ai.touchui-vue 1.40.2 → 1.41.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 (127) hide show
  1. package/lib/affix.js +2 -2
  2. package/lib/ai.touchui-vue.common.js +901 -819
  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 +18 -18
  10. package/lib/card.js +2 -2
  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 +12 -12
  17. package/lib/color.js +2 -2
  18. package/lib/countdown.js +2 -2
  19. package/lib/date-picker.js +120 -480
  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 +2 -2
  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 +6 -6
  37. package/lib/index.js +1 -1
  38. package/lib/input.js +2 -2
  39. package/lib/ip.js +2 -2
  40. package/lib/line.js +2 -2
  41. package/lib/loading.js +2 -2
  42. package/lib/longtap.js +2 -2
  43. package/lib/menu-icon.js +670 -673
  44. package/lib/message.js +2 -2
  45. package/lib/msg.js +2 -2
  46. package/lib/org.js +22 -22
  47. package/lib/padding.js +2 -2
  48. package/lib/page.js +2 -2
  49. package/lib/param.js +2 -2
  50. package/lib/pic.js +2 -2
  51. package/lib/popup.js +2 -2
  52. package/lib/progress.js +2 -2
  53. package/lib/range.js +10 -10
  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 +4 -4
  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 +2 -2
  67. package/lib/table.js +4 -4
  68. package/lib/tag.js +2 -2
  69. package/lib/theme/css/theme/B-Design.css +1 -1
  70. package/lib/theme/css/theme/aiplan.css +1 -1
  71. package/lib/theme/css/theme/aiplangd.css +1 -1
  72. package/lib/theme/css/theme/chbn.css +1 -1
  73. package/lib/theme/css/theme/default.css +1 -1
  74. package/lib/theme/css/theme/dt.css +1 -1
  75. package/lib/theme/css/theme/ecloud.css +1 -1
  76. package/lib/theme/css/theme/hongkong.css +1 -1
  77. package/lib/theme/css/theme/logistics.css +1 -1
  78. package/lib/theme/css/theme/narrow.css +1 -1
  79. package/lib/theme/css/theme/sdpf.css +1 -1
  80. package/lib/theme/css/theme/upc.css +1 -1
  81. package/lib/theme/css/theme/website.css +1 -1
  82. package/lib/theme/css/theme/workbench-gz.css +1 -1
  83. package/lib/theme/css/theme/zj.css +1 -1
  84. package/lib/timeline.js +2 -2
  85. package/lib/tip.js +2 -2
  86. package/lib/tooltip.js +2 -2
  87. package/lib/transfer.js +2 -2
  88. package/lib/tree.js +2 -2
  89. package/lib/upload.js +6 -6
  90. package/package.json +1 -1
  91. package/packages/date-picker/src/date-picker.vue +40 -12
  92. package/packages/date-picker/src/picker.vue +5 -1
  93. package/packages/theme/lib/css/theme/B-Design.css +1 -1
  94. package/packages/theme/lib/css/theme/aiplan.css +1 -1
  95. package/packages/theme/lib/css/theme/aiplangd.css +1 -1
  96. package/packages/theme/lib/css/theme/chbn.css +1 -1
  97. package/packages/theme/lib/css/theme/default.css +1 -1
  98. package/packages/theme/lib/css/theme/dt.css +1 -1
  99. package/packages/theme/lib/css/theme/ecloud.css +1 -1
  100. package/packages/theme/lib/css/theme/hongkong.css +1 -1
  101. package/packages/theme/lib/css/theme/logistics.css +1 -1
  102. package/packages/theme/lib/css/theme/narrow.css +1 -1
  103. package/packages/theme/lib/css/theme/sdpf.css +1 -1
  104. package/packages/theme/lib/css/theme/upc.css +1 -1
  105. package/packages/theme/lib/css/theme/website.css +1 -1
  106. package/packages/theme/lib/css/theme/workbench-gz.css +1 -1
  107. package/packages/theme/lib/css/theme/zj.css +1 -1
  108. package/packages/theme/src/less/component/calendar-dark.less +27 -1
  109. package/packages/theme/src/less/component/calendar.less +15 -11
  110. package/packages/theme/src/less/element/datePicker-dark.less +15 -0
  111. package/packages/theme/src/less/element/datePicker.less +17 -0
  112. package/packages/theme/src/less/theme/B-Design.less +2 -0
  113. package/packages/theme/src/less/theme/aiplan.less +2 -0
  114. package/packages/theme/src/less/theme/aiplangd.less +2 -0
  115. package/packages/theme/src/less/theme/chbn.less +2 -0
  116. package/packages/theme/src/less/theme/default.less +2 -0
  117. package/packages/theme/src/less/theme/dt.less +2 -0
  118. package/packages/theme/src/less/theme/ecloud.less +2 -0
  119. package/packages/theme/src/less/theme/hongkong.less +2 -0
  120. package/packages/theme/src/less/theme/logistics.less +2 -0
  121. package/packages/theme/src/less/theme/narrow.less +2 -0
  122. package/packages/theme/src/less/theme/sdpf.less +2 -0
  123. package/packages/theme/src/less/theme/upc.less +2 -0
  124. package/packages/theme/src/less/theme/website.less +2 -0
  125. package/packages/theme/src/less/theme/workbench-gz.less +2 -0
  126. package/packages/theme/src/less/theme/zj.less +2 -0
  127. package/src/index.js +64 -2
package/lib/timeline.js CHANGED
@@ -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 = 376);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 373);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 376:
195
+ /***/ 373:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/tip.js CHANGED
@@ -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 = 381);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 378);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 381:
195
+ /***/ 378:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/tooltip.js CHANGED
@@ -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 = 382);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 379);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 382:
195
+ /***/ 379:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/transfer.js CHANGED
@@ -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 = 361);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 358);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 361:
195
+ /***/ 358:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/tree.js CHANGED
@@ -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 = 347);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 344);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 347:
195
+ /***/ 344:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/upload.js CHANGED
@@ -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 = 360);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 357);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -199,7 +199,7 @@ module.exports = require("ai.touchui-vue/lib/utils/dom");
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 14:
202
+ /***/ 12:
203
203
  /***/ (function(module, exports) {
204
204
 
205
205
  module.exports = require("ai.touchui-vue/lib/utils/types");
@@ -818,7 +818,7 @@ module.exports = require("ai.touchui-vue/lib/locale");
818
818
 
819
819
  /***/ }),
820
820
 
821
- /***/ 360:
821
+ /***/ 357:
822
822
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
823
823
 
824
824
  "use strict";
@@ -1586,10 +1586,10 @@ var filetransfer_ = __webpack_require__(6);
1586
1586
  var filetransfer_default = /*#__PURE__*/__webpack_require__.n(filetransfer_);
1587
1587
 
1588
1588
  // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/types"
1589
- var types_ = __webpack_require__(14);
1589
+ var types_ = __webpack_require__(12);
1590
1590
 
1591
1591
  // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/md5"
1592
- var md5_ = __webpack_require__(88);
1592
+ var md5_ = __webpack_require__(87);
1593
1593
 
1594
1594
  // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/sign"
1595
1595
  var sign_ = __webpack_require__(9);
@@ -2561,7 +2561,7 @@ module.exports = require("ai.touchui-vue/lib/utils/util");
2561
2561
 
2562
2562
  /***/ }),
2563
2563
 
2564
- /***/ 88:
2564
+ /***/ 87:
2565
2565
  /***/ (function(module, exports) {
2566
2566
 
2567
2567
  module.exports = require("ai.touchui-vue/lib/utils/md5");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai.touchui-vue",
3
- "version": "1.40.2",
3
+ "version": "1.41.0",
4
4
  "description": "TouchUI Component Library for Vue.js.",
5
5
  "main": "lib/ai.touchui-vue.common.js",
6
6
  "files": [
@@ -2,10 +2,18 @@
2
2
  <to-input :id="id" ref="inputBox" class="to-date-picker" :required="required" :desc="desc" :color="color" :prefix="prefix" :suffix="suffix" :mode="mode" :prop-error-type="errorType" :prop-error-tip="errorTip" :fillet="fillet" :fillet-position="filletPosition" :value="datedisplay" :placeholder="placeholder" :readonly="disabled || !inputable" :sp-chars="spChars" :link="!inputable && !disabled" :clearable="clearable && !disabled" :width="width" :comparable="comparable" @focus="errorTip = ''; $emit('focus', datedisplay)" @click="handleClick" @clear="clear()" @input="handleDisplayChange" @blur="handleDisplayBlur">
3
3
  <to-icon v-if="type === 'time'" slot="suffix" :link="inputable" :class="disabled ? 'to-dis' : ''" mode="none" color="primary" value="time" @click="showLayer"></to-icon>
4
4
  <to-icon v-else slot="suffix" :link="inputable" :class="disabled ? 'to-dis' : ''" mode="none" color="primary" value="date" @click="showLayer"></to-icon>
5
- <to-float ref="layer" :lazy="lazy" :slide="layerSlide" :position="layerPosition" :paddng="0.5" :width="$platform === 'pc' ? 23 : ''" :align="optionAlign ? optionAlign : $pc ? 'right' : 'auto'" @close="handleLayerClose">
5
+ <to-float ref="layer" class="to-date-picker-layer" :lazy="lazy" :slide="layerSlide" :position="layerPosition" :paddng="0.5" :width="$platform === 'pc' ? shortcuts && shortcuts.length && type !== 'time' ? 29 : 23 : ''" :align="optionAlign ? optionAlign : $pc ? 'right' : 'auto'" @close="handleLayerClose">
6
6
  <to-scroll v-if="$pc || showCalendar">
7
- <to-calendar ref="calendar" v-model="date" :time="time" :type="type" :min="min" :max="max" :before-change="beforeChange" @change="select" @close="$refs.layer.close()">
8
- </to-calendar>
7
+ <div class="wrapper">
8
+ <div v-if="shortcuts && shortcuts.length && type !== 'time'" class="shortcuts">
9
+ <ul>
10
+ <li v-for="(item, index) in shortcuts" :key="index" @click="handleShortcut(item)">
11
+ {{ item.label }}
12
+ </li>
13
+ </ul>
14
+ </div>
15
+ <to-calendar ref="calendar" v-model="date" :time="time" :type="type" :min="min" :max="max" :before-change="beforeChange" @change="select" @close="$refs.layer.close()"></to-calendar>
16
+ </div>
9
17
  </to-scroll>
10
18
  <picker v-else v-model="date" :time="time" :type="type" :min="min" :max="max" @cancel="$refs.layer.close()" @change="select" @clear="clear()"></picker>
11
19
  </to-float>
@@ -160,6 +168,16 @@ export default {
160
168
  clearable: {
161
169
  type: Boolean,
162
170
  default: true
171
+ },
172
+ shortcuts: {
173
+ type: [Array, Boolean],
174
+ default() {
175
+ if (this.$TouchUI.datePicker && this.$TouchUI.datePicker.shortcuts) {
176
+ return this.$TouchUI.datePicker.shortcuts(this)
177
+ } else {
178
+ return this.$TouchUI.datePicker.shortcuts
179
+ }
180
+ }
163
181
  }
164
182
  },
165
183
  data() {
@@ -186,8 +204,10 @@ export default {
186
204
  this.datedisplay = ''
187
205
  } else {
188
206
  // 检查数据是否和 valueFormat 相匹配,避免报错
207
+ if (this.isDate(val)) {
208
+ val = this.formatDate(val, this.valueFormat, '')
209
+ }
189
210
  let newValue = val.trim().substring(0, this.valueFormat.length)
190
-
191
211
  if (!matchFormat(newValue, this.valueFormat)) { return }
192
212
  if (this.type === 'time') {
193
213
  this.date = this.getDateFromValue(newValue, 'yyyy-MM-dd HH:mm:ss')
@@ -204,8 +224,7 @@ export default {
204
224
  iValue: {
205
225
  handler(val) {
206
226
  this.$emit('change', val)
207
- },
208
- immediate: true
227
+ }
209
228
  },
210
229
  displayFormat: {
211
230
  handler(fmt) {
@@ -228,6 +247,9 @@ export default {
228
247
  // this.$refs.layer.open()
229
248
  },
230
249
  methods: {
250
+ isDate(obj) {
251
+ return Object.prototype.toString.call(obj) === '[object Date]';
252
+ },
231
253
  handleLayerClose() {
232
254
  this.$refs.calendar.timeLayer = false
233
255
  this.$refs.calendar.monthLayer = false
@@ -435,13 +457,19 @@ export default {
435
457
  },
436
458
  focus() {
437
459
  this.$refs.inputBox.focus()
460
+ },
461
+ handleShortcut(item) {
462
+ if (item && item.value && typeof item.value === 'function') {
463
+ const date = item.value.call(this);
464
+ if (date === null) {
465
+ this.clear();
466
+ } else {
467
+ const formattedDate = this.formatDate(date, this.valueFormat, '');
468
+ this.date = this.getDateFromValue(formattedDate, this.valueFormat);
469
+ this.select(formattedDate);
470
+ }
471
+ }
438
472
  }
439
473
  }
440
474
  };
441
475
  </script>
442
-
443
- <style>
444
- .to-date-picker.to-dis>.to-icon-date {
445
- pointer-events: none;
446
- }
447
- </style>
@@ -301,7 +301,11 @@ export default {
301
301
  } else if (this.type === 'time') {
302
302
  this.$emit('change', `${this.hour}:${this.minute}:${this.second}`)
303
303
  } else {
304
- this.$emit('change', `${this.year}-${this.month}-${this.day}`)
304
+ if (this.day) {
305
+ this.$emit('change', `${this.year}-${this.month}-${this.day}`)
306
+ } else {
307
+ this.$emit('change', `${this.year}-${this.month}`)
308
+ }
305
309
  }
306
310
  },
307
311
  clear() {