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
package/lib/input.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 = 349);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 352);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -199,14 +199,14 @@ module.exports = require("ai.touchui-vue/lib/mixins/locale");
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 349:
202
+ /***/ 352:
203
203
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
204
204
 
205
205
  "use strict";
206
206
  // ESM COMPAT FLAG
207
207
  __webpack_require__.r(__webpack_exports__);
208
208
 
209
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=7b2ef5ad
209
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=4a775748
210
210
  var render = function () {
211
211
  var _vm = this
212
212
  var _h = _vm.$createElement
@@ -476,7 +476,7 @@ var render = function () {
476
476
  "span",
477
477
  { staticClass: "to-inputSuffix" },
478
478
  [
479
- _vm.clearable
479
+ !_vm.readonly && _vm.clearable
480
480
  ? _c("to-icon", {
481
481
  directives: [
482
482
  {
@@ -610,7 +610,7 @@ var staticRenderFns = []
610
610
  render._withStripped = true
611
611
 
612
612
 
613
- // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=7b2ef5ad
613
+ // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=4a775748
614
614
 
615
615
  // CONCATENATED MODULE: ./src/utils/string.js
616
616
  function filter(chars, from) {
@@ -889,6 +889,10 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
889
889
  focusWhenClear: { // filterable模式下清空数据是否弹出下拉框
890
890
  type: Boolean,
891
891
  default: true
892
+ },
893
+ conversionType: {
894
+ type: [String, Number],
895
+ default: 0 // 0:保持原状 1:向上取值 2:向下取值 3:四舍五入
892
896
  }
893
897
  },
894
898
  data: function data() {
@@ -1056,7 +1060,7 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
1056
1060
  if (this.inited) {
1057
1061
 
1058
1062
  // 处理 IOS 下,to-input type=number 可以输入小数点
1059
- if (this.type === 'number' && Number(this.dot) === 0 && String(this.data).indexOf('.') > -1) {
1063
+ if (this.type === 'number' && Number(this.dot) === 0 && !this.conversionType && String(this.data).indexOf('.') > -1) {
1060
1064
  this.data = this.data.replace('.', '');
1061
1065
  }
1062
1066
  if (this.spChars) {
@@ -1133,7 +1137,7 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
1133
1137
  }
1134
1138
  },
1135
1139
  inputKeyPress: function inputKeyPress(event) {
1136
- if (this.type === 'number') {
1140
+ if (this.type === 'number' && !this.conversionType) {
1137
1141
  if ((event.keyCode !== 46 || Number(this.dot) === 0) && (event.keyCode !== 45 || Number(this.min) >= 0) && (event.keyCode < 48 || event.keyCode > 57)) {
1138
1142
  event.returnValue = false;
1139
1143
  }
@@ -1199,7 +1203,11 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
1199
1203
 
1200
1204
  // 最小值判断
1201
1205
  if (Number(this.data, 0) < Number(this.min)) {
1202
- this.data = Number(this.min) + '';
1206
+ this.data = 'NaN';
1207
+ }
1208
+
1209
+ if (this.conversionType) {
1210
+ this.data = this.formatNumber(this.data, this.dot, this.conversionType);
1203
1211
  }
1204
1212
  }
1205
1213
  this.focused = false;
@@ -1241,8 +1249,10 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
1241
1249
  var pre = this.data.substring(0, this.data.indexOf('.'));
1242
1250
  var suf = this.data.substring(this.data.indexOf('.') + 1);
1243
1251
 
1244
- // 去掉小数点之后的所有小圆点并截取所需数量
1245
- suf = suf.replace(/[/.]/g, '').substring(0, Number(this.dot));
1252
+ if (!this.conversionType) {
1253
+ // 去掉小数点之后的所有小圆点并截取所需数量
1254
+ suf = suf.replace(/[/.]/g, '').substring(0, Number(this.dot));
1255
+ }
1246
1256
 
1247
1257
  // 拼接字符串
1248
1258
  this.data = pre + '.' + suf;
@@ -1296,6 +1306,48 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
1296
1306
  restore: function restore() {
1297
1307
  this.data = this.valueStore[0];
1298
1308
  this.valueStore.splice(0, 1);
1309
+ },
1310
+ formatNumber: function formatNumber(value, decimalPlaces, type) {
1311
+ // type 0:保持原状 1:向上取值 2:向下取值 3:四舍五入 4:保持原值无限输入小数
1312
+ if (type < 0 || type > 3) throw new Error('Invalid type');
1313
+
1314
+ // if (type === 0) {
1315
+ // // 处理科学计数法并转换为字符串
1316
+ // let strValue = value.toLocaleString('fullwide', { useGrouping: false });
1317
+ // // 处理特殊情况,例如数值本身是整数
1318
+ // if (strValue.indexOf('.') === -1) strValue += '.';
1319
+
1320
+ // const [intPart, decimalPart = ''] = strValue.split('.');
1321
+ // let formattedDecimal = decimalPart;
1322
+
1323
+ // // 补零到指定的小数位数
1324
+ // if (decimalPart.length < decimalPlaces) {
1325
+ // formattedDecimal = decimalPart.padEnd(decimalPlaces, '0');
1326
+ // }
1327
+
1328
+ // return decimalPlaces === 0
1329
+ // ? intPart
1330
+ // : `${intPart}.${formattedDecimal}`;
1331
+ // }
1332
+
1333
+ var factor = Math.pow(10, decimalPlaces);
1334
+ var processedValue = value;
1335
+
1336
+ switch (Number(type)) {
1337
+ case 1:
1338
+ // 向上取值
1339
+ processedValue = Math.ceil(value * factor) / factor;
1340
+ break;
1341
+ case 2:
1342
+ // 向下取值
1343
+ processedValue = Math.floor(value * factor) / factor;
1344
+ break;
1345
+ case 3:
1346
+ // 四舍五入
1347
+ processedValue = Math.round(value * factor) / factor;
1348
+ break;
1349
+ }
1350
+ return processedValue.toFixed(decimalPlaces);
1299
1351
  }
1300
1352
  }
1301
1353
  });
package/lib/ip.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 = 357);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 360);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -199,7 +199,7 @@ module.exports = require("ai.touchui-vue/lib/locale");
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 357:
202
+ /***/ 360:
203
203
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
204
204
 
205
205
  "use strict";
package/lib/line.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 = 377);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 380);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 377:
195
+ /***/ 380:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/loading.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 = 399);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 402);
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
- /***/ 10:
202
+ /***/ 12:
203
203
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
204
204
 
205
205
  "use strict";
@@ -642,7 +642,14 @@ var component = Object(componentNormalizer["a" /* default */])(
642
642
 
643
643
  /***/ }),
644
644
 
645
- /***/ 399:
645
+ /***/ 4:
646
+ /***/ (function(module, exports) {
647
+
648
+ module.exports = require("vue");
649
+
650
+ /***/ }),
651
+
652
+ /***/ 402:
646
653
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
647
654
 
648
655
  "use strict";
@@ -654,7 +661,7 @@ var external_vue_ = __webpack_require__(4);
654
661
  var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
655
662
 
656
663
  // EXTERNAL MODULE: ./packages/msg/src/msg.vue + 4 modules
657
- var msg = __webpack_require__(10);
664
+ var msg = __webpack_require__(12);
658
665
 
659
666
  // EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/dom"
660
667
  var dom_ = __webpack_require__(1);
@@ -729,13 +736,6 @@ loadingDirective.install = function (Vue) {
729
736
  loading: src_loading
730
737
  });
731
738
 
732
- /***/ }),
733
-
734
- /***/ 4:
735
- /***/ (function(module, exports) {
736
-
737
- module.exports = require("vue");
738
-
739
739
  /***/ })
740
740
 
741
741
  /******/ });
package/lib/longtap.js CHANGED
@@ -82,12 +82,12 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 400);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 403);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 400:
90
+ /***/ 403:
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";