@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,117 +1,380 @@
1
- var K = Object.defineProperty;
2
- var l = (e, a) => K(e, "name", { value: a, configurable: !0 });
3
- import { jsx as T } 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 { VALUE_TIME_FORMATTER as b, VALUE_DATE_FORMATTER as _ } from "../../../OwpPicker/constants/index.js";
5
- import { useOwpTranslation as U } from "../../../../hooks/useOwpTranslation.js";
6
- import $ from "@mui/material/ClickAwayListener";
7
- import j from "@mui/material/Paper";
8
- import V from "@mui/material/Popper";
9
- import { enUS as z } from "../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js";
10
- import { ko as H } from "../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/ko.js";
11
- import w from "dayjs";
12
- import { useState as N, useMemo as c, useEffect as y, useCallback as v } from "react";
13
- import { DatePicker as q, registerLocale as L, setDefaultLocale as J } from "../../../../node_modules/.pnpm/react-datepicker@8.7.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-datepicker/dist/index.es.js";
14
- L("ko", H);
15
- L("en", z);
16
- J("ko");
17
- const Q = `${_} ${b}`, S = "", W = "OwpTreeGridDatePickerEditor", X = /* @__PURE__ */ l((e) => (e == null ? void 0 : e.enabled) !== !1, "isDatePickerEditorEnabled"), Y = /* @__PURE__ */ l((e, a, o) => !(o != null && o.showTimeInput) && !(o != null && o.showTimeSelect) ? _ : a.size === 0 || a.has(e) ? Q : _, "getDatePickerEditorValueFormatter"), k = /* @__PURE__ */ l((e) => e === 1 || e === "1", "isTreeGridCanEditEnabled"), Z = /* @__PURE__ */ l((e) => e === 0 || e === "0" || e === !1, "isTreeGridCanEditDisabled"), f = /* @__PURE__ */ l((e) => !e || e.Fixed === "Foot" ? !1 : e.Kind === "Data" || k(e.Added), "isDisplayTreeGridRow"), g = /* @__PURE__ */ l((e, a, o, d) => {
1
+ var $t = Object.defineProperty;
2
+ var a = (t, n) => $t(t, "name", { value: n, configurable: !0 });
3
+ import { jsx as I, jsxs as Vt } 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 { PICKER_INVALID_INPUT_MESSAGE_KEY as zt, VALUE_TIME_FORMATTER as S, VALUE_DATE_FORMATTER as k, VALUE_MONTH_FORMATTER as L, VALUE_YEAR_FORMATTER as $ } from "../../../OwpPicker/constants/index.js";
5
+ import { useOwpTranslation as jt } from "../../../../hooks/useOwpTranslation.js";
6
+ import { ensureDayjsBrowserSetup as Ut } from "../../../../utils/dayjsBrowser.js";
7
+ import Nt 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";
8
+ import Wt from "@mui/material/ClickAwayListener";
9
+ import qt from "@mui/material/IconButton";
10
+ import Xt from "@mui/material/InputAdornment";
11
+ import Jt from "@mui/material/Paper";
12
+ import Qt from "@mui/material/Popper";
13
+ import Zt from "@mui/material/TextField";
14
+ import { LocalizationProvider as gt, MultiSectionDigitalClock as te } from "@mui/x-date-pickers";
15
+ import { AdapterDayjs as ee } from "@mui/x-date-pickers/AdapterDayjs";
16
+ import { enUS as re } from "../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js";
17
+ import { ko as ne } from "../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/ko.js";
18
+ import R from "dayjs";
19
+ import { useState as q, useRef as mt, useMemo as b, useEffect as X, useCallback as y } from "react";
20
+ import { DatePicker as oe, registerLocale as ht, setDefaultLocale as ie } from "../../../../node_modules/.pnpm/react-datepicker@8.7.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-datepicker/dist/index.es.js";
21
+ ht("ko", ne);
22
+ ht("en", re);
23
+ ie("ko");
24
+ Ut();
25
+ const V = `${k} ${S}`, v = `${S}:ss`, O = `${k} ${v}`, pt = "", It = "OwpTreeGridDatePickerEditor", se = "OwpTreeGridTimePickerEditor", ae = '<span class="OwpTreeGridTimePickerEditorIcon" aria-hidden="true"></span>', Q = "MM", Z = "DD", J = 64, Et = 56, Dt = /* @__PURE__ */ new Map([
26
+ ["yyyy", $],
27
+ ["YYYY", $],
28
+ ["mm", Q],
29
+ ["MM", Q],
30
+ ["dd", Z],
31
+ ["DD", Z],
32
+ ["yyyy-mm", L],
33
+ ["YYYY-MM", L],
34
+ ["yyyy-mm-dd", k],
35
+ ["YYYY-MM-DD", k],
36
+ ["HH:mm", S],
37
+ ["HH:mm:ss", v],
38
+ ["yyyy-mm-dd HH:mm", V],
39
+ ["YYYY-MM-DD HH:mm", V],
40
+ ["yyyy-mm-dd HH:mm:ss", O],
41
+ ["YYYY-MM-DD HH:mm:ss", O]
42
+ ]), le = {
43
+ "&:hover": {
44
+ backgroundColor: "var(--owp-datepicker-hover-bg, rgba(3, 155, 229, 0.14))"
45
+ },
46
+ "&.Mui-selected": {
47
+ backgroundColor: "var(--owp-datepicker-selected-bg, #039be5)",
48
+ color: "var(--owp-datepicker-selected-color, #fff)",
49
+ "&:focus-visible, &:hover": {
50
+ backgroundColor: "var(--owp-datepicker-selected-hover-bg, #039be5)"
51
+ }
52
+ }
53
+ }, ce = /* @__PURE__ */ a((t) => (t == null ? void 0 : t.enabled) !== !1, "isDatePickerEditorEnabled"), ue = /* @__PURE__ */ a((t) => t == null ? void 0 : t.trim().replace(/\s+/g, " "), "normalizeTreeGridDateFormat"), ft = /* @__PURE__ */ a((t) => {
54
+ const n = ue(t);
55
+ return n ? Dt.get(n) ?? Dt.get(n.toLowerCase()) ?? null : null;
56
+ }, "convertTreeGridDateFormatToDayjs"), g = /* @__PURE__ */ a((t) => {
57
+ switch (t) {
58
+ case $:
59
+ return { kind: "year", valueFormat: t, inputLength: 4, digitLength: 4 };
60
+ case Q:
61
+ return { kind: "month", valueFormat: t, inputLength: 2, digitLength: 2 };
62
+ case L:
63
+ return { kind: "yearMonth", valueFormat: t, inputLength: 7, digitLength: 6 };
64
+ case Z:
65
+ return { kind: "day", valueFormat: t, inputLength: 2, digitLength: 2 };
66
+ case S:
67
+ return { kind: "time", valueFormat: t, inputLength: 5, digitLength: 4 };
68
+ case v:
69
+ return { kind: "time", valueFormat: t, inputLength: 8, digitLength: 6 };
70
+ case V:
71
+ return { kind: "dateTime", valueFormat: t, inputLength: 16, digitLength: 12 };
72
+ case O:
73
+ return { kind: "dateTime", valueFormat: t, inputLength: 19, digitLength: 14 };
74
+ default:
75
+ return { kind: "date", valueFormat: t, inputLength: 10, digitLength: 8 };
76
+ }
77
+ }, "getDatePickerEditorFormatMeta"), kt = /* @__PURE__ */ a((t, n) => {
78
+ var e;
79
+ if (!t)
80
+ return g(k);
81
+ const o = t.row, s = (e = t.grid.Cols) == null ? void 0 : e[t.col], c = o[`${t.col}EditFormat`] ?? o[`${t.col}Format`] ?? (s == null ? void 0 : s.EditFormat) ?? (s == null ? void 0 : s.Format), l = ft(
82
+ typeof c == "string" ? c : void 0
83
+ ) ?? (n != null && n.showTimeInput || n != null && n.showTimeSelect ? V : k);
84
+ return g(l);
85
+ }, "resolveDatePickerEditorFormatMeta"), _t = /* @__PURE__ */ a((t, n) => {
86
+ const o = t.replace(/\D/g, "").slice(0, n.digitLength), s = o.slice(0, 4), c = o.slice(4, 6), l = o.slice(6, 8), e = o.slice(8, 10), p = o.slice(10, 12), u = o.slice(12, 14);
87
+ switch (n.kind) {
88
+ case "year":
89
+ case "month":
90
+ case "day":
91
+ return o;
92
+ case "yearMonth":
93
+ return [s, c].filter(Boolean).join("-");
94
+ case "time":
95
+ return [o.slice(0, 2), o.slice(2, 4), o.slice(4, 6)].filter(Boolean).join(":");
96
+ case "dateTime":
97
+ return [s, c, l].filter(Boolean).join("-") + (e ? ` ${e}` : "") + (p ? `:${p}` : "") + (u ? `:${u}` : "");
98
+ default:
99
+ return [s, c, l].filter(Boolean).join("-");
100
+ }
101
+ }, "formatDatePickerEditorInput"), de = /* @__PURE__ */ a((t, n) => t.length === n.inputLength, "isCompleteDatePickerEditorInput"), me = /* @__PURE__ */ a((t, n, o, s) => {
102
+ var c, l, e, p;
103
+ return o.kind === "month" ? `${((l = (c = s == null ? void 0 : s.columnOptions) == null ? void 0 : c[t]) == null ? void 0 : l.baseYear) ?? R().format($)}-${n}` : o.kind === "day" ? `${((p = (e = s == null ? void 0 : s.columnOptions) == null ? void 0 : e[t]) == null ? void 0 : p.baseYearMonth) ?? R().format(L)}-${n}` : n;
104
+ }, "resolvePartialDatePickerEditorInputValue"), pe = /* @__PURE__ */ a((t) => t.kind === "month" ? L : t.kind === "day" ? k : t.valueFormat, "resolvePartialDatePickerEditorInputFormat"), tt = /* @__PURE__ */ a((t, n, o, s) => {
105
+ if (!n)
106
+ return null;
107
+ if (o.kind === "year") {
108
+ const p = `${n}-01-01`, u = R(p, k, !0);
109
+ return u.isValid() && u.format(k) === p ? u : null;
110
+ }
111
+ if (o.kind === "yearMonth") {
112
+ const p = `${n}-01`, u = R(p, k, !0);
113
+ return u.isValid() && u.format(k) === p ? u : null;
114
+ }
115
+ const c = me(t, n, o, s), l = pe(o), e = R(c, l, !0);
116
+ return e.isValid() && e.format(l) === c ? e : null;
117
+ }, "parseDatePickerEditorValue"), Ee = /* @__PURE__ */ a((t) => {
118
+ switch (t.kind) {
119
+ case "year":
120
+ return "yyyy";
121
+ case "month":
122
+ return "MM";
123
+ case "yearMonth":
124
+ return "yyyy-MM";
125
+ case "day":
126
+ return "dd";
127
+ case "dateTime":
128
+ return t.valueFormat === O ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd HH:mm";
129
+ default:
130
+ return "yyyy-MM-dd";
131
+ }
132
+ }, "getReactDatePickerDisplayFormat"), A = /* @__PURE__ */ a((t, n, o, s) => de(n, o) && !!tt(t, n, o, s), "isValidDatePickerEditorInput"), yt = /* @__PURE__ */ a((t) => t.valueFormat === v || t.valueFormat === O, "hasDatePickerEditorSeconds"), De = /* @__PURE__ */ a((t, n) => {
133
+ const o = n ? t.ActionTabLeft : t.ActionTabRight;
134
+ o == null || o.call(t, 1, 0);
135
+ }, "moveTreeGridDatePickerEditorFocusByTab"), ke = /* @__PURE__ */ a((t, n, o) => {
136
+ t.Focus(n, o, void 0, void 0, 1);
137
+ }, "focusTreeGridDatePickerEditorCell"), ye = /* @__PURE__ */ a((t, n) => {
138
+ const o = (t == null ? void 0 : t.split(/\s+/).filter(Boolean)) ?? [];
139
+ return o.includes(n) ? t : [...o, n].join(" ");
140
+ }, "appendTreeGridClass"), Te = /* @__PURE__ */ a((t, n, o, s) => {
141
+ var u, f, x, _;
142
+ const c = (u = t.GetStringEdit) == null ? void 0 : u.call(t, n, o), l = (f = t.GetString) == null ? void 0 : f.call(t, n, o), e = (x = t.GetValue) == null ? void 0 : x.call(t, n, o), p = (_ = s.textContent) == null ? void 0 : _.trim();
143
+ return String(c || l || p || e || "");
144
+ }, "resolveDatePickerEditorInitialValue"), he = /* @__PURE__ */ a((t, n, o, s) => {
145
+ if (!n)
146
+ return "";
147
+ if (A(t, n, o, s))
148
+ return n;
149
+ const c = _t(n, o);
150
+ return A(t, c, o, s) ? c : n;
151
+ }, "normalizeDatePickerEditorInitialValue"), Ie = /* @__PURE__ */ a((t, n) => {
152
+ const o = n;
153
+ return o.ctrlKey || o.altKey || o.metaKey ? !1 : /^\d$/.test(t) || /^\d$/.test(o.key) || t === "F2" || t === "Backspace" || t === "Delete" || o.key === "F2" || o.key === "Backspace" || o.key === "Delete";
154
+ }, "isDatePickerEditorStartKey"), Tt = /* @__PURE__ */ a((t) => {
155
+ const n = t.target;
156
+ return n instanceof Element && !!n.closest(`.${It}`);
157
+ }, "isDatePickerEditorEventTarget"), z = /* @__PURE__ */ a((t) => t === 1 || t === "1", "isTreeGridCanEditEnabled"), fe = /* @__PURE__ */ a((t) => t === 0 || t === "0" || t === !1, "isTreeGridCanEditDisabled"), _e = /* @__PURE__ */ a((t) => !t || t.Fixed === "Foot" ? !1 : t.Kind === "Data" || z(t.Added), "isDisplayTreeGridRow"), G = /* @__PURE__ */ a((t, n, o, s) => {
18
158
  var u;
19
- if (d.size > 0 && !d.has(o))
159
+ if (s.size > 0 && !s.has(o))
20
160
  return !1;
21
- const s = (u = e.Cols) == null ? void 0 : u[o], n = a[`${o}CanEdit`], t = n != null, p = k(t ? n : s == null ? void 0 : s.CanEdit);
22
- return (s == null ? void 0 : s.Type) === "Date" && f(a) && !Z(a.CanEdit) && p && a.Deleted !== 1;
23
- }, "isEditableDatePickerCell"), ee = /* @__PURE__ */ l((e, a) => {
24
- var d;
25
- if (!e)
161
+ const c = (u = t.Cols) == null ? void 0 : u[o], l = n[`${o}CanEdit`], e = l != null, p = z(e ? l : c == null ? void 0 : c.CanEdit);
162
+ return (c == null ? void 0 : c.Type) === "Date" && _e(n) && !fe(n.CanEdit) && p && n.Deleted !== 1;
163
+ }, "isEditableDatePickerCell"), Ce = /* @__PURE__ */ a((t, n) => {
164
+ var s;
165
+ if (!t)
26
166
  return;
27
- (a.length > 0 ? a : Object.keys(e.Cols ?? {}).filter((s) => {
28
- var n, t;
29
- return ((t = (n = e.Cols) == null ? void 0 : n[s]) == null ? void 0 : t.Type) === "Date";
30
- })).forEach((s) => {
31
- var t;
32
- const n = (t = e.Cols) == null ? void 0 : t[s];
33
- !n || n.Type !== "Date" || !k(n.CanEdit) || (n.Button = "Date", n.OnClickSideDate = "Focus", n.AutoCalendar = 0, n.CalendarButtons = 0);
34
- }), (d = e.Rerender) == null || d.call(e, 1, 1);
35
- }, "configureTreeGridDatePickerColumns"), ke = /* @__PURE__ */ l(({
36
- config: e,
37
- treeGridInstanceRef: a,
167
+ (n.length > 0 ? n : Object.keys(t.Cols ?? {}).filter((c) => {
168
+ var l, e;
169
+ return ((e = (l = t.Cols) == null ? void 0 : l[c]) == null ? void 0 : e.Type) === "Date";
170
+ })).forEach((c) => {
171
+ var u;
172
+ const l = (u = t.Cols) == null ? void 0 : u[c];
173
+ if (!l || l.Type !== "Date" || !z(l.CanEdit))
174
+ return;
175
+ l.AutoCalendar = 0, l.CalendarButtons = 0;
176
+ const e = l.EditFormat ?? l.Format, p = ft(
177
+ typeof e == "string" ? e : void 0
178
+ ) ?? k;
179
+ g(p).kind === "time" ? (l.Button = "Html", l.ButtonText = ae, l.OnClickSide = "Focus", l.Class = ye(l.Class, se)) : (l.Button = "Date", l.OnClickSideDate = "Focus");
180
+ }), (s = t.Rerender) == null || s.call(t, 1, 1);
181
+ }, "configureTreeGridDatePickerColumns"), je = /* @__PURE__ */ a(({
182
+ config: t,
183
+ treeGridInstanceRef: n,
38
184
  isTreeGridReady: o,
39
- onValueChange: d
185
+ onValueChange: s
40
186
  }) => {
41
- var R;
42
- const { t: s, i18n: n } = U(), [t, p] = N(null), u = X(e), D = ((R = e == null ? void 0 : e.columns) == null ? void 0 : R.join(S)) ?? "", C = c(
43
- () => D ? D.split(S) : [],
44
- [D]
45
- ), h = c(() => new Set(C), [C]), O = (n.resolvedLanguage ?? n.language ?? "kr") === "kr" ? "ko" : "en";
46
- y(() => {
47
- !u || !o || ee(a.current, C);
48
- }, [C, u, o, a]);
49
- const m = v(() => {
187
+ var dt;
188
+ const { t: c, i18n: l } = jt(), [e, p] = q(null), [u, f] = q(""), [x, _] = q(!1), et = mt(null), M = mt(!1), T = ce(t), j = ((dt = t == null ? void 0 : t.columns) == null ? void 0 : dt.join(pt)) ?? "", K = b(
189
+ () => j ? j.split(pt) : [],
190
+ [j]
191
+ ), C = b(() => new Set(K), [K]), rt = l.resolvedLanguage ?? l.language ?? "kr", Ct = rt === "kr" ? "ko" : "en", Pt = rt === "kr" ? "ko" : "en", U = (t == null ? void 0 : t.allowInput) !== !1, m = b(
192
+ () => kt(e, t),
193
+ [t, e]
194
+ );
195
+ X(() => {
196
+ !T || !o || Ce(n.current, K);
197
+ }, [K, T, o, n]);
198
+ const h = y(() => {
50
199
  p(null);
51
- }, []), F = v(
52
- (r, i, E, ne, ae, A) => {
53
- if (!u || !g(r, i, E, h)) {
54
- m();
200
+ }, []), P = y(
201
+ (r, i, d) => {
202
+ ke(r, i, d);
203
+ const E = r.GetCell(i, d);
204
+ if (!E)
205
+ return;
206
+ const D = {
207
+ grid: r,
208
+ row: i,
209
+ col: d,
210
+ anchorRect: E.getBoundingClientRect(),
211
+ value: Te(r, i, d, E)
212
+ }, w = kt(D, t), F = {
213
+ ...D,
214
+ value: he(
215
+ d,
216
+ D.value,
217
+ w,
218
+ t
219
+ )
220
+ };
221
+ return M.current = !1, _(!1), f(F.value ?? ""), p(F), 1;
222
+ },
223
+ [t]
224
+ ), Rt = y(
225
+ (r, i, d, E, D, w) => {
226
+ var F;
227
+ if (!T || !G(r, i, d, C)) {
228
+ h();
55
229
  return;
56
230
  }
57
- const I = r.GetCell(i, E);
58
- if (I)
59
- return A.preventDefault(), A.stopPropagation(), p({
60
- grid: r,
61
- row: i,
62
- col: E,
63
- anchorRect: I.getBoundingClientRect(),
64
- value: r.GetString(i, E) || r.GetValue(i, E)
65
- }), 1;
231
+ return (F = r.CloseDialog) == null || F.call(r), w.preventDefault(), w.stopPropagation(), P(r, i, d);
232
+ },
233
+ [h, C, T, P]
234
+ ), Mt = y(
235
+ (r, i, d, E) => {
236
+ var D;
237
+ if (!(!T || !G(r, i, d, C)))
238
+ return (D = r.CloseDialog) == null || D.call(r), E.preventDefault(), E.stopPropagation(), P(r, i, d);
239
+ },
240
+ [C, T, P]
241
+ ), wt = y(
242
+ (r, i, d) => {
243
+ var w;
244
+ if (Tt(d))
245
+ return 1;
246
+ const E = r.FRow || r.ARow, D = r.FCol || r.ACol;
247
+ if (!(!T || !E || !D || !G(r, E, D, C) || !Ie(i, d)))
248
+ return (w = r.CloseDialog) == null || w.call(r), d.preventDefault(), d.stopPropagation(), P(r, E, D);
66
249
  },
67
- [m, h, u]
68
- ), M = c(() => {
69
- if (!(t != null && t.value))
250
+ [C, T, P]
251
+ ), bt = y(
252
+ (r, i, d) => {
253
+ var E;
254
+ if (!(!T || !G(r, i, d, C)))
255
+ return (E = r.CloseDialog) == null || E.call(r), P(r, i, d), !0;
256
+ },
257
+ [C, T, P]
258
+ ), Ft = b(() => {
259
+ var i;
260
+ if (!e || m.kind === "time")
261
+ return null;
262
+ const r = A(
263
+ e.col,
264
+ u,
265
+ m,
266
+ t
267
+ ) ? tt(e.col, u, m, t) : null;
268
+ return r ? r.toDate() : ((i = tt(
269
+ e.col,
270
+ e.value,
271
+ m,
272
+ t
273
+ )) == null ? void 0 : i.toDate()) ?? null;
274
+ }, [t, e, m, u]), At = b(() => {
275
+ if (m.kind !== "time")
70
276
  return null;
71
- const r = w(t.value);
72
- return r.isValid() ? r.toDate() : null;
73
- }, [t == null ? void 0 : t.value]), x = c(() => t ? {
74
- getBoundingClientRect: /* @__PURE__ */ l(() => t.anchorRect, "getBoundingClientRect")
75
- } : null, [t]), G = c(() => {
277
+ const r = R(u, m.valueFormat, !0);
278
+ if (r.isValid())
279
+ return r;
280
+ if (!(e != null && e.value))
281
+ return null;
282
+ const i = R(e.value, m.valueFormat, !0);
283
+ return i.isValid() ? i : null;
284
+ }, [e == null ? void 0 : e.value, m, u]), Lt = b(() => e ? {
285
+ getBoundingClientRect: /* @__PURE__ */ a(() => e.anchorRect, "getBoundingClientRect")
286
+ } : null, [e]), Ot = b(() => {
76
287
  if (!(typeof document > "u"))
77
288
  return document.getElementById("calendar-portal") ?? void 0;
78
- }, []), B = /* @__PURE__ */ l((r) => {
79
- if (!t)
289
+ }, []), St = /* @__PURE__ */ a((r) => {
290
+ if (!e)
291
+ return;
292
+ const i = r ? R(r).format(m.valueFormat) : "";
293
+ M.current = !0, f(i), e.grid.SetString(e.row, e.col, i, 1), s == null || s(e.grid, e.row, e.col, i), h();
294
+ }, "handleDateSelect"), vt = /* @__PURE__ */ a((r, i) => {
295
+ if (!e)
80
296
  return;
81
- const i = r ? w(r).format(Y(t.col, h, e)) : "";
82
- t.grid.SetString(t.row, t.col, i, 1), d == null || d(t.grid, t.row, t.col, i), m();
83
- }, "handleSelect"), P = /* @__PURE__ */ l((r) => {
297
+ const d = r != null && r.isValid() ? r.format(m.valueFormat) : "", E = i === (yt(m) ? "seconds" : "minutes");
298
+ E && (M.current = !0), f(d), e.grid.SetString(e.row, e.col, d, 1), s == null || s(e.grid, e.row, e.col, d), p((D) => D && { ...D, value: d }), E && h();
299
+ }, "handleTimeSelect"), nt = y(
300
+ (r) => {
301
+ e && (e.grid.SetString(e.row, e.col, r, 1), s == null || s(e.grid, e.row, e.col, r));
302
+ },
303
+ [e, s]
304
+ ), Y = y(() => !e || u !== "" && !A(e.col, u, m, t) ? (e && u && _(!0), !1) : (M.current = !0, _(!1), nt(u), !0), [nt, t, e, m, u]), xt = y(() => {
305
+ Y(), h();
306
+ }, [h, Y]), Kt = /* @__PURE__ */ a((r) => {
307
+ e && (f(_t(r.target.value, m)), _(!1));
308
+ }, "handleInputChange"), H = y(
309
+ (r, i) => {
310
+ if (!e || r !== "Enter" && r !== "Tab" || !Y())
311
+ return !1;
312
+ const { grid: d } = e, E = r === "Tab";
313
+ return h(), E && window.requestAnimationFrame(() => {
314
+ De(d, i);
315
+ }), !0;
316
+ },
317
+ [h, Y, e]
318
+ ), ot = y(
319
+ (r) => {
320
+ r.key !== "Enter" && r.key !== "Tab" || (r.preventDefault(), H(r.key, r.shiftKey));
321
+ },
322
+ [H]
323
+ ), Yt = /* @__PURE__ */ a((r) => {
324
+ r.stopPropagation(), r.nativeEvent.stopImmediatePropagation(), ot(r);
325
+ }, "handleInputKeyDown"), Ht = /* @__PURE__ */ a((r) => {
326
+ r.preventDefault(), r.stopPropagation(), e && (M.current = !0, e.grid.SetString(e.row, e.col, "", 1), s == null || s(e.grid, e.row, e.col, ""), f(""), _(!1), p((i) => i && { ...i, value: "" }));
327
+ }, "handleInputClear"), it = /* @__PURE__ */ a((r) => {
84
328
  r.stopPropagation();
85
- }, "handleEditorMouseEvent");
86
- return y(() => {
87
- if (!t)
329
+ }, "handleEditorMouseEvent"), st = /* @__PURE__ */ a((r) => {
330
+ r.stopPropagation(), r.nativeEvent.stopImmediatePropagation(), ot(r);
331
+ }, "handleEditorKeyboardEvent"), B = u, at = e == null ? void 0 : e.grid, lt = e == null ? void 0 : e.row, ct = e == null ? void 0 : e.col, ut = x && !M.current && !!B && !A((e == null ? void 0 : e.col) ?? "", B, m, t), N = yt(m), W = J * (N ? 3 : 2), Bt = N ? ["hours", "minutes", "seconds"] : ["hours", "minutes"], Gt = N ? v : S;
332
+ return X(() => {
333
+ if (!e)
88
334
  return;
89
- const r = /* @__PURE__ */ l((i) => {
90
- i.key === "Escape" && m();
335
+ const r = /* @__PURE__ */ a((i) => {
336
+ if (i.key === "Escape") {
337
+ h();
338
+ return;
339
+ }
340
+ i.key !== "Enter" && i.key !== "Tab" || Tt(i) && (i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), H(i.key, i.shiftKey));
91
341
  }, "handleKeyDown");
92
- return window.addEventListener("keydown", r), () => {
93
- window.removeEventListener("keydown", r);
342
+ return window.addEventListener("keydown", r, !0), () => {
343
+ window.removeEventListener("keydown", r, !0);
344
+ };
345
+ }, [h, H, e]), X(() => {
346
+ if (!at || !lt || !ct || !U)
347
+ return;
348
+ const r = window.requestAnimationFrame(() => {
349
+ var i;
350
+ (i = et.current) == null || i.focus();
351
+ });
352
+ return () => {
353
+ window.cancelAnimationFrame(r);
94
354
  };
95
- }, [m, t]), {
96
- datePickerEditorElement: t ? /* @__PURE__ */ T(
97
- V,
355
+ }, [U, ct, at, lt]), {
356
+ datePickerEditorElement: e ? /* @__PURE__ */ I(
357
+ Qt,
98
358
  {
99
359
  open: !0,
100
- anchorEl: x,
101
- container: G,
360
+ anchorEl: Lt,
361
+ container: Ot,
102
362
  placement: "bottom-start",
103
363
  sx: { zIndex: 1400 },
104
- children: /* @__PURE__ */ T($, { onClickAway: m, children: /* @__PURE__ */ T(
105
- j,
364
+ children: /* @__PURE__ */ I(Wt, { onClickAway: xt, children: /* @__PURE__ */ Vt(
365
+ Jt,
106
366
  {
107
- className: W,
367
+ className: It,
108
368
  elevation: 8,
109
- onClick: P,
110
- onMouseDown: P,
369
+ onClick: it,
370
+ onKeyDown: st,
371
+ onKeyUp: st,
372
+ onMouseDown: it,
111
373
  sx: {
112
374
  borderRadius: 1,
113
375
  lineHeight: 0,
114
376
  overflow: "hidden",
377
+ width: m.kind === "time" ? W : "auto",
115
378
  "& .react-datepicker": {
116
379
  border: 0,
117
380
  display: "block",
@@ -124,30 +387,138 @@ const Q = `${_} ${b}`, S = "", W = "OwpTreeGridDatePickerEditor", X = /* @__PUR
124
387
  marginBottom: 0
125
388
  }
126
389
  },
127
- children: /* @__PURE__ */ T(
128
- q,
129
- {
130
- inline: !0,
131
- locale: O,
132
- selected: M,
133
- onChange: /* @__PURE__ */ l((r) => B(r), "onChange"),
134
- showTimeInput: e == null ? void 0 : e.showTimeInput,
135
- showTimeSelect: e == null ? void 0 : e.showTimeSelect,
136
- timeIntervals: e == null ? void 0 : e.timeIntervals,
137
- dateFormat: e != null && e.showTimeInput || e != null && e.showTimeSelect ? "Pp" : "P",
138
- timeFormat: b,
139
- timeCaption: `${s("Common.시간")}: `,
140
- timeInputLabel: `${s("Common.시간")}: `
141
- }
142
- )
390
+ children: [
391
+ U && /* @__PURE__ */ I(
392
+ Zt,
393
+ {
394
+ autoFocus: !0,
395
+ inputRef: et,
396
+ fullWidth: !0,
397
+ size: "small",
398
+ value: B,
399
+ error: ut,
400
+ helperText: ut ? c(zt) : void 0,
401
+ color: M.current ? "primary" : void 0,
402
+ placeholder: m.valueFormat,
403
+ onChange: Kt,
404
+ onKeyDown: Yt,
405
+ slotProps: {
406
+ htmlInput: {
407
+ inputMode: "numeric",
408
+ "aria-label": m.valueFormat
409
+ },
410
+ input: {
411
+ sx: {
412
+ paddingRight: 0.5
413
+ },
414
+ endAdornment: /* @__PURE__ */ I(
415
+ Xt,
416
+ {
417
+ position: "end",
418
+ sx: {
419
+ marginLeft: 0
420
+ },
421
+ children: /* @__PURE__ */ I(
422
+ qt,
423
+ {
424
+ size: "small",
425
+ "aria-label": "clear-date-picker-editor-value",
426
+ disabled: !B,
427
+ onClick: Ht,
428
+ onMouseDown: /* @__PURE__ */ a((r) => {
429
+ r.preventDefault(), r.stopPropagation();
430
+ }, "onMouseDown"),
431
+ sx: {
432
+ margin: 0,
433
+ padding: 0.25
434
+ },
435
+ children: /* @__PURE__ */ I(Nt, { fontSize: "small" })
436
+ }
437
+ )
438
+ }
439
+ )
440
+ }
441
+ },
442
+ sx: {
443
+ boxSizing: "border-box",
444
+ width: m.kind === "time" ? W : "100%",
445
+ px: 1,
446
+ py: 1,
447
+ "& .MuiOutlinedInput-root": {
448
+ borderRadius: 0.75,
449
+ fontSize: 13
450
+ }
451
+ }
452
+ }
453
+ ),
454
+ m.kind === "time" ? /* @__PURE__ */ I(gt, { dateAdapter: ee, adapterLocale: Pt, children: /* @__PURE__ */ I(
455
+ te,
456
+ {
457
+ ampm: !1,
458
+ value: At,
459
+ views: Bt,
460
+ onChange: /* @__PURE__ */ a((r, i, d) => vt(r, d), "onChange"),
461
+ timeSteps: {
462
+ minutes: (t == null ? void 0 : t.timeIntervals) ?? 1,
463
+ seconds: 1
464
+ },
465
+ slotProps: {
466
+ digitalClockSectionItem: {
467
+ sx: le
468
+ }
469
+ },
470
+ sx: {
471
+ border: 0,
472
+ width: W,
473
+ "& .MuiMultiSectionDigitalClockSection-root": {
474
+ border: 0,
475
+ boxSizing: "border-box",
476
+ width: J,
477
+ flex: `0 0 ${J}px`,
478
+ display: "flex",
479
+ flexDirection: "column",
480
+ alignItems: "stretch"
481
+ },
482
+ "& .MuiMultiSectionDigitalClockSection-item": {
483
+ alignSelf: "stretch",
484
+ boxSizing: "border-box",
485
+ width: Et,
486
+ minWidth: Et,
487
+ justifyContent: "center",
488
+ marginLeft: "auto",
489
+ marginRight: "auto"
490
+ }
491
+ }
492
+ }
493
+ ) }) : /* @__PURE__ */ I(
494
+ oe,
495
+ {
496
+ inline: !0,
497
+ locale: Ct,
498
+ selected: Ft,
499
+ onChange: /* @__PURE__ */ a((r) => St(r), "onChange"),
500
+ showYearPicker: m.kind === "year",
501
+ showMonthYearPicker: m.kind === "yearMonth" || m.kind === "month",
502
+ showTimeInput: m.kind === "dateTime",
503
+ timeIntervals: t == null ? void 0 : t.timeIntervals,
504
+ dateFormat: Ee(m),
505
+ timeFormat: Gt,
506
+ timeCaption: `${c("Common.시간")}: `,
507
+ timeInputLabel: `${c("Common.시간")}: `
508
+ }
509
+ )
510
+ ]
143
511
  }
144
512
  ) })
145
513
  }
146
514
  ) : null,
147
- handleDatePickerEditorCellClick: F
515
+ handleDatePickerEditorButtonClick: Mt,
516
+ handleDatePickerEditorCellClick: Rt,
517
+ handleDatePickerEditorKeyDown: wt,
518
+ handleDatePickerEditorStartEdit: bt
148
519
  };
149
520
  }, "useOwpTreeGridDatePickerEditor");
150
521
  export {
151
- ke as useOwpTreeGridDatePickerEditor
522
+ je as useOwpTreeGridDatePickerEditor
152
523
  };
153
524
  //# sourceMappingURL=useOwpTreeGridDatePickerEditor.js.map