@boltic/cli 1.0.6-beta.8 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,929 @@
1
+ const text = {
2
+ name: "name",
3
+ meta: {
4
+ displayName: "Name",
5
+ displayType: "text",
6
+ placeholder: "Enter your name",
7
+ description: "Name will be used for account purposes",
8
+ value: "John Doe",
9
+ readOnly: true,
10
+ isDisable: true,
11
+ htmlProps: {
12
+ showInfoIcon: false,
13
+ rightLabel: "",
14
+ rightLabelAlignment: "center",
15
+ },
16
+ validation: {
17
+ required: true,
18
+ min: 3,
19
+ max: 10,
20
+ pattern: "^[a-zA-Z]+$",
21
+ requiredDetail: {
22
+ errorMsg: "Value is required",
23
+ },
24
+ patternDetail: {
25
+ errorMsg: "Value must be a valid name",
26
+ },
27
+ minDetail: {
28
+ errorMsg: "Value must be greater than 3",
29
+ },
30
+ maxDetail: {
31
+ errorMsg: "Value must be less than 10",
32
+ },
33
+ infoDetail: { infoMsg: "this is for information purpose" },
34
+ },
35
+ dependencies: {
36
+ conditions: [
37
+ {
38
+ field: "name",
39
+ operator: "eq",
40
+ value: "John Doe",
41
+ },
42
+ ],
43
+ },
44
+ },
45
+ };
46
+
47
+ const number = {
48
+ name: "name",
49
+ meta: {
50
+ displayName: "Name",
51
+ displayType: "number",
52
+ placeholder: "Enter a number",
53
+ description: "Number input field",
54
+ value: 0,
55
+ readOnly: false,
56
+ isDisabled: false,
57
+ htmlProps: {
58
+ showInfoIcon: false,
59
+ rightLabel: "",
60
+ rightLabelAlignment: "center",
61
+ },
62
+ validation: {
63
+ required: false,
64
+ min: 0,
65
+ max: 1000,
66
+ requiredDetail: {
67
+ errorMsg: "Value is required",
68
+ },
69
+ minDetail: {
70
+ errorMsg: "Value must be greater than minimum",
71
+ },
72
+ maxDetail: {
73
+ errorMsg: "Value must be less than maximum",
74
+ },
75
+ infoDetail: { infoMsg: "this is for information purpose" },
76
+ },
77
+ dependencies: {
78
+ logic: "AND",
79
+ conditions: [
80
+ {
81
+ field: "fieldName",
82
+ operator: "EQUALS",
83
+ value: "expectedValue",
84
+ },
85
+ ],
86
+ },
87
+ },
88
+ };
89
+
90
+ const select = {
91
+ name: "name",
92
+ meta: {
93
+ displayName: "Display Name",
94
+ displayType: "select",
95
+ placeholder: "Select an option",
96
+ description: "Select from available options",
97
+ value: "",
98
+ readOnly: false,
99
+ isDisabled: false,
100
+ options: [
101
+ {
102
+ value: "value1",
103
+ label: "Label 1",
104
+ description: "Description 1",
105
+ },
106
+ ],
107
+ config: {
108
+ urlType: "options",
109
+ method: "get",
110
+ url: "/api/options",
111
+ labelKey: "label",
112
+ valueKey: "value",
113
+ body: {},
114
+ },
115
+ displayProps: { loading: false },
116
+ validation: {
117
+ required: false,
118
+ requiredDetail: {
119
+ errorMsg: "Selection is required",
120
+ },
121
+ },
122
+ dependencies: {
123
+ logic: "AND",
124
+ conditions: [
125
+ {
126
+ field: "fieldName",
127
+ operator: "EQUALS",
128
+ value: "expectedValue",
129
+ },
130
+ ],
131
+ },
132
+ },
133
+ };
134
+
135
+ const checkbox = {
136
+ name: "name",
137
+ meta: {
138
+ displayName: "Name",
139
+ displayType: "checkbox",
140
+ description: "Checkbox input",
141
+ value: false,
142
+ readOnly: false,
143
+ isDisabled: false,
144
+ validation: {
145
+ required: false,
146
+ requiredDetail: {
147
+ errorMsg: "Checkbox is required",
148
+ },
149
+ },
150
+ dependencies: {
151
+ logic: "AND",
152
+ conditions: [
153
+ {
154
+ field: "fieldName",
155
+ operator: "EQUALS",
156
+ value: "expectedValue",
157
+ },
158
+ ],
159
+ },
160
+ },
161
+ };
162
+
163
+ const autocomplete = {
164
+ name: "name",
165
+ meta: {
166
+ displayName: "Name",
167
+ displayType: "autocomplete",
168
+ placeholder: "Start typing...",
169
+ description: "Autocomplete input field",
170
+ value: "",
171
+ readOnly: false,
172
+ isDisabled: false,
173
+ options: [
174
+ {
175
+ label: "Option 1",
176
+ value: "option1",
177
+ description: "Description 1",
178
+ },
179
+ ],
180
+ config: {
181
+ urlType: "secret",
182
+ method: "get",
183
+ url: "/api/autocomplete",
184
+ labelKey: "label",
185
+ valueKey: "value",
186
+ body: {},
187
+ multiple: false,
188
+ limitTags: 3,
189
+ },
190
+ htmlProps: {
191
+ allowDynamic: false,
192
+ showAddNew: false,
193
+ },
194
+ validation: {
195
+ required: false,
196
+ requiredDetail: {
197
+ errorMsg: "Selection is required",
198
+ },
199
+ },
200
+ dependencies: {
201
+ logic: "AND",
202
+ conditions: [
203
+ {
204
+ field: "fieldName",
205
+ operator: "EQUALS",
206
+ value: "expectedValue",
207
+ },
208
+ ],
209
+ },
210
+ },
211
+ };
212
+
213
+ const email = {
214
+ name: "name",
215
+ meta: {
216
+ displayName: "Name",
217
+ displayType: "email",
218
+ placeholder: "Enter email address",
219
+ description: "Email input field",
220
+ value: "",
221
+ readOnly: false,
222
+ isDisabled: false,
223
+ validation: {
224
+ required: false,
225
+ pattern: "^[^@]+@[^@]+\\.[^@]+$",
226
+ requiredDetail: {
227
+ errorMsg: "Value is required",
228
+ },
229
+ patternDetail: {
230
+ errorMsg: "Must be a valid email address",
231
+ },
232
+ },
233
+ dependencies: {
234
+ logic: "AND",
235
+ conditions: [
236
+ {
237
+ field: "fieldName",
238
+ operator: "EQUALS",
239
+ value: "expectedValue",
240
+ },
241
+ ],
242
+ },
243
+ },
244
+ };
245
+
246
+ const password = {
247
+ name: "name",
248
+ meta: {
249
+ displayName: "Name",
250
+ displayType: "password",
251
+ placeholder: "Enter password",
252
+ description: "Password input field",
253
+ value: "",
254
+ readOnly: false,
255
+ isDisabled: false,
256
+ validation: {
257
+ required: false,
258
+ min: 8,
259
+ requiredDetail: {
260
+ errorMsg: "Value is required",
261
+ },
262
+ minDetail: {
263
+ errorMsg: "Password must be at least 8 characters",
264
+ },
265
+ },
266
+ dependencies: {
267
+ logic: "AND",
268
+ conditions: [
269
+ {
270
+ field: "fieldName",
271
+ operator: "EQUALS",
272
+ value: "expectedValue",
273
+ },
274
+ ],
275
+ },
276
+ },
277
+ };
278
+
279
+ const accordion = {
280
+ name: "name",
281
+ meta: {
282
+ displayName: "Name",
283
+ displayType: "accordion",
284
+ description: "Collapsible content section",
285
+ expanded: false,
286
+ children: [],
287
+ htmlProps: {
288
+ divider: true,
289
+ headerVariant: "h3",
290
+ subHeaderVariant: "h5",
291
+ },
292
+ dependencies: {
293
+ logic: "OR",
294
+ conditions: [],
295
+ },
296
+ },
297
+ };
298
+
299
+ const section = {
300
+ name: "name",
301
+ meta: {
302
+ displayName: "Name",
303
+ displayType: "section",
304
+ description: "Section container",
305
+ children: [],
306
+ htmlProps: {
307
+ divider: true,
308
+ headerVariant: "h3",
309
+ subHeaderVariant: "h5",
310
+ description: "",
311
+ },
312
+ dependencies: {
313
+ logic: "OR",
314
+ conditions: [
315
+ {
316
+ field: "fieldName",
317
+ operator: "EQUALS",
318
+ value: "expectedValue",
319
+ },
320
+ ],
321
+ },
322
+ },
323
+ };
324
+
325
+ const textarea = {
326
+ name: "name",
327
+ meta: {
328
+ displayName: "Name",
329
+ displayType: "textarea",
330
+ placeholder: "Enter text...",
331
+ description: "Multi-line text input",
332
+ value: "",
333
+ readOnly: false,
334
+ isDisabled: false,
335
+ htmlProps: {
336
+ minRows: 3,
337
+ maxRows: 10,
338
+ },
339
+ validation: {
340
+ required: false,
341
+ minLength: 0,
342
+ maxLength: 500,
343
+ pattern: "",
344
+ requiredDetail: {
345
+ errorMsg: "Text is required",
346
+ },
347
+ minDetail: {
348
+ errorMsg: "Text too short",
349
+ },
350
+ maxDetail: {
351
+ errorMsg: "Text too long",
352
+ },
353
+ },
354
+ },
355
+ };
356
+
357
+ const toggle = {
358
+ name: "name",
359
+ meta: {
360
+ displayName: "Name",
361
+ displayType: "toggle",
362
+ description: "Toggle switch",
363
+ value: false,
364
+ readOnly: false,
365
+ isDisabled: false,
366
+ validation: {
367
+ required: false,
368
+ disabled: false,
369
+ requiredDetail: {
370
+ errorMsg: "Toggle selection is required",
371
+ },
372
+ },
373
+ dependencies: {
374
+ logic: "AND",
375
+ conditions: [
376
+ {
377
+ field: "fieldName",
378
+ operator: "EQUALS",
379
+ value: "expectedValue",
380
+ },
381
+ ],
382
+ },
383
+ },
384
+ };
385
+
386
+ const file = {
387
+ name: "name",
388
+ meta: {
389
+ displayName: "Name",
390
+ displayType: "file",
391
+ placeholder: "Choose file...",
392
+ description: "File upload field",
393
+ value: "",
394
+ readOnly: false,
395
+ isDisabled: false,
396
+ htmlProps: {
397
+ multiple: false,
398
+ accept: "*/*",
399
+ maxSize: 52428800,
400
+ maxFiles: 1,
401
+ preview: true,
402
+ },
403
+ validation: {
404
+ required: false,
405
+ requiredDetail: {
406
+ errorMsg: "File is required",
407
+ },
408
+ },
409
+ dependencies: {
410
+ logic: "AND",
411
+ conditions: [
412
+ {
413
+ field: "fieldName",
414
+ operator: "EQUALS",
415
+ value: "expectedValue",
416
+ },
417
+ ],
418
+ },
419
+ },
420
+ };
421
+
422
+ const array = {
423
+ name: "name",
424
+ meta: {
425
+ displayName: "Name",
426
+ displayType: "array",
427
+ description: "Array of items",
428
+ value: [],
429
+ readOnly: false,
430
+ isDisabled: false,
431
+ children: [
432
+ {
433
+ name: "item",
434
+ meta: {
435
+ displayType: "text",
436
+ displayName: "Item",
437
+ validation: {
438
+ required: true,
439
+ },
440
+ },
441
+ },
442
+ ],
443
+ htmlProps: {
444
+ allowAdd: true,
445
+ allowDynamic: false,
446
+ },
447
+ validation: {
448
+ required: false,
449
+ max: 10,
450
+ requiredDetail: {
451
+ errorMsg: "Array is required",
452
+ },
453
+ maxDetail: {
454
+ errorMsg: "Too many items",
455
+ },
456
+ },
457
+ },
458
+ };
459
+
460
+ const object = {
461
+ name: "name",
462
+ meta: {
463
+ displayName: "Name",
464
+ displayType: "object",
465
+ description: "Object with properties",
466
+ value: {},
467
+ readOnly: false,
468
+ isDisabled: false,
469
+ children: [
470
+ {
471
+ name: "property",
472
+ meta: {
473
+ displayType: "text",
474
+ displayName: "Property",
475
+ validation: {
476
+ required: true,
477
+ },
478
+ },
479
+ },
480
+ ],
481
+ htmlProps: {
482
+ allowDynamic: false,
483
+ },
484
+ validation: {
485
+ required: false,
486
+ requiredDetail: {
487
+ errorMsg: "Object is required",
488
+ },
489
+ },
490
+ },
491
+ };
492
+
493
+ const code = {
494
+ name: "name",
495
+ meta: {
496
+ displayName: "Name",
497
+ displayType: "code",
498
+ placeholder: "Enter code...",
499
+ description: "Code editor field",
500
+ value: "",
501
+ readOnly: false,
502
+ htmlProps: {
503
+ language: "javascript",
504
+ size: "md",
505
+ fullscreen: false,
506
+ showSuggestions: true,
507
+ showCopyToClipboard: true,
508
+ showHtmlPreview: false,
509
+ height: "200px",
510
+ },
511
+ validation: {
512
+ required: false,
513
+ requiredDetail: {
514
+ errorMsg: "Code is required",
515
+ },
516
+ },
517
+ },
518
+ };
519
+
520
+ const slider = {
521
+ name: "name",
522
+ meta: {
523
+ displayName: "Name",
524
+ displayType: "slider",
525
+ description: "Slider input",
526
+ value: 0,
527
+ isDisabled: false,
528
+ min: 0,
529
+ max: 100,
530
+ step: 1,
531
+ htmlProps: {
532
+ showInfoIcon: false,
533
+ showRange: false,
534
+ allowDynamic: false,
535
+ },
536
+ validation: {
537
+ required: false,
538
+ requiredDetail: {
539
+ errorMsg: "Value is required",
540
+ },
541
+ },
542
+ },
543
+ };
544
+
545
+ const url = {
546
+ name: "name",
547
+ meta: {
548
+ displayName: "Name",
549
+ displayType: "url",
550
+ placeholder: "Enter URL",
551
+ description: "URL input field",
552
+ value: "",
553
+ readOnly: false,
554
+ isDisabled: false,
555
+ validation: {
556
+ required: false,
557
+ pattern: "^https?://.*",
558
+ requiredDetail: {
559
+ errorMsg: "URL is required",
560
+ },
561
+ patternDetail: {
562
+ errorMsg: "Must be a valid URL",
563
+ },
564
+ },
565
+ dependencies: {
566
+ logic: "AND",
567
+ conditions: [
568
+ {
569
+ field: "fieldName",
570
+ operator: "EQUALS",
571
+ value: "expectedValue",
572
+ },
573
+ ],
574
+ },
575
+ },
576
+ };
577
+
578
+ const hidden = {
579
+ name: "name",
580
+ meta: {
581
+ displayName: "Name",
582
+ displayType: "hidden",
583
+ value: "",
584
+ options: [],
585
+ },
586
+ };
587
+
588
+ const date = {
589
+ name: "name",
590
+ meta: {
591
+ displayName: "Name",
592
+ displayType: "date",
593
+ placeholder: "Select date",
594
+ description: "Date picker field",
595
+ value: "",
596
+ readOnly: false,
597
+ isDisabled: false,
598
+ htmlProps: {
599
+ format: "YYYY-MM-DD",
600
+ disabled: false,
601
+ readOnly: false,
602
+ views: undefined,
603
+ timeSteps: { hours: 1, minutes: 5, seconds: 5 },
604
+ },
605
+ validation: {
606
+ required: false,
607
+ requiredDetail: {
608
+ errorMsg: "Date is required",
609
+ },
610
+ },
611
+ dependencies: {
612
+ logic: "AND",
613
+ conditions: [
614
+ {
615
+ field: "fieldName",
616
+ operator: "EQUALS",
617
+ value: "expectedValue",
618
+ },
619
+ ],
620
+ },
621
+ },
622
+ };
623
+
624
+ const divider = {
625
+ name: "name",
626
+ meta: {
627
+ displayName: "Name",
628
+ displayType: "divider",
629
+ description: "Visual separator",
630
+ htmlProps: {
631
+ variant: "middle",
632
+ orientation: "horizontal",
633
+ },
634
+ },
635
+ };
636
+
637
+ const multiselect = {
638
+ name: "name",
639
+ meta: {
640
+ displayName: "Name",
641
+ displayType: "multiselect",
642
+ placeholder: "Select multiple options",
643
+ description: "Multi-select dropdown",
644
+ value: [],
645
+ readOnly: false,
646
+ options: [
647
+ {
648
+ label: "Option 1",
649
+ value: "option1",
650
+ description: "Description 1",
651
+ },
652
+ ],
653
+ config: {
654
+ urlType: "options",
655
+ method: "get",
656
+ url: "/api/options",
657
+ labelKey: "label",
658
+ valueKey: "value",
659
+ body: {},
660
+ },
661
+ validation: {
662
+ required: false,
663
+ requiredDetail: {
664
+ errorMsg: "Selection is required",
665
+ },
666
+ },
667
+ dependencies: {
668
+ logic: "AND",
669
+ conditions: [
670
+ {
671
+ field: "fieldName",
672
+ operator: "EQUALS",
673
+ value: "expectedValue",
674
+ },
675
+ ],
676
+ },
677
+ },
678
+ };
679
+
680
+ const radio = {
681
+ name: "name",
682
+ meta: {
683
+ displayName: "Name",
684
+ displayType: "radio",
685
+ description: "Radio button group",
686
+ value: "",
687
+ readOnly: false,
688
+ options: [
689
+ {
690
+ label: "Option 1",
691
+ value: "option1",
692
+ description: "Description 1",
693
+ },
694
+ ],
695
+ htmlProps: {
696
+ orientation: "vertical",
697
+ },
698
+ validation: {
699
+ required: false,
700
+ requiredDetail: {
701
+ errorMsg: "Selection is required",
702
+ },
703
+ },
704
+ dependencies: {
705
+ logic: "AND",
706
+ conditions: [
707
+ {
708
+ field: "fieldName",
709
+ operator: "EQUALS",
710
+ value: "expectedValue",
711
+ },
712
+ ],
713
+ },
714
+ },
715
+ };
716
+
717
+ const switchControl = {
718
+ name: "name",
719
+ meta: {
720
+ displayName: "Name",
721
+ displayType: "switch",
722
+ description: "Switch toggle",
723
+ value: false,
724
+ readOnly: false,
725
+ htmlProps: {
726
+ size: "medium",
727
+ color: "primary",
728
+ },
729
+ validation: {
730
+ required: false,
731
+ requiredDetail: {
732
+ errorMsg: "Switch selection is required",
733
+ },
734
+ },
735
+ dependencies: {
736
+ logic: "AND",
737
+ conditions: [
738
+ {
739
+ field: "fieldName",
740
+ operator: "EQUALS",
741
+ value: "expectedValue",
742
+ },
743
+ ],
744
+ },
745
+ },
746
+ };
747
+
748
+ const multitext = {
749
+ name: "name",
750
+ meta: {
751
+ displayName: "Name",
752
+ displayType: "multitext",
753
+ description: "Multiple field container",
754
+ value: [],
755
+ readOnly: false,
756
+ isDisabled: false,
757
+ children: [
758
+ {
759
+ name: "field1",
760
+ meta: {
761
+ displayType: "text",
762
+ displayName: "Field 1",
763
+ validation: {
764
+ required: true,
765
+ },
766
+ },
767
+ },
768
+ ],
769
+ htmlProps: {
770
+ allowAdd: true,
771
+ allowRemove: true,
772
+ minItems: 1,
773
+ maxItems: 10,
774
+ allowDynamic: true,
775
+ className: "custom class",
776
+ },
777
+ validation: {
778
+ required: false,
779
+ min: 1,
780
+ max: 10,
781
+ requiredDetail: {
782
+ errorMsg: "At least one item is required",
783
+ },
784
+ minDetail: {
785
+ errorMsg: "Minimum items required",
786
+ },
787
+ maxDetail: {
788
+ errorMsg: "Too many items",
789
+ },
790
+ },
791
+ dependencies: {
792
+ logic: "AND",
793
+ conditions: [
794
+ {
795
+ field: "fieldName",
796
+ operator: "EQUALS",
797
+ value: "expectedValue",
798
+ },
799
+ ],
800
+ },
801
+ },
802
+ };
803
+
804
+ const phone = {
805
+ name: "name",
806
+ meta: {
807
+ displayName: "Name",
808
+ displayType: "phone",
809
+ placeholder: "Enter phone number",
810
+ description: "Phone number input",
811
+ value: "",
812
+ readOnly: false,
813
+ isDisabled: false,
814
+ htmlProps: {
815
+ defaultCountry: "US",
816
+ excludedCountries: [],
817
+ onlyCountries: [],
818
+ preferredCountries: ["US", "GB", "CA"],
819
+ continents: ["NA", "EU"],
820
+ },
821
+ validation: {
822
+ required: false,
823
+ matchIsValidTel: true,
824
+ pattern: "^\\+?[1-9]\\d{1,14}$",
825
+ requiredDetail: {
826
+ errorMsg: "Phone number is required",
827
+ },
828
+ patternDetail: {
829
+ errorMsg: "Must be a valid phone number",
830
+ },
831
+ },
832
+ },
833
+ };
834
+
835
+ const keyvalue = {
836
+ name: "name",
837
+ meta: {
838
+ displayName: "Name",
839
+ displayType: "keyvalue",
840
+ description: "Key-value pairs",
841
+ value: {},
842
+ readOnly: false,
843
+ isDisabled: false,
844
+ children: [
845
+ {
846
+ name: "key",
847
+ meta: {
848
+ displayType: "text",
849
+ displayName: "Key",
850
+ validation: {
851
+ required: true,
852
+ },
853
+ },
854
+ },
855
+ {
856
+ name: "value",
857
+ meta: {
858
+ displayType: "text",
859
+ displayName: "Value",
860
+ validation: {
861
+ required: true,
862
+ },
863
+ },
864
+ },
865
+ ],
866
+ htmlProps: {
867
+ allowDynamic: false,
868
+ allowAdd: true,
869
+ },
870
+ validation: {
871
+ required: false,
872
+ max: 10,
873
+ requiredDetail: {
874
+ errorMsg: "Key-value pairs are required",
875
+ },
876
+ maxDetail: {
877
+ errorMsg: "Too many key-value pairs",
878
+ },
879
+ },
880
+ },
881
+ };
882
+
883
+ const button = {
884
+ name: "name",
885
+ meta: {
886
+ displayName: "Name",
887
+ displayType: "button",
888
+ description: "Action button",
889
+ text: "Click me",
890
+ value: "",
891
+ isDisabled: false,
892
+ readOnly: false,
893
+ htmlProps: {
894
+ variant: "contained",
895
+ size: "medium",
896
+ // ...any other prop will be added to button component
897
+ },
898
+ },
899
+ };
900
+
901
+ export {
902
+ accordion,
903
+ array,
904
+ autocomplete,
905
+ button,
906
+ checkbox,
907
+ code,
908
+ date,
909
+ divider,
910
+ email,
911
+ file,
912
+ hidden,
913
+ keyvalue,
914
+ multiselect,
915
+ multitext,
916
+ number,
917
+ object,
918
+ password,
919
+ phone,
920
+ radio,
921
+ section,
922
+ select,
923
+ slider,
924
+ switchControl as switch,
925
+ text,
926
+ textarea,
927
+ toggle,
928
+ url,
929
+ };