@genesislcap/foundation-forms 14.116.1 → 14.117.1-alpha-7cac6ae.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.
@@ -1,5 +1,10 @@
1
+ import { whenElse } from '@genesislcap/foundation-utils';
1
2
  import { html } from '@microsoft/fast-element';
2
3
  // <pre>${(x) => JSON.stringify(x.control, null, 2)}</pre>
4
+ function changeHandler(x, c) {
5
+ const inputValue = c.event.target.value;
6
+ x.control.handleChange(x.control.path, inputValue === '' ? null : inputValue);
7
+ }
3
8
  export const getStringControlRendererTemplate = (prefix = 'zero') => html `
4
9
  <template>
5
10
  <control-wrapper
@@ -7,21 +12,31 @@ export const getStringControlRendererTemplate = (prefix = 'zero') => html `
7
12
  :touched=${(x) => x.touched}
8
13
  ?submitted=${(x) => x.submitted}
9
14
  >
10
- <${prefix}-text-field
11
- type=${(x) => { var _a, _b; return (((_b = (_a = x.control.uischema) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.isPassword) ? 'password' : 'text'); }}
12
- :value=${(x) => x.control.data || ''}
13
- @change=${(x, c) => {
14
- const inputValue = c.event.target.value;
15
- x.control.handleChange(x.control.path, inputValue === '' ? null : inputValue);
16
- }}
17
- placeholder=${(x) => x.control.uischema.placeholder || x.control.label}
18
- id=${(x) => x.control.path}
19
- data-test-id=${(x) => x.control.path}
20
- ?required=${(x) => x.control.required}
21
- ?disabled=${(x) => !x.control.enabled}
22
- style="width: 100%"
23
- @blur=${(x) => x.onBlur()}
24
- ></${prefix}-text-field>
15
+ ${whenElse((x) => { var _a, _b; return !((_b = (_a = x.control.uischema) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.textarea); }, html `
16
+ <${prefix}-text-field
17
+ type=${(x) => { var _a, _b; return (((_b = (_a = x.control.uischema) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.isPassword) ? 'password' : 'text'); }}
18
+ :value=${(x) => x.control.data || ''}
19
+ @change=${changeHandler}
20
+ placeholder=${(x) => x.control.uischema.placeholder || x.control.label}
21
+ id=${(x) => x.control.path}
22
+ data-test-id=${(x) => x.control.path}
23
+ ?required=${(x) => x.control.required}
24
+ ?disabled=${(x) => !x.control.enabled}
25
+ style="width: 100%"
26
+ @blur=${(x) => x.onBlur()}
27
+ ></${prefix}-text-field>`, html `
28
+ <${prefix}-text-area
29
+ :value=${(x) => x.control.data || ''}
30
+ @change=${changeHandler}
31
+ placeholder=${(x) => x.control.uischema.placeholder || x.control.label}
32
+ id=${(x) => x.control.path}
33
+ data-test-id=${(x) => x.control.path}
34
+ ?required=${(x) => x.control.required}
35
+ ?disabled=${(x) => !x.control.enabled}
36
+ style="width: 100%"
37
+ @blur=${(x) => x.onBlur()}
38
+ ></${prefix}-text-area>
39
+ `)}
25
40
  </control-wrapper>
26
41
  </template>
27
42
  `;
@@ -172,6 +172,111 @@
172
172
  "name": "",
173
173
  "preserveMemberOrder": false,
174
174
  "members": [
175
+ {
176
+ "kind": "TypeAlias",
177
+ "canonicalReference": "@genesislcap/foundation-forms!ArrayRendererOptions:type",
178
+ "docComment": "/**\n * Configuration options available for array renderer.\n *\n * @public\n */\n",
179
+ "excerptTokens": [
180
+ {
181
+ "kind": "Content",
182
+ "text": "export type ArrayRendererOptions = "
183
+ },
184
+ {
185
+ "kind": "Content",
186
+ "text": "{\n childUiSchema?: "
187
+ },
188
+ {
189
+ "kind": "Reference",
190
+ "text": "UiSchema",
191
+ "canonicalReference": "@genesislcap/foundation-forms!UiSchema:type"
192
+ },
193
+ {
194
+ "kind": "Content",
195
+ "text": ";\n}"
196
+ },
197
+ {
198
+ "kind": "Content",
199
+ "text": ";"
200
+ }
201
+ ],
202
+ "fileUrlPath": "src/types.ts",
203
+ "releaseTag": "Public",
204
+ "name": "ArrayRendererOptions",
205
+ "typeTokenRange": {
206
+ "startIndex": 1,
207
+ "endIndex": 4
208
+ }
209
+ },
210
+ {
211
+ "kind": "TypeAlias",
212
+ "canonicalReference": "@genesislcap/foundation-forms!CategorizationRendererOptions:type",
213
+ "docComment": "/**\n * Configuration options available for categorization renderer.\n *\n * @public\n */\n",
214
+ "excerptTokens": [
215
+ {
216
+ "kind": "Content",
217
+ "text": "export type CategorizationRendererOptions = "
218
+ },
219
+ {
220
+ "kind": "Content",
221
+ "text": "{\n childElements?: "
222
+ },
223
+ {
224
+ "kind": "Reference",
225
+ "text": "UiSchema",
226
+ "canonicalReference": "@genesislcap/foundation-forms!UiSchema:type"
227
+ },
228
+ {
229
+ "kind": "Content",
230
+ "text": "[];\n}"
231
+ },
232
+ {
233
+ "kind": "Content",
234
+ "text": ";"
235
+ }
236
+ ],
237
+ "fileUrlPath": "src/types.ts",
238
+ "releaseTag": "Public",
239
+ "name": "CategorizationRendererOptions",
240
+ "typeTokenRange": {
241
+ "startIndex": 1,
242
+ "endIndex": 4
243
+ }
244
+ },
245
+ {
246
+ "kind": "TypeAlias",
247
+ "canonicalReference": "@genesislcap/foundation-forms!ConnectedRenderersOptions:type",
248
+ "docComment": "/**\n * Available configuration options for connected combobox/multiselect.\n *\n * @public\n */\n",
249
+ "excerptTokens": [
250
+ {
251
+ "kind": "Content",
252
+ "text": "export type ConnectedRenderersOptions = "
253
+ },
254
+ {
255
+ "kind": "Content",
256
+ "text": "{\n async?: boolean;\n allOptionsResourceName?: string;\n datasourceConfig?: "
257
+ },
258
+ {
259
+ "kind": "Reference",
260
+ "text": "DatasourceOptions",
261
+ "canonicalReference": "@genesislcap/foundation-comms!DatasourceOptions:interface"
262
+ },
263
+ {
264
+ "kind": "Content",
265
+ "text": ";\n valueField?: string;\n labelField?: string;\n data?: any[];\n}"
266
+ },
267
+ {
268
+ "kind": "Content",
269
+ "text": ";"
270
+ }
271
+ ],
272
+ "fileUrlPath": "src/types.ts",
273
+ "releaseTag": "Public",
274
+ "name": "ConnectedRenderersOptions",
275
+ "typeTokenRange": {
276
+ "startIndex": 1,
277
+ "endIndex": 4
278
+ }
279
+ },
175
280
  {
176
281
  "kind": "Variable",
177
282
  "canonicalReference": "@genesislcap/foundation-forms!createExpressions:var",
@@ -917,6 +1022,33 @@
917
1022
  "endIndex": 2
918
1023
  }
919
1024
  },
1025
+ {
1026
+ "kind": "TypeAlias",
1027
+ "canonicalReference": "@genesislcap/foundation-forms!GroupRendererOptions:type",
1028
+ "docComment": "/**\n * Configuration options available for group renderer.\n *\n * @public\n */\n",
1029
+ "excerptTokens": [
1030
+ {
1031
+ "kind": "Content",
1032
+ "text": "export type GroupRendererOptions = "
1033
+ },
1034
+ {
1035
+ "kind": "Reference",
1036
+ "text": "CategorizationRendererOptions",
1037
+ "canonicalReference": "@genesislcap/foundation-forms!CategorizationRendererOptions:type"
1038
+ },
1039
+ {
1040
+ "kind": "Content",
1041
+ "text": ";"
1042
+ }
1043
+ ],
1044
+ "fileUrlPath": "src/types.ts",
1045
+ "releaseTag": "Public",
1046
+ "name": "GroupRendererOptions",
1047
+ "typeTokenRange": {
1048
+ "startIndex": 1,
1049
+ "endIndex": 2
1050
+ }
1051
+ },
920
1052
  {
921
1053
  "kind": "Variable",
922
1054
  "canonicalReference": "@genesislcap/foundation-forms!mustMatch:var",
@@ -1043,10 +1175,80 @@
1043
1175
  "endIndex": 2
1044
1176
  }
1045
1177
  },
1178
+ {
1179
+ "kind": "TypeAlias",
1180
+ "canonicalReference": "@genesislcap/foundation-forms!StandardRendererOptions:type",
1181
+ "docComment": "/**\n * Standard configuration options available for all renderers.\n *\n * @public\n */\n",
1182
+ "excerptTokens": [
1183
+ {
1184
+ "kind": "Content",
1185
+ "text": "export type StandardRendererOptions = "
1186
+ },
1187
+ {
1188
+ "kind": "Content",
1189
+ "text": "{\n hidden?: boolean;\n validateFn?: (data: any, path: string, label: string) => "
1190
+ },
1191
+ {
1192
+ "kind": "Reference",
1193
+ "text": "ErrorObject",
1194
+ "canonicalReference": "ajv!ErrorObject:interface"
1195
+ },
1196
+ {
1197
+ "kind": "Content",
1198
+ "text": "[];\n i18n?: {\n [key: string]: any;\n };\n}"
1199
+ },
1200
+ {
1201
+ "kind": "Content",
1202
+ "text": ";"
1203
+ }
1204
+ ],
1205
+ "fileUrlPath": "src/types.ts",
1206
+ "releaseTag": "Public",
1207
+ "name": "StandardRendererOptions",
1208
+ "typeTokenRange": {
1209
+ "startIndex": 1,
1210
+ "endIndex": 4
1211
+ }
1212
+ },
1213
+ {
1214
+ "kind": "TypeAlias",
1215
+ "canonicalReference": "@genesislcap/foundation-forms!StepperOrientationOptions:type",
1216
+ "docComment": "/**\n * Orientation options available for stepper renderer.\n *\n * @public\n */\n",
1217
+ "excerptTokens": [
1218
+ {
1219
+ "kind": "Content",
1220
+ "text": "export type StepperOrientationOptions = "
1221
+ },
1222
+ {
1223
+ "kind": "Content",
1224
+ "text": "{\n orientation?: "
1225
+ },
1226
+ {
1227
+ "kind": "Reference",
1228
+ "text": "StepperOrientationType",
1229
+ "canonicalReference": "@genesislcap/foundation-forms!StepperOrientationType:type"
1230
+ },
1231
+ {
1232
+ "kind": "Content",
1233
+ "text": ";\n}"
1234
+ },
1235
+ {
1236
+ "kind": "Content",
1237
+ "text": ";"
1238
+ }
1239
+ ],
1240
+ "fileUrlPath": "src/types.ts",
1241
+ "releaseTag": "Public",
1242
+ "name": "StepperOrientationOptions",
1243
+ "typeTokenRange": {
1244
+ "startIndex": 1,
1245
+ "endIndex": 4
1246
+ }
1247
+ },
1046
1248
  {
1047
1249
  "kind": "TypeAlias",
1048
1250
  "canonicalReference": "@genesislcap/foundation-forms!StepperOrientationType:type",
1049
- "docComment": "/**\n * @public\n */\n",
1251
+ "docComment": "/**\n * Available orientation for stepper renderer.\n *\n * @public\n */\n",
1050
1252
  "excerptTokens": [
1051
1253
  {
1052
1254
  "kind": "Content",
@@ -1069,10 +1271,63 @@
1069
1271
  "endIndex": 2
1070
1272
  }
1071
1273
  },
1274
+ {
1275
+ "kind": "TypeAlias",
1276
+ "canonicalReference": "@genesislcap/foundation-forms!StepperRendererOptions:type",
1277
+ "docComment": "/**\n * Configuration options available for stepper renderer.\n *\n * @public\n */\n",
1278
+ "excerptTokens": [
1279
+ {
1280
+ "kind": "Content",
1281
+ "text": "export type StepperRendererOptions = "
1282
+ },
1283
+ {
1284
+ "kind": "Reference",
1285
+ "text": "CategorizationRendererOptions",
1286
+ "canonicalReference": "@genesislcap/foundation-forms!CategorizationRendererOptions:type"
1287
+ },
1288
+ {
1289
+ "kind": "Content",
1290
+ "text": ";"
1291
+ }
1292
+ ],
1293
+ "fileUrlPath": "src/types.ts",
1294
+ "releaseTag": "Public",
1295
+ "name": "StepperRendererOptions",
1296
+ "typeTokenRange": {
1297
+ "startIndex": 1,
1298
+ "endIndex": 2
1299
+ }
1300
+ },
1301
+ {
1302
+ "kind": "TypeAlias",
1303
+ "canonicalReference": "@genesislcap/foundation-forms!StringRendererOptions:type",
1304
+ "docComment": "/**\n * Configuration options available for string renderer.\n *\n * @public\n */\n",
1305
+ "excerptTokens": [
1306
+ {
1307
+ "kind": "Content",
1308
+ "text": "export type StringRendererOptions = "
1309
+ },
1310
+ {
1311
+ "kind": "Content",
1312
+ "text": "{\n isPassword?: boolean;\n textarea?: boolean;\n}"
1313
+ },
1314
+ {
1315
+ "kind": "Content",
1316
+ "text": ";"
1317
+ }
1318
+ ],
1319
+ "fileUrlPath": "src/types.ts",
1320
+ "releaseTag": "Public",
1321
+ "name": "StringRendererOptions",
1322
+ "typeTokenRange": {
1323
+ "startIndex": 1,
1324
+ "endIndex": 2
1325
+ }
1326
+ },
1072
1327
  {
1073
1328
  "kind": "TypeAlias",
1074
1329
  "canonicalReference": "@genesislcap/foundation-forms!UiSchema:type",
1075
- "docComment": "/**\n * @public\n */\n",
1330
+ "docComment": "/**\n * The UI schema, which is passed to JSON Forms, describes the general layout of a form and is just a regular JSON object. It describes the form by means of different UI schema elements, which can often be categorized into either Controls or Layouts.\n *\n * @public\n */\n",
1076
1331
  "excerptTokens": [
1077
1332
  {
1078
1333
  "kind": "Content",
@@ -1102,8 +1357,8 @@
1102
1357
  },
1103
1358
  {
1104
1359
  "kind": "Reference",
1105
- "text": "UiSchemaElementOptions",
1106
- "canonicalReference": "@genesislcap/foundation-forms!UiSchemaElementOptions:type"
1360
+ "text": "StepperOrientationOptions",
1361
+ "canonicalReference": "@genesislcap/foundation-forms!StepperOrientationOptions:type"
1107
1362
  },
1108
1363
  {
1109
1364
  "kind": "Content",
@@ -1125,7 +1380,7 @@
1125
1380
  {
1126
1381
  "kind": "TypeAlias",
1127
1382
  "canonicalReference": "@genesislcap/foundation-forms!UiSchemaElement:type",
1128
- "docComment": "/**\n * @public\n */\n",
1383
+ "docComment": "/**\n * A UiSchemaElement that displays property values in a user interface element.\n *\n * @public\n */\n",
1129
1384
  "excerptTokens": [
1130
1385
  {
1131
1386
  "kind": "Content",
@@ -1169,60 +1424,70 @@
1169
1424
  {
1170
1425
  "kind": "TypeAlias",
1171
1426
  "canonicalReference": "@genesislcap/foundation-forms!UiSchemaElementOptions:type",
1172
- "docComment": "/**\n * @public\n */\n",
1427
+ "docComment": "/**\n * All configuration options that are available.\n *\n * @public\n */\n",
1173
1428
  "excerptTokens": [
1174
1429
  {
1175
1430
  "kind": "Content",
1176
1431
  "text": "export type UiSchemaElementOptions = "
1177
1432
  },
1433
+ {
1434
+ "kind": "Reference",
1435
+ "text": "ConnectedRenderersOptions",
1436
+ "canonicalReference": "@genesislcap/foundation-forms!ConnectedRenderersOptions:type"
1437
+ },
1178
1438
  {
1179
1439
  "kind": "Content",
1180
- "text": "{\n async?: boolean;\n orientation?: "
1440
+ "text": " | "
1181
1441
  },
1182
1442
  {
1183
1443
  "kind": "Reference",
1184
- "text": "StepperOrientationType",
1185
- "canonicalReference": "@genesislcap/foundation-forms!StepperOrientationType:type"
1444
+ "text": "ArrayRendererOptions",
1445
+ "canonicalReference": "@genesislcap/foundation-forms!ArrayRendererOptions:type"
1186
1446
  },
1187
1447
  {
1188
1448
  "kind": "Content",
1189
- "text": ";\n allOptionsResourceName?: string;\n datasourceConfig?: "
1449
+ "text": " | "
1190
1450
  },
1191
1451
  {
1192
1452
  "kind": "Reference",
1193
- "text": "DatasourceOptions",
1194
- "canonicalReference": "@genesislcap/foundation-comms!DatasourceOptions:interface"
1453
+ "text": "CategorizationRendererOptions",
1454
+ "canonicalReference": "@genesislcap/foundation-forms!CategorizationRendererOptions:type"
1195
1455
  },
1196
1456
  {
1197
1457
  "kind": "Content",
1198
- "text": ";\n hidden?: boolean;\n isPassword?: boolean;\n validateFn?: (data: any, path: string, label: string) => "
1458
+ "text": " | "
1199
1459
  },
1200
1460
  {
1201
1461
  "kind": "Reference",
1202
- "text": "ErrorObject",
1203
- "canonicalReference": "ajv!ErrorObject:interface"
1462
+ "text": "GroupRendererOptions",
1463
+ "canonicalReference": "@genesislcap/foundation-forms!GroupRendererOptions:type"
1204
1464
  },
1205
1465
  {
1206
1466
  "kind": "Content",
1207
- "text": "[];\n valueField?: string;\n labelField?: string;\n textarea?: boolean;\n data?: any[];\n childUiSchema?: "
1467
+ "text": " | "
1208
1468
  },
1209
1469
  {
1210
1470
  "kind": "Reference",
1211
- "text": "UiSchema",
1212
- "canonicalReference": "@genesislcap/foundation-forms!UiSchema:type"
1471
+ "text": "StepperRendererOptions",
1472
+ "canonicalReference": "@genesislcap/foundation-forms!StepperRendererOptions:type"
1213
1473
  },
1214
1474
  {
1215
1475
  "kind": "Content",
1216
- "text": ";\n childElements?: "
1476
+ "text": " | "
1217
1477
  },
1218
1478
  {
1219
1479
  "kind": "Reference",
1220
- "text": "UiSchema",
1221
- "canonicalReference": "@genesislcap/foundation-forms!UiSchema:type"
1480
+ "text": "StringRendererOptions",
1481
+ "canonicalReference": "@genesislcap/foundation-forms!StringRendererOptions:type"
1222
1482
  },
1223
1483
  {
1224
1484
  "kind": "Content",
1225
- "text": "[];\n i18n?: {\n [key: string]: any;\n };\n}"
1485
+ "text": " | "
1486
+ },
1487
+ {
1488
+ "kind": "Reference",
1489
+ "text": "StandardRendererOptions",
1490
+ "canonicalReference": "@genesislcap/foundation-forms!StandardRendererOptions:type"
1226
1491
  },
1227
1492
  {
1228
1493
  "kind": "Content",
@@ -1234,13 +1499,13 @@
1234
1499
  "name": "UiSchemaElementOptions",
1235
1500
  "typeTokenRange": {
1236
1501
  "startIndex": 1,
1237
- "endIndex": 12
1502
+ "endIndex": 14
1238
1503
  }
1239
1504
  },
1240
1505
  {
1241
1506
  "kind": "TypeAlias",
1242
1507
  "canonicalReference": "@genesislcap/foundation-forms!UiSchemaElementType:type",
1243
- "docComment": "/**\n * @public\n */\n",
1508
+ "docComment": "/**\n * The layouts and control types, which allow you to customize the arrangement of forms.\n *\n * @public\n */\n",
1244
1509
  "excerptTokens": [
1245
1510
  {
1246
1511
  "kind": "Content",
@@ -1248,7 +1513,7 @@
1248
1513
  },
1249
1514
  {
1250
1515
  "kind": "Content",
1251
- "text": "'Control' | 'VerticalLayout' | any"
1516
+ "text": "'Control' | 'VerticalLayout' | 'LayoutVertical2Columns' | 'Categorization' | 'Group' | 'Stepper' | 'HorizontalLayout'"
1252
1517
  },
1253
1518
  {
1254
1519
  "kind": "Content",