cy-element-ui 1.1.19 → 1.1.21
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/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/lib/Alert.js +0 -420
- package/lib/Aside.js +0 -277
- package/lib/Autocomplete.js +0 -2051
- package/lib/Avatar.js +0 -363
- package/lib/Backtop.js +0 -404
- package/lib/Badge.js +0 -334
- package/lib/Breadcrumb.js +0 -293
- package/lib/BreadcrumbItem.js +0 -322
- package/lib/Button.js +0 -357
- package/lib/ButtonGroup.js +0 -262
- package/lib/Calendar.js +0 -1146
- package/lib/Card.js +0 -297
- package/lib/Carousel.js +0 -707
- package/lib/CarouselItem.js +0 -434
- package/lib/Cascader.js +0 -4641
- package/lib/CascaderPanel.js +0 -2602
- package/lib/Checkbox.js +0 -627
- package/lib/CheckboxButton.js +0 -583
- package/lib/CheckboxGroup.js +0 -313
- package/lib/Col.js +0 -177
- package/lib/Collapse.js +0 -329
- package/lib/CollapseItem.js +0 -497
- package/lib/ColorPicker.js +0 -2885
- package/lib/Container.js +0 -288
- package/lib/CySelectDisplayInput.js +0 -367
- package/lib/CySubTitle.js +0 -295
- package/lib/CyTabDialog.js +0 -1184
- package/lib/CyTreeSelect.js +0 -4422
- package/lib/DatePicker.js +0 -7574
- package/lib/Descriptions.js +0 -457
- package/lib/DescriptionsItem.js +0 -140
- package/lib/Dialog.js +0 -598
- package/lib/Divider.js +0 -313
- package/lib/Drawer.js +0 -592
- package/lib/Dropdown.js +0 -856
- package/lib/DropdownItem.js +0 -316
- package/lib/DropdownMenu.js +0 -351
- package/lib/Empty.js +0 -730
- package/lib/Footer.js +0 -277
- package/lib/Form.js +0 -466
- package/lib/FormItem.js +0 -826
- package/lib/Header.js +0 -277
- package/lib/Icon.js +0 -265
- package/lib/Image.js +0 -1138
- package/lib/InfiniteScroll.js +0 -301
- package/lib/Input.js +0 -999
- package/lib/InputNumber.js +0 -1552
- package/lib/Link.js +0 -332
- package/lib/Loading.js +0 -631
- package/lib/Main.js +0 -264
- package/lib/Menu.js +0 -865
- package/lib/MenuItem.js +0 -818
- package/lib/MenuItemGroup.js +0 -308
- package/lib/Message.js +0 -548
- package/lib/MessageBox.js +0 -2134
- package/lib/Notification.js +0 -615
- package/lib/Option.js +0 -474
- package/lib/OptionGroup.js +0 -344
- package/lib/PageHeader.js +0 -319
- package/lib/Pagination.js +0 -4123
- package/lib/Popconfirm.js +0 -1025
- package/lib/Popover.js +0 -617
- package/lib/Progress.js +0 -595
- package/lib/Radio.js +0 -497
- package/lib/RadioButton.js +0 -463
- package/lib/RadioGroup.js +0 -391
- 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 -3368
- package/lib/Skeleton.js +0 -372
- package/lib/SkeletonItem.js +0 -342
- package/lib/Slider.js +0 -2854
- 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 -700
- package/lib/Switch.js +0 -554
- package/lib/TabPane.js +0 -332
- package/lib/Table.js +0 -6125
- package/lib/TableColumn.js +0 -1481
- package/lib/Tabs.js +0 -920
- package/lib/Tag.js +0 -304
- package/lib/TimePicker.js +0 -4059
- package/lib/TimeSelect.js +0 -2871
- package/lib/Timeline.js +0 -275
- package/lib/TimelineItem.js +0 -371
- package/lib/Tooltip.js +0 -425
- package/lib/Transfer.js +0 -2557
- package/lib/Tree.js +0 -2680
- package/lib/Upload.js +0 -1782
package/lib/Rate.js
DELETED
|
@@ -1,670 +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 = 97);
|
|
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
|
-
/***/ 1:
|
|
196
|
-
/***/ (function(module, exports) {
|
|
197
|
-
|
|
198
|
-
module.exports = require("element-ui/lib/utils/dom");
|
|
199
|
-
|
|
200
|
-
/***/ }),
|
|
201
|
-
|
|
202
|
-
/***/ 21:
|
|
203
|
-
/***/ (function(module, exports) {
|
|
204
|
-
|
|
205
|
-
module.exports = require("element-ui/lib/utils/types");
|
|
206
|
-
|
|
207
|
-
/***/ }),
|
|
208
|
-
|
|
209
|
-
/***/ 7:
|
|
210
|
-
/***/ (function(module, exports) {
|
|
211
|
-
|
|
212
|
-
module.exports = require("element-ui/lib/mixins/migrating");
|
|
213
|
-
|
|
214
|
-
/***/ }),
|
|
215
|
-
|
|
216
|
-
/***/ 97:
|
|
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/rate/src/main.vue?vue&type=template&id=0f986b22
|
|
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-rate",
|
|
232
|
-
attrs: {
|
|
233
|
-
role: "slider",
|
|
234
|
-
"aria-valuenow": _vm.currentValue,
|
|
235
|
-
"aria-valuetext": _vm.text,
|
|
236
|
-
"aria-valuemin": "0",
|
|
237
|
-
"aria-valuemax": _vm.max,
|
|
238
|
-
tabindex: "0",
|
|
239
|
-
},
|
|
240
|
-
on: { keydown: _vm.handleKey },
|
|
241
|
-
},
|
|
242
|
-
[
|
|
243
|
-
_vm._l(_vm.max, function (item, key) {
|
|
244
|
-
return _c(
|
|
245
|
-
"span",
|
|
246
|
-
{
|
|
247
|
-
key: key,
|
|
248
|
-
staticClass: "el-rate__item",
|
|
249
|
-
style: { cursor: _vm.rateDisabled ? "auto" : "pointer" },
|
|
250
|
-
on: {
|
|
251
|
-
mousemove: function ($event) {
|
|
252
|
-
_vm.setCurrentValue(item, $event)
|
|
253
|
-
},
|
|
254
|
-
mouseleave: _vm.resetCurrentValue,
|
|
255
|
-
click: function ($event) {
|
|
256
|
-
_vm.selectValue(item)
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
[
|
|
261
|
-
_c(
|
|
262
|
-
"i",
|
|
263
|
-
{
|
|
264
|
-
staticClass: "el-rate__icon",
|
|
265
|
-
class: [
|
|
266
|
-
_vm.classes[item - 1],
|
|
267
|
-
{ hover: _vm.hoverIndex === item },
|
|
268
|
-
],
|
|
269
|
-
style: _vm.getIconStyle(item),
|
|
270
|
-
},
|
|
271
|
-
[
|
|
272
|
-
_vm.showDecimalIcon(item)
|
|
273
|
-
? _c("i", {
|
|
274
|
-
staticClass: "el-rate__decimal",
|
|
275
|
-
class: _vm.decimalIconClass,
|
|
276
|
-
style: _vm.decimalStyle,
|
|
277
|
-
})
|
|
278
|
-
: _vm._e(),
|
|
279
|
-
]
|
|
280
|
-
),
|
|
281
|
-
]
|
|
282
|
-
)
|
|
283
|
-
}),
|
|
284
|
-
_vm.showText || _vm.showScore
|
|
285
|
-
? _c(
|
|
286
|
-
"span",
|
|
287
|
-
{ staticClass: "el-rate__text", style: { color: _vm.textColor } },
|
|
288
|
-
[_vm._v(_vm._s(_vm.text))]
|
|
289
|
-
)
|
|
290
|
-
: _vm._e(),
|
|
291
|
-
],
|
|
292
|
-
2
|
|
293
|
-
)
|
|
294
|
-
}
|
|
295
|
-
var staticRenderFns = []
|
|
296
|
-
render._withStripped = true
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
// CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=template&id=0f986b22
|
|
300
|
-
|
|
301
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/dom"
|
|
302
|
-
var dom_ = __webpack_require__(1);
|
|
303
|
-
|
|
304
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/types"
|
|
305
|
-
var types_ = __webpack_require__(21);
|
|
306
|
-
|
|
307
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
|
|
308
|
-
var migrating_ = __webpack_require__(7);
|
|
309
|
-
var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
|
|
310
|
-
|
|
311
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/rate/src/main.vue?vue&type=script&lang=js
|
|
312
|
-
//
|
|
313
|
-
//
|
|
314
|
-
//
|
|
315
|
-
//
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
//
|
|
319
|
-
//
|
|
320
|
-
//
|
|
321
|
-
//
|
|
322
|
-
//
|
|
323
|
-
//
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
//
|
|
328
|
-
//
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
//
|
|
332
|
-
//
|
|
333
|
-
//
|
|
334
|
-
//
|
|
335
|
-
//
|
|
336
|
-
//
|
|
337
|
-
//
|
|
338
|
-
//
|
|
339
|
-
//
|
|
340
|
-
//
|
|
341
|
-
//
|
|
342
|
-
//
|
|
343
|
-
//
|
|
344
|
-
//
|
|
345
|
-
//
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
/* harmony default export */ var mainvue_type_script_lang_js = ({
|
|
352
|
-
name: 'ElRate',
|
|
353
|
-
|
|
354
|
-
mixins: [migrating_default.a],
|
|
355
|
-
|
|
356
|
-
inject: {
|
|
357
|
-
elForm: {
|
|
358
|
-
default: ''
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
data: function data() {
|
|
363
|
-
return {
|
|
364
|
-
pointerAtLeftHalf: true,
|
|
365
|
-
currentValue: this.value,
|
|
366
|
-
hoverIndex: -1
|
|
367
|
-
};
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
props: {
|
|
372
|
-
value: {
|
|
373
|
-
type: Number,
|
|
374
|
-
default: 0
|
|
375
|
-
},
|
|
376
|
-
lowThreshold: {
|
|
377
|
-
type: Number,
|
|
378
|
-
default: 2
|
|
379
|
-
},
|
|
380
|
-
highThreshold: {
|
|
381
|
-
type: Number,
|
|
382
|
-
default: 4
|
|
383
|
-
},
|
|
384
|
-
max: {
|
|
385
|
-
type: Number,
|
|
386
|
-
default: 5
|
|
387
|
-
},
|
|
388
|
-
colors: {
|
|
389
|
-
type: [Array, Object],
|
|
390
|
-
default: function _default() {
|
|
391
|
-
return ['#F7BA2A', '#F7BA2A', '#F7BA2A'];
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
voidColor: {
|
|
395
|
-
type: String,
|
|
396
|
-
default: '#C6D1DE'
|
|
397
|
-
},
|
|
398
|
-
disabledVoidColor: {
|
|
399
|
-
type: String,
|
|
400
|
-
default: '#EFF2F7'
|
|
401
|
-
},
|
|
402
|
-
iconClasses: {
|
|
403
|
-
type: [Array, Object],
|
|
404
|
-
default: function _default() {
|
|
405
|
-
return ['el-icon-star-on', 'el-icon-star-on', 'el-icon-star-on'];
|
|
406
|
-
}
|
|
407
|
-
},
|
|
408
|
-
voidIconClass: {
|
|
409
|
-
type: String,
|
|
410
|
-
default: 'el-icon-star-off'
|
|
411
|
-
},
|
|
412
|
-
disabledVoidIconClass: {
|
|
413
|
-
type: String,
|
|
414
|
-
default: 'el-icon-star-on'
|
|
415
|
-
},
|
|
416
|
-
disabled: {
|
|
417
|
-
type: Boolean,
|
|
418
|
-
default: false
|
|
419
|
-
},
|
|
420
|
-
allowHalf: {
|
|
421
|
-
type: Boolean,
|
|
422
|
-
default: false
|
|
423
|
-
},
|
|
424
|
-
showText: {
|
|
425
|
-
type: Boolean,
|
|
426
|
-
default: false
|
|
427
|
-
},
|
|
428
|
-
showScore: {
|
|
429
|
-
type: Boolean,
|
|
430
|
-
default: false
|
|
431
|
-
},
|
|
432
|
-
textColor: {
|
|
433
|
-
type: String,
|
|
434
|
-
default: '#1f2d3d'
|
|
435
|
-
},
|
|
436
|
-
texts: {
|
|
437
|
-
type: Array,
|
|
438
|
-
default: function _default() {
|
|
439
|
-
return ['极差', '失望', '一般', '满意', '惊喜'];
|
|
440
|
-
}
|
|
441
|
-
},
|
|
442
|
-
scoreTemplate: {
|
|
443
|
-
type: String,
|
|
444
|
-
default: '{value}'
|
|
445
|
-
}
|
|
446
|
-
},
|
|
447
|
-
|
|
448
|
-
computed: {
|
|
449
|
-
text: function text() {
|
|
450
|
-
var result = '';
|
|
451
|
-
if (this.showScore) {
|
|
452
|
-
result = this.scoreTemplate.replace(/\{\s*value\s*\}/, this.rateDisabled ? this.value : this.currentValue);
|
|
453
|
-
} else if (this.showText) {
|
|
454
|
-
result = this.texts[Math.ceil(this.currentValue) - 1];
|
|
455
|
-
}
|
|
456
|
-
return result;
|
|
457
|
-
},
|
|
458
|
-
decimalStyle: function decimalStyle() {
|
|
459
|
-
var width = '';
|
|
460
|
-
if (this.rateDisabled) {
|
|
461
|
-
width = this.valueDecimal + '%';
|
|
462
|
-
} else if (this.allowHalf) {
|
|
463
|
-
width = '50%';
|
|
464
|
-
}
|
|
465
|
-
return {
|
|
466
|
-
color: this.activeColor,
|
|
467
|
-
width: width
|
|
468
|
-
};
|
|
469
|
-
},
|
|
470
|
-
valueDecimal: function valueDecimal() {
|
|
471
|
-
return this.value * 100 - Math.floor(this.value) * 100;
|
|
472
|
-
},
|
|
473
|
-
classMap: function classMap() {
|
|
474
|
-
var _ref;
|
|
475
|
-
|
|
476
|
-
return Array.isArray(this.iconClasses) ? (_ref = {}, _ref[this.lowThreshold] = this.iconClasses[0], _ref[this.highThreshold] = { value: this.iconClasses[1], excluded: true }, _ref[this.max] = this.iconClasses[2], _ref) : this.iconClasses;
|
|
477
|
-
},
|
|
478
|
-
decimalIconClass: function decimalIconClass() {
|
|
479
|
-
return this.getValueFromMap(this.value, this.classMap);
|
|
480
|
-
},
|
|
481
|
-
voidClass: function voidClass() {
|
|
482
|
-
return this.rateDisabled ? this.disabledVoidIconClass : this.voidIconClass;
|
|
483
|
-
},
|
|
484
|
-
activeClass: function activeClass() {
|
|
485
|
-
return this.getValueFromMap(this.currentValue, this.classMap);
|
|
486
|
-
},
|
|
487
|
-
colorMap: function colorMap() {
|
|
488
|
-
var _ref2;
|
|
489
|
-
|
|
490
|
-
return Array.isArray(this.colors) ? (_ref2 = {}, _ref2[this.lowThreshold] = this.colors[0], _ref2[this.highThreshold] = { value: this.colors[1], excluded: true }, _ref2[this.max] = this.colors[2], _ref2) : this.colors;
|
|
491
|
-
},
|
|
492
|
-
activeColor: function activeColor() {
|
|
493
|
-
return this.getValueFromMap(this.currentValue, this.colorMap);
|
|
494
|
-
},
|
|
495
|
-
classes: function classes() {
|
|
496
|
-
var result = [];
|
|
497
|
-
var i = 0;
|
|
498
|
-
var threshold = this.currentValue;
|
|
499
|
-
if (this.allowHalf && this.currentValue !== Math.floor(this.currentValue)) {
|
|
500
|
-
threshold--;
|
|
501
|
-
}
|
|
502
|
-
for (; i < threshold; i++) {
|
|
503
|
-
result.push(this.activeClass);
|
|
504
|
-
}
|
|
505
|
-
for (; i < this.max; i++) {
|
|
506
|
-
result.push(this.voidClass);
|
|
507
|
-
}
|
|
508
|
-
return result;
|
|
509
|
-
},
|
|
510
|
-
rateDisabled: function rateDisabled() {
|
|
511
|
-
return this.disabled || (this.elForm || {}).disabled;
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
|
|
515
|
-
watch: {
|
|
516
|
-
value: function value(val) {
|
|
517
|
-
this.currentValue = val;
|
|
518
|
-
this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
|
|
519
|
-
}
|
|
520
|
-
},
|
|
521
|
-
|
|
522
|
-
methods: {
|
|
523
|
-
getMigratingConfig: function getMigratingConfig() {
|
|
524
|
-
return {
|
|
525
|
-
props: {
|
|
526
|
-
'text-template': 'text-template is renamed to score-template.'
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
},
|
|
530
|
-
getValueFromMap: function getValueFromMap(value, map) {
|
|
531
|
-
var matchedKeys = Object.keys(map).filter(function (key) {
|
|
532
|
-
var val = map[key];
|
|
533
|
-
var excluded = Object(types_["isObject"])(val) ? val.excluded : false;
|
|
534
|
-
return excluded ? value < key : value <= key;
|
|
535
|
-
}).sort(function (a, b) {
|
|
536
|
-
return a - b;
|
|
537
|
-
});
|
|
538
|
-
var matchedValue = map[matchedKeys[0]];
|
|
539
|
-
return Object(types_["isObject"])(matchedValue) ? matchedValue.value : matchedValue || '';
|
|
540
|
-
},
|
|
541
|
-
showDecimalIcon: function showDecimalIcon(item) {
|
|
542
|
-
var showWhenDisabled = this.rateDisabled && this.valueDecimal > 0 && item - 1 < this.value && item > this.value;
|
|
543
|
-
/* istanbul ignore next */
|
|
544
|
-
var showWhenAllowHalf = this.allowHalf && this.pointerAtLeftHalf && item - 0.5 <= this.currentValue && item > this.currentValue;
|
|
545
|
-
return showWhenDisabled || showWhenAllowHalf;
|
|
546
|
-
},
|
|
547
|
-
getIconStyle: function getIconStyle(item) {
|
|
548
|
-
var voidColor = this.rateDisabled ? this.disabledVoidColor : this.voidColor;
|
|
549
|
-
return {
|
|
550
|
-
color: item <= this.currentValue ? this.activeColor : voidColor
|
|
551
|
-
};
|
|
552
|
-
},
|
|
553
|
-
selectValue: function selectValue(value) {
|
|
554
|
-
if (this.rateDisabled) {
|
|
555
|
-
return;
|
|
556
|
-
}
|
|
557
|
-
if (this.allowHalf && this.pointerAtLeftHalf) {
|
|
558
|
-
this.$emit('input', this.currentValue);
|
|
559
|
-
this.$emit('change', this.currentValue);
|
|
560
|
-
} else {
|
|
561
|
-
this.$emit('input', value);
|
|
562
|
-
this.$emit('change', value);
|
|
563
|
-
}
|
|
564
|
-
},
|
|
565
|
-
handleKey: function handleKey(e) {
|
|
566
|
-
if (this.rateDisabled) {
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
var currentValue = this.currentValue;
|
|
570
|
-
var keyCode = e.keyCode;
|
|
571
|
-
if (keyCode === 38 || keyCode === 39) {
|
|
572
|
-
// left / down
|
|
573
|
-
if (this.allowHalf) {
|
|
574
|
-
currentValue += 0.5;
|
|
575
|
-
} else {
|
|
576
|
-
currentValue += 1;
|
|
577
|
-
}
|
|
578
|
-
e.stopPropagation();
|
|
579
|
-
e.preventDefault();
|
|
580
|
-
} else if (keyCode === 37 || keyCode === 40) {
|
|
581
|
-
if (this.allowHalf) {
|
|
582
|
-
currentValue -= 0.5;
|
|
583
|
-
} else {
|
|
584
|
-
currentValue -= 1;
|
|
585
|
-
}
|
|
586
|
-
e.stopPropagation();
|
|
587
|
-
e.preventDefault();
|
|
588
|
-
}
|
|
589
|
-
currentValue = currentValue < 0 ? 0 : currentValue;
|
|
590
|
-
currentValue = currentValue > this.max ? this.max : currentValue;
|
|
591
|
-
|
|
592
|
-
this.$emit('input', currentValue);
|
|
593
|
-
this.$emit('change', currentValue);
|
|
594
|
-
},
|
|
595
|
-
setCurrentValue: function setCurrentValue(value, event) {
|
|
596
|
-
if (this.rateDisabled) {
|
|
597
|
-
return;
|
|
598
|
-
}
|
|
599
|
-
/* istanbul ignore if */
|
|
600
|
-
if (this.allowHalf) {
|
|
601
|
-
var target = event.target;
|
|
602
|
-
if (Object(dom_["hasClass"])(target, 'el-rate__item')) {
|
|
603
|
-
target = target.querySelector('.el-rate__icon');
|
|
604
|
-
}
|
|
605
|
-
if (Object(dom_["hasClass"])(target, 'el-rate__decimal')) {
|
|
606
|
-
target = target.parentNode;
|
|
607
|
-
}
|
|
608
|
-
this.pointerAtLeftHalf = event.offsetX * 2 <= target.clientWidth;
|
|
609
|
-
this.currentValue = this.pointerAtLeftHalf ? value - 0.5 : value;
|
|
610
|
-
} else {
|
|
611
|
-
this.currentValue = value;
|
|
612
|
-
}
|
|
613
|
-
this.hoverIndex = value;
|
|
614
|
-
},
|
|
615
|
-
resetCurrentValue: function resetCurrentValue() {
|
|
616
|
-
if (this.rateDisabled) {
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
if (this.allowHalf) {
|
|
620
|
-
this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
|
|
621
|
-
}
|
|
622
|
-
this.currentValue = this.value;
|
|
623
|
-
this.hoverIndex = -1;
|
|
624
|
-
}
|
|
625
|
-
},
|
|
626
|
-
|
|
627
|
-
created: function created() {
|
|
628
|
-
if (!this.value) {
|
|
629
|
-
this.$emit('input', 0);
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
// CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=script&lang=js
|
|
634
|
-
/* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
|
|
635
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
636
|
-
var componentNormalizer = __webpack_require__(0);
|
|
637
|
-
|
|
638
|
-
// CONCATENATED MODULE: ./packages/rate/src/main.vue
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
/* normalize component */
|
|
645
|
-
|
|
646
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
647
|
-
src_mainvue_type_script_lang_js,
|
|
648
|
-
render,
|
|
649
|
-
staticRenderFns,
|
|
650
|
-
false,
|
|
651
|
-
null,
|
|
652
|
-
null,
|
|
653
|
-
null
|
|
654
|
-
|
|
655
|
-
)
|
|
656
|
-
|
|
657
|
-
/* harmony default export */ var main = (component.exports);
|
|
658
|
-
// CONCATENATED MODULE: ./packages/rate/index.js
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
/* istanbul ignore next */
|
|
662
|
-
main.install = function (Vue) {
|
|
663
|
-
Vue.component(main.name, main);
|
|
664
|
-
};
|
|
665
|
-
|
|
666
|
-
/* harmony default export */ var rate = __webpack_exports__["default"] = (main);
|
|
667
|
-
|
|
668
|
-
/***/ })
|
|
669
|
-
|
|
670
|
-
/******/ });
|