@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
package/dist/text.js ADDED
@@ -0,0 +1,1100 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("./icon"), require("./_mixin/emitter"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["./icon", "./_mixin/emitter"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("./icon"), require("./_mixin/emitter")) : factory(root["./icon"], root["./_mixin/emitter"]);
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__6__) {
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 = 91);
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
+ /***/ 131:
207
+ /***/ (function(module, exports) {
208
+
209
+ // removed by extract-text-webpack-plugin
210
+
211
+ /***/ }),
212
+
213
+ /***/ 251:
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
+ /***/ 41:
228
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
229
+
230
+ "use strict";
231
+
232
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/input/textarea.vue?vue&type=template&id=5786ca5a&
233
+ var render = function () {
234
+ var _vm = this
235
+ var _h = _vm.$createElement
236
+ var _c = _vm._self._c || _h
237
+ return _c(
238
+ "div",
239
+ { class: _vm.prefixCls + "-content " + (_vm.disabled ? "disable" : "") },
240
+ [
241
+ _c("textarea", {
242
+ directives: [
243
+ {
244
+ name: "model",
245
+ rawName: "v-model",
246
+ value: _vm.valueData,
247
+ expression: "valueData",
248
+ },
249
+ ],
250
+ ref: "textAreaRef",
251
+ class: _vm.prefixCls + " " + _vm.prefixCls + "-textarea",
252
+ style: _vm.textareaStyles,
253
+ attrs: {
254
+ maxlength: _vm.max_length,
255
+ minlength: _vm.min_length,
256
+ rows: _vm.rows,
257
+ placeholder: _vm.placeholder,
258
+ disabled: _vm.disabled,
259
+ },
260
+ domProps: { value: _vm.valueData },
261
+ on: {
262
+ input: [
263
+ function ($event) {
264
+ if ($event.target.composing) {
265
+ return
266
+ }
267
+ _vm.valueData = $event.target.value
268
+ },
269
+ _vm.handleInput,
270
+ ],
271
+ keypress: _vm.handleKeyDown,
272
+ change: _vm.handleChange,
273
+ focus: _vm.handleFocus,
274
+ blur: _vm.handleBlur,
275
+ },
276
+ }),
277
+ _vm.showLimit && _vm.max_length
278
+ ? _c("span", { class: _vm.prefixCls + "-show-limit" }, [
279
+ _vm._v(_vm._s(_vm.number) + "/" + _vm._s(_vm.max_length)),
280
+ ])
281
+ : _vm._e(),
282
+ ]
283
+ )
284
+ }
285
+ var staticRenderFns = []
286
+ render._withStripped = true
287
+
288
+
289
+ // CONCATENATED MODULE: ./components/input/textarea.vue?vue&type=template&id=5786ca5a&
290
+
291
+ // CONCATENATED MODULE: ./components/input/calculateNodeHeight.js
292
+ // Thanks to https://github.com/andreypopp/react-textarea-autosize/
293
+
294
+ /**
295
+ * calculateNodeHeight(uiTextNode, useCache = false)
296
+ */
297
+
298
+ var HIDDEN_TEXTAREA_STYLE = '\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n';
299
+
300
+ var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
301
+
302
+ var computedStyleCache = {};
303
+ var hiddenTextarea = void 0;
304
+
305
+ function calculateNodeStyling(node) {
306
+ var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
307
+
308
+ var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
309
+
310
+ if (useCache && computedStyleCache[nodeRef]) {
311
+ return computedStyleCache[nodeRef];
312
+ }
313
+
314
+ var style = window.getComputedStyle(node);
315
+
316
+ var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
317
+
318
+ var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
319
+
320
+ var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
321
+
322
+ var sizingStyle = SIZING_STYLE.map(function (name) {
323
+ return name + ':' + style.getPropertyValue(name);
324
+ }).join(';');
325
+
326
+ var nodeInfo = {
327
+ sizingStyle: sizingStyle,
328
+ paddingSize: paddingSize,
329
+ borderSize: borderSize,
330
+ boxSizing: boxSizing
331
+ };
332
+
333
+ if (useCache && nodeRef) {
334
+ computedStyleCache[nodeRef] = nodeInfo;
335
+ }
336
+
337
+ return nodeInfo;
338
+ }
339
+
340
+ function calculateNodeHeight(uiTextNode) {
341
+ var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
342
+ var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
343
+ var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
344
+
345
+ if (!hiddenTextarea) {
346
+ hiddenTextarea = document.createElement('textarea');
347
+ document.body.appendChild(hiddenTextarea);
348
+ }
349
+
350
+ // Fix wrap="off" issue
351
+ // https://github.com/mds-design/mds-design/issues/6577
352
+ if (uiTextNode.getAttribute('wrap')) {
353
+ hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
354
+ } else {
355
+ hiddenTextarea.removeAttribute('wrap');
356
+ }
357
+
358
+ // Copy all CSS properties that have an impact on the height of the content in
359
+ // the textbox
360
+
361
+ var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
362
+ paddingSize = _calculateNodeStyling.paddingSize,
363
+ borderSize = _calculateNodeStyling.borderSize,
364
+ boxSizing = _calculateNodeStyling.boxSizing,
365
+ sizingStyle = _calculateNodeStyling.sizingStyle;
366
+
367
+ // Need to have the overflow attribute to hide the scrollbar otherwise
368
+ // text-lines will not calculated properly as the shadow will technically be
369
+ // narrower for content
370
+
371
+
372
+ hiddenTextarea.setAttribute('style', sizingStyle + ';' + HIDDEN_TEXTAREA_STYLE);
373
+ hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
374
+
375
+ var minHeight = -Infinity;
376
+ var maxHeight = Infinity;
377
+ var height = hiddenTextarea.scrollHeight;
378
+ var overflowY = void 0;
379
+
380
+ if (boxSizing === 'border-box') {
381
+ // border-box: add border, since height = content + padding + border
382
+ height = height + borderSize;
383
+ } else if (boxSizing === 'content-box') {
384
+ // remove padding, since height = content
385
+ height = height - paddingSize;
386
+ }
387
+
388
+ if (minRows !== null || maxRows !== null) {
389
+ // measure height of a textarea with a single row
390
+ hiddenTextarea.value = '';
391
+ var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
392
+ if (minRows !== null) {
393
+ minHeight = singleRowHeight * minRows;
394
+ if (boxSizing === 'border-box') {
395
+ minHeight = minHeight + paddingSize + borderSize;
396
+ }
397
+ height = Math.max(minHeight, height);
398
+ }
399
+ if (maxRows !== null) {
400
+ maxHeight = singleRowHeight * maxRows;
401
+ if (boxSizing === 'border-box') {
402
+ maxHeight = maxHeight + paddingSize + borderSize;
403
+ }
404
+ overflowY = height > maxHeight ? '' : 'hidden';
405
+ height = Math.min(maxHeight, height);
406
+ }
407
+ }
408
+ // Remove scroll bar flash when autosize without maxRows
409
+ if (!maxRows) {
410
+ overflowY = 'hidden';
411
+ }
412
+ return { height: height + 'px', minHeight: minHeight + 'px', maxHeight: maxHeight + 'px', overflowY: overflowY };
413
+ }
414
+ // EXTERNAL MODULE: external "./_mixin/emitter"
415
+ var emitter_ = __webpack_require__(6);
416
+ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
417
+
418
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/input/textarea.vue?vue&type=script&lang=js&
419
+ //
420
+ //
421
+ //
422
+ //
423
+ //
424
+ //
425
+ //
426
+ //
427
+ //
428
+ //
429
+ //
430
+ //
431
+ //
432
+ //
433
+ //
434
+ //
435
+ //
436
+ //
437
+ //
438
+ //
439
+ //
440
+ //
441
+
442
+
443
+
444
+
445
+ function onNextFrame(cb) {
446
+ if (window.requestAnimationFrame) {
447
+ return window.requestAnimationFrame(cb);
448
+ }
449
+ return window.setTimeout(cb, 1);
450
+ }
451
+
452
+ function clearNextFrameAction(nextFrameId) {
453
+ if (window.cancelAnimationFrame) {
454
+ window.cancelAnimationFrame(nextFrameId);
455
+ } else {
456
+ window.clearTimeout(nextFrameId);
457
+ }
458
+ }
459
+
460
+ /* harmony default export */ var textareavue_type_script_lang_js_ = ({
461
+ name: 'MdsInputTextarea',
462
+ mixins: [emitter_default.a],
463
+ props: {
464
+ autosize: {
465
+ type: [Boolean, Object],
466
+ default: false
467
+ },
468
+ prefixCls: {
469
+ type: String,
470
+ default: 'mds-input'
471
+ },
472
+ maxlength: {
473
+ type: Number
474
+ },
475
+ minlength: {
476
+ type: Number
477
+ },
478
+ rows: {
479
+ type: Number,
480
+ default: 4
481
+ },
482
+ showLimit: {
483
+ type: Boolean,
484
+ default: false
485
+ },
486
+ placeholder: {
487
+ type: String,
488
+ default: ''
489
+ },
490
+ disabled: {
491
+ type: Boolean,
492
+ default: false
493
+ },
494
+ value: null
495
+ },
496
+ data: function data() {
497
+ return {
498
+ textareaStyles: {},
499
+ number: 0
500
+ };
501
+ },
502
+
503
+ computed: {
504
+ valueData: {
505
+ get: function get() {
506
+ return this.value || '';
507
+ },
508
+ set: function set(value) {
509
+ this.$emit('input', value);
510
+ }
511
+ },
512
+ max_length: function max_length() {
513
+ return this.$attrs.maxlength || this.maxlength;
514
+ },
515
+ min_length: function min_length() {
516
+ return this.$attrs.minlength || this.minlength;
517
+ }
518
+ },
519
+ watch: {
520
+ valueData: function valueData(newVal) {
521
+ if (newVal.length > this.maxlength) {
522
+ return false;
523
+ } else {
524
+ this.number = newVal.length;
525
+ }
526
+ }
527
+ },
528
+ created: function created() {
529
+ this.number = this.valueData.length;
530
+ },
531
+
532
+ methods: {
533
+ handleChange: function handleChange(e) {
534
+ this.$emit('change', e);
535
+ },
536
+ handleInput: function handleInput(e) {
537
+ if (this.nextFrameActionId) {
538
+ clearNextFrameAction(this.nextFrameActionId);
539
+ }
540
+ this.nextFrameActionId = onNextFrame(this.resizeTextarea);
541
+ this.$emit('input', e.target.value);
542
+ this.dispatch('MdsFormItem', 'formItemChange', e.target.value);
543
+ },
544
+ handleKeyDown: function handleKeyDown(e) {
545
+ if (e.keyCode === 13) {
546
+ this.$emit('press-enter', e);
547
+ }
548
+ this.$emit('keydown', e);
549
+ },
550
+ resizeTextarea: function resizeTextarea() {
551
+ if (!this.autosize) {
552
+ return false;
553
+ }
554
+ var minRows = this.autosize ? this.autosize.minRows : null;
555
+ var maxRows = this.autosize ? this.autosize.maxRows : null;
556
+ this.textareaStyles = calculateNodeHeight(this.$refs.textAreaRef, false, minRows, maxRows);
557
+ },
558
+ handleFocus: function handleFocus(e) {
559
+ this.$emit('focus', e);
560
+ },
561
+ handleBlur: function handleBlur(e) {
562
+ this.$emit('blur', e);
563
+ this.dispatch('MdsFormItem', 'formItemBlur', e);
564
+ },
565
+ focus: function focus() {
566
+ this.getInput().focus();
567
+ },
568
+ blur: function blur() {
569
+ this.getInput().blur();
570
+ },
571
+ getInput: function getInput() {
572
+ return this.$refs.textAreaRef;
573
+ }
574
+ },
575
+ mounted: function mounted() {
576
+ this.resizeTextarea();
577
+ }
578
+ });
579
+ // CONCATENATED MODULE: ./components/input/textarea.vue?vue&type=script&lang=js&
580
+ /* harmony default export */ var input_textareavue_type_script_lang_js_ = (textareavue_type_script_lang_js_);
581
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
582
+ var componentNormalizer = __webpack_require__(0);
583
+
584
+ // CONCATENATED MODULE: ./components/input/textarea.vue
585
+
586
+
587
+
588
+
589
+
590
+ /* normalize component */
591
+
592
+ var component = Object(componentNormalizer["a" /* default */])(
593
+ input_textareavue_type_script_lang_js_,
594
+ render,
595
+ staticRenderFns,
596
+ false,
597
+ null,
598
+ null,
599
+ null
600
+
601
+ )
602
+
603
+ /* hot reload */
604
+ if (false) { var api; }
605
+ component.options.__file = "components/input/textarea.vue"
606
+ /* harmony default export */ var input_textarea = __webpack_exports__["a"] = (component.exports);
607
+
608
+ /***/ }),
609
+
610
+ /***/ 6:
611
+ /***/ (function(module, exports) {
612
+
613
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6__;
614
+
615
+ /***/ }),
616
+
617
+ /***/ 91:
618
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
619
+
620
+ "use strict";
621
+ // ESM COMPAT FLAG
622
+ __webpack_require__.r(__webpack_exports__);
623
+
624
+ // EXTERNAL MODULE: ./components/style/index.less
625
+ var style = __webpack_require__(131);
626
+
627
+ // EXTERNAL MODULE: ./components/text/style/index.less
628
+ var text_style = __webpack_require__(251);
629
+
630
+ // CONCATENATED MODULE: ./components/text/style/index.js
631
+
632
+
633
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/text/text.vue?vue&type=template&id=0c79aab8&
634
+ var render = function () {
635
+ var _vm = this
636
+ var _h = _vm.$createElement
637
+ var _c = _vm._self._c || _h
638
+ return _c(
639
+ "span",
640
+ { class: ["mds-text", _vm.classNames] },
641
+ [
642
+ _vm.icon.length > 0
643
+ ? _c("mds-icon", { attrs: { type: _vm.icon } })
644
+ : _vm._e(),
645
+ _vm._t("default"),
646
+ ],
647
+ 2
648
+ )
649
+ }
650
+ var staticRenderFns = []
651
+ render._withStripped = true
652
+
653
+
654
+ // CONCATENATED MODULE: ./components/text/text.vue?vue&type=template&id=0c79aab8&
655
+
656
+ // EXTERNAL MODULE: external "./icon"
657
+ var external_icon_ = __webpack_require__(4);
658
+ var external_icon_default = /*#__PURE__*/__webpack_require__.n(external_icon_);
659
+
660
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/text/text.vue?vue&type=script&lang=js&
661
+ //
662
+ //
663
+ //
664
+ //
665
+ //
666
+ //
667
+
668
+
669
+ /* harmony default export */ var textvue_type_script_lang_js_ = ({
670
+ name: 'MdsText',
671
+ components: {
672
+ MdsIcon: external_icon_default.a
673
+ },
674
+ props: {
675
+ type: {
676
+ type: String,
677
+ default: 'primary'
678
+ },
679
+ mark: {
680
+ type: Boolean,
681
+ default: false
682
+ },
683
+ code: {
684
+ type: Boolean,
685
+ default: false
686
+ },
687
+ underline: {
688
+ type: Boolean,
689
+ default: false
690
+ },
691
+ delete: {
692
+ type: Boolean,
693
+ default: false
694
+ },
695
+ strong: {
696
+ type: Boolean,
697
+ default: false
698
+ },
699
+ icon: {
700
+ type: String,
701
+ default: ''
702
+ }
703
+ },
704
+ data: function data() {
705
+ return {
706
+ editing: false,
707
+ copied: false,
708
+ textContent: ''
709
+ };
710
+ },
711
+
712
+ computed: {
713
+ classNames: function classNames() {
714
+ var res = [];
715
+ var pre = 'mds-text-';
716
+ switch (this.type) {
717
+ case 'primary':
718
+ res.push(pre + 'primary');
719
+ break;
720
+ case 'secondary':
721
+ res.push(pre + 'secondary');
722
+ break;
723
+ case 'dark':
724
+ res.push(pre + 'dark');
725
+ break;
726
+ case 'disabled':
727
+ res.push(pre + 'disabled');
728
+ break;
729
+ case 'danger':
730
+ res.push(pre + 'danger');
731
+ break;
732
+ case 'success':
733
+ res.push(pre + 'success');
734
+ break;
735
+ case 'warning':
736
+ res.push(pre + 'warning');
737
+ break;
738
+ case 'info':
739
+ res.push(pre + 'info');
740
+ break;
741
+ default:
742
+ break;
743
+ }
744
+ if (this.mark) {
745
+ res.push(pre + 'mark');
746
+ }
747
+ if (this.code) {
748
+ res.push(pre + 'code');
749
+ }
750
+ if (this.underline) {
751
+ res.push(pre + 'underline');
752
+ }
753
+ if (this.delete) {
754
+ res.push(pre + 'delete');
755
+ }
756
+ if (this.strong) {
757
+ res.push(pre + 'strong');
758
+ }
759
+ return res;
760
+ }
761
+ },
762
+ methods: {},
763
+ mounted: function mounted() {}
764
+ });
765
+ // CONCATENATED MODULE: ./components/text/text.vue?vue&type=script&lang=js&
766
+ /* harmony default export */ var text_textvue_type_script_lang_js_ = (textvue_type_script_lang_js_);
767
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
768
+ var componentNormalizer = __webpack_require__(0);
769
+
770
+ // CONCATENATED MODULE: ./components/text/text.vue
771
+
772
+
773
+
774
+
775
+
776
+ /* normalize component */
777
+
778
+ var component = Object(componentNormalizer["a" /* default */])(
779
+ text_textvue_type_script_lang_js_,
780
+ render,
781
+ staticRenderFns,
782
+ false,
783
+ null,
784
+ null,
785
+ null
786
+
787
+ )
788
+
789
+ /* hot reload */
790
+ if (false) { var api; }
791
+ component.options.__file = "components/text/text.vue"
792
+ /* harmony default export */ var text_text = (component.exports);
793
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/text/link.vue?vue&type=template&id=7cc366f1&
794
+ var linkvue_type_template_id_7cc366f1_render = function () {
795
+ var _vm = this
796
+ var _h = _vm.$createElement
797
+ var _c = _vm._self._c || _h
798
+ return _c(
799
+ "a",
800
+ {
801
+ class: ["mds-link", _vm.underline ? "has-underline" : ""],
802
+ attrs: { href: _vm.url, target: _vm.target },
803
+ },
804
+ [_vm._t("default")],
805
+ 2
806
+ )
807
+ }
808
+ var linkvue_type_template_id_7cc366f1_staticRenderFns = []
809
+ linkvue_type_template_id_7cc366f1_render._withStripped = true
810
+
811
+
812
+ // CONCATENATED MODULE: ./components/text/link.vue?vue&type=template&id=7cc366f1&
813
+
814
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/text/link.vue?vue&type=script&lang=js&
815
+ //
816
+ //
817
+ //
818
+ //
819
+ //
820
+ //
821
+
822
+ /* harmony default export */ var linkvue_type_script_lang_js_ = ({
823
+ name: 'MdsLink',
824
+ props: {
825
+ url: {
826
+ type: String,
827
+ default: ''
828
+ },
829
+ underline: {
830
+ type: Boolean,
831
+ default: false
832
+ },
833
+ target: {
834
+ type: String,
835
+ default: '_self'
836
+ }
837
+ },
838
+ data: function data() {
839
+ return {};
840
+ },
841
+
842
+ methods: {},
843
+ mounted: function mounted() {}
844
+ });
845
+ // CONCATENATED MODULE: ./components/text/link.vue?vue&type=script&lang=js&
846
+ /* harmony default export */ var text_linkvue_type_script_lang_js_ = (linkvue_type_script_lang_js_);
847
+ // CONCATENATED MODULE: ./components/text/link.vue
848
+
849
+
850
+
851
+
852
+
853
+ /* normalize component */
854
+
855
+ var link_component = Object(componentNormalizer["a" /* default */])(
856
+ text_linkvue_type_script_lang_js_,
857
+ linkvue_type_template_id_7cc366f1_render,
858
+ linkvue_type_template_id_7cc366f1_staticRenderFns,
859
+ false,
860
+ null,
861
+ null,
862
+ null
863
+
864
+ )
865
+
866
+ /* hot reload */
867
+ if (false) { var link_api; }
868
+ link_component.options.__file = "components/text/link.vue"
869
+ /* harmony default export */ var text_link = (link_component.exports);
870
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/text/customize.vue?vue&type=template&id=56d05148&
871
+ var customizevue_type_template_id_56d05148_render = function () {
872
+ var _vm = this
873
+ var _h = _vm.$createElement
874
+ var _c = _vm._self._c || _h
875
+ return _c(
876
+ "span",
877
+ { staticClass: "mds-text" },
878
+ [
879
+ _vm.editable
880
+ ? [
881
+ !_vm.editing
882
+ ? _vm._t("default")
883
+ : _c("mds-input-textarea", {
884
+ ref: "textarea",
885
+ attrs: { id: "editTextarea", rows: "1" },
886
+ nativeOn: {
887
+ keyup: function ($event) {
888
+ if (
889
+ !$event.type.indexOf("key") &&
890
+ _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
891
+ ) {
892
+ return null
893
+ }
894
+ return _vm.finishEdit($event)
895
+ },
896
+ blur: function ($event) {
897
+ return _vm.finishEdit($event)
898
+ },
899
+ },
900
+ model: {
901
+ value: _vm.textContent,
902
+ callback: function ($$v) {
903
+ _vm.textContent = $$v
904
+ },
905
+ expression: "textContent",
906
+ },
907
+ }),
908
+ _c(
909
+ "mds-tooltip",
910
+ { attrs: { title: "编辑", mouseLeaveDelay: 0 } },
911
+ [
912
+ _c("mds-icon", {
913
+ directives: [
914
+ {
915
+ name: "show",
916
+ rawName: "v-show",
917
+ value: _vm.editable && !_vm.editing,
918
+ expression: "editable && !editing",
919
+ },
920
+ ],
921
+ staticClass: "edit-icon",
922
+ attrs: { type: "line-format-border-color" },
923
+ nativeOn: {
924
+ click: function ($event) {
925
+ return _vm.handleEdit($event)
926
+ },
927
+ },
928
+ }),
929
+ ],
930
+ 1
931
+ ),
932
+ ]
933
+ : _vm.copyable
934
+ ? [
935
+ _c(
936
+ "span",
937
+ { attrs: { id: "copy-target" } },
938
+ [_vm._t("default")],
939
+ 2
940
+ ),
941
+ _c(
942
+ "mds-tooltip",
943
+ {
944
+ attrs: {
945
+ title: _vm.copied ? "复制成功" : "复制",
946
+ mouseLeaveDelay: 0,
947
+ },
948
+ },
949
+ [
950
+ _c("mds-icon", {
951
+ attrs: {
952
+ type: _vm.copied ? "line-check" : "line-swap-stroke",
953
+ },
954
+ nativeOn: {
955
+ click: function ($event) {
956
+ return _vm.handleCopy($event)
957
+ },
958
+ },
959
+ }),
960
+ ],
961
+ 1
962
+ ),
963
+ ]
964
+ : _vm._e(),
965
+ ],
966
+ 2
967
+ )
968
+ }
969
+ var customizevue_type_template_id_56d05148_staticRenderFns = []
970
+ customizevue_type_template_id_56d05148_render._withStripped = true
971
+
972
+
973
+ // CONCATENATED MODULE: ./components/text/customize.vue?vue&type=template&id=56d05148&
974
+
975
+ // EXTERNAL MODULE: ./components/input/textarea.vue + 5 modules
976
+ var input_textarea = __webpack_require__(41);
977
+
978
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/text/customize.vue?vue&type=script&lang=js&
979
+ //
980
+ //
981
+ //
982
+ //
983
+ //
984
+ //
985
+ //
986
+ //
987
+ //
988
+ //
989
+ //
990
+ //
991
+ //
992
+ //
993
+ //
994
+ //
995
+ //
996
+ //
997
+ //
998
+ //
999
+ //
1000
+ //
1001
+ //
1002
+ //
1003
+ //
1004
+ //
1005
+ //
1006
+ //
1007
+
1008
+
1009
+
1010
+ /* harmony default export */ var customizevue_type_script_lang_js_ = ({
1011
+ name: 'MdsTextCustomize',
1012
+ components: {
1013
+ MdsIcon: external_icon_default.a,
1014
+ MdsInputTextarea: input_textarea["a" /* default */]
1015
+ },
1016
+ props: {
1017
+ editable: {
1018
+ type: Boolean,
1019
+ default: false
1020
+ },
1021
+ copyable: {
1022
+ type: Boolean,
1023
+ default: false
1024
+ }
1025
+ },
1026
+ data: function data() {
1027
+ return {
1028
+ editing: false,
1029
+ copied: false,
1030
+ textContent: ''
1031
+ };
1032
+ },
1033
+
1034
+ methods: {
1035
+ handleEdit: function handleEdit() {
1036
+ this.textContent = this.$slots.default[0].text;
1037
+ this.editing = true;
1038
+ this.$nextTick(function () {
1039
+ // this.$refs.textarea.focus()
1040
+ document.querySelector('#editTextarea').focus();
1041
+ });
1042
+ },
1043
+ finishEdit: function finishEdit() {
1044
+ this.editing = false;
1045
+ this.$slots.default[0].text = this.textContent;
1046
+ },
1047
+ handleCopy: function handleCopy() {
1048
+ if (!this.copied) {
1049
+ var copyContent = document.querySelector('#copy-target').textContent;
1050
+ var that = this;
1051
+ this.$copyText(copyContent).then(function () {
1052
+ that.copied = true;
1053
+ });
1054
+ }
1055
+ }
1056
+ },
1057
+ mounted: function mounted() {}
1058
+ });
1059
+ // CONCATENATED MODULE: ./components/text/customize.vue?vue&type=script&lang=js&
1060
+ /* harmony default export */ var text_customizevue_type_script_lang_js_ = (customizevue_type_script_lang_js_);
1061
+ // CONCATENATED MODULE: ./components/text/customize.vue
1062
+
1063
+
1064
+
1065
+
1066
+
1067
+ /* normalize component */
1068
+
1069
+ var customize_component = Object(componentNormalizer["a" /* default */])(
1070
+ text_customizevue_type_script_lang_js_,
1071
+ customizevue_type_template_id_56d05148_render,
1072
+ customizevue_type_template_id_56d05148_staticRenderFns,
1073
+ false,
1074
+ null,
1075
+ null,
1076
+ null
1077
+
1078
+ )
1079
+
1080
+ /* hot reload */
1081
+ if (false) { var customize_api; }
1082
+ customize_component.options.__file = "components/text/customize.vue"
1083
+ /* harmony default export */ var customize = (customize_component.exports);
1084
+ // CONCATENATED MODULE: ./components/text/index.js
1085
+
1086
+
1087
+
1088
+
1089
+ /* istanbul ignore next */
1090
+ text_text.install = function (Vue) {
1091
+ Vue.component(text_text.name, text_text);
1092
+ Vue.component(text_link.name, text_link);
1093
+ Vue.component(customize.name, customize);
1094
+ };
1095
+ /* harmony default export */ var components_text = __webpack_exports__["default"] = (text_text);
1096
+
1097
+ /***/ })
1098
+
1099
+ /******/ });
1100
+ });