@genesislcap/foundation-forms 14.70.4-es2021.1 → 14.70.4-test.1
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 +198 -420
- package/dist/esm/filters/filters.js +12 -9
- package/dist/esm/form.js +33 -28
- package/dist/esm/jsonforms/json-forms.js +16 -14
- package/dist/esm/jsonforms/renderers/ArrayListWrapperRenderer.js +3 -3
- package/dist/esm/jsonforms/renderers/CategorizationWrapperRenderer.js +1 -1
- package/dist/esm/jsonforms/renderers/ConnectedMultiselectControlRenderer.js +4 -4
- package/dist/esm/jsonforms/renderers/ConnectedSelectControlRenderer.js +7 -6
- package/dist/esm/jsonforms/renderers/ControlWrapperRenderer.js +1 -1
- package/dist/esm/jsonforms/renderers/EnumControlRenderer.js +4 -7
- package/dist/esm/jsonforms/renderers/FilterDateControlRenderer.js +24 -16
- package/dist/esm/jsonforms/renderers/FilterNumberControlRenderer.js +8 -6
- package/dist/esm/jsonforms/renderers/NumberControlRenderer.js +2 -2
- package/dist/esm/jsonforms/renderers/StringControlRenderer.js +1 -1
- package/dist/esm/jsonforms/renderers/dispatch-renderer.js +5 -10
- package/dist/esm/jsonforms/testers/isInvisible.js +2 -1
- package/dist/esm/utils/filters.js +2 -2
- package/dist/esm/utils/translation.js +3 -2
- package/dist/esm/utils/validation.js +4 -4
- package/package.json +8 -8
|
@@ -118,117 +118,6 @@
|
|
|
118
118
|
"name": "reset",
|
|
119
119
|
"description": "Reset the form state",
|
|
120
120
|
"privacy": "public"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"kind": "field",
|
|
124
|
-
"name": "_presentation",
|
|
125
|
-
"type": {
|
|
126
|
-
"text": "ComponentPresentation | null | undefined"
|
|
127
|
-
},
|
|
128
|
-
"privacy": "private",
|
|
129
|
-
"default": "void 0",
|
|
130
|
-
"inheritedFrom": {
|
|
131
|
-
"name": "FoundationElement",
|
|
132
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"kind": "field",
|
|
137
|
-
"name": "$presentation",
|
|
138
|
-
"type": {
|
|
139
|
-
"text": "ComponentPresentation | null"
|
|
140
|
-
},
|
|
141
|
-
"privacy": "public",
|
|
142
|
-
"description": "A property which resolves the ComponentPresentation instance\nfor the current component.",
|
|
143
|
-
"inheritedFrom": {
|
|
144
|
-
"name": "FoundationElement",
|
|
145
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"kind": "field",
|
|
150
|
-
"name": "template",
|
|
151
|
-
"type": {
|
|
152
|
-
"text": "ElementViewTemplate | void | null"
|
|
153
|
-
},
|
|
154
|
-
"privacy": "public",
|
|
155
|
-
"description": "Sets the template of the element instance. When undefined,\nthe element will attempt to resolve the template from\nthe associated presentation or custom element definition.",
|
|
156
|
-
"inheritedFrom": {
|
|
157
|
-
"name": "FoundationElement",
|
|
158
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"kind": "method",
|
|
163
|
-
"name": "templateChanged",
|
|
164
|
-
"privacy": "protected",
|
|
165
|
-
"return": {
|
|
166
|
-
"type": {
|
|
167
|
-
"text": "void"
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
"inheritedFrom": {
|
|
171
|
-
"name": "FoundationElement",
|
|
172
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"kind": "field",
|
|
177
|
-
"name": "styles",
|
|
178
|
-
"type": {
|
|
179
|
-
"text": "ElementStyles | void | null"
|
|
180
|
-
},
|
|
181
|
-
"privacy": "public",
|
|
182
|
-
"description": "Sets the default styles for the element instance. When undefined,\nthe element will attempt to resolve default styles from\nthe associated presentation or custom element definition.",
|
|
183
|
-
"inheritedFrom": {
|
|
184
|
-
"name": "FoundationElement",
|
|
185
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"kind": "method",
|
|
190
|
-
"name": "stylesChanged",
|
|
191
|
-
"privacy": "protected",
|
|
192
|
-
"return": {
|
|
193
|
-
"type": {
|
|
194
|
-
"text": "void"
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
"inheritedFrom": {
|
|
198
|
-
"name": "FoundationElement",
|
|
199
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"kind": "method",
|
|
204
|
-
"name": "compose",
|
|
205
|
-
"privacy": "public",
|
|
206
|
-
"static": true,
|
|
207
|
-
"return": {
|
|
208
|
-
"type": {
|
|
209
|
-
"text": "(\n overrideDefinition?: OverrideFoundationElementDefinition<T>\n ) => FoundationElementRegistry<T, K>"
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
"parameters": [
|
|
213
|
-
{
|
|
214
|
-
"name": "this",
|
|
215
|
-
"type": {
|
|
216
|
-
"text": "K"
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
"name": "elementDefinition",
|
|
221
|
-
"type": {
|
|
222
|
-
"text": "T"
|
|
223
|
-
},
|
|
224
|
-
"description": "The definition of the element to create the registry\nfunction for."
|
|
225
|
-
}
|
|
226
|
-
],
|
|
227
|
-
"description": "Defines an element registry function with a set of element definition defaults.",
|
|
228
|
-
"inheritedFrom": {
|
|
229
|
-
"name": "FoundationElement",
|
|
230
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
231
|
-
}
|
|
232
121
|
}
|
|
233
122
|
],
|
|
234
123
|
"attributes": [
|
|
@@ -485,117 +374,6 @@
|
|
|
485
374
|
{
|
|
486
375
|
"kind": "method",
|
|
487
376
|
"name": "valueChanged"
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
"kind": "field",
|
|
491
|
-
"name": "_presentation",
|
|
492
|
-
"type": {
|
|
493
|
-
"text": "ComponentPresentation | null | undefined"
|
|
494
|
-
},
|
|
495
|
-
"privacy": "private",
|
|
496
|
-
"default": "void 0",
|
|
497
|
-
"inheritedFrom": {
|
|
498
|
-
"name": "FoundationElement",
|
|
499
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
500
|
-
}
|
|
501
|
-
},
|
|
502
|
-
{
|
|
503
|
-
"kind": "field",
|
|
504
|
-
"name": "$presentation",
|
|
505
|
-
"type": {
|
|
506
|
-
"text": "ComponentPresentation | null"
|
|
507
|
-
},
|
|
508
|
-
"privacy": "public",
|
|
509
|
-
"description": "A property which resolves the ComponentPresentation instance\nfor the current component.",
|
|
510
|
-
"inheritedFrom": {
|
|
511
|
-
"name": "FoundationElement",
|
|
512
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
513
|
-
}
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
"kind": "field",
|
|
517
|
-
"name": "template",
|
|
518
|
-
"type": {
|
|
519
|
-
"text": "ElementViewTemplate | void | null"
|
|
520
|
-
},
|
|
521
|
-
"privacy": "public",
|
|
522
|
-
"description": "Sets the template of the element instance. When undefined,\nthe element will attempt to resolve the template from\nthe associated presentation or custom element definition.",
|
|
523
|
-
"inheritedFrom": {
|
|
524
|
-
"name": "FoundationElement",
|
|
525
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
526
|
-
}
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
"kind": "method",
|
|
530
|
-
"name": "templateChanged",
|
|
531
|
-
"privacy": "protected",
|
|
532
|
-
"return": {
|
|
533
|
-
"type": {
|
|
534
|
-
"text": "void"
|
|
535
|
-
}
|
|
536
|
-
},
|
|
537
|
-
"inheritedFrom": {
|
|
538
|
-
"name": "FoundationElement",
|
|
539
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
540
|
-
}
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
"kind": "field",
|
|
544
|
-
"name": "styles",
|
|
545
|
-
"type": {
|
|
546
|
-
"text": "ElementStyles | void | null"
|
|
547
|
-
},
|
|
548
|
-
"privacy": "public",
|
|
549
|
-
"description": "Sets the default styles for the element instance. When undefined,\nthe element will attempt to resolve default styles from\nthe associated presentation or custom element definition.",
|
|
550
|
-
"inheritedFrom": {
|
|
551
|
-
"name": "FoundationElement",
|
|
552
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
553
|
-
}
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
"kind": "method",
|
|
557
|
-
"name": "stylesChanged",
|
|
558
|
-
"privacy": "protected",
|
|
559
|
-
"return": {
|
|
560
|
-
"type": {
|
|
561
|
-
"text": "void"
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
"inheritedFrom": {
|
|
565
|
-
"name": "FoundationElement",
|
|
566
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
567
|
-
}
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
"kind": "method",
|
|
571
|
-
"name": "compose",
|
|
572
|
-
"privacy": "public",
|
|
573
|
-
"static": true,
|
|
574
|
-
"return": {
|
|
575
|
-
"type": {
|
|
576
|
-
"text": "(\n overrideDefinition?: OverrideFoundationElementDefinition<T>\n ) => FoundationElementRegistry<T, K>"
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
"parameters": [
|
|
580
|
-
{
|
|
581
|
-
"name": "this",
|
|
582
|
-
"type": {
|
|
583
|
-
"text": "K"
|
|
584
|
-
}
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
"name": "elementDefinition",
|
|
588
|
-
"type": {
|
|
589
|
-
"text": "T"
|
|
590
|
-
},
|
|
591
|
-
"description": "The definition of the element to create the registry\nfunction for."
|
|
592
|
-
}
|
|
593
|
-
],
|
|
594
|
-
"description": "Defines an element registry function with a set of element definition defaults.",
|
|
595
|
-
"inheritedFrom": {
|
|
596
|
-
"name": "FoundationElement",
|
|
597
|
-
"module": "src/foundation-element/foundation-element.ts"
|
|
598
|
-
}
|
|
599
377
|
}
|
|
600
378
|
],
|
|
601
379
|
"events": [
|
|
@@ -976,6 +754,204 @@
|
|
|
976
754
|
}
|
|
977
755
|
]
|
|
978
756
|
},
|
|
757
|
+
{
|
|
758
|
+
"kind": "javascript-module",
|
|
759
|
+
"path": "src/jsonforms/testers/isDate.ts",
|
|
760
|
+
"declarations": [
|
|
761
|
+
{
|
|
762
|
+
"kind": "variable",
|
|
763
|
+
"name": "isDate"
|
|
764
|
+
}
|
|
765
|
+
],
|
|
766
|
+
"exports": [
|
|
767
|
+
{
|
|
768
|
+
"kind": "js",
|
|
769
|
+
"name": "isDate",
|
|
770
|
+
"declaration": {
|
|
771
|
+
"name": "isDate",
|
|
772
|
+
"module": "src/jsonforms/testers/isDate.ts"
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
]
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"kind": "javascript-module",
|
|
779
|
+
"path": "src/jsonforms/testers/isInvisible.ts",
|
|
780
|
+
"declarations": [
|
|
781
|
+
{
|
|
782
|
+
"kind": "function",
|
|
783
|
+
"name": "isInvisible",
|
|
784
|
+
"return": {
|
|
785
|
+
"type": {
|
|
786
|
+
"text": "boolean"
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
"parameters": [
|
|
790
|
+
{
|
|
791
|
+
"name": "uischema",
|
|
792
|
+
"type": {
|
|
793
|
+
"text": "UISchemaElement"
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"name": "schema",
|
|
798
|
+
"type": {
|
|
799
|
+
"text": "JsonSchema"
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
"name": "context",
|
|
804
|
+
"type": {
|
|
805
|
+
"text": "TesterContext"
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
]
|
|
809
|
+
}
|
|
810
|
+
],
|
|
811
|
+
"exports": [
|
|
812
|
+
{
|
|
813
|
+
"kind": "js",
|
|
814
|
+
"name": "isInvisible",
|
|
815
|
+
"declaration": {
|
|
816
|
+
"name": "isInvisible",
|
|
817
|
+
"module": "src/jsonforms/testers/isInvisible.ts"
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
]
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"kind": "javascript-module",
|
|
824
|
+
"path": "src/jsonforms/testers/isLayoutArray.ts",
|
|
825
|
+
"declarations": [
|
|
826
|
+
{
|
|
827
|
+
"kind": "variable",
|
|
828
|
+
"name": "isLayoutArray"
|
|
829
|
+
}
|
|
830
|
+
],
|
|
831
|
+
"exports": [
|
|
832
|
+
{
|
|
833
|
+
"kind": "js",
|
|
834
|
+
"name": "isLayoutArray",
|
|
835
|
+
"declaration": {
|
|
836
|
+
"name": "isLayoutArray",
|
|
837
|
+
"module": "src/jsonforms/testers/isLayoutArray.ts"
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
]
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"kind": "javascript-module",
|
|
844
|
+
"path": "src/jsonforms/testers/isOneOfBoolean.ts",
|
|
845
|
+
"declarations": [
|
|
846
|
+
{
|
|
847
|
+
"kind": "variable",
|
|
848
|
+
"name": "isOneOfBoolean"
|
|
849
|
+
}
|
|
850
|
+
],
|
|
851
|
+
"exports": [
|
|
852
|
+
{
|
|
853
|
+
"kind": "js",
|
|
854
|
+
"name": "isOneOfBoolean",
|
|
855
|
+
"declaration": {
|
|
856
|
+
"name": "isOneOfBoolean",
|
|
857
|
+
"module": "src/jsonforms/testers/isOneOfBoolean.ts"
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
]
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
"kind": "javascript-module",
|
|
864
|
+
"path": "src/jsonforms/testers/isOneOfEnum.ts",
|
|
865
|
+
"declarations": [
|
|
866
|
+
{
|
|
867
|
+
"kind": "variable",
|
|
868
|
+
"name": "isOneOfEnum"
|
|
869
|
+
}
|
|
870
|
+
],
|
|
871
|
+
"exports": [
|
|
872
|
+
{
|
|
873
|
+
"kind": "js",
|
|
874
|
+
"name": "isOneOfEnum",
|
|
875
|
+
"declaration": {
|
|
876
|
+
"name": "isOneOfEnum",
|
|
877
|
+
"module": "src/jsonforms/testers/isOneOfEnum.ts"
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
]
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
"kind": "javascript-module",
|
|
884
|
+
"path": "src/jsonforms/testers/isOneOfNumber.ts",
|
|
885
|
+
"declarations": [
|
|
886
|
+
{
|
|
887
|
+
"kind": "variable",
|
|
888
|
+
"name": "isOneOfNumber"
|
|
889
|
+
}
|
|
890
|
+
],
|
|
891
|
+
"exports": [
|
|
892
|
+
{
|
|
893
|
+
"kind": "js",
|
|
894
|
+
"name": "isOneOfNumber",
|
|
895
|
+
"declaration": {
|
|
896
|
+
"name": "isOneOfNumber",
|
|
897
|
+
"module": "src/jsonforms/testers/isOneOfNumber.ts"
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
]
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
"kind": "javascript-module",
|
|
904
|
+
"path": "src/jsonforms/testers/isOneOfOptionMultiselect.ts",
|
|
905
|
+
"declarations": [
|
|
906
|
+
{
|
|
907
|
+
"kind": "variable",
|
|
908
|
+
"name": "isOneOfOptionMultiselect"
|
|
909
|
+
}
|
|
910
|
+
],
|
|
911
|
+
"exports": [
|
|
912
|
+
{
|
|
913
|
+
"kind": "js",
|
|
914
|
+
"name": "isOneOfOptionMultiselect",
|
|
915
|
+
"declaration": {
|
|
916
|
+
"name": "isOneOfOptionMultiselect",
|
|
917
|
+
"module": "src/jsonforms/testers/isOneOfOptionMultiselect.ts"
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
]
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"kind": "javascript-module",
|
|
924
|
+
"path": "src/jsonforms/testers/optionIs.ts",
|
|
925
|
+
"declarations": [
|
|
926
|
+
{
|
|
927
|
+
"kind": "function",
|
|
928
|
+
"name": "optionIs",
|
|
929
|
+
"return": {
|
|
930
|
+
"type": {
|
|
931
|
+
"text": "Tester"
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
"parameters": [
|
|
935
|
+
{
|
|
936
|
+
"name": "optionName",
|
|
937
|
+
"type": {
|
|
938
|
+
"text": "string"
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
]
|
|
942
|
+
}
|
|
943
|
+
],
|
|
944
|
+
"exports": [
|
|
945
|
+
{
|
|
946
|
+
"kind": "js",
|
|
947
|
+
"name": "optionIs",
|
|
948
|
+
"declaration": {
|
|
949
|
+
"name": "optionIs",
|
|
950
|
+
"module": "src/jsonforms/testers/optionIs.ts"
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
]
|
|
954
|
+
},
|
|
979
955
|
{
|
|
980
956
|
"kind": "javascript-module",
|
|
981
957
|
"path": "src/jsonforms/renderers/ArrayListWrapperRenderer.ts",
|
|
@@ -2220,204 +2196,6 @@
|
|
|
2220
2196
|
}
|
|
2221
2197
|
}
|
|
2222
2198
|
]
|
|
2223
|
-
},
|
|
2224
|
-
{
|
|
2225
|
-
"kind": "javascript-module",
|
|
2226
|
-
"path": "src/jsonforms/testers/isDate.ts",
|
|
2227
|
-
"declarations": [
|
|
2228
|
-
{
|
|
2229
|
-
"kind": "variable",
|
|
2230
|
-
"name": "isDate"
|
|
2231
|
-
}
|
|
2232
|
-
],
|
|
2233
|
-
"exports": [
|
|
2234
|
-
{
|
|
2235
|
-
"kind": "js",
|
|
2236
|
-
"name": "isDate",
|
|
2237
|
-
"declaration": {
|
|
2238
|
-
"name": "isDate",
|
|
2239
|
-
"module": "src/jsonforms/testers/isDate.ts"
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
]
|
|
2243
|
-
},
|
|
2244
|
-
{
|
|
2245
|
-
"kind": "javascript-module",
|
|
2246
|
-
"path": "src/jsonforms/testers/isInvisible.ts",
|
|
2247
|
-
"declarations": [
|
|
2248
|
-
{
|
|
2249
|
-
"kind": "function",
|
|
2250
|
-
"name": "isInvisible",
|
|
2251
|
-
"return": {
|
|
2252
|
-
"type": {
|
|
2253
|
-
"text": "boolean"
|
|
2254
|
-
}
|
|
2255
|
-
},
|
|
2256
|
-
"parameters": [
|
|
2257
|
-
{
|
|
2258
|
-
"name": "uischema",
|
|
2259
|
-
"type": {
|
|
2260
|
-
"text": "UISchemaElement"
|
|
2261
|
-
}
|
|
2262
|
-
},
|
|
2263
|
-
{
|
|
2264
|
-
"name": "schema",
|
|
2265
|
-
"type": {
|
|
2266
|
-
"text": "JsonSchema"
|
|
2267
|
-
}
|
|
2268
|
-
},
|
|
2269
|
-
{
|
|
2270
|
-
"name": "context",
|
|
2271
|
-
"type": {
|
|
2272
|
-
"text": "TesterContext"
|
|
2273
|
-
}
|
|
2274
|
-
}
|
|
2275
|
-
]
|
|
2276
|
-
}
|
|
2277
|
-
],
|
|
2278
|
-
"exports": [
|
|
2279
|
-
{
|
|
2280
|
-
"kind": "js",
|
|
2281
|
-
"name": "isInvisible",
|
|
2282
|
-
"declaration": {
|
|
2283
|
-
"name": "isInvisible",
|
|
2284
|
-
"module": "src/jsonforms/testers/isInvisible.ts"
|
|
2285
|
-
}
|
|
2286
|
-
}
|
|
2287
|
-
]
|
|
2288
|
-
},
|
|
2289
|
-
{
|
|
2290
|
-
"kind": "javascript-module",
|
|
2291
|
-
"path": "src/jsonforms/testers/isLayoutArray.ts",
|
|
2292
|
-
"declarations": [
|
|
2293
|
-
{
|
|
2294
|
-
"kind": "variable",
|
|
2295
|
-
"name": "isLayoutArray"
|
|
2296
|
-
}
|
|
2297
|
-
],
|
|
2298
|
-
"exports": [
|
|
2299
|
-
{
|
|
2300
|
-
"kind": "js",
|
|
2301
|
-
"name": "isLayoutArray",
|
|
2302
|
-
"declaration": {
|
|
2303
|
-
"name": "isLayoutArray",
|
|
2304
|
-
"module": "src/jsonforms/testers/isLayoutArray.ts"
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
|
-
]
|
|
2308
|
-
},
|
|
2309
|
-
{
|
|
2310
|
-
"kind": "javascript-module",
|
|
2311
|
-
"path": "src/jsonforms/testers/isOneOfBoolean.ts",
|
|
2312
|
-
"declarations": [
|
|
2313
|
-
{
|
|
2314
|
-
"kind": "variable",
|
|
2315
|
-
"name": "isOneOfBoolean"
|
|
2316
|
-
}
|
|
2317
|
-
],
|
|
2318
|
-
"exports": [
|
|
2319
|
-
{
|
|
2320
|
-
"kind": "js",
|
|
2321
|
-
"name": "isOneOfBoolean",
|
|
2322
|
-
"declaration": {
|
|
2323
|
-
"name": "isOneOfBoolean",
|
|
2324
|
-
"module": "src/jsonforms/testers/isOneOfBoolean.ts"
|
|
2325
|
-
}
|
|
2326
|
-
}
|
|
2327
|
-
]
|
|
2328
|
-
},
|
|
2329
|
-
{
|
|
2330
|
-
"kind": "javascript-module",
|
|
2331
|
-
"path": "src/jsonforms/testers/isOneOfEnum.ts",
|
|
2332
|
-
"declarations": [
|
|
2333
|
-
{
|
|
2334
|
-
"kind": "variable",
|
|
2335
|
-
"name": "isOneOfEnum"
|
|
2336
|
-
}
|
|
2337
|
-
],
|
|
2338
|
-
"exports": [
|
|
2339
|
-
{
|
|
2340
|
-
"kind": "js",
|
|
2341
|
-
"name": "isOneOfEnum",
|
|
2342
|
-
"declaration": {
|
|
2343
|
-
"name": "isOneOfEnum",
|
|
2344
|
-
"module": "src/jsonforms/testers/isOneOfEnum.ts"
|
|
2345
|
-
}
|
|
2346
|
-
}
|
|
2347
|
-
]
|
|
2348
|
-
},
|
|
2349
|
-
{
|
|
2350
|
-
"kind": "javascript-module",
|
|
2351
|
-
"path": "src/jsonforms/testers/isOneOfNumber.ts",
|
|
2352
|
-
"declarations": [
|
|
2353
|
-
{
|
|
2354
|
-
"kind": "variable",
|
|
2355
|
-
"name": "isOneOfNumber"
|
|
2356
|
-
}
|
|
2357
|
-
],
|
|
2358
|
-
"exports": [
|
|
2359
|
-
{
|
|
2360
|
-
"kind": "js",
|
|
2361
|
-
"name": "isOneOfNumber",
|
|
2362
|
-
"declaration": {
|
|
2363
|
-
"name": "isOneOfNumber",
|
|
2364
|
-
"module": "src/jsonforms/testers/isOneOfNumber.ts"
|
|
2365
|
-
}
|
|
2366
|
-
}
|
|
2367
|
-
]
|
|
2368
|
-
},
|
|
2369
|
-
{
|
|
2370
|
-
"kind": "javascript-module",
|
|
2371
|
-
"path": "src/jsonforms/testers/isOneOfOptionMultiselect.ts",
|
|
2372
|
-
"declarations": [
|
|
2373
|
-
{
|
|
2374
|
-
"kind": "variable",
|
|
2375
|
-
"name": "isOneOfOptionMultiselect"
|
|
2376
|
-
}
|
|
2377
|
-
],
|
|
2378
|
-
"exports": [
|
|
2379
|
-
{
|
|
2380
|
-
"kind": "js",
|
|
2381
|
-
"name": "isOneOfOptionMultiselect",
|
|
2382
|
-
"declaration": {
|
|
2383
|
-
"name": "isOneOfOptionMultiselect",
|
|
2384
|
-
"module": "src/jsonforms/testers/isOneOfOptionMultiselect.ts"
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
]
|
|
2388
|
-
},
|
|
2389
|
-
{
|
|
2390
|
-
"kind": "javascript-module",
|
|
2391
|
-
"path": "src/jsonforms/testers/optionIs.ts",
|
|
2392
|
-
"declarations": [
|
|
2393
|
-
{
|
|
2394
|
-
"kind": "function",
|
|
2395
|
-
"name": "optionIs",
|
|
2396
|
-
"return": {
|
|
2397
|
-
"type": {
|
|
2398
|
-
"text": "Tester"
|
|
2399
|
-
}
|
|
2400
|
-
},
|
|
2401
|
-
"parameters": [
|
|
2402
|
-
{
|
|
2403
|
-
"name": "optionName",
|
|
2404
|
-
"type": {
|
|
2405
|
-
"text": "string"
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
]
|
|
2409
|
-
}
|
|
2410
|
-
],
|
|
2411
|
-
"exports": [
|
|
2412
|
-
{
|
|
2413
|
-
"kind": "js",
|
|
2414
|
-
"name": "optionIs",
|
|
2415
|
-
"declaration": {
|
|
2416
|
-
"name": "optionIs",
|
|
2417
|
-
"module": "src/jsonforms/testers/optionIs.ts"
|
|
2418
|
-
}
|
|
2419
|
-
}
|
|
2420
|
-
]
|
|
2421
2199
|
}
|
|
2422
2200
|
]
|
|
2423
2201
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
|
2
2
|
import { Connect } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { CriteriaBuilder, Join } from '@genesislcap/foundation-criteria';
|
|
4
4
|
import { createLogger } from '@genesislcap/foundation-utils';
|
|
@@ -64,13 +64,16 @@ let Filters = class Filters extends FoundationElement {
|
|
|
64
64
|
*/
|
|
65
65
|
this.data = {};
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
resourceNameChanged() {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
this.jsonSchema = undefined;
|
|
71
|
+
if (this.resourceName) {
|
|
72
|
+
const jsonSchemaResponse = yield this.connect.getJSONSchema(this.resourceName);
|
|
73
|
+
this.jsonSchema = (_b = (_a = jsonSchemaResponse === null || jsonSchemaResponse === void 0 ? void 0 : jsonSchemaResponse.OUTBOUND) === null || _a === void 0 ? void 0 : _a.$defs) === null || _b === void 0 ? void 0 : _b['global.genesis.message.core.dataserver.QueryRow'];
|
|
74
|
+
(_c = this.jsonSchema) === null || _c === void 0 ? true : delete _c.properties['DETAILS'];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
74
77
|
}
|
|
75
78
|
clearFiltersData() {
|
|
76
79
|
this.data = {};
|
|
@@ -84,7 +87,7 @@ let Filters = class Filters extends FoundationElement {
|
|
|
84
87
|
*/
|
|
85
88
|
searchFilters() {
|
|
86
89
|
this.value = '';
|
|
87
|
-
const payload = {
|
|
90
|
+
const payload = Object.assign({}, this.data);
|
|
88
91
|
const expressions = createExpressions(payload);
|
|
89
92
|
const criteriaBuilder = new CriteriaBuilder();
|
|
90
93
|
filtersLogger.debug({ payload });
|
package/dist/esm/form.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
|
2
2
|
import { Connect } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { createLogger } from '@genesislcap/foundation-utils';
|
|
4
4
|
import { isControl, isStringControl, mapStateToControlProps, rankWith, } from '@jsonforms/core';
|
|
@@ -71,12 +71,15 @@ let Form = class Form extends FoundationElement {
|
|
|
71
71
|
*/
|
|
72
72
|
this.data = {};
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this.
|
|
79
|
-
|
|
74
|
+
resourceNameChanged() {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
this.jsonSchema = undefined;
|
|
78
|
+
if (this.resourceName) {
|
|
79
|
+
const jsonSchemaResponse = yield this.connect.getJSONSchema(this.resourceName);
|
|
80
|
+
this.jsonSchema = (_b = (_a = jsonSchemaResponse === null || jsonSchemaResponse === void 0 ? void 0 : jsonSchemaResponse.INBOUND) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.DETAILS;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
80
83
|
}
|
|
81
84
|
removeDataProperties() {
|
|
82
85
|
if (!this.jsonSchema || !this.data) {
|
|
@@ -94,35 +97,37 @@ let Form = class Form extends FoundationElement {
|
|
|
94
97
|
});
|
|
95
98
|
// force update of the data object to trigger error validation
|
|
96
99
|
if (removedPropertiesCount > 0) {
|
|
97
|
-
this.data = {
|
|
100
|
+
this.data = Object.assign({}, this.data);
|
|
98
101
|
}
|
|
99
102
|
return removedPropertiesCount > 0;
|
|
100
103
|
}
|
|
101
104
|
/**
|
|
102
105
|
* @internal
|
|
103
106
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (this.removeDataProperties()) {
|
|
109
|
-
await DOM.nextUpdate();
|
|
110
|
-
}
|
|
111
|
-
this.submitted = true;
|
|
112
|
-
const payload = { ...this.data };
|
|
113
|
-
logger.debug({ payload, errors: this.errors });
|
|
114
|
-
this.$emit('submit', { payload, errors: this.errors });
|
|
115
|
-
if (Object.entries(payload).length !== 0 && this.resourceName) {
|
|
116
|
-
this.submitting = true;
|
|
117
|
-
const formSubmitReq = await this.connect.commitEvent(this.resourceName, { DETAILS: payload });
|
|
118
|
-
this.submitting = false;
|
|
119
|
-
if (formSubmitReq.ERROR) {
|
|
120
|
-
this.$emit('submit-failure', { payload, errors: formSubmitReq.ERROR });
|
|
107
|
+
_submit() {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
if (this.submitting) {
|
|
110
|
+
return;
|
|
121
111
|
}
|
|
122
|
-
|
|
123
|
-
|
|
112
|
+
if (this.removeDataProperties()) {
|
|
113
|
+
yield DOM.nextUpdate();
|
|
124
114
|
}
|
|
125
|
-
|
|
115
|
+
this.submitted = true;
|
|
116
|
+
const payload = Object.assign({}, this.data);
|
|
117
|
+
logger.debug({ payload, errors: this.errors });
|
|
118
|
+
this.$emit('submit', { payload, errors: this.errors });
|
|
119
|
+
if (Object.entries(payload).length !== 0 && this.resourceName) {
|
|
120
|
+
this.submitting = true;
|
|
121
|
+
const formSubmitReq = yield this.connect.commitEvent(this.resourceName, { DETAILS: payload });
|
|
122
|
+
this.submitting = false;
|
|
123
|
+
if (formSubmitReq.ERROR) {
|
|
124
|
+
this.$emit('submit-failure', { payload, errors: formSubmitReq.ERROR });
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.$emit('submit-success', { payload });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
126
131
|
}
|
|
127
132
|
/**
|
|
128
133
|
* @internal
|
|
@@ -15,16 +15,14 @@ const template = html `
|
|
|
15
15
|
</template>
|
|
16
16
|
`;
|
|
17
17
|
const errorTranslator = (error, t, uischema) => {
|
|
18
|
-
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
|
+
return ((_d = (_c = (_b = (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.i18n) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c[error.keyword]) !== null && _d !== void 0 ? _d : genesisErrorTranslator(error, t, uischema));
|
|
19
20
|
};
|
|
20
21
|
let JSONForms = class JSONForms extends FASTElement {
|
|
21
22
|
constructor() {
|
|
22
23
|
super(...arguments);
|
|
23
24
|
this.dispatch = (action) => {
|
|
24
|
-
this.jsonforms = {
|
|
25
|
-
...this.jsonforms,
|
|
26
|
-
core: coreReducer(this.jsonforms.core, action),
|
|
27
|
-
};
|
|
25
|
+
this.jsonforms = Object.assign(Object.assign({}, this.jsonforms), { core: coreReducer(this.jsonforms.core, action) });
|
|
28
26
|
this.$emit('data-change', {
|
|
29
27
|
data: this.jsonforms.core.data,
|
|
30
28
|
errors: this.jsonforms.core.errors,
|
|
@@ -36,17 +34,19 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
36
34
|
* @returns ErrorObject[] that will be passed to JsonFormsCore as additionalErrors
|
|
37
35
|
*/
|
|
38
36
|
this.validate = (uischema) => {
|
|
39
|
-
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
const data = (_b = (_a = this.jsonforms) === null || _a === void 0 ? void 0 : _a.core) === null || _b === void 0 ? void 0 : _b.data;
|
|
40
39
|
if (!data)
|
|
41
40
|
return [];
|
|
42
41
|
const errors = [];
|
|
43
|
-
uischema
|
|
44
|
-
|
|
42
|
+
(_c = uischema === null || uischema === void 0 ? void 0 : uischema.elements) === null || _c === void 0 ? void 0 : _c.forEach((e) => {
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
|
+
const validator = (_a = e === null || e === void 0 ? void 0 : e.options) === null || _a === void 0 ? void 0 : _a.validateFn;
|
|
45
45
|
if (typeof validator !== 'function')
|
|
46
46
|
return;
|
|
47
|
-
const path = e
|
|
48
|
-
const label = e
|
|
49
|
-
let newErrors = validator(data, path, label)
|
|
47
|
+
const path = (_c = (_b = e === null || e === void 0 ? void 0 : e.scope) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop();
|
|
48
|
+
const label = e === null || e === void 0 ? void 0 : e.label;
|
|
49
|
+
let newErrors = (_d = validator(data, path, label)) !== null && _d !== void 0 ? _d : [];
|
|
50
50
|
// the validator function is supposed to return an array of errors but let's not explode if it returns a single one
|
|
51
51
|
if (!Array.isArray(newErrors)) {
|
|
52
52
|
newErrors = [newErrors];
|
|
@@ -57,10 +57,11 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
schemaChanged() {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
60
61
|
if (!this.schema) {
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
|
-
const uischemaToUse = this.uischema
|
|
64
|
+
const uischemaToUse = (_a = this.uischema) !== null && _a !== void 0 ? _a : Generate.uiSchema(this.schema);
|
|
64
65
|
if (!this.uischema) {
|
|
65
66
|
console.log('UI schema not provided. Auto generated schema:', uischemaToUse);
|
|
66
67
|
}
|
|
@@ -81,7 +82,7 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
81
82
|
this.jsonforms = {
|
|
82
83
|
core: initCore(),
|
|
83
84
|
config: configReducer(undefined, Actions.setConfig(this.config)),
|
|
84
|
-
i18n: i18nReducer(this.i18n, Actions.updateI18n(this.i18n
|
|
85
|
+
i18n: i18nReducer(this.i18n, Actions.updateI18n((_b = this.i18n) === null || _b === void 0 ? void 0 : _b.locale, (_c = this.i18n) === null || _c === void 0 ? void 0 : _c.translate, ((_d = this.i18n) === null || _d === void 0 ? void 0 : _d.translateError) || errorTranslator)),
|
|
85
86
|
renderers: this.renderers,
|
|
86
87
|
readonly: this.readonly,
|
|
87
88
|
};
|
|
@@ -112,10 +113,11 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
112
113
|
this.schemaChanged();
|
|
113
114
|
}
|
|
114
115
|
get props() {
|
|
116
|
+
var _a;
|
|
115
117
|
if (!this.schema && !this.uischema) {
|
|
116
118
|
return undefined;
|
|
117
119
|
}
|
|
118
|
-
const uischema = this.uischema
|
|
120
|
+
const uischema = (_a = this.uischema) !== null && _a !== void 0 ? _a : Generate.uiSchema(this.schema);
|
|
119
121
|
return {
|
|
120
122
|
uischema,
|
|
121
123
|
schema: this.schema,
|
|
@@ -62,14 +62,14 @@ let ArrayListWrapper = class ArrayListWrapper extends FASTElement {
|
|
|
62
62
|
}
|
|
63
63
|
this.schema = this.control.schema.properties[this.pathName].items;
|
|
64
64
|
const arrayUiSchema = Generate.uiSchema(this.schema);
|
|
65
|
-
this.uiSchema = {
|
|
65
|
+
this.uiSchema = Object.assign(Object.assign({}, arrayUiSchema), { type: 'HorizontalLayout' });
|
|
66
66
|
console.log('Auto generated uiSchema for layout array:', this.uiSchema);
|
|
67
67
|
}
|
|
68
68
|
addItem() {
|
|
69
69
|
const items = this.control.data[this.pathName] && Object.keys(this.control.data[this.pathName]).length !== 0
|
|
70
70
|
? [...this.control.data[this.pathName], {}]
|
|
71
71
|
: [{}];
|
|
72
|
-
const data = {
|
|
72
|
+
const data = Object.assign(Object.assign({}, this.control.data), { [this.pathName]: items });
|
|
73
73
|
this.$emit('data-change', {
|
|
74
74
|
data,
|
|
75
75
|
});
|
|
@@ -78,7 +78,7 @@ let ArrayListWrapper = class ArrayListWrapper extends FASTElement {
|
|
|
78
78
|
const allItems = this.control.data[this.pathName];
|
|
79
79
|
const valueToRemove = [allItems[index]];
|
|
80
80
|
const items = allItems.filter((element) => !valueToRemove.includes(element));
|
|
81
|
-
const data = {
|
|
81
|
+
const data = Object.assign(Object.assign({}, this.control.data), { [this.pathName]: items });
|
|
82
82
|
this.$emit('data-change', {
|
|
83
83
|
data,
|
|
84
84
|
});
|
|
@@ -4,7 +4,7 @@ export const CategorizationWrapperRendererTemplate = (prefix = 'zero') => html `
|
|
|
4
4
|
<template>
|
|
5
5
|
<${prefix}-tabs class="tabs-container">
|
|
6
6
|
${repeat((x) => x.control.uischema.elements, html `
|
|
7
|
-
<${prefix}-tab class="tab-control">${(x, ctx) => x.label
|
|
7
|
+
<${prefix}-tab class="tab-control">${(x, ctx) => { var _a; return (_a = x.label) !== null && _a !== void 0 ? _a : `Category ${ctx.index + 1}`; }}</${prefix}-tab>
|
|
8
8
|
`, { positioning: true })}
|
|
9
9
|
${repeat((x) => x.control.uischema.elements, html `
|
|
10
10
|
<${prefix}-tab-panel class="tab-panel-control">
|
|
@@ -22,10 +22,10 @@ export const ConnectedMultiselectControlRendererTemplate = (prefix = 'zero') =>
|
|
|
22
22
|
data-test-id=${(x) => x.control.path}
|
|
23
23
|
>
|
|
24
24
|
<multiselect-datasource
|
|
25
|
-
resourceName=${(x) => x.control.uischema.options
|
|
26
|
-
value-field=${(x) => x.control.uischema.options
|
|
27
|
-
label-field=${(x) => x.control.uischema.options
|
|
28
|
-
:datasourceConfig=${(x) => x.control.uischema.options
|
|
25
|
+
resourceName=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.allOptionsResourceName; }}
|
|
26
|
+
value-field=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.valueField; }}
|
|
27
|
+
label-field=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.labelField; }}
|
|
28
|
+
:datasourceConfig=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.datasourceConfig; }}
|
|
29
29
|
></multiselect-datasource>
|
|
30
30
|
</${prefix}-multiselect>
|
|
31
31
|
</control-wrapper>
|
|
@@ -16,7 +16,8 @@ export const ConnectedSelectControlRendererTemplate = (prefix = 'zero') => html
|
|
|
16
16
|
placeholder=${(x) => x.control.uischema.placeholder || x.control.label}
|
|
17
17
|
?disabled=${(x) => !x.control.enabled}
|
|
18
18
|
@value-change=${(x, c) => {
|
|
19
|
-
|
|
19
|
+
var _a;
|
|
20
|
+
const value = (_a = c.event.detail) === null || _a === void 0 ? void 0 : _a.value;
|
|
20
21
|
x.control.handleChange(x.control.path, value);
|
|
21
22
|
x.onBlur();
|
|
22
23
|
}}
|
|
@@ -24,11 +25,11 @@ export const ConnectedSelectControlRendererTemplate = (prefix = 'zero') => html
|
|
|
24
25
|
data-test-id=${(x) => x.control.path}
|
|
25
26
|
>
|
|
26
27
|
<options-datasource
|
|
27
|
-
resourceName=${(x) => x.control.uischema.options
|
|
28
|
-
value-field=${(x) => x.control.uischema.options
|
|
29
|
-
label-field=${(x) => x.control.uischema.options
|
|
30
|
-
:datasourceConfig=${(x) => x.control.uischema.options
|
|
31
|
-
:data=${(x) => x.control.uischema.options
|
|
28
|
+
resourceName=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.allOptionsResourceName; }}
|
|
29
|
+
value-field=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.valueField; }}
|
|
30
|
+
label-field=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.labelField; }}
|
|
31
|
+
:datasourceConfig=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.datasourceConfig; }}
|
|
32
|
+
:data=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.data; }}
|
|
32
33
|
:initialSelectedValue=${(x) => x.control.data}
|
|
33
34
|
></options-datasource>
|
|
34
35
|
</${prefix}-combobox>
|
|
@@ -3,7 +3,7 @@ import { computeLabel, isDescriptionHidden } from '@jsonforms/core';
|
|
|
3
3
|
import { html, css, when, observable, customElement, FASTElement, volatile, } from '@microsoft/fast-element';
|
|
4
4
|
export const ControlWrapperRendererTemplate = html `
|
|
5
5
|
<template>
|
|
6
|
-
${when((x) => x.control
|
|
6
|
+
${when((x) => { var _a; return (_a = x.control) === null || _a === void 0 ? void 0 : _a.visible; }, html `
|
|
7
7
|
<div
|
|
8
8
|
class="wrapperRoot"
|
|
9
9
|
id=${(x) => x.control.path + '-wrapper'}
|
|
@@ -11,10 +11,7 @@ export const mapStateToEnumControlProps = (state, ownProps) => {
|
|
|
11
11
|
(props.schema.const && [
|
|
12
12
|
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)),
|
|
13
13
|
]);
|
|
14
|
-
return {
|
|
15
|
-
...props,
|
|
16
|
-
options,
|
|
17
|
-
};
|
|
14
|
+
return Object.assign(Object.assign({}, props), { options });
|
|
18
15
|
};
|
|
19
16
|
export const EnumControlRendererTemplate = (prefix = 'zero') => html `
|
|
20
17
|
<template>
|
|
@@ -26,10 +23,10 @@ export const EnumControlRendererTemplate = (prefix = 'zero') => html `
|
|
|
26
23
|
<${prefix}-combobox
|
|
27
24
|
style="width: 100%"
|
|
28
25
|
?disabled=${(x) => !x.control.enabled}
|
|
29
|
-
:value=${(x) => x.control.options.find((option) => option.value === x.control.data)
|
|
26
|
+
:value=${(x) => { var _a; return ((_a = x.control.options.find((option) => option.value === x.control.data)) === null || _a === void 0 ? void 0 : _a.label) || ''; }}
|
|
30
27
|
@change=${(x, c) => {
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
var _a;
|
|
29
|
+
x.control.handleChange(x.control.path, (_a = x.control.options.find((option) => option.label === c.event.target.value)) === null || _a === void 0 ? void 0 : _a.value);
|
|
33
30
|
x.onBlur();
|
|
34
31
|
}}
|
|
35
32
|
id=${(x) => x.control.path}
|
|
@@ -6,21 +6,25 @@ export const DateControlRendererTemplate = (prefix = 'zero') => html `
|
|
|
6
6
|
<template>
|
|
7
7
|
<control-wrapper :control=${(x) => x.control} ?submitted=${(x) => x.submitted}>
|
|
8
8
|
<${prefix}-text-field
|
|
9
|
-
:value=${(x) =>
|
|
10
|
-
|
|
11
|
-
:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
:value=${(x) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return ((_a = x.control.data) === null || _a === void 0 ? void 0 : _a.min) === undefined || ((_b = x.control.data) === null || _b === void 0 ? void 0 : _b.min) === null
|
|
12
|
+
? ''
|
|
13
|
+
: new Intl.DateTimeFormat('fr-CA', {
|
|
14
|
+
year: 'numeric',
|
|
15
|
+
month: '2-digit',
|
|
16
|
+
day: '2-digit',
|
|
17
|
+
}).format(x.control.data.min);
|
|
18
|
+
}}
|
|
16
19
|
id=${(x) => `min-${x.control.path}`}
|
|
17
20
|
type="date"
|
|
18
21
|
data-test-id=${(x) => `min-${x.control.path}`}
|
|
19
22
|
@blur=${(x, c) => {
|
|
23
|
+
var _a, _b;
|
|
20
24
|
const value = c.event.target.control.valueAsNumber;
|
|
21
25
|
x.control.handleChange(x.control.path, {
|
|
22
26
|
min: value ? value : undefined,
|
|
23
|
-
max: x.control.data
|
|
27
|
+
max: ((_a = x.control.data) === null || _a === void 0 ? void 0 : _a.max) < value ? undefined : (_b = x.control.data) === null || _b === void 0 ? void 0 : _b.max,
|
|
24
28
|
type: 'date',
|
|
25
29
|
});
|
|
26
30
|
x.onBlur();
|
|
@@ -28,20 +32,24 @@ export const DateControlRendererTemplate = (prefix = 'zero') => html `
|
|
|
28
32
|
style="width: 100%"
|
|
29
33
|
></${prefix}-text-field>
|
|
30
34
|
<${prefix}-text-field
|
|
31
|
-
:value=${(x) =>
|
|
32
|
-
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
:value=${(x) => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
return ((_a = x.control.data) === null || _a === void 0 ? void 0 : _a.max) === undefined || ((_b = x.control.data) === null || _b === void 0 ? void 0 : _b.max) === null
|
|
38
|
+
? ''
|
|
39
|
+
: new Intl.DateTimeFormat('fr-CA', {
|
|
40
|
+
year: 'numeric',
|
|
41
|
+
month: '2-digit',
|
|
42
|
+
day: '2-digit',
|
|
43
|
+
}).format(x.control.data.max);
|
|
44
|
+
}}
|
|
38
45
|
id=${(x) => `max-${x.control.path}`}
|
|
39
46
|
type="date"
|
|
40
47
|
data-test-id=${(x) => `max-${x.control.path}`}
|
|
41
48
|
@blur=${(x, c) => {
|
|
49
|
+
var _a, _b;
|
|
42
50
|
const value = c.event.target.control.valueAsNumber;
|
|
43
51
|
x.control.handleChange(x.control.path, {
|
|
44
|
-
min: x.control.data
|
|
52
|
+
min: ((_a = x.control.data) === null || _a === void 0 ? void 0 : _a.min) > value ? undefined : (_b = x.control.data) === null || _b === void 0 ? void 0 : _b.min,
|
|
45
53
|
max: value ? value : undefined,
|
|
46
54
|
type: 'date',
|
|
47
55
|
});
|
|
@@ -6,16 +6,17 @@ export const FilterNumberControlRendererTemplate = (prefix = 'zero') => html `
|
|
|
6
6
|
<template>
|
|
7
7
|
<control-wrapper :control=${(x) => x.control} ?submitted=${(x) => x.submitted}>
|
|
8
8
|
<${prefix}-text-field
|
|
9
|
-
:value=${(x) => (x.control.data
|
|
9
|
+
:value=${(x) => { var _a; return (((_a = x.control.data) === null || _a === void 0 ? void 0 : _a.min) === undefined ? '' : x.control.data.min); }}
|
|
10
10
|
@change=${(x, c) => {
|
|
11
|
+
var _a, _b;
|
|
11
12
|
const value = parseFloat(c.event.target.value);
|
|
12
13
|
return x.control.handleChange(x.control.path, !isNaN(value)
|
|
13
14
|
? {
|
|
14
15
|
min: value,
|
|
15
|
-
max: x.control.data
|
|
16
|
+
max: ((_a = x.control.data) === null || _a === void 0 ? void 0 : _a.max) < value ? undefined : (_b = x.control.data) === null || _b === void 0 ? void 0 : _b.max,
|
|
16
17
|
type: 'number',
|
|
17
18
|
}
|
|
18
|
-
: {
|
|
19
|
+
: Object.assign(Object.assign({}, x.control.data), { min: undefined }));
|
|
19
20
|
}}
|
|
20
21
|
placeholder="Min"
|
|
21
22
|
id=${(x) => `min-${x.control.path}`}
|
|
@@ -31,16 +32,17 @@ export const FilterNumberControlRendererTemplate = (prefix = 'zero') => html `
|
|
|
31
32
|
-
|
|
32
33
|
</span>
|
|
33
34
|
<${prefix}-text-field
|
|
34
|
-
:value=${(x) => (x.control.data
|
|
35
|
+
:value=${(x) => { var _a; return (((_a = x.control.data) === null || _a === void 0 ? void 0 : _a.max) === undefined ? '' : x.control.data.max); }}
|
|
35
36
|
@change=${(x, c) => {
|
|
37
|
+
var _a, _b;
|
|
36
38
|
const value = parseFloat(c.event.target.value);
|
|
37
39
|
return x.control.handleChange(x.control.path, !isNaN(value)
|
|
38
40
|
? {
|
|
39
|
-
min: x.control.data
|
|
41
|
+
min: ((_a = x.control.data) === null || _a === void 0 ? void 0 : _a.min) > value ? undefined : (_b = x.control.data) === null || _b === void 0 ? void 0 : _b.min,
|
|
40
42
|
max: value,
|
|
41
43
|
type: 'number',
|
|
42
44
|
}
|
|
43
|
-
: {
|
|
45
|
+
: Object.assign(Object.assign({}, x.control.data), { max: undefined }));
|
|
44
46
|
}}
|
|
45
47
|
placeholder="Max"
|
|
46
48
|
id=${(x) => `max-${x.control.path}`}
|
|
@@ -10,8 +10,8 @@ export const NumberControlRendererTemplate = (prefix = 'zero') => html `
|
|
|
10
10
|
?submitted=${(x) => x.submitted}
|
|
11
11
|
>
|
|
12
12
|
<${prefix}-number-field
|
|
13
|
-
withFormatting=${(x) => (x.control.uischema.options
|
|
14
|
-
:options=${(x) => x.control.uischema.options
|
|
13
|
+
withFormatting=${(x) => { var _a; return (((_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.withoutFormatting) ? false : true); }}
|
|
14
|
+
:options=${(x) => { var _a; return (_a = x.control.uischema.options) === null || _a === void 0 ? void 0 : _a.formatOptions; }}
|
|
15
15
|
:value=${(x) => (x.control.data === undefined ? '' : String(x.control.data))}
|
|
16
16
|
@change=${(x, c) => {
|
|
17
17
|
const value = parseFloat(c.event.target.value);
|
|
@@ -8,7 +8,7 @@ export const getStringControlRendererTemplate = (prefix = 'zero') => html `
|
|
|
8
8
|
?submitted=${(x) => x.submitted}
|
|
9
9
|
>
|
|
10
10
|
<${prefix}-text-field
|
|
11
|
-
type=${(x) => (x.control.uischema
|
|
11
|
+
type=${(x) => { var _a, _b; return (((_b = (_a = x.control.uischema) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.isPassword) ? 'password' : 'text'); }}
|
|
12
12
|
:value=${(x) => x.control.data || ''}
|
|
13
13
|
@change=${(x, c) => {
|
|
14
14
|
const inputValue = c.event.target.value;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
1
|
+
import { __decorate, __rest } from "tslib";
|
|
2
2
|
import { mapDispatchToControlProps, mapStateToJsonFormsRendererProps } from '@jsonforms/core';
|
|
3
3
|
import { FASTElement, html, css, observable, attr, customElement } from '@microsoft/fast-element';
|
|
4
4
|
import maxBy from 'lodash/maxBy';
|
|
@@ -7,14 +7,9 @@ const template = html `
|
|
|
7
7
|
`;
|
|
8
8
|
const styles = css ``;
|
|
9
9
|
const useControl = (props, jsonforms, dispatch, stateMapper) => {
|
|
10
|
-
const control = {
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
const dispatchMethods = mapDispatchToControlProps?.(dispatch);
|
|
14
|
-
return {
|
|
15
|
-
...control,
|
|
16
|
-
...dispatchMethods,
|
|
17
|
-
};
|
|
10
|
+
const control = Object.assign({}, stateMapper({ jsonforms }, props));
|
|
11
|
+
const dispatchMethods = mapDispatchToControlProps === null || mapDispatchToControlProps === void 0 ? void 0 : mapDispatchToControlProps(dispatch);
|
|
12
|
+
return Object.assign(Object.assign({}, control), dispatchMethods);
|
|
18
13
|
};
|
|
19
14
|
let DispatchRenderer = class DispatchRenderer extends FASTElement {
|
|
20
15
|
constructor() {
|
|
@@ -24,7 +19,7 @@ let DispatchRenderer = class DispatchRenderer extends FASTElement {
|
|
|
24
19
|
return;
|
|
25
20
|
}
|
|
26
21
|
const rawProps = mapStateToJsonFormsRendererProps({ jsonforms: this.jsonforms }, this.props);
|
|
27
|
-
const { rootSchema,
|
|
22
|
+
const { rootSchema } = rawProps, renderer = __rest(rawProps, ["rootSchema"]);
|
|
28
23
|
this.renderer = renderer;
|
|
29
24
|
this.control = useControl(this.props, this.jsonforms, this.dispatch,
|
|
30
25
|
// @ts-ignore
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export const isInvisible = (uischema, schema, context) => {
|
|
2
|
-
|
|
2
|
+
var _a, _b;
|
|
3
|
+
return (_b = (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.hidden) !== null && _b !== void 0 ? _b : false;
|
|
3
4
|
};
|
|
@@ -61,14 +61,14 @@ const dateNumberExpressions = (key, value, type) => {
|
|
|
61
61
|
const startExpression = value.min
|
|
62
62
|
? new ExpressionBuilder()
|
|
63
63
|
.withField(key)
|
|
64
|
-
.withValue(startDay
|
|
64
|
+
.withValue(startDay !== null && startDay !== void 0 ? startDay : value.min)
|
|
65
65
|
.withSerialiser(startDay ? Serialisers.dateIsGreaterEqual : Serialisers.GE)
|
|
66
66
|
.build()
|
|
67
67
|
: undefined;
|
|
68
68
|
const endExpression = value.max
|
|
69
69
|
? new ExpressionBuilder()
|
|
70
70
|
.withField(key)
|
|
71
|
-
.withValue(endDay
|
|
71
|
+
.withValue(endDay !== null && endDay !== void 0 ? endDay : value.max)
|
|
72
72
|
.withSerialiser(endDay ? Serialisers.dateIsLessEqual : Serialisers.LE)
|
|
73
73
|
.build()
|
|
74
74
|
: undefined;
|
|
@@ -10,8 +10,9 @@ const MAP = {
|
|
|
10
10
|
};
|
|
11
11
|
/** @public */
|
|
12
12
|
export const genesisErrorTranslator = (error, t, uischema) => {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
if ((error === null || error === void 0 ? void 0 : error.keyword) === 'pattern') {
|
|
15
|
+
return (_a = MAP[error.params.pattern]) !== null && _a !== void 0 ? _a : 'Invalid pattern.';
|
|
15
16
|
}
|
|
16
17
|
return defaultErrorTranslator(error, t, uischema);
|
|
17
18
|
};
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export const mustMatch = (target) => {
|
|
8
8
|
return (data, path, label) => {
|
|
9
|
-
if (!path
|
|
9
|
+
if (!(path === null || path === void 0 ? void 0 : path.length) || !(target === null || target === void 0 ? void 0 : target.length) || !data)
|
|
10
10
|
return [];
|
|
11
|
-
const value1 = data
|
|
12
|
-
const value2 = data
|
|
13
|
-
if (!value1
|
|
11
|
+
const value1 = data === null || data === void 0 ? void 0 : data[target];
|
|
12
|
+
const value2 = data === null || data === void 0 ? void 0 : data[path];
|
|
13
|
+
if (!(value1 === null || value1 === void 0 ? void 0 : value1.length) || !(value2 === null || value2 === void 0 ? void 0 : value2.length) || value1 === value2)
|
|
14
14
|
return [];
|
|
15
15
|
return [
|
|
16
16
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-forms",
|
|
3
3
|
"description": "Genesis Foundation Forms",
|
|
4
|
-
"version": "14.70.4-
|
|
4
|
+
"version": "14.70.4-test.1",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"test:debug": "genx test --debug"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@genesislcap/foundation-testing": "14.70.4-
|
|
44
|
-
"@genesislcap/genx": "14.70.4-
|
|
43
|
+
"@genesislcap/foundation-testing": "14.70.4-test.1",
|
|
44
|
+
"@genesislcap/genx": "14.70.4-test.1",
|
|
45
45
|
"@types/json-schema": "^7.0.11",
|
|
46
46
|
"@types/ua-parser-js": "^0.7.36",
|
|
47
47
|
"analytics": "^0.8.0",
|
|
48
48
|
"rimraf": "^3.0.2"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@genesislcap/foundation-comms": "14.70.4-
|
|
52
|
-
"@genesislcap/foundation-criteria": "14.70.4-
|
|
53
|
-
"@genesislcap/foundation-ui": "14.70.4-
|
|
54
|
-
"@genesislcap/foundation-utils": "14.70.4-
|
|
51
|
+
"@genesislcap/foundation-comms": "14.70.4-test.1",
|
|
52
|
+
"@genesislcap/foundation-criteria": "14.70.4-test.1",
|
|
53
|
+
"@genesislcap/foundation-ui": "14.70.4-test.1",
|
|
54
|
+
"@genesislcap/foundation-utils": "14.70.4-test.1",
|
|
55
55
|
"@jsonforms/core": "^3.0.0",
|
|
56
56
|
"@microsoft/fast-components": "^2.21.3",
|
|
57
57
|
"@microsoft/fast-element": "^1.7.0",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
74
|
"customElements": "dist/custom-elements.json",
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "2414c66a7a84c61343d756e240cb4140d82f1311"
|
|
76
76
|
}
|