@thienvu18/designable-formily-setters 2.0.0

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.
Files changed (91) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +7 -0
  3. package/esm/components/DataSourceSetter/DataSettingPanel.d.ts +10 -0
  4. package/esm/components/DataSourceSetter/DataSettingPanel.js +54 -0
  5. package/esm/components/DataSourceSetter/Header.d.ts +7 -0
  6. package/esm/components/DataSourceSetter/Header.js +8 -0
  7. package/esm/components/DataSourceSetter/Title.d.ts +7 -0
  8. package/esm/components/DataSourceSetter/Title.js +46 -0
  9. package/esm/components/DataSourceSetter/TreePanel.d.ts +12 -0
  10. package/esm/components/DataSourceSetter/TreePanel.js +94 -0
  11. package/esm/components/DataSourceSetter/index.d.ts +18 -0
  12. package/esm/components/DataSourceSetter/index.js +27 -0
  13. package/esm/components/DataSourceSetter/shared.d.ts +9 -0
  14. package/esm/components/DataSourceSetter/shared.js +45 -0
  15. package/esm/components/DataSourceSetter/styles.less +81 -0
  16. package/esm/components/DataSourceSetter/types.d.ts +18 -0
  17. package/esm/components/DataSourceSetter/types.js +1 -0
  18. package/esm/components/ReactionsSetter/FieldPropertySetter.d.ts +10 -0
  19. package/esm/components/ReactionsSetter/FieldPropertySetter.js +65 -0
  20. package/esm/components/ReactionsSetter/PathSelector.d.ts +10 -0
  21. package/esm/components/ReactionsSetter/PathSelector.js +103 -0
  22. package/esm/components/ReactionsSetter/declarations.d.ts +5 -0
  23. package/esm/components/ReactionsSetter/declarations.js +51 -0
  24. package/esm/components/ReactionsSetter/helpers.d.ts +10 -0
  25. package/esm/components/ReactionsSetter/helpers.js +384 -0
  26. package/esm/components/ReactionsSetter/index.d.ts +8 -0
  27. package/esm/components/ReactionsSetter/index.js +251 -0
  28. package/esm/components/ReactionsSetter/properties.d.ts +11 -0
  29. package/esm/components/ReactionsSetter/properties.js +41 -0
  30. package/esm/components/ReactionsSetter/styles.less +105 -0
  31. package/esm/components/ReactionsSetter/types.d.ts +13 -0
  32. package/esm/components/ReactionsSetter/types.js +1 -0
  33. package/esm/components/ValidatorSetter/index.d.ts +6 -0
  34. package/esm/components/ValidatorSetter/index.js +135 -0
  35. package/esm/components/index.d.ts +3 -0
  36. package/esm/components/index.js +3 -0
  37. package/esm/index.d.ts +2 -0
  38. package/esm/index.js +2 -0
  39. package/esm/locales/en-US.d.ts +93 -0
  40. package/esm/locales/en-US.js +98 -0
  41. package/esm/locales/index.d.ts +1 -0
  42. package/esm/locales/index.js +5 -0
  43. package/esm/locales/ko-KR.d.ts +93 -0
  44. package/esm/locales/ko-KR.js +98 -0
  45. package/esm/locales/zh-CN.d.ts +93 -0
  46. package/esm/locales/zh-CN.js +98 -0
  47. package/lib/components/DataSourceSetter/DataSettingPanel.d.ts +10 -0
  48. package/lib/components/DataSourceSetter/DataSettingPanel.js +57 -0
  49. package/lib/components/DataSourceSetter/Header.d.ts +7 -0
  50. package/lib/components/DataSourceSetter/Header.js +11 -0
  51. package/lib/components/DataSourceSetter/Title.d.ts +7 -0
  52. package/lib/components/DataSourceSetter/Title.js +49 -0
  53. package/lib/components/DataSourceSetter/TreePanel.d.ts +12 -0
  54. package/lib/components/DataSourceSetter/TreePanel.js +97 -0
  55. package/lib/components/DataSourceSetter/index.d.ts +18 -0
  56. package/lib/components/DataSourceSetter/index.js +33 -0
  57. package/lib/components/DataSourceSetter/shared.d.ts +9 -0
  58. package/lib/components/DataSourceSetter/shared.js +51 -0
  59. package/lib/components/DataSourceSetter/styles.less +81 -0
  60. package/lib/components/DataSourceSetter/types.d.ts +18 -0
  61. package/lib/components/DataSourceSetter/types.js +2 -0
  62. package/lib/components/ReactionsSetter/FieldPropertySetter.d.ts +10 -0
  63. package/lib/components/ReactionsSetter/FieldPropertySetter.js +69 -0
  64. package/lib/components/ReactionsSetter/PathSelector.d.ts +10 -0
  65. package/lib/components/ReactionsSetter/PathSelector.js +107 -0
  66. package/lib/components/ReactionsSetter/declarations.d.ts +5 -0
  67. package/lib/components/ReactionsSetter/declarations.js +55 -0
  68. package/lib/components/ReactionsSetter/helpers.d.ts +10 -0
  69. package/lib/components/ReactionsSetter/helpers.js +387 -0
  70. package/lib/components/ReactionsSetter/index.d.ts +8 -0
  71. package/lib/components/ReactionsSetter/index.js +255 -0
  72. package/lib/components/ReactionsSetter/properties.d.ts +11 -0
  73. package/lib/components/ReactionsSetter/properties.js +44 -0
  74. package/lib/components/ReactionsSetter/styles.less +105 -0
  75. package/lib/components/ReactionsSetter/types.d.ts +13 -0
  76. package/lib/components/ReactionsSetter/types.js +2 -0
  77. package/lib/components/ValidatorSetter/index.d.ts +6 -0
  78. package/lib/components/ValidatorSetter/index.js +138 -0
  79. package/lib/components/index.d.ts +3 -0
  80. package/lib/components/index.js +19 -0
  81. package/lib/index.d.ts +2 -0
  82. package/lib/index.js +18 -0
  83. package/lib/locales/en-US.d.ts +93 -0
  84. package/lib/locales/en-US.js +100 -0
  85. package/lib/locales/index.d.ts +1 -0
  86. package/lib/locales/index.js +10 -0
  87. package/lib/locales/ko-KR.d.ts +93 -0
  88. package/lib/locales/ko-KR.js +100 -0
  89. package/lib/locales/zh-CN.d.ts +93 -0
  90. package/lib/locales/zh-CN.js +100 -0
  91. package/package.json +64 -0
@@ -0,0 +1,93 @@
1
+ declare const _default: {
2
+ 'en-US': {
3
+ settings: {
4
+ 'x-validator': {
5
+ title: string;
6
+ addValidatorRules: string;
7
+ drawer: string;
8
+ triggerType: {
9
+ title: string;
10
+ placeholder: string;
11
+ dataSource: string[];
12
+ };
13
+ format: {
14
+ title: string;
15
+ placeholder: string;
16
+ dataSource: {
17
+ label: string;
18
+ value: string;
19
+ }[];
20
+ };
21
+ validator: {
22
+ title: string;
23
+ tooltip: string;
24
+ };
25
+ pattern: string;
26
+ len: string;
27
+ max: string;
28
+ min: string;
29
+ exclusiveMaximum: string;
30
+ exclusiveMinimum: string;
31
+ whitespace: string;
32
+ required: string;
33
+ message: {
34
+ title: string;
35
+ tooltip: string;
36
+ };
37
+ };
38
+ };
39
+ SettingComponents: {
40
+ DataSourceSetter: {
41
+ nodeProperty: string;
42
+ pleaseSelectNode: string;
43
+ addKeyValuePair: string;
44
+ configureDataSource: string;
45
+ dataSource: string;
46
+ defaultTitle: string;
47
+ dataSourceTree: string;
48
+ addNode: string;
49
+ label: string;
50
+ value: string;
51
+ item: string;
52
+ };
53
+ ReactionsSetter: {
54
+ configureReactions: string;
55
+ relationsFields: string;
56
+ variableName: string;
57
+ variableNameValidateMessage: string;
58
+ pleaseInput: string;
59
+ sourceField: string;
60
+ sourceProperty: string;
61
+ variableType: string;
62
+ operations: string;
63
+ addRelationField: string;
64
+ propertyReactions: string;
65
+ actionReactions: string;
66
+ visible: string;
67
+ hidden: string;
68
+ display: string;
69
+ pattern: string;
70
+ title: string;
71
+ description: string;
72
+ value: string;
73
+ initialValue: string;
74
+ dataSource: string;
75
+ required: string;
76
+ component: string;
77
+ componentProps: string;
78
+ decorator: string;
79
+ decoratorProps: string;
80
+ pleaseSelect: string;
81
+ expressionValueTypeIs: string;
82
+ };
83
+ ValidatorSetter: {
84
+ pleaseSelect: string;
85
+ formats: {
86
+ label: string;
87
+ value: string;
88
+ }[];
89
+ };
90
+ };
91
+ };
92
+ };
93
+ export default _default;
@@ -0,0 +1,98 @@
1
+ const ValidatorFormats = [
2
+ { label: 'URL', value: 'url' },
3
+ { label: 'Email', value: 'email' },
4
+ { label: 'Number', value: 'number' },
5
+ { label: 'Integer', value: 'integer' },
6
+ { label: 'ID', value: 'idcard' },
7
+ { label: 'Phone Number', value: 'phone' },
8
+ { label: 'Currency', value: 'money' },
9
+ { label: 'Chinese', value: 'zh' },
10
+ { label: 'Date', value: 'date' },
11
+ { label: 'Zip', value: 'zip' },
12
+ ];
13
+ export default {
14
+ 'en-US': {
15
+ settings: {
16
+ 'x-validator': {
17
+ title: 'Validator',
18
+ addValidatorRules: 'Add Validator Rules',
19
+ drawer: 'Edit Rules',
20
+ triggerType: {
21
+ title: 'Trigger Type',
22
+ placeholder: 'Please Select',
23
+ dataSource: ['onInput', 'onFocus', 'onBlur'],
24
+ },
25
+ format: {
26
+ title: 'Format',
27
+ placeholder: 'Please Select',
28
+ dataSource: ValidatorFormats,
29
+ },
30
+ validator: {
31
+ title: 'Custom Validator',
32
+ tooltip: 'Format: function (value){ return "Error Message"}',
33
+ },
34
+ pattern: 'RegExp',
35
+ len: 'Length Limit',
36
+ max: 'Length/Value Lt',
37
+ min: 'Length/Value Gt',
38
+ exclusiveMaximum: 'Length/Value Lte',
39
+ exclusiveMinimum: 'Length/Value Gte',
40
+ whitespace: 'No Whitespace',
41
+ required: 'Required',
42
+ message: {
43
+ title: 'Error Message',
44
+ tooltip: 'The error message is only effective for one built-in rule of the current rule set. If you need to customize the error message for different built-in rules, please split into multiple rules',
45
+ },
46
+ },
47
+ },
48
+ SettingComponents: {
49
+ DataSourceSetter: {
50
+ nodeProperty: 'Node Property',
51
+ pleaseSelectNode: 'please select node from the tree on the left',
52
+ addKeyValuePair: 'Add Key Value Pair',
53
+ configureDataSource: 'Configure',
54
+ dataSource: 'Options',
55
+ defaultTitle: 'Default Title',
56
+ dataSourceTree: 'Options Tree',
57
+ addNode: 'Add Node',
58
+ label: 'label',
59
+ value: 'value',
60
+ item: 'Item',
61
+ },
62
+ ReactionsSetter: {
63
+ configureReactions: 'Configure',
64
+ relationsFields: 'Associated Fields',
65
+ variableName: 'Variable Name',
66
+ variableNameValidateMessage: 'This is not a standard variable name',
67
+ pleaseInput: 'Please Input',
68
+ sourceField: 'Source Field',
69
+ sourceProperty: 'Field Property',
70
+ variableType: 'Variable Type',
71
+ operations: 'Operations',
72
+ addRelationField: 'Add Associated Field',
73
+ propertyReactions: 'Property Reactions(Only Support Javascript Expression)',
74
+ actionReactions: 'Action Reactions(Optional, Support Javascript Statement)',
75
+ visible: 'Show/None',
76
+ hidden: 'Show/UI Hidden',
77
+ display: 'Display',
78
+ pattern: 'Pattern',
79
+ title: 'Title',
80
+ description: 'Description',
81
+ value: 'Value',
82
+ initialValue: 'InitialValue',
83
+ dataSource: 'Options',
84
+ required: 'Required',
85
+ component: 'Component',
86
+ componentProps: 'Component Props',
87
+ decorator: 'Decorator',
88
+ decoratorProps: 'Decorator Props',
89
+ pleaseSelect: 'Please Select',
90
+ expressionValueTypeIs: 'Expression value type is',
91
+ },
92
+ ValidatorSetter: {
93
+ pleaseSelect: 'Please Select',
94
+ formats: ValidatorFormats,
95
+ },
96
+ },
97
+ },
98
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { GlobalRegistry } from '@thienvu18/designable-core';
2
+ import zhCN from './zh-CN';
3
+ import enUS from './en-US';
4
+ import koKR from './ko-KR';
5
+ GlobalRegistry.registerDesignerLocales(zhCN, enUS, koKR);
@@ -0,0 +1,93 @@
1
+ declare const _default: {
2
+ 'ko-KR': {
3
+ settings: {
4
+ 'x-validator': {
5
+ title: string;
6
+ addValidatorRules: string;
7
+ drawer: string;
8
+ triggerType: {
9
+ title: string;
10
+ placeholder: string;
11
+ dataSource: string[];
12
+ };
13
+ format: {
14
+ title: string;
15
+ placeholder: string;
16
+ dataSource: {
17
+ label: string;
18
+ value: string;
19
+ }[];
20
+ };
21
+ validator: {
22
+ title: string;
23
+ tooltip: string;
24
+ };
25
+ pattern: string;
26
+ len: string;
27
+ max: string;
28
+ min: string;
29
+ exclusiveMaximum: string;
30
+ exclusiveMinimum: string;
31
+ whitespace: string;
32
+ required: string;
33
+ message: {
34
+ title: string;
35
+ tooltip: string;
36
+ };
37
+ };
38
+ };
39
+ SettingComponents: {
40
+ DataSourceSetter: {
41
+ nodeProperty: string;
42
+ pleaseSelectNode: string;
43
+ addKeyValuePair: string;
44
+ configureDataSource: string;
45
+ dataSource: string;
46
+ defaultTitle: string;
47
+ dataSourceTree: string;
48
+ addNode: string;
49
+ label: string;
50
+ value: string;
51
+ item: string;
52
+ };
53
+ ReactionsSetter: {
54
+ configureReactions: string;
55
+ relationsFields: string;
56
+ variableName: string;
57
+ variableNameValidateMessage: string;
58
+ pleaseInput: string;
59
+ sourceField: string;
60
+ sourceProperty: string;
61
+ variableType: string;
62
+ operations: string;
63
+ addRelationField: string;
64
+ propertyReactions: string;
65
+ actionReactions: string;
66
+ visible: string;
67
+ hidden: string;
68
+ display: string;
69
+ pattern: string;
70
+ title: string;
71
+ description: string;
72
+ value: string;
73
+ initialValue: string;
74
+ dataSource: string;
75
+ required: string;
76
+ component: string;
77
+ componentProps: string;
78
+ decorator: string;
79
+ decoratorProps: string;
80
+ pleaseSelect: string;
81
+ expressionValueTypeIs: string;
82
+ };
83
+ ValidatorSetter: {
84
+ pleaseSelect: string;
85
+ formats: {
86
+ label: string;
87
+ value: string;
88
+ }[];
89
+ };
90
+ };
91
+ };
92
+ };
93
+ export default _default;
@@ -0,0 +1,98 @@
1
+ const ValidatorFormats = [
2
+ { label: 'URL', value: 'url' },
3
+ { label: '이메일', value: 'email' },
4
+ { label: '숫자', value: 'number' },
5
+ { label: '상수', value: 'integer' },
6
+ { label: 'ID', value: 'idcard' },
7
+ { label: '휴대폰 번호', value: 'phone' },
8
+ { label: '통화', value: 'money' },
9
+ { label: '중국', value: 'zh' },
10
+ { label: '날짜', value: 'date' },
11
+ { label: 'Zip', value: 'zip' },
12
+ ];
13
+ export default {
14
+ 'ko-KR': {
15
+ settings: {
16
+ 'x-validator': {
17
+ title: '유효성 검사 도구',
18
+ addValidatorRules: '유효성 검사 규칙 추가',
19
+ drawer: '규칙 수정',
20
+ triggerType: {
21
+ title: '트리거 타입',
22
+ placeholder: '선택하세요',
23
+ dataSource: ['onInput', 'onFocus', 'onBlur'],
24
+ },
25
+ format: {
26
+ title: '포맷',
27
+ placeholder: '선택하세요',
28
+ dataSource: ValidatorFormats,
29
+ },
30
+ validator: {
31
+ title: '사용자 정의 유효성 검사 도구',
32
+ tooltip: '형식: function (value){ return "Error Message"}',
33
+ },
34
+ pattern: 'RegExp',
35
+ len: '길이 제한',
36
+ max: '길이/값 Lt',
37
+ min: '길이/값 Gt',
38
+ exclusiveMaximum: '길이/값 Lte',
39
+ exclusiveMinimum: '길이/값 Gte',
40
+ whitespace: '공백 없음',
41
+ required: '필수 항목',
42
+ message: {
43
+ title: '오류 메시지',
44
+ tooltip: '오류 메시지는 현재의 규칙 셋의 하나의 빌트인 규칙에 대해서만 적용됩니다. 여러 빌트인 규칙에 대한 오류 메시지를 사용자 정의해야 하는 경우 여러 규칙으로 분할하세요.',
45
+ },
46
+ },
47
+ },
48
+ SettingComponents: {
49
+ DataSourceSetter: {
50
+ nodeProperty: '노드 속성',
51
+ pleaseSelectNode: '왼쪽에 있는 트리에서 노드를 선택하세요.',
52
+ addKeyValuePair: '키/값 쌍 추가',
53
+ configureDataSource: '구성',
54
+ dataSource: 'Options',
55
+ defaultTitle: '기본 제목',
56
+ dataSourceTree: 'Options 트리',
57
+ addNode: '노드 추가',
58
+ label: '레이블',
59
+ value: '값',
60
+ item: '아이템',
61
+ },
62
+ ReactionsSetter: {
63
+ configureReactions: '구성',
64
+ relationsFields: '관련 필드',
65
+ variableName: '변수 이름',
66
+ variableNameValidateMessage: '표준 변수 이름이 아닙니다.',
67
+ pleaseInput: '입력해주세요',
68
+ sourceField: 'Source Field',
69
+ sourceProperty: '필드 속성',
70
+ variableType: '변수 타입',
71
+ operations: '작업',
72
+ addRelationField: '관련 필드 추가',
73
+ propertyReactions: '구성 리엑션(자바스크립트 표현식만 지원함)',
74
+ actionReactions: '액션 리엑션(선택사항, 자바스크립트 구문을 지원함)',
75
+ visible: '보기/없음',
76
+ hidden: '보기/UI 숨기기',
77
+ display: '디스플레이',
78
+ pattern: '패턴',
79
+ title: '제목',
80
+ description: '설명',
81
+ value: '값',
82
+ initialValue: '초기값',
83
+ dataSource: 'Options',
84
+ required: '필수 항목',
85
+ component: '컴포넌트',
86
+ componentProps: '컴포넌트 속성',
87
+ decorator: '테코레이터',
88
+ decoratorProps: '테코레이터 속성',
89
+ pleaseSelect: '선택하세요',
90
+ expressionValueTypeIs: '표현식 값 타입은',
91
+ },
92
+ ValidatorSetter: {
93
+ pleaseSelect: '선택하세요',
94
+ formats: ValidatorFormats,
95
+ },
96
+ },
97
+ },
98
+ };
@@ -0,0 +1,93 @@
1
+ declare const _default: {
2
+ 'zh-CN': {
3
+ settings: {
4
+ 'x-validator': {
5
+ title: string;
6
+ addValidatorRules: string;
7
+ drawer: string;
8
+ triggerType: {
9
+ title: string;
10
+ placeholder: string;
11
+ dataSource: string[];
12
+ };
13
+ format: {
14
+ title: string;
15
+ placeholder: string;
16
+ dataSource: {
17
+ label: string;
18
+ value: string;
19
+ }[];
20
+ };
21
+ validator: {
22
+ title: string;
23
+ tooltip: string;
24
+ };
25
+ pattern: string;
26
+ len: string;
27
+ max: string;
28
+ min: string;
29
+ exclusiveMaximum: string;
30
+ exclusiveMinimum: string;
31
+ whitespace: string;
32
+ required: string;
33
+ message: {
34
+ title: string;
35
+ tooltip: string;
36
+ };
37
+ };
38
+ };
39
+ SettingComponents: {
40
+ DataSourceSetter: {
41
+ nodeProperty: string;
42
+ pleaseSelectNode: string;
43
+ addKeyValuePair: string;
44
+ configureDataSource: string;
45
+ dataSource: string;
46
+ defaultTitle: string;
47
+ dataSourceTree: string;
48
+ addNode: string;
49
+ label: string;
50
+ value: string;
51
+ item: string;
52
+ };
53
+ ReactionsSetter: {
54
+ configureReactions: string;
55
+ relationsFields: string;
56
+ variableName: string;
57
+ variableNameValidateMessage: string;
58
+ pleaseInput: string;
59
+ sourceField: string;
60
+ sourceProperty: string;
61
+ variableType: string;
62
+ operations: string;
63
+ addRelationField: string;
64
+ propertyReactions: string;
65
+ actionReactions: string;
66
+ visible: string;
67
+ hidden: string;
68
+ display: string;
69
+ pattern: string;
70
+ title: string;
71
+ description: string;
72
+ value: string;
73
+ initialValue: string;
74
+ dataSource: string;
75
+ required: string;
76
+ component: string;
77
+ componentProps: string;
78
+ decorator: string;
79
+ decoratorProps: string;
80
+ pleaseSelect: string;
81
+ expressionValueTypeIs: string;
82
+ };
83
+ ValidatorSetter: {
84
+ pleaseSelect: string;
85
+ formats: {
86
+ label: string;
87
+ value: string;
88
+ }[];
89
+ };
90
+ };
91
+ };
92
+ };
93
+ export default _default;
@@ -0,0 +1,98 @@
1
+ const ValidatorFormats = [
2
+ { label: 'URL地址', value: 'url' },
3
+ { label: '邮箱格式', value: 'email' },
4
+ { label: '数字格式', value: 'number' },
5
+ { label: '整数格式', value: 'integer' },
6
+ { label: '身份证格式', value: 'idcard' },
7
+ { label: '手机号格式', value: 'phone' },
8
+ { label: '货币格式', value: 'money' },
9
+ { label: '中文格式', value: 'zh' },
10
+ { label: '日期格式', value: 'date' },
11
+ { label: '邮编格式', value: 'zip' },
12
+ ];
13
+ export default {
14
+ 'zh-CN': {
15
+ settings: {
16
+ 'x-validator': {
17
+ title: '校验规则',
18
+ addValidatorRules: '添加校验规则',
19
+ drawer: '配置规则',
20
+ triggerType: {
21
+ title: '触发类型',
22
+ placeholder: '请选择',
23
+ dataSource: ['输入时', '聚焦时', '失焦时'],
24
+ },
25
+ format: {
26
+ title: '格式校验',
27
+ placeholder: '请选择',
28
+ dataSource: ValidatorFormats,
29
+ },
30
+ validator: {
31
+ title: '自定义校验器',
32
+ tooltip: '格式: function (value){ return "Error Message"}',
33
+ },
34
+ pattern: '正则表达式',
35
+ len: '长度限制',
36
+ max: '长度/数值小于',
37
+ min: '长度/数值大于',
38
+ exclusiveMaximum: '长度/数值小于等于',
39
+ exclusiveMinimum: '长度/数值大于等于',
40
+ whitespace: '不允许空白符',
41
+ required: '是否必填',
42
+ message: {
43
+ title: '错误消息',
44
+ tooltip: '错误消息只对当前规则集的一个内置规则生效,如果需要对不同内置规则定制错误消息,请拆分成多条规则',
45
+ },
46
+ },
47
+ },
48
+ SettingComponents: {
49
+ DataSourceSetter: {
50
+ nodeProperty: '节点属性',
51
+ pleaseSelectNode: '请先选择左侧树节点',
52
+ addKeyValuePair: '添加键值对',
53
+ configureDataSource: '配置可选项',
54
+ dataSource: '可选项',
55
+ defaultTitle: '默认标题',
56
+ dataSourceTree: '可选项节点树',
57
+ addNode: '新增节点',
58
+ label: '键名',
59
+ value: '键值',
60
+ item: '选项',
61
+ },
62
+ ReactionsSetter: {
63
+ configureReactions: '配置响应器',
64
+ relationsFields: '依赖字段',
65
+ variableName: '变量名',
66
+ variableNameValidateMessage: '不符合变量命名规则',
67
+ pleaseInput: '请输入',
68
+ sourceField: '来源字段',
69
+ sourceProperty: '字段属性',
70
+ variableType: '变量类型',
71
+ operations: '操作',
72
+ addRelationField: '添加依赖字段',
73
+ propertyReactions: '属性响应(仅支持JS表达式)',
74
+ actionReactions: '动作响应(高级,可选,支持JS语句)',
75
+ visible: '显示/隐藏',
76
+ hidden: 'UI隐藏',
77
+ display: '展示状态',
78
+ pattern: 'UI形态',
79
+ title: '标题',
80
+ description: '描述',
81
+ value: '字段值',
82
+ initialValue: '默认值',
83
+ dataSource: '可选项',
84
+ required: '是否必填',
85
+ component: '组件',
86
+ componentProps: '组件属性',
87
+ decorator: '容器',
88
+ decoratorProps: '容器属性',
89
+ pleaseSelect: '请选择',
90
+ expressionValueTypeIs: '表达式值类型为',
91
+ },
92
+ ValidatorSetter: {
93
+ pleaseSelect: '请选择',
94
+ formats: ValidatorFormats,
95
+ },
96
+ },
97
+ },
98
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Form as FormCore } from '@formily/core';
3
+ import { ITreeDataSource } from './types';
4
+ import './styles.less';
5
+ export interface IDataSettingPanelProps {
6
+ treeDataSource: ITreeDataSource;
7
+ allowExtendOption?: boolean;
8
+ effects?: (form: FormCore<any>) => void;
9
+ }
10
+ export declare const DataSettingPanel: React.FC<IDataSettingPanelProps>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataSettingPanel = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const antd_1 = require("antd");
7
+ const icons_1 = require("@ant-design/icons");
8
+ const formily_antd_v6_1 = require("@thienvu18/formily-antd-v6");
9
+ const core_1 = require("@formily/core");
10
+ const reactive_react_1 = require("@formily/reactive-react");
11
+ const react_2 = require("@formily/react");
12
+ const designable_react_settings_form_1 = require("@thienvu18/designable-react-settings-form");
13
+ const designable_react_1 = require("@thienvu18/designable-react");
14
+ const Header_1 = require("./Header");
15
+ const shared_1 = require("./shared");
16
+ require("./styles.less");
17
+ const SchemaField = (0, react_2.createSchemaField)({
18
+ components: {
19
+ FormItem: formily_antd_v6_1.FormItem,
20
+ Input: formily_antd_v6_1.Input,
21
+ ArrayItems: formily_antd_v6_1.ArrayItems,
22
+ ValueInput: designable_react_settings_form_1.ValueInput,
23
+ },
24
+ });
25
+ exports.DataSettingPanel = (0, reactive_react_1.observer)((props) => {
26
+ const { allowExtendOption, effects } = props;
27
+ const prefix = (0, designable_react_1.usePrefix)('data-source-setter');
28
+ const form = (0, react_1.useMemo)(() => {
29
+ let values;
30
+ (0, shared_1.traverseTree)(props.treeDataSource.dataSource, (dataItem) => {
31
+ if (dataItem.key === props.treeDataSource.selectedKey) {
32
+ values = dataItem;
33
+ }
34
+ });
35
+ return (0, core_1.createForm)({
36
+ values,
37
+ effects: effects,
38
+ });
39
+ }, [
40
+ props.treeDataSource.selectedKey,
41
+ props.treeDataSource.dataSource.length,
42
+ ]);
43
+ if (!props.treeDataSource.selectedKey)
44
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_1.Header, { title: (0, jsx_runtime_1.jsx)(designable_react_1.TextWidget, { token: "SettingComponents.DataSourceSetter.nodeProperty" }), extra: null }), (0, jsx_runtime_1.jsx)("div", { className: `${prefix + '-layout-item-content'}`, children: (0, jsx_runtime_1.jsx)(designable_react_1.TextWidget, { token: "SettingComponents.DataSourceSetter.pleaseSelectNode" }) })] }));
45
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_1.Header, { title: (0, jsx_runtime_1.jsx)(designable_react_1.TextWidget, { token: "SettingComponents.DataSourceSetter.nodeProperty" }), extra: allowExtendOption ? ((0, jsx_runtime_1.jsx)(antd_1.Button, { type: "text", onClick: () => {
46
+ form.setFieldState('map', (state) => {
47
+ state.value.push({});
48
+ });
49
+ }, icon: (0, jsx_runtime_1.jsx)(icons_1.PlusOutlined, {}), children: (0, jsx_runtime_1.jsx)(designable_react_1.TextWidget, { token: "SettingComponents.DataSourceSetter.addKeyValuePair" }) })) : null }), (0, jsx_runtime_1.jsx)("div", { className: `${prefix + '-layout-item-content'}`, children: (0, jsx_runtime_1.jsx)(formily_antd_v6_1.Form, { form: form, labelWidth: 60, wrapperWidth: 160, children: (0, jsx_runtime_1.jsx)(SchemaField, { children: (0, jsx_runtime_1.jsx)(SchemaField.Array, { name: "map", "x-component": "ArrayItems", children: (0, jsx_runtime_1.jsxs)(SchemaField.Object, { "x-decorator": "ArrayItems.Item", "x-decorator-props": { type: 'divide' }, children: [(0, jsx_runtime_1.jsx)(SchemaField.String, { title: (0, jsx_runtime_1.jsx)(designable_react_1.TextWidget, { token: "SettingComponents.DataSourceSetter.label" }), "x-decorator": "FormItem", "x-disabled": !allowExtendOption, name: "label", "x-component": "Input" }), (0, jsx_runtime_1.jsx)(SchemaField.String, { title: (0, jsx_runtime_1.jsx)(designable_react_1.TextWidget, { token: "SettingComponents.DataSourceSetter.value" }), "x-decorator": "FormItem", name: "value", "x-component": "ValueInput" }), (0, jsx_runtime_1.jsx)(SchemaField.Void, { "x-component": "ArrayItems.Remove", "x-visible": allowExtendOption, "x-component-props": {
50
+ style: {
51
+ margin: 5,
52
+ display: 'flex',
53
+ justifyContent: 'center',
54
+ alignItems: 'center',
55
+ },
56
+ } })] }) }) }) }) })] }));
57
+ });
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ import './styles.less';
3
+ export interface IHeaderProps {
4
+ extra: ReactNode | null;
5
+ title: ReactNode | string;
6
+ }
7
+ export declare const Header: React.FC<IHeaderProps>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Header = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const reactive_react_1 = require("@formily/reactive-react");
6
+ const designable_react_1 = require("@thienvu18/designable-react");
7
+ require("./styles.less");
8
+ exports.Header = (0, reactive_react_1.observer)(({ extra, title }) => {
9
+ const prefix = (0, designable_react_1.usePrefix)('data-source-setter');
10
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `${prefix + '-layout-item-header'}`, children: [(0, jsx_runtime_1.jsx)("div", { className: `${prefix + '-layout-item-title'}`, children: title }), extra] }));
11
+ });