@techzyapp/ui-library 1.0.39 → 1.0.40

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 (125) hide show
  1. package/dist/{AdminRoot-B2lwjQig.cjs → AdminRoot-CRTBGUxq.cjs} +2 -2
  2. package/dist/{AdminRoot-B2lwjQig.cjs.map → AdminRoot-CRTBGUxq.cjs.map} +1 -1
  3. package/dist/{AdminRoot-BTPLhufU.js → AdminRoot-JOgiNkJA.js} +3 -3
  4. package/dist/{AdminRoot-BTPLhufU.js.map → AdminRoot-JOgiNkJA.js.map} +1 -1
  5. package/dist/{CodeBlock-BbIC5BRK.cjs → CodeBlock-C3mG_seZ.cjs} +2 -2
  6. package/dist/{CodeBlock-BbIC5BRK.cjs.map → CodeBlock-C3mG_seZ.cjs.map} +1 -1
  7. package/dist/{CodeBlock-C8A6E-tJ.js → CodeBlock-DrWRSRmO.js} +2 -2
  8. package/dist/{CodeBlock-C8A6E-tJ.js.map → CodeBlock-DrWRSRmO.js.map} +1 -1
  9. package/dist/{ColorRamp-B_-ZPqMa.cjs → ColorRamp-D9_5JULy.cjs} +2 -2
  10. package/dist/{ColorRamp-B_-ZPqMa.cjs.map → ColorRamp-D9_5JULy.cjs.map} +1 -1
  11. package/dist/{ColorRamp-CCfImssD.js → ColorRamp-Mp_ddhmb.js} +2 -2
  12. package/dist/{ColorRamp-CCfImssD.js.map → ColorRamp-Mp_ddhmb.js.map} +1 -1
  13. package/dist/{CopyButton-CUEEp_Na.cjs → CopyButton-DZeYcG68.cjs} +2 -2
  14. package/dist/CopyButton-DZeYcG68.cjs.map +1 -0
  15. package/dist/{CopyButton-BD5sN32G.js → CopyButton-Yg5ZVTiX.js} +2 -2
  16. package/dist/CopyButton-Yg5ZVTiX.js.map +1 -0
  17. package/dist/{DescriptionList-BD65gv7C.js → DescriptionList-CG08_qwT.js} +2 -2
  18. package/dist/{DescriptionList-BD65gv7C.js.map → DescriptionList-CG08_qwT.js.map} +1 -1
  19. package/dist/{DescriptionList-BlAJIabM.cjs → DescriptionList-S9C6Tp90.cjs} +2 -2
  20. package/dist/{DescriptionList-BlAJIabM.cjs.map → DescriptionList-S9C6Tp90.cjs.map} +1 -1
  21. package/dist/{ErrorBoundary-sQY2sFdu.js → ErrorBoundary-BILk_3fM.js} +2 -2
  22. package/dist/{ErrorBoundary-sQY2sFdu.js.map → ErrorBoundary-BILk_3fM.js.map} +1 -1
  23. package/dist/{ErrorBoundary-6HvsCoJ8.cjs → ErrorBoundary-JCNa0_Ys.cjs} +2 -2
  24. package/dist/{ErrorBoundary-6HvsCoJ8.cjs.map → ErrorBoundary-JCNa0_Ys.cjs.map} +1 -1
  25. package/dist/{ErrorState-DdxOeZy2.js → ErrorState-DI28ZCJN.js} +3 -3
  26. package/dist/{ErrorState-DdxOeZy2.js.map → ErrorState-DI28ZCJN.js.map} +1 -1
  27. package/dist/{ErrorState-To_MAOf4.cjs → ErrorState-MQBeyF2n.cjs} +2 -2
  28. package/dist/{ErrorState-To_MAOf4.cjs.map → ErrorState-MQBeyF2n.cjs.map} +1 -1
  29. package/dist/{FileUploader-CWH-RS-z.js → FileUploader-DwAl3UXI.js} +2 -2
  30. package/dist/{FileUploader-CWH-RS-z.js.map → FileUploader-DwAl3UXI.js.map} +1 -1
  31. package/dist/{FileUploader-H4k4Cm5B.cjs → FileUploader-FMVbj7rz.cjs} +2 -2
  32. package/dist/{FileUploader-H4k4Cm5B.cjs.map → FileUploader-FMVbj7rz.cjs.map} +1 -1
  33. package/dist/{LocationPicker-CHGJkMXl.js → LocationPicker-Ce8aLubZ.js} +3 -3
  34. package/dist/{LocationPicker-CHGJkMXl.js.map → LocationPicker-Ce8aLubZ.js.map} +1 -1
  35. package/dist/{LocationPicker-CgzZnTFE.cjs → LocationPicker-D-sT4rSe.cjs} +2 -2
  36. package/dist/{LocationPicker-CgzZnTFE.cjs.map → LocationPicker-D-sT4rSe.cjs.map} +1 -1
  37. package/dist/Modal-DTnB_mGg.js +206 -0
  38. package/dist/Modal-DTnB_mGg.js.map +1 -0
  39. package/dist/Modal-DjSOhZqd.cjs +2 -0
  40. package/dist/Modal-DjSOhZqd.cjs.map +1 -0
  41. package/dist/{PageError-9tfvBssn.js → PageError-BORFaxGW.js} +2 -2
  42. package/dist/{PageError-9tfvBssn.js.map → PageError-BORFaxGW.js.map} +1 -1
  43. package/dist/{PageError-CJHOUfCa.cjs → PageError-aUV0vUfB.cjs} +2 -2
  44. package/dist/{PageError-CJHOUfCa.cjs.map → PageError-aUV0vUfB.cjs.map} +1 -1
  45. package/dist/{PaletteField-AMZpUMID.js → PaletteField-ChG2VQtS.js} +2 -2
  46. package/dist/{PaletteField-AMZpUMID.js.map → PaletteField-ChG2VQtS.js.map} +1 -1
  47. package/dist/{PaletteField-ClCvXFdN.cjs → PaletteField-DQ1OvXqe.cjs} +2 -2
  48. package/dist/{PaletteField-ClCvXFdN.cjs.map → PaletteField-DQ1OvXqe.cjs.map} +1 -1
  49. package/dist/{RemoveDialog-yEZm6JaC.cjs → RemoveDialog-B_Y18MeJ.cjs} +2 -2
  50. package/dist/{RemoveDialog-yEZm6JaC.cjs.map → RemoveDialog-B_Y18MeJ.cjs.map} +1 -1
  51. package/dist/{RemoveDialog-BfPTOs1y.js → RemoveDialog-ayAfGXpB.js} +2 -2
  52. package/dist/{RemoveDialog-BfPTOs1y.js.map → RemoveDialog-ayAfGXpB.js.map} +1 -1
  53. package/dist/{RichTextEditor-CitILCiw.cjs → RichTextEditor-DSvSaszc.cjs} +2 -2
  54. package/dist/{RichTextEditor-CitILCiw.cjs.map → RichTextEditor-DSvSaszc.cjs.map} +1 -1
  55. package/dist/{RichTextEditor-CgItVhAR.js → RichTextEditor-itYD1PfE.js} +2 -2
  56. package/dist/{RichTextEditor-CgItVhAR.js.map → RichTextEditor-itYD1PfE.js.map} +1 -1
  57. package/dist/{RootLayout-CVYEk7Wi.js → RootLayout-BlYjYAYk.js} +3 -3
  58. package/dist/{RootLayout-CVYEk7Wi.js.map → RootLayout-BlYjYAYk.js.map} +1 -1
  59. package/dist/{RootLayout-DJ2Xv35m.cjs → RootLayout-D5nlzYlH.cjs} +2 -2
  60. package/dist/{RootLayout-DJ2Xv35m.cjs.map → RootLayout-D5nlzYlH.cjs.map} +1 -1
  61. package/dist/{SpeedDial-C2hkC_8p.js → SpeedDial-CEBAWIYo.js} +2 -2
  62. package/dist/{SpeedDial-C2hkC_8p.js.map → SpeedDial-CEBAWIYo.js.map} +1 -1
  63. package/dist/{SpeedDial-DRSIilyC.cjs → SpeedDial-D6me6w_m.cjs} +2 -2
  64. package/dist/{SpeedDial-DRSIilyC.cjs.map → SpeedDial-D6me6w_m.cjs.map} +1 -1
  65. package/dist/{Table-DDPzTA1H.cjs → Table-CFl3OYlo.cjs} +2 -2
  66. package/dist/{Table-DDPzTA1H.cjs.map → Table-CFl3OYlo.cjs.map} +1 -1
  67. package/dist/{Table-AXMp0eiw.js → Table-DChIfjqj.js} +2 -2
  68. package/dist/{Table-AXMp0eiw.js.map → Table-DChIfjqj.js.map} +1 -1
  69. package/dist/Tooltip-BbT0uNzy.js +152 -0
  70. package/dist/Tooltip-BbT0uNzy.js.map +1 -0
  71. package/dist/Tooltip-DmMq5R1x.cjs +2 -0
  72. package/dist/Tooltip-DmMq5R1x.cjs.map +1 -0
  73. package/dist/components/CodeBlock/index.cjs +1 -1
  74. package/dist/components/CodeBlock/index.js +1 -1
  75. package/dist/components/ColorRamp/index.cjs +1 -1
  76. package/dist/components/ColorRamp/index.js +1 -1
  77. package/dist/components/CopyButton/CopyButton.d.cts +1 -1
  78. package/dist/components/CopyButton/CopyButton.d.ts +1 -1
  79. package/dist/components/CopyButton/index.cjs +1 -1
  80. package/dist/components/CopyButton/index.js +1 -1
  81. package/dist/components/DescriptionList/index.cjs +1 -1
  82. package/dist/components/DescriptionList/index.js +1 -1
  83. package/dist/components/ErrorState/index.cjs +1 -1
  84. package/dist/components/ErrorState/index.js +2 -2
  85. package/dist/components/FileUploader/index.cjs +1 -1
  86. package/dist/components/FileUploader/index.js +1 -1
  87. package/dist/components/LocationPicker/index.cjs +1 -1
  88. package/dist/components/LocationPicker/index.js +1 -1
  89. package/dist/components/Modal/index.cjs +1 -1
  90. package/dist/components/Modal/index.js +1 -1
  91. package/dist/components/PageError/index.cjs +1 -1
  92. package/dist/components/PageError/index.js +1 -1
  93. package/dist/components/PaletteField/index.cjs +1 -1
  94. package/dist/components/PaletteField/index.js +1 -1
  95. package/dist/components/RemoveDialog/index.cjs +1 -1
  96. package/dist/components/RemoveDialog/index.js +1 -1
  97. package/dist/components/RichTextEditor/index.cjs +1 -1
  98. package/dist/components/RichTextEditor/index.js +1 -1
  99. package/dist/components/RootLayout/index.cjs +1 -1
  100. package/dist/components/RootLayout/index.js +1 -1
  101. package/dist/components/SpeedDial/index.cjs +1 -1
  102. package/dist/components/SpeedDial/index.js +1 -1
  103. package/dist/components/Table/index.cjs +1 -1
  104. package/dist/components/Table/index.js +1 -1
  105. package/dist/components/Tooltip/Tooltip.d.cts +5 -3
  106. package/dist/components/Tooltip/Tooltip.d.ts +5 -3
  107. package/dist/components/Tooltip/index.cjs +1 -1
  108. package/dist/components/Tooltip/index.js +1 -1
  109. package/dist/entries/app.cjs +1 -1
  110. package/dist/entries/app.js +1 -1
  111. package/dist/entries/components.cjs +1 -1
  112. package/dist/entries/components.js +17 -17
  113. package/dist/index.cjs +1 -1
  114. package/dist/index.js +18 -18
  115. package/package.json +1 -1
  116. package/dist/CopyButton-BD5sN32G.js.map +0 -1
  117. package/dist/CopyButton-CUEEp_Na.cjs.map +0 -1
  118. package/dist/Modal-BkO_6afj.js +0 -195
  119. package/dist/Modal-BkO_6afj.js.map +0 -1
  120. package/dist/Modal-D8V-JZBg.cjs +0 -2
  121. package/dist/Modal-D8V-JZBg.cjs.map +0 -1
  122. package/dist/Tooltip-Bw-1Xk2Z.cjs +0 -2
  123. package/dist/Tooltip-Bw-1Xk2Z.cjs.map +0 -1
  124. package/dist/Tooltip-DsDv4NOq.js +0 -135
  125. package/dist/Tooltip-DsDv4NOq.js.map +0 -1
@@ -3,7 +3,7 @@ import { createContext as H, useContext as J, forwardRef as g, useRef as T, useI
3
3
  import { clsx as u } from "clsx";
4
4
  import { b as P, a as R } from "./Icon-D5TxgfCc.js";
5
5
  import { I as W } from "./IconButton-06pmftMo.js";
6
- import { T as X } from "./Tooltip-DsDv4NOq.js";
6
+ import { T as X } from "./Tooltip-BbT0uNzy.js";
7
7
  const z = H(null);
8
8
  function Y() {
9
9
  return J(z);
@@ -174,4 +174,4 @@ export {
174
174
  he as S,
175
175
  me as a
176
176
  };
177
- //# sourceMappingURL=SpeedDial-C2hkC_8p.js.map
177
+ //# sourceMappingURL=SpeedDial-CEBAWIYo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpeedDial-C2hkC_8p.js","sources":["../src/components/SpeedDial/speedDialContext.ts","../src/components/SpeedDial/SpeedDialAction.tsx","../src/components/SpeedDial/SpeedDial.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { TooltipPlacement } from '../Tooltip'\n\n/** Action button size — one step smaller than the dial's FAB. */\nexport type SpeedDialActionSize = 'sm' | 'md' | 'lg'\n\n/** Shared state a `<SpeedDial>` hands down to its `<SpeedDialAction>` children via context. */\nexport interface SpeedDialContextValue {\n /** Size for the action FABs. */\n size: SpeedDialActionSize\n /** Where each action's tooltip label sits (derived from the dial `direction`). */\n placement: TooltipPlacement\n /** Close the dial after an action is clicked. */\n closeOnClick: boolean\n /** Show every action's label persistently (no hover needed) while the dial is open. */\n persistentLabels: boolean\n /** Request the dial to close (called by an action on click). */\n requestClose: () => void\n}\n\nexport const SpeedDialContext = createContext<SpeedDialContextValue | null>(null)\n\n/** Read the surrounding `<SpeedDial>` (or `null` when an action is rendered standalone). */\nexport function useSpeedDial(): SpeedDialContextValue | null {\n return useContext(SpeedDialContext)\n}\n","import { forwardRef, type ButtonHTMLAttributes, type MouseEvent, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport type { ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tooltip } from '../Tooltip'\nimport { useSpeedDial } from './speedDialContext'\nimport styles from './SpeedDial.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface SpeedDialActionProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'color'\n> {\n /** Action icon — a known `IconName` or any node. */\n icon: IconName | ReactNode\n /** Label shown as a tooltip beside the action (also its `aria-label` when a string). */\n label?: ReactNode\n /** Show the label persistently (no hover) while the dial is open — overrides the dial's `tooltipOpen`. */\n tooltipOpen?: boolean\n /** Hide the tooltip / persistent label (still used for `aria-label`). */\n hideTooltip?: boolean\n /**\n * Tints the **icon** (the circle stays the neutral surface button) — e.g. `error` for a destructive action.\n * Omit for the default text color.\n */\n color?: ThemeColor\n}\n\n/**\n * One action inside a `<SpeedDial>` — a small circular `IconButton` (surface-tinted) with a tooltip\n * `label`. It reads the dial via context for its size, tooltip placement and close-on-click; clicking\n * runs `onClick` then closes the dial. The ref points at the `<button>`.\n */\nexport const SpeedDialAction = forwardRef<HTMLButtonElement, SpeedDialActionProps>(\n function SpeedDialAction(\n {\n icon,\n label,\n tooltipOpen,\n hideTooltip = false,\n color,\n onClick,\n disabled,\n className,\n style,\n ...props\n },\n ref,\n ) {\n const dial = useSpeedDial()\n const iconNode =\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? <Icon name={icon as IconName} /> : icon\n\n const button = (\n <IconButton\n ref={ref}\n rounded\n variant=\"contained\"\n color=\"surface\"\n size={dial?.size ?? 'sm'}\n disabled={disabled}\n aria-label={typeof label === 'string' ? label : undefined}\n className={clsx(styles.action, className)}\n // the icon follows `color` (currentColor); the circle keeps its surface fill\n style={color ? { color: `var(--tz-color-${color})`, ...style } : style}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (dial?.closeOnClick) dial.requestClose()\n }}\n {...props}\n >\n {iconNode}\n </IconButton>\n )\n\n if (label == null || hideTooltip) return button\n\n const placement = dial?.placement ?? 'left'\n // persistent label: render a static label beside the button (no hover) — like MUI's tooltipOpen\n const persistent = tooltipOpen ?? dial?.persistentLabels ?? false\n if (persistent) {\n return (\n <span\n className={clsx(\n styles.actionWrap,\n placement === 'top' ? styles.labelTop : styles.labelLeft,\n )}\n >\n {button}\n <span className={styles.actionLabel}>{label}</span>\n </span>\n )\n }\n\n return (\n <Tooltip content={label} placement={placement}>\n {button}\n </Tooltip>\n )\n },\n)\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport type { ThemeColor } from '../../theme'\nimport type { TooltipPlacement } from '../Tooltip'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { SpeedDialAction } from './SpeedDialAction'\nimport {\n SpeedDialContext,\n type SpeedDialActionSize,\n type SpeedDialContextValue,\n} from './speedDialContext'\nimport styles from './SpeedDial.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type SpeedDialSize = 'sm' | 'md' | 'lg'\nexport type SpeedDialDirection = 'up' | 'down' | 'left' | 'right'\n\n/** The FAB size → the (smaller) action-button size. */\nconst ACTION_SIZE: Record<SpeedDialSize, SpeedDialActionSize> = { sm: 'sm', md: 'sm', lg: 'md' }\n/** Tooltip side per direction — labels sit left of a vertical dial, above a horizontal one. */\nconst TOOLTIP_PLACEMENT: Record<SpeedDialDirection, TooltipPlacement> = {\n up: 'left',\n down: 'left',\n left: 'top',\n right: 'top',\n}\n\n/** A data-driven action for the `actions` prop. */\nexport interface SpeedDialActionItem {\n /** Stable key (falls back to the index). */\n key?: string\n icon: IconName | ReactNode\n label?: ReactNode\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void\n disabled?: boolean\n /** Tints the action's icon (e.g. `error` for a destructive one); the circle stays neutral. */\n color?: ThemeColor\n}\n\nexport interface SpeedDialProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onChange'> {\n /** Accessible label for the FAB (required — it's icon-only). */\n ariaLabel: string\n /** FAB icon. Defaults to `Add` (a `+`). */\n icon?: IconName | ReactNode\n /** Icon shown while open. Omit to rotate the `icon` 45° instead (a `+` becomes a `×`). */\n openIcon?: IconName | ReactNode\n /** Which way the actions fan out. Defaults to `up`. */\n direction?: SpeedDialDirection\n /** Theme palette token tinting the FAB. Defaults to `primary`. */\n color?: ThemeColor\n /** FAB size (actions render one step smaller). Defaults to `md`. */\n size?: SpeedDialSize\n /** Controlled open state. */\n open?: boolean\n /** Initial open state for uncontrolled use. Defaults to `false`. */\n defaultOpen?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Open on hover (also opens on click). Defaults to `true`. */\n openOnHover?: boolean\n /** Close the dial after an action is clicked. Defaults to `true`. */\n closeOnActionClick?: boolean\n /** Show every action's label persistently while open (no hover needed) — like MUI's `tooltipOpen`. */\n tooltipOpen?: boolean\n /** Data-driven actions — an alternative to `<SpeedDialAction>` children. */\n actions?: SpeedDialActionItem[]\n /** Disables the FAB (and hover-opening). */\n disabled?: boolean\n /** `<SpeedDialAction>` children (used when `actions` is not given). */\n children?: ReactNode\n}\n\n/**\n * A floating action button that reveals a set of related actions on hover / click — fanning out in\n * `direction` (`up` default). The FAB icon rotates 45° when open (a `+` → `×`) unless an `openIcon` is\n * given. Each `<SpeedDialAction>` is a small circular button with a tooltip label; supply them via the\n * data-driven `actions` prop or as children. Opens on hover (`openOnHover`) and click; closes on\n * outside-pointerdown, Escape (refocusing the FAB), or selecting an action. Controlled (`open` +\n * `onOpenChange`) or uncontrolled (`defaultOpen`). The ref points at the root; position it (e.g.\n * `fixed` bottom-right) via `style`/`className`. The FAB carries `aria-expanded`/`aria-controls`.\n */\nexport const SpeedDial = forwardRef<HTMLDivElement, SpeedDialProps>(function SpeedDial(\n {\n ariaLabel,\n icon = 'Add',\n openIcon,\n direction = 'up',\n color = 'primary',\n size = 'md',\n open,\n defaultOpen = false,\n onOpenChange,\n openOnHover = true,\n closeOnActionClick = true,\n tooltipOpen = false,\n actions,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n forwardedRef,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null)\n const fabRef = useRef<HTMLButtonElement | null>(null)\n const actionsId = useId()\n\n const isControlled = open !== undefined\n const [internal, setInternal] = useState(defaultOpen)\n const isOpen = isControlled ? open : internal\n\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternal(next)\n onOpenChange?.(next)\n }\n // keep a stable reference for the document listeners below\n const setOpenRef = useRef(setOpen)\n setOpenRef.current = setOpen\n\n // while open: close on outside pointerdown / Escape (Escape refocuses the FAB)\n useEffect(() => {\n if (!isOpen) return\n const onPointerDown = (event: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(event.target as Node)) {\n setOpenRef.current(false)\n }\n }\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpenRef.current(false)\n fabRef.current?.focus()\n }\n }\n document.addEventListener('pointerdown', onPointerDown)\n document.addEventListener('keydown', onKeyDown)\n return () => {\n document.removeEventListener('pointerdown', onPointerDown)\n document.removeEventListener('keydown', onKeyDown)\n }\n }, [isOpen])\n\n const setRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n const renderIcon = (value: IconName | ReactNode) =>\n typeof value === 'string' && ICON_NAME_SET.has(value) ? (\n <Icon name={value as IconName} />\n ) : (\n value\n )\n\n const ctx: SpeedDialContextValue = {\n size: ACTION_SIZE[size],\n placement: TOOLTIP_PLACEMENT[direction],\n closeOnClick: closeOnActionClick,\n persistentLabels: tooltipOpen,\n requestClose: () => setOpen(false),\n }\n\n const hoverProps =\n openOnHover && !disabled\n ? { onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false) }\n : {}\n\n return (\n <div\n ref={setRootRef}\n className={clsx(styles.speedDial, className)}\n style={style as CSSProperties}\n {...hoverProps}\n {...props}\n >\n <div\n id={actionsId}\n className={clsx(styles.actions, styles[direction])}\n data-open={isOpen ? 'true' : 'false'}\n >\n <SpeedDialContext.Provider value={ctx}>\n {actions\n ? actions.map((action, index) => (\n <SpeedDialAction\n key={action.key ?? index}\n icon={action.icon}\n label={action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n color={action.color}\n />\n ))\n : children}\n </SpeedDialContext.Provider>\n </div>\n\n <IconButton\n ref={fabRef}\n rounded\n variant=\"contained\"\n color={color}\n size={size}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n aria-controls={actionsId}\n className={styles.fab}\n onClick={() => setOpen(!isOpen)}\n >\n <span className={clsx(styles.fabIcon, !openIcon && isOpen && styles.fabIconOpen)}>\n {isOpen && openIcon != null ? renderIcon(openIcon) : renderIcon(icon)}\n </span>\n </IconButton>\n </div>\n )\n})\n"],"names":["SpeedDialContext","createContext","useSpeedDial","useContext","ICON_NAME_SET","ICON_NAMES","SpeedDialAction","forwardRef","icon","label","tooltipOpen","hideTooltip","color","onClick","disabled","className","style","props","ref","dial","iconNode","jsx","Icon","button","IconButton","clsx","styles","event","placement","jsxs","Tooltip","ACTION_SIZE","TOOLTIP_PLACEMENT","SpeedDial","ariaLabel","openIcon","direction","size","open","defaultOpen","onOpenChange","openOnHover","closeOnActionClick","actions","children","forwardedRef","rootRef","useRef","fabRef","actionsId","useId","isControlled","internal","setInternal","useState","isOpen","setOpen","next","setOpenRef","useEffect","onPointerDown","onKeyDown","_a","setRootRef","node","renderIcon","value","ctx","hoverProps","action","index"],"mappings":";;;;;;AAoBO,MAAMA,IAAmBC,EAA4C,IAAI;AAGzE,SAASC,IAA6C;AAC3D,SAAOC,EAAWH,CAA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DialAction.tsx","../src/components/SpeedDial/SpeedDial.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { TooltipPlacement } from '../Tooltip'\n\n/** Action button size — one step smaller than the dial's FAB. */\nexport type SpeedDialActionSize = 'sm' | 'md' | 'lg'\n\n/** Shared state a `<SpeedDial>` hands down to its `<SpeedDialAction>` children via context. */\nexport interface SpeedDialContextValue {\n /** Size for the action FABs. */\n size: SpeedDialActionSize\n /** Where each action's tooltip label sits (derived from the dial `direction`). */\n placement: TooltipPlacement\n /** Close the dial after an action is clicked. */\n closeOnClick: boolean\n /** Show every action's label persistently (no hover needed) while the dial is open. */\n persistentLabels: boolean\n /** Request the dial to close (called by an action on click). */\n requestClose: () => void\n}\n\nexport const SpeedDialContext = createContext<SpeedDialContextValue | null>(null)\n\n/** Read the surrounding `<SpeedDial>` (or `null` when an action is rendered standalone). */\nexport function useSpeedDial(): SpeedDialContextValue | null {\n return useContext(SpeedDialContext)\n}\n","import { forwardRef, type ButtonHTMLAttributes, type MouseEvent, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport type { ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tooltip } from '../Tooltip'\nimport { useSpeedDial } from './speedDialContext'\nimport styles from './SpeedDial.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface SpeedDialActionProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'color'\n> {\n /** Action icon — a known `IconName` or any node. */\n icon: IconName | ReactNode\n /** Label shown as a tooltip beside the action (also its `aria-label` when a string). */\n label?: ReactNode\n /** Show the label persistently (no hover) while the dial is open — overrides the dial's `tooltipOpen`. */\n tooltipOpen?: boolean\n /** Hide the tooltip / persistent label (still used for `aria-label`). */\n hideTooltip?: boolean\n /**\n * Tints the **icon** (the circle stays the neutral surface button) — e.g. `error` for a destructive action.\n * Omit for the default text color.\n */\n color?: ThemeColor\n}\n\n/**\n * One action inside a `<SpeedDial>` — a small circular `IconButton` (surface-tinted) with a tooltip\n * `label`. It reads the dial via context for its size, tooltip placement and close-on-click; clicking\n * runs `onClick` then closes the dial. The ref points at the `<button>`.\n */\nexport const SpeedDialAction = forwardRef<HTMLButtonElement, SpeedDialActionProps>(\n function SpeedDialAction(\n {\n icon,\n label,\n tooltipOpen,\n hideTooltip = false,\n color,\n onClick,\n disabled,\n className,\n style,\n ...props\n },\n ref,\n ) {\n const dial = useSpeedDial()\n const iconNode =\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? <Icon name={icon as IconName} /> : icon\n\n const button = (\n <IconButton\n ref={ref}\n rounded\n variant=\"contained\"\n color=\"surface\"\n size={dial?.size ?? 'sm'}\n disabled={disabled}\n aria-label={typeof label === 'string' ? label : undefined}\n className={clsx(styles.action, className)}\n // the icon follows `color` (currentColor); the circle keeps its surface fill\n style={color ? { color: `var(--tz-color-${color})`, ...style } : style}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (dial?.closeOnClick) dial.requestClose()\n }}\n {...props}\n >\n {iconNode}\n </IconButton>\n )\n\n if (label == null || hideTooltip) return button\n\n const placement = dial?.placement ?? 'left'\n // persistent label: render a static label beside the button (no hover) — like MUI's tooltipOpen\n const persistent = tooltipOpen ?? dial?.persistentLabels ?? false\n if (persistent) {\n return (\n <span\n className={clsx(\n styles.actionWrap,\n placement === 'top' ? styles.labelTop : styles.labelLeft,\n )}\n >\n {button}\n <span className={styles.actionLabel}>{label}</span>\n </span>\n )\n }\n\n return (\n <Tooltip content={label} placement={placement}>\n {button}\n </Tooltip>\n )\n },\n)\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport type { ThemeColor } from '../../theme'\nimport type { TooltipPlacement } from '../Tooltip'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { SpeedDialAction } from './SpeedDialAction'\nimport {\n SpeedDialContext,\n type SpeedDialActionSize,\n type SpeedDialContextValue,\n} from './speedDialContext'\nimport styles from './SpeedDial.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type SpeedDialSize = 'sm' | 'md' | 'lg'\nexport type SpeedDialDirection = 'up' | 'down' | 'left' | 'right'\n\n/** The FAB size → the (smaller) action-button size. */\nconst ACTION_SIZE: Record<SpeedDialSize, SpeedDialActionSize> = { sm: 'sm', md: 'sm', lg: 'md' }\n/** Tooltip side per direction — labels sit left of a vertical dial, above a horizontal one. */\nconst TOOLTIP_PLACEMENT: Record<SpeedDialDirection, TooltipPlacement> = {\n up: 'left',\n down: 'left',\n left: 'top',\n right: 'top',\n}\n\n/** A data-driven action for the `actions` prop. */\nexport interface SpeedDialActionItem {\n /** Stable key (falls back to the index). */\n key?: string\n icon: IconName | ReactNode\n label?: ReactNode\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void\n disabled?: boolean\n /** Tints the action's icon (e.g. `error` for a destructive one); the circle stays neutral. */\n color?: ThemeColor\n}\n\nexport interface SpeedDialProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onChange'> {\n /** Accessible label for the FAB (required — it's icon-only). */\n ariaLabel: string\n /** FAB icon. Defaults to `Add` (a `+`). */\n icon?: IconName | ReactNode\n /** Icon shown while open. Omit to rotate the `icon` 45° instead (a `+` becomes a `×`). */\n openIcon?: IconName | ReactNode\n /** Which way the actions fan out. Defaults to `up`. */\n direction?: SpeedDialDirection\n /** Theme palette token tinting the FAB. Defaults to `primary`. */\n color?: ThemeColor\n /** FAB size (actions render one step smaller). Defaults to `md`. */\n size?: SpeedDialSize\n /** Controlled open state. */\n open?: boolean\n /** Initial open state for uncontrolled use. Defaults to `false`. */\n defaultOpen?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Open on hover (also opens on click). Defaults to `true`. */\n openOnHover?: boolean\n /** Close the dial after an action is clicked. Defaults to `true`. */\n closeOnActionClick?: boolean\n /** Show every action's label persistently while open (no hover needed) — like MUI's `tooltipOpen`. */\n tooltipOpen?: boolean\n /** Data-driven actions — an alternative to `<SpeedDialAction>` children. */\n actions?: SpeedDialActionItem[]\n /** Disables the FAB (and hover-opening). */\n disabled?: boolean\n /** `<SpeedDialAction>` children (used when `actions` is not given). */\n children?: ReactNode\n}\n\n/**\n * A floating action button that reveals a set of related actions on hover / click — fanning out in\n * `direction` (`up` default). The FAB icon rotates 45° when open (a `+` → `×`) unless an `openIcon` is\n * given. Each `<SpeedDialAction>` is a small circular button with a tooltip label; supply them via the\n * data-driven `actions` prop or as children. Opens on hover (`openOnHover`) and click; closes on\n * outside-pointerdown, Escape (refocusing the FAB), or selecting an action. Controlled (`open` +\n * `onOpenChange`) or uncontrolled (`defaultOpen`). The ref points at the root; position it (e.g.\n * `fixed` bottom-right) via `style`/`className`. The FAB carries `aria-expanded`/`aria-controls`.\n */\nexport const SpeedDial = forwardRef<HTMLDivElement, SpeedDialProps>(function SpeedDial(\n {\n ariaLabel,\n icon = 'Add',\n openIcon,\n direction = 'up',\n color = 'primary',\n size = 'md',\n open,\n defaultOpen = false,\n onOpenChange,\n openOnHover = true,\n closeOnActionClick = true,\n tooltipOpen = false,\n actions,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n forwardedRef,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null)\n const fabRef = useRef<HTMLButtonElement | null>(null)\n const actionsId = useId()\n\n const isControlled = open !== undefined\n const [internal, setInternal] = useState(defaultOpen)\n const isOpen = isControlled ? open : internal\n\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternal(next)\n onOpenChange?.(next)\n }\n // keep a stable reference for the document listeners below\n const setOpenRef = useRef(setOpen)\n setOpenRef.current = setOpen\n\n // while open: close on outside pointerdown / Escape (Escape refocuses the FAB)\n useEffect(() => {\n if (!isOpen) return\n const onPointerDown = (event: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(event.target as Node)) {\n setOpenRef.current(false)\n }\n }\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpenRef.current(false)\n fabRef.current?.focus()\n }\n }\n document.addEventListener('pointerdown', onPointerDown)\n document.addEventListener('keydown', onKeyDown)\n return () => {\n document.removeEventListener('pointerdown', onPointerDown)\n document.removeEventListener('keydown', onKeyDown)\n }\n }, [isOpen])\n\n const setRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n const renderIcon = (value: IconName | ReactNode) =>\n typeof value === 'string' && ICON_NAME_SET.has(value) ? (\n <Icon name={value as IconName} />\n ) : (\n value\n )\n\n const ctx: SpeedDialContextValue = {\n size: ACTION_SIZE[size],\n placement: TOOLTIP_PLACEMENT[direction],\n closeOnClick: closeOnActionClick,\n persistentLabels: tooltipOpen,\n requestClose: () => setOpen(false),\n }\n\n const hoverProps =\n openOnHover && !disabled\n ? { onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false) }\n : {}\n\n return (\n <div\n ref={setRootRef}\n className={clsx(styles.speedDial, className)}\n style={style as CSSProperties}\n {...hoverProps}\n {...props}\n >\n <div\n id={actionsId}\n className={clsx(styles.actions, styles[direction])}\n data-open={isOpen ? 'true' : 'false'}\n >\n <SpeedDialContext.Provider value={ctx}>\n {actions\n ? actions.map((action, index) => (\n <SpeedDialAction\n key={action.key ?? index}\n icon={action.icon}\n label={action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n color={action.color}\n />\n ))\n : children}\n </SpeedDialContext.Provider>\n </div>\n\n <IconButton\n ref={fabRef}\n rounded\n variant=\"contained\"\n color={color}\n size={size}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n aria-controls={actionsId}\n className={styles.fab}\n onClick={() => setOpen(!isOpen)}\n >\n <span className={clsx(styles.fabIcon, !openIcon && isOpen && styles.fabIconOpen)}>\n {isOpen && openIcon != null ? renderIcon(openIcon) : renderIcon(icon)}\n </span>\n </IconButton>\n </div>\n )\n})\n"],"names":["SpeedDialContext","createContext","useSpeedDial","useContext","ICON_NAME_SET","ICON_NAMES","SpeedDialAction","forwardRef","icon","label","tooltipOpen","hideTooltip","color","onClick","disabled","className","style","props","ref","dial","iconNode","jsx","Icon","button","IconButton","clsx","styles","event","placement","jsxs","Tooltip","ACTION_SIZE","TOOLTIP_PLACEMENT","SpeedDial","ariaLabel","openIcon","direction","size","open","defaultOpen","onOpenChange","openOnHover","closeOnActionClick","actions","children","forwardedRef","rootRef","useRef","fabRef","actionsId","useId","isControlled","internal","setInternal","useState","isOpen","setOpen","next","setOpenRef","useEffect","onPointerDown","onKeyDown","_a","setRootRef","node","renderIcon","value","ctx","hoverProps","action","index"],"mappings":";;;;;;AAoBO,MAAMA,IAAmBC,EAA4C,IAAI;AAGzE,SAASC,IAA6C;AAC3D,SAAOC,EAAWH,CAAgB;AACpC;;;;;;;;;;;;;;;;GCfMI,KAAgB,IAAI,IAAYC,CAAU,GA0BnCC,KAAkBC;AAAA,EAC7B,SACE;AAAA,IACE,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,GACA;AACA,UAAMC,IAAOjB,EAAA,GACPkB,IACJ,OAAOZ,KAAS,YAAYJ,GAAc,IAAII,CAAI,IAAI,gBAAAa,EAACC,GAAA,EAAK,MAAMd,EAAA,CAAkB,IAAKA,GAErFe,IACJ,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,KAAAN;AAAA,QACA,SAAO;AAAA,QACP,SAAQ;AAAA,QACR,OAAM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AA,QAAA;AAAA,QAGF,gBAAAvB;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,KAAKwB;AAAA,YACL,SAAO;AAAA,YACP,SAAQ;AAAA,YACR,OAAApC;AAAA,YACA,MAAAyB;AAAA,YACA,UAAAvB;AAAA,YACA,cAAYoB;AAAA,YACZ,iBAAc;AAAA,YACd,iBAAeqB;AAAA,YACf,iBAAeN;AAAA,YACf,WAAWvB,EAAO;AAAA,YAClB,SAAS,MAAM8B,EAAQ,CAACD,CAAM;AAAA,YAE9B,UAAA,gBAAAlC,EAAC,UAAK,WAAWI,EAAKC,EAAO,SAAS,CAACS,KAAYoB,KAAU7B,EAAO,WAAW,GAC5E,UAAA6B,KAAUpB,KAAY,OAAO8B,EAAW9B,CAAQ,IAAI8B,EAAWzD,CAAI,EAAA,CACtE;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const n=require("react/jsx-runtime"),o=require("react"),d=require("clsx"),N=require("./Icon-B6lz-V0A.cjs"),M=require("./IconButton-CQ25TtBc.cjs"),F=require("./Tooltip-Bw-1Xk2Z.cjs"),k=o.createContext(null);function G(){return o.useContext(k)}const H="_speedDial_1qwl9_4",J="_fab_1qwl9_9",Q="_fabIcon_1qwl9_17",U="_fabIconOpen_1qwl9_21",V="_actions_1qwl9_26",X="_up_1qwl9_47",Y="_down_1qwl9_53",ee="_left_1qwl9_59",te="_right_1qwl9_65",ne="_action_1qwl9_26",se="_actionWrap_1qwl9_91",oe="_actionLabel_1qwl9_95",ce="_labelLeft_1qwl9_110",re="_labelTop_1qwl9_117",s={speedDial:H,fab:J,fabIcon:Q,fabIconOpen:U,actions:V,up:X,down:Y,left:ee,right:te,action:ne,actionWrap:se,actionLabel:oe,labelLeft:ce,labelTop:re},le=new Set(N.ICON_NAMES),g=o.forwardRef(function({icon:l,label:c,tooltipOpen:p,hideTooltip:_=!1,color:b,onClick:a,disabled:m,className:L,style:i,...E},S){const t=G(),w=typeof l=="string"&&le.has(l)?n.jsx(N.Icon,{name:l}):l,u=n.jsx(M.IconButton,{ref:S,rounded:!0,variant:"contained",color:"surface",size:(t==null?void 0:t.size)??"sm",disabled:m,"aria-label":typeof c=="string"?c:void 0,className:d.clsx(s.action,L),style:b?{color:`var(--tz-color-${b})`,...i}:i,onClick:v=>{a==null||a(v),t!=null&&t.closeOnClick&&t.requestClose()},...E,children:w});if(c==null||_)return u;const x=(t==null?void 0:t.placement)??"left";return p??(t==null?void 0:t.persistentLabels)??!1?n.jsxs("span",{className:d.clsx(s.actionWrap,x==="top"?s.labelTop:s.labelLeft),children:[u,n.jsx("span",{className:s.actionLabel,children:c})]}):n.jsx(F.Tooltip,{content:c,placement:x,children:u})}),ae=new Set(N.ICON_NAMES),ie={sm:"sm",md:"sm",lg:"md"},ue={up:"left",down:"left",left:"top",right:"top"},fe=o.forwardRef(function({ariaLabel:l,icon:c="Add",openIcon:p,direction:_="up",color:b="primary",size:a="md",open:m,defaultOpen:L=!1,onOpenChange:i,openOnHover:E=!0,closeOnActionClick:S=!0,tooltipOpen:t=!1,actions:w,disabled:u=!1,children:x,className:O,style:v,...W},I){const D=o.useRef(null),T=o.useRef(null),y=o.useId(),A=m!==void 0,[z,B]=o.useState(L),r=A?m:z,f=e=>{A||B(e),i==null||i(e)},h=o.useRef(f);h.current=f,o.useEffect(()=>{if(!r)return;const e=j=>{D.current&&!D.current.contains(j.target)&&h.current(!1)},q=j=>{var R;j.key==="Escape"&&(h.current(!1),(R=T.current)==null||R.focus())};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",q),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",q)}},[r]);const $=e=>{D.current=e,typeof I=="function"?I(e):I&&(I.current=e)},C=e=>typeof e=="string"&&ae.has(e)?n.jsx(N.Icon,{name:e}):e,K={size:ie[a],placement:ue[_],closeOnClick:S,persistentLabels:t,requestClose:()=>f(!1)},Z=E&&!u?{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)}:{};return n.jsxs("div",{ref:$,className:d.clsx(s.speedDial,O),style:v,...Z,...W,children:[n.jsx("div",{id:y,className:d.clsx(s.actions,s[_]),"data-open":r?"true":"false",children:n.jsx(k.Provider,{value:K,children:w?w.map((e,q)=>n.jsx(g,{icon:e.icon,label:e.label,onClick:e.onClick,disabled:e.disabled,color:e.color},e.key??q)):x})}),n.jsx(M.IconButton,{ref:T,rounded:!0,variant:"contained",color:b,size:a,disabled:u,"aria-label":l,"aria-haspopup":"true","aria-expanded":r,"aria-controls":y,className:s.fab,onClick:()=>f(!r),children:n.jsx("span",{className:d.clsx(s.fabIcon,!p&&r&&s.fabIconOpen),children:r&&p!=null?C(p):C(c)})})]})});exports.SpeedDial=fe;exports.SpeedDialAction=g;
2
- //# sourceMappingURL=SpeedDial-DRSIilyC.cjs.map
1
+ "use strict";const n=require("react/jsx-runtime"),o=require("react"),d=require("clsx"),N=require("./Icon-B6lz-V0A.cjs"),M=require("./IconButton-CQ25TtBc.cjs"),F=require("./Tooltip-DmMq5R1x.cjs"),k=o.createContext(null);function G(){return o.useContext(k)}const H="_speedDial_1qwl9_4",J="_fab_1qwl9_9",Q="_fabIcon_1qwl9_17",U="_fabIconOpen_1qwl9_21",V="_actions_1qwl9_26",X="_up_1qwl9_47",Y="_down_1qwl9_53",ee="_left_1qwl9_59",te="_right_1qwl9_65",ne="_action_1qwl9_26",se="_actionWrap_1qwl9_91",oe="_actionLabel_1qwl9_95",ce="_labelLeft_1qwl9_110",re="_labelTop_1qwl9_117",s={speedDial:H,fab:J,fabIcon:Q,fabIconOpen:U,actions:V,up:X,down:Y,left:ee,right:te,action:ne,actionWrap:se,actionLabel:oe,labelLeft:ce,labelTop:re},le=new Set(N.ICON_NAMES),g=o.forwardRef(function({icon:l,label:c,tooltipOpen:p,hideTooltip:_=!1,color:b,onClick:a,disabled:m,className:L,style:i,...E},S){const t=G(),w=typeof l=="string"&&le.has(l)?n.jsx(N.Icon,{name:l}):l,u=n.jsx(M.IconButton,{ref:S,rounded:!0,variant:"contained",color:"surface",size:(t==null?void 0:t.size)??"sm",disabled:m,"aria-label":typeof c=="string"?c:void 0,className:d.clsx(s.action,L),style:b?{color:`var(--tz-color-${b})`,...i}:i,onClick:v=>{a==null||a(v),t!=null&&t.closeOnClick&&t.requestClose()},...E,children:w});if(c==null||_)return u;const x=(t==null?void 0:t.placement)??"left";return p??(t==null?void 0:t.persistentLabels)??!1?n.jsxs("span",{className:d.clsx(s.actionWrap,x==="top"?s.labelTop:s.labelLeft),children:[u,n.jsx("span",{className:s.actionLabel,children:c})]}):n.jsx(F.Tooltip,{content:c,placement:x,children:u})}),ae=new Set(N.ICON_NAMES),ie={sm:"sm",md:"sm",lg:"md"},ue={up:"left",down:"left",left:"top",right:"top"},fe=o.forwardRef(function({ariaLabel:l,icon:c="Add",openIcon:p,direction:_="up",color:b="primary",size:a="md",open:m,defaultOpen:L=!1,onOpenChange:i,openOnHover:E=!0,closeOnActionClick:S=!0,tooltipOpen:t=!1,actions:w,disabled:u=!1,children:x,className:O,style:v,...W},I){const D=o.useRef(null),T=o.useRef(null),y=o.useId(),A=m!==void 0,[z,B]=o.useState(L),r=A?m:z,f=e=>{A||B(e),i==null||i(e)},h=o.useRef(f);h.current=f,o.useEffect(()=>{if(!r)return;const e=j=>{D.current&&!D.current.contains(j.target)&&h.current(!1)},q=j=>{var R;j.key==="Escape"&&(h.current(!1),(R=T.current)==null||R.focus())};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",q),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",q)}},[r]);const $=e=>{D.current=e,typeof I=="function"?I(e):I&&(I.current=e)},C=e=>typeof e=="string"&&ae.has(e)?n.jsx(N.Icon,{name:e}):e,K={size:ie[a],placement:ue[_],closeOnClick:S,persistentLabels:t,requestClose:()=>f(!1)},Z=E&&!u?{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)}:{};return n.jsxs("div",{ref:$,className:d.clsx(s.speedDial,O),style:v,...Z,...W,children:[n.jsx("div",{id:y,className:d.clsx(s.actions,s[_]),"data-open":r?"true":"false",children:n.jsx(k.Provider,{value:K,children:w?w.map((e,q)=>n.jsx(g,{icon:e.icon,label:e.label,onClick:e.onClick,disabled:e.disabled,color:e.color},e.key??q)):x})}),n.jsx(M.IconButton,{ref:T,rounded:!0,variant:"contained",color:b,size:a,disabled:u,"aria-label":l,"aria-haspopup":"true","aria-expanded":r,"aria-controls":y,className:s.fab,onClick:()=>f(!r),children:n.jsx("span",{className:d.clsx(s.fabIcon,!p&&r&&s.fabIconOpen),children:r&&p!=null?C(p):C(c)})})]})});exports.SpeedDial=fe;exports.SpeedDialAction=g;
2
+ //# sourceMappingURL=SpeedDial-D6me6w_m.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpeedDial-DRSIilyC.cjs","sources":["../src/components/SpeedDial/speedDialContext.ts","../src/components/SpeedDial/SpeedDialAction.tsx","../src/components/SpeedDial/SpeedDial.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { TooltipPlacement } from '../Tooltip'\n\n/** Action button size — one step smaller than the dial's FAB. */\nexport type SpeedDialActionSize = 'sm' | 'md' | 'lg'\n\n/** Shared state a `<SpeedDial>` hands down to its `<SpeedDialAction>` children via context. */\nexport interface SpeedDialContextValue {\n /** Size for the action FABs. */\n size: SpeedDialActionSize\n /** Where each action's tooltip label sits (derived from the dial `direction`). */\n placement: TooltipPlacement\n /** Close the dial after an action is clicked. */\n closeOnClick: boolean\n /** Show every action's label persistently (no hover needed) while the dial is open. */\n persistentLabels: boolean\n /** Request the dial to close (called by an action on click). */\n requestClose: () => void\n}\n\nexport const SpeedDialContext = createContext<SpeedDialContextValue | null>(null)\n\n/** Read the surrounding `<SpeedDial>` (or `null` when an action is rendered standalone). */\nexport function useSpeedDial(): SpeedDialContextValue | null {\n return useContext(SpeedDialContext)\n}\n","import { forwardRef, type ButtonHTMLAttributes, type MouseEvent, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport type { ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tooltip } from '../Tooltip'\nimport { useSpeedDial } from './speedDialContext'\nimport styles from './SpeedDial.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface SpeedDialActionProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'color'\n> {\n /** Action icon — a known `IconName` or any node. */\n icon: IconName | ReactNode\n /** Label shown as a tooltip beside the action (also its `aria-label` when a string). */\n label?: ReactNode\n /** Show the label persistently (no hover) while the dial is open — overrides the dial's `tooltipOpen`. */\n tooltipOpen?: boolean\n /** Hide the tooltip / persistent label (still used for `aria-label`). */\n hideTooltip?: boolean\n /**\n * Tints the **icon** (the circle stays the neutral surface button) — e.g. `error` for a destructive action.\n * Omit for the default text color.\n */\n color?: ThemeColor\n}\n\n/**\n * One action inside a `<SpeedDial>` — a small circular `IconButton` (surface-tinted) with a tooltip\n * `label`. It reads the dial via context for its size, tooltip placement and close-on-click; clicking\n * runs `onClick` then closes the dial. The ref points at the `<button>`.\n */\nexport const SpeedDialAction = forwardRef<HTMLButtonElement, SpeedDialActionProps>(\n function SpeedDialAction(\n {\n icon,\n label,\n tooltipOpen,\n hideTooltip = false,\n color,\n onClick,\n disabled,\n className,\n style,\n ...props\n },\n ref,\n ) {\n const dial = useSpeedDial()\n const iconNode =\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? <Icon name={icon as IconName} /> : icon\n\n const button = (\n <IconButton\n ref={ref}\n rounded\n variant=\"contained\"\n color=\"surface\"\n size={dial?.size ?? 'sm'}\n disabled={disabled}\n aria-label={typeof label === 'string' ? label : undefined}\n className={clsx(styles.action, className)}\n // the icon follows `color` (currentColor); the circle keeps its surface fill\n style={color ? { color: `var(--tz-color-${color})`, ...style } : style}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (dial?.closeOnClick) dial.requestClose()\n }}\n {...props}\n >\n {iconNode}\n </IconButton>\n )\n\n if (label == null || hideTooltip) return button\n\n const placement = dial?.placement ?? 'left'\n // persistent label: render a static label beside the button (no hover) — like MUI's tooltipOpen\n const persistent = tooltipOpen ?? dial?.persistentLabels ?? false\n if (persistent) {\n return (\n <span\n className={clsx(\n styles.actionWrap,\n placement === 'top' ? styles.labelTop : styles.labelLeft,\n )}\n >\n {button}\n <span className={styles.actionLabel}>{label}</span>\n </span>\n )\n }\n\n return (\n <Tooltip content={label} placement={placement}>\n {button}\n </Tooltip>\n )\n },\n)\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport type { ThemeColor } from '../../theme'\nimport type { TooltipPlacement } from '../Tooltip'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { SpeedDialAction } from './SpeedDialAction'\nimport {\n SpeedDialContext,\n type SpeedDialActionSize,\n type SpeedDialContextValue,\n} from './speedDialContext'\nimport styles from './SpeedDial.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type SpeedDialSize = 'sm' | 'md' | 'lg'\nexport type SpeedDialDirection = 'up' | 'down' | 'left' | 'right'\n\n/** The FAB size → the (smaller) action-button size. */\nconst ACTION_SIZE: Record<SpeedDialSize, SpeedDialActionSize> = { sm: 'sm', md: 'sm', lg: 'md' }\n/** Tooltip side per direction — labels sit left of a vertical dial, above a horizontal one. */\nconst TOOLTIP_PLACEMENT: Record<SpeedDialDirection, TooltipPlacement> = {\n up: 'left',\n down: 'left',\n left: 'top',\n right: 'top',\n}\n\n/** A data-driven action for the `actions` prop. */\nexport interface SpeedDialActionItem {\n /** Stable key (falls back to the index). */\n key?: string\n icon: IconName | ReactNode\n label?: ReactNode\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void\n disabled?: boolean\n /** Tints the action's icon (e.g. `error` for a destructive one); the circle stays neutral. */\n color?: ThemeColor\n}\n\nexport interface SpeedDialProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onChange'> {\n /** Accessible label for the FAB (required — it's icon-only). */\n ariaLabel: string\n /** FAB icon. Defaults to `Add` (a `+`). */\n icon?: IconName | ReactNode\n /** Icon shown while open. Omit to rotate the `icon` 45° instead (a `+` becomes a `×`). */\n openIcon?: IconName | ReactNode\n /** Which way the actions fan out. Defaults to `up`. */\n direction?: SpeedDialDirection\n /** Theme palette token tinting the FAB. Defaults to `primary`. */\n color?: ThemeColor\n /** FAB size (actions render one step smaller). Defaults to `md`. */\n size?: SpeedDialSize\n /** Controlled open state. */\n open?: boolean\n /** Initial open state for uncontrolled use. Defaults to `false`. */\n defaultOpen?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Open on hover (also opens on click). Defaults to `true`. */\n openOnHover?: boolean\n /** Close the dial after an action is clicked. Defaults to `true`. */\n closeOnActionClick?: boolean\n /** Show every action's label persistently while open (no hover needed) — like MUI's `tooltipOpen`. */\n tooltipOpen?: boolean\n /** Data-driven actions — an alternative to `<SpeedDialAction>` children. */\n actions?: SpeedDialActionItem[]\n /** Disables the FAB (and hover-opening). */\n disabled?: boolean\n /** `<SpeedDialAction>` children (used when `actions` is not given). */\n children?: ReactNode\n}\n\n/**\n * A floating action button that reveals a set of related actions on hover / click — fanning out in\n * `direction` (`up` default). The FAB icon rotates 45° when open (a `+` → `×`) unless an `openIcon` is\n * given. Each `<SpeedDialAction>` is a small circular button with a tooltip label; supply them via the\n * data-driven `actions` prop or as children. Opens on hover (`openOnHover`) and click; closes on\n * outside-pointerdown, Escape (refocusing the FAB), or selecting an action. Controlled (`open` +\n * `onOpenChange`) or uncontrolled (`defaultOpen`). The ref points at the root; position it (e.g.\n * `fixed` bottom-right) via `style`/`className`. The FAB carries `aria-expanded`/`aria-controls`.\n */\nexport const SpeedDial = forwardRef<HTMLDivElement, SpeedDialProps>(function SpeedDial(\n {\n ariaLabel,\n icon = 'Add',\n openIcon,\n direction = 'up',\n color = 'primary',\n size = 'md',\n open,\n defaultOpen = false,\n onOpenChange,\n openOnHover = true,\n closeOnActionClick = true,\n tooltipOpen = false,\n actions,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n forwardedRef,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null)\n const fabRef = useRef<HTMLButtonElement | null>(null)\n const actionsId = useId()\n\n const isControlled = open !== undefined\n const [internal, setInternal] = useState(defaultOpen)\n const isOpen = isControlled ? open : internal\n\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternal(next)\n onOpenChange?.(next)\n }\n // keep a stable reference for the document listeners below\n const setOpenRef = useRef(setOpen)\n setOpenRef.current = setOpen\n\n // while open: close on outside pointerdown / Escape (Escape refocuses the FAB)\n useEffect(() => {\n if (!isOpen) return\n const onPointerDown = (event: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(event.target as Node)) {\n setOpenRef.current(false)\n }\n }\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpenRef.current(false)\n fabRef.current?.focus()\n }\n }\n document.addEventListener('pointerdown', onPointerDown)\n document.addEventListener('keydown', onKeyDown)\n return () => {\n document.removeEventListener('pointerdown', onPointerDown)\n document.removeEventListener('keydown', onKeyDown)\n }\n }, [isOpen])\n\n const setRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n const renderIcon = (value: IconName | ReactNode) =>\n typeof value === 'string' && ICON_NAME_SET.has(value) ? (\n <Icon name={value as IconName} />\n ) : (\n value\n )\n\n const ctx: SpeedDialContextValue = {\n size: ACTION_SIZE[size],\n placement: TOOLTIP_PLACEMENT[direction],\n closeOnClick: closeOnActionClick,\n persistentLabels: tooltipOpen,\n requestClose: () => setOpen(false),\n }\n\n const hoverProps =\n openOnHover && !disabled\n ? { onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false) }\n : {}\n\n return (\n <div\n ref={setRootRef}\n className={clsx(styles.speedDial, className)}\n style={style as CSSProperties}\n {...hoverProps}\n {...props}\n >\n <div\n id={actionsId}\n className={clsx(styles.actions, styles[direction])}\n data-open={isOpen ? 'true' : 'false'}\n >\n <SpeedDialContext.Provider value={ctx}>\n {actions\n ? actions.map((action, index) => (\n <SpeedDialAction\n key={action.key ?? index}\n icon={action.icon}\n label={action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n color={action.color}\n />\n ))\n : children}\n </SpeedDialContext.Provider>\n </div>\n\n <IconButton\n ref={fabRef}\n rounded\n variant=\"contained\"\n color={color}\n size={size}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n aria-controls={actionsId}\n className={styles.fab}\n onClick={() => setOpen(!isOpen)}\n >\n <span className={clsx(styles.fabIcon, !openIcon && isOpen && styles.fabIconOpen)}>\n {isOpen && openIcon != null ? renderIcon(openIcon) : renderIcon(icon)}\n </span>\n </IconButton>\n </div>\n )\n})\n"],"names":["SpeedDialContext","createContext","useSpeedDial","useContext","ICON_NAME_SET","ICON_NAMES","SpeedDialAction","forwardRef","icon","label","tooltipOpen","hideTooltip","color","onClick","disabled","className","style","props","ref","dial","iconNode","jsx","Icon","button","IconButton","clsx","styles","event","placement","jsxs","Tooltip","ACTION_SIZE","TOOLTIP_PLACEMENT","SpeedDial","ariaLabel","openIcon","direction","size","open","defaultOpen","onOpenChange","openOnHover","closeOnActionClick","actions","children","forwardedRef","rootRef","useRef","fabRef","actionsId","useId","isControlled","internal","setInternal","useState","isOpen","setOpen","next","setOpenRef","useEffect","onPointerDown","onKeyDown","_a","setRootRef","node","renderIcon","value","ctx","hoverProps","action","index"],"mappings":"mMAoBaA,EAAmBC,EAAAA,cAA4C,IAAI,EAGzE,SAASC,GAA6C,C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A,EAGFvB,EAAAA,IAACG,EAAAA,WAAA,CACC,IAAKwB,EACL,QAAO,GACP,QAAQ,YACR,MAAApC,EACA,KAAAyB,EACA,SAAAvB,EACA,aAAYoB,EACZ,gBAAc,OACd,gBAAeqB,EACf,gBAAeN,EACf,UAAWvB,EAAO,IAClB,QAAS,IAAM8B,EAAQ,CAACD,CAAM,EAE9B,SAAAlC,EAAAA,IAAC,QAAK,UAAWI,OAAKC,EAAO,QAAS,CAACS,GAAYoB,GAAU7B,EAAO,WAAW,EAC5E,SAAA6B,GAAUpB,GAAY,KAAO8B,EAAW9B,CAAQ,EAAI8B,EAAWzD,CAAI,CAAA,CACtE,CAAA,CAAA,CACF,CAAA,CAAA,CAGN,CAAC"}
1
+ {"version":3,"file":"SpeedDial-D6me6w_m.cjs","sources":["../src/components/SpeedDial/speedDialContext.ts","../src/components/SpeedDial/SpeedDialAction.tsx","../src/components/SpeedDial/SpeedDial.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { TooltipPlacement } from '../Tooltip'\n\n/** Action button size — one step smaller than the dial's FAB. */\nexport type SpeedDialActionSize = 'sm' | 'md' | 'lg'\n\n/** Shared state a `<SpeedDial>` hands down to its `<SpeedDialAction>` children via context. */\nexport interface SpeedDialContextValue {\n /** Size for the action FABs. */\n size: SpeedDialActionSize\n /** Where each action's tooltip label sits (derived from the dial `direction`). */\n placement: TooltipPlacement\n /** Close the dial after an action is clicked. */\n closeOnClick: boolean\n /** Show every action's label persistently (no hover needed) while the dial is open. */\n persistentLabels: boolean\n /** Request the dial to close (called by an action on click). */\n requestClose: () => void\n}\n\nexport const SpeedDialContext = createContext<SpeedDialContextValue | null>(null)\n\n/** Read the surrounding `<SpeedDial>` (or `null` when an action is rendered standalone). */\nexport function useSpeedDial(): SpeedDialContextValue | null {\n return useContext(SpeedDialContext)\n}\n","import { forwardRef, type ButtonHTMLAttributes, type MouseEvent, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport type { ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tooltip } from '../Tooltip'\nimport { useSpeedDial } from './speedDialContext'\nimport styles from './SpeedDial.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface SpeedDialActionProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'color'\n> {\n /** Action icon — a known `IconName` or any node. */\n icon: IconName | ReactNode\n /** Label shown as a tooltip beside the action (also its `aria-label` when a string). */\n label?: ReactNode\n /** Show the label persistently (no hover) while the dial is open — overrides the dial's `tooltipOpen`. */\n tooltipOpen?: boolean\n /** Hide the tooltip / persistent label (still used for `aria-label`). */\n hideTooltip?: boolean\n /**\n * Tints the **icon** (the circle stays the neutral surface button) — e.g. `error` for a destructive action.\n * Omit for the default text color.\n */\n color?: ThemeColor\n}\n\n/**\n * One action inside a `<SpeedDial>` — a small circular `IconButton` (surface-tinted) with a tooltip\n * `label`. It reads the dial via context for its size, tooltip placement and close-on-click; clicking\n * runs `onClick` then closes the dial. The ref points at the `<button>`.\n */\nexport const SpeedDialAction = forwardRef<HTMLButtonElement, SpeedDialActionProps>(\n function SpeedDialAction(\n {\n icon,\n label,\n tooltipOpen,\n hideTooltip = false,\n color,\n onClick,\n disabled,\n className,\n style,\n ...props\n },\n ref,\n ) {\n const dial = useSpeedDial()\n const iconNode =\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? <Icon name={icon as IconName} /> : icon\n\n const button = (\n <IconButton\n ref={ref}\n rounded\n variant=\"contained\"\n color=\"surface\"\n size={dial?.size ?? 'sm'}\n disabled={disabled}\n aria-label={typeof label === 'string' ? label : undefined}\n className={clsx(styles.action, className)}\n // the icon follows `color` (currentColor); the circle keeps its surface fill\n style={color ? { color: `var(--tz-color-${color})`, ...style } : style}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (dial?.closeOnClick) dial.requestClose()\n }}\n {...props}\n >\n {iconNode}\n </IconButton>\n )\n\n if (label == null || hideTooltip) return button\n\n const placement = dial?.placement ?? 'left'\n // persistent label: render a static label beside the button (no hover) — like MUI's tooltipOpen\n const persistent = tooltipOpen ?? dial?.persistentLabels ?? false\n if (persistent) {\n return (\n <span\n className={clsx(\n styles.actionWrap,\n placement === 'top' ? styles.labelTop : styles.labelLeft,\n )}\n >\n {button}\n <span className={styles.actionLabel}>{label}</span>\n </span>\n )\n }\n\n return (\n <Tooltip content={label} placement={placement}>\n {button}\n </Tooltip>\n )\n },\n)\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport type { ThemeColor } from '../../theme'\nimport type { TooltipPlacement } from '../Tooltip'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { SpeedDialAction } from './SpeedDialAction'\nimport {\n SpeedDialContext,\n type SpeedDialActionSize,\n type SpeedDialContextValue,\n} from './speedDialContext'\nimport styles from './SpeedDial.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type SpeedDialSize = 'sm' | 'md' | 'lg'\nexport type SpeedDialDirection = 'up' | 'down' | 'left' | 'right'\n\n/** The FAB size → the (smaller) action-button size. */\nconst ACTION_SIZE: Record<SpeedDialSize, SpeedDialActionSize> = { sm: 'sm', md: 'sm', lg: 'md' }\n/** Tooltip side per direction — labels sit left of a vertical dial, above a horizontal one. */\nconst TOOLTIP_PLACEMENT: Record<SpeedDialDirection, TooltipPlacement> = {\n up: 'left',\n down: 'left',\n left: 'top',\n right: 'top',\n}\n\n/** A data-driven action for the `actions` prop. */\nexport interface SpeedDialActionItem {\n /** Stable key (falls back to the index). */\n key?: string\n icon: IconName | ReactNode\n label?: ReactNode\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void\n disabled?: boolean\n /** Tints the action's icon (e.g. `error` for a destructive one); the circle stays neutral. */\n color?: ThemeColor\n}\n\nexport interface SpeedDialProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onChange'> {\n /** Accessible label for the FAB (required — it's icon-only). */\n ariaLabel: string\n /** FAB icon. Defaults to `Add` (a `+`). */\n icon?: IconName | ReactNode\n /** Icon shown while open. Omit to rotate the `icon` 45° instead (a `+` becomes a `×`). */\n openIcon?: IconName | ReactNode\n /** Which way the actions fan out. Defaults to `up`. */\n direction?: SpeedDialDirection\n /** Theme palette token tinting the FAB. Defaults to `primary`. */\n color?: ThemeColor\n /** FAB size (actions render one step smaller). Defaults to `md`. */\n size?: SpeedDialSize\n /** Controlled open state. */\n open?: boolean\n /** Initial open state for uncontrolled use. Defaults to `false`. */\n defaultOpen?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Open on hover (also opens on click). Defaults to `true`. */\n openOnHover?: boolean\n /** Close the dial after an action is clicked. Defaults to `true`. */\n closeOnActionClick?: boolean\n /** Show every action's label persistently while open (no hover needed) — like MUI's `tooltipOpen`. */\n tooltipOpen?: boolean\n /** Data-driven actions — an alternative to `<SpeedDialAction>` children. */\n actions?: SpeedDialActionItem[]\n /** Disables the FAB (and hover-opening). */\n disabled?: boolean\n /** `<SpeedDialAction>` children (used when `actions` is not given). */\n children?: ReactNode\n}\n\n/**\n * A floating action button that reveals a set of related actions on hover / click — fanning out in\n * `direction` (`up` default). The FAB icon rotates 45° when open (a `+` → `×`) unless an `openIcon` is\n * given. Each `<SpeedDialAction>` is a small circular button with a tooltip label; supply them via the\n * data-driven `actions` prop or as children. Opens on hover (`openOnHover`) and click; closes on\n * outside-pointerdown, Escape (refocusing the FAB), or selecting an action. Controlled (`open` +\n * `onOpenChange`) or uncontrolled (`defaultOpen`). The ref points at the root; position it (e.g.\n * `fixed` bottom-right) via `style`/`className`. The FAB carries `aria-expanded`/`aria-controls`.\n */\nexport const SpeedDial = forwardRef<HTMLDivElement, SpeedDialProps>(function SpeedDial(\n {\n ariaLabel,\n icon = 'Add',\n openIcon,\n direction = 'up',\n color = 'primary',\n size = 'md',\n open,\n defaultOpen = false,\n onOpenChange,\n openOnHover = true,\n closeOnActionClick = true,\n tooltipOpen = false,\n actions,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n forwardedRef,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null)\n const fabRef = useRef<HTMLButtonElement | null>(null)\n const actionsId = useId()\n\n const isControlled = open !== undefined\n const [internal, setInternal] = useState(defaultOpen)\n const isOpen = isControlled ? open : internal\n\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternal(next)\n onOpenChange?.(next)\n }\n // keep a stable reference for the document listeners below\n const setOpenRef = useRef(setOpen)\n setOpenRef.current = setOpen\n\n // while open: close on outside pointerdown / Escape (Escape refocuses the FAB)\n useEffect(() => {\n if (!isOpen) return\n const onPointerDown = (event: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(event.target as Node)) {\n setOpenRef.current(false)\n }\n }\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpenRef.current(false)\n fabRef.current?.focus()\n }\n }\n document.addEventListener('pointerdown', onPointerDown)\n document.addEventListener('keydown', onKeyDown)\n return () => {\n document.removeEventListener('pointerdown', onPointerDown)\n document.removeEventListener('keydown', onKeyDown)\n }\n }, [isOpen])\n\n const setRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n const renderIcon = (value: IconName | ReactNode) =>\n typeof value === 'string' && ICON_NAME_SET.has(value) ? (\n <Icon name={value as IconName} />\n ) : (\n value\n )\n\n const ctx: SpeedDialContextValue = {\n size: ACTION_SIZE[size],\n placement: TOOLTIP_PLACEMENT[direction],\n closeOnClick: closeOnActionClick,\n persistentLabels: tooltipOpen,\n requestClose: () => setOpen(false),\n }\n\n const hoverProps =\n openOnHover && !disabled\n ? { onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false) }\n : {}\n\n return (\n <div\n ref={setRootRef}\n className={clsx(styles.speedDial, className)}\n style={style as CSSProperties}\n {...hoverProps}\n {...props}\n >\n <div\n id={actionsId}\n className={clsx(styles.actions, styles[direction])}\n data-open={isOpen ? 'true' : 'false'}\n >\n <SpeedDialContext.Provider value={ctx}>\n {actions\n ? actions.map((action, index) => (\n <SpeedDialAction\n key={action.key ?? index}\n icon={action.icon}\n label={action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n color={action.color}\n />\n ))\n : children}\n </SpeedDialContext.Provider>\n </div>\n\n <IconButton\n ref={fabRef}\n rounded\n variant=\"contained\"\n color={color}\n size={size}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n aria-controls={actionsId}\n className={styles.fab}\n onClick={() => setOpen(!isOpen)}\n >\n <span className={clsx(styles.fabIcon, !openIcon && isOpen && styles.fabIconOpen)}>\n {isOpen && openIcon != null ? renderIcon(openIcon) : renderIcon(icon)}\n </span>\n </IconButton>\n </div>\n )\n})\n"],"names":["SpeedDialContext","createContext","useSpeedDial","useContext","ICON_NAME_SET","ICON_NAMES","SpeedDialAction","forwardRef","icon","label","tooltipOpen","hideTooltip","color","onClick","disabled","className","style","props","ref","dial","iconNode","jsx","Icon","button","IconButton","clsx","styles","event","placement","jsxs","Tooltip","ACTION_SIZE","TOOLTIP_PLACEMENT","SpeedDial","ariaLabel","openIcon","direction","size","open","defaultOpen","onOpenChange","openOnHover","closeOnActionClick","actions","children","forwardedRef","rootRef","useRef","fabRef","actionsId","useId","isControlled","internal","setInternal","useState","isOpen","setOpen","next","setOpenRef","useEffect","onPointerDown","onKeyDown","_a","setRootRef","node","renderIcon","value","ctx","hoverProps","action","index"],"mappings":"mMAoBaA,EAAmBC,EAAAA,cAA4C,IAAI,EAGzE,SAASC,GAA6C,CAC3D,OAAOC,EAAAA,WAAWH,CAAgB,CACpC,qdCf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KwB,EACL,QAAO,GACP,QAAQ,YACR,MAAApC,EACA,KAAAyB,EACA,SAAAvB,EACA,aAAYoB,EACZ,gBAAc,OACd,gBAAeqB,EACf,gBAAeN,EACf,UAAWvB,EAAO,IAClB,QAAS,IAAM8B,EAAQ,CAACD,CAAM,EAE9B,SAAAlC,EAAAA,IAAC,QAAK,UAAWI,OAAKC,EAAO,QAAS,CAACS,GAAYoB,GAAU7B,EAAO,WAAW,EAC5E,SAAA6B,GAAUpB,GAAY,KAAO8B,EAAW9B,CAAQ,EAAI8B,EAAWzD,CAAI,CAAA,CACtE,CAAA,CAAA,CACF,CAAA,CAAA,CAGN,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),p=require("react"),k=require("clsx"),ee=require("@tanstack/react-table"),W=require("@dnd-kit/core"),ne=require("@dnd-kit/sortable"),un=require("@dnd-kit/utilities"),me=require("./table-CZRQGNdk.cjs"),Nt=require("./Badge-DVbe1rAI.cjs"),_t=require("./Button-CYZoF18-.cjs"),Fe=require("./DatePicker-CXRsT-lt.cjs"),qe=require("./DateTimePicker-BuTIRTUX.cjs"),D=require("./Icon-B6lz-V0A.cjs"),He=require("./IconButton-CQ25TtBc.cjs"),mn=require("./Modal-D8V-JZBg.cjs"),fn=require("./MultiSelect-C4RvohFY.cjs"),Le=require("./NumberField-C3TLdAgT.cjs"),St=require("./RadioGroup-687BVZ7k.cjs"),Rt=require("./Select-1FWkryTK.cjs"),gn=require("./Slider-0joKXhPo.cjs"),Mt=require("./TextField-BL6OAJcP.cjs"),Ae=require("./TimePicker-6nHQx0P5.cjs"),X=require("./Typography-d97DdbNd.cjs"),re=require("./ConfigProvider-B_Bb6pk1.cjs"),wt=require("./Dropdown-DYYhzKSo.cjs"),pn=require("./EmptyState-DnGds1ch.cjs"),jt=require("./ListItem-Qo1Tt6Fi.cjs"),hn=require("./Loader-B5Pm8AaT.cjs"),xn=require("./Pagination-Ffv6IFIU.cjs"),$e=require("./Skeleton-DK0lAjS9.cjs"),yn=require("./errorMessage-C7N4KvUS.cjs");function Oe(t,n){if(n==null)return!1;switch(t){case"number":return typeof n=="number"&&!Number.isNaN(n);case"boolean":return typeof n=="boolean";case"multiSelect":return Array.isArray(n)&&n.length>0;case"numberRange":case"numberRangeSlider":return Array.isArray(n)&&(n[0]!=null||n[1]!=null);case"dateRange":case"timeRange":case"dateTimeRange":return Array.isArray(n)&&!!(n[0]||n[1]);default:return typeof n=="string"&&n.trim()!==""}}function bn(t,n){return t.reduce((s,i)=>Oe(i.type,n[i.key])?s+1:s,0)}const Y=t=>String(t).padStart(2,"0"),Ct=t=>`${t.getFullYear()}-${Y(t.getMonth()+1)}-${Y(t.getDate())}`,_n=t=>`${Ct(t)}T${Y(t.getHours())}:${Y(t.getMinutes())}`,Sn=t=>`${Y(t.getHours())}:${Y(t.getMinutes())}`,Qe=t=>{if(!t)return null;const n=/^\d{4}-\d{2}-\d{2}$/.test(t)?`${t}T00:00:00`:t,s=new Date(n);return Number.isNaN(s.getTime())?null:s},De=t=>{const n=Qe(t);return n?Ct(n):t.slice(0,10)},Ee=t=>{const n=Qe(t);return n?_n(n):t.slice(0,16)},te=t=>{if(/\d{4}-\d{2}-\d{2}/.test(t)){const n=Qe(t);if(n)return Sn(n)}return(t.includes("T")?t.slice(t.indexOf("T")+1):t).slice(0,5)};function wn(t,n,s){const i=String(n??"");switch(t){case"text":return i.toLowerCase().includes(String(s).toLowerCase());case"number":return Number(n)===s;case"numberRange":case"numberRangeSlider":{const[h,m]=s,f=Number(n);return(h==null||f>=h)&&(m==null||f<=m)}case"select":case"radio":return i===s;case"multiSelect":return s.includes(i);case"boolean":return!!n===s;case"date":return De(i)===De(String(s));case"dateTime":return Ee(i)===Ee(String(s));case"time":return te(i)===te(String(s));case"dateRange":case"dateTimeRange":{const h=t==="dateRange"?De:Ee,[m,f]=s,g=h(i);return(!m||g>=h(m))&&(!f||g<=h(f))}case"timeRange":{const[h,m]=s,f=te(i);return(!h||f>=te(h))&&(!m||f<=te(m))}default:return!0}}function jn(t,n,s){const i=n.filter(h=>Oe(h.type,s[h.key]));return i.length===0?t:t.filter(h=>i.every(m=>wn(m.type,h[m.key],s[m.key])))}function kt(t,n,s={}){const i=new URLSearchParams,h=s.rangeMinSuffix??"Min",m=s.rangeMaxSuffix??"Max",f=s.multiSelectFormat??"repeat";for(const g of t){const o=n[g.key];if(!Oe(g.type,o))continue;const l=g.queryKey??g.key;switch(g.type){case"multiSelect":{const d=o;f==="csv"?i.set(l,d.join(",")):f==="indexed"?d.forEach((y,_)=>i.set(`${l}[${_}]`,y)):d.forEach(y=>i.append(l,y));break}case"numberRange":case"numberRangeSlider":{const[d,y]=o;d!=null&&i.set(l+h,String(d)),y!=null&&i.set(l+m,String(y));break}case"dateRange":case"timeRange":case"dateTimeRange":{const[d,y]=o;d&&i.set(l+h,d),y&&i.set(l+m,y);break}default:i.set(l,String(o))}}return i}function vt(t,n,s={}){const i=s.rangeMinSuffix??"Min",h=s.rangeMaxSuffix??"Max",m=s.multiSelectFormat??"repeat",f={};for(const g of t){const o=g.queryKey??g.key;switch(g.type){case"multiSelect":{let l=[];if(m==="csv"){const d=n.get(o);d&&(l=d.split(",").filter(Boolean))}else if(m==="indexed")for(let d=0;n.has(`${o}[${d}]`);d++)l.push(n.get(`${o}[${d}]`));else l=n.getAll(o);l.length&&(f[g.key]=l);break}case"numberRange":case"numberRangeSlider":{const l=n.get(o+i),d=n.get(o+h);(l!=null||d!=null)&&(f[g.key]=[l!=null?Number(l):null,d!=null?Number(d):null]);break}case"dateRange":case"timeRange":case"dateTimeRange":{const l=n.get(o+i),d=n.get(o+h);(l!=null||d!=null)&&(f[g.key]=[l??"",d??""]);break}case"number":{const l=n.get(o);if(l!=null){const d=Number(l);Number.isNaN(d)||(f[g.key]=d)}break}case"boolean":{const l=n.get(o);l==="true"?f[g.key]=!0:l==="false"&&(f[g.key]=!1);break}default:{const l=n.get(o);l&&(f[g.key]=l)}}}return f}const kn="_fields_xa8i1_2",vn="_field_xa8i1_2",zn="_rangeLabel_xa8i1_15",Tn="_row_xa8i1_20",Nn="_rangeSep_xa8i1_30",Rn="_stack_xa8i1_36",Mn="_footer_xa8i1_43",Cn="_footerEnd_xa8i1_50",$={fields:kn,field:vn,rangeLabel:zn,row:Tn,rangeSep:Nn,stack:Rn,footer:Mn,footerEnd:Cn},In=(t,n)=>[{value:"",label:(t==null?void 0:t.any)??n("common.any")},{value:"true",label:(t==null?void 0:t.yes)??n("common.yes")},{value:"false",label:(t==null?void 0:t.no)??n("common.no")}],Pn=t=>t===!0?"true":t===!1?"false":"",Fn=t=>t==="true"?!0:t==="false"?!1:null;function fe({label:t,from:n,to:s,stacked:i}){return r.jsxs("div",{className:$.field,children:[r.jsx(X.Typography,{variant:"bodySmall",className:$.rangeLabel,children:t}),i?r.jsxs("div",{className:$.stack,children:[n,s]}):r.jsxs("div",{className:$.row,children:[n,r.jsx("span",{className:$.rangeSep,"aria-hidden":!0,children:"–"}),s]})]})}function qn({filter:t,value:n,onChange:s}){const i=re.useT(),{type:h,label:m,options:f=[],placeholder:g}=t;switch(h){case"text":return r.jsx(Mt.TextField,{label:m,placeholder:g,value:n??"",onChange:o=>s(o.target.value)});case"number":return r.jsx(Le.NumberField,{label:m,placeholder:g,value:n??null,onChange:o=>s(o)});case"numberRange":{const[o,l]=n??[null,null];return r.jsx(fe,{label:m,from:r.jsx(Le.NumberField,{placeholder:i("common.min"),value:o,onChange:d=>s([d,l])}),to:r.jsx(Le.NumberField,{placeholder:i("common.max"),value:l,onChange:d=>s([o,d])})})}case"numberRangeSlider":{const o=t.min??0,l=t.max??100,[d,y]=n??[null,null];return r.jsx(gn.Slider,{range:!0,label:m,min:o,max:l,step:t.step??1,value:[d??o,y??l],valueLabel:_=>{const[N,R]=_;return`${N} – ${R}`},onChange:_=>{const[N,R]=_;s([N<=o?null:N,R>=l?null:R])}})}case"select":return r.jsx(Rt.Select,{label:m,placeholder:g,options:f,value:n??"",onChange:o=>s(o)});case"radio":return r.jsx(St.RadioGroup,{label:m,orientation:t.orientation??"vertical",options:[{value:"",label:t.anyLabel??i("common.any")},...f.map(({value:o,label:l,disabled:d})=>({value:o,label:l,disabled:d}))],value:n??"",onChange:o=>s(o)});case"multiSelect":return r.jsx(fn.MultiSelect,{label:m,placeholder:g,options:f,value:n??[],onChange:o=>s(o)});case"boolean":return r.jsx(St.RadioGroup,{label:m,orientation:"horizontal",options:In(t.booleanLabels,i),value:Pn(n),onChange:o=>s(Fn(o))});case"date":return r.jsx(Fe.DatePicker,{label:m,value:n??"",onChange:o=>s(o??"")});case"dateRange":{const[o,l]=n??["",""];return r.jsx(fe,{label:m,from:r.jsx(Fe.DatePicker,{placeholder:i("common.from"),value:o,onChange:d=>s([d??"",l])}),to:r.jsx(Fe.DatePicker,{placeholder:i("common.to"),value:l,onChange:d=>s([o,d??""])})})}case"time":return r.jsx(Ae.TimePicker,{label:m,value:n??"",onChange:o=>s(o??"")});case"timeRange":{const[o,l]=n??["",""];return r.jsx(fe,{label:m,from:r.jsx(Ae.TimePicker,{placeholder:i("common.from"),value:o,onChange:d=>s([d??"",l])}),to:r.jsx(Ae.TimePicker,{placeholder:i("common.to"),value:l,onChange:d=>s([o,d??""])})})}case"dateTime":return r.jsx(qe.DateTimePicker,{label:m,value:n??"",onChange:o=>s(o??"")});case"dateTimeRange":{const[o,l]=n??["",""];return r.jsx(fe,{label:m,stacked:!0,from:r.jsx(qe.DateTimePicker,{placeholder:i("common.from"),value:o,onChange:d=>s([d??"",l])}),to:r.jsx(qe.DateTimePicker,{placeholder:i("common.to"),value:l,onChange:d=>s([o,d??""])})})}default:return null}}function Ln({filters:t,value:n,onChange:s}){const i=re.useT(),[h,m]=p.useState(!1),[f,g]=p.useState(n),o=bn(t,n),l=p.useId(),d=()=>{g(n),m(!0)},y=()=>{s(f),m(!1)};return r.jsxs(r.Fragment,{children:[r.jsx(Nt.Badge,{content:o,color:"primary",children:r.jsx(He.IconButton,{variant:"filled",size:"sm","aria-label":i("table.filters"),onClick:d,children:r.jsx(D.Icon,{name:"Filter"})})}),r.jsx(mn.Modal,{open:h,onClose:()=>m(!1),placement:"right",size:"sm",icon:"Filter",title:i("table.filters"),description:i("table.filtersDescription"),footer:r.jsx("div",{className:$.footer,children:r.jsxs("div",{className:$.footerEnd,children:[r.jsx(_t.Button,{variant:"text",size:"sm",startIcon:r.jsx(D.Icon,{name:"Trash"}),onClick:()=>g({}),children:i("common.clear")}),r.jsx(_t.Button,{type:"submit",size:"sm",form:l,startIcon:r.jsx(D.Icon,{name:"Filter"}),children:i("common.apply")})]})}),children:r.jsx("form",{id:l,className:$.fields,onSubmit:_=>{_.preventDefault(),y()},children:t.map(_=>r.jsx(qn,{filter:_,value:f[_.key],onChange:N=>g(R=>({...R,[_.key]:N}))},_.key))})})]})}const An="_root_ziri4_3",$n="_toolbar_ziri4_17",Dn="_title_ziri4_24",En="_toolbarStart_ziri4_28",Bn="_toolbarEnd_ziri4_35",Wn="_search_ziri4_41",Hn="_scroll_ziri4_9",On="_table_ziri4_56",Qn="_th_ziri4_63",Gn="_sticky_ziri4_73",Un="_td_ziri4_80",Kn="_tr_ziri4_90",Xn="_wrapCell_ziri4_97",Yn="_hoverable_ziri4_101",Jn="_striped_ziri4_104",Vn="_clickable_ziri4_107",Zn="_empty_ziri4_111",er="_menuTitle_ziri4_118",tr="_skeletonCell_ziri4_126",nr="_rowActions_ziri4_130",rr="_skeletonActions_ziri4_131",sr="_dragHandleCell_ziri4_142",ar="_dragHandle_ziri4_142",ir="_dragging_ziri4_171",or="_pinnedLeft_ziri4_179",cr="_pinnedRight_ziri4_180",lr="_skeletonActionsCell_ziri4_200",dr="_stateCell_ziri4_234",ur="_loadingOverlay_ziri4_238",mr="_footer_ziri4_248",fr="_footerMain_ziri4_254",gr="_pageSize_ziri4_261",pr="_pageSizeSelect_ziri4_267",hr="_rangeText_ziri4_270",u={root:An,toolbar:$n,title:Dn,toolbarStart:En,toolbarEnd:Bn,search:Wn,scroll:Hn,table:On,th:Qn,sticky:Gn,td:Un,tr:Kn,wrapCell:Xn,hoverable:Yn,striped:Jn,clickable:Vn,empty:Zn,menuTitle:er,skeletonCell:tr,rowActions:nr,skeletonActions:rr,dragHandleCell:sr,dragHandle:ar,dragging:ir,pinnedLeft:or,pinnedRight:cr,skeletonActionsCell:lr,stateCell:dr,loadingOverlay:ur,footer:mr,footerMain:fr,pageSize:gr,pageSizeSelect:pr,rangeText:hr},ge=Number.MAX_SAFE_INTEGER,zt=["8em","5.5em","7em","10em","4.5em","6.5em"],xr=280;function Be(t,n){return typeof t=="function"?t(n):t}function pe(t){return t.maxWidth??(t.wrap?xr:void 0)}function yr(t){return t==null||typeof t=="object"?"":String(t)}function br(t){return t==null||t===""||t===!1?r.jsx("span",{className:u.empty,"aria-hidden":!0,children:"—"}):t}function We(t){return t.toString().replace(/%2C/gi,",").replace(/%3A/gi,":").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tt(t,n){const s={pageParam:"page",sizeParam:"size",searchParam:"search",sortParam:"sort",sortOrderParam:"order",...t},i=t.rangeMinSuffix??"Min",h=t.rangeMaxSuffix??"Max",m=[s.pageParam,s.sizeParam,s.searchParam,s.sortParam,s.sortOrderParam];for(const f of n??[]){const g=f.queryKey??f.key;m.push(g,g+i,g+h)}return f=>m.includes(f)||m.some(g=>f.startsWith(`${g}[`))}function _r(t,n,s){const i={...t};return n.top+t.y<=s.top?i.y=s.top-n.top:n.bottom+t.y>=s.top+s.height&&(i.y=s.top+s.height-n.bottom),n.left+t.x<=s.left?i.x=s.left-n.left:n.right+t.x>=s.left+s.width&&(i.x=s.left+s.width-n.right),i}const Sr=({transform:t})=>({...t,x:0}),wr=({containerNodeRect:t,draggingNodeRect:n,transform:s})=>n&&t?_r(s,n,t):s,jr=[Sr,wr];function kr({id:t,cells:n,clickable:s,onClick:i}){const h=re.useT(),{setNodeRef:m,transform:f,transition:g,isDragging:o,attributes:l,listeners:d}=ne.useSortable({id:t});return r.jsxs("tr",{ref:m,className:k.clsx(u.tr,s&&u.clickable,o&&u.dragging),style:{transform:un.CSS.Translate.toString(f),transition:g,position:o?"relative":void 0,zIndex:o?1:void 0},onClick:i,children:[r.jsx("td",{className:k.clsx(u.td,u.dragHandleCell),children:r.jsx("button",{type:"button",className:u.dragHandle,"aria-label":h("table.dragHandle"),...l,...d,onClick:y=>y.stopPropagation(),children:r.jsx(D.Icon,{name:"Menu",size:"sm"})})}),n]})}function vr({enabled:t,sensors:n,onDragEnd:s,children:i}){return t?r.jsx(W.DndContext,{sensors:n,collisionDetection:W.closestCenter,modifiers:jr,onDragEnd:s,children:i}):r.jsx(r.Fragment,{children:i})}const zr=p.forwardRef(function({columns:n,data:s,getRowId:i,title:h,toolbar:m,searchable:f=!1,searchPlaceholder:g,defaultSearch:o="",debounceMs:l=300,defaultPage:d=1,defaultPageSize:y=10,pageSizeOptions:_=[10,20,50,100,200],allowAllRows:N=!0,showPageSize:R="auto",showFirstButton:It=!1,showLastButton:Pt=!1,manualPagination:Ft=!1,rowCount:Ge,defaultSort:he=null,onChange:Ue,queryMapping:qt,onExportToEmail:se,filters:b,defaultFilters:Lt,onRowClick:E,actions:ae,reorderable:H=!1,onReorder:Ke,loading:ie=!1,loadingRows:At,empty:$t,urlSync:B=!0,clearUrlOnUnmount:Xe=!0,page:Ye,onPageChange:xe,pageSize:Je,onPageSizeChange:ye,search:J,onSearchChange:be,sort:V,onSortChange:_e,filterValues:Se,onFiltersChange:we,stickyHeader:Dt=!1,striped:Et=!1,hoverable:Bt=!0,className:Wt,...Ht},Ot){const v=re.useT(),Qt=re.useTableQueryConfig(),F=p.useRef({});F.current={...Qt,...qt};const oe=p.useRef(Ue);oe.current=Ue;const ce=p.useRef(b);ce.current=b;const Ve=p.useRef(null),je=p.useRef(null),[Ze,Gt]=p.useState({start:!1,end:!1}),[q]=p.useState(()=>{const e=B&&typeof window<"u"?new URLSearchParams(window.location.search):null;return e?{...me.parseTableQuery(e,F.current),filters:b!=null&&b.length?vt(b,e,F.current):{}}:{page:null,size:null,search:"",sort:null,filters:{}}}),[et,Ut]=p.useState(()=>({pageIndex:(q.page??d)-1,pageSize:q.size??y})),[le,ke]=p.useState(q.search||o),[Kt,Xt]=p.useState(q.search||o),[tt,Yt]=p.useState(()=>q.sort?[{id:q.sort.key,desc:q.sort.direction==="desc"}]:he?[{id:he.key,desc:he.direction==="desc"}]:[]),[nt,Jt]=p.useState(()=>({...Lt,...q.filters})),z=Ft,rt=Ye!==void 0,st=Je!==void 0,at=J!==void 0,ve=V!==void 0,ze=Se!==void 0,Te={pageIndex:rt?Ye-1:et.pageIndex,pageSize:st?Je:et.pageSize},M=at?J:Kt,L=p.useMemo(()=>ve?V?[{id:V.key,desc:V.direction==="desc"}]:[]:tt,[ve,V,tt]),A=p.useMemo(()=>ze?Se:nt,[ze,Se,nt]),O=e=>{const a=Te,c=Be(e,a);c.pageIndex!==a.pageIndex&&(xe==null||xe(c.pageIndex+1)),c.pageSize!==a.pageSize&&(ye==null||ye(c.pageSize)),Ut(x=>({pageIndex:rt?x.pageIndex:c.pageIndex,pageSize:st?x.pageSize:c.pageSize}))},Ne=()=>O(e=>e.pageIndex===0?e:{...e,pageIndex:0}),Re=(e,a=!0)=>{at||Xt(e),be==null||be(e),a&&Ne()},Me=(e,a=!0)=>{const c=Be(e,L);ve||Yt(c),_e==null||_e(c[0]?{key:c[0].id,direction:c[0].desc?"desc":"asc"}:null),a&&Ne()},it=(e,a=!0)=>{ze||Jt(e),we==null||we(e),a&&Ne()},Vt=p.useMemo(()=>b&&b.length>0&&!z?jn(s,b,A):s,[b,z,s,A]),Zt=it,en=p.useMemo(()=>n.map(e=>({id:e.key,accessorFn:a=>a[e.key],enableSorting:!!e.sortable})),[n]),tn=p.useMemo(()=>{const e=_.map(a=>({value:String(a),label:String(a)}));return N?[...e,{value:"all",label:v("common.all")}]:e},[_,N]),de=p.useMemo(()=>{if(!ae)return n;const e={key:"__actions",header:"",align:"right",pinned:"right",cell:(a,c)=>r.jsx("div",{className:u.rowActions,onClick:x=>x.stopPropagation(),children:ae(a,c)})};return[...n,e]},[n,ae]),Ce=p.useMemo(()=>n.filter(e=>e.sortable),[n]),nn=e=>Me(a=>{const c=a[0];return!c||c.id!==e?[{id:e,desc:!1}]:c.desc?[]:[{id:e,desc:!0}]}),Ie=ee.useReactTable({data:Vt,columns:en,state:{pagination:Te,globalFilter:M,sorting:L},onPaginationChange:O,onGlobalFilterChange:e=>Re(Be(e,M)),onSortingChange:Me,globalFilterFn:"includesString",sortDescFirst:!1,getCoreRowModel:ee.getCoreRowModel(),getRowId:i,manualPagination:z,manualFiltering:z,manualSorting:z,...z?{rowCount:Ge??s.length}:{getPaginationRowModel:ee.getPaginationRowModel(),getFilteredRowModel:ee.getFilteredRowModel(),getSortedRowModel:ee.getSortedRowModel()}}),Q=Ie.getRowModel().rows,rn=W.useSensors(W.useSensor(W.PointerSensor,{activationConstraint:{distance:5}}),W.useSensor(W.KeyboardSensor,{coordinateGetter:ne.sortableKeyboardCoordinates})),ot=(e,a)=>i?i(e,a):String(a),sn=e=>{const{active:a,over:c}=e;if(!c||a.id===c.id||!Ke)return;const x=s.findIndex((P,w)=>ot(P,w)===a.id),j=s.findIndex((P,w)=>ot(P,w)===c.id);x<0||j<0||Ke(ne.arrayMove(s,x,j),{id:String(a.id),from:x,to:j})},C=z?Ge??s.length:Ie.getFilteredRowModel().rows.length,{pageIndex:T,pageSize:S}=Te,G=Math.max(1,Math.ceil(C/S)),an=Math.min(..._,...S<ge?[S]:[]),ct=R==="auto"?C>an:R,lt=T+1,on=C===0?0:T*S+1,cn=z?Math.min(C,T*S+Q.length):Math.min(C,lt*S);p.useEffect(()=>{J!==void 0&&ke(J)},[J]),p.useEffect(()=>{if(le===M)return;const e=setTimeout(()=>Re(le),l);return()=>clearTimeout(e)},[le,M,l]),p.useEffect(()=>{z&&C===0||T>0&&T>=G&&O(e=>({...e,pageIndex:G-1}))},[G,T,z,C]);const I=L[0]?{key:L[0].id,direction:L[0].desc?"desc":"asc"}:null,dt=()=>{const e=T+1,a=S,c=me.buildTableQuery({page:e,size:a,search:M,sort:I},F.current);return b!=null&&b.length&&kt(b,A,F.current).forEach((x,j)=>c.append(j,x)),{page:e,size:a,search:M,sort:I,filters:A,params:c,query:We(c)}};p.useEffect(()=>{var e;(e=oe.current)==null||e.call(oe,dt())},[T,S,M,L,A]);const ut=se!=null,mt=b!=null&&b.length>0,Z=p.useRef(null),ft=p.useCallback((e,a,c,x,j)=>{if(typeof window>"u"||!B)return;Z.current=window.location.pathname;const P=F.current,w=ce.current,U=me.buildTableQuery({page:e,size:a,search:c,sort:x},P);w!=null&&w.length&&kt(w,j,P).forEach((K,Pe)=>U.append(Pe,K));const dn=Tt(P,w),ue=new URLSearchParams(window.location.search);for(const K of[...ue.keys()])dn(K)&&ue.delete(K);U.forEach((K,Pe)=>ue.append(Pe,K));const yt=We(ue),bt=`${window.location.pathname}${yt?`?${yt}`:""}${window.location.hash}`;bt!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,"",bt)},[B]);p.useEffect(()=>{ft(T+1,S,M,I,A)},[T,S,M,L,A,ft]);const gt=p.useRef(B);gt.current=B;const pt=p.useRef(Xe);pt.current=Xe,p.useEffect(()=>{if(!(typeof window>"u"))return Z.current??(Z.current=window.location.pathname),()=>{if(!gt.current||!pt.current||window.location.pathname!==Z.current)return;const e=Tt(F.current,ce.current),a=new URLSearchParams(window.location.search),c=[...a.keys()].filter(e);if(c.length===0)return;for(const j of c)a.delete(j);const x=We(a);window.history.replaceState(window.history.state,"",`${window.location.pathname}${x?`?${x}`:""}${window.location.hash}`)}},[]);const ht=p.useRef(()=>{});ht.current=()=>{const e=new URLSearchParams(window.location.search),a=F.current,c=me.parseTableQuery(e,a);O(()=>({pageIndex:(c.page??d)-1,pageSize:c.size??S})),ke(c.search),Re(c.search,!1),Me(()=>c.sort?[{id:c.sort.key,desc:c.sort.direction==="desc"}]:[],!1);const x=ce.current;x!=null&&x.length&&it(vt(x,e,a),!1)},p.useEffect(()=>{if(typeof window>"u"||!B)return;const e=()=>ht.current();return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[B]),p.useEffect(()=>{yn.isDev()&&!i&&(E!=null||ae!=null||H)&&console.warn("[Table] No `getRowId` provided, so the row index is used as the React key. For a table with row interactions or changing / paged data, pass `getRowId` (e.g. `(row) => row.id`) so each row keeps its identity across sort / filter / refetch.")},[]),p.useEffect(()=>{const e=Ve.current;if(!e)return;const a=()=>{const x=e.scrollWidth>e.clientWidth+1,j=e.scrollLeft<=0,P=e.scrollLeft>=e.scrollWidth-e.clientWidth-1,w={start:x&&!j,end:x&&!P};Gt(U=>U.start===w.start&&U.end===w.end?U:w)};a(),e.addEventListener("scroll",a,{passive:!0});const c=typeof ResizeObserver<"u"?new ResizeObserver(a):null;return c==null||c.observe(e),c&&je.current&&c.observe(je.current),()=>{e.removeEventListener("scroll",a),c==null||c.disconnect()}},[]);const ln=h!=null||m!=null||f||mt||Ce.length>0||ut,xt=e=>de.map(a=>r.jsx("td",{className:k.clsx(u.td,a.pinned==="left"&&u.pinnedLeft,a.pinned==="right"&&u.pinnedRight,(a.wrap||a.maxWidth!=null)&&u.wrapCell),style:{width:a.width??(a.pinned?1:pe(a)),maxWidth:pe(a),textAlign:a.align},children:br(a.cell?a.cell(e.original,e.index):yr(e.getValue(a.key)))},a.key));return r.jsxs("div",{ref:Ot,className:k.clsx(u.root,Wt),...Ht,children:[ln&&r.jsxs("div",{className:u.toolbar,children:[r.jsxs("div",{className:u.toolbarStart,children:[h!=null&&r.jsx(X.Typography,{variant:"h4",as:"div",className:u.title,children:h}),f&&r.jsx(Mt.TextField,{className:u.search,fullWidth:!1,value:le,onChange:e=>ke(e.target.value),placeholder:g??v("common.search"),adornment:r.jsx(D.Icon,{name:"SearchNormal"}),"aria-label":v("common.search")})]}),r.jsxs("div",{className:u.toolbarEnd,children:[m,ut&&r.jsxs(wt.Dropdown,{placement:"bottom-end",trigger:r.jsx(He.IconButton,{variant:"filled",size:"sm","aria-label":v("table.export"),children:r.jsx(D.Icon,{name:"ExportArrow"})}),children:[r.jsx(X.Typography,{as:"div",variant:"caption",color:"muted",uppercase:!0,className:u.menuTitle,children:v("table.export")}),r.jsx(jt.ListItem,{clickable:!0,icon:"Sms",onClick:()=>se==null?void 0:se(dt()),children:v("table.sendOnEmail")})]}),Ce.length>0&&r.jsxs(wt.Dropdown,{placement:"bottom-end",closeOnSelect:!1,trigger:r.jsx(Nt.Badge,{dot:L.length>0,color:"primary",children:r.jsx(He.IconButton,{variant:"filled",size:"sm","aria-label":v("table.sort"),children:r.jsx(D.Icon,{name:"Sort"})})}),children:[r.jsx(X.Typography,{as:"div",variant:"caption",color:"muted",uppercase:!0,className:u.menuTitle,children:v("table.sortBy")}),Ce.map(e=>{const a=(I==null?void 0:I.key)===e.key;return r.jsx(jt.ListItem,{clickable:!0,selected:a,trailing:a?r.jsx(D.Icon,{name:(I==null?void 0:I.direction)==="desc"?"ArrowDown":"ArrowUp2"}):void 0,onClick:()=>nn(e.key),children:e.header},e.key)})]}),mt&&r.jsx(Ln,{filters:b,value:A,onChange:Zt})]})]}),r.jsx(vr,{enabled:H,sensors:rn,onDragEnd:sn,children:r.jsxs("div",{ref:Ve,className:u.scroll,"data-pin-start":Ze.start?"true":"false","data-pin-end":Ze.end?"true":"false",children:[r.jsxs("table",{ref:je,className:k.clsx(u.table,Et&&u.striped,Bt&&u.hoverable,Dt&&u.sticky),"aria-busy":ie||void 0,children:[r.jsx("thead",{children:r.jsxs("tr",{children:[H&&r.jsx("th",{className:k.clsx(u.th,u.dragHandleCell),scope:"col","aria-hidden":!0}),de.map(e=>{var c;const a=e.sortable&&((c=Ie.getColumn(e.key))==null?void 0:c.getIsSorted())||!1;return r.jsx("th",{scope:"col",className:k.clsx(u.th,e.pinned==="left"&&u.pinnedLeft,e.pinned==="right"&&u.pinnedRight,(e.wrap||e.maxWidth!=null)&&u.wrapCell),style:{width:e.width??(e.pinned?1:pe(e)),maxWidth:pe(e),textAlign:e.align},"aria-sort":e.sortable?a==="asc"?"ascending":a==="desc"?"descending":"none":void 0,children:e.header},e.key)})]})}),r.jsx("tbody",{children:Q.length>0?H?r.jsx(ne.SortableContext,{items:Q.map(e=>e.id),strategy:ne.verticalListSortingStrategy,children:Q.map(e=>r.jsx(kr,{id:e.id,clickable:!!E,onClick:E?()=>E(e.original,e.index):void 0,cells:xt(e)},e.id))}):Q.map(e=>r.jsx("tr",{className:k.clsx(u.tr,E&&u.clickable),onClick:E?()=>E(e.original,e.index):void 0,children:xt(e)},e.id)):ie?Array.from({length:At??Math.min(S===ge?10:S,10)},(e,a)=>r.jsxs("tr",{className:u.tr,"aria-hidden":"true",children:[H&&r.jsx("td",{className:k.clsx(u.td,u.dragHandleCell)}),de.map((c,x)=>r.jsx("td",{className:k.clsx(u.td,c.pinned==="left"&&u.pinnedLeft,c.pinned==="right"&&u.pinnedRight,c.key==="__actions"&&u.skeletonActionsCell),style:{width:c.width,textAlign:c.align},children:c.key==="__actions"?r.jsxs("span",{className:k.clsx(u.rowActions,u.skeletonActions),children:[r.jsx($e.Skeleton,{variant:"rect",width:"calc(var(--tz-control-height-sm) - var(--tz-space-xs))",height:"calc(var(--tz-control-height-sm) - var(--tz-space-xs))",radius:"xs"}),r.jsx($e.Skeleton,{variant:"rect",width:"calc(var(--tz-control-height-sm) - var(--tz-space-xs))",height:"calc(var(--tz-control-height-sm) - var(--tz-space-xs))",radius:"xs"})]}):r.jsx($e.Skeleton,{width:zt[(a*3+x)%zt.length],className:u.skeletonCell})},c.key))]},a)):r.jsx("tr",{children:r.jsx("td",{colSpan:Math.max(1,de.length+(H?1:0)),className:u.stateCell,children:$t??r.jsx(pn.EmptyState,{})})})})]}),ie&&Q.length>0&&r.jsx("div",{className:u.loadingOverlay,children:r.jsx(hn.Loader,{size:"lg"})})]})}),C>0&&(ct||G>1)&&r.jsxs("div",{className:u.footer,children:[r.jsx(X.Typography,{variant:"bodySmall",color:"muted",as:"span",className:u.rangeText,children:v("table.range",{from:on,to:cn,total:C})}),r.jsxs("div",{className:u.footerMain,children:[ct&&r.jsxs("div",{className:u.pageSize,children:[r.jsx(X.Typography,{variant:"bodySmall",color:"muted",as:"span",children:v("table.rowsPerPage")}),r.jsx(Rt.Select,{className:u.pageSizeSelect,fullWidth:!1,clearable:!1,showSelectedTick:!1,value:S>=ge?"all":String(S),onChange:e=>O(()=>({pageIndex:0,pageSize:e==="all"?ge:Number(e)})),options:tn})]}),G>1&&r.jsx(xn.Pagination,{count:G,page:lt,onChange:e=>O(a=>({...a,pageIndex:e-1})),showFirstButton:It,showLastButton:Pt,disabled:ie})]})]})]})});exports.Table=zr;
2
- //# sourceMappingURL=Table-DDPzTA1H.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),p=require("react"),k=require("clsx"),ee=require("@tanstack/react-table"),W=require("@dnd-kit/core"),ne=require("@dnd-kit/sortable"),un=require("@dnd-kit/utilities"),me=require("./table-CZRQGNdk.cjs"),Nt=require("./Badge-DVbe1rAI.cjs"),_t=require("./Button-CYZoF18-.cjs"),Fe=require("./DatePicker-CXRsT-lt.cjs"),qe=require("./DateTimePicker-BuTIRTUX.cjs"),D=require("./Icon-B6lz-V0A.cjs"),He=require("./IconButton-CQ25TtBc.cjs"),mn=require("./Modal-DjSOhZqd.cjs"),fn=require("./MultiSelect-C4RvohFY.cjs"),Le=require("./NumberField-C3TLdAgT.cjs"),St=require("./RadioGroup-687BVZ7k.cjs"),Rt=require("./Select-1FWkryTK.cjs"),gn=require("./Slider-0joKXhPo.cjs"),Mt=require("./TextField-BL6OAJcP.cjs"),Ae=require("./TimePicker-6nHQx0P5.cjs"),X=require("./Typography-d97DdbNd.cjs"),re=require("./ConfigProvider-B_Bb6pk1.cjs"),wt=require("./Dropdown-DYYhzKSo.cjs"),pn=require("./EmptyState-DnGds1ch.cjs"),jt=require("./ListItem-Qo1Tt6Fi.cjs"),hn=require("./Loader-B5Pm8AaT.cjs"),xn=require("./Pagination-Ffv6IFIU.cjs"),$e=require("./Skeleton-DK0lAjS9.cjs"),yn=require("./errorMessage-C7N4KvUS.cjs");function Oe(t,n){if(n==null)return!1;switch(t){case"number":return typeof n=="number"&&!Number.isNaN(n);case"boolean":return typeof n=="boolean";case"multiSelect":return Array.isArray(n)&&n.length>0;case"numberRange":case"numberRangeSlider":return Array.isArray(n)&&(n[0]!=null||n[1]!=null);case"dateRange":case"timeRange":case"dateTimeRange":return Array.isArray(n)&&!!(n[0]||n[1]);default:return typeof n=="string"&&n.trim()!==""}}function bn(t,n){return t.reduce((s,i)=>Oe(i.type,n[i.key])?s+1:s,0)}const Y=t=>String(t).padStart(2,"0"),Ct=t=>`${t.getFullYear()}-${Y(t.getMonth()+1)}-${Y(t.getDate())}`,_n=t=>`${Ct(t)}T${Y(t.getHours())}:${Y(t.getMinutes())}`,Sn=t=>`${Y(t.getHours())}:${Y(t.getMinutes())}`,Qe=t=>{if(!t)return null;const n=/^\d{4}-\d{2}-\d{2}$/.test(t)?`${t}T00:00:00`:t,s=new Date(n);return Number.isNaN(s.getTime())?null:s},De=t=>{const n=Qe(t);return n?Ct(n):t.slice(0,10)},Ee=t=>{const n=Qe(t);return n?_n(n):t.slice(0,16)},te=t=>{if(/\d{4}-\d{2}-\d{2}/.test(t)){const n=Qe(t);if(n)return Sn(n)}return(t.includes("T")?t.slice(t.indexOf("T")+1):t).slice(0,5)};function wn(t,n,s){const i=String(n??"");switch(t){case"text":return i.toLowerCase().includes(String(s).toLowerCase());case"number":return Number(n)===s;case"numberRange":case"numberRangeSlider":{const[h,m]=s,f=Number(n);return(h==null||f>=h)&&(m==null||f<=m)}case"select":case"radio":return i===s;case"multiSelect":return s.includes(i);case"boolean":return!!n===s;case"date":return De(i)===De(String(s));case"dateTime":return Ee(i)===Ee(String(s));case"time":return te(i)===te(String(s));case"dateRange":case"dateTimeRange":{const h=t==="dateRange"?De:Ee,[m,f]=s,g=h(i);return(!m||g>=h(m))&&(!f||g<=h(f))}case"timeRange":{const[h,m]=s,f=te(i);return(!h||f>=te(h))&&(!m||f<=te(m))}default:return!0}}function jn(t,n,s){const i=n.filter(h=>Oe(h.type,s[h.key]));return i.length===0?t:t.filter(h=>i.every(m=>wn(m.type,h[m.key],s[m.key])))}function kt(t,n,s={}){const i=new URLSearchParams,h=s.rangeMinSuffix??"Min",m=s.rangeMaxSuffix??"Max",f=s.multiSelectFormat??"repeat";for(const g of t){const o=n[g.key];if(!Oe(g.type,o))continue;const l=g.queryKey??g.key;switch(g.type){case"multiSelect":{const d=o;f==="csv"?i.set(l,d.join(",")):f==="indexed"?d.forEach((y,_)=>i.set(`${l}[${_}]`,y)):d.forEach(y=>i.append(l,y));break}case"numberRange":case"numberRangeSlider":{const[d,y]=o;d!=null&&i.set(l+h,String(d)),y!=null&&i.set(l+m,String(y));break}case"dateRange":case"timeRange":case"dateTimeRange":{const[d,y]=o;d&&i.set(l+h,d),y&&i.set(l+m,y);break}default:i.set(l,String(o))}}return i}function vt(t,n,s={}){const i=s.rangeMinSuffix??"Min",h=s.rangeMaxSuffix??"Max",m=s.multiSelectFormat??"repeat",f={};for(const g of t){const o=g.queryKey??g.key;switch(g.type){case"multiSelect":{let l=[];if(m==="csv"){const d=n.get(o);d&&(l=d.split(",").filter(Boolean))}else if(m==="indexed")for(let d=0;n.has(`${o}[${d}]`);d++)l.push(n.get(`${o}[${d}]`));else l=n.getAll(o);l.length&&(f[g.key]=l);break}case"numberRange":case"numberRangeSlider":{const l=n.get(o+i),d=n.get(o+h);(l!=null||d!=null)&&(f[g.key]=[l!=null?Number(l):null,d!=null?Number(d):null]);break}case"dateRange":case"timeRange":case"dateTimeRange":{const l=n.get(o+i),d=n.get(o+h);(l!=null||d!=null)&&(f[g.key]=[l??"",d??""]);break}case"number":{const l=n.get(o);if(l!=null){const d=Number(l);Number.isNaN(d)||(f[g.key]=d)}break}case"boolean":{const l=n.get(o);l==="true"?f[g.key]=!0:l==="false"&&(f[g.key]=!1);break}default:{const l=n.get(o);l&&(f[g.key]=l)}}}return f}const kn="_fields_xa8i1_2",vn="_field_xa8i1_2",zn="_rangeLabel_xa8i1_15",Tn="_row_xa8i1_20",Nn="_rangeSep_xa8i1_30",Rn="_stack_xa8i1_36",Mn="_footer_xa8i1_43",Cn="_footerEnd_xa8i1_50",$={fields:kn,field:vn,rangeLabel:zn,row:Tn,rangeSep:Nn,stack:Rn,footer:Mn,footerEnd:Cn},In=(t,n)=>[{value:"",label:(t==null?void 0:t.any)??n("common.any")},{value:"true",label:(t==null?void 0:t.yes)??n("common.yes")},{value:"false",label:(t==null?void 0:t.no)??n("common.no")}],Pn=t=>t===!0?"true":t===!1?"false":"",Fn=t=>t==="true"?!0:t==="false"?!1:null;function fe({label:t,from:n,to:s,stacked:i}){return r.jsxs("div",{className:$.field,children:[r.jsx(X.Typography,{variant:"bodySmall",className:$.rangeLabel,children:t}),i?r.jsxs("div",{className:$.stack,children:[n,s]}):r.jsxs("div",{className:$.row,children:[n,r.jsx("span",{className:$.rangeSep,"aria-hidden":!0,children:"–"}),s]})]})}function qn({filter:t,value:n,onChange:s}){const i=re.useT(),{type:h,label:m,options:f=[],placeholder:g}=t;switch(h){case"text":return r.jsx(Mt.TextField,{label:m,placeholder:g,value:n??"",onChange:o=>s(o.target.value)});case"number":return r.jsx(Le.NumberField,{label:m,placeholder:g,value:n??null,onChange:o=>s(o)});case"numberRange":{const[o,l]=n??[null,null];return r.jsx(fe,{label:m,from:r.jsx(Le.NumberField,{placeholder:i("common.min"),value:o,onChange:d=>s([d,l])}),to:r.jsx(Le.NumberField,{placeholder:i("common.max"),value:l,onChange:d=>s([o,d])})})}case"numberRangeSlider":{const o=t.min??0,l=t.max??100,[d,y]=n??[null,null];return r.jsx(gn.Slider,{range:!0,label:m,min:o,max:l,step:t.step??1,value:[d??o,y??l],valueLabel:_=>{const[N,R]=_;return`${N} – ${R}`},onChange:_=>{const[N,R]=_;s([N<=o?null:N,R>=l?null:R])}})}case"select":return r.jsx(Rt.Select,{label:m,placeholder:g,options:f,value:n??"",onChange:o=>s(o)});case"radio":return r.jsx(St.RadioGroup,{label:m,orientation:t.orientation??"vertical",options:[{value:"",label:t.anyLabel??i("common.any")},...f.map(({value:o,label:l,disabled:d})=>({value:o,label:l,disabled:d}))],value:n??"",onChange:o=>s(o)});case"multiSelect":return r.jsx(fn.MultiSelect,{label:m,placeholder:g,options:f,value:n??[],onChange:o=>s(o)});case"boolean":return r.jsx(St.RadioGroup,{label:m,orientation:"horizontal",options:In(t.booleanLabels,i),value:Pn(n),onChange:o=>s(Fn(o))});case"date":return r.jsx(Fe.DatePicker,{label:m,value:n??"",onChange:o=>s(o??"")});case"dateRange":{const[o,l]=n??["",""];return r.jsx(fe,{label:m,from:r.jsx(Fe.DatePicker,{placeholder:i("common.from"),value:o,onChange:d=>s([d??"",l])}),to:r.jsx(Fe.DatePicker,{placeholder:i("common.to"),value:l,onChange:d=>s([o,d??""])})})}case"time":return r.jsx(Ae.TimePicker,{label:m,value:n??"",onChange:o=>s(o??"")});case"timeRange":{const[o,l]=n??["",""];return r.jsx(fe,{label:m,from:r.jsx(Ae.TimePicker,{placeholder:i("common.from"),value:o,onChange:d=>s([d??"",l])}),to:r.jsx(Ae.TimePicker,{placeholder:i("common.to"),value:l,onChange:d=>s([o,d??""])})})}case"dateTime":return r.jsx(qe.DateTimePicker,{label:m,value:n??"",onChange:o=>s(o??"")});case"dateTimeRange":{const[o,l]=n??["",""];return r.jsx(fe,{label:m,stacked:!0,from:r.jsx(qe.DateTimePicker,{placeholder:i("common.from"),value:o,onChange:d=>s([d??"",l])}),to:r.jsx(qe.DateTimePicker,{placeholder:i("common.to"),value:l,onChange:d=>s([o,d??""])})})}default:return null}}function Ln({filters:t,value:n,onChange:s}){const i=re.useT(),[h,m]=p.useState(!1),[f,g]=p.useState(n),o=bn(t,n),l=p.useId(),d=()=>{g(n),m(!0)},y=()=>{s(f),m(!1)};return r.jsxs(r.Fragment,{children:[r.jsx(Nt.Badge,{content:o,color:"primary",children:r.jsx(He.IconButton,{variant:"filled",size:"sm","aria-label":i("table.filters"),onClick:d,children:r.jsx(D.Icon,{name:"Filter"})})}),r.jsx(mn.Modal,{open:h,onClose:()=>m(!1),placement:"right",size:"sm",icon:"Filter",title:i("table.filters"),description:i("table.filtersDescription"),footer:r.jsx("div",{className:$.footer,children:r.jsxs("div",{className:$.footerEnd,children:[r.jsx(_t.Button,{variant:"text",size:"sm",startIcon:r.jsx(D.Icon,{name:"Trash"}),onClick:()=>g({}),children:i("common.clear")}),r.jsx(_t.Button,{type:"submit",size:"sm",form:l,startIcon:r.jsx(D.Icon,{name:"Filter"}),children:i("common.apply")})]})}),children:r.jsx("form",{id:l,className:$.fields,onSubmit:_=>{_.preventDefault(),y()},children:t.map(_=>r.jsx(qn,{filter:_,value:f[_.key],onChange:N=>g(R=>({...R,[_.key]:N}))},_.key))})})]})}const An="_root_ziri4_3",$n="_toolbar_ziri4_17",Dn="_title_ziri4_24",En="_toolbarStart_ziri4_28",Bn="_toolbarEnd_ziri4_35",Wn="_search_ziri4_41",Hn="_scroll_ziri4_9",On="_table_ziri4_56",Qn="_th_ziri4_63",Gn="_sticky_ziri4_73",Un="_td_ziri4_80",Kn="_tr_ziri4_90",Xn="_wrapCell_ziri4_97",Yn="_hoverable_ziri4_101",Jn="_striped_ziri4_104",Vn="_clickable_ziri4_107",Zn="_empty_ziri4_111",er="_menuTitle_ziri4_118",tr="_skeletonCell_ziri4_126",nr="_rowActions_ziri4_130",rr="_skeletonActions_ziri4_131",sr="_dragHandleCell_ziri4_142",ar="_dragHandle_ziri4_142",ir="_dragging_ziri4_171",or="_pinnedLeft_ziri4_179",cr="_pinnedRight_ziri4_180",lr="_skeletonActionsCell_ziri4_200",dr="_stateCell_ziri4_234",ur="_loadingOverlay_ziri4_238",mr="_footer_ziri4_248",fr="_footerMain_ziri4_254",gr="_pageSize_ziri4_261",pr="_pageSizeSelect_ziri4_267",hr="_rangeText_ziri4_270",u={root:An,toolbar:$n,title:Dn,toolbarStart:En,toolbarEnd:Bn,search:Wn,scroll:Hn,table:On,th:Qn,sticky:Gn,td:Un,tr:Kn,wrapCell:Xn,hoverable:Yn,striped:Jn,clickable:Vn,empty:Zn,menuTitle:er,skeletonCell:tr,rowActions:nr,skeletonActions:rr,dragHandleCell:sr,dragHandle:ar,dragging:ir,pinnedLeft:or,pinnedRight:cr,skeletonActionsCell:lr,stateCell:dr,loadingOverlay:ur,footer:mr,footerMain:fr,pageSize:gr,pageSizeSelect:pr,rangeText:hr},ge=Number.MAX_SAFE_INTEGER,zt=["8em","5.5em","7em","10em","4.5em","6.5em"],xr=280;function Be(t,n){return typeof t=="function"?t(n):t}function pe(t){return t.maxWidth??(t.wrap?xr:void 0)}function yr(t){return t==null||typeof t=="object"?"":String(t)}function br(t){return t==null||t===""||t===!1?r.jsx("span",{className:u.empty,"aria-hidden":!0,children:"—"}):t}function We(t){return t.toString().replace(/%2C/gi,",").replace(/%3A/gi,":").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tt(t,n){const s={pageParam:"page",sizeParam:"size",searchParam:"search",sortParam:"sort",sortOrderParam:"order",...t},i=t.rangeMinSuffix??"Min",h=t.rangeMaxSuffix??"Max",m=[s.pageParam,s.sizeParam,s.searchParam,s.sortParam,s.sortOrderParam];for(const f of n??[]){const g=f.queryKey??f.key;m.push(g,g+i,g+h)}return f=>m.includes(f)||m.some(g=>f.startsWith(`${g}[`))}function _r(t,n,s){const i={...t};return n.top+t.y<=s.top?i.y=s.top-n.top:n.bottom+t.y>=s.top+s.height&&(i.y=s.top+s.height-n.bottom),n.left+t.x<=s.left?i.x=s.left-n.left:n.right+t.x>=s.left+s.width&&(i.x=s.left+s.width-n.right),i}const Sr=({transform:t})=>({...t,x:0}),wr=({containerNodeRect:t,draggingNodeRect:n,transform:s})=>n&&t?_r(s,n,t):s,jr=[Sr,wr];function kr({id:t,cells:n,clickable:s,onClick:i}){const h=re.useT(),{setNodeRef:m,transform:f,transition:g,isDragging:o,attributes:l,listeners:d}=ne.useSortable({id:t});return r.jsxs("tr",{ref:m,className:k.clsx(u.tr,s&&u.clickable,o&&u.dragging),style:{transform:un.CSS.Translate.toString(f),transition:g,position:o?"relative":void 0,zIndex:o?1:void 0},onClick:i,children:[r.jsx("td",{className:k.clsx(u.td,u.dragHandleCell),children:r.jsx("button",{type:"button",className:u.dragHandle,"aria-label":h("table.dragHandle"),...l,...d,onClick:y=>y.stopPropagation(),children:r.jsx(D.Icon,{name:"Menu",size:"sm"})})}),n]})}function vr({enabled:t,sensors:n,onDragEnd:s,children:i}){return t?r.jsx(W.DndContext,{sensors:n,collisionDetection:W.closestCenter,modifiers:jr,onDragEnd:s,children:i}):r.jsx(r.Fragment,{children:i})}const zr=p.forwardRef(function({columns:n,data:s,getRowId:i,title:h,toolbar:m,searchable:f=!1,searchPlaceholder:g,defaultSearch:o="",debounceMs:l=300,defaultPage:d=1,defaultPageSize:y=10,pageSizeOptions:_=[10,20,50,100,200],allowAllRows:N=!0,showPageSize:R="auto",showFirstButton:It=!1,showLastButton:Pt=!1,manualPagination:Ft=!1,rowCount:Ge,defaultSort:he=null,onChange:Ue,queryMapping:qt,onExportToEmail:se,filters:b,defaultFilters:Lt,onRowClick:E,actions:ae,reorderable:H=!1,onReorder:Ke,loading:ie=!1,loadingRows:At,empty:$t,urlSync:B=!0,clearUrlOnUnmount:Xe=!0,page:Ye,onPageChange:xe,pageSize:Je,onPageSizeChange:ye,search:J,onSearchChange:be,sort:V,onSortChange:_e,filterValues:Se,onFiltersChange:we,stickyHeader:Dt=!1,striped:Et=!1,hoverable:Bt=!0,className:Wt,...Ht},Ot){const v=re.useT(),Qt=re.useTableQueryConfig(),F=p.useRef({});F.current={...Qt,...qt};const oe=p.useRef(Ue);oe.current=Ue;const ce=p.useRef(b);ce.current=b;const Ve=p.useRef(null),je=p.useRef(null),[Ze,Gt]=p.useState({start:!1,end:!1}),[q]=p.useState(()=>{const e=B&&typeof window<"u"?new URLSearchParams(window.location.search):null;return e?{...me.parseTableQuery(e,F.current),filters:b!=null&&b.length?vt(b,e,F.current):{}}:{page:null,size:null,search:"",sort:null,filters:{}}}),[et,Ut]=p.useState(()=>({pageIndex:(q.page??d)-1,pageSize:q.size??y})),[le,ke]=p.useState(q.search||o),[Kt,Xt]=p.useState(q.search||o),[tt,Yt]=p.useState(()=>q.sort?[{id:q.sort.key,desc:q.sort.direction==="desc"}]:he?[{id:he.key,desc:he.direction==="desc"}]:[]),[nt,Jt]=p.useState(()=>({...Lt,...q.filters})),z=Ft,rt=Ye!==void 0,st=Je!==void 0,at=J!==void 0,ve=V!==void 0,ze=Se!==void 0,Te={pageIndex:rt?Ye-1:et.pageIndex,pageSize:st?Je:et.pageSize},M=at?J:Kt,L=p.useMemo(()=>ve?V?[{id:V.key,desc:V.direction==="desc"}]:[]:tt,[ve,V,tt]),A=p.useMemo(()=>ze?Se:nt,[ze,Se,nt]),O=e=>{const a=Te,c=Be(e,a);c.pageIndex!==a.pageIndex&&(xe==null||xe(c.pageIndex+1)),c.pageSize!==a.pageSize&&(ye==null||ye(c.pageSize)),Ut(x=>({pageIndex:rt?x.pageIndex:c.pageIndex,pageSize:st?x.pageSize:c.pageSize}))},Ne=()=>O(e=>e.pageIndex===0?e:{...e,pageIndex:0}),Re=(e,a=!0)=>{at||Xt(e),be==null||be(e),a&&Ne()},Me=(e,a=!0)=>{const c=Be(e,L);ve||Yt(c),_e==null||_e(c[0]?{key:c[0].id,direction:c[0].desc?"desc":"asc"}:null),a&&Ne()},it=(e,a=!0)=>{ze||Jt(e),we==null||we(e),a&&Ne()},Vt=p.useMemo(()=>b&&b.length>0&&!z?jn(s,b,A):s,[b,z,s,A]),Zt=it,en=p.useMemo(()=>n.map(e=>({id:e.key,accessorFn:a=>a[e.key],enableSorting:!!e.sortable})),[n]),tn=p.useMemo(()=>{const e=_.map(a=>({value:String(a),label:String(a)}));return N?[...e,{value:"all",label:v("common.all")}]:e},[_,N]),de=p.useMemo(()=>{if(!ae)return n;const e={key:"__actions",header:"",align:"right",pinned:"right",cell:(a,c)=>r.jsx("div",{className:u.rowActions,onClick:x=>x.stopPropagation(),children:ae(a,c)})};return[...n,e]},[n,ae]),Ce=p.useMemo(()=>n.filter(e=>e.sortable),[n]),nn=e=>Me(a=>{const c=a[0];return!c||c.id!==e?[{id:e,desc:!1}]:c.desc?[]:[{id:e,desc:!0}]}),Ie=ee.useReactTable({data:Vt,columns:en,state:{pagination:Te,globalFilter:M,sorting:L},onPaginationChange:O,onGlobalFilterChange:e=>Re(Be(e,M)),onSortingChange:Me,globalFilterFn:"includesString",sortDescFirst:!1,getCoreRowModel:ee.getCoreRowModel(),getRowId:i,manualPagination:z,manualFiltering:z,manualSorting:z,...z?{rowCount:Ge??s.length}:{getPaginationRowModel:ee.getPaginationRowModel(),getFilteredRowModel:ee.getFilteredRowModel(),getSortedRowModel:ee.getSortedRowModel()}}),Q=Ie.getRowModel().rows,rn=W.useSensors(W.useSensor(W.PointerSensor,{activationConstraint:{distance:5}}),W.useSensor(W.KeyboardSensor,{coordinateGetter:ne.sortableKeyboardCoordinates})),ot=(e,a)=>i?i(e,a):String(a),sn=e=>{const{active:a,over:c}=e;if(!c||a.id===c.id||!Ke)return;const x=s.findIndex((P,w)=>ot(P,w)===a.id),j=s.findIndex((P,w)=>ot(P,w)===c.id);x<0||j<0||Ke(ne.arrayMove(s,x,j),{id:String(a.id),from:x,to:j})},C=z?Ge??s.length:Ie.getFilteredRowModel().rows.length,{pageIndex:T,pageSize:S}=Te,G=Math.max(1,Math.ceil(C/S)),an=Math.min(..._,...S<ge?[S]:[]),ct=R==="auto"?C>an:R,lt=T+1,on=C===0?0:T*S+1,cn=z?Math.min(C,T*S+Q.length):Math.min(C,lt*S);p.useEffect(()=>{J!==void 0&&ke(J)},[J]),p.useEffect(()=>{if(le===M)return;const e=setTimeout(()=>Re(le),l);return()=>clearTimeout(e)},[le,M,l]),p.useEffect(()=>{z&&C===0||T>0&&T>=G&&O(e=>({...e,pageIndex:G-1}))},[G,T,z,C]);const I=L[0]?{key:L[0].id,direction:L[0].desc?"desc":"asc"}:null,dt=()=>{const e=T+1,a=S,c=me.buildTableQuery({page:e,size:a,search:M,sort:I},F.current);return b!=null&&b.length&&kt(b,A,F.current).forEach((x,j)=>c.append(j,x)),{page:e,size:a,search:M,sort:I,filters:A,params:c,query:We(c)}};p.useEffect(()=>{var e;(e=oe.current)==null||e.call(oe,dt())},[T,S,M,L,A]);const ut=se!=null,mt=b!=null&&b.length>0,Z=p.useRef(null),ft=p.useCallback((e,a,c,x,j)=>{if(typeof window>"u"||!B)return;Z.current=window.location.pathname;const P=F.current,w=ce.current,U=me.buildTableQuery({page:e,size:a,search:c,sort:x},P);w!=null&&w.length&&kt(w,j,P).forEach((K,Pe)=>U.append(Pe,K));const dn=Tt(P,w),ue=new URLSearchParams(window.location.search);for(const K of[...ue.keys()])dn(K)&&ue.delete(K);U.forEach((K,Pe)=>ue.append(Pe,K));const yt=We(ue),bt=`${window.location.pathname}${yt?`?${yt}`:""}${window.location.hash}`;bt!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,"",bt)},[B]);p.useEffect(()=>{ft(T+1,S,M,I,A)},[T,S,M,L,A,ft]);const gt=p.useRef(B);gt.current=B;const pt=p.useRef(Xe);pt.current=Xe,p.useEffect(()=>{if(!(typeof window>"u"))return Z.current??(Z.current=window.location.pathname),()=>{if(!gt.current||!pt.current||window.location.pathname!==Z.current)return;const e=Tt(F.current,ce.current),a=new URLSearchParams(window.location.search),c=[...a.keys()].filter(e);if(c.length===0)return;for(const j of c)a.delete(j);const x=We(a);window.history.replaceState(window.history.state,"",`${window.location.pathname}${x?`?${x}`:""}${window.location.hash}`)}},[]);const ht=p.useRef(()=>{});ht.current=()=>{const e=new URLSearchParams(window.location.search),a=F.current,c=me.parseTableQuery(e,a);O(()=>({pageIndex:(c.page??d)-1,pageSize:c.size??S})),ke(c.search),Re(c.search,!1),Me(()=>c.sort?[{id:c.sort.key,desc:c.sort.direction==="desc"}]:[],!1);const x=ce.current;x!=null&&x.length&&it(vt(x,e,a),!1)},p.useEffect(()=>{if(typeof window>"u"||!B)return;const e=()=>ht.current();return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[B]),p.useEffect(()=>{yn.isDev()&&!i&&(E!=null||ae!=null||H)&&console.warn("[Table] No `getRowId` provided, so the row index is used as the React key. For a table with row interactions or changing / paged data, pass `getRowId` (e.g. `(row) => row.id`) so each row keeps its identity across sort / filter / refetch.")},[]),p.useEffect(()=>{const e=Ve.current;if(!e)return;const a=()=>{const x=e.scrollWidth>e.clientWidth+1,j=e.scrollLeft<=0,P=e.scrollLeft>=e.scrollWidth-e.clientWidth-1,w={start:x&&!j,end:x&&!P};Gt(U=>U.start===w.start&&U.end===w.end?U:w)};a(),e.addEventListener("scroll",a,{passive:!0});const c=typeof ResizeObserver<"u"?new ResizeObserver(a):null;return c==null||c.observe(e),c&&je.current&&c.observe(je.current),()=>{e.removeEventListener("scroll",a),c==null||c.disconnect()}},[]);const ln=h!=null||m!=null||f||mt||Ce.length>0||ut,xt=e=>de.map(a=>r.jsx("td",{className:k.clsx(u.td,a.pinned==="left"&&u.pinnedLeft,a.pinned==="right"&&u.pinnedRight,(a.wrap||a.maxWidth!=null)&&u.wrapCell),style:{width:a.width??(a.pinned?1:pe(a)),maxWidth:pe(a),textAlign:a.align},children:br(a.cell?a.cell(e.original,e.index):yr(e.getValue(a.key)))},a.key));return r.jsxs("div",{ref:Ot,className:k.clsx(u.root,Wt),...Ht,children:[ln&&r.jsxs("div",{className:u.toolbar,children:[r.jsxs("div",{className:u.toolbarStart,children:[h!=null&&r.jsx(X.Typography,{variant:"h4",as:"div",className:u.title,children:h}),f&&r.jsx(Mt.TextField,{className:u.search,fullWidth:!1,value:le,onChange:e=>ke(e.target.value),placeholder:g??v("common.search"),adornment:r.jsx(D.Icon,{name:"SearchNormal"}),"aria-label":v("common.search")})]}),r.jsxs("div",{className:u.toolbarEnd,children:[m,ut&&r.jsxs(wt.Dropdown,{placement:"bottom-end",trigger:r.jsx(He.IconButton,{variant:"filled",size:"sm","aria-label":v("table.export"),children:r.jsx(D.Icon,{name:"ExportArrow"})}),children:[r.jsx(X.Typography,{as:"div",variant:"caption",color:"muted",uppercase:!0,className:u.menuTitle,children:v("table.export")}),r.jsx(jt.ListItem,{clickable:!0,icon:"Sms",onClick:()=>se==null?void 0:se(dt()),children:v("table.sendOnEmail")})]}),Ce.length>0&&r.jsxs(wt.Dropdown,{placement:"bottom-end",closeOnSelect:!1,trigger:r.jsx(Nt.Badge,{dot:L.length>0,color:"primary",children:r.jsx(He.IconButton,{variant:"filled",size:"sm","aria-label":v("table.sort"),children:r.jsx(D.Icon,{name:"Sort"})})}),children:[r.jsx(X.Typography,{as:"div",variant:"caption",color:"muted",uppercase:!0,className:u.menuTitle,children:v("table.sortBy")}),Ce.map(e=>{const a=(I==null?void 0:I.key)===e.key;return r.jsx(jt.ListItem,{clickable:!0,selected:a,trailing:a?r.jsx(D.Icon,{name:(I==null?void 0:I.direction)==="desc"?"ArrowDown":"ArrowUp2"}):void 0,onClick:()=>nn(e.key),children:e.header},e.key)})]}),mt&&r.jsx(Ln,{filters:b,value:A,onChange:Zt})]})]}),r.jsx(vr,{enabled:H,sensors:rn,onDragEnd:sn,children:r.jsxs("div",{ref:Ve,className:u.scroll,"data-pin-start":Ze.start?"true":"false","data-pin-end":Ze.end?"true":"false",children:[r.jsxs("table",{ref:je,className:k.clsx(u.table,Et&&u.striped,Bt&&u.hoverable,Dt&&u.sticky),"aria-busy":ie||void 0,children:[r.jsx("thead",{children:r.jsxs("tr",{children:[H&&r.jsx("th",{className:k.clsx(u.th,u.dragHandleCell),scope:"col","aria-hidden":!0}),de.map(e=>{var c;const a=e.sortable&&((c=Ie.getColumn(e.key))==null?void 0:c.getIsSorted())||!1;return r.jsx("th",{scope:"col",className:k.clsx(u.th,e.pinned==="left"&&u.pinnedLeft,e.pinned==="right"&&u.pinnedRight,(e.wrap||e.maxWidth!=null)&&u.wrapCell),style:{width:e.width??(e.pinned?1:pe(e)),maxWidth:pe(e),textAlign:e.align},"aria-sort":e.sortable?a==="asc"?"ascending":a==="desc"?"descending":"none":void 0,children:e.header},e.key)})]})}),r.jsx("tbody",{children:Q.length>0?H?r.jsx(ne.SortableContext,{items:Q.map(e=>e.id),strategy:ne.verticalListSortingStrategy,children:Q.map(e=>r.jsx(kr,{id:e.id,clickable:!!E,onClick:E?()=>E(e.original,e.index):void 0,cells:xt(e)},e.id))}):Q.map(e=>r.jsx("tr",{className:k.clsx(u.tr,E&&u.clickable),onClick:E?()=>E(e.original,e.index):void 0,children:xt(e)},e.id)):ie?Array.from({length:At??Math.min(S===ge?10:S,10)},(e,a)=>r.jsxs("tr",{className:u.tr,"aria-hidden":"true",children:[H&&r.jsx("td",{className:k.clsx(u.td,u.dragHandleCell)}),de.map((c,x)=>r.jsx("td",{className:k.clsx(u.td,c.pinned==="left"&&u.pinnedLeft,c.pinned==="right"&&u.pinnedRight,c.key==="__actions"&&u.skeletonActionsCell),style:{width:c.width,textAlign:c.align},children:c.key==="__actions"?r.jsxs("span",{className:k.clsx(u.rowActions,u.skeletonActions),children:[r.jsx($e.Skeleton,{variant:"rect",width:"calc(var(--tz-control-height-sm) - var(--tz-space-xs))",height:"calc(var(--tz-control-height-sm) - var(--tz-space-xs))",radius:"xs"}),r.jsx($e.Skeleton,{variant:"rect",width:"calc(var(--tz-control-height-sm) - var(--tz-space-xs))",height:"calc(var(--tz-control-height-sm) - var(--tz-space-xs))",radius:"xs"})]}):r.jsx($e.Skeleton,{width:zt[(a*3+x)%zt.length],className:u.skeletonCell})},c.key))]},a)):r.jsx("tr",{children:r.jsx("td",{colSpan:Math.max(1,de.length+(H?1:0)),className:u.stateCell,children:$t??r.jsx(pn.EmptyState,{})})})})]}),ie&&Q.length>0&&r.jsx("div",{className:u.loadingOverlay,children:r.jsx(hn.Loader,{size:"lg"})})]})}),C>0&&(ct||G>1)&&r.jsxs("div",{className:u.footer,children:[r.jsx(X.Typography,{variant:"bodySmall",color:"muted",as:"span",className:u.rangeText,children:v("table.range",{from:on,to:cn,total:C})}),r.jsxs("div",{className:u.footerMain,children:[ct&&r.jsxs("div",{className:u.pageSize,children:[r.jsx(X.Typography,{variant:"bodySmall",color:"muted",as:"span",children:v("table.rowsPerPage")}),r.jsx(Rt.Select,{className:u.pageSizeSelect,fullWidth:!1,clearable:!1,showSelectedTick:!1,value:S>=ge?"all":String(S),onChange:e=>O(()=>({pageIndex:0,pageSize:e==="all"?ge:Number(e)})),options:tn})]}),G>1&&r.jsx(xn.Pagination,{count:G,page:lt,onChange:e=>O(a=>({...a,pageIndex:e-1})),showFirstButton:It,showLastButton:Pt,disabled:ie})]})]})]})});exports.Table=zr;
2
+ //# sourceMappingURL=Table-CFl3OYlo.cjs.map