@thienvu18/designable-formily-setters 2.0.0 → 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 +25 -25
@@ -1,103 +1,100 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useSelectedNode } from '@thienvu18/designable-react';
3
- import { TreeSelect } from 'antd';
1
+ import { useSelectedNode } from '@thienvu18/designable-react'
2
+ import { TreeSelect } from 'antd'
3
+ import { jsx as _jsx } from 'react/jsx-runtime'
4
4
  const transformDataSource = (node) => {
5
- const currentNode = node;
6
- const dots = (count) => {
7
- let dots = '';
8
- for (let i = 0; i < count; i++) {
9
- dots += '.';
10
- }
11
- return dots;
12
- };
13
- const targetPath = (parentNode, targetNode) => {
14
- const path = [];
15
- const transform = (node) => {
16
- if (node && node !== parentNode) {
17
- path.push(node.props.name || node.id);
18
- }
19
- else {
20
- transform(node.parent);
21
- }
22
- };
23
- transform(targetNode);
24
- return path.reverse().join('.');
25
- };
26
- const hasNoVoidChildren = (node) => {
27
- return node.children?.some((node) => {
28
- if (node.props.type !== 'void' && node !== currentNode)
29
- return true;
30
- return hasNoVoidChildren(node);
31
- });
32
- };
33
- const findRoot = (node) => {
34
- if (!node?.parent)
35
- return node;
36
- if (node?.parent?.componentName !== node.componentName)
37
- return node.parent;
38
- return findRoot(node.parent);
39
- };
40
- const findArrayParent = (node) => {
41
- if (!node?.parent)
42
- return;
43
- if (node.parent.props.type === 'array')
44
- return node.parent;
45
- if (node.parent === root)
46
- return;
47
- return findArrayParent(node.parent);
48
- };
49
- const transformRelativePath = (arrayNode, targetNode) => {
50
- if (targetNode.depth === currentNode.depth)
51
- return `.${targetNode.props.name || targetNode.id}`;
52
- return `${dots(currentNode.depth - arrayNode.depth)}[].${targetPath(arrayNode, targetNode)}`;
53
- };
54
- const transformChildren = (children, path = []) => {
55
- return children.reduce((buf, node) => {
56
- if (node === currentNode)
57
- return buf;
58
- if (node.props.type === 'array' && !node.contains(currentNode))
59
- return buf;
60
- if (node.props.type === 'void' && !hasNoVoidChildren(node))
61
- return buf;
62
- const currentPath = path.concat(node.props.name || node.id);
63
- const arrayNode = findArrayParent(node);
64
- const label = node.props.title ||
65
- node.props['x-component-props']?.title ||
66
- node.props.name ||
67
- node.designerProps.title;
68
- const value = arrayNode
69
- ? transformRelativePath(arrayNode, node)
70
- : currentPath.join('.');
71
- return buf.concat({
72
- label,
73
- value,
74
- node,
75
- children: transformChildren(node.children, currentPath),
76
- });
77
- }, []);
78
- };
79
- const root = findRoot(node);
80
- if (root) {
81
- return transformChildren(root.children);
5
+ const currentNode = node
6
+ const dots = (count) => {
7
+ let dots = ''
8
+ for (let i = 0; i < count; i++) {
9
+ dots += '.'
82
10
  }
83
- return [];
84
- };
11
+ return dots
12
+ }
13
+ const targetPath = (parentNode, targetNode) => {
14
+ const path = []
15
+ const transform = (node) => {
16
+ if (node && node !== parentNode) {
17
+ path.push(node.props.name || node.id)
18
+ } else {
19
+ transform(node.parent)
20
+ }
21
+ }
22
+ transform(targetNode)
23
+ return path.reverse().join('.')
24
+ }
25
+ const hasNoVoidChildren = (node) => {
26
+ return node.children?.some((node) => {
27
+ if (node.props.type !== 'void' && node !== currentNode) return true
28
+ return hasNoVoidChildren(node)
29
+ })
30
+ }
31
+ const findRoot = (node) => {
32
+ if (!node?.parent) return node
33
+ if (node?.parent?.componentName !== node.componentName) return node.parent
34
+ return findRoot(node.parent)
35
+ }
36
+ const findArrayParent = (node) => {
37
+ if (!node?.parent) return
38
+ if (node.parent.props.type === 'array') return node.parent
39
+ if (node.parent === root) return
40
+ return findArrayParent(node.parent)
41
+ }
42
+ const transformRelativePath = (arrayNode, targetNode) => {
43
+ if (targetNode.depth === currentNode.depth)
44
+ return `.${targetNode.props.name || targetNode.id}`
45
+ return `${dots(currentNode.depth - arrayNode.depth)}[].${targetPath(
46
+ arrayNode,
47
+ targetNode
48
+ )}`
49
+ }
50
+ const transformChildren = (children, path = []) => {
51
+ return children.reduce((buf, node) => {
52
+ if (node === currentNode) return buf
53
+ if (node.props.type === 'array' && !node.contains(currentNode)) return buf
54
+ if (node.props.type === 'void' && !hasNoVoidChildren(node)) return buf
55
+ const currentPath = path.concat(node.props.name || node.id)
56
+ const arrayNode = findArrayParent(node)
57
+ const label =
58
+ node.props.title ||
59
+ node.props['x-component-props']?.title ||
60
+ node.props.name ||
61
+ node.designerProps.title
62
+ const value = arrayNode
63
+ ? transformRelativePath(arrayNode, node)
64
+ : currentPath.join('.')
65
+ return buf.concat({
66
+ label,
67
+ value,
68
+ node,
69
+ children: transformChildren(node.children, currentPath),
70
+ })
71
+ }, [])
72
+ }
73
+ const root = findRoot(node)
74
+ if (root) {
75
+ return transformChildren(root.children)
76
+ }
77
+ return []
78
+ }
85
79
  export const PathSelector = (props) => {
86
- const baseNode = useSelectedNode();
87
- const dataSource = transformDataSource(baseNode);
88
- const findNode = (dataSource, value) => {
89
- for (let i = 0; i < dataSource.length; i++) {
90
- const item = dataSource[i];
91
- if (item.value === value)
92
- return item.node;
93
- if (item.children?.length) {
94
- const fondedChild = findNode(item.children, value);
95
- if (fondedChild)
96
- return fondedChild;
97
- }
98
- }
99
- };
100
- return (_jsx(TreeSelect, { ...props, onChange: (value) => {
101
- props.onChange(value, findNode(dataSource, value));
102
- }, treeDefaultExpandAll: true, treeData: dataSource }));
103
- };
80
+ const baseNode = useSelectedNode()
81
+ const dataSource = transformDataSource(baseNode)
82
+ const findNode = (dataSource, value) => {
83
+ for (let i = 0; i < dataSource.length; i++) {
84
+ const item = dataSource[i]
85
+ if (item.value === value) return item.node
86
+ if (item.children?.length) {
87
+ const fondedChild = findNode(item.children, value)
88
+ if (fondedChild) return fondedChild
89
+ }
90
+ }
91
+ }
92
+ return _jsx(TreeSelect, {
93
+ ...props,
94
+ onChange: (value) => {
95
+ props.onChange(value, findNode(dataSource, value))
96
+ },
97
+ treeDefaultExpandAll: true,
98
+ treeData: dataSource,
99
+ })
100
+ }
@@ -1,5 +1,5 @@
1
1
  export interface IDependency {
2
- name: string;
3
- path: string;
2
+ name: string
3
+ path: string
4
4
  }
5
- export declare const initDeclaration: () => Promise<void>;
5
+ export declare const initDeclaration: () => Promise<void>
@@ -1,20 +1,31 @@
1
- import { MonacoInput, getNpmCDNRegistry } from '@thienvu18/designable-react-settings-form';
1
+ import {
2
+ MonacoInput,
3
+ getNpmCDNRegistry,
4
+ } from '@thienvu18/designable-react-settings-form'
2
5
  const loadDependencies = async (deps) => {
3
- return Promise.all(deps.map(async ({ name, path }) => ({
4
- name,
5
- path,
6
- library: await fetch(`${getNpmCDNRegistry()}/${name}/${path}`).then((res) => res.text()),
7
- })));
8
- };
6
+ return Promise.all(
7
+ deps.map(async ({ name, path }) => ({
8
+ name,
9
+ path,
10
+ library: await fetch(`${getNpmCDNRegistry()}/${name}/${path}`).then(
11
+ (res) => res.text()
12
+ ),
13
+ }))
14
+ )
15
+ }
9
16
  export const initDeclaration = async () => {
10
- return MonacoInput.loader.init().then(async (monaco) => {
11
- const deps = await loadDependencies([
12
- { name: '@formily/core', path: 'dist/formily.core.all.d.ts' },
13
- ]);
14
- deps?.forEach(({ name, library }) => {
15
- monaco.languages.typescript.typescriptDefaults.addExtraLib(`declare module '${name}'{ ${library} }`, `file:///node_modules/${name}/index.d.ts`);
16
- });
17
- monaco.languages.typescript.typescriptDefaults.addExtraLib(`
17
+ return MonacoInput.loader.init().then(async (monaco) => {
18
+ const deps = await loadDependencies([
19
+ { name: '@formily/core', path: 'dist/formily.core.all.d.ts' },
20
+ ])
21
+ deps?.forEach(({ name, library }) => {
22
+ monaco.languages.typescript.typescriptDefaults.addExtraLib(
23
+ `declare module '${name}'{ ${library} }`,
24
+ `file:///node_modules/${name}/index.d.ts`
25
+ )
26
+ })
27
+ monaco.languages.typescript.typescriptDefaults.addExtraLib(
28
+ `
18
29
  import { Form, Field } from '@formily/core'
19
30
  declare global {
20
31
  /*
@@ -46,6 +57,8 @@ export const initDeclaration = async () => {
46
57
  **/
47
58
  declare var $props: (props: any) => void
48
59
  }
49
- `, `file:///node_modules/formily_global.d.ts`);
50
- });
51
- };
60
+ `,
61
+ `file:///node_modules/formily_global.d.ts`
62
+ )
63
+ })
64
+ }
@@ -1,10 +1,20 @@
1
- export declare const GlobalHelper = "\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n";
2
- export declare const BooleanHelper = "\n/** \n * Example 1\n * Static Boolean\n **/\n\nfalse\n\n/** \n * Example 2\n * Equal Calculation\n **/\n\n$deps.VariableName === 'TARGET_VALUE'\n\n/** \n * Example 3\n * Not Equal Calculation\n **/\n\n$deps.VariableName !== 'TARGET_VALUE'\n\n/** \n * Example 4\n * And Logic Calculation\n **/\n\n$deps.VariableName1 && $deps.VariableName2\n\n/** \n * Example 5\n * Grater Logic Calculation\n **/\n\n$deps.VariableName > 100\n\n/** \n * Example 6\n * Not Logic Calculation\n **/\n\n!$deps.VariableName\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
3
- export declare const DisplayHelper = "\n/** \n * Example 1\n * Static Mode\n **/\n\n'none'\n\n/** \n * Example 2\n * Equal Condition Associated\n **/\n\n$deps.VariableName === 'TARGET_VALUE' ? 'visible' : 'none'\n\n/** \n * Example 3\n * Not Equal Condition Associated\n **/\n\n$deps.VariableName !== 'TARGET_VALUE' ? 'visible' : 'hidden'\n\n/** \n * Example 4\n * And Logic Condition Associated\n **/\n\n$deps.VariableName1 && $deps.VariableName2 ? 'visible' : 'none'\n\n/** \n * Example 5\n * Grater Logic Condition Associated\n **/\n\n$deps.VariableName > 100 ? 'visible' : 'hidden'\n\n/** \n * Example 6\n * Not Logic Condition Associated\n **/\n\n!$deps.VariableName ? 'visible' : 'none'\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
4
- export declare const PatternHelper = "\n/** \n * Example 1\n * Static Mode\n **/\n\n'readPretty'\n\n/** \n * Example 2\n * Equal Condition Associated\n **/\n\n$deps.VariableName === 'TARGET_VALUE' ? 'editable' : 'disabled'\n\n/** \n * Example 3\n * Not Equal Condition Associated\n **/\n\n$deps.VariableName !== 'TARGET_VALUE' ? 'editable' : 'readOnly'\n\n/** \n * Example 4\n * And Logic Condition Associated\n **/\n\n$deps.VariableName1 && $deps.VariableName2 ? 'editable' : 'readPretty'\n\n/** \n * Example 5\n * Grater Logic Condition Associated\n **/\n\n$deps.VariableName > 100 ? 'editable' : 'readOnly'\n\n/** \n * Example 6\n * Not Logic Condition Associated\n **/\n\n!$deps.VariableName ? 'editable' : 'disabled'\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
5
- export declare const StringHelper = "\n/** \n * Example 1\n * Static String\n **/\n\n'Normal String Text'\n\n/** \n * Example 2\n * Associated String\n **/\n\n$deps.VariableName === 'TARGET_VALUE' ? 'Associated String Text' : ''\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
6
- export declare const AnyHelper = "\n/** \n * Example 1\n * String Type\n **/\n\n'String'\n\n/** \n * Example 2\n * String Array\n **/\n\n['StringArray']\n\n/** \n * Example 3\n * Object Array\n **/\n\n[{ key: 'ObjectArray' }]\n\n/** \n * Example 4\n * Boolean\n **/\n\ntrue\n\n/** \n * Example 5\n * RegExp\n **/\n\n/d+/\n\n/** \n * Example 1\n * Associated String Value\n **/\n\n$deps.VariableName + 'Compose String'\n\n/** \n * Example 2\n * Associated Array Value\n **/\n\n[ $deps.VariableName ]\n\n/** \n * Example 3\n * Associated Object Value\n **/\n\n{\n key : $deps.VariableName\n}\n\n/** \n * Example 4\n * Associated Boolean Value\n **/\n\n!$deps.VariableName\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
7
- export declare const DataSourceHelper = "\n/** \n * Example 1\n * Static DataSource\n **/\n\n[\n { label : \"item1\", value: \"1\" },\n { label : \"item2\", value: \"2\" }\n]\n\n/** \n * Example 2\n * Associated DataSource\n **/\n\n[\n { label : \"item1\", value: \"1\" },\n { label : \"item2\", value: \"2\" },\n ...$deps.VariableName\n]\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
8
- export declare const ComponentPropsHelper = "\n/** \n * Example 1\n * Static Props\n **/\n\n{\n placeholder: \"This is placeholder\"\n}\n\n/** \n * Example 2\n * Associated Props\n **/\n\n{\n placeholder: $deps.VariableName\n}\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
9
- export declare const DecoratorPropsHelper = "\n/** \n * Example 1\n * Static Props\n **/\n\n{\n labelCol:6\n}\n\n/** \n * Example 2\n * Associated Props\n **/\n\n{\n labelCol: $deps.VariableName\n}\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
10
- export declare const FulfillRunHelper = "\n/** \n * Example 1\n * Async Select\n **/\n\n$effect(()=>{\n $self.loading = true\n fetch('//some.domain/getSomething')\n .then(response=>response.json())\n .then(({ data })=>{\n $self.loading = false\n $self.dataSource = data\n },()=>{\n $self.loading = false\n })\n},[])\n \n\n/** \n * Example 2\n * Async Search Select\n **/\n\nconst state = $observable({\n keyword:''\n})\n\n$props({\n onSearch(keyword){\n state.keyword = keyword\n }\n})\n\n$effect(()=>{\n $self.loading = true\n fetch(`//some.domain/getSomething?q=${state.keyword}`)\n .then(response=>response.json())\n .then(({ data })=>{\n $self.loading = false\n $self.dataSource = data\n },()=>{\n $self.loading = false\n })\n},[ state.keyword ])\n\n/** \n * Example 3\n * Async Associated Select\n **/\n\nconst state = $observable({\n keyword:''\n})\n\n$props({\n onSearch(keyword){\n state.keyword = keyword\n }\n})\n\n$effect(()=>{\n $self.loading = true\n fetch(`//some.domain/getSomething?q=${state.keyword}&other=${$deps.VariableName}`)\n .then(response=>response.json())\n .then(({ data })=>{\n $self.loading = false\n $self.dataSource = data\n },()=>{\n $self.loading = false\n })\n},[ state.keyword, $deps.VariableName ])\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n";
1
+ export declare const GlobalHelper =
2
+ '\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n'
3
+ export declare const BooleanHelper =
4
+ "\n/** \n * Example 1\n * Static Boolean\n **/\n\nfalse\n\n/** \n * Example 2\n * Equal Calculation\n **/\n\n$deps.VariableName === 'TARGET_VALUE'\n\n/** \n * Example 3\n * Not Equal Calculation\n **/\n\n$deps.VariableName !== 'TARGET_VALUE'\n\n/** \n * Example 4\n * And Logic Calculation\n **/\n\n$deps.VariableName1 && $deps.VariableName2\n\n/** \n * Example 5\n * Grater Logic Calculation\n **/\n\n$deps.VariableName > 100\n\n/** \n * Example 6\n * Not Logic Calculation\n **/\n\n!$deps.VariableName\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n"
5
+ export declare const DisplayHelper =
6
+ "\n/** \n * Example 1\n * Static Mode\n **/\n\n'none'\n\n/** \n * Example 2\n * Equal Condition Associated\n **/\n\n$deps.VariableName === 'TARGET_VALUE' ? 'visible' : 'none'\n\n/** \n * Example 3\n * Not Equal Condition Associated\n **/\n\n$deps.VariableName !== 'TARGET_VALUE' ? 'visible' : 'hidden'\n\n/** \n * Example 4\n * And Logic Condition Associated\n **/\n\n$deps.VariableName1 && $deps.VariableName2 ? 'visible' : 'none'\n\n/** \n * Example 5\n * Grater Logic Condition Associated\n **/\n\n$deps.VariableName > 100 ? 'visible' : 'hidden'\n\n/** \n * Example 6\n * Not Logic Condition Associated\n **/\n\n!$deps.VariableName ? 'visible' : 'none'\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n"
7
+ export declare const PatternHelper =
8
+ "\n/** \n * Example 1\n * Static Mode\n **/\n\n'readPretty'\n\n/** \n * Example 2\n * Equal Condition Associated\n **/\n\n$deps.VariableName === 'TARGET_VALUE' ? 'editable' : 'disabled'\n\n/** \n * Example 3\n * Not Equal Condition Associated\n **/\n\n$deps.VariableName !== 'TARGET_VALUE' ? 'editable' : 'readOnly'\n\n/** \n * Example 4\n * And Logic Condition Associated\n **/\n\n$deps.VariableName1 && $deps.VariableName2 ? 'editable' : 'readPretty'\n\n/** \n * Example 5\n * Grater Logic Condition Associated\n **/\n\n$deps.VariableName > 100 ? 'editable' : 'readOnly'\n\n/** \n * Example 6\n * Not Logic Condition Associated\n **/\n\n!$deps.VariableName ? 'editable' : 'disabled'\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n"
9
+ export declare const StringHelper =
10
+ "\n/** \n * Example 1\n * Static String\n **/\n\n'Normal String Text'\n\n/** \n * Example 2\n * Associated String\n **/\n\n$deps.VariableName === 'TARGET_VALUE' ? 'Associated String Text' : ''\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n"
11
+ export declare const AnyHelper =
12
+ "\n/** \n * Example 1\n * String Type\n **/\n\n'String'\n\n/** \n * Example 2\n * String Array\n **/\n\n['StringArray']\n\n/** \n * Example 3\n * Object Array\n **/\n\n[{ key: 'ObjectArray' }]\n\n/** \n * Example 4\n * Boolean\n **/\n\ntrue\n\n/** \n * Example 5\n * RegExp\n **/\n\n/d+/\n\n/** \n * Example 1\n * Associated String Value\n **/\n\n$deps.VariableName + 'Compose String'\n\n/** \n * Example 2\n * Associated Array Value\n **/\n\n[ $deps.VariableName ]\n\n/** \n * Example 3\n * Associated Object Value\n **/\n\n{\n key : $deps.VariableName\n}\n\n/** \n * Example 4\n * Associated Boolean Value\n **/\n\n!$deps.VariableName\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n"
13
+ export declare const DataSourceHelper =
14
+ '\n/** \n * Example 1\n * Static DataSource\n **/\n\n[\n { label : "item1", value: "1" },\n { label : "item2", value: "2" }\n]\n\n/** \n * Example 2\n * Associated DataSource\n **/\n\n[\n { label : "item1", value: "1" },\n { label : "item2", value: "2" },\n ...$deps.VariableName\n]\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n'
15
+ export declare const ComponentPropsHelper =
16
+ '\n/** \n * Example 1\n * Static Props\n **/\n\n{\n placeholder: "This is placeholder"\n}\n\n/** \n * Example 2\n * Associated Props\n **/\n\n{\n placeholder: $deps.VariableName\n}\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n'
17
+ export declare const DecoratorPropsHelper =
18
+ '\n/** \n * Example 1\n * Static Props\n **/\n\n{\n labelCol:6\n}\n\n/** \n * Example 2\n * Associated Props\n **/\n\n{\n labelCol: $deps.VariableName\n}\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n'
19
+ export declare const FulfillRunHelper =
20
+ "\n/** \n * Example 1\n * Async Select\n **/\n\n$effect(()=>{\n $self.loading = true\n fetch('//some.domain/getSomething')\n .then(response=>response.json())\n .then(({ data })=>{\n $self.loading = false\n $self.dataSource = data\n },()=>{\n $self.loading = false\n })\n},[])\n \n\n/** \n * Example 2\n * Async Search Select\n **/\n\nconst state = $observable({\n keyword:''\n})\n\n$props({\n onSearch(keyword){\n state.keyword = keyword\n }\n})\n\n$effect(()=>{\n $self.loading = true\n fetch(`//some.domain/getSomething?q=${state.keyword}`)\n .then(response=>response.json())\n .then(({ data })=>{\n $self.loading = false\n $self.dataSource = data\n },()=>{\n $self.loading = false\n })\n},[ state.keyword ])\n\n/** \n * Example 3\n * Async Associated Select\n **/\n\nconst state = $observable({\n keyword:''\n})\n\n$props({\n onSearch(keyword){\n state.keyword = keyword\n }\n})\n\n$effect(()=>{\n $self.loading = true\n fetch(`//some.domain/getSomething?q=${state.keyword}&other=${$deps.VariableName}`)\n .then(response=>response.json())\n .then(({ data })=>{\n $self.loading = false\n $self.dataSource = data\n },()=>{\n $self.loading = false\n })\n},[ state.keyword, $deps.VariableName ])\n\n\n/** \n * You can use the built-in context variables\n * \n * 1. `$self` is the current Field Model \n * \n * 2. `$form` is the current Form Model \n * \n * 3. `$deps` is the dependencies value\n * \n * 4. `$observable` function is used to create an persistent observable state object\n *\n * 5. `$memo` function is is used to create a persistent data\n * \n * 6. `$effect` function is used to handle side-effect logic\n * \n * 7. `$props` function is used to set component props to current field\n * \n * Document Links\n * \n * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F\n **/\n\n"
@@ -20,7 +20,7 @@ export const GlobalHelper = `
20
20
  *
21
21
  * https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F
22
22
  **/
23
- `;
23
+ `
24
24
  export const BooleanHelper = `
25
25
  /**
26
26
  * Example 1
@@ -65,7 +65,7 @@ $deps.VariableName > 100
65
65
  !$deps.VariableName
66
66
 
67
67
  ${GlobalHelper}
68
- `;
68
+ `
69
69
  export const DisplayHelper = `
70
70
  /**
71
71
  * Example 1
@@ -110,7 +110,7 @@ $deps.VariableName > 100 ? 'visible' : 'hidden'
110
110
  !$deps.VariableName ? 'visible' : 'none'
111
111
 
112
112
  ${GlobalHelper}
113
- `;
113
+ `
114
114
  export const PatternHelper = `
115
115
  /**
116
116
  * Example 1
@@ -155,7 +155,7 @@ $deps.VariableName > 100 ? 'editable' : 'readOnly'
155
155
  !$deps.VariableName ? 'editable' : 'disabled'
156
156
 
157
157
  ${GlobalHelper}
158
- `;
158
+ `
159
159
  export const StringHelper = `
160
160
  /**
161
161
  * Example 1
@@ -172,7 +172,7 @@ export const StringHelper = `
172
172
  $deps.VariableName === 'TARGET_VALUE' ? 'Associated String Text' : ''
173
173
 
174
174
  ${GlobalHelper}
175
- `;
175
+ `
176
176
  export const AnyHelper = `
177
177
  /**
178
178
  * Example 1
@@ -240,7 +240,7 @@ $deps.VariableName + 'Compose String'
240
240
  !$deps.VariableName
241
241
 
242
242
  ${GlobalHelper}
243
- `;
243
+ `
244
244
  export const DataSourceHelper = `
245
245
  /**
246
246
  * Example 1
@@ -264,7 +264,7 @@ export const DataSourceHelper = `
264
264
  ]
265
265
 
266
266
  ${GlobalHelper}
267
- `;
267
+ `
268
268
  export const ComponentPropsHelper = `
269
269
  /**
270
270
  * Example 1
@@ -285,7 +285,7 @@ export const ComponentPropsHelper = `
285
285
  }
286
286
 
287
287
  ${GlobalHelper}
288
- `;
288
+ `
289
289
  export const DecoratorPropsHelper = `
290
290
  /**
291
291
  * Example 1
@@ -306,7 +306,7 @@ export const DecoratorPropsHelper = `
306
306
  }
307
307
 
308
308
  ${GlobalHelper}
309
- `;
309
+ `
310
310
  export const FulfillRunHelper = `
311
311
  /**
312
312
  * Example 1
@@ -381,4 +381,4 @@ $effect(()=>{
381
381
  },[ state.keyword, $deps.VariableName ])
382
382
 
383
383
  ${GlobalHelper}
384
- `;
384
+ `
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
- import { IReaction } from './types';
3
- import './styles.less';
1
+ import React from 'react'
2
+ import './styles.less'
3
+ import { IReaction } from './types'
4
4
  export interface IReactionsSetterProps {
5
- value?: IReaction;
6
- onChange?: (value: IReaction) => void;
5
+ value?: IReaction
6
+ onChange?: (value: IReaction) => void
7
7
  }
8
- export declare const ReactionsSetter: React.FC<IReactionsSetterProps>;
8
+ export declare const ReactionsSetter: React.FC<IReactionsSetterProps>