@genesislcap/foundation-forms 14.363.0 → 14.364.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.
@@ -75,6 +75,16 @@
75
75
  "description": "When enabled, adds an APPROVAL_MESSAGE field to the form schema.\nThis field will be sent at root level alongside DETAILS when submitting.",
76
76
  "privacy": "public"
77
77
  },
78
+ {
79
+ "kind": "field",
80
+ "name": "approvalMessageLabel",
81
+ "type": {
82
+ "text": "string"
83
+ },
84
+ "default": "'Approval Message'",
85
+ "description": "Label for the approval message field in the approval dialog.",
86
+ "privacy": "public"
87
+ },
78
88
  {
79
89
  "kind": "field",
80
90
  "name": "uischema",
@@ -405,6 +415,15 @@
405
415
  "description": "When enabled, adds an APPROVAL_MESSAGE field to the form schema.\nThis field will be sent at root level alongside DETAILS when submitting.",
406
416
  "fieldName": "setApprovalMessage"
407
417
  },
418
+ {
419
+ "name": "approval-message-label",
420
+ "type": {
421
+ "text": "string"
422
+ },
423
+ "default": "'Approval Message'",
424
+ "description": "Label for the approval message field in the approval dialog.",
425
+ "fieldName": "approvalMessageLabel"
426
+ },
408
427
  {
409
428
  "type": {
410
429
  "text": "boolean"
@@ -1416,232 +1435,6 @@
1416
1435
  }
1417
1436
  ]
1418
1437
  },
1419
- {
1420
- "kind": "javascript-module",
1421
- "path": "src/jsonforms/testers/isArray.ts",
1422
- "declarations": [
1423
- {
1424
- "kind": "function",
1425
- "name": "isArray",
1426
- "parameters": [
1427
- {
1428
- "name": "itemsType",
1429
- "type": {
1430
- "text": "ArrayItemsType"
1431
- }
1432
- }
1433
- ]
1434
- }
1435
- ],
1436
- "exports": [
1437
- {
1438
- "kind": "js",
1439
- "name": "isArray",
1440
- "declaration": {
1441
- "name": "isArray",
1442
- "module": "src/jsonforms/testers/isArray.ts"
1443
- }
1444
- }
1445
- ]
1446
- },
1447
- {
1448
- "kind": "javascript-module",
1449
- "path": "src/jsonforms/testers/isDate.ts",
1450
- "declarations": [
1451
- {
1452
- "kind": "variable",
1453
- "name": "isOneOfDate"
1454
- }
1455
- ],
1456
- "exports": [
1457
- {
1458
- "kind": "js",
1459
- "name": "isOneOfDate",
1460
- "declaration": {
1461
- "name": "isOneOfDate",
1462
- "module": "src/jsonforms/testers/isDate.ts"
1463
- }
1464
- }
1465
- ]
1466
- },
1467
- {
1468
- "kind": "javascript-module",
1469
- "path": "src/jsonforms/testers/isInvisible.ts",
1470
- "declarations": [
1471
- {
1472
- "kind": "function",
1473
- "name": "isInvisible",
1474
- "return": {
1475
- "type": {
1476
- "text": "boolean"
1477
- }
1478
- },
1479
- "parameters": [
1480
- {
1481
- "name": "uischema",
1482
- "type": {
1483
- "text": "UISchemaElement"
1484
- }
1485
- },
1486
- {
1487
- "name": "schema",
1488
- "type": {
1489
- "text": "JsonSchema"
1490
- }
1491
- },
1492
- {
1493
- "name": "context",
1494
- "type": {
1495
- "text": "TesterContext"
1496
- }
1497
- }
1498
- ]
1499
- }
1500
- ],
1501
- "exports": [
1502
- {
1503
- "kind": "js",
1504
- "name": "isInvisible",
1505
- "declaration": {
1506
- "name": "isInvisible",
1507
- "module": "src/jsonforms/testers/isInvisible.ts"
1508
- }
1509
- }
1510
- ]
1511
- },
1512
- {
1513
- "kind": "javascript-module",
1514
- "path": "src/jsonforms/testers/isOneOfBoolean.ts",
1515
- "declarations": [
1516
- {
1517
- "kind": "variable",
1518
- "name": "isOneOfBoolean"
1519
- }
1520
- ],
1521
- "exports": [
1522
- {
1523
- "kind": "js",
1524
- "name": "isOneOfBoolean",
1525
- "declaration": {
1526
- "name": "isOneOfBoolean",
1527
- "module": "src/jsonforms/testers/isOneOfBoolean.ts"
1528
- }
1529
- }
1530
- ]
1531
- },
1532
- {
1533
- "kind": "javascript-module",
1534
- "path": "src/jsonforms/testers/isOneOfEnum.ts",
1535
- "declarations": [
1536
- {
1537
- "kind": "variable",
1538
- "name": "isOneOfEnum"
1539
- }
1540
- ],
1541
- "exports": [
1542
- {
1543
- "kind": "js",
1544
- "name": "isOneOfEnum",
1545
- "declaration": {
1546
- "name": "isOneOfEnum",
1547
- "module": "src/jsonforms/testers/isOneOfEnum.ts"
1548
- }
1549
- }
1550
- ]
1551
- },
1552
- {
1553
- "kind": "javascript-module",
1554
- "path": "src/jsonforms/testers/isOneOfNumber.ts",
1555
- "declarations": [
1556
- {
1557
- "kind": "variable",
1558
- "name": "isOneOfNumber"
1559
- }
1560
- ],
1561
- "exports": [
1562
- {
1563
- "kind": "js",
1564
- "name": "isOneOfNumber",
1565
- "declaration": {
1566
- "name": "isOneOfNumber",
1567
- "module": "src/jsonforms/testers/isOneOfNumber.ts"
1568
- }
1569
- }
1570
- ]
1571
- },
1572
- {
1573
- "kind": "javascript-module",
1574
- "path": "src/jsonforms/testers/isOneOfOptionMultiselect.ts",
1575
- "declarations": [
1576
- {
1577
- "kind": "variable",
1578
- "name": "isOneOfOptionMultiselect"
1579
- }
1580
- ],
1581
- "exports": [
1582
- {
1583
- "kind": "js",
1584
- "name": "isOneOfOptionMultiselect",
1585
- "declaration": {
1586
- "name": "isOneOfOptionMultiselect",
1587
- "module": "src/jsonforms/testers/isOneOfOptionMultiselect.ts"
1588
- }
1589
- }
1590
- ]
1591
- },
1592
- {
1593
- "kind": "javascript-module",
1594
- "path": "src/jsonforms/testers/isTime.ts",
1595
- "declarations": [
1596
- {
1597
- "kind": "variable",
1598
- "name": "isOneOfTime"
1599
- }
1600
- ],
1601
- "exports": [
1602
- {
1603
- "kind": "js",
1604
- "name": "isOneOfTime",
1605
- "declaration": {
1606
- "name": "isOneOfTime",
1607
- "module": "src/jsonforms/testers/isTime.ts"
1608
- }
1609
- }
1610
- ]
1611
- },
1612
- {
1613
- "kind": "javascript-module",
1614
- "path": "src/jsonforms/testers/optionIs.ts",
1615
- "declarations": [
1616
- {
1617
- "kind": "function",
1618
- "name": "optionIs",
1619
- "return": {
1620
- "type": {
1621
- "text": "Tester"
1622
- }
1623
- },
1624
- "parameters": [
1625
- {
1626
- "name": "optionName",
1627
- "type": {
1628
- "text": "string"
1629
- }
1630
- }
1631
- ]
1632
- }
1633
- ],
1634
- "exports": [
1635
- {
1636
- "kind": "js",
1637
- "name": "optionIs",
1638
- "declaration": {
1639
- "name": "optionIs",
1640
- "module": "src/jsonforms/testers/optionIs.ts"
1641
- }
1642
- }
1643
- ]
1644
- },
1645
1438
  {
1646
1439
  "kind": "javascript-module",
1647
1440
  "path": "src/jsonforms/renderers/ArrayListWrapperRenderer.ts",
@@ -3332,6 +3125,232 @@
3332
3125
  }
3333
3126
  }
3334
3127
  ]
3128
+ },
3129
+ {
3130
+ "kind": "javascript-module",
3131
+ "path": "src/jsonforms/testers/isArray.ts",
3132
+ "declarations": [
3133
+ {
3134
+ "kind": "function",
3135
+ "name": "isArray",
3136
+ "parameters": [
3137
+ {
3138
+ "name": "itemsType",
3139
+ "type": {
3140
+ "text": "ArrayItemsType"
3141
+ }
3142
+ }
3143
+ ]
3144
+ }
3145
+ ],
3146
+ "exports": [
3147
+ {
3148
+ "kind": "js",
3149
+ "name": "isArray",
3150
+ "declaration": {
3151
+ "name": "isArray",
3152
+ "module": "src/jsonforms/testers/isArray.ts"
3153
+ }
3154
+ }
3155
+ ]
3156
+ },
3157
+ {
3158
+ "kind": "javascript-module",
3159
+ "path": "src/jsonforms/testers/isDate.ts",
3160
+ "declarations": [
3161
+ {
3162
+ "kind": "variable",
3163
+ "name": "isOneOfDate"
3164
+ }
3165
+ ],
3166
+ "exports": [
3167
+ {
3168
+ "kind": "js",
3169
+ "name": "isOneOfDate",
3170
+ "declaration": {
3171
+ "name": "isOneOfDate",
3172
+ "module": "src/jsonforms/testers/isDate.ts"
3173
+ }
3174
+ }
3175
+ ]
3176
+ },
3177
+ {
3178
+ "kind": "javascript-module",
3179
+ "path": "src/jsonforms/testers/isInvisible.ts",
3180
+ "declarations": [
3181
+ {
3182
+ "kind": "function",
3183
+ "name": "isInvisible",
3184
+ "return": {
3185
+ "type": {
3186
+ "text": "boolean"
3187
+ }
3188
+ },
3189
+ "parameters": [
3190
+ {
3191
+ "name": "uischema",
3192
+ "type": {
3193
+ "text": "UISchemaElement"
3194
+ }
3195
+ },
3196
+ {
3197
+ "name": "schema",
3198
+ "type": {
3199
+ "text": "JsonSchema"
3200
+ }
3201
+ },
3202
+ {
3203
+ "name": "context",
3204
+ "type": {
3205
+ "text": "TesterContext"
3206
+ }
3207
+ }
3208
+ ]
3209
+ }
3210
+ ],
3211
+ "exports": [
3212
+ {
3213
+ "kind": "js",
3214
+ "name": "isInvisible",
3215
+ "declaration": {
3216
+ "name": "isInvisible",
3217
+ "module": "src/jsonforms/testers/isInvisible.ts"
3218
+ }
3219
+ }
3220
+ ]
3221
+ },
3222
+ {
3223
+ "kind": "javascript-module",
3224
+ "path": "src/jsonforms/testers/isOneOfBoolean.ts",
3225
+ "declarations": [
3226
+ {
3227
+ "kind": "variable",
3228
+ "name": "isOneOfBoolean"
3229
+ }
3230
+ ],
3231
+ "exports": [
3232
+ {
3233
+ "kind": "js",
3234
+ "name": "isOneOfBoolean",
3235
+ "declaration": {
3236
+ "name": "isOneOfBoolean",
3237
+ "module": "src/jsonforms/testers/isOneOfBoolean.ts"
3238
+ }
3239
+ }
3240
+ ]
3241
+ },
3242
+ {
3243
+ "kind": "javascript-module",
3244
+ "path": "src/jsonforms/testers/isOneOfEnum.ts",
3245
+ "declarations": [
3246
+ {
3247
+ "kind": "variable",
3248
+ "name": "isOneOfEnum"
3249
+ }
3250
+ ],
3251
+ "exports": [
3252
+ {
3253
+ "kind": "js",
3254
+ "name": "isOneOfEnum",
3255
+ "declaration": {
3256
+ "name": "isOneOfEnum",
3257
+ "module": "src/jsonforms/testers/isOneOfEnum.ts"
3258
+ }
3259
+ }
3260
+ ]
3261
+ },
3262
+ {
3263
+ "kind": "javascript-module",
3264
+ "path": "src/jsonforms/testers/isOneOfNumber.ts",
3265
+ "declarations": [
3266
+ {
3267
+ "kind": "variable",
3268
+ "name": "isOneOfNumber"
3269
+ }
3270
+ ],
3271
+ "exports": [
3272
+ {
3273
+ "kind": "js",
3274
+ "name": "isOneOfNumber",
3275
+ "declaration": {
3276
+ "name": "isOneOfNumber",
3277
+ "module": "src/jsonforms/testers/isOneOfNumber.ts"
3278
+ }
3279
+ }
3280
+ ]
3281
+ },
3282
+ {
3283
+ "kind": "javascript-module",
3284
+ "path": "src/jsonforms/testers/isOneOfOptionMultiselect.ts",
3285
+ "declarations": [
3286
+ {
3287
+ "kind": "variable",
3288
+ "name": "isOneOfOptionMultiselect"
3289
+ }
3290
+ ],
3291
+ "exports": [
3292
+ {
3293
+ "kind": "js",
3294
+ "name": "isOneOfOptionMultiselect",
3295
+ "declaration": {
3296
+ "name": "isOneOfOptionMultiselect",
3297
+ "module": "src/jsonforms/testers/isOneOfOptionMultiselect.ts"
3298
+ }
3299
+ }
3300
+ ]
3301
+ },
3302
+ {
3303
+ "kind": "javascript-module",
3304
+ "path": "src/jsonforms/testers/isTime.ts",
3305
+ "declarations": [
3306
+ {
3307
+ "kind": "variable",
3308
+ "name": "isOneOfTime"
3309
+ }
3310
+ ],
3311
+ "exports": [
3312
+ {
3313
+ "kind": "js",
3314
+ "name": "isOneOfTime",
3315
+ "declaration": {
3316
+ "name": "isOneOfTime",
3317
+ "module": "src/jsonforms/testers/isTime.ts"
3318
+ }
3319
+ }
3320
+ ]
3321
+ },
3322
+ {
3323
+ "kind": "javascript-module",
3324
+ "path": "src/jsonforms/testers/optionIs.ts",
3325
+ "declarations": [
3326
+ {
3327
+ "kind": "function",
3328
+ "name": "optionIs",
3329
+ "return": {
3330
+ "type": {
3331
+ "text": "Tester"
3332
+ }
3333
+ },
3334
+ "parameters": [
3335
+ {
3336
+ "name": "optionName",
3337
+ "type": {
3338
+ "text": "string"
3339
+ }
3340
+ }
3341
+ ]
3342
+ }
3343
+ ],
3344
+ "exports": [
3345
+ {
3346
+ "kind": "js",
3347
+ "name": "optionIs",
3348
+ "declaration": {
3349
+ "name": "optionIs",
3350
+ "module": "src/jsonforms/testers/optionIs.ts"
3351
+ }
3352
+ }
3353
+ ]
3335
3354
  }
3336
3355
  ]
3337
3356
  }
@@ -117,10 +117,7 @@ declare const Form_base: (new (...args: any[]) => {
117
117
  removeAttribute(qualifiedName: string): void;
118
118
  removeAttributeNS(namespace: string | null, localName: string): void;
119
119
  removeAttributeNode(attr: Attr): Attr;
120
- requestFullscreen(options? /**
121
- * Builds the commit payload for the form submission.
122
- * @internal
123
- */: FullscreenOptions): Promise<void>;
120
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
124
121
  requestPointerLock(options?: PointerLockOptions): Promise<void>;
125
122
  scroll(options?: ScrollToOptions): void;
126
123
  scroll(x: number, y: number): void;
@@ -406,6 +403,26 @@ export declare class Form extends Form_base {
406
403
  * @public
407
404
  */
408
405
  setApprovalMessage: boolean;
406
+ /**
407
+ * Label for the approval message field in the approval dialog.
408
+ * @public
409
+ */
410
+ approvalMessageLabel: string;
411
+ /**
412
+ * Reference to the approval message modal element.
413
+ * @internal
414
+ */
415
+ approvalModal: any;
416
+ /**
417
+ * Stores the approval message entered by the user.
418
+ * @internal
419
+ */
420
+ approvalMessage: string;
421
+ /**
422
+ * Stores the original payload for retry after approval message is provided.
423
+ * @internal
424
+ */
425
+ private pendingPayload;
409
426
  /**
410
427
  * UI schema used to define configuration of the layout and elements in the form
411
428
  * Check {@link UiSchema} for possible options
@@ -539,6 +556,21 @@ export declare class Form extends Form_base {
539
556
  * @public
540
557
  */
541
558
  reset(clearData?: boolean): void;
559
+ /**
560
+ * Show the approval message modal
561
+ * @internal
562
+ */
563
+ private showApprovalModal;
564
+ /**
565
+ * Close the approval message modal
566
+ * @internal
567
+ */
568
+ closeApprovalModal(): void;
569
+ /**
570
+ * Submit with approval message
571
+ * @internal
572
+ */
573
+ submitWithApproval(): Promise<void>;
542
574
  }
543
575
  export {};
544
576
  //# sourceMappingURL=form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAKA,OA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OAGG;IACH,kBAAkB;IAQlB;;;OAGG;IACG,kBAAkB;CA8BzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"form.styles.d.ts","sourceRoot":"","sources":["../../src/form.styles.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,GAAI,SAAQ,MAAe,WAK7D,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,iDA4DhC,CAAC"}
1
+ {"version":3,"file":"form.styles.d.ts","sourceRoot":"","sources":["../../src/form.styles.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,GAAI,SAAQ,MAAe,WAK7D,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,iDAmEhC,CAAC"}
@@ -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;AAenC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,8DA+BrC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,2DAElC,CAAC"}
1
+ {"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAenC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,8DA4DrC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,2DAElC,CAAC"}
package/dist/esm/form.js CHANGED
@@ -75,6 +75,21 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
75
75
  * @public
76
76
  */
77
77
  this.prefix = 'rapid';
78
+ /**
79
+ * Label for the approval message field in the approval dialog.
80
+ * @public
81
+ */
82
+ this.approvalMessageLabel = 'Approval Message';
83
+ /**
84
+ * Stores the approval message entered by the user.
85
+ * @internal
86
+ */
87
+ this.approvalMessage = '';
88
+ /**
89
+ * Stores the original payload for retry after approval message is provided.
90
+ * @internal
91
+ */
92
+ this.pendingPayload = null;
78
93
  /**
79
94
  * Allows to provide the main set of renderers used by the form. If not provided, the built-in renderers will be used by default.
80
95
  * @public
@@ -170,7 +185,16 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
170
185
  const formSubmitReq = yield this.connect.commitEvent(this.resourceName, commitPayload);
171
186
  this.submitting = false;
172
187
  if (formSubmitReq.ERROR) {
173
- this.$emit('submit-failure', { payload, errors: formSubmitReq.ERROR });
188
+ const approvalError = formSubmitReq.ERROR.find((err) => err.CODE === 'APPROVAL_MESSAGE_MISSING');
189
+ // Only show modal if in REACTIVE mode (setApprovalMessage is false/not set)
190
+ // In proactive mode, the field is already visible, so just emit error normally
191
+ if (approvalError && !this.setApprovalMessage) {
192
+ this.pendingPayload = payload;
193
+ this.showApprovalModal();
194
+ }
195
+ else {
196
+ this.$emit('submit-failure', { payload, errors: formSubmitReq.ERROR });
197
+ }
174
198
  }
175
199
  else {
176
200
  this.$emit('submit-success', { payload, response: formSubmitReq });
@@ -251,6 +275,59 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
251
275
  this.data = {};
252
276
  }
253
277
  }
278
+ /**
279
+ * Show the approval message modal
280
+ * @internal
281
+ */
282
+ showApprovalModal() {
283
+ this.approvalMessage = '';
284
+ if (this.approvalModal) {
285
+ this.approvalModal.show();
286
+ }
287
+ }
288
+ /**
289
+ * Close the approval message modal
290
+ * @internal
291
+ */
292
+ closeApprovalModal() {
293
+ this.approvalMessage = '';
294
+ this.pendingPayload = null;
295
+ if (this.approvalModal) {
296
+ this.approvalModal.close();
297
+ }
298
+ }
299
+ /**
300
+ * Submit with approval message
301
+ * @internal
302
+ */
303
+ submitWithApproval() {
304
+ return __awaiter(this, void 0, void 0, function* () {
305
+ if (!this.approvalMessage || !this.approvalMessage.trim()) {
306
+ logger.warn('Approval message is required');
307
+ return;
308
+ }
309
+ if (!this.pendingPayload) {
310
+ logger.error('No pending payload to submit');
311
+ this.closeApprovalModal();
312
+ return;
313
+ }
314
+ this.submitting = true;
315
+ const commitPayload = {
316
+ DETAILS: this.pendingPayload,
317
+ APPROVAL_MESSAGE: this.approvalMessage,
318
+ };
319
+ const formSubmitReq = yield this.connect.commitEvent(this.resourceName, commitPayload);
320
+ this.submitting = false;
321
+ if (formSubmitReq.ERROR) {
322
+ this.$emit('submit-failure', { payload: this.pendingPayload, errors: formSubmitReq.ERROR });
323
+ }
324
+ else {
325
+ this.$emit('submit-success', { payload: this.pendingPayload, response: formSubmitReq });
326
+ this.closeApprovalModal();
327
+ this.pendingPayload = null;
328
+ }
329
+ });
330
+ }
254
331
  };
255
332
  __decorate([
256
333
  attr({ attribute: 'design-system-prefix' })
@@ -264,6 +341,12 @@ __decorate([
264
341
  __decorate([
265
342
  attr({ attribute: 'set-approval-message', mode: 'boolean' })
266
343
  ], Form.prototype, "setApprovalMessage", void 0);
344
+ __decorate([
345
+ attr({ attribute: 'approval-message-label' })
346
+ ], Form.prototype, "approvalMessageLabel", void 0);
347
+ __decorate([
348
+ observable
349
+ ], Form.prototype, "approvalMessage", void 0);
267
350
  __decorate([
268
351
  observable
269
352
  ], Form.prototype, "uischema", void 0);
@@ -59,6 +59,13 @@ export const foundationFormStyles = css `
59
59
  border-bottom: 2px solid red;
60
60
  }
61
61
 
62
+ .approval-message-actions {
63
+ display: flex;
64
+ justify-content: flex-end;
65
+ gap: calc(${designUnit} * 2px);
66
+ margin-top: calc(${designUnit} * 2px);
67
+ }
68
+
62
69
  .submit-button {
63
70
  width: 70px;
64
71
  margin: 0;
@@ -1,4 +1,5 @@
1
- import { html, when } from '@microsoft/fast-element';
1
+ import { sync } from '@genesislcap/foundation-utils';
2
+ import { html, ref, when } from '@microsoft/fast-element';
2
3
  import { JSONForms } from './jsonforms/json-forms';
3
4
  import { ArrayListWrapper } from './jsonforms/renderers/ArrayListWrapperRenderer';
4
5
  import { CategorizationWrapper } from './jsonforms/renderers/CategorizationWrapperRenderer';
@@ -39,6 +40,35 @@ export const getPrefixedForm = (prefix) => html `
39
40
  </${prefix}-button>
40
41
  </slot>
41
42
  `)}
43
+ <${prefix}-modal
44
+ ${ref('approvalModal')}
45
+ part="approval-modal"
46
+ :onCloseCallback=${(x) => x.closeApprovalModal.bind(x)}
47
+ data-test-id="approval-message-modal"
48
+ >
49
+ <div slot="top">${(x) => x.approvalMessageLabel} (required)</div>
50
+ <div>
51
+ <${prefix}-text-field
52
+ value=${sync((x) => x.approvalMessage, 'string', 'input')}
53
+ placeholder="Enter approval message..."
54
+ ></${prefix}-text-field>
55
+ </div>
56
+ <div slot="bottom" class="approval-message-actions">
57
+ <${prefix}-button
58
+ appearance="neutral"
59
+ @click="${(x) => x.closeApprovalModal()}"
60
+ >
61
+ Cancel
62
+ </${prefix}-button>
63
+ <${prefix}-button
64
+ appearance="accent"
65
+ @click="${(x) => x.submitWithApproval()}"
66
+ ?disabled=${(x) => !x.approvalMessage || !x.approvalMessage.trim()}
67
+ >
68
+ Submit
69
+ </${prefix}-button>
70
+ </div>
71
+ </${prefix}-modal>
42
72
  </template>
43
73
  `;
44
74
  /** @internal */
@@ -1000,6 +1000,36 @@
1000
1000
  "isProtected": false,
1001
1001
  "isAbstract": false
1002
1002
  },
1003
+ {
1004
+ "kind": "Property",
1005
+ "canonicalReference": "@genesislcap/foundation-forms!Form#approvalMessageLabel:member",
1006
+ "docComment": "/**\n * Label for the approval message field in the approval dialog.\n *\n * @public\n */\n",
1007
+ "excerptTokens": [
1008
+ {
1009
+ "kind": "Content",
1010
+ "text": "approvalMessageLabel: "
1011
+ },
1012
+ {
1013
+ "kind": "Content",
1014
+ "text": "string"
1015
+ },
1016
+ {
1017
+ "kind": "Content",
1018
+ "text": ";"
1019
+ }
1020
+ ],
1021
+ "isReadonly": false,
1022
+ "isOptional": false,
1023
+ "releaseTag": "Public",
1024
+ "name": "approvalMessageLabel",
1025
+ "propertyTypeTokenRange": {
1026
+ "startIndex": 1,
1027
+ "endIndex": 2
1028
+ },
1029
+ "isStatic": false,
1030
+ "isProtected": false,
1031
+ "isAbstract": false
1032
+ },
1003
1033
  {
1004
1034
  "kind": "Property",
1005
1035
  "canonicalReference": "@genesislcap/foundation-forms!Form#confirmationMessage:member",
@@ -724,6 +724,26 @@ export declare class Form extends Form_base {
724
724
  * @public
725
725
  */
726
726
  setApprovalMessage: boolean;
727
+ /**
728
+ * Label for the approval message field in the approval dialog.
729
+ * @public
730
+ */
731
+ approvalMessageLabel: string;
732
+ /**
733
+ * Reference to the approval message modal element.
734
+ * @internal
735
+ */
736
+ approvalModal: any;
737
+ /**
738
+ * Stores the approval message entered by the user.
739
+ * @internal
740
+ */
741
+ approvalMessage: string;
742
+ /**
743
+ * Stores the original payload for retry after approval message is provided.
744
+ * @internal
745
+ */
746
+ private pendingPayload;
727
747
  /**
728
748
  * UI schema used to define configuration of the layout and elements in the form
729
749
  * Check {@link UiSchema} for possible options
@@ -857,6 +877,21 @@ export declare class Form extends Form_base {
857
877
  * @public
858
878
  */
859
879
  reset(clearData?: boolean): void;
880
+ /**
881
+ * Show the approval message modal
882
+ * @internal
883
+ */
884
+ private showApprovalModal;
885
+ /**
886
+ * Close the approval message modal
887
+ * @internal
888
+ */
889
+ closeApprovalModal(): void;
890
+ /**
891
+ * Submit with approval message
892
+ * @internal
893
+ */
894
+ submitWithApproval(): Promise<void>;
860
895
  }
861
896
 
862
897
  declare const Form_base: (new (...args: any[]) => {
@@ -970,10 +1005,7 @@ declare const Form_base: (new (...args: any[]) => {
970
1005
  removeAttribute(qualifiedName: string): void;
971
1006
  removeAttributeNS(namespace: string | null, localName: string): void;
972
1007
  removeAttributeNode(attr: Attr): Attr;
973
- requestFullscreen(options? /**
974
- * Builds the commit payload for the form submission.
975
- * @internal
976
- */: FullscreenOptions): Promise<void>;
1008
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
977
1009
  requestPointerLock(options?: PointerLockOptions): Promise<void>;
978
1010
  scroll(options?: ScrollToOptions): void;
979
1011
  scroll(x: number, y: number): void;
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-forms](./foundation-forms.md) &gt; [Form](./foundation-forms.form.md) &gt; [approvalMessageLabel](./foundation-forms.form.approvalmessagelabel.md)
4
+
5
+ ## Form.approvalMessageLabel property
6
+
7
+ Label for the approval message field in the approval dialog.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ approvalMessageLabel: string;
13
+ ```
@@ -54,6 +54,25 @@ Description
54
54
  Allows to provide set of additional renderers used by the form.
55
55
 
56
56
 
57
+ </td></tr>
58
+ <tr><td>
59
+
60
+ [approvalMessageLabel](./foundation-forms.form.approvalmessagelabel.md)
61
+
62
+
63
+ </td><td>
64
+
65
+
66
+ </td><td>
67
+
68
+ string
69
+
70
+
71
+ </td><td>
72
+
73
+ Label for the approval message field in the approval dialog.
74
+
75
+
57
76
  </td></tr>
58
77
  <tr><td>
59
78
 
@@ -131,6 +131,13 @@ export class Form extends Form_base {
131
131
  additionalRenderers: RendererEntry[];
132
132
  // @internal (undocumented)
133
133
  additionalRenderersChanged(): void;
134
+ // @internal
135
+ approvalMessage: string;
136
+ approvalMessageLabel: string;
137
+ // @internal
138
+ approvalModal: any;
139
+ // @internal
140
+ closeApprovalModal(): void;
134
141
  confirmationMessage: string;
135
142
  data: any;
136
143
  // @internal (undocumented)
@@ -161,6 +168,8 @@ export class Form extends Form_base {
161
168
  submitted: boolean;
162
169
  // @internal (undocumented)
163
170
  submitting: boolean;
171
+ // @internal
172
+ submitWithApproval(): Promise<void>;
164
173
  uischema: UiSchema;
165
174
  }
166
175
 
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.363.0",
4
+ "version": "14.364.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -48,22 +48,22 @@
48
48
  }
49
49
  },
50
50
  "devDependencies": {
51
- "@genesislcap/foundation-testing": "14.363.0",
52
- "@genesislcap/genx": "14.363.0",
53
- "@genesislcap/rollup-builder": "14.363.0",
54
- "@genesislcap/ts-builder": "14.363.0",
55
- "@genesislcap/uvu-playwright-builder": "14.363.0",
56
- "@genesislcap/vite-builder": "14.363.0",
57
- "@genesislcap/webpack-builder": "14.363.0",
51
+ "@genesislcap/foundation-testing": "14.364.0",
52
+ "@genesislcap/genx": "14.364.0",
53
+ "@genesislcap/rollup-builder": "14.364.0",
54
+ "@genesislcap/ts-builder": "14.364.0",
55
+ "@genesislcap/uvu-playwright-builder": "14.364.0",
56
+ "@genesislcap/vite-builder": "14.364.0",
57
+ "@genesislcap/webpack-builder": "14.364.0",
58
58
  "@types/json-schema": "^7.0.11"
59
59
  },
60
60
  "dependencies": {
61
- "@genesislcap/foundation-comms": "14.363.0",
62
- "@genesislcap/foundation-criteria": "14.363.0",
63
- "@genesislcap/foundation-logger": "14.363.0",
64
- "@genesislcap/foundation-notifications": "14.363.0",
65
- "@genesislcap/foundation-ui": "14.363.0",
66
- "@genesislcap/foundation-utils": "14.363.0",
61
+ "@genesislcap/foundation-comms": "14.364.0",
62
+ "@genesislcap/foundation-criteria": "14.364.0",
63
+ "@genesislcap/foundation-logger": "14.364.0",
64
+ "@genesislcap/foundation-notifications": "14.364.0",
65
+ "@genesislcap/foundation-ui": "14.364.0",
66
+ "@genesislcap/foundation-utils": "14.364.0",
67
67
  "@json-schema-tools/dereferencer": "^1.6.1",
68
68
  "@jsonforms/core": "^3.2.1",
69
69
  "@microsoft/fast-components": "2.30.6",
@@ -84,5 +84,5 @@
84
84
  "access": "public"
85
85
  },
86
86
  "customElements": "dist/custom-elements.json",
87
- "gitHead": "40c64eb7db47bb801edd34ec3ae5e4c726afe40a"
87
+ "gitHead": "a37dabc49e6a5e2bea7ea0047c9494d37cef2d95"
88
88
  }