@genesislcap/foundation-forms 14.108.0 → 14.109.1-alpha-cf055218219.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/README.md +175 -0
- package/dist/custom-elements.json +176 -2
- package/dist/dts/form.d.ts +7 -2
- package/dist/dts/form.d.ts.map +1 -1
- package/dist/dts/form.template.d.ts.map +1 -1
- package/dist/dts/jsonforms/renderers/LayoutStepperRenderer.d.ts +3 -0
- package/dist/dts/jsonforms/renderers/LayoutStepperRenderer.d.ts.map +1 -0
- package/dist/dts/jsonforms/renderers/RenderersRanks.d.ts +1 -0
- package/dist/dts/jsonforms/renderers/RenderersRanks.d.ts.map +1 -1
- package/dist/dts/jsonforms/renderers/StepperWrapperRenderer.d.ts +15 -0
- package/dist/dts/jsonforms/renderers/StepperWrapperRenderer.d.ts.map +1 -0
- package/dist/esm/form.js +27 -8
- package/dist/esm/form.template.js +6 -1
- package/dist/esm/jsonforms/renderers/LayoutStepperRenderer.js +13 -0
- package/dist/esm/jsonforms/renderers/RenderersRanks.js +1 -0
- package/dist/esm/jsonforms/renderers/StepperWrapperRenderer.js +96 -0
- package/dist/foundation-forms.api.json +71 -25
- package/dist/foundation-forms.d.ts +7 -2
- package/docs/api/{foundation-forms.form.connectedcallback.md → foundation-forms.form.hidesubmit.md} +3 -7
- package/docs/api/foundation-forms.form.issubmithidden.md +14 -0
- package/docs/api/foundation-forms.form.md +3 -2
- package/docs/api/foundation-forms.form.reset.md +8 -1
- package/docs/api-report.md +7 -3
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -525,6 +525,181 @@ const groupUISchema = {
|
|
|
525
525
|
};
|
|
526
526
|
```
|
|
527
527
|
|
|
528
|
+
#### 7. Stepper Layout
|
|
529
|
+
|
|
530
|
+
Stepper layout allows you to create more complex forms that can be divided into appropriate steps (for example, personal information and address), which will be in separate steps.
|
|
531
|
+
|
|
532
|
+
It is more complicated when it comes to customisation because it needs proper `jsonSchema` and `uiSchema` so that validation and data saving work properly.
|
|
533
|
+
|
|
534
|
+
:::info
|
|
535
|
+
Remember to add `hide-submit-button` attribute to `foundation-forms` because in this case submit is built directly into stepper-layout
|
|
536
|
+
:::
|
|
537
|
+
|
|
538
|
+
```ts
|
|
539
|
+
const uiSchemaStepper = {
|
|
540
|
+
type: 'Stepper',
|
|
541
|
+
elements: [
|
|
542
|
+
{
|
|
543
|
+
type: 'Step',
|
|
544
|
+
scope: '#/properties/person',
|
|
545
|
+
label: 'Entity',
|
|
546
|
+
options: {
|
|
547
|
+
childElements: [
|
|
548
|
+
{
|
|
549
|
+
type: 'HorizontalLayout',
|
|
550
|
+
elements: [
|
|
551
|
+
{
|
|
552
|
+
type: 'Control',
|
|
553
|
+
scope: '#/properties/person/properties/firstName',
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
type: 'Control',
|
|
557
|
+
scope: '#/properties/person/properties/secondName',
|
|
558
|
+
},
|
|
559
|
+
],
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
type: 'HorizontalLayout',
|
|
563
|
+
elements: [
|
|
564
|
+
{
|
|
565
|
+
type: 'Control',
|
|
566
|
+
scope: '#/properties/person/properties/birthDate',
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
type: 'Control',
|
|
570
|
+
scope: '#/properties/person/properties/nationality',
|
|
571
|
+
},
|
|
572
|
+
],
|
|
573
|
+
},
|
|
574
|
+
],
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
type: 'Step',
|
|
579
|
+
label: 'Doc',
|
|
580
|
+
scope: '#/properties/address',
|
|
581
|
+
options: {
|
|
582
|
+
childElements: [
|
|
583
|
+
{
|
|
584
|
+
type: 'HorizontalLayout',
|
|
585
|
+
elements: [
|
|
586
|
+
{
|
|
587
|
+
type: 'Control',
|
|
588
|
+
scope: '#/properties/address/properties/street',
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
type: 'Control',
|
|
592
|
+
scope: '#/properties/address/properties/streetNumber',
|
|
593
|
+
},
|
|
594
|
+
],
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
type: 'HorizontalLayout',
|
|
598
|
+
elements: [
|
|
599
|
+
{
|
|
600
|
+
type: 'Control',
|
|
601
|
+
scope: '#/properties/address/properties/city',
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
type: 'Control',
|
|
605
|
+
scope: '#/properties/address/properties/postalCode',
|
|
606
|
+
},
|
|
607
|
+
],
|
|
608
|
+
},
|
|
609
|
+
],
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
type: 'Step',
|
|
614
|
+
label: 'Primary doc',
|
|
615
|
+
scope: '#/properties/vegetarianOptions',
|
|
616
|
+
options: {
|
|
617
|
+
childElements: [
|
|
618
|
+
{
|
|
619
|
+
type: 'VerticalLayout',
|
|
620
|
+
elements: [
|
|
621
|
+
{
|
|
622
|
+
type: 'Control',
|
|
623
|
+
scope: '#/properties/vegetarianOptions/properties/favoriteVegetable',
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
type: 'Control',
|
|
627
|
+
scope: '#/properties/vegetarianOptions/properties/otherFavoriteVegetable',
|
|
628
|
+
},
|
|
629
|
+
],
|
|
630
|
+
},
|
|
631
|
+
],
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
],
|
|
635
|
+
};
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
```ts
|
|
639
|
+
const jsonSchemaStepper = {
|
|
640
|
+
type: 'object',
|
|
641
|
+
properties: {
|
|
642
|
+
person: {
|
|
643
|
+
type: 'object',
|
|
644
|
+
properties: {
|
|
645
|
+
firstName: {
|
|
646
|
+
type: 'string',
|
|
647
|
+
minLength: 3,
|
|
648
|
+
description: 'Please enter your first name',
|
|
649
|
+
},
|
|
650
|
+
secondName: {
|
|
651
|
+
type: 'string',
|
|
652
|
+
minLength: 3,
|
|
653
|
+
description: 'Please enter your second name',
|
|
654
|
+
},
|
|
655
|
+
birthDate: {
|
|
656
|
+
type: 'string',
|
|
657
|
+
format: 'date',
|
|
658
|
+
description: 'Please enter your birth date.',
|
|
659
|
+
},
|
|
660
|
+
nationality: {
|
|
661
|
+
type: 'string',
|
|
662
|
+
description: 'Please enter your nationality.',
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
required: ['firstName', 'secondName'],
|
|
666
|
+
},
|
|
667
|
+
address: {
|
|
668
|
+
type: 'object',
|
|
669
|
+
properties: {
|
|
670
|
+
street: {
|
|
671
|
+
type: 'string',
|
|
672
|
+
},
|
|
673
|
+
streetNumber: {
|
|
674
|
+
type: 'string',
|
|
675
|
+
},
|
|
676
|
+
city: {
|
|
677
|
+
type: 'string',
|
|
678
|
+
},
|
|
679
|
+
postalCode: {
|
|
680
|
+
type: 'string',
|
|
681
|
+
maxLength: 5,
|
|
682
|
+
},
|
|
683
|
+
},
|
|
684
|
+
required: ['postalCode'],
|
|
685
|
+
},
|
|
686
|
+
vegetarianOptions: {
|
|
687
|
+
type: 'object',
|
|
688
|
+
properties: {
|
|
689
|
+
favoriteVegetable: {
|
|
690
|
+
type: 'string',
|
|
691
|
+
enum: ['Tomato', 'Potato', 'Salad', 'Aubergine', 'Cucumber', 'Other'],
|
|
692
|
+
},
|
|
693
|
+
otherFavoriteVegetable: {
|
|
694
|
+
type: 'string',
|
|
695
|
+
},
|
|
696
|
+
},
|
|
697
|
+
required: ['otherFavoriteVegetable'],
|
|
698
|
+
},
|
|
699
|
+
},
|
|
700
|
+
};
|
|
701
|
+
```
|
|
702
|
+
|
|
528
703
|
### Default control renderers and examples
|
|
529
704
|
|
|
530
705
|
Most renderers are defined directly in the `jsonSchema` that comes from the server, but there are also those that you can add via `uiSchema`.
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"type": {
|
|
25
25
|
"text": "array"
|
|
26
26
|
},
|
|
27
|
-
"default": "[\n fallbackEntry,\n stringEntry,\n BooleanControlEntry,\n LayoutArrayRendererEntry,\n LayoutCategorizationRendererEntry,\n LayoutGroupRendererEntry,\n LayoutHorizontalEntry,\n LayoutVertical2ColumnsEntry,\n LayoutRendererEntry,\n NumberControlRendererEntry,\n ConnectedMultiselectControlRendererEntry,\n EnumControlRendererEntry,\n ConnectedSelectControlRendererEntry,\n DateControlRendererEntry,\n InvisibleControlEntry,\n]",
|
|
27
|
+
"default": "[\n fallbackEntry,\n stringEntry,\n BooleanControlEntry,\n LayoutArrayRendererEntry,\n LayoutCategorizationRendererEntry,\n LayoutGroupRendererEntry,\n LayoutHorizontalEntry,\n LayoutVertical2ColumnsEntry,\n LayoutRendererEntry,\n LayoutStepperRendererEntry,\n NumberControlRendererEntry,\n ConnectedMultiselectControlRendererEntry,\n EnumControlRendererEntry,\n ConnectedSelectControlRendererEntry,\n DateControlRendererEntry,\n InvisibleControlEntry,\n]",
|
|
28
28
|
"privacy": "public"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"type": {
|
|
67
67
|
"text": "RendererEntry[]"
|
|
68
68
|
},
|
|
69
|
-
"default": "[\n fallbackEntry,\n stringEntry,\n BooleanControlEntry,\n LayoutArrayRendererEntry,\n LayoutCategorizationRendererEntry,\n LayoutGroupRendererEntry,\n LayoutHorizontalEntry,\n LayoutVertical2ColumnsEntry,\n LayoutRendererEntry,\n NumberControlRendererEntry,\n ConnectedMultiselectControlRendererEntry,\n EnumControlRendererEntry,\n ConnectedSelectControlRendererEntry,\n DateControlRendererEntry,\n InvisibleControlEntry,\n]",
|
|
69
|
+
"default": "[\n fallbackEntry,\n stringEntry,\n BooleanControlEntry,\n LayoutArrayRendererEntry,\n LayoutCategorizationRendererEntry,\n LayoutGroupRendererEntry,\n LayoutHorizontalEntry,\n LayoutVertical2ColumnsEntry,\n LayoutRendererEntry,\n LayoutStepperRendererEntry,\n NumberControlRendererEntry,\n ConnectedMultiselectControlRendererEntry,\n EnumControlRendererEntry,\n ConnectedSelectControlRendererEntry,\n DateControlRendererEntry,\n InvisibleControlEntry,\n]",
|
|
70
70
|
"description": "Allows to provide set of renderers used by the form. If not provided it will default to text-field inputs",
|
|
71
71
|
"privacy": "public"
|
|
72
72
|
},
|
|
@@ -113,9 +113,27 @@
|
|
|
113
113
|
"text": "boolean"
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
+
{
|
|
117
|
+
"kind": "field",
|
|
118
|
+
"name": "hideSubmit",
|
|
119
|
+
"type": {
|
|
120
|
+
"text": "boolean"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"kind": "field",
|
|
125
|
+
"name": "isSubmitHidden",
|
|
126
|
+
"readonly": true
|
|
127
|
+
},
|
|
116
128
|
{
|
|
117
129
|
"kind": "method",
|
|
118
130
|
"name": "reset",
|
|
131
|
+
"parameters": [
|
|
132
|
+
{
|
|
133
|
+
"name": "clearData",
|
|
134
|
+
"default": "true"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
119
137
|
"description": "Reset the form state",
|
|
120
138
|
"privacy": "public"
|
|
121
139
|
},
|
|
@@ -245,6 +263,13 @@
|
|
|
245
263
|
"text": "boolean"
|
|
246
264
|
},
|
|
247
265
|
"fieldName": "readonly"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "hide-submit-button",
|
|
269
|
+
"type": {
|
|
270
|
+
"text": "boolean"
|
|
271
|
+
},
|
|
272
|
+
"fieldName": "hideSubmit"
|
|
248
273
|
}
|
|
249
274
|
],
|
|
250
275
|
"superclass": {
|
|
@@ -1773,6 +1798,43 @@
|
|
|
1773
1798
|
}
|
|
1774
1799
|
]
|
|
1775
1800
|
},
|
|
1801
|
+
{
|
|
1802
|
+
"kind": "javascript-module",
|
|
1803
|
+
"path": "src/jsonforms/renderers/LayoutStepperRenderer.ts",
|
|
1804
|
+
"declarations": [
|
|
1805
|
+
{
|
|
1806
|
+
"kind": "variable",
|
|
1807
|
+
"name": "LayoutStepperRendererTemplate",
|
|
1808
|
+
"default": "html`\n <template>\n <stepper-wrapper :form=${(x) => x} :control=${(x) => x.control}></stepper-wrapper>\n </template>\n`"
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
"kind": "variable",
|
|
1812
|
+
"name": "LayoutStepperRendererEntry",
|
|
1813
|
+
"type": {
|
|
1814
|
+
"text": "any"
|
|
1815
|
+
},
|
|
1816
|
+
"default": "{\n renderer: LayoutStepperRendererTemplate,\n tester: rankWith(LAYOUT_STEPPER_RANK, (uiSchema) => uiSchema.type === 'Stepper'),\n mapper: mapStateToLayoutProps,\n}"
|
|
1817
|
+
}
|
|
1818
|
+
],
|
|
1819
|
+
"exports": [
|
|
1820
|
+
{
|
|
1821
|
+
"kind": "js",
|
|
1822
|
+
"name": "LayoutStepperRendererTemplate",
|
|
1823
|
+
"declaration": {
|
|
1824
|
+
"name": "LayoutStepperRendererTemplate",
|
|
1825
|
+
"module": "src/jsonforms/renderers/LayoutStepperRenderer.ts"
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
"kind": "js",
|
|
1830
|
+
"name": "LayoutStepperRendererEntry",
|
|
1831
|
+
"declaration": {
|
|
1832
|
+
"name": "LayoutStepperRendererEntry",
|
|
1833
|
+
"module": "src/jsonforms/renderers/LayoutStepperRenderer.ts"
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
]
|
|
1837
|
+
},
|
|
1776
1838
|
{
|
|
1777
1839
|
"kind": "javascript-module",
|
|
1778
1840
|
"path": "src/jsonforms/renderers/LayoutVertical2ColumnsRenderer.ts",
|
|
@@ -1947,6 +2009,14 @@
|
|
|
1947
2009
|
},
|
|
1948
2010
|
"default": "2"
|
|
1949
2011
|
},
|
|
2012
|
+
{
|
|
2013
|
+
"kind": "variable",
|
|
2014
|
+
"name": "LAYOUT_STEPPER_RANK",
|
|
2015
|
+
"type": {
|
|
2016
|
+
"text": "number"
|
|
2017
|
+
},
|
|
2018
|
+
"default": "3"
|
|
2019
|
+
},
|
|
1950
2020
|
{
|
|
1951
2021
|
"kind": "variable",
|
|
1952
2022
|
"name": "LAYOUT2COLUMNS_RANK",
|
|
@@ -2053,6 +2123,14 @@
|
|
|
2053
2123
|
"module": "src/jsonforms/renderers/RenderersRanks.ts"
|
|
2054
2124
|
}
|
|
2055
2125
|
},
|
|
2126
|
+
{
|
|
2127
|
+
"kind": "js",
|
|
2128
|
+
"name": "LAYOUT_STEPPER_RANK",
|
|
2129
|
+
"declaration": {
|
|
2130
|
+
"name": "LAYOUT_STEPPER_RANK",
|
|
2131
|
+
"module": "src/jsonforms/renderers/RenderersRanks.ts"
|
|
2132
|
+
}
|
|
2133
|
+
},
|
|
2056
2134
|
{
|
|
2057
2135
|
"kind": "js",
|
|
2058
2136
|
"name": "LAYOUT2COLUMNS_RANK",
|
|
@@ -2071,6 +2149,102 @@
|
|
|
2071
2149
|
}
|
|
2072
2150
|
]
|
|
2073
2151
|
},
|
|
2152
|
+
{
|
|
2153
|
+
"kind": "javascript-module",
|
|
2154
|
+
"path": "src/jsonforms/renderers/StepperWrapperRenderer.ts",
|
|
2155
|
+
"declarations": [
|
|
2156
|
+
{
|
|
2157
|
+
"kind": "function",
|
|
2158
|
+
"name": "StepperWrapperRendererTemplate",
|
|
2159
|
+
"parameters": [
|
|
2160
|
+
{
|
|
2161
|
+
"name": "prefix",
|
|
2162
|
+
"default": "'zero'"
|
|
2163
|
+
}
|
|
2164
|
+
]
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
"kind": "class",
|
|
2168
|
+
"description": "",
|
|
2169
|
+
"name": "StepperWrapper",
|
|
2170
|
+
"members": [
|
|
2171
|
+
{
|
|
2172
|
+
"kind": "field",
|
|
2173
|
+
"name": "form"
|
|
2174
|
+
},
|
|
2175
|
+
{
|
|
2176
|
+
"kind": "field",
|
|
2177
|
+
"name": "control"
|
|
2178
|
+
},
|
|
2179
|
+
{
|
|
2180
|
+
"kind": "field",
|
|
2181
|
+
"name": "validation",
|
|
2182
|
+
"type": {
|
|
2183
|
+
"text": "Validation[]"
|
|
2184
|
+
}
|
|
2185
|
+
},
|
|
2186
|
+
{
|
|
2187
|
+
"kind": "field",
|
|
2188
|
+
"name": "stepper",
|
|
2189
|
+
"type": {
|
|
2190
|
+
"text": "Stepper"
|
|
2191
|
+
}
|
|
2192
|
+
},
|
|
2193
|
+
{
|
|
2194
|
+
"kind": "field",
|
|
2195
|
+
"name": "propertyNames",
|
|
2196
|
+
"type": {
|
|
2197
|
+
"text": "Array<string>"
|
|
2198
|
+
}
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
"kind": "method",
|
|
2202
|
+
"name": "submit"
|
|
2203
|
+
},
|
|
2204
|
+
{
|
|
2205
|
+
"kind": "method",
|
|
2206
|
+
"name": "nextStep"
|
|
2207
|
+
},
|
|
2208
|
+
{
|
|
2209
|
+
"kind": "method",
|
|
2210
|
+
"name": "resetValidation"
|
|
2211
|
+
}
|
|
2212
|
+
],
|
|
2213
|
+
"superclass": {
|
|
2214
|
+
"name": "FASTElement",
|
|
2215
|
+
"package": "@microsoft/fast-element"
|
|
2216
|
+
},
|
|
2217
|
+
"tagName": "stepper-wrapper",
|
|
2218
|
+
"customElement": true
|
|
2219
|
+
}
|
|
2220
|
+
],
|
|
2221
|
+
"exports": [
|
|
2222
|
+
{
|
|
2223
|
+
"kind": "js",
|
|
2224
|
+
"name": "StepperWrapperRendererTemplate",
|
|
2225
|
+
"declaration": {
|
|
2226
|
+
"name": "StepperWrapperRendererTemplate",
|
|
2227
|
+
"module": "src/jsonforms/renderers/StepperWrapperRenderer.ts"
|
|
2228
|
+
}
|
|
2229
|
+
},
|
|
2230
|
+
{
|
|
2231
|
+
"kind": "js",
|
|
2232
|
+
"name": "StepperWrapper",
|
|
2233
|
+
"declaration": {
|
|
2234
|
+
"name": "StepperWrapper",
|
|
2235
|
+
"module": "src/jsonforms/renderers/StepperWrapperRenderer.ts"
|
|
2236
|
+
}
|
|
2237
|
+
},
|
|
2238
|
+
{
|
|
2239
|
+
"kind": "custom-element-definition",
|
|
2240
|
+
"name": "stepper-wrapper",
|
|
2241
|
+
"declaration": {
|
|
2242
|
+
"name": "StepperWrapper",
|
|
2243
|
+
"module": "src/jsonforms/renderers/StepperWrapperRenderer.ts"
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
]
|
|
2247
|
+
},
|
|
2074
2248
|
{
|
|
2075
2249
|
"kind": "javascript-module",
|
|
2076
2250
|
"path": "src/jsonforms/renderers/StringControlRenderer.ts",
|
package/dist/dts/form.d.ts
CHANGED
|
@@ -89,20 +89,25 @@ export declare class Form extends FoundationElement {
|
|
|
89
89
|
*/
|
|
90
90
|
submitted: boolean;
|
|
91
91
|
readonly: boolean;
|
|
92
|
+
hideSubmit: boolean;
|
|
92
93
|
/**
|
|
93
94
|
* @internal
|
|
94
95
|
*/
|
|
95
96
|
_submit(): Promise<void>;
|
|
97
|
+
get isSubmitHidden(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
submitPart(event: CustomEvent): void;
|
|
96
102
|
/**
|
|
97
103
|
* @internal
|
|
98
104
|
*/
|
|
99
105
|
onChange(event: CustomEvent): void;
|
|
100
|
-
connectedCallback(): void;
|
|
101
106
|
disconnectedCallback(): void;
|
|
102
107
|
/**
|
|
103
108
|
* Reset the form state
|
|
104
109
|
* @public
|
|
105
110
|
*/
|
|
106
|
-
reset(): void;
|
|
111
|
+
reset(clearData?: boolean): void;
|
|
107
112
|
}
|
|
108
113
|
//# sourceMappingURL=form.d.ts.map
|
package/dist/dts/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAmB1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,gBAAgB;AAChB,eAAO,MAAM,MAAM,iDAAkC,CAAC;AActD,cAAc;AACd,eAAO,MAAM,SAAS,OAiBrB,CAAC;AACF;;;;;GAKG;AAEH,qBAKa,IAAK,SAAQ,iBAAiB;IACzC;;;;OAIG;IACG,YAAY,EAAE,MAAM,CAAC;YACb,mBAAmB;IAQjC,OAAO,CAAC,oBAAoB;IA0B5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACS,QAAQ,EAAE,eAAe,CAAC;IACtC;;;OAGG;IACS,SAAS,EAAE,aAAa,EAAE,CAAa;IACnD;;;;;;OAMG;IACS,UAAU,EAAE,WAAW,CAAC;IAEpC,OAAO,CAAC,MAAM,CAAqB;IAC1B,OAAO,CAAC,OAAO,CAAW;IACnC;;;OAGG;IACS,IAAI,EAAE,GAAG,CAAM;IAE3B;;OAEG;IACS,UAAU,EAAE,OAAO,CAAC;IAChC;;OAEG;IACS,SAAS,EAAE,OAAO,CAAC;IAEJ,QAAQ,EAAE,OAAO,CAAC;IACe,UAAU,EAAE,OAAO,CAAC;IAEhF;;OAEG;IACG,OAAO;IA2Bb,IAAc,cAAc,YAM3B;IAED;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,WAAW;IAI7B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW;IAQ3B,oBAAoB;IAKpB;;;OAGG;IACH,KAAK,CAAC,SAAS,UAAO;CAMvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAenC,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,2DA8BlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutStepperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/LayoutStepperRenderer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B,0DAIzC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAIxC,CAAC"}
|
|
@@ -9,6 +9,7 @@ export declare const LAYOUT_ARRAY_RANK = 2;
|
|
|
9
9
|
export declare const LAYOUT_CATEGORIZATION_RANK = 2;
|
|
10
10
|
export declare const LAYOUT_GROUP_RANK = 2;
|
|
11
11
|
export declare const LAYOUT_HORIZONTAL_RANK = 2;
|
|
12
|
+
export declare const LAYOUT_STEPPER_RANK = 3;
|
|
12
13
|
export declare const LAYOUT2COLUMNS_RANK = 2;
|
|
13
14
|
export declare const INVISIBLE_CONTROL_RANK = 5;
|
|
14
15
|
//# sourceMappingURL=RenderersRanks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderersRanks.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/RenderersRanks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,sBAAsB,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"RenderersRanks.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/RenderersRanks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,sBAAsB,IAAI,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Stepper, Validation } from '@genesislcap/foundation-ui';
|
|
2
|
+
import { FASTElement } from '@microsoft/fast-element';
|
|
3
|
+
export declare const StepperWrapperRendererTemplate: (prefix?: string) => import("@microsoft/fast-element").ViewTemplate<StepperWrapper, any>;
|
|
4
|
+
export declare class StepperWrapper extends FASTElement {
|
|
5
|
+
form: any;
|
|
6
|
+
control: any;
|
|
7
|
+
validation: Validation[];
|
|
8
|
+
stepper: Stepper;
|
|
9
|
+
propertyNames: Array<string>;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
submit(): void;
|
|
12
|
+
nextStep(): void;
|
|
13
|
+
resetValidation(): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=StepperWrapperRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepperWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/StepperWrapperRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAKL,WAAW,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,8BAA8B,0FA2C1C,CAAC;AAUF,qBAOa,cAAe,SAAQ,WAAW;IACjC,IAAI,MAAC;IACL,OAAO,MAAC;IACR,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzC,iBAAiB,IAAI,IAAI;IAezB,MAAM;IAIN,QAAQ;IAcR,eAAe;CAGhB"}
|
package/dist/esm/form.js
CHANGED
|
@@ -2,7 +2,7 @@ import { __awaiter, __decorate } from "tslib";
|
|
|
2
2
|
import { Connect } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { createLogger } from '@genesislcap/foundation-logger';
|
|
4
4
|
import { isControl, isStringControl, mapStateToControlProps, rankWith, } from '@jsonforms/core';
|
|
5
|
-
import { attr, customElement, DOM, observable } from '@microsoft/fast-element';
|
|
5
|
+
import { attr, customElement, DOM, observable, volatile } from '@microsoft/fast-element';
|
|
6
6
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
7
7
|
import { foundationFormStyles as styles } from './form.styles';
|
|
8
8
|
import { foundationFormTemplate as template } from './form.template';
|
|
@@ -17,6 +17,7 @@ import { LayoutCategorizationRendererEntry } from './jsonforms/renderers/LayoutC
|
|
|
17
17
|
import { LayoutGroupRendererEntry } from './jsonforms/renderers/LayoutGroupRenderer';
|
|
18
18
|
import { LayoutHorizontalEntry } from './jsonforms/renderers/LayoutHorizontalRenderer';
|
|
19
19
|
import { LayoutRendererEntry } from './jsonforms/renderers/LayoutRenderer';
|
|
20
|
+
import { LayoutStepperRendererEntry } from './jsonforms/renderers/LayoutStepperRenderer';
|
|
20
21
|
import { LayoutVertical2ColumnsEntry } from './jsonforms/renderers/LayoutVertical2ColumnsRenderer';
|
|
21
22
|
import { NumberControlRendererEntry } from './jsonforms/renderers/NumberControlRenderer';
|
|
22
23
|
import { StringControlRendererTemplate } from './jsonforms/renderers/StringControlRenderer';
|
|
@@ -43,6 +44,7 @@ export const renderers = [
|
|
|
43
44
|
LayoutHorizontalEntry,
|
|
44
45
|
LayoutVertical2ColumnsEntry,
|
|
45
46
|
LayoutRendererEntry,
|
|
47
|
+
LayoutStepperRendererEntry,
|
|
46
48
|
NumberControlRendererEntry,
|
|
47
49
|
ConnectedMultiselectControlRendererEntry,
|
|
48
50
|
EnumControlRendererEntry,
|
|
@@ -129,6 +131,20 @@ let Form = class Form extends FoundationElement {
|
|
|
129
131
|
}
|
|
130
132
|
});
|
|
131
133
|
}
|
|
134
|
+
get isSubmitHidden() {
|
|
135
|
+
if (this.readonly || this.hideSubmit) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
145
|
+
submitPart(event) {
|
|
146
|
+
this.submitted = true;
|
|
147
|
+
}
|
|
132
148
|
/**
|
|
133
149
|
* @internal
|
|
134
150
|
*/
|
|
@@ -139,22 +155,19 @@ let Form = class Form extends FoundationElement {
|
|
|
139
155
|
this.errors = event.detail.errors;
|
|
140
156
|
}
|
|
141
157
|
}
|
|
142
|
-
connectedCallback() {
|
|
143
|
-
super.connectedCallback();
|
|
144
|
-
this.addEventListener('submit-button-clicked', this._submit);
|
|
145
|
-
}
|
|
146
158
|
disconnectedCallback() {
|
|
147
159
|
super.disconnectedCallback();
|
|
148
|
-
this.removeEventListener('submit-button-clicked', this._submit);
|
|
149
160
|
this.reset();
|
|
150
161
|
}
|
|
151
162
|
/**
|
|
152
163
|
* Reset the form state
|
|
153
164
|
* @public
|
|
154
165
|
*/
|
|
155
|
-
reset() {
|
|
166
|
+
reset(clearData = true) {
|
|
156
167
|
this.submitted = false;
|
|
157
|
-
|
|
168
|
+
if (clearData) {
|
|
169
|
+
this.data = {};
|
|
170
|
+
}
|
|
158
171
|
}
|
|
159
172
|
};
|
|
160
173
|
__decorate([
|
|
@@ -184,6 +197,12 @@ __decorate([
|
|
|
184
197
|
__decorate([
|
|
185
198
|
attr({ mode: 'boolean' })
|
|
186
199
|
], Form.prototype, "readonly", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
attr({ attribute: 'hide-submit-button', mode: 'boolean' })
|
|
202
|
+
], Form.prototype, "hideSubmit", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
volatile
|
|
205
|
+
], Form.prototype, "isSubmitHidden", null);
|
|
187
206
|
Form = __decorate([
|
|
188
207
|
customElement({
|
|
189
208
|
name: 'foundation-form',
|
|
@@ -4,15 +4,20 @@ import { ArrayListWrapper } from './jsonforms/renderers/ArrayListWrapperRenderer
|
|
|
4
4
|
import { CategorizationWrapper } from './jsonforms/renderers/CategorizationWrapperRenderer';
|
|
5
5
|
import { ControlWrapper } from './jsonforms/renderers/ControlWrapperRenderer';
|
|
6
6
|
import { DispatchRenderer } from './jsonforms/renderers/dispatch-renderer';
|
|
7
|
+
import { StepperWrapper } from './jsonforms/renderers/StepperWrapperRenderer';
|
|
7
8
|
JSONForms;
|
|
8
9
|
ArrayListWrapper;
|
|
9
10
|
CategorizationWrapper;
|
|
10
11
|
ControlWrapper;
|
|
11
12
|
DispatchRenderer;
|
|
13
|
+
StepperWrapper;
|
|
12
14
|
/** @internal */
|
|
13
15
|
export const foundationFormTemplate = html `
|
|
14
16
|
<template>
|
|
15
17
|
<json-forms
|
|
18
|
+
@submit-button-clicked=${(x) => x._submit()}
|
|
19
|
+
@submit-part=${(x, c) => x.submitPart(c.event)}
|
|
20
|
+
@reset-form=${(x) => x.reset(false)}
|
|
16
21
|
?readonly=${(x) => x.readonly}
|
|
17
22
|
?submitted=${(x) => x.submitted}
|
|
18
23
|
:renderers=${(x) => x.renderers}
|
|
@@ -21,7 +26,7 @@ export const foundationFormTemplate = html `
|
|
|
21
26
|
:data=${(x) => x.data}
|
|
22
27
|
@data-change=${(x, c) => x.onChange(c.event)}
|
|
23
28
|
></json-forms>
|
|
24
|
-
${when((x) =>
|
|
29
|
+
${when((x) => x.isSubmitHidden, html `
|
|
25
30
|
<slot name="userActions" part="userActions" class="actions">
|
|
26
31
|
<fast-button
|
|
27
32
|
@click="${(x) => x._submit()}"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { mapStateToLayoutProps, rankWith } from '@jsonforms/core';
|
|
2
|
+
import { html } from '@microsoft/fast-element';
|
|
3
|
+
import { LAYOUT_STEPPER_RANK } from './RenderersRanks';
|
|
4
|
+
export const LayoutStepperRendererTemplate = html `
|
|
5
|
+
<template>
|
|
6
|
+
<stepper-wrapper :form=${(x) => x} :control=${(x) => x.control}></stepper-wrapper>
|
|
7
|
+
</template>
|
|
8
|
+
`;
|
|
9
|
+
export const LayoutStepperRendererEntry = {
|
|
10
|
+
renderer: LayoutStepperRendererTemplate,
|
|
11
|
+
tester: rankWith(LAYOUT_STEPPER_RANK, (uiSchema) => uiSchema.type === 'Stepper'),
|
|
12
|
+
mapper: mapStateToLayoutProps,
|
|
13
|
+
};
|
|
@@ -9,5 +9,6 @@ export const LAYOUT_ARRAY_RANK = 2;
|
|
|
9
9
|
export const LAYOUT_CATEGORIZATION_RANK = 2;
|
|
10
10
|
export const LAYOUT_GROUP_RANK = 2;
|
|
11
11
|
export const LAYOUT_HORIZONTAL_RANK = 2;
|
|
12
|
+
export const LAYOUT_STEPPER_RANK = 3;
|
|
12
13
|
export const LAYOUT2COLUMNS_RANK = 2;
|
|
13
14
|
export const INVISIBLE_CONTROL_RANK = 5;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { getSubErrorsAt } from '@jsonforms/core';
|
|
3
|
+
import { html, css, observable, customElement, FASTElement, repeat, ref, } from '@microsoft/fast-element';
|
|
4
|
+
export const StepperWrapperRendererTemplate = (prefix = 'zero') => html `
|
|
5
|
+
<template>
|
|
6
|
+
<${prefix}-stepper
|
|
7
|
+
class="tabs-container"
|
|
8
|
+
${ref('stepper')}
|
|
9
|
+
@next-step=${(x) => x.nextStep()}
|
|
10
|
+
@validation-success=${(x) => x.resetValidation()}
|
|
11
|
+
@submit=${(x) => x.submit()}
|
|
12
|
+
:validation=${(x) => x.validation}>
|
|
13
|
+
${repeat((x) => x.control.uischema.elements, html `
|
|
14
|
+
<${prefix}-stepper-tab class="tab-control">${(x, ctx) => { var _a; return (_a = x.label) !== null && _a !== void 0 ? _a : `Step ${ctx.index + 1}`; }}</${prefix}-stepper-tab>
|
|
15
|
+
`, { positioning: true })}
|
|
16
|
+
${repeat((x) => x.control.uischema.elements, html `
|
|
17
|
+
<${prefix}-stepper-tab-panel class="tab-panel-control">
|
|
18
|
+
${repeat((x) => x.options.childElements, html `
|
|
19
|
+
<dispatch-renderer
|
|
20
|
+
?submitted=${(x, ctx) => ctx.parentContext.parent.form.submitted}
|
|
21
|
+
:dispatch=${(x, ctx) => ctx.parentContext.parent.form.dispatch}
|
|
22
|
+
:jsonforms=${(x, ctx) => ctx.parentContext.parent.form.jsonforms}
|
|
23
|
+
:props=${(x, ctx) => ({
|
|
24
|
+
uischema: x,
|
|
25
|
+
schema: ctx.parentContext.parent.control.schema,
|
|
26
|
+
renderers: ctx.parentContext.parent.control.renderers,
|
|
27
|
+
path: ctx.parentContext.parent.control.path,
|
|
28
|
+
enabled: ctx.parentContext.parent.control.enabled,
|
|
29
|
+
})}
|
|
30
|
+
></dispatch-renderer>
|
|
31
|
+
`)}
|
|
32
|
+
</${prefix}-stepper-tab-panel>
|
|
33
|
+
`)}
|
|
34
|
+
</${prefix}-stepper>
|
|
35
|
+
</template>
|
|
36
|
+
`;
|
|
37
|
+
const styles = css `
|
|
38
|
+
.tabs-container::part(stepper-panel-container) {
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: flex-start;
|
|
41
|
+
align-items: flex-start;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
let StepperWrapper = class StepperWrapper extends FASTElement {
|
|
45
|
+
connectedCallback() {
|
|
46
|
+
super.connectedCallback();
|
|
47
|
+
this.propertyNames = this.control.uischema.elements.map((element) => {
|
|
48
|
+
const splitedScope = element.scope.split('/');
|
|
49
|
+
return splitedScope.pop();
|
|
50
|
+
});
|
|
51
|
+
this.validation = this.propertyNames.map((propertyName, index) => ({
|
|
52
|
+
isValid: () => getSubErrorsAt(propertyName, this.control.schema)(this.form).length === 0 &&
|
|
53
|
+
Object.keys(this.control.data)[index] === propertyName,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
submit() {
|
|
57
|
+
this.$emit('submit-button-clicked');
|
|
58
|
+
}
|
|
59
|
+
nextStep() {
|
|
60
|
+
this.$emit('submit-part');
|
|
61
|
+
const currentProperty = this.propertyNames[this.stepper.activeTabIndex];
|
|
62
|
+
if (!this.control.data[currentProperty]) {
|
|
63
|
+
this.$emit('data-change', {
|
|
64
|
+
data: Object.assign(Object.assign({}, this.control.data), { [currentProperty]: {} }),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
resetValidation() {
|
|
69
|
+
this.$emit('reset-form');
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
__decorate([
|
|
73
|
+
observable
|
|
74
|
+
], StepperWrapper.prototype, "form", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
observable
|
|
77
|
+
], StepperWrapper.prototype, "control", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
observable
|
|
80
|
+
], StepperWrapper.prototype, "validation", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
observable
|
|
83
|
+
], StepperWrapper.prototype, "stepper", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
observable
|
|
86
|
+
], StepperWrapper.prototype, "propertyNames", void 0);
|
|
87
|
+
StepperWrapper = __decorate([
|
|
88
|
+
customElement({
|
|
89
|
+
name: 'stepper-wrapper',
|
|
90
|
+
styles,
|
|
91
|
+
template: html `
|
|
92
|
+
${(x) => StepperWrapperRendererTemplate(x.form.prefix)}
|
|
93
|
+
`,
|
|
94
|
+
})
|
|
95
|
+
], StepperWrapper);
|
|
96
|
+
export { StepperWrapper };
|
|
@@ -560,14 +560,44 @@
|
|
|
560
560
|
"name": "Form",
|
|
561
561
|
"preserveMemberOrder": false,
|
|
562
562
|
"members": [
|
|
563
|
+
{
|
|
564
|
+
"kind": "Property",
|
|
565
|
+
"canonicalReference": "@genesislcap/foundation-forms!Form#data:member",
|
|
566
|
+
"docComment": "/**\n * Initial data for the form\n *\n * @public\n */\n",
|
|
567
|
+
"excerptTokens": [
|
|
568
|
+
{
|
|
569
|
+
"kind": "Content",
|
|
570
|
+
"text": "data: "
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"kind": "Content",
|
|
574
|
+
"text": "any"
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"kind": "Content",
|
|
578
|
+
"text": ";"
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
"isReadonly": false,
|
|
582
|
+
"isOptional": false,
|
|
583
|
+
"releaseTag": "Public",
|
|
584
|
+
"name": "data",
|
|
585
|
+
"propertyTypeTokenRange": {
|
|
586
|
+
"startIndex": 1,
|
|
587
|
+
"endIndex": 2
|
|
588
|
+
},
|
|
589
|
+
"isStatic": false,
|
|
590
|
+
"isProtected": false,
|
|
591
|
+
"isAbstract": false
|
|
592
|
+
},
|
|
563
593
|
{
|
|
564
594
|
"kind": "Method",
|
|
565
|
-
"canonicalReference": "@genesislcap/foundation-forms!Form#
|
|
595
|
+
"canonicalReference": "@genesislcap/foundation-forms!Form#disconnectedCallback:member(1)",
|
|
566
596
|
"docComment": "",
|
|
567
597
|
"excerptTokens": [
|
|
568
598
|
{
|
|
569
599
|
"kind": "Content",
|
|
570
|
-
"text": "
|
|
600
|
+
"text": "disconnectedCallback(): "
|
|
571
601
|
},
|
|
572
602
|
{
|
|
573
603
|
"kind": "Content",
|
|
@@ -589,20 +619,20 @@
|
|
|
589
619
|
"parameters": [],
|
|
590
620
|
"isOptional": false,
|
|
591
621
|
"isAbstract": false,
|
|
592
|
-
"name": "
|
|
622
|
+
"name": "disconnectedCallback"
|
|
593
623
|
},
|
|
594
624
|
{
|
|
595
625
|
"kind": "Property",
|
|
596
|
-
"canonicalReference": "@genesislcap/foundation-forms!Form#
|
|
597
|
-
"docComment": "
|
|
626
|
+
"canonicalReference": "@genesislcap/foundation-forms!Form#hideSubmit:member",
|
|
627
|
+
"docComment": "",
|
|
598
628
|
"excerptTokens": [
|
|
599
629
|
{
|
|
600
630
|
"kind": "Content",
|
|
601
|
-
"text": "
|
|
631
|
+
"text": "hideSubmit: "
|
|
602
632
|
},
|
|
603
633
|
{
|
|
604
634
|
"kind": "Content",
|
|
605
|
-
"text": "
|
|
635
|
+
"text": "boolean"
|
|
606
636
|
},
|
|
607
637
|
{
|
|
608
638
|
"kind": "Content",
|
|
@@ -611,8 +641,8 @@
|
|
|
611
641
|
],
|
|
612
642
|
"isReadonly": false,
|
|
613
643
|
"isOptional": false,
|
|
614
|
-
"releaseTag": "
|
|
615
|
-
"name": "
|
|
644
|
+
"releaseTag": "Beta",
|
|
645
|
+
"name": "hideSubmit",
|
|
616
646
|
"propertyTypeTokenRange": {
|
|
617
647
|
"startIndex": 1,
|
|
618
648
|
"endIndex": 2
|
|
@@ -622,35 +652,34 @@
|
|
|
622
652
|
"isAbstract": false
|
|
623
653
|
},
|
|
624
654
|
{
|
|
625
|
-
"kind": "
|
|
626
|
-
"canonicalReference": "@genesislcap/foundation-forms!Form#
|
|
655
|
+
"kind": "Property",
|
|
656
|
+
"canonicalReference": "@genesislcap/foundation-forms!Form#isSubmitHidden:member",
|
|
627
657
|
"docComment": "",
|
|
628
658
|
"excerptTokens": [
|
|
629
659
|
{
|
|
630
660
|
"kind": "Content",
|
|
631
|
-
"text": "
|
|
661
|
+
"text": "get isSubmitHidden(): "
|
|
632
662
|
},
|
|
633
663
|
{
|
|
634
664
|
"kind": "Content",
|
|
635
|
-
"text": "
|
|
665
|
+
"text": "boolean"
|
|
636
666
|
},
|
|
637
667
|
{
|
|
638
668
|
"kind": "Content",
|
|
639
669
|
"text": ";"
|
|
640
670
|
}
|
|
641
671
|
],
|
|
642
|
-
"
|
|
643
|
-
"
|
|
672
|
+
"isReadonly": true,
|
|
673
|
+
"isOptional": false,
|
|
674
|
+
"releaseTag": "Beta",
|
|
675
|
+
"name": "isSubmitHidden",
|
|
676
|
+
"propertyTypeTokenRange": {
|
|
644
677
|
"startIndex": 1,
|
|
645
678
|
"endIndex": 2
|
|
646
679
|
},
|
|
647
|
-
"
|
|
680
|
+
"isStatic": false,
|
|
648
681
|
"isProtected": false,
|
|
649
|
-
"
|
|
650
|
-
"parameters": [],
|
|
651
|
-
"isOptional": false,
|
|
652
|
-
"isAbstract": false,
|
|
653
|
-
"name": "disconnectedCallback"
|
|
682
|
+
"isAbstract": false
|
|
654
683
|
},
|
|
655
684
|
{
|
|
656
685
|
"kind": "Property",
|
|
@@ -755,7 +784,15 @@
|
|
|
755
784
|
"excerptTokens": [
|
|
756
785
|
{
|
|
757
786
|
"kind": "Content",
|
|
758
|
-
"text": "reset(
|
|
787
|
+
"text": "reset(clearData?: "
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"kind": "Content",
|
|
791
|
+
"text": "boolean"
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"kind": "Content",
|
|
795
|
+
"text": "): "
|
|
759
796
|
},
|
|
760
797
|
{
|
|
761
798
|
"kind": "Content",
|
|
@@ -768,13 +805,22 @@
|
|
|
768
805
|
],
|
|
769
806
|
"isStatic": false,
|
|
770
807
|
"returnTypeTokenRange": {
|
|
771
|
-
"startIndex":
|
|
772
|
-
"endIndex":
|
|
808
|
+
"startIndex": 3,
|
|
809
|
+
"endIndex": 4
|
|
773
810
|
},
|
|
774
811
|
"releaseTag": "Public",
|
|
775
812
|
"isProtected": false,
|
|
776
813
|
"overloadIndex": 1,
|
|
777
|
-
"parameters": [
|
|
814
|
+
"parameters": [
|
|
815
|
+
{
|
|
816
|
+
"parameterName": "clearData",
|
|
817
|
+
"parameterTypeTokenRange": {
|
|
818
|
+
"startIndex": 1,
|
|
819
|
+
"endIndex": 2
|
|
820
|
+
},
|
|
821
|
+
"isOptional": true
|
|
822
|
+
}
|
|
823
|
+
],
|
|
778
824
|
"isOptional": false,
|
|
779
825
|
"isAbstract": false,
|
|
780
826
|
"name": "reset"
|
|
@@ -223,21 +223,26 @@ export declare class Form extends FoundationElement {
|
|
|
223
223
|
*/
|
|
224
224
|
submitted: boolean;
|
|
225
225
|
readonly: boolean;
|
|
226
|
+
hideSubmit: boolean;
|
|
226
227
|
/**
|
|
227
228
|
* @internal
|
|
228
229
|
*/
|
|
229
230
|
_submit(): Promise<void>;
|
|
231
|
+
get isSubmitHidden(): boolean;
|
|
232
|
+
/**
|
|
233
|
+
* @internal
|
|
234
|
+
*/
|
|
235
|
+
submitPart(event: CustomEvent): void;
|
|
230
236
|
/**
|
|
231
237
|
* @internal
|
|
232
238
|
*/
|
|
233
239
|
onChange(event: CustomEvent): void;
|
|
234
|
-
connectedCallback(): void;
|
|
235
240
|
disconnectedCallback(): void;
|
|
236
241
|
/**
|
|
237
242
|
* Reset the form state
|
|
238
243
|
* @public
|
|
239
244
|
*/
|
|
240
|
-
reset(): void;
|
|
245
|
+
reset(clearData?: boolean): void;
|
|
241
246
|
}
|
|
242
247
|
|
|
243
248
|
/** @internal */
|
package/docs/api/{foundation-forms.form.connectedcallback.md → foundation-forms.form.hidesubmit.md}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
2
|
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-forms](./foundation-forms.md) > [Form](./foundation-forms.form.md) > [
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-forms](./foundation-forms.md) > [Form](./foundation-forms.form.md) > [hideSubmit](./foundation-forms.form.hidesubmit.md)
|
|
4
4
|
|
|
5
|
-
## Form.
|
|
5
|
+
## Form.hideSubmit property
|
|
6
6
|
|
|
7
7
|
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
8
|
>
|
|
@@ -10,9 +10,5 @@
|
|
|
10
10
|
**Signature:**
|
|
11
11
|
|
|
12
12
|
```typescript
|
|
13
|
-
|
|
13
|
+
hideSubmit: boolean;
|
|
14
14
|
```
|
|
15
|
-
**Returns:**
|
|
16
|
-
|
|
17
|
-
void
|
|
18
|
-
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-forms](./foundation-forms.md) > [Form](./foundation-forms.form.md) > [isSubmitHidden](./foundation-forms.form.issubmithidden.md)
|
|
4
|
+
|
|
5
|
+
## Form.isSubmitHidden property
|
|
6
|
+
|
|
7
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
**Signature:**
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
get isSubmitHidden(): boolean;
|
|
14
|
+
```
|
|
@@ -21,6 +21,8 @@ export declare class Form extends FoundationElement
|
|
|
21
21
|
| Property | Modifiers | Type | Description |
|
|
22
22
|
| --- | --- | --- | --- |
|
|
23
23
|
| [data](./foundation-forms.form.data.md) | | any | Initial data for the form |
|
|
24
|
+
| [hideSubmit](./foundation-forms.form.hidesubmit.md) | | boolean | **_(BETA)_** |
|
|
25
|
+
| [isSubmitHidden](./foundation-forms.form.issubmithidden.md) | <code>readonly</code> | boolean | **_(BETA)_** |
|
|
24
26
|
| [jsonSchema](./foundation-forms.form.jsonschema.md) | | JSONSchema7 | Alternatively to providing [Form.resourceName](./foundation-forms.form.resourcename.md) you can hardcode the JSON schema on the client. |
|
|
25
27
|
| [readonly](./foundation-forms.form.readonly.md) | | boolean | **_(BETA)_** |
|
|
26
28
|
| [renderers](./foundation-forms.form.renderers.md) | | [RendererEntry](./foundation-forms.rendererentry.md)<!-- -->\[\] | Allows to provide set of renderers used by the form. If not provided it will default to text-field inputs |
|
|
@@ -31,7 +33,6 @@ export declare class Form extends FoundationElement
|
|
|
31
33
|
|
|
32
34
|
| Method | Modifiers | Description |
|
|
33
35
|
| --- | --- | --- |
|
|
34
|
-
| [connectedCallback()](./foundation-forms.form.connectedcallback.md) | | **_(BETA)_** |
|
|
35
36
|
| [disconnectedCallback()](./foundation-forms.form.disconnectedcallback.md) | | **_(BETA)_** |
|
|
36
|
-
| [reset()](./foundation-forms.form.reset.md) | | Reset the form state |
|
|
37
|
+
| [reset(clearData)](./foundation-forms.form.reset.md) | | Reset the form state |
|
|
37
38
|
|
|
@@ -9,8 +9,15 @@ Reset the form state
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
reset(): void;
|
|
12
|
+
reset(clearData?: boolean): void;
|
|
13
13
|
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| clearData | boolean | _(Optional)_ |
|
|
20
|
+
|
|
14
21
|
**Returns:**
|
|
15
22
|
|
|
16
23
|
void
|
package/docs/api-report.md
CHANGED
|
@@ -61,12 +61,14 @@ export const filtersRenderers: any[];
|
|
|
61
61
|
|
|
62
62
|
// @beta
|
|
63
63
|
export class Form extends FoundationElement {
|
|
64
|
-
// (undocumented)
|
|
65
|
-
connectedCallback(): void;
|
|
66
64
|
// @public
|
|
67
65
|
data: any;
|
|
68
66
|
// (undocumented)
|
|
69
67
|
disconnectedCallback(): void;
|
|
68
|
+
// (undocumented)
|
|
69
|
+
hideSubmit: boolean;
|
|
70
|
+
// (undocumented)
|
|
71
|
+
get isSubmitHidden(): boolean;
|
|
70
72
|
// @public
|
|
71
73
|
jsonSchema: JSONSchema7;
|
|
72
74
|
// @internal (undocumented)
|
|
@@ -76,12 +78,14 @@ export class Form extends FoundationElement {
|
|
|
76
78
|
// @public
|
|
77
79
|
renderers: RendererEntry[];
|
|
78
80
|
// @public
|
|
79
|
-
reset(): void;
|
|
81
|
+
reset(clearData?: boolean): void;
|
|
80
82
|
// @public
|
|
81
83
|
resourceName: string;
|
|
82
84
|
// @internal (undocumented)
|
|
83
85
|
_submit(): Promise<void>;
|
|
84
86
|
// @internal (undocumented)
|
|
87
|
+
submitPart(event: CustomEvent): void;
|
|
88
|
+
// @internal (undocumented)
|
|
85
89
|
submitted: boolean;
|
|
86
90
|
// @internal (undocumented)
|
|
87
91
|
submitting: boolean;
|
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.
|
|
4
|
+
"version": "14.109.1-alpha-cf055218219.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"test:debug": "genx test --debug"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@genesislcap/foundation-testing": "14.
|
|
44
|
-
"@genesislcap/genx": "14.
|
|
43
|
+
"@genesislcap/foundation-testing": "14.109.1-alpha-cf055218219.0",
|
|
44
|
+
"@genesislcap/genx": "14.109.1-alpha-cf055218219.0",
|
|
45
45
|
"@types/json-schema": "^7.0.11",
|
|
46
46
|
"rimraf": "^3.0.2"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@genesislcap/foundation-comms": "14.
|
|
50
|
-
"@genesislcap/foundation-criteria": "14.
|
|
51
|
-
"@genesislcap/foundation-logger": "14.
|
|
52
|
-
"@genesislcap/foundation-ui": "14.
|
|
49
|
+
"@genesislcap/foundation-comms": "14.109.1-alpha-cf055218219.0",
|
|
50
|
+
"@genesislcap/foundation-criteria": "14.109.1-alpha-cf055218219.0",
|
|
51
|
+
"@genesislcap/foundation-logger": "14.109.1-alpha-cf055218219.0",
|
|
52
|
+
"@genesislcap/foundation-ui": "14.109.1-alpha-cf055218219.0",
|
|
53
53
|
"@jsonforms/core": "^3.0.0",
|
|
54
54
|
"@microsoft/fast-components": "^2.21.3",
|
|
55
55
|
"@microsoft/fast-element": "^1.7.0",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
71
|
"customElements": "dist/custom-elements.json",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "2aca46b6e2d2e0df7aae4314ce806468e43e8c57"
|
|
73
73
|
}
|