@genesislcap/expression-builder 14.253.0 → 14.254.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.
- package/dist/custom-elements.json +471 -320
- package/dist/dts/main/expression-group/expression-group.d.ts.map +1 -1
- package/dist/dts/main/expression-group/expression-group.template.d.ts.map +1 -1
- package/dist/dts/main/expression-rule/expression-rule.d.ts +1 -0
- package/dist/dts/main/expression-rule/expression-rule.d.ts.map +1 -1
- package/dist/dts/main/expression-rule/expression-rule.helpers.d.ts +14 -1
- package/dist/dts/main/expression-rule/expression-rule.helpers.d.ts.map +1 -1
- package/dist/dts/main/expression-rule/expression-rule.styles.d.ts.map +1 -1
- package/dist/dts/main/rule-operator/rule-operator.template.d.ts.map +1 -1
- package/dist/dts/types/public.types.d.ts +4 -0
- package/dist/dts/types/public.types.d.ts.map +1 -1
- package/dist/esm/main/expression-group/expression-group.js +0 -10
- package/dist/esm/main/expression-group/expression-group.template.js +9 -0
- package/dist/esm/main/expression-rule/expression-rule.helpers.js +84 -0
- package/dist/esm/main/expression-rule/expression-rule.js +14 -53
- package/dist/esm/main/expression-rule/expression-rule.styles.js +4 -0
- package/dist/esm/main/expression-rule/expression-rule.template.js +2 -2
- package/dist/esm/main/rule-operator/rule-operator.template.js +2 -0
- package/dist/expression-builder.d.ts +4 -0
- package/docs/api-report.md +2 -0
- package/package.json +2 -2
|
@@ -136,6 +136,290 @@
|
|
|
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`\nUses UTC methods to ensure consistent output regardless of timezone."
|
|
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`\nUses UTC methods to ensure consistent output regardless of timezone."
|
|
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
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"kind": "javascript-module",
|
|
390
|
+
"path": "src/types/index.ts",
|
|
391
|
+
"declarations": [],
|
|
392
|
+
"exports": [
|
|
393
|
+
{
|
|
394
|
+
"kind": "js",
|
|
395
|
+
"name": "*",
|
|
396
|
+
"declaration": {
|
|
397
|
+
"name": "*",
|
|
398
|
+
"package": "./public.types"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"kind": "js",
|
|
403
|
+
"name": "*",
|
|
404
|
+
"declaration": {
|
|
405
|
+
"name": "*",
|
|
406
|
+
"package": "./private.types"
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"kind": "javascript-module",
|
|
413
|
+
"path": "src/types/private.types.ts",
|
|
414
|
+
"declarations": [],
|
|
415
|
+
"exports": []
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"kind": "javascript-module",
|
|
419
|
+
"path": "src/types/public.types.ts",
|
|
420
|
+
"declarations": [],
|
|
421
|
+
"exports": []
|
|
422
|
+
},
|
|
139
423
|
{
|
|
140
424
|
"kind": "javascript-module",
|
|
141
425
|
"path": "src/main/events.ts",
|
|
@@ -578,269 +862,59 @@
|
|
|
578
862
|
"kind": "field",
|
|
579
863
|
"name": "handleUpdateRuleData",
|
|
580
864
|
"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": [
|
|
865
|
+
},
|
|
799
866
|
{
|
|
800
|
-
"
|
|
801
|
-
"
|
|
802
|
-
|
|
803
|
-
|
|
867
|
+
"kind": "method",
|
|
868
|
+
"name": "_handleUpdateRuleData",
|
|
869
|
+
"privacy": "private",
|
|
870
|
+
"parameters": [
|
|
871
|
+
{
|
|
872
|
+
"name": "event",
|
|
873
|
+
"type": {
|
|
874
|
+
"text": "CustomEvent<EventsDetailMap[Events.UpdateRule]>"
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
]
|
|
804
878
|
}
|
|
805
879
|
],
|
|
806
|
-
"
|
|
807
|
-
},
|
|
808
|
-
{
|
|
809
|
-
"kind": "function",
|
|
810
|
-
"name": "formatDateTimeString",
|
|
811
|
-
"parameters": [
|
|
880
|
+
"events": [
|
|
812
881
|
{
|
|
813
|
-
"name": "
|
|
882
|
+
"name": "change",
|
|
814
883
|
"type": {
|
|
815
|
-
"text": "
|
|
884
|
+
"text": "CustomEvent"
|
|
816
885
|
}
|
|
817
886
|
}
|
|
818
887
|
],
|
|
819
|
-
"
|
|
888
|
+
"superclass": {
|
|
889
|
+
"name": "GenesisElement",
|
|
890
|
+
"package": "@genesislcap/web-core"
|
|
891
|
+
},
|
|
892
|
+
"tagName": "expression-builder",
|
|
893
|
+
"customElement": true
|
|
820
894
|
}
|
|
821
895
|
],
|
|
822
896
|
"exports": [
|
|
823
897
|
{
|
|
824
898
|
"kind": "js",
|
|
825
|
-
"name": "
|
|
899
|
+
"name": "ExpressionBuilder",
|
|
826
900
|
"declaration": {
|
|
827
|
-
"name": "
|
|
828
|
-
"module": "src/
|
|
901
|
+
"name": "ExpressionBuilder",
|
|
902
|
+
"module": "src/main/expression-builder.ts"
|
|
829
903
|
}
|
|
830
904
|
},
|
|
831
905
|
{
|
|
832
|
-
"kind": "
|
|
833
|
-
"name": "
|
|
906
|
+
"kind": "custom-element-definition",
|
|
907
|
+
"name": "expression-builder",
|
|
834
908
|
"declaration": {
|
|
835
|
-
"name": "
|
|
836
|
-
"module": "src/
|
|
909
|
+
"name": "ExpressionBuilder",
|
|
910
|
+
"module": "src/main/expression-builder.ts"
|
|
837
911
|
}
|
|
838
912
|
}
|
|
839
913
|
]
|
|
840
914
|
},
|
|
841
915
|
{
|
|
842
916
|
"kind": "javascript-module",
|
|
843
|
-
"path": "src/
|
|
917
|
+
"path": "src/main/index.ts",
|
|
844
918
|
"declarations": [],
|
|
845
919
|
"exports": [
|
|
846
920
|
{
|
|
@@ -848,7 +922,7 @@
|
|
|
848
922
|
"name": "*",
|
|
849
923
|
"declaration": {
|
|
850
924
|
"name": "*",
|
|
851
|
-
"package": "./
|
|
925
|
+
"package": "./expression-builder"
|
|
852
926
|
}
|
|
853
927
|
},
|
|
854
928
|
{
|
|
@@ -856,7 +930,7 @@
|
|
|
856
930
|
"name": "*",
|
|
857
931
|
"declaration": {
|
|
858
932
|
"name": "*",
|
|
859
|
-
"package": "./
|
|
933
|
+
"package": "./expression-builder.styles"
|
|
860
934
|
}
|
|
861
935
|
},
|
|
862
936
|
{
|
|
@@ -864,81 +938,7 @@
|
|
|
864
938
|
"name": "*",
|
|
865
939
|
"declaration": {
|
|
866
940
|
"name": "*",
|
|
867
|
-
"package": "./
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
]
|
|
871
|
-
},
|
|
872
|
-
{
|
|
873
|
-
"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
|
-
],
|
|
927
|
-
"exports": [
|
|
928
|
-
{
|
|
929
|
-
"kind": "js",
|
|
930
|
-
"name": "processOptGroups",
|
|
931
|
-
"declaration": {
|
|
932
|
-
"name": "processOptGroups",
|
|
933
|
-
"module": "src/utils/misc.ts"
|
|
934
|
-
}
|
|
935
|
-
},
|
|
936
|
-
{
|
|
937
|
-
"kind": "js",
|
|
938
|
-
"name": "applyCustomStyles",
|
|
939
|
-
"declaration": {
|
|
940
|
-
"name": "applyCustomStyles",
|
|
941
|
-
"module": "src/utils/misc.ts"
|
|
941
|
+
"package": "./expression-builder.template"
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
]
|
|
@@ -971,7 +971,7 @@
|
|
|
971
971
|
{
|
|
972
972
|
"kind": "variable",
|
|
973
973
|
"name": "template",
|
|
974
|
-
"default": "html<ExpressionGroup>`\n ${(context) => {\n const buttonTag = context.styles?.customElements?.button || 'button';\n const maybeRadioBlock = context.styles?.customElements?.radio;\n const { radioTag, radioGroupTag } = maybeRadioBlock\n ? { radioTag: maybeRadioBlock.input, radioGroupTag: maybeRadioBlock.group }\n : { radioTag: 'input', radioGroupTag: 'div' };\n\n return html<ExpressionGroup>`\n <div class=\"rules-group-container\">\n <div class=\"rules-group-header\">\n <div class=\"btn-group float-end group-actions\">\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-success\"\n data-add=\"rule\"\n @click=\"${(x, c) => x.dispatchAddRule(c.event)}\"\n >\n Add Rule\n </${buttonTag}>\n ${when(\n (x) => x.allowNestedGroup,\n html<ExpressionGroup>`\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-success\"\n data-add=\"group\"\n @click=\"${(x, c) => x.dispatchAddGroup(c.event)}\"\n >\n Add Group\n </${buttonTag}>\n `,\n )}\n ${when(\n (x) => typeof x.index === 'number',\n html<ExpressionGroup>`\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-danger\"\n data-delete=\"group\"\n @click=\"${(x, c) => x.dispatchDeleteGroup(c.event)}\"\n >\n Delete Group\n </${buttonTag}>\n `,\n )}\n <div class=\"btn-group group-conditions\">\n ${whenElse(\n (_) => radioTag !== 'input',\n html<ExpressionGroup>`\n <${radioGroupTag}\n class=\"radio-group-container\"\n name=\"combinator\"\n @change=\"${(x, c) => x.handleCombinatorChange(c.event)}\"\n value=\"${(x) => x.model?.combinator?.type}\"\n >\n ${repeat(\n (x) => x.config.combinators,\n html<Combinator, ExpressionGroup>`\n <${radioTag}\n value=\"${(x) => x.type}\"\n ?checked=${(x, c) => c.parent.model?.combinator?.type === x.type}\n >\n ${(x) => x.label ?? x.type}\n </${radioTag}>\n `,\n )}\n </${radioGroupTag}>\n `,\n html<ExpressionGroup>`\n <div class=\"radio-group-container\">\n ${repeat(\n (x) => x.config.combinators,\n html<Combinator, ExpressionGroup>`\n <label class=\"btn btn-sm btn-primary\">\n <input\n type=\"radio\"\n name=\"combinator\"\n value=\"${(x) => x.type}\"\n @change=\"${(_, c) => c.parent.handleCombinatorChange(c.event)}\"\n ?checked=${(x, c) => c.parent.model?.combinator?.type === x.type}\n />\n ${(x) => x.label ?? x.type}\n </label>\n `,\n )}\n </div>\n `,\n )}\n </div>\n </div>\n <div class=\"rules-group-body\">\n <div class=\"rules-list\">\n ${repeat(\n (x) => x.model?.children ?? [],\n html<ModelRule | ModelGroup, ExpressionBuilder>`\n ${whenElse(\n (x) => 'children' in x,\n html<ModelGroup>`\n <expression-group\n :config=${(_, c) => c.parent.config}\n :styles=${(_, c) => c.parent.styles}\n :model=${(x) => x}\n :index=${(_, c) => c.index}\n ></expression-group>\n `,\n html<ModelRule>`\n <expression-rule\n :config=${(_, c) => c.parent.config}\n :styles=${(_, c) => c.parent.styles}\n :model=${(x) => x}\n :index=${(_, c) => c.index}\n ></expression-rule>\n `,\n )}\n `,\n { recycle: false, positioning: true },\n )}\n </div>\n </div>\n </div>\n </div>\n `;\n }}\n`"
|
|
974
|
+
"default": "html<ExpressionGroup>`\n ${(context) => {\n const buttonTag = context.styles?.customElements?.button || 'button';\n const maybeRadioBlock = context.styles?.customElements?.radio;\n const { radioTag, radioGroupTag } = maybeRadioBlock\n ? { radioTag: maybeRadioBlock.input, radioGroupTag: maybeRadioBlock.group }\n : { radioTag: 'input', radioGroupTag: 'div' };\n\n const ruleTooltip = `Add a new condition with field (e.g. CURRENCY), operator (e.g. EQUALS), and value (e.g. GBP) that will be combined with other conditions in this group using the selected logic (e.g. ${context.config.combinators[0].type})`;\n\n const groupTooltip = `Add a new nested sub-group to create more complex expressions, joined by combinatorial logic (e.g. ${context.config.combinators[0].type})`;\n\n return html<ExpressionGroup>`\n <div class=\"rules-group-container\">\n <div class=\"rules-group-header\">\n <div class=\"btn-group float-end group-actions\">\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-success\"\n data-add=\"rule\"\n @click=\"${(x, c) => x.dispatchAddRule(c.event)}\"\n title=${(_) => ruleTooltip}\n >\n Add Rule\n </${buttonTag}>\n ${when(\n (x) => x.allowNestedGroup,\n html<ExpressionGroup>`\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-success\"\n data-add=\"group\"\n @click=\"${(x, c) => x.dispatchAddGroup(c.event)}\"\n title=\"${(_) => groupTooltip}\"\n >\n Add Group\n </${buttonTag}>\n `,\n )}\n ${when(\n (x) => typeof x.index === 'number',\n html<ExpressionGroup>`\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-danger\"\n data-delete=\"group\"\n @click=\"${(x, c) => x.dispatchDeleteGroup(c.event)}\"\n >\n Delete Group\n </${buttonTag}>\n `,\n )}\n <div class=\"btn-group group-conditions\">\n ${whenElse(\n (_) => radioTag !== 'input',\n html<ExpressionGroup>`\n <${radioGroupTag}\n class=\"radio-group-container\"\n name=\"combinator\"\n @change=\"${(x, c) => x.handleCombinatorChange(c.event)}\"\n value=\"${(x) => x.model?.combinator?.type}\"\n >\n ${repeat(\n (x) => x.config.combinators,\n html<Combinator, ExpressionGroup>`\n <${radioTag}\n value=\"${(x) => x.type}\"\n ?checked=${(x, c) => c.parent.model?.combinator?.type === x.type}\n >\n ${(x) => x.label ?? x.type}\n </${radioTag}>\n `,\n )}\n </${radioGroupTag}>\n `,\n html<ExpressionGroup>`\n <div class=\"radio-group-container\">\n ${repeat(\n (x) => x.config.combinators,\n html<Combinator, ExpressionGroup>`\n <label class=\"btn btn-sm btn-primary\">\n <input\n type=\"radio\"\n name=\"combinator\"\n value=\"${(x) => x.type}\"\n @change=\"${(_, c) => c.parent.handleCombinatorChange(c.event)}\"\n ?checked=${(x, c) => c.parent.model?.combinator?.type === x.type}\n />\n ${(x) => x.label ?? x.type}\n </label>\n `,\n )}\n </div>\n `,\n )}\n </div>\n </div>\n <div class=\"rules-group-body\">\n <div class=\"rules-list\">\n ${repeat(\n (x) => x.model?.children ?? [],\n html<ModelRule | ModelGroup, ExpressionBuilder>`\n ${whenElse(\n (x) => 'children' in x,\n html<ModelGroup>`\n <expression-group\n :config=${(_, c) => c.parent.config}\n :styles=${(_, c) => c.parent.styles}\n :model=${(x) => x}\n :index=${(_, c) => c.index}\n ></expression-group>\n `,\n html<ModelRule>`\n <expression-rule\n :config=${(_, c) => c.parent.config}\n :styles=${(_, c) => c.parent.styles}\n :model=${(x) => x}\n :index=${(_, c) => c.index}\n ></expression-rule>\n `,\n )}\n ${when(\n (_, loopCtx) => !loopCtx.isLast,\n html<ModelRule | ModelGroup, ExpressionBuilder>`\n <p class=\"group-combinator-link\">\n ${(_, innerCtx) => innerCtx.parent.model.combinator.type}\n </p>\n `,\n )}\n `,\n { recycle: false, positioning: true },\n )}\n </div>\n </div>\n </div>\n </div>\n `;\n }}\n`"
|
|
975
975
|
}
|
|
976
976
|
],
|
|
977
977
|
"exports": [
|
|
@@ -1166,6 +1166,18 @@
|
|
|
1166
1166
|
}
|
|
1167
1167
|
]
|
|
1168
1168
|
},
|
|
1169
|
+
{
|
|
1170
|
+
"kind": "function",
|
|
1171
|
+
"name": "getValue",
|
|
1172
|
+
"parameters": [
|
|
1173
|
+
{
|
|
1174
|
+
"name": "m",
|
|
1175
|
+
"type": {
|
|
1176
|
+
"text": "ModelRule"
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
]
|
|
1180
|
+
},
|
|
1169
1181
|
{
|
|
1170
1182
|
"kind": "function",
|
|
1171
1183
|
"name": "fieldDefault",
|
|
@@ -1177,6 +1189,88 @@
|
|
|
1177
1189
|
}
|
|
1178
1190
|
}
|
|
1179
1191
|
]
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
"kind": "function",
|
|
1195
|
+
"name": "operatorChangedUpdatedModel",
|
|
1196
|
+
"return": {
|
|
1197
|
+
"type": {
|
|
1198
|
+
"text": "Rule"
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
"parameters": [
|
|
1202
|
+
{
|
|
1203
|
+
"name": "newOperator",
|
|
1204
|
+
"type": {
|
|
1205
|
+
"text": "Operator"
|
|
1206
|
+
}
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
"name": "model",
|
|
1210
|
+
"type": {
|
|
1211
|
+
"text": "ModelRule"
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
]
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
"kind": "function",
|
|
1218
|
+
"name": "valueChangedUpdateModel",
|
|
1219
|
+
"return": {
|
|
1220
|
+
"type": {
|
|
1221
|
+
"text": "Rule"
|
|
1222
|
+
}
|
|
1223
|
+
},
|
|
1224
|
+
"parameters": [
|
|
1225
|
+
{
|
|
1226
|
+
"name": "model",
|
|
1227
|
+
"type": {
|
|
1228
|
+
"text": "ModelRule"
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
"name": "value",
|
|
1233
|
+
"type": {
|
|
1234
|
+
"text": "any"
|
|
1235
|
+
}
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
"name": "argIndex",
|
|
1239
|
+
"type": {
|
|
1240
|
+
"text": "number"
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
]
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"kind": "function",
|
|
1247
|
+
"name": "isValueInvalid",
|
|
1248
|
+
"parameters": [
|
|
1249
|
+
{
|
|
1250
|
+
"name": "x",
|
|
1251
|
+
"type": {
|
|
1252
|
+
"text": "any"
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
],
|
|
1256
|
+
"description": "Test a value considered to be allowed for validation reasons\nA boolean cast to falsy is considered invalid, except special case\nthat we allow `0` because that's a valid numeric comparison.\nThis will consider blank strings invalid, to test against that explicitly the user\nshould define an operator such as `is_blank`\nThis shouldn't be used on a boolean value"
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
"kind": "function",
|
|
1260
|
+
"name": "isPartialRuleError",
|
|
1261
|
+
"return": {
|
|
1262
|
+
"type": {
|
|
1263
|
+
"text": "boolean"
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
"parameters": [
|
|
1267
|
+
{
|
|
1268
|
+
"name": "model",
|
|
1269
|
+
"type": {
|
|
1270
|
+
"text": "ModelRule"
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
]
|
|
1180
1274
|
}
|
|
1181
1275
|
],
|
|
1182
1276
|
"exports": [
|
|
@@ -1188,6 +1282,14 @@
|
|
|
1188
1282
|
"module": "src/main/expression-rule/expression-rule.helpers.ts"
|
|
1189
1283
|
}
|
|
1190
1284
|
},
|
|
1285
|
+
{
|
|
1286
|
+
"kind": "js",
|
|
1287
|
+
"name": "getValue",
|
|
1288
|
+
"declaration": {
|
|
1289
|
+
"name": "getValue",
|
|
1290
|
+
"module": "src/main/expression-rule/expression-rule.helpers.ts"
|
|
1291
|
+
}
|
|
1292
|
+
},
|
|
1191
1293
|
{
|
|
1192
1294
|
"kind": "js",
|
|
1193
1295
|
"name": "fieldDefault",
|
|
@@ -1195,6 +1297,38 @@
|
|
|
1195
1297
|
"name": "fieldDefault",
|
|
1196
1298
|
"module": "src/main/expression-rule/expression-rule.helpers.ts"
|
|
1197
1299
|
}
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
"kind": "js",
|
|
1303
|
+
"name": "operatorChangedUpdatedModel",
|
|
1304
|
+
"declaration": {
|
|
1305
|
+
"name": "operatorChangedUpdatedModel",
|
|
1306
|
+
"module": "src/main/expression-rule/expression-rule.helpers.ts"
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
"kind": "js",
|
|
1311
|
+
"name": "valueChangedUpdateModel",
|
|
1312
|
+
"declaration": {
|
|
1313
|
+
"name": "valueChangedUpdateModel",
|
|
1314
|
+
"module": "src/main/expression-rule/expression-rule.helpers.ts"
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"kind": "js",
|
|
1319
|
+
"name": "isValueInvalid",
|
|
1320
|
+
"declaration": {
|
|
1321
|
+
"name": "isValueInvalid",
|
|
1322
|
+
"module": "src/main/expression-rule/expression-rule.helpers.ts"
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
"kind": "js",
|
|
1327
|
+
"name": "isPartialRuleError",
|
|
1328
|
+
"declaration": {
|
|
1329
|
+
"name": "isPartialRuleError",
|
|
1330
|
+
"module": "src/main/expression-rule/expression-rule.helpers.ts"
|
|
1331
|
+
}
|
|
1198
1332
|
}
|
|
1199
1333
|
]
|
|
1200
1334
|
},
|
|
@@ -1205,7 +1339,7 @@
|
|
|
1205
1339
|
{
|
|
1206
1340
|
"kind": "variable",
|
|
1207
1341
|
"name": "styles",
|
|
1208
|
-
"default": "css`\n .rule-container {\n border: 1px solid #eee;\n margin-bottom: 5px;\n padding: 5px;\n display: grid;\n grid-template-columns: auto 1fr;\n }\n\n .margin {\n margin-left: calc(var(--design-unit) * 1px);\n margin-right: calc(var(--design-unit) * 1px);\n }\n\n .rule-header {\n margin-bottom: 5px;\n display: flex;\n justify-content: flex-end;\n }\n\n .rule-actions {\n display: inline-block;\n }\n\n .rule-content {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n }\n\n .rule-field-container,\n .rule-operator-container,\n .rule-value-container {\n display: inline-block;\n margin: 0 5px 0 0;\n vertical-align: middle;\n }\n\n .rule-value-container {\n border-left: var(--rule-value-separator);\n padding-left: 5px;\n }\n\n .rule-value-container label {\n margin-bottom: 0;\n font-weight: normal;\n }\n\n .rule-value-container label.block {\n display: block;\n }\n\n expression-rule-value {\n display: flex;\n }\n`"
|
|
1342
|
+
"default": "css`\n .rule-container {\n border: 1px solid #eee;\n margin-bottom: 5px;\n padding: 5px;\n display: grid;\n grid-template-columns: auto 1fr;\n }\n\n .rule-container.error {\n border-color: red;\n }\n\n .margin {\n margin-left: calc(var(--design-unit) * 1px);\n margin-right: calc(var(--design-unit) * 1px);\n }\n\n .rule-header {\n margin-bottom: 5px;\n display: flex;\n justify-content: flex-end;\n }\n\n .rule-actions {\n display: inline-block;\n }\n\n .rule-content {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n }\n\n .rule-field-container,\n .rule-operator-container,\n .rule-value-container {\n display: inline-block;\n margin: 0 5px 0 0;\n vertical-align: middle;\n }\n\n .rule-value-container {\n border-left: var(--rule-value-separator);\n padding-left: 5px;\n }\n\n .rule-value-container label {\n margin-bottom: 0;\n font-weight: normal;\n }\n\n .rule-value-container label.block {\n display: block;\n }\n\n expression-rule-value {\n display: flex;\n }\n`"
|
|
1209
1343
|
}
|
|
1210
1344
|
],
|
|
1211
1345
|
"exports": [
|
|
@@ -1226,7 +1360,7 @@
|
|
|
1226
1360
|
{
|
|
1227
1361
|
"kind": "variable",
|
|
1228
1362
|
"name": "template",
|
|
1229
|
-
"default": "html<ExpressionRule>`\n ${(context) => {\n const buttonTag = context.styles?.customElements?.button || 'button';\n\n return html<ExpressionRule>`\n <div class=\"rule-container\">\n <div class=\"rule-content\">\n <expression-rule-field\nclass=\"margin\"\n :fields=${(x) => x.config.fields}\n :field=${(x) => x.model?.field}\n :config=${(x) => x.config}\n :styles=${(x) => x.styles}\n @field-selected=${(x, c) =>\n x.handleFieldSelected(c.event as CustomEvent<EventsDetailMap[Events.FieldSelected]>)}\n ></expression-rule-field>\n <expression-rule-operator\nclass=\"margin\"\n :operators=${(x) => x.config.operators}\n :field=${(x) => x.model.field}\n :operator=${(x) => x.model?.operator}\n :config=${(x) => x.config}\n :styles=${(x) => x.styles}\n @operator-selected=${(x, c) =>\n x.handleOperatorSelected(\n c.event as CustomEvent<EventsDetailMap[Events.OperatorSelected]>,\n )}\n ></expression-rule-operator>\n ${repeat(\n (x) => x.operandIterator,\n html<true, ExpressionRule>`\n <expression-rule-value\n class=\"margin\"\n :config=${(_, c) => c.parent.config}\n :styles=${(_, c) => c.parent.styles}\n :field=${(_, c) => c.parent.model.field}\n :value=${(_, c) => c.parent.operandValue(c.index)}\n value-index=${(_, c) => c.index}\n ?variadic=${(_, c) => c.parent.model?.operator?.nbInputs === 'many'}\n @value-updated=${(_, c) =>\n c.parent.handleValueChanged(\n c.event as CustomEvent<EventsDetailMap[Events.ValueUpdated]>,\n )}\n @remove-variadic-operand=${(_, c) =>\n c.parent.handleRemoveVarArg(\n c.event as CustomEvent<EventsDetailMap[Events.RemoveVarArg]>,\n )}\n ></expression-rule-value>\n `,\n { positioning: true, recycle: false },\n )}\n ${when(\n (x) => x.model?.operator?.nbInputs === 'many',\n html<ExpressionRule>`\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-accept\"\n @click=\"${(x) => x.dispatchAddVarArg()}\"\n >\n +\n </${buttonTag}>\n `,\n )}\n </div>\n\n <div class=\"rule-header\">\n <div class=\"btn-group rule-actions\">\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-danger\"\n data-delete=\"rule\"\n @click=\"${(x, c) => x.dispatchDeleteRule(c.event)}\"\n >\n Delete Rule\n </${buttonTag}>\n </div>\n </div>\n </div>\n `;\n }}\n`"
|
|
1363
|
+
"default": "html<ExpressionRule>`\n ${(context) => {\n const buttonTag = context.styles?.customElements?.button || 'button';\n\n return html<ExpressionRule>`\n <div class=\"rule-container ${(x) => classNames(['error', x.error])}\">\n <div class=\"rule-content\">\n <expression-rule-field\nclass=\"margin\"\n :fields=${(x) => x.config.fields}\n :field=${(x) => x.model?.field}\n :config=${(x) => x.config}\n :styles=${(x) => x.styles}\n @field-selected=${(x, c) =>\n x.handleFieldSelected(c.event as CustomEvent<EventsDetailMap[Events.FieldSelected]>)}\n ></expression-rule-field>\n <expression-rule-operator\nclass=\"margin\"\n :operators=${(x) => x.config.operators}\n :field=${(x) => x.model.field}\n :operator=${(x) => x.model?.operator}\n :config=${(x) => x.config}\n :styles=${(x) => x.styles}\n @operator-selected=${(x, c) =>\n x.handleOperatorSelected(\n c.event as CustomEvent<EventsDetailMap[Events.OperatorSelected]>,\n )}\n ></expression-rule-operator>\n ${repeat(\n (x) => x.operandIterator,\n html<true, ExpressionRule>`\n <expression-rule-value\n class=\"margin\"\n :config=${(_, c) => c.parent.config}\n :styles=${(_, c) => c.parent.styles}\n :field=${(_, c) => c.parent.model.field}\n :value=${(_, c) => c.parent.operandValue(c.index)}\n value-index=${(_, c) => c.index}\n ?variadic=${(_, c) => c.parent.model?.operator?.nbInputs === 'many'}\n @value-updated=${(_, c) =>\n c.parent.handleValueChanged(\n c.event as CustomEvent<EventsDetailMap[Events.ValueUpdated]>,\n )}\n @remove-variadic-operand=${(_, c) =>\n c.parent.handleRemoveVarArg(\n c.event as CustomEvent<EventsDetailMap[Events.RemoveVarArg]>,\n )}\n ></expression-rule-value>\n `,\n { positioning: true, recycle: false },\n )}\n ${when(\n (x) => x.model?.operator?.nbInputs === 'many',\n html<ExpressionRule>`\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-accept\"\n @click=\"${(x) => x.dispatchAddVarArg()}\"\n >\n +\n </${buttonTag}>\n `,\n )}\n </div>\n\n <div class=\"rule-header\">\n <div class=\"btn-group rule-actions\">\n <${buttonTag}\n type=\"button\"\n class=\"btn btn-sm btn-danger\"\n data-delete=\"rule\"\n @click=\"${(x, c) => x.dispatchDeleteRule(c.event)}\"\n >\n Delete Rule\n </${buttonTag}>\n </div>\n </div>\n </div>\n `;\n }}\n`"
|
|
1230
1364
|
}
|
|
1231
1365
|
],
|
|
1232
1366
|
"exports": [
|
|
@@ -1277,6 +1411,14 @@
|
|
|
1277
1411
|
"text": "number"
|
|
1278
1412
|
}
|
|
1279
1413
|
},
|
|
1414
|
+
{
|
|
1415
|
+
"kind": "field",
|
|
1416
|
+
"name": "error",
|
|
1417
|
+
"type": {
|
|
1418
|
+
"text": "boolean"
|
|
1419
|
+
},
|
|
1420
|
+
"default": "false"
|
|
1421
|
+
},
|
|
1280
1422
|
{
|
|
1281
1423
|
"kind": "method",
|
|
1282
1424
|
"name": "variadicRule",
|
|
@@ -1388,6 +1530,15 @@
|
|
|
1388
1530
|
}
|
|
1389
1531
|
}
|
|
1390
1532
|
],
|
|
1533
|
+
"attributes": [
|
|
1534
|
+
{
|
|
1535
|
+
"type": {
|
|
1536
|
+
"text": "boolean"
|
|
1537
|
+
},
|
|
1538
|
+
"default": "false",
|
|
1539
|
+
"fieldName": "error"
|
|
1540
|
+
}
|
|
1541
|
+
],
|
|
1391
1542
|
"superclass": {
|
|
1392
1543
|
"name": "GenesisElement",
|
|
1393
1544
|
"package": "@genesislcap/web-core"
|
|
@@ -1536,7 +1687,7 @@
|
|
|
1536
1687
|
{
|
|
1537
1688
|
"kind": "variable",
|
|
1538
1689
|
"name": "template",
|
|
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`"
|
|
1690
|
+
"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 title=${(x) => x.tooltip}\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 title=${(x) => x.tooltip}\n >\n ${(x) => x.type}\n </${optionTag}>\n `;\n }\n }}\n `,\n )}\n </${selectTag}>\n `;\n }}\n`"
|
|
1540
1691
|
}
|
|
1541
1692
|
],
|
|
1542
1693
|
"exports": [
|