@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
|
@@ -0,0 +1,1567 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("./_util/proptype"), require("./icon"), require("vue"), require("./_mixin/emitter"), require("./transition"), require("./_mixin/popper"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["./_util/proptype", "./icon", "vue", "./_mixin/emitter", "./transition", "./_mixin/popper"], factory);
|
|
6
|
+
else {
|
|
7
|
+
var a = typeof exports === 'object' ? factory(require("./_util/proptype"), require("./icon"), require("vue"), require("./_mixin/emitter"), require("./transition"), require("./_mixin/popper")) : factory(root["./_util/proptype"], root["./icon"], root["Vue"], root["./_mixin/emitter"], root["./transition"], root["./_mixin/popper"]);
|
|
8
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
+
}
|
|
10
|
+
})(window, function(__WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__6__, __WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__44__) {
|
|
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 = 87);
|
|
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
|
+
/***/ 1:
|
|
207
|
+
/***/ (function(module, exports) {
|
|
208
|
+
|
|
209
|
+
module.exports = require("babel-runtime/helpers/defineProperty");
|
|
210
|
+
|
|
211
|
+
/***/ }),
|
|
212
|
+
|
|
213
|
+
/***/ 13:
|
|
214
|
+
/***/ (function(module, exports) {
|
|
215
|
+
|
|
216
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
|
|
217
|
+
|
|
218
|
+
/***/ }),
|
|
219
|
+
|
|
220
|
+
/***/ 131:
|
|
221
|
+
/***/ (function(module, exports) {
|
|
222
|
+
|
|
223
|
+
// removed by extract-text-webpack-plugin
|
|
224
|
+
|
|
225
|
+
/***/ }),
|
|
226
|
+
|
|
227
|
+
/***/ 223:
|
|
228
|
+
/***/ (function(module, exports) {
|
|
229
|
+
|
|
230
|
+
// removed by extract-text-webpack-plugin
|
|
231
|
+
|
|
232
|
+
/***/ }),
|
|
233
|
+
|
|
234
|
+
/***/ 29:
|
|
235
|
+
/***/ (function(module, exports) {
|
|
236
|
+
|
|
237
|
+
module.exports = require("moment");
|
|
238
|
+
|
|
239
|
+
/***/ }),
|
|
240
|
+
|
|
241
|
+
/***/ 3:
|
|
242
|
+
/***/ (function(module, exports) {
|
|
243
|
+
|
|
244
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__3__;
|
|
245
|
+
|
|
246
|
+
/***/ }),
|
|
247
|
+
|
|
248
|
+
/***/ 4:
|
|
249
|
+
/***/ (function(module, exports) {
|
|
250
|
+
|
|
251
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__4__;
|
|
252
|
+
|
|
253
|
+
/***/ }),
|
|
254
|
+
|
|
255
|
+
/***/ 44:
|
|
256
|
+
/***/ (function(module, exports) {
|
|
257
|
+
|
|
258
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__44__;
|
|
259
|
+
|
|
260
|
+
/***/ }),
|
|
261
|
+
|
|
262
|
+
/***/ 5:
|
|
263
|
+
/***/ (function(module, exports) {
|
|
264
|
+
|
|
265
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__5__;
|
|
266
|
+
|
|
267
|
+
/***/ }),
|
|
268
|
+
|
|
269
|
+
/***/ 6:
|
|
270
|
+
/***/ (function(module, exports) {
|
|
271
|
+
|
|
272
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__6__;
|
|
273
|
+
|
|
274
|
+
/***/ }),
|
|
275
|
+
|
|
276
|
+
/***/ 87:
|
|
277
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
278
|
+
|
|
279
|
+
"use strict";
|
|
280
|
+
// ESM COMPAT FLAG
|
|
281
|
+
__webpack_require__.r(__webpack_exports__);
|
|
282
|
+
|
|
283
|
+
// EXTERNAL MODULE: ./components/style/index.less
|
|
284
|
+
var style = __webpack_require__(131);
|
|
285
|
+
|
|
286
|
+
// EXTERNAL MODULE: ./components/timepicker/style/index.less
|
|
287
|
+
var timepicker_style = __webpack_require__(223);
|
|
288
|
+
|
|
289
|
+
// CONCATENATED MODULE: ./components/timepicker/style/index.js
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
// style dependencies
|
|
294
|
+
// import '../../input/style'
|
|
295
|
+
// EXTERNAL MODULE: external "babel-runtime/helpers/defineProperty"
|
|
296
|
+
var defineProperty_ = __webpack_require__(1);
|
|
297
|
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
|
|
298
|
+
|
|
299
|
+
// EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
|
|
300
|
+
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(5);
|
|
301
|
+
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
|
|
302
|
+
|
|
303
|
+
// EXTERNAL MODULE: external "moment"
|
|
304
|
+
var external_moment_ = __webpack_require__(29);
|
|
305
|
+
var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_);
|
|
306
|
+
|
|
307
|
+
// EXTERNAL MODULE: external "./_mixin/popper"
|
|
308
|
+
var popper_ = __webpack_require__(44);
|
|
309
|
+
var popper_default = /*#__PURE__*/__webpack_require__.n(popper_);
|
|
310
|
+
|
|
311
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/header.vue?vue&type=template&id=94a41d54&
|
|
312
|
+
var headervue_type_template_id_94a41d54_render = function () {
|
|
313
|
+
var _vm = this
|
|
314
|
+
var _h = _vm.$createElement
|
|
315
|
+
var _c = _vm._self._c || _h
|
|
316
|
+
return _c(
|
|
317
|
+
"div",
|
|
318
|
+
{
|
|
319
|
+
class: [
|
|
320
|
+
_vm.prefixCls + "-input-wrap",
|
|
321
|
+
_vm.prefixCls + "-input-wrap-" + _vm.size,
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
[
|
|
325
|
+
_vm.isRange
|
|
326
|
+
? [
|
|
327
|
+
_c("div", { class: [this.prefixCls + "-box"] }, [
|
|
328
|
+
_c("input", {
|
|
329
|
+
class: [
|
|
330
|
+
_vm.prefixCls + "-input",
|
|
331
|
+
_vm.prefixCls + "-input-half",
|
|
332
|
+
_vm.invalid ? _vm.prefixCls + "-input-invalid" : "",
|
|
333
|
+
],
|
|
334
|
+
attrs: { readonly: "", placeholder: _vm.placeholder },
|
|
335
|
+
domProps: {
|
|
336
|
+
value:
|
|
337
|
+
(_vm.value[0] && _vm.value[0].format(this.format)) || "",
|
|
338
|
+
},
|
|
339
|
+
}),
|
|
340
|
+
_c("span", { class: [this.prefixCls + "-box-span"] }, [
|
|
341
|
+
_vm._v("-"),
|
|
342
|
+
]),
|
|
343
|
+
_c("input", {
|
|
344
|
+
class: [
|
|
345
|
+
_vm.prefixCls + "-input",
|
|
346
|
+
_vm.prefixCls + "-input-half",
|
|
347
|
+
_vm.invalid ? _vm.prefixCls + "-input-invalid" : "",
|
|
348
|
+
],
|
|
349
|
+
attrs: { readonly: "", placeholder: _vm.placeholder },
|
|
350
|
+
domProps: {
|
|
351
|
+
value:
|
|
352
|
+
(_vm.value[1] && _vm.value[1].format(this.format)) || "",
|
|
353
|
+
},
|
|
354
|
+
}),
|
|
355
|
+
]),
|
|
356
|
+
]
|
|
357
|
+
: [
|
|
358
|
+
_c("input", {
|
|
359
|
+
class: [
|
|
360
|
+
_vm.prefixCls + "-input",
|
|
361
|
+
_vm.invalid ? _vm.prefixCls + "-input-invalid" : "",
|
|
362
|
+
],
|
|
363
|
+
attrs: { readonly: "", placeholder: _vm.placeholder },
|
|
364
|
+
domProps: {
|
|
365
|
+
value: (_vm.value && _vm.value.format(this.format)) || "",
|
|
366
|
+
},
|
|
367
|
+
}),
|
|
368
|
+
],
|
|
369
|
+
_c(
|
|
370
|
+
"div",
|
|
371
|
+
{
|
|
372
|
+
class: _vm.prefixCls + "-clear-btn",
|
|
373
|
+
on: { click: _vm.handleClearClick },
|
|
374
|
+
},
|
|
375
|
+
[
|
|
376
|
+
_vm.allowEmpty
|
|
377
|
+
? _c("mds-icon", {
|
|
378
|
+
attrs: { title: _vm.clearText, type: "line-close" },
|
|
379
|
+
})
|
|
380
|
+
: _vm._e(),
|
|
381
|
+
],
|
|
382
|
+
1
|
|
383
|
+
),
|
|
384
|
+
],
|
|
385
|
+
2
|
|
386
|
+
)
|
|
387
|
+
}
|
|
388
|
+
var staticRenderFns = []
|
|
389
|
+
headervue_type_template_id_94a41d54_render._withStripped = true
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
// CONCATENATED MODULE: ./components/timepicker/header.vue?vue&type=template&id=94a41d54&
|
|
393
|
+
|
|
394
|
+
// EXTERNAL MODULE: external "./icon"
|
|
395
|
+
var external_icon_ = __webpack_require__(4);
|
|
396
|
+
var external_icon_default = /*#__PURE__*/__webpack_require__.n(external_icon_);
|
|
397
|
+
|
|
398
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/header.vue?vue&type=script&lang=js&
|
|
399
|
+
//
|
|
400
|
+
//
|
|
401
|
+
//
|
|
402
|
+
//
|
|
403
|
+
//
|
|
404
|
+
//
|
|
405
|
+
//
|
|
406
|
+
//
|
|
407
|
+
//
|
|
408
|
+
//
|
|
409
|
+
//
|
|
410
|
+
//
|
|
411
|
+
//
|
|
412
|
+
//
|
|
413
|
+
//
|
|
414
|
+
//
|
|
415
|
+
//
|
|
416
|
+
//
|
|
417
|
+
//
|
|
418
|
+
//
|
|
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
|
+
//
|
|
446
|
+
//
|
|
447
|
+
//
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
/* harmony default export */ var headervue_type_script_lang_js_ = ({
|
|
451
|
+
components: {
|
|
452
|
+
MdsIcon: external_icon_default.a
|
|
453
|
+
},
|
|
454
|
+
props: {
|
|
455
|
+
prefixCls: String,
|
|
456
|
+
allowEmpty: {
|
|
457
|
+
type: Boolean,
|
|
458
|
+
default: true
|
|
459
|
+
},
|
|
460
|
+
clearText: {
|
|
461
|
+
type: String,
|
|
462
|
+
default: 'clear'
|
|
463
|
+
},
|
|
464
|
+
isRange: Boolean,
|
|
465
|
+
format: String,
|
|
466
|
+
invalid: {
|
|
467
|
+
type: Boolean,
|
|
468
|
+
default: false
|
|
469
|
+
},
|
|
470
|
+
size: String,
|
|
471
|
+
placeholder: String,
|
|
472
|
+
value: null
|
|
473
|
+
},
|
|
474
|
+
methods: {
|
|
475
|
+
handleClearClick: function handleClearClick(e) {
|
|
476
|
+
this.$emit('clear', e);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
// CONCATENATED MODULE: ./components/timepicker/header.vue?vue&type=script&lang=js&
|
|
481
|
+
/* harmony default export */ var timepicker_headervue_type_script_lang_js_ = (headervue_type_script_lang_js_);
|
|
482
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
483
|
+
var componentNormalizer = __webpack_require__(0);
|
|
484
|
+
|
|
485
|
+
// CONCATENATED MODULE: ./components/timepicker/header.vue
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
/* normalize component */
|
|
492
|
+
|
|
493
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
494
|
+
timepicker_headervue_type_script_lang_js_,
|
|
495
|
+
headervue_type_template_id_94a41d54_render,
|
|
496
|
+
staticRenderFns,
|
|
497
|
+
false,
|
|
498
|
+
null,
|
|
499
|
+
null,
|
|
500
|
+
null
|
|
501
|
+
|
|
502
|
+
)
|
|
503
|
+
|
|
504
|
+
/* hot reload */
|
|
505
|
+
if (false) { var api; }
|
|
506
|
+
component.options.__file = "components/timepicker/header.vue"
|
|
507
|
+
/* harmony default export */ var header = (component.exports);
|
|
508
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/select.vue?vue&type=template&id=45c91776&
|
|
509
|
+
var selectvue_type_template_id_45c91776_render = function () {
|
|
510
|
+
var _vm = this
|
|
511
|
+
var _h = _vm.$createElement
|
|
512
|
+
var _c = _vm._self._c || _h
|
|
513
|
+
return _c(
|
|
514
|
+
"div",
|
|
515
|
+
{
|
|
516
|
+
class: _vm.classes,
|
|
517
|
+
on: {
|
|
518
|
+
mouseenter: _vm.handleMouseEnter,
|
|
519
|
+
mouseleave: _vm.handleMouseLeave,
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
[
|
|
523
|
+
_c(
|
|
524
|
+
"ul",
|
|
525
|
+
{ ref: "list" },
|
|
526
|
+
_vm._l(_vm.options, function (item, index) {
|
|
527
|
+
var _obj
|
|
528
|
+
return _c(
|
|
529
|
+
"li",
|
|
530
|
+
{
|
|
531
|
+
key: item.value,
|
|
532
|
+
class:
|
|
533
|
+
((_obj = {}),
|
|
534
|
+
(_obj[_vm.prefixCls + "-select-option-selected"] =
|
|
535
|
+
_vm.selectedIndex === index),
|
|
536
|
+
(_obj[_vm.prefixCls + "-select-option-disabled"] =
|
|
537
|
+
item.disabled),
|
|
538
|
+
_obj),
|
|
539
|
+
attrs: { disabled: item.disabled },
|
|
540
|
+
on: {
|
|
541
|
+
click: function ($event) {
|
|
542
|
+
!item.disabled ? _vm.handleClick(item.value) : null
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
[_vm._v("\n " + _vm._s(item.value) + "\n ")]
|
|
547
|
+
)
|
|
548
|
+
}),
|
|
549
|
+
0
|
|
550
|
+
),
|
|
551
|
+
]
|
|
552
|
+
)
|
|
553
|
+
}
|
|
554
|
+
var selectvue_type_template_id_45c91776_staticRenderFns = []
|
|
555
|
+
selectvue_type_template_id_45c91776_render._withStripped = true
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
// CONCATENATED MODULE: ./components/timepicker/select.vue?vue&type=template&id=45c91776&
|
|
559
|
+
|
|
560
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/select.vue?vue&type=script&lang=js&
|
|
561
|
+
|
|
562
|
+
//
|
|
563
|
+
//
|
|
564
|
+
//
|
|
565
|
+
//
|
|
566
|
+
//
|
|
567
|
+
//
|
|
568
|
+
//
|
|
569
|
+
//
|
|
570
|
+
//
|
|
571
|
+
//
|
|
572
|
+
//
|
|
573
|
+
//
|
|
574
|
+
//
|
|
575
|
+
//
|
|
576
|
+
//
|
|
577
|
+
//
|
|
578
|
+
//
|
|
579
|
+
//
|
|
580
|
+
//
|
|
581
|
+
//
|
|
582
|
+
//
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
var scrollTo = function scrollTo(element, to, duration) {
|
|
586
|
+
var requestAnimationFrame = window.requestAnimationFrame || function requestAnimationFrameTimeout() {
|
|
587
|
+
return setTimeout(arguments[0], 10);
|
|
588
|
+
};
|
|
589
|
+
// jump to target if duration zero
|
|
590
|
+
if (duration <= 0) {
|
|
591
|
+
element.scrollTop = to;
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
var difference = to - element.scrollTop;
|
|
595
|
+
var perTick = difference / duration * 10;
|
|
596
|
+
|
|
597
|
+
requestAnimationFrame(function () {
|
|
598
|
+
element.scrollTop = element.scrollTop + perTick;
|
|
599
|
+
if (element.scrollTop === to) return;
|
|
600
|
+
scrollTo(element, to, duration - 10);
|
|
601
|
+
});
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
/* harmony default export */ var selectvue_type_script_lang_js_ = ({
|
|
605
|
+
props: {
|
|
606
|
+
isShow: Boolean,
|
|
607
|
+
prefixCls: String,
|
|
608
|
+
options: Array,
|
|
609
|
+
selectedIndex: Number,
|
|
610
|
+
type: String
|
|
611
|
+
},
|
|
612
|
+
data: function data() {
|
|
613
|
+
return {
|
|
614
|
+
active: false
|
|
615
|
+
};
|
|
616
|
+
},
|
|
617
|
+
|
|
618
|
+
watch: {
|
|
619
|
+
isShow: function isShow(v) {
|
|
620
|
+
v && this.scrollToSelected(0);
|
|
621
|
+
},
|
|
622
|
+
selectedIndex: function selectedIndex(v) {
|
|
623
|
+
this.scrollToSelected(120);
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
methods: {
|
|
627
|
+
handleMouseEnter: function handleMouseEnter() {
|
|
628
|
+
this.active = true;
|
|
629
|
+
},
|
|
630
|
+
handleMouseLeave: function handleMouseLeave() {
|
|
631
|
+
this.active = false;
|
|
632
|
+
},
|
|
633
|
+
handleClick: function handleClick(value) {
|
|
634
|
+
this.$emit('selected', this.type, value);
|
|
635
|
+
},
|
|
636
|
+
scrollToSelected: function scrollToSelected(duration) {
|
|
637
|
+
var select = this.$el;
|
|
638
|
+
var list = this.$refs.list;
|
|
639
|
+
if (!list) {
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
var index = this.selectedIndex < 0 ? 0 : this.selectedIndex;
|
|
643
|
+
var topOption = list.children[index];
|
|
644
|
+
var to = topOption.offsetTop;
|
|
645
|
+
scrollTo(select, to, duration);
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
computed: {
|
|
649
|
+
classes: function classes() {
|
|
650
|
+
var prefixCls = this.prefixCls;
|
|
651
|
+
return [prefixCls + '-select', defineProperty_default()({}, prefixCls + '-select-active', this.active)];
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
mounted: function mounted() {
|
|
655
|
+
this.scrollToSelected(0);
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
// CONCATENATED MODULE: ./components/timepicker/select.vue?vue&type=script&lang=js&
|
|
659
|
+
/* harmony default export */ var timepicker_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
|
|
660
|
+
// CONCATENATED MODULE: ./components/timepicker/select.vue
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
/* normalize component */
|
|
667
|
+
|
|
668
|
+
var select_component = Object(componentNormalizer["a" /* default */])(
|
|
669
|
+
timepicker_selectvue_type_script_lang_js_,
|
|
670
|
+
selectvue_type_template_id_45c91776_render,
|
|
671
|
+
selectvue_type_template_id_45c91776_staticRenderFns,
|
|
672
|
+
false,
|
|
673
|
+
null,
|
|
674
|
+
null,
|
|
675
|
+
null
|
|
676
|
+
|
|
677
|
+
)
|
|
678
|
+
|
|
679
|
+
/* hot reload */
|
|
680
|
+
if (false) { var select_api; }
|
|
681
|
+
select_component.options.__file = "components/timepicker/select.vue"
|
|
682
|
+
/* harmony default export */ var timepicker_select = (select_component.exports);
|
|
683
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/combobox.vue?vue&type=script&lang=js&
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
var formatOption = function formatOption(option, disabledOptions) {
|
|
688
|
+
var value = option < 10 ? '0' + option : '' + option;
|
|
689
|
+
var disabled = disabledOptions && disabledOptions.indexOf(option) >= 0;
|
|
690
|
+
|
|
691
|
+
return {
|
|
692
|
+
value: value,
|
|
693
|
+
disabled: disabled
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
/* harmony default export */ var comboboxvue_type_script_lang_js_ = ({
|
|
698
|
+
props: {
|
|
699
|
+
prefixCls: String,
|
|
700
|
+
defaultOpenValue: Object,
|
|
701
|
+
disabledHours: Array,
|
|
702
|
+
disabledMinutes: Array,
|
|
703
|
+
disabledSeconds: Array,
|
|
704
|
+
format: String,
|
|
705
|
+
isShow: Boolean,
|
|
706
|
+
hourOptions: Array,
|
|
707
|
+
minuteOptions: Array,
|
|
708
|
+
secondOptions: Array,
|
|
709
|
+
showHour: Boolean,
|
|
710
|
+
showMinute: Boolean,
|
|
711
|
+
showSecond: Boolean,
|
|
712
|
+
use12Hours: Boolean,
|
|
713
|
+
isAM: Boolean,
|
|
714
|
+
index: Number,
|
|
715
|
+
value: null
|
|
716
|
+
},
|
|
717
|
+
components: {
|
|
718
|
+
MdsPickerSelect: timepicker_select
|
|
719
|
+
},
|
|
720
|
+
methods: {
|
|
721
|
+
handleSelected: function handleSelected(type, itemValue) {
|
|
722
|
+
var value = (this.value || this.defaultOpenValue).clone();
|
|
723
|
+
if (type === 'hour') {
|
|
724
|
+
if (this.use12Hours) {
|
|
725
|
+
if (this.isAM) {
|
|
726
|
+
value.hour(+itemValue % 12);
|
|
727
|
+
} else {
|
|
728
|
+
value.hour(+itemValue % 12 + 12);
|
|
729
|
+
}
|
|
730
|
+
} else {
|
|
731
|
+
value.hour(+itemValue);
|
|
732
|
+
}
|
|
733
|
+
} else if (type === 'minute') {
|
|
734
|
+
value.minute(+itemValue);
|
|
735
|
+
} else if (type === 'ampm') {
|
|
736
|
+
var ampm = itemValue.toUpperCase();
|
|
737
|
+
if (this.use12Hours) {
|
|
738
|
+
if (ampm === 'PM' && value.hour() < 12) {
|
|
739
|
+
value.hour(value.hour() % 12 + 12);
|
|
740
|
+
}
|
|
741
|
+
if (ampm === 'AM') {
|
|
742
|
+
if (value.hour() >= 12) {
|
|
743
|
+
value.hour(value.hour() - 12);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
} else {
|
|
748
|
+
value.second(+itemValue);
|
|
749
|
+
}
|
|
750
|
+
this.$emit('change', value, this.index);
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
render: function render(h) {
|
|
754
|
+
var _this = this;
|
|
755
|
+
|
|
756
|
+
var value = this.value || this.defaultOpenValue;
|
|
757
|
+
|
|
758
|
+
var getHourSelect = function getHourSelect(hour) {
|
|
759
|
+
if (!_this.showHour) {
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
var disabledOptions = _this.disabledHours;
|
|
763
|
+
var hourOptionsAdj = _this.use12Hours ? [12].concat(_this.hourOptions.filter(function (h) {
|
|
764
|
+
return h < 12 && h > 0;
|
|
765
|
+
})) : _this.hourOptions;
|
|
766
|
+
var hourAdj = _this.use12Hours ? hour % 12 || 12 : hour;
|
|
767
|
+
var options = hourOptionsAdj.map(function (el) {
|
|
768
|
+
return formatOption(el, disabledOptions);
|
|
769
|
+
});
|
|
770
|
+
var selectedIndex = hourOptionsAdj.indexOf(hourAdj);
|
|
771
|
+
|
|
772
|
+
return h(timepicker_select, {
|
|
773
|
+
attrs: {
|
|
774
|
+
isShow: _this.isShow,
|
|
775
|
+
prefixCls: _this.prefixCls,
|
|
776
|
+
options: options,
|
|
777
|
+
selectedIndex: selectedIndex,
|
|
778
|
+
|
|
779
|
+
type: 'hour' },
|
|
780
|
+
on: {
|
|
781
|
+
'selected': _this.handleSelected
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
var getMinuteSelect = function getMinuteSelect(minute) {
|
|
787
|
+
if (!_this.showMinute) {
|
|
788
|
+
return null;
|
|
789
|
+
}
|
|
790
|
+
var disabledOptions = _this.disabledMinutes;
|
|
791
|
+
var options = _this.minuteOptions.map(function (option) {
|
|
792
|
+
return formatOption(option, disabledOptions);
|
|
793
|
+
});
|
|
794
|
+
var selectedIndex = _this.minuteOptions.indexOf(minute);
|
|
795
|
+
|
|
796
|
+
return h(timepicker_select, {
|
|
797
|
+
attrs: {
|
|
798
|
+
isShow: _this.isShow,
|
|
799
|
+
prefixCls: _this.prefixCls,
|
|
800
|
+
options: options,
|
|
801
|
+
selectedIndex: selectedIndex,
|
|
802
|
+
type: 'minute'
|
|
803
|
+
},
|
|
804
|
+
on: {
|
|
805
|
+
'selected': _this.handleSelected
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
var getSecondSelect = function getSecondSelect(second) {
|
|
811
|
+
if (!_this.showSecond) {
|
|
812
|
+
return null;
|
|
813
|
+
}
|
|
814
|
+
var disabledOptions = _this.disabledSeconds;
|
|
815
|
+
var options = _this.secondOptions.map(function (option) {
|
|
816
|
+
return formatOption(option, disabledOptions);
|
|
817
|
+
});
|
|
818
|
+
var selectedIndex = _this.secondOptions.indexOf(second);
|
|
819
|
+
|
|
820
|
+
return h(timepicker_select, {
|
|
821
|
+
attrs: {
|
|
822
|
+
isShow: _this.isShow,
|
|
823
|
+
prefixCls: _this.prefixCls,
|
|
824
|
+
options: options,
|
|
825
|
+
selectedIndex: selectedIndex,
|
|
826
|
+
type: 'second'
|
|
827
|
+
},
|
|
828
|
+
on: {
|
|
829
|
+
'selected': _this.handleSelected
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
var getAMPMSelect = function getAMPMSelect() {
|
|
835
|
+
if (!_this.use12Hours) {
|
|
836
|
+
return null;
|
|
837
|
+
}
|
|
838
|
+
var AMPMOptions = ['am', 'pm'] // If format has A char, then we should uppercase AM/PM
|
|
839
|
+
.map(function (c) {
|
|
840
|
+
return _this.format.match(/\sA/) ? c.toUpperCase() : c;
|
|
841
|
+
}).map(function (c) {
|
|
842
|
+
return { value: c };
|
|
843
|
+
});
|
|
844
|
+
|
|
845
|
+
var selectedIndex = _this.isAM ? 0 : 1;
|
|
846
|
+
|
|
847
|
+
return h(timepicker_select, {
|
|
848
|
+
attrs: {
|
|
849
|
+
isShow: _this.isShow,
|
|
850
|
+
prefixCls: _this.prefixCls,
|
|
851
|
+
options: AMPMOptions,
|
|
852
|
+
selectedIndex: selectedIndex,
|
|
853
|
+
type: 'ampm'
|
|
854
|
+
},
|
|
855
|
+
on: {
|
|
856
|
+
'selected': _this.handleSelected
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
var addon = function addon() {
|
|
862
|
+
if (!_this.$slots.default) {
|
|
863
|
+
return null;
|
|
864
|
+
}
|
|
865
|
+
return h(
|
|
866
|
+
'div',
|
|
867
|
+
{ 'class': _this.prefixCls + '-addon' },
|
|
868
|
+
[_this.$slots.default]
|
|
869
|
+
);
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
return h(
|
|
873
|
+
'div',
|
|
874
|
+
{ 'class': this.prefixCls + '-combobox' },
|
|
875
|
+
[getHourSelect(value.hour()), getMinuteSelect(value.minute()), getSecondSelect(value.second()), getAMPMSelect(), addon()]
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
// CONCATENATED MODULE: ./components/timepicker/combobox.vue?vue&type=script&lang=js&
|
|
880
|
+
/* harmony default export */ var timepicker_comboboxvue_type_script_lang_js_ = (comboboxvue_type_script_lang_js_);
|
|
881
|
+
// CONCATENATED MODULE: ./components/timepicker/combobox.vue
|
|
882
|
+
var combobox_render, combobox_staticRenderFns
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
/* normalize component */
|
|
888
|
+
|
|
889
|
+
var combobox_component = Object(componentNormalizer["a" /* default */])(
|
|
890
|
+
timepicker_comboboxvue_type_script_lang_js_,
|
|
891
|
+
combobox_render,
|
|
892
|
+
combobox_staticRenderFns,
|
|
893
|
+
false,
|
|
894
|
+
null,
|
|
895
|
+
null,
|
|
896
|
+
null
|
|
897
|
+
|
|
898
|
+
)
|
|
899
|
+
|
|
900
|
+
/* hot reload */
|
|
901
|
+
if (false) { var combobox_api; }
|
|
902
|
+
combobox_component.options.__file = "components/timepicker/combobox.vue"
|
|
903
|
+
/* harmony default export */ var combobox = (combobox_component.exports);
|
|
904
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/panel.vue?vue&type=script&lang=js&
|
|
905
|
+
//
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
var generateOptions = function generateOptions(length, disabledOptions, hideDisabledOptions) {
|
|
911
|
+
var step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
912
|
+
|
|
913
|
+
var arr = [];
|
|
914
|
+
for (var value = 0; value < length; value += step) {
|
|
915
|
+
if (!disabledOptions || disabledOptions.indexOf(value) < 0 || !hideDisabledOptions) {
|
|
916
|
+
arr.push(value);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
return arr;
|
|
920
|
+
};
|
|
921
|
+
var isAM = function isAM(value) {
|
|
922
|
+
return value && value.hour() >= 0 && value.hour() < 12;
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
/* harmony default export */ var panelvue_type_script_lang_js_ = ({
|
|
926
|
+
props: {
|
|
927
|
+
prefixCls: String,
|
|
928
|
+
defaultOpenValue: Object,
|
|
929
|
+
disabledHours: Function,
|
|
930
|
+
disabledMinutes: Function,
|
|
931
|
+
disabledSeconds: Function,
|
|
932
|
+
isRange: Boolean,
|
|
933
|
+
isShow: Boolean,
|
|
934
|
+
format: String,
|
|
935
|
+
hideDisabledOptions: Boolean,
|
|
936
|
+
hourOptions: Array,
|
|
937
|
+
minuteOptions: Array,
|
|
938
|
+
placeholder: String,
|
|
939
|
+
size: String,
|
|
940
|
+
secondOptions: Array,
|
|
941
|
+
showHour: Boolean,
|
|
942
|
+
showMinute: Boolean,
|
|
943
|
+
showSecond: Boolean,
|
|
944
|
+
use12Hours: Boolean,
|
|
945
|
+
allowEmpty: Boolean,
|
|
946
|
+
value: null
|
|
947
|
+
},
|
|
948
|
+
components: {
|
|
949
|
+
MdsPickerHeader: header,
|
|
950
|
+
MdsPickerCombobox: combobox
|
|
951
|
+
},
|
|
952
|
+
methods: {
|
|
953
|
+
handleChange: function handleChange(value, index) {
|
|
954
|
+
if (typeof index === 'number' && this.isRange) {
|
|
955
|
+
var f = this.value[0] ? this.value[0].clone() : null;
|
|
956
|
+
var s = this.value[1] ? this.value[1].clone() : null;
|
|
957
|
+
var val = [f, s];
|
|
958
|
+
val[index] = value;
|
|
959
|
+
this.$emit('change', val);
|
|
960
|
+
} else {
|
|
961
|
+
this.$emit('change', value);
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
handleHeaderClick: function handleHeaderClick(e) {
|
|
965
|
+
this.$emit('clear', e);
|
|
966
|
+
}
|
|
967
|
+
},
|
|
968
|
+
render: function render(h) {
|
|
969
|
+
var _this = this;
|
|
970
|
+
|
|
971
|
+
var disabledHours = function disabledHours(value) {
|
|
972
|
+
var disabledOptions = _this.disabledHours();
|
|
973
|
+
var result = _this.use12Hours && Array.isArray(disabledOptions) ? isAM(value) ? disabledOptions.filter(function (h) {
|
|
974
|
+
return h < 12;
|
|
975
|
+
}).map(function (h) {
|
|
976
|
+
return h === 0 ? 12 : h;
|
|
977
|
+
}) : disabledOptions.map(function (h) {
|
|
978
|
+
return h === 12 ? 12 : h - 12;
|
|
979
|
+
}) : disabledOptions;
|
|
980
|
+
return result;
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
var getPickerCombobox = function getPickerCombobox(value) {
|
|
984
|
+
var otherValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
985
|
+
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
986
|
+
|
|
987
|
+
var disabledHourOptions = disabledHours(value);
|
|
988
|
+
var disabledMinuteOptions = _this.disabledMinutes(value ? value.hour() : null);
|
|
989
|
+
var disabledSecondOptions = _this.disabledSeconds(value ? value.hour() : null, value ? value.minute() : null);
|
|
990
|
+
if (index === 0 && otherValue) {
|
|
991
|
+
var totalHour = void 0;
|
|
992
|
+
_this.use12Hours ? totalHour = 12 : totalHour = 24;
|
|
993
|
+
for (var i = otherValue.hour() + 1; i < totalHour; i++) {
|
|
994
|
+
if (disabledHourOptions.indexOf(i) < 0) disabledHourOptions.push(i);
|
|
995
|
+
}
|
|
996
|
+
if (value && value.hour() >= otherValue.hour()) {
|
|
997
|
+
for (var _i = otherValue.minute(); _i <= 60; _i++) {
|
|
998
|
+
if (disabledMinuteOptions.indexOf(_i) < 0) disabledMinuteOptions.push(_i);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
if (value && value.hour() >= otherValue.hour() && value.minute() >= otherValue.minute()) {
|
|
1002
|
+
for (var _i2 = otherValue.second() + 1; _i2 <= 60; _i2++) {
|
|
1003
|
+
if (disabledSecondOptions.indexOf(_i2) < 0) disabledSecondOptions.push(_i2);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
} else if (index === 1 && otherValue) {
|
|
1007
|
+
for (var _i3 = 0; _i3 < otherValue.hour(); _i3++) {
|
|
1008
|
+
if (disabledHourOptions.indexOf(_i3) < 0) disabledHourOptions.push(_i3);
|
|
1009
|
+
}
|
|
1010
|
+
if (value && value.hour() <= otherValue.hour()) {
|
|
1011
|
+
for (var _i4 = 0; _i4 < otherValue.minute(); _i4++) {
|
|
1012
|
+
if (disabledMinuteOptions.indexOf(_i4) < 0) disabledMinuteOptions.push(_i4);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
if (value && value.hour() <= otherValue.hour() && value.minute() <= otherValue.minute()) {
|
|
1016
|
+
for (var _i5 = 0; _i5 < otherValue.second(); _i5++) {
|
|
1017
|
+
if (disabledSecondOptions.indexOf(_i5) < 0) disabledSecondOptions.push(_i5);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
var hourOptions = generateOptions(24, disabledHourOptions, _this.hideDisabledOptions);
|
|
1023
|
+
var minuteOptions = generateOptions(60, disabledMinuteOptions, _this.hideDisabledOptions);
|
|
1024
|
+
var secondOptions = generateOptions(60, disabledSecondOptions, _this.hideDisabledOptions);
|
|
1025
|
+
return h(combobox, {
|
|
1026
|
+
attrs: {
|
|
1027
|
+
prefixCls: _this.prefixCls,
|
|
1028
|
+
defaultOpenValue: _this.defaultOpenValue,
|
|
1029
|
+
disabledHours: disabledHourOptions,
|
|
1030
|
+
disabledMinutes: disabledMinuteOptions,
|
|
1031
|
+
disabledSeconds: disabledSecondOptions,
|
|
1032
|
+
format: _this.format,
|
|
1033
|
+
isAM: isAM(value),
|
|
1034
|
+
isShow: _this.isShow,
|
|
1035
|
+
hideDisabledOptions: _this.hideDisabledOptions,
|
|
1036
|
+
hourOptions: hourOptions,
|
|
1037
|
+
minuteOptions: minuteOptions,
|
|
1038
|
+
secondOptions: secondOptions,
|
|
1039
|
+
showHour: _this.showHour,
|
|
1040
|
+
showMinute: _this.showMinute,
|
|
1041
|
+
showSecond: _this.showSecond,
|
|
1042
|
+
|
|
1043
|
+
use12Hours: _this.use12Hours,
|
|
1044
|
+
index: index,
|
|
1045
|
+
value: value },
|
|
1046
|
+
on: {
|
|
1047
|
+
'change': _this.handleChange
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
1050
|
+
};
|
|
1051
|
+
var getPickerBox = function getPickerBox() {
|
|
1052
|
+
var getPickerBottom = function getPickerBottom() {
|
|
1053
|
+
if (_this.$slots.default === undefined) {
|
|
1054
|
+
return '';
|
|
1055
|
+
} else {
|
|
1056
|
+
return h(
|
|
1057
|
+
'div',
|
|
1058
|
+
{ 'class': _this.prefixCls + '-picker-box-bottom' },
|
|
1059
|
+
[_this.$slots.default]
|
|
1060
|
+
);
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
if (_this.isRange) {
|
|
1064
|
+
return h(
|
|
1065
|
+
'div',
|
|
1066
|
+
{ 'class': _this.prefixCls + '-picker-box ' + _this.prefixCls + '-picker-half' },
|
|
1067
|
+
[h(
|
|
1068
|
+
'div',
|
|
1069
|
+
{ 'class': _this.prefixCls + '-picker-box-halfbox' },
|
|
1070
|
+
[h(
|
|
1071
|
+
'div',
|
|
1072
|
+
{ 'class': _this.prefixCls + '-picker-box-half' },
|
|
1073
|
+
[h('h2', ['\u5F00\u59CB\u65F6\u95F4']), getPickerCombobox(_this.value[0], _this.value[1], 0)]
|
|
1074
|
+
), h(
|
|
1075
|
+
'div',
|
|
1076
|
+
{ 'class': _this.prefixCls + '-picker-box-half' },
|
|
1077
|
+
[h('h2', ['\u7ED3\u675F\u65F6\u95F4']), getPickerCombobox(_this.value[1], _this.value[0], 1)]
|
|
1078
|
+
)]
|
|
1079
|
+
), getPickerBottom()]
|
|
1080
|
+
);
|
|
1081
|
+
} else {
|
|
1082
|
+
return h(
|
|
1083
|
+
'div',
|
|
1084
|
+
{ 'class': _this.prefixCls + '-picker-box' },
|
|
1085
|
+
[getPickerCombobox(_this.value), getPickerBottom()]
|
|
1086
|
+
);
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
return h(
|
|
1091
|
+
'div',
|
|
1092
|
+
{ 'class': this.prefixCls + '-inner' },
|
|
1093
|
+
[h(header, {
|
|
1094
|
+
attrs: {
|
|
1095
|
+
size: this.size,
|
|
1096
|
+
prefixCls: this.prefixCls,
|
|
1097
|
+
allowEmpty: this.allowEmpty,
|
|
1098
|
+
isRange: this.isRange,
|
|
1099
|
+
clearText: this.clearText,
|
|
1100
|
+
format: this.format,
|
|
1101
|
+
|
|
1102
|
+
placeholder: this.placeholder,
|
|
1103
|
+
value: this.value },
|
|
1104
|
+
on: {
|
|
1105
|
+
'clear': this.handleHeaderClick
|
|
1106
|
+
}
|
|
1107
|
+
}), getPickerBox()]
|
|
1108
|
+
);
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
// CONCATENATED MODULE: ./components/timepicker/panel.vue?vue&type=script&lang=js&
|
|
1112
|
+
/* harmony default export */ var timepicker_panelvue_type_script_lang_js_ = (panelvue_type_script_lang_js_);
|
|
1113
|
+
// CONCATENATED MODULE: ./components/timepicker/panel.vue
|
|
1114
|
+
var panel_render, panel_staticRenderFns
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
/* normalize component */
|
|
1120
|
+
|
|
1121
|
+
var panel_component = Object(componentNormalizer["a" /* default */])(
|
|
1122
|
+
timepicker_panelvue_type_script_lang_js_,
|
|
1123
|
+
panel_render,
|
|
1124
|
+
panel_staticRenderFns,
|
|
1125
|
+
false,
|
|
1126
|
+
null,
|
|
1127
|
+
null,
|
|
1128
|
+
null
|
|
1129
|
+
|
|
1130
|
+
)
|
|
1131
|
+
|
|
1132
|
+
/* hot reload */
|
|
1133
|
+
if (false) { var panel_api; }
|
|
1134
|
+
panel_component.options.__file = "components/timepicker/panel.vue"
|
|
1135
|
+
/* harmony default export */ var panel = (panel_component.exports);
|
|
1136
|
+
// EXTERNAL MODULE: external "./_util/proptype"
|
|
1137
|
+
var proptype_ = __webpack_require__(3);
|
|
1138
|
+
|
|
1139
|
+
// EXTERNAL MODULE: external "./transition"
|
|
1140
|
+
var external_transition_ = __webpack_require__(13);
|
|
1141
|
+
var external_transition_default = /*#__PURE__*/__webpack_require__.n(external_transition_);
|
|
1142
|
+
|
|
1143
|
+
// EXTERNAL MODULE: external "./_mixin/emitter"
|
|
1144
|
+
var emitter_ = __webpack_require__(6);
|
|
1145
|
+
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
1146
|
+
|
|
1147
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/time-picker.vue?vue&type=script&lang=js&
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
function generateShowHourMinuteSecond(format) {
|
|
1160
|
+
// Ref: http://momentjs.com/docs/#/parsing/string-format/
|
|
1161
|
+
return {
|
|
1162
|
+
showHour: format.indexOf('H') > -1 || format.indexOf('h') > -1 || format.indexOf('k') > -1,
|
|
1163
|
+
showMinute: format.indexOf('m') > -1,
|
|
1164
|
+
showSecond: format.indexOf('s') > -1
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/* harmony default export */ var time_pickervue_type_script_lang_js_ = ({
|
|
1169
|
+
name: 'MdsTimePicker',
|
|
1170
|
+
mixins: [popper_default.a, emitter_default.a],
|
|
1171
|
+
model: {
|
|
1172
|
+
event: 'change'
|
|
1173
|
+
},
|
|
1174
|
+
data: function data() {
|
|
1175
|
+
return {
|
|
1176
|
+
current: 0,
|
|
1177
|
+
showHour: true,
|
|
1178
|
+
showMinute: true,
|
|
1179
|
+
showSecond: true,
|
|
1180
|
+
popperModifiers: {
|
|
1181
|
+
inner: {
|
|
1182
|
+
enabled: true
|
|
1183
|
+
},
|
|
1184
|
+
offset: {
|
|
1185
|
+
offset: '2px'
|
|
1186
|
+
}
|
|
1187
|
+
},
|
|
1188
|
+
visible: false,
|
|
1189
|
+
momentValue: null
|
|
1190
|
+
};
|
|
1191
|
+
},
|
|
1192
|
+
|
|
1193
|
+
props: {
|
|
1194
|
+
prefixCls: {
|
|
1195
|
+
type: String,
|
|
1196
|
+
default: 'mds-time-picker'
|
|
1197
|
+
},
|
|
1198
|
+
width: {
|
|
1199
|
+
type: Number,
|
|
1200
|
+
default: 240
|
|
1201
|
+
},
|
|
1202
|
+
allowEmpty: {
|
|
1203
|
+
type: Boolean,
|
|
1204
|
+
default: true
|
|
1205
|
+
},
|
|
1206
|
+
clearText: {
|
|
1207
|
+
type: String,
|
|
1208
|
+
default: 'clear'
|
|
1209
|
+
},
|
|
1210
|
+
defaultOpenValue: {
|
|
1211
|
+
type: Object,
|
|
1212
|
+
validator: function validator(value) {
|
|
1213
|
+
return external_moment_default.a.isMoment(value);
|
|
1214
|
+
},
|
|
1215
|
+
|
|
1216
|
+
default: function _default() {
|
|
1217
|
+
return external_moment_default()();
|
|
1218
|
+
}
|
|
1219
|
+
},
|
|
1220
|
+
disabled: {
|
|
1221
|
+
type: Boolean,
|
|
1222
|
+
default: false
|
|
1223
|
+
},
|
|
1224
|
+
disabledHours: {
|
|
1225
|
+
type: Function,
|
|
1226
|
+
default: function _default() {
|
|
1227
|
+
return [];
|
|
1228
|
+
}
|
|
1229
|
+
},
|
|
1230
|
+
disabledMinutes: {
|
|
1231
|
+
type: Function,
|
|
1232
|
+
default: function _default(h) {
|
|
1233
|
+
return [];
|
|
1234
|
+
}
|
|
1235
|
+
},
|
|
1236
|
+
disabledSeconds: {
|
|
1237
|
+
type: Function,
|
|
1238
|
+
default: function _default(h, m) {
|
|
1239
|
+
return [];
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
format: {
|
|
1243
|
+
type: String,
|
|
1244
|
+
default: ''
|
|
1245
|
+
},
|
|
1246
|
+
valueFormat: {
|
|
1247
|
+
type: String,
|
|
1248
|
+
default: ''
|
|
1249
|
+
},
|
|
1250
|
+
hideDisabledOptions: {
|
|
1251
|
+
type: Boolean,
|
|
1252
|
+
default: false
|
|
1253
|
+
},
|
|
1254
|
+
open: {
|
|
1255
|
+
type: Boolean,
|
|
1256
|
+
default: false
|
|
1257
|
+
},
|
|
1258
|
+
placement: {
|
|
1259
|
+
type: String,
|
|
1260
|
+
default: 'topLeft'
|
|
1261
|
+
},
|
|
1262
|
+
placeholder: {
|
|
1263
|
+
type: String,
|
|
1264
|
+
default: '请选择时间'
|
|
1265
|
+
},
|
|
1266
|
+
startPlaceholder: {
|
|
1267
|
+
type: String,
|
|
1268
|
+
default: '开始时间'
|
|
1269
|
+
},
|
|
1270
|
+
endPlaceholder: {
|
|
1271
|
+
type: String,
|
|
1272
|
+
default: '结束时间'
|
|
1273
|
+
},
|
|
1274
|
+
popupClassName: {
|
|
1275
|
+
type: String,
|
|
1276
|
+
default: ''
|
|
1277
|
+
},
|
|
1278
|
+
size: {
|
|
1279
|
+
type: String,
|
|
1280
|
+
default: 'default',
|
|
1281
|
+
validator: function validator(value) {
|
|
1282
|
+
return Object(proptype_["oneOf"])(value, ['large', 'default', 'small', 'mini']);
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
use12Hours: {
|
|
1286
|
+
type: Boolean,
|
|
1287
|
+
default: false
|
|
1288
|
+
},
|
|
1289
|
+
isRange: {
|
|
1290
|
+
type: Boolean,
|
|
1291
|
+
default: false
|
|
1292
|
+
},
|
|
1293
|
+
value: {
|
|
1294
|
+
validator: function validator(value) {
|
|
1295
|
+
if (Array.isArray(value)) {
|
|
1296
|
+
return (value[0] ? external_moment_default.a.isMoment(value[0]) || typeof value[0] === 'string' : true) && (value[1] ? external_moment_default.a.isMoment(value[1]) || typeof value[1] === 'string' : true);
|
|
1297
|
+
} else {
|
|
1298
|
+
return typeof value === 'string' || external_moment_default.a.isMoment(value);
|
|
1299
|
+
}
|
|
1300
|
+
},
|
|
1301
|
+
|
|
1302
|
+
required: true
|
|
1303
|
+
}
|
|
1304
|
+
},
|
|
1305
|
+
components: {
|
|
1306
|
+
MdsPanel: panel,
|
|
1307
|
+
MdsTransition: external_transition_default.a,
|
|
1308
|
+
MdsIcon: external_icon_default.a
|
|
1309
|
+
},
|
|
1310
|
+
computed: {
|
|
1311
|
+
classes: function classes() {
|
|
1312
|
+
var _ref;
|
|
1313
|
+
|
|
1314
|
+
var prefixCls = this.prefixCls;
|
|
1315
|
+
return ['' + prefixCls, (_ref = {}, defineProperty_default()(_ref, prefixCls + '-' + this.size, !!this.size), defineProperty_default()(_ref, prefixCls + '-disabled', this.disabled), _ref)];
|
|
1316
|
+
},
|
|
1317
|
+
defaultFormat: function defaultFormat() {
|
|
1318
|
+
return this.format ? this.format : this.use12Hours ? 'h:mm:ss a' : 'HH:mm:ss';
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
created: function created() {
|
|
1322
|
+
this.initMomentValue();
|
|
1323
|
+
},
|
|
1324
|
+
mounted: function mounted() {
|
|
1325
|
+
this.popper = this.popperVM.$el;
|
|
1326
|
+
this.popper.style.width = this.$el.offsetWidth + 'px';
|
|
1327
|
+
this.reference = this.$refs.picker;
|
|
1328
|
+
this.visible = this.open;
|
|
1329
|
+
document.addEventListener('click', this.closePopper);
|
|
1330
|
+
},
|
|
1331
|
+
destroyed: function destroyed() {
|
|
1332
|
+
document.removeEventListener('click', this.closePopper);
|
|
1333
|
+
},
|
|
1334
|
+
|
|
1335
|
+
watch: {
|
|
1336
|
+
open: function open(v) {
|
|
1337
|
+
this.visible = v;
|
|
1338
|
+
},
|
|
1339
|
+
visible: function visible(v) {
|
|
1340
|
+
this.$emit('open-change', v);
|
|
1341
|
+
},
|
|
1342
|
+
value: function value(v) {
|
|
1343
|
+
this.initMomentValue();
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
methods: {
|
|
1347
|
+
initMomentValue: function initMomentValue() {
|
|
1348
|
+
if (this.isRange) {
|
|
1349
|
+
this.momentValue = [null, null];
|
|
1350
|
+
if (this.value[0]) {
|
|
1351
|
+
this.momentValue[0] = external_moment_default()(this.value[0], this.defaultFormat);
|
|
1352
|
+
}
|
|
1353
|
+
if (this.value[1]) {
|
|
1354
|
+
this.momentValue[1] = external_moment_default()(this.value[1], this.defaultFormat);
|
|
1355
|
+
}
|
|
1356
|
+
} else {
|
|
1357
|
+
if (this.value) {
|
|
1358
|
+
this.momentValue = external_moment_default()(this.value, this.defaultFormat);
|
|
1359
|
+
} else this.momentValue = null;
|
|
1360
|
+
}
|
|
1361
|
+
},
|
|
1362
|
+
handleClick: function handleClick() {
|
|
1363
|
+
if (this.disabled) {
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1366
|
+
this.visible = !this.visible;
|
|
1367
|
+
if (this.isRange) {
|
|
1368
|
+
this.$refs.inputF.blur();
|
|
1369
|
+
this.$refs.inputS.blur();
|
|
1370
|
+
} else {
|
|
1371
|
+
this.$refs.input.blur();
|
|
1372
|
+
}
|
|
1373
|
+
},
|
|
1374
|
+
handleChange: function handleChange(value) {
|
|
1375
|
+
if (this.isRange) {
|
|
1376
|
+
var formatValue = [];
|
|
1377
|
+
formatValue[0] = this.valueFormat ? value[0] ? value[0].format(this.valueFormat) : '' : value[0];
|
|
1378
|
+
formatValue[1] = this.valueFormat ? value[1] ? value[1].format(this.valueFormat) : '' : value[1];
|
|
1379
|
+
this.momentValue = value;
|
|
1380
|
+
this.$emit('change', formatValue);
|
|
1381
|
+
this.dispatch('MdsFormItem', 'formItemChange', formatValue);
|
|
1382
|
+
} else {
|
|
1383
|
+
var _formatValue = this.valueFormat ? value.format(this.valueFormat) : value;
|
|
1384
|
+
this.$emit('change', _formatValue);
|
|
1385
|
+
this.momentValue = value;
|
|
1386
|
+
this.dispatch('MdsFormItem', 'formItemChange', _formatValue);
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
handleClear: function handleClear(e) {
|
|
1390
|
+
if (this.isRange) {
|
|
1391
|
+
this.momentValue = [null, null];
|
|
1392
|
+
this.$emit('change', ['', '']);
|
|
1393
|
+
this.dispatch('MdsFormItem', 'formItemChange', ['', '']);
|
|
1394
|
+
} else {
|
|
1395
|
+
this.momentValue = '';
|
|
1396
|
+
this.$emit('change', '');
|
|
1397
|
+
this.dispatch('MdsFormItem', 'formItemChange', '');
|
|
1398
|
+
}
|
|
1399
|
+
this.visible = false;
|
|
1400
|
+
this.$emit('clear', e);
|
|
1401
|
+
},
|
|
1402
|
+
closePopper: function closePopper(e) {
|
|
1403
|
+
if (!this.visible || !this.$el || !this.reference || !this.popper || this.$el.contains(e.target) || this.reference.contains(e.target) || this.popper.contains(e.target)) return;
|
|
1404
|
+
this.visible = false;
|
|
1405
|
+
}
|
|
1406
|
+
},
|
|
1407
|
+
render: function render(h) {
|
|
1408
|
+
var _this = this;
|
|
1409
|
+
|
|
1410
|
+
if (this.isRange && !Array.isArray(this.value)) {
|
|
1411
|
+
throw new Error('传入的值必须为数组');
|
|
1412
|
+
} else if (!this.isRange && Array.isArray(this.value)) {
|
|
1413
|
+
throw new Error('传入的值不能为数组');
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
var _generateShowHourMinu = generateShowHourMinuteSecond(this.defaultFormat),
|
|
1417
|
+
showHour = _generateShowHourMinu.showHour,
|
|
1418
|
+
showMinute = _generateShowHourMinu.showMinute,
|
|
1419
|
+
showSecond = _generateShowHourMinu.showSecond;
|
|
1420
|
+
|
|
1421
|
+
var vm = this;
|
|
1422
|
+
this.popperVM = new external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a({
|
|
1423
|
+
render: function render(h) {
|
|
1424
|
+
return h(
|
|
1425
|
+
external_transition_default.a,
|
|
1426
|
+
{
|
|
1427
|
+
attrs: { type: 'slide', motion: 'up' }
|
|
1428
|
+
},
|
|
1429
|
+
[h(
|
|
1430
|
+
'div',
|
|
1431
|
+
{
|
|
1432
|
+
'class': [vm.prefixCls + '-panel', vm.popupClassName, defineProperty_default()({}, vm.prefixCls + '-panel-narrow', (!showHour || !showMinute || !showSecond) && !vm.use12Hours)],
|
|
1433
|
+
directives: [{
|
|
1434
|
+
name: 'show',
|
|
1435
|
+
value: vm.visible
|
|
1436
|
+
}],
|
|
1437
|
+
|
|
1438
|
+
ref: 'popper' },
|
|
1439
|
+
[h(
|
|
1440
|
+
panel,
|
|
1441
|
+
{
|
|
1442
|
+
attrs: {
|
|
1443
|
+
size: vm.size,
|
|
1444
|
+
allowEmpty: vm.allowEmpty,
|
|
1445
|
+
clearText: vm.clearText,
|
|
1446
|
+
defaultOpenValue: vm.defaultOpenValue,
|
|
1447
|
+
isRange: vm.isRange,
|
|
1448
|
+
disabledHours: vm.disabledHours,
|
|
1449
|
+
disabledMinutes: vm.disabledMinutes,
|
|
1450
|
+
disabledSeconds: vm.disabledSeconds,
|
|
1451
|
+
format: vm.defaultFormat,
|
|
1452
|
+
hideDisabledOptions: vm.hideDisabledOptions,
|
|
1453
|
+
prefixCls: vm.prefixCls + '-panel',
|
|
1454
|
+
placeholder: vm.placeholder,
|
|
1455
|
+
showHour: showHour,
|
|
1456
|
+
showMinute: showMinute,
|
|
1457
|
+
showSecond: showSecond,
|
|
1458
|
+
use12Hours: vm.use12Hours,
|
|
1459
|
+
isShow: vm.visible,
|
|
1460
|
+
|
|
1461
|
+
value: vm.momentValue },
|
|
1462
|
+
on: {
|
|
1463
|
+
'change': vm.handleChange,
|
|
1464
|
+
'clear': vm.handleClear
|
|
1465
|
+
}
|
|
1466
|
+
},
|
|
1467
|
+
[vm.$slots.default]
|
|
1468
|
+
)]
|
|
1469
|
+
)]
|
|
1470
|
+
);
|
|
1471
|
+
}
|
|
1472
|
+
}).$mount();
|
|
1473
|
+
var getInput = function getInput() {
|
|
1474
|
+
if (_this.isRange) {
|
|
1475
|
+
return h(
|
|
1476
|
+
'div',
|
|
1477
|
+
{ 'class': _this.prefixCls + '-box' },
|
|
1478
|
+
[h('input', {
|
|
1479
|
+
ref: 'inputF',
|
|
1480
|
+
'class': _this.prefixCls + '-input ' + _this.prefixCls + '-box-half',
|
|
1481
|
+
attrs: { disabled: _this.disabled,
|
|
1482
|
+
placeholder: _this.startPlaceholder
|
|
1483
|
+
},
|
|
1484
|
+
domProps: {
|
|
1485
|
+
'value': _this.momentValue[0] && _this.momentValue[0].format(_this.defaultFormat) || ''
|
|
1486
|
+
}
|
|
1487
|
+
}), h(
|
|
1488
|
+
'span',
|
|
1489
|
+
{ 'class': _this.prefixCls + '-box-span' },
|
|
1490
|
+
['-']
|
|
1491
|
+
), h('input', {
|
|
1492
|
+
ref: 'inputS',
|
|
1493
|
+
'class': _this.prefixCls + '-input ' + _this.prefixCls + '-box-half',
|
|
1494
|
+
attrs: { disabled: _this.disabled,
|
|
1495
|
+
placeholder: _this.endPlaceholder
|
|
1496
|
+
},
|
|
1497
|
+
domProps: {
|
|
1498
|
+
'value': _this.momentValue[1] && _this.momentValue[1].format(_this.defaultFormat) || ''
|
|
1499
|
+
}
|
|
1500
|
+
})]
|
|
1501
|
+
);
|
|
1502
|
+
} else {
|
|
1503
|
+
return h('input', {
|
|
1504
|
+
ref: 'input',
|
|
1505
|
+
'class': _this.prefixCls + '-input',
|
|
1506
|
+
attrs: { disabled: _this.disabled,
|
|
1507
|
+
placeholder: _this.placeholder
|
|
1508
|
+
},
|
|
1509
|
+
domProps: {
|
|
1510
|
+
'value': _this.momentValue && _this.momentValue.format(_this.defaultFormat) || ''
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
};
|
|
1515
|
+
return h(
|
|
1516
|
+
'span',
|
|
1517
|
+
{
|
|
1518
|
+
ref: 'picker',
|
|
1519
|
+
style: 'width: ' + this.width + 'px',
|
|
1520
|
+
'class': this.classes,
|
|
1521
|
+
on: {
|
|
1522
|
+
'click': this.handleClick
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
[getInput(), h(external_icon_default.a, { 'class': this.prefixCls + '-icon', attrs: { type: 'line-clock-circle-o' }
|
|
1526
|
+
})]
|
|
1527
|
+
);
|
|
1528
|
+
}
|
|
1529
|
+
});
|
|
1530
|
+
// CONCATENATED MODULE: ./components/timepicker/time-picker.vue?vue&type=script&lang=js&
|
|
1531
|
+
/* harmony default export */ var timepicker_time_pickervue_type_script_lang_js_ = (time_pickervue_type_script_lang_js_);
|
|
1532
|
+
// CONCATENATED MODULE: ./components/timepicker/time-picker.vue
|
|
1533
|
+
var time_picker_render, time_picker_staticRenderFns
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
/* normalize component */
|
|
1539
|
+
|
|
1540
|
+
var time_picker_component = Object(componentNormalizer["a" /* default */])(
|
|
1541
|
+
timepicker_time_pickervue_type_script_lang_js_,
|
|
1542
|
+
time_picker_render,
|
|
1543
|
+
time_picker_staticRenderFns,
|
|
1544
|
+
false,
|
|
1545
|
+
null,
|
|
1546
|
+
null,
|
|
1547
|
+
null
|
|
1548
|
+
|
|
1549
|
+
)
|
|
1550
|
+
|
|
1551
|
+
/* hot reload */
|
|
1552
|
+
if (false) { var time_picker_api; }
|
|
1553
|
+
time_picker_component.options.__file = "components/timepicker/time-picker.vue"
|
|
1554
|
+
/* harmony default export */ var time_picker = (time_picker_component.exports);
|
|
1555
|
+
// CONCATENATED MODULE: ./components/timepicker/index.js
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
/* istanbul ignore next */
|
|
1559
|
+
time_picker.install = function (Vue) {
|
|
1560
|
+
Vue.component(time_picker.name, time_picker);
|
|
1561
|
+
};
|
|
1562
|
+
/* harmony default export */ var timepicker = __webpack_exports__["default"] = (time_picker);
|
|
1563
|
+
|
|
1564
|
+
/***/ })
|
|
1565
|
+
|
|
1566
|
+
/******/ });
|
|
1567
|
+
});
|