@panpanzhao/component-ui 0.0.9 → 0.0.10

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.
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 76);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 77);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,28 +192,28 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 62:
195
+ /***/ 31:
196
196
  /***/ (function(module, exports) {
197
197
 
198
198
  module.exports = require("element-ui/src/utils/popup");
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 63:
202
+ /***/ 32:
203
203
  /***/ (function(module, exports) {
204
204
 
205
- module.exports = require("element-ui/src/mixins/migrating");
205
+ module.exports = require("element-ui/src/mixins/emitter");
206
206
 
207
207
  /***/ }),
208
208
 
209
- /***/ 64:
209
+ /***/ 65:
210
210
  /***/ (function(module, exports) {
211
211
 
212
- module.exports = require("element-ui/src/mixins/emitter");
212
+ module.exports = require("element-ui/src/mixins/migrating");
213
213
 
214
214
  /***/ }),
215
215
 
216
- /***/ 76:
216
+ /***/ 77:
217
217
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
218
218
 
219
219
  "use strict";
@@ -336,15 +336,15 @@ render._withStripped = true
336
336
  // CONCATENATED MODULE: ./src/components/dialog/src/index.vue?vue&type=template&id=6ea89ba6&
337
337
 
338
338
  // EXTERNAL MODULE: external "element-ui/src/utils/popup"
339
- var popup_ = __webpack_require__(62);
339
+ var popup_ = __webpack_require__(31);
340
340
  var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
341
341
 
342
342
  // EXTERNAL MODULE: external "element-ui/src/mixins/migrating"
343
- var migrating_ = __webpack_require__(63);
343
+ var migrating_ = __webpack_require__(65);
344
344
  var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
345
345
 
346
346
  // EXTERNAL MODULE: external "element-ui/src/mixins/emitter"
347
- var emitter_ = __webpack_require__(64);
347
+ var emitter_ = __webpack_require__(32);
348
348
  var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
349
349
 
350
350
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dialog/src/index.vue?vue&type=script&lang=js&
@@ -0,0 +1,547 @@
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 = 78);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 1:
91
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
+
93
+ "use strict";
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
+ /* globals __VUE_SSR_CONTEXT__ */
96
+
97
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
98
+ // This module is a runtime utility for cleaner component module output and will
99
+ // be included in the final webpack user bundle.
100
+
101
+ function normalizeComponent(
102
+ scriptExports,
103
+ render,
104
+ staticRenderFns,
105
+ functionalTemplate,
106
+ injectStyles,
107
+ scopeId,
108
+ moduleIdentifier /* server only */,
109
+ shadowMode /* vue-cli only */
110
+ ) {
111
+ // Vue.extend constructor export interop
112
+ var options =
113
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
114
+
115
+ // render functions
116
+ if (render) {
117
+ options.render = render
118
+ options.staticRenderFns = staticRenderFns
119
+ options._compiled = true
120
+ }
121
+
122
+ // functional template
123
+ if (functionalTemplate) {
124
+ options.functional = true
125
+ }
126
+
127
+ // scopedId
128
+ if (scopeId) {
129
+ options._scopeId = 'data-v-' + scopeId
130
+ }
131
+
132
+ var hook
133
+ if (moduleIdentifier) {
134
+ // server build
135
+ hook = function (context) {
136
+ // 2.3 injection
137
+ context =
138
+ context || // cached call
139
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
140
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
141
+ // 2.2 with runInNewContext: true
142
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
143
+ context = __VUE_SSR_CONTEXT__
144
+ }
145
+ // inject component styles
146
+ if (injectStyles) {
147
+ injectStyles.call(this, context)
148
+ }
149
+ // register component module identifier for async chunk inferrence
150
+ if (context && context._registeredComponents) {
151
+ context._registeredComponents.add(moduleIdentifier)
152
+ }
153
+ }
154
+ // used by ssr in case component is cached and beforeCreate
155
+ // never gets called
156
+ options._ssrRegister = hook
157
+ } else if (injectStyles) {
158
+ hook = shadowMode
159
+ ? function () {
160
+ injectStyles.call(
161
+ this,
162
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
163
+ )
164
+ }
165
+ : injectStyles
166
+ }
167
+
168
+ if (hook) {
169
+ if (options.functional) {
170
+ // for template-only hot-reload because in that case the render fn doesn't
171
+ // go through the normalizer
172
+ options._injectStyles = hook
173
+ // register for functional component in vue file
174
+ var originalRender = options.render
175
+ options.render = function renderWithStyleInjection(h, context) {
176
+ hook.call(context)
177
+ return originalRender(h, context)
178
+ }
179
+ } else {
180
+ // inject component registration as beforeCreate hook
181
+ var existing = options.beforeCreate
182
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
183
+ }
184
+ }
185
+
186
+ return {
187
+ exports: scriptExports,
188
+ options: options
189
+ }
190
+ }
191
+
192
+
193
+ /***/ }),
194
+
195
+ /***/ 31:
196
+ /***/ (function(module, exports) {
197
+
198
+ module.exports = require("element-ui/src/utils/popup");
199
+
200
+ /***/ }),
201
+
202
+ /***/ 32:
203
+ /***/ (function(module, exports) {
204
+
205
+ module.exports = require("element-ui/src/mixins/emitter");
206
+
207
+ /***/ }),
208
+
209
+ /***/ 78:
210
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
211
+
212
+ "use strict";
213
+ // ESM COMPAT FLAG
214
+ __webpack_require__.r(__webpack_exports__);
215
+
216
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/drawer/src/index.vue?vue&type=template&id=6565c780&
217
+ var render = function render() {
218
+ var _vm = this,
219
+ _c = _vm._self._c
220
+ return _c(
221
+ "transition",
222
+ {
223
+ attrs: { name: "el-drawer-fade" },
224
+ on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave },
225
+ },
226
+ [
227
+ _c(
228
+ "div",
229
+ {
230
+ directives: [
231
+ {
232
+ name: "show",
233
+ rawName: "v-show",
234
+ value: _vm.visible,
235
+ expression: "visible",
236
+ },
237
+ ],
238
+ staticClass: "el-drawer__wrapper",
239
+ attrs: { tabindex: "-1" },
240
+ },
241
+ [
242
+ _c(
243
+ "div",
244
+ {
245
+ staticClass: "el-drawer__container",
246
+ class: _vm.visible && "el-drawer__open",
247
+ attrs: { role: "document", tabindex: "-1" },
248
+ on: {
249
+ click: function ($event) {
250
+ if ($event.target !== $event.currentTarget) return null
251
+ return _vm.handleWrapperClick.apply(null, arguments)
252
+ },
253
+ },
254
+ },
255
+ [
256
+ _c(
257
+ "div",
258
+ {
259
+ ref: "drawer",
260
+ staticClass: "el-drawer drawer",
261
+ class: [_vm.direction, _vm.customClass],
262
+ style: _vm.isHorizontal
263
+ ? `width: ${_vm.drawerSize}`
264
+ : `height: ${_vm.drawerSize}`,
265
+ attrs: {
266
+ "aria-modal": "true",
267
+ "aria-labelledby": "el-drawer__title",
268
+ "aria-label": _vm.title,
269
+ role: "dialog",
270
+ tabindex: "-1",
271
+ },
272
+ },
273
+ [
274
+ _vm.withHeader
275
+ ? _c(
276
+ "header",
277
+ {
278
+ staticClass: "el-drawer__header",
279
+ attrs: { id: "el-drawer__title" },
280
+ },
281
+ [
282
+ _vm._t("title", function () {
283
+ return [
284
+ _c(
285
+ "span",
286
+ {
287
+ attrs: { role: "heading", title: _vm.title },
288
+ },
289
+ [_vm._v(_vm._s(_vm.title))]
290
+ ),
291
+ ]
292
+ }),
293
+ _vm.showClose
294
+ ? _c(
295
+ "button",
296
+ {
297
+ staticClass: "el-drawer__close-btn",
298
+ attrs: {
299
+ "aria-label": `close ${
300
+ _vm.title || "drawer"
301
+ }`,
302
+ type: "button",
303
+ },
304
+ on: { click: _vm.closeDrawer },
305
+ },
306
+ [
307
+ _c("i", {
308
+ staticClass:
309
+ "el-dialog__close el-icon el-icon-close",
310
+ }),
311
+ ]
312
+ )
313
+ : _vm._e(),
314
+ ],
315
+ 2
316
+ )
317
+ : _vm._e(),
318
+ _vm.rendered
319
+ ? _c(
320
+ "section",
321
+ { staticClass: "el-drawer__body" },
322
+ [_vm._t("default")],
323
+ 2
324
+ )
325
+ : _vm._e(),
326
+ _vm.$slots.footer
327
+ ? _c(
328
+ "footer",
329
+ { staticClass: "el-drawer__footer" },
330
+ [_vm._t("footer")],
331
+ 2
332
+ )
333
+ : _vm._e(),
334
+ ]
335
+ ),
336
+ ]
337
+ ),
338
+ ]
339
+ ),
340
+ ]
341
+ )
342
+ }
343
+ var staticRenderFns = []
344
+ render._withStripped = true
345
+
346
+
347
+ // CONCATENATED MODULE: ./src/components/drawer/src/index.vue?vue&type=template&id=6565c780&
348
+
349
+ // EXTERNAL MODULE: external "element-ui/src/utils/popup"
350
+ var popup_ = __webpack_require__(31);
351
+ var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
352
+
353
+ // EXTERNAL MODULE: external "element-ui/src/mixins/emitter"
354
+ var emitter_ = __webpack_require__(32);
355
+ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
356
+
357
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/drawer/src/index.vue?vue&type=script&lang=js&
358
+
359
+
360
+ /* harmony default export */ var srcvue_type_script_lang_js_ = ({
361
+ name: 'Drawer',
362
+ mixins: [popup_default.a, emitter_default.a],
363
+ props: {
364
+ appendToBody: {
365
+ type: Boolean,
366
+ default: true
367
+ },
368
+ beforeClose: {
369
+ type: Function
370
+ },
371
+ customClass: {
372
+ type: String,
373
+ default: ''
374
+ },
375
+ closeOnPressEscape: {
376
+ type: Boolean,
377
+ default: true
378
+ },
379
+ destroyOnClose: {
380
+ type: Boolean,
381
+ default: false
382
+ },
383
+ modal: {
384
+ type: Boolean,
385
+ default: true
386
+ },
387
+ direction: {
388
+ type: String,
389
+ default: 'rtl',
390
+ validator: function validator(val) {
391
+ return ['ltr', 'rtl', 'ttb', 'btt'].indexOf(val) !== -1;
392
+ }
393
+ },
394
+ modalAppendToBody: {
395
+ type: Boolean,
396
+ default: true
397
+ },
398
+ showClose: {
399
+ type: Boolean,
400
+ default: true
401
+ },
402
+ size: {
403
+ type: [Number, String],
404
+ default: '30%'
405
+ },
406
+ title: {
407
+ type: String,
408
+ default: ''
409
+ },
410
+ visible: {
411
+ type: Boolean
412
+ },
413
+ wrapperClosable: {
414
+ type: Boolean,
415
+ default: true
416
+ },
417
+ withHeader: {
418
+ type: Boolean,
419
+ default: true
420
+ }
421
+ },
422
+ computed: {
423
+ isHorizontal: function isHorizontal() {
424
+ return this.direction === 'rtl' || this.direction === 'ltr';
425
+ },
426
+ drawerSize: function drawerSize() {
427
+ return typeof this.size === 'number' ? this.size + "px" : this.size;
428
+ }
429
+ },
430
+ data: function data() {
431
+ return {
432
+ closed: false,
433
+ prevActiveElement: null
434
+ };
435
+ },
436
+ watch: {
437
+ visible: function visible(val) {
438
+ var _this = this;
439
+ if (val) {
440
+ this.closed = false;
441
+ this.$emit('open');
442
+ if (this.appendToBody) {
443
+ document.body.appendChild(this.$el);
444
+ }
445
+ this.prevActiveElement = document.activeElement;
446
+ } else {
447
+ if (!this.closed) {
448
+ this.$emit('close');
449
+ if (this.destroyOnClose === true) {
450
+ this.rendered = false;
451
+ }
452
+ }
453
+ this.$nextTick(function () {
454
+ if (_this.prevActiveElement) {
455
+ _this.prevActiveElement.focus();
456
+ }
457
+ });
458
+ }
459
+ }
460
+ },
461
+ methods: {
462
+ afterEnter: function afterEnter() {
463
+ this.$emit('opened');
464
+ },
465
+ afterLeave: function afterLeave() {
466
+ this.$emit('closed');
467
+ },
468
+ hide: function hide(cancel) {
469
+ if (cancel !== false) {
470
+ this.$emit('update:visible', false);
471
+ this.$emit('close');
472
+ if (this.destroyOnClose === true) {
473
+ this.rendered = false;
474
+ }
475
+ this.closed = true;
476
+ }
477
+ },
478
+ handleWrapperClick: function handleWrapperClick() {
479
+ if (this.wrapperClosable) {
480
+ this.closeDrawer();
481
+ }
482
+ },
483
+ closeDrawer: function closeDrawer() {
484
+ if (typeof this.beforeClose === 'function') {
485
+ this.beforeClose(this.hide);
486
+ } else {
487
+ this.hide();
488
+ }
489
+ },
490
+ handleClose: function handleClose() {
491
+ // This method here will be called by PopupManger, when the `closeOnPressEscape` was set to true
492
+ // pressing `ESC` will call this method, and also close the drawer.
493
+ // This method also calls `beforeClose` if there was one.
494
+ this.closeDrawer();
495
+ }
496
+ },
497
+ mounted: function mounted() {
498
+ if (this.visible) {
499
+ this.rendered = true;
500
+ this.open();
501
+ if (this.appendToBody) {
502
+ document.body.appendChild(this.$el);
503
+ }
504
+ }
505
+ },
506
+ destroyed: function destroyed() {
507
+ // if appendToBody is true, remove DOM node after destroy
508
+ if (this.appendToBody && this.$el && this.$el.parentNode) {
509
+ this.$el.parentNode.removeChild(this.$el);
510
+ }
511
+ }
512
+ });
513
+ // CONCATENATED MODULE: ./src/components/drawer/src/index.vue?vue&type=script&lang=js&
514
+ /* harmony default export */ var drawer_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
515
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
516
+ var componentNormalizer = __webpack_require__(1);
517
+
518
+ // CONCATENATED MODULE: ./src/components/drawer/src/index.vue
519
+
520
+
521
+
522
+
523
+
524
+ /* normalize component */
525
+
526
+ var component = Object(componentNormalizer["a" /* default */])(
527
+ drawer_srcvue_type_script_lang_js_,
528
+ render,
529
+ staticRenderFns,
530
+ false,
531
+ null,
532
+ null,
533
+ null
534
+
535
+ )
536
+
537
+ /* harmony default export */ var src = (component.exports);
538
+ // CONCATENATED MODULE: ./src/components/drawer/index.js
539
+
540
+ src.install = function (Vue) {
541
+ Vue.component(src.name, src);
542
+ };
543
+ /* harmony default export */ var drawer = __webpack_exports__["default"] = (src);
544
+
545
+ /***/ })
546
+
547
+ /******/ });