@bluewardai/react-ui 0.1.0 → 0.2.0
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/CHANGELOG.md +66 -0
- package/dist/index.js +3059 -178
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as r, memo as i, use as a, useCallback as o, useDeferredValue as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
|
|
3
3
|
// src/utils/cx.js
|
|
4
|
-
function
|
|
4
|
+
function g(...e) {
|
|
5
5
|
return e.filter(Boolean).join(" ");
|
|
6
6
|
}
|
|
7
|
-
var
|
|
7
|
+
var _ = {
|
|
8
8
|
badge: "bw-badge-RsuMz",
|
|
9
9
|
dot: "bw-dot-i0c-G",
|
|
10
10
|
success: "bw-success-u9JiS",
|
|
@@ -14,18 +14,18 @@ var o = {
|
|
|
14
14
|
neutral: "bw-neutral-lulSm"
|
|
15
15
|
};
|
|
16
16
|
// src/components/Badge/Badge.jsx
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
className:
|
|
20
|
-
...
|
|
21
|
-
children: [r && /* @__PURE__ */
|
|
22
|
-
className:
|
|
17
|
+
function v({ tone: e = "neutral", dot: r = !0, className: i, children: a, ...o }) {
|
|
18
|
+
return /* @__PURE__ */ n("span", {
|
|
19
|
+
className: g(_.badge, _[e], i),
|
|
20
|
+
...o,
|
|
21
|
+
children: [r && /* @__PURE__ */ t("span", {
|
|
22
|
+
className: _.dot,
|
|
23
23
|
"aria-hidden": "true"
|
|
24
|
-
}),
|
|
24
|
+
}), a]
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
// src/components/Icon/icons.js
|
|
28
|
-
var
|
|
28
|
+
var y = {
|
|
29
29
|
grid: "<rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"1.5\"/>",
|
|
30
30
|
file: "<path d=\"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z\"/><path d=\"M14 3v6h6\"/><path d=\"M8 13h8M8 17h5\"/>",
|
|
31
31
|
link: "<path d=\"M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1\"/><path d=\"M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1\"/>",
|
|
@@ -59,11 +59,21 @@ var c = {
|
|
|
59
59
|
refresh: "<path d=\"M20 12a8 8 0 1 1-2.34-5.66L20 8.5\"/><path d=\"M20 4v4.5h-4.5\"/>",
|
|
60
60
|
columns: "<rect x=\"3.5\" y=\"4\" width=\"17\" height=\"16\" rx=\"2\"/><path d=\"M9.5 4v16M14.5 4v16\"/>",
|
|
61
61
|
sort: "<path d=\"M8 4v16M4 8l4-4 4 4M16 20V4M12 16l4 4 4-4\"/>",
|
|
62
|
-
external: "<path d=\"M14 4h6v6M20 4l-9 9M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\"/>"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
external: "<path d=\"M14 4h6v6M20 4l-9 9M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\"/>",
|
|
63
|
+
home: "<path d=\"M4 10.5L12 4l8 6.5\"/><path d=\"M6 9v10.5h12V9\"/><path d=\"M10 19.5v-5h4v5\"/>",
|
|
64
|
+
user: "<circle cx=\"12\" cy=\"8.5\" r=\"3.5\"/><path d=\"M5 19.5c1.2-3.3 3.8-5 7-5s5.8 1.7 7 5\"/>",
|
|
65
|
+
logout: "<path d=\"M10 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h4\"/><path d=\"M15 8l4 4-4 4M19 12H9.5\"/>",
|
|
66
|
+
menu: "<path d=\"M4 7h16M4 12h16M4 17h16\"/>",
|
|
67
|
+
lock: "<rect x=\"5\" y=\"10.5\" width=\"14\" height=\"10\" rx=\"2\"/><path d=\"M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5\"/>",
|
|
68
|
+
eye: "<path d=\"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>",
|
|
69
|
+
eyeOff: "<path d=\"M4 4l16 16\"/><path d=\"M9.9 6A9.6 9.6 0 0 1 12 5.5c6 0 9.5 6.5 9.5 6.5a16 16 0 0 1-2.6 3.4M6.4 7.6C3.9 9.3 2.5 12 2.5 12S6 18.5 12 18.5c1.6 0 3-.4 4.2-1\"/><path d=\"M10 10.2a3 3 0 0 0 4 4\"/>",
|
|
70
|
+
sun: "<circle cx=\"12\" cy=\"12\" r=\"4\"/><path d=\"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4\"/>",
|
|
71
|
+
moon: "<path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z\"/>",
|
|
72
|
+
monitor: "<rect x=\"3\" y=\"4.5\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M8.5 20h7M12 16.5V20\"/>"
|
|
73
|
+
}, b = Object.keys(y);
|
|
74
|
+
function x({ name: e, size: n = 20, label: r, className: i, ...a }) {
|
|
75
|
+
let o = y[e];
|
|
76
|
+
return o ? /* @__PURE__ */ t("svg", {
|
|
67
77
|
width: n,
|
|
68
78
|
height: n,
|
|
69
79
|
viewBox: "0 0 24 24",
|
|
@@ -81,64 +91,87 @@ function u({ name: t, size: n = 20, label: r, className: i, ...a }) {
|
|
|
81
91
|
...a
|
|
82
92
|
}) : null;
|
|
83
93
|
}
|
|
84
|
-
var
|
|
94
|
+
var S = {
|
|
85
95
|
spinner: "bw-spinner-GpFZS",
|
|
86
96
|
spin: "bw-spin-LFfLH"
|
|
87
97
|
};
|
|
88
98
|
// src/components/Spinner/Spinner.jsx
|
|
89
|
-
function
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
className:
|
|
99
|
+
function C({ size: e = 16, label: n, className: r }) {
|
|
100
|
+
return /* @__PURE__ */ t("span", {
|
|
101
|
+
className: g(S.spinner, r),
|
|
92
102
|
style: {
|
|
93
|
-
width:
|
|
94
|
-
height:
|
|
103
|
+
width: e,
|
|
104
|
+
height: e
|
|
95
105
|
},
|
|
96
106
|
role: n ? "status" : void 0,
|
|
97
107
|
"aria-label": n,
|
|
98
108
|
"aria-hidden": !n || void 0
|
|
99
109
|
});
|
|
100
110
|
}
|
|
101
|
-
var
|
|
111
|
+
var w = {
|
|
102
112
|
button: "bw-button-2ZuB7",
|
|
113
|
+
link: "bw-link-Zt5hw",
|
|
103
114
|
label: "bw-label-UJ3Zt",
|
|
104
115
|
sm: "bw-sm-NhG0g",
|
|
105
116
|
md: "bw-md-hH4h3",
|
|
106
117
|
lg: "bw-lg-2plQf",
|
|
107
118
|
fullWidth: "bw-fullWidth-36oJT",
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
119
|
+
"tone-brand": "bw-tone-brand-kz9-e",
|
|
120
|
+
"tone-neutral": "bw-tone-neutral-a51Ij",
|
|
121
|
+
"tone-danger": "bw-tone-danger-RoCWI",
|
|
122
|
+
"tone-success": "bw-tone-success-ihcct",
|
|
123
|
+
solid: "bw-solid--Lgrt",
|
|
124
|
+
soft: "bw-soft-c3kzm",
|
|
125
|
+
outline: "bw-outline-F5jq-",
|
|
126
|
+
ghost: "bw-ghost-1KINV"
|
|
127
|
+
}, T = {
|
|
113
128
|
sm: 16,
|
|
114
129
|
md: 18,
|
|
115
130
|
lg: 20
|
|
131
|
+
}, E = {
|
|
132
|
+
primary: ["solid", "brand"],
|
|
133
|
+
secondary: ["outline", "neutral"],
|
|
134
|
+
danger: ["solid", "danger"],
|
|
135
|
+
ghost: ["ghost", "brand"]
|
|
136
|
+
}, ee = {
|
|
137
|
+
solid: "brand",
|
|
138
|
+
soft: "brand",
|
|
139
|
+
outline: "neutral",
|
|
140
|
+
ghost: "brand",
|
|
141
|
+
link: "brand"
|
|
116
142
|
};
|
|
117
|
-
function
|
|
118
|
-
let v =
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
ref:
|
|
121
|
-
type:
|
|
122
|
-
className:
|
|
123
|
-
disabled:
|
|
124
|
-
"aria-busy":
|
|
125
|
-
...
|
|
126
|
-
children: [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
143
|
+
function D({ variant: e = "outline", tone: r, size: i = "md", icon: a, iconEnd: o, loading: s = !1, fullWidth: c = !1, disabled: l = !1, type: u = "button", className: d, children: f, ref: p, ...m }) {
|
|
144
|
+
let [h, _] = E[e] ?? [e, void 0], v = r ?? _ ?? ee[h] ?? "brand", y = l || s;
|
|
145
|
+
return /* @__PURE__ */ n("button", {
|
|
146
|
+
ref: p,
|
|
147
|
+
type: u,
|
|
148
|
+
className: g(w.button, w[h], w[`tone-${v}`], w[i], c && w.fullWidth, d),
|
|
149
|
+
disabled: y,
|
|
150
|
+
"aria-busy": s || void 0,
|
|
151
|
+
...m,
|
|
152
|
+
children: [
|
|
153
|
+
s ? /* @__PURE__ */ t(C, { size: T[i] - 2 }) : a && /* @__PURE__ */ t(x, {
|
|
154
|
+
name: a,
|
|
155
|
+
size: T[i]
|
|
156
|
+
}),
|
|
157
|
+
f != null && /* @__PURE__ */ t("span", {
|
|
158
|
+
className: w.label,
|
|
159
|
+
children: f
|
|
160
|
+
}),
|
|
161
|
+
o && !s && /* @__PURE__ */ t(x, {
|
|
162
|
+
name: o,
|
|
163
|
+
size: T[i]
|
|
164
|
+
})
|
|
165
|
+
]
|
|
133
166
|
});
|
|
134
167
|
}
|
|
135
168
|
// src/utils/mergeRefs.js
|
|
136
|
-
function
|
|
169
|
+
function O(...e) {
|
|
137
170
|
return (t) => {
|
|
138
171
|
for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
|
|
139
172
|
};
|
|
140
173
|
}
|
|
141
|
-
var
|
|
174
|
+
var k = {
|
|
142
175
|
checkbox: "bw-checkbox-lSeQj",
|
|
143
176
|
input: "bw-input-2kt-h",
|
|
144
177
|
box: "bw-box-OCPee",
|
|
@@ -147,37 +180,2239 @@ var _ = {
|
|
|
147
180
|
label: "bw-label-cwRtI"
|
|
148
181
|
};
|
|
149
182
|
// src/components/Checkbox/Checkbox.jsx
|
|
150
|
-
function
|
|
151
|
-
return /* @__PURE__ */
|
|
152
|
-
className:
|
|
183
|
+
function te({ checked: e, indeterminate: r = !1, disabled: i, className: a, children: o, ref: s, ...c }) {
|
|
184
|
+
return /* @__PURE__ */ n("label", {
|
|
185
|
+
className: g(k.checkbox, i && k.disabled, a),
|
|
153
186
|
children: [
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
ref:
|
|
187
|
+
/* @__PURE__ */ t("input", {
|
|
188
|
+
ref: O((e) => {
|
|
156
189
|
e && (e.indeterminate = r);
|
|
157
|
-
},
|
|
190
|
+
}, s),
|
|
158
191
|
type: "checkbox",
|
|
159
|
-
className:
|
|
160
|
-
checked:
|
|
192
|
+
className: k.input,
|
|
193
|
+
checked: e,
|
|
161
194
|
disabled: i,
|
|
162
|
-
...
|
|
195
|
+
...c
|
|
163
196
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
className:
|
|
197
|
+
/* @__PURE__ */ t("span", {
|
|
198
|
+
className: k.box,
|
|
166
199
|
"aria-hidden": "true",
|
|
167
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ t(x, {
|
|
168
201
|
name: r ? "minus" : "check",
|
|
169
202
|
size: 14,
|
|
170
|
-
className:
|
|
203
|
+
className: k.mark
|
|
171
204
|
})
|
|
172
205
|
}),
|
|
173
|
-
|
|
174
|
-
className:
|
|
175
|
-
children:
|
|
206
|
+
o != null && /* @__PURE__ */ t("span", {
|
|
207
|
+
className: k.label,
|
|
208
|
+
children: o
|
|
176
209
|
})
|
|
177
210
|
]
|
|
178
211
|
});
|
|
179
212
|
}
|
|
180
|
-
var
|
|
213
|
+
var ne = {
|
|
214
|
+
iconButton: "bw-iconButton-JAF-a",
|
|
215
|
+
sm: "bw-sm--tgrW",
|
|
216
|
+
md: "bw-md-Rq8Ph",
|
|
217
|
+
ghost: "bw-ghost-Xo7aA",
|
|
218
|
+
secondary: "bw-secondary-bawOo"
|
|
219
|
+
};
|
|
220
|
+
// src/components/IconButton/IconButton.jsx
|
|
221
|
+
function re({ icon: e, label: n, variant: r = "ghost", size: i = "md", type: a = "button", className: o, ref: s, ...c }) {
|
|
222
|
+
return /* @__PURE__ */ t("button", {
|
|
223
|
+
ref: s,
|
|
224
|
+
type: a,
|
|
225
|
+
"aria-label": n,
|
|
226
|
+
title: n,
|
|
227
|
+
className: g(ne.iconButton, ne[r], ne[i], o),
|
|
228
|
+
...c,
|
|
229
|
+
children: /* @__PURE__ */ t(x, {
|
|
230
|
+
name: e,
|
|
231
|
+
size: i === "sm" ? 16 : 20
|
|
232
|
+
})
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
var A = {
|
|
236
|
+
root: "bw-root-FniYz",
|
|
237
|
+
toolbar: "bw-toolbar-cuegZ",
|
|
238
|
+
toolbarLeft: "bw-toolbarLeft-jJBG7",
|
|
239
|
+
toolbarRight: "bw-toolbarRight-gqUdb",
|
|
240
|
+
title: "bw-title-n-Reh",
|
|
241
|
+
search: "bw-search-OAem9",
|
|
242
|
+
progress: "bw-progress-cvUtT",
|
|
243
|
+
scroller: "bw-scroller-REFtT",
|
|
244
|
+
content: "bw-content-UAlFW",
|
|
245
|
+
header: "bw-header-zyNBW",
|
|
246
|
+
headerCell: "bw-headerCell-32SWs",
|
|
247
|
+
groupCell: "bw-groupCell-m7WD8",
|
|
248
|
+
headerLabel: "bw-headerLabel-VaXx5",
|
|
249
|
+
static: "bw-static-ZXE5j",
|
|
250
|
+
labelText: "bw-labelText-QaTLV",
|
|
251
|
+
sortIcon: "bw-sortIcon-mYGae",
|
|
252
|
+
sorted: "bw-sorted-HexTD",
|
|
253
|
+
sortOrder: "bw-sortOrder-AR-Si",
|
|
254
|
+
"align-right": "bw-align-right-K-ZFS",
|
|
255
|
+
"align-center": "bw-align-center-KkelN",
|
|
256
|
+
filterButton: "bw-filterButton-PlvKt",
|
|
257
|
+
filterActive: "bw-filterActive-eBehN",
|
|
258
|
+
resizeHandle: "bw-resizeHandle-GoYFE",
|
|
259
|
+
summaryRow: "bw-summaryRow-p72Wm",
|
|
260
|
+
summaryBottom: "bw-summaryBottom-rTI0S",
|
|
261
|
+
summaryCount: "bw-summaryCount-NWI0w",
|
|
262
|
+
body: "bw-body-mVZwc",
|
|
263
|
+
row: "bw-row-bVXQ9",
|
|
264
|
+
selected: "bw-selected-iSn10",
|
|
265
|
+
cell: "bw-cell-UTG-6",
|
|
266
|
+
linesAll: "bw-linesAll-hJeH-",
|
|
267
|
+
cellText: "bw-cellText-mAaZT",
|
|
268
|
+
activeCell: "bw-activeCell-tzyzv",
|
|
269
|
+
spacer: "bw-spacer-988LR",
|
|
270
|
+
pinned: "bw-pinned-Oi0fH",
|
|
271
|
+
edgeLeft: "bw-edgeLeft-qhCeJ",
|
|
272
|
+
edgeRight: "bw-edgeRight-lIjrh",
|
|
273
|
+
scrolledLeft: "bw-scrolledLeft-YpQvn",
|
|
274
|
+
scrolledRight: "bw-scrolledRight-6LnPx",
|
|
275
|
+
mark: "bw-mark-Mcb8o",
|
|
276
|
+
stateArea: "bw-stateArea-R-Gsr",
|
|
277
|
+
stateMessage: "bw-stateMessage-CQipG",
|
|
278
|
+
skeleton: "bw-skeleton-M9TSC",
|
|
279
|
+
shimmer: "bw-shimmer-cSg-c",
|
|
280
|
+
statusBar: "bw-statusBar-Mcg8R",
|
|
281
|
+
notice: "bw-notice-lf68j",
|
|
282
|
+
bulkBar: "bw-bulkBar-5deTe",
|
|
283
|
+
rise: "bw-rise-7xgJ-",
|
|
284
|
+
bulkCount: "bw-bulkCount-ZtXHp",
|
|
285
|
+
popover: "bw-popover-hbMZ9",
|
|
286
|
+
popoverTitle: "bw-popoverTitle-r9D-W",
|
|
287
|
+
rangeRow: "bw-rangeRow-fBXun",
|
|
288
|
+
miniInput: "bw-miniInput-IfO0K",
|
|
289
|
+
miniSearch: "bw-miniSearch-wvE5H",
|
|
290
|
+
valueList: "bw-valueList-MOZD6",
|
|
291
|
+
valueText: "bw-valueText--GiqH",
|
|
292
|
+
valueCount: "bw-valueCount-ovRmQ",
|
|
293
|
+
valueMore: "bw-valueMore-iLDYE",
|
|
294
|
+
popoverActions: "bw-popoverActions-7sIX7",
|
|
295
|
+
panel: "bw-panel-xmuc9",
|
|
296
|
+
slideIn: "bw-slideIn-Vm8Po",
|
|
297
|
+
panelHead: "bw-panelHead-csoWi",
|
|
298
|
+
panelTitle: "bw-panelTitle-zt0kE",
|
|
299
|
+
panelSection: "bw-panelSection-4NnRy",
|
|
300
|
+
panelLegend: "bw-panelLegend-74EMw",
|
|
301
|
+
densityGroup: "bw-densityGroup-2G2Ba",
|
|
302
|
+
panelList: "bw-panelList-TaMQO",
|
|
303
|
+
panelItem: "bw-panelItem-Eo7qq",
|
|
304
|
+
pinSelect: "bw-pinSelect-QBMFJ",
|
|
305
|
+
panelFoot: "bw-panelFoot-z7bIh",
|
|
306
|
+
"tone-neutral": "bw-tone-neutral-hZBRD",
|
|
307
|
+
"tone-brand": "bw-tone-brand-Y4aYo",
|
|
308
|
+
"tone-info": "bw-tone-info-jVRb9",
|
|
309
|
+
"tone-success": "bw-tone-success-KrAab",
|
|
310
|
+
"tone-warning": "bw-tone-warning-jxb9b",
|
|
311
|
+
"tone-danger": "bw-tone-danger-6IMkh",
|
|
312
|
+
"tone-muted": "bw-tone-muted-u-Z5-",
|
|
313
|
+
badge: "bw-badge-F2Dq8",
|
|
314
|
+
badgeDot: "bw-badgeDot-eCK8p",
|
|
315
|
+
cellLink: "bw-cellLink-lHxML",
|
|
316
|
+
cellButton: "bw-cellButton-eVhJz",
|
|
317
|
+
"text-brand": "bw-text-brand-zVmUH",
|
|
318
|
+
"text-info": "bw-text-info-r-V9Y",
|
|
319
|
+
"text-success": "bw-text-success-yxTkl",
|
|
320
|
+
"text-warning": "bw-text-warning-KAmBj",
|
|
321
|
+
"text-danger": "bw-text-danger-xrr2z",
|
|
322
|
+
"text-muted": "bw-text-muted-RYKXv",
|
|
323
|
+
"rowTone-info": "bw-rowTone-info-A2bim",
|
|
324
|
+
"rowTone-brand": "bw-rowTone-brand-0ly0g",
|
|
325
|
+
"rowTone-success": "bw-rowTone-success-Bx-n1",
|
|
326
|
+
"rowTone-warning": "bw-rowTone-warning-N1TDp",
|
|
327
|
+
"rowTone-danger": "bw-rowTone-danger-Ye0hN",
|
|
328
|
+
"rowTone-muted": "bw-rowTone-muted-Lmz92",
|
|
329
|
+
rangeMode: "bw-rangeMode-aKPAH",
|
|
330
|
+
inRange: "bw-inRange-eow6x",
|
|
331
|
+
rangeTop: "bw-rangeTop-h8sRX",
|
|
332
|
+
rangeBottom: "bw-rangeBottom-SXMXz",
|
|
333
|
+
rangeLeft: "bw-rangeLeft-q-ifi",
|
|
334
|
+
rangeRight: "bw-rangeRight-2TfA4",
|
|
335
|
+
rangeStats: "bw-rangeStats-H8h9p"
|
|
336
|
+
}, ie = [
|
|
337
|
+
{
|
|
338
|
+
value: "compact",
|
|
339
|
+
label: "촘촘"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
value: "standard",
|
|
343
|
+
label: "보통"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
value: "comfortable",
|
|
347
|
+
label: "여유"
|
|
348
|
+
}
|
|
349
|
+
];
|
|
350
|
+
function ae({ columns: e, density: r, onChange: i, onReset: a, onClose: o }) {
|
|
351
|
+
let s = p(null);
|
|
352
|
+
c(() => {
|
|
353
|
+
s.current?.focus();
|
|
354
|
+
let e = (e) => {
|
|
355
|
+
e.key === "Escape" && o();
|
|
356
|
+
};
|
|
357
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
358
|
+
}, [o]);
|
|
359
|
+
let l = e.map((e) => e.name);
|
|
360
|
+
function u(e, t) {
|
|
361
|
+
let n = [...l], r = e + t;
|
|
362
|
+
r < 0 || r >= n.length || ([n[e], n[r]] = [n[r], n[e]], i({ order: n }));
|
|
363
|
+
}
|
|
364
|
+
function d(t, n) {
|
|
365
|
+
let r = new Set(e.filter((e) => e.hidden).map((e) => e.name));
|
|
366
|
+
n ? r.add(t) : r.delete(t), r.size >= e.length || i({
|
|
367
|
+
hidden: [...r],
|
|
368
|
+
order: l
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function f(e, t) {
|
|
372
|
+
i((n) => ({
|
|
373
|
+
pins: {
|
|
374
|
+
...n.pins,
|
|
375
|
+
[e]: t || null
|
|
376
|
+
},
|
|
377
|
+
order: l
|
|
378
|
+
}));
|
|
379
|
+
}
|
|
380
|
+
return /* @__PURE__ */ n("aside", {
|
|
381
|
+
ref: s,
|
|
382
|
+
className: A.panel,
|
|
383
|
+
"aria-label": "컬럼 설정",
|
|
384
|
+
tabIndex: -1,
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ n("div", {
|
|
387
|
+
className: A.panelHead,
|
|
388
|
+
children: [/* @__PURE__ */ t("p", {
|
|
389
|
+
className: A.panelTitle,
|
|
390
|
+
children: "컬럼 설정"
|
|
391
|
+
}), /* @__PURE__ */ t(re, {
|
|
392
|
+
icon: "x",
|
|
393
|
+
label: "닫기",
|
|
394
|
+
size: "sm",
|
|
395
|
+
onClick: o
|
|
396
|
+
})]
|
|
397
|
+
}),
|
|
398
|
+
/* @__PURE__ */ n("fieldset", {
|
|
399
|
+
className: A.panelSection,
|
|
400
|
+
children: [/* @__PURE__ */ t("legend", { children: "행 높이" }), /* @__PURE__ */ t("div", {
|
|
401
|
+
className: A.densityGroup,
|
|
402
|
+
role: "group",
|
|
403
|
+
children: ie.map((e) => /* @__PURE__ */ t("button", {
|
|
404
|
+
type: "button",
|
|
405
|
+
"aria-pressed": r === e.value,
|
|
406
|
+
onClick: () => i({ density: e.value }),
|
|
407
|
+
children: e.label
|
|
408
|
+
}, e.value))
|
|
409
|
+
})]
|
|
410
|
+
}),
|
|
411
|
+
/* @__PURE__ */ n("div", {
|
|
412
|
+
className: A.panelSection,
|
|
413
|
+
children: [/* @__PURE__ */ n("p", {
|
|
414
|
+
className: A.panelLegend,
|
|
415
|
+
children: [
|
|
416
|
+
"컬럼 (",
|
|
417
|
+
e.filter((e) => !e.hidden).length,
|
|
418
|
+
"/",
|
|
419
|
+
e.length,
|
|
420
|
+
")"
|
|
421
|
+
]
|
|
422
|
+
}), /* @__PURE__ */ t("ul", {
|
|
423
|
+
className: A.panelList,
|
|
424
|
+
children: e.map((r, i) => /* @__PURE__ */ n("li", {
|
|
425
|
+
className: A.panelItem,
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ t(te, {
|
|
428
|
+
checked: !r.hidden,
|
|
429
|
+
onChange: (e) => d(r.name, !e.target.checked),
|
|
430
|
+
children: r.path.join(" · ")
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ n("select", {
|
|
433
|
+
className: A.pinSelect,
|
|
434
|
+
value: r.pin ?? "",
|
|
435
|
+
onChange: (e) => f(r.name, e.target.value),
|
|
436
|
+
"aria-label": `${r.label} 고정 위치`,
|
|
437
|
+
children: [
|
|
438
|
+
/* @__PURE__ */ t("option", {
|
|
439
|
+
value: "",
|
|
440
|
+
children: "고정 안 함"
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ t("option", {
|
|
443
|
+
value: "left",
|
|
444
|
+
children: "왼쪽 고정"
|
|
445
|
+
}),
|
|
446
|
+
/* @__PURE__ */ t("option", {
|
|
447
|
+
value: "right",
|
|
448
|
+
children: "오른쪽 고정"
|
|
449
|
+
})
|
|
450
|
+
]
|
|
451
|
+
}),
|
|
452
|
+
/* @__PURE__ */ t(re, {
|
|
453
|
+
icon: "chevronUp",
|
|
454
|
+
label: `${r.label} 위로`,
|
|
455
|
+
size: "sm",
|
|
456
|
+
disabled: i === 0,
|
|
457
|
+
onClick: () => u(i, -1)
|
|
458
|
+
}),
|
|
459
|
+
/* @__PURE__ */ t(re, {
|
|
460
|
+
icon: "chevronDown",
|
|
461
|
+
label: `${r.label} 아래로`,
|
|
462
|
+
size: "sm",
|
|
463
|
+
disabled: i === e.length - 1,
|
|
464
|
+
onClick: () => u(i, 1)
|
|
465
|
+
})
|
|
466
|
+
]
|
|
467
|
+
}, r.name))
|
|
468
|
+
})]
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ n("div", {
|
|
471
|
+
className: A.panelFoot,
|
|
472
|
+
children: [/* @__PURE__ */ t(D, {
|
|
473
|
+
size: "sm",
|
|
474
|
+
variant: "ghost",
|
|
475
|
+
icon: "refresh",
|
|
476
|
+
onClick: a,
|
|
477
|
+
children: "기본값으로"
|
|
478
|
+
}), /* @__PURE__ */ t(D, {
|
|
479
|
+
size: "sm",
|
|
480
|
+
variant: "primary",
|
|
481
|
+
onClick: o,
|
|
482
|
+
children: "닫기"
|
|
483
|
+
})]
|
|
484
|
+
})
|
|
485
|
+
]
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
// src/components/DataGrid/format.js
|
|
489
|
+
var oe = /* @__PURE__ */ new Map();
|
|
490
|
+
function se(e, t) {
|
|
491
|
+
let n = `${e}|${t}`, r = oe.get(n);
|
|
492
|
+
return r || (r = new Intl.NumberFormat("ko-KR", {
|
|
493
|
+
minimumFractionDigits: e,
|
|
494
|
+
maximumFractionDigits: e,
|
|
495
|
+
useGrouping: t
|
|
496
|
+
}), oe.set(n, r)), r;
|
|
497
|
+
}
|
|
498
|
+
function ce(e, t) {
|
|
499
|
+
if (!e) return {
|
|
500
|
+
grouping: !0,
|
|
501
|
+
digits: t === "float" ? 2 : 0
|
|
502
|
+
};
|
|
503
|
+
let n = e.includes(","), r = e.indexOf(".");
|
|
504
|
+
return {
|
|
505
|
+
grouping: n,
|
|
506
|
+
digits: r === -1 ? 0 : e.length - r - 1
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
function le(e) {
|
|
510
|
+
if (e == null || e === "") return null;
|
|
511
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
512
|
+
if (typeof e == "number") return new Date(e);
|
|
513
|
+
let t = String(e);
|
|
514
|
+
if (/^\d{8}$/.test(t)) return new Date(Number(t.slice(0, 4)), Number(t.slice(4, 6)) - 1, Number(t.slice(6, 8)));
|
|
515
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(t)) {
|
|
516
|
+
let [e, n, r] = t.split("-").map(Number);
|
|
517
|
+
return new Date(e, n - 1, r);
|
|
518
|
+
}
|
|
519
|
+
let n = new Date(t);
|
|
520
|
+
return Number.isNaN(n.getTime()) ? null : n;
|
|
521
|
+
}
|
|
522
|
+
var ue = (e) => String(e).padStart(2, "0");
|
|
523
|
+
function de(e, t = "yyyy-MM-dd") {
|
|
524
|
+
return t.replace("yyyy", String(e.getFullYear())).replace("MM", ue(e.getMonth() + 1)).replace("dd", ue(e.getDate())).replace("HH", ue(e.getHours())).replace("mm", ue(e.getMinutes()));
|
|
525
|
+
}
|
|
526
|
+
function fe(e) {
|
|
527
|
+
return e ? Array.isArray(e) ? new Map(e.map((e) => [String(e.value), e.label])) : new Map(Object.entries(e).map(([e, t]) => [String(e), t])) : null;
|
|
528
|
+
}
|
|
529
|
+
var j = {
|
|
530
|
+
businessNumber: "###-##-#####",
|
|
531
|
+
registrationNumber: "######-#######"
|
|
532
|
+
};
|
|
533
|
+
function pe(e, t) {
|
|
534
|
+
let n = String(e).replace(/[^0-9a-zA-Z]/g, ""), r = 0;
|
|
535
|
+
for (let e of t) e === "#" && r++;
|
|
536
|
+
if (n.length !== r) return String(e);
|
|
537
|
+
let i = 0, a = "";
|
|
538
|
+
for (let e of t) a += e === "#" ? n[i++] : e;
|
|
539
|
+
return a;
|
|
540
|
+
}
|
|
541
|
+
function M(e, t) {
|
|
542
|
+
if (e == null || e === "") return "";
|
|
543
|
+
if (t.formatType) {
|
|
544
|
+
let n = t.formatType === "mask" ? t.mask : j[t.formatType];
|
|
545
|
+
if (n) return pe(e, n);
|
|
546
|
+
}
|
|
547
|
+
switch (t.type) {
|
|
548
|
+
case "int":
|
|
549
|
+
case "float": {
|
|
550
|
+
let n = typeof e == "number" ? e : Number(String(e).replace(/,/g, ""));
|
|
551
|
+
if (Number.isNaN(n)) return String(e);
|
|
552
|
+
let { grouping: r, digits: i } = t.numberPattern;
|
|
553
|
+
return se(i, r).format(n);
|
|
554
|
+
}
|
|
555
|
+
case "date": {
|
|
556
|
+
let n = le(e);
|
|
557
|
+
return n ? de(n, t.format) : String(e);
|
|
558
|
+
}
|
|
559
|
+
case "enum": return t.enumMap?.get(String(e)) ?? String(e);
|
|
560
|
+
case "bool": return e ? "예" : "아니오";
|
|
561
|
+
default: return String(e);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
// src/components/DataGrid/columnModel.js
|
|
565
|
+
var me = {
|
|
566
|
+
text: {
|
|
567
|
+
width: 160,
|
|
568
|
+
align: "left"
|
|
569
|
+
},
|
|
570
|
+
int: {
|
|
571
|
+
width: 120,
|
|
572
|
+
align: "right"
|
|
573
|
+
},
|
|
574
|
+
float: {
|
|
575
|
+
width: 120,
|
|
576
|
+
align: "right"
|
|
577
|
+
},
|
|
578
|
+
date: {
|
|
579
|
+
width: 110,
|
|
580
|
+
align: "center"
|
|
581
|
+
},
|
|
582
|
+
enum: {
|
|
583
|
+
width: 120,
|
|
584
|
+
align: "left"
|
|
585
|
+
},
|
|
586
|
+
bool: {
|
|
587
|
+
width: 80,
|
|
588
|
+
align: "center"
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
function he(e) {
|
|
592
|
+
let t = e.type ?? "text", n = me[t] ?? me.text, r = Array.isArray(e.header) ? e.header : [e.header ?? e.name];
|
|
593
|
+
return {
|
|
594
|
+
...e,
|
|
595
|
+
type: t,
|
|
596
|
+
path: r,
|
|
597
|
+
label: r[r.length - 1],
|
|
598
|
+
align: e.align ?? n.align,
|
|
599
|
+
defaultWidth: e.width ?? (e.summary && (t === "int" || t === "float") ? 150 : n.width),
|
|
600
|
+
minWidth: e.minWidth ?? 48,
|
|
601
|
+
sortable: e.sortable !== !1,
|
|
602
|
+
filterable: e.filterable !== !1,
|
|
603
|
+
resizable: e.resizable !== !1,
|
|
604
|
+
numberPattern: t === "int" || t === "float" ? ce(e.format, t) : null,
|
|
605
|
+
enumMap: t === "enum" ? fe(e.enum) : null,
|
|
606
|
+
format: t === "date" ? e.format ?? "yyyy-MM-dd" : e.format
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
function ge(e, t = {}) {
|
|
610
|
+
let n = e.map(he), r = new Map(n.map((e) => [e.name, e])), i = t.order?.filter((e) => r.has(e)) ?? [];
|
|
611
|
+
for (let e of n) i.includes(e.name) || i.push(e.name);
|
|
612
|
+
let a = new Set(t.hidden ?? n.filter((e) => e.hidden).map((e) => e.name)), o = i.map((e) => {
|
|
613
|
+
let n = r.get(e), i = t.widths?.[e], o = t.pins && e in t.pins ? t.pins[e] : n.pin ?? null;
|
|
614
|
+
return {
|
|
615
|
+
...n,
|
|
616
|
+
width: Math.max(n.minWidth, i ?? n.defaultWidth),
|
|
617
|
+
pin: o,
|
|
618
|
+
hidden: a.has(e)
|
|
619
|
+
};
|
|
620
|
+
}), s = /* @__PURE__ */ new Map();
|
|
621
|
+
for (let e of o) e.path.length > 1 && e.pin && !s.has(e.path[0]) && s.set(e.path[0], e.pin);
|
|
622
|
+
for (let e of o) e.path.length > 1 && s.has(e.path[0]) && (e.pin = s.get(e.path[0]));
|
|
623
|
+
let c = o.filter((e) => !e.hidden), l = c.filter((e) => e.pin === "left"), u = c.filter((e) => e.pin === "right"), d = c.filter((e) => e.pin !== "left" && e.pin !== "right"), f = 0;
|
|
624
|
+
for (let e of l) e.stickyLeft = f, f += e.width;
|
|
625
|
+
let p = f;
|
|
626
|
+
f = 0;
|
|
627
|
+
for (let e = u.length - 1; e >= 0; e--) u[e].stickyRight = f, f += u[e].width;
|
|
628
|
+
let m = f, h = [0];
|
|
629
|
+
for (let e of d) h.push(h[h.length - 1] + e.width);
|
|
630
|
+
let g = h[h.length - 1], _ = Math.max(1, ...c.map((e) => e.path.length));
|
|
631
|
+
return {
|
|
632
|
+
all: o,
|
|
633
|
+
left: l,
|
|
634
|
+
center: d,
|
|
635
|
+
right: u,
|
|
636
|
+
leftWidth: p,
|
|
637
|
+
rightWidth: m,
|
|
638
|
+
centerWidth: g,
|
|
639
|
+
totalWidth: p + g + m,
|
|
640
|
+
centerOffsets: h,
|
|
641
|
+
depth: _
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
function _e(e, t, n, r = 2) {
|
|
645
|
+
let i = e.length - 1;
|
|
646
|
+
if (i <= 0) return [0, -1];
|
|
647
|
+
let a = (t) => {
|
|
648
|
+
let n = 0, r = i - 1;
|
|
649
|
+
for (; n < r;) {
|
|
650
|
+
let i = n + r + 1 >> 1;
|
|
651
|
+
e[i] <= t ? n = i : r = i - 1;
|
|
652
|
+
}
|
|
653
|
+
return n;
|
|
654
|
+
};
|
|
655
|
+
return [Math.max(0, a(t) - r), Math.min(i - 1, a(n) + r)];
|
|
656
|
+
}
|
|
657
|
+
function ve(e, t) {
|
|
658
|
+
let [n, r] = t, i = [];
|
|
659
|
+
for (let t of e.left) i.push({
|
|
660
|
+
kind: "col",
|
|
661
|
+
column: t
|
|
662
|
+
});
|
|
663
|
+
let a = e.centerOffsets[n] ?? 0;
|
|
664
|
+
i.push({
|
|
665
|
+
kind: "spacer",
|
|
666
|
+
width: a,
|
|
667
|
+
key: "spacer-left"
|
|
668
|
+
});
|
|
669
|
+
for (let t = n; t <= r; t++) i.push({
|
|
670
|
+
kind: "col",
|
|
671
|
+
column: e.center[t]
|
|
672
|
+
});
|
|
673
|
+
let o = e.centerWidth - (e.centerOffsets[r + 1] ?? e.centerWidth);
|
|
674
|
+
i.push({
|
|
675
|
+
kind: "spacer",
|
|
676
|
+
width: Math.max(0, o),
|
|
677
|
+
key: "spacer-right"
|
|
678
|
+
});
|
|
679
|
+
for (let t of e.right) i.push({
|
|
680
|
+
kind: "col",
|
|
681
|
+
column: t
|
|
682
|
+
});
|
|
683
|
+
return {
|
|
684
|
+
cols: i,
|
|
685
|
+
template: i.map((e) => `${e.kind === "col" ? e.column.width : e.width}px`).join(" ")
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
function ye(e, t) {
|
|
689
|
+
let n = [];
|
|
690
|
+
for (let r = 0; r < t; r++) {
|
|
691
|
+
let i = 0;
|
|
692
|
+
for (; i < e.length;) {
|
|
693
|
+
let a = e[i];
|
|
694
|
+
if (a.kind !== "col") {
|
|
695
|
+
i++;
|
|
696
|
+
continue;
|
|
697
|
+
}
|
|
698
|
+
let o = a.column, s = o.path;
|
|
699
|
+
if (r > s.length - 1) {
|
|
700
|
+
i++;
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
703
|
+
if (r === s.length - 1) {
|
|
704
|
+
n.push({
|
|
705
|
+
key: `leaf-${o.name}`,
|
|
706
|
+
label: s[r],
|
|
707
|
+
column: o,
|
|
708
|
+
isLeaf: !0,
|
|
709
|
+
level: r,
|
|
710
|
+
gridColumn: `${i + 1} / span 1`,
|
|
711
|
+
gridRow: `${r + 1} / span ${t - r}`,
|
|
712
|
+
pin: o.pin,
|
|
713
|
+
stickyLeft: o.stickyLeft,
|
|
714
|
+
stickyRight: o.stickyRight
|
|
715
|
+
}), i++;
|
|
716
|
+
continue;
|
|
717
|
+
}
|
|
718
|
+
let c = i + 1, l = s.slice(0, r + 1).join("\0");
|
|
719
|
+
for (; c < e.length;) {
|
|
720
|
+
let t = e[c];
|
|
721
|
+
if (t.kind !== "col" || t.column.pin !== o.pin || t.column.path.length - 1 <= r || t.column.path.slice(0, r + 1).join("\0") !== l) break;
|
|
722
|
+
c++;
|
|
723
|
+
}
|
|
724
|
+
n.push({
|
|
725
|
+
key: `group-${r}-${o.name}`,
|
|
726
|
+
label: s[r],
|
|
727
|
+
isLeaf: !1,
|
|
728
|
+
level: r,
|
|
729
|
+
gridColumn: `${i + 1} / span ${c - i}`,
|
|
730
|
+
gridRow: `${r + 1} / span 1`,
|
|
731
|
+
pin: o.pin,
|
|
732
|
+
stickyLeft: o.stickyLeft,
|
|
733
|
+
stickyRight: e[c - 1].column.stickyRight
|
|
734
|
+
}), i = c;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return n;
|
|
738
|
+
}
|
|
739
|
+
// src/excel/zip.js
|
|
740
|
+
var be = (() => {
|
|
741
|
+
let e = /* @__PURE__ */ new Uint32Array(256);
|
|
742
|
+
for (let t = 0; t < 256; t++) {
|
|
743
|
+
let n = t;
|
|
744
|
+
for (let e = 0; e < 8; e++) n = n & 1 ? 3988292384 ^ n >>> 1 : n >>> 1;
|
|
745
|
+
e[t] = n >>> 0;
|
|
746
|
+
}
|
|
747
|
+
return e;
|
|
748
|
+
})();
|
|
749
|
+
function xe(e) {
|
|
750
|
+
let t = 4294967295;
|
|
751
|
+
for (let n = 0; n < e.length; n++) t = be[(t ^ e[n]) & 255] ^ t >>> 8;
|
|
752
|
+
return (t ^ 4294967295) >>> 0;
|
|
753
|
+
}
|
|
754
|
+
async function Se(e) {
|
|
755
|
+
let t = new Blob([e]).stream().pipeThrough(new CompressionStream("deflate-raw"));
|
|
756
|
+
return new Uint8Array(await new Response(t).arrayBuffer());
|
|
757
|
+
}
|
|
758
|
+
async function Ce(e, { compress: t = !0, type: n = "application/zip" } = {}) {
|
|
759
|
+
let r = t && typeof CompressionStream < "u", i = new TextEncoder(), a = [], o = [], s = 0;
|
|
760
|
+
for (let t of e) {
|
|
761
|
+
let e = i.encode(t.name), n = t.data, c = xe(n), l = r ? await Se(n) : n, u = r ? 8 : 0, d = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(30));
|
|
762
|
+
d.setUint32(0, 67324752, !0), d.setUint16(4, 20, !0), d.setUint16(6, 2048, !0), d.setUint16(8, u, !0), d.setUint32(14, c, !0), d.setUint32(18, l.length, !0), d.setUint32(22, n.length, !0), d.setUint16(26, e.length, !0), a.push(new Uint8Array(d.buffer), e, l);
|
|
763
|
+
let f = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(46));
|
|
764
|
+
f.setUint32(0, 33639248, !0), f.setUint16(4, 20, !0), f.setUint16(6, 20, !0), f.setUint16(8, 2048, !0), f.setUint16(10, u, !0), f.setUint32(16, c, !0), f.setUint32(20, l.length, !0), f.setUint32(24, n.length, !0), f.setUint16(28, e.length, !0), f.setUint32(42, s, !0), o.push(new Uint8Array(f.buffer), e), s += 30 + e.length + l.length;
|
|
765
|
+
}
|
|
766
|
+
let c = o.reduce((e, t) => e + t.length, 0), l = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(22));
|
|
767
|
+
return l.setUint32(0, 101010256, !0), l.setUint16(8, e.length, !0), l.setUint16(10, e.length, !0), l.setUint32(12, c, !0), l.setUint32(16, s, !0), new Blob([
|
|
768
|
+
...a,
|
|
769
|
+
...o,
|
|
770
|
+
new Uint8Array(l.buffer)
|
|
771
|
+
], { type: n });
|
|
772
|
+
}
|
|
773
|
+
// src/excel/workbook.js
|
|
774
|
+
function we(e) {
|
|
775
|
+
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f]/g, "");
|
|
776
|
+
}
|
|
777
|
+
function Te(e) {
|
|
778
|
+
let t = "", n = e;
|
|
779
|
+
for (; n > 0;) {
|
|
780
|
+
let e = (n - 1) % 26;
|
|
781
|
+
t = String.fromCharCode(65 + e) + t, n = Math.floor((n - 1) / 26);
|
|
782
|
+
}
|
|
783
|
+
return t;
|
|
784
|
+
}
|
|
785
|
+
function N(e, t) {
|
|
786
|
+
return `${Te(t)}${e}`;
|
|
787
|
+
}
|
|
788
|
+
function Ee(e) {
|
|
789
|
+
return (Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds()) - Date.UTC(1899, 11, 30)) / 864e5;
|
|
790
|
+
}
|
|
791
|
+
function De(e, t) {
|
|
792
|
+
let n = String(e || "Sheet").replace(/[\\/?*[\]:]/g, " ").slice(0, 31) || "Sheet", r = n, i = 2;
|
|
793
|
+
for (; t.has(r.toLowerCase());) {
|
|
794
|
+
let e = ` (${i++})`;
|
|
795
|
+
r = n.slice(0, 31 - e.length) + e;
|
|
796
|
+
}
|
|
797
|
+
return t.add(r.toLowerCase()), r;
|
|
798
|
+
}
|
|
799
|
+
function Oe() {
|
|
800
|
+
let e = ["<font><sz val=\"10\"/><name val=\"맑은 고딕\"/></font>"], t = /* @__PURE__ */ new Map([["||10", 0]]), n = ["<fill><patternFill patternType=\"none\"/></fill>", "<fill><patternFill patternType=\"gray125\"/></fill>"], r = /* @__PURE__ */ new Map(), i = ["<border/>", "<border><left style=\"thin\"><color rgb=\"FFD7DCE2\"/></left><right style=\"thin\"><color rgb=\"FFD7DCE2\"/></right><top style=\"thin\"><color rgb=\"FFD7DCE2\"/></top><bottom style=\"thin\"><color rgb=\"FFD7DCE2\"/></bottom></border>"], a = /* @__PURE__ */ new Map(), o = ["<xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\" xfId=\"0\"/>"], s = /* @__PURE__ */ new Map([["default", 0]]), c = ({ bold: n, italic: r, color: i, size: a = 10 }) => {
|
|
801
|
+
let o = `${n ? "b" : ""}${r ? "i" : ""}|${i ?? ""}|${a}`;
|
|
802
|
+
return t.has(o) || (e.push(`<font>${n ? "<b/>" : ""}${r ? "<i/>" : ""}<sz val="${a}"/>${i ? `<color rgb="FF${i}"/>` : ""}<name val="맑은 고딕"/></font>`), t.set(o, e.length - 1)), t.get(o);
|
|
803
|
+
}, l = (e) => e ? (r.has(e) || (n.push(`<fill><patternFill patternType="solid"><fgColor rgb="FF${e}"/></patternFill></fill>`), r.set(e, n.length - 1)), r.get(e)) : 0, u = (e) => e ? e === "0" ? 1 : (a.has(e) || a.set(e, 164 + a.size), a.get(e)) : 0;
|
|
804
|
+
function d(e) {
|
|
805
|
+
if (!e) return 0;
|
|
806
|
+
let t = JSON.stringify(e);
|
|
807
|
+
if (s.has(t)) return s.get(t);
|
|
808
|
+
let n = c(e), r = l(e.fill), i = +!!e.border, a = u(e.format), d = e.align || e.valign || e.wrap ? `<alignment${e.align ? ` horizontal="${e.align}"` : ""} vertical="${e.valign ?? "center"}"${e.wrap ? " wrapText=\"1\"" : ""}/>` : "";
|
|
809
|
+
return o.push(`<xf numFmtId="${a}" fontId="${n}" fillId="${r}" borderId="${i}" xfId="0" applyNumberFormat="1" applyFont="1" applyFill="1" applyBorder="1" applyAlignment="1">${d}</xf>`), s.set(t, o.length - 1), o.length - 1;
|
|
810
|
+
}
|
|
811
|
+
function f() {
|
|
812
|
+
let t = [...a.entries()].map(([e, t]) => `<numFmt numFmtId="${t}" formatCode="${we(e)}"/>`).join("");
|
|
813
|
+
return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><styleSheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">" + (a.size ? `<numFmts count="${a.size}">${t}</numFmts>` : "") + `<fonts count="${e.length}">${e.join("")}</fonts><fills count="${n.length}">${n.join("")}</fills><borders count="${i.length}">${i.join("")}</borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${o.length}">${o.join("")}</cellXfs></styleSheet>`;
|
|
814
|
+
}
|
|
815
|
+
return {
|
|
816
|
+
get: d,
|
|
817
|
+
toXml: f
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
function ke(e, t, n) {
|
|
821
|
+
let r = /* @__PURE__ */ new Map(), i = [], a = [], o = t.freeze ?? null, s = null, c = 0, l = {
|
|
822
|
+
name: e,
|
|
823
|
+
get rowCount() {
|
|
824
|
+
return c;
|
|
825
|
+
},
|
|
826
|
+
setColumns(e) {
|
|
827
|
+
return e.forEach((e, t) => {
|
|
828
|
+
i[t] = typeof e == "number" ? { width: e } : e;
|
|
829
|
+
}), l;
|
|
830
|
+
},
|
|
831
|
+
setCell(e, t, i, a) {
|
|
832
|
+
r.has(e) || r.set(e, /* @__PURE__ */ new Map());
|
|
833
|
+
let o = a;
|
|
834
|
+
return i instanceof Date && !o?.format && (o = {
|
|
835
|
+
...o,
|
|
836
|
+
format: "yyyy-mm-dd"
|
|
837
|
+
}), r.get(e).set(t, {
|
|
838
|
+
value: i,
|
|
839
|
+
styleId: n.get(o)
|
|
840
|
+
}), e > c && (c = e), l;
|
|
841
|
+
},
|
|
842
|
+
addRow(e, t) {
|
|
843
|
+
let n = c + 1;
|
|
844
|
+
return e.forEach((e, r) => {
|
|
845
|
+
let i = Array.isArray(t) ? t[r] : t;
|
|
846
|
+
(e !== void 0 || i) && l.setCell(n, r + 1, e ?? null, i);
|
|
847
|
+
}), e.length === 0 && (c = n), n;
|
|
848
|
+
},
|
|
849
|
+
merge(e, t, n, r) {
|
|
850
|
+
return a.push(`${N(e, t)}:${N(n, r)}`), l;
|
|
851
|
+
},
|
|
852
|
+
freeze(e) {
|
|
853
|
+
return o = e, l;
|
|
854
|
+
},
|
|
855
|
+
setAutoFilter(e, t, n, r) {
|
|
856
|
+
return s = `${N(e, t)}:${N(n, r)}`, l;
|
|
857
|
+
},
|
|
858
|
+
_toXml() {
|
|
859
|
+
let e = "";
|
|
860
|
+
for (let t of [...r.keys()].sort((e, t) => e - t)) {
|
|
861
|
+
let n = r.get(t), i = "";
|
|
862
|
+
for (let e of [...n.keys()].sort((e, t) => e - t)) {
|
|
863
|
+
let { value: r, styleId: a } = n.get(e), o = N(t, e), s = a ? ` s="${a}"` : "";
|
|
864
|
+
r == null || r === "" ? i += `<c r="${o}"${s}/>` : typeof r == "number" ? i += Number.isFinite(r) ? `<c r="${o}"${s}><v>${r}</v></c>` : `<c r="${o}"${s}/>` : typeof r == "boolean" ? i += `<c r="${o}"${s} t="b"><v>${+!!r}</v></c>` : r instanceof Date ? i += `<c r="${o}"${s}><v>${Ee(r)}</v></c>` : i += `<c r="${o}"${s} t="inlineStr"><is><t xml:space="preserve">${we(r)}</t></is></c>`;
|
|
865
|
+
}
|
|
866
|
+
e += `<row r="${t}">${i}</row>`;
|
|
867
|
+
}
|
|
868
|
+
let t = "<sheetView workbookViewId=\"0\"/>";
|
|
869
|
+
if (o && (o.rows || o.cols)) {
|
|
870
|
+
let e = o.rows ?? 0, n = o.cols ?? 0, r = e && n ? "bottomRight" : e ? "bottomLeft" : "topRight";
|
|
871
|
+
t = `<sheetView workbookViewId="0"><pane${n ? ` xSplit="${n}"` : ""}${e ? ` ySplit="${e}"` : ""} topLeftCell="${N(e + 1, n + 1)}" activePane="${r}" state="frozen"/></sheetView>`;
|
|
872
|
+
}
|
|
873
|
+
let n = i.map((e, t) => e?.width ? `<col min="${t + 1}" max="${t + 1}" width="${Math.max(4, Math.round(e.width / 7 * 100) / 100)}" customWidth="1"/>` : "").join("");
|
|
874
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><sheetViews>${t}</sheetViews>` + (n ? `<cols>${n}</cols>` : "") + `<sheetData>${e}</sheetData>` + (s ? `<autoFilter ref="${s}"/>` : "") + (a.length ? `<mergeCells count="${a.length}">${a.map((e) => `<mergeCell ref="${e}"/>`).join("")}</mergeCells>` : "") + "</worksheet>";
|
|
875
|
+
},
|
|
876
|
+
_autoFilter: () => s
|
|
877
|
+
};
|
|
878
|
+
return l;
|
|
879
|
+
}
|
|
880
|
+
function Ae() {
|
|
881
|
+
let e = Oe(), t = [], n = /* @__PURE__ */ new Set();
|
|
882
|
+
async function r({ compress: n = !0 } = {}) {
|
|
883
|
+
t.length === 0 && i("Sheet1");
|
|
884
|
+
let r = new TextEncoder(), a = (e, t) => ({
|
|
885
|
+
name: e,
|
|
886
|
+
data: r.encode(t)
|
|
887
|
+
}), o = t.map((e, t) => e._autoFilter() ? `<definedName name="_xlnm._FilterDatabase" localSheetId="${t}" hidden="1">'${we(e.name.replace(/'/g, "''"))}'!${e._autoFilter().replace(/([A-Z]+)(\d+)/g, "$$$1$$$2")}</definedName>` : "").join("");
|
|
888
|
+
return Ce([
|
|
889
|
+
a("[Content_Types].xml", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\"><Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/><Default Extension=\"xml\" ContentType=\"application/xml\"/><Override PartName=\"/xl/workbook.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\"/>" + t.map((e, t) => `<Override PartName="/xl/worksheets/sheet${t + 1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("") + "<Override PartName=\"/xl/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"/></Types>"),
|
|
890
|
+
a("_rels/.rels", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"xl/workbook.xml\"/></Relationships>"),
|
|
891
|
+
a("xl/workbook.xml", `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets>${t.map((e, t) => `<sheet name="${we(e.name)}" sheetId="${t + 1}" r:id="rId${t + 1}"/>`).join("")}</sheets>` + (o ? `<definedNames>${o}</definedNames>` : "") + "</workbook>"),
|
|
892
|
+
a("xl/_rels/workbook.xml.rels", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">" + t.map((e, t) => `<Relationship Id="rId${t + 1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${t + 1}.xml"/>`).join("") + `<Relationship Id="rId${t.length + 1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`),
|
|
893
|
+
a("xl/styles.xml", e.toXml()),
|
|
894
|
+
...t.map((e, t) => a(`xl/worksheets/sheet${t + 1}.xml`, e._toXml()))
|
|
895
|
+
], {
|
|
896
|
+
compress: n,
|
|
897
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
function i(r, i = {}) {
|
|
901
|
+
let a = ke(De(r, n), i, e);
|
|
902
|
+
return t.push(a), a;
|
|
903
|
+
}
|
|
904
|
+
return {
|
|
905
|
+
addSheet: i,
|
|
906
|
+
toBlob: r,
|
|
907
|
+
async download(e = "data.xlsx") {
|
|
908
|
+
P(await r(), e.endsWith(".xlsx") ? e : `${e}.xlsx`);
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
function P(e, t) {
|
|
913
|
+
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
914
|
+
r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 1e3);
|
|
915
|
+
}
|
|
916
|
+
// src/components/DataGrid/rowPipeline.js
|
|
917
|
+
var je = new Intl.Collator("ko", {
|
|
918
|
+
numeric: !0,
|
|
919
|
+
sensitivity: "base"
|
|
920
|
+
});
|
|
921
|
+
function F(e, t) {
|
|
922
|
+
return t.value ? t.value(e) : e[t.name];
|
|
923
|
+
}
|
|
924
|
+
function Me(e, t) {
|
|
925
|
+
let n = F(e, t);
|
|
926
|
+
if (n == null || n === "") return null;
|
|
927
|
+
if (t.type === "int" || t.type === "float") {
|
|
928
|
+
let e = typeof n == "number" ? n : Number(String(n).replace(/,/g, ""));
|
|
929
|
+
return Number.isNaN(e) ? null : e;
|
|
930
|
+
}
|
|
931
|
+
return t.type === "date" ? le(n)?.getTime() ?? null : t.type === "bool" ? +!!n : M(n, t);
|
|
932
|
+
}
|
|
933
|
+
var Ne = /* @__PURE__ */ new WeakMap();
|
|
934
|
+
function Pe(e, t) {
|
|
935
|
+
let n = F(e, t);
|
|
936
|
+
return n == null ? "" : (t.type === "int" || t.type === "float" || t.type === "date") && typeof n != "object" ? String(n) : t.type === "enum" ? t.enumMap?.get(String(n)) ?? String(n) : t.type === "text" || !t.type ? String(n) : M(n, t);
|
|
937
|
+
}
|
|
938
|
+
function Fe(e, t, n) {
|
|
939
|
+
let r = Ne.get(e);
|
|
940
|
+
if (r && r.signature === n) return r.text;
|
|
941
|
+
let i = "";
|
|
942
|
+
for (let n of t) i += `${Pe(e, n)}\u0001`;
|
|
943
|
+
return i = i.toLowerCase(), Ne.set(e, {
|
|
944
|
+
signature: n,
|
|
945
|
+
text: i
|
|
946
|
+
}), i;
|
|
947
|
+
}
|
|
948
|
+
function Ie(e, t) {
|
|
949
|
+
let n = window.requestIdleCallback ?? ((e) => setTimeout(() => e({ timeRemaining: () => 8 }), 50)), r = window.cancelIdleCallback ?? clearTimeout, i = t.map((e) => e.name).join("|"), a = 0, o, s = (r) => {
|
|
950
|
+
for (; a < e.length && r.timeRemaining() > 2;) {
|
|
951
|
+
let n = Math.min(e.length, a + 200);
|
|
952
|
+
for (; a < n; a++) Fe(e[a], t, i);
|
|
953
|
+
}
|
|
954
|
+
a < e.length && (o = n(s));
|
|
955
|
+
};
|
|
956
|
+
return o = n(s), () => r(o);
|
|
957
|
+
}
|
|
958
|
+
function Le(e, t, n) {
|
|
959
|
+
if (n.kind === "values") return n.values.has(M(F(e, t), t));
|
|
960
|
+
if (n.kind === "text") return M(F(e, t), t).toLowerCase().includes(n.text.toLowerCase());
|
|
961
|
+
if (n.kind === "range") {
|
|
962
|
+
let r = Me(e, t);
|
|
963
|
+
if (r == null) return !1;
|
|
964
|
+
let i = (e) => t.type === "date" ? le(e)?.getTime() : Number(e);
|
|
965
|
+
return !(n.min != null && n.min !== "" && r < i(n.min) || n.max != null && n.max !== "" && r > i(n.max));
|
|
966
|
+
}
|
|
967
|
+
return !0;
|
|
968
|
+
}
|
|
969
|
+
function Re(e, t, { search: n = "", filters: r = {}, sort: i = [] } = {}) {
|
|
970
|
+
let a = new Map(t.map((e) => [e.name, e])), o = Object.entries(r).filter(([e, t]) => t && a.has(e)).map(([e, t]) => [a.get(e), t]), s = n.trim().toLowerCase(), c = s.replace(/[,\-./]/g, ""), l = t.map((e) => e.name).join("|"), u = [];
|
|
971
|
+
if (!s && o.length === 0) {
|
|
972
|
+
u = Array(e.length);
|
|
973
|
+
for (let t = 0; t < e.length; t++) u[t] = t;
|
|
974
|
+
} else for (let n = 0; n < e.length; n++) {
|
|
975
|
+
let r = e[n];
|
|
976
|
+
if (s) {
|
|
977
|
+
let e = Fe(r, t, l);
|
|
978
|
+
if (!e.includes(s) && !(c && c !== s && e.includes(c))) continue;
|
|
979
|
+
}
|
|
980
|
+
let i = !0;
|
|
981
|
+
for (let [e, t] of o) if (!Le(r, e, t)) {
|
|
982
|
+
i = !1;
|
|
983
|
+
break;
|
|
984
|
+
}
|
|
985
|
+
i && u.push(n);
|
|
986
|
+
}
|
|
987
|
+
let d = i.map((e) => ({
|
|
988
|
+
...e,
|
|
989
|
+
column: a.get(e.name)
|
|
990
|
+
})).filter((e) => e.column);
|
|
991
|
+
if (d.length > 0) {
|
|
992
|
+
let t = d.map((t) => {
|
|
993
|
+
let n = Array(e.length);
|
|
994
|
+
for (let r of u) n[r] = Me(e[r], t.column);
|
|
995
|
+
return n;
|
|
996
|
+
});
|
|
997
|
+
u.sort((e, n) => {
|
|
998
|
+
for (let r = 0; r < d.length; r++) {
|
|
999
|
+
let i = t[r][e], a = t[r][n];
|
|
1000
|
+
if (i === a) continue;
|
|
1001
|
+
if (i == null) return 1;
|
|
1002
|
+
if (a == null) return -1;
|
|
1003
|
+
let o = typeof i == "number" && typeof a == "number" ? i - a : je.compare(String(i), String(a));
|
|
1004
|
+
if (o !== 0) return d[r].dir === "desc" ? -o : o;
|
|
1005
|
+
}
|
|
1006
|
+
return e - n;
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
return u;
|
|
1010
|
+
}
|
|
1011
|
+
function ze(e, t, n) {
|
|
1012
|
+
let r = /* @__PURE__ */ new Map();
|
|
1013
|
+
for (let i of n) {
|
|
1014
|
+
let n = i.summary;
|
|
1015
|
+
if (!n) continue;
|
|
1016
|
+
if (typeof n == "function") {
|
|
1017
|
+
let a = t.map((t) => e[t]);
|
|
1018
|
+
r.set(i.name, n(a.map((e) => F(e, i)), a));
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
if (n === "count") {
|
|
1022
|
+
r.set(i.name, t.length);
|
|
1023
|
+
continue;
|
|
1024
|
+
}
|
|
1025
|
+
let a = 0, o = 0, s = Infinity, c = -Infinity, l = i.name, u = !i.value;
|
|
1026
|
+
for (let n = 0; n < t.length; n++) {
|
|
1027
|
+
let r = e[t[n]], d = u ? r[l] : i.value(r), f;
|
|
1028
|
+
if (typeof d == "number") f = d;
|
|
1029
|
+
else if (d == null || d === "") continue;
|
|
1030
|
+
else f = Number(String(d).replace(/,/g, ""));
|
|
1031
|
+
Number.isNaN(f) || (a += f, o++, f < s && (s = f), f > c && (c = f));
|
|
1032
|
+
}
|
|
1033
|
+
n === "sum" ? r.set(i.name, a) : n === "avg" ? r.set(i.name, o ? a / o : null) : n === "min" ? r.set(i.name, o ? s : null) : n === "max" && r.set(i.name, o ? c : null);
|
|
1034
|
+
}
|
|
1035
|
+
return r;
|
|
1036
|
+
}
|
|
1037
|
+
function Be(e, t, n = 500) {
|
|
1038
|
+
let r = /* @__PURE__ */ new Map();
|
|
1039
|
+
for (let n of e) {
|
|
1040
|
+
let e = M(F(n, t), t);
|
|
1041
|
+
r.set(e, (r.get(e) ?? 0) + 1);
|
|
1042
|
+
}
|
|
1043
|
+
let i = [...r.entries()].map(([e, t]) => ({
|
|
1044
|
+
text: e,
|
|
1045
|
+
count: t
|
|
1046
|
+
}));
|
|
1047
|
+
return i.sort((e, t) => je.compare(e.text, t.text)), {
|
|
1048
|
+
values: i.slice(0, n),
|
|
1049
|
+
total: i.length
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
// src/components/DataGrid/exportXlsx.js
|
|
1053
|
+
var Ve = {
|
|
1054
|
+
bold: !0,
|
|
1055
|
+
fill: "F1F4F6",
|
|
1056
|
+
align: "center",
|
|
1057
|
+
border: !0
|
|
1058
|
+
}, He = {
|
|
1059
|
+
bold: !0,
|
|
1060
|
+
fill: "EBF0F6",
|
|
1061
|
+
border: !0
|
|
1062
|
+
};
|
|
1063
|
+
function Ue(e) {
|
|
1064
|
+
if (e.type === "int" || e.type === "float") {
|
|
1065
|
+
let { grouping: t, digits: n } = e.numberPattern;
|
|
1066
|
+
return `${t ? "#,##0" : "0"}${n ? `.${"0".repeat(n)}` : ""}`;
|
|
1067
|
+
}
|
|
1068
|
+
if (e.type === "date") return (e.format ?? "yyyy-MM-dd").replace("MM", "mm");
|
|
1069
|
+
}
|
|
1070
|
+
function We({ columns: e, depth: t, rows: n, indices: r, summary: i, sheetName: a = "Sheet1" }) {
|
|
1071
|
+
let o = Ae(), s = o.addSheet(a);
|
|
1072
|
+
s.setColumns(e.map((e) => ({ width: e.width })));
|
|
1073
|
+
for (let n = 1; n <= t; n++) for (let t = 1; t <= e.length; t++) s.setCell(n, t, null, Ve);
|
|
1074
|
+
let c = ye(e.map((e) => ({
|
|
1075
|
+
kind: "col",
|
|
1076
|
+
column: e
|
|
1077
|
+
})), t);
|
|
1078
|
+
for (let e of c) {
|
|
1079
|
+
let [t, n] = e.gridColumn.split(" / span ").map(Number), [r, i] = e.gridRow.split(" / span ").map(Number);
|
|
1080
|
+
s.setCell(r, t, e.label, Ve), (n > 1 || i > 1) && s.merge(r, t, r + i - 1, t + n - 1);
|
|
1081
|
+
}
|
|
1082
|
+
let l = t;
|
|
1083
|
+
if (i && i.size > 0) {
|
|
1084
|
+
l++;
|
|
1085
|
+
let t = e.findIndex((e) => !i.has(e.name));
|
|
1086
|
+
e.forEach((e, n) => {
|
|
1087
|
+
i.has(e.name) ? s.setCell(l, n + 1, i.get(e.name), {
|
|
1088
|
+
...He,
|
|
1089
|
+
align: "right",
|
|
1090
|
+
format: Ue(e)
|
|
1091
|
+
}) : s.setCell(l, n + 1, n === t ? `합계 (${r.length.toLocaleString("ko-KR")}건)` : null, He);
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
s.freeze({ rows: l });
|
|
1095
|
+
let u = e.map((e) => ({
|
|
1096
|
+
border: !0,
|
|
1097
|
+
format: Ue(e),
|
|
1098
|
+
align: e.align === "right" ? "right" : e.align === "center" ? "center" : void 0
|
|
1099
|
+
}));
|
|
1100
|
+
for (let t of r) {
|
|
1101
|
+
let r = n[t];
|
|
1102
|
+
s.addRow(e.map((e) => {
|
|
1103
|
+
let t = F(r, e);
|
|
1104
|
+
if (t == null || t === "") return null;
|
|
1105
|
+
if (e.type === "int" || e.type === "float") {
|
|
1106
|
+
let e = typeof t == "number" ? t : Number(String(t).replace(/,/g, ""));
|
|
1107
|
+
if (!Number.isNaN(e)) return e;
|
|
1108
|
+
}
|
|
1109
|
+
if (e.type === "date") {
|
|
1110
|
+
let e = le(t);
|
|
1111
|
+
if (e) return e;
|
|
1112
|
+
}
|
|
1113
|
+
return M(t, e);
|
|
1114
|
+
}), u);
|
|
1115
|
+
}
|
|
1116
|
+
return o;
|
|
1117
|
+
}
|
|
1118
|
+
// src/components/DataGrid/FilterPopover.jsx
|
|
1119
|
+
function Ge({ column: e, rows: r, filter: i, position: a, onApply: o, onClose: s }) {
|
|
1120
|
+
let l = p(null), u = e.type === "int" || e.type === "float" || e.type === "date", { values: d, total: h } = f(() => Be(r, e), [r, e]), [g, _] = m(""), [v, y] = m(() => i?.kind === "values" ? new Set(i.values) : new Set(d.map((e) => e.text))), [b, S] = m(i?.kind === "range" ? i.min ?? "" : ""), [C, w] = m(i?.kind === "range" ? i.max ?? "" : ""), T = g ? d.filter((e) => e.text.toLowerCase().includes(g.toLowerCase())) : d, E = T.length > 0 && T.every((e) => v.has(e.text)), ee = T.some((e) => v.has(e.text));
|
|
1121
|
+
c(() => {
|
|
1122
|
+
let e = (e) => {
|
|
1123
|
+
l.current && !l.current.contains(e.target) && s();
|
|
1124
|
+
}, t = (e) => {
|
|
1125
|
+
e.key === "Escape" && s();
|
|
1126
|
+
}, n = (e) => {
|
|
1127
|
+
l.current && !l.current.contains(e.target) && s();
|
|
1128
|
+
};
|
|
1129
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), window.addEventListener("scroll", n, !0), window.addEventListener("resize", s), () => {
|
|
1130
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t), window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", s);
|
|
1131
|
+
};
|
|
1132
|
+
}, [s]);
|
|
1133
|
+
function O() {
|
|
1134
|
+
y((e) => {
|
|
1135
|
+
let t = new Set(e);
|
|
1136
|
+
for (let e of T) E ? t.delete(e.text) : t.add(e.text);
|
|
1137
|
+
return t;
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
function k(e) {
|
|
1141
|
+
y((t) => {
|
|
1142
|
+
let n = new Set(t);
|
|
1143
|
+
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1146
|
+
function ne() {
|
|
1147
|
+
u && (b !== "" || C !== "") ? o({
|
|
1148
|
+
kind: "range",
|
|
1149
|
+
min: b === "" ? null : b,
|
|
1150
|
+
max: C === "" ? null : C
|
|
1151
|
+
}) : v.size === d.length && h <= d.length ? o(null) : o({
|
|
1152
|
+
kind: "values",
|
|
1153
|
+
values: v
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
let re = e.type === "date" ? "date" : "number";
|
|
1157
|
+
return /* @__PURE__ */ n("div", {
|
|
1158
|
+
ref: l,
|
|
1159
|
+
className: A.popover,
|
|
1160
|
+
style: {
|
|
1161
|
+
top: a.top,
|
|
1162
|
+
left: a.left
|
|
1163
|
+
},
|
|
1164
|
+
role: "dialog",
|
|
1165
|
+
"aria-label": `${e.label} 필터`,
|
|
1166
|
+
children: [
|
|
1167
|
+
/* @__PURE__ */ t("p", {
|
|
1168
|
+
className: A.popoverTitle,
|
|
1169
|
+
children: e.label
|
|
1170
|
+
}),
|
|
1171
|
+
u && /* @__PURE__ */ n("div", {
|
|
1172
|
+
className: A.rangeRow,
|
|
1173
|
+
children: [
|
|
1174
|
+
/* @__PURE__ */ t("input", {
|
|
1175
|
+
className: A.miniInput,
|
|
1176
|
+
type: re,
|
|
1177
|
+
value: b,
|
|
1178
|
+
onChange: (e) => S(e.target.value),
|
|
1179
|
+
"aria-label": "이상",
|
|
1180
|
+
placeholder: "이상"
|
|
1181
|
+
}),
|
|
1182
|
+
/* @__PURE__ */ t("span", {
|
|
1183
|
+
"aria-hidden": "true",
|
|
1184
|
+
children: "~"
|
|
1185
|
+
}),
|
|
1186
|
+
/* @__PURE__ */ t("input", {
|
|
1187
|
+
className: A.miniInput,
|
|
1188
|
+
type: re,
|
|
1189
|
+
value: C,
|
|
1190
|
+
onChange: (e) => w(e.target.value),
|
|
1191
|
+
"aria-label": "이하",
|
|
1192
|
+
placeholder: "이하"
|
|
1193
|
+
})
|
|
1194
|
+
]
|
|
1195
|
+
}),
|
|
1196
|
+
/* @__PURE__ */ n("div", {
|
|
1197
|
+
className: A.miniSearch,
|
|
1198
|
+
children: [/* @__PURE__ */ t(x, {
|
|
1199
|
+
name: "search",
|
|
1200
|
+
size: 14
|
|
1201
|
+
}), /* @__PURE__ */ t("input", {
|
|
1202
|
+
type: "search",
|
|
1203
|
+
value: g,
|
|
1204
|
+
onChange: (e) => _(e.target.value),
|
|
1205
|
+
placeholder: "값 검색",
|
|
1206
|
+
"aria-label": "값 검색",
|
|
1207
|
+
autoFocus: !0
|
|
1208
|
+
})]
|
|
1209
|
+
}),
|
|
1210
|
+
/* @__PURE__ */ n("div", {
|
|
1211
|
+
className: A.valueList,
|
|
1212
|
+
children: [
|
|
1213
|
+
/* @__PURE__ */ t(te, {
|
|
1214
|
+
checked: E,
|
|
1215
|
+
indeterminate: !E && ee,
|
|
1216
|
+
onChange: O,
|
|
1217
|
+
children: g ? "검색 결과 전체" : "전체"
|
|
1218
|
+
}),
|
|
1219
|
+
T.map((e) => /* @__PURE__ */ n(te, {
|
|
1220
|
+
checked: v.has(e.text),
|
|
1221
|
+
onChange: () => k(e.text),
|
|
1222
|
+
children: [/* @__PURE__ */ t("span", {
|
|
1223
|
+
className: A.valueText,
|
|
1224
|
+
children: e.text === "" ? "(빈 값)" : e.text
|
|
1225
|
+
}), /* @__PURE__ */ t("span", {
|
|
1226
|
+
className: A.valueCount,
|
|
1227
|
+
children: e.count.toLocaleString("ko-KR")
|
|
1228
|
+
})]
|
|
1229
|
+
}, e.text)),
|
|
1230
|
+
h > d.length && /* @__PURE__ */ n("p", {
|
|
1231
|
+
className: A.valueMore,
|
|
1232
|
+
children: [
|
|
1233
|
+
"값이 많아 앞 ",
|
|
1234
|
+
d.length,
|
|
1235
|
+
"개만 보입니다. 검색으로 찾으세요."
|
|
1236
|
+
]
|
|
1237
|
+
})
|
|
1238
|
+
]
|
|
1239
|
+
}),
|
|
1240
|
+
/* @__PURE__ */ n("div", {
|
|
1241
|
+
className: A.popoverActions,
|
|
1242
|
+
children: [/* @__PURE__ */ t(D, {
|
|
1243
|
+
size: "sm",
|
|
1244
|
+
variant: "ghost",
|
|
1245
|
+
onClick: () => o(null),
|
|
1246
|
+
children: "초기화"
|
|
1247
|
+
}), /* @__PURE__ */ t(D, {
|
|
1248
|
+
size: "sm",
|
|
1249
|
+
variant: "primary",
|
|
1250
|
+
onClick: ne,
|
|
1251
|
+
children: "적용"
|
|
1252
|
+
})]
|
|
1253
|
+
})
|
|
1254
|
+
]
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
// src/components/DataGrid/cellContent.jsx
|
|
1258
|
+
var I = /* @__PURE__ */ new Set([
|
|
1259
|
+
"neutral",
|
|
1260
|
+
"brand",
|
|
1261
|
+
"info",
|
|
1262
|
+
"success",
|
|
1263
|
+
"warning",
|
|
1264
|
+
"danger",
|
|
1265
|
+
"muted"
|
|
1266
|
+
]);
|
|
1267
|
+
function Ke(e, t, n) {
|
|
1268
|
+
if (e == null) return null;
|
|
1269
|
+
let r;
|
|
1270
|
+
return r = typeof e == "function" ? e(t, n) : typeof e == "object" ? e[String(t)] : e, I.has(r) ? r : null;
|
|
1271
|
+
}
|
|
1272
|
+
function qe(r, i) {
|
|
1273
|
+
if (!i || !r) return r;
|
|
1274
|
+
let a = r.toLowerCase().indexOf(i);
|
|
1275
|
+
return a === -1 ? r : /* @__PURE__ */ n(e, { children: [
|
|
1276
|
+
r.slice(0, a),
|
|
1277
|
+
/* @__PURE__ */ t("mark", {
|
|
1278
|
+
className: A.mark,
|
|
1279
|
+
children: r.slice(a, a + i.length)
|
|
1280
|
+
}),
|
|
1281
|
+
r.slice(a + i.length)
|
|
1282
|
+
] });
|
|
1283
|
+
}
|
|
1284
|
+
function Je({ column: e, row: r, value: i, text: a, searchTerm: o, onCellAction: s }) {
|
|
1285
|
+
if (e.render) return e.render({
|
|
1286
|
+
value: i,
|
|
1287
|
+
row: r,
|
|
1288
|
+
text: a
|
|
1289
|
+
});
|
|
1290
|
+
let c = (t) => {
|
|
1291
|
+
t.stopPropagation(), s?.({
|
|
1292
|
+
action: e.action ?? e.name,
|
|
1293
|
+
column: e.name,
|
|
1294
|
+
value: i,
|
|
1295
|
+
row: r
|
|
1296
|
+
});
|
|
1297
|
+
};
|
|
1298
|
+
switch (e.kind) {
|
|
1299
|
+
case "badge": {
|
|
1300
|
+
if (a === "") return null;
|
|
1301
|
+
let o = Ke(e.badge?.tone, i, r) ?? "neutral";
|
|
1302
|
+
return /* @__PURE__ */ n("span", {
|
|
1303
|
+
className: `${A.badge} ${A[`tone-${o}`]}`,
|
|
1304
|
+
children: [e.badge?.dot && /* @__PURE__ */ t("span", {
|
|
1305
|
+
className: A.badgeDot,
|
|
1306
|
+
"aria-hidden": "true"
|
|
1307
|
+
}), a]
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
case "link": return a === "" ? null : /* @__PURE__ */ t("button", {
|
|
1311
|
+
type: "button",
|
|
1312
|
+
className: A.cellLink,
|
|
1313
|
+
onPointerDown: L,
|
|
1314
|
+
onClick: c,
|
|
1315
|
+
children: qe(a, o)
|
|
1316
|
+
});
|
|
1317
|
+
case "button": {
|
|
1318
|
+
let n = e.button ?? {}, o = typeof n.label == "function" ? n.label(i, r) : n.label ?? a;
|
|
1319
|
+
if (!o) return null;
|
|
1320
|
+
let s = Ke(n.tone, i, r) ?? "neutral", l = typeof n.disabled == "function" ? n.disabled(i, r) : !!n.disabled;
|
|
1321
|
+
return /* @__PURE__ */ t("button", {
|
|
1322
|
+
type: "button",
|
|
1323
|
+
className: `${A.cellButton} ${A[`tone-${s}`]}`,
|
|
1324
|
+
disabled: l,
|
|
1325
|
+
onPointerDown: L,
|
|
1326
|
+
onClick: c,
|
|
1327
|
+
children: o
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
default: return /* @__PURE__ */ t("span", {
|
|
1331
|
+
className: A.cellText,
|
|
1332
|
+
children: qe(a, o)
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
function L(e) {
|
|
1337
|
+
e.stopPropagation();
|
|
1338
|
+
}
|
|
1339
|
+
// src/components/DataGrid/cellRange.js
|
|
1340
|
+
function Ye(e) {
|
|
1341
|
+
if (!e) return null;
|
|
1342
|
+
let { anchor: t, focus: n } = e;
|
|
1343
|
+
return {
|
|
1344
|
+
r1: Math.min(t.row, n.row),
|
|
1345
|
+
r2: Math.max(t.row, n.row),
|
|
1346
|
+
c1: Math.min(t.col, n.col),
|
|
1347
|
+
c2: Math.max(t.col, n.col)
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
function Xe(e) {
|
|
1351
|
+
return e ? (e.r2 - e.r1 + 1) * (e.c2 - e.c1 + 1) : 0;
|
|
1352
|
+
}
|
|
1353
|
+
function Ze(e, { rows: t, viewIndices: n, columns: r }) {
|
|
1354
|
+
let i = [];
|
|
1355
|
+
for (let a = e.r1; a <= e.r2; a++) {
|
|
1356
|
+
let o = t[n[a]], s = [];
|
|
1357
|
+
for (let t = e.c1; t <= e.c2; t++) {
|
|
1358
|
+
let e = r[t];
|
|
1359
|
+
s.push(M(F(o, e), e).replace(/[\t\r\n]+/g, " "));
|
|
1360
|
+
}
|
|
1361
|
+
i.push(s.join(" "));
|
|
1362
|
+
}
|
|
1363
|
+
return i.join("\n");
|
|
1364
|
+
}
|
|
1365
|
+
var Qe = 2e6;
|
|
1366
|
+
function $e(e, { rows: t, viewIndices: n, columns: r }) {
|
|
1367
|
+
let i = Xe(e), a = {
|
|
1368
|
+
cells: i,
|
|
1369
|
+
numbers: 0,
|
|
1370
|
+
sum: 0,
|
|
1371
|
+
avg: 0,
|
|
1372
|
+
skipped: !1
|
|
1373
|
+
};
|
|
1374
|
+
if (i <= 1) return a;
|
|
1375
|
+
if (i > Qe) return {
|
|
1376
|
+
...a,
|
|
1377
|
+
skipped: !0
|
|
1378
|
+
};
|
|
1379
|
+
let o = [];
|
|
1380
|
+
for (let t = e.c1; t <= e.c2; t++) {
|
|
1381
|
+
let e = r[t];
|
|
1382
|
+
(e.type === "int" || e.type === "float") && o.push(e);
|
|
1383
|
+
}
|
|
1384
|
+
if (o.length === 0) return a;
|
|
1385
|
+
let s = 0, c = 0;
|
|
1386
|
+
for (let r = e.r1; r <= e.r2; r++) {
|
|
1387
|
+
let e = t[n[r]];
|
|
1388
|
+
for (let t of o) {
|
|
1389
|
+
let n = t.value ? F(e, t) : e[t.name];
|
|
1390
|
+
if (n == null || n === "") continue;
|
|
1391
|
+
let r = typeof n == "number" ? n : Number(String(n).replace(/,/g, ""));
|
|
1392
|
+
Number.isNaN(r) || (s += r, c++);
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
return {
|
|
1396
|
+
cells: i,
|
|
1397
|
+
numbers: c,
|
|
1398
|
+
sum: s,
|
|
1399
|
+
avg: c ? s / c : 0,
|
|
1400
|
+
skipped: !1
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
// src/components/DataGrid/useGridSettings.js
|
|
1404
|
+
var et = "bui.datagrid.", tt = 1;
|
|
1405
|
+
function nt(e) {
|
|
1406
|
+
if (!e) return null;
|
|
1407
|
+
try {
|
|
1408
|
+
let t = window.localStorage.getItem(et + e);
|
|
1409
|
+
if (!t) return null;
|
|
1410
|
+
let n = JSON.parse(t);
|
|
1411
|
+
return n?.v === tt ? n.settings : null;
|
|
1412
|
+
} catch {
|
|
1413
|
+
return null;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
function rt(e, t) {
|
|
1417
|
+
if (e) try {
|
|
1418
|
+
window.localStorage.setItem(et + e, JSON.stringify({
|
|
1419
|
+
v: tt,
|
|
1420
|
+
settings: t
|
|
1421
|
+
}));
|
|
1422
|
+
} catch {}
|
|
1423
|
+
}
|
|
1424
|
+
function it(e, t, n) {
|
|
1425
|
+
let [r, i] = m(() => ({
|
|
1426
|
+
...t,
|
|
1427
|
+
...nt(e)
|
|
1428
|
+
})), a = p(n);
|
|
1429
|
+
a.current = n;
|
|
1430
|
+
let s = p(!0);
|
|
1431
|
+
return c(() => {
|
|
1432
|
+
s.current ? s.current = !1 : (rt(e, r), a.current?.(r));
|
|
1433
|
+
}, [e, r]), [
|
|
1434
|
+
r,
|
|
1435
|
+
o((e) => {
|
|
1436
|
+
i((t) => ({
|
|
1437
|
+
...t,
|
|
1438
|
+
...typeof e == "function" ? e(t) : e
|
|
1439
|
+
}));
|
|
1440
|
+
}, []),
|
|
1441
|
+
o(() => i({ ...t }), [t])
|
|
1442
|
+
];
|
|
1443
|
+
}
|
|
1444
|
+
// src/components/DataGrid/DataGrid.jsx
|
|
1445
|
+
var at = {
|
|
1446
|
+
compact: {
|
|
1447
|
+
row: 32,
|
|
1448
|
+
header: 32
|
|
1449
|
+
},
|
|
1450
|
+
standard: {
|
|
1451
|
+
row: 40,
|
|
1452
|
+
header: 38
|
|
1453
|
+
},
|
|
1454
|
+
comfortable: {
|
|
1455
|
+
row: 48,
|
|
1456
|
+
header: 42
|
|
1457
|
+
}
|
|
1458
|
+
}, ot = "__select", st = 8, ct = 30, lt = {
|
|
1459
|
+
name: ot,
|
|
1460
|
+
header: "",
|
|
1461
|
+
width: 44,
|
|
1462
|
+
minWidth: 44,
|
|
1463
|
+
pin: "left",
|
|
1464
|
+
align: "center",
|
|
1465
|
+
sortable: !1,
|
|
1466
|
+
filterable: !1,
|
|
1467
|
+
resizable: !1,
|
|
1468
|
+
internal: !0
|
|
1469
|
+
};
|
|
1470
|
+
function ut({ columns: r, rows: i, rowKey: a, id: h, selection: _ = "none", checkbox: v = !0, selectedKeys: y, defaultSelectedKeys: b, onSelectionChange: S, summary: w = "top", quickSearch: T = !1, excel: E = !1, columnSettings: ee = !0, title: O, toolbar: k, bulkActions: ne, loading: ie = !1, error: oe, onRetry: se, emptyMessage: ce = "조회된 데이터가 없습니다.", height: le = 520, density: ue = "standard", gridLines: de = "all", defaultSort: fe, rangeSelection: j = !0, rowState: pe, onCellAction: me, onRowClick: he, onRowDoubleClick: be, onSettingsChange: xe, className: Se, ref: Ce }) {
|
|
1471
|
+
let we = l(), Te = p(null), N = p(null), Ee = _ === "multiple" && v, De = f(() => Ee ? [lt, ...r] : r, [r, Ee]), [Oe, ke, Ae] = it(h, f(() => ({
|
|
1472
|
+
order: null,
|
|
1473
|
+
widths: {},
|
|
1474
|
+
hidden: null,
|
|
1475
|
+
pins: {},
|
|
1476
|
+
density: ue,
|
|
1477
|
+
sort: fe ?? []
|
|
1478
|
+
}), [ue, fe]), xe), P = f(() => {
|
|
1479
|
+
let e = Oe.order?.filter((e) => e !== ot);
|
|
1480
|
+
return ge(De, {
|
|
1481
|
+
...Oe,
|
|
1482
|
+
order: Ee ? [ot, ...e ?? []] : e
|
|
1483
|
+
});
|
|
1484
|
+
}, [
|
|
1485
|
+
De,
|
|
1486
|
+
Oe,
|
|
1487
|
+
Ee
|
|
1488
|
+
]), je = f(() => [
|
|
1489
|
+
...P.left,
|
|
1490
|
+
...P.center,
|
|
1491
|
+
...P.right
|
|
1492
|
+
].filter((e) => !e.internal), [P]), Me = je.map((e) => `${e.name}:${e.type}:${e.format ?? ""}:${String(e.summary ?? "")}`).join("|"), Ne = p({
|
|
1493
|
+
signature: null,
|
|
1494
|
+
columns: []
|
|
1495
|
+
});
|
|
1496
|
+
Ne.current.signature !== Me && (Ne.current = {
|
|
1497
|
+
signature: Me,
|
|
1498
|
+
columns: je
|
|
1499
|
+
});
|
|
1500
|
+
let Pe = Ne.current.columns, [Fe, Le] = m(""), Be = s(Fe), [Ve, He] = m({}), Ue = Oe.sort, I = f(() => Re(i, Pe, {
|
|
1501
|
+
search: Be,
|
|
1502
|
+
filters: Ve,
|
|
1503
|
+
sort: Ue
|
|
1504
|
+
}), [
|
|
1505
|
+
i,
|
|
1506
|
+
Pe,
|
|
1507
|
+
Be,
|
|
1508
|
+
Ve,
|
|
1509
|
+
Ue
|
|
1510
|
+
]);
|
|
1511
|
+
c(() => T ? Ie(i, Pe) : void 0, [
|
|
1512
|
+
T,
|
|
1513
|
+
i,
|
|
1514
|
+
Pe
|
|
1515
|
+
]);
|
|
1516
|
+
let qe = f(() => ze(i, I, Pe), [
|
|
1517
|
+
i,
|
|
1518
|
+
I,
|
|
1519
|
+
Pe
|
|
1520
|
+
]), Je = w !== !1 && Pe.some((e) => e.summary), L = at[Oe.density] ?? at.standard, Qe = P.depth * L.header, et = Je ? L.row : 0, tt = I.length * L.row, [nt, rt] = m({
|
|
1521
|
+
width: 0,
|
|
1522
|
+
height: 0
|
|
1523
|
+
}), [ut, dt] = m({
|
|
1524
|
+
top: 0,
|
|
1525
|
+
left: 0
|
|
1526
|
+
});
|
|
1527
|
+
d(() => {
|
|
1528
|
+
let e = N.current;
|
|
1529
|
+
if (!e) return;
|
|
1530
|
+
let t = new ResizeObserver(() => rt({
|
|
1531
|
+
width: e.clientWidth,
|
|
1532
|
+
height: e.clientHeight
|
|
1533
|
+
}));
|
|
1534
|
+
return t.observe(e), () => t.disconnect();
|
|
1535
|
+
}, []);
|
|
1536
|
+
let gt = p(0), yt = o(() => {
|
|
1537
|
+
gt.current ||= requestAnimationFrame(() => {
|
|
1538
|
+
gt.current = 0;
|
|
1539
|
+
let e = N.current;
|
|
1540
|
+
e && dt((t) => t.top === e.scrollTop && t.left === e.scrollLeft ? t : {
|
|
1541
|
+
top: e.scrollTop,
|
|
1542
|
+
left: e.scrollLeft
|
|
1543
|
+
});
|
|
1544
|
+
});
|
|
1545
|
+
}, []);
|
|
1546
|
+
c(() => () => cancelAnimationFrame(gt.current), []);
|
|
1547
|
+
let R = Math.max(0, nt.height - Qe - et), z = Math.max(0, Math.floor(ut.top / L.row) - st), bt = Math.min(I.length - 1, Math.ceil((ut.top + R) / L.row) + st), xt = Math.max(0, nt.width - P.leftWidth - P.rightWidth), [St, Ct] = P.center.length > ct ? _e(P.centerOffsets, ut.left, ut.left + xt) : [0, P.center.length - 1], { cols: B, template: wt } = f(() => ve(P, [St, Ct]), [
|
|
1548
|
+
P,
|
|
1549
|
+
St,
|
|
1550
|
+
Ct
|
|
1551
|
+
]), Tt = f(() => ye(B, P.depth), [B, P.depth]), Et = P.left[P.left.length - 1]?.name, Dt = P.right[0]?.name, Ot = ut.left > 0, kt = ut.left + nt.width < P.totalWidth - 1, V = o((e, t) => typeof a == "function" ? a(e) : a ? e[a] : t, [a]), At = y !== void 0, [H, jt] = m(() => new Set(b ?? [])), U = f(() => At ? new Set(y) : H, [
|
|
1552
|
+
At,
|
|
1553
|
+
y,
|
|
1554
|
+
H
|
|
1555
|
+
]), Mt = p(null), W = f(() => {
|
|
1556
|
+
if (_ === "none") return null;
|
|
1557
|
+
let e = /* @__PURE__ */ new Map();
|
|
1558
|
+
return i.forEach((t, n) => e.set(V(t, n), n)), e;
|
|
1559
|
+
}, [
|
|
1560
|
+
i,
|
|
1561
|
+
V,
|
|
1562
|
+
_
|
|
1563
|
+
]), G = o((e = U) => [...e].map((e) => W?.get(e)).filter((e) => e != null).map((e) => i[e]), [
|
|
1564
|
+
U,
|
|
1565
|
+
W,
|
|
1566
|
+
i
|
|
1567
|
+
]), K = o((e) => {
|
|
1568
|
+
At || jt(e), S?.([...e], G(e));
|
|
1569
|
+
}, [
|
|
1570
|
+
At,
|
|
1571
|
+
S,
|
|
1572
|
+
G
|
|
1573
|
+
]), q = o((e, { shift: t = !1, toggle: n = !1 } = {}) => {
|
|
1574
|
+
if (_ === "none") return;
|
|
1575
|
+
let r = I[e], a = V(i[r], r);
|
|
1576
|
+
if (_ === "single") {
|
|
1577
|
+
K(new Set(U.has(a) && n ? [] : [a])), Mt.current = e;
|
|
1578
|
+
return;
|
|
1579
|
+
}
|
|
1580
|
+
let o = new Set(U);
|
|
1581
|
+
if (t && Mt.current != null) {
|
|
1582
|
+
let [t, n] = [Mt.current, e].sort((e, t) => e - t);
|
|
1583
|
+
for (let e = t; e <= n; e++) o.add(V(i[I[e]], I[e]));
|
|
1584
|
+
} else o.has(a) ? (o.delete(a), Mt.current = e) : (o.add(a), Mt.current = e);
|
|
1585
|
+
K(o);
|
|
1586
|
+
}, [
|
|
1587
|
+
_,
|
|
1588
|
+
I,
|
|
1589
|
+
V,
|
|
1590
|
+
i,
|
|
1591
|
+
U,
|
|
1592
|
+
K
|
|
1593
|
+
]), Nt = f(() => {
|
|
1594
|
+
if (!Ee || I.length === 0) return {
|
|
1595
|
+
all: !1,
|
|
1596
|
+
some: !1
|
|
1597
|
+
};
|
|
1598
|
+
let e = 0;
|
|
1599
|
+
for (let t of I) U.has(V(i[t], t)) && e++;
|
|
1600
|
+
return {
|
|
1601
|
+
all: e === I.length,
|
|
1602
|
+
some: e > 0
|
|
1603
|
+
};
|
|
1604
|
+
}, [
|
|
1605
|
+
Ee,
|
|
1606
|
+
I,
|
|
1607
|
+
U,
|
|
1608
|
+
V,
|
|
1609
|
+
i
|
|
1610
|
+
]), Pt = o(() => {
|
|
1611
|
+
let e = new Set(U);
|
|
1612
|
+
for (let t of I) {
|
|
1613
|
+
let n = V(i[t], t);
|
|
1614
|
+
Nt.all ? e.delete(n) : e.add(n);
|
|
1615
|
+
}
|
|
1616
|
+
K(e);
|
|
1617
|
+
}, [
|
|
1618
|
+
U,
|
|
1619
|
+
I,
|
|
1620
|
+
V,
|
|
1621
|
+
i,
|
|
1622
|
+
Nt.all,
|
|
1623
|
+
K
|
|
1624
|
+
]), Ft = o(() => K(/* @__PURE__ */ new Set()), [K]), It = o((e, t) => {
|
|
1625
|
+
ke((n) => {
|
|
1626
|
+
let r = n.sort.find((t) => t.name === e), i = r ? r.dir === "asc" ? "desc" : null : "asc";
|
|
1627
|
+
if (!t) return { sort: i ? [{
|
|
1628
|
+
name: e,
|
|
1629
|
+
dir: i
|
|
1630
|
+
}] : [] };
|
|
1631
|
+
let a = n.sort.filter((t) => t.name !== e);
|
|
1632
|
+
return { sort: i ? [...a, {
|
|
1633
|
+
name: e,
|
|
1634
|
+
dir: i
|
|
1635
|
+
}] : a };
|
|
1636
|
+
});
|
|
1637
|
+
}, [ke]), [Lt, Rt] = m(null), zt = o((e, t) => {
|
|
1638
|
+
let n = t.getBoundingClientRect(), r = n.bottom + 4;
|
|
1639
|
+
Rt({
|
|
1640
|
+
column: e,
|
|
1641
|
+
position: {
|
|
1642
|
+
top: r + 420 > window.innerHeight ? Math.max(8, n.top - 420 - 4) : r,
|
|
1643
|
+
left: Math.min(Math.max(8, n.right - 280), window.innerWidth - 280 - 8)
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
}, []), Bt = o(() => Rt(null), []), Vt = o((e, t) => {
|
|
1647
|
+
He((n) => {
|
|
1648
|
+
let r = { ...n };
|
|
1649
|
+
return t ? r[e] = t : delete r[e], r;
|
|
1650
|
+
}), Rt(null);
|
|
1651
|
+
}, []), J = Object.keys(Ve).length, Ht = o((e, t) => ke((n) => ({ widths: {
|
|
1652
|
+
...n.widths,
|
|
1653
|
+
[e]: Math.round(t)
|
|
1654
|
+
} })), [ke]), Y = o((e) => {
|
|
1655
|
+
let t = document.createElement("canvas").getContext("2d"), n = getComputedStyle(N.current);
|
|
1656
|
+
t.font = `${n.fontSize} ${n.fontFamily}`;
|
|
1657
|
+
let r = t.measureText(e.label).width + 40, a = Math.min(I.length, 1e3);
|
|
1658
|
+
for (let n = 0; n < a; n++) {
|
|
1659
|
+
let a = M(F(i[I[n]], e), e), o = t.measureText(a).width + 28;
|
|
1660
|
+
o > r && (r = o);
|
|
1661
|
+
}
|
|
1662
|
+
Ht(e.name, Math.min(600, Math.max(e.minWidth, r)));
|
|
1663
|
+
}, [
|
|
1664
|
+
I,
|
|
1665
|
+
i,
|
|
1666
|
+
Ht
|
|
1667
|
+
]), X = je, Ut = f(() => new Map(X.map((e, t) => [e.name, t])), [X]), [Z, Wt] = m(null), [Gt, Q] = m(null), $ = f(() => Ye(Gt), [Gt]), [Kt, qt] = m(""), Jt = o((e, t) => {
|
|
1668
|
+
let n = N.current;
|
|
1669
|
+
if (!n) return;
|
|
1670
|
+
let r = e * L.row;
|
|
1671
|
+
r < n.scrollTop ? n.scrollTop = r : r + L.row > n.scrollTop + R && (n.scrollTop = r + L.row - R);
|
|
1672
|
+
let i = P.center.findIndex((e) => e.name === t);
|
|
1673
|
+
if (i >= 0) {
|
|
1674
|
+
let e = P.centerOffsets[i], t = P.centerOffsets[i + 1];
|
|
1675
|
+
e < n.scrollLeft ? n.scrollLeft = e : t > n.scrollLeft + xt && (n.scrollLeft = t - xt);
|
|
1676
|
+
}
|
|
1677
|
+
}, [
|
|
1678
|
+
L.row,
|
|
1679
|
+
R,
|
|
1680
|
+
P,
|
|
1681
|
+
xt
|
|
1682
|
+
]), Yt = o((e, t, { extend: n = !1 } = {}) => {
|
|
1683
|
+
if (I.length === 0 || X.length === 0) return;
|
|
1684
|
+
let r = Math.min(I.length - 1, Math.max(0, e)), i = Math.min(X.length - 1, Math.max(0, t)), a = X[i].name;
|
|
1685
|
+
if (Wt({
|
|
1686
|
+
row: r,
|
|
1687
|
+
col: a
|
|
1688
|
+
}), j) {
|
|
1689
|
+
let e = {
|
|
1690
|
+
row: r,
|
|
1691
|
+
col: i
|
|
1692
|
+
};
|
|
1693
|
+
Q((t) => n && t ? {
|
|
1694
|
+
anchor: t.anchor,
|
|
1695
|
+
focus: e
|
|
1696
|
+
} : {
|
|
1697
|
+
anchor: e,
|
|
1698
|
+
focus: e
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
Jt(r, a);
|
|
1702
|
+
}, [
|
|
1703
|
+
I.length,
|
|
1704
|
+
X,
|
|
1705
|
+
Jt,
|
|
1706
|
+
j
|
|
1707
|
+
]);
|
|
1708
|
+
c(() => {
|
|
1709
|
+
Q(null);
|
|
1710
|
+
}, [I]);
|
|
1711
|
+
let Xt = o((e) => {
|
|
1712
|
+
qt(e), setTimeout(() => qt(""), 2e3);
|
|
1713
|
+
}, []), Zt = o(async () => {
|
|
1714
|
+
let e = "", t = "복사됨", n = Xe($);
|
|
1715
|
+
if (j && n > 1) e = Ze($, {
|
|
1716
|
+
rows: i,
|
|
1717
|
+
viewIndices: I,
|
|
1718
|
+
columns: X
|
|
1719
|
+
}), t = `${n.toLocaleString("ko-KR")}칸 복사됨`;
|
|
1720
|
+
else if (U.size > 0) {
|
|
1721
|
+
let n = G(), r = [X.map((e) => e.path.join(" ")).join(" ")];
|
|
1722
|
+
for (let e of n) r.push(X.map((t) => M(F(e, t), t)).join(" "));
|
|
1723
|
+
e = r.join("\n"), t = `${U.size}건 복사됨`;
|
|
1724
|
+
} else if (Z) {
|
|
1725
|
+
let t = X.find((e) => e.name === Z.col);
|
|
1726
|
+
e = M(F(i[I[Z.row]], t), t);
|
|
1727
|
+
}
|
|
1728
|
+
e && Xt(await mt(e) ? t : "복사하지 못했습니다");
|
|
1729
|
+
}, [
|
|
1730
|
+
$,
|
|
1731
|
+
j,
|
|
1732
|
+
U,
|
|
1733
|
+
G,
|
|
1734
|
+
X,
|
|
1735
|
+
Z,
|
|
1736
|
+
i,
|
|
1737
|
+
I,
|
|
1738
|
+
Xt
|
|
1739
|
+
]), Qt = o(() => {
|
|
1740
|
+
I.length !== 0 && X.length !== 0 && Q({
|
|
1741
|
+
anchor: {
|
|
1742
|
+
row: 0,
|
|
1743
|
+
col: 0
|
|
1744
|
+
},
|
|
1745
|
+
focus: {
|
|
1746
|
+
row: I.length - 1,
|
|
1747
|
+
col: X.length - 1
|
|
1748
|
+
}
|
|
1749
|
+
});
|
|
1750
|
+
}, [I.length, X.length]), $t = o((e) => {
|
|
1751
|
+
let t = e.target === N.current, n = e.ctrlKey || e.metaKey;
|
|
1752
|
+
if (n && e.key.toLowerCase() === "c") {
|
|
1753
|
+
e.preventDefault(), Zt();
|
|
1754
|
+
return;
|
|
1755
|
+
}
|
|
1756
|
+
if (n && e.key.toLowerCase() === "a") {
|
|
1757
|
+
j ? (e.preventDefault(), Qt()) : _ === "multiple" && (e.preventDefault(), Nt.all || Pt());
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
if (!Z) {
|
|
1761
|
+
[
|
|
1762
|
+
"ArrowDown",
|
|
1763
|
+
"ArrowUp",
|
|
1764
|
+
"ArrowLeft",
|
|
1765
|
+
"ArrowRight"
|
|
1766
|
+
].includes(e.key) && (e.preventDefault(), Yt(0, 0));
|
|
1767
|
+
return;
|
|
1768
|
+
}
|
|
1769
|
+
let r = X.findIndex((e) => e.name === Z.col), a = I.length - 1, o = X.length - 1, s = Math.max(1, Math.floor(R / L.row) - 1), c = {
|
|
1770
|
+
ArrowDown: [n ? a : Z.row + 1, r],
|
|
1771
|
+
ArrowUp: [n ? 0 : Z.row - 1, r],
|
|
1772
|
+
ArrowRight: [Z.row, n ? o : r + 1],
|
|
1773
|
+
ArrowLeft: [Z.row, n ? 0 : r - 1],
|
|
1774
|
+
PageDown: [Z.row + s, r],
|
|
1775
|
+
PageUp: [Z.row - s, r],
|
|
1776
|
+
Home: n ? [0, 0] : [Z.row, 0],
|
|
1777
|
+
End: n ? [a, o] : [Z.row, o]
|
|
1778
|
+
};
|
|
1779
|
+
if (c[e.key]) {
|
|
1780
|
+
e.preventDefault();
|
|
1781
|
+
let t = e.shiftKey && j;
|
|
1782
|
+
Yt(c[e.key][0], c[e.key][1], { extend: t }), !j && e.shiftKey && _ === "multiple" && (e.key === "ArrowDown" || e.key === "ArrowUp") && q(Math.min(a, Math.max(0, c[e.key][0])), { shift: !0 });
|
|
1783
|
+
} else if (e.key === " " && t && _ !== "none") e.preventDefault(), q(Z.row, { toggle: !0 });
|
|
1784
|
+
else {
|
|
1785
|
+
if (e.key === "Enter" && t) {
|
|
1786
|
+
let e = I[Z.row];
|
|
1787
|
+
be?.(i[e], e);
|
|
1788
|
+
}
|
|
1789
|
+
e.key === "Escape" && (Xe($) > 1 ? Yt(Z.row, r) : U.size > 0 && Ft());
|
|
1790
|
+
}
|
|
1791
|
+
}, [
|
|
1792
|
+
Z,
|
|
1793
|
+
X,
|
|
1794
|
+
R,
|
|
1795
|
+
L.row,
|
|
1796
|
+
I,
|
|
1797
|
+
Yt,
|
|
1798
|
+
_,
|
|
1799
|
+
q,
|
|
1800
|
+
Zt,
|
|
1801
|
+
Nt.all,
|
|
1802
|
+
Pt,
|
|
1803
|
+
be,
|
|
1804
|
+
i,
|
|
1805
|
+
U.size,
|
|
1806
|
+
Ft,
|
|
1807
|
+
j,
|
|
1808
|
+
Qt,
|
|
1809
|
+
$
|
|
1810
|
+
]);
|
|
1811
|
+
c(() => {
|
|
1812
|
+
Z && Z.row >= I.length && Wt(null);
|
|
1813
|
+
}, [Z, I.length]);
|
|
1814
|
+
let en = p(null), tn = {
|
|
1815
|
+
top: Qe + (w === "bottom" ? 0 : et),
|
|
1816
|
+
bottom: w === "bottom" ? et : 0
|
|
1817
|
+
}, nn = p(tn);
|
|
1818
|
+
nn.current = tn;
|
|
1819
|
+
let rn = p(X);
|
|
1820
|
+
rn.current = X;
|
|
1821
|
+
let an = o((e) => {
|
|
1822
|
+
let t = N.current;
|
|
1823
|
+
if (!t) return;
|
|
1824
|
+
let n = {
|
|
1825
|
+
x: e.clientX,
|
|
1826
|
+
y: e.clientY,
|
|
1827
|
+
raf: 0
|
|
1828
|
+
};
|
|
1829
|
+
en.current = n;
|
|
1830
|
+
let r = () => {
|
|
1831
|
+
let e = t.getBoundingClientRect(), { top: i, bottom: a } = nn.current, o = e.top + i, s = e.top + t.clientHeight - a, c = e.left, l = e.left + t.clientWidth, u = (e) => Math.max(-40, Math.min(40, Math.round(e / 2))), d = n.y < o + 28 ? u(n.y - o - 28) : n.y > s - 28 ? u(n.y - s + 28) : 0, f = n.x < c + 28 ? u(n.x - c - 28) : n.x > l - 28 ? u(n.x - l + 28) : 0;
|
|
1832
|
+
(f || d) && t.scrollBy(f, d);
|
|
1833
|
+
let p = Math.min(l - 2, Math.max(c + 2, n.x)), m = Math.min(s - 2, Math.max(o + 2, n.y)), h = document.elementFromPoint(p, m)?.closest("[data-cell]");
|
|
1834
|
+
if (h && t.contains(h)) {
|
|
1835
|
+
let e = Number(h.dataset.row), t = Number(h.dataset.col);
|
|
1836
|
+
Q((n) => n && (n.focus.row !== e || n.focus.col !== t) ? {
|
|
1837
|
+
anchor: n.anchor,
|
|
1838
|
+
focus: {
|
|
1839
|
+
row: e,
|
|
1840
|
+
col: t
|
|
1841
|
+
}
|
|
1842
|
+
} : n);
|
|
1843
|
+
let n = rn.current[t]?.name;
|
|
1844
|
+
Wt((t) => t && t.row === e && t.col === n ? t : {
|
|
1845
|
+
row: e,
|
|
1846
|
+
col: n
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
n.raf = requestAnimationFrame(r);
|
|
1850
|
+
}, i = (e) => {
|
|
1851
|
+
n.x = e.clientX, n.y = e.clientY;
|
|
1852
|
+
}, a = () => {
|
|
1853
|
+
cancelAnimationFrame(n.raf), window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", a), en.current = null;
|
|
1854
|
+
};
|
|
1855
|
+
window.addEventListener("pointermove", i), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", a), n.raf = requestAnimationFrame(r);
|
|
1856
|
+
}, []);
|
|
1857
|
+
c(() => () => en.current && cancelAnimationFrame(en.current.raf), []);
|
|
1858
|
+
let on = o((e, t, n) => {
|
|
1859
|
+
if (n === ot || e.button !== 0) return;
|
|
1860
|
+
if (Wt({
|
|
1861
|
+
row: t,
|
|
1862
|
+
col: n
|
|
1863
|
+
}), j) {
|
|
1864
|
+
let r = {
|
|
1865
|
+
row: t,
|
|
1866
|
+
col: Ut.get(n)
|
|
1867
|
+
};
|
|
1868
|
+
Q((t) => e.shiftKey && t ? {
|
|
1869
|
+
anchor: t.anchor,
|
|
1870
|
+
focus: r
|
|
1871
|
+
} : {
|
|
1872
|
+
anchor: r,
|
|
1873
|
+
focus: r
|
|
1874
|
+
}), an(e);
|
|
1875
|
+
}
|
|
1876
|
+
let r = e.ctrlKey || e.metaKey, a = !j && e.shiftKey;
|
|
1877
|
+
(_ === "single" || _ === "multiple" && (r || a)) && q(t, {
|
|
1878
|
+
shift: a,
|
|
1879
|
+
toggle: r
|
|
1880
|
+
});
|
|
1881
|
+
let o = I[t];
|
|
1882
|
+
he?.(i[o], o);
|
|
1883
|
+
}, [
|
|
1884
|
+
_,
|
|
1885
|
+
q,
|
|
1886
|
+
I,
|
|
1887
|
+
he,
|
|
1888
|
+
i,
|
|
1889
|
+
j,
|
|
1890
|
+
Ut,
|
|
1891
|
+
an
|
|
1892
|
+
]), sn = o((e, t) => q(t, { shift: e.shiftKey }), [q]), cn = o((e) => {
|
|
1893
|
+
let t = I[e];
|
|
1894
|
+
be?.(i[t], t);
|
|
1895
|
+
}, [
|
|
1896
|
+
I,
|
|
1897
|
+
be,
|
|
1898
|
+
i
|
|
1899
|
+
]), ln = p(me);
|
|
1900
|
+
ln.current = me;
|
|
1901
|
+
let un = o((e) => ln.current?.(e), []), dn = s($), fn = f(() => j && Xe(dn) > 1 ? $e(dn, {
|
|
1902
|
+
rows: i,
|
|
1903
|
+
viewIndices: I,
|
|
1904
|
+
columns: X
|
|
1905
|
+
}) : null, [
|
|
1906
|
+
j,
|
|
1907
|
+
dn,
|
|
1908
|
+
i,
|
|
1909
|
+
I,
|
|
1910
|
+
X
|
|
1911
|
+
]), pn = o(async (e = {}) => {
|
|
1912
|
+
let t = e.fileName ?? (typeof E == "object" && E.fileName) ?? "data";
|
|
1913
|
+
await We({
|
|
1914
|
+
columns: je,
|
|
1915
|
+
depth: Math.max(1, ...je.map((e) => e.path.length)),
|
|
1916
|
+
rows: i,
|
|
1917
|
+
indices: I,
|
|
1918
|
+
summary: Je ? qe : null,
|
|
1919
|
+
sheetName: e.sheetName ?? (typeof E == "object" && E.sheetName) ?? (typeof O == "string" ? O : "Sheet1")
|
|
1920
|
+
}).download(t);
|
|
1921
|
+
}, [
|
|
1922
|
+
E,
|
|
1923
|
+
O,
|
|
1924
|
+
je,
|
|
1925
|
+
i,
|
|
1926
|
+
I,
|
|
1927
|
+
Je,
|
|
1928
|
+
qe
|
|
1929
|
+
]), [mn, hn] = m(!1);
|
|
1930
|
+
u(Ce, () => ({
|
|
1931
|
+
getViewRows: () => I.map((e) => i[e]),
|
|
1932
|
+
getSelectedRows: () => G(),
|
|
1933
|
+
clearSelection: Ft,
|
|
1934
|
+
exportExcel: pn,
|
|
1935
|
+
resetSettings: Ae,
|
|
1936
|
+
scrollToRow: (e) => Jt(e, null)
|
|
1937
|
+
}), [
|
|
1938
|
+
I,
|
|
1939
|
+
i,
|
|
1940
|
+
G,
|
|
1941
|
+
Ft,
|
|
1942
|
+
pn,
|
|
1943
|
+
Ae,
|
|
1944
|
+
Jt
|
|
1945
|
+
]);
|
|
1946
|
+
let gn = I.length, _n = O || k || T || E || ee, vn = U.size, yn = Z ? `${we}-r${Z.row}-${Z.col}` : void 0, bn = ie && i.length === 0, xn = (e) => Ue.findIndex((t) => t.name === e), Sn = [];
|
|
1947
|
+
if (!bn && !oe) for (let e = z; e <= bt; e++) {
|
|
1948
|
+
let n = I[e], r = i[n], a = V(r, n);
|
|
1949
|
+
Sn.push(/* @__PURE__ */ t(vt, {
|
|
1950
|
+
gridId: we,
|
|
1951
|
+
row: r,
|
|
1952
|
+
viewIndex: e,
|
|
1953
|
+
top: e * L.row,
|
|
1954
|
+
height: L.row,
|
|
1955
|
+
renderCols: B,
|
|
1956
|
+
selected: U.has(a),
|
|
1957
|
+
activeCol: Z?.row === e ? Z.col : null,
|
|
1958
|
+
rangeInfo: $ && e >= $.r1 && e <= $.r2 ? ht($, e) : null,
|
|
1959
|
+
colIndexOf: Ut,
|
|
1960
|
+
tone: pe ? Ke(pe(r), null, r) : null,
|
|
1961
|
+
searchTerm: Be.trim().toLowerCase(),
|
|
1962
|
+
lastLeftName: Et,
|
|
1963
|
+
firstRightName: Dt,
|
|
1964
|
+
onCellPointerDown: on,
|
|
1965
|
+
onCheckboxClick: sn,
|
|
1966
|
+
onDoubleClick: cn,
|
|
1967
|
+
onCellAction: un
|
|
1968
|
+
}, a));
|
|
1969
|
+
}
|
|
1970
|
+
return /* @__PURE__ */ n("div", {
|
|
1971
|
+
ref: Te,
|
|
1972
|
+
className: g(A.root, de === "all" && A.linesAll, Ot && A.scrolledLeft, kt && A.scrolledRight, Se),
|
|
1973
|
+
style: { height: le },
|
|
1974
|
+
children: [
|
|
1975
|
+
_n && /* @__PURE__ */ n("div", {
|
|
1976
|
+
className: A.toolbar,
|
|
1977
|
+
children: [/* @__PURE__ */ n("div", {
|
|
1978
|
+
className: A.toolbarLeft,
|
|
1979
|
+
children: [O && /* @__PURE__ */ t("h3", {
|
|
1980
|
+
className: A.title,
|
|
1981
|
+
children: O
|
|
1982
|
+
}), k]
|
|
1983
|
+
}), /* @__PURE__ */ n("div", {
|
|
1984
|
+
className: A.toolbarRight,
|
|
1985
|
+
children: [
|
|
1986
|
+
J > 0 && /* @__PURE__ */ n(D, {
|
|
1987
|
+
size: "sm",
|
|
1988
|
+
variant: "ghost",
|
|
1989
|
+
icon: "x",
|
|
1990
|
+
onClick: () => He({}),
|
|
1991
|
+
children: ["필터 해제 ", J]
|
|
1992
|
+
}),
|
|
1993
|
+
T && /* @__PURE__ */ n("label", {
|
|
1994
|
+
className: A.search,
|
|
1995
|
+
children: [/* @__PURE__ */ t(x, {
|
|
1996
|
+
name: "search",
|
|
1997
|
+
size: 16
|
|
1998
|
+
}), /* @__PURE__ */ t("input", {
|
|
1999
|
+
type: "search",
|
|
2000
|
+
value: Fe,
|
|
2001
|
+
onChange: (e) => Le(e.target.value),
|
|
2002
|
+
placeholder: "표 안에서 검색",
|
|
2003
|
+
"aria-label": "표 안에서 검색"
|
|
2004
|
+
})]
|
|
2005
|
+
}),
|
|
2006
|
+
E && /* @__PURE__ */ t(re, {
|
|
2007
|
+
icon: "download",
|
|
2008
|
+
label: "엑셀 다운로드",
|
|
2009
|
+
variant: "secondary",
|
|
2010
|
+
size: "sm",
|
|
2011
|
+
onClick: () => pn()
|
|
2012
|
+
}),
|
|
2013
|
+
ee && /* @__PURE__ */ t(re, {
|
|
2014
|
+
icon: "columns",
|
|
2015
|
+
label: "컬럼 설정",
|
|
2016
|
+
variant: "secondary",
|
|
2017
|
+
size: "sm",
|
|
2018
|
+
"aria-expanded": mn,
|
|
2019
|
+
onClick: () => hn((e) => !e)
|
|
2020
|
+
})
|
|
2021
|
+
]
|
|
2022
|
+
})]
|
|
2023
|
+
}),
|
|
2024
|
+
ie && i.length > 0 && /* @__PURE__ */ t("div", {
|
|
2025
|
+
className: A.progress,
|
|
2026
|
+
role: "progressbar",
|
|
2027
|
+
"aria-label": "불러오는 중"
|
|
2028
|
+
}),
|
|
2029
|
+
/* @__PURE__ */ t("div", {
|
|
2030
|
+
ref: N,
|
|
2031
|
+
className: g(A.scroller, j && A.rangeMode),
|
|
2032
|
+
role: "grid",
|
|
2033
|
+
"aria-label": typeof O == "string" ? O : "데이터 표",
|
|
2034
|
+
"aria-rowcount": gn + P.depth + +!!Je,
|
|
2035
|
+
"aria-colcount": X.length,
|
|
2036
|
+
"aria-multiselectable": _ === "multiple" || void 0,
|
|
2037
|
+
"aria-activedescendant": yn,
|
|
2038
|
+
"aria-busy": ie || void 0,
|
|
2039
|
+
tabIndex: 0,
|
|
2040
|
+
onScroll: yt,
|
|
2041
|
+
onKeyDown: $t,
|
|
2042
|
+
onFocus: (e) => {
|
|
2043
|
+
e.target === N.current && !Z && gn > 0 && Wt({
|
|
2044
|
+
row: 0,
|
|
2045
|
+
col: X[0]?.name
|
|
2046
|
+
});
|
|
2047
|
+
},
|
|
2048
|
+
children: /* @__PURE__ */ n("div", {
|
|
2049
|
+
className: A.content,
|
|
2050
|
+
style: {
|
|
2051
|
+
width: P.totalWidth,
|
|
2052
|
+
height: Qe + et + Math.max(tt, bn || oe || gn === 0 ? 200 : 0),
|
|
2053
|
+
"--bui-grid-template": wt,
|
|
2054
|
+
"--bui-row-height": `${L.row}px`
|
|
2055
|
+
},
|
|
2056
|
+
children: [
|
|
2057
|
+
/* @__PURE__ */ t("div", {
|
|
2058
|
+
className: A.header,
|
|
2059
|
+
role: "row",
|
|
2060
|
+
"aria-rowindex": 1,
|
|
2061
|
+
style: { gridTemplateRows: `repeat(${P.depth}, ${L.header}px)` },
|
|
2062
|
+
children: Tt.map((e) => /* @__PURE__ */ t(ft, {
|
|
2063
|
+
cell: e,
|
|
2064
|
+
sortState: e.column ? Ue.find((t) => t.name === e.column.name) : null,
|
|
2065
|
+
sortOrder: e.column && Ue.length > 1 ? xn(e.column.name) + 1 : 0,
|
|
2066
|
+
filterActive: e.column ? !!Ve[e.column.name] : !1,
|
|
2067
|
+
edge: e.column?.name === Et ? "left" : e.column?.name === Dt ? "right" : null,
|
|
2068
|
+
selectAll: e.column?.name === ot ? /* @__PURE__ */ t(te, {
|
|
2069
|
+
"aria-label": "전체 선택",
|
|
2070
|
+
checked: Nt.all,
|
|
2071
|
+
indeterminate: !Nt.all && Nt.some,
|
|
2072
|
+
onChange: Pt
|
|
2073
|
+
}) : null,
|
|
2074
|
+
onSort: It,
|
|
2075
|
+
onFilter: zt,
|
|
2076
|
+
onResize: Ht,
|
|
2077
|
+
onAutoSize: Y
|
|
2078
|
+
}, e.key))
|
|
2079
|
+
}),
|
|
2080
|
+
Je && w !== "bottom" && /* @__PURE__ */ t(pt, {
|
|
2081
|
+
renderCols: B,
|
|
2082
|
+
summaryMap: qe,
|
|
2083
|
+
count: gn,
|
|
2084
|
+
top: Qe,
|
|
2085
|
+
lastLeftName: Et,
|
|
2086
|
+
firstRightName: Dt
|
|
2087
|
+
}),
|
|
2088
|
+
/* @__PURE__ */ t("div", {
|
|
2089
|
+
className: A.body,
|
|
2090
|
+
role: "rowgroup",
|
|
2091
|
+
style: { height: tt },
|
|
2092
|
+
children: Sn
|
|
2093
|
+
}),
|
|
2094
|
+
(bn || oe || !ie && gn === 0) && /* @__PURE__ */ t("div", {
|
|
2095
|
+
className: A.stateArea,
|
|
2096
|
+
style: {
|
|
2097
|
+
top: Qe + et,
|
|
2098
|
+
width: nt.width
|
|
2099
|
+
},
|
|
2100
|
+
children: bn ? /* @__PURE__ */ t("div", {
|
|
2101
|
+
className: A.skeleton,
|
|
2102
|
+
"aria-hidden": "true",
|
|
2103
|
+
children: Array.from({ length: 6 }, (e, n) => /* @__PURE__ */ t("span", { style: { height: L.row } }, n))
|
|
2104
|
+
}) : oe ? /* @__PURE__ */ n("div", {
|
|
2105
|
+
className: A.stateMessage,
|
|
2106
|
+
role: "alert",
|
|
2107
|
+
children: [
|
|
2108
|
+
/* @__PURE__ */ t(x, {
|
|
2109
|
+
name: "xCircle",
|
|
2110
|
+
size: 24
|
|
2111
|
+
}),
|
|
2112
|
+
/* @__PURE__ */ t("p", { children: oe }),
|
|
2113
|
+
se && /* @__PURE__ */ t(D, {
|
|
2114
|
+
size: "sm",
|
|
2115
|
+
icon: "refresh",
|
|
2116
|
+
onClick: se,
|
|
2117
|
+
children: "다시 시도"
|
|
2118
|
+
})
|
|
2119
|
+
]
|
|
2120
|
+
}) : /* @__PURE__ */ n("div", {
|
|
2121
|
+
className: A.stateMessage,
|
|
2122
|
+
children: [
|
|
2123
|
+
/* @__PURE__ */ t(x, {
|
|
2124
|
+
name: J || Be ? "filter" : "file",
|
|
2125
|
+
size: 24
|
|
2126
|
+
}),
|
|
2127
|
+
/* @__PURE__ */ t("p", { children: J || Be ? "조건에 맞는 데이터가 없습니다." : ce }),
|
|
2128
|
+
(J > 0 || Be) && /* @__PURE__ */ t(D, {
|
|
2129
|
+
size: "sm",
|
|
2130
|
+
onClick: () => {
|
|
2131
|
+
He({}), Le("");
|
|
2132
|
+
},
|
|
2133
|
+
children: "검색·필터 해제"
|
|
2134
|
+
})
|
|
2135
|
+
]
|
|
2136
|
+
})
|
|
2137
|
+
}),
|
|
2138
|
+
Je && w === "bottom" && /* @__PURE__ */ t(pt, {
|
|
2139
|
+
renderCols: B,
|
|
2140
|
+
summaryMap: qe,
|
|
2141
|
+
count: gn,
|
|
2142
|
+
bottom: !0,
|
|
2143
|
+
lastLeftName: Et,
|
|
2144
|
+
firstRightName: Dt
|
|
2145
|
+
})
|
|
2146
|
+
]
|
|
2147
|
+
})
|
|
2148
|
+
}),
|
|
2149
|
+
/* @__PURE__ */ n("div", {
|
|
2150
|
+
className: A.statusBar,
|
|
2151
|
+
children: [
|
|
2152
|
+
/* @__PURE__ */ n("span", { children: [
|
|
2153
|
+
"전체 ",
|
|
2154
|
+
/* @__PURE__ */ t("strong", { children: i.length.toLocaleString("ko-KR") }),
|
|
2155
|
+
"건",
|
|
2156
|
+
gn !== i.length && /* @__PURE__ */ n(e, { children: [
|
|
2157
|
+
" ",
|
|
2158
|
+
"· 조회 결과 ",
|
|
2159
|
+
/* @__PURE__ */ t("strong", { children: gn.toLocaleString("ko-KR") }),
|
|
2160
|
+
"건"
|
|
2161
|
+
] })
|
|
2162
|
+
] }),
|
|
2163
|
+
fn && /* @__PURE__ */ n("span", {
|
|
2164
|
+
className: A.rangeStats,
|
|
2165
|
+
children: [
|
|
2166
|
+
"선택 ",
|
|
2167
|
+
/* @__PURE__ */ t("strong", { children: fn.cells.toLocaleString("ko-KR") }),
|
|
2168
|
+
"칸",
|
|
2169
|
+
fn.numbers > 0 && /* @__PURE__ */ n(e, { children: [
|
|
2170
|
+
" ",
|
|
2171
|
+
"· 숫자 ",
|
|
2172
|
+
/* @__PURE__ */ t("strong", { children: fn.numbers.toLocaleString("ko-KR") }),
|
|
2173
|
+
"개 · 합계 ",
|
|
2174
|
+
/* @__PURE__ */ t("strong", { children: _t(fn.sum) }),
|
|
2175
|
+
" · 평균",
|
|
2176
|
+
" ",
|
|
2177
|
+
/* @__PURE__ */ t("strong", { children: _t(fn.avg) })
|
|
2178
|
+
] }),
|
|
2179
|
+
fn.skipped && " (범위가 커서 합계는 생략)"
|
|
2180
|
+
]
|
|
2181
|
+
}),
|
|
2182
|
+
ie && /* @__PURE__ */ t(C, {
|
|
2183
|
+
size: 14,
|
|
2184
|
+
label: "불러오는 중"
|
|
2185
|
+
}),
|
|
2186
|
+
/* @__PURE__ */ t("span", {
|
|
2187
|
+
className: A.notice,
|
|
2188
|
+
"aria-live": "polite",
|
|
2189
|
+
children: Kt
|
|
2190
|
+
})
|
|
2191
|
+
]
|
|
2192
|
+
}),
|
|
2193
|
+
_ === "multiple" && vn > 0 && /* @__PURE__ */ n("div", {
|
|
2194
|
+
className: A.bulkBar,
|
|
2195
|
+
role: "region",
|
|
2196
|
+
"aria-label": "선택한 행 작업",
|
|
2197
|
+
children: [
|
|
2198
|
+
/* @__PURE__ */ n("span", {
|
|
2199
|
+
className: A.bulkCount,
|
|
2200
|
+
children: [/* @__PURE__ */ t("strong", { children: vn.toLocaleString("ko-KR") }), "건 선택"]
|
|
2201
|
+
}),
|
|
2202
|
+
ne?.(G()),
|
|
2203
|
+
/* @__PURE__ */ t(D, {
|
|
2204
|
+
size: "sm",
|
|
2205
|
+
variant: "ghost",
|
|
2206
|
+
onClick: Ft,
|
|
2207
|
+
children: "선택 해제"
|
|
2208
|
+
})
|
|
2209
|
+
]
|
|
2210
|
+
}),
|
|
2211
|
+
Lt && /* @__PURE__ */ t(Ge, {
|
|
2212
|
+
column: Lt.column,
|
|
2213
|
+
rows: i,
|
|
2214
|
+
filter: Ve[Lt.column.name],
|
|
2215
|
+
position: Lt.position,
|
|
2216
|
+
onApply: (e) => Vt(Lt.column.name, e),
|
|
2217
|
+
onClose: Bt
|
|
2218
|
+
}),
|
|
2219
|
+
mn && /* @__PURE__ */ t(ae, {
|
|
2220
|
+
columns: P.all.filter((e) => !e.internal),
|
|
2221
|
+
density: Oe.density,
|
|
2222
|
+
onChange: ke,
|
|
2223
|
+
onReset: () => {
|
|
2224
|
+
Ae(), He({});
|
|
2225
|
+
},
|
|
2226
|
+
onClose: () => hn(!1)
|
|
2227
|
+
})
|
|
2228
|
+
]
|
|
2229
|
+
});
|
|
2230
|
+
}
|
|
2231
|
+
function dt(e) {
|
|
2232
|
+
if (e?.pin === "left") return { left: e.stickyLeft };
|
|
2233
|
+
if (e?.pin === "right") return { right: e.stickyRight };
|
|
2234
|
+
}
|
|
2235
|
+
function ft({ cell: e, sortState: r, sortOrder: i, filterActive: a, edge: o, selectAll: s, onSort: c, onFilter: l, onResize: u, onAutoSize: d }) {
|
|
2236
|
+
let f = e.column, p = r ? r.dir === "asc" ? "ascending" : "descending" : void 0;
|
|
2237
|
+
function m(e) {
|
|
2238
|
+
e.preventDefault(), e.stopPropagation();
|
|
2239
|
+
let t = e.clientX, n = f.width, r = e.currentTarget;
|
|
2240
|
+
r.setPointerCapture(e.pointerId);
|
|
2241
|
+
let i = (e) => u(f.name, Math.max(f.minWidth, n + e.clientX - t)), a = () => {
|
|
2242
|
+
r.removeEventListener("pointermove", i), r.removeEventListener("pointerup", a);
|
|
2243
|
+
};
|
|
2244
|
+
r.addEventListener("pointermove", i), r.addEventListener("pointerup", a);
|
|
2245
|
+
}
|
|
2246
|
+
return /* @__PURE__ */ n("div", {
|
|
2247
|
+
role: e.isLeaf ? "columnheader" : "presentation",
|
|
2248
|
+
"aria-sort": p,
|
|
2249
|
+
className: g(A.headerCell, !e.isLeaf && A.groupCell, e.pin && A.pinned, o === "left" && A.edgeLeft, o === "right" && A.edgeRight, f && A[`align-${f.align}`], r && A.sorted),
|
|
2250
|
+
style: {
|
|
2251
|
+
gridColumn: e.gridColumn,
|
|
2252
|
+
gridRow: e.gridRow,
|
|
2253
|
+
...e.pin === "left" ? { left: e.stickyLeft } : e.pin === "right" ? { right: e.stickyRight } : null
|
|
2254
|
+
},
|
|
2255
|
+
children: [
|
|
2256
|
+
s ?? (e.isLeaf && f.sortable ? /* @__PURE__ */ n("button", {
|
|
2257
|
+
type: "button",
|
|
2258
|
+
className: A.headerLabel,
|
|
2259
|
+
onClick: (e) => c(f.name, e.shiftKey),
|
|
2260
|
+
title: "클릭: 정렬 · Shift+클릭: 여러 열로 정렬",
|
|
2261
|
+
children: [/* @__PURE__ */ t("span", {
|
|
2262
|
+
className: A.labelText,
|
|
2263
|
+
children: e.label
|
|
2264
|
+
}), /* @__PURE__ */ n("span", {
|
|
2265
|
+
className: A.sortIcon,
|
|
2266
|
+
"aria-hidden": "true",
|
|
2267
|
+
children: [/* @__PURE__ */ t(x, {
|
|
2268
|
+
name: r?.dir === "desc" ? "arrowDown" : "arrowUp",
|
|
2269
|
+
size: 13
|
|
2270
|
+
}), i > 0 && r && /* @__PURE__ */ t("span", {
|
|
2271
|
+
className: A.sortOrder,
|
|
2272
|
+
children: i
|
|
2273
|
+
})]
|
|
2274
|
+
})]
|
|
2275
|
+
}) : /* @__PURE__ */ t("span", {
|
|
2276
|
+
className: g(A.headerLabel, A.static),
|
|
2277
|
+
children: /* @__PURE__ */ t("span", {
|
|
2278
|
+
className: A.labelText,
|
|
2279
|
+
children: e.label
|
|
2280
|
+
})
|
|
2281
|
+
})),
|
|
2282
|
+
e.isLeaf && f.filterable && !f.internal && /* @__PURE__ */ t("button", {
|
|
2283
|
+
type: "button",
|
|
2284
|
+
className: g(A.filterButton, a && A.filterActive),
|
|
2285
|
+
"aria-label": `${e.label} 필터${a ? " (적용 중)" : ""}`,
|
|
2286
|
+
onClick: (e) => l(f, e.currentTarget.closest("[role=\"columnheader\"]")),
|
|
2287
|
+
children: /* @__PURE__ */ t(x, {
|
|
2288
|
+
name: "filter",
|
|
2289
|
+
size: 13
|
|
2290
|
+
})
|
|
2291
|
+
}),
|
|
2292
|
+
e.isLeaf && f.resizable && /* @__PURE__ */ t("span", {
|
|
2293
|
+
className: A.resizeHandle,
|
|
2294
|
+
onPointerDown: m,
|
|
2295
|
+
onDoubleClick: () => d(f),
|
|
2296
|
+
"aria-hidden": "true"
|
|
2297
|
+
})
|
|
2298
|
+
]
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
function pt({ renderCols: r, summaryMap: i, count: a, top: o, bottom: s, lastLeftName: c, firstRightName: l }) {
|
|
2302
|
+
let u = r.find((e) => e.kind === "col" && !e.column.internal && !i.has(e.column.name))?.column.name;
|
|
2303
|
+
return /* @__PURE__ */ t("div", {
|
|
2304
|
+
className: g(A.summaryRow, s && A.summaryBottom),
|
|
2305
|
+
role: "row",
|
|
2306
|
+
style: s ? void 0 : { top: o },
|
|
2307
|
+
children: r.map((r) => {
|
|
2308
|
+
if (r.kind === "spacer") return /* @__PURE__ */ t("div", {
|
|
2309
|
+
className: A.spacer,
|
|
2310
|
+
"aria-hidden": "true"
|
|
2311
|
+
}, r.key);
|
|
2312
|
+
let o = r.column, s = i.get(o.name), d = null;
|
|
2313
|
+
return i.has(o.name) ? d = typeof s == "number" ? M(s, o.type === "int" || o.type === "float" ? o : {
|
|
2314
|
+
...o,
|
|
2315
|
+
type: "int",
|
|
2316
|
+
numberPattern: {
|
|
2317
|
+
grouping: !0,
|
|
2318
|
+
digits: 0
|
|
2319
|
+
}
|
|
2320
|
+
}) : s : o.name === u && (d = /* @__PURE__ */ n(e, { children: ["합계 ", /* @__PURE__ */ n("span", {
|
|
2321
|
+
className: A.summaryCount,
|
|
2322
|
+
children: [a.toLocaleString("ko-KR"), "건"]
|
|
2323
|
+
})] })), /* @__PURE__ */ t("div", {
|
|
2324
|
+
role: "gridcell",
|
|
2325
|
+
className: g(A.cell, A[`align-${i.has(o.name) ? "right" : "left"}`], o.pin && A.pinned, o.name === c && A.edgeLeft, o.name === l && A.edgeRight),
|
|
2326
|
+
style: dt(o),
|
|
2327
|
+
title: typeof d == "string" ? d : void 0,
|
|
2328
|
+
children: /* @__PURE__ */ t("span", {
|
|
2329
|
+
className: A.cellText,
|
|
2330
|
+
children: d
|
|
2331
|
+
})
|
|
2332
|
+
}, o.name);
|
|
2333
|
+
})
|
|
2334
|
+
});
|
|
2335
|
+
}
|
|
2336
|
+
async function mt(e) {
|
|
2337
|
+
try {
|
|
2338
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
2339
|
+
} catch {
|
|
2340
|
+
let t = document.activeElement, n = document.createElement("textarea");
|
|
2341
|
+
n.value = e, n.setAttribute("readonly", ""), n.style.cssText = "position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;", document.body.appendChild(n), n.select();
|
|
2342
|
+
let r = !1;
|
|
2343
|
+
try {
|
|
2344
|
+
r = document.execCommand("copy");
|
|
2345
|
+
} catch {
|
|
2346
|
+
r = !1;
|
|
2347
|
+
}
|
|
2348
|
+
return n.remove(), t?.focus?.({ preventScroll: !0 }), r;
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
function ht(e, t) {
|
|
2352
|
+
return {
|
|
2353
|
+
c1: e.c1,
|
|
2354
|
+
c2: e.c2,
|
|
2355
|
+
top: t === e.r1,
|
|
2356
|
+
bottom: t === e.r2
|
|
2357
|
+
};
|
|
2358
|
+
}
|
|
2359
|
+
var gt = new Intl.NumberFormat("ko-KR", { maximumFractionDigits: 2 });
|
|
2360
|
+
function _t(e) {
|
|
2361
|
+
return gt.format(e);
|
|
2362
|
+
}
|
|
2363
|
+
var vt = i(function({ gridId: e, row: n, viewIndex: r, top: i, height: a, renderCols: o, selected: s, activeCol: c, rangeInfo: l, colIndexOf: u, tone: d, searchTerm: f, lastLeftName: p, firstRightName: m, onCellPointerDown: h, onCheckboxClick: _, onDoubleClick: v, onCellAction: y }) {
|
|
2364
|
+
return /* @__PURE__ */ t("div", {
|
|
2365
|
+
className: g(A.row, s && A.selected, d && A[`rowTone-${d}`]),
|
|
2366
|
+
role: "row",
|
|
2367
|
+
"aria-rowindex": r + 2,
|
|
2368
|
+
"aria-selected": s || void 0,
|
|
2369
|
+
style: {
|
|
2370
|
+
transform: `translateY(${i}px)`,
|
|
2371
|
+
height: a
|
|
2372
|
+
},
|
|
2373
|
+
onDoubleClick: () => v(r),
|
|
2374
|
+
children: o.map((i) => {
|
|
2375
|
+
if (i.kind === "spacer") return /* @__PURE__ */ t("div", {
|
|
2376
|
+
className: A.spacer,
|
|
2377
|
+
"aria-hidden": "true"
|
|
2378
|
+
}, i.key);
|
|
2379
|
+
let a = i.column, o = c === a.name, d, v = -1, b = null, x, S;
|
|
2380
|
+
if (a.name === ot) d = /* @__PURE__ */ t(te, {
|
|
2381
|
+
"aria-label": `${r + 1}번째 행 선택`,
|
|
2382
|
+
checked: s,
|
|
2383
|
+
onChange: () => {},
|
|
2384
|
+
onClick: (e) => _(e, r),
|
|
2385
|
+
tabIndex: -1
|
|
2386
|
+
});
|
|
2387
|
+
else {
|
|
2388
|
+
v = u.get(a.name);
|
|
2389
|
+
let e = F(n, a), t = M(e, a);
|
|
2390
|
+
d = Je({
|
|
2391
|
+
column: a,
|
|
2392
|
+
row: n,
|
|
2393
|
+
value: e,
|
|
2394
|
+
text: t,
|
|
2395
|
+
searchTerm: f,
|
|
2396
|
+
onCellAction: y
|
|
2397
|
+
}), b = Ke(a.cellTone, e, n), !b && a.negative === "danger" && typeof e == "number" && e < 0 && (b = "danger"), x = typeof a.cellClassName == "function" ? a.cellClassName(e, n) : a.cellClassName, !a.kind && !a.render && a.tooltip !== !1 && t && (S = t);
|
|
2398
|
+
}
|
|
2399
|
+
let C = l && v >= l.c1 && v <= l.c2;
|
|
2400
|
+
return /* @__PURE__ */ t("div", {
|
|
2401
|
+
id: `${e}-r${r}-${a.name}`,
|
|
2402
|
+
role: "gridcell",
|
|
2403
|
+
"aria-selected": o || void 0,
|
|
2404
|
+
className: g(A.cell, A[`align-${a.align}`], a.pin && A.pinned, a.name === p && A.edgeLeft, a.name === m && A.edgeRight, o && A.activeCell, b && A[`text-${b}`], C && A.inRange, C && l.top && A.rangeTop, C && l.bottom && A.rangeBottom, C && v === l.c1 && A.rangeLeft, C && v === l.c2 && A.rangeRight, x),
|
|
2405
|
+
style: dt(a),
|
|
2406
|
+
title: S,
|
|
2407
|
+
"data-cell": v >= 0 ? "" : void 0,
|
|
2408
|
+
"data-row": r,
|
|
2409
|
+
"data-col": v >= 0 ? v : void 0,
|
|
2410
|
+
onPointerDown: (e) => h(e, r, a.name),
|
|
2411
|
+
children: d
|
|
2412
|
+
}, a.name);
|
|
2413
|
+
})
|
|
2414
|
+
});
|
|
2415
|
+
}), yt = {
|
|
181
2416
|
field: "bw-field-m7I4B",
|
|
182
2417
|
label: "bw-label-LAQio",
|
|
183
2418
|
required: "bw-required-8HCWC",
|
|
@@ -185,57 +2420,210 @@ var y = {
|
|
|
185
2420
|
error: "bw-error-m0uol"
|
|
186
2421
|
};
|
|
187
2422
|
// src/components/Field/Field.jsx
|
|
188
|
-
function
|
|
189
|
-
let
|
|
190
|
-
id:
|
|
191
|
-
"aria-invalid":
|
|
192
|
-
"aria-describedby":
|
|
193
|
-
"aria-required":
|
|
2423
|
+
function R({ id: e, label: r, required: i = !1, helperText: a, error: o, className: s, children: c }) {
|
|
2424
|
+
let u = l(), d = e ?? u, f = `${d}-message`, p = o || a, m = {
|
|
2425
|
+
id: d,
|
|
2426
|
+
"aria-invalid": o ? !0 : void 0,
|
|
2427
|
+
"aria-describedby": p ? f : void 0,
|
|
2428
|
+
"aria-required": i || void 0
|
|
194
2429
|
};
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
className:
|
|
2430
|
+
return /* @__PURE__ */ n("div", {
|
|
2431
|
+
className: g(yt.field, s),
|
|
197
2432
|
children: [
|
|
198
|
-
r && /* @__PURE__ */
|
|
199
|
-
htmlFor:
|
|
200
|
-
className:
|
|
201
|
-
children: [r,
|
|
202
|
-
className:
|
|
2433
|
+
r && /* @__PURE__ */ n("label", {
|
|
2434
|
+
htmlFor: d,
|
|
2435
|
+
className: yt.label,
|
|
2436
|
+
children: [r, i && /* @__PURE__ */ t("span", {
|
|
2437
|
+
className: yt.required,
|
|
203
2438
|
"aria-hidden": "true",
|
|
204
2439
|
children: "*"
|
|
205
2440
|
})]
|
|
206
2441
|
}),
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
id:
|
|
210
|
-
className:
|
|
211
|
-
children:
|
|
2442
|
+
c(m),
|
|
2443
|
+
p && /* @__PURE__ */ t("p", {
|
|
2444
|
+
id: f,
|
|
2445
|
+
className: g(yt.message, o && yt.error),
|
|
2446
|
+
children: p
|
|
212
2447
|
})
|
|
213
2448
|
]
|
|
214
2449
|
});
|
|
215
2450
|
}
|
|
216
|
-
var
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
2451
|
+
var z = {
|
|
2452
|
+
root: "bw-root-Hh-vp",
|
|
2453
|
+
trigger: "bw-trigger-czBaL",
|
|
2454
|
+
content: "bw-content-C-DvA",
|
|
2455
|
+
"menu-in": "bw-menu-in--hB0F",
|
|
2456
|
+
"align-start": "bw-align-start-dvSyv",
|
|
2457
|
+
"align-end": "bw-align-end-5HrVR",
|
|
2458
|
+
item: "bw-item-NMXha",
|
|
2459
|
+
itemIcon: "bw-itemIcon-28gCA",
|
|
2460
|
+
itemLabel: "bw-itemLabel-zvcqC",
|
|
2461
|
+
check: "bw-check-a-DSA",
|
|
2462
|
+
danger: "bw-danger--VLkc",
|
|
2463
|
+
header: "bw-header-QypVp",
|
|
2464
|
+
label: "bw-label-4FBGa",
|
|
2465
|
+
separator: "bw-separator-uH6aK"
|
|
2466
|
+
}, bt = r(null), xt = r(null);
|
|
2467
|
+
function St() {
|
|
2468
|
+
let e = a(bt);
|
|
2469
|
+
if (!e) throw Error("Menu 조각은 <Menu> 안에서만 쓸 수 있습니다.");
|
|
2470
|
+
return e;
|
|
2471
|
+
}
|
|
2472
|
+
function Ct(e) {
|
|
2473
|
+
return e ? [...e.querySelectorAll("[data-menu-item]:not([disabled])")] : [];
|
|
2474
|
+
}
|
|
2475
|
+
function B({ open: e, defaultOpen: n = !1, onOpenChange: r, className: i, children: a }) {
|
|
2476
|
+
let [s, u] = m(n), d = e ?? s, f = p(null), h = p(null), _ = p("first"), v = l(), y = o((t, { focus: n = "first", returnFocus: i = !1 } = {}) => {
|
|
2477
|
+
_.current = n, e === void 0 && u(t), r?.(t), !t && i && f.current?.focus();
|
|
2478
|
+
}, [e, r]);
|
|
2479
|
+
c(() => {
|
|
2480
|
+
if (!d) return;
|
|
2481
|
+
let e = (e) => {
|
|
2482
|
+
h.current?.contains(e.target) || f.current?.contains(e.target) || y(!1);
|
|
2483
|
+
};
|
|
2484
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
2485
|
+
}, [d, y]), c(() => {
|
|
2486
|
+
if (!d) return;
|
|
2487
|
+
let e = Ct(h.current);
|
|
2488
|
+
(_.current === "last" ? e.at(-1) : e[0])?.focus();
|
|
2489
|
+
}, [d]);
|
|
2490
|
+
let b = {
|
|
2491
|
+
open: d,
|
|
2492
|
+
setOpen: y,
|
|
2493
|
+
triggerRef: f,
|
|
2494
|
+
contentRef: h,
|
|
2495
|
+
contentId: `${v}-menu`,
|
|
2496
|
+
triggerId: `${v}-trigger`
|
|
2497
|
+
};
|
|
2498
|
+
return /* @__PURE__ */ t(bt, {
|
|
2499
|
+
value: b,
|
|
2500
|
+
children: /* @__PURE__ */ t("div", {
|
|
2501
|
+
className: g(z.root, i),
|
|
2502
|
+
children: a
|
|
2503
|
+
})
|
|
2504
|
+
});
|
|
2505
|
+
}
|
|
2506
|
+
function wt({ className: e, children: n, onClick: r, onKeyDown: i, ...a }) {
|
|
2507
|
+
let { open: o, setOpen: s, triggerRef: c, contentId: l, triggerId: u } = St();
|
|
2508
|
+
return /* @__PURE__ */ t("button", {
|
|
226
2509
|
ref: c,
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
2510
|
+
id: u,
|
|
2511
|
+
type: "button",
|
|
2512
|
+
className: g(z.trigger, e),
|
|
2513
|
+
"aria-haspopup": "menu",
|
|
2514
|
+
"aria-expanded": o,
|
|
2515
|
+
"aria-controls": o ? l : void 0,
|
|
2516
|
+
onClick: (e) => {
|
|
2517
|
+
r?.(e), s(!o);
|
|
2518
|
+
},
|
|
2519
|
+
onKeyDown: (e) => {
|
|
2520
|
+
i?.(e), (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), s(!0, { focus: e.key === "ArrowUp" ? "last" : "first" }));
|
|
2521
|
+
},
|
|
2522
|
+
...a,
|
|
2523
|
+
children: n
|
|
2524
|
+
});
|
|
2525
|
+
}
|
|
2526
|
+
function Tt({ align: e = "start", width: n = 240, className: r, children: i }) {
|
|
2527
|
+
let { open: a, setOpen: o, contentRef: s, contentId: c, triggerId: l } = St();
|
|
2528
|
+
if (!a) return null;
|
|
2529
|
+
function u(e) {
|
|
2530
|
+
let t = Ct(s.current), n = t.indexOf(document.activeElement), r = (e) => t[(e + t.length) % t.length]?.focus();
|
|
2531
|
+
e.key === "ArrowDown" ? (e.preventDefault(), r(n + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), r(n - 1)) : e.key === "Home" ? (e.preventDefault(), r(0)) : e.key === "End" ? (e.preventDefault(), r(t.length - 1)) : e.key === "Escape" ? (e.preventDefault(), o(!1, { returnFocus: !0 })) : e.key === "Tab" && o(!1);
|
|
2532
|
+
}
|
|
2533
|
+
return /* @__PURE__ */ t("div", {
|
|
2534
|
+
ref: s,
|
|
2535
|
+
id: c,
|
|
2536
|
+
role: "menu",
|
|
2537
|
+
"aria-labelledby": l,
|
|
2538
|
+
className: g(z.content, z[`align-${e}`], r),
|
|
2539
|
+
style: { width: n },
|
|
2540
|
+
onKeyDown: u,
|
|
2541
|
+
children: i
|
|
2542
|
+
});
|
|
2543
|
+
}
|
|
2544
|
+
function Et({ icon: e, tone: r = "default", onSelect: i, disabled: a, className: o, children: s, ...c }) {
|
|
2545
|
+
let { setOpen: l } = St();
|
|
2546
|
+
return /* @__PURE__ */ n("button", {
|
|
2547
|
+
type: "button",
|
|
2548
|
+
role: "menuitem",
|
|
2549
|
+
tabIndex: -1,
|
|
2550
|
+
"data-menu-item": "",
|
|
2551
|
+
disabled: a,
|
|
2552
|
+
className: g(z.item, r === "danger" && z.danger, o),
|
|
2553
|
+
onClick: () => {
|
|
2554
|
+
i?.(), l(!1, { returnFocus: !0 });
|
|
2555
|
+
},
|
|
2556
|
+
...c,
|
|
2557
|
+
children: [e ? /* @__PURE__ */ t(x, {
|
|
2558
|
+
name: e,
|
|
2559
|
+
size: 16,
|
|
2560
|
+
className: z.itemIcon
|
|
2561
|
+
}) : null, /* @__PURE__ */ t("span", {
|
|
2562
|
+
className: z.itemLabel,
|
|
2563
|
+
children: s
|
|
2564
|
+
})]
|
|
2565
|
+
});
|
|
2566
|
+
}
|
|
2567
|
+
function Dt({ value: e, onValueChange: n, children: r }) {
|
|
2568
|
+
return /* @__PURE__ */ t(xt, {
|
|
2569
|
+
value: {
|
|
2570
|
+
value: e,
|
|
2571
|
+
onValueChange: n
|
|
2572
|
+
},
|
|
2573
|
+
children: /* @__PURE__ */ t("div", {
|
|
2574
|
+
role: "group",
|
|
2575
|
+
children: r
|
|
235
2576
|
})
|
|
236
2577
|
});
|
|
237
2578
|
}
|
|
238
|
-
|
|
2579
|
+
function Ot({ value: e, icon: r, className: i, children: o }) {
|
|
2580
|
+
let s = a(xt), c = s?.value === e;
|
|
2581
|
+
return /* @__PURE__ */ n("button", {
|
|
2582
|
+
type: "button",
|
|
2583
|
+
role: "menuitemradio",
|
|
2584
|
+
"aria-checked": c,
|
|
2585
|
+
tabIndex: -1,
|
|
2586
|
+
"data-menu-item": "",
|
|
2587
|
+
className: g(z.item, i),
|
|
2588
|
+
onClick: () => s?.onValueChange?.(e),
|
|
2589
|
+
children: [
|
|
2590
|
+
r ? /* @__PURE__ */ t(x, {
|
|
2591
|
+
name: r,
|
|
2592
|
+
size: 16,
|
|
2593
|
+
className: z.itemIcon
|
|
2594
|
+
}) : null,
|
|
2595
|
+
/* @__PURE__ */ t("span", {
|
|
2596
|
+
className: z.itemLabel,
|
|
2597
|
+
children: o
|
|
2598
|
+
}),
|
|
2599
|
+
c ? /* @__PURE__ */ t(x, {
|
|
2600
|
+
name: "check",
|
|
2601
|
+
size: 16,
|
|
2602
|
+
className: z.check
|
|
2603
|
+
}) : null
|
|
2604
|
+
]
|
|
2605
|
+
});
|
|
2606
|
+
}
|
|
2607
|
+
function kt({ className: e, children: n }) {
|
|
2608
|
+
return /* @__PURE__ */ t("div", {
|
|
2609
|
+
className: g(z.header, e),
|
|
2610
|
+
children: n
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
function V({ children: e }) {
|
|
2614
|
+
return /* @__PURE__ */ t("div", {
|
|
2615
|
+
className: z.label,
|
|
2616
|
+
children: e
|
|
2617
|
+
});
|
|
2618
|
+
}
|
|
2619
|
+
function At() {
|
|
2620
|
+
return /* @__PURE__ */ t("div", {
|
|
2621
|
+
role: "separator",
|
|
2622
|
+
className: z.separator
|
|
2623
|
+
});
|
|
2624
|
+
}
|
|
2625
|
+
B.Trigger = wt, B.Content = Tt, B.Item = Et, B.RadioGroup = Dt, B.RadioItem = Ot, B.Header = kt, B.Label = V, B.Separator = At;
|
|
2626
|
+
var H = {
|
|
239
2627
|
group: "bw-group-oi329",
|
|
240
2628
|
legend: "bw-legend-Touvj",
|
|
241
2629
|
options: "bw-options-ciXxq",
|
|
@@ -246,65 +2634,439 @@ var C = {
|
|
|
246
2634
|
circle: "bw-circle-6v2W0",
|
|
247
2635
|
disabled: "bw-disabled-0-cna",
|
|
248
2636
|
error: "bw-error-wem7t"
|
|
249
|
-
},
|
|
250
|
-
function
|
|
251
|
-
let
|
|
252
|
-
return /* @__PURE__ */
|
|
253
|
-
className:
|
|
254
|
-
disabled:
|
|
255
|
-
"aria-invalid":
|
|
256
|
-
"aria-describedby":
|
|
2637
|
+
}, jt = r(null);
|
|
2638
|
+
function U({ label: e, name: r, value: i, onChange: a, direction: o = "horizontal", disabled: s = !1, error: c, className: u, children: d }) {
|
|
2639
|
+
let f = l(), p = `${f}-error`;
|
|
2640
|
+
return /* @__PURE__ */ n("fieldset", {
|
|
2641
|
+
className: g(H.group, u),
|
|
2642
|
+
disabled: s,
|
|
2643
|
+
"aria-invalid": c ? !0 : void 0,
|
|
2644
|
+
"aria-describedby": c ? p : void 0,
|
|
257
2645
|
children: [
|
|
258
|
-
|
|
259
|
-
className:
|
|
260
|
-
children:
|
|
2646
|
+
e && /* @__PURE__ */ t("legend", {
|
|
2647
|
+
className: H.legend,
|
|
2648
|
+
children: e
|
|
261
2649
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
className:
|
|
264
|
-
children: /* @__PURE__ */
|
|
2650
|
+
/* @__PURE__ */ t("div", {
|
|
2651
|
+
className: g(H.options, H[o]),
|
|
2652
|
+
children: /* @__PURE__ */ t(jt, {
|
|
265
2653
|
value: {
|
|
266
|
-
name: r ??
|
|
267
|
-
value:
|
|
268
|
-
onChange:
|
|
2654
|
+
name: r ?? f,
|
|
2655
|
+
value: i,
|
|
2656
|
+
onChange: a
|
|
269
2657
|
},
|
|
270
|
-
children:
|
|
2658
|
+
children: d
|
|
271
2659
|
})
|
|
272
2660
|
}),
|
|
273
|
-
|
|
274
|
-
id:
|
|
275
|
-
className:
|
|
276
|
-
children:
|
|
2661
|
+
c && /* @__PURE__ */ t("p", {
|
|
2662
|
+
id: p,
|
|
2663
|
+
className: H.error,
|
|
2664
|
+
children: c
|
|
277
2665
|
})
|
|
278
2666
|
]
|
|
279
2667
|
});
|
|
280
2668
|
}
|
|
281
|
-
function
|
|
282
|
-
let
|
|
283
|
-
if (!
|
|
284
|
-
return /* @__PURE__ */
|
|
285
|
-
className:
|
|
2669
|
+
function Mt({ value: e, disabled: r, className: i, children: o }) {
|
|
2670
|
+
let s = a(jt);
|
|
2671
|
+
if (!s) throw Error("Radio는 RadioGroup 안에서만 사용할 수 있습니다.");
|
|
2672
|
+
return /* @__PURE__ */ n("label", {
|
|
2673
|
+
className: g(H.radio, r && H.disabled, i),
|
|
286
2674
|
children: [
|
|
287
|
-
/* @__PURE__ */
|
|
2675
|
+
/* @__PURE__ */ t("input", {
|
|
288
2676
|
type: "radio",
|
|
289
|
-
className:
|
|
290
|
-
name:
|
|
291
|
-
value:
|
|
292
|
-
checked:
|
|
293
|
-
disabled:
|
|
294
|
-
onChange: () =>
|
|
2677
|
+
className: H.input,
|
|
2678
|
+
name: s.name,
|
|
2679
|
+
value: e,
|
|
2680
|
+
checked: s.value === e,
|
|
2681
|
+
disabled: r,
|
|
2682
|
+
onChange: () => s.onChange?.(e)
|
|
295
2683
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
className:
|
|
2684
|
+
/* @__PURE__ */ t("span", {
|
|
2685
|
+
className: H.circle,
|
|
298
2686
|
"aria-hidden": "true"
|
|
299
2687
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
className:
|
|
302
|
-
children:
|
|
2688
|
+
/* @__PURE__ */ t("span", {
|
|
2689
|
+
className: H.label,
|
|
2690
|
+
children: o
|
|
303
2691
|
})
|
|
304
2692
|
]
|
|
305
2693
|
});
|
|
306
2694
|
}
|
|
307
|
-
var
|
|
2695
|
+
var W = {
|
|
2696
|
+
nav: "bw-nav-ey3xr",
|
|
2697
|
+
list: "bw-list--1rYz",
|
|
2698
|
+
nested: "bw-nested-nz9eL",
|
|
2699
|
+
item: "bw-item-89jVZ",
|
|
2700
|
+
active: "bw-active-GTHlO",
|
|
2701
|
+
onPath: "bw-onPath-MYAtY",
|
|
2702
|
+
icon: "bw-icon-BDBiJ",
|
|
2703
|
+
label: "bw-label-e2nl7",
|
|
2704
|
+
badge: "bw-badge-ocFZh",
|
|
2705
|
+
chevron: "bw-chevron-OZCAj",
|
|
2706
|
+
chevronOpen: "bw-chevronOpen-Tuemn",
|
|
2707
|
+
search: "bw-search-05Ltf",
|
|
2708
|
+
searchIcon: "bw-searchIcon-NY4zR",
|
|
2709
|
+
searchInput: "bw-searchInput-VPgvD",
|
|
2710
|
+
results: "bw-results-m1Ef8",
|
|
2711
|
+
result: "bw-result-EzB7n",
|
|
2712
|
+
resultPath: "bw-resultPath-CFEiI",
|
|
2713
|
+
resultLabel: "bw-resultLabel-r-Y1u",
|
|
2714
|
+
mark: "bw-mark-Ild9F",
|
|
2715
|
+
empty: "bw-empty-s9VHh",
|
|
2716
|
+
rail: "bw-rail-QPg-3",
|
|
2717
|
+
railItem: "bw-railItem-oyJj6",
|
|
2718
|
+
railOpen: "bw-railOpen-antnx",
|
|
2719
|
+
railActive: "bw-railActive-QSSdd",
|
|
2720
|
+
railLetter: "bw-railLetter-M-vII",
|
|
2721
|
+
railDot: "bw-railDot-dReaX",
|
|
2722
|
+
flyout: "bw-flyout-7UHfq",
|
|
2723
|
+
"flyout-in": "bw-flyout-in-Qzxjk",
|
|
2724
|
+
flyoutTitle: "bw-flyoutTitle-zORFM"
|
|
2725
|
+
};
|
|
2726
|
+
// src/components/SideNav/SideNav.jsx
|
|
2727
|
+
function G(e, t, n = []) {
|
|
2728
|
+
for (let r of e) {
|
|
2729
|
+
if (r.id === t) return n;
|
|
2730
|
+
if (r.children) {
|
|
2731
|
+
let e = G(r.children, t, [...n, r.id]);
|
|
2732
|
+
if (e) return e;
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
return null;
|
|
2736
|
+
}
|
|
2737
|
+
var K = (e) => String(e).toLowerCase().replace(/\s+/g, "");
|
|
2738
|
+
function q(e, t, n = 50) {
|
|
2739
|
+
let r = K(t);
|
|
2740
|
+
if (!r) return [];
|
|
2741
|
+
let i = [], a = [], o = (e, t, n) => {
|
|
2742
|
+
for (let s of e) {
|
|
2743
|
+
let e = K(s.label).includes(r);
|
|
2744
|
+
s.children?.length ? o(s.children, [...t, s.label], n || e) : e ? i.push({
|
|
2745
|
+
item: s,
|
|
2746
|
+
path: t
|
|
2747
|
+
}) : n && a.push({
|
|
2748
|
+
item: s,
|
|
2749
|
+
path: t
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2752
|
+
};
|
|
2753
|
+
return o(e, [], !1), [...i, ...a].slice(0, n);
|
|
2754
|
+
}
|
|
2755
|
+
function Nt(r, i) {
|
|
2756
|
+
let a = i.trim().toLowerCase(), o = a ? r.toLowerCase().indexOf(a) : -1;
|
|
2757
|
+
return o < 0 ? r : /* @__PURE__ */ n(e, { children: [
|
|
2758
|
+
r.slice(0, o),
|
|
2759
|
+
/* @__PURE__ */ t("mark", {
|
|
2760
|
+
className: W.mark,
|
|
2761
|
+
children: r.slice(o, o + a.length)
|
|
2762
|
+
}),
|
|
2763
|
+
r.slice(o + a.length)
|
|
2764
|
+
] });
|
|
2765
|
+
}
|
|
2766
|
+
function Pt(e, t, n, r) {
|
|
2767
|
+
e.external || t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || t.button !== 0 || (n?.(e, t), r?.());
|
|
2768
|
+
}
|
|
2769
|
+
function Ft({ items: e, activeId: r, onNavigate: i, defaultExpandedIds: a, collapsed: o = !1, searchable: s = !1, searchPlaceholder: l = "메뉴 검색", className: u, "aria-label": d = "주 메뉴" }) {
|
|
2770
|
+
let h = f(() => new Set(G(e, r) ?? []), [e, r]), [_, v] = m(() => new Set(a ?? [])), [y, b] = m(() => /* @__PURE__ */ new Set()), [x, S] = m(r);
|
|
2771
|
+
x !== r && (S(r), y.size && b(/* @__PURE__ */ new Set()));
|
|
2772
|
+
let C = (e) => !y.has(e) && (_.has(e) || h.has(e)), w = (e, t) => {
|
|
2773
|
+
let n = t ?? !C(e);
|
|
2774
|
+
v((t) => {
|
|
2775
|
+
let r = new Set(t);
|
|
2776
|
+
return n ? r.add(e) : r.delete(e), r;
|
|
2777
|
+
}), b((t) => {
|
|
2778
|
+
let r = new Set(t);
|
|
2779
|
+
return n ? r.delete(e) : r.add(e), r;
|
|
2780
|
+
});
|
|
2781
|
+
}, [T, E] = m(""), ee = p(null);
|
|
2782
|
+
c(() => {
|
|
2783
|
+
ee.current?.querySelector("[aria-current=\"page\"]")?.scrollIntoView({ block: "nearest" });
|
|
2784
|
+
}, [r]);
|
|
2785
|
+
let D = s && !o && T.trim() !== "", O = {
|
|
2786
|
+
activeId: r,
|
|
2787
|
+
ancestors: h,
|
|
2788
|
+
isOpen: C,
|
|
2789
|
+
toggle: w,
|
|
2790
|
+
onNavigate: i
|
|
2791
|
+
};
|
|
2792
|
+
return /* @__PURE__ */ n("nav", {
|
|
2793
|
+
ref: ee,
|
|
2794
|
+
className: g(W.nav, o && W.collapsed, u),
|
|
2795
|
+
"aria-label": d,
|
|
2796
|
+
children: [s && !o && /* @__PURE__ */ t(It, {
|
|
2797
|
+
query: T,
|
|
2798
|
+
setQuery: E,
|
|
2799
|
+
placeholder: l
|
|
2800
|
+
}), o ? /* @__PURE__ */ t(Vt, {
|
|
2801
|
+
items: e,
|
|
2802
|
+
...O
|
|
2803
|
+
}) : D ? /* @__PURE__ */ t(Lt, {
|
|
2804
|
+
items: e,
|
|
2805
|
+
query: T,
|
|
2806
|
+
activeId: r,
|
|
2807
|
+
onNavigate: i
|
|
2808
|
+
}) : /* @__PURE__ */ t(Rt, {
|
|
2809
|
+
items: e,
|
|
2810
|
+
depth: 0,
|
|
2811
|
+
...O
|
|
2812
|
+
})]
|
|
2813
|
+
});
|
|
2814
|
+
}
|
|
2815
|
+
function It({ query: e, setQuery: r, placeholder: i }) {
|
|
2816
|
+
return /* @__PURE__ */ n("div", {
|
|
2817
|
+
className: W.search,
|
|
2818
|
+
role: "search",
|
|
2819
|
+
children: [/* @__PURE__ */ t(x, {
|
|
2820
|
+
name: "search",
|
|
2821
|
+
size: 16,
|
|
2822
|
+
className: W.searchIcon
|
|
2823
|
+
}), /* @__PURE__ */ t("input", {
|
|
2824
|
+
type: "search",
|
|
2825
|
+
className: W.searchInput,
|
|
2826
|
+
value: e,
|
|
2827
|
+
onChange: (e) => r(e.target.value),
|
|
2828
|
+
placeholder: i,
|
|
2829
|
+
"aria-label": i,
|
|
2830
|
+
onKeyDown: (t) => {
|
|
2831
|
+
if (t.nativeEvent.isComposing || t.keyCode === 229) return;
|
|
2832
|
+
let n = t.currentTarget.closest("nav")?.querySelectorAll("[data-search-result]");
|
|
2833
|
+
t.key === "Enter" && n?.length ? (t.preventDefault(), n[0].click()) : t.key === "ArrowDown" && n?.length ? (t.preventDefault(), n[0].focus()) : t.key === "Escape" && e && (t.preventDefault(), r(""));
|
|
2834
|
+
}
|
|
2835
|
+
})]
|
|
2836
|
+
});
|
|
2837
|
+
}
|
|
2838
|
+
function Lt({ items: e, query: r, activeId: i, onNavigate: a }) {
|
|
2839
|
+
let o = f(() => q(e, r), [e, r]);
|
|
2840
|
+
if (o.length === 0) return /* @__PURE__ */ n("p", {
|
|
2841
|
+
className: W.empty,
|
|
2842
|
+
role: "status",
|
|
2843
|
+
children: [
|
|
2844
|
+
"'",
|
|
2845
|
+
r.trim(),
|
|
2846
|
+
"'에 맞는 메뉴가 없습니다."
|
|
2847
|
+
]
|
|
2848
|
+
});
|
|
2849
|
+
let s = (e, t) => {
|
|
2850
|
+
let n = [...e.currentTarget.closest("ul").querySelectorAll("[data-search-result]")], r = n[n.indexOf(e.currentTarget) + t];
|
|
2851
|
+
e.preventDefault(), r ? r.focus() : t < 0 && e.currentTarget.closest("nav")?.querySelector("input")?.focus();
|
|
2852
|
+
};
|
|
2853
|
+
return /* @__PURE__ */ t("ul", {
|
|
2854
|
+
className: W.results,
|
|
2855
|
+
"aria-label": `검색 결과 ${o.length}개`,
|
|
2856
|
+
children: o.map(({ item: e, path: o }) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("a", {
|
|
2857
|
+
href: e.href ?? "#",
|
|
2858
|
+
"data-search-result": "",
|
|
2859
|
+
className: g(W.result, e.id === i && W.active),
|
|
2860
|
+
"aria-current": e.id === i ? "page" : void 0,
|
|
2861
|
+
target: e.external ? "_blank" : void 0,
|
|
2862
|
+
rel: e.external ? "noopener noreferrer" : void 0,
|
|
2863
|
+
onClick: (t) => Pt(e, t, a),
|
|
2864
|
+
onKeyDown: (e) => {
|
|
2865
|
+
e.key === "ArrowDown" ? s(e, 1) : e.key === "ArrowUp" && s(e, -1);
|
|
2866
|
+
},
|
|
2867
|
+
children: [o.length > 0 && /* @__PURE__ */ t("span", {
|
|
2868
|
+
className: W.resultPath,
|
|
2869
|
+
children: o.join(" › ")
|
|
2870
|
+
}), /* @__PURE__ */ n("span", {
|
|
2871
|
+
className: W.resultLabel,
|
|
2872
|
+
children: [Nt(e.label, r), e.external && /* @__PURE__ */ t(x, {
|
|
2873
|
+
name: "external",
|
|
2874
|
+
size: 13,
|
|
2875
|
+
className: W.chevron
|
|
2876
|
+
})]
|
|
2877
|
+
})]
|
|
2878
|
+
}) }, e.id))
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
function Rt({ items: e, depth: n, ...r }) {
|
|
2882
|
+
return /* @__PURE__ */ t("ul", {
|
|
2883
|
+
className: g(W.list, n > 0 && W.nested),
|
|
2884
|
+
style: { "--depth": n },
|
|
2885
|
+
children: e.map((e) => /* @__PURE__ */ t(zt, {
|
|
2886
|
+
item: e,
|
|
2887
|
+
depth: n,
|
|
2888
|
+
...r
|
|
2889
|
+
}, e.id))
|
|
2890
|
+
});
|
|
2891
|
+
}
|
|
2892
|
+
var zt = i(function({ item: e, depth: r, activeId: i, ancestors: a, isOpen: o, toggle: s, onNavigate: c, onLinkClick: l }) {
|
|
2893
|
+
let u = Array.isArray(e.children) && e.children.length > 0, d = u && o(e.id), f = a.has(e.id), p = e.id === i, m = r === 0 && e.icon ? /* @__PURE__ */ t(x, {
|
|
2894
|
+
name: e.icon,
|
|
2895
|
+
size: 18,
|
|
2896
|
+
className: W.icon
|
|
2897
|
+
}) : null;
|
|
2898
|
+
return u ? /* @__PURE__ */ n("li", { children: [/* @__PURE__ */ n("button", {
|
|
2899
|
+
type: "button",
|
|
2900
|
+
className: g(W.item, f && W.onPath),
|
|
2901
|
+
"aria-expanded": d,
|
|
2902
|
+
onClick: () => s(e.id),
|
|
2903
|
+
onKeyDown: (t) => {
|
|
2904
|
+
t.key === "ArrowRight" && !d ? (t.preventDefault(), s(e.id, !0)) : t.key === "ArrowLeft" && (t.preventDefault(), d ? s(e.id, !1) : Bt(t.currentTarget));
|
|
2905
|
+
},
|
|
2906
|
+
children: [
|
|
2907
|
+
m,
|
|
2908
|
+
/* @__PURE__ */ t("span", {
|
|
2909
|
+
className: W.label,
|
|
2910
|
+
title: e.label,
|
|
2911
|
+
children: e.label
|
|
2912
|
+
}),
|
|
2913
|
+
e.badge != null && /* @__PURE__ */ t("span", {
|
|
2914
|
+
className: W.badge,
|
|
2915
|
+
children: e.badge
|
|
2916
|
+
}),
|
|
2917
|
+
/* @__PURE__ */ t(x, {
|
|
2918
|
+
name: "chevronDown",
|
|
2919
|
+
size: 16,
|
|
2920
|
+
className: g(W.chevron, d && W.chevronOpen)
|
|
2921
|
+
})
|
|
2922
|
+
]
|
|
2923
|
+
}), d && /* @__PURE__ */ t(Rt, {
|
|
2924
|
+
items: e.children,
|
|
2925
|
+
depth: r + 1,
|
|
2926
|
+
activeId: i,
|
|
2927
|
+
ancestors: a,
|
|
2928
|
+
isOpen: o,
|
|
2929
|
+
toggle: s,
|
|
2930
|
+
onNavigate: c,
|
|
2931
|
+
onLinkClick: l
|
|
2932
|
+
})] }) : /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("a", {
|
|
2933
|
+
href: e.href ?? "#",
|
|
2934
|
+
className: g(W.item, p && W.active),
|
|
2935
|
+
"aria-current": p ? "page" : void 0,
|
|
2936
|
+
target: e.external ? "_blank" : void 0,
|
|
2937
|
+
rel: e.external ? "noopener noreferrer" : void 0,
|
|
2938
|
+
onClick: (t) => Pt(e, t, c, l),
|
|
2939
|
+
onKeyDown: (e) => {
|
|
2940
|
+
e.key === "ArrowLeft" && (e.preventDefault(), Bt(e.currentTarget));
|
|
2941
|
+
},
|
|
2942
|
+
children: [
|
|
2943
|
+
m,
|
|
2944
|
+
/* @__PURE__ */ t("span", {
|
|
2945
|
+
className: W.label,
|
|
2946
|
+
title: e.label,
|
|
2947
|
+
children: e.label
|
|
2948
|
+
}),
|
|
2949
|
+
e.badge != null && /* @__PURE__ */ t("span", {
|
|
2950
|
+
className: W.badge,
|
|
2951
|
+
children: e.badge
|
|
2952
|
+
}),
|
|
2953
|
+
e.external && /* @__PURE__ */ t(x, {
|
|
2954
|
+
name: "external",
|
|
2955
|
+
size: 14,
|
|
2956
|
+
className: W.chevron
|
|
2957
|
+
})
|
|
2958
|
+
]
|
|
2959
|
+
}) });
|
|
2960
|
+
});
|
|
2961
|
+
function Bt(e) {
|
|
2962
|
+
(e.closest("ul")?.parentElement?.querySelector(":scope > button"))?.focus();
|
|
2963
|
+
}
|
|
2964
|
+
function Vt({ items: r, activeId: i, ancestors: a, isOpen: o, toggle: s, onNavigate: l }) {
|
|
2965
|
+
let [u, d] = m(null), f = p(0), h = p(null), _ = p(null), v = () => clearTimeout(f.current), y = () => {
|
|
2966
|
+
v(), f.current = setTimeout(() => d((e) => e?.pinned ? e : null), 150);
|
|
2967
|
+
}, b = (e, t, n = !1) => {
|
|
2968
|
+
v();
|
|
2969
|
+
let r = h.current?.getBoundingClientRect(), i = t.getBoundingClientRect().top;
|
|
2970
|
+
d({
|
|
2971
|
+
id: e.id,
|
|
2972
|
+
top: i,
|
|
2973
|
+
left: (r?.right ?? 64) + 8,
|
|
2974
|
+
pinned: n
|
|
2975
|
+
});
|
|
2976
|
+
}, S = (e) => {
|
|
2977
|
+
d(null), e?.focus();
|
|
2978
|
+
};
|
|
2979
|
+
c(() => {
|
|
2980
|
+
if (!u) return;
|
|
2981
|
+
let e = (e) => {
|
|
2982
|
+
_.current?.contains(e.target) || h.current?.contains(e.target) || d(null);
|
|
2983
|
+
}, t = () => d(null);
|
|
2984
|
+
return document.addEventListener("pointerdown", e), window.addEventListener("resize", t), () => {
|
|
2985
|
+
document.removeEventListener("pointerdown", e), window.removeEventListener("resize", t);
|
|
2986
|
+
};
|
|
2987
|
+
}, [u]), c(() => () => clearTimeout(f.current), []), c(() => {
|
|
2988
|
+
u?.pinned && _.current?.querySelector("a, button")?.focus();
|
|
2989
|
+
}, [u?.pinned, u?.id]);
|
|
2990
|
+
let C = u ? r.find((e) => e.id === u.id) : null;
|
|
2991
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("ul", {
|
|
2992
|
+
ref: h,
|
|
2993
|
+
className: W.rail,
|
|
2994
|
+
children: r.map((e) => {
|
|
2995
|
+
let r = Array.isArray(e.children) && e.children.length > 0, o = e.id === i || a.has(e.id), s = e.icon ? /* @__PURE__ */ t(x, {
|
|
2996
|
+
name: e.icon,
|
|
2997
|
+
size: 20
|
|
2998
|
+
}) : /* @__PURE__ */ t("span", {
|
|
2999
|
+
className: W.railLetter,
|
|
3000
|
+
children: e.label.slice(0, 1)
|
|
3001
|
+
}), c = {
|
|
3002
|
+
className: g(W.railItem, o && W.railActive, u?.id === e.id && W.railOpen),
|
|
3003
|
+
onMouseEnter: (t) => b(e, t.currentTarget, u?.pinned && u.id === e.id),
|
|
3004
|
+
onMouseLeave: y,
|
|
3005
|
+
onFocus: (t) => b(e, t.currentTarget, u?.pinned && u.id === e.id),
|
|
3006
|
+
"aria-label": e.label
|
|
3007
|
+
};
|
|
3008
|
+
return /* @__PURE__ */ t("li", { children: r ? /* @__PURE__ */ n("button", {
|
|
3009
|
+
type: "button",
|
|
3010
|
+
...c,
|
|
3011
|
+
"aria-haspopup": "true",
|
|
3012
|
+
"aria-expanded": u?.id === e.id,
|
|
3013
|
+
onClick: (t) => u?.id === e.id && u.pinned ? S() : b(e, t.currentTarget, !0),
|
|
3014
|
+
onKeyDown: (t) => {
|
|
3015
|
+
t.key === "ArrowRight" ? (t.preventDefault(), b(e, t.currentTarget, !0)) : t.key === "Escape" && S();
|
|
3016
|
+
},
|
|
3017
|
+
children: [s, e.badge != null && /* @__PURE__ */ t("span", {
|
|
3018
|
+
className: W.railDot,
|
|
3019
|
+
"aria-hidden": "true"
|
|
3020
|
+
})]
|
|
3021
|
+
}) : /* @__PURE__ */ n("a", {
|
|
3022
|
+
...c,
|
|
3023
|
+
href: e.href ?? "#",
|
|
3024
|
+
"aria-current": e.id === i ? "page" : void 0,
|
|
3025
|
+
target: e.external ? "_blank" : void 0,
|
|
3026
|
+
rel: e.external ? "noopener noreferrer" : void 0,
|
|
3027
|
+
onClick: (t) => Pt(e, t, l, () => d(null)),
|
|
3028
|
+
children: [s, e.badge != null && /* @__PURE__ */ t("span", {
|
|
3029
|
+
className: W.railDot,
|
|
3030
|
+
"aria-hidden": "true"
|
|
3031
|
+
})]
|
|
3032
|
+
}) }, e.id);
|
|
3033
|
+
})
|
|
3034
|
+
}), C && /* @__PURE__ */ n("div", {
|
|
3035
|
+
ref: _,
|
|
3036
|
+
className: W.flyout,
|
|
3037
|
+
style: {
|
|
3038
|
+
top: u.top,
|
|
3039
|
+
left: u.left,
|
|
3040
|
+
maxHeight: `calc(100vh - ${Math.max(0, u.top) + 16}px)`
|
|
3041
|
+
},
|
|
3042
|
+
onMouseEnter: v,
|
|
3043
|
+
onMouseLeave: y,
|
|
3044
|
+
onKeyDown: (e) => {
|
|
3045
|
+
if (e.key === "Escape") {
|
|
3046
|
+
e.stopPropagation();
|
|
3047
|
+
let t = h.current?.querySelector("[aria-expanded=\"true\"]");
|
|
3048
|
+
S(t);
|
|
3049
|
+
}
|
|
3050
|
+
},
|
|
3051
|
+
children: [/* @__PURE__ */ n("p", {
|
|
3052
|
+
className: W.flyoutTitle,
|
|
3053
|
+
children: [C.label, C.badge != null && /* @__PURE__ */ t("span", {
|
|
3054
|
+
className: W.badge,
|
|
3055
|
+
children: C.badge
|
|
3056
|
+
})]
|
|
3057
|
+
}), C.children?.length ? /* @__PURE__ */ t(Rt, {
|
|
3058
|
+
items: C.children,
|
|
3059
|
+
depth: 0,
|
|
3060
|
+
activeId: i,
|
|
3061
|
+
ancestors: a,
|
|
3062
|
+
isOpen: o,
|
|
3063
|
+
toggle: s,
|
|
3064
|
+
onNavigate: l,
|
|
3065
|
+
onLinkClick: () => d(null)
|
|
3066
|
+
}) : null]
|
|
3067
|
+
})] });
|
|
3068
|
+
}
|
|
3069
|
+
var J = {
|
|
308
3070
|
switch: "bw-switch-hgdMu",
|
|
309
3071
|
input: "bw-input-5BPNu",
|
|
310
3072
|
track: "bw-track-7ObdZ",
|
|
@@ -313,32 +3075,32 @@ var D = {
|
|
|
313
3075
|
label: "bw-label-LrH7V"
|
|
314
3076
|
};
|
|
315
3077
|
// src/components/Switch/Switch.jsx
|
|
316
|
-
function
|
|
317
|
-
return /* @__PURE__ */
|
|
318
|
-
className:
|
|
3078
|
+
function Ht({ checked: e, disabled: r, className: i, children: a, ref: o, ...s }) {
|
|
3079
|
+
return /* @__PURE__ */ n("label", {
|
|
3080
|
+
className: g(J.switch, r && J.disabled, i),
|
|
319
3081
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
ref:
|
|
3082
|
+
/* @__PURE__ */ t("input", {
|
|
3083
|
+
ref: o,
|
|
322
3084
|
type: "checkbox",
|
|
323
3085
|
role: "switch",
|
|
324
|
-
className:
|
|
325
|
-
checked:
|
|
3086
|
+
className: J.input,
|
|
3087
|
+
checked: e,
|
|
326
3088
|
disabled: r,
|
|
327
|
-
...
|
|
3089
|
+
...s
|
|
328
3090
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
className:
|
|
3091
|
+
/* @__PURE__ */ t("span", {
|
|
3092
|
+
className: J.track,
|
|
331
3093
|
"aria-hidden": "true",
|
|
332
|
-
children: /* @__PURE__ */
|
|
3094
|
+
children: /* @__PURE__ */ t("span", { className: J.knob })
|
|
333
3095
|
}),
|
|
334
|
-
|
|
335
|
-
className:
|
|
336
|
-
children:
|
|
3096
|
+
a != null && /* @__PURE__ */ t("span", {
|
|
3097
|
+
className: J.label,
|
|
3098
|
+
children: a
|
|
337
3099
|
})
|
|
338
3100
|
]
|
|
339
3101
|
});
|
|
340
3102
|
}
|
|
341
|
-
var
|
|
3103
|
+
var Y = {
|
|
342
3104
|
box: "bw-box-uOcZi",
|
|
343
3105
|
md: "bw-md-fIzHt",
|
|
344
3106
|
lg: "bw-lg-fOSc9",
|
|
@@ -350,39 +3112,158 @@ var k = {
|
|
|
350
3112
|
disabled: "bw-disabled-XqQQ1"
|
|
351
3113
|
};
|
|
352
3114
|
// src/components/TextField/TextField.jsx
|
|
353
|
-
function
|
|
354
|
-
return /* @__PURE__ */
|
|
355
|
-
id:
|
|
356
|
-
label:
|
|
3115
|
+
function X({ label: e, required: r, helperText: i, error: a, size: o = "md", icon: s, suffix: c, id: l, className: u, disabled: d, readOnly: f, ref: p, ...m }) {
|
|
3116
|
+
return /* @__PURE__ */ t(R, {
|
|
3117
|
+
id: l,
|
|
3118
|
+
label: e,
|
|
357
3119
|
required: r,
|
|
358
3120
|
helperText: i,
|
|
359
|
-
error:
|
|
360
|
-
className:
|
|
361
|
-
children: (
|
|
362
|
-
className:
|
|
3121
|
+
error: a,
|
|
3122
|
+
className: u,
|
|
3123
|
+
children: (e) => /* @__PURE__ */ n("div", {
|
|
3124
|
+
className: g(Y.box, Y[o], a && Y.invalid, d && Y.disabled, f && Y.readOnly),
|
|
363
3125
|
children: [
|
|
364
|
-
|
|
365
|
-
name:
|
|
3126
|
+
s && /* @__PURE__ */ t(x, {
|
|
3127
|
+
name: s,
|
|
366
3128
|
size: 16,
|
|
367
|
-
className:
|
|
3129
|
+
className: Y.icon
|
|
368
3130
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
ref:
|
|
371
|
-
className:
|
|
372
|
-
disabled:
|
|
373
|
-
readOnly:
|
|
3131
|
+
/* @__PURE__ */ t("input", {
|
|
3132
|
+
ref: p,
|
|
3133
|
+
className: Y.input,
|
|
3134
|
+
disabled: d,
|
|
3135
|
+
readOnly: f,
|
|
374
3136
|
required: r,
|
|
375
|
-
...
|
|
376
|
-
...
|
|
3137
|
+
...e,
|
|
3138
|
+
...m
|
|
377
3139
|
}),
|
|
378
|
-
|
|
379
|
-
className:
|
|
380
|
-
children:
|
|
3140
|
+
c && /* @__PURE__ */ t("span", {
|
|
3141
|
+
className: Y.suffix,
|
|
3142
|
+
children: c
|
|
381
3143
|
})
|
|
382
3144
|
]
|
|
383
3145
|
})
|
|
384
3146
|
});
|
|
385
3147
|
}
|
|
386
|
-
|
|
3148
|
+
// src/theme/theme.js
|
|
3149
|
+
var Ut = "bui.theme", Z = [
|
|
3150
|
+
"light",
|
|
3151
|
+
"dark",
|
|
3152
|
+
"system"
|
|
3153
|
+
], Wt = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
3154
|
+
function Gt() {
|
|
3155
|
+
try {
|
|
3156
|
+
let e = localStorage.getItem(Ut);
|
|
3157
|
+
return Z.includes(e) ? e : "system";
|
|
3158
|
+
} catch {
|
|
3159
|
+
return "system";
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
var Q = typeof window < "u" ? Gt() : "system", $ = /* @__PURE__ */ new Set();
|
|
3163
|
+
function Kt(e) {
|
|
3164
|
+
return e === "system" ? Wt?.matches ? "dark" : "light" : e;
|
|
3165
|
+
}
|
|
3166
|
+
function qt() {
|
|
3167
|
+
typeof document < "u" && (document.documentElement.dataset.theme = Kt(Q));
|
|
3168
|
+
}
|
|
3169
|
+
function Jt() {
|
|
3170
|
+
qt();
|
|
3171
|
+
for (let e of $) e();
|
|
3172
|
+
}
|
|
3173
|
+
Wt?.addEventListener?.("change", () => {
|
|
3174
|
+
Q === "system" && Jt();
|
|
3175
|
+
}), typeof window < "u" && (window.addEventListener("storage", (e) => {
|
|
3176
|
+
e.key === Ut && (Q = Gt(), Jt());
|
|
3177
|
+
}), qt());
|
|
3178
|
+
function Yt(e) {
|
|
3179
|
+
if (!Z.includes(e)) return;
|
|
3180
|
+
let t = Kt(Q);
|
|
3181
|
+
Q = e;
|
|
3182
|
+
try {
|
|
3183
|
+
e === "system" ? localStorage.removeItem(Ut) : localStorage.setItem(Ut, e);
|
|
3184
|
+
} catch {}
|
|
3185
|
+
t !== Kt(e) && Xt() ? document.startViewTransition(Jt) : Jt();
|
|
3186
|
+
}
|
|
3187
|
+
function Xt() {
|
|
3188
|
+
return typeof document > "u" || typeof document.startViewTransition != "function" ? !1 : !window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
3189
|
+
}
|
|
3190
|
+
function Zt() {
|
|
3191
|
+
return {
|
|
3192
|
+
preference: Q,
|
|
3193
|
+
resolved: Kt(Q)
|
|
3194
|
+
};
|
|
3195
|
+
}
|
|
3196
|
+
function Qt(e) {
|
|
3197
|
+
return $.add(e), () => $.delete(e);
|
|
3198
|
+
}
|
|
3199
|
+
function $t() {
|
|
3200
|
+
return {
|
|
3201
|
+
preference: h(Qt, () => Q, () => "system"),
|
|
3202
|
+
resolved: h(Qt, () => Kt(Q), () => "light"),
|
|
3203
|
+
setTheme: Yt
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
var en = `(function(){try{var p=localStorage.getItem('${Ut}');var d=p==='dark'||(p!=='light'&&matchMedia('(prefers-color-scheme: dark)').matches);document.documentElement.dataset.theme=d?'dark':'light'}catch(e){}})()`, tn = {
|
|
3207
|
+
bold: !0,
|
|
3208
|
+
fill: "F1F4F6",
|
|
3209
|
+
align: "center",
|
|
3210
|
+
border: !0
|
|
3211
|
+
}, nn = {
|
|
3212
|
+
bold: !0,
|
|
3213
|
+
fill: "EBF0F6",
|
|
3214
|
+
border: !0
|
|
3215
|
+
};
|
|
3216
|
+
function rn(e) {
|
|
3217
|
+
if (e instanceof Date || e == null || e === "") return e;
|
|
3218
|
+
let t = String(e);
|
|
3219
|
+
if (/^\d{8}$/.test(t)) return new Date(Number(t.slice(0, 4)), Number(t.slice(4, 6)) - 1, Number(t.slice(6, 8)));
|
|
3220
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(t)) {
|
|
3221
|
+
let [e, n, r] = t.split("-").map(Number);
|
|
3222
|
+
return new Date(e, n - 1, r);
|
|
3223
|
+
}
|
|
3224
|
+
return e;
|
|
3225
|
+
}
|
|
3226
|
+
function an(e) {
|
|
3227
|
+
if (typeof e == "number" || e == null || e === "") return e;
|
|
3228
|
+
let t = Number(String(e).replace(/,/g, ""));
|
|
3229
|
+
return Number.isNaN(t) ? e : t;
|
|
3230
|
+
}
|
|
3231
|
+
function on(e, { name: t = "Sheet1", title: n, columns: r, rows: i, autoFilter: a = !0 }) {
|
|
3232
|
+
let o = e.addSheet(t);
|
|
3233
|
+
o.setColumns(r.map((e) => ({ width: e.width ?? (e.type === "number" ? 120 : e.type === "date" ? 100 : 140) })));
|
|
3234
|
+
let s = 1;
|
|
3235
|
+
n && (o.setCell(1, 1, n, {
|
|
3236
|
+
bold: !0,
|
|
3237
|
+
size: 14
|
|
3238
|
+
}), o.merge(1, 1, 1, r.length), s = 3), r.forEach((e, t) => o.setCell(s, t + 1, e.header ?? e.key, tn));
|
|
3239
|
+
let c = r.map((e) => ({
|
|
3240
|
+
border: !0,
|
|
3241
|
+
align: e.align ?? (e.type === "number" ? "right" : e.type === "date" ? "center" : void 0),
|
|
3242
|
+
format: e.format ?? (e.type === "number" ? "#,##0" : e.type === "date" ? "yyyy-mm-dd" : void 0)
|
|
3243
|
+
})), l = (e, t) => {
|
|
3244
|
+
let n = t.value ? t.value(e) : e[t.key];
|
|
3245
|
+
return t.type === "date" ? rn(n) : t.type === "number" ? an(n) : n;
|
|
3246
|
+
};
|
|
3247
|
+
for (let e of i) o.addRow(r.map((t) => l(e, t)), c);
|
|
3248
|
+
let u = o.rowCount;
|
|
3249
|
+
if (r.some((e) => e.sum)) {
|
|
3250
|
+
let e = r.map((e, t) => e.sum ? i.reduce((t, n) => {
|
|
3251
|
+
let r = l(n, e);
|
|
3252
|
+
return typeof r == "number" ? t + r : t;
|
|
3253
|
+
}, 0) : t === 0 ? `합계 (${i.length.toLocaleString("ko-KR")}건)` : null);
|
|
3254
|
+
o.addRow(e, r.map((e) => ({
|
|
3255
|
+
...nn,
|
|
3256
|
+
align: e.sum ? "right" : void 0,
|
|
3257
|
+
format: e.sum ? c[r.indexOf(e)].format : void 0
|
|
3258
|
+
})));
|
|
3259
|
+
}
|
|
3260
|
+
return o.freeze({ rows: s }), a && i.length > 0 && o.setAutoFilter(s, 1, u, r.length), o;
|
|
3261
|
+
}
|
|
3262
|
+
async function sn({ fileName: e = "data", sheets: t, ...n }) {
|
|
3263
|
+
let r = Ae();
|
|
3264
|
+
for (let e of t ?? [n]) on(r, e);
|
|
3265
|
+
await r.download(e);
|
|
3266
|
+
}
|
|
3267
|
+
export { v as Badge, D as Button, te as Checkbox, ut as DataGrid, R as Field, x as Icon, re as IconButton, B as Menu, Mt as Radio, U as RadioGroup, Ft as SideNav, C as Spinner, Ht as Switch, en as THEME_INIT_SCRIPT, X as TextField, on as addTableSheet, Ae as createWorkbook, P as downloadBlob, sn as exportToExcel, Zt as getTheme, b as iconNames, Yt as setTheme, $t as useTheme };
|
|
387
3268
|
|
|
388
3269
|
//# sourceMappingURL=index.js.map
|