@ostack.tech/ui-kform 1.0.0-rc.0 → 1.0.0-rc.2
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-CBhjKaFE.js → en-D4xMcf6Q.js} +2 -2
- package/dist/chunks/{en-CBhjKaFE.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 +1 -1
- package/dist/locales/index.js +5 -0
- package/dist/locales/pt-PT.js +1 -1
- package/dist/ostack-ui-kform.css +5 -0
- package/dist/ostack-ui-kform.js +173 -196
- package/dist/ostack-ui-kform.js.map +1 -1
- package/package.json +6 -2
- package/scss/components/TopBar/_TopBar.scss +6 -0
- package/types/components/ControlField/ControlField.d.ts +26 -30
- package/types/components/ControlField/index.d.ts +0 -1
- package/types/components/FormPages/FormPagesContext.d.ts +2 -1
- package/types/components/IssueMessages/IssueMessages.d.ts +6 -1
- package/types/components/TopBar/TopBar.d.ts +3 -1
- package/types/components/TopBar/TopBarActions.d.ts +1 -1
- package/types/index.d.ts +0 -1
- package/types/providers/LocalizationProvider/LocalizationObject.d.ts +2 -2
- package/types/utils/useControlIssues.d.ts +5 -3
- package/types/components/ControlField/ControlFieldContext.d.ts +0 -32
package/dist/ostack-ui-kform.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
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 { 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, 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, 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";
|
|
11
|
+
import { DEV } from "esm-env";
|
|
16
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";
|
|
@@ -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
|
}
|
|
@@ -1547,107 +1543,6 @@ function useReportValidationFailures(info) {
|
|
|
1547
1543
|
}, [info, reportError]);
|
|
1548
1544
|
}
|
|
1549
1545
|
//#endregion
|
|
1550
|
-
//#region src/components/ControlField/ControlFieldContext.ts
|
|
1551
|
-
/** Control field context. */
|
|
1552
|
-
var ControlFieldContext = createContext(null);
|
|
1553
|
-
/** Hook which creates the control field context value. */
|
|
1554
|
-
function useCreateControlFieldContext() {
|
|
1555
|
-
return useConstant(() => createStore(() => ({ controlStates: {} })));
|
|
1556
|
-
}
|
|
1557
|
-
/** Hook returning the control field's context value. */
|
|
1558
|
-
function useControlFieldContext() {
|
|
1559
|
-
return useContext(ControlFieldContext);
|
|
1560
|
-
}
|
|
1561
|
-
/** Hook that returns access to the control field's store. */
|
|
1562
|
-
function useControlFieldStore(selector) {
|
|
1563
|
-
return useStore(useControlFieldContext() ?? EMPTY_STORE, selector);
|
|
1564
|
-
}
|
|
1565
|
-
/** Hook exposing whether a component is being rendered within a control field. */
|
|
1566
|
-
function useIsInControlField() {
|
|
1567
|
-
return useControlFieldContext() !== null;
|
|
1568
|
-
}
|
|
1569
|
-
/**
|
|
1570
|
-
* Hook that makes a control field aware of a controller.
|
|
1571
|
-
*
|
|
1572
|
-
* The passed `controller` object should not be different on every render.
|
|
1573
|
-
*/
|
|
1574
|
-
function useRegisterControllerWithinControlField(controller, deferredIssuesToDisplay) {
|
|
1575
|
-
const store = useControlFieldContext();
|
|
1576
|
-
const formManager = controller.useFormManager();
|
|
1577
|
-
const path = controller.usePath();
|
|
1578
|
-
const schema = controller.useSchema();
|
|
1579
|
-
const exists = controller.useState((state) => state.initialized && state.exists);
|
|
1580
|
-
useEffect(() => {
|
|
1581
|
-
if (store) {
|
|
1582
|
-
const pathStr = path.toString();
|
|
1583
|
-
store.setState((state) => ({ controlStates: {
|
|
1584
|
-
...state.controlStates,
|
|
1585
|
-
[pathStr]: {
|
|
1586
|
-
formManager,
|
|
1587
|
-
schema,
|
|
1588
|
-
path,
|
|
1589
|
-
exists,
|
|
1590
|
-
deferredIssuesToDisplay
|
|
1591
|
-
}
|
|
1592
|
-
} }));
|
|
1593
|
-
return () => {
|
|
1594
|
-
store.setState(({ controlStates: { [pathStr]: _, ...controlStates } }) => ({ controlStates }));
|
|
1595
|
-
};
|
|
1596
|
-
}
|
|
1597
|
-
}, [
|
|
1598
|
-
deferredIssuesToDisplay,
|
|
1599
|
-
exists,
|
|
1600
|
-
formManager,
|
|
1601
|
-
path,
|
|
1602
|
-
schema,
|
|
1603
|
-
store
|
|
1604
|
-
]);
|
|
1605
|
-
}
|
|
1606
|
-
//#endregion
|
|
1607
|
-
//#region src/components/ControlField/ControlField.tsx
|
|
1608
|
-
/**
|
|
1609
|
-
* Component used to group controls with a label, helper text, and/or feedback.
|
|
1610
|
-
*
|
|
1611
|
-
* The component can be conditionally shown via the `shown` property which, by
|
|
1612
|
-
* default, when changing from `true` to `false` will reset its inner controls.
|
|
1613
|
-
*
|
|
1614
|
-
* Added labels automatically "point" to the control and are set to "required"
|
|
1615
|
-
* when requested by the control.
|
|
1616
|
-
*
|
|
1617
|
-
* Aria descriptions and error messages are set on the control based on the
|
|
1618
|
-
* provided helper texts or feedbacks.
|
|
1619
|
-
*/
|
|
1620
|
-
function ControlField({ path = Path.CURRENT, shown = true, resetOnHide = true, setUntouchedOnHide = resetOnHide, setPristineOnHide = resetOnHide, ...otherProps }) {
|
|
1621
|
-
const formManager = useFormManager();
|
|
1622
|
-
const store = useCreateControlFieldContext();
|
|
1623
|
-
const controlStates = useStore(store, (state) => state.controlStates);
|
|
1624
|
-
useEffect(() => {
|
|
1625
|
-
if (!shown) for (const controlState of Object.values(controlStates)) {
|
|
1626
|
-
const { formManager, path, exists } = controlState;
|
|
1627
|
-
if (exists) {
|
|
1628
|
-
if (resetOnHide) formManager.reset(path);
|
|
1629
|
-
if (setUntouchedOnHide) formManager.setUntouched(path);
|
|
1630
|
-
if (setPristineOnHide) formManager.setPristine(path);
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
}, [
|
|
1634
|
-
controlStates,
|
|
1635
|
-
formManager,
|
|
1636
|
-
resetOnHide,
|
|
1637
|
-
setPristineOnHide,
|
|
1638
|
-
setUntouchedOnHide,
|
|
1639
|
-
shown,
|
|
1640
|
-
store
|
|
1641
|
-
]);
|
|
1642
|
-
return shown && /* @__PURE__ */ jsx(CurrentPath, {
|
|
1643
|
-
path,
|
|
1644
|
-
children: /* @__PURE__ */ jsx(ControlFieldContext.Provider, {
|
|
1645
|
-
value: store,
|
|
1646
|
-
children: /* @__PURE__ */ jsx(Field, { ...otherProps })
|
|
1647
|
-
})
|
|
1648
|
-
});
|
|
1649
|
-
}
|
|
1650
|
-
//#endregion
|
|
1651
1546
|
//#region src/components/IssueMessages/IssueMessages.tsx
|
|
1652
1547
|
/**
|
|
1653
1548
|
* Component used to display all issues associated with the relevant path.
|
|
@@ -1662,36 +1557,29 @@ function ControlField({ path = Path.CURRENT, shown = true, resetOnHide = true, s
|
|
|
1662
1557
|
* If `path` contains an issue without an associated issue message, a generic
|
|
1663
1558
|
* message is displayed together with a console warning.
|
|
1664
1559
|
*/
|
|
1665
|
-
function IssueMessages({ path, issues, messages, displayIssueCodes, messagesDataKey, visuallyHiddenErrorCodePrefix, visuallyHiddenWarningCodePrefix, unknownErrorMessage, unknownWarningMessage, unwrapped, ...otherProps }) {
|
|
1560
|
+
function IssueMessages({ path, issues, schema, messages, displayIssueCodes, messagesDataKey, visuallyHiddenErrorCodePrefix, visuallyHiddenWarningCodePrefix, unknownErrorMessage, unknownWarningMessage, unwrapped, ...otherProps }) {
|
|
1666
1561
|
const prefix = usePrefix();
|
|
1667
|
-
const isInControlField = useIsInControlField();
|
|
1668
1562
|
const formManager = useFormManager();
|
|
1669
1563
|
const absolutePath = useResolvedPath(path);
|
|
1670
|
-
const { info } = useIssuesTracker(absolutePath, { enabled: !issues
|
|
1564
|
+
const { info } = useIssuesTracker(absolutePath, { enabled: !issues });
|
|
1671
1565
|
const messagesToRegister = useMemo(() => messages && { [absolutePath.toString()]: messages }, [absolutePath, messages]);
|
|
1672
|
-
const relevantControlState = useControlFieldStore((state) => isInControlField ? state.controlStates?.[absolutePath.toString()] : null);
|
|
1673
1566
|
const deferredTrackedIssues = useDeferredValue(useMemo(() => info?.flatMap((info) => info.issues) ?? [], [info]));
|
|
1674
|
-
const deferredIssuesToDisplay =
|
|
1675
|
-
deferredTrackedIssues,
|
|
1676
|
-
isInControlField,
|
|
1677
|
-
issues,
|
|
1678
|
-
relevantControlState?.deferredIssuesToDisplay
|
|
1679
|
-
]);
|
|
1567
|
+
const deferredIssuesToDisplay = issues ?? deferredTrackedIssues;
|
|
1680
1568
|
useReportValidationFailures(useMemo(() => [{
|
|
1681
1569
|
path: absolutePath,
|
|
1682
1570
|
issues: deferredIssuesToDisplay
|
|
1683
1571
|
}], [absolutePath, deferredIssuesToDisplay]));
|
|
1684
|
-
const
|
|
1572
|
+
const actualSchema = useMemo(() => schema ?? formManager.schema(absolutePath), [
|
|
1685
1573
|
absolutePath,
|
|
1686
1574
|
formManager,
|
|
1687
|
-
|
|
1575
|
+
schema
|
|
1688
1576
|
]);
|
|
1689
1577
|
const feedbackNodes = useMemo(() => deferredIssuesToDisplay.map((issue, i) => /* @__PURE__ */ jsx(Feedback, {
|
|
1690
1578
|
type: issue.severity,
|
|
1691
1579
|
children: /* @__PURE__ */ jsx(IssueMessage, {
|
|
1692
1580
|
path: absolutePath,
|
|
1693
1581
|
issue,
|
|
1694
|
-
schema,
|
|
1582
|
+
schema: actualSchema,
|
|
1695
1583
|
displayIssueCode: displayIssueCodes,
|
|
1696
1584
|
messageDataKey: messagesDataKey,
|
|
1697
1585
|
visuallyHiddenErrorCodePrefix,
|
|
@@ -1703,7 +1591,7 @@ function IssueMessages({ path, issues, messages, displayIssueCodes, messagesData
|
|
|
1703
1591
|
}, i)), [
|
|
1704
1592
|
deferredIssuesToDisplay,
|
|
1705
1593
|
absolutePath,
|
|
1706
|
-
|
|
1594
|
+
actualSchema,
|
|
1707
1595
|
displayIssueCodes,
|
|
1708
1596
|
messagesDataKey,
|
|
1709
1597
|
visuallyHiddenErrorCodePrefix,
|
|
@@ -1728,19 +1616,20 @@ function IssuesPopover({ path, relevantPaths, defaultOpen, open: controlledOpen,
|
|
|
1728
1616
|
label ??= locale.IssuesPopover.label;
|
|
1729
1617
|
const absolutePath = useResolvedPath(path);
|
|
1730
1618
|
const [open, setOpen] = useControllableState(defaultOpen, controlledOpen);
|
|
1731
|
-
const
|
|
1619
|
+
const isInFeedbackProvider = useIsInFeedbackProvider();
|
|
1620
|
+
const handleOpenChange = combineEventHandlers(onOpenChange, setOpen);
|
|
1732
1621
|
useOnPathFocus(useCallback((focusedPath) => {
|
|
1733
|
-
if ((relevantPaths ?? [absolutePath]).some((path) => focusedPath.equals(new AbsolutePath(path))))
|
|
1622
|
+
if ((relevantPaths ?? [absolutePath]).some((path) => focusedPath.equals(new AbsolutePath(path)))) handleOpenChange(true);
|
|
1734
1623
|
}, [
|
|
1735
1624
|
relevantPaths,
|
|
1736
1625
|
absolutePath,
|
|
1737
|
-
|
|
1738
|
-
]), { enabled: !
|
|
1626
|
+
handleOpenChange
|
|
1627
|
+
]), { enabled: !isInFeedbackProvider });
|
|
1739
1628
|
return /* @__PURE__ */ jsx(CurrentPath, {
|
|
1740
1629
|
path: absolutePath,
|
|
1741
1630
|
children: /* @__PURE__ */ jsx(FeedbackPopover, {
|
|
1742
1631
|
open,
|
|
1743
|
-
onOpenChange:
|
|
1632
|
+
onOpenChange: handleOpenChange,
|
|
1744
1633
|
label,
|
|
1745
1634
|
...otherProps
|
|
1746
1635
|
})
|
|
@@ -1786,10 +1675,11 @@ function useTopBarElement() {
|
|
|
1786
1675
|
//#endregion
|
|
1787
1676
|
//#region src/components/TopBar/TopBar.tsx
|
|
1788
1677
|
/** Top bar component. */
|
|
1789
|
-
function TopBar({ className, ref, ...otherProps }) {
|
|
1678
|
+
function TopBar({ className, ref, children, globalIssuesProps, ...otherProps }) {
|
|
1790
1679
|
const prefix = usePrefix();
|
|
1791
1680
|
const { printHidden } = usePrintClassNames();
|
|
1792
1681
|
const setTopBarHeight = useSetTopBarHeight();
|
|
1682
|
+
const issuesDisplayMode = useIssuesDisplayMode();
|
|
1793
1683
|
const [topBarEl, setTopBarEl] = useState(null);
|
|
1794
1684
|
useMeasure(topBarEl, useCallback((measurement) => setTopBarHeight(measurement?.height), [setTopBarHeight]));
|
|
1795
1685
|
const combinedTopBarRef = useCombinedRef(setTopBarEl, ref);
|
|
@@ -1797,10 +1687,18 @@ function TopBar({ className, ref, ...otherProps }) {
|
|
|
1797
1687
|
value: { topBarEl },
|
|
1798
1688
|
children: /* @__PURE__ */ jsx(Layer, {
|
|
1799
1689
|
zIndex: "sticky",
|
|
1800
|
-
children: /* @__PURE__ */
|
|
1690
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1801
1691
|
className: cx(prefix("top-bar"), printHidden, className),
|
|
1802
1692
|
...otherProps,
|
|
1803
|
-
ref: combinedTopBarRef
|
|
1693
|
+
ref: combinedTopBarRef,
|
|
1694
|
+
children: [issuesDisplayMode === "inline" && /* @__PURE__ */ jsx(IssuesPopover, {
|
|
1695
|
+
...globalIssuesProps,
|
|
1696
|
+
buttonContainerProps: {
|
|
1697
|
+
...globalIssuesProps?.buttonContainerProps,
|
|
1698
|
+
className: cx(prefix("top-bar__global-issues-container"), globalIssuesProps?.buttonContainerProps?.className)
|
|
1699
|
+
},
|
|
1700
|
+
children: /* @__PURE__ */ jsx(IssueMessages, {})
|
|
1701
|
+
}), children]
|
|
1804
1702
|
})
|
|
1805
1703
|
})
|
|
1806
1704
|
});
|
|
@@ -1808,10 +1706,9 @@ function TopBar({ className, ref, ...otherProps }) {
|
|
|
1808
1706
|
//#endregion
|
|
1809
1707
|
//#region src/components/TopBar/TopBarActions.tsx
|
|
1810
1708
|
/** Container of the top bar actions. */
|
|
1811
|
-
function TopBarActions({ className, containerProps,
|
|
1709
|
+
function TopBarActions({ className, containerProps, ...otherProps }) {
|
|
1812
1710
|
const prefix = usePrefix();
|
|
1813
|
-
|
|
1814
|
-
return /* @__PURE__ */ jsxs(Actions, {
|
|
1711
|
+
return /* @__PURE__ */ jsx(Actions, {
|
|
1815
1712
|
className: cx(prefix("top-bar__actions"), className),
|
|
1816
1713
|
primaryLayout: {
|
|
1817
1714
|
xs: ["horizontal", "vertical"],
|
|
@@ -1825,8 +1722,7 @@ function TopBarActions({ className, containerProps, children, ...otherProps }) {
|
|
|
1825
1722
|
...containerProps,
|
|
1826
1723
|
className: cx(prefix("top-bar__actions-container"), containerProps?.className)
|
|
1827
1724
|
},
|
|
1828
|
-
...otherProps
|
|
1829
|
-
children: [issuesDisplayMode === "inline" && /* @__PURE__ */ jsx(IssuesPopover, { children: /* @__PURE__ */ jsx(IssueMessages, {}) }), children]
|
|
1725
|
+
...otherProps
|
|
1830
1726
|
});
|
|
1831
1727
|
}
|
|
1832
1728
|
//#endregion
|
|
@@ -1959,7 +1855,7 @@ function AnnexesMenuItem({ removeAnnexButtonLabel, removeAnnexKeyboardHint, remo
|
|
|
1959
1855
|
...formContext,
|
|
1960
1856
|
currentPath: path
|
|
1961
1857
|
},
|
|
1962
|
-
children: removeAnnexConfirmDialogMessage?.(/* @__PURE__ */ jsxs("strong", { children: [state.title, state.subtitle && /* @__PURE__ */ jsxs(Fragment, { children: [" — ", state.subtitle] })] }))
|
|
1858
|
+
children: removeAnnexConfirmDialogMessage?.(/* @__PURE__ */ jsxs("strong", { children: [state.title, state.subtitle && /* @__PURE__ */ jsxs(Fragment$1, { children: [" — ", state.subtitle] })] }))
|
|
1963
1859
|
}), {
|
|
1964
1860
|
title: removeAnnexConfirmDialogTitle,
|
|
1965
1861
|
color: "danger",
|
|
@@ -2002,7 +1898,7 @@ function AnnexesMenuItem({ removeAnnexButtonLabel, removeAnnexKeyboardHint, remo
|
|
|
2002
1898
|
className: prefix("annexes__menu-annex-description"),
|
|
2003
1899
|
children: [/* @__PURE__ */ jsx(VisuallyHidden, { children: ", " }), nonRepetitiveDescription]
|
|
2004
1900
|
})]
|
|
2005
|
-
}), isRemovable && !formIsReadOnly && /* @__PURE__ */ jsxs(Fragment, { children: [removeAnnexKeyboardHint && /* @__PURE__ */ jsx(VisuallyHidden, { children: removeAnnexKeyboardHint }), /* @__PURE__ */ jsx(IconButton, {
|
|
1901
|
+
}), isRemovable && !formIsReadOnly && /* @__PURE__ */ jsxs(Fragment$1, { children: [removeAnnexKeyboardHint && /* @__PURE__ */ jsx(VisuallyHidden, { children: removeAnnexKeyboardHint }), /* @__PURE__ */ jsx(IconButton, {
|
|
2006
1902
|
className: prefix("annexes__menu-annex-remove"),
|
|
2007
1903
|
icon: faTrash,
|
|
2008
1904
|
label: removeAnnexButtonLabel ?? "",
|
|
@@ -2083,6 +1979,7 @@ function AnnexTab({ path }) {
|
|
|
2083
1979
|
const issuesDisplayMode = useIssuesDisplayMode();
|
|
2084
1980
|
const deferredIssuesToDisplay = useAnnexState(path, useShallow((state) => state?.deferredIssuesToDisplay ?? []));
|
|
2085
1981
|
const hasIssues = deferredIssuesToDisplay.length > 0;
|
|
1982
|
+
const schema = useAnnexState(path, (state) => state?.schema);
|
|
2086
1983
|
const deferredDisplayStatus = useAnnexState(path, (state) => state?.deferredDisplayStatus);
|
|
2087
1984
|
const title = useAnnexState(path, (state) => state?.title);
|
|
2088
1985
|
const subtitle = useAnnexState(path, (state) => state?.subtitle);
|
|
@@ -2106,7 +2003,7 @@ function AnnexTab({ path }) {
|
|
|
2106
2003
|
const handleIssuesPopoverOpenAutoFocus = useCallback((evt) => {
|
|
2107
2004
|
if (tabFocused) evt.preventDefault();
|
|
2108
2005
|
}, [tabFocused]);
|
|
2109
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2006
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2110
2007
|
/* @__PURE__ */ jsx(Tab, {
|
|
2111
2008
|
className: prefix("annexes__tab"),
|
|
2112
2009
|
value: path.toString(),
|
|
@@ -2133,6 +2030,7 @@ function AnnexTab({ path }) {
|
|
|
2133
2030
|
hidden: true,
|
|
2134
2031
|
id: issueMessagesId,
|
|
2135
2032
|
path,
|
|
2033
|
+
schema,
|
|
2136
2034
|
issues: deferredIssuesToDisplay
|
|
2137
2035
|
}),
|
|
2138
2036
|
issuesDisplayMode === "inline" && /* @__PURE__ */ jsx(IssuesPopover, {
|
|
@@ -2232,6 +2130,7 @@ function AnnexesManager({ showMenu, menuButtonText, menuButtonLabel, addAnnexTex
|
|
|
2232
2130
|
hidden: issuesDisplayMode === "panel",
|
|
2233
2131
|
children: tablessStates.map((state, i) => /* @__PURE__ */ jsx(IssueMessages, {
|
|
2234
2132
|
path: state.path,
|
|
2133
|
+
schema: state.schema,
|
|
2235
2134
|
issues: deferredTablessIssuesToDisplay[i] ?? [],
|
|
2236
2135
|
unwrapped: true
|
|
2237
2136
|
}, state.path.toString()))
|
|
@@ -2295,7 +2194,7 @@ function AnnexesManager({ showMenu, menuButtonText, menuButtonLabel, addAnnexTex
|
|
|
2295
2194
|
//#endregion
|
|
2296
2195
|
//#region src/utils/useControlIssues.tsx
|
|
2297
2196
|
/** Hook which helps a control component render its issues. */
|
|
2298
|
-
function useControlIssues({ issuesToDisplay, issueMessages, displayIssues = true, issueMessagesProps, variant }) {
|
|
2197
|
+
function useControlIssues({ issuesToDisplay, issueMessages, schemas, displayIssues = true, issueMessagesProps, variant }) {
|
|
2299
2198
|
const issuesDisplayMode = useIssuesDisplayMode();
|
|
2300
2199
|
const isInTableCell = useIsInTableCell();
|
|
2301
2200
|
const showInPopover = variant === "cell" || variant === void 0 && isInTableCell;
|
|
@@ -2305,8 +2204,9 @@ function useControlIssues({ issuesToDisplay, issueMessages, displayIssues = true
|
|
|
2305
2204
|
hidden: issuesDisplayMode === "panel",
|
|
2306
2205
|
children: Object.entries(issuesToDisplay).map(([path, issues], i) => /* @__PURE__ */ jsx(IssueMessages, {
|
|
2307
2206
|
path,
|
|
2207
|
+
schema: schemas[path],
|
|
2308
2208
|
issues,
|
|
2309
|
-
messages: issueMessages
|
|
2209
|
+
messages: issueMessages[path],
|
|
2310
2210
|
displayIssueCodes,
|
|
2311
2211
|
unknownErrorMessage,
|
|
2312
2212
|
unknownWarningMessage,
|
|
@@ -2342,7 +2242,6 @@ function useRegisterControl({ controller, issuesPanelLabel, ariaLabel, issuesPan
|
|
|
2342
2242
|
const columnLabel = useDataTableColumnLabel();
|
|
2343
2243
|
useRegisterLabel(path, issuesPanelLabel || columnLabel || ariaLabel, issuesPanelLabel ? 1 : -1);
|
|
2344
2244
|
useRegisterFieldLabel(path, issuesPanelLabelSuffix);
|
|
2345
|
-
useRegisterControllerWithinControlField(controller, issuesToDisplay);
|
|
2346
2245
|
useRegisterController(controller);
|
|
2347
2246
|
useImperativeHandle(apiRef, () => controller, [controller]);
|
|
2348
2247
|
const autofocusRef = useControlAutofocus(controller, !preventAutoFocus && !printing);
|
|
@@ -2378,7 +2277,7 @@ function useRegisterControl({ controller, issuesPanelLabel, ariaLabel, issuesPan
|
|
|
2378
2277
|
/** Hook used to register a label for all control field's controls. */
|
|
2379
2278
|
function useRegisterFieldLabel(path, issuesPanelLabelSuffix) {
|
|
2380
2279
|
const { store: formAppStore } = useFormAppContext();
|
|
2381
|
-
useOnLabelChange(useCallback((label) => formAppStore.getState().actions.registerLabel(path, label && issuesPanelLabelSuffix ? /* @__PURE__ */ jsxs(Fragment, { children: [label, issuesPanelLabelSuffix] }) : label), [
|
|
2280
|
+
useOnLabelChange(useCallback((label) => formAppStore.getState().actions.registerLabel(path, label && issuesPanelLabelSuffix ? /* @__PURE__ */ jsxs(Fragment$1, { children: [label, issuesPanelLabelSuffix] }) : label), [
|
|
2382
2281
|
formAppStore,
|
|
2383
2282
|
issuesPanelLabelSuffix,
|
|
2384
2283
|
path
|
|
@@ -2430,7 +2329,7 @@ function DebugInfo({ defaultOpen, open, onOpenChange, path = Path.CURRENT_DEEP,
|
|
|
2430
2329
|
/* @__PURE__ */ jsx(DescriptionListItem, {
|
|
2431
2330
|
xs: 6,
|
|
2432
2331
|
term: "Validations",
|
|
2433
|
-
children: schema.validations.length > 0 ? schema.validations.map((validation, i) => /* @__PURE__ */ jsxs(Fragment
|
|
2332
|
+
children: schema.validations.length > 0 ? schema.validations.map((validation, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i !== 0 && ", ", /* @__PURE__ */ jsx(Code, { children: validation.toString() })] }, i)) : empty
|
|
2434
2333
|
}),
|
|
2435
2334
|
/* @__PURE__ */ jsx(DescriptionListItem, {
|
|
2436
2335
|
xs: 6,
|
|
@@ -2450,7 +2349,7 @@ function DebugInfo({ defaultOpen, open, onOpenChange, path = Path.CURRENT_DEEP,
|
|
|
2450
2349
|
/* @__PURE__ */ jsx(DescriptionListItem, {
|
|
2451
2350
|
xs: 6,
|
|
2452
2351
|
term: "Issues",
|
|
2453
|
-
children: issues && issues.length > 0 ? issues.map((issue, i) => /* @__PURE__ */ jsxs(Fragment
|
|
2352
|
+
children: issues && issues.length > 0 ? issues.map((issue, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i !== 0 && ", ", /* @__PURE__ */ jsx(Code, {
|
|
2454
2353
|
color: issue.severity === "error" ? "danger" : "warning",
|
|
2455
2354
|
children: issue.code
|
|
2456
2355
|
})] }, i)) : empty
|
|
@@ -2743,9 +2642,11 @@ function CheckboxControl({ path, issueMessages, issuesPanelLabel, displayIssues
|
|
|
2743
2642
|
apiRef
|
|
2744
2643
|
});
|
|
2745
2644
|
if (schema.typeInfo.name !== "Boolean") throw new InvalidPathError(absolutePath, `Unsupported schema: Expected schema representing (possibly nullable) booleans, but got schema representing values of type '${schema.typeInfo.toString()}'.`);
|
|
2645
|
+
const absolutePathStr = absolutePath.toString();
|
|
2746
2646
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
2747
|
-
issuesToDisplay: { [
|
|
2748
|
-
issueMessages: { [
|
|
2647
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
2648
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
2649
|
+
schemas: { [absolutePathStr]: schema },
|
|
2749
2650
|
displayIssues,
|
|
2750
2651
|
issueMessagesProps,
|
|
2751
2652
|
variant: otherProps.variant
|
|
@@ -2760,7 +2661,7 @@ function CheckboxControl({ path, issueMessages, issuesPanelLabel, displayIssues
|
|
|
2760
2661
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
2761
2662
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
2762
2663
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
2763
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2664
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2764
2665
|
popoverIssues,
|
|
2765
2666
|
endAdornment,
|
|
2766
2667
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, { path: absolutePath })
|
|
@@ -2849,8 +2750,8 @@ function UnknownValue({ value, label }) {
|
|
|
2849
2750
|
label ??= locale.UnknownValue.label;
|
|
2850
2751
|
const prefix = usePrefix();
|
|
2851
2752
|
const valueStr = value == null ? "" : String(value);
|
|
2852
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2853
|
-
valueStr && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2753
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2754
|
+
valueStr && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2854
2755
|
"“",
|
|
2855
2756
|
/* @__PURE__ */ jsx("span", {
|
|
2856
2757
|
className: prefix("unknown-value"),
|
|
@@ -2858,7 +2759,7 @@ function UnknownValue({ value, label }) {
|
|
|
2858
2759
|
}),
|
|
2859
2760
|
"”"
|
|
2860
2761
|
] }),
|
|
2861
|
-
valueStr && label && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }),
|
|
2762
|
+
valueStr && label && /* @__PURE__ */ jsx(Fragment$1, { children: "\xA0" }),
|
|
2862
2763
|
label && /* @__PURE__ */ jsxs("span", {
|
|
2863
2764
|
className: prefix("unknown-value__label"),
|
|
2864
2765
|
children: [
|
|
@@ -2985,9 +2886,11 @@ function CheckboxGroupControl({ path, options, issueMessages, issuesPanelLabel,
|
|
|
2985
2886
|
schema,
|
|
2986
2887
|
unknownValues
|
|
2987
2888
|
]);
|
|
2889
|
+
const absolutePathStr = absolutePath.toString();
|
|
2988
2890
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
2989
|
-
issuesToDisplay: { [
|
|
2990
|
-
issueMessages: { [
|
|
2891
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
2892
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
2893
|
+
schemas: { [absolutePathStr]: schema },
|
|
2991
2894
|
displayIssues,
|
|
2992
2895
|
issueMessagesProps,
|
|
2993
2896
|
variant: otherProps.variant
|
|
@@ -3004,7 +2907,7 @@ function CheckboxGroupControl({ path, options, issueMessages, issuesPanelLabel,
|
|
|
3004
2907
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
3005
2908
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
3006
2909
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
3007
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2910
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3008
2911
|
popoverIssues,
|
|
3009
2912
|
endAdornment,
|
|
3010
2913
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, { path: absolutePath })
|
|
@@ -3029,6 +2932,51 @@ function CheckboxGroupControl({ path, options, issueMessages, issuesPanelLabel,
|
|
|
3029
2932
|
}), inlineIssues] });
|
|
3030
2933
|
}
|
|
3031
2934
|
//#endregion
|
|
2935
|
+
//#region src/components/ControlField/ControlField.tsx
|
|
2936
|
+
/**
|
|
2937
|
+
* Component used to group controls with a label, helper text, and/or feedback.
|
|
2938
|
+
*
|
|
2939
|
+
* The component can be conditionally shown via the `shown` property which, by
|
|
2940
|
+
* default, when changing from `true` to `false` will reset its inner controls.
|
|
2941
|
+
*
|
|
2942
|
+
* Added labels automatically "point" to the control and are set to "required"
|
|
2943
|
+
* when requested by the control.
|
|
2944
|
+
*
|
|
2945
|
+
* Aria descriptions and error messages are set on the control based on the
|
|
2946
|
+
* provided helper texts or feedbacks.
|
|
2947
|
+
*
|
|
2948
|
+
* @deprecated Use the `@ostack.tech/ui` {@link Field} component instead. Set the
|
|
2949
|
+
* `path` on the control directly instead.
|
|
2950
|
+
*
|
|
2951
|
+
* Change from:
|
|
2952
|
+
*
|
|
2953
|
+
* ```tsx
|
|
2954
|
+
* <ControlField path="name">
|
|
2955
|
+
* <Label>Name</Label>
|
|
2956
|
+
* <TextControl />
|
|
2957
|
+
* </ControlField>;
|
|
2958
|
+
* ```
|
|
2959
|
+
*
|
|
2960
|
+
* To:
|
|
2961
|
+
*
|
|
2962
|
+
* ```tsx
|
|
2963
|
+
* <Field>
|
|
2964
|
+
* <Label>Name</Label>
|
|
2965
|
+
* <TextControl path="name" />
|
|
2966
|
+
* </Field>;
|
|
2967
|
+
* ```
|
|
2968
|
+
*
|
|
2969
|
+
* If you were using `shown` (together with `resetOnHide`), use the
|
|
2970
|
+
* `ResetOnChange` component or the `useResetOnChange` hook instead on the
|
|
2971
|
+
* control that is the cause of the reset instead.
|
|
2972
|
+
*/
|
|
2973
|
+
function ControlField({ path = Path.CURRENT, ...otherProps }) {
|
|
2974
|
+
return /* @__PURE__ */ jsx(CurrentPath, {
|
|
2975
|
+
path,
|
|
2976
|
+
children: /* @__PURE__ */ jsx(Field, { ...otherProps })
|
|
2977
|
+
});
|
|
2978
|
+
}
|
|
2979
|
+
//#endregion
|
|
3032
2980
|
//#region src/utils/dateRestrictions.ts
|
|
3033
2981
|
/** Returns the minimum date allowed based on a temporal schema's restrictions. */
|
|
3034
2982
|
function minDateRestriction(schema) {
|
|
@@ -3133,9 +3081,11 @@ function DateControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
3133
3081
|
setFormattedValue(formattedValue);
|
|
3134
3082
|
inputProps.onChange(formattedValue);
|
|
3135
3083
|
}, [inputProps]);
|
|
3084
|
+
const absolutePathStr = absolutePath.toString();
|
|
3136
3085
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
3137
|
-
issuesToDisplay: { [
|
|
3138
|
-
issueMessages: { [
|
|
3086
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
3087
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
3088
|
+
schemas: { [absolutePathStr]: schema },
|
|
3139
3089
|
displayIssues,
|
|
3140
3090
|
issueMessagesProps,
|
|
3141
3091
|
variant: otherProps.variant
|
|
@@ -3153,7 +3103,7 @@ function DateControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
3153
3103
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
3154
3104
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
3155
3105
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
3156
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3106
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3157
3107
|
popoverIssues,
|
|
3158
3108
|
endAdornment,
|
|
3159
3109
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -3278,14 +3228,20 @@ function DateRangeControl({ startPath, endPath, startIssueMessages, endIssueMess
|
|
|
3278
3228
|
formattedValue.start,
|
|
3279
3229
|
startControllerInputProps
|
|
3280
3230
|
]);
|
|
3231
|
+
const startAbsolutePathStr = startAbsolutePath.toString();
|
|
3232
|
+
const endAbsolutePathStr = endAbsolutePath.toString();
|
|
3281
3233
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
3282
3234
|
issuesToDisplay: {
|
|
3283
|
-
[
|
|
3284
|
-
[
|
|
3235
|
+
[startAbsolutePathStr]: startIssuesToDisplay,
|
|
3236
|
+
[endAbsolutePathStr]: endIssuesToDisplay
|
|
3285
3237
|
},
|
|
3286
3238
|
issueMessages: {
|
|
3287
|
-
[
|
|
3288
|
-
[
|
|
3239
|
+
[startAbsolutePathStr]: startIssueMessages,
|
|
3240
|
+
[endAbsolutePathStr]: endIssueMessages
|
|
3241
|
+
},
|
|
3242
|
+
schemas: {
|
|
3243
|
+
[startAbsolutePathStr]: startSchema,
|
|
3244
|
+
[endAbsolutePathStr]: endSchema
|
|
3289
3245
|
},
|
|
3290
3246
|
displayIssues,
|
|
3291
3247
|
issueMessagesProps,
|
|
@@ -3321,11 +3277,11 @@ function DateRangeControl({ startPath, endPath, startIssueMessages, endIssueMess
|
|
|
3321
3277
|
onFocus: combineEventHandlers(endInputProps?.onFocus, handleEndFocus),
|
|
3322
3278
|
ref: useCombinedRef(endControllerInputProps?.ref, useCombinedRef(endAutofocusRef, endInputProps?.ref))
|
|
3323
3279
|
},
|
|
3324
|
-
startMiddleAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [startMiddleAdornment, (DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
3280
|
+
startMiddleAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [startMiddleAdornment, (DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
3325
3281
|
path: startAbsolutePath,
|
|
3326
3282
|
children: /* @__PURE__ */ jsx(DebugInfoControlAddonTrigger, {})
|
|
3327
3283
|
})] }),
|
|
3328
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3284
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3329
3285
|
popoverIssues,
|
|
3330
3286
|
endAdornment,
|
|
3331
3287
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -3452,8 +3408,9 @@ function FileControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
3452
3408
|
onTouchedStatusChange
|
|
3453
3409
|
});
|
|
3454
3410
|
const { useSchema, usePath, inputProps } = controller;
|
|
3455
|
-
const
|
|
3411
|
+
const schema = useSchema();
|
|
3456
3412
|
const absolutePath = usePath();
|
|
3413
|
+
const { nullable, restrictions } = schema.typeInfo;
|
|
3457
3414
|
const showDebugInfo = useFormInDebugMode() || debug;
|
|
3458
3415
|
const { displayLoading, displayDisabled, displayReadOnly, displayStatusToDisplay, displayValidating, issuesToDisplay, autofocusRef, handleFocus } = useRegisterControl({
|
|
3459
3416
|
controller,
|
|
@@ -3478,9 +3435,11 @@ function FileControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
3478
3435
|
const handleKeyDown = useCallback((evt) => {
|
|
3479
3436
|
if (evt.code === "Delete" || evt.code === "Backspace") clearButtonRef.current?.click();
|
|
3480
3437
|
}, []);
|
|
3438
|
+
const absolutePathStr = absolutePath.toString();
|
|
3481
3439
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
3482
|
-
issuesToDisplay: { [
|
|
3483
|
-
issueMessages: { [
|
|
3440
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
3441
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
3442
|
+
schemas: { [absolutePathStr]: schema },
|
|
3484
3443
|
displayIssues,
|
|
3485
3444
|
issueMessagesProps
|
|
3486
3445
|
});
|
|
@@ -3506,7 +3465,7 @@ function FileControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
3506
3465
|
onClick: combineEventHandlers(clearButtonProps?.onClick, handleClearButtonClick),
|
|
3507
3466
|
ref: useCombinedRef(clearButtonProps?.ref, clearButtonRef)
|
|
3508
3467
|
},
|
|
3509
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3468
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3510
3469
|
popoverIssues,
|
|
3511
3470
|
endAdornment,
|
|
3512
3471
|
fileInteraction === "view" && file && /* @__PURE__ */ jsx(FileControlViewAddon, {
|
|
@@ -3628,6 +3587,7 @@ function FormPageHeader({ helperText, helperButtonLabel, ownIssueMessages, codeP
|
|
|
3628
3587
|
const issuesDisplayMode = useIssuesDisplayMode();
|
|
3629
3588
|
const deferredIssuesToDisplay = useFormPageState(currentPath, useShallow((state) => !printing && issuesDisplayMode === "inline" && state?.deferredIssuesToDisplay || [])) ?? [];
|
|
3630
3589
|
const deferredDisplayStatus = useFormPageState(currentPath, (state) => printing ? void 0 : state?.deferredDisplayStatus);
|
|
3590
|
+
const schema = useFormPageState(currentPath, (state) => state?.schema);
|
|
3631
3591
|
const code = useFormPageState(currentPath, (state) => state?.code);
|
|
3632
3592
|
const title = useFormPageState(currentPath, (state) => state?.title);
|
|
3633
3593
|
const visuallyHiddenCodePrefix = useFormPageState(currentPath, (state) => state?.visuallyHiddenCodePrefix ?? locale.FormPage.visuallyHiddenCodePrefix);
|
|
@@ -3646,7 +3606,7 @@ function FormPageHeader({ helperText, helperButtonLabel, ownIssueMessages, codeP
|
|
|
3646
3606
|
className: cx(prefix("form-pages__page-code"), codeProps?.className),
|
|
3647
3607
|
"data-status": displayStatusToControlStatus(deferredDisplayStatus),
|
|
3648
3608
|
"data-accent": controlStatusToAccent(displayStatusToControlStatus(deferredDisplayStatus)),
|
|
3649
|
-
children: code != null && typeof code !== "boolean" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3609
|
+
children: code != null && typeof code !== "boolean" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3650
3610
|
visuallyHiddenCodePrefix && /* @__PURE__ */ jsxs(VisuallyHidden, { children: [visuallyHiddenCodePrefix, " "] }),
|
|
3651
3611
|
code,
|
|
3652
3612
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: ", " })
|
|
@@ -3665,6 +3625,8 @@ function FormPageHeader({ helperText, helperButtonLabel, ownIssueMessages, codeP
|
|
|
3665
3625
|
...issuesPopoverProps?.iconButtonProps
|
|
3666
3626
|
},
|
|
3667
3627
|
children: /* @__PURE__ */ jsx(IssueMessages, {
|
|
3628
|
+
path: currentPath,
|
|
3629
|
+
schema,
|
|
3668
3630
|
issues: deferredIssuesToDisplay,
|
|
3669
3631
|
messages: ownIssueMessages,
|
|
3670
3632
|
...issueMessagesProps
|
|
@@ -3795,6 +3757,7 @@ function FormPageRegistrar({ path, title, documentTitle, code, issuesPanelLabel
|
|
|
3795
3757
|
onInitialized: finishPrintingTask
|
|
3796
3758
|
});
|
|
3797
3759
|
const absolutePath = controller.usePath();
|
|
3760
|
+
const schema = controller.useSchema();
|
|
3798
3761
|
const exists = controller.useState((state) => state.initialized && state.exists);
|
|
3799
3762
|
const value = controller.useValue();
|
|
3800
3763
|
const deferredValue = useDeferredValue(value);
|
|
@@ -3808,6 +3771,7 @@ function FormPageRegistrar({ path, title, documentTitle, code, issuesPanelLabel
|
|
|
3808
3771
|
registerPageState(absolutePath, {
|
|
3809
3772
|
exists,
|
|
3810
3773
|
path: absolutePath,
|
|
3774
|
+
schema,
|
|
3811
3775
|
deferredIssuesToDisplay,
|
|
3812
3776
|
deferredDisplayStatus,
|
|
3813
3777
|
title: actualTitle,
|
|
@@ -3822,6 +3786,7 @@ function FormPageRegistrar({ path, title, documentTitle, code, issuesPanelLabel
|
|
|
3822
3786
|
deferredDisplayStatus,
|
|
3823
3787
|
deferredIssuesToDisplay,
|
|
3824
3788
|
exists,
|
|
3789
|
+
schema,
|
|
3825
3790
|
store,
|
|
3826
3791
|
title
|
|
3827
3792
|
]);
|
|
@@ -4043,7 +4008,7 @@ function FormPageSidebarItem({ path }) {
|
|
|
4043
4008
|
"data-selected": boolDataAttr(isSelected),
|
|
4044
4009
|
"data-status": displayStatusToControlStatus(deferredDisplayStatus),
|
|
4045
4010
|
"data-accent": controlStatusToAccent(displayStatusToControlStatus(deferredDisplayStatus)),
|
|
4046
|
-
children: code != null && typeof code !== "boolean" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4011
|
+
children: code != null && typeof code !== "boolean" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4047
4012
|
visuallyHiddenCodePrefix && /* @__PURE__ */ jsxs(VisuallyHidden, { children: [visuallyHiddenCodePrefix, " "] }),
|
|
4048
4013
|
code,
|
|
4049
4014
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: ", " })
|
|
@@ -4559,7 +4524,7 @@ function IssuesPanelControls({ currentPagePath, nPages, currentPageIndex, curren
|
|
|
4559
4524
|
});
|
|
4560
4525
|
return /* @__PURE__ */ jsxs("div", {
|
|
4561
4526
|
className: prefix("issues-panel__controls"),
|
|
4562
|
-
children: [nPages > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4527
|
+
children: [nPages > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4563
4528
|
deferredValidating && /* @__PURE__ */ jsx(Spinner, {
|
|
4564
4529
|
...validatingSpinnerProps,
|
|
4565
4530
|
className: cx(prefix("issues-panel__validating-spinner"), validatingSpinnerProps?.className)
|
|
@@ -4657,7 +4622,7 @@ function IssuesPanelMessagesCard({ currentPagePath, currentPageController, issue
|
|
|
4657
4622
|
const [cardEl, setCardEl] = useState(null);
|
|
4658
4623
|
const headerRef = useRef(null);
|
|
4659
4624
|
useScrollPosition(cardEl, useCallback((scrollPosition) => setBoolDataAttr(headerRef.current, "stuck", (scrollPosition?.top ?? 0) > 0), []));
|
|
4660
|
-
const renderIssuesList = (severity) => (severity === "error" ? hasErrors : hasWarnings) && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
|
|
4625
|
+
const renderIssuesList = (severity) => (severity === "error" ? hasErrors : hasWarnings) && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("h3", {
|
|
4661
4626
|
className: prefix("issues-panel__issues-list-title"),
|
|
4662
4627
|
children: severity === "error" ? errorsLabel?.() : warningsLabel?.()
|
|
4663
4628
|
}), /* @__PURE__ */ jsx("ul", {
|
|
@@ -4698,7 +4663,7 @@ function IssuesPanelMessagesCard({ currentPagePath, currentPageController, issue
|
|
|
4698
4663
|
...loadingSpinnerProps,
|
|
4699
4664
|
className: cx(prefix("issues-panel__loading-spinner"), loadingSpinnerProps?.className)
|
|
4700
4665
|
}),
|
|
4701
|
-
initialized && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
4666
|
+
initialized && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
4702
4667
|
color: relevantColor,
|
|
4703
4668
|
size: "lg",
|
|
4704
4669
|
...iconProps,
|
|
@@ -4765,7 +4730,7 @@ function IssuesPanelSummaryCard({ issuesTrackerResult, errorsLabel, warningsLabe
|
|
|
4765
4730
|
...loadingSpinnerProps,
|
|
4766
4731
|
className: cx(prefix("issues-panel__loading-spinner"), loadingSpinnerProps?.className)
|
|
4767
4732
|
}),
|
|
4768
|
-
initialized && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
4733
|
+
initialized && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
4769
4734
|
color: relevantColor,
|
|
4770
4735
|
size: "lg",
|
|
4771
4736
|
...iconProps,
|
|
@@ -4775,7 +4740,7 @@ function IssuesPanelSummaryCard({ issuesTrackerResult, errorsLabel, warningsLabe
|
|
|
4775
4740
|
role: "status",
|
|
4776
4741
|
...titleProps,
|
|
4777
4742
|
className: cx(prefix("issues-panel__title"), titleProps?.className),
|
|
4778
|
-
children: [nPages === 0 && noIssuesMessage, nPages > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4743
|
+
children: [nPages === 0 && noIssuesMessage, nPages > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4779
4744
|
errors > 0 && errorsLabel?.(errors),
|
|
4780
4745
|
errors > 0 && warnings > 0 && ", ",
|
|
4781
4746
|
warnings > 0 && warningsLabel?.(warnings)
|
|
@@ -5181,11 +5146,13 @@ function NumericControl({ path, issueMessages, issuesPanelLabel, displayIssues =
|
|
|
5181
5146
|
setStringValue(stringValue);
|
|
5182
5147
|
}
|
|
5183
5148
|
}, [inputProps, latestRef]);
|
|
5149
|
+
const absolutePathStr = absolutePath.toString();
|
|
5184
5150
|
const schemaIsInteger = INTEGER_TYPES.includes(schema.typeInfo.name);
|
|
5185
|
-
if (schemaIsInteger && valueIsInteger !== void 0) warnOnce(`NumericControl: At '${
|
|
5151
|
+
if (schemaIsInteger && valueIsInteger !== void 0) warnOnce(`NumericControl: At '${absolutePathStr}': Property \`valueIsInteger\` has no effect (it will always be \`true\`) when the control's schema is one of the integer types.`);
|
|
5186
5152
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
5187
|
-
issuesToDisplay: { [
|
|
5188
|
-
issueMessages: { [
|
|
5153
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
5154
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
5155
|
+
schemas: { [absolutePathStr]: schema },
|
|
5189
5156
|
displayIssues,
|
|
5190
5157
|
issueMessagesProps,
|
|
5191
5158
|
variant: otherProps.variant
|
|
@@ -5207,7 +5174,7 @@ function NumericControl({ path, issueMessages, issuesPanelLabel, displayIssues =
|
|
|
5207
5174
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
5208
5175
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5209
5176
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
5210
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5177
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5211
5178
|
popoverIssues,
|
|
5212
5179
|
endAdornment,
|
|
5213
5180
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -5441,9 +5408,11 @@ function RadioGroupControl({ path, options, issueMessages, issuesPanelLabel, dis
|
|
|
5441
5408
|
const clearedValue = nullable ? null : schema.initialValue;
|
|
5442
5409
|
const clearedIdx = useMemo(() => options.findIndex((option) => equals(option.value, clearedValue)), [clearedValue, options]);
|
|
5443
5410
|
const clearedFormattedValue = clearedIdx === -1 ? "" : clearedIdx.toString();
|
|
5411
|
+
const absolutePathStr = absolutePath.toString();
|
|
5444
5412
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
5445
|
-
issuesToDisplay: { [
|
|
5446
|
-
issueMessages: { [
|
|
5413
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
5414
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
5415
|
+
schemas: { [absolutePathStr]: schema },
|
|
5447
5416
|
displayIssues,
|
|
5448
5417
|
issueMessagesProps,
|
|
5449
5418
|
variant: otherProps.variant
|
|
@@ -5459,7 +5428,7 @@ function RadioGroupControl({ path, options, issueMessages, issuesPanelLabel, dis
|
|
|
5459
5428
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5460
5429
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
5461
5430
|
showClearButton: showClearButton === "auto" ? formattedValue !== clearedFormattedValue : showClearButton,
|
|
5462
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5431
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5463
5432
|
popoverIssues,
|
|
5464
5433
|
endAdornment,
|
|
5465
5434
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, { path: absolutePath })
|
|
@@ -5814,9 +5783,11 @@ function SelectControl({ path, options: groupedOptions, issueMessages, issuesPan
|
|
|
5814
5783
|
const clearedIdx = useMemo(() => options.findIndex((option) => equals(option.value, clearedValue)), [clearedValue, options]);
|
|
5815
5784
|
const clearedFormattedValue = clearedIdx === -1 ? "" : clearedIdx.toString();
|
|
5816
5785
|
const optionNodes = useMemo(() => selectionItemObjectsToNodes(groupedOptions), [groupedOptions]);
|
|
5786
|
+
const absolutePathStr = absolutePath.toString();
|
|
5817
5787
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
5818
|
-
issuesToDisplay: { [
|
|
5819
|
-
issueMessages: { [
|
|
5788
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
5789
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
5790
|
+
schemas: { [absolutePathStr]: schema },
|
|
5820
5791
|
displayIssues,
|
|
5821
5792
|
issueMessagesProps,
|
|
5822
5793
|
variant: otherProps.variant
|
|
@@ -5832,7 +5803,7 @@ function SelectControl({ path, options: groupedOptions, issueMessages, issuesPan
|
|
|
5832
5803
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5833
5804
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
5834
5805
|
showClearButton: showClearButton === "auto" ? formattedValue !== clearedFormattedValue : showClearButton,
|
|
5835
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5806
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5836
5807
|
popoverIssues,
|
|
5837
5808
|
endAdornment,
|
|
5838
5809
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -6000,9 +5971,11 @@ function SelectMultipleControl({ path, options: groupedOptions, issueMessages, i
|
|
|
6000
5971
|
unknownValues
|
|
6001
5972
|
]);
|
|
6002
5973
|
const optionNodes = useMemo(() => selectionItemObjectsToNodes(groupedOptions), [groupedOptions]);
|
|
5974
|
+
const absolutePathStr = absolutePath.toString();
|
|
6003
5975
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
6004
|
-
issuesToDisplay: { [
|
|
6005
|
-
issueMessages: { [
|
|
5976
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
5977
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
5978
|
+
schemas: { [absolutePathStr]: schema },
|
|
6006
5979
|
displayIssues,
|
|
6007
5980
|
issueMessagesProps,
|
|
6008
5981
|
variant: otherProps.variant
|
|
@@ -6019,7 +5992,7 @@ function SelectMultipleControl({ path, options: groupedOptions, issueMessages, i
|
|
|
6019
5992
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
6020
5993
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
6021
5994
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
6022
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5995
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6023
5996
|
popoverIssues,
|
|
6024
5997
|
endAdornment,
|
|
6025
5998
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -6202,7 +6175,7 @@ function SubmitAction({ onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedS
|
|
|
6202
6175
|
container: formAppEl,
|
|
6203
6176
|
...dialogContentProps?.portalProps
|
|
6204
6177
|
},
|
|
6205
|
-
children: submissionInfo && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6178
|
+
children: submissionInfo && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6206
6179
|
/* @__PURE__ */ jsx(AlertDialogHeader, {
|
|
6207
6180
|
...dialogHeaderProps,
|
|
6208
6181
|
children: /* @__PURE__ */ jsx(AlertDialogTitle, {
|
|
@@ -6551,9 +6524,11 @@ function TableControl({ path, issueMessages, issuesPanelLabel, displayIssues = t
|
|
|
6551
6524
|
...controller,
|
|
6552
6525
|
...ownController
|
|
6553
6526
|
}), [controller, ownController]);
|
|
6527
|
+
const absolutePathStr = absolutePath.toString();
|
|
6554
6528
|
const { inlineIssues } = useControlIssues({
|
|
6555
|
-
issuesToDisplay: { [
|
|
6556
|
-
issueMessages: { [
|
|
6529
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
6530
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
6531
|
+
schemas: { [absolutePathStr]: schema },
|
|
6557
6532
|
displayIssues,
|
|
6558
6533
|
issueMessagesProps
|
|
6559
6534
|
});
|
|
@@ -6871,7 +6846,7 @@ function TableControlContent({ emptyMessage, scrollableProps, ...otherProps }) {
|
|
|
6871
6846
|
const { initialized, exists, touched } = controller.getState();
|
|
6872
6847
|
if (initialized && exists && !touched) controller.setTouched();
|
|
6873
6848
|
}, [controller]);
|
|
6874
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [(DEV || false) && debug && /* @__PURE__ */ jsx(DebugInfo, {
|
|
6849
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [(DEV || false) && debug && /* @__PURE__ */ jsx(DebugInfo, {
|
|
6875
6850
|
path: absolutePath,
|
|
6876
6851
|
"data-prefer-right-alignment": ""
|
|
6877
6852
|
}), /* @__PURE__ */ jsx(DataTableContent, {
|
|
@@ -6966,9 +6941,11 @@ function TextControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
6966
6941
|
});
|
|
6967
6942
|
const [wasMultiline] = useState(multiline);
|
|
6968
6943
|
if (multiline !== wasMultiline) throw new Error("The `multiline` property cannot not be changed at runtime.");
|
|
6944
|
+
const absolutePathStr = absolutePath.toString();
|
|
6969
6945
|
const { inlineIssues, popoverIssues } = useControlIssues({
|
|
6970
|
-
issuesToDisplay: { [
|
|
6971
|
-
issueMessages: { [
|
|
6946
|
+
issuesToDisplay: { [absolutePathStr]: issuesToDisplay },
|
|
6947
|
+
issueMessages: { [absolutePathStr]: issueMessages },
|
|
6948
|
+
schemas: { [absolutePathStr]: schema },
|
|
6972
6949
|
displayIssues,
|
|
6973
6950
|
issueMessagesProps,
|
|
6974
6951
|
variant: otherProps.variant
|
|
@@ -6984,7 +6961,7 @@ function TextControl({ path, issueMessages, issuesPanelLabel, displayIssues = tr
|
|
|
6984
6961
|
disabled: displayDisabled || disabled || inputProps.disabled,
|
|
6985
6962
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
6986
6963
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
6987
|
-
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6964
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6988
6965
|
popoverIssues,
|
|
6989
6966
|
endAdornment,
|
|
6990
6967
|
(DEV || false) && showDebugInfo && /* @__PURE__ */ jsx(DebugInfo, {
|
|
@@ -7060,6 +7037,6 @@ function ValidateAction({ label, keybinds, showWhenReadOnly, loading, disabled,
|
|
|
7060
7037
|
});
|
|
7061
7038
|
}
|
|
7062
7039
|
//#endregion
|
|
7063
|
-
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,
|
|
7040
|
+
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, useIsRegistered, useIssuesDisplayMode, useLocale, useOnPathFocus, usePrefix, useRegisterControl, useRegisterController, useRegisterIssueMessages, useRegisterLabel, useRegisteredIssueMessage, useResetFocus, useResetOnChange, useResetOnChangeContext, useSetBottomPanelHeight, useSetLeftSidebarWidth, useSetTopBarHeight, useStartIssuesNavigation, useTableControlApiRef, useTopBarElement };
|
|
7064
7041
|
|
|
7065
7042
|
//# sourceMappingURL=ostack-ui-kform.js.map
|