@genesislcap/expression-builder 14.249.0 → 14.251.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.
@@ -136,6 +136,255 @@
136
136
  }
137
137
  ]
138
138
  },
139
+ {
140
+ "kind": "javascript-module",
141
+ "path": "src/utils/data-model.ts",
142
+ "declarations": [
143
+ {
144
+ "kind": "function",
145
+ "name": "groupToModelGroup",
146
+ "return": {
147
+ "type": {
148
+ "text": "ModelGroup"
149
+ }
150
+ },
151
+ "parameters": [
152
+ {
153
+ "name": "group",
154
+ "type": {
155
+ "text": "Group"
156
+ }
157
+ },
158
+ {
159
+ "name": "provider",
160
+ "type": {
161
+ "text": "MetadataProvider"
162
+ }
163
+ }
164
+ ],
165
+ "description": "Converts a Group to a ModelGroup (adds required metadata)"
166
+ },
167
+ {
168
+ "kind": "function",
169
+ "name": "modelGroupToGroup",
170
+ "return": {
171
+ "type": {
172
+ "text": ""
173
+ }
174
+ },
175
+ "parameters": [
176
+ {
177
+ "name": "modelGroup",
178
+ "type": {
179
+ "text": "ModelGroup"
180
+ },
181
+ "description": "The internal ModelGroup to convert."
182
+ }
183
+ ],
184
+ "description": "Converts a ModelGroup (internal data structure) to a public Group structure.\nThis function recursively processes the rules within the group."
185
+ },
186
+ {
187
+ "kind": "function",
188
+ "name": "modelRuleToRule",
189
+ "return": {
190
+ "type": {
191
+ "text": ""
192
+ }
193
+ },
194
+ "parameters": [
195
+ {
196
+ "name": "modelRule",
197
+ "type": {
198
+ "text": "ModelRule"
199
+ },
200
+ "description": "The internal ModelRule to convert."
201
+ }
202
+ ],
203
+ "description": "Converts a ModelRule (internal data structure) to a public Rule structure."
204
+ }
205
+ ],
206
+ "exports": [
207
+ {
208
+ "kind": "js",
209
+ "name": "groupToModelGroup",
210
+ "declaration": {
211
+ "name": "groupToModelGroup",
212
+ "module": "src/utils/data-model.ts"
213
+ }
214
+ },
215
+ {
216
+ "kind": "js",
217
+ "name": "modelGroupToGroup",
218
+ "declaration": {
219
+ "name": "modelGroupToGroup",
220
+ "module": "src/utils/data-model.ts"
221
+ }
222
+ },
223
+ {
224
+ "kind": "js",
225
+ "name": "modelRuleToRule",
226
+ "declaration": {
227
+ "name": "modelRuleToRule",
228
+ "module": "src/utils/data-model.ts"
229
+ }
230
+ }
231
+ ]
232
+ },
233
+ {
234
+ "kind": "javascript-module",
235
+ "path": "src/utils/formatting.ts",
236
+ "declarations": [
237
+ {
238
+ "kind": "function",
239
+ "name": "formatDateString",
240
+ "parameters": [
241
+ {
242
+ "name": "date",
243
+ "type": {
244
+ "text": "Date"
245
+ }
246
+ }
247
+ ],
248
+ "description": "Gets the string representation from a `Date` which is the format a `date` input uses.\n`yyyy-mm-dd`"
249
+ },
250
+ {
251
+ "kind": "function",
252
+ "name": "formatDateTimeString",
253
+ "parameters": [
254
+ {
255
+ "name": "date",
256
+ "type": {
257
+ "text": "Date"
258
+ }
259
+ }
260
+ ],
261
+ "description": "Gets the string representation from a `Date` which is the format a `datetime-local` input uses.\n`yyyy-mm-ddThh:mm:ss`"
262
+ }
263
+ ],
264
+ "exports": [
265
+ {
266
+ "kind": "js",
267
+ "name": "formatDateString",
268
+ "declaration": {
269
+ "name": "formatDateString",
270
+ "module": "src/utils/formatting.ts"
271
+ }
272
+ },
273
+ {
274
+ "kind": "js",
275
+ "name": "formatDateTimeString",
276
+ "declaration": {
277
+ "name": "formatDateTimeString",
278
+ "module": "src/utils/formatting.ts"
279
+ }
280
+ }
281
+ ]
282
+ },
283
+ {
284
+ "kind": "javascript-module",
285
+ "path": "src/utils/index.ts",
286
+ "declarations": [],
287
+ "exports": [
288
+ {
289
+ "kind": "js",
290
+ "name": "*",
291
+ "declaration": {
292
+ "name": "*",
293
+ "package": "./data-model"
294
+ }
295
+ },
296
+ {
297
+ "kind": "js",
298
+ "name": "*",
299
+ "declaration": {
300
+ "name": "*",
301
+ "package": "./formatting"
302
+ }
303
+ },
304
+ {
305
+ "kind": "js",
306
+ "name": "*",
307
+ "declaration": {
308
+ "name": "*",
309
+ "package": "./misc"
310
+ }
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "kind": "javascript-module",
316
+ "path": "src/utils/misc.ts",
317
+ "declarations": [
318
+ {
319
+ "kind": "function",
320
+ "name": "processOptGroups",
321
+ "return": {
322
+ "type": {
323
+ "text": "(T | { optgroup: string | null; xs: T[] })[]"
324
+ }
325
+ },
326
+ "parameters": [
327
+ {
328
+ "name": "xs",
329
+ "type": {
330
+ "text": "T[]"
331
+ }
332
+ }
333
+ ]
334
+ },
335
+ {
336
+ "kind": "function",
337
+ "name": "applyCustomStyles",
338
+ "return": {
339
+ "type": {
340
+ "text": "void"
341
+ }
342
+ },
343
+ "parameters": [
344
+ {
345
+ "name": "component",
346
+ "type": {
347
+ "text": "HTMLElement"
348
+ },
349
+ "description": "The web component instance"
350
+ },
351
+ {
352
+ "name": "styles",
353
+ "type": {
354
+ "text": "Styles | undefined | null"
355
+ },
356
+ "description": "The styles configuration object"
357
+ },
358
+ {
359
+ "name": "styleKey",
360
+ "type": {
361
+ "text": "keyof NonNullable<Styles['customStyles']>"
362
+ },
363
+ "description": "The key in styles.customStyles to use for custom styles"
364
+ }
365
+ ],
366
+ "description": "Utility function to add custom styles to a web component's shadow root"
367
+ }
368
+ ],
369
+ "exports": [
370
+ {
371
+ "kind": "js",
372
+ "name": "processOptGroups",
373
+ "declaration": {
374
+ "name": "processOptGroups",
375
+ "module": "src/utils/misc.ts"
376
+ }
377
+ },
378
+ {
379
+ "kind": "js",
380
+ "name": "applyCustomStyles",
381
+ "declaration": {
382
+ "name": "applyCustomStyles",
383
+ "module": "src/utils/misc.ts"
384
+ }
385
+ }
386
+ ]
387
+ },
139
388
  {
140
389
  "kind": "javascript-module",
141
390
  "path": "src/main/events.ts",
@@ -565,282 +814,72 @@
565
814
  "kind": "method",
566
815
  "name": "_handleUpdateGroupData",
567
816
  "privacy": "private",
568
- "parameters": [
569
- {
570
- "name": "event",
571
- "type": {
572
- "text": "CustomEvent<EventsDetailMap[Events.UpdateGroup]>"
573
- }
574
- }
575
- ]
576
- },
577
- {
578
- "kind": "field",
579
- "name": "handleUpdateRuleData",
580
- "privacy": "private"
581
- },
582
- {
583
- "kind": "method",
584
- "name": "_handleUpdateRuleData",
585
- "privacy": "private",
586
- "parameters": [
587
- {
588
- "name": "event",
589
- "type": {
590
- "text": "CustomEvent<EventsDetailMap[Events.UpdateRule]>"
591
- }
592
- }
593
- ]
594
- }
595
- ],
596
- "events": [
597
- {
598
- "name": "change",
599
- "type": {
600
- "text": "CustomEvent"
601
- }
602
- }
603
- ],
604
- "superclass": {
605
- "name": "GenesisElement",
606
- "package": "@genesislcap/web-core"
607
- },
608
- "tagName": "expression-builder",
609
- "customElement": true
610
- }
611
- ],
612
- "exports": [
613
- {
614
- "kind": "js",
615
- "name": "ExpressionBuilder",
616
- "declaration": {
617
- "name": "ExpressionBuilder",
618
- "module": "src/main/expression-builder.ts"
619
- }
620
- },
621
- {
622
- "kind": "custom-element-definition",
623
- "name": "expression-builder",
624
- "declaration": {
625
- "name": "ExpressionBuilder",
626
- "module": "src/main/expression-builder.ts"
627
- }
628
- }
629
- ]
630
- },
631
- {
632
- "kind": "javascript-module",
633
- "path": "src/main/index.ts",
634
- "declarations": [],
635
- "exports": [
636
- {
637
- "kind": "js",
638
- "name": "*",
639
- "declaration": {
640
- "name": "*",
641
- "package": "./expression-builder"
642
- }
643
- },
644
- {
645
- "kind": "js",
646
- "name": "*",
647
- "declaration": {
648
- "name": "*",
649
- "package": "./expression-builder.styles"
650
- }
651
- },
652
- {
653
- "kind": "js",
654
- "name": "*",
655
- "declaration": {
656
- "name": "*",
657
- "package": "./expression-builder.template"
658
- }
659
- }
660
- ]
661
- },
662
- {
663
- "kind": "javascript-module",
664
- "path": "src/types/index.ts",
665
- "declarations": [],
666
- "exports": [
667
- {
668
- "kind": "js",
669
- "name": "*",
670
- "declaration": {
671
- "name": "*",
672
- "package": "./public.types"
673
- }
674
- },
675
- {
676
- "kind": "js",
677
- "name": "*",
678
- "declaration": {
679
- "name": "*",
680
- "package": "./private.types"
681
- }
682
- }
683
- ]
684
- },
685
- {
686
- "kind": "javascript-module",
687
- "path": "src/types/private.types.ts",
688
- "declarations": [],
689
- "exports": []
690
- },
691
- {
692
- "kind": "javascript-module",
693
- "path": "src/types/public.types.ts",
694
- "declarations": [],
695
- "exports": []
696
- },
697
- {
698
- "kind": "javascript-module",
699
- "path": "src/utils/data-model.ts",
700
- "declarations": [
701
- {
702
- "kind": "function",
703
- "name": "groupToModelGroup",
704
- "return": {
705
- "type": {
706
- "text": "ModelGroup"
707
- }
708
- },
709
- "parameters": [
710
- {
711
- "name": "group",
712
- "type": {
713
- "text": "Group"
714
- }
715
- },
716
- {
717
- "name": "provider",
718
- "type": {
719
- "text": "MetadataProvider"
720
- }
721
- }
722
- ],
723
- "description": "Converts a Group to a ModelGroup (adds required metadata)"
724
- },
725
- {
726
- "kind": "function",
727
- "name": "modelGroupToGroup",
728
- "return": {
729
- "type": {
730
- "text": ""
731
- }
732
- },
733
- "parameters": [
734
- {
735
- "name": "modelGroup",
736
- "type": {
737
- "text": "ModelGroup"
738
- },
739
- "description": "The internal ModelGroup to convert."
740
- }
741
- ],
742
- "description": "Converts a ModelGroup (internal data structure) to a public Group structure.\nThis function recursively processes the rules within the group."
743
- },
744
- {
745
- "kind": "function",
746
- "name": "modelRuleToRule",
747
- "return": {
748
- "type": {
749
- "text": ""
750
- }
751
- },
752
- "parameters": [
753
- {
754
- "name": "modelRule",
755
- "type": {
756
- "text": "ModelRule"
757
- },
758
- "description": "The internal ModelRule to convert."
759
- }
760
- ],
761
- "description": "Converts a ModelRule (internal data structure) to a public Rule structure."
762
- }
763
- ],
764
- "exports": [
765
- {
766
- "kind": "js",
767
- "name": "groupToModelGroup",
768
- "declaration": {
769
- "name": "groupToModelGroup",
770
- "module": "src/utils/data-model.ts"
771
- }
772
- },
773
- {
774
- "kind": "js",
775
- "name": "modelGroupToGroup",
776
- "declaration": {
777
- "name": "modelGroupToGroup",
778
- "module": "src/utils/data-model.ts"
779
- }
780
- },
781
- {
782
- "kind": "js",
783
- "name": "modelRuleToRule",
784
- "declaration": {
785
- "name": "modelRuleToRule",
786
- "module": "src/utils/data-model.ts"
787
- }
788
- }
789
- ]
790
- },
791
- {
792
- "kind": "javascript-module",
793
- "path": "src/utils/formatting.ts",
794
- "declarations": [
795
- {
796
- "kind": "function",
797
- "name": "formatDateString",
798
- "parameters": [
817
+ "parameters": [
818
+ {
819
+ "name": "event",
820
+ "type": {
821
+ "text": "CustomEvent<EventsDetailMap[Events.UpdateGroup]>"
822
+ }
823
+ }
824
+ ]
825
+ },
799
826
  {
800
- "name": "date",
801
- "type": {
802
- "text": "Date"
803
- }
827
+ "kind": "field",
828
+ "name": "handleUpdateRuleData",
829
+ "privacy": "private"
830
+ },
831
+ {
832
+ "kind": "method",
833
+ "name": "_handleUpdateRuleData",
834
+ "privacy": "private",
835
+ "parameters": [
836
+ {
837
+ "name": "event",
838
+ "type": {
839
+ "text": "CustomEvent<EventsDetailMap[Events.UpdateRule]>"
840
+ }
841
+ }
842
+ ]
804
843
  }
805
844
  ],
806
- "description": "Gets the string representation from a `Date` which is the format a `date` input uses.\n`yyyy-mm-dd`"
807
- },
808
- {
809
- "kind": "function",
810
- "name": "formatDateTimeString",
811
- "parameters": [
845
+ "events": [
812
846
  {
813
- "name": "date",
847
+ "name": "change",
814
848
  "type": {
815
- "text": "Date"
849
+ "text": "CustomEvent"
816
850
  }
817
851
  }
818
852
  ],
819
- "description": "Gets the string representation from a `Date` which is the format a `datetime-local` input uses.\n`yyyy-mm-ddThh:mm:ss`"
853
+ "superclass": {
854
+ "name": "GenesisElement",
855
+ "package": "@genesislcap/web-core"
856
+ },
857
+ "tagName": "expression-builder",
858
+ "customElement": true
820
859
  }
821
860
  ],
822
861
  "exports": [
823
862
  {
824
863
  "kind": "js",
825
- "name": "formatDateString",
864
+ "name": "ExpressionBuilder",
826
865
  "declaration": {
827
- "name": "formatDateString",
828
- "module": "src/utils/formatting.ts"
866
+ "name": "ExpressionBuilder",
867
+ "module": "src/main/expression-builder.ts"
829
868
  }
830
869
  },
831
870
  {
832
- "kind": "js",
833
- "name": "formatDateTimeString",
871
+ "kind": "custom-element-definition",
872
+ "name": "expression-builder",
834
873
  "declaration": {
835
- "name": "formatDateTimeString",
836
- "module": "src/utils/formatting.ts"
874
+ "name": "ExpressionBuilder",
875
+ "module": "src/main/expression-builder.ts"
837
876
  }
838
877
  }
839
878
  ]
840
879
  },
841
880
  {
842
881
  "kind": "javascript-module",
843
- "path": "src/utils/index.ts",
882
+ "path": "src/main/index.ts",
844
883
  "declarations": [],
845
884
  "exports": [
846
885
  {
@@ -848,7 +887,7 @@
848
887
  "name": "*",
849
888
  "declaration": {
850
889
  "name": "*",
851
- "package": "./data-model"
890
+ "package": "./expression-builder"
852
891
  }
853
892
  },
854
893
  {
@@ -856,7 +895,7 @@
856
895
  "name": "*",
857
896
  "declaration": {
858
897
  "name": "*",
859
- "package": "./formatting"
898
+ "package": "./expression-builder.styles"
860
899
  }
861
900
  },
862
901
  {
@@ -864,85 +903,46 @@
864
903
  "name": "*",
865
904
  "declaration": {
866
905
  "name": "*",
867
- "package": "./misc"
906
+ "package": "./expression-builder.template"
868
907
  }
869
908
  }
870
909
  ]
871
910
  },
872
911
  {
873
912
  "kind": "javascript-module",
874
- "path": "src/utils/misc.ts",
875
- "declarations": [
876
- {
877
- "kind": "function",
878
- "name": "processOptGroups",
879
- "return": {
880
- "type": {
881
- "text": "(T | { optgroup: string | null; xs: T[] })[]"
882
- }
883
- },
884
- "parameters": [
885
- {
886
- "name": "xs",
887
- "type": {
888
- "text": "T[]"
889
- }
890
- }
891
- ]
892
- },
893
- {
894
- "kind": "function",
895
- "name": "applyCustomStyles",
896
- "return": {
897
- "type": {
898
- "text": "void"
899
- }
900
- },
901
- "parameters": [
902
- {
903
- "name": "component",
904
- "type": {
905
- "text": "HTMLElement"
906
- },
907
- "description": "The web component instance"
908
- },
909
- {
910
- "name": "styles",
911
- "type": {
912
- "text": "Styles | undefined | null"
913
- },
914
- "description": "The styles configuration object"
915
- },
916
- {
917
- "name": "styleKey",
918
- "type": {
919
- "text": "keyof NonNullable<Styles['customStyles']>"
920
- },
921
- "description": "The key in styles.customStyles to use for custom styles"
922
- }
923
- ],
924
- "description": "Utility function to add custom styles to a web component's shadow root"
925
- }
926
- ],
913
+ "path": "src/types/index.ts",
914
+ "declarations": [],
927
915
  "exports": [
928
916
  {
929
917
  "kind": "js",
930
- "name": "processOptGroups",
918
+ "name": "*",
931
919
  "declaration": {
932
- "name": "processOptGroups",
933
- "module": "src/utils/misc.ts"
920
+ "name": "*",
921
+ "package": "./public.types"
934
922
  }
935
923
  },
936
924
  {
937
925
  "kind": "js",
938
- "name": "applyCustomStyles",
926
+ "name": "*",
939
927
  "declaration": {
940
- "name": "applyCustomStyles",
941
- "module": "src/utils/misc.ts"
928
+ "name": "*",
929
+ "package": "./private.types"
942
930
  }
943
931
  }
944
932
  ]
945
933
  },
934
+ {
935
+ "kind": "javascript-module",
936
+ "path": "src/types/private.types.ts",
937
+ "declarations": [],
938
+ "exports": []
939
+ },
940
+ {
941
+ "kind": "javascript-module",
942
+ "path": "src/types/public.types.ts",
943
+ "declarations": [],
944
+ "exports": []
945
+ },
946
946
  {
947
947
  "kind": "javascript-module",
948
948
  "path": "src/main/expression-group/expression-group.styles.ts",
@@ -1417,12 +1417,12 @@
1417
1417
  },
1418
1418
  {
1419
1419
  "kind": "javascript-module",
1420
- "path": "src/main/rule-operator/rule-operator.template.ts",
1420
+ "path": "src/main/rule-field/rule-field.template.ts",
1421
1421
  "declarations": [
1422
1422
  {
1423
1423
  "kind": "variable",
1424
1424
  "name": "template",
1425
- "default": "html<RuleOperator>`\n ${(context) => {\n const selectTag = context.styles?.customElements?.select || 'select';\n const optionTag = context.styles?.customElements?.option || 'option';\n const optgroupTag = 'optgroup'; // Not supporting custom optgroup for now\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 >\n ${(x) => 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 >\n ${(x) => x.type}\n </${optionTag}>\n `;\n }\n }}\n `,\n )}\n </${selectTag}>\n `;\n }}\n`"
1425
+ "default": "html<RuleField>`\n ${(context) => {\n const selectTag = context.styles?.customElements?.select || 'select';\n const optionTag = context.styles?.customElements?.option || 'option';\n const optgroupTag = 'optgroup'; // Not supporting custom optgroup for now\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`"
1426
1426
  }
1427
1427
  ],
1428
1428
  "exports": [
@@ -1431,42 +1431,34 @@
1431
1431
  "name": "template",
1432
1432
  "declaration": {
1433
1433
  "name": "template",
1434
- "module": "src/main/rule-operator/rule-operator.template.ts"
1434
+ "module": "src/main/rule-field/rule-field.template.ts"
1435
1435
  }
1436
1436
  }
1437
1437
  ]
1438
1438
  },
1439
1439
  {
1440
1440
  "kind": "javascript-module",
1441
- "path": "src/main/rule-operator/rule-operator.ts",
1441
+ "path": "src/main/rule-field/rule-field.ts",
1442
1442
  "declarations": [
1443
1443
  {
1444
1444
  "kind": "class",
1445
1445
  "description": "",
1446
- "name": "RuleOperator",
1446
+ "name": "RuleField",
1447
1447
  "members": [
1448
1448
  {
1449
1449
  "kind": "field",
1450
- "name": "operators",
1450
+ "name": "fields",
1451
1451
  "type": {
1452
- "text": "Operator[]"
1452
+ "text": "Field[]"
1453
1453
  },
1454
1454
  "default": "[]"
1455
1455
  },
1456
- {
1457
- "kind": "field",
1458
- "name": "operator",
1459
- "type": {
1460
- "text": "Operator"
1461
- }
1462
- },
1463
1456
  {
1464
1457
  "kind": "field",
1465
1458
  "name": "field",
1466
1459
  "type": {
1467
- "text": "Field | null"
1468
- },
1469
- "default": "null"
1460
+ "text": "Field"
1461
+ }
1470
1462
  },
1471
1463
  {
1472
1464
  "kind": "field",
@@ -1484,23 +1476,15 @@
1484
1476
  },
1485
1477
  {
1486
1478
  "kind": "field",
1487
- "name": "allowedOperators",
1488
- "type": {
1489
- "text": "Operator[]"
1490
- },
1491
- "readonly": true
1492
- },
1493
- {
1494
- "kind": "field",
1495
- "name": "groupedOperators",
1479
+ "name": "groupedFieldss",
1496
1480
  "type": {
1497
- "text": "(Operator | { optgroup: string | null; xs: Operator[] })[]"
1481
+ "text": "(Field | { optgroup: string | null; xs: Field[] })[]"
1498
1482
  },
1499
1483
  "readonly": true
1500
1484
  },
1501
1485
  {
1502
1486
  "kind": "method",
1503
- "name": "handleOperatorChange",
1487
+ "name": "dispatchFieldsChanged",
1504
1488
  "parameters": [
1505
1489
  {
1506
1490
  "name": "event",
@@ -1522,37 +1506,37 @@
1522
1506
  "name": "GenesisElement",
1523
1507
  "package": "@genesislcap/web-core"
1524
1508
  },
1525
- "tagName": "expression-rule-operator",
1509
+ "tagName": "expression-rule-field",
1526
1510
  "customElement": true
1527
1511
  }
1528
1512
  ],
1529
1513
  "exports": [
1530
1514
  {
1531
1515
  "kind": "js",
1532
- "name": "RuleOperator",
1516
+ "name": "RuleField",
1533
1517
  "declaration": {
1534
- "name": "RuleOperator",
1535
- "module": "src/main/rule-operator/rule-operator.ts"
1518
+ "name": "RuleField",
1519
+ "module": "src/main/rule-field/rule-field.ts"
1536
1520
  }
1537
1521
  },
1538
1522
  {
1539
1523
  "kind": "custom-element-definition",
1540
- "name": "expression-rule-operator",
1524
+ "name": "expression-rule-field",
1541
1525
  "declaration": {
1542
- "name": "RuleOperator",
1543
- "module": "src/main/rule-operator/rule-operator.ts"
1526
+ "name": "RuleField",
1527
+ "module": "src/main/rule-field/rule-field.ts"
1544
1528
  }
1545
1529
  }
1546
1530
  ]
1547
1531
  },
1548
1532
  {
1549
1533
  "kind": "javascript-module",
1550
- "path": "src/main/rule-field/rule-field.template.ts",
1534
+ "path": "src/main/rule-operator/rule-operator.template.ts",
1551
1535
  "declarations": [
1552
1536
  {
1553
1537
  "kind": "variable",
1554
1538
  "name": "template",
1555
- "default": "html<RuleField>`\n ${(context) => {\n const selectTag = context.styles?.customElements?.select || 'select';\n const optionTag = context.styles?.customElements?.option || 'option';\n const optgroupTag = 'optgroup'; // Not supporting custom optgroup for now\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`"
1539
+ "default": "html<RuleOperator>`\n ${(context) => {\n const selectTag = context.styles?.customElements?.select || 'select';\n const optionTag = context.styles?.customElements?.option || 'option';\n const optgroupTag = 'optgroup'; // Not supporting custom optgroup for now\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 >\n ${(x) => 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 >\n ${(x) => x.type}\n </${optionTag}>\n `;\n }\n }}\n `,\n )}\n </${selectTag}>\n `;\n }}\n`"
1556
1540
  }
1557
1541
  ],
1558
1542
  "exports": [
@@ -1561,35 +1545,43 @@
1561
1545
  "name": "template",
1562
1546
  "declaration": {
1563
1547
  "name": "template",
1564
- "module": "src/main/rule-field/rule-field.template.ts"
1548
+ "module": "src/main/rule-operator/rule-operator.template.ts"
1565
1549
  }
1566
1550
  }
1567
1551
  ]
1568
1552
  },
1569
1553
  {
1570
1554
  "kind": "javascript-module",
1571
- "path": "src/main/rule-field/rule-field.ts",
1555
+ "path": "src/main/rule-operator/rule-operator.ts",
1572
1556
  "declarations": [
1573
1557
  {
1574
1558
  "kind": "class",
1575
1559
  "description": "",
1576
- "name": "RuleField",
1560
+ "name": "RuleOperator",
1577
1561
  "members": [
1578
1562
  {
1579
1563
  "kind": "field",
1580
- "name": "fields",
1564
+ "name": "operators",
1581
1565
  "type": {
1582
- "text": "Field[]"
1566
+ "text": "Operator[]"
1583
1567
  },
1584
1568
  "default": "[]"
1585
1569
  },
1586
1570
  {
1587
1571
  "kind": "field",
1588
- "name": "field",
1572
+ "name": "operator",
1589
1573
  "type": {
1590
- "text": "Field"
1574
+ "text": "Operator"
1591
1575
  }
1592
1576
  },
1577
+ {
1578
+ "kind": "field",
1579
+ "name": "field",
1580
+ "type": {
1581
+ "text": "Field | null"
1582
+ },
1583
+ "default": "null"
1584
+ },
1593
1585
  {
1594
1586
  "kind": "field",
1595
1587
  "name": "config",
@@ -1606,15 +1598,23 @@
1606
1598
  },
1607
1599
  {
1608
1600
  "kind": "field",
1609
- "name": "groupedFieldss",
1601
+ "name": "allowedOperators",
1610
1602
  "type": {
1611
- "text": "(Field | { optgroup: string | null; xs: Field[] })[]"
1603
+ "text": "Operator[]"
1604
+ },
1605
+ "readonly": true
1606
+ },
1607
+ {
1608
+ "kind": "field",
1609
+ "name": "groupedOperators",
1610
+ "type": {
1611
+ "text": "(Operator | { optgroup: string | null; xs: Operator[] })[]"
1612
1612
  },
1613
1613
  "readonly": true
1614
1614
  },
1615
1615
  {
1616
1616
  "kind": "method",
1617
- "name": "dispatchFieldsChanged",
1617
+ "name": "handleOperatorChange",
1618
1618
  "parameters": [
1619
1619
  {
1620
1620
  "name": "event",
@@ -1636,25 +1636,25 @@
1636
1636
  "name": "GenesisElement",
1637
1637
  "package": "@genesislcap/web-core"
1638
1638
  },
1639
- "tagName": "expression-rule-field",
1639
+ "tagName": "expression-rule-operator",
1640
1640
  "customElement": true
1641
1641
  }
1642
1642
  ],
1643
1643
  "exports": [
1644
1644
  {
1645
1645
  "kind": "js",
1646
- "name": "RuleField",
1646
+ "name": "RuleOperator",
1647
1647
  "declaration": {
1648
- "name": "RuleField",
1649
- "module": "src/main/rule-field/rule-field.ts"
1648
+ "name": "RuleOperator",
1649
+ "module": "src/main/rule-operator/rule-operator.ts"
1650
1650
  }
1651
1651
  },
1652
1652
  {
1653
1653
  "kind": "custom-element-definition",
1654
- "name": "expression-rule-field",
1654
+ "name": "expression-rule-operator",
1655
1655
  "declaration": {
1656
- "name": "RuleField",
1657
- "module": "src/main/rule-field/rule-field.ts"
1656
+ "name": "RuleOperator",
1657
+ "module": "src/main/rule-operator/rule-operator.ts"
1658
1658
  }
1659
1659
  }
1660
1660
  ]
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": "14.249.0",
4
+ "version": "14.251.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/expression-builder.d.ts",
@@ -62,5 +62,5 @@
62
62
  "access": "public"
63
63
  },
64
64
  "customElements": "dist/custom-elements.json",
65
- "gitHead": "0827469e373358a4dbc50de154868998adf62bd9"
65
+ "gitHead": "2ab61e47fbc752e88ecb2d83d794c590a8093829"
66
66
  }