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/Cascader.js
DELETED
|
@@ -1,4641 +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 = 104);
|
|
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
|
-
/***/ 10:
|
|
203
|
-
/***/ (function(module, exports) {
|
|
204
|
-
|
|
205
|
-
module.exports = require("element-ui/lib/utils/resize-event");
|
|
206
|
-
|
|
207
|
-
/***/ }),
|
|
208
|
-
|
|
209
|
-
/***/ 104:
|
|
210
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
211
|
-
|
|
212
|
-
"use strict";
|
|
213
|
-
// ESM COMPAT FLAG
|
|
214
|
-
__webpack_require__.r(__webpack_exports__);
|
|
215
|
-
|
|
216
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader/src/cascader.vue?vue&type=template&id=5e697676
|
|
217
|
-
var render = function () {
|
|
218
|
-
var _vm = this
|
|
219
|
-
var _h = _vm.$createElement
|
|
220
|
-
var _c = _vm._self._c || _h
|
|
221
|
-
return _c(
|
|
222
|
-
"div",
|
|
223
|
-
{
|
|
224
|
-
directives: [
|
|
225
|
-
{
|
|
226
|
-
name: "clickoutside",
|
|
227
|
-
rawName: "v-clickoutside",
|
|
228
|
-
value: function () {
|
|
229
|
-
return _vm.toggleDropDownVisible(false)
|
|
230
|
-
},
|
|
231
|
-
expression: "() => toggleDropDownVisible(false)",
|
|
232
|
-
},
|
|
233
|
-
],
|
|
234
|
-
ref: "reference",
|
|
235
|
-
class: [
|
|
236
|
-
"el-cascader",
|
|
237
|
-
_vm.realSize && "el-cascader--" + _vm.realSize,
|
|
238
|
-
{ "is-disabled": _vm.isDisabled },
|
|
239
|
-
],
|
|
240
|
-
on: {
|
|
241
|
-
mouseenter: function ($event) {
|
|
242
|
-
_vm.inputHover = true
|
|
243
|
-
},
|
|
244
|
-
mouseleave: function ($event) {
|
|
245
|
-
_vm.inputHover = false
|
|
246
|
-
},
|
|
247
|
-
click: function () {
|
|
248
|
-
return _vm.toggleDropDownVisible(_vm.readonly ? undefined : true)
|
|
249
|
-
},
|
|
250
|
-
keydown: _vm.handleKeyDown,
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
[
|
|
254
|
-
_c(
|
|
255
|
-
"el-input",
|
|
256
|
-
{
|
|
257
|
-
ref: "input",
|
|
258
|
-
class: { "is-focus": _vm.dropDownVisible },
|
|
259
|
-
attrs: {
|
|
260
|
-
size: _vm.realSize,
|
|
261
|
-
placeholder: _vm.placeholder,
|
|
262
|
-
readonly: _vm.readonly,
|
|
263
|
-
disabled: _vm.isDisabled,
|
|
264
|
-
"validate-event": false,
|
|
265
|
-
},
|
|
266
|
-
on: {
|
|
267
|
-
focus: _vm.handleFocus,
|
|
268
|
-
blur: _vm.handleBlur,
|
|
269
|
-
input: _vm.handleInput,
|
|
270
|
-
},
|
|
271
|
-
model: {
|
|
272
|
-
value: _vm.multiple ? _vm.presentText : _vm.inputValue,
|
|
273
|
-
callback: function ($$v) {
|
|
274
|
-
_vm.multiple ? _vm.presentText : (_vm.inputValue = $$v)
|
|
275
|
-
},
|
|
276
|
-
expression: "multiple ? presentText : inputValue",
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
[
|
|
280
|
-
_c("template", { slot: "suffix" }, [
|
|
281
|
-
_vm.clearBtnVisible
|
|
282
|
-
? _c("i", {
|
|
283
|
-
key: "clear",
|
|
284
|
-
staticClass: "el-input__icon el-icon-circle-close",
|
|
285
|
-
on: {
|
|
286
|
-
click: function ($event) {
|
|
287
|
-
$event.stopPropagation()
|
|
288
|
-
return _vm.handleClear($event)
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
})
|
|
292
|
-
: _c("i", {
|
|
293
|
-
key: "arrow-down",
|
|
294
|
-
class: [
|
|
295
|
-
"el-input__icon",
|
|
296
|
-
"el-icon-arrow-down",
|
|
297
|
-
_vm.dropDownVisible && "is-reverse",
|
|
298
|
-
],
|
|
299
|
-
on: {
|
|
300
|
-
click: function ($event) {
|
|
301
|
-
$event.stopPropagation()
|
|
302
|
-
_vm.toggleDropDownVisible()
|
|
303
|
-
},
|
|
304
|
-
},
|
|
305
|
-
}),
|
|
306
|
-
]),
|
|
307
|
-
],
|
|
308
|
-
2
|
|
309
|
-
),
|
|
310
|
-
_vm.multiple
|
|
311
|
-
? _c(
|
|
312
|
-
"div",
|
|
313
|
-
{ staticClass: "el-cascader__tags" },
|
|
314
|
-
[
|
|
315
|
-
_vm._l(_vm.presentTags, function (tag) {
|
|
316
|
-
return _c(
|
|
317
|
-
"el-tag",
|
|
318
|
-
{
|
|
319
|
-
key: tag.key,
|
|
320
|
-
attrs: {
|
|
321
|
-
type: "info",
|
|
322
|
-
size: _vm.tagSize,
|
|
323
|
-
hit: tag.hitState,
|
|
324
|
-
closable: tag.closable,
|
|
325
|
-
"disable-transitions": "",
|
|
326
|
-
},
|
|
327
|
-
on: {
|
|
328
|
-
close: function ($event) {
|
|
329
|
-
_vm.deleteTag(tag)
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
[_c("span", [_vm._v(_vm._s(tag.text))])]
|
|
334
|
-
)
|
|
335
|
-
}),
|
|
336
|
-
_vm.filterable && !_vm.isDisabled
|
|
337
|
-
? _c("input", {
|
|
338
|
-
directives: [
|
|
339
|
-
{
|
|
340
|
-
name: "model",
|
|
341
|
-
rawName: "v-model.trim",
|
|
342
|
-
value: _vm.inputValue,
|
|
343
|
-
expression: "inputValue",
|
|
344
|
-
modifiers: { trim: true },
|
|
345
|
-
},
|
|
346
|
-
],
|
|
347
|
-
staticClass: "el-cascader__search-input",
|
|
348
|
-
attrs: {
|
|
349
|
-
type: "text",
|
|
350
|
-
placeholder: _vm.presentTags.length
|
|
351
|
-
? ""
|
|
352
|
-
: _vm.placeholder,
|
|
353
|
-
},
|
|
354
|
-
domProps: { value: _vm.inputValue },
|
|
355
|
-
on: {
|
|
356
|
-
input: [
|
|
357
|
-
function ($event) {
|
|
358
|
-
if ($event.target.composing) {
|
|
359
|
-
return
|
|
360
|
-
}
|
|
361
|
-
_vm.inputValue = $event.target.value.trim()
|
|
362
|
-
},
|
|
363
|
-
function (e) {
|
|
364
|
-
return _vm.handleInput(_vm.inputValue, e)
|
|
365
|
-
},
|
|
366
|
-
],
|
|
367
|
-
click: function ($event) {
|
|
368
|
-
$event.stopPropagation()
|
|
369
|
-
_vm.toggleDropDownVisible(true)
|
|
370
|
-
},
|
|
371
|
-
keydown: function ($event) {
|
|
372
|
-
if (
|
|
373
|
-
!("button" in $event) &&
|
|
374
|
-
_vm._k(
|
|
375
|
-
$event.keyCode,
|
|
376
|
-
"delete",
|
|
377
|
-
[8, 46],
|
|
378
|
-
$event.key,
|
|
379
|
-
["Backspace", "Delete", "Del"]
|
|
380
|
-
)
|
|
381
|
-
) {
|
|
382
|
-
return null
|
|
383
|
-
}
|
|
384
|
-
return _vm.handleDelete($event)
|
|
385
|
-
},
|
|
386
|
-
blur: function ($event) {
|
|
387
|
-
_vm.$forceUpdate()
|
|
388
|
-
},
|
|
389
|
-
},
|
|
390
|
-
})
|
|
391
|
-
: _vm._e(),
|
|
392
|
-
],
|
|
393
|
-
2
|
|
394
|
-
)
|
|
395
|
-
: _vm._e(),
|
|
396
|
-
_c(
|
|
397
|
-
"transition",
|
|
398
|
-
{
|
|
399
|
-
attrs: { name: "el-zoom-in-top" },
|
|
400
|
-
on: { "after-leave": _vm.handleDropdownLeave },
|
|
401
|
-
},
|
|
402
|
-
[
|
|
403
|
-
_c(
|
|
404
|
-
"div",
|
|
405
|
-
{
|
|
406
|
-
directives: [
|
|
407
|
-
{
|
|
408
|
-
name: "show",
|
|
409
|
-
rawName: "v-show",
|
|
410
|
-
value: _vm.dropDownVisible,
|
|
411
|
-
expression: "dropDownVisible",
|
|
412
|
-
},
|
|
413
|
-
],
|
|
414
|
-
ref: "popper",
|
|
415
|
-
class: ["el-popper", "el-cascader__dropdown", _vm.popperClass],
|
|
416
|
-
},
|
|
417
|
-
[
|
|
418
|
-
_c("el-cascader-panel", {
|
|
419
|
-
directives: [
|
|
420
|
-
{
|
|
421
|
-
name: "show",
|
|
422
|
-
rawName: "v-show",
|
|
423
|
-
value: !_vm.filtering,
|
|
424
|
-
expression: "!filtering",
|
|
425
|
-
},
|
|
426
|
-
],
|
|
427
|
-
ref: "panel",
|
|
428
|
-
attrs: {
|
|
429
|
-
options: _vm.options,
|
|
430
|
-
props: _vm.config,
|
|
431
|
-
border: false,
|
|
432
|
-
"render-label": _vm.$scopedSlots.default,
|
|
433
|
-
},
|
|
434
|
-
on: {
|
|
435
|
-
"expand-change": _vm.handleExpandChange,
|
|
436
|
-
close: function ($event) {
|
|
437
|
-
_vm.toggleDropDownVisible(false)
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
model: {
|
|
441
|
-
value: _vm.checkedValue,
|
|
442
|
-
callback: function ($$v) {
|
|
443
|
-
_vm.checkedValue = $$v
|
|
444
|
-
},
|
|
445
|
-
expression: "checkedValue",
|
|
446
|
-
},
|
|
447
|
-
}),
|
|
448
|
-
_vm.filterable
|
|
449
|
-
? _c(
|
|
450
|
-
"el-scrollbar",
|
|
451
|
-
{
|
|
452
|
-
directives: [
|
|
453
|
-
{
|
|
454
|
-
name: "show",
|
|
455
|
-
rawName: "v-show",
|
|
456
|
-
value: _vm.filtering,
|
|
457
|
-
expression: "filtering",
|
|
458
|
-
},
|
|
459
|
-
],
|
|
460
|
-
ref: "suggestionPanel",
|
|
461
|
-
staticClass: "el-cascader__suggestion-panel",
|
|
462
|
-
attrs: {
|
|
463
|
-
tag: "ul",
|
|
464
|
-
"view-class": "el-cascader__suggestion-list",
|
|
465
|
-
},
|
|
466
|
-
nativeOn: {
|
|
467
|
-
keydown: function ($event) {
|
|
468
|
-
return _vm.handleSuggestionKeyDown($event)
|
|
469
|
-
},
|
|
470
|
-
},
|
|
471
|
-
},
|
|
472
|
-
[
|
|
473
|
-
_vm.suggestions.length
|
|
474
|
-
? _vm._l(_vm.suggestions, function (item, index) {
|
|
475
|
-
return _c(
|
|
476
|
-
"li",
|
|
477
|
-
{
|
|
478
|
-
key: item.uid,
|
|
479
|
-
class: [
|
|
480
|
-
"el-cascader__suggestion-item",
|
|
481
|
-
item.checked && "is-checked",
|
|
482
|
-
],
|
|
483
|
-
attrs: { tabindex: -1 },
|
|
484
|
-
on: {
|
|
485
|
-
click: function ($event) {
|
|
486
|
-
_vm.handleSuggestionClick(index)
|
|
487
|
-
},
|
|
488
|
-
},
|
|
489
|
-
},
|
|
490
|
-
[
|
|
491
|
-
_c("span", [_vm._v(_vm._s(item.text))]),
|
|
492
|
-
item.checked
|
|
493
|
-
? _c("i", { staticClass: "el-icon-check" })
|
|
494
|
-
: _vm._e(),
|
|
495
|
-
]
|
|
496
|
-
)
|
|
497
|
-
})
|
|
498
|
-
: _vm._t("empty", [
|
|
499
|
-
_c(
|
|
500
|
-
"li",
|
|
501
|
-
{ staticClass: "el-cascader__empty-text" },
|
|
502
|
-
[_vm._v(_vm._s(_vm.t("el.cascader.noMatch")))]
|
|
503
|
-
),
|
|
504
|
-
]),
|
|
505
|
-
],
|
|
506
|
-
2
|
|
507
|
-
)
|
|
508
|
-
: _vm._e(),
|
|
509
|
-
],
|
|
510
|
-
1
|
|
511
|
-
),
|
|
512
|
-
]
|
|
513
|
-
),
|
|
514
|
-
],
|
|
515
|
-
1
|
|
516
|
-
)
|
|
517
|
-
}
|
|
518
|
-
var staticRenderFns = []
|
|
519
|
-
render._withStripped = true
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
// CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=template&id=5e697676
|
|
523
|
-
|
|
524
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
|
|
525
|
-
var vue_popper_ = __webpack_require__(5);
|
|
526
|
-
var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
|
|
527
|
-
|
|
528
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
|
|
529
|
-
var clickoutside_ = __webpack_require__(14);
|
|
530
|
-
var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
|
|
531
|
-
|
|
532
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
|
|
533
|
-
var emitter_ = __webpack_require__(4);
|
|
534
|
-
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
535
|
-
|
|
536
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
|
|
537
|
-
var locale_ = __webpack_require__(9);
|
|
538
|
-
var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
|
|
539
|
-
|
|
540
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
|
|
541
|
-
var migrating_ = __webpack_require__(7);
|
|
542
|
-
var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
|
|
543
|
-
|
|
544
|
-
// EXTERNAL MODULE: ./packages/input/index.js + 6 modules
|
|
545
|
-
var packages_input = __webpack_require__(13);
|
|
546
|
-
|
|
547
|
-
// EXTERNAL MODULE: ./packages/tag/index.js + 3 modules
|
|
548
|
-
var packages_tag = __webpack_require__(30);
|
|
549
|
-
|
|
550
|
-
// EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
|
|
551
|
-
var scrollbar = __webpack_require__(18);
|
|
552
|
-
|
|
553
|
-
// EXTERNAL MODULE: ./packages/cascader-panel/index.js + 13 modules
|
|
554
|
-
var cascader_panel = __webpack_require__(47);
|
|
555
|
-
|
|
556
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/aria-utils"
|
|
557
|
-
var aria_utils_ = __webpack_require__(40);
|
|
558
|
-
var aria_utils_default = /*#__PURE__*/__webpack_require__.n(aria_utils_);
|
|
559
|
-
|
|
560
|
-
// EXTERNAL MODULE: external "element-ui/lib/locale"
|
|
561
|
-
var lib_locale_ = __webpack_require__(22);
|
|
562
|
-
|
|
563
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/util"
|
|
564
|
-
var util_ = __webpack_require__(3);
|
|
565
|
-
|
|
566
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/types"
|
|
567
|
-
var types_ = __webpack_require__(21);
|
|
568
|
-
|
|
569
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/shared"
|
|
570
|
-
var shared_ = __webpack_require__(11);
|
|
571
|
-
|
|
572
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
|
|
573
|
-
var resize_event_ = __webpack_require__(10);
|
|
574
|
-
|
|
575
|
-
// EXTERNAL MODULE: external "throttle-debounce/debounce"
|
|
576
|
-
var debounce_ = __webpack_require__(15);
|
|
577
|
-
var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
|
|
578
|
-
|
|
579
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader/src/cascader.vue?vue&type=script&lang=js
|
|
580
|
-
//
|
|
581
|
-
//
|
|
582
|
-
//
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
//
|
|
586
|
-
//
|
|
587
|
-
//
|
|
588
|
-
//
|
|
589
|
-
//
|
|
590
|
-
//
|
|
591
|
-
//
|
|
592
|
-
//
|
|
593
|
-
//
|
|
594
|
-
//
|
|
595
|
-
//
|
|
596
|
-
//
|
|
597
|
-
//
|
|
598
|
-
//
|
|
599
|
-
//
|
|
600
|
-
//
|
|
601
|
-
//
|
|
602
|
-
//
|
|
603
|
-
//
|
|
604
|
-
//
|
|
605
|
-
//
|
|
606
|
-
//
|
|
607
|
-
//
|
|
608
|
-
//
|
|
609
|
-
//
|
|
610
|
-
//
|
|
611
|
-
//
|
|
612
|
-
//
|
|
613
|
-
//
|
|
614
|
-
//
|
|
615
|
-
//
|
|
616
|
-
//
|
|
617
|
-
//
|
|
618
|
-
//
|
|
619
|
-
//
|
|
620
|
-
//
|
|
621
|
-
//
|
|
622
|
-
//
|
|
623
|
-
//
|
|
624
|
-
//
|
|
625
|
-
//
|
|
626
|
-
//
|
|
627
|
-
//
|
|
628
|
-
//
|
|
629
|
-
//
|
|
630
|
-
//
|
|
631
|
-
//
|
|
632
|
-
//
|
|
633
|
-
//
|
|
634
|
-
//
|
|
635
|
-
//
|
|
636
|
-
//
|
|
637
|
-
//
|
|
638
|
-
//
|
|
639
|
-
//
|
|
640
|
-
//
|
|
641
|
-
//
|
|
642
|
-
//
|
|
643
|
-
//
|
|
644
|
-
//
|
|
645
|
-
//
|
|
646
|
-
//
|
|
647
|
-
//
|
|
648
|
-
//
|
|
649
|
-
//
|
|
650
|
-
//
|
|
651
|
-
//
|
|
652
|
-
//
|
|
653
|
-
//
|
|
654
|
-
//
|
|
655
|
-
//
|
|
656
|
-
//
|
|
657
|
-
//
|
|
658
|
-
//
|
|
659
|
-
//
|
|
660
|
-
//
|
|
661
|
-
//
|
|
662
|
-
//
|
|
663
|
-
//
|
|
664
|
-
//
|
|
665
|
-
//
|
|
666
|
-
//
|
|
667
|
-
//
|
|
668
|
-
//
|
|
669
|
-
//
|
|
670
|
-
//
|
|
671
|
-
//
|
|
672
|
-
//
|
|
673
|
-
//
|
|
674
|
-
//
|
|
675
|
-
//
|
|
676
|
-
//
|
|
677
|
-
//
|
|
678
|
-
//
|
|
679
|
-
//
|
|
680
|
-
//
|
|
681
|
-
//
|
|
682
|
-
//
|
|
683
|
-
//
|
|
684
|
-
//
|
|
685
|
-
//
|
|
686
|
-
//
|
|
687
|
-
//
|
|
688
|
-
//
|
|
689
|
-
//
|
|
690
|
-
//
|
|
691
|
-
//
|
|
692
|
-
//
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
var KeyCode = aria_utils_default.a.keys;
|
|
712
|
-
|
|
713
|
-
var MigratingProps = {
|
|
714
|
-
expandTrigger: {
|
|
715
|
-
newProp: 'expandTrigger',
|
|
716
|
-
type: String
|
|
717
|
-
},
|
|
718
|
-
changeOnSelect: {
|
|
719
|
-
newProp: 'checkStrictly',
|
|
720
|
-
type: Boolean
|
|
721
|
-
},
|
|
722
|
-
hoverThreshold: {
|
|
723
|
-
newProp: 'hoverThreshold',
|
|
724
|
-
type: Number
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
|
|
728
|
-
var PopperMixin = {
|
|
729
|
-
props: {
|
|
730
|
-
placement: {
|
|
731
|
-
type: String,
|
|
732
|
-
default: 'bottom-start'
|
|
733
|
-
},
|
|
734
|
-
appendToBody: vue_popper_default.a.props.appendToBody,
|
|
735
|
-
visibleArrow: {
|
|
736
|
-
type: Boolean,
|
|
737
|
-
default: true
|
|
738
|
-
},
|
|
739
|
-
arrowOffset: vue_popper_default.a.props.arrowOffset,
|
|
740
|
-
offset: vue_popper_default.a.props.offset,
|
|
741
|
-
boundariesPadding: vue_popper_default.a.props.boundariesPadding,
|
|
742
|
-
popperOptions: vue_popper_default.a.props.popperOptions,
|
|
743
|
-
transformOrigin: vue_popper_default.a.props.transformOrigin
|
|
744
|
-
},
|
|
745
|
-
methods: vue_popper_default.a.methods,
|
|
746
|
-
data: vue_popper_default.a.data,
|
|
747
|
-
beforeDestroy: vue_popper_default.a.beforeDestroy
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
var InputSizeMap = {
|
|
751
|
-
medium: 36,
|
|
752
|
-
small: 32,
|
|
753
|
-
mini: 28
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
/* harmony default export */ var cascadervue_type_script_lang_js = ({
|
|
757
|
-
name: 'ElCascader',
|
|
758
|
-
|
|
759
|
-
directives: { Clickoutside: clickoutside_default.a },
|
|
760
|
-
|
|
761
|
-
mixins: [PopperMixin, emitter_default.a, locale_default.a, migrating_default.a],
|
|
762
|
-
|
|
763
|
-
inject: {
|
|
764
|
-
elForm: {
|
|
765
|
-
default: ''
|
|
766
|
-
},
|
|
767
|
-
elFormItem: {
|
|
768
|
-
default: ''
|
|
769
|
-
}
|
|
770
|
-
},
|
|
771
|
-
|
|
772
|
-
components: {
|
|
773
|
-
ElInput: packages_input["default"],
|
|
774
|
-
ElTag: packages_tag["default"],
|
|
775
|
-
ElScrollbar: scrollbar["default"],
|
|
776
|
-
ElCascaderPanel: cascader_panel["default"]
|
|
777
|
-
},
|
|
778
|
-
|
|
779
|
-
props: {
|
|
780
|
-
value: {},
|
|
781
|
-
options: Array,
|
|
782
|
-
props: Object,
|
|
783
|
-
size: String,
|
|
784
|
-
placeholder: {
|
|
785
|
-
type: String,
|
|
786
|
-
default: function _default() {
|
|
787
|
-
return Object(lib_locale_["t"])('el.cascader.placeholder');
|
|
788
|
-
}
|
|
789
|
-
},
|
|
790
|
-
disabled: Boolean,
|
|
791
|
-
clearable: Boolean,
|
|
792
|
-
filterable: Boolean,
|
|
793
|
-
filterMethod: Function,
|
|
794
|
-
separator: {
|
|
795
|
-
type: String,
|
|
796
|
-
default: ' / '
|
|
797
|
-
},
|
|
798
|
-
showAllLevels: {
|
|
799
|
-
type: Boolean,
|
|
800
|
-
default: true
|
|
801
|
-
},
|
|
802
|
-
collapseTags: Boolean,
|
|
803
|
-
debounce: {
|
|
804
|
-
type: Number,
|
|
805
|
-
default: 300
|
|
806
|
-
},
|
|
807
|
-
beforeFilter: {
|
|
808
|
-
type: Function,
|
|
809
|
-
default: function _default() {
|
|
810
|
-
return function () {};
|
|
811
|
-
}
|
|
812
|
-
},
|
|
813
|
-
popperClass: String
|
|
814
|
-
},
|
|
815
|
-
|
|
816
|
-
data: function data() {
|
|
817
|
-
return {
|
|
818
|
-
dropDownVisible: false,
|
|
819
|
-
checkedValue: this.value,
|
|
820
|
-
inputHover: false,
|
|
821
|
-
inputValue: null,
|
|
822
|
-
presentText: null,
|
|
823
|
-
presentTags: [],
|
|
824
|
-
checkedNodes: [],
|
|
825
|
-
filtering: false,
|
|
826
|
-
suggestions: [],
|
|
827
|
-
inputInitialHeight: 0,
|
|
828
|
-
pressDeleteCount: 0
|
|
829
|
-
};
|
|
830
|
-
},
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
computed: {
|
|
834
|
-
realSize: function realSize() {
|
|
835
|
-
var _elFormItemSize = (this.elFormItem || {}).elFormItemSize;
|
|
836
|
-
return this.size || _elFormItemSize || (this.$ELEMENT || {}).size;
|
|
837
|
-
},
|
|
838
|
-
tagSize: function tagSize() {
|
|
839
|
-
return ['small', 'mini'].indexOf(this.realSize) > -1 ? 'mini' : 'small';
|
|
840
|
-
},
|
|
841
|
-
isDisabled: function isDisabled() {
|
|
842
|
-
return this.disabled || (this.elForm || {}).disabled;
|
|
843
|
-
},
|
|
844
|
-
config: function config() {
|
|
845
|
-
var config = this.props || {};
|
|
846
|
-
var $attrs = this.$attrs;
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
Object.keys(MigratingProps).forEach(function (oldProp) {
|
|
850
|
-
var _MigratingProps$oldPr = MigratingProps[oldProp],
|
|
851
|
-
newProp = _MigratingProps$oldPr.newProp,
|
|
852
|
-
type = _MigratingProps$oldPr.type;
|
|
853
|
-
|
|
854
|
-
var oldValue = $attrs[oldProp] || $attrs[Object(util_["kebabCase"])(oldProp)];
|
|
855
|
-
if (Object(shared_["isDef"])(oldProp) && !Object(shared_["isDef"])(config[newProp])) {
|
|
856
|
-
if (type === Boolean && oldValue === '') {
|
|
857
|
-
oldValue = true;
|
|
858
|
-
}
|
|
859
|
-
config[newProp] = oldValue;
|
|
860
|
-
}
|
|
861
|
-
});
|
|
862
|
-
|
|
863
|
-
return config;
|
|
864
|
-
},
|
|
865
|
-
multiple: function multiple() {
|
|
866
|
-
return this.config.multiple;
|
|
867
|
-
},
|
|
868
|
-
leafOnly: function leafOnly() {
|
|
869
|
-
return !this.config.checkStrictly;
|
|
870
|
-
},
|
|
871
|
-
readonly: function readonly() {
|
|
872
|
-
return !this.filterable || this.multiple;
|
|
873
|
-
},
|
|
874
|
-
clearBtnVisible: function clearBtnVisible() {
|
|
875
|
-
if (!this.clearable || this.isDisabled || this.filtering || !this.inputHover) {
|
|
876
|
-
return false;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
return this.multiple ? !!this.checkedNodes.filter(function (node) {
|
|
880
|
-
return !node.isDisabled;
|
|
881
|
-
}).length : !!this.presentText;
|
|
882
|
-
},
|
|
883
|
-
panel: function panel() {
|
|
884
|
-
return this.$refs.panel;
|
|
885
|
-
}
|
|
886
|
-
},
|
|
887
|
-
|
|
888
|
-
watch: {
|
|
889
|
-
disabled: function disabled() {
|
|
890
|
-
this.computePresentContent();
|
|
891
|
-
},
|
|
892
|
-
value: function value(val) {
|
|
893
|
-
if (!Object(util_["isEqual"])(val, this.checkedValue)) {
|
|
894
|
-
this.checkedValue = val;
|
|
895
|
-
this.computePresentContent();
|
|
896
|
-
}
|
|
897
|
-
},
|
|
898
|
-
checkedValue: function checkedValue(val) {
|
|
899
|
-
var value = this.value,
|
|
900
|
-
dropDownVisible = this.dropDownVisible;
|
|
901
|
-
var _config = this.config,
|
|
902
|
-
checkStrictly = _config.checkStrictly,
|
|
903
|
-
multiple = _config.multiple;
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
if (!Object(util_["isEqual"])(val, value) || Object(types_["isUndefined"])(value)) {
|
|
907
|
-
this.computePresentContent();
|
|
908
|
-
// hide dropdown when single mode
|
|
909
|
-
if (!multiple && !checkStrictly && dropDownVisible) {
|
|
910
|
-
this.toggleDropDownVisible(false);
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
this.$emit('input', val);
|
|
914
|
-
this.$emit('change', val);
|
|
915
|
-
this.dispatch('ElFormItem', 'el.form.change', [val]);
|
|
916
|
-
}
|
|
917
|
-
},
|
|
918
|
-
|
|
919
|
-
options: {
|
|
920
|
-
handler: function handler() {
|
|
921
|
-
this.$nextTick(this.computePresentContent);
|
|
922
|
-
},
|
|
923
|
-
deep: true
|
|
924
|
-
},
|
|
925
|
-
presentText: function presentText(val) {
|
|
926
|
-
this.inputValue = val;
|
|
927
|
-
},
|
|
928
|
-
presentTags: function presentTags(val, oldVal) {
|
|
929
|
-
if (this.multiple && (val.length || oldVal.length)) {
|
|
930
|
-
this.$nextTick(this.updateStyle);
|
|
931
|
-
}
|
|
932
|
-
},
|
|
933
|
-
filtering: function filtering(val) {
|
|
934
|
-
this.$nextTick(this.updatePopper);
|
|
935
|
-
}
|
|
936
|
-
},
|
|
937
|
-
|
|
938
|
-
mounted: function mounted() {
|
|
939
|
-
var _this = this;
|
|
940
|
-
|
|
941
|
-
var input = this.$refs.input;
|
|
942
|
-
|
|
943
|
-
if (input && input.$el) {
|
|
944
|
-
this.inputInitialHeight = input.$el.offsetHeight || InputSizeMap[this.realSize] || 40;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
if (!this.isEmptyValue(this.value)) {
|
|
948
|
-
this.computePresentContent();
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
this.filterHandler = debounce_default()(this.debounce, function () {
|
|
952
|
-
var inputValue = _this.inputValue;
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
if (!inputValue) {
|
|
956
|
-
_this.filtering = false;
|
|
957
|
-
return;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
var before = _this.beforeFilter(inputValue);
|
|
961
|
-
if (before && before.then) {
|
|
962
|
-
before.then(_this.getSuggestions);
|
|
963
|
-
} else if (before !== false) {
|
|
964
|
-
_this.getSuggestions();
|
|
965
|
-
} else {
|
|
966
|
-
_this.filtering = false;
|
|
967
|
-
}
|
|
968
|
-
});
|
|
969
|
-
|
|
970
|
-
Object(resize_event_["addResizeListener"])(this.$el, this.updateStyle);
|
|
971
|
-
},
|
|
972
|
-
beforeDestroy: function beforeDestroy() {
|
|
973
|
-
Object(resize_event_["removeResizeListener"])(this.$el, this.updateStyle);
|
|
974
|
-
},
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
methods: {
|
|
978
|
-
getMigratingConfig: function getMigratingConfig() {
|
|
979
|
-
return {
|
|
980
|
-
props: {
|
|
981
|
-
'expand-trigger': 'expand-trigger is removed, use `props.expandTrigger` instead.',
|
|
982
|
-
'change-on-select': 'change-on-select is removed, use `props.checkStrictly` instead.',
|
|
983
|
-
'hover-threshold': 'hover-threshold is removed, use `props.hoverThreshold` instead'
|
|
984
|
-
},
|
|
985
|
-
events: {
|
|
986
|
-
'active-item-change': 'active-item-change is renamed to expand-change'
|
|
987
|
-
}
|
|
988
|
-
};
|
|
989
|
-
},
|
|
990
|
-
toggleDropDownVisible: function toggleDropDownVisible(visible) {
|
|
991
|
-
var _this2 = this;
|
|
992
|
-
|
|
993
|
-
if (this.isDisabled) return;
|
|
994
|
-
|
|
995
|
-
var dropDownVisible = this.dropDownVisible;
|
|
996
|
-
var input = this.$refs.input;
|
|
997
|
-
|
|
998
|
-
visible = Object(shared_["isDef"])(visible) ? visible : !dropDownVisible;
|
|
999
|
-
if (visible !== dropDownVisible) {
|
|
1000
|
-
this.dropDownVisible = visible;
|
|
1001
|
-
if (visible) {
|
|
1002
|
-
this.$nextTick(function () {
|
|
1003
|
-
_this2.updatePopper();
|
|
1004
|
-
_this2.panel.scrollIntoView();
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
input.$refs.input.setAttribute('aria-expanded', visible);
|
|
1008
|
-
this.$emit('visible-change', visible);
|
|
1009
|
-
}
|
|
1010
|
-
},
|
|
1011
|
-
handleDropdownLeave: function handleDropdownLeave() {
|
|
1012
|
-
this.filtering = false;
|
|
1013
|
-
this.inputValue = this.presentText;
|
|
1014
|
-
this.doDestroy();
|
|
1015
|
-
},
|
|
1016
|
-
handleKeyDown: function handleKeyDown(event) {
|
|
1017
|
-
switch (event.keyCode) {
|
|
1018
|
-
case KeyCode.enter:
|
|
1019
|
-
this.toggleDropDownVisible();
|
|
1020
|
-
break;
|
|
1021
|
-
case KeyCode.down:
|
|
1022
|
-
this.toggleDropDownVisible(true);
|
|
1023
|
-
this.focusFirstNode();
|
|
1024
|
-
event.preventDefault();
|
|
1025
|
-
break;
|
|
1026
|
-
case KeyCode.esc:
|
|
1027
|
-
case KeyCode.tab:
|
|
1028
|
-
this.toggleDropDownVisible(false);
|
|
1029
|
-
break;
|
|
1030
|
-
}
|
|
1031
|
-
},
|
|
1032
|
-
handleFocus: function handleFocus(e) {
|
|
1033
|
-
this.$emit('focus', e);
|
|
1034
|
-
},
|
|
1035
|
-
handleBlur: function handleBlur(e) {
|
|
1036
|
-
this.$emit('blur', e);
|
|
1037
|
-
},
|
|
1038
|
-
handleInput: function handleInput(val, event) {
|
|
1039
|
-
!this.dropDownVisible && this.toggleDropDownVisible(true);
|
|
1040
|
-
|
|
1041
|
-
if (event && event.isComposing) return;
|
|
1042
|
-
if (val) {
|
|
1043
|
-
this.filterHandler();
|
|
1044
|
-
} else {
|
|
1045
|
-
this.filtering = false;
|
|
1046
|
-
}
|
|
1047
|
-
},
|
|
1048
|
-
handleClear: function handleClear() {
|
|
1049
|
-
this.presentText = '';
|
|
1050
|
-
this.panel.clearCheckedNodes();
|
|
1051
|
-
},
|
|
1052
|
-
handleExpandChange: function handleExpandChange(value) {
|
|
1053
|
-
this.$nextTick(this.updatePopper.bind(this));
|
|
1054
|
-
this.$emit('expand-change', value);
|
|
1055
|
-
this.$emit('active-item-change', value); // Deprecated
|
|
1056
|
-
},
|
|
1057
|
-
focusFirstNode: function focusFirstNode() {
|
|
1058
|
-
var _this3 = this;
|
|
1059
|
-
|
|
1060
|
-
this.$nextTick(function () {
|
|
1061
|
-
var filtering = _this3.filtering;
|
|
1062
|
-
var _$refs = _this3.$refs,
|
|
1063
|
-
popper = _$refs.popper,
|
|
1064
|
-
suggestionPanel = _$refs.suggestionPanel;
|
|
1065
|
-
|
|
1066
|
-
var firstNode = null;
|
|
1067
|
-
|
|
1068
|
-
if (filtering && suggestionPanel) {
|
|
1069
|
-
firstNode = suggestionPanel.$el.querySelector('.el-cascader__suggestion-item');
|
|
1070
|
-
} else {
|
|
1071
|
-
var firstMenu = popper.querySelector('.el-cascader-menu');
|
|
1072
|
-
firstNode = firstMenu.querySelector('.el-cascader-node[tabindex="-1"]');
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
if (firstNode) {
|
|
1076
|
-
firstNode.focus();
|
|
1077
|
-
!filtering && firstNode.click();
|
|
1078
|
-
}
|
|
1079
|
-
});
|
|
1080
|
-
},
|
|
1081
|
-
computePresentContent: function computePresentContent() {
|
|
1082
|
-
var _this4 = this;
|
|
1083
|
-
|
|
1084
|
-
// nextTick is required, because checked nodes may not change right now
|
|
1085
|
-
this.$nextTick(function () {
|
|
1086
|
-
if (_this4.config.multiple) {
|
|
1087
|
-
_this4.computePresentTags();
|
|
1088
|
-
_this4.presentText = _this4.presentTags.length ? ' ' : null;
|
|
1089
|
-
} else {
|
|
1090
|
-
_this4.computePresentText();
|
|
1091
|
-
}
|
|
1092
|
-
});
|
|
1093
|
-
},
|
|
1094
|
-
isEmptyValue: function isEmptyValue(val) {
|
|
1095
|
-
var multiple = this.multiple;
|
|
1096
|
-
var emitPath = this.panel.config.emitPath;
|
|
1097
|
-
|
|
1098
|
-
if (multiple || emitPath) {
|
|
1099
|
-
return Object(util_["isEmpty"])(val);
|
|
1100
|
-
}
|
|
1101
|
-
return false;
|
|
1102
|
-
},
|
|
1103
|
-
computePresentText: function computePresentText() {
|
|
1104
|
-
var checkedValue = this.checkedValue,
|
|
1105
|
-
config = this.config;
|
|
1106
|
-
|
|
1107
|
-
if (!this.isEmptyValue(checkedValue)) {
|
|
1108
|
-
var node = this.panel.getNodeByValue(checkedValue);
|
|
1109
|
-
if (node && (config.checkStrictly || node.isLeaf)) {
|
|
1110
|
-
this.presentText = node.getText(this.showAllLevels, this.separator);
|
|
1111
|
-
return;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
this.presentText = null;
|
|
1115
|
-
},
|
|
1116
|
-
computePresentTags: function computePresentTags() {
|
|
1117
|
-
var isDisabled = this.isDisabled,
|
|
1118
|
-
leafOnly = this.leafOnly,
|
|
1119
|
-
showAllLevels = this.showAllLevels,
|
|
1120
|
-
separator = this.separator,
|
|
1121
|
-
collapseTags = this.collapseTags;
|
|
1122
|
-
|
|
1123
|
-
var checkedNodes = this.getCheckedNodes(leafOnly);
|
|
1124
|
-
var tags = [];
|
|
1125
|
-
|
|
1126
|
-
var genTag = function genTag(node) {
|
|
1127
|
-
return {
|
|
1128
|
-
node: node,
|
|
1129
|
-
key: node.uid,
|
|
1130
|
-
text: node.getText(showAllLevels, separator),
|
|
1131
|
-
hitState: false,
|
|
1132
|
-
closable: !isDisabled && !node.isDisabled
|
|
1133
|
-
};
|
|
1134
|
-
};
|
|
1135
|
-
|
|
1136
|
-
if (checkedNodes.length) {
|
|
1137
|
-
var first = checkedNodes[0],
|
|
1138
|
-
rest = checkedNodes.slice(1);
|
|
1139
|
-
|
|
1140
|
-
var restCount = rest.length;
|
|
1141
|
-
tags.push(genTag(first));
|
|
1142
|
-
|
|
1143
|
-
if (restCount) {
|
|
1144
|
-
if (collapseTags) {
|
|
1145
|
-
tags.push({
|
|
1146
|
-
key: -1,
|
|
1147
|
-
text: '+ ' + restCount,
|
|
1148
|
-
closable: false
|
|
1149
|
-
});
|
|
1150
|
-
} else {
|
|
1151
|
-
rest.forEach(function (node) {
|
|
1152
|
-
return tags.push(genTag(node));
|
|
1153
|
-
});
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
this.checkedNodes = checkedNodes;
|
|
1159
|
-
this.presentTags = tags;
|
|
1160
|
-
},
|
|
1161
|
-
getSuggestions: function getSuggestions() {
|
|
1162
|
-
var _this5 = this;
|
|
1163
|
-
|
|
1164
|
-
var filterMethod = this.filterMethod;
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
if (!Object(types_["isFunction"])(filterMethod)) {
|
|
1168
|
-
filterMethod = function filterMethod(node, keyword) {
|
|
1169
|
-
return node.text.includes(keyword);
|
|
1170
|
-
};
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
var suggestions = this.panel.getFlattedNodes(this.leafOnly).filter(function (node) {
|
|
1174
|
-
if (node.isDisabled) return false;
|
|
1175
|
-
node.text = node.getText(_this5.showAllLevels, _this5.separator) || '';
|
|
1176
|
-
return filterMethod(node, _this5.inputValue);
|
|
1177
|
-
});
|
|
1178
|
-
|
|
1179
|
-
if (this.multiple) {
|
|
1180
|
-
this.presentTags.forEach(function (tag) {
|
|
1181
|
-
tag.hitState = false;
|
|
1182
|
-
});
|
|
1183
|
-
} else {
|
|
1184
|
-
suggestions.forEach(function (node) {
|
|
1185
|
-
node.checked = Object(util_["isEqual"])(_this5.checkedValue, node.getValueByOption());
|
|
1186
|
-
});
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
this.filtering = true;
|
|
1190
|
-
this.suggestions = suggestions;
|
|
1191
|
-
this.$nextTick(this.updatePopper);
|
|
1192
|
-
},
|
|
1193
|
-
handleSuggestionKeyDown: function handleSuggestionKeyDown(event) {
|
|
1194
|
-
var keyCode = event.keyCode,
|
|
1195
|
-
target = event.target;
|
|
1196
|
-
|
|
1197
|
-
switch (keyCode) {
|
|
1198
|
-
case KeyCode.enter:
|
|
1199
|
-
target.click();
|
|
1200
|
-
break;
|
|
1201
|
-
case KeyCode.up:
|
|
1202
|
-
var prev = target.previousElementSibling;
|
|
1203
|
-
prev && prev.focus();
|
|
1204
|
-
break;
|
|
1205
|
-
case KeyCode.down:
|
|
1206
|
-
var next = target.nextElementSibling;
|
|
1207
|
-
next && next.focus();
|
|
1208
|
-
break;
|
|
1209
|
-
case KeyCode.esc:
|
|
1210
|
-
case KeyCode.tab:
|
|
1211
|
-
this.toggleDropDownVisible(false);
|
|
1212
|
-
break;
|
|
1213
|
-
}
|
|
1214
|
-
},
|
|
1215
|
-
handleDelete: function handleDelete() {
|
|
1216
|
-
var inputValue = this.inputValue,
|
|
1217
|
-
pressDeleteCount = this.pressDeleteCount,
|
|
1218
|
-
presentTags = this.presentTags;
|
|
1219
|
-
|
|
1220
|
-
var lastIndex = presentTags.length - 1;
|
|
1221
|
-
var lastTag = presentTags[lastIndex];
|
|
1222
|
-
this.pressDeleteCount = inputValue ? 0 : pressDeleteCount + 1;
|
|
1223
|
-
|
|
1224
|
-
if (!lastTag) return;
|
|
1225
|
-
|
|
1226
|
-
if (this.pressDeleteCount) {
|
|
1227
|
-
if (lastTag.hitState) {
|
|
1228
|
-
this.deleteTag(lastTag);
|
|
1229
|
-
} else {
|
|
1230
|
-
lastTag.hitState = true;
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
},
|
|
1234
|
-
handleSuggestionClick: function handleSuggestionClick(index) {
|
|
1235
|
-
var multiple = this.multiple;
|
|
1236
|
-
|
|
1237
|
-
var targetNode = this.suggestions[index];
|
|
1238
|
-
|
|
1239
|
-
if (multiple) {
|
|
1240
|
-
var checked = targetNode.checked;
|
|
1241
|
-
|
|
1242
|
-
targetNode.doCheck(!checked);
|
|
1243
|
-
this.panel.calculateMultiCheckedValue();
|
|
1244
|
-
} else {
|
|
1245
|
-
this.checkedValue = targetNode.getValueByOption();
|
|
1246
|
-
this.toggleDropDownVisible(false);
|
|
1247
|
-
}
|
|
1248
|
-
},
|
|
1249
|
-
deleteTag: function deleteTag(tag) {
|
|
1250
|
-
var checkedValue = this.checkedValue;
|
|
1251
|
-
|
|
1252
|
-
var current = tag.node.getValueByOption();
|
|
1253
|
-
var val = checkedValue.find(function (n) {
|
|
1254
|
-
return Object(util_["isEqual"])(n, current);
|
|
1255
|
-
});
|
|
1256
|
-
this.checkedValue = checkedValue.filter(function (n) {
|
|
1257
|
-
return !Object(util_["isEqual"])(n, current);
|
|
1258
|
-
});
|
|
1259
|
-
this.$emit('remove-tag', val);
|
|
1260
|
-
},
|
|
1261
|
-
updateStyle: function updateStyle() {
|
|
1262
|
-
var $el = this.$el,
|
|
1263
|
-
inputInitialHeight = this.inputInitialHeight;
|
|
1264
|
-
|
|
1265
|
-
if (this.$isServer || !$el) return;
|
|
1266
|
-
|
|
1267
|
-
var suggestionPanel = this.$refs.suggestionPanel;
|
|
1268
|
-
|
|
1269
|
-
var inputInner = $el.querySelector('.el-input__inner');
|
|
1270
|
-
|
|
1271
|
-
if (!inputInner) return;
|
|
1272
|
-
|
|
1273
|
-
var tags = $el.querySelector('.el-cascader__tags');
|
|
1274
|
-
var suggestionPanelEl = null;
|
|
1275
|
-
|
|
1276
|
-
if (suggestionPanel && (suggestionPanelEl = suggestionPanel.$el)) {
|
|
1277
|
-
var suggestionList = suggestionPanelEl.querySelector('.el-cascader__suggestion-list');
|
|
1278
|
-
suggestionList.style.minWidth = inputInner.offsetWidth + 'px';
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
if (tags) {
|
|
1282
|
-
var offsetHeight = Math.round(tags.getBoundingClientRect().height);
|
|
1283
|
-
var height = Math.max(offsetHeight + 6, inputInitialHeight) + 'px';
|
|
1284
|
-
inputInner.style.height = height;
|
|
1285
|
-
if (this.dropDownVisible) {
|
|
1286
|
-
this.updatePopper();
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
},
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* public methods
|
|
1294
|
-
*/
|
|
1295
|
-
getCheckedNodes: function getCheckedNodes(leafOnly) {
|
|
1296
|
-
return this.panel.getCheckedNodes(leafOnly);
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
});
|
|
1300
|
-
// CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=script&lang=js
|
|
1301
|
-
/* harmony default export */ var src_cascadervue_type_script_lang_js = (cascadervue_type_script_lang_js);
|
|
1302
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
1303
|
-
var componentNormalizer = __webpack_require__(0);
|
|
1304
|
-
|
|
1305
|
-
// CONCATENATED MODULE: ./packages/cascader/src/cascader.vue
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
/* normalize component */
|
|
1312
|
-
|
|
1313
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
1314
|
-
src_cascadervue_type_script_lang_js,
|
|
1315
|
-
render,
|
|
1316
|
-
staticRenderFns,
|
|
1317
|
-
false,
|
|
1318
|
-
null,
|
|
1319
|
-
null,
|
|
1320
|
-
null
|
|
1321
|
-
|
|
1322
|
-
)
|
|
1323
|
-
|
|
1324
|
-
/* harmony default export */ var cascader = (component.exports);
|
|
1325
|
-
// CONCATENATED MODULE: ./packages/cascader/index.js
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
/* istanbul ignore next */
|
|
1329
|
-
cascader.install = function (Vue) {
|
|
1330
|
-
Vue.component(cascader.name, cascader);
|
|
1331
|
-
};
|
|
1332
|
-
|
|
1333
|
-
/* harmony default export */ var packages_cascader = __webpack_exports__["default"] = (cascader);
|
|
1334
|
-
|
|
1335
|
-
/***/ }),
|
|
1336
|
-
|
|
1337
|
-
/***/ 11:
|
|
1338
|
-
/***/ (function(module, exports) {
|
|
1339
|
-
|
|
1340
|
-
module.exports = require("element-ui/lib/utils/shared");
|
|
1341
|
-
|
|
1342
|
-
/***/ }),
|
|
1343
|
-
|
|
1344
|
-
/***/ 13:
|
|
1345
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1346
|
-
|
|
1347
|
-
"use strict";
|
|
1348
|
-
// ESM COMPAT FLAG
|
|
1349
|
-
__webpack_require__.r(__webpack_exports__);
|
|
1350
|
-
|
|
1351
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=048a9cde
|
|
1352
|
-
var render = function () {
|
|
1353
|
-
var _vm = this
|
|
1354
|
-
var _h = _vm.$createElement
|
|
1355
|
-
var _c = _vm._self._c || _h
|
|
1356
|
-
return _c(
|
|
1357
|
-
"div",
|
|
1358
|
-
{
|
|
1359
|
-
class: [
|
|
1360
|
-
_vm.type === "textarea" ? "el-textarea" : "el-input",
|
|
1361
|
-
_vm.inputSize ? "el-input--" + _vm.inputSize : "",
|
|
1362
|
-
{
|
|
1363
|
-
"is-disabled": _vm.inputDisabled,
|
|
1364
|
-
"is-exceed": _vm.inputExceed,
|
|
1365
|
-
"el-input-group": _vm.$slots.prepend || _vm.$slots.append,
|
|
1366
|
-
"el-input-group--append": _vm.$slots.append,
|
|
1367
|
-
"el-input-group--prepend": _vm.$slots.prepend,
|
|
1368
|
-
"el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
|
|
1369
|
-
"el-input--suffix":
|
|
1370
|
-
_vm.$slots.suffix ||
|
|
1371
|
-
_vm.suffixIcon ||
|
|
1372
|
-
_vm.clearable ||
|
|
1373
|
-
_vm.showPassword,
|
|
1374
|
-
},
|
|
1375
|
-
],
|
|
1376
|
-
on: {
|
|
1377
|
-
mouseenter: function ($event) {
|
|
1378
|
-
_vm.hovering = true
|
|
1379
|
-
},
|
|
1380
|
-
mouseleave: function ($event) {
|
|
1381
|
-
_vm.hovering = false
|
|
1382
|
-
},
|
|
1383
|
-
},
|
|
1384
|
-
},
|
|
1385
|
-
[
|
|
1386
|
-
_vm.type !== "textarea"
|
|
1387
|
-
? [
|
|
1388
|
-
_vm.$slots.prepend
|
|
1389
|
-
? _c(
|
|
1390
|
-
"div",
|
|
1391
|
-
{ staticClass: "el-input-group__prepend" },
|
|
1392
|
-
[_vm._t("prepend")],
|
|
1393
|
-
2
|
|
1394
|
-
)
|
|
1395
|
-
: _vm._e(),
|
|
1396
|
-
_vm.type !== "textarea"
|
|
1397
|
-
? _c(
|
|
1398
|
-
"input",
|
|
1399
|
-
_vm._b(
|
|
1400
|
-
{
|
|
1401
|
-
ref: "input",
|
|
1402
|
-
staticClass: "el-input__inner",
|
|
1403
|
-
attrs: {
|
|
1404
|
-
tabindex: _vm.tabindex,
|
|
1405
|
-
type: _vm.showPassword
|
|
1406
|
-
? _vm.passwordVisible
|
|
1407
|
-
? "text"
|
|
1408
|
-
: "password"
|
|
1409
|
-
: _vm.type,
|
|
1410
|
-
disabled: _vm.inputDisabled,
|
|
1411
|
-
readonly: _vm.readonly,
|
|
1412
|
-
autocomplete: _vm.autoComplete || _vm.autocomplete,
|
|
1413
|
-
"aria-label": _vm.label,
|
|
1414
|
-
},
|
|
1415
|
-
on: {
|
|
1416
|
-
compositionstart: _vm.handleCompositionStart,
|
|
1417
|
-
compositionupdate: _vm.handleCompositionUpdate,
|
|
1418
|
-
compositionend: _vm.handleCompositionEnd,
|
|
1419
|
-
input: _vm.handleInput,
|
|
1420
|
-
focus: _vm.handleFocus,
|
|
1421
|
-
blur: _vm.handleBlur,
|
|
1422
|
-
change: _vm.handleChange,
|
|
1423
|
-
},
|
|
1424
|
-
},
|
|
1425
|
-
"input",
|
|
1426
|
-
_vm.$attrs,
|
|
1427
|
-
false
|
|
1428
|
-
)
|
|
1429
|
-
)
|
|
1430
|
-
: _vm._e(),
|
|
1431
|
-
_vm.$slots.prefix || _vm.prefixIcon
|
|
1432
|
-
? _c(
|
|
1433
|
-
"span",
|
|
1434
|
-
{ staticClass: "el-input__prefix" },
|
|
1435
|
-
[
|
|
1436
|
-
_vm._t("prefix"),
|
|
1437
|
-
_vm.prefixIcon
|
|
1438
|
-
? _c("i", {
|
|
1439
|
-
staticClass: "el-input__icon",
|
|
1440
|
-
class: _vm.prefixIcon,
|
|
1441
|
-
})
|
|
1442
|
-
: _vm._e(),
|
|
1443
|
-
],
|
|
1444
|
-
2
|
|
1445
|
-
)
|
|
1446
|
-
: _vm._e(),
|
|
1447
|
-
_vm.getSuffixVisible()
|
|
1448
|
-
? _c("span", { staticClass: "el-input__suffix" }, [
|
|
1449
|
-
_c(
|
|
1450
|
-
"span",
|
|
1451
|
-
{ staticClass: "el-input__suffix-inner" },
|
|
1452
|
-
[
|
|
1453
|
-
!_vm.showClear ||
|
|
1454
|
-
!_vm.showPwdVisible ||
|
|
1455
|
-
!_vm.isWordLimitVisible
|
|
1456
|
-
? [
|
|
1457
|
-
_vm._t("suffix"),
|
|
1458
|
-
_vm.suffixIcon
|
|
1459
|
-
? _c("i", {
|
|
1460
|
-
staticClass: "el-input__icon",
|
|
1461
|
-
class: _vm.suffixIcon,
|
|
1462
|
-
})
|
|
1463
|
-
: _vm._e(),
|
|
1464
|
-
]
|
|
1465
|
-
: _vm._e(),
|
|
1466
|
-
_vm.showClear
|
|
1467
|
-
? _c("i", {
|
|
1468
|
-
staticClass:
|
|
1469
|
-
"el-input__icon el-icon-circle-close el-input__clear",
|
|
1470
|
-
on: {
|
|
1471
|
-
mousedown: function ($event) {
|
|
1472
|
-
$event.preventDefault()
|
|
1473
|
-
},
|
|
1474
|
-
click: _vm.clear,
|
|
1475
|
-
},
|
|
1476
|
-
})
|
|
1477
|
-
: _vm._e(),
|
|
1478
|
-
_vm.showPwdVisible
|
|
1479
|
-
? _c("i", {
|
|
1480
|
-
staticClass:
|
|
1481
|
-
"el-input__icon el-icon-view el-input__clear",
|
|
1482
|
-
on: { click: _vm.handlePasswordVisible },
|
|
1483
|
-
})
|
|
1484
|
-
: _vm._e(),
|
|
1485
|
-
_vm.isWordLimitVisible
|
|
1486
|
-
? _c("span", { staticClass: "el-input__count" }, [
|
|
1487
|
-
_c(
|
|
1488
|
-
"span",
|
|
1489
|
-
{ staticClass: "el-input__count-inner" },
|
|
1490
|
-
[
|
|
1491
|
-
_vm._v(
|
|
1492
|
-
"\n\t\t\t\t\t\t\t" +
|
|
1493
|
-
_vm._s(_vm.textLength) +
|
|
1494
|
-
"/" +
|
|
1495
|
-
_vm._s(_vm.upperLimit) +
|
|
1496
|
-
"\n\t\t\t\t\t\t"
|
|
1497
|
-
),
|
|
1498
|
-
]
|
|
1499
|
-
),
|
|
1500
|
-
])
|
|
1501
|
-
: _vm._e(),
|
|
1502
|
-
],
|
|
1503
|
-
2
|
|
1504
|
-
),
|
|
1505
|
-
_vm.validateState
|
|
1506
|
-
? _c("i", {
|
|
1507
|
-
staticClass: "el-input__icon",
|
|
1508
|
-
class: ["el-input__validateIcon", _vm.validateIcon],
|
|
1509
|
-
})
|
|
1510
|
-
: _vm._e(),
|
|
1511
|
-
])
|
|
1512
|
-
: _vm._e(),
|
|
1513
|
-
_vm.$slots.append
|
|
1514
|
-
? _c(
|
|
1515
|
-
"div",
|
|
1516
|
-
{ staticClass: "el-input-group__append" },
|
|
1517
|
-
[_vm._t("append")],
|
|
1518
|
-
2
|
|
1519
|
-
)
|
|
1520
|
-
: _vm._e(),
|
|
1521
|
-
]
|
|
1522
|
-
: _c(
|
|
1523
|
-
"textarea",
|
|
1524
|
-
_vm._b(
|
|
1525
|
-
{
|
|
1526
|
-
ref: "textarea",
|
|
1527
|
-
staticClass: "el-textarea__inner",
|
|
1528
|
-
style: _vm.textareaStyle,
|
|
1529
|
-
attrs: {
|
|
1530
|
-
tabindex: _vm.tabindex,
|
|
1531
|
-
disabled: _vm.inputDisabled,
|
|
1532
|
-
readonly: _vm.readonly,
|
|
1533
|
-
autocomplete: _vm.autoComplete || _vm.autocomplete,
|
|
1534
|
-
"aria-label": _vm.label,
|
|
1535
|
-
},
|
|
1536
|
-
on: {
|
|
1537
|
-
compositionstart: _vm.handleCompositionStart,
|
|
1538
|
-
compositionupdate: _vm.handleCompositionUpdate,
|
|
1539
|
-
compositionend: _vm.handleCompositionEnd,
|
|
1540
|
-
input: _vm.handleInput,
|
|
1541
|
-
focus: _vm.handleFocus,
|
|
1542
|
-
blur: _vm.handleBlur,
|
|
1543
|
-
change: _vm.handleChange,
|
|
1544
|
-
},
|
|
1545
|
-
},
|
|
1546
|
-
"textarea",
|
|
1547
|
-
_vm.$attrs,
|
|
1548
|
-
false
|
|
1549
|
-
)
|
|
1550
|
-
),
|
|
1551
|
-
_vm.isWordLimitVisible && _vm.type === "textarea"
|
|
1552
|
-
? _c("span", { staticClass: "el-input__count" }, [
|
|
1553
|
-
_vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit)),
|
|
1554
|
-
])
|
|
1555
|
-
: _vm._e(),
|
|
1556
|
-
],
|
|
1557
|
-
2
|
|
1558
|
-
)
|
|
1559
|
-
}
|
|
1560
|
-
var staticRenderFns = []
|
|
1561
|
-
render._withStripped = true
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
// CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=048a9cde
|
|
1565
|
-
|
|
1566
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
|
|
1567
|
-
var emitter_ = __webpack_require__(4);
|
|
1568
|
-
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
1569
|
-
|
|
1570
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
|
|
1571
|
-
var migrating_ = __webpack_require__(7);
|
|
1572
|
-
var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
|
|
1573
|
-
|
|
1574
|
-
// CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
|
|
1575
|
-
var hiddenTextarea = void 0;
|
|
1576
|
-
|
|
1577
|
-
var HIDDEN_STYLE = '\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
|
|
1578
|
-
|
|
1579
|
-
var CONTEXT_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
|
|
1580
|
-
|
|
1581
|
-
function calculateNodeStyling(targetElement) {
|
|
1582
|
-
var style = window.getComputedStyle(targetElement);
|
|
1583
|
-
|
|
1584
|
-
var boxSizing = style.getPropertyValue('box-sizing');
|
|
1585
|
-
|
|
1586
|
-
var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
|
|
1587
|
-
|
|
1588
|
-
var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
|
|
1589
|
-
|
|
1590
|
-
var contextStyle = CONTEXT_STYLE.map(function (name) {
|
|
1591
|
-
return name + ':' + style.getPropertyValue(name);
|
|
1592
|
-
}).join(';');
|
|
1593
|
-
|
|
1594
|
-
return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
function calcTextareaHeight(targetElement) {
|
|
1598
|
-
var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1599
|
-
var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
1600
|
-
|
|
1601
|
-
if (!hiddenTextarea) {
|
|
1602
|
-
hiddenTextarea = document.createElement('textarea');
|
|
1603
|
-
document.body.appendChild(hiddenTextarea);
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
var _calculateNodeStyling = calculateNodeStyling(targetElement),
|
|
1607
|
-
paddingSize = _calculateNodeStyling.paddingSize,
|
|
1608
|
-
borderSize = _calculateNodeStyling.borderSize,
|
|
1609
|
-
boxSizing = _calculateNodeStyling.boxSizing,
|
|
1610
|
-
contextStyle = _calculateNodeStyling.contextStyle;
|
|
1611
|
-
|
|
1612
|
-
hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
|
|
1613
|
-
hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
|
|
1614
|
-
|
|
1615
|
-
var height = hiddenTextarea.scrollHeight;
|
|
1616
|
-
var result = {};
|
|
1617
|
-
|
|
1618
|
-
if (boxSizing === 'border-box') {
|
|
1619
|
-
height = height + borderSize;
|
|
1620
|
-
} else if (boxSizing === 'content-box') {
|
|
1621
|
-
height = height - paddingSize;
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
hiddenTextarea.value = '';
|
|
1625
|
-
var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
|
|
1626
|
-
|
|
1627
|
-
if (minRows !== null) {
|
|
1628
|
-
var minHeight = singleRowHeight * minRows;
|
|
1629
|
-
if (boxSizing === 'border-box') {
|
|
1630
|
-
minHeight = minHeight + paddingSize + borderSize;
|
|
1631
|
-
}
|
|
1632
|
-
height = Math.max(minHeight, height);
|
|
1633
|
-
result.minHeight = minHeight + 'px';
|
|
1634
|
-
}
|
|
1635
|
-
if (maxRows !== null) {
|
|
1636
|
-
var maxHeight = singleRowHeight * maxRows;
|
|
1637
|
-
if (boxSizing === 'border-box') {
|
|
1638
|
-
maxHeight = maxHeight + paddingSize + borderSize;
|
|
1639
|
-
}
|
|
1640
|
-
height = Math.min(maxHeight, height);
|
|
1641
|
-
}
|
|
1642
|
-
result.height = height + 'px';
|
|
1643
|
-
hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
|
|
1644
|
-
hiddenTextarea = null;
|
|
1645
|
-
return result;
|
|
1646
|
-
};
|
|
1647
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/merge"
|
|
1648
|
-
var merge_ = __webpack_require__(6);
|
|
1649
|
-
var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
|
|
1650
|
-
|
|
1651
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/shared"
|
|
1652
|
-
var shared_ = __webpack_require__(11);
|
|
1653
|
-
|
|
1654
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=script&lang=js
|
|
1655
|
-
//
|
|
1656
|
-
//
|
|
1657
|
-
//
|
|
1658
|
-
//
|
|
1659
|
-
//
|
|
1660
|
-
//
|
|
1661
|
-
//
|
|
1662
|
-
//
|
|
1663
|
-
//
|
|
1664
|
-
//
|
|
1665
|
-
//
|
|
1666
|
-
//
|
|
1667
|
-
//
|
|
1668
|
-
//
|
|
1669
|
-
//
|
|
1670
|
-
//
|
|
1671
|
-
//
|
|
1672
|
-
//
|
|
1673
|
-
//
|
|
1674
|
-
//
|
|
1675
|
-
//
|
|
1676
|
-
//
|
|
1677
|
-
//
|
|
1678
|
-
//
|
|
1679
|
-
//
|
|
1680
|
-
//
|
|
1681
|
-
//
|
|
1682
|
-
//
|
|
1683
|
-
//
|
|
1684
|
-
//
|
|
1685
|
-
//
|
|
1686
|
-
//
|
|
1687
|
-
//
|
|
1688
|
-
//
|
|
1689
|
-
//
|
|
1690
|
-
//
|
|
1691
|
-
//
|
|
1692
|
-
//
|
|
1693
|
-
//
|
|
1694
|
-
//
|
|
1695
|
-
//
|
|
1696
|
-
//
|
|
1697
|
-
//
|
|
1698
|
-
//
|
|
1699
|
-
//
|
|
1700
|
-
//
|
|
1701
|
-
//
|
|
1702
|
-
//
|
|
1703
|
-
//
|
|
1704
|
-
//
|
|
1705
|
-
//
|
|
1706
|
-
//
|
|
1707
|
-
//
|
|
1708
|
-
//
|
|
1709
|
-
//
|
|
1710
|
-
//
|
|
1711
|
-
//
|
|
1712
|
-
//
|
|
1713
|
-
//
|
|
1714
|
-
//
|
|
1715
|
-
//
|
|
1716
|
-
//
|
|
1717
|
-
//
|
|
1718
|
-
//
|
|
1719
|
-
//
|
|
1720
|
-
//
|
|
1721
|
-
//
|
|
1722
|
-
//
|
|
1723
|
-
//
|
|
1724
|
-
//
|
|
1725
|
-
//
|
|
1726
|
-
//
|
|
1727
|
-
//
|
|
1728
|
-
//
|
|
1729
|
-
//
|
|
1730
|
-
//
|
|
1731
|
-
//
|
|
1732
|
-
//
|
|
1733
|
-
//
|
|
1734
|
-
//
|
|
1735
|
-
//
|
|
1736
|
-
//
|
|
1737
|
-
//
|
|
1738
|
-
//
|
|
1739
|
-
//
|
|
1740
|
-
//
|
|
1741
|
-
//
|
|
1742
|
-
//
|
|
1743
|
-
//
|
|
1744
|
-
//
|
|
1745
|
-
//
|
|
1746
|
-
//
|
|
1747
|
-
//
|
|
1748
|
-
//
|
|
1749
|
-
//
|
|
1750
|
-
//
|
|
1751
|
-
//
|
|
1752
|
-
//
|
|
1753
|
-
//
|
|
1754
|
-
//
|
|
1755
|
-
//
|
|
1756
|
-
//
|
|
1757
|
-
//
|
|
1758
|
-
//
|
|
1759
|
-
//
|
|
1760
|
-
//
|
|
1761
|
-
//
|
|
1762
|
-
//
|
|
1763
|
-
//
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
/* harmony default export */ var inputvue_type_script_lang_js = ({
|
|
1772
|
-
name: 'ElInput',
|
|
1773
|
-
|
|
1774
|
-
componentName: 'ElInput',
|
|
1775
|
-
|
|
1776
|
-
mixins: [emitter_default.a, migrating_default.a],
|
|
1777
|
-
|
|
1778
|
-
inheritAttrs: false,
|
|
1779
|
-
|
|
1780
|
-
inject: {
|
|
1781
|
-
elForm: {
|
|
1782
|
-
default: ''
|
|
1783
|
-
},
|
|
1784
|
-
elFormItem: {
|
|
1785
|
-
default: ''
|
|
1786
|
-
}
|
|
1787
|
-
},
|
|
1788
|
-
|
|
1789
|
-
data: function data() {
|
|
1790
|
-
return {
|
|
1791
|
-
textareaCalcStyle: {},
|
|
1792
|
-
hovering: false,
|
|
1793
|
-
focused: false,
|
|
1794
|
-
isComposing: false,
|
|
1795
|
-
passwordVisible: false
|
|
1796
|
-
};
|
|
1797
|
-
},
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
props: {
|
|
1801
|
-
value: [String, Number],
|
|
1802
|
-
size: String,
|
|
1803
|
-
resize: String,
|
|
1804
|
-
form: String,
|
|
1805
|
-
disabled: Boolean,
|
|
1806
|
-
readonly: Boolean,
|
|
1807
|
-
type: {
|
|
1808
|
-
type: String,
|
|
1809
|
-
default: 'text'
|
|
1810
|
-
},
|
|
1811
|
-
autosize: {
|
|
1812
|
-
type: [Boolean, Object],
|
|
1813
|
-
default: false
|
|
1814
|
-
},
|
|
1815
|
-
autocomplete: {
|
|
1816
|
-
type: String,
|
|
1817
|
-
default: 'off'
|
|
1818
|
-
},
|
|
1819
|
-
/** @Deprecated in next major version */
|
|
1820
|
-
autoComplete: {
|
|
1821
|
-
type: String,
|
|
1822
|
-
validator: function validator(val) {
|
|
1823
|
-
false && false;
|
|
1824
|
-
return true;
|
|
1825
|
-
}
|
|
1826
|
-
},
|
|
1827
|
-
validateEvent: {
|
|
1828
|
-
type: Boolean,
|
|
1829
|
-
default: true
|
|
1830
|
-
},
|
|
1831
|
-
suffixIcon: String,
|
|
1832
|
-
prefixIcon: String,
|
|
1833
|
-
label: String,
|
|
1834
|
-
clearable: {
|
|
1835
|
-
type: Boolean,
|
|
1836
|
-
default: false
|
|
1837
|
-
},
|
|
1838
|
-
showPassword: {
|
|
1839
|
-
type: Boolean,
|
|
1840
|
-
default: false
|
|
1841
|
-
},
|
|
1842
|
-
showWordLimit: {
|
|
1843
|
-
type: Boolean,
|
|
1844
|
-
default: false
|
|
1845
|
-
},
|
|
1846
|
-
tabindex: String
|
|
1847
|
-
},
|
|
1848
|
-
|
|
1849
|
-
computed: {
|
|
1850
|
-
_elFormItemSize: function _elFormItemSize() {
|
|
1851
|
-
return (this.elFormItem || {}).elFormItemSize;
|
|
1852
|
-
},
|
|
1853
|
-
validateState: function validateState() {
|
|
1854
|
-
return this.elFormItem ? this.elFormItem.validateState : '';
|
|
1855
|
-
},
|
|
1856
|
-
needStatusIcon: function needStatusIcon() {
|
|
1857
|
-
return this.elForm ? this.elForm.statusIcon : false;
|
|
1858
|
-
},
|
|
1859
|
-
validateIcon: function validateIcon() {
|
|
1860
|
-
return {
|
|
1861
|
-
validating: 'el-icon-loading',
|
|
1862
|
-
success: 'el-icon-circle-check',
|
|
1863
|
-
error: 'el-icon-circle-close'
|
|
1864
|
-
}[this.validateState];
|
|
1865
|
-
},
|
|
1866
|
-
textareaStyle: function textareaStyle() {
|
|
1867
|
-
return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
|
|
1868
|
-
},
|
|
1869
|
-
inputSize: function inputSize() {
|
|
1870
|
-
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
1871
|
-
},
|
|
1872
|
-
inputDisabled: function inputDisabled() {
|
|
1873
|
-
return this.disabled || (this.elForm || {}).disabled;
|
|
1874
|
-
},
|
|
1875
|
-
nativeInputValue: function nativeInputValue() {
|
|
1876
|
-
return this.value === null || this.value === undefined ? '' : String(this.value);
|
|
1877
|
-
},
|
|
1878
|
-
showClear: function showClear() {
|
|
1879
|
-
return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
|
|
1880
|
-
},
|
|
1881
|
-
showPwdVisible: function showPwdVisible() {
|
|
1882
|
-
return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
|
|
1883
|
-
},
|
|
1884
|
-
isWordLimitVisible: function isWordLimitVisible() {
|
|
1885
|
-
return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
|
|
1886
|
-
},
|
|
1887
|
-
upperLimit: function upperLimit() {
|
|
1888
|
-
return this.$attrs.maxlength;
|
|
1889
|
-
},
|
|
1890
|
-
textLength: function textLength() {
|
|
1891
|
-
if (typeof this.value === 'number') {
|
|
1892
|
-
return String(this.value).length;
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
return (this.value || '').length;
|
|
1896
|
-
},
|
|
1897
|
-
inputExceed: function inputExceed() {
|
|
1898
|
-
// show exceed style if length of initial value greater then maxlength
|
|
1899
|
-
return this.isWordLimitVisible && this.textLength > this.upperLimit;
|
|
1900
|
-
}
|
|
1901
|
-
},
|
|
1902
|
-
|
|
1903
|
-
watch: {
|
|
1904
|
-
value: function value(val) {
|
|
1905
|
-
this.$nextTick(this.resizeTextarea);
|
|
1906
|
-
if (this.validateEvent) {
|
|
1907
|
-
this.dispatch('ElFormItem', 'el.form.change', [val]);
|
|
1908
|
-
}
|
|
1909
|
-
},
|
|
1910
|
-
|
|
1911
|
-
// native input value is set explicitly
|
|
1912
|
-
// do not use v-model / :value in template
|
|
1913
|
-
// see: https://github.com/ElemeFE/element/issues/14521
|
|
1914
|
-
nativeInputValue: function nativeInputValue() {
|
|
1915
|
-
this.setNativeInputValue();
|
|
1916
|
-
},
|
|
1917
|
-
|
|
1918
|
-
// when change between <input> and <textarea>,
|
|
1919
|
-
// update DOM dependent value and styles
|
|
1920
|
-
// https://github.com/ElemeFE/element/issues/14857
|
|
1921
|
-
type: function type() {
|
|
1922
|
-
var _this = this;
|
|
1923
|
-
|
|
1924
|
-
this.$nextTick(function () {
|
|
1925
|
-
_this.setNativeInputValue();
|
|
1926
|
-
_this.resizeTextarea();
|
|
1927
|
-
_this.updateIconOffset();
|
|
1928
|
-
});
|
|
1929
|
-
}
|
|
1930
|
-
},
|
|
1931
|
-
|
|
1932
|
-
methods: {
|
|
1933
|
-
focus: function focus() {
|
|
1934
|
-
this.getInput().focus();
|
|
1935
|
-
},
|
|
1936
|
-
blur: function blur() {
|
|
1937
|
-
this.getInput().blur();
|
|
1938
|
-
},
|
|
1939
|
-
getMigratingConfig: function getMigratingConfig() {
|
|
1940
|
-
return {
|
|
1941
|
-
props: {
|
|
1942
|
-
'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
|
|
1943
|
-
'on-icon-click': 'on-icon-click is removed.'
|
|
1944
|
-
},
|
|
1945
|
-
events: {
|
|
1946
|
-
'click': 'click is removed.'
|
|
1947
|
-
}
|
|
1948
|
-
};
|
|
1949
|
-
},
|
|
1950
|
-
handleBlur: function handleBlur(event) {
|
|
1951
|
-
this.focused = false;
|
|
1952
|
-
this.$emit('blur', event);
|
|
1953
|
-
if (this.validateEvent) {
|
|
1954
|
-
this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
|
|
1955
|
-
}
|
|
1956
|
-
},
|
|
1957
|
-
select: function select() {
|
|
1958
|
-
this.getInput().select();
|
|
1959
|
-
},
|
|
1960
|
-
resizeTextarea: function resizeTextarea() {
|
|
1961
|
-
if (this.$isServer) return;
|
|
1962
|
-
var autosize = this.autosize,
|
|
1963
|
-
type = this.type;
|
|
1964
|
-
|
|
1965
|
-
if (type !== 'textarea') return;
|
|
1966
|
-
if (!autosize) {
|
|
1967
|
-
this.textareaCalcStyle = {
|
|
1968
|
-
minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
|
|
1969
|
-
};
|
|
1970
|
-
return;
|
|
1971
|
-
}
|
|
1972
|
-
var minRows = autosize.minRows;
|
|
1973
|
-
var maxRows = autosize.maxRows;
|
|
1974
|
-
|
|
1975
|
-
this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
|
|
1976
|
-
},
|
|
1977
|
-
setNativeInputValue: function setNativeInputValue() {
|
|
1978
|
-
var input = this.getInput();
|
|
1979
|
-
if (!input) return;
|
|
1980
|
-
if (input.value === this.nativeInputValue) return;
|
|
1981
|
-
input.value = this.nativeInputValue;
|
|
1982
|
-
},
|
|
1983
|
-
handleFocus: function handleFocus(event) {
|
|
1984
|
-
this.focused = true;
|
|
1985
|
-
this.$emit('focus', event);
|
|
1986
|
-
},
|
|
1987
|
-
handleCompositionStart: function handleCompositionStart(event) {
|
|
1988
|
-
this.$emit('compositionstart', event);
|
|
1989
|
-
this.isComposing = true;
|
|
1990
|
-
},
|
|
1991
|
-
handleCompositionUpdate: function handleCompositionUpdate(event) {
|
|
1992
|
-
this.$emit('compositionupdate', event);
|
|
1993
|
-
var text = event.target.value;
|
|
1994
|
-
var lastCharacter = text[text.length - 1] || '';
|
|
1995
|
-
this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
|
|
1996
|
-
},
|
|
1997
|
-
handleCompositionEnd: function handleCompositionEnd(event) {
|
|
1998
|
-
this.$emit('compositionend', event);
|
|
1999
|
-
if (this.isComposing) {
|
|
2000
|
-
this.isComposing = false;
|
|
2001
|
-
this.handleInput(event);
|
|
2002
|
-
}
|
|
2003
|
-
},
|
|
2004
|
-
handleInput: function handleInput(event) {
|
|
2005
|
-
// should not emit input during composition
|
|
2006
|
-
// see: https://github.com/ElemeFE/element/issues/10516
|
|
2007
|
-
if (this.isComposing) return;
|
|
2008
|
-
|
|
2009
|
-
// hack for https://github.com/ElemeFE/element/issues/8548
|
|
2010
|
-
// should remove the following line when we don't support IE
|
|
2011
|
-
if (event.target.value === this.nativeInputValue) return;
|
|
2012
|
-
|
|
2013
|
-
this.$emit('input', event.target.value);
|
|
2014
|
-
|
|
2015
|
-
// ensure native input value is controlled
|
|
2016
|
-
// see: https://github.com/ElemeFE/element/issues/12850
|
|
2017
|
-
this.$nextTick(this.setNativeInputValue);
|
|
2018
|
-
},
|
|
2019
|
-
handleChange: function handleChange(event) {
|
|
2020
|
-
this.$emit('change', event.target.value);
|
|
2021
|
-
},
|
|
2022
|
-
calcIconOffset: function calcIconOffset(place) {
|
|
2023
|
-
var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
|
|
2024
|
-
if (!elList.length) return;
|
|
2025
|
-
var el = null;
|
|
2026
|
-
for (var i = 0; i < elList.length; i++) {
|
|
2027
|
-
if (elList[i].parentNode === this.$el) {
|
|
2028
|
-
el = elList[i];
|
|
2029
|
-
break;
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
|
-
if (!el) return;
|
|
2033
|
-
var pendantMap = {
|
|
2034
|
-
suffix: 'append',
|
|
2035
|
-
prefix: 'prepend'
|
|
2036
|
-
};
|
|
2037
|
-
|
|
2038
|
-
var pendant = pendantMap[place];
|
|
2039
|
-
if (this.$slots[pendant]) {
|
|
2040
|
-
el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
|
|
2041
|
-
} else {
|
|
2042
|
-
el.removeAttribute('style');
|
|
2043
|
-
}
|
|
2044
|
-
},
|
|
2045
|
-
updateIconOffset: function updateIconOffset() {
|
|
2046
|
-
this.calcIconOffset('prefix');
|
|
2047
|
-
this.calcIconOffset('suffix');
|
|
2048
|
-
},
|
|
2049
|
-
clear: function clear() {
|
|
2050
|
-
this.$emit('input', '');
|
|
2051
|
-
this.$emit('change', '');
|
|
2052
|
-
this.$emit('clear');
|
|
2053
|
-
},
|
|
2054
|
-
handlePasswordVisible: function handlePasswordVisible() {
|
|
2055
|
-
var _this2 = this;
|
|
2056
|
-
|
|
2057
|
-
this.passwordVisible = !this.passwordVisible;
|
|
2058
|
-
this.$nextTick(function () {
|
|
2059
|
-
_this2.focus();
|
|
2060
|
-
});
|
|
2061
|
-
},
|
|
2062
|
-
getInput: function getInput() {
|
|
2063
|
-
return this.$refs.input || this.$refs.textarea;
|
|
2064
|
-
},
|
|
2065
|
-
getSuffixVisible: function getSuffixVisible() {
|
|
2066
|
-
return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
|
|
2067
|
-
}
|
|
2068
|
-
},
|
|
2069
|
-
|
|
2070
|
-
created: function created() {
|
|
2071
|
-
this.$on('inputSelect', this.select);
|
|
2072
|
-
},
|
|
2073
|
-
mounted: function mounted() {
|
|
2074
|
-
this.setNativeInputValue();
|
|
2075
|
-
this.resizeTextarea();
|
|
2076
|
-
this.updateIconOffset();
|
|
2077
|
-
},
|
|
2078
|
-
updated: function updated() {
|
|
2079
|
-
this.$nextTick(this.updateIconOffset);
|
|
2080
|
-
}
|
|
2081
|
-
});
|
|
2082
|
-
// CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js
|
|
2083
|
-
/* harmony default export */ var src_inputvue_type_script_lang_js = (inputvue_type_script_lang_js);
|
|
2084
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
2085
|
-
var componentNormalizer = __webpack_require__(0);
|
|
2086
|
-
|
|
2087
|
-
// CONCATENATED MODULE: ./packages/input/src/input.vue
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
/* normalize component */
|
|
2094
|
-
|
|
2095
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
2096
|
-
src_inputvue_type_script_lang_js,
|
|
2097
|
-
render,
|
|
2098
|
-
staticRenderFns,
|
|
2099
|
-
false,
|
|
2100
|
-
null,
|
|
2101
|
-
null,
|
|
2102
|
-
null
|
|
2103
|
-
|
|
2104
|
-
)
|
|
2105
|
-
|
|
2106
|
-
/* harmony default export */ var input = (component.exports);
|
|
2107
|
-
// CONCATENATED MODULE: ./packages/input/index.js
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
/* istanbul ignore next */
|
|
2111
|
-
input.install = function (Vue) {
|
|
2112
|
-
Vue.component(input.name, input);
|
|
2113
|
-
};
|
|
2114
|
-
|
|
2115
|
-
/* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
|
|
2116
|
-
|
|
2117
|
-
/***/ }),
|
|
2118
|
-
|
|
2119
|
-
/***/ 14:
|
|
2120
|
-
/***/ (function(module, exports) {
|
|
2121
|
-
|
|
2122
|
-
module.exports = require("element-ui/lib/utils/clickoutside");
|
|
2123
|
-
|
|
2124
|
-
/***/ }),
|
|
2125
|
-
|
|
2126
|
-
/***/ 15:
|
|
2127
|
-
/***/ (function(module, exports) {
|
|
2128
|
-
|
|
2129
|
-
module.exports = require("throttle-debounce/debounce");
|
|
2130
|
-
|
|
2131
|
-
/***/ }),
|
|
2132
|
-
|
|
2133
|
-
/***/ 16:
|
|
2134
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2135
|
-
|
|
2136
|
-
"use strict";
|
|
2137
|
-
// ESM COMPAT FLAG
|
|
2138
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2139
|
-
|
|
2140
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox.vue?vue&type=template&id=5f30258f
|
|
2141
|
-
var render = function () {
|
|
2142
|
-
var _vm = this
|
|
2143
|
-
var _h = _vm.$createElement
|
|
2144
|
-
var _c = _vm._self._c || _h
|
|
2145
|
-
return _c(
|
|
2146
|
-
"label",
|
|
2147
|
-
{
|
|
2148
|
-
staticClass: "el-checkbox",
|
|
2149
|
-
class: [
|
|
2150
|
-
_vm.border && _vm.checkboxSize
|
|
2151
|
-
? "el-checkbox--" + _vm.checkboxSize
|
|
2152
|
-
: "",
|
|
2153
|
-
{ "is-disabled": _vm.isDisabled },
|
|
2154
|
-
{ "is-bordered": _vm.border },
|
|
2155
|
-
{ "is-checked": _vm.isChecked },
|
|
2156
|
-
],
|
|
2157
|
-
attrs: { id: _vm.id },
|
|
2158
|
-
},
|
|
2159
|
-
[
|
|
2160
|
-
_c(
|
|
2161
|
-
"span",
|
|
2162
|
-
{
|
|
2163
|
-
staticClass: "el-checkbox__input",
|
|
2164
|
-
class: {
|
|
2165
|
-
"is-disabled": _vm.isDisabled,
|
|
2166
|
-
"is-checked": _vm.isChecked,
|
|
2167
|
-
"is-indeterminate": _vm.indeterminate,
|
|
2168
|
-
"is-focus": _vm.focus,
|
|
2169
|
-
},
|
|
2170
|
-
attrs: {
|
|
2171
|
-
tabindex: _vm.indeterminate ? 0 : false,
|
|
2172
|
-
role: _vm.indeterminate ? "checkbox" : false,
|
|
2173
|
-
"aria-checked": _vm.indeterminate ? "mixed" : false,
|
|
2174
|
-
},
|
|
2175
|
-
},
|
|
2176
|
-
[
|
|
2177
|
-
_c("span", { staticClass: "el-checkbox__inner" }),
|
|
2178
|
-
_vm.trueLabel || _vm.falseLabel
|
|
2179
|
-
? _c("input", {
|
|
2180
|
-
directives: [
|
|
2181
|
-
{
|
|
2182
|
-
name: "model",
|
|
2183
|
-
rawName: "v-model",
|
|
2184
|
-
value: _vm.model,
|
|
2185
|
-
expression: "model",
|
|
2186
|
-
},
|
|
2187
|
-
],
|
|
2188
|
-
staticClass: "el-checkbox__original",
|
|
2189
|
-
attrs: {
|
|
2190
|
-
type: "checkbox",
|
|
2191
|
-
"aria-hidden": _vm.indeterminate ? "true" : "false",
|
|
2192
|
-
name: _vm.name,
|
|
2193
|
-
disabled: _vm.isDisabled,
|
|
2194
|
-
"true-value": _vm.trueLabel,
|
|
2195
|
-
"false-value": _vm.falseLabel,
|
|
2196
|
-
},
|
|
2197
|
-
domProps: {
|
|
2198
|
-
checked: Array.isArray(_vm.model)
|
|
2199
|
-
? _vm._i(_vm.model, null) > -1
|
|
2200
|
-
: _vm._q(_vm.model, _vm.trueLabel),
|
|
2201
|
-
},
|
|
2202
|
-
on: {
|
|
2203
|
-
change: [
|
|
2204
|
-
function ($event) {
|
|
2205
|
-
var $$a = _vm.model,
|
|
2206
|
-
$$el = $event.target,
|
|
2207
|
-
$$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
|
|
2208
|
-
if (Array.isArray($$a)) {
|
|
2209
|
-
var $$v = null,
|
|
2210
|
-
$$i = _vm._i($$a, $$v)
|
|
2211
|
-
if ($$el.checked) {
|
|
2212
|
-
$$i < 0 && (_vm.model = $$a.concat([$$v]))
|
|
2213
|
-
} else {
|
|
2214
|
-
$$i > -1 &&
|
|
2215
|
-
(_vm.model = $$a
|
|
2216
|
-
.slice(0, $$i)
|
|
2217
|
-
.concat($$a.slice($$i + 1)))
|
|
2218
|
-
}
|
|
2219
|
-
} else {
|
|
2220
|
-
_vm.model = $$c
|
|
2221
|
-
}
|
|
2222
|
-
},
|
|
2223
|
-
_vm.handleChange,
|
|
2224
|
-
],
|
|
2225
|
-
focus: function ($event) {
|
|
2226
|
-
_vm.focus = true
|
|
2227
|
-
},
|
|
2228
|
-
blur: function ($event) {
|
|
2229
|
-
_vm.focus = false
|
|
2230
|
-
},
|
|
2231
|
-
},
|
|
2232
|
-
})
|
|
2233
|
-
: _c("input", {
|
|
2234
|
-
directives: [
|
|
2235
|
-
{
|
|
2236
|
-
name: "model",
|
|
2237
|
-
rawName: "v-model",
|
|
2238
|
-
value: _vm.model,
|
|
2239
|
-
expression: "model",
|
|
2240
|
-
},
|
|
2241
|
-
],
|
|
2242
|
-
staticClass: "el-checkbox__original",
|
|
2243
|
-
attrs: {
|
|
2244
|
-
type: "checkbox",
|
|
2245
|
-
"aria-hidden": _vm.indeterminate ? "true" : "false",
|
|
2246
|
-
disabled: _vm.isDisabled,
|
|
2247
|
-
name: _vm.name,
|
|
2248
|
-
},
|
|
2249
|
-
domProps: {
|
|
2250
|
-
value: _vm.label,
|
|
2251
|
-
checked: Array.isArray(_vm.model)
|
|
2252
|
-
? _vm._i(_vm.model, _vm.label) > -1
|
|
2253
|
-
: _vm.model,
|
|
2254
|
-
},
|
|
2255
|
-
on: {
|
|
2256
|
-
change: [
|
|
2257
|
-
function ($event) {
|
|
2258
|
-
var $$a = _vm.model,
|
|
2259
|
-
$$el = $event.target,
|
|
2260
|
-
$$c = $$el.checked ? true : false
|
|
2261
|
-
if (Array.isArray($$a)) {
|
|
2262
|
-
var $$v = _vm.label,
|
|
2263
|
-
$$i = _vm._i($$a, $$v)
|
|
2264
|
-
if ($$el.checked) {
|
|
2265
|
-
$$i < 0 && (_vm.model = $$a.concat([$$v]))
|
|
2266
|
-
} else {
|
|
2267
|
-
$$i > -1 &&
|
|
2268
|
-
(_vm.model = $$a
|
|
2269
|
-
.slice(0, $$i)
|
|
2270
|
-
.concat($$a.slice($$i + 1)))
|
|
2271
|
-
}
|
|
2272
|
-
} else {
|
|
2273
|
-
_vm.model = $$c
|
|
2274
|
-
}
|
|
2275
|
-
},
|
|
2276
|
-
_vm.handleChange,
|
|
2277
|
-
],
|
|
2278
|
-
focus: function ($event) {
|
|
2279
|
-
_vm.focus = true
|
|
2280
|
-
},
|
|
2281
|
-
blur: function ($event) {
|
|
2282
|
-
_vm.focus = false
|
|
2283
|
-
},
|
|
2284
|
-
},
|
|
2285
|
-
}),
|
|
2286
|
-
]
|
|
2287
|
-
),
|
|
2288
|
-
_vm.$slots.default || _vm.label
|
|
2289
|
-
? _c(
|
|
2290
|
-
"span",
|
|
2291
|
-
{ staticClass: "el-checkbox__label" },
|
|
2292
|
-
[
|
|
2293
|
-
_vm._t("default"),
|
|
2294
|
-
!_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e(),
|
|
2295
|
-
],
|
|
2296
|
-
2
|
|
2297
|
-
)
|
|
2298
|
-
: _vm._e(),
|
|
2299
|
-
]
|
|
2300
|
-
)
|
|
2301
|
-
}
|
|
2302
|
-
var staticRenderFns = []
|
|
2303
|
-
render._withStripped = true
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
// CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=template&id=5f30258f
|
|
2307
|
-
|
|
2308
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
|
|
2309
|
-
var emitter_ = __webpack_require__(4);
|
|
2310
|
-
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
2311
|
-
|
|
2312
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js
|
|
2313
|
-
//
|
|
2314
|
-
//
|
|
2315
|
-
//
|
|
2316
|
-
//
|
|
2317
|
-
//
|
|
2318
|
-
//
|
|
2319
|
-
//
|
|
2320
|
-
//
|
|
2321
|
-
//
|
|
2322
|
-
//
|
|
2323
|
-
//
|
|
2324
|
-
//
|
|
2325
|
-
//
|
|
2326
|
-
//
|
|
2327
|
-
//
|
|
2328
|
-
//
|
|
2329
|
-
//
|
|
2330
|
-
//
|
|
2331
|
-
//
|
|
2332
|
-
//
|
|
2333
|
-
//
|
|
2334
|
-
//
|
|
2335
|
-
//
|
|
2336
|
-
//
|
|
2337
|
-
//
|
|
2338
|
-
//
|
|
2339
|
-
//
|
|
2340
|
-
//
|
|
2341
|
-
//
|
|
2342
|
-
//
|
|
2343
|
-
//
|
|
2344
|
-
//
|
|
2345
|
-
//
|
|
2346
|
-
//
|
|
2347
|
-
//
|
|
2348
|
-
//
|
|
2349
|
-
//
|
|
2350
|
-
//
|
|
2351
|
-
//
|
|
2352
|
-
//
|
|
2353
|
-
//
|
|
2354
|
-
//
|
|
2355
|
-
//
|
|
2356
|
-
//
|
|
2357
|
-
//
|
|
2358
|
-
//
|
|
2359
|
-
//
|
|
2360
|
-
//
|
|
2361
|
-
//
|
|
2362
|
-
//
|
|
2363
|
-
//
|
|
2364
|
-
//
|
|
2365
|
-
//
|
|
2366
|
-
//
|
|
2367
|
-
//
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
/* harmony default export */ var checkboxvue_type_script_lang_js = ({
|
|
2372
|
-
name: 'ElCheckbox',
|
|
2373
|
-
|
|
2374
|
-
mixins: [emitter_default.a],
|
|
2375
|
-
|
|
2376
|
-
inject: {
|
|
2377
|
-
elForm: {
|
|
2378
|
-
default: ''
|
|
2379
|
-
},
|
|
2380
|
-
elFormItem: {
|
|
2381
|
-
default: ''
|
|
2382
|
-
}
|
|
2383
|
-
},
|
|
2384
|
-
|
|
2385
|
-
componentName: 'ElCheckbox',
|
|
2386
|
-
|
|
2387
|
-
data: function data() {
|
|
2388
|
-
return {
|
|
2389
|
-
selfModel: false,
|
|
2390
|
-
focus: false,
|
|
2391
|
-
isLimitExceeded: false
|
|
2392
|
-
};
|
|
2393
|
-
},
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
computed: {
|
|
2397
|
-
model: {
|
|
2398
|
-
get: function get() {
|
|
2399
|
-
return this.isGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
|
|
2400
|
-
},
|
|
2401
|
-
set: function set(val) {
|
|
2402
|
-
if (this.isGroup) {
|
|
2403
|
-
this.isLimitExceeded = false;
|
|
2404
|
-
this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
|
|
2405
|
-
|
|
2406
|
-
this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
|
|
2407
|
-
|
|
2408
|
-
this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
|
|
2409
|
-
} else {
|
|
2410
|
-
this.$emit('input', val);
|
|
2411
|
-
this.selfModel = val;
|
|
2412
|
-
}
|
|
2413
|
-
}
|
|
2414
|
-
},
|
|
2415
|
-
|
|
2416
|
-
isChecked: function isChecked() {
|
|
2417
|
-
if ({}.toString.call(this.model) === '[object Boolean]') {
|
|
2418
|
-
return this.model;
|
|
2419
|
-
} else if (Array.isArray(this.model)) {
|
|
2420
|
-
return this.model.indexOf(this.label) > -1;
|
|
2421
|
-
} else if (this.model !== null && this.model !== undefined) {
|
|
2422
|
-
return this.model === this.trueLabel;
|
|
2423
|
-
}
|
|
2424
|
-
},
|
|
2425
|
-
isGroup: function isGroup() {
|
|
2426
|
-
var parent = this.$parent;
|
|
2427
|
-
while (parent) {
|
|
2428
|
-
if (parent.$options.componentName !== 'ElCheckboxGroup') {
|
|
2429
|
-
parent = parent.$parent;
|
|
2430
|
-
} else {
|
|
2431
|
-
this._checkboxGroup = parent;
|
|
2432
|
-
return true;
|
|
2433
|
-
}
|
|
2434
|
-
}
|
|
2435
|
-
return false;
|
|
2436
|
-
},
|
|
2437
|
-
store: function store() {
|
|
2438
|
-
return this._checkboxGroup ? this._checkboxGroup.value : this.value;
|
|
2439
|
-
},
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
/* used to make the isDisabled judgment under max/min props */
|
|
2443
|
-
isLimitDisabled: function isLimitDisabled() {
|
|
2444
|
-
var _checkboxGroup = this._checkboxGroup,
|
|
2445
|
-
max = _checkboxGroup.max,
|
|
2446
|
-
min = _checkboxGroup.min;
|
|
2447
|
-
|
|
2448
|
-
return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
|
|
2449
|
-
},
|
|
2450
|
-
isDisabled: function isDisabled() {
|
|
2451
|
-
return this.isGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
|
|
2452
|
-
},
|
|
2453
|
-
_elFormItemSize: function _elFormItemSize() {
|
|
2454
|
-
return (this.elFormItem || {}).elFormItemSize;
|
|
2455
|
-
},
|
|
2456
|
-
checkboxSize: function checkboxSize() {
|
|
2457
|
-
var temCheckboxSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
2458
|
-
return this.isGroup ? this._checkboxGroup.checkboxGroupSize || temCheckboxSize : temCheckboxSize;
|
|
2459
|
-
}
|
|
2460
|
-
},
|
|
2461
|
-
|
|
2462
|
-
props: {
|
|
2463
|
-
value: {},
|
|
2464
|
-
label: {},
|
|
2465
|
-
indeterminate: Boolean,
|
|
2466
|
-
disabled: Boolean,
|
|
2467
|
-
checked: Boolean,
|
|
2468
|
-
name: String,
|
|
2469
|
-
trueLabel: [String, Number],
|
|
2470
|
-
falseLabel: [String, Number],
|
|
2471
|
-
id: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
|
|
2472
|
-
controls: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
|
|
2473
|
-
border: Boolean,
|
|
2474
|
-
size: String
|
|
2475
|
-
},
|
|
2476
|
-
|
|
2477
|
-
methods: {
|
|
2478
|
-
addToStore: function addToStore() {
|
|
2479
|
-
if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
|
|
2480
|
-
this.model.push(this.label);
|
|
2481
|
-
} else {
|
|
2482
|
-
this.model = this.trueLabel || true;
|
|
2483
|
-
}
|
|
2484
|
-
},
|
|
2485
|
-
handleChange: function handleChange(ev) {
|
|
2486
|
-
var _this = this;
|
|
2487
|
-
|
|
2488
|
-
if (this.isLimitExceeded) return;
|
|
2489
|
-
var value = void 0;
|
|
2490
|
-
if (ev.target.checked) {
|
|
2491
|
-
value = this.trueLabel === undefined ? true : this.trueLabel;
|
|
2492
|
-
} else {
|
|
2493
|
-
value = this.falseLabel === undefined ? false : this.falseLabel;
|
|
2494
|
-
}
|
|
2495
|
-
this.$emit('change', value, ev);
|
|
2496
|
-
this.$nextTick(function () {
|
|
2497
|
-
if (_this.isGroup) {
|
|
2498
|
-
_this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
|
|
2499
|
-
}
|
|
2500
|
-
});
|
|
2501
|
-
}
|
|
2502
|
-
},
|
|
2503
|
-
|
|
2504
|
-
created: function created() {
|
|
2505
|
-
this.checked && this.addToStore();
|
|
2506
|
-
},
|
|
2507
|
-
mounted: function mounted() {
|
|
2508
|
-
// 为indeterminate元素 添加aria-controls 属性
|
|
2509
|
-
if (this.indeterminate) {
|
|
2510
|
-
this.$el.setAttribute('aria-controls', this.controls);
|
|
2511
|
-
}
|
|
2512
|
-
},
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
watch: {
|
|
2516
|
-
value: function value(_value) {
|
|
2517
|
-
this.dispatch('ElFormItem', 'el.form.change', _value);
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
});
|
|
2521
|
-
// CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js
|
|
2522
|
-
/* harmony default export */ var src_checkboxvue_type_script_lang_js = (checkboxvue_type_script_lang_js);
|
|
2523
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
2524
|
-
var componentNormalizer = __webpack_require__(0);
|
|
2525
|
-
|
|
2526
|
-
// CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
/* normalize component */
|
|
2533
|
-
|
|
2534
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
2535
|
-
src_checkboxvue_type_script_lang_js,
|
|
2536
|
-
render,
|
|
2537
|
-
staticRenderFns,
|
|
2538
|
-
false,
|
|
2539
|
-
null,
|
|
2540
|
-
null,
|
|
2541
|
-
null
|
|
2542
|
-
|
|
2543
|
-
)
|
|
2544
|
-
|
|
2545
|
-
/* harmony default export */ var src_checkbox = (component.exports);
|
|
2546
|
-
// CONCATENATED MODULE: ./packages/checkbox/index.js
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
/* istanbul ignore next */
|
|
2550
|
-
src_checkbox.install = function (Vue) {
|
|
2551
|
-
Vue.component(src_checkbox.name, src_checkbox);
|
|
2552
|
-
};
|
|
2553
|
-
|
|
2554
|
-
/* harmony default export */ var packages_checkbox = __webpack_exports__["default"] = (src_checkbox);
|
|
2555
|
-
|
|
2556
|
-
/***/ }),
|
|
2557
|
-
|
|
2558
|
-
/***/ 17:
|
|
2559
|
-
/***/ (function(module, exports) {
|
|
2560
|
-
|
|
2561
|
-
module.exports = require("element-ui/lib/utils/scrollbar-width");
|
|
2562
|
-
|
|
2563
|
-
/***/ }),
|
|
2564
|
-
|
|
2565
|
-
/***/ 18:
|
|
2566
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2567
|
-
|
|
2568
|
-
"use strict";
|
|
2569
|
-
// ESM COMPAT FLAG
|
|
2570
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2571
|
-
|
|
2572
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
|
|
2573
|
-
var resize_event_ = __webpack_require__(10);
|
|
2574
|
-
|
|
2575
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/scrollbar-width"
|
|
2576
|
-
var scrollbar_width_ = __webpack_require__(17);
|
|
2577
|
-
var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
|
|
2578
|
-
|
|
2579
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/util"
|
|
2580
|
-
var util_ = __webpack_require__(3);
|
|
2581
|
-
|
|
2582
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/dom"
|
|
2583
|
-
var dom_ = __webpack_require__(1);
|
|
2584
|
-
|
|
2585
|
-
// CONCATENATED MODULE: ./packages/scrollbar/src/util.js
|
|
2586
|
-
var BAR_MAP = {
|
|
2587
|
-
vertical: {
|
|
2588
|
-
offset: 'offsetHeight',
|
|
2589
|
-
scroll: 'scrollTop',
|
|
2590
|
-
scrollSize: 'scrollHeight',
|
|
2591
|
-
size: 'height',
|
|
2592
|
-
key: 'vertical',
|
|
2593
|
-
axis: 'Y',
|
|
2594
|
-
client: 'clientY',
|
|
2595
|
-
direction: 'top'
|
|
2596
|
-
},
|
|
2597
|
-
horizontal: {
|
|
2598
|
-
offset: 'offsetWidth',
|
|
2599
|
-
scroll: 'scrollLeft',
|
|
2600
|
-
scrollSize: 'scrollWidth',
|
|
2601
|
-
size: 'width',
|
|
2602
|
-
key: 'horizontal',
|
|
2603
|
-
axis: 'X',
|
|
2604
|
-
client: 'clientX',
|
|
2605
|
-
direction: 'left'
|
|
2606
|
-
}
|
|
2607
|
-
};
|
|
2608
|
-
|
|
2609
|
-
function renderThumbStyle(_ref) {
|
|
2610
|
-
var move = _ref.move,
|
|
2611
|
-
size = _ref.size,
|
|
2612
|
-
bar = _ref.bar;
|
|
2613
|
-
|
|
2614
|
-
var style = {};
|
|
2615
|
-
var translate = 'translate' + bar.axis + '(' + move + '%)';
|
|
2616
|
-
|
|
2617
|
-
style[bar.size] = size;
|
|
2618
|
-
style.transform = translate;
|
|
2619
|
-
style.msTransform = translate;
|
|
2620
|
-
style.webkitTransform = translate;
|
|
2621
|
-
|
|
2622
|
-
return style;
|
|
2623
|
-
};
|
|
2624
|
-
// CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
/* istanbul ignore next */
|
|
2629
|
-
/* harmony default export */ var src_bar = ({
|
|
2630
|
-
name: 'Bar',
|
|
2631
|
-
|
|
2632
|
-
props: {
|
|
2633
|
-
vertical: Boolean,
|
|
2634
|
-
size: String,
|
|
2635
|
-
move: Number
|
|
2636
|
-
},
|
|
2637
|
-
|
|
2638
|
-
computed: {
|
|
2639
|
-
bar: function bar() {
|
|
2640
|
-
return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
|
|
2641
|
-
},
|
|
2642
|
-
wrap: function wrap() {
|
|
2643
|
-
return this.$parent.wrap;
|
|
2644
|
-
}
|
|
2645
|
-
},
|
|
2646
|
-
|
|
2647
|
-
render: function render(h) {
|
|
2648
|
-
var size = this.size,
|
|
2649
|
-
move = this.move,
|
|
2650
|
-
bar = this.bar;
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
return h(
|
|
2654
|
-
'div',
|
|
2655
|
-
{
|
|
2656
|
-
'class': ['el-scrollbar__bar', 'is-' + bar.key],
|
|
2657
|
-
on: {
|
|
2658
|
-
'mousedown': this.clickTrackHandler
|
|
2659
|
-
}
|
|
2660
|
-
},
|
|
2661
|
-
[h('div', {
|
|
2662
|
-
ref: 'thumb',
|
|
2663
|
-
'class': 'el-scrollbar__thumb',
|
|
2664
|
-
on: {
|
|
2665
|
-
'mousedown': this.clickThumbHandler
|
|
2666
|
-
},
|
|
2667
|
-
|
|
2668
|
-
style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
|
|
2669
|
-
);
|
|
2670
|
-
},
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
methods: {
|
|
2674
|
-
clickThumbHandler: function clickThumbHandler(e) {
|
|
2675
|
-
// prevent click event of right button
|
|
2676
|
-
if (e.ctrlKey || e.button === 2) {
|
|
2677
|
-
return;
|
|
2678
|
-
}
|
|
2679
|
-
this.startDrag(e);
|
|
2680
|
-
this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
|
|
2681
|
-
},
|
|
2682
|
-
clickTrackHandler: function clickTrackHandler(e) {
|
|
2683
|
-
var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
|
|
2684
|
-
var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
|
|
2685
|
-
var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
|
|
2686
|
-
|
|
2687
|
-
this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
|
|
2688
|
-
},
|
|
2689
|
-
startDrag: function startDrag(e) {
|
|
2690
|
-
e.stopImmediatePropagation();
|
|
2691
|
-
this.cursorDown = true;
|
|
2692
|
-
|
|
2693
|
-
Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
|
|
2694
|
-
Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
|
|
2695
|
-
document.onselectstart = function () {
|
|
2696
|
-
return false;
|
|
2697
|
-
};
|
|
2698
|
-
},
|
|
2699
|
-
mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
|
|
2700
|
-
if (this.cursorDown === false) return;
|
|
2701
|
-
var prevPage = this[this.bar.axis];
|
|
2702
|
-
|
|
2703
|
-
if (!prevPage) return;
|
|
2704
|
-
|
|
2705
|
-
var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
|
|
2706
|
-
var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
|
|
2707
|
-
var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
|
|
2708
|
-
|
|
2709
|
-
this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
|
|
2710
|
-
},
|
|
2711
|
-
mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
|
|
2712
|
-
this.cursorDown = false;
|
|
2713
|
-
this[this.bar.axis] = 0;
|
|
2714
|
-
Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
|
|
2715
|
-
document.onselectstart = null;
|
|
2716
|
-
}
|
|
2717
|
-
},
|
|
2718
|
-
|
|
2719
|
-
destroyed: function destroyed() {
|
|
2720
|
-
Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
|
|
2721
|
-
}
|
|
2722
|
-
});
|
|
2723
|
-
// CONCATENATED MODULE: ./packages/scrollbar/src/main.js
|
|
2724
|
-
// reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
/* istanbul ignore next */
|
|
2732
|
-
/* harmony default export */ var main = ({
|
|
2733
|
-
name: 'ElScrollbar',
|
|
2734
|
-
|
|
2735
|
-
components: { Bar: src_bar },
|
|
2736
|
-
|
|
2737
|
-
props: {
|
|
2738
|
-
native: Boolean,
|
|
2739
|
-
wrapStyle: {},
|
|
2740
|
-
wrapClass: {},
|
|
2741
|
-
viewClass: {},
|
|
2742
|
-
viewStyle: {},
|
|
2743
|
-
noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
|
|
2744
|
-
tag: {
|
|
2745
|
-
type: String,
|
|
2746
|
-
default: 'div'
|
|
2747
|
-
}
|
|
2748
|
-
},
|
|
2749
|
-
|
|
2750
|
-
data: function data() {
|
|
2751
|
-
return {
|
|
2752
|
-
sizeWidth: '0',
|
|
2753
|
-
sizeHeight: '0',
|
|
2754
|
-
moveX: 0,
|
|
2755
|
-
moveY: 0
|
|
2756
|
-
};
|
|
2757
|
-
},
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
computed: {
|
|
2761
|
-
wrap: function wrap() {
|
|
2762
|
-
return this.$refs.wrap;
|
|
2763
|
-
}
|
|
2764
|
-
},
|
|
2765
|
-
|
|
2766
|
-
render: function render(h) {
|
|
2767
|
-
var gutter = scrollbar_width_default()();
|
|
2768
|
-
var style = this.wrapStyle;
|
|
2769
|
-
|
|
2770
|
-
if (gutter) {
|
|
2771
|
-
var gutterWith = '-' + gutter + 'px';
|
|
2772
|
-
var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
|
|
2773
|
-
|
|
2774
|
-
if (Array.isArray(this.wrapStyle)) {
|
|
2775
|
-
style = Object(util_["toObject"])(this.wrapStyle);
|
|
2776
|
-
style.marginRight = style.marginBottom = gutterWith;
|
|
2777
|
-
} else if (typeof this.wrapStyle === 'string') {
|
|
2778
|
-
style += gutterStyle;
|
|
2779
|
-
} else {
|
|
2780
|
-
style = gutterStyle;
|
|
2781
|
-
}
|
|
2782
|
-
}
|
|
2783
|
-
var view = h(this.tag, {
|
|
2784
|
-
class: ['el-scrollbar__view', this.viewClass],
|
|
2785
|
-
style: this.viewStyle,
|
|
2786
|
-
ref: 'resize'
|
|
2787
|
-
}, this.$slots.default);
|
|
2788
|
-
var wrap = h(
|
|
2789
|
-
'div',
|
|
2790
|
-
{
|
|
2791
|
-
ref: 'wrap',
|
|
2792
|
-
style: style,
|
|
2793
|
-
on: {
|
|
2794
|
-
'scroll': this.handleScroll
|
|
2795
|
-
},
|
|
2796
|
-
|
|
2797
|
-
'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
|
|
2798
|
-
[[view]]
|
|
2799
|
-
);
|
|
2800
|
-
var nodes = void 0;
|
|
2801
|
-
|
|
2802
|
-
if (!this.native) {
|
|
2803
|
-
nodes = [wrap, h(src_bar, {
|
|
2804
|
-
attrs: {
|
|
2805
|
-
move: this.moveX,
|
|
2806
|
-
size: this.sizeWidth }
|
|
2807
|
-
}), h(src_bar, {
|
|
2808
|
-
attrs: {
|
|
2809
|
-
vertical: true,
|
|
2810
|
-
move: this.moveY,
|
|
2811
|
-
size: this.sizeHeight }
|
|
2812
|
-
})];
|
|
2813
|
-
} else {
|
|
2814
|
-
nodes = [h(
|
|
2815
|
-
'div',
|
|
2816
|
-
{
|
|
2817
|
-
ref: 'wrap',
|
|
2818
|
-
'class': [this.wrapClass, 'el-scrollbar__wrap'],
|
|
2819
|
-
style: style },
|
|
2820
|
-
[[view]]
|
|
2821
|
-
)];
|
|
2822
|
-
}
|
|
2823
|
-
return h('div', { class: 'el-scrollbar' }, nodes);
|
|
2824
|
-
},
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
methods: {
|
|
2828
|
-
handleScroll: function handleScroll() {
|
|
2829
|
-
var wrap = this.wrap;
|
|
2830
|
-
|
|
2831
|
-
this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
|
|
2832
|
-
this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
|
|
2833
|
-
},
|
|
2834
|
-
update: function update() {
|
|
2835
|
-
var heightPercentage = void 0,
|
|
2836
|
-
widthPercentage = void 0;
|
|
2837
|
-
var wrap = this.wrap;
|
|
2838
|
-
if (!wrap) return;
|
|
2839
|
-
|
|
2840
|
-
heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
|
|
2841
|
-
widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
|
|
2842
|
-
|
|
2843
|
-
this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
|
|
2844
|
-
this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
|
|
2845
|
-
}
|
|
2846
|
-
},
|
|
2847
|
-
|
|
2848
|
-
mounted: function mounted() {
|
|
2849
|
-
if (this.native) return;
|
|
2850
|
-
this.$nextTick(this.update);
|
|
2851
|
-
!this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
|
|
2852
|
-
},
|
|
2853
|
-
beforeDestroy: function beforeDestroy() {
|
|
2854
|
-
if (this.native) return;
|
|
2855
|
-
!this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
|
|
2856
|
-
}
|
|
2857
|
-
});
|
|
2858
|
-
// CONCATENATED MODULE: ./packages/scrollbar/index.js
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
/* istanbul ignore next */
|
|
2862
|
-
main.install = function (Vue) {
|
|
2863
|
-
Vue.component(main.name, main);
|
|
2864
|
-
};
|
|
2865
|
-
|
|
2866
|
-
/* harmony default export */ var scrollbar = __webpack_exports__["default"] = (main);
|
|
2867
|
-
|
|
2868
|
-
/***/ }),
|
|
2869
|
-
|
|
2870
|
-
/***/ 21:
|
|
2871
|
-
/***/ (function(module, exports) {
|
|
2872
|
-
|
|
2873
|
-
module.exports = require("element-ui/lib/utils/types");
|
|
2874
|
-
|
|
2875
|
-
/***/ }),
|
|
2876
|
-
|
|
2877
|
-
/***/ 22:
|
|
2878
|
-
/***/ (function(module, exports) {
|
|
2879
|
-
|
|
2880
|
-
module.exports = require("element-ui/lib/locale");
|
|
2881
|
-
|
|
2882
|
-
/***/ }),
|
|
2883
|
-
|
|
2884
|
-
/***/ 24:
|
|
2885
|
-
/***/ (function(module, exports) {
|
|
2886
|
-
|
|
2887
|
-
module.exports = require("babel-helper-vue-jsx-merge-props");
|
|
2888
|
-
|
|
2889
|
-
/***/ }),
|
|
2890
|
-
|
|
2891
|
-
/***/ 26:
|
|
2892
|
-
/***/ (function(module, exports) {
|
|
2893
|
-
|
|
2894
|
-
module.exports = require("element-ui/lib/utils/scroll-into-view");
|
|
2895
|
-
|
|
2896
|
-
/***/ }),
|
|
2897
|
-
|
|
2898
|
-
/***/ 3:
|
|
2899
|
-
/***/ (function(module, exports) {
|
|
2900
|
-
|
|
2901
|
-
module.exports = require("element-ui/lib/utils/util");
|
|
2902
|
-
|
|
2903
|
-
/***/ }),
|
|
2904
|
-
|
|
2905
|
-
/***/ 30:
|
|
2906
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2907
|
-
|
|
2908
|
-
"use strict";
|
|
2909
|
-
// ESM COMPAT FLAG
|
|
2910
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2911
|
-
|
|
2912
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tag/src/tag.vue?vue&type=script&lang=js
|
|
2913
|
-
|
|
2914
|
-
/* harmony default export */ var tagvue_type_script_lang_js = ({
|
|
2915
|
-
name: 'ElTag',
|
|
2916
|
-
props: {
|
|
2917
|
-
text: String,
|
|
2918
|
-
closable: Boolean,
|
|
2919
|
-
type: String,
|
|
2920
|
-
hit: Boolean,
|
|
2921
|
-
disableTransitions: Boolean,
|
|
2922
|
-
color: String,
|
|
2923
|
-
size: String,
|
|
2924
|
-
effect: {
|
|
2925
|
-
type: String,
|
|
2926
|
-
default: 'light',
|
|
2927
|
-
validator: function validator(val) {
|
|
2928
|
-
return ['dark', 'light', 'plain'].indexOf(val) !== -1;
|
|
2929
|
-
}
|
|
2930
|
-
}
|
|
2931
|
-
},
|
|
2932
|
-
methods: {
|
|
2933
|
-
handleClose: function handleClose(event) {
|
|
2934
|
-
event.stopPropagation();
|
|
2935
|
-
this.$emit('close', event);
|
|
2936
|
-
},
|
|
2937
|
-
handleClick: function handleClick(event) {
|
|
2938
|
-
this.$emit('click', event);
|
|
2939
|
-
}
|
|
2940
|
-
},
|
|
2941
|
-
computed: {
|
|
2942
|
-
tagSize: function tagSize() {
|
|
2943
|
-
return this.size || (this.$ELEMENT || {}).size;
|
|
2944
|
-
}
|
|
2945
|
-
},
|
|
2946
|
-
render: function render(h) {
|
|
2947
|
-
var type = this.type,
|
|
2948
|
-
tagSize = this.tagSize,
|
|
2949
|
-
hit = this.hit,
|
|
2950
|
-
effect = this.effect;
|
|
2951
|
-
|
|
2952
|
-
var classes = ['el-tag', type ? 'el-tag--' + type : '', tagSize ? 'el-tag--' + tagSize : '', effect ? 'el-tag--' + effect : '', hit && 'is-hit'];
|
|
2953
|
-
var tagEl = h(
|
|
2954
|
-
'span',
|
|
2955
|
-
{
|
|
2956
|
-
'class': classes,
|
|
2957
|
-
style: { backgroundColor: this.color },
|
|
2958
|
-
on: {
|
|
2959
|
-
'click': this.handleClick
|
|
2960
|
-
}
|
|
2961
|
-
},
|
|
2962
|
-
[this.$slots.default, this.closable && h('i', { 'class': 'el-tag__close el-icon-close', on: {
|
|
2963
|
-
'click': this.handleClose
|
|
2964
|
-
}
|
|
2965
|
-
})]
|
|
2966
|
-
);
|
|
2967
|
-
|
|
2968
|
-
return this.disableTransitions ? tagEl : h(
|
|
2969
|
-
'transition',
|
|
2970
|
-
{
|
|
2971
|
-
attrs: { name: 'el-zoom-in-center' }
|
|
2972
|
-
},
|
|
2973
|
-
[tagEl]
|
|
2974
|
-
);
|
|
2975
|
-
}
|
|
2976
|
-
});
|
|
2977
|
-
// CONCATENATED MODULE: ./packages/tag/src/tag.vue?vue&type=script&lang=js
|
|
2978
|
-
/* harmony default export */ var src_tagvue_type_script_lang_js = (tagvue_type_script_lang_js);
|
|
2979
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
2980
|
-
var componentNormalizer = __webpack_require__(0);
|
|
2981
|
-
|
|
2982
|
-
// CONCATENATED MODULE: ./packages/tag/src/tag.vue
|
|
2983
|
-
var render, staticRenderFns
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
/* normalize component */
|
|
2989
|
-
|
|
2990
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
2991
|
-
src_tagvue_type_script_lang_js,
|
|
2992
|
-
render,
|
|
2993
|
-
staticRenderFns,
|
|
2994
|
-
false,
|
|
2995
|
-
null,
|
|
2996
|
-
null,
|
|
2997
|
-
null
|
|
2998
|
-
|
|
2999
|
-
)
|
|
3000
|
-
|
|
3001
|
-
/* harmony default export */ var tag = (component.exports);
|
|
3002
|
-
// CONCATENATED MODULE: ./packages/tag/index.js
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
/* istanbul ignore next */
|
|
3006
|
-
tag.install = function (Vue) {
|
|
3007
|
-
Vue.component(tag.name, tag);
|
|
3008
|
-
};
|
|
3009
|
-
|
|
3010
|
-
/* harmony default export */ var packages_tag = __webpack_exports__["default"] = (tag);
|
|
3011
|
-
|
|
3012
|
-
/***/ }),
|
|
3013
|
-
|
|
3014
|
-
/***/ 38:
|
|
3015
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3016
|
-
|
|
3017
|
-
"use strict";
|
|
3018
|
-
// ESM COMPAT FLAG
|
|
3019
|
-
__webpack_require__.r(__webpack_exports__);
|
|
3020
|
-
|
|
3021
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio/src/radio.vue?vue&type=template&id=1e51a39c
|
|
3022
|
-
var render = function () {
|
|
3023
|
-
var _vm = this
|
|
3024
|
-
var _h = _vm.$createElement
|
|
3025
|
-
var _c = _vm._self._c || _h
|
|
3026
|
-
return _c(
|
|
3027
|
-
"label",
|
|
3028
|
-
{
|
|
3029
|
-
staticClass: "el-radio",
|
|
3030
|
-
class: [
|
|
3031
|
-
_vm.border && _vm.radioSize ? "el-radio--" + _vm.radioSize : "",
|
|
3032
|
-
{ "is-disabled": _vm.isDisabled },
|
|
3033
|
-
{ "is-focus": _vm.focus },
|
|
3034
|
-
{ "is-bordered": _vm.border },
|
|
3035
|
-
{ "is-checked": _vm.model === _vm.label },
|
|
3036
|
-
],
|
|
3037
|
-
attrs: {
|
|
3038
|
-
role: "radio",
|
|
3039
|
-
"aria-checked": _vm.model === _vm.label,
|
|
3040
|
-
"aria-disabled": _vm.isDisabled,
|
|
3041
|
-
tabindex: _vm.tabIndex,
|
|
3042
|
-
},
|
|
3043
|
-
on: {
|
|
3044
|
-
keydown: function ($event) {
|
|
3045
|
-
if (
|
|
3046
|
-
!("button" in $event) &&
|
|
3047
|
-
_vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])
|
|
3048
|
-
) {
|
|
3049
|
-
return null
|
|
3050
|
-
}
|
|
3051
|
-
$event.stopPropagation()
|
|
3052
|
-
$event.preventDefault()
|
|
3053
|
-
_vm.model = _vm.isDisabled ? _vm.model : _vm.label
|
|
3054
|
-
},
|
|
3055
|
-
},
|
|
3056
|
-
},
|
|
3057
|
-
[
|
|
3058
|
-
_c(
|
|
3059
|
-
"span",
|
|
3060
|
-
{
|
|
3061
|
-
staticClass: "el-radio__input",
|
|
3062
|
-
class: {
|
|
3063
|
-
"is-disabled": _vm.isDisabled,
|
|
3064
|
-
"is-checked": _vm.model === _vm.label,
|
|
3065
|
-
},
|
|
3066
|
-
},
|
|
3067
|
-
[
|
|
3068
|
-
_c("span", { staticClass: "el-radio__inner" }),
|
|
3069
|
-
_c("input", {
|
|
3070
|
-
directives: [
|
|
3071
|
-
{
|
|
3072
|
-
name: "model",
|
|
3073
|
-
rawName: "v-model",
|
|
3074
|
-
value: _vm.model,
|
|
3075
|
-
expression: "model",
|
|
3076
|
-
},
|
|
3077
|
-
],
|
|
3078
|
-
ref: "radio",
|
|
3079
|
-
staticClass: "el-radio__original",
|
|
3080
|
-
attrs: {
|
|
3081
|
-
type: "radio",
|
|
3082
|
-
"aria-hidden": "true",
|
|
3083
|
-
name: _vm.name,
|
|
3084
|
-
disabled: _vm.isDisabled,
|
|
3085
|
-
tabindex: "-1",
|
|
3086
|
-
autocomplete: "off",
|
|
3087
|
-
},
|
|
3088
|
-
domProps: {
|
|
3089
|
-
value: _vm.label,
|
|
3090
|
-
checked: _vm._q(_vm.model, _vm.label),
|
|
3091
|
-
},
|
|
3092
|
-
on: {
|
|
3093
|
-
focus: function ($event) {
|
|
3094
|
-
_vm.focus = true
|
|
3095
|
-
},
|
|
3096
|
-
blur: function ($event) {
|
|
3097
|
-
_vm.focus = false
|
|
3098
|
-
},
|
|
3099
|
-
change: [
|
|
3100
|
-
function ($event) {
|
|
3101
|
-
_vm.model = _vm.label
|
|
3102
|
-
},
|
|
3103
|
-
_vm.handleChange,
|
|
3104
|
-
],
|
|
3105
|
-
},
|
|
3106
|
-
}),
|
|
3107
|
-
]
|
|
3108
|
-
),
|
|
3109
|
-
_c(
|
|
3110
|
-
"span",
|
|
3111
|
-
{
|
|
3112
|
-
staticClass: "el-radio__label",
|
|
3113
|
-
on: {
|
|
3114
|
-
keydown: function ($event) {
|
|
3115
|
-
$event.stopPropagation()
|
|
3116
|
-
},
|
|
3117
|
-
},
|
|
3118
|
-
},
|
|
3119
|
-
[
|
|
3120
|
-
_vm._t("default"),
|
|
3121
|
-
!_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e(),
|
|
3122
|
-
],
|
|
3123
|
-
2
|
|
3124
|
-
),
|
|
3125
|
-
]
|
|
3126
|
-
)
|
|
3127
|
-
}
|
|
3128
|
-
var staticRenderFns = []
|
|
3129
|
-
render._withStripped = true
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
// CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=template&id=1e51a39c
|
|
3133
|
-
|
|
3134
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
|
|
3135
|
-
var emitter_ = __webpack_require__(4);
|
|
3136
|
-
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
3137
|
-
|
|
3138
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio/src/radio.vue?vue&type=script&lang=js
|
|
3139
|
-
//
|
|
3140
|
-
//
|
|
3141
|
-
//
|
|
3142
|
-
//
|
|
3143
|
-
//
|
|
3144
|
-
//
|
|
3145
|
-
//
|
|
3146
|
-
//
|
|
3147
|
-
//
|
|
3148
|
-
//
|
|
3149
|
-
//
|
|
3150
|
-
//
|
|
3151
|
-
//
|
|
3152
|
-
//
|
|
3153
|
-
//
|
|
3154
|
-
//
|
|
3155
|
-
//
|
|
3156
|
-
//
|
|
3157
|
-
//
|
|
3158
|
-
//
|
|
3159
|
-
//
|
|
3160
|
-
//
|
|
3161
|
-
//
|
|
3162
|
-
//
|
|
3163
|
-
//
|
|
3164
|
-
//
|
|
3165
|
-
//
|
|
3166
|
-
//
|
|
3167
|
-
//
|
|
3168
|
-
//
|
|
3169
|
-
//
|
|
3170
|
-
//
|
|
3171
|
-
//
|
|
3172
|
-
//
|
|
3173
|
-
//
|
|
3174
|
-
//
|
|
3175
|
-
//
|
|
3176
|
-
//
|
|
3177
|
-
//
|
|
3178
|
-
//
|
|
3179
|
-
//
|
|
3180
|
-
//
|
|
3181
|
-
//
|
|
3182
|
-
//
|
|
3183
|
-
//
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
/* harmony default export */ var radiovue_type_script_lang_js = ({
|
|
3188
|
-
name: 'ElRadio',
|
|
3189
|
-
|
|
3190
|
-
mixins: [emitter_default.a],
|
|
3191
|
-
|
|
3192
|
-
inject: {
|
|
3193
|
-
elForm: {
|
|
3194
|
-
default: ''
|
|
3195
|
-
},
|
|
3196
|
-
|
|
3197
|
-
elFormItem: {
|
|
3198
|
-
default: ''
|
|
3199
|
-
}
|
|
3200
|
-
},
|
|
3201
|
-
|
|
3202
|
-
componentName: 'ElRadio',
|
|
3203
|
-
|
|
3204
|
-
props: {
|
|
3205
|
-
value: {},
|
|
3206
|
-
label: {},
|
|
3207
|
-
disabled: Boolean,
|
|
3208
|
-
name: String,
|
|
3209
|
-
border: Boolean,
|
|
3210
|
-
size: String
|
|
3211
|
-
},
|
|
3212
|
-
|
|
3213
|
-
data: function data() {
|
|
3214
|
-
return {
|
|
3215
|
-
focus: false
|
|
3216
|
-
};
|
|
3217
|
-
},
|
|
3218
|
-
|
|
3219
|
-
computed: {
|
|
3220
|
-
isGroup: function isGroup() {
|
|
3221
|
-
var parent = this.$parent;
|
|
3222
|
-
while (parent) {
|
|
3223
|
-
if (parent.$options.componentName !== 'ElRadioGroup') {
|
|
3224
|
-
parent = parent.$parent;
|
|
3225
|
-
} else {
|
|
3226
|
-
this._radioGroup = parent;
|
|
3227
|
-
return true;
|
|
3228
|
-
}
|
|
3229
|
-
}
|
|
3230
|
-
return false;
|
|
3231
|
-
},
|
|
3232
|
-
|
|
3233
|
-
model: {
|
|
3234
|
-
get: function get() {
|
|
3235
|
-
return this.isGroup ? this._radioGroup.value : this.value;
|
|
3236
|
-
},
|
|
3237
|
-
set: function set(val) {
|
|
3238
|
-
if (this.isGroup) {
|
|
3239
|
-
this.dispatch('ElRadioGroup', 'input', [val]);
|
|
3240
|
-
} else {
|
|
3241
|
-
this.$emit('input', val);
|
|
3242
|
-
}
|
|
3243
|
-
this.$refs.radio && (this.$refs.radio.checked = this.model === this.label);
|
|
3244
|
-
}
|
|
3245
|
-
},
|
|
3246
|
-
_elFormItemSize: function _elFormItemSize() {
|
|
3247
|
-
return (this.elFormItem || {}).elFormItemSize;
|
|
3248
|
-
},
|
|
3249
|
-
radioSize: function radioSize() {
|
|
3250
|
-
var temRadioSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
3251
|
-
return this.isGroup ? this._radioGroup.radioGroupSize || temRadioSize : temRadioSize;
|
|
3252
|
-
},
|
|
3253
|
-
isDisabled: function isDisabled() {
|
|
3254
|
-
return this.isGroup ? this._radioGroup.disabled || this.disabled || (this.elForm || {}).disabled : this.disabled || (this.elForm || {}).disabled;
|
|
3255
|
-
},
|
|
3256
|
-
tabIndex: function tabIndex() {
|
|
3257
|
-
return this.isDisabled || this.isGroup && this.model !== this.label ? -1 : 0;
|
|
3258
|
-
}
|
|
3259
|
-
},
|
|
3260
|
-
|
|
3261
|
-
methods: {
|
|
3262
|
-
handleChange: function handleChange() {
|
|
3263
|
-
var _this = this;
|
|
3264
|
-
|
|
3265
|
-
this.$nextTick(function () {
|
|
3266
|
-
_this.$emit('change', _this.model);
|
|
3267
|
-
_this.isGroup && _this.dispatch('ElRadioGroup', 'handleChange', _this.model);
|
|
3268
|
-
});
|
|
3269
|
-
}
|
|
3270
|
-
}
|
|
3271
|
-
});
|
|
3272
|
-
// CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=script&lang=js
|
|
3273
|
-
/* harmony default export */ var src_radiovue_type_script_lang_js = (radiovue_type_script_lang_js);
|
|
3274
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
3275
|
-
var componentNormalizer = __webpack_require__(0);
|
|
3276
|
-
|
|
3277
|
-
// CONCATENATED MODULE: ./packages/radio/src/radio.vue
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
/* normalize component */
|
|
3284
|
-
|
|
3285
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
3286
|
-
src_radiovue_type_script_lang_js,
|
|
3287
|
-
render,
|
|
3288
|
-
staticRenderFns,
|
|
3289
|
-
false,
|
|
3290
|
-
null,
|
|
3291
|
-
null,
|
|
3292
|
-
null
|
|
3293
|
-
|
|
3294
|
-
)
|
|
3295
|
-
|
|
3296
|
-
/* harmony default export */ var src_radio = (component.exports);
|
|
3297
|
-
// CONCATENATED MODULE: ./packages/radio/index.js
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
/* istanbul ignore next */
|
|
3301
|
-
src_radio.install = function (Vue) {
|
|
3302
|
-
Vue.component(src_radio.name, src_radio);
|
|
3303
|
-
};
|
|
3304
|
-
|
|
3305
|
-
/* harmony default export */ var packages_radio = __webpack_exports__["default"] = (src_radio);
|
|
3306
|
-
|
|
3307
|
-
/***/ }),
|
|
3308
|
-
|
|
3309
|
-
/***/ 4:
|
|
3310
|
-
/***/ (function(module, exports) {
|
|
3311
|
-
|
|
3312
|
-
module.exports = require("element-ui/lib/mixins/emitter");
|
|
3313
|
-
|
|
3314
|
-
/***/ }),
|
|
3315
|
-
|
|
3316
|
-
/***/ 40:
|
|
3317
|
-
/***/ (function(module, exports) {
|
|
3318
|
-
|
|
3319
|
-
module.exports = require("element-ui/lib/utils/aria-utils");
|
|
3320
|
-
|
|
3321
|
-
/***/ }),
|
|
3322
|
-
|
|
3323
|
-
/***/ 47:
|
|
3324
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3325
|
-
|
|
3326
|
-
"use strict";
|
|
3327
|
-
// ESM COMPAT FLAG
|
|
3328
|
-
__webpack_require__.r(__webpack_exports__);
|
|
3329
|
-
|
|
3330
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=09ca3ff1
|
|
3331
|
-
var cascader_panelvue_type_template_id_09ca3ff1_render = function () {
|
|
3332
|
-
var _vm = this
|
|
3333
|
-
var _h = _vm.$createElement
|
|
3334
|
-
var _c = _vm._self._c || _h
|
|
3335
|
-
return _c(
|
|
3336
|
-
"div",
|
|
3337
|
-
{
|
|
3338
|
-
class: ["el-cascader-panel", _vm.border && "is-bordered"],
|
|
3339
|
-
on: { keydown: _vm.handleKeyDown },
|
|
3340
|
-
},
|
|
3341
|
-
_vm._l(_vm.menus, function (menu, index) {
|
|
3342
|
-
return _c("cascader-menu", {
|
|
3343
|
-
key: index,
|
|
3344
|
-
ref: "menu",
|
|
3345
|
-
refInFor: true,
|
|
3346
|
-
attrs: { index: index, nodes: menu },
|
|
3347
|
-
})
|
|
3348
|
-
}),
|
|
3349
|
-
1
|
|
3350
|
-
)
|
|
3351
|
-
}
|
|
3352
|
-
var staticRenderFns = []
|
|
3353
|
-
cascader_panelvue_type_template_id_09ca3ff1_render._withStripped = true
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=09ca3ff1
|
|
3357
|
-
|
|
3358
|
-
// EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
|
|
3359
|
-
var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(24);
|
|
3360
|
-
var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
|
|
3361
|
-
|
|
3362
|
-
// EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
|
|
3363
|
-
var scrollbar = __webpack_require__(18);
|
|
3364
|
-
|
|
3365
|
-
// EXTERNAL MODULE: ./packages/checkbox/index.js + 5 modules
|
|
3366
|
-
var packages_checkbox = __webpack_require__(16);
|
|
3367
|
-
|
|
3368
|
-
// EXTERNAL MODULE: ./packages/radio/index.js + 5 modules
|
|
3369
|
-
var packages_radio = __webpack_require__(38);
|
|
3370
|
-
|
|
3371
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/util"
|
|
3372
|
-
var util_ = __webpack_require__(3);
|
|
3373
|
-
|
|
3374
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
var stopPropagation = function stopPropagation(e) {
|
|
3382
|
-
return e.stopPropagation();
|
|
3383
|
-
};
|
|
3384
|
-
|
|
3385
|
-
/* harmony default export */ var cascader_nodevue_type_script_lang_js = ({
|
|
3386
|
-
inject: ['panel'],
|
|
3387
|
-
|
|
3388
|
-
components: {
|
|
3389
|
-
ElCheckbox: packages_checkbox["default"],
|
|
3390
|
-
ElRadio: packages_radio["default"]
|
|
3391
|
-
},
|
|
3392
|
-
|
|
3393
|
-
props: {
|
|
3394
|
-
node: {
|
|
3395
|
-
required: true
|
|
3396
|
-
},
|
|
3397
|
-
nodeId: String
|
|
3398
|
-
},
|
|
3399
|
-
|
|
3400
|
-
computed: {
|
|
3401
|
-
config: function config() {
|
|
3402
|
-
return this.panel.config;
|
|
3403
|
-
},
|
|
3404
|
-
isLeaf: function isLeaf() {
|
|
3405
|
-
return this.node.isLeaf;
|
|
3406
|
-
},
|
|
3407
|
-
isDisabled: function isDisabled() {
|
|
3408
|
-
return this.node.isDisabled;
|
|
3409
|
-
},
|
|
3410
|
-
checkedValue: function checkedValue() {
|
|
3411
|
-
return this.panel.checkedValue;
|
|
3412
|
-
},
|
|
3413
|
-
isChecked: function isChecked() {
|
|
3414
|
-
return this.node.isSameNode(this.checkedValue);
|
|
3415
|
-
},
|
|
3416
|
-
inActivePath: function inActivePath() {
|
|
3417
|
-
return this.isInPath(this.panel.activePath);
|
|
3418
|
-
},
|
|
3419
|
-
inCheckedPath: function inCheckedPath() {
|
|
3420
|
-
var _this = this;
|
|
3421
|
-
|
|
3422
|
-
if (!this.config.checkStrictly) return false;
|
|
3423
|
-
|
|
3424
|
-
return this.panel.checkedNodePaths.some(function (checkedPath) {
|
|
3425
|
-
return _this.isInPath(checkedPath);
|
|
3426
|
-
});
|
|
3427
|
-
},
|
|
3428
|
-
value: function value() {
|
|
3429
|
-
return this.node.getValueByOption();
|
|
3430
|
-
}
|
|
3431
|
-
},
|
|
3432
|
-
|
|
3433
|
-
methods: {
|
|
3434
|
-
handleExpand: function handleExpand() {
|
|
3435
|
-
var _this2 = this;
|
|
3436
|
-
|
|
3437
|
-
var panel = this.panel,
|
|
3438
|
-
node = this.node,
|
|
3439
|
-
isDisabled = this.isDisabled,
|
|
3440
|
-
config = this.config;
|
|
3441
|
-
var multiple = config.multiple,
|
|
3442
|
-
checkStrictly = config.checkStrictly;
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
if (!checkStrictly && isDisabled || node.loading) return;
|
|
3446
|
-
|
|
3447
|
-
if (config.lazy && !node.loaded) {
|
|
3448
|
-
panel.lazyLoad(node, function () {
|
|
3449
|
-
// do not use cached leaf value here, invoke this.isLeaf to get new value.
|
|
3450
|
-
var isLeaf = _this2.isLeaf;
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
if (!isLeaf) _this2.handleExpand();
|
|
3454
|
-
if (multiple) {
|
|
3455
|
-
// if leaf sync checked state, else clear checked state
|
|
3456
|
-
var checked = isLeaf ? node.checked : false;
|
|
3457
|
-
_this2.handleMultiCheckChange(checked);
|
|
3458
|
-
}
|
|
3459
|
-
});
|
|
3460
|
-
} else {
|
|
3461
|
-
panel.handleExpand(node);
|
|
3462
|
-
}
|
|
3463
|
-
},
|
|
3464
|
-
handleCheckChange: function handleCheckChange() {
|
|
3465
|
-
var panel = this.panel,
|
|
3466
|
-
value = this.value,
|
|
3467
|
-
node = this.node;
|
|
3468
|
-
|
|
3469
|
-
panel.handleCheckChange(value);
|
|
3470
|
-
panel.handleExpand(node);
|
|
3471
|
-
},
|
|
3472
|
-
handleMultiCheckChange: function handleMultiCheckChange(checked) {
|
|
3473
|
-
this.node.doCheck(checked);
|
|
3474
|
-
this.panel.calculateMultiCheckedValue();
|
|
3475
|
-
},
|
|
3476
|
-
isInPath: function isInPath(pathNodes) {
|
|
3477
|
-
var node = this.node;
|
|
3478
|
-
|
|
3479
|
-
var selectedPathNode = pathNodes[node.level - 1] || {};
|
|
3480
|
-
return selectedPathNode.uid === node.uid;
|
|
3481
|
-
},
|
|
3482
|
-
renderPrefix: function renderPrefix(h) {
|
|
3483
|
-
var isLeaf = this.isLeaf,
|
|
3484
|
-
isChecked = this.isChecked,
|
|
3485
|
-
config = this.config;
|
|
3486
|
-
var checkStrictly = config.checkStrictly,
|
|
3487
|
-
multiple = config.multiple;
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
if (multiple) {
|
|
3491
|
-
return this.renderCheckbox(h);
|
|
3492
|
-
} else if (checkStrictly) {
|
|
3493
|
-
return this.renderRadio(h);
|
|
3494
|
-
} else if (isLeaf && isChecked) {
|
|
3495
|
-
return this.renderCheckIcon(h);
|
|
3496
|
-
}
|
|
3497
|
-
|
|
3498
|
-
return null;
|
|
3499
|
-
},
|
|
3500
|
-
renderPostfix: function renderPostfix(h) {
|
|
3501
|
-
var node = this.node,
|
|
3502
|
-
isLeaf = this.isLeaf;
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
if (node.loading) {
|
|
3506
|
-
return this.renderLoadingIcon(h);
|
|
3507
|
-
} else if (!isLeaf) {
|
|
3508
|
-
return this.renderExpandIcon(h);
|
|
3509
|
-
}
|
|
3510
|
-
|
|
3511
|
-
return null;
|
|
3512
|
-
},
|
|
3513
|
-
renderCheckbox: function renderCheckbox(h) {
|
|
3514
|
-
var node = this.node,
|
|
3515
|
-
config = this.config,
|
|
3516
|
-
isDisabled = this.isDisabled;
|
|
3517
|
-
|
|
3518
|
-
var events = {
|
|
3519
|
-
on: { change: this.handleMultiCheckChange },
|
|
3520
|
-
nativeOn: {}
|
|
3521
|
-
};
|
|
3522
|
-
|
|
3523
|
-
if (config.checkStrictly) {
|
|
3524
|
-
// when every node is selectable, click event should not trigger expand event.
|
|
3525
|
-
events.nativeOn.click = stopPropagation;
|
|
3526
|
-
}
|
|
3527
|
-
|
|
3528
|
-
return h('el-checkbox', external_babel_helper_vue_jsx_merge_props_default()([{
|
|
3529
|
-
attrs: {
|
|
3530
|
-
value: node.checked,
|
|
3531
|
-
indeterminate: node.indeterminate,
|
|
3532
|
-
disabled: isDisabled
|
|
3533
|
-
}
|
|
3534
|
-
}, events]));
|
|
3535
|
-
},
|
|
3536
|
-
renderRadio: function renderRadio(h) {
|
|
3537
|
-
var checkedValue = this.checkedValue,
|
|
3538
|
-
value = this.value,
|
|
3539
|
-
isDisabled = this.isDisabled;
|
|
3540
|
-
|
|
3541
|
-
// to keep same reference if value cause radio's checked state is calculated by reference comparision;
|
|
3542
|
-
|
|
3543
|
-
if (Object(util_["isEqual"])(value, checkedValue)) {
|
|
3544
|
-
value = checkedValue;
|
|
3545
|
-
}
|
|
3546
|
-
|
|
3547
|
-
return h(
|
|
3548
|
-
'el-radio',
|
|
3549
|
-
{
|
|
3550
|
-
attrs: {
|
|
3551
|
-
value: checkedValue,
|
|
3552
|
-
label: value,
|
|
3553
|
-
disabled: isDisabled
|
|
3554
|
-
},
|
|
3555
|
-
on: {
|
|
3556
|
-
'change': this.handleCheckChange
|
|
3557
|
-
},
|
|
3558
|
-
nativeOn: {
|
|
3559
|
-
'click': stopPropagation
|
|
3560
|
-
}
|
|
3561
|
-
},
|
|
3562
|
-
[h('span')]
|
|
3563
|
-
);
|
|
3564
|
-
},
|
|
3565
|
-
renderCheckIcon: function renderCheckIcon(h) {
|
|
3566
|
-
return h('i', { 'class': 'el-icon-check el-cascader-node__prefix' });
|
|
3567
|
-
},
|
|
3568
|
-
renderLoadingIcon: function renderLoadingIcon(h) {
|
|
3569
|
-
return h('i', { 'class': 'el-icon-loading el-cascader-node__postfix' });
|
|
3570
|
-
},
|
|
3571
|
-
renderExpandIcon: function renderExpandIcon(h) {
|
|
3572
|
-
return h('i', { 'class': 'el-icon-arrow-right el-cascader-node__postfix' });
|
|
3573
|
-
},
|
|
3574
|
-
renderContent: function renderContent(h) {
|
|
3575
|
-
var panel = this.panel,
|
|
3576
|
-
node = this.node;
|
|
3577
|
-
|
|
3578
|
-
var render = panel.renderLabelFn;
|
|
3579
|
-
var vnode = render ? render({ node: node, data: node.data }) : null;
|
|
3580
|
-
|
|
3581
|
-
return h(
|
|
3582
|
-
'span',
|
|
3583
|
-
{ 'class': 'el-cascader-node__label' },
|
|
3584
|
-
[vnode || node.label]
|
|
3585
|
-
);
|
|
3586
|
-
}
|
|
3587
|
-
},
|
|
3588
|
-
|
|
3589
|
-
render: function render(h) {
|
|
3590
|
-
var _this3 = this;
|
|
3591
|
-
|
|
3592
|
-
var inActivePath = this.inActivePath,
|
|
3593
|
-
inCheckedPath = this.inCheckedPath,
|
|
3594
|
-
isChecked = this.isChecked,
|
|
3595
|
-
isLeaf = this.isLeaf,
|
|
3596
|
-
isDisabled = this.isDisabled,
|
|
3597
|
-
config = this.config,
|
|
3598
|
-
nodeId = this.nodeId;
|
|
3599
|
-
var expandTrigger = config.expandTrigger,
|
|
3600
|
-
checkStrictly = config.checkStrictly,
|
|
3601
|
-
multiple = config.multiple;
|
|
3602
|
-
|
|
3603
|
-
var disabled = !checkStrictly && isDisabled;
|
|
3604
|
-
var events = { on: {} };
|
|
3605
|
-
|
|
3606
|
-
if (expandTrigger === 'click') {
|
|
3607
|
-
events.on.click = this.handleExpand;
|
|
3608
|
-
} else {
|
|
3609
|
-
events.on.mouseenter = function (e) {
|
|
3610
|
-
_this3.handleExpand();
|
|
3611
|
-
_this3.$emit('expand', e);
|
|
3612
|
-
};
|
|
3613
|
-
events.on.focus = function (e) {
|
|
3614
|
-
_this3.handleExpand();
|
|
3615
|
-
_this3.$emit('expand', e);
|
|
3616
|
-
};
|
|
3617
|
-
}
|
|
3618
|
-
if (isLeaf && !isDisabled && !checkStrictly && !multiple) {
|
|
3619
|
-
events.on.click = this.handleCheckChange;
|
|
3620
|
-
}
|
|
3621
|
-
|
|
3622
|
-
return h(
|
|
3623
|
-
'li',
|
|
3624
|
-
external_babel_helper_vue_jsx_merge_props_default()([{
|
|
3625
|
-
attrs: {
|
|
3626
|
-
role: 'menuitem',
|
|
3627
|
-
id: nodeId,
|
|
3628
|
-
'aria-expanded': inActivePath,
|
|
3629
|
-
tabindex: disabled ? null : -1
|
|
3630
|
-
},
|
|
3631
|
-
'class': {
|
|
3632
|
-
'el-cascader-node': true,
|
|
3633
|
-
'is-selectable': checkStrictly,
|
|
3634
|
-
'in-active-path': inActivePath,
|
|
3635
|
-
'in-checked-path': inCheckedPath,
|
|
3636
|
-
'is-active': isChecked,
|
|
3637
|
-
'is-disabled': disabled
|
|
3638
|
-
}
|
|
3639
|
-
}, events]),
|
|
3640
|
-
[this.renderPrefix(h), this.renderContent(h), this.renderPostfix(h)]
|
|
3641
|
-
);
|
|
3642
|
-
}
|
|
3643
|
-
});
|
|
3644
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js
|
|
3645
|
-
/* harmony default export */ var src_cascader_nodevue_type_script_lang_js = (cascader_nodevue_type_script_lang_js);
|
|
3646
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
3647
|
-
var componentNormalizer = __webpack_require__(0);
|
|
3648
|
-
|
|
3649
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue
|
|
3650
|
-
var cascader_node_render, cascader_node_staticRenderFns
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
/* normalize component */
|
|
3656
|
-
|
|
3657
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
3658
|
-
src_cascader_nodevue_type_script_lang_js,
|
|
3659
|
-
cascader_node_render,
|
|
3660
|
-
cascader_node_staticRenderFns,
|
|
3661
|
-
false,
|
|
3662
|
-
null,
|
|
3663
|
-
null,
|
|
3664
|
-
null
|
|
3665
|
-
|
|
3666
|
-
)
|
|
3667
|
-
|
|
3668
|
-
/* harmony default export */ var cascader_node = (component.exports);
|
|
3669
|
-
// EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
|
|
3670
|
-
var locale_ = __webpack_require__(9);
|
|
3671
|
-
var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
|
|
3672
|
-
|
|
3673
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
/* harmony default export */ var cascader_menuvue_type_script_lang_js = ({
|
|
3682
|
-
name: 'ElCascaderMenu',
|
|
3683
|
-
|
|
3684
|
-
mixins: [locale_default.a],
|
|
3685
|
-
|
|
3686
|
-
inject: ['panel'],
|
|
3687
|
-
|
|
3688
|
-
components: {
|
|
3689
|
-
ElScrollbar: scrollbar["default"],
|
|
3690
|
-
CascaderNode: cascader_node
|
|
3691
|
-
},
|
|
3692
|
-
|
|
3693
|
-
props: {
|
|
3694
|
-
nodes: {
|
|
3695
|
-
type: Array,
|
|
3696
|
-
required: true
|
|
3697
|
-
},
|
|
3698
|
-
index: Number
|
|
3699
|
-
},
|
|
3700
|
-
|
|
3701
|
-
data: function data() {
|
|
3702
|
-
return {
|
|
3703
|
-
activeNode: null,
|
|
3704
|
-
hoverTimer: null,
|
|
3705
|
-
id: Object(util_["generateId"])()
|
|
3706
|
-
};
|
|
3707
|
-
},
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
computed: {
|
|
3711
|
-
isEmpty: function isEmpty() {
|
|
3712
|
-
return !this.nodes.length;
|
|
3713
|
-
},
|
|
3714
|
-
menuId: function menuId() {
|
|
3715
|
-
return 'cascader-menu-' + this.id + '-' + this.index;
|
|
3716
|
-
}
|
|
3717
|
-
},
|
|
3718
|
-
|
|
3719
|
-
methods: {
|
|
3720
|
-
handleExpand: function handleExpand(e) {
|
|
3721
|
-
this.activeNode = e.target;
|
|
3722
|
-
},
|
|
3723
|
-
handleMouseMove: function handleMouseMove(e) {
|
|
3724
|
-
var activeNode = this.activeNode,
|
|
3725
|
-
hoverTimer = this.hoverTimer;
|
|
3726
|
-
var hoverZone = this.$refs.hoverZone;
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
if (!activeNode || !hoverZone) return;
|
|
3730
|
-
|
|
3731
|
-
if (activeNode.contains(e.target)) {
|
|
3732
|
-
clearTimeout(hoverTimer);
|
|
3733
|
-
|
|
3734
|
-
var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
|
|
3735
|
-
left = _$el$getBoundingClien.left;
|
|
3736
|
-
|
|
3737
|
-
var startX = e.clientX - left;
|
|
3738
|
-
var _$el = this.$el,
|
|
3739
|
-
offsetWidth = _$el.offsetWidth,
|
|
3740
|
-
offsetHeight = _$el.offsetHeight;
|
|
3741
|
-
|
|
3742
|
-
var top = activeNode.offsetTop;
|
|
3743
|
-
var bottom = top + activeNode.offsetHeight;
|
|
3744
|
-
|
|
3745
|
-
hoverZone.innerHTML = '\n <path style="pointer-events: auto;" fill="transparent" d="M' + startX + ' ' + top + ' L' + offsetWidth + ' 0 V' + top + ' Z" />\n <path style="pointer-events: auto;" fill="transparent" d="M' + startX + ' ' + bottom + ' L' + offsetWidth + ' ' + offsetHeight + ' V' + bottom + ' Z" />\n ';
|
|
3746
|
-
} else if (!hoverTimer) {
|
|
3747
|
-
this.hoverTimer = setTimeout(this.clearHoverZone, this.panel.config.hoverThreshold);
|
|
3748
|
-
}
|
|
3749
|
-
},
|
|
3750
|
-
clearHoverZone: function clearHoverZone() {
|
|
3751
|
-
var hoverZone = this.$refs.hoverZone;
|
|
3752
|
-
|
|
3753
|
-
if (!hoverZone) return;
|
|
3754
|
-
hoverZone.innerHTML = '';
|
|
3755
|
-
},
|
|
3756
|
-
renderEmptyText: function renderEmptyText(h) {
|
|
3757
|
-
return h(
|
|
3758
|
-
'div',
|
|
3759
|
-
{ 'class': 'el-cascader-menu__empty-text' },
|
|
3760
|
-
[this.t('el.cascader.noData')]
|
|
3761
|
-
);
|
|
3762
|
-
},
|
|
3763
|
-
renderNodeList: function renderNodeList(h) {
|
|
3764
|
-
var menuId = this.menuId;
|
|
3765
|
-
var isHoverMenu = this.panel.isHoverMenu;
|
|
3766
|
-
|
|
3767
|
-
var events = { on: {} };
|
|
3768
|
-
|
|
3769
|
-
if (isHoverMenu) {
|
|
3770
|
-
events.on.expand = this.handleExpand;
|
|
3771
|
-
}
|
|
3772
|
-
|
|
3773
|
-
var nodes = this.nodes.map(function (node, index) {
|
|
3774
|
-
var hasChildren = node.hasChildren;
|
|
3775
|
-
|
|
3776
|
-
return h('cascader-node', external_babel_helper_vue_jsx_merge_props_default()([{
|
|
3777
|
-
key: node.uid,
|
|
3778
|
-
attrs: { node: node,
|
|
3779
|
-
'node-id': menuId + '-' + index,
|
|
3780
|
-
'aria-haspopup': hasChildren,
|
|
3781
|
-
'aria-owns': hasChildren ? menuId : null
|
|
3782
|
-
}
|
|
3783
|
-
}, events]));
|
|
3784
|
-
});
|
|
3785
|
-
|
|
3786
|
-
return [].concat(nodes, [isHoverMenu ? h('svg', { ref: 'hoverZone', 'class': 'el-cascader-menu__hover-zone' }) : null]);
|
|
3787
|
-
}
|
|
3788
|
-
},
|
|
3789
|
-
|
|
3790
|
-
render: function render(h) {
|
|
3791
|
-
var isEmpty = this.isEmpty,
|
|
3792
|
-
menuId = this.menuId;
|
|
3793
|
-
|
|
3794
|
-
var events = { nativeOn: {} };
|
|
3795
|
-
|
|
3796
|
-
// optimize hover to expand experience (#8010)
|
|
3797
|
-
if (this.panel.isHoverMenu) {
|
|
3798
|
-
events.nativeOn.mousemove = this.handleMouseMove;
|
|
3799
|
-
// events.nativeOn.mouseleave = this.clearHoverZone;
|
|
3800
|
-
}
|
|
3801
|
-
|
|
3802
|
-
return h(
|
|
3803
|
-
'el-scrollbar',
|
|
3804
|
-
external_babel_helper_vue_jsx_merge_props_default()([{
|
|
3805
|
-
attrs: {
|
|
3806
|
-
tag: 'ul',
|
|
3807
|
-
role: 'menu',
|
|
3808
|
-
id: menuId,
|
|
3809
|
-
|
|
3810
|
-
'wrap-class': 'el-cascader-menu__wrap',
|
|
3811
|
-
'view-class': {
|
|
3812
|
-
'el-cascader-menu__list': true,
|
|
3813
|
-
'is-empty': isEmpty
|
|
3814
|
-
}
|
|
3815
|
-
},
|
|
3816
|
-
'class': 'el-cascader-menu' }, events]),
|
|
3817
|
-
[isEmpty ? this.renderEmptyText(h) : this.renderNodeList(h)]
|
|
3818
|
-
);
|
|
3819
|
-
}
|
|
3820
|
-
});
|
|
3821
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js
|
|
3822
|
-
/* harmony default export */ var src_cascader_menuvue_type_script_lang_js = (cascader_menuvue_type_script_lang_js);
|
|
3823
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue
|
|
3824
|
-
var cascader_menu_render, cascader_menu_staticRenderFns
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
/* normalize component */
|
|
3830
|
-
|
|
3831
|
-
var cascader_menu_component = Object(componentNormalizer["a" /* default */])(
|
|
3832
|
-
src_cascader_menuvue_type_script_lang_js,
|
|
3833
|
-
cascader_menu_render,
|
|
3834
|
-
cascader_menu_staticRenderFns,
|
|
3835
|
-
false,
|
|
3836
|
-
null,
|
|
3837
|
-
null,
|
|
3838
|
-
null
|
|
3839
|
-
|
|
3840
|
-
)
|
|
3841
|
-
|
|
3842
|
-
/* harmony default export */ var cascader_menu = (cascader_menu_component.exports);
|
|
3843
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/shared"
|
|
3844
|
-
var shared_ = __webpack_require__(11);
|
|
3845
|
-
|
|
3846
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/node.js
|
|
3847
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
3848
|
-
|
|
3849
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
var uid = 0;
|
|
3855
|
-
|
|
3856
|
-
var node_Node = function () {
|
|
3857
|
-
function Node(data, config, parentNode) {
|
|
3858
|
-
_classCallCheck(this, Node);
|
|
3859
|
-
|
|
3860
|
-
this.data = data;
|
|
3861
|
-
this.config = config;
|
|
3862
|
-
this.parent = parentNode || null;
|
|
3863
|
-
this.level = !this.parent ? 1 : this.parent.level + 1;
|
|
3864
|
-
this.uid = uid++;
|
|
3865
|
-
|
|
3866
|
-
this.initState();
|
|
3867
|
-
this.initChildren();
|
|
3868
|
-
}
|
|
3869
|
-
|
|
3870
|
-
Node.prototype.initState = function initState() {
|
|
3871
|
-
var _config = this.config,
|
|
3872
|
-
valueKey = _config.value,
|
|
3873
|
-
labelKey = _config.label;
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
this.value = this.data[valueKey];
|
|
3877
|
-
this.label = this.data[labelKey];
|
|
3878
|
-
this.pathNodes = this.calculatePathNodes();
|
|
3879
|
-
this.path = this.pathNodes.map(function (node) {
|
|
3880
|
-
return node.value;
|
|
3881
|
-
});
|
|
3882
|
-
this.pathLabels = this.pathNodes.map(function (node) {
|
|
3883
|
-
return node.label;
|
|
3884
|
-
});
|
|
3885
|
-
|
|
3886
|
-
// lazy load
|
|
3887
|
-
this.loading = false;
|
|
3888
|
-
this.loaded = false;
|
|
3889
|
-
};
|
|
3890
|
-
|
|
3891
|
-
Node.prototype.initChildren = function initChildren() {
|
|
3892
|
-
var _this = this;
|
|
3893
|
-
|
|
3894
|
-
var config = this.config;
|
|
3895
|
-
|
|
3896
|
-
var childrenKey = config.children;
|
|
3897
|
-
var childrenData = this.data[childrenKey];
|
|
3898
|
-
this.hasChildren = Array.isArray(childrenData);
|
|
3899
|
-
this.children = (childrenData || []).map(function (child) {
|
|
3900
|
-
return new Node(child, config, _this);
|
|
3901
|
-
});
|
|
3902
|
-
};
|
|
3903
|
-
|
|
3904
|
-
Node.prototype.calculatePathNodes = function calculatePathNodes() {
|
|
3905
|
-
var nodes = [this];
|
|
3906
|
-
var parent = this.parent;
|
|
3907
|
-
|
|
3908
|
-
while (parent) {
|
|
3909
|
-
nodes.unshift(parent);
|
|
3910
|
-
parent = parent.parent;
|
|
3911
|
-
}
|
|
3912
|
-
|
|
3913
|
-
return nodes;
|
|
3914
|
-
};
|
|
3915
|
-
|
|
3916
|
-
Node.prototype.getPath = function getPath() {
|
|
3917
|
-
return this.path;
|
|
3918
|
-
};
|
|
3919
|
-
|
|
3920
|
-
Node.prototype.getValue = function getValue() {
|
|
3921
|
-
return this.value;
|
|
3922
|
-
};
|
|
3923
|
-
|
|
3924
|
-
Node.prototype.getValueByOption = function getValueByOption() {
|
|
3925
|
-
return this.config.emitPath ? this.getPath() : this.getValue();
|
|
3926
|
-
};
|
|
3927
|
-
|
|
3928
|
-
Node.prototype.getText = function getText(allLevels, separator) {
|
|
3929
|
-
return allLevels ? this.pathLabels.join(separator) : this.label;
|
|
3930
|
-
};
|
|
3931
|
-
|
|
3932
|
-
Node.prototype.isSameNode = function isSameNode(checkedValue) {
|
|
3933
|
-
var value = this.getValueByOption();
|
|
3934
|
-
return this.config.multiple && Array.isArray(checkedValue) ? checkedValue.some(function (val) {
|
|
3935
|
-
return Object(util_["isEqual"])(val, value);
|
|
3936
|
-
}) : Object(util_["isEqual"])(checkedValue, value);
|
|
3937
|
-
};
|
|
3938
|
-
|
|
3939
|
-
Node.prototype.broadcast = function broadcast(event) {
|
|
3940
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
3941
|
-
args[_key - 1] = arguments[_key];
|
|
3942
|
-
}
|
|
3943
|
-
|
|
3944
|
-
var handlerName = 'onParent' + Object(util_["capitalize"])(event);
|
|
3945
|
-
|
|
3946
|
-
this.children.forEach(function (child) {
|
|
3947
|
-
if (child) {
|
|
3948
|
-
// bottom up
|
|
3949
|
-
child.broadcast.apply(child, [event].concat(args));
|
|
3950
|
-
child[handlerName] && child[handlerName].apply(child, args);
|
|
3951
|
-
}
|
|
3952
|
-
});
|
|
3953
|
-
};
|
|
3954
|
-
|
|
3955
|
-
Node.prototype.emit = function emit(event) {
|
|
3956
|
-
var parent = this.parent;
|
|
3957
|
-
|
|
3958
|
-
var handlerName = 'onChild' + Object(util_["capitalize"])(event);
|
|
3959
|
-
if (parent) {
|
|
3960
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
3961
|
-
args[_key2 - 1] = arguments[_key2];
|
|
3962
|
-
}
|
|
3963
|
-
|
|
3964
|
-
parent[handlerName] && parent[handlerName].apply(parent, args);
|
|
3965
|
-
parent.emit.apply(parent, [event].concat(args));
|
|
3966
|
-
}
|
|
3967
|
-
};
|
|
3968
|
-
|
|
3969
|
-
Node.prototype.onParentCheck = function onParentCheck(checked) {
|
|
3970
|
-
if (!this.isDisabled) {
|
|
3971
|
-
this.setCheckState(checked);
|
|
3972
|
-
}
|
|
3973
|
-
};
|
|
3974
|
-
|
|
3975
|
-
Node.prototype.onChildCheck = function onChildCheck() {
|
|
3976
|
-
var children = this.children;
|
|
3977
|
-
|
|
3978
|
-
var validChildren = children.filter(function (child) {
|
|
3979
|
-
return !child.isDisabled;
|
|
3980
|
-
});
|
|
3981
|
-
var checked = validChildren.length ? validChildren.every(function (child) {
|
|
3982
|
-
return child.checked;
|
|
3983
|
-
}) : false;
|
|
3984
|
-
|
|
3985
|
-
this.setCheckState(checked);
|
|
3986
|
-
};
|
|
3987
|
-
|
|
3988
|
-
Node.prototype.setCheckState = function setCheckState(checked) {
|
|
3989
|
-
var totalNum = this.children.length;
|
|
3990
|
-
var checkedNum = this.children.reduce(function (c, p) {
|
|
3991
|
-
var num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
|
|
3992
|
-
return c + num;
|
|
3993
|
-
}, 0);
|
|
3994
|
-
|
|
3995
|
-
this.checked = checked;
|
|
3996
|
-
this.indeterminate = checkedNum !== totalNum && checkedNum > 0;
|
|
3997
|
-
};
|
|
3998
|
-
|
|
3999
|
-
Node.prototype.syncCheckState = function syncCheckState(checkedValue) {
|
|
4000
|
-
var value = this.getValueByOption();
|
|
4001
|
-
var checked = this.isSameNode(checkedValue, value);
|
|
4002
|
-
|
|
4003
|
-
this.doCheck(checked);
|
|
4004
|
-
};
|
|
4005
|
-
|
|
4006
|
-
Node.prototype.doCheck = function doCheck(checked) {
|
|
4007
|
-
if (this.checked !== checked) {
|
|
4008
|
-
if (this.config.checkStrictly) {
|
|
4009
|
-
this.checked = checked;
|
|
4010
|
-
} else {
|
|
4011
|
-
// bottom up to unify the calculation of the indeterminate state
|
|
4012
|
-
this.broadcast('check', checked);
|
|
4013
|
-
this.setCheckState(checked);
|
|
4014
|
-
this.emit('check');
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
};
|
|
4018
|
-
|
|
4019
|
-
_createClass(Node, [{
|
|
4020
|
-
key: 'isDisabled',
|
|
4021
|
-
get: function get() {
|
|
4022
|
-
var data = this.data,
|
|
4023
|
-
parent = this.parent,
|
|
4024
|
-
config = this.config;
|
|
4025
|
-
|
|
4026
|
-
var disabledKey = config.disabled;
|
|
4027
|
-
var checkStrictly = config.checkStrictly;
|
|
4028
|
-
|
|
4029
|
-
return data[disabledKey] || !checkStrictly && parent && parent.isDisabled;
|
|
4030
|
-
}
|
|
4031
|
-
}, {
|
|
4032
|
-
key: 'isLeaf',
|
|
4033
|
-
get: function get() {
|
|
4034
|
-
var data = this.data,
|
|
4035
|
-
loaded = this.loaded,
|
|
4036
|
-
hasChildren = this.hasChildren,
|
|
4037
|
-
children = this.children;
|
|
4038
|
-
var _config2 = this.config,
|
|
4039
|
-
lazy = _config2.lazy,
|
|
4040
|
-
leafKey = _config2.leaf;
|
|
4041
|
-
|
|
4042
|
-
if (lazy) {
|
|
4043
|
-
var isLeaf = Object(shared_["isDef"])(data[leafKey]) ? data[leafKey] : loaded ? !children.length : false;
|
|
4044
|
-
this.hasChildren = !isLeaf;
|
|
4045
|
-
return isLeaf;
|
|
4046
|
-
}
|
|
4047
|
-
return !hasChildren;
|
|
4048
|
-
}
|
|
4049
|
-
}]);
|
|
4050
|
-
|
|
4051
|
-
return Node;
|
|
4052
|
-
}();
|
|
4053
|
-
|
|
4054
|
-
/* harmony default export */ var src_node = (node_Node);
|
|
4055
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/store.js
|
|
4056
|
-
function store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
var flatNodes = function flatNodes(data, leafOnly) {
|
|
4062
|
-
return data.reduce(function (res, node) {
|
|
4063
|
-
if (node.isLeaf) {
|
|
4064
|
-
res.push(node);
|
|
4065
|
-
} else {
|
|
4066
|
-
!leafOnly && res.push(node);
|
|
4067
|
-
res = res.concat(flatNodes(node.children, leafOnly));
|
|
4068
|
-
}
|
|
4069
|
-
return res;
|
|
4070
|
-
}, []);
|
|
4071
|
-
};
|
|
4072
|
-
|
|
4073
|
-
var store_Store = function () {
|
|
4074
|
-
function Store(data, config) {
|
|
4075
|
-
store_classCallCheck(this, Store);
|
|
4076
|
-
|
|
4077
|
-
this.config = config;
|
|
4078
|
-
this.initNodes(data);
|
|
4079
|
-
}
|
|
4080
|
-
|
|
4081
|
-
Store.prototype.initNodes = function initNodes(data) {
|
|
4082
|
-
var _this = this;
|
|
4083
|
-
|
|
4084
|
-
data = Object(util_["coerceTruthyValueToArray"])(data);
|
|
4085
|
-
this.nodes = data.map(function (nodeData) {
|
|
4086
|
-
return new src_node(nodeData, _this.config);
|
|
4087
|
-
});
|
|
4088
|
-
this.flattedNodes = this.getFlattedNodes(false, false);
|
|
4089
|
-
this.leafNodes = this.getFlattedNodes(true, false);
|
|
4090
|
-
};
|
|
4091
|
-
|
|
4092
|
-
Store.prototype.appendNode = function appendNode(nodeData, parentNode) {
|
|
4093
|
-
var node = new src_node(nodeData, this.config, parentNode);
|
|
4094
|
-
var children = parentNode ? parentNode.children : this.nodes;
|
|
4095
|
-
|
|
4096
|
-
children.push(node);
|
|
4097
|
-
};
|
|
4098
|
-
|
|
4099
|
-
Store.prototype.appendNodes = function appendNodes(nodeDataList, parentNode) {
|
|
4100
|
-
var _this2 = this;
|
|
4101
|
-
|
|
4102
|
-
nodeDataList = Object(util_["coerceTruthyValueToArray"])(nodeDataList);
|
|
4103
|
-
nodeDataList.forEach(function (nodeData) {
|
|
4104
|
-
return _this2.appendNode(nodeData, parentNode);
|
|
4105
|
-
});
|
|
4106
|
-
};
|
|
4107
|
-
|
|
4108
|
-
Store.prototype.getNodes = function getNodes() {
|
|
4109
|
-
return this.nodes;
|
|
4110
|
-
};
|
|
4111
|
-
|
|
4112
|
-
Store.prototype.getFlattedNodes = function getFlattedNodes(leafOnly) {
|
|
4113
|
-
var cached = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
4114
|
-
|
|
4115
|
-
var cachedNodes = leafOnly ? this.leafNodes : this.flattedNodes;
|
|
4116
|
-
return cached ? cachedNodes : flatNodes(this.nodes, leafOnly);
|
|
4117
|
-
};
|
|
4118
|
-
|
|
4119
|
-
Store.prototype.getNodeByValue = function getNodeByValue(value) {
|
|
4120
|
-
var nodes = this.getFlattedNodes(false, !this.config.lazy).filter(function (node) {
|
|
4121
|
-
return Object(util_["valueEquals"])(node.path, value) || node.value === value;
|
|
4122
|
-
});
|
|
4123
|
-
return nodes && nodes.length ? nodes[0] : null;
|
|
4124
|
-
};
|
|
4125
|
-
|
|
4126
|
-
return Store;
|
|
4127
|
-
}();
|
|
4128
|
-
|
|
4129
|
-
/* harmony default export */ var src_store = (store_Store);
|
|
4130
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/merge"
|
|
4131
|
-
var merge_ = __webpack_require__(6);
|
|
4132
|
-
var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
|
|
4133
|
-
|
|
4134
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/aria-utils"
|
|
4135
|
-
var aria_utils_ = __webpack_require__(40);
|
|
4136
|
-
var aria_utils_default = /*#__PURE__*/__webpack_require__.n(aria_utils_);
|
|
4137
|
-
|
|
4138
|
-
// EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
|
|
4139
|
-
var scroll_into_view_ = __webpack_require__(26);
|
|
4140
|
-
var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
|
|
4141
|
-
|
|
4142
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js
|
|
4143
|
-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
4144
|
-
|
|
4145
|
-
//
|
|
4146
|
-
//
|
|
4147
|
-
//
|
|
4148
|
-
//
|
|
4149
|
-
//
|
|
4150
|
-
//
|
|
4151
|
-
//
|
|
4152
|
-
//
|
|
4153
|
-
//
|
|
4154
|
-
//
|
|
4155
|
-
//
|
|
4156
|
-
//
|
|
4157
|
-
//
|
|
4158
|
-
//
|
|
4159
|
-
//
|
|
4160
|
-
//
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
var KeyCode = aria_utils_default.a.keys;
|
|
4170
|
-
|
|
4171
|
-
var DefaultProps = {
|
|
4172
|
-
expandTrigger: 'click', // or hover
|
|
4173
|
-
multiple: false,
|
|
4174
|
-
checkStrictly: false, // whether all nodes can be selected
|
|
4175
|
-
emitPath: true, // wether to emit an array of all levels value in which node is located
|
|
4176
|
-
lazy: false,
|
|
4177
|
-
lazyLoad: util_["noop"],
|
|
4178
|
-
value: 'value',
|
|
4179
|
-
label: 'label',
|
|
4180
|
-
children: 'children',
|
|
4181
|
-
leaf: 'leaf',
|
|
4182
|
-
disabled: 'disabled',
|
|
4183
|
-
hoverThreshold: 500
|
|
4184
|
-
};
|
|
4185
|
-
|
|
4186
|
-
var cascader_panelvue_type_script_lang_js_isLeaf = function isLeaf(el) {
|
|
4187
|
-
return !el.getAttribute('aria-owns');
|
|
4188
|
-
};
|
|
4189
|
-
|
|
4190
|
-
var getSibling = function getSibling(el, distance) {
|
|
4191
|
-
var parentNode = el.parentNode;
|
|
4192
|
-
|
|
4193
|
-
if (parentNode) {
|
|
4194
|
-
var siblings = parentNode.querySelectorAll('.el-cascader-node[tabindex="-1"]');
|
|
4195
|
-
var index = Array.prototype.indexOf.call(siblings, el);
|
|
4196
|
-
return siblings[index + distance] || null;
|
|
4197
|
-
}
|
|
4198
|
-
return null;
|
|
4199
|
-
};
|
|
4200
|
-
|
|
4201
|
-
var getMenuIndex = function getMenuIndex(el, distance) {
|
|
4202
|
-
if (!el) return;
|
|
4203
|
-
var pieces = el.id.split('-');
|
|
4204
|
-
return Number(pieces[pieces.length - 2]);
|
|
4205
|
-
};
|
|
4206
|
-
|
|
4207
|
-
var focusNode = function focusNode(el) {
|
|
4208
|
-
if (!el) return;
|
|
4209
|
-
el.focus();
|
|
4210
|
-
!cascader_panelvue_type_script_lang_js_isLeaf(el) && el.click();
|
|
4211
|
-
};
|
|
4212
|
-
|
|
4213
|
-
var checkNode = function checkNode(el) {
|
|
4214
|
-
if (!el) return;
|
|
4215
|
-
|
|
4216
|
-
var input = el.querySelector('input');
|
|
4217
|
-
if (input) {
|
|
4218
|
-
input.click();
|
|
4219
|
-
} else if (cascader_panelvue_type_script_lang_js_isLeaf(el)) {
|
|
4220
|
-
el.click();
|
|
4221
|
-
}
|
|
4222
|
-
};
|
|
4223
|
-
|
|
4224
|
-
/* harmony default export */ var cascader_panelvue_type_script_lang_js = ({
|
|
4225
|
-
name: 'ElCascaderPanel',
|
|
4226
|
-
|
|
4227
|
-
components: {
|
|
4228
|
-
CascaderMenu: cascader_menu
|
|
4229
|
-
},
|
|
4230
|
-
|
|
4231
|
-
props: {
|
|
4232
|
-
value: {},
|
|
4233
|
-
options: Array,
|
|
4234
|
-
props: Object,
|
|
4235
|
-
border: {
|
|
4236
|
-
type: Boolean,
|
|
4237
|
-
default: true
|
|
4238
|
-
},
|
|
4239
|
-
renderLabel: Function
|
|
4240
|
-
},
|
|
4241
|
-
|
|
4242
|
-
provide: function provide() {
|
|
4243
|
-
return {
|
|
4244
|
-
panel: this
|
|
4245
|
-
};
|
|
4246
|
-
},
|
|
4247
|
-
data: function data() {
|
|
4248
|
-
return {
|
|
4249
|
-
checkedValue: null,
|
|
4250
|
-
checkedNodePaths: [],
|
|
4251
|
-
store: [],
|
|
4252
|
-
menus: [],
|
|
4253
|
-
activePath: [],
|
|
4254
|
-
loadCount: 0
|
|
4255
|
-
};
|
|
4256
|
-
},
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
computed: {
|
|
4260
|
-
config: function config() {
|
|
4261
|
-
return merge_default()(_extends({}, DefaultProps), this.props || {});
|
|
4262
|
-
},
|
|
4263
|
-
multiple: function multiple() {
|
|
4264
|
-
return this.config.multiple;
|
|
4265
|
-
},
|
|
4266
|
-
checkStrictly: function checkStrictly() {
|
|
4267
|
-
return this.config.checkStrictly;
|
|
4268
|
-
},
|
|
4269
|
-
leafOnly: function leafOnly() {
|
|
4270
|
-
return !this.checkStrictly;
|
|
4271
|
-
},
|
|
4272
|
-
isHoverMenu: function isHoverMenu() {
|
|
4273
|
-
return this.config.expandTrigger === 'hover';
|
|
4274
|
-
},
|
|
4275
|
-
renderLabelFn: function renderLabelFn() {
|
|
4276
|
-
return this.renderLabel || this.$scopedSlots.default;
|
|
4277
|
-
}
|
|
4278
|
-
},
|
|
4279
|
-
|
|
4280
|
-
watch: {
|
|
4281
|
-
value: function value() {
|
|
4282
|
-
this.syncCheckedValue();
|
|
4283
|
-
this.checkStrictly && this.calculateCheckedNodePaths();
|
|
4284
|
-
},
|
|
4285
|
-
|
|
4286
|
-
options: {
|
|
4287
|
-
handler: function handler() {
|
|
4288
|
-
this.initStore();
|
|
4289
|
-
},
|
|
4290
|
-
immediate: true,
|
|
4291
|
-
deep: true
|
|
4292
|
-
},
|
|
4293
|
-
checkedValue: function checkedValue(val) {
|
|
4294
|
-
if (!Object(util_["isEqual"])(val, this.value)) {
|
|
4295
|
-
this.checkStrictly && this.calculateCheckedNodePaths();
|
|
4296
|
-
this.$emit('input', val);
|
|
4297
|
-
this.$emit('change', val);
|
|
4298
|
-
}
|
|
4299
|
-
}
|
|
4300
|
-
},
|
|
4301
|
-
|
|
4302
|
-
mounted: function mounted() {
|
|
4303
|
-
if (!this.isEmptyValue(this.value)) {
|
|
4304
|
-
this.syncCheckedValue();
|
|
4305
|
-
}
|
|
4306
|
-
},
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
methods: {
|
|
4310
|
-
initStore: function initStore() {
|
|
4311
|
-
var config = this.config,
|
|
4312
|
-
options = this.options;
|
|
4313
|
-
|
|
4314
|
-
if (config.lazy && Object(util_["isEmpty"])(options)) {
|
|
4315
|
-
this.lazyLoad();
|
|
4316
|
-
} else {
|
|
4317
|
-
this.store = new src_store(options, config);
|
|
4318
|
-
this.menus = [this.store.getNodes()];
|
|
4319
|
-
this.syncMenuState();
|
|
4320
|
-
}
|
|
4321
|
-
},
|
|
4322
|
-
syncCheckedValue: function syncCheckedValue() {
|
|
4323
|
-
var value = this.value,
|
|
4324
|
-
checkedValue = this.checkedValue;
|
|
4325
|
-
|
|
4326
|
-
if (!Object(util_["isEqual"])(value, checkedValue)) {
|
|
4327
|
-
this.activePath = [];
|
|
4328
|
-
this.checkedValue = value;
|
|
4329
|
-
this.syncMenuState();
|
|
4330
|
-
}
|
|
4331
|
-
},
|
|
4332
|
-
syncMenuState: function syncMenuState() {
|
|
4333
|
-
var multiple = this.multiple,
|
|
4334
|
-
checkStrictly = this.checkStrictly;
|
|
4335
|
-
|
|
4336
|
-
this.syncActivePath();
|
|
4337
|
-
multiple && this.syncMultiCheckState();
|
|
4338
|
-
checkStrictly && this.calculateCheckedNodePaths();
|
|
4339
|
-
this.$nextTick(this.scrollIntoView);
|
|
4340
|
-
},
|
|
4341
|
-
syncMultiCheckState: function syncMultiCheckState() {
|
|
4342
|
-
var _this = this;
|
|
4343
|
-
|
|
4344
|
-
var nodes = this.getFlattedNodes(this.leafOnly);
|
|
4345
|
-
|
|
4346
|
-
nodes.forEach(function (node) {
|
|
4347
|
-
node.syncCheckState(_this.checkedValue);
|
|
4348
|
-
});
|
|
4349
|
-
},
|
|
4350
|
-
isEmptyValue: function isEmptyValue(val) {
|
|
4351
|
-
var multiple = this.multiple,
|
|
4352
|
-
config = this.config;
|
|
4353
|
-
var emitPath = config.emitPath;
|
|
4354
|
-
|
|
4355
|
-
if (multiple || emitPath) {
|
|
4356
|
-
return Object(util_["isEmpty"])(val);
|
|
4357
|
-
}
|
|
4358
|
-
return false;
|
|
4359
|
-
},
|
|
4360
|
-
syncActivePath: function syncActivePath() {
|
|
4361
|
-
var _this2 = this;
|
|
4362
|
-
|
|
4363
|
-
var store = this.store,
|
|
4364
|
-
multiple = this.multiple,
|
|
4365
|
-
activePath = this.activePath,
|
|
4366
|
-
checkedValue = this.checkedValue;
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
if (!Object(util_["isEmpty"])(activePath)) {
|
|
4370
|
-
var nodes = activePath.map(function (node) {
|
|
4371
|
-
return _this2.getNodeByValue(node.getValue());
|
|
4372
|
-
});
|
|
4373
|
-
this.expandNodes(nodes);
|
|
4374
|
-
} else if (!this.isEmptyValue(checkedValue)) {
|
|
4375
|
-
var value = multiple ? checkedValue[0] : checkedValue;
|
|
4376
|
-
var checkedNode = this.getNodeByValue(value) || {};
|
|
4377
|
-
var _nodes = (checkedNode.pathNodes || []).slice(0, -1);
|
|
4378
|
-
this.expandNodes(_nodes);
|
|
4379
|
-
} else {
|
|
4380
|
-
this.activePath = [];
|
|
4381
|
-
this.menus = [store.getNodes()];
|
|
4382
|
-
}
|
|
4383
|
-
},
|
|
4384
|
-
expandNodes: function expandNodes(nodes) {
|
|
4385
|
-
var _this3 = this;
|
|
4386
|
-
|
|
4387
|
-
nodes.forEach(function (node) {
|
|
4388
|
-
return _this3.handleExpand(node, true /* silent */);
|
|
4389
|
-
});
|
|
4390
|
-
},
|
|
4391
|
-
calculateCheckedNodePaths: function calculateCheckedNodePaths() {
|
|
4392
|
-
var _this4 = this;
|
|
4393
|
-
|
|
4394
|
-
var checkedValue = this.checkedValue,
|
|
4395
|
-
multiple = this.multiple;
|
|
4396
|
-
|
|
4397
|
-
var checkedValues = multiple ? Object(util_["coerceTruthyValueToArray"])(checkedValue) : [checkedValue];
|
|
4398
|
-
this.checkedNodePaths = checkedValues.map(function (v) {
|
|
4399
|
-
var checkedNode = _this4.getNodeByValue(v);
|
|
4400
|
-
return checkedNode ? checkedNode.pathNodes : [];
|
|
4401
|
-
});
|
|
4402
|
-
},
|
|
4403
|
-
handleKeyDown: function handleKeyDown(e) {
|
|
4404
|
-
var target = e.target,
|
|
4405
|
-
keyCode = e.keyCode;
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
switch (keyCode) {
|
|
4409
|
-
case KeyCode.up:
|
|
4410
|
-
var prev = getSibling(target, -1);
|
|
4411
|
-
focusNode(prev);
|
|
4412
|
-
break;
|
|
4413
|
-
case KeyCode.down:
|
|
4414
|
-
var next = getSibling(target, 1);
|
|
4415
|
-
focusNode(next);
|
|
4416
|
-
break;
|
|
4417
|
-
case KeyCode.left:
|
|
4418
|
-
var preMenu = this.$refs.menu[getMenuIndex(target) - 1];
|
|
4419
|
-
if (preMenu) {
|
|
4420
|
-
var expandedNode = preMenu.$el.querySelector('.el-cascader-node[aria-expanded="true"]');
|
|
4421
|
-
focusNode(expandedNode);
|
|
4422
|
-
}
|
|
4423
|
-
break;
|
|
4424
|
-
case KeyCode.right:
|
|
4425
|
-
var nextMenu = this.$refs.menu[getMenuIndex(target) + 1];
|
|
4426
|
-
if (nextMenu) {
|
|
4427
|
-
var firstNode = nextMenu.$el.querySelector('.el-cascader-node[tabindex="-1"]');
|
|
4428
|
-
focusNode(firstNode);
|
|
4429
|
-
}
|
|
4430
|
-
break;
|
|
4431
|
-
case KeyCode.enter:
|
|
4432
|
-
checkNode(target);
|
|
4433
|
-
break;
|
|
4434
|
-
case KeyCode.esc:
|
|
4435
|
-
case KeyCode.tab:
|
|
4436
|
-
this.$emit('close');
|
|
4437
|
-
break;
|
|
4438
|
-
default:
|
|
4439
|
-
return;
|
|
4440
|
-
}
|
|
4441
|
-
},
|
|
4442
|
-
handleExpand: function handleExpand(node, silent) {
|
|
4443
|
-
var activePath = this.activePath;
|
|
4444
|
-
var level = node.level;
|
|
4445
|
-
|
|
4446
|
-
var path = activePath.slice(0, level - 1);
|
|
4447
|
-
var menus = this.menus.slice(0, level);
|
|
4448
|
-
|
|
4449
|
-
if (!node.isLeaf) {
|
|
4450
|
-
path.push(node);
|
|
4451
|
-
menus.push(node.children);
|
|
4452
|
-
}
|
|
4453
|
-
|
|
4454
|
-
this.activePath = path;
|
|
4455
|
-
this.menus = menus;
|
|
4456
|
-
|
|
4457
|
-
if (!silent) {
|
|
4458
|
-
var pathValues = path.map(function (node) {
|
|
4459
|
-
return node.getValue();
|
|
4460
|
-
});
|
|
4461
|
-
var activePathValues = activePath.map(function (node) {
|
|
4462
|
-
return node.getValue();
|
|
4463
|
-
});
|
|
4464
|
-
if (!Object(util_["valueEquals"])(pathValues, activePathValues)) {
|
|
4465
|
-
this.$emit('active-item-change', pathValues); // Deprecated
|
|
4466
|
-
this.$emit('expand-change', pathValues);
|
|
4467
|
-
}
|
|
4468
|
-
}
|
|
4469
|
-
},
|
|
4470
|
-
handleCheckChange: function handleCheckChange(value) {
|
|
4471
|
-
this.checkedValue = value;
|
|
4472
|
-
},
|
|
4473
|
-
lazyLoad: function lazyLoad(node, onFullfiled) {
|
|
4474
|
-
var _this5 = this;
|
|
4475
|
-
|
|
4476
|
-
var config = this.config;
|
|
4477
|
-
|
|
4478
|
-
if (!node) {
|
|
4479
|
-
node = node || { root: true, level: 0 };
|
|
4480
|
-
this.store = new src_store([], config);
|
|
4481
|
-
this.menus = [this.store.getNodes()];
|
|
4482
|
-
}
|
|
4483
|
-
node.loading = true;
|
|
4484
|
-
var resolve = function resolve(dataList) {
|
|
4485
|
-
var parent = node.root ? null : node;
|
|
4486
|
-
dataList && dataList.length && _this5.store.appendNodes(dataList, parent);
|
|
4487
|
-
node.loading = false;
|
|
4488
|
-
node.loaded = true;
|
|
4489
|
-
|
|
4490
|
-
// dispose default value on lazy load mode
|
|
4491
|
-
if (Array.isArray(_this5.checkedValue)) {
|
|
4492
|
-
var nodeValue = _this5.checkedValue[_this5.loadCount++];
|
|
4493
|
-
var valueKey = _this5.config.value;
|
|
4494
|
-
var leafKey = _this5.config.leaf;
|
|
4495
|
-
|
|
4496
|
-
if (Array.isArray(dataList) && dataList.filter(function (item) {
|
|
4497
|
-
return item[valueKey] === nodeValue;
|
|
4498
|
-
}).length > 0) {
|
|
4499
|
-
var checkedNode = _this5.store.getNodeByValue(nodeValue);
|
|
4500
|
-
|
|
4501
|
-
if (!checkedNode.data[leafKey]) {
|
|
4502
|
-
_this5.lazyLoad(checkedNode, function () {
|
|
4503
|
-
_this5.handleExpand(checkedNode);
|
|
4504
|
-
});
|
|
4505
|
-
}
|
|
4506
|
-
|
|
4507
|
-
if (_this5.loadCount === _this5.checkedValue.length) {
|
|
4508
|
-
_this5.$parent.computePresentText();
|
|
4509
|
-
}
|
|
4510
|
-
}
|
|
4511
|
-
}
|
|
4512
|
-
|
|
4513
|
-
onFullfiled && onFullfiled(dataList);
|
|
4514
|
-
};
|
|
4515
|
-
config.lazyLoad(node, resolve);
|
|
4516
|
-
},
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
/**
|
|
4520
|
-
* public methods
|
|
4521
|
-
*/
|
|
4522
|
-
calculateMultiCheckedValue: function calculateMultiCheckedValue() {
|
|
4523
|
-
this.checkedValue = this.getCheckedNodes(this.leafOnly).map(function (node) {
|
|
4524
|
-
return node.getValueByOption();
|
|
4525
|
-
});
|
|
4526
|
-
},
|
|
4527
|
-
scrollIntoView: function scrollIntoView() {
|
|
4528
|
-
if (this.$isServer) return;
|
|
4529
|
-
|
|
4530
|
-
var menus = this.$refs.menu || [];
|
|
4531
|
-
menus.forEach(function (menu) {
|
|
4532
|
-
var menuElement = menu.$el;
|
|
4533
|
-
if (menuElement) {
|
|
4534
|
-
var container = menuElement.querySelector('.el-scrollbar__wrap');
|
|
4535
|
-
var activeNode = menuElement.querySelector('.el-cascader-node.is-active') || menuElement.querySelector('.el-cascader-node.in-active-path');
|
|
4536
|
-
scroll_into_view_default()(container, activeNode);
|
|
4537
|
-
}
|
|
4538
|
-
});
|
|
4539
|
-
},
|
|
4540
|
-
getNodeByValue: function getNodeByValue(val) {
|
|
4541
|
-
return this.store.getNodeByValue(val);
|
|
4542
|
-
},
|
|
4543
|
-
getFlattedNodes: function getFlattedNodes(leafOnly) {
|
|
4544
|
-
var cached = !this.config.lazy;
|
|
4545
|
-
return this.store.getFlattedNodes(leafOnly, cached);
|
|
4546
|
-
},
|
|
4547
|
-
getCheckedNodes: function getCheckedNodes(leafOnly) {
|
|
4548
|
-
var checkedValue = this.checkedValue,
|
|
4549
|
-
multiple = this.multiple;
|
|
4550
|
-
|
|
4551
|
-
if (multiple) {
|
|
4552
|
-
var nodes = this.getFlattedNodes(leafOnly);
|
|
4553
|
-
return nodes.filter(function (node) {
|
|
4554
|
-
return node.checked;
|
|
4555
|
-
});
|
|
4556
|
-
} else {
|
|
4557
|
-
return this.isEmptyValue(checkedValue) ? [] : [this.getNodeByValue(checkedValue)];
|
|
4558
|
-
}
|
|
4559
|
-
},
|
|
4560
|
-
clearCheckedNodes: function clearCheckedNodes() {
|
|
4561
|
-
var config = this.config,
|
|
4562
|
-
leafOnly = this.leafOnly;
|
|
4563
|
-
var multiple = config.multiple,
|
|
4564
|
-
emitPath = config.emitPath;
|
|
4565
|
-
|
|
4566
|
-
if (multiple) {
|
|
4567
|
-
this.getCheckedNodes(leafOnly).filter(function (node) {
|
|
4568
|
-
return !node.isDisabled;
|
|
4569
|
-
}).forEach(function (node) {
|
|
4570
|
-
return node.doCheck(false);
|
|
4571
|
-
});
|
|
4572
|
-
this.calculateMultiCheckedValue();
|
|
4573
|
-
} else {
|
|
4574
|
-
this.checkedValue = emitPath ? [] : null;
|
|
4575
|
-
}
|
|
4576
|
-
}
|
|
4577
|
-
}
|
|
4578
|
-
});
|
|
4579
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js
|
|
4580
|
-
/* harmony default export */ var src_cascader_panelvue_type_script_lang_js = (cascader_panelvue_type_script_lang_js);
|
|
4581
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
/* normalize component */
|
|
4588
|
-
|
|
4589
|
-
var cascader_panel_component = Object(componentNormalizer["a" /* default */])(
|
|
4590
|
-
src_cascader_panelvue_type_script_lang_js,
|
|
4591
|
-
cascader_panelvue_type_template_id_09ca3ff1_render,
|
|
4592
|
-
staticRenderFns,
|
|
4593
|
-
false,
|
|
4594
|
-
null,
|
|
4595
|
-
null,
|
|
4596
|
-
null
|
|
4597
|
-
|
|
4598
|
-
)
|
|
4599
|
-
|
|
4600
|
-
/* harmony default export */ var cascader_panel = (cascader_panel_component.exports);
|
|
4601
|
-
// CONCATENATED MODULE: ./packages/cascader-panel/index.js
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
/* istanbul ignore next */
|
|
4605
|
-
cascader_panel.install = function (Vue) {
|
|
4606
|
-
Vue.component(cascader_panel.name, cascader_panel);
|
|
4607
|
-
};
|
|
4608
|
-
|
|
4609
|
-
/* harmony default export */ var packages_cascader_panel = __webpack_exports__["default"] = (cascader_panel);
|
|
4610
|
-
|
|
4611
|
-
/***/ }),
|
|
4612
|
-
|
|
4613
|
-
/***/ 5:
|
|
4614
|
-
/***/ (function(module, exports) {
|
|
4615
|
-
|
|
4616
|
-
module.exports = require("element-ui/lib/utils/vue-popper");
|
|
4617
|
-
|
|
4618
|
-
/***/ }),
|
|
4619
|
-
|
|
4620
|
-
/***/ 6:
|
|
4621
|
-
/***/ (function(module, exports) {
|
|
4622
|
-
|
|
4623
|
-
module.exports = require("element-ui/lib/utils/merge");
|
|
4624
|
-
|
|
4625
|
-
/***/ }),
|
|
4626
|
-
|
|
4627
|
-
/***/ 7:
|
|
4628
|
-
/***/ (function(module, exports) {
|
|
4629
|
-
|
|
4630
|
-
module.exports = require("element-ui/lib/mixins/migrating");
|
|
4631
|
-
|
|
4632
|
-
/***/ }),
|
|
4633
|
-
|
|
4634
|
-
/***/ 9:
|
|
4635
|
-
/***/ (function(module, exports) {
|
|
4636
|
-
|
|
4637
|
-
module.exports = require("element-ui/lib/mixins/locale");
|
|
4638
|
-
|
|
4639
|
-
/***/ })
|
|
4640
|
-
|
|
4641
|
-
/******/ });
|