@ostack.tech/ui-kform 1.2.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.
- package/dist/chunks/{en-BHlLXSzh.js → en-BalUyhAv.js} +3 -3
- package/dist/chunks/en-BalUyhAv.js.map +1 -0
- package/dist/locales/en-GB.js +2 -3
- package/dist/locales/en-GB.js.map +1 -1
- package/dist/locales/en-US.js +2 -3
- package/dist/locales/en-US.js.map +1 -1
- package/dist/locales/fr-FR.js +2 -2
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js +2 -2
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui-kform.css +1 -45
- package/dist/ostack-ui-kform.js +431 -468
- package/dist/ostack-ui-kform.js.map +1 -1
- package/package.json +2 -2
- package/scss/components/Annexes/_Annexes-variables.scss +7 -3
- package/scss/components/FormApp/_FormApp.scss +1 -1
- package/types/components/ChangeLocaleAction/ChangeLocaleAction.d.ts +63 -0
- package/types/components/ChangeLocaleAction/index.d.ts +1 -0
- package/types/components/LoadAction/LoadAction.d.ts +2 -2
- package/types/components/PrintAction/PrintAction.d.ts +2 -3
- package/types/components/SaveAction/SaveAction.d.ts +3 -6
- package/types/components/SubmitAction/SubmitAction.d.ts +3 -3
- package/types/components/ValidateAction/ValidateAction.d.ts +2 -2
- package/types/index.d.ts +1 -0
- package/types/providers/LocalizationProvider/LocalizationObject.d.ts +2 -0
- package/types/utils/useFormSaver.d.ts +1 -4
- package/dist/chunks/en-BHlLXSzh.js.map +0 -1
package/dist/ostack-ui-kform.js
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
144
|
-
//#region src/providers/LocalizationProvider/LocalizationContext.ts
|
|
138
|
+
// src/providers/LocalizationProvider/LocalizationContext.ts
|
|
145
139
|
/** Localisation context. */
|
|
146
140
|
var LocalizationContext = createContext(null);
|
|
147
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
1033
|
+
const $ = c(45);
|
|
1049
1034
|
let children;
|
|
1050
1035
|
let className;
|
|
1051
1036
|
let formAppElement;
|
|
@@ -1083,132 +1068,119 @@ function FormAppElement(t0) {
|
|
|
1083
1068
|
$[10] = t1;
|
|
1084
1069
|
} else t1 = $[10];
|
|
1085
1070
|
const { cssVarName } = useCssVars(t1);
|
|
1086
|
-
let t2;
|
|
1087
|
-
if ($[11] !== prefix) {
|
|
1088
|
-
t2 = { prefix };
|
|
1089
|
-
$[11] = prefix;
|
|
1090
|
-
$[12] = t2;
|
|
1091
|
-
} else t2 = $[12];
|
|
1092
|
-
const { responsiveValueToCssVarsAndDataAttrs } = useResponsiveValues(t2);
|
|
1093
1071
|
const { store } = useFormAppContext();
|
|
1094
1072
|
const formTitle = useFormTitle();
|
|
1073
|
+
let t2;
|
|
1095
1074
|
let t3;
|
|
1096
|
-
if ($[
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
$[14] = formAppElement?.style;
|
|
1100
|
-
$[15] = store;
|
|
1101
|
-
$[16] = t3;
|
|
1102
|
-
} else t3 = $[16];
|
|
1103
|
-
let t4;
|
|
1104
|
-
if ($[17] !== cssVarName || $[18] !== formAppElement || $[19] !== store) {
|
|
1105
|
-
t4 = [
|
|
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 });
|
|
1077
|
+
t3 = [
|
|
1106
1078
|
cssVarName,
|
|
1107
1079
|
formAppElement,
|
|
1108
1080
|
store
|
|
1109
1081
|
];
|
|
1110
|
-
$[
|
|
1111
|
-
$[
|
|
1112
|
-
$[
|
|
1113
|
-
$[
|
|
1114
|
-
|
|
1115
|
-
|
|
1082
|
+
$[11] = cssVarName;
|
|
1083
|
+
$[12] = formAppElement;
|
|
1084
|
+
$[13] = store;
|
|
1085
|
+
$[14] = t2;
|
|
1086
|
+
$[15] = t3;
|
|
1087
|
+
} else {
|
|
1088
|
+
t2 = $[14];
|
|
1089
|
+
t3 = $[15];
|
|
1090
|
+
}
|
|
1091
|
+
useEffect(t2, t3);
|
|
1092
|
+
let t4;
|
|
1116
1093
|
let t5;
|
|
1117
|
-
if ($[
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
$[22] = formAppElement?.style;
|
|
1121
|
-
$[23] = store;
|
|
1122
|
-
$[24] = t5;
|
|
1123
|
-
} else t5 = $[24];
|
|
1124
|
-
let t6;
|
|
1125
|
-
if ($[25] !== cssVarName || $[26] !== formAppElement || $[27] !== store) {
|
|
1126
|
-
t6 = [
|
|
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 });
|
|
1096
|
+
t5 = [
|
|
1127
1097
|
cssVarName,
|
|
1128
1098
|
formAppElement,
|
|
1129
1099
|
store
|
|
1130
1100
|
];
|
|
1131
|
-
$[
|
|
1132
|
-
$[
|
|
1133
|
-
$[
|
|
1134
|
-
$[
|
|
1135
|
-
|
|
1136
|
-
|
|
1101
|
+
$[16] = cssVarName;
|
|
1102
|
+
$[17] = formAppElement;
|
|
1103
|
+
$[18] = store;
|
|
1104
|
+
$[19] = t4;
|
|
1105
|
+
$[20] = t5;
|
|
1106
|
+
} else {
|
|
1107
|
+
t4 = $[19];
|
|
1108
|
+
t5 = $[20];
|
|
1109
|
+
}
|
|
1110
|
+
useEffect(t4, t5);
|
|
1111
|
+
let t6;
|
|
1137
1112
|
let t7;
|
|
1138
|
-
if ($[
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
$[30] = formAppElement?.style;
|
|
1142
|
-
$[31] = store;
|
|
1143
|
-
$[32] = t7;
|
|
1144
|
-
} else t7 = $[32];
|
|
1145
|
-
let t8;
|
|
1146
|
-
if ($[33] !== cssVarName || $[34] !== formAppElement || $[35] !== store) {
|
|
1147
|
-
t8 = [
|
|
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 });
|
|
1115
|
+
t7 = [
|
|
1148
1116
|
cssVarName,
|
|
1149
1117
|
formAppElement,
|
|
1150
1118
|
store
|
|
1151
1119
|
];
|
|
1152
|
-
$[
|
|
1153
|
-
$[
|
|
1154
|
-
$[
|
|
1155
|
-
$[
|
|
1156
|
-
|
|
1157
|
-
|
|
1120
|
+
$[21] = cssVarName;
|
|
1121
|
+
$[22] = formAppElement;
|
|
1122
|
+
$[23] = store;
|
|
1123
|
+
$[24] = t6;
|
|
1124
|
+
$[25] = t7;
|
|
1125
|
+
} else {
|
|
1126
|
+
t6 = $[24];
|
|
1127
|
+
t7 = $[25];
|
|
1128
|
+
}
|
|
1129
|
+
useEffect(t6, t7);
|
|
1130
|
+
let t8;
|
|
1131
|
+
if ($[26] !== prefix) {
|
|
1132
|
+
t8 = { prefix };
|
|
1133
|
+
$[26] = prefix;
|
|
1134
|
+
$[27] = t8;
|
|
1135
|
+
} else t8 = $[27];
|
|
1136
|
+
const minHeightProps = useResponsiveValue("form-app-", "min-height", minHeight, _temp4$21, t8);
|
|
1158
1137
|
let t9;
|
|
1159
|
-
if ($[
|
|
1160
|
-
t9 =
|
|
1161
|
-
$[
|
|
1162
|
-
$[
|
|
1163
|
-
$[
|
|
1164
|
-
} else t9 = $[
|
|
1165
|
-
const { cssVars, dataAttrs } = t9;
|
|
1138
|
+
if ($[28] !== className || $[29] !== prefix) {
|
|
1139
|
+
t9 = cx(prefix("form-app"), className);
|
|
1140
|
+
$[28] = className;
|
|
1141
|
+
$[29] = prefix;
|
|
1142
|
+
$[30] = t9;
|
|
1143
|
+
} else t9 = $[30];
|
|
1166
1144
|
let t10;
|
|
1167
|
-
if ($[
|
|
1168
|
-
t10 =
|
|
1169
|
-
|
|
1170
|
-
$[41] = prefix;
|
|
1171
|
-
$[42] = t10;
|
|
1172
|
-
} else t10 = $[42];
|
|
1173
|
-
let t11;
|
|
1174
|
-
if ($[43] !== cssVars || $[44] !== style) {
|
|
1175
|
-
t11 = {
|
|
1176
|
-
...cssVars,
|
|
1145
|
+
if ($[31] !== minHeightProps.cssVars || $[32] !== style) {
|
|
1146
|
+
t10 = {
|
|
1147
|
+
...minHeightProps.cssVars,
|
|
1177
1148
|
...style
|
|
1178
1149
|
};
|
|
1179
|
-
$[
|
|
1180
|
-
$[
|
|
1181
|
-
$[
|
|
1182
|
-
} else
|
|
1150
|
+
$[31] = minHeightProps.cssVars;
|
|
1151
|
+
$[32] = style;
|
|
1152
|
+
$[33] = t10;
|
|
1153
|
+
} else t10 = $[33];
|
|
1154
|
+
const t11 = minHeightProps.dataAttrs;
|
|
1183
1155
|
let t12;
|
|
1184
|
-
if ($[
|
|
1156
|
+
if ($[34] !== ref || $[35] !== setFormAppElement) {
|
|
1185
1157
|
t12 = [setFormAppElement, ref];
|
|
1186
|
-
$[
|
|
1187
|
-
$[
|
|
1188
|
-
$[
|
|
1189
|
-
} else t12 = $[
|
|
1158
|
+
$[34] = ref;
|
|
1159
|
+
$[35] = setFormAppElement;
|
|
1160
|
+
$[36] = t12;
|
|
1161
|
+
} else t12 = $[36];
|
|
1190
1162
|
const t13 = useCombinedRef(t12);
|
|
1191
1163
|
let t14;
|
|
1192
|
-
if ($[
|
|
1164
|
+
if ($[37] !== children || $[38] !== formTitle || $[39] !== minHeightProps.dataAttrs || $[40] !== otherProps || $[41] !== t10 || $[42] !== t13 || $[43] !== t9) {
|
|
1193
1165
|
t14 = /* @__PURE__ */ jsx("form", {
|
|
1194
|
-
className:
|
|
1195
|
-
style:
|
|
1166
|
+
className: t9,
|
|
1167
|
+
style: t10,
|
|
1196
1168
|
"aria-label": formTitle,
|
|
1197
1169
|
tabIndex: -1,
|
|
1198
|
-
...
|
|
1170
|
+
...t11,
|
|
1199
1171
|
...otherProps,
|
|
1200
1172
|
ref: t13,
|
|
1201
1173
|
children
|
|
1202
1174
|
});
|
|
1203
|
-
$[
|
|
1204
|
-
$[
|
|
1205
|
-
$[
|
|
1206
|
-
$[
|
|
1207
|
-
$[
|
|
1208
|
-
$[
|
|
1209
|
-
$[
|
|
1210
|
-
$[
|
|
1211
|
-
} else t14 = $[
|
|
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];
|
|
1212
1184
|
return t14;
|
|
1213
1185
|
}
|
|
1214
1186
|
function _temp4$21(v) {
|
|
@@ -1226,16 +1198,14 @@ function _temp$50(t0) {
|
|
|
1226
1198
|
const { topBarHeight } = t0;
|
|
1227
1199
|
return topBarHeight;
|
|
1228
1200
|
}
|
|
1229
|
-
|
|
1230
|
-
//#region src/components/FormApp/FormAppIssueMessages.tsx
|
|
1201
|
+
// src/components/FormApp/FormAppIssueMessages.tsx
|
|
1231
1202
|
/** Component used to register new issue messages within the form app. */
|
|
1232
1203
|
function FormAppIssueMessages(t0) {
|
|
1233
1204
|
const { path, issueMessages, priority, children } = t0;
|
|
1234
1205
|
useRegisterIssueMessages(useResolvedPath(path), issueMessages, priority);
|
|
1235
1206
|
return children;
|
|
1236
1207
|
}
|
|
1237
|
-
|
|
1238
|
-
//#region src/components/FormApp/FormApp.tsx
|
|
1208
|
+
// src/components/FormApp/FormApp.tsx
|
|
1239
1209
|
/**
|
|
1240
1210
|
* Root component of a form application. Built on top of the ostack/KForm-React's `useForm` hook.
|
|
1241
1211
|
*
|
|
@@ -1827,8 +1797,7 @@ function _temp2$45(prop) {
|
|
|
1827
1797
|
function _temp$49(prop_0) {
|
|
1828
1798
|
return prop_0 !== void 0;
|
|
1829
1799
|
}
|
|
1830
|
-
|
|
1831
|
-
//#region src/components/FormApp/FormAppStatus.tsx
|
|
1800
|
+
// src/components/FormApp/FormAppStatus.tsx
|
|
1832
1801
|
/** Component used to apply a different form app status to part of the form. */
|
|
1833
1802
|
function FormAppStatus(t0) {
|
|
1834
1803
|
const $ = c(7);
|
|
@@ -1862,8 +1831,7 @@ function FormAppStatus(t0) {
|
|
|
1862
1831
|
} else t6 = $[6];
|
|
1863
1832
|
return t6;
|
|
1864
1833
|
}
|
|
1865
|
-
|
|
1866
|
-
//#region src/utils/mostSpecificPath.ts
|
|
1834
|
+
// src/utils/mostSpecificPath.ts
|
|
1867
1835
|
/**
|
|
1868
1836
|
* Function which selects the most "specific" path from a list of paths, given a path to match.
|
|
1869
1837
|
* `currentActivePath` contains the path that is currently active.
|
|
@@ -1880,8 +1848,7 @@ function mostSpecificPath(toMatch, paths, currentActivePath) {
|
|
|
1880
1848
|
if (currentActivePath && paths.some((path) => path.contains(currentActivePath))) return currentActivePath;
|
|
1881
1849
|
return paths[0];
|
|
1882
1850
|
}
|
|
1883
|
-
|
|
1884
|
-
//#region src/components/Annexes/AnnexesContext.ts
|
|
1851
|
+
// src/components/Annexes/AnnexesContext.ts
|
|
1885
1852
|
/** Annexes' context. */
|
|
1886
1853
|
var AnnexesContext = createContext(null);
|
|
1887
1854
|
/** Hook used to create the annexes' context. */
|
|
@@ -2149,8 +2116,7 @@ function useAnnexState(path, selector) {
|
|
|
2149
2116
|
} else t0 = $[2];
|
|
2150
2117
|
return useStore(useAnnexesContext(), t0);
|
|
2151
2118
|
}
|
|
2152
|
-
|
|
2153
|
-
//#region src/components/Annexes/Annex.tsx
|
|
2119
|
+
// src/components/Annexes/Annex.tsx
|
|
2154
2120
|
/** Component containing the content of an annex. */
|
|
2155
2121
|
function Annex(t0) {
|
|
2156
2122
|
const $ = c(11);
|
|
@@ -2375,8 +2341,7 @@ function AnnexTabContent(t0) {
|
|
|
2375
2341
|
function _temp2$43(state) {
|
|
2376
2342
|
return state === null ? null : state.documentTitle;
|
|
2377
2343
|
}
|
|
2378
|
-
|
|
2379
|
-
//#region src/utils/useFormLoader.tsx
|
|
2344
|
+
// src/utils/useFormLoader.tsx
|
|
2380
2345
|
/** Hook exposing a function used to load the form from a file. */
|
|
2381
2346
|
function useFormLoader(t0) {
|
|
2382
2347
|
const $ = c(27);
|
|
@@ -2401,9 +2366,9 @@ function useFormLoader(t0) {
|
|
|
2401
2366
|
} else t2 = $[3];
|
|
2402
2367
|
const defaultId = t2;
|
|
2403
2368
|
let t3;
|
|
2404
|
-
if ($[4] !== _setState || $[5] !== addToast || $[6] !== defaultId || $[7] !== formManager || $[8] !== locale || $[9] !==
|
|
2369
|
+
if ($[4] !== _setState || $[5] !== addToast || $[6] !== defaultId || $[7] !== formManager || $[8] !== locale || $[9] !== startIssuesNavigation) {
|
|
2405
2370
|
t3 = async function load(t4) {
|
|
2406
|
-
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;
|
|
2407
2372
|
const path_0 = t5 === void 0 ? AbsolutePath.ROOT : t5;
|
|
2408
2373
|
const id_0 = t6 === void 0 ? defaultId : t6;
|
|
2409
2374
|
const setPristineOnLoad_0 = t7 === void 0 ? true : t7;
|
|
@@ -2414,13 +2379,15 @@ function useFormLoader(t0) {
|
|
|
2414
2379
|
const errorMessage_0 = errorMessageProp ?? locale.LoadAction.errorMessage;
|
|
2415
2380
|
_setState({ preparingLoad: true });
|
|
2416
2381
|
const validationModeIsAuto = formManager.autoValidationStatus !== "inactive";
|
|
2417
|
-
|
|
2418
|
-
|
|
2382
|
+
const loadState = {
|
|
2383
|
+
file: null,
|
|
2384
|
+
started: false
|
|
2385
|
+
};
|
|
2419
2386
|
await withCleanup(async () => {
|
|
2420
2387
|
try {
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
file = await fileOpen({
|
|
2388
|
+
if (await onBeforeLoad_0?.() === false) return;
|
|
2389
|
+
loadState.started = true;
|
|
2390
|
+
const loadedFile = loadState.file = await fileOpen({
|
|
2424
2391
|
extensions: extensions_0,
|
|
2425
2392
|
mimeTypes: mimeTypes_0,
|
|
2426
2393
|
description: description_0,
|
|
@@ -2431,10 +2398,10 @@ function useFormLoader(t0) {
|
|
|
2431
2398
|
preparingLoad: false,
|
|
2432
2399
|
loading: true
|
|
2433
2400
|
});
|
|
2434
|
-
const formValue = await decode_0(
|
|
2401
|
+
const formValue = await decode_0(loadedFile);
|
|
2435
2402
|
if (validationModeIsAuto) await formManager.setValidationMode("manual");
|
|
2436
2403
|
await formManager.set(path_0, formValue);
|
|
2437
|
-
if (setPristineOnLoad_0 || setTouchedOnLoad_0) {
|
|
2404
|
+
if (setPristineOnLoad_0 || setTouchedOnLoad_0 || validateOnLoad_0) {
|
|
2438
2405
|
const pathWithDescendants = (path_0 instanceof AbsolutePath ? path_0 : new AbsolutePath(path_0)).append(AbsolutePathFragment.RecursiveWildcard);
|
|
2439
2406
|
await Promise.all([
|
|
2440
2407
|
setPristineOnLoad_0 && formManager.setPristine(path_0),
|
|
@@ -2445,20 +2412,22 @@ function useFormLoader(t0) {
|
|
|
2445
2412
|
if (validateOnLoad_0) await startIssuesNavigation({ validate: false });
|
|
2446
2413
|
_setState((state) => ({ latestFileHandles: {
|
|
2447
2414
|
...state.latestFileHandles,
|
|
2448
|
-
[id_0]:
|
|
2415
|
+
[id_0]: loadedFile.handle ?? null
|
|
2449
2416
|
} }));
|
|
2450
|
-
const message_0 = typeof successMessage_0 === "function" ? successMessage_0(
|
|
2417
|
+
const message_0 = typeof successMessage_0 === "function" ? successMessage_0(loadedFile) : successMessage_0;
|
|
2451
2418
|
if (message_0 != null) addToast(message_0, { severity: "success" });
|
|
2452
2419
|
} catch (t10) {
|
|
2453
2420
|
const error = t10;
|
|
2454
2421
|
if (error instanceof DOMException && error.name === "AbortError") return;
|
|
2455
2422
|
if (DEV) console.error(error);
|
|
2456
|
-
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;
|
|
2457
2424
|
if (message != null) addToast(message, { severity: "danger" });
|
|
2458
2425
|
}
|
|
2459
2426
|
}, () => withCleanup(async () => {
|
|
2460
|
-
if (
|
|
2461
|
-
|
|
2427
|
+
if (loadState.started) {
|
|
2428
|
+
if (validationModeIsAuto) await formManager.setValidationMode("auto");
|
|
2429
|
+
await onAfterLoad_0?.();
|
|
2430
|
+
}
|
|
2462
2431
|
}, () => _setState({
|
|
2463
2432
|
preparingLoad: false,
|
|
2464
2433
|
loading: false
|
|
@@ -2469,14 +2438,12 @@ function useFormLoader(t0) {
|
|
|
2469
2438
|
$[6] = defaultId;
|
|
2470
2439
|
$[7] = formManager;
|
|
2471
2440
|
$[8] = locale;
|
|
2472
|
-
$[9] =
|
|
2473
|
-
$[10] =
|
|
2474
|
-
|
|
2475
|
-
$[12] = t3;
|
|
2476
|
-
} else t3 = $[12];
|
|
2441
|
+
$[9] = startIssuesNavigation;
|
|
2442
|
+
$[10] = t3;
|
|
2443
|
+
} else t3 = $[10];
|
|
2477
2444
|
const load = t3;
|
|
2478
2445
|
let t4;
|
|
2479
|
-
if ($[
|
|
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) {
|
|
2480
2447
|
t4 = {
|
|
2481
2448
|
load: (t5) => {
|
|
2482
2449
|
return load({
|
|
@@ -2487,6 +2454,8 @@ function useFormLoader(t0) {
|
|
|
2487
2454
|
description,
|
|
2488
2455
|
startIn,
|
|
2489
2456
|
id,
|
|
2457
|
+
onBeforeLoad,
|
|
2458
|
+
onAfterLoad,
|
|
2490
2459
|
setPristineOnLoad,
|
|
2491
2460
|
setTouchedOnLoad,
|
|
2492
2461
|
validateOnLoad,
|
|
@@ -2497,13 +2466,15 @@ function useFormLoader(t0) {
|
|
|
2497
2466
|
},
|
|
2498
2467
|
supportsFileSystemAPIs: supported
|
|
2499
2468
|
};
|
|
2500
|
-
$[
|
|
2501
|
-
$[
|
|
2502
|
-
$[
|
|
2503
|
-
$[
|
|
2504
|
-
$[
|
|
2505
|
-
$[
|
|
2506
|
-
$[
|
|
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;
|
|
2507
2478
|
$[20] = path;
|
|
2508
2479
|
$[21] = setPristineOnLoad;
|
|
2509
2480
|
$[22] = setTouchedOnLoad;
|
|
@@ -2531,8 +2502,7 @@ function useFormIsLoading() {
|
|
|
2531
2502
|
function _temp2$42(state) {
|
|
2532
2503
|
return state.loading;
|
|
2533
2504
|
}
|
|
2534
|
-
|
|
2535
|
-
//#region src/components/Annexes/AnnexRegistrar.tsx
|
|
2505
|
+
// src/components/Annexes/AnnexRegistrar.tsx
|
|
2536
2506
|
/** Component used to register a form annex. */
|
|
2537
2507
|
function AnnexRegistrar(t0) {
|
|
2538
2508
|
const $ = c(50);
|
|
@@ -2732,8 +2702,7 @@ function _temp2$41(t0) {
|
|
|
2732
2702
|
function _temp$45(value) {
|
|
2733
2703
|
return value === null;
|
|
2734
2704
|
}
|
|
2735
|
-
|
|
2736
|
-
//#region src/components/Annexes/RepetitiveAnnexRegistrar.tsx
|
|
2705
|
+
// src/components/Annexes/RepetitiveAnnexRegistrar.tsx
|
|
2737
2706
|
/** Component used to register a repetitive form annex. */
|
|
2738
2707
|
function RepetitiveAnnexRegistrar(t0) {
|
|
2739
2708
|
const $ = c(25);
|
|
@@ -2858,8 +2827,7 @@ function _temp2$40(t0) {
|
|
|
2858
2827
|
function _temp$44(value) {
|
|
2859
2828
|
return value ? tableIdsToArray(value) : [];
|
|
2860
2829
|
}
|
|
2861
|
-
|
|
2862
|
-
//#region src/components/Annexes/Annexes.tsx
|
|
2830
|
+
// src/components/Annexes/Annexes.tsx
|
|
2863
2831
|
/**
|
|
2864
2832
|
* The annexes component can be used to split parts of a form into separate annexes (tabs), while
|
|
2865
2833
|
* providing means of managing and navigating between them. Although not strictly mandatory, each
|
|
@@ -3056,8 +3024,7 @@ function _temp2$39(frag_0, i, t0) {
|
|
|
3056
3024
|
function _temp$43(frag) {
|
|
3057
3025
|
return !(frag instanceof AbsolutePathFragment.Id);
|
|
3058
3026
|
}
|
|
3059
|
-
|
|
3060
|
-
//#region src/utils/useReportValidationFailures.ts
|
|
3027
|
+
// src/utils/useReportValidationFailures.ts
|
|
3061
3028
|
var ValidationFailureError = class extends AtPathError {
|
|
3062
3029
|
constructor(path, issue) {
|
|
3063
3030
|
super(path, `Failed to run validation '${issue.validation}'`);
|
|
@@ -3088,8 +3055,7 @@ function useReportValidationFailures(info) {
|
|
|
3088
3055
|
}
|
|
3089
3056
|
useEffect(t0, t1);
|
|
3090
3057
|
}
|
|
3091
|
-
|
|
3092
|
-
//#region src/components/IssueMessages/IssueMessages.tsx
|
|
3058
|
+
// src/components/IssueMessages/IssueMessages.tsx
|
|
3093
3059
|
/**
|
|
3094
3060
|
* Component used to display all issues associated with the relevant path.
|
|
3095
3061
|
*
|
|
@@ -3261,8 +3227,7 @@ function IssueMessages(t0) {
|
|
|
3261
3227
|
function _temp$42(info_0) {
|
|
3262
3228
|
return info_0.issues;
|
|
3263
3229
|
}
|
|
3264
|
-
|
|
3265
|
-
//#region src/components/IssuesPopover/IssuesPopover.tsx
|
|
3230
|
+
// src/components/IssuesPopover/IssuesPopover.tsx
|
|
3266
3231
|
/** Component used to display issues within a popover. */
|
|
3267
3232
|
function IssuesPopover(t0) {
|
|
3268
3233
|
const $ = c(25);
|
|
@@ -3349,8 +3314,7 @@ function IssuesPopover(t0) {
|
|
|
3349
3314
|
} else t6 = $[24];
|
|
3350
3315
|
return t6;
|
|
3351
3316
|
}
|
|
3352
|
-
|
|
3353
|
-
//#region src/utils/displayStatusConversions.ts
|
|
3317
|
+
// src/utils/displayStatusConversions.ts
|
|
3354
3318
|
/** Transforms ostack/KForm's display status into ostack/UI's control status. */
|
|
3355
3319
|
function displayStatusToControlStatus(displayStatus) {
|
|
3356
3320
|
switch (displayStatus) {
|
|
@@ -3367,8 +3331,7 @@ function displayStatusToColor(displayStatus) {
|
|
|
3367
3331
|
default: return;
|
|
3368
3332
|
}
|
|
3369
3333
|
}
|
|
3370
|
-
|
|
3371
|
-
//#region src/utils/promiseUtils.ts
|
|
3334
|
+
// src/utils/promiseUtils.ts
|
|
3372
3335
|
/**
|
|
3373
3336
|
* Whether a given value is [promise-like]{@link PromiseLike}.
|
|
3374
3337
|
*
|
|
@@ -3378,16 +3341,14 @@ function displayStatusToColor(displayStatus) {
|
|
|
3378
3341
|
function isPromiseLike(value) {
|
|
3379
3342
|
return typeof value?.then === "function";
|
|
3380
3343
|
}
|
|
3381
|
-
|
|
3382
|
-
//#region src/components/TopBar/TopBarContext.tsx
|
|
3344
|
+
// src/components/TopBar/TopBarContext.tsx
|
|
3383
3345
|
/** Context of the top bar component. */
|
|
3384
3346
|
var TopBarContext = createContext(null);
|
|
3385
3347
|
/** Provides access to the top bar element within the context. */
|
|
3386
3348
|
function useTopBarElement() {
|
|
3387
3349
|
return useContext(TopBarContext)?.topBarEl ?? null;
|
|
3388
3350
|
}
|
|
3389
|
-
|
|
3390
|
-
//#region src/components/TopBar/TopBar.tsx
|
|
3351
|
+
// src/components/TopBar/TopBar.tsx
|
|
3391
3352
|
/** Top bar component. */
|
|
3392
3353
|
function TopBar(t0) {
|
|
3393
3354
|
const $ = c(29);
|
|
@@ -3489,8 +3450,7 @@ function TopBar(t0) {
|
|
|
3489
3450
|
} else t8 = $[28];
|
|
3490
3451
|
return t8;
|
|
3491
3452
|
}
|
|
3492
|
-
|
|
3493
|
-
//#region src/components/TopBar/TopBarActions.tsx
|
|
3453
|
+
// src/components/TopBar/TopBarActions.tsx
|
|
3494
3454
|
/** Container of the top bar actions. */
|
|
3495
3455
|
function TopBarActions(t0) {
|
|
3496
3456
|
const $ = c(19);
|
|
@@ -3565,8 +3525,7 @@ function TopBarActions(t0) {
|
|
|
3565
3525
|
} else t6 = $[18];
|
|
3566
3526
|
return t6;
|
|
3567
3527
|
}
|
|
3568
|
-
|
|
3569
|
-
//#region src/components/TopBar/TopBarActionsSecondary.tsx
|
|
3528
|
+
// src/components/TopBar/TopBarActionsSecondary.tsx
|
|
3570
3529
|
/** Container of the secondary top bar actions. */
|
|
3571
3530
|
function TopBarActionsSecondary(props) {
|
|
3572
3531
|
const $ = c(2);
|
|
@@ -3581,8 +3540,7 @@ function TopBarActionsSecondary(props) {
|
|
|
3581
3540
|
} else t0 = $[1];
|
|
3582
3541
|
return t0;
|
|
3583
3542
|
}
|
|
3584
|
-
|
|
3585
|
-
//#region src/components/Annexes/AnnexesMenu.tsx
|
|
3543
|
+
// src/components/Annexes/AnnexesMenu.tsx
|
|
3586
3544
|
/** Component that allows to navigate between, add, and remove annexes. */
|
|
3587
3545
|
function AnnexesMenu(t0) {
|
|
3588
3546
|
const $ = c(87);
|
|
@@ -4280,8 +4238,7 @@ function AnnexesMenuNewItem(t0) {
|
|
|
4280
4238
|
} else t13 = $[39];
|
|
4281
4239
|
return t13;
|
|
4282
4240
|
}
|
|
4283
|
-
|
|
4284
|
-
//#region src/components/Annexes/AnnexTab.tsx
|
|
4241
|
+
// src/components/Annexes/AnnexTab.tsx
|
|
4285
4242
|
function AnnexTab(t0) {
|
|
4286
4243
|
const $ = c(68);
|
|
4287
4244
|
const { path } = t0;
|
|
@@ -4526,8 +4483,7 @@ function _temp2$37(state_0) {
|
|
|
4526
4483
|
function _temp$40(state) {
|
|
4527
4484
|
return state?.deferredIssuesToDisplay ?? [];
|
|
4528
4485
|
}
|
|
4529
|
-
|
|
4530
|
-
//#region src/components/Annexes/AnnexesTabList.tsx
|
|
4486
|
+
// src/components/Annexes/AnnexesTabList.tsx
|
|
4531
4487
|
/** List of annex tabs. */
|
|
4532
4488
|
function AnnexesTabList(t0) {
|
|
4533
4489
|
const $ = c(30);
|
|
@@ -4619,8 +4575,7 @@ function _temp2$36(state_0) {
|
|
|
4619
4575
|
function _temp$39(state) {
|
|
4620
4576
|
return state.activeAnnex;
|
|
4621
4577
|
}
|
|
4622
|
-
|
|
4623
|
-
//#region src/components/Annexes/AnnexesManager.tsx
|
|
4578
|
+
// src/components/Annexes/AnnexesManager.tsx
|
|
4624
4579
|
/**
|
|
4625
4580
|
* Component used to manage the form's annexes. Provides a menu that allows changing, adding, and
|
|
4626
4581
|
* removing annexes, as well as a list of tabs for each existing annex.
|
|
@@ -5020,8 +4975,140 @@ function _temp2$35(state_0) {
|
|
|
5020
4975
|
function _temp$38(state) {
|
|
5021
4976
|
return state.tablessStates();
|
|
5022
4977
|
}
|
|
5023
|
-
|
|
5024
|
-
|
|
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
|
|
5025
5112
|
/** Hook which helps a control component render its issues. */
|
|
5026
5113
|
function useControlIssues(t0) {
|
|
5027
5114
|
const $ = c(25);
|
|
@@ -5116,8 +5203,7 @@ function useControlIssues(t0) {
|
|
|
5116
5203
|
} else t6 = $[24];
|
|
5117
5204
|
return t6;
|
|
5118
5205
|
}
|
|
5119
|
-
|
|
5120
|
-
//#region src/utils/useRegisterControl.tsx
|
|
5206
|
+
// src/utils/useRegisterControl.tsx
|
|
5121
5207
|
/** Hook used to register a control within the form app. */
|
|
5122
5208
|
function useRegisterControl(t0) {
|
|
5123
5209
|
const $ = c(24);
|
|
@@ -5252,8 +5338,7 @@ function useRegisterFieldLabel(path, issuesPanelLabelSuffix) {
|
|
|
5252
5338
|
} else t0 = $[3];
|
|
5253
5339
|
useOnLabelChange(t0);
|
|
5254
5340
|
}
|
|
5255
|
-
|
|
5256
|
-
//#region src/components/DebugInfo/DebugInfo.tsx
|
|
5341
|
+
// src/components/DebugInfo/DebugInfo.tsx
|
|
5257
5342
|
/** Debug information. */
|
|
5258
5343
|
function DebugInfo(t0) {
|
|
5259
5344
|
const $ = c(33);
|
|
@@ -5449,8 +5534,7 @@ function defaultFormat(value) {
|
|
|
5449
5534
|
if (typeof value === "object" && [null, Object.prototype].includes(Object.getPrototypeOf(value))) return `{${Object.entries(value).map(([k, v]) => `${k}: ${defaultFormat(v)}`).join(", ")}}`;
|
|
5450
5535
|
return String(value);
|
|
5451
5536
|
}
|
|
5452
|
-
|
|
5453
|
-
//#region src/components/DebugInfo/DebugInfoControlAddonTrigger.tsx
|
|
5537
|
+
// src/components/DebugInfo/DebugInfoControlAddonTrigger.tsx
|
|
5454
5538
|
/** Debug info trigger as a control addon. */
|
|
5455
5539
|
function DebugInfoControlAddonTrigger(t0) {
|
|
5456
5540
|
const $ = c(11);
|
|
@@ -5501,16 +5585,14 @@ function DebugInfoControlAddonTrigger(t0) {
|
|
|
5501
5585
|
} else t3 = $[10];
|
|
5502
5586
|
return t3;
|
|
5503
5587
|
}
|
|
5504
|
-
|
|
5505
|
-
//#region src/components/ResetOnChange/ResetOnChangeContext.ts
|
|
5588
|
+
// src/components/ResetOnChange/ResetOnChangeContext.ts
|
|
5506
5589
|
/** Reset on change context. */
|
|
5507
5590
|
var ResetOnChangeContext = createContext(void 0);
|
|
5508
5591
|
/** Function providing access to the reset on change context value. */
|
|
5509
5592
|
function useResetOnChangeContext() {
|
|
5510
5593
|
return useContext(ResetOnChangeContext);
|
|
5511
5594
|
}
|
|
5512
|
-
|
|
5513
|
-
//#region src/utils/extractConfirmDialogOptions.ts
|
|
5595
|
+
// src/utils/extractConfirmDialogOptions.ts
|
|
5514
5596
|
/** Function used to extract confirm dialog options with a given prefix. */
|
|
5515
5597
|
function extractConfirmDialogOptions(options, prefix = "confirmDialog", newPrefix = "") {
|
|
5516
5598
|
const confirmDialogOptions = {};
|
|
@@ -5525,8 +5607,7 @@ function extractConfirmDialogOptions(options, prefix = "confirmDialog", newPrefi
|
|
|
5525
5607
|
}
|
|
5526
5608
|
return [confirmDialogOptions, otherOptions];
|
|
5527
5609
|
}
|
|
5528
|
-
|
|
5529
|
-
//#region src/components/ResetOnChange/useResetOnChange.tsx
|
|
5610
|
+
// src/components/ResetOnChange/useResetOnChange.tsx
|
|
5530
5611
|
var defaultWhen = () => true;
|
|
5531
5612
|
/**
|
|
5532
5613
|
* Hook which returns an `onValueChange` event handler which resets the fields at the provided
|
|
@@ -5709,8 +5790,7 @@ async function resetAll(formManager, toReset, setPristine, setUntouched) {
|
|
|
5709
5790
|
setUntouched && formManager.setUntouched(path)
|
|
5710
5791
|
]));
|
|
5711
5792
|
}
|
|
5712
|
-
|
|
5713
|
-
//#region src/components/ResetOnChange/ResetOnChange.tsx
|
|
5793
|
+
// src/components/ResetOnChange/ResetOnChange.tsx
|
|
5714
5794
|
/**
|
|
5715
5795
|
* Component used to reset path(s) to their initial value when the value of controls within it
|
|
5716
5796
|
* change (according to the `when` function). Built on top of the `useResetOnChange` hook.
|
|
@@ -5762,8 +5842,7 @@ function ResetOnChange(t0) {
|
|
|
5762
5842
|
} else t1 = $[6];
|
|
5763
5843
|
return t1;
|
|
5764
5844
|
}
|
|
5765
|
-
|
|
5766
|
-
//#region src/components/CheckboxControl/CheckboxControl.tsx
|
|
5845
|
+
// src/components/CheckboxControl/CheckboxControl.tsx
|
|
5767
5846
|
/**
|
|
5768
5847
|
* The checkbox control component is a KForm form control for values with (possibly
|
|
5769
5848
|
* [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
|
|
@@ -6110,8 +6189,7 @@ function parseCheckboxValue(formattedValue, state) {
|
|
|
6110
6189
|
function formatToCheckboxValue(value) {
|
|
6111
6190
|
return value === void 0 ? false : value ?? "indeterminate";
|
|
6112
6191
|
}
|
|
6113
|
-
|
|
6114
|
-
//#region src/utils/selectionTransformations.tsx
|
|
6192
|
+
// src/utils/selectionTransformations.tsx
|
|
6115
6193
|
/** Whether the provided value isn't a known option. */
|
|
6116
6194
|
function isUnknownValue(value, options) {
|
|
6117
6195
|
return value != null && value !== "" && options.every((opt) => !equals(opt.value, value));
|
|
@@ -6165,8 +6243,7 @@ function selectionItemObjectsToNodes(items) {
|
|
|
6165
6243
|
children: optionOrGroup.text ?? optionOrGroup.value?.toString() ?? ""
|
|
6166
6244
|
}, key ?? i));
|
|
6167
6245
|
}
|
|
6168
|
-
|
|
6169
|
-
//#region src/components/UnknownValue/UnknownValue.tsx
|
|
6246
|
+
// src/components/UnknownValue/UnknownValue.tsx
|
|
6170
6247
|
/** Representation of an unknown value. */
|
|
6171
6248
|
function UnknownValue(t0) {
|
|
6172
6249
|
const $ = c(13);
|
|
@@ -6224,8 +6301,7 @@ function UnknownValue(t0) {
|
|
|
6224
6301
|
} else t4 = $[12];
|
|
6225
6302
|
return t4;
|
|
6226
6303
|
}
|
|
6227
|
-
|
|
6228
|
-
//#region src/components/CheckboxGroupControl/CheckboxGroupControlItem.tsx
|
|
6304
|
+
// src/components/CheckboxGroupControl/CheckboxGroupControlItem.tsx
|
|
6229
6305
|
/**
|
|
6230
6306
|
* Definition of a checkbox group control item.
|
|
6231
6307
|
*
|
|
@@ -6235,8 +6311,7 @@ function UnknownValue(t0) {
|
|
|
6235
6311
|
function CheckboxGroupControlItem(_props) {
|
|
6236
6312
|
return null;
|
|
6237
6313
|
}
|
|
6238
|
-
|
|
6239
|
-
//#region src/components/CheckboxGroupControl/CheckboxGroupControl.tsx
|
|
6314
|
+
// src/components/CheckboxGroupControl/CheckboxGroupControl.tsx
|
|
6240
6315
|
/**
|
|
6241
6316
|
* The checkbox group control component is a KForm form control for values with (possibly
|
|
6242
6317
|
* [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
|
|
@@ -6655,8 +6730,7 @@ function _temp$34(t0) {
|
|
|
6655
6730
|
...otherProps_0
|
|
6656
6731
|
};
|
|
6657
6732
|
}
|
|
6658
|
-
|
|
6659
|
-
//#region src/components/ControlField/ControlField.tsx
|
|
6733
|
+
// src/components/ControlField/ControlField.tsx
|
|
6660
6734
|
/**
|
|
6661
6735
|
* Component used to group controls with a label, helper text, and/or feedback.
|
|
6662
6736
|
*
|
|
@@ -6726,8 +6800,7 @@ function ControlField(t0) {
|
|
|
6726
6800
|
} else t3 = $[7];
|
|
6727
6801
|
return t3;
|
|
6728
6802
|
}
|
|
6729
|
-
|
|
6730
|
-
//#region src/utils/dateRestrictions.ts
|
|
6803
|
+
// src/utils/dateRestrictions.ts
|
|
6731
6804
|
/** Returns the minimum date allowed based on a temporal schema's restrictions. */
|
|
6732
6805
|
function minDateRestriction(schema) {
|
|
6733
6806
|
const { restrictions } = schema.typeInfo;
|
|
@@ -6748,8 +6821,7 @@ function maxDateRestriction(schema) {
|
|
|
6748
6821
|
function temporalRestrictionToDate(restriction, schema) {
|
|
6749
6822
|
return restriction == null ? void 0 : parseISO(formatTemporalAsString(restriction, schema));
|
|
6750
6823
|
}
|
|
6751
|
-
|
|
6752
|
-
//#region src/utils/useTemporalStringTransformer.ts
|
|
6824
|
+
// src/utils/useTemporalStringTransformer.ts
|
|
6753
6825
|
/**
|
|
6754
6826
|
* Hook exposing functions to transform a temporal string value from/into a string representation of
|
|
6755
6827
|
* a date accepted by a date input.
|
|
@@ -6790,8 +6862,7 @@ function useTemporalStringTransformer(dateTransformerOptions) {
|
|
|
6790
6862
|
} else t2 = $[6];
|
|
6791
6863
|
return t2;
|
|
6792
6864
|
}
|
|
6793
|
-
|
|
6794
|
-
//#region src/components/DateControl/DateControl.tsx
|
|
6865
|
+
// src/components/DateControl/DateControl.tsx
|
|
6795
6866
|
/**
|
|
6796
6867
|
* The date control component is a KForm form control for values with (typically nullable) schemas
|
|
6797
6868
|
* of type
|
|
@@ -7181,8 +7252,7 @@ function _temp$33(t0) {
|
|
|
7181
7252
|
const { schema } = t0;
|
|
7182
7253
|
return schema;
|
|
7183
7254
|
}
|
|
7184
|
-
|
|
7185
|
-
//#region src/components/DateRangeControl/DateRangeControl.tsx
|
|
7255
|
+
// src/components/DateRangeControl/DateRangeControl.tsx
|
|
7186
7256
|
/**
|
|
7187
7257
|
* The date-range control component is a KForm form control for pairs of values (start and end
|
|
7188
7258
|
* dates) with (typically nullable) schemas of type
|
|
@@ -7841,8 +7911,7 @@ function _temp$32(t0) {
|
|
|
7841
7911
|
const { schema } = t0;
|
|
7842
7912
|
return schema;
|
|
7843
7913
|
}
|
|
7844
|
-
|
|
7845
|
-
//#region src/components/FileControl/FileControlDownloadAddon.tsx
|
|
7914
|
+
// src/components/FileControl/FileControlDownloadAddon.tsx
|
|
7846
7915
|
/** Control addon used to download a file. */
|
|
7847
7916
|
function FileControlDownloadAddon(t0) {
|
|
7848
7917
|
const $ = c(10);
|
|
@@ -7886,8 +7955,7 @@ function FileControlDownloadAddon(t0) {
|
|
|
7886
7955
|
} else t4 = $[9];
|
|
7887
7956
|
return t4;
|
|
7888
7957
|
}
|
|
7889
|
-
|
|
7890
|
-
//#region src/components/FileControl/FileControlViewAddon.tsx
|
|
7958
|
+
// src/components/FileControl/FileControlViewAddon.tsx
|
|
7891
7959
|
/** Control addon used to view a file. */
|
|
7892
7960
|
function FileControlViewAddon(t0) {
|
|
7893
7961
|
const $ = c(52);
|
|
@@ -8065,8 +8133,7 @@ function FileControlViewAddon(t0) {
|
|
|
8065
8133
|
} else t21 = $[51];
|
|
8066
8134
|
return t21;
|
|
8067
8135
|
}
|
|
8068
|
-
|
|
8069
|
-
//#region src/components/FileControl/FileControl.tsx
|
|
8136
|
+
// src/components/FileControl/FileControl.tsx
|
|
8070
8137
|
/**
|
|
8071
8138
|
* The file control component is a KForm form control for values with (typically
|
|
8072
8139
|
* [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
|
|
@@ -8555,8 +8622,7 @@ function _temp$31(t0) {
|
|
|
8555
8622
|
const { schema } = t0;
|
|
8556
8623
|
return schema;
|
|
8557
8624
|
}
|
|
8558
|
-
|
|
8559
|
-
//#region src/components/FormPages/FormPagesContext.ts
|
|
8625
|
+
// src/components/FormPages/FormPagesContext.ts
|
|
8560
8626
|
/** Form pages context. */
|
|
8561
8627
|
var FormPagesContext = createContext(null);
|
|
8562
8628
|
/** Hook used to create the form pages context. */
|
|
@@ -8705,8 +8771,7 @@ function useFormPageState(path, selector) {
|
|
|
8705
8771
|
} else t0 = $[2];
|
|
8706
8772
|
return useStore(useFormPagesContext(), t0);
|
|
8707
8773
|
}
|
|
8708
|
-
|
|
8709
|
-
//#region src/components/FormPages/FormPageHeader.tsx
|
|
8774
|
+
// src/components/FormPages/FormPageHeader.tsx
|
|
8710
8775
|
/** Form page header. */
|
|
8711
8776
|
function FormPageHeader(t0) {
|
|
8712
8777
|
const $ = c(70);
|
|
@@ -8952,8 +9017,7 @@ function _temp2$26(state_2) {
|
|
|
8952
9017
|
function _temp$29(state_1) {
|
|
8953
9018
|
return state_1?.schema;
|
|
8954
9019
|
}
|
|
8955
|
-
|
|
8956
|
-
//#region src/components/FormPages/FormPage.tsx
|
|
9020
|
+
// src/components/FormPages/FormPage.tsx
|
|
8957
9021
|
/** Component representing a single form page. */
|
|
8958
9022
|
function FormPage(t0) {
|
|
8959
9023
|
const $ = c(97);
|
|
@@ -9307,8 +9371,7 @@ function _temp2$25(state_1) {
|
|
|
9307
9371
|
function _temp$28(state) {
|
|
9308
9372
|
return state.activePage;
|
|
9309
9373
|
}
|
|
9310
|
-
|
|
9311
|
-
//#region src/components/FormPages/FormPageRegistrar.tsx
|
|
9374
|
+
// src/components/FormPages/FormPageRegistrar.tsx
|
|
9312
9375
|
/** Component used to register a form page. */
|
|
9313
9376
|
function FormPageRegistrar(t0) {
|
|
9314
9377
|
const $ = c(33);
|
|
@@ -9463,8 +9526,7 @@ function _temp$27(t0) {
|
|
|
9463
9526
|
const { path: path_0 } = t0;
|
|
9464
9527
|
return path_0;
|
|
9465
9528
|
}
|
|
9466
|
-
|
|
9467
|
-
//#region src/components/FormPages/FormPages.tsx
|
|
9529
|
+
// src/components/FormPages/FormPages.tsx
|
|
9468
9530
|
/**
|
|
9469
9531
|
* The form pages component can be used to split parts of a form into separate pages, while
|
|
9470
9532
|
* providing means of navigating between them. Although not strictly mandatory, each page is
|
|
@@ -9677,8 +9739,7 @@ function _temp2$23(frag_0) {
|
|
|
9677
9739
|
function _temp$26(frag) {
|
|
9678
9740
|
return !(frag instanceof AbsolutePathFragment.Id);
|
|
9679
9741
|
}
|
|
9680
|
-
|
|
9681
|
-
//#region src/components/FormPages/FormPagesSelectOption.tsx
|
|
9742
|
+
// src/components/FormPages/FormPagesSelectOption.tsx
|
|
9682
9743
|
function FormPagesSelectOption(t0) {
|
|
9683
9744
|
const $ = c(37);
|
|
9684
9745
|
const { path } = t0;
|
|
@@ -9808,8 +9869,7 @@ function _temp2$22(state_0) {
|
|
|
9808
9869
|
function _temp$25(state) {
|
|
9809
9870
|
return !state?.exists;
|
|
9810
9871
|
}
|
|
9811
|
-
|
|
9812
|
-
//#region src/components/FormPages/FormPagesSelect.tsx
|
|
9872
|
+
// src/components/FormPages/FormPagesSelect.tsx
|
|
9813
9873
|
/** Select component allowing the navigation between form pages. */
|
|
9814
9874
|
function FormPagesSelect(t0) {
|
|
9815
9875
|
const $ = c(63);
|
|
@@ -10017,8 +10077,7 @@ function _temp2$21(state_0) {
|
|
|
10017
10077
|
function _temp$24(state) {
|
|
10018
10078
|
return state.activePage;
|
|
10019
10079
|
}
|
|
10020
|
-
|
|
10021
|
-
//#region src/components/FormPages/FormPageSidebarItem.tsx
|
|
10080
|
+
// src/components/FormPages/FormPageSidebarItem.tsx
|
|
10022
10081
|
function FormPageSidebarItem(t0) {
|
|
10023
10082
|
const $ = c(66);
|
|
10024
10083
|
const { path } = t0;
|
|
@@ -10240,8 +10299,7 @@ function _temp2$20(state_0) {
|
|
|
10240
10299
|
function _temp$23(state) {
|
|
10241
10300
|
return state.activePage;
|
|
10242
10301
|
}
|
|
10243
|
-
|
|
10244
|
-
//#region src/components/FormPages/FormPagesSidebar.tsx
|
|
10302
|
+
// src/components/FormPages/FormPagesSidebar.tsx
|
|
10245
10303
|
/** Sidebar component allowing the navigation between form pages. */
|
|
10246
10304
|
function FormPagesSidebar(t0) {
|
|
10247
10305
|
const $ = c(22);
|
|
@@ -10328,8 +10386,7 @@ function _temp2$19(state_0) {
|
|
|
10328
10386
|
function _temp$22(state) {
|
|
10329
10387
|
return state.activePage;
|
|
10330
10388
|
}
|
|
10331
|
-
|
|
10332
|
-
//#region src/components/FormPages/FormPagesNavigation.tsx
|
|
10389
|
+
// src/components/FormPages/FormPagesNavigation.tsx
|
|
10333
10390
|
/**
|
|
10334
10391
|
* Component allowing navigation between form pages. Renders as a sidebar in large screens and as a
|
|
10335
10392
|
* select for smaller ones.
|
|
@@ -10415,8 +10472,7 @@ function FormPagesNavigation(t0) {
|
|
|
10415
10472
|
} else t6 = $[24];
|
|
10416
10473
|
return t6;
|
|
10417
10474
|
}
|
|
10418
|
-
|
|
10419
|
-
//#region src/components/FormStepper/FormStepperContext.ts
|
|
10475
|
+
// src/components/FormStepper/FormStepperContext.ts
|
|
10420
10476
|
/** Form stepper context. */
|
|
10421
10477
|
var FormStepperContext = createContext(null);
|
|
10422
10478
|
/** Hook used to create the form stepper context. */
|
|
@@ -10595,8 +10651,7 @@ function useFormStepState(path, selector) {
|
|
|
10595
10651
|
} else t0 = $[2];
|
|
10596
10652
|
return useStore(useFormStepperContext(), t0);
|
|
10597
10653
|
}
|
|
10598
|
-
|
|
10599
|
-
//#region src/components/FormStepper/FormStep.tsx
|
|
10654
|
+
// src/components/FormStepper/FormStep.tsx
|
|
10600
10655
|
/** Single form step. */
|
|
10601
10656
|
function FormStep(t0) {
|
|
10602
10657
|
const $ = c(21);
|
|
@@ -10697,8 +10752,7 @@ function _temp$20(controller) {
|
|
|
10697
10752
|
}
|
|
10698
10753
|
/** @deprecated Use `FormStep` instead. */
|
|
10699
10754
|
var FormStepContent = FormStep;
|
|
10700
|
-
|
|
10701
|
-
//#region src/components/FormStepper/FormStepButton.tsx
|
|
10755
|
+
// src/components/FormStepper/FormStepButton.tsx
|
|
10702
10756
|
/** Form step button. */
|
|
10703
10757
|
function FormStepButton(t0) {
|
|
10704
10758
|
const $ = c(13);
|
|
@@ -10756,8 +10810,7 @@ function _temp2$16(state_0) {
|
|
|
10756
10810
|
function _temp$19(state) {
|
|
10757
10811
|
return state?.deferredDisplayStatus;
|
|
10758
10812
|
}
|
|
10759
|
-
|
|
10760
|
-
//#region src/components/FormStepper/FormStepList.tsx
|
|
10813
|
+
// src/components/FormStepper/FormStepList.tsx
|
|
10761
10814
|
/** Component displaying all form steps in a list. */
|
|
10762
10815
|
function FormStepList(t0) {
|
|
10763
10816
|
const $ = c(12);
|
|
@@ -10810,8 +10863,7 @@ function _temp2$15(step) {
|
|
|
10810
10863
|
function _temp$18(state) {
|
|
10811
10864
|
return state.steps;
|
|
10812
10865
|
}
|
|
10813
|
-
|
|
10814
|
-
//#region src/components/FormStepper/FormStepRegistrar.tsx
|
|
10866
|
+
// src/components/FormStepper/FormStepRegistrar.tsx
|
|
10815
10867
|
/** Component used to register a form step. */
|
|
10816
10868
|
function FormStepRegistrar(t0) {
|
|
10817
10869
|
const $ = c(30);
|
|
@@ -10945,8 +10997,7 @@ function _temp$17(t0) {
|
|
|
10945
10997
|
const { path: path_0 } = t0;
|
|
10946
10998
|
return path_0;
|
|
10947
10999
|
}
|
|
10948
|
-
|
|
10949
|
-
//#region src/components/FormStepper/FormStepper.tsx
|
|
11000
|
+
// src/components/FormStepper/FormStepper.tsx
|
|
10950
11001
|
/**
|
|
10951
11002
|
* The form stepper component can be used to split parts of a form into separate steps. It is built
|
|
10952
11003
|
* on top of the [`Stepper`](/docs/ostack-ui-disclosure-stepper--docs) component. Although not
|
|
@@ -11145,20 +11196,16 @@ function _temp2$13(frag_0) {
|
|
|
11145
11196
|
function _temp$16(frag) {
|
|
11146
11197
|
return !(frag instanceof AbsolutePathFragment.Id);
|
|
11147
11198
|
}
|
|
11148
|
-
|
|
11149
|
-
//#region src/components/FormStepper/FormStepperFinishTrigger.tsx
|
|
11199
|
+
// src/components/FormStepper/FormStepperFinishTrigger.tsx
|
|
11150
11200
|
/** Trigger used to conclude the form stepper. */
|
|
11151
11201
|
var FormStepperFinishTrigger = StepperFinishTrigger;
|
|
11152
|
-
|
|
11153
|
-
//#region src/components/FormStepper/FormStepperNextTrigger.tsx
|
|
11202
|
+
// src/components/FormStepper/FormStepperNextTrigger.tsx
|
|
11154
11203
|
/** Trigger used to go to the next step of the form stepper. */
|
|
11155
11204
|
var FormStepperNextTrigger = StepperNextTrigger;
|
|
11156
|
-
|
|
11157
|
-
//#region src/components/FormStepper/FormStepperPreviousTrigger.tsx
|
|
11205
|
+
// src/components/FormStepper/FormStepperPreviousTrigger.tsx
|
|
11158
11206
|
/** Trigger used to go to the previous step of the form stepper. */
|
|
11159
11207
|
var FormStepperPreviousTrigger = StepperPreviousTrigger;
|
|
11160
|
-
|
|
11161
|
-
//#region src/components/IssuesAlert/IssuesAlert.tsx
|
|
11208
|
+
// src/components/IssuesAlert/IssuesAlert.tsx
|
|
11162
11209
|
/** Component used to display an issue alert. */
|
|
11163
11210
|
function IssuesAlert(t0) {
|
|
11164
11211
|
const $ = c(62);
|
|
@@ -11346,8 +11393,7 @@ function _temp2$12(issue) {
|
|
|
11346
11393
|
function _temp$15(info_0) {
|
|
11347
11394
|
return info_0.issues;
|
|
11348
11395
|
}
|
|
11349
|
-
|
|
11350
|
-
//#region src/utils/useFormValidator.ts
|
|
11396
|
+
// src/utils/useFormValidator.ts
|
|
11351
11397
|
/** Hook exposing a function used to validate the form. */
|
|
11352
11398
|
function useFormValidator(t0) {
|
|
11353
11399
|
const $ = c(7);
|
|
@@ -11364,14 +11410,10 @@ function useFormValidator(t0) {
|
|
|
11364
11410
|
if ($[2] !== _setState || $[3] !== onAfterValidate || $[4] !== onBeforeValidate || $[5] !== startIssuesNavigation) {
|
|
11365
11411
|
const validate = async () => {
|
|
11366
11412
|
_setState({ validating: true });
|
|
11367
|
-
let beforeValidateResult;
|
|
11368
11413
|
await withCleanup(async () => {
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
}, () => withCleanup(async () => {
|
|
11373
|
-
if (beforeValidateResult !== false) await onAfterValidate?.();
|
|
11374
|
-
}, () => _setState({ validating: false })));
|
|
11414
|
+
if (await onBeforeValidate?.() === false) return;
|
|
11415
|
+
await withCleanup(() => startIssuesNavigation(), () => onAfterValidate?.());
|
|
11416
|
+
}, () => _setState({ validating: false }));
|
|
11375
11417
|
};
|
|
11376
11418
|
t2 = { validate };
|
|
11377
11419
|
$[2] = _setState;
|
|
@@ -11409,8 +11451,7 @@ function _temp$14(t0) {
|
|
|
11409
11451
|
const { autoValidationStatus } = t0;
|
|
11410
11452
|
return autoValidationStatus === "activeRunning";
|
|
11411
11453
|
}
|
|
11412
|
-
|
|
11413
|
-
//#region src/components/IssuesPanel/IssuesPanelControls.tsx
|
|
11454
|
+
// src/components/IssuesPanel/IssuesPanelControls.tsx
|
|
11414
11455
|
/** Controls of the issues panel. */
|
|
11415
11456
|
function IssuesPanelControls(t0) {
|
|
11416
11457
|
const $ = c(91);
|
|
@@ -11738,8 +11779,7 @@ function _temp$13(t0) {
|
|
|
11738
11779
|
const { initialized } = t0;
|
|
11739
11780
|
return initialized;
|
|
11740
11781
|
}
|
|
11741
|
-
|
|
11742
|
-
//#region src/components/IssuesPanel/IssuesPanelMessagesCard.tsx
|
|
11782
|
+
// src/components/IssuesPanel/IssuesPanelMessagesCard.tsx
|
|
11743
11783
|
function IssuesPanelMessagesCard(t0) {
|
|
11744
11784
|
const $ = c(90);
|
|
11745
11785
|
let bodyProps;
|
|
@@ -12066,8 +12106,7 @@ function Breadcrumb() {
|
|
|
12066
12106
|
} else t0 = $[2];
|
|
12067
12107
|
return t0;
|
|
12068
12108
|
}
|
|
12069
|
-
|
|
12070
|
-
//#region src/components/IssuesPanel/IssuesPanelSummaryCard.tsx
|
|
12109
|
+
// src/components/IssuesPanel/IssuesPanelSummaryCard.tsx
|
|
12071
12110
|
function IssuesPanelSummaryCard(t0) {
|
|
12072
12111
|
const $ = c(49);
|
|
12073
12112
|
let className;
|
|
@@ -12218,8 +12257,7 @@ function IssuesPanelSummaryCard(t0) {
|
|
|
12218
12257
|
} else t8 = $[48];
|
|
12219
12258
|
return t8;
|
|
12220
12259
|
}
|
|
12221
|
-
|
|
12222
|
-
//#region src/components/IssuesPanel/IssuesPanel.tsx
|
|
12260
|
+
// src/components/IssuesPanel/IssuesPanel.tsx
|
|
12223
12261
|
/** Default “focus” keybinds. */
|
|
12224
12262
|
var DEFAULT_FOCUS_KEYBINDS = "Alt+Shift+F";
|
|
12225
12263
|
/** Default “previous issue” keybinds. */
|
|
@@ -12807,13 +12845,12 @@ function mostRelevantIssuePath(info, latestInteraction, formSchema, issuesOrderC
|
|
|
12807
12845
|
}
|
|
12808
12846
|
return info[0].path;
|
|
12809
12847
|
}
|
|
12810
|
-
|
|
12811
|
-
//#region src/components/LoadAction/LoadAction.tsx
|
|
12848
|
+
// src/components/LoadAction/LoadAction.tsx
|
|
12812
12849
|
/** Default “load” keybinds. */
|
|
12813
12850
|
var DEFAULT_LOAD_KEYBINDS = "$mod+O";
|
|
12814
12851
|
/**
|
|
12815
|
-
* Form action used to load the form from a file. Built on
|
|
12816
|
-
*
|
|
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.
|
|
12817
12854
|
*
|
|
12818
12855
|
* Example usage:
|
|
12819
12856
|
*
|
|
@@ -13011,8 +13048,7 @@ function LoadAction(t0) {
|
|
|
13011
13048
|
} else t8 = $[56];
|
|
13012
13049
|
return t8;
|
|
13013
13050
|
}
|
|
13014
|
-
|
|
13015
|
-
//#region src/components/NumericControl/NumericControl.tsx
|
|
13051
|
+
// src/components/NumericControl/NumericControl.tsx
|
|
13016
13052
|
/** Kotlin integer types. */
|
|
13017
13053
|
var INTEGER_TYPES = [
|
|
13018
13054
|
"Byte",
|
|
@@ -13459,8 +13495,7 @@ function _temp$11(t0) {
|
|
|
13459
13495
|
const { schema } = t0;
|
|
13460
13496
|
return schema;
|
|
13461
13497
|
}
|
|
13462
|
-
|
|
13463
|
-
//#region src/components/PathLink/PathLink.tsx
|
|
13498
|
+
// src/components/PathLink/PathLink.tsx
|
|
13464
13499
|
/**
|
|
13465
13500
|
* The path link component creates a link (although typically rendered as a `<button>`) to a part of
|
|
13466
13501
|
* the form identified by the provided path. It is built on top of the [`Link`
|
|
@@ -13543,14 +13578,12 @@ function PathLink(t0) {
|
|
|
13543
13578
|
} else t7 = $[15];
|
|
13544
13579
|
return t7;
|
|
13545
13580
|
}
|
|
13546
|
-
|
|
13547
|
-
//#region src/components/PrintAction/PrintAction.tsx
|
|
13581
|
+
// src/components/PrintAction/PrintAction.tsx
|
|
13548
13582
|
/** Default “print” keybinds. */
|
|
13549
13583
|
var DEFAULT_PRINT_KEYBINDS = "$mod+P";
|
|
13550
13584
|
/**
|
|
13551
|
-
* Form action used to print the form application. Built on
|
|
13552
|
-
* [`
|
|
13553
|
-
* [`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.
|
|
13554
13587
|
*
|
|
13555
13588
|
* To print a whole form application, requires the `<FormApp>` component to be wrapped within a
|
|
13556
13589
|
* `<Printer>`, and for the `<PrinterContent>` to wrap all annexes, pages, and form controls.
|
|
@@ -13695,8 +13728,7 @@ function PrintAction(t0) {
|
|
|
13695
13728
|
} else t7 = $[27];
|
|
13696
13729
|
return t7;
|
|
13697
13730
|
}
|
|
13698
|
-
|
|
13699
|
-
//#region src/components/RadioGroupControl/RadioGroupControlItem.tsx
|
|
13731
|
+
// src/components/RadioGroupControl/RadioGroupControlItem.tsx
|
|
13700
13732
|
/**
|
|
13701
13733
|
* Definition of a radio group control item.
|
|
13702
13734
|
*
|
|
@@ -13706,8 +13738,7 @@ function PrintAction(t0) {
|
|
|
13706
13738
|
function RadioGroupControlItem(_props) {
|
|
13707
13739
|
return null;
|
|
13708
13740
|
}
|
|
13709
|
-
|
|
13710
|
-
//#region src/components/RadioGroupControl/RadioGroupControl.tsx
|
|
13741
|
+
// src/components/RadioGroupControl/RadioGroupControl.tsx
|
|
13711
13742
|
/**
|
|
13712
13743
|
* The radio group control component is a KForm form control for values with any type of (typically
|
|
13713
13744
|
* [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
|
|
@@ -14151,8 +14182,7 @@ function _temp$10(t0) {
|
|
|
14151
14182
|
...otherProps_0
|
|
14152
14183
|
};
|
|
14153
14184
|
}
|
|
14154
|
-
|
|
14155
|
-
//#region src/utils/useFormSaver.tsx
|
|
14185
|
+
// src/utils/useFormSaver.tsx
|
|
14156
14186
|
/** Hook exposing functions used to save the form to a file. */
|
|
14157
14187
|
function useFormSaver(t0) {
|
|
14158
14188
|
const $ = c(29);
|
|
@@ -14176,9 +14206,9 @@ function useFormSaver(t0) {
|
|
|
14176
14206
|
} else t2 = $[3];
|
|
14177
14207
|
const defaultId = t2;
|
|
14178
14208
|
let t3;
|
|
14179
|
-
if ($[4] !== _setState || $[5] !== addToast || $[6] !== defaultId || $[7] !== formManager || $[8] !== formTitle || $[9] !== getState || $[10] !== locale
|
|
14209
|
+
if ($[4] !== _setState || $[5] !== addToast || $[6] !== defaultId || $[7] !== formManager || $[8] !== formTitle || $[9] !== getState || $[10] !== locale) {
|
|
14180
14210
|
t3 = async function save(t4) {
|
|
14181
|
-
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;
|
|
14182
14212
|
const path_0 = t5 === void 0 ? AbsolutePath.ROOT : t5;
|
|
14183
14213
|
const id_0 = t6 === void 0 ? defaultId : t6;
|
|
14184
14214
|
const setPristineOnSave_0 = t7 === void 0 ? true : t7;
|
|
@@ -14186,14 +14216,17 @@ function useFormSaver(t0) {
|
|
|
14186
14216
|
const successMessage_0 = successMessageProp ?? locale.SaveAction.successMessage;
|
|
14187
14217
|
const errorMessage_0 = errorMessageProp ?? locale.SaveAction.errorMessage;
|
|
14188
14218
|
_setState({ saving: true });
|
|
14189
|
-
|
|
14190
|
-
|
|
14219
|
+
const previousFileHandle = getState().latestFileHandles?.[id_0] ?? null;
|
|
14220
|
+
const saveState = {
|
|
14221
|
+
fileHandle: previousFileHandle,
|
|
14222
|
+
started: false
|
|
14223
|
+
};
|
|
14191
14224
|
await withCleanup(async () => {
|
|
14192
14225
|
try {
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
const [encodedForm, suggestedFileName] = await formManager.get(path_0, (value) => Promise.all([encode_0(value),
|
|
14196
|
-
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, {
|
|
14197
14230
|
fileName: suggestedFileName || defaultFileName(formTitle, extensions_0?.[0]),
|
|
14198
14231
|
extensions: extensions_0,
|
|
14199
14232
|
description: description_0,
|
|
@@ -14201,25 +14234,25 @@ function useFormSaver(t0) {
|
|
|
14201
14234
|
startIn: startIn_0,
|
|
14202
14235
|
excludeAcceptAllOption: excludeAcceptAllOption_0,
|
|
14203
14236
|
id: id_0
|
|
14204
|
-
}, overwrite_0 ?
|
|
14237
|
+
}, overwrite_0 ? previousFileHandle : null);
|
|
14205
14238
|
if (setPristineOnSave_0) await formManager.setPristine(path_0);
|
|
14206
14239
|
_setState((state) => ({ latestFileHandles: {
|
|
14207
14240
|
...state.latestFileHandles,
|
|
14208
|
-
[id_0]:
|
|
14241
|
+
[id_0]: savedFileHandle
|
|
14209
14242
|
} }));
|
|
14210
14243
|
if (supported) {
|
|
14211
|
-
const message_0 = typeof successMessage_0 == "function" ? successMessage_0(
|
|
14244
|
+
const message_0 = typeof successMessage_0 == "function" ? successMessage_0(savedFileHandle) : successMessage_0;
|
|
14212
14245
|
if (message_0 != null) addToast(message_0, { severity: "success" });
|
|
14213
14246
|
}
|
|
14214
14247
|
} catch (t8) {
|
|
14215
14248
|
const error = t8;
|
|
14216
14249
|
if (error instanceof DOMException && error.name === "AbortError") return;
|
|
14217
14250
|
if (DEV) console.error(error);
|
|
14218
|
-
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;
|
|
14219
14252
|
if (message != null) addToast(message, { severity: "danger" });
|
|
14220
14253
|
}
|
|
14221
14254
|
}, () => withCleanup(async () => {
|
|
14222
|
-
if (
|
|
14255
|
+
if (saveState.started) await onAfterSave_0?.();
|
|
14223
14256
|
}, () => _setState({ saving: false })));
|
|
14224
14257
|
};
|
|
14225
14258
|
$[4] = _setState;
|
|
@@ -14229,13 +14262,11 @@ function useFormSaver(t0) {
|
|
|
14229
14262
|
$[8] = formTitle;
|
|
14230
14263
|
$[9] = getState;
|
|
14231
14264
|
$[10] = locale;
|
|
14232
|
-
$[11] =
|
|
14233
|
-
|
|
14234
|
-
$[13] = t3;
|
|
14235
|
-
} else t3 = $[13];
|
|
14265
|
+
$[11] = t3;
|
|
14266
|
+
} else t3 = $[11];
|
|
14236
14267
|
const save = t3;
|
|
14237
14268
|
let t4;
|
|
14238
|
-
if ($[
|
|
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) {
|
|
14239
14270
|
t4 = {
|
|
14240
14271
|
save: (t5) => {
|
|
14241
14272
|
return save({
|
|
@@ -14249,6 +14280,8 @@ function useFormSaver(t0) {
|
|
|
14249
14280
|
startIn,
|
|
14250
14281
|
excludeAcceptAllOption,
|
|
14251
14282
|
id,
|
|
14283
|
+
onBeforeSave,
|
|
14284
|
+
onAfterSave,
|
|
14252
14285
|
setPristineOnSave,
|
|
14253
14286
|
successMessage,
|
|
14254
14287
|
errorMessage,
|
|
@@ -14257,14 +14290,16 @@ function useFormSaver(t0) {
|
|
|
14257
14290
|
},
|
|
14258
14291
|
supportsFileSystemAPIs: supported
|
|
14259
14292
|
};
|
|
14260
|
-
$[
|
|
14261
|
-
$[
|
|
14262
|
-
$[
|
|
14263
|
-
$[
|
|
14264
|
-
$[
|
|
14265
|
-
$[
|
|
14266
|
-
$[
|
|
14267
|
-
$[
|
|
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;
|
|
14268
14303
|
$[22] = overwrite;
|
|
14269
14304
|
$[23] = path;
|
|
14270
14305
|
$[24] = save;
|
|
@@ -14286,19 +14321,15 @@ function _temp$9(state) {
|
|
|
14286
14321
|
function defaultFileName(formTitle, extension) {
|
|
14287
14322
|
return [[formTitle, formatISO(/* @__PURE__ */ new Date(), { representation: "date" })].filter(Boolean).join(" "), extension].filter(Boolean).join("");
|
|
14288
14323
|
}
|
|
14289
|
-
|
|
14290
|
-
//#region src/components/SaveAction/SaveAction.tsx
|
|
14324
|
+
// src/components/SaveAction/SaveAction.tsx
|
|
14291
14325
|
/** Default “save” keybinds. */
|
|
14292
14326
|
var DEFAULT_SAVE_KEYBINDS = "$mod+S";
|
|
14293
14327
|
/** Default “save as” keybinds. */
|
|
14294
14328
|
var DEFAULT_SAVE_AS_KEYBINDS = "$mod+Shift+S";
|
|
14295
14329
|
/**
|
|
14296
|
-
* Form action used to save the form to a file, supporting
|
|
14297
|
-
* behaviours (i.e. supporting both “save” and “save as”).
|
|
14298
|
-
*
|
|
14299
|
-
* [`Button`](/docs/ostack-ui-forms-button--docs), and
|
|
14300
|
-
* [`DropdownMenu`](/docs/ostack-ui-overlay-dropdown-menu--docs) components, as well as the
|
|
14301
|
-
* `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.
|
|
14302
14333
|
*
|
|
14303
14334
|
* Example usage:
|
|
14304
14335
|
*
|
|
@@ -14629,8 +14660,7 @@ function SaveAction(t0) {
|
|
|
14629
14660
|
} else t14 = $[103];
|
|
14630
14661
|
return t14;
|
|
14631
14662
|
}
|
|
14632
|
-
|
|
14633
|
-
//#region src/components/SelectControl/SelectControlItem.tsx
|
|
14663
|
+
// src/components/SelectControl/SelectControlItem.tsx
|
|
14634
14664
|
/**
|
|
14635
14665
|
* Definition of a select control item.
|
|
14636
14666
|
*
|
|
@@ -14640,8 +14670,7 @@ function SaveAction(t0) {
|
|
|
14640
14670
|
function SelectControlItem(_props) {
|
|
14641
14671
|
return null;
|
|
14642
14672
|
}
|
|
14643
|
-
|
|
14644
|
-
//#region src/components/SelectControl/SelectControlItemGroup.tsx
|
|
14673
|
+
// src/components/SelectControl/SelectControlItemGroup.tsx
|
|
14645
14674
|
/**
|
|
14646
14675
|
* Definition of a select control item group.
|
|
14647
14676
|
*
|
|
@@ -14651,8 +14680,7 @@ function SelectControlItem(_props) {
|
|
|
14651
14680
|
function SelectControlItemGroup(_props) {
|
|
14652
14681
|
return null;
|
|
14653
14682
|
}
|
|
14654
|
-
|
|
14655
|
-
//#region src/components/SelectControl/SelectControl.tsx
|
|
14683
|
+
// src/components/SelectControl/SelectControl.tsx
|
|
14656
14684
|
/**
|
|
14657
14685
|
* The select control component is a KForm form control for values with any type of (typically
|
|
14658
14686
|
* [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
|
|
@@ -15065,8 +15093,7 @@ function _temp$8(t0) {
|
|
|
15065
15093
|
...otherProps_0
|
|
15066
15094
|
};
|
|
15067
15095
|
}
|
|
15068
|
-
|
|
15069
|
-
//#region src/components/SelectMultipleControl/SelectMultipleControlItem.tsx
|
|
15096
|
+
// src/components/SelectMultipleControl/SelectMultipleControlItem.tsx
|
|
15070
15097
|
/**
|
|
15071
15098
|
* Definition of a select multiple control item.
|
|
15072
15099
|
*
|
|
@@ -15076,8 +15103,7 @@ function _temp$8(t0) {
|
|
|
15076
15103
|
function SelectMultipleControlItem(_props) {
|
|
15077
15104
|
return null;
|
|
15078
15105
|
}
|
|
15079
|
-
|
|
15080
|
-
//#region src/components/SelectMultipleControl/SelectMultipleControlItemGroup.tsx
|
|
15106
|
+
// src/components/SelectMultipleControl/SelectMultipleControlItemGroup.tsx
|
|
15081
15107
|
/**
|
|
15082
15108
|
* Definition of a select multiple control item group.
|
|
15083
15109
|
*
|
|
@@ -15088,8 +15114,7 @@ function SelectMultipleControlItem(_props) {
|
|
|
15088
15114
|
function SelectMultipleControlItemGroup(_props) {
|
|
15089
15115
|
return null;
|
|
15090
15116
|
}
|
|
15091
|
-
|
|
15092
|
-
//#region src/components/SelectMultipleControl/SelectMultipleControl.tsx
|
|
15117
|
+
// src/components/SelectMultipleControl/SelectMultipleControl.tsx
|
|
15093
15118
|
/**
|
|
15094
15119
|
* The select multiple control component is a KForm form control for values with (possibly
|
|
15095
15120
|
* [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
|
|
@@ -15510,15 +15535,14 @@ function _temp$7(t0) {
|
|
|
15510
15535
|
...otherProps_0
|
|
15511
15536
|
};
|
|
15512
15537
|
}
|
|
15513
|
-
|
|
15514
|
-
//#region src/components/SubmitAction/SubmitAction.tsx
|
|
15538
|
+
// src/components/SubmitAction/SubmitAction.tsx
|
|
15515
15539
|
/** Default “submit” keybinds. */
|
|
15516
15540
|
var DEFAULT_SUBMIT_KEYBINDS = "$mod+Enter";
|
|
15517
15541
|
/**
|
|
15518
|
-
* Form action used to submit a form, supporting all
|
|
15542
|
+
* Form [action](/docs/ostack-ui-layout-actions--docs) used to submit a form, supporting all
|
|
15543
|
+
* submission-related properties available in a
|
|
15519
15544
|
* [`FormApp`](/docs/ostack-ui-kform-layout-form-app--docs). Built on top of the
|
|
15520
|
-
* [
|
|
15521
|
-
* [AlertDialog](/docs/ostack-ui-overlay-alert-dialog--docs) components.
|
|
15545
|
+
* [AlertDialog](/docs/ostack-ui-overlay-alert-dialog--docs) component.
|
|
15522
15546
|
*
|
|
15523
15547
|
* Example usage:
|
|
15524
15548
|
*
|
|
@@ -16002,8 +16026,7 @@ function SubmitAction(t0) {
|
|
|
16002
16026
|
} else t20 = $[118];
|
|
16003
16027
|
return t20;
|
|
16004
16028
|
}
|
|
16005
|
-
|
|
16006
|
-
//#region src/components/TableControl/TableControlContext.ts
|
|
16029
|
+
// src/components/TableControl/TableControlContext.ts
|
|
16007
16030
|
/** Table control context. */
|
|
16008
16031
|
var TableControlContext = createContext(null);
|
|
16009
16032
|
/** Hook providing access to the table control context. */
|
|
@@ -16020,8 +16043,7 @@ function useTableControlRowContext() {
|
|
|
16020
16043
|
if (!tableControlRowContext) throw new Error("Table control row context not in scope.");
|
|
16021
16044
|
return tableControlRowContext;
|
|
16022
16045
|
}
|
|
16023
|
-
|
|
16024
|
-
//#region src/components/TableControl/TableControlCell.tsx
|
|
16046
|
+
// src/components/TableControl/TableControlCell.tsx
|
|
16025
16047
|
/** Cell of the table control. */
|
|
16026
16048
|
function TableControlCell(t0) {
|
|
16027
16049
|
const $ = c(11);
|
|
@@ -16065,8 +16087,7 @@ function _temp$6(t0) {
|
|
|
16065
16087
|
const { displayStatus } = t0;
|
|
16066
16088
|
return displayStatus;
|
|
16067
16089
|
}
|
|
16068
|
-
|
|
16069
|
-
//#region src/components/TableControl/TableControlColumn.tsx
|
|
16090
|
+
// src/components/TableControl/TableControlColumn.tsx
|
|
16070
16091
|
/**
|
|
16071
16092
|
* Definition of a table control column.
|
|
16072
16093
|
*
|
|
@@ -16076,8 +16097,7 @@ function _temp$6(t0) {
|
|
|
16076
16097
|
function TableControlColumn(_props) {
|
|
16077
16098
|
return null;
|
|
16078
16099
|
}
|
|
16079
|
-
|
|
16080
|
-
//#region src/components/TableControl/TableControlColumnGroup.tsx
|
|
16100
|
+
// src/components/TableControl/TableControlColumnGroup.tsx
|
|
16081
16101
|
/**
|
|
16082
16102
|
* Definition of a table control column group.
|
|
16083
16103
|
*
|
|
@@ -16087,8 +16107,7 @@ function TableControlColumn(_props) {
|
|
|
16087
16107
|
function TableControlColumnGroup(_props) {
|
|
16088
16108
|
return null;
|
|
16089
16109
|
}
|
|
16090
|
-
|
|
16091
|
-
//#region src/components/TableControl/TableControlColumns.tsx
|
|
16110
|
+
// src/components/TableControl/TableControlColumns.tsx
|
|
16092
16111
|
/**
|
|
16093
16112
|
* Container for the definition of all table control columns. This component must be a direct child
|
|
16094
16113
|
* of the `TableControl` component.
|
|
@@ -16099,8 +16118,7 @@ function TableControlColumnGroup(_props) {
|
|
|
16099
16118
|
function TableControlColumns(_props) {
|
|
16100
16119
|
return null;
|
|
16101
16120
|
}
|
|
16102
|
-
|
|
16103
|
-
//#region src/components/TableControl/TableControlRow.tsx
|
|
16121
|
+
// src/components/TableControl/TableControlRow.tsx
|
|
16104
16122
|
/** Row of a table control. */
|
|
16105
16123
|
function TableControlRow(t0) {
|
|
16106
16124
|
const $ = c(27);
|
|
@@ -16213,8 +16231,7 @@ function _temp$5(t0) {
|
|
|
16213
16231
|
const { path } = t0;
|
|
16214
16232
|
return path;
|
|
16215
16233
|
}
|
|
16216
|
-
|
|
16217
|
-
//#region src/components/TableControl/TableControl.tsx
|
|
16234
|
+
// src/components/TableControl/TableControl.tsx
|
|
16218
16235
|
/**
|
|
16219
16236
|
* The table control component is a KForm form control for values with (possibly
|
|
16220
16237
|
* [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
|
|
@@ -16793,22 +16810,19 @@ function TableControlCellRenderer(t0) {
|
|
|
16793
16810
|
} else t2 = $[2];
|
|
16794
16811
|
return t2;
|
|
16795
16812
|
}
|
|
16796
|
-
|
|
16797
|
-
//#region src/components/TableControl/TableControlActionsColumnLabel.tsx
|
|
16813
|
+
// src/components/TableControl/TableControlActionsColumnLabel.tsx
|
|
16798
16814
|
/** Default label of the table control's actions column. */
|
|
16799
16815
|
function TableControlActionsColumnLabel() {
|
|
16800
16816
|
const [locale] = useLocale();
|
|
16801
16817
|
return locale.TableControlActionsColumn.label;
|
|
16802
16818
|
}
|
|
16803
|
-
|
|
16804
|
-
//#region src/components/TableControl/TableControlIndexColumnLabel.tsx
|
|
16819
|
+
// src/components/TableControl/TableControlIndexColumnLabel.tsx
|
|
16805
16820
|
/** Default label of the table control's index column. */
|
|
16806
16821
|
function TableControlIndexColumnLabel() {
|
|
16807
16822
|
const [locale] = useLocale();
|
|
16808
16823
|
return locale.TableControlIndexColumn.label ?? "#";
|
|
16809
16824
|
}
|
|
16810
|
-
|
|
16811
|
-
//#region src/components/TableControl/TableControlRemoveRowTrigger.tsx
|
|
16825
|
+
// src/components/TableControl/TableControlRemoveRowTrigger.tsx
|
|
16812
16826
|
/**
|
|
16813
16827
|
* Trigger used to remove a row of a table controlled by a table control.
|
|
16814
16828
|
*
|
|
@@ -16962,8 +16976,7 @@ function _temp$3(t0) {
|
|
|
16962
16976
|
const { initialized } = t0;
|
|
16963
16977
|
return initialized;
|
|
16964
16978
|
}
|
|
16965
|
-
|
|
16966
|
-
//#region src/components/TableControl/TableControlColumnFns.tsx
|
|
16979
|
+
// src/components/TableControl/TableControlColumnFns.tsx
|
|
16967
16980
|
/**
|
|
16968
16981
|
* Pre-configured column used to display the index of each row. By default, it sticks to left of the
|
|
16969
16982
|
* table.
|
|
@@ -17042,8 +17055,7 @@ function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation,
|
|
|
17042
17055
|
...columnProps
|
|
17043
17056
|
};
|
|
17044
17057
|
}
|
|
17045
|
-
|
|
17046
|
-
//#region src/components/TableControl/TableControlActionsColumn.tsx
|
|
17058
|
+
// src/components/TableControl/TableControlActionsColumn.tsx
|
|
17047
17059
|
/**
|
|
17048
17060
|
* Pre-configured column used to display row actions. By default, it sticks to the right of the
|
|
17049
17061
|
* table and renders the `TableControlRemoveRowTrigger` component.
|
|
@@ -17057,35 +17069,14 @@ function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation,
|
|
|
17057
17069
|
* </TableControlActionsColumn>;
|
|
17058
17070
|
* ```
|
|
17059
17071
|
*/
|
|
17060
|
-
function TableControlActionsColumn(
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17064
|
-
|
|
17065
|
-
|
|
17066
|
-
|
|
17067
|
-
|
|
17068
|
-
...otherProps,
|
|
17069
|
-
render: render ?? children
|
|
17070
|
-
});
|
|
17071
|
-
$[0] = t0;
|
|
17072
|
-
$[1] = T0;
|
|
17073
|
-
$[2] = t1;
|
|
17074
|
-
} else {
|
|
17075
|
-
T0 = $[1];
|
|
17076
|
-
t1 = $[2];
|
|
17077
|
-
}
|
|
17078
|
-
let t2;
|
|
17079
|
-
if ($[3] !== T0 || $[4] !== t1) {
|
|
17080
|
-
t2 = /* @__PURE__ */ jsx(T0, { ...t1 });
|
|
17081
|
-
$[3] = T0;
|
|
17082
|
-
$[4] = t1;
|
|
17083
|
-
$[5] = t2;
|
|
17084
|
-
} else t2 = $[5];
|
|
17085
|
-
return t2;
|
|
17086
|
-
}
|
|
17087
|
-
//#endregion
|
|
17088
|
-
//#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
|
|
17089
17080
|
/** Trigger used to add a new row to a table control. */
|
|
17090
17081
|
function TableControlAddRowTrigger(t0) {
|
|
17091
17082
|
const $ = c(58);
|
|
@@ -17280,14 +17271,12 @@ function TableControlAddRowTrigger(t0) {
|
|
|
17280
17271
|
function _temp$2(state) {
|
|
17281
17272
|
return state.gettingRowValue;
|
|
17282
17273
|
}
|
|
17283
|
-
|
|
17284
|
-
//#region src/components/TableControl/TableControlApi.ts
|
|
17274
|
+
// src/components/TableControl/TableControlApi.ts
|
|
17285
17275
|
/** Hook used to access the table control API. */
|
|
17286
17276
|
function useTableControlApiRef() {
|
|
17287
17277
|
return useRef(null);
|
|
17288
17278
|
}
|
|
17289
|
-
|
|
17290
|
-
//#region src/components/TableControl/TableControlContent.tsx
|
|
17279
|
+
// src/components/TableControl/TableControlContent.tsx
|
|
17291
17280
|
/** Component containing the content of the table control. */
|
|
17292
17281
|
function TableControlContent(t0) {
|
|
17293
17282
|
const $ = c(33);
|
|
@@ -17410,49 +17399,25 @@ function _temp$1(t0) {
|
|
|
17410
17399
|
const { path } = t0;
|
|
17411
17400
|
return path;
|
|
17412
17401
|
}
|
|
17413
|
-
|
|
17414
|
-
//#region src/components/TableControl/TableControlIndexColumn.tsx
|
|
17402
|
+
// src/components/TableControl/TableControlIndexColumn.tsx
|
|
17415
17403
|
/**
|
|
17416
17404
|
* Pre-configured column used to display the index of each row. By default, it sticks to left of the
|
|
17417
17405
|
* table.
|
|
17418
17406
|
*/
|
|
17419
|
-
function TableControlIndexColumn(
|
|
17420
|
-
|
|
17421
|
-
|
|
17422
|
-
|
|
17423
|
-
|
|
17424
|
-
|
|
17425
|
-
|
|
17426
|
-
|
|
17427
|
-
...otherProps,
|
|
17428
|
-
render: render ?? children
|
|
17429
|
-
});
|
|
17430
|
-
$[0] = t0;
|
|
17431
|
-
$[1] = T0;
|
|
17432
|
-
$[2] = t1;
|
|
17433
|
-
} else {
|
|
17434
|
-
T0 = $[1];
|
|
17435
|
-
t1 = $[2];
|
|
17436
|
-
}
|
|
17437
|
-
let t2;
|
|
17438
|
-
if ($[3] !== T0 || $[4] !== t1) {
|
|
17439
|
-
t2 = /* @__PURE__ */ jsx(T0, { ...t1 });
|
|
17440
|
-
$[3] = T0;
|
|
17441
|
-
$[4] = t1;
|
|
17442
|
-
$[5] = t2;
|
|
17443
|
-
} else t2 = $[5];
|
|
17444
|
-
return t2;
|
|
17445
|
-
}
|
|
17446
|
-
//#endregion
|
|
17447
|
-
//#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
|
|
17448
17415
|
/** Table control pagination. */
|
|
17449
17416
|
var TableControlPagination = DataTablePagination;
|
|
17450
|
-
|
|
17451
|
-
//#region src/components/TableControl/TableControlRowsPerPage.tsx
|
|
17417
|
+
// src/components/TableControl/TableControlRowsPerPage.tsx
|
|
17452
17418
|
/** Table control rows per page. */
|
|
17453
17419
|
var TableControlRowsPerPage = DataTableRowsPerPage;
|
|
17454
|
-
|
|
17455
|
-
//#region src/components/TextControl/TextControl.tsx
|
|
17420
|
+
// src/components/TextControl/TextControl.tsx
|
|
17456
17421
|
/**
|
|
17457
17422
|
* The text control component is a KForm form control for values with (possibly
|
|
17458
17423
|
* [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
|
|
@@ -17828,13 +17793,12 @@ function _temp(t0) {
|
|
|
17828
17793
|
function parseText(formattedValue, state) {
|
|
17829
17794
|
return state.schema.typeInfo.nullable ? formattedValue || null : formattedValue;
|
|
17830
17795
|
}
|
|
17831
|
-
|
|
17832
|
-
//#region src/components/ValidateAction/ValidateAction.tsx
|
|
17796
|
+
// src/components/ValidateAction/ValidateAction.tsx
|
|
17833
17797
|
/** Default “validate” keybinds. */
|
|
17834
17798
|
var DEFAULT_VALIDATE_KEYBINDS = "Alt+Shift+V";
|
|
17835
17799
|
/**
|
|
17836
|
-
* Form action used to validate the form. Built on top of
|
|
17837
|
-
*
|
|
17800
|
+
* Form [action](/docs/ostack-ui-layout-actions--docs) used to validate the form. Built on top of
|
|
17801
|
+
* the `useFormValidator` hook.
|
|
17838
17802
|
*
|
|
17839
17803
|
* If the form contains an `IssuesPanel` component, it is shown as a result of triggering the
|
|
17840
17804
|
* action.
|
|
@@ -17961,7 +17925,6 @@ function ValidateAction(t0) {
|
|
|
17961
17925
|
} else t6 = $[29];
|
|
17962
17926
|
return t6;
|
|
17963
17927
|
}
|
|
17964
|
-
|
|
17965
|
-
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 };
|
|
17966
17929
|
|
|
17967
17930
|
//# sourceMappingURL=ostack-ui-kform.js.map
|