cy-element-ui 1.1.18 → 1.1.20

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.
Files changed (255) hide show
  1. package/lib/index.js +1 -1
  2. package/lib/theme-chalk/BreadcrumbItem.css +0 -0
  3. package/lib/theme-chalk/ButtonGroup.css +0 -0
  4. package/lib/theme-chalk/CarouselItem.css +0 -0
  5. package/lib/theme-chalk/CascaderPanel.css +0 -0
  6. package/lib/theme-chalk/CheckboxButton.css +0 -0
  7. package/lib/theme-chalk/CheckboxGroup.css +0 -0
  8. package/lib/theme-chalk/CollapseItem.css +0 -0
  9. package/lib/theme-chalk/ColorPicker.css +0 -0
  10. package/lib/theme-chalk/DatePicker.css +0 -0
  11. package/lib/theme-chalk/DescriptionsItem.css +0 -0
  12. package/lib/theme-chalk/DropdownItem.css +0 -0
  13. package/lib/theme-chalk/DropdownMenu.css +0 -0
  14. package/lib/theme-chalk/FormItem.css +0 -0
  15. package/lib/theme-chalk/InputNumber.css +0 -0
  16. package/lib/theme-chalk/MenuItem.css +0 -0
  17. package/lib/theme-chalk/MenuItemGroup.css +0 -0
  18. package/lib/theme-chalk/MessageBox.css +0 -0
  19. package/lib/theme-chalk/OptionGroup.css +0 -0
  20. package/lib/theme-chalk/PageHeader.css +0 -0
  21. package/lib/theme-chalk/RadioButton.css +0 -0
  22. package/lib/theme-chalk/RadioGroup.css +0 -0
  23. package/lib/theme-chalk/SkeletonItem.css +0 -0
  24. package/lib/theme-chalk/TabPane.css +0 -0
  25. package/lib/theme-chalk/TableColumn.css +0 -0
  26. package/lib/theme-chalk/TimePicker.css +0 -0
  27. package/lib/theme-chalk/TimeSelect.css +0 -0
  28. package/lib/theme-chalk/TimelineItem.css +0 -0
  29. package/lib/theme-chalk/alert.css +1 -0
  30. package/lib/theme-chalk/aside.css +1 -0
  31. package/lib/theme-chalk/autocomplete.css +1 -0
  32. package/lib/theme-chalk/avatar.css +1 -0
  33. package/lib/theme-chalk/backtop.css +1 -0
  34. package/lib/theme-chalk/badge.css +1 -0
  35. package/lib/theme-chalk/base.css +1 -0
  36. package/lib/theme-chalk/breadcrumb-item.css +0 -0
  37. package/lib/theme-chalk/breadcrumb.css +1 -0
  38. package/lib/theme-chalk/button-group.css +0 -0
  39. package/lib/theme-chalk/button.css +1 -0
  40. package/lib/theme-chalk/calendar.css +1 -0
  41. package/lib/theme-chalk/card.css +1 -0
  42. package/lib/theme-chalk/carousel-item.css +1 -0
  43. package/lib/theme-chalk/carousel.css +1 -0
  44. package/lib/theme-chalk/cascader-panel.css +1 -0
  45. package/lib/theme-chalk/cascader.css +1 -0
  46. package/lib/theme-chalk/checkbox-button.css +0 -0
  47. package/lib/theme-chalk/checkbox-group.css +0 -0
  48. package/lib/theme-chalk/checkbox.css +1 -0
  49. package/lib/theme-chalk/col.css +1 -0
  50. package/lib/theme-chalk/collapse-item.css +0 -0
  51. package/lib/theme-chalk/collapse.css +1 -0
  52. package/lib/theme-chalk/color-picker.css +1 -0
  53. package/lib/theme-chalk/container.css +1 -0
  54. package/lib/theme-chalk/date-picker.css +1 -0
  55. package/lib/theme-chalk/descriptions-item.css +1 -0
  56. package/lib/theme-chalk/descriptions.css +1 -0
  57. package/lib/theme-chalk/dialog.css +1 -0
  58. package/lib/theme-chalk/display.css +1 -0
  59. package/lib/theme-chalk/divider.css +1 -0
  60. package/lib/theme-chalk/drawer.css +1 -0
  61. package/lib/theme-chalk/dropdown-item.css +0 -0
  62. package/lib/theme-chalk/dropdown-menu.css +0 -0
  63. package/lib/theme-chalk/dropdown.css +1 -0
  64. package/lib/theme-chalk/element.css +1 -0
  65. package/lib/theme-chalk/empty.css +1 -0
  66. package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
  67. package/lib/theme-chalk/fonts/element-icons.woff +0 -0
  68. package/lib/theme-chalk/footer.css +1 -0
  69. package/lib/theme-chalk/form-item.css +0 -0
  70. package/lib/theme-chalk/form.css +1 -0
  71. package/lib/theme-chalk/header.css +1 -0
  72. package/lib/theme-chalk/icon.css +1 -0
  73. package/lib/theme-chalk/image.css +1 -0
  74. package/lib/theme-chalk/index.css +1 -0
  75. package/lib/theme-chalk/infinite-scroll.css +0 -0
  76. package/lib/theme-chalk/infiniteScroll.css +0 -0
  77. package/lib/theme-chalk/input-number.css +1 -0
  78. package/lib/theme-chalk/input.css +1 -0
  79. package/lib/theme-chalk/link.css +1 -0
  80. package/lib/theme-chalk/loading.css +1 -0
  81. package/lib/theme-chalk/main.css +1 -0
  82. package/lib/theme-chalk/menu-item-group.css +0 -0
  83. package/lib/theme-chalk/menu-item.css +0 -0
  84. package/lib/theme-chalk/menu.css +1 -0
  85. package/lib/theme-chalk/message-box.css +1 -0
  86. package/lib/theme-chalk/message.css +1 -0
  87. package/lib/theme-chalk/notification.css +1 -0
  88. package/lib/theme-chalk/option-group.css +1 -0
  89. package/lib/theme-chalk/option.css +1 -0
  90. package/lib/theme-chalk/page-header.css +1 -0
  91. package/lib/theme-chalk/pagination.css +1 -0
  92. package/lib/theme-chalk/popconfirm.css +1 -0
  93. package/lib/theme-chalk/popover.css +1 -0
  94. package/lib/theme-chalk/popper.css +1 -0
  95. package/lib/theme-chalk/progress.css +1 -0
  96. package/lib/theme-chalk/radio-button.css +1 -0
  97. package/lib/theme-chalk/radio-group.css +1 -0
  98. package/lib/theme-chalk/radio.css +1 -0
  99. package/lib/theme-chalk/rate.css +1 -0
  100. package/lib/theme-chalk/reset.css +1 -0
  101. package/lib/theme-chalk/result.css +1 -0
  102. package/lib/theme-chalk/row.css +1 -0
  103. package/lib/theme-chalk/scrollbar.css +1 -0
  104. package/lib/theme-chalk/select-dropdown.css +1 -0
  105. package/lib/theme-chalk/select.css +1 -0
  106. package/lib/theme-chalk/selectDisplayInput.css +1 -0
  107. package/lib/theme-chalk/skeleton-item.css +1 -0
  108. package/lib/theme-chalk/skeleton.css +1 -0
  109. package/lib/theme-chalk/slider.css +1 -0
  110. package/lib/theme-chalk/spinner.css +1 -0
  111. package/lib/theme-chalk/statistic.css +1 -0
  112. package/lib/theme-chalk/step.css +1 -0
  113. package/lib/theme-chalk/steps.css +1 -0
  114. package/lib/theme-chalk/subTitle.css +1 -0
  115. package/lib/theme-chalk/submenu.css +0 -0
  116. package/lib/theme-chalk/switch.css +1 -0
  117. package/lib/theme-chalk/tab-pane.css +0 -0
  118. package/lib/theme-chalk/tabDialog.css +1 -0
  119. package/lib/theme-chalk/table-column.css +1 -0
  120. package/lib/theme-chalk/table.css +1 -0
  121. package/lib/theme-chalk/tabs.css +1 -0
  122. package/lib/theme-chalk/tag.css +1 -0
  123. package/lib/theme-chalk/time-picker.css +1 -0
  124. package/lib/theme-chalk/time-select.css +1 -0
  125. package/lib/theme-chalk/timeline-item.css +1 -0
  126. package/lib/theme-chalk/timeline.css +1 -0
  127. package/lib/theme-chalk/tooltip.css +1 -0
  128. package/lib/theme-chalk/transfer.css +1 -0
  129. package/lib/theme-chalk/tree.css +1 -0
  130. package/lib/theme-chalk/treeSelect.css +1 -0
  131. package/lib/theme-chalk/upload.css +1 -0
  132. package/package.json +1 -1
  133. package/packages/theme-chalk/gulpfile.js +0 -1
  134. package/packages/theme-chalk/src/BreadcrumbItem.scss +0 -0
  135. package/packages/theme-chalk/src/ButtonGroup.scss +0 -0
  136. package/packages/theme-chalk/src/CarouselItem.scss +0 -0
  137. package/packages/theme-chalk/src/CascaderPanel.scss +0 -0
  138. package/packages/theme-chalk/src/CheckboxButton.scss +0 -0
  139. package/packages/theme-chalk/src/CheckboxGroup.scss +0 -0
  140. package/packages/theme-chalk/src/CollapseItem.scss +0 -0
  141. package/packages/theme-chalk/src/ColorPicker.scss +0 -0
  142. package/packages/theme-chalk/src/DatePicker.scss +0 -0
  143. package/packages/theme-chalk/src/DescriptionsItem.scss +0 -0
  144. package/packages/theme-chalk/src/DropdownItem.scss +0 -0
  145. package/packages/theme-chalk/src/DropdownMenu.scss +0 -0
  146. package/packages/theme-chalk/src/FormItem.scss +0 -0
  147. package/packages/theme-chalk/src/InputNumber.scss +0 -0
  148. package/packages/theme-chalk/src/MenuItem.scss +0 -0
  149. package/packages/theme-chalk/src/MenuItemGroup.scss +0 -0
  150. package/packages/theme-chalk/src/MessageBox.scss +0 -0
  151. package/packages/theme-chalk/src/OptionGroup.scss +0 -0
  152. package/packages/theme-chalk/src/PageHeader.scss +0 -0
  153. package/packages/theme-chalk/src/RadioButton.scss +0 -0
  154. package/packages/theme-chalk/src/RadioGroup.scss +0 -0
  155. package/packages/theme-chalk/src/SkeletonItem.scss +0 -0
  156. package/packages/theme-chalk/src/TabPane.scss +0 -0
  157. package/packages/theme-chalk/src/TableColumn.scss +0 -0
  158. package/packages/theme-chalk/src/TimePicker.scss +0 -0
  159. package/packages/theme-chalk/src/TimeSelect.scss +0 -0
  160. package/packages/theme-chalk/src/TimelineItem.scss +0 -0
  161. package/packages/theme-chalk/src/index.scss +89 -89
  162. package/src/index.js +1 -1
  163. package/lib/Alert.js +0 -420
  164. package/lib/Aside.js +0 -277
  165. package/lib/Autocomplete.js +0 -2051
  166. package/lib/Avatar.js +0 -363
  167. package/lib/Backtop.js +0 -404
  168. package/lib/Badge.js +0 -334
  169. package/lib/Breadcrumb.js +0 -293
  170. package/lib/BreadcrumbItem.js +0 -322
  171. package/lib/Button.js +0 -357
  172. package/lib/ButtonGroup.js +0 -262
  173. package/lib/Calendar.js +0 -1146
  174. package/lib/Card.js +0 -297
  175. package/lib/Carousel.js +0 -707
  176. package/lib/CarouselItem.js +0 -434
  177. package/lib/Cascader.js +0 -4641
  178. package/lib/CascaderPanel.js +0 -2602
  179. package/lib/Checkbox.js +0 -627
  180. package/lib/CheckboxButton.js +0 -583
  181. package/lib/CheckboxGroup.js +0 -313
  182. package/lib/Col.js +0 -177
  183. package/lib/Collapse.js +0 -329
  184. package/lib/CollapseItem.js +0 -497
  185. package/lib/ColorPicker.js +0 -2885
  186. package/lib/Container.js +0 -288
  187. package/lib/CySelectDisplayInput.js +0 -367
  188. package/lib/CySubTitle.js +0 -295
  189. package/lib/CyTabDialog.js +0 -1184
  190. package/lib/CyTreeSelect.js +0 -4422
  191. package/lib/DatePicker.js +0 -7574
  192. package/lib/Descriptions.js +0 -457
  193. package/lib/DescriptionsItem.js +0 -140
  194. package/lib/Dialog.js +0 -598
  195. package/lib/Divider.js +0 -313
  196. package/lib/Drawer.js +0 -592
  197. package/lib/Dropdown.js +0 -856
  198. package/lib/DropdownItem.js +0 -316
  199. package/lib/DropdownMenu.js +0 -351
  200. package/lib/Empty.js +0 -730
  201. package/lib/Footer.js +0 -277
  202. package/lib/Form.js +0 -466
  203. package/lib/FormItem.js +0 -826
  204. package/lib/Header.js +0 -277
  205. package/lib/Icon.js +0 -265
  206. package/lib/Image.js +0 -1138
  207. package/lib/InfiniteScroll.js +0 -301
  208. package/lib/Input.js +0 -999
  209. package/lib/InputNumber.js +0 -1552
  210. package/lib/Link.js +0 -332
  211. package/lib/Loading.js +0 -631
  212. package/lib/Main.js +0 -264
  213. package/lib/Menu.js +0 -865
  214. package/lib/MenuItem.js +0 -818
  215. package/lib/MenuItemGroup.js +0 -308
  216. package/lib/Message.js +0 -548
  217. package/lib/MessageBox.js +0 -2134
  218. package/lib/Notification.js +0 -615
  219. package/lib/Option.js +0 -474
  220. package/lib/OptionGroup.js +0 -344
  221. package/lib/PageHeader.js +0 -319
  222. package/lib/Pagination.js +0 -4123
  223. package/lib/Popconfirm.js +0 -1025
  224. package/lib/Popover.js +0 -617
  225. package/lib/Progress.js +0 -595
  226. package/lib/Radio.js +0 -497
  227. package/lib/RadioButton.js +0 -463
  228. package/lib/RadioGroup.js +0 -391
  229. package/lib/Rate.js +0 -670
  230. package/lib/Result.js +0 -578
  231. package/lib/Row.js +0 -149
  232. package/lib/Scrollbar.js +0 -423
  233. package/lib/Select.js +0 -3368
  234. package/lib/Skeleton.js +0 -372
  235. package/lib/SkeletonItem.js +0 -342
  236. package/lib/Slider.js +0 -2854
  237. package/lib/Spinner.js +0 -301
  238. package/lib/Statistic.js +0 -533
  239. package/lib/Step.js +0 -522
  240. package/lib/Steps.js +0 -342
  241. package/lib/Submenu.js +0 -700
  242. package/lib/Switch.js +0 -554
  243. package/lib/TabPane.js +0 -332
  244. package/lib/Table.js +0 -6125
  245. package/lib/TableColumn.js +0 -1481
  246. package/lib/Tabs.js +0 -920
  247. package/lib/Tag.js +0 -304
  248. package/lib/TimePicker.js +0 -4059
  249. package/lib/TimeSelect.js +0 -2871
  250. package/lib/Timeline.js +0 -275
  251. package/lib/TimelineItem.js +0 -371
  252. package/lib/Tooltip.js +0 -425
  253. package/lib/Transfer.js +0 -2557
  254. package/lib/Tree.js +0 -2680
  255. package/lib/Upload.js +0 -1782
@@ -1,2602 +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 = 47);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ([
89
- /* 0 */
90
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
91
-
92
- "use strict";
93
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
94
- /* globals __VUE_SSR_CONTEXT__ */
95
-
96
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
97
- // This module is a runtime utility for cleaner component module output and will
98
- // be included in the final webpack user bundle.
99
-
100
- function normalizeComponent(
101
- scriptExports,
102
- render,
103
- staticRenderFns,
104
- functionalTemplate,
105
- injectStyles,
106
- scopeId,
107
- moduleIdentifier /* server only */,
108
- shadowMode /* vue-cli only */
109
- ) {
110
- // Vue.extend constructor export interop
111
- var options =
112
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
113
-
114
- // render functions
115
- if (render) {
116
- options.render = render
117
- options.staticRenderFns = staticRenderFns
118
- options._compiled = true
119
- }
120
-
121
- // functional template
122
- if (functionalTemplate) {
123
- options.functional = true
124
- }
125
-
126
- // scopedId
127
- if (scopeId) {
128
- options._scopeId = 'data-v-' + scopeId
129
- }
130
-
131
- var hook
132
- if (moduleIdentifier) {
133
- // server build
134
- hook = function (context) {
135
- // 2.3 injection
136
- context =
137
- context || // cached call
138
- (this.$vnode && this.$vnode.ssrContext) || // stateful
139
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
140
- // 2.2 with runInNewContext: true
141
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
142
- context = __VUE_SSR_CONTEXT__
143
- }
144
- // inject component styles
145
- if (injectStyles) {
146
- injectStyles.call(this, context)
147
- }
148
- // register component module identifier for async chunk inferrence
149
- if (context && context._registeredComponents) {
150
- context._registeredComponents.add(moduleIdentifier)
151
- }
152
- }
153
- // used by ssr in case component is cached and beforeCreate
154
- // never gets called
155
- options._ssrRegister = hook
156
- } else if (injectStyles) {
157
- hook = shadowMode
158
- ? function () {
159
- injectStyles.call(
160
- this,
161
- (options.functional ? this.parent : this).$root.$options.shadowRoot
162
- )
163
- }
164
- : injectStyles
165
- }
166
-
167
- if (hook) {
168
- if (options.functional) {
169
- // for template-only hot-reload because in that case the render fn doesn't
170
- // go through the normalizer
171
- options._injectStyles = hook
172
- // register for functional component in vue file
173
- var originalRender = options.render
174
- options.render = function renderWithStyleInjection(h, context) {
175
- hook.call(context)
176
- return originalRender(h, context)
177
- }
178
- } else {
179
- // inject component registration as beforeCreate hook
180
- var existing = options.beforeCreate
181
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
182
- }
183
- }
184
-
185
- return {
186
- exports: scriptExports,
187
- options: options
188
- }
189
- }
190
-
191
-
192
- /***/ }),
193
- /* 1 */
194
- /***/ (function(module, exports) {
195
-
196
- module.exports = require("element-ui/lib/utils/dom");
197
-
198
- /***/ }),
199
- /* 2 */,
200
- /* 3 */
201
- /***/ (function(module, exports) {
202
-
203
- module.exports = require("element-ui/lib/utils/util");
204
-
205
- /***/ }),
206
- /* 4 */
207
- /***/ (function(module, exports) {
208
-
209
- module.exports = require("element-ui/lib/mixins/emitter");
210
-
211
- /***/ }),
212
- /* 5 */,
213
- /* 6 */
214
- /***/ (function(module, exports) {
215
-
216
- module.exports = require("element-ui/lib/utils/merge");
217
-
218
- /***/ }),
219
- /* 7 */,
220
- /* 8 */,
221
- /* 9 */
222
- /***/ (function(module, exports) {
223
-
224
- module.exports = require("element-ui/lib/mixins/locale");
225
-
226
- /***/ }),
227
- /* 10 */
228
- /***/ (function(module, exports) {
229
-
230
- module.exports = require("element-ui/lib/utils/resize-event");
231
-
232
- /***/ }),
233
- /* 11 */
234
- /***/ (function(module, exports) {
235
-
236
- module.exports = require("element-ui/lib/utils/shared");
237
-
238
- /***/ }),
239
- /* 12 */,
240
- /* 13 */,
241
- /* 14 */,
242
- /* 15 */,
243
- /* 16 */
244
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
245
-
246
- "use strict";
247
- // ESM COMPAT FLAG
248
- __webpack_require__.r(__webpack_exports__);
249
-
250
- // 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
251
- var render = function () {
252
- var _vm = this
253
- var _h = _vm.$createElement
254
- var _c = _vm._self._c || _h
255
- return _c(
256
- "label",
257
- {
258
- staticClass: "el-checkbox",
259
- class: [
260
- _vm.border && _vm.checkboxSize
261
- ? "el-checkbox--" + _vm.checkboxSize
262
- : "",
263
- { "is-disabled": _vm.isDisabled },
264
- { "is-bordered": _vm.border },
265
- { "is-checked": _vm.isChecked },
266
- ],
267
- attrs: { id: _vm.id },
268
- },
269
- [
270
- _c(
271
- "span",
272
- {
273
- staticClass: "el-checkbox__input",
274
- class: {
275
- "is-disabled": _vm.isDisabled,
276
- "is-checked": _vm.isChecked,
277
- "is-indeterminate": _vm.indeterminate,
278
- "is-focus": _vm.focus,
279
- },
280
- attrs: {
281
- tabindex: _vm.indeterminate ? 0 : false,
282
- role: _vm.indeterminate ? "checkbox" : false,
283
- "aria-checked": _vm.indeterminate ? "mixed" : false,
284
- },
285
- },
286
- [
287
- _c("span", { staticClass: "el-checkbox__inner" }),
288
- _vm.trueLabel || _vm.falseLabel
289
- ? _c("input", {
290
- directives: [
291
- {
292
- name: "model",
293
- rawName: "v-model",
294
- value: _vm.model,
295
- expression: "model",
296
- },
297
- ],
298
- staticClass: "el-checkbox__original",
299
- attrs: {
300
- type: "checkbox",
301
- "aria-hidden": _vm.indeterminate ? "true" : "false",
302
- name: _vm.name,
303
- disabled: _vm.isDisabled,
304
- "true-value": _vm.trueLabel,
305
- "false-value": _vm.falseLabel,
306
- },
307
- domProps: {
308
- checked: Array.isArray(_vm.model)
309
- ? _vm._i(_vm.model, null) > -1
310
- : _vm._q(_vm.model, _vm.trueLabel),
311
- },
312
- on: {
313
- change: [
314
- function ($event) {
315
- var $$a = _vm.model,
316
- $$el = $event.target,
317
- $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
318
- if (Array.isArray($$a)) {
319
- var $$v = null,
320
- $$i = _vm._i($$a, $$v)
321
- if ($$el.checked) {
322
- $$i < 0 && (_vm.model = $$a.concat([$$v]))
323
- } else {
324
- $$i > -1 &&
325
- (_vm.model = $$a
326
- .slice(0, $$i)
327
- .concat($$a.slice($$i + 1)))
328
- }
329
- } else {
330
- _vm.model = $$c
331
- }
332
- },
333
- _vm.handleChange,
334
- ],
335
- focus: function ($event) {
336
- _vm.focus = true
337
- },
338
- blur: function ($event) {
339
- _vm.focus = false
340
- },
341
- },
342
- })
343
- : _c("input", {
344
- directives: [
345
- {
346
- name: "model",
347
- rawName: "v-model",
348
- value: _vm.model,
349
- expression: "model",
350
- },
351
- ],
352
- staticClass: "el-checkbox__original",
353
- attrs: {
354
- type: "checkbox",
355
- "aria-hidden": _vm.indeterminate ? "true" : "false",
356
- disabled: _vm.isDisabled,
357
- name: _vm.name,
358
- },
359
- domProps: {
360
- value: _vm.label,
361
- checked: Array.isArray(_vm.model)
362
- ? _vm._i(_vm.model, _vm.label) > -1
363
- : _vm.model,
364
- },
365
- on: {
366
- change: [
367
- function ($event) {
368
- var $$a = _vm.model,
369
- $$el = $event.target,
370
- $$c = $$el.checked ? true : false
371
- if (Array.isArray($$a)) {
372
- var $$v = _vm.label,
373
- $$i = _vm._i($$a, $$v)
374
- if ($$el.checked) {
375
- $$i < 0 && (_vm.model = $$a.concat([$$v]))
376
- } else {
377
- $$i > -1 &&
378
- (_vm.model = $$a
379
- .slice(0, $$i)
380
- .concat($$a.slice($$i + 1)))
381
- }
382
- } else {
383
- _vm.model = $$c
384
- }
385
- },
386
- _vm.handleChange,
387
- ],
388
- focus: function ($event) {
389
- _vm.focus = true
390
- },
391
- blur: function ($event) {
392
- _vm.focus = false
393
- },
394
- },
395
- }),
396
- ]
397
- ),
398
- _vm.$slots.default || _vm.label
399
- ? _c(
400
- "span",
401
- { staticClass: "el-checkbox__label" },
402
- [
403
- _vm._t("default"),
404
- !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e(),
405
- ],
406
- 2
407
- )
408
- : _vm._e(),
409
- ]
410
- )
411
- }
412
- var staticRenderFns = []
413
- render._withStripped = true
414
-
415
-
416
- // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=template&id=5f30258f
417
-
418
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
419
- var emitter_ = __webpack_require__(4);
420
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
421
-
422
- // 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
423
- //
424
- //
425
- //
426
- //
427
- //
428
- //
429
- //
430
- //
431
- //
432
- //
433
- //
434
- //
435
- //
436
- //
437
- //
438
- //
439
- //
440
- //
441
- //
442
- //
443
- //
444
- //
445
- //
446
- //
447
- //
448
- //
449
- //
450
- //
451
- //
452
- //
453
- //
454
- //
455
- //
456
- //
457
- //
458
- //
459
- //
460
- //
461
- //
462
- //
463
- //
464
- //
465
- //
466
- //
467
- //
468
- //
469
- //
470
- //
471
- //
472
- //
473
- //
474
- //
475
- //
476
- //
477
- //
478
-
479
-
480
-
481
- /* harmony default export */ var checkboxvue_type_script_lang_js = ({
482
- name: 'ElCheckbox',
483
-
484
- mixins: [emitter_default.a],
485
-
486
- inject: {
487
- elForm: {
488
- default: ''
489
- },
490
- elFormItem: {
491
- default: ''
492
- }
493
- },
494
-
495
- componentName: 'ElCheckbox',
496
-
497
- data: function data() {
498
- return {
499
- selfModel: false,
500
- focus: false,
501
- isLimitExceeded: false
502
- };
503
- },
504
-
505
-
506
- computed: {
507
- model: {
508
- get: function get() {
509
- return this.isGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
510
- },
511
- set: function set(val) {
512
- if (this.isGroup) {
513
- this.isLimitExceeded = false;
514
- this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
515
-
516
- this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
517
-
518
- this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
519
- } else {
520
- this.$emit('input', val);
521
- this.selfModel = val;
522
- }
523
- }
524
- },
525
-
526
- isChecked: function isChecked() {
527
- if ({}.toString.call(this.model) === '[object Boolean]') {
528
- return this.model;
529
- } else if (Array.isArray(this.model)) {
530
- return this.model.indexOf(this.label) > -1;
531
- } else if (this.model !== null && this.model !== undefined) {
532
- return this.model === this.trueLabel;
533
- }
534
- },
535
- isGroup: function isGroup() {
536
- var parent = this.$parent;
537
- while (parent) {
538
- if (parent.$options.componentName !== 'ElCheckboxGroup') {
539
- parent = parent.$parent;
540
- } else {
541
- this._checkboxGroup = parent;
542
- return true;
543
- }
544
- }
545
- return false;
546
- },
547
- store: function store() {
548
- return this._checkboxGroup ? this._checkboxGroup.value : this.value;
549
- },
550
-
551
-
552
- /* used to make the isDisabled judgment under max/min props */
553
- isLimitDisabled: function isLimitDisabled() {
554
- var _checkboxGroup = this._checkboxGroup,
555
- max = _checkboxGroup.max,
556
- min = _checkboxGroup.min;
557
-
558
- return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
559
- },
560
- isDisabled: function isDisabled() {
561
- return this.isGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
562
- },
563
- _elFormItemSize: function _elFormItemSize() {
564
- return (this.elFormItem || {}).elFormItemSize;
565
- },
566
- checkboxSize: function checkboxSize() {
567
- var temCheckboxSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
568
- return this.isGroup ? this._checkboxGroup.checkboxGroupSize || temCheckboxSize : temCheckboxSize;
569
- }
570
- },
571
-
572
- props: {
573
- value: {},
574
- label: {},
575
- indeterminate: Boolean,
576
- disabled: Boolean,
577
- checked: Boolean,
578
- name: String,
579
- trueLabel: [String, Number],
580
- falseLabel: [String, Number],
581
- id: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
582
- controls: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
583
- border: Boolean,
584
- size: String
585
- },
586
-
587
- methods: {
588
- addToStore: function addToStore() {
589
- if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
590
- this.model.push(this.label);
591
- } else {
592
- this.model = this.trueLabel || true;
593
- }
594
- },
595
- handleChange: function handleChange(ev) {
596
- var _this = this;
597
-
598
- if (this.isLimitExceeded) return;
599
- var value = void 0;
600
- if (ev.target.checked) {
601
- value = this.trueLabel === undefined ? true : this.trueLabel;
602
- } else {
603
- value = this.falseLabel === undefined ? false : this.falseLabel;
604
- }
605
- this.$emit('change', value, ev);
606
- this.$nextTick(function () {
607
- if (_this.isGroup) {
608
- _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
609
- }
610
- });
611
- }
612
- },
613
-
614
- created: function created() {
615
- this.checked && this.addToStore();
616
- },
617
- mounted: function mounted() {
618
- // 为indeterminate元素 添加aria-controls 属性
619
- if (this.indeterminate) {
620
- this.$el.setAttribute('aria-controls', this.controls);
621
- }
622
- },
623
-
624
-
625
- watch: {
626
- value: function value(_value) {
627
- this.dispatch('ElFormItem', 'el.form.change', _value);
628
- }
629
- }
630
- });
631
- // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js
632
- /* harmony default export */ var src_checkboxvue_type_script_lang_js = (checkboxvue_type_script_lang_js);
633
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
634
- var componentNormalizer = __webpack_require__(0);
635
-
636
- // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue
637
-
638
-
639
-
640
-
641
-
642
- /* normalize component */
643
-
644
- var component = Object(componentNormalizer["a" /* default */])(
645
- src_checkboxvue_type_script_lang_js,
646
- render,
647
- staticRenderFns,
648
- false,
649
- null,
650
- null,
651
- null
652
-
653
- )
654
-
655
- /* harmony default export */ var src_checkbox = (component.exports);
656
- // CONCATENATED MODULE: ./packages/checkbox/index.js
657
-
658
-
659
- /* istanbul ignore next */
660
- src_checkbox.install = function (Vue) {
661
- Vue.component(src_checkbox.name, src_checkbox);
662
- };
663
-
664
- /* harmony default export */ var packages_checkbox = __webpack_exports__["default"] = (src_checkbox);
665
-
666
- /***/ }),
667
- /* 17 */
668
- /***/ (function(module, exports) {
669
-
670
- module.exports = require("element-ui/lib/utils/scrollbar-width");
671
-
672
- /***/ }),
673
- /* 18 */
674
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
675
-
676
- "use strict";
677
- // ESM COMPAT FLAG
678
- __webpack_require__.r(__webpack_exports__);
679
-
680
- // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
681
- var resize_event_ = __webpack_require__(10);
682
-
683
- // EXTERNAL MODULE: external "element-ui/lib/utils/scrollbar-width"
684
- var scrollbar_width_ = __webpack_require__(17);
685
- var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
686
-
687
- // EXTERNAL MODULE: external "element-ui/lib/utils/util"
688
- var util_ = __webpack_require__(3);
689
-
690
- // EXTERNAL MODULE: external "element-ui/lib/utils/dom"
691
- var dom_ = __webpack_require__(1);
692
-
693
- // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
694
- var BAR_MAP = {
695
- vertical: {
696
- offset: 'offsetHeight',
697
- scroll: 'scrollTop',
698
- scrollSize: 'scrollHeight',
699
- size: 'height',
700
- key: 'vertical',
701
- axis: 'Y',
702
- client: 'clientY',
703
- direction: 'top'
704
- },
705
- horizontal: {
706
- offset: 'offsetWidth',
707
- scroll: 'scrollLeft',
708
- scrollSize: 'scrollWidth',
709
- size: 'width',
710
- key: 'horizontal',
711
- axis: 'X',
712
- client: 'clientX',
713
- direction: 'left'
714
- }
715
- };
716
-
717
- function renderThumbStyle(_ref) {
718
- var move = _ref.move,
719
- size = _ref.size,
720
- bar = _ref.bar;
721
-
722
- var style = {};
723
- var translate = 'translate' + bar.axis + '(' + move + '%)';
724
-
725
- style[bar.size] = size;
726
- style.transform = translate;
727
- style.msTransform = translate;
728
- style.webkitTransform = translate;
729
-
730
- return style;
731
- };
732
- // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
733
-
734
-
735
-
736
- /* istanbul ignore next */
737
- /* harmony default export */ var src_bar = ({
738
- name: 'Bar',
739
-
740
- props: {
741
- vertical: Boolean,
742
- size: String,
743
- move: Number
744
- },
745
-
746
- computed: {
747
- bar: function bar() {
748
- return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
749
- },
750
- wrap: function wrap() {
751
- return this.$parent.wrap;
752
- }
753
- },
754
-
755
- render: function render(h) {
756
- var size = this.size,
757
- move = this.move,
758
- bar = this.bar;
759
-
760
-
761
- return h(
762
- 'div',
763
- {
764
- 'class': ['el-scrollbar__bar', 'is-' + bar.key],
765
- on: {
766
- 'mousedown': this.clickTrackHandler
767
- }
768
- },
769
- [h('div', {
770
- ref: 'thumb',
771
- 'class': 'el-scrollbar__thumb',
772
- on: {
773
- 'mousedown': this.clickThumbHandler
774
- },
775
-
776
- style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
777
- );
778
- },
779
-
780
-
781
- methods: {
782
- clickThumbHandler: function clickThumbHandler(e) {
783
- // prevent click event of right button
784
- if (e.ctrlKey || e.button === 2) {
785
- return;
786
- }
787
- this.startDrag(e);
788
- this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
789
- },
790
- clickTrackHandler: function clickTrackHandler(e) {
791
- var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
792
- var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
793
- var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
794
-
795
- this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
796
- },
797
- startDrag: function startDrag(e) {
798
- e.stopImmediatePropagation();
799
- this.cursorDown = true;
800
-
801
- Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
802
- Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
803
- document.onselectstart = function () {
804
- return false;
805
- };
806
- },
807
- mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
808
- if (this.cursorDown === false) return;
809
- var prevPage = this[this.bar.axis];
810
-
811
- if (!prevPage) return;
812
-
813
- var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
814
- var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
815
- var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
816
-
817
- this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
818
- },
819
- mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
820
- this.cursorDown = false;
821
- this[this.bar.axis] = 0;
822
- Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
823
- document.onselectstart = null;
824
- }
825
- },
826
-
827
- destroyed: function destroyed() {
828
- Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
829
- }
830
- });
831
- // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
832
- // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
833
-
834
-
835
-
836
-
837
-
838
-
839
- /* istanbul ignore next */
840
- /* harmony default export */ var main = ({
841
- name: 'ElScrollbar',
842
-
843
- components: { Bar: src_bar },
844
-
845
- props: {
846
- native: Boolean,
847
- wrapStyle: {},
848
- wrapClass: {},
849
- viewClass: {},
850
- viewStyle: {},
851
- noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
852
- tag: {
853
- type: String,
854
- default: 'div'
855
- }
856
- },
857
-
858
- data: function data() {
859
- return {
860
- sizeWidth: '0',
861
- sizeHeight: '0',
862
- moveX: 0,
863
- moveY: 0
864
- };
865
- },
866
-
867
-
868
- computed: {
869
- wrap: function wrap() {
870
- return this.$refs.wrap;
871
- }
872
- },
873
-
874
- render: function render(h) {
875
- var gutter = scrollbar_width_default()();
876
- var style = this.wrapStyle;
877
-
878
- if (gutter) {
879
- var gutterWith = '-' + gutter + 'px';
880
- var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
881
-
882
- if (Array.isArray(this.wrapStyle)) {
883
- style = Object(util_["toObject"])(this.wrapStyle);
884
- style.marginRight = style.marginBottom = gutterWith;
885
- } else if (typeof this.wrapStyle === 'string') {
886
- style += gutterStyle;
887
- } else {
888
- style = gutterStyle;
889
- }
890
- }
891
- var view = h(this.tag, {
892
- class: ['el-scrollbar__view', this.viewClass],
893
- style: this.viewStyle,
894
- ref: 'resize'
895
- }, this.$slots.default);
896
- var wrap = h(
897
- 'div',
898
- {
899
- ref: 'wrap',
900
- style: style,
901
- on: {
902
- 'scroll': this.handleScroll
903
- },
904
-
905
- 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
906
- [[view]]
907
- );
908
- var nodes = void 0;
909
-
910
- if (!this.native) {
911
- nodes = [wrap, h(src_bar, {
912
- attrs: {
913
- move: this.moveX,
914
- size: this.sizeWidth }
915
- }), h(src_bar, {
916
- attrs: {
917
- vertical: true,
918
- move: this.moveY,
919
- size: this.sizeHeight }
920
- })];
921
- } else {
922
- nodes = [h(
923
- 'div',
924
- {
925
- ref: 'wrap',
926
- 'class': [this.wrapClass, 'el-scrollbar__wrap'],
927
- style: style },
928
- [[view]]
929
- )];
930
- }
931
- return h('div', { class: 'el-scrollbar' }, nodes);
932
- },
933
-
934
-
935
- methods: {
936
- handleScroll: function handleScroll() {
937
- var wrap = this.wrap;
938
-
939
- this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
940
- this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
941
- },
942
- update: function update() {
943
- var heightPercentage = void 0,
944
- widthPercentage = void 0;
945
- var wrap = this.wrap;
946
- if (!wrap) return;
947
-
948
- heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
949
- widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
950
-
951
- this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
952
- this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
953
- }
954
- },
955
-
956
- mounted: function mounted() {
957
- if (this.native) return;
958
- this.$nextTick(this.update);
959
- !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
960
- },
961
- beforeDestroy: function beforeDestroy() {
962
- if (this.native) return;
963
- !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
964
- }
965
- });
966
- // CONCATENATED MODULE: ./packages/scrollbar/index.js
967
-
968
-
969
- /* istanbul ignore next */
970
- main.install = function (Vue) {
971
- Vue.component(main.name, main);
972
- };
973
-
974
- /* harmony default export */ var scrollbar = __webpack_exports__["default"] = (main);
975
-
976
- /***/ }),
977
- /* 19 */,
978
- /* 20 */,
979
- /* 21 */,
980
- /* 22 */,
981
- /* 23 */,
982
- /* 24 */
983
- /***/ (function(module, exports) {
984
-
985
- module.exports = require("babel-helper-vue-jsx-merge-props");
986
-
987
- /***/ }),
988
- /* 25 */,
989
- /* 26 */
990
- /***/ (function(module, exports) {
991
-
992
- module.exports = require("element-ui/lib/utils/scroll-into-view");
993
-
994
- /***/ }),
995
- /* 27 */,
996
- /* 28 */,
997
- /* 29 */,
998
- /* 30 */,
999
- /* 31 */,
1000
- /* 32 */,
1001
- /* 33 */,
1002
- /* 34 */,
1003
- /* 35 */,
1004
- /* 36 */,
1005
- /* 37 */,
1006
- /* 38 */
1007
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1008
-
1009
- "use strict";
1010
- // ESM COMPAT FLAG
1011
- __webpack_require__.r(__webpack_exports__);
1012
-
1013
- // 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
1014
- var render = function () {
1015
- var _vm = this
1016
- var _h = _vm.$createElement
1017
- var _c = _vm._self._c || _h
1018
- return _c(
1019
- "label",
1020
- {
1021
- staticClass: "el-radio",
1022
- class: [
1023
- _vm.border && _vm.radioSize ? "el-radio--" + _vm.radioSize : "",
1024
- { "is-disabled": _vm.isDisabled },
1025
- { "is-focus": _vm.focus },
1026
- { "is-bordered": _vm.border },
1027
- { "is-checked": _vm.model === _vm.label },
1028
- ],
1029
- attrs: {
1030
- role: "radio",
1031
- "aria-checked": _vm.model === _vm.label,
1032
- "aria-disabled": _vm.isDisabled,
1033
- tabindex: _vm.tabIndex,
1034
- },
1035
- on: {
1036
- keydown: function ($event) {
1037
- if (
1038
- !("button" in $event) &&
1039
- _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])
1040
- ) {
1041
- return null
1042
- }
1043
- $event.stopPropagation()
1044
- $event.preventDefault()
1045
- _vm.model = _vm.isDisabled ? _vm.model : _vm.label
1046
- },
1047
- },
1048
- },
1049
- [
1050
- _c(
1051
- "span",
1052
- {
1053
- staticClass: "el-radio__input",
1054
- class: {
1055
- "is-disabled": _vm.isDisabled,
1056
- "is-checked": _vm.model === _vm.label,
1057
- },
1058
- },
1059
- [
1060
- _c("span", { staticClass: "el-radio__inner" }),
1061
- _c("input", {
1062
- directives: [
1063
- {
1064
- name: "model",
1065
- rawName: "v-model",
1066
- value: _vm.model,
1067
- expression: "model",
1068
- },
1069
- ],
1070
- ref: "radio",
1071
- staticClass: "el-radio__original",
1072
- attrs: {
1073
- type: "radio",
1074
- "aria-hidden": "true",
1075
- name: _vm.name,
1076
- disabled: _vm.isDisabled,
1077
- tabindex: "-1",
1078
- autocomplete: "off",
1079
- },
1080
- domProps: {
1081
- value: _vm.label,
1082
- checked: _vm._q(_vm.model, _vm.label),
1083
- },
1084
- on: {
1085
- focus: function ($event) {
1086
- _vm.focus = true
1087
- },
1088
- blur: function ($event) {
1089
- _vm.focus = false
1090
- },
1091
- change: [
1092
- function ($event) {
1093
- _vm.model = _vm.label
1094
- },
1095
- _vm.handleChange,
1096
- ],
1097
- },
1098
- }),
1099
- ]
1100
- ),
1101
- _c(
1102
- "span",
1103
- {
1104
- staticClass: "el-radio__label",
1105
- on: {
1106
- keydown: function ($event) {
1107
- $event.stopPropagation()
1108
- },
1109
- },
1110
- },
1111
- [
1112
- _vm._t("default"),
1113
- !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e(),
1114
- ],
1115
- 2
1116
- ),
1117
- ]
1118
- )
1119
- }
1120
- var staticRenderFns = []
1121
- render._withStripped = true
1122
-
1123
-
1124
- // CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=template&id=1e51a39c
1125
-
1126
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
1127
- var emitter_ = __webpack_require__(4);
1128
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
1129
-
1130
- // 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
1131
- //
1132
- //
1133
- //
1134
- //
1135
- //
1136
- //
1137
- //
1138
- //
1139
- //
1140
- //
1141
- //
1142
- //
1143
- //
1144
- //
1145
- //
1146
- //
1147
- //
1148
- //
1149
- //
1150
- //
1151
- //
1152
- //
1153
- //
1154
- //
1155
- //
1156
- //
1157
- //
1158
- //
1159
- //
1160
- //
1161
- //
1162
- //
1163
- //
1164
- //
1165
- //
1166
- //
1167
- //
1168
- //
1169
- //
1170
- //
1171
- //
1172
- //
1173
- //
1174
- //
1175
- //
1176
-
1177
-
1178
-
1179
- /* harmony default export */ var radiovue_type_script_lang_js = ({
1180
- name: 'ElRadio',
1181
-
1182
- mixins: [emitter_default.a],
1183
-
1184
- inject: {
1185
- elForm: {
1186
- default: ''
1187
- },
1188
-
1189
- elFormItem: {
1190
- default: ''
1191
- }
1192
- },
1193
-
1194
- componentName: 'ElRadio',
1195
-
1196
- props: {
1197
- value: {},
1198
- label: {},
1199
- disabled: Boolean,
1200
- name: String,
1201
- border: Boolean,
1202
- size: String
1203
- },
1204
-
1205
- data: function data() {
1206
- return {
1207
- focus: false
1208
- };
1209
- },
1210
-
1211
- computed: {
1212
- isGroup: function isGroup() {
1213
- var parent = this.$parent;
1214
- while (parent) {
1215
- if (parent.$options.componentName !== 'ElRadioGroup') {
1216
- parent = parent.$parent;
1217
- } else {
1218
- this._radioGroup = parent;
1219
- return true;
1220
- }
1221
- }
1222
- return false;
1223
- },
1224
-
1225
- model: {
1226
- get: function get() {
1227
- return this.isGroup ? this._radioGroup.value : this.value;
1228
- },
1229
- set: function set(val) {
1230
- if (this.isGroup) {
1231
- this.dispatch('ElRadioGroup', 'input', [val]);
1232
- } else {
1233
- this.$emit('input', val);
1234
- }
1235
- this.$refs.radio && (this.$refs.radio.checked = this.model === this.label);
1236
- }
1237
- },
1238
- _elFormItemSize: function _elFormItemSize() {
1239
- return (this.elFormItem || {}).elFormItemSize;
1240
- },
1241
- radioSize: function radioSize() {
1242
- var temRadioSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
1243
- return this.isGroup ? this._radioGroup.radioGroupSize || temRadioSize : temRadioSize;
1244
- },
1245
- isDisabled: function isDisabled() {
1246
- return this.isGroup ? this._radioGroup.disabled || this.disabled || (this.elForm || {}).disabled : this.disabled || (this.elForm || {}).disabled;
1247
- },
1248
- tabIndex: function tabIndex() {
1249
- return this.isDisabled || this.isGroup && this.model !== this.label ? -1 : 0;
1250
- }
1251
- },
1252
-
1253
- methods: {
1254
- handleChange: function handleChange() {
1255
- var _this = this;
1256
-
1257
- this.$nextTick(function () {
1258
- _this.$emit('change', _this.model);
1259
- _this.isGroup && _this.dispatch('ElRadioGroup', 'handleChange', _this.model);
1260
- });
1261
- }
1262
- }
1263
- });
1264
- // CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=script&lang=js
1265
- /* harmony default export */ var src_radiovue_type_script_lang_js = (radiovue_type_script_lang_js);
1266
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1267
- var componentNormalizer = __webpack_require__(0);
1268
-
1269
- // CONCATENATED MODULE: ./packages/radio/src/radio.vue
1270
-
1271
-
1272
-
1273
-
1274
-
1275
- /* normalize component */
1276
-
1277
- var component = Object(componentNormalizer["a" /* default */])(
1278
- src_radiovue_type_script_lang_js,
1279
- render,
1280
- staticRenderFns,
1281
- false,
1282
- null,
1283
- null,
1284
- null
1285
-
1286
- )
1287
-
1288
- /* harmony default export */ var src_radio = (component.exports);
1289
- // CONCATENATED MODULE: ./packages/radio/index.js
1290
-
1291
-
1292
- /* istanbul ignore next */
1293
- src_radio.install = function (Vue) {
1294
- Vue.component(src_radio.name, src_radio);
1295
- };
1296
-
1297
- /* harmony default export */ var packages_radio = __webpack_exports__["default"] = (src_radio);
1298
-
1299
- /***/ }),
1300
- /* 39 */,
1301
- /* 40 */
1302
- /***/ (function(module, exports) {
1303
-
1304
- module.exports = require("element-ui/lib/utils/aria-utils");
1305
-
1306
- /***/ }),
1307
- /* 41 */,
1308
- /* 42 */,
1309
- /* 43 */,
1310
- /* 44 */,
1311
- /* 45 */,
1312
- /* 46 */,
1313
- /* 47 */
1314
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1315
-
1316
- "use strict";
1317
- // ESM COMPAT FLAG
1318
- __webpack_require__.r(__webpack_exports__);
1319
-
1320
- // 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
1321
- var cascader_panelvue_type_template_id_09ca3ff1_render = function () {
1322
- var _vm = this
1323
- var _h = _vm.$createElement
1324
- var _c = _vm._self._c || _h
1325
- return _c(
1326
- "div",
1327
- {
1328
- class: ["el-cascader-panel", _vm.border && "is-bordered"],
1329
- on: { keydown: _vm.handleKeyDown },
1330
- },
1331
- _vm._l(_vm.menus, function (menu, index) {
1332
- return _c("cascader-menu", {
1333
- key: index,
1334
- ref: "menu",
1335
- refInFor: true,
1336
- attrs: { index: index, nodes: menu },
1337
- })
1338
- }),
1339
- 1
1340
- )
1341
- }
1342
- var staticRenderFns = []
1343
- cascader_panelvue_type_template_id_09ca3ff1_render._withStripped = true
1344
-
1345
-
1346
- // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=09ca3ff1
1347
-
1348
- // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
1349
- var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(24);
1350
- var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
1351
-
1352
- // EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
1353
- var scrollbar = __webpack_require__(18);
1354
-
1355
- // EXTERNAL MODULE: ./packages/checkbox/index.js + 5 modules
1356
- var packages_checkbox = __webpack_require__(16);
1357
-
1358
- // EXTERNAL MODULE: ./packages/radio/index.js + 5 modules
1359
- var packages_radio = __webpack_require__(38);
1360
-
1361
- // EXTERNAL MODULE: external "element-ui/lib/utils/util"
1362
- var util_ = __webpack_require__(3);
1363
-
1364
- // 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
1365
-
1366
-
1367
-
1368
-
1369
-
1370
-
1371
- var stopPropagation = function stopPropagation(e) {
1372
- return e.stopPropagation();
1373
- };
1374
-
1375
- /* harmony default export */ var cascader_nodevue_type_script_lang_js = ({
1376
- inject: ['panel'],
1377
-
1378
- components: {
1379
- ElCheckbox: packages_checkbox["default"],
1380
- ElRadio: packages_radio["default"]
1381
- },
1382
-
1383
- props: {
1384
- node: {
1385
- required: true
1386
- },
1387
- nodeId: String
1388
- },
1389
-
1390
- computed: {
1391
- config: function config() {
1392
- return this.panel.config;
1393
- },
1394
- isLeaf: function isLeaf() {
1395
- return this.node.isLeaf;
1396
- },
1397
- isDisabled: function isDisabled() {
1398
- return this.node.isDisabled;
1399
- },
1400
- checkedValue: function checkedValue() {
1401
- return this.panel.checkedValue;
1402
- },
1403
- isChecked: function isChecked() {
1404
- return this.node.isSameNode(this.checkedValue);
1405
- },
1406
- inActivePath: function inActivePath() {
1407
- return this.isInPath(this.panel.activePath);
1408
- },
1409
- inCheckedPath: function inCheckedPath() {
1410
- var _this = this;
1411
-
1412
- if (!this.config.checkStrictly) return false;
1413
-
1414
- return this.panel.checkedNodePaths.some(function (checkedPath) {
1415
- return _this.isInPath(checkedPath);
1416
- });
1417
- },
1418
- value: function value() {
1419
- return this.node.getValueByOption();
1420
- }
1421
- },
1422
-
1423
- methods: {
1424
- handleExpand: function handleExpand() {
1425
- var _this2 = this;
1426
-
1427
- var panel = this.panel,
1428
- node = this.node,
1429
- isDisabled = this.isDisabled,
1430
- config = this.config;
1431
- var multiple = config.multiple,
1432
- checkStrictly = config.checkStrictly;
1433
-
1434
-
1435
- if (!checkStrictly && isDisabled || node.loading) return;
1436
-
1437
- if (config.lazy && !node.loaded) {
1438
- panel.lazyLoad(node, function () {
1439
- // do not use cached leaf value here, invoke this.isLeaf to get new value.
1440
- var isLeaf = _this2.isLeaf;
1441
-
1442
-
1443
- if (!isLeaf) _this2.handleExpand();
1444
- if (multiple) {
1445
- // if leaf sync checked state, else clear checked state
1446
- var checked = isLeaf ? node.checked : false;
1447
- _this2.handleMultiCheckChange(checked);
1448
- }
1449
- });
1450
- } else {
1451
- panel.handleExpand(node);
1452
- }
1453
- },
1454
- handleCheckChange: function handleCheckChange() {
1455
- var panel = this.panel,
1456
- value = this.value,
1457
- node = this.node;
1458
-
1459
- panel.handleCheckChange(value);
1460
- panel.handleExpand(node);
1461
- },
1462
- handleMultiCheckChange: function handleMultiCheckChange(checked) {
1463
- this.node.doCheck(checked);
1464
- this.panel.calculateMultiCheckedValue();
1465
- },
1466
- isInPath: function isInPath(pathNodes) {
1467
- var node = this.node;
1468
-
1469
- var selectedPathNode = pathNodes[node.level - 1] || {};
1470
- return selectedPathNode.uid === node.uid;
1471
- },
1472
- renderPrefix: function renderPrefix(h) {
1473
- var isLeaf = this.isLeaf,
1474
- isChecked = this.isChecked,
1475
- config = this.config;
1476
- var checkStrictly = config.checkStrictly,
1477
- multiple = config.multiple;
1478
-
1479
-
1480
- if (multiple) {
1481
- return this.renderCheckbox(h);
1482
- } else if (checkStrictly) {
1483
- return this.renderRadio(h);
1484
- } else if (isLeaf && isChecked) {
1485
- return this.renderCheckIcon(h);
1486
- }
1487
-
1488
- return null;
1489
- },
1490
- renderPostfix: function renderPostfix(h) {
1491
- var node = this.node,
1492
- isLeaf = this.isLeaf;
1493
-
1494
-
1495
- if (node.loading) {
1496
- return this.renderLoadingIcon(h);
1497
- } else if (!isLeaf) {
1498
- return this.renderExpandIcon(h);
1499
- }
1500
-
1501
- return null;
1502
- },
1503
- renderCheckbox: function renderCheckbox(h) {
1504
- var node = this.node,
1505
- config = this.config,
1506
- isDisabled = this.isDisabled;
1507
-
1508
- var events = {
1509
- on: { change: this.handleMultiCheckChange },
1510
- nativeOn: {}
1511
- };
1512
-
1513
- if (config.checkStrictly) {
1514
- // when every node is selectable, click event should not trigger expand event.
1515
- events.nativeOn.click = stopPropagation;
1516
- }
1517
-
1518
- return h('el-checkbox', external_babel_helper_vue_jsx_merge_props_default()([{
1519
- attrs: {
1520
- value: node.checked,
1521
- indeterminate: node.indeterminate,
1522
- disabled: isDisabled
1523
- }
1524
- }, events]));
1525
- },
1526
- renderRadio: function renderRadio(h) {
1527
- var checkedValue = this.checkedValue,
1528
- value = this.value,
1529
- isDisabled = this.isDisabled;
1530
-
1531
- // to keep same reference if value cause radio's checked state is calculated by reference comparision;
1532
-
1533
- if (Object(util_["isEqual"])(value, checkedValue)) {
1534
- value = checkedValue;
1535
- }
1536
-
1537
- return h(
1538
- 'el-radio',
1539
- {
1540
- attrs: {
1541
- value: checkedValue,
1542
- label: value,
1543
- disabled: isDisabled
1544
- },
1545
- on: {
1546
- 'change': this.handleCheckChange
1547
- },
1548
- nativeOn: {
1549
- 'click': stopPropagation
1550
- }
1551
- },
1552
- [h('span')]
1553
- );
1554
- },
1555
- renderCheckIcon: function renderCheckIcon(h) {
1556
- return h('i', { 'class': 'el-icon-check el-cascader-node__prefix' });
1557
- },
1558
- renderLoadingIcon: function renderLoadingIcon(h) {
1559
- return h('i', { 'class': 'el-icon-loading el-cascader-node__postfix' });
1560
- },
1561
- renderExpandIcon: function renderExpandIcon(h) {
1562
- return h('i', { 'class': 'el-icon-arrow-right el-cascader-node__postfix' });
1563
- },
1564
- renderContent: function renderContent(h) {
1565
- var panel = this.panel,
1566
- node = this.node;
1567
-
1568
- var render = panel.renderLabelFn;
1569
- var vnode = render ? render({ node: node, data: node.data }) : null;
1570
-
1571
- return h(
1572
- 'span',
1573
- { 'class': 'el-cascader-node__label' },
1574
- [vnode || node.label]
1575
- );
1576
- }
1577
- },
1578
-
1579
- render: function render(h) {
1580
- var _this3 = this;
1581
-
1582
- var inActivePath = this.inActivePath,
1583
- inCheckedPath = this.inCheckedPath,
1584
- isChecked = this.isChecked,
1585
- isLeaf = this.isLeaf,
1586
- isDisabled = this.isDisabled,
1587
- config = this.config,
1588
- nodeId = this.nodeId;
1589
- var expandTrigger = config.expandTrigger,
1590
- checkStrictly = config.checkStrictly,
1591
- multiple = config.multiple;
1592
-
1593
- var disabled = !checkStrictly && isDisabled;
1594
- var events = { on: {} };
1595
-
1596
- if (expandTrigger === 'click') {
1597
- events.on.click = this.handleExpand;
1598
- } else {
1599
- events.on.mouseenter = function (e) {
1600
- _this3.handleExpand();
1601
- _this3.$emit('expand', e);
1602
- };
1603
- events.on.focus = function (e) {
1604
- _this3.handleExpand();
1605
- _this3.$emit('expand', e);
1606
- };
1607
- }
1608
- if (isLeaf && !isDisabled && !checkStrictly && !multiple) {
1609
- events.on.click = this.handleCheckChange;
1610
- }
1611
-
1612
- return h(
1613
- 'li',
1614
- external_babel_helper_vue_jsx_merge_props_default()([{
1615
- attrs: {
1616
- role: 'menuitem',
1617
- id: nodeId,
1618
- 'aria-expanded': inActivePath,
1619
- tabindex: disabled ? null : -1
1620
- },
1621
- 'class': {
1622
- 'el-cascader-node': true,
1623
- 'is-selectable': checkStrictly,
1624
- 'in-active-path': inActivePath,
1625
- 'in-checked-path': inCheckedPath,
1626
- 'is-active': isChecked,
1627
- 'is-disabled': disabled
1628
- }
1629
- }, events]),
1630
- [this.renderPrefix(h), this.renderContent(h), this.renderPostfix(h)]
1631
- );
1632
- }
1633
- });
1634
- // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js
1635
- /* harmony default export */ var src_cascader_nodevue_type_script_lang_js = (cascader_nodevue_type_script_lang_js);
1636
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1637
- var componentNormalizer = __webpack_require__(0);
1638
-
1639
- // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue
1640
- var cascader_node_render, cascader_node_staticRenderFns
1641
-
1642
-
1643
-
1644
-
1645
- /* normalize component */
1646
-
1647
- var component = Object(componentNormalizer["a" /* default */])(
1648
- src_cascader_nodevue_type_script_lang_js,
1649
- cascader_node_render,
1650
- cascader_node_staticRenderFns,
1651
- false,
1652
- null,
1653
- null,
1654
- null
1655
-
1656
- )
1657
-
1658
- /* harmony default export */ var cascader_node = (component.exports);
1659
- // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
1660
- var locale_ = __webpack_require__(9);
1661
- var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
1662
-
1663
- // 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
1664
-
1665
-
1666
-
1667
-
1668
-
1669
-
1670
-
1671
- /* harmony default export */ var cascader_menuvue_type_script_lang_js = ({
1672
- name: 'ElCascaderMenu',
1673
-
1674
- mixins: [locale_default.a],
1675
-
1676
- inject: ['panel'],
1677
-
1678
- components: {
1679
- ElScrollbar: scrollbar["default"],
1680
- CascaderNode: cascader_node
1681
- },
1682
-
1683
- props: {
1684
- nodes: {
1685
- type: Array,
1686
- required: true
1687
- },
1688
- index: Number
1689
- },
1690
-
1691
- data: function data() {
1692
- return {
1693
- activeNode: null,
1694
- hoverTimer: null,
1695
- id: Object(util_["generateId"])()
1696
- };
1697
- },
1698
-
1699
-
1700
- computed: {
1701
- isEmpty: function isEmpty() {
1702
- return !this.nodes.length;
1703
- },
1704
- menuId: function menuId() {
1705
- return 'cascader-menu-' + this.id + '-' + this.index;
1706
- }
1707
- },
1708
-
1709
- methods: {
1710
- handleExpand: function handleExpand(e) {
1711
- this.activeNode = e.target;
1712
- },
1713
- handleMouseMove: function handleMouseMove(e) {
1714
- var activeNode = this.activeNode,
1715
- hoverTimer = this.hoverTimer;
1716
- var hoverZone = this.$refs.hoverZone;
1717
-
1718
-
1719
- if (!activeNode || !hoverZone) return;
1720
-
1721
- if (activeNode.contains(e.target)) {
1722
- clearTimeout(hoverTimer);
1723
-
1724
- var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
1725
- left = _$el$getBoundingClien.left;
1726
-
1727
- var startX = e.clientX - left;
1728
- var _$el = this.$el,
1729
- offsetWidth = _$el.offsetWidth,
1730
- offsetHeight = _$el.offsetHeight;
1731
-
1732
- var top = activeNode.offsetTop;
1733
- var bottom = top + activeNode.offsetHeight;
1734
-
1735
- 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 ';
1736
- } else if (!hoverTimer) {
1737
- this.hoverTimer = setTimeout(this.clearHoverZone, this.panel.config.hoverThreshold);
1738
- }
1739
- },
1740
- clearHoverZone: function clearHoverZone() {
1741
- var hoverZone = this.$refs.hoverZone;
1742
-
1743
- if (!hoverZone) return;
1744
- hoverZone.innerHTML = '';
1745
- },
1746
- renderEmptyText: function renderEmptyText(h) {
1747
- return h(
1748
- 'div',
1749
- { 'class': 'el-cascader-menu__empty-text' },
1750
- [this.t('el.cascader.noData')]
1751
- );
1752
- },
1753
- renderNodeList: function renderNodeList(h) {
1754
- var menuId = this.menuId;
1755
- var isHoverMenu = this.panel.isHoverMenu;
1756
-
1757
- var events = { on: {} };
1758
-
1759
- if (isHoverMenu) {
1760
- events.on.expand = this.handleExpand;
1761
- }
1762
-
1763
- var nodes = this.nodes.map(function (node, index) {
1764
- var hasChildren = node.hasChildren;
1765
-
1766
- return h('cascader-node', external_babel_helper_vue_jsx_merge_props_default()([{
1767
- key: node.uid,
1768
- attrs: { node: node,
1769
- 'node-id': menuId + '-' + index,
1770
- 'aria-haspopup': hasChildren,
1771
- 'aria-owns': hasChildren ? menuId : null
1772
- }
1773
- }, events]));
1774
- });
1775
-
1776
- return [].concat(nodes, [isHoverMenu ? h('svg', { ref: 'hoverZone', 'class': 'el-cascader-menu__hover-zone' }) : null]);
1777
- }
1778
- },
1779
-
1780
- render: function render(h) {
1781
- var isEmpty = this.isEmpty,
1782
- menuId = this.menuId;
1783
-
1784
- var events = { nativeOn: {} };
1785
-
1786
- // optimize hover to expand experience (#8010)
1787
- if (this.panel.isHoverMenu) {
1788
- events.nativeOn.mousemove = this.handleMouseMove;
1789
- // events.nativeOn.mouseleave = this.clearHoverZone;
1790
- }
1791
-
1792
- return h(
1793
- 'el-scrollbar',
1794
- external_babel_helper_vue_jsx_merge_props_default()([{
1795
- attrs: {
1796
- tag: 'ul',
1797
- role: 'menu',
1798
- id: menuId,
1799
-
1800
- 'wrap-class': 'el-cascader-menu__wrap',
1801
- 'view-class': {
1802
- 'el-cascader-menu__list': true,
1803
- 'is-empty': isEmpty
1804
- }
1805
- },
1806
- 'class': 'el-cascader-menu' }, events]),
1807
- [isEmpty ? this.renderEmptyText(h) : this.renderNodeList(h)]
1808
- );
1809
- }
1810
- });
1811
- // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js
1812
- /* harmony default export */ var src_cascader_menuvue_type_script_lang_js = (cascader_menuvue_type_script_lang_js);
1813
- // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue
1814
- var cascader_menu_render, cascader_menu_staticRenderFns
1815
-
1816
-
1817
-
1818
-
1819
- /* normalize component */
1820
-
1821
- var cascader_menu_component = Object(componentNormalizer["a" /* default */])(
1822
- src_cascader_menuvue_type_script_lang_js,
1823
- cascader_menu_render,
1824
- cascader_menu_staticRenderFns,
1825
- false,
1826
- null,
1827
- null,
1828
- null
1829
-
1830
- )
1831
-
1832
- /* harmony default export */ var cascader_menu = (cascader_menu_component.exports);
1833
- // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
1834
- var shared_ = __webpack_require__(11);
1835
-
1836
- // CONCATENATED MODULE: ./packages/cascader-panel/src/node.js
1837
- 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; }; }();
1838
-
1839
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1840
-
1841
-
1842
-
1843
-
1844
- var uid = 0;
1845
-
1846
- var node_Node = function () {
1847
- function Node(data, config, parentNode) {
1848
- _classCallCheck(this, Node);
1849
-
1850
- this.data = data;
1851
- this.config = config;
1852
- this.parent = parentNode || null;
1853
- this.level = !this.parent ? 1 : this.parent.level + 1;
1854
- this.uid = uid++;
1855
-
1856
- this.initState();
1857
- this.initChildren();
1858
- }
1859
-
1860
- Node.prototype.initState = function initState() {
1861
- var _config = this.config,
1862
- valueKey = _config.value,
1863
- labelKey = _config.label;
1864
-
1865
-
1866
- this.value = this.data[valueKey];
1867
- this.label = this.data[labelKey];
1868
- this.pathNodes = this.calculatePathNodes();
1869
- this.path = this.pathNodes.map(function (node) {
1870
- return node.value;
1871
- });
1872
- this.pathLabels = this.pathNodes.map(function (node) {
1873
- return node.label;
1874
- });
1875
-
1876
- // lazy load
1877
- this.loading = false;
1878
- this.loaded = false;
1879
- };
1880
-
1881
- Node.prototype.initChildren = function initChildren() {
1882
- var _this = this;
1883
-
1884
- var config = this.config;
1885
-
1886
- var childrenKey = config.children;
1887
- var childrenData = this.data[childrenKey];
1888
- this.hasChildren = Array.isArray(childrenData);
1889
- this.children = (childrenData || []).map(function (child) {
1890
- return new Node(child, config, _this);
1891
- });
1892
- };
1893
-
1894
- Node.prototype.calculatePathNodes = function calculatePathNodes() {
1895
- var nodes = [this];
1896
- var parent = this.parent;
1897
-
1898
- while (parent) {
1899
- nodes.unshift(parent);
1900
- parent = parent.parent;
1901
- }
1902
-
1903
- return nodes;
1904
- };
1905
-
1906
- Node.prototype.getPath = function getPath() {
1907
- return this.path;
1908
- };
1909
-
1910
- Node.prototype.getValue = function getValue() {
1911
- return this.value;
1912
- };
1913
-
1914
- Node.prototype.getValueByOption = function getValueByOption() {
1915
- return this.config.emitPath ? this.getPath() : this.getValue();
1916
- };
1917
-
1918
- Node.prototype.getText = function getText(allLevels, separator) {
1919
- return allLevels ? this.pathLabels.join(separator) : this.label;
1920
- };
1921
-
1922
- Node.prototype.isSameNode = function isSameNode(checkedValue) {
1923
- var value = this.getValueByOption();
1924
- return this.config.multiple && Array.isArray(checkedValue) ? checkedValue.some(function (val) {
1925
- return Object(util_["isEqual"])(val, value);
1926
- }) : Object(util_["isEqual"])(checkedValue, value);
1927
- };
1928
-
1929
- Node.prototype.broadcast = function broadcast(event) {
1930
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1931
- args[_key - 1] = arguments[_key];
1932
- }
1933
-
1934
- var handlerName = 'onParent' + Object(util_["capitalize"])(event);
1935
-
1936
- this.children.forEach(function (child) {
1937
- if (child) {
1938
- // bottom up
1939
- child.broadcast.apply(child, [event].concat(args));
1940
- child[handlerName] && child[handlerName].apply(child, args);
1941
- }
1942
- });
1943
- };
1944
-
1945
- Node.prototype.emit = function emit(event) {
1946
- var parent = this.parent;
1947
-
1948
- var handlerName = 'onChild' + Object(util_["capitalize"])(event);
1949
- if (parent) {
1950
- for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1951
- args[_key2 - 1] = arguments[_key2];
1952
- }
1953
-
1954
- parent[handlerName] && parent[handlerName].apply(parent, args);
1955
- parent.emit.apply(parent, [event].concat(args));
1956
- }
1957
- };
1958
-
1959
- Node.prototype.onParentCheck = function onParentCheck(checked) {
1960
- if (!this.isDisabled) {
1961
- this.setCheckState(checked);
1962
- }
1963
- };
1964
-
1965
- Node.prototype.onChildCheck = function onChildCheck() {
1966
- var children = this.children;
1967
-
1968
- var validChildren = children.filter(function (child) {
1969
- return !child.isDisabled;
1970
- });
1971
- var checked = validChildren.length ? validChildren.every(function (child) {
1972
- return child.checked;
1973
- }) : false;
1974
-
1975
- this.setCheckState(checked);
1976
- };
1977
-
1978
- Node.prototype.setCheckState = function setCheckState(checked) {
1979
- var totalNum = this.children.length;
1980
- var checkedNum = this.children.reduce(function (c, p) {
1981
- var num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
1982
- return c + num;
1983
- }, 0);
1984
-
1985
- this.checked = checked;
1986
- this.indeterminate = checkedNum !== totalNum && checkedNum > 0;
1987
- };
1988
-
1989
- Node.prototype.syncCheckState = function syncCheckState(checkedValue) {
1990
- var value = this.getValueByOption();
1991
- var checked = this.isSameNode(checkedValue, value);
1992
-
1993
- this.doCheck(checked);
1994
- };
1995
-
1996
- Node.prototype.doCheck = function doCheck(checked) {
1997
- if (this.checked !== checked) {
1998
- if (this.config.checkStrictly) {
1999
- this.checked = checked;
2000
- } else {
2001
- // bottom up to unify the calculation of the indeterminate state
2002
- this.broadcast('check', checked);
2003
- this.setCheckState(checked);
2004
- this.emit('check');
2005
- }
2006
- }
2007
- };
2008
-
2009
- _createClass(Node, [{
2010
- key: 'isDisabled',
2011
- get: function get() {
2012
- var data = this.data,
2013
- parent = this.parent,
2014
- config = this.config;
2015
-
2016
- var disabledKey = config.disabled;
2017
- var checkStrictly = config.checkStrictly;
2018
-
2019
- return data[disabledKey] || !checkStrictly && parent && parent.isDisabled;
2020
- }
2021
- }, {
2022
- key: 'isLeaf',
2023
- get: function get() {
2024
- var data = this.data,
2025
- loaded = this.loaded,
2026
- hasChildren = this.hasChildren,
2027
- children = this.children;
2028
- var _config2 = this.config,
2029
- lazy = _config2.lazy,
2030
- leafKey = _config2.leaf;
2031
-
2032
- if (lazy) {
2033
- var isLeaf = Object(shared_["isDef"])(data[leafKey]) ? data[leafKey] : loaded ? !children.length : false;
2034
- this.hasChildren = !isLeaf;
2035
- return isLeaf;
2036
- }
2037
- return !hasChildren;
2038
- }
2039
- }]);
2040
-
2041
- return Node;
2042
- }();
2043
-
2044
- /* harmony default export */ var src_node = (node_Node);
2045
- // CONCATENATED MODULE: ./packages/cascader-panel/src/store.js
2046
- function store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2047
-
2048
-
2049
-
2050
-
2051
- var flatNodes = function flatNodes(data, leafOnly) {
2052
- return data.reduce(function (res, node) {
2053
- if (node.isLeaf) {
2054
- res.push(node);
2055
- } else {
2056
- !leafOnly && res.push(node);
2057
- res = res.concat(flatNodes(node.children, leafOnly));
2058
- }
2059
- return res;
2060
- }, []);
2061
- };
2062
-
2063
- var store_Store = function () {
2064
- function Store(data, config) {
2065
- store_classCallCheck(this, Store);
2066
-
2067
- this.config = config;
2068
- this.initNodes(data);
2069
- }
2070
-
2071
- Store.prototype.initNodes = function initNodes(data) {
2072
- var _this = this;
2073
-
2074
- data = Object(util_["coerceTruthyValueToArray"])(data);
2075
- this.nodes = data.map(function (nodeData) {
2076
- return new src_node(nodeData, _this.config);
2077
- });
2078
- this.flattedNodes = this.getFlattedNodes(false, false);
2079
- this.leafNodes = this.getFlattedNodes(true, false);
2080
- };
2081
-
2082
- Store.prototype.appendNode = function appendNode(nodeData, parentNode) {
2083
- var node = new src_node(nodeData, this.config, parentNode);
2084
- var children = parentNode ? parentNode.children : this.nodes;
2085
-
2086
- children.push(node);
2087
- };
2088
-
2089
- Store.prototype.appendNodes = function appendNodes(nodeDataList, parentNode) {
2090
- var _this2 = this;
2091
-
2092
- nodeDataList = Object(util_["coerceTruthyValueToArray"])(nodeDataList);
2093
- nodeDataList.forEach(function (nodeData) {
2094
- return _this2.appendNode(nodeData, parentNode);
2095
- });
2096
- };
2097
-
2098
- Store.prototype.getNodes = function getNodes() {
2099
- return this.nodes;
2100
- };
2101
-
2102
- Store.prototype.getFlattedNodes = function getFlattedNodes(leafOnly) {
2103
- var cached = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2104
-
2105
- var cachedNodes = leafOnly ? this.leafNodes : this.flattedNodes;
2106
- return cached ? cachedNodes : flatNodes(this.nodes, leafOnly);
2107
- };
2108
-
2109
- Store.prototype.getNodeByValue = function getNodeByValue(value) {
2110
- var nodes = this.getFlattedNodes(false, !this.config.lazy).filter(function (node) {
2111
- return Object(util_["valueEquals"])(node.path, value) || node.value === value;
2112
- });
2113
- return nodes && nodes.length ? nodes[0] : null;
2114
- };
2115
-
2116
- return Store;
2117
- }();
2118
-
2119
- /* harmony default export */ var src_store = (store_Store);
2120
- // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
2121
- var merge_ = __webpack_require__(6);
2122
- var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
2123
-
2124
- // EXTERNAL MODULE: external "element-ui/lib/utils/aria-utils"
2125
- var aria_utils_ = __webpack_require__(40);
2126
- var aria_utils_default = /*#__PURE__*/__webpack_require__.n(aria_utils_);
2127
-
2128
- // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
2129
- var scroll_into_view_ = __webpack_require__(26);
2130
- var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
2131
-
2132
- // 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
2133
- 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; };
2134
-
2135
- //
2136
- //
2137
- //
2138
- //
2139
- //
2140
- //
2141
- //
2142
- //
2143
- //
2144
- //
2145
- //
2146
- //
2147
- //
2148
- //
2149
- //
2150
- //
2151
-
2152
-
2153
-
2154
-
2155
-
2156
-
2157
-
2158
-
2159
- var KeyCode = aria_utils_default.a.keys;
2160
-
2161
- var DefaultProps = {
2162
- expandTrigger: 'click', // or hover
2163
- multiple: false,
2164
- checkStrictly: false, // whether all nodes can be selected
2165
- emitPath: true, // wether to emit an array of all levels value in which node is located
2166
- lazy: false,
2167
- lazyLoad: util_["noop"],
2168
- value: 'value',
2169
- label: 'label',
2170
- children: 'children',
2171
- leaf: 'leaf',
2172
- disabled: 'disabled',
2173
- hoverThreshold: 500
2174
- };
2175
-
2176
- var cascader_panelvue_type_script_lang_js_isLeaf = function isLeaf(el) {
2177
- return !el.getAttribute('aria-owns');
2178
- };
2179
-
2180
- var getSibling = function getSibling(el, distance) {
2181
- var parentNode = el.parentNode;
2182
-
2183
- if (parentNode) {
2184
- var siblings = parentNode.querySelectorAll('.el-cascader-node[tabindex="-1"]');
2185
- var index = Array.prototype.indexOf.call(siblings, el);
2186
- return siblings[index + distance] || null;
2187
- }
2188
- return null;
2189
- };
2190
-
2191
- var getMenuIndex = function getMenuIndex(el, distance) {
2192
- if (!el) return;
2193
- var pieces = el.id.split('-');
2194
- return Number(pieces[pieces.length - 2]);
2195
- };
2196
-
2197
- var focusNode = function focusNode(el) {
2198
- if (!el) return;
2199
- el.focus();
2200
- !cascader_panelvue_type_script_lang_js_isLeaf(el) && el.click();
2201
- };
2202
-
2203
- var checkNode = function checkNode(el) {
2204
- if (!el) return;
2205
-
2206
- var input = el.querySelector('input');
2207
- if (input) {
2208
- input.click();
2209
- } else if (cascader_panelvue_type_script_lang_js_isLeaf(el)) {
2210
- el.click();
2211
- }
2212
- };
2213
-
2214
- /* harmony default export */ var cascader_panelvue_type_script_lang_js = ({
2215
- name: 'ElCascaderPanel',
2216
-
2217
- components: {
2218
- CascaderMenu: cascader_menu
2219
- },
2220
-
2221
- props: {
2222
- value: {},
2223
- options: Array,
2224
- props: Object,
2225
- border: {
2226
- type: Boolean,
2227
- default: true
2228
- },
2229
- renderLabel: Function
2230
- },
2231
-
2232
- provide: function provide() {
2233
- return {
2234
- panel: this
2235
- };
2236
- },
2237
- data: function data() {
2238
- return {
2239
- checkedValue: null,
2240
- checkedNodePaths: [],
2241
- store: [],
2242
- menus: [],
2243
- activePath: [],
2244
- loadCount: 0
2245
- };
2246
- },
2247
-
2248
-
2249
- computed: {
2250
- config: function config() {
2251
- return merge_default()(_extends({}, DefaultProps), this.props || {});
2252
- },
2253
- multiple: function multiple() {
2254
- return this.config.multiple;
2255
- },
2256
- checkStrictly: function checkStrictly() {
2257
- return this.config.checkStrictly;
2258
- },
2259
- leafOnly: function leafOnly() {
2260
- return !this.checkStrictly;
2261
- },
2262
- isHoverMenu: function isHoverMenu() {
2263
- return this.config.expandTrigger === 'hover';
2264
- },
2265
- renderLabelFn: function renderLabelFn() {
2266
- return this.renderLabel || this.$scopedSlots.default;
2267
- }
2268
- },
2269
-
2270
- watch: {
2271
- value: function value() {
2272
- this.syncCheckedValue();
2273
- this.checkStrictly && this.calculateCheckedNodePaths();
2274
- },
2275
-
2276
- options: {
2277
- handler: function handler() {
2278
- this.initStore();
2279
- },
2280
- immediate: true,
2281
- deep: true
2282
- },
2283
- checkedValue: function checkedValue(val) {
2284
- if (!Object(util_["isEqual"])(val, this.value)) {
2285
- this.checkStrictly && this.calculateCheckedNodePaths();
2286
- this.$emit('input', val);
2287
- this.$emit('change', val);
2288
- }
2289
- }
2290
- },
2291
-
2292
- mounted: function mounted() {
2293
- if (!this.isEmptyValue(this.value)) {
2294
- this.syncCheckedValue();
2295
- }
2296
- },
2297
-
2298
-
2299
- methods: {
2300
- initStore: function initStore() {
2301
- var config = this.config,
2302
- options = this.options;
2303
-
2304
- if (config.lazy && Object(util_["isEmpty"])(options)) {
2305
- this.lazyLoad();
2306
- } else {
2307
- this.store = new src_store(options, config);
2308
- this.menus = [this.store.getNodes()];
2309
- this.syncMenuState();
2310
- }
2311
- },
2312
- syncCheckedValue: function syncCheckedValue() {
2313
- var value = this.value,
2314
- checkedValue = this.checkedValue;
2315
-
2316
- if (!Object(util_["isEqual"])(value, checkedValue)) {
2317
- this.activePath = [];
2318
- this.checkedValue = value;
2319
- this.syncMenuState();
2320
- }
2321
- },
2322
- syncMenuState: function syncMenuState() {
2323
- var multiple = this.multiple,
2324
- checkStrictly = this.checkStrictly;
2325
-
2326
- this.syncActivePath();
2327
- multiple && this.syncMultiCheckState();
2328
- checkStrictly && this.calculateCheckedNodePaths();
2329
- this.$nextTick(this.scrollIntoView);
2330
- },
2331
- syncMultiCheckState: function syncMultiCheckState() {
2332
- var _this = this;
2333
-
2334
- var nodes = this.getFlattedNodes(this.leafOnly);
2335
-
2336
- nodes.forEach(function (node) {
2337
- node.syncCheckState(_this.checkedValue);
2338
- });
2339
- },
2340
- isEmptyValue: function isEmptyValue(val) {
2341
- var multiple = this.multiple,
2342
- config = this.config;
2343
- var emitPath = config.emitPath;
2344
-
2345
- if (multiple || emitPath) {
2346
- return Object(util_["isEmpty"])(val);
2347
- }
2348
- return false;
2349
- },
2350
- syncActivePath: function syncActivePath() {
2351
- var _this2 = this;
2352
-
2353
- var store = this.store,
2354
- multiple = this.multiple,
2355
- activePath = this.activePath,
2356
- checkedValue = this.checkedValue;
2357
-
2358
-
2359
- if (!Object(util_["isEmpty"])(activePath)) {
2360
- var nodes = activePath.map(function (node) {
2361
- return _this2.getNodeByValue(node.getValue());
2362
- });
2363
- this.expandNodes(nodes);
2364
- } else if (!this.isEmptyValue(checkedValue)) {
2365
- var value = multiple ? checkedValue[0] : checkedValue;
2366
- var checkedNode = this.getNodeByValue(value) || {};
2367
- var _nodes = (checkedNode.pathNodes || []).slice(0, -1);
2368
- this.expandNodes(_nodes);
2369
- } else {
2370
- this.activePath = [];
2371
- this.menus = [store.getNodes()];
2372
- }
2373
- },
2374
- expandNodes: function expandNodes(nodes) {
2375
- var _this3 = this;
2376
-
2377
- nodes.forEach(function (node) {
2378
- return _this3.handleExpand(node, true /* silent */);
2379
- });
2380
- },
2381
- calculateCheckedNodePaths: function calculateCheckedNodePaths() {
2382
- var _this4 = this;
2383
-
2384
- var checkedValue = this.checkedValue,
2385
- multiple = this.multiple;
2386
-
2387
- var checkedValues = multiple ? Object(util_["coerceTruthyValueToArray"])(checkedValue) : [checkedValue];
2388
- this.checkedNodePaths = checkedValues.map(function (v) {
2389
- var checkedNode = _this4.getNodeByValue(v);
2390
- return checkedNode ? checkedNode.pathNodes : [];
2391
- });
2392
- },
2393
- handleKeyDown: function handleKeyDown(e) {
2394
- var target = e.target,
2395
- keyCode = e.keyCode;
2396
-
2397
-
2398
- switch (keyCode) {
2399
- case KeyCode.up:
2400
- var prev = getSibling(target, -1);
2401
- focusNode(prev);
2402
- break;
2403
- case KeyCode.down:
2404
- var next = getSibling(target, 1);
2405
- focusNode(next);
2406
- break;
2407
- case KeyCode.left:
2408
- var preMenu = this.$refs.menu[getMenuIndex(target) - 1];
2409
- if (preMenu) {
2410
- var expandedNode = preMenu.$el.querySelector('.el-cascader-node[aria-expanded="true"]');
2411
- focusNode(expandedNode);
2412
- }
2413
- break;
2414
- case KeyCode.right:
2415
- var nextMenu = this.$refs.menu[getMenuIndex(target) + 1];
2416
- if (nextMenu) {
2417
- var firstNode = nextMenu.$el.querySelector('.el-cascader-node[tabindex="-1"]');
2418
- focusNode(firstNode);
2419
- }
2420
- break;
2421
- case KeyCode.enter:
2422
- checkNode(target);
2423
- break;
2424
- case KeyCode.esc:
2425
- case KeyCode.tab:
2426
- this.$emit('close');
2427
- break;
2428
- default:
2429
- return;
2430
- }
2431
- },
2432
- handleExpand: function handleExpand(node, silent) {
2433
- var activePath = this.activePath;
2434
- var level = node.level;
2435
-
2436
- var path = activePath.slice(0, level - 1);
2437
- var menus = this.menus.slice(0, level);
2438
-
2439
- if (!node.isLeaf) {
2440
- path.push(node);
2441
- menus.push(node.children);
2442
- }
2443
-
2444
- this.activePath = path;
2445
- this.menus = menus;
2446
-
2447
- if (!silent) {
2448
- var pathValues = path.map(function (node) {
2449
- return node.getValue();
2450
- });
2451
- var activePathValues = activePath.map(function (node) {
2452
- return node.getValue();
2453
- });
2454
- if (!Object(util_["valueEquals"])(pathValues, activePathValues)) {
2455
- this.$emit('active-item-change', pathValues); // Deprecated
2456
- this.$emit('expand-change', pathValues);
2457
- }
2458
- }
2459
- },
2460
- handleCheckChange: function handleCheckChange(value) {
2461
- this.checkedValue = value;
2462
- },
2463
- lazyLoad: function lazyLoad(node, onFullfiled) {
2464
- var _this5 = this;
2465
-
2466
- var config = this.config;
2467
-
2468
- if (!node) {
2469
- node = node || { root: true, level: 0 };
2470
- this.store = new src_store([], config);
2471
- this.menus = [this.store.getNodes()];
2472
- }
2473
- node.loading = true;
2474
- var resolve = function resolve(dataList) {
2475
- var parent = node.root ? null : node;
2476
- dataList && dataList.length && _this5.store.appendNodes(dataList, parent);
2477
- node.loading = false;
2478
- node.loaded = true;
2479
-
2480
- // dispose default value on lazy load mode
2481
- if (Array.isArray(_this5.checkedValue)) {
2482
- var nodeValue = _this5.checkedValue[_this5.loadCount++];
2483
- var valueKey = _this5.config.value;
2484
- var leafKey = _this5.config.leaf;
2485
-
2486
- if (Array.isArray(dataList) && dataList.filter(function (item) {
2487
- return item[valueKey] === nodeValue;
2488
- }).length > 0) {
2489
- var checkedNode = _this5.store.getNodeByValue(nodeValue);
2490
-
2491
- if (!checkedNode.data[leafKey]) {
2492
- _this5.lazyLoad(checkedNode, function () {
2493
- _this5.handleExpand(checkedNode);
2494
- });
2495
- }
2496
-
2497
- if (_this5.loadCount === _this5.checkedValue.length) {
2498
- _this5.$parent.computePresentText();
2499
- }
2500
- }
2501
- }
2502
-
2503
- onFullfiled && onFullfiled(dataList);
2504
- };
2505
- config.lazyLoad(node, resolve);
2506
- },
2507
-
2508
-
2509
- /**
2510
- * public methods
2511
- */
2512
- calculateMultiCheckedValue: function calculateMultiCheckedValue() {
2513
- this.checkedValue = this.getCheckedNodes(this.leafOnly).map(function (node) {
2514
- return node.getValueByOption();
2515
- });
2516
- },
2517
- scrollIntoView: function scrollIntoView() {
2518
- if (this.$isServer) return;
2519
-
2520
- var menus = this.$refs.menu || [];
2521
- menus.forEach(function (menu) {
2522
- var menuElement = menu.$el;
2523
- if (menuElement) {
2524
- var container = menuElement.querySelector('.el-scrollbar__wrap');
2525
- var activeNode = menuElement.querySelector('.el-cascader-node.is-active') || menuElement.querySelector('.el-cascader-node.in-active-path');
2526
- scroll_into_view_default()(container, activeNode);
2527
- }
2528
- });
2529
- },
2530
- getNodeByValue: function getNodeByValue(val) {
2531
- return this.store.getNodeByValue(val);
2532
- },
2533
- getFlattedNodes: function getFlattedNodes(leafOnly) {
2534
- var cached = !this.config.lazy;
2535
- return this.store.getFlattedNodes(leafOnly, cached);
2536
- },
2537
- getCheckedNodes: function getCheckedNodes(leafOnly) {
2538
- var checkedValue = this.checkedValue,
2539
- multiple = this.multiple;
2540
-
2541
- if (multiple) {
2542
- var nodes = this.getFlattedNodes(leafOnly);
2543
- return nodes.filter(function (node) {
2544
- return node.checked;
2545
- });
2546
- } else {
2547
- return this.isEmptyValue(checkedValue) ? [] : [this.getNodeByValue(checkedValue)];
2548
- }
2549
- },
2550
- clearCheckedNodes: function clearCheckedNodes() {
2551
- var config = this.config,
2552
- leafOnly = this.leafOnly;
2553
- var multiple = config.multiple,
2554
- emitPath = config.emitPath;
2555
-
2556
- if (multiple) {
2557
- this.getCheckedNodes(leafOnly).filter(function (node) {
2558
- return !node.isDisabled;
2559
- }).forEach(function (node) {
2560
- return node.doCheck(false);
2561
- });
2562
- this.calculateMultiCheckedValue();
2563
- } else {
2564
- this.checkedValue = emitPath ? [] : null;
2565
- }
2566
- }
2567
- }
2568
- });
2569
- // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js
2570
- /* harmony default export */ var src_cascader_panelvue_type_script_lang_js = (cascader_panelvue_type_script_lang_js);
2571
- // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue
2572
-
2573
-
2574
-
2575
-
2576
-
2577
- /* normalize component */
2578
-
2579
- var cascader_panel_component = Object(componentNormalizer["a" /* default */])(
2580
- src_cascader_panelvue_type_script_lang_js,
2581
- cascader_panelvue_type_template_id_09ca3ff1_render,
2582
- staticRenderFns,
2583
- false,
2584
- null,
2585
- null,
2586
- null
2587
-
2588
- )
2589
-
2590
- /* harmony default export */ var cascader_panel = (cascader_panel_component.exports);
2591
- // CONCATENATED MODULE: ./packages/cascader-panel/index.js
2592
-
2593
-
2594
- /* istanbul ignore next */
2595
- cascader_panel.install = function (Vue) {
2596
- Vue.component(cascader_panel.name, cascader_panel);
2597
- };
2598
-
2599
- /* harmony default export */ var packages_cascader_panel = __webpack_exports__["default"] = (cascader_panel);
2600
-
2601
- /***/ })
2602
- /******/ ]);