@react-typed-forms/schemas-html 4.1.1 → 5.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.
Files changed (33) hide show
  1. package/lib/adornments/optionalAdornment.d.ts +4 -25
  2. package/lib/components/ArrayElementRenderer.d.ts +1 -4
  3. package/lib/components/AutocompleteRenderer.d.ts +1 -7
  4. package/lib/components/CheckRenderer.d.ts +3 -29
  5. package/lib/components/ControlInput.d.ts +2 -1
  6. package/lib/components/DefaultAccordion.d.ts +13 -6
  7. package/lib/components/DefaultArrayRenderer.d.ts +2 -9
  8. package/lib/components/DefaultDialogRenderer.d.ts +3 -7
  9. package/lib/components/DefaultDisplay.d.ts +3 -6
  10. package/lib/components/DefaultDisplayOnly.d.ts +3 -3
  11. package/lib/components/DefaultGroupRenderer.d.ts +2 -16
  12. package/lib/components/DefaultLayout.d.ts +4 -8
  13. package/lib/components/DefaultVisibility.d.ts +1 -1
  14. package/lib/components/DefaultWizardRenderer.d.ts +1 -27
  15. package/lib/components/GridRenderer.d.ts +1 -5
  16. package/lib/components/HtmlCheckButtons.d.ts +3 -0
  17. package/lib/components/JsonataRenderer.d.ts +2 -1
  18. package/lib/components/MultilineTextfield.d.ts +2 -1
  19. package/lib/components/ScrollListRenderer.d.ts +2 -0
  20. package/lib/components/SelectDataRenderer.d.ts +3 -6
  21. package/lib/components/TabsRenderer.d.ts +1 -9
  22. package/lib/components/ValueForFieldRenderer.d.ts +2 -10
  23. package/lib/createButtonActionRenderer.d.ts +2 -20
  24. package/lib/createDefaultRenderers.d.ts +8 -83
  25. package/lib/index.cjs +727 -553
  26. package/lib/index.cjs.map +1 -1
  27. package/lib/index.d.ts +3 -1
  28. package/lib/index.js +664 -478
  29. package/lib/index.js.map +1 -1
  30. package/lib/rendererOptions.d.ts +218 -0
  31. package/lib/tailwind.d.ts +14 -2
  32. package/package.json +9 -8
  33. package/lib/components/VisibleChildrenRenderer.d.ts +0 -14
package/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import clsx from 'clsx';
2
- import { DisplayDataType, rendererClass, coerceToString, getOverrideClass, FieldType, createDataRenderer, fieldOptionAdornment, DataRenderType, createLayoutRenderer, renderLayoutParts, createGroupRenderer, GroupRenderType, fontAwesomeIcon, deepMerge, createAction, IconPlacement, visitFormDataInContext, validationVisitor, ActionStyle, isTabsRenderer, isGridRenderer, isWizardRenderer, isDialogRenderer, isSelectChildRenderer, isFlexRenderer, isInlineRenderer, useExpression, createVisibilityRenderer, getJsonPath, ExpressionType, getLastDefinedValue, getNullToggler, mergeObjects, isArrayRenderer, isCompoundField, ControlDefinitionType, createArrayActions, getLengthRestrictions, applyArrayLengthRestrictions, buildSchema, stringField, boolField, schemaDataForFieldRef, schemaForFieldRef, defaultControlForField, createSchemaTree, useControlRendererComponent, makeSchemaDataNode, createAdornmentRenderer, getIsEditing, appendMarkupAt, AdornmentPlacement, wrapMarkup, getAllValues, ControlAdornmentType, getExternalEditData, createActionRenderer, isDataGroupRenderer, isDisplayOnlyRenderer, hasOptions, isTextfieldRenderer, isOptionalAdornment, isSetFieldAdornment, wrapLayout, isIconAdornment, isAccordionAdornment, LabelType, IconLibrary } from '@react-typed-forms/schemas';
1
+ import { useState, useMemo, useEffect, Fragment as Fragment$1, useId, createElement, useRef, isValidElement } from 'react';
2
+ import clsx, { clsx as clsx$1 } from 'clsx';
3
+ import { DisplayDataType, rendererClass, coerceToString, getOverrideClass, FieldType, createDataRenderer, fieldOptionAdornment, DataRenderType, setIncluded, useElementSelectedRenderer, createLayoutRenderer, renderLayoutParts, createGroupRenderer, GroupRenderType, DefaultFormNodeUi, fontAwesomeIcon, deepMerge, createAction, IconPlacement, ActionStyle, schemaDataForFieldRef, isTabsRenderer, isGridRenderer, isWizardRenderer, isDialogRenderer, isAccordionRenderer, isSelectChildRenderer, isFlexRenderer, isInlineRenderer, useExpression, createVisibilityRenderer, getJsonPath, ExpressionType, getLastDefinedValue, getNullToggler, mergeObjects, isArrayRenderer, createArrayActions, getLengthRestrictions, applyArrayLengthRestrictions, buildSchema, stringField, boolField, schemaForFieldRef, defaultControlForField, createSchemaTree, createFormTree, RenderForm, createSchemaDataNode, createAdornmentRenderer, getIsEditing, appendMarkupAt, AdornmentPlacement, wrapMarkup, getAllValues, ControlAdornmentType, getExternalEditData, makeSchemaDataNode, createActionRenderer, getLoadingControl, getHasMoreControl, NoOpControlActionContext, isDataGroupRenderer, isDisplayOnlyRenderer, hasOptions, isTextfieldRenderer, isOptionalAdornment, isSetFieldAdornment, wrapLayout, isIconAdornment, isAccordionAdornment, LabelType, IconLibrary } from '@react-typed-forms/schemas';
3
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { useComponentTracking, formControlProps, useControl, useControlEffect, RenderArrayElements, useComputed, RenderElements, controlValues, removeElement, trackedValue, setFields, newControl, Fcheckbox as Fcheckbox$1 } from '@react-typed-forms/core';
5
- import { useState, useMemo, useEffect, Fragment as Fragment$1, createElement, useRef } from 'react';
5
+ import { useComponentTracking, formControlProps, useControl, useControlEffect, useComputed, trackedValue, RenderControl, controlValues, removeElement, setFields, newControl, Fcheckbox as Fcheckbox$1, RenderElements, RenderArrayElements } from '@react-typed-forms/core';
6
6
  import { createOverlayState, Dialog, Modal } from '@astroapps/aria-base';
7
7
  import { useAutocomplete } from '@mui/base';
8
8
  import { useOverlayTriggerState } from '@react-stately/overlays';
@@ -96,13 +96,13 @@ function _objectWithoutPropertiesLoose(r, e) {
96
96
  if (null == r) return {};
97
97
  var t = {};
98
98
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
99
- if (e.includes(n)) continue;
99
+ if (-1 !== e.indexOf(n)) continue;
100
100
  t[n] = r[n];
101
101
  }
102
102
  return t;
103
103
  }
104
104
 
105
- const _excluded$4 = ["control", "convert", "renderer"],
105
+ const _excluded$4 = ["control", "convert", "renderer", "errorId"],
106
106
  _excluded2$2 = ["errorText", "value", "onChange", "ref"];
107
107
  function ControlInput(_ref) {
108
108
  var _effect = useComponentTracking();
@@ -110,11 +110,13 @@ function ControlInput(_ref) {
110
110
  let {
111
111
  control,
112
112
  convert,
113
- renderer
113
+ renderer,
114
+ errorId
114
115
  } = _ref,
115
116
  props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
116
117
  const _formControlProps = formControlProps(control),
117
118
  {
119
+ errorText,
118
120
  value,
119
121
  ref
120
122
  } = _formControlProps,
@@ -128,6 +130,8 @@ function ControlInput(_ref) {
128
130
  inputRef: ref,
129
131
  type: convert[0],
130
132
  value: textValue.value,
133
+ "aria-describedby": !!errorText ? errorId : undefined,
134
+ "aria-invalid": !!errorText || undefined,
131
135
  onChangeValue: e => {
132
136
  textValue.value = e;
133
137
  const converted = convert[1](e);
@@ -173,7 +177,8 @@ function createInputConversion(ft) {
173
177
  const _excluded$3 = ["state", "options", "className", "convert", "required", "emptyText", "requiredText", "readonly"];
174
178
  function createSelectRenderer(options = {}) {
175
179
  return createDataRenderer((props, asArray) => {
176
- var _props$options;
180
+ var _props$options, _renderOptions$requir;
181
+ const renderOptions = props.definition.renderOptions;
177
182
  return /*#__PURE__*/jsx(SelectDataRenderer, {
178
183
  className: rendererClass(props.className, options.className),
179
184
  state: props.control,
@@ -182,7 +187,7 @@ function createSelectRenderer(options = {}) {
182
187
  options: (_props$options = props.options) != null ? _props$options : [],
183
188
  required: props.required,
184
189
  emptyText: options.emptyText,
185
- requiredText: options.requiredText,
190
+ requiredText: (_renderOptions$requir = renderOptions == null ? void 0 : renderOptions.requiredText) != null ? _renderOptions$requir : options.requiredText,
186
191
  convert: createSelectConversion(props.field.type)
187
192
  });
188
193
  }, {
@@ -251,7 +256,7 @@ function createSelectConversion(ft) {
251
256
  const _excluded$2 = ["control", "type", "notValue", "renderer"],
252
257
  _excluded2$1 = ["value", "onChange", "errorText", "ref"];
253
258
  function createRadioRenderer(options = {}) {
254
- return createDataRenderer((p, renderer) => /*#__PURE__*/jsx(CheckButtons, _extends({
259
+ return createDataRenderer((p, renderer) => /*#__PURE__*/jsx(renderer.html.CheckButtons, _extends({
255
260
  classes: options,
256
261
  controlClasses: p.renderOptions
257
262
  }, p, {
@@ -270,7 +275,7 @@ function createRadioRenderer(options = {}) {
270
275
  });
271
276
  }
272
277
  function createCheckListRenderer(options = {}) {
273
- return createDataRenderer((p, renderer) => /*#__PURE__*/jsx(CheckButtons, _extends({
278
+ return createDataRenderer((p, renderer) => /*#__PURE__*/jsx(renderer.html.CheckButtons, _extends({
274
279
  classes: options,
275
280
  controlClasses: p.renderOptions
276
281
  }, p, {
@@ -292,80 +297,6 @@ function createCheckListRenderer(options = {}) {
292
297
  renderType: DataRenderType.CheckList
293
298
  });
294
299
  }
295
- function CheckButtons({
296
- control,
297
- options,
298
- readonly,
299
- className,
300
- id,
301
- type,
302
- isChecked,
303
- setChecked,
304
- entryAdornment,
305
- classes,
306
- controlClasses = {},
307
- renderer
308
- }) {
309
- var _effect = useComponentTracking();
310
- try {
311
- const {
312
- Button,
313
- Input,
314
- Label,
315
- Div
316
- } = renderer.html;
317
- const {
318
- disabled
319
- } = control;
320
- const name = "r" + control.uniqueId;
321
- return /*#__PURE__*/jsx(Div, {
322
- className: className,
323
- id: id,
324
- children: /*#__PURE__*/jsx(RenderArrayElements, {
325
- array: options == null ? void 0 : options.filter(x => x.value != null),
326
- children: (o, i) => {
327
- const checked = useComputed(() => isChecked(control, o)).value;
328
- const selOrUnsel = checked ? rendererClass(controlClasses == null ? void 0 : controlClasses.selectedClass, classes.selectedClass) : rendererClass(controlClasses == null ? void 0 : controlClasses.notSelectedClass, classes.notSelectedClass);
329
- return /*#__PURE__*/jsxs(Button, {
330
- className: clsx(rendererClass(controlClasses == null ? void 0 : controlClasses.entryWrapperClass, classes.entryWrapperClass), selOrUnsel),
331
- onClick: () => !readonly && setChecked(control, o, !checked),
332
- children: [/*#__PURE__*/jsxs(Div, {
333
- className: classes.entryClass,
334
- children: [/*#__PURE__*/jsx(Input, {
335
- id: name + "_" + i,
336
- className: classes.checkClass,
337
- type: type,
338
- name: name,
339
- readOnly: readonly,
340
- disabled: disabled,
341
- checked: checked,
342
- onChangeChecked: x => {
343
- !readonly && setChecked(control, o, x);
344
- }
345
- }), /*#__PURE__*/jsx(Label, {
346
- className: classes.labelClass,
347
- htmlFor: name + "_" + i,
348
- children: o.name
349
- })]
350
- }), entryAdornment == null ? void 0 : entryAdornment(o, i, checked)]
351
- });
352
- }
353
- })
354
- });
355
- } finally {
356
- _effect();
357
- }
358
- }
359
- function setIncluded(array, elem, included) {
360
- const already = array.includes(elem);
361
- if (included === already) {
362
- return array;
363
- }
364
- if (included) {
365
- return [...array, elem];
366
- }
367
- return array.filter(e => e !== elem);
368
- }
369
300
  function createCheckboxRenderer(options = {}) {
370
301
  return createDataRenderer((props, renderer) => p => _extends({}, p, {
371
302
  label: undefined,
@@ -398,24 +329,13 @@ function CheckBoxSelected({
398
329
  renderer,
399
330
  options
400
331
  }) {
401
- var _effect2 = useComponentTracking();
332
+ var _effect = useComponentTracking();
402
333
  try {
334
+ var _p$label;
403
335
  const {
404
336
  Div
405
337
  } = renderer.html;
406
- const elementValue = useControl();
407
- useEffect(() => {
408
- props.runExpression(elementValue, props.renderOptions.elementExpression, v => elementValue.value = v);
409
- });
410
- const isSelected = useComputed(() => {
411
- var _props$control$as$val, _props$control$as$val2;
412
- return (_props$control$as$val = (_props$control$as$val2 = props.control.as().value) == null ? void 0 : _props$control$as$val2.includes(elementValue.current.value)) != null ? _props$control$as$val : false;
413
- });
414
- const selControl = useControl(() => isSelected.current.value);
415
- selControl.value = isSelected.value;
416
- useControlEffect(() => selControl.value, v => {
417
- props.control.as().setValue(x => setIncluded(x != null ? x : [], elementValue.value, v));
418
- });
338
+ const selControl = useElementSelectedRenderer(props);
419
339
  return /*#__PURE__*/jsxs(Div, {
420
340
  className: rendererClass(props.className, options.entryClass),
421
341
  children: [/*#__PURE__*/jsx(Fcheckbox, {
@@ -424,10 +344,10 @@ function CheckBoxSelected({
424
344
  style: props.style,
425
345
  className: options.checkClass,
426
346
  renderer: renderer
427
- }), p.label && renderer.renderLabel(p.label, undefined, undefined)]
347
+ }), ((_p$label = p.label) == null ? void 0 : _p$label.label) && renderer.renderLabel(p.label, undefined, undefined)]
428
348
  });
429
349
  } finally {
430
- _effect2();
350
+ _effect();
431
351
  }
432
352
  }
433
353
  function CheckBox({
@@ -436,7 +356,7 @@ function CheckBox({
436
356
  renderer,
437
357
  options
438
358
  }) {
439
- var _effect3 = useComponentTracking();
359
+ var _effect2 = useComponentTracking();
440
360
  try {
441
361
  const {
442
362
  Div
@@ -452,11 +372,11 @@ function CheckBox({
452
372
  }), p.label && renderer.renderLabel(p.label, undefined, undefined)]
453
373
  });
454
374
  } finally {
455
- _effect3();
375
+ _effect2();
456
376
  }
457
377
  }
458
378
  function Fcheckbox(_ref) {
459
- var _effect4 = useComponentTracking();
379
+ var _effect3 = useComponentTracking();
460
380
  try {
461
381
  let {
462
382
  control,
@@ -483,7 +403,7 @@ function Fcheckbox(_ref) {
483
403
  type: type
484
404
  }, others));
485
405
  } finally {
486
- _effect4();
406
+ _effect3();
487
407
  }
488
408
  }
489
409
 
@@ -511,8 +431,9 @@ function DefaultLayout({
511
431
  Span
512
432
  }
513
433
  },
514
- renderError = e => e && /*#__PURE__*/jsx(Div, {
434
+ renderError = (e, errorId) => e && /*#__PURE__*/jsx(Div, {
515
435
  children: /*#__PURE__*/jsx(Span, {
436
+ id: errorId,
516
437
  className: errorClass,
517
438
  children: e
518
439
  })
@@ -522,7 +443,8 @@ function DefaultLayout({
522
443
  controlStart,
523
444
  label,
524
445
  children,
525
- errorControl
446
+ errorControl,
447
+ errorId
526
448
  }
527
449
  }) {
528
450
  var _effect = useComponentTracking();
@@ -530,7 +452,7 @@ function DefaultLayout({
530
452
  const ec = errorControl;
531
453
  const errorText = ec && ec.touched ? ec.error : undefined;
532
454
  return /*#__PURE__*/jsxs(Fragment, {
533
- children: [label, controlStart, children, renderError(errorText), controlEnd]
455
+ children: [label, controlStart, children, renderError(errorText, errorId), controlEnd]
534
456
  });
535
457
  } finally {
536
458
  _effect();
@@ -551,7 +473,10 @@ function DefaultDisplayOnly({
551
473
  var _effect = useComponentTracking();
552
474
  try {
553
475
  var _ref;
554
- const text = state.display != null ? state.display : (_ref = schemaInterface.isEmptyValue(dataNode.schema.field, dataNode.control.value) ? emptyText : schemaInterface.textValueForData(dataNode)) != null ? _ref : "";
476
+ const {
477
+ display
478
+ } = state.resolved;
479
+ const text = display != null ? display : (_ref = schemaInterface.isEmptyValue(dataNode.schema.field, dataNode.control.value) ? emptyText : schemaInterface.textValueForData(dataNode)) != null ? _ref : "";
555
480
  const {
556
481
  Div
557
482
  } = renderer.html;
@@ -567,110 +492,33 @@ function DefaultDisplayOnly({
567
492
  }
568
493
  }
569
494
 
570
- function DefaultAccordion({
571
- children,
572
- accordion,
573
- contentStyle,
574
- contentClassName,
575
- designMode,
576
- iconOpen,
577
- iconClosed,
578
- className,
579
- renderTitle = t => t,
580
- renderToggler,
581
- renderers,
582
- titleClass,
583
- useCss,
584
- dataContext
585
- }) {
586
- var _effect = useComponentTracking();
587
- try {
588
- var _dataContext$dataNode;
589
- const {
590
- Button,
591
- I,
592
- Div,
593
- Label
594
- } = renderers.html;
595
- const dataControl = ((_dataContext$dataNode = dataContext.dataNode) != null ? _dataContext$dataNode : dataContext.parentNode).control;
596
- const open = useControl(!!accordion.defaultExpanded);
597
- if (dataControl && !dataControl.meta.accordionState) {
598
- dataControl.meta.accordionState = open;
599
- }
600
- const isOpen = open.value;
601
- const fullContentStyle = isOpen || designMode ? contentStyle : _extends({}, contentStyle, {
602
- display: "none"
603
- });
604
- const title = renderers.renderLabelText(renderTitle(accordion.title, open));
605
- const currentIcon = isOpen ? iconOpen : iconClosed;
606
- const toggler = renderToggler ? renderToggler(open, title) : /*#__PURE__*/jsxs(Button, {
607
- className: className,
608
- onClick: () => open.setValue(x => !x),
609
- children: [/*#__PURE__*/jsx(Label, {
610
- className: titleClass,
611
- children: title
612
- }), currentIcon && /*#__PURE__*/jsx(I, {
613
- iconLibrary: currentIcon.library,
614
- iconName: currentIcon.name
615
- })]
616
- });
617
- return /*#__PURE__*/jsxs(Fragment, {
618
- children: [toggler, (useCss || isOpen || designMode) && /*#__PURE__*/jsx(Div, {
619
- style: fullContentStyle,
620
- className: contentClassName,
621
- children: children
622
- })]
623
- });
624
- } finally {
625
- _effect();
626
- }
627
- }
628
- function getAccordionState(c) {
629
- return c.meta.accordionState;
630
- }
631
-
632
- /**
633
- * @trackControls
634
- */
635
- function VisibleChildrenRenderer(props) {
636
- var _effect = useComponentTracking();
637
- try {
638
- const childStates = props.parentFormNode.getChildNodes().map(x => props.parent.getChildState(x));
639
- return props.render(props.props, i => !childStates[i].hidden);
640
- } finally {
641
- _effect();
642
- }
643
- }
644
-
645
495
  function createTabsRenderer(options = {}) {
646
496
  return createGroupRenderer((p, renderer) => {
647
- return /*#__PURE__*/jsx(VisibleChildrenRenderer, {
648
- render: renderAllTabs,
649
- dataContext: p.dataContext,
650
- parentFormNode: p.formNode,
651
- parent: p,
652
- props: {
653
- groupProps: p,
654
- tabOptions: p.renderOptions,
655
- options: options
656
- }
497
+ return /*#__PURE__*/jsx(TabsRenderer, {
498
+ groupProps: p,
499
+ tabOptions: p.renderOptions,
500
+ options: options
657
501
  });
658
502
  }, {
659
503
  renderType: GroupRenderType.Tabs
660
504
  });
661
- function renderAllTabs({
662
- options,
663
- groupProps: {
664
- designMode,
665
- formNode,
666
- className,
667
- renderChild,
668
- state
669
- },
670
- tabOptions
671
- }, isVisible) {
672
- var _tabIndex$value;
673
- const tabIndex = state.meta.fields.tabIndex.as();
505
+ }
506
+ function TabsRenderer({
507
+ options,
508
+ groupProps: {
509
+ designMode,
510
+ formNode,
511
+ className,
512
+ renderChild
513
+ },
514
+ tabOptions
515
+ }) {
516
+ var _effect = useComponentTracking();
517
+ try {
518
+ const tabIndex = useControl(0);
519
+ useEffect(() => {
520
+ formNode.attachUi(new TabUi(tabIndex, formNode));
521
+ }, [formNode, tabIndex]);
674
522
  const {
675
523
  tabClass,
676
524
  labelClass,
@@ -679,10 +527,10 @@ function createTabsRenderer(options = {}) {
679
527
  activeClass,
680
528
  contentClass
681
529
  } = options;
682
- const currentTab = (_tabIndex$value = tabIndex.value) != null ? _tabIndex$value : 0;
530
+ const currentTab = tabIndex.value;
683
531
  return designMode ? /*#__PURE__*/jsx(Fragment, {
684
- children: formNode.getChildNodes().map((x, i) => renderTabs([x], i))
685
- }) : renderTabs(formNode.getChildNodes().filter((x, i) => isVisible(i)), 0);
532
+ children: formNode.children.map((x, i) => renderTabs([x], i))
533
+ }) : renderTabs(formNode.children.filter((x, i) => x.visible), 0);
686
534
  function renderTabs(tabs, key) {
687
535
  return /*#__PURE__*/jsxs("div", {
688
536
  className: rendererClass(className, options.className),
@@ -698,52 +546,81 @@ function createTabsRenderer(options = {}) {
698
546
  }, i))
699
547
  }), /*#__PURE__*/jsx("div", {
700
548
  className: rendererClass(tabOptions.contentClass, contentClass),
701
- children: renderChild(currentTab, tabs[currentTab])
549
+ children: renderChild(tabs[currentTab])
702
550
  })]
703
551
  }, key);
704
552
  }
553
+ } finally {
554
+ _effect();
555
+ }
556
+ }
557
+ class TabUi extends DefaultFormNodeUi {
558
+ constructor(tabIndex, node) {
559
+ super(node);
560
+ this.tabIndex = void 0;
561
+ this.tabIndex = tabIndex;
562
+ }
563
+ ensureChildVisible(childIndex) {
564
+ this.tabIndex.value = childIndex;
565
+ super.ensureChildVisible(childIndex);
705
566
  }
706
567
  }
707
568
 
708
569
  function createGridRenderer(options) {
709
- return createGroupRenderer((props, formRenderer) => /*#__PURE__*/jsx(VisibleChildrenRenderer, {
710
- props: _extends({}, props, {
711
- formRenderer,
712
- defaultOptions: options
713
- }),
714
- render: renderGrid,
715
- parent: props,
716
- dataContext: props.dataContext,
717
- parentFormNode: props.formNode
570
+ return createGroupRenderer((props, formRenderer) => /*#__PURE__*/jsx(GridRenderer, {
571
+ groupProps: props,
572
+ formRenderer: formRenderer,
573
+ options: options
718
574
  }), {
719
575
  renderType: GroupRenderType.Grid
720
576
  });
721
- function renderGrid(props, isChildVisible) {
722
- var _props$defaultOptions, _ref, _gridOptions$columns;
723
- const filteredChildren = props.formNode.getChildNodes().filter((x, i) => isChildVisible(i));
577
+ }
578
+ function GridRenderer(props) {
579
+ var _effect = useComponentTracking();
580
+ try {
581
+ var _props$options, _ref, _gridOptions$columns;
582
+ const {
583
+ formNode,
584
+ renderOptions,
585
+ renderChild,
586
+ className
587
+ } = props.groupProps;
588
+ const filteredChildren = formNode.children.filter((x, i) => x.visible);
724
589
  const {
725
590
  Div
726
591
  } = props.formRenderer.html;
727
- const defaults = (_props$defaultOptions = props.defaultOptions) != null ? _props$defaultOptions : {};
728
- const gridOptions = props.renderOptions;
592
+ const defaults = (_props$options = props.options) != null ? _props$options : {};
593
+ const gridOptions = renderOptions;
729
594
  const numColumns = (_ref = (_gridOptions$columns = gridOptions.columns) != null ? _gridOptions$columns : defaults.defaultColumns) != null ? _ref : 2;
730
- const allChildren = filteredChildren.map((x, i) => props.renderChild(i, x));
595
+ const allChildren = filteredChildren.map(x => renderChild(x));
596
+ const cellClass = gridOptions.cellClass ? getCellClassNames(gridOptions.cellClass) : getCellClassNames(defaults.cellClass);
731
597
  // split into numColumns items wrapped a div each
732
598
  const rows = [];
733
599
  for (let i = 0; i < allChildren.length; i += numColumns) {
734
600
  rows.push(allChildren.slice(i, i + numColumns));
735
601
  }
736
602
  return /*#__PURE__*/jsx(Div, {
737
- className: rendererClass(props.className, defaults.className),
603
+ className: rendererClass(className, defaults.className),
738
604
  children: rows.map((row, rowIndex) => /*#__PURE__*/jsx(Div, {
739
605
  className: rendererClass(gridOptions.rowClass, defaults.rowClass),
740
- children: row
606
+ children: row.map((cell, cellIndex) => {
607
+ var _cellClass$at;
608
+ return /*#__PURE__*/jsx(Div, {
609
+ className: (_cellClass$at = cellClass == null ? void 0 : cellClass.at(cellIndex)) != null ? _cellClass$at : "flex-1",
610
+ children: cell
611
+ }, cellIndex);
612
+ })
741
613
  }, rowIndex))
742
614
  });
615
+ } finally {
616
+ _effect();
743
617
  }
744
618
  }
619
+ function getCellClassNames(cellClass) {
620
+ return cellClass == null ? void 0 : cellClass.split(",");
621
+ }
745
622
 
746
- const defaultOptions = {
623
+ const defaultOptions$1 = {
747
624
  classes: {
748
625
  className: undefined,
749
626
  contentClass: "min-h-96 overflow-auto",
@@ -779,127 +656,131 @@ function defaultNavigationRender({
779
656
  }
780
657
  }
781
658
  function createWizardRenderer(options) {
782
- return createGroupRenderer((props, formRenderer) => /*#__PURE__*/jsx(VisibleChildrenRenderer, {
783
- props: _extends({}, props, {
784
- formRenderer,
785
- defaultOptions: options
786
- }),
787
- render: renderWizard,
788
- parent: props,
789
- dataContext: props.dataContext,
790
- parentFormNode: props.formNode
659
+ return createGroupRenderer((props, formRenderer) => /*#__PURE__*/jsx(WizardRenderer, {
660
+ groupProps: props,
661
+ formRenderer: formRenderer,
662
+ options: options
791
663
  }), {
792
664
  renderType: GroupRenderType.Wizard
793
665
  });
794
666
  }
795
- function renderWizard(props, isChildVisible) {
796
- var _props$defaultOptions;
797
- const mergedOptions = deepMerge((_props$defaultOptions = props.defaultOptions) != null ? _props$defaultOptions : {}, defaultOptions);
798
- const {
799
- classes: {
800
- className,
801
- contentClass,
802
- navContainerClass
803
- },
804
- actions: {
805
- nextText,
806
- nextIcon,
807
- prevText,
808
- prevIcon,
809
- nextValidate,
810
- prevValidate
811
- },
812
- renderNavigation
813
- } = mergedOptions;
814
- const {
815
- html: {
816
- Div
817
- }
818
- } = props.formRenderer;
819
- const children = props.formNode.getChildNodes();
820
- const allVisible = children.map((_, i) => isChildVisible(i));
821
- const page = useControl(0);
822
- const currentPage = page.value;
823
- const isValid = useComputed(() => isPageValid());
824
- const next = createAction("nav", () => nav(1, nextValidate), nextText, {
825
- hidden: !props.designMode && nextVisibleInDirection(1) == null,
826
- disabled: !isValid.value,
827
- icon: nextIcon,
828
- iconPlacement: IconPlacement.AfterText
829
- });
830
- const prev = createAction("nav", () => nav(-1, prevValidate), prevText, {
831
- disabled: !props.designMode && nextVisibleInDirection(-1) == null,
832
- icon: prevIcon
833
- });
834
- const navElement = renderNavigation({
835
- formRenderer: props.formRenderer,
836
- page: countVisibleUntil(currentPage),
837
- totalPages: countVisibleUntil(children.length),
838
- prev,
839
- next: next,
840
- className: navContainerClass,
841
- validatePage: async () => validatePage()
842
- });
843
- const content = props.designMode ? /*#__PURE__*/jsx(Div, {
844
- children: children.map((child, i) => props.renderChild(i, child))
845
- }) : currentPage < children.length ? /*#__PURE__*/jsx(Div, {
846
- className: contentClass,
847
- children: props.renderChild(currentPage, children[currentPage])
848
- }) : /*#__PURE__*/jsx(Fragment$1, {});
849
- return /*#__PURE__*/jsxs(Div, {
850
- className: rendererClass(props.className, className),
851
- children: [content, navElement]
852
- });
853
- function countVisibleUntil(untilPage) {
854
- let count = 0;
855
- for (let i = 0; i < untilPage && i < allVisible.length; i++) {
856
- if (allVisible[i]) {
857
- count++;
667
+ function WizardRenderer({
668
+ groupProps: props,
669
+ formRenderer,
670
+ options
671
+ }) {
672
+ var _effect = useComponentTracking();
673
+ try {
674
+ const mergedOptions = deepMerge(options != null ? options : {}, defaultOptions$1);
675
+ const {
676
+ classes: {
677
+ className,
678
+ contentClass,
679
+ navContainerClass
680
+ },
681
+ actions: {
682
+ nextText,
683
+ nextIcon,
684
+ prevText,
685
+ prevIcon,
686
+ nextValidate,
687
+ prevValidate
688
+ },
689
+ renderNavigation
690
+ } = mergedOptions;
691
+ const {
692
+ formNode,
693
+ designMode,
694
+ renderChild
695
+ } = props;
696
+ const {
697
+ html: {
698
+ Div
858
699
  }
700
+ } = formRenderer;
701
+ const childrenLength = formNode.getChildCount();
702
+ const page = useControl(0);
703
+ const currentPage = page.value;
704
+ const isValid = useComputed(() => isPageValid());
705
+ const next = createAction("nav", () => nav(1, nextValidate), nextText, {
706
+ hidden: !designMode && nextVisibleInDirection(1) == null,
707
+ disabled: !isValid.value,
708
+ icon: nextIcon,
709
+ iconPlacement: IconPlacement.AfterText
710
+ });
711
+ const prev = createAction("nav", () => nav(-1, prevValidate), prevText, {
712
+ disabled: !designMode && nextVisibleInDirection(-1) == null,
713
+ icon: prevIcon
714
+ });
715
+ const navElement = renderNavigation({
716
+ formRenderer,
717
+ page: countVisibleUntil(currentPage),
718
+ totalPages: countVisibleUntil(childrenLength),
719
+ prev,
720
+ next: next,
721
+ className: navContainerClass,
722
+ validatePage: async () => validatePage()
723
+ });
724
+ const content = designMode ? /*#__PURE__*/jsx(Div, {
725
+ children: formNode.children.map(child => renderChild(child))
726
+ }) : currentPage < childrenLength ? /*#__PURE__*/jsx(Div, {
727
+ className: contentClass,
728
+ children: renderChild(formNode.getChild(currentPage))
729
+ }) : /*#__PURE__*/jsx(Fragment$1, {});
730
+ return /*#__PURE__*/jsxs(Div, {
731
+ className: rendererClass(props.className, className),
732
+ children: [content, navElement]
733
+ });
734
+ function countVisibleUntil(untilPage) {
735
+ let count = 0;
736
+ for (let i = 0; i < untilPage && i < childrenLength; i++) {
737
+ if (formNode.getChild(i).visible) {
738
+ count++;
739
+ }
740
+ }
741
+ return count;
859
742
  }
860
- return count;
861
- }
862
- function nav(dir, validate) {
863
- if (validate && !validatePage()) {
864
- return;
743
+ function nav(dir, validate) {
744
+ if (validate && !validatePage()) {
745
+ return;
746
+ }
747
+ const next = nextVisibleInDirection(dir);
748
+ if (next != null) {
749
+ page.value = next;
750
+ }
865
751
  }
866
- const next = nextVisibleInDirection(dir);
867
- if (next != null) {
868
- page.value = next;
752
+ function nextVisibleInDirection(dir) {
753
+ let next = currentPage + dir;
754
+ while (next >= 0 && next < childrenLength) {
755
+ if (formNode.getChild(next).visible) {
756
+ return next;
757
+ }
758
+ next += dir;
759
+ }
760
+ return null;
869
761
  }
870
- }
871
- function nextVisibleInDirection(dir) {
872
- let next = currentPage + dir;
873
- while (next >= 0 && next < children.length) {
874
- if (allVisible[next]) {
875
- return next;
762
+ function validatePage() {
763
+ const pageNode = formNode.getChild(currentPage);
764
+ if (pageNode) {
765
+ const valid = pageNode.validate();
766
+ pageNode.setTouched(true);
767
+ return valid;
876
768
  }
877
- next += dir;
769
+ return false;
878
770
  }
879
- return null;
880
- }
881
- function validatePage() {
882
- const pageNode = children[currentPage];
883
- let hasErrors = false;
884
- visitFormDataInContext(props.dataContext.parentNode, pageNode, validationVisitor(() => {
885
- hasErrors = true;
886
- }));
887
- return !hasErrors;
888
- }
889
- function isPageValid() {
890
- const pageNode = children[currentPage];
891
- let hasErrors = false;
892
- visitFormDataInContext(props.dataContext.parentNode, pageNode, c => {
893
- if (!c.control.valid) hasErrors = true;
894
- });
895
- return !hasErrors;
771
+ function isPageValid() {
772
+ return formNode.getChild(currentPage).valid;
773
+ }
774
+ } finally {
775
+ _effect();
896
776
  }
897
777
  }
898
778
 
899
779
  const defaultDialogOptions = {
900
780
  classes: {
901
781
  className: "",
902
- titleClass: "text-2xl font-bold"
782
+ titleClass: "text-2xl font-bold",
783
+ containerClass: "relative m-4 p-4 min-w-[400px] max-w-[80%] rounded-lg bg-white shadow-sm"
903
784
  }
904
785
  };
905
786
  function createDialogRenderer(options) {
@@ -923,7 +804,8 @@ function DefaultDialogRenderer({
923
804
  const {
924
805
  classes: {
925
806
  titleClass,
926
- className
807
+ className,
808
+ containerClass
927
809
  }
928
810
  } = deepMerge(options, defaultDialogOptions);
929
811
  const open = useControl(false);
@@ -936,21 +818,23 @@ function DefaultDialogRenderer({
936
818
  return () => overlayState.open();
937
819
  }
938
820
  };
939
- const triggerChildren = props.formNode.getChildNodes().filter(x => x.definition.placement === "trigger");
821
+ const allChildren = props.formNode.children;
822
+ const triggerChildren = allChildren.filter(x => x.definition.placement === "trigger");
940
823
  const dialogContent = /*#__PURE__*/jsx(Dialog, {
941
824
  title: renderOptions.title,
942
825
  titleClass: titleClass,
943
826
  className: rendererClass(props.className, className),
944
- children: props.formNode.getChildNodes().filter(x => !x.definition.placement || x.definition.placement === "dialog").map((x, i) => props.renderChild(i, x, {
827
+ children: allChildren.filter(x => !x.definition.placement || x.definition.placement === "dialog").map((x, i) => props.renderChild(x, {
945
828
  actionOnClick
946
829
  }))
947
830
  });
948
831
  return /*#__PURE__*/jsxs(Fragment, {
949
- children: [triggerChildren.map((x, i) => props.renderChild(i, x, {
832
+ children: [triggerChildren.map((x, i) => props.renderChild(x, {
950
833
  actionOnClick
951
834
  })), props.designMode ? designContent() : open.value && /*#__PURE__*/jsx(Modal, {
952
835
  state: overlayState,
953
836
  isDismissable: true,
837
+ containerClass: containerClass,
954
838
  children: dialogContent
955
839
  })]
956
840
  });
@@ -969,11 +853,140 @@ function DefaultDialogRenderer({
969
853
  }
970
854
  }
971
855
 
972
- function createDefaultGroupRenderer(options) {
856
+ function DefaultAccordion({
857
+ openCtrl,
858
+ children,
859
+ contentStyle,
860
+ className,
861
+ contentClassName,
862
+ designMode,
863
+ renderers,
864
+ dataContext,
865
+ title,
866
+ options,
867
+ defaultExpanded,
868
+ isGroup,
869
+ titleTextClass
870
+ }) {
871
+ var _effect = useComponentTracking();
872
+ try {
873
+ var _dataContext$dataNode;
874
+ const {
875
+ iconOpen,
876
+ iconClosed,
877
+ togglerClass,
878
+ renderTitle = t => t,
879
+ renderToggler,
880
+ useCss
881
+ } = options != null ? options : {};
882
+ const panelId = useId();
883
+ const {
884
+ Button,
885
+ I,
886
+ Div,
887
+ Label
888
+ } = renderers.html;
889
+ const dataControl = ((_dataContext$dataNode = dataContext.dataNode) != null ? _dataContext$dataNode : dataContext.parentNode).control;
890
+ const open = useControl(!!defaultExpanded, {
891
+ use: openCtrl
892
+ });
893
+ if (dataControl && !dataControl.meta.accordionState) {
894
+ dataControl.meta.accordionState = open;
895
+ }
896
+ const isOpen = open.value;
897
+ const fullContentStyle = isOpen || designMode ? contentStyle : _extends({}, contentStyle, {
898
+ display: "none"
899
+ });
900
+ const currentIcon = isOpen ? iconOpen : iconClosed;
901
+ const accordionClassName = rendererClass(className, options == null ? void 0 : options.className);
902
+ const accordionTitleTextClass = rendererClass(titleTextClass, options == null ? void 0 : options.titleTextClass);
903
+ const accordionTitle = isGroup ? title : /*#__PURE__*/jsx(Label, {
904
+ textClass: accordionTitleTextClass,
905
+ children: title
906
+ });
907
+ const toggler = renderToggler ? renderToggler(open, renderTitle(title, open)) : /*#__PURE__*/jsxs(Button, {
908
+ className: accordionClassName,
909
+ notWrapInText: true,
910
+ onClick: () => open.setValue(x => !x),
911
+ "aria-expanded": isOpen,
912
+ "aria-controls": panelId,
913
+ children: [accordionTitle, currentIcon && /*#__PURE__*/jsx(I, {
914
+ className: togglerClass,
915
+ iconLibrary: currentIcon.library,
916
+ iconName: currentIcon.name
917
+ })]
918
+ });
919
+ // The content class name not currently used since if the content is wrapped in a group, the group will handle the styling
920
+ return /*#__PURE__*/jsxs(Fragment, {
921
+ children: [toggler, (useCss || isOpen || designMode) && /*#__PURE__*/jsx(Div, {
922
+ id: panelId,
923
+ role: "region",
924
+ style: fullContentStyle,
925
+ className: contentClassName,
926
+ children: children
927
+ })]
928
+ });
929
+ } finally {
930
+ _effect();
931
+ }
932
+ }
933
+ function getAccordionState(c) {
934
+ return c.meta.accordionState;
935
+ }
936
+ function createAccordionGroupRenderer(options) {
937
+ return createGroupRenderer((p, renderer) => /*#__PURE__*/jsx(AccordionGroupRenderer, {
938
+ groupProps: p,
939
+ renderer: renderer,
940
+ options: options
941
+ }), {
942
+ renderType: GroupRenderType.Accordion
943
+ });
944
+ }
945
+ function AccordionGroupRenderer({
946
+ groupProps,
947
+ renderer,
948
+ options
949
+ }) {
950
+ var _effect2 = useComponentTracking();
951
+ try {
952
+ const allChildren = groupProps.formNode.children;
953
+ const titleChildren = allChildren.filter(x => x.definition.placement === "title");
954
+ const contentChildren = allChildren.filter(x => x.definition.placement !== "title");
955
+ const {
956
+ expandStateField,
957
+ defaultExpanded
958
+ } = groupProps.renderOptions;
959
+ const expandStateFieldNode = expandStateField ? schemaDataForFieldRef(expandStateField, groupProps.dataContext.parentNode) : null;
960
+ const open = expandStateFieldNode == null ? void 0 : expandStateFieldNode.control.as();
961
+ return /*#__PURE__*/jsx(DefaultAccordion, {
962
+ openCtrl: open,
963
+ isGroup: true,
964
+ options: options,
965
+ children: /*#__PURE__*/jsx(Fragment, {
966
+ children: contentChildren.map(x => groupProps.renderChild(x))
967
+ }),
968
+ title: /*#__PURE__*/jsx(Fragment, {
969
+ children: titleChildren.map(x => groupProps.renderChild(x))
970
+ }),
971
+ renderers: renderer,
972
+ className: groupProps.className,
973
+ dataContext: groupProps.dataContext,
974
+ designMode: groupProps.designMode,
975
+ defaultExpanded: defaultExpanded,
976
+ contentStyle: groupProps.style
977
+ });
978
+ } finally {
979
+ _effect2();
980
+ }
981
+ }
982
+
983
+ function createDefaultGroupRenderer(options, adornmentOptions) {
984
+ var _options$accordion;
973
985
  const gridRenderer = createGridRenderer(options == null ? void 0 : options.grid);
974
986
  const tabsRenderer = createTabsRenderer(options == null ? void 0 : options.tabs);
975
987
  const wizardRenderer = createWizardRenderer(options == null ? void 0 : options.wizard);
976
988
  const dialogRenderer = createDialogRenderer(options == null ? void 0 : options.dialog);
989
+ const accordionRenderer = createAccordionGroupRenderer((_options$accordion = options == null ? void 0 : options.accordion) != null ? _options$accordion : adornmentOptions == null ? void 0 : adornmentOptions.accordion);
977
990
  const {
978
991
  className,
979
992
  standardClassName,
@@ -1001,10 +1014,14 @@ function createDefaultGroupRenderer(options) {
1001
1014
  if (isGridRenderer(renderOptions)) return gridRenderer.render(props, renderer);
1002
1015
  if (isWizardRenderer(renderOptions)) return wizardRenderer.render(props, renderer);
1003
1016
  if (isDialogRenderer(renderOptions)) return dialogRenderer.render(props, renderer);
1017
+ if (isAccordionRenderer(renderOptions)) return accordionRenderer.render(props, renderer);
1004
1018
  if (isSelectChildRenderer(renderOptions) && !props.designMode) {
1005
- return /*#__PURE__*/jsx(SelectChildGroupRenderer, _extends({}, props, {
1006
- renderOptions: renderOptions
1007
- }));
1019
+ return /*#__PURE__*/jsx(SelectChildGroupRenderer, {
1020
+ props: _extends({}, props, {
1021
+ renderOptions
1022
+ }),
1023
+ renderer: renderer
1024
+ });
1008
1025
  }
1009
1026
  const {
1010
1027
  style,
@@ -1018,7 +1035,7 @@ function createDefaultGroupRenderer(options) {
1018
1035
  Div
1019
1036
  } = renderer.html;
1020
1037
  const inline = renderOptions.type == GroupRenderType.Inline;
1021
- const children = formNode.getChildNodes().map((c, i) => renderChild(i, c, {
1038
+ const children = formNode.children.map((c, i) => renderChild(c, {
1022
1039
  inline
1023
1040
  }));
1024
1041
  return /*#__PURE__*/jsx(Div, {
@@ -1035,7 +1052,7 @@ function createDefaultGroupRenderer(options) {
1035
1052
  formNode,
1036
1053
  renderChild
1037
1054
  } = props;
1038
- const children = formNode.getChildNodes().map((c, i) => renderChild(i, c));
1055
+ const children = formNode.children.map(c => renderChild(c));
1039
1056
  return layout => {
1040
1057
  return _extends({}, layout, {
1041
1058
  inline: true,
@@ -1050,18 +1067,24 @@ function createDefaultGroupRenderer(options) {
1050
1067
  render: renderLayout
1051
1068
  };
1052
1069
  }
1053
- function SelectChildGroupRenderer(props) {
1070
+ function SelectChildGroupRenderer({
1071
+ props,
1072
+ renderer
1073
+ }) {
1054
1074
  var _effect = useComponentTracking();
1055
1075
  try {
1076
+ const {
1077
+ Div
1078
+ } = renderer.html;
1056
1079
  const {
1057
1080
  runExpression,
1058
1081
  renderOptions
1059
1082
  } = props;
1060
1083
  const ctrl = useExpression(undefined, runExpression, renderOptions == null ? void 0 : renderOptions.childIndexExpression, x => typeof x == "string" ? parseInt(x) : x);
1061
1084
  const childIndex = ctrl == null ? void 0 : ctrl.value;
1062
- const childDefinitions = props.formNode.getChildNodes();
1063
- return /*#__PURE__*/jsx("div", {
1064
- children: typeof childIndex === "number" && childIndex < childDefinitions.length && childIndex >= 0 && props.renderChild(childIndex, childDefinitions[childIndex])
1085
+ const childCount = props.formNode.getChildCount();
1086
+ return /*#__PURE__*/jsx(Div, {
1087
+ children: typeof childIndex === "number" && childIndex < childCount && childIndex >= 0 && props.renderChild(props.formNode.getChild(childIndex))
1065
1088
  });
1066
1089
  } finally {
1067
1090
  _effect();
@@ -1132,13 +1155,12 @@ function JsonataRenderer({
1132
1155
  }) {
1133
1156
  var _effect = useComponentTracking();
1134
1157
  try {
1135
- const sdn = dataNode.elementIndex != null ? dataNode : dataContext.parentNode;
1136
- const bindings = useComputed(() => _extends({}, dataContext.variables, {
1137
- value: control.value,
1158
+ const bindings = changes => ({
1159
+ value: trackedValue(control, changes),
1138
1160
  readonly,
1139
1161
  disabled: control.disabled,
1140
1162
  dataPath: getJsonPath(dataNode)
1141
- }));
1163
+ });
1142
1164
  const rendered = useExpression("", runExpression, {
1143
1165
  type: ExpressionType.Jsonata,
1144
1166
  expression: renderOptions.expression
@@ -1214,8 +1236,7 @@ function DataArrayRenderer({
1214
1236
  className,
1215
1237
  style,
1216
1238
  dataContext,
1217
- formNode,
1218
- getChildState
1239
+ formNode
1219
1240
  } = dataProps;
1220
1241
  const {
1221
1242
  addText,
@@ -1223,29 +1244,10 @@ function DataArrayRenderer({
1223
1244
  noRemove,
1224
1245
  noReorder,
1225
1246
  removeText,
1226
- editExternal
1247
+ editExternal,
1248
+ childOverrideClass
1227
1249
  } = mergeObjects(isArrayRenderer(renderOptions) ? renderOptions : {}, defaultActions);
1228
- const childDefs = formNode.getResolvedChildren();
1229
- const renderAsElement = !isCompoundField(field);
1230
- const defaultChildDef = {
1231
- type: ControlDefinitionType.Data,
1232
- field: ".",
1233
- renderOptions: {
1234
- type: DataRenderType.Standard
1235
- },
1236
- hideTitle: true
1237
- };
1238
- const childDef = {
1239
- type: ControlDefinitionType.Group,
1240
- groupOptions: {
1241
- type: GroupRenderType.Standard,
1242
- hideTitle: true
1243
- },
1244
- children: renderAsElement && childDefs.length == 0 ? [defaultChildDef] : childDefs
1245
- };
1246
- const childNode = formNode.createChildNode("child", childDef);
1247
- const childNodes = childNode.getChildNodes();
1248
- const arrayProps = _extends({}, createArrayActions(control.as(), field, {
1250
+ const arrayProps = _extends({}, createArrayActions(control.as(), () => formNode.getChildCount(), field, {
1249
1251
  addText,
1250
1252
  removeText,
1251
1253
  noAdd,
@@ -1255,46 +1257,20 @@ function DataArrayRenderer({
1255
1257
  designMode,
1256
1258
  editExternal
1257
1259
  }), {
1260
+ childOverrideClass,
1258
1261
  required,
1259
- renderElement: (i, wrap) => /*#__PURE__*/jsx(RenderEntry, {
1260
- index: i,
1261
- renderChildElement: renderChildElement,
1262
- dataContext: dataContext,
1263
- wrap: wrap,
1264
- isChildHidden: dataNode => childNodes.every(x => getChildState(x, dataNode).hidden)
1265
- }),
1262
+ renderElement: (i, wrap) => {
1263
+ const n = formNode.getChild(i);
1264
+ return !n || !n.visible ? undefined : wrap(n.childKey, renderChild(n));
1265
+ },
1266
1266
  className: className ? className : undefined,
1267
1267
  style
1268
1268
  }, getLengthRestrictions(definition));
1269
1269
  return renderers.renderArray(arrayProps);
1270
- function renderChildElement(i, elementNode) {
1271
- return renderChild(elementNode.control.uniqueId, childNode, {
1272
- parentDataNode: elementNode
1273
- });
1274
- }
1275
1270
  } finally {
1276
1271
  _effect();
1277
1272
  }
1278
1273
  }
1279
- /**
1280
- * @trackControls
1281
- */
1282
- function RenderEntry({
1283
- index: i,
1284
- renderChildElement,
1285
- wrap,
1286
- isChildHidden,
1287
- dataContext
1288
- }) {
1289
- var _effect2 = useComponentTracking();
1290
- try {
1291
- const elementNode = dataContext.dataNode.getChildElement(i);
1292
- if (isChildHidden(elementNode)) return undefined;
1293
- return wrap(renderChildElement(i, elementNode));
1294
- } finally {
1295
- _effect2();
1296
- }
1297
- }
1298
1274
  function createDefaultArrayRenderer(options) {
1299
1275
  return {
1300
1276
  render: (props, {
@@ -1308,7 +1284,7 @@ function createDefaultArrayRenderer(options) {
1308
1284
  };
1309
1285
  }
1310
1286
  function DefaultArrayRenderer(props) {
1311
- var _effect3 = useComponentTracking();
1287
+ var _effect2 = useComponentTracking();
1312
1288
  try {
1313
1289
  const {
1314
1290
  renderElement,
@@ -1316,9 +1292,10 @@ function DefaultArrayRenderer(props) {
1316
1292
  removableClass,
1317
1293
  childClass,
1318
1294
  removableChildClass,
1295
+ childOverrideClass,
1319
1296
  removeActionClass,
1320
1297
  addActionClass,
1321
- arrayControl,
1298
+ getElementCount,
1322
1299
  renderAction,
1323
1300
  style,
1324
1301
  editAction,
@@ -1334,28 +1311,29 @@ function DefaultArrayRenderer(props) {
1334
1311
  style: style,
1335
1312
  children: [/*#__PURE__*/jsx(Div, {
1336
1313
  className: clsx(className, removeAction && removableClass),
1337
- children: /*#__PURE__*/jsx(RenderElements, {
1338
- control: arrayControl,
1339
- children: (_, x) => renderElement(x, children => removeAction || editAction ? /*#__PURE__*/jsxs(Fragment, {
1314
+ children: Array.from({
1315
+ length: getElementCount()
1316
+ }, (_, x) => /*#__PURE__*/jsx(RenderControl, {
1317
+ render: () => renderElement(x, (key, children) => removeAction || editAction ? /*#__PURE__*/jsxs(Fragment$1, {
1340
1318
  children: [/*#__PURE__*/jsx(Div, {
1341
- className: clsx(childClass, removableChildClass),
1319
+ className: clsx(rendererClass(childOverrideClass, childClass), removableChildClass),
1342
1320
  children: children
1343
1321
  }), /*#__PURE__*/jsxs(Div, {
1344
1322
  className: removeActionClass,
1345
1323
  children: [editAction && renderAction(editAction(x)), removeAction && renderAction(removeAction(x))]
1346
1324
  })]
1347
- }) : /*#__PURE__*/jsx(Div, {
1348
- className: childClass,
1325
+ }, key) : /*#__PURE__*/jsx(Div, {
1326
+ className: rendererClass(childOverrideClass, childClass),
1349
1327
  children: children
1350
- }))
1351
- })
1328
+ }, key))
1329
+ }, x))
1352
1330
  }), addAction && /*#__PURE__*/jsx(Div, {
1353
1331
  className: addActionClass,
1354
1332
  children: renderAction(addAction)
1355
1333
  })]
1356
1334
  });
1357
1335
  } finally {
1358
- _effect3();
1336
+ _effect2();
1359
1337
  }
1360
1338
  }
1361
1339
 
@@ -1669,12 +1647,16 @@ function ValueForField({
1669
1647
  hideTitle: true
1670
1648
  });
1671
1649
  const rootSchema = createSchemaTree([adjustedField]).rootNode;
1672
- return [control, rootSchema];
1650
+ return [createFormTree([control]), rootSchema];
1673
1651
  }, [schemaField]);
1674
- const Render = useControlRendererComponent(controls, renderer, {
1675
- disabled: control.disabled
1676
- }, makeSchemaDataNode(rootSchema, value));
1677
- return /*#__PURE__*/jsx(Render, {});
1652
+ return /*#__PURE__*/jsx(RenderForm, {
1653
+ form: controls.rootNode,
1654
+ renderer: renderer,
1655
+ data: createSchemaDataNode(rootSchema, value),
1656
+ options: {
1657
+ disabled: control.disabled
1658
+ }
1659
+ });
1678
1660
  } finally {
1679
1661
  _effect();
1680
1662
  }
@@ -1696,7 +1678,7 @@ function createOptionalAdornment(options = {}) {
1696
1678
  return {
1697
1679
  apply: rl => {
1698
1680
  var _ref, _adornment$placement;
1699
- if (props.formOptions.readonly) return rl;
1681
+ if (props.formNode.readonly) return rl;
1700
1682
  if (!options.hideEdit && adornment.editSelectable) appendMarkupAt((_ref = (_adornment$placement = adornment.placement) != null ? _adornment$placement : options.defaultPlacement) != null ? _ref : AdornmentPlacement.LabelStart, /*#__PURE__*/jsx(Fcheckbox$1, {
1701
1683
  control: editing,
1702
1684
  className: options.checkClass
@@ -1793,6 +1775,17 @@ function MultilineTextfield({
1793
1775
  }
1794
1776
  }
1795
1777
 
1778
+ // ============================================================================
1779
+ // ADDITIONAL CONSTANTS
1780
+ // ============================================================================
1781
+ const DefaultBoolOptions = [{
1782
+ name: "Yes",
1783
+ value: true
1784
+ }, {
1785
+ name: "No",
1786
+ value: false
1787
+ }];
1788
+
1796
1789
  function createArrayElementRenderer(options = {}) {
1797
1790
  return createDataRenderer((props, formRenderer) => /*#__PURE__*/jsx(ArrayElementRenderer, {
1798
1791
  dataProps: props,
@@ -1826,25 +1819,21 @@ function ArrayElementRenderer({
1826
1819
  });
1827
1820
  if (designMode || extData.value !== undefined) {
1828
1821
  const parentDataNode = makeSchemaDataNode(dataProps.dataNode.schema, extData.fields.data);
1829
- const elementGroup = formNode.createChildNode("group", {
1830
- type: ControlDefinitionType.Group,
1831
- groupOptions: {
1832
- type: GroupRenderType.Standard,
1833
- hideTitle: true
1834
- },
1835
- children: formNode.getResolvedChildren()
1836
- });
1837
- const editContent = /*#__PURE__*/jsxs("div", {
1822
+ // TODO
1823
+ // const elementGroup: FormNode = formNode.createChildNode("group", {
1824
+ // type: ControlDefinitionType.Group,
1825
+ // groupOptions: { type: GroupRenderType.Standard, hideTitle: true },
1826
+ // children: formNode.getResolvedChildren(),
1827
+ // } as GroupedControlsDefinition);
1828
+ const editContent = /*#__PURE__*/jsx("div", {
1838
1829
  className: rendererClass(dataProps.className, options.className),
1839
- children: [renderChild("", elementGroup, {
1840
- parentDataNode
1841
- }), /*#__PURE__*/jsx("div", {
1830
+ children: /*#__PURE__*/jsx("div", {
1842
1831
  className: options.actionsClass,
1843
1832
  children: /*#__PURE__*/jsx(RenderElements, {
1844
1833
  control: extData.fields.actions,
1845
1834
  children: c => formRenderer.renderAction(applyValidation(c.value))
1846
1835
  })
1847
- })]
1836
+ })
1848
1837
  });
1849
1838
  if (renderOptions.showInline || designMode) return editContent;
1850
1839
  return /*#__PURE__*/jsx(Modal, {
@@ -1854,11 +1843,16 @@ function ArrayElementRenderer({
1854
1843
  })
1855
1844
  });
1856
1845
  function runValidation(onClick) {
1857
- let hasErrors = false;
1858
- visitFormDataInContext(parentDataNode, elementGroup, validationVisitor(() => {
1859
- hasErrors = true;
1860
- }));
1861
- if (!hasErrors) onClick();
1846
+ // TODO
1847
+ // let hasErrors = false;
1848
+ // visitFormDataInContext(
1849
+ // parentDataNode,
1850
+ // elementGroup,
1851
+ // validationVisitor(() => {
1852
+ // hasErrors = true;
1853
+ // }),
1854
+ // );
1855
+ // if (!hasErrors) onClick();
1862
1856
  }
1863
1857
  function applyValidation({
1864
1858
  action,
@@ -1876,7 +1870,7 @@ function ArrayElementRenderer({
1876
1870
 
1877
1871
  function createButtonActionRenderer(actionId, options = {}) {
1878
1872
  return createActionRenderer(actionId, (props, renderer) => {
1879
- var _props$icon, _ref, _props$iconPlacement, _options$renderConten;
1873
+ var _props$icon, _ref, _props$iconPlacement, _ref2, _props$iconPlacement2, _options$renderConten;
1880
1874
  const {
1881
1875
  key,
1882
1876
  onClick,
@@ -1889,10 +1883,15 @@ function createButtonActionRenderer(actionId, options = {}) {
1889
1883
  textClass,
1890
1884
  actionStyle,
1891
1885
  inline,
1892
- actionContent
1886
+ actionContent,
1887
+ busy
1893
1888
  } = props;
1894
- const icon = (_props$icon = props.icon) != null && _props$icon.name ? props.icon : options.icon;
1895
- const iconPlacement = (_ref = (_props$iconPlacement = props.iconPlacement) != null ? _props$iconPlacement : options.iconPlacement) != null ? _ref : IconPlacement.BeforeText;
1889
+ const busyIcon = props.busy ? options.busyIcon : undefined;
1890
+ const stdIcon = (_props$icon = props.icon) != null && _props$icon.name ? props.icon : options.icon;
1891
+ const icon = busyIcon != null ? busyIcon : stdIcon;
1892
+ const stdIconPlacement = (_ref = (_props$iconPlacement = props.iconPlacement) != null ? _props$iconPlacement : options.iconPlacement) != null ? _ref : IconPlacement.BeforeText;
1893
+ const busyPlacement = (_ref2 = (_props$iconPlacement2 = props.iconPlacement) != null ? _props$iconPlacement2 : options.busyIconPlacement) != null ? _ref2 : IconPlacement.ReplaceText;
1894
+ const iconPlacement = busyIcon ? busyPlacement : stdIconPlacement;
1896
1895
  const {
1897
1896
  Button,
1898
1897
  I,
@@ -1901,12 +1900,12 @@ function createButtonActionRenderer(actionId, options = {}) {
1901
1900
  const isLink = actionStyle == ActionStyle.Link;
1902
1901
  const isGroup = actionStyle == ActionStyle.Group;
1903
1902
  const classNames = rendererClass(className, isLink ? options.linkClass : isGroup ? options.groupClass : rendererClass(options.buttonClass, actionStyle == ActionStyle.Secondary ? options.secondaryClass : options.primaryClass));
1903
+ const textClassNames = rendererClass(textClass, isLink ? options.linkTextClass : rendererClass(options.textClass, actionStyle == ActionStyle.Secondary ? options.secondaryTextClass : options.primaryTextClass));
1904
1904
  const iconElement = icon && /*#__PURE__*/jsx(I, {
1905
1905
  iconName: icon.name,
1906
1906
  iconLibrary: icon.library,
1907
- className: iconPlacement == IconPlacement.BeforeText ? options.iconBeforeClass : options.iconAfterClass
1907
+ className: rendererClass(textClassNames, iconPlacement == IconPlacement.BeforeText ? options.iconBeforeClass : options.iconAfterClass)
1908
1908
  });
1909
- const textClassNames = rendererClass(textClass, isLink ? options.linkTextClass : rendererClass(options.textClass, actionStyle == ActionStyle.Secondary ? options.secondaryTextClass : options.primaryTextClass));
1910
1909
  const textElement = actionContent != null ? actionContent : actionText && /*#__PURE__*/jsx(Span, {
1911
1910
  className: textClassNames,
1912
1911
  children: actionText
@@ -1922,24 +1921,188 @@ function createButtonActionRenderer(actionId, options = {}) {
1922
1921
  title: iconPlacement == IconPlacement.ReplaceText ? actionText : undefined,
1923
1922
  notWrapInText: options.notWrapInText,
1924
1923
  androidRippleColor: options.androidRippleColor,
1925
- children: (_options$renderConten = options.renderContent == null ? void 0 : options.renderContent(actionText, actionId, actionData)) != null ? _options$renderConten : /*#__PURE__*/jsxs(Fragment, {
1924
+ children: (_options$renderConten = options.renderContent == null ? void 0 : options.renderContent(actionText, actionId, actionData, busy)) != null ? _options$renderConten : /*#__PURE__*/jsxs(Fragment, {
1926
1925
  children: [iconPlacement == IconPlacement.BeforeText && iconElement, iconPlacement != IconPlacement.ReplaceText && textElement, iconPlacement != IconPlacement.BeforeText && iconElement]
1927
1926
  })
1928
1927
  }, key);
1929
1928
  });
1930
1929
  }
1931
1930
 
1931
+ const defaultOptions = {
1932
+ spinnerClass: "flex justify-center my-6",
1933
+ className: "flex flex-row",
1934
+ loadingIcon: undefined,
1935
+ iconClass: "text-[36px]"
1936
+ };
1937
+ function createScrollListRenderer(options) {
1938
+ return createDataRenderer((p, renderer) => /*#__PURE__*/jsx(ScrollListRenderer, {
1939
+ dataProps: p,
1940
+ renderer: renderer,
1941
+ options: options
1942
+ }), {
1943
+ collection: true,
1944
+ renderType: DataRenderType.ScrollList
1945
+ });
1946
+ }
1947
+ function ScrollListRenderer({
1948
+ dataProps: {
1949
+ formNode,
1950
+ renderChild,
1951
+ dataNode,
1952
+ actionOnClick,
1953
+ renderOptions,
1954
+ dataContext,
1955
+ className
1956
+ },
1957
+ renderer,
1958
+ options
1959
+ }) {
1960
+ var _effect = useComponentTracking();
1961
+ try {
1962
+ const {
1963
+ bottomActionId
1964
+ } = renderOptions;
1965
+ const loadingControl = getLoadingControl(dataNode.control);
1966
+ const hasMoreControl = getHasMoreControl(dataNode.control);
1967
+ const handler = bottomActionId ? actionOnClick == null ? void 0 : actionOnClick(bottomActionId, undefined, dataContext) : undefined;
1968
+ const {
1969
+ I
1970
+ } = renderer.html;
1971
+ const {
1972
+ loadingIcon,
1973
+ spinnerClass,
1974
+ iconClass
1975
+ } = deepMerge(options, defaultOptions);
1976
+ return /*#__PURE__*/jsxs(Fragment, {
1977
+ children: [/*#__PURE__*/jsx("div", {
1978
+ className: rendererClass(className, options == null ? void 0 : options.className),
1979
+ children: formNode.children.map(x => renderChild(x))
1980
+ }), (loadingIcon == null ? void 0 : loadingIcon.name) && /*#__PURE__*/jsx(RenderControl, {
1981
+ render: spinner
1982
+ }), /*#__PURE__*/jsx(ScrollTrigger, {
1983
+ hasMoreControl: hasMoreControl,
1984
+ loadingControl: loadingControl,
1985
+ fetchMore: () => handler == null ? void 0 : handler(NoOpControlActionContext)
1986
+ })]
1987
+ });
1988
+ function spinner() {
1989
+ return loadingControl.value && /*#__PURE__*/jsx("div", {
1990
+ className: spinnerClass,
1991
+ ref: e => e == null ? void 0 : e.scrollIntoView({
1992
+ behavior: "smooth"
1993
+ }),
1994
+ children: /*#__PURE__*/jsx(I, {
1995
+ iconName: loadingIcon.name,
1996
+ iconLibrary: loadingIcon.library,
1997
+ className: iconClass
1998
+ })
1999
+ });
2000
+ }
2001
+ } finally {
2002
+ _effect();
2003
+ }
2004
+ }
2005
+ function ScrollTrigger({
2006
+ hasMoreControl,
2007
+ loadingControl,
2008
+ fetchMore
2009
+ }) {
2010
+ var _effect2 = useComponentTracking();
2011
+ try {
2012
+ const observerTarget = useRef(null);
2013
+ const hasMore = hasMoreControl.value;
2014
+ const loading = loadingControl.value;
2015
+ useEffect(() => {
2016
+ const observer = new IntersectionObserver(entries => {
2017
+ if (entries[0].isIntersecting && hasMore && !loading) {
2018
+ fetchMore();
2019
+ }
2020
+ }, {
2021
+ threshold: 0.5
2022
+ }); // Trigger when 50% of the target is visible
2023
+ if (observerTarget.current) {
2024
+ observer.observe(observerTarget.current);
2025
+ }
2026
+ return () => {
2027
+ if (observerTarget.current) {
2028
+ observer.unobserve(observerTarget.current);
2029
+ }
2030
+ };
2031
+ }, [hasMore, loading]); // Re-run effect if hasMore or loading state changes
2032
+ return /*#__PURE__*/jsx("div", {
2033
+ ref: observerTarget,
2034
+ style: {
2035
+ height: "1px"
2036
+ }
2037
+ });
2038
+ } finally {
2039
+ _effect2();
2040
+ }
2041
+ }
2042
+
2043
+ function HtmlCheckButtons(props) {
2044
+ var _effect = useComponentTracking();
2045
+ try {
2046
+ const {
2047
+ control,
2048
+ options,
2049
+ readonly,
2050
+ className,
2051
+ id,
2052
+ type,
2053
+ isChecked,
2054
+ setChecked,
2055
+ entryAdornment,
2056
+ classes,
2057
+ controlClasses = {}
2058
+ } = props;
2059
+ const {
2060
+ disabled
2061
+ } = control;
2062
+ const name = "r" + control.uniqueId;
2063
+ return /*#__PURE__*/jsx("div", {
2064
+ role: "group",
2065
+ className: className,
2066
+ id: id,
2067
+ children: /*#__PURE__*/jsx(RenderArrayElements, {
2068
+ array: options == null ? void 0 : options.filter(x => x.value != null),
2069
+ children: (o, i) => {
2070
+ const checked = useComputed(() => isChecked(control, o)).value;
2071
+ const selOrUnsel = checked ? rendererClass(controlClasses == null ? void 0 : controlClasses.selectedClass, classes.selectedClass) : rendererClass(controlClasses == null ? void 0 : controlClasses.notSelectedClass, classes.notSelectedClass);
2072
+ return /*#__PURE__*/jsxs("div", {
2073
+ className: clsx$1(rendererClass(controlClasses == null ? void 0 : controlClasses.entryWrapperClass, classes.entryWrapperClass), selOrUnsel),
2074
+ children: [/*#__PURE__*/jsxs("div", {
2075
+ className: classes.entryClass,
2076
+ children: [/*#__PURE__*/jsx("input", {
2077
+ id: name + "_" + i,
2078
+ className: classes.checkClass,
2079
+ type: type,
2080
+ name: name,
2081
+ readOnly: readonly,
2082
+ disabled: disabled,
2083
+ checked: checked,
2084
+ onChange: x => {
2085
+ !readonly && setChecked(control, o, x.target.checked);
2086
+ }
2087
+ }), /*#__PURE__*/jsx("label", {
2088
+ className: classes.labelClass,
2089
+ htmlFor: name + "_" + i,
2090
+ children: o.name
2091
+ })]
2092
+ }), entryAdornment == null ? void 0 : entryAdornment(o, i, checked)]
2093
+ });
2094
+ }
2095
+ })
2096
+ });
2097
+ } finally {
2098
+ _effect();
2099
+ }
2100
+ }
2101
+
1932
2102
  const _excluded = ["inline", "textClass", "className", "notWrapInText", "androidRippleColor", "onClick", "nonTextContent"],
1933
2103
  _excluded2 = ["textClass", "className", "onChangeValue", "onChangeChecked", "inputRef"],
1934
2104
  _excluded3 = ["text", "html", "children", "className", "textClass", "nativeRef", "inline"],
1935
2105
  _excluded4 = ["textClass", "className"];
1936
- const DefaultBoolOptions = [{
1937
- name: "Yes",
1938
- value: true
1939
- }, {
1940
- name: "No",
1941
- value: false
1942
- }];
1943
2106
  function createDefaultDataRenderer(options = {}) {
1944
2107
  var _options$checkboxOpti, _options$checkboxOpti2, _options$radioOptions, _options$checkListOpt;
1945
2108
  const elementSelectedRenderer = createElementSelectedRenderer((_options$checkboxOpti = options.checkboxOptions) != null ? _options$checkboxOpti : options.checkOptions);
@@ -1964,18 +2127,19 @@ function createDefaultDataRenderer(options = {}) {
1964
2127
  }, options);
1965
2128
  const arrayRenderer = createDefaultArrayDataRenderer(options.arrayOptions);
1966
2129
  const autocompleteRenderer = createAutocompleteRenderer(options.autocompleteOptions);
2130
+ const scrollListRenderer = createScrollListRenderer(options.scrollListOptions);
1967
2131
  return createDataRenderer((props, renderers) => {
1968
2132
  const {
1969
2133
  field
1970
2134
  } = props;
1971
2135
  const fieldType = field.type;
1972
2136
  const renderOptions = props.renderOptions;
1973
- let renderType = renderOptions.type;
2137
+ let renderType = renderOptions.type ? renderOptions.type : DataRenderType.Standard;
1974
2138
  if (field.collection && props.dataNode.elementIndex == null && (renderType == DataRenderType.Standard || renderType == DataRenderType.Array || renderType == DataRenderType.ArrayElement)) {
1975
2139
  if (renderType == DataRenderType.ArrayElement) return arrayElementRenderer.render(props, renderers);
1976
2140
  return arrayRenderer.render(props, renderers);
1977
2141
  }
1978
- if (fieldType === FieldType.Compound) {
2142
+ if (fieldType === FieldType.Compound && (isDataGroupRenderer(renderOptions) || renderType === DataRenderType.Standard)) {
1979
2143
  var _ref;
1980
2144
  const groupOptions = (_ref = isDataGroupRenderer(renderOptions) ? renderOptions.groupOptions : undefined) != null ? _ref : {
1981
2145
  type: "Standard",
@@ -1990,7 +2154,7 @@ function createDefaultDataRenderer(options = {}) {
1990
2154
  className: "@ " + rendererClass(p.className, displayOnlyClass),
1991
2155
  children: /*#__PURE__*/jsx(DefaultDisplayOnly, {
1992
2156
  dataNode: props.dataNode,
1993
- state: props.state,
2157
+ state: props.formNode,
1994
2158
  schemaInterface: props.dataContext.schemaInterface,
1995
2159
  className: props.className,
1996
2160
  textClass: props.textClass,
@@ -2015,6 +2179,8 @@ function createDefaultDataRenderer(options = {}) {
2015
2179
  return nullToggler.render(props, renderers);
2016
2180
  case DataRenderType.CheckList:
2017
2181
  return checkListRenderer.render(props, renderers);
2182
+ case DataRenderType.ScrollList:
2183
+ return scrollListRenderer.render(props, renderers);
2018
2184
  case DataRenderType.Dropdown:
2019
2185
  return selectRenderer.render(props, renderers);
2020
2186
  case DataRenderType.Radio:
@@ -2041,6 +2207,7 @@ function createDefaultDataRenderer(options = {}) {
2041
2207
  textClass: rendererClass(props.textClass, inputTextClass),
2042
2208
  style: props.style,
2043
2209
  id: props.id,
2210
+ errorId: props.errorId,
2044
2211
  readOnly: props.readonly,
2045
2212
  control: props.control,
2046
2213
  placeholder: placeholder != null ? placeholder : undefined,
@@ -2089,15 +2256,24 @@ function createDefaultAdornmentRenderer(options = {}) {
2089
2256
  }))(rl);
2090
2257
  }
2091
2258
  if (isAccordionAdornment(adornment)) {
2092
- return wrapLayout(x => /*#__PURE__*/jsx(DefaultAccordion, _extends({
2093
- renderers: renderers,
2094
- children: x,
2095
- accordion: adornment,
2096
- contentStyle: rl.style,
2097
- contentClassName: rl.className,
2098
- designMode: designMode,
2099
- dataContext: dataContext
2100
- }, options.accordion)))(rl);
2259
+ return wrapLayout(x => {
2260
+ var _rl$children$props;
2261
+ const displayProps = /*#__PURE__*/isValidElement(rl.children) ? (_rl$children$props = rl.children.props) == null ? void 0 : _rl$children$props.displayProps : undefined;
2262
+ return /*#__PURE__*/jsx(DefaultAccordion, {
2263
+ isGroup: false,
2264
+ renderers: renderers,
2265
+ children: x,
2266
+ className: displayProps == null ? void 0 : displayProps.className,
2267
+ titleTextClass: displayProps == null ? void 0 : displayProps.textClass,
2268
+ title: renderers.renderLabelText(adornment.title),
2269
+ defaultExpanded: adornment.defaultExpanded,
2270
+ contentStyle: rl.style,
2271
+ contentClassName: rl.className,
2272
+ designMode: designMode,
2273
+ dataContext: dataContext,
2274
+ options: options.accordion
2275
+ });
2276
+ })(rl);
2101
2277
  }
2102
2278
  },
2103
2279
  priority: 0,
@@ -2168,21 +2344,23 @@ const StandardHtmlComponents = {
2168
2344
  Div: DefaultHtmlDivRenderer,
2169
2345
  H1: "h1",
2170
2346
  B: "b",
2171
- Input: DefaultHtmlInputRenderer
2347
+ Input: DefaultHtmlInputRenderer,
2348
+ CheckButtons: HtmlCheckButtons
2172
2349
  };
2173
2350
  function DefaultHtmlButtonRenderer(_ref2) {
2174
2351
  var _effect = useComponentTracking();
2175
2352
  try {
2176
2353
  let {
2354
+ inline,
2177
2355
  textClass,
2178
2356
  className,
2179
2357
  onClick,
2180
2358
  nonTextContent
2181
2359
  } = _ref2,
2182
2360
  props = _objectWithoutPropertiesLoose(_ref2, _excluded);
2183
- const Comp = nonTextContent ? "div" : "button";
2361
+ const Comp = inline ? "span" : nonTextContent ? "div" : "button";
2184
2362
  return /*#__PURE__*/jsx(Comp, _extends({
2185
- role: nonTextContent ? "button" : undefined,
2363
+ role: nonTextContent || inline ? "button" : undefined,
2186
2364
  onClick: onClick ? e => {
2187
2365
  e.stopPropagation();
2188
2366
  onClick();
@@ -2272,8 +2450,11 @@ function DefaultHtmlIconRenderer({
2272
2450
  switch (iconLibrary) {
2273
2451
  case IconLibrary.FontAwesome:
2274
2452
  return "fa fa-" + iconName;
2275
- default:
2453
+ case IconLibrary.Material:
2454
+ case IconLibrary.CssClass:
2276
2455
  return iconName;
2456
+ default:
2457
+ return iconLibrary + " fa-" + iconName;
2277
2458
  }
2278
2459
  }
2279
2460
  } finally {
@@ -2287,7 +2468,7 @@ function createDefaultRenderers(options = {}) {
2287
2468
  display: createDefaultDisplayRenderer(options.display),
2288
2469
  action: createButtonActionRenderer(undefined, options.action),
2289
2470
  array: createDefaultArrayRenderer(options.array),
2290
- group: createDefaultGroupRenderer(options.group),
2471
+ group: createDefaultGroupRenderer(options.group, options.adornment),
2291
2472
  label: createDefaultLabelRenderer(options.label),
2292
2473
  adornment: createDefaultAdornmentRenderer(options.adornment),
2293
2474
  renderLayout: createDefaultLayoutRenderer(options.layout),
@@ -2340,7 +2521,8 @@ const defaultTailwindTheme = {
2340
2521
  standardClassName: "flex flex-col gap-4",
2341
2522
  grid: {
2342
2523
  className: "flex flex-col gap-4",
2343
- rowClass: "flex flex-row gap-4 justify-between *:flex-1"
2524
+ rowClass: "flex flex-row gap-4 justify-between",
2525
+ cellClass: "flex-1"
2344
2526
  },
2345
2527
  flexClassName: "gap-2",
2346
2528
  inlineClass: "",
@@ -2359,7 +2541,8 @@ const defaultTailwindTheme = {
2359
2541
  primaryClass: "bg-primary-500",
2360
2542
  secondaryClass: "bg-secondary-500",
2361
2543
  iconBeforeClass: "px-2",
2362
- iconAfterClass: "px-2"
2544
+ iconAfterClass: "px-2",
2545
+ busyIcon: fontAwesomeIcon("spinner fa-spin")
2363
2546
  },
2364
2547
  layout: {
2365
2548
  className: "flex flex-col",
@@ -2385,12 +2568,15 @@ const defaultTailwindTheme = {
2385
2568
  listEntryClass: "list-none p-2 rounded-lg cursor-default last-of-type:border-b-0 hover:cursor-pointer hover:bg-primary-100 aria-selected:bg-primary-200 aria-selected:text-primary-900 focused:bg-surface-100 focus-visible:bg-surface-100 focused:text-surface-900 focus-visible:text-surface-900 focus-visible:shadow-[0_0_0_3px_transparent] focus-visible:shadow-primary-200 focused:aria-selected:bg-primary-200 focus-visible:aria-selected:bg-primary-200 focused:aria-selected:text-primary-900 focus-visible:aria-selected:text-primary-900",
2386
2569
  chipContainerClass: "flex flex-row items-center px-3 py-1 rounded-full bg-surface-100 m-1 gap-2 truncate",
2387
2570
  chipCloseButtonClass: "fa-solid fa-xmark p-1 bg-surface-300 rounded-full min-w-[24px] flex justify-center text-surface-50 hover:bg-surface-400 hover:text-surface-100 hover:cursor-pointer"
2571
+ },
2572
+ scrollListOptions: {
2573
+ loadingIcon: fontAwesomeIcon("spinner fa-spin")
2388
2574
  }
2389
2575
  },
2390
2576
  adornment: {
2391
2577
  accordion: {
2392
- className: "flex items-center gap-2 my-2",
2393
- titleClass: "cursor-pointer",
2578
+ className: "flex items-center gap-2 my-2 w-fit",
2579
+ titleTextClass: "cursor-pointer",
2394
2580
  iconOpen: fontAwesomeIcon("chevron-up"),
2395
2581
  iconClosed: fontAwesomeIcon("chevron-down")
2396
2582
  },
@@ -2403,5 +2589,5 @@ const defaultTailwindTheme = {
2403
2589
  }
2404
2590
  };
2405
2591
 
2406
- export { CheckButtons, ControlInput, DataArrayRenderer, DefaultAccordion, DefaultArrayRenderer, DefaultBoolOptions, DefaultDisplay, DefaultDisplayOnly, DefaultHtmlButtonRenderer, DefaultHtmlDivRenderer, DefaultHtmlIconRenderer, DefaultHtmlInputRenderer, DefaultHtmlLabelRenderer, DefaultLayout, DefaultVisibility, Fcheckbox, JsonataRenderer, OptionalEditRenderer, SelectDataRenderer, StandardHtmlComponents, ValueForFieldExtension, createAutocompleteRenderer, createButtonActionRenderer, createCheckListRenderer, createCheckboxRenderer, createClassStyledRenderers, createDefaultAdornmentRenderer, createDefaultArrayDataRenderer, createDefaultArrayRenderer, createDefaultDataRenderer, createDefaultDisplayRenderer, createDefaultGroupRenderer, createDefaultLabelRenderer, createDefaultLayoutRenderer, createDefaultRenderers, createDefaultVisibilityRenderer, createElementSelectedRenderer, createInputConversion, createJsonataRenderer, createNullToggleRenderer, createOptionalAdornment, createRadioRenderer, createSelectConversion, createSelectRenderer, createValueForFieldRenderer, createWizardRenderer, defaultTailwindTheme, getAccordionState, setIncluded };
2592
+ export { ControlInput, DataArrayRenderer, DefaultAccordion, DefaultArrayRenderer, DefaultBoolOptions, DefaultDisplay, DefaultDisplayOnly, DefaultHtmlButtonRenderer, DefaultHtmlDivRenderer, DefaultHtmlIconRenderer, DefaultHtmlInputRenderer, DefaultHtmlLabelRenderer, DefaultLayout, DefaultVisibility, Fcheckbox, JsonataRenderer, OptionalEditRenderer, SelectDataRenderer, StandardHtmlComponents, ValueForFieldExtension, createAccordionGroupRenderer, createAutocompleteRenderer, createButtonActionRenderer, createCheckListRenderer, createCheckboxRenderer, createClassStyledRenderers, createDefaultAdornmentRenderer, createDefaultArrayDataRenderer, createDefaultArrayRenderer, createDefaultDataRenderer, createDefaultDisplayRenderer, createDefaultGroupRenderer, createDefaultLabelRenderer, createDefaultLayoutRenderer, createDefaultRenderers, createDefaultVisibilityRenderer, createElementSelectedRenderer, createInputConversion, createJsonataRenderer, createNullToggleRenderer, createOptionalAdornment, createRadioRenderer, createScrollListRenderer, createSelectConversion, createSelectRenderer, createValueForFieldRenderer, createWizardRenderer, defaultTailwindTheme, getAccordionState };
2407
2593
  //# sourceMappingURL=index.js.map