cy-element-ui 1.0.39 → 1.0.41

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 (119) hide show
  1. package/README.md +8 -7
  2. package/lib/alert.js +13 -31
  3. package/lib/aside.js +77 -84
  4. package/lib/autocomplete.js +3969 -268
  5. package/lib/avatar.js +108 -108
  6. package/lib/backtop.js +118 -136
  7. package/lib/badge.js +112 -133
  8. package/lib/breadcrumb-item.js +8 -21
  9. package/lib/breadcrumb.js +8 -14
  10. package/lib/button-group.js +8 -14
  11. package/lib/button.js +8 -33
  12. package/lib/calendar.js +1549 -109
  13. package/lib/card.js +96 -104
  14. package/lib/carousel-item.js +456 -135
  15. package/lib/carousel.js +191 -179
  16. package/lib/cascader-panel.js +2275 -209
  17. package/lib/cascader.js +6410 -349
  18. package/lib/checkbox-button.js +52 -62
  19. package/lib/checkbox-group.js +51 -20
  20. package/lib/checkbox.js +51 -75
  21. package/lib/col.js +2 -2
  22. package/lib/collapse-item.js +829 -170
  23. package/lib/collapse.js +112 -118
  24. package/lib/color-picker.js +3917 -258
  25. package/lib/container.js +88 -95
  26. package/lib/date-picker.js +8736 -4669
  27. package/lib/descriptions-item.js +2 -2
  28. package/lib/descriptions.js +63 -8
  29. package/lib/dialog.js +1213 -75
  30. package/lib/divider.js +104 -120
  31. package/lib/drawer.js +897 -173
  32. package/lib/dropdown-item.js +47 -31
  33. package/lib/dropdown-menu.js +2275 -81
  34. package/lib/dropdown.js +1072 -136
  35. package/lib/element-ui.common.js +910 -4903
  36. package/lib/empty.js +625 -169
  37. package/lib/fileUpload.js +3593 -520
  38. package/lib/footer.js +77 -84
  39. package/lib/form-item.js +450 -99
  40. package/lib/form.js +33 -28
  41. package/lib/header.js +77 -84
  42. package/lib/icon.js +67 -72
  43. package/lib/image.js +1400 -152
  44. package/lib/index.js +1 -1
  45. package/lib/infinite-scroll.js +311 -21
  46. package/lib/input-number.js +1438 -100
  47. package/lib/input.js +511 -151
  48. package/lib/link.js +9 -33
  49. package/lib/loading.js +808 -90
  50. package/lib/main.js +64 -71
  51. package/lib/menu-item-group.js +8 -20
  52. package/lib/menu-item.js +2912 -59
  53. package/lib/menu.js +745 -54
  54. package/lib/message-box.js +2556 -184
  55. package/lib/message.js +1117 -64
  56. package/lib/notification.js +1114 -67
  57. package/lib/option-group.js +47 -27
  58. package/lib/option.js +404 -43
  59. package/lib/page-header.js +683 -94
  60. package/lib/pagination.js +6078 -170
  61. package/lib/popconfirm.js +3514 -263
  62. package/lib/popover.js +2594 -93
  63. package/lib/progress.js +9 -62
  64. package/lib/radio-button.js +48 -55
  65. package/lib/radio-group.js +47 -26
  66. package/lib/radio.js +52 -67
  67. package/lib/rate.js +760 -152
  68. package/lib/result.js +39 -89
  69. package/lib/row.js +2 -2
  70. package/lib/scrollbar.js +735 -50
  71. package/lib/select.js +4294 -326
  72. package/lib/skeleton-item.js +13 -33
  73. package/lib/skeleton.js +116 -143
  74. package/lib/slider.js +4285 -254
  75. package/lib/spinner.js +100 -108
  76. package/lib/statistic.js +9627 -161
  77. package/lib/step.js +140 -186
  78. package/lib/steps.js +514 -111
  79. package/lib/subTitle.js +91 -100
  80. package/lib/submenu.js +2444 -123
  81. package/lib/switch.js +483 -67
  82. package/lib/tab-pane.js +10 -24
  83. package/lib/tabDialog.js +1548 -71
  84. package/lib/table-column.js +880 -32
  85. package/lib/table.js +4530 -744
  86. package/lib/tabs.js +432 -23
  87. package/lib/tag.js +4 -4
  88. package/lib/theme-chalk/gulpfile.js +27 -0
  89. package/lib/time-picker.js +5016 -566
  90. package/lib/time-select.js +4976 -313
  91. package/lib/timeline-item.js +114 -156
  92. package/lib/timeline.js +82 -82
  93. package/lib/tooltip.js +2566 -41
  94. package/lib/transfer.js +2143 -247
  95. package/lib/tree.js +1387 -180
  96. package/lib/treeSelect.js +3426 -153
  97. package/lib/upload.js +1154 -207
  98. package/package.json +10 -11
  99. package/packages/input-number/src/input-number.vue +7 -4
  100. package/packages/selectDisplayInput/index.js +8 -0
  101. package/packages/selectDisplayInput/src/main.vue +75 -0
  102. package/packages/theme-chalk/gulpfile.js +27 -0
  103. package/packages/theme-cy/gulpfile.js +27 -0
  104. package/packages/theme-cy/src/base.scss +3 -0
  105. package/packages/theme-cy/src/index.scss +1 -0
  106. package/packages/theme-cy/src/selectDisplayInput.scss +76 -0
  107. package/packages/theme-cy/src/treeSelect.scss +9 -4
  108. package/packages/treeSelect/src/main.vue +79 -0
  109. package/src/index.js +7 -4
  110. package/types/element-ui.d.ts +5 -1
  111. package/types/selectDisplayInput.d.ts +5 -0
  112. package/CHANGELOG.md +0 -280
  113. /package/{packages/theme-cy/lib → lib/theme-chalk}/base.css +0 -0
  114. /package/{packages/theme-cy/lib → lib/theme-chalk}/element.css +0 -0
  115. /package/{packages/theme-cy/lib → lib/theme-chalk}/fileUpload.css +0 -0
  116. /package/{packages/theme-cy/lib → lib/theme-chalk}/index.css +0 -0
  117. /package/{packages/theme-cy/lib → lib/theme-chalk}/subTitle.css +0 -0
  118. /package/{packages/theme-cy/lib → lib/theme-chalk}/tabDialog.css +0 -0
  119. /package/{packages/theme-cy/lib → lib/theme-chalk}/treeSelect.css +0 -0
package/lib/drawer.js CHANGED
@@ -82,128 +82,271 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 130);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 121);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
90
  /***/ 0:
91
+ /***/ (function(module, exports) {
92
+
93
+ module.exports = require("vue");
94
+
95
+ /***/ }),
96
+
97
+ /***/ 1:
91
98
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
99
 
93
100
  "use strict";
94
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
- /* globals __VUE_SSR_CONTEXT__ */
101
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
102
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
103
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
104
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
105
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
106
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
107
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
108
+ /* unused harmony export setStyle */
109
+ /* unused harmony export isScroll */
110
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
111
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
112
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
113
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
114
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
96
115
 
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.
116
+ /* istanbul ignore next */
100
117
 
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
118
 
115
- // render functions
116
- if (render) {
117
- options.render = render
118
- options.staticRenderFns = staticRenderFns
119
- options._compiled = true
120
- }
121
119
 
122
- // functional template
123
- if (functionalTemplate) {
124
- options.functional = true
125
- }
120
+ var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
121
+ var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
122
+ var MOZ_HACK_REGEXP = /^moz([A-Z])/;
123
+ var ieVersion = isServer ? 0 : Number(document.documentMode);
126
124
 
127
- // scopedId
128
- if (scopeId) {
129
- options._scopeId = 'data-v-' + scopeId
130
- }
125
+ /* istanbul ignore next */
126
+ var trim = function trim(string) {
127
+ return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
128
+ };
129
+ /* istanbul ignore next */
130
+ var camelCase = function camelCase(name) {
131
+ return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
132
+ return offset ? letter.toUpperCase() : letter;
133
+ }).replace(MOZ_HACK_REGEXP, 'Moz$1');
134
+ };
131
135
 
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
- }
136
+ /* istanbul ignore next */
137
+ var on = function () {
138
+ if (!isServer && document.addEventListener) {
139
+ return function (element, event, handler) {
140
+ if (element && event && handler) {
141
+ element.addEventListener(event, handler, false);
142
+ }
143
+ };
144
+ } else {
145
+ return function (element, event, handler) {
146
+ if (element && event && handler) {
147
+ element.attachEvent('on' + event, handler);
148
+ }
149
+ };
150
+ }
151
+ }();
167
152
 
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
- }
153
+ /* istanbul ignore next */
154
+ var off = function () {
155
+ if (!isServer && document.removeEventListener) {
156
+ return function (element, event, handler) {
157
+ if (element && event) {
158
+ element.removeEventListener(event, handler, false);
159
+ }
160
+ };
161
+ } else {
162
+ return function (element, event, handler) {
163
+ if (element && event) {
164
+ element.detachEvent('on' + event, handler);
165
+ }
166
+ };
167
+ }
168
+ }();
185
169
 
186
- return {
187
- exports: scriptExports,
188
- options: options
189
- }
190
- }
170
+ /* istanbul ignore next */
171
+ var once = function once(el, event, fn) {
172
+ var listener = function listener() {
173
+ if (fn) {
174
+ fn.apply(this, arguments);
175
+ }
176
+ off(el, event, listener);
177
+ };
178
+ on(el, event, listener);
179
+ };
180
+
181
+ /* istanbul ignore next */
182
+ function hasClass(el, cls) {
183
+ if (!el || !cls) return false;
184
+ if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
185
+ if (el.classList) {
186
+ return el.classList.contains(cls);
187
+ } else {
188
+ return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
189
+ }
190
+ };
191
191
 
192
+ /* istanbul ignore next */
193
+ function addClass(el, cls) {
194
+ if (!el) return;
195
+ var curClass = el.className;
196
+ var classes = (cls || '').split(' ');
197
+
198
+ for (var i = 0, j = classes.length; i < j; i++) {
199
+ var clsName = classes[i];
200
+ if (!clsName) continue;
201
+
202
+ if (el.classList) {
203
+ el.classList.add(clsName);
204
+ } else if (!hasClass(el, clsName)) {
205
+ curClass += ' ' + clsName;
206
+ }
207
+ }
208
+ if (!el.classList) {
209
+ el.setAttribute('class', curClass);
210
+ }
211
+ };
212
+
213
+ /* istanbul ignore next */
214
+ function removeClass(el, cls) {
215
+ if (!el || !cls) return;
216
+ var classes = cls.split(' ');
217
+ var curClass = ' ' + el.className + ' ';
218
+
219
+ for (var i = 0, j = classes.length; i < j; i++) {
220
+ var clsName = classes[i];
221
+ if (!clsName) continue;
222
+
223
+ if (el.classList) {
224
+ el.classList.remove(clsName);
225
+ } else if (hasClass(el, clsName)) {
226
+ curClass = curClass.replace(' ' + clsName + ' ', ' ');
227
+ }
228
+ }
229
+ if (!el.classList) {
230
+ el.setAttribute('class', trim(curClass));
231
+ }
232
+ };
233
+
234
+ /* istanbul ignore next */
235
+ var getStyle = ieVersion < 9 ? function (element, styleName) {
236
+ if (isServer) return;
237
+ if (!element || !styleName) return null;
238
+ styleName = camelCase(styleName);
239
+ if (styleName === 'float') {
240
+ styleName = 'styleFloat';
241
+ }
242
+ try {
243
+ switch (styleName) {
244
+ case 'opacity':
245
+ try {
246
+ return element.filters.item('alpha').opacity / 100;
247
+ } catch (e) {
248
+ return 1.0;
249
+ }
250
+ default:
251
+ return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
252
+ }
253
+ } catch (e) {
254
+ return element.style[styleName];
255
+ }
256
+ } : function (element, styleName) {
257
+ if (isServer) return;
258
+ if (!element || !styleName) return null;
259
+ styleName = camelCase(styleName);
260
+ if (styleName === 'float') {
261
+ styleName = 'cssFloat';
262
+ }
263
+ try {
264
+ var computed = document.defaultView.getComputedStyle(element, '');
265
+ return element.style[styleName] || computed ? computed[styleName] : null;
266
+ } catch (e) {
267
+ return element.style[styleName];
268
+ }
269
+ };
270
+
271
+ /* istanbul ignore next */
272
+ function setStyle(element, styleName, value) {
273
+ if (!element || !styleName) return;
274
+
275
+ if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
276
+ for (var prop in styleName) {
277
+ if (styleName.hasOwnProperty(prop)) {
278
+ setStyle(element, prop, styleName[prop]);
279
+ }
280
+ }
281
+ } else {
282
+ styleName = camelCase(styleName);
283
+ if (styleName === 'opacity' && ieVersion < 9) {
284
+ element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
285
+ } else {
286
+ element.style[styleName] = value;
287
+ }
288
+ }
289
+ };
290
+
291
+ var isScroll = function isScroll(el, vertical) {
292
+ if (isServer) return;
293
+
294
+ var determinedDirection = vertical !== null && vertical !== undefined;
295
+ var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
296
+
297
+ return overflow.match(/(scroll|auto|overlay)/);
298
+ };
299
+
300
+ var getScrollContainer = function getScrollContainer(el, vertical) {
301
+ if (isServer) return;
302
+
303
+ var parent = el;
304
+ while (parent) {
305
+ if ([window, document, document.documentElement].includes(parent)) {
306
+ return window;
307
+ }
308
+ if (isScroll(parent, vertical)) {
309
+ return parent;
310
+ }
311
+ parent = parent.parentNode;
312
+ }
313
+
314
+ return parent;
315
+ };
316
+
317
+ var isInContainer = function isInContainer(el, container) {
318
+ if (isServer || !el || !container) return false;
319
+
320
+ var elRect = el.getBoundingClientRect();
321
+ var containerRect = void 0;
322
+
323
+ if ([window, document, document.documentElement, null, undefined].includes(container)) {
324
+ containerRect = {
325
+ top: 0,
326
+ right: window.innerWidth,
327
+ bottom: window.innerHeight,
328
+ left: 0
329
+ };
330
+ } else {
331
+ containerRect = container.getBoundingClientRect();
332
+ }
333
+
334
+ return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
335
+ };
192
336
 
193
337
  /***/ }),
194
338
 
195
- /***/ 130:
339
+ /***/ 121:
196
340
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
341
 
198
342
  "use strict";
199
343
  // ESM COMPAT FLAG
200
344
  __webpack_require__.r(__webpack_exports__);
201
345
 
202
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/drawer/src/main.vue?vue&type=template&id=19f4c8a0
203
- var render = function () {
204
- var _vm = this
205
- var _h = _vm.$createElement
206
- var _c = _vm._self._c || _h
346
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/drawer/src/main.vue?vue&type=template&id=19f4c8a0
347
+ var render = function render() {
348
+ var _vm = this,
349
+ _c = _vm._self._c
207
350
  return _c(
208
351
  "transition",
209
352
  {
@@ -234,10 +377,8 @@ var render = function () {
234
377
  attrs: { role: "document", tabindex: "-1" },
235
378
  on: {
236
379
  click: function ($event) {
237
- if ($event.target !== $event.currentTarget) {
238
- return null
239
- }
240
- return _vm.handleWrapperClick($event)
380
+ if ($event.target !== $event.currentTarget) return null
381
+ return _vm.handleWrapperClick.apply(null, arguments)
241
382
  },
242
383
  },
243
384
  },
@@ -249,8 +390,8 @@ var render = function () {
249
390
  staticClass: "el-drawer",
250
391
  class: [_vm.direction, _vm.customClass],
251
392
  style: _vm.isHorizontal
252
- ? "width: " + _vm.drawerSize
253
- : "height: " + _vm.drawerSize,
393
+ ? `width: ${_vm.drawerSize}`
394
+ : `height: ${_vm.drawerSize}`,
254
395
  attrs: {
255
396
  "aria-modal": "true",
256
397
  "aria-labelledby": "el-drawer__title",
@@ -268,21 +409,26 @@ var render = function () {
268
409
  attrs: { id: "el-drawer__title" },
269
410
  },
270
411
  [
271
- _vm._t("title", [
272
- _c(
273
- "span",
274
- { attrs: { role: "heading", title: _vm.title } },
275
- [_vm._v(_vm._s(_vm.title))]
276
- ),
277
- ]),
412
+ _vm._t("title", function () {
413
+ return [
414
+ _c(
415
+ "span",
416
+ {
417
+ attrs: { role: "heading", title: _vm.title },
418
+ },
419
+ [_vm._v(_vm._s(_vm.title))]
420
+ ),
421
+ ]
422
+ }),
278
423
  _vm.showClose
279
424
  ? _c(
280
425
  "button",
281
426
  {
282
427
  staticClass: "el-drawer__close-btn",
283
428
  attrs: {
284
- "aria-label":
285
- "close " + (_vm.title || "drawer"),
429
+ "aria-label": `close ${
430
+ _vm.title || "drawer"
431
+ }`,
286
432
  type: "button",
287
433
  },
288
434
  on: { click: _vm.closeDrawer },
@@ -322,70 +468,20 @@ render._withStripped = true
322
468
 
323
469
  // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=template&id=19f4c8a0
324
470
 
325
- // EXTERNAL MODULE: external "element-ui/lib/utils/popup"
326
- var popup_ = __webpack_require__(14);
327
- var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
471
+ // EXTERNAL MODULE: ./src/utils/popup/index.js + 1 modules
472
+ var popup = __webpack_require__(9);
328
473
 
329
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
330
- var emitter_ = __webpack_require__(4);
331
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
474
+ // EXTERNAL MODULE: ./src/mixins/emitter.js
475
+ var emitter = __webpack_require__(6);
332
476
 
333
477
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/drawer/src/main.vue?vue&type=script&lang=js
334
- //
335
- //
336
- //
337
- //
338
- //
339
- //
340
- //
341
- //
342
- //
343
- //
344
- //
345
- //
346
- //
347
- //
348
- //
349
- //
350
- //
351
- //
352
- //
353
- //
354
- //
355
- //
356
- //
357
- //
358
- //
359
- //
360
- //
361
- //
362
- //
363
- //
364
- //
365
- //
366
- //
367
- //
368
- //
369
- //
370
- //
371
- //
372
- //
373
- //
374
- //
375
- //
376
- //
377
- //
378
- //
379
- //
380
- //
381
- //
382
478
 
383
479
 
384
480
 
385
481
 
386
482
  /* harmony default export */ var mainvue_type_script_lang_js = ({
387
483
  name: 'ElDrawer',
388
- mixins: [popup_default.a, emitter_default.a],
484
+ mixins: [popup["b" /* default */], emitter["a" /* default */]],
389
485
  props: {
390
486
  appendToBody: {
391
487
  type: Boolean,
@@ -541,7 +637,7 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
541
637
  // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=script&lang=js
542
638
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
543
639
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
544
- var componentNormalizer = __webpack_require__(0);
640
+ var componentNormalizer = __webpack_require__(2);
545
641
 
546
642
  // CONCATENATED MODULE: ./packages/drawer/src/main.vue
547
643
 
@@ -575,17 +671,645 @@ main.install = function (Vue) {
575
671
 
576
672
  /***/ }),
577
673
 
578
- /***/ 14:
579
- /***/ (function(module, exports) {
674
+ /***/ 2:
675
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
676
+
677
+ "use strict";
678
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
679
+ /* globals __VUE_SSR_CONTEXT__ */
680
+
681
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
682
+ // This module is a runtime utility for cleaner component module output and will
683
+ // be included in the final webpack user bundle.
684
+
685
+ function normalizeComponent(
686
+ scriptExports,
687
+ render,
688
+ staticRenderFns,
689
+ functionalTemplate,
690
+ injectStyles,
691
+ scopeId,
692
+ moduleIdentifier /* server only */,
693
+ shadowMode /* vue-cli only */
694
+ ) {
695
+ // Vue.extend constructor export interop
696
+ var options =
697
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
698
+
699
+ // render functions
700
+ if (render) {
701
+ options.render = render
702
+ options.staticRenderFns = staticRenderFns
703
+ options._compiled = true
704
+ }
705
+
706
+ // functional template
707
+ if (functionalTemplate) {
708
+ options.functional = true
709
+ }
710
+
711
+ // scopedId
712
+ if (scopeId) {
713
+ options._scopeId = 'data-v-' + scopeId
714
+ }
715
+
716
+ var hook
717
+ if (moduleIdentifier) {
718
+ // server build
719
+ hook = function (context) {
720
+ // 2.3 injection
721
+ context =
722
+ context || // cached call
723
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
724
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
725
+ // 2.2 with runInNewContext: true
726
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
727
+ context = __VUE_SSR_CONTEXT__
728
+ }
729
+ // inject component styles
730
+ if (injectStyles) {
731
+ injectStyles.call(this, context)
732
+ }
733
+ // register component module identifier for async chunk inferrence
734
+ if (context && context._registeredComponents) {
735
+ context._registeredComponents.add(moduleIdentifier)
736
+ }
737
+ }
738
+ // used by ssr in case component is cached and beforeCreate
739
+ // never gets called
740
+ options._ssrRegister = hook
741
+ } else if (injectStyles) {
742
+ hook = shadowMode
743
+ ? function () {
744
+ injectStyles.call(
745
+ this,
746
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
747
+ )
748
+ }
749
+ : injectStyles
750
+ }
751
+
752
+ if (hook) {
753
+ if (options.functional) {
754
+ // for template-only hot-reload because in that case the render fn doesn't
755
+ // go through the normalizer
756
+ options._injectStyles = hook
757
+ // register for functional component in vue file
758
+ var originalRender = options.render
759
+ options.render = function renderWithStyleInjection(h, context) {
760
+ hook.call(context)
761
+ return originalRender(h, context)
762
+ }
763
+ } else {
764
+ // inject component registration as beforeCreate hook
765
+ var existing = options.beforeCreate
766
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
767
+ }
768
+ }
769
+
770
+ return {
771
+ exports: scriptExports,
772
+ options: options
773
+ }
774
+ }
580
775
 
581
- module.exports = require("element-ui/lib/utils/popup");
582
776
 
583
777
  /***/ }),
584
778
 
585
- /***/ 4:
586
- /***/ (function(module, exports) {
779
+ /***/ 6:
780
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
781
+
782
+ "use strict";
783
+ function _broadcast(componentName, eventName, params) {
784
+ this.$children.forEach(function (child) {
785
+ var name = child.$options.componentName;
786
+
787
+ if (name === componentName) {
788
+ child.$emit.apply(child, [eventName].concat(params));
789
+ } else {
790
+ _broadcast.apply(child, [componentName, eventName].concat([params]));
791
+ }
792
+ });
793
+ }
794
+ /* harmony default export */ __webpack_exports__["a"] = ({
795
+ methods: {
796
+ dispatch: function dispatch(componentName, eventName, params) {
797
+ var parent = this.$parent || this.$root;
798
+ var name = parent.$options.componentName;
799
+
800
+ while (parent && (!name || name !== componentName)) {
801
+ parent = parent.$parent;
802
+
803
+ if (parent) {
804
+ name = parent.$options.componentName;
805
+ }
806
+ }
807
+ if (parent) {
808
+ parent.$emit.apply(parent, [eventName].concat(params));
809
+ }
810
+ },
811
+ broadcast: function broadcast(componentName, eventName, params) {
812
+ _broadcast.call(this, componentName, eventName, params);
813
+ }
814
+ }
815
+ });
816
+
817
+ /***/ }),
818
+
819
+ /***/ 7:
820
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
821
+
822
+ "use strict";
823
+ /* harmony default export */ __webpack_exports__["a"] = (function (target) {
824
+ for (var i = 1, j = arguments.length; i < j; i++) {
825
+ var source = arguments[i] || {};
826
+ for (var prop in source) {
827
+ if (source.hasOwnProperty(prop)) {
828
+ var value = source[prop];
829
+ if (value !== undefined) {
830
+ target[prop] = value;
831
+ }
832
+ }
833
+ }
834
+ }
835
+
836
+ return target;
837
+ });;
838
+
839
+ /***/ }),
840
+
841
+ /***/ 8:
842
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
843
+
844
+ "use strict";
845
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
846
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
847
+
848
+
849
+ var scrollBarWidth = void 0;
850
+
851
+ /* harmony default export */ __webpack_exports__["a"] = (function () {
852
+ if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0;
853
+ if (scrollBarWidth !== undefined) return scrollBarWidth;
854
+
855
+ var outer = document.createElement('div');
856
+ outer.className = 'el-scrollbar__wrap';
857
+ outer.style.visibility = 'hidden';
858
+ outer.style.width = '100px';
859
+ outer.style.position = 'absolute';
860
+ outer.style.top = '-9999px';
861
+ document.body.appendChild(outer);
862
+
863
+ var widthNoScroll = outer.offsetWidth;
864
+ outer.style.overflow = 'scroll';
865
+
866
+ var inner = document.createElement('div');
867
+ inner.style.width = '100%';
868
+ outer.appendChild(inner);
869
+
870
+ var widthWithScroll = inner.offsetWidth;
871
+ outer.parentNode.removeChild(outer);
872
+ scrollBarWidth = widthNoScroll - widthWithScroll;
873
+
874
+ return scrollBarWidth;
875
+ });;
876
+
877
+ /***/ }),
878
+
879
+ /***/ 9:
880
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
881
+
882
+ "use strict";
883
+
884
+ // EXPORTS
885
+ __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; });
886
+
887
+ // EXTERNAL MODULE: external "vue"
888
+ var external_vue_ = __webpack_require__(0);
889
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
890
+
891
+ // EXTERNAL MODULE: ./src/utils/merge.js
892
+ var merge = __webpack_require__(7);
893
+
894
+ // EXTERNAL MODULE: ./src/utils/dom.js
895
+ var utils_dom = __webpack_require__(1);
896
+
897
+ // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
898
+
899
+
900
+
901
+ var hasModal = false;
902
+ var hasInitZIndex = false;
903
+ var popup_manager_zIndex = void 0;
904
+
905
+ var popup_manager_getModal = function getModal() {
906
+ if (external_vue_default.a.prototype.$isServer) return;
907
+ var modalDom = PopupManager.modalDom;
908
+ if (modalDom) {
909
+ hasModal = true;
910
+ } else {
911
+ hasModal = false;
912
+ modalDom = document.createElement('div');
913
+ PopupManager.modalDom = modalDom;
914
+
915
+ modalDom.addEventListener('touchmove', function (event) {
916
+ event.preventDefault();
917
+ event.stopPropagation();
918
+ });
919
+
920
+ modalDom.addEventListener('click', function () {
921
+ PopupManager.doOnModalClick && PopupManager.doOnModalClick();
922
+ });
923
+ }
924
+
925
+ return modalDom;
926
+ };
927
+
928
+ var instances = {};
929
+
930
+ var PopupManager = {
931
+ modalFade: true,
932
+
933
+ getInstance: function getInstance(id) {
934
+ return instances[id];
935
+ },
936
+
937
+ register: function register(id, instance) {
938
+ if (id && instance) {
939
+ instances[id] = instance;
940
+ }
941
+ },
942
+
943
+ deregister: function deregister(id) {
944
+ if (id) {
945
+ instances[id] = null;
946
+ delete instances[id];
947
+ }
948
+ },
949
+
950
+ nextZIndex: function nextZIndex() {
951
+ return PopupManager.zIndex++;
952
+ },
953
+
954
+ modalStack: [],
955
+
956
+ doOnModalClick: function doOnModalClick() {
957
+ var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
958
+ if (!topItem) return;
959
+
960
+ var instance = PopupManager.getInstance(topItem.id);
961
+ if (instance && instance.closeOnClickModal) {
962
+ instance.close();
963
+ }
964
+ },
965
+
966
+ openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
967
+ if (external_vue_default.a.prototype.$isServer) return;
968
+ if (!id || zIndex === undefined) return;
969
+ this.modalFade = modalFade;
970
+
971
+ var modalStack = this.modalStack;
972
+
973
+ for (var i = 0, j = modalStack.length; i < j; i++) {
974
+ var item = modalStack[i];
975
+ if (item.id === id) {
976
+ return;
977
+ }
978
+ }
979
+
980
+ var modalDom = popup_manager_getModal();
981
+
982
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal');
983
+ if (this.modalFade && !hasModal) {
984
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter');
985
+ }
986
+ if (modalClass) {
987
+ var classArr = modalClass.trim().split(/\s+/);
988
+ classArr.forEach(function (item) {
989
+ return Object(utils_dom["a" /* addClass */])(modalDom, item);
990
+ });
991
+ }
992
+ setTimeout(function () {
993
+ Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter');
994
+ }, 200);
995
+
996
+ if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
997
+ dom.parentNode.appendChild(modalDom);
998
+ } else {
999
+ document.body.appendChild(modalDom);
1000
+ }
1001
+
1002
+ if (zIndex) {
1003
+ modalDom.style.zIndex = zIndex;
1004
+ }
1005
+ modalDom.tabIndex = 0;
1006
+ modalDom.style.display = '';
1007
+
1008
+ this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
1009
+ },
1010
+
1011
+ closeModal: function closeModal(id) {
1012
+ var modalStack = this.modalStack;
1013
+ var modalDom = popup_manager_getModal();
1014
+
1015
+ if (modalStack.length > 0) {
1016
+ var topItem = modalStack[modalStack.length - 1];
1017
+ if (topItem.id === id) {
1018
+ if (topItem.modalClass) {
1019
+ var classArr = topItem.modalClass.trim().split(/\s+/);
1020
+ classArr.forEach(function (item) {
1021
+ return Object(utils_dom["i" /* removeClass */])(modalDom, item);
1022
+ });
1023
+ }
1024
+
1025
+ modalStack.pop();
1026
+ if (modalStack.length > 0) {
1027
+ modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
1028
+ }
1029
+ } else {
1030
+ for (var i = modalStack.length - 1; i >= 0; i--) {
1031
+ if (modalStack[i].id === id) {
1032
+ modalStack.splice(i, 1);
1033
+ break;
1034
+ }
1035
+ }
1036
+ }
1037
+ }
1038
+
1039
+ if (modalStack.length === 0) {
1040
+ if (this.modalFade) {
1041
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave');
1042
+ }
1043
+ setTimeout(function () {
1044
+ if (modalStack.length === 0) {
1045
+ if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
1046
+ modalDom.style.display = 'none';
1047
+ PopupManager.modalDom = undefined;
1048
+ }
1049
+ Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave');
1050
+ }, 200);
1051
+ }
1052
+ }
1053
+ };
1054
+
1055
+ Object.defineProperty(PopupManager, 'zIndex', {
1056
+ configurable: true,
1057
+ get: function get() {
1058
+ if (!hasInitZIndex) {
1059
+ popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$ELEMENT || {}).zIndex || 2000;
1060
+ hasInitZIndex = true;
1061
+ }
1062
+ return popup_manager_zIndex;
1063
+ },
1064
+ set: function set(value) {
1065
+ popup_manager_zIndex = value;
1066
+ }
1067
+ });
1068
+
1069
+ var popup_manager_getTopPopup = function getTopPopup() {
1070
+ if (external_vue_default.a.prototype.$isServer) return;
1071
+ if (PopupManager.modalStack.length > 0) {
1072
+ var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
1073
+ if (!topPopup) return;
1074
+ var instance = PopupManager.getInstance(topPopup.id);
1075
+
1076
+ return instance;
1077
+ }
1078
+ };
1079
+
1080
+ if (!external_vue_default.a.prototype.$isServer) {
1081
+ // handle `esc` key when the popup is shown
1082
+ window.addEventListener('keydown', function (event) {
1083
+ if (event.keyCode === 27) {
1084
+ var topPopup = popup_manager_getTopPopup();
1085
+
1086
+ if (topPopup && topPopup.closeOnPressEscape) {
1087
+ topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
1088
+ }
1089
+ }
1090
+ });
1091
+ }
1092
+
1093
+ /* harmony default export */ var popup_manager = (PopupManager);
1094
+ // EXTERNAL MODULE: ./src/utils/scrollbar-width.js
1095
+ var scrollbar_width = __webpack_require__(8);
1096
+
1097
+ // CONCATENATED MODULE: ./src/utils/popup/index.js
1098
+
1099
+
1100
+
1101
+
1102
+
1103
+
1104
+ var idSeed = 1;
1105
+
1106
+ var scrollBarWidth = void 0;
1107
+
1108
+ /* harmony default export */ var popup = __webpack_exports__["b"] = ({
1109
+ props: {
1110
+ visible: {
1111
+ type: Boolean,
1112
+ default: false
1113
+ },
1114
+ openDelay: {},
1115
+ closeDelay: {},
1116
+ zIndex: {},
1117
+ modal: {
1118
+ type: Boolean,
1119
+ default: false
1120
+ },
1121
+ modalFade: {
1122
+ type: Boolean,
1123
+ default: true
1124
+ },
1125
+ modalClass: {},
1126
+ modalAppendToBody: {
1127
+ type: Boolean,
1128
+ default: false
1129
+ },
1130
+ lockScroll: {
1131
+ type: Boolean,
1132
+ default: true
1133
+ },
1134
+ closeOnPressEscape: {
1135
+ type: Boolean,
1136
+ default: false
1137
+ },
1138
+ closeOnClickModal: {
1139
+ type: Boolean,
1140
+ default: false
1141
+ }
1142
+ },
1143
+
1144
+ beforeMount: function beforeMount() {
1145
+ this._popupId = 'popup-' + idSeed++;
1146
+ popup_manager.register(this._popupId, this);
1147
+ },
1148
+ beforeDestroy: function beforeDestroy() {
1149
+ popup_manager.deregister(this._popupId);
1150
+ popup_manager.closeModal(this._popupId);
1151
+
1152
+ this.restoreBodyStyle();
1153
+ },
1154
+ data: function data() {
1155
+ return {
1156
+ opened: false,
1157
+ bodyPaddingRight: null,
1158
+ computedBodyPaddingRight: 0,
1159
+ withoutHiddenClass: true,
1160
+ rendered: false
1161
+ };
1162
+ },
1163
+
1164
+
1165
+ watch: {
1166
+ visible: function visible(val) {
1167
+ var _this = this;
1168
+
1169
+ if (val) {
1170
+ if (this._opening) return;
1171
+ if (!this.rendered) {
1172
+ this.rendered = true;
1173
+ external_vue_default.a.nextTick(function () {
1174
+ _this.open();
1175
+ });
1176
+ } else {
1177
+ this.open();
1178
+ }
1179
+ } else {
1180
+ this.close();
1181
+ }
1182
+ }
1183
+ },
1184
+
1185
+ methods: {
1186
+ open: function open(options) {
1187
+ var _this2 = this;
1188
+
1189
+ if (!this.rendered) {
1190
+ this.rendered = true;
1191
+ }
1192
+
1193
+ var props = Object(merge["a" /* default */])({}, this.$props || this, options);
1194
+
1195
+ if (this._closeTimer) {
1196
+ clearTimeout(this._closeTimer);
1197
+ this._closeTimer = null;
1198
+ }
1199
+ clearTimeout(this._openTimer);
1200
+
1201
+ var openDelay = Number(props.openDelay);
1202
+ if (openDelay > 0) {
1203
+ this._openTimer = setTimeout(function () {
1204
+ _this2._openTimer = null;
1205
+ _this2.doOpen(props);
1206
+ }, openDelay);
1207
+ } else {
1208
+ this.doOpen(props);
1209
+ }
1210
+ },
1211
+ doOpen: function doOpen(props) {
1212
+ if (this.$isServer) return;
1213
+ if (this.willOpen && !this.willOpen()) return;
1214
+ if (this.opened) return;
1215
+
1216
+ this._opening = true;
1217
+
1218
+ var dom = this.$el;
1219
+
1220
+ var modal = props.modal;
1221
+
1222
+ var zIndex = props.zIndex;
1223
+ if (zIndex) {
1224
+ popup_manager.zIndex = zIndex;
1225
+ }
1226
+
1227
+ if (modal) {
1228
+ if (this._closing) {
1229
+ popup_manager.closeModal(this._popupId);
1230
+ this._closing = false;
1231
+ }
1232
+ popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
1233
+ if (props.lockScroll) {
1234
+ this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'el-popup-parent--hidden');
1235
+ if (this.withoutHiddenClass) {
1236
+ this.bodyPaddingRight = document.body.style.paddingRight;
1237
+ this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10);
1238
+ }
1239
+ scrollBarWidth = Object(scrollbar_width["a" /* default */])();
1240
+ var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
1241
+ var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY');
1242
+ if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
1243
+ document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
1244
+ }
1245
+ Object(utils_dom["a" /* addClass */])(document.body, 'el-popup-parent--hidden');
1246
+ }
1247
+ }
1248
+
1249
+ if (getComputedStyle(dom).position === 'static') {
1250
+ dom.style.position = 'absolute';
1251
+ }
1252
+
1253
+ dom.style.zIndex = popup_manager.nextZIndex();
1254
+ this.opened = true;
1255
+
1256
+ this.onOpen && this.onOpen();
1257
+
1258
+ this.doAfterOpen();
1259
+ },
1260
+ doAfterOpen: function doAfterOpen() {
1261
+ this._opening = false;
1262
+ },
1263
+ close: function close() {
1264
+ var _this3 = this;
1265
+
1266
+ if (this.willClose && !this.willClose()) return;
1267
+
1268
+ if (this._openTimer !== null) {
1269
+ clearTimeout(this._openTimer);
1270
+ this._openTimer = null;
1271
+ }
1272
+ clearTimeout(this._closeTimer);
1273
+
1274
+ var closeDelay = Number(this.closeDelay);
1275
+
1276
+ if (closeDelay > 0) {
1277
+ this._closeTimer = setTimeout(function () {
1278
+ _this3._closeTimer = null;
1279
+ _this3.doClose();
1280
+ }, closeDelay);
1281
+ } else {
1282
+ this.doClose();
1283
+ }
1284
+ },
1285
+ doClose: function doClose() {
1286
+ this._closing = true;
1287
+
1288
+ this.onClose && this.onClose();
1289
+
1290
+ if (this.lockScroll) {
1291
+ setTimeout(this.restoreBodyStyle, 200);
1292
+ }
1293
+
1294
+ this.opened = false;
1295
+
1296
+ this.doAfterClose();
1297
+ },
1298
+ doAfterClose: function doAfterClose() {
1299
+ popup_manager.closeModal(this._popupId);
1300
+ this._closing = false;
1301
+ },
1302
+ restoreBodyStyle: function restoreBodyStyle() {
1303
+ if (this.modal && this.withoutHiddenClass) {
1304
+ document.body.style.paddingRight = this.bodyPaddingRight;
1305
+ Object(utils_dom["i" /* removeClass */])(document.body, 'el-popup-parent--hidden');
1306
+ }
1307
+ this.withoutHiddenClass = true;
1308
+ }
1309
+ }
1310
+ });
1311
+
587
1312
 
588
- module.exports = require("element-ui/lib/mixins/emitter");
589
1313
 
590
1314
  /***/ })
591
1315