asma-ui-core 3.125.0 → 3.126.1

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 (25) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +6 -5
  3. package/dist/components/data-display/read-only-text/StyledReadOnlyText.js +56 -0
  4. package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +12 -12
  5. package/dist/components/inputs/field-styles.js +1 -1
  6. package/dist/components/inputs/input-field/StyledInputField.js +226 -205
  7. package/dist/components/miscellaneous/StyledFormControlLabel.js +14 -14
  8. package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +81 -73
  9. package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.js +28 -26
  10. package/dist/datetime/components/date-picker/components/DatePickerInputSingle.js +23 -21
  11. package/dist/datetime/components/time-picker/StyledTimePicker.js +25 -25
  12. package/dist/datetime/components/time-picker/TimePickerInput.js +41 -40
  13. package/dist/index.js +223 -221
  14. package/dist/src/components/data-display/read-only-text/StyledReadOnlyText.d.ts +38 -0
  15. package/dist/src/components/data-display/read-only-text/index.d.ts +1 -0
  16. package/dist/src/components/inputs/field-styles.d.ts +3 -1
  17. package/dist/src/components/inputs/input-field/StyledInputField.d.ts +14 -1
  18. package/dist/src/datetime/components/date-picker/components/BaseDatePickerInput.d.ts +2 -0
  19. package/dist/src/datetime/components/date-picker/types.d.ts +7 -0
  20. package/dist/src/datetime/components/time-picker/types.d.ts +2 -0
  21. package/dist/src/index.d.ts +1 -0
  22. package/dist/src/table/components/table-header/SortIndicator.d.ts +3 -2
  23. package/dist/table/components/StyledTable.module.js +53 -53
  24. package/dist/table/shared-components/StyledCheckbox.module.js +11 -11
  25. package/package.json +1 -1
@@ -1,34 +1,34 @@
1
- import { cn as o } from "../../helpers/cn.js";
1
+ import { cn as r } from "../../helpers/cn.js";
2
2
  import { resolveSx as g } from "../../helpers/sx.js";
3
- import { cloneElement as y, isValidElement as t, useId as w } from "react";
4
- import { jsx as C, jsxs as L } from "react/jsx-runtime";
5
- var A = {
3
+ import { cloneElement as w, isValidElement as n, useId as C } from "react";
4
+ import { jsx as L, jsxs as A } from "react/jsx-runtime";
5
+ var E = {
6
6
  end: "flex-row",
7
7
  start: "flex-row-reverse",
8
8
  top: "flex-col-reverse",
9
9
  bottom: "flex-col"
10
- }, k = ({ control: l, label: a, checked: i, disabled: m, name: d, value: c, labelPlacement: x = "end", className: f, sx: p, onChange: h }) => {
11
- const e = t(l) ? l.props : {}, s = m ?? e.disabled ?? !1, n = w(), u = e["aria-label"] != null || e["aria-labelledby"] != null, b = typeof a == "string" ? a.trim().length > 0 : a != null, r = t(l) && b && !u, v = t(l) ? y(l, {
10
+ }, O = ({ control: l, label: a, checked: i, disabled: d, name: m, value: c, labelPlacement: x = "end", className: f, sx: p, onChange: h }) => {
11
+ const e = n(l) ? l.props : {}, s = d ?? e.disabled ?? !1, u = !!e.readOnly, t = C(), b = e["aria-label"] != null || e["aria-labelledby"] != null, v = typeof a == "string" ? a.trim().length > 0 : a != null, o = n(l) && v && !b, y = n(l) ? w(l, {
12
12
  checked: e.checked ?? i,
13
13
  onChange: e.onChange ?? h,
14
14
  disabled: s,
15
- name: e.name ?? d,
15
+ name: e.name ?? m,
16
16
  value: e.value ?? c,
17
- ...r ? { "aria-labelledby": n } : {}
17
+ ...o ? { "aria-labelledby": t } : {}
18
18
  }) : l;
19
- return /* @__PURE__ */ L("label", {
20
- className: o("m-0 inline-flex items-center gap-2 align-middle text-delta-800", s ? "cursor-default" : "cursor-pointer", A[x], f),
19
+ return /* @__PURE__ */ A("label", {
20
+ className: r("m-0 inline-flex items-center gap-2 align-middle text-delta-800", s || u ? "cursor-default" : "cursor-pointer", E[x], f),
21
21
  style: {
22
22
  fontFamily: "Roboto, Helvetica, Arial, sans-serif",
23
23
  ...g(p)
24
24
  },
25
- children: [v, a != null && /* @__PURE__ */ C("span", {
26
- id: r ? n : void 0,
27
- className: o("text-sm leading-5 tracking-[0.00938em]", "max-xs:min-w-0 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", s && "text-delta-300"),
25
+ children: [y, a != null && /* @__PURE__ */ L("span", {
26
+ id: o ? t : void 0,
27
+ className: r("text-sm leading-5 tracking-[0.00938em]", "max-xs:min-w-0 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", s && "text-delta-300"),
28
28
  children: a
29
29
  })]
30
30
  });
31
31
  };
32
32
  export {
33
- k as StyledFormControlLabel
33
+ O as StyledFormControlLabel
34
34
  };
@@ -1,140 +1,148 @@
1
- import { fieldLabelAboveClass as V, fieldWidthStyle as ee } from "../../../../components/inputs/field-styles.js";
2
- import { StyledInputField as te } from "../../../../components/inputs/input-field/StyledInputField.js";
3
- import { getValue as x } from "../helpers.js";
4
- import { DatePickerButton as re } from "./DatePickerButton.js";
5
- import { getTitleLabelling as ae } from "../../../helpers/getTitleLabelling.js";
6
- import { DATE_INPUT_FONT_FAMILY as le } from "../../../../helpers/inputMask.js";
7
- import { useDatePickerMask as ie } from "../hooks/useDatePickerMask.js";
8
- import { defaultDatePickerValidationMessages as oe, useDatePickerValidation as de } from "../hooks/useDatePickerValidation.js";
9
- import { useEffect as A, useId as E, useRef as se, useState as H } from "react";
10
- import { jsx as r, jsxs as b } from "react/jsx-runtime";
11
- import { isValid as ne, parse as ce } from "date-fns";
12
- var Te = (R) => {
13
- const { onClick: Y, inputClassName: B, dateFormat: a, selected: e, error: L, helperText: O, errorText: S, onInputChange: y, hideCalendar: _, locale: l, disabledDays: s, label: h, title: v, inputAriaProps: j, readOnly: i, disallowPast: n, disallowFuture: c, validateOnCalendarClose: T, onValidatedOnce: C, hideDefaultHelperText: q, reserveHelperText: W, required: o, minDate: m, width: N = "s", ...p } = R, { validationError: z, handleValidation: u, errHelperText: U, clearValidation: P } = de(oe), { maskRef: G } = ie(), M = E(), k = E(), [t, w] = H(e ? x(e, a) : ""), g = se(!1), [I, J] = H({
1
+ import { fieldLabelAboveClass as R, fieldWidthStyle as le } from "../../../../components/inputs/field-styles.js";
2
+ import { StyledInputField as oe } from "../../../../components/inputs/input-field/StyledInputField.js";
3
+ import { getValue as b } from "../helpers.js";
4
+ import { DatePickerButton as ie } from "./DatePickerButton.js";
5
+ import { getTitleLabelling as de } from "../../../helpers/getTitleLabelling.js";
6
+ import { DATE_INPUT_FONT_FAMILY as se } from "../../../../helpers/inputMask.js";
7
+ import { useDatePickerMask as ne } from "../hooks/useDatePickerMask.js";
8
+ import { defaultDatePickerValidationMessages as ce, useDatePickerValidation as ue } from "../hooks/useDatePickerValidation.js";
9
+ import { useEffect as A, useId as E, useRef as pe, useState as H } from "react";
10
+ import { jsx as a, jsxs as T } from "react/jsx-runtime";
11
+ import { isValid as me, parse as fe } from "date-fns";
12
+ var ke = (Y) => {
13
+ const { onClick: L, inputClassName: S, dateFormat: r, selected: e, error: _, helperText: j, errorText: q, onInputChange: C, hideCalendar: W, locale: l, disabledDays: s, label: h, title: v, inputAriaProps: z, readOnly: U, lockedReason: y, readOnlyReason: g, disallowPast: n, disallowFuture: c, validateOnCalendarClose: N, onValidatedOnce: P, hideDefaultHelperText: G, reserveHelperText: J, required: o, minDate: u, width: k = "s", ...p } = Y, i = !!U || !!y || !!g, M = !y && !!g, { validationError: K, handleValidation: m, errHelperText: Q, clearValidation: w } = ue(ce), { maskRef: X } = ne(), I = E(), V = E(), [t, B] = H(e ? b(e, r) : ""), D = pe(!1), [F, Z] = H({
14
14
  selected: e,
15
- dateFormat: a
15
+ dateFormat: r
16
16
  });
17
- (e !== I.selected || a !== I.dateFormat) && (J({
17
+ (e !== F.selected || r !== F.dateFormat) && (Z({
18
18
  selected: e,
19
- dateFormat: a
20
- }), w(e ? x(e, a) : ""));
21
- const K = l?.code?.startsWith("nb") ? "DD/MM/ÅÅÅÅ" : "DD/MM/YYYY", Q = q ? void 0 : K, F = !!(z || L), d = F ? S ?? U : O ?? Q;
19
+ dateFormat: r
20
+ }), B(e ? b(e, r) : ""));
21
+ const $ = l?.code?.startsWith("nb") ? "DD/MM/ÅÅÅÅ" : "DD/MM/YYYY", ee = G ? void 0 : $, O = !!(K || _), d = O ? q ?? Q : j ?? ee;
22
22
  A(() => {
23
23
  if (!e) {
24
- g.current || P(), g.current = !1;
24
+ D.current || w(), D.current = !1;
25
25
  return;
26
26
  }
27
- u({
28
- value: x(e, a),
27
+ m({
28
+ value: b(e, r),
29
29
  disabledDays: s,
30
30
  localeCode: l?.code,
31
31
  disallowPast: n,
32
32
  disallowFuture: c,
33
33
  required: o,
34
- minDate: m
34
+ minDate: u
35
35
  });
36
36
  }, [
37
37
  e,
38
- a,
38
+ r,
39
39
  s,
40
40
  l?.code,
41
41
  n,
42
42
  c,
43
43
  o,
44
- m,
45
44
  u,
46
- P
45
+ m,
46
+ w
47
47
  ]);
48
- const X = /\d/.test(t), Z = (D) => {
49
- const f = D.target.value;
50
- w(f.replace(/\D/g, "").length ? f : "");
48
+ const te = /\d/.test(t), ae = (x) => {
49
+ const f = x.target.value;
50
+ B(f.replace(/\D/g, "").length ? f : "");
51
51
  };
52
52
  A(() => {
53
- T && (u({
53
+ N && (m({
54
54
  value: t,
55
55
  disabledDays: s,
56
56
  localeCode: l?.code,
57
57
  disallowPast: n,
58
58
  disallowFuture: c,
59
59
  required: o,
60
- minDate: m
61
- }), C?.());
60
+ minDate: u
61
+ }), P?.());
62
62
  }, [
63
- T,
63
+ N,
64
64
  t,
65
65
  s,
66
66
  l?.code,
67
67
  n,
68
68
  c,
69
69
  o,
70
- m,
71
- C,
72
- u
70
+ u,
71
+ P,
72
+ m
73
73
  ]);
74
- const $ = () => {
75
- const D = u({
74
+ const re = () => {
75
+ const x = m({
76
76
  value: t,
77
77
  disabledDays: s,
78
78
  localeCode: l?.code,
79
79
  disallowPast: n,
80
80
  disallowFuture: c,
81
81
  required: o,
82
- minDate: m
82
+ minDate: u
83
83
  });
84
84
  if (!t.replace(/\D/g, "").length) {
85
- g.current = !!e, y?.(void 0);
85
+ D.current = !!e, C?.(void 0);
86
86
  return;
87
87
  }
88
- if (D) return;
89
- const f = ce(t, "dd/MM/yyyy", /* @__PURE__ */ new Date());
90
- y?.(ne(f) ? f : void 0);
88
+ if (x) return;
89
+ const f = fe(t, "dd/MM/yyyy", /* @__PURE__ */ new Date());
90
+ C?.(me(f) ? f : void 0);
91
91
  };
92
- return /* @__PURE__ */ b("div", {
92
+ return /* @__PURE__ */ T("div", {
93
93
  className: "cursor-default",
94
- "data-field-width": N,
95
- style: ee(N),
94
+ "data-field-width": k,
95
+ style: le(k),
96
96
  "data-helper-room-box": "",
97
97
  children: [
98
- v && /* @__PURE__ */ r("div", {
99
- id: M,
100
- className: V({ disabled: p.disabled }),
98
+ v && /* @__PURE__ */ a("div", {
99
+ id: I,
100
+ className: R({
101
+ disabled: p.disabled,
102
+ flush: M
103
+ }),
101
104
  children: v
102
105
  }),
103
- h && /* @__PURE__ */ r("div", {
104
- className: V({ disabled: p.disabled }),
105
- children: /* @__PURE__ */ b("label", {
106
- htmlFor: k,
107
- children: [h, o && /* @__PURE__ */ r("span", {
106
+ h && /* @__PURE__ */ a("div", {
107
+ className: R({
108
+ disabled: p.disabled,
109
+ flush: M
110
+ }),
111
+ children: /* @__PURE__ */ T("label", {
112
+ htmlFor: V,
113
+ children: [h, o && /* @__PURE__ */ a("span", {
108
114
  "aria-hidden": "true",
109
115
  children: " *"
110
116
  })]
111
117
  })
112
118
  }),
113
- /* @__PURE__ */ b("div", {
119
+ /* @__PURE__ */ T("div", {
114
120
  className: "flex items-start gap-1",
115
- children: [/* @__PURE__ */ r("div", {
121
+ children: [/* @__PURE__ */ a("div", {
116
122
  className: "min-w-0 flex-1",
117
- children: /* @__PURE__ */ r("div", {
123
+ children: /* @__PURE__ */ a("div", {
118
124
  className: "relative",
119
- children: /* @__PURE__ */ r(te, {
125
+ children: /* @__PURE__ */ a(oe, {
120
126
  ...p,
121
- id: k,
127
+ id: V,
122
128
  readOnly: i,
129
+ lockedReason: y,
130
+ readOnlyReason: g,
123
131
  "data-testid": p.dataTest,
124
132
  autoComplete: "off",
125
- inputRef: i ? void 0 : G,
126
- placeholder: !i && !X ? " / / " : void 0,
133
+ inputRef: i ? void 0 : X,
134
+ placeholder: !i && !te ? " / / " : void 0,
127
135
  size: "small",
128
136
  value: i ? t.replaceAll("/", ".") : t,
129
- className: B,
130
- error: F,
131
- onBlur: i ? void 0 : $,
132
- helperText: d == null || d === "" ? d : /* @__PURE__ */ r("span", {
137
+ className: S,
138
+ error: O,
139
+ onBlur: i ? void 0 : re,
140
+ helperText: d == null || d === "" ? d : /* @__PURE__ */ a("span", {
133
141
  className: "block truncate",
134
142
  title: typeof d == "string" ? d : void 0,
135
143
  children: d
136
144
  }),
137
- reserveHelperText: W,
145
+ reserveHelperText: J,
138
146
  slotProps: {
139
147
  formHelperText: { sx: {
140
148
  marginTop: "4px",
@@ -143,23 +151,23 @@ var Te = (R) => {
143
151
  } },
144
152
  htmlInput: {
145
153
  "aria-required": o ? !0 : void 0,
146
- ...ae({
154
+ ...de({
147
155
  title: v,
148
- titleId: M,
156
+ titleId: I,
149
157
  label: h,
150
- inputAriaProps: j
158
+ inputAriaProps: z
151
159
  }),
152
160
  ...i ? {} : {
153
161
  inputMode: "numeric",
154
- style: { fontFamily: le }
162
+ style: { fontFamily: se }
155
163
  }
156
164
  }
157
165
  },
158
- onChange: Z
166
+ onChange: ae
159
167
  })
160
168
  })
161
- }), !_ && !i && /* @__PURE__ */ r(re, {
162
- onClick: Y,
169
+ }), !W && !i && /* @__PURE__ */ a(ie, {
170
+ onClick: L,
163
171
  disabled: !!p.disabled,
164
172
  localeCode: l?.code
165
173
  })]
@@ -168,5 +176,5 @@ var Te = (R) => {
168
176
  });
169
177
  };
170
178
  export {
171
- Te as BaseDatePickerInput
179
+ ke as BaseDatePickerInput
172
180
  };
@@ -1,65 +1,67 @@
1
- import u from "./DatePickerInputRangeCompact.module.js";
2
- import { BaseDatePickerInput as x } from "./BaseDatePickerInput.js";
3
- import F from "clsx";
4
- import { jsx as g, jsxs as y } from "react/jsx-runtime";
5
- import { addDays as h } from "date-fns";
6
- var N = ({ datePickerProps: b, onClick: l }) => {
7
- const { dataTest: D, className: C, inputClassName: i, disabled: a, readOnly: m, dateFormat: d, onInputChange: o, hideCalendar: s, locale: p, selected: t, disabledDays: n, validateOnCalendarClose: T, onValidatedOnce: c, width: f, ...e } = b;
1
+ import x from "./DatePickerInputRangeCompact.module.js";
2
+ import { BaseDatePickerInput as g } from "./BaseDatePickerInput.js";
3
+ import k from "clsx";
4
+ import { jsx as h, jsxs as y } from "react/jsx-runtime";
5
+ import { addDays as b } from "date-fns";
6
+ var O = ({ datePickerProps: D, onClick: l }) => {
7
+ const { dataTest: C, className: F, inputClassName: i, disabled: a, readOnly: m, lockedReason: d, dateFormat: s, onInputChange: o, hideCalendar: n, locale: p, selected: t, disabledDays: T, validateOnCalendarClose: c, onValidatedOnce: f, width: u, ...e } = D;
8
8
  return /* @__PURE__ */ y("div", {
9
- "data-testid": D,
10
- className: F(C, u["styled-date-picker-input-range-compact"], a && u["range-compact-disabled"]),
11
- children: [/* @__PURE__ */ g(x, {
9
+ "data-testid": C,
10
+ className: k(F, x["styled-date-picker-input-range-compact"], a && x["range-compact-disabled"]),
11
+ children: [/* @__PURE__ */ h(g, {
12
12
  dataTest: "styled-date-picker-input-range-from",
13
- dateFormat: d,
13
+ dateFormat: s,
14
14
  selected: t?.from,
15
15
  inputClassName: i,
16
16
  readOnly: m,
17
+ lockedReason: d,
17
18
  disabled: !!a,
18
19
  onClick: l,
19
20
  onInputChange: (r) => {
20
21
  r && t?.to && r.getTime() > t?.to.getTime() ? o?.({
21
22
  from: r,
22
- to: h(r, 1)
23
+ to: b(r, 1)
23
24
  }) : o?.({
24
25
  from: r,
25
26
  to: t?.to
26
27
  });
27
28
  },
28
- hideCalendar: s,
29
+ hideCalendar: n,
29
30
  locale: p,
30
- disabledDays: n,
31
- validateOnCalendarClose: T,
32
- onValidatedOnce: c,
33
- width: f,
31
+ disabledDays: T,
32
+ validateOnCalendarClose: c,
33
+ onValidatedOnce: f,
34
+ width: u,
34
35
  label: e.labelFrom,
35
36
  error: e.errorFrom,
36
37
  helperText: e.helperTextFrom,
37
38
  errorText: e.errorTextFrom,
38
39
  title: e.titleFrom,
39
40
  hideDefaultHelperText: e.hideDefaultHelperTextFrom
40
- }), /* @__PURE__ */ g(x, {
41
+ }), /* @__PURE__ */ h(g, {
41
42
  dataTest: "styled-date-picker-input-range-to",
42
- dateFormat: d,
43
+ dateFormat: s,
43
44
  selected: t?.to,
44
45
  inputClassName: i,
45
46
  readOnly: m,
47
+ lockedReason: d,
46
48
  disabled: !!a,
47
49
  onClick: l,
48
50
  onInputChange: (r) => {
49
51
  r && t?.from && r.getTime() < t?.from.getTime() ? o?.({
50
- from: h(r, -1),
52
+ from: b(r, -1),
51
53
  to: r
52
54
  }) : o?.({
53
55
  from: t?.from,
54
56
  to: r
55
57
  });
56
58
  },
57
- hideCalendar: s,
59
+ hideCalendar: n,
58
60
  locale: p,
59
- disabledDays: n,
60
- validateOnCalendarClose: T,
61
- onValidatedOnce: c,
62
- width: f,
61
+ disabledDays: T,
62
+ validateOnCalendarClose: c,
63
+ onValidatedOnce: f,
64
+ width: u,
63
65
  label: e.labelTo,
64
66
  error: e.errorTo,
65
67
  helperText: e.helperTextTo,
@@ -70,5 +72,5 @@ var N = ({ datePickerProps: b, onClick: l }) => {
70
72
  });
71
73
  };
72
74
  export {
73
- N as DatePickerInputRangeCompact
75
+ O as DatePickerInputRangeCompact
74
76
  };
@@ -1,36 +1,38 @@
1
- import { BaseDatePickerInput as y } from "./BaseDatePickerInput.js";
2
- import { jsx as F } from "react/jsx-runtime";
3
- var q = ({ datePickerProps: e, onClick: a }) => {
4
- const { inputClassName: r, disabled: t, helperText: l, label: d, error: i, locale: n, hideCalendar: o, dateFormat: s, disabledDays: p, dataTest: u, readOnly: m, errorText: c, disallowFuture: h, disallowPast: x, required: C, minDate: D, validateOnCalendarClose: T, onValidatedOnce: b, onInputChange: I, selected: P, title: f, hideDefaultHelperText: g, reserveHelperText: v, inputAriaProps: w, width: O } = e;
5
- return /* @__PURE__ */ F(y, {
1
+ import { BaseDatePickerInput as H } from "./BaseDatePickerInput.js";
2
+ import { jsx as R } from "react/jsx-runtime";
3
+ var A = ({ datePickerProps: e, onClick: a }) => {
4
+ const { inputClassName: r, disabled: t, helperText: l, label: d, error: n, locale: i, hideCalendar: o, dateFormat: s, disabledDays: p, dataTest: u, readOnly: c, lockedReason: m, readOnlyReason: h, errorText: x, disallowFuture: C, disallowPast: D, required: T, minDate: b, validateOnCalendarClose: I, onValidatedOnce: O, onInputChange: P, selected: f, title: g, hideDefaultHelperText: k, reserveHelperText: v, inputAriaProps: w, width: y } = e;
5
+ return /* @__PURE__ */ R(H, {
6
6
  dataTest: u,
7
7
  inputClassName: r,
8
- readOnly: m,
8
+ readOnly: c,
9
+ lockedReason: m,
10
+ readOnlyReason: h,
9
11
  disabled: !!t,
10
12
  helperText: l,
11
13
  onClick: a,
12
- onInputChange: (k) => I?.(k),
13
- selected: P,
14
- error: !!i,
15
- locale: n,
14
+ onInputChange: (F) => P?.(F),
15
+ selected: f,
16
+ error: !!n,
17
+ locale: i,
16
18
  hideCalendar: o,
17
19
  dateFormat: s,
18
20
  disabledDays: p,
19
21
  label: d,
20
- errorText: c,
21
- disallowFuture: h,
22
- disallowPast: x,
23
- required: C,
24
- minDate: D,
25
- validateOnCalendarClose: T,
26
- onValidatedOnce: b,
27
- title: f,
28
- hideDefaultHelperText: g,
22
+ errorText: x,
23
+ disallowFuture: C,
24
+ disallowPast: D,
25
+ required: T,
26
+ minDate: b,
27
+ validateOnCalendarClose: I,
28
+ onValidatedOnce: O,
29
+ title: g,
30
+ hideDefaultHelperText: k,
29
31
  reserveHelperText: v,
30
32
  inputAriaProps: w,
31
- width: O
33
+ width: y
32
34
  });
33
35
  };
34
36
  export {
35
- q as DatePickerInputSingle
37
+ A as DatePickerInputSingle
36
38
  };
@@ -1,10 +1,10 @@
1
1
  import { cn as L } from "../../../helpers/cn.js";
2
- import { isOverlayBackEnabled as K, useBackCloses as W } from "../../../hooks/useBackCloses.hook.js";
3
- import { useIsMobileView as z } from "../../hooks/useWindowWidthSize.hook.js";
4
- import { StyledDrawer as G } from "../../../components/navigation/drawer/StyledDrawer.js";
5
- import { useBackNavigationClose as J } from "../../hooks/useBackNavigationClose.hook.js";
6
- import { usePopupState as Q } from "../../../hooks/usePopupState.js";
7
- import { ClickAwayListener as R } from "../../../components/mui-compat/ClickAwayListener.js";
2
+ import { isOverlayBackEnabled as K, useBackCloses as R } from "../../../hooks/useBackCloses.hook.js";
3
+ import { useIsMobileView as W } from "../../hooks/useWindowWidthSize.hook.js";
4
+ import { StyledDrawer as z } from "../../../components/navigation/drawer/StyledDrawer.js";
5
+ import { useBackNavigationClose as G } from "../../hooks/useBackNavigationClose.hook.js";
6
+ import { usePopupState as J } from "../../../hooks/usePopupState.js";
7
+ import { ClickAwayListener as Q } from "../../../components/mui-compat/ClickAwayListener.js";
8
8
  import { isBeforeMinTime as T } from "./helpers/minTime.js";
9
9
  import { TimePickerPanel as U } from "./components/TimePickerPanel.js";
10
10
  import { TimePickerPopper as X } from "./TimePickerPopper.js";
@@ -15,59 +15,59 @@ import { useEffect as Z, useState as b } from "react";
15
15
  import { jsx as n, jsxs as j } from "react/jsx-runtime";
16
16
  import { format as S, isBefore as _, isValid as $ } from "date-fns";
17
17
  var ve = (i) => {
18
- const { value: s, onSelect: r, notBeforeTime: v, minTime: u, required: w } = i, o = Q({
18
+ const { value: s, onSelect: r, notBeforeTime: v, minTime: u, required: k } = i, o = J({
19
19
  variant: "popper",
20
20
  popupId: "time-picker-popper"
21
- }), f = z();
22
- W({
21
+ }), f = W();
22
+ R({
23
23
  active: o.isOpen,
24
24
  requestClose: o.close
25
- }), J({
25
+ }), G({
26
26
  open: f && o.isOpen && !K(),
27
27
  onClose: o.close
28
28
  });
29
- const { isOpen: x, anchorEl: g, close: k } = o;
29
+ const { isOpen: x, anchorEl: g, close: w } = o;
30
30
  Z(() => {
31
31
  if (!x || f) return;
32
32
  const e = (t) => {
33
- g?.contains(document.activeElement) && (t.key === "Escape" ? (t.preventDefault(), t.stopPropagation(), k()) : t.key === "Tab" && k());
33
+ g?.contains(document.activeElement) && (t.key === "Escape" ? (t.preventDefault(), t.stopPropagation(), w()) : t.key === "Tab" && w());
34
34
  };
35
35
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
36
36
  }, [
37
37
  x,
38
38
  g,
39
- k,
39
+ w,
40
40
  f
41
41
  ]);
42
- const B = s ? S(s, "HH:mm") : "", [y, p] = b(B), [E, a] = b(!1), [C, c] = b(!1), l = E ? y : B, d = (e) => !e || !v || !$(v) || !_(e, v), m = l.length === 5 ? V(l, s) : null, I = !C || l === "" || m !== null, A = !C || !m || d(m), O = !!w && C && l === "", N = (e) => {
42
+ const B = s ? S(s, "HH:mm") : "", [y, d] = b(B), [E, a] = b(!1), [C, c] = b(!1), l = E ? y : B, p = (e) => !e || !v || !$(v) || !_(e, v), m = l.length === 5 ? V(l, s) : null, I = !C || l === "" || m !== null, A = !C || !m || p(m), O = !!k && C && l === "", N = (e) => {
43
43
  if (e === "") return !0;
44
44
  const t = V(e, s);
45
- return t !== null && d(t);
45
+ return t !== null && p(t);
46
46
  }, q = (e) => {
47
47
  const t = e.target.value;
48
- if (a(!0), p(t), (O || N(t)) && c(!1), t.length !== 5) return;
48
+ if (a(!0), d(t), (O || N(t)) && c(!1), t.length !== 5) return;
49
49
  const h = V(t, s);
50
50
  if (!h) {
51
51
  r(void 0);
52
52
  return;
53
53
  }
54
- T(h, u) || (d(h) ? (r(h), a(!1), o.close()) : r(void 0));
54
+ T(h, u) || (p(h) ? (r(h), a(!1), o.close()) : r(void 0));
55
55
  }, D = (e) => {
56
56
  if (e && T(e, u)) return;
57
- const t = d(e);
57
+ const t = p(e);
58
58
  if (c(!t), t) {
59
- r(e), p(e ? S(e, "HH:mm") : ""), a(!1);
59
+ r(e), d(e ? S(e, "HH:mm") : ""), a(!1);
60
60
  return;
61
61
  }
62
- r(void 0), p(e ? S(e, "HH:mm") : ""), a(!0);
62
+ r(void 0), d(e ? S(e, "HH:mm") : ""), a(!0);
63
63
  }, F = () => {
64
- if (w && l === "" && !o.isOpen) {
64
+ if (k && l === "" && !o.isOpen) {
65
65
  E && r(void 0), c(!0);
66
66
  return;
67
67
  }
68
68
  E && (m && T(m, u) ? a(!1) : y === "" ? r(void 0) : N(y) || c(!0));
69
69
  }, H = () => {
70
- r(void 0), p(""), a(!1), c(!!w);
70
+ r(void 0), d(""), a(!1), c(!!k);
71
71
  }, P = /* @__PURE__ */ n(Y, {
72
72
  ...i,
73
73
  popupState: o,
@@ -78,13 +78,13 @@ var ve = (i) => {
78
78
  handleChange: q,
79
79
  handleBlur: F
80
80
  });
81
- return i.disabled || i.readOnly ? P : f ? /* @__PURE__ */ j("div", {
81
+ return i.disabled || i.readOnly || i.lockedReason ? P : f ? /* @__PURE__ */ j("div", {
82
82
  className: L("relative h-auto", typeof i.width == "number" && "w-auto"),
83
83
  ...M(i.width),
84
84
  children: [/* @__PURE__ */ n("div", {
85
85
  className: "m-0 flex h-fit items-center justify-center p-0",
86
86
  children: P
87
- }), /* @__PURE__ */ n(G, {
87
+ }), /* @__PURE__ */ n(z, {
88
88
  anchor: "bottom",
89
89
  open: o.isOpen,
90
90
  onClose: o.close,
@@ -102,7 +102,7 @@ var ve = (i) => {
102
102
  })
103
103
  })
104
104
  })]
105
- }) : /* @__PURE__ */ n(R, {
105
+ }) : /* @__PURE__ */ n(Q, {
106
106
  mouseEvent: "onMouseDown",
107
107
  onClickAway: o.close,
108
108
  children: /* @__PURE__ */ j("div", {