@owp/core 2.5.25 → 2.5.26

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 (47) hide show
  1. package/dist/_virtual/index16.js +4 -4
  2. package/dist/_virtual/index17.js +4 -4
  3. package/dist/_virtual/index18.js +4 -4
  4. package/dist/_virtual/index19.js +4 -4
  5. package/dist/components/OwpPicker/OwpDatePicker.js +297 -280
  6. package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
  7. package/dist/components/OwpPicker/OwpDateRangePicker.js +175 -85
  8. package/dist/components/OwpPicker/OwpDateRangePicker.js.map +1 -1
  9. package/dist/components/OwpPicker/OwpTimePicker.js +305 -305
  10. package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
  11. package/dist/components/OwpPicker/internal/AnimatedCalendarContainer.js +21 -31
  12. package/dist/components/OwpPicker/internal/AnimatedCalendarContainer.js.map +1 -1
  13. package/dist/components/OwpPicker/internal/OwpDatePickerCalendarHeader.js +182 -0
  14. package/dist/components/OwpPicker/internal/OwpDatePickerCalendarHeader.js.map +1 -0
  15. package/dist/components/OwpPicker/internal/pickerEditorStyles.js +68 -0
  16. package/dist/components/OwpPicker/internal/pickerEditorStyles.js.map +1 -0
  17. package/dist/components/OwpPicker/internal/useOwpDatePickerCalendarHeaderState.js +50 -0
  18. package/dist/components/OwpPicker/internal/useOwpDatePickerCalendarHeaderState.js.map +1 -0
  19. package/dist/components/OwpPicker/internal/useOwpPickerPopperTransition.js +35 -0
  20. package/dist/components/OwpPicker/internal/useOwpPickerPopperTransition.js.map +1 -0
  21. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +125 -117
  22. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
  23. package/dist/components/OwpSelectorBase/OwpSelectorSelect.js +84 -77
  24. package/dist/components/OwpSelectorBase/OwpSelectorSelect.js.map +1 -1
  25. package/dist/components/OwpSelectorBase/selectorBaseStyles.js +10 -0
  26. package/dist/components/OwpSelectorBase/selectorBaseStyles.js.map +1 -0
  27. package/dist/components/OwpStyleProvider/OwpStyleProvider.js +76 -72
  28. package/dist/components/OwpStyleProvider/OwpStyleProvider.js.map +1 -1
  29. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js +415 -401
  30. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js.map +1 -1
  31. package/dist/layout/components/navbar/style/NavbarStyle.js +33 -16
  32. package/dist/layout/components/navbar/style/NavbarStyle.js.map +1 -1
  33. package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
  34. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ArrowDropUp.js +9 -0
  35. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ArrowDropUp.js.map +1 -0
  36. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  37. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  38. package/dist/node_modules/.pnpm/react-overlays@5.2.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-overlays/esm/Portal.js +1 -1
  39. package/dist/owp-app.css +1 -1
  40. package/dist/types/components/OwpPicker/OwpDatePicker.d.ts +1 -1
  41. package/dist/types/components/OwpPicker/OwpDateRangePicker.d.ts +2 -2
  42. package/dist/types/components/OwpPicker/internal/OwpDatePickerCalendarHeader.d.ts +28 -0
  43. package/dist/types/components/OwpPicker/internal/pickerEditorStyles.d.ts +9 -0
  44. package/dist/types/components/OwpPicker/internal/useOwpDatePickerCalendarHeaderState.d.ts +25 -0
  45. package/dist/types/components/OwpPicker/internal/useOwpPickerPopperTransition.d.ts +9 -0
  46. package/dist/types/components/OwpSelectorBase/selectorBaseStyles.d.ts +8 -0
  47. package/package.json +1 -1
@@ -1,18 +1,20 @@
1
- var Jn = Object.defineProperty;
2
- var c = (r, I) => Jn(r, "name", { value: I, configurable: !0 });
3
- import { jsx as E, jsxs as F } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
- import { useOwpTranslation as Qn } from "../../hooks/useOwpTranslation.js";
5
- import bn from "../../node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/Clear.js";
6
- import { Popper as Zn, Paper as xn, InputAdornment as pn, IconButton as Mn } from "@mui/material";
7
- import { TimePicker as Fn, MultiSectionDigitalClock as Pn, LocalizationProvider as ne } from "@mui/x-date-pickers";
8
- import { AdapterDayjs as ee } from "@mui/x-date-pickers/AdapterDayjs";
9
- import { clsx as te } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
10
- import { owpDayjs as g } from "../../dayjs.js";
11
- import { useMemo as P, useState as q, useRef as k, useCallback as o, useEffect as nn } from "react";
12
- import { TIME_PICKER_EDITOR_SECTION_WIDTH as en, VALUE_TIME_SECOND_FORMATTER as X, VALUE_TIME_FORMATTER as $, PICKER_INVALID_INPUT_MESSAGE_KEY as re, TIME_PICKER_EDITOR_SECTION_ITEM_WIDTH as gn, TIME_PICKER_SELECTED_ITEM_SX as ie } from "./constants/index.js";
13
- import { getAdjacentFocusableElement as ae, getPickerInputMask as ce } from "./utils/index.js";
14
- import { OwpTextMaskField as ue } from "../OwpTextField/OwpTextMaskField.js";
15
- const tn = "––", oe = {
1
+ var xn = Object.defineProperty;
2
+ var u = (r, I) => xn(r, "name", { value: I, configurable: !0 });
3
+ import { jsx as w, jsxs as en } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
+ import { useOwpTranslation as Fn } from "../../hooks/useOwpTranslation.js";
5
+ import An from "../../node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/Clear.js";
6
+ import { Popper as Pn, Paper as ne, InputAdornment as bn, IconButton as Rn } from "@mui/material";
7
+ import { TimePicker as ee, MultiSectionDigitalClock as te, LocalizationProvider as re } from "@mui/x-date-pickers";
8
+ import { AdapterDayjs as ae } from "@mui/x-date-pickers/AdapterDayjs";
9
+ import { clsx as ie } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
10
+ import { owpDayjs as O } from "../../dayjs.js";
11
+ import { useMemo as tn, useState as Y, useRef as D, useCallback as o, useEffect as rn } from "react";
12
+ import { TIME_PICKER_EDITOR_SECTION_WIDTH as ce, VALUE_TIME_SECOND_FORMATTER as G, VALUE_TIME_FORMATTER as J, PICKER_INVALID_INPUT_MESSAGE_KEY as ue, TIME_PICKER_SELECTED_ITEM_SX as oe } from "./constants/index.js";
13
+ import { getOwpPickerEditorPaperSx as se, getOwpPickerEditorInputSx as le, getOwpTimePickerClockSx as fe } from "./internal/pickerEditorStyles.js";
14
+ import { useOwpPickerPopperTransition as de, PICKER_TRANSITION_DURATION as Mn, PICKER_EXIT_TRANSFORM_DELAY as me, PICKER_TRANSFORM_TRANSITION_DURATION as Ie } from "./internal/useOwpPickerPopperTransition.js";
15
+ import { getAdjacentFocusableElement as Te, getPickerInputMask as we } from "./utils/index.js";
16
+ import { OwpTextMaskField as ye } from "../OwpTextField/OwpTextMaskField.js";
17
+ const an = "––", ke = {
16
18
  "& .MuiInputBase-root": {
17
19
  alignItems: "center"
18
20
  },
@@ -38,19 +40,19 @@ const tn = "––", oe = {
38
40
  visibility: "visible"
39
41
  }
40
42
  }
41
- }, le = /* @__PURE__ */ c((r) => r.ctrlKey || r.altKey || r.metaKey ? !1 : r.key.length === 1 || r.key === "Backspace" || r.key === "Delete", "isValueEditingKey"), fe = /* @__PURE__ */ c((r) => r.ctrlKey || r.altKey || r.metaKey || r.key === "Escape" || r.key === "Enter" || r.key === "Tab" ? !1 : r.key.length === 1 || r.key.startsWith("Arrow"), "isTimePickerOpenKey"), rn = /* @__PURE__ */ c((r, I) => {
42
- const Y = r.trim(), d = I ? "(\\d{2}):(\\d{2}):(\\d{2})" : "(\\d{2}):(\\d{2})", w = Y.match(new RegExp(`^${d}$`));
43
- if (!w)
43
+ }, pe = /* @__PURE__ */ u((r) => r.ctrlKey || r.altKey || r.metaKey ? !1 : r.key.length === 1 || r.key === "Backspace" || r.key === "Delete", "isValueEditingKey"), Ee = /* @__PURE__ */ u((r) => r.ctrlKey || r.altKey || r.metaKey || r.key === "Escape" || r.key === "Enter" || r.key === "Tab" ? !1 : r.key.length === 1 || r.key.startsWith("Arrow"), "isTimePickerOpenKey"), cn = /* @__PURE__ */ u((r, I) => {
44
+ const Q = r.trim(), d = I ? "(\\d{2}):(\\d{2}):(\\d{2})" : "(\\d{2}):(\\d{2})", A = Q.match(new RegExp(`^${d}$`));
45
+ if (!A)
44
46
  return null;
45
- const S = Number(w[1]), B = Number(w[2]), h = I ? Number(w[3]) : 0;
46
- if (B > 59 || h > 59 || S > 24 || S === 24 && (B > 0 || h > 0))
47
+ const S = Number(A[1]), L = Number(A[2]), _ = I ? Number(A[3]) : 0;
48
+ if (L > 59 || _ > 59 || S > 24 || S === 24 && (L > 0 || _ > 0))
47
49
  return null;
48
- const L = [S, B, ...I ? [h] : []].map((a) => String(a).padStart(2, "0")).join(":");
50
+ const V = [S, L, ...I ? [_] : []].map((i) => String(i).padStart(2, "0")).join(":");
49
51
  return {
50
- dateValue: S === 24 ? g("00:00:00", X, !0).add(1, "day") : g(L, I ? X : $, !0),
51
- valueText: L
52
+ dateValue: S === 24 ? O("00:00:00", G, !0).add(1, "day") : O(V, I ? G : J, !0),
53
+ valueText: V
52
54
  };
53
- }, "parseTimePickerInput"), an = /* @__PURE__ */ c((r, I) => r.format(I ? X : $), "formatTimePickerDisplayInput"), de = /* @__PURE__ */ c((r, I) => {
55
+ }, "parseTimePickerInput"), un = /* @__PURE__ */ u((r, I) => r.format(I ? G : J), "formatTimePickerDisplayInput"), De = /* @__PURE__ */ u((r, I) => {
54
56
  if (r) {
55
57
  if (typeof r == "function") {
56
58
  r(I);
@@ -58,296 +60,320 @@ const tn = "––", oe = {
58
60
  }
59
61
  r.current = I;
60
62
  }
61
- }, "assignInputRef"), Ae = /* @__PURE__ */ c(({
63
+ }, "assignInputRef"), qe = /* @__PURE__ */ u(({
62
64
  label: r,
63
65
  variant: I = "standard",
64
- sx: Y,
66
+ sx: Q,
65
67
  value: d,
66
- format: w = $,
68
+ format: A = J,
67
69
  useAmPm: S,
68
- placeholder: B,
69
- disabledClearButton: h,
70
- fullWidth: L,
71
- onChange: a,
70
+ placeholder: L,
71
+ disabledClearButton: _,
72
+ fullWidth: V,
73
+ onChange: i,
72
74
  textFieldProps: t,
73
- localeText: Sn,
74
- open: cn,
75
- onOpen: v,
76
- onClose: W,
77
- slots: hn,
78
- slotProps: i,
75
+ localeText: On,
76
+ open: on,
77
+ onOpen: q,
78
+ onClose: $,
79
+ slots: Sn,
80
+ slotProps: a,
79
81
  ...l
80
82
  }) => {
81
- var kn;
82
- const m = /s/i.test(w), y = m ? X : $, A = S ?? /a/i.test(w), An = A ? m ? "A hh:mm:ss" : "A hh:mm" : y, Rn = l.closeOnSelect ?? !1, un = {
83
+ var En;
84
+ const m = /s/i.test(A), T = m ? G : J, K = S ?? /a/i.test(A), _n = K ? m ? "A hh:mm:ss" : "A hh:mm" : T, Kn = l.closeOnSelect ?? !1, sn = {
83
85
  minutes: 1,
84
86
  seconds: 1,
85
87
  ...l.timeSteps
86
- }, R = P(
88
+ }, g = tn(
87
89
  () => m ? ["hours", "minutes", "seconds"] : ["hours", "minutes"],
88
90
  [m]
89
- ), on = R.length - 1, G = en * (R.length + (A ? 1 : 0)), [_n, ln] = q(!1), [_, On] = q(""), [fn, dn] = q(!1), [Kn, O] = q(null), C = k(null), sn = k(null), mn = k(null), J = k(null), H = k(!1), U = k(!1), b = k(0), Q = k(!1), { t: Z, i18n: In } = Qn(), Bn = (In.resolvedLanguage ?? In.language ?? "kr") === "kr" ? "ko" : "en", x = {
90
- okButtonLabel: Z("Button.확인"),
91
- clearButtonLabel: Z("Button.초기화"),
92
- fieldHoursPlaceholder: /* @__PURE__ */ c(() => tn, "fieldHoursPlaceholder"),
93
- fieldMinutesPlaceholder: /* @__PURE__ */ c(() => tn, "fieldMinutesPlaceholder"),
94
- fieldMeridiemPlaceholder: /* @__PURE__ */ c(() => tn, "fieldMeridiemPlaceholder"),
95
- ...Sn
96
- }, Ln = B ?? (A ? "–– ––:––" : "––:––"), Vn = [oe, Y, t == null ? void 0 : t.sx].filter(
91
+ ), ln = g.length - 1, Z = ce * (g.length + (K ? 1 : 0)), [gn, fn] = Y(!1), [h, hn] = Y(""), [dn, mn] = Y(!1), [Nn, N] = Y(null), C = D(null), In = D(null), Tn = D(null), x = D(null), W = D(!1), X = D(!1), k = D(0), F = D(!1), { t: P, i18n: wn } = Fn(), Bn = (wn.resolvedLanguage ?? wn.language ?? "kr") === "kr" ? "ko" : "en", nn = {
92
+ okButtonLabel: P("Button.확인"),
93
+ clearButtonLabel: P("Button.초기화"),
94
+ fieldHoursPlaceholder: /* @__PURE__ */ u(() => an, "fieldHoursPlaceholder"),
95
+ fieldMinutesPlaceholder: /* @__PURE__ */ u(() => an, "fieldMinutesPlaceholder"),
96
+ fieldMeridiemPlaceholder: /* @__PURE__ */ u(() => an, "fieldMeridiemPlaceholder"),
97
+ ...On
98
+ }, Ln = L ?? (K ? "–– ––:––" : "––:––"), Vn = [ke, Q, t == null ? void 0 : t.sx].filter(
97
99
  Boolean
98
- ), zn = !!(h || l.disabled || l.readOnly), Nn = !!a && !h, V = cn !== void 0, s = V ? cn : _n, f = o((n) => {
99
- On(n), dn(!1);
100
- }, []), p = P(() => {
100
+ ), zn = !!(_ || l.disabled || l.readOnly), jn = !!i && !_, z = on !== void 0, s = z ? on : gn, v = de(s), f = o((n) => {
101
+ hn(n), mn(!1);
102
+ }, []), b = o(() => {
103
+ var n;
104
+ (n = x.current) == null || n.focus();
105
+ }, []), R = tn(() => {
101
106
  if (!d)
102
107
  return null;
103
- if (g.isDayjs(d))
108
+ if (O.isDayjs(d))
104
109
  return d;
105
110
  if (typeof d == "string") {
106
- const e = rn(d, m);
111
+ const e = cn(d, m);
107
112
  if (e != null && e.dateValue.isValid())
108
113
  return e.dateValue;
109
- const u = g(d, y, !0);
110
- return u.isValid() ? u : null;
114
+ const c = O(d, T, !0);
115
+ return c.isValid() ? c : null;
111
116
  }
112
- const n = g(d);
117
+ const n = O(d);
113
118
  return n.isValid() ? n : null;
114
- }, [m, y, d]), K = P(() => {
119
+ }, [m, T, d]), B = tn(() => {
115
120
  if (!d)
116
121
  return "";
117
122
  if (typeof d == "string") {
118
- const e = g(d, y, !0);
119
- return e.isValid() ? an(e, m) : d;
123
+ const e = O(d, T, !0);
124
+ return e.isValid() ? un(e, m) : d;
120
125
  }
121
- const n = g(d);
122
- return n.isValid() ? an(n, m) : "";
123
- }, [m, y, d]), jn = /* @__PURE__ */ c((n) => {
124
- const e = n != null && n.isValid() ? n.format(y) : void 0;
126
+ const n = O(d);
127
+ return n.isValid() ? un(n, m) : "";
128
+ }, [m, T, d]), Un = /* @__PURE__ */ u((n) => {
129
+ const e = n != null && n.isValid() ? n.format(T) : void 0;
125
130
  f(
126
- n != null && n.isValid() ? an(n, m) : ""
127
- ), a == null || a(e);
128
- }, "handleChange"), z = o(
131
+ n != null && n.isValid() ? un(n, m) : ""
132
+ ), i == null || i(e);
133
+ }, "handleChange"), M = o(
129
134
  (n) => {
130
- if (!_)
131
- return f(""), a == null || a(""), !0;
132
- const e = rn(_, m);
133
- return e != null && e.dateValue.isValid() ? (f(e.valueText), a == null || a(e.valueText), !0) : (n && _ && dn(!0), !1);
135
+ if (!h)
136
+ return f(""), i == null || i(""), !0;
137
+ const e = cn(h, m);
138
+ return e != null && e.dateValue.isValid() ? (f(e.valueText), i == null || i(e.valueText), !0) : (n && h && mn(!0), !1);
134
139
  },
135
- [m, _, a, f]
136
- ), D = o(() => {
137
- if (U.current || Date.now() < b.current) {
138
- U.current = !1;
140
+ [m, h, i, f]
141
+ ), p = o(() => {
142
+ if (X.current || Date.now() < k.current) {
143
+ X.current = !1;
139
144
  return;
140
145
  }
141
- V || ln(!0), f(K), O(p), v == null || v();
142
- }, [V, v, K, p, f]), T = o(() => {
143
- V || ln(!1), W == null || W();
144
- }, [V, W]), M = o(() => {
145
- z(), T();
146
- }, [T, z]), yn = o(() => {
147
- b.current = Date.now() + 200, M();
148
- }, [M]), En = o(() => {
149
- b.current = Date.now() + 200, T();
150
- }, [T]), Dn = o((n) => {
146
+ z || fn(!0), f(B), N(R), q == null || q();
147
+ }, [z, q, B, R, f]), y = o(() => {
148
+ z || fn(!1), $ == null || $();
149
+ }, [z, $]), E = o(() => {
150
+ M(), y();
151
+ }, [y, M]), yn = o(() => {
152
+ k.current = Date.now() + 200, E();
153
+ }, [E]), kn = o(() => {
154
+ k.current = Date.now() + 200, y();
155
+ }, [y]), H = o((n) => {
151
156
  const e = C.current;
152
157
  e && window.requestAnimationFrame(() => {
153
- var u;
154
- (u = ae(e, n)) == null || u.focus();
158
+ var c;
159
+ (c = Te(e, n)) == null || c.focus();
155
160
  });
156
- }, []), N = o(() => {
161
+ }, []), j = o(() => {
157
162
  window.requestAnimationFrame(() => {
158
163
  var n;
159
- (n = mn.current) == null || n.focus();
164
+ (n = Tn.current) == null || n.focus();
160
165
  });
161
- }, []), vn = o(
166
+ }, []), qn = o(
162
167
  (n) => {
163
- mn.current = n, de(t == null ? void 0 : t.inputRef, n);
168
+ Tn.current = n, De(t == null ? void 0 : t.inputRef, n);
164
169
  },
165
170
  [t == null ? void 0 : t.inputRef]
166
- ), Wn = /* @__PURE__ */ c(() => {
167
- a == null || a(""), f("");
168
- }, "handleClear"), Cn = o(
171
+ ), $n = o(
172
+ (n) => {
173
+ x.current = n, !(!n || !s) && (window.requestAnimationFrame(() => {
174
+ b();
175
+ }), window.setTimeout(() => {
176
+ b();
177
+ }));
178
+ },
179
+ [b, s]
180
+ ), Cn = /* @__PURE__ */ u(() => {
181
+ i == null || i(""), f("");
182
+ }, "handleClear"), Wn = o(
169
183
  (n) => {
170
- const e = n.target.value, u = rn(e, m);
171
- f(e), u != null && u.dateValue.isValid() && O(u.dateValue);
184
+ const e = n.target.value, c = cn(e, m);
185
+ f(e), c != null && c.dateValue.isValid() && N(c.dateValue);
172
186
  },
173
187
  [m, f]
174
- ), Tn = o(
188
+ ), pn = o(
175
189
  (n) => {
176
190
  n.stopPropagation(), n.nativeEvent.stopImmediatePropagation();
177
191
  },
178
192
  []
179
- ), Hn = o(
193
+ ), Xn = o(
180
194
  (n) => {
181
- if (Tn(n), n.key === "Escape") {
182
- n.preventDefault(), b.current = Date.now() + 200, f(K), O(p), T(), N();
195
+ if (pn(n), n.key === "Escape") {
196
+ n.preventDefault(), k.current = Date.now() + 200, f(B), N(R), y(), j();
183
197
  return;
184
198
  }
185
199
  if (n.key === "Tab") {
186
- if (n.preventDefault(), !z(!0))
200
+ if (n.preventDefault(), !M(!0))
187
201
  return;
188
- b.current = Date.now() + 200, T(), Dn(n.shiftKey);
202
+ k.current = Date.now() + 200, y(), H(n.shiftKey);
189
203
  return;
190
204
  }
191
- n.key === "Enter" && (n.preventDefault(), z(!0) && (b.current = Date.now() + 200, T(), N()));
205
+ n.key === "Enter" && (n.preventDefault(), M(!0) && (k.current = Date.now() + 200, y(), j()));
192
206
  },
193
207
  [
194
- T,
195
- z,
196
- Dn,
197
- N,
198
- K,
199
- p,
208
+ y,
209
+ M,
210
+ H,
211
+ j,
212
+ B,
213
+ R,
200
214
  f,
201
- Tn
215
+ pn
202
216
  ]
203
- ), Un = o(
217
+ ), vn = o(
218
+ (n) => {
219
+ n.stopPropagation(), n.key === "Tab" && (n.preventDefault(), M(!0) && (k.current = Date.now() + 200, y(), H(n.shiftKey)));
220
+ },
221
+ [y, M, H]
222
+ ), Hn = o(
204
223
  (n) => {
205
224
  var e;
206
- n.preventDefault(), n.stopPropagation(), a == null || a(""), f(""), O(null), (e = J.current) == null || e.focus();
225
+ n.preventDefault(), n.stopPropagation(), i == null || i(""), f(""), N(null), (e = x.current) == null || e.focus();
207
226
  },
208
- [a, f]
209
- ), qn = o(
227
+ [i, f]
228
+ ), Yn = o(
210
229
  (n, e) => {
211
230
  if (!(n != null && n.isValid()))
212
231
  return;
213
- const u = n.format(y);
214
- O(n), f(u), e === R[on] && (b.current = Date.now() + 200, a == null || a(u), En(), N());
232
+ const c = n.format(T);
233
+ N(n), f(c), e === g[ln] && (k.current = Date.now() + 200, i == null || i(c), kn(), j());
215
234
  },
216
235
  [
217
- on,
218
- En,
219
- N,
220
- y,
221
- a,
236
+ ln,
237
+ kn,
238
+ j,
239
+ T,
240
+ i,
222
241
  f,
223
- R
242
+ g
224
243
  ]
225
- ), Xn = o(
244
+ ), Gn = o(
226
245
  (n) => {
227
246
  var e;
228
- (e = t == null ? void 0 : t.onMouseDown) == null || e.call(t, n), H.current = !0;
247
+ (e = t == null ? void 0 : t.onMouseDown) == null || e.call(t, n), W.current = !0;
229
248
  },
230
249
  [t]
231
- ), $n = o(
250
+ ), Jn = o(
232
251
  (n) => {
233
252
  var e;
234
- (e = t == null ? void 0 : t.onFocus) == null || e.call(t, n), !(n.defaultPrevented || l.disabled || l.readOnly || s) && (Q.current = H.current, D());
253
+ (e = t == null ? void 0 : t.onFocus) == null || e.call(t, n), !(n.defaultPrevented || l.disabled || l.readOnly || s) && (F.current = W.current, p());
235
254
  },
236
- [D, s, t, l.disabled, l.readOnly]
237
- ), Yn = o(
255
+ [p, s, t, l.disabled, l.readOnly]
256
+ ), Qn = o(
238
257
  (n) => {
239
258
  var e;
240
259
  if ((e = t == null ? void 0 : t.onClick) == null || e.call(t, n), !(n.defaultPrevented || l.disabled || l.readOnly)) {
241
- if (Q.current) {
242
- Q.current = !1, H.current = !1;
260
+ if (F.current) {
261
+ F.current = !1, W.current = !1;
243
262
  return;
244
263
  }
245
- if (H.current = !1, s) {
246
- U.current = !0, M(), queueMicrotask(() => {
247
- U.current = !1;
264
+ if (W.current = !1, s) {
265
+ X.current = !0, E(), queueMicrotask(() => {
266
+ X.current = !1;
248
267
  });
249
268
  return;
250
269
  }
251
- D();
270
+ p();
252
271
  }
253
272
  },
254
273
  [
255
- M,
256
- D,
274
+ E,
275
+ p,
257
276
  s,
258
277
  t,
259
278
  l.disabled,
260
279
  l.readOnly
261
280
  ]
262
- ), Gn = o(
281
+ ), Zn = o(
263
282
  (n) => {
264
283
  var e;
265
284
  if ((e = t == null ? void 0 : t.onKeyDown) == null || e.call(t, n), !(n.defaultPrevented || l.disabled || l.readOnly)) {
266
- if (!s && fe(n)) {
267
- n.preventDefault(), D();
285
+ if (!s && Ee(n)) {
286
+ n.preventDefault(), p();
268
287
  return;
269
288
  }
270
- !s || !le(n) || M();
289
+ if (s && n.key === "Tab") {
290
+ k.current = Date.now() + 200, E();
291
+ return;
292
+ }
293
+ !s || !pe(n) || E();
271
294
  }
272
295
  },
273
296
  [
274
- M,
275
- D,
297
+ E,
298
+ p,
276
299
  s,
277
300
  t,
278
301
  l.disabled,
279
302
  l.readOnly
280
303
  ]
281
304
  );
282
- return nn(() => {
283
- s && (f(K), O(p));
284
- }, [s, K, p, f]), nn(() => {
285
- if (!s)
305
+ return rn(() => {
306
+ s && (f(B), N(R));
307
+ }, [s, B, R, f]), rn(() => {
308
+ if (!s || v.state !== "open")
286
309
  return;
287
310
  const n = window.requestAnimationFrame(() => {
288
- var e;
289
- (e = J.current) == null || e.focus();
290
- });
311
+ b();
312
+ }), e = window.setTimeout(() => {
313
+ b();
314
+ }), c = window.setTimeout(() => {
315
+ b();
316
+ }, Mn);
291
317
  return () => {
292
- window.cancelAnimationFrame(n);
318
+ window.cancelAnimationFrame(n), window.clearTimeout(e), window.clearTimeout(c);
293
319
  };
294
- }, [s]), nn(() => {
320
+ }, [b, s, v.state]), rn(() => {
295
321
  if (!s)
296
322
  return;
297
- const n = /* @__PURE__ */ c((e) => {
298
- var j, wn;
299
- const u = e.target;
300
- u instanceof Node && ((j = C.current) != null && j.contains(u) || (wn = sn.current) != null && wn.contains(u) || yn());
323
+ const n = /* @__PURE__ */ u((e) => {
324
+ var U, Dn;
325
+ const c = e.target;
326
+ c instanceof Node && ((U = C.current) != null && U.contains(c) || (Dn = In.current) != null && Dn.contains(c) || yn());
301
327
  }, "handleDocumentMouseDown");
302
328
  return document.addEventListener("mousedown", n, !0), () => {
303
329
  document.removeEventListener("mousedown", n, !0);
304
330
  };
305
- }, [yn, s]), /* @__PURE__ */ E(ne, { dateAdapter: ee, adapterLocale: Bn, children: /* @__PURE__ */ F("div", { ref: C, children: [
306
- /* @__PURE__ */ E(
307
- Fn,
331
+ }, [yn, s]), /* @__PURE__ */ w(re, { dateAdapter: ae, adapterLocale: Bn, children: /* @__PURE__ */ en("div", { ref: C, children: [
332
+ /* @__PURE__ */ w(
333
+ ee,
308
334
  {
309
335
  ...l,
310
336
  enableAccessibleFieldDOMStructure: !1,
311
- ampm: A,
337
+ ampm: K,
312
338
  open: !1,
313
- closeOnSelect: Rn,
314
- timeSteps: un,
339
+ closeOnSelect: Kn,
340
+ timeSteps: sn,
315
341
  label: r,
316
- value: p,
317
- views: R,
318
- format: An,
319
- localeText: x,
320
- onChange: jn,
321
- onOpen: D,
322
- onClose: M,
342
+ value: R,
343
+ views: g,
344
+ format: _n,
345
+ localeText: nn,
346
+ onChange: Un,
347
+ onOpen: p,
348
+ onClose: E,
323
349
  slots: {
324
- ...hn,
325
- inputAdornment: /* @__PURE__ */ c(({ position: n, children: e, ...u }) => /* @__PURE__ */ F(pn, { position: n, ...u, children: [
326
- n === "end" && Nn && /* @__PURE__ */ E(
327
- Mn,
350
+ ...Sn,
351
+ inputAdornment: /* @__PURE__ */ u(({ position: n, children: e, ...c }) => /* @__PURE__ */ en(bn, { position: n, ...c, children: [
352
+ n === "end" && jn && /* @__PURE__ */ w(
353
+ Rn,
328
354
  {
329
355
  className: "clearButton",
330
356
  size: "small",
331
357
  tabIndex: -1,
332
- "aria-label": x.clearButtonLabel,
358
+ "aria-label": nn.clearButtonLabel,
333
359
  disabled: zn,
334
- onClick: /* @__PURE__ */ c((j) => {
335
- j.preventDefault(), j.stopPropagation(), Wn();
360
+ onClick: /* @__PURE__ */ u((U) => {
361
+ U.preventDefault(), U.stopPropagation(), Cn();
336
362
  }, "onClick"),
337
- children: /* @__PURE__ */ E(bn, { fontSize: "small" })
363
+ children: /* @__PURE__ */ w(An, { fontSize: "small" })
338
364
  }
339
365
  ),
340
366
  e
341
367
  ] }), "TimePickerInputAdornment")
342
368
  },
343
369
  slotProps: {
344
- ...i,
370
+ ...a,
345
371
  openPickerButton: {
346
- ...typeof (i == null ? void 0 : i.openPickerButton) == "function" || i == null ? void 0 : i.openPickerButton,
372
+ ...typeof (a == null ? void 0 : a.openPickerButton) == "function" || a == null ? void 0 : a.openPickerButton,
347
373
  size: "small",
348
374
  tabIndex: -1,
349
- onClick: /* @__PURE__ */ c((n) => {
350
- n.preventDefault(), n.stopPropagation(), s || D();
375
+ onClick: /* @__PURE__ */ u((n) => {
376
+ n.preventDefault(), n.stopPropagation(), s || p();
351
377
  }, "onClick"),
352
378
  sx: {
353
379
  margin: 0,
@@ -355,44 +381,44 @@ const tn = "––", oe = {
355
381
  }
356
382
  },
357
383
  openPickerIcon: {
358
- ...typeof (i == null ? void 0 : i.openPickerIcon) == "function" || i == null ? void 0 : i.openPickerIcon,
384
+ ...typeof (a == null ? void 0 : a.openPickerIcon) == "function" || a == null ? void 0 : a.openPickerIcon,
359
385
  fontSize: "small"
360
386
  },
361
387
  inputAdornment: {
362
- ...typeof (i == null ? void 0 : i.inputAdornment) == "function" || i == null ? void 0 : i.inputAdornment,
388
+ ...typeof (a == null ? void 0 : a.inputAdornment) == "function" || a == null ? void 0 : a.inputAdornment,
363
389
  sx: {
364
390
  marginBottom: 0,
365
391
  marginLeft: 0,
366
392
  gap: 0,
367
- ...typeof (i == null ? void 0 : i.inputAdornment) == "function" || (kn = i == null ? void 0 : i.inputAdornment) == null ? void 0 : kn.sx
393
+ ...typeof (a == null ? void 0 : a.inputAdornment) == "function" || (En = a == null ? void 0 : a.inputAdornment) == null ? void 0 : En.sx
368
394
  }
369
395
  },
370
396
  textField: {
371
397
  variant: I,
372
- fullWidth: L,
398
+ fullWidth: V,
373
399
  ...t,
374
- className: te(
375
- !L && (A ? "w-[160px]" : "w-[140px]"),
400
+ className: ie(
401
+ !V && (K ? "w-[160px]" : "w-[140px]"),
376
402
  t == null ? void 0 : t.className
377
403
  ),
378
- onMouseDown: Xn,
379
- onFocus: $n,
380
- onClick: Yn,
381
- onKeyDown: Gn,
382
- inputRef: vn,
404
+ onMouseDown: Gn,
405
+ onFocus: Jn,
406
+ onClick: Qn,
407
+ onKeyDown: Zn,
408
+ inputRef: qn,
383
409
  placeholder: Ln,
384
410
  sx: Vn
385
411
  }
386
412
  }
387
413
  }
388
414
  ),
389
- /* @__PURE__ */ E(
390
- Zn,
415
+ v.shouldRender && /* @__PURE__ */ w(
416
+ Pn,
391
417
  {
392
- open: s,
418
+ open: !0,
393
419
  anchorEl: C.current,
394
420
  placement: "bottom-end",
395
- ref: sn,
421
+ ref: In,
396
422
  modifiers: [
397
423
  {
398
424
  name: "offset",
@@ -401,127 +427,101 @@ const tn = "––", oe = {
401
427
  }
402
428
  }
403
429
  ],
404
- sx: { zIndex: /* @__PURE__ */ c((n) => n.zIndex.modal, "zIndex") },
405
- children: /* @__PURE__ */ F(
406
- xn,
430
+ sx: { zIndex: /* @__PURE__ */ u((n) => n.zIndex.modal, "zIndex") },
431
+ children: /* @__PURE__ */ w(
432
+ "div",
407
433
  {
408
- elevation: 8,
409
- onClick: /* @__PURE__ */ c((n) => {
410
- n.stopPropagation();
411
- }, "onClick"),
412
- onKeyDown: /* @__PURE__ */ c((n) => {
413
- n.stopPropagation();
414
- }, "onKeyDown"),
415
- onKeyUp: /* @__PURE__ */ c((n) => {
416
- n.stopPropagation();
417
- }, "onKeyUp"),
418
- onMouseDown: /* @__PURE__ */ c((n) => {
419
- n.stopPropagation();
420
- }, "onMouseDown"),
421
- sx: {
422
- borderRadius: 1,
423
- lineHeight: 0,
424
- overflow: "hidden",
425
- width: G
434
+ className: "owp-animated-picker-popper",
435
+ "data-state": v.state,
436
+ style: {
437
+ "--owp-calendar-transition-duration": `${Mn}ms`,
438
+ "--owp-calendar-transform-transition-duration": `${Ie}ms`,
439
+ "--owp-calendar-exit-transform-delay": `${me}ms`
426
440
  },
427
- children: [
428
- /* @__PURE__ */ E(
429
- ue,
430
- {
431
- autoFocus: !0,
432
- inputRef: J,
433
- fullWidth: !0,
434
- size: "small",
435
- variant: "outlined",
436
- value: _,
437
- error: fn,
438
- helperText: fn ? Z(re) : void 0,
439
- mask: ce(y),
440
- placeholder: y,
441
- onChange: Cn,
442
- onKeyDown: Hn,
443
- inputProps: {
444
- inputMode: "numeric",
445
- "aria-label": y
446
- },
447
- endAdornment: /* @__PURE__ */ E(
448
- pn,
441
+ children: /* @__PURE__ */ en(
442
+ ne,
443
+ {
444
+ elevation: 8,
445
+ onClick: /* @__PURE__ */ u((n) => {
446
+ n.stopPropagation();
447
+ }, "onClick"),
448
+ onKeyDown: vn,
449
+ onKeyUp: /* @__PURE__ */ u((n) => {
450
+ n.stopPropagation();
451
+ }, "onKeyUp"),
452
+ onMouseDown: /* @__PURE__ */ u((n) => {
453
+ n.stopPropagation();
454
+ }, "onMouseDown"),
455
+ sx: se(Z),
456
+ children: [
457
+ /* @__PURE__ */ w(
458
+ ye,
449
459
  {
450
- position: "end",
451
- sx: {
452
- marginLeft: 0
460
+ autoFocus: !0,
461
+ inputRef: $n,
462
+ fullWidth: !0,
463
+ size: "small",
464
+ variant: "outlined",
465
+ value: h,
466
+ error: dn,
467
+ helperText: dn ? P(ue) : void 0,
468
+ mask: we(T),
469
+ placeholder: T,
470
+ onChange: Wn,
471
+ onKeyDown: Xn,
472
+ inputProps: {
473
+ inputMode: "numeric",
474
+ "aria-label": T
453
475
  },
454
- children: /* @__PURE__ */ E(
455
- Mn,
476
+ endAdornment: /* @__PURE__ */ w(
477
+ bn,
456
478
  {
457
- size: "small",
458
- tabIndex: -1,
459
- "aria-label": x.clearButtonLabel,
460
- disabled: !_,
461
- onClick: Un,
462
- onMouseDown: /* @__PURE__ */ c((n) => {
463
- n.preventDefault(), n.stopPropagation();
464
- }, "onMouseDown"),
479
+ position: "end",
465
480
  sx: {
466
- margin: 0,
467
- padding: 0.25
481
+ marginLeft: 0
468
482
  },
469
- children: /* @__PURE__ */ E(bn, { fontSize: "small" })
483
+ children: /* @__PURE__ */ w(
484
+ Rn,
485
+ {
486
+ size: "small",
487
+ tabIndex: -1,
488
+ "aria-label": nn.clearButtonLabel,
489
+ disabled: !h,
490
+ onClick: Hn,
491
+ onMouseDown: /* @__PURE__ */ u((n) => {
492
+ n.preventDefault(), n.stopPropagation();
493
+ }, "onMouseDown"),
494
+ sx: {
495
+ margin: 0,
496
+ padding: 0.25
497
+ },
498
+ children: /* @__PURE__ */ w(An, { fontSize: "small" })
499
+ }
500
+ )
470
501
  }
471
- )
502
+ ),
503
+ sx: le(Z)
472
504
  }
473
505
  ),
474
- sx: {
475
- boxSizing: "border-box",
476
- width: G,
477
- px: 1,
478
- py: 1,
479
- "& .MuiOutlinedInput-root": {
480
- borderRadius: 0.75,
481
- fontSize: 13,
482
- paddingRight: 0.5
483
- }
484
- }
485
- }
486
- ),
487
- /* @__PURE__ */ E(
488
- Pn,
489
- {
490
- ampm: A,
491
- value: Kn,
492
- views: R,
493
- onChange: /* @__PURE__ */ c((n, e, u) => qn(n, u), "onChange"),
494
- timeSteps: un,
495
- slotProps: {
496
- digitalClockSectionItem: {
497
- sx: ie
498
- }
499
- },
500
- sx: {
501
- border: 0,
502
- width: G,
503
- "& .MuiMultiSectionDigitalClockSection-root": {
504
- border: 0,
505
- boxSizing: "border-box",
506
- width: en,
507
- flex: `0 0 ${en}px`,
508
- display: "flex",
509
- flexDirection: "column",
510
- alignItems: "stretch"
511
- },
512
- "& .MuiMultiSectionDigitalClockSection-item": {
513
- alignSelf: "stretch",
514
- boxSizing: "border-box",
515
- width: gn,
516
- minWidth: gn,
517
- justifyContent: "center",
518
- marginLeft: "auto",
519
- marginRight: "auto"
506
+ /* @__PURE__ */ w(
507
+ te,
508
+ {
509
+ ampm: K,
510
+ value: Nn,
511
+ views: g,
512
+ onChange: /* @__PURE__ */ u((n, e, c) => Yn(n, c), "onChange"),
513
+ timeSteps: sn,
514
+ slotProps: {
515
+ digitalClockSectionItem: {
516
+ sx: oe
517
+ }
518
+ },
519
+ sx: fe(Z)
520
520
  }
521
- }
522
- }
523
- )
524
- ]
521
+ )
522
+ ]
523
+ }
524
+ )
525
525
  }
526
526
  )
527
527
  }
@@ -529,6 +529,6 @@ const tn = "––", oe = {
529
529
  ] }) });
530
530
  }, "OwpTimePicker");
531
531
  export {
532
- Ae as OwpTimePicker
532
+ qe as OwpTimePicker
533
533
  };
534
534
  //# sourceMappingURL=OwpTimePicker.js.map