@aspire-ui/element-component-pro 1.0.6 → 1.0.8
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/README.md +22 -0
- package/dist/ProForm/FormattedNumberInput.vue.d.ts +55 -0
- package/dist/ProForm/ProForm.vue.d.ts +7 -0
- package/dist/ProForm/ProFormItem.vue.d.ts +2 -0
- package/dist/ProForm/index.d.ts +2 -1
- package/dist/element-component-pro.es.js +966 -759
- package/dist/element-component-pro.es.js.map +1 -1
- package/dist/element-component-pro.umd.js +2 -2
- package/dist/element-component-pro.umd.js.map +1 -1
- package/dist/index.d.ts +130 -50
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +13 -2
- package/dist/utils/formattedNumber.d.ts +16 -0
- package/dist/utils/tooltip.d.ts +4 -0
- package/package.json +2 -1
- package/src/ProDescriptions/ProDescriptions.vue +24 -6
- package/src/ProForm/FormattedNumberInput.vue +122 -0
- package/src/ProForm/ProForm.vue +3 -1
- package/src/ProForm/ProFormItem.vue +155 -123
- package/src/ProForm/index.ts +2 -1
- package/src/ProTable/TableAction.vue +2 -5
- package/src/index.ts +5 -2
- package/src/types/index.ts +9 -1
- package/src/utils/formattedNumber.ts +118 -0
- package/src/utils/tooltip.ts +56 -0
- package/src/vite-env.d.ts +5 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { VueConstructor } from 'vue';
|
|
2
2
|
import { default as ProTable, TableAction } from './ProTable';
|
|
3
|
-
import { default as ProForm, ProFormItem, FormActions } from './ProForm';
|
|
3
|
+
import { default as ProForm, ProFormItem, FormActions, FormattedNumberInput } from './ProForm';
|
|
4
4
|
import { default as ProDescriptions } from './ProDescriptions';
|
|
5
5
|
import { useForm } from './ProForm/useForm';
|
|
6
6
|
import { useDescription } from './ProDescriptions/useDescription';
|
|
7
7
|
import { useProTable } from './ProTable/useProTable';
|
|
8
8
|
import { useComponentSetting } from './useComponentSetting';
|
|
9
9
|
|
|
10
|
-
export { ProForm, ProFormItem, FormActions, useForm };
|
|
10
|
+
export { ProForm, ProFormItem, FormActions, FormattedNumberInput, useForm };
|
|
11
11
|
export { ProTable, useProTable, TableAction };
|
|
12
12
|
export { ProDescriptions, useDescription };
|
|
13
13
|
export { useComponentSetting };
|
|
@@ -16,6 +16,7 @@ export type { UseProTableReturn, UseProTablePropsReactive } from './ProTable/use
|
|
|
16
16
|
export type { UseDescriptionReturn, UseDescriptionPropsReactive } from './ProDescriptions/useDescription';
|
|
17
17
|
export * from './ProTable/types';
|
|
18
18
|
export * from './types';
|
|
19
|
+
export * from './utils/formattedNumber';
|
|
19
20
|
export declare function install(Vue: VueConstructor): void;
|
|
20
21
|
declare const _default: {
|
|
21
22
|
install: typeof install;
|
|
@@ -52,16 +53,16 @@ declare const _default: {
|
|
|
52
53
|
type: import('vue').PropType<boolean>;
|
|
53
54
|
default: boolean;
|
|
54
55
|
};
|
|
56
|
+
immediate: {
|
|
57
|
+
type: import('vue').PropType<boolean>;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
55
60
|
treeProps: {
|
|
56
61
|
type: import('vue').PropType<{
|
|
57
62
|
hasChildren?: string;
|
|
58
63
|
children?: string;
|
|
59
64
|
}>;
|
|
60
65
|
};
|
|
61
|
-
immediate: {
|
|
62
|
-
type: import('vue').PropType<boolean>;
|
|
63
|
-
default: boolean;
|
|
64
|
-
};
|
|
65
66
|
rowSelection: {
|
|
66
67
|
type: import('vue').PropType<{
|
|
67
68
|
type?: "checkbox" | "radio";
|
|
@@ -222,16 +223,16 @@ declare const _default: {
|
|
|
222
223
|
type: import('vue').PropType<boolean>;
|
|
223
224
|
default: boolean;
|
|
224
225
|
};
|
|
226
|
+
immediate: {
|
|
227
|
+
type: import('vue').PropType<boolean>;
|
|
228
|
+
default: boolean;
|
|
229
|
+
};
|
|
225
230
|
treeProps: {
|
|
226
231
|
type: import('vue').PropType<{
|
|
227
232
|
hasChildren?: string;
|
|
228
233
|
children?: string;
|
|
229
234
|
}>;
|
|
230
235
|
};
|
|
231
|
-
immediate: {
|
|
232
|
-
type: import('vue').PropType<boolean>;
|
|
233
|
-
default: boolean;
|
|
234
|
-
};
|
|
235
236
|
rowSelection: {
|
|
236
237
|
type: import('vue').PropType<{
|
|
237
238
|
type?: "checkbox" | "radio";
|
|
@@ -433,16 +434,16 @@ declare const _default: {
|
|
|
433
434
|
type: import('vue').PropType<boolean>;
|
|
434
435
|
default: boolean;
|
|
435
436
|
};
|
|
437
|
+
immediate: {
|
|
438
|
+
type: import('vue').PropType<boolean>;
|
|
439
|
+
default: boolean;
|
|
440
|
+
};
|
|
436
441
|
treeProps: {
|
|
437
442
|
type: import('vue').PropType<{
|
|
438
443
|
hasChildren?: string;
|
|
439
444
|
children?: string;
|
|
440
445
|
}>;
|
|
441
446
|
};
|
|
442
|
-
immediate: {
|
|
443
|
-
type: import('vue').PropType<boolean>;
|
|
444
|
-
default: boolean;
|
|
445
|
-
};
|
|
446
447
|
rowSelection: {
|
|
447
448
|
type: import('vue').PropType<{
|
|
448
449
|
type?: "checkbox" | "radio";
|
|
@@ -637,16 +638,16 @@ declare const _default: {
|
|
|
637
638
|
type: import('vue').PropType<boolean>;
|
|
638
639
|
default: boolean;
|
|
639
640
|
};
|
|
641
|
+
immediate: {
|
|
642
|
+
type: import('vue').PropType<boolean>;
|
|
643
|
+
default: boolean;
|
|
644
|
+
};
|
|
640
645
|
treeProps: {
|
|
641
646
|
type: import('vue').PropType<{
|
|
642
647
|
hasChildren?: string;
|
|
643
648
|
children?: string;
|
|
644
649
|
}>;
|
|
645
650
|
};
|
|
646
|
-
immediate: {
|
|
647
|
-
type: import('vue').PropType<boolean>;
|
|
648
|
-
default: boolean;
|
|
649
|
-
};
|
|
650
651
|
rowSelection: {
|
|
651
652
|
type: import('vue').PropType<{
|
|
652
653
|
type?: "checkbox" | "radio";
|
|
@@ -807,16 +808,16 @@ declare const _default: {
|
|
|
807
808
|
type: import('vue').PropType<boolean>;
|
|
808
809
|
default: boolean;
|
|
809
810
|
};
|
|
811
|
+
immediate: {
|
|
812
|
+
type: import('vue').PropType<boolean>;
|
|
813
|
+
default: boolean;
|
|
814
|
+
};
|
|
810
815
|
treeProps: {
|
|
811
816
|
type: import('vue').PropType<{
|
|
812
817
|
hasChildren?: string;
|
|
813
818
|
children?: string;
|
|
814
819
|
}>;
|
|
815
820
|
};
|
|
816
|
-
immediate: {
|
|
817
|
-
type: import('vue').PropType<boolean>;
|
|
818
|
-
default: boolean;
|
|
819
|
-
};
|
|
820
821
|
rowSelection: {
|
|
821
822
|
type: import('vue').PropType<{
|
|
822
823
|
type?: "checkbox" | "radio";
|
|
@@ -1053,16 +1054,16 @@ declare const _default: {
|
|
|
1053
1054
|
type: import('vue').PropType<boolean>;
|
|
1054
1055
|
default: boolean;
|
|
1055
1056
|
};
|
|
1057
|
+
immediate: {
|
|
1058
|
+
type: import('vue').PropType<boolean>;
|
|
1059
|
+
default: boolean;
|
|
1060
|
+
};
|
|
1056
1061
|
treeProps: {
|
|
1057
1062
|
type: import('vue').PropType<{
|
|
1058
1063
|
hasChildren?: string;
|
|
1059
1064
|
children?: string;
|
|
1060
1065
|
}>;
|
|
1061
1066
|
};
|
|
1062
|
-
immediate: {
|
|
1063
|
-
type: import('vue').PropType<boolean>;
|
|
1064
|
-
default: boolean;
|
|
1065
|
-
};
|
|
1066
1067
|
rowSelection: {
|
|
1067
1068
|
type: import('vue').PropType<{
|
|
1068
1069
|
type?: "checkbox" | "radio";
|
|
@@ -1307,6 +1308,9 @@ declare const _default: {
|
|
|
1307
1308
|
};
|
|
1308
1309
|
});
|
|
1309
1310
|
ProForm: import('vue/types/v3-component-public-instance').ComponentPublicInstanceConstructor<import('vue/types/v3-component-public-instance').Vue3Instance<{}, Readonly<import('vue').ExtractPropTypes<{
|
|
1311
|
+
disabled: {
|
|
1312
|
+
type: import('vue').PropType<boolean>;
|
|
1313
|
+
};
|
|
1310
1314
|
size: {
|
|
1311
1315
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1312
1316
|
default: string;
|
|
@@ -1314,9 +1318,6 @@ declare const _default: {
|
|
|
1314
1318
|
components: {
|
|
1315
1319
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1316
1320
|
};
|
|
1317
|
-
disabled: {
|
|
1318
|
-
type: import('vue').PropType<boolean>;
|
|
1319
|
-
};
|
|
1320
1321
|
showActionButtonGroup: {
|
|
1321
1322
|
type: import('vue').PropType<boolean>;
|
|
1322
1323
|
default: boolean;
|
|
@@ -1359,6 +1360,10 @@ declare const _default: {
|
|
|
1359
1360
|
xl: number;
|
|
1360
1361
|
};
|
|
1361
1362
|
};
|
|
1363
|
+
colon: {
|
|
1364
|
+
type: import('vue').PropType<boolean>;
|
|
1365
|
+
default: boolean;
|
|
1366
|
+
};
|
|
1362
1367
|
schemas: {
|
|
1363
1368
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1364
1369
|
};
|
|
@@ -1373,7 +1378,7 @@ declare const _default: {
|
|
|
1373
1378
|
default: string;
|
|
1374
1379
|
};
|
|
1375
1380
|
labelPosition: {
|
|
1376
|
-
type: import('vue').PropType<"
|
|
1381
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1377
1382
|
default: string;
|
|
1378
1383
|
};
|
|
1379
1384
|
gutter: {
|
|
@@ -1419,6 +1424,9 @@ declare const _default: {
|
|
|
1419
1424
|
type: import('vue').PropType<import('./types').FormListeners>;
|
|
1420
1425
|
};
|
|
1421
1426
|
}>>, Readonly<import('vue').ExtractPropTypes<{
|
|
1427
|
+
disabled: {
|
|
1428
|
+
type: import('vue').PropType<boolean>;
|
|
1429
|
+
};
|
|
1422
1430
|
size: {
|
|
1423
1431
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1424
1432
|
default: string;
|
|
@@ -1426,9 +1434,6 @@ declare const _default: {
|
|
|
1426
1434
|
components: {
|
|
1427
1435
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1428
1436
|
};
|
|
1429
|
-
disabled: {
|
|
1430
|
-
type: import('vue').PropType<boolean>;
|
|
1431
|
-
};
|
|
1432
1437
|
showActionButtonGroup: {
|
|
1433
1438
|
type: import('vue').PropType<boolean>;
|
|
1434
1439
|
default: boolean;
|
|
@@ -1471,6 +1476,10 @@ declare const _default: {
|
|
|
1471
1476
|
xl: number;
|
|
1472
1477
|
};
|
|
1473
1478
|
};
|
|
1479
|
+
colon: {
|
|
1480
|
+
type: import('vue').PropType<boolean>;
|
|
1481
|
+
default: boolean;
|
|
1482
|
+
};
|
|
1474
1483
|
schemas: {
|
|
1475
1484
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1476
1485
|
};
|
|
@@ -1485,7 +1494,7 @@ declare const _default: {
|
|
|
1485
1494
|
default: string;
|
|
1486
1495
|
};
|
|
1487
1496
|
labelPosition: {
|
|
1488
|
-
type: import('vue').PropType<"
|
|
1497
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1489
1498
|
default: string;
|
|
1490
1499
|
};
|
|
1491
1500
|
gutter: {
|
|
@@ -1546,6 +1555,7 @@ declare const _default: {
|
|
|
1546
1555
|
resetButtonIcon: string;
|
|
1547
1556
|
showAdvancedButton: boolean;
|
|
1548
1557
|
actionColOptions: import('./types').ColEx;
|
|
1558
|
+
colon: boolean;
|
|
1549
1559
|
labelWidth: string;
|
|
1550
1560
|
labelPosition: "left" | "right" | "top";
|
|
1551
1561
|
gutter: number;
|
|
@@ -1555,6 +1565,9 @@ declare const _default: {
|
|
|
1555
1565
|
alwaysShowLines: number;
|
|
1556
1566
|
submitOnReset: boolean;
|
|
1557
1567
|
}, true, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import('vue').ExtractPropTypes<{
|
|
1568
|
+
disabled: {
|
|
1569
|
+
type: import('vue').PropType<boolean>;
|
|
1570
|
+
};
|
|
1558
1571
|
size: {
|
|
1559
1572
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1560
1573
|
default: string;
|
|
@@ -1562,9 +1575,6 @@ declare const _default: {
|
|
|
1562
1575
|
components: {
|
|
1563
1576
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1564
1577
|
};
|
|
1565
|
-
disabled: {
|
|
1566
|
-
type: import('vue').PropType<boolean>;
|
|
1567
|
-
};
|
|
1568
1578
|
showActionButtonGroup: {
|
|
1569
1579
|
type: import('vue').PropType<boolean>;
|
|
1570
1580
|
default: boolean;
|
|
@@ -1607,6 +1617,10 @@ declare const _default: {
|
|
|
1607
1617
|
xl: number;
|
|
1608
1618
|
};
|
|
1609
1619
|
};
|
|
1620
|
+
colon: {
|
|
1621
|
+
type: import('vue').PropType<boolean>;
|
|
1622
|
+
default: boolean;
|
|
1623
|
+
};
|
|
1610
1624
|
schemas: {
|
|
1611
1625
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1612
1626
|
};
|
|
@@ -1621,7 +1635,7 @@ declare const _default: {
|
|
|
1621
1635
|
default: string;
|
|
1622
1636
|
};
|
|
1623
1637
|
labelPosition: {
|
|
1624
|
-
type: import('vue').PropType<"
|
|
1638
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1625
1639
|
default: string;
|
|
1626
1640
|
};
|
|
1627
1641
|
gutter: {
|
|
@@ -1680,6 +1694,9 @@ declare const _default: {
|
|
|
1680
1694
|
removeSchemaByField: (field: string | string[]) => Promise<void>;
|
|
1681
1695
|
setProps: (props: Partial<import('./types').ProFormProps>) => Promise<void>;
|
|
1682
1696
|
}> & import('vue/types/v3-component-options').ExtractComputedReturns<{}> & import('vue').ComponentCustomProperties & Readonly<import('vue').ExtractPropTypes<{
|
|
1697
|
+
disabled: {
|
|
1698
|
+
type: import('vue').PropType<boolean>;
|
|
1699
|
+
};
|
|
1683
1700
|
size: {
|
|
1684
1701
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1685
1702
|
default: string;
|
|
@@ -1687,9 +1704,6 @@ declare const _default: {
|
|
|
1687
1704
|
components: {
|
|
1688
1705
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1689
1706
|
};
|
|
1690
|
-
disabled: {
|
|
1691
|
-
type: import('vue').PropType<boolean>;
|
|
1692
|
-
};
|
|
1693
1707
|
showActionButtonGroup: {
|
|
1694
1708
|
type: import('vue').PropType<boolean>;
|
|
1695
1709
|
default: boolean;
|
|
@@ -1732,6 +1746,10 @@ declare const _default: {
|
|
|
1732
1746
|
xl: number;
|
|
1733
1747
|
};
|
|
1734
1748
|
};
|
|
1749
|
+
colon: {
|
|
1750
|
+
type: import('vue').PropType<boolean>;
|
|
1751
|
+
default: boolean;
|
|
1752
|
+
};
|
|
1735
1753
|
schemas: {
|
|
1736
1754
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1737
1755
|
};
|
|
@@ -1746,7 +1764,7 @@ declare const _default: {
|
|
|
1746
1764
|
default: string;
|
|
1747
1765
|
};
|
|
1748
1766
|
labelPosition: {
|
|
1749
|
-
type: import('vue').PropType<"
|
|
1767
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1750
1768
|
default: string;
|
|
1751
1769
|
};
|
|
1752
1770
|
gutter: {
|
|
@@ -1792,6 +1810,9 @@ declare const _default: {
|
|
|
1792
1810
|
type: import('vue').PropType<import('./types').FormListeners>;
|
|
1793
1811
|
};
|
|
1794
1812
|
}>>> & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
1813
|
+
disabled: {
|
|
1814
|
+
type: import('vue').PropType<boolean>;
|
|
1815
|
+
};
|
|
1795
1816
|
size: {
|
|
1796
1817
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1797
1818
|
default: string;
|
|
@@ -1799,9 +1820,6 @@ declare const _default: {
|
|
|
1799
1820
|
components: {
|
|
1800
1821
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1801
1822
|
};
|
|
1802
|
-
disabled: {
|
|
1803
|
-
type: import('vue').PropType<boolean>;
|
|
1804
|
-
};
|
|
1805
1823
|
showActionButtonGroup: {
|
|
1806
1824
|
type: import('vue').PropType<boolean>;
|
|
1807
1825
|
default: boolean;
|
|
@@ -1844,6 +1862,10 @@ declare const _default: {
|
|
|
1844
1862
|
xl: number;
|
|
1845
1863
|
};
|
|
1846
1864
|
};
|
|
1865
|
+
colon: {
|
|
1866
|
+
type: import('vue').PropType<boolean>;
|
|
1867
|
+
default: boolean;
|
|
1868
|
+
};
|
|
1847
1869
|
schemas: {
|
|
1848
1870
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1849
1871
|
};
|
|
@@ -1858,7 +1880,7 @@ declare const _default: {
|
|
|
1858
1880
|
default: string;
|
|
1859
1881
|
};
|
|
1860
1882
|
labelPosition: {
|
|
1861
|
-
type: import('vue').PropType<"
|
|
1883
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1862
1884
|
default: string;
|
|
1863
1885
|
};
|
|
1864
1886
|
gutter: {
|
|
@@ -1932,6 +1954,7 @@ declare const _default: {
|
|
|
1932
1954
|
resetButtonIcon: string;
|
|
1933
1955
|
showAdvancedButton: boolean;
|
|
1934
1956
|
actionColOptions: import('./types').ColEx;
|
|
1957
|
+
colon: boolean;
|
|
1935
1958
|
labelWidth: string;
|
|
1936
1959
|
labelPosition: "left" | "right" | "top";
|
|
1937
1960
|
gutter: number;
|
|
@@ -1942,6 +1965,9 @@ declare const _default: {
|
|
|
1942
1965
|
submitOnReset: boolean;
|
|
1943
1966
|
}> & {
|
|
1944
1967
|
props: {
|
|
1968
|
+
disabled: {
|
|
1969
|
+
type: import('vue').PropType<boolean>;
|
|
1970
|
+
};
|
|
1945
1971
|
size: {
|
|
1946
1972
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1947
1973
|
default: string;
|
|
@@ -1949,9 +1975,6 @@ declare const _default: {
|
|
|
1949
1975
|
components: {
|
|
1950
1976
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1951
1977
|
};
|
|
1952
|
-
disabled: {
|
|
1953
|
-
type: import('vue').PropType<boolean>;
|
|
1954
|
-
};
|
|
1955
1978
|
showActionButtonGroup: {
|
|
1956
1979
|
type: import('vue').PropType<boolean>;
|
|
1957
1980
|
default: boolean;
|
|
@@ -1994,6 +2017,10 @@ declare const _default: {
|
|
|
1994
2017
|
xl: number;
|
|
1995
2018
|
};
|
|
1996
2019
|
};
|
|
2020
|
+
colon: {
|
|
2021
|
+
type: import('vue').PropType<boolean>;
|
|
2022
|
+
default: boolean;
|
|
2023
|
+
};
|
|
1997
2024
|
schemas: {
|
|
1998
2025
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1999
2026
|
};
|
|
@@ -2008,7 +2035,7 @@ declare const _default: {
|
|
|
2008
2035
|
default: string;
|
|
2009
2036
|
};
|
|
2010
2037
|
labelPosition: {
|
|
2011
|
-
type: import('vue').PropType<"
|
|
2038
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
2012
2039
|
default: string;
|
|
2013
2040
|
};
|
|
2014
2041
|
gutter: {
|
|
@@ -2061,6 +2088,7 @@ declare const _default: {
|
|
|
2061
2088
|
field: string;
|
|
2062
2089
|
label: string;
|
|
2063
2090
|
labelWidth?: string | undefined;
|
|
2091
|
+
colon?: boolean | undefined;
|
|
2064
2092
|
component?: (import('./types').ProFormBuiltInComponent | import('./types').ProFormCustomComponent) | undefined;
|
|
2065
2093
|
componentProps?: (Record<string, unknown> | ((params: import('./types').RenderCallbackParams & {
|
|
2066
2094
|
formActionType?: import('./types').FormActionType;
|
|
@@ -2090,6 +2118,7 @@ declare const _default: {
|
|
|
2090
2118
|
dependencies?: string[] | undefined;
|
|
2091
2119
|
helpMessage?: string | string[] | undefined;
|
|
2092
2120
|
helpComponentProps?: Record<string, unknown> | undefined;
|
|
2121
|
+
tooltip?: (boolean | string | Record<string, unknown> | ((params: import('./types').RenderCallbackParams) => boolean | string | Record<string, unknown>)) | undefined;
|
|
2093
2122
|
};
|
|
2094
2123
|
field: string;
|
|
2095
2124
|
values: Record<string, unknown>;
|
|
@@ -2543,5 +2572,56 @@ declare const _default: {
|
|
|
2543
2572
|
dropDownActions: import('./ProTable').TableActionItem[];
|
|
2544
2573
|
stopButtonPropagation: boolean;
|
|
2545
2574
|
}>;
|
|
2575
|
+
FormattedNumberInput: import('vue').DefineComponent<{
|
|
2576
|
+
disabled: {
|
|
2577
|
+
type: import('vue').PropType<boolean>;
|
|
2578
|
+
};
|
|
2579
|
+
value: {
|
|
2580
|
+
type: import('vue').PropType<unknown>;
|
|
2581
|
+
};
|
|
2582
|
+
placeholder: {
|
|
2583
|
+
type: import('vue').PropType<string>;
|
|
2584
|
+
};
|
|
2585
|
+
integerDigits: {
|
|
2586
|
+
type: import('vue').PropType<number>;
|
|
2587
|
+
default: number;
|
|
2588
|
+
};
|
|
2589
|
+
decimalPlaces: {
|
|
2590
|
+
type: import('vue').PropType<number>;
|
|
2591
|
+
default: number;
|
|
2592
|
+
};
|
|
2593
|
+
rounding: {
|
|
2594
|
+
type: import('vue').PropType<import('.').FormattedNumberRounding>;
|
|
2595
|
+
default: string;
|
|
2596
|
+
};
|
|
2597
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
2598
|
+
input: (value: unknown) => void;
|
|
2599
|
+
}, string, Readonly<import('vue').ExtractPropTypes<{
|
|
2600
|
+
disabled: {
|
|
2601
|
+
type: import('vue').PropType<boolean>;
|
|
2602
|
+
};
|
|
2603
|
+
value: {
|
|
2604
|
+
type: import('vue').PropType<unknown>;
|
|
2605
|
+
};
|
|
2606
|
+
placeholder: {
|
|
2607
|
+
type: import('vue').PropType<string>;
|
|
2608
|
+
};
|
|
2609
|
+
integerDigits: {
|
|
2610
|
+
type: import('vue').PropType<number>;
|
|
2611
|
+
default: number;
|
|
2612
|
+
};
|
|
2613
|
+
decimalPlaces: {
|
|
2614
|
+
type: import('vue').PropType<number>;
|
|
2615
|
+
default: number;
|
|
2616
|
+
};
|
|
2617
|
+
rounding: {
|
|
2618
|
+
type: import('vue').PropType<import('.').FormattedNumberRounding>;
|
|
2619
|
+
default: string;
|
|
2620
|
+
};
|
|
2621
|
+
}>>, {
|
|
2622
|
+
integerDigits: number;
|
|
2623
|
+
decimalPlaces: number;
|
|
2624
|
+
rounding: import('.').FormattedNumberRounding;
|
|
2625
|
+
}>;
|
|
2546
2626
|
};
|
|
2547
2627
|
export default _default;
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ecp-pro-table[data-v-c5638c20]{padding:16px;background:#fff;width:100%;box-sizing:border-box}.ecp-pro-table[data-v-c5638c20] .el-table{width:100%!important}.ecp-pro-table__header[data-v-c5638c20]{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.ecp-pro-table__title-wrapper[data-v-c5638c20]{display:flex;align-items:center;gap:4px}.ecp-pro-table__title[data-v-c5638c20]{font-size:16px;font-weight:600}.ecp-pro-table__help[data-v-c5638c20]{color:#909399;cursor:help}.ecp-pro-table__toolbar[data-v-c5638c20]{display:flex;align-items:center;gap:8px}.ecp-pro-table__body[data-v-c5638c20]{width:100%}.ecp-pro-table__pagination[data-v-c5638c20]{margin-top:16px;display:flex;justify-content:flex-end}.ecp-pro-table__col-help[data-v-c5638c20]{margin-left:4px;color:#909399;cursor:help}.ecp-table-action[data-v-
|
|
1
|
+
.ecp-pro-table[data-v-c5638c20]{padding:16px;background:#fff;width:100%;box-sizing:border-box}.ecp-pro-table[data-v-c5638c20] .el-table{width:100%!important}.ecp-pro-table__header[data-v-c5638c20]{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.ecp-pro-table__title-wrapper[data-v-c5638c20]{display:flex;align-items:center;gap:4px}.ecp-pro-table__title[data-v-c5638c20]{font-size:16px;font-weight:600}.ecp-pro-table__help[data-v-c5638c20]{color:#909399;cursor:help}.ecp-pro-table__toolbar[data-v-c5638c20]{display:flex;align-items:center;gap:8px}.ecp-pro-table__body[data-v-c5638c20]{width:100%}.ecp-pro-table__pagination[data-v-c5638c20]{margin-top:16px;display:flex;justify-content:flex-end}.ecp-pro-table__col-help[data-v-c5638c20]{margin-left:4px;color:#909399;cursor:help}.ecp-table-action[data-v-45a58e7c],.ecp-table-action__item[data-v-45a58e7c]{display:inline-flex;align-items:center;gap:4px}.ecp-table-action__icon[data-v-45a58e7c]{margin-right:4px}.ecp-table-action__more[data-v-45a58e7c]{display:inline-flex;align-items:center}.ecp-table-action__dropdown-item[data-v-45a58e7c]{display:inline-flex;align-items:center;gap:4px}.ecp-tree-select[data-v-f30bba11]{position:relative;width:100%}.ecp-tree-select__filter-inner[data-v-f30bba11]{margin-bottom:8px}.ecp-tree-select__dropdown[data-v-f30bba11]{position:absolute;top:100%;left:0;right:0;max-height:280px;overflow:auto;background:#fff;border:1px solid #dcdfe6;border-radius:4px;margin-top:4px;z-index:1000;padding:8px}.ecp-tree-select__loading[data-v-f30bba11]{padding:24px;text-align:center;color:#909399;font-size:14px}.ecp-pro-form-item__colon[data-v-d3466c67]{margin-right:2px}.ecp-pro-form-item__help-icon[data-v-d3466c67]{margin-left:4px;color:#909399;cursor:help;font-size:14px}.ecp-pro-form-item__help-icon[data-v-d3466c67]:hover{color:#409eff}.ecp-pro-form-item__help-item[data-v-d3466c67]{margin-bottom:4px}.ecp-pro-form-item__help-item[data-v-d3466c67]:last-child{margin-bottom:0}.ecp-form-actions[data-v-489c88d2]{text-align:right}.ecp-form-actions__advance[data-v-489c88d2]{margin-right:8px}.el-icon-d-arrow-left.up[data-v-489c88d2]{transform:rotate(90deg)}.el-icon-d-arrow-left.down[data-v-489c88d2]{transform:rotate(-90deg)}.ecp-pro-form[data-v-bf70afca]{padding:16px;position:relative}.ecp-pro-form__advance[data-v-bf70afca]{margin-bottom:16px}.ecp-pro-form_col[data-v-bf70afca]{position:relative;float:right}.el-icon-d-arrow-left.up[data-v-bf70afca]{transform:rotate(90deg)}.el-icon-d-arrow-left.down[data-v-bf70afca]{transform:rotate(-90deg)}.ecp-form-actions__advance[data-v-bf70afca]{position:absolute;bottom:0;left:50%;transform:translate(-50%,-50%)}.ecp-pro-descriptions[data-v-7d6cd376]{width:100%;box-sizing:border-box}.ecp-pro-descriptions__header[data-v-7d6cd376]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:12px}.ecp-pro-descriptions__title-wrap[data-v-7d6cd376]{display:flex;align-items:center;gap:6px}.ecp-pro-descriptions__title[data-v-7d6cd376]{font-size:16px;font-weight:600;color:#303133}.ecp-pro-descriptions__help[data-v-7d6cd376],.ecp-pro-descriptions__toggle[data-v-7d6cd376]{color:#909399}.ecp-pro-descriptions__toggle .el-icon-arrow-down[data-v-7d6cd376]{margin-left:4px;transition:transform .2s ease}.ecp-pro-descriptions__toggle .el-icon-arrow-down.is-expanded[data-v-7d6cd376]{transform:rotate(180deg)}.ecp-pro-descriptions__body[data-v-7d6cd376]{display:grid;border-top:1px solid #ebeef5;border-left:1px solid #ebeef5;overflow:hidden}.ecp-pro-descriptions__body.is-collapsed[data-v-7d6cd376]{overflow:hidden}.ecp-pro-descriptions__body[data-v-7d6cd376]:not(.is-bordered){border-top:0;border-left:0;gap:12px 16px}.ecp-pro-descriptions__item[data-v-7d6cd376]{display:flex;min-width:0;border-right:1px solid #ebeef5;border-bottom:1px solid #ebeef5}.ecp-pro-descriptions__body:not(.is-bordered) .ecp-pro-descriptions__item[data-v-7d6cd376]{border-right:0;border-bottom:0}.ecp-pro-descriptions__label[data-v-7d6cd376],.ecp-pro-descriptions__content[data-v-7d6cd376]{min-width:0;box-sizing:border-box;word-break:break-word}.ecp-pro-descriptions__label[data-v-7d6cd376]{flex:0 0 120px;padding:12px 16px;color:#606266;background:#fafafa}.ecp-pro-descriptions__content[data-v-7d6cd376]{flex:1;padding:12px 16px;color:#303133;background:#fff}.ecp-pro-descriptions__body:not(.is-bordered) .ecp-pro-descriptions__label[data-v-7d6cd376]{flex-basis:auto;padding:0;margin-right:8px;background:transparent;font-weight:500}.ecp-pro-descriptions__body:not(.is-bordered) .ecp-pro-descriptions__content[data-v-7d6cd376]{padding:0;background:transparent}.ecp-pro-descriptions__body.is-small .ecp-pro-descriptions__label[data-v-7d6cd376],.ecp-pro-descriptions__body.is-small .ecp-pro-descriptions__content[data-v-7d6cd376]{padding-top:8px;padding-bottom:8px;font-size:13px}@media (max-width: 767px){.ecp-pro-descriptions__item[data-v-7d6cd376]{flex-direction:column}.ecp-pro-descriptions__label[data-v-7d6cd376]{flex-basis:auto}}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export interface ProFormProps {
|
|
|
54
54
|
initialValues?: Record<string, unknown>;
|
|
55
55
|
labelWidth?: string;
|
|
56
56
|
labelPosition?: 'left' | 'right' | 'top';
|
|
57
|
+
colon?: boolean;
|
|
57
58
|
gutter?: number;
|
|
58
59
|
size?: 'medium' | 'small' | 'large';
|
|
59
60
|
disabled?: boolean;
|
|
@@ -77,7 +78,7 @@ export interface ProFormProps {
|
|
|
77
78
|
components?: Record<string, unknown>;
|
|
78
79
|
}
|
|
79
80
|
/** ProForm 内置表单项组件类型 */
|
|
80
|
-
export type ProFormBuiltInComponent = 'input' | 'select' | 'api-select' | 'tree-select' | 'date-picker' | 'date-range' | 'input-number' | 'switch' | 'cascader' | 'checkbox' | 'radio';
|
|
81
|
+
export type ProFormBuiltInComponent = 'input' | 'select' | 'api-select' | 'tree-select' | 'date-picker' | 'date-range' | 'input-number' | 'formatted-number' | 'switch' | 'cascader' | 'checkbox' | 'radio';
|
|
81
82
|
/** 自定义组件:组件名(string)或 Vue 组件选项/构造函数(object | Function) */
|
|
82
83
|
export type ProFormCustomComponent = string | object | ((...args: unknown[]) => unknown);
|
|
83
84
|
/** ProForm 表单项配置 */
|
|
@@ -88,9 +89,11 @@ export interface ProFormSchema {
|
|
|
88
89
|
label: string;
|
|
89
90
|
/** 单个表单项标签宽度,优先级高于 Form 的 labelWidth */
|
|
90
91
|
labelWidth?: string;
|
|
92
|
+
/** 是否显示 label 冒号,优先级高于 ProForm 的 colon */
|
|
93
|
+
colon?: boolean;
|
|
91
94
|
/**
|
|
92
95
|
* 组件类型:
|
|
93
|
-
* - 内置:'input' | 'select' | 'date-picker' | 'date-range' | 'input-number' | 'switch' | 'cascader' | 'checkbox' | 'radio'
|
|
96
|
+
* - 内置:'input' | 'select' | 'date-picker' | 'date-range' | 'input-number' | 'formatted-number' | 'switch' | 'cascader' | 'checkbox' | 'radio'
|
|
94
97
|
* - 自定义组件名:任意字符串,对应全局或 ProForm 传入的 components 中注册的组件
|
|
95
98
|
* - 内联组件:直接传入 Vue 组件选项对象或构造函数
|
|
96
99
|
*/
|
|
@@ -129,6 +132,8 @@ export interface ProFormSchema {
|
|
|
129
132
|
helpMessage?: string | string[];
|
|
130
133
|
/** 温馨提示组件的 props */
|
|
131
134
|
helpComponentProps?: Record<string, unknown>;
|
|
135
|
+
/** 表单项 value 的 tooltip,true 时默认展示当前值,支持函数动态返回 */
|
|
136
|
+
tooltip?: boolean | string | Record<string, unknown> | ((params: RenderCallbackParams) => boolean | string | Record<string, unknown>);
|
|
132
137
|
}
|
|
133
138
|
/** ProDescriptions 描述项配置 */
|
|
134
139
|
export interface ProDescriptionsSchema {
|
|
@@ -174,6 +179,12 @@ export interface DescriptionSchema {
|
|
|
174
179
|
slot?: string;
|
|
175
180
|
/** 自定义渲染 */
|
|
176
181
|
render?: (value: unknown, record: Record<string, unknown>) => VNode | string | number | null | undefined;
|
|
182
|
+
/** 描述项 value 的 tooltip,true 时默认展示当前值,支持函数动态返回 */
|
|
183
|
+
tooltip?: boolean | string | Record<string, unknown> | ((params: {
|
|
184
|
+
value: unknown;
|
|
185
|
+
record: Record<string, unknown>;
|
|
186
|
+
schema: DescriptionSchema;
|
|
187
|
+
}) => boolean | string | Record<string, unknown>);
|
|
177
188
|
}
|
|
178
189
|
/** Description Props */
|
|
179
190
|
export interface DescriptionProps {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 进位方式:向下取整、向上取整、四舍五入 */
|
|
2
|
+
export type FormattedNumberRounding = 'floor' | 'ceil' | 'round';
|
|
3
|
+
/** 仅保留数字、至多一个小数点、可选前导负号 */
|
|
4
|
+
export declare function sanitizeNumericInput(raw: string): string;
|
|
5
|
+
export declare function stripNumberGrouping(s: string): string;
|
|
6
|
+
/** 按整数位数上限约束绝对值 */
|
|
7
|
+
export declare function clampByIntegerDigits(value: number, integerDigits: number, decimalPlaces: number): number;
|
|
8
|
+
export declare function roundToDecimals(value: number, decimalPlaces: number, rounding: FormattedNumberRounding): number;
|
|
9
|
+
/**
|
|
10
|
+
* 解析 → 按整数位夹紧 → 按小数位与进位方式舍入 → 再夹紧(防止舍入后越界)
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeNumericValue(value: number, integerDigits: number, decimalPlaces: number, rounding: FormattedNumberRounding): number;
|
|
13
|
+
/** 千分位格式化展示(整数部分),小数部分固定 m 位 */
|
|
14
|
+
export declare function formatWithThousands(value: number, decimalPlaces: number): string;
|
|
15
|
+
/** 编辑态:无千分位,去掉多余尾部 0(在 m 位精度内) */
|
|
16
|
+
export declare function numberToEditString(value: number, decimalPlaces: number): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type TooltipValue = boolean | string | Record<string, unknown>;
|
|
2
|
+
export declare const hasTooltipContent: (value: unknown) => boolean;
|
|
3
|
+
export declare const getTooltipContent: (value: unknown) => string;
|
|
4
|
+
export declare const normalizeTooltipConfig: (tooltip: TooltipValue | null | undefined, fallbackValue?: unknown) => Record<string, unknown> | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aspire-ui/element-component-pro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.08",
|
|
4
4
|
"description": "Element UI 二次封装组件库,基于 Vue 2.7 + TypeScript + setup 语法糖,实现 VbenAdmin 风格的 Pro 组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/element-component-pro.umd.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@vitejs/plugin-vue2": "^2.3.1",
|
|
34
34
|
"element-ui": "^2.15.14",
|
|
35
|
+
"marked": "^9.1.6",
|
|
35
36
|
"playwright": "^1.40.0",
|
|
36
37
|
"typescript": "^5.3.0",
|
|
37
38
|
"vite": "^4.5.0",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
<script setup lang="ts">
|
|
73
73
|
import { computed, defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
74
74
|
import { useComponentSetting } from '../useComponentSetting'
|
|
75
|
+
import { normalizeTooltipConfig } from '../utils/tooltip'
|
|
75
76
|
import type {
|
|
76
77
|
DescriptionActionType,
|
|
77
78
|
DescriptionColumn,
|
|
@@ -139,30 +140,47 @@ const DescriptionValueRenderer = defineComponent({
|
|
|
139
140
|
const record = rendererProps.record as Record<string, unknown>
|
|
140
141
|
const value = rendererProps.value
|
|
141
142
|
|
|
143
|
+
const renderTextNode = (text: string) => {
|
|
144
|
+
const tooltipProps = normalizeTooltip(schema, text === rendererProps.emptyText ? value : text, record)
|
|
145
|
+
const contentNode = h('span', text)
|
|
146
|
+
if (!tooltipProps) return contentNode
|
|
147
|
+
return h('el-tooltip', { props: tooltipProps }, [contentNode])
|
|
148
|
+
}
|
|
149
|
+
|
|
142
150
|
if (schema.render) {
|
|
143
151
|
const rendered = schema.render(value, record)
|
|
144
|
-
if (rendered == null || rendered === '') return
|
|
145
|
-
if (typeof rendered === 'string' || typeof rendered === 'number') return
|
|
152
|
+
if (rendered == null || rendered === '') return renderTextNode(rendererProps.emptyText)
|
|
153
|
+
if (typeof rendered === 'string' || typeof rendered === 'number') return renderTextNode(String(rendered))
|
|
146
154
|
return rendered as never
|
|
147
155
|
}
|
|
148
156
|
|
|
149
157
|
if (Array.isArray(value)) {
|
|
150
|
-
return
|
|
158
|
+
return renderTextNode(value.length ? value.join(', ') : rendererProps.emptyText)
|
|
151
159
|
}
|
|
152
160
|
|
|
153
161
|
if (value === null || value === undefined || value === '') {
|
|
154
|
-
return
|
|
162
|
+
return renderTextNode(rendererProps.emptyText)
|
|
155
163
|
}
|
|
156
164
|
|
|
157
165
|
if (typeof value === 'object') {
|
|
158
|
-
return
|
|
166
|
+
return renderTextNode(JSON.stringify(value))
|
|
159
167
|
}
|
|
160
168
|
|
|
161
|
-
return
|
|
169
|
+
return renderTextNode(String(value))
|
|
162
170
|
}
|
|
163
171
|
},
|
|
164
172
|
})
|
|
165
173
|
|
|
174
|
+
const normalizeTooltip = (schema: DescriptionSchema, value: unknown, record: Record<string, unknown>) => {
|
|
175
|
+
const tooltip = schema.tooltip
|
|
176
|
+
if (!tooltip) return null
|
|
177
|
+
|
|
178
|
+
const resolved = typeof tooltip === 'function'
|
|
179
|
+
? tooltip({ value, record, schema })
|
|
180
|
+
: tooltip
|
|
181
|
+
return normalizeTooltipConfig(resolved, value)
|
|
182
|
+
}
|
|
183
|
+
|
|
166
184
|
const { getSetting } = useComponentSetting()
|
|
167
185
|
const effectiveProps = computed(() => ({ ...getSetting('ProDescriptions'), ...props, ...innerProps.value }))
|
|
168
186
|
|