@owp/core 2.5.20 → 2.5.22

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 (125) hide show
  1. package/dayjs.d.ts +4 -0
  2. package/dayjs.js +2 -0
  3. package/dist/_virtual/isBetween.js +8 -0
  4. package/dist/_virtual/isBetween.js.map +1 -0
  5. package/dist/_virtual/isBetween2.js +5 -0
  6. package/dist/_virtual/isBetween2.js.map +1 -0
  7. package/dist/components/OwpCommonCode/OwpCommonCodeQuerySelector.js +26 -26
  8. package/dist/components/OwpCommonCode/OwpCommonCodeQuerySelector.js.map +1 -1
  9. package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js +29 -29
  10. package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js.map +1 -1
  11. package/dist/components/OwpMrtTable/OwpMrtTable.js +144 -141
  12. package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
  13. package/dist/components/OwpOptionSelector/OwpOptionSelector.js +20 -20
  14. package/dist/components/OwpOptionSelector/OwpOptionSelector.js.map +1 -1
  15. package/dist/components/OwpPageContent/OwpPageContent.js +20 -19
  16. package/dist/components/OwpPageContent/OwpPageContent.js.map +1 -1
  17. package/dist/components/OwpPicker/OwpDatePicker.js +216 -235
  18. package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
  19. package/dist/components/OwpPicker/OwpDateRangePicker.js +21 -21
  20. package/dist/components/OwpPicker/OwpDateRangePicker.js.map +1 -1
  21. package/dist/components/OwpPicker/OwpTimePicker.js +310 -340
  22. package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
  23. package/dist/components/OwpPicker/OwpWeekDatePicker.js +28 -29
  24. package/dist/components/OwpPicker/OwpWeekDatePicker.js.map +1 -1
  25. package/dist/components/OwpPicker/OwpYearRangePicker.js +1 -1
  26. package/dist/components/OwpPicker/OwpYearRangePicker.js.map +1 -1
  27. package/dist/components/OwpPicker/constants/index.js +21 -6
  28. package/dist/components/OwpPicker/constants/index.js.map +1 -1
  29. package/dist/components/OwpPicker/internal/DatePickerInput.js +5 -5
  30. package/dist/components/OwpPicker/internal/DatePickerInput.js.map +1 -1
  31. package/dist/components/OwpPicker/utils/index.js +22 -0
  32. package/dist/components/OwpPicker/utils/index.js.map +1 -0
  33. package/dist/components/OwpQuerySelector/OwpQuerySelector.js +218 -205
  34. package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -1
  35. package/dist/components/OwpSection/OwpSection.js +118 -111
  36. package/dist/components/OwpSection/OwpSection.js.map +1 -1
  37. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +59 -59
  38. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
  39. package/dist/components/OwpSelectorBase/OwpSelectorSelect.js +88 -85
  40. package/dist/components/OwpSelectorBase/OwpSelectorSelect.js.map +1 -1
  41. package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js +93 -93
  42. package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js.map +1 -1
  43. package/dist/components/OwpTable/OwpDataTable.js +329 -317
  44. package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
  45. package/dist/components/OwpTable/OwpFieldTable.js +77 -74
  46. package/dist/components/OwpTable/OwpFieldTable.js.map +1 -1
  47. package/dist/components/OwpTable/OwpTable.js +66 -219
  48. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  49. package/dist/components/OwpTable/internal/OwpTableBase.js +195 -0
  50. package/dist/components/OwpTable/internal/OwpTableBase.js.map +1 -0
  51. package/dist/components/OwpTable/internal/OwpTableTotalCount.js +23 -0
  52. package/dist/components/OwpTable/internal/OwpTableTotalCount.js.map +1 -0
  53. package/dist/components/OwpTable/internal/defaultTableStyle.js +10 -10
  54. package/dist/components/OwpTable/internal/defaultTableStyle.js.map +1 -1
  55. package/dist/components/OwpTable/utils/tableSx.js +9 -0
  56. package/dist/components/OwpTable/utils/tableSx.js.map +1 -0
  57. package/dist/components/OwpTextField/OwpTextMaskField.js +95 -86
  58. package/dist/components/OwpTextField/OwpTextMaskField.js.map +1 -1
  59. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +1 -1
  60. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  61. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js +164 -179
  62. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js.map +1 -1
  63. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +10 -10
  64. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
  65. package/dist/components/OwpYesNoSelector/OwpYesNoSelector.js.map +1 -1
  66. package/dist/dayjs.js +18 -0
  67. package/dist/dayjs.js.map +1 -0
  68. package/dist/features/themePreview/components/ThemePreviewCanvas.js +22 -22
  69. package/dist/features/themePreview/components/ThemePreviewCanvas.js.map +1 -1
  70. package/dist/features/themePreview/configs/table.js +4 -4
  71. package/dist/features/themePreview/configs/table.js.map +1 -1
  72. package/dist/features/themePreview/hooks/useThemePreview.js +16 -16
  73. package/dist/features/themePreview/hooks/useThemePreview.js.map +1 -1
  74. package/dist/hooks/{useInitCommonCodes.js → internal/useInitCommonCodes.js} +6 -6
  75. package/dist/hooks/internal/useInitCommonCodes.js.map +1 -0
  76. package/dist/hooks/internal/useMinimumVisibleState.js +31 -0
  77. package/dist/hooks/internal/useMinimumVisibleState.js.map +1 -0
  78. package/dist/hooks/useInitApp.js +17 -14
  79. package/dist/hooks/useInitApp.js.map +1 -1
  80. package/dist/hooks.js +49 -51
  81. package/dist/hooks.js.map +1 -1
  82. package/dist/index.js +91 -94
  83. package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/isBetween.js +23 -0
  84. package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/isBetween.js.map +1 -0
  85. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
  86. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  87. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  88. package/dist/types/components/OwpCommonCode/OwpCommonCodeQuerySelector.d.ts +3 -3
  89. package/dist/types/components/OwpCommonCode/OwpCommonCodeSelector.d.ts +3 -3
  90. package/dist/types/components/OwpMrtTable/OwpMrtTable.d.ts +1 -0
  91. package/dist/types/components/OwpOptionSelector/OwpOptionSelector.d.ts +2 -2
  92. package/dist/types/components/OwpPicker/OwpDatePicker.d.ts +1 -1
  93. package/dist/types/components/OwpPicker/OwpTimePicker.d.ts +2 -2
  94. package/dist/types/components/OwpPicker/constants/index.d.ts +15 -0
  95. package/dist/types/components/OwpPicker/utils/index.d.ts +6 -0
  96. package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +1 -1
  97. package/dist/types/components/OwpQuerySelector/types/types.d.ts +1 -0
  98. package/dist/types/components/OwpSection/OwpSection.d.ts +9 -3
  99. package/dist/types/components/OwpSelectorBase/hooks/useOwpSelectorBase.d.ts +1 -1
  100. package/dist/types/components/OwpSelectorBase/types/types.d.ts +1 -1
  101. package/dist/types/components/OwpTable/OwpDataTable.d.ts +5 -1
  102. package/dist/types/components/OwpTable/OwpFieldTable.d.ts +7 -1
  103. package/dist/types/components/OwpTable/OwpTable.d.ts +6 -38
  104. package/dist/types/components/OwpTable/internal/OwpTableBase.d.ts +34 -0
  105. package/dist/types/components/OwpTable/internal/OwpTableTotalCount.d.ts +9 -0
  106. package/dist/types/components/OwpTable/internal/defaultTableStyle.d.ts +4 -2
  107. package/dist/types/components/OwpTable/utils/tableSx.d.ts +11 -0
  108. package/dist/types/components/OwpTextField/OwpTextMaskField.d.ts +3 -3
  109. package/dist/types/components/OwpYesNoSelector/OwpYesNoSelector.d.ts +1 -1
  110. package/dist/types/dayjs.d.ts +18 -0
  111. package/dist/types/hooks/index.d.ts +0 -1
  112. package/dist/types/hooks/internal/useMinimumVisibleState.d.ts +7 -0
  113. package/dist/types/utils/dayjsBrowser.d.ts +1 -7
  114. package/dist/types/utils/formatDateToYmd.d.ts +1 -1
  115. package/dist/utils/formatDateToYmd.js +3 -3
  116. package/dist/utils/formatDateToYmd.js.map +1 -1
  117. package/dist/utils/treeGridExportExcelUtil.js +1 -1
  118. package/dist/utils/treeGridExportExcelUtil.js.map +1 -1
  119. package/dist/utils/zipUtil.js +3 -3
  120. package/dist/utils/zipUtil.js.map +1 -1
  121. package/package.json +3 -1
  122. package/dist/hooks/useInitCommonCodes.js.map +0 -1
  123. package/dist/utils/dayjsBrowser.js +0 -16
  124. package/dist/utils/dayjsBrowser.js.map +0 -1
  125. /package/dist/types/hooks/{useInitCommonCodes.d.ts → internal/useInitCommonCodes.d.ts} +0 -0
@@ -1,273 +1,286 @@
1
- var Qt = Object.defineProperty;
2
- var s = (t, n) => Qt(t, "name", { value: n, configurable: !0 });
3
- import { jsx as wt } 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 { OwpSelectorBase as ht } from "../OwpSelectorBase/OwpSelectorBase.js";
5
- import { splitSelectorValue as P, mergeSelectorOptions as Et } from "../OwpSelectorBase/utils/querySelectorUtils.js";
6
- import { STORAGE_ACCESS_TOKEN_KEY as Lt } from "../../constants/localStorageKeys.js";
7
- import { useOwpAppContext as Ct } from "../../contexts/OwpAppProvider.js";
8
- import { useGetCurrentUser as It } from "../../hooks/useCurrentUser.js";
9
- import { createJsonString as Bt } from "../../utils/createJsonString.js";
10
- import { getApiLanguageCode as Nt } from "../../utils/language.js";
11
- import { useQuery as y } from "@tanstack/react-query";
12
- import { clsx as st } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
13
- import { useState as B, useMemo as N, useEffect as j } from "react";
14
- import { isArray as it } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
15
- import { isPlainObject as jt } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js";
16
- import { isFunction as at } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js";
17
- const $t = "resultData", v = /* @__PURE__ */ s((t) => typeof t == "string" || typeof t == "number" ? `${t}` : "", "getQuerySelectorOptionLabelText"), Tt = /* @__PURE__ */ s((t) => ({
18
- jsondata: Bt(t)
19
- }), "defaultBuildRequestQuery"), ct = /* @__PURE__ */ s((t, n) => n != null && n.length ? [...t, n] : t, "appendQuerySelectorQueryKeyDeps"), G = /* @__PURE__ */ s((t) => {
1
+ var Ct = Object.defineProperty;
2
+ var c = (t, o) => Ct(t, "name", { value: o, configurable: !0 });
3
+ import { jsx as Ot } 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 { OwpSelectorBase as Bt } from "../OwpSelectorBase/OwpSelectorBase.js";
5
+ import { splitSelectorValue as y, mergeSelectorOptions as It } from "../OwpSelectorBase/utils/querySelectorUtils.js";
6
+ import { STORAGE_ACCESS_TOKEN_KEY as Nt } from "../../constants/localStorageKeys.js";
7
+ import { useOwpAppContext as jt } from "../../contexts/OwpAppProvider.js";
8
+ import { useGetCurrentUser as $t } from "../../hooks/useCurrentUser.js";
9
+ import { createJsonString as Tt } from "../../utils/createJsonString.js";
10
+ import { getApiLanguageCode as Mt } from "../../utils/language.js";
11
+ import { useQuery as Y } from "@tanstack/react-query";
12
+ import { clsx as ct } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
13
+ import { useState as V, useMemo as N, useEffect as j } from "react";
14
+ import { isArray as at } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
15
+ import { isPlainObject as Vt } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js";
16
+ import { isFunction as it } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js";
17
+ const _t = "resultData", v = /* @__PURE__ */ c((t) => typeof t == "string" || typeof t == "number" ? `${t}` : "", "getQuerySelectorOptionLabelText"), Rt = /* @__PURE__ */ c((t) => ({
18
+ jsondata: Tt(t)
19
+ }), "defaultBuildRequestQuery"), ut = /* @__PURE__ */ c((t, o) => o != null && o.length ? [...t, o] : t, "appendQuerySelectorQueryKeyDeps"), H = /* @__PURE__ */ c((t) => {
20
20
  if (t instanceof Date)
21
21
  return t.toJSON();
22
22
  if (typeof t == "bigint")
23
23
  return t.toString();
24
- if (it(t))
25
- return t.map((n) => G(n));
26
- if (jt(t))
27
- return Object.keys(t).sort().reduce((n, c) => {
28
- const g = G(t[c]);
29
- return g === void 0 || (n[c] = g), n;
24
+ if (at(t))
25
+ return t.map((o) => H(o));
26
+ if (Vt(t))
27
+ return Object.keys(t).sort().reduce((o, a) => {
28
+ const m = H(t[a]);
29
+ return m === void 0 || (o[a] = m), o;
30
30
  }, {});
31
- if (!(at(t) || typeof t == "symbol"))
31
+ if (!(it(t) || typeof t == "symbol"))
32
32
  return t;
33
- }, "normalizeQuerySelectorKeyValue"), Vt = /* @__PURE__ */ s((t) => JSON.stringify(G(t)), "createQuerySelectorScopeKey"), Mt = /* @__PURE__ */ s((t, n, c, g) => {
34
- const C = new URL(t.endsWith("/") ? t : `${t}/`), f = new URL(n.startsWith("/") ? n.slice(1) : n, C);
35
- return Object.entries(c).forEach(([l, u]) => {
36
- u != null && f.searchParams.set(l, typeof u == "string" ? u : JSON.stringify(u));
37
- }), g && f.searchParams.set("TOKEN", g), f.searchParams.set("i18nextLng", Nt()), f.toString();
38
- }, "createQuerySelectorRequestUrl"), _t = /* @__PURE__ */ s((t, n) => {
33
+ }, "normalizeQuerySelectorKeyValue"), Jt = /* @__PURE__ */ c((t) => JSON.stringify(H(t)), "createQuerySelectorScopeKey"), zt = /* @__PURE__ */ c((t, o, a, m) => {
34
+ const Q = new URL(t.endsWith("/") ? t : `${t}/`), n = new URL(o.startsWith("/") ? o.slice(1) : o, Q);
35
+ return Object.entries(a).forEach(([d, l]) => {
36
+ l != null && n.searchParams.set(d, typeof l == "string" ? l : JSON.stringify(l));
37
+ }), m && n.searchParams.set("TOKEN", m), n.searchParams.set("i18nextLng", Mt()), n.toString();
38
+ }, "createQuerySelectorRequestUrl"), kt = /* @__PURE__ */ c((t, o) => {
39
39
  if (!t || typeof t != "object")
40
40
  return [];
41
- const c = t[n];
42
- return it(c) ? c : [];
43
- }, "getQuerySelectorResponseList"), Rt = /* @__PURE__ */ s((t, n, c) => `${(c ? c(t) : `${(t == null ? void 0 : t[n ?? ""]) ?? ""}`) ?? ""}`.trim(), "resolveQuerySelectorValue"), Jt = /* @__PURE__ */ s((t, n, c) => `${(c ? c(t) : `${(t == null ? void 0 : t[n ?? ""]) ?? ""}`) ?? ""}`.trim(), "resolveQuerySelectorLabel"), zt = /* @__PURE__ */ s((t, n, c, g, C) => t.map((f) => {
44
- const l = Rt(f, n, g);
45
- return l ? {
46
- label: Jt(f, c, C),
47
- raw: f,
48
- value: l
41
+ const a = t[o];
42
+ return at(a) ? a : [];
43
+ }, "getQuerySelectorResponseList"), Gt = /* @__PURE__ */ c((t, o, a) => `${(a ? a(t) : `${(t == null ? void 0 : t[o ?? ""]) ?? ""}`) ?? ""}`.trim(), "resolveQuerySelectorValue"), Wt = /* @__PURE__ */ c((t, o, a) => `${(a ? a(t) : `${(t == null ? void 0 : t[o ?? ""]) ?? ""}`) ?? ""}`.trim(), "resolveQuerySelectorLabel"), Yt = /* @__PURE__ */ c((t, o, a, m, Q) => t.map((n) => {
44
+ const d = Gt(n, o, m);
45
+ return d ? {
46
+ label: Wt(n, a, Q),
47
+ raw: n,
48
+ value: d
49
49
  } : null;
50
- }).filter((f) => f != null), "mapQuerySelectorOptions"), Pt = /* @__PURE__ */ s(({
50
+ }).filter((n) => n != null), "mapQuerySelectorOptions"), tn = /* @__PURE__ */ c(({
51
51
  apiUrl: t,
52
- asyncSearch: n,
53
- buildRequestQuery: c = Tt,
54
- className: g,
55
- disableAllValueItem: C,
56
- filterOptions: f,
57
- multiple: l,
58
- query: u,
59
- queryKeyDeps: $,
60
- responseListKey: Q = $t,
61
- selectorType: T = "select",
62
- value: b,
63
- valueKey: w,
64
- valueResolver: ut,
65
- labelKey: h,
66
- labelResolver: ft,
67
- onChange: W,
68
- defaultValue: V,
69
- textFieldProps: m,
70
- ...lt
52
+ asyncSearch: o,
53
+ buildRequestQuery: a = Rt,
54
+ className: m,
55
+ filterOptions: Q,
56
+ forceEmptyOptions: n = !1,
57
+ multiple: d,
58
+ query: l,
59
+ queryKeyDeps: _,
60
+ responseListKey: L = _t,
61
+ selectorType: R = "select",
62
+ value: w,
63
+ valueKey: C,
64
+ valueResolver: lt,
65
+ labelKey: O,
66
+ labelResolver: dt,
67
+ onChange: U,
68
+ defaultValue: J,
69
+ showAllOption: ft = !0,
70
+ textFieldProps: f,
71
+ ...gt
71
72
  }) => {
72
- const { env: Y } = Ct(), H = It(), I = `${(Y == null ? void 0 : Y.apiBaseUrl) ?? ""}`.trim(), mt = `${(H == null ? void 0 : H.token) ?? localStorage.getItem(Lt) ?? ""}`.trim(), e = T === "autocomplete" ? n : void 0, i = e != null, tt = i ? !0 : C, dt = (e == null ? void 0 : e.minLength) ?? 1, ot = (e == null ? void 0 : e.debounceMs) ?? 300, [U, X] = B(b ?? V ?? ""), [gt, p] = B(""), [nt, M] = B(""), [Z, _] = B(""), et = $ != null && $.length ? G($) : void 0, S = Vt(
73
- ct(
74
- [t, u, Q, w, h],
75
- et
73
+ const { env: X } = jt(), Z = $t(), $ = `${(X == null ? void 0 : X.apiBaseUrl) ?? ""}`.trim(), mt = `${(Z == null ? void 0 : Z.token) ?? localStorage.getItem(Nt) ?? ""}`.trim(), r = R === "autocomplete" ? o : void 0, u = r != null, tt = n || u ? !1 : ft, St = (r == null ? void 0 : r.minLength) ?? 1, nt = (r == null ? void 0 : r.debounceMs) ?? 300, [A, K] = V(w ?? J ?? ""), [bt, S] = V(""), [et, T] = V(""), [D, M] = V(""), ot = _ != null && _.length ? H(_) : void 0, h = Jt(
74
+ ut(
75
+ [t, l, L, C, O],
76
+ ot
76
77
  )
77
- ), [R, pt] = B(() => ({
78
+ ), [z, wt] = V(() => ({
78
79
  options: {},
79
- scopeKey: S
80
+ scopeKey: h
80
81
  })), rt = N(
81
- () => R.scopeKey === S ? R.options : {},
82
- [R.options, R.scopeKey, S]
83
- ), E = N(() => P(U), [U]), A = i && Z.trim().length >= dt, J = /* @__PURE__ */ s((...o) => ct(["owp", "query-selector", ...o], et), "createSelectorQueryKey");
82
+ () => z.scopeKey === h ? z.options : {},
83
+ [z.options, z.scopeKey, h]
84
+ ), st = N(() => y(A), [A]), B = N(
85
+ () => n ? [] : st,
86
+ [n, st]
87
+ ), E = !n && u && D.trim().length >= St, k = /* @__PURE__ */ c((...e) => ut(["owp", "query-selector", ...e], ot), "createSelectorQueryKey");
84
88
  j(() => {
85
- b !== void 0 && X(b);
86
- }, [b]), j(() => {
87
- b === void 0 && X(V ?? "");
88
- }, [V, b]), j(() => {
89
- if (!i)
89
+ w !== void 0 && K(w);
90
+ }, [w]), j(() => {
91
+ w === void 0 && K(J ?? "");
92
+ }, [J, w]), j(() => {
93
+ if (!u)
90
94
  return;
91
- const o = window.setTimeout(() => {
92
- _(nt.trim());
93
- }, ot);
95
+ const e = window.setTimeout(() => {
96
+ M(et.trim());
97
+ }, nt);
94
98
  return () => {
95
- window.clearTimeout(o);
99
+ window.clearTimeout(e);
96
100
  };
97
- }, [ot, i, nt]);
98
- const z = /* @__PURE__ */ s(async (o) => {
99
- const r = await fetch(
100
- Mt(I, t, c(o), mt)
101
- ), a = await r.json();
102
- if (!r.ok || (a == null ? void 0 : a.resultCode) === "STATUS_0")
103
- throw new Error(`${(a == null ? void 0 : a.resultMessage) ?? "Failed to fetch selector options"}`);
104
- const d = _t(a, Q), O = at(f) ? f(d) : d;
105
- return zt(
101
+ }, [nt, u, et]);
102
+ const G = /* @__PURE__ */ c(async (e) => {
103
+ const s = await fetch(
104
+ zt($, t, a(e), mt)
105
+ ), i = await s.json();
106
+ if (!s.ok || (i == null ? void 0 : i.resultCode) === "STATUS_0")
107
+ throw new Error(`${(i == null ? void 0 : i.resultMessage) ?? "Failed to fetch selector options"}`);
108
+ const g = kt(i, L), b = it(Q) ? Q(g) : g;
109
+ return Yt(
110
+ b,
111
+ C,
106
112
  O,
107
- w,
108
- h,
109
- ut,
110
- ft
113
+ lt,
114
+ dt
111
115
  );
112
- }, "fetchOptions"), K = y({
113
- queryKey: J(t, u, Q, w, h),
114
- enabled: !!I && !i,
115
- queryFn: /* @__PURE__ */ s(() => z(u), "queryFn")
116
- }), D = y({
117
- queryKey: J(
116
+ }, "fetchOptions"), p = Y({
117
+ queryKey: k(t, l, L, C, O),
118
+ enabled: !!$ && !n && !u,
119
+ queryFn: /* @__PURE__ */ c(() => G(l), "queryFn")
120
+ }), q = Y({
121
+ queryKey: k(
118
122
  "search",
119
123
  t,
120
- u,
121
- Z,
122
- Q,
123
- w,
124
- h
124
+ l,
125
+ D,
126
+ L,
127
+ C,
128
+ O
125
129
  ),
126
- enabled: !!I && i && A,
127
- queryFn: /* @__PURE__ */ s(() => z({
128
- ...u,
129
- ...(e == null ? void 0 : e.buildKeywordQuery(Z)) ?? {}
130
+ enabled: !!$ && !n && u && E,
131
+ queryFn: /* @__PURE__ */ c(() => G({
132
+ ...l,
133
+ ...(r == null ? void 0 : r.buildKeywordQuery(D)) ?? {}
130
134
  }), "queryFn")
131
- }), q = y({
132
- queryKey: J(
135
+ }), x = Y({
136
+ queryKey: k(
133
137
  "all",
134
138
  t,
135
- u,
136
- Q,
137
- w,
138
- h
139
+ l,
140
+ L,
141
+ C,
142
+ O
139
143
  ),
140
- enabled: !!I && i && (!!E.length || !!l && !tt),
141
- queryFn: /* @__PURE__ */ s(() => {
142
- var o;
143
- return z({
144
- ...u,
145
- ...((o = e == null ? void 0 : e.buildAllQuery) == null ? void 0 : o.call(e)) ?? {}
144
+ enabled: !!$ && !n && u && (!!B.length || !!d && tt),
145
+ queryFn: /* @__PURE__ */ c(() => {
146
+ var e;
147
+ return G({
148
+ ...l,
149
+ ...((e = r == null ? void 0 : r.buildAllQuery) == null ? void 0 : e.call(r)) ?? {}
146
150
  });
147
151
  }, "queryFn")
148
- }), x = y({
149
- queryKey: J(
152
+ }), F = Y({
153
+ queryKey: k(
150
154
  "selected",
151
155
  t,
152
- u,
153
- E,
154
- Q,
155
- w,
156
- h
156
+ l,
157
+ B,
158
+ L,
159
+ C,
160
+ O
157
161
  ),
158
- enabled: !!I && i && !!E.length && !!(e != null && e.buildSelectedQuery),
159
- queryFn: /* @__PURE__ */ s(() => {
160
- var o;
161
- return z({
162
- ...u,
163
- ...((o = e == null ? void 0 : e.buildSelectedQuery) == null ? void 0 : o.call(e, E)) ?? {}
162
+ enabled: !!$ && !n && u && !!B.length && !!(r != null && r.buildSelectedQuery),
163
+ queryFn: /* @__PURE__ */ c(() => {
164
+ var e;
165
+ return G({
166
+ ...l,
167
+ ...((e = r == null ? void 0 : r.buildSelectedQuery) == null ? void 0 : e.call(r, B)) ?? {}
164
168
  });
165
169
  }, "queryFn")
166
- }), F = N(() => i ? A ? D.data ?? [] : [] : K.data ?? [], [
167
- K.data,
168
- i,
169
- D.data,
170
- A
171
- ]), L = N(
172
- () => Et(
173
- F,
174
- q.data,
170
+ }), P = N(() => n ? [] : u ? E ? q.data ?? [] : [] : p.data ?? [], [
171
+ p.data,
172
+ n,
173
+ u,
174
+ q.data,
175
+ E
176
+ ]), I = N(
177
+ () => n ? [] : It(
178
+ P,
175
179
  x.data,
180
+ F.data,
176
181
  Object.values(rt)
177
182
  ),
178
- [q.data, rt, F, x.data]
179
- ), k = N(
183
+ [
184
+ x.data,
185
+ rt,
186
+ P,
187
+ n,
188
+ F.data
189
+ ]
190
+ ), W = N(
180
191
  () => {
181
- const o = {};
182
- return L.forEach((r) => {
183
- o[r.value] = r;
184
- }), o;
192
+ const e = {};
193
+ return I.forEach((s) => {
194
+ e[s.value] = s;
195
+ }), e;
185
196
  },
186
- [L]
187
- ), Ot = K.isLoading || D.isLoading || q.isLoading || x.isLoading, bt = st(T === "autocomplete" && "!min-w-160", g), St = st(
188
- T === "autocomplete" && !(m != null && m.className) && "w-full",
189
- m == null ? void 0 : m.className
197
+ [I]
198
+ ), ht = !n && (p.isLoading || q.isLoading || x.isLoading || F.isLoading), Qt = ct(R === "autocomplete" && "!min-w-160", m), Lt = ct(
199
+ R === "autocomplete" && !(f != null && f.className) && "w-full",
200
+ f == null ? void 0 : f.className
190
201
  );
191
202
  return j(() => {
192
- L.length && pt((o) => {
193
- const r = o.scopeKey === S ? o.options : {}, a = { ...r };
194
- let d = !1;
195
- return L.forEach((O) => {
196
- a[O.value] !== O && (a[O.value] = O, d = !0);
197
- }), !d && o.scopeKey === S ? o : {
198
- options: d ? a : r,
199
- scopeKey: S
203
+ I.length && wt((e) => {
204
+ const s = e.scopeKey === h ? e.options : {}, i = { ...s };
205
+ let g = !1;
206
+ return I.forEach((b) => {
207
+ i[b.value] !== b && (i[b.value] = b, g = !0);
208
+ }), !g && e.scopeKey === h ? e : {
209
+ options: g ? i : s,
210
+ scopeKey: h
200
211
  };
201
212
  });
202
- }, [S, L]), j(() => {
203
- var r;
204
- if (!i)
213
+ }, [h, I]), j(() => {
214
+ var s;
215
+ if (!u)
205
216
  return;
206
- if (l) {
207
- p("");
217
+ if (d) {
218
+ S("");
208
219
  return;
209
220
  }
210
- const o = E[0];
211
- if (!o) {
212
- p("");
221
+ const e = B[0];
222
+ if (!e) {
223
+ S("");
213
224
  return;
214
225
  }
215
- p(v(((r = k[o]) == null ? void 0 : r.label) ?? ""));
216
- }, [i, l, k, E]), /* @__PURE__ */ wt(
217
- ht,
226
+ S(v(((s = W[e]) == null ? void 0 : s.label) ?? ""));
227
+ }, [u, d, W, B]), j(() => {
228
+ !n || !u || (S(""), T(""), M(""));
229
+ }, [n, u]), /* @__PURE__ */ Ot(
230
+ Bt,
218
231
  {
219
- ...lt,
220
- allOptions: L,
232
+ ...gt,
233
+ allOptions: I,
221
234
  allValueMode: "joined",
222
- autocompleteInputValue: i ? gt : void 0,
223
- className: bt,
224
- defaultValue: V,
225
- disableAllValueItem: tt,
226
- disableClientFilter: i,
227
- loading: Ot,
228
- multiple: l,
229
- onAutocompleteInputChange: i ? (o, r) => {
230
- r !== "reset" && (l && r !== "input" || (p(o), M(o)));
235
+ autocompleteInputValue: u ? n ? "" : bt : void 0,
236
+ className: Qt,
237
+ defaultValue: n ? "" : J,
238
+ disableClientFilter: u,
239
+ loading: ht,
240
+ multiple: d,
241
+ onAutocompleteInputChange: u ? (e, s) => {
242
+ s !== "reset" && (d && s !== "input" || n || (S(e), T(e)));
231
243
  } : void 0,
232
- onChange: /* @__PURE__ */ s((o) => {
233
- var r;
234
- if (X(o.target.value), i) {
235
- const a = P(o.target.value);
236
- if (l)
237
- p(""), M(""), _("");
244
+ onChange: /* @__PURE__ */ c((e) => {
245
+ var s;
246
+ if (K(e.target.value), u) {
247
+ const i = n ? [] : y(e.target.value);
248
+ if (d)
249
+ S(""), T(""), M("");
238
250
  else {
239
- const d = a[0], O = d ? v(((r = k[d]) == null ? void 0 : r.label) ?? "") : "";
240
- p(O), M(""), _("");
251
+ const g = i[0], b = g ? v(((s = W[g]) == null ? void 0 : s.label) ?? "") : "";
252
+ S(b), T(""), M("");
241
253
  }
242
254
  }
243
- W == null || W(o);
255
+ U == null || U(e);
244
256
  }, "onChange"),
245
- options: F,
246
- selectorType: T,
257
+ options: P,
258
+ selectorType: R,
259
+ showAllOption: tt,
247
260
  textFieldProps: {
248
- ...m,
249
- className: St,
250
- onBlur: /* @__PURE__ */ s((o) => {
251
- var r, a;
252
- if (i) {
253
- if (l)
254
- p("");
261
+ ...f,
262
+ className: Lt,
263
+ onBlur: /* @__PURE__ */ c((e) => {
264
+ var s, i;
265
+ if (u) {
266
+ if (d)
267
+ S("");
255
268
  else {
256
- const d = P(U)[0];
257
- p(
258
- d ? v(((r = k[d]) == null ? void 0 : r.label) ?? "") : ""
269
+ const g = n ? void 0 : y(A)[0];
270
+ S(
271
+ g ? v(((s = W[g]) == null ? void 0 : s.label) ?? "") : ""
259
272
  );
260
273
  }
261
- M(""), _("");
274
+ T(""), M("");
262
275
  }
263
- (a = m == null ? void 0 : m.onBlur) == null || a.call(m, o);
276
+ (i = f == null ? void 0 : f.onBlur) == null || i.call(f, e);
264
277
  }, "onBlur")
265
278
  },
266
- value: b
279
+ value: n ? "" : w
267
280
  }
268
281
  );
269
282
  }, "OwpQuerySelector");
270
283
  export {
271
- Pt as OwpQuerySelector
284
+ tn as OwpQuerySelector
272
285
  };
273
286
  //# sourceMappingURL=OwpQuerySelector.js.map