@genesislcap/expression-builder 15.22.1-GENC-1582.4 → 15.22.1-GENC-1582.6

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.
@@ -737,6 +737,41 @@
737
737
  }
738
738
  ]
739
739
  },
740
+ {
741
+ "kind": "javascript-module",
742
+ "path": "src/types/index.ts",
743
+ "declarations": [],
744
+ "exports": [
745
+ {
746
+ "kind": "js",
747
+ "name": "*",
748
+ "declaration": {
749
+ "name": "*",
750
+ "package": "./public.types"
751
+ }
752
+ },
753
+ {
754
+ "kind": "js",
755
+ "name": "*",
756
+ "declaration": {
757
+ "name": "*",
758
+ "package": "./private.types"
759
+ }
760
+ }
761
+ ]
762
+ },
763
+ {
764
+ "kind": "javascript-module",
765
+ "path": "src/types/private.types.ts",
766
+ "declarations": [],
767
+ "exports": []
768
+ },
769
+ {
770
+ "kind": "javascript-module",
771
+ "path": "src/types/public.types.ts",
772
+ "declarations": [],
773
+ "exports": []
774
+ },
740
775
  {
741
776
  "kind": "javascript-module",
742
777
  "path": "src/utils/data-model.ts",
@@ -1026,41 +1061,6 @@
1026
1061
  }
1027
1062
  ]
1028
1063
  },
1029
- {
1030
- "kind": "javascript-module",
1031
- "path": "src/types/index.ts",
1032
- "declarations": [],
1033
- "exports": [
1034
- {
1035
- "kind": "js",
1036
- "name": "*",
1037
- "declaration": {
1038
- "name": "*",
1039
- "package": "./public.types"
1040
- }
1041
- },
1042
- {
1043
- "kind": "js",
1044
- "name": "*",
1045
- "declaration": {
1046
- "name": "*",
1047
- "package": "./private.types"
1048
- }
1049
- }
1050
- ]
1051
- },
1052
- {
1053
- "kind": "javascript-module",
1054
- "path": "src/types/private.types.ts",
1055
- "declarations": [],
1056
- "exports": []
1057
- },
1058
- {
1059
- "kind": "javascript-module",
1060
- "path": "src/types/public.types.ts",
1061
- "declarations": [],
1062
- "exports": []
1063
- },
1064
1064
  {
1065
1065
  "kind": "javascript-module",
1066
1066
  "path": "src/main/expression-group/expression-group.styles.ts",
@@ -1738,12 +1738,12 @@
1738
1738
  },
1739
1739
  {
1740
1740
  "kind": "javascript-module",
1741
- "path": "src/main/rule-field/rule-field.template.ts",
1741
+ "path": "src/main/rule-operator/rule-operator.template.ts",
1742
1742
  "declarations": [
1743
1743
  {
1744
1744
  "kind": "variable",
1745
1745
  "name": "template",
1746
- "default": "html<RuleField>`\n ${(context) => {\n const selectTag = context.styles?.customElements?.select || 'select';\n const optionTag = context.styles?.customElements?.option || 'option';\n const optgroupTag = context.styles?.customElements?.optgroup || 'optgroup';\n\n return html<RuleField>`\n <${selectTag}\n class=\"form-select\"\n @change=${(x, c) => x.dispatchFieldsChanged(c.event)}\n value=${(x) => x.field?.fieldId}\n >\n <${optionTag} value=\"\">Select a field</${optionTag}>\n ${repeat(\n (x) => x.groupedFieldss,\n html<{ optgroup: string | null; xs: Field[] } | Field, RuleField>`\n ${(groupOrFields) => {\n if ('xs' in groupOrFields) {\n return html<{\n optgroup: string | null;\n xs: Field[];\n }>`\n <${optgroupTag} label=\"${(x) => x.optgroup}\">\n ${repeat(\n (x) => x.xs,\n html<Field>`\n <${optionTag}\n value=\"${(x) => x.fieldId}\"\n ?selected=${(x, c) => x.fieldId === c.parentContext.parent?.field?.fieldId}\n >\n ${(x) => x.label}\n </${optionTag}>\n `,\n )}\n </${optgroupTag}>\n `;\n } else {\n return html<Field>`\n <${optionTag}\n value=\"${(x) => x.fieldId}\"\n ?selected=${(x, c) => x.fieldId === c.parent?.field?.fieldId}\n >\n ${(x) => x.label}\n </${optionTag}>\n `;\n }\n }}\n `,\n )}\n </${selectTag}>\n `;\n }}\n`"
1746
+ "default": "html<RuleOperator>`\n ${(context) => {\n const selectTag = context.styles?.customElements?.select || 'select';\n const optionTag = context.styles?.customElements?.option || 'option';\n const optgroupTag = context.styles?.customElements?.optgroup || 'optgroup';\n\n return html<RuleOperator>`\n <${selectTag}\n class=\"form-select\"\n @change=${(x, c) => x.handleOperatorChange(c.event)}\n value=${(x) => x.operator?.type}\n >\n <${optionTag} value=\"\">Select an operator</${optionTag}>\n ${repeat(\n (x) => x.groupedOperators,\n html<{ optgroup: string | null; xs: Operator[] } | Operator, RuleOperator>`\n ${(groupOrOperator) => {\n if ('xs' in groupOrOperator) {\n return html<{ optgroup: string | null; xs: Operator[] }, RuleOperator>`\n <${optgroupTag} label=\"${groupOrOperator.optgroup}\">\n ${repeat(\n (x) => x.xs,\n html<Operator>`\n <${optionTag}\n value=\"${(x) => x.type}\"\n ?selected=${(x, c) => x.type === c.parentContext.parent.operator?.type}\n title=${(x) => x.tooltip}\n >\n ${(x) => x.label ?? x.type}\n </${optionTag}>\n `,\n )}\n </${optgroupTag}>\n `;\n } else {\n return html<Operator, RuleOperator>`\n <${optionTag}\n value=\"${(x) => x.type}\"\n ?selected=${(x, c) => c.parent.operator?.type === x.type}\n title=${(x) => x.tooltip}\n >\n ${(x) => x.label ?? x.type}\n </${optionTag}>\n `;\n }\n }}\n `,\n )}\n </${selectTag}>\n `;\n }}\n`"
1747
1747
  }
1748
1748
  ],
1749
1749
  "exports": [
@@ -1752,35 +1752,43 @@
1752
1752
  "name": "template",
1753
1753
  "declaration": {
1754
1754
  "name": "template",
1755
- "module": "src/main/rule-field/rule-field.template.ts"
1755
+ "module": "src/main/rule-operator/rule-operator.template.ts"
1756
1756
  }
1757
1757
  }
1758
1758
  ]
1759
1759
  },
1760
1760
  {
1761
1761
  "kind": "javascript-module",
1762
- "path": "src/main/rule-field/rule-field.ts",
1762
+ "path": "src/main/rule-operator/rule-operator.ts",
1763
1763
  "declarations": [
1764
1764
  {
1765
1765
  "kind": "class",
1766
- "description": "Field selector for expression rules.",
1767
- "name": "RuleField",
1766
+ "description": "Operator selector for expression rules.",
1767
+ "name": "RuleOperator",
1768
1768
  "members": [
1769
1769
  {
1770
1770
  "kind": "field",
1771
- "name": "fields",
1771
+ "name": "operators",
1772
1772
  "type": {
1773
- "text": "Field[]"
1773
+ "text": "Operator[]"
1774
1774
  },
1775
1775
  "default": "[]"
1776
1776
  },
1777
1777
  {
1778
1778
  "kind": "field",
1779
- "name": "field",
1779
+ "name": "operator",
1780
1780
  "type": {
1781
- "text": "Field"
1781
+ "text": "Operator"
1782
1782
  }
1783
1783
  },
1784
+ {
1785
+ "kind": "field",
1786
+ "name": "field",
1787
+ "type": {
1788
+ "text": "Field | null"
1789
+ },
1790
+ "default": "null"
1791
+ },
1784
1792
  {
1785
1793
  "kind": "field",
1786
1794
  "name": "config",
@@ -1797,15 +1805,23 @@
1797
1805
  },
1798
1806
  {
1799
1807
  "kind": "field",
1800
- "name": "groupedFieldss",
1808
+ "name": "allowedOperators",
1801
1809
  "type": {
1802
- "text": "(Field | { optgroup: string | null; xs: Field[] })[]"
1810
+ "text": "Operator[]"
1811
+ },
1812
+ "readonly": true
1813
+ },
1814
+ {
1815
+ "kind": "field",
1816
+ "name": "groupedOperators",
1817
+ "type": {
1818
+ "text": "(Operator | { optgroup: string | null; xs: Operator[] })[]"
1803
1819
  },
1804
1820
  "readonly": true
1805
1821
  },
1806
1822
  {
1807
1823
  "kind": "method",
1808
- "name": "dispatchFieldsChanged",
1824
+ "name": "handleOperatorChange",
1809
1825
  "parameters": [
1810
1826
  {
1811
1827
  "name": "event",
@@ -1823,45 +1839,45 @@
1823
1839
  }
1824
1840
  },
1825
1841
  {
1826
- "description": "Bubbled when the selected field changes. detail: `FieldSelectedEventDetail`",
1827
- "name": "field-selected"
1842
+ "description": "Bubbled when the selected operator changes. detail: `OperatorSelectedEventDetail`",
1843
+ "name": "operator-selected"
1828
1844
  }
1829
1845
  ],
1830
1846
  "superclass": {
1831
1847
  "name": "GenesisElement",
1832
1848
  "package": "@genesislcap/web-core"
1833
1849
  },
1834
- "tagName": "expression-rule-field",
1850
+ "tagName": "expression-rule-operator",
1835
1851
  "customElement": true
1836
1852
  }
1837
1853
  ],
1838
1854
  "exports": [
1839
1855
  {
1840
1856
  "kind": "js",
1841
- "name": "RuleField",
1857
+ "name": "RuleOperator",
1842
1858
  "declaration": {
1843
- "name": "RuleField",
1844
- "module": "src/main/rule-field/rule-field.ts"
1859
+ "name": "RuleOperator",
1860
+ "module": "src/main/rule-operator/rule-operator.ts"
1845
1861
  }
1846
1862
  },
1847
1863
  {
1848
1864
  "kind": "custom-element-definition",
1849
- "name": "expression-rule-field",
1865
+ "name": "expression-rule-operator",
1850
1866
  "declaration": {
1851
- "name": "RuleField",
1852
- "module": "src/main/rule-field/rule-field.ts"
1867
+ "name": "RuleOperator",
1868
+ "module": "src/main/rule-operator/rule-operator.ts"
1853
1869
  }
1854
1870
  }
1855
1871
  ]
1856
1872
  },
1857
1873
  {
1858
1874
  "kind": "javascript-module",
1859
- "path": "src/main/rule-operator/rule-operator.template.ts",
1875
+ "path": "src/main/rule-field/rule-field.template.ts",
1860
1876
  "declarations": [
1861
1877
  {
1862
1878
  "kind": "variable",
1863
1879
  "name": "template",
1864
- "default": "html<RuleOperator>`\n ${(context) => {\n const selectTag = context.styles?.customElements?.select || 'select';\n const optionTag = context.styles?.customElements?.option || 'option';\n const optgroupTag = context.styles?.customElements?.optgroup || 'optgroup';\n\n return html<RuleOperator>`\n <${selectTag}\n class=\"form-select\"\n @change=${(x, c) => x.handleOperatorChange(c.event)}\n value=${(x) => x.operator?.type}\n >\n <${optionTag} value=\"\">Select an operator</${optionTag}>\n ${repeat(\n (x) => x.groupedOperators,\n html<{ optgroup: string | null; xs: Operator[] } | Operator, RuleOperator>`\n ${(groupOrOperator) => {\n if ('xs' in groupOrOperator) {\n return html<{ optgroup: string | null; xs: Operator[] }, RuleOperator>`\n <${optgroupTag} label=\"${groupOrOperator.optgroup}\">\n ${repeat(\n (x) => x.xs,\n html<Operator>`\n <${optionTag}\n value=\"${(x) => x.type}\"\n ?selected=${(x, c) => x.type === c.parentContext.parent.operator?.type}\n title=${(x) => x.tooltip}\n >\n ${(x) => x.label ?? x.type}\n </${optionTag}>\n `,\n )}\n </${optgroupTag}>\n `;\n } else {\n return html<Operator, RuleOperator>`\n <${optionTag}\n value=\"${(x) => x.type}\"\n ?selected=${(x, c) => c.parent.operator?.type === x.type}\n title=${(x) => x.tooltip}\n >\n ${(x) => x.label ?? x.type}\n </${optionTag}>\n `;\n }\n }}\n `,\n )}\n </${selectTag}>\n `;\n }}\n`"
1880
+ "default": "html<RuleField>`\n ${(context) => {\n const selectTag = context.styles?.customElements?.select || 'select';\n const optionTag = context.styles?.customElements?.option || 'option';\n const optgroupTag = context.styles?.customElements?.optgroup || 'optgroup';\n\n return html<RuleField>`\n <${selectTag}\n class=\"form-select\"\n @change=${(x, c) => x.dispatchFieldsChanged(c.event)}\n value=${(x) => x.field?.fieldId}\n >\n <${optionTag} value=\"\">Select a field</${optionTag}>\n ${repeat(\n (x) => x.groupedFieldss,\n html<{ optgroup: string | null; xs: Field[] } | Field, RuleField>`\n ${(groupOrFields) => {\n if ('xs' in groupOrFields) {\n return html<{\n optgroup: string | null;\n xs: Field[];\n }>`\n <${optgroupTag} label=\"${(x) => x.optgroup}\">\n ${repeat(\n (x) => x.xs,\n html<Field>`\n <${optionTag}\n value=\"${(x) => x.fieldId}\"\n ?selected=${(x, c) => x.fieldId === c.parentContext.parent?.field?.fieldId}\n >\n ${(x) => x.label}\n </${optionTag}>\n `,\n )}\n </${optgroupTag}>\n `;\n } else {\n return html<Field>`\n <${optionTag}\n value=\"${(x) => x.fieldId}\"\n ?selected=${(x, c) => x.fieldId === c.parent?.field?.fieldId}\n >\n ${(x) => x.label}\n </${optionTag}>\n `;\n }\n }}\n `,\n )}\n </${selectTag}>\n `;\n }}\n`"
1865
1881
  }
1866
1882
  ],
1867
1883
  "exports": [
@@ -1870,42 +1886,34 @@
1870
1886
  "name": "template",
1871
1887
  "declaration": {
1872
1888
  "name": "template",
1873
- "module": "src/main/rule-operator/rule-operator.template.ts"
1889
+ "module": "src/main/rule-field/rule-field.template.ts"
1874
1890
  }
1875
1891
  }
1876
1892
  ]
1877
1893
  },
1878
1894
  {
1879
1895
  "kind": "javascript-module",
1880
- "path": "src/main/rule-operator/rule-operator.ts",
1896
+ "path": "src/main/rule-field/rule-field.ts",
1881
1897
  "declarations": [
1882
1898
  {
1883
1899
  "kind": "class",
1884
- "description": "Operator selector for expression rules.",
1885
- "name": "RuleOperator",
1900
+ "description": "Field selector for expression rules.",
1901
+ "name": "RuleField",
1886
1902
  "members": [
1887
1903
  {
1888
1904
  "kind": "field",
1889
- "name": "operators",
1905
+ "name": "fields",
1890
1906
  "type": {
1891
- "text": "Operator[]"
1907
+ "text": "Field[]"
1892
1908
  },
1893
1909
  "default": "[]"
1894
1910
  },
1895
- {
1896
- "kind": "field",
1897
- "name": "operator",
1898
- "type": {
1899
- "text": "Operator"
1900
- }
1901
- },
1902
1911
  {
1903
1912
  "kind": "field",
1904
1913
  "name": "field",
1905
1914
  "type": {
1906
- "text": "Field | null"
1907
- },
1908
- "default": "null"
1915
+ "text": "Field"
1916
+ }
1909
1917
  },
1910
1918
  {
1911
1919
  "kind": "field",
@@ -1923,23 +1931,15 @@
1923
1931
  },
1924
1932
  {
1925
1933
  "kind": "field",
1926
- "name": "allowedOperators",
1927
- "type": {
1928
- "text": "Operator[]"
1929
- },
1930
- "readonly": true
1931
- },
1932
- {
1933
- "kind": "field",
1934
- "name": "groupedOperators",
1934
+ "name": "groupedFieldss",
1935
1935
  "type": {
1936
- "text": "(Operator | { optgroup: string | null; xs: Operator[] })[]"
1936
+ "text": "(Field | { optgroup: string | null; xs: Field[] })[]"
1937
1937
  },
1938
1938
  "readonly": true
1939
1939
  },
1940
1940
  {
1941
1941
  "kind": "method",
1942
- "name": "handleOperatorChange",
1942
+ "name": "dispatchFieldsChanged",
1943
1943
  "parameters": [
1944
1944
  {
1945
1945
  "name": "event",
@@ -1957,33 +1957,33 @@
1957
1957
  }
1958
1958
  },
1959
1959
  {
1960
- "description": "Bubbled when the selected operator changes. detail: `OperatorSelectedEventDetail`",
1961
- "name": "operator-selected"
1960
+ "description": "Bubbled when the selected field changes. detail: `FieldSelectedEventDetail`",
1961
+ "name": "field-selected"
1962
1962
  }
1963
1963
  ],
1964
1964
  "superclass": {
1965
1965
  "name": "GenesisElement",
1966
1966
  "package": "@genesislcap/web-core"
1967
1967
  },
1968
- "tagName": "expression-rule-operator",
1968
+ "tagName": "expression-rule-field",
1969
1969
  "customElement": true
1970
1970
  }
1971
1971
  ],
1972
1972
  "exports": [
1973
1973
  {
1974
1974
  "kind": "js",
1975
- "name": "RuleOperator",
1975
+ "name": "RuleField",
1976
1976
  "declaration": {
1977
- "name": "RuleOperator",
1978
- "module": "src/main/rule-operator/rule-operator.ts"
1977
+ "name": "RuleField",
1978
+ "module": "src/main/rule-field/rule-field.ts"
1979
1979
  }
1980
1980
  },
1981
1981
  {
1982
1982
  "kind": "custom-element-definition",
1983
- "name": "expression-rule-operator",
1983
+ "name": "expression-rule-field",
1984
1984
  "declaration": {
1985
- "name": "RuleOperator",
1986
- "module": "src/main/rule-operator/rule-operator.ts"
1985
+ "name": "RuleField",
1986
+ "module": "src/main/rule-field/rule-field.ts"
1987
1987
  }
1988
1988
  }
1989
1989
  ]
@@ -80,16 +80,6 @@ export declare const ExpressionRule: React.ForwardRefExoticComponent<
80
80
  >;
81
81
  export type ExpressionRuleRef = ExpressionRuleWC;
82
82
 
83
- export declare const RuleField: React.ForwardRefExoticComponent<
84
- React.PropsWithChildren<
85
- Omit<PublicOf<RuleFieldWC>, 'children' | 'style'> &
86
- HTMLWCProps & {
87
- onFieldSelected?: (event: CustomEvent<FieldSelectedEventDetail>) => void;
88
- }
89
- > & React.RefAttributes<RuleFieldWC>
90
- >;
91
- export type RuleFieldRef = RuleFieldWC;
92
-
93
83
  export declare const RuleOperator: React.ForwardRefExoticComponent<
94
84
  React.PropsWithChildren<
95
85
  Omit<PublicOf<RuleOperatorWC>, 'children' | 'style'> &
@@ -100,6 +90,16 @@ export declare const RuleOperator: React.ForwardRefExoticComponent<
100
90
  >;
101
91
  export type RuleOperatorRef = RuleOperatorWC;
102
92
 
93
+ export declare const RuleField: React.ForwardRefExoticComponent<
94
+ React.PropsWithChildren<
95
+ Omit<PublicOf<RuleFieldWC>, 'children' | 'style'> &
96
+ HTMLWCProps & {
97
+ onFieldSelected?: (event: CustomEvent<FieldSelectedEventDetail>) => void;
98
+ }
99
+ > & React.RefAttributes<RuleFieldWC>
100
+ >;
101
+ export type RuleFieldRef = RuleFieldWC;
102
+
103
103
  export declare const RuleValue: React.ForwardRefExoticComponent<
104
104
  React.PropsWithChildren<
105
105
  Omit<PublicOf<RuleValueWC>, 'children' | 'style'> &
package/dist/react.cjs CHANGED
@@ -118,38 +118,38 @@ const ExpressionRule = React.forwardRef(function ExpressionRule(props, ref) {
118
118
  return React.createElement(customElements.getName(ExpressionRuleWC) ?? 'expression-rule', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
119
119
  });
120
120
 
121
- const RuleField = React.forwardRef(function RuleField(props, ref) {
122
- const { onFieldSelected, children, ...rest } = props;
121
+ const RuleOperator = React.forwardRef(function RuleOperator(props, ref) {
122
+ const { onOperatorSelected, children, ...rest } = props;
123
123
  const _innerRef = React.useRef(null);
124
- const _onFieldSelectedRef = React.useRef(onFieldSelected);
125
- _onFieldSelectedRef.current = onFieldSelected;
124
+ const _onOperatorSelectedRef = React.useRef(onOperatorSelected);
125
+ _onOperatorSelectedRef.current = onOperatorSelected;
126
126
  React.useLayoutEffect(() => {
127
127
  const el = _innerRef.current;
128
128
  if (!el) return;
129
- const _onFieldSelectedFn = (e) => _onFieldSelectedRef.current?.(e);
130
- el.addEventListener('field-selected', _onFieldSelectedFn);
129
+ const _onOperatorSelectedFn = (e) => _onOperatorSelectedRef.current?.(e);
130
+ el.addEventListener('operator-selected', _onOperatorSelectedFn);
131
131
  return () => {
132
- el.removeEventListener('field-selected', _onFieldSelectedFn);
132
+ el.removeEventListener('operator-selected', _onOperatorSelectedFn);
133
133
  };
134
134
  }, []);
135
- return React.createElement(customElements.getName(RuleFieldWC) ?? 'expression-rule-field', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
135
+ return React.createElement(customElements.getName(RuleOperatorWC) ?? 'expression-rule-operator', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
136
136
  });
137
137
 
138
- const RuleOperator = React.forwardRef(function RuleOperator(props, ref) {
139
- const { onOperatorSelected, children, ...rest } = props;
138
+ const RuleField = React.forwardRef(function RuleField(props, ref) {
139
+ const { onFieldSelected, children, ...rest } = props;
140
140
  const _innerRef = React.useRef(null);
141
- const _onOperatorSelectedRef = React.useRef(onOperatorSelected);
142
- _onOperatorSelectedRef.current = onOperatorSelected;
141
+ const _onFieldSelectedRef = React.useRef(onFieldSelected);
142
+ _onFieldSelectedRef.current = onFieldSelected;
143
143
  React.useLayoutEffect(() => {
144
144
  const el = _innerRef.current;
145
145
  if (!el) return;
146
- const _onOperatorSelectedFn = (e) => _onOperatorSelectedRef.current?.(e);
147
- el.addEventListener('operator-selected', _onOperatorSelectedFn);
146
+ const _onFieldSelectedFn = (e) => _onFieldSelectedRef.current?.(e);
147
+ el.addEventListener('field-selected', _onFieldSelectedFn);
148
148
  return () => {
149
- el.removeEventListener('operator-selected', _onOperatorSelectedFn);
149
+ el.removeEventListener('field-selected', _onFieldSelectedFn);
150
150
  };
151
151
  }, []);
152
- return React.createElement(customElements.getName(RuleOperatorWC) ?? 'expression-rule-operator', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
152
+ return React.createElement(customElements.getName(RuleFieldWC) ?? 'expression-rule-field', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
153
153
  });
154
154
 
155
155
  const RuleValue = React.forwardRef(function RuleValue(props, ref) {
@@ -178,7 +178,7 @@ module.exports = {
178
178
  ExpressionBuilder,
179
179
  ExpressionGroup,
180
180
  ExpressionRule,
181
- RuleField,
182
181
  RuleOperator,
182
+ RuleField,
183
183
  RuleValue,
184
184
  };
package/dist/react.mjs CHANGED
@@ -116,38 +116,38 @@ export const ExpressionRule = React.forwardRef(function ExpressionRule(props, re
116
116
  return React.createElement(customElements.getName(ExpressionRuleWC) ?? 'expression-rule', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
117
117
  });
118
118
 
119
- export const RuleField = React.forwardRef(function RuleField(props, ref) {
120
- const { onFieldSelected, children, ...rest } = props;
119
+ export const RuleOperator = React.forwardRef(function RuleOperator(props, ref) {
120
+ const { onOperatorSelected, children, ...rest } = props;
121
121
  const _innerRef = React.useRef(null);
122
- const _onFieldSelectedRef = React.useRef(onFieldSelected);
123
- _onFieldSelectedRef.current = onFieldSelected;
122
+ const _onOperatorSelectedRef = React.useRef(onOperatorSelected);
123
+ _onOperatorSelectedRef.current = onOperatorSelected;
124
124
  React.useLayoutEffect(() => {
125
125
  const el = _innerRef.current;
126
126
  if (!el) return;
127
- const _onFieldSelectedFn = (e) => _onFieldSelectedRef.current?.(e);
128
- el.addEventListener('field-selected', _onFieldSelectedFn);
127
+ const _onOperatorSelectedFn = (e) => _onOperatorSelectedRef.current?.(e);
128
+ el.addEventListener('operator-selected', _onOperatorSelectedFn);
129
129
  return () => {
130
- el.removeEventListener('field-selected', _onFieldSelectedFn);
130
+ el.removeEventListener('operator-selected', _onOperatorSelectedFn);
131
131
  };
132
132
  }, []);
133
- return React.createElement(customElements.getName(RuleFieldWC) ?? 'expression-rule-field', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
133
+ return React.createElement(customElements.getName(RuleOperatorWC) ?? 'expression-rule-operator', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
134
134
  });
135
135
 
136
- export const RuleOperator = React.forwardRef(function RuleOperator(props, ref) {
137
- const { onOperatorSelected, children, ...rest } = props;
136
+ export const RuleField = React.forwardRef(function RuleField(props, ref) {
137
+ const { onFieldSelected, children, ...rest } = props;
138
138
  const _innerRef = React.useRef(null);
139
- const _onOperatorSelectedRef = React.useRef(onOperatorSelected);
140
- _onOperatorSelectedRef.current = onOperatorSelected;
139
+ const _onFieldSelectedRef = React.useRef(onFieldSelected);
140
+ _onFieldSelectedRef.current = onFieldSelected;
141
141
  React.useLayoutEffect(() => {
142
142
  const el = _innerRef.current;
143
143
  if (!el) return;
144
- const _onOperatorSelectedFn = (e) => _onOperatorSelectedRef.current?.(e);
145
- el.addEventListener('operator-selected', _onOperatorSelectedFn);
144
+ const _onFieldSelectedFn = (e) => _onFieldSelectedRef.current?.(e);
145
+ el.addEventListener('field-selected', _onFieldSelectedFn);
146
146
  return () => {
147
- el.removeEventListener('operator-selected', _onOperatorSelectedFn);
147
+ el.removeEventListener('field-selected', _onFieldSelectedFn);
148
148
  };
149
149
  }, []);
150
- return React.createElement(customElements.getName(RuleOperatorWC) ?? 'expression-rule-operator', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
150
+ return React.createElement(customElements.getName(RuleFieldWC) ?? 'expression-rule-field', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
151
151
  });
152
152
 
153
153
  export const RuleValue = React.forwardRef(function RuleValue(props, ref) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/expression-builder",
3
3
  "description": "Genesis Foundation Expression Builder",
4
- "version": "15.22.1-GENC-1582.4",
4
+ "version": "15.22.1-GENC-1582.6",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/expression-builder.d.ts",
@@ -38,16 +38,16 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@genesislcap/foundation-testing": "15.22.1-GENC-1582.4",
42
- "@genesislcap/genx": "15.22.1-GENC-1582.4",
43
- "@genesislcap/rollup-builder": "15.22.1-GENC-1582.4",
44
- "@genesislcap/ts-builder": "15.22.1-GENC-1582.4",
45
- "@genesislcap/uvu-playwright-builder": "15.22.1-GENC-1582.4",
46
- "@genesislcap/vite-builder": "15.22.1-GENC-1582.4",
47
- "@genesislcap/webpack-builder": "15.22.1-GENC-1582.4"
41
+ "@genesislcap/foundation-testing": "15.22.1-GENC-1582.6",
42
+ "@genesislcap/genx": "15.22.1-GENC-1582.6",
43
+ "@genesislcap/rollup-builder": "15.22.1-GENC-1582.6",
44
+ "@genesislcap/ts-builder": "15.22.1-GENC-1582.6",
45
+ "@genesislcap/uvu-playwright-builder": "15.22.1-GENC-1582.6",
46
+ "@genesislcap/vite-builder": "15.22.1-GENC-1582.6",
47
+ "@genesislcap/webpack-builder": "15.22.1-GENC-1582.6"
48
48
  },
49
49
  "dependencies": {
50
- "@genesislcap/web-core": "15.22.1-GENC-1582.4",
50
+ "@genesislcap/web-core": "15.22.1-GENC-1582.6",
51
51
  "rfdc": "1.4.1"
52
52
  },
53
53
  "repository": {