@pisell/materials 1.0.472 → 1.0.474
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +18 -18
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +17 -17
- package/es/components/cardMetricItem/index.less +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/index.less +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +4 -3
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +41 -17
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +4 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +4 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +15 -0
- package/es/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
- package/es/components/dataSourceComponents/dataSourceShow/utils.js +82 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +33 -139
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +162 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +135 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +35 -39
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +65 -11
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +105 -6
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +245 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +41 -12
- package/es/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/index.js +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/index.less +5 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
- package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +23 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
- package/es/components/dataSourceComponents/dataSourceWrapper/index.js +17 -2
- package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +7 -1
- package/es/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
- package/es/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +7 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/index.js +5 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
- package/es/components/dataSourceComponents/fields/Input/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Email/WithMode.js +17 -0
- package/es/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Email/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Email/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
- package/es/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Json/WithMode.js +41 -1
- package/es/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +12 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/type.js +1 -0
- package/es/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +46 -5
- package/es/components/dataSourceComponents/fields/index.js +7 -2
- package/es/components/dataSourceComponents/fields/type.d.ts +18 -0
- package/es/components/dataSourceComponents/fields/type.js +1 -0
- package/es/components/dataSourceComponents/fields/utils.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/utils.js +111 -0
- package/es/components/dataSourceComponents/hooks/useActions.js +22 -7
- package/es/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
- package/es/components/dataSourceComponents/hooks/useComponentId.js +9 -0
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +37 -27
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +19 -13
- package/es/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
- package/es/components/dataSourceComponents/provider/variables/utils.js +9 -0
- package/es/components/filter/components/Dropdown/index.d.ts +1 -0
- package/es/components/filter/components/Dropdown/index.js +6 -2
- package/es/components/filter/components/FilterButton/index.js +5 -3
- package/es/components/filter/components/FilterButton/types.d.ts +2 -0
- package/es/components/pisellAnchor/index.less +77 -77
- package/es/components/pisellStatisticList/index.less +1 -1
- package/es/components/pisellWalletPassCard/index.js +3 -1
- package/es/components/pisellWalletPassCard/index.less +23 -9
- package/es/components/table/Actions/index.js +16 -7
- package/es/components/table/Gallery/index.d.ts +3 -3
- package/es/components/table/Gallery/index.js +25 -7
- package/es/components/table/Gallery/index.less +1 -0
- package/es/components/table/Header/index.d.ts +10 -3
- package/es/components/table/Header/index.js +37 -11
- package/es/components/table/Header/index.less +10 -2
- package/es/components/table/Table/utils.js +4 -0
- package/es/components/table/Tabs/index.d.ts +14 -0
- package/es/components/table/Tabs/index.js +37 -0
- package/es/components/table/hooks/useTriggerValuesChange.js +3 -0
- package/es/components/table/index.js +16 -3
- package/es/components/table/types.d.ts +14 -2
- package/es/components/typography/index.d.ts +2 -2
- package/es/components/typography/index.js +4 -3
- package/es/components/walletCard/index.d.ts +6 -4
- package/es/components/walletCard/index.js +34 -15
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/locales/en-US.d.ts +7 -0
- package/es/locales/en-US.js +16 -1
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +16 -1
- package/es/locales/zh-TW.d.ts +7 -0
- package/es/locales/zh-TW.js +16 -1
- package/lib/components/cardMetricItem/index.less +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/index.less +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +3 -2
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +58 -11
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +38 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +38 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +44 -0
- package/lib/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
- package/lib/components/dataSourceComponents/dataSourceShow/utils.js +95 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +29 -90
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +176 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +176 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +24 -37
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +53 -7
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +73 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +236 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +38 -11
- package/lib/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/index.js +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/index.less +5 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
- package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +51 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.js +14 -2
- package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +3 -1
- package/lib/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
- package/lib/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +41 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +42 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/index.js +39 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
- package/lib/components/dataSourceComponents/fields/Input/index.js +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.js +57 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.js +30 -2
- package/lib/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +43 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +46 -5
- package/lib/components/dataSourceComponents/fields/index.js +6 -1
- package/lib/components/dataSourceComponents/fields/type.d.ts +18 -0
- package/lib/components/dataSourceComponents/fields/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/utils.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/utils.js +134 -0
- package/lib/components/dataSourceComponents/hooks/useActions.js +14 -5
- package/lib/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
- package/lib/components/dataSourceComponents/hooks/useComponentId.js +32 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +29 -16
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +17 -8
- package/lib/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
- package/lib/components/dataSourceComponents/provider/variables/utils.js +15 -2
- package/lib/components/filter/components/Dropdown/index.d.ts +1 -0
- package/lib/components/filter/components/Dropdown/index.js +6 -2
- package/lib/components/filter/components/FilterButton/index.js +5 -3
- package/lib/components/filter/components/FilterButton/types.d.ts +2 -0
- package/lib/components/pisellAnchor/index.less +77 -77
- package/lib/components/pisellStatisticList/index.less +1 -1
- package/lib/components/pisellWalletPassCard/index.js +1 -1
- package/lib/components/pisellWalletPassCard/index.less +23 -9
- package/lib/components/table/Actions/index.js +18 -9
- package/lib/components/table/Gallery/index.d.ts +3 -3
- package/lib/components/table/Gallery/index.js +17 -0
- package/lib/components/table/Gallery/index.less +1 -0
- package/lib/components/table/Header/index.d.ts +10 -3
- package/lib/components/table/Header/index.js +29 -4
- package/lib/components/table/Header/index.less +10 -2
- package/lib/components/table/Table/utils.js +4 -0
- package/lib/components/table/Tabs/index.d.ts +14 -0
- package/lib/components/table/Tabs/index.js +70 -0
- package/lib/components/table/hooks/useTriggerValuesChange.js +3 -0
- package/lib/components/table/index.js +17 -2
- package/lib/components/table/types.d.ts +14 -2
- package/lib/components/typography/index.d.ts +2 -2
- package/lib/components/typography/index.js +4 -3
- package/lib/components/walletCard/index.d.ts +6 -4
- package/lib/components/walletCard/index.js +24 -13
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/locales/en-US.d.ts +7 -0
- package/lib/locales/en-US.js +8 -1
- package/lib/locales/zh-CN.d.ts +7 -0
- package/lib/locales/zh-CN.js +8 -1
- package/lib/locales/zh-TW.d.ts +7 -0
- package/lib/locales/zh-TW.js +8 -1
- package/lowcode/_utils/defaultSchema.ts +452 -83
- package/lowcode/_utils/type.ts +5 -0
- package/lowcode/_utils/utils.ts +1 -0
- package/lowcode/button/meta.ts +1 -2
- package/lowcode/data-source-form/constants.ts +5 -0
- package/lowcode/data-source-form/meta.ts +259 -273
- package/lowcode/data-source-form/snippets.ts +9 -0
- package/lowcode/data-source-form/utils.ts +80 -15
- package/lowcode/data-source-image/meta.ts +74 -0
- package/lowcode/data-source-image/snippets.ts +14 -0
- package/lowcode/data-source-qrcode/meta.ts +158 -0
- package/lowcode/data-source-qrcode/snippets.ts +20 -0
- package/lowcode/data-source-table/meta.ts +4577 -2285
- package/lowcode/data-source-table/snippets.ts +10 -4
- package/lowcode/data-source-table/utils.tsx +254 -0
- package/lowcode/data-source-typography/meta.ts +54 -0
- package/lowcode/data-source-typography.text/meta.ts +212 -0
- package/lowcode/data-source-typography.text/snippets.ts +12 -0
- package/lowcode/data-source-wrapper/meta.ts +243 -0
- package/lowcode/data-source-wrapper/snippets.ts +11 -0
- package/lowcode/data-source-wrapper/utils.ts +45 -0
- package/lowcode/form-item-color-picker/snippets.ts +1 -0
- package/lowcode/form-item-input/meta.ts +2 -1
- package/lowcode/form-item-input/snippets.ts +2 -1
- package/lowcode/form-item-input.email/meta.ts +284 -0
- package/lowcode/form-item-input.email/snippets.ts +35 -0
- package/lowcode/form-item-input.phone/meta.ts +295 -0
- package/lowcode/form-item-input.phone/snippets.ts +16 -0
- package/lowcode/form-item-input.text-area/meta.ts +243 -32
- package/lowcode/form-item-input.text-area/snippets.ts +2 -1
- package/lowcode/form-item-input.url/meta.ts +44 -20
- package/lowcode/form-item-input.url/snippets.ts +5 -5
- package/lowcode/table/snippets.ts +6 -0
- package/lowcode/test/meta.ts +1 -2
- package/package.json +4 -4
|
@@ -1,23 +1,27 @@
|
|
|
1
|
+
import { IPublicTypeTitleContent } from '@alilc/lowcode-types';
|
|
1
2
|
import {
|
|
2
3
|
getVariable,
|
|
3
4
|
getDataSourceValue,
|
|
4
5
|
setBatchVariables,
|
|
6
|
+
getCptValuesVariables,
|
|
5
7
|
} from '../data-source-form/utils';
|
|
6
8
|
|
|
7
9
|
// 获取表单容器组件
|
|
8
|
-
const getParentForm = (target: any) => {
|
|
10
|
+
export const getParentForm = (target: any) => {
|
|
9
11
|
let parent = target.node.parent;
|
|
10
|
-
while (
|
|
12
|
+
while (
|
|
13
|
+
!['DataSourceForm', 'DataSourceWrapper'].includes(parent.componentName)
|
|
14
|
+
) {
|
|
11
15
|
parent = parent.parent;
|
|
12
16
|
}
|
|
13
17
|
return parent;
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
// 获取dataSourceform 中使用的字段
|
|
17
|
-
const getDataSourceFormFields = (target: any) => {
|
|
18
|
-
const getFormItemFields = (node) => {
|
|
19
|
-
let fields = [];
|
|
20
|
-
node.children.forEach((child) => {
|
|
21
|
+
export const getDataSourceFormFields = (target: any) => {
|
|
22
|
+
const getFormItemFields = (node: any) => {
|
|
23
|
+
let fields: any[] = [];
|
|
24
|
+
node.children.forEach((child: any) => {
|
|
21
25
|
if (child.componentName.startsWith('FormItem')) {
|
|
22
26
|
fields.push(child.getProps().getPropValue('name'));
|
|
23
27
|
} else if (child.children) {
|
|
@@ -41,7 +45,11 @@ export const generalItemMap = {
|
|
|
41
45
|
'en-US': 'Title',
|
|
42
46
|
'zh-CN': '标题',
|
|
43
47
|
},
|
|
44
|
-
tip:
|
|
48
|
+
tip: {
|
|
49
|
+
type: 'i18n',
|
|
50
|
+
'en-US': 'The text displayed in the label of the form item, corresponding to Label.',
|
|
51
|
+
'zh-CN': '用于显示在表单项的标签文本,对应Label。',
|
|
52
|
+
},
|
|
45
53
|
},
|
|
46
54
|
propType: 'string',
|
|
47
55
|
setter: 'PisellI18nSetter',
|
|
@@ -54,26 +62,30 @@ export const generalItemMap = {
|
|
|
54
62
|
'en-US': 'Field',
|
|
55
63
|
'zh-CN': '字段',
|
|
56
64
|
},
|
|
57
|
-
tip:
|
|
65
|
+
tip: {
|
|
66
|
+
type: 'i18n',
|
|
67
|
+
'en-US': 'Field',
|
|
68
|
+
'zh-CN': '字段名',
|
|
69
|
+
},
|
|
58
70
|
},
|
|
59
71
|
isRequired: true,
|
|
60
72
|
propType: 'string',
|
|
61
73
|
setter: [
|
|
62
74
|
{
|
|
63
75
|
componentName: 'SelectSetter',
|
|
64
|
-
condition: (target) => {
|
|
76
|
+
condition: (target: any) => {
|
|
65
77
|
// 获取表单容器组件的currentFields
|
|
66
78
|
const fields = getVariable(getParentForm(target), 'currentFields');
|
|
67
79
|
// 如果fields存在且长度大于0,则显示选择器
|
|
68
80
|
return fields && fields.length > 0;
|
|
69
81
|
},
|
|
70
|
-
props: (target) => {
|
|
82
|
+
props: (target: any) => {
|
|
71
83
|
// 获取表单容器组件的currentFields
|
|
72
84
|
const fields = getVariable(getParentForm(target), 'currentFields');
|
|
73
85
|
// 已有字段key
|
|
74
86
|
const usedFields = getDataSourceFormFields(target);
|
|
75
87
|
|
|
76
|
-
const options = fields?.map?.((item) => ({
|
|
88
|
+
const options = fields?.map?.((item: any) => ({
|
|
77
89
|
title: item.uiSchema.title,
|
|
78
90
|
value: item.name,
|
|
79
91
|
disabled: usedFields.includes(item.name),
|
|
@@ -115,7 +127,11 @@ export const generalItemMap = {
|
|
|
115
127
|
'en-US': 'Tooltip',
|
|
116
128
|
'zh-CN': '提示',
|
|
117
129
|
},
|
|
118
|
-
tip:
|
|
130
|
+
tip: {
|
|
131
|
+
type: 'i18n',
|
|
132
|
+
'en-US': 'Tooltip',
|
|
133
|
+
'zh-CN': '标签提示信息,当需要对标签进行解释时,可以使用这个。',
|
|
134
|
+
},
|
|
119
135
|
},
|
|
120
136
|
propType: { type: 'oneOfType', value: ['string', 'node'] },
|
|
121
137
|
setter: ['PisellI18nSetter', 'SlotSetter'],
|
|
@@ -128,7 +144,11 @@ export const generalItemMap = {
|
|
|
128
144
|
'en-US': 'Show title area',
|
|
129
145
|
'zh-CN': '隐藏标题区域',
|
|
130
146
|
},
|
|
131
|
-
tip:
|
|
147
|
+
tip: {
|
|
148
|
+
type: 'i18n',
|
|
149
|
+
'en-US': 'Whether to hide the Label of the component, including title and tooltip, but not including helper text.',
|
|
150
|
+
'zh-CN': '是否隐藏组件的Label,包括title和tooltip,但是不包括helper text。',
|
|
151
|
+
},
|
|
132
152
|
},
|
|
133
153
|
propType: 'bool',
|
|
134
154
|
defaultValue: false,
|
|
@@ -143,7 +163,11 @@ export const generalItemMap = {
|
|
|
143
163
|
'en-US': 'Helper text',
|
|
144
164
|
'zh-CN': '辅助说明',
|
|
145
165
|
},
|
|
146
|
-
tip:
|
|
166
|
+
tip: {
|
|
167
|
+
type: 'i18n',
|
|
168
|
+
'en-US': 'Helper text',
|
|
169
|
+
'zh-CN': '在组件下方或上方显示的辅助说明文本。',
|
|
170
|
+
},
|
|
147
171
|
},
|
|
148
172
|
propType: { type: 'oneOfType', value: ['string', 'node'] },
|
|
149
173
|
setter: ['PisellI18nSetter', 'SlotSetter'],
|
|
@@ -156,7 +180,11 @@ export const generalItemMap = {
|
|
|
156
180
|
'en-US': 'Placeholder',
|
|
157
181
|
'zh-CN': '占位提示',
|
|
158
182
|
},
|
|
159
|
-
tip:
|
|
183
|
+
tip: {
|
|
184
|
+
type: 'i18n',
|
|
185
|
+
'en-US': 'Placeholder',
|
|
186
|
+
'zh-CN': '输入框为空时显示的提示文本。',
|
|
187
|
+
},
|
|
160
188
|
},
|
|
161
189
|
propType: 'string',
|
|
162
190
|
setter: 'PisellI18nSetter',
|
|
@@ -169,7 +197,11 @@ export const generalItemMap = {
|
|
|
169
197
|
'en-US': 'Status',
|
|
170
198
|
'zh-CN': '状态',
|
|
171
199
|
},
|
|
172
|
-
tip:
|
|
200
|
+
tip: {
|
|
201
|
+
type: 'i18n',
|
|
202
|
+
'en-US': 'Set the status of the form item.',
|
|
203
|
+
'zh-CN': '设置表单项的状态。',
|
|
204
|
+
},
|
|
173
205
|
},
|
|
174
206
|
setter: {
|
|
175
207
|
componentName: 'RadioGroupSetter',
|
|
@@ -209,14 +241,29 @@ export const generalItemMap = {
|
|
|
209
241
|
'en-US': 'Default value',
|
|
210
242
|
'zh-CN': '默认值',
|
|
211
243
|
},
|
|
212
|
-
tip:
|
|
244
|
+
tip: {
|
|
245
|
+
type: 'i18n',
|
|
246
|
+
'en-US': 'Default value',
|
|
247
|
+
'zh-CN': '默认值',
|
|
248
|
+
},
|
|
213
249
|
},
|
|
214
250
|
propType: 'string',
|
|
215
251
|
setter: 'StringSetter',
|
|
216
252
|
},
|
|
217
253
|
requiredobj: {
|
|
218
254
|
name: 'requiredobj',
|
|
219
|
-
title: {
|
|
255
|
+
title: {
|
|
256
|
+
label: {
|
|
257
|
+
type: 'i18n',
|
|
258
|
+
'en-US': 'Required',
|
|
259
|
+
'zh-CN': '必填',
|
|
260
|
+
},
|
|
261
|
+
tip: {
|
|
262
|
+
type: 'i18n',
|
|
263
|
+
'en-US': 'Required',
|
|
264
|
+
'zh-CN': '必填',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
220
267
|
setter: {
|
|
221
268
|
componentName: 'ObjectSetter',
|
|
222
269
|
props: {
|
|
@@ -224,14 +271,22 @@ export const generalItemMap = {
|
|
|
224
271
|
items: [
|
|
225
272
|
{
|
|
226
273
|
name: 'required',
|
|
227
|
-
title:
|
|
274
|
+
title: {
|
|
275
|
+
type: 'i18n',
|
|
276
|
+
'en-US': 'Required',
|
|
277
|
+
'zh-CN': '是否必填',
|
|
278
|
+
},
|
|
228
279
|
propType: 'bool',
|
|
229
280
|
setter: 'BoolSetter',
|
|
230
281
|
isRequired: true,
|
|
231
282
|
},
|
|
232
283
|
{
|
|
233
284
|
name: 'message',
|
|
234
|
-
title:
|
|
285
|
+
title: {
|
|
286
|
+
type: 'i18n',
|
|
287
|
+
'en-US': 'Error message',
|
|
288
|
+
'zh-CN': '错误信息提示',
|
|
289
|
+
},
|
|
235
290
|
propType: 'string',
|
|
236
291
|
setter: 'PisellI18nSetter',
|
|
237
292
|
},
|
|
@@ -245,7 +300,18 @@ export const generalItemMap = {
|
|
|
245
300
|
},
|
|
246
301
|
minLengthobj: {
|
|
247
302
|
name: 'minLengthobj',
|
|
248
|
-
title: {
|
|
303
|
+
title: {
|
|
304
|
+
label: {
|
|
305
|
+
type: 'i18n',
|
|
306
|
+
'en-US': 'Minimum length',
|
|
307
|
+
'zh-CN': '最小长度',
|
|
308
|
+
},
|
|
309
|
+
tip: {
|
|
310
|
+
type: 'i18n',
|
|
311
|
+
'en-US': 'Minimum length',
|
|
312
|
+
'zh-CN': '最小长度',
|
|
313
|
+
},
|
|
314
|
+
},
|
|
249
315
|
setter: {
|
|
250
316
|
componentName: 'ObjectSetter',
|
|
251
317
|
props: {
|
|
@@ -253,20 +319,32 @@ export const generalItemMap = {
|
|
|
253
319
|
items: [
|
|
254
320
|
{
|
|
255
321
|
name: 'enabled',
|
|
256
|
-
title:
|
|
322
|
+
title: {
|
|
323
|
+
type: 'i18n',
|
|
324
|
+
'en-US': 'Enabled',
|
|
325
|
+
'zh-CN': '是否启用',
|
|
326
|
+
},
|
|
257
327
|
propType: 'bool',
|
|
258
328
|
setter: 'BoolSetter',
|
|
259
329
|
isRequired: true,
|
|
260
330
|
},
|
|
261
331
|
{
|
|
262
332
|
name: 'min',
|
|
263
|
-
title:
|
|
333
|
+
title: {
|
|
334
|
+
type: 'i18n',
|
|
335
|
+
'en-US': 'Minimum length',
|
|
336
|
+
'zh-CN': '最小长度',
|
|
337
|
+
},
|
|
264
338
|
propType: 'number',
|
|
265
339
|
setter: 'NumberSetter',
|
|
266
340
|
},
|
|
267
341
|
{
|
|
268
342
|
name: 'message',
|
|
269
|
-
title:
|
|
343
|
+
title: {
|
|
344
|
+
type: 'i18n',
|
|
345
|
+
'en-US': 'Error message',
|
|
346
|
+
'zh-CN': '错误信息提示',
|
|
347
|
+
},
|
|
270
348
|
propType: 'string',
|
|
271
349
|
setter: 'PisellI18nSetter',
|
|
272
350
|
},
|
|
@@ -280,7 +358,18 @@ export const generalItemMap = {
|
|
|
280
358
|
},
|
|
281
359
|
maxLengthobj: {
|
|
282
360
|
name: 'maxLengthobj',
|
|
283
|
-
|
|
361
|
+
title: {
|
|
362
|
+
label: {
|
|
363
|
+
type: 'i18n',
|
|
364
|
+
'en-US': 'Maximum length',
|
|
365
|
+
'zh-CN': '最大长度',
|
|
366
|
+
},
|
|
367
|
+
tip: {
|
|
368
|
+
type: 'i18n',
|
|
369
|
+
'en-US': 'Maximum length',
|
|
370
|
+
'zh-CN': '最大长度',
|
|
371
|
+
},
|
|
372
|
+
},
|
|
284
373
|
setter: {
|
|
285
374
|
componentName: 'ObjectSetter',
|
|
286
375
|
props: {
|
|
@@ -288,20 +377,32 @@ export const generalItemMap = {
|
|
|
288
377
|
items: [
|
|
289
378
|
{
|
|
290
379
|
name: 'enabled',
|
|
291
|
-
title:
|
|
380
|
+
title: {
|
|
381
|
+
type: 'i18n',
|
|
382
|
+
'en-US': 'Enabled',
|
|
383
|
+
'zh-CN': '是否启用',
|
|
384
|
+
},
|
|
292
385
|
propType: 'bool',
|
|
293
386
|
setter: 'BoolSetter',
|
|
294
387
|
isRequired: true,
|
|
295
388
|
},
|
|
296
389
|
{
|
|
297
390
|
name: 'max',
|
|
298
|
-
title:
|
|
391
|
+
title: {
|
|
392
|
+
type: 'i18n',
|
|
393
|
+
'en-US': 'Maximum length',
|
|
394
|
+
'zh-CN': '最大长度',
|
|
395
|
+
},
|
|
299
396
|
propType: 'number',
|
|
300
397
|
setter: 'NumberSetter',
|
|
301
398
|
},
|
|
302
399
|
{
|
|
303
400
|
name: 'message',
|
|
304
|
-
title:
|
|
401
|
+
title: {
|
|
402
|
+
type: 'i18n',
|
|
403
|
+
'en-US': 'Error message',
|
|
404
|
+
'zh-CN': '错误信息提示',
|
|
405
|
+
},
|
|
305
406
|
propType: 'string',
|
|
306
407
|
setter: 'PisellI18nSetter',
|
|
307
408
|
},
|
|
@@ -315,7 +416,14 @@ export const generalItemMap = {
|
|
|
315
416
|
},
|
|
316
417
|
typeobj: {
|
|
317
418
|
name: 'typeobj',
|
|
318
|
-
title: {
|
|
419
|
+
title: {
|
|
420
|
+
label: {
|
|
421
|
+
type: 'i18n',
|
|
422
|
+
'en-US': 'Type validation',
|
|
423
|
+
'zh-CN': '类型校验',
|
|
424
|
+
},
|
|
425
|
+
tip: '类型校验',
|
|
426
|
+
},
|
|
319
427
|
setter: {
|
|
320
428
|
componentName: 'ObjectSetter',
|
|
321
429
|
props: {
|
|
@@ -323,14 +431,22 @@ export const generalItemMap = {
|
|
|
323
431
|
items: [
|
|
324
432
|
{
|
|
325
433
|
name: 'enabled',
|
|
326
|
-
title:
|
|
434
|
+
title: {
|
|
435
|
+
type: 'i18n',
|
|
436
|
+
'en-US': 'Enabled',
|
|
437
|
+
'zh-CN': '是否启用',
|
|
438
|
+
},
|
|
327
439
|
propType: 'bool',
|
|
328
440
|
setter: 'BoolSetter',
|
|
329
441
|
isRequired: true,
|
|
330
442
|
},
|
|
331
443
|
{
|
|
332
444
|
name: 'type',
|
|
333
|
-
title:
|
|
445
|
+
title: {
|
|
446
|
+
type: 'i18n',
|
|
447
|
+
'en-US': 'Type',
|
|
448
|
+
'zh-CN': '类型',
|
|
449
|
+
},
|
|
334
450
|
propType: 'string',
|
|
335
451
|
setter: {
|
|
336
452
|
componentName: 'SelectSetter',
|
|
@@ -345,7 +461,11 @@ export const generalItemMap = {
|
|
|
345
461
|
},
|
|
346
462
|
{
|
|
347
463
|
name: 'message',
|
|
348
|
-
title:
|
|
464
|
+
title: {
|
|
465
|
+
type: 'i18n',
|
|
466
|
+
'en-US': 'Error message',
|
|
467
|
+
'zh-CN': '错误信息提示',
|
|
468
|
+
},
|
|
349
469
|
propType: 'string',
|
|
350
470
|
setter: 'PisellI18nSetter',
|
|
351
471
|
},
|
|
@@ -359,7 +479,14 @@ export const generalItemMap = {
|
|
|
359
479
|
},
|
|
360
480
|
maxobj: {
|
|
361
481
|
name: 'maxobj',
|
|
362
|
-
title: {
|
|
482
|
+
title: {
|
|
483
|
+
label: {
|
|
484
|
+
type: 'i18n',
|
|
485
|
+
'en-US': 'Maximum value validation',
|
|
486
|
+
'zh-CN': '最大值校验设置',
|
|
487
|
+
},
|
|
488
|
+
tip: '最大值校验设置',
|
|
489
|
+
},
|
|
363
490
|
setter: {
|
|
364
491
|
componentName: 'ObjectSetter',
|
|
365
492
|
props: {
|
|
@@ -367,20 +494,32 @@ export const generalItemMap = {
|
|
|
367
494
|
items: [
|
|
368
495
|
{
|
|
369
496
|
name: 'enabled',
|
|
370
|
-
title:
|
|
497
|
+
title: {
|
|
498
|
+
type: 'i18n',
|
|
499
|
+
'en-US': 'Enabled',
|
|
500
|
+
'zh-CN': '是否启用',
|
|
501
|
+
},
|
|
371
502
|
propType: 'bool',
|
|
372
503
|
setter: 'BoolSetter',
|
|
373
504
|
isRequired: true,
|
|
374
505
|
},
|
|
375
506
|
{
|
|
376
507
|
name: 'max',
|
|
377
|
-
title:
|
|
508
|
+
title: {
|
|
509
|
+
type: 'i18n',
|
|
510
|
+
'en-US': 'Maximum value',
|
|
511
|
+
'zh-CN': '最大值',
|
|
512
|
+
},
|
|
378
513
|
propType: 'number',
|
|
379
514
|
setter: 'NumberSetter',
|
|
380
515
|
},
|
|
381
516
|
{
|
|
382
517
|
name: 'message',
|
|
383
|
-
title:
|
|
518
|
+
title: {
|
|
519
|
+
type: 'i18n',
|
|
520
|
+
'en-US': 'Error message',
|
|
521
|
+
'zh-CN': '错误信息提示',
|
|
522
|
+
},
|
|
384
523
|
propType: 'string',
|
|
385
524
|
setter: 'PisellI18nSetter',
|
|
386
525
|
},
|
|
@@ -394,7 +533,14 @@ export const generalItemMap = {
|
|
|
394
533
|
},
|
|
395
534
|
minobj: {
|
|
396
535
|
name: 'minobj',
|
|
397
|
-
title: {
|
|
536
|
+
title: {
|
|
537
|
+
label: {
|
|
538
|
+
type: 'i18n',
|
|
539
|
+
'en-US': 'Minimum value validation',
|
|
540
|
+
'zh-CN': '最小值校验设置',
|
|
541
|
+
},
|
|
542
|
+
tip: '最小值校验设置',
|
|
543
|
+
},
|
|
398
544
|
setter: {
|
|
399
545
|
componentName: 'ObjectSetter',
|
|
400
546
|
props: {
|
|
@@ -402,20 +548,32 @@ export const generalItemMap = {
|
|
|
402
548
|
items: [
|
|
403
549
|
{
|
|
404
550
|
name: 'enabled',
|
|
405
|
-
title:
|
|
551
|
+
title: {
|
|
552
|
+
type: 'i18n',
|
|
553
|
+
'en-US': 'Enabled',
|
|
554
|
+
'zh-CN': '是否启用',
|
|
555
|
+
},
|
|
406
556
|
propType: 'bool',
|
|
407
557
|
setter: 'BoolSetter',
|
|
408
558
|
isRequired: true,
|
|
409
559
|
},
|
|
410
560
|
{
|
|
411
561
|
name: 'min',
|
|
412
|
-
title:
|
|
562
|
+
title: {
|
|
563
|
+
type: 'i18n',
|
|
564
|
+
'en-US': 'Minimum value',
|
|
565
|
+
'zh-CN': '最小值',
|
|
566
|
+
},
|
|
413
567
|
propType: 'number',
|
|
414
568
|
setter: 'NumberSetter',
|
|
415
569
|
},
|
|
416
570
|
{
|
|
417
571
|
name: 'message',
|
|
418
|
-
title:
|
|
572
|
+
title: {
|
|
573
|
+
type: 'i18n',
|
|
574
|
+
'en-US': 'Error message',
|
|
575
|
+
'zh-CN': '错误信息提示',
|
|
576
|
+
},
|
|
419
577
|
propType: 'string',
|
|
420
578
|
setter: 'PisellI18nSetter',
|
|
421
579
|
},
|
|
@@ -507,7 +665,7 @@ export const formItemGeneralOptionTypeGroup = {
|
|
|
507
665
|
},
|
|
508
666
|
{
|
|
509
667
|
name: 'dataSource',
|
|
510
|
-
condition: (target) => {
|
|
668
|
+
condition: (target: any) => {
|
|
511
669
|
const optionType = target.getProps().getPropValue('optionSourceType');
|
|
512
670
|
return optionType === 'api';
|
|
513
671
|
},
|
|
@@ -543,7 +701,7 @@ export const formItemGeneralOptionTypeGroup = {
|
|
|
543
701
|
},
|
|
544
702
|
{
|
|
545
703
|
name: 'labelField',
|
|
546
|
-
condition: (target) => {
|
|
704
|
+
condition: (target: any) => {
|
|
547
705
|
const optionSourceType = target
|
|
548
706
|
.getProps()
|
|
549
707
|
.getPropValue('optionSourceType');
|
|
@@ -556,10 +714,10 @@ export const formItemGeneralOptionTypeGroup = {
|
|
|
556
714
|
},
|
|
557
715
|
setter: {
|
|
558
716
|
componentName: 'SelectSetter',
|
|
559
|
-
props: (target) => {
|
|
717
|
+
props: (target: any) => {
|
|
560
718
|
const fields = getVariable(target, 'currentFields');
|
|
561
719
|
return {
|
|
562
|
-
options: fields?.map?.((item) => ({
|
|
720
|
+
options: fields?.map?.((item: any) => ({
|
|
563
721
|
title: item.uiSchema.title,
|
|
564
722
|
value: item.name,
|
|
565
723
|
})),
|
|
@@ -569,7 +727,7 @@ export const formItemGeneralOptionTypeGroup = {
|
|
|
569
727
|
},
|
|
570
728
|
{
|
|
571
729
|
name: 'valueField',
|
|
572
|
-
condition: (target) => {
|
|
730
|
+
condition: (target: any) => {
|
|
573
731
|
const optionSourceType = target
|
|
574
732
|
.getProps()
|
|
575
733
|
.getPropValue('optionSourceType');
|
|
@@ -582,11 +740,11 @@ export const formItemGeneralOptionTypeGroup = {
|
|
|
582
740
|
},
|
|
583
741
|
setter: {
|
|
584
742
|
componentName: 'SelectSetter',
|
|
585
|
-
props: (target) => {
|
|
743
|
+
props: (target: any) => {
|
|
586
744
|
// 获取表单容器组件的currentFields
|
|
587
745
|
const fields = getVariable(target, 'currentFields');
|
|
588
746
|
|
|
589
|
-
const options = fields?.map?.((item) => ({
|
|
747
|
+
const options = fields?.map?.((item: any) => ({
|
|
590
748
|
title: item.uiSchema.title,
|
|
591
749
|
value: item.name,
|
|
592
750
|
}));
|
|
@@ -600,7 +758,7 @@ export const formItemGeneralOptionTypeGroup = {
|
|
|
600
758
|
},
|
|
601
759
|
{
|
|
602
760
|
name: 'options',
|
|
603
|
-
condition: (target) => {
|
|
761
|
+
condition: (target: any) => {
|
|
604
762
|
const optionSourceType = target
|
|
605
763
|
.getProps()
|
|
606
764
|
.getPropValue('optionSourceType');
|
|
@@ -613,7 +771,7 @@ export const formItemGeneralOptionTypeGroup = {
|
|
|
613
771
|
},
|
|
614
772
|
setter: {
|
|
615
773
|
componentName: 'ArraySetter',
|
|
616
|
-
props: (target) => {
|
|
774
|
+
props: (target: any) => {
|
|
617
775
|
const optionSourceType = target
|
|
618
776
|
.getProps()
|
|
619
777
|
.getPropValue('optionSourceType');
|
|
@@ -705,32 +863,48 @@ export const formItemGeneralProps = [
|
|
|
705
863
|
'en-US': 'Title',
|
|
706
864
|
'zh-CN': '标题',
|
|
707
865
|
},
|
|
708
|
-
tip:
|
|
866
|
+
tip: {
|
|
867
|
+
type: 'i18n',
|
|
868
|
+
'en-US':
|
|
869
|
+
'Used to display the label text in the form item, corresponding to Label.',
|
|
870
|
+
'zh-CN': '用于显示在表单项的标签文本,对应Label。',
|
|
871
|
+
},
|
|
709
872
|
},
|
|
710
873
|
propType: 'string',
|
|
711
874
|
setter: 'PisellI18nSetter',
|
|
712
875
|
},
|
|
713
876
|
{
|
|
714
877
|
name: 'name',
|
|
715
|
-
title: {
|
|
878
|
+
title: {
|
|
879
|
+
label: {
|
|
880
|
+
type: 'i18n',
|
|
881
|
+
'en-US': 'Field name',
|
|
882
|
+
'zh-CN': '字段名',
|
|
883
|
+
},
|
|
884
|
+
tip: {
|
|
885
|
+
type: 'i18n',
|
|
886
|
+
'en-US': 'Field name',
|
|
887
|
+
'zh-CN': '字段名',
|
|
888
|
+
},
|
|
889
|
+
},
|
|
716
890
|
isRequired: true,
|
|
717
891
|
propType: 'string',
|
|
718
892
|
setter: [
|
|
719
893
|
{
|
|
720
894
|
componentName: 'SelectSetter',
|
|
721
|
-
condition: (target) => {
|
|
895
|
+
condition: (target: any) => {
|
|
722
896
|
// 获取表单容器组件的currentFields
|
|
723
897
|
const fields = getVariable(getParentForm(target), 'currentFields');
|
|
724
898
|
// 如果fields存在且长度大于0,则显示选择器
|
|
725
899
|
return fields && fields.length > 0;
|
|
726
900
|
},
|
|
727
|
-
props: (target) => {
|
|
901
|
+
props: (target: any) => {
|
|
728
902
|
// 获取表单容器组件的currentFields
|
|
729
903
|
const fields = getVariable(getParentForm(target), 'currentFields');
|
|
730
904
|
// 已有字段key
|
|
731
905
|
const usedFields = getDataSourceFormFields(target);
|
|
732
906
|
|
|
733
|
-
const options = fields?.map?.((item) => ({
|
|
907
|
+
const options = fields?.map?.((item: any) => ({
|
|
734
908
|
title: item.uiSchema.title,
|
|
735
909
|
value: item.name,
|
|
736
910
|
disabled: usedFields.includes(item.name),
|
|
@@ -772,7 +946,12 @@ export const formItemGeneralProps = [
|
|
|
772
946
|
'en-US': 'Tooltip',
|
|
773
947
|
'zh-CN': '提示',
|
|
774
948
|
},
|
|
775
|
-
tip:
|
|
949
|
+
tip: {
|
|
950
|
+
type: 'i18n',
|
|
951
|
+
'en-US':
|
|
952
|
+
'Tooltip information for the label, used when you need to explain the label.',
|
|
953
|
+
'zh-CN': '标签提示信息,当需要对标签进行解释时,可以使用这个。',
|
|
954
|
+
},
|
|
776
955
|
},
|
|
777
956
|
propType: { type: 'oneOfType', value: ['string', 'node'] },
|
|
778
957
|
setter: ['PisellI18nSetter', 'SlotSetter'],
|
|
@@ -785,7 +964,13 @@ export const formItemGeneralProps = [
|
|
|
785
964
|
'en-US': 'Show title area',
|
|
786
965
|
'zh-CN': '隐藏标题区域',
|
|
787
966
|
},
|
|
788
|
-
tip:
|
|
967
|
+
tip: {
|
|
968
|
+
type: 'i18n',
|
|
969
|
+
'en-US':
|
|
970
|
+
'Whether to hide the Label area of the component, including title and tooltip, but not including helper text.',
|
|
971
|
+
'zh-CN':
|
|
972
|
+
'是否隐藏组件的Label,包括title和tooltip,但是不包括helper text。',
|
|
973
|
+
},
|
|
789
974
|
},
|
|
790
975
|
propType: 'bool',
|
|
791
976
|
defaultValue: false,
|
|
@@ -800,7 +985,11 @@ export const formItemGeneralProps = [
|
|
|
800
985
|
'en-US': 'Helper text',
|
|
801
986
|
'zh-CN': '辅助说明',
|
|
802
987
|
},
|
|
803
|
-
tip:
|
|
988
|
+
tip: {
|
|
989
|
+
type: 'i18n',
|
|
990
|
+
'en-US': 'Helper text displayed below or above the component.',
|
|
991
|
+
'zh-CN': '在组件下方或上方显示的辅助说明文本。',
|
|
992
|
+
},
|
|
804
993
|
},
|
|
805
994
|
propType: { type: 'oneOfType', value: ['string', 'node'] },
|
|
806
995
|
setter: ['PisellI18nSetter', 'SlotSetter'],
|
|
@@ -813,7 +1002,11 @@ export const formItemGeneralProps = [
|
|
|
813
1002
|
'en-US': 'Placeholder',
|
|
814
1003
|
'zh-CN': '占位提示',
|
|
815
1004
|
},
|
|
816
|
-
tip:
|
|
1005
|
+
tip: {
|
|
1006
|
+
type: 'i18n',
|
|
1007
|
+
'en-US': 'Placeholder text displayed when the input field is empty.',
|
|
1008
|
+
'zh-CN': '输入框为空时显示的提示文本。',
|
|
1009
|
+
},
|
|
817
1010
|
},
|
|
818
1011
|
propType: 'string',
|
|
819
1012
|
setter: 'PisellI18nSetter',
|
|
@@ -826,7 +1019,11 @@ export const formItemGeneralProps = [
|
|
|
826
1019
|
'en-US': 'Status',
|
|
827
1020
|
'zh-CN': '状态',
|
|
828
1021
|
},
|
|
829
|
-
tip:
|
|
1022
|
+
tip: {
|
|
1023
|
+
type: 'i18n',
|
|
1024
|
+
'en-US': 'Set the status of the form item.',
|
|
1025
|
+
'zh-CN': '设置表单项的状态。',
|
|
1026
|
+
},
|
|
830
1027
|
},
|
|
831
1028
|
setter: {
|
|
832
1029
|
componentName: 'RadioGroupSetter',
|
|
@@ -866,7 +1063,11 @@ export const formItemGeneralProps = [
|
|
|
866
1063
|
'en-US': 'Default value',
|
|
867
1064
|
'zh-CN': '默认值',
|
|
868
1065
|
},
|
|
869
|
-
tip:
|
|
1066
|
+
tip: {
|
|
1067
|
+
type: 'i18n',
|
|
1068
|
+
'en-US': 'Default value',
|
|
1069
|
+
'zh-CN': '默认值',
|
|
1070
|
+
},
|
|
870
1071
|
},
|
|
871
1072
|
propType: 'string',
|
|
872
1073
|
setter: 'StringSetter',
|
|
@@ -882,7 +1083,18 @@ export const formItemGeneralProps = [
|
|
|
882
1083
|
items: [
|
|
883
1084
|
{
|
|
884
1085
|
name: 'requiredobj',
|
|
885
|
-
title: {
|
|
1086
|
+
title: {
|
|
1087
|
+
label: {
|
|
1088
|
+
type: 'i18n',
|
|
1089
|
+
'en-US': 'Required',
|
|
1090
|
+
'zh-CN': '必填',
|
|
1091
|
+
},
|
|
1092
|
+
tip: {
|
|
1093
|
+
type: 'i18n',
|
|
1094
|
+
'en-US': 'Required',
|
|
1095
|
+
'zh-CN': '必填',
|
|
1096
|
+
},
|
|
1097
|
+
},
|
|
886
1098
|
setter: {
|
|
887
1099
|
componentName: 'ObjectSetter',
|
|
888
1100
|
props: {
|
|
@@ -890,14 +1102,22 @@ export const formItemGeneralProps = [
|
|
|
890
1102
|
items: [
|
|
891
1103
|
{
|
|
892
1104
|
name: 'required',
|
|
893
|
-
title:
|
|
1105
|
+
title: {
|
|
1106
|
+
type: 'i18n',
|
|
1107
|
+
'en-US': 'Required',
|
|
1108
|
+
'zh-CN': '是否必填',
|
|
1109
|
+
},
|
|
894
1110
|
propType: 'bool',
|
|
895
1111
|
setter: 'BoolSetter',
|
|
896
1112
|
isRequired: true,
|
|
897
1113
|
},
|
|
898
1114
|
{
|
|
899
1115
|
name: 'message',
|
|
900
|
-
title:
|
|
1116
|
+
title: {
|
|
1117
|
+
type: 'i18n',
|
|
1118
|
+
'en-US': 'Error message',
|
|
1119
|
+
'zh-CN': '错误信息提示',
|
|
1120
|
+
},
|
|
901
1121
|
propType: 'string',
|
|
902
1122
|
setter: 'PisellI18nSetter',
|
|
903
1123
|
},
|
|
@@ -911,7 +1131,18 @@ export const formItemGeneralProps = [
|
|
|
911
1131
|
},
|
|
912
1132
|
{
|
|
913
1133
|
name: 'minLengthobj',
|
|
914
|
-
title: {
|
|
1134
|
+
title: {
|
|
1135
|
+
label: {
|
|
1136
|
+
type: 'i18n',
|
|
1137
|
+
'en-US': 'Minimum length',
|
|
1138
|
+
'zh-CN': '最小长度',
|
|
1139
|
+
},
|
|
1140
|
+
tip: {
|
|
1141
|
+
type: 'i18n',
|
|
1142
|
+
'en-US': 'Minimum length',
|
|
1143
|
+
'zh-CN': '最小长度',
|
|
1144
|
+
},
|
|
1145
|
+
},
|
|
915
1146
|
setter: {
|
|
916
1147
|
componentName: 'ObjectSetter',
|
|
917
1148
|
props: {
|
|
@@ -919,20 +1150,32 @@ export const formItemGeneralProps = [
|
|
|
919
1150
|
items: [
|
|
920
1151
|
{
|
|
921
1152
|
name: 'enabled',
|
|
922
|
-
title:
|
|
1153
|
+
title: {
|
|
1154
|
+
type: 'i18n',
|
|
1155
|
+
'en-US': 'Enabled',
|
|
1156
|
+
'zh-CN': '是否启用',
|
|
1157
|
+
},
|
|
923
1158
|
propType: 'bool',
|
|
924
1159
|
setter: 'BoolSetter',
|
|
925
1160
|
isRequired: true,
|
|
926
1161
|
},
|
|
927
1162
|
{
|
|
928
1163
|
name: 'min',
|
|
929
|
-
title:
|
|
1164
|
+
title: {
|
|
1165
|
+
type: 'i18n',
|
|
1166
|
+
'en-US': 'Minimum length',
|
|
1167
|
+
'zh-CN': '最小长度',
|
|
1168
|
+
},
|
|
930
1169
|
propType: 'number',
|
|
931
1170
|
setter: 'NumberSetter',
|
|
932
1171
|
},
|
|
933
1172
|
{
|
|
934
1173
|
name: 'message',
|
|
935
|
-
title:
|
|
1174
|
+
title: {
|
|
1175
|
+
type: 'i18n',
|
|
1176
|
+
'en-US': 'Error message',
|
|
1177
|
+
'zh-CN': '错误信息提示',
|
|
1178
|
+
},
|
|
936
1179
|
propType: 'string',
|
|
937
1180
|
setter: 'PisellI18nSetter',
|
|
938
1181
|
},
|
|
@@ -946,7 +1189,18 @@ export const formItemGeneralProps = [
|
|
|
946
1189
|
},
|
|
947
1190
|
{
|
|
948
1191
|
name: 'maxLengthobj',
|
|
949
|
-
title: {
|
|
1192
|
+
title: {
|
|
1193
|
+
label: {
|
|
1194
|
+
type: 'i18n',
|
|
1195
|
+
'en-US': 'Maximum length',
|
|
1196
|
+
'zh-CN': '最大长度',
|
|
1197
|
+
},
|
|
1198
|
+
tip: {
|
|
1199
|
+
type: 'i18n',
|
|
1200
|
+
'en-US': 'Maximum length',
|
|
1201
|
+
'zh-CN': '最大长度',
|
|
1202
|
+
},
|
|
1203
|
+
},
|
|
950
1204
|
setter: {
|
|
951
1205
|
componentName: 'ObjectSetter',
|
|
952
1206
|
props: {
|
|
@@ -954,20 +1208,32 @@ export const formItemGeneralProps = [
|
|
|
954
1208
|
items: [
|
|
955
1209
|
{
|
|
956
1210
|
name: 'enabled',
|
|
957
|
-
title:
|
|
1211
|
+
title: {
|
|
1212
|
+
type: 'i18n',
|
|
1213
|
+
'en-US': 'Enabled',
|
|
1214
|
+
'zh-CN': '是否启用',
|
|
1215
|
+
},
|
|
958
1216
|
propType: 'bool',
|
|
959
1217
|
setter: 'BoolSetter',
|
|
960
1218
|
isRequired: true,
|
|
961
1219
|
},
|
|
962
1220
|
{
|
|
963
1221
|
name: 'max',
|
|
964
|
-
title:
|
|
1222
|
+
title: {
|
|
1223
|
+
type: 'i18n',
|
|
1224
|
+
'en-US': 'Maximum length',
|
|
1225
|
+
'zh-CN': '最大长度',
|
|
1226
|
+
},
|
|
965
1227
|
propType: 'number',
|
|
966
1228
|
setter: 'NumberSetter',
|
|
967
1229
|
},
|
|
968
1230
|
{
|
|
969
1231
|
name: 'message',
|
|
970
|
-
title:
|
|
1232
|
+
title: {
|
|
1233
|
+
type: 'i18n',
|
|
1234
|
+
'en-US': 'Error message',
|
|
1235
|
+
'zh-CN': '错误信息提示',
|
|
1236
|
+
},
|
|
971
1237
|
propType: 'string',
|
|
972
1238
|
setter: 'PisellI18nSetter',
|
|
973
1239
|
},
|
|
@@ -981,7 +1247,18 @@ export const formItemGeneralProps = [
|
|
|
981
1247
|
},
|
|
982
1248
|
{
|
|
983
1249
|
name: 'typeobj',
|
|
984
|
-
title: {
|
|
1250
|
+
title: {
|
|
1251
|
+
label: {
|
|
1252
|
+
type: 'i18n',
|
|
1253
|
+
'en-US': 'Type validation',
|
|
1254
|
+
'zh-CN': '类型校验',
|
|
1255
|
+
},
|
|
1256
|
+
tip: {
|
|
1257
|
+
type: 'i18n',
|
|
1258
|
+
'en-US': 'Type validation',
|
|
1259
|
+
'zh-CN': '类型校验',
|
|
1260
|
+
},
|
|
1261
|
+
},
|
|
985
1262
|
setter: {
|
|
986
1263
|
componentName: 'ObjectSetter',
|
|
987
1264
|
props: {
|
|
@@ -989,14 +1266,22 @@ export const formItemGeneralProps = [
|
|
|
989
1266
|
items: [
|
|
990
1267
|
{
|
|
991
1268
|
name: 'enabled',
|
|
992
|
-
title:
|
|
1269
|
+
title: {
|
|
1270
|
+
type: 'i18n',
|
|
1271
|
+
'en-US': 'Enabled',
|
|
1272
|
+
'zh-CN': '是否启用',
|
|
1273
|
+
},
|
|
993
1274
|
propType: 'bool',
|
|
994
1275
|
setter: 'BoolSetter',
|
|
995
1276
|
isRequired: true,
|
|
996
1277
|
},
|
|
997
1278
|
{
|
|
998
1279
|
name: 'type',
|
|
999
|
-
title:
|
|
1280
|
+
title: {
|
|
1281
|
+
type: 'i18n',
|
|
1282
|
+
'en-US': 'Type',
|
|
1283
|
+
'zh-CN': '类型',
|
|
1284
|
+
},
|
|
1000
1285
|
propType: 'string',
|
|
1001
1286
|
setter: {
|
|
1002
1287
|
componentName: 'SelectSetter',
|
|
@@ -1011,7 +1296,11 @@ export const formItemGeneralProps = [
|
|
|
1011
1296
|
},
|
|
1012
1297
|
{
|
|
1013
1298
|
name: 'message',
|
|
1014
|
-
title:
|
|
1299
|
+
title: {
|
|
1300
|
+
type: 'i18n',
|
|
1301
|
+
'en-US': 'Error message',
|
|
1302
|
+
'zh-CN': '错误信息提示',
|
|
1303
|
+
},
|
|
1015
1304
|
propType: 'string',
|
|
1016
1305
|
setter: 'PisellI18nSetter',
|
|
1017
1306
|
},
|
|
@@ -1025,7 +1314,18 @@ export const formItemGeneralProps = [
|
|
|
1025
1314
|
},
|
|
1026
1315
|
{
|
|
1027
1316
|
name: 'maxobj',
|
|
1028
|
-
title: {
|
|
1317
|
+
title: {
|
|
1318
|
+
label: {
|
|
1319
|
+
type: 'i18n',
|
|
1320
|
+
'en-US': 'Maximum value validation setting',
|
|
1321
|
+
'zh-CN': '最大值校验设置',
|
|
1322
|
+
},
|
|
1323
|
+
tip: {
|
|
1324
|
+
type: 'i18n',
|
|
1325
|
+
'en-US': 'Maximum value validation setting',
|
|
1326
|
+
'zh-CN': '最大值校验设置',
|
|
1327
|
+
},
|
|
1328
|
+
},
|
|
1029
1329
|
setter: {
|
|
1030
1330
|
componentName: 'ObjectSetter',
|
|
1031
1331
|
props: {
|
|
@@ -1033,20 +1333,32 @@ export const formItemGeneralProps = [
|
|
|
1033
1333
|
items: [
|
|
1034
1334
|
{
|
|
1035
1335
|
name: 'enabled',
|
|
1036
|
-
title:
|
|
1336
|
+
title: {
|
|
1337
|
+
type: 'i18n',
|
|
1338
|
+
'en-US': 'Enabled',
|
|
1339
|
+
'zh-CN': '是否启用',
|
|
1340
|
+
},
|
|
1037
1341
|
propType: 'bool',
|
|
1038
1342
|
setter: 'BoolSetter',
|
|
1039
1343
|
isRequired: true,
|
|
1040
1344
|
},
|
|
1041
1345
|
{
|
|
1042
1346
|
name: 'max',
|
|
1043
|
-
title:
|
|
1347
|
+
title: {
|
|
1348
|
+
type: 'i18n',
|
|
1349
|
+
'en-US': 'Maximum value',
|
|
1350
|
+
'zh-CN': '最大值',
|
|
1351
|
+
},
|
|
1044
1352
|
propType: 'number',
|
|
1045
1353
|
setter: 'NumberSetter',
|
|
1046
1354
|
},
|
|
1047
1355
|
{
|
|
1048
1356
|
name: 'message',
|
|
1049
|
-
title:
|
|
1357
|
+
title: {
|
|
1358
|
+
type: 'i18n',
|
|
1359
|
+
'en-US': 'Error message',
|
|
1360
|
+
'zh-CN': '错误信息提示',
|
|
1361
|
+
},
|
|
1050
1362
|
propType: 'string',
|
|
1051
1363
|
setter: 'PisellI18nSetter',
|
|
1052
1364
|
},
|
|
@@ -1060,7 +1372,18 @@ export const formItemGeneralProps = [
|
|
|
1060
1372
|
},
|
|
1061
1373
|
{
|
|
1062
1374
|
name: 'minobj',
|
|
1063
|
-
title: {
|
|
1375
|
+
title: {
|
|
1376
|
+
label: {
|
|
1377
|
+
type: 'i18n',
|
|
1378
|
+
'en-US': 'Minimum value validation setting',
|
|
1379
|
+
'zh-CN': '最小值校验设置',
|
|
1380
|
+
},
|
|
1381
|
+
tip: {
|
|
1382
|
+
type: 'i18n',
|
|
1383
|
+
'en-US': 'Minimum value validation setting',
|
|
1384
|
+
'zh-CN': '最小值校验设置',
|
|
1385
|
+
},
|
|
1386
|
+
},
|
|
1064
1387
|
setter: {
|
|
1065
1388
|
componentName: 'ObjectSetter',
|
|
1066
1389
|
props: {
|
|
@@ -1068,20 +1391,32 @@ export const formItemGeneralProps = [
|
|
|
1068
1391
|
items: [
|
|
1069
1392
|
{
|
|
1070
1393
|
name: 'enabled',
|
|
1071
|
-
title:
|
|
1394
|
+
title: {
|
|
1395
|
+
type: 'i18n',
|
|
1396
|
+
'en-US': 'Enabled',
|
|
1397
|
+
'zh-CN': '是否启用',
|
|
1398
|
+
},
|
|
1072
1399
|
propType: 'bool',
|
|
1073
1400
|
setter: 'BoolSetter',
|
|
1074
1401
|
isRequired: true,
|
|
1075
1402
|
},
|
|
1076
1403
|
{
|
|
1077
1404
|
name: 'min',
|
|
1078
|
-
title:
|
|
1405
|
+
title: {
|
|
1406
|
+
type: 'i18n',
|
|
1407
|
+
'en-US': 'Minimum value',
|
|
1408
|
+
'zh-CN': '最小值',
|
|
1409
|
+
},
|
|
1079
1410
|
propType: 'number',
|
|
1080
1411
|
setter: 'NumberSetter',
|
|
1081
1412
|
},
|
|
1082
1413
|
{
|
|
1083
1414
|
name: 'message',
|
|
1084
|
-
title:
|
|
1415
|
+
title: {
|
|
1416
|
+
type: 'i18n',
|
|
1417
|
+
'en-US': 'Error message',
|
|
1418
|
+
'zh-CN': '错误信息提示',
|
|
1419
|
+
},
|
|
1085
1420
|
propType: 'string',
|
|
1086
1421
|
setter: 'PisellI18nSetter',
|
|
1087
1422
|
},
|
|
@@ -1096,3 +1431,37 @@ export const formItemGeneralProps = [
|
|
|
1096
1431
|
],
|
|
1097
1432
|
},
|
|
1098
1433
|
];
|
|
1434
|
+
|
|
1435
|
+
// 生成无代码组件变量属性
|
|
1436
|
+
export const genGeneralVariablesSetting = ({
|
|
1437
|
+
name,
|
|
1438
|
+
title,
|
|
1439
|
+
...rest
|
|
1440
|
+
}: {
|
|
1441
|
+
name: string;
|
|
1442
|
+
title: IPublicTypeTitleContent;
|
|
1443
|
+
[key: string]: any;
|
|
1444
|
+
}) => {
|
|
1445
|
+
return {
|
|
1446
|
+
name,
|
|
1447
|
+
title,
|
|
1448
|
+
...rest,
|
|
1449
|
+
extraProps: {
|
|
1450
|
+
setValue(target: any, value: any) {
|
|
1451
|
+
if (!value.value) {
|
|
1452
|
+
return target.getProps().setPropValue(name, '');
|
|
1453
|
+
}
|
|
1454
|
+
return target.getProps().setPropValue(name, value.value);
|
|
1455
|
+
},
|
|
1456
|
+
},
|
|
1457
|
+
setter: {
|
|
1458
|
+
componentName: 'PisellDataSourceSetter',
|
|
1459
|
+
props: (target: any) => {
|
|
1460
|
+
return {
|
|
1461
|
+
isShowOriginalDataSource: false,
|
|
1462
|
+
variables: getCptValuesVariables(target),
|
|
1463
|
+
};
|
|
1464
|
+
},
|
|
1465
|
+
},
|
|
1466
|
+
};
|
|
1467
|
+
};
|