@owp/core 2.5.17 → 2.5.19

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 (89) hide show
  1. package/dist/_virtual/index10.js +2 -2
  2. package/dist/_virtual/index12.js +2 -2
  3. package/dist/_virtual/index13.js +2 -2
  4. package/dist/_virtual/index14.js +2 -2
  5. package/dist/_virtual/index16.js +4 -4
  6. package/dist/_virtual/index17.js +4 -4
  7. package/dist/_virtual/index18.js +4 -4
  8. package/dist/_virtual/index19.js +4 -4
  9. package/dist/components/OwpPageContent/OwpPageContent.js +14 -12
  10. package/dist/components/OwpPageContent/OwpPageContent.js.map +1 -1
  11. package/dist/components/OwpPageTitle/OwpPageTitle.js +37 -35
  12. package/dist/components/OwpPageTitle/OwpPageTitle.js.map +1 -1
  13. package/dist/components/OwpPicker/OwpDatePicker.js +339 -102
  14. package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
  15. package/dist/components/OwpPicker/OwpDateRangePicker.js +87 -82
  16. package/dist/components/OwpPicker/OwpDateRangePicker.js.map +1 -1
  17. package/dist/components/OwpPicker/OwpTimePicker.js +494 -220
  18. package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
  19. package/dist/components/OwpPicker/constants/index.js +6 -5
  20. package/dist/components/OwpPicker/constants/index.js.map +1 -1
  21. package/dist/components/OwpPicker/internal/DatePickerInput.js +71 -47
  22. package/dist/components/OwpPicker/internal/DatePickerInput.js.map +1 -1
  23. package/dist/components/OwpSection/OwpSection.js +84 -62
  24. package/dist/components/OwpSection/OwpSection.js.map +1 -1
  25. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +42 -40
  26. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
  27. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +273 -224
  28. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  29. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js +476 -105
  30. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js.map +1 -1
  31. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +317 -245
  32. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  33. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +315 -151
  34. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
  35. package/dist/constants/gridTheme.js +9 -7
  36. package/dist/constants/gridTheme.js.map +1 -1
  37. package/dist/constants/treeGrid.js +37 -35
  38. package/dist/constants/treeGrid.js.map +1 -1
  39. package/dist/constants.js +25 -23
  40. package/dist/features/themePreview/configs/grid.js +3 -1
  41. package/dist/features/themePreview/configs/grid.js.map +1 -1
  42. package/dist/features/themePreview/utils/themePreviewDefinitions.js +10 -0
  43. package/dist/features/themePreview/utils/themePreviewDefinitions.js.map +1 -1
  44. package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
  45. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  46. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
  47. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
  48. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
  49. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
  50. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
  51. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
  52. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  53. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
  54. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
  55. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
  56. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
  57. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
  58. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
  59. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
  60. 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
  61. package/dist/owp-app.css +1 -1
  62. package/dist/types/components/OwpPageContent/OwpPageContent.d.ts +3 -1
  63. package/dist/types/components/OwpPageTitle/OwpPageTitle.d.ts +3 -1
  64. package/dist/types/components/OwpPicker/OwpTimePicker.d.ts +3 -1
  65. package/dist/types/components/OwpPicker/constants/index.d.ts +1 -0
  66. package/dist/types/components/OwpPicker/internal/DatePickerInput.d.ts +7 -0
  67. package/dist/types/components/OwpSection/OwpSection.d.ts +3 -1
  68. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +6 -6
  69. package/dist/types/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.d.ts +3 -0
  70. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +33 -7
  71. package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +1 -1
  72. package/dist/types/constants/gridTheme.d.ts +4 -0
  73. package/dist/types/constants/treeGrid.d.ts +3 -1
  74. package/dist/types/features/themePreview/configs/grid.d.ts +2 -0
  75. package/dist/types/features/themePreview/configs/settings.d.ts +2 -0
  76. package/dist/types/types/OwpGridThemeTypes.d.ts +2 -0
  77. package/dist/types/utils/index.d.ts +0 -1
  78. package/dist/types/utils/treeGridUtil.d.ts +42 -3
  79. package/dist/utils/treeGridUtil.js +220 -119
  80. package/dist/utils/treeGridUtil.js.map +1 -1
  81. package/dist/utils.js +90 -86
  82. package/dist/utils.js.map +1 -1
  83. package/package.json +1 -1
  84. package/dist/components/OwpTreeGrid/internal/treeGridColumnEditRules.js +0 -84
  85. package/dist/components/OwpTreeGrid/internal/treeGridColumnEditRules.js.map +0 -1
  86. package/dist/types/components/OwpTreeGrid/internal/treeGridColumnEditRules.d.ts +0 -60
  87. package/dist/types/utils/normalizeTimeToHourMinute.d.ts +0 -11
  88. package/dist/utils/normalizeTimeToHourMinute.js +0 -34
  89. package/dist/utils/normalizeTimeToHourMinute.js.map +0 -1
@@ -1,18 +1,18 @@
1
- var te = Object.defineProperty;
2
- var n = (t, h) => te(t, "name", { value: h, configurable: !0 });
3
- import { jsx as f, jsxs as ae } 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 ie } from "../../hooks/useOwpTranslation.js";
5
- import { ensureDayjsBrowserSetup as le } from "../../utils/dayjsBrowser.js";
6
- import ce 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 { IconButton as se, InputAdornment as de } from "@mui/material";
8
- import { TimePicker as ue, LocalizationProvider as me } from "@mui/x-date-pickers";
9
- import { AdapterDayjs as fe } from "@mui/x-date-pickers/AdapterDayjs";
10
- import { clsx as pe } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
11
- import E from "dayjs";
12
- import { useState as be, useRef as S, useMemo as ge, useCallback as I, useEffect as ke } from "react";
13
- import { VALUE_TIME_FORMATTER as K } from "./constants/index.js";
14
- le();
15
- const T = "––", z = {
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 T = "––", z = {
23
23
  backgroundColor: "var(--owp-datepicker-selected-hover-bg, #039be5)"
24
24
  }
25
25
  }
26
- }, Me = {
26
+ }, on = {
27
27
  "& .MuiInputBase-root": {
28
28
  alignItems: "center"
29
29
  },
@@ -49,243 +49,517 @@ const T = "––", z = {
49
49
  visibility: "visible"
50
50
  }
51
51
  }
52
- }, j = {
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
- }, ye = /* @__PURE__ */ n((t) => t.ctrlKey || t.altKey || t.metaKey ? !1 : t.key.length === 1 || t.key === "Backspace" || t.key === "Delete", "isValueEditingKey"), Re = /* @__PURE__ */ n(({
88
+ }, "assignInputRef"), On = /* @__PURE__ */ a(({
89
89
  label: t,
90
- variant: h = "standard",
91
- sx: N,
92
- value: l,
93
- format: H = K,
94
- useAmPm: V,
95
- placeholder: X,
96
- disabledClearButton: w,
97
- fullWidth: v,
98
- onChange: c,
99
- textFieldProps: o,
100
- localeText: Y,
101
- open: B,
102
- onOpen: p,
103
- onClose: b,
104
- slots: W,
105
- ...a
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
106
107
  }) => {
107
- const g = K, k = V ?? /a/i.test(H), q = k ? "A hh:mm" : g, U = a.closeOnSelect ?? !1, G = {
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 = {
108
110
  minutes: 1,
109
- ...a.timeSteps
110
- }, [J, D] = be(!1), L = S(null), C = S(null), M = S(!1), { t: A, i18n: _ } = ie(), Q = (_.resolvedLanguage ?? _.language ?? "kr") === "kr" ? "ko" : "en", O = {
111
- okButtonLabel: A("Button.확인"),
112
- clearButtonLabel: A("Button.초기화"),
113
- fieldHoursPlaceholder: /* @__PURE__ */ n(() => T, "fieldHoursPlaceholder"),
114
- fieldMinutesPlaceholder: /* @__PURE__ */ n(() => T, "fieldMinutesPlaceholder"),
115
- fieldMeridiemPlaceholder: /* @__PURE__ */ n(() => T, "fieldMeridiemPlaceholder"),
116
- ...Y
117
- }, Z = X ?? (k ? "–– ––:––" : "––:––"), $ = [Me, N, o == null ? void 0 : o.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(
118
124
  Boolean
119
- ), x = !!(w || a.disabled || a.readOnly), F = !!c && !w, d = B !== void 0, i = d ? B : J, P = ge(() => {
120
- if (!l)
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)
121
129
  return null;
122
- if (E.isDayjs(l))
123
- return l;
124
- if (typeof l == "string") {
125
- const r = E(l, g, !0);
126
- return r.isValid() ? r : 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;
127
138
  }
128
- const e = E(l);
139
+ const e = h(i);
129
140
  return e.isValid() ? e : null;
130
- }, [g, l]), ee = /* @__PURE__ */ n((e) => {
131
- c == null || c(e != null && e.isValid() ? e.format(g) : void 0);
132
- }, "handleChange"), y = I(() => {
133
- if (M.current) {
134
- M.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;
135
166
  return;
136
167
  }
137
- d || D(!0), p == null || p();
138
- }, [d, p]), s = I(() => {
139
- d || D(!1), b == null || b();
140
- }, [d, b]), oe = /* @__PURE__ */ n(() => {
141
- c == null || c("");
142
- }, "handleClear"), ne = I(
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(
231
+ (e) => {
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(
143
253
  (e) => {
144
- var r;
145
- if ((r = o == null ? void 0 : o.onClick) == null || r.call(o, e), !(e.defaultPrevented || a.disabled || a.readOnly)) {
146
- if (i) {
147
- M.current = !0, s(), queueMicrotask(() => {
148
- M.current = !1;
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;
149
275
  });
150
276
  return;
151
277
  }
152
- y();
278
+ T();
153
279
  }
154
280
  },
155
- [s, y, i, o, a.disabled, a.readOnly]
156
- ), re = I(
281
+ [
282
+ M,
283
+ T,
284
+ I,
285
+ r,
286
+ d.disabled,
287
+ d.readOnly
288
+ ]
289
+ ), $e = l(
157
290
  (e) => {
158
- var r;
159
- (r = o == null ? void 0 : o.onKeyDown) == null || r.call(o, e), !(e.defaultPrevented || !i || !ye(e)) && s();
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
+ }
160
299
  },
161
- [s, i, o]
300
+ [
301
+ M,
302
+ T,
303
+ I,
304
+ r,
305
+ d.disabled,
306
+ d.readOnly
307
+ ]
162
308
  );
163
- return ke(() => {
164
- if (!i)
309
+ return ee(() => {
310
+ I && (f(L), B(g));
311
+ }, [I, L, g, f]), ee(() => {
312
+ if (!I)
165
313
  return;
166
- const e = /* @__PURE__ */ n((r) => {
167
- var m, R;
168
- const u = r.target;
169
- u instanceof Node && ((m = L.current) != null && m.contains(u) || (R = C.current) != null && R.contains(u) || s());
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());
170
328
  }, "handleDocumentMouseDown");
171
329
  return document.addEventListener("mousedown", e, !0), () => {
172
330
  document.removeEventListener("mousedown", e, !0);
173
331
  };
174
- }, [s, i]), /* @__PURE__ */ f(me, { dateAdapter: fe, adapterLocale: Q, children: /* @__PURE__ */ f("div", { ref: L, children: /* @__PURE__ */ f(
175
- ue,
176
- {
177
- ...a,
178
- enableAccessibleFieldDOMStructure: !1,
179
- ampm: k,
180
- open: i,
181
- closeOnSelect: U,
182
- timeSteps: G,
183
- label: t,
184
- value: P,
185
- format: q,
186
- localeText: O,
187
- onChange: ee,
188
- onOpen: y,
189
- onClose: s,
190
- slots: {
191
- ...W,
192
- inputAdornment: /* @__PURE__ */ n(({ position: e, children: r, ...u }) => /* @__PURE__ */ ae(de, { position: e, ...u, children: [
193
- e === "end" && F && /* @__PURE__ */ f(
194
- se,
195
- {
196
- className: "clearButton",
197
- size: "small",
198
- "aria-label": O.clearButtonLabel,
199
- disabled: x,
200
- onClick: /* @__PURE__ */ n((m) => {
201
- m.preventDefault(), m.stopPropagation(), oe();
202
- }, "onClick"),
203
- children: /* @__PURE__ */ f(ce, { fontSize: "small" })
204
- }
205
- ),
206
- r
207
- ] }), "TimePickerInputAdornment")
208
- },
209
- slotProps: {
210
- popper: {
211
- placement: "bottom-end",
212
- ref: /* @__PURE__ */ n((e) => {
213
- C.current = e;
214
- }, "ref"),
215
- modifiers: [
216
- {
217
- name: "offset",
218
- options: {
219
- offset: [0, 7]
332
+ }, [Ie, I]), /* @__PURE__ */ y(nn, { dateAdapter: tn, adapterLocale: Be, children: /* @__PURE__ */ F("div", { ref: U, children: [
333
+ /* @__PURE__ */ y(
334
+ Pe,
335
+ {
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" })
220
365
  }
221
- }
222
- ]
366
+ ),
367
+ n
368
+ ] }), "TimePickerInputAdornment")
223
369
  },
224
- desktopPaper: {
225
- sx: j
226
- },
227
- mobilePaper: {
228
- sx: j
229
- },
230
- actionBar: {
231
- actions: ["accept"],
232
- sx: {
233
- backgroundColor: "#f6f3f4",
234
- minHeight: 44,
235
- padding: "4px 8px",
236
- "& .MuiButton-root": {
237
- minHeight: 28,
238
- minWidth: 48,
239
- padding: "4px 8px",
240
- fontSize: "1.3rem",
241
- lineHeight: 1.2
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
242
382
  }
383
+ },
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
243
412
  }
244
- },
245
- openPickerButton: {
246
- size: "small",
247
- onClick: /* @__PURE__ */ n((e) => {
248
- e.preventDefault(), e.stopPropagation(), i || y();
249
- }, "onClick"),
250
- sx: {
251
- margin: 0,
252
- padding: 0
413
+ }
414
+ }
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
+ }
253
429
  }
254
- },
255
- openPickerIcon: {
256
- fontSize: "small"
257
- },
258
- inputAdornment: {
259
- sx: {
260
- marginBottom: 0,
261
- marginLeft: 0,
262
- gap: 0
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
+ ]
263
556
  }
264
- },
265
- digitalClockItem: {
266
- sx: z
267
- },
268
- digitalClockSectionItem: {
269
- sx: z
270
- },
271
- textField: {
272
- variant: h,
273
- fullWidth: v,
274
- ...o,
275
- className: pe(
276
- !v && (k ? "w-[160px]" : "w-[140px]"),
277
- o == null ? void 0 : o.className
278
- ),
279
- onClick: ne,
280
- onKeyDown: re,
281
- placeholder: Z,
282
- sx: $
283
- }
557
+ )
284
558
  }
285
- }
286
- ) }) });
559
+ )
560
+ ] }) });
287
561
  }, "OwpTimePicker");
288
562
  export {
289
- Re as OwpTimePicker
563
+ On as OwpTimePicker
290
564
  };
291
565
  //# sourceMappingURL=OwpTimePicker.js.map