@krds.ui/vue 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/krds-vue.es.js +1011 -522
- package/dist/krds-vue.es.js.map +1 -1
- package/dist/krds-vue.umd.js +1 -1
- package/dist/krds-vue.umd.js.map +1 -1
- package/dist/types/index.d.ts +249 -0
- package/package.json +47 -22
package/dist/krds-vue.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as C, computed as g, h as r, ref as M, onMounted as re, onBeforeUnmount as _e, createElementBlock as B, openBlock as w, createElementVNode as h, normalizeClass as L, withDirectives as Y, unref as I, toDisplayString as N, Fragment as E, renderList as F, vShow as G, createBlock as W, withCtx as U, createTextVNode as R, watch as Be, provide as De, inject as Ke, createCommentVNode as J, onUnmounted as ae, resolveDirective as xe, resolveDynamicComponent as le } from "vue";
|
|
2
|
+
const oe = C({
|
|
3
3
|
name: "KrdsButton",
|
|
4
4
|
props: {
|
|
5
5
|
type: {
|
|
@@ -36,37 +36,37 @@ const U = b({
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
emits: ["click"],
|
|
39
|
-
setup(e, { emit:
|
|
40
|
-
const
|
|
39
|
+
setup(e, { emit: i, slots: s }) {
|
|
40
|
+
const n = g(() => {
|
|
41
41
|
const t = ["krds-btn"];
|
|
42
42
|
return e.icon && t.push("icon"), e.border && t.push("border"), e.pure && t.push("pure"), e.variant && !e.icon && t.push(e.variant), e.size && t.push(e.size), e.class && t.push(e.class), t;
|
|
43
|
-
}),
|
|
44
|
-
e.disabled ||
|
|
43
|
+
}), o = (t) => {
|
|
44
|
+
e.disabled || i("click", t);
|
|
45
45
|
};
|
|
46
|
-
return () =>
|
|
46
|
+
return () => r(
|
|
47
47
|
"button",
|
|
48
48
|
{
|
|
49
49
|
type: e.type,
|
|
50
|
-
class:
|
|
50
|
+
class: n.value,
|
|
51
51
|
disabled: e.disabled,
|
|
52
|
-
onClick:
|
|
52
|
+
onClick: o
|
|
53
53
|
},
|
|
54
|
-
|
|
54
|
+
s.default?.()
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
}),
|
|
57
|
+
}), Ie = C({
|
|
58
58
|
name: "KrdsButtonGroup",
|
|
59
59
|
props: {},
|
|
60
|
-
setup(e, { slots:
|
|
61
|
-
return () =>
|
|
60
|
+
setup(e, { slots: i }) {
|
|
61
|
+
return () => r(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
class: "btn-group"
|
|
65
65
|
},
|
|
66
|
-
|
|
66
|
+
i.default?.()
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
}),
|
|
69
|
+
}), Ve = C({
|
|
70
70
|
name: "KrdsIcon",
|
|
71
71
|
props: {
|
|
72
72
|
name: {
|
|
@@ -79,11 +79,11 @@ const U = b({
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
setup(e) {
|
|
82
|
-
return () =>
|
|
82
|
+
return () => r("i", {
|
|
83
83
|
class: ["svg-icon", e.name, e.class].filter(Boolean).join(" ")
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
}),
|
|
86
|
+
}), ze = C({
|
|
87
87
|
name: "KrdsLink",
|
|
88
88
|
props: {
|
|
89
89
|
href: {
|
|
@@ -120,29 +120,41 @@ const U = b({
|
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
emits: ["click"],
|
|
123
|
-
setup(e, { emit:
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
return e.size &&
|
|
127
|
-
}),
|
|
128
|
-
const
|
|
123
|
+
setup(e, { emit: i, slots: s }) {
|
|
124
|
+
const n = g(() => {
|
|
125
|
+
const a = ["krds-btn"];
|
|
126
|
+
return e.size && a.push(e.size), e.link && a.push("link"), e.basic && a.push("basic"), e.pure && a.push("pure"), e.class && a.push(e.class), a;
|
|
127
|
+
}), o = g(() => {
|
|
128
|
+
const a = {
|
|
129
129
|
href: e.href,
|
|
130
|
-
class:
|
|
130
|
+
class: n.value
|
|
131
131
|
};
|
|
132
|
-
return e.target && (
|
|
133
|
-
}), t = (
|
|
134
|
-
|
|
132
|
+
return e.target && (a.target = e.target), e.title && (a.title = e.title), e.target === "_blank" && (a.rel = "noopener noreferrer"), a;
|
|
133
|
+
}), t = (a) => {
|
|
134
|
+
i("click", a);
|
|
135
135
|
};
|
|
136
|
-
return () =>
|
|
136
|
+
return () => r(
|
|
137
137
|
"a",
|
|
138
138
|
{
|
|
139
|
-
...
|
|
139
|
+
...o.value,
|
|
140
140
|
onClick: t
|
|
141
141
|
},
|
|
142
|
-
|
|
142
|
+
s.default?.()
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
|
-
}),
|
|
145
|
+
}), ue = C({
|
|
146
|
+
name: "KrdsSpinner",
|
|
147
|
+
props: {
|
|
148
|
+
label: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: void 0
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
render() {
|
|
154
|
+
const e = [r("span", { class: "sr-only" }, "로딩 중")];
|
|
155
|
+
return this.label && e.push(r("span", this.label)), r("div", { class: "krds-spinner", role: "status" }, e);
|
|
156
|
+
}
|
|
157
|
+
}), Me = C({
|
|
146
158
|
name: "KrdsInput",
|
|
147
159
|
props: {
|
|
148
160
|
modelValue: {
|
|
@@ -217,6 +229,10 @@ const U = b({
|
|
|
217
229
|
type: Boolean,
|
|
218
230
|
default: !1
|
|
219
231
|
},
|
|
232
|
+
loading: {
|
|
233
|
+
type: Boolean,
|
|
234
|
+
default: !1
|
|
235
|
+
},
|
|
220
236
|
class: {
|
|
221
237
|
type: String,
|
|
222
238
|
default: void 0
|
|
@@ -227,27 +243,27 @@ const U = b({
|
|
|
227
243
|
}
|
|
228
244
|
},
|
|
229
245
|
emits: ["update:modelValue", "input", "change", "focus", "blur", "keydown", "keyup"],
|
|
230
|
-
setup(e, { emit:
|
|
231
|
-
const
|
|
232
|
-
const
|
|
233
|
-
return e.size &&
|
|
234
|
-
}),
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
}, t = (
|
|
238
|
-
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
},
|
|
248
|
-
const
|
|
246
|
+
setup(e, { emit: i, slots: s }) {
|
|
247
|
+
const n = g(() => {
|
|
248
|
+
const y = ["krds-input"];
|
|
249
|
+
return e.size && y.push(e.size), e.class && y.push(e.class), y;
|
|
250
|
+
}), o = (y) => {
|
|
251
|
+
const $ = y.target, d = e.type === "number" ? Number($.value) : $.value;
|
|
252
|
+
i("update:modelValue", d), i("input", y);
|
|
253
|
+
}, t = (y) => {
|
|
254
|
+
i("change", y);
|
|
255
|
+
}, a = (y) => {
|
|
256
|
+
i("focus", y);
|
|
257
|
+
}, u = (y) => {
|
|
258
|
+
i("blur", y);
|
|
259
|
+
}, v = (y) => {
|
|
260
|
+
i("keydown", y);
|
|
261
|
+
}, S = (y) => {
|
|
262
|
+
i("keyup", y);
|
|
263
|
+
}, _ = g(() => {
|
|
264
|
+
const y = {
|
|
249
265
|
type: e.type,
|
|
250
|
-
class:
|
|
266
|
+
class: n.value,
|
|
251
267
|
value: e.modelValue,
|
|
252
268
|
placeholder: e.placeholder,
|
|
253
269
|
name: e.name,
|
|
@@ -257,24 +273,24 @@ const U = b({
|
|
|
257
273
|
disabled: e.disabled,
|
|
258
274
|
autocomplete: e.autocomplete,
|
|
259
275
|
autofocus: e.autofocus,
|
|
260
|
-
onInput:
|
|
276
|
+
onInput: o,
|
|
261
277
|
onChange: t,
|
|
262
|
-
onFocus:
|
|
263
|
-
onBlur:
|
|
264
|
-
onKeydown:
|
|
265
|
-
onKeyup:
|
|
278
|
+
onFocus: a,
|
|
279
|
+
onBlur: u,
|
|
280
|
+
onKeydown: v,
|
|
281
|
+
onKeyup: S
|
|
266
282
|
};
|
|
267
|
-
return e.maxlength !== void 0 && (
|
|
268
|
-
}),
|
|
269
|
-
const
|
|
270
|
-
return e.state !== "default" &&
|
|
283
|
+
return e.maxlength !== void 0 && (y.maxlength = e.maxlength), e.minlength !== void 0 && (y.minlength = e.minlength), e.type === "number" && (e.max !== void 0 && (y.max = e.max), e.min !== void 0 && (y.min = e.min), e.step !== void 0 && (y.step = e.step)), y;
|
|
284
|
+
}), V = g(() => {
|
|
285
|
+
const y = ["form-conts"];
|
|
286
|
+
return e.state !== "default" && y.push(`is-${e.state}`), e.icon && y.push("btn-ico-wrap"), y;
|
|
271
287
|
});
|
|
272
288
|
return () => {
|
|
273
|
-
const
|
|
274
|
-
return
|
|
289
|
+
const y = [r("input", _.value)];
|
|
290
|
+
return e.loading ? r("div", { class: V.value }, [r("div", { class: "form-spinner" }, [...y, r(ue)])]) : (s.default && y.push(...s.default()), r("div", { class: V.value }, y));
|
|
275
291
|
};
|
|
276
292
|
}
|
|
277
|
-
}),
|
|
293
|
+
}), $e = C({
|
|
278
294
|
name: "KrdsFormLabel",
|
|
279
295
|
props: {
|
|
280
296
|
for: {
|
|
@@ -295,25 +311,25 @@ const U = b({
|
|
|
295
311
|
}
|
|
296
312
|
},
|
|
297
313
|
emits: ["click"],
|
|
298
|
-
setup(e, { emit:
|
|
299
|
-
const
|
|
300
|
-
|
|
314
|
+
setup(e, { emit: i, slots: s }) {
|
|
315
|
+
const n = (o) => {
|
|
316
|
+
i("click", o);
|
|
301
317
|
};
|
|
302
|
-
return () =>
|
|
303
|
-
|
|
318
|
+
return () => r("div", { class: "form-tit" }, [
|
|
319
|
+
r(
|
|
304
320
|
"label",
|
|
305
321
|
{
|
|
306
322
|
for: e.for,
|
|
307
323
|
id: e.id,
|
|
308
324
|
class: e.class,
|
|
309
325
|
style: e.style,
|
|
310
|
-
onClick:
|
|
326
|
+
onClick: n
|
|
311
327
|
},
|
|
312
|
-
|
|
328
|
+
s.default?.()
|
|
313
329
|
)
|
|
314
330
|
]);
|
|
315
331
|
}
|
|
316
|
-
}),
|
|
332
|
+
}), Pe = C({
|
|
317
333
|
name: "KrdsFormHint",
|
|
318
334
|
props: {
|
|
319
335
|
type: {
|
|
@@ -334,10 +350,10 @@ const U = b({
|
|
|
334
350
|
}
|
|
335
351
|
},
|
|
336
352
|
emits: ["click"],
|
|
337
|
-
setup(e, { emit:
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
},
|
|
353
|
+
setup(e, { emit: i, slots: s }) {
|
|
354
|
+
const n = (t) => {
|
|
355
|
+
i("click", t);
|
|
356
|
+
}, o = () => {
|
|
341
357
|
let t;
|
|
342
358
|
switch (e.type) {
|
|
343
359
|
case "error":
|
|
@@ -355,18 +371,18 @@ const U = b({
|
|
|
355
371
|
}
|
|
356
372
|
return e.class ? `${t} ${e.class}` : t;
|
|
357
373
|
};
|
|
358
|
-
return () =>
|
|
374
|
+
return () => r(
|
|
359
375
|
"p",
|
|
360
376
|
{
|
|
361
377
|
id: e.id,
|
|
362
|
-
class:
|
|
378
|
+
class: o(),
|
|
363
379
|
style: e.style,
|
|
364
|
-
onClick:
|
|
380
|
+
onClick: n
|
|
365
381
|
},
|
|
366
|
-
|
|
382
|
+
s.default?.()
|
|
367
383
|
);
|
|
368
384
|
}
|
|
369
|
-
}),
|
|
385
|
+
}), Le = C({
|
|
370
386
|
name: "KrdsFormGroup",
|
|
371
387
|
props: {
|
|
372
388
|
class: {
|
|
@@ -382,94 +398,94 @@ const U = b({
|
|
|
382
398
|
default: void 0
|
|
383
399
|
}
|
|
384
400
|
},
|
|
385
|
-
setup(e, { slots:
|
|
386
|
-
const
|
|
387
|
-
const
|
|
388
|
-
return e.class &&
|
|
401
|
+
setup(e, { slots: i }) {
|
|
402
|
+
const s = g(() => {
|
|
403
|
+
const n = ["form-group"];
|
|
404
|
+
return e.class && n.push(e.class), n;
|
|
389
405
|
});
|
|
390
|
-
return () =>
|
|
406
|
+
return () => r(
|
|
391
407
|
"div",
|
|
392
408
|
{
|
|
393
409
|
id: e.id,
|
|
394
|
-
class:
|
|
410
|
+
class: s.value,
|
|
395
411
|
style: e.style
|
|
396
412
|
},
|
|
397
|
-
|
|
413
|
+
i.default?.()
|
|
398
414
|
);
|
|
399
415
|
}
|
|
400
416
|
});
|
|
401
|
-
function
|
|
402
|
-
const
|
|
403
|
-
const
|
|
404
|
-
for (let
|
|
405
|
-
|
|
406
|
-
return
|
|
407
|
-
}),
|
|
408
|
-
t.value = null,
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
},
|
|
414
|
-
if (
|
|
415
|
-
t.value =
|
|
416
|
-
else if (!t.value || t.value &&
|
|
417
|
-
t.value =
|
|
417
|
+
function Ne(e, i) {
|
|
418
|
+
const s = /* @__PURE__ */ new Date(), n = M(e || s.getFullYear()), o = M(i || s.getMonth() + 1), t = M(null), a = M(null), u = M(null), v = g(() => {
|
|
419
|
+
const p = s.getFullYear(), f = [];
|
|
420
|
+
for (let b = p - 10; b <= p + 10; b++)
|
|
421
|
+
f.push(b);
|
|
422
|
+
return f;
|
|
423
|
+
}), S = g(() => Array.from({ length: 12 }, (p, f) => f + 1)), _ = () => {
|
|
424
|
+
t.value = null, a.value = null;
|
|
425
|
+
}, V = () => {
|
|
426
|
+
o.value === 1 ? (o.value = 12, n.value -= 1) : o.value -= 1;
|
|
427
|
+
}, y = () => {
|
|
428
|
+
o.value === 12 ? (o.value = 1, n.value += 1) : o.value += 1;
|
|
429
|
+
}, $ = (p, f = !1) => {
|
|
430
|
+
if (f)
|
|
431
|
+
t.value = p, a.value = p;
|
|
432
|
+
else if (!t.value || t.value && a.value)
|
|
433
|
+
t.value = p, a.value = null;
|
|
418
434
|
else {
|
|
419
|
-
const
|
|
420
|
-
new Date(
|
|
435
|
+
const b = new Date(t.value.replace(/\./g, "-"));
|
|
436
|
+
new Date(p.replace(/\./g, "-")) < b ? (t.value = p, a.value = null) : a.value = p;
|
|
421
437
|
}
|
|
422
438
|
};
|
|
423
439
|
return {
|
|
424
440
|
// State
|
|
425
|
-
currentYear:
|
|
426
|
-
currentMonth:
|
|
441
|
+
currentYear: n,
|
|
442
|
+
currentMonth: o,
|
|
427
443
|
selectedStartDate: t,
|
|
428
|
-
selectedEndDate:
|
|
429
|
-
activeDateSelector:
|
|
444
|
+
selectedEndDate: a,
|
|
445
|
+
activeDateSelector: u,
|
|
430
446
|
// Computed
|
|
431
|
-
yearOptions:
|
|
432
|
-
monthOptions:
|
|
447
|
+
yearOptions: v,
|
|
448
|
+
monthOptions: S,
|
|
433
449
|
// Methods
|
|
434
|
-
clearDateSelection:
|
|
435
|
-
prevMonth:
|
|
436
|
-
nextMonth:
|
|
437
|
-
handleDateSelection:
|
|
450
|
+
clearDateSelection: _,
|
|
451
|
+
prevMonth: V,
|
|
452
|
+
nextMonth: y,
|
|
453
|
+
handleDateSelection: $,
|
|
438
454
|
selectToday: () => {
|
|
439
|
-
const
|
|
440
|
-
|
|
455
|
+
const p = `${s.getFullYear()}.${String(s.getMonth() + 1).padStart(2, "0")}.${String(s.getDate()).padStart(2, "0")}`;
|
|
456
|
+
$(p, !0);
|
|
441
457
|
},
|
|
442
|
-
isDateInSelectedRange: (
|
|
443
|
-
if (!t.value || !
|
|
458
|
+
isDateInSelectedRange: (p) => {
|
|
459
|
+
if (!t.value || !a.value)
|
|
444
460
|
return { isInRange: !1, isStart: !1, isEnd: !1 };
|
|
445
|
-
const
|
|
446
|
-
return { isInRange:
|
|
461
|
+
const f = new Date(p.replace(/\./g, "-")), b = new Date(t.value.replace(/\./g, "-")), K = new Date(a.value.replace(/\./g, "-")), O = p === t.value, T = p === a.value;
|
|
462
|
+
return { isInRange: f >= b && f <= K, isStart: O, isEnd: T };
|
|
447
463
|
}
|
|
448
464
|
};
|
|
449
465
|
}
|
|
450
|
-
function
|
|
451
|
-
let
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
e.value?.contains(
|
|
456
|
-
}, document.addEventListener(
|
|
457
|
-
},
|
|
458
|
-
if (
|
|
459
|
-
const
|
|
460
|
-
document.removeEventListener(
|
|
466
|
+
function Te(e, i, s = {}) {
|
|
467
|
+
let n = null;
|
|
468
|
+
const o = typeof s == "string" ? { ignore: s } : s, { ignore: t, event: a = "click" } = o, u = () => {
|
|
469
|
+
n = (S) => {
|
|
470
|
+
const _ = S.target;
|
|
471
|
+
e.value?.contains(_) || t && _.closest(t) || i();
|
|
472
|
+
}, document.addEventListener(a, n);
|
|
473
|
+
}, v = () => {
|
|
474
|
+
if (n) {
|
|
475
|
+
const S = typeof s == "string" ? "click" : s.event || "click";
|
|
476
|
+
document.removeEventListener(S, n), n = null;
|
|
461
477
|
}
|
|
462
478
|
};
|
|
463
|
-
return
|
|
464
|
-
|
|
465
|
-
}),
|
|
466
|
-
|
|
479
|
+
return re(() => {
|
|
480
|
+
u();
|
|
481
|
+
}), _e(() => {
|
|
482
|
+
v();
|
|
467
483
|
}), {
|
|
468
|
-
setupGlobalListeners:
|
|
469
|
-
removeGlobalListeners:
|
|
484
|
+
setupGlobalListeners: u,
|
|
485
|
+
removeGlobalListeners: v
|
|
470
486
|
};
|
|
471
487
|
}
|
|
472
|
-
const
|
|
488
|
+
const Ae = { class: "form-conts" }, Ee = { class: "calendar-input" }, Oe = ["id", "name", "placeholder", "value", "readonly", "disabled", "required", "autofocus"], qe = ["disabled", "aria-expanded"], Fe = { class: "calendar-head" }, He = { class: "calendar-switch-wrap" }, Re = { class: "calendar-drop-down" }, Ye = ["aria-expanded"], je = { class: "calendar-select calendar-year-wrap" }, Ge = { class: "sel year" }, We = ["onClick"], Ue = { class: "calendar-drop-down" }, Je = ["aria-expanded"], Qe = { class: "calendar-select calendar-mon-wrap" }, Xe = { class: "sel month" }, Ze = ["onClick"], et = { class: "calendar-body" }, tt = { class: "calendar-table-wrap" }, at = { class: "calendar-tbl" }, lt = ["data-date"], nt = ["aria-pressed", "onClick"], st = { class: "calendar-footer" }, it = { class: "calendar-btn-wrap" }, rt = /* @__PURE__ */ C({
|
|
473
489
|
__name: "KrdsDateInput",
|
|
474
490
|
props: {
|
|
475
491
|
modelValue: { default: void 0 },
|
|
@@ -489,66 +505,66 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
489
505
|
id: { default: void 0 }
|
|
490
506
|
},
|
|
491
507
|
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
492
|
-
setup(e, { emit:
|
|
493
|
-
const
|
|
494
|
-
currentYear:
|
|
495
|
-
currentMonth:
|
|
496
|
-
selectedStartDate:
|
|
497
|
-
selectedEndDate:
|
|
498
|
-
yearOptions:
|
|
499
|
-
monthOptions:
|
|
500
|
-
prevMonth:
|
|
501
|
-
nextMonth:
|
|
502
|
-
handleDateSelection:
|
|
503
|
-
selectToday:
|
|
504
|
-
isDateInSelectedRange:
|
|
505
|
-
} =
|
|
506
|
-
|
|
508
|
+
setup(e, { emit: i }) {
|
|
509
|
+
const s = e, n = i, o = M(), t = M(), a = M(!1), u = M(null), {
|
|
510
|
+
currentYear: v,
|
|
511
|
+
currentMonth: S,
|
|
512
|
+
selectedStartDate: _,
|
|
513
|
+
selectedEndDate: V,
|
|
514
|
+
yearOptions: y,
|
|
515
|
+
monthOptions: $,
|
|
516
|
+
prevMonth: d,
|
|
517
|
+
nextMonth: l,
|
|
518
|
+
handleDateSelection: p,
|
|
519
|
+
selectToday: f,
|
|
520
|
+
isDateInSelectedRange: b
|
|
521
|
+
} = Ne(s.initialYear, s.initialMonth), K = () => {
|
|
522
|
+
a.value && t.value?.focus(), a.value = !1, u.value = null;
|
|
507
523
|
};
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
const
|
|
511
|
-
return
|
|
512
|
-
}),
|
|
524
|
+
Te(o, K, ".calendar-conts");
|
|
525
|
+
const O = g(() => {
|
|
526
|
+
const c = ["krds-input", "datepicker", "cal"];
|
|
527
|
+
return s.size && c.push(s.size), s.class && c.push(s.class), c;
|
|
528
|
+
}), T = g(() => ["form-conts", "calendar-conts"]), P = g(() => ({
|
|
513
529
|
"krds-calendar-area": !0,
|
|
514
|
-
active:
|
|
515
|
-
})),
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
for (let
|
|
520
|
-
const
|
|
521
|
-
for (let
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
day:
|
|
525
|
-
dateString:
|
|
526
|
-
isCurrentMonth:
|
|
527
|
-
isToday:
|
|
528
|
-
isPrevMonth:
|
|
529
|
-
isNextMonth:
|
|
530
|
-
isSunday:
|
|
531
|
-
isSaturday:
|
|
532
|
-
}),
|
|
530
|
+
active: a.value
|
|
531
|
+
})), z = g(() => {
|
|
532
|
+
const c = v.value, m = S.value, k = new Date(c, m - 1, 1), q = new Date(k);
|
|
533
|
+
q.setDate(q.getDate() - k.getDay());
|
|
534
|
+
const A = [], x = new Date(q);
|
|
535
|
+
for (let j = 0; j < 6; j++) {
|
|
536
|
+
const Z = [];
|
|
537
|
+
for (let ee = 0; ee < 7; ee++) {
|
|
538
|
+
const we = `${x.getFullYear()}.${String(x.getMonth() + 1).padStart(2, "0")}.${String(x.getDate()).padStart(2, "0")}`, te = x.getDay();
|
|
539
|
+
Z.push({
|
|
540
|
+
day: x.getDate(),
|
|
541
|
+
dateString: we,
|
|
542
|
+
isCurrentMonth: x.getMonth() === m - 1,
|
|
543
|
+
isToday: x.toDateString() === (/* @__PURE__ */ new Date()).toDateString(),
|
|
544
|
+
isPrevMonth: x.getMonth() < m - 1 || x.getMonth() === 11 && m === 1,
|
|
545
|
+
isNextMonth: x.getMonth() > m - 1 || x.getMonth() === 0 && m === 12,
|
|
546
|
+
isSunday: te === 0,
|
|
547
|
+
isSaturday: te === 6
|
|
548
|
+
}), x.setDate(x.getDate() + 1);
|
|
533
549
|
}
|
|
534
|
-
|
|
550
|
+
A.push(Z);
|
|
535
551
|
}
|
|
536
|
-
return
|
|
537
|
-
}),
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
const
|
|
541
|
-
|
|
552
|
+
return A;
|
|
553
|
+
}), H = (c) => {
|
|
554
|
+
const m = [];
|
|
555
|
+
if (c.isPrevMonth && m.push("old"), c.isNextMonth && m.push("new"), c.isToday && m.push("today"), c.isSunday && m.push("day-off"), s.holidays?.includes(c.dateString) && m.push("day-off"), s.eventDates?.includes(c.dateString) && m.push("day-event"), c.isCurrentMonth) {
|
|
556
|
+
const k = b(c.dateString);
|
|
557
|
+
k.isInRange && (m.push("period"), k.isStart && m.push("start"), k.isEnd && m.push("end"));
|
|
542
558
|
}
|
|
543
|
-
return
|
|
544
|
-
},
|
|
559
|
+
return m;
|
|
560
|
+
}, D = g(() => [
|
|
545
561
|
{
|
|
546
562
|
id: "get-today",
|
|
547
563
|
label: "오늘",
|
|
548
564
|
class: "text",
|
|
549
565
|
variant: void 0,
|
|
550
566
|
size: "small",
|
|
551
|
-
handler:
|
|
567
|
+
handler: f
|
|
552
568
|
},
|
|
553
569
|
{
|
|
554
570
|
id: "cancel-btn",
|
|
@@ -556,7 +572,7 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
556
572
|
class: void 0,
|
|
557
573
|
variant: "tertiary",
|
|
558
574
|
size: "small",
|
|
559
|
-
handler:
|
|
575
|
+
handler: K
|
|
560
576
|
},
|
|
561
577
|
{
|
|
562
578
|
id: "confirm-btn",
|
|
@@ -564,211 +580,211 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
564
580
|
class: void 0,
|
|
565
581
|
variant: "primary",
|
|
566
582
|
size: "small",
|
|
567
|
-
handler:
|
|
583
|
+
handler: ge
|
|
568
584
|
}
|
|
569
|
-
]),
|
|
570
|
-
|
|
571
|
-
},
|
|
572
|
-
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
if (
|
|
577
|
-
if (
|
|
578
|
-
const
|
|
579
|
-
|
|
585
|
+
]), X = (c) => {
|
|
586
|
+
u.value === c ? u.value = null : u.value = c;
|
|
587
|
+
}, ve = (c) => {
|
|
588
|
+
v.value = c, u.value = null;
|
|
589
|
+
}, he = (c) => {
|
|
590
|
+
S.value = c, u.value = null;
|
|
591
|
+
}, ge = () => {
|
|
592
|
+
if (_.value) {
|
|
593
|
+
if (V.value && _.value !== V.value) {
|
|
594
|
+
const c = `${_.value} ~ ${V.value}`;
|
|
595
|
+
n("update:modelValue", c);
|
|
580
596
|
} else
|
|
581
|
-
|
|
582
|
-
|
|
597
|
+
n("update:modelValue", _.value);
|
|
598
|
+
K();
|
|
583
599
|
}
|
|
584
|
-
},
|
|
585
|
-
|
|
586
|
-
|
|
600
|
+
}, ye = () => {
|
|
601
|
+
a.value = !0, u.value = null, setTimeout(() => {
|
|
602
|
+
o.value?.querySelector(".calendar-wrap")?.focus();
|
|
587
603
|
}, 50);
|
|
588
|
-
},
|
|
589
|
-
|
|
590
|
-
},
|
|
591
|
-
|
|
592
|
-
},
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
},
|
|
596
|
-
|
|
597
|
-
},
|
|
598
|
-
|
|
599
|
-
},
|
|
600
|
-
|
|
604
|
+
}, pe = () => {
|
|
605
|
+
a.value ? K() : ye();
|
|
606
|
+
}, me = (c) => {
|
|
607
|
+
c.code === "Escape" && (u.value ? u.value = null : a.value && K());
|
|
608
|
+
}, be = (c) => {
|
|
609
|
+
const m = c.target;
|
|
610
|
+
n("update:modelValue", m.value), n("input", c);
|
|
611
|
+
}, ke = (c) => {
|
|
612
|
+
n("change", c);
|
|
613
|
+
}, Se = (c) => {
|
|
614
|
+
n("focus", c);
|
|
615
|
+
}, Ce = (c) => {
|
|
616
|
+
n("blur", c);
|
|
601
617
|
};
|
|
602
|
-
return (
|
|
603
|
-
|
|
604
|
-
class:
|
|
618
|
+
return (c, m) => (w(), B("div", Ae, [
|
|
619
|
+
h("div", {
|
|
620
|
+
class: L(T.value)
|
|
605
621
|
}, [
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
id:
|
|
609
|
-
name:
|
|
610
|
-
class:
|
|
611
|
-
placeholder:
|
|
612
|
-
value:
|
|
613
|
-
readonly:
|
|
614
|
-
disabled:
|
|
615
|
-
required:
|
|
616
|
-
autofocus:
|
|
622
|
+
h("div", Ee, [
|
|
623
|
+
h("input", {
|
|
624
|
+
id: c.id,
|
|
625
|
+
name: c.name,
|
|
626
|
+
class: L(O.value),
|
|
627
|
+
placeholder: c.placeholder,
|
|
628
|
+
value: c.modelValue,
|
|
629
|
+
readonly: c.readonly,
|
|
630
|
+
disabled: c.disabled,
|
|
631
|
+
required: c.required,
|
|
632
|
+
autofocus: c.autofocus,
|
|
617
633
|
type: "text",
|
|
618
|
-
onInput:
|
|
619
|
-
onChange:
|
|
620
|
-
onFocus:
|
|
621
|
-
onBlur:
|
|
622
|
-
}, null, 42,
|
|
623
|
-
|
|
634
|
+
onInput: be,
|
|
635
|
+
onChange: ke,
|
|
636
|
+
onFocus: Se,
|
|
637
|
+
onBlur: Ce
|
|
638
|
+
}, null, 42, Oe),
|
|
639
|
+
h("button", {
|
|
624
640
|
ref_key: "datePickerButtonRef",
|
|
625
641
|
ref: t,
|
|
626
|
-
class:
|
|
627
|
-
disabled:
|
|
628
|
-
"aria-expanded":
|
|
642
|
+
class: L(`krds-btn ${c.size || "medium"} icon form-btn-datepicker`),
|
|
643
|
+
disabled: c.disabled,
|
|
644
|
+
"aria-expanded": a.value,
|
|
629
645
|
type: "button",
|
|
630
|
-
onClick:
|
|
631
|
-
}, [...
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
])], 10,
|
|
646
|
+
onClick: pe
|
|
647
|
+
}, [...m[4] || (m[4] = [
|
|
648
|
+
h("span", { class: "sr-only" }, "달력 열기", -1),
|
|
649
|
+
h("i", { class: "svg-icon ico-calendar" }, null, -1)
|
|
650
|
+
])], 10, qe)
|
|
635
651
|
]),
|
|
636
|
-
|
|
652
|
+
h("div", {
|
|
637
653
|
ref_key: "datePickerAreaRef",
|
|
638
|
-
ref:
|
|
639
|
-
class:
|
|
654
|
+
ref: o,
|
|
655
|
+
class: L(P.value)
|
|
640
656
|
}, [
|
|
641
|
-
|
|
657
|
+
Y(h("div", {
|
|
642
658
|
class: "calendar-wrap bottom",
|
|
643
659
|
"aria-label": "달력",
|
|
644
660
|
tabindex: "0",
|
|
645
|
-
onKeydown:
|
|
661
|
+
onKeydown: me
|
|
646
662
|
}, [
|
|
647
|
-
|
|
648
|
-
|
|
663
|
+
h("div", Fe, [
|
|
664
|
+
h("button", {
|
|
649
665
|
type: "button",
|
|
650
666
|
class: "btn-cal-move prev",
|
|
651
|
-
onClick:
|
|
652
|
-
(...
|
|
653
|
-
}, [...
|
|
654
|
-
|
|
667
|
+
onClick: m[0] || (m[0] = //@ts-ignore
|
|
668
|
+
(...k) => I(d) && I(d)(...k))
|
|
669
|
+
}, [...m[5] || (m[5] = [
|
|
670
|
+
h("span", { class: "sr-only" }, "이전 달", -1)
|
|
655
671
|
])]),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
672
|
+
h("div", He, [
|
|
673
|
+
h("div", Re, [
|
|
674
|
+
h("button", {
|
|
659
675
|
type: "button",
|
|
660
676
|
class: "btn-cal-switch year",
|
|
661
677
|
"aria-label": "연도 선택",
|
|
662
|
-
"aria-expanded":
|
|
663
|
-
onClick:
|
|
664
|
-
},
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
(
|
|
668
|
-
|
|
678
|
+
"aria-expanded": u.value === "year",
|
|
679
|
+
onClick: m[1] || (m[1] = (k) => X("year"))
|
|
680
|
+
}, N(I(v)) + "년 ", 9, Ye),
|
|
681
|
+
Y(h("div", je, [
|
|
682
|
+
h("ul", Ge, [
|
|
683
|
+
(w(!0), B(E, null, F(I(y), (k) => (w(), B("li", { key: k }, [
|
|
684
|
+
h("button", {
|
|
669
685
|
type: "button",
|
|
670
|
-
class:
|
|
671
|
-
onClick: (
|
|
672
|
-
},
|
|
686
|
+
class: L({ active: k === I(v) }),
|
|
687
|
+
onClick: (q) => ve(k)
|
|
688
|
+
}, N(k) + "년", 11, We)
|
|
673
689
|
]))), 128))
|
|
674
690
|
])
|
|
675
691
|
], 512), [
|
|
676
|
-
[
|
|
692
|
+
[G, u.value === "year"]
|
|
677
693
|
])
|
|
678
694
|
]),
|
|
679
|
-
|
|
680
|
-
|
|
695
|
+
h("div", Ue, [
|
|
696
|
+
h("button", {
|
|
681
697
|
type: "button",
|
|
682
698
|
class: "btn-cal-switch month",
|
|
683
699
|
"aria-label": "월 선택",
|
|
684
|
-
"aria-expanded":
|
|
685
|
-
onClick:
|
|
686
|
-
},
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
(
|
|
690
|
-
|
|
700
|
+
"aria-expanded": u.value === "month",
|
|
701
|
+
onClick: m[2] || (m[2] = (k) => X("month"))
|
|
702
|
+
}, N(I(S).toString().padStart(2, "0")) + "월 ", 9, Je),
|
|
703
|
+
Y(h("div", Qe, [
|
|
704
|
+
h("ul", Xe, [
|
|
705
|
+
(w(!0), B(E, null, F(I($), (k) => (w(), B("li", { key: k }, [
|
|
706
|
+
h("button", {
|
|
691
707
|
type: "button",
|
|
692
|
-
class:
|
|
693
|
-
onClick: (
|
|
694
|
-
},
|
|
708
|
+
class: L({ active: k === I(S) }),
|
|
709
|
+
onClick: (q) => he(k)
|
|
710
|
+
}, N(k.toString().padStart(2, "0")) + "월 ", 11, Ze)
|
|
695
711
|
]))), 128))
|
|
696
712
|
])
|
|
697
713
|
], 512), [
|
|
698
|
-
[
|
|
714
|
+
[G, u.value === "month"]
|
|
699
715
|
])
|
|
700
716
|
])
|
|
701
717
|
]),
|
|
702
|
-
|
|
718
|
+
h("button", {
|
|
703
719
|
type: "button",
|
|
704
720
|
class: "btn-cal-move next",
|
|
705
|
-
onClick:
|
|
706
|
-
(...
|
|
707
|
-
}, [...
|
|
708
|
-
|
|
721
|
+
onClick: m[3] || (m[3] = //@ts-ignore
|
|
722
|
+
(...k) => I(l) && I(l)(...k))
|
|
723
|
+
}, [...m[6] || (m[6] = [
|
|
724
|
+
h("span", { class: "sr-only" }, "다음 달", -1)
|
|
709
725
|
])])
|
|
710
726
|
]),
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
727
|
+
h("div", et, [
|
|
728
|
+
h("div", tt, [
|
|
729
|
+
h("table", at, [
|
|
730
|
+
h("caption", null, N(I(v)) + "년 " + N(I(S).toString().padStart(2, "0")) + "월", 1),
|
|
731
|
+
m[7] || (m[7] = h("thead", null, [
|
|
732
|
+
h("tr", null, [
|
|
733
|
+
h("th", null, "일"),
|
|
734
|
+
h("th", null, "월"),
|
|
735
|
+
h("th", null, "화"),
|
|
736
|
+
h("th", null, "수"),
|
|
737
|
+
h("th", null, "목"),
|
|
738
|
+
h("th", null, "금"),
|
|
739
|
+
h("th", null, "토")
|
|
724
740
|
])
|
|
725
741
|
], -1)),
|
|
726
|
-
|
|
727
|
-
(
|
|
728
|
-
(
|
|
729
|
-
key:
|
|
730
|
-
class:
|
|
731
|
-
"data-date":
|
|
742
|
+
h("tbody", null, [
|
|
743
|
+
(w(!0), B(E, null, F(z.value, (k, q) => (w(), B("tr", { key: q }, [
|
|
744
|
+
(w(!0), B(E, null, F(k, (A, x) => (w(), B("td", {
|
|
745
|
+
key: x,
|
|
746
|
+
class: L(H(A)),
|
|
747
|
+
"data-date": A.dateString
|
|
732
748
|
}, [
|
|
733
|
-
|
|
749
|
+
h("button", {
|
|
734
750
|
type: "button",
|
|
735
751
|
class: "btn-set-date",
|
|
736
|
-
"aria-pressed":
|
|
737
|
-
onClick: (
|
|
752
|
+
"aria-pressed": I(b)(A.dateString).isInRange ? "true" : "false",
|
|
753
|
+
onClick: (j) => I(p)(A.dateString)
|
|
738
754
|
}, [
|
|
739
|
-
|
|
740
|
-
], 8,
|
|
741
|
-
], 10,
|
|
755
|
+
h("span", null, N(A.day), 1)
|
|
756
|
+
], 8, nt)
|
|
757
|
+
], 10, lt))), 128))
|
|
742
758
|
]))), 128))
|
|
743
759
|
])
|
|
744
760
|
])
|
|
745
761
|
])
|
|
746
762
|
]),
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
(
|
|
750
|
-
id:
|
|
751
|
-
key:
|
|
752
|
-
class:
|
|
753
|
-
variant:
|
|
754
|
-
size:
|
|
755
|
-
onClick:
|
|
763
|
+
h("div", st, [
|
|
764
|
+
h("div", it, [
|
|
765
|
+
(w(!0), B(E, null, F(D.value, (k) => (w(), W(I(oe), {
|
|
766
|
+
id: k.id,
|
|
767
|
+
key: k.id,
|
|
768
|
+
class: L(k.class),
|
|
769
|
+
variant: k.variant,
|
|
770
|
+
size: k.size,
|
|
771
|
+
onClick: k.handler
|
|
756
772
|
}, {
|
|
757
|
-
default:
|
|
758
|
-
|
|
773
|
+
default: U(() => [
|
|
774
|
+
R(N(k.label), 1)
|
|
759
775
|
]),
|
|
760
776
|
_: 2
|
|
761
777
|
}, 1032, ["id", "class", "variant", "size", "onClick"]))), 128))
|
|
762
778
|
])
|
|
763
779
|
])
|
|
764
780
|
], 544), [
|
|
765
|
-
[
|
|
781
|
+
[G, a.value]
|
|
766
782
|
])
|
|
767
783
|
], 2)
|
|
768
784
|
], 2)
|
|
769
785
|
]));
|
|
770
786
|
}
|
|
771
|
-
}),
|
|
787
|
+
}), ot = C({
|
|
772
788
|
name: "KrdsTextarea",
|
|
773
789
|
props: {
|
|
774
790
|
modelValue: {
|
|
@@ -842,38 +858,38 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
842
858
|
}
|
|
843
859
|
},
|
|
844
860
|
emits: ["update:modelValue", "input", "change", "focus", "blur", "keydown", "keyup"],
|
|
845
|
-
setup(e, { emit:
|
|
846
|
-
const
|
|
847
|
-
|
|
861
|
+
setup(e, { emit: i }) {
|
|
862
|
+
const s = M(0);
|
|
863
|
+
Be(
|
|
848
864
|
() => e.modelValue,
|
|
849
|
-
(
|
|
850
|
-
|
|
865
|
+
(l) => {
|
|
866
|
+
s.value = (l || "").length;
|
|
851
867
|
},
|
|
852
868
|
{ immediate: !0 }
|
|
853
869
|
);
|
|
854
|
-
const
|
|
855
|
-
const
|
|
856
|
-
return e.size &&
|
|
857
|
-
}),
|
|
858
|
-
const
|
|
859
|
-
return e.resize && (
|
|
860
|
-
}), t = (
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
},
|
|
864
|
-
|
|
865
|
-
},
|
|
866
|
-
|
|
867
|
-
},
|
|
868
|
-
|
|
869
|
-
},
|
|
870
|
-
|
|
871
|
-
},
|
|
872
|
-
|
|
873
|
-
},
|
|
874
|
-
const
|
|
875
|
-
class:
|
|
876
|
-
style:
|
|
870
|
+
const n = g(() => {
|
|
871
|
+
const l = ["krds-input"];
|
|
872
|
+
return e.size && l.push(e.size), e.class && l.push(e.class), l;
|
|
873
|
+
}), o = g(() => {
|
|
874
|
+
const l = {};
|
|
875
|
+
return e.resize && (l.resize = e.resize), l;
|
|
876
|
+
}), t = (l) => {
|
|
877
|
+
const f = l.target.value;
|
|
878
|
+
s.value = f.length, i("update:modelValue", f), i("input", l);
|
|
879
|
+
}, a = (l) => {
|
|
880
|
+
i("change", l);
|
|
881
|
+
}, u = (l) => {
|
|
882
|
+
i("focus", l);
|
|
883
|
+
}, v = (l) => {
|
|
884
|
+
i("blur", l);
|
|
885
|
+
}, S = (l) => {
|
|
886
|
+
i("keydown", l);
|
|
887
|
+
}, _ = (l) => {
|
|
888
|
+
i("keyup", l);
|
|
889
|
+
}, V = g(() => {
|
|
890
|
+
const l = {
|
|
891
|
+
class: n.value,
|
|
892
|
+
style: o.value,
|
|
877
893
|
value: e.modelValue,
|
|
878
894
|
placeholder: e.placeholder,
|
|
879
895
|
name: e.name,
|
|
@@ -885,32 +901,32 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
885
901
|
rows: e.rows,
|
|
886
902
|
cols: e.cols,
|
|
887
903
|
onInput: t,
|
|
888
|
-
onChange:
|
|
889
|
-
onFocus:
|
|
890
|
-
onBlur:
|
|
891
|
-
onKeydown:
|
|
892
|
-
onKeyup:
|
|
904
|
+
onChange: a,
|
|
905
|
+
onFocus: u,
|
|
906
|
+
onBlur: v,
|
|
907
|
+
onKeydown: S,
|
|
908
|
+
onKeyup: _
|
|
893
909
|
};
|
|
894
|
-
return e.maxlength !== void 0 && (
|
|
895
|
-
}),
|
|
910
|
+
return e.maxlength !== void 0 && (l.maxlength = e.maxlength), e.minlength !== void 0 && (l.minlength = e.minlength), l;
|
|
911
|
+
}), y = g(() => ["form-conts"]), $ = g(() => ["textarea-wrap"]), d = g(() => {
|
|
896
912
|
if (!e.showCount) return null;
|
|
897
|
-
const
|
|
913
|
+
const l = s.value, p = e.maxlength;
|
|
898
914
|
return {
|
|
899
|
-
current:
|
|
900
|
-
max:
|
|
915
|
+
current: l,
|
|
916
|
+
max: p || ""
|
|
901
917
|
};
|
|
902
918
|
});
|
|
903
919
|
return () => {
|
|
904
|
-
const
|
|
905
|
-
return
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
920
|
+
const l = [r("textarea", V.value)];
|
|
921
|
+
return d.value && l.push(
|
|
922
|
+
r("p", { class: "textarea-count" }, [
|
|
923
|
+
r("span", { class: "count-now" }, d.value.current),
|
|
924
|
+
r("span", { class: "count-total" }, d.value.max ? `/${d.value.max}` : "")
|
|
909
925
|
])
|
|
910
|
-
),
|
|
926
|
+
), r("div", { class: y.value }, [r("div", { class: $.value }, l)]);
|
|
911
927
|
};
|
|
912
928
|
}
|
|
913
|
-
}),
|
|
929
|
+
}), ut = C({
|
|
914
930
|
name: "KrdsFileUpload",
|
|
915
931
|
props: {
|
|
916
932
|
modelValue: {
|
|
@@ -1013,15 +1029,15 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
1013
1029
|
"download",
|
|
1014
1030
|
"preview"
|
|
1015
1031
|
],
|
|
1016
|
-
setup(e, { emit:
|
|
1017
|
-
|
|
1018
|
-
const
|
|
1019
|
-
return e.class &&
|
|
1032
|
+
setup(e, { emit: i }) {
|
|
1033
|
+
M(!1), g(() => {
|
|
1034
|
+
const n = ["krds-file-upload", "line"];
|
|
1035
|
+
return e.class && n.push(e.class), n;
|
|
1020
1036
|
});
|
|
1021
|
-
const
|
|
1022
|
-
return
|
|
1037
|
+
const s = g(() => e.modelValue?.length || 0);
|
|
1038
|
+
return g(() => !e.disabled && s.value < e.maxFiles), () => null;
|
|
1023
1039
|
}
|
|
1024
|
-
}),
|
|
1040
|
+
}), dt = C({
|
|
1025
1041
|
name: "KrdsBadge",
|
|
1026
1042
|
props: {
|
|
1027
1043
|
type: {
|
|
@@ -1046,27 +1062,27 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
1046
1062
|
}
|
|
1047
1063
|
},
|
|
1048
1064
|
emits: ["click"],
|
|
1049
|
-
setup(e, { emit:
|
|
1050
|
-
const
|
|
1065
|
+
setup(e, { emit: i, slots: s }) {
|
|
1066
|
+
const n = g(() => {
|
|
1051
1067
|
const t = ["krds-badge"];
|
|
1052
1068
|
return t.push(`${e.type}-${e.color}`), e.size && t.push(e.size), e.number && t.push("number"), e.class && t.push(e.class), t;
|
|
1053
|
-
}),
|
|
1054
|
-
|
|
1069
|
+
}), o = (t) => {
|
|
1070
|
+
i("click", t);
|
|
1055
1071
|
};
|
|
1056
|
-
return () =>
|
|
1072
|
+
return () => r(
|
|
1057
1073
|
"span",
|
|
1058
1074
|
{
|
|
1059
1075
|
type: e.type,
|
|
1060
1076
|
color: e.color,
|
|
1061
1077
|
size: e.size,
|
|
1062
1078
|
number: e.number,
|
|
1063
|
-
class:
|
|
1064
|
-
onClick:
|
|
1079
|
+
class: n.value,
|
|
1080
|
+
onClick: o
|
|
1065
1081
|
},
|
|
1066
|
-
|
|
1082
|
+
s.default?.()
|
|
1067
1083
|
);
|
|
1068
1084
|
}
|
|
1069
|
-
}),
|
|
1085
|
+
}), ct = C({
|
|
1070
1086
|
name: "KrdsTag",
|
|
1071
1087
|
props: {
|
|
1072
1088
|
link: {
|
|
@@ -1091,40 +1107,40 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
1091
1107
|
}
|
|
1092
1108
|
},
|
|
1093
1109
|
emits: ["remove"],
|
|
1094
|
-
setup(e, { emit:
|
|
1095
|
-
const
|
|
1096
|
-
const
|
|
1097
|
-
return e.link &&
|
|
1098
|
-
}),
|
|
1099
|
-
|
|
1100
|
-
}, t = () =>
|
|
1110
|
+
setup(e, { emit: i, slots: s }) {
|
|
1111
|
+
const n = g(() => {
|
|
1112
|
+
const a = ["krds-btn-tag"];
|
|
1113
|
+
return e.link && a.push("link"), e.class && a.push(e.class), a;
|
|
1114
|
+
}), o = (a) => {
|
|
1115
|
+
i("remove", a);
|
|
1116
|
+
}, t = () => r(
|
|
1101
1117
|
"button",
|
|
1102
1118
|
{
|
|
1103
1119
|
type: "button",
|
|
1104
1120
|
class: "btn-delete",
|
|
1105
|
-
onClick:
|
|
1121
|
+
onClick: o
|
|
1106
1122
|
},
|
|
1107
|
-
[
|
|
1123
|
+
[r("span", { class: "sr-only" }, "삭제")]
|
|
1108
1124
|
);
|
|
1109
1125
|
return () => {
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1112
|
-
const
|
|
1126
|
+
const a = [], u = s.default?.();
|
|
1127
|
+
if (u && a.push(u), e.link || a.push(t()), e.link) {
|
|
1128
|
+
const v = {
|
|
1113
1129
|
href: e.href,
|
|
1114
|
-
class:
|
|
1130
|
+
class: n.value
|
|
1115
1131
|
};
|
|
1116
|
-
return e.target && (
|
|
1132
|
+
return e.target && (v.target = e.target), e.rel && (v.rel = e.rel), r("a", v, a);
|
|
1117
1133
|
}
|
|
1118
|
-
return
|
|
1134
|
+
return r(
|
|
1119
1135
|
"span",
|
|
1120
1136
|
{
|
|
1121
|
-
class:
|
|
1137
|
+
class: n.value
|
|
1122
1138
|
},
|
|
1123
|
-
|
|
1139
|
+
a
|
|
1124
1140
|
);
|
|
1125
1141
|
};
|
|
1126
1142
|
}
|
|
1127
|
-
}),
|
|
1143
|
+
}), ft = C({
|
|
1128
1144
|
name: "KrdsTagGroup",
|
|
1129
1145
|
props: {
|
|
1130
1146
|
size: {
|
|
@@ -1136,20 +1152,20 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
1136
1152
|
default: void 0
|
|
1137
1153
|
}
|
|
1138
1154
|
},
|
|
1139
|
-
setup(e, { slots:
|
|
1140
|
-
const
|
|
1141
|
-
const
|
|
1142
|
-
return e.size &&
|
|
1155
|
+
setup(e, { slots: i }) {
|
|
1156
|
+
const s = g(() => {
|
|
1157
|
+
const n = ["krds-tag-wrap"];
|
|
1158
|
+
return e.size && n.push(e.size), e.class && n.push(e.class), n;
|
|
1143
1159
|
});
|
|
1144
|
-
return () =>
|
|
1160
|
+
return () => r(
|
|
1145
1161
|
"div",
|
|
1146
1162
|
{
|
|
1147
|
-
class:
|
|
1163
|
+
class: s.value
|
|
1148
1164
|
},
|
|
1149
|
-
|
|
1165
|
+
i.default?.()
|
|
1150
1166
|
);
|
|
1151
1167
|
}
|
|
1152
|
-
}),
|
|
1168
|
+
}), vt = C({
|
|
1153
1169
|
name: "KrdsMasthead",
|
|
1154
1170
|
props: {
|
|
1155
1171
|
class: {
|
|
@@ -1158,36 +1174,36 @@ const Ke = { class: "form-conts" }, xe = { class: "calendar-input" }, ze = ["id"
|
|
|
1158
1174
|
}
|
|
1159
1175
|
},
|
|
1160
1176
|
emits: ["click"],
|
|
1161
|
-
setup(e, { emit:
|
|
1162
|
-
const
|
|
1177
|
+
setup(e, { emit: i, slots: s }) {
|
|
1178
|
+
const n = g(() => {
|
|
1163
1179
|
const t = [""];
|
|
1164
1180
|
return e.class && t.push(e.class), t;
|
|
1165
|
-
}),
|
|
1166
|
-
|
|
1181
|
+
}), o = (t) => {
|
|
1182
|
+
i("click", t);
|
|
1167
1183
|
};
|
|
1168
|
-
return () =>
|
|
1184
|
+
return () => r(
|
|
1169
1185
|
"div",
|
|
1170
1186
|
{
|
|
1171
1187
|
id: "krds-masthead",
|
|
1172
|
-
class:
|
|
1173
|
-
onClick:
|
|
1188
|
+
class: n.value,
|
|
1189
|
+
onClick: o
|
|
1174
1190
|
},
|
|
1175
1191
|
[
|
|
1176
|
-
|
|
1177
|
-
|
|
1192
|
+
r("div", { class: "toggle-wrap" }, [
|
|
1193
|
+
r("div", { class: "toggle-head" }, [r("div", { class: "inner" }, [r("span", { class: "nuri-txt" }, s.default?.())])])
|
|
1178
1194
|
])
|
|
1179
1195
|
]
|
|
1180
1196
|
);
|
|
1181
1197
|
}
|
|
1182
1198
|
});
|
|
1183
|
-
let
|
|
1184
|
-
function
|
|
1185
|
-
return `${e}-${++
|
|
1199
|
+
let ht = 0;
|
|
1200
|
+
function de(e = "krds") {
|
|
1201
|
+
return `${e}-${++ht}`;
|
|
1186
1202
|
}
|
|
1187
|
-
function
|
|
1203
|
+
function ce(...e) {
|
|
1188
1204
|
return e.filter(Boolean).join(" ");
|
|
1189
1205
|
}
|
|
1190
|
-
const
|
|
1206
|
+
const gt = C({
|
|
1191
1207
|
name: "KrdsToggleSwitch",
|
|
1192
1208
|
props: {
|
|
1193
1209
|
modelValue: {
|
|
@@ -1229,40 +1245,40 @@ const nt = b({
|
|
|
1229
1245
|
}
|
|
1230
1246
|
},
|
|
1231
1247
|
emits: ["update:modelValue", "change"],
|
|
1232
|
-
setup(e, { emit:
|
|
1233
|
-
const
|
|
1248
|
+
setup(e, { emit: i, attrs: s }) {
|
|
1249
|
+
const n = g(() => e.modelValue), o = g(() => ce("krds-form-toggle-switch", e.size, e.class)), t = (u) => {
|
|
1234
1250
|
if (e.disabled)
|
|
1235
1251
|
return;
|
|
1236
|
-
const
|
|
1237
|
-
|
|
1238
|
-
},
|
|
1239
|
-
return () =>
|
|
1252
|
+
const S = u.target.checked;
|
|
1253
|
+
i("update:modelValue", S), i("change", S);
|
|
1254
|
+
}, a = g(() => e.id || de("toggle-switch"));
|
|
1255
|
+
return () => r(
|
|
1240
1256
|
"div",
|
|
1241
1257
|
{
|
|
1242
|
-
class:
|
|
1258
|
+
class: o.value
|
|
1243
1259
|
},
|
|
1244
1260
|
[
|
|
1245
|
-
|
|
1261
|
+
r("input", {
|
|
1246
1262
|
type: "checkbox",
|
|
1247
|
-
id:
|
|
1263
|
+
id: a.value,
|
|
1248
1264
|
name: e.name,
|
|
1249
|
-
checked:
|
|
1265
|
+
checked: n.value,
|
|
1250
1266
|
disabled: e.disabled,
|
|
1251
1267
|
onChange: t,
|
|
1252
|
-
...
|
|
1268
|
+
...s
|
|
1253
1269
|
}),
|
|
1254
|
-
|
|
1270
|
+
r(
|
|
1255
1271
|
"label",
|
|
1256
1272
|
{
|
|
1257
|
-
for:
|
|
1273
|
+
for: a.value
|
|
1258
1274
|
},
|
|
1259
1275
|
[
|
|
1260
|
-
|
|
1276
|
+
r(
|
|
1261
1277
|
"span",
|
|
1262
1278
|
{
|
|
1263
1279
|
class: "switch-toggle"
|
|
1264
1280
|
},
|
|
1265
|
-
[
|
|
1281
|
+
[r("i")]
|
|
1266
1282
|
),
|
|
1267
1283
|
e.label || ""
|
|
1268
1284
|
]
|
|
@@ -1270,7 +1286,7 @@ const nt = b({
|
|
|
1270
1286
|
]
|
|
1271
1287
|
);
|
|
1272
1288
|
}
|
|
1273
|
-
}),
|
|
1289
|
+
}), yt = C({
|
|
1274
1290
|
name: "KrdsCheckArea",
|
|
1275
1291
|
props: {
|
|
1276
1292
|
class: {
|
|
@@ -1278,19 +1294,19 @@ const nt = b({
|
|
|
1278
1294
|
default: void 0
|
|
1279
1295
|
}
|
|
1280
1296
|
},
|
|
1281
|
-
setup(e, { slots:
|
|
1297
|
+
setup(e, { slots: i }) {
|
|
1282
1298
|
return () => {
|
|
1283
|
-
const
|
|
1284
|
-
return e.class &&
|
|
1299
|
+
const s = ["krds-check-area"];
|
|
1300
|
+
return e.class && s.push(e.class), r(
|
|
1285
1301
|
"div",
|
|
1286
1302
|
{
|
|
1287
|
-
class:
|
|
1303
|
+
class: s
|
|
1288
1304
|
},
|
|
1289
|
-
|
|
1305
|
+
i.default?.()
|
|
1290
1306
|
);
|
|
1291
1307
|
};
|
|
1292
1308
|
}
|
|
1293
|
-
}),
|
|
1309
|
+
}), pt = C({
|
|
1294
1310
|
name: "KrdsCheckbox",
|
|
1295
1311
|
props: {
|
|
1296
1312
|
modelValue: {
|
|
@@ -1321,97 +1337,570 @@ const nt = b({
|
|
|
1321
1337
|
},
|
|
1322
1338
|
emits: ["update:modelValue", "change"],
|
|
1323
1339
|
slots: Object,
|
|
1324
|
-
setup(e, { emit:
|
|
1325
|
-
const
|
|
1326
|
-
const
|
|
1327
|
-
return
|
|
1328
|
-
}),
|
|
1340
|
+
setup(e, { emit: i, attrs: s, slots: n }) {
|
|
1341
|
+
const o = g(() => e.modelValue), t = g(() => {
|
|
1342
|
+
const v = e.chip ? "krds-form-chip" : "krds-form-check";
|
|
1343
|
+
return ce(v, e.size, e.class);
|
|
1344
|
+
}), a = (v) => {
|
|
1329
1345
|
if (e.disabled)
|
|
1330
1346
|
return;
|
|
1331
|
-
const
|
|
1332
|
-
|
|
1333
|
-
},
|
|
1347
|
+
const _ = v.target.checked;
|
|
1348
|
+
i("update:modelValue", _), i("change", _);
|
|
1349
|
+
}, u = g(() => e.id || de("checkbox"));
|
|
1334
1350
|
return () => {
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1351
|
+
const v = [
|
|
1352
|
+
r("input", {
|
|
1337
1353
|
type: "checkbox",
|
|
1338
|
-
id:
|
|
1339
|
-
checked:
|
|
1354
|
+
id: u.value,
|
|
1355
|
+
checked: o.value,
|
|
1340
1356
|
disabled: e.disabled,
|
|
1341
|
-
onChange:
|
|
1342
|
-
...
|
|
1357
|
+
onChange: a,
|
|
1358
|
+
...s
|
|
1343
1359
|
}),
|
|
1344
|
-
|
|
1360
|
+
r(
|
|
1345
1361
|
"label",
|
|
1346
1362
|
{
|
|
1347
|
-
for:
|
|
1363
|
+
for: u.value
|
|
1348
1364
|
},
|
|
1349
|
-
|
|
1365
|
+
n.default?.()
|
|
1350
1366
|
)
|
|
1351
1367
|
];
|
|
1352
|
-
return
|
|
1368
|
+
return n.description && !e.chip && v.push(r("div", { class: "krds-form-check-cnt" }, r("p", { class: "krds-form-check-p" }, n.description()))), r(
|
|
1353
1369
|
"div",
|
|
1354
1370
|
{
|
|
1355
1371
|
class: t.value
|
|
1356
1372
|
},
|
|
1357
|
-
|
|
1373
|
+
v
|
|
1358
1374
|
);
|
|
1359
1375
|
};
|
|
1360
1376
|
}
|
|
1361
|
-
}),
|
|
1377
|
+
}), mt = C({
|
|
1378
|
+
name: "KrdsStepIndicator",
|
|
1379
|
+
props: {
|
|
1380
|
+
modelValue: {
|
|
1381
|
+
type: Number,
|
|
1382
|
+
default: 0
|
|
1383
|
+
},
|
|
1384
|
+
class: {
|
|
1385
|
+
type: String,
|
|
1386
|
+
default: void 0
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
emits: ["update:modelValue"],
|
|
1390
|
+
setup(e, { slots: i }) {
|
|
1391
|
+
const s = g(() => {
|
|
1392
|
+
const u = ["krds-step-wrap"];
|
|
1393
|
+
return e.class && u.push(e.class), u;
|
|
1394
|
+
}), n = (u) => {
|
|
1395
|
+
const v = e.modelValue || 0;
|
|
1396
|
+
return u < v ? "done" : u === v ? "active" : "pending";
|
|
1397
|
+
}, o = M(0), t = () => {
|
|
1398
|
+
o.value = 0;
|
|
1399
|
+
}, a = () => o.value++;
|
|
1400
|
+
return De("stepIndicator", {
|
|
1401
|
+
activeStep: g(() => e.modelValue || 0),
|
|
1402
|
+
getStepStatus: n,
|
|
1403
|
+
getNextStepIndex: a,
|
|
1404
|
+
resetStepIndex: t
|
|
1405
|
+
}), () => (t(), r(
|
|
1406
|
+
"ol",
|
|
1407
|
+
{
|
|
1408
|
+
class: s.value
|
|
1409
|
+
},
|
|
1410
|
+
i.default?.()
|
|
1411
|
+
));
|
|
1412
|
+
}
|
|
1413
|
+
}), bt = C({
|
|
1414
|
+
name: "KrdsStep",
|
|
1415
|
+
props: {
|
|
1416
|
+
step: {
|
|
1417
|
+
type: [String, Number],
|
|
1418
|
+
required: !0
|
|
1419
|
+
},
|
|
1420
|
+
title: {
|
|
1421
|
+
type: String,
|
|
1422
|
+
required: !0
|
|
1423
|
+
},
|
|
1424
|
+
status: {
|
|
1425
|
+
type: String,
|
|
1426
|
+
default: void 0
|
|
1427
|
+
},
|
|
1428
|
+
class: {
|
|
1429
|
+
type: String,
|
|
1430
|
+
default: void 0
|
|
1431
|
+
}
|
|
1432
|
+
},
|
|
1433
|
+
emits: ["click"],
|
|
1434
|
+
setup(e, { emit: i, slots: s }) {
|
|
1435
|
+
const n = Ke("stepIndicator"), o = n ? n.getNextStepIndex() : -1, t = g(() => e.status ? e.status : n && o >= 0 ? n.getStepStatus(o) : "pending"), a = g(() => {
|
|
1436
|
+
const v = [t.value];
|
|
1437
|
+
return e.class && v.push(e.class), v;
|
|
1438
|
+
}), u = (v) => {
|
|
1439
|
+
i("click", v, e.step);
|
|
1440
|
+
};
|
|
1441
|
+
return () => {
|
|
1442
|
+
const v = t.value === "active";
|
|
1443
|
+
return r(
|
|
1444
|
+
"li",
|
|
1445
|
+
{
|
|
1446
|
+
class: a.value,
|
|
1447
|
+
onClick: u
|
|
1448
|
+
},
|
|
1449
|
+
[
|
|
1450
|
+
r("span", [
|
|
1451
|
+
// 현재 단계 표시 (활성 상태일 때만)
|
|
1452
|
+
v && r("em", { class: "sr-only" }, "현재단계"),
|
|
1453
|
+
// 단계 번호
|
|
1454
|
+
r("i", { class: "step" }, e.step),
|
|
1455
|
+
// 단계 제목
|
|
1456
|
+
r("span", { class: "step-tit" }, e.title),
|
|
1457
|
+
// 슬롯 내용 (추가 콘텐츠가 있는 경우)
|
|
1458
|
+
s.default?.()
|
|
1459
|
+
])
|
|
1460
|
+
]
|
|
1461
|
+
);
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
}), kt = C({
|
|
1465
|
+
name: "KrdsSkipLink",
|
|
1466
|
+
props: {
|
|
1467
|
+
/**
|
|
1468
|
+
* 건너뛸 대상 요소의 ID
|
|
1469
|
+
* @example '#main-content', '#breadcrumb'
|
|
1470
|
+
*/
|
|
1471
|
+
href: {
|
|
1472
|
+
type: String,
|
|
1473
|
+
required: !0,
|
|
1474
|
+
validator: (e) => e.startsWith("#")
|
|
1475
|
+
},
|
|
1476
|
+
/**
|
|
1477
|
+
* 추가 CSS 클래스
|
|
1478
|
+
*/
|
|
1479
|
+
class: {
|
|
1480
|
+
type: [String, Array, Object],
|
|
1481
|
+
default: void 0
|
|
1482
|
+
},
|
|
1483
|
+
/**
|
|
1484
|
+
* 요소 ID
|
|
1485
|
+
*/
|
|
1486
|
+
id: {
|
|
1487
|
+
type: String,
|
|
1488
|
+
default: "krds-skip-link"
|
|
1489
|
+
}
|
|
1490
|
+
},
|
|
1491
|
+
setup(e, { slots: i }) {
|
|
1492
|
+
return () => r(
|
|
1493
|
+
"div",
|
|
1494
|
+
{
|
|
1495
|
+
id: e.id,
|
|
1496
|
+
class: e.class
|
|
1497
|
+
},
|
|
1498
|
+
[
|
|
1499
|
+
r(
|
|
1500
|
+
"a",
|
|
1501
|
+
{
|
|
1502
|
+
href: e.href
|
|
1503
|
+
},
|
|
1504
|
+
i.default?.()
|
|
1505
|
+
)
|
|
1506
|
+
]
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
}), St = ["id", "aria-label"], Ct = { class: "breadcrumb" }, wt = ["href", "aria-current", "onClick"], _t = { key: 0 }, Bt = /* @__PURE__ */ C({
|
|
1510
|
+
__name: "KrdsBreadcrumb",
|
|
1511
|
+
props: {
|
|
1512
|
+
items: {},
|
|
1513
|
+
id: { default: void 0 },
|
|
1514
|
+
ariaLabel: { default: "현재 경로" },
|
|
1515
|
+
showHomeIcon: { type: Boolean, default: !0 }
|
|
1516
|
+
},
|
|
1517
|
+
emits: ["item-click"],
|
|
1518
|
+
setup(e, { emit: i }) {
|
|
1519
|
+
const s = e, n = i, o = (a) => a === s.items.length - 1, t = (a, u) => {
|
|
1520
|
+
a.onClick && a.onClick(u), n("item-click", a, u);
|
|
1521
|
+
};
|
|
1522
|
+
return (a, u) => (w(), B("nav", {
|
|
1523
|
+
id: a.id,
|
|
1524
|
+
class: "krds-breadcrumb-wrap",
|
|
1525
|
+
"aria-label": a.ariaLabel
|
|
1526
|
+
}, [
|
|
1527
|
+
h("ol", Ct, [
|
|
1528
|
+
(w(!0), B(E, null, F(a.items, (v, S) => (w(), B("li", {
|
|
1529
|
+
key: `breadcrumb-${S}`,
|
|
1530
|
+
class: L({ home: S === 0 && a.showHomeIcon })
|
|
1531
|
+
}, [
|
|
1532
|
+
h("a", {
|
|
1533
|
+
href: v.href || "#",
|
|
1534
|
+
class: "txt",
|
|
1535
|
+
"aria-current": o(S) ? "page" : void 0,
|
|
1536
|
+
onClick: (_) => t(v, _)
|
|
1537
|
+
}, [
|
|
1538
|
+
S === 0 && a.showHomeIcon ? J("", !0) : (w(), B("span", _t, N(v.text), 1))
|
|
1539
|
+
], 8, wt)
|
|
1540
|
+
], 2))), 128))
|
|
1541
|
+
])
|
|
1542
|
+
], 8, St));
|
|
1543
|
+
}
|
|
1544
|
+
}), Dt = C({
|
|
1545
|
+
name: "KrdsInPageNavigation",
|
|
1546
|
+
props: {
|
|
1547
|
+
title: {
|
|
1548
|
+
type: String,
|
|
1549
|
+
default: void 0
|
|
1550
|
+
},
|
|
1551
|
+
caption: {
|
|
1552
|
+
type: String,
|
|
1553
|
+
default: "이 페이지의 구성"
|
|
1554
|
+
},
|
|
1555
|
+
items: {
|
|
1556
|
+
type: Array,
|
|
1557
|
+
default: () => []
|
|
1558
|
+
},
|
|
1559
|
+
autoActive: {
|
|
1560
|
+
type: Boolean,
|
|
1561
|
+
default: !0
|
|
1562
|
+
},
|
|
1563
|
+
headerTopSelector: {
|
|
1564
|
+
type: String,
|
|
1565
|
+
default: "#krds-masthead"
|
|
1566
|
+
},
|
|
1567
|
+
headerInnerSelector: {
|
|
1568
|
+
type: String,
|
|
1569
|
+
default: "#krds-header .header-in"
|
|
1570
|
+
},
|
|
1571
|
+
class: {
|
|
1572
|
+
type: String,
|
|
1573
|
+
default: void 0
|
|
1574
|
+
}
|
|
1575
|
+
},
|
|
1576
|
+
emits: ["itemClick"],
|
|
1577
|
+
slots: Object,
|
|
1578
|
+
setup(e, { emit: i, slots: s }) {
|
|
1579
|
+
const n = M(""), o = M(/* @__PURE__ */ new Map()), t = g(() => {
|
|
1580
|
+
const d = ["krds-in-page-navigation-type"];
|
|
1581
|
+
return e.class && d.push(e.class), d;
|
|
1582
|
+
}), a = () => {
|
|
1583
|
+
const d = e.headerTopSelector, l = e.headerInnerSelector, p = document.querySelector(d)?.clientHeight || 0, f = document.querySelector(l)?.clientHeight || 0;
|
|
1584
|
+
return p + f;
|
|
1585
|
+
}, u = (d, l) => {
|
|
1586
|
+
if (i("itemClick", d, l), d.href.startsWith("#")) {
|
|
1587
|
+
l.preventDefault();
|
|
1588
|
+
const p = document.querySelector(d.href);
|
|
1589
|
+
if (p) {
|
|
1590
|
+
const f = a();
|
|
1591
|
+
if (window.scrollTo({
|
|
1592
|
+
left: 0,
|
|
1593
|
+
top: p.getBoundingClientRect().top + window.scrollY - f,
|
|
1594
|
+
behavior: "smooth"
|
|
1595
|
+
}), n.value = d.href, l instanceof KeyboardEvent) {
|
|
1596
|
+
const b = p.querySelector(".sec-tit, h1, h2, h3, h4, h5, h6");
|
|
1597
|
+
b && b instanceof HTMLElement && (b.setAttribute("tabindex", "-1"), b.focus({ preventScroll: !0 }));
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
}, v = () => {
|
|
1602
|
+
o.value.clear(), e.items && e.items.filter((d) => d.href.startsWith("#")).forEach((d) => {
|
|
1603
|
+
const l = document.querySelector(d.href);
|
|
1604
|
+
l && o.value.set(d.href, l);
|
|
1605
|
+
});
|
|
1606
|
+
}, S = () => {
|
|
1607
|
+
if (!e.autoActive || !e.items || o.value.size === 0) return;
|
|
1608
|
+
const d = window.innerHeight, l = Math.ceil(d / 5), p = window.scrollY + d, f = document.body.scrollHeight, b = e.items.filter((z) => z.href.startsWith("#") && o.value.has(z.href)).map((z) => ({
|
|
1609
|
+
href: z.href,
|
|
1610
|
+
element: o.value.get(z.href),
|
|
1611
|
+
item: z
|
|
1612
|
+
}));
|
|
1613
|
+
if (b.length === 0) return;
|
|
1614
|
+
const K = b[0], O = b[b.length - 1], T = K.element.offsetTop;
|
|
1615
|
+
let P = "";
|
|
1616
|
+
if (p >= f)
|
|
1617
|
+
P = O.href;
|
|
1618
|
+
else if (window.scrollY <= T)
|
|
1619
|
+
P = K.href;
|
|
1620
|
+
else
|
|
1621
|
+
for (const z of b) {
|
|
1622
|
+
const H = z.element.offsetHeight, D = z.element.offsetTop - l;
|
|
1623
|
+
if (window.scrollY > D && window.scrollY <= D + H) {
|
|
1624
|
+
P = z.href;
|
|
1625
|
+
break;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
P && P !== n.value && (n.value = P);
|
|
1629
|
+
}, _ = () => {
|
|
1630
|
+
if (!e.items) return;
|
|
1631
|
+
const d = e.items.find((l) => l.active);
|
|
1632
|
+
d ? n.value = d.href : e.items.length > 0 && (n.value = e.items[0].href);
|
|
1633
|
+
};
|
|
1634
|
+
re(() => {
|
|
1635
|
+
if (_(), e.autoActive) {
|
|
1636
|
+
v(), S(), window.addEventListener("scroll", S, { passive: !0 });
|
|
1637
|
+
const d = new MutationObserver(() => {
|
|
1638
|
+
v();
|
|
1639
|
+
});
|
|
1640
|
+
d.observe(document.body, {
|
|
1641
|
+
childList: !0,
|
|
1642
|
+
subtree: !0
|
|
1643
|
+
}), ae(() => {
|
|
1644
|
+
d.disconnect();
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
}), ae(() => {
|
|
1648
|
+
e.autoActive && (window.removeEventListener("scroll", S), o.value.clear());
|
|
1649
|
+
});
|
|
1650
|
+
const V = () => !e.caption && !e.title ? null : r("div", { class: "in-page-navigation-header" }, [
|
|
1651
|
+
e.caption && r("p", { class: "quick-caption" }, e.caption),
|
|
1652
|
+
e.title && r("p", { class: "quick-title" }, e.title)
|
|
1653
|
+
]), y = () => {
|
|
1654
|
+
if (!e.items) return null;
|
|
1655
|
+
const d = e.items.map((l) => {
|
|
1656
|
+
const p = n.value === l.href || !e.autoActive && l.active;
|
|
1657
|
+
return r("li", { key: l.href }, [
|
|
1658
|
+
r(
|
|
1659
|
+
"a",
|
|
1660
|
+
{
|
|
1661
|
+
href: l.href,
|
|
1662
|
+
class: p ? "active" : "",
|
|
1663
|
+
onClick: (f) => u(l, f),
|
|
1664
|
+
onKeydown: (f) => {
|
|
1665
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), u(l, f));
|
|
1666
|
+
}
|
|
1667
|
+
},
|
|
1668
|
+
l.text
|
|
1669
|
+
)
|
|
1670
|
+
]);
|
|
1671
|
+
});
|
|
1672
|
+
return r("nav", { class: "in-page-navigation-list" }, [r("ul", {}, d)]);
|
|
1673
|
+
}, $ = () => s.action ? r("div", { class: "in-page-navigation-action" }, [s.action()]) : null;
|
|
1674
|
+
return () => r("div", { class: t.value }, [
|
|
1675
|
+
r("div", { class: "krds-in-page-navigation-area" }, [V(), y(), $()].filter(Boolean))
|
|
1676
|
+
]);
|
|
1677
|
+
}
|
|
1678
|
+
}), Kt = ["id"], xt = { class: "page-links" }, It = ["href", "aria-current", "onClick"], Vt = { key: 0 }, zt = ["aria-label"], Mt = /* @__PURE__ */ C({
|
|
1679
|
+
__name: "KrdsPagination",
|
|
1680
|
+
props: {
|
|
1681
|
+
modelValue: { default: 1 },
|
|
1682
|
+
min: { default: 1 },
|
|
1683
|
+
max: {},
|
|
1684
|
+
id: { default: void 0 },
|
|
1685
|
+
ariaLabel: { default: "페이지 내비게이션" },
|
|
1686
|
+
pageRange: { default: 8 }
|
|
1687
|
+
},
|
|
1688
|
+
emits: ["update:modelValue"],
|
|
1689
|
+
setup(e, { emit: i }) {
|
|
1690
|
+
const s = e, n = i, o = g(() => Math.max(1, s.min)), t = g(() => s.modelValue ?? o.value), a = g(() => t.value <= o.value), u = g(() => t.value >= s.max), v = g(() => {
|
|
1691
|
+
if (!a.value)
|
|
1692
|
+
return "#";
|
|
1693
|
+
}), S = g(() => {
|
|
1694
|
+
if (!u.value)
|
|
1695
|
+
return "#";
|
|
1696
|
+
}), _ = g(() => {
|
|
1697
|
+
const { pageRange: d, max: l } = s, p = 1, f = [];
|
|
1698
|
+
if (l <= d + 2 * p)
|
|
1699
|
+
for (let b = o.value; b <= l; b++)
|
|
1700
|
+
f.push({
|
|
1701
|
+
type: "page",
|
|
1702
|
+
key: `page-${b}`,
|
|
1703
|
+
page: b,
|
|
1704
|
+
href: "#"
|
|
1705
|
+
});
|
|
1706
|
+
else {
|
|
1707
|
+
const b = Math.min(p, l), K = Math.max(l - p + 1, 1), O = Math.max(o.value, t.value - Math.floor(d / 2)), T = Math.min(l, O + d - 1), P = Math.max(o.value, T - d + 1);
|
|
1708
|
+
for (let D = o.value; D <= b; D++)
|
|
1709
|
+
f.push({
|
|
1710
|
+
type: "page",
|
|
1711
|
+
key: `page-${D}`,
|
|
1712
|
+
page: D,
|
|
1713
|
+
href: "#"
|
|
1714
|
+
});
|
|
1715
|
+
P > b + 1 && f.push({
|
|
1716
|
+
type: "ellipsis",
|
|
1717
|
+
key: "ellipsis-left",
|
|
1718
|
+
ariaLabel: "페이지 생략"
|
|
1719
|
+
});
|
|
1720
|
+
const z = Math.max(P, b + 1), H = Math.min(T, K - 1);
|
|
1721
|
+
for (let D = z; D <= H; D++)
|
|
1722
|
+
f.push({
|
|
1723
|
+
type: "page",
|
|
1724
|
+
key: `page-${D}`,
|
|
1725
|
+
page: D,
|
|
1726
|
+
href: "#"
|
|
1727
|
+
});
|
|
1728
|
+
T < K - 1 && f.push({
|
|
1729
|
+
type: "ellipsis",
|
|
1730
|
+
key: "ellipsis-right",
|
|
1731
|
+
ariaLabel: "페이지 생략"
|
|
1732
|
+
});
|
|
1733
|
+
for (let D = K; D <= l; D++)
|
|
1734
|
+
f.push({
|
|
1735
|
+
type: "page",
|
|
1736
|
+
key: `page-${D}`,
|
|
1737
|
+
page: D,
|
|
1738
|
+
href: "#"
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
return f;
|
|
1742
|
+
}), V = (d, l) => {
|
|
1743
|
+
if (d === t.value) {
|
|
1744
|
+
l.preventDefault();
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1747
|
+
n("update:modelValue", d);
|
|
1748
|
+
}, y = (d) => {
|
|
1749
|
+
if (a.value) {
|
|
1750
|
+
d.preventDefault();
|
|
1751
|
+
return;
|
|
1752
|
+
}
|
|
1753
|
+
const l = t.value - 1;
|
|
1754
|
+
n("update:modelValue", l);
|
|
1755
|
+
}, $ = (d) => {
|
|
1756
|
+
if (u.value) {
|
|
1757
|
+
d.preventDefault();
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
const l = t.value + 1;
|
|
1761
|
+
n("update:modelValue", l);
|
|
1762
|
+
};
|
|
1763
|
+
return (d, l) => {
|
|
1764
|
+
const p = xe("sr-only");
|
|
1765
|
+
return w(), B("div", {
|
|
1766
|
+
id: d.id,
|
|
1767
|
+
class: "krds-pagination"
|
|
1768
|
+
}, [
|
|
1769
|
+
(w(), W(le(a.value ? "span" : "a"), {
|
|
1770
|
+
href: a.value ? void 0 : v.value,
|
|
1771
|
+
class: L(["page-navi", "prev", { disabled: a.value }]),
|
|
1772
|
+
onClick: y
|
|
1773
|
+
}, {
|
|
1774
|
+
default: U(() => [...l[0] || (l[0] = [
|
|
1775
|
+
R(" 이전 ", -1)
|
|
1776
|
+
])]),
|
|
1777
|
+
_: 1
|
|
1778
|
+
}, 8, ["href", "class"])),
|
|
1779
|
+
h("div", xt, [
|
|
1780
|
+
(w(!0), B(E, null, F(_.value, (f) => (w(), B(E, {
|
|
1781
|
+
key: f.key
|
|
1782
|
+
}, [
|
|
1783
|
+
f.type === "page" ? (w(), B("a", {
|
|
1784
|
+
key: 0,
|
|
1785
|
+
href: f.href || "#",
|
|
1786
|
+
class: L(["page-link", { active: f.page === t.value }]),
|
|
1787
|
+
"aria-current": f.page === t.value ? "page" : void 0,
|
|
1788
|
+
onClick: (b) => V(f.page, b)
|
|
1789
|
+
}, [
|
|
1790
|
+
f.page === t.value ? Y((w(), B("span", Vt, [...l[1] || (l[1] = [
|
|
1791
|
+
R("현재페이지", -1)
|
|
1792
|
+
])])), [
|
|
1793
|
+
[p]
|
|
1794
|
+
]) : J("", !0),
|
|
1795
|
+
R(" " + N(f.page), 1)
|
|
1796
|
+
], 10, It)) : f.type === "ellipsis" ? (w(), B("span", {
|
|
1797
|
+
key: 1,
|
|
1798
|
+
class: "page-link link-dot",
|
|
1799
|
+
"aria-label": f.ariaLabel
|
|
1800
|
+
}, null, 8, zt)) : J("", !0)
|
|
1801
|
+
], 64))), 128))
|
|
1802
|
+
]),
|
|
1803
|
+
(w(), W(le(u.value ? "span" : "a"), {
|
|
1804
|
+
href: u.value ? void 0 : S.value,
|
|
1805
|
+
class: L(["page-navi", "next", { disabled: u.value }]),
|
|
1806
|
+
onClick: $
|
|
1807
|
+
}, {
|
|
1808
|
+
default: U(() => [...l[2] || (l[2] = [
|
|
1809
|
+
R(" 다음 ", -1)
|
|
1810
|
+
])]),
|
|
1811
|
+
_: 1
|
|
1812
|
+
}, 8, ["href", "class"]))
|
|
1813
|
+
], 8, Kt);
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
}), ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1817
|
+
__proto__: null,
|
|
1818
|
+
KrdsBadge: dt,
|
|
1819
|
+
KrdsBreadcrumb: Bt,
|
|
1820
|
+
KrdsButton: oe,
|
|
1821
|
+
KrdsButtonGroup: Ie,
|
|
1822
|
+
KrdsCheckArea: yt,
|
|
1823
|
+
KrdsCheckbox: pt,
|
|
1824
|
+
KrdsDateInput: rt,
|
|
1825
|
+
KrdsFileUpload: ut,
|
|
1826
|
+
KrdsFormGroup: Le,
|
|
1827
|
+
KrdsFormHint: Pe,
|
|
1828
|
+
KrdsFormLabel: $e,
|
|
1829
|
+
KrdsIcon: Ve,
|
|
1830
|
+
KrdsInPageNavigation: Dt,
|
|
1831
|
+
KrdsInput: Me,
|
|
1832
|
+
KrdsLink: ze,
|
|
1833
|
+
KrdsMasthead: vt,
|
|
1834
|
+
KrdsPagination: Mt,
|
|
1835
|
+
KrdsSkipLink: kt,
|
|
1836
|
+
KrdsSpinner: ue,
|
|
1837
|
+
KrdsStep: bt,
|
|
1838
|
+
KrdsStepIndicator: mt,
|
|
1839
|
+
KrdsTag: ct,
|
|
1840
|
+
KrdsTagGroup: ft,
|
|
1841
|
+
KrdsTextarea: ot,
|
|
1842
|
+
KrdsToggleSwitch: gt
|
|
1843
|
+
}, Symbol.toStringTag, { value: "Module" })), Q = {
|
|
1844
|
+
mounted(e, i) {
|
|
1845
|
+
i.value !== !1 && e.classList.add("sr-only");
|
|
1846
|
+
},
|
|
1847
|
+
updated(e, i) {
|
|
1848
|
+
i.value === !1 ? e.classList.remove("sr-only") : e.classList.add("sr-only");
|
|
1849
|
+
},
|
|
1850
|
+
unmounted(e) {
|
|
1851
|
+
e.classList.remove("sr-only");
|
|
1852
|
+
}
|
|
1853
|
+
}, se = {
|
|
1854
|
+
"sr-only": Q
|
|
1855
|
+
}, fe = (e) => {
|
|
1856
|
+
e.directive("sr-only", Q);
|
|
1857
|
+
}, ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1362
1858
|
__proto__: null,
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
KrdsLink: ke,
|
|
1376
|
-
KrdsMasthead: at,
|
|
1377
|
-
KrdsTag: et,
|
|
1378
|
-
KrdsTagGroup: tt,
|
|
1379
|
-
KrdsTextarea: Qe,
|
|
1380
|
-
KrdsToggleSwitch: nt
|
|
1381
|
-
}, Symbol.toStringTag, { value: "Module" })), it = {
|
|
1382
|
-
install(e, s = {}) {
|
|
1383
|
-
e.provide("krds:config", s);
|
|
1384
|
-
const a = s.components || Object.keys(H);
|
|
1385
|
-
a.forEach((l) => {
|
|
1386
|
-
const i = H[l];
|
|
1387
|
-
i && e.component(l, i);
|
|
1388
|
-
}), e.config.globalProperties.$krds = {
|
|
1859
|
+
default: se,
|
|
1860
|
+
directives: se,
|
|
1861
|
+
installDirectives: fe,
|
|
1862
|
+
vSrOnly: Q
|
|
1863
|
+
}, Symbol.toStringTag, { value: "Module" })), Pt = {
|
|
1864
|
+
install(e, i = {}) {
|
|
1865
|
+
e.provide("krds:config", i);
|
|
1866
|
+
const s = i.components || Object.keys(ne);
|
|
1867
|
+
s.forEach((n) => {
|
|
1868
|
+
const o = ne[n];
|
|
1869
|
+
o && e.component(n, o);
|
|
1870
|
+
}), typeof ie == "object" && ie !== null && fe(e), e.config.globalProperties.$krds = {
|
|
1389
1871
|
version: "__VERSION__"
|
|
1390
|
-
}, process.env.NODE_ENV !== "production" && console.log(`[KRDS Vue] v__VERSION__ 설치 완료 - 컴포넌트: ${
|
|
1872
|
+
}, process.env.NODE_ENV !== "production" && console.log(`[KRDS Vue] v__VERSION__ 설치 완료 - 컴포넌트: ${s.length}개`);
|
|
1391
1873
|
}
|
|
1392
|
-
},
|
|
1874
|
+
}, Lt = "__VERSION__";
|
|
1393
1875
|
export {
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1876
|
+
dt as KrdsBadge,
|
|
1877
|
+
Bt as KrdsBreadcrumb,
|
|
1878
|
+
oe as KrdsButton,
|
|
1879
|
+
Ie as KrdsButtonGroup,
|
|
1880
|
+
yt as KrdsCheckArea,
|
|
1881
|
+
pt as KrdsCheckbox,
|
|
1882
|
+
rt as KrdsDateInput,
|
|
1883
|
+
ut as KrdsFileUpload,
|
|
1884
|
+
Le as KrdsFormGroup,
|
|
1885
|
+
Pe as KrdsFormHint,
|
|
1886
|
+
$e as KrdsFormLabel,
|
|
1887
|
+
Ve as KrdsIcon,
|
|
1888
|
+
Dt as KrdsInPageNavigation,
|
|
1889
|
+
Me as KrdsInput,
|
|
1890
|
+
ze as KrdsLink,
|
|
1891
|
+
vt as KrdsMasthead,
|
|
1892
|
+
Mt as KrdsPagination,
|
|
1893
|
+
kt as KrdsSkipLink,
|
|
1894
|
+
ue as KrdsSpinner,
|
|
1895
|
+
bt as KrdsStep,
|
|
1896
|
+
mt as KrdsStepIndicator,
|
|
1897
|
+
ct as KrdsTag,
|
|
1898
|
+
ft as KrdsTagGroup,
|
|
1899
|
+
ot as KrdsTextarea,
|
|
1900
|
+
gt as KrdsToggleSwitch,
|
|
1901
|
+
ce as classNames,
|
|
1902
|
+
Pt as default,
|
|
1903
|
+
de as generateId,
|
|
1904
|
+
Lt as version
|
|
1416
1905
|
};
|
|
1417
1906
|
//# sourceMappingURL=krds-vue.es.js.map
|