ai.touchui-vue 1.33.1 → 1.33.3
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.
- package/lib/ai.touchui-vue.common.js +33 -40
- package/lib/index.js +1 -1
- package/lib/input.js +14 -27
- package/lib/tab.js +8 -2
- package/package.json +3 -2
- package/packages/input/src/input.vue +12 -25
- package/packages/tab/src/tab.vue +4 -1
- package/src/index.js +1 -1
package/lib/input.js
CHANGED
|
@@ -206,7 +206,7 @@ module.exports = require("ai.touchui-vue/lib/mixins/locale");
|
|
|
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=
|
|
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=7002140a
|
|
210
210
|
var render = function () {
|
|
211
211
|
var _vm = this
|
|
212
212
|
var _h = _vm.$createElement
|
|
@@ -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=
|
|
613
|
+
// CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=7002140a
|
|
614
614
|
|
|
615
615
|
// CONCATENATED MODULE: ./src/utils/string.js
|
|
616
616
|
function filter(chars, from) {
|
|
@@ -1060,7 +1060,7 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
|
|
|
1060
1060
|
if (this.inited) {
|
|
1061
1061
|
|
|
1062
1062
|
// 处理 IOS 下,to-input type=number 可以输入小数点
|
|
1063
|
-
if (this.type === 'number' && Number(this.dot) === 0 && !this.conversionType && String(this.data).indexOf('.') > -1) {
|
|
1063
|
+
if (this.type === 'number' && Number(this.dot) === 0 && !Number(this.conversionType) && String(this.data).indexOf('.') > -1) {
|
|
1064
1064
|
this.data = this.data.replace('.', '');
|
|
1065
1065
|
}
|
|
1066
1066
|
if (this.spChars) {
|
|
@@ -1137,7 +1137,7 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
|
|
|
1137
1137
|
}
|
|
1138
1138
|
},
|
|
1139
1139
|
inputKeyPress: function inputKeyPress(event) {
|
|
1140
|
-
if (this.type === 'number' && !this.conversionType) {
|
|
1140
|
+
if (this.type === 'number' && !Number(this.conversionType)) {
|
|
1141
1141
|
if ((event.keyCode !== 46 || Number(this.dot) === 0) && (event.keyCode !== 45 || Number(this.min) >= 0) && (event.keyCode < 48 || event.keyCode > 57)) {
|
|
1142
1142
|
event.returnValue = false;
|
|
1143
1143
|
}
|
|
@@ -1206,8 +1206,8 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
|
|
|
1206
1206
|
this.data = 'NaN';
|
|
1207
1207
|
}
|
|
1208
1208
|
|
|
1209
|
-
if (this.conversionType) {
|
|
1210
|
-
this.data = this.formatNumber(this.data, this.dot, this.conversionType);
|
|
1209
|
+
if (Number(this.conversionType)) {
|
|
1210
|
+
this.data = this.formatNumber(this.data, this.dot, Number(this.conversionType));
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
1213
1213
|
this.focused = false;
|
|
@@ -1249,7 +1249,7 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
|
|
|
1249
1249
|
var pre = this.data.substring(0, this.data.indexOf('.'));
|
|
1250
1250
|
var suf = this.data.substring(this.data.indexOf('.') + 1);
|
|
1251
1251
|
|
|
1252
|
-
if (!this.conversionType) {
|
|
1252
|
+
if (!Number(this.conversionType)) {
|
|
1253
1253
|
// 去掉小数点之后的所有小圆点并截取所需数量
|
|
1254
1254
|
suf = suf.replace(/[/.]/g, '').substring(0, Number(this.dot));
|
|
1255
1255
|
}
|
|
@@ -1311,25 +1311,6 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
|
|
|
1311
1311
|
// type 0:保持原状 1:向上取值 2:向下取值 3:四舍五入 4:保持原值无限输入小数
|
|
1312
1312
|
if (type < 0 || type > 3) throw new Error('Invalid type');
|
|
1313
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
1314
|
var factor = Math.pow(10, decimalPlaces);
|
|
1334
1315
|
var processedValue = value;
|
|
1335
1316
|
|
|
@@ -1344,9 +1325,15 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
|
|
|
1344
1325
|
break;
|
|
1345
1326
|
case 3:
|
|
1346
1327
|
// 四舍五入
|
|
1347
|
-
processedValue = Math.round(value * factor) / factor;
|
|
1328
|
+
processedValue = Math.round(Number((value * factor).toFixed(1))) / factor;
|
|
1329
|
+
// processedValue = this.preciseMultiply(value, factor);
|
|
1348
1330
|
break;
|
|
1349
1331
|
}
|
|
1332
|
+
// console.log(value, 'value')
|
|
1333
|
+
// console.log(factor, 'factor')
|
|
1334
|
+
// console.log('processedValue', processedValue)
|
|
1335
|
+
// console.log('value * factor * 10', value * factor * 10)
|
|
1336
|
+
// console.log('Math.round(value * factor * 10)', Math.round(value * factor * 10))
|
|
1350
1337
|
return processedValue.toFixed(decimalPlaces);
|
|
1351
1338
|
}
|
|
1352
1339
|
}
|
package/lib/tab.js
CHANGED
|
@@ -199,7 +199,7 @@ function normalizeComponent(
|
|
|
199
199
|
// ESM COMPAT FLAG
|
|
200
200
|
__webpack_require__.r(__webpack_exports__);
|
|
201
201
|
|
|
202
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tab/src/tab.vue?vue&type=template&id=
|
|
202
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tab/src/tab.vue?vue&type=template&id=46748484
|
|
203
203
|
var render = function () {
|
|
204
204
|
var _vm = this
|
|
205
205
|
var _h = _vm.$createElement
|
|
@@ -259,6 +259,9 @@ var render = function () {
|
|
|
259
259
|
mouseover: function ($event) {
|
|
260
260
|
return _vm.changeTab(item, index, "mouseover")
|
|
261
261
|
},
|
|
262
|
+
contextmenu: function (e) {
|
|
263
|
+
return _vm.contextmenuHandle(e, item, index)
|
|
264
|
+
},
|
|
262
265
|
},
|
|
263
266
|
},
|
|
264
267
|
[
|
|
@@ -584,7 +587,7 @@ var staticRenderFns = []
|
|
|
584
587
|
render._withStripped = true
|
|
585
588
|
|
|
586
589
|
|
|
587
|
-
// CONCATENATED MODULE: ./packages/tab/src/tab.vue?vue&type=template&id=
|
|
590
|
+
// CONCATENATED MODULE: ./packages/tab/src/tab.vue?vue&type=template&id=46748484
|
|
588
591
|
|
|
589
592
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tab/src/tab.vue?vue&type=script&lang=js
|
|
590
593
|
//
|
|
@@ -1222,6 +1225,9 @@ render._withStripped = true
|
|
|
1222
1225
|
this.showPage = false;
|
|
1223
1226
|
this.$emit('change', '');
|
|
1224
1227
|
}
|
|
1228
|
+
},
|
|
1229
|
+
contextmenuHandle: function contextmenuHandle(event, item, index) {
|
|
1230
|
+
this.$emit('tab-contextmenu', event, item, index);
|
|
1225
1231
|
}
|
|
1226
1232
|
}
|
|
1227
1233
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai.touchui-vue",
|
|
3
|
-
"version": "1.33.
|
|
3
|
+
"version": "1.33.3",
|
|
4
4
|
"description": "TouchUI Component Library for Vue.js.",
|
|
5
5
|
"main": "lib/ai.touchui-vue.common.js",
|
|
6
6
|
"files": [
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"@typescript-eslint/eslint-plugin": "5.8.0",
|
|
61
61
|
"@vue/component-compiler-utils": "2.6.0",
|
|
62
62
|
"ai.touchui-chat": "^1.9.0",
|
|
63
|
-
"ai.touchui-
|
|
63
|
+
"ai.touchui-desk": "0.0.43",
|
|
64
|
+
"ai.touchui-plugin": "^1.0.60",
|
|
64
65
|
"algoliasearch": "3.35.1",
|
|
65
66
|
"archiver": "5.3.1",
|
|
66
67
|
"babel-cli": "6.26.0",
|
|
@@ -421,7 +421,7 @@ export default {
|
|
|
421
421
|
if (
|
|
422
422
|
this.type === 'number' &&
|
|
423
423
|
Number(this.dot) === 0 &&
|
|
424
|
-
!this.conversionType &&
|
|
424
|
+
!Number(this.conversionType) &&
|
|
425
425
|
String(this.data).indexOf('.') > -1
|
|
426
426
|
) {
|
|
427
427
|
this.data = this.data.replace('.', '')
|
|
@@ -497,7 +497,7 @@ export default {
|
|
|
497
497
|
}
|
|
498
498
|
},
|
|
499
499
|
inputKeyPress(event) {
|
|
500
|
-
if (this.type === 'number' && !this.conversionType) {
|
|
500
|
+
if (this.type === 'number' && !Number(this.conversionType)) {
|
|
501
501
|
if (
|
|
502
502
|
(event.keyCode !== 46 || Number(this.dot) === 0) &&
|
|
503
503
|
(event.keyCode !== 45 || Number(this.min) >= 0) &&
|
|
@@ -568,8 +568,8 @@ export default {
|
|
|
568
568
|
this.data = 'NaN';
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
-
if (this.conversionType) {
|
|
572
|
-
this.data = this.formatNumber(this.data, this.dot, this.conversionType)
|
|
571
|
+
if (Number(this.conversionType)) {
|
|
572
|
+
this.data = this.formatNumber(this.data, this.dot, Number(this.conversionType))
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
this.focused = false;
|
|
@@ -611,7 +611,7 @@ export default {
|
|
|
611
611
|
let pre = this.data.substring(0, this.data.indexOf('.'));
|
|
612
612
|
let suf = this.data.substring(this.data.indexOf('.') + 1);
|
|
613
613
|
|
|
614
|
-
if (!this.conversionType) {
|
|
614
|
+
if (!Number(this.conversionType)) {
|
|
615
615
|
// 去掉小数点之后的所有小圆点并截取所需数量
|
|
616
616
|
suf = suf.replace(/[/.]/g, '').substring(0, Number(this.dot));
|
|
617
617
|
}
|
|
@@ -671,25 +671,6 @@ export default {
|
|
|
671
671
|
// type 0:保持原状 1:向上取值 2:向下取值 3:四舍五入 4:保持原值无限输入小数
|
|
672
672
|
if (type < 0 || type > 3) throw new Error('Invalid type');
|
|
673
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
674
|
const factor = Math.pow(10, decimalPlaces);
|
|
694
675
|
let processedValue = value;
|
|
695
676
|
|
|
@@ -701,9 +682,15 @@ export default {
|
|
|
701
682
|
processedValue = Math.floor(value * factor) / factor;
|
|
702
683
|
break;
|
|
703
684
|
case 3: // 四舍五入
|
|
704
|
-
processedValue = Math.round(value * factor) / factor;
|
|
685
|
+
processedValue = Math.round(Number((value * factor).toFixed(1))) / factor;
|
|
686
|
+
// processedValue = this.preciseMultiply(value, factor);
|
|
705
687
|
break;
|
|
706
688
|
}
|
|
689
|
+
// console.log(value, 'value')
|
|
690
|
+
// console.log(factor, 'factor')
|
|
691
|
+
// console.log('processedValue', processedValue)
|
|
692
|
+
// console.log('value * factor * 10', value * factor * 10)
|
|
693
|
+
// console.log('Math.round(value * factor * 10)', Math.round(value * factor * 10))
|
|
707
694
|
return processedValue.toFixed(decimalPlaces);
|
|
708
695
|
}
|
|
709
696
|
}
|
package/packages/tab/src/tab.vue
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<li v-if="$slots.center && Math.floor(itabs.length / 2) === index" :key="index" class="center">
|
|
11
11
|
<slot name="center"></slot>
|
|
12
12
|
</li>
|
|
13
|
-
<li v-else :key="index" :style="setTabStyle(item)" :class="{ on: item.value === iValue, deletable, disabled: item.disabled}" @click="changeTab(item, index, 'click')" @mouseover="changeTab(item, index, 'mouseover')">
|
|
13
|
+
<li v-else :key="index" :style="setTabStyle(item)" :class="{ on: item.value === iValue, deletable, disabled: item.disabled}" @click="changeTab(item, index, 'click')" @mouseover="changeTab(item, index, 'mouseover')" @contextmenu="e => contextmenuHandle(e, item, index)">
|
|
14
14
|
<div class="content">
|
|
15
15
|
<slot name="item" :item="item">
|
|
16
16
|
<div v-if="item.pic" class="pic">
|
|
@@ -588,6 +588,9 @@ export default {
|
|
|
588
588
|
this.showPage = false
|
|
589
589
|
this.$emit('change', '');
|
|
590
590
|
}
|
|
591
|
+
},
|
|
592
|
+
contextmenuHandle(event, item, index) {
|
|
593
|
+
this.$emit('tab-contextmenu', event, item, index)
|
|
591
594
|
}
|
|
592
595
|
}
|
|
593
596
|
};
|