@pisell/materials 1.0.464 → 1.0.466
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 +19 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.js +13 -13
- package/build/lowcode/view.js +13 -13
- package/es/components/dataSourceComponents/dataSourceForm/formItem.js +3 -1
- package/es/components/dataSourceComponents/dataSourceForm/index.js +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.d.ts +4 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperContext.d.ts +4 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperContext.js +4 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.js +21 -4
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +15 -10
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +9 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +49 -2
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -7
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +5 -4
- package/es/components/dataSourceComponents/dataSourceTable/index.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +2 -1
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +6 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/index.js +6 -0
- package/es/components/dataSourceComponents/fields/Checkbox/index.js +10 -2
- package/es/components/dataSourceComponents/fields/Radio/index.js +10 -2
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +9 -2
- package/es/components/dataSourceComponents/fields/Select/index.js +11 -3
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -1
- package/es/components/dataSourceComponents/hooks/useActions.d.ts +1 -1
- package/es/components/dataSourceComponents/hooks/useActions.js +2 -5
- package/es/components/dataSourceComponents/hooks/useDataSource.d.ts +1 -1
- package/es/components/dataSourceComponents/hooks/useDataSource.js +1 -1
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +2 -0
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.js +2 -0
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +19 -4
- package/es/components/dataSourceComponents/provider/variables/utils.d.ts +10 -0
- package/es/components/dataSourceComponents/provider/variables/utils.js +19 -0
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/index.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.d.ts +4 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperContext.d.ts +4 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperContext.js +4 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.js +6 -2
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +8 -6
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +9 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +45 -3
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +7 -6
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +11 -5
- package/lib/components/dataSourceComponents/dataSourceTable/index.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +2 -1
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +6 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.js +40 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
- package/lib/components/dataSourceComponents/fields/Radio/index.js +3 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +9 -2
- package/lib/components/dataSourceComponents/fields/Select/index.js +4 -2
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -1
- package/lib/components/dataSourceComponents/hooks/useActions.d.ts +1 -1
- package/lib/components/dataSourceComponents/hooks/useActions.js +1 -4
- package/lib/components/dataSourceComponents/hooks/useDataSource.d.ts +1 -1
- package/lib/components/dataSourceComponents/hooks/useDataSource.js +1 -1
- package/lib/components/dataSourceComponents/provider/{fields → dataSource}/DataSourceContext.js +1 -1
- package/lib/components/dataSourceComponents/provider/{fields → dataSource}/DataSourceProvider.js +1 -1
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +2 -0
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.js +4 -0
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +24 -3
- package/lib/components/dataSourceComponents/provider/variables/utils.d.ts +10 -0
- package/lib/components/dataSourceComponents/provider/variables/utils.js +48 -0
- package/lowcode/_utils/defaultSchema.ts +674 -6
- package/lowcode/_utils/utils.ts +9 -0
- package/lowcode/data-source-form/meta.ts +10 -3
- package/lowcode/data-source-form/utils.ts +65 -6
- package/lowcode/data-source-table/meta.ts +18 -6
- package/lowcode/data-source-table/utils.tsx +5 -0
- package/lowcode/date-picker.range-picker/meta.ts +20 -0
- package/lowcode/form-group/meta.ts +2 -3
- package/lowcode/form-item-checkbox/snippets.ts +2 -0
- package/lowcode/form-item-checkbox.group/meta.ts +47 -22
- package/lowcode/form-item-color-picker/meta.ts +27 -14
- package/lowcode/form-item-input/meta.ts +23 -2
- package/lowcode/form-item-radio/snippets.ts +6 -3
- package/lowcode/form-item-radio.group/meta.ts +20 -2
- package/lowcode/form-item-select/meta.ts +64 -33
- package/lowcode/form-item-select/snippets.ts +1 -0
- package/package.json +1 -1
- /package/es/components/dataSourceComponents/provider/{fields → dataSource}/DataSourceContext.d.ts +0 -0
- /package/es/components/dataSourceComponents/provider/{fields → dataSource}/DataSourceContext.js +0 -0
- /package/es/components/dataSourceComponents/provider/{fields → dataSource}/DataSourceProvider.d.ts +0 -0
- /package/es/components/dataSourceComponents/provider/{fields → dataSource}/DataSourceProvider.js +0 -0
- /package/lib/components/dataSourceComponents/provider/{fields → dataSource}/DataSourceContext.d.ts +0 -0
- /package/lib/components/dataSourceComponents/provider/{fields → dataSource}/DataSourceProvider.d.ts +0 -0
|
@@ -100,6 +100,10 @@ export default {
|
|
|
100
100
|
label: 'dataSourceTitle',
|
|
101
101
|
value: '',
|
|
102
102
|
},
|
|
103
|
+
{
|
|
104
|
+
label: 'dataSourceValue',
|
|
105
|
+
value: '',
|
|
106
|
+
},
|
|
103
107
|
]);
|
|
104
108
|
target.node.children.importSchema([]);
|
|
105
109
|
return target.getProps().setPropValue('dataSource', '');
|
|
@@ -130,6 +134,8 @@ export default {
|
|
|
130
134
|
target.getProps().setPropValue('title', value.title);
|
|
131
135
|
}
|
|
132
136
|
|
|
137
|
+
const dataSource = value.isVariable ? value.value : value.item;
|
|
138
|
+
|
|
133
139
|
setBatchVariables(target, [
|
|
134
140
|
{
|
|
135
141
|
label: 'currentFields',
|
|
@@ -139,9 +145,12 @@ export default {
|
|
|
139
145
|
label: 'dataSourceTitle',
|
|
140
146
|
value: value.title,
|
|
141
147
|
},
|
|
148
|
+
{
|
|
149
|
+
label: 'dataSourceValue',
|
|
150
|
+
value: dataSource,
|
|
151
|
+
},
|
|
142
152
|
]);
|
|
143
153
|
|
|
144
|
-
const dataSource = value.isVariable ? value.value : value.item;
|
|
145
154
|
return target.getProps().setPropValue('dataSource', dataSource);
|
|
146
155
|
},
|
|
147
156
|
},
|
|
@@ -242,7 +251,6 @@ export default {
|
|
|
242
251
|
if (!value.value) {
|
|
243
252
|
return target.getProps().setPropValue('currentValue', '');
|
|
244
253
|
}
|
|
245
|
-
console.log('value', value);
|
|
246
254
|
return target
|
|
247
255
|
.getProps()
|
|
248
256
|
.setPropValue('currentValue', value.value);
|
|
@@ -251,7 +259,6 @@ export default {
|
|
|
251
259
|
setter: {
|
|
252
260
|
componentName: 'PisellDataSourceSetter',
|
|
253
261
|
props: (target) => {
|
|
254
|
-
console.log('target getter', target);
|
|
255
262
|
return {
|
|
256
263
|
isShowOriginalDataSource: false,
|
|
257
264
|
variables: getCurrentValueVariables(target),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isString } from '@pisell/utils';
|
|
1
2
|
import {
|
|
2
3
|
nocobaseCpt2PisellCptMap,
|
|
3
4
|
pisellCptMap,
|
|
@@ -50,6 +51,7 @@ export const createSubmitButton = (props: any = {}) => {
|
|
|
50
51
|
afterSubmitType: 'none',
|
|
51
52
|
...props,
|
|
52
53
|
},
|
|
54
|
+
children: [],
|
|
53
55
|
};
|
|
54
56
|
};
|
|
55
57
|
|
|
@@ -143,6 +145,7 @@ export const createFormItemSchema = (
|
|
|
143
145
|
if (['Radio.Group', 'Checkbox.Group'].includes(xComponent)) {
|
|
144
146
|
props.direction = 'horizontal';
|
|
145
147
|
}
|
|
148
|
+
props.optionSourceType = 'default';
|
|
146
149
|
props.options = uiSchema.enum;
|
|
147
150
|
}
|
|
148
151
|
|
|
@@ -308,41 +311,97 @@ export const setBatchVariables = (
|
|
|
308
311
|
target.getProps().setPropValue('_variables', newVariables);
|
|
309
312
|
};
|
|
310
313
|
|
|
314
|
+
// 获取当前节点所有变量
|
|
311
315
|
export const getAllVariables = (target: any) => {
|
|
312
316
|
return target.getProps().getPropValue('_variables');
|
|
313
317
|
};
|
|
314
318
|
|
|
319
|
+
// 获取当前节点单个变量
|
|
315
320
|
export const getVariable = (target: any, label: string) => {
|
|
316
321
|
return target.getProps().getPropValue('_variables')?.[label];
|
|
317
322
|
};
|
|
318
323
|
|
|
324
|
+
// 清除当前节点所有变量
|
|
319
325
|
export const clearVariables = (target: any) => {
|
|
320
326
|
return target.getProps().setPropValue('_variables', null);
|
|
321
327
|
};
|
|
322
328
|
|
|
329
|
+
type VariablesItemType = {
|
|
330
|
+
componentName: string;
|
|
331
|
+
title: string;
|
|
332
|
+
id: string;
|
|
333
|
+
variables: Record<string, any>;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
// 获取当前节点父节点所有变量
|
|
323
337
|
const getParentVariables = (target: any) => {
|
|
324
|
-
let parent = target.node
|
|
325
|
-
|
|
338
|
+
let parent = target.node;
|
|
339
|
+
const variables: VariablesItemType[] = [];
|
|
340
|
+
|
|
341
|
+
while (parent) {
|
|
342
|
+
const { componentName, title, id } = parent;
|
|
343
|
+
const _variables = parent.getProps().getPropValue('_variables');
|
|
344
|
+
|
|
345
|
+
const strTitle = isString(title) ? title : title['zh-CN'];
|
|
346
|
+
|
|
347
|
+
if (_variables) {
|
|
348
|
+
variables.push({
|
|
349
|
+
componentName,
|
|
350
|
+
title: strTitle,
|
|
351
|
+
id,
|
|
352
|
+
|
|
353
|
+
variables: _variables,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
|
|
326
357
|
parent = parent.parent;
|
|
327
358
|
}
|
|
328
|
-
|
|
359
|
+
|
|
360
|
+
return variables;
|
|
329
361
|
};
|
|
330
362
|
|
|
363
|
+
// 获取数据源变量
|
|
331
364
|
export const getDataSourceVariables = (target: any) => {
|
|
332
365
|
const variables = getParentVariables(target);
|
|
333
|
-
|
|
366
|
+
|
|
367
|
+
return variables?.map((item: VariablesItemType) => {
|
|
368
|
+
return {
|
|
369
|
+
label: item.title,
|
|
370
|
+
value: item.id,
|
|
371
|
+
children: item.variables.dataSourceVariables,
|
|
372
|
+
isVariable: true,
|
|
373
|
+
};
|
|
374
|
+
}).filter(item => item?.children?.length);
|
|
334
375
|
};
|
|
335
376
|
|
|
336
377
|
export const getCurrentValueVariables = (target: any) => {
|
|
337
378
|
const variables = getParentVariables(target);
|
|
338
379
|
const currentDataSourceTitle = getVariable(target, 'dataSourceTitle');
|
|
339
380
|
|
|
340
|
-
const currentValueVariables = [
|
|
381
|
+
const currentValueVariables: any[] = [
|
|
341
382
|
{
|
|
342
383
|
label: currentDataSourceTitle,
|
|
343
384
|
value: 'server',
|
|
344
385
|
},
|
|
345
386
|
];
|
|
346
387
|
|
|
347
|
-
|
|
388
|
+
variables.forEach((item: VariablesItemType) => {
|
|
389
|
+
if (item.variables?.currentValueVariables?.length) {
|
|
390
|
+
currentValueVariables.push({
|
|
391
|
+
label: item.title,
|
|
392
|
+
value: item.id,
|
|
393
|
+
children: item.variables.currentValueVariables,
|
|
394
|
+
isVariable: true,
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
return currentValueVariables;
|
|
348
400
|
};
|
|
401
|
+
|
|
402
|
+
export const getDataSourceValue = (target: any) => {
|
|
403
|
+
const variables = getParentVariables(target);
|
|
404
|
+
return variables?.find(item => item.variables.dataSourceValue)?.variables.dataSourceValue;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import snippets from './snippets';
|
|
2
2
|
import button from '../button/meta';
|
|
3
|
-
import { columns2Options, fields2Columns } from './utils';
|
|
3
|
+
import { columns2Options, fields2Columns, genDataSourceValueKey } from './utils';
|
|
4
4
|
import {
|
|
5
5
|
fields2ChildrenSchemas,
|
|
6
6
|
getVariable,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
setBatchVariables,
|
|
10
10
|
createSubmitButton,
|
|
11
11
|
} from '../data-source-form/utils';
|
|
12
|
+
import { omit } from '../_utils/utils';
|
|
12
13
|
|
|
13
14
|
const getI18n = (
|
|
14
15
|
item:
|
|
@@ -47,6 +48,12 @@ const getFormContent = (target: any, mode: 'add' | 'edit' | 'view') => {
|
|
|
47
48
|
);
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
// 过滤不需要继承的变量
|
|
52
|
+
const variables = omit(getAllVariables(target), [
|
|
53
|
+
'currentValueVariables',
|
|
54
|
+
'dataSourceVariables',
|
|
55
|
+
]);
|
|
56
|
+
|
|
50
57
|
return {
|
|
51
58
|
type: 'JSSlot',
|
|
52
59
|
params: [],
|
|
@@ -55,15 +62,18 @@ const getFormContent = (target: any, mode: 'add' | 'edit' | 'view') => {
|
|
|
55
62
|
componentName: 'DataSourceForm',
|
|
56
63
|
title,
|
|
57
64
|
props: {
|
|
58
|
-
_variables:
|
|
59
|
-
dataSource: '
|
|
65
|
+
_variables: variables,
|
|
66
|
+
dataSource: genDataSourceValueKey(target, 'currentDataSource'),
|
|
60
67
|
showTitle: false,
|
|
61
68
|
showDescription: false,
|
|
62
69
|
groupInfoPosition: 'top',
|
|
63
70
|
layout: 'vertical',
|
|
64
71
|
size: 'large',
|
|
65
72
|
mode,
|
|
66
|
-
currentValue:
|
|
73
|
+
currentValue:
|
|
74
|
+
mode !== 'add'
|
|
75
|
+
? genDataSourceValueKey(target, 'currentRecord')
|
|
76
|
+
: undefined,
|
|
67
77
|
},
|
|
68
78
|
children: childrenSchemas,
|
|
69
79
|
},
|
|
@@ -108,6 +118,7 @@ export default {
|
|
|
108
118
|
display: 'block',
|
|
109
119
|
extraProps: {
|
|
110
120
|
setValue(target: any, value: any) {
|
|
121
|
+
console.log(target, 'target');
|
|
111
122
|
// 如果value为空,则清空表格
|
|
112
123
|
if (!value.item) {
|
|
113
124
|
target.getProps().setPropValue('columns', []);
|
|
@@ -134,8 +145,9 @@ export default {
|
|
|
134
145
|
value: [
|
|
135
146
|
{
|
|
136
147
|
label: '当前数据表',
|
|
137
|
-
value: '
|
|
148
|
+
value: genDataSourceValueKey(target, 'currentDataSource'),
|
|
138
149
|
item: value.item,
|
|
150
|
+
isVariable: true,
|
|
139
151
|
},
|
|
140
152
|
],
|
|
141
153
|
},
|
|
@@ -148,7 +160,7 @@ export default {
|
|
|
148
160
|
value: [
|
|
149
161
|
{
|
|
150
162
|
label: '当前行数据',
|
|
151
|
-
value: '
|
|
163
|
+
value: genDataSourceValueKey(target, 'currentRecord'),
|
|
152
164
|
},
|
|
153
165
|
],
|
|
154
166
|
},
|
|
@@ -171,6 +171,26 @@ export default {
|
|
|
171
171
|
},
|
|
172
172
|
},
|
|
173
173
|
},
|
|
174
|
+
{
|
|
175
|
+
name: "isHideCustomSelect",
|
|
176
|
+
title: {
|
|
177
|
+
label: "是否隐藏自定义范围",
|
|
178
|
+
tip: "isHideCustomSelect | 是否隐藏自定义范围",
|
|
179
|
+
},
|
|
180
|
+
propType: "bool",
|
|
181
|
+
defaultValue: false,
|
|
182
|
+
setter: "BoolSetter",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "endDateDays",
|
|
186
|
+
title: {
|
|
187
|
+
label: "结束时间在开始时间的几天之后",
|
|
188
|
+
tip: "endDateDays | 结束时间在开始时间的几天之后",
|
|
189
|
+
},
|
|
190
|
+
defaultValue: 0,
|
|
191
|
+
propType: "number",
|
|
192
|
+
setter: "NumberSetter",
|
|
193
|
+
},
|
|
174
194
|
],
|
|
175
195
|
},
|
|
176
196
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import snippets from './snippets';
|
|
2
|
-
import { createFormItemSchema, formSchema2PisellFieldsOptions, getVariable } from '../data-source-form/utils';
|
|
2
|
+
import { createFormItemSchema, formSchema2PisellFieldsOptions, getVariable, getDataSourceValue } from '../data-source-form/utils';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
snippets,
|
|
@@ -77,8 +77,7 @@ export default {
|
|
|
77
77
|
display: 'inline',
|
|
78
78
|
extraProps: {
|
|
79
79
|
getValue(target: any) {
|
|
80
|
-
|
|
81
|
-
return dataSource?.key || dataSource?.tableName;
|
|
80
|
+
return getDataSourceValue(target);
|
|
82
81
|
},
|
|
83
82
|
},
|
|
84
83
|
setter: {
|
|
@@ -1,23 +1,48 @@
|
|
|
1
1
|
import { uuid } from '../_utils/utils';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
formItemGeneralDataGroup,
|
|
4
|
+
getFormItemGeneralInfoGroup,
|
|
5
|
+
getFormItemValidateGroup,
|
|
6
|
+
generalItemMap,
|
|
7
|
+
formItemGeneralOptionTypeGroup,
|
|
8
|
+
getFormItemGeneralAppearanceGroup,
|
|
9
|
+
} from '../_utils/defaultSchema';
|
|
3
10
|
|
|
4
11
|
export default {
|
|
5
12
|
componentName: 'FormItemCheckbox.Group',
|
|
6
13
|
title: '多选框组',
|
|
7
14
|
category: '表单',
|
|
8
|
-
group:
|
|
9
|
-
docUrl:
|
|
10
|
-
screenshot:
|
|
11
|
-
devMode:
|
|
15
|
+
group: '无代码组件',
|
|
16
|
+
docUrl: '',
|
|
17
|
+
screenshot: '',
|
|
18
|
+
devMode: 'proCode',
|
|
12
19
|
npm: {
|
|
13
|
-
package:
|
|
14
|
-
version:
|
|
15
|
-
exportName:
|
|
16
|
-
main:
|
|
20
|
+
package: '@pisell/materials',
|
|
21
|
+
version: '1.0.1',
|
|
22
|
+
exportName: 'FormItemCheckbox',
|
|
23
|
+
main: 'src/index.tsx',
|
|
17
24
|
destructuring: true,
|
|
18
|
-
subName:
|
|
25
|
+
subName: 'Group',
|
|
19
26
|
},
|
|
20
|
-
generalProps:
|
|
27
|
+
generalProps: [
|
|
28
|
+
// 数据分组
|
|
29
|
+
formItemGeneralDataGroup,
|
|
30
|
+
// 信息分组
|
|
31
|
+
getFormItemGeneralInfoGroup([
|
|
32
|
+
generalItemMap['label'],
|
|
33
|
+
generalItemMap['tooltip'],
|
|
34
|
+
generalItemMap['extra'],
|
|
35
|
+
generalItemMap['noStyle'],
|
|
36
|
+
generalItemMap['mode'],
|
|
37
|
+
generalItemMap['defaultValue'],
|
|
38
|
+
]),
|
|
39
|
+
// 选项类型分组
|
|
40
|
+
formItemGeneralOptionTypeGroup,
|
|
41
|
+
// 校验分组
|
|
42
|
+
getFormItemValidateGroup([generalItemMap['requiredobj']]),
|
|
43
|
+
// 外观分组
|
|
44
|
+
getFormItemGeneralAppearanceGroup([generalItemMap['direction']]),
|
|
45
|
+
],
|
|
21
46
|
|
|
22
47
|
props: [
|
|
23
48
|
{
|
|
@@ -30,10 +55,10 @@ export default {
|
|
|
30
55
|
props: {
|
|
31
56
|
itemSetter: {
|
|
32
57
|
componentName: 'StringSetter',
|
|
33
|
-
}
|
|
34
|
-
}
|
|
58
|
+
},
|
|
59
|
+
},
|
|
35
60
|
},
|
|
36
|
-
supportVariable: true
|
|
61
|
+
supportVariable: true,
|
|
37
62
|
},
|
|
38
63
|
{
|
|
39
64
|
name: 'value',
|
|
@@ -44,10 +69,10 @@ export default {
|
|
|
44
69
|
props: {
|
|
45
70
|
itemSetter: {
|
|
46
71
|
componentName: 'StringSetter',
|
|
47
|
-
}
|
|
48
|
-
}
|
|
72
|
+
},
|
|
73
|
+
},
|
|
49
74
|
},
|
|
50
|
-
supportVariable: true
|
|
75
|
+
supportVariable: true,
|
|
51
76
|
},
|
|
52
77
|
{
|
|
53
78
|
name: 'disabled',
|
|
@@ -55,14 +80,14 @@ export default {
|
|
|
55
80
|
propType: 'bool',
|
|
56
81
|
defaultValue: false,
|
|
57
82
|
setter: 'BoolSetter',
|
|
58
|
-
supportVariable: true
|
|
83
|
+
supportVariable: true,
|
|
59
84
|
},
|
|
60
85
|
{
|
|
61
86
|
name: 'name',
|
|
62
87
|
title: { label: 'name属性', tip: 'name属性' },
|
|
63
88
|
propType: 'string',
|
|
64
89
|
setter: 'StringSetter',
|
|
65
|
-
supportVariable: true
|
|
90
|
+
supportVariable: true,
|
|
66
91
|
},
|
|
67
92
|
{
|
|
68
93
|
name: 'options',
|
|
@@ -105,13 +130,13 @@ export default {
|
|
|
105
130
|
name: 'label',
|
|
106
131
|
title: '选项名',
|
|
107
132
|
setter: 'PisellI18nSetter',
|
|
108
|
-
isRequired: true
|
|
133
|
+
isRequired: true,
|
|
109
134
|
},
|
|
110
135
|
{
|
|
111
136
|
name: 'value',
|
|
112
137
|
title: '选项值',
|
|
113
138
|
setter: 'StringSetter',
|
|
114
|
-
isRequired: true
|
|
139
|
+
isRequired: true,
|
|
115
140
|
},
|
|
116
141
|
{
|
|
117
142
|
name: 'disabled',
|
|
@@ -131,7 +156,7 @@ export default {
|
|
|
131
156
|
},
|
|
132
157
|
},
|
|
133
158
|
},
|
|
134
|
-
supportVariable: true
|
|
159
|
+
supportVariable: true,
|
|
135
160
|
},
|
|
136
161
|
{
|
|
137
162
|
name: 'direction',
|
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
import snippets from './snippets';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { formItemGeneralDataGroup, getFormItemGeneralInfoGroup, generalItemMap, getFormItemValidateGroup } from '../_utils/defaultSchema';
|
|
4
3
|
export default {
|
|
5
4
|
snippets,
|
|
6
5
|
componentName: 'FormItemColorPicker',
|
|
7
6
|
title: '颜色选择器',
|
|
8
7
|
category: '表单',
|
|
9
8
|
group: '无代码组件',
|
|
10
|
-
docUrl:
|
|
11
|
-
screenshot:
|
|
12
|
-
devMode:
|
|
9
|
+
docUrl: '',
|
|
10
|
+
screenshot: '',
|
|
11
|
+
devMode: 'proCode',
|
|
13
12
|
npm: {
|
|
14
|
-
package:
|
|
15
|
-
version:
|
|
16
|
-
exportName:
|
|
17
|
-
main:
|
|
13
|
+
package: '@pisell/materials',
|
|
14
|
+
version: '1.0.1',
|
|
15
|
+
exportName: 'FormItemColorPicker',
|
|
16
|
+
main: 'src/index.tsx',
|
|
18
17
|
destructuring: true,
|
|
19
|
-
subName:
|
|
18
|
+
subName: '',
|
|
20
19
|
},
|
|
21
|
-
generalProps:
|
|
20
|
+
generalProps: [
|
|
21
|
+
// 数据分组
|
|
22
|
+
formItemGeneralDataGroup,
|
|
23
|
+
// 信息分组
|
|
24
|
+
getFormItemGeneralInfoGroup([
|
|
25
|
+
generalItemMap['label'],
|
|
26
|
+
generalItemMap['tooltip'],
|
|
27
|
+
generalItemMap['extra'],
|
|
28
|
+
generalItemMap['noStyle'],
|
|
29
|
+
generalItemMap['mode'],
|
|
30
|
+
]),
|
|
31
|
+
// 校验分组
|
|
32
|
+
getFormItemValidateGroup([generalItemMap['requiredobj']]),
|
|
33
|
+
],
|
|
22
34
|
props: [
|
|
23
35
|
{
|
|
24
36
|
name: 'allowClear',
|
|
@@ -130,7 +142,7 @@ export default {
|
|
|
130
142
|
{
|
|
131
143
|
name: 'presets',
|
|
132
144
|
title: { label: '预设的颜色', tip: '预设的颜色' },
|
|
133
|
-
setter:
|
|
145
|
+
setter: 'JsonSetter',
|
|
134
146
|
},
|
|
135
147
|
{
|
|
136
148
|
name: 'placement',
|
|
@@ -213,7 +225,7 @@ export default {
|
|
|
213
225
|
name: 'value',
|
|
214
226
|
title: { label: '当前值', tip: '当前值' },
|
|
215
227
|
propType: 'string',
|
|
216
|
-
setter: 'StringSetter'
|
|
228
|
+
setter: 'StringSetter',
|
|
217
229
|
},
|
|
218
230
|
{
|
|
219
231
|
name: 'showText',
|
|
@@ -283,7 +295,8 @@ export default {
|
|
|
283
295
|
},
|
|
284
296
|
{
|
|
285
297
|
name: 'onFormatChange',
|
|
286
|
-
template:
|
|
298
|
+
template:
|
|
299
|
+
"onFormatChange(event,${extParams}){\n// 颜色格式变化的回调\nconsole.log('onFormatChange',event);}",
|
|
287
300
|
},
|
|
288
301
|
{
|
|
289
302
|
name: 'onOpenChange',
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import snippets from './snippets';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
formItemGeneralDataGroup,
|
|
4
|
+
getFormItemGeneralInfoGroup,
|
|
5
|
+
generalItemMap,
|
|
6
|
+
getFormItemValidateGroup,
|
|
7
|
+
} from '../_utils/defaultSchema';
|
|
3
8
|
|
|
4
9
|
export default {
|
|
5
10
|
snippets,
|
|
@@ -18,7 +23,23 @@ export default {
|
|
|
18
23
|
destructuring: true,
|
|
19
24
|
subName: '',
|
|
20
25
|
},
|
|
21
|
-
generalProps:
|
|
26
|
+
generalProps: [
|
|
27
|
+
formItemGeneralDataGroup,
|
|
28
|
+
getFormItemGeneralInfoGroup([
|
|
29
|
+
generalItemMap['label'],
|
|
30
|
+
generalItemMap['placeholder'],
|
|
31
|
+
generalItemMap['tooltip'],
|
|
32
|
+
generalItemMap['extra'],
|
|
33
|
+
generalItemMap['noStyle'],
|
|
34
|
+
generalItemMap['mode'],
|
|
35
|
+
generalItemMap['defaultValue'],
|
|
36
|
+
]),
|
|
37
|
+
getFormItemValidateGroup([
|
|
38
|
+
generalItemMap['requiredobj'],
|
|
39
|
+
generalItemMap['minLengthobj'],
|
|
40
|
+
generalItemMap['maxLengthobj'],
|
|
41
|
+
]),
|
|
42
|
+
],
|
|
22
43
|
props: [
|
|
23
44
|
{
|
|
24
45
|
name: 'defaultValue',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export default [
|
|
2
2
|
{
|
|
3
3
|
title: '单选框',
|
|
4
|
-
screenshot:
|
|
4
|
+
screenshot:
|
|
5
|
+
'https://alifd.alicdn.com/fusion-cool/icons/icon-antd/radio-1.png',
|
|
5
6
|
schema: {
|
|
6
7
|
componentName: 'FormItemRadio',
|
|
7
8
|
props: {
|
|
@@ -11,11 +12,13 @@ export default [
|
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
14
|
title: '单选框组',
|
|
14
|
-
screenshot:
|
|
15
|
+
screenshot:
|
|
16
|
+
'https://alifd.alicdn.com/fusion-cool/icons/icon-antd/radio-group-1.png',
|
|
15
17
|
schema: {
|
|
16
18
|
componentName: 'FormItemRadio.Group',
|
|
17
19
|
props: {
|
|
18
|
-
direction:
|
|
20
|
+
direction: 'horizontal',
|
|
21
|
+
optionSourceType: 'default',
|
|
19
22
|
options: [
|
|
20
23
|
{
|
|
21
24
|
label: 'A',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { uuid } from '../_utils/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { formItemGeneralDataGroup,generalItemMap, getFormItemGeneralInfoGroup, formItemGeneralOptionTypeGroup, getFormItemValidateGroup, getFormItemGeneralAppearanceGroup } from '../_utils/defaultSchema';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
componentName: 'FormItemRadio.Group',
|
|
@@ -17,7 +17,25 @@ export default {
|
|
|
17
17
|
destructuring: true,
|
|
18
18
|
subName: "Group",
|
|
19
19
|
},
|
|
20
|
-
generalProps:
|
|
20
|
+
generalProps: [
|
|
21
|
+
// 数据分组
|
|
22
|
+
formItemGeneralDataGroup,
|
|
23
|
+
// 信息分组
|
|
24
|
+
getFormItemGeneralInfoGroup([
|
|
25
|
+
generalItemMap['label'],
|
|
26
|
+
generalItemMap['tooltip'],
|
|
27
|
+
generalItemMap['extra'],
|
|
28
|
+
generalItemMap['noStyle'],
|
|
29
|
+
generalItemMap['mode'],
|
|
30
|
+
generalItemMap['defaultValue'],
|
|
31
|
+
]),
|
|
32
|
+
// 选项类型分组
|
|
33
|
+
formItemGeneralOptionTypeGroup,
|
|
34
|
+
// 校验分组
|
|
35
|
+
getFormItemValidateGroup([generalItemMap['requiredobj']]),
|
|
36
|
+
// 外观分组
|
|
37
|
+
getFormItemGeneralAppearanceGroup([generalItemMap['direction']]),
|
|
38
|
+
],
|
|
21
39
|
props: [
|
|
22
40
|
{
|
|
23
41
|
name: 'defaultValue',
|