@raystack/apsara 1.0.0-rc.1 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/components/alert-dialog/alert-dialog.cjs +2 -1
  2. package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
  3. package/dist/components/alert-dialog/alert-dialog.d.ts +10 -9
  4. package/dist/components/alert-dialog/alert-dialog.d.ts.map +1 -1
  5. package/dist/components/alert-dialog/alert-dialog.js +2 -1
  6. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  7. package/dist/components/calendar/calendar.cjs +1 -1
  8. package/dist/components/calendar/calendar.cjs.map +1 -1
  9. package/dist/components/calendar/calendar.d.ts.map +1 -1
  10. package/dist/components/calendar/calendar.js +1 -1
  11. package/dist/components/calendar/calendar.js.map +1 -1
  12. package/dist/components/calendar/date-picker.cjs +1 -1
  13. package/dist/components/calendar/date-picker.cjs.map +1 -1
  14. package/dist/components/calendar/date-picker.js +1 -1
  15. package/dist/components/calendar/date-picker.js.map +1 -1
  16. package/dist/components/combobox/combobox.cjs +4 -1
  17. package/dist/components/combobox/combobox.cjs.map +1 -1
  18. package/dist/components/combobox/combobox.d.ts +3 -0
  19. package/dist/components/combobox/combobox.d.ts.map +1 -1
  20. package/dist/components/combobox/combobox.js +4 -1
  21. package/dist/components/combobox/combobox.js.map +1 -1
  22. package/dist/components/data-table/utils/filter-operations.cjs +12 -3
  23. package/dist/components/data-table/utils/filter-operations.cjs.map +1 -1
  24. package/dist/components/data-table/utils/filter-operations.d.ts.map +1 -1
  25. package/dist/components/data-table/utils/filter-operations.js +12 -3
  26. package/dist/components/data-table/utils/filter-operations.js.map +1 -1
  27. package/dist/components/dialog/dialog.cjs +2 -1
  28. package/dist/components/dialog/dialog.cjs.map +1 -1
  29. package/dist/components/dialog/dialog.d.ts +1 -0
  30. package/dist/components/dialog/dialog.d.ts.map +1 -1
  31. package/dist/components/dialog/dialog.js +2 -1
  32. package/dist/components/dialog/dialog.js.map +1 -1
  33. package/dist/components/drawer/drawer-content.cjs +1 -1
  34. package/dist/components/drawer/drawer-content.cjs.map +1 -1
  35. package/dist/components/drawer/drawer-content.d.ts +1 -1
  36. package/dist/components/drawer/drawer-content.d.ts.map +1 -1
  37. package/dist/components/drawer/drawer-content.js +2 -2
  38. package/dist/components/drawer/drawer-content.js.map +1 -1
  39. package/dist/components/drawer/drawer-misc.cjs +2 -2
  40. package/dist/components/drawer/drawer-misc.cjs.map +1 -1
  41. package/dist/components/drawer/drawer-misc.d.ts +1 -1
  42. package/dist/components/drawer/drawer-misc.d.ts.map +1 -1
  43. package/dist/components/drawer/drawer-misc.js +3 -3
  44. package/dist/components/drawer/drawer-misc.js.map +1 -1
  45. package/dist/components/drawer/drawer-root.cjs +1 -1
  46. package/dist/components/drawer/drawer-root.cjs.map +1 -1
  47. package/dist/components/drawer/drawer-root.d.ts +1 -1
  48. package/dist/components/drawer/drawer-root.d.ts.map +1 -1
  49. package/dist/components/drawer/drawer-root.js +2 -2
  50. package/dist/components/drawer/drawer-root.js.map +1 -1
  51. package/dist/components/drawer/drawer.cjs +3 -2
  52. package/dist/components/drawer/drawer.cjs.map +1 -1
  53. package/dist/components/drawer/drawer.d.ts +2 -1
  54. package/dist/components/drawer/drawer.d.ts.map +1 -1
  55. package/dist/components/drawer/drawer.js +4 -3
  56. package/dist/components/drawer/drawer.js.map +1 -1
  57. package/dist/components/flex/flex.d.ts +3 -3
  58. package/dist/components/menu/menu.cjs +3 -1
  59. package/dist/components/menu/menu.cjs.map +1 -1
  60. package/dist/components/menu/menu.d.ts +2 -0
  61. package/dist/components/menu/menu.d.ts.map +1 -1
  62. package/dist/components/menu/menu.js +3 -1
  63. package/dist/components/menu/menu.js.map +1 -1
  64. package/dist/components/popover/popover.cjs +2 -1
  65. package/dist/components/popover/popover.cjs.map +1 -1
  66. package/dist/components/popover/popover.d.ts +1 -0
  67. package/dist/components/popover/popover.d.ts.map +1 -1
  68. package/dist/components/popover/popover.js +2 -1
  69. package/dist/components/popover/popover.js.map +1 -1
  70. package/dist/components/scroll-area/scroll-area-scrollbar.cjs +1 -1
  71. package/dist/components/scroll-area/scroll-area-scrollbar.cjs.map +1 -1
  72. package/dist/components/scroll-area/scroll-area-scrollbar.d.ts.map +1 -1
  73. package/dist/components/scroll-area/scroll-area-scrollbar.js +1 -1
  74. package/dist/components/scroll-area/scroll-area-scrollbar.js.map +1 -1
  75. package/dist/components/text/text.d.ts +2 -2
  76. package/dist/components/text-area/text-area.cjs +1 -1
  77. package/dist/components/text-area/text-area.cjs.map +1 -1
  78. package/dist/components/text-area/text-area.d.ts.map +1 -1
  79. package/dist/components/text-area/text-area.js +1 -1
  80. package/dist/components/text-area/text-area.js.map +1 -1
  81. package/dist/components/tooltip/tooltip.cjs +2 -1
  82. package/dist/components/tooltip/tooltip.cjs.map +1 -1
  83. package/dist/components/tooltip/tooltip.d.ts +1 -0
  84. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  85. package/dist/components/tooltip/tooltip.js +2 -1
  86. package/dist/components/tooltip/tooltip.js.map +1 -1
  87. package/dist/style.css +1 -1
  88. package/package.json +3 -3
@@ -13,7 +13,8 @@ const AlertDialog = Object.assign(react.AlertDialog.Root, {
13
13
  Close: react.AlertDialog.Close,
14
14
  CloseButton: alertDialogMisc.CloseButton,
15
15
  Title: alertDialogMisc.AlertDialogTitle,
16
- Description: alertDialogMisc.AlertDialogDescription
16
+ Description: alertDialogMisc.AlertDialogDescription,
17
+ createHandle: react.AlertDialog.createHandle
17
18
  });
18
19
 
19
20
  exports.AlertDialog = AlertDialog;
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.cjs","sources":["../../../components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react';\nimport { AlertDialogContent } from './alert-dialog-content';\nimport {\n AlertDialogBody,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n CloseButton\n} from './alert-dialog-misc';\n\nexport const AlertDialog = Object.assign(AlertDialogPrimitive.Root, {\n Header: AlertDialogHeader,\n Footer: AlertDialogFooter,\n Body: AlertDialogBody,\n Trigger: AlertDialogPrimitive.Trigger,\n Content: AlertDialogContent,\n Close: AlertDialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\n"],"names":["AlertDialogPrimitive","AlertDialogHeader","AlertDialogFooter","AlertDialogBody","AlertDialogContent","CloseButton","AlertDialogTitle","AlertDialogDescription"],"mappings":";;;;;;AAWa,MAAA,WAAW,GAAG,MAAM,CAAC,MAAM,CAACA,iBAAoB,CAAC,IAAI,EAAE;AAClE,IAAA,MAAM,EAAEC,iCAAiB;AACzB,IAAA,MAAM,EAAEC,iCAAiB;AACzB,IAAA,IAAI,EAAEC,+BAAe;IACrB,OAAO,EAAEH,iBAAoB,CAAC,OAAO;AACrC,IAAA,OAAO,EAAEI,qCAAkB;IAC3B,KAAK,EAAEJ,iBAAoB,CAAC,KAAK;AACjC,IAAA,WAAW,EAAEK,2BAAW;AACxB,IAAA,KAAK,EAAEC,gCAAgB;AACvB,IAAA,WAAW,EAAEC,sCAAsB;AACpC,CAAA;;;;"}
1
+ {"version":3,"file":"alert-dialog.cjs","sources":["../../../components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react';\nimport { AlertDialogContent } from './alert-dialog-content';\nimport {\n AlertDialogBody,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n CloseButton\n} from './alert-dialog-misc';\n\nexport const AlertDialog = Object.assign(AlertDialogPrimitive.Root, {\n Header: AlertDialogHeader,\n Footer: AlertDialogFooter,\n Body: AlertDialogBody,\n Trigger: AlertDialogPrimitive.Trigger,\n Content: AlertDialogContent,\n Close: AlertDialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n createHandle: AlertDialogPrimitive.createHandle\n});\n"],"names":["AlertDialogPrimitive","AlertDialogHeader","AlertDialogFooter","AlertDialogBody","AlertDialogContent","CloseButton","AlertDialogTitle","AlertDialogDescription"],"mappings":";;;;;;AAWa,MAAA,WAAW,GAAG,MAAM,CAAC,MAAM,CAACA,iBAAoB,CAAC,IAAI,EAAE;AAClE,IAAA,MAAM,EAAEC,iCAAiB;AACzB,IAAA,MAAM,EAAEC,iCAAiB;AACzB,IAAA,IAAI,EAAEC,+BAAe;IACrB,OAAO,EAAEH,iBAAoB,CAAC,OAAO;AACrC,IAAA,OAAO,EAAEI,qCAAkB;IAC3B,KAAK,EAAEJ,iBAAoB,CAAC,KAAK;AACjC,IAAA,WAAW,EAAEK,2BAAW;AACxB,IAAA,KAAK,EAAEC,gCAAgB;AACvB,IAAA,WAAW,EAAEC,sCAAsB;IACnC,YAAY,EAAEP,iBAAoB,CAAC,YAAY;AAChD,CAAA;;;;"}
@@ -3,10 +3,10 @@ export declare const AlertDialog: typeof AlertDialogPrimitive.Root & {
3
3
  Header: {
4
4
  ({ className, ...props }: import("class-variance-authority").VariantProps<(props?: ({
5
5
  direction?: "row" | "column" | "rowReverse" | "columnReverse" | null | undefined;
6
- align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
7
- justify?: "center" | "start" | "end" | "between" | null | undefined;
6
+ align?: "center" | "stretch" | "end" | "start" | "baseline" | null | undefined;
7
+ justify?: "center" | "end" | "start" | "between" | null | undefined;
8
8
  wrap?: "wrap" | "noWrap" | "wrapReverse" | null | undefined;
9
- gap?: "small" | 1 | "extra-small" | "medium" | "large" | "extra-large" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
9
+ gap?: "small" | 1 | "medium" | "large" | "extra-small" | "extra-large" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
10
10
  width?: "full" | null | undefined;
11
11
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
12
12
  render?: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("@base-ui/react").ComponentRenderFn<import("@base-ui/react").HTMLProps, {}> | undefined;
@@ -16,10 +16,10 @@ export declare const AlertDialog: typeof AlertDialogPrimitive.Root & {
16
16
  Footer: {
17
17
  ({ className, ...props }: import("class-variance-authority").VariantProps<(props?: ({
18
18
  direction?: "row" | "column" | "rowReverse" | "columnReverse" | null | undefined;
19
- align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
20
- justify?: "center" | "start" | "end" | "between" | null | undefined;
19
+ align?: "center" | "stretch" | "end" | "start" | "baseline" | null | undefined;
20
+ justify?: "center" | "end" | "start" | "between" | null | undefined;
21
21
  wrap?: "wrap" | "noWrap" | "wrapReverse" | null | undefined;
22
- gap?: "small" | 1 | "extra-small" | "medium" | "large" | "extra-large" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
22
+ gap?: "small" | 1 | "medium" | "large" | "extra-small" | "extra-large" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
23
23
  width?: "full" | null | undefined;
24
24
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
25
25
  render?: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("@base-ui/react").ComponentRenderFn<import("@base-ui/react").HTMLProps, {}> | undefined;
@@ -29,10 +29,10 @@ export declare const AlertDialog: typeof AlertDialogPrimitive.Root & {
29
29
  Body: {
30
30
  ({ className, ...props }: import("class-variance-authority").VariantProps<(props?: ({
31
31
  direction?: "row" | "column" | "rowReverse" | "columnReverse" | null | undefined;
32
- align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
33
- justify?: "center" | "start" | "end" | "between" | null | undefined;
32
+ align?: "center" | "stretch" | "end" | "start" | "baseline" | null | undefined;
33
+ justify?: "center" | "end" | "start" | "between" | null | undefined;
34
34
  wrap?: "wrap" | "noWrap" | "wrapReverse" | null | undefined;
35
- gap?: "small" | 1 | "extra-small" | "medium" | "large" | "extra-large" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
35
+ gap?: "small" | 1 | "medium" | "large" | "extra-small" | "extra-large" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
36
36
  width?: "full" | null | undefined;
37
37
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
38
38
  render?: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("@base-ui/react").ComponentRenderFn<import("@base-ui/react").HTMLProps, {}> | undefined;
@@ -57,5 +57,6 @@ export declare const AlertDialog: typeof AlertDialogPrimitive.Root & {
57
57
  ({ className, ...props }: import("@base-ui/react").DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
58
58
  displayName: string;
59
59
  };
60
+ createHandle: typeof AlertDialogPrimitive.createHandle;
60
61
  };
61
62
  //# sourceMappingURL=alert-dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../components/alert-dialog/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAWrE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUtB,CAAC"}
1
+ {"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../components/alert-dialog/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAWrE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWtB,CAAC"}
@@ -11,7 +11,8 @@ const AlertDialog = Object.assign(AlertDialog$1.Root, {
11
11
  Close: AlertDialog$1.Close,
12
12
  CloseButton: CloseButton,
13
13
  Title: AlertDialogTitle,
14
- Description: AlertDialogDescription
14
+ Description: AlertDialogDescription,
15
+ createHandle: AlertDialog$1.createHandle
15
16
  });
16
17
 
17
18
  export { AlertDialog };
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.js","sources":["../../../components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react';\nimport { AlertDialogContent } from './alert-dialog-content';\nimport {\n AlertDialogBody,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n CloseButton\n} from './alert-dialog-misc';\n\nexport const AlertDialog = Object.assign(AlertDialogPrimitive.Root, {\n Header: AlertDialogHeader,\n Footer: AlertDialogFooter,\n Body: AlertDialogBody,\n Trigger: AlertDialogPrimitive.Trigger,\n Content: AlertDialogContent,\n Close: AlertDialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\n"],"names":["AlertDialogPrimitive"],"mappings":";;;;AAWa,MAAA,WAAW,GAAG,MAAM,CAAC,MAAM,CAACA,aAAoB,CAAC,IAAI,EAAE;AAClE,IAAA,MAAM,EAAE,iBAAiB;AACzB,IAAA,MAAM,EAAE,iBAAiB;AACzB,IAAA,IAAI,EAAE,eAAe;IACrB,OAAO,EAAEA,aAAoB,CAAC,OAAO;AACrC,IAAA,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAEA,aAAoB,CAAC,KAAK;AACjC,IAAA,WAAW,EAAE,WAAW;AACxB,IAAA,KAAK,EAAE,gBAAgB;AACvB,IAAA,WAAW,EAAE,sBAAsB;AACpC,CAAA;;;;"}
1
+ {"version":3,"file":"alert-dialog.js","sources":["../../../components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react';\nimport { AlertDialogContent } from './alert-dialog-content';\nimport {\n AlertDialogBody,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n CloseButton\n} from './alert-dialog-misc';\n\nexport const AlertDialog = Object.assign(AlertDialogPrimitive.Root, {\n Header: AlertDialogHeader,\n Footer: AlertDialogFooter,\n Body: AlertDialogBody,\n Trigger: AlertDialogPrimitive.Trigger,\n Content: AlertDialogContent,\n Close: AlertDialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n createHandle: AlertDialogPrimitive.createHandle\n});\n"],"names":["AlertDialogPrimitive"],"mappings":";;;;AAWa,MAAA,WAAW,GAAG,MAAM,CAAC,MAAM,CAACA,aAAoB,CAAC,IAAI,EAAE;AAClE,IAAA,MAAM,EAAE,iBAAiB;AACzB,IAAA,MAAM,EAAE,iBAAiB;AACzB,IAAA,IAAI,EAAE,eAAe;IACrB,OAAO,EAAEA,aAAoB,CAAC,OAAO;AACrC,IAAA,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAEA,aAAoB,CAAC,KAAK;AACjC,IAAA,WAAW,EAAE,WAAW;AACxB,IAAA,KAAK,EAAE,gBAAgB;AACvB,IAAA,WAAW,EAAE,sBAAsB;IACnC,YAAY,EAAEA,aAAoB,CAAC,YAAY;AAChD,CAAA;;;;"}
@@ -44,7 +44,7 @@ const Calendar = function ({ className, classNames, showOutsideDays = true, onDr
44
44
  ? dateInfo(day.date)
45
45
  : dateInfo[dateKey];
46
46
  const hasDateInfo = Boolean(dateComponent);
47
- return (jsxRuntime.jsx(tooltip.Tooltip, { side: 'top', disabled: loadingData || !showTooltip || !message, message: message, children: jsxRuntime.jsxs("button", { ...buttonProps, className: classVarianceAuthority.cx(buttonProps.className, hasDateInfo && calendar_module.default.dayButtonWithInfo), children: [hasDateInfo && (jsxRuntime.jsx("div", { className: calendar_module.default.dayInfo, children: dateComponent })), jsxRuntime.jsx("span", { className: calendar_module.default.dayNumber, children: buttonProps.children })] }) }));
47
+ return (jsxRuntime.jsxs(tooltip.Tooltip, { disabled: loadingData || !showTooltip || !message, children: [jsxRuntime.jsx(tooltip.Tooltip.Trigger, { render: jsxRuntime.jsxs("button", { ...buttonProps, className: classVarianceAuthority.cx(buttonProps.className, hasDateInfo && calendar_module.default.dayButtonWithInfo), children: [hasDateInfo && (jsxRuntime.jsx("div", { className: calendar_module.default.dayInfo, children: dateComponent })), jsxRuntime.jsx("span", { className: calendar_module.default.dayNumber, children: buttonProps.children })] }) }), jsxRuntime.jsx(tooltip.Tooltip.Content, { side: 'top', children: message })] }));
48
48
  },
49
49
  MonthGrid: props => loadingData ? (jsxRuntime.jsx(skeleton.Skeleton, { count: 5, height: '18px', width: '252px', style: { marginBottom: 'var(--rs-space-6)' } })) : (jsxRuntime.jsx("table", { ...props }))
50
50
  }, classNames: {
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.cjs","sources":["../../../components/calendar/calendar.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';\nimport { cva, cx } from 'class-variance-authority';\nimport { ChangeEvent, ReactNode, useEffect, useState } from 'react';\nimport {\n DayPicker,\n DayPickerProps,\n DropdownProps,\n dateLib\n} from 'react-day-picker';\n\nimport { IconButton } from '../icon-button';\nimport { Select } from '../select';\nimport { Skeleton } from '../skeleton';\nimport { Tooltip } from '../tooltip';\nimport styles from './calendar.module.css';\n\ninterface OnDropdownOpen {\n onDropdownOpen?: VoidFunction;\n}\n\ninterface CalendarPropsExtended {\n showTooltip?: boolean;\n tooltipMessages?: Record<string, ReactNode>;\n dateInfo?: Record<string, ReactNode> | ((date: Date) => ReactNode | null);\n loadingData?: boolean;\n timeZone?: string;\n}\n\nexport type CalendarProps = DayPickerProps &\n OnDropdownOpen &\n CalendarPropsExtended;\n\nconst root = cva(styles.calendarRoot);\n\ninterface DropDownComponentProps extends DropdownProps, OnDropdownOpen {\n disabled?: boolean;\n}\n\nfunction DropDown({\n options = [],\n value,\n onChange,\n onDropdownOpen,\n disabled\n}: DropDownComponentProps) {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (open && onDropdownOpen) onDropdownOpen();\n }, [open, onDropdownOpen]);\n\n function handleChange(value: string) {\n if (onChange) {\n onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);\n }\n }\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={handleChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Select.Trigger\n className={styles.dropdownTrigger}\n iconProps={{\n className: styles.dropdownIcon\n }}\n size='small'\n variant='text'\n disabled={disabled}\n >\n <Select.Value />\n </Select.Trigger>\n <Select.Content className={styles.dropdownContent}>\n {options.map(opt => (\n <Select.Item\n value={opt.value.toString()}\n key={opt.value}\n disabled={opt.disabled}\n >\n {opt.label}\n </Select.Item>\n ))}\n </Select.Content>\n </Select>\n );\n}\n\nexport const Calendar = function ({\n className,\n classNames,\n showOutsideDays = true,\n onDropdownOpen,\n showTooltip = false,\n tooltipMessages = {},\n dateInfo = {},\n loadingData = false,\n timeZone,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n timeZone={timeZone}\n components={{\n Chevron: props => {\n const icon =\n props.orientation === 'left' ? (\n <ChevronLeftIcon />\n ) : (\n <ChevronRightIcon />\n );\n\n return (\n <IconButton\n {...props}\n disabled={loadingData}\n className={cx(props.className, loadingData && styles.disabled)}\n size={3}\n aria-label={\n props.orientation === 'left' ? 'Previous month' : 'Next month'\n }\n >\n {icon}\n </IconButton>\n );\n },\n Dropdown: (props: DropdownProps) => (\n <DropDown\n {...props}\n onDropdownOpen={onDropdownOpen}\n disabled={loadingData}\n />\n ),\n DayButton: props => {\n const { day, ...buttonProps } = props;\n const dateKey = dateLib.format(day.date, 'dd-MM-yyyy');\n const message = tooltipMessages[dateKey];\n\n // Support both object and function for dateInfo\n const dateComponent =\n typeof dateInfo === 'function'\n ? dateInfo(day.date)\n : dateInfo[dateKey];\n const hasDateInfo = Boolean(dateComponent);\n\n return (\n <Tooltip\n side='top'\n disabled={loadingData || !showTooltip || !message}\n message={message}\n >\n <button\n {...buttonProps}\n className={cx(\n buttonProps.className,\n hasDateInfo && styles.dayButtonWithInfo\n )}\n >\n {hasDateInfo && (\n <div className={styles.dayInfo}>{dateComponent}</div>\n )}\n <span className={styles.dayNumber}>{buttonProps.children}</span>\n </button>\n </Tooltip>\n );\n },\n MonthGrid: props =>\n loadingData ? (\n <Skeleton\n count={5}\n height='18px'\n width='252px'\n style={{ marginBottom: 'var(--rs-space-6)' }}\n />\n ) : (\n <table {...props} />\n )\n }}\n classNames={{\n caption_label: styles.captionLabel,\n button_previous: `${styles.navButton} ${styles.navButtonPrevious}`,\n button_next: `${styles.navButton} ${styles.navButtonNext}`,\n month_caption: styles.monthCaption,\n months: styles.months,\n nav: styles.nav,\n day: styles.day,\n today: styles.today,\n outside: styles.outside,\n week: styles.week,\n weekdays: styles.week,\n weekday: styles.weekday,\n disabled: styles.disabled,\n selected: styles.selected,\n day_button: styles.dayButton,\n range_middle: styles.rangeMiddle,\n range_end: styles.rangeEnd,\n range_start: styles.rangeStart,\n hidden: styles.hidden,\n dropdowns: styles.dropdowns,\n ...classNames\n }}\n className={root({ className })}\n mode='single'\n {...props}\n />\n );\n};\n\nCalendar.displayName = 'Calendar';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAkCA;AAMA;;;;AAUgC;AAC9B;;;;;;AAQA;;AAWO;AAoBT;AAEa;AAYX;;;;;;;;AAoCQ;AACA;;AAGA;AAEI;AACA;AACJ;AAEA;;AAqBF;AAWD;;;;;;;;;;;;;;;;;;;;;AAsBC;AACD;AAMP;AAEA;;"}
1
+ {"version":3,"file":"calendar.cjs","sources":["../../../components/calendar/calendar.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';\nimport { cva, cx } from 'class-variance-authority';\nimport { ChangeEvent, ReactNode, useEffect, useState } from 'react';\nimport {\n DayPicker,\n DayPickerProps,\n DropdownProps,\n dateLib\n} from 'react-day-picker';\n\nimport { IconButton } from '../icon-button';\nimport { Select } from '../select';\nimport { Skeleton } from '../skeleton';\nimport { Tooltip } from '../tooltip';\nimport styles from './calendar.module.css';\n\ninterface OnDropdownOpen {\n onDropdownOpen?: VoidFunction;\n}\n\ninterface CalendarPropsExtended {\n showTooltip?: boolean;\n tooltipMessages?: Record<string, ReactNode>;\n dateInfo?: Record<string, ReactNode> | ((date: Date) => ReactNode | null);\n loadingData?: boolean;\n timeZone?: string;\n}\n\nexport type CalendarProps = DayPickerProps &\n OnDropdownOpen &\n CalendarPropsExtended;\n\nconst root = cva(styles.calendarRoot);\n\ninterface DropDownComponentProps extends DropdownProps, OnDropdownOpen {\n disabled?: boolean;\n}\n\nfunction DropDown({\n options = [],\n value,\n onChange,\n onDropdownOpen,\n disabled\n}: DropDownComponentProps) {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (open && onDropdownOpen) onDropdownOpen();\n }, [open, onDropdownOpen]);\n\n function handleChange(value: string) {\n if (onChange) {\n onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);\n }\n }\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={handleChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Select.Trigger\n className={styles.dropdownTrigger}\n iconProps={{\n className: styles.dropdownIcon\n }}\n size='small'\n variant='text'\n disabled={disabled}\n >\n <Select.Value />\n </Select.Trigger>\n <Select.Content className={styles.dropdownContent}>\n {options.map(opt => (\n <Select.Item\n value={opt.value.toString()}\n key={opt.value}\n disabled={opt.disabled}\n >\n {opt.label}\n </Select.Item>\n ))}\n </Select.Content>\n </Select>\n );\n}\n\nexport const Calendar = function ({\n className,\n classNames,\n showOutsideDays = true,\n onDropdownOpen,\n showTooltip = false,\n tooltipMessages = {},\n dateInfo = {},\n loadingData = false,\n timeZone,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n timeZone={timeZone}\n components={{\n Chevron: props => {\n const icon =\n props.orientation === 'left' ? (\n <ChevronLeftIcon />\n ) : (\n <ChevronRightIcon />\n );\n\n return (\n <IconButton\n {...props}\n disabled={loadingData}\n className={cx(props.className, loadingData && styles.disabled)}\n size={3}\n aria-label={\n props.orientation === 'left' ? 'Previous month' : 'Next month'\n }\n >\n {icon}\n </IconButton>\n );\n },\n Dropdown: (props: DropdownProps) => (\n <DropDown\n {...props}\n onDropdownOpen={onDropdownOpen}\n disabled={loadingData}\n />\n ),\n DayButton: props => {\n const { day, ...buttonProps } = props;\n const dateKey = dateLib.format(day.date, 'dd-MM-yyyy');\n const message = tooltipMessages[dateKey];\n\n // Support both object and function for dateInfo\n const dateComponent =\n typeof dateInfo === 'function'\n ? dateInfo(day.date)\n : dateInfo[dateKey];\n const hasDateInfo = Boolean(dateComponent);\n\n return (\n <Tooltip disabled={loadingData || !showTooltip || !message}>\n <Tooltip.Trigger\n render={\n <button\n {...buttonProps}\n className={cx(\n buttonProps.className,\n hasDateInfo && styles.dayButtonWithInfo\n )}\n >\n {hasDateInfo && (\n <div className={styles.dayInfo}>{dateComponent}</div>\n )}\n <span className={styles.dayNumber}>\n {buttonProps.children}\n </span>\n </button>\n }\n />\n <Tooltip.Content side='top'>{message}</Tooltip.Content>\n </Tooltip>\n );\n },\n MonthGrid: props =>\n loadingData ? (\n <Skeleton\n count={5}\n height='18px'\n width='252px'\n style={{ marginBottom: 'var(--rs-space-6)' }}\n />\n ) : (\n <table {...props} />\n )\n }}\n classNames={{\n caption_label: styles.captionLabel,\n button_previous: `${styles.navButton} ${styles.navButtonPrevious}`,\n button_next: `${styles.navButton} ${styles.navButtonNext}`,\n month_caption: styles.monthCaption,\n months: styles.months,\n nav: styles.nav,\n day: styles.day,\n today: styles.today,\n outside: styles.outside,\n week: styles.week,\n weekdays: styles.week,\n weekday: styles.weekday,\n disabled: styles.disabled,\n selected: styles.selected,\n day_button: styles.dayButton,\n range_middle: styles.rangeMiddle,\n range_end: styles.rangeEnd,\n range_start: styles.rangeStart,\n hidden: styles.hidden,\n dropdowns: styles.dropdowns,\n ...classNames\n }}\n className={root({ className })}\n mode='single'\n {...props}\n />\n );\n};\n\nCalendar.displayName = 'Calendar';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAkCA;AAMA;;;;AAUgC;AAC9B;;;;;;AAQA;;AAWO;AAoBT;AAEa;AAYX;;;;;;;;AAoCQ;AACA;;AAGA;AAEI;AACA;AACJ;AAEA;;AAwBF;AAWD;;;;;;;;;;;;;;;;;;;;;AAsBC;AACD;AAMP;AAEA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../components/calendar/calendar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAe,SAAS,EAAuB,MAAM,OAAO,CAAC;AACpE,OAAO,EAEL,cAAc,EAGf,MAAM,kBAAkB,CAAC;AAQ1B,UAAU,cAAc;IACtB,cAAc,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,GAAG,IAAI,CAAC,CAAC;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,GACxC,cAAc,GACd,qBAAqB,CAAC;AA4DxB,eAAO,MAAM,QAAQ;0IAWlB,aAAa;;CA4Gf,CAAC"}
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../components/calendar/calendar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAe,SAAS,EAAuB,MAAM,OAAO,CAAC;AACpE,OAAO,EAEL,cAAc,EAGf,MAAM,kBAAkB,CAAC;AAQ1B,UAAU,cAAc;IACtB,cAAc,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,GAAG,IAAI,CAAC,CAAC;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,GACxC,cAAc,GACd,qBAAqB,CAAC;AA4DxB,eAAO,MAAM,QAAQ;0IAWlB,aAAa;;CA+Gf,CAAC"}
@@ -42,7 +42,7 @@ const Calendar = function ({ className, classNames, showOutsideDays = true, onDr
42
42
  ? dateInfo(day.date)
43
43
  : dateInfo[dateKey];
44
44
  const hasDateInfo = Boolean(dateComponent);
45
- return (jsx(Tooltip, { side: 'top', disabled: loadingData || !showTooltip || !message, message: message, children: jsxs("button", { ...buttonProps, className: cx(buttonProps.className, hasDateInfo && styles.dayButtonWithInfo), children: [hasDateInfo && (jsx("div", { className: styles.dayInfo, children: dateComponent })), jsx("span", { className: styles.dayNumber, children: buttonProps.children })] }) }));
45
+ return (jsxs(Tooltip, { disabled: loadingData || !showTooltip || !message, children: [jsx(Tooltip.Trigger, { render: jsxs("button", { ...buttonProps, className: cx(buttonProps.className, hasDateInfo && styles.dayButtonWithInfo), children: [hasDateInfo && (jsx("div", { className: styles.dayInfo, children: dateComponent })), jsx("span", { className: styles.dayNumber, children: buttonProps.children })] }) }), jsx(Tooltip.Content, { side: 'top', children: message })] }));
46
46
  },
47
47
  MonthGrid: props => loadingData ? (jsx(Skeleton, { count: 5, height: '18px', width: '252px', style: { marginBottom: 'var(--rs-space-6)' } })) : (jsx("table", { ...props }))
48
48
  }, classNames: {
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sources":["../../../components/calendar/calendar.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';\nimport { cva, cx } from 'class-variance-authority';\nimport { ChangeEvent, ReactNode, useEffect, useState } from 'react';\nimport {\n DayPicker,\n DayPickerProps,\n DropdownProps,\n dateLib\n} from 'react-day-picker';\n\nimport { IconButton } from '../icon-button';\nimport { Select } from '../select';\nimport { Skeleton } from '../skeleton';\nimport { Tooltip } from '../tooltip';\nimport styles from './calendar.module.css';\n\ninterface OnDropdownOpen {\n onDropdownOpen?: VoidFunction;\n}\n\ninterface CalendarPropsExtended {\n showTooltip?: boolean;\n tooltipMessages?: Record<string, ReactNode>;\n dateInfo?: Record<string, ReactNode> | ((date: Date) => ReactNode | null);\n loadingData?: boolean;\n timeZone?: string;\n}\n\nexport type CalendarProps = DayPickerProps &\n OnDropdownOpen &\n CalendarPropsExtended;\n\nconst root = cva(styles.calendarRoot);\n\ninterface DropDownComponentProps extends DropdownProps, OnDropdownOpen {\n disabled?: boolean;\n}\n\nfunction DropDown({\n options = [],\n value,\n onChange,\n onDropdownOpen,\n disabled\n}: DropDownComponentProps) {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (open && onDropdownOpen) onDropdownOpen();\n }, [open, onDropdownOpen]);\n\n function handleChange(value: string) {\n if (onChange) {\n onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);\n }\n }\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={handleChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Select.Trigger\n className={styles.dropdownTrigger}\n iconProps={{\n className: styles.dropdownIcon\n }}\n size='small'\n variant='text'\n disabled={disabled}\n >\n <Select.Value />\n </Select.Trigger>\n <Select.Content className={styles.dropdownContent}>\n {options.map(opt => (\n <Select.Item\n value={opt.value.toString()}\n key={opt.value}\n disabled={opt.disabled}\n >\n {opt.label}\n </Select.Item>\n ))}\n </Select.Content>\n </Select>\n );\n}\n\nexport const Calendar = function ({\n className,\n classNames,\n showOutsideDays = true,\n onDropdownOpen,\n showTooltip = false,\n tooltipMessages = {},\n dateInfo = {},\n loadingData = false,\n timeZone,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n timeZone={timeZone}\n components={{\n Chevron: props => {\n const icon =\n props.orientation === 'left' ? (\n <ChevronLeftIcon />\n ) : (\n <ChevronRightIcon />\n );\n\n return (\n <IconButton\n {...props}\n disabled={loadingData}\n className={cx(props.className, loadingData && styles.disabled)}\n size={3}\n aria-label={\n props.orientation === 'left' ? 'Previous month' : 'Next month'\n }\n >\n {icon}\n </IconButton>\n );\n },\n Dropdown: (props: DropdownProps) => (\n <DropDown\n {...props}\n onDropdownOpen={onDropdownOpen}\n disabled={loadingData}\n />\n ),\n DayButton: props => {\n const { day, ...buttonProps } = props;\n const dateKey = dateLib.format(day.date, 'dd-MM-yyyy');\n const message = tooltipMessages[dateKey];\n\n // Support both object and function for dateInfo\n const dateComponent =\n typeof dateInfo === 'function'\n ? dateInfo(day.date)\n : dateInfo[dateKey];\n const hasDateInfo = Boolean(dateComponent);\n\n return (\n <Tooltip\n side='top'\n disabled={loadingData || !showTooltip || !message}\n message={message}\n >\n <button\n {...buttonProps}\n className={cx(\n buttonProps.className,\n hasDateInfo && styles.dayButtonWithInfo\n )}\n >\n {hasDateInfo && (\n <div className={styles.dayInfo}>{dateComponent}</div>\n )}\n <span className={styles.dayNumber}>{buttonProps.children}</span>\n </button>\n </Tooltip>\n );\n },\n MonthGrid: props =>\n loadingData ? (\n <Skeleton\n count={5}\n height='18px'\n width='252px'\n style={{ marginBottom: 'var(--rs-space-6)' }}\n />\n ) : (\n <table {...props} />\n )\n }}\n classNames={{\n caption_label: styles.captionLabel,\n button_previous: `${styles.navButton} ${styles.navButtonPrevious}`,\n button_next: `${styles.navButton} ${styles.navButtonNext}`,\n month_caption: styles.monthCaption,\n months: styles.months,\n nav: styles.nav,\n day: styles.day,\n today: styles.today,\n outside: styles.outside,\n week: styles.week,\n weekdays: styles.week,\n weekday: styles.weekday,\n disabled: styles.disabled,\n selected: styles.selected,\n day_button: styles.dayButton,\n range_middle: styles.rangeMiddle,\n range_end: styles.rangeEnd,\n range_start: styles.rangeStart,\n hidden: styles.hidden,\n dropdowns: styles.dropdowns,\n ...classNames\n }}\n className={root({ className })}\n mode='single'\n {...props}\n />\n );\n};\n\nCalendar.displayName = 'Calendar';\n"],"names":[],"mappings":";;;;;;;;;;;;AAkCA;AAMA;;;;AAUgC;AAC9B;;;;;;AAQA;;AAWO;AAoBT;AAEa;AAYX;;;;;;;;AAoCQ;AACA;;AAGA;AAEI;AACA;AACJ;AAEA;;AAqBF;AAWD;;;;;;;;;;;;;;;;;;;;;AAsBC;AACD;AAMP;AAEA;;"}
1
+ {"version":3,"file":"calendar.js","sources":["../../../components/calendar/calendar.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';\nimport { cva, cx } from 'class-variance-authority';\nimport { ChangeEvent, ReactNode, useEffect, useState } from 'react';\nimport {\n DayPicker,\n DayPickerProps,\n DropdownProps,\n dateLib\n} from 'react-day-picker';\n\nimport { IconButton } from '../icon-button';\nimport { Select } from '../select';\nimport { Skeleton } from '../skeleton';\nimport { Tooltip } from '../tooltip';\nimport styles from './calendar.module.css';\n\ninterface OnDropdownOpen {\n onDropdownOpen?: VoidFunction;\n}\n\ninterface CalendarPropsExtended {\n showTooltip?: boolean;\n tooltipMessages?: Record<string, ReactNode>;\n dateInfo?: Record<string, ReactNode> | ((date: Date) => ReactNode | null);\n loadingData?: boolean;\n timeZone?: string;\n}\n\nexport type CalendarProps = DayPickerProps &\n OnDropdownOpen &\n CalendarPropsExtended;\n\nconst root = cva(styles.calendarRoot);\n\ninterface DropDownComponentProps extends DropdownProps, OnDropdownOpen {\n disabled?: boolean;\n}\n\nfunction DropDown({\n options = [],\n value,\n onChange,\n onDropdownOpen,\n disabled\n}: DropDownComponentProps) {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (open && onDropdownOpen) onDropdownOpen();\n }, [open, onDropdownOpen]);\n\n function handleChange(value: string) {\n if (onChange) {\n onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);\n }\n }\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={handleChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Select.Trigger\n className={styles.dropdownTrigger}\n iconProps={{\n className: styles.dropdownIcon\n }}\n size='small'\n variant='text'\n disabled={disabled}\n >\n <Select.Value />\n </Select.Trigger>\n <Select.Content className={styles.dropdownContent}>\n {options.map(opt => (\n <Select.Item\n value={opt.value.toString()}\n key={opt.value}\n disabled={opt.disabled}\n >\n {opt.label}\n </Select.Item>\n ))}\n </Select.Content>\n </Select>\n );\n}\n\nexport const Calendar = function ({\n className,\n classNames,\n showOutsideDays = true,\n onDropdownOpen,\n showTooltip = false,\n tooltipMessages = {},\n dateInfo = {},\n loadingData = false,\n timeZone,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n timeZone={timeZone}\n components={{\n Chevron: props => {\n const icon =\n props.orientation === 'left' ? (\n <ChevronLeftIcon />\n ) : (\n <ChevronRightIcon />\n );\n\n return (\n <IconButton\n {...props}\n disabled={loadingData}\n className={cx(props.className, loadingData && styles.disabled)}\n size={3}\n aria-label={\n props.orientation === 'left' ? 'Previous month' : 'Next month'\n }\n >\n {icon}\n </IconButton>\n );\n },\n Dropdown: (props: DropdownProps) => (\n <DropDown\n {...props}\n onDropdownOpen={onDropdownOpen}\n disabled={loadingData}\n />\n ),\n DayButton: props => {\n const { day, ...buttonProps } = props;\n const dateKey = dateLib.format(day.date, 'dd-MM-yyyy');\n const message = tooltipMessages[dateKey];\n\n // Support both object and function for dateInfo\n const dateComponent =\n typeof dateInfo === 'function'\n ? dateInfo(day.date)\n : dateInfo[dateKey];\n const hasDateInfo = Boolean(dateComponent);\n\n return (\n <Tooltip disabled={loadingData || !showTooltip || !message}>\n <Tooltip.Trigger\n render={\n <button\n {...buttonProps}\n className={cx(\n buttonProps.className,\n hasDateInfo && styles.dayButtonWithInfo\n )}\n >\n {hasDateInfo && (\n <div className={styles.dayInfo}>{dateComponent}</div>\n )}\n <span className={styles.dayNumber}>\n {buttonProps.children}\n </span>\n </button>\n }\n />\n <Tooltip.Content side='top'>{message}</Tooltip.Content>\n </Tooltip>\n );\n },\n MonthGrid: props =>\n loadingData ? (\n <Skeleton\n count={5}\n height='18px'\n width='252px'\n style={{ marginBottom: 'var(--rs-space-6)' }}\n />\n ) : (\n <table {...props} />\n )\n }}\n classNames={{\n caption_label: styles.captionLabel,\n button_previous: `${styles.navButton} ${styles.navButtonPrevious}`,\n button_next: `${styles.navButton} ${styles.navButtonNext}`,\n month_caption: styles.monthCaption,\n months: styles.months,\n nav: styles.nav,\n day: styles.day,\n today: styles.today,\n outside: styles.outside,\n week: styles.week,\n weekdays: styles.week,\n weekday: styles.weekday,\n disabled: styles.disabled,\n selected: styles.selected,\n day_button: styles.dayButton,\n range_middle: styles.rangeMiddle,\n range_end: styles.rangeEnd,\n range_start: styles.rangeStart,\n hidden: styles.hidden,\n dropdowns: styles.dropdowns,\n ...classNames\n }}\n className={root({ className })}\n mode='single'\n {...props}\n />\n );\n};\n\nCalendar.displayName = 'Calendar';\n"],"names":[],"mappings":";;;;;;;;;;;;AAkCA;AAMA;;;;AAUgC;AAC9B;;;;;;AAQA;;AAWO;AAoBT;AAEa;AAYX;;;;;;;;AAoCQ;AACA;;AAGA;AAEI;AACA;AACJ;AAEA;;AAwBF;AAWD;;;;;;;;;;;;;;;;;;;;;AAsBC;AACD;AAMP;AAEA;;"}
@@ -5,7 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
5
5
  var reactIcons = require('@radix-ui/react-icons');
6
6
  var classVarianceAuthority = require('class-variance-authority');
7
7
  var dayjs = require('dayjs');
8
- var customParseFormat = require('dayjs/plugin/customParseFormat');
8
+ var customParseFormat = require('dayjs/plugin/customParseFormat.js');
9
9
  var React = require('react');
10
10
  var inputField = require('../input-field/input-field.cjs');
11
11
  var popover = require('../popover/popover.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.cjs","sources":["../../../components/calendar/date-picker.tsx"],"sourcesContent":["'use client';\n\nimport { CalendarIcon } from '@radix-ui/react-icons';\nimport { cx } from 'class-variance-authority';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport {\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport { PropsBase, PropsSingleRequired } from 'react-day-picker';\nimport { InputField } from '../input-field';\nimport { InputFieldProps } from '../input-field/input-field';\nimport { Popover } from '../popover';\nimport { PopoverContentProps } from '../popover/popover';\nimport { Calendar } from './calendar';\nimport styles from './calendar.module.css';\n\ndayjs.extend(customParseFormat);\n\ninterface DatePickerProps {\n dateFormat?: string;\n inputFieldProps?: InputFieldProps;\n calendarProps?: PropsSingleRequired & PropsBase;\n onSelect?: (date: Date) => void;\n value?: Date;\n children?:\n | React.ReactNode\n | ((props: { selectedDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n timeZone?: string;\n popoverProps?: PopoverContentProps;\n}\n\nexport function DatePicker({\n dateFormat = 'DD/MM/YYYY',\n inputFieldProps,\n calendarProps,\n value = new Date(),\n onSelect = () => {},\n children,\n showCalendarIcon = true,\n timeZone,\n popoverProps\n}: DatePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [selectedDate, setSelectedDate] = useState(value);\n const [error, setError] = useState<string>();\n\n const formattedDate = dayjs(selectedDate).format(dateFormat);\n\n const isDropdownOpenRef = useRef(false);\n const inputFieldRef = useRef<HTMLInputElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const isInputFieldFocused = useRef(false);\n const selectedDateRef = useRef(selectedDate);\n\n useEffect(() => {\n selectedDateRef.current = selectedDate;\n }, [selectedDate]);\n\n const isElementOutside = useCallback((el: HTMLElement) => {\n return (\n !isDropdownOpenRef.current && // Month and Year dropdown from Date picker\n !inputFieldRef.current?.contains(el) && // InputField\n !contentRef.current?.contains(el)\n );\n }, []);\n\n const handleMouseDown = useCallback(\n (event: MouseEvent) => {\n const el = event.target as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n },\n [isElementOutside]\n );\n\n function registerEventListeners() {\n isInputFieldFocused.current = true;\n document.addEventListener('mouseup', handleMouseDown);\n }\n\n function removeEventListeners(skipUpdate = false) {\n isInputFieldFocused.current = false;\n setShowCalendar(false);\n\n const updatedVal = dayjs(selectedDateRef.current).format(dateFormat);\n\n if (inputFieldRef.current) inputFieldRef.current.value = updatedVal;\n if (!error && !skipUpdate) onSelect(dayjs(updatedVal).toDate());\n\n document.removeEventListener('mouseup', handleMouseDown);\n }\n\n const handleSelect = (day: Date) => {\n setSelectedDate(day);\n onSelect(day);\n setError(undefined);\n removeEventListeners(true);\n };\n\n function onDropdownOpen() {\n isDropdownOpenRef.current = true;\n }\n\n function onOpenChange(open?: boolean) {\n if (\n !isDropdownOpenRef.current &&\n !(isInputFieldFocused.current && showCalendar)\n ) {\n setShowCalendar(Boolean(open));\n }\n\n isDropdownOpenRef.current = false;\n }\n\n function handleInputFocus() {\n if (isInputFieldFocused.current) return;\n if (!showCalendar) setShowCalendar(true);\n }\n\n function handleInputBlur(event: React.FocusEvent) {\n if (isInputFieldFocused.current) {\n const el = event.relatedTarget as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n } else {\n registerEventListeners();\n setTimeout(() => inputFieldRef.current?.select());\n }\n }\n\n function handleKeyUp(event: React.KeyboardEvent) {\n if (event.code === 'Enter' && inputFieldRef.current) {\n inputFieldRef.current.blur();\n removeEventListeners();\n }\n }\n\n function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { value } = event.target;\n\n const format = value.includes('/')\n ? 'DD/MM/YYYY'\n : value.includes('-')\n ? 'DD-MM-YYYY'\n : undefined;\n const date = dayjs(value, format);\n\n const isValidDate = date.isValid();\n\n const isAfter =\n calendarProps?.startMonth !== undefined\n ? dayjs(date).isSameOrAfter(calendarProps.startMonth)\n : true;\n const isBefore =\n calendarProps?.endMonth !== undefined\n ? dayjs(date).isSameOrBefore(calendarProps.endMonth)\n : true;\n\n const isValid =\n isValidDate && isAfter && isBefore && dayjs(date).isSameOrBefore(dayjs());\n\n if (isValid) {\n setSelectedDate(date.toDate());\n setError(undefined);\n } else {\n setError('Invalid date');\n }\n }\n\n const defaultTrigger = (\n <InputField\n size='small'\n placeholder='Select date'\n error={error}\n className={styles.datePickerInput}\n trailingIcon={showCalendarIcon ? <CalendarIcon /> : undefined}\n {...inputFieldProps}\n ref={inputFieldRef}\n value={formattedDate}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n onKeyUp={handleKeyUp}\n />\n );\n\n const trigger =\n typeof children === 'function' ? (\n children({ selectedDate: formattedDate })\n ) : children ? (\n <div>{children}</div>\n ) : (\n <div>{defaultTrigger}</div>\n );\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger\n render={isValidElement(trigger) ? trigger : <button>{trigger}</button>}\n />\n <Popover.Content\n ref={contentRef}\n {...popoverProps}\n className={cx(styles.calendarPopover, popoverProps?.className)}\n side={popoverProps?.side ?? 'top'}\n >\n <Calendar\n required={true}\n {...calendarProps}\n timeZone={timeZone}\n onDropdownOpen={onDropdownOpen}\n mode='single'\n selected={selectedDate}\n month={selectedDate}\n onSelect={handleSelect}\n onMonthChange={setSelectedDate}\n />\n </Popover.Content>\n </Popover>\n );\n}\n\nDatePicker.displayName = 'DatePicker';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqBA;AAgBgB;;;;;AAiBd;AACA;AACA;AACA;AACA;;AAGE;AACF;AAEA;AACE;;;;AAOF;AAEI;AACA;AAAgC;AAClC;AAIF;AACE;AACA;;AAGF;AACE;;AAGA;;AAE2B;AAC3B;;AAEA;;AAGF;;;;;AAKA;AAEA;AACE;;;;;AAQE;;AAGF;;AAGF;;;AAEE;;;;AAIA;AACE;AACA;AAAgC;;;AAEhC;;;;;;AAOA;AACA;;;;AAKF;AAEA;AACE;AACA;AACE;;;AAIJ;AAEA;;;AAIA;;;AAKA;;AAIE;;;;;;;AAOJ;AAiBA;;AAkCF;AAEA;;"}
1
+ {"version":3,"file":"date-picker.cjs","sources":["../../../components/calendar/date-picker.tsx"],"sourcesContent":["'use client';\n\nimport { CalendarIcon } from '@radix-ui/react-icons';\nimport { cx } from 'class-variance-authority';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat.js';\nimport {\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport { PropsBase, PropsSingleRequired } from 'react-day-picker';\nimport { InputField } from '../input-field';\nimport { InputFieldProps } from '../input-field/input-field';\nimport { Popover } from '../popover';\nimport { PopoverContentProps } from '../popover/popover';\nimport { Calendar } from './calendar';\nimport styles from './calendar.module.css';\n\ndayjs.extend(customParseFormat);\n\ninterface DatePickerProps {\n dateFormat?: string;\n inputFieldProps?: InputFieldProps;\n calendarProps?: PropsSingleRequired & PropsBase;\n onSelect?: (date: Date) => void;\n value?: Date;\n children?:\n | React.ReactNode\n | ((props: { selectedDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n timeZone?: string;\n popoverProps?: PopoverContentProps;\n}\n\nexport function DatePicker({\n dateFormat = 'DD/MM/YYYY',\n inputFieldProps,\n calendarProps,\n value = new Date(),\n onSelect = () => {},\n children,\n showCalendarIcon = true,\n timeZone,\n popoverProps\n}: DatePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [selectedDate, setSelectedDate] = useState(value);\n const [error, setError] = useState<string>();\n\n const formattedDate = dayjs(selectedDate).format(dateFormat);\n\n const isDropdownOpenRef = useRef(false);\n const inputFieldRef = useRef<HTMLInputElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const isInputFieldFocused = useRef(false);\n const selectedDateRef = useRef(selectedDate);\n\n useEffect(() => {\n selectedDateRef.current = selectedDate;\n }, [selectedDate]);\n\n const isElementOutside = useCallback((el: HTMLElement) => {\n return (\n !isDropdownOpenRef.current && // Month and Year dropdown from Date picker\n !inputFieldRef.current?.contains(el) && // InputField\n !contentRef.current?.contains(el)\n );\n }, []);\n\n const handleMouseDown = useCallback(\n (event: MouseEvent) => {\n const el = event.target as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n },\n [isElementOutside]\n );\n\n function registerEventListeners() {\n isInputFieldFocused.current = true;\n document.addEventListener('mouseup', handleMouseDown);\n }\n\n function removeEventListeners(skipUpdate = false) {\n isInputFieldFocused.current = false;\n setShowCalendar(false);\n\n const updatedVal = dayjs(selectedDateRef.current).format(dateFormat);\n\n if (inputFieldRef.current) inputFieldRef.current.value = updatedVal;\n if (!error && !skipUpdate) onSelect(dayjs(updatedVal).toDate());\n\n document.removeEventListener('mouseup', handleMouseDown);\n }\n\n const handleSelect = (day: Date) => {\n setSelectedDate(day);\n onSelect(day);\n setError(undefined);\n removeEventListeners(true);\n };\n\n function onDropdownOpen() {\n isDropdownOpenRef.current = true;\n }\n\n function onOpenChange(open?: boolean) {\n if (\n !isDropdownOpenRef.current &&\n !(isInputFieldFocused.current && showCalendar)\n ) {\n setShowCalendar(Boolean(open));\n }\n\n isDropdownOpenRef.current = false;\n }\n\n function handleInputFocus() {\n if (isInputFieldFocused.current) return;\n if (!showCalendar) setShowCalendar(true);\n }\n\n function handleInputBlur(event: React.FocusEvent) {\n if (isInputFieldFocused.current) {\n const el = event.relatedTarget as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n } else {\n registerEventListeners();\n setTimeout(() => inputFieldRef.current?.select());\n }\n }\n\n function handleKeyUp(event: React.KeyboardEvent) {\n if (event.code === 'Enter' && inputFieldRef.current) {\n inputFieldRef.current.blur();\n removeEventListeners();\n }\n }\n\n function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { value } = event.target;\n\n const format = value.includes('/')\n ? 'DD/MM/YYYY'\n : value.includes('-')\n ? 'DD-MM-YYYY'\n : undefined;\n const date = dayjs(value, format);\n\n const isValidDate = date.isValid();\n\n const isAfter =\n calendarProps?.startMonth !== undefined\n ? dayjs(date).isSameOrAfter(calendarProps.startMonth)\n : true;\n const isBefore =\n calendarProps?.endMonth !== undefined\n ? dayjs(date).isSameOrBefore(calendarProps.endMonth)\n : true;\n\n const isValid =\n isValidDate && isAfter && isBefore && dayjs(date).isSameOrBefore(dayjs());\n\n if (isValid) {\n setSelectedDate(date.toDate());\n setError(undefined);\n } else {\n setError('Invalid date');\n }\n }\n\n const defaultTrigger = (\n <InputField\n size='small'\n placeholder='Select date'\n error={error}\n className={styles.datePickerInput}\n trailingIcon={showCalendarIcon ? <CalendarIcon /> : undefined}\n {...inputFieldProps}\n ref={inputFieldRef}\n value={formattedDate}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n onKeyUp={handleKeyUp}\n />\n );\n\n const trigger =\n typeof children === 'function' ? (\n children({ selectedDate: formattedDate })\n ) : children ? (\n <div>{children}</div>\n ) : (\n <div>{defaultTrigger}</div>\n );\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger\n render={isValidElement(trigger) ? trigger : <button>{trigger}</button>}\n />\n <Popover.Content\n ref={contentRef}\n {...popoverProps}\n className={cx(styles.calendarPopover, popoverProps?.className)}\n side={popoverProps?.side ?? 'top'}\n >\n <Calendar\n required={true}\n {...calendarProps}\n timeZone={timeZone}\n onDropdownOpen={onDropdownOpen}\n mode='single'\n selected={selectedDate}\n month={selectedDate}\n onSelect={handleSelect}\n onMonthChange={setSelectedDate}\n />\n </Popover.Content>\n </Popover>\n );\n}\n\nDatePicker.displayName = 'DatePicker';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqBA;AAgBgB;;;;;AAiBd;AACA;AACA;AACA;AACA;;AAGE;AACF;AAEA;AACE;;;;AAOF;AAEI;AACA;AAAgC;AAClC;AAIF;AACE;AACA;;AAGF;AACE;;AAGA;;AAE2B;AAC3B;;AAEA;;AAGF;;;;;AAKA;AAEA;AACE;;;;;AAQE;;AAGF;;AAGF;;;AAEE;;;;AAIA;AACE;AACA;AAAgC;;;AAEhC;;;;;;AAOA;AACA;;;;AAKF;AAEA;AACE;AACA;AACE;;;AAIJ;AAEA;;;AAIA;;;AAKA;;AAIE;;;;;;;AAOJ;AAiBA;;AAkCF;AAEA;;"}
@@ -3,7 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { CalendarIcon } from '@radix-ui/react-icons';
4
4
  import { cx } from 'class-variance-authority';
5
5
  import dayjs from 'dayjs';
6
- import customParseFormat from 'dayjs/plugin/customParseFormat';
6
+ import customParseFormat from 'dayjs/plugin/customParseFormat.js';
7
7
  import { useState, useRef, useEffect, useCallback, isValidElement } from 'react';
8
8
  import { InputField } from '../input-field/input-field.js';
9
9
  import { Popover } from '../popover/popover.js';
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","sources":["../../../components/calendar/date-picker.tsx"],"sourcesContent":["'use client';\n\nimport { CalendarIcon } from '@radix-ui/react-icons';\nimport { cx } from 'class-variance-authority';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport {\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport { PropsBase, PropsSingleRequired } from 'react-day-picker';\nimport { InputField } from '../input-field';\nimport { InputFieldProps } from '../input-field/input-field';\nimport { Popover } from '../popover';\nimport { PopoverContentProps } from '../popover/popover';\nimport { Calendar } from './calendar';\nimport styles from './calendar.module.css';\n\ndayjs.extend(customParseFormat);\n\ninterface DatePickerProps {\n dateFormat?: string;\n inputFieldProps?: InputFieldProps;\n calendarProps?: PropsSingleRequired & PropsBase;\n onSelect?: (date: Date) => void;\n value?: Date;\n children?:\n | React.ReactNode\n | ((props: { selectedDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n timeZone?: string;\n popoverProps?: PopoverContentProps;\n}\n\nexport function DatePicker({\n dateFormat = 'DD/MM/YYYY',\n inputFieldProps,\n calendarProps,\n value = new Date(),\n onSelect = () => {},\n children,\n showCalendarIcon = true,\n timeZone,\n popoverProps\n}: DatePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [selectedDate, setSelectedDate] = useState(value);\n const [error, setError] = useState<string>();\n\n const formattedDate = dayjs(selectedDate).format(dateFormat);\n\n const isDropdownOpenRef = useRef(false);\n const inputFieldRef = useRef<HTMLInputElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const isInputFieldFocused = useRef(false);\n const selectedDateRef = useRef(selectedDate);\n\n useEffect(() => {\n selectedDateRef.current = selectedDate;\n }, [selectedDate]);\n\n const isElementOutside = useCallback((el: HTMLElement) => {\n return (\n !isDropdownOpenRef.current && // Month and Year dropdown from Date picker\n !inputFieldRef.current?.contains(el) && // InputField\n !contentRef.current?.contains(el)\n );\n }, []);\n\n const handleMouseDown = useCallback(\n (event: MouseEvent) => {\n const el = event.target as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n },\n [isElementOutside]\n );\n\n function registerEventListeners() {\n isInputFieldFocused.current = true;\n document.addEventListener('mouseup', handleMouseDown);\n }\n\n function removeEventListeners(skipUpdate = false) {\n isInputFieldFocused.current = false;\n setShowCalendar(false);\n\n const updatedVal = dayjs(selectedDateRef.current).format(dateFormat);\n\n if (inputFieldRef.current) inputFieldRef.current.value = updatedVal;\n if (!error && !skipUpdate) onSelect(dayjs(updatedVal).toDate());\n\n document.removeEventListener('mouseup', handleMouseDown);\n }\n\n const handleSelect = (day: Date) => {\n setSelectedDate(day);\n onSelect(day);\n setError(undefined);\n removeEventListeners(true);\n };\n\n function onDropdownOpen() {\n isDropdownOpenRef.current = true;\n }\n\n function onOpenChange(open?: boolean) {\n if (\n !isDropdownOpenRef.current &&\n !(isInputFieldFocused.current && showCalendar)\n ) {\n setShowCalendar(Boolean(open));\n }\n\n isDropdownOpenRef.current = false;\n }\n\n function handleInputFocus() {\n if (isInputFieldFocused.current) return;\n if (!showCalendar) setShowCalendar(true);\n }\n\n function handleInputBlur(event: React.FocusEvent) {\n if (isInputFieldFocused.current) {\n const el = event.relatedTarget as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n } else {\n registerEventListeners();\n setTimeout(() => inputFieldRef.current?.select());\n }\n }\n\n function handleKeyUp(event: React.KeyboardEvent) {\n if (event.code === 'Enter' && inputFieldRef.current) {\n inputFieldRef.current.blur();\n removeEventListeners();\n }\n }\n\n function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { value } = event.target;\n\n const format = value.includes('/')\n ? 'DD/MM/YYYY'\n : value.includes('-')\n ? 'DD-MM-YYYY'\n : undefined;\n const date = dayjs(value, format);\n\n const isValidDate = date.isValid();\n\n const isAfter =\n calendarProps?.startMonth !== undefined\n ? dayjs(date).isSameOrAfter(calendarProps.startMonth)\n : true;\n const isBefore =\n calendarProps?.endMonth !== undefined\n ? dayjs(date).isSameOrBefore(calendarProps.endMonth)\n : true;\n\n const isValid =\n isValidDate && isAfter && isBefore && dayjs(date).isSameOrBefore(dayjs());\n\n if (isValid) {\n setSelectedDate(date.toDate());\n setError(undefined);\n } else {\n setError('Invalid date');\n }\n }\n\n const defaultTrigger = (\n <InputField\n size='small'\n placeholder='Select date'\n error={error}\n className={styles.datePickerInput}\n trailingIcon={showCalendarIcon ? <CalendarIcon /> : undefined}\n {...inputFieldProps}\n ref={inputFieldRef}\n value={formattedDate}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n onKeyUp={handleKeyUp}\n />\n );\n\n const trigger =\n typeof children === 'function' ? (\n children({ selectedDate: formattedDate })\n ) : children ? (\n <div>{children}</div>\n ) : (\n <div>{defaultTrigger}</div>\n );\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger\n render={isValidElement(trigger) ? trigger : <button>{trigger}</button>}\n />\n <Popover.Content\n ref={contentRef}\n {...popoverProps}\n className={cx(styles.calendarPopover, popoverProps?.className)}\n side={popoverProps?.side ?? 'top'}\n >\n <Calendar\n required={true}\n {...calendarProps}\n timeZone={timeZone}\n onDropdownOpen={onDropdownOpen}\n mode='single'\n selected={selectedDate}\n month={selectedDate}\n onSelect={handleSelect}\n onMonthChange={setSelectedDate}\n />\n </Popover.Content>\n </Popover>\n );\n}\n\nDatePicker.displayName = 'DatePicker';\n"],"names":[],"mappings":";;;;;;;;;;;;AAqBA;AAgBgB;;;;;AAiBd;AACA;AACA;AACA;AACA;;AAGE;AACF;AAEA;AACE;;;;AAOF;AAEI;AACA;AAAgC;AAClC;AAIF;AACE;AACA;;AAGF;AACE;;AAGA;;AAE2B;AAC3B;;AAEA;;AAGF;;;;;AAKA;AAEA;AACE;;;;;AAQE;;AAGF;;AAGF;;;AAEE;;;;AAIA;AACE;AACA;AAAgC;;;AAEhC;;;;;;AAOA;AACA;;;;AAKF;AAEA;AACE;AACA;AACE;;;AAIJ;AAEA;;;AAIA;;;AAKA;;AAIE;;;;;;;AAOJ;AAiBA;;AAkCF;AAEA;;"}
1
+ {"version":3,"file":"date-picker.js","sources":["../../../components/calendar/date-picker.tsx"],"sourcesContent":["'use client';\n\nimport { CalendarIcon } from '@radix-ui/react-icons';\nimport { cx } from 'class-variance-authority';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat.js';\nimport {\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport { PropsBase, PropsSingleRequired } from 'react-day-picker';\nimport { InputField } from '../input-field';\nimport { InputFieldProps } from '../input-field/input-field';\nimport { Popover } from '../popover';\nimport { PopoverContentProps } from '../popover/popover';\nimport { Calendar } from './calendar';\nimport styles from './calendar.module.css';\n\ndayjs.extend(customParseFormat);\n\ninterface DatePickerProps {\n dateFormat?: string;\n inputFieldProps?: InputFieldProps;\n calendarProps?: PropsSingleRequired & PropsBase;\n onSelect?: (date: Date) => void;\n value?: Date;\n children?:\n | React.ReactNode\n | ((props: { selectedDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n timeZone?: string;\n popoverProps?: PopoverContentProps;\n}\n\nexport function DatePicker({\n dateFormat = 'DD/MM/YYYY',\n inputFieldProps,\n calendarProps,\n value = new Date(),\n onSelect = () => {},\n children,\n showCalendarIcon = true,\n timeZone,\n popoverProps\n}: DatePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [selectedDate, setSelectedDate] = useState(value);\n const [error, setError] = useState<string>();\n\n const formattedDate = dayjs(selectedDate).format(dateFormat);\n\n const isDropdownOpenRef = useRef(false);\n const inputFieldRef = useRef<HTMLInputElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const isInputFieldFocused = useRef(false);\n const selectedDateRef = useRef(selectedDate);\n\n useEffect(() => {\n selectedDateRef.current = selectedDate;\n }, [selectedDate]);\n\n const isElementOutside = useCallback((el: HTMLElement) => {\n return (\n !isDropdownOpenRef.current && // Month and Year dropdown from Date picker\n !inputFieldRef.current?.contains(el) && // InputField\n !contentRef.current?.contains(el)\n );\n }, []);\n\n const handleMouseDown = useCallback(\n (event: MouseEvent) => {\n const el = event.target as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n },\n [isElementOutside]\n );\n\n function registerEventListeners() {\n isInputFieldFocused.current = true;\n document.addEventListener('mouseup', handleMouseDown);\n }\n\n function removeEventListeners(skipUpdate = false) {\n isInputFieldFocused.current = false;\n setShowCalendar(false);\n\n const updatedVal = dayjs(selectedDateRef.current).format(dateFormat);\n\n if (inputFieldRef.current) inputFieldRef.current.value = updatedVal;\n if (!error && !skipUpdate) onSelect(dayjs(updatedVal).toDate());\n\n document.removeEventListener('mouseup', handleMouseDown);\n }\n\n const handleSelect = (day: Date) => {\n setSelectedDate(day);\n onSelect(day);\n setError(undefined);\n removeEventListeners(true);\n };\n\n function onDropdownOpen() {\n isDropdownOpenRef.current = true;\n }\n\n function onOpenChange(open?: boolean) {\n if (\n !isDropdownOpenRef.current &&\n !(isInputFieldFocused.current && showCalendar)\n ) {\n setShowCalendar(Boolean(open));\n }\n\n isDropdownOpenRef.current = false;\n }\n\n function handleInputFocus() {\n if (isInputFieldFocused.current) return;\n if (!showCalendar) setShowCalendar(true);\n }\n\n function handleInputBlur(event: React.FocusEvent) {\n if (isInputFieldFocused.current) {\n const el = event.relatedTarget as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n } else {\n registerEventListeners();\n setTimeout(() => inputFieldRef.current?.select());\n }\n }\n\n function handleKeyUp(event: React.KeyboardEvent) {\n if (event.code === 'Enter' && inputFieldRef.current) {\n inputFieldRef.current.blur();\n removeEventListeners();\n }\n }\n\n function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { value } = event.target;\n\n const format = value.includes('/')\n ? 'DD/MM/YYYY'\n : value.includes('-')\n ? 'DD-MM-YYYY'\n : undefined;\n const date = dayjs(value, format);\n\n const isValidDate = date.isValid();\n\n const isAfter =\n calendarProps?.startMonth !== undefined\n ? dayjs(date).isSameOrAfter(calendarProps.startMonth)\n : true;\n const isBefore =\n calendarProps?.endMonth !== undefined\n ? dayjs(date).isSameOrBefore(calendarProps.endMonth)\n : true;\n\n const isValid =\n isValidDate && isAfter && isBefore && dayjs(date).isSameOrBefore(dayjs());\n\n if (isValid) {\n setSelectedDate(date.toDate());\n setError(undefined);\n } else {\n setError('Invalid date');\n }\n }\n\n const defaultTrigger = (\n <InputField\n size='small'\n placeholder='Select date'\n error={error}\n className={styles.datePickerInput}\n trailingIcon={showCalendarIcon ? <CalendarIcon /> : undefined}\n {...inputFieldProps}\n ref={inputFieldRef}\n value={formattedDate}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n onKeyUp={handleKeyUp}\n />\n );\n\n const trigger =\n typeof children === 'function' ? (\n children({ selectedDate: formattedDate })\n ) : children ? (\n <div>{children}</div>\n ) : (\n <div>{defaultTrigger}</div>\n );\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger\n render={isValidElement(trigger) ? trigger : <button>{trigger}</button>}\n />\n <Popover.Content\n ref={contentRef}\n {...popoverProps}\n className={cx(styles.calendarPopover, popoverProps?.className)}\n side={popoverProps?.side ?? 'top'}\n >\n <Calendar\n required={true}\n {...calendarProps}\n timeZone={timeZone}\n onDropdownOpen={onDropdownOpen}\n mode='single'\n selected={selectedDate}\n month={selectedDate}\n onSelect={handleSelect}\n onMonthChange={setSelectedDate}\n />\n </Popover.Content>\n </Popover>\n );\n}\n\nDatePicker.displayName = 'DatePicker';\n"],"names":[],"mappings":";;;;;;;;;;;;AAqBA;AAgBgB;;;;;AAiBd;AACA;AACA;AACA;AACA;;AAGE;AACF;AAEA;AACE;;;;AAOF;AAEI;AACA;AAAgC;AAClC;AAIF;AACE;AACA;;AAGF;AACE;;AAGA;;AAE2B;AAC3B;;AAEA;;AAGF;;;;;AAKA;AAEA;AACE;;;;;AAQE;;AAGF;;AAGF;;;AAEE;;;;AAIA;AACE;AACA;AAAgC;;;AAEhC;;;;;;AAOA;AACA;;;;AAKF;AAEA;AACE;AACA;AACE;;;AAIJ;AAEA;;;AAIA;;;AAKA;;AAIE;;;;;;;AAOJ;AAiBA;;AAkCF;AAEA;;"}
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var react = require('@base-ui/react');
3
4
  var comboboxContent = require('./combobox-content.cjs');
4
5
  var comboboxInput = require('./combobox-input.cjs');
5
6
  var comboboxItem = require('./combobox-item.cjs');
@@ -12,7 +13,9 @@ const Combobox = Object.assign(comboboxRoot.ComboboxRoot, {
12
13
  Item: comboboxItem.ComboboxItem,
13
14
  Group: comboboxMisc.ComboboxGroup,
14
15
  Label: comboboxMisc.ComboboxLabel,
15
- Separator: comboboxMisc.ComboboxSeparator
16
+ Separator: comboboxMisc.ComboboxSeparator,
17
+ useFilter: react.Combobox.useFilter,
18
+ useFilteredItems: react.Combobox.useFilteredItems
16
19
  });
17
20
 
18
21
  exports.Combobox = Combobox;
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.cjs","sources":["../../../components/combobox/combobox.tsx"],"sourcesContent":["import { ComboboxContent } from './combobox-content';\nimport { ComboboxInput } from './combobox-input';\nimport { ComboboxItem } from './combobox-item';\nimport {\n ComboboxGroup,\n ComboboxLabel,\n ComboboxSeparator\n} from './combobox-misc';\nimport { ComboboxRoot } from './combobox-root';\n\nexport const Combobox = Object.assign(ComboboxRoot, {\n Input: ComboboxInput,\n Content: ComboboxContent,\n Item: ComboboxItem,\n Group: ComboboxGroup,\n Label: ComboboxLabel,\n Separator: ComboboxSeparator\n});\n"],"names":["ComboboxRoot","ComboboxInput","ComboboxContent","ComboboxItem","ComboboxGroup","ComboboxLabel","ComboboxSeparator"],"mappings":";;;;;;;;MAUa,QAAQ,GAAG,MAAM,CAAC,MAAM,CAACA,yBAAY,EAAE;AAClD,IAAA,KAAK,EAAEC,2BAAa;AACpB,IAAA,OAAO,EAAEC,+BAAe;AACxB,IAAA,IAAI,EAAEC,yBAAY;AAClB,IAAA,KAAK,EAAEC,0BAAa;AACpB,IAAA,KAAK,EAAEC,0BAAa;AACpB,IAAA,SAAS,EAAEC,8BAAiB;AAC7B,CAAA;;;;"}
1
+ {"version":3,"file":"combobox.cjs","sources":["../../../components/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as ComboboxPrimitive } from '@base-ui/react';\nimport { ComboboxContent } from './combobox-content';\nimport { ComboboxInput } from './combobox-input';\nimport { ComboboxItem } from './combobox-item';\nimport {\n ComboboxGroup,\n ComboboxLabel,\n ComboboxSeparator\n} from './combobox-misc';\nimport { ComboboxRoot } from './combobox-root';\n\nexport const Combobox = Object.assign(ComboboxRoot, {\n Input: ComboboxInput,\n Content: ComboboxContent,\n Item: ComboboxItem,\n Group: ComboboxGroup,\n Label: ComboboxLabel,\n Separator: ComboboxSeparator,\n useFilter: ComboboxPrimitive.useFilter,\n useFilteredItems: ComboboxPrimitive.useFilteredItems\n});\n"],"names":["ComboboxRoot","ComboboxInput","ComboboxContent","ComboboxItem","ComboboxGroup","ComboboxLabel","ComboboxSeparator","ComboboxPrimitive"],"mappings":";;;;;;;;;MAWa,QAAQ,GAAG,MAAM,CAAC,MAAM,CAACA,yBAAY,EAAE;AAClD,IAAA,KAAK,EAAEC,2BAAa;AACpB,IAAA,OAAO,EAAEC,+BAAe;AACxB,IAAA,IAAI,EAAEC,yBAAY;AAClB,IAAA,KAAK,EAAEC,0BAAa;AACpB,IAAA,KAAK,EAAEC,0BAAa;AACpB,IAAA,SAAS,EAAEC,8BAAiB;IAC5B,SAAS,EAAEC,cAAiB,CAAC,SAAS;IACtC,gBAAgB,EAAEA,cAAiB,CAAC,gBAAgB;AACrD,CAAA;;;;"}
@@ -1,3 +1,4 @@
1
+ import { Combobox as ComboboxPrimitive } from '@base-ui/react';
1
2
  export declare const Combobox: {
2
3
  <Value extends unknown>({ multiple, children, onValueChange, onInputValueChange, value: providedValue, defaultValue, items, ...props }: import("./combobox-root").ComboboxRootProps<Value>): import("react/jsx-runtime").JSX.Element;
3
4
  displayName: string;
@@ -26,5 +27,7 @@ export declare const Combobox: {
26
27
  ({ className, ...props }: import("@base-ui/react").SeparatorProps): import("react/jsx-runtime").JSX.Element | null;
27
28
  displayName: string;
28
29
  };
30
+ useFilter: typeof ComboboxPrimitive.useFilter;
31
+ useFilteredItems: typeof ComboboxPrimitive.useFilteredItems;
29
32
  };
30
33
  //# sourceMappingURL=combobox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../components/combobox/combobox.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOnB,CAAC"}
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../components/combobox/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAW/D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASnB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { Combobox as Combobox$1 } from '@base-ui/react';
1
2
  import { ComboboxContent } from './combobox-content.js';
2
3
  import { ComboboxInput } from './combobox-input.js';
3
4
  import { ComboboxItem } from './combobox-item.js';
@@ -10,7 +11,9 @@ const Combobox = Object.assign(ComboboxRoot, {
10
11
  Item: ComboboxItem,
11
12
  Group: ComboboxGroup,
12
13
  Label: ComboboxLabel,
13
- Separator: ComboboxSeparator
14
+ Separator: ComboboxSeparator,
15
+ useFilter: Combobox$1.useFilter,
16
+ useFilteredItems: Combobox$1.useFilteredItems
14
17
  });
15
18
 
16
19
  export { Combobox };
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","sources":["../../../components/combobox/combobox.tsx"],"sourcesContent":["import { ComboboxContent } from './combobox-content';\nimport { ComboboxInput } from './combobox-input';\nimport { ComboboxItem } from './combobox-item';\nimport {\n ComboboxGroup,\n ComboboxLabel,\n ComboboxSeparator\n} from './combobox-misc';\nimport { ComboboxRoot } from './combobox-root';\n\nexport const Combobox = Object.assign(ComboboxRoot, {\n Input: ComboboxInput,\n Content: ComboboxContent,\n Item: ComboboxItem,\n Group: ComboboxGroup,\n Label: ComboboxLabel,\n Separator: ComboboxSeparator\n});\n"],"names":[],"mappings":";;;;;;MAUa,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE;AAClD,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,OAAO,EAAE,eAAe;AACxB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,SAAS,EAAE,iBAAiB;AAC7B,CAAA;;;;"}
1
+ {"version":3,"file":"combobox.js","sources":["../../../components/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as ComboboxPrimitive } from '@base-ui/react';\nimport { ComboboxContent } from './combobox-content';\nimport { ComboboxInput } from './combobox-input';\nimport { ComboboxItem } from './combobox-item';\nimport {\n ComboboxGroup,\n ComboboxLabel,\n ComboboxSeparator\n} from './combobox-misc';\nimport { ComboboxRoot } from './combobox-root';\n\nexport const Combobox = Object.assign(ComboboxRoot, {\n Input: ComboboxInput,\n Content: ComboboxContent,\n Item: ComboboxItem,\n Group: ComboboxGroup,\n Label: ComboboxLabel,\n Separator: ComboboxSeparator,\n useFilter: ComboboxPrimitive.useFilter,\n useFilteredItems: ComboboxPrimitive.useFilteredItems\n});\n"],"names":["ComboboxPrimitive"],"mappings":";;;;;;;MAWa,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE;AAClD,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,OAAO,EAAE,eAAe;AACxB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAEA,UAAiB,CAAC,SAAS;IACtC,gBAAgB,EAAEA,UAAiB,CAAC,gBAAgB;AACrD,CAAA;;;;"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var dayjs = require('dayjs');
4
- var isSameOrAfter = require('dayjs/plugin/isSameOrAfter');
5
- var isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
4
+ var isSameOrAfter = require('dayjs/plugin/isSameOrAfter.js');
5
+ var isSameOrBefore = require('dayjs/plugin/isSameOrBefore.js');
6
6
  var filters = require('../../../types/filters.cjs');
7
7
 
8
8
  dayjs.extend(isSameOrAfter);
@@ -114,9 +114,18 @@ const handleStringBasedTypes = (filterType, value, operator) => {
114
114
  switch (filterType) {
115
115
  case filters.FilterType.date: {
116
116
  const dateValue = dayjs(value);
117
+ let stringValue = '';
118
+ if (dateValue.isValid()) {
119
+ try {
120
+ stringValue = dateValue.toISOString();
121
+ }
122
+ catch {
123
+ stringValue = '';
124
+ }
125
+ }
117
126
  return {
118
127
  value,
119
- stringValue: dateValue.isValid() ? dateValue.toISOString() : ''
128
+ stringValue
120
129
  };
121
130
  }
122
131
  case filters.FilterType.select:
@@ -1 +1 @@
1
- {"version":3,"file":"filter-operations.cjs","sources":["../../../../components/data-table/utils/filter-operations.tsx"],"sourcesContent":["import type { FilterFn } from '@tanstack/table-core';\nimport dayjs from 'dayjs';\nimport isSameOrAfter from 'dayjs/plugin/isSameOrAfter';\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore';\n\nimport {\n DataTableFilterOperatorTypes,\n DateFilterOperatorType,\n EmptyFilterValue,\n FilterOperatorTypes,\n FilterType,\n FilterTypes,\n FilterValue,\n FilterValueType,\n MultiSelectFilterOperatorType,\n NumberFilterOperatorType,\n SelectFilterOperatorType,\n StringFilterOperatorType\n} from '~/types/filters';\nimport { DataTableFilterValues } from '../data-table.types';\n\ndayjs.extend(isSameOrAfter);\ndayjs.extend(isSameOrBefore);\n\nexport type FilterFunctionsMap = {\n number: Record<NumberFilterOperatorType, FilterFn<unknown>>;\n string: Record<StringFilterOperatorType, FilterFn<unknown>>;\n date: Record<DateFilterOperatorType, FilterFn<unknown>>;\n select: Record<SelectFilterOperatorType, FilterFn<unknown>>;\n multiselect: Record<MultiSelectFilterOperatorType, FilterFn<unknown>>;\n};\n\nexport const filterOperationsMap: FilterFunctionsMap = {\n number: {\n eq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) === Number(filterValue.value);\n },\n neq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) !== Number(filterValue.value);\n },\n lt: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) < Number(filterValue.value);\n },\n lte: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) <= Number(filterValue.value);\n },\n gt: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) > Number(filterValue.value);\n },\n gte: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) >= Number(filterValue.value);\n }\n },\n string: {\n eq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return (\n String(row.getValue(columnId)).toLowerCase() ===\n String(filterValue.value).toLowerCase()\n );\n },\n neq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return (\n String(row.getValue(columnId)).toLowerCase() !==\n String(filterValue.value).toLowerCase()\n );\n },\n contains: (row, columnId, filterValue: FilterValue, _addMeta) => {\n const columnValue = String(row.getValue(columnId)).toLowerCase();\n const filterStr = String(filterValue.value).toLowerCase();\n return columnValue.includes(filterStr);\n },\n starts_with: (row, columnId, filterValue: FilterValue, _addMeta) => {\n const columnValue = String(row.getValue(columnId)).toLowerCase();\n const filterStr = String(filterValue.value).toLowerCase();\n return columnValue.startsWith(filterStr);\n },\n ends_with: (row, columnId, filterValue: FilterValue, _addMeta) => {\n const columnValue = String(row.getValue(columnId)).toLowerCase();\n const filterStr = String(filterValue.value).toLowerCase();\n return columnValue.endsWith(filterStr);\n }\n },\n date: {\n eq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isSame(\n dayjs(filterValue.date),\n 'day'\n );\n },\n neq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return !dayjs(row.getValue(columnId)).isSame(\n dayjs(filterValue.date),\n 'day'\n );\n },\n lt: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isBefore(\n dayjs(filterValue.date),\n 'day'\n );\n },\n lte: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isSameOrBefore(\n dayjs(filterValue.date),\n 'day'\n );\n },\n gt: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isAfter(\n dayjs(filterValue.date),\n 'day'\n );\n },\n gte: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isSameOrAfter(\n dayjs(filterValue.date),\n 'day'\n );\n }\n },\n select: {\n eq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n if (String(filterValue.value) === EmptyFilterValue) {\n return row.getValue(columnId) === '';\n }\n // Select only supports string values\n return String(row.getValue(columnId)) === String(filterValue.value);\n },\n neq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n if (String(filterValue.value) === EmptyFilterValue) {\n return row.getValue(columnId) !== '';\n }\n // Select only supports string values\n return String(row.getValue(columnId)) !== String(filterValue.value);\n }\n },\n multiselect: {\n in: (row, columnId, filterValue: FilterValue, _addMeta) => {\n if (!Array.isArray(filterValue.value)) return false;\n\n return filterValue.value\n .map(value => (value === EmptyFilterValue ? '' : String(value)))\n .includes(String(row.getValue(columnId)));\n },\n notin: (row, columnId, filterValue: FilterValue, _addMeta) => {\n if (!Array.isArray(filterValue.value)) return false;\n\n return !filterValue.value\n .map(value => (value === EmptyFilterValue ? '' : String(value)))\n .includes(String(row.getValue(columnId)));\n }\n }\n} as const;\n\nexport function getFilterFn<T extends keyof FilterFunctionsMap>(\n type: T,\n operator: FilterOperatorTypes\n) {\n // @ts-expect-error FilterOperatorTypes is union of all possible operators\n return filterOperationsMap[type][operator];\n}\n\nconst handleStringBasedTypes = (\n filterType: FilterTypes,\n value: any,\n operator?: FilterOperatorTypes | DataTableFilterOperatorTypes\n): DataTableFilterValues => {\n switch (filterType) {\n case FilterType.date: {\n const dateValue = dayjs(value);\n return {\n value,\n stringValue: dateValue.isValid() ? dateValue.toISOString() : ''\n };\n }\n case FilterType.select:\n return {\n stringValue: value === EmptyFilterValue ? '' : value,\n value\n };\n case FilterType.multiselect:\n return {\n value,\n stringValue: value\n .map((value: any) =>\n value === EmptyFilterValue ? '' : String(value)\n )\n .join()\n };\n case FilterType.string: {\n // Apply wildcards for ilike operations\n let processedValue = value;\n // Check if we need to apply wildcards (operator could be UI type or already converted to 'ilike')\n if (operator === 'contains') {\n processedValue = `%${value}%`;\n } else if (operator === 'starts_with') {\n processedValue = `${value}%`;\n } else if (operator === 'ends_with') {\n processedValue = `%${value}`;\n } else if (operator === 'ilike') {\n // If already converted to ilike, assume it needs contains-style wildcards\n // unless the value already has wildcards\n if (!value.includes('%')) {\n processedValue = `%${value}%`;\n }\n }\n return {\n stringValue: processedValue,\n value\n };\n }\n default:\n return {\n stringValue: value,\n value\n };\n }\n};\n\nexport const getFilterOperator = ({\n value,\n filterType,\n operator\n}: {\n value: any;\n filterType?: FilterTypes;\n operator: FilterOperatorTypes;\n}): DataTableFilterOperatorTypes => {\n if (value === EmptyFilterValue && filterType === FilterType.select) {\n return 'empty';\n }\n\n // Map string filter operators to ilike for DataTableFilter\n if (\n filterType === FilterType.string &&\n (operator === 'contains' ||\n operator === 'starts_with' ||\n operator === 'ends_with')\n ) {\n return 'ilike';\n }\n\n return operator as DataTableFilterOperatorTypes;\n};\n\nexport const getFilterValue = ({\n value,\n dataType = 'string',\n filterType = FilterType.string,\n operator\n}: {\n value: any;\n dataType?: FilterValueType;\n filterType?: FilterTypes;\n operator?: FilterOperatorTypes | DataTableFilterOperatorTypes;\n}): DataTableFilterValues => {\n if (dataType === 'boolean') {\n return { boolValue: value, value };\n }\n if (dataType === 'number') {\n return { numberValue: value, value };\n }\n\n // Handle string-based types\n return handleStringBasedTypes(filterType, value, operator);\n};\n\nexport const getDataType = ({\n filterType = FilterType.string,\n dataType = 'string'\n}: {\n dataType?: FilterValueType;\n filterType?: FilterTypes;\n}): FilterValueType => {\n switch (filterType) {\n case FilterType.multiselect:\n case FilterType.select:\n return dataType;\n case FilterType.date:\n return 'string';\n default:\n return filterType;\n }\n};\n"],"names":["EmptyFilterValue","FilterType"],"mappings":";;;;;;;AAqBA,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Q,CAAC;QAClB,KAAKA,kBAAU,CAAC,IAAI;AAClB,YAAA,OAAO,QAAQ,CAAC;AAClB,QAAA;AACE,YAAA,OAAO,UAAU,CAAC;KACrB;AACH;;;;;;;;"}
1
+ {"version":3,"file":"filter-operations.cjs","sources":["../../../../components/data-table/utils/filter-operations.tsx"],"sourcesContent":["import type { FilterFn } from '@tanstack/table-core';\nimport dayjs from 'dayjs';\nimport isSameOrAfter from 'dayjs/plugin/isSameOrAfter.js';\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js';\n\nimport {\n DataTableFilterOperatorTypes,\n DateFilterOperatorType,\n EmptyFilterValue,\n FilterOperatorTypes,\n FilterType,\n FilterTypes,\n FilterValue,\n FilterValueType,\n MultiSelectFilterOperatorType,\n NumberFilterOperatorType,\n SelectFilterOperatorType,\n StringFilterOperatorType\n} from '~/types/filters';\nimport { DataTableFilterValues } from '../data-table.types';\n\ndayjs.extend(isSameOrAfter);\ndayjs.extend(isSameOrBefore);\n\nexport type FilterFunctionsMap = {\n number: Record<NumberFilterOperatorType, FilterFn<unknown>>;\n string: Record<StringFilterOperatorType, FilterFn<unknown>>;\n date: Record<DateFilterOperatorType, FilterFn<unknown>>;\n select: Record<SelectFilterOperatorType, FilterFn<unknown>>;\n multiselect: Record<MultiSelectFilterOperatorType, FilterFn<unknown>>;\n};\n\nexport const filterOperationsMap: FilterFunctionsMap = {\n number: {\n eq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) === Number(filterValue.value);\n },\n neq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) !== Number(filterValue.value);\n },\n lt: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) < Number(filterValue.value);\n },\n lte: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) <= Number(filterValue.value);\n },\n gt: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) > Number(filterValue.value);\n },\n gte: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return Number(row.getValue(columnId)) >= Number(filterValue.value);\n }\n },\n string: {\n eq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return (\n String(row.getValue(columnId)).toLowerCase() ===\n String(filterValue.value).toLowerCase()\n );\n },\n neq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return (\n String(row.getValue(columnId)).toLowerCase() !==\n String(filterValue.value).toLowerCase()\n );\n },\n contains: (row, columnId, filterValue: FilterValue, _addMeta) => {\n const columnValue = String(row.getValue(columnId)).toLowerCase();\n const filterStr = String(filterValue.value).toLowerCase();\n return columnValue.includes(filterStr);\n },\n starts_with: (row, columnId, filterValue: FilterValue, _addMeta) => {\n const columnValue = String(row.getValue(columnId)).toLowerCase();\n const filterStr = String(filterValue.value).toLowerCase();\n return columnValue.startsWith(filterStr);\n },\n ends_with: (row, columnId, filterValue: FilterValue, _addMeta) => {\n const columnValue = String(row.getValue(columnId)).toLowerCase();\n const filterStr = String(filterValue.value).toLowerCase();\n return columnValue.endsWith(filterStr);\n }\n },\n date: {\n eq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isSame(\n dayjs(filterValue.date),\n 'day'\n );\n },\n neq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return !dayjs(row.getValue(columnId)).isSame(\n dayjs(filterValue.date),\n 'day'\n );\n },\n lt: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isBefore(\n dayjs(filterValue.date),\n 'day'\n );\n },\n lte: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isSameOrBefore(\n dayjs(filterValue.date),\n 'day'\n );\n },\n gt: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isAfter(\n dayjs(filterValue.date),\n 'day'\n );\n },\n gte: (row, columnId, filterValue: FilterValue, _addMeta) => {\n return dayjs(row.getValue(columnId)).isSameOrAfter(\n dayjs(filterValue.date),\n 'day'\n );\n }\n },\n select: {\n eq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n if (String(filterValue.value) === EmptyFilterValue) {\n return row.getValue(columnId) === '';\n }\n // Select only supports string values\n return String(row.getValue(columnId)) === String(filterValue.value);\n },\n neq: (row, columnId, filterValue: FilterValue, _addMeta) => {\n if (String(filterValue.value) === EmptyFilterValue) {\n return row.getValue(columnId) !== '';\n }\n // Select only supports string values\n return String(row.getValue(columnId)) !== String(filterValue.value);\n }\n },\n multiselect: {\n in: (row, columnId, filterValue: FilterValue, _addMeta) => {\n if (!Array.isArray(filterValue.value)) return false;\n\n return filterValue.value\n .map(value => (value === EmptyFilterValue ? '' : String(value)))\n .includes(String(row.getValue(columnId)));\n },\n notin: (row, columnId, filterValue: FilterValue, _addMeta) => {\n if (!Array.isArray(filterValue.value)) return false;\n\n return !filterValue.value\n .map(value => (value === EmptyFilterValue ? '' : String(value)))\n .includes(String(row.getValue(columnId)));\n }\n }\n} as const;\n\nexport function getFilterFn<T extends keyof FilterFunctionsMap>(\n type: T,\n operator: FilterOperatorTypes\n) {\n // @ts-expect-error FilterOperatorTypes is union of all possible operators\n return filterOperationsMap[type][operator];\n}\n\nconst handleStringBasedTypes = (\n filterType: FilterTypes,\n value: any,\n operator?: FilterOperatorTypes | DataTableFilterOperatorTypes\n): DataTableFilterValues => {\n switch (filterType) {\n case FilterType.date: {\n const dateValue = dayjs(value);\n let stringValue = '';\n if (dateValue.isValid()) {\n try {\n stringValue = dateValue.toISOString();\n } catch {\n stringValue = '';\n }\n }\n return {\n value,\n stringValue\n };\n }\n case FilterType.select:\n return {\n stringValue: value === EmptyFilterValue ? '' : value,\n value\n };\n case FilterType.multiselect:\n return {\n value,\n stringValue: value\n .map((value: any) =>\n value === EmptyFilterValue ? '' : String(value)\n )\n .join()\n };\n case FilterType.string: {\n // Apply wildcards for ilike operations\n let processedValue = value;\n // Check if we need to apply wildcards (operator could be UI type or already converted to 'ilike')\n if (operator === 'contains') {\n processedValue = `%${value}%`;\n } else if (operator === 'starts_with') {\n processedValue = `${value}%`;\n } else if (operator === 'ends_with') {\n processedValue = `%${value}`;\n } else if (operator === 'ilike') {\n // If already converted to ilike, assume it needs contains-style wildcards\n // unless the value already has wildcards\n if (!value.includes('%')) {\n processedValue = `%${value}%`;\n }\n }\n return {\n stringValue: processedValue,\n value\n };\n }\n default:\n return {\n stringValue: value,\n value\n };\n }\n};\n\nexport const getFilterOperator = ({\n value,\n filterType,\n operator\n}: {\n value: any;\n filterType?: FilterTypes;\n operator: FilterOperatorTypes;\n}): DataTableFilterOperatorTypes => {\n if (value === EmptyFilterValue && filterType === FilterType.select) {\n return 'empty';\n }\n\n // Map string filter operators to ilike for DataTableFilter\n if (\n filterType === FilterType.string &&\n (operator === 'contains' ||\n operator === 'starts_with' ||\n operator === 'ends_with')\n ) {\n return 'ilike';\n }\n\n return operator as DataTableFilterOperatorTypes;\n};\n\nexport const getFilterValue = ({\n value,\n dataType = 'string',\n filterType = FilterType.string,\n operator\n}: {\n value: any;\n dataType?: FilterValueType;\n filterType?: FilterTypes;\n operator?: FilterOperatorTypes | DataTableFilterOperatorTypes;\n}): DataTableFilterValues => {\n if (dataType === 'boolean') {\n return { boolValue: value, value };\n }\n if (dataType === 'number') {\n return { numberValue: value, value };\n }\n\n // Handle string-based types\n return handleStringBasedTypes(filterType, value, operator);\n};\n\nexport const getDataType = ({\n filterType = FilterType.string,\n dataType = 'string'\n}: {\n dataType?: FilterValueType;\n filterType?: FilterTypes;\n}): FilterValueType => {\n switch (filterType) {\n case FilterType.multiselect:\n case FilterType.select:\n return dataType;\n case FilterType.date:\n return 'string';\n default:\n return filterType;\n }\n};\n"],"names":["EmptyFilterValue","FilterType"],"mappings":";;;;;;;AAqBA,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAC5B,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAUhB,MAAA,mBAAmB,GAAuB;A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CAAC;AAEF,eAAO,MAAM,WAAW;;;MAMpB,eAUH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import dayjs from 'dayjs';
2
- import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
3
- import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
2
+ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter.js';
3
+ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js';
4
4
  import { EmptyFilterValue, FilterType } from '../../../types/filters.js';
5
5
 
6
6
  dayjs.extend(isSameOrAfter);
@@ -112,9 +112,18 @@ const handleStringBasedTypes = (filterType, value, operator) => {
112
112
  switch (filterType) {
113
113
  case FilterType.date: {
114
114
  const dateValue = dayjs(value);
115
+ let stringValue = '';
116
+ if (dateValue.isValid()) {
117
+ try {
118
+ stringValue = dateValue.toISOString();
119
+ }
120
+ catch {
121
+ stringValue = '';
122
+ }
123
+ }
115
124
  return {
116
125
  value,
117
- stringValue: dateValue.isValid() ? dateValue.toISOString() : ''
126
+ stringValue
118
127
  };
119
128
  }
120
129
  case FilterType.select: