@astroapps/forms-core 1.2.2 → 2.0.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/lib/index.cjs CHANGED
@@ -25,6 +25,7 @@ exports.DynamicPropertyType = void 0;
25
25
  DynamicPropertyType["AllowedOptions"] = "AllowedOptions";
26
26
  DynamicPropertyType["Label"] = "Label";
27
27
  DynamicPropertyType["ActionData"] = "ActionData";
28
+ DynamicPropertyType["GridColumns"] = "GridColumns";
28
29
  })(exports.DynamicPropertyType || (exports.DynamicPropertyType = {}));
29
30
  exports.AdornmentPlacement = void 0;
30
31
  (function (AdornmentPlacement) {
@@ -70,6 +71,7 @@ exports.DataRenderType = void 0;
70
71
  DataRenderType["Array"] = "Array";
71
72
  DataRenderType["ArrayElement"] = "ArrayElement";
72
73
  DataRenderType["ElementSelected"] = "ElementSelected";
74
+ DataRenderType["ScrollList"] = "ScrollList";
73
75
  })(exports.DataRenderType || (exports.DataRenderType = {}));
74
76
  exports.SyncTextType = void 0;
75
77
  (function (SyncTextType) {
@@ -89,6 +91,7 @@ exports.GroupRenderType = void 0;
89
91
  GroupRenderType["Wizard"] = "Wizard";
90
92
  GroupRenderType["Dialog"] = "Dialog";
91
93
  GroupRenderType["Contents"] = "Contents";
94
+ GroupRenderType["Accordion"] = "Accordion";
92
95
  })(exports.GroupRenderType || (exports.GroupRenderType = {}));
93
96
  exports.DisplayDataType = void 0;
94
97
  (function (DisplayDataType) {
@@ -97,6 +100,12 @@ exports.DisplayDataType = void 0;
97
100
  DisplayDataType["Icon"] = "Icon";
98
101
  DisplayDataType["Custom"] = "Custom";
99
102
  })(exports.DisplayDataType || (exports.DisplayDataType = {}));
103
+ exports.ControlDisableType = void 0;
104
+ (function (ControlDisableType) {
105
+ ControlDisableType["None"] = "None";
106
+ ControlDisableType["Self"] = "Self";
107
+ ControlDisableType["Global"] = "Global";
108
+ })(exports.ControlDisableType || (exports.ControlDisableType = {}));
100
109
  exports.ActionStyle = void 0;
101
110
  (function (ActionStyle) {
102
111
  ActionStyle["Button"] = "Button";
@@ -133,6 +142,9 @@ function isWizardRenderer(options) {
133
142
  function isDialogRenderer(options) {
134
143
  return options.type === exports.GroupRenderType.Dialog;
135
144
  }
145
+ function isAccordionRenderer(options) {
146
+ return options.type === exports.GroupRenderType.Accordion;
147
+ }
136
148
  function isInlineRenderer(options) {
137
149
  return options.type === exports.GroupRenderType.Inline;
138
150
  }
@@ -243,7 +255,7 @@ function fontAwesomeIcon(icon) {
243
255
  * @returns True if the control definition is readonly, false otherwise.
244
256
  */
245
257
  function isControlReadonly(c) {
246
- return isDataControl(c) && !!c.readonly;
258
+ return !!c.readonly;
247
259
  }
248
260
  /**
249
261
  * Checks if a control definition is disabled.
@@ -251,7 +263,7 @@ function isControlReadonly(c) {
251
263
  * @returns True if the control definition is disabled, false otherwise.
252
264
  */
253
265
  function isControlDisabled(c) {
254
- return isDataControl(c) && !!c.disabled;
266
+ return !!c.disabled;
255
267
  }
256
268
  /**
257
269
  * Returns the group renderer options for a control definition.
@@ -279,21 +291,22 @@ function getDisplayOnlyOptions(d) {
279
291
  return isDataControl(d) && d.renderOptions && isDisplayOnlyRenderer(d.renderOptions) ? d.renderOptions : undefined;
280
292
  }
281
293
 
282
- exports.ExpressionType = void 0;
283
- (function (ExpressionType) {
284
- ExpressionType["Jsonata"] = "Jsonata";
285
- ExpressionType["Data"] = "Data";
286
- ExpressionType["DataMatch"] = "FieldValue";
287
- ExpressionType["UserMatch"] = "UserMatch";
288
- ExpressionType["NotEmpty"] = "NotEmpty";
289
- ExpressionType["UUID"] = "UUID";
290
- })(exports.ExpressionType || (exports.ExpressionType = {}));
291
-
292
294
  function _arrayLikeToArray(r, a) {
293
295
  (null == a || a > r.length) && (a = r.length);
294
296
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
295
297
  return n;
296
298
  }
299
+ function _defineProperties(e, r) {
300
+ for (var t = 0; t < r.length; t++) {
301
+ var o = r[t];
302
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
303
+ }
304
+ }
305
+ function _createClass(e, r, t) {
306
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
307
+ writable: !1
308
+ }), e;
309
+ }
297
310
  function _createForOfIteratorHelperLoose(r, e) {
298
311
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
299
312
  if (t) return (t = t.call(r)).next.bind(t);
@@ -328,6 +341,20 @@ function _setPrototypeOf(t, e) {
328
341
  return t.__proto__ = e, t;
329
342
  }, _setPrototypeOf(t, e);
330
343
  }
344
+ function _toPrimitive(t, r) {
345
+ if ("object" != typeof t || !t) return t;
346
+ var e = t[Symbol.toPrimitive];
347
+ if (void 0 !== e) {
348
+ var i = e.call(t, r || "default");
349
+ if ("object" != typeof i) return i;
350
+ throw new TypeError("@@toPrimitive must return a primitive value.");
351
+ }
352
+ return ("string" === r ? String : Number)(t);
353
+ }
354
+ function _toPropertyKey(t) {
355
+ var i = _toPrimitive(t, "string");
356
+ return "symbol" == typeof i ? i : i + "";
357
+ }
331
358
  function _unsupportedIterableToArray(r, a) {
332
359
  if (r) {
333
360
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
@@ -336,6 +363,206 @@ function _unsupportedIterableToArray(r, a) {
336
363
  }
337
364
  }
338
365
 
366
+ exports.ValidatorType = void 0;
367
+ (function (ValidatorType) {
368
+ ValidatorType["Jsonata"] = "Jsonata";
369
+ ValidatorType["Date"] = "Date";
370
+ ValidatorType["Length"] = "Length";
371
+ })(exports.ValidatorType || (exports.ValidatorType = {}));
372
+ exports.DateComparison = void 0;
373
+ (function (DateComparison) {
374
+ DateComparison["NotBefore"] = "NotBefore";
375
+ DateComparison["NotAfter"] = "NotAfter";
376
+ })(exports.DateComparison || (exports.DateComparison = {}));
377
+ function jsonataValidator$1(expr) {
378
+ return {
379
+ type: exports.ValidatorType.Jsonata,
380
+ expression: expr
381
+ };
382
+ }
383
+ function dateValidator$1(comparison, fixedDate, daysFromCurrent) {
384
+ return {
385
+ type: exports.ValidatorType.Date,
386
+ comparison: comparison,
387
+ fixedDate: fixedDate,
388
+ daysFromCurrent: daysFromCurrent
389
+ };
390
+ }
391
+ function lengthValidator$1(min, max) {
392
+ return {
393
+ type: exports.ValidatorType.Length,
394
+ min: min,
395
+ max: max
396
+ };
397
+ }
398
+
399
+ exports.ExpressionType = void 0;
400
+ (function (ExpressionType) {
401
+ ExpressionType["Jsonata"] = "Jsonata";
402
+ ExpressionType["Data"] = "Data";
403
+ ExpressionType["DataMatch"] = "FieldValue";
404
+ ExpressionType["UserMatch"] = "UserMatch";
405
+ ExpressionType["NotEmpty"] = "NotEmpty";
406
+ ExpressionType["UUID"] = "UUID";
407
+ })(exports.ExpressionType || (exports.ExpressionType = {}));
408
+
409
+ function dataControl(field, title, options) {
410
+ return _extends({
411
+ type: exports.ControlDefinitionType.Data,
412
+ field: field,
413
+ title: title
414
+ }, options);
415
+ }
416
+ function validatorOptions(type) {
417
+ return function (o) {
418
+ return _extends({
419
+ type: type
420
+ }, o);
421
+ };
422
+ }
423
+ function adornmentOptions(type) {
424
+ return function (o) {
425
+ return _extends({
426
+ type: type
427
+ }, o);
428
+ };
429
+ }
430
+ function renderOptionsFor(type) {
431
+ return function (o) {
432
+ return {
433
+ renderOptions: _extends({
434
+ type: type
435
+ }, o)
436
+ };
437
+ };
438
+ }
439
+ var autocompleteOptions = renderOptionsFor(exports.DataRenderType.Autocomplete);
440
+ var checkListOptions = renderOptionsFor(exports.DataRenderType.CheckList);
441
+ var radioButtonOptions = renderOptionsFor(exports.DataRenderType.Radio);
442
+ var lengthValidatorOptions = validatorOptions(exports.ValidatorType.Length);
443
+ var jsonataValidatorOptions = validatorOptions(exports.ValidatorType.Jsonata);
444
+ var dateValidatorOptions = validatorOptions(exports.ValidatorType.Date);
445
+ var accordionOptions = adornmentOptions(exports.ControlAdornmentType.Accordion);
446
+ var textfieldOptions = renderOptionsFor(exports.DataRenderType.Textfield);
447
+ var displayOnlyOptions = renderOptionsFor(exports.DataRenderType.DisplayOnly);
448
+ var jsonataOptions = renderOptionsFor(exports.DataRenderType.Jsonata);
449
+ function textDisplayControl(text, options) {
450
+ return _extends({
451
+ type: exports.ControlDefinitionType.Display,
452
+ displayData: {
453
+ type: exports.DisplayDataType.Text,
454
+ text: text
455
+ }
456
+ }, options);
457
+ }
458
+ function htmlDisplayControl(html, options) {
459
+ return _extends({
460
+ type: exports.ControlDefinitionType.Display,
461
+ displayData: {
462
+ type: exports.DisplayDataType.Html,
463
+ html: html
464
+ }
465
+ }, options);
466
+ }
467
+ function dynamicDefaultValue(expr) {
468
+ return {
469
+ type: exports.DynamicPropertyType.DefaultValue,
470
+ expr: expr
471
+ };
472
+ }
473
+ function dynamicReadonly(expr) {
474
+ return {
475
+ type: exports.DynamicPropertyType.Readonly,
476
+ expr: expr
477
+ };
478
+ }
479
+ function dynamicVisibility(expr) {
480
+ return {
481
+ type: exports.DynamicPropertyType.Visible,
482
+ expr: expr
483
+ };
484
+ }
485
+ function dynamicDisabled(expr) {
486
+ return {
487
+ type: exports.DynamicPropertyType.Disabled,
488
+ expr: expr
489
+ };
490
+ }
491
+ function dataExpr(field) {
492
+ return {
493
+ type: exports.ExpressionType.Data,
494
+ field: field
495
+ };
496
+ }
497
+ /**
498
+ * @deprecated Use dataExpr
499
+ */
500
+ var fieldExpr = dataExpr;
501
+ /**
502
+ * @deprecated Use dataMatchExpr
503
+ */
504
+ var fieldEqExpr = dataMatchExpr;
505
+ var uuidExpr = {
506
+ type: exports.ExpressionType.UUID
507
+ };
508
+ function dataMatchExpr(field, value) {
509
+ return {
510
+ type: exports.ExpressionType.DataMatch,
511
+ field: field,
512
+ value: value
513
+ };
514
+ }
515
+ function notEmptyExpr(field, empty) {
516
+ return {
517
+ type: exports.ExpressionType.NotEmpty,
518
+ field: field,
519
+ empty: empty
520
+ };
521
+ }
522
+ function jsonataExpr(expression) {
523
+ return {
524
+ type: exports.ExpressionType.Jsonata,
525
+ expression: expression
526
+ };
527
+ }
528
+ function groupedControl(children, title, options) {
529
+ return _extends({
530
+ type: exports.ControlDefinitionType.Group,
531
+ children: children,
532
+ title: title,
533
+ groupOptions: {
534
+ type: "Standard",
535
+ hideTitle: !title
536
+ }
537
+ }, options);
538
+ }
539
+ function compoundControl(field, title, children, options) {
540
+ return _extends({
541
+ type: exports.ControlDefinitionType.Data,
542
+ field: field,
543
+ children: children,
544
+ title: title,
545
+ renderOptions: {
546
+ type: "Standard"
547
+ }
548
+ }, options);
549
+ }
550
+ function actionControl(actionText, actionId, options) {
551
+ return _extends({
552
+ type: exports.ControlDefinitionType.Action,
553
+ title: actionText,
554
+ actionId: actionId
555
+ }, options);
556
+ }
557
+ var emptyGroupDefinition = {
558
+ type: exports.ControlDefinitionType.Group,
559
+ children: [],
560
+ groupOptions: {
561
+ type: exports.GroupRenderType.Standard,
562
+ hideTitle: true
563
+ }
564
+ };
565
+
339
566
  /**
340
567
  * Enum representing the various field types.
341
568
  */
@@ -439,21 +666,24 @@ function createSchemaTree(rootFields, lookup) {
439
666
  return new SchemaTreeImpl(rootFields, lookup);
440
667
  }
441
668
  var SchemaNode = /*#__PURE__*/function () {
442
- function SchemaNode(id, field, tree, parent) {
669
+ function SchemaNode(id, field, tree, parent, getChildFields) {
443
670
  this.id = void 0;
444
671
  this.field = void 0;
445
672
  this.tree = void 0;
446
673
  this.parent = void 0;
674
+ this.getChildFields = void 0;
447
675
  this.id = id;
448
676
  this.field = field;
449
677
  this.tree = tree;
450
678
  this.parent = parent;
679
+ this.getChildFields = getChildFields;
451
680
  }
452
681
  var _proto3 = SchemaNode.prototype;
453
682
  _proto3.getSchema = function getSchema(schemaId) {
454
683
  return this.tree.getSchema(schemaId);
455
684
  };
456
685
  _proto3.getUnresolvedFields = function getUnresolvedFields() {
686
+ if (this.getChildFields) return this.getChildFields();
457
687
  return isCompoundField(this.field) ? this.field.children : [];
458
688
  };
459
689
  _proto3.getResolvedParent = function getResolvedParent(noRecurse) {
@@ -549,6 +779,51 @@ function schemaForFieldPath(fieldPath, schema) {
549
779
  }
550
780
  return schema;
551
781
  }
782
+ function schemaForDataPath(fieldPath, schema) {
783
+ var i = 0;
784
+ var element = schema.field.collection;
785
+ while (i < fieldPath.length) {
786
+ var nextField = fieldPath[i];
787
+ var childNode = void 0;
788
+ if (nextField == ".") {
789
+ i++;
790
+ continue;
791
+ } else if (nextField == "..") {
792
+ if (element) {
793
+ element = false;
794
+ i++;
795
+ continue;
796
+ }
797
+ childNode = schema.parent;
798
+ } else {
799
+ childNode = schema.getChildNode(nextField);
800
+ }
801
+ if (!childNode) {
802
+ childNode = createSchemaNode(missingField(nextField), schema.tree, schema);
803
+ } else {
804
+ element = childNode.field.collection;
805
+ }
806
+ schema = childNode;
807
+ i++;
808
+ }
809
+ return {
810
+ node: schema,
811
+ element: !!element
812
+ };
813
+ }
814
+ function getParentDataPath(_ref) {
815
+ var node = _ref.node,
816
+ element = _ref.element;
817
+ if (element) return {
818
+ node: node,
819
+ element: false
820
+ };
821
+ var parent = node.parent;
822
+ return parent ? {
823
+ node: parent,
824
+ element: !!parent.field.collection
825
+ } : undefined;
826
+ }
552
827
  function getSchemaNodePath(node) {
553
828
  var paths = [];
554
829
  var curNode = node;
@@ -710,6 +985,11 @@ function mergeOption(fields, name, value, fieldName) {
710
985
  });
711
986
  }
712
987
  function mergeFields(fields, name, value, newFields) {
988
+ if (name === "*") {
989
+ return newFields.reduce(function (af, x) {
990
+ return mergeField(x, af);
991
+ }, fields);
992
+ }
713
993
  var withType = fields.map(function (x) {
714
994
  return x.isTypeField ? addFieldOption(x, name, value) : x;
715
995
  });
@@ -757,18 +1037,6 @@ function resolveSchemas(schemaMap) {
757
1037
  return out;
758
1038
  }
759
1039
 
760
- exports.ValidatorType = void 0;
761
- (function (ValidatorType) {
762
- ValidatorType["Jsonata"] = "Jsonata";
763
- ValidatorType["Date"] = "Date";
764
- ValidatorType["Length"] = "Length";
765
- })(exports.ValidatorType || (exports.ValidatorType = {}));
766
- exports.DateComparison = void 0;
767
- (function (DateComparison) {
768
- DateComparison["NotBefore"] = "NotBefore";
769
- DateComparison["NotAfter"] = "NotAfter";
770
- })(exports.DateComparison || (exports.DateComparison = {}));
771
-
772
1040
  var SchemaDataTree = function SchemaDataTree() {};
773
1041
  var SchemaDataNode = /*#__PURE__*/function () {
774
1042
  function SchemaDataNode(id, schema, elementIndex, control, tree, parent) {
@@ -820,7 +1088,7 @@ var SchemaDataTreeImpl = /*#__PURE__*/function (_SchemaDataTree) {
820
1088
  _proto2.getChildElement = function getChildElement(parent, elementIndex) {
821
1089
  var elemControl = parent.control;
822
1090
  var elemChild = elemControl.elements[elementIndex];
823
- return new SchemaDataNode(elemChild.uniqueId.toString(), parent.schema, elementIndex, elemChild, this, parent);
1091
+ return new SchemaDataNode(elemChild.uniqueId.toString() + "_" + elementIndex, parent.schema, elementIndex, elemChild, this, parent);
824
1092
  };
825
1093
  return SchemaDataTreeImpl;
826
1094
  }(SchemaDataTree);
@@ -882,6 +1150,21 @@ function hideDisplayOnly(context, schemaInterface, definition) {
882
1150
  var displayOptions = getDisplayOnlyOptions(definition);
883
1151
  return displayOptions && !displayOptions.emptyText && schemaInterface.isEmptyValue(context.schema.field, (_context$control = context.control) == null ? void 0 : _context$control.value);
884
1152
  }
1153
+ function getLoadingControl(data) {
1154
+ return controls.ensureMetaValue(data, "loading", function () {
1155
+ return controls.newControl(false);
1156
+ });
1157
+ }
1158
+ function getRefreshingControl(data) {
1159
+ return controls.ensureMetaValue(data, "refreshing", function () {
1160
+ return controls.newControl(false);
1161
+ });
1162
+ }
1163
+ function getHasMoreControl(data) {
1164
+ return controls.ensureMetaValue(data, "hasMore", function () {
1165
+ return controls.newControl(false);
1166
+ });
1167
+ }
885
1168
 
886
1169
  var DefaultSchemaInterface = /*#__PURE__*/function () {
887
1170
  function DefaultSchemaInterface(boolStrings, parseDateTime) {
@@ -965,7 +1248,7 @@ var DefaultSchemaInterface = /*#__PURE__*/function () {
965
1248
  case exports.FieldType.Time:
966
1249
  return value ? new Date("1970-01-01T" + value).toLocaleTimeString() : undefined;
967
1250
  case exports.FieldType.Bool:
968
- return this.boolStrings[value ? 1 : 0];
1251
+ return value != null ? this.boolStrings[value ? 1 : 0] : undefined;
969
1252
  default:
970
1253
  return value != null ? value.toString() : undefined;
971
1254
  }
@@ -975,8 +1258,8 @@ var DefaultSchemaInterface = /*#__PURE__*/function () {
975
1258
  return f.collection ? (_control$elements$len = (_control$elements = control.elements) == null ? void 0 : _control$elements.length) != null ? _control$elements$len : 0 : this.valueLength(f, control.value);
976
1259
  };
977
1260
  _proto.valueLength = function valueLength(field, value) {
978
- var _ref2;
979
- return (_ref2 = value && (value == null ? void 0 : value.length)) != null ? _ref2 : 0;
1261
+ var len = value == null ? void 0 : value.length;
1262
+ return typeof len === "number" ? len : 0;
980
1263
  };
981
1264
  _proto.compareValue = function compareValue(field, v1, v2) {
982
1265
  if (v1 == null) return v2 == null ? 0 : 1;
@@ -988,7 +1271,7 @@ var DefaultSchemaInterface = /*#__PURE__*/function () {
988
1271
  case exports.FieldType.String:
989
1272
  return v1.localeCompare(v2);
990
1273
  case exports.FieldType.Bool:
991
- return v1 ? v2 ? 0 : 1 : -1;
1274
+ return v1 === v2 ? 0 : !v1 ? -1 : 1;
992
1275
  case exports.FieldType.Int:
993
1276
  case exports.FieldType.Double:
994
1277
  return v1 - v2;
@@ -1145,7 +1428,7 @@ var FormTreeImpl = /*#__PURE__*/function (_FormTree) {
1145
1428
  return FormTreeImpl;
1146
1429
  }(FormTree);
1147
1430
  function legacyFormNode(definition) {
1148
- return createFormTree([definition]).rootNode.getChildNodes()[0];
1431
+ return createFormTree([definition]).rootNode;
1149
1432
  }
1150
1433
  function createFormTree(controls, getForm) {
1151
1434
  if (getForm === void 0) {
@@ -1155,7 +1438,7 @@ function createFormTree(controls, getForm) {
1155
1438
  }
1156
1439
  };
1157
1440
  }
1158
- return new FormTreeImpl(getForm, {
1441
+ return new FormTreeImpl(getForm, controls.length === 1 ? controls[0] : {
1159
1442
  type: exports.ControlDefinitionType.Group,
1160
1443
  children: controls,
1161
1444
  groupOptions: {
@@ -1232,35 +1515,6 @@ function visitFormDataInContext(parentContext, node, cb) {
1232
1515
  var dataNode = lookupDataNode(node.definition, parentContext);
1233
1516
  return visitFormData(node, dataNode != null ? dataNode : parentContext, cb, !dataNode);
1234
1517
  }
1235
- function visitFormDataNode(node, visitFn) {
1236
- var dataNode = lookupDataNode(node.formNode.definition, node.parentData);
1237
- var v = visitFn(node, dataNode);
1238
- if (v !== undefined) return v;
1239
- var parentData = dataNode != null ? dataNode : node.parentData;
1240
- if (parentData.schema.field.collection && parentData.elementIndex == null) {
1241
- var elemCount = parentData.control.elements.length;
1242
- for (var i = 0; i < elemCount; i++) {
1243
- var _v = visitChildren(parentData.getChildElement(i));
1244
- if (_v !== undefined) return _v;
1245
- }
1246
- return undefined;
1247
- } else {
1248
- return visitChildren(parentData);
1249
- }
1250
- function visitChildren(parentData) {
1251
- var children = node.formNode.getChildNodes();
1252
- for (var _i2 = 0; _i2 < children.length; _i2++) {
1253
- var child = children[_i2];
1254
- var res = visitFormDataNode({
1255
- formNode: child,
1256
- parent: node,
1257
- parentData: parentData,
1258
- childIndex: _i2
1259
- }, visitFn);
1260
- if (res !== undefined) return res;
1261
- }
1262
- }
1263
- }
1264
1518
 
1265
1519
  /**
1266
1520
  * Converts a JSON path array to a string.
@@ -1331,11 +1585,14 @@ var notEmptyEval = function notEmptyEval(expr, _ref3) {
1331
1585
  var jsonataEval = function jsonataEval(expr, _ref4) {
1332
1586
  var runJsonata = function runJsonata(effect, signal) {
1333
1587
  try {
1334
- var bindings = controls.collectChanges(effect.collectUsage, function () {
1335
- return variables == null ? void 0 : variables.value;
1336
- });
1337
- return Promise.resolve(parsedJsonata.fields.expr.value.evaluate(controls.trackedValue(rootData, effect.collectUsage), bindings)).then(function (evalResult) {
1338
- // console.log(parsedJsonata.fields.fullExpr.value, evalResult, bindings);
1588
+ var trackedVars = variables == null ? void 0 : variables(effect.collectUsage);
1589
+ return Promise.resolve(parsedJsonata.fields.expr.value.evaluate(controls.trackedValue(rootData, effect.collectUsage), trackedVars)).then(function (evalResult) {
1590
+ // console.log(
1591
+ // rootData,
1592
+ // parsedJsonata.fields.fullExpr.current.value,
1593
+ // evalResult,
1594
+ // trackedVars,
1595
+ // );
1339
1596
  controls.collectChanges(effect.collectUsage, function () {
1340
1597
  return returnResult(evalResult);
1341
1598
  });
@@ -1379,6 +1636,54 @@ var uuidEval = function uuidEval(_, ctx) {
1379
1636
  ctx.returnResult(uuid.v4());
1380
1637
  };
1381
1638
  var defaultEvaluators = (_defaultEvaluators = {}, _defaultEvaluators[exports.ExpressionType.DataMatch] = dataMatchEval, _defaultEvaluators[exports.ExpressionType.Data] = dataEval, _defaultEvaluators[exports.ExpressionType.NotEmpty] = notEmptyEval, _defaultEvaluators[exports.ExpressionType.Jsonata] = jsonataEval, _defaultEvaluators[exports.ExpressionType.UUID] = uuidEval, _defaultEvaluators);
1639
+ function createEvalExpr(evalExpression, context) {
1640
+ function evalExpr(scope, init, nk, e, coerce) {
1641
+ nk.value = init;
1642
+ if (e != null && e.type) {
1643
+ evalExpression(e, _extends({
1644
+ returnResult: function returnResult(r) {
1645
+ nk.value = coerce(r);
1646
+ },
1647
+ scope: scope
1648
+ }, context));
1649
+ return true;
1650
+ }
1651
+ return false;
1652
+ }
1653
+ return evalExpr;
1654
+ }
1655
+
1656
+ function createOverrideProxy(proxyFor, handlers) {
1657
+ var overrides = controls.getCurrentFields(handlers);
1658
+ var allOwn = Reflect.ownKeys(proxyFor);
1659
+ Reflect.ownKeys(overrides).forEach(function (k) {
1660
+ if (!allOwn.includes(k)) allOwn.push(k);
1661
+ });
1662
+ return new Proxy(proxyFor, {
1663
+ get: function get(target, p, receiver) {
1664
+ if (Object.hasOwn(overrides, p)) {
1665
+ var nv = overrides[p].value;
1666
+ if (nv !== NoOverride) return nv;
1667
+ }
1668
+ return Reflect.get(target, p, receiver);
1669
+ },
1670
+ ownKeys: function ownKeys(target) {
1671
+ return allOwn;
1672
+ },
1673
+ has: function has(target, p) {
1674
+ return Reflect.has(proxyFor, p) || Reflect.has(overrides, p);
1675
+ },
1676
+ getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, k) {
1677
+ if (Object.hasOwn(overrides, k)) return {
1678
+ enumerable: true,
1679
+ configurable: true
1680
+ };
1681
+ return Reflect.getOwnPropertyDescriptor(target, k);
1682
+ }
1683
+ });
1684
+ }
1685
+ var NoValue = function NoValue() {};
1686
+ var NoOverride = new NoValue();
1382
1687
 
1383
1688
  var _defaultValidators;
1384
1689
  var jsonataValidator = function jsonataValidator(validation, context) {
@@ -1397,7 +1702,7 @@ var jsonataValidator = function jsonataValidator(validation, context) {
1397
1702
  context.data.control.setError("jsonata", v == null ? void 0 : v.toString());
1398
1703
  },
1399
1704
  schemaInterface: context.schemaInterface,
1400
- variables: context.formContext.fields.variables,
1705
+ variables: context.variables,
1401
1706
  runAsync: context.runAsync
1402
1707
  });
1403
1708
  };
@@ -1457,7 +1762,7 @@ function createValidators(def, context) {
1457
1762
  if (def.required) {
1458
1763
  context.addSync(function (v) {
1459
1764
  var field = context.data.schema.field;
1460
- return schemaInterface.isEmptyValue(field, v) ? schemaInterface.validationMessageText(field, exports.ValidationMessageType.NotEmpty, false, true) : null;
1765
+ return schemaInterface.isEmptyValue(field, v) ? def.requiredErrorText ? def.requiredErrorText : schemaInterface.validationMessageText(field, exports.ValidationMessageType.NotEmpty, false, true) : null;
1461
1766
  });
1462
1767
  }
1463
1768
  (_def$validators = def.validators) == null || _def$validators.forEach(function (x) {
@@ -1466,9 +1771,9 @@ function createValidators(def, context) {
1466
1771
  });
1467
1772
  }
1468
1773
  }
1469
- function setupValidation(controlImpl, definition, dataNode, schemaInterface, parent, formNode, hidden, runAsync) {
1470
- var validationEnabled = createScopedComputed(controlImpl, function () {
1471
- return !hidden.value;
1774
+ function setupValidation(scope, variables, definition, dataNode, schemaInterface, parent, visible, runAsync) {
1775
+ var validationEnabled = createScopedComputed(scope, function () {
1776
+ return !!visible.value;
1472
1777
  });
1473
1778
  var validatorsScope = controls.createCleanupScope();
1474
1779
  controls.createEffect(function () {
@@ -1476,7 +1781,7 @@ function setupValidation(controlImpl, definition, dataNode, schemaInterface, par
1476
1781
  var dn = dataNode.value;
1477
1782
  if (dn) {
1478
1783
  var syncValidations = [];
1479
- createValidators(formNode.definition, {
1784
+ createValidators(definition, {
1480
1785
  data: dn,
1481
1786
  parentData: parent,
1482
1787
  validationEnabled: validationEnabled,
@@ -1487,7 +1792,7 @@ function setupValidation(controlImpl, definition, dataNode, schemaInterface, par
1487
1792
  addCleanup: function addCleanup(cleanup) {
1488
1793
  validatorsScope.addCleanup(cleanup);
1489
1794
  },
1490
- formContext: controlImpl,
1795
+ variables: variables,
1491
1796
  runAsync: runAsync
1492
1797
  });
1493
1798
  controls.createEffect(function () {
@@ -1505,289 +1810,643 @@ function setupValidation(controlImpl, definition, dataNode, schemaInterface, par
1505
1810
  dn.control.setError("default", e);
1506
1811
  }, validatorsScope);
1507
1812
  }
1508
- }, function (c) {}, controlImpl);
1813
+ }, function (c) {}, scope);
1509
1814
  }
1510
1815
 
1511
- function getControlStateId(parent, formNode, stateKey) {
1512
- return parent.id + "$" + formNode.id + (stateKey != null ? stateKey : "");
1816
+ function createEvaluatedDefinition(def, evalExpr, scope, display) {
1817
+ var definitionOverrides = createScoped(scope, {});
1818
+ var displayOverrides = createScoped(scope, {});
1819
+ var groupOptionsOverrides = createScoped(scope, {});
1820
+ var renderOptionsOverrides = createScoped(scope, {});
1821
+ var _definitionOverrides$ = definitionOverrides.fields,
1822
+ hidden = _definitionOverrides$.hidden,
1823
+ displayData = _definitionOverrides$.displayData,
1824
+ readonly = _definitionOverrides$.readonly,
1825
+ disabled = _definitionOverrides$.disabled,
1826
+ defaultValue = _definitionOverrides$.defaultValue,
1827
+ actionData = _definitionOverrides$.actionData,
1828
+ title = _definitionOverrides$.title,
1829
+ groupOptions = _definitionOverrides$.groupOptions,
1830
+ renderOptions = _definitionOverrides$.renderOptions;
1831
+ var columns = groupOptionsOverrides.fields.columns;
1832
+ var dataGroupRenderOptions = renderOptionsOverrides.fields.groupOptions;
1833
+ var _displayOverrides$fie = displayOverrides.fields,
1834
+ html = _displayOverrides$fie.html,
1835
+ text = _displayOverrides$fie.text;
1836
+ controls.updateComputedValue(dataGroupRenderOptions, function () {
1837
+ var _def$renderOptions$gr;
1838
+ return isDataControl(def) && isDataGroupRenderer(def.renderOptions) ? createOverrideProxy((_def$renderOptions$gr = def.renderOptions.groupOptions) != null ? _def$renderOptions$gr : {}, groupOptionsOverrides) : undefined;
1839
+ });
1840
+ controls.updateComputedValue(displayData, function () {
1841
+ return isDisplayControl(def) ? createOverrideProxy(def.displayData, displayOverrides) : undefined;
1842
+ });
1843
+ controls.updateComputedValue(groupOptions, function () {
1844
+ var groupOptions = getGroupRendererOptions(def);
1845
+ return groupOptions ? createOverrideProxy(groupOptions, groupOptionsOverrides) : undefined;
1846
+ });
1847
+ controls.updateComputedValue(renderOptions, function () {
1848
+ var _def$renderOptions;
1849
+ return isDataControl(def) ? createOverrideProxy((_def$renderOptions = def.renderOptions) != null ? _def$renderOptions : {}, renderOptionsOverrides) : undefined;
1850
+ });
1851
+ evalDynamic(hidden, exports.DynamicPropertyType.Visible,
1852
+ // Make sure it's not null if no scripting
1853
+ function (x) {
1854
+ return x ? def.hidden : !!def.hidden;
1855
+ }, function (r) {
1856
+ return !r;
1857
+ });
1858
+ evalDynamic(readonly, exports.DynamicPropertyType.Readonly, function () {
1859
+ return isControlReadonly(def);
1860
+ }, function (r) {
1861
+ return !!r;
1862
+ });
1863
+ controls.createScopedEffect(function (c) {
1864
+ evalExpr(c, isControlDisabled(def), disabled, firstExpr(exports.DynamicPropertyType.Disabled), function (r) {
1865
+ return !!r;
1866
+ });
1867
+ }, definitionOverrides);
1868
+ controls.createScopedEffect(function (c) {
1869
+ var groupOptions = getGroupRendererOptions(def);
1870
+ evalExpr(c, groupOptions == null ? void 0 : groupOptions.columns, columns, groupOptions ? firstExpr(exports.DynamicPropertyType.GridColumns) : undefined, function (r) {
1871
+ return typeof r === "number" ? r : undefined;
1872
+ });
1873
+ }, groupOptionsOverrides);
1874
+ controls.createScopedEffect(function (c) {
1875
+ evalExpr(c, isDataControl(def) ? def.defaultValue : undefined, defaultValue, isDataControl(def) ? firstExpr(exports.DynamicPropertyType.DefaultValue) : undefined, function (r) {
1876
+ return r;
1877
+ });
1878
+ }, definitionOverrides);
1879
+ controls.createScopedEffect(function (c) {
1880
+ evalExpr(c, isActionControl(def) ? def.actionData : undefined, actionData, isActionControl(def) ? firstExpr(exports.DynamicPropertyType.ActionData) : undefined, function (r) {
1881
+ return r;
1882
+ });
1883
+ }, definitionOverrides);
1884
+ controls.createScopedEffect(function (c) {
1885
+ evalExpr(c, def.title, title, firstExpr(exports.DynamicPropertyType.Label), coerceString);
1886
+ }, definitionOverrides);
1887
+ controls.createSyncEffect(function () {
1888
+ if (isDisplayControl(def)) {
1889
+ if (display.value !== undefined) {
1890
+ text.value = isTextDisplay(def.displayData) ? display.value : NoOverride;
1891
+ html.value = isHtmlDisplay(def.displayData) ? display.value : NoOverride;
1892
+ } else {
1893
+ text.value = NoOverride;
1894
+ html.value = NoOverride;
1895
+ }
1896
+ }
1897
+ }, displayOverrides);
1898
+ return createOverrideProxy(def, definitionOverrides);
1899
+ function firstExpr(property) {
1900
+ var _def$dynamic;
1901
+ return (_def$dynamic = def.dynamic) == null || (_def$dynamic = _def$dynamic.find(function (x) {
1902
+ return x.type === property && x.expr.type;
1903
+ })) == null ? void 0 : _def$dynamic.expr;
1904
+ }
1905
+ function evalDynamic(control, property, init, coerce) {
1906
+ controls.createScopedEffect(function (c) {
1907
+ var x = firstExpr(property);
1908
+ evalExpr(c, init(x), control, x, coerce);
1909
+ }, scope);
1910
+ }
1911
+ }
1912
+ function coerceStyle(v) {
1913
+ return typeof v === "object" ? v : undefined;
1513
1914
  }
1514
- function createFormState(schemaInterface, evaluators) {
1515
- if (evaluators === void 0) {
1516
- evaluators = defaultEvaluators;
1915
+ function coerceString(v) {
1916
+ if (typeof v === "string") return v;
1917
+ if (v == null) return "";
1918
+ switch (typeof v) {
1919
+ case "number":
1920
+ case "boolean":
1921
+ return v.toString();
1922
+ default:
1923
+ return JSON.stringify(v);
1517
1924
  }
1518
- // console.log("createFormState");
1519
- var controlStates = controls.newControl({});
1520
- function evalExpression(e, context) {
1521
- var x = evaluators[e.type];
1522
- x == null || x(e, context);
1925
+ }
1926
+ function createFormStateNode(formNode, parent, options, nodeOptions) {
1927
+ var globals = controls.newControl({
1928
+ schemaInterface: options.schemaInterface,
1929
+ evalExpression: options.evalExpression,
1930
+ runAsync: options.runAsync,
1931
+ resolveChildren: options.resolveChildren,
1932
+ clearHidden: options.clearHidden
1933
+ });
1934
+ return new FormStateNodeImpl("ROOT", {}, formNode.definition, formNode, nodeOptions, globals, parent, undefined, 0, options.resolveChildren);
1935
+ }
1936
+ var noopUi = {
1937
+ ensureChildVisible: function ensureChildVisible(childIndex) {},
1938
+ ensureVisible: function ensureVisible() {},
1939
+ getDisabler: function getDisabler(type) {
1940
+ return function () {
1941
+ return function () {};
1942
+ };
1523
1943
  }
1524
- return {
1525
- evalExpression: evalExpression,
1526
- cleanup: function cleanup() {
1527
- // console.log("Cleanup form state");
1528
- controlStates.cleanup();
1529
- },
1530
- getExistingControlState: function getExistingControlState(parent, formNode, stateKey) {
1531
- var stateId = getControlStateId(parent, formNode, stateKey);
1532
- var control = controls.getCurrentFields(controlStates)[stateId];
1533
- if (control) {
1534
- var _getMetaValue;
1535
- return (_getMetaValue = controls.getMetaValue(control, "impl")) == null ? void 0 : _getMetaValue.value;
1536
- }
1537
- return undefined;
1538
- },
1539
- getControlState: function getControlState(parent, formNode, context, runAsync) {
1540
- var stateId = getControlStateId(parent, formNode, context.stateKey);
1541
- var controlImpl = controlStates.fields[stateId];
1542
- controlImpl.value = context;
1543
- function evalExpr(scope, init, nk, e, coerce) {
1544
- nk.value = init;
1545
- if (e != null && e.type) {
1546
- evalExpression(e, {
1547
- returnResult: function returnResult(r) {
1548
- nk.value = coerce(r);
1549
- },
1550
- scope: scope,
1551
- dataNode: parent,
1552
- variables: controlImpl.fields.variables,
1553
- schemaInterface: schemaInterface,
1554
- runAsync: runAsync
1555
- });
1556
- return true;
1944
+ };
1945
+ var FormStateNodeImpl = /*#__PURE__*/function () {
1946
+ function FormStateNodeImpl(childKey, meta, definition, form, nodeOptions, globals, parent, parentNode, childIndex, resolveChildren) {
1947
+ this.childKey = void 0;
1948
+ this.meta = void 0;
1949
+ this.form = void 0;
1950
+ this.globals = void 0;
1951
+ this.parent = void 0;
1952
+ this.parentNode = void 0;
1953
+ this.base = void 0;
1954
+ this.options = void 0;
1955
+ this.resolveChildren = void 0;
1956
+ this.ui = noopUi;
1957
+ this.childKey = childKey;
1958
+ this.meta = meta;
1959
+ this.form = form;
1960
+ this.globals = globals;
1961
+ this.parent = parent;
1962
+ this.parentNode = parentNode;
1963
+ var base = controls.newControl({
1964
+ readonly: false,
1965
+ visible: null,
1966
+ disabled: false,
1967
+ children: [],
1968
+ resolved: {
1969
+ definition: definition
1970
+ },
1971
+ parent: parent,
1972
+ allowedOptions: undefined,
1973
+ childIndex: childIndex,
1974
+ nodeOptions: nodeOptions,
1975
+ busy: false
1976
+ }, {
1977
+ dontClearError: true
1978
+ });
1979
+ this.base = base;
1980
+ this.options = base.fields.nodeOptions;
1981
+ base.meta["$FormState"] = this;
1982
+ this.resolveChildren = resolveChildren != null ? resolveChildren : globals.fields.resolveChildren.value;
1983
+ initFormState(definition, this, parentNode);
1984
+ }
1985
+ var _proto = FormStateNodeImpl.prototype;
1986
+ _proto.setBusy = function setBusy(busy) {
1987
+ this.base.fields.busy.value = busy;
1988
+ };
1989
+ _proto.setForceDisabled = function setForceDisabled(value) {
1990
+ return this.options.fields.forceDisabled.value = value;
1991
+ };
1992
+ _proto.attachUi = function attachUi(f) {
1993
+ this.ui = f;
1994
+ };
1995
+ _proto.setTouched = function setTouched(touched, notChildren) {
1996
+ this.base.setTouched(touched, notChildren);
1997
+ };
1998
+ _proto.validate = function validate() {
1999
+ this.children.forEach(function (child) {
2000
+ child.validate();
2001
+ });
2002
+ if (this.dataNode) {
2003
+ this.dataNode.control.validate();
2004
+ }
2005
+ return this.valid;
2006
+ };
2007
+ _proto.getChild = function getChild(index) {
2008
+ var _this$base$fields$chi;
2009
+ return (_this$base$fields$chi = this.base.fields.children.elements[index]) == null ? void 0 : _this$base$fields$chi.meta["$FormState"];
2010
+ };
2011
+ _proto.getChildCount = function getChildCount() {
2012
+ return this.base.fields.children.elements.length;
2013
+ };
2014
+ _proto.cleanup = function cleanup() {
2015
+ this.base.cleanup();
2016
+ };
2017
+ _proto.ensureMeta = function ensureMeta(key, init) {
2018
+ if (key in this.meta) return this.meta[key];
2019
+ var res = init(this.base);
2020
+ this.meta[key] = res;
2021
+ return res;
2022
+ };
2023
+ return _createClass(FormStateNodeImpl, [{
2024
+ key: "busy",
2025
+ get: function get() {
2026
+ return this.base.fields.busy.value;
2027
+ }
2028
+ }, {
2029
+ key: "evalExpression",
2030
+ get: function get() {
2031
+ return this.globals.fields.evalExpression.value;
2032
+ }
2033
+ }, {
2034
+ key: "runAsync",
2035
+ get: function get() {
2036
+ return this.globals.fields.runAsync.value;
2037
+ }
2038
+ }, {
2039
+ key: "schemaInterface",
2040
+ get: function get() {
2041
+ return this.globals.fields.schemaInterface.value;
2042
+ }
2043
+ }, {
2044
+ key: "forceDisabled",
2045
+ get: function get() {
2046
+ return this.options.fields.forceDisabled.value;
2047
+ }
2048
+ }, {
2049
+ key: "forceReadonly",
2050
+ get: function get() {
2051
+ return this.options.fields.forceReadonly.value;
2052
+ }
2053
+ }, {
2054
+ key: "forceHidden",
2055
+ get: function get() {
2056
+ return this.options.fields.forceHidden.value;
2057
+ }
2058
+ }, {
2059
+ key: "childIndex",
2060
+ get: function get() {
2061
+ return this.base.fields.childIndex.value;
2062
+ }
2063
+ }, {
2064
+ key: "children",
2065
+ get: function get() {
2066
+ return this.base.fields.children.elements.map(function (x) {
2067
+ return x.meta["$FormState"];
2068
+ });
2069
+ }
2070
+ }, {
2071
+ key: "uniqueId",
2072
+ get: function get() {
2073
+ return this.base.uniqueId.toString();
2074
+ }
2075
+ }, {
2076
+ key: "valid",
2077
+ get: function get() {
2078
+ return this.base.valid;
2079
+ }
2080
+ }, {
2081
+ key: "touched",
2082
+ get: function get() {
2083
+ return this.base.touched;
2084
+ }
2085
+ }, {
2086
+ key: "readonly",
2087
+ get: function get() {
2088
+ return this.base.fields.readonly.value;
2089
+ }
2090
+ }, {
2091
+ key: "visible",
2092
+ get: function get() {
2093
+ return this.base.fields.visible.value;
2094
+ }
2095
+ }, {
2096
+ key: "disabled",
2097
+ get: function get() {
2098
+ return this.base.fields.disabled.value;
2099
+ }
2100
+ }, {
2101
+ key: "clearHidden",
2102
+ get: function get() {
2103
+ return this.globals.fields.clearHidden.value;
2104
+ }
2105
+ }, {
2106
+ key: "variables",
2107
+ get: function get() {
2108
+ return this.options.fields.variables.value;
2109
+ }
2110
+ }, {
2111
+ key: "definition",
2112
+ get: function get() {
2113
+ return this.resolved.definition;
2114
+ }
2115
+ }, {
2116
+ key: "resolved",
2117
+ get: function get() {
2118
+ return this.base.fields.resolved.value;
2119
+ }
2120
+ }, {
2121
+ key: "dataNode",
2122
+ get: function get() {
2123
+ return this.base.fields.dataNode.value;
2124
+ }
2125
+ }]);
2126
+ }();
2127
+ function initFormState(def, impl, parentNode) {
2128
+ var base = impl.base,
2129
+ options = impl.options,
2130
+ schemaInterface = impl.schemaInterface,
2131
+ runAsync = impl.runAsync,
2132
+ evalExpression = impl.evalExpression,
2133
+ parent = impl.parent,
2134
+ variables = impl.variables;
2135
+ var evalExpr = createEvalExpr(evalExpression, {
2136
+ schemaInterface: schemaInterface,
2137
+ variables: variables,
2138
+ dataNode: parent,
2139
+ runAsync: runAsync
2140
+ });
2141
+ var scope = base;
2142
+ var _options$fields = options.fields,
2143
+ forceReadonly = _options$fields.forceReadonly,
2144
+ forceDisabled = _options$fields.forceDisabled,
2145
+ forceHidden = _options$fields.forceHidden;
2146
+ var resolved = base.fields.resolved.as();
2147
+ var _resolved$fields = resolved.fields,
2148
+ style = _resolved$fields.style,
2149
+ layoutStyle = _resolved$fields.layoutStyle,
2150
+ fieldOptions = _resolved$fields.fieldOptions,
2151
+ display = _resolved$fields.display,
2152
+ rd = _resolved$fields.definition;
2153
+ evalDynamic(display, exports.DynamicPropertyType.Display, undefined, coerceString);
2154
+ var _base$fields = base.fields,
2155
+ dataNode = _base$fields.dataNode,
2156
+ readonly = _base$fields.readonly,
2157
+ disabled = _base$fields.disabled,
2158
+ visible = _base$fields.visible,
2159
+ allowedOptions = _base$fields.allowedOptions;
2160
+ var definition = createEvaluatedDefinition(def, evalExpr, scope, display);
2161
+ rd.value = definition;
2162
+ evalDynamic(style, exports.DynamicPropertyType.Style, undefined, coerceStyle);
2163
+ evalDynamic(layoutStyle, exports.DynamicPropertyType.LayoutStyle, undefined, coerceStyle);
2164
+ evalDynamic(allowedOptions, exports.DynamicPropertyType.AllowedOptions, undefined, function (x) {
2165
+ return x;
2166
+ });
2167
+ controls.updateComputedValue(dataNode, function () {
2168
+ return lookupDataNode(definition, parent);
2169
+ });
2170
+ controls.updateComputedValue(visible, function () {
2171
+ if (forceHidden.value) return false;
2172
+ if (parentNode && !parentNode.visible) return parentNode.visible;
2173
+ var dn = dataNode.value;
2174
+ if (dn && (!validDataNode(dn) || hideDisplayOnly(dn, schemaInterface, definition))) return false;
2175
+ return definition.hidden == null ? null : !definition.hidden;
2176
+ });
2177
+ controls.updateComputedValue(readonly, function () {
2178
+ return (parentNode == null ? void 0 : parentNode.readonly) || forceReadonly.value || isControlReadonly(definition);
2179
+ });
2180
+ controls.updateComputedValue(disabled, function () {
2181
+ return (parentNode == null ? void 0 : parentNode.disabled) || forceDisabled.value || isControlDisabled(definition);
2182
+ });
2183
+ controls.updateComputedValue(fieldOptions, function () {
2184
+ var _allowedOptions$value;
2185
+ var dn = dataNode.value;
2186
+ if (!dn) return undefined;
2187
+ var fieldOptions = schemaInterface.getDataOptions(dn);
2188
+ var _allowed = (_allowedOptions$value = allowedOptions.value) != null ? _allowedOptions$value : [];
2189
+ var allowed = Array.isArray(_allowed) ? _allowed : [_allowed];
2190
+ return allowed.length > 0 ? allowed.map(function (x) {
2191
+ var _fieldOptions$find;
2192
+ return typeof x === "object" ? x : (_fieldOptions$find = fieldOptions == null ? void 0 : fieldOptions.find(function (y) {
2193
+ return y.value == x;
2194
+ })) != null ? _fieldOptions$find : {
2195
+ name: x.toString(),
2196
+ value: x
2197
+ };
2198
+ }).filter(function (x) {
2199
+ return x != null;
2200
+ }) : fieldOptions;
2201
+ });
2202
+ controls.createSyncEffect(function () {
2203
+ var dn = dataNode.value;
2204
+ if (dn) {
2205
+ dn.control.disabled = disabled.value;
2206
+ }
2207
+ }, scope);
2208
+ controls.createSyncEffect(function () {
2209
+ var dn = dataNode.value;
2210
+ if (dn) {
2211
+ dn.control.touched = base.touched;
2212
+ }
2213
+ }, scope);
2214
+ controls.createSyncEffect(function () {
2215
+ var dn = dataNode.value;
2216
+ if (dn) {
2217
+ base.touched = dn.control.touched;
2218
+ }
2219
+ }, scope);
2220
+ controls.createSyncEffect(function () {
2221
+ var dn = dataNode.value;
2222
+ base.setErrors(dn == null ? void 0 : dn.control.errors);
2223
+ }, scope);
2224
+ setupValidation(scope, impl.variables, definition, dataNode, schemaInterface, parent, visible, runAsync);
2225
+ controls.createSyncEffect(function () {
2226
+ var _dataNode$value;
2227
+ var dn = (_dataNode$value = dataNode.value) == null ? void 0 : _dataNode$value.control;
2228
+ if (dn && isDataControl(definition)) {
2229
+ var _definition$adornment, _definition$renderOpt;
2230
+ if (impl.visible == false) {
2231
+ if (impl.clearHidden && !definition.dontClearHidden) {
2232
+ // console.log("Clearing hidden");
2233
+ dn.value = undefined;
1557
2234
  }
1558
- return false;
2235
+ } else if (impl.visible && dn.value === undefined && definition.defaultValue != null && !((_definition$adornment = definition.adornments) != null && _definition$adornment.some(function (x) {
2236
+ return x.type === exports.ControlAdornmentType.Optional;
2237
+ })) && ((_definition$renderOpt = definition.renderOptions) == null ? void 0 : _definition$renderOpt.type) != exports.DataRenderType.NullToggle) {
2238
+ // console.log(
2239
+ // "Setting to default",
2240
+ // definition.defaultValue,
2241
+ // definition.field,
2242
+ // );
2243
+ // const [required, dcv] = isDataControl(definition)
2244
+ // ? [definition.required, definition.defaultValue]
2245
+ // : [false, undefined];
2246
+ // const field = ctx.dataNode?.schema.field;
2247
+ // return (
2248
+ // dcv ??
2249
+ // (field
2250
+ // ? ctx.dataNode!.elementIndex != null
2251
+ // ? elementValueForField(field)
2252
+ // : defaultValueForField(field, required)
2253
+ // : undefined)
2254
+ // );
2255
+ dn.value = definition.defaultValue;
1559
2256
  }
1560
- return createScopedMetaValue(formNode, controlImpl, "impl", function (scope) {
1561
- var _controlImpl$fields$v;
1562
- var cf = controlImpl.fields;
1563
- var definitionOverrides = createScoped(controlImpl, {});
1564
- createScoped(controlImpl, undefined);
1565
- var displayOverrides = createScoped(controlImpl, {});
1566
- var def = formNode.definition;
1567
- var definition = createOverrideProxy(def, definitionOverrides);
1568
- var of = definitionOverrides.fields;
1569
- var _displayOverrides$fie = displayOverrides.fields,
1570
- text = _displayOverrides$fie.text,
1571
- html = _displayOverrides$fie.html;
1572
- controls.updateComputedValue(of.displayData, function () {
1573
- return isDisplayControl(def) ? createOverrideProxy(def.displayData, displayOverrides) : undefined;
1574
- });
1575
- controls.createScopedEffect(function (c) {
1576
- evalExpr(c, def.hidden, of.hidden, firstExpr(formNode, exports.DynamicPropertyType.Visible), function (r) {
1577
- return !r;
1578
- });
1579
- }, definitionOverrides);
1580
- controls.createScopedEffect(function (c) {
1581
- evalExpr(c, isControlReadonly(def), of.readonly, firstExpr(formNode, exports.DynamicPropertyType.Readonly), function (r) {
1582
- return !!r;
1583
- });
1584
- }, definitionOverrides);
1585
- controls.createScopedEffect(function (c) {
1586
- evalExpr(c, isControlDisabled(def), of.disabled, firstExpr(formNode, exports.DynamicPropertyType.Disabled), function (r) {
1587
- return !!r;
1588
- });
1589
- }, definitionOverrides);
1590
- controls.createScopedEffect(function (c) {
1591
- evalExpr(c, isDataControl(def) ? def.defaultValue : undefined, of.defaultValue, isDataControl(def) ? firstExpr(formNode, exports.DynamicPropertyType.DefaultValue) : undefined, function (r) {
1592
- return r;
1593
- });
1594
- }, definitionOverrides);
1595
- controls.createScopedEffect(function (c) {
1596
- evalExpr(c, isActionControl(def) ? def.actionData : undefined, of.actionData, isActionControl(def) ? firstExpr(formNode, exports.DynamicPropertyType.ActionData) : undefined, function (r) {
1597
- return r;
1598
- });
1599
- }, definitionOverrides);
1600
- controls.createScopedEffect(function (c) {
1601
- evalExpr(c, def.title, of.title, firstExpr(formNode, exports.DynamicPropertyType.Label), coerceString);
1602
- }, definitionOverrides);
1603
- var control = createScoped(controlImpl, {
1604
- definition: definition,
1605
- dataNode: undefined,
1606
- schemaInterface: schemaInterface,
1607
- disabled: false,
1608
- readonly: false,
1609
- clearHidden: false,
1610
- hidden: false,
1611
- variables: (_controlImpl$fields$v = controlImpl.fields.variables.current.value) != null ? _controlImpl$fields$v : {},
1612
- stateId: stateId,
1613
- meta: controls.newControl({})
1614
- });
1615
- var _control$fields = control.fields,
1616
- dataNode = _control$fields.dataNode,
1617
- hidden = _control$fields.hidden,
1618
- readonly = _control$fields.readonly,
1619
- style = _control$fields.style,
1620
- layoutStyle = _control$fields.layoutStyle,
1621
- allowedOptions = _control$fields.allowedOptions,
1622
- disabled = _control$fields.disabled,
1623
- variables = _control$fields.variables,
1624
- display = _control$fields.display;
1625
- controls.createScopedEffect(function (c) {
1626
- return evalExpr(c, undefined, style, firstExpr(formNode, exports.DynamicPropertyType.Style), coerceStyle);
1627
- }, scope);
1628
- controls.createScopedEffect(function (c) {
1629
- return evalExpr(c, undefined, layoutStyle, firstExpr(formNode, exports.DynamicPropertyType.LayoutStyle), coerceStyle);
1630
- }, scope);
1631
- controls.createScopedEffect(function (c) {
1632
- return evalExpr(c, undefined, allowedOptions, firstExpr(formNode, exports.DynamicPropertyType.AllowedOptions), function (x) {
1633
- return x;
1634
- });
1635
- }, scope);
1636
- controls.createScopedEffect(function (c) {
1637
- return evalExpr(c, undefined, display, firstExpr(formNode, exports.DynamicPropertyType.Display), coerceString);
1638
- }, scope);
1639
- controls.updateComputedValue(dataNode, function () {
1640
- return lookupDataNode(definition, parent);
1641
- });
1642
- controls.updateComputedValue(hidden, function () {
1643
- return !!cf.hidden.value || definition.hidden || dataNode.value && (!validDataNode(dataNode.value) || hideDisplayOnly(dataNode.value, schemaInterface, definition));
1644
- });
1645
- controls.updateComputedValue(readonly, function () {
1646
- return !!cf.readonly.value || isControlReadonly(definition);
1647
- });
1648
- controls.updateComputedValue(disabled, function () {
1649
- return !!cf.disabled.value || of.disabled.value;
1650
- });
1651
- controls.updateComputedValue(variables, function () {
1652
- var _controlImpl$fields$v2;
1653
- return (_controlImpl$fields$v2 = controlImpl.fields.variables.value) != null ? _controlImpl$fields$v2 : {};
1654
- });
1655
- controls.createSyncEffect(function () {
1656
- var dn = dataNode.value;
1657
- if (dn) {
1658
- dn.control.disabled = disabled.value;
1659
- }
1660
- }, scope);
1661
- controls.createSyncEffect(function () {
1662
- if (isDisplayControl(def)) {
1663
- if (display.value !== undefined) {
1664
- text.value = isTextDisplay(def.displayData) ? display.value : NoOverride;
1665
- html.value = isHtmlDisplay(def.displayData) ? display.value : NoOverride;
1666
- } else {
1667
- text.value = NoOverride;
1668
- html.value = NoOverride;
1669
- }
1670
- }
1671
- }, displayOverrides);
1672
- setupValidation(controlImpl, definition, dataNode, schemaInterface, parent, formNode, hidden, runAsync);
1673
- controls.createSyncEffect(function () {
1674
- var _dataNode$value;
1675
- var dn = (_dataNode$value = dataNode.value) == null ? void 0 : _dataNode$value.control;
1676
- if (dn && isDataControl(definition)) {
1677
- var _definition$adornment, _definition$renderOpt;
1678
- if (definition.hidden) {
1679
- if (controlImpl.fields.clearHidden.value && !definition.dontClearHidden) {
1680
- // console.log("Clearing hidden");
1681
- dn.value = undefined;
1682
- }
1683
- } else if (dn.value === undefined && definition.defaultValue != null && !((_definition$adornment = definition.adornments) != null && _definition$adornment.some(function (x) {
1684
- return x.type === exports.ControlAdornmentType.Optional;
1685
- })) && ((_definition$renderOpt = definition.renderOptions) == null ? void 0 : _definition$renderOpt.type) != exports.DataRenderType.NullToggle) {
1686
- // console.log(
1687
- // "Setting to default",
1688
- // definition.defaultValue,
1689
- // definition.field,
1690
- // );
1691
- // const [required, dcv] = isDataControl(definition)
1692
- // ? [definition.required, definition.defaultValue]
1693
- // : [false, undefined];
1694
- // const field = ctx.dataNode?.schema.field;
1695
- // return (
1696
- // dcv ??
1697
- // (field
1698
- // ? ctx.dataNode!.elementIndex != null
1699
- // ? elementValueForField(field)
1700
- // : defaultValueForField(field, required)
1701
- // : undefined)
1702
- // );
1703
- dn.value = definition.defaultValue;
1704
- }
1705
- }
1706
- }, scope);
1707
- return createOverrideProxy(control.current.value, control);
1708
- });
1709
2257
  }
2258
+ }, scope);
2259
+ initChildren(impl);
2260
+ function firstExpr(property) {
2261
+ var _def$dynamic2;
2262
+ return (_def$dynamic2 = def.dynamic) == null || (_def$dynamic2 = _def$dynamic2.find(function (x) {
2263
+ return x.type === property && x.expr.type;
2264
+ })) == null ? void 0 : _def$dynamic2.expr;
2265
+ }
2266
+ function evalDynamic(control, property, init, coerce) {
2267
+ controls.createScopedEffect(function (c) {
2268
+ return evalExpr(c, init, control, firstExpr(property), coerce);
2269
+ }, scope);
2270
+ }
2271
+ }
2272
+ function combineVariables(v1, v2) {
2273
+ if (!v1) return v2;
2274
+ if (!v2) return v1;
2275
+ return function (c) {
2276
+ return _extends({}, v1(c), v2(c));
1710
2277
  };
1711
2278
  }
1712
- function firstExpr(formNode, property) {
1713
- var _formNode$definition$;
1714
- return (_formNode$definition$ = formNode.definition.dynamic) == null || (_formNode$definition$ = _formNode$definition$.find(function (x) {
1715
- return x.type === property && x.expr.type;
1716
- })) == null ? void 0 : _formNode$definition$.expr;
2279
+ function initChildren(formImpl) {
2280
+ var childMap = new Map();
2281
+ controls.createSyncEffect(function () {
2282
+ var base = formImpl.base,
2283
+ resolveChildren = formImpl.resolveChildren;
2284
+ var children = base.fields.children;
2285
+ var kids = resolveChildren(formImpl);
2286
+ var scope = base;
2287
+ var detached = controls.updateElements(children, function () {
2288
+ return kids.map(function (_ref, childIndex) {
2289
+ var childKey = _ref.childKey,
2290
+ create = _ref.create;
2291
+ var child = childMap.get(childKey);
2292
+ if (child) {
2293
+ child.fields.childIndex.value = childIndex;
2294
+ } else {
2295
+ var _cc$definition, _cc$parent;
2296
+ var meta = {};
2297
+ var cc = create(scope, meta);
2298
+ var newOptions = {
2299
+ forceHidden: false,
2300
+ forceDisabled: false,
2301
+ forceReadonly: false,
2302
+ variables: combineVariables(formImpl.variables, cc.variables)
2303
+ };
2304
+ var fsChild = new FormStateNodeImpl(childKey, meta, (_cc$definition = cc.definition) != null ? _cc$definition : groupedControl([]), cc.node === undefined ? formImpl.form : cc.node, newOptions, formImpl.globals, (_cc$parent = cc.parent) != null ? _cc$parent : formImpl.parent, formImpl, childIndex, cc.resolveChildren);
2305
+ child = fsChild.base;
2306
+ childMap.set(childKey, child);
2307
+ }
2308
+ return child;
2309
+ });
2310
+ });
2311
+ detached.forEach(function (child) {
2312
+ return child.cleanup();
2313
+ });
2314
+ }, formImpl.base);
1717
2315
  }
1718
- function coerceStyle(v) {
1719
- return typeof v === "object" ? v : undefined;
2316
+ function visitFormState(node, visitFn) {
2317
+ var v = visitFn(node);
2318
+ if (v !== undefined) return v;
2319
+ var childCount = node.getChildCount();
2320
+ for (var i = 0; i < childCount; i++) {
2321
+ var res = visitFormState(node.getChild(i), visitFn);
2322
+ if (res !== undefined) return res;
2323
+ }
2324
+ return undefined;
1720
2325
  }
1721
- function coerceString(v) {
1722
- var _v$toString;
1723
- return typeof v === "string" ? v : (_v$toString = v == null ? void 0 : v.toString()) != null ? _v$toString : "";
1724
- }
1725
- function createScopedMetaValue(formNode, c, key, init) {
1726
- return controls.ensureMetaValue(c, key, function () {
1727
- var holder = createScoped(c, undefined, {
1728
- equals: function equals(a, b) {
1729
- return a === b;
2326
+
2327
+ function defaultResolveChildNodes(formStateNode) {
2328
+ var resolved = formStateNode.resolved,
2329
+ data = formStateNode.dataNode,
2330
+ schemaInterface = formStateNode.schemaInterface,
2331
+ parent = formStateNode.parent,
2332
+ node = formStateNode.form;
2333
+ if (!node) return [];
2334
+ var def = resolved.definition;
2335
+ if (isDataControl(def)) {
2336
+ var _def$renderOptions;
2337
+ if (!data) return [];
2338
+ var type = (_def$renderOptions = def.renderOptions) == null ? void 0 : _def$renderOptions.type;
2339
+ if (type === exports.DataRenderType.CheckList || type === exports.DataRenderType.Radio) {
2340
+ var n = node.getChildNodes();
2341
+ if (n.length > 0 && resolved.fieldOptions) {
2342
+ return resolved.fieldOptions.map(function (x) {
2343
+ var _x$value;
2344
+ return {
2345
+ childKey: (_x$value = x.value) == null ? void 0 : _x$value.toString(),
2346
+ create: function create(scope, meta) {
2347
+ meta["fieldOptionValue"] = x.value;
2348
+ var vars = createScopedComputed(scope, function () {
2349
+ return {
2350
+ option: x,
2351
+ optionSelected: isOptionSelected(schemaInterface, x, data)
2352
+ };
2353
+ });
2354
+ return {
2355
+ definition: {
2356
+ type: exports.ControlDefinitionType.Group,
2357
+ groupOptions: {
2358
+ type: exports.GroupRenderType.Contents
2359
+ }
2360
+ },
2361
+ parent: parent,
2362
+ node: node,
2363
+ variables: function variables(changes) {
2364
+ return {
2365
+ formData: controls.trackedValue(vars, changes)
2366
+ };
2367
+ }
2368
+ };
2369
+ }
2370
+ };
2371
+ });
2372
+ }
2373
+ return [];
2374
+ }
2375
+ if (data.schema.field.collection && data.elementIndex == null) return resolveArrayChildren(data, node);
2376
+ }
2377
+ return node.getChildNodes().map(function (x) {
2378
+ return {
2379
+ childKey: x.id,
2380
+ create: function create() {
2381
+ return {
2382
+ node: x,
2383
+ parent: data != null ? data : parent,
2384
+ definition: x.definition
2385
+ };
1730
2386
  }
1731
- });
1732
- var effect = controls.createScopedEffect(function (c) {
1733
- return holder.value = init(c);
1734
- }, holder);
1735
- effect.run = function () {
1736
- console.log("ControlState being recreated:", effect.subscriptions.map(function (x) {
1737
- var _x$;
1738
- return ((_x$ = x[1]) == null ? void 0 : _x$.mask) + " " + jsonPathString(controls.getControlPath(x[0], controls.unsafeRestoreControl(formNode.definition)));
1739
- }));
1740
2387
  };
1741
- return holder;
1742
- }).value;
1743
- }
1744
- function createOverrideProxy(proxyFor, handlers) {
1745
- var overrides = controls.getCurrentFields(handlers);
1746
- var allOwn = Reflect.ownKeys(proxyFor);
1747
- Reflect.ownKeys(overrides).forEach(function (k) {
1748
- if (!allOwn.includes(k)) allOwn.push(k);
1749
2388
  });
1750
- return new Proxy(proxyFor, {
1751
- get: function get(target, p, receiver) {
1752
- if (Object.hasOwn(overrides, p)) {
1753
- var nv = overrides[p].value;
1754
- if (nv !== NoOverride) return nv;
2389
+ }
2390
+ function resolveArrayChildren(data, node, adjustChild) {
2391
+ var childNodes = node.getChildNodes();
2392
+ var childCount = childNodes.length;
2393
+ var singleChild = childCount === 1 ? childNodes[0] : null;
2394
+ return data.control.as().elements.map(function (x, i) {
2395
+ return {
2396
+ childKey: x.uniqueId,
2397
+ create: function create() {
2398
+ var _adjustChild;
2399
+ return _extends({
2400
+ definition: !childCount ? {
2401
+ type: exports.ControlDefinitionType.Data,
2402
+ field: ".",
2403
+ hideTitle: true,
2404
+ renderOptions: {
2405
+ type: exports.DataRenderType.Standard
2406
+ }
2407
+ } : singleChild ? singleChild.definition : groupedControl([]),
2408
+ node: singleChild != null ? singleChild : node,
2409
+ parent: data.getChildElement(i)
2410
+ }, (_adjustChild = adjustChild == null ? void 0 : adjustChild(x, i)) != null ? _adjustChild : {});
1755
2411
  }
1756
- return Reflect.get(target, p, receiver);
1757
- },
1758
- ownKeys: function ownKeys(target) {
1759
- return allOwn;
1760
- },
1761
- has: function has(target, p) {
1762
- return Reflect.has(proxyFor, p) || Reflect.has(overrides, p);
1763
- },
1764
- getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, k) {
1765
- if (Object.hasOwn(overrides, k)) return {
1766
- enumerable: true,
1767
- configurable: true
1768
- };
1769
- return Reflect.getOwnPropertyDescriptor(target, k);
1770
- }
2412
+ };
1771
2413
  });
1772
2414
  }
1773
- var NoValue = function NoValue() {};
1774
- var NoOverride = new NoValue();
2415
+ function isOptionSelected(schemaInterface, option, data) {
2416
+ if (data.schema.field.collection) {
2417
+ var _data$control$as$valu;
2418
+ return !!((_data$control$as$valu = data.control.as().value) != null && _data$control$as$valu.includes(option.value));
2419
+ }
2420
+ return schemaInterface.compareValue(data.schema.field, data.control.value, option.value) === 0;
2421
+ }
1775
2422
 
1776
2423
  exports.DefaultSchemaInterface = DefaultSchemaInterface;
1777
2424
  exports.FormNode = FormNode;
1778
2425
  exports.FormTree = FormTree;
2426
+ exports.NoOverride = NoOverride;
1779
2427
  exports.SchemaDataNode = SchemaDataNode;
1780
2428
  exports.SchemaDataTree = SchemaDataTree;
1781
2429
  exports.SchemaDataTreeImpl = SchemaDataTreeImpl;
1782
2430
  exports.SchemaNode = SchemaNode;
1783
2431
  exports.SchemaTree = SchemaTree;
2432
+ exports.accordionOptions = accordionOptions;
2433
+ exports.actionControl = actionControl;
1784
2434
  exports.addFieldOption = addFieldOption;
2435
+ exports.adornmentOptions = adornmentOptions;
2436
+ exports.autocompleteOptions = autocompleteOptions;
1785
2437
  exports.boolField = boolField;
1786
2438
  exports.buildSchema = buildSchema;
2439
+ exports.checkListOptions = checkListOptions;
2440
+ exports.coerceString = coerceString;
2441
+ exports.coerceStyle = coerceStyle;
2442
+ exports.combineVariables = combineVariables;
2443
+ exports.compoundControl = compoundControl;
1787
2444
  exports.compoundField = compoundField;
1788
2445
  exports.createControlMap = createControlMap;
2446
+ exports.createEvalExpr = createEvalExpr;
2447
+ exports.createEvaluatedDefinition = createEvaluatedDefinition;
1789
2448
  exports.createFormLookup = createFormLookup;
1790
- exports.createFormState = createFormState;
2449
+ exports.createFormStateNode = createFormStateNode;
1791
2450
  exports.createFormTree = createFormTree;
1792
2451
  exports.createOverrideProxy = createOverrideProxy;
1793
2452
  exports.createSchemaDataNode = createSchemaDataNode;
@@ -1796,28 +2455,49 @@ exports.createSchemaNode = createSchemaNode;
1796
2455
  exports.createSchemaTree = createSchemaTree;
1797
2456
  exports.createScoped = createScoped;
1798
2457
  exports.createScopedComputed = createScopedComputed;
2458
+ exports.dataControl = dataControl;
2459
+ exports.dataExpr = dataExpr;
2460
+ exports.dataMatchExpr = dataMatchExpr;
1799
2461
  exports.dateField = dateField;
1800
2462
  exports.dateTimeField = dateTimeField;
2463
+ exports.dateValidator = dateValidator$1;
2464
+ exports.dateValidatorOptions = dateValidatorOptions;
1801
2465
  exports.defaultCompoundField = defaultCompoundField;
2466
+ exports.defaultEvaluators = defaultEvaluators;
2467
+ exports.defaultResolveChildNodes = defaultResolveChildNodes;
1802
2468
  exports.defaultScalarField = defaultScalarField;
1803
2469
  exports.defaultSchemaInterface = defaultSchemaInterface;
2470
+ exports.displayOnlyOptions = displayOnlyOptions;
1804
2471
  exports.doubleField = doubleField;
2472
+ exports.dynamicDefaultValue = dynamicDefaultValue;
2473
+ exports.dynamicDisabled = dynamicDisabled;
2474
+ exports.dynamicReadonly = dynamicReadonly;
2475
+ exports.dynamicVisibility = dynamicVisibility;
2476
+ exports.emptyGroupDefinition = emptyGroupDefinition;
2477
+ exports.fieldEqExpr = fieldEqExpr;
2478
+ exports.fieldExpr = fieldExpr;
1805
2479
  exports.fieldPathForDefinition = fieldPathForDefinition;
1806
2480
  exports.findField = findField;
1807
2481
  exports.fontAwesomeIcon = fontAwesomeIcon;
1808
- exports.getControlStateId = getControlStateId;
1809
2482
  exports.getDisplayOnlyOptions = getDisplayOnlyOptions;
1810
2483
  exports.getGroupRendererOptions = getGroupRendererOptions;
2484
+ exports.getHasMoreControl = getHasMoreControl;
1811
2485
  exports.getJsonPath = getJsonPath;
2486
+ exports.getLoadingControl = getLoadingControl;
1812
2487
  exports.getMetaFields = getMetaFields;
2488
+ exports.getParentDataPath = getParentDataPath;
2489
+ exports.getRefreshingControl = getRefreshingControl;
1813
2490
  exports.getRootDataNode = getRootDataNode;
1814
2491
  exports.getSchemaFieldList = getSchemaFieldList;
1815
2492
  exports.getSchemaNodePath = getSchemaNodePath;
1816
2493
  exports.getSchemaNodePathString = getSchemaNodePathString;
1817
2494
  exports.getSchemaPath = getSchemaPath;
1818
2495
  exports.getTagParam = getTagParam;
2496
+ exports.groupedControl = groupedControl;
1819
2497
  exports.hideDisplayOnly = hideDisplayOnly;
2498
+ exports.htmlDisplayControl = htmlDisplayControl;
1820
2499
  exports.intField = intField;
2500
+ exports.isAccordionRenderer = isAccordionRenderer;
1821
2501
  exports.isActionControl = isActionControl;
1822
2502
  exports.isArrayRenderer = isArrayRenderer;
1823
2503
  exports.isAutoCompleteClasses = isAutoCompleteClasses;
@@ -1846,7 +2526,14 @@ exports.isTextDisplay = isTextDisplay;
1846
2526
  exports.isTextfieldRenderer = isTextfieldRenderer;
1847
2527
  exports.isWizardRenderer = isWizardRenderer;
1848
2528
  exports.jsonPathString = jsonPathString;
2529
+ exports.jsonataEval = jsonataEval;
2530
+ exports.jsonataExpr = jsonataExpr;
2531
+ exports.jsonataOptions = jsonataOptions;
2532
+ exports.jsonataValidator = jsonataValidator$1;
2533
+ exports.jsonataValidatorOptions = jsonataValidatorOptions;
1849
2534
  exports.legacyFormNode = legacyFormNode;
2535
+ exports.lengthValidator = lengthValidator$1;
2536
+ exports.lengthValidatorOptions = lengthValidatorOptions;
1850
2537
  exports.lookupDataNode = lookupDataNode;
1851
2538
  exports.makeCompoundField = makeCompoundField;
1852
2539
  exports.makeParamTag = makeParamTag;
@@ -1856,26 +2543,37 @@ exports.mergeField = mergeField;
1856
2543
  exports.mergeFields = mergeFields;
1857
2544
  exports.mergeOption = mergeOption;
1858
2545
  exports.missingField = missingField;
2546
+ exports.noopUi = noopUi;
2547
+ exports.notEmptyExpr = notEmptyExpr;
2548
+ exports.radioButtonOptions = radioButtonOptions;
1859
2549
  exports.relativePath = relativePath;
1860
2550
  exports.relativeSegmentPath = relativeSegmentPath;
2551
+ exports.renderOptionsFor = renderOptionsFor;
2552
+ exports.resolveArrayChildren = resolveArrayChildren;
1861
2553
  exports.resolveSchemaNode = resolveSchemaNode;
1862
2554
  exports.resolveSchemas = resolveSchemas;
1863
2555
  exports.schemaDataForFieldPath = schemaDataForFieldPath;
1864
2556
  exports.schemaDataForFieldRef = schemaDataForFieldRef;
2557
+ exports.schemaForDataPath = schemaForDataPath;
1865
2558
  exports.schemaForFieldPath = schemaForFieldPath;
1866
2559
  exports.schemaForFieldRef = schemaForFieldRef;
1867
2560
  exports.stringField = stringField;
1868
2561
  exports.stringOptionsField = stringOptionsField;
2562
+ exports.textDisplayControl = textDisplayControl;
2563
+ exports.textfieldOptions = textfieldOptions;
1869
2564
  exports.timeField = timeField;
1870
2565
  exports.traverseData = traverseData;
1871
2566
  exports.traverseParents = traverseParents;
1872
2567
  exports.traverseSchemaPath = traverseSchemaPath;
2568
+ exports.uuidEval = uuidEval;
2569
+ exports.uuidExpr = uuidExpr;
1873
2570
  exports.validDataNode = validDataNode;
2571
+ exports.validatorOptions = validatorOptions;
1874
2572
  exports.visitControlData = visitControlData;
1875
2573
  exports.visitControlDataArray = visitControlDataArray;
1876
2574
  exports.visitControlDefinition = visitControlDefinition;
1877
2575
  exports.visitFormData = visitFormData;
1878
2576
  exports.visitFormDataInContext = visitFormDataInContext;
1879
- exports.visitFormDataNode = visitFormDataNode;
2577
+ exports.visitFormState = visitFormState;
1880
2578
  exports.withScalarOptions = withScalarOptions;
1881
2579
  //# sourceMappingURL=index.cjs.map