@genesislcap/expression-builder 14.483.3-alpha-7a2e689.0 → 14.484.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.
@@ -644,30 +644,30 @@
644
644
  "type": {
645
645
  "text": "CustomEvent"
646
646
  },
647
- "description": "Fired when the expression model changes"
647
+ "description": "Fired when the expression model changes. detail: `ChangeEventDetail`"
648
648
  },
649
649
  {
650
- "description": "Bubbled when a nested group add is requested",
650
+ "description": "Bubbled when a nested group add is requested. detail: `AddGroupEventDetail`",
651
651
  "name": "add-group"
652
652
  },
653
653
  {
654
- "description": "Bubbled when a group delete is requested",
654
+ "description": "Bubbled when a group delete is requested. detail: `DelGroupEventDetail`",
655
655
  "name": "del-group"
656
656
  },
657
657
  {
658
- "description": "Bubbled when a rule add is requested",
658
+ "description": "Bubbled when a rule add is requested. detail: `AddRuleEventDetail`",
659
659
  "name": "add-rule"
660
660
  },
661
661
  {
662
- "description": "Bubbled when a rule delete is requested",
662
+ "description": "Bubbled when a rule delete is requested. detail: `DelRuleEventDetail`",
663
663
  "name": "del-rule"
664
664
  },
665
665
  {
666
- "description": "Bubbled when group data changes",
666
+ "description": "Bubbled when group data changes. detail: `UpdateGroupEventDetail`",
667
667
  "name": "update-group"
668
668
  },
669
669
  {
670
- "description": "Bubbled when rule data changes",
670
+ "description": "Bubbled when rule data changes. detail: `UpdateRuleEventDetail`",
671
671
  "name": "update-rule"
672
672
  }
673
673
  ],
@@ -703,6 +703,14 @@
703
703
  "path": "src/main/index.ts",
704
704
  "declarations": [],
705
705
  "exports": [
706
+ {
707
+ "kind": "js",
708
+ "name": "*",
709
+ "declaration": {
710
+ "name": "*",
711
+ "package": "./events"
712
+ }
713
+ },
706
714
  {
707
715
  "kind": "js",
708
716
  "name": "*",
@@ -1241,19 +1249,19 @@
1241
1249
  }
1242
1250
  },
1243
1251
  {
1244
- "description": "Bubbled when adding a child rule",
1252
+ "description": "Bubbled when adding a child rule. detail: `AddRuleEventDetail`",
1245
1253
  "name": "add-rule"
1246
1254
  },
1247
1255
  {
1248
- "description": "Bubbled when adding a child group",
1256
+ "description": "Bubbled when adding a child group. detail: `AddGroupEventDetail`",
1249
1257
  "name": "add-group"
1250
1258
  },
1251
1259
  {
1252
- "description": "Bubbled when deleting this group",
1260
+ "description": "Bubbled when deleting this group. detail: `DelGroupEventDetail`",
1253
1261
  "name": "del-group"
1254
1262
  },
1255
1263
  {
1256
- "description": "Bubbled when combinator changes",
1264
+ "description": "Bubbled when combinator changes. detail: `UpdateGroupEventDetail`",
1257
1265
  "name": "update-group"
1258
1266
  }
1259
1267
  ],
@@ -1684,11 +1692,11 @@
1684
1692
  }
1685
1693
  },
1686
1694
  {
1687
- "description": "Bubbled when deleting this rule",
1695
+ "description": "Bubbled when deleting this rule. detail: `DelRuleEventDetail`",
1688
1696
  "name": "del-rule"
1689
1697
  },
1690
1698
  {
1691
- "description": "Bubbled when field/operator/value changes",
1699
+ "description": "Bubbled when field/operator/value changes. detail: `UpdateRuleEventDetail`",
1692
1700
  "name": "update-rule"
1693
1701
  }
1694
1702
  ],
@@ -1730,12 +1738,12 @@
1730
1738
  },
1731
1739
  {
1732
1740
  "kind": "javascript-module",
1733
- "path": "src/main/rule-operator/rule-operator.template.ts",
1741
+ "path": "src/main/rule-field/rule-field.template.ts",
1734
1742
  "declarations": [
1735
1743
  {
1736
1744
  "kind": "variable",
1737
1745
  "name": "template",
1738
- "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`"
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`"
1739
1747
  }
1740
1748
  ],
1741
1749
  "exports": [
@@ -1744,42 +1752,34 @@
1744
1752
  "name": "template",
1745
1753
  "declaration": {
1746
1754
  "name": "template",
1747
- "module": "src/main/rule-operator/rule-operator.template.ts"
1755
+ "module": "src/main/rule-field/rule-field.template.ts"
1748
1756
  }
1749
1757
  }
1750
1758
  ]
1751
1759
  },
1752
1760
  {
1753
1761
  "kind": "javascript-module",
1754
- "path": "src/main/rule-operator/rule-operator.ts",
1762
+ "path": "src/main/rule-field/rule-field.ts",
1755
1763
  "declarations": [
1756
1764
  {
1757
1765
  "kind": "class",
1758
- "description": "Operator selector for expression rules.",
1759
- "name": "RuleOperator",
1766
+ "description": "Field selector for expression rules.",
1767
+ "name": "RuleField",
1760
1768
  "members": [
1761
1769
  {
1762
1770
  "kind": "field",
1763
- "name": "operators",
1771
+ "name": "fields",
1764
1772
  "type": {
1765
- "text": "Operator[]"
1773
+ "text": "Field[]"
1766
1774
  },
1767
1775
  "default": "[]"
1768
1776
  },
1769
- {
1770
- "kind": "field",
1771
- "name": "operator",
1772
- "type": {
1773
- "text": "Operator"
1774
- }
1775
- },
1776
1777
  {
1777
1778
  "kind": "field",
1778
1779
  "name": "field",
1779
1780
  "type": {
1780
- "text": "Field | null"
1781
- },
1782
- "default": "null"
1781
+ "text": "Field"
1782
+ }
1783
1783
  },
1784
1784
  {
1785
1785
  "kind": "field",
@@ -1797,23 +1797,15 @@
1797
1797
  },
1798
1798
  {
1799
1799
  "kind": "field",
1800
- "name": "allowedOperators",
1801
- "type": {
1802
- "text": "Operator[]"
1803
- },
1804
- "readonly": true
1805
- },
1806
- {
1807
- "kind": "field",
1808
- "name": "groupedOperators",
1800
+ "name": "groupedFieldss",
1809
1801
  "type": {
1810
- "text": "(Operator | { optgroup: string | null; xs: Operator[] })[]"
1802
+ "text": "(Field | { optgroup: string | null; xs: Field[] })[]"
1811
1803
  },
1812
1804
  "readonly": true
1813
1805
  },
1814
1806
  {
1815
1807
  "kind": "method",
1816
- "name": "handleOperatorChange",
1808
+ "name": "dispatchFieldsChanged",
1817
1809
  "parameters": [
1818
1810
  {
1819
1811
  "name": "event",
@@ -1831,45 +1823,45 @@
1831
1823
  }
1832
1824
  },
1833
1825
  {
1834
- "description": "Bubbled when the selected operator changes",
1835
- "name": "operator-selected"
1826
+ "description": "Bubbled when the selected field changes. detail: `FieldSelectedEventDetail`",
1827
+ "name": "field-selected"
1836
1828
  }
1837
1829
  ],
1838
1830
  "superclass": {
1839
1831
  "name": "GenesisElement",
1840
1832
  "package": "@genesislcap/web-core"
1841
1833
  },
1842
- "tagName": "expression-rule-operator",
1834
+ "tagName": "expression-rule-field",
1843
1835
  "customElement": true
1844
1836
  }
1845
1837
  ],
1846
1838
  "exports": [
1847
1839
  {
1848
1840
  "kind": "js",
1849
- "name": "RuleOperator",
1841
+ "name": "RuleField",
1850
1842
  "declaration": {
1851
- "name": "RuleOperator",
1852
- "module": "src/main/rule-operator/rule-operator.ts"
1843
+ "name": "RuleField",
1844
+ "module": "src/main/rule-field/rule-field.ts"
1853
1845
  }
1854
1846
  },
1855
1847
  {
1856
1848
  "kind": "custom-element-definition",
1857
- "name": "expression-rule-operator",
1849
+ "name": "expression-rule-field",
1858
1850
  "declaration": {
1859
- "name": "RuleOperator",
1860
- "module": "src/main/rule-operator/rule-operator.ts"
1851
+ "name": "RuleField",
1852
+ "module": "src/main/rule-field/rule-field.ts"
1861
1853
  }
1862
1854
  }
1863
1855
  ]
1864
1856
  },
1865
1857
  {
1866
1858
  "kind": "javascript-module",
1867
- "path": "src/main/rule-field/rule-field.template.ts",
1859
+ "path": "src/main/rule-operator/rule-operator.template.ts",
1868
1860
  "declarations": [
1869
1861
  {
1870
1862
  "kind": "variable",
1871
1863
  "name": "template",
1872
- "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`"
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`"
1873
1865
  }
1874
1866
  ],
1875
1867
  "exports": [
@@ -1878,35 +1870,43 @@
1878
1870
  "name": "template",
1879
1871
  "declaration": {
1880
1872
  "name": "template",
1881
- "module": "src/main/rule-field/rule-field.template.ts"
1873
+ "module": "src/main/rule-operator/rule-operator.template.ts"
1882
1874
  }
1883
1875
  }
1884
1876
  ]
1885
1877
  },
1886
1878
  {
1887
1879
  "kind": "javascript-module",
1888
- "path": "src/main/rule-field/rule-field.ts",
1880
+ "path": "src/main/rule-operator/rule-operator.ts",
1889
1881
  "declarations": [
1890
1882
  {
1891
1883
  "kind": "class",
1892
- "description": "Field selector for expression rules.",
1893
- "name": "RuleField",
1884
+ "description": "Operator selector for expression rules.",
1885
+ "name": "RuleOperator",
1894
1886
  "members": [
1895
1887
  {
1896
1888
  "kind": "field",
1897
- "name": "fields",
1889
+ "name": "operators",
1898
1890
  "type": {
1899
- "text": "Field[]"
1891
+ "text": "Operator[]"
1900
1892
  },
1901
1893
  "default": "[]"
1902
1894
  },
1903
1895
  {
1904
1896
  "kind": "field",
1905
- "name": "field",
1897
+ "name": "operator",
1906
1898
  "type": {
1907
- "text": "Field"
1899
+ "text": "Operator"
1908
1900
  }
1909
1901
  },
1902
+ {
1903
+ "kind": "field",
1904
+ "name": "field",
1905
+ "type": {
1906
+ "text": "Field | null"
1907
+ },
1908
+ "default": "null"
1909
+ },
1910
1910
  {
1911
1911
  "kind": "field",
1912
1912
  "name": "config",
@@ -1923,15 +1923,23 @@
1923
1923
  },
1924
1924
  {
1925
1925
  "kind": "field",
1926
- "name": "groupedFieldss",
1926
+ "name": "allowedOperators",
1927
1927
  "type": {
1928
- "text": "(Field | { optgroup: string | null; xs: Field[] })[]"
1928
+ "text": "Operator[]"
1929
+ },
1930
+ "readonly": true
1931
+ },
1932
+ {
1933
+ "kind": "field",
1934
+ "name": "groupedOperators",
1935
+ "type": {
1936
+ "text": "(Operator | { optgroup: string | null; xs: Operator[] })[]"
1929
1937
  },
1930
1938
  "readonly": true
1931
1939
  },
1932
1940
  {
1933
1941
  "kind": "method",
1934
- "name": "dispatchFieldsChanged",
1942
+ "name": "handleOperatorChange",
1935
1943
  "parameters": [
1936
1944
  {
1937
1945
  "name": "event",
@@ -1949,33 +1957,33 @@
1949
1957
  }
1950
1958
  },
1951
1959
  {
1952
- "description": "Bubbled when the selected field changes",
1953
- "name": "field-selected"
1960
+ "description": "Bubbled when the selected operator changes. detail: `OperatorSelectedEventDetail`",
1961
+ "name": "operator-selected"
1954
1962
  }
1955
1963
  ],
1956
1964
  "superclass": {
1957
1965
  "name": "GenesisElement",
1958
1966
  "package": "@genesislcap/web-core"
1959
1967
  },
1960
- "tagName": "expression-rule-field",
1968
+ "tagName": "expression-rule-operator",
1961
1969
  "customElement": true
1962
1970
  }
1963
1971
  ],
1964
1972
  "exports": [
1965
1973
  {
1966
1974
  "kind": "js",
1967
- "name": "RuleField",
1975
+ "name": "RuleOperator",
1968
1976
  "declaration": {
1969
- "name": "RuleField",
1970
- "module": "src/main/rule-field/rule-field.ts"
1977
+ "name": "RuleOperator",
1978
+ "module": "src/main/rule-operator/rule-operator.ts"
1971
1979
  }
1972
1980
  },
1973
1981
  {
1974
1982
  "kind": "custom-element-definition",
1975
- "name": "expression-rule-field",
1983
+ "name": "expression-rule-operator",
1976
1984
  "declaration": {
1977
- "name": "RuleField",
1978
- "module": "src/main/rule-field/rule-field.ts"
1985
+ "name": "RuleOperator",
1986
+ "module": "src/main/rule-operator/rule-operator.ts"
1979
1987
  }
1980
1988
  }
1981
1989
  ]
@@ -2238,11 +2246,11 @@
2238
2246
  }
2239
2247
  },
2240
2248
  {
2241
- "description": "Bubbled when operand value changes",
2249
+ "description": "Bubbled when operand value changes. detail: `ValueUpdatedEventDetail`",
2242
2250
  "name": "value-updated"
2243
2251
  },
2244
2252
  {
2245
- "description": "Bubbled when a variadic operand is removed",
2253
+ "description": "Bubbled when a variadic operand is removed. detail: `RemoveVarArgEventDetail`",
2246
2254
  "name": "remove-variadic-operand"
2247
2255
  }
2248
2256
  ],
@@ -1,4 +1,5 @@
1
1
  import { Group, GroupMetadata, Rule } from '../types';
2
+ /** @beta Event names dispatched by the expression builder component family. */
2
3
  export declare enum Events {
3
4
  AddGroup = "add-group",
4
5
  DelGroup = "del-group",
@@ -11,6 +12,7 @@ export declare enum Events {
11
12
  ValueUpdated = "value-updated",
12
13
  RemoveVarArg = "remove-variadic-operand"
13
14
  }
15
+ /** @beta Maps each event name to the `detail` payload carried by its CustomEvent. */
14
16
  export type EventsDetailMap = {
15
17
  [Events.AddGroup]: {
16
18
  parentGroupId: string;
@@ -47,4 +49,31 @@ export type EventsDetailMap = {
47
49
  index: number;
48
50
  };
49
51
  };
52
+ /** @beta Detail payload for the `add-group` event. */
53
+ export type AddGroupEventDetail = EventsDetailMap[Events.AddGroup];
54
+ /** @beta Detail payload for the `del-group` event. */
55
+ export type DelGroupEventDetail = EventsDetailMap[Events.DelGroup];
56
+ /** @beta Detail payload for the `add-rule` event. */
57
+ export type AddRuleEventDetail = EventsDetailMap[Events.AddRule];
58
+ /** @beta Detail payload for the `del-rule` event. */
59
+ export type DelRuleEventDetail = EventsDetailMap[Events.DelRule];
60
+ /** @beta Detail payload for the `update-group` event. */
61
+ export type UpdateGroupEventDetail = EventsDetailMap[Events.UpdateGroup];
62
+ /** @beta Detail payload for the `update-rule` event. */
63
+ export type UpdateRuleEventDetail = EventsDetailMap[Events.UpdateRule];
64
+ /** @beta Detail payload for the `field-selected` event. */
65
+ export type FieldSelectedEventDetail = EventsDetailMap[Events.FieldSelected];
66
+ /** @beta Detail payload for the `operator-selected` event. */
67
+ export type OperatorSelectedEventDetail = EventsDetailMap[Events.OperatorSelected];
68
+ /** @beta Detail payload for the `value-updated` event. */
69
+ export type ValueUpdatedEventDetail = EventsDetailMap[Events.ValueUpdated];
70
+ /** @beta Detail payload for the `remove-variadic-operand` event. */
71
+ export type RemoveVarArgEventDetail = EventsDetailMap[Events.RemoveVarArg];
72
+ /**
73
+ * @beta Detail payload for the `change` event fired by the expression builder component.
74
+ * Alias of `Types.Group` exposed as a plain identifier: `Group` is otherwise only reachable
75
+ * through the `Types` namespace re-export, which the generated React wrapper's detail-type
76
+ * resolution can't follow.
77
+ */
78
+ export type ChangeEventDetail = Group;
50
79
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/main/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEtD,oBAAY,MAAM;IAChB,QAAQ,cAAc;IACtB,QAAQ,cAAc;IAEtB,OAAO,aAAa;IACpB,OAAO,aAAa;IAEpB,WAAW,iBAAiB;IAE5B,UAAU,gBAAgB;IAC1B,aAAa,mBAAmB;IAChC,gBAAgB,sBAAsB;IACtC,YAAY,kBAAkB;IAC9B,YAAY,4BAA4B;CACzC;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IACrF,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAEvC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAA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AAM,CAAC,OAAO,CAAC,CAAC;AAEjE,qDAAqD;AACrD,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjE,yDAAyD;AACzD,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAEzE,wDAAwD;AACxD,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAEvE,2DAA2D;AAC3D,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAE7E,8DAA8D;AAC9D,MAAM,MAAM,2BAA2B,GAAG,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEnF,0DAA0D;AAC1D,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAE3E,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC"}
@@ -13,13 +13,13 @@ import { MetadataProvider } from '../utils/data-model';
13
13
  * where you want to use a different (e.g. domain specific) model then it will likely override then emit event and instead emit
14
14
  * it's own model. To check the underlying `Types.Group` model check the {@link ExpressionBuilder.model} property.
15
15
  *
16
- * @fires change - Fired when the expression model changes
17
- * @fires add-group - Bubbled when a nested group add is requested
18
- * @fires del-group - Bubbled when a group delete is requested
19
- * @fires add-rule - Bubbled when a rule add is requested
20
- * @fires del-rule - Bubbled when a rule delete is requested
21
- * @fires update-group - Bubbled when group data changes
22
- * @fires update-rule - Bubbled when rule data changes
16
+ * @fires change - Fired when the expression model changes. detail: `ChangeEventDetail`
17
+ * @fires add-group - Bubbled when a nested group add is requested. detail: `AddGroupEventDetail`
18
+ * @fires del-group - Bubbled when a group delete is requested. detail: `DelGroupEventDetail`
19
+ * @fires add-rule - Bubbled when a rule add is requested. detail: `AddRuleEventDetail`
20
+ * @fires del-rule - Bubbled when a rule delete is requested. detail: `DelRuleEventDetail`
21
+ * @fires update-group - Bubbled when group data changes. detail: `UpdateGroupEventDetail`
22
+ * @fires update-rule - Bubbled when rule data changes. detail: `UpdateRuleEventDetail`
23
23
  *
24
24
  * @beta
25
25
  */
@@ -4,10 +4,10 @@ import { Combinator, Config, ModelGroup, Styles } from '../../types';
4
4
  * Group node used inside expression-builder.
5
5
  * @beta
6
6
  *
7
- * @fires add-rule - Bubbled when adding a child rule
8
- * @fires add-group - Bubbled when adding a child group
9
- * @fires del-group - Bubbled when deleting this group
10
- * @fires update-group - Bubbled when combinator changes
7
+ * @fires add-rule - Bubbled when adding a child rule. detail: `AddRuleEventDetail`
8
+ * @fires add-group - Bubbled when adding a child group. detail: `AddGroupEventDetail`
9
+ * @fires del-group - Bubbled when deleting this group. detail: `DelGroupEventDetail`
10
+ * @fires update-group - Bubbled when combinator changes. detail: `UpdateGroupEventDetail`
11
11
  */
12
12
  export declare class ExpressionGroup extends GenesisElement {
13
13
  config: Config;
@@ -5,8 +5,8 @@ import { Events, EventsDetailMap } from '../events';
5
5
  * Rule node used inside expression-builder.
6
6
  * @beta
7
7
  *
8
- * @fires del-rule - Bubbled when deleting this rule
9
- * @fires update-rule - Bubbled when field/operator/value changes
8
+ * @fires del-rule - Bubbled when deleting this rule. detail: `DelRuleEventDetail`
9
+ * @fires update-rule - Bubbled when field/operator/value changes. detail: `UpdateRuleEventDetail`
10
10
  */
11
11
  export declare class ExpressionRule extends GenesisElement {
12
12
  config: Config;
@@ -1,3 +1,4 @@
1
+ export * from './events';
1
2
  export * from './expression-builder';
2
3
  export * from './expression-builder.styles';
3
4
  export * from './expression-builder.template';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC"}
@@ -4,7 +4,7 @@ import { Config, Field, Styles } from '../../types';
4
4
  * Field selector for expression rules.
5
5
  * @beta
6
6
  *
7
- * @fires field-selected - Bubbled when the selected field changes
7
+ * @fires field-selected - Bubbled when the selected field changes. detail: `FieldSelectedEventDetail`
8
8
  */
9
9
  export declare class RuleField extends GenesisElement {
10
10
  fields: Field[];
@@ -4,7 +4,7 @@ import { Config, Field, Operator, Styles } from '../../types';
4
4
  * Operator selector for expression rules.
5
5
  * @beta
6
6
  *
7
- * @fires operator-selected - Bubbled when the selected operator changes
7
+ * @fires operator-selected - Bubbled when the selected operator changes. detail: `OperatorSelectedEventDetail`
8
8
  */
9
9
  export declare class RuleOperator extends GenesisElement {
10
10
  operators: Operator[];
@@ -4,8 +4,8 @@ import { Config, Field, Operator, Styles } from '../../types';
4
4
  * Value editor for expression rules.
5
5
  * @beta
6
6
  *
7
- * @fires value-updated - Bubbled when operand value changes
8
- * @fires remove-variadic-operand - Bubbled when a variadic operand is removed
7
+ * @fires value-updated - Bubbled when operand value changes. detail: `ValueUpdatedEventDetail`
8
+ * @fires remove-variadic-operand - Bubbled when a variadic operand is removed. detail: `RemoveVarArgEventDetail`
9
9
  */
10
10
  export declare class RuleValue extends GenesisElement {
11
11
  valueIndex: string;
@@ -10,6 +10,7 @@ import type { ExpressionRule as ExpressionRuleWC } from './main/expression-rule/
10
10
  import type { RuleField as RuleFieldWC } from './main/rule-field/rule-field';
11
11
  import type { RuleOperator as RuleOperatorWC } from './main/rule-operator/rule-operator';
12
12
  import type { RuleValue as RuleValueWC } from './main/rule-value/rule-value';
13
+ import type { AddGroupEventDetail, AddRuleEventDetail, DelGroupEventDetail, DelRuleEventDetail, FieldSelectedEventDetail, OperatorSelectedEventDetail, RemoveVarArgEventDetail, UpdateGroupEventDetail, UpdateRuleEventDetail, ValueUpdatedEventDetail } from '@genesislcap/expression-builder';
13
14
 
14
15
  /** @internal Maps a web component class to its public props only.
15
16
  * keyof T skips private/protected members, so this avoids the TS error
@@ -44,12 +45,12 @@ export declare const ExpressionBuilder: React.ForwardRefExoticComponent<
44
45
  React.PropsWithChildren<
45
46
  Omit<PublicOf<ExpressionBuilderWC>, 'children' | 'style'> &
46
47
  HTMLWCProps & {
47
- onAddGroup?: (event: CustomEvent<unknown>) => void;
48
- onDelGroup?: (event: CustomEvent<unknown>) => void;
49
- onAddRule?: (event: CustomEvent<unknown>) => void;
50
- onDelRule?: (event: CustomEvent<unknown>) => void;
51
- onUpdateGroup?: (event: CustomEvent<unknown>) => void;
52
- onUpdateRule?: (event: CustomEvent<unknown>) => void;
48
+ onAddGroup?: (event: CustomEvent<AddGroupEventDetail>) => void;
49
+ onDelGroup?: (event: CustomEvent<DelGroupEventDetail>) => void;
50
+ onAddRule?: (event: CustomEvent<AddRuleEventDetail>) => void;
51
+ onDelRule?: (event: CustomEvent<DelRuleEventDetail>) => void;
52
+ onUpdateGroup?: (event: CustomEvent<UpdateGroupEventDetail>) => void;
53
+ onUpdateRule?: (event: CustomEvent<UpdateRuleEventDetail>) => void;
53
54
  }
54
55
  > & React.RefAttributes<ExpressionBuilderWC>
55
56
  >;
@@ -59,10 +60,10 @@ export declare const ExpressionGroup: React.ForwardRefExoticComponent<
59
60
  React.PropsWithChildren<
60
61
  Omit<PublicOf<ExpressionGroupWC>, 'children' | 'style'> &
61
62
  HTMLWCProps & {
62
- onAddRule?: (event: CustomEvent<unknown>) => void;
63
- onAddGroup?: (event: CustomEvent<unknown>) => void;
64
- onDelGroup?: (event: CustomEvent<unknown>) => void;
65
- onUpdateGroup?: (event: CustomEvent<unknown>) => void;
63
+ onAddRule?: (event: CustomEvent<AddRuleEventDetail>) => void;
64
+ onAddGroup?: (event: CustomEvent<AddGroupEventDetail>) => void;
65
+ onDelGroup?: (event: CustomEvent<DelGroupEventDetail>) => void;
66
+ onUpdateGroup?: (event: CustomEvent<UpdateGroupEventDetail>) => void;
66
67
  }
67
68
  > & React.RefAttributes<ExpressionGroupWC>
68
69
  >;
@@ -72,39 +73,39 @@ export declare const ExpressionRule: React.ForwardRefExoticComponent<
72
73
  React.PropsWithChildren<
73
74
  Omit<PublicOf<ExpressionRuleWC>, 'children' | 'style'> &
74
75
  HTMLWCProps & {
75
- onDelRule?: (event: CustomEvent<unknown>) => void;
76
- onUpdateRule?: (event: CustomEvent<unknown>) => void;
76
+ onDelRule?: (event: CustomEvent<DelRuleEventDetail>) => void;
77
+ onUpdateRule?: (event: CustomEvent<UpdateRuleEventDetail>) => void;
77
78
  }
78
79
  > & React.RefAttributes<ExpressionRuleWC>
79
80
  >;
80
81
  export type ExpressionRuleRef = ExpressionRuleWC;
81
82
 
82
- export declare const RuleOperator: React.ForwardRefExoticComponent<
83
+ export declare const RuleField: React.ForwardRefExoticComponent<
83
84
  React.PropsWithChildren<
84
- Omit<PublicOf<RuleOperatorWC>, 'children' | 'style'> &
85
+ Omit<PublicOf<RuleFieldWC>, 'children' | 'style'> &
85
86
  HTMLWCProps & {
86
- onOperatorSelected?: (event: CustomEvent<unknown>) => void;
87
+ onFieldSelected?: (event: CustomEvent<FieldSelectedEventDetail>) => void;
87
88
  }
88
- > & React.RefAttributes<RuleOperatorWC>
89
+ > & React.RefAttributes<RuleFieldWC>
89
90
  >;
90
- export type RuleOperatorRef = RuleOperatorWC;
91
+ export type RuleFieldRef = RuleFieldWC;
91
92
 
92
- export declare const RuleField: React.ForwardRefExoticComponent<
93
+ export declare const RuleOperator: React.ForwardRefExoticComponent<
93
94
  React.PropsWithChildren<
94
- Omit<PublicOf<RuleFieldWC>, 'children' | 'style'> &
95
+ Omit<PublicOf<RuleOperatorWC>, 'children' | 'style'> &
95
96
  HTMLWCProps & {
96
- onFieldSelected?: (event: CustomEvent<unknown>) => void;
97
+ onOperatorSelected?: (event: CustomEvent<OperatorSelectedEventDetail>) => void;
97
98
  }
98
- > & React.RefAttributes<RuleFieldWC>
99
+ > & React.RefAttributes<RuleOperatorWC>
99
100
  >;
100
- export type RuleFieldRef = RuleFieldWC;
101
+ export type RuleOperatorRef = RuleOperatorWC;
101
102
 
102
103
  export declare const RuleValue: React.ForwardRefExoticComponent<
103
104
  React.PropsWithChildren<
104
105
  Omit<PublicOf<RuleValueWC>, 'children' | 'style'> &
105
106
  HTMLWCProps & {
106
- onValueUpdated?: (event: CustomEvent<unknown>) => void;
107
- onRemoveVariadicOperand?: (event: CustomEvent<unknown>) => void;
107
+ onValueUpdated?: (event: CustomEvent<ValueUpdatedEventDetail>) => void;
108
+ onRemoveVariadicOperand?: (event: CustomEvent<RemoveVarArgEventDetail>) => void;
108
109
  }
109
110
  > & React.RefAttributes<RuleValueWC>
110
111
  >;
@@ -1,3 +1,4 @@
1
+ /** @beta Event names dispatched by the expression builder component family. */
1
2
  export var Events;
2
3
  (function (Events) {
3
4
  Events["AddGroup"] = "add-group";