@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
|
@@ -7,6 +7,9 @@ export default [
|
|
|
7
7
|
title: '表单(添加)',
|
|
8
8
|
componentName: 'DataSourceForm',
|
|
9
9
|
props: {
|
|
10
|
+
style: {
|
|
11
|
+
padding: '24px',
|
|
12
|
+
},
|
|
10
13
|
mode: 'add',
|
|
11
14
|
groupInfoPosition: 'top',
|
|
12
15
|
labelWrap: true,
|
|
@@ -49,6 +52,9 @@ export default [
|
|
|
49
52
|
title: '表单(编辑)',
|
|
50
53
|
componentName: 'DataSourceForm',
|
|
51
54
|
props: {
|
|
55
|
+
style: {
|
|
56
|
+
padding: '24px',
|
|
57
|
+
},
|
|
52
58
|
mode: 'edit',
|
|
53
59
|
groupInfoPosition: 'top',
|
|
54
60
|
labelWrap: true,
|
|
@@ -92,6 +98,9 @@ export default [
|
|
|
92
98
|
title: '详情',
|
|
93
99
|
componentName: 'DataSourceForm',
|
|
94
100
|
props: {
|
|
101
|
+
style: {
|
|
102
|
+
padding: '24px',
|
|
103
|
+
},
|
|
95
104
|
mode: 'view',
|
|
96
105
|
groupInfoPosition: 'top',
|
|
97
106
|
labelWrap: true,
|
|
@@ -35,6 +35,7 @@ export const createFormGroup = (children: any[]) => {
|
|
|
35
35
|
export const createSubmitButton = (props: any = {}) => {
|
|
36
36
|
return {
|
|
37
37
|
componentName: 'SubmitButton',
|
|
38
|
+
title: '提交',
|
|
38
39
|
props: {
|
|
39
40
|
type: 'primary',
|
|
40
41
|
size: 'large',
|
|
@@ -97,6 +98,7 @@ export const createFormItemSchema = (
|
|
|
97
98
|
uiSchema: UiSchema;
|
|
98
99
|
children?: any[];
|
|
99
100
|
_children?: any[];
|
|
101
|
+
interface?: string;
|
|
100
102
|
},
|
|
101
103
|
mode: string
|
|
102
104
|
) => {
|
|
@@ -109,6 +111,8 @@ export const createFormItemSchema = (
|
|
|
109
111
|
default: defaultValue,
|
|
110
112
|
} = uiSchema;
|
|
111
113
|
|
|
114
|
+
let cptTitle = undefined;
|
|
115
|
+
|
|
112
116
|
let props: Record<string, any> = {
|
|
113
117
|
label: title,
|
|
114
118
|
name,
|
|
@@ -119,6 +123,15 @@ export const createFormItemSchema = (
|
|
|
119
123
|
let childrenSchema: any[] = [];
|
|
120
124
|
|
|
121
125
|
if (validator && validator !== 'integer') {
|
|
126
|
+
console.log('validator', validator);
|
|
127
|
+
if (item?.interface === 'phone') {
|
|
128
|
+
cptTitle = '手机号码输入';
|
|
129
|
+
componentName = 'Input.Phone';
|
|
130
|
+
}
|
|
131
|
+
if (validator === 'email') {
|
|
132
|
+
cptTitle = '电子邮箱输入';
|
|
133
|
+
componentName = 'Input.Email';
|
|
134
|
+
}
|
|
122
135
|
props.typeobj = {
|
|
123
136
|
type: validator,
|
|
124
137
|
enabled: true,
|
|
@@ -126,15 +139,35 @@ export const createFormItemSchema = (
|
|
|
126
139
|
}
|
|
127
140
|
|
|
128
141
|
if (xComponent === 'Input.JSON') {
|
|
129
|
-
props.prefix = name;
|
|
130
|
-
|
|
131
142
|
const jsonChildren = item._children || item.children || [];
|
|
132
143
|
|
|
133
144
|
// 如果有children属性,递归创建子表单项
|
|
134
145
|
if (jsonChildren && jsonChildren.length > 0) {
|
|
146
|
+
props.prefix = name;
|
|
135
147
|
childrenSchema = jsonChildren.map((child: any) =>
|
|
136
148
|
createFormItemSchema(child, mode)
|
|
137
149
|
);
|
|
150
|
+
} else {
|
|
151
|
+
componentName = 'Input.InputJSON';
|
|
152
|
+
props.autoSize = {
|
|
153
|
+
minRows: 4,
|
|
154
|
+
};
|
|
155
|
+
// props.validateTrigger = "onBlur";
|
|
156
|
+
props.normalize = {
|
|
157
|
+
type: 'JSExpression',
|
|
158
|
+
value:
|
|
159
|
+
'(value) => {\n try {\n return JSON.parse(value);\n } catch(error) {\n console.log(error)\n }\n return value\n}',
|
|
160
|
+
};
|
|
161
|
+
props.getValueProps = {
|
|
162
|
+
type: 'JSExpression',
|
|
163
|
+
value:
|
|
164
|
+
'(value) => {\n try {\n return { value: value != "" && typeof value === \'object\' ? JSON.stringify(value, null, 2) : value};\n } catch(error) {\n console.log(error)\n }\n return {value: value}\n}',
|
|
165
|
+
};
|
|
166
|
+
props.validator = {
|
|
167
|
+
type: 'JSExpression',
|
|
168
|
+
value:
|
|
169
|
+
"async (value) => {\n try {\n if (typeof value === 'string' && value.trim() !== '') {\n JSON.parse(value);\n }\n } catch (err) {\n return Promise.reject(new Error(err.message));\n }\n}",
|
|
170
|
+
};
|
|
138
171
|
}
|
|
139
172
|
}
|
|
140
173
|
|
|
@@ -159,6 +192,7 @@ export const createFormItemSchema = (
|
|
|
159
192
|
}
|
|
160
193
|
|
|
161
194
|
return {
|
|
195
|
+
title: cptTitle,
|
|
162
196
|
componentName: nocobaseCpt2PisellCptMap[componentName],
|
|
163
197
|
props,
|
|
164
198
|
children: childrenSchema,
|
|
@@ -178,7 +212,11 @@ export const formSchema2PisellFieldsOptions = (
|
|
|
178
212
|
formSchema: any,
|
|
179
213
|
allFields: any[]
|
|
180
214
|
) => {
|
|
181
|
-
if (
|
|
215
|
+
if (
|
|
216
|
+
!['DataSourceForm', 'FormGroup', 'DataSourceWrapper'].includes(
|
|
217
|
+
formSchema.componentName
|
|
218
|
+
)
|
|
219
|
+
) {
|
|
182
220
|
return [];
|
|
183
221
|
}
|
|
184
222
|
|
|
@@ -295,7 +333,19 @@ export const setVariables = (
|
|
|
295
333
|
export const setBatchVariables = (
|
|
296
334
|
target: any,
|
|
297
335
|
variables: Array<{
|
|
298
|
-
|
|
336
|
+
/**
|
|
337
|
+
* currentFields 当前表单字段列表
|
|
338
|
+
* dataSourceTitle 数据源标题
|
|
339
|
+
* dataSourceValue 数据源值
|
|
340
|
+
* cptValuesVariables 组件值变量
|
|
341
|
+
*/
|
|
342
|
+
label:
|
|
343
|
+
| 'currentFields'
|
|
344
|
+
| 'dataSourceTitle'
|
|
345
|
+
| 'dataSourceValue'
|
|
346
|
+
| 'cptValuesVariables'
|
|
347
|
+
| 'currentValueVariables'
|
|
348
|
+
| 'dataSourceVariables';
|
|
299
349
|
value: any;
|
|
300
350
|
}>
|
|
301
351
|
) => {
|
|
@@ -364,14 +414,16 @@ const getParentVariables = (target: any) => {
|
|
|
364
414
|
export const getDataSourceVariables = (target: any) => {
|
|
365
415
|
const variables = getParentVariables(target);
|
|
366
416
|
|
|
367
|
-
return variables
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
417
|
+
return variables
|
|
418
|
+
?.map((item: VariablesItemType) => {
|
|
419
|
+
return {
|
|
420
|
+
label: item.title,
|
|
421
|
+
value: item.id,
|
|
422
|
+
children: item.variables.dataSourceVariables,
|
|
423
|
+
isVariable: true,
|
|
424
|
+
};
|
|
425
|
+
})
|
|
426
|
+
.filter((item) => item?.children?.length);
|
|
375
427
|
};
|
|
376
428
|
|
|
377
429
|
export const getCurrentValueVariables = (target: any) => {
|
|
@@ -399,9 +451,22 @@ export const getCurrentValueVariables = (target: any) => {
|
|
|
399
451
|
return currentValueVariables;
|
|
400
452
|
};
|
|
401
453
|
|
|
402
|
-
export const
|
|
454
|
+
export const getCptValuesVariables = (target: any) => {
|
|
403
455
|
const variables = getParentVariables(target);
|
|
404
|
-
return variables
|
|
456
|
+
return variables
|
|
457
|
+
?.map((item: VariablesItemType) => {
|
|
458
|
+
return {
|
|
459
|
+
label: `${item.title}-${item?.variables?.dataSourceTitle || ''}`,
|
|
460
|
+
value: item.id,
|
|
461
|
+
children: item.variables.cptValuesVariables,
|
|
462
|
+
isVariable: true,
|
|
463
|
+
};
|
|
464
|
+
})
|
|
465
|
+
.filter((item) => item?.children?.length);
|
|
405
466
|
};
|
|
406
467
|
|
|
407
|
-
|
|
468
|
+
export const getDataSourceValue = (target: any) => {
|
|
469
|
+
const variables = getParentVariables(target);
|
|
470
|
+
return variables?.find((item) => item.variables.dataSourceValue)?.variables
|
|
471
|
+
.dataSourceValue;
|
|
472
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import snippets from './snippets';
|
|
2
|
+
import { genGeneralVariablesSetting } from '../_utils/defaultSchema';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
snippets,
|
|
6
|
+
componentName: 'DataSourceImage',
|
|
7
|
+
title: '图片',
|
|
8
|
+
category: '数据展示',
|
|
9
|
+
group: '无代码组件',
|
|
10
|
+
docUrl: '',
|
|
11
|
+
screenshot: '',
|
|
12
|
+
devMode: 'proCode',
|
|
13
|
+
npm: {
|
|
14
|
+
package: '@pisell/materials',
|
|
15
|
+
version: '1.0.1',
|
|
16
|
+
exportName: 'DataSourceImage',
|
|
17
|
+
main: 'src/index.tsx',
|
|
18
|
+
destructuring: true,
|
|
19
|
+
subName: '',
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
generalProps: [
|
|
23
|
+
genGeneralVariablesSetting({
|
|
24
|
+
name: 'src',
|
|
25
|
+
title: { label: '图片地址', tip: '图片地址' },
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
props: [
|
|
29
|
+
{
|
|
30
|
+
name: 'src',
|
|
31
|
+
title: { label: '图片地址', tip: '图片地址' },
|
|
32
|
+
propType: { type: 'string', isRequired: true },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'alt',
|
|
36
|
+
title: { label: '替换文本', tip: '替换文本' },
|
|
37
|
+
propType: 'string',
|
|
38
|
+
setter: 'PisellI18nSetter',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'preview',
|
|
42
|
+
title: { label: '支持预览', tip: '支持预览' },
|
|
43
|
+
defaultValue: true,
|
|
44
|
+
propType: 'bool',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'fallback',
|
|
48
|
+
title: { label: '失败地址', tip: '加载失败容错地址' },
|
|
49
|
+
propType: 'string',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'width',
|
|
53
|
+
title: { label: '宽度', tip: '宽度' },
|
|
54
|
+
propType: 'number',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'height',
|
|
58
|
+
title: { label: '高度', tip: '高度' },
|
|
59
|
+
propType: 'number',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
configure: {
|
|
63
|
+
supports: {
|
|
64
|
+
style: true,
|
|
65
|
+
events: [
|
|
66
|
+
{
|
|
67
|
+
name: 'onClick',
|
|
68
|
+
template:
|
|
69
|
+
"onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
title: '图片',
|
|
4
|
+
screenshot: 'https://alifd.alicdn.com/fusion-cool/icons/icon-antd/image-1.png',
|
|
5
|
+
schema: {
|
|
6
|
+
componentName: 'DataSourceImage',
|
|
7
|
+
props: {
|
|
8
|
+
src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
|
9
|
+
height: 120,
|
|
10
|
+
width: 120,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
];
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import snippets from './snippets';
|
|
2
|
+
import { genGeneralVariablesSetting } from '../_utils/defaultSchema';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
snippets,
|
|
6
|
+
componentName: 'DataSourceQRCode',
|
|
7
|
+
title: '二维码',
|
|
8
|
+
category: '数据展示',
|
|
9
|
+
group: '无代码组件',
|
|
10
|
+
docUrl: "",
|
|
11
|
+
screenshot: "",
|
|
12
|
+
devMode: "proCode",
|
|
13
|
+
npm: {
|
|
14
|
+
package: "@pisell/materials",
|
|
15
|
+
version: "1.0.1",
|
|
16
|
+
exportName: "DataSourceQRCode",
|
|
17
|
+
main: "src/index.tsx",
|
|
18
|
+
destructuring: true,
|
|
19
|
+
subName: "",
|
|
20
|
+
},
|
|
21
|
+
generalProps: [
|
|
22
|
+
genGeneralVariablesSetting({
|
|
23
|
+
name: 'value',
|
|
24
|
+
title: { label: '内容', tip: '内容' },
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
props: [
|
|
28
|
+
{
|
|
29
|
+
name: 'value',
|
|
30
|
+
title: { label: '内容', tip: '内容' },
|
|
31
|
+
propType: 'string',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'type',
|
|
35
|
+
title: { label: '渲染类型', tip: '渲染类型' },
|
|
36
|
+
setter: {
|
|
37
|
+
componentName: 'RadioGroupSetter',
|
|
38
|
+
props: {
|
|
39
|
+
options: [
|
|
40
|
+
{
|
|
41
|
+
title: 'Canvas',
|
|
42
|
+
value: 'canvas',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: 'Svg',
|
|
46
|
+
value: 'svg',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'icon',
|
|
54
|
+
title: { label: '二维码中图片的地址', tip: '二维码中图片的地址(目前只支持图片地址)' },
|
|
55
|
+
propType: 'string',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'size',
|
|
59
|
+
title: { label: '二维码大小', tip: '二维码大小' },
|
|
60
|
+
propType: 'number',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'iconSize',
|
|
64
|
+
title: { label: '二维码中图片的大小', tip: '二维码中图片的大小' },
|
|
65
|
+
propType: 'number',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'color',
|
|
69
|
+
description: '二维码颜色',
|
|
70
|
+
propType: 'string',
|
|
71
|
+
setter: 'ColorSetter',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'bgColor',
|
|
75
|
+
description: '二维码背景颜色',
|
|
76
|
+
propType: 'string',
|
|
77
|
+
setter: 'ColorSetter',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'bordered',
|
|
81
|
+
title: { label: '是否有边框', tip: '是否有边框' },
|
|
82
|
+
propType: 'bool',
|
|
83
|
+
setter: 'BoolSetter'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'errorLevel',
|
|
87
|
+
title: { label: '二维码纠错等级', tip: '通常情况下二维码分为 4 个纠错级别:L级 可纠正约 7% 错误、M级 可纠正约 15% 错误、Q级 可纠正约 25% 错误、H级 可纠正约30% 错误。并不是所有位置都可以缺损,像最明显的三个角上的方框,直接影响初始定位。中间零散的部分是内容编码,可以容忍缺损。当二维码的内容编码携带信息比较少的时候,也就是链接比较短的时候,设置不同的纠错等级,生成的图片不会发生变化。' },
|
|
88
|
+
setter: {
|
|
89
|
+
componentName: 'RadioGroupSetter',
|
|
90
|
+
props: {
|
|
91
|
+
options: [
|
|
92
|
+
{
|
|
93
|
+
title: 'L',
|
|
94
|
+
value: 'L',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
title: 'M',
|
|
98
|
+
value: 'M',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
title: 'Q',
|
|
102
|
+
value: 'Q',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
title: 'H',
|
|
106
|
+
value: 'H',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'preview',
|
|
114
|
+
title: { label: '预览功能', tip: '是否开启预览功能,点击放大展示' },
|
|
115
|
+
propType: 'bool',
|
|
116
|
+
setter: 'BoolSetter'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'status',
|
|
120
|
+
title: { label: '二维码状态', tip: '二维码状态' },
|
|
121
|
+
setter: {
|
|
122
|
+
componentName: 'RadioGroupSetter',
|
|
123
|
+
props: {
|
|
124
|
+
options: [
|
|
125
|
+
{
|
|
126
|
+
title: 'active',
|
|
127
|
+
value: 'active',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
title: 'expired',
|
|
131
|
+
value: 'expired',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
title: 'loading',
|
|
135
|
+
value: 'loading',
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
configure: {
|
|
143
|
+
supports: {
|
|
144
|
+
style: true,
|
|
145
|
+
events: [
|
|
146
|
+
{
|
|
147
|
+
name: 'onRefresh',
|
|
148
|
+
template: "onRefresh(event,${extParams}){\n// 刷新\nconsole.log('onClose',event);}",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "onClick",
|
|
152
|
+
template:
|
|
153
|
+
"onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
title: '二维码',
|
|
4
|
+
screenshot: 'https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*cJopQrf0ncwAAAAAAAAAAAAADrJ8AQ/original',
|
|
5
|
+
schema: {
|
|
6
|
+
componentName: 'DataSourceQRCode',
|
|
7
|
+
props: {
|
|
8
|
+
value: "pisell2",
|
|
9
|
+
size: 160,
|
|
10
|
+
iconSize: 40,
|
|
11
|
+
status: "active",
|
|
12
|
+
errorLevel: "L",
|
|
13
|
+
type: "canvas",
|
|
14
|
+
color: "#000",
|
|
15
|
+
bgColor: "transparent",
|
|
16
|
+
bordered: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
];
|