@ostack.tech/ui-kform 0.16.4 → 1.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/chunks/{en-CKrk2smU.js → en-CBhjKaFE.js} +2 -1
  2. package/dist/chunks/{en-CKrk2smU.js.map → en-CBhjKaFE.js.map} +1 -1
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +1 -0
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +1 -0
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui-kform.css +17 -1
  10. package/dist/ostack-ui-kform.js +124 -65
  11. package/dist/ostack-ui-kform.js.map +1 -1
  12. package/package.json +2 -2
  13. package/scss/components/Annexes/_Annexes.scss +6 -0
  14. package/scss/components/TopBar/_TopBar.scss +13 -1
  15. package/types/components/FileControl/FileControl.d.ts +1 -1
  16. package/types/components/LoadAction/LoadAction.d.ts +2 -5
  17. package/types/components/PrintAction/PrintAction.d.ts +2 -5
  18. package/types/components/SaveAction/SaveAction.d.ts +8 -10
  19. package/types/components/SubmitAction/SubmitAction.d.ts +2 -4
  20. package/types/components/TableControl/TableControl.d.ts +4 -1
  21. package/types/components/TableControl/TableControlAddRowTrigger.d.ts +2 -4
  22. package/types/components/TableControl/TableControlColumnFns.d.ts +4 -1
  23. package/types/components/TableControl/TableControlContent.d.ts +1 -1
  24. package/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +2 -2
  25. package/types/components/TopBar/TopBarActions.d.ts +4 -4
  26. package/types/components/TopBar/TopBarActionsSecondary.d.ts +6 -0
  27. package/types/components/TopBar/index.d.ts +1 -0
  28. package/types/components/ValidateAction/ValidateAction.d.ts +2 -5
  29. package/types/providers/LocalizationProvider/LocalizationObject.d.ts +2 -1
@@ -2,7 +2,7 @@ import { locale } from "./locales/en-GB.js";
2
2
  import { locale as locale$1 } from "./locales/en-US.js";
3
3
  import { locale as locale$2 } from "./locales/fr-FR.js";
4
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";
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
6
  import { DEV } from "esm-env";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  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";
@@ -13,7 +13,7 @@ import { AbsolutePath, AbsolutePathFragment, Path, PathMultimap, PromiseCancella
13
13
  import { subscribeWithSelector } from "zustand/middleware";
14
14
  import { shallow } from "zustand/shallow";
15
15
  import { fileOpen, fileSave, supported } from "browser-fs-access";
16
- import { faAngleLeft, faAngleRight, faAnglesLeft, faAnglesRight, faArrowRight, faArrowsToDot, faBug, faCaretDown, faChevronDown, faChevronUp, faCircleCheck, faCircleExclamation, faCircleQuestion, faDownload, faFileLines, faFloppyDisk, faFolderOpen, faPlus, faPrint, faTrash, faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
16
+ 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
17
  import { addDays, format, formatISO, max, min, parseISO } from "date-fns";
18
18
  import { faCircleCheck as faCircleCheck$1 } from "@fortawesome/free-regular-svg-icons";
19
19
  //#region src/providers/PrefixSuffixProvider/defaultPrefixSuffix.ts
@@ -1807,20 +1807,38 @@ function TopBar({ className, ref, ...otherProps }) {
1807
1807
  }
1808
1808
  //#endregion
1809
1809
  //#region src/components/TopBar/TopBarActions.tsx
1810
- /** Container used to display actions within the top bar. */
1811
- function TopBarActions({ className, children, ...otherProps }) {
1810
+ /** Container of the top bar actions. */
1811
+ function TopBarActions({ className, containerProps, children, ...otherProps }) {
1812
1812
  const prefix = usePrefix();
1813
1813
  const issuesDisplayMode = useIssuesDisplayMode();
1814
- return /* @__PURE__ */ jsxs(Stack, {
1814
+ return /* @__PURE__ */ jsxs(Actions, {
1815
1815
  className: cx(prefix("top-bar__actions"), className),
1816
- direction: "row",
1817
- gap: 2,
1818
- justifyContent: "flex-end",
1816
+ primaryLayout: {
1817
+ xs: ["horizontal", "vertical"],
1818
+ sm: "horizontal"
1819
+ },
1820
+ secondaryLayout: {
1821
+ xs: "dropdown",
1822
+ md: ["vertical", "dropdown"]
1823
+ },
1824
+ containerProps: {
1825
+ ...containerProps,
1826
+ className: cx(prefix("top-bar__actions-container"), containerProps?.className)
1827
+ },
1819
1828
  ...otherProps,
1820
1829
  children: [issuesDisplayMode === "inline" && /* @__PURE__ */ jsx(IssuesPopover, { children: /* @__PURE__ */ jsx(IssueMessages, {}) }), children]
1821
1830
  });
1822
1831
  }
1823
1832
  //#endregion
1833
+ //#region src/components/TopBar/TopBarActionsSecondary.tsx
1834
+ /** Container of the secondary top bar actions. */
1835
+ function TopBarActionsSecondary(props) {
1836
+ return /* @__PURE__ */ jsx(ActionsSecondary, {
1837
+ color: "success",
1838
+ ...props
1839
+ });
1840
+ }
1841
+ //#endregion
1824
1842
  //#region src/components/Annexes/AnnexesMenu.tsx
1825
1843
  /** Component that allows to navigate between, add, and remove annexes. */
1826
1844
  function AnnexesMenu({ menuButtonText, menuButtonLabel, addAnnexText, removeAnnexButtonLabel, removeAnnexKeyboardHint, removeAnnexConfirmDialogTitle, removeAnnexConfirmDialogMessage, removeAnnexConfirmDialogOkText, removeAnnexConfirmDialogCancelText, defaultOpen = false, open: controlledOpen, onOpenChange, menuTriggerProps, menuContentProps, ...otherProps }) {
@@ -2142,6 +2160,7 @@ function AnnexesTabList({ hideNonActiveOnSmallScreens, rootProps, className, ...
2142
2160
  const store = useAnnexesContext();
2143
2161
  const activeAnnex = useStore(store, (state) => state.activeAnnex);
2144
2162
  const tabStates = useStore(store, useShallow((state) => state.tabStates()));
2163
+ const printing = usePrinting();
2145
2164
  const isLargeScreen = useMediaBreakpointUp("sm");
2146
2165
  return /* @__PURE__ */ jsx(TabList, {
2147
2166
  className: cx(prefix("annexes__tab-list"), className),
@@ -2150,7 +2169,7 @@ function AnnexesTabList({ hideNonActiveOnSmallScreens, rootProps, className, ...
2150
2169
  className: cx(prefix("annexes__tab-list-root"), rootProps?.className)
2151
2170
  },
2152
2171
  ...otherProps,
2153
- children: tabStates.map((state) => !hideNonActiveOnSmallScreens || isLargeScreen || state.path.equals(activeAnnex) ? /* @__PURE__ */ jsx(AnnexTab, { ...state }, state.path.toString()) : null)
2172
+ children: tabStates.map((state) => printing || !hideNonActiveOnSmallScreens || isLargeScreen || state.path.equals(activeAnnex) ? /* @__PURE__ */ jsx(AnnexTab, { ...state }, state.path.toString()) : null)
2154
2173
  });
2155
2174
  }
2156
2175
  //#endregion
@@ -5061,16 +5080,17 @@ function LoadAction({ label, keybinds, showWhenReadOnly, fileSystemId, loading,
5061
5080
  target: formAppEl,
5062
5081
  preventDefault: true
5063
5082
  });
5064
- return showAction && /* @__PURE__ */ jsx(Button, {
5065
- vertical: true,
5083
+ const { secondary } = useActionsContext() ?? {};
5084
+ return showAction && /* @__PURE__ */ jsx(Action, {
5085
+ layout: secondary ? void 0 : "vertical",
5086
+ label,
5066
5087
  variant: "subtle",
5067
5088
  icon: faFolderOpen,
5068
5089
  ...otherProps,
5069
5090
  onClick: combineEventHandlers(() => load(), onClick),
5070
5091
  disabled: showDisabled,
5071
5092
  loading: showLoading,
5072
- keybinds,
5073
- children: label
5093
+ keybinds
5074
5094
  });
5075
5095
  }
5076
5096
  //#endregion
@@ -5307,17 +5327,18 @@ function PrintAction({ label, keybinds, showWhenReadOnly = true, disabled, loadi
5307
5327
  target: formAppEl,
5308
5328
  preventDefault: true
5309
5329
  });
5330
+ const { secondary } = useActionsContext() ?? {};
5310
5331
  return showAction && /* @__PURE__ */ jsx(PrinterTrigger, {
5311
5332
  onClick: combineEventHandlers(onClick, handlePrint, { checkDefaultPrevented: true }),
5312
- children: /* @__PURE__ */ jsx(Button, {
5313
- vertical: true,
5333
+ children: /* @__PURE__ */ jsx(Action, {
5334
+ label,
5335
+ layout: secondary ? void 0 : "vertical",
5314
5336
  variant: "subtle",
5315
5337
  icon: faPrint,
5316
5338
  ...otherProps,
5317
5339
  disabled: showDisabled,
5318
5340
  loading: showLoading,
5319
- keybinds,
5320
- children: label
5341
+ keybinds
5321
5342
  })
5322
5343
  });
5323
5344
  }
@@ -5589,7 +5610,7 @@ var DEFAULT_SAVE_AS_KEYBINDS = "$mod+Shift+S";
5589
5610
  * }
5590
5611
  * ```
5591
5612
  */
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, dropdownMenuProps, ...otherProps }) {
5613
+ 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
5614
  const [locale] = useLocale();
5594
5615
  label ??= locale.SaveAction.label;
5595
5616
  if (keybinds === void 0) keybinds = locale.SaveAction.keybinds ?? "$mod+S";
@@ -5628,8 +5649,9 @@ function SaveAction({ label, keybinds, showWhenReadOnly = true, fileSystemId, di
5628
5649
  target: formAppEl,
5629
5650
  preventDefault: true
5630
5651
  });
5631
- const saveButton = /* @__PURE__ */ jsx(Button, {
5632
- vertical: true,
5652
+ const { secondary } = useActionsContext() ?? {};
5653
+ const saveActionProps = {
5654
+ layout: secondary ? void 0 : "vertical",
5633
5655
  variant,
5634
5656
  color,
5635
5657
  icon: faFloppyDisk,
@@ -5638,30 +5660,36 @@ function SaveAction({ label, keybinds, showWhenReadOnly = true, fileSystemId, di
5638
5660
  disabled: showDisabled,
5639
5661
  loading: showLoading,
5640
5662
  keybinds,
5641
- children: label
5642
- });
5643
- return showAction && (supportsFileSystemAPIs && !disableOverwrite ? /* @__PURE__ */ jsxs(ButtonGroup, { children: [saveButton, /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, { children: /* @__PURE__ */ jsx(IconButton, {
5644
- variant,
5645
- color,
5646
- icon: faCaretDown,
5647
- ...saveOptionsProps,
5648
- label: saveOptionsLabel,
5649
- disabled: showDisabled || saveOptionsProps?.disabled,
5650
- style: {
5651
- minWidth: 20,
5652
- ...saveOptionsProps?.style
5653
- }
5654
- }) }), /* @__PURE__ */ jsx(DropdownMenuContent, {
5655
- align: "end",
5656
- ...dropdownMenuProps,
5657
- children: /* @__PURE__ */ jsx(DropdownMenuItem, {
5663
+ label
5664
+ };
5665
+ return showAction && (supportsFileSystemAPIs && !disableOverwrite ? /* @__PURE__ */ jsx(ActionSplit, {
5666
+ ...saveActionProps,
5667
+ groupCollapsed,
5668
+ defaultOpen,
5669
+ open,
5670
+ onOpenChange,
5671
+ modal,
5672
+ groupLabel,
5673
+ splitPlacement: saveOptionsPlacement,
5674
+ buttonGroupProps,
5675
+ dropdownMenuGroupProps,
5676
+ splitLabel: saveOptionsLabel,
5677
+ splitProps: {
5678
+ ...saveOptionsProps,
5679
+ disabled: showDisabled || saveOptionsProps?.disabled
5680
+ },
5681
+ dropdownMenuContentProps: {
5682
+ align: "end",
5683
+ ...dropdownMenuContentProps
5684
+ },
5685
+ children: /* @__PURE__ */ jsx(Action, {
5686
+ label: saveAsLabel,
5658
5687
  onClick: () => save(),
5659
5688
  disabled: showDisabled,
5660
5689
  loading: showLoading,
5661
- keybinds: saveAsKeybinds,
5662
- children: saveAsLabel
5690
+ keybinds: saveAsKeybinds
5663
5691
  })
5664
- })] })] }) : saveButton);
5692
+ }) : /* @__PURE__ */ jsx(Action, { ...saveActionProps }));
5665
5693
  }
5666
5694
  //#endregion
5667
5695
  //#region src/components/SelectControl/SelectControlItem.tsx
@@ -6155,7 +6183,8 @@ function SubmitAction({ onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedS
6155
6183
  return showAction && /* @__PURE__ */ jsxs(AlertDialog, {
6156
6184
  open: confirmingSubmission,
6157
6185
  onOpenChange: handleOpenChange,
6158
- children: [/* @__PURE__ */ jsx(AlertDialogTrigger, { children: /* @__PURE__ */ jsx(Button, {
6186
+ children: [/* @__PURE__ */ jsx(AlertDialogTrigger, { children: /* @__PURE__ */ jsx(Action, {
6187
+ label,
6159
6188
  type: "submit",
6160
6189
  color: "success",
6161
6190
  icon: faArrowRight,
@@ -6164,8 +6193,7 @@ function SubmitAction({ onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedS
6164
6193
  onClick: combineEventHandlers(onClick, handleAction),
6165
6194
  disabled: showDisabled,
6166
6195
  loading: showLoading,
6167
- keybinds,
6168
- children: label
6196
+ keybinds
6169
6197
  }) }), /* @__PURE__ */ jsx(AlertDialogContent, {
6170
6198
  color: "primary",
6171
6199
  ...dialogContentProps,
@@ -6393,7 +6421,10 @@ function TableControlRow({ row, index, ...otherProps }) {
6393
6421
  * <TableControlActionsColumn removeRowLabel="Remove item" />
6394
6422
  * </TableControlColumns>
6395
6423
  * <TableControlAddRowTrigger label="Add item" />
6396
- * <TableControlContent caption="Inventory" />
6424
+ * <TableControlContent
6425
+ * caption="Inventory"
6426
+ * emptyMessage="No items added."
6427
+ * />
6397
6428
  * </TableControl>
6398
6429
  * );
6399
6430
  * }
@@ -6619,6 +6650,7 @@ function TableControlRemoveRowTrigger({ onConfirmRowRemoval, onRowRemoved, confi
6619
6650
  const initialized = useInitialized();
6620
6651
  const exists = useExists();
6621
6652
  const setLatestInteraction = useSetLatestInteraction();
6653
+ const actionsContext = useActionsContext();
6622
6654
  const [removing, setRemoving] = useState(false);
6623
6655
  const handleClick = async () => {
6624
6656
  setLatestInteraction(controller.getState().path);
@@ -6644,9 +6676,10 @@ function TableControlRemoveRowTrigger({ onConfirmRowRemoval, onRowRemoved, confi
6644
6676
  disabled: !initialized || !exists || controlIsDisabled || disabled || controlIsReadOnly || removing && children !== void 0,
6645
6677
  onClick: combineEventHandlers(onClick, handleClick, { checkDefaultPrevented: true })
6646
6678
  };
6647
- if (children === void 0) return /* @__PURE__ */ jsx(IconButton, {
6648
- icon: faTrash,
6679
+ if (children === void 0) return /* @__PURE__ */ jsx(Action, {
6680
+ layout: actionsContext ? void 0 : "icon",
6649
6681
  label,
6682
+ icon: faTrash,
6650
6683
  color: "danger",
6651
6684
  loading: !initialized || removing,
6652
6685
  circle: true,
@@ -6703,7 +6736,7 @@ function tableControlIndexColumn({ render, ...otherProps } = {}) {
6703
6736
  * @param overrides Column properties used to display the actions of each row.
6704
6737
  * @returns Table control column used to display the actions of each row.
6705
6738
  */
6706
- function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation, onConfirmRowRemoval, onRowRemoved, confirmRowRemovalDialogMessage, removeRowProps, render, ...otherProps } = {}) {
6739
+ function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation, onConfirmRowRemoval, onRowRemoved, confirmRowRemovalDialogMessage, removeRowProps, render, actionsProps, ...otherProps } = {}) {
6707
6740
  const [confirmRowRemovalDialogProps, columnProps] = extractConfirmDialogOptions(otherProps, "confirmRowRemovalDialog", "confirmDialog");
6708
6741
  return {
6709
6742
  label: /* @__PURE__ */ jsx(TableControlActionsColumnLabel, {}),
@@ -6713,15 +6746,31 @@ function tableControlActionsColumn({ removeRowLabel, showRowRemovalConfirmation,
6713
6746
  align: "center",
6714
6747
  showWhilePrinting: false,
6715
6748
  showWhenReadOnly: false,
6716
- render: render ?? /* @__PURE__ */ jsx(TableControlRemoveRowTrigger, {
6717
- label: removeRowLabel,
6718
- showConfirmation: showRowRemovalConfirmation,
6719
- onConfirmRowRemoval,
6720
- onRowRemoved,
6721
- confirmDialogMessage: confirmRowRemovalDialogMessage,
6722
- ...confirmRowRemovalDialogProps,
6723
- ...removeRowProps
6724
- }),
6749
+ render: (...args) => {
6750
+ const removeRowTrigger = /* @__PURE__ */ jsx(TableControlRemoveRowTrigger, {
6751
+ label: removeRowLabel,
6752
+ showConfirmation: showRowRemovalConfirmation,
6753
+ onConfirmRowRemoval,
6754
+ onRowRemoved,
6755
+ confirmDialogMessage: confirmRowRemovalDialogMessage,
6756
+ ...confirmRowRemovalDialogProps,
6757
+ ...removeRowProps
6758
+ });
6759
+ return render ? /* @__PURE__ */ jsx(Actions, {
6760
+ primaryLayout: "icon",
6761
+ secondaryLayout: "dropdown",
6762
+ gap: 1,
6763
+ ...actionsProps,
6764
+ containerProps: {
6765
+ ...actionsProps?.containerProps,
6766
+ style: {
6767
+ justifyContent: "center",
6768
+ ...actionsProps?.containerProps?.style
6769
+ }
6770
+ },
6771
+ children: typeof render === "function" ? render(...args) : render
6772
+ }) : removeRowTrigger;
6773
+ },
6725
6774
  ...columnProps
6726
6775
  };
6727
6776
  }
@@ -6759,6 +6808,7 @@ function TableControlAddRowTrigger({ disableWhileAdding, onRowAdded, preferRight
6759
6808
  const controlIsDisabled = useFormIsDisabled();
6760
6809
  const controlIsReadOnly = useFormIsReadOnly();
6761
6810
  const setLatestInteraction = useSetLatestInteraction();
6811
+ const actionsContext = useActionsContext();
6762
6812
  const gettingRowValue = controller.useState((state) => state.gettingRowValue);
6763
6813
  const [adding, setAdding] = useState(false);
6764
6814
  const handleClick = async () => {
@@ -6781,14 +6831,18 @@ function TableControlAddRowTrigger({ disableWhileAdding, onRowAdded, preferRight
6781
6831
  };
6782
6832
  if (children === void 0) {
6783
6833
  const { defaultButtonText, label = defaultButtonText ?? locale.TableControlAddRowTrigger.label, ...buttonProps } = otherProps;
6784
- return /* @__PURE__ */ jsx(Button, {
6834
+ return /* @__PURE__ */ jsx(Action, {
6835
+ layout: actionsContext ? void 0 : {
6836
+ xs: "vertical",
6837
+ sm: "horizontal"
6838
+ },
6839
+ label,
6785
6840
  icon: faPlus,
6786
6841
  color: "primary",
6787
6842
  loading: gettingRowValue || adding && disableWhileAdding,
6788
6843
  showSpinner: adding && !disableWhileAdding,
6789
6844
  ...buttonProps,
6790
- ...commonProps,
6791
- children: label
6845
+ ...commonProps
6792
6846
  });
6793
6847
  }
6794
6848
  return /* @__PURE__ */ jsx(Slot, {
@@ -6806,7 +6860,9 @@ function useTableControlApiRef() {
6806
6860
  //#endregion
6807
6861
  //#region src/components/TableControl/TableControlContent.tsx
6808
6862
  /** Component containing the content of the table control. */
6809
- function TableControlContent({ scrollableProps, ...otherProps }) {
6863
+ function TableControlContent({ emptyMessage, scrollableProps, ...otherProps }) {
6864
+ const [locale] = useLocale();
6865
+ emptyMessage ??= locale.TableControlContent.emptyMessage;
6810
6866
  const { autofocusRef, handleFocus, controller, debug } = useTableControlContext();
6811
6867
  const printing = usePrinting();
6812
6868
  const absolutePath = controller.usePath();
@@ -6822,6 +6878,7 @@ function TableControlContent({ scrollableProps, ...otherProps }) {
6822
6878
  editable: true,
6823
6879
  variant: "control",
6824
6880
  status: printing ? void 0 : displayStatusToControlStatus(deferredDisplayStatus),
6881
+ emptyMessage,
6825
6882
  scrollableProps: {
6826
6883
  onFocus: combineEventHandlers(scrollableProps?.onFocus, handleFocus),
6827
6884
  onBlur: combineEventHandlers(scrollableProps?.onBlur, handleContainerOnBlur),
@@ -6987,20 +7044,22 @@ function ValidateAction({ label, keybinds, showWhenReadOnly, loading, disabled,
6987
7044
  target: formAppEl,
6988
7045
  preventDefault: true
6989
7046
  });
6990
- return showAction && /* @__PURE__ */ jsx(Button, {
7047
+ const { secondary } = useActionsContext() ?? {};
7048
+ return showAction && /* @__PURE__ */ jsx(Action, {
7049
+ layout: secondary ? void 0 : "vertical",
7050
+ label,
7051
+ variant: "solid",
6991
7052
  color: "primary",
6992
7053
  icon: faCircleCheck$1,
6993
- vertical: true,
6994
7054
  ...otherProps,
6995
7055
  onClick: combineEventHandlers(validate, onClick),
6996
7056
  disabled: showDisabled,
6997
7057
  loading: showLoading,
6998
7058
  showSpinner: deferredValidatingAutomatically,
6999
- keybinds,
7000
- children: label
7059
+ keybinds
7001
7060
  });
7002
7061
  }
7003
7062
  //#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, locale as enGB, locale$1 as enUS, locale$2 as fr, locale$2 as frFR, locale$3 as pt, locale$3 as ptPT, 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 };
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, locale as enGB, locale$1 as enUS, locale$2 as fr, locale$2 as frFR, locale$3 as pt, locale$3 as ptPT, 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
7064
 
7006
7065
  //# sourceMappingURL=ostack-ui-kform.js.map