cy-element-ui 1.1.7 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/lib/index.js +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/subTitle.css +0 -0
- package/lib/theme-chalk/tabDialog.css +0 -1
- package/lib/theme-chalk/treeSelect.css +0 -1
- package/lib/theme-cy/base.css +1 -0
- package/lib/theme-cy/element.css +1 -0
- package/lib/theme-cy/index.css +1 -0
- package/lib/theme-cy/subTitle.css +1 -0
- package/lib/theme-cy/tabDialog.css +1 -0
- package/lib/theme-cy/treeSelect.css +1 -0
- package/package.json +2 -2
- package/packages/subTitle/index.js +7 -0
- package/packages/subTitle/src/main.vue +36 -0
- package/packages/tabDialog/src/dialog/drag.js +63 -63
- package/packages/theme-chalk/src/index.scss +1 -0
- package/packages/theme-chalk/src/subTitle.scss +0 -0
- package/packages/theme-chalk/src/tabDialog.scss +0 -43
- package/packages/theme-chalk/src/treeSelect.scss +0 -98
- package/packages/theme-cy/gulpfile.js +19 -0
- package/packages/theme-cy/lib/base.css +1 -0
- package/packages/theme-cy/lib/element.css +1 -0
- package/packages/theme-cy/lib/index.css +1 -0
- package/packages/theme-cy/lib/subTitle.css +1 -0
- package/packages/theme-cy/lib/tabDialog.css +1 -0
- package/packages/theme-cy/lib/treeSelect.css +1 -0
- package/packages/theme-cy/package.json +9 -0
- package/packages/theme-cy/src/base.scss +3 -0
- package/packages/theme-cy/src/element.scss +12 -0
- package/packages/theme-cy/src/index.scss +4 -0
- package/packages/theme-cy/src/subTitle.scss +26 -0
- package/packages/theme-cy/src/tabDialog.scss +43 -0
- package/packages/theme-cy/src/treeSelect.scss +131 -0
- package/src/index.js +12 -4
- package/lib/alert.js +0 -420
- package/lib/aside.js +0 -277
- package/lib/autocomplete.js +0 -952
- package/lib/avatar.js +0 -363
- package/lib/backtop.js +0 -404
- package/lib/badge.js +0 -334
- package/lib/breadcrumb-item.js +0 -322
- package/lib/breadcrumb.js +0 -293
- package/lib/button-group.js +0 -262
- package/lib/button.js +0 -357
- package/lib/calendar.js +0 -933
- package/lib/card.js +0 -297
- package/lib/carousel-item.js +0 -434
- package/lib/carousel.js +0 -707
- package/lib/cascader-panel.js +0 -1558
- package/lib/cascader.js +0 -1439
- package/lib/checkbox-button.js +0 -583
- package/lib/checkbox-group.js +0 -313
- package/lib/checkbox.js +0 -627
- package/lib/col.js +0 -177
- package/lib/collapse-item.js +0 -497
- package/lib/collapse.js +0 -329
- package/lib/color-picker.js +0 -1943
- package/lib/container.js +0 -288
- package/lib/date-picker.js +0 -6336
- package/lib/descriptions-item.js +0 -140
- package/lib/descriptions.js +0 -457
- package/lib/dialog.js +0 -598
- package/lib/directives/mousewheel.js +0 -26
- package/lib/directives/repeat-click.js +0 -33
- package/lib/divider.js +0 -313
- package/lib/drawer.js +0 -592
- package/lib/dropdown-item.js +0 -316
- package/lib/dropdown-menu.js +0 -351
- package/lib/dropdown.js +0 -643
- package/lib/element-ui.common.js +0 -44659
- package/lib/empty.js +0 -730
- package/lib/footer.js +0 -277
- package/lib/form-item.js +0 -826
- package/lib/form.js +0 -466
- package/lib/header.js +0 -277
- package/lib/icon.js +0 -265
- package/lib/image.js +0 -1138
- package/lib/infinite-scroll.js +0 -301
- package/lib/input-number.js +0 -757
- package/lib/input.js +0 -998
- package/lib/link.js +0 -332
- package/lib/loading.js +0 -631
- package/lib/locale/format.js +0 -56
- package/lib/locale/index.js +0 -63
- package/lib/locale/lang/en.js +0 -126
- package/lib/locale/lang/zh-CN.js +0 -126
- package/lib/locale/lang/zh-TW.js +0 -126
- package/lib/main.js +0 -264
- package/lib/menu-item-group.js +0 -308
- package/lib/menu-item.js +0 -491
- package/lib/menu.js +0 -865
- package/lib/message-box.js +0 -1192
- package/lib/message.js +0 -548
- package/lib/mixins/emitter.js +0 -36
- package/lib/mixins/focus.js +0 -15
- package/lib/mixins/locale.js +0 -17
- package/lib/mixins/migrating.js +0 -69
- package/lib/notification.js +0 -615
- package/lib/option-group.js +0 -344
- package/lib/option.js +0 -474
- package/lib/page-header.js +0 -319
- package/lib/pagination.js +0 -950
- package/lib/popconfirm.js +0 -457
- package/lib/popover.js +0 -617
- package/lib/progress.js +0 -595
- package/lib/radio-button.js +0 -463
- package/lib/radio-group.js +0 -391
- package/lib/radio.js +0 -497
- package/lib/rate.js +0 -670
- package/lib/result.js +0 -578
- package/lib/row.js +0 -149
- package/lib/scrollbar.js +0 -423
- package/lib/select.js +0 -2167
- package/lib/skeleton-item.js +0 -342
- package/lib/skeleton.js +0 -372
- package/lib/slider.js +0 -1199
- package/lib/spinner.js +0 -301
- package/lib/statistic.js +0 -533
- package/lib/step.js +0 -522
- package/lib/steps.js +0 -342
- package/lib/submenu.js +0 -701
- package/lib/switch.js +0 -554
- package/lib/tab-pane.js +0 -332
- package/lib/tabDialog.js +0 -1184
- package/lib/table-column.js +0 -952
- package/lib/table.js +0 -5011
- package/lib/tabs.js +0 -920
- package/lib/tag.js +0 -304
- package/lib/time-picker.js +0 -2967
- package/lib/time-select.js +0 -1765
- package/lib/timeline-item.js +0 -371
- package/lib/timeline.js +0 -275
- package/lib/tooltip.js +0 -425
- package/lib/transfer.js +0 -1102
- package/lib/transitions/collapse-transition.js +0 -91
- package/lib/tree.js +0 -2263
- package/lib/treeSelect.js +0 -746
- package/lib/umd/locale/en.js +0 -142
- package/lib/umd/locale/zh-CN.js +0 -142
- package/lib/umd/locale/zh-TW.js +0 -142
- package/lib/upload.js +0 -1390
- package/lib/utils/after-leave.js +0 -35
- package/lib/utils/aria-dialog.js +0 -104
- package/lib/utils/aria-utils.js +0 -126
- package/lib/utils/clickoutside.js +0 -79
- package/lib/utils/date-util.js +0 -310
- package/lib/utils/date.js +0 -369
- package/lib/utils/dom.js +0 -234
- package/lib/utils/lodash.js +0 -9421
- package/lib/utils/menu/aria-menubar.js +0 -24
- package/lib/utils/menu/aria-menuitem.js +0 -62
- package/lib/utils/menu/aria-submenu.js +0 -69
- package/lib/utils/merge.js +0 -21
- package/lib/utils/popper.js +0 -1261
- package/lib/utils/popup/index.js +0 -233
- package/lib/utils/popup/popup-manager.js +0 -205
- package/lib/utils/resize-event.js +0 -59
- package/lib/utils/scroll-into-view.js +0 -38
- package/lib/utils/scrollbar-width.js +0 -39
- package/lib/utils/shared.js +0 -12
- package/lib/utils/types.js +0 -52
- package/lib/utils/util.js +0 -272
- package/lib/utils/vdom.js +0 -13
- package/lib/utils/vue-popper.js +0 -202
package/lib/slider.js
DELETED
|
@@ -1,1199 +0,0 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
-
/******/ // The module cache
|
|
4
|
-
/******/ var installedModules = {};
|
|
5
|
-
/******/
|
|
6
|
-
/******/ // The require function
|
|
7
|
-
/******/ function __webpack_require__(moduleId) {
|
|
8
|
-
/******/
|
|
9
|
-
/******/ // Check if module is in cache
|
|
10
|
-
/******/ if(installedModules[moduleId]) {
|
|
11
|
-
/******/ return installedModules[moduleId].exports;
|
|
12
|
-
/******/ }
|
|
13
|
-
/******/ // Create a new module (and put it into the cache)
|
|
14
|
-
/******/ var module = installedModules[moduleId] = {
|
|
15
|
-
/******/ i: moduleId,
|
|
16
|
-
/******/ l: false,
|
|
17
|
-
/******/ exports: {}
|
|
18
|
-
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/ // Execute the module function
|
|
21
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
-
/******/
|
|
23
|
-
/******/ // Flag the module as loaded
|
|
24
|
-
/******/ module.l = true;
|
|
25
|
-
/******/
|
|
26
|
-
/******/ // Return the exports of the module
|
|
27
|
-
/******/ return module.exports;
|
|
28
|
-
/******/ }
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
-
/******/ __webpack_require__.m = modules;
|
|
33
|
-
/******/
|
|
34
|
-
/******/ // expose the module cache
|
|
35
|
-
/******/ __webpack_require__.c = installedModules;
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "/dist/";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 65);
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ({
|
|
89
|
-
|
|
90
|
-
/***/ 0:
|
|
91
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
|
-
|
|
93
|
-
"use strict";
|
|
94
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
|
95
|
-
/* globals __VUE_SSR_CONTEXT__ */
|
|
96
|
-
|
|
97
|
-
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
98
|
-
// This module is a runtime utility for cleaner component module output and will
|
|
99
|
-
// be included in the final webpack user bundle.
|
|
100
|
-
|
|
101
|
-
function normalizeComponent(
|
|
102
|
-
scriptExports,
|
|
103
|
-
render,
|
|
104
|
-
staticRenderFns,
|
|
105
|
-
functionalTemplate,
|
|
106
|
-
injectStyles,
|
|
107
|
-
scopeId,
|
|
108
|
-
moduleIdentifier /* server only */,
|
|
109
|
-
shadowMode /* vue-cli only */
|
|
110
|
-
) {
|
|
111
|
-
// Vue.extend constructor export interop
|
|
112
|
-
var options =
|
|
113
|
-
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
114
|
-
|
|
115
|
-
// render functions
|
|
116
|
-
if (render) {
|
|
117
|
-
options.render = render
|
|
118
|
-
options.staticRenderFns = staticRenderFns
|
|
119
|
-
options._compiled = true
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// functional template
|
|
123
|
-
if (functionalTemplate) {
|
|
124
|
-
options.functional = true
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// scopedId
|
|
128
|
-
if (scopeId) {
|
|
129
|
-
options._scopeId = 'data-v-' + scopeId
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var hook
|
|
133
|
-
if (moduleIdentifier) {
|
|
134
|
-
// server build
|
|
135
|
-
hook = function (context) {
|
|
136
|
-
// 2.3 injection
|
|
137
|
-
context =
|
|
138
|
-
context || // cached call
|
|
139
|
-
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
140
|
-
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
141
|
-
// 2.2 with runInNewContext: true
|
|
142
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
143
|
-
context = __VUE_SSR_CONTEXT__
|
|
144
|
-
}
|
|
145
|
-
// inject component styles
|
|
146
|
-
if (injectStyles) {
|
|
147
|
-
injectStyles.call(this, context)
|
|
148
|
-
}
|
|
149
|
-
// register component module identifier for async chunk inferrence
|
|
150
|
-
if (context && context._registeredComponents) {
|
|
151
|
-
context._registeredComponents.add(moduleIdentifier)
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
// used by ssr in case component is cached and beforeCreate
|
|
155
|
-
// never gets called
|
|
156
|
-
options._ssrRegister = hook
|
|
157
|
-
} else if (injectStyles) {
|
|
158
|
-
hook = shadowMode
|
|
159
|
-
? function () {
|
|
160
|
-
injectStyles.call(
|
|
161
|
-
this,
|
|
162
|
-
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
: injectStyles
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (hook) {
|
|
169
|
-
if (options.functional) {
|
|
170
|
-
// for template-only hot-reload because in that case the render fn doesn't
|
|
171
|
-
// go through the normalizer
|
|
172
|
-
options._injectStyles = hook
|
|
173
|
-
// register for functional component in vue file
|
|
174
|
-
var originalRender = options.render
|
|
175
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
176
|
-
hook.call(context)
|
|
177
|
-
return originalRender(h, context)
|
|
178
|
-
}
|
|
179
|
-
} else {
|
|
180
|
-
// inject component registration as beforeCreate hook
|
|
181
|
-
var existing = options.beforeCreate
|
|
182
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return {
|
|
187
|
-
exports: scriptExports,
|
|
188
|
-
options: options
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
/***/ }),
|
|
194
|
-
|
|
195
|
-
/***/ 29:
|
|
196
|
-
/***/ (function(module, exports) {
|
|
197
|
-
|
|
198
|
-
module.exports = require("element-ui/lib/tooltip");
|
|
199
|
-
|
|
200
|
-
/***/ }),
|
|
201
|
-
|
|
202
|
-
/***/ 4:
|
|
203
|
-
/***/ (function(module, exports) {
|
|
204
|
-
|
|
205
|
-
module.exports = require("element-ui/lib/mixins/emitter");
|
|
206
|
-
|
|
207
|
-
/***/ }),
|
|
208
|
-
|
|
209
|
-
/***/ 52:
|
|
210
|
-
/***/ (function(module, exports) {
|
|
211
|
-
|
|
212
|
-
module.exports = require("element-ui/lib/input-number");
|
|
213
|
-
|
|
214
|
-
/***/ }),
|
|
215
|
-
|
|
216
|
-
/***/ 65:
|
|
217
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
218
|
-
|
|
219
|
-
"use strict";
|
|
220
|
-
// ESM COMPAT FLAG
|
|
221
|
-
__webpack_require__.r(__webpack_exports__);
|
|
222
|
-
|
|
223
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/main.vue?vue&type=template&id=1c6449fc
|
|
224
|
-
var render = function () {
|
|
225
|
-
var _vm = this
|
|
226
|
-
var _h = _vm.$createElement
|
|
227
|
-
var _c = _vm._self._c || _h
|
|
228
|
-
return _c(
|
|
229
|
-
"div",
|
|
230
|
-
{
|
|
231
|
-
staticClass: "el-slider",
|
|
232
|
-
class: {
|
|
233
|
-
"is-vertical": _vm.vertical,
|
|
234
|
-
"el-slider--with-input": _vm.showInput,
|
|
235
|
-
},
|
|
236
|
-
attrs: {
|
|
237
|
-
role: "slider",
|
|
238
|
-
"aria-valuemin": _vm.min,
|
|
239
|
-
"aria-valuemax": _vm.max,
|
|
240
|
-
"aria-orientation": _vm.vertical ? "vertical" : "horizontal",
|
|
241
|
-
"aria-disabled": _vm.sliderDisabled,
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
[
|
|
245
|
-
_vm.showInput && !_vm.range
|
|
246
|
-
? _c("el-input-number", {
|
|
247
|
-
ref: "input",
|
|
248
|
-
staticClass: "el-slider__input",
|
|
249
|
-
attrs: {
|
|
250
|
-
step: _vm.step,
|
|
251
|
-
disabled: _vm.sliderDisabled,
|
|
252
|
-
controls: _vm.showInputControls,
|
|
253
|
-
min: _vm.min,
|
|
254
|
-
max: _vm.max,
|
|
255
|
-
debounce: _vm.debounce,
|
|
256
|
-
size: _vm.inputSize,
|
|
257
|
-
},
|
|
258
|
-
on: { change: _vm.emitChange },
|
|
259
|
-
model: {
|
|
260
|
-
value: _vm.firstValue,
|
|
261
|
-
callback: function ($$v) {
|
|
262
|
-
_vm.firstValue = $$v
|
|
263
|
-
},
|
|
264
|
-
expression: "firstValue",
|
|
265
|
-
},
|
|
266
|
-
})
|
|
267
|
-
: _vm._e(),
|
|
268
|
-
_c(
|
|
269
|
-
"div",
|
|
270
|
-
{
|
|
271
|
-
ref: "slider",
|
|
272
|
-
staticClass: "el-slider__runway",
|
|
273
|
-
class: { "show-input": _vm.showInput, disabled: _vm.sliderDisabled },
|
|
274
|
-
style: _vm.runwayStyle,
|
|
275
|
-
on: { click: _vm.onSliderClick },
|
|
276
|
-
},
|
|
277
|
-
[
|
|
278
|
-
_c("div", { staticClass: "el-slider__bar", style: _vm.barStyle }),
|
|
279
|
-
_c("slider-button", {
|
|
280
|
-
ref: "button1",
|
|
281
|
-
attrs: {
|
|
282
|
-
vertical: _vm.vertical,
|
|
283
|
-
"tooltip-class": _vm.tooltipClass,
|
|
284
|
-
},
|
|
285
|
-
model: {
|
|
286
|
-
value: _vm.firstValue,
|
|
287
|
-
callback: function ($$v) {
|
|
288
|
-
_vm.firstValue = $$v
|
|
289
|
-
},
|
|
290
|
-
expression: "firstValue",
|
|
291
|
-
},
|
|
292
|
-
}),
|
|
293
|
-
_vm.range
|
|
294
|
-
? _c("slider-button", {
|
|
295
|
-
ref: "button2",
|
|
296
|
-
attrs: {
|
|
297
|
-
vertical: _vm.vertical,
|
|
298
|
-
"tooltip-class": _vm.tooltipClass,
|
|
299
|
-
},
|
|
300
|
-
model: {
|
|
301
|
-
value: _vm.secondValue,
|
|
302
|
-
callback: function ($$v) {
|
|
303
|
-
_vm.secondValue = $$v
|
|
304
|
-
},
|
|
305
|
-
expression: "secondValue",
|
|
306
|
-
},
|
|
307
|
-
})
|
|
308
|
-
: _vm._e(),
|
|
309
|
-
_vm._l(_vm.stops, function (item, key) {
|
|
310
|
-
return _vm.showStops
|
|
311
|
-
? _c("div", {
|
|
312
|
-
key: key,
|
|
313
|
-
staticClass: "el-slider__stop",
|
|
314
|
-
style: _vm.getStopStyle(item),
|
|
315
|
-
})
|
|
316
|
-
: _vm._e()
|
|
317
|
-
}),
|
|
318
|
-
_vm.markList.length > 0
|
|
319
|
-
? [
|
|
320
|
-
_c(
|
|
321
|
-
"div",
|
|
322
|
-
_vm._l(_vm.markList, function (item, key) {
|
|
323
|
-
return _c("div", {
|
|
324
|
-
key: key,
|
|
325
|
-
staticClass: "el-slider__stop el-slider__marks-stop",
|
|
326
|
-
style: _vm.getStopStyle(item.position),
|
|
327
|
-
})
|
|
328
|
-
}),
|
|
329
|
-
0
|
|
330
|
-
),
|
|
331
|
-
_c(
|
|
332
|
-
"div",
|
|
333
|
-
{ staticClass: "el-slider__marks" },
|
|
334
|
-
_vm._l(_vm.markList, function (item, key) {
|
|
335
|
-
return _c("slider-marker", {
|
|
336
|
-
key: key,
|
|
337
|
-
style: _vm.getStopStyle(item.position),
|
|
338
|
-
attrs: { mark: item.mark },
|
|
339
|
-
})
|
|
340
|
-
}),
|
|
341
|
-
1
|
|
342
|
-
),
|
|
343
|
-
]
|
|
344
|
-
: _vm._e(),
|
|
345
|
-
],
|
|
346
|
-
2
|
|
347
|
-
),
|
|
348
|
-
],
|
|
349
|
-
1
|
|
350
|
-
)
|
|
351
|
-
}
|
|
352
|
-
var staticRenderFns = []
|
|
353
|
-
render._withStripped = true
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
// CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=template&id=1c6449fc
|
|
357
|
-
|
|
358
|
-
// EXTERNAL MODULE: external "element-ui/lib/input-number"
|
|
359
|
-
var input_number_ = __webpack_require__(52);
|
|
360
|
-
var input_number_default = /*#__PURE__*/__webpack_require__.n(input_number_);
|
|
361
|
-
|
|
362
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/button.vue?vue&type=template&id=2c1bd88a
|
|
363
|
-
var buttonvue_type_template_id_2c1bd88a_render = function () {
|
|
364
|
-
var _vm = this
|
|
365
|
-
var _h = _vm.$createElement
|
|
366
|
-
var _c = _vm._self._c || _h
|
|
367
|
-
return _c(
|
|
368
|
-
"div",
|
|
369
|
-
{
|
|
370
|
-
ref: "button",
|
|
371
|
-
staticClass: "el-slider__button-wrapper",
|
|
372
|
-
class: { hover: _vm.hovering, dragging: _vm.dragging },
|
|
373
|
-
style: _vm.wrapperStyle,
|
|
374
|
-
attrs: { tabindex: "0" },
|
|
375
|
-
on: {
|
|
376
|
-
mouseenter: _vm.handleMouseEnter,
|
|
377
|
-
mouseleave: _vm.handleMouseLeave,
|
|
378
|
-
mousedown: _vm.onButtonDown,
|
|
379
|
-
touchstart: _vm.onButtonDown,
|
|
380
|
-
focus: _vm.handleMouseEnter,
|
|
381
|
-
blur: _vm.handleMouseLeave,
|
|
382
|
-
keydown: [
|
|
383
|
-
function ($event) {
|
|
384
|
-
if (
|
|
385
|
-
!("button" in $event) &&
|
|
386
|
-
_vm._k($event.keyCode, "left", 37, $event.key, [
|
|
387
|
-
"Left",
|
|
388
|
-
"ArrowLeft",
|
|
389
|
-
])
|
|
390
|
-
) {
|
|
391
|
-
return null
|
|
392
|
-
}
|
|
393
|
-
if ("button" in $event && $event.button !== 0) {
|
|
394
|
-
return null
|
|
395
|
-
}
|
|
396
|
-
return _vm.onLeftKeyDown($event)
|
|
397
|
-
},
|
|
398
|
-
function ($event) {
|
|
399
|
-
if (
|
|
400
|
-
!("button" in $event) &&
|
|
401
|
-
_vm._k($event.keyCode, "right", 39, $event.key, [
|
|
402
|
-
"Right",
|
|
403
|
-
"ArrowRight",
|
|
404
|
-
])
|
|
405
|
-
) {
|
|
406
|
-
return null
|
|
407
|
-
}
|
|
408
|
-
if ("button" in $event && $event.button !== 2) {
|
|
409
|
-
return null
|
|
410
|
-
}
|
|
411
|
-
return _vm.onRightKeyDown($event)
|
|
412
|
-
},
|
|
413
|
-
function ($event) {
|
|
414
|
-
if (
|
|
415
|
-
!("button" in $event) &&
|
|
416
|
-
_vm._k($event.keyCode, "down", 40, $event.key, [
|
|
417
|
-
"Down",
|
|
418
|
-
"ArrowDown",
|
|
419
|
-
])
|
|
420
|
-
) {
|
|
421
|
-
return null
|
|
422
|
-
}
|
|
423
|
-
$event.preventDefault()
|
|
424
|
-
return _vm.onLeftKeyDown($event)
|
|
425
|
-
},
|
|
426
|
-
function ($event) {
|
|
427
|
-
if (
|
|
428
|
-
!("button" in $event) &&
|
|
429
|
-
_vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
|
|
430
|
-
) {
|
|
431
|
-
return null
|
|
432
|
-
}
|
|
433
|
-
$event.preventDefault()
|
|
434
|
-
return _vm.onRightKeyDown($event)
|
|
435
|
-
},
|
|
436
|
-
],
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
[
|
|
440
|
-
_c(
|
|
441
|
-
"el-tooltip",
|
|
442
|
-
{
|
|
443
|
-
ref: "tooltip",
|
|
444
|
-
attrs: {
|
|
445
|
-
placement: "top",
|
|
446
|
-
"popper-class": _vm.tooltipClass,
|
|
447
|
-
disabled: !_vm.showTooltip,
|
|
448
|
-
},
|
|
449
|
-
},
|
|
450
|
-
[
|
|
451
|
-
_c("span", { attrs: { slot: "content" }, slot: "content" }, [
|
|
452
|
-
_vm._v(_vm._s(_vm.formatValue)),
|
|
453
|
-
]),
|
|
454
|
-
_c("div", {
|
|
455
|
-
staticClass: "el-slider__button",
|
|
456
|
-
class: { hover: _vm.hovering, dragging: _vm.dragging },
|
|
457
|
-
}),
|
|
458
|
-
]
|
|
459
|
-
),
|
|
460
|
-
],
|
|
461
|
-
1
|
|
462
|
-
)
|
|
463
|
-
}
|
|
464
|
-
var buttonvue_type_template_id_2c1bd88a_staticRenderFns = []
|
|
465
|
-
buttonvue_type_template_id_2c1bd88a_render._withStripped = true
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
// CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=template&id=2c1bd88a
|
|
469
|
-
|
|
470
|
-
// EXTERNAL MODULE: external "element-ui/lib/tooltip"
|
|
471
|
-
var tooltip_ = __webpack_require__(29);
|
|
472
|
-
var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip_);
|
|
473
|
-
|
|
474
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/button.vue?vue&type=script&lang=js
|
|
475
|
-
//
|
|
476
|
-
//
|
|
477
|
-
//
|
|
478
|
-
//
|
|
479
|
-
//
|
|
480
|
-
//
|
|
481
|
-
//
|
|
482
|
-
//
|
|
483
|
-
//
|
|
484
|
-
//
|
|
485
|
-
//
|
|
486
|
-
//
|
|
487
|
-
//
|
|
488
|
-
//
|
|
489
|
-
//
|
|
490
|
-
//
|
|
491
|
-
//
|
|
492
|
-
//
|
|
493
|
-
//
|
|
494
|
-
//
|
|
495
|
-
//
|
|
496
|
-
//
|
|
497
|
-
//
|
|
498
|
-
//
|
|
499
|
-
//
|
|
500
|
-
//
|
|
501
|
-
//
|
|
502
|
-
//
|
|
503
|
-
//
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
/* harmony default export */ var buttonvue_type_script_lang_js = ({
|
|
508
|
-
name: 'ElSliderButton',
|
|
509
|
-
|
|
510
|
-
components: {
|
|
511
|
-
ElTooltip: tooltip_default.a
|
|
512
|
-
},
|
|
513
|
-
|
|
514
|
-
props: {
|
|
515
|
-
value: {
|
|
516
|
-
type: Number,
|
|
517
|
-
default: 0
|
|
518
|
-
},
|
|
519
|
-
vertical: {
|
|
520
|
-
type: Boolean,
|
|
521
|
-
default: false
|
|
522
|
-
},
|
|
523
|
-
tooltipClass: String
|
|
524
|
-
},
|
|
525
|
-
|
|
526
|
-
data: function data() {
|
|
527
|
-
return {
|
|
528
|
-
hovering: false,
|
|
529
|
-
dragging: false,
|
|
530
|
-
isClick: false,
|
|
531
|
-
startX: 0,
|
|
532
|
-
currentX: 0,
|
|
533
|
-
startY: 0,
|
|
534
|
-
currentY: 0,
|
|
535
|
-
startPosition: 0,
|
|
536
|
-
newPosition: null,
|
|
537
|
-
oldValue: this.value
|
|
538
|
-
};
|
|
539
|
-
},
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
computed: {
|
|
543
|
-
disabled: function disabled() {
|
|
544
|
-
return this.$parent.sliderDisabled;
|
|
545
|
-
},
|
|
546
|
-
max: function max() {
|
|
547
|
-
return this.$parent.max;
|
|
548
|
-
},
|
|
549
|
-
min: function min() {
|
|
550
|
-
return this.$parent.min;
|
|
551
|
-
},
|
|
552
|
-
step: function step() {
|
|
553
|
-
return this.$parent.step;
|
|
554
|
-
},
|
|
555
|
-
showTooltip: function showTooltip() {
|
|
556
|
-
return this.$parent.showTooltip;
|
|
557
|
-
},
|
|
558
|
-
precision: function precision() {
|
|
559
|
-
return this.$parent.precision;
|
|
560
|
-
},
|
|
561
|
-
currentPosition: function currentPosition() {
|
|
562
|
-
return (this.value - this.min) / (this.max - this.min) * 100 + '%';
|
|
563
|
-
},
|
|
564
|
-
enableFormat: function enableFormat() {
|
|
565
|
-
return this.$parent.formatTooltip instanceof Function;
|
|
566
|
-
},
|
|
567
|
-
formatValue: function formatValue() {
|
|
568
|
-
return this.enableFormat && this.$parent.formatTooltip(this.value) || this.value;
|
|
569
|
-
},
|
|
570
|
-
wrapperStyle: function wrapperStyle() {
|
|
571
|
-
return this.vertical ? { bottom: this.currentPosition } : { left: this.currentPosition };
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
watch: {
|
|
576
|
-
dragging: function dragging(val) {
|
|
577
|
-
this.$parent.dragging = val;
|
|
578
|
-
}
|
|
579
|
-
},
|
|
580
|
-
|
|
581
|
-
methods: {
|
|
582
|
-
displayTooltip: function displayTooltip() {
|
|
583
|
-
this.$refs.tooltip && (this.$refs.tooltip.showPopper = true);
|
|
584
|
-
},
|
|
585
|
-
hideTooltip: function hideTooltip() {
|
|
586
|
-
this.$refs.tooltip && (this.$refs.tooltip.showPopper = false);
|
|
587
|
-
},
|
|
588
|
-
handleMouseEnter: function handleMouseEnter() {
|
|
589
|
-
this.hovering = true;
|
|
590
|
-
this.displayTooltip();
|
|
591
|
-
},
|
|
592
|
-
handleMouseLeave: function handleMouseLeave() {
|
|
593
|
-
this.hovering = false;
|
|
594
|
-
this.hideTooltip();
|
|
595
|
-
},
|
|
596
|
-
onButtonDown: function onButtonDown(event) {
|
|
597
|
-
if (this.disabled) return;
|
|
598
|
-
event.preventDefault();
|
|
599
|
-
this.onDragStart(event);
|
|
600
|
-
window.addEventListener('mousemove', this.onDragging);
|
|
601
|
-
window.addEventListener('touchmove', this.onDragging);
|
|
602
|
-
window.addEventListener('mouseup', this.onDragEnd);
|
|
603
|
-
window.addEventListener('touchend', this.onDragEnd);
|
|
604
|
-
window.addEventListener('contextmenu', this.onDragEnd);
|
|
605
|
-
},
|
|
606
|
-
onLeftKeyDown: function onLeftKeyDown() {
|
|
607
|
-
if (this.disabled) return;
|
|
608
|
-
this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
|
|
609
|
-
this.setPosition(this.newPosition);
|
|
610
|
-
this.$parent.emitChange();
|
|
611
|
-
},
|
|
612
|
-
onRightKeyDown: function onRightKeyDown() {
|
|
613
|
-
if (this.disabled) return;
|
|
614
|
-
this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
|
|
615
|
-
this.setPosition(this.newPosition);
|
|
616
|
-
this.$parent.emitChange();
|
|
617
|
-
},
|
|
618
|
-
onDragStart: function onDragStart(event) {
|
|
619
|
-
this.dragging = true;
|
|
620
|
-
this.isClick = true;
|
|
621
|
-
if (event.type === 'touchstart') {
|
|
622
|
-
event.clientY = event.touches[0].clientY;
|
|
623
|
-
event.clientX = event.touches[0].clientX;
|
|
624
|
-
}
|
|
625
|
-
if (this.vertical) {
|
|
626
|
-
this.startY = event.clientY;
|
|
627
|
-
} else {
|
|
628
|
-
this.startX = event.clientX;
|
|
629
|
-
}
|
|
630
|
-
this.startPosition = parseFloat(this.currentPosition);
|
|
631
|
-
this.newPosition = this.startPosition;
|
|
632
|
-
},
|
|
633
|
-
onDragging: function onDragging(event) {
|
|
634
|
-
if (this.dragging) {
|
|
635
|
-
this.isClick = false;
|
|
636
|
-
this.displayTooltip();
|
|
637
|
-
this.$parent.resetSize();
|
|
638
|
-
var diff = 0;
|
|
639
|
-
if (event.type === 'touchmove') {
|
|
640
|
-
event.clientY = event.touches[0].clientY;
|
|
641
|
-
event.clientX = event.touches[0].clientX;
|
|
642
|
-
}
|
|
643
|
-
if (this.vertical) {
|
|
644
|
-
this.currentY = event.clientY;
|
|
645
|
-
diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
|
|
646
|
-
} else {
|
|
647
|
-
this.currentX = event.clientX;
|
|
648
|
-
diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
|
|
649
|
-
}
|
|
650
|
-
this.newPosition = this.startPosition + diff;
|
|
651
|
-
this.setPosition(this.newPosition);
|
|
652
|
-
}
|
|
653
|
-
},
|
|
654
|
-
onDragEnd: function onDragEnd() {
|
|
655
|
-
var _this = this;
|
|
656
|
-
|
|
657
|
-
if (this.dragging) {
|
|
658
|
-
/*
|
|
659
|
-
* 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
|
|
660
|
-
* 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
|
|
661
|
-
*/
|
|
662
|
-
setTimeout(function () {
|
|
663
|
-
_this.dragging = false;
|
|
664
|
-
_this.hideTooltip();
|
|
665
|
-
if (!_this.isClick) {
|
|
666
|
-
_this.setPosition(_this.newPosition);
|
|
667
|
-
_this.$parent.emitChange();
|
|
668
|
-
}
|
|
669
|
-
}, 0);
|
|
670
|
-
window.removeEventListener('mousemove', this.onDragging);
|
|
671
|
-
window.removeEventListener('touchmove', this.onDragging);
|
|
672
|
-
window.removeEventListener('mouseup', this.onDragEnd);
|
|
673
|
-
window.removeEventListener('touchend', this.onDragEnd);
|
|
674
|
-
window.removeEventListener('contextmenu', this.onDragEnd);
|
|
675
|
-
}
|
|
676
|
-
},
|
|
677
|
-
setPosition: function setPosition(newPosition) {
|
|
678
|
-
var _this2 = this;
|
|
679
|
-
|
|
680
|
-
if (newPosition === null || isNaN(newPosition)) return;
|
|
681
|
-
if (newPosition < 0) {
|
|
682
|
-
newPosition = 0;
|
|
683
|
-
} else if (newPosition > 100) {
|
|
684
|
-
newPosition = 100;
|
|
685
|
-
}
|
|
686
|
-
var lengthPerStep = 100 / ((this.max - this.min) / this.step);
|
|
687
|
-
var steps = Math.round(newPosition / lengthPerStep);
|
|
688
|
-
var value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
|
|
689
|
-
value = parseFloat(value.toFixed(this.precision));
|
|
690
|
-
this.$emit('input', value);
|
|
691
|
-
this.$nextTick(function () {
|
|
692
|
-
_this2.displayTooltip();
|
|
693
|
-
_this2.$refs.tooltip && _this2.$refs.tooltip.updatePopper();
|
|
694
|
-
});
|
|
695
|
-
if (!this.dragging && this.value !== this.oldValue) {
|
|
696
|
-
this.oldValue = this.value;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
// CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=script&lang=js
|
|
702
|
-
/* harmony default export */ var src_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
|
|
703
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
704
|
-
var componentNormalizer = __webpack_require__(0);
|
|
705
|
-
|
|
706
|
-
// CONCATENATED MODULE: ./packages/slider/src/button.vue
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
/* normalize component */
|
|
713
|
-
|
|
714
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
715
|
-
src_buttonvue_type_script_lang_js,
|
|
716
|
-
buttonvue_type_template_id_2c1bd88a_render,
|
|
717
|
-
buttonvue_type_template_id_2c1bd88a_staticRenderFns,
|
|
718
|
-
false,
|
|
719
|
-
null,
|
|
720
|
-
null,
|
|
721
|
-
null
|
|
722
|
-
|
|
723
|
-
)
|
|
724
|
-
|
|
725
|
-
/* harmony default export */ var src_button = (component.exports);
|
|
726
|
-
// CONCATENATED MODULE: ./packages/slider/src/marker.js
|
|
727
|
-
/* harmony default export */ var marker = ({
|
|
728
|
-
name: 'ElMarker',
|
|
729
|
-
|
|
730
|
-
props: {
|
|
731
|
-
mark: {
|
|
732
|
-
type: [String, Object]
|
|
733
|
-
}
|
|
734
|
-
},
|
|
735
|
-
render: function render() {
|
|
736
|
-
var h = arguments[0];
|
|
737
|
-
|
|
738
|
-
var label = typeof this.mark === 'string' ? this.mark : this.mark.label;
|
|
739
|
-
|
|
740
|
-
return h(
|
|
741
|
-
'div',
|
|
742
|
-
{ 'class': 'el-slider__marks-text', style: this.mark.style || {} },
|
|
743
|
-
[label]
|
|
744
|
-
);
|
|
745
|
-
}
|
|
746
|
-
});
|
|
747
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
|
|
748
|
-
var emitter_ = __webpack_require__(4);
|
|
749
|
-
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
750
|
-
|
|
751
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/main.vue?vue&type=script&lang=js
|
|
752
|
-
//
|
|
753
|
-
//
|
|
754
|
-
//
|
|
755
|
-
//
|
|
756
|
-
//
|
|
757
|
-
//
|
|
758
|
-
//
|
|
759
|
-
//
|
|
760
|
-
//
|
|
761
|
-
//
|
|
762
|
-
//
|
|
763
|
-
//
|
|
764
|
-
//
|
|
765
|
-
//
|
|
766
|
-
//
|
|
767
|
-
//
|
|
768
|
-
//
|
|
769
|
-
//
|
|
770
|
-
//
|
|
771
|
-
//
|
|
772
|
-
//
|
|
773
|
-
//
|
|
774
|
-
//
|
|
775
|
-
//
|
|
776
|
-
//
|
|
777
|
-
//
|
|
778
|
-
//
|
|
779
|
-
//
|
|
780
|
-
//
|
|
781
|
-
//
|
|
782
|
-
//
|
|
783
|
-
//
|
|
784
|
-
//
|
|
785
|
-
//
|
|
786
|
-
//
|
|
787
|
-
//
|
|
788
|
-
//
|
|
789
|
-
//
|
|
790
|
-
//
|
|
791
|
-
//
|
|
792
|
-
//
|
|
793
|
-
//
|
|
794
|
-
//
|
|
795
|
-
//
|
|
796
|
-
//
|
|
797
|
-
//
|
|
798
|
-
//
|
|
799
|
-
//
|
|
800
|
-
//
|
|
801
|
-
//
|
|
802
|
-
//
|
|
803
|
-
//
|
|
804
|
-
//
|
|
805
|
-
//
|
|
806
|
-
//
|
|
807
|
-
//
|
|
808
|
-
//
|
|
809
|
-
//
|
|
810
|
-
//
|
|
811
|
-
//
|
|
812
|
-
//
|
|
813
|
-
//
|
|
814
|
-
//
|
|
815
|
-
//
|
|
816
|
-
//
|
|
817
|
-
//
|
|
818
|
-
//
|
|
819
|
-
//
|
|
820
|
-
//
|
|
821
|
-
//
|
|
822
|
-
//
|
|
823
|
-
//
|
|
824
|
-
//
|
|
825
|
-
//
|
|
826
|
-
//
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
/* harmony default export */ var mainvue_type_script_lang_js = ({
|
|
834
|
-
name: 'ElSlider',
|
|
835
|
-
|
|
836
|
-
mixins: [emitter_default.a],
|
|
837
|
-
|
|
838
|
-
inject: {
|
|
839
|
-
elForm: {
|
|
840
|
-
default: ''
|
|
841
|
-
}
|
|
842
|
-
},
|
|
843
|
-
|
|
844
|
-
props: {
|
|
845
|
-
min: {
|
|
846
|
-
type: Number,
|
|
847
|
-
default: 0
|
|
848
|
-
},
|
|
849
|
-
max: {
|
|
850
|
-
type: Number,
|
|
851
|
-
default: 100
|
|
852
|
-
},
|
|
853
|
-
step: {
|
|
854
|
-
type: Number,
|
|
855
|
-
default: 1
|
|
856
|
-
},
|
|
857
|
-
value: {
|
|
858
|
-
type: [Number, Array],
|
|
859
|
-
default: 0
|
|
860
|
-
},
|
|
861
|
-
showInput: {
|
|
862
|
-
type: Boolean,
|
|
863
|
-
default: false
|
|
864
|
-
},
|
|
865
|
-
showInputControls: {
|
|
866
|
-
type: Boolean,
|
|
867
|
-
default: true
|
|
868
|
-
},
|
|
869
|
-
inputSize: {
|
|
870
|
-
type: String,
|
|
871
|
-
default: 'small'
|
|
872
|
-
},
|
|
873
|
-
showStops: {
|
|
874
|
-
type: Boolean,
|
|
875
|
-
default: false
|
|
876
|
-
},
|
|
877
|
-
showTooltip: {
|
|
878
|
-
type: Boolean,
|
|
879
|
-
default: true
|
|
880
|
-
},
|
|
881
|
-
formatTooltip: Function,
|
|
882
|
-
disabled: {
|
|
883
|
-
type: Boolean,
|
|
884
|
-
default: false
|
|
885
|
-
},
|
|
886
|
-
range: {
|
|
887
|
-
type: Boolean,
|
|
888
|
-
default: false
|
|
889
|
-
},
|
|
890
|
-
vertical: {
|
|
891
|
-
type: Boolean,
|
|
892
|
-
default: false
|
|
893
|
-
},
|
|
894
|
-
height: {
|
|
895
|
-
type: String
|
|
896
|
-
},
|
|
897
|
-
debounce: {
|
|
898
|
-
type: Number,
|
|
899
|
-
default: 300
|
|
900
|
-
},
|
|
901
|
-
label: {
|
|
902
|
-
type: String
|
|
903
|
-
},
|
|
904
|
-
tooltipClass: String,
|
|
905
|
-
marks: Object
|
|
906
|
-
},
|
|
907
|
-
|
|
908
|
-
components: {
|
|
909
|
-
ElInputNumber: input_number_default.a,
|
|
910
|
-
SliderButton: src_button,
|
|
911
|
-
SliderMarker: marker
|
|
912
|
-
},
|
|
913
|
-
|
|
914
|
-
data: function data() {
|
|
915
|
-
return {
|
|
916
|
-
firstValue: null,
|
|
917
|
-
secondValue: null,
|
|
918
|
-
oldValue: null,
|
|
919
|
-
dragging: false,
|
|
920
|
-
sliderSize: 1
|
|
921
|
-
};
|
|
922
|
-
},
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
watch: {
|
|
926
|
-
value: function value(val, oldVal) {
|
|
927
|
-
if (this.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every(function (item, index) {
|
|
928
|
-
return item === oldVal[index];
|
|
929
|
-
})) {
|
|
930
|
-
return;
|
|
931
|
-
}
|
|
932
|
-
this.setValues();
|
|
933
|
-
},
|
|
934
|
-
dragging: function dragging(val) {
|
|
935
|
-
if (!val) {
|
|
936
|
-
this.setValues();
|
|
937
|
-
}
|
|
938
|
-
},
|
|
939
|
-
firstValue: function firstValue(val) {
|
|
940
|
-
if (this.range) {
|
|
941
|
-
this.$emit('input', [this.minValue, this.maxValue]);
|
|
942
|
-
} else {
|
|
943
|
-
this.$emit('input', val);
|
|
944
|
-
}
|
|
945
|
-
},
|
|
946
|
-
secondValue: function secondValue() {
|
|
947
|
-
if (this.range) {
|
|
948
|
-
this.$emit('input', [this.minValue, this.maxValue]);
|
|
949
|
-
}
|
|
950
|
-
},
|
|
951
|
-
min: function min() {
|
|
952
|
-
this.setValues();
|
|
953
|
-
},
|
|
954
|
-
max: function max() {
|
|
955
|
-
this.setValues();
|
|
956
|
-
}
|
|
957
|
-
},
|
|
958
|
-
|
|
959
|
-
methods: {
|
|
960
|
-
valueChanged: function valueChanged() {
|
|
961
|
-
var _this = this;
|
|
962
|
-
|
|
963
|
-
if (this.range) {
|
|
964
|
-
return ![this.minValue, this.maxValue].every(function (item, index) {
|
|
965
|
-
return item === _this.oldValue[index];
|
|
966
|
-
});
|
|
967
|
-
} else {
|
|
968
|
-
return this.value !== this.oldValue;
|
|
969
|
-
}
|
|
970
|
-
},
|
|
971
|
-
setValues: function setValues() {
|
|
972
|
-
if (this.min > this.max) {
|
|
973
|
-
console.error('[Element Error][Slider]min should not be greater than max.');
|
|
974
|
-
return;
|
|
975
|
-
}
|
|
976
|
-
var val = this.value;
|
|
977
|
-
if (this.range && Array.isArray(val)) {
|
|
978
|
-
if (val[1] < this.min) {
|
|
979
|
-
this.$emit('input', [this.min, this.min]);
|
|
980
|
-
} else if (val[0] > this.max) {
|
|
981
|
-
this.$emit('input', [this.max, this.max]);
|
|
982
|
-
} else if (val[0] < this.min) {
|
|
983
|
-
this.$emit('input', [this.min, val[1]]);
|
|
984
|
-
} else if (val[1] > this.max) {
|
|
985
|
-
this.$emit('input', [val[0], this.max]);
|
|
986
|
-
} else {
|
|
987
|
-
this.firstValue = val[0];
|
|
988
|
-
this.secondValue = val[1];
|
|
989
|
-
if (this.valueChanged()) {
|
|
990
|
-
this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
|
|
991
|
-
this.oldValue = val.slice();
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
} else if (!this.range && typeof val === 'number' && !isNaN(val)) {
|
|
995
|
-
if (val < this.min) {
|
|
996
|
-
this.$emit('input', this.min);
|
|
997
|
-
} else if (val > this.max) {
|
|
998
|
-
this.$emit('input', this.max);
|
|
999
|
-
} else {
|
|
1000
|
-
this.firstValue = val;
|
|
1001
|
-
if (this.valueChanged()) {
|
|
1002
|
-
this.dispatch('ElFormItem', 'el.form.change', val);
|
|
1003
|
-
this.oldValue = val;
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
},
|
|
1008
|
-
setPosition: function setPosition(percent) {
|
|
1009
|
-
var targetValue = this.min + percent * (this.max - this.min) / 100;
|
|
1010
|
-
if (!this.range) {
|
|
1011
|
-
this.$refs.button1.setPosition(percent);
|
|
1012
|
-
return;
|
|
1013
|
-
}
|
|
1014
|
-
var button = void 0;
|
|
1015
|
-
if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
|
|
1016
|
-
button = this.firstValue < this.secondValue ? 'button1' : 'button2';
|
|
1017
|
-
} else {
|
|
1018
|
-
button = this.firstValue > this.secondValue ? 'button1' : 'button2';
|
|
1019
|
-
}
|
|
1020
|
-
this.$refs[button].setPosition(percent);
|
|
1021
|
-
},
|
|
1022
|
-
onSliderClick: function onSliderClick(event) {
|
|
1023
|
-
if (this.sliderDisabled || this.dragging) return;
|
|
1024
|
-
this.resetSize();
|
|
1025
|
-
if (this.vertical) {
|
|
1026
|
-
var sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
|
|
1027
|
-
this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
|
|
1028
|
-
} else {
|
|
1029
|
-
var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
|
|
1030
|
-
this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
|
|
1031
|
-
}
|
|
1032
|
-
this.emitChange();
|
|
1033
|
-
},
|
|
1034
|
-
resetSize: function resetSize() {
|
|
1035
|
-
if (this.$refs.slider) {
|
|
1036
|
-
this.sliderSize = this.$refs.slider['client' + (this.vertical ? 'Height' : 'Width')];
|
|
1037
|
-
}
|
|
1038
|
-
},
|
|
1039
|
-
emitChange: function emitChange() {
|
|
1040
|
-
var _this2 = this;
|
|
1041
|
-
|
|
1042
|
-
this.$nextTick(function () {
|
|
1043
|
-
_this2.$emit('change', _this2.range ? [_this2.minValue, _this2.maxValue] : _this2.value);
|
|
1044
|
-
});
|
|
1045
|
-
},
|
|
1046
|
-
getStopStyle: function getStopStyle(position) {
|
|
1047
|
-
return this.vertical ? { 'bottom': position + '%' } : { 'left': position + '%' };
|
|
1048
|
-
}
|
|
1049
|
-
},
|
|
1050
|
-
|
|
1051
|
-
computed: {
|
|
1052
|
-
stops: function stops() {
|
|
1053
|
-
var _this3 = this;
|
|
1054
|
-
|
|
1055
|
-
if (!this.showStops || this.min > this.max) return [];
|
|
1056
|
-
if (this.step === 0) {
|
|
1057
|
-
false && false;
|
|
1058
|
-
return [];
|
|
1059
|
-
}
|
|
1060
|
-
var stopCount = (this.max - this.min) / this.step;
|
|
1061
|
-
var stepWidth = 100 * this.step / (this.max - this.min);
|
|
1062
|
-
var result = [];
|
|
1063
|
-
for (var i = 1; i < stopCount; i++) {
|
|
1064
|
-
result.push(i * stepWidth);
|
|
1065
|
-
}
|
|
1066
|
-
if (this.range) {
|
|
1067
|
-
return result.filter(function (step) {
|
|
1068
|
-
return step < 100 * (_this3.minValue - _this3.min) / (_this3.max - _this3.min) || step > 100 * (_this3.maxValue - _this3.min) / (_this3.max - _this3.min);
|
|
1069
|
-
});
|
|
1070
|
-
} else {
|
|
1071
|
-
return result.filter(function (step) {
|
|
1072
|
-
return step > 100 * (_this3.firstValue - _this3.min) / (_this3.max - _this3.min);
|
|
1073
|
-
});
|
|
1074
|
-
}
|
|
1075
|
-
},
|
|
1076
|
-
markList: function markList() {
|
|
1077
|
-
var _this4 = this;
|
|
1078
|
-
|
|
1079
|
-
if (!this.marks) {
|
|
1080
|
-
return [];
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
var marksKeys = Object.keys(this.marks);
|
|
1084
|
-
return marksKeys.map(parseFloat).sort(function (a, b) {
|
|
1085
|
-
return a - b;
|
|
1086
|
-
}).filter(function (point) {
|
|
1087
|
-
return point <= _this4.max && point >= _this4.min;
|
|
1088
|
-
}).map(function (point) {
|
|
1089
|
-
return {
|
|
1090
|
-
point: point,
|
|
1091
|
-
position: (point - _this4.min) * 100 / (_this4.max - _this4.min),
|
|
1092
|
-
mark: _this4.marks[point]
|
|
1093
|
-
};
|
|
1094
|
-
});
|
|
1095
|
-
},
|
|
1096
|
-
minValue: function minValue() {
|
|
1097
|
-
return Math.min(this.firstValue, this.secondValue);
|
|
1098
|
-
},
|
|
1099
|
-
maxValue: function maxValue() {
|
|
1100
|
-
return Math.max(this.firstValue, this.secondValue);
|
|
1101
|
-
},
|
|
1102
|
-
barSize: function barSize() {
|
|
1103
|
-
return this.range ? 100 * (this.maxValue - this.minValue) / (this.max - this.min) + '%' : 100 * (this.firstValue - this.min) / (this.max - this.min) + '%';
|
|
1104
|
-
},
|
|
1105
|
-
barStart: function barStart() {
|
|
1106
|
-
return this.range ? 100 * (this.minValue - this.min) / (this.max - this.min) + '%' : '0%';
|
|
1107
|
-
},
|
|
1108
|
-
precision: function precision() {
|
|
1109
|
-
var precisions = [this.min, this.max, this.step].map(function (item) {
|
|
1110
|
-
var decimal = ('' + item).split('.')[1];
|
|
1111
|
-
return decimal ? decimal.length : 0;
|
|
1112
|
-
});
|
|
1113
|
-
return Math.max.apply(null, precisions);
|
|
1114
|
-
},
|
|
1115
|
-
runwayStyle: function runwayStyle() {
|
|
1116
|
-
return this.vertical ? { height: this.height } : {};
|
|
1117
|
-
},
|
|
1118
|
-
barStyle: function barStyle() {
|
|
1119
|
-
return this.vertical ? {
|
|
1120
|
-
height: this.barSize,
|
|
1121
|
-
bottom: this.barStart
|
|
1122
|
-
} : {
|
|
1123
|
-
width: this.barSize,
|
|
1124
|
-
left: this.barStart
|
|
1125
|
-
};
|
|
1126
|
-
},
|
|
1127
|
-
sliderDisabled: function sliderDisabled() {
|
|
1128
|
-
return this.disabled || (this.elForm || {}).disabled;
|
|
1129
|
-
}
|
|
1130
|
-
},
|
|
1131
|
-
|
|
1132
|
-
mounted: function mounted() {
|
|
1133
|
-
var valuetext = void 0;
|
|
1134
|
-
if (this.range) {
|
|
1135
|
-
if (Array.isArray(this.value)) {
|
|
1136
|
-
this.firstValue = Math.max(this.min, this.value[0]);
|
|
1137
|
-
this.secondValue = Math.min(this.max, this.value[1]);
|
|
1138
|
-
} else {
|
|
1139
|
-
this.firstValue = this.min;
|
|
1140
|
-
this.secondValue = this.max;
|
|
1141
|
-
}
|
|
1142
|
-
this.oldValue = [this.firstValue, this.secondValue];
|
|
1143
|
-
valuetext = this.firstValue + '-' + this.secondValue;
|
|
1144
|
-
} else {
|
|
1145
|
-
if (typeof this.value !== 'number' || isNaN(this.value)) {
|
|
1146
|
-
this.firstValue = this.min;
|
|
1147
|
-
} else {
|
|
1148
|
-
this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
|
|
1149
|
-
}
|
|
1150
|
-
this.oldValue = this.firstValue;
|
|
1151
|
-
valuetext = this.firstValue;
|
|
1152
|
-
}
|
|
1153
|
-
this.$el.setAttribute('aria-valuetext', valuetext);
|
|
1154
|
-
|
|
1155
|
-
// label screen reader
|
|
1156
|
-
this.$el.setAttribute('aria-label', this.label ? this.label : 'slider between ' + this.min + ' and ' + this.max);
|
|
1157
|
-
|
|
1158
|
-
this.resetSize();
|
|
1159
|
-
window.addEventListener('resize', this.resetSize);
|
|
1160
|
-
},
|
|
1161
|
-
beforeDestroy: function beforeDestroy() {
|
|
1162
|
-
window.removeEventListener('resize', this.resetSize);
|
|
1163
|
-
}
|
|
1164
|
-
});
|
|
1165
|
-
// CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=script&lang=js
|
|
1166
|
-
/* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
|
|
1167
|
-
// CONCATENATED MODULE: ./packages/slider/src/main.vue
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
/* normalize component */
|
|
1174
|
-
|
|
1175
|
-
var main_component = Object(componentNormalizer["a" /* default */])(
|
|
1176
|
-
src_mainvue_type_script_lang_js,
|
|
1177
|
-
render,
|
|
1178
|
-
staticRenderFns,
|
|
1179
|
-
false,
|
|
1180
|
-
null,
|
|
1181
|
-
null,
|
|
1182
|
-
null
|
|
1183
|
-
|
|
1184
|
-
)
|
|
1185
|
-
|
|
1186
|
-
/* harmony default export */ var main = (main_component.exports);
|
|
1187
|
-
// CONCATENATED MODULE: ./packages/slider/index.js
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
/* istanbul ignore next */
|
|
1191
|
-
main.install = function (Vue) {
|
|
1192
|
-
Vue.component(main.name, main);
|
|
1193
|
-
};
|
|
1194
|
-
|
|
1195
|
-
/* harmony default export */ var slider = __webpack_exports__["default"] = (main);
|
|
1196
|
-
|
|
1197
|
-
/***/ })
|
|
1198
|
-
|
|
1199
|
-
/******/ });
|