@thienvu18/designable-formily-setters 2.0.1 → 2.0.2

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 (89) hide show
  1. package/esm/components/DataSourceSetter/DataSettingPanel.d.ts +8 -8
  2. package/esm/components/DataSourceSetter/DataSettingPanel.js +124 -52
  3. package/esm/components/DataSourceSetter/Header.d.ts +5 -5
  4. package/esm/components/DataSourceSetter/Header.js +16 -7
  5. package/esm/components/DataSourceSetter/Title.d.ts +5 -5
  6. package/esm/components/DataSourceSetter/Title.js +57 -44
  7. package/esm/components/DataSourceSetter/TreePanel.d.ts +10 -10
  8. package/esm/components/DataSourceSetter/TreePanel.js +129 -89
  9. package/esm/components/DataSourceSetter/index.d.ts +16 -16
  10. package/esm/components/DataSourceSetter/index.js +81 -24
  11. package/esm/components/DataSourceSetter/shared.d.ts +14 -7
  12. package/esm/components/DataSourceSetter/shared.js +39 -41
  13. package/esm/components/DataSourceSetter/styles.less +4 -3
  14. package/esm/components/DataSourceSetter/types.d.ts +12 -12
  15. package/esm/components/DataSourceSetter/types.js +1 -1
  16. package/esm/components/ReactionsSetter/FieldPropertySetter.d.ts +6 -6
  17. package/esm/components/ReactionsSetter/FieldPropertySetter.js +140 -63
  18. package/esm/components/ReactionsSetter/PathSelector.d.ts +10 -9
  19. package/esm/components/ReactionsSetter/PathSelector.js +97 -100
  20. package/esm/components/ReactionsSetter/declarations.d.ts +3 -3
  21. package/esm/components/ReactionsSetter/declarations.js +31 -18
  22. package/esm/components/ReactionsSetter/helpers.d.ts +20 -10
  23. package/esm/components/ReactionsSetter/helpers.js +10 -10
  24. package/esm/components/ReactionsSetter/index.d.ts +6 -6
  25. package/esm/components/ReactionsSetter/index.js +412 -230
  26. package/esm/components/ReactionsSetter/properties.d.ts +14 -11
  27. package/esm/components/ReactionsSetter/properties.js +49 -40
  28. package/esm/components/ReactionsSetter/styles.less +2 -2
  29. package/esm/components/ReactionsSetter/types.d.ts +11 -11
  30. package/esm/components/ReactionsSetter/types.js +1 -1
  31. package/esm/components/ValidatorSetter/index.d.ts +4 -4
  32. package/esm/components/ValidatorSetter/index.js +148 -125
  33. package/esm/components/index.d.ts +3 -3
  34. package/esm/components/index.js +3 -3
  35. package/esm/index.d.ts +2 -2
  36. package/esm/index.js +2 -2
  37. package/esm/locales/en-US.d.ts +92 -92
  38. package/esm/locales/en-US.js +96 -93
  39. package/esm/locales/index.d.ts +1 -1
  40. package/esm/locales/index.js +5 -5
  41. package/esm/locales/ko-KR.d.ts +92 -92
  42. package/esm/locales/ko-KR.js +94 -93
  43. package/esm/locales/zh-CN.d.ts +92 -92
  44. package/esm/locales/zh-CN.js +94 -93
  45. package/lib/components/DataSourceSetter/DataSettingPanel.d.ts +8 -8
  46. package/lib/components/DataSourceSetter/DataSettingPanel.js +129 -55
  47. package/lib/components/DataSourceSetter/Header.d.ts +5 -5
  48. package/lib/components/DataSourceSetter/Header.js +19 -10
  49. package/lib/components/DataSourceSetter/Title.d.ts +5 -5
  50. package/lib/components/DataSourceSetter/Title.js +70 -47
  51. package/lib/components/DataSourceSetter/TreePanel.d.ts +10 -10
  52. package/lib/components/DataSourceSetter/TreePanel.js +134 -92
  53. package/lib/components/DataSourceSetter/index.d.ts +16 -16
  54. package/lib/components/DataSourceSetter/index.js +94 -30
  55. package/lib/components/DataSourceSetter/shared.d.ts +14 -7
  56. package/lib/components/DataSourceSetter/shared.js +48 -47
  57. package/lib/components/DataSourceSetter/styles.less +4 -3
  58. package/lib/components/DataSourceSetter/types.d.ts +12 -12
  59. package/lib/components/DataSourceSetter/types.js +2 -2
  60. package/lib/components/ReactionsSetter/FieldPropertySetter.d.ts +6 -6
  61. package/lib/components/ReactionsSetter/FieldPropertySetter.js +150 -67
  62. package/lib/components/ReactionsSetter/PathSelector.d.ts +10 -9
  63. package/lib/components/ReactionsSetter/PathSelector.js +101 -104
  64. package/lib/components/ReactionsSetter/declarations.d.ts +3 -3
  65. package/lib/components/ReactionsSetter/declarations.js +35 -22
  66. package/lib/components/ReactionsSetter/helpers.d.ts +20 -10
  67. package/lib/components/ReactionsSetter/helpers.js +23 -13
  68. package/lib/components/ReactionsSetter/index.d.ts +6 -6
  69. package/lib/components/ReactionsSetter/index.js +434 -234
  70. package/lib/components/ReactionsSetter/properties.d.ts +14 -11
  71. package/lib/components/ReactionsSetter/properties.js +43 -43
  72. package/lib/components/ReactionsSetter/styles.less +2 -2
  73. package/lib/components/ReactionsSetter/types.d.ts +11 -11
  74. package/lib/components/ReactionsSetter/types.js +2 -2
  75. package/lib/components/ValidatorSetter/index.d.ts +4 -4
  76. package/lib/components/ValidatorSetter/index.js +151 -128
  77. package/lib/components/index.d.ts +3 -3
  78. package/lib/components/index.js +35 -19
  79. package/lib/index.d.ts +2 -2
  80. package/lib/index.js +34 -18
  81. package/lib/locales/en-US.d.ts +92 -92
  82. package/lib/locales/en-US.js +98 -95
  83. package/lib/locales/index.d.ts +1 -1
  84. package/lib/locales/index.js +16 -10
  85. package/lib/locales/ko-KR.d.ts +92 -92
  86. package/lib/locales/ko-KR.js +96 -95
  87. package/lib/locales/zh-CN.d.ts +92 -92
  88. package/lib/locales/zh-CN.js +96 -95
  89. package/package.json +5 -5
@@ -1,11 +1,14 @@
1
- export declare const FieldProperties: ({
2
- key: string;
3
- type: string;
4
- helpCode: string;
5
- token?: undefined;
6
- } | {
7
- key: string;
8
- token: string;
9
- type: string;
10
- helpCode: string;
11
- })[];
1
+ export declare const FieldProperties: (
2
+ | {
3
+ key: string
4
+ type: string
5
+ helpCode: string
6
+ token?: undefined
7
+ }
8
+ | {
9
+ key: string
10
+ token: string
11
+ type: string
12
+ helpCode: string
13
+ }
14
+ )[]
@@ -1,41 +1,50 @@
1
- import { BooleanHelper, PatternHelper, StringHelper, AnyHelper, DataSourceHelper, DecoratorPropsHelper, DisplayHelper, ComponentPropsHelper, } from './helpers';
1
+ import {
2
+ AnyHelper,
3
+ BooleanHelper,
4
+ ComponentPropsHelper,
5
+ DataSourceHelper,
6
+ DecoratorPropsHelper,
7
+ DisplayHelper,
8
+ PatternHelper,
9
+ StringHelper,
10
+ } from './helpers'
2
11
  export const FieldProperties = [
3
- {
4
- key: 'visible',
5
- type: 'boolean',
6
- helpCode: BooleanHelper,
7
- },
8
- { key: 'hidden', type: 'boolean', helpCode: BooleanHelper },
9
- {
10
- key: 'display',
11
- type: '"visible" | "hidden" | "none"',
12
- helpCode: DisplayHelper,
13
- },
14
- {
15
- key: 'pattern',
16
- type: '"editable" | "disabled" | "readOnly" | "readPretty"',
17
- helpCode: PatternHelper,
18
- },
19
- { key: 'title', type: 'string', helpCode: StringHelper },
20
- { key: 'description', type: 'string', helpCode: StringHelper },
21
- { key: 'value', type: 'any', helpCode: AnyHelper },
22
- { key: 'initialValue', type: 'any', helpCode: AnyHelper },
23
- { key: 'required', type: 'boolean', helpCode: BooleanHelper },
24
- {
25
- key: 'dataSource',
26
- type: 'Array<{label?:string,value?:any}>',
27
- helpCode: DataSourceHelper,
28
- },
29
- {
30
- key: 'componentProps',
31
- token: 'componentProps',
32
- type: 'object',
33
- helpCode: ComponentPropsHelper,
34
- },
35
- {
36
- key: 'decoratorProps',
37
- token: 'decoratorProps',
38
- type: 'object',
39
- helpCode: DecoratorPropsHelper,
40
- },
41
- ];
12
+ {
13
+ key: 'visible',
14
+ type: 'boolean',
15
+ helpCode: BooleanHelper,
16
+ },
17
+ { key: 'hidden', type: 'boolean', helpCode: BooleanHelper },
18
+ {
19
+ key: 'display',
20
+ type: '"visible" | "hidden" | "none"',
21
+ helpCode: DisplayHelper,
22
+ },
23
+ {
24
+ key: 'pattern',
25
+ type: '"editable" | "disabled" | "readOnly" | "readPretty"',
26
+ helpCode: PatternHelper,
27
+ },
28
+ { key: 'title', type: 'string', helpCode: StringHelper },
29
+ { key: 'description', type: 'string', helpCode: StringHelper },
30
+ { key: 'value', type: 'any', helpCode: AnyHelper },
31
+ { key: 'initialValue', type: 'any', helpCode: AnyHelper },
32
+ { key: 'required', type: 'boolean', helpCode: BooleanHelper },
33
+ {
34
+ key: 'dataSource',
35
+ type: 'Array<{label?:string,value?:any}>',
36
+ helpCode: DataSourceHelper,
37
+ },
38
+ {
39
+ key: 'componentProps',
40
+ token: 'componentProps',
41
+ type: 'object',
42
+ helpCode: ComponentPropsHelper,
43
+ },
44
+ {
45
+ key: 'decoratorProps',
46
+ token: 'decoratorProps',
47
+ type: 'object',
48
+ helpCode: DecoratorPropsHelper,
49
+ },
50
+ ]
@@ -1,4 +1,3 @@
1
-
2
1
  .dn-reactions-setter {
3
2
  width: 100%;
4
3
  min-height: 623px;
@@ -25,7 +24,8 @@
25
24
  &-header {
26
25
  padding: 8px 10px !important;
27
26
  background-color: var(--dn-color-bg-container, #fff) !important;
28
- border-bottom: 1px solid var(--dn-color-border-secondary, rgba(5, 5, 5, 0.06)) !important;
27
+ border-bottom: 1px solid
28
+ var(--dn-color-border-secondary, rgba(5, 5, 5, 0.06)) !important;
29
29
  font-weight: 500 !important;
30
30
 
31
31
  .@{ant-prefix}-collapse-arrow {
@@ -1,13 +1,13 @@
1
1
  export interface IReaction {
2
- dependencies?: {
3
- [key: string]: string;
4
- };
5
- fulfill?: {
6
- state?: {
7
- [key: string]: string;
8
- };
9
- schema?: {
10
- [key: string]: string;
11
- };
12
- };
2
+ dependencies?: {
3
+ [key: string]: string
4
+ }
5
+ fulfill?: {
6
+ state?: {
7
+ [key: string]: string
8
+ }
9
+ schema?: {
10
+ [key: string]: string
11
+ }
12
+ }
13
13
  }
@@ -1 +1 @@
1
- export {};
1
+ export {}
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import React from 'react'
2
2
  export interface IValidatorSetterProps {
3
- value?: any;
4
- onChange?: (value: any) => void;
3
+ value?: any
4
+ onChange?: (value: any) => void
5
5
  }
6
- export declare const ValidatorSetter: React.FC<IValidatorSetterProps>;
6
+ export declare const ValidatorSetter: React.FC<IValidatorSetterProps>
@@ -1,135 +1,158 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { observer, useField, SchemaContext, Schema, } from '@formily/react';
3
- import { GlobalRegistry } from '@thienvu18/designable-core';
4
- import { ArrayItems } from '@thienvu18/formily-antd-v6';
5
- import { FoldItem } from '@thienvu18/designable-react-settings-form';
6
- import { Select } from 'antd';
1
+ import { Schema, SchemaContext, observer, useField } from '@formily/react'
2
+ import { GlobalRegistry } from '@thienvu18/designable-core'
3
+ import { FoldItem } from '@thienvu18/designable-react-settings-form'
4
+ import { ArrayItems } from '@thienvu18/formily-antd-v6'
5
+ import { Select } from 'antd'
6
+ import { jsx as _jsx, jsxs as _jsxs } from 'react/jsx-runtime'
7
7
  const ValidatorSchema = {
8
- type: 'array',
9
- items: {
10
- type: 'object',
11
- 'x-decorator': 'ArrayItems.Item',
12
- 'x-decorator-props': {
13
- style: {
14
- alignItems: 'center',
15
- borderRadius: 3,
16
- paddingTop: 6,
17
- paddingBottom: 6,
18
- },
19
- },
8
+ type: 'array',
9
+ items: {
10
+ type: 'object',
11
+ 'x-decorator': 'ArrayItems.Item',
12
+ 'x-decorator-props': {
13
+ style: {
14
+ alignItems: 'center',
15
+ borderRadius: 3,
16
+ paddingTop: 6,
17
+ paddingBottom: 6,
18
+ },
19
+ },
20
+ properties: {
21
+ sortable: {
22
+ type: 'void',
23
+ 'x-component': 'ArrayItems.SortHandle',
24
+ 'x-component-props': { style: { marginRight: 10 } },
25
+ },
26
+ drawer: {
27
+ type: 'void',
28
+ 'x-component': 'DrawerSetter',
20
29
  properties: {
21
- sortable: {
22
- type: 'void',
23
- 'x-component': 'ArrayItems.SortHandle',
24
- 'x-component-props': { style: { marginRight: 10 } },
25
- },
26
- drawer: {
27
- type: 'void',
28
- 'x-component': 'DrawerSetter',
29
- properties: {
30
- triggerType: {
31
- type: 'string',
32
- enum: ['onInput', 'onFocus', 'onBlur'],
33
- 'x-decorator': 'FormItem',
34
- 'x-component': 'Select',
35
- },
36
- validator: {
37
- type: 'string',
38
- 'x-decorator': 'FormItem',
39
- 'x-component': 'ValueInput',
40
- 'x-component-props': {
41
- include: ['EXPRESSION'],
42
- },
43
- },
44
- message: {
45
- type: 'string',
46
- 'x-decorator': 'FormItem',
47
- 'x-component': 'Input.TextArea',
48
- },
49
- format: {
50
- type: 'string',
51
- 'x-decorator': 'FormItem',
52
- 'x-component': 'Select',
53
- 'x-component-props': {
54
- allowClear: true,
55
- },
56
- },
57
- pattern: {
58
- type: 'string',
59
- 'x-decorator': 'FormItem',
60
- 'x-component': 'Input',
61
- 'x-component-props': {
62
- prefix: '/',
63
- suffix: '/',
64
- },
65
- },
66
- len: {
67
- type: 'string',
68
- 'x-decorator': 'FormItem',
69
- 'x-component': 'NumberPicker',
70
- },
71
- max: {
72
- type: 'string',
73
- 'x-decorator': 'FormItem',
74
- 'x-component': 'NumberPicker',
75
- },
76
- min: {
77
- type: 'string',
78
- 'x-decorator': 'FormItem',
79
- 'x-component': 'NumberPicker',
80
- },
81
- exclusiveMaximum: {
82
- type: 'string',
83
- 'x-decorator': 'FormItem',
84
- 'x-component': 'NumberPicker',
85
- },
86
- exclusiveMinimum: {
87
- type: 'string',
88
- 'x-decorator': 'FormItem',
89
- 'x-component': 'NumberPicker',
90
- },
91
- whitespace: {
92
- type: 'string',
93
- 'x-decorator': 'FormItem',
94
- 'x-component': 'Switch',
95
- },
96
- required: {
97
- type: 'string',
98
- 'x-decorator': 'FormItem',
99
- 'x-component': 'Switch',
100
- },
101
- },
102
- },
103
- moveDown: {
104
- type: 'void',
105
- 'x-component': 'ArrayItems.MoveDown',
106
- 'x-component-props': { style: { marginLeft: 10 } },
30
+ triggerType: {
31
+ type: 'string',
32
+ enum: ['onInput', 'onFocus', 'onBlur'],
33
+ 'x-decorator': 'FormItem',
34
+ 'x-component': 'Select',
35
+ },
36
+ validator: {
37
+ type: 'string',
38
+ 'x-decorator': 'FormItem',
39
+ 'x-component': 'ValueInput',
40
+ 'x-component-props': {
41
+ include: ['EXPRESSION'],
107
42
  },
108
- moveUp: {
109
- type: 'void',
110
- 'x-component': 'ArrayItems.MoveUp',
111
- 'x-component-props': { style: { marginLeft: 5 } },
43
+ },
44
+ message: {
45
+ type: 'string',
46
+ 'x-decorator': 'FormItem',
47
+ 'x-component': 'Input.TextArea',
48
+ },
49
+ format: {
50
+ type: 'string',
51
+ 'x-decorator': 'FormItem',
52
+ 'x-component': 'Select',
53
+ 'x-component-props': {
54
+ allowClear: true,
112
55
  },
113
- remove: {
114
- type: 'void',
115
- 'x-component': 'ArrayItems.Remove',
116
- 'x-component-props': { style: { marginLeft: 5 } },
56
+ },
57
+ pattern: {
58
+ type: 'string',
59
+ 'x-decorator': 'FormItem',
60
+ 'x-component': 'Input',
61
+ 'x-component-props': {
62
+ prefix: '/',
63
+ suffix: '/',
117
64
  },
65
+ },
66
+ len: {
67
+ type: 'string',
68
+ 'x-decorator': 'FormItem',
69
+ 'x-component': 'NumberPicker',
70
+ },
71
+ max: {
72
+ type: 'string',
73
+ 'x-decorator': 'FormItem',
74
+ 'x-component': 'NumberPicker',
75
+ },
76
+ min: {
77
+ type: 'string',
78
+ 'x-decorator': 'FormItem',
79
+ 'x-component': 'NumberPicker',
80
+ },
81
+ exclusiveMaximum: {
82
+ type: 'string',
83
+ 'x-decorator': 'FormItem',
84
+ 'x-component': 'NumberPicker',
85
+ },
86
+ exclusiveMinimum: {
87
+ type: 'string',
88
+ 'x-decorator': 'FormItem',
89
+ 'x-component': 'NumberPicker',
90
+ },
91
+ whitespace: {
92
+ type: 'string',
93
+ 'x-decorator': 'FormItem',
94
+ 'x-component': 'Switch',
95
+ },
96
+ required: {
97
+ type: 'string',
98
+ 'x-decorator': 'FormItem',
99
+ 'x-component': 'Switch',
100
+ },
118
101
  },
102
+ },
103
+ moveDown: {
104
+ type: 'void',
105
+ 'x-component': 'ArrayItems.MoveDown',
106
+ 'x-component-props': { style: { marginLeft: 10 } },
107
+ },
108
+ moveUp: {
109
+ type: 'void',
110
+ 'x-component': 'ArrayItems.MoveUp',
111
+ 'x-component-props': { style: { marginLeft: 5 } },
112
+ },
113
+ remove: {
114
+ type: 'void',
115
+ 'x-component': 'ArrayItems.Remove',
116
+ 'x-component-props': { style: { marginLeft: 5 } },
117
+ },
119
118
  },
120
- properties: {
121
- addValidatorRules: {
122
- type: 'void',
123
- 'x-component': 'ArrayItems.Addition',
124
- 'x-component-props': {
125
- style: {
126
- marginBottom: 10,
127
- },
128
- },
119
+ },
120
+ properties: {
121
+ addValidatorRules: {
122
+ type: 'void',
123
+ 'x-component': 'ArrayItems.Addition',
124
+ 'x-component-props': {
125
+ style: {
126
+ marginBottom: 10,
129
127
  },
128
+ },
130
129
  },
131
- };
130
+ },
131
+ }
132
132
  export const ValidatorSetter = observer((props) => {
133
- const field = useField();
134
- return (_jsxs(FoldItem, { label: field.title, children: [_jsx(FoldItem.Base, { children: _jsx(Select, { value: Array.isArray(props.value) ? undefined : props.value, onChange: props.onChange, allowClear: true, placeholder: GlobalRegistry.getDesignerMessage('SettingComponents.ValidatorSetter.pleaseSelect'), options: GlobalRegistry.getDesignerMessage('SettingComponents.ValidatorSetter.formats') }) }), _jsx(FoldItem.Extra, { children: _jsx(SchemaContext.Provider, { value: new Schema(ValidatorSchema), children: _jsx(ArrayItems, {}) }) })] }));
135
- });
133
+ const field = useField()
134
+ return _jsxs(FoldItem, {
135
+ label: field.title,
136
+ children: [
137
+ _jsx(FoldItem.Base, {
138
+ children: _jsx(Select, {
139
+ value: Array.isArray(props.value) ? undefined : props.value,
140
+ onChange: props.onChange,
141
+ allowClear: true,
142
+ placeholder: GlobalRegistry.getDesignerMessage(
143
+ 'SettingComponents.ValidatorSetter.pleaseSelect'
144
+ ),
145
+ options: GlobalRegistry.getDesignerMessage(
146
+ 'SettingComponents.ValidatorSetter.formats'
147
+ ),
148
+ }),
149
+ }),
150
+ _jsx(FoldItem.Extra, {
151
+ children: _jsx(SchemaContext.Provider, {
152
+ value: new Schema(ValidatorSchema),
153
+ children: _jsx(ArrayItems, {}),
154
+ }),
155
+ }),
156
+ ],
157
+ })
158
+ })
@@ -1,3 +1,3 @@
1
- export * from './DataSourceSetter';
2
- export * from './ReactionsSetter';
3
- export * from './ValidatorSetter';
1
+ export * from './DataSourceSetter'
2
+ export * from './ReactionsSetter'
3
+ export * from './ValidatorSetter'
@@ -1,3 +1,3 @@
1
- export * from './DataSourceSetter';
2
- export * from './ReactionsSetter';
3
- export * from './ValidatorSetter';
1
+ export * from './DataSourceSetter'
2
+ export * from './ReactionsSetter'
3
+ export * from './ValidatorSetter'
package/esm/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import './locales';
2
- export * from './components';
1
+ import './locales'
2
+ export * from './components'
package/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import './locales';
2
- export * from './components';
1
+ import './locales'
2
+ export * from './components'