ai.touchui-vue 1.32.1 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/lib/affix.js +2 -2
  2. package/lib/ai.touchui-vue.common.js +994 -881
  3. package/lib/align.js +2 -2
  4. package/lib/animation.js +2 -2
  5. package/lib/article.js +2 -2
  6. package/lib/box.js +2 -2
  7. package/lib/button.js +2 -2
  8. package/lib/calendar.js +2 -2
  9. package/lib/card-item.js +4 -4
  10. package/lib/card.js +178 -178
  11. package/lib/cascader.js +2 -2
  12. package/lib/center-scroll.js +2 -2
  13. package/lib/chat.js +4 -4
  14. package/lib/checkbox.js +2 -2
  15. package/lib/checkboxes.js +2 -2
  16. package/lib/collapse.js +771 -771
  17. package/lib/color.js +2 -2
  18. package/lib/countdown.js +2 -2
  19. package/lib/date-picker.js +1466 -1466
  20. package/lib/date-range.js +2 -2
  21. package/lib/dialog.js +2 -2
  22. package/lib/dis.js +2 -2
  23. package/lib/ellipsis.js +2 -2
  24. package/lib/emote.js +2 -2
  25. package/lib/export.js +10 -10
  26. package/lib/filter.js +2 -2
  27. package/lib/fix.js +2 -2
  28. package/lib/float.js +2 -2
  29. package/lib/flow.js +4 -4
  30. package/lib/form.js +2 -2
  31. package/lib/grid.js +2 -2
  32. package/lib/guider.js +2 -2
  33. package/lib/header.js +2 -2
  34. package/lib/hide.js +2 -2
  35. package/lib/icon.js +2 -2
  36. package/lib/import.js +12 -12
  37. package/lib/index.js +1 -1
  38. package/lib/input.js +62 -10
  39. package/lib/ip.js +2 -2
  40. package/lib/line.js +2 -2
  41. package/lib/loading.js +11 -11
  42. package/lib/longtap.js +2 -2
  43. package/lib/menu-icon.js +673 -670
  44. package/lib/message.js +2 -2
  45. package/lib/msg.js +19 -19
  46. package/lib/org.js +582 -582
  47. package/lib/padding.js +2 -2
  48. package/lib/page.js +578 -578
  49. package/lib/param.js +24 -8
  50. package/lib/pic.js +4 -4
  51. package/lib/popup.js +2 -2
  52. package/lib/progress.js +2 -2
  53. package/lib/range.js +452 -18
  54. package/lib/rate.js +2 -2
  55. package/lib/reverser.js +2 -2
  56. package/lib/scroll.js +2 -2
  57. package/lib/segment.js +2 -2
  58. package/lib/select.js +2 -2
  59. package/lib/size.js +2 -2
  60. package/lib/skeleton.js +2 -2
  61. package/lib/slide.js +2 -2
  62. package/lib/space.js +2 -2
  63. package/lib/step.js +2 -2
  64. package/lib/submit.js +2 -2
  65. package/lib/switch.js +2 -2
  66. package/lib/tab.js +5 -5
  67. package/lib/table.js +10 -10
  68. package/lib/tag.js +2 -2
  69. package/lib/timeline.js +2 -2
  70. package/lib/tip.js +2 -2
  71. package/lib/tooltip.js +2 -2
  72. package/lib/transfer.js +2 -2
  73. package/lib/tree.js +2 -2
  74. package/lib/upload.js +14 -14
  75. package/package.json +1 -1
  76. package/packages/input/src/input.vue +65 -7
  77. package/packages/param/src/param.vue +6 -2
  78. package/packages/range/src/range.vue +17 -14
  79. package/packages/tab/src/tab.vue +1 -1
  80. package/packages/table/src/table-head.vue +1 -1
  81. package/src/index.js +1 -1
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 343);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 346);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,788 +192,798 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 11:
195
+ /***/ 19:
196
196
  /***/ (function(module, exports, __webpack_require__) {
197
197
 
198
- "use strict";
199
-
200
-
201
- /*
202
- MIT License http://www.opensource.org/licenses/mit-license.php
203
- Author Tobias Koppers @sokra
204
- */
205
- // css base code, injected by the css-loader
206
- // eslint-disable-next-line func-names
207
- module.exports = function (useSourceMap) {
208
- var list = []; // return the list of modules as css string
209
-
210
- list.toString = function toString() {
211
- return this.map(function (item) {
212
- var content = cssWithMappingToString(item, useSourceMap);
213
-
214
- if (item[2]) {
215
- return "@media ".concat(item[2], "{").concat(content, "}");
216
- }
217
-
218
- return content;
219
- }).join('');
220
- }; // import a list of modules into the list
221
- // eslint-disable-next-line func-names
222
-
223
-
224
- list.i = function (modules, mediaQuery) {
225
- if (typeof modules === 'string') {
226
- // eslint-disable-next-line no-param-reassign
227
- modules = [[null, modules, '']];
228
- }
229
-
230
- var alreadyImportedModules = {};
198
+ var content = __webpack_require__(97);
231
199
 
232
- for (var i = 0; i < this.length; i++) {
233
- // eslint-disable-next-line prefer-destructuring
234
- var id = this[i][0];
200
+ if (typeof content === 'string') {
201
+ content = [[module.i, content, '']];
202
+ }
235
203
 
236
- if (id != null) {
237
- alreadyImportedModules[id] = true;
238
- }
239
- }
204
+ var options = {}
240
205
 
241
- for (var _i = 0; _i < modules.length; _i++) {
242
- var item = modules[_i]; // skip already imported module
243
- // this implementation is not 100% perfect for weird media query combinations
244
- // when a module is imported multiple times with different media queries.
245
- // I hope this will never occur (Hey this way we have smaller bundles)
206
+ options.insert = "head";
207
+ options.singleton = false;
246
208
 
247
- if (item[0] == null || !alreadyImportedModules[item[0]]) {
248
- if (mediaQuery && !item[2]) {
249
- item[2] = mediaQuery;
250
- } else if (mediaQuery) {
251
- item[2] = "(".concat(item[2], ") and (").concat(mediaQuery, ")");
252
- }
209
+ var update = __webpack_require__(8)(content, options);
253
210
 
254
- list.push(item);
255
- }
256
- }
257
- };
211
+ if (content.locals) {
212
+ module.exports = content.locals;
213
+ }
258
214
 
259
- return list;
260
- };
261
215
 
262
- function cssWithMappingToString(item, useSourceMap) {
263
- var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
216
+ /***/ }),
264
217
 
265
- var cssMapping = item[3];
218
+ /***/ 3:
219
+ /***/ (function(module, exports) {
266
220
 
267
- if (!cssMapping) {
268
- return content;
269
- }
221
+ module.exports = require("ai.touchui-vue/lib/locale");
270
222
 
271
- if (useSourceMap && typeof btoa === 'function') {
272
- var sourceMapping = toComment(cssMapping);
273
- var sourceURLs = cssMapping.sources.map(function (source) {
274
- return "/*# sourceURL=".concat(cssMapping.sourceRoot).concat(source, " */");
275
- });
276
- return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
277
- }
223
+ /***/ }),
278
224
 
279
- return [content].join('\n');
280
- } // Adapted from convert-source-map (MIT)
225
+ /***/ 346:
226
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
281
227
 
228
+ "use strict";
229
+ // ESM COMPAT FLAG
230
+ __webpack_require__.r(__webpack_exports__);
282
231
 
283
- function toComment(sourceMap) {
284
- // eslint-disable-next-line no-undef
285
- var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
286
- var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
287
- return "/*# ".concat(data, " */");
232
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/date-picker.vue?vue&type=template&id=535581e0
233
+ var render = function () {
234
+ var _vm = this
235
+ var _h = _vm.$createElement
236
+ var _c = _vm._self._c || _h
237
+ return _c(
238
+ "to-input",
239
+ {
240
+ ref: "inputBox",
241
+ staticClass: "to-date-picker",
242
+ attrs: {
243
+ id: _vm.id,
244
+ required: _vm.required,
245
+ desc: _vm.desc,
246
+ color: _vm.color,
247
+ prefix: _vm.prefix,
248
+ suffix: _vm.suffix,
249
+ mode: _vm.mode,
250
+ "prop-error-type": _vm.errorType,
251
+ "prop-error-tip": _vm.errorTip,
252
+ fillet: _vm.fillet,
253
+ "fillet-position": _vm.filletPosition,
254
+ value: _vm.datedisplay,
255
+ placeholder: _vm.placeholder,
256
+ readonly: _vm.disabled || !_vm.inputable,
257
+ "sp-chars": _vm.spChars,
258
+ link: !_vm.inputable && !_vm.disabled,
259
+ clearable: _vm.clearable && !_vm.disabled,
260
+ width: _vm.width,
261
+ comparable: _vm.comparable,
262
+ },
263
+ on: {
264
+ focus: function ($event) {
265
+ _vm.errorTip = ""
266
+ },
267
+ click: _vm.handleClick,
268
+ clear: function ($event) {
269
+ return _vm.clear()
270
+ },
271
+ input: _vm.handleDisplayChange,
272
+ blur: _vm.handleDisplayBlur,
273
+ },
274
+ },
275
+ [
276
+ _vm.type === "time"
277
+ ? _c("to-icon", {
278
+ class: _vm.disabled ? "to-dis" : "",
279
+ attrs: {
280
+ slot: "suffix",
281
+ link: _vm.inputable,
282
+ mode: "none",
283
+ color: "primary",
284
+ value: "time",
285
+ },
286
+ on: { click: _vm.showLayer },
287
+ slot: "suffix",
288
+ })
289
+ : _c("to-icon", {
290
+ class: _vm.disabled ? "to-dis" : "",
291
+ attrs: {
292
+ slot: "suffix",
293
+ link: _vm.inputable,
294
+ mode: "none",
295
+ color: "primary",
296
+ value: "date",
297
+ },
298
+ on: { click: _vm.showLayer },
299
+ slot: "suffix",
300
+ }),
301
+ _c(
302
+ "to-float",
303
+ {
304
+ ref: "layer",
305
+ attrs: {
306
+ lazy: _vm.lazy,
307
+ slide: _vm.layerSlide,
308
+ position: _vm.layerPosition,
309
+ paddng: 0.5,
310
+ width: _vm.$platform === "pc" ? 23 : "",
311
+ align: _vm.optionAlign
312
+ ? _vm.optionAlign
313
+ : _vm.$pc
314
+ ? "right"
315
+ : "auto",
316
+ },
317
+ on: { close: _vm.handleLayerClose },
318
+ },
319
+ [
320
+ _vm.$pc || _vm.showCalendar
321
+ ? _c(
322
+ "to-scroll",
323
+ [
324
+ _c("to-calendar", {
325
+ ref: "calendar",
326
+ attrs: {
327
+ time: _vm.time,
328
+ type: _vm.type,
329
+ min: _vm.min,
330
+ max: _vm.max,
331
+ "before-change": _vm.beforeChange,
332
+ },
333
+ on: {
334
+ change: _vm.select,
335
+ close: function ($event) {
336
+ return _vm.$refs.layer.close()
337
+ },
338
+ },
339
+ model: {
340
+ value: _vm.date,
341
+ callback: function ($$v) {
342
+ _vm.date = $$v
343
+ },
344
+ expression: "date",
345
+ },
346
+ }),
347
+ ],
348
+ 1
349
+ )
350
+ : _c("picker", {
351
+ attrs: {
352
+ time: _vm.time,
353
+ type: _vm.type,
354
+ min: _vm.min,
355
+ max: _vm.max,
356
+ },
357
+ on: {
358
+ cancel: function ($event) {
359
+ return _vm.$refs.layer.close()
360
+ },
361
+ change: _vm.select,
362
+ clear: function ($event) {
363
+ return _vm.clear()
364
+ },
365
+ },
366
+ model: {
367
+ value: _vm.date,
368
+ callback: function ($$v) {
369
+ _vm.date = $$v
370
+ },
371
+ expression: "date",
372
+ },
373
+ }),
374
+ ],
375
+ 1
376
+ ),
377
+ ],
378
+ 1
379
+ )
288
380
  }
381
+ var staticRenderFns = []
382
+ render._withStripped = true
289
383
 
290
- /***/ }),
291
-
292
- /***/ 12:
293
- /***/ (function(module, exports, __webpack_require__) {
294
384
 
295
- "use strict";
385
+ // CONCATENATED MODULE: ./packages/date-picker/src/date-picker.vue?vue&type=template&id=535581e0
296
386
 
387
+ // EXTERNAL MODULE: external "ai.touchui-vue/lib/locale"
388
+ var locale_ = __webpack_require__(3);
297
389
 
298
- var stylesInDom = {};
390
+ // EXTERNAL MODULE: external "ai.touchui-vue/lib/mixins/tip"
391
+ var tip_ = __webpack_require__(5);
392
+ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
299
393
 
300
- var isOldIE = function isOldIE() {
301
- var memo;
302
- return function memorize() {
303
- if (typeof memo === 'undefined') {
304
- // Test for IE <= 9 as proposed by Browserhacks
305
- // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
306
- // Tests for existence of standard globals is to allow style-loader
307
- // to operate correctly into non-standard environments
308
- // @see https://github.com/webpack-contrib/style-loader/issues/177
309
- memo = Boolean(window && document && document.all && !window.atob);
310
- }
311
-
312
- return memo;
313
- };
314
- }();
315
-
316
- var getTarget = function getTarget() {
317
- var memo = {};
318
- return function memorize(target) {
319
- if (typeof memo[target] === 'undefined') {
320
- var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
321
-
322
- if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
323
- try {
324
- // This will throw an exception if access to iframe is blocked
325
- // due to cross-origin restrictions
326
- styleTarget = styleTarget.contentDocument.head;
327
- } catch (e) {
328
- // istanbul ignore next
329
- styleTarget = null;
330
- }
331
- }
332
-
333
- memo[target] = styleTarget;
334
- }
335
-
336
- return memo[target];
337
- };
338
- }();
339
-
340
- function listToStyles(list, options) {
341
- var styles = [];
342
- var newStyles = {};
343
-
344
- for (var i = 0; i < list.length; i++) {
345
- var item = list[i];
346
- var id = options.base ? item[0] + options.base : item[0];
347
- var css = item[1];
348
- var media = item[2];
349
- var sourceMap = item[3];
350
- var part = {
351
- css: css,
352
- media: media,
353
- sourceMap: sourceMap
354
- };
355
-
356
- if (!newStyles[id]) {
357
- styles.push(newStyles[id] = {
358
- id: id,
359
- parts: [part]
360
- });
361
- } else {
362
- newStyles[id].parts.push(part);
363
- }
364
- }
365
-
366
- return styles;
367
- }
368
-
369
- function addStylesToDom(styles, options) {
370
- for (var i = 0; i < styles.length; i++) {
371
- var item = styles[i];
372
- var domStyle = stylesInDom[item.id];
373
- var j = 0;
374
-
375
- if (domStyle) {
376
- domStyle.refs++;
377
-
378
- for (; j < domStyle.parts.length; j++) {
379
- domStyle.parts[j](item.parts[j]);
380
- }
381
-
382
- for (; j < item.parts.length; j++) {
383
- domStyle.parts.push(addStyle(item.parts[j], options));
384
- }
385
- } else {
386
- var parts = [];
387
-
388
- for (; j < item.parts.length; j++) {
389
- parts.push(addStyle(item.parts[j], options));
390
- }
391
-
392
- stylesInDom[item.id] = {
393
- id: item.id,
394
- refs: 1,
395
- parts: parts
396
- };
397
- }
398
- }
399
- }
400
-
401
- function insertStyleElement(options) {
402
- var style = document.createElement('style');
403
-
404
- if (typeof options.attributes.nonce === 'undefined') {
405
- var nonce = true ? __webpack_require__.nc : undefined;
406
-
407
- if (nonce) {
408
- options.attributes.nonce = nonce;
409
- }
410
- }
411
-
412
- Object.keys(options.attributes).forEach(function (key) {
413
- style.setAttribute(key, options.attributes[key]);
414
- });
415
-
416
- if (typeof options.insert === 'function') {
417
- options.insert(style);
418
- } else {
419
- var target = getTarget(options.insert || 'head');
420
-
421
- if (!target) {
422
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
423
- }
424
-
425
- target.appendChild(style);
426
- }
427
-
428
- return style;
429
- }
430
-
431
- function removeStyleElement(style) {
432
- // istanbul ignore if
433
- if (style.parentNode === null) {
434
- return false;
435
- }
436
-
437
- style.parentNode.removeChild(style);
438
- }
439
- /* istanbul ignore next */
440
-
441
-
442
- var replaceText = function replaceText() {
443
- var textStore = [];
444
- return function replace(index, replacement) {
445
- textStore[index] = replacement;
446
- return textStore.filter(Boolean).join('\n');
447
- };
448
- }();
449
-
450
- function applyToSingletonTag(style, index, remove, obj) {
451
- var css = remove ? '' : obj.css; // For old IE
452
-
453
- /* istanbul ignore if */
454
-
455
- if (style.styleSheet) {
456
- style.styleSheet.cssText = replaceText(index, css);
457
- } else {
458
- var cssNode = document.createTextNode(css);
459
- var childNodes = style.childNodes;
460
-
461
- if (childNodes[index]) {
462
- style.removeChild(childNodes[index]);
463
- }
464
-
465
- if (childNodes.length) {
466
- style.insertBefore(cssNode, childNodes[index]);
467
- } else {
468
- style.appendChild(cssNode);
469
- }
470
- }
471
- }
472
-
473
- function applyToTag(style, options, obj) {
474
- var css = obj.css;
475
- var media = obj.media;
476
- var sourceMap = obj.sourceMap;
477
-
478
- if (media) {
479
- style.setAttribute('media', media);
480
- }
481
-
482
- if (sourceMap && btoa) {
483
- css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
484
- } // For old IE
485
-
486
- /* istanbul ignore if */
487
-
488
-
489
- if (style.styleSheet) {
490
- style.styleSheet.cssText = css;
491
- } else {
492
- while (style.firstChild) {
493
- style.removeChild(style.firstChild);
494
- }
495
-
496
- style.appendChild(document.createTextNode(css));
497
- }
498
- }
499
-
500
- var singleton = null;
501
- var singletonCounter = 0;
502
-
503
- function addStyle(obj, options) {
504
- var style;
505
- var update;
506
- var remove;
507
-
508
- if (options.singleton) {
509
- var styleIndex = singletonCounter++;
510
- style = singleton || (singleton = insertStyleElement(options));
511
- update = applyToSingletonTag.bind(null, style, styleIndex, false);
512
- remove = applyToSingletonTag.bind(null, style, styleIndex, true);
513
- } else {
514
- style = insertStyleElement(options);
515
- update = applyToTag.bind(null, style, options);
516
-
517
- remove = function remove() {
518
- removeStyleElement(style);
519
- };
520
- }
521
-
522
- update(obj);
523
- return function updateStyle(newObj) {
524
- if (newObj) {
525
- if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
526
- return;
527
- }
528
-
529
- update(obj = newObj);
530
- } else {
531
- remove();
532
- }
533
- };
394
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=4176400e
395
+ var pickervue_type_template_id_4176400e_render = function () {
396
+ var _vm = this
397
+ var _h = _vm.$createElement
398
+ var _c = _vm._self._c || _h
399
+ return _c(
400
+ "to-padding",
401
+ [
402
+ _c(
403
+ "to-grid",
404
+ { attrs: { space: "1" } },
405
+ [
406
+ _vm.type !== "time"
407
+ ? [
408
+ _c(
409
+ "to-grid-item",
410
+ [
411
+ _c("to-center-scroll", {
412
+ attrs: { data: _vm.years },
413
+ on: { change: _vm.yearChange },
414
+ model: {
415
+ value: _vm.year,
416
+ callback: function ($$v) {
417
+ _vm.year = $$v
418
+ },
419
+ expression: "year",
420
+ },
421
+ }),
422
+ ],
423
+ 1
424
+ ),
425
+ _c(
426
+ "to-grid-item",
427
+ [
428
+ _c("to-center-scroll", {
429
+ attrs: { data: _vm.monthList },
430
+ on: { change: _vm.monthChange },
431
+ model: {
432
+ value: _vm.month,
433
+ callback: function ($$v) {
434
+ _vm.month = $$v
435
+ },
436
+ expression: "month",
437
+ },
438
+ }),
439
+ ],
440
+ 1
441
+ ),
442
+ _vm.type !== "month"
443
+ ? _c(
444
+ "to-grid-item",
445
+ [
446
+ _c("to-center-scroll", {
447
+ attrs: { data: _vm.days },
448
+ model: {
449
+ value: _vm.day,
450
+ callback: function ($$v) {
451
+ _vm.day = $$v
452
+ },
453
+ expression: "day",
454
+ },
455
+ }),
456
+ ],
457
+ 1
458
+ )
459
+ : _vm._e(),
460
+ ]
461
+ : _vm._e(),
462
+ _vm.type === "datetime"
463
+ ? _c("to-grid-item", { attrs: { width: "1" } })
464
+ : _vm._e(),
465
+ _vm.type === "datetime" || _vm.type === "time"
466
+ ? [
467
+ _c(
468
+ "to-grid-item",
469
+ [
470
+ _c("to-center-scroll", {
471
+ attrs: { data: _vm.hours },
472
+ model: {
473
+ value: _vm.hour,
474
+ callback: function ($$v) {
475
+ _vm.hour = $$v
476
+ },
477
+ expression: "hour",
478
+ },
479
+ }),
480
+ ],
481
+ 1
482
+ ),
483
+ _c(
484
+ "to-grid-item",
485
+ [
486
+ _c("to-center-scroll", {
487
+ attrs: { data: _vm.minutes },
488
+ model: {
489
+ value: _vm.minute,
490
+ callback: function ($$v) {
491
+ _vm.minute = $$v
492
+ },
493
+ expression: "minute",
494
+ },
495
+ }),
496
+ ],
497
+ 1
498
+ ),
499
+ _c(
500
+ "to-grid-item",
501
+ [
502
+ _c("to-center-scroll", {
503
+ attrs: { data: _vm.seconds },
504
+ model: {
505
+ value: _vm.second,
506
+ callback: function ($$v) {
507
+ _vm.second = $$v
508
+ },
509
+ expression: "second",
510
+ },
511
+ }),
512
+ ],
513
+ 1
514
+ ),
515
+ ]
516
+ : _vm._e(),
517
+ ],
518
+ 2
519
+ ),
520
+ _c("to-space"),
521
+ _c(
522
+ "to-submit",
523
+ { attrs: { width: "full", space: 2 } },
524
+ [
525
+ _c(
526
+ "to-button",
527
+ {
528
+ directives: [
529
+ {
530
+ name: "size",
531
+ rawName: "v-size",
532
+ value: "l",
533
+ expression: "'l'",
534
+ },
535
+ ],
536
+ attrs: { fillet: "normal", mode: "line", color: "primary" },
537
+ on: {
538
+ click: function ($event) {
539
+ return _vm.$emit("cancel")
540
+ },
541
+ },
542
+ },
543
+ [_vm._v("取消")]
544
+ ),
545
+ _c(
546
+ "to-button",
547
+ {
548
+ directives: [
549
+ {
550
+ name: "size",
551
+ rawName: "v-size",
552
+ value: "l",
553
+ expression: "'l'",
554
+ },
555
+ ],
556
+ attrs: { fillet: "normal", mode: "line", color: "primary" },
557
+ on: { click: _vm.clear },
558
+ },
559
+ [_vm._v("清除")]
560
+ ),
561
+ _c(
562
+ "to-button",
563
+ {
564
+ directives: [
565
+ {
566
+ name: "size",
567
+ rawName: "v-size",
568
+ value: "l",
569
+ expression: "'l'",
570
+ },
571
+ ],
572
+ attrs: { fillet: "normal", color: "primary" },
573
+ on: { click: _vm.submit },
574
+ },
575
+ [_vm._v("确定")]
576
+ ),
577
+ ],
578
+ 1
579
+ ),
580
+ ],
581
+ 1
582
+ )
534
583
  }
584
+ var pickervue_type_template_id_4176400e_staticRenderFns = []
585
+ pickervue_type_template_id_4176400e_render._withStripped = true
535
586
 
536
- module.exports = function (list, options) {
537
- options = options || {};
538
- options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
539
- // tags it will allow on a page
540
-
541
- if (!options.singleton && typeof options.singleton !== 'boolean') {
542
- options.singleton = isOldIE();
543
- }
544
587
 
545
- var styles = listToStyles(list, options);
546
- addStylesToDom(styles, options);
547
- return function update(newList) {
548
- var mayRemove = [];
588
+ // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=4176400e
549
589
 
550
- for (var i = 0; i < styles.length; i++) {
551
- var item = styles[i];
552
- var domStyle = stylesInDom[item.id];
590
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=script&lang=js
591
+ //
592
+ //
593
+ //
594
+ //
595
+ //
596
+ //
597
+ //
598
+ //
599
+ //
600
+ //
601
+ //
602
+ //
603
+ //
604
+ //
605
+ //
606
+ //
607
+ //
608
+ //
609
+ //
610
+ //
611
+ //
612
+ //
613
+ //
614
+ //
615
+ //
616
+ //
617
+ //
618
+ //
619
+ //
620
+ //
621
+ //
622
+ //
623
+ //
624
+ //
625
+ //
626
+ //
553
627
 
554
- if (domStyle) {
555
- domStyle.refs--;
556
- mayRemove.push(domStyle);
557
- }
558
- }
628
+ /* harmony default export */ var pickervue_type_script_lang_js = ({
629
+ props: {
630
+ value: {
631
+ type: [String, Date],
632
+ default: ''
633
+ },
634
+ type: {
635
+ type: String,
636
+ default: ''
637
+ },
638
+ time: {
639
+ type: String,
640
+ default: ''
641
+ },
642
+ min: {
643
+ type: [String, Date, Number],
644
+ default: ''
645
+ },
646
+ max: {
647
+ type: [String, Date, Number],
648
+ default: ''
649
+ }
650
+ },
651
+ data: function data() {
652
+ return {
653
+ inited: false,
654
+ year: '',
655
+ month: '',
656
+ day: '',
657
+ hour: '',
658
+ minute: '',
659
+ second: '',
660
+ years: [],
661
+ months: '01,02,03,04,05,06,07,08,09,10,11,12',
662
+ monthList: [],
663
+ days: [],
664
+ hours: '00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23',
665
+ minutes: '00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59',
666
+ seconds: '00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59'
667
+ };
668
+ },
559
669
 
560
- if (newList) {
561
- var newStyles = listToStyles(newList, options);
562
- addStylesToDom(newStyles, options);
563
- }
670
+ computed: {
671
+ valueo: function valueo() {
672
+ var _formatDate$split = this.formatDate(this.value).split(' '),
673
+ date = _formatDate$split[0],
674
+ time = _formatDate$split[1];
564
675
 
565
- for (var _i = 0; _i < mayRemove.length; _i++) {
566
- var _domStyle = mayRemove[_i];
676
+ var _date$split = date.split('-'),
677
+ year = _date$split[0],
678
+ month = _date$split[1],
679
+ day = _date$split[2];
567
680
 
568
- if (_domStyle.refs === 0) {
569
- for (var j = 0; j < _domStyle.parts.length; j++) {
570
- _domStyle.parts[j]();
571
- }
681
+ var _time$split = time.split(':'),
682
+ hour = _time$split[0],
683
+ minute = _time$split[1],
684
+ second = _time$split[2];
572
685
 
573
- delete stylesInDom[_domStyle.id];
574
- }
575
- }
576
- };
577
- };
686
+ var obj = {
687
+ year: year || '',
688
+ month: month || '',
689
+ day: day || '',
690
+ hour: hour || '',
691
+ minute: minute || '',
692
+ second: second || ''
693
+ };
694
+ return obj;
695
+ },
696
+ minDate: function minDate() {
697
+ if (this.min) {
698
+ var min = '';
699
+ // 默认使用 2023-03-01 格式时,其 hour = 8 而不是 0,所以要转为 2023/03/01 格式
700
+ if (typeof this.min === 'string') {
701
+ min = this.min.replace(/-/gi, '/');
702
+ } else {
703
+ min = this.min;
704
+ }
705
+ return new Date(min);
706
+ } else {
707
+ return new Date('1900-01-01');
708
+ }
709
+ },
710
+ maxDate: function maxDate() {
711
+ if (this.max) {
712
+ var max = '';
713
+ // 默认使用 2023-03-01 格式时,其 hour = 8 而不是 0,所以要转为 2023/03/01 格式
714
+ if (typeof this.max === 'string') {
715
+ max = this.max.replace(/-/gi, '/');
716
+ } else {
717
+ max = this.max;
718
+ }
719
+ return new Date(max);
720
+ } else {
721
+ return new Date('2099-12-31');
722
+ }
723
+ }
724
+ },
725
+ watch: {
726
+ value: function value() {
727
+ var _this = this;
578
728
 
579
- /***/ }),
729
+ this.setYear(function () {
730
+ _this.setMonth(function () {
731
+ _this.setDay();
732
+ });
733
+ });
734
+ }
735
+ },
736
+ mounted: function mounted() {
737
+ var _this2 = this;
580
738
 
581
- /***/ 18:
582
- /***/ (function(module, exports, __webpack_require__) {
739
+ setTimeout(function () {
740
+ if (_this2.type !== 'time') {
741
+ _this2.setYear(function () {
742
+ _this2.setMonth(function () {
743
+ if (_this2.type !== 'month') {
744
+ _this2.setDay();
745
+ }
746
+ });
747
+ });
748
+ }
749
+ if (_this2.type === 'datetime' || _this2.type === 'time') {
750
+ _this2.setHour();
751
+ _this2.setMinute();
752
+ _this2.setSecond();
753
+ }
754
+ _this2.inited = true;
755
+ }, 100);
756
+ },
583
757
 
584
- var content = __webpack_require__(94);
758
+ methods: {
759
+ setYear: function setYear(callback) {
760
+ var _this3 = this;
585
761
 
586
- if (typeof content === 'string') {
587
- content = [[module.i, content, '']];
588
- }
762
+ function getYearsRange(currentYear, range) {
763
+ var startYear = currentYear - range;
764
+ var endYear = currentYear + range;
765
+ var years = [];
589
766
 
590
- var options = {}
767
+ for (var year = startYear; year <= endYear; year++) {
768
+ years.push(String(year));
769
+ }
591
770
 
592
- options.insert = "head";
593
- options.singleton = false;
771
+ return years;
772
+ }
594
773
 
595
- var update = __webpack_require__(12)(content, options);
774
+ // 获取当前年份
775
+ var currentYear = new Date().getFullYear();
596
776
 
597
- if (content.locals) {
598
- module.exports = content.locals;
599
- }
777
+ // 获取前后 100 年的年份
778
+ var years = getYearsRange(currentYear, 100);
600
779
 
780
+ // 设置数据
781
+ years.map(function (item) {
782
+ var object = {
783
+ label: item,
784
+ value: item
785
+ };
601
786
 
602
- /***/ }),
787
+ if (item >= _this3.minDate.getFullYear() && item <= _this3.maxDate.getFullYear()) {
788
+ _this3.years.push(object);
789
+ }
790
+ });
603
791
 
604
- /***/ 3:
605
- /***/ (function(module, exports) {
792
+ // 将今年设置为默认年份
793
+ this.$nextTick(function () {
794
+ if (_this3.value) {
795
+ _this3.year = _this3.valueo.year;
796
+ } else {
797
+ _this3.year = String(new Date().getFullYear());
798
+ }
799
+ callback && callback();
800
+ });
801
+ },
802
+ setMonth: function setMonth(callback) {
803
+ var _this4 = this;
606
804
 
607
- module.exports = require("ai.touchui-vue/lib/locale");
805
+ this.monthList = [];
806
+ this.months.split(',').forEach(function (item) {
608
807
 
609
- /***/ }),
808
+ var object = {
809
+ label: item,
810
+ value: item
811
+ };
610
812
 
611
- /***/ 343:
612
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
813
+ var date = new Date(_this4.year + '-' + item);
613
814
 
614
- "use strict";
615
- // ESM COMPAT FLAG
616
- __webpack_require__.r(__webpack_exports__);
815
+ // 在 safari 或者 IOS 端,年月必须采用 '2024-07' 的String 类型
816
+ var minDate = new Date(String(_this4.minDate.getFullYear()) + '-' + _this4.addZero(String(_this4.minDate.getMonth() + 1)));
817
+ var maxDate = new Date(String(_this4.maxDate.getFullYear()) + '-' + _this4.addZero(String(_this4.maxDate.getMonth() + 1)));
617
818
 
618
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/date-picker.vue?vue&type=template&id=535581e0
619
- var render = function () {
620
- var _vm = this
621
- var _h = _vm.$createElement
622
- var _c = _vm._self._c || _h
623
- return _c(
624
- "to-input",
625
- {
626
- ref: "inputBox",
627
- staticClass: "to-date-picker",
628
- attrs: {
629
- id: _vm.id,
630
- required: _vm.required,
631
- desc: _vm.desc,
632
- color: _vm.color,
633
- prefix: _vm.prefix,
634
- suffix: _vm.suffix,
635
- mode: _vm.mode,
636
- "prop-error-type": _vm.errorType,
637
- "prop-error-tip": _vm.errorTip,
638
- fillet: _vm.fillet,
639
- "fillet-position": _vm.filletPosition,
640
- value: _vm.datedisplay,
641
- placeholder: _vm.placeholder,
642
- readonly: _vm.disabled || !_vm.inputable,
643
- "sp-chars": _vm.spChars,
644
- link: !_vm.inputable && !_vm.disabled,
645
- clearable: _vm.clearable && !_vm.disabled,
646
- width: _vm.width,
647
- comparable: _vm.comparable,
648
- },
649
- on: {
650
- focus: function ($event) {
651
- _vm.errorTip = ""
652
- },
653
- click: _vm.handleClick,
654
- clear: function ($event) {
655
- return _vm.clear()
656
- },
657
- input: _vm.handleDisplayChange,
658
- blur: _vm.handleDisplayBlur,
659
- },
660
- },
661
- [
662
- _vm.type === "time"
663
- ? _c("to-icon", {
664
- class: _vm.disabled ? "to-dis" : "",
665
- attrs: {
666
- slot: "suffix",
667
- link: _vm.inputable,
668
- mode: "none",
669
- color: "primary",
670
- value: "time",
671
- },
672
- on: { click: _vm.showLayer },
673
- slot: "suffix",
674
- })
675
- : _c("to-icon", {
676
- class: _vm.disabled ? "to-dis" : "",
677
- attrs: {
678
- slot: "suffix",
679
- link: _vm.inputable,
680
- mode: "none",
681
- color: "primary",
682
- value: "date",
683
- },
684
- on: { click: _vm.showLayer },
685
- slot: "suffix",
686
- }),
687
- _c(
688
- "to-float",
689
- {
690
- ref: "layer",
691
- attrs: {
692
- lazy: _vm.lazy,
693
- slide: _vm.layerSlide,
694
- position: _vm.layerPosition,
695
- paddng: 0.5,
696
- width: _vm.$platform === "pc" ? 23 : "",
697
- align: _vm.optionAlign
698
- ? _vm.optionAlign
699
- : _vm.$pc
700
- ? "right"
701
- : "auto",
702
- },
703
- on: { close: _vm.handleLayerClose },
704
- },
705
- [
706
- _vm.$pc || _vm.showCalendar
707
- ? _c(
708
- "to-scroll",
709
- [
710
- _c("to-calendar", {
711
- ref: "calendar",
712
- attrs: {
713
- time: _vm.time,
714
- type: _vm.type,
715
- min: _vm.min,
716
- max: _vm.max,
717
- "before-change": _vm.beforeChange,
718
- },
719
- on: {
720
- change: _vm.select,
721
- close: function ($event) {
722
- return _vm.$refs.layer.close()
723
- },
724
- },
725
- model: {
726
- value: _vm.date,
727
- callback: function ($$v) {
728
- _vm.date = $$v
729
- },
730
- expression: "date",
731
- },
732
- }),
733
- ],
734
- 1
735
- )
736
- : _c("picker", {
737
- attrs: {
738
- time: _vm.time,
739
- type: _vm.type,
740
- min: _vm.min,
741
- max: _vm.max,
742
- },
743
- on: {
744
- cancel: function ($event) {
745
- return _vm.$refs.layer.close()
746
- },
747
- change: _vm.select,
748
- clear: function ($event) {
749
- return _vm.clear()
750
- },
751
- },
752
- model: {
753
- value: _vm.date,
754
- callback: function ($$v) {
755
- _vm.date = $$v
756
- },
757
- expression: "date",
758
- },
759
- }),
760
- ],
761
- 1
762
- ),
763
- ],
764
- 1
765
- )
766
- }
767
- var staticRenderFns = []
768
- render._withStripped = true
819
+ if (date >= minDate && date <= maxDate) {
820
+ _this4.monthList.push(object);
821
+ }
822
+ });
769
823
 
824
+ this.$nextTick(function () {
825
+ if (_this4.value) {
826
+ _this4.month = _this4.valueo.month;
827
+ } else if (Array.isArray(_this4.monthList) && _this4.monthList.length) {
828
+ var month = '';
829
+ if (_this4.min) {
830
+ month = _this4.monthList[0].value;
831
+ } else {
832
+ month = new Date().getMonth() + 1;
833
+ }
834
+ var date = new Date(String(_this4.year) + '-' + _this4.addZero(String(month)));
835
+ _this4.month = _this4.addZero(String(date.getMonth() + 1));
836
+ } else {
837
+ _this4.month = _this4.addZero(String(new Date().getMonth() + 1));
838
+ }
839
+ callback && callback();
840
+ });
841
+ },
842
+ setDay: function setDay() {
843
+ var _this5 = this;
770
844
 
771
- // CONCATENATED MODULE: ./packages/date-picker/src/date-picker.vue?vue&type=template&id=535581e0
845
+ var total = new Date(this.year, this.month, 0).getDate();
846
+ this.days = [];
772
847
 
773
- // EXTERNAL MODULE: external "ai.touchui-vue/lib/locale"
774
- var locale_ = __webpack_require__(3);
848
+ for (var i = 0; i < total; i++) {
849
+ var day = this.addZero(i + 1);
775
850
 
776
- // EXTERNAL MODULE: external "ai.touchui-vue/lib/mixins/tip"
777
- var tip_ = __webpack_require__(5);
778
- var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
851
+ var object = {
852
+ label: day,
853
+ value: day
779
854
 
780
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=4176400e
781
- var pickervue_type_template_id_4176400e_render = function () {
782
- var _vm = this
783
- var _h = _vm.$createElement
784
- var _c = _vm._self._c || _h
785
- return _c(
786
- "to-padding",
787
- [
788
- _c(
789
- "to-grid",
790
- { attrs: { space: "1" } },
791
- [
792
- _vm.type !== "time"
793
- ? [
794
- _c(
795
- "to-grid-item",
796
- [
797
- _c("to-center-scroll", {
798
- attrs: { data: _vm.years },
799
- on: { change: _vm.yearChange },
800
- model: {
801
- value: _vm.year,
802
- callback: function ($$v) {
803
- _vm.year = $$v
804
- },
805
- expression: "year",
806
- },
807
- }),
808
- ],
809
- 1
810
- ),
811
- _c(
812
- "to-grid-item",
813
- [
814
- _c("to-center-scroll", {
815
- attrs: { data: _vm.monthList },
816
- on: { change: _vm.monthChange },
817
- model: {
818
- value: _vm.month,
819
- callback: function ($$v) {
820
- _vm.month = $$v
821
- },
822
- expression: "month",
823
- },
824
- }),
825
- ],
826
- 1
827
- ),
828
- _vm.type !== "month"
829
- ? _c(
830
- "to-grid-item",
831
- [
832
- _c("to-center-scroll", {
833
- attrs: { data: _vm.days },
834
- model: {
835
- value: _vm.day,
836
- callback: function ($$v) {
837
- _vm.day = $$v
838
- },
839
- expression: "day",
840
- },
841
- }),
842
- ],
843
- 1
844
- )
845
- : _vm._e(),
846
- ]
847
- : _vm._e(),
848
- _vm.type === "datetime"
849
- ? _c("to-grid-item", { attrs: { width: "1" } })
850
- : _vm._e(),
851
- _vm.type === "datetime" || _vm.type === "time"
852
- ? [
853
- _c(
854
- "to-grid-item",
855
- [
856
- _c("to-center-scroll", {
857
- attrs: { data: _vm.hours },
858
- model: {
859
- value: _vm.hour,
860
- callback: function ($$v) {
861
- _vm.hour = $$v
862
- },
863
- expression: "hour",
864
- },
865
- }),
866
- ],
867
- 1
868
- ),
869
- _c(
870
- "to-grid-item",
871
- [
872
- _c("to-center-scroll", {
873
- attrs: { data: _vm.minutes },
874
- model: {
875
- value: _vm.minute,
876
- callback: function ($$v) {
877
- _vm.minute = $$v
878
- },
879
- expression: "minute",
880
- },
881
- }),
882
- ],
883
- 1
884
- ),
885
- _c(
886
- "to-grid-item",
887
- [
888
- _c("to-center-scroll", {
889
- attrs: { data: _vm.seconds },
890
- model: {
891
- value: _vm.second,
892
- callback: function ($$v) {
893
- _vm.second = $$v
894
- },
895
- expression: "second",
896
- },
897
- }),
898
- ],
899
- 1
900
- ),
901
- ]
902
- : _vm._e(),
903
- ],
904
- 2
905
- ),
906
- _c("to-space"),
907
- _c(
908
- "to-submit",
909
- { attrs: { width: "full", space: 2 } },
910
- [
911
- _c(
912
- "to-button",
913
- {
914
- directives: [
915
- {
916
- name: "size",
917
- rawName: "v-size",
918
- value: "l",
919
- expression: "'l'",
920
- },
921
- ],
922
- attrs: { fillet: "normal", mode: "line", color: "primary" },
923
- on: {
924
- click: function ($event) {
925
- return _vm.$emit("cancel")
926
- },
927
- },
928
- },
929
- [_vm._v("取消")]
930
- ),
931
- _c(
932
- "to-button",
933
- {
934
- directives: [
935
- {
936
- name: "size",
937
- rawName: "v-size",
938
- value: "l",
939
- expression: "'l'",
940
- },
941
- ],
942
- attrs: { fillet: "normal", mode: "line", color: "primary" },
943
- on: { click: _vm.clear },
944
- },
945
- [_vm._v("清除")]
946
- ),
947
- _c(
948
- "to-button",
949
- {
950
- directives: [
951
- {
952
- name: "size",
953
- rawName: "v-size",
954
- value: "l",
955
- expression: "'l'",
956
- },
957
- ],
958
- attrs: { fillet: "normal", color: "primary" },
959
- on: { click: _vm.submit },
960
- },
961
- [_vm._v("确定")]
962
- ),
963
- ],
964
- 1
965
- ),
966
- ],
967
- 1
968
- )
969
- }
970
- var pickervue_type_template_id_4176400e_staticRenderFns = []
971
- pickervue_type_template_id_4176400e_render._withStripped = true
855
+ // 在年月都在可用范围时,再判断天
856
+ };var minDate = new Date(this.minDate.getFullYear(), this.minDate.getMonth(), this.minDate.getDate());
857
+ var maxDate = new Date(this.maxDate.getFullYear(), this.maxDate.getMonth(), this.maxDate.getDate());
858
+ var date = new Date(this.year, this.month - 1, day);
859
+ if (date >= minDate && date <= maxDate) {
860
+ this.days.push(object);
861
+ }
862
+ }
863
+ this.$nextTick(function () {
864
+ if (_this5.value) {
865
+ _this5.day = _this5.valueo.day;
866
+ } else if (Array.isArray(_this5.days) && _this5.days.length) {
867
+ var _day = new Date().getDate();
868
+ var _date = new Date(_this5.year + '/' + _this5.month + '/' + _day);
869
+ _this5.day = _this5.addZero(String(_date.getDate()));
870
+ } else {
871
+ _this5.day = _this5.addZero(String(new Date().getDate()));
872
+ }
873
+ });
874
+ },
875
+ setHour: function setHour() {
876
+ if (this.value) {
877
+ this.hour = this.valueo.hour;
878
+ } else {
879
+ this.hour = this.addZero(String(new Date().getHours()));
880
+ }
881
+ },
882
+ setMinute: function setMinute() {
883
+ if (this.value) {
884
+ this.minute = this.valueo.minute;
885
+ } else {
886
+ this.minute = this.addZero(String(new Date().getMinutes()));
887
+ }
888
+ },
889
+ setSecond: function setSecond() {
890
+ if (this.value) {
891
+ this.second = this.valueo.second;
892
+ } else {
893
+ this.second = this.addZero(String(new Date().getSeconds()));
894
+ }
895
+ },
896
+ yearChange: function yearChange() {
897
+ var _this6 = this;
972
898
 
899
+ if (this.inited) {
900
+ this.setMonth(function () {
901
+ _this6.setDay();
902
+ });
903
+ }
904
+ },
905
+ monthChange: function monthChange() {
906
+ if (this.inited) {
907
+ this.setDay();
908
+ }
909
+ },
910
+ submit: function submit() {
911
+ if (this.type === 'datetime') {
912
+ this.$emit('change', this.year + '-' + this.month + '-' + this.day + ' ' + this.hour + ':' + this.minute + ':' + this.second);
913
+ } else if (this.type === 'time') {
914
+ this.$emit('change', this.hour + ':' + this.minute + ':' + this.second);
915
+ } else {
916
+ this.$emit('change', this.year + '-' + this.month + '-' + this.day);
917
+ }
918
+ },
919
+ clear: function clear() {
920
+ this.$emit('clear');
921
+ },
973
922
 
974
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=4176400e
923
+ // 格式化日期
924
+ formatDate: function formatDate(date, fmt) {
925
+ if (typeof date === 'string') {
926
+ date = new Date(date);
927
+ }
975
928
 
976
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=script&lang=js
929
+ if (!fmt) {
930
+ fmt = 'yyyy-MM-dd HH:mm:ss';
931
+ }
932
+ if (/(y+)/.test(fmt)) {
933
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
934
+ }
935
+ var o = {
936
+ 'M+': date.getMonth() + 1,
937
+ 'd+': date.getDate(),
938
+ 'H+': date.getHours(),
939
+ 'm+': date.getMinutes(),
940
+ 's+': date.getSeconds()
941
+ };
942
+ for (var k in o) {
943
+ if (new RegExp('(' + k + ')').test(fmt)) {
944
+ var str = o[k] + '';
945
+ fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.addZero(str));
946
+ }
947
+ }
948
+ return fmt;
949
+ },
950
+ addZero: function addZero(str) {
951
+ return ('00' + str).substr(str.toString().length);
952
+ }
953
+ }
954
+ });
955
+ // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js
956
+ /* harmony default export */ var src_pickervue_type_script_lang_js = (pickervue_type_script_lang_js);
957
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
958
+ var componentNormalizer = __webpack_require__(0);
959
+
960
+ // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue
961
+
962
+
963
+
964
+
965
+
966
+ /* normalize component */
967
+
968
+ var component = Object(componentNormalizer["a" /* default */])(
969
+ src_pickervue_type_script_lang_js,
970
+ pickervue_type_template_id_4176400e_render,
971
+ pickervue_type_template_id_4176400e_staticRenderFns,
972
+ false,
973
+ null,
974
+ null,
975
+ null
976
+
977
+ )
978
+
979
+ /* harmony default export */ var picker = (component.exports);
980
+ // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/date"
981
+ var date_ = __webpack_require__(91);
982
+
983
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/date-picker.vue?vue&type=script&lang=js
984
+ //
985
+ //
986
+ //
977
987
  //
978
988
  //
979
989
  //
@@ -1011,858 +1021,848 @@ pickervue_type_template_id_4176400e_render._withStripped = true
1011
1021
  //
1012
1022
  //
1013
1023
 
1014
- /* harmony default export */ var pickervue_type_script_lang_js = ({
1024
+
1025
+
1026
+
1027
+
1028
+ // import moment from 'moment';
1029
+ /* harmony default export */ var date_pickervue_type_script_lang_js = ({
1030
+ name: 'ToDatePicker',
1031
+ components: { picker: picker },
1032
+ mixins: [tip_default.a],
1033
+ componentName: 'ToDatePicker',
1034
+ model: {
1035
+ event: 'change'
1036
+ },
1015
1037
  props: {
1038
+ suffix: {
1039
+ type: String,
1040
+ default: ''
1041
+ },
1042
+ prefix: {
1043
+ type: String,
1044
+ default: ''
1045
+ },
1046
+ showCalendar: {
1047
+ type: Boolean,
1048
+ default: false
1049
+ },
1050
+ lazy: {
1051
+ type: Boolean,
1052
+ default: function _default() {
1053
+ if (this.$TouchUI && this.$TouchUI.datePicker && this.$TouchUI.datePicker.lazy === false) {
1054
+ return false;
1055
+ } else {
1056
+ return true;
1057
+ }
1058
+ }
1059
+ },
1060
+ desc: {
1061
+ type: String,
1062
+ default: ''
1063
+ },
1064
+ // 安全
1065
+ spChars: {
1066
+ type: [String, Boolean],
1067
+ default: '/,\\,[,],{,},"' // 微软拼音输入法使用单引号做上屏前多个字符分隔符,不能过滤单引号
1068
+ },
1069
+ id: {
1070
+ type: String,
1071
+ default: ''
1072
+ },
1073
+ required: {
1074
+ type: Boolean,
1075
+ default: null
1076
+ },
1016
1077
  value: {
1017
1078
  type: [String, Date],
1018
1079
  default: ''
1019
1080
  },
1081
+ placeholder: {
1082
+ type: String,
1083
+ default: function _default() {
1084
+ if (this.inputable) {
1085
+ return Object(locale_["t"])('to.common.placeholder.select');
1086
+ } else {
1087
+ return Object(locale_["t"])('to.common.placeholder.select');
1088
+ }
1089
+ }
1090
+ },
1091
+ readonly: Boolean,
1092
+ inputable: {
1093
+ type: Boolean,
1094
+ default: true
1095
+ },
1020
1096
  type: {
1021
1097
  type: String,
1022
1098
  default: ''
1023
1099
  },
1100
+ fillet: {
1101
+ type: String,
1102
+ default: function _default() {
1103
+ return this.$TouchUI.datePicker.fillet || this.$TouchUI.global.fillet || 'normal';
1104
+ }
1105
+ },
1106
+ filletPosition: {
1107
+ type: String,
1108
+ default: ''
1109
+ },
1110
+ color: {
1111
+ type: String,
1112
+ default: 'default'
1113
+ },
1114
+ mode: {
1115
+ type: String,
1116
+ default: ''
1117
+ },
1118
+ width: {
1119
+ type: [Number, String],
1120
+ default: ''
1121
+ },
1122
+ valueFormat: {
1123
+ type: String,
1124
+ default: function _default() {
1125
+ if (this.type === 'datetime') {
1126
+ return 'yyyy-MM-dd HH:mm:ss';
1127
+ } else if (this.type === 'time') {
1128
+ return 'HH:mm:ss';
1129
+ } else if (this.type === 'month') {
1130
+ return 'yyyy-MM';
1131
+ } else {
1132
+ return 'yyyy-MM-dd';
1133
+ }
1134
+ }
1135
+ },
1136
+ displayFormat: {
1137
+ type: String,
1138
+ default: function _default() {
1139
+ if (this.type === 'datetime') {
1140
+ return 'yyyy-MM-dd HH:mm:ss';
1141
+ } else if (this.type === 'month') {
1142
+ return 'yyyy-MM';
1143
+ } else {
1144
+ return 'yyyy-MM-dd';
1145
+ }
1146
+ }
1147
+ },
1024
1148
  time: {
1025
1149
  type: String,
1026
1150
  default: ''
1027
1151
  },
1152
+ comparable: Boolean,
1153
+ beforeChange: {
1154
+ type: Function,
1155
+ default: null
1156
+ },
1157
+ optionAlign: {
1158
+ type: String,
1159
+ default: ''
1160
+ },
1028
1161
  min: {
1029
1162
  type: [String, Date, Number],
1030
1163
  default: ''
1031
1164
  },
1032
- max: {
1033
- type: [String, Date, Number],
1034
- default: ''
1165
+ max: {
1166
+ type: [String, Date, Number],
1167
+ default: ''
1168
+ },
1169
+ clearable: {
1170
+ type: Boolean,
1171
+ default: true
1172
+ }
1173
+ },
1174
+ data: function data() {
1175
+ return {
1176
+ errorType: 'rule',
1177
+ errorTip: '',
1178
+ date: '',
1179
+ iValue: '',
1180
+ datedisplay: '',
1181
+ layerSlide: false,
1182
+ displayFormatRegExp: '',
1183
+ layerPosition: 'auto',
1184
+ disabled: this.readonly
1185
+ };
1186
+ },
1187
+
1188
+ watch: {
1189
+ readonly: function readonly(val) {
1190
+ this.disabled = val;
1191
+ },
1192
+
1193
+ value: {
1194
+ handler: function handler(val) {
1195
+ if (val === '' || val === null || val === undefined) {
1196
+ this.date = '';
1197
+ this.datedisplay = '';
1198
+ } else {
1199
+ // 检查数据是否和 valueFormat 相匹配,避免报错
1200
+ var newValue = val.trim().substring(0, this.valueFormat.length);
1201
+
1202
+ if (!Object(date_["matchFormat"])(newValue, this.valueFormat)) {
1203
+ return;
1204
+ }
1205
+ if (this.type === 'time') {
1206
+ this.date = this.getDateFromValue(newValue, 'yyyy-MM-dd HH:mm:ss');
1207
+ this.datedisplay = newValue;
1208
+ } else {
1209
+ newValue = this.getDateFromValue(newValue, this.valueFormat);
1210
+ this.date = newValue;
1211
+ this.datedisplay = this.formatDate(newValue, this.displayFormat);
1212
+ }
1213
+ }
1214
+ },
1215
+
1216
+ immediate: true
1217
+ },
1218
+ displayFormat: {
1219
+ handler: function handler(fmt) {
1220
+ this.displayFormatRegExp = new RegExp('^' + String(fmt).replace(/\-|\//g, '\\-').replace(/[a-zA-Z]/g, '\\d') + '$');
1221
+ },
1222
+
1223
+ immediate: true
1035
1224
  }
1036
1225
  },
1037
- data: function data() {
1038
- return {
1039
- inited: false,
1040
- year: '',
1041
- month: '',
1042
- day: '',
1043
- hour: '',
1044
- minute: '',
1045
- second: '',
1046
- years: [],
1047
- months: '01,02,03,04,05,06,07,08,09,10,11,12',
1048
- monthList: [],
1049
- days: [],
1050
- hours: '00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23',
1051
- minutes: '00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59',
1052
- seconds: '00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59'
1053
- };
1226
+ created: function created() {
1227
+ if (this.$platform === 'phone') {
1228
+ this.layerSlide = true;
1229
+ this.layerPosition = 'bottom';
1230
+ }
1231
+ if (this.value) {
1232
+ this.iValue = this.value;
1233
+ this.$emit('change', this.value);
1234
+ }
1235
+ },
1236
+ mounted: function mounted() {
1237
+ // this.$refs.layer.open()
1054
1238
  },
1055
1239
 
1056
- computed: {
1057
- valueo: function valueo() {
1058
- var _formatDate$split = this.formatDate(this.value).split(' '),
1059
- date = _formatDate$split[0],
1060
- time = _formatDate$split[1];
1061
-
1062
- var _date$split = date.split('-'),
1063
- year = _date$split[0],
1064
- month = _date$split[1],
1065
- day = _date$split[2];
1066
-
1067
- var _time$split = time.split(':'),
1068
- hour = _time$split[0],
1069
- minute = _time$split[1],
1070
- second = _time$split[2];
1240
+ methods: {
1241
+ handleLayerClose: function handleLayerClose() {
1242
+ this.$refs.calendar.timeLayer = false;
1243
+ this.$refs.calendar.monthLayer = false;
1244
+ },
1245
+ handleDisplayChange: function handleDisplayChange(value) {
1246
+ this.datedisplay = value;
1247
+ this.$emit('change', this.datedisplay);
1248
+ },
1249
+ handleDisplayBlur: function handleDisplayBlur() {
1250
+ var _this = this;
1071
1251
 
1072
- var obj = {
1073
- year: year || '',
1074
- month: month || '',
1075
- day: day || '',
1076
- hour: hour || '',
1077
- minute: minute || '',
1078
- second: second || ''
1079
- };
1080
- return obj;
1252
+ setTimeout(function () {
1253
+ if (isNaN(new Date(_this.datedisplay))) {
1254
+ _this.datedisplay = '';
1255
+ _this.changeValue('');
1256
+ } else {
1257
+ _this.$emit('beforeChange', _this.datedisplay);
1258
+ if (!_this.displayFormatRegExp.test(_this.datedisplay)) {
1259
+ _this.datedisplay = _this.formatDate(new Date(_this.datedisplay), _this.displayFormat);
1260
+ _this.iValue = _this.formatDate(new Date(_this.datedisplay), _this.displayFormat);
1261
+ _this.$emit('change', _this.iValue);
1262
+ } else {
1263
+ _this.changeValue(_this.getDateFromValue(_this.datedisplay, _this.displayFormat));
1264
+ }
1265
+ }
1266
+ }, 100);
1081
1267
  },
1082
- minDate: function minDate() {
1083
- if (this.min) {
1084
- var min = '';
1085
- // 默认使用 2023-03-01 格式时,其 hour = 8 而不是 0,所以要转为 2023/03/01 格式
1086
- if (typeof this.min === 'string') {
1087
- min = this.min.replace(/-/gi, '/');
1268
+ select: function select(value) {
1269
+ this.changeValue(value);
1270
+ this.$refs.layer.close();
1271
+ },
1272
+ changeValue: function changeValue(value) {
1273
+ this.$emit('beforeChange', value);
1274
+ if (!value) {
1275
+ this.clear();
1276
+ } else if (this.type === 'time') {
1277
+ if (typeof value === 'string') {
1278
+ this.datedisplay = value.split(' ').length > 1 ? value.split(' ')[1] : value;
1279
+ this.iValue = value.split(' ').length > 1 ? value.split(' ')[1] : value;
1088
1280
  } else {
1089
- min = this.min;
1281
+ value = this.formatDate(new Date(value), 'yyyy-MM-dd HH:mm:ss');
1282
+ var flag = isNaN(new Date(value).getTime()); // 判断是否可以使用 2022-05 如果不可用,则替换为 2022/05
1283
+ if (flag) {
1284
+ value = value.replace(/-/g, '/');
1285
+ }
1286
+ this.datedisplay = value.split(' ').length > 1 ? value.split(' ')[1] : value;
1287
+ this.iValue = value.split(' ').length > 1 ? value.split(' ')[1] : value;
1090
1288
  }
1091
- return new Date(min);
1289
+ this.$emit('change', this.iValue);
1092
1290
  } else {
1093
- return new Date('1900-01-01');
1291
+ var _flag = isNaN(new Date(value).getTime()); // 判断是否可以使用 2022-05 如果不可用,则替换为 2022/05
1292
+ if (_flag) {
1293
+ value = value.replace(/-/g, '/');
1294
+ }
1295
+ this.datedisplay = this.formatDate(new Date(value), this.displayFormat);
1296
+ this.iValue = this.formatDate(new Date(value), this.valueFormat);
1297
+ this.$emit('change', this.iValue);
1094
1298
  }
1095
1299
  },
1096
- maxDate: function maxDate() {
1097
- if (this.max) {
1098
- var max = '';
1099
- // 默认使用 2023-03-01 格式时,其 hour = 8 而不是 0,所以要转为 2023/03/01 格式
1100
- if (typeof this.max === 'string') {
1101
- max = this.max.replace(/-/gi, '/');
1300
+ clear: function clear() {
1301
+ var oldVal = this.iValue; // 失去焦点时原本就是空的情况不应该 change
1302
+ this.iValue = '';
1303
+ if (oldVal) {
1304
+ this.$emit('change', this.iValue);
1305
+ }
1306
+ if (!this.$pc) {
1307
+ this.$refs.layer.close();
1308
+ }
1309
+ },
1310
+ addZero: function addZero(str) {
1311
+ return ('00' + str).substr(str.toString().length);
1312
+ },
1313
+ handleClick: function handleClick() {
1314
+ if (!this.readonly && !this.inputable) {
1315
+ this.showLayer();
1316
+ }
1317
+ },
1318
+ showLayer: function showLayer() {
1319
+ // 如果 v-dis 为 true,避免在 IE11 下 v-dis 不生效
1320
+ var className = this.$refs.inputBox && this.$refs.inputBox.$el && this.$refs.inputBox.$el.className || '';
1321
+
1322
+ // 表单校验的提示清除
1323
+ this.errorTip = this.$refs.inputBox.errorTip = '';
1324
+ if (className.indexOf('to-dis') > -1) {
1325
+ return;
1326
+ }
1327
+ if (!this.disabled) {
1328
+ this.$refs.layer.toggle('inputBox');
1329
+ this.$nextTick(function () {
1330
+ if (this.$refs.calendar) {
1331
+ this.$refs.calendar.initCalendar();
1332
+ this.$refs.calendar.setData();
1333
+ }
1334
+ });
1335
+ }
1336
+ },
1337
+ getDateFromValue: function getDateFromValue(value) {
1338
+ var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-MM-dd';
1339
+
1340
+ if (!value) return;
1341
+ if (typeof value === 'string') {
1342
+ var date = new Date();
1343
+ var day = void 0;
1344
+ if (this.type === 'month') {
1345
+ day = 1;
1102
1346
  } else {
1103
- max = this.max;
1347
+ day = this.getDateStrFromMatch(/d+/, value, format) || this.addZero(date.getDate());
1104
1348
  }
1105
- return new Date(max);
1106
- } else {
1107
- return new Date('2099-12-31');
1349
+ var datearr = [this.getDateStrFromMatch(/y+/, value, format) || date.getFullYear(), this.getDateStrFromMatch(/M+/, value, format) || this.addZero(date.getMonth() + 1), day];
1350
+ var timearr = [this.getDateStrFromMatch(/H+|h+/, value, format) || this.addZero(date.getHours()), this.getDateStrFromMatch(/m+/, value, format) || this.addZero(date.getMinutes()), this.getDateStrFromMatch(/s+/, value, format) || this.addZero(date.getSeconds())];
1351
+ if (this.type === 'time') {
1352
+ datearr = [date.getFullYear(), this.addZero(date.getMonth() + 1), this.addZero(date.getDate())];
1353
+ var times = value.split(':');
1354
+ timearr = [times[0] || this.addZero(date.getHours()), times[1] || this.addZero(date.getMinutes()), times[2] || this.addZero(date.getSeconds())];
1355
+ }
1356
+ value = new Date(datearr.join('/') + ' ' + timearr.join(':'));
1108
1357
  }
1109
- }
1110
- },
1111
- watch: {
1112
- value: function value() {
1113
- var _this = this;
1358
+ return value;
1359
+ // 值补齐
1360
+ // var date = new Date()
1361
+ // dateformat = dateformat.replace(/y+/g, )
1362
+ // dateformat = dateformat.replace(/M+/g, )
1363
+ // dateformat = dateformat.replace(/d+/g, ))
1364
+ // dateformat = dateformat.replace(/(h+)|(H+)/g,))
1365
+ // dateformat = dateformat.replace(/m+/g, ))
1366
+ // dateformat = dateformat.replace(/s+/g, ))
1367
+ },
1368
+ getDateStrFromMatch: function getDateStrFromMatch(regExp) {
1369
+ var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1370
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'yyyy-MM-dd';
1114
1371
 
1115
- this.setYear(function () {
1116
- _this.setMonth(function () {
1117
- _this.setDay();
1118
- });
1119
- });
1372
+ var yMatch = format.match(regExp);
1373
+ if (!yMatch) return;
1374
+ return value.substr(yMatch.index, yMatch[0].length);
1375
+ },
1376
+ formatDate: function formatDate(date, fmt) {
1377
+ if (date) {
1378
+ if (!fmt) {
1379
+ if (this.type === 'datetime') {
1380
+ fmt = 'yyyy-MM-dd HH:mm:ss';
1381
+ } else if (this.type === 'time') {
1382
+ fmt = 'HH:mm:ss';
1383
+ } else {
1384
+ fmt = 'yyyy-MM-dd';
1385
+ }
1386
+ }
1387
+ if (/(y+)/.test(fmt)) {
1388
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
1389
+ }
1390
+ var o = {
1391
+ 'M+': date.getMonth() + 1,
1392
+ 'd+': date.getDate(),
1393
+ 'H+': date.getHours(),
1394
+ 'm+': date.getMinutes(),
1395
+ 's+': date.getSeconds()
1396
+ };
1397
+ for (var k in o) {
1398
+ if (new RegExp('(' + k + ')').test(fmt)) {
1399
+ var str = o[k] + '';
1400
+ fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.addZero(str));
1401
+ }
1402
+ }
1403
+ return fmt;
1404
+ } else {
1405
+ return '';
1406
+ }
1407
+ },
1408
+ setDisabled: function setDisabled(f) {
1409
+ this.disabled = f;
1120
1410
  }
1121
- },
1122
- mounted: function mounted() {
1123
- var _this2 = this;
1411
+ }
1412
+ });
1413
+ // CONCATENATED MODULE: ./packages/date-picker/src/date-picker.vue?vue&type=script&lang=js
1414
+ /* harmony default export */ var src_date_pickervue_type_script_lang_js = (date_pickervue_type_script_lang_js);
1415
+ // EXTERNAL MODULE: ./packages/date-picker/src/date-picker.vue?vue&type=style&index=0&id=535581e0&prod&lang=css
1416
+ var date_pickervue_type_style_index_0_id_535581e0_prod_lang_css = __webpack_require__(96);
1124
1417
 
1125
- setTimeout(function () {
1126
- if (_this2.type !== 'time') {
1127
- _this2.setYear(function () {
1128
- _this2.setMonth(function () {
1129
- if (_this2.type !== 'month') {
1130
- _this2.setDay();
1131
- }
1132
- });
1133
- });
1134
- }
1135
- if (_this2.type === 'datetime' || _this2.type === 'time') {
1136
- _this2.setHour();
1137
- _this2.setMinute();
1138
- _this2.setSecond();
1139
- }
1140
- _this2.inited = true;
1141
- }, 100);
1142
- },
1418
+ // CONCATENATED MODULE: ./packages/date-picker/src/date-picker.vue
1143
1419
 
1144
- methods: {
1145
- setYear: function setYear(callback) {
1146
- var _this3 = this;
1147
1420
 
1148
- function getYearsRange(currentYear, range) {
1149
- var startYear = currentYear - range;
1150
- var endYear = currentYear + range;
1151
- var years = [];
1152
1421
 
1153
- for (var year = startYear; year <= endYear; year++) {
1154
- years.push(String(year));
1155
- }
1156
1422
 
1157
- return years;
1158
- }
1159
1423
 
1160
- // 获取当前年份
1161
- var currentYear = new Date().getFullYear();
1162
1424
 
1163
- // 获取前后 100 年的年份
1164
- var years = getYearsRange(currentYear, 100);
1425
+ /* normalize component */
1165
1426
 
1166
- // 设置数据
1167
- years.map(function (item) {
1168
- var object = {
1169
- label: item,
1170
- value: item
1171
- };
1427
+ var date_picker_component = Object(componentNormalizer["a" /* default */])(
1428
+ src_date_pickervue_type_script_lang_js,
1429
+ render,
1430
+ staticRenderFns,
1431
+ false,
1432
+ null,
1433
+ null,
1434
+ null
1435
+
1436
+ )
1172
1437
 
1173
- if (item >= _this3.minDate.getFullYear() && item <= _this3.maxDate.getFullYear()) {
1174
- _this3.years.push(object);
1175
- }
1176
- });
1438
+ /* harmony default export */ var date_picker = (date_picker_component.exports);
1439
+ // CONCATENATED MODULE: ./packages/date-picker/index.js
1177
1440
 
1178
- // 将今年设置为默认年份
1179
- this.$nextTick(function () {
1180
- if (_this3.value) {
1181
- _this3.year = _this3.valueo.year;
1182
- } else {
1183
- _this3.year = String(new Date().getFullYear());
1184
- }
1185
- callback && callback();
1186
- });
1187
- },
1188
- setMonth: function setMonth(callback) {
1189
- var _this4 = this;
1190
1441
 
1191
- this.monthList = [];
1192
- this.months.split(',').forEach(function (item) {
1442
+ /* istanbul ignore next */
1443
+ date_picker.install = function (Vue) {
1444
+ Vue.component(date_picker.name, date_picker);
1445
+ };
1193
1446
 
1194
- var object = {
1195
- label: item,
1196
- value: item
1197
- };
1447
+ /* harmony default export */ var packages_date_picker = __webpack_exports__["default"] = (date_picker);
1198
1448
 
1199
- var date = new Date(_this4.year + '-' + item);
1449
+ /***/ }),
1200
1450
 
1201
- // 在 safari 或者 IOS 端,年月必须采用 '2024-07' 的String 类型
1202
- var minDate = new Date(String(_this4.minDate.getFullYear()) + '-' + _this4.addZero(String(_this4.minDate.getMonth() + 1)));
1203
- var maxDate = new Date(String(_this4.maxDate.getFullYear()) + '-' + _this4.addZero(String(_this4.maxDate.getMonth() + 1)));
1451
+ /***/ 5:
1452
+ /***/ (function(module, exports) {
1204
1453
 
1205
- if (date >= minDate && date <= maxDate) {
1206
- _this4.monthList.push(object);
1207
- }
1208
- });
1454
+ module.exports = require("ai.touchui-vue/lib/mixins/tip");
1209
1455
 
1210
- this.$nextTick(function () {
1211
- if (_this4.value) {
1212
- _this4.month = _this4.valueo.month;
1213
- } else if (Array.isArray(_this4.monthList) && _this4.monthList.length) {
1214
- var month = '';
1215
- if (_this4.min) {
1216
- month = _this4.monthList[0].value;
1217
- } else {
1218
- month = new Date().getMonth() + 1;
1219
- }
1220
- var date = new Date(String(_this4.year) + '-' + _this4.addZero(String(month)));
1221
- _this4.month = _this4.addZero(String(date.getMonth() + 1));
1222
- } else {
1223
- _this4.month = _this4.addZero(String(new Date().getMonth() + 1));
1224
- }
1225
- callback && callback();
1226
- });
1227
- },
1228
- setDay: function setDay() {
1229
- var _this5 = this;
1456
+ /***/ }),
1230
1457
 
1231
- var total = new Date(this.year, this.month, 0).getDate();
1232
- this.days = [];
1458
+ /***/ 7:
1459
+ /***/ (function(module, exports, __webpack_require__) {
1233
1460
 
1234
- for (var i = 0; i < total; i++) {
1235
- var day = this.addZero(i + 1);
1461
+ "use strict";
1236
1462
 
1237
- var object = {
1238
- label: day,
1239
- value: day
1240
1463
 
1241
- // 在年月都在可用范围时,再判断天
1242
- };var minDate = new Date(this.minDate.getFullYear(), this.minDate.getMonth(), this.minDate.getDate());
1243
- var maxDate = new Date(this.maxDate.getFullYear(), this.maxDate.getMonth(), this.maxDate.getDate());
1244
- var date = new Date(this.year, this.month - 1, day);
1245
- if (date >= minDate && date <= maxDate) {
1246
- this.days.push(object);
1247
- }
1248
- }
1249
- this.$nextTick(function () {
1250
- if (_this5.value) {
1251
- _this5.day = _this5.valueo.day;
1252
- } else if (Array.isArray(_this5.days) && _this5.days.length) {
1253
- var _day = new Date().getDate();
1254
- var _date = new Date(_this5.year + '/' + _this5.month + '/' + _day);
1255
- _this5.day = _this5.addZero(String(_date.getDate()));
1256
- } else {
1257
- _this5.day = _this5.addZero(String(new Date().getDate()));
1258
- }
1259
- });
1260
- },
1261
- setHour: function setHour() {
1262
- if (this.value) {
1263
- this.hour = this.valueo.hour;
1264
- } else {
1265
- this.hour = this.addZero(String(new Date().getHours()));
1266
- }
1267
- },
1268
- setMinute: function setMinute() {
1269
- if (this.value) {
1270
- this.minute = this.valueo.minute;
1271
- } else {
1272
- this.minute = this.addZero(String(new Date().getMinutes()));
1273
- }
1274
- },
1275
- setSecond: function setSecond() {
1276
- if (this.value) {
1277
- this.second = this.valueo.second;
1278
- } else {
1279
- this.second = this.addZero(String(new Date().getSeconds()));
1280
- }
1281
- },
1282
- yearChange: function yearChange() {
1283
- var _this6 = this;
1464
+ /*
1465
+ MIT License http://www.opensource.org/licenses/mit-license.php
1466
+ Author Tobias Koppers @sokra
1467
+ */
1468
+ // css base code, injected by the css-loader
1469
+ // eslint-disable-next-line func-names
1470
+ module.exports = function (useSourceMap) {
1471
+ var list = []; // return the list of modules as css string
1284
1472
 
1285
- if (this.inited) {
1286
- this.setMonth(function () {
1287
- _this6.setDay();
1288
- });
1289
- }
1290
- },
1291
- monthChange: function monthChange() {
1292
- if (this.inited) {
1293
- this.setDay();
1294
- }
1295
- },
1296
- submit: function submit() {
1297
- if (this.type === 'datetime') {
1298
- this.$emit('change', this.year + '-' + this.month + '-' + this.day + ' ' + this.hour + ':' + this.minute + ':' + this.second);
1299
- } else if (this.type === 'time') {
1300
- this.$emit('change', this.hour + ':' + this.minute + ':' + this.second);
1301
- } else {
1302
- this.$emit('change', this.year + '-' + this.month + '-' + this.day);
1303
- }
1304
- },
1305
- clear: function clear() {
1306
- this.$emit('clear');
1307
- },
1473
+ list.toString = function toString() {
1474
+ return this.map(function (item) {
1475
+ var content = cssWithMappingToString(item, useSourceMap);
1308
1476
 
1309
- // 格式化日期
1310
- formatDate: function formatDate(date, fmt) {
1311
- if (typeof date === 'string') {
1312
- date = new Date(date);
1313
- }
1477
+ if (item[2]) {
1478
+ return "@media ".concat(item[2], "{").concat(content, "}");
1479
+ }
1314
1480
 
1315
- if (!fmt) {
1316
- fmt = 'yyyy-MM-dd HH:mm:ss';
1317
- }
1318
- if (/(y+)/.test(fmt)) {
1319
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
1320
- }
1321
- var o = {
1322
- 'M+': date.getMonth() + 1,
1323
- 'd+': date.getDate(),
1324
- 'H+': date.getHours(),
1325
- 'm+': date.getMinutes(),
1326
- 's+': date.getSeconds()
1327
- };
1328
- for (var k in o) {
1329
- if (new RegExp('(' + k + ')').test(fmt)) {
1330
- var str = o[k] + '';
1331
- fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.addZero(str));
1332
- }
1333
- }
1334
- return fmt;
1335
- },
1336
- addZero: function addZero(str) {
1337
- return ('00' + str).substr(str.toString().length);
1338
- }
1339
- }
1340
- });
1341
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js
1342
- /* harmony default export */ var src_pickervue_type_script_lang_js = (pickervue_type_script_lang_js);
1343
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1344
- var componentNormalizer = __webpack_require__(0);
1481
+ return content;
1482
+ }).join('');
1483
+ }; // import a list of modules into the list
1484
+ // eslint-disable-next-line func-names
1345
1485
 
1346
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue
1347
1486
 
1487
+ list.i = function (modules, mediaQuery) {
1488
+ if (typeof modules === 'string') {
1489
+ // eslint-disable-next-line no-param-reassign
1490
+ modules = [[null, modules, '']];
1491
+ }
1492
+
1493
+ var alreadyImportedModules = {};
1348
1494
 
1495
+ for (var i = 0; i < this.length; i++) {
1496
+ // eslint-disable-next-line prefer-destructuring
1497
+ var id = this[i][0];
1349
1498
 
1499
+ if (id != null) {
1500
+ alreadyImportedModules[id] = true;
1501
+ }
1502
+ }
1350
1503
 
1504
+ for (var _i = 0; _i < modules.length; _i++) {
1505
+ var item = modules[_i]; // skip already imported module
1506
+ // this implementation is not 100% perfect for weird media query combinations
1507
+ // when a module is imported multiple times with different media queries.
1508
+ // I hope this will never occur (Hey this way we have smaller bundles)
1351
1509
 
1352
- /* normalize component */
1510
+ if (item[0] == null || !alreadyImportedModules[item[0]]) {
1511
+ if (mediaQuery && !item[2]) {
1512
+ item[2] = mediaQuery;
1513
+ } else if (mediaQuery) {
1514
+ item[2] = "(".concat(item[2], ") and (").concat(mediaQuery, ")");
1515
+ }
1353
1516
 
1354
- var component = Object(componentNormalizer["a" /* default */])(
1355
- src_pickervue_type_script_lang_js,
1356
- pickervue_type_template_id_4176400e_render,
1357
- pickervue_type_template_id_4176400e_staticRenderFns,
1358
- false,
1359
- null,
1360
- null,
1361
- null
1362
-
1363
- )
1517
+ list.push(item);
1518
+ }
1519
+ }
1520
+ };
1364
1521
 
1365
- /* harmony default export */ var picker = (component.exports);
1366
- // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/date"
1367
- var date_ = __webpack_require__(90);
1522
+ return list;
1523
+ };
1368
1524
 
1369
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/date-picker.vue?vue&type=script&lang=js
1370
- //
1371
- //
1372
- //
1373
- //
1374
- //
1375
- //
1376
- //
1377
- //
1378
- //
1379
- //
1380
- //
1381
- //
1382
- //
1383
- //
1384
- //
1385
- //
1386
- //
1387
- //
1388
- //
1389
- //
1390
- //
1391
- //
1392
- //
1393
- //
1394
- //
1395
- //
1396
- //
1397
- //
1398
- //
1399
- //
1400
- //
1401
- //
1402
- //
1403
- //
1404
- //
1405
- //
1406
- //
1407
- //
1408
- //
1525
+ function cssWithMappingToString(item, useSourceMap) {
1526
+ var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
1409
1527
 
1528
+ var cssMapping = item[3];
1410
1529
 
1530
+ if (!cssMapping) {
1531
+ return content;
1532
+ }
1411
1533
 
1534
+ if (useSourceMap && typeof btoa === 'function') {
1535
+ var sourceMapping = toComment(cssMapping);
1536
+ var sourceURLs = cssMapping.sources.map(function (source) {
1537
+ return "/*# sourceURL=".concat(cssMapping.sourceRoot).concat(source, " */");
1538
+ });
1539
+ return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
1540
+ }
1412
1541
 
1542
+ return [content].join('\n');
1543
+ } // Adapted from convert-source-map (MIT)
1413
1544
 
1414
- // import moment from 'moment';
1415
- /* harmony default export */ var date_pickervue_type_script_lang_js = ({
1416
- name: 'ToDatePicker',
1417
- components: { picker: picker },
1418
- mixins: [tip_default.a],
1419
- componentName: 'ToDatePicker',
1420
- model: {
1421
- event: 'change'
1422
- },
1423
- props: {
1424
- suffix: {
1425
- type: String,
1426
- default: ''
1427
- },
1428
- prefix: {
1429
- type: String,
1430
- default: ''
1431
- },
1432
- showCalendar: {
1433
- type: Boolean,
1434
- default: false
1435
- },
1436
- lazy: {
1437
- type: Boolean,
1438
- default: function _default() {
1439
- if (this.$TouchUI && this.$TouchUI.datePicker && this.$TouchUI.datePicker.lazy === false) {
1440
- return false;
1441
- } else {
1442
- return true;
1443
- }
1444
- }
1445
- },
1446
- desc: {
1447
- type: String,
1448
- default: ''
1449
- },
1450
- // 安全
1451
- spChars: {
1452
- type: [String, Boolean],
1453
- default: '/,\\,[,],{,},"' // 微软拼音输入法使用单引号做上屏前多个字符分隔符,不能过滤单引号
1454
- },
1455
- id: {
1456
- type: String,
1457
- default: ''
1458
- },
1459
- required: {
1460
- type: Boolean,
1461
- default: null
1462
- },
1463
- value: {
1464
- type: [String, Date],
1465
- default: ''
1466
- },
1467
- placeholder: {
1468
- type: String,
1469
- default: function _default() {
1470
- if (this.inputable) {
1471
- return Object(locale_["t"])('to.common.placeholder.select');
1472
- } else {
1473
- return Object(locale_["t"])('to.common.placeholder.select');
1474
- }
1475
- }
1476
- },
1477
- readonly: Boolean,
1478
- inputable: {
1479
- type: Boolean,
1480
- default: true
1481
- },
1482
- type: {
1483
- type: String,
1484
- default: ''
1485
- },
1486
- fillet: {
1487
- type: String,
1488
- default: function _default() {
1489
- return this.$TouchUI.datePicker.fillet || this.$TouchUI.global.fillet || 'normal';
1490
- }
1491
- },
1492
- filletPosition: {
1493
- type: String,
1494
- default: ''
1495
- },
1496
- color: {
1497
- type: String,
1498
- default: 'default'
1499
- },
1500
- mode: {
1501
- type: String,
1502
- default: ''
1503
- },
1504
- width: {
1505
- type: [Number, String],
1506
- default: ''
1507
- },
1508
- valueFormat: {
1509
- type: String,
1510
- default: function _default() {
1511
- if (this.type === 'datetime') {
1512
- return 'yyyy-MM-dd HH:mm:ss';
1513
- } else if (this.type === 'time') {
1514
- return 'HH:mm:ss';
1515
- } else if (this.type === 'month') {
1516
- return 'yyyy-MM';
1517
- } else {
1518
- return 'yyyy-MM-dd';
1519
- }
1520
- }
1521
- },
1522
- displayFormat: {
1523
- type: String,
1524
- default: function _default() {
1525
- if (this.type === 'datetime') {
1526
- return 'yyyy-MM-dd HH:mm:ss';
1527
- } else if (this.type === 'month') {
1528
- return 'yyyy-MM';
1529
- } else {
1530
- return 'yyyy-MM-dd';
1531
- }
1532
- }
1533
- },
1534
- time: {
1535
- type: String,
1536
- default: ''
1537
- },
1538
- comparable: Boolean,
1539
- beforeChange: {
1540
- type: Function,
1541
- default: null
1542
- },
1543
- optionAlign: {
1544
- type: String,
1545
- default: ''
1546
- },
1547
- min: {
1548
- type: [String, Date, Number],
1549
- default: ''
1550
- },
1551
- max: {
1552
- type: [String, Date, Number],
1553
- default: ''
1554
- },
1555
- clearable: {
1556
- type: Boolean,
1557
- default: true
1558
- }
1559
- },
1560
- data: function data() {
1561
- return {
1562
- errorType: 'rule',
1563
- errorTip: '',
1564
- date: '',
1565
- iValue: '',
1566
- datedisplay: '',
1567
- layerSlide: false,
1568
- displayFormatRegExp: '',
1569
- layerPosition: 'auto',
1570
- disabled: this.readonly
1571
- };
1572
- },
1573
1545
 
1574
- watch: {
1575
- readonly: function readonly(val) {
1576
- this.disabled = val;
1577
- },
1546
+ function toComment(sourceMap) {
1547
+ // eslint-disable-next-line no-undef
1548
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
1549
+ var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
1550
+ return "/*# ".concat(data, " */");
1551
+ }
1578
1552
 
1579
- value: {
1580
- handler: function handler(val) {
1581
- if (val === '' || val === null || val === undefined) {
1582
- this.date = '';
1583
- this.datedisplay = '';
1584
- } else {
1585
- // 检查数据是否和 valueFormat 相匹配,避免报错
1586
- var newValue = val.trim().substring(0, this.valueFormat.length);
1553
+ /***/ }),
1587
1554
 
1588
- if (!Object(date_["matchFormat"])(newValue, this.valueFormat)) {
1589
- return;
1590
- }
1591
- if (this.type === 'time') {
1592
- this.date = this.getDateFromValue(newValue, 'yyyy-MM-dd HH:mm:ss');
1593
- this.datedisplay = newValue;
1594
- } else {
1595
- newValue = this.getDateFromValue(newValue, this.valueFormat);
1596
- this.date = newValue;
1597
- this.datedisplay = this.formatDate(newValue, this.displayFormat);
1598
- }
1599
- }
1600
- },
1555
+ /***/ 8:
1556
+ /***/ (function(module, exports, __webpack_require__) {
1601
1557
 
1602
- immediate: true
1603
- },
1604
- displayFormat: {
1605
- handler: function handler(fmt) {
1606
- this.displayFormatRegExp = new RegExp('^' + String(fmt).replace(/\-|\//g, '\\-').replace(/[a-zA-Z]/g, '\\d') + '$');
1607
- },
1558
+ "use strict";
1608
1559
 
1609
- immediate: true
1610
- }
1611
- },
1612
- created: function created() {
1613
- if (this.$platform === 'phone') {
1614
- this.layerSlide = true;
1615
- this.layerPosition = 'bottom';
1616
- }
1617
- if (this.value) {
1618
- this.iValue = this.value;
1619
- this.$emit('change', this.value);
1620
- }
1621
- },
1622
- mounted: function mounted() {
1623
- // this.$refs.layer.open()
1624
- },
1625
1560
 
1626
- methods: {
1627
- handleLayerClose: function handleLayerClose() {
1628
- this.$refs.calendar.timeLayer = false;
1629
- this.$refs.calendar.monthLayer = false;
1630
- },
1631
- handleDisplayChange: function handleDisplayChange(value) {
1632
- this.datedisplay = value;
1633
- this.$emit('change', this.datedisplay);
1634
- },
1635
- handleDisplayBlur: function handleDisplayBlur() {
1636
- var _this = this;
1561
+ var stylesInDom = {};
1637
1562
 
1638
- setTimeout(function () {
1639
- if (isNaN(new Date(_this.datedisplay))) {
1640
- _this.datedisplay = '';
1641
- _this.changeValue('');
1642
- } else {
1643
- _this.$emit('beforeChange', _this.datedisplay);
1644
- if (!_this.displayFormatRegExp.test(_this.datedisplay)) {
1645
- _this.datedisplay = _this.formatDate(new Date(_this.datedisplay), _this.displayFormat);
1646
- _this.iValue = _this.formatDate(new Date(_this.datedisplay), _this.displayFormat);
1647
- _this.$emit('change', _this.iValue);
1648
- } else {
1649
- _this.changeValue(_this.getDateFromValue(_this.datedisplay, _this.displayFormat));
1650
- }
1651
- }
1652
- }, 100);
1653
- },
1654
- select: function select(value) {
1655
- this.changeValue(value);
1656
- this.$refs.layer.close();
1657
- },
1658
- changeValue: function changeValue(value) {
1659
- this.$emit('beforeChange', value);
1660
- if (!value) {
1661
- this.clear();
1662
- } else if (this.type === 'time') {
1663
- if (typeof value === 'string') {
1664
- this.datedisplay = value.split(' ').length > 1 ? value.split(' ')[1] : value;
1665
- this.iValue = value.split(' ').length > 1 ? value.split(' ')[1] : value;
1666
- } else {
1667
- value = this.formatDate(new Date(value), 'yyyy-MM-dd HH:mm:ss');
1668
- var flag = isNaN(new Date(value).getTime()); // 判断是否可以使用 2022-05 如果不可用,则替换为 2022/05
1669
- if (flag) {
1670
- value = value.replace(/-/g, '/');
1671
- }
1672
- this.datedisplay = value.split(' ').length > 1 ? value.split(' ')[1] : value;
1673
- this.iValue = value.split(' ').length > 1 ? value.split(' ')[1] : value;
1674
- }
1675
- this.$emit('change', this.iValue);
1676
- } else {
1677
- var _flag = isNaN(new Date(value).getTime()); // 判断是否可以使用 2022-05 如果不可用,则替换为 2022/05
1678
- if (_flag) {
1679
- value = value.replace(/-/g, '/');
1680
- }
1681
- this.datedisplay = this.formatDate(new Date(value), this.displayFormat);
1682
- this.iValue = this.formatDate(new Date(value), this.valueFormat);
1683
- this.$emit('change', this.iValue);
1684
- }
1685
- },
1686
- clear: function clear() {
1687
- var oldVal = this.iValue; // 失去焦点时原本就是空的情况不应该 change
1688
- this.iValue = '';
1689
- if (oldVal) {
1690
- this.$emit('change', this.iValue);
1691
- }
1692
- if (!this.$pc) {
1693
- this.$refs.layer.close();
1694
- }
1695
- },
1696
- addZero: function addZero(str) {
1697
- return ('00' + str).substr(str.toString().length);
1698
- },
1699
- handleClick: function handleClick() {
1700
- if (!this.readonly && !this.inputable) {
1701
- this.showLayer();
1702
- }
1703
- },
1704
- showLayer: function showLayer() {
1705
- // 如果 v-dis 为 true,避免在 IE11 下 v-dis 不生效
1706
- var className = this.$refs.inputBox && this.$refs.inputBox.$el && this.$refs.inputBox.$el.className || '';
1563
+ var isOldIE = function isOldIE() {
1564
+ var memo;
1565
+ return function memorize() {
1566
+ if (typeof memo === 'undefined') {
1567
+ // Test for IE <= 9 as proposed by Browserhacks
1568
+ // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
1569
+ // Tests for existence of standard globals is to allow style-loader
1570
+ // to operate correctly into non-standard environments
1571
+ // @see https://github.com/webpack-contrib/style-loader/issues/177
1572
+ memo = Boolean(window && document && document.all && !window.atob);
1573
+ }
1574
+
1575
+ return memo;
1576
+ };
1577
+ }();
1578
+
1579
+ var getTarget = function getTarget() {
1580
+ var memo = {};
1581
+ return function memorize(target) {
1582
+ if (typeof memo[target] === 'undefined') {
1583
+ var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
1584
+
1585
+ if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
1586
+ try {
1587
+ // This will throw an exception if access to iframe is blocked
1588
+ // due to cross-origin restrictions
1589
+ styleTarget = styleTarget.contentDocument.head;
1590
+ } catch (e) {
1591
+ // istanbul ignore next
1592
+ styleTarget = null;
1593
+ }
1594
+ }
1595
+
1596
+ memo[target] = styleTarget;
1597
+ }
1598
+
1599
+ return memo[target];
1600
+ };
1601
+ }();
1602
+
1603
+ function listToStyles(list, options) {
1604
+ var styles = [];
1605
+ var newStyles = {};
1606
+
1607
+ for (var i = 0; i < list.length; i++) {
1608
+ var item = list[i];
1609
+ var id = options.base ? item[0] + options.base : item[0];
1610
+ var css = item[1];
1611
+ var media = item[2];
1612
+ var sourceMap = item[3];
1613
+ var part = {
1614
+ css: css,
1615
+ media: media,
1616
+ sourceMap: sourceMap
1617
+ };
1618
+
1619
+ if (!newStyles[id]) {
1620
+ styles.push(newStyles[id] = {
1621
+ id: id,
1622
+ parts: [part]
1623
+ });
1624
+ } else {
1625
+ newStyles[id].parts.push(part);
1626
+ }
1627
+ }
1628
+
1629
+ return styles;
1630
+ }
1631
+
1632
+ function addStylesToDom(styles, options) {
1633
+ for (var i = 0; i < styles.length; i++) {
1634
+ var item = styles[i];
1635
+ var domStyle = stylesInDom[item.id];
1636
+ var j = 0;
1637
+
1638
+ if (domStyle) {
1639
+ domStyle.refs++;
1640
+
1641
+ for (; j < domStyle.parts.length; j++) {
1642
+ domStyle.parts[j](item.parts[j]);
1643
+ }
1644
+
1645
+ for (; j < item.parts.length; j++) {
1646
+ domStyle.parts.push(addStyle(item.parts[j], options));
1647
+ }
1648
+ } else {
1649
+ var parts = [];
1650
+
1651
+ for (; j < item.parts.length; j++) {
1652
+ parts.push(addStyle(item.parts[j], options));
1653
+ }
1654
+
1655
+ stylesInDom[item.id] = {
1656
+ id: item.id,
1657
+ refs: 1,
1658
+ parts: parts
1659
+ };
1660
+ }
1661
+ }
1662
+ }
1663
+
1664
+ function insertStyleElement(options) {
1665
+ var style = document.createElement('style');
1666
+
1667
+ if (typeof options.attributes.nonce === 'undefined') {
1668
+ var nonce = true ? __webpack_require__.nc : undefined;
1669
+
1670
+ if (nonce) {
1671
+ options.attributes.nonce = nonce;
1672
+ }
1673
+ }
1674
+
1675
+ Object.keys(options.attributes).forEach(function (key) {
1676
+ style.setAttribute(key, options.attributes[key]);
1677
+ });
1678
+
1679
+ if (typeof options.insert === 'function') {
1680
+ options.insert(style);
1681
+ } else {
1682
+ var target = getTarget(options.insert || 'head');
1707
1683
 
1708
- // 表单校验的提示清除
1709
- this.errorTip = this.$refs.inputBox.errorTip = '';
1710
- if (className.indexOf('to-dis') > -1) {
1711
- return;
1712
- }
1713
- if (!this.disabled) {
1714
- this.$refs.layer.toggle('inputBox');
1715
- this.$nextTick(function () {
1716
- if (this.$refs.calendar) {
1717
- this.$refs.calendar.initCalendar();
1718
- this.$refs.calendar.setData();
1719
- }
1720
- });
1721
- }
1722
- },
1723
- getDateFromValue: function getDateFromValue(value) {
1724
- var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-MM-dd';
1684
+ if (!target) {
1685
+ throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
1686
+ }
1725
1687
 
1726
- if (!value) return;
1727
- if (typeof value === 'string') {
1728
- var date = new Date();
1729
- var day = void 0;
1730
- if (this.type === 'month') {
1731
- day = 1;
1732
- } else {
1733
- day = this.getDateStrFromMatch(/d+/, value, format) || this.addZero(date.getDate());
1734
- }
1735
- var datearr = [this.getDateStrFromMatch(/y+/, value, format) || date.getFullYear(), this.getDateStrFromMatch(/M+/, value, format) || this.addZero(date.getMonth() + 1), day];
1736
- var timearr = [this.getDateStrFromMatch(/H+|h+/, value, format) || this.addZero(date.getHours()), this.getDateStrFromMatch(/m+/, value, format) || this.addZero(date.getMinutes()), this.getDateStrFromMatch(/s+/, value, format) || this.addZero(date.getSeconds())];
1737
- if (this.type === 'time') {
1738
- datearr = [date.getFullYear(), this.addZero(date.getMonth() + 1), this.addZero(date.getDate())];
1739
- var times = value.split(':');
1740
- timearr = [times[0] || this.addZero(date.getHours()), times[1] || this.addZero(date.getMinutes()), times[2] || this.addZero(date.getSeconds())];
1741
- }
1742
- value = new Date(datearr.join('/') + ' ' + timearr.join(':'));
1743
- }
1744
- return value;
1745
- // 值补齐
1746
- // var date = new Date()
1747
- // dateformat = dateformat.replace(/y+/g, )
1748
- // dateformat = dateformat.replace(/M+/g, )
1749
- // dateformat = dateformat.replace(/d+/g, ))
1750
- // dateformat = dateformat.replace(/(h+)|(H+)/g,))
1751
- // dateformat = dateformat.replace(/m+/g, ))
1752
- // dateformat = dateformat.replace(/s+/g, ))
1753
- },
1754
- getDateStrFromMatch: function getDateStrFromMatch(regExp) {
1755
- var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1756
- var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'yyyy-MM-dd';
1688
+ target.appendChild(style);
1689
+ }
1757
1690
 
1758
- var yMatch = format.match(regExp);
1759
- if (!yMatch) return;
1760
- return value.substr(yMatch.index, yMatch[0].length);
1761
- },
1762
- formatDate: function formatDate(date, fmt) {
1763
- if (date) {
1764
- if (!fmt) {
1765
- if (this.type === 'datetime') {
1766
- fmt = 'yyyy-MM-dd HH:mm:ss';
1767
- } else if (this.type === 'time') {
1768
- fmt = 'HH:mm:ss';
1769
- } else {
1770
- fmt = 'yyyy-MM-dd';
1771
- }
1772
- }
1773
- if (/(y+)/.test(fmt)) {
1774
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
1775
- }
1776
- var o = {
1777
- 'M+': date.getMonth() + 1,
1778
- 'd+': date.getDate(),
1779
- 'H+': date.getHours(),
1780
- 'm+': date.getMinutes(),
1781
- 's+': date.getSeconds()
1782
- };
1783
- for (var k in o) {
1784
- if (new RegExp('(' + k + ')').test(fmt)) {
1785
- var str = o[k] + '';
1786
- fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.addZero(str));
1787
- }
1788
- }
1789
- return fmt;
1790
- } else {
1791
- return '';
1792
- }
1793
- },
1794
- setDisabled: function setDisabled(f) {
1795
- this.disabled = f;
1796
- }
1797
- }
1798
- });
1799
- // CONCATENATED MODULE: ./packages/date-picker/src/date-picker.vue?vue&type=script&lang=js
1800
- /* harmony default export */ var src_date_pickervue_type_script_lang_js = (date_pickervue_type_script_lang_js);
1801
- // EXTERNAL MODULE: ./packages/date-picker/src/date-picker.vue?vue&type=style&index=0&id=535581e0&prod&lang=css
1802
- var date_pickervue_type_style_index_0_id_535581e0_prod_lang_css = __webpack_require__(93);
1691
+ return style;
1692
+ }
1803
1693
 
1804
- // CONCATENATED MODULE: ./packages/date-picker/src/date-picker.vue
1694
+ function removeStyleElement(style) {
1695
+ // istanbul ignore if
1696
+ if (style.parentNode === null) {
1697
+ return false;
1698
+ }
1805
1699
 
1700
+ style.parentNode.removeChild(style);
1701
+ }
1702
+ /* istanbul ignore next */
1806
1703
 
1807
1704
 
1705
+ var replaceText = function replaceText() {
1706
+ var textStore = [];
1707
+ return function replace(index, replacement) {
1708
+ textStore[index] = replacement;
1709
+ return textStore.filter(Boolean).join('\n');
1710
+ };
1711
+ }();
1808
1712
 
1713
+ function applyToSingletonTag(style, index, remove, obj) {
1714
+ var css = remove ? '' : obj.css; // For old IE
1809
1715
 
1716
+ /* istanbul ignore if */
1810
1717
 
1811
- /* normalize component */
1718
+ if (style.styleSheet) {
1719
+ style.styleSheet.cssText = replaceText(index, css);
1720
+ } else {
1721
+ var cssNode = document.createTextNode(css);
1722
+ var childNodes = style.childNodes;
1812
1723
 
1813
- var date_picker_component = Object(componentNormalizer["a" /* default */])(
1814
- src_date_pickervue_type_script_lang_js,
1815
- render,
1816
- staticRenderFns,
1817
- false,
1818
- null,
1819
- null,
1820
- null
1821
-
1822
- )
1724
+ if (childNodes[index]) {
1725
+ style.removeChild(childNodes[index]);
1726
+ }
1823
1727
 
1824
- /* harmony default export */ var date_picker = (date_picker_component.exports);
1825
- // CONCATENATED MODULE: ./packages/date-picker/index.js
1728
+ if (childNodes.length) {
1729
+ style.insertBefore(cssNode, childNodes[index]);
1730
+ } else {
1731
+ style.appendChild(cssNode);
1732
+ }
1733
+ }
1734
+ }
1826
1735
 
1736
+ function applyToTag(style, options, obj) {
1737
+ var css = obj.css;
1738
+ var media = obj.media;
1739
+ var sourceMap = obj.sourceMap;
1827
1740
 
1828
- /* istanbul ignore next */
1829
- date_picker.install = function (Vue) {
1830
- Vue.component(date_picker.name, date_picker);
1831
- };
1741
+ if (media) {
1742
+ style.setAttribute('media', media);
1743
+ }
1832
1744
 
1833
- /* harmony default export */ var packages_date_picker = __webpack_exports__["default"] = (date_picker);
1745
+ if (sourceMap && btoa) {
1746
+ css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
1747
+ } // For old IE
1834
1748
 
1835
- /***/ }),
1749
+ /* istanbul ignore if */
1836
1750
 
1837
- /***/ 5:
1838
- /***/ (function(module, exports) {
1839
1751
 
1840
- module.exports = require("ai.touchui-vue/lib/mixins/tip");
1752
+ if (style.styleSheet) {
1753
+ style.styleSheet.cssText = css;
1754
+ } else {
1755
+ while (style.firstChild) {
1756
+ style.removeChild(style.firstChild);
1757
+ }
1758
+
1759
+ style.appendChild(document.createTextNode(css));
1760
+ }
1761
+ }
1762
+
1763
+ var singleton = null;
1764
+ var singletonCounter = 0;
1765
+
1766
+ function addStyle(obj, options) {
1767
+ var style;
1768
+ var update;
1769
+ var remove;
1770
+
1771
+ if (options.singleton) {
1772
+ var styleIndex = singletonCounter++;
1773
+ style = singleton || (singleton = insertStyleElement(options));
1774
+ update = applyToSingletonTag.bind(null, style, styleIndex, false);
1775
+ remove = applyToSingletonTag.bind(null, style, styleIndex, true);
1776
+ } else {
1777
+ style = insertStyleElement(options);
1778
+ update = applyToTag.bind(null, style, options);
1779
+
1780
+ remove = function remove() {
1781
+ removeStyleElement(style);
1782
+ };
1783
+ }
1784
+
1785
+ update(obj);
1786
+ return function updateStyle(newObj) {
1787
+ if (newObj) {
1788
+ if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
1789
+ return;
1790
+ }
1791
+
1792
+ update(obj = newObj);
1793
+ } else {
1794
+ remove();
1795
+ }
1796
+ };
1797
+ }
1798
+
1799
+ module.exports = function (list, options) {
1800
+ options = options || {};
1801
+ options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
1802
+ // tags it will allow on a page
1803
+
1804
+ if (!options.singleton && typeof options.singleton !== 'boolean') {
1805
+ options.singleton = isOldIE();
1806
+ }
1807
+
1808
+ var styles = listToStyles(list, options);
1809
+ addStylesToDom(styles, options);
1810
+ return function update(newList) {
1811
+ var mayRemove = [];
1812
+
1813
+ for (var i = 0; i < styles.length; i++) {
1814
+ var item = styles[i];
1815
+ var domStyle = stylesInDom[item.id];
1816
+
1817
+ if (domStyle) {
1818
+ domStyle.refs--;
1819
+ mayRemove.push(domStyle);
1820
+ }
1821
+ }
1822
+
1823
+ if (newList) {
1824
+ var newStyles = listToStyles(newList, options);
1825
+ addStylesToDom(newStyles, options);
1826
+ }
1827
+
1828
+ for (var _i = 0; _i < mayRemove.length; _i++) {
1829
+ var _domStyle = mayRemove[_i];
1830
+
1831
+ if (_domStyle.refs === 0) {
1832
+ for (var j = 0; j < _domStyle.parts.length; j++) {
1833
+ _domStyle.parts[j]();
1834
+ }
1835
+
1836
+ delete stylesInDom[_domStyle.id];
1837
+ }
1838
+ }
1839
+ };
1840
+ };
1841
1841
 
1842
1842
  /***/ }),
1843
1843
 
1844
- /***/ 90:
1844
+ /***/ 91:
1845
1845
  /***/ (function(module, exports) {
1846
1846
 
1847
1847
  module.exports = require("ai.touchui-vue/lib/utils/date");
1848
1848
 
1849
1849
  /***/ }),
1850
1850
 
1851
- /***/ 93:
1851
+ /***/ 96:
1852
1852
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1853
1853
 
1854
1854
  "use strict";
1855
- /* harmony import */ var _node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_date_picker_vue_vue_type_style_index_0_id_535581e0_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
1855
+ /* harmony import */ var _node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_date_picker_vue_vue_type_style_index_0_id_535581e0_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
1856
1856
  /* harmony import */ var _node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_date_picker_vue_vue_type_style_index_0_id_535581e0_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_date_picker_vue_vue_type_style_index_0_id_535581e0_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
1857
1857
  /* unused harmony reexport * */
1858
1858
 
1859
1859
 
1860
1860
  /***/ }),
1861
1861
 
1862
- /***/ 94:
1862
+ /***/ 97:
1863
1863
  /***/ (function(module, exports, __webpack_require__) {
1864
1864
 
1865
- exports = module.exports = __webpack_require__(11)(false);
1865
+ exports = module.exports = __webpack_require__(7)(false);
1866
1866
  // Module
1867
1867
  exports.push([module.i, "\n.to-date-picker.to-dis>.to-icon-date {\n\tpointer-events: none;\n}\n", ""]);
1868
1868