@ostack.tech/ui-kform 0.16.4 → 1.0.0-rc.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-CKrk2smU.js → en-D4xMcf6Q.js} +3 -2
- package/dist/chunks/{en-CKrk2smU.js.map → en-D4xMcf6Q.js.map} +1 -1
- package/dist/locales/en-GB.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/fr-FR.js +2 -1
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/index.js +5 -0
- package/dist/locales/pt-PT.js +2 -1
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui-kform.css +17 -1
- package/dist/ostack-ui-kform.js +163 -107
- package/dist/ostack-ui-kform.js.map +1 -1
- package/package.json +6 -2
- package/scss/components/Annexes/_Annexes.scss +6 -0
- package/scss/components/TopBar/_TopBar.scss +13 -1
- package/types/components/FileControl/FileControl.d.ts +1 -1
- package/types/components/LoadAction/LoadAction.d.ts +2 -5
- package/types/components/PrintAction/PrintAction.d.ts +2 -5
- package/types/components/SaveAction/SaveAction.d.ts +8 -10
- package/types/components/SubmitAction/SubmitAction.d.ts +2 -4
- package/types/components/TableControl/TableControl.d.ts +4 -1
- package/types/components/TableControl/TableControlAddRowTrigger.d.ts +2 -4
- package/types/components/TableControl/TableControlColumnFns.d.ts +4 -1
- package/types/components/TableControl/TableControlContent.d.ts +1 -1
- package/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +2 -2
- package/types/components/TopBar/TopBarActions.d.ts +4 -4
- package/types/components/TopBar/TopBarActionsSecondary.d.ts +6 -0
- package/types/components/TopBar/index.d.ts +1 -0
- package/types/components/ValidateAction/ValidateAction.d.ts +2 -5
- package/types/index.d.ts +0 -1
- package/types/providers/LocalizationProvider/LocalizationObject.d.ts +3 -2
package/dist/ostack-ui-kform.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import { locale } from "./locales/en-GB.js";
|
|
2
|
-
import { locale as locale$1 } from "./locales/en-US.js";
|
|
3
|
-
import { locale as locale$2 } from "./locales/fr-FR.js";
|
|
4
|
-
import { locale as locale$3 } from "./locales/pt-PT.js";
|
|
5
|
-
import { Alert, AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Button, ButtonGroup, 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, EMPTY_STORE, 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, combineEventHandlers, computed, controlStatusToAccent, cx, parseChildren, setBoolDataAttr, useAlertDialog, useCombinedRef, useConstant, useControllableState, useCssVars, useDataTableApiRef, useDataTableColumnLabel, useDateTransformer, useErrorReporter, useIntersectionObserver, useIsInRoot, useIsInTableCell, useKeyboardShortcut, useLatestRef, useMeasure, useMediaBreakpointUp, useOnLabelChange, usePrefix as usePrefix$1, usePrevious, usePrint, usePrintClassNames, usePrintInProgress, usePrinterDocumentTitle, usePrinting, useResponsiveValues, useScrollPosition, useSpacing, useStartPrintingTask, useToastManager, warnOnce } from "@ostack.tech/ui";
|
|
6
|
-
import { DEV } from "esm-env";
|
|
7
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
1
|
import { AtPathError, CurrentPath, FormContext, FormattedValue, InvalidPathError, equals, formatNumericAsString, formatTemporalAsString, toFileList, useController, useCurrentPath, useFileInput, useForm, useFormContext, useFormController, useFormManager, useFormattedValue, useFormatter, useInput, useIssuesTracker, useListableInput, useNumericInput, useResolvedPath, useTemporalInput } from "@ostack.tech/kform-react";
|
|
9
|
-
import {
|
|
2
|
+
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, EMPTY_STORE, 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, combineEventHandlers, computed, controlStatusToAccent, cx, parseChildren, setBoolDataAttr, useActionsContext, useAlertDialog, 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, useResponsiveValues, useScrollPosition, useSpacing, useStartPrintingTask, useToastManager, warnOnce } from "@ostack.tech/ui";
|
|
3
|
+
import { Children, Fragment, Suspense, createContext, isValidElement, startTransition, useCallback, useContext, useDeferredValue, useEffect, useEffectEvent, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
10
4
|
import { createStore, useStore } from "zustand";
|
|
11
5
|
import { useShallow } from "zustand/react/shallow";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
7
|
import { AbsolutePath, AbsolutePathFragment, Path, PathMultimap, PromiseCancellationException, ValidationFailure, ValueEvent, arrayToTable, compareSchemaPaths, isComputedSchema, isKtList, isTable, nullableSchemaInnerSchema, sliceTableRows, tableIdsToArray, tableRowsToArray, tableSize } from "@ostack.tech/kform";
|
|
13
8
|
import { subscribeWithSelector } from "zustand/middleware";
|
|
14
9
|
import { shallow } from "zustand/shallow";
|
|
15
10
|
import { fileOpen, fileSave, supported } from "browser-fs-access";
|
|
16
|
-
import {
|
|
11
|
+
import { DEV } from "esm-env";
|
|
12
|
+
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";
|
|
17
13
|
import { addDays, format, formatISO, max, min, parseISO } from "date-fns";
|
|
18
14
|
import { faCircleCheck as faCircleCheck$1 } from "@fortawesome/free-regular-svg-icons";
|
|
19
15
|
//#region src/providers/PrefixSuffixProvider/defaultPrefixSuffix.ts
|
|
@@ -1387,7 +1383,7 @@ function AnnexRegistrar({ path, title, subtitle, description, issuesPanelLabel,
|
|
|
1387
1383
|
useRegisterController(controller);
|
|
1388
1384
|
useRegisterLabel(absolutePath, /* @__PURE__ */ jsx(CurrentPath, {
|
|
1389
1385
|
path: absolutePath,
|
|
1390
|
-
children: isRepetitive ? typeof itemIssuesPanelLabel === "function" ? deferredValue === void 0 ? null : itemIssuesPanelLabel(deferredValue, index) : itemIssuesPanelLabel === void 0 ? actualSubtitle ?? index + 1 : itemIssuesPanelLabel : issuesPanelLabel ? typeof issuesPanelLabel === "function" ? deferredValue === void 0 ? null : issuesPanelLabel(deferredValue) : issuesPanelLabel : /* @__PURE__ */ jsxs(Fragment, { children: [actualTitle, actualSubtitle && /* @__PURE__ */ jsxs(Fragment, { children: [" — ", actualSubtitle] })] })
|
|
1386
|
+
children: isRepetitive ? typeof itemIssuesPanelLabel === "function" ? deferredValue === void 0 ? null : itemIssuesPanelLabel(deferredValue, index) : itemIssuesPanelLabel === void 0 ? actualSubtitle ?? index + 1 : itemIssuesPanelLabel : issuesPanelLabel ? typeof issuesPanelLabel === "function" ? deferredValue === void 0 ? null : issuesPanelLabel(deferredValue) : issuesPanelLabel : /* @__PURE__ */ jsxs(Fragment$1, { children: [actualTitle, actualSubtitle && /* @__PURE__ */ jsxs(Fragment$1, { children: [" — ", actualSubtitle] })] })
|
|
1391
1387
|
}));
|
|
1392
1388
|
return null;
|
|
1393
1389
|
}
|
|
@@ -1728,19 +1724,20 @@ function IssuesPopover({ path, relevantPaths, defaultOpen, open: controlledOpen,
|
|
|
1728
1724
|
label ??= locale.IssuesPopover.label;
|
|
1729
1725
|
const absolutePath = useResolvedPath(path);
|
|
1730
1726
|
const [open, setOpen] = useControllableState(defaultOpen, controlledOpen);
|
|
1731
|
-
const
|
|
1727
|
+
const isInFeedbackProvider = useIsInFeedbackProvider();
|
|
1728
|
+
const handleOpenChange = combineEventHandlers(onOpenChange, setOpen);
|
|
1732
1729
|
useOnPathFocus(useCallback((focusedPath) => {
|
|
1733
|
-
if ((relevantPaths ?? [absolutePath]).some((path) => focusedPath.equals(new AbsolutePath(path))))
|
|
1730
|
+
if ((relevantPaths ?? [absolutePath]).some((path) => focusedPath.equals(new AbsolutePath(path)))) handleOpenChange(true);
|
|
1734
1731
|
}, [
|
|
1735
1732
|
relevantPaths,
|
|
1736
1733
|
absolutePath,
|
|
1737
|
-
|
|
1738
|
-
]), { enabled: !
|
|
1734
|
+
handleOpenChange
|
|
1735
|
+
]), { enabled: !isInFeedbackProvider });
|
|
1739
1736
|
return /* @__PURE__ */ jsx(CurrentPath, {
|
|
1740
1737
|
path: absolutePath,
|
|
1741
1738
|
children: /* @__PURE__ */ jsx(FeedbackPopover, {
|
|
1742
1739
|
open,
|
|
1743
|
-
onOpenChange:
|
|
1740
|
+
onOpenChange: handleOpenChange,
|
|
1744
1741
|
label,
|
|
1745
1742
|
...otherProps
|
|
1746
1743
|
})
|
|
@@ -1807,20 +1804,38 @@ function TopBar({ className, ref, ...otherProps }) {
|
|
|
1807
1804
|
}
|
|
1808
1805
|
//#endregion
|
|
1809
1806
|
//#region src/components/TopBar/TopBarActions.tsx
|
|
1810
|
-
/** Container
|
|
1811
|
-
function TopBarActions({ className, children, ...otherProps }) {
|
|
1807
|
+
/** Container of the top bar actions. */
|
|
1808
|
+
function TopBarActions({ className, containerProps, children, ...otherProps }) {
|
|
1812
1809
|
const prefix = usePrefix();
|
|
1813
1810
|
const issuesDisplayMode = useIssuesDisplayMode();
|
|
1814
|
-
return /* @__PURE__ */ jsxs(
|
|
1811
|
+
return /* @__PURE__ */ jsxs(Actions, {
|
|
1815
1812
|
className: cx(prefix("top-bar__actions"), className),
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1813
|
+
primaryLayout: {
|
|
1814
|
+
xs: ["horizontal", "vertical"],
|
|
1815
|
+
sm: "horizontal"
|
|
1816
|
+
},
|
|
1817
|
+
secondaryLayout: {
|
|
1818
|
+
xs: "dropdown",
|
|
1819
|
+
md: ["vertical", "dropdown"]
|
|
1820
|
+
},
|
|
1821
|
+
containerProps: {
|
|
1822
|
+
...containerProps,
|
|
1823
|
+
className: cx(prefix("top-bar__actions-container"), containerProps?.className)
|
|
1824
|
+
},
|
|
1819
1825
|
...otherProps,
|
|
1820
1826
|
children: [issuesDisplayMode === "inline" && /* @__PURE__ */ jsx(IssuesPopover, { children: /* @__PURE__ */ jsx(IssueMessages, {}) }), children]
|
|
1821
1827
|
});
|
|
1822
1828
|
}
|
|
1823
1829
|
//#endregion
|
|
1830
|
+
//#region src/components/TopBar/TopBarActionsSecondary.tsx
|
|
1831
|
+
/** Container of the secondary top bar actions. */
|
|
1832
|
+
function TopBarActionsSecondary(props) {
|
|
1833
|
+
return /* @__PURE__ */ jsx(ActionsSecondary, {
|
|
1834
|
+
color: "success",
|
|
1835
|
+
...props
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
//#endregion
|
|
1824
1839
|
//#region src/components/Annexes/AnnexesMenu.tsx
|
|
1825
1840
|
/** Component that allows to navigate between, add, and remove annexes. */
|
|
1826
1841
|
function AnnexesMenu({ menuButtonText, menuButtonLabel, addAnnexText, removeAnnexButtonLabel, removeAnnexKeyboardHint, removeAnnexConfirmDialogTitle, removeAnnexConfirmDialogMessage, removeAnnexConfirmDialogOkText, removeAnnexConfirmDialogCancelText, defaultOpen = false, open: controlledOpen, onOpenChange, menuTriggerProps, menuContentProps, ...otherProps }) {
|
|
@@ -1941,7 +1956,7 @@ function AnnexesMenuItem({ removeAnnexButtonLabel, removeAnnexKeyboardHint, remo
|
|
|
1941
1956
|
...formContext,
|
|
1942
1957
|
currentPath: path
|
|
1943
1958
|
},
|
|
1944
|
-
children: removeAnnexConfirmDialogMessage?.(/* @__PURE__ */ jsxs("strong", { children: [state.title, state.subtitle && /* @__PURE__ */ jsxs(Fragment, { children: [" — ", state.subtitle] })] }))
|
|
1959
|
+
children: removeAnnexConfirmDialogMessage?.(/* @__PURE__ */ jsxs("strong", { children: [state.title, state.subtitle && /* @__PURE__ */ jsxs(Fragment$1, { children: [" — ", state.subtitle] })] }))
|
|
1945
1960
|
}), {
|
|
1946
1961
|
title: removeAnnexConfirmDialogTitle,
|
|
1947
1962
|
color: "danger",
|
|
@@ -1984,7 +1999,7 @@ function AnnexesMenuItem({ removeAnnexButtonLabel, removeAnnexKeyboardHint, remo
|
|
|
1984
1999
|
className: prefix("annexes__menu-annex-description"),
|
|
1985
2000
|
children: [/* @__PURE__ */ jsx(VisuallyHidden, { children: ", " }), nonRepetitiveDescription]
|
|
1986
2001
|
})]
|
|
1987
|
-
}), isRemovable && !formIsReadOnly && /* @__PURE__ */ jsxs(Fragment, { children: [removeAnnexKeyboardHint && /* @__PURE__ */ jsx(VisuallyHidden, { children: removeAnnexKeyboardHint }), /* @__PURE__ */ jsx(IconButton, {
|
|
2002
|
+
}), isRemovable && !formIsReadOnly && /* @__PURE__ */ jsxs(Fragment$1, { children: [removeAnnexKeyboardHint && /* @__PURE__ */ jsx(VisuallyHidden, { children: removeAnnexKeyboardHint }), /* @__PURE__ */ jsx(IconButton, {
|
|
1988
2003
|
className: prefix("annexes__menu-annex-remove"),
|
|
1989
2004
|
icon: faTrash,
|
|
1990
2005
|
label: removeAnnexButtonLabel ?? "",
|
|
@@ -2088,7 +2103,7 @@ function AnnexTab({ path }) {
|
|
|
2088
2103
|
const handleIssuesPopoverOpenAutoFocus = useCallback((evt) => {
|
|
2089
2104
|
if (tabFocused) evt.preventDefault();
|
|
2090
2105
|
}, [tabFocused]);
|
|
2091
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2106
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2092
2107
|
/* @__PURE__ */ jsx(Tab, {
|
|
2093
2108
|
className: prefix("annexes__tab"),
|
|
2094
2109
|
value: path.toString(),
|
|
@@ -2142,6 +2157,7 @@ function AnnexesTabList({ hideNonActiveOnSmallScreens, rootProps, className, ...
|
|
|
2142
2157
|
const store = useAnnexesContext();
|
|
2143
2158
|
const activeAnnex = useStore(store, (state) => state.activeAnnex);
|
|
2144
2159
|
const tabStates = useStore(store, useShallow((state) => state.tabStates()));
|
|
2160
|
+
const printing = usePrinting();
|
|
2145
2161
|
const isLargeScreen = useMediaBreakpointUp("sm");
|
|
2146
2162
|
return /* @__PURE__ */ jsx(TabList, {
|
|
2147
2163
|
className: cx(prefix("annexes__tab-list"), className),
|
|
@@ -2150,7 +2166,7 @@ function AnnexesTabList({ hideNonActiveOnSmallScreens, rootProps, className, ...
|
|
|
2150
2166
|
className: cx(prefix("annexes__tab-list-root"), rootProps?.className)
|
|
2151
2167
|
},
|
|
2152
2168
|
...otherProps,
|
|
2153
|
-
children: tabStates.map((state) => !hideNonActiveOnSmallScreens || isLargeScreen || state.path.equals(activeAnnex) ? /* @__PURE__ */ jsx(AnnexTab, { ...state }, state.path.toString()) : null)
|
|
2169
|
+
children: tabStates.map((state) => printing || !hideNonActiveOnSmallScreens || isLargeScreen || state.path.equals(activeAnnex) ? /* @__PURE__ */ jsx(AnnexTab, { ...state }, state.path.toString()) : null)
|
|
2154
2170
|
});
|
|
2155
2171
|
}
|
|
2156
2172
|
//#endregion
|
|
@@ -2359,7 +2375,7 @@ function useRegisterControl({ controller, issuesPanelLabel, ariaLabel, issuesPan
|
|
|
2359
2375
|
/** Hook used to register a label for all control field's controls. */
|
|
2360
2376
|
function useRegisterFieldLabel(path, issuesPanelLabelSuffix) {
|
|
2361
2377
|
const { store: formAppStore } = useFormAppContext();
|
|
2362
|
-
useOnLabelChange(useCallback((label) => formAppStore.getState().actions.registerLabel(path, label && issuesPanelLabelSuffix ? /* @__PURE__ */ jsxs(Fragment, { children: [label, issuesPanelLabelSuffix] }) : label), [
|
|
2378
|
+
useOnLabelChange(useCallback((label) => formAppStore.getState().actions.registerLabel(path, label && issuesPanelLabelSuffix ? /* @__PURE__ */ jsxs(Fragment$1, { children: [label, issuesPanelLabelSuffix] }) : label), [
|
|
2363
2379
|
formAppStore,
|
|
2364
2380
|
issuesPanelLabelSuffix,
|
|
2365
2381
|
path
|
|
@@ -2411,7 +2427,7 @@ function DebugInfo({ defaultOpen, open, onOpenChange, path = Path.CURRENT_DEEP,
|
|
|
2411
2427
|
/* @__PURE__ */ jsx(DescriptionListItem, {
|
|
2412
2428
|
xs: 6,
|
|
2413
2429
|
term: "Validations",
|
|
2414
|
-
children: schema.validations.length > 0 ? schema.validations.map((validation, i) => /* @__PURE__ */ jsxs(Fragment
|
|
2430
|
+
children: schema.validations.length > 0 ? schema.validations.map((validation, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i !== 0 && ", ", /* @__PURE__ */ jsx(Code, { children: validation.toString() })] }, i)) : empty
|
|
2415
2431
|
}),
|
|
2416
2432
|
/* @__PURE__ */ jsx(DescriptionListItem, {
|
|
2417
2433
|
xs: 6,
|
|
@@ -2431,7 +2447,7 @@ function DebugInfo({ defaultOpen, open, onOpenChange, path = Path.CURRENT_DEEP,
|
|
|
2431
2447
|
/* @__PURE__ */ jsx(DescriptionListItem, {
|
|
2432
2448
|
xs: 6,
|
|
2433
2449
|
term: "Issues",
|
|
2434
|
-
children: issues && issues.length > 0 ? issues.map((issue, i) => /* @__PURE__ */ jsxs(Fragment
|
|
2450
|
+
children: issues && issues.length > 0 ? issues.map((issue, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i !== 0 && ", ", /* @__PURE__ */ jsx(Code, {
|
|
2435
2451
|
color: issue.severity === "error" ? "danger" : "warning",
|
|
2436
2452
|
children: issue.code
|
|
2437
2453
|
})] }, i)) : empty
|
|
@@ -2741,7 +2757,7 @@ function CheckboxControl({ path, issueMessages, issuesPanelLabel, displayIssues
|
|
|
2741
2757
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
2742
2758
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
2743
2759
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
2744
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2760
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2745
2761
|
popoverIssues,
|
|
2746
2762
|
endAdornment,
|
|
2747
2763
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, { path: absolutePath })
|
|
@@ -2830,8 +2846,8 @@ function UnknownValue({ value, label }) {
|
|
|
2830
2846
|
label ??= locale.UnknownValue.label;
|
|
2831
2847
|
const prefix = usePrefix();
|
|
2832
2848
|
const valueStr = value == null ? "" : String(value);
|
|
2833
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2834
|
-
valueStr && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2849
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2850
|
+
valueStr && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2835
2851
|
"“",
|
|
2836
2852
|
/* @__PURE__ */ jsx("span", {
|
|
2837
2853
|
className: prefix("unknown-value"),
|
|
@@ -2839,7 +2855,7 @@ function UnknownValue({ value, label }) {
|
|
|
2839
2855
|
}),
|
|
2840
2856
|
"”"
|
|
2841
2857
|
] }),
|
|
2842
|
-
valueStr && label && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }),
|
|
2858
|
+
valueStr && label && /* @__PURE__ */ jsx(Fragment$1, { children: "\xA0" }),
|
|
2843
2859
|
label && /* @__PURE__ */ jsxs("span", {
|
|
2844
2860
|
className: prefix("unknown-value__label"),
|
|
2845
2861
|
children: [
|
|
@@ -2985,7 +3001,7 @@ function CheckboxGroupControl({ path, options, issueMessages, issuesPanelLabel,
|
|
|
2985
3001
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
2986
3002
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
2987
3003
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
2988
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3004
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2989
3005
|
popoverIssues,
|
|
2990
3006
|
endAdornment,
|
|
2991
3007
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, { path: absolutePath })
|
|
@@ -3134,7 +3150,7 @@ function DateControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
3134
3150
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
3135
3151
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
3136
3152
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
3137
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3153
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3138
3154
|
popoverIssues,
|
|
3139
3155
|
endAdornment,
|
|
3140
3156
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -3302,11 +3318,11 @@ function DateRangeControl({ startPath, endPath, startIssueMessages, endIssueMess
|
|
|
3302
3318
|
onFocus: combineEventHandlers(endInputProps?.onFocus, handleEndFocus),
|
|
3303
3319
|
ref: useCombinedRef(endControllerInputProps?.ref, useCombinedRef(endAutofocusRef, endInputProps?.ref))
|
|
3304
3320
|
},
|
|
3305
|
-
startMiddleAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [startMiddleAdornment, (DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
3321
|
+
startMiddleAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [startMiddleAdornment, (DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
3306
3322
|
path: startAbsolutePath,
|
|
3307
3323
|
children: /* @__PURE__ */ jsx(DebugInfoControlAddonTrigger, {})
|
|
3308
3324
|
})] }),
|
|
3309
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3325
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3310
3326
|
popoverIssues,
|
|
3311
3327
|
endAdornment,
|
|
3312
3328
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -3487,7 +3503,7 @@ function FileControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
3487
3503
|
onClick: combineEventHandlers(clearButtonProps?.onClick, handleClearButtonClick),
|
|
3488
3504
|
ref: useCombinedRef(clearButtonProps?.ref, clearButtonRef)
|
|
3489
3505
|
},
|
|
3490
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3506
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3491
3507
|
popoverIssues,
|
|
3492
3508
|
endAdornment,
|
|
3493
3509
|
fileInteraction === "view" && file && /* @__PURE__ */ jsx(FileControlViewAddon, {
|
|
@@ -3627,7 +3643,7 @@ function FormPageHeader({ helperText, helperButtonLabel, ownIssueMessages, codeP
|
|
|
3627
3643
|
className: cx(prefix("form-pages__page-code"), codeProps?.className),
|
|
3628
3644
|
"data-status": displayStatusToControlStatus(deferredDisplayStatus),
|
|
3629
3645
|
"data-accent": controlStatusToAccent(displayStatusToControlStatus(deferredDisplayStatus)),
|
|
3630
|
-
children: code != null && typeof code !== "boolean" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3646
|
+
children: code != null && typeof code !== "boolean" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3631
3647
|
visuallyHiddenCodePrefix && /* @__PURE__ */ jsxs(VisuallyHidden, { children: [visuallyHiddenCodePrefix, " "] }),
|
|
3632
3648
|
code,
|
|
3633
3649
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: ", " })
|
|
@@ -4024,7 +4040,7 @@ function FormPageSidebarItem({ path }) {
|
|
|
4024
4040
|
"data-selected": boolDataAttr(isSelected),
|
|
4025
4041
|
"data-status": displayStatusToControlStatus(deferredDisplayStatus),
|
|
4026
4042
|
"data-accent": controlStatusToAccent(displayStatusToControlStatus(deferredDisplayStatus)),
|
|
4027
|
-
children: code != null && typeof code !== "boolean" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4043
|
+
children: code != null && typeof code !== "boolean" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4028
4044
|
visuallyHiddenCodePrefix && /* @__PURE__ */ jsxs(VisuallyHidden, { children: [visuallyHiddenCodePrefix, " "] }),
|
|
4029
4045
|
code,
|
|
4030
4046
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: ", " })
|
|
@@ -4540,7 +4556,7 @@ function IssuesPanelControls({ currentPagePath, nPages, currentPageIndex, curren
|
|
|
4540
4556
|
});
|
|
4541
4557
|
return /* @__PURE__ */ jsxs("div", {
|
|
4542
4558
|
className: prefix("issues-panel__controls"),
|
|
4543
|
-
children: [nPages > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4559
|
+
children: [nPages > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4544
4560
|
deferredValidating && /* @__PURE__ */ jsx(Spinner, {
|
|
4545
4561
|
...validatingSpinnerProps,
|
|
4546
4562
|
className: cx(prefix("issues-panel__validating-spinner"), validatingSpinnerProps?.className)
|
|
@@ -4638,7 +4654,7 @@ function IssuesPanelMessagesCard({ currentPagePath, currentPageController, issue
|
|
|
4638
4654
|
const [cardEl, setCardEl] = useState(null);
|
|
4639
4655
|
const headerRef = useRef(null);
|
|
4640
4656
|
useScrollPosition(cardEl, useCallback((scrollPosition) => setBoolDataAttr(headerRef.current, "stuck", (scrollPosition?.top ?? 0) > 0), []));
|
|
4641
|
-
const renderIssuesList = (severity) => (severity === "error" ? hasErrors : hasWarnings) && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
|
|
4657
|
+
const renderIssuesList = (severity) => (severity === "error" ? hasErrors : hasWarnings) && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("h3", {
|
|
4642
4658
|
className: prefix("issues-panel__issues-list-title"),
|
|
4643
4659
|
children: severity === "error" ? errorsLabel?.() : warningsLabel?.()
|
|
4644
4660
|
}), /* @__PURE__ */ jsx("ul", {
|
|
@@ -4679,7 +4695,7 @@ function IssuesPanelMessagesCard({ currentPagePath, currentPageController, issue
|
|
|
4679
4695
|
...loadingSpinnerProps,
|
|
4680
4696
|
className: cx(prefix("issues-panel__loading-spinner"), loadingSpinnerProps?.className)
|
|
4681
4697
|
}),
|
|
4682
|
-
initialized && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
4698
|
+
initialized && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
4683
4699
|
color: relevantColor,
|
|
4684
4700
|
size: "lg",
|
|
4685
4701
|
...iconProps,
|
|
@@ -4746,7 +4762,7 @@ function IssuesPanelSummaryCard({ issuesTrackerResult, errorsLabel, warningsLabe
|
|
|
4746
4762
|
...loadingSpinnerProps,
|
|
4747
4763
|
className: cx(prefix("issues-panel__loading-spinner"), loadingSpinnerProps?.className)
|
|
4748
4764
|
}),
|
|
4749
|
-
initialized && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
4765
|
+
initialized && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
4750
4766
|
color: relevantColor,
|
|
4751
4767
|
size: "lg",
|
|
4752
4768
|
...iconProps,
|
|
@@ -4756,7 +4772,7 @@ function IssuesPanelSummaryCard({ issuesTrackerResult, errorsLabel, warningsLabe
|
|
|
4756
4772
|
role: "status",
|
|
4757
4773
|
...titleProps,
|
|
4758
4774
|
className: cx(prefix("issues-panel__title"), titleProps?.className),
|
|
4759
|
-
children: [nPages === 0 && noIssuesMessage, nPages > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4775
|
+
children: [nPages === 0 && noIssuesMessage, nPages > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4760
4776
|
errors > 0 && errorsLabel?.(errors),
|
|
4761
4777
|
errors > 0 && warnings > 0 && ", ",
|
|
4762
4778
|
warnings > 0 && warningsLabel?.(warnings)
|
|
@@ -5061,16 +5077,17 @@ function LoadAction({ label, keybinds, showWhenReadOnly, fileSystemId, loading,
|
|
|
5061
5077
|
target: formAppEl,
|
|
5062
5078
|
preventDefault: true
|
|
5063
5079
|
});
|
|
5064
|
-
|
|
5065
|
-
|
|
5080
|
+
const { secondary } = useActionsContext() ?? {};
|
|
5081
|
+
return showAction && /* @__PURE__ */ jsx(Action, {
|
|
5082
|
+
layout: secondary ? void 0 : "vertical",
|
|
5083
|
+
label,
|
|
5066
5084
|
variant: "subtle",
|
|
5067
5085
|
icon: faFolderOpen,
|
|
5068
5086
|
...otherProps,
|
|
5069
5087
|
onClick: combineEventHandlers(() => load(), onClick),
|
|
5070
5088
|
disabled: showDisabled,
|
|
5071
5089
|
loading: showLoading,
|
|
5072
|
-
keybinds
|
|
5073
|
-
children: label
|
|
5090
|
+
keybinds
|
|
5074
5091
|
});
|
|
5075
5092
|
}
|
|
5076
5093
|
//#endregion
|
|
@@ -5187,7 +5204,7 @@ function NumericControl({ path, issueMessages, issuesPanelLabel, displayIssues =
|
|
|
5187
5204
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
5188
5205
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5189
5206
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
5190
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5207
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5191
5208
|
popoverIssues,
|
|
5192
5209
|
endAdornment,
|
|
5193
5210
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -5307,17 +5324,18 @@ function PrintAction({ label, keybinds, showWhenReadOnly = true, disabled, loadi
|
|
|
5307
5324
|
target: formAppEl,
|
|
5308
5325
|
preventDefault: true
|
|
5309
5326
|
});
|
|
5327
|
+
const { secondary } = useActionsContext() ?? {};
|
|
5310
5328
|
return showAction && /* @__PURE__ */ jsx(PrinterTrigger, {
|
|
5311
5329
|
onClick: combineEventHandlers(onClick, handlePrint, { checkDefaultPrevented: true }),
|
|
5312
|
-
children: /* @__PURE__ */ jsx(
|
|
5313
|
-
|
|
5330
|
+
children: /* @__PURE__ */ jsx(Action, {
|
|
5331
|
+
label,
|
|
5332
|
+
layout: secondary ? void 0 : "vertical",
|
|
5314
5333
|
variant: "subtle",
|
|
5315
5334
|
icon: faPrint,
|
|
5316
5335
|
...otherProps,
|
|
5317
5336
|
disabled: showDisabled,
|
|
5318
5337
|
loading: showLoading,
|
|
5319
|
-
keybinds
|
|
5320
|
-
children: label
|
|
5338
|
+
keybinds
|
|
5321
5339
|
})
|
|
5322
5340
|
});
|
|
5323
5341
|
}
|
|
@@ -5438,7 +5456,7 @@ function RadioGroupControl({ path, options, issueMessages, issuesPanelLabel, dis
|
|
|
5438
5456
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5439
5457
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
5440
5458
|
showClearButton: showClearButton === "auto" ? formattedValue !== clearedFormattedValue : showClearButton,
|
|
5441
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5459
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5442
5460
|
popoverIssues,
|
|
5443
5461
|
endAdornment,
|
|
5444
5462
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, { path: absolutePath })
|
|
@@ -5589,7 +5607,7 @@ var DEFAULT_SAVE_AS_KEYBINDS = "$mod+Shift+S";
|
|
|
5589
5607
|
* }
|
|
5590
5608
|
* ```
|
|
5591
5609
|
*/
|
|
5592
|
-
function SaveAction({ label, keybinds, showWhenReadOnly = true, fileSystemId, disableOverwrite, saveOptionsLabel, saveAsLabel, saveAsKeybinds, loading, disabled, onClick, variant = "subtle", color, path, encode, fileName, extensions, description, mimeTypes, startIn, excludeAcceptAllOption, successMessage, errorMessage, saveOptionsProps,
|
|
5610
|
+
function SaveAction({ label, keybinds, showWhenReadOnly = true, fileSystemId, disableOverwrite, saveOptionsLabel, saveAsLabel, saveAsKeybinds, loading, disabled, onClick, variant = "subtle", color, path, encode, fileName, extensions, description, mimeTypes, startIn, excludeAcceptAllOption, successMessage, errorMessage, groupCollapsed, defaultOpen, open, onOpenChange, modal, groupLabel, saveOptionsPlacement, buttonGroupProps, saveOptionsProps, dropdownMenuGroupProps, dropdownMenuContentProps, ...otherProps }) {
|
|
5593
5611
|
const [locale] = useLocale();
|
|
5594
5612
|
label ??= locale.SaveAction.label;
|
|
5595
5613
|
if (keybinds === void 0) keybinds = locale.SaveAction.keybinds ?? "$mod+S";
|
|
@@ -5628,8 +5646,9 @@ function SaveAction({ label, keybinds, showWhenReadOnly = true, fileSystemId, di
|
|
|
5628
5646
|
target: formAppEl,
|
|
5629
5647
|
preventDefault: true
|
|
5630
5648
|
});
|
|
5631
|
-
const
|
|
5632
|
-
|
|
5649
|
+
const { secondary } = useActionsContext() ?? {};
|
|
5650
|
+
const saveActionProps = {
|
|
5651
|
+
layout: secondary ? void 0 : "vertical",
|
|
5633
5652
|
variant,
|
|
5634
5653
|
color,
|
|
5635
5654
|
icon: faFloppyDisk,
|
|
@@ -5638,30 +5657,36 @@ function SaveAction({ label, keybinds, showWhenReadOnly = true, fileSystemId, di
|
|
|
5638
5657
|
disabled: showDisabled,
|
|
5639
5658
|
loading: showLoading,
|
|
5640
5659
|
keybinds,
|
|
5641
|
-
|
|
5642
|
-
}
|
|
5643
|
-
return showAction && (supportsFileSystemAPIs && !disableOverwrite ? /* @__PURE__ */
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5660
|
+
label
|
|
5661
|
+
};
|
|
5662
|
+
return showAction && (supportsFileSystemAPIs && !disableOverwrite ? /* @__PURE__ */ jsx(ActionSplit, {
|
|
5663
|
+
...saveActionProps,
|
|
5664
|
+
groupCollapsed,
|
|
5665
|
+
defaultOpen,
|
|
5666
|
+
open,
|
|
5667
|
+
onOpenChange,
|
|
5668
|
+
modal,
|
|
5669
|
+
groupLabel,
|
|
5670
|
+
splitPlacement: saveOptionsPlacement,
|
|
5671
|
+
buttonGroupProps,
|
|
5672
|
+
dropdownMenuGroupProps,
|
|
5673
|
+
splitLabel: saveOptionsLabel,
|
|
5674
|
+
splitProps: {
|
|
5675
|
+
...saveOptionsProps,
|
|
5676
|
+
disabled: showDisabled || saveOptionsProps?.disabled
|
|
5677
|
+
},
|
|
5678
|
+
dropdownMenuContentProps: {
|
|
5679
|
+
align: "end",
|
|
5680
|
+
...dropdownMenuContentProps
|
|
5681
|
+
},
|
|
5682
|
+
children: /* @__PURE__ */ jsx(Action, {
|
|
5683
|
+
label: saveAsLabel,
|
|
5658
5684
|
onClick: () => save(),
|
|
5659
5685
|
disabled: showDisabled,
|
|
5660
5686
|
loading: showLoading,
|
|
5661
|
-
keybinds: saveAsKeybinds
|
|
5662
|
-
children: saveAsLabel
|
|
5687
|
+
keybinds: saveAsKeybinds
|
|
5663
5688
|
})
|
|
5664
|
-
})
|
|
5689
|
+
}) : /* @__PURE__ */ jsx(Action, { ...saveActionProps }));
|
|
5665
5690
|
}
|
|
5666
5691
|
//#endregion
|
|
5667
5692
|
//#region src/components/SelectControl/SelectControlItem.tsx
|
|
@@ -5804,7 +5829,7 @@ function SelectControl({ path, options: groupedOptions, issueMessages, issuesPan
|
|
|
5804
5829
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5805
5830
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
5806
5831
|
showClearButton: showClearButton === "auto" ? formattedValue !== clearedFormattedValue : showClearButton,
|
|
5807
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5832
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5808
5833
|
popoverIssues,
|
|
5809
5834
|
endAdornment,
|
|
5810
5835
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -5991,7 +6016,7 @@ function SelectMultipleControl({ path, options: groupedOptions, issueMessages, i
|
|
|
5991
6016
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
5992
6017
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5993
6018
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
5994
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6019
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5995
6020
|
popoverIssues,
|
|
5996
6021
|
endAdornment,
|
|
5997
6022
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -6155,7 +6180,8 @@ function SubmitAction({ onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedS
|
|
|
6155
6180
|
return showAction && /* @__PURE__ */ jsxs(AlertDialog, {
|
|
6156
6181
|
open: confirmingSubmission,
|
|
6157
6182
|
onOpenChange: handleOpenChange,
|
|
6158
|
-
children: [/* @__PURE__ */ jsx(AlertDialogTrigger, { children: /* @__PURE__ */ jsx(
|
|
6183
|
+
children: [/* @__PURE__ */ jsx(AlertDialogTrigger, { children: /* @__PURE__ */ jsx(Action, {
|
|
6184
|
+
label,
|
|
6159
6185
|
type: "submit",
|
|
6160
6186
|
color: "success",
|
|
6161
6187
|
icon: faArrowRight,
|
|
@@ -6164,8 +6190,7 @@ function SubmitAction({ onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedS
|
|
|
6164
6190
|
onClick: combineEventHandlers(onClick, handleAction),
|
|
6165
6191
|
disabled: showDisabled,
|
|
6166
6192
|
loading: showLoading,
|
|
6167
|
-
keybinds
|
|
6168
|
-
children: label
|
|
6193
|
+
keybinds
|
|
6169
6194
|
}) }), /* @__PURE__ */ jsx(AlertDialogContent, {
|
|
6170
6195
|
color: "primary",
|
|
6171
6196
|
...dialogContentProps,
|
|
@@ -6174,7 +6199,7 @@ function SubmitAction({ onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedS
|
|
|
6174
6199
|
container: formAppEl,
|
|
6175
6200
|
...dialogContentProps?.portalProps
|
|
6176
6201
|
},
|
|
6177
|
-
children: submissionInfo && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6202
|
+
children: submissionInfo && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6178
6203
|
/* @__PURE__ */ jsx(AlertDialogHeader, {
|
|
6179
6204
|
...dialogHeaderProps,
|
|
6180
6205
|
children: /* @__PURE__ */ jsx(AlertDialogTitle, {
|
|
@@ -6393,7 +6418,10 @@ function TableControlRow({ row, index, ...otherProps }) {
|
|
|
6393
6418
|
* <TableControlActionsColumn removeRowLabel="Remove item" />
|
|
6394
6419
|
* </TableControlColumns>
|
|
6395
6420
|
* <TableControlAddRowTrigger label="Add item" />
|
|
6396
|
-
* <TableControlContent
|
|
6421
|
+
* <TableControlContent
|
|
6422
|
+
* caption="Inventory"
|
|
6423
|
+
* emptyMessage="No items added."
|
|
6424
|
+
* />
|
|
6397
6425
|
* </TableControl>
|
|
6398
6426
|
* );
|
|
6399
6427
|
* }
|
|
@@ -6619,6 +6647,7 @@ function TableControlRemoveRowTrigger({ onConfirmRowRemoval, onRowRemoved, confi
|
|
|
6619
6647
|
const initialized = useInitialized();
|
|
6620
6648
|
const exists = useExists();
|
|
6621
6649
|
const setLatestInteraction = useSetLatestInteraction();
|
|
6650
|
+
const actionsContext = useActionsContext();
|
|
6622
6651
|
const [removing, setRemoving] = useState(false);
|
|
6623
6652
|
const handleClick = async () => {
|
|
6624
6653
|
setLatestInteraction(controller.getState().path);
|
|
@@ -6644,9 +6673,10 @@ function TableControlRemoveRowTrigger({ onConfirmRowRemoval, onRowRemoved, confi
|
|
|
6644
6673
|
disabled: !initialized || !exists || controlIsDisabled || disabled || controlIsReadOnly || removing && children !== void 0,
|
|
6645
6674
|
onClick: combineEventHandlers(onClick, handleClick, { checkDefaultPrevented: true })
|
|
6646
6675
|
};
|
|
6647
|
-
if (children === void 0) return /* @__PURE__ */ jsx(
|
|
6648
|
-
|
|
6676
|
+
if (children === void 0) return /* @__PURE__ */ jsx(Action, {
|
|
6677
|
+
layout: actionsContext ? void 0 : "icon",
|
|
6649
6678
|
label,
|
|
6679
|
+
icon: faTrash,
|
|
6650
6680
|
color: "danger",
|
|
6651
6681
|
loading: !initialized || removing,
|
|
6652
6682
|
circle: true,
|
|
@@ -6703,7 +6733,7 @@ function tableControlIndexColumn({ render, ...otherProps } = {}) {
|
|
|
6703
6733
|
* @param overrides Column properties used to display the actions of each row.
|
|
6704
6734
|
* @returns Table control column used to display the actions of each row.
|
|
6705
6735
|
*/
|
|
6706
|
-
function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation, onConfirmRowRemoval, onRowRemoved, confirmRowRemovalDialogMessage, removeRowProps, render, ...otherProps } = {}) {
|
|
6736
|
+
function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation, onConfirmRowRemoval, onRowRemoved, confirmRowRemovalDialogMessage, removeRowProps, render, actionsProps, ...otherProps } = {}) {
|
|
6707
6737
|
const [confirmRowRemovalDialogProps, columnProps] = extractConfirmDialogOptions(otherProps, "confirmRowRemovalDialog", "confirmDialog");
|
|
6708
6738
|
return {
|
|
6709
6739
|
label: /* @__PURE__ */ jsx(TableControlActionsColumnLabel, {}),
|
|
@@ -6713,15 +6743,31 @@ function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation,
|
|
|
6713
6743
|
align: "center",
|
|
6714
6744
|
showWhilePrinting: false,
|
|
6715
6745
|
showWhenReadOnly: false,
|
|
6716
|
-
render:
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6746
|
+
render: (...args) => {
|
|
6747
|
+
const removeRowTrigger = /* @__PURE__ */ jsx(TableControlRemoveRowTrigger, {
|
|
6748
|
+
label: removeRowLabel,
|
|
6749
|
+
showConfirmation: showRowRemovalConfirmation,
|
|
6750
|
+
onConfirmRowRemoval,
|
|
6751
|
+
onRowRemoved,
|
|
6752
|
+
confirmDialogMessage: confirmRowRemovalDialogMessage,
|
|
6753
|
+
...confirmRowRemovalDialogProps,
|
|
6754
|
+
...removeRowProps
|
|
6755
|
+
});
|
|
6756
|
+
return render ? /* @__PURE__ */ jsx(Actions, {
|
|
6757
|
+
primaryLayout: "icon",
|
|
6758
|
+
secondaryLayout: "dropdown",
|
|
6759
|
+
gap: 1,
|
|
6760
|
+
...actionsProps,
|
|
6761
|
+
containerProps: {
|
|
6762
|
+
...actionsProps?.containerProps,
|
|
6763
|
+
style: {
|
|
6764
|
+
justifyContent: "center",
|
|
6765
|
+
...actionsProps?.containerProps?.style
|
|
6766
|
+
}
|
|
6767
|
+
},
|
|
6768
|
+
children: typeof render === "function" ? render(...args) : render
|
|
6769
|
+
}) : removeRowTrigger;
|
|
6770
|
+
},
|
|
6725
6771
|
...columnProps
|
|
6726
6772
|
};
|
|
6727
6773
|
}
|
|
@@ -6759,6 +6805,7 @@ function TableControlAddRowTrigger({ disableWhileAdding, onRowAdded, preferRight
|
|
|
6759
6805
|
const controlIsDisabled = useFormIsDisabled();
|
|
6760
6806
|
const controlIsReadOnly = useFormIsReadOnly();
|
|
6761
6807
|
const setLatestInteraction = useSetLatestInteraction();
|
|
6808
|
+
const actionsContext = useActionsContext();
|
|
6762
6809
|
const gettingRowValue = controller.useState((state) => state.gettingRowValue);
|
|
6763
6810
|
const [adding, setAdding] = useState(false);
|
|
6764
6811
|
const handleClick = async () => {
|
|
@@ -6781,14 +6828,18 @@ function TableControlAddRowTrigger({ disableWhileAdding, onRowAdded, preferRight
|
|
|
6781
6828
|
};
|
|
6782
6829
|
if (children === void 0) {
|
|
6783
6830
|
const { defaultButtonText, label = defaultButtonText ?? locale.TableControlAddRowTrigger.label, ...buttonProps } = otherProps;
|
|
6784
|
-
return /* @__PURE__ */ jsx(
|
|
6831
|
+
return /* @__PURE__ */ jsx(Action, {
|
|
6832
|
+
layout: actionsContext ? void 0 : {
|
|
6833
|
+
xs: "vertical",
|
|
6834
|
+
sm: "horizontal"
|
|
6835
|
+
},
|
|
6836
|
+
label,
|
|
6785
6837
|
icon: faPlus,
|
|
6786
6838
|
color: "primary",
|
|
6787
6839
|
loading: gettingRowValue || adding && disableWhileAdding,
|
|
6788
6840
|
showSpinner: adding && !disableWhileAdding,
|
|
6789
6841
|
...buttonProps,
|
|
6790
|
-
...commonProps
|
|
6791
|
-
children: label
|
|
6842
|
+
...commonProps
|
|
6792
6843
|
});
|
|
6793
6844
|
}
|
|
6794
6845
|
return /* @__PURE__ */ jsx(Slot, {
|
|
@@ -6806,7 +6857,9 @@ function useTableControlApiRef() {
|
|
|
6806
6857
|
//#endregion
|
|
6807
6858
|
//#region src/components/TableControl/TableControlContent.tsx
|
|
6808
6859
|
/** Component containing the content of the table control. */
|
|
6809
|
-
function TableControlContent({ scrollableProps, ...otherProps }) {
|
|
6860
|
+
function TableControlContent({ emptyMessage, scrollableProps, ...otherProps }) {
|
|
6861
|
+
const [locale] = useLocale();
|
|
6862
|
+
emptyMessage ??= locale.TableControlContent.emptyMessage;
|
|
6810
6863
|
const { autofocusRef, handleFocus, controller, debug } = useTableControlContext();
|
|
6811
6864
|
const printing = usePrinting();
|
|
6812
6865
|
const absolutePath = controller.usePath();
|
|
@@ -6815,13 +6868,14 @@ function TableControlContent({ scrollableProps, ...otherProps }) {
|
|
|
6815
6868
|
const { initialized, exists, touched } = controller.getState();
|
|
6816
6869
|
if (initialized && exists && !touched) controller.setTouched();
|
|
6817
6870
|
}, [controller]);
|
|
6818
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [(DEV || false) && debug && /* @__PURE__ */ jsx(DebugInfo, {
|
|
6871
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [(DEV || false) && debug && /* @__PURE__ */ jsx(DebugInfo, {
|
|
6819
6872
|
path: absolutePath,
|
|
6820
6873
|
"data-prefer-right-alignment": ""
|
|
6821
6874
|
}), /* @__PURE__ */ jsx(DataTableContent, {
|
|
6822
6875
|
editable: true,
|
|
6823
6876
|
variant: "control",
|
|
6824
6877
|
status: printing ? void 0 : displayStatusToControlStatus(deferredDisplayStatus),
|
|
6878
|
+
emptyMessage,
|
|
6825
6879
|
scrollableProps: {
|
|
6826
6880
|
onFocus: combineEventHandlers(scrollableProps?.onFocus, handleFocus),
|
|
6827
6881
|
onBlur: combineEventHandlers(scrollableProps?.onBlur, handleContainerOnBlur),
|
|
@@ -6927,7 +6981,7 @@ function TextControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
6927
6981
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
6928
6982
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
6929
6983
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
6930
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6984
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6931
6985
|
popoverIssues,
|
|
6932
6986
|
endAdornment,
|
|
6933
6987
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -6987,20 +7041,22 @@ function ValidateAction({ label, keybinds, showWhenReadOnly, loading, disabled,
|
|
|
6987
7041
|
target: formAppEl,
|
|
6988
7042
|
preventDefault: true
|
|
6989
7043
|
});
|
|
6990
|
-
|
|
7044
|
+
const { secondary } = useActionsContext() ?? {};
|
|
7045
|
+
return showAction && /* @__PURE__ */ jsx(Action, {
|
|
7046
|
+
layout: secondary ? void 0 : "vertical",
|
|
7047
|
+
label,
|
|
7048
|
+
variant: "solid",
|
|
6991
7049
|
color: "primary",
|
|
6992
7050
|
icon: faCircleCheck$1,
|
|
6993
|
-
vertical: true,
|
|
6994
7051
|
...otherProps,
|
|
6995
7052
|
onClick: combineEventHandlers(validate, onClick),
|
|
6996
7053
|
disabled: showDisabled,
|
|
6997
7054
|
loading: showLoading,
|
|
6998
7055
|
showSpinner: deferredValidatingAutomatically,
|
|
6999
|
-
keybinds
|
|
7000
|
-
children: label
|
|
7056
|
+
keybinds
|
|
7001
7057
|
});
|
|
7002
7058
|
}
|
|
7003
7059
|
//#endregion
|
|
7004
|
-
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, ValidateAction, displayStatusToColor, displayStatusToControlStatus,
|
|
7060
|
+
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, useFormIsReadOnly, useFormIsSaving, useFormIsValidating, useFormLoader, useFormSaver, useFormTitle, useFormValidator, useIsInControlField, useIsRegistered, useIssuesDisplayMode, useLocale, useOnPathFocus, usePrefix, useRegisterControl, useRegisterController, useRegisterControllerWithinControlField, useRegisterIssueMessages, useRegisterLabel, useRegisteredIssueMessage, useResetFocus, useResetOnChange, useResetOnChangeContext, useSetBottomPanelHeight, useSetLeftSidebarWidth, useSetTopBarHeight, useStartIssuesNavigation, useTableControlApiRef, useTopBarElement };
|
|
7005
7061
|
|
|
7006
7062
|
//# sourceMappingURL=ostack-ui-kform.js.map
|