@shwfed/config 2.12.6 → 2.12.7
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/dist/module.json +1 -1
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +34 -34
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue +54 -50
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +8 -8
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +8 -8
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue +11 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +3 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.js +7 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +6 -6
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/runtime.vue +6 -73
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +44 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue +8 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +3 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.js +7 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/schema.d.ts +68 -68
- package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
- package/dist/runtime/share/number-format.d.ts +7 -0
- package/dist/runtime/share/number-format.js +72 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const CHINESE_DIGITS = ["\u96F6", "\u58F9", "\u8D30", "\u53C1", "\u8086", "\u4F0D", "\u9646", "\u67D2", "\u634C", "\u7396"];
|
|
2
|
+
const CHINESE_UNITS = ["", "\u62FE", "\u4F70", "\u4EDF"];
|
|
3
|
+
const CHINESE_GROUP_UNITS = ["", "\u4E07", "\u4EBF", "\u5146"];
|
|
4
|
+
export function toChineseUppercase(n) {
|
|
5
|
+
if (Number.isNaN(n)) return "-";
|
|
6
|
+
if (n === 0) return "\u96F6";
|
|
7
|
+
const isNegative = n < 0;
|
|
8
|
+
const absN = Math.abs(n);
|
|
9
|
+
const [intPart, decPart] = String(absN).split(".");
|
|
10
|
+
let result = "";
|
|
11
|
+
const digits = intPart.split("").reverse();
|
|
12
|
+
let zeroFlag = false;
|
|
13
|
+
for (let i = 0; i < digits.length; i++) {
|
|
14
|
+
const d = Number(digits[i]);
|
|
15
|
+
const groupIndex = Math.floor(i / 4);
|
|
16
|
+
const posInGroup = i % 4;
|
|
17
|
+
if (d === 0) {
|
|
18
|
+
zeroFlag = true;
|
|
19
|
+
} else {
|
|
20
|
+
if (zeroFlag) {
|
|
21
|
+
result = CHINESE_DIGITS[0] + result;
|
|
22
|
+
zeroFlag = false;
|
|
23
|
+
}
|
|
24
|
+
result = CHINESE_DIGITS[d] + CHINESE_UNITS[posInGroup] + result;
|
|
25
|
+
}
|
|
26
|
+
if (posInGroup === 0 && groupIndex > 0 && !zeroFlag) {
|
|
27
|
+
result = (CHINESE_GROUP_UNITS[groupIndex] ?? "") + result;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (decPart) {
|
|
31
|
+
result += "\u70B9";
|
|
32
|
+
for (const ch of decPart) {
|
|
33
|
+
result += CHINESE_DIGITS[Number(ch)];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return isNegative ? `\u8D1F${result}` : result;
|
|
37
|
+
}
|
|
38
|
+
export function formatNumberDisplay(value, opts) {
|
|
39
|
+
if (value === void 0 || value === null) return "-";
|
|
40
|
+
const n = Number(value);
|
|
41
|
+
if (Number.isNaN(n)) return "-";
|
|
42
|
+
const displayMode = opts.displayMode ?? "plain";
|
|
43
|
+
if (displayMode === "uppercaseChinese") {
|
|
44
|
+
return toChineseUppercase(n);
|
|
45
|
+
}
|
|
46
|
+
let result;
|
|
47
|
+
if (opts.precision !== void 0) {
|
|
48
|
+
const mode = opts.roundingMode ?? "round";
|
|
49
|
+
const digits = opts.precision;
|
|
50
|
+
const factor = 10 ** digits;
|
|
51
|
+
let processed;
|
|
52
|
+
switch (mode) {
|
|
53
|
+
case "floor":
|
|
54
|
+
processed = Math.floor(n * factor) / factor;
|
|
55
|
+
break;
|
|
56
|
+
case "ceil":
|
|
57
|
+
processed = Math.ceil(n * factor) / factor;
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
60
|
+
processed = Math.round(n * factor) / factor;
|
|
61
|
+
}
|
|
62
|
+
result = processed.toFixed(digits);
|
|
63
|
+
} else {
|
|
64
|
+
result = String(n);
|
|
65
|
+
}
|
|
66
|
+
if (displayMode === "monoThousand") {
|
|
67
|
+
const [integer, decimal] = result.split(".");
|
|
68
|
+
const formattedInt = integer.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
69
|
+
result = decimal !== void 0 ? `${formattedInt}.${decimal}` : formattedInt;
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|