@ostack.tech/ui-kform 1.3.0-beta.0 → 1.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { c } from "react/compiler-runtime";
2
2
  import { AtPathError, CurrentPath, FormContext, FormattedValue, InvalidPathError, equals, formatNumericAsString, formatTemporalAsString, toFileList, useController, useControllerState, useCurrentPath, useFileInput, useForm, useFormContext, useFormController, useFormManager, useFormattedValue, useFormatter, useInput, useIssuesTracker, useListableInput, useNumericInput, useResolvedPath, useSubmitting, useTemporalInput } from "@ostack.tech/kform-react";
3
- import { Action, ActionSplit, Actions, ActionsSecondary, Alert, AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Button, Card, CardBody, CardHeader, CardTitle, Checkbox, CheckboxGroup, CloseButton, Code, Container, ControlAddon, DataTable, DataTableCell, DataTableContent, DataTablePagination, DataTableRow, DataTableRowsPerPage, DateInput, DateRangeInput, DescriptionList, DescriptionListItem, Dialog, DialogBody, DialogContent, DialogHeader, DialogTitle, DialogTrigger, DocumentTitle, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ErrorBoundary, Feedback, FeedbackList, FeedbackPopover, FeedbackProvider, Field, Icon, IconButton, Input, Layer, Link, LocalizationProvider as LocalizationProvider$1, MenuList, MenuListItem, NATIVE_CONTROLS, NumericInput, Option, OptionsGroup, Popover, PopoverContent, PopoverTrigger, PrefixProvider, PrinterTrigger, Radio, RadioGroup, Root, Select, Slot, Spinner, Stack, Step, StepContent, StepList, Stepper, StepperFinishTrigger, StepperNextTrigger, StepperPreviousTrigger, Tab, TabContent, TabList, Tabs, TextArea, Tooltip, VisuallyHidden, boolDataAttr, combineAriaIds, computed, controlStatusToAccent, cx, parseChildren, setBoolDataAttr, useActionsContext, useAlertDialog, useCombinedEventHandler, useCombinedRef, useConstant, useControllableState, useCssVars, useDataTableApiRef, useDataTableColumnLabel, useDateTransformer, useErrorReporter, useIntersectionObserver, useIsInFeedbackProvider, useIsInRoot, useIsInTableCell, useKeyboardShortcut, useLatestRef, useMeasure, useMediaBreakpointUp, useOnLabelChange, usePrefix as usePrefix$1, usePrevious, usePrint, usePrintClassNames, usePrintInProgress, usePrinterDocumentTitle, usePrinting, useResponsiveValue, useScrollPosition, useSpacing, useStartPrintingTask, useToastManager, warnOnce, withCleanup } from "@ostack.tech/ui";
3
+ import { Action, ActionMenu, ActionMenuRadioGroup, ActionMenuRadioItem, ActionSplit, Actions, ActionsSecondary, Alert, AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Button, Card, CardBody, CardHeader, CardTitle, Checkbox, CheckboxGroup, CloseButton, Code, Container, ControlAddon, DataTable, DataTableCell, DataTableContent, DataTablePagination, DataTableRow, DataTableRowsPerPage, DateInput, DateRangeInput, DescriptionList, DescriptionListItem, Dialog, DialogBody, DialogContent, DialogHeader, DialogTitle, DialogTrigger, DocumentTitle, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ErrorBoundary, Feedback, FeedbackList, FeedbackPopover, FeedbackProvider, Field, Icon, IconButton, Input, Layer, Link, LocalizationProvider as LocalizationProvider$1, MenuList, MenuListItem, NATIVE_CONTROLS, NumericInput, Option, OptionsGroup, Popover, PopoverContent, PopoverTrigger, PrefixProvider, PrinterTrigger, Radio, RadioGroup, Root, Select, Slot, Spinner, Stack, Step, StepContent, StepList, Stepper, StepperFinishTrigger, StepperNextTrigger, StepperPreviousTrigger, Tab, TabContent, TabList, Tabs, TextArea, Tooltip, VisuallyHidden, boolDataAttr, combineAriaIds, computed, controlStatusToAccent, cx, localeLabel, parseChildren, setBoolDataAttr, useActionsContext, useAlertDialog, useCombinedEventHandler, useCombinedRef, useConstant, useControllableState, useCssVars, useDataTableApiRef, useDataTableColumnLabel, useDateTransformer, useErrorReporter, useIntersectionObserver, useIsInFeedbackProvider, useIsInRoot, useIsInTableCell, useKeyboardShortcut, useLatestRef, useMeasure, useMediaBreakpointUp, useOnLabelChange, usePrefix as usePrefix$1, usePrevious, usePrint, usePrintClassNames, usePrintInProgress, usePrinterDocumentTitle, usePrinting, useResponsiveValue, useScrollPosition, useSpacing, useStartPrintingTask, useToastManager, warnOnce, withCleanup } from "@ostack.tech/ui";
4
4
  import { Children, Fragment, Suspense, createContext, isValidElement, startTransition, useContext, useDeferredValue, useEffect, useEffectEvent, useId, useImperativeHandle, useRef, useState } from "react";
5
5
  import { createStore, useStore } from "zustand";
6
6
  import { useShallow } from "zustand/react/shallow";
@@ -10,10 +10,10 @@ import { subscribeWithSelector } from "zustand/middleware";
10
10
  import { shallow } from "zustand/shallow";
11
11
  import { fileOpen, fileSave, supported } from "browser-fs-access";
12
12
  import { DEV } from "esm-env";
13
- import { faAngleLeft, faAngleRight, faAnglesLeft, faAnglesRight, faArrowRight, faArrowsToDot, faBug, faChevronDown, faChevronUp, faCircleCheck, faCircleExclamation, faCircleQuestion, faDownload, faFileLines, faFloppyDisk, faFolderOpen, faPlus, faPrint, faTrash, faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
13
+ import { faAngleLeft, faAngleRight, faAnglesLeft, faAnglesRight, faArrowRight, faArrowsToDot, faBug, faChevronDown, faChevronUp, faCircleCheck, faCircleExclamation, faCircleQuestion, faDownload, faFileLines, faFloppyDisk, faFolderOpen, faGlobe, faPlus, faPrint, faTrash, faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
14
14
  import { addDays, format, formatISO, max, min, parseISO } from "date-fns";
15
15
  import { faCircleCheck as faCircleCheck$1 } from "@fortawesome/free-regular-svg-icons";
16
- //#region src/providers/PrefixSuffixProvider/defaultPrefixSuffix.ts
16
+ // src/providers/PrefixSuffixProvider/defaultPrefixSuffix.ts
17
17
  /** Initial default library prefix-suffix. */
18
18
  var DEFAULT_PREFIX_SUFFIX = "kform-";
19
19
  /** Store holding the default prefix-suffix. */
@@ -28,12 +28,10 @@ var defaultPrefixSuffixStore = createStore(() => ({ defaultPrefixSuffix: DEFAULT
28
28
  function setDefaultPrefixSuffix(defaultPrefixSuffix) {
29
29
  defaultPrefixSuffixStore.setState({ defaultPrefixSuffix });
30
30
  }
31
- //#endregion
32
- //#region src/providers/PrefixSuffixProvider/PrefixSuffixContext.ts
31
+ // src/providers/PrefixSuffixProvider/PrefixSuffixContext.ts
33
32
  /** Prefix-suffix context. */
34
33
  var PrefixSuffixContext = createContext(null);
35
- //#endregion
36
- //#region src/providers/PrefixSuffixProvider/PrefixSuffixProvider.tsx
34
+ // src/providers/PrefixSuffixProvider/PrefixSuffixProvider.tsx
37
35
  /** Prefix-suffix provider. */
38
36
  function PrefixSuffixProvider(t0) {
39
37
  const $ = c(3);
@@ -50,8 +48,7 @@ function PrefixSuffixProvider(t0) {
50
48
  } else t1 = $[2];
51
49
  return t1;
52
50
  }
53
- //#endregion
54
- //#region src/providers/PrefixSuffixProvider/usePrefix.ts
51
+ // src/providers/PrefixSuffixProvider/usePrefix.ts
55
52
  /** Hook which returns a function which can be used to prefix a string with the current prefix. */
56
53
  function usePrefix() {
57
54
  const $ = c(3);
@@ -73,8 +70,7 @@ function _temp$54(t0) {
73
70
  const { defaultPrefixSuffix } = t0;
74
71
  return defaultPrefixSuffix;
75
72
  }
76
- //#endregion
77
- //#region src/providers/ActivePathProvider/ActivePathContext.ts
73
+ // src/providers/ActivePathProvider/ActivePathContext.ts
78
74
  /** Active path context. */
79
75
  var ActivePathContext = createContext(null);
80
76
  /** Hook providing access to the active path context. */
@@ -83,8 +79,7 @@ function useActivePathContext() {
83
79
  if (!activePathContext) throw new Error("Active path context not in scope");
84
80
  return activePathContext;
85
81
  }
86
- //#endregion
87
- //#region src/providers/ActivePathProvider/ActivePathProvider.tsx
82
+ // src/providers/ActivePathProvider/ActivePathProvider.tsx
88
83
  /** Provider which controls the active path in a section of a form. */
89
84
  function ActivePathProvider(t0) {
90
85
  const $ = c(12);
@@ -140,12 +135,10 @@ function ActivePathProvider(t0) {
140
135
  } else t4 = $[11];
141
136
  return t4;
142
137
  }
143
- //#endregion
144
- //#region src/providers/LocalizationProvider/LocalizationContext.ts
138
+ // src/providers/LocalizationProvider/LocalizationContext.ts
145
139
  /** Localisation context. */
146
140
  var LocalizationContext = createContext(null);
147
- //#endregion
148
- //#region src/providers/LocalizationProvider/LocalizationProvider.tsx
141
+ // src/providers/LocalizationProvider/LocalizationProvider.tsx
149
142
  /** Localisation provider (also sets the `@ostack.tech/ui` localisation provider). */
150
143
  function LocalizationProvider(t0) {
151
144
  const $ = c(7);
@@ -178,8 +171,7 @@ function LocalizationProvider(t0) {
178
171
  } else t2 = $[6];
179
172
  return t2;
180
173
  }
181
- //#endregion
182
- //#region src/providers/LocalizationProvider/useLocale.ts
174
+ // src/providers/LocalizationProvider/useLocale.ts
183
175
  /** Hook used to get and set the current locale. */
184
176
  function useLocale() {
185
177
  const $ = c(3);
@@ -194,8 +186,7 @@ function useLocale() {
194
186
  } else t0 = $[2];
195
187
  return t0;
196
188
  }
197
- //#endregion
198
- //#region src/utils/pathSpecificity.ts
189
+ // src/utils/pathSpecificity.ts
199
190
  /**
200
191
  * Given two paths, returns a number > 0 if the first path is more specific than the second, a
201
192
  * number < 0 if the first path is less specific than the second, or 0 if both paths have the same
@@ -229,8 +220,7 @@ function pathSpecificity(path) {
229
220
  else if (fragment === AbsolutePathFragment.RecursiveWildcard) ++specificity[2];
230
221
  return specificity;
231
222
  }
232
- //#endregion
233
- //#region src/utils/useEqualityFn.ts
223
+ // src/utils/useEqualityFn.ts
234
224
  var INITIAL = Symbol();
235
225
  function useEqualityFn(selector, t0) {
236
226
  const $ = c(3);
@@ -248,8 +238,7 @@ function useEqualityFn(selector, t0) {
248
238
  } else t1 = $[2];
249
239
  return t1;
250
240
  }
251
- //#endregion
252
- //#region src/components/FormApp/FormAppContext.ts
241
+ // src/components/FormApp/FormAppContext.ts
253
242
  /** Form app context. */
254
243
  var FormAppContext = createContext(null);
255
244
  /** Hook which creates the form app context. */
@@ -814,8 +803,7 @@ function useSetStartIssuesNavigation(fn) {
814
803
  }
815
804
  useEffect(t0, t1);
816
805
  }
817
- //#endregion
818
- //#region src/components/IssueMessage/IssueMessage.tsx
806
+ // src/components/IssueMessage/IssueMessage.tsx
819
807
  /** Default data key where to check for an issue message. */
820
808
  var DEFAULT_ISSUE_MESSAGE_DATA_KEY = "message";
821
809
  /** Single issue message within the issue messages or issues panel components. */
@@ -878,8 +866,7 @@ function IssueMessage(t0) {
878
866
  } else t3 = $[16];
879
867
  return t3;
880
868
  }
881
- //#endregion
882
- //#region src/utils/useControlAutofocus.ts
869
+ // src/utils/useControlAutofocus.ts
883
870
  var FOCUSABLE_ELEMENTS = [
884
871
  "INPUT",
885
872
  "SELECT",
@@ -1006,8 +993,7 @@ function getScrollableParent(el) {
1006
993
  }
1007
994
  return document.scrollingElement ?? document.documentElement;
1008
995
  }
1009
- //#endregion
1010
- //#region src/components/FormApp/FormAppAutoFocus.tsx
996
+ // src/components/FormApp/FormAppAutoFocus.tsx
1011
997
  /** Component enabling support for auto-focusing the form app via `focus("/")`. */
1012
998
  function FormAppAutoFocus() {
1013
999
  const $ = c(6);
@@ -1041,11 +1027,10 @@ function _temp$51(t0) {
1041
1027
  const { initialized } = t0;
1042
1028
  return initialized;
1043
1029
  }
1044
- //#endregion
1045
- //#region src/components/FormApp/FormAppElement.tsx
1030
+ // src/components/FormApp/FormAppElement.tsx
1046
1031
  /** Form application element. */
1047
1032
  function FormAppElement(t0) {
1048
- const $ = c(54);
1033
+ const $ = c(45);
1049
1034
  let children;
1050
1035
  let className;
1051
1036
  let formAppElement;
@@ -1086,103 +1071,97 @@ function FormAppElement(t0) {
1086
1071
  const { store } = useFormAppContext();
1087
1072
  const formTitle = useFormTitle();
1088
1073
  let t2;
1089
- if ($[11] !== cssVarName || $[12] !== formAppElement?.style || $[13] !== store) {
1090
- t2 = () => store.subscribe(_temp$50, (height) => formAppElement?.style.setProperty(cssVarName("top-bar-height"), `${height}px`), { fireImmediately: true });
1091
- $[11] = cssVarName;
1092
- $[12] = formAppElement?.style;
1093
- $[13] = store;
1094
- $[14] = t2;
1095
- } else t2 = $[14];
1096
1074
  let t3;
1097
- if ($[15] !== cssVarName || $[16] !== formAppElement || $[17] !== store) {
1075
+ if ($[11] !== cssVarName || $[12] !== formAppElement || $[13] !== store) {
1076
+ t2 = () => store.subscribe(_temp$50, (height) => formAppElement?.style.setProperty(cssVarName("top-bar-height"), `${height}px`), { fireImmediately: true });
1098
1077
  t3 = [
1099
1078
  cssVarName,
1100
1079
  formAppElement,
1101
1080
  store
1102
1081
  ];
1103
- $[15] = cssVarName;
1104
- $[16] = formAppElement;
1105
- $[17] = store;
1106
- $[18] = t3;
1107
- } else t3 = $[18];
1082
+ $[11] = cssVarName;
1083
+ $[12] = formAppElement;
1084
+ $[13] = store;
1085
+ $[14] = t2;
1086
+ $[15] = t3;
1087
+ } else {
1088
+ t2 = $[14];
1089
+ t3 = $[15];
1090
+ }
1108
1091
  useEffect(t2, t3);
1109
1092
  let t4;
1110
- if ($[19] !== cssVarName || $[20] !== formAppElement?.style || $[21] !== store) {
1111
- t4 = () => store.subscribe(_temp2$46, (width) => formAppElement?.style.setProperty(cssVarName("left-sidebar-width"), `${width}px`), { fireImmediately: true });
1112
- $[19] = cssVarName;
1113
- $[20] = formAppElement?.style;
1114
- $[21] = store;
1115
- $[22] = t4;
1116
- } else t4 = $[22];
1117
1093
  let t5;
1118
- if ($[23] !== cssVarName || $[24] !== formAppElement || $[25] !== store) {
1094
+ if ($[16] !== cssVarName || $[17] !== formAppElement || $[18] !== store) {
1095
+ t4 = () => store.subscribe(_temp2$46, (width) => formAppElement?.style.setProperty(cssVarName("left-sidebar-width"), `${width}px`), { fireImmediately: true });
1119
1096
  t5 = [
1120
1097
  cssVarName,
1121
1098
  formAppElement,
1122
1099
  store
1123
1100
  ];
1124
- $[23] = cssVarName;
1125
- $[24] = formAppElement;
1126
- $[25] = store;
1127
- $[26] = t5;
1128
- } else t5 = $[26];
1101
+ $[16] = cssVarName;
1102
+ $[17] = formAppElement;
1103
+ $[18] = store;
1104
+ $[19] = t4;
1105
+ $[20] = t5;
1106
+ } else {
1107
+ t4 = $[19];
1108
+ t5 = $[20];
1109
+ }
1129
1110
  useEffect(t4, t5);
1130
1111
  let t6;
1131
- if ($[27] !== cssVarName || $[28] !== formAppElement?.style || $[29] !== store) {
1132
- t6 = () => store.subscribe(_temp3$27, (height_0) => formAppElement?.style.setProperty(cssVarName("bottom-panel-height"), `${height_0}px`), { fireImmediately: true });
1133
- $[27] = cssVarName;
1134
- $[28] = formAppElement?.style;
1135
- $[29] = store;
1136
- $[30] = t6;
1137
- } else t6 = $[30];
1138
1112
  let t7;
1139
- if ($[31] !== cssVarName || $[32] !== formAppElement || $[33] !== store) {
1113
+ if ($[21] !== cssVarName || $[22] !== formAppElement || $[23] !== store) {
1114
+ t6 = () => store.subscribe(_temp3$27, (height_0) => formAppElement?.style.setProperty(cssVarName("bottom-panel-height"), `${height_0}px`), { fireImmediately: true });
1140
1115
  t7 = [
1141
1116
  cssVarName,
1142
1117
  formAppElement,
1143
1118
  store
1144
1119
  ];
1145
- $[31] = cssVarName;
1146
- $[32] = formAppElement;
1147
- $[33] = store;
1148
- $[34] = t7;
1149
- } else t7 = $[34];
1120
+ $[21] = cssVarName;
1121
+ $[22] = formAppElement;
1122
+ $[23] = store;
1123
+ $[24] = t6;
1124
+ $[25] = t7;
1125
+ } else {
1126
+ t6 = $[24];
1127
+ t7 = $[25];
1128
+ }
1150
1129
  useEffect(t6, t7);
1151
1130
  let t8;
1152
- if ($[35] !== prefix) {
1131
+ if ($[26] !== prefix) {
1153
1132
  t8 = { prefix };
1154
- $[35] = prefix;
1155
- $[36] = t8;
1156
- } else t8 = $[36];
1133
+ $[26] = prefix;
1134
+ $[27] = t8;
1135
+ } else t8 = $[27];
1157
1136
  const minHeightProps = useResponsiveValue("form-app-", "min-height", minHeight, _temp4$21, t8);
1158
1137
  let t9;
1159
- if ($[37] !== className || $[38] !== prefix) {
1138
+ if ($[28] !== className || $[29] !== prefix) {
1160
1139
  t9 = cx(prefix("form-app"), className);
1161
- $[37] = className;
1162
- $[38] = prefix;
1163
- $[39] = t9;
1164
- } else t9 = $[39];
1140
+ $[28] = className;
1141
+ $[29] = prefix;
1142
+ $[30] = t9;
1143
+ } else t9 = $[30];
1165
1144
  let t10;
1166
- if ($[40] !== minHeightProps.cssVars || $[41] !== style) {
1145
+ if ($[31] !== minHeightProps.cssVars || $[32] !== style) {
1167
1146
  t10 = {
1168
1147
  ...minHeightProps.cssVars,
1169
1148
  ...style
1170
1149
  };
1171
- $[40] = minHeightProps.cssVars;
1172
- $[41] = style;
1173
- $[42] = t10;
1174
- } else t10 = $[42];
1150
+ $[31] = minHeightProps.cssVars;
1151
+ $[32] = style;
1152
+ $[33] = t10;
1153
+ } else t10 = $[33];
1175
1154
  const t11 = minHeightProps.dataAttrs;
1176
1155
  let t12;
1177
- if ($[43] !== ref || $[44] !== setFormAppElement) {
1156
+ if ($[34] !== ref || $[35] !== setFormAppElement) {
1178
1157
  t12 = [setFormAppElement, ref];
1179
- $[43] = ref;
1180
- $[44] = setFormAppElement;
1181
- $[45] = t12;
1182
- } else t12 = $[45];
1158
+ $[34] = ref;
1159
+ $[35] = setFormAppElement;
1160
+ $[36] = t12;
1161
+ } else t12 = $[36];
1183
1162
  const t13 = useCombinedRef(t12);
1184
1163
  let t14;
1185
- if ($[46] !== children || $[47] !== formTitle || $[48] !== minHeightProps.dataAttrs || $[49] !== otherProps || $[50] !== t10 || $[51] !== t13 || $[52] !== t9) {
1164
+ if ($[37] !== children || $[38] !== formTitle || $[39] !== minHeightProps.dataAttrs || $[40] !== otherProps || $[41] !== t10 || $[42] !== t13 || $[43] !== t9) {
1186
1165
  t14 = /* @__PURE__ */ jsx("form", {
1187
1166
  className: t9,
1188
1167
  style: t10,
@@ -1193,15 +1172,15 @@ function FormAppElement(t0) {
1193
1172
  ref: t13,
1194
1173
  children
1195
1174
  });
1196
- $[46] = children;
1197
- $[47] = formTitle;
1198
- $[48] = minHeightProps.dataAttrs;
1199
- $[49] = otherProps;
1200
- $[50] = t10;
1201
- $[51] = t13;
1202
- $[52] = t9;
1203
- $[53] = t14;
1204
- } else t14 = $[53];
1175
+ $[37] = children;
1176
+ $[38] = formTitle;
1177
+ $[39] = minHeightProps.dataAttrs;
1178
+ $[40] = otherProps;
1179
+ $[41] = t10;
1180
+ $[42] = t13;
1181
+ $[43] = t9;
1182
+ $[44] = t14;
1183
+ } else t14 = $[44];
1205
1184
  return t14;
1206
1185
  }
1207
1186
  function _temp4$21(v) {
@@ -1219,16 +1198,14 @@ function _temp$50(t0) {
1219
1198
  const { topBarHeight } = t0;
1220
1199
  return topBarHeight;
1221
1200
  }
1222
- //#endregion
1223
- //#region src/components/FormApp/FormAppIssueMessages.tsx
1201
+ // src/components/FormApp/FormAppIssueMessages.tsx
1224
1202
  /** Component used to register new issue messages within the form app. */
1225
1203
  function FormAppIssueMessages(t0) {
1226
1204
  const { path, issueMessages, priority, children } = t0;
1227
1205
  useRegisterIssueMessages(useResolvedPath(path), issueMessages, priority);
1228
1206
  return children;
1229
1207
  }
1230
- //#endregion
1231
- //#region src/components/FormApp/FormApp.tsx
1208
+ // src/components/FormApp/FormApp.tsx
1232
1209
  /**
1233
1210
  * Root component of a form application. Built on top of the ostack/KForm-React's `useForm` hook.
1234
1211
  *
@@ -1820,8 +1797,7 @@ function _temp2$45(prop) {
1820
1797
  function _temp$49(prop_0) {
1821
1798
  return prop_0 !== void 0;
1822
1799
  }
1823
- //#endregion
1824
- //#region src/components/FormApp/FormAppStatus.tsx
1800
+ // src/components/FormApp/FormAppStatus.tsx
1825
1801
  /** Component used to apply a different form app status to part of the form. */
1826
1802
  function FormAppStatus(t0) {
1827
1803
  const $ = c(7);
@@ -1855,8 +1831,7 @@ function FormAppStatus(t0) {
1855
1831
  } else t6 = $[6];
1856
1832
  return t6;
1857
1833
  }
1858
- //#endregion
1859
- //#region src/utils/mostSpecificPath.ts
1834
+ // src/utils/mostSpecificPath.ts
1860
1835
  /**
1861
1836
  * Function which selects the most "specific" path from a list of paths, given a path to match.
1862
1837
  * `currentActivePath` contains the path that is currently active.
@@ -1873,8 +1848,7 @@ function mostSpecificPath(toMatch, paths, currentActivePath) {
1873
1848
  if (currentActivePath && paths.some((path) => path.contains(currentActivePath))) return currentActivePath;
1874
1849
  return paths[0];
1875
1850
  }
1876
- //#endregion
1877
- //#region src/components/Annexes/AnnexesContext.ts
1851
+ // src/components/Annexes/AnnexesContext.ts
1878
1852
  /** Annexes' context. */
1879
1853
  var AnnexesContext = createContext(null);
1880
1854
  /** Hook used to create the annexes' context. */
@@ -2142,8 +2116,7 @@ function useAnnexState(path, selector) {
2142
2116
  } else t0 = $[2];
2143
2117
  return useStore(useAnnexesContext(), t0);
2144
2118
  }
2145
- //#endregion
2146
- //#region src/components/Annexes/Annex.tsx
2119
+ // src/components/Annexes/Annex.tsx
2147
2120
  /** Component containing the content of an annex. */
2148
2121
  function Annex(t0) {
2149
2122
  const $ = c(11);
@@ -2368,8 +2341,7 @@ function AnnexTabContent(t0) {
2368
2341
  function _temp2$43(state) {
2369
2342
  return state === null ? null : state.documentTitle;
2370
2343
  }
2371
- //#endregion
2372
- //#region src/utils/useFormLoader.tsx
2344
+ // src/utils/useFormLoader.tsx
2373
2345
  /** Hook exposing a function used to load the form from a file. */
2374
2346
  function useFormLoader(t0) {
2375
2347
  const $ = c(27);
@@ -2394,9 +2366,9 @@ function useFormLoader(t0) {
2394
2366
  } else t2 = $[3];
2395
2367
  const defaultId = t2;
2396
2368
  let t3;
2397
- if ($[4] !== _setState || $[5] !== addToast || $[6] !== defaultId || $[7] !== formManager || $[8] !== locale || $[9] !== onAfterLoad || $[10] !== onBeforeLoad || $[11] !== startIssuesNavigation) {
2369
+ if ($[4] !== _setState || $[5] !== addToast || $[6] !== defaultId || $[7] !== formManager || $[8] !== locale || $[9] !== startIssuesNavigation) {
2398
2370
  t3 = async function load(t4) {
2399
- const { decode: decode_0, path: t5, extensions: extensions_0, mimeTypes: mimeTypes_0, description: description_0, startIn: startIn_0, id: t6, setPristineOnLoad: t7, setTouchedOnLoad: t8, validateOnLoad: t9, successMessage: successMessageProp, errorMessage: errorMessageProp } = t4;
2371
+ const { decode: decode_0, path: t5, extensions: extensions_0, mimeTypes: mimeTypes_0, description: description_0, startIn: startIn_0, id: t6, onBeforeLoad: onBeforeLoad_0, onAfterLoad: onAfterLoad_0, setPristineOnLoad: t7, setTouchedOnLoad: t8, validateOnLoad: t9, successMessage: successMessageProp, errorMessage: errorMessageProp } = t4;
2400
2372
  const path_0 = t5 === void 0 ? AbsolutePath.ROOT : t5;
2401
2373
  const id_0 = t6 === void 0 ? defaultId : t6;
2402
2374
  const setPristineOnLoad_0 = t7 === void 0 ? true : t7;
@@ -2407,13 +2379,15 @@ function useFormLoader(t0) {
2407
2379
  const errorMessage_0 = errorMessageProp ?? locale.LoadAction.errorMessage;
2408
2380
  _setState({ preparingLoad: true });
2409
2381
  const validationModeIsAuto = formManager.autoValidationStatus !== "inactive";
2410
- let file = null;
2411
- let beforeLoadResult;
2382
+ const loadState = {
2383
+ file: null,
2384
+ started: false
2385
+ };
2412
2386
  await withCleanup(async () => {
2413
2387
  try {
2414
- beforeLoadResult = await onBeforeLoad?.();
2415
- if (beforeLoadResult === false) return;
2416
- file = await fileOpen({
2388
+ if (await onBeforeLoad_0?.() === false) return;
2389
+ loadState.started = true;
2390
+ const loadedFile = loadState.file = await fileOpen({
2417
2391
  extensions: extensions_0,
2418
2392
  mimeTypes: mimeTypes_0,
2419
2393
  description: description_0,
@@ -2424,10 +2398,10 @@ function useFormLoader(t0) {
2424
2398
  preparingLoad: false,
2425
2399
  loading: true
2426
2400
  });
2427
- const formValue = await decode_0(file);
2401
+ const formValue = await decode_0(loadedFile);
2428
2402
  if (validationModeIsAuto) await formManager.setValidationMode("manual");
2429
2403
  await formManager.set(path_0, formValue);
2430
- if (setPristineOnLoad_0 || setTouchedOnLoad_0) {
2404
+ if (setPristineOnLoad_0 || setTouchedOnLoad_0 || validateOnLoad_0) {
2431
2405
  const pathWithDescendants = (path_0 instanceof AbsolutePath ? path_0 : new AbsolutePath(path_0)).append(AbsolutePathFragment.RecursiveWildcard);
2432
2406
  await Promise.all([
2433
2407
  setPristineOnLoad_0 && formManager.setPristine(path_0),
@@ -2438,20 +2412,22 @@ function useFormLoader(t0) {
2438
2412
  if (validateOnLoad_0) await startIssuesNavigation({ validate: false });
2439
2413
  _setState((state) => ({ latestFileHandles: {
2440
2414
  ...state.latestFileHandles,
2441
- [id_0]: file.handle ?? null
2415
+ [id_0]: loadedFile.handle ?? null
2442
2416
  } }));
2443
- const message_0 = typeof successMessage_0 === "function" ? successMessage_0(file) : successMessage_0;
2417
+ const message_0 = typeof successMessage_0 === "function" ? successMessage_0(loadedFile) : successMessage_0;
2444
2418
  if (message_0 != null) addToast(message_0, { severity: "success" });
2445
2419
  } catch (t10) {
2446
2420
  const error = t10;
2447
2421
  if (error instanceof DOMException && error.name === "AbortError") return;
2448
2422
  if (DEV) console.error(error);
2449
- const message = typeof errorMessage_0 === "function" ? errorMessage_0(file, error) : errorMessage_0;
2423
+ const message = typeof errorMessage_0 === "function" ? errorMessage_0(loadState.file, error) : errorMessage_0;
2450
2424
  if (message != null) addToast(message, { severity: "danger" });
2451
2425
  }
2452
2426
  }, () => withCleanup(async () => {
2453
- if (validationModeIsAuto) await formManager.setValidationMode("auto");
2454
- if (beforeLoadResult !== false) await onAfterLoad?.();
2427
+ if (loadState.started) {
2428
+ if (validationModeIsAuto) await formManager.setValidationMode("auto");
2429
+ await onAfterLoad_0?.();
2430
+ }
2455
2431
  }, () => _setState({
2456
2432
  preparingLoad: false,
2457
2433
  loading: false
@@ -2462,14 +2438,12 @@ function useFormLoader(t0) {
2462
2438
  $[6] = defaultId;
2463
2439
  $[7] = formManager;
2464
2440
  $[8] = locale;
2465
- $[9] = onAfterLoad;
2466
- $[10] = onBeforeLoad;
2467
- $[11] = startIssuesNavigation;
2468
- $[12] = t3;
2469
- } else t3 = $[12];
2441
+ $[9] = startIssuesNavigation;
2442
+ $[10] = t3;
2443
+ } else t3 = $[10];
2470
2444
  const load = t3;
2471
2445
  let t4;
2472
- if ($[13] !== decode || $[14] !== description || $[15] !== errorMessage || $[16] !== extensions || $[17] !== id || $[18] !== load || $[19] !== mimeTypes || $[20] !== path || $[21] !== setPristineOnLoad || $[22] !== setTouchedOnLoad || $[23] !== startIn || $[24] !== successMessage || $[25] !== validateOnLoad) {
2446
+ if ($[11] !== decode || $[12] !== description || $[13] !== errorMessage || $[14] !== extensions || $[15] !== id || $[16] !== load || $[17] !== mimeTypes || $[18] !== onAfterLoad || $[19] !== onBeforeLoad || $[20] !== path || $[21] !== setPristineOnLoad || $[22] !== setTouchedOnLoad || $[23] !== startIn || $[24] !== successMessage || $[25] !== validateOnLoad) {
2473
2447
  t4 = {
2474
2448
  load: (t5) => {
2475
2449
  return load({
@@ -2480,6 +2454,8 @@ function useFormLoader(t0) {
2480
2454
  description,
2481
2455
  startIn,
2482
2456
  id,
2457
+ onBeforeLoad,
2458
+ onAfterLoad,
2483
2459
  setPristineOnLoad,
2484
2460
  setTouchedOnLoad,
2485
2461
  validateOnLoad,
@@ -2490,13 +2466,15 @@ function useFormLoader(t0) {
2490
2466
  },
2491
2467
  supportsFileSystemAPIs: supported
2492
2468
  };
2493
- $[13] = decode;
2494
- $[14] = description;
2495
- $[15] = errorMessage;
2496
- $[16] = extensions;
2497
- $[17] = id;
2498
- $[18] = load;
2499
- $[19] = mimeTypes;
2469
+ $[11] = decode;
2470
+ $[12] = description;
2471
+ $[13] = errorMessage;
2472
+ $[14] = extensions;
2473
+ $[15] = id;
2474
+ $[16] = load;
2475
+ $[17] = mimeTypes;
2476
+ $[18] = onAfterLoad;
2477
+ $[19] = onBeforeLoad;
2500
2478
  $[20] = path;
2501
2479
  $[21] = setPristineOnLoad;
2502
2480
  $[22] = setTouchedOnLoad;
@@ -2524,8 +2502,7 @@ function useFormIsLoading() {
2524
2502
  function _temp2$42(state) {
2525
2503
  return state.loading;
2526
2504
  }
2527
- //#endregion
2528
- //#region src/components/Annexes/AnnexRegistrar.tsx
2505
+ // src/components/Annexes/AnnexRegistrar.tsx
2529
2506
  /** Component used to register a form annex. */
2530
2507
  function AnnexRegistrar(t0) {
2531
2508
  const $ = c(50);
@@ -2725,8 +2702,7 @@ function _temp2$41(t0) {
2725
2702
  function _temp$45(value) {
2726
2703
  return value === null;
2727
2704
  }
2728
- //#endregion
2729
- //#region src/components/Annexes/RepetitiveAnnexRegistrar.tsx
2705
+ // src/components/Annexes/RepetitiveAnnexRegistrar.tsx
2730
2706
  /** Component used to register a repetitive form annex. */
2731
2707
  function RepetitiveAnnexRegistrar(t0) {
2732
2708
  const $ = c(25);
@@ -2851,8 +2827,7 @@ function _temp2$40(t0) {
2851
2827
  function _temp$44(value) {
2852
2828
  return value ? tableIdsToArray(value) : [];
2853
2829
  }
2854
- //#endregion
2855
- //#region src/components/Annexes/Annexes.tsx
2830
+ // src/components/Annexes/Annexes.tsx
2856
2831
  /**
2857
2832
  * The annexes component can be used to split parts of a form into separate annexes (tabs), while
2858
2833
  * providing means of managing and navigating between them. Although not strictly mandatory, each
@@ -3049,8 +3024,7 @@ function _temp2$39(frag_0, i, t0) {
3049
3024
  function _temp$43(frag) {
3050
3025
  return !(frag instanceof AbsolutePathFragment.Id);
3051
3026
  }
3052
- //#endregion
3053
- //#region src/utils/useReportValidationFailures.ts
3027
+ // src/utils/useReportValidationFailures.ts
3054
3028
  var ValidationFailureError = class extends AtPathError {
3055
3029
  constructor(path, issue) {
3056
3030
  super(path, `Failed to run validation '${issue.validation}'`);
@@ -3081,8 +3055,7 @@ function useReportValidationFailures(info) {
3081
3055
  }
3082
3056
  useEffect(t0, t1);
3083
3057
  }
3084
- //#endregion
3085
- //#region src/components/IssueMessages/IssueMessages.tsx
3058
+ // src/components/IssueMessages/IssueMessages.tsx
3086
3059
  /**
3087
3060
  * Component used to display all issues associated with the relevant path.
3088
3061
  *
@@ -3254,8 +3227,7 @@ function IssueMessages(t0) {
3254
3227
  function _temp$42(info_0) {
3255
3228
  return info_0.issues;
3256
3229
  }
3257
- //#endregion
3258
- //#region src/components/IssuesPopover/IssuesPopover.tsx
3230
+ // src/components/IssuesPopover/IssuesPopover.tsx
3259
3231
  /** Component used to display issues within a popover. */
3260
3232
  function IssuesPopover(t0) {
3261
3233
  const $ = c(25);
@@ -3342,8 +3314,7 @@ function IssuesPopover(t0) {
3342
3314
  } else t6 = $[24];
3343
3315
  return t6;
3344
3316
  }
3345
- //#endregion
3346
- //#region src/utils/displayStatusConversions.ts
3317
+ // src/utils/displayStatusConversions.ts
3347
3318
  /** Transforms ostack/KForm's display status into ostack/UI's control status. */
3348
3319
  function displayStatusToControlStatus(displayStatus) {
3349
3320
  switch (displayStatus) {
@@ -3360,8 +3331,7 @@ function displayStatusToColor(displayStatus) {
3360
3331
  default: return;
3361
3332
  }
3362
3333
  }
3363
- //#endregion
3364
- //#region src/utils/promiseUtils.ts
3334
+ // src/utils/promiseUtils.ts
3365
3335
  /**
3366
3336
  * Whether a given value is [promise-like]{@link PromiseLike}.
3367
3337
  *
@@ -3371,16 +3341,14 @@ function displayStatusToColor(displayStatus) {
3371
3341
  function isPromiseLike(value) {
3372
3342
  return typeof value?.then === "function";
3373
3343
  }
3374
- //#endregion
3375
- //#region src/components/TopBar/TopBarContext.tsx
3344
+ // src/components/TopBar/TopBarContext.tsx
3376
3345
  /** Context of the top bar component. */
3377
3346
  var TopBarContext = createContext(null);
3378
3347
  /** Provides access to the top bar element within the context. */
3379
3348
  function useTopBarElement() {
3380
3349
  return useContext(TopBarContext)?.topBarEl ?? null;
3381
3350
  }
3382
- //#endregion
3383
- //#region src/components/TopBar/TopBar.tsx
3351
+ // src/components/TopBar/TopBar.tsx
3384
3352
  /** Top bar component. */
3385
3353
  function TopBar(t0) {
3386
3354
  const $ = c(29);
@@ -3482,8 +3450,7 @@ function TopBar(t0) {
3482
3450
  } else t8 = $[28];
3483
3451
  return t8;
3484
3452
  }
3485
- //#endregion
3486
- //#region src/components/TopBar/TopBarActions.tsx
3453
+ // src/components/TopBar/TopBarActions.tsx
3487
3454
  /** Container of the top bar actions. */
3488
3455
  function TopBarActions(t0) {
3489
3456
  const $ = c(19);
@@ -3558,8 +3525,7 @@ function TopBarActions(t0) {
3558
3525
  } else t6 = $[18];
3559
3526
  return t6;
3560
3527
  }
3561
- //#endregion
3562
- //#region src/components/TopBar/TopBarActionsSecondary.tsx
3528
+ // src/components/TopBar/TopBarActionsSecondary.tsx
3563
3529
  /** Container of the secondary top bar actions. */
3564
3530
  function TopBarActionsSecondary(props) {
3565
3531
  const $ = c(2);
@@ -3574,8 +3540,7 @@ function TopBarActionsSecondary(props) {
3574
3540
  } else t0 = $[1];
3575
3541
  return t0;
3576
3542
  }
3577
- //#endregion
3578
- //#region src/components/Annexes/AnnexesMenu.tsx
3543
+ // src/components/Annexes/AnnexesMenu.tsx
3579
3544
  /** Component that allows to navigate between, add, and remove annexes. */
3580
3545
  function AnnexesMenu(t0) {
3581
3546
  const $ = c(87);
@@ -4273,8 +4238,7 @@ function AnnexesMenuNewItem(t0) {
4273
4238
  } else t13 = $[39];
4274
4239
  return t13;
4275
4240
  }
4276
- //#endregion
4277
- //#region src/components/Annexes/AnnexTab.tsx
4241
+ // src/components/Annexes/AnnexTab.tsx
4278
4242
  function AnnexTab(t0) {
4279
4243
  const $ = c(68);
4280
4244
  const { path } = t0;
@@ -4519,8 +4483,7 @@ function _temp2$37(state_0) {
4519
4483
  function _temp$40(state) {
4520
4484
  return state?.deferredIssuesToDisplay ?? [];
4521
4485
  }
4522
- //#endregion
4523
- //#region src/components/Annexes/AnnexesTabList.tsx
4486
+ // src/components/Annexes/AnnexesTabList.tsx
4524
4487
  /** List of annex tabs. */
4525
4488
  function AnnexesTabList(t0) {
4526
4489
  const $ = c(30);
@@ -4612,8 +4575,7 @@ function _temp2$36(state_0) {
4612
4575
  function _temp$39(state) {
4613
4576
  return state.activeAnnex;
4614
4577
  }
4615
- //#endregion
4616
- //#region src/components/Annexes/AnnexesManager.tsx
4578
+ // src/components/Annexes/AnnexesManager.tsx
4617
4579
  /**
4618
4580
  * Component used to manage the form's annexes. Provides a menu that allows changing, adding, and
4619
4581
  * removing annexes, as well as a list of tabs for each existing annex.
@@ -5013,8 +4975,140 @@ function _temp2$35(state_0) {
5013
4975
  function _temp$38(state) {
5014
4976
  return state.tablessStates();
5015
4977
  }
5016
- //#endregion
5017
- //#region src/utils/useControlIssues.tsx
4978
+ // src/components/ChangeLocaleAction/ChangeLocaleAction.tsx
4979
+ /**
4980
+ * [Action](/docs/ostack-ui-layout-actions--docs) used to change the application's locale.
4981
+ *
4982
+ * Note that `getLocalizationObject` must be specified to manually return `@ostack.tech/ui-kform`'s
4983
+ * localisation object for the provided locale. This is **not** automatic so that translations may
4984
+ * be code-split when applications are bundled.
4985
+ *
4986
+ * Example usage:
4987
+ *
4988
+ * ```tsx
4989
+ * import { ChangeLocaleAction } from "@ostack.tech/ui-kform";
4990
+ * import { useI18n } from "@example-lib/i18n";
4991
+ *
4992
+ * const LOCALE_LOADERS = {
4993
+ * "en-US": () => import("@ostack.tech/ui-kform/locales/en-US"),
4994
+ * "pt-PT": () => import("@ostack.tech/ui-kform/locales/pt-PT"),
4995
+ * };
4996
+ *
4997
+ * function ChangeFormLocale() {
4998
+ * const { i18n } = useI18n();
4999
+ * return (
5000
+ * <ChangeLocaleAction
5001
+ * locales={["en-US", "pt-PT"]}
5002
+ * getLocalizationObject={async (locale) => (await LOCALE_LOADERS[locale]()).locale}
5003
+ * onLocaleChange={(locale) => i18n.setLocale(locale)}
5004
+ * />
5005
+ * );
5006
+ * }
5007
+ * ```
5008
+ */
5009
+ function ChangeLocaleAction(t0) {
5010
+ const $ = c(31);
5011
+ let getLocalizationObject;
5012
+ let labelProp;
5013
+ let loading;
5014
+ let localeLabels;
5015
+ let localesProp;
5016
+ let onLocaleChange;
5017
+ let otherProps;
5018
+ let showWhenReadOnly;
5019
+ if ($[0] !== t0) {
5020
+ ({locales: localesProp, onLocaleChange, getLocalizationObject, localeLabels, showWhenReadOnly, label: labelProp, loading, ...otherProps} = t0);
5021
+ $[0] = t0;
5022
+ $[1] = getLocalizationObject;
5023
+ $[2] = labelProp;
5024
+ $[3] = loading;
5025
+ $[4] = localeLabels;
5026
+ $[5] = localesProp;
5027
+ $[6] = onLocaleChange;
5028
+ $[7] = otherProps;
5029
+ $[8] = showWhenReadOnly;
5030
+ } else {
5031
+ getLocalizationObject = $[1];
5032
+ labelProp = $[2];
5033
+ loading = $[3];
5034
+ localeLabels = $[4];
5035
+ localesProp = $[5];
5036
+ onLocaleChange = $[6];
5037
+ otherProps = $[7];
5038
+ showWhenReadOnly = $[8];
5039
+ }
5040
+ const [locale, setLocale] = useLocale();
5041
+ const curLocale = locale.baseLocale.languageTag;
5042
+ let t1;
5043
+ if ($[9] !== curLocale || $[10] !== localesProp) {
5044
+ t1 = localesProp ?? [curLocale];
5045
+ $[9] = curLocale;
5046
+ $[10] = localesProp;
5047
+ $[11] = t1;
5048
+ } else t1 = $[11];
5049
+ const locales = t1;
5050
+ let t2;
5051
+ if ($[12] !== curLocale || $[13] !== labelProp || $[14] !== locale.ChangeLocaleAction || $[15] !== locales) {
5052
+ t2 = (labelProp === void 0 ? locale.ChangeLocaleAction.label : labelProp) ?? localeLabel(curLocale, locales);
5053
+ $[12] = curLocale;
5054
+ $[13] = labelProp;
5055
+ $[14] = locale.ChangeLocaleAction;
5056
+ $[15] = locales;
5057
+ $[16] = t2;
5058
+ } else t2 = $[16];
5059
+ const label = t2;
5060
+ const [changingLocale, setChangingLocale] = useState(false);
5061
+ const showAction = !useFormIsReadOnly() || showWhenReadOnly;
5062
+ const showLoading = loading || changingLocale;
5063
+ let t3;
5064
+ if ($[17] !== getLocalizationObject || $[18] !== onLocaleChange || $[19] !== setLocale) {
5065
+ t3 = async function handleLanguageChange(locale_0) {
5066
+ setChangingLocale(true);
5067
+ withCleanup(() => {
5068
+ const localizationObject = getLocalizationObject(locale_0);
5069
+ return Promise.all([isPromiseLike(localizationObject) ? localizationObject.then(setLocale) : localizationObject && setLocale(localizationObject), onLocaleChange?.(locale_0)]);
5070
+ }, () => setChangingLocale(false));
5071
+ };
5072
+ $[17] = getLocalizationObject;
5073
+ $[18] = onLocaleChange;
5074
+ $[19] = setLocale;
5075
+ $[20] = t3;
5076
+ } else t3 = $[20];
5077
+ const handleLanguageChange = t3;
5078
+ const { secondary } = useActionsContext() ?? {};
5079
+ let t4;
5080
+ if ($[21] !== curLocale || $[22] !== handleLanguageChange || $[23] !== label || $[24] !== localeLabels || $[25] !== locales || $[26] !== otherProps || $[27] !== secondary || $[28] !== showAction || $[29] !== showLoading) {
5081
+ t4 = showAction && /* @__PURE__ */ jsx(ActionMenu, {
5082
+ layout: secondary ? void 0 : "vertical",
5083
+ label,
5084
+ variant: "solid",
5085
+ color: "primary",
5086
+ icon: faGlobe,
5087
+ ...otherProps,
5088
+ loading: showLoading,
5089
+ children: /* @__PURE__ */ jsx(ActionMenuRadioGroup, {
5090
+ value: curLocale,
5091
+ onValueChange: handleLanguageChange,
5092
+ children: locales.map((l) => /* @__PURE__ */ jsx(ActionMenuRadioItem, {
5093
+ value: l,
5094
+ children: localeLabels?.[l] ?? localeLabel(l, locales)
5095
+ }, l))
5096
+ })
5097
+ });
5098
+ $[21] = curLocale;
5099
+ $[22] = handleLanguageChange;
5100
+ $[23] = label;
5101
+ $[24] = localeLabels;
5102
+ $[25] = locales;
5103
+ $[26] = otherProps;
5104
+ $[27] = secondary;
5105
+ $[28] = showAction;
5106
+ $[29] = showLoading;
5107
+ $[30] = t4;
5108
+ } else t4 = $[30];
5109
+ return t4;
5110
+ }
5111
+ // src/utils/useControlIssues.tsx
5018
5112
  /** Hook which helps a control component render its issues. */
5019
5113
  function useControlIssues(t0) {
5020
5114
  const $ = c(25);
@@ -5109,8 +5203,7 @@ function useControlIssues(t0) {
5109
5203
  } else t6 = $[24];
5110
5204
  return t6;
5111
5205
  }
5112
- //#endregion
5113
- //#region src/utils/useRegisterControl.tsx
5206
+ // src/utils/useRegisterControl.tsx
5114
5207
  /** Hook used to register a control within the form app. */
5115
5208
  function useRegisterControl(t0) {
5116
5209
  const $ = c(24);
@@ -5245,8 +5338,7 @@ function useRegisterFieldLabel(path, issuesPanelLabelSuffix) {
5245
5338
  } else t0 = $[3];
5246
5339
  useOnLabelChange(t0);
5247
5340
  }
5248
- //#endregion
5249
- //#region src/components/DebugInfo/DebugInfo.tsx
5341
+ // src/components/DebugInfo/DebugInfo.tsx
5250
5342
  /** Debug information. */
5251
5343
  function DebugInfo(t0) {
5252
5344
  const $ = c(33);
@@ -5442,8 +5534,7 @@ function defaultFormat(value) {
5442
5534
  if (typeof value === "object" && [null, Object.prototype].includes(Object.getPrototypeOf(value))) return `{${Object.entries(value).map(([k, v]) => `${k}: ${defaultFormat(v)}`).join(", ")}}`;
5443
5535
  return String(value);
5444
5536
  }
5445
- //#endregion
5446
- //#region src/components/DebugInfo/DebugInfoControlAddonTrigger.tsx
5537
+ // src/components/DebugInfo/DebugInfoControlAddonTrigger.tsx
5447
5538
  /** Debug info trigger as a control addon. */
5448
5539
  function DebugInfoControlAddonTrigger(t0) {
5449
5540
  const $ = c(11);
@@ -5494,16 +5585,14 @@ function DebugInfoControlAddonTrigger(t0) {
5494
5585
  } else t3 = $[10];
5495
5586
  return t3;
5496
5587
  }
5497
- //#endregion
5498
- //#region src/components/ResetOnChange/ResetOnChangeContext.ts
5588
+ // src/components/ResetOnChange/ResetOnChangeContext.ts
5499
5589
  /** Reset on change context. */
5500
5590
  var ResetOnChangeContext = createContext(void 0);
5501
5591
  /** Function providing access to the reset on change context value. */
5502
5592
  function useResetOnChangeContext() {
5503
5593
  return useContext(ResetOnChangeContext);
5504
5594
  }
5505
- //#endregion
5506
- //#region src/utils/extractConfirmDialogOptions.ts
5595
+ // src/utils/extractConfirmDialogOptions.ts
5507
5596
  /** Function used to extract confirm dialog options with a given prefix. */
5508
5597
  function extractConfirmDialogOptions(options, prefix = "confirmDialog", newPrefix = "") {
5509
5598
  const confirmDialogOptions = {};
@@ -5518,8 +5607,7 @@ function extractConfirmDialogOptions(options, prefix = "confirmDialog", newPrefi
5518
5607
  }
5519
5608
  return [confirmDialogOptions, otherOptions];
5520
5609
  }
5521
- //#endregion
5522
- //#region src/components/ResetOnChange/useResetOnChange.tsx
5610
+ // src/components/ResetOnChange/useResetOnChange.tsx
5523
5611
  var defaultWhen = () => true;
5524
5612
  /**
5525
5613
  * Hook which returns an `onValueChange` event handler which resets the fields at the provided
@@ -5702,8 +5790,7 @@ async function resetAll(formManager, toReset, setPristine, setUntouched) {
5702
5790
  setUntouched && formManager.setUntouched(path)
5703
5791
  ]));
5704
5792
  }
5705
- //#endregion
5706
- //#region src/components/ResetOnChange/ResetOnChange.tsx
5793
+ // src/components/ResetOnChange/ResetOnChange.tsx
5707
5794
  /**
5708
5795
  * Component used to reset path(s) to their initial value when the value of controls within it
5709
5796
  * change (according to the `when` function). Built on top of the `useResetOnChange` hook.
@@ -5755,8 +5842,7 @@ function ResetOnChange(t0) {
5755
5842
  } else t1 = $[6];
5756
5843
  return t1;
5757
5844
  }
5758
- //#endregion
5759
- //#region src/components/CheckboxControl/CheckboxControl.tsx
5845
+ // src/components/CheckboxControl/CheckboxControl.tsx
5760
5846
  /**
5761
5847
  * The checkbox control component is a KForm form control for values with (possibly
5762
5848
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
@@ -6103,8 +6189,7 @@ function parseCheckboxValue(formattedValue, state) {
6103
6189
  function formatToCheckboxValue(value) {
6104
6190
  return value === void 0 ? false : value ?? "indeterminate";
6105
6191
  }
6106
- //#endregion
6107
- //#region src/utils/selectionTransformations.tsx
6192
+ // src/utils/selectionTransformations.tsx
6108
6193
  /** Whether the provided value isn't a known option. */
6109
6194
  function isUnknownValue(value, options) {
6110
6195
  return value != null && value !== "" && options.every((opt) => !equals(opt.value, value));
@@ -6158,8 +6243,7 @@ function selectionItemObjectsToNodes(items) {
6158
6243
  children: optionOrGroup.text ?? optionOrGroup.value?.toString() ?? ""
6159
6244
  }, key ?? i));
6160
6245
  }
6161
- //#endregion
6162
- //#region src/components/UnknownValue/UnknownValue.tsx
6246
+ // src/components/UnknownValue/UnknownValue.tsx
6163
6247
  /** Representation of an unknown value. */
6164
6248
  function UnknownValue(t0) {
6165
6249
  const $ = c(13);
@@ -6217,8 +6301,7 @@ function UnknownValue(t0) {
6217
6301
  } else t4 = $[12];
6218
6302
  return t4;
6219
6303
  }
6220
- //#endregion
6221
- //#region src/components/CheckboxGroupControl/CheckboxGroupControlItem.tsx
6304
+ // src/components/CheckboxGroupControl/CheckboxGroupControlItem.tsx
6222
6305
  /**
6223
6306
  * Definition of a checkbox group control item.
6224
6307
  *
@@ -6228,8 +6311,7 @@ function UnknownValue(t0) {
6228
6311
  function CheckboxGroupControlItem(_props) {
6229
6312
  return null;
6230
6313
  }
6231
- //#endregion
6232
- //#region src/components/CheckboxGroupControl/CheckboxGroupControl.tsx
6314
+ // src/components/CheckboxGroupControl/CheckboxGroupControl.tsx
6233
6315
  /**
6234
6316
  * The checkbox group control component is a KForm form control for values with (possibly
6235
6317
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
@@ -6648,8 +6730,7 @@ function _temp$34(t0) {
6648
6730
  ...otherProps_0
6649
6731
  };
6650
6732
  }
6651
- //#endregion
6652
- //#region src/components/ControlField/ControlField.tsx
6733
+ // src/components/ControlField/ControlField.tsx
6653
6734
  /**
6654
6735
  * Component used to group controls with a label, helper text, and/or feedback.
6655
6736
  *
@@ -6719,8 +6800,7 @@ function ControlField(t0) {
6719
6800
  } else t3 = $[7];
6720
6801
  return t3;
6721
6802
  }
6722
- //#endregion
6723
- //#region src/utils/dateRestrictions.ts
6803
+ // src/utils/dateRestrictions.ts
6724
6804
  /** Returns the minimum date allowed based on a temporal schema's restrictions. */
6725
6805
  function minDateRestriction(schema) {
6726
6806
  const { restrictions } = schema.typeInfo;
@@ -6741,8 +6821,7 @@ function maxDateRestriction(schema) {
6741
6821
  function temporalRestrictionToDate(restriction, schema) {
6742
6822
  return restriction == null ? void 0 : parseISO(formatTemporalAsString(restriction, schema));
6743
6823
  }
6744
- //#endregion
6745
- //#region src/utils/useTemporalStringTransformer.ts
6824
+ // src/utils/useTemporalStringTransformer.ts
6746
6825
  /**
6747
6826
  * Hook exposing functions to transform a temporal string value from/into a string representation of
6748
6827
  * a date accepted by a date input.
@@ -6783,8 +6862,7 @@ function useTemporalStringTransformer(dateTransformerOptions) {
6783
6862
  } else t2 = $[6];
6784
6863
  return t2;
6785
6864
  }
6786
- //#endregion
6787
- //#region src/components/DateControl/DateControl.tsx
6865
+ // src/components/DateControl/DateControl.tsx
6788
6866
  /**
6789
6867
  * The date control component is a KForm form control for values with (typically nullable) schemas
6790
6868
  * of type
@@ -7174,8 +7252,7 @@ function _temp$33(t0) {
7174
7252
  const { schema } = t0;
7175
7253
  return schema;
7176
7254
  }
7177
- //#endregion
7178
- //#region src/components/DateRangeControl/DateRangeControl.tsx
7255
+ // src/components/DateRangeControl/DateRangeControl.tsx
7179
7256
  /**
7180
7257
  * The date-range control component is a KForm form control for pairs of values (start and end
7181
7258
  * dates) with (typically nullable) schemas of type
@@ -7834,8 +7911,7 @@ function _temp$32(t0) {
7834
7911
  const { schema } = t0;
7835
7912
  return schema;
7836
7913
  }
7837
- //#endregion
7838
- //#region src/components/FileControl/FileControlDownloadAddon.tsx
7914
+ // src/components/FileControl/FileControlDownloadAddon.tsx
7839
7915
  /** Control addon used to download a file. */
7840
7916
  function FileControlDownloadAddon(t0) {
7841
7917
  const $ = c(10);
@@ -7879,8 +7955,7 @@ function FileControlDownloadAddon(t0) {
7879
7955
  } else t4 = $[9];
7880
7956
  return t4;
7881
7957
  }
7882
- //#endregion
7883
- //#region src/components/FileControl/FileControlViewAddon.tsx
7958
+ // src/components/FileControl/FileControlViewAddon.tsx
7884
7959
  /** Control addon used to view a file. */
7885
7960
  function FileControlViewAddon(t0) {
7886
7961
  const $ = c(52);
@@ -8058,8 +8133,7 @@ function FileControlViewAddon(t0) {
8058
8133
  } else t21 = $[51];
8059
8134
  return t21;
8060
8135
  }
8061
- //#endregion
8062
- //#region src/components/FileControl/FileControl.tsx
8136
+ // src/components/FileControl/FileControl.tsx
8063
8137
  /**
8064
8138
  * The file control component is a KForm form control for values with (typically
8065
8139
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
@@ -8548,8 +8622,7 @@ function _temp$31(t0) {
8548
8622
  const { schema } = t0;
8549
8623
  return schema;
8550
8624
  }
8551
- //#endregion
8552
- //#region src/components/FormPages/FormPagesContext.ts
8625
+ // src/components/FormPages/FormPagesContext.ts
8553
8626
  /** Form pages context. */
8554
8627
  var FormPagesContext = createContext(null);
8555
8628
  /** Hook used to create the form pages context. */
@@ -8698,8 +8771,7 @@ function useFormPageState(path, selector) {
8698
8771
  } else t0 = $[2];
8699
8772
  return useStore(useFormPagesContext(), t0);
8700
8773
  }
8701
- //#endregion
8702
- //#region src/components/FormPages/FormPageHeader.tsx
8774
+ // src/components/FormPages/FormPageHeader.tsx
8703
8775
  /** Form page header. */
8704
8776
  function FormPageHeader(t0) {
8705
8777
  const $ = c(70);
@@ -8945,8 +9017,7 @@ function _temp2$26(state_2) {
8945
9017
  function _temp$29(state_1) {
8946
9018
  return state_1?.schema;
8947
9019
  }
8948
- //#endregion
8949
- //#region src/components/FormPages/FormPage.tsx
9020
+ // src/components/FormPages/FormPage.tsx
8950
9021
  /** Component representing a single form page. */
8951
9022
  function FormPage(t0) {
8952
9023
  const $ = c(97);
@@ -9300,8 +9371,7 @@ function _temp2$25(state_1) {
9300
9371
  function _temp$28(state) {
9301
9372
  return state.activePage;
9302
9373
  }
9303
- //#endregion
9304
- //#region src/components/FormPages/FormPageRegistrar.tsx
9374
+ // src/components/FormPages/FormPageRegistrar.tsx
9305
9375
  /** Component used to register a form page. */
9306
9376
  function FormPageRegistrar(t0) {
9307
9377
  const $ = c(33);
@@ -9456,8 +9526,7 @@ function _temp$27(t0) {
9456
9526
  const { path: path_0 } = t0;
9457
9527
  return path_0;
9458
9528
  }
9459
- //#endregion
9460
- //#region src/components/FormPages/FormPages.tsx
9529
+ // src/components/FormPages/FormPages.tsx
9461
9530
  /**
9462
9531
  * The form pages component can be used to split parts of a form into separate pages, while
9463
9532
  * providing means of navigating between them. Although not strictly mandatory, each page is
@@ -9670,8 +9739,7 @@ function _temp2$23(frag_0) {
9670
9739
  function _temp$26(frag) {
9671
9740
  return !(frag instanceof AbsolutePathFragment.Id);
9672
9741
  }
9673
- //#endregion
9674
- //#region src/components/FormPages/FormPagesSelectOption.tsx
9742
+ // src/components/FormPages/FormPagesSelectOption.tsx
9675
9743
  function FormPagesSelectOption(t0) {
9676
9744
  const $ = c(37);
9677
9745
  const { path } = t0;
@@ -9801,8 +9869,7 @@ function _temp2$22(state_0) {
9801
9869
  function _temp$25(state) {
9802
9870
  return !state?.exists;
9803
9871
  }
9804
- //#endregion
9805
- //#region src/components/FormPages/FormPagesSelect.tsx
9872
+ // src/components/FormPages/FormPagesSelect.tsx
9806
9873
  /** Select component allowing the navigation between form pages. */
9807
9874
  function FormPagesSelect(t0) {
9808
9875
  const $ = c(63);
@@ -10010,8 +10077,7 @@ function _temp2$21(state_0) {
10010
10077
  function _temp$24(state) {
10011
10078
  return state.activePage;
10012
10079
  }
10013
- //#endregion
10014
- //#region src/components/FormPages/FormPageSidebarItem.tsx
10080
+ // src/components/FormPages/FormPageSidebarItem.tsx
10015
10081
  function FormPageSidebarItem(t0) {
10016
10082
  const $ = c(66);
10017
10083
  const { path } = t0;
@@ -10233,8 +10299,7 @@ function _temp2$20(state_0) {
10233
10299
  function _temp$23(state) {
10234
10300
  return state.activePage;
10235
10301
  }
10236
- //#endregion
10237
- //#region src/components/FormPages/FormPagesSidebar.tsx
10302
+ // src/components/FormPages/FormPagesSidebar.tsx
10238
10303
  /** Sidebar component allowing the navigation between form pages. */
10239
10304
  function FormPagesSidebar(t0) {
10240
10305
  const $ = c(22);
@@ -10321,8 +10386,7 @@ function _temp2$19(state_0) {
10321
10386
  function _temp$22(state) {
10322
10387
  return state.activePage;
10323
10388
  }
10324
- //#endregion
10325
- //#region src/components/FormPages/FormPagesNavigation.tsx
10389
+ // src/components/FormPages/FormPagesNavigation.tsx
10326
10390
  /**
10327
10391
  * Component allowing navigation between form pages. Renders as a sidebar in large screens and as a
10328
10392
  * select for smaller ones.
@@ -10408,8 +10472,7 @@ function FormPagesNavigation(t0) {
10408
10472
  } else t6 = $[24];
10409
10473
  return t6;
10410
10474
  }
10411
- //#endregion
10412
- //#region src/components/FormStepper/FormStepperContext.ts
10475
+ // src/components/FormStepper/FormStepperContext.ts
10413
10476
  /** Form stepper context. */
10414
10477
  var FormStepperContext = createContext(null);
10415
10478
  /** Hook used to create the form stepper context. */
@@ -10588,8 +10651,7 @@ function useFormStepState(path, selector) {
10588
10651
  } else t0 = $[2];
10589
10652
  return useStore(useFormStepperContext(), t0);
10590
10653
  }
10591
- //#endregion
10592
- //#region src/components/FormStepper/FormStep.tsx
10654
+ // src/components/FormStepper/FormStep.tsx
10593
10655
  /** Single form step. */
10594
10656
  function FormStep(t0) {
10595
10657
  const $ = c(21);
@@ -10690,8 +10752,7 @@ function _temp$20(controller) {
10690
10752
  }
10691
10753
  /** @deprecated Use `FormStep` instead. */
10692
10754
  var FormStepContent = FormStep;
10693
- //#endregion
10694
- //#region src/components/FormStepper/FormStepButton.tsx
10755
+ // src/components/FormStepper/FormStepButton.tsx
10695
10756
  /** Form step button. */
10696
10757
  function FormStepButton(t0) {
10697
10758
  const $ = c(13);
@@ -10749,8 +10810,7 @@ function _temp2$16(state_0) {
10749
10810
  function _temp$19(state) {
10750
10811
  return state?.deferredDisplayStatus;
10751
10812
  }
10752
- //#endregion
10753
- //#region src/components/FormStepper/FormStepList.tsx
10813
+ // src/components/FormStepper/FormStepList.tsx
10754
10814
  /** Component displaying all form steps in a list. */
10755
10815
  function FormStepList(t0) {
10756
10816
  const $ = c(12);
@@ -10803,8 +10863,7 @@ function _temp2$15(step) {
10803
10863
  function _temp$18(state) {
10804
10864
  return state.steps;
10805
10865
  }
10806
- //#endregion
10807
- //#region src/components/FormStepper/FormStepRegistrar.tsx
10866
+ // src/components/FormStepper/FormStepRegistrar.tsx
10808
10867
  /** Component used to register a form step. */
10809
10868
  function FormStepRegistrar(t0) {
10810
10869
  const $ = c(30);
@@ -10938,8 +10997,7 @@ function _temp$17(t0) {
10938
10997
  const { path: path_0 } = t0;
10939
10998
  return path_0;
10940
10999
  }
10941
- //#endregion
10942
- //#region src/components/FormStepper/FormStepper.tsx
11000
+ // src/components/FormStepper/FormStepper.tsx
10943
11001
  /**
10944
11002
  * The form stepper component can be used to split parts of a form into separate steps. It is built
10945
11003
  * on top of the [`Stepper`](/docs/ostack-ui-disclosure-stepper--docs) component. Although not
@@ -11138,20 +11196,16 @@ function _temp2$13(frag_0) {
11138
11196
  function _temp$16(frag) {
11139
11197
  return !(frag instanceof AbsolutePathFragment.Id);
11140
11198
  }
11141
- //#endregion
11142
- //#region src/components/FormStepper/FormStepperFinishTrigger.tsx
11199
+ // src/components/FormStepper/FormStepperFinishTrigger.tsx
11143
11200
  /** Trigger used to conclude the form stepper. */
11144
11201
  var FormStepperFinishTrigger = StepperFinishTrigger;
11145
- //#endregion
11146
- //#region src/components/FormStepper/FormStepperNextTrigger.tsx
11202
+ // src/components/FormStepper/FormStepperNextTrigger.tsx
11147
11203
  /** Trigger used to go to the next step of the form stepper. */
11148
11204
  var FormStepperNextTrigger = StepperNextTrigger;
11149
- //#endregion
11150
- //#region src/components/FormStepper/FormStepperPreviousTrigger.tsx
11205
+ // src/components/FormStepper/FormStepperPreviousTrigger.tsx
11151
11206
  /** Trigger used to go to the previous step of the form stepper. */
11152
11207
  var FormStepperPreviousTrigger = StepperPreviousTrigger;
11153
- //#endregion
11154
- //#region src/components/IssuesAlert/IssuesAlert.tsx
11208
+ // src/components/IssuesAlert/IssuesAlert.tsx
11155
11209
  /** Component used to display an issue alert. */
11156
11210
  function IssuesAlert(t0) {
11157
11211
  const $ = c(62);
@@ -11339,8 +11393,7 @@ function _temp2$12(issue) {
11339
11393
  function _temp$15(info_0) {
11340
11394
  return info_0.issues;
11341
11395
  }
11342
- //#endregion
11343
- //#region src/utils/useFormValidator.ts
11396
+ // src/utils/useFormValidator.ts
11344
11397
  /** Hook exposing a function used to validate the form. */
11345
11398
  function useFormValidator(t0) {
11346
11399
  const $ = c(7);
@@ -11357,14 +11410,10 @@ function useFormValidator(t0) {
11357
11410
  if ($[2] !== _setState || $[3] !== onAfterValidate || $[4] !== onBeforeValidate || $[5] !== startIssuesNavigation) {
11358
11411
  const validate = async () => {
11359
11412
  _setState({ validating: true });
11360
- let beforeValidateResult;
11361
11413
  await withCleanup(async () => {
11362
- beforeValidateResult = await onBeforeValidate?.();
11363
- if (beforeValidateResult === false) return;
11364
- await startIssuesNavigation();
11365
- }, () => withCleanup(async () => {
11366
- if (beforeValidateResult !== false) await onAfterValidate?.();
11367
- }, () => _setState({ validating: false })));
11414
+ if (await onBeforeValidate?.() === false) return;
11415
+ await withCleanup(() => startIssuesNavigation(), () => onAfterValidate?.());
11416
+ }, () => _setState({ validating: false }));
11368
11417
  };
11369
11418
  t2 = { validate };
11370
11419
  $[2] = _setState;
@@ -11402,8 +11451,7 @@ function _temp$14(t0) {
11402
11451
  const { autoValidationStatus } = t0;
11403
11452
  return autoValidationStatus === "activeRunning";
11404
11453
  }
11405
- //#endregion
11406
- //#region src/components/IssuesPanel/IssuesPanelControls.tsx
11454
+ // src/components/IssuesPanel/IssuesPanelControls.tsx
11407
11455
  /** Controls of the issues panel. */
11408
11456
  function IssuesPanelControls(t0) {
11409
11457
  const $ = c(91);
@@ -11731,8 +11779,7 @@ function _temp$13(t0) {
11731
11779
  const { initialized } = t0;
11732
11780
  return initialized;
11733
11781
  }
11734
- //#endregion
11735
- //#region src/components/IssuesPanel/IssuesPanelMessagesCard.tsx
11782
+ // src/components/IssuesPanel/IssuesPanelMessagesCard.tsx
11736
11783
  function IssuesPanelMessagesCard(t0) {
11737
11784
  const $ = c(90);
11738
11785
  let bodyProps;
@@ -12059,8 +12106,7 @@ function Breadcrumb() {
12059
12106
  } else t0 = $[2];
12060
12107
  return t0;
12061
12108
  }
12062
- //#endregion
12063
- //#region src/components/IssuesPanel/IssuesPanelSummaryCard.tsx
12109
+ // src/components/IssuesPanel/IssuesPanelSummaryCard.tsx
12064
12110
  function IssuesPanelSummaryCard(t0) {
12065
12111
  const $ = c(49);
12066
12112
  let className;
@@ -12211,8 +12257,7 @@ function IssuesPanelSummaryCard(t0) {
12211
12257
  } else t8 = $[48];
12212
12258
  return t8;
12213
12259
  }
12214
- //#endregion
12215
- //#region src/components/IssuesPanel/IssuesPanel.tsx
12260
+ // src/components/IssuesPanel/IssuesPanel.tsx
12216
12261
  /** Default “focus” keybinds. */
12217
12262
  var DEFAULT_FOCUS_KEYBINDS = "Alt+Shift+F";
12218
12263
  /** Default “previous issue” keybinds. */
@@ -12800,13 +12845,12 @@ function mostRelevantIssuePath(info, latestInteraction, formSchema, issuesOrderC
12800
12845
  }
12801
12846
  return info[0].path;
12802
12847
  }
12803
- //#endregion
12804
- //#region src/components/LoadAction/LoadAction.tsx
12848
+ // src/components/LoadAction/LoadAction.tsx
12805
12849
  /** Default “load” keybinds. */
12806
12850
  var DEFAULT_LOAD_KEYBINDS = "$mod+O";
12807
12851
  /**
12808
- * Form action used to load the form from a file. Built on top of the [`Button`
12809
- * component](/docs/ostack-ui-forms-button--docs) and `useFormLoader` hook.
12852
+ * Form [action](/docs/ostack-ui-layout-actions--docs) used to load the form from a file. Built on
12853
+ * top of the `useFormLoader` hook.
12810
12854
  *
12811
12855
  * Example usage:
12812
12856
  *
@@ -13004,8 +13048,7 @@ function LoadAction(t0) {
13004
13048
  } else t8 = $[56];
13005
13049
  return t8;
13006
13050
  }
13007
- //#endregion
13008
- //#region src/components/NumericControl/NumericControl.tsx
13051
+ // src/components/NumericControl/NumericControl.tsx
13009
13052
  /** Kotlin integer types. */
13010
13053
  var INTEGER_TYPES = [
13011
13054
  "Byte",
@@ -13452,8 +13495,7 @@ function _temp$11(t0) {
13452
13495
  const { schema } = t0;
13453
13496
  return schema;
13454
13497
  }
13455
- //#endregion
13456
- //#region src/components/PathLink/PathLink.tsx
13498
+ // src/components/PathLink/PathLink.tsx
13457
13499
  /**
13458
13500
  * The path link component creates a link (although typically rendered as a `<button>`) to a part of
13459
13501
  * the form identified by the provided path. It is built on top of the [`Link`
@@ -13536,14 +13578,12 @@ function PathLink(t0) {
13536
13578
  } else t7 = $[15];
13537
13579
  return t7;
13538
13580
  }
13539
- //#endregion
13540
- //#region src/components/PrintAction/PrintAction.tsx
13581
+ // src/components/PrintAction/PrintAction.tsx
13541
13582
  /** Default “print” keybinds. */
13542
13583
  var DEFAULT_PRINT_KEYBINDS = "$mod+P";
13543
13584
  /**
13544
- * Form action used to print the form application. Built on top of the
13545
- * [`Button`](/docs/ostack-ui-forms-button--docs) and
13546
- * [`PrinterTrigger`](/docs/ostack-ui-utilities-printer--docs) components.
13585
+ * Form [action](/docs/ostack-ui-layout-actions--docs) used to print the form application. Built on
13586
+ * top of the [`PrinterTrigger`](/docs/ostack-ui-utilities-printer--docs) component.
13547
13587
  *
13548
13588
  * To print a whole form application, requires the `<FormApp>` component to be wrapped within a
13549
13589
  * `<Printer>`, and for the `<PrinterContent>` to wrap all annexes, pages, and form controls.
@@ -13688,8 +13728,7 @@ function PrintAction(t0) {
13688
13728
  } else t7 = $[27];
13689
13729
  return t7;
13690
13730
  }
13691
- //#endregion
13692
- //#region src/components/RadioGroupControl/RadioGroupControlItem.tsx
13731
+ // src/components/RadioGroupControl/RadioGroupControlItem.tsx
13693
13732
  /**
13694
13733
  * Definition of a radio group control item.
13695
13734
  *
@@ -13699,8 +13738,7 @@ function PrintAction(t0) {
13699
13738
  function RadioGroupControlItem(_props) {
13700
13739
  return null;
13701
13740
  }
13702
- //#endregion
13703
- //#region src/components/RadioGroupControl/RadioGroupControl.tsx
13741
+ // src/components/RadioGroupControl/RadioGroupControl.tsx
13704
13742
  /**
13705
13743
  * The radio group control component is a KForm form control for values with any type of (typically
13706
13744
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
@@ -14144,8 +14182,7 @@ function _temp$10(t0) {
14144
14182
  ...otherProps_0
14145
14183
  };
14146
14184
  }
14147
- //#endregion
14148
- //#region src/utils/useFormSaver.tsx
14185
+ // src/utils/useFormSaver.tsx
14149
14186
  /** Hook exposing functions used to save the form to a file. */
14150
14187
  function useFormSaver(t0) {
14151
14188
  const $ = c(29);
@@ -14169,9 +14206,9 @@ function useFormSaver(t0) {
14169
14206
  } else t2 = $[3];
14170
14207
  const defaultId = t2;
14171
14208
  let t3;
14172
- if ($[4] !== _setState || $[5] !== addToast || $[6] !== defaultId || $[7] !== formManager || $[8] !== formTitle || $[9] !== getState || $[10] !== locale || $[11] !== onAfterSave || $[12] !== onBeforeSave) {
14209
+ if ($[4] !== _setState || $[5] !== addToast || $[6] !== defaultId || $[7] !== formManager || $[8] !== formTitle || $[9] !== getState || $[10] !== locale) {
14173
14210
  t3 = async function save(t4) {
14174
- const { overwrite: overwrite_0, path: t5, encode: encode_0, fileName: fileName_0, extensions: extensions_0, description: description_0, mimeTypes: mimeTypes_0, startIn: startIn_0, excludeAcceptAllOption: excludeAcceptAllOption_0, id: t6, setPristineOnSave: t7, successMessage: successMessageProp, errorMessage: errorMessageProp } = t4;
14211
+ const { overwrite: overwrite_0, path: t5, encode: encode_0, fileName: fileName_0, extensions: extensions_0, description: description_0, mimeTypes: mimeTypes_0, startIn: startIn_0, excludeAcceptAllOption: excludeAcceptAllOption_0, id: t6, onBeforeSave: onBeforeSave_0, onAfterSave: onAfterSave_0, setPristineOnSave: t7, successMessage: successMessageProp, errorMessage: errorMessageProp } = t4;
14175
14212
  const path_0 = t5 === void 0 ? AbsolutePath.ROOT : t5;
14176
14213
  const id_0 = t6 === void 0 ? defaultId : t6;
14177
14214
  const setPristineOnSave_0 = t7 === void 0 ? true : t7;
@@ -14179,14 +14216,17 @@ function useFormSaver(t0) {
14179
14216
  const successMessage_0 = successMessageProp ?? locale.SaveAction.successMessage;
14180
14217
  const errorMessage_0 = errorMessageProp ?? locale.SaveAction.errorMessage;
14181
14218
  _setState({ saving: true });
14182
- let fileHandle = getState().latestFileHandles?.[id_0] ?? null;
14183
- let beforeSaveResult;
14219
+ const previousFileHandle = getState().latestFileHandles?.[id_0] ?? null;
14220
+ const saveState = {
14221
+ fileHandle: previousFileHandle,
14222
+ started: false
14223
+ };
14184
14224
  await withCleanup(async () => {
14185
14225
  try {
14186
- beforeSaveResult = await onBeforeSave?.();
14187
- if (beforeSaveResult === false) return;
14188
- const [encodedForm, suggestedFileName] = await formManager.get(path_0, (value) => Promise.all([encode_0(value), fileHandle ? fileHandle.name : typeof fileName_0 === "function" ? fileName_0(value) : fileName_0]));
14189
- fileHandle = await fileSave(typeof encodedForm === "string" ? new Blob([encodedForm], { type: mimeTypes_0?.[0] }) : encodedForm, {
14226
+ if (await onBeforeSave_0?.() === false) return;
14227
+ saveState.started = true;
14228
+ const [encodedForm, suggestedFileName] = await formManager.get(path_0, (value) => Promise.all([encode_0(value), previousFileHandle ? previousFileHandle.name : typeof fileName_0 === "function" ? fileName_0(value) : fileName_0]));
14229
+ const savedFileHandle = saveState.fileHandle = await fileSave(typeof encodedForm === "string" ? new Blob([encodedForm], { type: mimeTypes_0?.[0] }) : encodedForm, {
14190
14230
  fileName: suggestedFileName || defaultFileName(formTitle, extensions_0?.[0]),
14191
14231
  extensions: extensions_0,
14192
14232
  description: description_0,
@@ -14194,25 +14234,25 @@ function useFormSaver(t0) {
14194
14234
  startIn: startIn_0,
14195
14235
  excludeAcceptAllOption: excludeAcceptAllOption_0,
14196
14236
  id: id_0
14197
- }, overwrite_0 ? fileHandle : null);
14237
+ }, overwrite_0 ? previousFileHandle : null);
14198
14238
  if (setPristineOnSave_0) await formManager.setPristine(path_0);
14199
14239
  _setState((state) => ({ latestFileHandles: {
14200
14240
  ...state.latestFileHandles,
14201
- [id_0]: fileHandle
14241
+ [id_0]: savedFileHandle
14202
14242
  } }));
14203
14243
  if (supported) {
14204
- const message_0 = typeof successMessage_0 == "function" ? successMessage_0(fileHandle) : successMessage_0;
14244
+ const message_0 = typeof successMessage_0 == "function" ? successMessage_0(savedFileHandle) : successMessage_0;
14205
14245
  if (message_0 != null) addToast(message_0, { severity: "success" });
14206
14246
  }
14207
14247
  } catch (t8) {
14208
14248
  const error = t8;
14209
14249
  if (error instanceof DOMException && error.name === "AbortError") return;
14210
14250
  if (DEV) console.error(error);
14211
- const message = typeof errorMessage_0 == "function" ? errorMessage_0(fileHandle, error) : errorMessage_0;
14251
+ const message = typeof errorMessage_0 == "function" ? errorMessage_0(saveState.fileHandle, error) : errorMessage_0;
14212
14252
  if (message != null) addToast(message, { severity: "danger" });
14213
14253
  }
14214
14254
  }, () => withCleanup(async () => {
14215
- if (beforeSaveResult !== false) await onAfterSave?.();
14255
+ if (saveState.started) await onAfterSave_0?.();
14216
14256
  }, () => _setState({ saving: false })));
14217
14257
  };
14218
14258
  $[4] = _setState;
@@ -14222,13 +14262,11 @@ function useFormSaver(t0) {
14222
14262
  $[8] = formTitle;
14223
14263
  $[9] = getState;
14224
14264
  $[10] = locale;
14225
- $[11] = onAfterSave;
14226
- $[12] = onBeforeSave;
14227
- $[13] = t3;
14228
- } else t3 = $[13];
14265
+ $[11] = t3;
14266
+ } else t3 = $[11];
14229
14267
  const save = t3;
14230
14268
  let t4;
14231
- if ($[14] !== description || $[15] !== encode || $[16] !== errorMessage || $[17] !== excludeAcceptAllOption || $[18] !== extensions || $[19] !== fileName || $[20] !== id || $[21] !== mimeTypes || $[22] !== overwrite || $[23] !== path || $[24] !== save || $[25] !== setPristineOnSave || $[26] !== startIn || $[27] !== successMessage) {
14269
+ if ($[12] !== description || $[13] !== encode || $[14] !== errorMessage || $[15] !== excludeAcceptAllOption || $[16] !== extensions || $[17] !== fileName || $[18] !== id || $[19] !== mimeTypes || $[20] !== onAfterSave || $[21] !== onBeforeSave || $[22] !== overwrite || $[23] !== path || $[24] !== save || $[25] !== setPristineOnSave || $[26] !== startIn || $[27] !== successMessage) {
14232
14270
  t4 = {
14233
14271
  save: (t5) => {
14234
14272
  return save({
@@ -14242,6 +14280,8 @@ function useFormSaver(t0) {
14242
14280
  startIn,
14243
14281
  excludeAcceptAllOption,
14244
14282
  id,
14283
+ onBeforeSave,
14284
+ onAfterSave,
14245
14285
  setPristineOnSave,
14246
14286
  successMessage,
14247
14287
  errorMessage,
@@ -14250,14 +14290,16 @@ function useFormSaver(t0) {
14250
14290
  },
14251
14291
  supportsFileSystemAPIs: supported
14252
14292
  };
14253
- $[14] = description;
14254
- $[15] = encode;
14255
- $[16] = errorMessage;
14256
- $[17] = excludeAcceptAllOption;
14257
- $[18] = extensions;
14258
- $[19] = fileName;
14259
- $[20] = id;
14260
- $[21] = mimeTypes;
14293
+ $[12] = description;
14294
+ $[13] = encode;
14295
+ $[14] = errorMessage;
14296
+ $[15] = excludeAcceptAllOption;
14297
+ $[16] = extensions;
14298
+ $[17] = fileName;
14299
+ $[18] = id;
14300
+ $[19] = mimeTypes;
14301
+ $[20] = onAfterSave;
14302
+ $[21] = onBeforeSave;
14261
14303
  $[22] = overwrite;
14262
14304
  $[23] = path;
14263
14305
  $[24] = save;
@@ -14279,19 +14321,15 @@ function _temp$9(state) {
14279
14321
  function defaultFileName(formTitle, extension) {
14280
14322
  return [[formTitle, formatISO(/* @__PURE__ */ new Date(), { representation: "date" })].filter(Boolean).join(" "), extension].filter(Boolean).join("");
14281
14323
  }
14282
- //#endregion
14283
- //#region src/components/SaveAction/SaveAction.tsx
14324
+ // src/components/SaveAction/SaveAction.tsx
14284
14325
  /** Default “save” keybinds. */
14285
14326
  var DEFAULT_SAVE_KEYBINDS = "$mod+S";
14286
14327
  /** Default “save as” keybinds. */
14287
14328
  var DEFAULT_SAVE_AS_KEYBINDS = "$mod+Shift+S";
14288
14329
  /**
14289
- * Form action used to save the form to a file, supporting both overwriting and non-overwriting
14290
- * behaviours (i.e. supporting both “save” and “save as”). Built on top of the
14291
- * [`ButtonGroup`](/docs/ostack-ui-layout-button-group--docs),
14292
- * [`Button`](/docs/ostack-ui-forms-button--docs), and
14293
- * [`DropdownMenu`](/docs/ostack-ui-overlay-dropdown-menu--docs) components, as well as the
14294
- * `useFormSaver` hook.
14330
+ * Form [action](/docs/ostack-ui-layout-actions--docs) used to save the form to a file, supporting
14331
+ * both overwriting and non-overwriting behaviours (i.e. supporting both “save” and “save as”).
14332
+ * Built on top of the `useFormSaver` hook.
14295
14333
  *
14296
14334
  * Example usage:
14297
14335
  *
@@ -14622,8 +14660,7 @@ function SaveAction(t0) {
14622
14660
  } else t14 = $[103];
14623
14661
  return t14;
14624
14662
  }
14625
- //#endregion
14626
- //#region src/components/SelectControl/SelectControlItem.tsx
14663
+ // src/components/SelectControl/SelectControlItem.tsx
14627
14664
  /**
14628
14665
  * Definition of a select control item.
14629
14666
  *
@@ -14633,8 +14670,7 @@ function SaveAction(t0) {
14633
14670
  function SelectControlItem(_props) {
14634
14671
  return null;
14635
14672
  }
14636
- //#endregion
14637
- //#region src/components/SelectControl/SelectControlItemGroup.tsx
14673
+ // src/components/SelectControl/SelectControlItemGroup.tsx
14638
14674
  /**
14639
14675
  * Definition of a select control item group.
14640
14676
  *
@@ -14644,8 +14680,7 @@ function SelectControlItem(_props) {
14644
14680
  function SelectControlItemGroup(_props) {
14645
14681
  return null;
14646
14682
  }
14647
- //#endregion
14648
- //#region src/components/SelectControl/SelectControl.tsx
14683
+ // src/components/SelectControl/SelectControl.tsx
14649
14684
  /**
14650
14685
  * The select control component is a KForm form control for values with any type of (typically
14651
14686
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
@@ -15058,8 +15093,7 @@ function _temp$8(t0) {
15058
15093
  ...otherProps_0
15059
15094
  };
15060
15095
  }
15061
- //#endregion
15062
- //#region src/components/SelectMultipleControl/SelectMultipleControlItem.tsx
15096
+ // src/components/SelectMultipleControl/SelectMultipleControlItem.tsx
15063
15097
  /**
15064
15098
  * Definition of a select multiple control item.
15065
15099
  *
@@ -15069,8 +15103,7 @@ function _temp$8(t0) {
15069
15103
  function SelectMultipleControlItem(_props) {
15070
15104
  return null;
15071
15105
  }
15072
- //#endregion
15073
- //#region src/components/SelectMultipleControl/SelectMultipleControlItemGroup.tsx
15106
+ // src/components/SelectMultipleControl/SelectMultipleControlItemGroup.tsx
15074
15107
  /**
15075
15108
  * Definition of a select multiple control item group.
15076
15109
  *
@@ -15081,8 +15114,7 @@ function SelectMultipleControlItem(_props) {
15081
15114
  function SelectMultipleControlItemGroup(_props) {
15082
15115
  return null;
15083
15116
  }
15084
- //#endregion
15085
- //#region src/components/SelectMultipleControl/SelectMultipleControl.tsx
15117
+ // src/components/SelectMultipleControl/SelectMultipleControl.tsx
15086
15118
  /**
15087
15119
  * The select multiple control component is a KForm form control for values with (possibly
15088
15120
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
@@ -15503,15 +15535,14 @@ function _temp$7(t0) {
15503
15535
  ...otherProps_0
15504
15536
  };
15505
15537
  }
15506
- //#endregion
15507
- //#region src/components/SubmitAction/SubmitAction.tsx
15538
+ // src/components/SubmitAction/SubmitAction.tsx
15508
15539
  /** Default “submit” keybinds. */
15509
15540
  var DEFAULT_SUBMIT_KEYBINDS = "$mod+Enter";
15510
15541
  /**
15511
- * Form action used to submit a form, supporting all submission-related properties available in a
15542
+ * Form [action](/docs/ostack-ui-layout-actions--docs) used to submit a form, supporting all
15543
+ * submission-related properties available in a
15512
15544
  * [`FormApp`](/docs/ostack-ui-kform-layout-form-app--docs). Built on top of the
15513
- * [Button](/docs/ostack-ui-forms-button--docs) and
15514
- * [AlertDialog](/docs/ostack-ui-overlay-alert-dialog--docs) components.
15545
+ * [AlertDialog](/docs/ostack-ui-overlay-alert-dialog--docs) component.
15515
15546
  *
15516
15547
  * Example usage:
15517
15548
  *
@@ -15995,8 +16026,7 @@ function SubmitAction(t0) {
15995
16026
  } else t20 = $[118];
15996
16027
  return t20;
15997
16028
  }
15998
- //#endregion
15999
- //#region src/components/TableControl/TableControlContext.ts
16029
+ // src/components/TableControl/TableControlContext.ts
16000
16030
  /** Table control context. */
16001
16031
  var TableControlContext = createContext(null);
16002
16032
  /** Hook providing access to the table control context. */
@@ -16013,8 +16043,7 @@ function useTableControlRowContext() {
16013
16043
  if (!tableControlRowContext) throw new Error("Table control row context not in scope.");
16014
16044
  return tableControlRowContext;
16015
16045
  }
16016
- //#endregion
16017
- //#region src/components/TableControl/TableControlCell.tsx
16046
+ // src/components/TableControl/TableControlCell.tsx
16018
16047
  /** Cell of the table control. */
16019
16048
  function TableControlCell(t0) {
16020
16049
  const $ = c(11);
@@ -16058,8 +16087,7 @@ function _temp$6(t0) {
16058
16087
  const { displayStatus } = t0;
16059
16088
  return displayStatus;
16060
16089
  }
16061
- //#endregion
16062
- //#region src/components/TableControl/TableControlColumn.tsx
16090
+ // src/components/TableControl/TableControlColumn.tsx
16063
16091
  /**
16064
16092
  * Definition of a table control column.
16065
16093
  *
@@ -16069,8 +16097,7 @@ function _temp$6(t0) {
16069
16097
  function TableControlColumn(_props) {
16070
16098
  return null;
16071
16099
  }
16072
- //#endregion
16073
- //#region src/components/TableControl/TableControlColumnGroup.tsx
16100
+ // src/components/TableControl/TableControlColumnGroup.tsx
16074
16101
  /**
16075
16102
  * Definition of a table control column group.
16076
16103
  *
@@ -16080,8 +16107,7 @@ function TableControlColumn(_props) {
16080
16107
  function TableControlColumnGroup(_props) {
16081
16108
  return null;
16082
16109
  }
16083
- //#endregion
16084
- //#region src/components/TableControl/TableControlColumns.tsx
16110
+ // src/components/TableControl/TableControlColumns.tsx
16085
16111
  /**
16086
16112
  * Container for the definition of all table control columns. This component must be a direct child
16087
16113
  * of the `TableControl` component.
@@ -16092,8 +16118,7 @@ function TableControlColumnGroup(_props) {
16092
16118
  function TableControlColumns(_props) {
16093
16119
  return null;
16094
16120
  }
16095
- //#endregion
16096
- //#region src/components/TableControl/TableControlRow.tsx
16121
+ // src/components/TableControl/TableControlRow.tsx
16097
16122
  /** Row of a table control. */
16098
16123
  function TableControlRow(t0) {
16099
16124
  const $ = c(27);
@@ -16206,8 +16231,7 @@ function _temp$5(t0) {
16206
16231
  const { path } = t0;
16207
16232
  return path;
16208
16233
  }
16209
- //#endregion
16210
- //#region src/components/TableControl/TableControl.tsx
16234
+ // src/components/TableControl/TableControl.tsx
16211
16235
  /**
16212
16236
  * The table control component is a KForm form control for values with (possibly
16213
16237
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
@@ -16786,22 +16810,19 @@ function TableControlCellRenderer(t0) {
16786
16810
  } else t2 = $[2];
16787
16811
  return t2;
16788
16812
  }
16789
- //#endregion
16790
- //#region src/components/TableControl/TableControlActionsColumnLabel.tsx
16813
+ // src/components/TableControl/TableControlActionsColumnLabel.tsx
16791
16814
  /** Default label of the table control's actions column. */
16792
16815
  function TableControlActionsColumnLabel() {
16793
16816
  const [locale] = useLocale();
16794
16817
  return locale.TableControlActionsColumn.label;
16795
16818
  }
16796
- //#endregion
16797
- //#region src/components/TableControl/TableControlIndexColumnLabel.tsx
16819
+ // src/components/TableControl/TableControlIndexColumnLabel.tsx
16798
16820
  /** Default label of the table control's index column. */
16799
16821
  function TableControlIndexColumnLabel() {
16800
16822
  const [locale] = useLocale();
16801
16823
  return locale.TableControlIndexColumn.label ?? "#";
16802
16824
  }
16803
- //#endregion
16804
- //#region src/components/TableControl/TableControlRemoveRowTrigger.tsx
16825
+ // src/components/TableControl/TableControlRemoveRowTrigger.tsx
16805
16826
  /**
16806
16827
  * Trigger used to remove a row of a table controlled by a table control.
16807
16828
  *
@@ -16955,8 +16976,7 @@ function _temp$3(t0) {
16955
16976
  const { initialized } = t0;
16956
16977
  return initialized;
16957
16978
  }
16958
- //#endregion
16959
- //#region src/components/TableControl/TableControlColumnFns.tsx
16979
+ // src/components/TableControl/TableControlColumnFns.tsx
16960
16980
  /**
16961
16981
  * Pre-configured column used to display the index of each row. By default, it sticks to left of the
16962
16982
  * table.
@@ -17035,8 +17055,7 @@ function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation,
17035
17055
  ...columnProps
17036
17056
  };
17037
17057
  }
17038
- //#endregion
17039
- //#region src/components/TableControl/TableControlActionsColumn.tsx
17058
+ // src/components/TableControl/TableControlActionsColumn.tsx
17040
17059
  /**
17041
17060
  * Pre-configured column used to display row actions. By default, it sticks to the right of the
17042
17061
  * table and renders the `TableControlRemoveRowTrigger` component.
@@ -17050,35 +17069,14 @@ function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation,
17050
17069
  * </TableControlActionsColumn>;
17051
17070
  * ```
17052
17071
  */
17053
- function TableControlActionsColumn(t0) {
17054
- const $ = c(6);
17055
- let T0;
17056
- let t1;
17057
- if ($[0] !== t0) {
17058
- const { render, children, ...otherProps } = t0;
17059
- T0 = TableControlColumn;
17060
- t1 = tableControlActionsColumn({
17061
- ...otherProps,
17062
- render: render ?? children
17063
- });
17064
- $[0] = t0;
17065
- $[1] = T0;
17066
- $[2] = t1;
17067
- } else {
17068
- T0 = $[1];
17069
- t1 = $[2];
17070
- }
17071
- let t2;
17072
- if ($[3] !== T0 || $[4] !== t1) {
17073
- t2 = /* @__PURE__ */ jsx(T0, { ...t1 });
17074
- $[3] = T0;
17075
- $[4] = t1;
17076
- $[5] = t2;
17077
- } else t2 = $[5];
17078
- return t2;
17079
- }
17080
- //#endregion
17081
- //#region src/components/TableControl/TableControlAddRowTrigger.tsx
17072
+ function TableControlActionsColumn({ render, children, ...otherProps }) {
17073
+ "use no memo";
17074
+ return /* @__PURE__ */ jsx(TableControlColumn, { ...tableControlActionsColumn({
17075
+ ...otherProps,
17076
+ render: render ?? children
17077
+ }) });
17078
+ }
17079
+ // src/components/TableControl/TableControlAddRowTrigger.tsx
17082
17080
  /** Trigger used to add a new row to a table control. */
17083
17081
  function TableControlAddRowTrigger(t0) {
17084
17082
  const $ = c(58);
@@ -17273,14 +17271,12 @@ function TableControlAddRowTrigger(t0) {
17273
17271
  function _temp$2(state) {
17274
17272
  return state.gettingRowValue;
17275
17273
  }
17276
- //#endregion
17277
- //#region src/components/TableControl/TableControlApi.ts
17274
+ // src/components/TableControl/TableControlApi.ts
17278
17275
  /** Hook used to access the table control API. */
17279
17276
  function useTableControlApiRef() {
17280
17277
  return useRef(null);
17281
17278
  }
17282
- //#endregion
17283
- //#region src/components/TableControl/TableControlContent.tsx
17279
+ // src/components/TableControl/TableControlContent.tsx
17284
17280
  /** Component containing the content of the table control. */
17285
17281
  function TableControlContent(t0) {
17286
17282
  const $ = c(33);
@@ -17403,49 +17399,25 @@ function _temp$1(t0) {
17403
17399
  const { path } = t0;
17404
17400
  return path;
17405
17401
  }
17406
- //#endregion
17407
- //#region src/components/TableControl/TableControlIndexColumn.tsx
17402
+ // src/components/TableControl/TableControlIndexColumn.tsx
17408
17403
  /**
17409
17404
  * Pre-configured column used to display the index of each row. By default, it sticks to left of the
17410
17405
  * table.
17411
17406
  */
17412
- function TableControlIndexColumn(t0) {
17413
- const $ = c(6);
17414
- let T0;
17415
- let t1;
17416
- if ($[0] !== t0) {
17417
- const { render, children, ...otherProps } = t0;
17418
- T0 = TableControlColumn;
17419
- t1 = tableControlIndexColumn({
17420
- ...otherProps,
17421
- render: render ?? children
17422
- });
17423
- $[0] = t0;
17424
- $[1] = T0;
17425
- $[2] = t1;
17426
- } else {
17427
- T0 = $[1];
17428
- t1 = $[2];
17429
- }
17430
- let t2;
17431
- if ($[3] !== T0 || $[4] !== t1) {
17432
- t2 = /* @__PURE__ */ jsx(T0, { ...t1 });
17433
- $[3] = T0;
17434
- $[4] = t1;
17435
- $[5] = t2;
17436
- } else t2 = $[5];
17437
- return t2;
17438
- }
17439
- //#endregion
17440
- //#region src/components/TableControl/TableControlPagination.tsx
17407
+ function TableControlIndexColumn({ render, children, ...otherProps }) {
17408
+ "use no memo";
17409
+ return /* @__PURE__ */ jsx(TableControlColumn, { ...tableControlIndexColumn({
17410
+ ...otherProps,
17411
+ render: render ?? children
17412
+ }) });
17413
+ }
17414
+ // src/components/TableControl/TableControlPagination.tsx
17441
17415
  /** Table control pagination. */
17442
17416
  var TableControlPagination = DataTablePagination;
17443
- //#endregion
17444
- //#region src/components/TableControl/TableControlRowsPerPage.tsx
17417
+ // src/components/TableControl/TableControlRowsPerPage.tsx
17445
17418
  /** Table control rows per page. */
17446
17419
  var TableControlRowsPerPage = DataTableRowsPerPage;
17447
- //#endregion
17448
- //#region src/components/TextControl/TextControl.tsx
17420
+ // src/components/TextControl/TextControl.tsx
17449
17421
  /**
17450
17422
  * The text control component is a KForm form control for values with (possibly
17451
17423
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
@@ -17821,13 +17793,12 @@ function _temp(t0) {
17821
17793
  function parseText(formattedValue, state) {
17822
17794
  return state.schema.typeInfo.nullable ? formattedValue || null : formattedValue;
17823
17795
  }
17824
- //#endregion
17825
- //#region src/components/ValidateAction/ValidateAction.tsx
17796
+ // src/components/ValidateAction/ValidateAction.tsx
17826
17797
  /** Default “validate” keybinds. */
17827
17798
  var DEFAULT_VALIDATE_KEYBINDS = "Alt+Shift+V";
17828
17799
  /**
17829
- * Form action used to validate the form. Built on top of the [`Button`
17830
- * component](/docs/ostack-ui-forms-button--docs) and `useFormValidator` hook.
17800
+ * Form [action](/docs/ostack-ui-layout-actions--docs) used to validate the form. Built on top of
17801
+ * the `useFormValidator` hook.
17831
17802
  *
17832
17803
  * If the form contains an `IssuesPanel` component, it is shown as a result of triggering the
17833
17804
  * action.
@@ -17954,7 +17925,6 @@ function ValidateAction(t0) {
17954
17925
  } else t6 = $[29];
17955
17926
  return t6;
17956
17927
  }
17957
- //#endregion
17958
- export { ActivePathContext, ActivePathProvider, Annex, AnnexRegistrar, Annexes, AnnexesManager, CheckboxControl, CheckboxGroupControl, CheckboxGroupControlItem, ControlField, DEFAULT_FIRST_ISSUE_KEYBINDS, DEFAULT_FOCUS_KEYBINDS, DEFAULT_LAST_ISSUE_KEYBINDS, DEFAULT_LOAD_KEYBINDS, DEFAULT_NEXT_ISSUE_KEYBINDS, DEFAULT_PREVIOUS_ISSUE_KEYBINDS, DEFAULT_PRINT_KEYBINDS, DEFAULT_SAVE_AS_KEYBINDS, DEFAULT_SAVE_KEYBINDS, DEFAULT_SUBMIT_KEYBINDS, DEFAULT_VALIDATE_KEYBINDS, DateControl, DateRangeControl, DebugInfo, DebugInfoControlAddonTrigger, FileControl, FormApp, FormAppIssueMessages, FormAppStatus, FormPage, FormPageRegistrar, FormPages, FormPagesNavigation, FormStep, FormStepContent, FormStepList, FormStepRegistrar, FormStepper, FormStepperFinishTrigger, FormStepperNextTrigger, FormStepperPreviousTrigger, IssueMessages, IssuesAlert, IssuesPanel, IssuesPopover, LoadAction, LocalizationContext, LocalizationProvider, NumericControl, PathLink, PrefixSuffixContext, PrefixSuffixProvider, PrintAction, RadioGroupControl, RadioGroupControlItem, RepetitiveAnnexRegistrar, ResetOnChange, SaveAction, SelectControl, SelectControlItem, SelectControlItemGroup, SelectMultipleControl, SelectMultipleControlItem, SelectMultipleControlItemGroup, SubmitAction, TableControl, TableControlActionsColumn, TableControlAddRowTrigger, TableControlCellRenderer, TableControlColumn, TableControlColumnGroup, TableControlColumns, TableControlContent, TableControlIndexColumn, TableControlPagination, TableControlRemoveRowTrigger, TableControlRowsPerPage, TextControl, TopBar, TopBarActions, TopBarActionsSecondary, ValidateAction, displayStatusToColor, displayStatusToControlStatus, setDefaultPrefixSuffix, tableControlActionsColumn, tableControlIndexColumn, useActiveIssuesPanelBreadcrumb, useActivePathContext, useControlIssues, useDisplayIssueCodesInIssueMessages, useFocus, useFormAppElement, useFormInDebugMode, useFormIsDisabled, useFormIsLoading, useFormIsPreparingLoad, useFormIsReadOnly, useFormIsSaving, useFormIsValidating, useFormLoader, useFormSaver, useFormTitle, useFormValidator, useIsRegistered, useIssuesDisplayMode, useLocale, useOnPathFocus, usePrefix, useRegisterControl, useRegisterController, useRegisterIssueMessages, useRegisterLabel, useRegisteredIssueMessage, useResetFocus, useResetOnChange, useResetOnChangeContext, useSetBottomPanelHeight, useSetLeftSidebarWidth, useSetTopBarHeight, useStartIssuesNavigation, useTableControlApiRef, useTopBarElement };
17928
+ export { ActivePathContext, ActivePathProvider, Annex, AnnexRegistrar, Annexes, AnnexesManager, ChangeLocaleAction, CheckboxControl, CheckboxGroupControl, CheckboxGroupControlItem, ControlField, DEFAULT_FIRST_ISSUE_KEYBINDS, DEFAULT_FOCUS_KEYBINDS, DEFAULT_LAST_ISSUE_KEYBINDS, DEFAULT_LOAD_KEYBINDS, DEFAULT_NEXT_ISSUE_KEYBINDS, DEFAULT_PREVIOUS_ISSUE_KEYBINDS, DEFAULT_PRINT_KEYBINDS, DEFAULT_SAVE_AS_KEYBINDS, DEFAULT_SAVE_KEYBINDS, DEFAULT_SUBMIT_KEYBINDS, DEFAULT_VALIDATE_KEYBINDS, DateControl, DateRangeControl, DebugInfo, DebugInfoControlAddonTrigger, FileControl, FormApp, FormAppIssueMessages, FormAppStatus, FormPage, FormPageRegistrar, FormPages, FormPagesNavigation, FormStep, FormStepContent, FormStepList, FormStepRegistrar, FormStepper, FormStepperFinishTrigger, FormStepperNextTrigger, FormStepperPreviousTrigger, IssueMessages, IssuesAlert, IssuesPanel, IssuesPopover, LoadAction, LocalizationContext, LocalizationProvider, NumericControl, PathLink, PrefixSuffixContext, PrefixSuffixProvider, PrintAction, RadioGroupControl, RadioGroupControlItem, RepetitiveAnnexRegistrar, ResetOnChange, SaveAction, SelectControl, SelectControlItem, SelectControlItemGroup, SelectMultipleControl, SelectMultipleControlItem, SelectMultipleControlItemGroup, SubmitAction, TableControl, TableControlActionsColumn, TableControlAddRowTrigger, TableControlCellRenderer, TableControlColumn, TableControlColumnGroup, TableControlColumns, TableControlContent, TableControlIndexColumn, TableControlPagination, TableControlRemoveRowTrigger, TableControlRowsPerPage, TextControl, TopBar, TopBarActions, TopBarActionsSecondary, ValidateAction, displayStatusToColor, displayStatusToControlStatus, setDefaultPrefixSuffix, tableControlActionsColumn, tableControlIndexColumn, useActiveIssuesPanelBreadcrumb, useActivePathContext, useControlIssues, useDisplayIssueCodesInIssueMessages, useFocus, useFormAppElement, useFormInDebugMode, useFormIsDisabled, useFormIsLoading, useFormIsPreparingLoad, useFormIsReadOnly, useFormIsSaving, useFormIsValidating, useFormLoader, useFormSaver, useFormTitle, useFormValidator, useIsRegistered, useIssuesDisplayMode, useLocale, useOnPathFocus, usePrefix, useRegisterControl, useRegisterController, useRegisterIssueMessages, useRegisterLabel, useRegisteredIssueMessage, useResetFocus, useResetOnChange, useResetOnChangeContext, useSetBottomPanelHeight, useSetLeftSidebarWidth, useSetTopBarHeight, useStartIssuesNavigation, useTableControlApiRef, useTopBarElement };
17959
17929
 
17960
17930
  //# sourceMappingURL=ostack-ui-kform.js.map