ai.touchui-vue 1.40.2 → 1.41.1

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 (128) hide show
  1. package/lib/affix.js +2 -2
  2. package/lib/ai.touchui-vue.common.js +921 -829
  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 +127 -481
  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 +10 -6
  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 +42 -13
  92. package/packages/date-picker/src/picker.vue +5 -1
  93. package/packages/input/src/input.vue +5 -2
  94. package/packages/theme/lib/css/theme/B-Design.css +1 -1
  95. package/packages/theme/lib/css/theme/aiplan.css +1 -1
  96. package/packages/theme/lib/css/theme/aiplangd.css +1 -1
  97. package/packages/theme/lib/css/theme/chbn.css +1 -1
  98. package/packages/theme/lib/css/theme/default.css +1 -1
  99. package/packages/theme/lib/css/theme/dt.css +1 -1
  100. package/packages/theme/lib/css/theme/ecloud.css +1 -1
  101. package/packages/theme/lib/css/theme/hongkong.css +1 -1
  102. package/packages/theme/lib/css/theme/logistics.css +1 -1
  103. package/packages/theme/lib/css/theme/narrow.css +1 -1
  104. package/packages/theme/lib/css/theme/sdpf.css +1 -1
  105. package/packages/theme/lib/css/theme/upc.css +1 -1
  106. package/packages/theme/lib/css/theme/website.css +1 -1
  107. package/packages/theme/lib/css/theme/workbench-gz.css +1 -1
  108. package/packages/theme/lib/css/theme/zj.css +1 -1
  109. package/packages/theme/src/less/component/calendar-dark.less +27 -1
  110. package/packages/theme/src/less/component/calendar.less +15 -11
  111. package/packages/theme/src/less/element/datePicker-dark.less +15 -0
  112. package/packages/theme/src/less/element/datePicker.less +17 -0
  113. package/packages/theme/src/less/theme/B-Design.less +2 -0
  114. package/packages/theme/src/less/theme/aiplan.less +2 -0
  115. package/packages/theme/src/less/theme/aiplangd.less +2 -0
  116. package/packages/theme/src/less/theme/chbn.less +2 -0
  117. package/packages/theme/src/less/theme/default.less +2 -0
  118. package/packages/theme/src/less/theme/dt.less +2 -0
  119. package/packages/theme/src/less/theme/ecloud.less +2 -0
  120. package/packages/theme/src/less/theme/hongkong.less +2 -0
  121. package/packages/theme/src/less/theme/logistics.less +2 -0
  122. package/packages/theme/src/less/theme/narrow.less +2 -0
  123. package/packages/theme/src/less/theme/sdpf.less +2 -0
  124. package/packages/theme/src/less/theme/upc.less +2 -0
  125. package/packages/theme/src/less/theme/website.less +2 -0
  126. package/packages/theme/src/less/theme/workbench-gz.less +2 -0
  127. package/packages/theme/src/less/theme/zj.less +2 -0
  128. 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.1",
4
4
  "description": "TouchUI Component Library for Vue.js.",
5
5
  "main": "lib/ai.touchui-vue.common.js",
6
6
  "files": [
@@ -1,11 +1,20 @@
1
1
  <template>
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">
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 && inputable && !disabled ? true : clearable && !inputable && !disabled ? 'always' : false" :width="width" :comparable="comparable" @focus="errorTip = ''; $emit('focus', datedisplay)" @click="handleClick" @clear="clear()" @input="handleDisplayChange" @blur="handleDisplayBlur">
3
+ <!-- {{ clearable && inputable && !disabled ? true : clearable && !inputable && !disabled ? 'always' : false }} -->
3
4
  <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
5
  <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">
6
+ <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
7
  <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>
8
+ <div class="wrapper">
9
+ <div v-if="shortcuts && shortcuts.length && type !== 'time'" class="shortcuts">
10
+ <ul>
11
+ <li v-for="(item, index) in shortcuts" :key="index" @click="handleShortcut(item)">
12
+ {{ item.label }}
13
+ </li>
14
+ </ul>
15
+ </div>
16
+ <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>
17
+ </div>
9
18
  </to-scroll>
10
19
  <picker v-else v-model="date" :time="time" :type="type" :min="min" :max="max" @cancel="$refs.layer.close()" @change="select" @clear="clear()"></picker>
11
20
  </to-float>
@@ -160,6 +169,16 @@ export default {
160
169
  clearable: {
161
170
  type: Boolean,
162
171
  default: true
172
+ },
173
+ shortcuts: {
174
+ type: [Array, Boolean],
175
+ default() {
176
+ if (this.$TouchUI.datePicker && this.$TouchUI.datePicker.shortcuts) {
177
+ return this.$TouchUI.datePicker.shortcuts(this)
178
+ } else {
179
+ return this.$TouchUI.datePicker.shortcuts
180
+ }
181
+ }
163
182
  }
164
183
  },
165
184
  data() {
@@ -186,8 +205,10 @@ export default {
186
205
  this.datedisplay = ''
187
206
  } else {
188
207
  // 检查数据是否和 valueFormat 相匹配,避免报错
208
+ if (this.isDate(val)) {
209
+ val = this.formatDate(val, this.valueFormat, '')
210
+ }
189
211
  let newValue = val.trim().substring(0, this.valueFormat.length)
190
-
191
212
  if (!matchFormat(newValue, this.valueFormat)) { return }
192
213
  if (this.type === 'time') {
193
214
  this.date = this.getDateFromValue(newValue, 'yyyy-MM-dd HH:mm:ss')
@@ -204,8 +225,7 @@ export default {
204
225
  iValue: {
205
226
  handler(val) {
206
227
  this.$emit('change', val)
207
- },
208
- immediate: true
228
+ }
209
229
  },
210
230
  displayFormat: {
211
231
  handler(fmt) {
@@ -228,6 +248,9 @@ export default {
228
248
  // this.$refs.layer.open()
229
249
  },
230
250
  methods: {
251
+ isDate(obj) {
252
+ return Object.prototype.toString.call(obj) === '[object Date]';
253
+ },
231
254
  handleLayerClose() {
232
255
  this.$refs.calendar.timeLayer = false
233
256
  this.$refs.calendar.monthLayer = false
@@ -435,13 +458,19 @@ export default {
435
458
  },
436
459
  focus() {
437
460
  this.$refs.inputBox.focus()
461
+ },
462
+ handleShortcut(item) {
463
+ if (item && item.value && typeof item.value === 'function') {
464
+ const date = item.value.call(this);
465
+ if (date === null) {
466
+ this.clear();
467
+ } else {
468
+ const formattedDate = this.formatDate(date, this.valueFormat, '');
469
+ this.date = this.getDateFromValue(formattedDate, this.valueFormat);
470
+ this.select(formattedDate);
471
+ }
472
+ }
438
473
  }
439
474
  }
440
475
  };
441
476
  </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() {
@@ -58,7 +58,7 @@
58
58
  @change="inputChange"
59
59
  />
60
60
  <span v-if="clearable || suggestion || $slots.default || $slots.suffix || suffix || step" class="to-inputSuffix">
61
- <to-icon v-if="!readonly && clearable" v-show="clearVisible" class="to-inputClear" color="default" :mode="iconMode" link value="close" @click.stop="clear()"></to-icon>
61
+ <to-icon v-if="(clearable === true && !readonly) || (clearable === 'always' && readonly)" v-show="clearVisible" class="to-inputClear" color="default" :mode="iconMode" link value="close" @click.stop="clear()"></to-icon>
62
62
  <to-icon v-if="step" v-dis="Number(data) === Number(max) || readonly" :value="stepIconMode ? 'fold' : 'add'" link color="primary" mode="none" @mousedown.native="increase"></to-icon>
63
63
  <span v-if="suffix" class="to-inputText">{{ suffix }}</span>
64
64
  <slot name="suffix"></slot>
@@ -205,7 +205,10 @@ export default {
205
205
  },
206
206
 
207
207
  // 基本功能-----------
208
- clearable: Boolean,
208
+ clearable: {
209
+ type: [Boolean, String],
210
+ default: true
211
+ },
209
212
  preventFocus: Boolean,
210
213
  comparable: Boolean,
211
214
  value: {