@aspire-ui/element-component-pro 1.0.6 → 1.0.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/README.md +21 -0
- package/dist/ProForm/ProForm.vue.d.ts +7 -0
- package/dist/ProForm/ProFormItem.vue.d.ts +2 -0
- package/dist/element-component-pro.es.js +758 -723
- 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 +52 -24
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +11 -0
- package/dist/utils/tooltip.d.ts +4 -0
- package/package.json +2 -1
- package/src/ProDescriptions/ProDescriptions.vue +24 -6
- package/src/ProForm/ProForm.vue +3 -1
- package/src/ProForm/ProFormItem.vue +144 -123
- package/src/ProTable/TableAction.vue +2 -5
- package/src/types/index.ts +7 -0
- package/src/utils/tooltip.ts +56 -0
- package/src/vite-env.d.ts +5 -0
package/dist/index.d.ts
CHANGED
|
@@ -1307,6 +1307,9 @@ declare const _default: {
|
|
|
1307
1307
|
};
|
|
1308
1308
|
});
|
|
1309
1309
|
ProForm: import('vue/types/v3-component-public-instance').ComponentPublicInstanceConstructor<import('vue/types/v3-component-public-instance').Vue3Instance<{}, Readonly<import('vue').ExtractPropTypes<{
|
|
1310
|
+
disabled: {
|
|
1311
|
+
type: import('vue').PropType<boolean>;
|
|
1312
|
+
};
|
|
1310
1313
|
size: {
|
|
1311
1314
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1312
1315
|
default: string;
|
|
@@ -1314,9 +1317,6 @@ declare const _default: {
|
|
|
1314
1317
|
components: {
|
|
1315
1318
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1316
1319
|
};
|
|
1317
|
-
disabled: {
|
|
1318
|
-
type: import('vue').PropType<boolean>;
|
|
1319
|
-
};
|
|
1320
1320
|
showActionButtonGroup: {
|
|
1321
1321
|
type: import('vue').PropType<boolean>;
|
|
1322
1322
|
default: boolean;
|
|
@@ -1359,6 +1359,10 @@ declare const _default: {
|
|
|
1359
1359
|
xl: number;
|
|
1360
1360
|
};
|
|
1361
1361
|
};
|
|
1362
|
+
colon: {
|
|
1363
|
+
type: import('vue').PropType<boolean>;
|
|
1364
|
+
default: boolean;
|
|
1365
|
+
};
|
|
1362
1366
|
schemas: {
|
|
1363
1367
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1364
1368
|
};
|
|
@@ -1373,7 +1377,7 @@ declare const _default: {
|
|
|
1373
1377
|
default: string;
|
|
1374
1378
|
};
|
|
1375
1379
|
labelPosition: {
|
|
1376
|
-
type: import('vue').PropType<"
|
|
1380
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1377
1381
|
default: string;
|
|
1378
1382
|
};
|
|
1379
1383
|
gutter: {
|
|
@@ -1419,6 +1423,9 @@ declare const _default: {
|
|
|
1419
1423
|
type: import('vue').PropType<import('./types').FormListeners>;
|
|
1420
1424
|
};
|
|
1421
1425
|
}>>, Readonly<import('vue').ExtractPropTypes<{
|
|
1426
|
+
disabled: {
|
|
1427
|
+
type: import('vue').PropType<boolean>;
|
|
1428
|
+
};
|
|
1422
1429
|
size: {
|
|
1423
1430
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1424
1431
|
default: string;
|
|
@@ -1426,9 +1433,6 @@ declare const _default: {
|
|
|
1426
1433
|
components: {
|
|
1427
1434
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1428
1435
|
};
|
|
1429
|
-
disabled: {
|
|
1430
|
-
type: import('vue').PropType<boolean>;
|
|
1431
|
-
};
|
|
1432
1436
|
showActionButtonGroup: {
|
|
1433
1437
|
type: import('vue').PropType<boolean>;
|
|
1434
1438
|
default: boolean;
|
|
@@ -1471,6 +1475,10 @@ declare const _default: {
|
|
|
1471
1475
|
xl: number;
|
|
1472
1476
|
};
|
|
1473
1477
|
};
|
|
1478
|
+
colon: {
|
|
1479
|
+
type: import('vue').PropType<boolean>;
|
|
1480
|
+
default: boolean;
|
|
1481
|
+
};
|
|
1474
1482
|
schemas: {
|
|
1475
1483
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1476
1484
|
};
|
|
@@ -1485,7 +1493,7 @@ declare const _default: {
|
|
|
1485
1493
|
default: string;
|
|
1486
1494
|
};
|
|
1487
1495
|
labelPosition: {
|
|
1488
|
-
type: import('vue').PropType<"
|
|
1496
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1489
1497
|
default: string;
|
|
1490
1498
|
};
|
|
1491
1499
|
gutter: {
|
|
@@ -1546,6 +1554,7 @@ declare const _default: {
|
|
|
1546
1554
|
resetButtonIcon: string;
|
|
1547
1555
|
showAdvancedButton: boolean;
|
|
1548
1556
|
actionColOptions: import('./types').ColEx;
|
|
1557
|
+
colon: boolean;
|
|
1549
1558
|
labelWidth: string;
|
|
1550
1559
|
labelPosition: "left" | "right" | "top";
|
|
1551
1560
|
gutter: number;
|
|
@@ -1555,6 +1564,9 @@ declare const _default: {
|
|
|
1555
1564
|
alwaysShowLines: number;
|
|
1556
1565
|
submitOnReset: boolean;
|
|
1557
1566
|
}, true, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import('vue').ExtractPropTypes<{
|
|
1567
|
+
disabled: {
|
|
1568
|
+
type: import('vue').PropType<boolean>;
|
|
1569
|
+
};
|
|
1558
1570
|
size: {
|
|
1559
1571
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1560
1572
|
default: string;
|
|
@@ -1562,9 +1574,6 @@ declare const _default: {
|
|
|
1562
1574
|
components: {
|
|
1563
1575
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1564
1576
|
};
|
|
1565
|
-
disabled: {
|
|
1566
|
-
type: import('vue').PropType<boolean>;
|
|
1567
|
-
};
|
|
1568
1577
|
showActionButtonGroup: {
|
|
1569
1578
|
type: import('vue').PropType<boolean>;
|
|
1570
1579
|
default: boolean;
|
|
@@ -1607,6 +1616,10 @@ declare const _default: {
|
|
|
1607
1616
|
xl: number;
|
|
1608
1617
|
};
|
|
1609
1618
|
};
|
|
1619
|
+
colon: {
|
|
1620
|
+
type: import('vue').PropType<boolean>;
|
|
1621
|
+
default: boolean;
|
|
1622
|
+
};
|
|
1610
1623
|
schemas: {
|
|
1611
1624
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1612
1625
|
};
|
|
@@ -1621,7 +1634,7 @@ declare const _default: {
|
|
|
1621
1634
|
default: string;
|
|
1622
1635
|
};
|
|
1623
1636
|
labelPosition: {
|
|
1624
|
-
type: import('vue').PropType<"
|
|
1637
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1625
1638
|
default: string;
|
|
1626
1639
|
};
|
|
1627
1640
|
gutter: {
|
|
@@ -1680,6 +1693,9 @@ declare const _default: {
|
|
|
1680
1693
|
removeSchemaByField: (field: string | string[]) => Promise<void>;
|
|
1681
1694
|
setProps: (props: Partial<import('./types').ProFormProps>) => Promise<void>;
|
|
1682
1695
|
}> & import('vue/types/v3-component-options').ExtractComputedReturns<{}> & import('vue').ComponentCustomProperties & Readonly<import('vue').ExtractPropTypes<{
|
|
1696
|
+
disabled: {
|
|
1697
|
+
type: import('vue').PropType<boolean>;
|
|
1698
|
+
};
|
|
1683
1699
|
size: {
|
|
1684
1700
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1685
1701
|
default: string;
|
|
@@ -1687,9 +1703,6 @@ declare const _default: {
|
|
|
1687
1703
|
components: {
|
|
1688
1704
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1689
1705
|
};
|
|
1690
|
-
disabled: {
|
|
1691
|
-
type: import('vue').PropType<boolean>;
|
|
1692
|
-
};
|
|
1693
1706
|
showActionButtonGroup: {
|
|
1694
1707
|
type: import('vue').PropType<boolean>;
|
|
1695
1708
|
default: boolean;
|
|
@@ -1732,6 +1745,10 @@ declare const _default: {
|
|
|
1732
1745
|
xl: number;
|
|
1733
1746
|
};
|
|
1734
1747
|
};
|
|
1748
|
+
colon: {
|
|
1749
|
+
type: import('vue').PropType<boolean>;
|
|
1750
|
+
default: boolean;
|
|
1751
|
+
};
|
|
1735
1752
|
schemas: {
|
|
1736
1753
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1737
1754
|
};
|
|
@@ -1746,7 +1763,7 @@ declare const _default: {
|
|
|
1746
1763
|
default: string;
|
|
1747
1764
|
};
|
|
1748
1765
|
labelPosition: {
|
|
1749
|
-
type: import('vue').PropType<"
|
|
1766
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1750
1767
|
default: string;
|
|
1751
1768
|
};
|
|
1752
1769
|
gutter: {
|
|
@@ -1792,6 +1809,9 @@ declare const _default: {
|
|
|
1792
1809
|
type: import('vue').PropType<import('./types').FormListeners>;
|
|
1793
1810
|
};
|
|
1794
1811
|
}>>> & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
1812
|
+
disabled: {
|
|
1813
|
+
type: import('vue').PropType<boolean>;
|
|
1814
|
+
};
|
|
1795
1815
|
size: {
|
|
1796
1816
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1797
1817
|
default: string;
|
|
@@ -1799,9 +1819,6 @@ declare const _default: {
|
|
|
1799
1819
|
components: {
|
|
1800
1820
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1801
1821
|
};
|
|
1802
|
-
disabled: {
|
|
1803
|
-
type: import('vue').PropType<boolean>;
|
|
1804
|
-
};
|
|
1805
1822
|
showActionButtonGroup: {
|
|
1806
1823
|
type: import('vue').PropType<boolean>;
|
|
1807
1824
|
default: boolean;
|
|
@@ -1844,6 +1861,10 @@ declare const _default: {
|
|
|
1844
1861
|
xl: number;
|
|
1845
1862
|
};
|
|
1846
1863
|
};
|
|
1864
|
+
colon: {
|
|
1865
|
+
type: import('vue').PropType<boolean>;
|
|
1866
|
+
default: boolean;
|
|
1867
|
+
};
|
|
1847
1868
|
schemas: {
|
|
1848
1869
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1849
1870
|
};
|
|
@@ -1858,7 +1879,7 @@ declare const _default: {
|
|
|
1858
1879
|
default: string;
|
|
1859
1880
|
};
|
|
1860
1881
|
labelPosition: {
|
|
1861
|
-
type: import('vue').PropType<"
|
|
1882
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
1862
1883
|
default: string;
|
|
1863
1884
|
};
|
|
1864
1885
|
gutter: {
|
|
@@ -1932,6 +1953,7 @@ declare const _default: {
|
|
|
1932
1953
|
resetButtonIcon: string;
|
|
1933
1954
|
showAdvancedButton: boolean;
|
|
1934
1955
|
actionColOptions: import('./types').ColEx;
|
|
1956
|
+
colon: boolean;
|
|
1935
1957
|
labelWidth: string;
|
|
1936
1958
|
labelPosition: "left" | "right" | "top";
|
|
1937
1959
|
gutter: number;
|
|
@@ -1942,6 +1964,9 @@ declare const _default: {
|
|
|
1942
1964
|
submitOnReset: boolean;
|
|
1943
1965
|
}> & {
|
|
1944
1966
|
props: {
|
|
1967
|
+
disabled: {
|
|
1968
|
+
type: import('vue').PropType<boolean>;
|
|
1969
|
+
};
|
|
1945
1970
|
size: {
|
|
1946
1971
|
type: import('vue').PropType<"medium" | "small" | "large">;
|
|
1947
1972
|
default: string;
|
|
@@ -1949,9 +1974,6 @@ declare const _default: {
|
|
|
1949
1974
|
components: {
|
|
1950
1975
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1951
1976
|
};
|
|
1952
|
-
disabled: {
|
|
1953
|
-
type: import('vue').PropType<boolean>;
|
|
1954
|
-
};
|
|
1955
1977
|
showActionButtonGroup: {
|
|
1956
1978
|
type: import('vue').PropType<boolean>;
|
|
1957
1979
|
default: boolean;
|
|
@@ -1994,6 +2016,10 @@ declare const _default: {
|
|
|
1994
2016
|
xl: number;
|
|
1995
2017
|
};
|
|
1996
2018
|
};
|
|
2019
|
+
colon: {
|
|
2020
|
+
type: import('vue').PropType<boolean>;
|
|
2021
|
+
default: boolean;
|
|
2022
|
+
};
|
|
1997
2023
|
schemas: {
|
|
1998
2024
|
type: import('vue').PropType<import('./types').ProFormSchema[]>;
|
|
1999
2025
|
};
|
|
@@ -2008,7 +2034,7 @@ declare const _default: {
|
|
|
2008
2034
|
default: string;
|
|
2009
2035
|
};
|
|
2010
2036
|
labelPosition: {
|
|
2011
|
-
type: import('vue').PropType<"
|
|
2037
|
+
type: import('vue').PropType<"top" | "left" | "right">;
|
|
2012
2038
|
default: string;
|
|
2013
2039
|
};
|
|
2014
2040
|
gutter: {
|
|
@@ -2061,6 +2087,7 @@ declare const _default: {
|
|
|
2061
2087
|
field: string;
|
|
2062
2088
|
label: string;
|
|
2063
2089
|
labelWidth?: string | undefined;
|
|
2090
|
+
colon?: boolean | undefined;
|
|
2064
2091
|
component?: (import('./types').ProFormBuiltInComponent | import('./types').ProFormCustomComponent) | undefined;
|
|
2065
2092
|
componentProps?: (Record<string, unknown> | ((params: import('./types').RenderCallbackParams & {
|
|
2066
2093
|
formActionType?: import('./types').FormActionType;
|
|
@@ -2090,6 +2117,7 @@ declare const _default: {
|
|
|
2090
2117
|
dependencies?: string[] | undefined;
|
|
2091
2118
|
helpMessage?: string | string[] | undefined;
|
|
2092
2119
|
helpComponentProps?: Record<string, unknown> | undefined;
|
|
2120
|
+
tooltip?: (boolean | string | Record<string, unknown> | ((params: import('./types').RenderCallbackParams) => boolean | string | Record<string, unknown>)) | undefined;
|
|
2093
2121
|
};
|
|
2094
2122
|
field: string;
|
|
2095
2123
|
values: Record<string, unknown>;
|
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-9514f173]{margin-right:2px}.ecp-pro-form-item__help-icon[data-v-9514f173]{margin-left:4px;color:#909399;cursor:help;font-size:14px}.ecp-pro-form-item__help-icon[data-v-9514f173]:hover{color:#409eff}.ecp-pro-form-item__help-item[data-v-9514f173]{margin-bottom:4px}.ecp-pro-form-item__help-item[data-v-9514f173]: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;
|
|
@@ -88,6 +89,8 @@ 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
96
|
* - 内置:'input' | 'select' | 'date-picker' | 'date-range' | 'input-number' | 'switch' | 'cascader' | 'checkbox' | 'radio'
|
|
@@ -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,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.07",
|
|
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
|
|
package/src/ProForm/ProForm.vue
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<el-col v-if="shouldShow(schema)" :key="schema.field" v-bind="getColProps(schema)"
|
|
10
10
|
:offset="schema.colProps?.offset ?? effectiveProps.baseColProps?.offset ?? 0" :data-field="schema.field">
|
|
11
11
|
<ProFormItem :schema="schema" :form-model="currentFormModel" :form-disabled="effectiveProps.disabled"
|
|
12
|
-
:auto-placeholder="effectiveProps.autoSetPlaceholder" :form-action-type="formActionRef"
|
|
12
|
+
:auto-placeholder="effectiveProps.autoSetPlaceholder" :form-action-type="formActionRef" :colon="effectiveProps.colon"
|
|
13
13
|
:custom-components="formCustomComponents" :on-field-change="handleFieldChange">
|
|
14
14
|
<template v-if="slots[getSlotName(schema)]">
|
|
15
15
|
<slot :name="getSlotName(schema)" :model="currentFormModel" :schema="schema" :field="schema.field"
|
|
@@ -69,6 +69,7 @@ const props = withDefaults(
|
|
|
69
69
|
initialValues?: Record<string, unknown>
|
|
70
70
|
labelWidth?: string
|
|
71
71
|
labelPosition?: 'left' | 'right' | 'top'
|
|
72
|
+
colon?: boolean
|
|
72
73
|
gutter?: number
|
|
73
74
|
size?: 'medium' | 'small' | 'large'
|
|
74
75
|
disabled?: boolean
|
|
@@ -96,6 +97,7 @@ const props = withDefaults(
|
|
|
96
97
|
{
|
|
97
98
|
labelWidth: '120px',
|
|
98
99
|
labelPosition: 'right',
|
|
100
|
+
colon: true,
|
|
99
101
|
gutter: 24,
|
|
100
102
|
size: 'medium',
|
|
101
103
|
autoSetPlaceholder: true,
|