ai.touchui-vue 1.32.2 → 1.33.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 (83) hide show
  1. package/lib/affix.js +2 -2
  2. package/lib/ai.touchui-vue.common.js +986 -873
  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 +2 -2
  67. package/lib/table.js +10 -10
  68. package/lib/tag.js +2 -2
  69. package/lib/theme/css/theme/logistics.css +1 -0
  70. package/lib/timeline.js +2 -2
  71. package/lib/tip.js +2 -2
  72. package/lib/tooltip.js +2 -2
  73. package/lib/transfer.js +2 -2
  74. package/lib/tree.js +2 -2
  75. package/lib/upload.js +14 -14
  76. package/package.json +1 -1
  77. package/packages/input/src/input.vue +65 -7
  78. package/packages/param/src/param.vue +6 -2
  79. package/packages/range/src/range.vue +17 -14
  80. package/packages/table/src/table-head.vue +1 -1
  81. package/packages/theme/lib/css/theme/logistics.css +1 -0
  82. package/packages/theme/src/less/theme/logistics.less +160 -0
  83. package/src/index.js +1 -1
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 = 379);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 376:
195
+ /***/ 379:
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 = 384);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 381:
195
+ /***/ 384:
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 = 385);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 382:
195
+ /***/ 385:
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 = 364);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 361:
195
+ /***/ 364:
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 = 350);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 347:
195
+ /***/ 350:
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 = 363);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -199,6 +199,13 @@ module.exports = require("ai.touchui-vue/lib/utils/dom");
199
199
 
200
200
  /***/ }),
201
201
 
202
+ /***/ 11:
203
+ /***/ (function(module, exports) {
204
+
205
+ module.exports = require("ai.touchui-vue/lib/utils/sign");
206
+
207
+ /***/ }),
208
+
202
209
  /***/ 14:
203
210
  /***/ (function(module, exports) {
204
211
 
@@ -413,7 +420,7 @@ render._withStripped = true
413
420
  var dom_ = __webpack_require__(1);
414
421
 
415
422
  // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/util"
416
- var util_ = __webpack_require__(7);
423
+ var util_ = __webpack_require__(9);
417
424
 
418
425
  // EXTERNAL MODULE: external "ai.touchui-vue/lib/mixins/locale"
419
426
  var locale_ = __webpack_require__(2);
@@ -818,7 +825,7 @@ module.exports = require("ai.touchui-vue/lib/locale");
818
825
 
819
826
  /***/ }),
820
827
 
821
- /***/ 360:
828
+ /***/ 363:
822
829
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
823
830
 
824
831
  "use strict";
@@ -1589,10 +1596,10 @@ var filetransfer_default = /*#__PURE__*/__webpack_require__.n(filetransfer_);
1589
1596
  var types_ = __webpack_require__(14);
1590
1597
 
1591
1598
  // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/md5"
1592
- var md5_ = __webpack_require__(88);
1599
+ var md5_ = __webpack_require__(89);
1593
1600
 
1594
1601
  // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/sign"
1595
- var sign_ = __webpack_require__(9);
1602
+ var sign_ = __webpack_require__(11);
1596
1603
 
1597
1604
  // EXTERNAL MODULE: ./packages/pic/src/pic-viewer.vue + 4 modules
1598
1605
  var pic_viewer = __webpack_require__(16);
@@ -2554,14 +2561,7 @@ module.exports = require("ai.touchui-vue/lib/utils/filetransfer");
2554
2561
 
2555
2562
  /***/ }),
2556
2563
 
2557
- /***/ 7:
2558
- /***/ (function(module, exports) {
2559
-
2560
- module.exports = require("ai.touchui-vue/lib/utils/util");
2561
-
2562
- /***/ }),
2563
-
2564
- /***/ 88:
2564
+ /***/ 89:
2565
2565
  /***/ (function(module, exports) {
2566
2566
 
2567
2567
  module.exports = require("ai.touchui-vue/lib/utils/md5");
@@ -2571,7 +2571,7 @@ module.exports = require("ai.touchui-vue/lib/utils/md5");
2571
2571
  /***/ 9:
2572
2572
  /***/ (function(module, exports) {
2573
2573
 
2574
- module.exports = require("ai.touchui-vue/lib/utils/sign");
2574
+ module.exports = require("ai.touchui-vue/lib/utils/util");
2575
2575
 
2576
2576
  /***/ })
2577
2577
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai.touchui-vue",
3
- "version": "1.32.2",
3
+ "version": "1.33.1",
4
4
  "description": "TouchUI Component Library for Vue.js.",
5
5
  "main": "lib/ai.touchui-vue.common.js",
6
6
  "files": [
@@ -48,7 +48,7 @@
48
48
  @change="inputChange"
49
49
  />
50
50
  <span v-if="clearable || suggestion || $slots.default || $slots.suffix || suffix || step" class="to-inputSuffix">
51
- <to-icon v-if="clearable" v-show="clearVisible" class="to-inputClear" color="default" :mode="iconMode" link value="close" @click.stop="clear()"></to-icon>
51
+ <to-icon v-if="!readonly && clearable" v-show="clearVisible" class="to-inputClear" color="default" :mode="iconMode" link value="close" @click.stop="clear()"></to-icon>
52
52
  <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>
53
53
  <span v-if="suffix" class="to-inputText">{{ suffix }}</span>
54
54
  <slot name="suffix"></slot>
@@ -248,6 +248,10 @@ export default {
248
248
  focusWhenClear: { // filterable模式下清空数据是否弹出下拉框
249
249
  type: Boolean,
250
250
  default: true
251
+ },
252
+ conversionType: {
253
+ type: [String, Number],
254
+ default: 0 // 0:保持原状 1:向上取值 2:向下取值 3:四舍五入
251
255
  }
252
256
  },
253
257
  data() {
@@ -414,7 +418,12 @@ export default {
414
418
  if (this.inited) {
415
419
 
416
420
  // 处理 IOS 下,to-input type=number 可以输入小数点
417
- if (this.type === 'number' && Number(this.dot) === 0 && String(this.data).indexOf('.') > -1) {
421
+ if (
422
+ this.type === 'number' &&
423
+ Number(this.dot) === 0 &&
424
+ !this.conversionType &&
425
+ String(this.data).indexOf('.') > -1
426
+ ) {
418
427
  this.data = this.data.replace('.', '')
419
428
  }
420
429
  if (this.spChars) {
@@ -488,8 +497,12 @@ export default {
488
497
  }
489
498
  },
490
499
  inputKeyPress(event) {
491
- if (this.type === 'number') {
492
- if ((event.keyCode !== 46 || Number(this.dot) === 0) && (event.keyCode !== 45 || Number(this.min) >= 0) && (event.keyCode < 48 || event.keyCode > 57)) {
500
+ if (this.type === 'number' && !this.conversionType) {
501
+ if (
502
+ (event.keyCode !== 46 || Number(this.dot) === 0) &&
503
+ (event.keyCode !== 45 || Number(this.min) >= 0) &&
504
+ (event.keyCode < 48 || event.keyCode > 57)
505
+ ) {
493
506
  event.returnValue = false;
494
507
  }
495
508
  }
@@ -552,7 +565,11 @@ export default {
552
565
 
553
566
  // 最小值判断
554
567
  if (Number(this.data, 0) < Number(this.min)) {
555
- this.data = Number(this.min) + '';
568
+ this.data = 'NaN';
569
+ }
570
+
571
+ if (this.conversionType) {
572
+ this.data = this.formatNumber(this.data, this.dot, this.conversionType)
556
573
  }
557
574
  }
558
575
  this.focused = false;
@@ -594,8 +611,10 @@ export default {
594
611
  let pre = this.data.substring(0, this.data.indexOf('.'));
595
612
  let suf = this.data.substring(this.data.indexOf('.') + 1);
596
613
 
597
- // 去掉小数点之后的所有小圆点并截取所需数量
598
- suf = suf.replace(/[/.]/g, '').substring(0, Number(this.dot));
614
+ if (!this.conversionType) {
615
+ // 去掉小数点之后的所有小圆点并截取所需数量
616
+ suf = suf.replace(/[/.]/g, '').substring(0, Number(this.dot));
617
+ }
599
618
 
600
619
  // 拼接字符串
601
620
  this.data = `${pre}.${suf}`;
@@ -647,6 +666,45 @@ export default {
647
666
  restore() {
648
667
  this.data = this.valueStore[0]
649
668
  this.valueStore.splice(0, 1)
669
+ },
670
+ formatNumber(value, decimalPlaces, type) {
671
+ // type 0:保持原状 1:向上取值 2:向下取值 3:四舍五入 4:保持原值无限输入小数
672
+ if (type < 0 || type > 3) throw new Error('Invalid type');
673
+
674
+ // if (type === 0) {
675
+ // // 处理科学计数法并转换为字符串
676
+ // let strValue = value.toLocaleString('fullwide', { useGrouping: false });
677
+ // // 处理特殊情况,例如数值本身是整数
678
+ // if (strValue.indexOf('.') === -1) strValue += '.';
679
+
680
+ // const [intPart, decimalPart = ''] = strValue.split('.');
681
+ // let formattedDecimal = decimalPart;
682
+
683
+ // // 补零到指定的小数位数
684
+ // if (decimalPart.length < decimalPlaces) {
685
+ // formattedDecimal = decimalPart.padEnd(decimalPlaces, '0');
686
+ // }
687
+
688
+ // return decimalPlaces === 0
689
+ // ? intPart
690
+ // : `${intPart}.${formattedDecimal}`;
691
+ // }
692
+
693
+ const factor = Math.pow(10, decimalPlaces);
694
+ let processedValue = value;
695
+
696
+ switch (Number(type)) {
697
+ case 1: // 向上取值
698
+ processedValue = Math.ceil(value * factor) / factor;
699
+ break;
700
+ case 2: // 向下取值
701
+ processedValue = Math.floor(value * factor) / factor;
702
+ break;
703
+ case 3: // 四舍五入
704
+ processedValue = Math.round(value * factor) / factor;
705
+ break;
706
+ }
707
+ return processedValue.toFixed(decimalPlaces);
650
708
  }
651
709
  }
652
710
  };
@@ -4,7 +4,7 @@
4
4
  <slot></slot>
5
5
  <li v-for="(item, index) in rowData" :key="index" :style="setLiStyle" :class="[item.merge ? 'merge-' + item.merge : '']">
6
6
  <span class="label" :style="{ width: width === 'compute' ? width : ''}"><span>{{ item.label }}</span></span>
7
- <span class="value">{{ item.value }}</span>
7
+ <span v-tip="tip ? item.value : ''" class="value">{{ item.value }}</span>
8
8
  </li>
9
9
  </ul>
10
10
  </div>
@@ -92,7 +92,11 @@ export default {
92
92
  },
93
93
  // 是否平均分布
94
94
  avg: Boolean,
95
- wrap: Boolean
95
+ wrap: Boolean,
96
+ tip: {
97
+ type: Boolean,
98
+ default: false
99
+ }
96
100
  },
97
101
  data() {
98
102
  return {
@@ -107,7 +107,7 @@ export default {
107
107
  },
108
108
  set: function(newVal) {
109
109
  this.progress = newVal
110
- this.x = this.length * this.progress / this.range
110
+ this.x = this.length.offsetWidth * this.progress / this.range
111
111
  }
112
112
  },
113
113
  startVal: {
@@ -116,7 +116,7 @@ export default {
116
116
  },
117
117
  set: function(newVal) {
118
118
  this.sProgress = newVal
119
- this.sx = this.length * this.sProgress / this.range
119
+ this.sx = this.length.offsetWidth * this.sProgress / this.range
120
120
  }
121
121
  },
122
122
  refVal: {
@@ -259,7 +259,7 @@ export default {
259
259
  mounted() {
260
260
  // 这里注意range的value改变不会触发视图刷新
261
261
  this.$nextTick(()=>{
262
- this.length = this.$el.querySelector('.to-rangeBar').offsetWidth
262
+ this.length = this.$el.querySelector('.to-rangeBar')
263
263
  this.initRangeVal()
264
264
  })
265
265
  },
@@ -287,12 +287,12 @@ export default {
287
287
  let leftX = e.offsetX
288
288
  this.x = e.clientX - leftX
289
289
  if (this.start) {
290
- let startLeft = this.startProgress / this.range * this.length
291
- let endLeft = this.rangeProgress / this.range * this.length
290
+ let startLeft = this.startProgress / this.range * this.length.offsetWidth
291
+ let endLeft = this.rangeProgress / this.range * this.length.offsetWidth
292
292
  let startLeftAbs = Math.abs(startLeft - leftX)
293
293
  let endLeftAbs = Math.abs(endLeft - leftX)
294
294
  if (startLeftAbs >= endLeftAbs) {
295
- this.progress = leftX / this.length * this.range
295
+ this.progress = leftX / this.length.offsetWidth * this.range
296
296
  this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress
297
297
  if (this.progress <= 0) {
298
298
  this.progress = 0
@@ -307,7 +307,7 @@ export default {
307
307
  }
308
308
  this.rangeProgress = progress
309
309
  } else {
310
- this.sProgress = leftX / this.length * this.range
310
+ this.sProgress = leftX / this.length.offsetWidth * this.range
311
311
  this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress
312
312
  if (this.sProgress <= 0) {
313
313
  this.sProgress = 0
@@ -323,7 +323,7 @@ export default {
323
323
  this.startProgress = progress
324
324
  }
325
325
  } else {
326
- this.progress = leftX / this.length * this.range
326
+ this.progress = leftX / this.length.offsetWidth * this.range
327
327
  this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress
328
328
  if (this.progress <= 0) {
329
329
  this.progress = 0
@@ -351,7 +351,7 @@ export default {
351
351
  if (this.isStart) {
352
352
  this.moveX = e.touches[0].clientX
353
353
  if (this.isStartMove === 'end') {
354
- this.progress = (this.x + this.moveX - this.endStartX) / this.length * this.range
354
+ this.progress = (this.x + this.moveX - this.endStartX) / this.length.offsetWidth * this.range
355
355
  if (this.progress <= 0) {
356
356
  this.progress = 0
357
357
  } else if (this.progress >= this.range) {
@@ -365,7 +365,7 @@ export default {
365
365
  }
366
366
  this.rangeProgress = progress
367
367
  } else if (this.isStartMove === 'start') {
368
- this.sProgress = (this.sx + this.moveX - this.startX) / this.length * this.range
368
+ this.sProgress = (this.sx + this.moveX - this.startX) / this.length.offsetWidth * this.range
369
369
  if (this.sProgress <= 0) {
370
370
  this.sProgress = 0
371
371
  } else if (this.sProgress >= this.range) {
@@ -389,14 +389,14 @@ export default {
389
389
  if (this.progress <= 0) {
390
390
  this.x = 0
391
391
  } else if (this.progress >= this.range) {
392
- this.x = this.length
392
+ this.x = this.length.offsetWidth
393
393
  }
394
394
  } else if (this.isStartMove === 'start') {
395
395
  this.sx += this.moveX - this.endStartX
396
396
  if (this.sProgress <= 0) {
397
397
  this.sx = 0
398
398
  } else if (this.sProgress >= this.range) {
399
- this.sx = this.length
399
+ this.sx = this.length.offsetWidth
400
400
  }
401
401
  }
402
402
  this.isStart = false
@@ -507,7 +507,7 @@ export default {
507
507
  }
508
508
  var currentX = event.clientX;
509
509
  if (this.isStartMove === 'end') {
510
- let diff = (currentX - this.startMoveX) / this.length * this.range
510
+ let diff = (currentX - this.startMoveX) / this.length.offsetWidth * this.range
511
511
  this.progress = this.startPosition + diff;
512
512
  if (this.progress <= 0) {
513
513
  this.progress = 0
@@ -525,7 +525,7 @@ export default {
525
525
  }
526
526
  this.rangeProgress = progress
527
527
  } else if (this.isStartMove === 'start') {
528
- let diff = (currentX - this.sStartMoveX) / this.length * this.range
528
+ let diff = (currentX - this.sStartMoveX) / this.length.offsetWidth * this.range
529
529
  this.sProgress = this.sStartPosition + diff;
530
530
  if (this.sProgress <= 0) {
531
531
  this.sProgress = 0
@@ -610,3 +610,6 @@ export default {
610
610
  }
611
611
  }
612
612
  </script>
613
+ <style>
614
+ //.to-rangeProgress{ transition: width 0.01s ease; }
615
+ </style>
@@ -39,7 +39,7 @@
39
39
  <to-icon v-if="item.orderType == 'asc'" value="fold"></to-icon>
40
40
  <to-icon v-if="item.orderType == 'desc'" value="unfold"></to-icon>
41
41
  </template>
42
- <span>{{ ToTable.indexColumnName || item.label }}111</span>
42
+ <span>{{ ToTable.indexColumnName || item.label }}</span>
43
43
  </th>
44
44
  <th
45
45
  v-else-if="item.type === 'action' && configurable && ToTable.hasAction"