@companix/uikit 0.0.16 → 0.0.17

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 (59) hide show
  1. package/dist/DatePicker/index.d.ts +2 -3
  2. package/dist/Input/Form.scss +1 -4
  3. package/dist/Input/InlineInput.d.ts +0 -0
  4. package/dist/Input/{index.d.ts → Input.d.ts} +4 -8
  5. package/dist/Input/Input.scss +23 -0
  6. package/dist/Input/InputContainer.d.ts +11 -0
  7. package/dist/Input/InputElement.d.ts +7 -0
  8. package/dist/NumberInput/index.d.ts +2 -2
  9. package/dist/Select/SelectOptions.d.ts +12 -0
  10. package/dist/Select/SelectRight.d.ts +8 -0
  11. package/dist/Select/index.d.ts +5 -1
  12. package/dist/TimePicker/index.d.ts +10 -0
  13. package/dist/__hooks/use-input-padding.d.ts +5 -0
  14. package/dist/__hooks/use-scrollbox.d.ts +1 -1
  15. package/dist/__hooks/use-update.d.ts +1 -1
  16. package/dist/__utils/utils.d.ts +15 -1
  17. package/dist/bundle.es.js +30 -26
  18. package/dist/bundle.es10.js +1 -1
  19. package/dist/bundle.es14.js +1 -1
  20. package/dist/bundle.es19.js +1 -1
  21. package/dist/bundle.es20.js +1 -1
  22. package/dist/bundle.es23.js +1 -1
  23. package/dist/bundle.es24.js +2 -2
  24. package/dist/bundle.es25.js +93 -85
  25. package/dist/bundle.es26.js +67 -29
  26. package/dist/bundle.es27.js +34 -10
  27. package/dist/bundle.es28.js +11 -10
  28. package/dist/bundle.es29.js +82 -21
  29. package/dist/bundle.es30.js +10 -35
  30. package/dist/bundle.es31.js +21 -20
  31. package/dist/bundle.es32.js +36 -83
  32. package/dist/bundle.es33.js +23 -17
  33. package/dist/bundle.es34.js +87 -14
  34. package/dist/bundle.es35.js +18 -22
  35. package/dist/bundle.es36.js +20 -5
  36. package/dist/bundle.es37.js +24 -14
  37. package/dist/bundle.es38.js +39 -14
  38. package/dist/bundle.es39.js +20 -68
  39. package/dist/bundle.es40.js +5 -68
  40. package/dist/bundle.es41.js +13 -31
  41. package/dist/bundle.es42.js +14 -68
  42. package/dist/bundle.es43.js +66 -39
  43. package/dist/bundle.es44.js +67 -30
  44. package/dist/bundle.es45.js +69 -74
  45. package/dist/bundle.es46.js +10 -48
  46. package/dist/bundle.es47.js +45 -0
  47. package/dist/bundle.es48.js +34 -0
  48. package/dist/bundle.es49.js +70 -0
  49. package/dist/bundle.es50.js +16 -0
  50. package/dist/bundle.es51.js +45 -0
  51. package/dist/bundle.es52.js +77 -0
  52. package/dist/bundle.es53.js +51 -0
  53. package/dist/bundle.es54.js +16 -0
  54. package/dist/bundle.es8.js +54 -62
  55. package/dist/bundle.es9.js +35 -70
  56. package/dist/index.d.ts +3 -1
  57. package/dist/index.scss +2 -2
  58. package/dist/types.d.ts +4 -0
  59. package/package.json +2 -3
@@ -1,11 +1,10 @@
1
- import { FormProps } from '../Input';
1
+ import { InputProps } from '../Input/Input';
2
2
  import { CalendarProps } from './Calendar';
3
- interface DatePickerProps extends Omit<CalendarProps, 'onChange'>, Omit<FormProps, 'value' | 'onChange' | 'rightElement'> {
3
+ interface DatePickerProps extends Omit<CalendarProps, 'onChange'>, Omit<InputProps, 'value' | 'onChange' | 'rightElement'> {
4
4
  onChange?: (value: Date | null) => void;
5
5
  clearButton?: boolean;
6
6
  clearButtonIcon?: boolean;
7
7
  children?: React.ReactNode;
8
- minimalOptions?: boolean;
9
8
  }
10
9
  export declare const DatePicker: (props: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
11
10
  export {};
@@ -31,10 +31,6 @@
31
31
 
32
32
  &[data-fill] {
33
33
  width: 100%;
34
-
35
- .form-input {
36
- width: 100%;
37
- }
38
34
  }
39
35
 
40
36
  &[data-required] {
@@ -56,6 +52,7 @@
56
52
 
57
53
  .form-input {
58
54
  outline: none;
55
+ width: 100%;
59
56
 
60
57
  &::-webkit-outer-spin-button,
61
58
  &::-webkit-inner-spin-button {
File without changes
@@ -1,17 +1,13 @@
1
- export interface FormProps extends React.HTMLAttributes<HTMLDivElement> {
2
- required?: boolean;
3
- disabled?: boolean;
4
- leftElement?: React.ReactNode;
5
- rightElement?: React.ReactNode;
1
+ import { InputContainerProps } from './InputContainer';
2
+ export interface InputProps extends Omit<InputContainerProps, 'inputRef' | 'children'> {
6
3
  placeholder?: string;
7
4
  value?: string | number;
8
5
  readOnly?: boolean;
9
6
  onValueChange?: (value: string, targetElement: HTMLInputElement) => void;
10
7
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
11
8
  inputRef?: React.Ref<HTMLInputElement>;
12
- size?: 'sm' | 'md' | 'lg';
13
- fill?: boolean;
9
+ inputClassName?: string;
14
10
  mask?: string;
15
11
  maskChar?: string;
16
12
  }
17
- export declare const Input: import('react').ForwardRefExoticComponent<FormProps & import('react').RefAttributes<HTMLDivElement>>;
13
+ export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -22,3 +22,26 @@
22
22
  align-items: center;
23
23
  }
24
24
  }
25
+
26
+ .inline-input {
27
+ position: absolute;
28
+ top: 0;
29
+ left: 0;
30
+ width: 100%;
31
+ height: 100%;
32
+
33
+ &-container {
34
+ position: relative;
35
+ display: flex;
36
+ flex: 1;
37
+ align-items: center;
38
+ align-self: stretch;
39
+ overflow: hidden;
40
+ height: var(--form_size_md_height);
41
+ }
42
+
43
+ &-title {
44
+ padding: 0px var(--form_space, 0);
45
+ opacity: 0;
46
+ }
47
+ }
@@ -0,0 +1,11 @@
1
+ export interface InputContainerProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ leftElement?: React.ReactNode;
3
+ rightElement?: React.ReactNode;
4
+ size?: 'sm' | 'md' | 'lg';
5
+ fill?: boolean;
6
+ disabled?: boolean;
7
+ required?: boolean;
8
+ inputRef: React.RefObject<HTMLInputElement>;
9
+ children: React.ReactNode;
10
+ }
11
+ export declare const InputContainer: import('react').ForwardRefExoticComponent<InputContainerProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children'> {
2
+ mask?: string;
3
+ maskChar?: string;
4
+ onValueChange?: (value: string, targetElement: HTMLInputElement) => void;
5
+ }
6
+ export declare const InputElement: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
7
+ export {};
@@ -1,5 +1,5 @@
1
- import { FormProps } from '../Input';
2
- export interface NumberInputProps extends Omit<FormProps, 'value' | 'onChange'> {
1
+ import { InputProps } from '../Input/Input';
2
+ export interface NumberInputProps extends Omit<InputProps, 'value' | 'onChange'> {
3
3
  value: number | null;
4
4
  onChange: (value: number | null) => void;
5
5
  }
@@ -0,0 +1,12 @@
1
+ import { Option } from '..';
2
+ interface SelectPopoverProps<T> {
3
+ scrollboxRef?: React.RefObject<HTMLDivElement>;
4
+ optionsWrapperRef?: React.RefObject<HTMLDivElement>;
5
+ options: Option<T>[];
6
+ minimalOptions?: boolean;
7
+ active?: T | null;
8
+ onSelect?: (value: T) => void;
9
+ onOpened?: () => void;
10
+ }
11
+ export declare const SelectOptions: <T>(props: SelectPopoverProps<T>) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,8 @@
1
+ interface SelectRightElementsProps {
2
+ onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void;
3
+ clearButton?: boolean;
4
+ clearButtonIcon?: React.ReactNode;
5
+ value: boolean;
6
+ }
7
+ export declare const SelectRightElements: (props: SelectRightElementsProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -15,6 +15,10 @@ type SelectProps<T> = Omit<SelectFormProps, 'value' | 'onChange' | 'closeButton'
15
15
  children?: React.ReactNode;
16
16
  minimalOptions?: boolean;
17
17
  matchTarget?: 'width' | 'min-width';
18
+ popoverRef?: React.Ref<HTMLDivElement>;
19
+ scrollRef?: React.Ref<{
20
+ scrollTo: (index: number) => void;
21
+ }>;
18
22
  };
19
- export declare const Select: <T>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const Select: <T extends string | number>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
20
24
  export {};
@@ -0,0 +1,10 @@
1
+ import { InputProps } from '../Input/Input';
2
+ import { TimeFormat } from '..';
3
+ export interface TimePickerProps extends Omit<InputProps, 'value' | 'onChange' | 'rightElement'> {
4
+ required?: boolean;
5
+ value: TimeFormat | null;
6
+ onChange: (value: TimeFormat | null) => void;
7
+ clearButton?: boolean;
8
+ clearButtonIcon?: boolean;
9
+ }
10
+ export declare const TimePicker: (props: TimePickerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ declare const useInputPadding: (inputRef: React.RefObject<HTMLInputElement>, deps?: React.DependencyList) => {
2
+ rightRef: import('react').RefObject<HTMLSpanElement>;
3
+ leftRef: import('react').RefObject<HTMLSpanElement>;
4
+ };
5
+ export { useInputPadding };
@@ -1,7 +1,7 @@
1
1
  interface UseScrollListControllerReturn {
2
2
  scrollBoxRef: React.RefObject<HTMLDivElement>;
3
3
  optionsWrapperRef: React.RefObject<HTMLDivElement>;
4
- scrollToElement: (index: number, center?: boolean) => void;
4
+ scrollToElement: (index: number, position?: 'center' | 'top') => void;
5
5
  }
6
6
  export declare const useScrollListController: () => UseScrollListControllerReturn;
7
7
  export {};
@@ -1 +1 @@
1
- export declare const useLayoutAndUpdate: (callback: () => void, deps?: React.DependencyList | undefined) => void;
1
+ export declare const useEffectWithLayout: (callback: () => void, deps?: React.DependencyList | undefined) => void;
@@ -1,4 +1,4 @@
1
- import { DateFormat, Option } from '..';
1
+ import { DateFormat, Option, TimeFormat } from '..';
2
2
  export declare const getMonthMaxDay: (month: number, year: number) => number;
3
3
  export declare const getFirstDay: (month: number, year: number) => number;
4
4
  export declare const getDayIndex: (day: number) => number;
@@ -23,3 +23,17 @@ export declare const DEFAULT_MAX_YEAR = 9999;
23
23
  export declare const DEFAULT_MIN_YEAR = 100;
24
24
  export declare const getYears: (currentYear: number, range: number) => Option<number>[];
25
25
  export declare const getMonths: (locale?: string) => Option<number>[];
26
+ export declare const removeDigits: (value: string, signs: string[]) => string;
27
+ export declare const convertTimeToOption: ({ hours, minutes }: TimeFormat, char?: string) => string;
28
+ interface TimeOption extends Option<string> {
29
+ hours: string;
30
+ minutes: string;
31
+ }
32
+ export declare const getTimeValue: (time: TimeFormat, char?: string) => {
33
+ title: string;
34
+ value: string;
35
+ hours: string;
36
+ minutes: string;
37
+ };
38
+ export declare const getTimesOptions: (step: number, char?: string) => TimeOption[];
39
+ export {};
package/dist/bundle.es.js CHANGED
@@ -5,15 +5,15 @@ import { ImitateScroll as a } from "./bundle.es5.js";
5
5
  import { Popover as i } from "./bundle.es6.js";
6
6
  import { Tooltip as c } from "./bundle.es7.js";
7
7
  import { Select as S } from "./bundle.es8.js";
8
- import { Input as g } from "./bundle.es9.js";
9
- import { OptionItem as b } from "./bundle.es10.js";
10
- import { NumberInput as D } from "./bundle.es11.js";
8
+ import { Input as T } from "./bundle.es9.js";
9
+ import { OptionItem as D } from "./bundle.es10.js";
10
+ import { NumberInput as b } from "./bundle.es11.js";
11
11
  import { OptionsList as d } from "./bundle.es12.js";
12
- import { ButtonGroup as B } from "./bundle.es13.js";
13
- import { Checkbox as O } from "./bundle.es14.js";
14
- import { Switch as k } from "./bundle.es15.js";
15
- import { Radio as C } from "./bundle.es16.js";
16
- import { Drawer as G } from "./bundle.es17.js";
12
+ import { ButtonGroup as w } from "./bundle.es13.js";
13
+ import { Checkbox as L } from "./bundle.es14.js";
14
+ import { Switch as P } from "./bundle.es15.js";
15
+ import { Radio as v } from "./bundle.es16.js";
16
+ import { Drawer as F } from "./bundle.es17.js";
17
17
  import { Dialog as y } from "./bundle.es18.js";
18
18
  import { AlertDialog as R } from "./bundle.es19.js";
19
19
  import { LoadButton as q } from "./bundle.es20.js";
@@ -22,39 +22,43 @@ import { Countdown as J } from "./bundle.es22.js";
22
22
  import { TextArea as M } from "./bundle.es23.js";
23
23
  import { SelectTags as U } from "./bundle.es24.js";
24
24
  import { DatePicker as W } from "./bundle.es25.js";
25
- import { FileOverlay as Y } from "./bundle.es26.js";
26
- import { FormGroup as _ } from "./bundle.es27.js";
27
- import { useLocalStorage as oo } from "./bundle.es28.js";
28
- import { createAlertAgent as eo } from "./bundle.es29.js";
29
- import { createToaster as po } from "./bundle.es30.js";
25
+ import { DateInput as Y } from "./bundle.es26.js";
26
+ import { FileOverlay as _ } from "./bundle.es27.js";
27
+ import { FormGroup as oo } from "./bundle.es28.js";
28
+ import { TimePicker as eo } from "./bundle.es29.js";
29
+ import { useLocalStorage as po } from "./bundle.es30.js";
30
+ import { createAlertAgent as xo } from "./bundle.es31.js";
31
+ import { createToaster as ao } from "./bundle.es32.js";
30
32
  export {
31
33
  R as AlertDialog,
32
34
  e as Button,
33
- B as ButtonGroup,
34
- O as Checkbox,
35
+ w as ButtonGroup,
36
+ L as Checkbox,
35
37
  J as Countdown,
38
+ Y as DateInput,
36
39
  W as DatePicker,
37
40
  y as Dialog,
38
- G as Drawer,
39
- Y as FileOverlay,
40
- _ as FormGroup,
41
+ F as Drawer,
42
+ _ as FileOverlay,
43
+ oo as FormGroup,
41
44
  a as ImitateScroll,
42
- g as Input,
45
+ T as Input,
43
46
  q as LoadButton,
44
- D as NumberInput,
45
- b as OptionItem,
47
+ b as NumberInput,
48
+ D as OptionItem,
46
49
  d as OptionsList,
47
50
  i as Popover,
48
- C as Radio,
51
+ v as Radio,
49
52
  x as Scrollable,
50
53
  S as Select,
51
54
  U as SelectTags,
52
55
  p as Spinner,
53
- k as Switch,
56
+ P as Switch,
54
57
  E as Tabs,
55
58
  M as TextArea,
59
+ eo as TimePicker,
56
60
  c as Tooltip,
57
- eo as createAlertAgent,
58
- po as createToaster,
59
- oo as useLocalStorage
61
+ xo as createAlertAgent,
62
+ ao as createToaster,
63
+ po as useLocalStorage
60
64
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
2
  import N from "classnames";
3
- import { Icon as v } from "./bundle.es35.js";
3
+ import { Icon as v } from "./bundle.es39.js";
4
4
  import { attr as t } from "@companix/utils-browser";
5
5
  import { forwardRef as k } from "react";
6
6
  import { faCheck as x } from "@fortawesome/free-solid-svg-icons";
@@ -1,6 +1,6 @@
1
1
  import { jsxs as x, jsx as o } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-checkbox";
3
- import { Icon as h } from "./bundle.es35.js";
3
+ import { Icon as h } from "./bundle.es39.js";
4
4
  import { faCheck as l } from "@fortawesome/free-solid-svg-icons";
5
5
  import { useId as n } from "react";
6
6
  import { attr as c } from "@companix/utils-browser";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import * as r from "@radix-ui/react-alert-dialog";
3
3
  import { Button as c } from "./bundle.es2.js";
4
- import { RemoveListener as N } from "./bundle.es36.js";
4
+ import { RemoveListener as N } from "./bundle.es40.js";
5
5
  import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
6
6
  const C = ({
7
7
  open: d,
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Button as m } from "./bundle.es2.js";
3
- import { useLoading as p } from "./bundle.es37.js";
3
+ import { useLoading as p } from "./bundle.es41.js";
4
4
  const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
5
5
  const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
6
6
  return /* @__PURE__ */ e(
@@ -1,5 +1,5 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { useResizeTextarea as x } from "./bundle.es38.js";
2
+ import { useResizeTextarea as x } from "./bundle.es42.js";
3
3
  import { attr as e, callMultiple as u } from "@companix/utils-browser";
4
4
  import { useEffect as z } from "react";
5
5
  import { mergeRefs as R } from "react-merge-refs";
@@ -1,10 +1,10 @@
1
1
  import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
- import { useFroozeClosing as M } from "./bundle.es31.js";
2
+ import { useFroozeClosing as M } from "./bundle.es33.js";
3
3
  import { Popover as j } from "./bundle.es6.js";
4
4
  import { OptionItem as q } from "./bundle.es10.js";
5
5
  import { OptionsList as V } from "./bundle.es12.js";
6
6
  import { useState as B, useRef as d, useMemo as h } from "react";
7
- import { Icon as g } from "./bundle.es35.js";
7
+ import { Icon as g } from "./bundle.es39.js";
8
8
  import { faClose as H, faChevronDown as Q } from "@fortawesome/free-solid-svg-icons";
9
9
  import { attr as v, getActiveElementByAnotherElement as G, contains as J } from "@companix/utils-browser";
10
10
  import { mergeRefs as K } from "react-merge-refs";
@@ -1,114 +1,122 @@
1
- import { jsx as l, jsxs as O, Fragment as R } from "react/jsx-runtime";
2
- import { Popover as z } from "./bundle.es6.js";
3
- import { Input as Y } from "./bundle.es9.js";
4
- import { faClose as E, faChevronDown as S } from "@fortawesome/free-solid-svg-icons";
5
- import { Icon as k } from "./bundle.es35.js";
6
- import { useState as _, useRef as q } from "react";
7
- import { Calendar as G } from "./bundle.es39.js";
8
- import { useDayDisableCheker as H } from "./bundle.es40.js";
9
- import { formatTime as y, getNum as d } from "@companix/utils-js";
10
- const h = (t, i = "-") => {
11
- if (t) {
12
- const n = y(t.getDate()), r = y(t.getMonth() + 1), s = t.getFullYear();
13
- return [n, r, s].join(i);
14
- }
15
- return "";
16
- }, F = (t, i = "-") => {
17
- const n = t.split(i);
18
- if (n.length === 3) {
19
- const [r, s, a] = [d(n[0]), d(n[1]), d(n[2])];
20
- if (r && s && a) {
21
- const o = new Date(a, s - 1, r);
22
- if (o.getFullYear() === a && o.getDate() === r && o.getMonth() === s - 1)
23
- return o;
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { Popover as x } from "./bundle.es6.js";
3
+ import { Input as A } from "./bundle.es9.js";
4
+ import { useState as M, useRef as j } from "react";
5
+ import { Calendar as E } from "./bundle.es43.js";
6
+ import { useDayDisableCheker as N } from "./bundle.es44.js";
7
+ import { getNum as f, formatTime as v } from "@companix/utils-js";
8
+ import { removeDigits as O } from "./bundle.es45.js";
9
+ import { SelectRightElements as Y } from "./bundle.es46.js";
10
+ const i = {
11
+ char: "-",
12
+ toString: (e) => {
13
+ if (e) {
14
+ const n = v(e.getDate()), r = v(e.getMonth() + 1), l = e.getFullYear();
15
+ return [n, r, l].join(i.char);
16
+ }
17
+ return "";
18
+ },
19
+ toValue: (e) => {
20
+ const n = e.split(i.char);
21
+ if (n.length === 3) {
22
+ const [r, l, a] = [f(n[0]), f(n[1]), f(n[2])];
23
+ if (r && l && a) {
24
+ const o = new Date(a, l - 1, r);
25
+ if (o.getFullYear() === a && o.getDate() === r && o.getMonth() === l - 1)
26
+ return o;
27
+ }
24
28
  }
29
+ return null;
25
30
  }
26
- return null;
27
- }, te = (t) => {
31
+ }, U = (e) => {
28
32
  const {
29
- minimalOptions: i,
30
33
  clearButton: n,
31
34
  clearButtonIcon: r,
32
- children: s,
35
+ children: l,
33
36
  disabled: a,
34
37
  // calendar props
35
38
  value: o,
36
- enableTime: P,
37
- disablePickers: v,
38
- showNeighboringMonth: A,
39
- onChange: u,
40
- shouldDisableDate: g,
41
- viewDate: N,
42
- disablePast: D,
43
- disableFuture: C,
44
- minDateTime: b,
45
- maxDateTime: x,
39
+ enableTime: y,
40
+ disablePickers: I,
41
+ showNeighboringMonth: P,
42
+ onChange: c,
43
+ shouldDisableDate: d,
44
+ viewDate: S,
45
+ disablePast: g,
46
+ disableFuture: D,
47
+ minDateTime: C,
48
+ maxDateTime: b,
46
49
  // input props
47
- ...T
48
- } = t, [m, c] = _(() => h(o ?? null)), p = q(null), I = H({
49
- disableFuture: C,
50
- disablePast: D,
51
- shouldDisableDate: g,
52
- minDateTime: b,
53
- maxDateTime: x
54
- }), w = (e) => {
55
- a || p.current && p.current.getAttribute("data-state") === "open" && e.preventDefault();
56
- }, B = (e) => {
57
- e.stopPropagation(), c(""), u?.(null);
58
- }, V = (e) => {
59
- c(e);
60
- const f = F(e);
61
- f && !I(f) && u?.(f);
62
- }, j = () => {
63
- const e = F(m);
64
- (!e || I(e)) && c(h(o ?? null));
65
- }, M = (e) => {
66
- u?.(e), c(h(e));
50
+ ...V
51
+ } = e, [m, s] = M(() => i.toString(o ?? null)), p = j(null), k = N({
52
+ disableFuture: D,
53
+ disablePast: g,
54
+ shouldDisableDate: d,
55
+ minDateTime: C,
56
+ maxDateTime: b
57
+ }), B = (t) => {
58
+ a || p.current && p.current.getAttribute("data-state") === "open" && t.preventDefault();
59
+ }, F = (t) => {
60
+ t.stopPropagation(), s(""), c?.(null);
61
+ }, R = (t) => {
62
+ s(t);
63
+ const h = i.toValue(t);
64
+ h && !k(h) && c?.(h);
65
+ }, T = () => {
66
+ const t = i.toValue(m);
67
+ (!t || k(t)) && s(i.toString(o ?? null));
68
+ }, w = (t) => {
69
+ c?.(t), s(i.toString(t));
67
70
  };
68
- return /* @__PURE__ */ l(
69
- z,
71
+ return /* @__PURE__ */ u(
72
+ x,
70
73
  {
71
74
  minimal: !0,
72
75
  ref: p,
73
76
  sideOffset: 0,
74
- onOpenAutoFocus: (e) => e.preventDefault(),
75
- onCloseAutoFocus: (e) => e.preventDefault(),
77
+ onOpenAutoFocus: (t) => t.preventDefault(),
78
+ onCloseAutoFocus: (t) => t.preventDefault(),
76
79
  disabled: a,
77
- content: () => /* @__PURE__ */ l(
78
- G,
80
+ content: () => /* @__PURE__ */ u(
81
+ E,
79
82
  {
80
83
  value: o,
81
- disablePast: D,
82
- disableFuture: C,
83
- enableTime: P,
84
- disablePickers: v,
85
- showNeighboringMonth: A,
86
- onChange: M,
87
- shouldDisableDate: g,
88
- viewDate: N,
89
- minDateTime: b,
90
- maxDateTime: x
84
+ disablePast: g,
85
+ disableFuture: D,
86
+ enableTime: y,
87
+ disablePickers: I,
88
+ showNeighboringMonth: P,
89
+ onChange: w,
90
+ shouldDisableDate: d,
91
+ viewDate: S,
92
+ minDateTime: C,
93
+ maxDateTime: b
91
94
  }
92
95
  ),
93
- children: /* @__PURE__ */ l(
94
- Y,
96
+ children: /* @__PURE__ */ u(
97
+ A,
95
98
  {
96
- ...T,
99
+ ...V,
97
100
  value: m,
98
101
  disabled: a,
99
- onClick: w,
100
- onValueChange: V,
101
- onBlur: j,
102
+ onClick: B,
103
+ onValueChange: R,
104
+ onBlur: T,
102
105
  mask: "99-99-9999",
103
- rightElement: /* @__PURE__ */ O(R, { children: [
104
- n && J(m) && /* @__PURE__ */ l("button", { className: "select-close-button", onClick: B, children: r ?? /* @__PURE__ */ l(k, { className: "select-close-icon", icon: E, size: "xxxs" }) }),
105
- /* @__PURE__ */ l(k, { className: "expand-icon select-expand", icon: S, size: "xxxs" })
106
- ] })
106
+ rightElement: /* @__PURE__ */ u(
107
+ Y,
108
+ {
109
+ clearButton: n,
110
+ clearButtonIcon: r,
111
+ value: !!O(m, ["-", "_"]),
112
+ onClear: F
113
+ }
114
+ )
107
115
  }
108
116
  )
109
117
  }
110
118
  );
111
- }, J = (t) => t.trim().replaceAll("-", "").replaceAll("_", "");
119
+ };
112
120
  export {
113
- te as DatePicker
121
+ U as DatePicker
114
122
  };