@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.
- package/CHANGELOG.md +778 -0
- package/LICENSE +21 -0
- package/README.md +106 -0
- package/dist/_locale/index.js +18 -0
- package/dist/_locale/zh-CN.js +123 -0
- package/dist/_mixin/emitter.js +35 -0
- package/dist/_mixin/focus.js +13 -0
- package/dist/_mixin/locale.js +17 -0
- package/dist/_mixin/popper.js +192 -0
- package/dist/_mixin/tooltip.js +218 -0
- package/dist/_util/__test__/switchcase.test.js +43 -0
- package/dist/_util/autoprefixer.js +249 -0
- package/dist/_util/clickoutside.js +79 -0
- package/dist/_util/date.js +368 -0
- package/dist/_util/dateUtil.js +311 -0
- package/dist/_util/dom.js +240 -0
- package/dist/_util/getRequestAnimationFrame.js +50 -0
- package/dist/_util/getScroll.js +21 -0
- package/dist/_util/loaders/loaders.css.js +52 -0
- package/dist/_util/loaders/loading.js +53 -0
- package/dist/_util/merge.js +18 -0
- package/dist/_util/popper.js +1261 -0
- package/dist/_util/popup/index.js +232 -0
- package/dist/_util/popup/popup-manager.js +205 -0
- package/dist/_util/proptype.js +12 -0
- package/dist/_util/repeatClick.js +30 -0
- package/dist/_util/resize.js +61 -0
- package/dist/_util/resizeEvent.js +59 -0
- package/dist/_util/scrollIntoView.js +38 -0
- package/dist/_util/scrollbar-width.js +37 -0
- package/dist/_util/soda.js +54 -0
- package/dist/_util/switchcase.js +22 -0
- package/dist/_util/throttleByAnimationFrame.js +70 -0
- package/dist/_util/tree/node.js +412 -0
- package/dist/_util/tree/tree.js +410 -0
- package/dist/_util/util.js +166 -0
- package/dist/_util/vue-popper.js +213 -0
- package/dist/affix.js +509 -0
- package/dist/anchor.js +522 -0
- package/dist/avatar.js +437 -0
- package/dist/backtop.js +469 -0
- package/dist/badge.js +439 -0
- package/dist/bordershadow.js +310 -0
- package/dist/breadcrumb.js +434 -0
- package/dist/button.js +579 -0
- package/dist/card.js +514 -0
- package/dist/carousel.js +1326 -0
- package/dist/cascaderpanel.js +2320 -0
- package/dist/checkbox.js +681 -0
- package/dist/col.js +546 -0
- package/dist/collapse.js +671 -0
- package/dist/color.js +306 -0
- package/dist/datepicker.js +8089 -0
- package/dist/divider.js +346 -0
- package/dist/drawer.js +652 -0
- package/dist/dropdown.js +687 -0
- package/dist/empty.js +416 -0
- package/dist/font.js +306 -0
- package/dist/form.js +878 -0
- package/dist/icon.js +401 -0
- package/dist/index.js +1 -0
- package/dist/input.js +1251 -0
- package/dist/inputnumber.js +689 -0
- package/dist/layout.js +786 -0
- package/dist/list.js +789 -0
- package/dist/loading.js +430 -0
- package/dist/mds-ui.min.css +7 -0
- package/dist/mds-ui.min.js +64911 -0
- package/dist/menu.js +1131 -0
- package/dist/message.js +1016 -0
- package/dist/modal.js +895 -0
- package/dist/notification.js +818 -0
- package/dist/pagination.js +1213 -0
- package/dist/popconfirm.js +336 -0
- package/dist/popover.js +206 -0
- package/dist/progress.js +1023 -0
- package/dist/radio.js +760 -0
- package/dist/rate.js +765 -0
- package/dist/row.js +546 -0
- package/dist/select.js +4950 -0
- package/dist/slider.js +1411 -0
- package/dist/slottable.js +1414 -0
- package/dist/steps.js +546 -0
- package/dist/style/affix.css +5524 -0
- package/dist/style/anchor.css +5572 -0
- package/dist/style/avatar.css +5587 -0
- package/dist/style/backtop.css +34 -0
- package/dist/style/badge.css +5655 -0
- package/dist/style/bordershadow.css +5601 -0
- package/dist/style/breadcrumb.css +5551 -0
- package/dist/style/button.css +7679 -0
- package/dist/style/card.css +5670 -0
- package/dist/style/carousel.css +5731 -0
- package/dist/style/cascaderpanel.css +125 -0
- package/dist/style/checkbox.css +5700 -0
- package/dist/style/col.css +8121 -0
- package/dist/style/collapse.css +5593 -0
- package/dist/style/color.css +6136 -0
- package/dist/style/datepicker.css +5977 -0
- package/dist/style/divider.css +5558 -0
- package/dist/style/drawer.css +7979 -0
- package/dist/style/dropdown.css +7950 -0
- package/dist/style/empty.css +5563 -0
- package/dist/style/font.css +5559 -0
- package/dist/style/form.css +5662 -0
- package/dist/style/icon.css +5538 -0
- package/dist/style/input.css +6256 -0
- package/dist/style/inputnumber.css +5828 -0
- package/dist/style/layout.css +5572 -0
- package/dist/style/list.css +5655 -0
- package/dist/style/loading.css +5540 -0
- package/dist/style/menu.css +6183 -0
- package/dist/style/message.css +194 -0
- package/dist/style/modal.css +5637 -0
- package/dist/style/notification.css +5706 -0
- package/dist/style/pagination.css +6683 -0
- package/dist/style/popconfirm.css +7951 -0
- package/dist/style/popover.css +5727 -0
- package/dist/style/progress.css +5714 -0
- package/dist/style/radio.css +5769 -0
- package/dist/style/rate.css +5616 -0
- package/dist/style/row.css +8121 -0
- package/dist/style/select.css +5729 -0
- package/dist/style/slider.css +5594 -0
- package/dist/style/slottable.css +5831 -0
- package/dist/style/steps.css +6100 -0
- package/dist/style/switch.css +5624 -0
- package/dist/style/table.css +8392 -0
- package/dist/style/tabs.css +6047 -0
- package/dist/style/tag.css +5935 -0
- package/dist/style/text.css +5636 -0
- package/dist/style/timeline.css +5602 -0
- package/dist/style/timepicker.css +5904 -0
- package/dist/style/tooltip.css +5686 -0
- package/dist/style/transfer.css +101 -0
- package/dist/style/transition.css +1417 -0
- package/dist/style/tree.css +5598 -0
- package/dist/style/typography.css +5640 -0
- package/dist/style/upload.css +5834 -0
- package/dist/switch.js +448 -0
- package/dist/table.js +3809 -0
- package/dist/tabs.js +1273 -0
- package/dist/tag.js +478 -0
- package/dist/text.js +1100 -0
- package/dist/timeline.js +495 -0
- package/dist/timepicker.js +1567 -0
- package/dist/tooltip.js +179 -0
- package/dist/transfer.js +981 -0
- package/dist/transition.js +246 -0
- package/dist/tree.js +1866 -0
- package/dist/typography.js +469 -0
- package/dist/upload.js +1990 -0
- package/package.json +144 -0
package/dist/backtop.js
ADDED
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("./transition"), require("./_util/getScroll"), require("./_util/getRequestAnimationFrame"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["./transition", "./_util/getScroll", "./_util/getRequestAnimationFrame"], factory);
|
|
6
|
+
else {
|
|
7
|
+
var a = typeof exports === 'object' ? factory(require("./transition"), require("./_util/getScroll"), require("./_util/getRequestAnimationFrame")) : factory(root["./transition"], root["./_util/getScroll"], root["./_util/getRequestAnimationFrame"]);
|
|
8
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
+
}
|
|
10
|
+
})(window, function(__WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__38__, __WEBPACK_EXTERNAL_MODULE__59__) {
|
|
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 = 124);
|
|
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
|
+
/***/ 124:
|
|
207
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
208
|
+
|
|
209
|
+
"use strict";
|
|
210
|
+
// ESM COMPAT FLAG
|
|
211
|
+
__webpack_require__.r(__webpack_exports__);
|
|
212
|
+
|
|
213
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/backtop/back-top.vue?vue&type=template&id=0e601a8b&
|
|
214
|
+
var render = function () {
|
|
215
|
+
var _vm = this
|
|
216
|
+
var _h = _vm.$createElement
|
|
217
|
+
var _c = _vm._self._c || _h
|
|
218
|
+
return _c("mds-transition", { attrs: { type: "fade" } }, [
|
|
219
|
+
_vm.visible
|
|
220
|
+
? _c(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
ref: "BackTop",
|
|
224
|
+
class: _vm.prefixCls,
|
|
225
|
+
on: { click: _vm.scrollToTop },
|
|
226
|
+
},
|
|
227
|
+
[
|
|
228
|
+
_vm._t("default"),
|
|
229
|
+
_vm.$slots.default === undefined
|
|
230
|
+
? _c("div", { class: _vm.prefixCls + "-content" }, [
|
|
231
|
+
_c(
|
|
232
|
+
"svg",
|
|
233
|
+
{
|
|
234
|
+
staticClass: "icon",
|
|
235
|
+
class: _vm.prefixCls + "-icon",
|
|
236
|
+
attrs: {
|
|
237
|
+
t: "1562838530206",
|
|
238
|
+
viewBox: "0 0 1024 1024",
|
|
239
|
+
version: "1.1",
|
|
240
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
241
|
+
"p-id": "4044",
|
|
242
|
+
width: "40",
|
|
243
|
+
height: "40",
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
[
|
|
247
|
+
_c("path", {
|
|
248
|
+
attrs: {
|
|
249
|
+
d: "M537.6 523.8784V729.6a38.4 38.4 0 0 1-76.8 0v-205.7216l-79.2576 79.2832a38.4 38.4 0 0 1-54.3232-54.3232l144.8192-144.8192c7.5008-7.4752 17.3312-11.2384 27.1616-11.2384 9.8304 0 19.6608 3.7632 27.136 11.264l144.8448 144.7936a38.4 38.4 0 1 1-54.3232 54.3232L537.6 523.8784zM345.6 281.6h307.2a38.4 38.4 0 0 1 0 76.8h-307.2a38.4 38.4 0 0 1 0-76.8z",
|
|
250
|
+
fill: "#666666",
|
|
251
|
+
"p-id": "4045",
|
|
252
|
+
},
|
|
253
|
+
}),
|
|
254
|
+
]
|
|
255
|
+
),
|
|
256
|
+
])
|
|
257
|
+
: _vm._e(),
|
|
258
|
+
],
|
|
259
|
+
2
|
|
260
|
+
)
|
|
261
|
+
: _vm._e(),
|
|
262
|
+
])
|
|
263
|
+
}
|
|
264
|
+
var staticRenderFns = []
|
|
265
|
+
render._withStripped = true
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
// CONCATENATED MODULE: ./components/backtop/back-top.vue?vue&type=template&id=0e601a8b&
|
|
269
|
+
|
|
270
|
+
// EXTERNAL MODULE: external "./transition"
|
|
271
|
+
var external_transition_ = __webpack_require__(13);
|
|
272
|
+
var external_transition_default = /*#__PURE__*/__webpack_require__.n(external_transition_);
|
|
273
|
+
|
|
274
|
+
// EXTERNAL MODULE: external "./_util/getScroll"
|
|
275
|
+
var getScroll_ = __webpack_require__(38);
|
|
276
|
+
var getScroll_default = /*#__PURE__*/__webpack_require__.n(getScroll_);
|
|
277
|
+
|
|
278
|
+
// EXTERNAL MODULE: external "./_util/getRequestAnimationFrame"
|
|
279
|
+
var getRequestAnimationFrame_ = __webpack_require__(59);
|
|
280
|
+
var getRequestAnimationFrame_default = /*#__PURE__*/__webpack_require__.n(getRequestAnimationFrame_);
|
|
281
|
+
|
|
282
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/backtop/back-top.vue?vue&type=script&lang=js&
|
|
283
|
+
//
|
|
284
|
+
//
|
|
285
|
+
//
|
|
286
|
+
//
|
|
287
|
+
//
|
|
288
|
+
//
|
|
289
|
+
//
|
|
290
|
+
//
|
|
291
|
+
//
|
|
292
|
+
//
|
|
293
|
+
//
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
var reqAnimFrame = getRequestAnimationFrame_default()();
|
|
300
|
+
|
|
301
|
+
var easeInOutCubic = function easeInOutCubic(t, b, c, d) {
|
|
302
|
+
var cc = c - b;
|
|
303
|
+
t /= d / 2;
|
|
304
|
+
if (t < 1) {
|
|
305
|
+
return cc / 2 * t * t * t + b;
|
|
306
|
+
} else {
|
|
307
|
+
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
/* harmony default export */ var back_topvue_type_script_lang_js_ = ({
|
|
312
|
+
name: 'MdsBackTop',
|
|
313
|
+
data: function data() {
|
|
314
|
+
return {
|
|
315
|
+
visible: true
|
|
316
|
+
};
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
props: {
|
|
320
|
+
prefixCls: {
|
|
321
|
+
type: String,
|
|
322
|
+
default: 'mds-back-top'
|
|
323
|
+
},
|
|
324
|
+
target: {
|
|
325
|
+
type: Function,
|
|
326
|
+
default: function _default() {
|
|
327
|
+
return window;
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
time: {
|
|
331
|
+
type: Number,
|
|
332
|
+
default: 10
|
|
333
|
+
},
|
|
334
|
+
visibilityHeight: {
|
|
335
|
+
type: Number,
|
|
336
|
+
default: 400
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
mounted: function mounted() {
|
|
340
|
+
var getTarget = this.target;
|
|
341
|
+
this.scrollEvent = getTarget().addEventListener('scroll', this.handleScroll);
|
|
342
|
+
this.handleScroll();
|
|
343
|
+
document.body.appendChild(this.$refs.BackTop);
|
|
344
|
+
},
|
|
345
|
+
beforeDestroy: function beforeDestroy() {
|
|
346
|
+
document.body.removeChild(this.$refs.BackTop);
|
|
347
|
+
},
|
|
348
|
+
destroyed: function destroyed() {
|
|
349
|
+
if (this.scrollEvent) {
|
|
350
|
+
this.scrollEvent.remove();
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
methods: {
|
|
355
|
+
handleScroll: function handleScroll() {
|
|
356
|
+
var scrollTop = getScroll_default()(this.target(), true);
|
|
357
|
+
this.visible = scrollTop >= this.visibilityHeight;
|
|
358
|
+
},
|
|
359
|
+
getCurrentScrollTop: function getCurrentScrollTop() {
|
|
360
|
+
var getTarget = this.target;
|
|
361
|
+
var targetNode = getTarget();
|
|
362
|
+
if (targetNode === window) {
|
|
363
|
+
return window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
|
|
364
|
+
}
|
|
365
|
+
return targetNode.scrollTop;
|
|
366
|
+
},
|
|
367
|
+
setScrollTop: function setScrollTop(value) {
|
|
368
|
+
var getTarget = this.target;
|
|
369
|
+
var targetNode = getTarget();
|
|
370
|
+
if (targetNode === window) {
|
|
371
|
+
document.body.scrollTop = value;
|
|
372
|
+
document.documentElement.scrollTop = value;
|
|
373
|
+
} else {
|
|
374
|
+
targetNode.scrollTop = value;
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
scrollToTop: function scrollToTop(e) {
|
|
378
|
+
var _this = this;
|
|
379
|
+
|
|
380
|
+
var scrollTop = this.getCurrentScrollTop();
|
|
381
|
+
var startTime = Date.now();
|
|
382
|
+
var frameFunc = function frameFunc() {
|
|
383
|
+
var timestamp = Date.now();
|
|
384
|
+
var time = timestamp - startTime;
|
|
385
|
+
_this.setScrollTop(easeInOutCubic(time, scrollTop, 0, 450));
|
|
386
|
+
if (time < 450) {
|
|
387
|
+
reqAnimFrame(frameFunc);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
reqAnimFrame(frameFunc);
|
|
391
|
+
this.$emit('click', e);
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
components: {
|
|
395
|
+
MdsTransition: external_transition_default.a
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
// CONCATENATED MODULE: ./components/backtop/back-top.vue?vue&type=script&lang=js&
|
|
399
|
+
/* harmony default export */ var backtop_back_topvue_type_script_lang_js_ = (back_topvue_type_script_lang_js_);
|
|
400
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
401
|
+
var componentNormalizer = __webpack_require__(0);
|
|
402
|
+
|
|
403
|
+
// CONCATENATED MODULE: ./components/backtop/back-top.vue
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
/* normalize component */
|
|
410
|
+
|
|
411
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
412
|
+
backtop_back_topvue_type_script_lang_js_,
|
|
413
|
+
render,
|
|
414
|
+
staticRenderFns,
|
|
415
|
+
false,
|
|
416
|
+
null,
|
|
417
|
+
null,
|
|
418
|
+
null
|
|
419
|
+
|
|
420
|
+
)
|
|
421
|
+
|
|
422
|
+
/* hot reload */
|
|
423
|
+
if (false) { var api; }
|
|
424
|
+
component.options.__file = "components/backtop/back-top.vue"
|
|
425
|
+
/* harmony default export */ var back_top = (component.exports);
|
|
426
|
+
// EXTERNAL MODULE: ./components/backtop/style/index.less
|
|
427
|
+
var style = __webpack_require__(139);
|
|
428
|
+
|
|
429
|
+
// CONCATENATED MODULE: ./components/backtop/index.js
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
/* istanbul ignore next */
|
|
433
|
+
back_top.install = function (Vue) {
|
|
434
|
+
Vue.component(back_top.name, back_top);
|
|
435
|
+
};
|
|
436
|
+
/* harmony default export */ var backtop = __webpack_exports__["default"] = (back_top);
|
|
437
|
+
|
|
438
|
+
/***/ }),
|
|
439
|
+
|
|
440
|
+
/***/ 13:
|
|
441
|
+
/***/ (function(module, exports) {
|
|
442
|
+
|
|
443
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
|
|
444
|
+
|
|
445
|
+
/***/ }),
|
|
446
|
+
|
|
447
|
+
/***/ 139:
|
|
448
|
+
/***/ (function(module, exports) {
|
|
449
|
+
|
|
450
|
+
// removed by extract-text-webpack-plugin
|
|
451
|
+
|
|
452
|
+
/***/ }),
|
|
453
|
+
|
|
454
|
+
/***/ 38:
|
|
455
|
+
/***/ (function(module, exports) {
|
|
456
|
+
|
|
457
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__38__;
|
|
458
|
+
|
|
459
|
+
/***/ }),
|
|
460
|
+
|
|
461
|
+
/***/ 59:
|
|
462
|
+
/***/ (function(module, exports) {
|
|
463
|
+
|
|
464
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__59__;
|
|
465
|
+
|
|
466
|
+
/***/ })
|
|
467
|
+
|
|
468
|
+
/******/ });
|
|
469
|
+
});
|