@mdsfe/mds-ui 0.4.2 → 0.4.4

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 (51) hide show
  1. package/dist/affix.js +504 -0
  2. package/dist/alert.js +471 -0
  3. package/dist/anchor.js +514 -0
  4. package/dist/avatar.js +441 -0
  5. package/dist/backtop.js +464 -0
  6. package/dist/badge.js +434 -0
  7. package/dist/bordershadow.js +316 -0
  8. package/dist/breadcrumb.js +426 -0
  9. package/dist/button.js +564 -0
  10. package/dist/carousel.js +2 -2
  11. package/dist/cascader.js +4 -4
  12. package/dist/cascaderpanel.js +10 -10
  13. package/dist/collapse.js +2 -2
  14. package/dist/divider.js +2 -2
  15. package/dist/drawer.js +4 -4
  16. package/dist/empty.js +2 -2
  17. package/dist/form.js +2 -2
  18. package/dist/input.js +2 -2
  19. package/dist/inputnumber.js +2 -2
  20. package/dist/layout.js +2 -2
  21. package/dist/list.js +2 -2
  22. package/dist/loading.js +2 -2
  23. package/dist/menu.js +4 -4
  24. package/dist/message.js +2 -2
  25. package/dist/modal.js +2 -2
  26. package/dist/notification.js +7 -7
  27. package/dist/pagination.js +4 -4
  28. package/dist/popconfirm.js +2 -2
  29. package/dist/popover.js +2 -2
  30. package/dist/progress.js +2 -2
  31. package/dist/radio.js +2 -2
  32. package/dist/rate.js +2 -2
  33. package/dist/select.js +7 -7
  34. package/dist/slider.js +2 -2
  35. package/dist/slottable.js +4 -4
  36. package/dist/steps.js +2 -2
  37. package/dist/style/icon.css +1 -1
  38. package/dist/style/rate.css +3 -3
  39. package/dist/switch.js +2 -2
  40. package/dist/table.js +6 -6
  41. package/dist/tabs.js +2 -2
  42. package/dist/tag.js +2 -2
  43. package/dist/text.js +2 -2
  44. package/dist/timeline.js +2 -2
  45. package/dist/timepicker.js +2 -2
  46. package/dist/tooltip.js +2 -2
  47. package/dist/transfer.js +6 -6
  48. package/dist/transition.js +2 -2
  49. package/dist/tree.js +2 -2
  50. package/dist/typography.js +2 -2
  51. package/package.json +1 -1
package/dist/affix.js CHANGED
@@ -0,0 +1,504 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("./_util/getScroll"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["./_util/getScroll"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("./_util/getScroll")) : factory(root["./_util/getScroll"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(window, function(__WEBPACK_EXTERNAL_MODULE__43__) {
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 = "";
91
+ /******/
92
+ /******/
93
+ /******/ // Load entry module and return exports
94
+ /******/ return __webpack_require__(__webpack_require__.s = 121);
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 =
122
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
123
+
124
+ // render functions
125
+ if (render) {
126
+ options.render = render
127
+ options.staticRenderFns = staticRenderFns
128
+ options._compiled = true
129
+ }
130
+
131
+ // functional template
132
+ if (functionalTemplate) {
133
+ options.functional = true
134
+ }
135
+
136
+ // scopedId
137
+ if (scopeId) {
138
+ options._scopeId = 'data-v-' + scopeId
139
+ }
140
+
141
+ var hook
142
+ if (moduleIdentifier) {
143
+ // 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 ? [].concat(existing, hook) : [hook]
192
+ }
193
+ }
194
+
195
+ return {
196
+ exports: scriptExports,
197
+ options: options
198
+ }
199
+ }
200
+
201
+
202
+ /***/ }),
203
+
204
+ /***/ 121:
205
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
206
+
207
+ "use strict";
208
+ // ESM COMPAT FLAG
209
+ __webpack_require__.r(__webpack_exports__);
210
+
211
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/affix/affix.vue?vue&type=template&id=462bd895
212
+ var render = function () {
213
+ var _vm = this
214
+ var _h = _vm.$createElement
215
+ var _c = _vm._self._c || _h
216
+ return _c("div", [
217
+ _c(
218
+ "div",
219
+ { ref: "fixedNode", class: _vm.classes, style: _vm.styles },
220
+ [_vm._t("default")],
221
+ 2
222
+ ),
223
+ _c("div", {
224
+ directives: [
225
+ {
226
+ name: "show",
227
+ rawName: "v-show",
228
+ value: _vm.slot,
229
+ expression: "slot",
230
+ },
231
+ ],
232
+ style: _vm.slotStyle,
233
+ }),
234
+ ])
235
+ }
236
+ var staticRenderFns = []
237
+ render._withStripped = true
238
+
239
+
240
+ // CONCATENATED MODULE: ./components/affix/affix.vue?vue&type=template&id=462bd895
241
+
242
+ // EXTERNAL MODULE: external "babel-runtime/helpers/defineProperty"
243
+ var defineProperty_ = __webpack_require__(3);
244
+ var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
245
+
246
+ // EXTERNAL MODULE: external "./_util/getScroll"
247
+ var getScroll_ = __webpack_require__(43);
248
+ var getScroll_default = /*#__PURE__*/__webpack_require__.n(getScroll_);
249
+
250
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/affix/affix.vue?vue&type=script&lang=js
251
+
252
+ //
253
+ //
254
+ //
255
+ //
256
+ //
257
+ //
258
+ //
259
+ //
260
+ //
261
+
262
+
263
+ // import { throttleByAnimationFrameDecorator } from 'mds-ui/_util/throttleByAnimationFrame'
264
+
265
+ var getTargetRect = function getTargetRect(target) {
266
+ return target !== window ? target.getBoundingClientRect() : { top: 0, left: 0, bottom: 0 };
267
+ };
268
+
269
+ var affixvue_type_script_lang_js_getOffset = function getOffset(element, target) {
270
+ var elemRect = element.getBoundingClientRect();
271
+ var targetRect = getTargetRect(target);
272
+
273
+ var scrollTop = getScroll_default()(target, true);
274
+ var scrollLeft = getScroll_default()(target, false);
275
+
276
+ var docElem = window.document.body;
277
+ var clientTop = docElem.clientTop || 0;
278
+ var clientLeft = docElem.clientLeft || 0;
279
+
280
+ return {
281
+ top: elemRect.top - targetRect.top + scrollTop - clientTop,
282
+ left: elemRect.left - targetRect.left + scrollLeft - clientLeft,
283
+ width: elemRect.width,
284
+ height: elemRect.height
285
+ };
286
+ };
287
+
288
+ /* harmony default export */ var affixvue_type_script_lang_js = ({
289
+ name: 'MdsAffix',
290
+ props: {
291
+ prefixCls: {
292
+ type: String,
293
+ default: 'mds-affix'
294
+ },
295
+ offsetTop: {
296
+ type: Number,
297
+ default: 0
298
+ },
299
+ offsetBottom: {
300
+ type: Number
301
+ },
302
+ target: {
303
+ type: Function,
304
+ default: function _default() {
305
+ return window;
306
+ }
307
+ }
308
+ },
309
+ data: function data() {
310
+ return {
311
+ affix: false,
312
+ styles: {},
313
+ slot: false,
314
+ slotStyle: {}
315
+ };
316
+ },
317
+
318
+ computed: {
319
+ offsetType: function offsetType() {
320
+ var type = 'top';
321
+ if (this.offsetBottom >= 0) {
322
+ type = 'bottom';
323
+ }
324
+ return type;
325
+ },
326
+ classes: function classes() {
327
+ return defineProperty_default()({}, '' + this.prefixCls, this.affix);
328
+ }
329
+ },
330
+ watch: {
331
+ target: function target(val, oldVal) {
332
+ var oldTarget = oldVal();
333
+ var newTarget = val();
334
+ oldTarget && oldTarget.removeEventListener('scroll', this.handleScroll, false);
335
+ oldTarget && oldTarget.removeEventListener('resize', this.handleScroll, false);
336
+ newTarget && newTarget.addEventListener('scroll', this.handleScroll, false);
337
+ newTarget && newTarget.addEventListener('resize', this.handleScroll, false);
338
+ },
339
+ affix: function affix(val) {
340
+ var target = this.target();
341
+ var fixedNode = this.$refs.fixedNode;
342
+ if (target !== target.window) {
343
+ return;
344
+ }
345
+ if (val) {
346
+ document.body.appendChild(fixedNode);
347
+ } else {
348
+ this.$el.appendChild(fixedNode);
349
+ }
350
+ }
351
+ },
352
+ mounted: function mounted() {
353
+ var target = this.target();
354
+ target.addEventListener('scroll', this.handleScroll, false);
355
+ target.addEventListener('resize', this.handleScroll, false);
356
+ },
357
+ beforeDestroy: function beforeDestroy() {
358
+ var target = this.target();
359
+ var fixedNode = this.$refs.fixedNode;
360
+ if (this.affix) {
361
+ document.body.removeChild(fixedNode);
362
+ }
363
+ target && target.removeEventListener('scroll', this.handleScroll, false);
364
+ target && target.removeEventListener('resize', this.handleScroll, false);
365
+ },
366
+
367
+ methods: {
368
+ // @throttleByAnimationFrameDecorator
369
+ handleScroll: function handleScroll() {
370
+ var target = this.target();
371
+ var affix = this.affix;
372
+ var scrollTop = getScroll_default()(target || window, true);
373
+ var elOffset = affixvue_type_script_lang_js_getOffset(this.$el, target || window);
374
+ // console.log(scrollTop)
375
+ var windowHeight = window.innerHeight;
376
+ var elHeight = this.$el.getElementsByTagName('div')[0].offsetHeight;
377
+ var targetRect = getTargetRect(target);
378
+
379
+ // Fixed Top
380
+ if (elOffset.top - this.offsetTop < scrollTop && this.offsetType === 'top' && !affix) {
381
+ this.affix = true;
382
+ this.slotStyle = {
383
+ width: this.$refs.fixedNode.clientWidth + 'px',
384
+ height: this.$refs.fixedNode.clientHeight + 'px'
385
+ };
386
+ this.slot = true;
387
+ this.styles = {
388
+ top: targetRect.top + this.offsetTop + 'px',
389
+ left: targetRect.left + elOffset.left + 'px',
390
+ width: this.$el.offsetWidth + 'px'
391
+ };
392
+ this.$emit('change', true);
393
+ } else if (elOffset.top - this.offsetTop > scrollTop && this.offsetType === 'top' && affix) {
394
+ this.slot = false;
395
+ this.slotStyle = {};
396
+ this.affix = false;
397
+ this.styles = null;
398
+ this.$emit('change', false);
399
+ } else if (this.offsetType === 'top' && affix) {
400
+ this.styles = {
401
+ top: targetRect.top + this.offsetTop + 'px',
402
+ left: targetRect.left + elOffset.left + 'px',
403
+ width: this.$el.offsetWidth + 'px'
404
+ };
405
+ }
406
+
407
+ // Fixed Bottom
408
+ if (elOffset.top + this.offsetBottom + elHeight > scrollTop + windowHeight && this.offsetType === 'bottom' && !affix) {
409
+ this.affix = true;
410
+ this.styles = {
411
+ bottom: this.offsetBottom + 'px',
412
+ left: elOffset.left + 'px',
413
+ width: this.$el.offsetWidth + 'px'
414
+ };
415
+ this.$emit('change', true);
416
+ } else if (elOffset.top + this.offsetBottom + elHeight < scrollTop + windowHeight && this.offsetType === 'bottom' && affix) {
417
+ this.affix = false;
418
+ this.styles = null;
419
+ this.$emit('change', false);
420
+ } else if (this.offsetType === 'bottom' && affix) {
421
+ this.styles = {
422
+ bottom: this.offsetBottom + 'px',
423
+ left: elOffset.left + 'px',
424
+ width: this.$el.offsetWidth + 'px'
425
+ };
426
+ }
427
+ }
428
+ }
429
+ });
430
+ // CONCATENATED MODULE: ./components/affix/affix.vue?vue&type=script&lang=js
431
+ /* harmony default export */ var affix_affixvue_type_script_lang_js = (affixvue_type_script_lang_js);
432
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
433
+ var componentNormalizer = __webpack_require__(0);
434
+
435
+ // CONCATENATED MODULE: ./components/affix/affix.vue
436
+
437
+
438
+
439
+
440
+
441
+ /* normalize component */
442
+
443
+ var component = Object(componentNormalizer["a" /* default */])(
444
+ affix_affixvue_type_script_lang_js,
445
+ render,
446
+ staticRenderFns,
447
+ false,
448
+ null,
449
+ null,
450
+ null
451
+
452
+ )
453
+
454
+ /* harmony default export */ var affix_affix = (component.exports);
455
+ // EXTERNAL MODULE: ./components/style/mixins-only.less
456
+ var mixins_only = __webpack_require__(140);
457
+
458
+ // EXTERNAL MODULE: ./components/affix/style/index.less
459
+ var style = __webpack_require__(144);
460
+
461
+ // CONCATENATED MODULE: ./components/affix/style/index.js
462
+
463
+
464
+ // CONCATENATED MODULE: ./components/affix/index.js
465
+
466
+
467
+ /* istanbul ignore next */
468
+ affix_affix.install = function (Vue) {
469
+ Vue.component(affix_affix.name, affix_affix);
470
+ };
471
+ /* harmony default export */ var components_affix = __webpack_exports__["default"] = (affix_affix);
472
+
473
+ /***/ }),
474
+
475
+ /***/ 140:
476
+ /***/ (function(module, exports) {
477
+
478
+ // removed by extract-text-webpack-plugin
479
+
480
+ /***/ }),
481
+
482
+ /***/ 144:
483
+ /***/ (function(module, exports) {
484
+
485
+ // removed by extract-text-webpack-plugin
486
+
487
+ /***/ }),
488
+
489
+ /***/ 3:
490
+ /***/ (function(module, exports) {
491
+
492
+ module.exports = require("babel-runtime/helpers/defineProperty");
493
+
494
+ /***/ }),
495
+
496
+ /***/ 43:
497
+ /***/ (function(module, exports) {
498
+
499
+ module.exports = __WEBPACK_EXTERNAL_MODULE__43__;
500
+
501
+ /***/ })
502
+
503
+ /******/ });
504
+ });