@mdsfe/mds-ui 0.2.0

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 (153) hide show
  1. package/CHANGELOG.md +778 -0
  2. package/LICENSE +21 -0
  3. package/README.md +106 -0
  4. package/dist/_locale/index.js +18 -0
  5. package/dist/_locale/zh-CN.js +123 -0
  6. package/dist/_mixin/emitter.js +35 -0
  7. package/dist/_mixin/focus.js +13 -0
  8. package/dist/_mixin/locale.js +17 -0
  9. package/dist/_mixin/popper.js +192 -0
  10. package/dist/_mixin/tooltip.js +218 -0
  11. package/dist/_util/__test__/switchcase.test.js +43 -0
  12. package/dist/_util/autoprefixer.js +249 -0
  13. package/dist/_util/clickoutside.js +79 -0
  14. package/dist/_util/date.js +368 -0
  15. package/dist/_util/dateUtil.js +311 -0
  16. package/dist/_util/dom.js +240 -0
  17. package/dist/_util/getRequestAnimationFrame.js +50 -0
  18. package/dist/_util/getScroll.js +21 -0
  19. package/dist/_util/loaders/loaders.css.js +52 -0
  20. package/dist/_util/loaders/loading.js +53 -0
  21. package/dist/_util/merge.js +18 -0
  22. package/dist/_util/popper.js +1261 -0
  23. package/dist/_util/popup/index.js +232 -0
  24. package/dist/_util/popup/popup-manager.js +205 -0
  25. package/dist/_util/proptype.js +12 -0
  26. package/dist/_util/repeatClick.js +30 -0
  27. package/dist/_util/resize.js +61 -0
  28. package/dist/_util/resizeEvent.js +59 -0
  29. package/dist/_util/scrollIntoView.js +38 -0
  30. package/dist/_util/scrollbar-width.js +37 -0
  31. package/dist/_util/soda.js +54 -0
  32. package/dist/_util/switchcase.js +22 -0
  33. package/dist/_util/throttleByAnimationFrame.js +70 -0
  34. package/dist/_util/tree/node.js +412 -0
  35. package/dist/_util/tree/tree.js +410 -0
  36. package/dist/_util/util.js +166 -0
  37. package/dist/_util/vue-popper.js +213 -0
  38. package/dist/affix.js +509 -0
  39. package/dist/anchor.js +522 -0
  40. package/dist/avatar.js +437 -0
  41. package/dist/backtop.js +469 -0
  42. package/dist/badge.js +439 -0
  43. package/dist/bordershadow.js +310 -0
  44. package/dist/breadcrumb.js +434 -0
  45. package/dist/button.js +579 -0
  46. package/dist/card.js +514 -0
  47. package/dist/carousel.js +1326 -0
  48. package/dist/cascaderpanel.js +2320 -0
  49. package/dist/checkbox.js +681 -0
  50. package/dist/col.js +546 -0
  51. package/dist/collapse.js +671 -0
  52. package/dist/color.js +306 -0
  53. package/dist/datepicker.js +8089 -0
  54. package/dist/divider.js +346 -0
  55. package/dist/drawer.js +652 -0
  56. package/dist/dropdown.js +687 -0
  57. package/dist/empty.js +416 -0
  58. package/dist/font.js +306 -0
  59. package/dist/form.js +878 -0
  60. package/dist/icon.js +401 -0
  61. package/dist/index.js +1 -0
  62. package/dist/input.js +1251 -0
  63. package/dist/inputnumber.js +689 -0
  64. package/dist/layout.js +786 -0
  65. package/dist/list.js +789 -0
  66. package/dist/loading.js +430 -0
  67. package/dist/mds-ui.min.css +7 -0
  68. package/dist/mds-ui.min.js +64911 -0
  69. package/dist/menu.js +1131 -0
  70. package/dist/message.js +1016 -0
  71. package/dist/modal.js +895 -0
  72. package/dist/notification.js +818 -0
  73. package/dist/pagination.js +1213 -0
  74. package/dist/popconfirm.js +336 -0
  75. package/dist/popover.js +206 -0
  76. package/dist/progress.js +1023 -0
  77. package/dist/radio.js +760 -0
  78. package/dist/rate.js +765 -0
  79. package/dist/row.js +546 -0
  80. package/dist/select.js +4950 -0
  81. package/dist/slider.js +1411 -0
  82. package/dist/slottable.js +1414 -0
  83. package/dist/steps.js +546 -0
  84. package/dist/style/affix.css +5524 -0
  85. package/dist/style/anchor.css +5572 -0
  86. package/dist/style/avatar.css +5587 -0
  87. package/dist/style/backtop.css +34 -0
  88. package/dist/style/badge.css +5655 -0
  89. package/dist/style/bordershadow.css +5601 -0
  90. package/dist/style/breadcrumb.css +5551 -0
  91. package/dist/style/button.css +7679 -0
  92. package/dist/style/card.css +5670 -0
  93. package/dist/style/carousel.css +5731 -0
  94. package/dist/style/cascaderpanel.css +125 -0
  95. package/dist/style/checkbox.css +5700 -0
  96. package/dist/style/col.css +8121 -0
  97. package/dist/style/collapse.css +5593 -0
  98. package/dist/style/color.css +6136 -0
  99. package/dist/style/datepicker.css +5977 -0
  100. package/dist/style/divider.css +5558 -0
  101. package/dist/style/drawer.css +7979 -0
  102. package/dist/style/dropdown.css +7950 -0
  103. package/dist/style/empty.css +5563 -0
  104. package/dist/style/font.css +5559 -0
  105. package/dist/style/form.css +5662 -0
  106. package/dist/style/icon.css +5538 -0
  107. package/dist/style/input.css +6256 -0
  108. package/dist/style/inputnumber.css +5828 -0
  109. package/dist/style/layout.css +5572 -0
  110. package/dist/style/list.css +5655 -0
  111. package/dist/style/loading.css +5540 -0
  112. package/dist/style/menu.css +6183 -0
  113. package/dist/style/message.css +194 -0
  114. package/dist/style/modal.css +5637 -0
  115. package/dist/style/notification.css +5706 -0
  116. package/dist/style/pagination.css +6683 -0
  117. package/dist/style/popconfirm.css +7951 -0
  118. package/dist/style/popover.css +5727 -0
  119. package/dist/style/progress.css +5714 -0
  120. package/dist/style/radio.css +5769 -0
  121. package/dist/style/rate.css +5616 -0
  122. package/dist/style/row.css +8121 -0
  123. package/dist/style/select.css +5729 -0
  124. package/dist/style/slider.css +5594 -0
  125. package/dist/style/slottable.css +5831 -0
  126. package/dist/style/steps.css +6100 -0
  127. package/dist/style/switch.css +5624 -0
  128. package/dist/style/table.css +8392 -0
  129. package/dist/style/tabs.css +6047 -0
  130. package/dist/style/tag.css +5935 -0
  131. package/dist/style/text.css +5636 -0
  132. package/dist/style/timeline.css +5602 -0
  133. package/dist/style/timepicker.css +5904 -0
  134. package/dist/style/tooltip.css +5686 -0
  135. package/dist/style/transfer.css +101 -0
  136. package/dist/style/transition.css +1417 -0
  137. package/dist/style/tree.css +5598 -0
  138. package/dist/style/typography.css +5640 -0
  139. package/dist/style/upload.css +5834 -0
  140. package/dist/switch.js +448 -0
  141. package/dist/table.js +3809 -0
  142. package/dist/tabs.js +1273 -0
  143. package/dist/tag.js +478 -0
  144. package/dist/text.js +1100 -0
  145. package/dist/timeline.js +495 -0
  146. package/dist/timepicker.js +1567 -0
  147. package/dist/tooltip.js +179 -0
  148. package/dist/transfer.js +981 -0
  149. package/dist/transition.js +246 -0
  150. package/dist/tree.js +1866 -0
  151. package/dist/typography.js +469 -0
  152. package/dist/upload.js +1990 -0
  153. package/package.json +144 -0
@@ -0,0 +1,818 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("./icon"), require("vue"), require("./button"), require("./transition"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["./icon", "vue", "./button", "./transition"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("./icon"), require("vue"), require("./button"), require("./transition")) : factory(root["./icon"], root["Vue"], root["./button"], root["./transition"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(window, function(__WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__13__) {
11
+ return /******/ (function(modules) { // webpackBootstrap
12
+ /******/ // The module cache
13
+ /******/ var installedModules = {};
14
+ /******/
15
+ /******/ // The require function
16
+ /******/ function __webpack_require__(moduleId) {
17
+ /******/
18
+ /******/ // Check if module is in cache
19
+ /******/ if(installedModules[moduleId]) {
20
+ /******/ return installedModules[moduleId].exports;
21
+ /******/ }
22
+ /******/ // Create a new module (and put it into the cache)
23
+ /******/ var module = installedModules[moduleId] = {
24
+ /******/ i: moduleId,
25
+ /******/ l: false,
26
+ /******/ exports: {}
27
+ /******/ };
28
+ /******/
29
+ /******/ // Execute the module function
30
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
+ /******/
32
+ /******/ // Flag the module as loaded
33
+ /******/ module.l = true;
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /******/
40
+ /******/ // expose the modules object (__webpack_modules__)
41
+ /******/ __webpack_require__.m = modules;
42
+ /******/
43
+ /******/ // expose the module cache
44
+ /******/ __webpack_require__.c = installedModules;
45
+ /******/
46
+ /******/ // define getter function for harmony exports
47
+ /******/ __webpack_require__.d = function(exports, name, getter) {
48
+ /******/ if(!__webpack_require__.o(exports, name)) {
49
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
+ /******/ }
51
+ /******/ };
52
+ /******/
53
+ /******/ // define __esModule on exports
54
+ /******/ __webpack_require__.r = function(exports) {
55
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
+ /******/ }
58
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
+ /******/ };
60
+ /******/
61
+ /******/ // create a fake namespace object
62
+ /******/ // mode & 1: value is a module id, require it
63
+ /******/ // mode & 2: merge all properties of value into the ns
64
+ /******/ // mode & 4: return value when already ns object
65
+ /******/ // mode & 8|1: behave like require
66
+ /******/ __webpack_require__.t = function(value, mode) {
67
+ /******/ if(mode & 1) value = __webpack_require__(value);
68
+ /******/ if(mode & 8) return value;
69
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
+ /******/ var ns = Object.create(null);
71
+ /******/ __webpack_require__.r(ns);
72
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
+ /******/ return ns;
75
+ /******/ };
76
+ /******/
77
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
78
+ /******/ __webpack_require__.n = function(module) {
79
+ /******/ var getter = module && module.__esModule ?
80
+ /******/ function getDefault() { return module['default']; } :
81
+ /******/ function getModuleExports() { return module; };
82
+ /******/ __webpack_require__.d(getter, 'a', getter);
83
+ /******/ return getter;
84
+ /******/ };
85
+ /******/
86
+ /******/ // Object.prototype.hasOwnProperty.call
87
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
+ /******/
89
+ /******/ // __webpack_public_path__
90
+ /******/ __webpack_require__.p = "/dist/";
91
+ /******/
92
+ /******/
93
+ /******/ // Load entry module and return exports
94
+ /******/ return __webpack_require__(__webpack_require__.s = 101);
95
+ /******/ })
96
+ /************************************************************************/
97
+ /******/ ({
98
+
99
+ /***/ 0:
100
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
101
+
102
+ "use strict";
103
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
104
+ /* globals __VUE_SSR_CONTEXT__ */
105
+
106
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
107
+ // This module is a runtime utility for cleaner component module output and will
108
+ // be included in the final webpack user bundle.
109
+
110
+ function normalizeComponent (
111
+ scriptExports,
112
+ render,
113
+ staticRenderFns,
114
+ functionalTemplate,
115
+ injectStyles,
116
+ scopeId,
117
+ moduleIdentifier, /* server only */
118
+ shadowMode /* vue-cli only */
119
+ ) {
120
+ // Vue.extend constructor export interop
121
+ var options = typeof scriptExports === 'function'
122
+ ? scriptExports.options
123
+ : scriptExports
124
+
125
+ // render functions
126
+ if (render) {
127
+ options.render = render
128
+ options.staticRenderFns = staticRenderFns
129
+ options._compiled = true
130
+ }
131
+
132
+ // functional template
133
+ if (functionalTemplate) {
134
+ options.functional = true
135
+ }
136
+
137
+ // scopedId
138
+ if (scopeId) {
139
+ options._scopeId = 'data-v-' + scopeId
140
+ }
141
+
142
+ var hook
143
+ if (moduleIdentifier) { // server build
144
+ hook = function (context) {
145
+ // 2.3 injection
146
+ context =
147
+ context || // cached call
148
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
149
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
150
+ // 2.2 with runInNewContext: true
151
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
152
+ context = __VUE_SSR_CONTEXT__
153
+ }
154
+ // inject component styles
155
+ if (injectStyles) {
156
+ injectStyles.call(this, context)
157
+ }
158
+ // register component module identifier for async chunk inferrence
159
+ if (context && context._registeredComponents) {
160
+ context._registeredComponents.add(moduleIdentifier)
161
+ }
162
+ }
163
+ // used by ssr in case component is cached and beforeCreate
164
+ // never gets called
165
+ options._ssrRegister = hook
166
+ } else if (injectStyles) {
167
+ hook = shadowMode
168
+ ? function () {
169
+ injectStyles.call(
170
+ this,
171
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
172
+ )
173
+ }
174
+ : injectStyles
175
+ }
176
+
177
+ if (hook) {
178
+ if (options.functional) {
179
+ // for template-only hot-reload because in that case the render fn doesn't
180
+ // go through the normalizer
181
+ options._injectStyles = hook
182
+ // register for functional component in vue file
183
+ var originalRender = options.render
184
+ options.render = function renderWithStyleInjection (h, context) {
185
+ hook.call(context)
186
+ return originalRender(h, context)
187
+ }
188
+ } else {
189
+ // inject component registration as beforeCreate hook
190
+ var existing = options.beforeCreate
191
+ options.beforeCreate = existing
192
+ ? [].concat(existing, hook)
193
+ : [hook]
194
+ }
195
+ }
196
+
197
+ return {
198
+ exports: scriptExports,
199
+ options: options
200
+ }
201
+ }
202
+
203
+
204
+ /***/ }),
205
+
206
+ /***/ 101:
207
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
208
+
209
+ "use strict";
210
+ // ESM COMPAT FLAG
211
+ __webpack_require__.r(__webpack_exports__);
212
+
213
+ // EXTERNAL MODULE: ./components/style/index.less
214
+ var style = __webpack_require__(131);
215
+
216
+ // EXTERNAL MODULE: ./components/notification/style/index.less
217
+ var notification_style = __webpack_require__(185);
218
+
219
+ // CONCATENATED MODULE: ./components/notification/style/index.js
220
+
221
+
222
+ // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
223
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(5);
224
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
225
+
226
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/notification/notification.vue?vue&type=template&id=872f1938&
227
+ var render = function () {
228
+ var _obj
229
+ var _vm = this
230
+ var _h = _vm.$createElement
231
+ var _c = _vm._self._c || _h
232
+ return _c(
233
+ "mds-transition",
234
+ { attrs: { type: "slide", motion: _vm.moveFrom } },
235
+ [
236
+ _c(
237
+ "div",
238
+ {
239
+ directives: [
240
+ {
241
+ name: "show",
242
+ rawName: "v-show",
243
+ value: _vm.visible,
244
+ expression: "visible",
245
+ },
246
+ ],
247
+ class: [_vm.prefixCls + "-notice", _vm.prefixCls + "-closable"],
248
+ },
249
+ [
250
+ _c("div", { class: _vm.prefixCls + "-notice-content" }, [
251
+ _c(
252
+ "div",
253
+ {
254
+ class:
255
+ ((_obj = {}),
256
+ (_obj[_vm.prefixCls + "-notice-with-icon"] =
257
+ _vm.type || _vm.icon),
258
+ _obj),
259
+ },
260
+ [
261
+ _vm.type || _vm.icon
262
+ ? _c("mds-icon", {
263
+ class:
264
+ _vm.prefixCls +
265
+ "-notice-icon " +
266
+ _vm.prefixCls +
267
+ "-notice-icon-" +
268
+ _vm.type +
269
+ " " +
270
+ _vm.iconClass,
271
+ style: _vm.iconStyle,
272
+ attrs: { type: _vm.typeIcon },
273
+ })
274
+ : _vm._e(),
275
+ _c("div", { class: _vm.prefixCls + "-notice-title" }, [
276
+ _vm._v(_vm._s(_vm.title)),
277
+ ]),
278
+ _c(
279
+ "div",
280
+ {
281
+ directives: [
282
+ {
283
+ name: "show",
284
+ rawName: "v-show",
285
+ value: _vm.content,
286
+ expression: "content",
287
+ },
288
+ ],
289
+ class: _vm.prefixCls + "-notice-desc",
290
+ },
291
+ [
292
+ !_vm.useHTML
293
+ ? _c("p", [_vm._v(_vm._s(_vm.content))])
294
+ : _c("p", {
295
+ domProps: { innerHTML: _vm._s(_vm.content) },
296
+ }),
297
+ ]
298
+ ),
299
+ ],
300
+ 1
301
+ ),
302
+ _vm.btn
303
+ ? _c(
304
+ "div",
305
+ { class: _vm.prefixCls + "-notice-btn" },
306
+ [
307
+ _c(
308
+ "mds-button",
309
+ {
310
+ attrs: { type: _vm.btnType },
311
+ on: { click: _vm.handleOnClick },
312
+ },
313
+ [_vm._v(_vm._s(_vm.btn))]
314
+ ),
315
+ ],
316
+ 1
317
+ )
318
+ : _vm._e(),
319
+ ]),
320
+ _c(
321
+ "div",
322
+ {
323
+ directives: [
324
+ {
325
+ name: "show",
326
+ rawName: "v-show",
327
+ value: _vm.showClose,
328
+ expression: "showClose",
329
+ },
330
+ ],
331
+ class: _vm.prefixCls + "-notice-close-btn",
332
+ on: { click: _vm.handleClose },
333
+ },
334
+ [_c("mds-icon", { attrs: { type: "line-close" } })],
335
+ 1
336
+ ),
337
+ ]
338
+ ),
339
+ ]
340
+ )
341
+ }
342
+ var staticRenderFns = []
343
+ render._withStripped = true
344
+
345
+
346
+ // CONCATENATED MODULE: ./components/notification/notification.vue?vue&type=template&id=872f1938&
347
+
348
+ // EXTERNAL MODULE: external "./icon"
349
+ var external_icon_ = __webpack_require__(4);
350
+ var external_icon_default = /*#__PURE__*/__webpack_require__.n(external_icon_);
351
+
352
+ // EXTERNAL MODULE: external "./button"
353
+ var external_button_ = __webpack_require__(7);
354
+ var external_button_default = /*#__PURE__*/__webpack_require__.n(external_button_);
355
+
356
+ // EXTERNAL MODULE: external "./transition"
357
+ var external_transition_ = __webpack_require__(13);
358
+ var external_transition_default = /*#__PURE__*/__webpack_require__.n(external_transition_);
359
+
360
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/notification/notification.vue?vue&type=script&lang=js&
361
+ //
362
+ //
363
+ //
364
+ //
365
+ //
366
+ //
367
+ //
368
+ //
369
+ //
370
+ //
371
+ //
372
+ //
373
+ //
374
+ //
375
+ //
376
+ //
377
+ //
378
+ //
379
+ //
380
+ //
381
+ //
382
+ //
383
+ //
384
+ //
385
+ //
386
+ //
387
+ //
388
+ //
389
+ //
390
+ //
391
+ //
392
+ //
393
+ //
394
+ //
395
+ //
396
+ //
397
+
398
+
399
+
400
+
401
+ /* harmony default export */ var notificationvue_type_script_lang_js_ = ({
402
+ name: 'MdsNotification',
403
+ props: {
404
+ prefixCls: {
405
+ type: String,
406
+ default: 'mds-notification'
407
+ },
408
+ title: {
409
+ type: String,
410
+ default: '提示'
411
+ },
412
+ content: {
413
+ type: String,
414
+ default: '这是一个提示'
415
+ },
416
+ useHTML: {
417
+ type: Boolean,
418
+ default: false
419
+ },
420
+ duration: {
421
+ type: Number,
422
+ default: 4.5
423
+ },
424
+ onClose: {
425
+ type: Function
426
+ },
427
+ type: {
428
+ type: String,
429
+ default: ''
430
+ },
431
+ iconClass: {
432
+ type: String,
433
+ default: ''
434
+ },
435
+ icon: {
436
+ type: String,
437
+ default: ''
438
+ },
439
+ iconStyle: {
440
+ type: Object
441
+ },
442
+ btn: {
443
+ type: String,
444
+ default: ''
445
+ },
446
+ btnType: {
447
+ type: String,
448
+ validator: function validator(value) {
449
+ return ['primary', 'default', 'dashed', 'danger'].includes(value);
450
+ },
451
+
452
+ default: 'primary'
453
+ },
454
+ onClick: {
455
+ type: Function
456
+ },
457
+ showClose: {
458
+ type: Boolean,
459
+ default: true
460
+ },
461
+ moveFrom: {
462
+ type: String,
463
+ validator: function validator(value) {
464
+ return ['left', 'right'].includes(value);
465
+ }
466
+ }
467
+ },
468
+ data: function data() {
469
+ return {
470
+ visible: false,
471
+ closed: false,
472
+ timer: null,
473
+ test: false
474
+ };
475
+ },
476
+
477
+ computed: {
478
+ durationMS: function durationMS() {
479
+ return this.duration * 1000;
480
+ },
481
+ typeIcon: function typeIcon() {
482
+ var typeToIcon = {
483
+ info: 'line-info-circle',
484
+ success: 'fill-solid-right-circle',
485
+ error: 'fill-solid-wrong-circle',
486
+ warning: 'fill-solid-exclamation-circle'
487
+ };
488
+ if (this.type) return typeToIcon[this.type];else if (this.icon) return this.icon;
489
+ }
490
+ },
491
+ components: {
492
+ MdsIcon: external_icon_default.a,
493
+ MdsButton: external_button_default.a,
494
+ MdsTransition: external_transition_default.a
495
+ },
496
+ watch: {
497
+ closed: function closed(newVal) {
498
+ if (newVal) {
499
+ this.visible = false;
500
+ this.$el.parentNode && this.$el.parentNode.removeChild(this.$el);
501
+ }
502
+ }
503
+ },
504
+ methods: {
505
+ destroyElement: function destroyElement() {
506
+ this.$destroy(true);
507
+ this.$el.parentNode && this.$el.parentNode.removeChild(this.$el);
508
+ },
509
+ handleOnClick: function handleOnClick() {
510
+ if (this.onClick) {
511
+ this.onClick();
512
+ }
513
+ this.handleClose();
514
+ },
515
+ handleClose: function handleClose() {
516
+ this.closed = true;
517
+ this.onClose();
518
+ },
519
+ clearTimer: function clearTimer() {
520
+ this.test = true;
521
+ clearTimeout(this.timer);
522
+ },
523
+ startTimer: function startTimer() {
524
+ var _this = this;
525
+
526
+ this.test = false;
527
+ if (this.duration > 0) {
528
+ this.timer = setTimeout(function () {
529
+ if (!_this.closed) {
530
+ _this.handleClose();
531
+ }
532
+ }, this.durationMS);
533
+ }
534
+ }
535
+ },
536
+ mounted: function mounted() {
537
+ this.startTimer();
538
+ }
539
+ });
540
+ // CONCATENATED MODULE: ./components/notification/notification.vue?vue&type=script&lang=js&
541
+ /* harmony default export */ var notification_notificationvue_type_script_lang_js_ = (notificationvue_type_script_lang_js_);
542
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
543
+ var componentNormalizer = __webpack_require__(0);
544
+
545
+ // CONCATENATED MODULE: ./components/notification/notification.vue
546
+
547
+
548
+
549
+
550
+
551
+ /* normalize component */
552
+
553
+ var component = Object(componentNormalizer["a" /* default */])(
554
+ notification_notificationvue_type_script_lang_js_,
555
+ render,
556
+ staticRenderFns,
557
+ false,
558
+ null,
559
+ null,
560
+ null
561
+
562
+ )
563
+
564
+ /* hot reload */
565
+ if (false) { var api; }
566
+ component.options.__file = "components/notification/notification.vue"
567
+ /* harmony default export */ var notification = (component.exports);
568
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/notification/notification-box.vue?vue&type=template&id=0f7fb0e2&scoped=true&
569
+ var notification_boxvue_type_template_id_0f7fb0e2_scoped_true_render = function () {
570
+ var _vm = this
571
+ var _h = _vm.$createElement
572
+ var _c = _vm._self._c || _h
573
+ return _c(
574
+ "div",
575
+ { class: _vm.prefixCls + " " + _vm.prefixCls + "-" + _vm.placement },
576
+ [_c("span")]
577
+ )
578
+ }
579
+ var notification_boxvue_type_template_id_0f7fb0e2_scoped_true_staticRenderFns = []
580
+ notification_boxvue_type_template_id_0f7fb0e2_scoped_true_render._withStripped = true
581
+
582
+
583
+ // CONCATENATED MODULE: ./components/notification/notification-box.vue?vue&type=template&id=0f7fb0e2&scoped=true&
584
+
585
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/notification/notification-box.vue?vue&type=script&lang=js&
586
+ //
587
+ //
588
+ //
589
+ //
590
+ //
591
+ //
592
+ //
593
+
594
+ /* harmony default export */ var notification_boxvue_type_script_lang_js_ = ({
595
+ name: 'MdsNotificationBox',
596
+ props: {
597
+ prefixCls: {
598
+ type: String,
599
+ default: 'mds-notification'
600
+ },
601
+ placement: {
602
+ type: String,
603
+ validator: function validator(value) {
604
+ return ['topLeft', 'topRight', 'bottomRight', 'bottomLeft'].includes(value);
605
+ },
606
+
607
+ default: 'bottomRight'
608
+ }
609
+ }
610
+ });
611
+ // CONCATENATED MODULE: ./components/notification/notification-box.vue?vue&type=script&lang=js&
612
+ /* harmony default export */ var notification_notification_boxvue_type_script_lang_js_ = (notification_boxvue_type_script_lang_js_);
613
+ // EXTERNAL MODULE: ./components/notification/notification-box.vue?vue&type=style&index=0&id=0f7fb0e2&lang=less&scoped=true&
614
+ var notification_boxvue_type_style_index_0_id_0f7fb0e2_lang_less_scoped_true_ = __webpack_require__(73);
615
+
616
+ // CONCATENATED MODULE: ./components/notification/notification-box.vue
617
+
618
+
619
+
620
+
621
+
622
+
623
+ /* normalize component */
624
+
625
+ var notification_box_component = Object(componentNormalizer["a" /* default */])(
626
+ notification_notification_boxvue_type_script_lang_js_,
627
+ notification_boxvue_type_template_id_0f7fb0e2_scoped_true_render,
628
+ notification_boxvue_type_template_id_0f7fb0e2_scoped_true_staticRenderFns,
629
+ false,
630
+ null,
631
+ "0f7fb0e2",
632
+ null
633
+
634
+ )
635
+
636
+ /* hot reload */
637
+ if (false) { var notification_box_api; }
638
+ notification_box_component.options.__file = "components/notification/notification-box.vue"
639
+ /* harmony default export */ var notification_box = (notification_box_component.exports);
640
+ // CONCATENATED MODULE: ./components/notification/index.js
641
+ /*
642
+ * @Descripttion:
643
+ * @version:
644
+ * @Author: liangshuang
645
+ */
646
+
647
+
648
+
649
+
650
+
651
+
652
+ var NotificationBoxConstructor = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.extend(notification_box);
653
+ var NotificationConstructor = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.extend(notification);
654
+ var boxInstances = {};
655
+ var boxEls = {};
656
+ var notificationInstances = [];
657
+ var seed = 1;
658
+ var prefixCls = 'mds-notification';
659
+ var defaultPlacement = 'bottomRight'; // 位置
660
+ var defaultDuration = 4.5; // 延时时间
661
+ var getContainer = void 0;
662
+
663
+ var getBoxEl = function getBoxEl(opt) {
664
+ var placement = opt.placement;
665
+ boxInstances[placement] = boxInstances[placement] || new NotificationBoxConstructor({
666
+ propsData: {
667
+ prefixCls: prefixCls,
668
+ placement: placement
669
+ }
670
+ });
671
+ boxInstances[placement].vm = boxInstances[placement].$mount();
672
+ boxEls[placement] = boxInstances[placement].vm.$el;
673
+ if (getContainer) {
674
+ getContainer().appendChild(boxInstances[placement].vm.$el);
675
+ } else {
676
+ document.body.appendChild(boxInstances[placement].vm.$el);
677
+ }
678
+ return boxEls[placement];
679
+ };
680
+
681
+ var notice = function notice(opt) {
682
+ opt.duration = opt.duration !== undefined ? opt.duration : defaultDuration;
683
+ opt.placement = opt.placement || defaultPlacement;
684
+ var userOnClose = opt.onClose;
685
+ opt.onClose = function () {
686
+ notification_close(id, userOnClose);
687
+ };
688
+ opt.moveFrom = /Right$/.test(opt.placement) ? 'right' : 'left';
689
+ var boxEl = getBoxEl(opt);
690
+ var id = '' + prefixCls + seed++;
691
+ var notificationInstance = new NotificationConstructor({
692
+ propsData: opt
693
+ });
694
+ notificationInstance.id = id;
695
+ notificationInstance.vm = notificationInstance.$mount();
696
+ boxEl.querySelector('span').appendChild(notificationInstance.vm.$el);
697
+ notificationInstance.vm.visible = true;
698
+ notificationInstances.push(notificationInstance);
699
+ return function () {
700
+ notificationInstance.vm.visible = false;
701
+ };
702
+ };
703
+
704
+ var notification_close = function close(id, userOnClose) {
705
+ for (var i = 0, len = notificationInstances.length; i < len; i++) {
706
+ if (id === notificationInstances[i].id) {
707
+ if (typeof userOnClose === 'function') {
708
+ userOnClose(notificationInstances[i]);
709
+ }
710
+ notificationInstances.splice(i, 1);
711
+ break;
712
+ }
713
+ }
714
+ };
715
+ var notify = function notify(options) {
716
+ if (typeof options === 'string') {
717
+ options.content = options;
718
+ }
719
+ return notice(options);
720
+ };
721
+ ['info', 'success', 'error', 'warning'].forEach(function (type) {
722
+ notify[type] = function (opt) {
723
+ if (typeof opt === 'string') {
724
+ opt.content = opt;
725
+ }
726
+ opt.type = type;
727
+ return notice(opt);
728
+ };
729
+ });
730
+ notify.config = function (options) {
731
+ if (options.placement !== undefined) {
732
+ defaultPlacement = options.placement;
733
+ }
734
+ if (options.duration !== undefined) {
735
+ defaultDuration = options.duration;
736
+ }
737
+ if (options.prefixCls !== undefined) {
738
+ prefixCls = options.prefixCls;
739
+ }
740
+ if (options.getContainer !== undefined) {
741
+ getContainer = options.getContainer;
742
+ }
743
+ };
744
+ notify.destroy = function () {
745
+ for (var key in boxInstances) {
746
+ if (boxInstances[key]) {
747
+ boxInstances[key].vm.$destroy(true);
748
+ boxEls[key].parentNode.removeChild(boxEls[key]);
749
+ }
750
+ boxInstances[key] = null;
751
+ }
752
+ };
753
+ /* harmony default export */ var components_notification = __webpack_exports__["default"] = (notify);
754
+
755
+ /***/ }),
756
+
757
+ /***/ 13:
758
+ /***/ (function(module, exports) {
759
+
760
+ module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
761
+
762
+ /***/ }),
763
+
764
+ /***/ 131:
765
+ /***/ (function(module, exports) {
766
+
767
+ // removed by extract-text-webpack-plugin
768
+
769
+ /***/ }),
770
+
771
+ /***/ 185:
772
+ /***/ (function(module, exports) {
773
+
774
+ // removed by extract-text-webpack-plugin
775
+
776
+ /***/ }),
777
+
778
+ /***/ 187:
779
+ /***/ (function(module, exports) {
780
+
781
+ // removed by extract-text-webpack-plugin
782
+
783
+ /***/ }),
784
+
785
+ /***/ 4:
786
+ /***/ (function(module, exports) {
787
+
788
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4__;
789
+
790
+ /***/ }),
791
+
792
+ /***/ 5:
793
+ /***/ (function(module, exports) {
794
+
795
+ module.exports = __WEBPACK_EXTERNAL_MODULE__5__;
796
+
797
+ /***/ }),
798
+
799
+ /***/ 7:
800
+ /***/ (function(module, exports) {
801
+
802
+ module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
803
+
804
+ /***/ }),
805
+
806
+ /***/ 73:
807
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
808
+
809
+ "use strict";
810
+ /* harmony import */ var _node_modules_extract_text_webpack_plugin_dist_loader_js_ref_4_0_node_modules_style_loader_index_js_node_modules_css_loader_index_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_less_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_notification_box_vue_vue_type_style_index_0_id_0f7fb0e2_lang_less_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(187);
811
+ /* harmony import */ var _node_modules_extract_text_webpack_plugin_dist_loader_js_ref_4_0_node_modules_style_loader_index_js_node_modules_css_loader_index_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_less_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_notification_box_vue_vue_type_style_index_0_id_0f7fb0e2_lang_less_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_extract_text_webpack_plugin_dist_loader_js_ref_4_0_node_modules_style_loader_index_js_node_modules_css_loader_index_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_less_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_notification_box_vue_vue_type_style_index_0_id_0f7fb0e2_lang_less_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
812
+ /* unused harmony reexport * */
813
+
814
+
815
+ /***/ })
816
+
817
+ /******/ });
818
+ });