@owp/core 2.5.18 → 2.5.20

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 (53) hide show
  1. package/dist/components/OwpPageContent/OwpPageContent.js +14 -12
  2. package/dist/components/OwpPageContent/OwpPageContent.js.map +1 -1
  3. package/dist/components/OwpPageTitle/OwpPageTitle.js +37 -35
  4. package/dist/components/OwpPageTitle/OwpPageTitle.js.map +1 -1
  5. package/dist/components/OwpPicker/OwpDatePicker.js +339 -102
  6. package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
  7. package/dist/components/OwpPicker/OwpDateRangePicker.js +89 -85
  8. package/dist/components/OwpPicker/OwpDateRangePicker.js.map +1 -1
  9. package/dist/components/OwpPicker/OwpTimePicker.js +494 -236
  10. package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
  11. package/dist/components/OwpPicker/constants/index.js +6 -5
  12. package/dist/components/OwpPicker/constants/index.js.map +1 -1
  13. package/dist/components/OwpPicker/internal/DatePickerInput.js +71 -47
  14. package/dist/components/OwpPicker/internal/DatePickerInput.js.map +1 -1
  15. package/dist/components/OwpSection/OwpSection.js +84 -62
  16. package/dist/components/OwpSection/OwpSection.js.map +1 -1
  17. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +42 -40
  18. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
  19. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js +307 -270
  20. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js.map +1 -1
  21. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +267 -276
  22. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  23. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +262 -182
  24. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
  25. package/dist/constants/gridTheme.js +7 -6
  26. package/dist/constants/gridTheme.js.map +1 -1
  27. package/dist/constants/treeGrid.js +32 -31
  28. package/dist/constants/treeGrid.js.map +1 -1
  29. package/dist/constants.js +28 -27
  30. package/dist/features/themePreview/configs/grid.js +3 -1
  31. package/dist/features/themePreview/configs/grid.js.map +1 -1
  32. package/dist/features/themePreview/utils/themePreviewDefinitions.js +10 -0
  33. package/dist/features/themePreview/utils/themePreviewDefinitions.js.map +1 -1
  34. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  35. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
  36. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  37. package/dist/owp-app.css +1 -1
  38. package/dist/types/components/OwpPageContent/OwpPageContent.d.ts +3 -1
  39. package/dist/types/components/OwpPageTitle/OwpPageTitle.d.ts +3 -1
  40. package/dist/types/components/OwpPicker/constants/index.d.ts +1 -0
  41. package/dist/types/components/OwpPicker/internal/DatePickerInput.d.ts +7 -0
  42. package/dist/types/components/OwpSection/OwpSection.d.ts +3 -1
  43. package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +1 -1
  44. package/dist/types/constants/gridTheme.d.ts +2 -0
  45. package/dist/types/constants/treeGrid.d.ts +2 -1
  46. package/dist/types/features/themePreview/configs/grid.d.ts +2 -0
  47. package/dist/types/features/themePreview/configs/settings.d.ts +2 -0
  48. package/dist/types/types/OwpGridThemeTypes.d.ts +1 -0
  49. package/dist/types/utils/treeGridUtil.d.ts +15 -3
  50. package/dist/utils/treeGridUtil.js +193 -147
  51. package/dist/utils/treeGridUtil.js.map +1 -1
  52. package/dist/utils.js +69 -67
  53. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
- var me = Object.defineProperty;
2
- var t = (r, w) => me(r, "name", { value: w, configurable: !0 });
3
- import { jsx as f, jsxs as fe } 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 pe } from "../../hooks/useOwpTranslation.js";
5
- import { ensureDayjsBrowserSetup as ge } from "../../utils/dayjsBrowser.js";
6
- import be 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";
7
- import { MenuItem as ke, IconButton as Ie, InputAdornment as Me } from "@mui/material";
8
- import { TimePicker as Ee, LocalizationProvider as ye } from "@mui/x-date-pickers";
9
- import { AdapterDayjs as Te } from "@mui/x-date-pickers/AdapterDayjs";
10
- import { clsx as he } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
11
- import B from "dayjs";
12
- import { useState as Se, useRef as v, useMemo as V, useCallback as S, useEffect as we, forwardRef as Ce } from "react";
13
- import { VALUE_TIME_FORMATTER as Y } from "./constants/index.js";
14
- ge();
15
- const D = "––", Be = 1, U = {
1
+ var Ye = Object.defineProperty;
2
+ var a = (t, s) => Ye(t, "name", { value: s, configurable: !0 });
3
+ import { jsx as y, 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 Je } from "../../hooks/useOwpTranslation.js";
5
+ import { ensureDayjsBrowserSetup as Qe } from "../../utils/dayjsBrowser.js";
6
+ import ke 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";
7
+ import { Popper as Ze, Paper as xe, TextField as Fe, InputAdornment as pe, IconButton as we } from "@mui/material";
8
+ import { TimePicker as Pe, MultiSectionDigitalClock as en, LocalizationProvider as nn } from "@mui/x-date-pickers";
9
+ import { AdapterDayjs as tn } from "@mui/x-date-pickers/AdapterDayjs";
10
+ import { clsx as rn } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
11
+ import h from "dayjs";
12
+ import { useMemo as P, useState as G, useRef as k, useCallback as l, useEffect as ee } from "react";
13
+ import { VALUE_TIME_FORMATTER as X, PICKER_INVALID_INPUT_MESSAGE_KEY as an } from "./constants/index.js";
14
+ Qe();
15
+ const ne = "––", $ = "HH:mm:ss", te = 64, ge = 56, cn = {
16
16
  "&:hover": {
17
17
  backgroundColor: "var(--owp-datepicker-hover-bg, rgba(3, 155, 229, 0.14))"
18
18
  },
@@ -23,7 +23,7 @@ const D = "––", Be = 1, U = {
23
23
  backgroundColor: "var(--owp-datepicker-selected-hover-bg, #039be5)"
24
24
  }
25
25
  }
26
- }, ve = {
26
+ }, on = {
27
27
  "& .MuiInputBase-root": {
28
28
  alignItems: "center"
29
29
  },
@@ -49,259 +49,517 @@ const D = "––", Be = 1, U = {
49
49
  visibility: "visible"
50
50
  }
51
51
  }
52
- }, W = {
53
- border: 0,
54
- borderRadius: 1,
55
- boxShadow: 8,
56
- backgroundImage: "none",
57
- backgroundColor: "background.paper",
58
- overflow: "hidden",
59
- "& .MuiPickersLayout-contentWrapper": {
60
- border: 0
61
- },
62
- "& .MuiPickersLayout-actionBar": {
63
- borderTop: "1px solid",
64
- borderColor: "#e0e0e0"
65
- },
66
- "& .MuiMultiSectionDigitalClock-root, & .MuiDigitalClock-root": {
67
- border: 0
68
- },
69
- "& .MuiMultiSectionDigitalClockSection-root": {
70
- border: 0
71
- },
72
- "& .MuiMultiSectionDigitalClockSection-root:last-of-type": {
73
- overflowY: "hidden",
74
- scrollbarWidth: "none",
75
- "&::-webkit-scrollbar": {
76
- display: "none",
77
- width: 0
78
- },
79
- "@media (pointer: fine)": {
80
- "&:hover": {
81
- overflowY: "hidden"
82
- }
83
- },
84
- "@media (pointer: none), (pointer: coarse)": {
85
- overflowY: "hidden"
52
+ }, un = /* @__PURE__ */ a((t) => t.ctrlKey || t.altKey || t.metaKey ? !1 : t.key.length === 1 || t.key === "Backspace" || t.key === "Delete", "isValueEditingKey"), ln = /* @__PURE__ */ a((t) => t.ctrlKey || t.altKey || t.metaKey || t.key === "Escape" || t.key === "Enter" || t.key === "Tab" ? !1 : t.key.length === 1 || t.key.startsWith("Arrow"), "isTimePickerOpenKey"), sn = /* @__PURE__ */ a((t, s) => {
53
+ const D = s ? 6 : 4, i = t.replace(/\D/g, "").slice(0, D);
54
+ return [i.slice(0, 2), i.slice(2, 4), i.slice(4, 6)].filter(Boolean).join(":");
55
+ }, "formatTimePickerInput"), re = /* @__PURE__ */ a((t, s) => {
56
+ const D = t.trim(), i = s ? "(\\d{2}):(\\d{2}):(\\d{2})" : "(\\d{2}):(\\d{2})", p = D.match(new RegExp(`^${i}$`));
57
+ if (!p)
58
+ return null;
59
+ const S = Number(p[1]), N = Number(p[2]), A = s ? Number(p[3]) : 0;
60
+ if (N > 59 || A > 59 || S > 24 || S === 24 && (N > 0 || A > 0))
61
+ return null;
62
+ const K = [S, N, ...s ? [A] : []].map((o) => String(o).padStart(2, "0")).join(":");
63
+ return {
64
+ dateValue: S === 24 ? h("00:00:00", $, !0).add(1, "day") : h(K, s ? $ : X, !0),
65
+ valueText: K
66
+ };
67
+ }, "parseTimePickerInput"), ie = /* @__PURE__ */ a((t, s) => t.format(s ? $ : X), "formatTimePickerDisplayInput"), dn = /* @__PURE__ */ a((t) => !(!(t instanceof HTMLElement) || t.hasAttribute("disabled") || t.getAttribute("aria-disabled") === "true" || t.tabIndex < 0 || !t.getClientRects().length), "isFocusableElement"), fn = /* @__PURE__ */ a((t, s) => {
68
+ const D = Array.from(
69
+ document.querySelectorAll(
70
+ 'a[href],button,input,select,textarea,[tabindex]:not([tabindex="-1"])'
71
+ )
72
+ ).filter(
73
+ (i) => dn(i) && !t.contains(i)
74
+ );
75
+ return s ? D.reverse().find(
76
+ (i) => !!(t.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_PRECEDING)
77
+ ) : D.find(
78
+ (i) => !!(t.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_FOLLOWING)
79
+ );
80
+ }, "getAdjacentFocusableElement"), mn = /* @__PURE__ */ a((t, s) => {
81
+ if (t) {
82
+ if (typeof t == "function") {
83
+ t(s);
84
+ return;
86
85
  }
86
+ t.current = s;
87
87
  }
88
- }, De = /* @__PURE__ */ t((r) => r.ctrlKey || r.altKey || r.metaKey ? !1 : r.key.length === 1 || r.key === "Backspace" || r.key === "Delete", "isValueEditingKey"), We = /* @__PURE__ */ t(({
89
- label: r,
90
- variant: w = "standard",
91
- sx: q,
92
- value: d,
93
- format: G = Y,
94
- useAmPm: J,
95
- placeholder: Q,
96
- disabledClearButton: _,
97
- fullWidth: L,
98
- onChange: s,
99
- textFieldProps: n,
100
- localeText: Z,
101
- open: A,
102
- onOpen: g,
103
- onClose: b,
104
- slots: k,
105
- slotProps: m,
106
- ...i
88
+ }, "assignInputRef"), On = /* @__PURE__ */ a(({
89
+ label: t,
90
+ variant: s = "standard",
91
+ sx: D,
92
+ value: i,
93
+ format: p = X,
94
+ useAmPm: S,
95
+ placeholder: N,
96
+ disabledClearButton: A,
97
+ fullWidth: K,
98
+ onChange: o,
99
+ textFieldProps: r,
100
+ localeText: Me,
101
+ open: ae,
102
+ onOpen: C,
103
+ onClose: H,
104
+ slots: he,
105
+ slotProps: c,
106
+ ...d
107
107
  }) => {
108
- const I = Y, M = J ?? /a/i.test(G), $ = M ? "A hh:mm" : I, x = i.closeOnSelect ?? !1, F = {
108
+ var Te;
109
+ const m = /s/i.test(p), b = m ? $ : X, O = S ?? /a/i.test(p), Se = O ? m ? "A hh:mm:ss" : "A hh:mm" : b, Ae = d.closeOnSelect ?? !1, ce = {
109
110
  minutes: 1,
110
- ...i.timeSteps
111
- }, [P, O] = Se(!1), R = v(null), K = v(null), E = v(!1), { t: N, i18n: z } = pe(), ee = (z.resolvedLanguage ?? z.language ?? "kr") === "kr" ? "ko" : "en", j = {
112
- okButtonLabel: N("Button.확인"),
113
- clearButtonLabel: N("Button.초기화"),
114
- fieldHoursPlaceholder: /* @__PURE__ */ t(() => D, "fieldHoursPlaceholder"),
115
- fieldMinutesPlaceholder: /* @__PURE__ */ t(() => D, "fieldMinutesPlaceholder"),
116
- fieldMeridiemPlaceholder: /* @__PURE__ */ t(() => D, "fieldMeridiemPlaceholder"),
117
- ...Z
118
- }, ne = Q ?? (M ? "–– ––:––" : "––:––"), oe = [ve, q, n == null ? void 0 : n.sx].filter(
111
+ seconds: 1,
112
+ ...d.timeSteps
113
+ }, _ = P(
114
+ () => m ? ["hours", "minutes", "seconds"] : ["hours", "minutes"],
115
+ [m]
116
+ ), oe = _.length - 1, Y = te * (_.length + (O ? 1 : 0)), [Oe, ue] = G(!1), [R, _e] = G(""), [le, se] = G(!1), [Re, B] = G(null), U = k(null), de = k(null), fe = k(null), J = k(null), W = k(!1), q = k(!1), w = k(0), Q = k(!1), { t: Z, i18n: me } = Je(), Be = (me.resolvedLanguage ?? me.language ?? "kr") === "kr" ? "ko" : "en", x = {
117
+ okButtonLabel: Z("Button.확인"),
118
+ clearButtonLabel: Z("Button.초기화"),
119
+ fieldHoursPlaceholder: /* @__PURE__ */ a(() => ne, "fieldHoursPlaceholder"),
120
+ fieldMinutesPlaceholder: /* @__PURE__ */ a(() => ne, "fieldMinutesPlaceholder"),
121
+ fieldMeridiemPlaceholder: /* @__PURE__ */ a(() => ne, "fieldMeridiemPlaceholder"),
122
+ ...Me
123
+ }, Le = N ?? (O ? "–– ––:––" : "––:––"), Ne = [on, D, r == null ? void 0 : r.sx].filter(
119
124
  Boolean
120
- ), te = !!(_ || i.disabled || i.readOnly), re = !!s && !_, p = A !== void 0, l = p ? A : P, y = typeof (m == null ? void 0 : m.actionBar) == "function" || m == null ? void 0 : m.actionBar, ie = V(() => {
121
- if (!d)
125
+ ), Ke = !!(A || d.disabled || d.readOnly), Ve = !!o && !A, V = ae !== void 0, I = V ? ae : Oe, f = l((e) => {
126
+ _e(e), se(!1);
127
+ }, []), g = P(() => {
128
+ if (!i)
122
129
  return null;
123
- if (B.isDayjs(d))
124
- return d;
125
- if (typeof d == "string") {
126
- const o = B(d, I, !0);
127
- return o.isValid() ? o : null;
130
+ if (h.isDayjs(i))
131
+ return i;
132
+ if (typeof i == "string") {
133
+ const n = re(i, m);
134
+ if (n != null && n.dateValue.isValid())
135
+ return n.dateValue;
136
+ const u = h(i, b, !0);
137
+ return u.isValid() ? u : null;
128
138
  }
129
- const e = B(d);
139
+ const e = h(i);
130
140
  return e.isValid() ? e : null;
131
- }, [I, d]), ae = /* @__PURE__ */ t((e) => {
132
- s == null || s(e != null && e.isValid() ? e.format(I) : void 0);
133
- }, "handleChange"), T = S(() => {
134
- if (E.current) {
135
- E.current = !1;
141
+ }, [m, b, i]), L = P(() => {
142
+ if (!i)
143
+ return "";
144
+ if (typeof i == "string") {
145
+ const n = h(i, b, !0);
146
+ return n.isValid() ? ie(n, m) : i;
147
+ }
148
+ const e = h(i);
149
+ return e.isValid() ? ie(e, m) : "";
150
+ }, [m, b, i]), ze = /* @__PURE__ */ a((e) => {
151
+ const n = e != null && e.isValid() ? e.format(b) : void 0;
152
+ f(
153
+ e != null && e.isValid() ? ie(e, m) : ""
154
+ ), o == null || o(n);
155
+ }, "handleChange"), z = l(
156
+ (e) => {
157
+ if (!R)
158
+ return f(""), o == null || o(""), !0;
159
+ const n = re(R, m);
160
+ return n != null && n.dateValue.isValid() ? (f(n.valueText), o == null || o(n.valueText), !0) : (e && R && se(!0), !1);
161
+ },
162
+ [m, R, o, f]
163
+ ), T = l(() => {
164
+ if (q.current || Date.now() < w.current) {
165
+ q.current = !1;
136
166
  return;
137
167
  }
138
- p || O(!0), g == null || g();
139
- }, [p, g]), a = S(() => {
140
- p || O(!1), b == null || b();
141
- }, [p, b]), ce = /* @__PURE__ */ t(() => {
142
- s == null || s("");
143
- }, "handleClear"), le = S(
168
+ V || ue(!0), f(L), B(g), C == null || C();
169
+ }, [V, C, L, g, f]), E = l(() => {
170
+ V || ue(!1), H == null || H();
171
+ }, [V, H]), M = l(() => {
172
+ z(), E();
173
+ }, [E, z]), Ie = l(() => {
174
+ w.current = Date.now() + 200, M();
175
+ }, [M]), be = l(() => {
176
+ w.current = Date.now() + 200, E();
177
+ }, [E]), ye = l((e) => {
178
+ const n = U.current;
179
+ n && window.requestAnimationFrame(() => {
180
+ var u;
181
+ (u = fn(n, e)) == null || u.focus();
182
+ });
183
+ }, []), v = l(() => {
184
+ window.requestAnimationFrame(() => {
185
+ var e;
186
+ (e = fe.current) == null || e.focus();
187
+ });
188
+ }, []), ve = l(
189
+ (e) => {
190
+ fe.current = e, mn(r == null ? void 0 : r.inputRef, e);
191
+ },
192
+ [r == null ? void 0 : r.inputRef]
193
+ ), je = /* @__PURE__ */ a(() => {
194
+ o == null || o(""), f("");
195
+ }, "handleClear"), Ce = l(
196
+ (e) => {
197
+ const n = sn(e.target.value, m), u = re(n, m);
198
+ f(n), u != null && u.dateValue.isValid() && B(u.dateValue);
199
+ },
200
+ [m, f]
201
+ ), De = l(
202
+ (e) => {
203
+ e.stopPropagation(), e.nativeEvent.stopImmediatePropagation();
204
+ },
205
+ []
206
+ ), He = l(
207
+ (e) => {
208
+ if (De(e), e.key === "Escape") {
209
+ e.preventDefault(), w.current = Date.now() + 200, f(L), B(g), E(), v();
210
+ return;
211
+ }
212
+ if (e.key === "Tab") {
213
+ if (e.preventDefault(), !z(!0))
214
+ return;
215
+ w.current = Date.now() + 200, E(), ye(e.shiftKey);
216
+ return;
217
+ }
218
+ e.key === "Enter" && (e.preventDefault(), z(!0) && (w.current = Date.now() + 200, E(), v()));
219
+ },
220
+ [
221
+ E,
222
+ z,
223
+ ye,
224
+ v,
225
+ L,
226
+ g,
227
+ f,
228
+ De
229
+ ]
230
+ ), Ue = l(
144
231
  (e) => {
145
- var o;
146
- if ((o = n == null ? void 0 : n.onClick) == null || o.call(n, e), !(e.defaultPrevented || i.disabled || i.readOnly)) {
147
- if (l) {
148
- E.current = !0, a(), queueMicrotask(() => {
149
- E.current = !1;
232
+ var n;
233
+ e.preventDefault(), e.stopPropagation(), o == null || o(""), f(""), B(null), (n = J.current) == null || n.focus();
234
+ },
235
+ [o, f]
236
+ ), We = l(
237
+ (e, n) => {
238
+ if (!(e != null && e.isValid()))
239
+ return;
240
+ const u = e.format(b);
241
+ B(e), f(u), n === _[oe] && (w.current = Date.now() + 200, o == null || o(u), be(), v());
242
+ },
243
+ [
244
+ oe,
245
+ be,
246
+ v,
247
+ b,
248
+ o,
249
+ f,
250
+ _
251
+ ]
252
+ ), qe = l(
253
+ (e) => {
254
+ var n;
255
+ (n = r == null ? void 0 : r.onMouseDown) == null || n.call(r, e), W.current = !0;
256
+ },
257
+ [r]
258
+ ), Ge = l(
259
+ (e) => {
260
+ var n;
261
+ (n = r == null ? void 0 : r.onFocus) == null || n.call(r, e), !(e.defaultPrevented || d.disabled || d.readOnly || I) && (Q.current = W.current, T());
262
+ },
263
+ [T, I, r, d.disabled, d.readOnly]
264
+ ), Xe = l(
265
+ (e) => {
266
+ var n;
267
+ if ((n = r == null ? void 0 : r.onClick) == null || n.call(r, e), !(e.defaultPrevented || d.disabled || d.readOnly)) {
268
+ if (Q.current) {
269
+ Q.current = !1, W.current = !1;
270
+ return;
271
+ }
272
+ if (W.current = !1, I) {
273
+ q.current = !0, M(), queueMicrotask(() => {
274
+ q.current = !1;
150
275
  });
151
276
  return;
152
277
  }
153
278
  T();
154
279
  }
155
280
  },
156
- [a, T, l, n, i.disabled, i.readOnly]
157
- ), de = S(
281
+ [
282
+ M,
283
+ T,
284
+ I,
285
+ r,
286
+ d.disabled,
287
+ d.readOnly
288
+ ]
289
+ ), $e = l(
158
290
  (e) => {
159
- var o;
160
- (o = n == null ? void 0 : n.onKeyDown) == null || o.call(n, e), !(e.defaultPrevented || !l || !De(e)) && a();
291
+ var n;
292
+ if ((n = r == null ? void 0 : r.onKeyDown) == null || n.call(r, e), !(e.defaultPrevented || d.disabled || d.readOnly)) {
293
+ if (!I && ln(e)) {
294
+ e.preventDefault(), T();
295
+ return;
296
+ }
297
+ !I || !un(e) || M();
298
+ }
161
299
  },
162
- [a, l, n]
300
+ [
301
+ M,
302
+ T,
303
+ I,
304
+ r,
305
+ d.disabled,
306
+ d.readOnly
307
+ ]
163
308
  );
164
- we(() => {
165
- if (!l)
309
+ return ee(() => {
310
+ I && (f(L), B(g));
311
+ }, [I, L, g, f]), ee(() => {
312
+ if (!I)
166
313
  return;
167
- const e = /* @__PURE__ */ t((o) => {
168
- var u, C;
169
- const c = o.target;
170
- c instanceof Node && ((u = R.current) != null && u.contains(c) || (C = K.current) != null && C.contains(c) || a());
314
+ const e = window.requestAnimationFrame(() => {
315
+ var n;
316
+ (n = J.current) == null || n.focus();
317
+ });
318
+ return () => {
319
+ window.cancelAnimationFrame(e);
320
+ };
321
+ }, [I]), ee(() => {
322
+ if (!I)
323
+ return;
324
+ const e = /* @__PURE__ */ a((n) => {
325
+ var j, Ee;
326
+ const u = n.target;
327
+ u instanceof Node && ((j = U.current) != null && j.contains(u) || (Ee = de.current) != null && Ee.contains(u) || Ie());
171
328
  }, "handleDocumentMouseDown");
172
329
  return document.addEventListener("mousedown", e, !0), () => {
173
330
  document.removeEventListener("mousedown", e, !0);
174
331
  };
175
- }, [a, l]);
176
- const se = /* @__PURE__ */ t(({ position: e, children: o, ...c }) => /* @__PURE__ */ fe(Me, { position: e, ...c, children: [
177
- e === "end" && re && /* @__PURE__ */ f(
178
- Ie,
332
+ }, [Ie, I]), /* @__PURE__ */ y(nn, { dateAdapter: tn, adapterLocale: Be, children: /* @__PURE__ */ F("div", { ref: U, children: [
333
+ /* @__PURE__ */ y(
334
+ Pe,
179
335
  {
180
- className: "clearButton",
181
- size: "small",
182
- "aria-label": j.clearButtonLabel,
183
- disabled: te,
184
- onClick: /* @__PURE__ */ t((u) => {
185
- u.preventDefault(), u.stopPropagation(), ce();
186
- }, "onClick"),
187
- children: /* @__PURE__ */ f(be, { fontSize: "small" })
188
- }
189
- ),
190
- o
191
- ] }), "TimePickerInputAdornment"), ue = V(
192
- () => Ce((e, o) => {
193
- const { onClick: c, ...u } = e;
194
- return /* @__PURE__ */ f(ke, { ref: o, onClick: /* @__PURE__ */ t((X) => {
195
- c == null || c(X);
196
- const h = X.currentTarget.parentElement, H = h == null ? void 0 : h.parentElement;
197
- (H ? Array.from(H.children).indexOf(h) : -1) === Be && window.setTimeout(a, 0);
198
- }, "handleClick"), ...u });
199
- }),
200
- [a]
201
- );
202
- return /* @__PURE__ */ f(ye, { dateAdapter: Te, adapterLocale: ee, children: /* @__PURE__ */ f("div", { ref: R, children: /* @__PURE__ */ f(
203
- Ee,
204
- {
205
- ...i,
206
- enableAccessibleFieldDOMStructure: !1,
207
- ampm: M,
208
- open: l,
209
- closeOnSelect: x,
210
- timeSteps: F,
211
- label: r,
212
- value: ie,
213
- format: $,
214
- localeText: j,
215
- onChange: ae,
216
- onOpen: T,
217
- onClose: a,
218
- slots: {
219
- ...k,
220
- inputAdornment: se,
221
- digitalClockSectionItem: (k == null ? void 0 : k.digitalClockSectionItem) ?? ue
222
- },
223
- slotProps: {
224
- popper: {
225
- placement: "bottom-end",
226
- ref: /* @__PURE__ */ t((e) => {
227
- K.current = e;
228
- }, "ref"),
229
- modifiers: [
230
- {
231
- name: "offset",
232
- options: {
233
- offset: [0, 7]
336
+ ...d,
337
+ enableAccessibleFieldDOMStructure: !1,
338
+ ampm: O,
339
+ open: !1,
340
+ closeOnSelect: Ae,
341
+ timeSteps: ce,
342
+ label: t,
343
+ value: g,
344
+ views: _,
345
+ format: Se,
346
+ localeText: x,
347
+ onChange: ze,
348
+ onOpen: T,
349
+ onClose: M,
350
+ slots: {
351
+ ...he,
352
+ inputAdornment: /* @__PURE__ */ a(({ position: e, children: n, ...u }) => /* @__PURE__ */ F(pe, { position: e, ...u, children: [
353
+ e === "end" && Ve && /* @__PURE__ */ y(
354
+ we,
355
+ {
356
+ className: "clearButton",
357
+ size: "small",
358
+ tabIndex: -1,
359
+ "aria-label": x.clearButtonLabel,
360
+ disabled: Ke,
361
+ onClick: /* @__PURE__ */ a((j) => {
362
+ j.preventDefault(), j.stopPropagation(), je();
363
+ }, "onClick"),
364
+ children: /* @__PURE__ */ y(ke, { fontSize: "small" })
234
365
  }
235
- }
236
- ]
237
- },
238
- desktopPaper: {
239
- sx: W
240
- },
241
- mobilePaper: {
242
- sx: W
366
+ ),
367
+ n
368
+ ] }), "TimePickerInputAdornment")
243
369
  },
244
- actionBar: {
245
- actions: [],
246
- sx: {
247
- backgroundColor: "#f6f3f4",
248
- minHeight: 44,
249
- padding: "4px 8px",
250
- "& .MuiButton-root": {
251
- minHeight: 28,
252
- minWidth: 48,
253
- padding: "4px 8px",
254
- fontSize: "1.3rem",
255
- lineHeight: 1.2
256
- },
257
- ...y == null ? void 0 : y.sx
370
+ slotProps: {
371
+ ...c,
372
+ openPickerButton: {
373
+ ...typeof (c == null ? void 0 : c.openPickerButton) == "function" || c == null ? void 0 : c.openPickerButton,
374
+ size: "small",
375
+ tabIndex: -1,
376
+ onClick: /* @__PURE__ */ a((e) => {
377
+ e.preventDefault(), e.stopPropagation(), I || T();
378
+ }, "onClick"),
379
+ sx: {
380
+ margin: 0,
381
+ padding: 0
382
+ }
258
383
  },
259
- ...y
260
- },
261
- openPickerButton: {
262
- size: "small",
263
- onClick: /* @__PURE__ */ t((e) => {
264
- e.preventDefault(), e.stopPropagation(), l || T();
265
- }, "onClick"),
266
- sx: {
267
- margin: 0,
268
- padding: 0
269
- }
270
- },
271
- openPickerIcon: {
272
- fontSize: "small"
273
- },
274
- inputAdornment: {
275
- sx: {
276
- marginBottom: 0,
277
- marginLeft: 0,
278
- gap: 0
384
+ openPickerIcon: {
385
+ ...typeof (c == null ? void 0 : c.openPickerIcon) == "function" || c == null ? void 0 : c.openPickerIcon,
386
+ fontSize: "small"
387
+ },
388
+ inputAdornment: {
389
+ ...typeof (c == null ? void 0 : c.inputAdornment) == "function" || c == null ? void 0 : c.inputAdornment,
390
+ sx: {
391
+ marginBottom: 0,
392
+ marginLeft: 0,
393
+ gap: 0,
394
+ ...typeof (c == null ? void 0 : c.inputAdornment) == "function" || (Te = c == null ? void 0 : c.inputAdornment) == null ? void 0 : Te.sx
395
+ }
396
+ },
397
+ textField: {
398
+ variant: s,
399
+ fullWidth: K,
400
+ ...r,
401
+ className: rn(
402
+ !K && (O ? "w-[160px]" : "w-[140px]"),
403
+ r == null ? void 0 : r.className
404
+ ),
405
+ onMouseDown: qe,
406
+ onFocus: Ge,
407
+ onClick: Xe,
408
+ onKeyDown: $e,
409
+ inputRef: ve,
410
+ placeholder: Le,
411
+ sx: Ne
279
412
  }
280
- },
281
- digitalClockItem: {
282
- sx: U
283
- },
284
- digitalClockSectionItem: {
285
- sx: U
286
- },
287
- textField: {
288
- variant: w,
289
- fullWidth: L,
290
- ...n,
291
- className: he(
292
- !L && (M ? "w-[160px]" : "w-[140px]"),
293
- n == null ? void 0 : n.className
294
- ),
295
- onClick: le,
296
- onKeyDown: de,
297
- placeholder: ne,
298
- sx: oe
299
413
  }
300
414
  }
301
- }
302
- ) }) });
415
+ ),
416
+ /* @__PURE__ */ y(
417
+ Ze,
418
+ {
419
+ open: I,
420
+ anchorEl: U.current,
421
+ placement: "bottom-end",
422
+ ref: de,
423
+ modifiers: [
424
+ {
425
+ name: "offset",
426
+ options: {
427
+ offset: [0, 7]
428
+ }
429
+ }
430
+ ],
431
+ sx: { zIndex: /* @__PURE__ */ a((e) => e.zIndex.modal, "zIndex") },
432
+ children: /* @__PURE__ */ F(
433
+ xe,
434
+ {
435
+ elevation: 8,
436
+ onClick: /* @__PURE__ */ a((e) => {
437
+ e.stopPropagation();
438
+ }, "onClick"),
439
+ onKeyDown: /* @__PURE__ */ a((e) => {
440
+ e.stopPropagation();
441
+ }, "onKeyDown"),
442
+ onKeyUp: /* @__PURE__ */ a((e) => {
443
+ e.stopPropagation();
444
+ }, "onKeyUp"),
445
+ onMouseDown: /* @__PURE__ */ a((e) => {
446
+ e.stopPropagation();
447
+ }, "onMouseDown"),
448
+ sx: {
449
+ borderRadius: 1,
450
+ lineHeight: 0,
451
+ overflow: "hidden",
452
+ width: Y
453
+ },
454
+ children: [
455
+ /* @__PURE__ */ y(
456
+ Fe,
457
+ {
458
+ autoFocus: !0,
459
+ inputRef: J,
460
+ fullWidth: !0,
461
+ size: "small",
462
+ value: R,
463
+ error: le,
464
+ helperText: le ? Z(an) : void 0,
465
+ placeholder: b,
466
+ onChange: Ce,
467
+ onKeyDown: He,
468
+ slotProps: {
469
+ htmlInput: {
470
+ inputMode: "numeric",
471
+ "aria-label": b
472
+ },
473
+ input: {
474
+ sx: {
475
+ paddingRight: 0.5
476
+ },
477
+ endAdornment: /* @__PURE__ */ y(
478
+ pe,
479
+ {
480
+ position: "end",
481
+ sx: {
482
+ marginLeft: 0
483
+ },
484
+ children: /* @__PURE__ */ y(
485
+ we,
486
+ {
487
+ size: "small",
488
+ tabIndex: -1,
489
+ "aria-label": x.clearButtonLabel,
490
+ disabled: !R,
491
+ onClick: Ue,
492
+ onMouseDown: /* @__PURE__ */ a((e) => {
493
+ e.preventDefault(), e.stopPropagation();
494
+ }, "onMouseDown"),
495
+ sx: {
496
+ margin: 0,
497
+ padding: 0.25
498
+ },
499
+ children: /* @__PURE__ */ y(ke, { fontSize: "small" })
500
+ }
501
+ )
502
+ }
503
+ )
504
+ }
505
+ },
506
+ sx: {
507
+ boxSizing: "border-box",
508
+ width: Y,
509
+ px: 1,
510
+ py: 1,
511
+ "& .MuiOutlinedInput-root": {
512
+ borderRadius: 0.75,
513
+ fontSize: 13
514
+ }
515
+ }
516
+ }
517
+ ),
518
+ /* @__PURE__ */ y(
519
+ en,
520
+ {
521
+ ampm: O,
522
+ value: Re,
523
+ views: _,
524
+ onChange: /* @__PURE__ */ a((e, n, u) => We(e, u), "onChange"),
525
+ timeSteps: ce,
526
+ slotProps: {
527
+ digitalClockSectionItem: {
528
+ sx: cn
529
+ }
530
+ },
531
+ sx: {
532
+ border: 0,
533
+ width: Y,
534
+ "& .MuiMultiSectionDigitalClockSection-root": {
535
+ border: 0,
536
+ boxSizing: "border-box",
537
+ width: te,
538
+ flex: `0 0 ${te}px`,
539
+ display: "flex",
540
+ flexDirection: "column",
541
+ alignItems: "stretch"
542
+ },
543
+ "& .MuiMultiSectionDigitalClockSection-item": {
544
+ alignSelf: "stretch",
545
+ boxSizing: "border-box",
546
+ width: ge,
547
+ minWidth: ge,
548
+ justifyContent: "center",
549
+ marginLeft: "auto",
550
+ marginRight: "auto"
551
+ }
552
+ }
553
+ }
554
+ )
555
+ ]
556
+ }
557
+ )
558
+ }
559
+ )
560
+ ] }) });
303
561
  }, "OwpTimePicker");
304
562
  export {
305
- We as OwpTimePicker
563
+ On as OwpTimePicker
306
564
  };
307
565
  //# sourceMappingURL=OwpTimePicker.js.map