3h1-ui 3.0.0-next.250 → 3.0.0-next.252
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/es/index.js
CHANGED
|
@@ -27845,6 +27845,11 @@ function useRowSelection(propsRef, tableData, emit) {
|
|
|
27845
27845
|
setSelectedRows
|
|
27846
27846
|
};
|
|
27847
27847
|
}
|
|
27848
|
+
function formatNumberWithThousandSeparator$1(val) {
|
|
27849
|
+
const [intPart, decimalPart] = String(val).split(".");
|
|
27850
|
+
const formattedInt = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
27851
|
+
return decimalPart !== void 0 ? `${formattedInt}.${decimalPart}` : formattedInt;
|
|
27852
|
+
}
|
|
27848
27853
|
function useDataSource(propsRef, {
|
|
27849
27854
|
getPaginationInfo,
|
|
27850
27855
|
setPagination,
|
|
@@ -27871,9 +27876,9 @@ function useDataSource(propsRef, {
|
|
|
27871
27876
|
const total = dataSourceRef.value.reduce((acc, cur) => {
|
|
27872
27877
|
return +acc + (+cur[field] || 0);
|
|
27873
27878
|
}, 0);
|
|
27874
|
-
obj[field] =
|
|
27875
|
-
|
|
27876
|
-
|
|
27879
|
+
obj[field] = formatNumberWithThousandSeparator$1(
|
|
27880
|
+
total.toFixed(unref(propsRef).summaryPrecision)
|
|
27881
|
+
);
|
|
27877
27882
|
});
|
|
27878
27883
|
return obj;
|
|
27879
27884
|
});
|
|
@@ -30134,6 +30139,11 @@ const ShyTag = /* @__PURE__ */ defineComponent({
|
|
|
30134
30139
|
return () => unref(renderTag);
|
|
30135
30140
|
}
|
|
30136
30141
|
});
|
|
30142
|
+
function formatNumberWithThousandSeparator(val) {
|
|
30143
|
+
const [intPart, decimalPart] = String(val).split(".");
|
|
30144
|
+
const formattedInt = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
30145
|
+
return decimalPart !== void 0 ? `${formattedInt}.${decimalPart}` : formattedInt;
|
|
30146
|
+
}
|
|
30137
30147
|
const handleItem = (item, ellipsis) => {
|
|
30138
30148
|
const {
|
|
30139
30149
|
key: key2,
|
|
@@ -30319,9 +30329,7 @@ const useColumns$1 = (propsRef, getPaginationRef, tableAction2, wrapRef) => {
|
|
|
30319
30329
|
var _a2, _b, _c;
|
|
30320
30330
|
const isSummaryCol = (_b = (_a2 = unref(propsRef).summaryTotalFields) == null ? void 0 : _a2.includes) == null ? void 0 : _b.call(_a2, column2.dataIndex);
|
|
30321
30331
|
const summaryFormat = (text) => {
|
|
30322
|
-
return text || isNumber$3(text) ? isNumber$3(+text) && !isNaN(+text) ? (+text).toFixed(unref(propsRef).summaryPrecision)
|
|
30323
|
-
return match + (string3.charAt(offset2 + 1) === "." || offset2 === string3.length - 1 ? "" : ",");
|
|
30324
|
-
}) : text : text;
|
|
30332
|
+
return text || isNumber$3(text) ? isNumber$3(+text) && !isNaN(+text) ? formatNumberWithThousandSeparator((+text).toFixed(unref(propsRef).summaryPrecision)) : text : text;
|
|
30325
30333
|
};
|
|
30326
30334
|
const {
|
|
30327
30335
|
slots,
|
|
@@ -32051,6 +32059,10 @@ const shyFormTableProps = reactive({
|
|
|
32051
32059
|
};
|
|
32052
32060
|
}
|
|
32053
32061
|
},
|
|
32062
|
+
useDefaultAdd: {
|
|
32063
|
+
type: Boolean,
|
|
32064
|
+
default: () => true
|
|
32065
|
+
},
|
|
32054
32066
|
dynamicShowRemove: {
|
|
32055
32067
|
type: Function,
|
|
32056
32068
|
default: () => (record) => true
|
|
@@ -32310,15 +32322,17 @@ const ShyFormTable = /* @__PURE__ */ defineComponent({
|
|
|
32310
32322
|
}, {});
|
|
32311
32323
|
});
|
|
32312
32324
|
const create = () => {
|
|
32313
|
-
|
|
32314
|
-
|
|
32315
|
-
|
|
32316
|
-
|
|
32317
|
-
|
|
32318
|
-
|
|
32319
|
-
|
|
32320
|
-
|
|
32321
|
-
|
|
32325
|
+
if (props2.useDefaultAdd) {
|
|
32326
|
+
state.value = [...toRaw(state.value), {
|
|
32327
|
+
[props2.rowKey]: buildUUID(),
|
|
32328
|
+
...unref(defaultValuesRef)
|
|
32329
|
+
}];
|
|
32330
|
+
curIndex.value = 0;
|
|
32331
|
+
if (props2.isVirtual) {
|
|
32332
|
+
nextTick(() => {
|
|
32333
|
+
document.querySelector(`.${prefixCls2}-scroll-bar-wrapper`).scrollTop = (state.value.length + 1) * ROW_HEIGHT;
|
|
32334
|
+
});
|
|
32335
|
+
}
|
|
32322
32336
|
}
|
|
32323
32337
|
emit("add", state.value);
|
|
32324
32338
|
};
|
|
@@ -67,6 +67,10 @@ export declare const shyFormTableProps: {
|
|
|
67
67
|
type: string;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
+
useDefaultAdd: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: () => true;
|
|
73
|
+
};
|
|
70
74
|
dynamicShowRemove: {
|
|
71
75
|
type: ((new (...args: any[]) => (record: Recordable) => boolean) | (() => (record: Recordable) => boolean) | {
|
|
72
76
|
(): (record: Recordable) => boolean;
|
|
@@ -150,6 +154,10 @@ declare const ShyFormTable: import("vue").DefineComponent<{
|
|
|
150
154
|
type: string;
|
|
151
155
|
};
|
|
152
156
|
};
|
|
157
|
+
useDefaultAdd: {
|
|
158
|
+
type: BooleanConstructor;
|
|
159
|
+
default: () => true;
|
|
160
|
+
};
|
|
153
161
|
dynamicShowRemove: {
|
|
154
162
|
type: ((new (...args: any[]) => (record: Recordable) => boolean) | (() => (record: Recordable) => boolean) | {
|
|
155
163
|
(): (record: Recordable) => boolean;
|
|
@@ -232,6 +240,10 @@ declare const ShyFormTable: import("vue").DefineComponent<{
|
|
|
232
240
|
type: string;
|
|
233
241
|
};
|
|
234
242
|
};
|
|
243
|
+
useDefaultAdd: {
|
|
244
|
+
type: BooleanConstructor;
|
|
245
|
+
default: () => true;
|
|
246
|
+
};
|
|
235
247
|
dynamicShowRemove: {
|
|
236
248
|
type: ((new (...args: any[]) => (record: Recordable) => boolean) | (() => (record: Recordable) => boolean) | {
|
|
237
249
|
(): (record: Recordable) => boolean;
|
|
@@ -266,6 +278,7 @@ declare const ShyFormTable: import("vue").DefineComponent<{
|
|
|
266
278
|
isShowRemoveBtn: boolean;
|
|
267
279
|
showRowCount: number;
|
|
268
280
|
addBtnConf: Record<string, any>;
|
|
281
|
+
useDefaultAdd: boolean;
|
|
269
282
|
dynamicShowRemove: (record: Recordable) => boolean;
|
|
270
283
|
}, {}>;
|
|
271
284
|
export { ShyFormTable };
|
package/lib/index.js
CHANGED
|
@@ -27869,6 +27869,11 @@ function useRowSelection(propsRef, tableData, emit) {
|
|
|
27869
27869
|
setSelectedRows
|
|
27870
27870
|
};
|
|
27871
27871
|
}
|
|
27872
|
+
function formatNumberWithThousandSeparator$1(val) {
|
|
27873
|
+
const [intPart, decimalPart] = String(val).split(".");
|
|
27874
|
+
const formattedInt = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
27875
|
+
return decimalPart !== void 0 ? `${formattedInt}.${decimalPart}` : formattedInt;
|
|
27876
|
+
}
|
|
27872
27877
|
function useDataSource(propsRef, {
|
|
27873
27878
|
getPaginationInfo,
|
|
27874
27879
|
setPagination,
|
|
@@ -27895,9 +27900,9 @@ function useDataSource(propsRef, {
|
|
|
27895
27900
|
const total = dataSourceRef.value.reduce((acc, cur) => {
|
|
27896
27901
|
return +acc + (+cur[field] || 0);
|
|
27897
27902
|
}, 0);
|
|
27898
|
-
obj[field] =
|
|
27899
|
-
|
|
27900
|
-
|
|
27903
|
+
obj[field] = formatNumberWithThousandSeparator$1(
|
|
27904
|
+
total.toFixed(vue.unref(propsRef).summaryPrecision)
|
|
27905
|
+
);
|
|
27901
27906
|
});
|
|
27902
27907
|
return obj;
|
|
27903
27908
|
});
|
|
@@ -30158,6 +30163,11 @@ const ShyTag = /* @__PURE__ */ vue.defineComponent({
|
|
|
30158
30163
|
return () => vue.unref(renderTag);
|
|
30159
30164
|
}
|
|
30160
30165
|
});
|
|
30166
|
+
function formatNumberWithThousandSeparator(val) {
|
|
30167
|
+
const [intPart, decimalPart] = String(val).split(".");
|
|
30168
|
+
const formattedInt = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
30169
|
+
return decimalPart !== void 0 ? `${formattedInt}.${decimalPart}` : formattedInt;
|
|
30170
|
+
}
|
|
30161
30171
|
const handleItem = (item, ellipsis) => {
|
|
30162
30172
|
const {
|
|
30163
30173
|
key: key2,
|
|
@@ -30343,9 +30353,7 @@ const useColumns$1 = (propsRef, getPaginationRef, tableAction2, wrapRef) => {
|
|
|
30343
30353
|
var _a2, _b, _c;
|
|
30344
30354
|
const isSummaryCol = (_b = (_a2 = vue.unref(propsRef).summaryTotalFields) == null ? void 0 : _a2.includes) == null ? void 0 : _b.call(_a2, column2.dataIndex);
|
|
30345
30355
|
const summaryFormat = (text) => {
|
|
30346
|
-
return text || utils$1.isNumber(text) ? utils$1.isNumber(+text) && !isNaN(+text) ? (+text).toFixed(vue.unref(propsRef).summaryPrecision)
|
|
30347
|
-
return match + (string3.charAt(offset2 + 1) === "." || offset2 === string3.length - 1 ? "" : ",");
|
|
30348
|
-
}) : text : text;
|
|
30356
|
+
return text || utils$1.isNumber(text) ? utils$1.isNumber(+text) && !isNaN(+text) ? formatNumberWithThousandSeparator((+text).toFixed(vue.unref(propsRef).summaryPrecision)) : text : text;
|
|
30349
30357
|
};
|
|
30350
30358
|
const {
|
|
30351
30359
|
slots,
|
|
@@ -32075,6 +32083,10 @@ const shyFormTableProps = vue.reactive({
|
|
|
32075
32083
|
};
|
|
32076
32084
|
}
|
|
32077
32085
|
},
|
|
32086
|
+
useDefaultAdd: {
|
|
32087
|
+
type: Boolean,
|
|
32088
|
+
default: () => true
|
|
32089
|
+
},
|
|
32078
32090
|
dynamicShowRemove: {
|
|
32079
32091
|
type: Function,
|
|
32080
32092
|
default: () => (record) => true
|
|
@@ -32334,15 +32346,17 @@ const ShyFormTable = /* @__PURE__ */ vue.defineComponent({
|
|
|
32334
32346
|
}, {});
|
|
32335
32347
|
});
|
|
32336
32348
|
const create = () => {
|
|
32337
|
-
|
|
32338
|
-
|
|
32339
|
-
|
|
32340
|
-
|
|
32341
|
-
|
|
32342
|
-
|
|
32343
|
-
|
|
32344
|
-
|
|
32345
|
-
|
|
32349
|
+
if (props2.useDefaultAdd) {
|
|
32350
|
+
state.value = [...vue.toRaw(state.value), {
|
|
32351
|
+
[props2.rowKey]: utils$1.buildUUID(),
|
|
32352
|
+
...vue.unref(defaultValuesRef)
|
|
32353
|
+
}];
|
|
32354
|
+
curIndex.value = 0;
|
|
32355
|
+
if (props2.isVirtual) {
|
|
32356
|
+
vue.nextTick(() => {
|
|
32357
|
+
document.querySelector(`.${prefixCls2}-scroll-bar-wrapper`).scrollTop = (state.value.length + 1) * ROW_HEIGHT;
|
|
32358
|
+
});
|
|
32359
|
+
}
|
|
32346
32360
|
}
|
|
32347
32361
|
emit("add", state.value);
|
|
32348
32362
|
};
|
|
@@ -67,6 +67,10 @@ export declare const shyFormTableProps: {
|
|
|
67
67
|
type: string;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
+
useDefaultAdd: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: () => true;
|
|
73
|
+
};
|
|
70
74
|
dynamicShowRemove: {
|
|
71
75
|
type: ((new (...args: any[]) => (record: Recordable) => boolean) | (() => (record: Recordable) => boolean) | {
|
|
72
76
|
(): (record: Recordable) => boolean;
|
|
@@ -150,6 +154,10 @@ declare const ShyFormTable: import("vue").DefineComponent<{
|
|
|
150
154
|
type: string;
|
|
151
155
|
};
|
|
152
156
|
};
|
|
157
|
+
useDefaultAdd: {
|
|
158
|
+
type: BooleanConstructor;
|
|
159
|
+
default: () => true;
|
|
160
|
+
};
|
|
153
161
|
dynamicShowRemove: {
|
|
154
162
|
type: ((new (...args: any[]) => (record: Recordable) => boolean) | (() => (record: Recordable) => boolean) | {
|
|
155
163
|
(): (record: Recordable) => boolean;
|
|
@@ -232,6 +240,10 @@ declare const ShyFormTable: import("vue").DefineComponent<{
|
|
|
232
240
|
type: string;
|
|
233
241
|
};
|
|
234
242
|
};
|
|
243
|
+
useDefaultAdd: {
|
|
244
|
+
type: BooleanConstructor;
|
|
245
|
+
default: () => true;
|
|
246
|
+
};
|
|
235
247
|
dynamicShowRemove: {
|
|
236
248
|
type: ((new (...args: any[]) => (record: Recordable) => boolean) | (() => (record: Recordable) => boolean) | {
|
|
237
249
|
(): (record: Recordable) => boolean;
|
|
@@ -266,6 +278,7 @@ declare const ShyFormTable: import("vue").DefineComponent<{
|
|
|
266
278
|
isShowRemoveBtn: boolean;
|
|
267
279
|
showRowCount: number;
|
|
268
280
|
addBtnConf: Record<string, any>;
|
|
281
|
+
useDefaultAdd: boolean;
|
|
269
282
|
dynamicShowRemove: (record: Recordable) => boolean;
|
|
270
283
|
}, {}>;
|
|
271
284
|
export { ShyFormTable };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "3h1-ui",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.252",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"vue-json-pretty": "^2.2.3",
|
|
30
30
|
"vxe-table": "4.3.6",
|
|
31
31
|
"xe-utils": "^3.5.7",
|
|
32
|
-
"@shy-plugins/tinymce": "^1.0.6",
|
|
33
32
|
"@shy-plugins/use": "1.0.1-next.5",
|
|
33
|
+
"@shy-plugins/tinymce": "^1.0.6",
|
|
34
34
|
"@shy-plugins/utils": "1.0.0-next.1"
|
|
35
35
|
},
|
|
36
36
|
"types": "es/ui/index.d.ts",
|