@ukhomeoffice/cop-react-form-renderer 5.56.3 → 6.0.0-peter

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.
Files changed (30) hide show
  1. package/dist/components/CollectionSummary/CollectionSummary.js +21 -6
  2. package/dist/components/CollectionSummary/SummaryCard.js +10 -39
  3. package/dist/components/CollectionSummary/SummaryCard.scss +0 -145
  4. package/dist/components/CollectionSummary/SummaryCard.test.js +0 -243
  5. package/dist/components/CollectionSummary/SummaryCardDetails.js +117 -0
  6. package/dist/components/CollectionSummary/SummaryCardDetails.scss +158 -0
  7. package/dist/components/CollectionSummary/SummaryCardDetails.test.js +319 -0
  8. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/component-used-in-multiple-pages-data.json +4 -0
  9. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/component-used-in-multiple-pages-form.json +61 -0
  10. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-collection-data-removed.json +4 -0
  11. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-collections.json +8 -0
  12. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-components-removed.json +3 -0
  13. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-components.json +5 -0
  14. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-entire-collection-removed.json +3 -0
  15. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-nested-component-removed.json +10 -0
  16. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-nested-components.json +11 -0
  17. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/form-for-nested-components.json +96 -0
  18. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/form-with-collections-delete-entire.json +47 -0
  19. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/form-with-collections.json +46 -0
  20. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/form-with-components.json +48 -0
  21. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.js +134 -0
  22. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +113 -0
  23. package/dist/components/FormRenderer/helpers/deleteNodeByPath.js +20 -0
  24. package/dist/components/FormRenderer/helpers/deleteNodeByPath.test.js +56 -0
  25. package/dist/components/FormRenderer/helpers/index.js +3 -1
  26. package/dist/components/FormRenderer/onPageAction.js +1 -0
  27. package/dist/components/FormRenderer/onPageAction.test.js +5 -0
  28. package/dist/utils/CollectionPage/mergeCollectionPages.js +15 -5
  29. package/dist/utils/CollectionPage/mergeCollectionPages.test.js +48 -1
  30. package/package.json +1 -1
@@ -0,0 +1,158 @@
1
+ $govuk-font-family: 'Roboto', arial, sans-serif;
2
+
3
+ @import "node_modules/govuk-frontend/govuk/_base";
4
+
5
+ .govuk-grid-column-two-thirds:has(.hods-form-summary-card-details) {
6
+ width: 100% !important;
7
+ }
8
+
9
+ .hods-form-summary-card-details {
10
+ &__section {
11
+ border-bottom: 2px solid #E9EBED;
12
+
13
+ &-title {
14
+ font-weight: bold;
15
+ margin: govuk-spacing(2) 0 govuk-spacing(6) 0;
16
+ }
17
+
18
+ &-content {
19
+ display: flex;
20
+ flex-wrap: wrap;
21
+ gap: govuk-spacing(2);
22
+
23
+ .hods-form-summary-card-details__field {
24
+ box-sizing: border-box;
25
+ margin-bottom: govuk-spacing(4);
26
+
27
+ .govuk-label,
28
+ .govuk-fieldset__legend {
29
+ font-weight: bold;
30
+ margin-bottom: govuk-spacing(1) !important;
31
+
32
+ &::after {
33
+ content: " :";
34
+ }
35
+ }
36
+
37
+ div.govuk-form-group div:has(img){
38
+ display: flex;
39
+ flex-wrap: wrap;
40
+
41
+ .hods-readonly.hods-readonly--success {
42
+ font-size: 0;
43
+ line-height: 0;
44
+
45
+ .cop-upload-preview__thumb {
46
+ display: inline-block;
47
+ margin-right: govuk-spacing(1);
48
+ }
49
+ }
50
+
51
+ }
52
+ }
53
+
54
+ &--columns-1,
55
+ &--columns-2,
56
+ &--columns-3 {
57
+ position: relative;
58
+ margin-bottom: govuk-spacing(1);
59
+
60
+ &::before {
61
+ content: "";
62
+ position: absolute;
63
+ top: 0;
64
+ width: 2px;
65
+ height: 100%;
66
+ background-color: #E9EBED;
67
+ left: 0;
68
+ }
69
+ }
70
+
71
+ &--columns-2 {
72
+ &::after {
73
+ content: "";
74
+ position: absolute;
75
+ top: 0;
76
+ width: 2px;
77
+ height: 100%;
78
+ background-color: #E9EBED;
79
+ left: 50%;
80
+ }
81
+
82
+ .hods-form-summary-card-details__field {
83
+ flex: 0 0 calc(50% - 10px);
84
+ }
85
+ }
86
+
87
+ &--columns-3 {
88
+ &::after {
89
+ content: "";
90
+ position: absolute;
91
+ top: 0;
92
+ left: 33.333%;
93
+ width: 2px;
94
+ height: 100%;
95
+ background-color: #E9EBED;
96
+ }
97
+
98
+ .hods-form-summary-card-details__field {
99
+ flex: 0 0 calc(33.333% - 10px);
100
+
101
+ &:nth-child(2)::after {
102
+ content: "";
103
+ position: absolute;
104
+ top: 0;
105
+ right: 33.333%;
106
+ width: 2px;
107
+ height: 100%;
108
+ background-color: #E9EBED;
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ @media (max-width: 640px) {
117
+ .hods-form-summary-card-details {
118
+ &__section {
119
+ &-content {
120
+ display: block;
121
+
122
+ .hods-form-summary-card-details__field {
123
+ width: 100%;
124
+ }
125
+
126
+ .hods-form-summary-card-details__field:nth-child(2)::after {
127
+ display: none;
128
+ }
129
+
130
+ &--columns-2,
131
+ &--columns-3 {
132
+ position: relative;
133
+ margin-bottom: govuk-spacing(1);
134
+
135
+ &::before {
136
+ content: '';
137
+ position: absolute;
138
+ top: 0;
139
+ width: 2px;
140
+ height: 100%;
141
+ background-color: #A9A9A9;
142
+ left: 0;
143
+ }
144
+
145
+ &::after {
146
+ display: none;
147
+ }
148
+ }
149
+
150
+ &--columns-3 {
151
+ .hods-form-summary-card-details__field:nth-child(2)::after {
152
+ content: none;
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
@@ -0,0 +1,319 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+ var _copReactComponents = require("@ukhomeoffice/cop-react-components");
5
+ var _setupTests = require("../../setupTests");
6
+ var _SummaryCardDetails = _interopRequireWildcard(require("./SummaryCardDetails"));
7
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
8
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // Global imports.
16
+ // Local imports.
17
+ describe('components.CollectionSummary.SummaryCardDetails', function () {
18
+ var classes = _copReactComponents.Utils.classBuilder(_SummaryCardDetails.DEFAULT_CLASS, [], '');
19
+ var ENTRY = {
20
+ id: '001',
21
+ bannerText: 'A banner',
22
+ titleText: 'A title',
23
+ detailsText: 'Some details',
24
+ index: 0,
25
+ summaryText: 'Full details',
26
+ childCollection: [{
27
+ id: '001',
28
+ childField1: 'alpha',
29
+ childField2: 'bravo'
30
+ }, {
31
+ id: '002',
32
+ childField1: 'alpha',
33
+ childField2: 'bravo'
34
+ }]
35
+ };
36
+ it('should render sections and fields based on summaryLayout config', function () {
37
+ var CHILD_PAGES = [{
38
+ summaryLayout: {
39
+ sections: [{
40
+ title: 'Section 1',
41
+ columns: 2,
42
+ fields: ['fieldA', 'fieldB']
43
+ }, {
44
+ title: 'Section 2',
45
+ columns: 1,
46
+ fields: ['fieldC']
47
+ }]
48
+ },
49
+ components: [{
50
+ fieldId: 'fieldA'
51
+ }, {
52
+ fieldId: 'fieldB'
53
+ }, {
54
+ fieldId: 'fieldC'
55
+ }]
56
+ }];
57
+ var MASTER_PAGE = {
58
+ childPages: CHILD_PAGES
59
+ };
60
+ var _renderWithValidation = (0, _setupTests.renderWithValidation)( /*#__PURE__*/_react.default.createElement(_SummaryCardDetails.default, {
61
+ masterPage: MASTER_PAGE,
62
+ childMasterPages: [],
63
+ formData: {},
64
+ entryData: ENTRY
65
+ })),
66
+ container = _renderWithValidation.container;
67
+
68
+ // Function to find an element by its text content
69
+ function getByTextContent(parent, text) {
70
+ return Array.from(parent.getElementsByClassName(classes('section-title'))).find(function (el) {
71
+ return el.textContent === text;
72
+ });
73
+ }
74
+
75
+ // Check for section titles
76
+ var section1Title = getByTextContent(container, 'Section 1');
77
+ var section2Title = getByTextContent(container, 'Section 2');
78
+ expect(section1Title).not.toBeUndefined();
79
+ expect(section2Title).not.toBeUndefined();
80
+ var section1Content = section1Title.parentNode.querySelector(".".concat(classes('section-content')));
81
+ expect(section1Content.querySelectorAll(".".concat(classes('field'))).length).toEqual(2);
82
+ var section2Content = section2Title.parentNode.querySelector(".".concat(classes('section-content')));
83
+ expect(section2Content.querySelectorAll(".".concat(classes('field'))).length).toEqual(1);
84
+ });
85
+ it('should render sections if they have show_when checks and pass them', function () {
86
+ var CHILD_PAGES = [{
87
+ summaryLayout: {
88
+ sections: [{
89
+ title: 'Section 1',
90
+ columns: 2,
91
+ fields: ['fieldA', 'fieldB'],
92
+ show_when: [{
93
+ field: 'showSection1',
94
+ op: "=",
95
+ value: true
96
+ }]
97
+ }, {
98
+ title: 'Section 2',
99
+ columns: 1,
100
+ fields: ['fieldC']
101
+ }]
102
+ },
103
+ components: [{
104
+ fieldId: 'fieldA'
105
+ }, {
106
+ fieldId: 'fieldB'
107
+ }, {
108
+ fieldId: 'fieldC'
109
+ }]
110
+ }];
111
+ var MASTER_PAGE = {
112
+ childPages: CHILD_PAGES
113
+ };
114
+ var CUSTOM_ENTRY = _objectSpread(_objectSpread({}, ENTRY), {}, {
115
+ showSection1: true
116
+ });
117
+ var _renderWithValidation2 = (0, _setupTests.renderWithValidation)( /*#__PURE__*/_react.default.createElement(_SummaryCardDetails.default, {
118
+ masterPage: MASTER_PAGE,
119
+ childMasterPages: [],
120
+ formData: {},
121
+ entryData: CUSTOM_ENTRY
122
+ })),
123
+ container = _renderWithValidation2.container;
124
+
125
+ // Function to find an element by its text content
126
+ function getByTextContent(parent, text) {
127
+ return Array.from(parent.getElementsByClassName(classes('section-title'))).find(function (el) {
128
+ return el.textContent === text;
129
+ });
130
+ }
131
+
132
+ // Check for section titles
133
+ var section1Title = getByTextContent(container, 'Section 1');
134
+ var section2Title = getByTextContent(container, 'Section 2');
135
+ expect(section1Title).not.toBeUndefined();
136
+ expect(section2Title).not.toBeUndefined();
137
+ var section1Content = section1Title.parentNode.querySelector(".".concat(classes('section-content')));
138
+ expect(section1Content.querySelectorAll(".".concat(classes('field'))).length).toEqual(2);
139
+ var section2Content = section2Title.parentNode.querySelector(".".concat(classes('section-content')));
140
+ expect(section2Content.querySelectorAll(".".concat(classes('field'))).length).toEqual(1);
141
+ });
142
+ it('should not render sections if they have show_when checks and fail them', function () {
143
+ var CHILD_PAGES = [{
144
+ summaryLayout: {
145
+ sections: [{
146
+ title: 'Section 1',
147
+ columns: 2,
148
+ fields: ['fieldA', 'fieldB'],
149
+ show_when: [{
150
+ field: 'showSection1',
151
+ op: "=",
152
+ value: true
153
+ }]
154
+ }, {
155
+ title: 'Section 2',
156
+ columns: 1,
157
+ fields: ['fieldC']
158
+ }]
159
+ },
160
+ components: [{
161
+ fieldId: 'fieldA'
162
+ }, {
163
+ fieldId: 'fieldB'
164
+ }, {
165
+ fieldId: 'fieldC'
166
+ }]
167
+ }];
168
+ var MASTER_PAGE = {
169
+ childPages: CHILD_PAGES
170
+ };
171
+ var CUSTOM_ENTRY = _objectSpread(_objectSpread({}, ENTRY), {}, {
172
+ showSection1: false
173
+ });
174
+ var _renderWithValidation3 = (0, _setupTests.renderWithValidation)( /*#__PURE__*/_react.default.createElement(_SummaryCardDetails.default, {
175
+ masterPage: MASTER_PAGE,
176
+ childMasterPages: [],
177
+ formData: {},
178
+ entryData: CUSTOM_ENTRY
179
+ })),
180
+ container = _renderWithValidation3.container;
181
+
182
+ // Function to find an element by its text content
183
+ function getByTextContent(parent, text) {
184
+ return Array.from(parent.getElementsByClassName(classes('section-title'))).find(function (el) {
185
+ return el.textContent === text;
186
+ });
187
+ }
188
+
189
+ // Check for section titles
190
+ var section1Title = getByTextContent(container, 'Section 1');
191
+ var section2Title = getByTextContent(container, 'Section 2');
192
+ expect(section1Title).toBeUndefined();
193
+ expect(section2Title).not.toBeUndefined();
194
+ var section2Content = section2Title.parentNode.querySelector(".".concat(classes('section-content')));
195
+ expect(section2Content.querySelectorAll(".".concat(classes('field'))).length).toEqual(1);
196
+ });
197
+ it('should not render sections on pages that fail show_when checks', function () {
198
+ var CHILD_PAGES = [{
199
+ show_when: [{
200
+ field: 'testField',
201
+ op: '=',
202
+ value: true
203
+ }],
204
+ summaryLayout: {
205
+ sections: [{
206
+ title: 'Section 1',
207
+ columns: 2,
208
+ fields: ['fieldA', 'fieldB'],
209
+ show_when: [{
210
+ field: 'showSection1',
211
+ op: "=",
212
+ value: true
213
+ }]
214
+ }, {
215
+ title: 'Section 2',
216
+ columns: 1,
217
+ fields: ['fieldC']
218
+ }]
219
+ },
220
+ components: [{
221
+ fieldId: 'fieldA'
222
+ }, {
223
+ fieldId: 'fieldB'
224
+ }, {
225
+ fieldId: 'fieldC'
226
+ }]
227
+ }];
228
+ var MASTER_PAGE = {
229
+ childPages: CHILD_PAGES
230
+ };
231
+ var CUSTOM_ENTRY = _objectSpread(_objectSpread({}, ENTRY), {}, {
232
+ showSection1: false
233
+ });
234
+ var _renderWithValidation4 = (0, _setupTests.renderWithValidation)( /*#__PURE__*/_react.default.createElement(_SummaryCardDetails.default, {
235
+ masterPage: MASTER_PAGE,
236
+ childMasterPages: [],
237
+ formData: {
238
+ testField: false
239
+ },
240
+ entryData: CUSTOM_ENTRY
241
+ })),
242
+ container = _renderWithValidation4.container;
243
+
244
+ // Function to find an element by its text content
245
+ function getByTextContent(parent, text) {
246
+ return Array.from(parent.getElementsByClassName(classes('section-title'))).find(function (el) {
247
+ return el.textContent === text;
248
+ });
249
+ }
250
+
251
+ // Check for section titles
252
+ var section1Title = getByTextContent(container, 'Section 1');
253
+ var section2Title = getByTextContent(container, 'Section 2');
254
+ expect(section1Title).toBeUndefined();
255
+ expect(section2Title).toBeUndefined();
256
+ });
257
+ it('should render child collections', function () {
258
+ var CHILD_MASTER_PAGES = [{
259
+ collection: {
260
+ name: 'childCollection'
261
+ },
262
+ childPages: [{
263
+ components: [{
264
+ fieldId: 'childField1'
265
+ }, {
266
+ fieldId: 'childField2'
267
+ }],
268
+ summaryLayout: {
269
+ sections: [{
270
+ title: 'Hidden Title',
271
+ columns: 2,
272
+ fields: ['childfield1', 'childfield2']
273
+ }]
274
+ }
275
+ }]
276
+ }];
277
+ var CHILD_PAGES = [{
278
+ summaryLayout: {
279
+ sections: [{
280
+ type: 'childCollection',
281
+ collectionName: 'childCollection',
282
+ title: 'Children'
283
+ }]
284
+ },
285
+ components: [{
286
+ fieldId: 'fieldA'
287
+ }, {
288
+ fieldId: 'fieldB'
289
+ }, {
290
+ fieldId: 'fieldC'
291
+ }]
292
+ }];
293
+ var MASTER_PAGE = {
294
+ childPages: [].concat(CHILD_PAGES, CHILD_MASTER_PAGES)
295
+ };
296
+ var CHILD_COLLECTIONS = ['childCollection'];
297
+ var _renderWithValidation5 = (0, _setupTests.renderWithValidation)( /*#__PURE__*/_react.default.createElement(_SummaryCardDetails.default, {
298
+ masterPage: MASTER_PAGE,
299
+ childCollections: CHILD_COLLECTIONS,
300
+ formData: {},
301
+ entryData: ENTRY
302
+ })),
303
+ container = _renderWithValidation5.container;
304
+
305
+ // Function to find an element by its text content
306
+ function getByTextContent(parent, text) {
307
+ return Array.from(parent.getElementsByClassName(classes('section-title'))).find(function (el) {
308
+ return el.textContent === text;
309
+ });
310
+ }
311
+ var childCollectionSectionTitle = getByTextContent(container, 'Children');
312
+ expect(childCollectionSectionTitle).not.toBeUndefined();
313
+ var childSectionTitles = getByTextContent(container, 'Hidden Title');
314
+ expect(childSectionTitles).toBeUndefined(); // Individual section title for child collections should be hidden.
315
+
316
+ var childFields = container.querySelectorAll(".".concat(classes('field')));
317
+ expect(childFields.length).toEqual(4); // Two for each entry in the child collection.
318
+ });
319
+ });
@@ -0,0 +1,61 @@
1
+ {
2
+ "components": [
3
+ {
4
+ "id": "componentA",
5
+ "type": "radios",
6
+ "label": "Field A",
7
+ "fieldId": "fieldA",
8
+ "required": true
9
+ },
10
+ {
11
+ "id": "componentB",
12
+ "type": "collection",
13
+ "label": "Component B",
14
+ "fieldId": "componentB"
15
+ }
16
+ ],
17
+ "pages": [
18
+ {
19
+ "id": "pageA",
20
+ "show_when": {
21
+ "op": "=",
22
+ "field": "componentA",
23
+ "value": "hide"
24
+ },
25
+ "components": [
26
+ {
27
+ "id": "componentB",
28
+ "use": "componentB"
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "id": "pageB",
34
+ "show_when": {
35
+ "op": "=",
36
+ "field": "componentA",
37
+ "value": "show"
38
+ },
39
+ "components": [
40
+ {
41
+ "id": "componentB",
42
+ "use": "componentB"
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ "id": "pageC",
48
+ "show_when": {
49
+ "op": "=",
50
+ "field": "componentA",
51
+ "value": "hide"
52
+ },
53
+ "components": [
54
+ {
55
+ "id": "componentB",
56
+ "use": "componentB"
57
+ }
58
+ ]
59
+ }
60
+ ]
61
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "componentA": "false",
3
+ "componentAs": [{}]
4
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "componentA": "false",
3
+ "componentAs": [
4
+ {
5
+ "itemCategory": "1111111111"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "componentA": "show",
3
+ "componentB": "hide if component A is anything other than show",
4
+ "componentC": "hide if component A is anything other than show"
5
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "type": "Example form",
3
+ "alpha": "alpha",
4
+ "bravo": "bravo",
5
+ "person": {
6
+ "charlie": "Smith"
7
+ },
8
+ "gamma": "gamma",
9
+ "epsilon": "epsilon"
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "type": "Example form",
3
+ "alpha": "alpha",
4
+ "bravo": "bravo",
5
+ "person": {
6
+ "charlie": "Smith",
7
+ "delta":"Acme Inc"
8
+ },
9
+ "gamma": "gamma",
10
+ "epsilon": "epsilon"
11
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "id": "example-form",
3
+ "version": "0.0.1",
4
+ "name": "example-form",
5
+ "title": "Example form",
6
+ "type": "form",
7
+ "components": [
8
+ {
9
+ "id": "alpha",
10
+ "fieldId": "alpha",
11
+ "label": "Alpha",
12
+ "type": "text"
13
+ },
14
+ {
15
+ "id": "bravo",
16
+ "fieldId": "bravo",
17
+ "label": "Bravo",
18
+ "type": "text"
19
+ },
20
+ {
21
+ "id": "person",
22
+ "fieldId": "person",
23
+ "type": "container",
24
+ "components": [
25
+ {
26
+ "id": "charlie",
27
+ "fieldId": "charlie",
28
+ "label": "Charlie",
29
+ "type": "text",
30
+ "show_when": {
31
+ "op": "=",
32
+ "field": "bravo",
33
+ "value": "bravo"
34
+ }
35
+ },
36
+ {
37
+ "id": "delta",
38
+ "fieldId": "delta",
39
+ "label": "Delta",
40
+ "type": "text",
41
+ "show_when": {
42
+ "op": "=",
43
+ "field": "bravo",
44
+ "value": "another"
45
+ }
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "id": "gamma",
51
+ "fieldId": "gamma",
52
+ "label": "Gamma",
53
+ "type": "text"
54
+ },
55
+ {
56
+ "id": "epsilon",
57
+ "fieldId": "epsilon",
58
+ "label": "Epsilon",
59
+ "type": "text"
60
+ }
61
+ ],
62
+ "pages": [
63
+ {
64
+ "id": "general",
65
+ "name": "general",
66
+ "title": "General information",
67
+ "components": [
68
+ {
69
+ "use": "alpha"
70
+ },
71
+ {
72
+ "use": "bravo"
73
+ },
74
+ {
75
+ "use": "person"
76
+ },
77
+ {
78
+ "use": "gamma"
79
+ },
80
+ {
81
+ "use": "epsilon"
82
+ }
83
+ ],
84
+ "actions": [
85
+ "submit",
86
+ {
87
+ "type": "cancel",
88
+ "page": "",
89
+ "validate": false,
90
+ "classModifiers": "secondary",
91
+ "label": "Cancel"
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ }