@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,1016 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("./icon"), require("vue"), require("./button"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["./icon", "vue", "./button"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("./icon"), require("vue"), require("./button")) : factory(root["./icon"], root["Vue"], root["./button"]);
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__) {
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 = 88);
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
+ /***/ 179:
207
+ /***/ (function(module, exports) {
208
+
209
+ // removed by extract-text-webpack-plugin
210
+
211
+ /***/ }),
212
+
213
+ /***/ 181:
214
+ /***/ (function(module, exports) {
215
+
216
+ // removed by extract-text-webpack-plugin
217
+
218
+ /***/ }),
219
+
220
+ /***/ 4:
221
+ /***/ (function(module, exports) {
222
+
223
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4__;
224
+
225
+ /***/ }),
226
+
227
+ /***/ 5:
228
+ /***/ (function(module, exports) {
229
+
230
+ module.exports = __WEBPACK_EXTERNAL_MODULE__5__;
231
+
232
+ /***/ }),
233
+
234
+ /***/ 7:
235
+ /***/ (function(module, exports) {
236
+
237
+ module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
238
+
239
+ /***/ }),
240
+
241
+ /***/ 88:
242
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
243
+
244
+ "use strict";
245
+ // ESM COMPAT FLAG
246
+ __webpack_require__.r(__webpack_exports__);
247
+
248
+ // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
249
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(5);
250
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
251
+
252
+ // EXTERNAL MODULE: ./components/style/themes/default.less
253
+ var themes_default = __webpack_require__(179);
254
+
255
+ // EXTERNAL MODULE: ./components/message/style/index.less
256
+ var style = __webpack_require__(181);
257
+
258
+ // CONCATENATED MODULE: ./components/message/style/index.js
259
+
260
+
261
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/message/message-box.vue?vue&type=template&id=6bac7792&
262
+ var render = function () {
263
+ var _vm = this
264
+ var _h = _vm.$createElement
265
+ var _c = _vm._self._c || _h
266
+ return _c("div", { class: _vm.prefixCls, style: _vm.styles })
267
+ }
268
+ var staticRenderFns = []
269
+ render._withStripped = true
270
+
271
+
272
+ // CONCATENATED MODULE: ./components/message/message-box.vue?vue&type=template&id=6bac7792&
273
+
274
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/message/message-box.vue?vue&type=script&lang=js&
275
+ //
276
+ //
277
+ //
278
+ //
279
+
280
+ /* harmony default export */ var message_boxvue_type_script_lang_js_ = ({
281
+ name: 'MdsMessageBox',
282
+ props: {
283
+ prefixCls: {
284
+ type: String,
285
+ default: 'mds-message-box'
286
+ },
287
+ styles: {
288
+ type: Object,
289
+ default: function _default() {
290
+ return {};
291
+ }
292
+ }
293
+ }
294
+ });
295
+ // CONCATENATED MODULE: ./components/message/message-box.vue?vue&type=script&lang=js&
296
+ /* harmony default export */ var message_message_boxvue_type_script_lang_js_ = (message_boxvue_type_script_lang_js_);
297
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
298
+ var componentNormalizer = __webpack_require__(0);
299
+
300
+ // CONCATENATED MODULE: ./components/message/message-box.vue
301
+
302
+
303
+
304
+
305
+
306
+ /* normalize component */
307
+
308
+ var component = Object(componentNormalizer["a" /* default */])(
309
+ message_message_boxvue_type_script_lang_js_,
310
+ render,
311
+ staticRenderFns,
312
+ false,
313
+ null,
314
+ null,
315
+ null
316
+
317
+ )
318
+
319
+ /* hot reload */
320
+ if (false) { var api; }
321
+ component.options.__file = "components/message/message-box.vue"
322
+ /* harmony default export */ var message_box = (component.exports);
323
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/message/message.vue?vue&type=template&id=dc37dbd8&
324
+ var messagevue_type_template_id_dc37dbd8_render = function () {
325
+ var _vm = this
326
+ var _h = _vm.$createElement
327
+ var _c = _vm._self._c || _h
328
+ return _c(
329
+ "div",
330
+ {
331
+ directives: [
332
+ {
333
+ name: "show",
334
+ rawName: "v-show",
335
+ value: _vm.visible,
336
+ expression: "visible",
337
+ },
338
+ ],
339
+ class: _vm.prefixCls + "-notice",
340
+ },
341
+ [
342
+ _c(
343
+ "div",
344
+ {
345
+ class: [{ link: _vm.showLink }, _vm.prefixCls + "-notice-content"],
346
+ style: _vm.defaultStyle,
347
+ },
348
+ [
349
+ _c(
350
+ "div",
351
+ {
352
+ class: _vm.prefixCls + "-" + _vm.type,
353
+ on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer },
354
+ },
355
+ [
356
+ _vm.type === "loading"
357
+ ? [
358
+ _c("mds-icon", {
359
+ staticStyle: { fontSize: "16px", "margin-right": "5px" },
360
+ attrs: { type: _vm.iconType, spin: "" },
361
+ }),
362
+ ]
363
+ : [
364
+ _c("mds-icon", {
365
+ staticStyle: { fontSize: "16px", "margin-right": "5px" },
366
+ attrs: { type: _vm.iconType },
367
+ }),
368
+ ],
369
+ _c("span", [_vm._v(_vm._s(_vm.content))]),
370
+ ],
371
+ 2
372
+ ),
373
+ _c(
374
+ "div",
375
+ {
376
+ directives: [
377
+ {
378
+ name: "show",
379
+ rawName: "v-show",
380
+ value: _vm.showClose && !_vm.showLink,
381
+ expression: "showClose && !showLink",
382
+ },
383
+ ],
384
+ class: _vm.prefixCls + "-close",
385
+ on: { click: _vm.handleClose },
386
+ },
387
+ [_c("mds-icon", { attrs: { type: "line-close" } })],
388
+ 1
389
+ ),
390
+ _c(
391
+ "a",
392
+ {
393
+ directives: [
394
+ {
395
+ name: "show",
396
+ rawName: "v-show",
397
+ value: _vm.showLink,
398
+ expression: "showLink",
399
+ },
400
+ ],
401
+ class: [
402
+ _vm.prefixCls + "-" + _vm.type + "-link",
403
+ _vm.prefixCls + "-link",
404
+ ],
405
+ attrs: { href: _vm.showLink },
406
+ },
407
+ [_vm._v("查看信息")]
408
+ ),
409
+ ]
410
+ ),
411
+ ]
412
+ )
413
+ }
414
+ var messagevue_type_template_id_dc37dbd8_staticRenderFns = []
415
+ messagevue_type_template_id_dc37dbd8_render._withStripped = true
416
+
417
+
418
+ // CONCATENATED MODULE: ./components/message/message.vue?vue&type=template&id=dc37dbd8&
419
+
420
+ // EXTERNAL MODULE: external "./button"
421
+ var external_button_ = __webpack_require__(7);
422
+ var external_button_default = /*#__PURE__*/__webpack_require__.n(external_button_);
423
+
424
+ // EXTERNAL MODULE: external "./icon"
425
+ var external_icon_ = __webpack_require__(4);
426
+ var external_icon_default = /*#__PURE__*/__webpack_require__.n(external_icon_);
427
+
428
+ // CONCATENATED MODULE: ./components/message/props.js
429
+ /* harmony default export */ var props = ({
430
+ props: {
431
+ content: {
432
+ default: ''
433
+ },
434
+ duration: {
435
+ type: Number,
436
+ default: 3
437
+ },
438
+ onClose: {
439
+ type: Function,
440
+ default: function _default() {}
441
+ },
442
+ prefixCls: {
443
+ type: String,
444
+ default: 'mds-message'
445
+ },
446
+ type: {
447
+ type: String,
448
+ validator: function validator(value) {
449
+ // 这个值必须匹配下列字符串中的一个
450
+ return ['info', 'success', 'error', 'warning', 'loading'].indexOf(value) !== -1;
451
+ },
452
+ default: 'info'
453
+ },
454
+ showClose: {
455
+ type: Boolean,
456
+ default: false
457
+ },
458
+ showLink: {
459
+ type: String,
460
+ default: ''
461
+ }
462
+ }
463
+ });
464
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/message/message.vue?vue&type=script&lang=js&
465
+ //
466
+ //
467
+ //
468
+ //
469
+ //
470
+ //
471
+ //
472
+ //
473
+ //
474
+ //
475
+ //
476
+ //
477
+ //
478
+ //
479
+ //
480
+ //
481
+ //
482
+ //
483
+ //
484
+ //
485
+ //
486
+ //
487
+ //
488
+ //
489
+ //
490
+ //
491
+
492
+
493
+
494
+
495
+ var ICONTYPES = {
496
+ info: 'line-info-circle',
497
+ success: 'fill-solid-right-circle',
498
+ error: 'fill-solid-wrong-circle',
499
+ warning: 'fill-solid-exclamation-circle',
500
+ loading: 'line-spinner'
501
+ };
502
+ /* harmony default export */ var messagevue_type_script_lang_js_ = ({
503
+ name: 'MdsMessage',
504
+ mixins: [props],
505
+ data: function data() {
506
+ return {
507
+ visible: false,
508
+ closed: false,
509
+ timer: null,
510
+ test: false
511
+ };
512
+ },
513
+
514
+ computed: {
515
+ durationMS: function durationMS() {
516
+ return this.duration * 1000;
517
+ },
518
+ iconType: function iconType() {
519
+ return ICONTYPES[this.type];
520
+ },
521
+ defaultStyle: function defaultStyle() {
522
+ return this.style;
523
+ }
524
+ },
525
+ components: { MdsIcon: external_icon_default.a, MdsButton: external_button_default.a },
526
+ watch: {
527
+ closed: function closed(newVal) {
528
+ if (newVal) {
529
+ this.visible = false;
530
+ }
531
+ }
532
+ },
533
+ methods: {
534
+ /**
535
+ * @description: 销毁
536
+ * @param {type}
537
+ * @return:
538
+ */
539
+
540
+ destroyElement: function destroyElement() {
541
+ this.$destroy(true);
542
+ this.closed = true;
543
+ this.$el.parentNode && this.$el.parentNode.removeChild(this.$el);
544
+ },
545
+
546
+ /**
547
+ * @description: 关闭
548
+ * @param {type}
549
+ * @return:
550
+ */
551
+
552
+ handleClose: function handleClose() {
553
+ this.closed = true;
554
+ this.onClose();
555
+ this.$el.parentNode && this.$el.parentNode.removeChild(this.$el);
556
+ },
557
+
558
+ /**
559
+ * @description: 清除setTimeout计时
560
+ * @param {type}
561
+ * @return:
562
+ */
563
+ clearTimer: function clearTimer() {
564
+ clearTimeout(this.timer);
565
+ this.test = true;
566
+ },
567
+
568
+ /**
569
+ * @description:
570
+ * @param {type} 开始计时删除
571
+ * @return:
572
+ */
573
+ startTimer: function startTimer() {
574
+ var _this = this;
575
+
576
+ this.test = false;
577
+ if (this.duration > 0) {
578
+ this.timer = setTimeout(function () {
579
+ if (!_this.closed) {
580
+ _this.handleClose();
581
+ }
582
+ }, this.durationMS);
583
+ }
584
+ }
585
+ },
586
+ mounted: function mounted() {
587
+ this.startTimer();
588
+ }
589
+ });
590
+ // CONCATENATED MODULE: ./components/message/message.vue?vue&type=script&lang=js&
591
+ /* harmony default export */ var message_messagevue_type_script_lang_js_ = (messagevue_type_script_lang_js_);
592
+ // CONCATENATED MODULE: ./components/message/message.vue
593
+
594
+
595
+
596
+
597
+
598
+ /* normalize component */
599
+
600
+ var message_component = Object(componentNormalizer["a" /* default */])(
601
+ message_messagevue_type_script_lang_js_,
602
+ messagevue_type_template_id_dc37dbd8_render,
603
+ messagevue_type_template_id_dc37dbd8_staticRenderFns,
604
+ false,
605
+ null,
606
+ null,
607
+ null
608
+
609
+ )
610
+
611
+ /* hot reload */
612
+ if (false) { var message_api; }
613
+ message_component.options.__file = "components/message/message.vue"
614
+ /* harmony default export */ var message = (message_component.exports);
615
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/message/message-size.vue?vue&type=template&id=8e7dc96c&
616
+ var message_sizevue_type_template_id_8e7dc96c_render = function () {
617
+ var _vm = this
618
+ var _h = _vm.$createElement
619
+ var _c = _vm._self._c || _h
620
+ return _c(
621
+ "div",
622
+ {
623
+ directives: [
624
+ {
625
+ name: "show",
626
+ rawName: "v-show",
627
+ value: _vm.visible,
628
+ expression: "visible",
629
+ },
630
+ ],
631
+ class: _vm.prefixCls + "-notice",
632
+ },
633
+ [
634
+ _c("div", { class: _vm.prefixCls + "-notice-content" }, [
635
+ _c(
636
+ "div",
637
+ {
638
+ class:
639
+ _vm.prefixCls +
640
+ "-" +
641
+ _vm.type +
642
+ " " +
643
+ _vm.prefixCls +
644
+ "-" +
645
+ _vm.type +
646
+ "-size",
647
+ on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer },
648
+ },
649
+ [
650
+ _c(
651
+ "div",
652
+ { class: _vm.prefixCls + "-" + _vm.type + "-size-title" },
653
+ [
654
+ _c("mds-icon", {
655
+ class: _vm.prefixCls + "-" + _vm.type + "-size-icon",
656
+ attrs: { type: _vm.iconType },
657
+ }),
658
+ _c("span", [_vm._v(_vm._s(_vm.title || _vm.defaultTitle))]),
659
+ ],
660
+ 1
661
+ ),
662
+ _c(
663
+ "div",
664
+ { class: _vm.prefixCls + "-" + _vm.type + "-size-content" },
665
+ [_vm._v(_vm._s(_vm.content))]
666
+ ),
667
+ ]
668
+ ),
669
+ _c(
670
+ "div",
671
+ {
672
+ directives: [
673
+ {
674
+ name: "show",
675
+ rawName: "v-show",
676
+ value: _vm.showClose && !_vm.showLink,
677
+ expression: "showClose && !showLink",
678
+ },
679
+ ],
680
+ class: _vm.prefixCls + "-close",
681
+ on: { click: _vm.handleClose },
682
+ },
683
+ [_c("mds-icon", { attrs: { type: "line-close" } })],
684
+ 1
685
+ ),
686
+ _c(
687
+ "a",
688
+ {
689
+ directives: [
690
+ {
691
+ name: "show",
692
+ rawName: "v-show",
693
+ value: _vm.showLink,
694
+ expression: "showLink",
695
+ },
696
+ ],
697
+ class: _vm.prefixCls + "-link",
698
+ attrs: { href: _vm.showLink },
699
+ },
700
+ [_vm._v("查看信息")]
701
+ ),
702
+ ]),
703
+ ]
704
+ )
705
+ }
706
+ var message_sizevue_type_template_id_8e7dc96c_staticRenderFns = []
707
+ message_sizevue_type_template_id_8e7dc96c_render._withStripped = true
708
+
709
+
710
+ // CONCATENATED MODULE: ./components/message/message-size.vue?vue&type=template&id=8e7dc96c&
711
+
712
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/message/message-size.vue?vue&type=script&lang=js&
713
+ //
714
+ //
715
+ //
716
+ //
717
+ //
718
+ //
719
+ //
720
+ //
721
+ //
722
+ //
723
+ //
724
+ //
725
+ //
726
+ //
727
+ //
728
+ //
729
+ //
730
+ //
731
+ //
732
+ //
733
+ //
734
+ //
735
+ //
736
+ //
737
+ //
738
+ //
739
+ //
740
+
741
+
742
+
743
+ var message_sizevue_type_script_lang_js_ICONTYPES = {
744
+ info: 'line-info-circle',
745
+ success: 'fill-solid-right-circle',
746
+ error: 'fill-solid-wrong-circle',
747
+ warning: 'fill-solid-exclamation-circle',
748
+ loading: 'line-sync',
749
+ help: 'line-info-circle'
750
+ };
751
+ var TITLETYPES = {
752
+ info: '信息',
753
+ success: '已成功',
754
+ error: '出错啦',
755
+ warning: '请注意',
756
+ help: '帮助信息'
757
+ };
758
+ /* harmony default export */ var message_sizevue_type_script_lang_js_ = ({
759
+ name: 'MdsMessageSize',
760
+ mixins: [props],
761
+ props: {
762
+ title: {
763
+ type: String,
764
+ default: '请注意'
765
+ }
766
+ },
767
+ data: function data() {
768
+ return {
769
+ visible: false,
770
+ closed: false,
771
+ timer: null,
772
+ test: false
773
+ };
774
+ },
775
+
776
+ computed: {
777
+ durationMS: function durationMS() {
778
+ return this.duration * 1000;
779
+ },
780
+ iconType: function iconType() {
781
+ return this.type && message_sizevue_type_script_lang_js_ICONTYPES[this.type] ? message_sizevue_type_script_lang_js_ICONTYPES[this.type] : 'line-info-circle';
782
+ },
783
+ defaultTitle: function defaultTitle() {
784
+ return this.type && TITLETYPES[this.type] ? TITLETYPES[this.type] : '请注意';
785
+ }
786
+ },
787
+ components: {
788
+ MdsIcon: external_icon_default.a
789
+ },
790
+ watch: {
791
+ closed: function closed(newVal) {
792
+ if (newVal) {
793
+ this.visible = false;
794
+ this.$el.parentNode && this.$el.parentNode.removeChild(this.$el);
795
+ }
796
+ }
797
+ },
798
+ methods: {
799
+ /**
800
+ * @description: 销毁
801
+ * @param {type}
802
+ * @return:
803
+ */
804
+
805
+ destroyElement: function destroyElement() {
806
+ this.closed = true;
807
+ this.$destroy(true);
808
+ this.$el.parentNode && this.$el.parentNode.removeChild(this.$el);
809
+ },
810
+
811
+ /**
812
+ * @description: 关闭
813
+ * @param {type}
814
+ * @return:
815
+ */
816
+
817
+ handleClose: function handleClose() {
818
+ this.closed = true;
819
+ this.onClose();
820
+ },
821
+
822
+ /**
823
+ * @description: 清除setTimeout计时
824
+ * @param {type}
825
+ * @return:
826
+ */
827
+ clearTimer: function clearTimer() {
828
+ this.test = true;
829
+ clearTimeout(this.timer);
830
+ },
831
+
832
+ /**
833
+ * @description:
834
+ * @param {type} 开始计时删除
835
+ * @return:
836
+ */
837
+ startTimer: function startTimer() {
838
+ var _this = this;
839
+
840
+ this.test = false;
841
+ if (this.duration > 0) {
842
+ this.timer = setTimeout(function () {
843
+ if (!_this.closed) {
844
+ _this.handleClose();
845
+ }
846
+ }, this.durationMS);
847
+ }
848
+ }
849
+ },
850
+ mounted: function mounted() {
851
+ this.startTimer();
852
+ }
853
+ });
854
+ // CONCATENATED MODULE: ./components/message/message-size.vue?vue&type=script&lang=js&
855
+ /* harmony default export */ var message_message_sizevue_type_script_lang_js_ = (message_sizevue_type_script_lang_js_);
856
+ // CONCATENATED MODULE: ./components/message/message-size.vue
857
+
858
+
859
+
860
+
861
+
862
+ /* normalize component */
863
+
864
+ var message_size_component = Object(componentNormalizer["a" /* default */])(
865
+ message_message_sizevue_type_script_lang_js_,
866
+ message_sizevue_type_template_id_8e7dc96c_render,
867
+ message_sizevue_type_template_id_8e7dc96c_staticRenderFns,
868
+ false,
869
+ null,
870
+ null,
871
+ null
872
+
873
+ )
874
+
875
+ /* hot reload */
876
+ if (false) { var message_size_api; }
877
+ message_size_component.options.__file = "components/message/message-size.vue"
878
+ /* harmony default export */ var message_size = (message_size_component.exports);
879
+ // CONCATENATED MODULE: ./components/message/index.js
880
+
881
+ /*
882
+ * @Descripttion:
883
+ * @version:
884
+ * @Author: liangshuang
885
+ */
886
+
887
+
888
+
889
+
890
+
891
+
892
+
893
+ var MessageBoxConstructor = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.extend(message_box);
894
+ var MessageConstructor = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.extend(message);
895
+ var MessageSizeConstructor = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.extend(message_size);
896
+ var boxInstance = void 0;
897
+ var boxEl = void 0;
898
+ var messageInstances = []; // 存放当前未close的message
899
+ var seed = 1;
900
+ var prefixCls = 'mds-message'; // class前缀
901
+ var defaultTop = 24; // 距离头部高度
902
+ var defaultDuration = 3; // 默认延时
903
+ var getContainer = void 0;
904
+ var defaultShowClose = false;
905
+
906
+ var getBoxEl = function getBoxEl() {
907
+ boxInstance = boxInstance || new MessageBoxConstructor({
908
+ propsData: {
909
+ prefixCls: prefixCls,
910
+ styles: { top: defaultTop + 'px' }
911
+ }
912
+ });
913
+ boxInstance.vm = boxInstance.$mount();
914
+ boxEl = boxInstance.vm.$el;
915
+ if (getContainer) {
916
+ getContainer().appendChild(boxInstance.vm.$el);
917
+ } else {
918
+ document.body.appendChild(boxInstance.vm.$el);
919
+ }
920
+ return boxEl;
921
+ };
922
+
923
+ var notice = function notice(options) {
924
+ var boxEl = getBoxEl();
925
+ var id = '' + prefixCls + seed++;
926
+ var userOnClose = options.onClose || ''; // 用来存放用户设置关闭时的回调函数, 参数为被关闭的 message 实例
927
+ options.onClose = function () {
928
+ message_close(id, userOnClose);
929
+ };
930
+ options.showClose = options.showClose !== undefined ? options.showClose : defaultShowClose;
931
+ options.duration = options.duration !== undefined ? options.duration : defaultDuration;
932
+ options.type = ['info', 'success', 'error', 'warning', 'loading', 'help'].includes(options.type) ? options.type : 'info';
933
+ var messageInstance = void 0;
934
+ if (options.size) {
935
+ messageInstance = new MessageSizeConstructor({
936
+ propsData: options
937
+ });
938
+ } else {
939
+ messageInstance = new MessageConstructor({
940
+ propsData: options
941
+ });
942
+ }
943
+
944
+ messageInstance.id = id;
945
+ messageInstance.vm = messageInstance.$mount();
946
+ boxEl.appendChild(messageInstance.vm.$el);
947
+ messageInstance.vm.visible = true;
948
+ messageInstances.push(messageInstance);
949
+
950
+ return function () {
951
+ messageInstance.vm.visible = false;
952
+ };
953
+ };
954
+
955
+ var message_close = function close(id, userOnClose) {
956
+ for (var i = 0, len = messageInstances.length; i < len; i++) {
957
+ if (id === messageInstances[i].id) {
958
+ if (typeof userOnClose === 'function') {
959
+ userOnClose(messageInstances[i]);
960
+ }
961
+ messageInstances.splice(i, 1);
962
+ break;
963
+ }
964
+ }
965
+ };
966
+ var MdsMessage = function MdsMessage(options) {
967
+ options = options || {};
968
+ if (typeof options === 'string') {
969
+ options = {
970
+ content: options
971
+ };
972
+ }
973
+ return notice(options);
974
+ };
975
+ ['success', 'error', 'info', 'warn', 'warning', 'loading'].forEach(function (type) {
976
+ MdsMessage[type] = function (options) {
977
+ if (typeof options === 'string') {
978
+ options = {
979
+ content: options
980
+ };
981
+ }
982
+ options.type = type;
983
+ return notice(options);
984
+ };
985
+ });
986
+ MdsMessage.config = function (options) {
987
+ if (options.top !== undefined) {
988
+ defaultTop = options.top;
989
+ boxInstance = null;
990
+ }
991
+ if (options.duration !== undefined) {
992
+ defaultDuration = options.duration;
993
+ }
994
+ if (options.prefixCls !== undefined) {
995
+ prefixCls = options.prefixCls;
996
+ }
997
+ if (options.getContainer !== undefined) {
998
+ getContainer = options.getContainer;
999
+ }
1000
+ if (options.showClose !== undefined) {
1001
+ defaultShowClose = options.showClose;
1002
+ }
1003
+ };
1004
+ MdsMessage.destroy = function () {
1005
+ if (boxInstance) {
1006
+ boxInstance.vm.$destroy(true);
1007
+ boxEl.parentNode.removeChild(boxEl);
1008
+ }
1009
+ boxInstance = null;
1010
+ };
1011
+ /* harmony default export */ var components_message = __webpack_exports__["default"] = (MdsMessage);
1012
+
1013
+ /***/ })
1014
+
1015
+ /******/ });
1016
+ });