@owp/core 2.2.4 → 2.2.5
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.
- package/dist/_virtual/index11.js +2 -2
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index16.js +2 -5
- package/dist/_virtual/index16.js.map +1 -1
- package/dist/_virtual/index17.js +2 -2
- package/dist/_virtual/index5.js +5 -2
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js +68 -149
- package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js.map +1 -1
- package/dist/components/OwpOptionSelector/OwpOptionSelector.js +52 -38
- package/dist/components/OwpOptionSelector/OwpOptionSelector.js.map +1 -1
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js +232 -0
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -0
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +381 -0
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -0
- package/dist/components/OwpSelectorBase/OwpSelectorBase.js +14 -0
- package/dist/components/OwpSelectorBase/OwpSelectorBase.js.map +1 -0
- package/dist/components/OwpSelectorBase/OwpSelectorSelect.js +152 -0
- package/dist/components/OwpSelectorBase/OwpSelectorSelect.js.map +1 -0
- package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js +120 -0
- package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js.map +1 -0
- package/dist/components/OwpSelectorBase/utils/querySelectorUtils.js +24 -0
- package/dist/components/OwpSelectorBase/utils/querySelectorUtils.js.map +1 -0
- package/dist/index.js +39 -37
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ArrowDropDown.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ArrowDropDown.js.map +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js +10 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js.map +1 -0
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
- package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js +1 -1
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
- 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
- package/dist/owp-app.css +1 -1
- package/dist/types/components/OwpCommonCode/OwpCommonCodeSelector.d.ts +16 -6
- package/dist/types/components/OwpOptionSelector/OwpOptionSelector.d.ts +9 -8
- package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +6 -0
- package/dist/types/components/OwpQuerySelector/index.d.ts +2 -0
- package/dist/types/components/OwpQuerySelector/types/index.d.ts +1 -0
- package/dist/types/components/OwpQuerySelector/types/types.d.ts +42 -0
- package/dist/types/components/OwpSelectorBase/OwpSelectorAutocomplete.d.ts +11 -0
- package/dist/types/components/OwpSelectorBase/OwpSelectorBase.d.ts +6 -0
- package/dist/types/components/OwpSelectorBase/OwpSelectorSelect.d.ts +11 -0
- package/dist/types/components/OwpSelectorBase/hooks/useOwpSelectorBase.d.ts +6 -0
- package/dist/types/components/OwpSelectorBase/types/index.d.ts +1 -0
- package/dist/types/components/OwpSelectorBase/types/types.d.ts +59 -0
- package/dist/types/components/OwpSelectorBase/utils/index.d.ts +1 -0
- package/dist/types/components/OwpSelectorBase/utils/querySelectorUtils.d.ts +31 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
var ct = Object.defineProperty;
|
|
2
|
+
var c = (t, u) => ct(t, "name", { value: u, configurable: !0 });
|
|
3
|
+
import { jsx as ut } 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 it } from "../OwpSelectorBase/OwpSelectorBase.js";
|
|
5
|
+
import { splitSelectorValue as K, mergeSelectorOptions as at } from "../OwpSelectorBase/utils/querySelectorUtils.js";
|
|
6
|
+
import { STORAGE_ACCESS_TOKEN_KEY as lt } from "../../constants/localStorageKeys.js";
|
|
7
|
+
import { useOwpAppContext as ft } from "../../contexts/OwpAppProvider.js";
|
|
8
|
+
import { useGetCurrentUser as dt } from "../../hooks/useCurrentUser.js";
|
|
9
|
+
import { createJsonString as mt } from "../../utils/createJsonString.js";
|
|
10
|
+
import { getApiLanguageCode as pt } from "../../utils/language.js";
|
|
11
|
+
import { useQuery as C } from "@tanstack/react-query";
|
|
12
|
+
import { useState as L, useMemo as j, useEffect as I } from "react";
|
|
13
|
+
import { isFunction as gt } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js";
|
|
14
|
+
import { isArray as bt } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
|
|
15
|
+
const Ot = "resultData", U = /* @__PURE__ */ c((t) => typeof t == "string" || typeof t == "number" ? `${t}` : "", "getQuerySelectorOptionLabelText"), wt = /* @__PURE__ */ c((t) => ({
|
|
16
|
+
jsondata: mt(t)
|
|
17
|
+
}), "defaultBuildRequestQuery"), St = /* @__PURE__ */ c((t, u, a, m) => {
|
|
18
|
+
const b = new URL(t.endsWith("/") ? t : `${t}/`), r = new URL(u.startsWith("/") ? u.slice(1) : u, b);
|
|
19
|
+
return Object.entries(a).forEach(([f, d]) => {
|
|
20
|
+
d != null && r.searchParams.set(f, typeof d == "string" ? d : JSON.stringify(d));
|
|
21
|
+
}), m && r.searchParams.set("TOKEN", m), r.searchParams.set("i18nextLng", pt()), r.toString();
|
|
22
|
+
}, "createQuerySelectorRequestUrl"), Qt = /* @__PURE__ */ c((t, u) => {
|
|
23
|
+
if (!t || typeof t != "object")
|
|
24
|
+
return [];
|
|
25
|
+
const a = t[u];
|
|
26
|
+
return bt(a) ? a : [];
|
|
27
|
+
}, "getQuerySelectorResponseList"), ht = /* @__PURE__ */ c((t, u, a) => `${(a ? a(t) : `${(t == null ? void 0 : t[u ?? ""]) ?? ""}`) ?? ""}`.trim(), "resolveQuerySelectorValue"), Et = /* @__PURE__ */ c((t, u, a) => `${(a ? a(t) : `${(t == null ? void 0 : t[u ?? ""]) ?? ""}`) ?? ""}`.trim(), "resolveQuerySelectorLabel"), Lt = /* @__PURE__ */ c((t, u, a, m, b) => t.map((r) => {
|
|
28
|
+
const f = ht(r, u, m);
|
|
29
|
+
return f ? {
|
|
30
|
+
label: Et(r, a, b),
|
|
31
|
+
raw: r,
|
|
32
|
+
value: f
|
|
33
|
+
} : null;
|
|
34
|
+
}).filter((r) => r != null), "mapQuerySelectorOptions"), Nt = /* @__PURE__ */ c(({
|
|
35
|
+
apiUrl: t,
|
|
36
|
+
asyncSearch: u,
|
|
37
|
+
buildRequestQuery: a = wt,
|
|
38
|
+
disableAllValueItem: m,
|
|
39
|
+
filterOptions: b,
|
|
40
|
+
multiple: r,
|
|
41
|
+
query: f,
|
|
42
|
+
responseListKey: d = Ot,
|
|
43
|
+
selectorType: z = "select",
|
|
44
|
+
value: g,
|
|
45
|
+
valueKey: Q,
|
|
46
|
+
valueResolver: P,
|
|
47
|
+
labelKey: h,
|
|
48
|
+
labelResolver: v,
|
|
49
|
+
onChange: M,
|
|
50
|
+
defaultValue: y,
|
|
51
|
+
textFieldProps: O,
|
|
52
|
+
...tt
|
|
53
|
+
}) => {
|
|
54
|
+
const { env: _ } = ft(), V = dt(), E = `${(_ == null ? void 0 : _.apiBaseUrl) ?? ""}`.trim(), et = `${(V == null ? void 0 : V.token) ?? localStorage.getItem(lt) ?? ""}`.trim(), o = z === "autocomplete" ? u : void 0, s = o != null, H = s ? !0 : m, ot = (o == null ? void 0 : o.minLength) ?? 1, X = (o == null ? void 0 : o.debounceMs) ?? 300, [R, D] = L(g ?? y ?? ""), [nt, p] = L(""), [Z, B] = L(""), [N, q] = L(""), [A, rt] = L({}), w = j(() => K(R), [R]), k = s && N.trim().length >= ot;
|
|
55
|
+
I(() => {
|
|
56
|
+
g !== void 0 && D(g);
|
|
57
|
+
}, [g]), I(() => {
|
|
58
|
+
g === void 0 && D(y ?? "");
|
|
59
|
+
}, [y, g]), I(() => {
|
|
60
|
+
if (!s)
|
|
61
|
+
return;
|
|
62
|
+
const e = window.setTimeout(() => {
|
|
63
|
+
q(Z.trim());
|
|
64
|
+
}, X);
|
|
65
|
+
return () => {
|
|
66
|
+
window.clearTimeout(e);
|
|
67
|
+
};
|
|
68
|
+
}, [X, s, Z]);
|
|
69
|
+
const T = /* @__PURE__ */ c(async (e) => {
|
|
70
|
+
const n = await fetch(
|
|
71
|
+
St(E, t, a(e), et)
|
|
72
|
+
), i = await n.json();
|
|
73
|
+
if (!n.ok || (i == null ? void 0 : i.resultCode) === "STATUS_0")
|
|
74
|
+
throw new Error(`${(i == null ? void 0 : i.resultMessage) ?? "Failed to fetch selector options"}`);
|
|
75
|
+
const l = Qt(i, d), F = gt(b) ? b(l) : l;
|
|
76
|
+
return Lt(
|
|
77
|
+
F,
|
|
78
|
+
Q,
|
|
79
|
+
h,
|
|
80
|
+
P,
|
|
81
|
+
v
|
|
82
|
+
);
|
|
83
|
+
}, "fetchOptions"), G = C({
|
|
84
|
+
queryKey: ["owp", "query-selector", t, f, d, Q, h],
|
|
85
|
+
enabled: !!E && !s,
|
|
86
|
+
queryFn: /* @__PURE__ */ c(() => T(f), "queryFn")
|
|
87
|
+
}), J = C({
|
|
88
|
+
queryKey: [
|
|
89
|
+
"owp",
|
|
90
|
+
"query-selector",
|
|
91
|
+
"search",
|
|
92
|
+
t,
|
|
93
|
+
f,
|
|
94
|
+
N,
|
|
95
|
+
d,
|
|
96
|
+
Q,
|
|
97
|
+
h
|
|
98
|
+
],
|
|
99
|
+
enabled: !!E && s && k,
|
|
100
|
+
queryFn: /* @__PURE__ */ c(() => T({
|
|
101
|
+
...f,
|
|
102
|
+
...(o == null ? void 0 : o.buildKeywordQuery(N)) ?? {}
|
|
103
|
+
}), "queryFn")
|
|
104
|
+
}), W = C({
|
|
105
|
+
queryKey: ["owp", "query-selector", "all", t, f, d, Q, h],
|
|
106
|
+
enabled: !!E && s && (!!w.length || !!r && !H),
|
|
107
|
+
queryFn: /* @__PURE__ */ c(() => {
|
|
108
|
+
var e;
|
|
109
|
+
return T({
|
|
110
|
+
...f,
|
|
111
|
+
...((e = o == null ? void 0 : o.buildAllQuery) == null ? void 0 : e.call(o)) ?? {}
|
|
112
|
+
});
|
|
113
|
+
}, "queryFn")
|
|
114
|
+
}), Y = C({
|
|
115
|
+
queryKey: [
|
|
116
|
+
"owp",
|
|
117
|
+
"query-selector",
|
|
118
|
+
"selected",
|
|
119
|
+
t,
|
|
120
|
+
w,
|
|
121
|
+
d,
|
|
122
|
+
Q,
|
|
123
|
+
h
|
|
124
|
+
],
|
|
125
|
+
enabled: !!E && s && !!w.length && !!(o != null && o.buildSelectedQuery),
|
|
126
|
+
queryFn: /* @__PURE__ */ c(() => {
|
|
127
|
+
var e;
|
|
128
|
+
return T({
|
|
129
|
+
...f,
|
|
130
|
+
...((e = o == null ? void 0 : o.buildSelectedQuery) == null ? void 0 : e.call(o, w)) ?? {}
|
|
131
|
+
});
|
|
132
|
+
}, "queryFn")
|
|
133
|
+
}), x = j(() => s ? k ? J.data ?? [] : [] : G.data ?? [], [
|
|
134
|
+
G.data,
|
|
135
|
+
s,
|
|
136
|
+
J.data,
|
|
137
|
+
k
|
|
138
|
+
]), S = j(
|
|
139
|
+
() => at(
|
|
140
|
+
x,
|
|
141
|
+
W.data,
|
|
142
|
+
Y.data,
|
|
143
|
+
Object.values(A)
|
|
144
|
+
),
|
|
145
|
+
[W.data, A, x, Y.data]
|
|
146
|
+
), $ = j(
|
|
147
|
+
() => {
|
|
148
|
+
const e = {};
|
|
149
|
+
return S.forEach((n) => {
|
|
150
|
+
e[n.value] = n;
|
|
151
|
+
}), e;
|
|
152
|
+
},
|
|
153
|
+
[S]
|
|
154
|
+
), st = G.isLoading || J.isLoading || W.isLoading || Y.isLoading;
|
|
155
|
+
return I(() => {
|
|
156
|
+
S.length && rt((e) => {
|
|
157
|
+
const n = { ...e };
|
|
158
|
+
let i = !1;
|
|
159
|
+
return S.forEach((l) => {
|
|
160
|
+
n[l.value] !== l && (n[l.value] = l, i = !0);
|
|
161
|
+
}), i ? n : e;
|
|
162
|
+
});
|
|
163
|
+
}, [S]), I(() => {
|
|
164
|
+
var n;
|
|
165
|
+
if (!s)
|
|
166
|
+
return;
|
|
167
|
+
if (r) {
|
|
168
|
+
p("");
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const e = w[0];
|
|
172
|
+
if (!e) {
|
|
173
|
+
p("");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
p(U(((n = $[e]) == null ? void 0 : n.label) ?? ""));
|
|
177
|
+
}, [s, r, $, w]), /* @__PURE__ */ ut(
|
|
178
|
+
it,
|
|
179
|
+
{
|
|
180
|
+
...tt,
|
|
181
|
+
allOptions: S,
|
|
182
|
+
allValueMode: "joined",
|
|
183
|
+
autocompleteInputValue: s ? nt : void 0,
|
|
184
|
+
defaultValue: y,
|
|
185
|
+
disableAllValueItem: H,
|
|
186
|
+
disableClientFilter: s,
|
|
187
|
+
loading: st,
|
|
188
|
+
multiple: r,
|
|
189
|
+
onAutocompleteInputChange: s ? (e, n) => {
|
|
190
|
+
n !== "reset" && (r && n !== "input" || (p(e), B(e)));
|
|
191
|
+
} : void 0,
|
|
192
|
+
onChange: /* @__PURE__ */ c((e) => {
|
|
193
|
+
var n;
|
|
194
|
+
if (D(e.target.value), s) {
|
|
195
|
+
const i = K(e.target.value);
|
|
196
|
+
if (r)
|
|
197
|
+
p(""), B(""), q("");
|
|
198
|
+
else {
|
|
199
|
+
const l = i[0], F = l ? U(((n = $[l]) == null ? void 0 : n.label) ?? "") : "";
|
|
200
|
+
p(F), B(""), q("");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
M == null || M(e);
|
|
204
|
+
}, "onChange"),
|
|
205
|
+
options: x,
|
|
206
|
+
selectorType: z,
|
|
207
|
+
textFieldProps: {
|
|
208
|
+
...O,
|
|
209
|
+
onBlur: /* @__PURE__ */ c((e) => {
|
|
210
|
+
var n, i;
|
|
211
|
+
if (s) {
|
|
212
|
+
if (r)
|
|
213
|
+
p("");
|
|
214
|
+
else {
|
|
215
|
+
const l = K(R)[0];
|
|
216
|
+
p(
|
|
217
|
+
l ? U(((n = $[l]) == null ? void 0 : n.label) ?? "") : ""
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
B(""), q("");
|
|
221
|
+
}
|
|
222
|
+
(i = O == null ? void 0 : O.onBlur) == null || i.call(O, e);
|
|
223
|
+
}, "onBlur")
|
|
224
|
+
},
|
|
225
|
+
value: g
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}, "OwpQuerySelector");
|
|
229
|
+
export {
|
|
230
|
+
Nt as OwpQuerySelector
|
|
231
|
+
};
|
|
232
|
+
//# sourceMappingURL=OwpQuerySelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwpQuerySelector.js","sources":["../../../src/components/OwpQuerySelector/OwpQuerySelector.tsx"],"sourcesContent":["import { OwpSelectorBase } from '@/components/OwpSelectorBase/OwpSelectorBase';\nimport type { OwpSelectorBaseOption } from '@/components/OwpSelectorBase/types';\nimport { mergeSelectorOptions, splitSelectorValue } from '@/components/OwpSelectorBase/utils';\nimport { STORAGE_ACCESS_TOKEN_KEY } from '@/constants/localStorageKeys';\nimport { useOwpAppContext } from '@/contexts/OwpAppProvider';\nimport { useGetCurrentUser } from '@/hooks/useCurrentUser';\nimport { createJsonString } from '@/utils/createJsonString';\nimport { getApiLanguageCode } from '@/utils/language';\nimport { useQuery } from '@tanstack/react-query';\nimport { isArray, isFunction } from 'es-toolkit/compat';\nimport { useEffect, useMemo, useState } from 'react';\nimport type { OwpQuerySelectorProps } from './types';\n\nconst DEFAULT_RESPONSE_LIST_KEY = 'resultData';\n\n/**\n * 선택 옵션 라벨 문자열 변환\n * @param label 선택 옵션 라벨\n */\nconst getQuerySelectorOptionLabelText = (label: OwpSelectorBaseOption['label']) => {\n return typeof label === 'string' || typeof label === 'number' ? `${label}` : '';\n};\n\n/**\n * 요청 query 객체 구성\n * @param query 원본 query\n */\nconst defaultBuildRequestQuery = (query: Record<string, unknown>) => {\n return {\n jsondata: createJsonString(query),\n };\n};\n\n/**\n * API 요청 URL 생성\n * @param apiBaseUrl API base URL\n * @param apiUrl API path\n * @param requestQuery 요청 query\n * @param accessToken 접근 토큰\n */\nconst createQuerySelectorRequestUrl = (\n apiBaseUrl: string,\n apiUrl: string,\n requestQuery: Record<string, unknown>,\n accessToken: string,\n) => {\n const baseUrl = new URL(apiBaseUrl.endsWith('/') ? apiBaseUrl : `${apiBaseUrl}/`);\n const requestUrl = new URL(apiUrl.startsWith('/') ? apiUrl.slice(1) : apiUrl, baseUrl);\n\n Object.entries(requestQuery).forEach(([key, value]) => {\n if (value == null) {\n return;\n }\n\n requestUrl.searchParams.set(key, typeof value === 'string' ? value : JSON.stringify(value));\n });\n\n if (accessToken) {\n requestUrl.searchParams.set('TOKEN', accessToken);\n }\n\n requestUrl.searchParams.set('i18nextLng', getApiLanguageCode());\n\n return requestUrl.toString();\n};\n\n/**\n * 원격 선택기 응답 목록 정규화\n * @param data 응답 데이터\n * @param responseListKey 목록 키\n */\nconst getQuerySelectorResponseList = (data: unknown, responseListKey: string) => {\n if (!data || typeof data !== 'object') {\n return [];\n }\n\n const responseList = (data as Record<string, unknown>)[responseListKey];\n\n return isArray(responseList) ? (responseList as Record<string, unknown>[]) : [];\n};\n\n/**\n * 원격 아이템 value 계산\n * @param item 응답 아이템\n * @param valueKey value key\n * @param valueResolver value resolver\n */\nconst resolveQuerySelectorValue = (\n item: Record<string, unknown>,\n valueKey?: string,\n valueResolver?: (item: Record<string, unknown>) => string,\n) => {\n const value = valueResolver ? valueResolver(item) : `${item?.[valueKey ?? ''] ?? ''}`;\n\n return `${value ?? ''}`.trim();\n};\n\n/**\n * 원격 아이템 label 계산\n * @param item 응답 아이템\n * @param labelKey label key\n * @param labelResolver label resolver\n */\nconst resolveQuerySelectorLabel = (\n item: Record<string, unknown>,\n labelKey?: string,\n labelResolver?: (item: Record<string, unknown>) => string,\n) => {\n const label = labelResolver ? labelResolver(item) : `${item?.[labelKey ?? ''] ?? ''}`;\n\n return `${label ?? ''}`.trim();\n};\n\n/**\n * 원격 응답 데이터를 선택 옵션으로 변환\n * @param items 응답 아이템 목록\n * @param valueKey value key\n * @param labelKey label key\n * @param valueResolver value resolver\n * @param labelResolver label resolver\n */\nconst mapQuerySelectorOptions = (\n items: Record<string, unknown>[],\n valueKey?: string,\n labelKey?: string,\n valueResolver?: (item: Record<string, unknown>) => string,\n labelResolver?: (item: Record<string, unknown>) => string,\n) => {\n return items\n .map((item) => {\n const value = resolveQuerySelectorValue(item, valueKey, valueResolver);\n\n if (!value) {\n return null;\n }\n\n return {\n label: resolveQuerySelectorLabel(item, labelKey, labelResolver),\n raw: item,\n value,\n } as OwpSelectorBaseOption<Record<string, unknown>>;\n })\n .filter((option): option is OwpSelectorBaseOption<Record<string, unknown>> => option != null);\n};\n\n/**\n * 원격 조회형 공통 선택기\n * @param props 원격 선택기 props\n */\nexport const OwpQuerySelector = ({\n apiUrl,\n asyncSearch,\n buildRequestQuery = defaultBuildRequestQuery,\n disableAllValueItem,\n filterOptions,\n multiple,\n query,\n responseListKey = DEFAULT_RESPONSE_LIST_KEY,\n selectorType = 'select',\n value,\n valueKey,\n valueResolver,\n labelKey,\n labelResolver,\n onChange,\n defaultValue,\n textFieldProps,\n ...selectorBaseProps\n}: OwpQuerySelectorProps) => {\n const { env } = useOwpAppContext();\n const currentUser = useGetCurrentUser();\n const apiBaseUrl = `${env?.apiBaseUrl ?? ''}`.trim();\n const accessToken = `${currentUser?.token ?? localStorage.getItem(STORAGE_ACCESS_TOKEN_KEY) ?? ''}`.trim();\n const resolvedAsyncSearch = selectorType === 'autocomplete' ? asyncSearch : undefined;\n const isAsyncSearchEnabled = resolvedAsyncSearch != null;\n const resolvedDisableAllValueItem = isAsyncSearchEnabled ? true : disableAllValueItem;\n const minLength = resolvedAsyncSearch?.minLength ?? 1;\n const debounceMs = resolvedAsyncSearch?.debounceMs ?? 300;\n const [currentSelectionValue, setCurrentSelectionValue] = useState(value ?? defaultValue ?? '');\n const [autocompleteInputValue, setAutocompleteInputValue] = useState('');\n const [searchKeyword, setSearchKeyword] = useState('');\n const [debouncedSearchKeyword, setDebouncedSearchKeyword] = useState('');\n const [cachedOptions, setCachedOptions] = useState<Record<string, OwpSelectorBaseOption<Record<string, unknown>>>>({});\n const selectedIds = useMemo(() => splitSelectorValue(currentSelectionValue), [currentSelectionValue]);\n const shouldFetchSearchOptions = isAsyncSearchEnabled && debouncedSearchKeyword.trim().length >= minLength;\n\n useEffect(() => {\n if (value === undefined) {\n return;\n }\n\n setCurrentSelectionValue(value);\n }, [value]);\n\n useEffect(() => {\n if (value !== undefined) {\n return;\n }\n\n setCurrentSelectionValue(defaultValue ?? '');\n }, [defaultValue, value]);\n\n useEffect(() => {\n if (!isAsyncSearchEnabled) {\n return;\n }\n\n const timer = window.setTimeout(() => {\n setDebouncedSearchKeyword(searchKeyword.trim());\n }, debounceMs);\n\n return () => {\n window.clearTimeout(timer);\n };\n }, [debounceMs, isAsyncSearchEnabled, searchKeyword]);\n\n const fetchOptions = async (nextQuery: Record<string, unknown>) => {\n const response = await fetch(\n createQuerySelectorRequestUrl(apiBaseUrl, apiUrl, buildRequestQuery(nextQuery), accessToken),\n );\n const data = (await response.json()) as Record<string, unknown>;\n\n if (!response.ok || data?.resultCode === 'STATUS_0') {\n throw new Error(`${data?.resultMessage ?? 'Failed to fetch selector options'}`);\n }\n\n const responseList = getQuerySelectorResponseList(data, responseListKey);\n const filteredItems = isFunction(filterOptions) ? filterOptions(responseList) : responseList;\n\n return mapQuerySelectorOptions(\n filteredItems,\n valueKey,\n labelKey,\n valueResolver,\n labelResolver,\n );\n };\n\n const baseOptionsQuery = useQuery({\n queryKey: ['owp', 'query-selector', apiUrl, query, responseListKey, valueKey, labelKey],\n enabled: Boolean(apiBaseUrl) && !isAsyncSearchEnabled,\n queryFn: () => fetchOptions(query),\n });\n const searchOptionsQuery = useQuery({\n queryKey: [\n 'owp',\n 'query-selector',\n 'search',\n apiUrl,\n query,\n debouncedSearchKeyword,\n responseListKey,\n valueKey,\n labelKey,\n ],\n enabled: Boolean(apiBaseUrl) && isAsyncSearchEnabled && shouldFetchSearchOptions,\n queryFn: () =>\n fetchOptions({\n ...query,\n ...(resolvedAsyncSearch?.buildKeywordQuery(debouncedSearchKeyword) ?? {}),\n }),\n });\n const allOptionsQuery = useQuery({\n queryKey: ['owp', 'query-selector', 'all', apiUrl, query, responseListKey, valueKey, labelKey],\n enabled:\n Boolean(apiBaseUrl) &&\n isAsyncSearchEnabled &&\n (Boolean(selectedIds.length) || (Boolean(multiple) && !resolvedDisableAllValueItem)),\n queryFn: () =>\n fetchOptions({\n ...query,\n ...(resolvedAsyncSearch?.buildAllQuery?.() ?? {}),\n }),\n });\n const selectedOptionsQuery = useQuery({\n queryKey: [\n 'owp',\n 'query-selector',\n 'selected',\n apiUrl,\n selectedIds,\n responseListKey,\n valueKey,\n labelKey,\n ],\n enabled: Boolean(apiBaseUrl) && isAsyncSearchEnabled && Boolean(selectedIds.length) && Boolean(resolvedAsyncSearch?.buildSelectedQuery),\n queryFn: () =>\n fetchOptions({\n ...query,\n ...(resolvedAsyncSearch?.buildSelectedQuery?.(selectedIds) ?? {}),\n }),\n });\n\n const currentOptions = useMemo(() => {\n if (isAsyncSearchEnabled) {\n return shouldFetchSearchOptions ? (searchOptionsQuery.data ?? []) : [];\n }\n\n return baseOptionsQuery.data ?? [];\n }, [\n baseOptionsQuery.data,\n isAsyncSearchEnabled,\n searchOptionsQuery.data,\n shouldFetchSearchOptions,\n ]);\n const resolvedAllOptions = useMemo(\n () =>\n mergeSelectorOptions(\n currentOptions,\n allOptionsQuery.data,\n selectedOptionsQuery.data,\n Object.values(cachedOptions),\n ),\n [allOptionsQuery.data, cachedOptions, currentOptions, selectedOptionsQuery.data],\n );\n const optionMap = useMemo(\n () => {\n const nextOptionMap: Record<string, OwpSelectorBaseOption<Record<string, unknown>>> = {};\n\n resolvedAllOptions.forEach((option) => {\n nextOptionMap[option.value] = option;\n });\n\n return nextOptionMap;\n },\n [resolvedAllOptions],\n );\n const isLoading =\n baseOptionsQuery.isLoading ||\n searchOptionsQuery.isLoading ||\n allOptionsQuery.isLoading ||\n selectedOptionsQuery.isLoading;\n\n useEffect(() => {\n if (!resolvedAllOptions.length) {\n return;\n }\n\n setCachedOptions((previousCachedOptions) => {\n const nextCachedOptions = { ...previousCachedOptions };\n let hasChanged = false;\n\n resolvedAllOptions.forEach((option) => {\n if (nextCachedOptions[option.value] === option) {\n return;\n }\n\n nextCachedOptions[option.value] = option;\n hasChanged = true;\n });\n\n return hasChanged ? nextCachedOptions : previousCachedOptions;\n });\n }, [resolvedAllOptions]);\n\n useEffect(() => {\n if (!isAsyncSearchEnabled) {\n return;\n }\n\n if (multiple) {\n setAutocompleteInputValue('');\n return;\n }\n\n const selectedId = selectedIds[0];\n\n if (!selectedId) {\n setAutocompleteInputValue('');\n return;\n }\n\n setAutocompleteInputValue(getQuerySelectorOptionLabelText(optionMap[selectedId]?.label ?? ''));\n }, [isAsyncSearchEnabled, multiple, optionMap, selectedIds]);\n\n return (\n <OwpSelectorBase\n {...selectorBaseProps}\n allOptions={resolvedAllOptions}\n allValueMode=\"joined\"\n autocompleteInputValue={isAsyncSearchEnabled ? autocompleteInputValue : undefined}\n defaultValue={defaultValue}\n disableAllValueItem={resolvedDisableAllValueItem}\n disableClientFilter={isAsyncSearchEnabled}\n loading={isLoading}\n multiple={multiple}\n onAutocompleteInputChange={\n isAsyncSearchEnabled\n ? (nextInputValue, reason) => {\n if (reason === 'reset') {\n return;\n }\n\n if (multiple && reason !== 'input') {\n return;\n }\n\n setAutocompleteInputValue(nextInputValue);\n setSearchKeyword(nextInputValue);\n }\n : undefined\n }\n onChange={(event) => {\n setCurrentSelectionValue(event.target.value);\n\n if (isAsyncSearchEnabled) {\n const nextSelectedIds = splitSelectorValue(event.target.value);\n\n if (multiple) {\n setAutocompleteInputValue('');\n setSearchKeyword('');\n setDebouncedSearchKeyword('');\n } else {\n const nextSelectedId = nextSelectedIds[0];\n const nextLabel = nextSelectedId\n ? getQuerySelectorOptionLabelText(optionMap[nextSelectedId]?.label ?? '')\n : '';\n\n setAutocompleteInputValue(nextLabel);\n setSearchKeyword('');\n setDebouncedSearchKeyword('');\n }\n }\n\n onChange?.(event);\n }}\n options={currentOptions}\n selectorType={selectorType}\n textFieldProps={{\n ...textFieldProps,\n onBlur: (event) => {\n if (isAsyncSearchEnabled) {\n if (multiple) {\n setAutocompleteInputValue('');\n } else {\n const selectedId = splitSelectorValue(currentSelectionValue)[0];\n\n setAutocompleteInputValue(\n selectedId ? getQuerySelectorOptionLabelText(optionMap[selectedId]?.label ?? '') : '',\n );\n }\n\n setSearchKeyword('');\n setDebouncedSearchKeyword('');\n }\n\n textFieldProps?.onBlur?.(event);\n },\n }}\n value={value}\n />\n );\n};\n"],"names":["DEFAULT_RESPONSE_LIST_KEY","getQuerySelectorOptionLabelText","__name","label","defaultBuildRequestQuery","query","createJsonString","createQuerySelectorRequestUrl","apiBaseUrl","apiUrl","requestQuery","accessToken","baseUrl","requestUrl","key","value","getApiLanguageCode","getQuerySelectorResponseList","data","responseListKey","responseList","isArray","resolveQuerySelectorValue","item","valueKey","valueResolver","resolveQuerySelectorLabel","labelKey","labelResolver","mapQuerySelectorOptions","items","option","OwpQuerySelector","asyncSearch","buildRequestQuery","disableAllValueItem","filterOptions","multiple","selectorType","onChange","defaultValue","textFieldProps","selectorBaseProps","env","useOwpAppContext","currentUser","useGetCurrentUser","STORAGE_ACCESS_TOKEN_KEY","resolvedAsyncSearch","isAsyncSearchEnabled","resolvedDisableAllValueItem","minLength","debounceMs","currentSelectionValue","setCurrentSelectionValue","useState","autocompleteInputValue","setAutocompleteInputValue","searchKeyword","setSearchKeyword","debouncedSearchKeyword","setDebouncedSearchKeyword","cachedOptions","setCachedOptions","selectedIds","useMemo","splitSelectorValue","shouldFetchSearchOptions","useEffect","timer","fetchOptions","nextQuery","response","filteredItems","isFunction","baseOptionsQuery","useQuery","searchOptionsQuery","allOptionsQuery","_a","selectedOptionsQuery","currentOptions","resolvedAllOptions","mergeSelectorOptions","optionMap","nextOptionMap","isLoading","previousCachedOptions","nextCachedOptions","hasChanged","selectedId","jsx","OwpSelectorBase","nextInputValue","reason","event","nextSelectedIds","nextSelectedId","nextLabel","_b"],"mappings":";;;;;;;;;;;;;;AAaA,MAAMA,KAA4B,cAM5BC,IAAkC,gBAAAC,EAAA,CAACC,MAChC,OAAOA,KAAU,YAAY,OAAOA,KAAU,WAAW,GAAGA,CAAK,KAAK,IADvC,oCAQlCC,KAA2B,gBAAAF,EAAA,CAACG,OACzB;AAAA,EACL,UAAUC,GAAiBD,CAAK;AAAA,IAFH,6BAa3BE,KAAgC,gBAAAL,EAAA,CACpCM,GACAC,GACAC,GACAC,MACG;AACH,QAAMC,IAAU,IAAI,IAAIJ,EAAW,SAAS,GAAG,IAAIA,IAAa,GAAGA,CAAU,GAAG,GAC1EK,IAAa,IAAI,IAAIJ,EAAO,WAAW,GAAG,IAAIA,EAAO,MAAM,CAAC,IAAIA,GAAQG,CAAO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6F,MAAU;;AACjB,cAAI9C,GAAsB;AACxB,gBAAIZ;AACF,cAAAoB,EAA0B,EAAE;AAAA,iBACvB;AACL,oBAAMiC,IAAaxB,EAAmBb,CAAqB,EAAE,CAAC;AAE9D,cAAAI;AAAA,gBACEiC,IAAazF,IAAgC8E,IAAAK,EAAUM,CAAU,MAApB,gBAAAX,EAAuB,UAAS,EAAE,IAAI;AAAA,cAAA;AAAA,YAEvF;AAEA,YAAApB,EAAiB,EAAE,GACnBE,EAA0B,EAAE;AAAA,UAC9B;AAEA,WAAAsC,IAAA1D,KAAA,gBAAAA,EAAgB,WAAhB,QAAA0D,EAAA,KAAA1D,GAAyBsD;AAAA,QAC3B,GAjBQ;AAAA,MAiBR;AAAA,MAEF,OAAAhF;AAAA,IAAA;AAAA,EAAA;AAGN,GA/SgC;"}
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var n = (a, s) => ge(a, "name", { value: s, configurable: !0 });
|
|
3
|
+
import { jsxs as C, jsx as r, Fragment as M } 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 { createElement as xe } from "@emotion/react";
|
|
5
|
+
import { useOwpTranslation as be } from "../../hooks/useOwpTranslation.js";
|
|
6
|
+
import Y 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/ArrowDropDown.js";
|
|
7
|
+
import F 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 { Box as ve, Chip as E, Checkbox as Ae, TextField as ee, CircularProgress as te, Autocomplete as oe, ClickAwayListener as ye, Paper as Se, Popper as Me } from "@mui/material";
|
|
9
|
+
import { alpha as g } from "@mui/material/styles";
|
|
10
|
+
import { clsx as ne } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
11
|
+
import { useMemo as le, useState as Ee, useRef as re, useEffect as ie } from "react";
|
|
12
|
+
import { isSelectorAllOption as h } from "./utils/querySelectorUtils.js";
|
|
13
|
+
const ae = 2, we = 152, se = 72, ue = 18.57, pe = /* @__PURE__ */ n((a, s) => {
|
|
14
|
+
const u = a.target;
|
|
15
|
+
return u instanceof HTMLInputElement ? u.value : s ?? "";
|
|
16
|
+
}, "getCurrentAutocompleteInputValue"), ce = /* @__PURE__ */ n((a) => typeof a == "string" || typeof a == "number" ? `${a}` : "", "getAutocompleteOptionLabel"), Be = /* @__PURE__ */ n(({ hookResult: a, props: s }) => {
|
|
17
|
+
const { t: u } = be(), {
|
|
18
|
+
autocompleteInputValue: d,
|
|
19
|
+
className: w,
|
|
20
|
+
disableAllValueItem: f,
|
|
21
|
+
disableClientFilter: k,
|
|
22
|
+
disabled: I,
|
|
23
|
+
error: L,
|
|
24
|
+
fullWidth: O,
|
|
25
|
+
helperText: D,
|
|
26
|
+
label: V,
|
|
27
|
+
loading: T,
|
|
28
|
+
loadingText: N,
|
|
29
|
+
multiple: z,
|
|
30
|
+
noOptionsText: me,
|
|
31
|
+
onAutocompleteInputChange: c,
|
|
32
|
+
placeholder: R,
|
|
33
|
+
required: P,
|
|
34
|
+
textFieldProps: o
|
|
35
|
+
} = s, {
|
|
36
|
+
allOption: x,
|
|
37
|
+
clearSelection: _,
|
|
38
|
+
isAllSelected: m,
|
|
39
|
+
resolvedOptions: H,
|
|
40
|
+
restoreAllSelection: W,
|
|
41
|
+
selectAll: B,
|
|
42
|
+
selectedOption: de,
|
|
43
|
+
selectedOptions: b,
|
|
44
|
+
selectMultipleValues: U,
|
|
45
|
+
selectSingleValue: $
|
|
46
|
+
} = a, q = f ? H : [x, ...H], v = le(
|
|
47
|
+
() => b.filter((e) => !h(e)),
|
|
48
|
+
[b]
|
|
49
|
+
), K = le(
|
|
50
|
+
() => m ? [] : v.slice(ae),
|
|
51
|
+
[v, m]
|
|
52
|
+
), p = K.length, [j, A] = Ee(null), Z = re(null), G = me ?? u("Message.검색 결과 없음"), J = re(
|
|
53
|
+
z && !f && ((s.value ?? s.defaultValue) == null || (s.value ?? s.defaultValue) === "")
|
|
54
|
+
), Q = {
|
|
55
|
+
clearIndicator: {
|
|
56
|
+
className: "m-0 p-0",
|
|
57
|
+
size: "small"
|
|
58
|
+
},
|
|
59
|
+
paper: {
|
|
60
|
+
sx: {
|
|
61
|
+
"& .MuiAutocomplete-noOptions": {
|
|
62
|
+
fontSize: 14,
|
|
63
|
+
px: 1,
|
|
64
|
+
py: 1.5,
|
|
65
|
+
whiteSpace: "nowrap"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
popupIndicator: {
|
|
70
|
+
className: "m-0 p-0",
|
|
71
|
+
size: "small"
|
|
72
|
+
}
|
|
73
|
+
}, X = {
|
|
74
|
+
minWidth: we,
|
|
75
|
+
"& .MuiAutocomplete-endAdornment": {
|
|
76
|
+
"& .MuiAutocomplete-clearIndicator + .MuiAutocomplete-popupIndicator": {
|
|
77
|
+
ml: 0
|
|
78
|
+
},
|
|
79
|
+
"& .MuiIconButton-root": {
|
|
80
|
+
m: 0,
|
|
81
|
+
p: 0
|
|
82
|
+
},
|
|
83
|
+
"& > :not(style) + :not(style)": {
|
|
84
|
+
ml: 0
|
|
85
|
+
},
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
gap: 0,
|
|
88
|
+
right: 0
|
|
89
|
+
}
|
|
90
|
+
}, fe = {
|
|
91
|
+
...X,
|
|
92
|
+
"& .MuiAutocomplete-inputRoot .MuiAutocomplete-input": {
|
|
93
|
+
flexBasis: se,
|
|
94
|
+
minWidth: se
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
ie(() => {
|
|
98
|
+
p || A(null);
|
|
99
|
+
}, [p]), ie(() => {
|
|
100
|
+
var l;
|
|
101
|
+
if (!J.current)
|
|
102
|
+
return;
|
|
103
|
+
const e = (l = Z.current) == null ? void 0 : l.closest("form");
|
|
104
|
+
if (!e)
|
|
105
|
+
return;
|
|
106
|
+
const t = /* @__PURE__ */ n(() => {
|
|
107
|
+
window.setTimeout(() => {
|
|
108
|
+
W();
|
|
109
|
+
}, 0);
|
|
110
|
+
}, "handleFormReset");
|
|
111
|
+
return e.addEventListener("reset", t), () => {
|
|
112
|
+
e.removeEventListener("reset", t);
|
|
113
|
+
};
|
|
114
|
+
}, [W]);
|
|
115
|
+
const he = /* @__PURE__ */ n(() => {
|
|
116
|
+
A(null);
|
|
117
|
+
}, "handleHiddenChipPopperClose"), Ie = /* @__PURE__ */ n((e) => {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
}, "handleHiddenChipSummaryMouseDown"), Oe = /* @__PURE__ */ n((e) => {
|
|
120
|
+
e.preventDefault(), e.stopPropagation(), A(
|
|
121
|
+
(t) => t === e.currentTarget ? null : e.currentTarget
|
|
122
|
+
);
|
|
123
|
+
}, "handleHiddenChipSummaryClick"), Te = /* @__PURE__ */ n((e) => {
|
|
124
|
+
U(
|
|
125
|
+
v.filter((t) => t.value !== e).map((t) => t.value)
|
|
126
|
+
);
|
|
127
|
+
}, "handleHiddenChipDelete"), Ce = /* @__PURE__ */ n((e) => {
|
|
128
|
+
var l;
|
|
129
|
+
const t = pe(e, d);
|
|
130
|
+
(m || p > 0) && t === "" && (e.key === "Backspace" || e.key === "Delete") && (e.defaultMuiPrevented = !0, e.preventDefault(), e.stopPropagation()), (l = o == null ? void 0 : o.onKeyDown) == null || l.call(o, e);
|
|
131
|
+
}, "handleMultipleRootKeyDown");
|
|
132
|
+
return z ? /* @__PURE__ */ C(M, { children: [
|
|
133
|
+
/* @__PURE__ */ r(
|
|
134
|
+
oe,
|
|
135
|
+
{
|
|
136
|
+
ref: Z,
|
|
137
|
+
className: ne("min-w-128", w),
|
|
138
|
+
disableCloseOnSelect: !0,
|
|
139
|
+
disabled: I,
|
|
140
|
+
filterOptions: k ? (e) => e : void 0,
|
|
141
|
+
fullWidth: O,
|
|
142
|
+
inputValue: d,
|
|
143
|
+
loading: T,
|
|
144
|
+
multiple: !0,
|
|
145
|
+
options: q,
|
|
146
|
+
clearText: "",
|
|
147
|
+
closeText: "",
|
|
148
|
+
clearIcon: /* @__PURE__ */ r(F, { sx: { fontSize: ue } }),
|
|
149
|
+
openText: "",
|
|
150
|
+
popupIcon: /* @__PURE__ */ r(Y, {}),
|
|
151
|
+
sx: fe,
|
|
152
|
+
value: b,
|
|
153
|
+
getOptionLabel: /* @__PURE__ */ n((e) => ce(e.label), "getOptionLabel"),
|
|
154
|
+
isOptionEqualToValue: /* @__PURE__ */ n((e, t) => e.value === t.value, "isOptionEqualToValue"),
|
|
155
|
+
loadingText: N ?? u("Common.로딩 중..."),
|
|
156
|
+
noOptionsText: G,
|
|
157
|
+
onChange: /* @__PURE__ */ n((e, t, l, i) => {
|
|
158
|
+
const y = e.type === "keydown" ? pe(
|
|
159
|
+
e,
|
|
160
|
+
d
|
|
161
|
+
) : d ?? "";
|
|
162
|
+
if (l === "removeOption" && e.type === "keydown" && y === "" && (m || p > 0)) {
|
|
163
|
+
e.preventDefault(), e.stopPropagation();
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (l === "clear") {
|
|
167
|
+
if (J.current) {
|
|
168
|
+
B();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
_();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (!f && (i != null && i.option) && h(i.option)) {
|
|
175
|
+
if (m) {
|
|
176
|
+
_();
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
B();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
U(
|
|
183
|
+
t.filter((S) => !h(S)).map((S) => S.value)
|
|
184
|
+
);
|
|
185
|
+
}, "onChange"),
|
|
186
|
+
onInputChange: /* @__PURE__ */ n((e, t, l) => {
|
|
187
|
+
c == null || c(t, l);
|
|
188
|
+
}, "onInputChange"),
|
|
189
|
+
onKeyDown: Ce,
|
|
190
|
+
slotProps: Q,
|
|
191
|
+
renderInput: /* @__PURE__ */ n((e) => {
|
|
192
|
+
var t;
|
|
193
|
+
return /* @__PURE__ */ r(
|
|
194
|
+
ee,
|
|
195
|
+
{
|
|
196
|
+
...e,
|
|
197
|
+
...o,
|
|
198
|
+
disabled: I,
|
|
199
|
+
error: L,
|
|
200
|
+
fullWidth: O,
|
|
201
|
+
helperText: D,
|
|
202
|
+
label: V,
|
|
203
|
+
placeholder: R ?? u("Common.검색"),
|
|
204
|
+
required: P,
|
|
205
|
+
slotProps: {
|
|
206
|
+
...o == null ? void 0 : o.slotProps,
|
|
207
|
+
input: {
|
|
208
|
+
...e.InputProps,
|
|
209
|
+
...(t = o == null ? void 0 : o.slotProps) == null ? void 0 : t.input,
|
|
210
|
+
endAdornment: /* @__PURE__ */ C(M, { children: [
|
|
211
|
+
T ? /* @__PURE__ */ r(te, { color: "inherit", size: 16, sx: { mr: 0.5 } }) : null,
|
|
212
|
+
e.InputProps.endAdornment
|
|
213
|
+
] })
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
variant: (o == null ? void 0 : o.variant) ?? "standard"
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}, "renderInput"),
|
|
220
|
+
renderOption: /* @__PURE__ */ n((e, t, l) => /* @__PURE__ */ C("li", { ...e, children: [
|
|
221
|
+
/* @__PURE__ */ r(Ae, { checked: l.selected, className: "!mr-8 !p-0", size: "small" }),
|
|
222
|
+
t.label
|
|
223
|
+
] }), "renderOption"),
|
|
224
|
+
renderValue: /* @__PURE__ */ n((e, t) => !f && m ? [
|
|
225
|
+
/* @__PURE__ */ r(
|
|
226
|
+
ve,
|
|
227
|
+
{
|
|
228
|
+
component: "span",
|
|
229
|
+
sx: { color: "text.primary", fontWeight: 500, mr: 0.5 },
|
|
230
|
+
children: x.label
|
|
231
|
+
},
|
|
232
|
+
x.value
|
|
233
|
+
)
|
|
234
|
+
] : [
|
|
235
|
+
...e.filter((i) => !h(i)).slice(0, ae).map((i, y) => /* @__PURE__ */ xe(
|
|
236
|
+
E,
|
|
237
|
+
{
|
|
238
|
+
...t({ index: y }),
|
|
239
|
+
key: i.value,
|
|
240
|
+
label: i.label,
|
|
241
|
+
size: "small",
|
|
242
|
+
sx: { borderRadius: 1, mr: 0.5 }
|
|
243
|
+
}
|
|
244
|
+
)),
|
|
245
|
+
...p > 0 ? [
|
|
246
|
+
/* @__PURE__ */ r(
|
|
247
|
+
E,
|
|
248
|
+
{
|
|
249
|
+
clickable: !0,
|
|
250
|
+
label: `+${p}`,
|
|
251
|
+
onClick: Oe,
|
|
252
|
+
onMouseDown: Ie,
|
|
253
|
+
size: "small",
|
|
254
|
+
sx: /* @__PURE__ */ n((i) => ({
|
|
255
|
+
backgroundColor: g(i.palette.primary.main, 0.14),
|
|
256
|
+
border: `1px solid ${g(i.palette.primary.main, 0.22)}`,
|
|
257
|
+
borderRadius: 1,
|
|
258
|
+
color: i.palette.primary.dark,
|
|
259
|
+
fontWeight: 600,
|
|
260
|
+
mr: 0.5,
|
|
261
|
+
"&:hover": {
|
|
262
|
+
backgroundColor: g(i.palette.primary.main, 0.2)
|
|
263
|
+
}
|
|
264
|
+
}), "sx")
|
|
265
|
+
},
|
|
266
|
+
"owp-selector-hidden-chip-summary"
|
|
267
|
+
)
|
|
268
|
+
] : []
|
|
269
|
+
], "renderValue")
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
/* @__PURE__ */ r(
|
|
273
|
+
Me,
|
|
274
|
+
{
|
|
275
|
+
anchorEl: j,
|
|
276
|
+
open: !!j && p > 0,
|
|
277
|
+
placement: "bottom-start",
|
|
278
|
+
sx: { zIndex: /* @__PURE__ */ n((e) => e.zIndex.modal, "zIndex") },
|
|
279
|
+
children: /* @__PURE__ */ r(ye, { onClickAway: he, children: /* @__PURE__ */ r(
|
|
280
|
+
Se,
|
|
281
|
+
{
|
|
282
|
+
className: "mt-4",
|
|
283
|
+
sx: {
|
|
284
|
+
border: /* @__PURE__ */ n((e) => `1px solid ${g(e.palette.common.black, 0.12)}`, "border"),
|
|
285
|
+
display: "flex",
|
|
286
|
+
flexWrap: "wrap",
|
|
287
|
+
gap: 0.75,
|
|
288
|
+
maxWidth: 280,
|
|
289
|
+
p: 1
|
|
290
|
+
},
|
|
291
|
+
children: K.map((e) => /* @__PURE__ */ r(
|
|
292
|
+
E,
|
|
293
|
+
{
|
|
294
|
+
label: e.label,
|
|
295
|
+
onDelete: /* @__PURE__ */ n(() => Te(e.value), "onDelete"),
|
|
296
|
+
size: "small",
|
|
297
|
+
sx: { borderRadius: 1 }
|
|
298
|
+
},
|
|
299
|
+
e.value
|
|
300
|
+
))
|
|
301
|
+
}
|
|
302
|
+
) })
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
] }) : /* @__PURE__ */ r(
|
|
306
|
+
oe,
|
|
307
|
+
{
|
|
308
|
+
className: ne("min-w-128", w),
|
|
309
|
+
disabled: I,
|
|
310
|
+
filterOptions: k ? (e) => e : void 0,
|
|
311
|
+
fullWidth: O,
|
|
312
|
+
inputValue: d,
|
|
313
|
+
loading: T,
|
|
314
|
+
options: q,
|
|
315
|
+
clearText: "",
|
|
316
|
+
closeText: "",
|
|
317
|
+
clearIcon: /* @__PURE__ */ r(F, { sx: { fontSize: ue } }),
|
|
318
|
+
openText: "",
|
|
319
|
+
popupIcon: /* @__PURE__ */ r(Y, {}),
|
|
320
|
+
sx: X,
|
|
321
|
+
value: de,
|
|
322
|
+
getOptionLabel: /* @__PURE__ */ n((e) => ce(e.label), "getOptionLabel"),
|
|
323
|
+
isOptionEqualToValue: /* @__PURE__ */ n((e, t) => e.value === t.value, "isOptionEqualToValue"),
|
|
324
|
+
loadingText: N ?? u("Common.로딩 중..."),
|
|
325
|
+
noOptionsText: G,
|
|
326
|
+
onChange: /* @__PURE__ */ n((e, t) => {
|
|
327
|
+
if (!t || !f && h(t)) {
|
|
328
|
+
$("");
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
$(t.value);
|
|
332
|
+
}, "onChange"),
|
|
333
|
+
onInputChange: /* @__PURE__ */ n((e, t, l) => {
|
|
334
|
+
c == null || c(t, l);
|
|
335
|
+
}, "onInputChange"),
|
|
336
|
+
slotProps: Q,
|
|
337
|
+
renderInput: /* @__PURE__ */ n((e) => {
|
|
338
|
+
var t, l, i;
|
|
339
|
+
return /* @__PURE__ */ r(
|
|
340
|
+
ee,
|
|
341
|
+
{
|
|
342
|
+
...e,
|
|
343
|
+
...o,
|
|
344
|
+
disabled: I,
|
|
345
|
+
error: L,
|
|
346
|
+
fullWidth: O,
|
|
347
|
+
helperText: D,
|
|
348
|
+
label: V,
|
|
349
|
+
placeholder: R,
|
|
350
|
+
required: P,
|
|
351
|
+
slotProps: {
|
|
352
|
+
...o == null ? void 0 : o.slotProps,
|
|
353
|
+
input: {
|
|
354
|
+
...e.InputProps,
|
|
355
|
+
...(t = o == null ? void 0 : o.slotProps) == null ? void 0 : t.input,
|
|
356
|
+
sx: {
|
|
357
|
+
"& .MuiAutocomplete-input, & .MuiInputBase-input": {
|
|
358
|
+
paddingLeft: "11px !important"
|
|
359
|
+
},
|
|
360
|
+
...e.InputProps.sx ?? {},
|
|
361
|
+
...((i = (l = o == null ? void 0 : o.slotProps) == null ? void 0 : l.input) == null ? void 0 : i.sx) ?? {}
|
|
362
|
+
},
|
|
363
|
+
endAdornment: /* @__PURE__ */ C(M, { children: [
|
|
364
|
+
T ? /* @__PURE__ */ r(te, { color: "inherit", size: 16, sx: { mr: 0.5 } }) : null,
|
|
365
|
+
e.InputProps.endAdornment
|
|
366
|
+
] })
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
variant: (o == null ? void 0 : o.variant) ?? "standard"
|
|
370
|
+
}
|
|
371
|
+
);
|
|
372
|
+
}, "renderInput"),
|
|
373
|
+
selectOnFocus: !0,
|
|
374
|
+
renderOption: /* @__PURE__ */ n((e, t) => /* @__PURE__ */ r("li", { ...e, children: t.label }), "renderOption")
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
}, "OwpSelectorAutocomplete");
|
|
378
|
+
export {
|
|
379
|
+
Be as OwpSelectorAutocomplete
|
|
380
|
+
};
|
|
381
|
+
//# sourceMappingURL=OwpSelectorAutocomplete.js.map
|