@sellmate/design-system 1.19.0 → 1.20.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/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-badge.cjs.entry.js +1 -1
- package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
- package/dist/cjs/sd-calendar_2.cjs.entry.js +5 -5
- package/dist/cjs/sd-callout.cjs.entry.js +1 -1
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-chip-input.cjs.entry.js +2 -2
- package/dist/cjs/sd-chip.cjs.entry.js +1 -1
- package/dist/cjs/sd-circle-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-picker_7.cjs.entry.js +9 -9
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +1 -1
- package/dist/cjs/sd-divider.cjs.entry.js +1 -1
- package/dist/cjs/sd-field_3.cjs.entry.js +8 -8
- package/dist/cjs/{sd-ghost-button_2.cjs.entry.js → sd-ghost-button_3.cjs.entry.js} +264 -10
- package/dist/cjs/sd-key-value-table.cjs.entry.js +4 -4
- package/dist/cjs/sd-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-loading-container.cjs.entry.js +2 -2
- package/dist/cjs/sd-pagination_4.cjs.entry.js +8 -8
- package/dist/cjs/sd-popup.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-list-item_2.cjs.entry.js +6 -6
- package/dist/cjs/sd-select_3.cjs.entry.js +8 -8
- package/dist/cjs/sd-switch.cjs.entry.js +1 -1
- package/dist/cjs/sd-table.cjs.entry.js +8 -8
- package/dist/cjs/sd-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sd-td.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast.cjs.entry.js +2 -2
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/collection/components/sd-badge/sd-badge.js +1 -1
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +1 -1
- package/dist/collection/components/sd-calendar/sd-calendar.js +3 -3
- package/dist/collection/components/sd-callout/sd-callout.js +1 -1
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-chip/sd-chip.js +1 -1
- package/dist/collection/components/sd-chip-input/sd-chip-input.js +2 -2
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +1 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +2 -2
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
- package/dist/collection/components/sd-divider/sd-divider.js +1 -1
- package/dist/collection/components/sd-field/sd-field.js +5 -5
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.css +2 -17
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +21 -12
- package/dist/collection/components/sd-input/sd-input.js +2 -2
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.css +2 -2
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.js +6 -6
- package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
- package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
- package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
- package/dist/collection/components/sd-popup/sd-popup.js +1 -1
- package/dist/collection/components/sd-portal/sd-portal.js +34 -3
- package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
- package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
- package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
- package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
- package/dist/collection/components/sd-select/sd-select.js +4 -4
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.css +1 -1
- package/dist/collection/components/sd-table/sd-table.js +9 -9
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +2 -2
- package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
- package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
- package/dist/collection/components/sd-tag/sd-tag.js +2 -2
- package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
- package/dist/collection/components/sd-toast/sd-toast.js +2 -2
- package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/components/{p-CH6cVc2a.js → p-5GcM22aW.js} +1 -1
- package/dist/components/p-B7PHGGFH.js +1 -0
- package/dist/components/{p-DMS9mQsg.js → p-BHW1fnDC.js} +1 -1
- package/dist/components/{p-B3SKaQId.js → p-BZjIn1hr.js} +1 -1
- package/dist/components/{p-CzCu_NDl.js → p-Bd-fDbVE.js} +1 -1
- package/dist/components/p-BeYMZ1fR.js +1 -0
- package/dist/components/{p-79DExV92.js → p-BuFzlA0M.js} +1 -1
- package/dist/components/{p-CQWZv8vY.js → p-BzUU-npj.js} +1 -1
- package/dist/components/p-CEhI4kUA.js +1 -0
- package/dist/components/{p-4HPAPKne.js → p-CQozoo2-.js} +1 -1
- package/dist/components/p-Cfko62rU.js +1 -0
- package/dist/components/{p-hzCGj0On.js → p-ChncPmp-.js} +1 -1
- package/dist/components/p-CiEAVQT4.js +1 -0
- package/dist/components/p-CjYYBlrZ.js +1 -0
- package/dist/components/p-CvSqieCH.js +1 -0
- package/dist/components/p-DAJIg-VD.js +1 -0
- package/dist/components/p-DRgPF0Fp.js +1 -0
- package/dist/components/p-DYOyb7rq.js +1 -0
- package/dist/components/{p-BD8OoYud.js → p-DaMzYzXI.js} +1 -1
- package/dist/components/{p-BMIgVp9-.js → p-De7UsPPk.js} +1 -1
- package/dist/components/p-Df1g_kVH.js +1 -0
- package/dist/components/p-DpfXh55-.js +1 -0
- package/dist/components/{p-B_5uwji5.js → p-E5buAge1.js} +1 -1
- package/dist/components/{p-BLNc_TL-.js → p-P2jWtk8J.js} +1 -1
- package/dist/components/{p-C_r3z9VA.js → p-lmVlfugh.js} +1 -1
- package/dist/components/p-nruUh8p1.js +1 -0
- package/dist/components/p-pSthmtsz.js +1 -0
- package/dist/components/p-vTnMooAF.js +1 -0
- package/dist/components/sd-action-modal.js +1 -1
- package/dist/components/sd-badge.js +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-calendar.js +1 -1
- package/dist/components/sd-callout.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-chip-input.js +1 -1
- package/dist/components/sd-chip.js +1 -1
- package/dist/components/sd-circle-progress.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-picker-trigger.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker-calendar.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-divider.js +1 -1
- package/dist/components/sd-dropdown-button.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-file-picker.js +1 -1
- package/dist/components/sd-floating-portal.js +1 -1
- package/dist/components/sd-ghost-button.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-key-value-table.js +1 -1
- package/dist/components/sd-linear-progress.js +1 -1
- package/dist/components/sd-loading-container.js +1 -1
- package/dist/components/sd-loading-modal.js +1 -1
- package/dist/components/sd-modal-container.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/sd-popup.js +1 -1
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-select-list-item-search.js +1 -1
- package/dist/components/sd-select-list-item.js +1 -1
- package/dist/components/sd-select-listbox.js +1 -1
- package/dist/components/sd-select-trigger.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-switch.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tabs.js +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.js +1 -1
- package/dist/components/sd-toast-container.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-80bde621.entry.js → p-08343698.entry.js} +1 -1
- package/dist/design-system/{p-bbbc4b27.entry.js → p-2151e081.entry.js} +1 -1
- package/dist/design-system/p-316b8a08.entry.js +1 -0
- package/dist/design-system/{p-f5190934.entry.js → p-4acfc5f9.entry.js} +1 -1
- package/dist/design-system/{p-22484d65.entry.js → p-5039241c.entry.js} +1 -1
- package/dist/design-system/p-52f551a1.entry.js +1 -0
- package/dist/design-system/{p-d726d8e7.entry.js → p-54853a2b.entry.js} +1 -1
- package/dist/design-system/p-5eaa12af.entry.js +1 -0
- package/dist/design-system/{p-827f067b.entry.js → p-646a7830.entry.js} +1 -1
- package/dist/design-system/{p-9d35b674.entry.js → p-717eba5f.entry.js} +1 -1
- package/dist/design-system/{p-8f90620b.entry.js → p-9289eb14.entry.js} +1 -1
- package/dist/design-system/{p-b4b20a86.entry.js → p-98e0b332.entry.js} +1 -1
- package/dist/design-system/{p-9124a1af.entry.js → p-9c38ee79.entry.js} +1 -1
- package/dist/design-system/{p-c318b762.entry.js → p-a4331364.entry.js} +1 -1
- package/dist/design-system/{p-683c3b91.entry.js → p-a5a586da.entry.js} +1 -1
- package/dist/design-system/{p-1602a5fa.entry.js → p-aa1c6202.entry.js} +1 -1
- package/dist/design-system/{p-8a84a4fe.entry.js → p-ae344950.entry.js} +1 -1
- package/dist/design-system/{p-4b15247b.entry.js → p-b291baab.entry.js} +1 -1
- package/dist/design-system/{p-e93dda25.entry.js → p-b63b8df9.entry.js} +1 -1
- package/dist/design-system/{p-3caf2c5b.entry.js → p-bdb7492c.entry.js} +1 -1
- package/dist/design-system/{p-cc5f5bff.entry.js → p-c47198fc.entry.js} +1 -1
- package/dist/design-system/{p-4b626171.entry.js → p-c995e6c3.entry.js} +1 -1
- package/dist/design-system/{p-9095aab6.entry.js → p-cb80327c.entry.js} +1 -1
- package/dist/design-system/{p-7ed5aed5.entry.js → p-ccf1a3fc.entry.js} +1 -1
- package/dist/design-system/{p-4e1d76b8.entry.js → p-df7c721d.entry.js} +1 -1
- package/dist/design-system/p-e3990243.entry.js +1 -0
- package/dist/design-system/{p-81aa23d1.entry.js → p-e9d1dbb5.entry.js} +1 -1
- package/dist/design-system/p-faf7b64c.entry.js +1 -0
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sd-badge.entry.js +1 -1
- package/dist/esm/sd-barcode-input.entry.js +1 -1
- package/dist/esm/sd-calendar_2.entry.js +5 -5
- package/dist/esm/sd-callout.entry.js +1 -1
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-chip-input.entry.js +2 -2
- package/dist/esm/sd-chip.entry.js +1 -1
- package/dist/esm/sd-circle-progress.entry.js +1 -1
- package/dist/esm/sd-confirm-modal_2.entry.js +3 -3
- package/dist/esm/sd-date-picker_7.entry.js +9 -9
- package/dist/esm/sd-date-range-picker-calendar.entry.js +1 -1
- package/dist/esm/sd-divider.entry.js +1 -1
- package/dist/esm/sd-field_3.entry.js +8 -8
- package/dist/esm/{sd-ghost-button_2.entry.js → sd-ghost-button_3.entry.js} +265 -12
- package/dist/esm/sd-key-value-table.entry.js +4 -4
- package/dist/esm/sd-linear-progress.entry.js +1 -1
- package/dist/esm/sd-loading-container.entry.js +2 -2
- package/dist/esm/sd-pagination_4.entry.js +8 -8
- package/dist/esm/sd-popup.entry.js +1 -1
- package/dist/esm/sd-select-list-item_2.entry.js +6 -6
- package/dist/esm/sd-select_3.entry.js +8 -8
- package/dist/esm/sd-switch.entry.js +1 -1
- package/dist/esm/sd-table.entry.js +8 -8
- package/dist/esm/sd-tabs.entry.js +1 -1
- package/dist/esm/sd-td.entry.js +1 -1
- package/dist/esm/sd-toast-container.entry.js +1 -1
- package/dist/esm/sd-toast.entry.js +2 -2
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/types/components/sd-ghost-button/sd-ghost-button.d.ts +7 -1
- package/dist/types/components/sd-key-value-table/sd-key-value-table.d.ts +2 -2
- package/dist/types/components/sd-portal/sd-portal.d.ts +1 -0
- package/dist/types/components/sd-table/sd-table.d.ts +1 -1
- package/dist/types/components.d.ts +20 -17
- package/hydrate/index.js +113 -96
- package/hydrate/index.mjs +113 -96
- package/package.json +1 -1
- package/dist/cjs/sd-portal.cjs.entry.js +0 -243
- package/dist/components/p-AI4YlQmL.js +0 -1
- package/dist/components/p-B-4ulKJj.js +0 -1
- package/dist/components/p-BX5uKVOt.js +0 -1
- package/dist/components/p-BYTrIk62.js +0 -1
- package/dist/components/p-Bzo51vnP.js +0 -1
- package/dist/components/p-C0tkFuhj.js +0 -1
- package/dist/components/p-C3wv8gVC.js +0 -1
- package/dist/components/p-CXRFEcE_.js +0 -1
- package/dist/components/p-Cl5io5TH.js +0 -1
- package/dist/components/p-DAOeioSV.js +0 -1
- package/dist/components/p-DTFXzlvq.js +0 -1
- package/dist/components/p-Dr5Q2ZKB.js +0 -1
- package/dist/components/p-DyVh4pNL.js +0 -1
- package/dist/components/p-Ng3JMPxb.js +0 -1
- package/dist/components/p-qJeUUOyB.js +0 -1
- package/dist/design-system/p-12306783.entry.js +0 -1
- package/dist/design-system/p-43529bba.entry.js +0 -1
- package/dist/design-system/p-46da89f2.entry.js +0 -1
- package/dist/design-system/p-8a025f91.entry.js +0 -1
- package/dist/design-system/p-a263af1b.entry.js +0 -1
- package/dist/design-system/p-a532d998.entry.js +0 -1
- package/dist/esm/sd-portal.entry.js +0 -241
package/package.json
CHANGED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-DXm0PH2A.js');
|
|
4
|
-
|
|
5
|
-
const SdPortal = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
index.registerInstance(this, hostRef);
|
|
8
|
-
this.close = index.createEvent(this, "sdClose", 3);
|
|
9
|
-
}
|
|
10
|
-
get hostEl() { return index.getElement(this); }
|
|
11
|
-
to = 'body';
|
|
12
|
-
parentRef = null;
|
|
13
|
-
offset = [0, 4];
|
|
14
|
-
viewportPadding = 0;
|
|
15
|
-
zIndex = 998;
|
|
16
|
-
open = false;
|
|
17
|
-
close;
|
|
18
|
-
container;
|
|
19
|
-
wrapper;
|
|
20
|
-
rafId;
|
|
21
|
-
isInsideClick = false;
|
|
22
|
-
closeTransitionTimer;
|
|
23
|
-
handleObservedScroll = () => this.updatePosition();
|
|
24
|
-
resizeObserver;
|
|
25
|
-
mutationObserver;
|
|
26
|
-
scrollParents = [];
|
|
27
|
-
isObserved = false;
|
|
28
|
-
handleOpenChange() {
|
|
29
|
-
this.syncPortalState();
|
|
30
|
-
}
|
|
31
|
-
componentDidLoad() {
|
|
32
|
-
this.container = this.resolveContainer();
|
|
33
|
-
this.syncPortalState();
|
|
34
|
-
}
|
|
35
|
-
componentDidRender() {
|
|
36
|
-
this.syncPortalState();
|
|
37
|
-
}
|
|
38
|
-
disconnectedCallback() {
|
|
39
|
-
if (this.closeTransitionTimer)
|
|
40
|
-
clearTimeout(this.closeTransitionTimer);
|
|
41
|
-
this.unobserveParent();
|
|
42
|
-
if (this.wrapper?.parentNode) {
|
|
43
|
-
try {
|
|
44
|
-
this.wrapper.parentNode.removeChild(this.wrapper);
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
// Stencil spec mock DOM can already detach the wrapper before this callback runs.
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
resolveContainer() {
|
|
52
|
-
const el = typeof this.to === 'string' ? document.querySelector(this.to) : this.to;
|
|
53
|
-
return el instanceof HTMLElement ? el : document.body;
|
|
54
|
-
}
|
|
55
|
-
createWrapper() {
|
|
56
|
-
this.wrapper = document.createElement('div');
|
|
57
|
-
Object.assign(this.wrapper.style, {
|
|
58
|
-
position: 'fixed',
|
|
59
|
-
top: '0',
|
|
60
|
-
left: '0',
|
|
61
|
-
zIndex: (this.zIndex ?? 998).toString(),
|
|
62
|
-
opacity: '0',
|
|
63
|
-
transition: 'opacity 0.15s ease-out',
|
|
64
|
-
boxSizing: 'border-box',
|
|
65
|
-
visibility: 'hidden',
|
|
66
|
-
});
|
|
67
|
-
this.container.appendChild(this.wrapper);
|
|
68
|
-
}
|
|
69
|
-
ensureWrapper() {
|
|
70
|
-
if (this.wrapper)
|
|
71
|
-
return;
|
|
72
|
-
this.container ||= this.resolveContainer();
|
|
73
|
-
this.createWrapper();
|
|
74
|
-
this.moveSlotContent();
|
|
75
|
-
}
|
|
76
|
-
syncPortalState() {
|
|
77
|
-
if (!this.open) {
|
|
78
|
-
if (this.wrapper) {
|
|
79
|
-
this.wrapper.style.transition = 'opacity 0.15s ease-out';
|
|
80
|
-
this.wrapper.style.opacity = '0';
|
|
81
|
-
this.wrapper.style.pointerEvents = 'none';
|
|
82
|
-
if (this.closeTransitionTimer)
|
|
83
|
-
clearTimeout(this.closeTransitionTimer);
|
|
84
|
-
this.closeTransitionTimer = setTimeout(() => {
|
|
85
|
-
if (this.wrapper && !this.open) {
|
|
86
|
-
this.wrapper.style.display = 'none';
|
|
87
|
-
}
|
|
88
|
-
}, 150);
|
|
89
|
-
}
|
|
90
|
-
this.unobserveParent();
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (this.closeTransitionTimer)
|
|
94
|
-
clearTimeout(this.closeTransitionTimer);
|
|
95
|
-
this.ensureWrapper();
|
|
96
|
-
if (!this.wrapper)
|
|
97
|
-
return;
|
|
98
|
-
this.wrapper.style.display = 'block';
|
|
99
|
-
this.wrapper.style.transition = 'opacity 0.25s ease-out';
|
|
100
|
-
this.wrapper.style.opacity = '0';
|
|
101
|
-
this.wrapper.style.pointerEvents = '';
|
|
102
|
-
this.observeParent();
|
|
103
|
-
this.updatePosition();
|
|
104
|
-
}
|
|
105
|
-
moveSlotContent() {
|
|
106
|
-
if (!this.wrapper)
|
|
107
|
-
return;
|
|
108
|
-
const nodes = Array.from(this.hostEl.childNodes).filter(n => n.nodeType !== Node.COMMENT_NODE);
|
|
109
|
-
nodes.forEach(n => this.wrapper.appendChild(n));
|
|
110
|
-
}
|
|
111
|
-
// 위치 갱신 (scroll / resize)
|
|
112
|
-
updatePosition() {
|
|
113
|
-
if (this.rafId !== undefined)
|
|
114
|
-
cancelAnimationFrame(this.rafId);
|
|
115
|
-
this.rafId = requestAnimationFrame(() => {
|
|
116
|
-
if (!this.parentRef || !this.wrapper)
|
|
117
|
-
return;
|
|
118
|
-
const parentRect = this.parentRef.getBoundingClientRect();
|
|
119
|
-
const viewport = {
|
|
120
|
-
width: window.innerWidth,
|
|
121
|
-
height: window.innerHeight,
|
|
122
|
-
};
|
|
123
|
-
const offset = this.offset ?? [0, 4];
|
|
124
|
-
const viewportPadding = Math.max(0, this.viewportPadding ?? 0);
|
|
125
|
-
const maxWidth = Math.max(viewport.width - viewportPadding * 2, 0);
|
|
126
|
-
const maxHeight = Math.max(viewport.height - viewportPadding * 2, 0);
|
|
127
|
-
this.wrapper.style.maxWidth = `${maxWidth}px`;
|
|
128
|
-
this.wrapper.style.maxHeight = `${maxHeight}px`;
|
|
129
|
-
const wrapperRect = this.wrapper.getBoundingClientRect();
|
|
130
|
-
const availableBelow = viewport.height - parentRect.bottom - offset[1] - viewportPadding;
|
|
131
|
-
const availableAbove = parentRect.top - offset[1] - viewportPadding;
|
|
132
|
-
let top = parentRect.bottom + offset[1];
|
|
133
|
-
let left = parentRect.left + offset[0];
|
|
134
|
-
if (availableBelow < wrapperRect.height && availableAbove > availableBelow) {
|
|
135
|
-
top = parentRect.top - wrapperRect.height - offset[1];
|
|
136
|
-
}
|
|
137
|
-
const minTop = viewportPadding;
|
|
138
|
-
const maxTop = viewport.height - viewportPadding - wrapperRect.height;
|
|
139
|
-
if (maxTop < minTop) {
|
|
140
|
-
top = minTop;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
top = Math.min(Math.max(top, minTop), maxTop);
|
|
144
|
-
}
|
|
145
|
-
if (parentRect.left + wrapperRect.width + offset[0] > viewport.width - viewportPadding) {
|
|
146
|
-
left = parentRect.right - wrapperRect.width - offset[0];
|
|
147
|
-
}
|
|
148
|
-
const minLeft = viewportPadding;
|
|
149
|
-
const maxLeft = viewport.width - viewportPadding - wrapperRect.width;
|
|
150
|
-
if (maxLeft < minLeft) {
|
|
151
|
-
left = minLeft;
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
left = Math.min(Math.max(left, minLeft), maxLeft);
|
|
155
|
-
}
|
|
156
|
-
this.wrapper.style.top = `${top}px`;
|
|
157
|
-
this.wrapper.style.left = `${left}px`;
|
|
158
|
-
this.wrapper.style.visibility = 'visible';
|
|
159
|
-
this.wrapper.style.opacity = '1';
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
// parentRef의 이동 / 크기변경 감지
|
|
163
|
-
observeParent() {
|
|
164
|
-
if (!this.parentRef || this.isObserved)
|
|
165
|
-
return;
|
|
166
|
-
this.observeScrollParents(this.parentRef);
|
|
167
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
168
|
-
this.resizeObserver = new ResizeObserver(() => this.updatePosition());
|
|
169
|
-
this.resizeObserver.observe(this.parentRef);
|
|
170
|
-
}
|
|
171
|
-
if (typeof MutationObserver !== 'undefined') {
|
|
172
|
-
this.mutationObserver = new MutationObserver(() => this.updatePosition());
|
|
173
|
-
this.mutationObserver.observe(document.body, {
|
|
174
|
-
childList: true,
|
|
175
|
-
subtree: true,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
this.isObserved = true;
|
|
179
|
-
}
|
|
180
|
-
unobserveParent() {
|
|
181
|
-
if (!this.isObserved)
|
|
182
|
-
return;
|
|
183
|
-
this.unobserveScrollParents();
|
|
184
|
-
this.resizeObserver?.disconnect();
|
|
185
|
-
this.resizeObserver = undefined;
|
|
186
|
-
this.mutationObserver?.disconnect();
|
|
187
|
-
this.mutationObserver = undefined;
|
|
188
|
-
this.isObserved = false;
|
|
189
|
-
}
|
|
190
|
-
observeScrollParents(element) {
|
|
191
|
-
const nextScrollParents = this.getScrollParents(element);
|
|
192
|
-
nextScrollParents.forEach(parent => {
|
|
193
|
-
parent.addEventListener('scroll', this.handleObservedScroll, { passive: true });
|
|
194
|
-
});
|
|
195
|
-
this.scrollParents = nextScrollParents;
|
|
196
|
-
}
|
|
197
|
-
unobserveScrollParents() {
|
|
198
|
-
this.scrollParents.forEach(parent => {
|
|
199
|
-
parent.removeEventListener('scroll', this.handleObservedScroll);
|
|
200
|
-
});
|
|
201
|
-
this.scrollParents = [];
|
|
202
|
-
}
|
|
203
|
-
getScrollParents(element) {
|
|
204
|
-
const scrollParents = [];
|
|
205
|
-
let currentElement = element.parentElement;
|
|
206
|
-
while (currentElement) {
|
|
207
|
-
const { overflow, overflowX, overflowY } = getComputedStyle(currentElement);
|
|
208
|
-
const isScrollable = [overflow, overflowX, overflowY].some(value => /(auto|scroll|overlay)/.test(value));
|
|
209
|
-
if (isScrollable) {
|
|
210
|
-
scrollParents.push(currentElement);
|
|
211
|
-
}
|
|
212
|
-
currentElement = currentElement.parentElement;
|
|
213
|
-
}
|
|
214
|
-
return scrollParents;
|
|
215
|
-
}
|
|
216
|
-
isInsideTarget(target) {
|
|
217
|
-
return !!((this.wrapper?.contains(target)) ||
|
|
218
|
-
(this.parentRef?.contains(target)));
|
|
219
|
-
}
|
|
220
|
-
// 외부 클릭 감지
|
|
221
|
-
handleMouseDown(e) {
|
|
222
|
-
this.isInsideClick = this.isInsideTarget(e.target);
|
|
223
|
-
}
|
|
224
|
-
handleWindowClick(e) {
|
|
225
|
-
if (this.isInsideClick) {
|
|
226
|
-
this.isInsideClick = false;
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
if (this.isInsideTarget(e.target))
|
|
230
|
-
return;
|
|
231
|
-
this.close.emit();
|
|
232
|
-
}
|
|
233
|
-
render() {
|
|
234
|
-
return index.h("slot", { key: '22e09896836d017f33a9c6b92772a00fc85f8997' });
|
|
235
|
-
}
|
|
236
|
-
static get watchers() { return {
|
|
237
|
-
"open": [{
|
|
238
|
-
"handleOpenChange": 0
|
|
239
|
-
}]
|
|
240
|
-
}; }
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
exports.sd_portal = SdPortal;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as i,t as n}from"./p-Bg9XySrz.js";import{n as r}from"./p-CCwNgVmC.js";import{f as d}from"./p-BOJJ_sQS.js";import{d as u}from"./p-DDR0VcRU.js";import{d as a}from"./p-BX5uKVOt.js";import{d as o}from"./p-BLNc_TL-.js";import{d as l}from"./p-DTFXzlvq.js";import{d as p}from"./p-ClKABgST.js";import{d as h}from"./p-BMIgVp9-.js";import{d as c}from"./p-Cl5io5TH.js";var b={numberInput:{sm:{height:"28",paddingX:"6",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"8",radius:"6",typography:{fontWeight:"400",fontSize:"14",lineHeight:"24"}},border:{default:"#AAAAAA",focus:"#0075FF",danger:"#FB4444"},bg:{default:"#FFFFFF"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},stepper:{sm:{size:"20"},md:{size:"24"},radius:"4",bg:{default:"#EFF6FF",disabled:"#EEEEEE"},icon:{default:"#0075FF",disabled:"#BBBBBB"}}}};const m=b.numberInput.sm,f=b.numberInput.md,g={sm:{height:m.height,paddingX:m.paddingX,radius:m.radius,fontSize:m.typography.fontSize,lineHeight:m.typography.lineHeight,fontWeight:m.typography.fontWeight},md:{height:f.height,paddingX:f.paddingX,radius:f.radius,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight}},y={border:b.numberInput.border,bg:b.numberInput.bg,text:b.numberInput.text},_={sm:{size:b.numberInput.stepper.sm.size},md:{size:b.numberInput.stepper.md.size},radius:b.numberInput.stepper.radius,bg:b.numberInput.stepper.bg,icon:b.numberInput.stepper.icon},x=d.field.hint,v=d.field.errorMessage,w=d.field.contents.gap,z=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}size="sm";min=Number.NEGATIVE_INFINITY;max=Number.POSITIVE_INFINITY;step=1;useButton=!1;useDecimal=!1;value=null;label;labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;width;rules=[];autoFocus=!1;status;hint="";errorMessage="";inputPrefix="";inputSuffix="";inputClass="";readonly=!1;inputStyle={};error=!1;focused=!1;hovered=!1;internalValue=null;displayValue="";nativeEl=void 0;formField;name=r();update;focus;blur;toNumber(t){if(null==t||""===t)return null;if("number"==typeof t)return isNaN(t)?null:t;if("string"==typeof t)return this.parseInput(t);const e=Number(t);return isNaN(e)?null:e}formatWithCommas(t){if(null==t||isNaN(t))return"";const e=t<0,s=Math.abs(t),[i,n]=s.toString().split("."),r=(+i).toLocaleString(),d=e?"-"+r:r;return void 0!==n&&""!==n?d+"."+n:String(d)}parseInput(t){if(""===t.trim())return null;const e=t.replace(/,/g,"").trim();if(!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(e))return null;const s=parseFloat(e);return isNaN(s)||!this.useDecimal&&e.includes(".")?null:s}clampMinMax(t){return isNaN(t)?0:Math.min(Math.max(t,this.min),this.max)}updateDisplay(){this.displayValue=this.formatWithCommas(this.internalValue)}isIncrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue>=this.max}isDecrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue<=this.min}valueChanged(t){const e=this.toNumber(t);this.internalValue=null!==e?this.clampMinMax(e):null,this.updateDisplay()}internalValueChanged(t){this.updateDisplay(),t!==this.value&&(this.value=t,this.update?.emit(t))}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async sdGetNativeElement(){return this.nativeEl||null}componentWillLoad(){const t=this.toNumber(this.value);null!==t&&(this.internalValue=this.clampMinMax(t)),this.updateDisplay()}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{const e=t.target,s=e.value;if(""===s)return this.internalValue=null,void(this.displayValue="");const i=s.replace(/,/g,""),n=(i.match(/\./g)||[]).length;if(n>1)return void(e.value=this.displayValue);if("-"===i||"."===i||"-."===i)return void(e.value=i);if(i.endsWith(".")&&1===n){const t=i.slice(0,-1),s=this.parseInput(t);if(null!==s){const t=this.formatWithCommas(s);return void(e.value=t+".")}}const r=this.parseInput(i);if(null!==r){if(r<this.min)return void(e.value=this.displayValue);if(r>this.max)return void(e.value=this.displayValue);this.internalValue=r,this.displayValue=this.formatWithCommas(r),e.value=this.displayValue}else e.value=this.displayValue};handleFocus=t=>{this.focused=!0,this.focus?.emit(t)};handleBlur=async t=>{this.updateDisplay(),this.nativeEl&&(this.nativeEl.value=this.displayValue),this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.focused=!1,this.blur?.emit(t)};handleKeyDown=t=>{"ArrowUp"===t.key?(t.preventDefault(),this.handleIncrement()):"ArrowDown"===t.key&&(t.preventDefault(),this.handleDecrement())};handleIncrement=()=>{if(this.isIncrementDisabled())return;const t=this.internalValue??this.min??0;let e=t+this.step;e>this.max&&(e=this.max),e!==t&&(this.internalValue=e)};handleDecrement=()=>{if(this.isDecrementDisabled())return;const t=this.internalValue??this.min??0;let e=t-this.step;e<this.min&&(e=this.min),e!==t&&(this.internalValue=e)};render(){const t=g[this.size]??g.sm,e="md"===this.size?14:12;return i("sd-field",{key:"ad212dcbaf8e19cac070e6bdfa292ca614480fbc",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,readonly:this.readonly,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-number-input-font-size":`${t.fontSize}px`,"--sd-number-input-line-height":`${t.lineHeight}px`,"--sd-number-input-font-weight":t.fontWeight,"--sd-number-input-padding-x":`${t.paddingX}px`,"--sd-number-input-text-color":y.text.default,"--sd-number-input-placeholder-color":y.text.placeholder,"--sd-number-input-disabled-color":y.text.disabled,"--sd-number-input-stepper-size":`${_[this.size]?.size??_.sm.size}px`,"--sd-number-input-stepper-radius":`${_.radius}px`,"--sd-number-input-stepper-bg":_.bg.default,"--sd-number-input-stepper-bg-disabled":_.bg.disabled,"--sd-number-input-stepper-icon-color":_.icon.default,"--sd-number-input-stepper-icon-disabled":_.icon.disabled,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`,"--sd-system-color-field-border-default":y.border.default,"--sd-system-color-field-border-focus":y.border.focus,"--sd-system-color-field-border-danger":y.border.danger,"--sd-system-color-field-bg-default":y.bg.default,"--sd-textinput-input-text-error-message":v.color,"--sd-textinput-input-error-message-typography-font-size":`${v.typography.fontSize}px`,"--sd-textinput-input-error-message-typography-line-height":`${v.typography.lineHeight}px`,"--sd-textinput-input-text-hint":x.color,"--sd-textinput-input-hint-typography-font-size":`${x.typography.fontSize}px`,"--sd-textinput-input-hint-typography-line-height":`${x.typography.lineHeight}px`,"--sd-textinput-input-contents-gap":`${w}px`}},i("div",{key:"b9c403df166e2f05f815ebf3851b6517b8afbd2a",class:{"sd-number-input__content":!0,"sd-number-input__content--no-stepper":!this.useButton}},this.useButton&&i("button",{key:"206f45b19bf8dd56b65ff55fb65d760e36d80ba7",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"d39cadc9a83cf7a0170144b8734a90f71d7aa9d1",name:"minus",size:e,color:this.isDecrementDisabled()?_.icon.disabled:_.icon.default})),this.inputPrefix&&i("span",{key:"0c97309540467d56ee3415001df7a027ba581a3d",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"9462f0c7ac028c038894ad184c7cf052e366e48c",name:this.name,ref:t=>this.nativeEl=t,class:`sd-number-input__native ${this.inputClass}`,type:"text",inputMode:"numeric",value:this.displayValue,placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,style:{textAlign:this.useButton?"center":"right",...this.inputStyle}}),this.inputSuffix&&i("span",{key:"fdd4f4e680fe5de55cb68c848615ec6b00f00430",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"8cdfcc46a010fb0f503b48c34290fd096403524a",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"ec8826370cd9d8c6054ca6ab216de6baa62d90db",name:"add",size:e,color:this.isIncrementDisabled()?_.icon.disabled:_.icon.default}))))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-number-input{display:inline-flex}sd-number-input .sd-number-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;gap:var(--sd-number-input-padding-x);color:var(--sd-number-input-text-color);font-size:var(--sd-number-input-font-size);line-height:var(--sd-number-input-line-height);font-weight:var(--sd-number-input-font-weight);padding:0 var(--sd-number-input-padding-x)}sd-number-input .sd-number-input__content--no-stepper{padding:0 calc(var(--sd-number-input-padding-x) * 2)}sd-number-input .sd-number-input__content .sd-number-input__native{width:100%;height:100%;min-width:0;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;padding-block:0;padding-inline:0}sd-number-input .sd-number-input__content .sd-number-input__native[disabled]{cursor:not-allowed;color:var(--sd-number-input-disabled-color)}sd-number-input .sd-number-input__content .sd-number-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-number-input .sd-number-input__content .sd-number-input__native::placeholder{color:var(--sd-number-input-placeholder-color)}sd-number-input .sd-number-input__content .sd-number-input__prefix,sd-number-input .sd-number-input__content .sd-number-input__suffix{flex-shrink:0;white-space:nowrap;color:var(--sd-number-input-placeholder-color);font-size:inherit;line-height:inherit}sd-number-input .sd-number-input__content .sd-number-input__stepper{flex-shrink:0;width:var(--sd-number-input-stepper-size);height:var(--sd-number-input-stepper-size);border:none;border-radius:var(--sd-number-input-stepper-radius);background-color:var(--sd-number-input-stepper-bg);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.15s ease}sd-number-input .sd-number-input__content .sd-number-input__stepper:hover:not(:disabled){filter:brightness(0.95)}sd-number-input .sd-number-input__content .sd-number-input__stepper:disabled{background-color:var(--sd-number-input-stepper-bg-disabled);cursor:not-allowed}"}},[512,"sd-number-input",{size:[1],min:[2],max:[2],step:[2],useButton:[4,"use-button"],useDecimal:[4,"use-decimal"],value:[1032],label:[1],labelWidth:[8,"label-width"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],placeholder:[1],disabled:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputPrefix:[1,"input-prefix"],inputSuffix:[1,"input-suffix"],inputClass:[1,"input-class"],readonly:[4],inputStyle:[16],error:[1028],focused:[1028],hovered:[1028],name:[1],internalValue:[32],displayValue:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function k(){"undefined"!=typeof customElements&&["sd-number-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag","sd-tooltip"].forEach((t=>{switch(t){case"sd-number-input":customElements.get(n(t))||customElements.define(n(t),z);break;case"sd-button":customElements.get(n(t))||u();break;case"sd-field":customElements.get(n(t))||a();break;case"sd-floating-portal":customElements.get(n(t))||o();break;case"sd-ghost-button":customElements.get(n(t))||l();break;case"sd-icon":customElements.get(n(t))||p();break;case"sd-tag":customElements.get(n(t))||h();break;case"sd-tooltip":customElements.get(n(t))||c()}}))}export{z as S,k as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as i,c as s,h as t,t as l}from"./p-Bg9XySrz.js";import{n as r}from"./p-CCwNgVmC.js";import{d as o}from"./p-DDR0VcRU.js";import{d as a}from"./p-Bzo51vnP.js";import{d}from"./p-BX5uKVOt.js";import{d as n}from"./p-BLNc_TL-.js";import{d as c}from"./p-DTFXzlvq.js";import{d as h}from"./p-ClKABgST.js";import{d as p}from"./p-BMIgVp9-.js";import{d as f}from"./p-Cl5io5TH.js";var u={sm:{height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const m={height:u.sm.height,paddingX:u.sm.paddingX,gap:u.sm.gap,radius:u.sm.radius,fontSize:u.sm.typography.fontSize,lineHeight:u.sm.typography.lineHeight,fontWeight:u.sm.typography.fontWeight,iconSize:u.sm.icon},k={text:u.text,icon:{default:"#888888",disabled:u.icon.disabled}},g=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.reject=s(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name=r();label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";width="";rules;error=!1;status;icon=void 0;labelTooltip="";labelTooltipProps=null;focused=!1;hovered=!1;internalValue=null;showTooltip=!1;fileInputRef;fileNamesRef;formField;update;reject;valueChanged(e){this.internalValue=e}componentDidLoad(){this.checkOverflow()}componentDidUpdate(){this.checkOverflow()}async sdValidate(){return this.formField?.sdValidate()??Promise.resolve(!0)}async sdReset(){const e=this.multiple?[]:null;this.value=e,this.internalValue=e,this.fileInputRef&&(this.fileInputRef.value=""),await(this.formField?.sdResetValidation())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e,i=0){const s=this.toBytes(this.maxFileSize),t=this.toBytes(this.maxTotalSize),l=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=l&&i+e.length>l)return{accepted:[],rejected:e,reason:"max-files"};if(null!=s){const i=e.filter((e=>e.size>s));if(i.length>0)return{accepted:[],rejected:i,reason:"max-file-size"}}return null!=t&&e.reduce(((e,i)=>e+i.size),0)>t?{accepted:[],rejected:e,reason:"max-total-size"}:{accepted:e,rejected:[]}}handleFileChange=e=>{const i=e.target.files;if(!i||0===i.length)return;const s=Array.from(i);if(this.multiple){const e=Array.isArray(this.internalValue)?this.internalValue:[],{accepted:i,rejected:t,reason:l}=this.validateFiles(s,e.length);if(this.fileInputRef&&(this.fileInputRef.value=""),null!=l)return void this.reject?.emit({files:t,reason:l});const r=[...e,...i];this.internalValue=r,this.value=r,this.update?.emit(this.value)}else{const{accepted:e,rejected:i,reason:t}=this.validateFiles(s);if(null!=t)return this.reject?.emit({files:i,reason:t}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=e[0],this.value=this.internalValue,this.update?.emit(this.value)}};handleClear=e=>{if(this.disabled)return;e.stopPropagation();const i=this.multiple?[]:null;this.value=i,this.internalValue=i,this.update?.emit(i),this.fileInputRef&&(this.fileInputRef.value="")};handleClick=()=>{this.disabled||this.fileInputRef?.click()};hasFiles(){return!this.multiple&&!!this.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}hasChips(){return Array.isArray(this.internalValue)&&this.internalValue.length>0}getDisplayText(){return this.hasFiles()&&this.internalValue?.name||(this.placeholder??"Click to upload")}handleChipRemove=e=>{if(!Array.isArray(this.internalValue))return;const i=[...this.internalValue];i.splice(e,1),this.internalValue=i,this.value=i,this.update?.emit(this.value)};renderChipList(){return this.hasChips()?t("div",{class:"sd-file-picker__chip-list"},this.internalValue.map(((e,i)=>t("sd-chip",{value:e.name,onSdRemove:()=>this.handleChipRemove(i)})))):null}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?k.icon.disabled:k.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),s={"--sd-file-picker-font-size":`${m.fontSize}px`,"--sd-file-picker-line-height":`${m.lineHeight}px`,"--sd-file-picker-font-weight":m.fontWeight,"--sd-file-picker-padding-x":`${m.paddingX}px`,"--sd-file-picker-gap":`${m.gap}px`,"--sd-file-picker-text-color":k.text.default,"--sd-file-picker-placeholder-color":k.text.placeholder,"--sd-file-picker-disabled-color":k.text.disabled,"--sd-system-size-field-sm-height":`${m.height}px`,"--sd-system-radius-field-sm":`${m.radius}px`},l=t("div",{role:"button",tabindex:this.disabled?-1:0,class:"sd-file-picker__content",onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},t("input",{ref:e=>this.fileInputRef=e,type:"file",class:"sd-file-picker__input",disabled:this.disabled,multiple:this.multiple,accept:this.accept,onInput:this.handleFileChange,"aria-label":this.placeholder??"Click to upload"}),t("sd-icon",{name:"attachFile",size:Number(m.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),t("div",{ref:e=>this.fileNamesRef=e,class:{"sd-file-picker__text":!0,"sd-file-picker__text--placeholder":!e,"sd-file-picker__text--active":e}},i),!this.disabled&&e&&t("sd-ghost-button",{icon:"close",size:"xxs",ariaLabel:"clear",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&t("div",{class:"sd-file-picker__tooltip"},i));return this.inline?t("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:s,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l,this.renderChipList()):t("div",{class:"sd-file-picker__wrapper",style:s},t("sd-field",{name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l),this.renderChipList())}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:flex;flex-direction:column;width:100%}.sd-file-picker__wrapper{display:flex;flex-direction:column;width:100%}.sd-file-picker__chip-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:998;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}"}},[512,"sd-file-picker",{value:[1040],placeholder:[513],disabled:[516],inline:[516],multiple:[516],accept:[1],maxFileSize:[8,"max-file-size"],maxTotalSize:[8,"max-total-size"],maxFiles:[8,"max-files"],name:[1],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],width:[8],rules:[16],error:[1028],status:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],focused:[1028],hovered:[1028],internalValue:[32],showTooltip:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{value:[{valueChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-chip","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),g);break;case"sd-button":customElements.get(l(e))||o();break;case"sd-chip":customElements.get(l(e))||a();break;case"sd-field":customElements.get(l(e))||d();break;case"sd-floating-portal":customElements.get(l(e))||n();break;case"sd-ghost-button":customElements.get(l(e))||c();break;case"sd-icon":customElements.get(l(e))||h();break;case"sd-tag":customElements.get(l(e))||p();break;case"sd-tooltip":customElements.get(l(e))||f()}}))}export{g as S,x as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as d,h as s,t as i}from"./p-Bg9XySrz.js";import{f as l}from"./p-BOJJ_sQS.js";import{d as t}from"./p-DDR0VcRU.js";import{d as o}from"./p-BLNc_TL-.js";import{d as r}from"./p-DTFXzlvq.js";import{d as a}from"./p-ClKABgST.js";import{d as f}from"./p-BMIgVp9-.js";import{d as n}from"./p-Cl5io5TH.js";const h={start:"flex-start",center:"center",end:"flex-end"},c=l.field.label.sm,p=l.field.label.md,b={sm:{height:c.height,gap:c.gap,icon:c.icon,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight},md:{height:p.height,gap:p.gap,icon:p.icon,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight}},g=["sd-input","sd-barcode-input","sd-textarea","sd-number-input","sd-select","sd-file-picker","sd-date-picker","sd-date-range-picker","sd-chip-input"],m=e(class extends d{constructor(e){super(),!1!==e&&this.__registerHost()}get el(){return this}name="";rules=[];error=!1;disabled=!1;readonly=!1;hovered=!1;focused=!1;status;hint="";errorMessage="";width="";size="sm";label="";labelWidth="";addonLabel="";addonAlign="start";icon=void 0;labelTooltip="";labelTooltipProps=null;errorMsg="";hostElement=null;get value(){return this.hostElement?.value??null}get fieldStatus(){let e="";return this.disabled?(e="disabled",`sd-field--${e}`):this.readonly?(e="readonly",`sd-field--${e}`):this.focused?(e="focus",`sd-field--${e}`):(this.hovered&&(e="hover"),void 0!==this.status&&(e=this.status),this.error&&(e="error"),""!==e?`sd-field--${e}`:"")}componentDidLoad(){this.hostElement=this.findHostElement(),this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}findHostElement(){for(const e of g){const d=this.el.closest(e);if(d&&"value"in d)return d}return null}registerToForm(){const e=this.el.closest("sd-form");e&&"function"==typeof e.componentOnReady&&e.componentOnReady().then((e=>{e.sdRegisterField(this)}))}unregisterFromForm(){if(""===this.name)return;const e=this.el.closest("sd-form");e?.componentOnReady().then((e=>{e.sdUnregisterField(this)}))}async sdValidate(){if(!this.rules||0===this.rules.length)return!0;for(const e of this.rules){const d=e(this.value??"");if(!0!==d)return this.setError(!0,d),!1}return this.setError(!1,""),!0}async sdReset(){this.hostElement&&(this.hostElement.value=null),this.setError(!1,"")}async sdResetValidation(){this.setError(!1,"")}async sdFocus(){this.hostElement?.focus?.(),this.hostElement?.scrollIntoView({behavior:"smooth",block:"center"})}setError(e,d){this.errorMsg=d,this.hostElement&&(this.hostElement.error=e)}render(){const e=this.addonLabel,d=l.field.addonLabel,i=this.size in b?this.size:"sm",t=b[i],o={"--sd-field-wrapper-height":`var(--sd-system-size-field-${i}-height)`,"--sd-field-control-radius":`var(--sd-system-radius-field-${i})`,"--sd-field-label-margin-right":`var(--sd-system-space-field-${i}-gap)`},r={"--sd-field-error-message-color":l.field.errorMessage.color,"--sd-field-error-message-font-size":`${l.field.errorMessage.typography.fontSize}px`,"--sd-field-error-message-line-height":`${l.field.errorMessage.typography.lineHeight}px`,"--sd-field-hint-color":l.field.hint.color,"--sd-field-hint-font-size":`${l.field.hint.typography.fontSize}px`,"--sd-field-hint-line-height":`${l.field.hint.typography.lineHeight}px`,"--sd-field-message-gap":`${l.field.contents.gap}px`},a=""!==this.label?{"--sd-field-label-height":`${t.height}px`,"--sd-field-label-gap":`${t.gap}px`,"--sd-field-label-font-size":`${t.fontSize}px`,"--sd-field-label-line-height":`${t.lineHeight}px`,"--sd-field-label-font-weight":t.fontWeight,...""!==this.labelWidth&&0!==this.labelWidth?{"--sd-field-label-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{},f=""!==e?{"--sd-field-addon-padding-x":`${d.paddingX}px`,"--sd-field-addon-font-size":`${d.typography.fontSize}px`,"--sd-field-addon-line-height":`${d.typography.lineHeight}px`,"--sd-field-addon-font-weight":d.typography.fontWeight,"--sd-field-addon-bg":d.bg,"--sd-field-addon-border-color":this.disabled?d.border.disabled:d.border.default,"--sd-field-addon-gap":`${d.gap}px`,"--sd-field-addon-border-width":`${d.border.width}px`,"--sd-field-addon-justify":h[this.addonAlign]??h.start,...""!==this.labelWidth&&0!==this.labelWidth?{"--sd-field-addon-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{};return s("div",{key:"9edafceb24a4fcde7cfb966f421bfb73f1b07617",class:{"sd-field":!0,"sd-field--has-label":""!==this.label,"sd-field--has-addon":""!==e,[this.fieldStatus]:""!==this.fieldStatus},style:{...o,...a,...f,...r}},s("div",{key:"e5c4a8aad05afb40f3eccc492135b2b968ffc646",class:"sd-field__wrapper"},this.renderLabel(this.label),s("div",{key:"e88d62a979eaab9f6794c851813e5f56c3c5c4ac",class:"sd-field__main",style:""!==this.width&&0!==this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width,flex:"none"}:{}},s("div",{key:"be69d7e48d90dda0872ffc43c2a1b4044e99ac00",class:{"sd-field__control":!0,"sd-field__control--has-addon":""!==e}},e&&s("div",{key:"2c631ac0f8b9001cf6344908cf8cbcdf182cc1a7",class:"sd-field__addon"},this.icon&&s("sd-icon",{key:"34a49839ee200cd59c3ff5b84caf5ded2c50f7b0",name:this.icon.name,size:this.icon.size??Number(b[this.size in b?this.size:"sm"].icon),color:this.icon.color,rotate:this.icon.rotate}),e),s("slot",{key:"693f20c529e5f2ea84d381e59327392edb7b4c15"})),""!==this.errorMsg||""!==this.errorMessage?s("div",{class:"sd-field__error-message"},""!==this.errorMsg?this.errorMsg:this.errorMessage):""!==this.hint&&s("div",{class:"sd-field__hint"},this.hint))))}renderLabel(e){return null==e||""===e?null:s("label",{class:"sd-field__label"},this.icon&&s("sd-icon",{name:this.icon.name,size:this.icon.size??Number(b[this.size in b?this.size:"sm"].icon),color:this.icon.color,rotate:this.icon.rotate,class:"sd-field__label__icon"}),s("div",{class:"sd-field__label__text"},e),this.labelTooltip&&s("sd-tooltip",{class:"sd-field__label__tooltip",...this.labelTooltipProps},this.labelTooltip))}static get style(){return"sd-field{display:inline-flex;flex-flow:column nowrap;height:fit-content;width:100%}sd-field .sd-field *:focus,sd-field .sd-field *:focus-visible,sd-field .sd-field *:focus-within{outline:none !important}sd-field .sd-field.sd-field--disabled{cursor:not-allowed}sd-field .sd-field.sd-field--disabled .sd-field__wrapper{cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__label-inside{border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__control{background-color:#E1E1E1;border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--readonly .sd-field__wrapper .sd-field__control{background-color:var(--sd-system-color-field-bg-read-only);color:var(--sd-system-color-field-text-read-only)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label{display:flex;align-items:center;flex-shrink:0;width:var(--sd-field-label-width, auto);height:var(--sd-field-label-height);margin-right:var(--sd-field-label-margin-right)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__icon{margin-right:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__text{font-size:var(--sd-field-label-font-size);line-height:var(--sd-field-label-line-height);font-weight:var(--sd-field-label-font-weight);color:var(--sd-system-color-field-text-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__tooltip{margin-left:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-addon .sd-field__control .sd-field__addon{display:flex;gap:var(--sd-field-addon-gap);align-items:center;justify-content:var(--sd-field-addon-justify, flex-start);white-space:nowrap;box-sizing:border-box;flex-shrink:0;width:var(--sd-field-addon-width, auto);padding:0 var(--sd-field-addon-padding-x);font-size:var(--sd-field-addon-font-size);line-height:var(--sd-field-addon-line-height);font-weight:var(--sd-field-addon-font-weight);background:var(--sd-field-addon-bg);border-right:var(--sd-field-addon-border-width) solid var(--sd-field-addon-border-color);border-radius:calc(var(--sd-field-control-radius) - 1px) 0 0 calc(var(--sd-field-control-radius) - 1px)}sd-field .sd-field__wrapper{width:100%;display:flex;align-items:flex-start;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__main{flex:1;min-width:0;display:flex;flex-direction:column}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:var(--sd-field-wrapper-height);display:flex;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-field-control-radius);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error .sd-field__wrapper .sd-field__control:not(:hover){border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field:not(.sd-field--disabled):not(.sd-field--readonly) .sd-field__wrapper .sd-field__control:hover{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--focus:not(.sd-field--readonly) .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field .sd-field__error-message{color:var(--sd-field-error-message-color);font-size:var(--sd-field-error-message-font-size);line-height:var(--sd-field-error-message-line-height);margin-top:var(--sd-field-message-gap)}sd-field .sd-field .sd-field__hint{color:var(--sd-field-hint-color);font-size:var(--sd-field-hint-font-size);line-height:var(--sd-field-hint-line-height);margin-top:var(--sd-field-message-gap)}"}},[772,"sd-field",{name:[1],rules:[16],error:[1028],disabled:[1028],readonly:[1028],hovered:[1028],focused:[1028],status:[1],hint:[1],errorMessage:[1,"error-message"],width:[8],size:[513],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],errorMsg:[32],sdValidate:[64],sdReset:[64],sdResetValidation:[64],sdFocus:[64]}]);function _(){"undefined"!=typeof customElements&&["sd-field","sd-button","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-field":customElements.get(i(e))||customElements.define(i(e),m);break;case"sd-button":customElements.get(i(e))||t();break;case"sd-floating-portal":customElements.get(i(e))||o();break;case"sd-ghost-button":customElements.get(i(e))||r();break;case"sd-icon":customElements.get(i(e))||a();break;case"sd-tag":customElements.get(i(e))||f();break;case"sd-tooltip":customElements.get(i(e))||n()}}))}export{m as S,_ as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as r,h as s,d as t,t as c}from"./p-Bg9XySrz.js";import{p as a}from"./p-D1vaasIp.js";import{s as o}from"./p-BJfiMC9H.js";var i={track:"#EEEEEE",arc:"#2D8DFF"};const l=a.progress.color.label,n=o.color.fg.tertiary,p={primary:{arc:i.arc,track:i.track},inverse:{arc:"#FFFFFF",track:"transparent"},error:{arc:"#E30000",track:i.track},complete:{arc:"#01BB4B",track:i.track}},d=2*Math.PI*34,g=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}indeterminate=!1;value=0;type="primary";label;get clampedValue(){return Number.isFinite(this.value)?Math.max(0,Math.min(100,this.value)):0}render(){const e=p[this.type]??p.primary,r={"--sd-circle-progress-track":e.track,"--sd-circle-progress-arc":e.arc,"--sd-circle-progress-label-color":l,"--sd-circle-progress-percent-color":0===this.clampedValue?n:e.arc},c={};this.indeterminate||(c.strokeDasharray=`${this.clampedValue/100*d} ${d}`,c.strokeDashoffset="0");const a=!this.indeterminate;return s(t,{key:"35b4dc433f5e2bbd02dc3422b286da179472082f",style:r},s("svg",{key:"de1d3e44eccf421491a1107ba234e1562917945b",class:"sd-circle-progress",viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg"},s("circle",{key:"b0a54a2e155222a416a6bdcb75f4fe54d9de8270",class:"sd-circle-progress__track",cx:40,cy:40,r:34,fill:"none","stroke-width":12}),s("circle",{key:"6bc314b3fce758d41a3499e9d87b7158b15777a5",class:"sd-circle-progress__arc",cx:40,cy:40,r:34,fill:"none","stroke-width":12,"stroke-linecap":"round",style:c})),a&&s("span",{key:"16ec46b178d5f2f2f5ad245703c2f4362b8df261",class:"sd-circle-progress__percent"},Math.round(this.clampedValue),"%"),this.label&&s("span",{key:"c199799d2466c75f91f1bc1f20fdb7e71c64ba0e",class:"sd-circle-progress__label"},this.label))}static get style(){return'@charset "UTF-8";sd-circle-progress{display:inline-flex;flex-direction:column;align-items:center;gap:8px}sd-circle-progress .sd-circle-progress{width:80px;height:80px}sd-circle-progress .sd-circle-progress__track{stroke:var(--sd-circle-progress-track)}sd-circle-progress .sd-circle-progress__arc{stroke:var(--sd-circle-progress-arc);transform:rotate(-90deg);transform-origin:center center;transition:stroke-dasharray 0.4s linear, stroke-dashoffset 0.4s linear}sd-circle-progress .sd-circle-progress__percent{text-align:center;color:var(--sd-circle-progress-percent-color);font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;font-size:16px;font-weight:700;line-height:26px}sd-circle-progress .sd-circle-progress__label{text-align:center;color:var(--sd-circle-progress-label-color);font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;font-size:12px;font-weight:400;line-height:20px}sd-circle-progress{}sd-circle-progress[indeterminate] .sd-circle-progress{animation:sd-circle-progress-spin 2s linear infinite;transform-origin:center center}sd-circle-progress[indeterminate] .sd-circle-progress__arc{transform:none;transition:none;animation:sd-circle-progress-spin-path 1.5s ease-in-out infinite}@keyframes sd-circle-progress-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes sd-circle-progress-spin-path{0%{stroke-dasharray:1, 340;stroke-dashoffset:0}50%{stroke-dasharray:151, 340;stroke-dashoffset:-60}100%{stroke-dasharray:151, 340;stroke-dashoffset:-211}}'}},[512,"sd-circle-progress",{indeterminate:[516],value:[2],type:[513],label:[1]}]);function f(){"undefined"!=typeof customElements&&["sd-circle-progress"].forEach((e=>{"sd-circle-progress"===e&&(customElements.get(c(e))||customElements.define(c(e),g))}))}export{g as S,f as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as i,c as s,h as e,t as h}from"./p-Bg9XySrz.js";import{d as n}from"./p-DTFXzlvq.js";import{d as o}from"./p-ClKABgST.js";import{d}from"./p-BMIgVp9-.js";var a={default:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",lineHeight:"20"},focus:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"400",lineHeight:"20"}},r={default:"#F6F6F6",error:"#FCEFEF"},c={default:"#555555",error:"#E30000",focus:"#222222"};const l={height:`${"24"}px`,paddingX:`${"8"}px`,gap:`${"4"}px`,radius:`${"9999"}px`,borderWidth:`${{width:"1"}.width}px`},p={bg:{default:r.default,error:r.error},content:{default:c.default,error:c.error,focus:c.focus}},u={default:{fontFamily:a.default.fontFamily,fontSize:`${a.default.fontSize}px`,fontWeight:a.default.fontWeight,lineHeight:`${a.default.lineHeight}px`},focus:{fontFamily:a.focus.fontFamily,fontSize:`${a.focus.fontSize}px`,fontWeight:a.focus.fontWeight,lineHeight:`${a.focus.lineHeight}px`}},f=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.delete=s(this,"sdRemove",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}name="";value="";error=!1;disabled=!1;editable=!0;placeholder="";rules=[];internalValue="";isEditing=!1;update;delete;focus;blur;inputEl;draftValue="";shouldInitInput=!1;valueChanged(t){const i=t??"",s=this.isEditing;this.internalValue=i,this.draftValue=i,s&&(this.isEditing=!1,this.shouldInitInput=!1,this.inputEl?.blur(),this.blur.emit())}componentWillLoad(){this.internalValue=this.value??""}componentDidLoad(){this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}async sdValidate(){if(!this.rules||0===this.rules.length)return this.error=!1,!0;for(const t of this.rules)if(!0!==t(this.internalValue??""))return this.error=!0,!1;return this.error=!1,!0}async sdReset(){this.internalValue="",this.value="",this.error=!1,this.draftValue="",this.isEditing=!1,this.shouldInitInput=!1}async sdResetValidate(){this.error=!1}async sdResetValidation(){this.error=!1}async sdFocus(){this.disabled||this.enterEditMode()}async sdGetNativeElement(){return this.inputEl??null}get isEditable(){return!1!==this.editable}enterEditMode=()=>{this.disabled||this.isEditing||!this.isEditable||(this.draftValue=this.internalValue,this.shouldInitInput=!0,this.isEditing=!0,this.focus.emit())};commitEdit=async()=>{if(!this.isEditing)return;const t=(this.inputEl?.textContent??this.draftValue).trim(),i=t!==this.draftValue;this.internalValue=t,this.isEditing=!1,this.shouldInitInput=!1,this.value=t,i&&this.update.emit(t),await this.sdValidate(),this.blur.emit()};cancelEdit=()=>{this.isEditing&&(this.internalValue=this.draftValue,this.isEditing=!1,this.shouldInitInput=!1,this.blur.emit())};handleChipClick=()=>{this.disabled||this.isEditing||!this.isEditable||this.enterEditMode()};handleChipKeyDown=t=>{this.disabled||this.isEditing||!this.isEditable||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.enterEditMode())};handleInputChange=t=>{this.internalValue=t.target.textContent??""};handleInputKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),t.stopPropagation(),this.commitEdit()):"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.cancelEdit())};handleInputBlur=()=>{this.commitEdit()};handlePaste=t=>{t.preventDefault();const i=t.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,i)};handleRemoveClick=t=>{t.stopPropagation(),this.disabled||this.delete.emit()};syncInputValue(t){if(!this.inputEl)return;this.inputEl.textContent=t;const i=document.createRange();i.selectNodeContents(this.inputEl),i.collapse(!1);const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}registerToForm(){const t=this.el.closest("sd-form");t&&"function"==typeof t.componentOnReady&&t.componentOnReady().then((t=>{t.sdRegisterField(this)}))}unregisterFromForm(){if(""===this.name)return;const t=this.el.closest("sd-form");t?.componentOnReady().then((t=>{t.sdUnregisterField(this)}))}componentDidUpdate(){this.isEditing&&this.inputEl&&this.shouldInitInput&&(this.inputEl.focus(),this.syncInputValue(this.internalValue),this.shouldInitInput=!1)}resolveState(){return this.isEditing?"focus":this.error?"error":"default"}render(){const t=this.resolveState(),i=u.default,s={"--sd-chip-height":l.height,"--sd-chip-padding-x":l.paddingX,"--sd-chip-gap":l.gap,"--sd-chip-radius":l.radius,"--sd-chip-border-width":l.borderWidth,"--sd-chip-bg":"error"===t?p.bg.error:p.bg.default,"--sd-chip-content":"error"===t?p.content.error:p.content.default,"--sd-chip-border-color":"transparent","--sd-chip-font-family":i.fontFamily,"--sd-chip-font-size":i.fontSize,"--sd-chip-font-weight":i.fontWeight,"--sd-chip-line-height":i.lineHeight};return e("span",{key:"26f863e035272df44fec64b16ebe6c17230d3452",class:{"sd-chip":!0,[`sd-chip--${t}`]:!0,"sd-chip--disabled":this.disabled,"sd-chip--editable":!this.disabled&&this.isEditable},role:this.disabled||!this.isEditable?void 0:"button",tabIndex:this.disabled||this.isEditing||!this.isEditable?-1:0,"aria-disabled":this.disabled?"true":void 0,style:s,onClick:this.handleChipClick,onKeyDown:this.handleChipKeyDown},this.isEditing?e("span",{key:"chip-input",ref:t=>this.inputEl=t,class:"sd-chip__input",role:"textbox",tabindex:this.disabled?-1:0,contentEditable:!this.disabled,"data-placeholder":this.placeholder,spellcheck:!1,onInput:this.handleInputChange,onKeyDown:this.handleInputKeyDown,onBlur:this.handleInputBlur,onPaste:this.handlePaste,onClick:t=>t.stopPropagation()}):[e("span",{key:"chip-label",class:"sd-chip__label"},this.internalValue),!this.disabled&&e("sd-ghost-button",{key:"chip-remove",class:"sd-chip__remove",icon:"close",size:"xxs",ariaLabel:"remove",onClick:this.handleRemoveClick})])}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-chip{display:inline-flex;width:fit-content;max-width:100%;height:fit-content}sd-chip .sd-chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-chip-gap);max-width:100%;height:var(--sd-chip-height);padding:0 var(--sd-chip-padding-x);border-radius:var(--sd-chip-radius);background:var(--sd-chip-bg);color:var(--sd-chip-content);border:var(--sd-chip-border-width) solid var(--sd-chip-border-color);font-family:var(--sd-chip-font-family);font-size:var(--sd-chip-font-size);font-weight:var(--sd-chip-font-weight);line-height:var(--sd-chip-line-height);box-sizing:border-box;white-space:nowrap;overflow:hidden;-webkit-user-select:none;user-select:none}sd-chip .sd-chip--editable:not(.sd-chip--focus){cursor:text}sd-chip .sd-chip--disabled{cursor:not-allowed;opacity:0.6}sd-chip .sd-chip__label{display:inline-flex;align-items:center;min-width:0;overflow:hidden;text-overflow:ellipsis}sd-chip .sd-chip__input{display:inline-block;min-width:1ch;outline:none;background:transparent;color:inherit;font:inherit;white-space:nowrap;cursor:text}sd-chip .sd-chip__input:empty::before{content:attr(data-placeholder);color:inherit;opacity:0.6;pointer-events:none}sd-chip .sd-chip__remove{flex-shrink:0}"}},[512,"sd-chip",{name:[1],value:[1025],error:[1028],disabled:[4],editable:[4],placeholder:[1],rules:[16],internalValue:[32],isEditing:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdResetValidation:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}]}]);function m(){"undefined"!=typeof customElements&&["sd-chip","sd-ghost-button","sd-icon","sd-tag"].forEach((t=>{switch(t){case"sd-chip":customElements.get(h(t))||customElements.define(h(t),f);break;case"sd-ghost-button":customElements.get(h(t))||n();break;case"sd-icon":customElements.get(h(t))||o();break;case"sd-tag":customElements.get(h(t))||d()}}))}export{u as C,f as S,p as a,l as b,m as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as s,c as i,h as e,t as n}from"./p-Bg9XySrz.js";import{n as o}from"./p-CCwNgVmC.js";import{i as a}from"./p-e0ABNkP6.js";import{d as l}from"./p-DDR0VcRU.js";import{d}from"./p-BX5uKVOt.js";import{d as r}from"./p-BLNc_TL-.js";import{d as u}from"./p-DTFXzlvq.js";import{d as h}from"./p-ClKABgST.js";import{d as p}from"./p-BMIgVp9-.js";import{d as c}from"./p-Cl5io5TH.js";const f=a.textinput.sm,b=a.textinput.md,m={sm:{height:f.height,paddingX:f.paddingX,gap:f.gap,radius:f.radius,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight},md:{height:b.height,paddingX:b.paddingX,gap:b.gap,radius:b.radius,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight,fontWeight:b.typography.fontWeight}},g={text:a.textinput.text,icon:a.textinput.icon},_=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.input=i(this,"sdUpdate",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get host(){return this}value=null;type="text";size="sm";addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;autocomplete="";maxlength;minlength;inputmode;enterkeyhint;spellcheck=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;passwordVisible=!1;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){null!=this.value&&""!==this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{this.internalValue=t.target.value};handleFocus=async(t,s)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(s)):this.focus?.emit(s)};render(){const t=m[this.size]??m.sm;return e("sd-field",{key:"64e7a3ba5e223341336248ba31e621b4416987fd",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,readonly:this.readonly,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-input-font-size":`${t.fontSize}px`,"--sd-input-line-height":`${t.lineHeight}px`,"--sd-input-font-weight":t.fontWeight,"--sd-input-padding-x":`${t.paddingX}px`,"--sd-input-gap":`${t.gap}px`,"--sd-input-text-color":g.text.default,"--sd-input-placeholder-color":g.text.placeholder,"--sd-input-disabled-color":g.text.disabled,"--sd-input-icon-color":g.icon.default,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`}},e("label",{key:"b66e286c35cc14c1eb02badcaaff24b38ff0a7b3",class:"sd-input__content"},e("slot",{key:"dc8b900eb2b38c18b85663bc930e810be77bdbd7",name:"prefix"}),e("input",{key:"36d35464338838aaaeff6f728020241d33a493ec",name:this.name,ref:t=>this.nativeEl=t,class:`sd-input__native ${this.inputClass}`,type:"password"===this.type&&this.passwordVisible?"text":this.type??"text",value:this.internalValue||"",placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,autocomplete:this.autocomplete||void 0,maxlength:this.maxlength,minlength:this.minlength,inputmode:this.inputmode,enterkeyhint:this.enterkeyhint,spellcheck:this.spellcheck,onInput:this.handleInput,onFocus:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),e("slot",{key:"4f30d4a59794c0692f367d41af4311e191c5427b",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&!this.readonly&&e("sd-ghost-button",{key:"247da41512f20d8e562f345b08bd5bc13486734b",icon:"close",ariaLabel:"clear",size:"xxs",disabled:this.disabled,class:"sd-input__clear-icon",onClick:async()=>{this.disabled||this.readonly||(this.internalValue="",await(this.formField?.sdValidate()))}}),"password"===this.type&&e("sd-ghost-button",{key:"70c596ef0072bf369bd59e2c58d0a6f8c6fd1b11",icon:this.passwordVisible?"visibilityOn":"visibilityOff",ariaLabel:"visibility",size:"xxs",disabled:this.disabled||this.readonly,class:"sd-input__password-icon",onClick:()=>{this.disabled||this.readonly||(this.passwordVisible=!this.passwordVisible)}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}sd-input{display:inline-flex}sd-input .sd-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-input-text-color);font-size:var(--sd-input-font-size);line-height:var(--sd-input-line-height);font-weight:var(--sd-input-font-weight);padding:0 var(--sd-input-padding-x);gap:var(--sd-input-gap)}sd-input .sd-input__content .sd-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-input .sd-input__content .sd-input__native[disabled]{cursor:not-allowed;color:var(--sd-input-disabled-color)}sd-input .sd-input__content .sd-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-input .sd-input__content .sd-input__native::placeholder{color:var(--sd-input-placeholder-color)}sd-input .sd-input__content .sd-input__clear-icon,sd-input .sd-input__content .sd-input__password-icon{flex-shrink:0}sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__password-icon,sd-input .sd-input__content .sd-input__native[readonly]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[readonly]~.sd-input__password-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-input",{value:[1032],type:[1],size:[1],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],autocomplete:[1],maxlength:[2],minlength:[2],inputmode:[1],enterkeyhint:[1],spellcheck:[4],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],labelWidth:[8,"label-width"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],inputStyle:[16],name:[1],internalValue:[32],passwordVisible:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function v(){"undefined"!=typeof customElements&&["sd-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag","sd-tooltip"].forEach((t=>{switch(t){case"sd-input":customElements.get(n(t))||customElements.define(n(t),_);break;case"sd-button":customElements.get(n(t))||l();break;case"sd-field":customElements.get(n(t))||d();break;case"sd-floating-portal":customElements.get(n(t))||r();break;case"sd-ghost-button":customElements.get(n(t))||u();break;case"sd-icon":customElements.get(n(t))||h();break;case"sd-tag":customElements.get(n(t))||p();break;case"sd-tooltip":customElements.get(n(t))||c()}}))}export{_ as S,v as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as a,c as r,h as n,F as d,t}from"./p-Bg9XySrz.js";import{u as i,t as s,W as c,C as l}from"./p-BysikR_g.js";import{d as g}from"./p-laVsm9VM.js";import{d as o}from"./p-DTFXzlvq.js";import{d as h}from"./p-ClKABgST.js";import{d as p}from"./p-BMIgVp9-.js";const k=(e,a)=>{const[r,n,d]=e.split("-").map(Number),t=new Date(r,n-1,d);return t.setDate(t.getDate()+a),`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`},_={bg:g.datepicker.calendar.range.bg,height:g.datepicker.calendar.range.height,panelGap:g.datepicker.calendar.range.panelGap,divider:g.datepicker.calendar.range.divider},u=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.select=r(this,"sdSelect",7),this.viewChange=r(this,"sdViewChange",7)}value=null;selectable;maxRange;currentYear;currentMonth;pendingStart="";hoverDate="";displayValue=null;select;viewChange;dateUtil=i();componentWillLoad(){this.syncFromValue()}handleValueChange(){this.syncFromValue()}syncFromValue(){const e=this.value?.[0]||s,[a,r]=e.split("-").map(Number);this.currentYear=a,this.currentMonth=r,this.pendingStart="",this.hoverDate="",this.displayValue=this.value?[this.value[0],this.value[1]]:null}get rightYear(){return 12===this.currentMonth?this.currentYear+1:this.currentYear}get rightMonth(){return 12===this.currentMonth?1:this.currentMonth+1}formatDate(e,a,r){return`${e}-${String(a).padStart(2,"0")}-${String(r).padStart(2,"0")}`}buildCells(e,a){const r=new Date(e,a-1,1).getDay(),n=new Date(e,a,0).getDate(),d=1===a?12:a-1,t=1===a?e-1:e,i=new Date(t,d,0).getDate(),s=12===a?1:a+1,c=12===a?e+1:e,l=[];for(let e=r-1;e>=0;e--){const a=i-e;l.push({date:this.formatDate(t,d,a),day:a,inCurrentMonth:!1})}for(let r=1;r<=n;r++)l.push({date:this.formatDate(e,a,r),day:r,inCurrentMonth:!0});const g=(7-l.length%7)%7;for(let e=1;e<=g;e++)l.push({date:this.formatDate(c,s,e),day:e,inCurrentMonth:!1});return l}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=e=>{e.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=e=>{e.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:r}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=a,this.currentMonth=r,this.emitViewChange()};goNextMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:r}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=a,this.currentMonth=r,this.emitViewChange()};goToday=e=>{e.stopPropagation();const[a,r]=s.split("-").map(Number);this.currentYear===a&&this.currentMonth===r||(this.currentYear=a,this.currentMonth=r,this.emitViewChange())};isDisabled(e){if(this.selectable){const[a,r]=this.selectable;if(null!=a&&""!==a&&e<a)return!0;if(null!=r&&""!==r&&e>r)return!0}if(null!=this.maxRange&&this.maxRange>0&&""!==this.pendingStart){const a=k(this.pendingStart,-this.maxRange),r=k(this.pendingStart,this.maxRange);if(e<a||e>r)return!0}return!1}handleDayClick(e){if(!e.inCurrentMonth)return;if(this.isDisabled(e.date))return;if(""===this.pendingStart||null!=this.displayValue&&""!==this.displayValue[0]&&""!==this.displayValue[1]||e.date<this.pendingStart)return this.pendingStart=e.date,this.displayValue=null,void(this.hoverDate="");const a=[this.pendingStart,e.date];this.pendingStart="",this.hoverDate="",this.displayValue=a,this.select.emit(a)}handleDayHover(e){e.inCurrentMonth&&""!==this.pendingStart&&(this.hoverDate=e.date)}getRangeState(e,a){if(!a)return{inRange:!1,isRangeStart:!1,isRangeEnd:!1,isSelectedEdge:!1};if(""!==this.pendingStart){const a=e===this.pendingStart,r=""!==this.hoverDate&&this.hoverDate>=this.pendingStart?this.hoverDate:"";return{inRange:""!==r&&e>this.pendingStart&&e<=r,isRangeStart:a,isRangeEnd:""!==r&&e===r,isSelectedEdge:a}}if(null!=this.displayValue&&""!==this.displayValue[0]&&""!==this.displayValue[1]){const[a,r]=this.displayValue,n=e===a,d=e===r;return{inRange:e>a&&e<r,isRangeStart:n,isRangeEnd:d,isSelectedEdge:n||d}}return{inRange:!1,isRangeStart:!1,isRangeEnd:!1,isSelectedEdge:!1}}renderHeader(e,a,r){const d=`${e}.${String(a).padStart(2,"0")}`;return n("div",{class:"sd-date-range-picker-calendar__header"},n("div",{class:"sd-date-range-picker-calendar__nav-group sd-date-range-picker-calendar__nav-group-month"},n("sd-ghost-button",{class:{"sd-date-range-picker-calendar__nav-placeholder":!r},ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),n("span",{class:"sd-date-range-picker-calendar__label sd-date-range-picker-calendar__label-month"},d),n("sd-ghost-button",{class:{"sd-date-range-picker-calendar__nav-placeholder":r},ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth})))}renderYearNav(){return n("div",{class:"sd-date-range-picker-calendar__top-bar"},n("div",{class:"sd-date-range-picker-calendar__year-nav"},n("sd-ghost-button",{ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),n("span",{class:"sd-date-range-picker-calendar__label"},this.currentYear),n("sd-ghost-button",{ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),n("button",{type:"button",class:"sd-date-range-picker-calendar__today-button",onClick:this.goToday},"오늘"))}renderPanel(e,a,r){const d=this.buildCells(e,a);return n("div",{class:"sd-date-range-picker-calendar__panel"},this.renderHeader(e,a,r),n("div",{class:"sd-date-range-picker-calendar__week"},c.map((e=>n("span",{key:e,class:"sd-date-range-picker-calendar__week-cell"},e)))),n("div",{class:"sd-date-range-picker-calendar__grid"},d.map((e=>{const{inRange:a,isRangeStart:r,isRangeEnd:d,isSelectedEdge:t}=this.getRangeState(e.date,e.inCurrentMonth),i=e.inCurrentMonth&&s===e.date,c=e.inCurrentMonth&&this.isDisabled(e.date);return n("button",{type:"button",key:e.date,class:{"sd-date-range-picker-calendar__day":!0,"sd-date-range-picker-calendar__day--empty":!e.inCurrentMonth,"sd-date-range-picker-calendar__day--today":i,"sd-date-range-picker-calendar__day--in-range":a,"sd-date-range-picker-calendar__day--range-start":r,"sd-date-range-picker-calendar__day--range-end":d,"sd-date-range-picker-calendar__day--selected":t,"sd-date-range-picker-calendar__day--disabled":c},disabled:!e.inCurrentMonth||c,tabindex:e.inCurrentMonth?void 0:-1,"aria-hidden":e.inCurrentMonth?void 0:"true",onClick:()=>this.handleDayClick(e),onMouseEnter:()=>this.handleDayHover(e)},n("span",{class:"sd-date-range-picker-calendar__day-circle"},e.inCurrentMonth?e.day:""))}))))}render(){return n(d,{key:"71f25effececd0b83d9b33201230dc615ba87a30"},n("div",{key:"f075474fb0be9f8e8562a013532b3cdbaadee069",class:"sd-date-range-picker-calendar",style:{"--calendar-bg":l.bg,"--calendar-padding":`${l.paddingXY}px`,"--calendar-gap":`${l.gap}px`,"--calendar-radius":`${l.radius}px`,"--calendar-header-gap":`${l.header.gap}px`,"--calendar-header-divider":l.header.divider,"--calendar-header-font-size":`${l.header.fontSize}px`,"--calendar-header-line-height":`${l.header.lineHeight}px`,"--calendar-header-font-weight":l.header.fontWeight,"--calendar-week-font-size":`${l.week.fontSize}px`,"--calendar-week-line-height":`${l.week.lineHeight}px`,"--calendar-week-font-weight":l.week.fontWeight,"--calendar-week-color":l.week.color,"--calendar-grid-row-gap":`${l.grid.rowGap}px`,"--calendar-day-size":`${l.day.size}px`,"--calendar-day-circle-size":`${l.day.circleSize}px`,"--calendar-day-circle-radius":`${l.day.circleRadius}px`,"--calendar-day-text":l.day.defaultText,"--calendar-day-hover-text":l.day.hoverText,"--calendar-day-hover-border":l.day.hoverBorder,"--calendar-day-select-bg":l.day.selectBg,"--calendar-day-select-text":l.day.selectText,"--calendar-day-disabled-text":l.day.disabledText,"--calendar-day-font-size":`${l.day.fontSize}px`,"--calendar-day-line-height":`${l.day.lineHeight}px`,"--calendar-day-font-weight":l.day.fontWeight,"--range-bg":_.bg,"--range-height":`${_.height}px`,"--range-panel-gap":`${_.panelGap}px`,"--range-divider":_.divider}},this.renderYearNav(),n("div",{key:"4dfa1d65b971f7d80f0799482c8ce41522200a94",class:"sd-date-range-picker-calendar__panels"},this.renderPanel(this.currentYear,this.currentMonth,!0),n("span",{key:"20149f97a5115115cc49894383ca7f989ba2b904",class:"sd-date-range-picker-calendar__divider","aria-hidden":"true"}),this.renderPanel(this.rightYear,this.rightMonth,!1))))}static get watchers(){return{value:[{handleValueChange:0}]}}static get style(){return"sd-date-range-picker-calendar{display:block}sd-date-range-picker-calendar .sd-date-range-picker-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);height:364px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2);user-select:none}sd-date-range-picker-calendar .sd-date-range-picker-calendar__top-bar{position:relative;display:flex;align-items:center;justify-content:center}sd-date-range-picker-calendar .sd-date-range-picker-calendar__year-nav{display:flex;align-items:center;justify-content:center;gap:var(--calendar-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__today-button{position:absolute;right:0;background:transparent;cursor:pointer;font-size:var(--calendar-week-font-size);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text);min-width:37px;height:24px;line-height:24px;text-align:center}sd-date-range-picker-calendar .sd-date-range-picker-calendar__today-button:hover{text-decoration:underline}sd-date-range-picker-calendar .sd-date-range-picker-calendar__panels{display:flex;flex-direction:row;gap:var(--range-panel-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__divider{flex-shrink:0;width:1px;background:var(--range-divider)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__panel{display:flex;flex-direction:column;gap:var(--calendar-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__header{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__nav-group-month{display:flex;width:100%;align-items:center;gap:var(--calendar-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-date-range-picker-calendar .sd-date-range-picker-calendar__label-month{flex:1}sd-date-range-picker-calendar .sd-date-range-picker-calendar__nav-placeholder{visibility:hidden;pointer-events:none}sd-date-range-picker-calendar .sd-date-range-picker-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-date-range-picker-calendar .sd-date-range-picker-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-size);height:var(--range-height);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day-circle{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day:not(:disabled):hover .sd-date-range-picker-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--today .sd-date-range-picker-calendar__day-circle{font-weight:700}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--in-range{background:var(--range-bg)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--range-start{background:linear-gradient(to right, transparent 50%, var(--range-bg) 50%)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--range-end{background:var(--range-bg)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--range-startsd-date-range-picker-calendar .sd-date-range-picker-calendar__day--range-end{background:transparent}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--selected .sd-date-range-picker-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--selected:not(:disabled):hover .sd-date-range-picker-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--disabled{color:var(--calendar-day-disabled-text);cursor:not-allowed}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--disabled:not(.sd-date-range-picker-calendar__day--in-range):not(.sd-date-range-picker-calendar__day--range-start):not(.sd-date-range-picker-calendar__day--range-end){background:none}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--empty{visibility:hidden;pointer-events:none;background:transparent}"}},[512,"sd-date-range-picker-calendar",{value:[16],selectable:[16],maxRange:[2,"max-range"],currentYear:[32],currentMonth:[32],pendingStart:[32],hoverDate:[32],displayValue:[32]},void 0,{value:[{handleValueChange:0}]}]);function y(){"undefined"!=typeof customElements&&["sd-date-range-picker-calendar","sd-ghost-button","sd-icon","sd-tag"].forEach((e=>{switch(e){case"sd-date-range-picker-calendar":customElements.get(t(e))||customElements.define(t(e),u);break;case"sd-ghost-button":customElements.get(t(e))||o();break;case"sd-icon":customElements.get(t(e))||h();break;case"sd-tag":customElements.get(t(e))||p()}}))}export{u as S,y as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as i,d as o,t as r}from"./p-Bg9XySrz.js";import{T as l}from"./p-sZMi_32I.js";import{a,r as h,e as n,c,f as d,g as b,h as p,i as f}from"./p-Cmg10jpN.js";import{d as g}from"./p-DDR0VcRU.js";import{d as m}from"./p-DbLQoVx6.js";import{d as y}from"./p-BLNc_TL-.js";import{d as u}from"./p-DTFXzlvq.js";import{d as x}from"./p-ClKABgST.js";import{d as k}from"./p-BMIgVp9-.js";import{d as _}from"./p-Cl5io5TH.js";const v=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.sdColumnSort=s(this,"sdColumnSort",7)}get el(){return this}columns;selectable;resizable;stickyColumn;stickyHeader;scrolledLeft;scrolledRight;rows=[];columnWidths=[];sdColumnSort;tableId="";_columns=[];_selectable=!1;_resizable=!1;_stickyColumn={left:0,right:0};_stickyHeader=!1;_scrolledLeft=!1;_scrolledRight=!1;tableEl=null;handleColumnsChange(t){Array.isArray(t)&&0===(this.columnWidths??[]).length&&(this.columnWidths=t.map((t=>t.autoWidth?0:parseInt(t.width||"120",10))))}componentWillLoad(){this.syncTableContext(),this.columnWidths=Array.isArray(this.columnWidths)?this.columnWidths:[],this.resolveConfig(),0===(this.columnWidths??[]).length&&(this.columnWidths=this._columns.map((t=>t.autoWidth?0:parseInt(t.width||"120",10))))}componentDidLoad(){this.syncTableContext(),this.resolveConfig()}syncTableContext(){const t=this.el.closest("sd-table"),e=this.el.getRootNode(),s=e instanceof ShadowRoot?e.host:null,i=t??s;this.tableEl=i;const o=i?.getTableIdSync?.(),r=i?.getAttribute(l),a=(null!=o&&""!==o&&"undefined"!==o?o:null)??(null!=r&&""!==r&&"undefined"!==r?r:null)??"";""!==a&&a!==this.tableId&&(this.tableId=a)}resolveConfig(){const t=this.tableEl?.getConfigSync?.(),e=Array.isArray(this.columns)?this.columns:Array.isArray(t?.columns)?t.columns:[];this._columns=e,this._selectable=this.selectable??t?.selectable??!1,this._resizable=this.resizable??t?.resizable??!1,this._stickyColumn=this.stickyColumn??t?.stickyColumn??{left:0,right:0},this._stickyHeader=this.stickyHeader??t?.stickyHeader??!1,this._scrolledLeft=this.scrolledLeft??t?.scrolledLeft??!1,this._scrolledRight=this.scrolledRight??t?.scrolledRight??!1,Array.isArray(t?.columnWidths)&&0===(this.columnWidths??[]).length&&(this.columnWidths=[...t.columnWidths]),Array.isArray(this.columnWidths)||(this.columnWidths=[])}async refreshConfig(){this.resolveConfig()}async setColumnWidths(t){this.columnWidths=Array.isArray(t)?t:[]}async refreshSelection(){const t=this.el.querySelector("sd-checkbox");t&&(t.value=this.getIsAllChecked())}get visibleColumns(){return this._columns.filter((t=>!1!==t.visible))}getStickyStyle(t){if(this.tableEl?.getStickyStyleSync)return this.tableEl.getStickyStyleSync(t);const e=this.columnWidths.slice(0,t).reduce(((t,e)=>t+e),0)+(this._selectable?a:0),s=this.columnWidths.filter(((e,s)=>s>=this.visibleColumns.length-(this._stickyColumn.right||0)&&s>t)).reduce(((t,e)=>t+e),0),i=this.visibleColumns[t],o={"--sticky-left-offset":`${e}px`,"--sticky-right-offset":`${s}px`};return i?.autoWidth||(o.width=`${this.columnWidths[t]}px`,o.minWidth=`${this.columnWidths[t]}px`,o.maxWidth=`${this.columnWidths[t]}px`),o}handleResize(t,e,s=!1){this.tableEl?.handleResize&&this.tableEl.handleResize(t,e,s)}handleColumnSort=t=>{this.sdColumnSort.emit({column:t})};handleSelectAll(t){const e=!!t,s=Array.isArray(this.rows)?this.rows:[];this.tableEl?.toggleSelectAllSync&&this.tableEl.toggleSelectAllSync(e,s)}getIsAllChecked(){const t=Array.isArray(this.rows)?this.rows:[];return!!(this.tableEl?.getIsAllCheckedSync&&t.length>0)&&this.tableEl.getIsAllCheckedSync(t)}render(){const t=Array.isArray(this.rows)?this.rows:[],e=this._stickyColumn.left||0,s=this._stickyColumn.right||0,r=this.visibleColumns.slice(0,e),l=this.visibleColumns.slice(e,this.visibleColumns.length-s),a=this.visibleColumns.slice(this.visibleColumns.length-s),g=this.visibleColumns.length-1;return i(o,{key:"1e352d3996dc6cd60acd20c22c8c426edabaa9ea",slot:`${this.tableId}-head`,style:{"--table-header-height":`${f.height}px`,"--table-header-padding-x":`${f.paddingX}px`,"--table-header-gap":`${f.gap}px`,"--table-header-bg":p.bg,"--table-header-font-family":b.fontFamily,"--table-header-font-weight":b.fontWeight,"--table-header-font-size":`${b.fontSize}px`,"--table-header-line-height":`${b.lineHeight}px`,"--table-header-text-decoration":b.textDecoration,"--table-header-resizer-color":d.color,"--table-header-resizer-height":`${d.height}px`,"--table-border-color":c.color,"--table-border-width":`${c.width}px`}},i("thead",{key:"d76dbdd5b03096197fe09d69c198ab3a5892106c",class:{thead:!0,"thead--sticky":this._stickyHeader}},i("tr",{key:"fb0c1f8ff93ddb8682b07e9b4f55eaf56b1be41a",class:"tr"},this._selectable&&i("th",{key:"a53b9771dbec3ef7f3888bf9fc9393c683356c50",class:{th:!0,"th--selected":!0,"sticky-left":!0,"sticky-left-edge":0===e,"is-scrolled-left":0===e&&this._scrolledLeft},style:{"--sticky-left-offset":"0px"}},i("sd-checkbox",{key:"8dc233b34b68a5daca91a60364ec8faffeb4b21d",value:this.getIsAllChecked(),disabled:0===t.length,onSdUpdate:t=>this.handleSelectAll(t.detail)}),i("div",{key:"bfc496c2468f3f81c1db4ffe70584a9229bd3512",class:"th__bar"})),r.map(((t,s)=>i("th",{key:t.name,class:{th:!0,[`${t.thClass}`]:Boolean(t.thClass),"sticky-left":!0,"sticky-left-edge":s===e-1,"is-scrolled-left":s===e-1&&this._scrolledLeft},style:{...t.thStyle,...this.getStickyStyle(s)}},i("div",{class:`th__content th__content--${t.align||"left"}`},i("div",{class:"th__content--label"},t.label),t.icon&&i("sd-icon",{name:t.icon,size:"12",color:h(t.icon,t.iconColor)}),t.sort&&i("sd-icon",{name:n(t.sort),size:"12",color:h(n(t.sort),t.iconColor),onClick:()=>this.handleColumnSort(t),style:{cursor:"pointer"}}),t.tooltip&&i("sd-tooltip",{...t.tooltipOptions},i("div",{slot:"content"},t.tooltip.map((t=>i("p",null,t)))))),this._resizable&&s!==g&&i("div",{class:"th__resizer",onMouseDown:t=>this.handleResize(s,t)})))),l.map(((t,s)=>{const o=e+s;return i("th",{key:t.name,class:{th:!0,[`${t.thClass}`]:Boolean(t.thClass)},style:{...t.thStyle,...this.getStickyStyle(o)}},i("div",{class:`th__content th__content--${t.align||"left"}`},i("div",{class:"th__content--label"},t.label),t.icon&&i("sd-icon",{name:t.icon,size:"12",color:h(t.icon,t.iconColor)}),t.sort&&i("sd-icon",{name:n(t.sort),size:"12",color:h(n(t.sort),t.iconColor),onClick:()=>this.handleColumnSort(t),style:{cursor:"pointer"}}),t.tooltip&&i("sd-tooltip",{...t.tooltipOptions},i("div",{slot:"content"},t.tooltip.map((t=>i("p",null,t)))))),this._resizable&&o!==g&&i("div",{class:"th__resizer",onMouseDown:t=>this.handleResize(o,t)}))})),a.map(((t,e)=>{const o=this.visibleColumns.length-s+e;return i("th",{key:t.name,class:{th:!0,[`${t.thClass}`]:Boolean(t.thClass),"sticky-right":!0,"sticky-right-edge":0===e,"is-scrolled-right":0===e&&this._scrolledRight},style:{...t.thStyle,...this.getStickyStyle(o)}},i("div",{class:`th__content th__content--${t.align||"left"}`},i("div",{class:"th__content--label"},t.label),t.icon&&i("sd-icon",{name:t.icon,size:"12",color:h(t.icon,t.iconColor)}),t.sort&&i("sd-icon",{name:n(t.sort),size:"12",color:h(n(t.sort),t.iconColor),onClick:()=>this.handleColumnSort(t),style:{cursor:"pointer"}}),t.tooltip&&i("sd-tooltip",{...t.tooltipOptions},i("div",{slot:"content"},t.tooltip.map((t=>i("p",null,t)))))),this._resizable&&i("div",{class:"th__resizer th__resizer--left",onMouseDown:t=>this.handleResize(o,t,!0)}))})))))}static get watchers(){return{columns:[{handleColumnsChange:0}]}}static get style(){return'sd-thead{display:contents}sd-thead *{box-sizing:border-box}.thead{display:table-header-group;height:var(--table-header-height, 36px)}.thead--sticky{position:sticky;top:0;z-index:120}.tr{display:table-row;width:100%}.th{display:table-cell;background:var(--table-header-bg, #F5FAFF);height:var(--table-header-height, 36px);padding:0 var(--table-header-padding-x, 16px);font-family:var(--table-header-font-family, inherit);font-weight:var(--table-header-font-weight, 500);font-size:var(--table-header-font-size, 12px);line-height:var(--table-header-line-height, 20px);text-decoration:var(--table-header-text-decoration, none);vertical-align:middle;border-bottom:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);-webkit-user-select:none;user-select:none;position:relative;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.th--selected{position:relative;width:var(--table-selectable-width, 48px) !important;max-width:var(--table-selectable-width, 48px) !important;min-width:var(--table-selectable-width, 48px) !important;text-align:center}.th--selected sd-checkbox label{position:relative}.th--selected sd-checkbox label:before{content:"";position:absolute;inset:-6px}.th.sticky-left{position:sticky;background-color:var(--table-header-bg, #F5FAFF);z-index:110 !important;left:var(--sticky-left-offset, 0)}.th.sticky-right{position:sticky;background-color:var(--table-header-bg, #F5FAFF);z-index:110 !important;right:var(--sticky-right-offset, 0)}.th.sticky-left-edge:after{content:"";position:absolute;top:0;left:100%;right:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset 12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.th.sticky-right-edge:after{content:"";position:absolute;top:0;left:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset -12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.th.sticky-left-edge.is-scrolled-left{overflow:visible}.th.sticky-left-edge.is-scrolled-left:after{opacity:1}.th.sticky-right-edge.is-scrolled-right{overflow:visible}.th.sticky-right-edge.is-scrolled-right:after{opacity:1}.th__content{display:flex;flex-flow:row nowrap;align-items:center;gap:var(--table-header-gap, 4px)}.th__content--left{justify-content:flex-start}.th__content--center{justify-content:center}.th__content--right{justify-content:flex-end}.th__content--label{white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.th__bar{position:absolute;top:50%;right:0;transform:translateY(-50%);width:var(--table-border-width, 1px);height:var(--table-header-resizer-height, 16px);z-index:3;background-color:var(--table-header-resizer-color, #CCCCCC)}.th__resizer{position:absolute;top:50%;right:0;transform:translateY(-50%);width:4px;height:var(--table-header-resizer-height, 16px);cursor:col-resize;z-index:3;border-left:var(--table-border-width, 1px) solid var(--table-header-resizer-color, #CCCCCC);border-right:var(--table-border-width, 1px) solid var(--table-header-resizer-color, #CCCCCC)}.th__resizer--left{right:auto;left:0}'}},[512,"sd-thead",{columns:[16],selectable:[4],resizable:[4],stickyColumn:[16],stickyHeader:[4,"sticky-header"],scrolledLeft:[4,"scrolled-left"],scrolledRight:[4,"scrolled-right"],rows:[16],columnWidths:[1040],tableId:[32],_columns:[32],_selectable:[32],_resizable:[32],_stickyColumn:[32],_stickyHeader:[32],_scrolledLeft:[32],_scrolledRight:[32],refreshConfig:[64],setColumnWidths:[64],refreshSelection:[64]},void 0,{columns:[{handleColumnsChange:0}]}]);function w(){"undefined"!=typeof customElements&&["sd-thead","sd-button","sd-checkbox","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag","sd-tooltip"].forEach((t=>{switch(t){case"sd-thead":customElements.get(r(t))||customElements.define(r(t),v);break;case"sd-button":customElements.get(r(t))||g();break;case"sd-checkbox":customElements.get(r(t))||m();break;case"sd-floating-portal":customElements.get(r(t))||y();break;case"sd-ghost-button":customElements.get(r(t))||u();break;case"sd-icon":customElements.get(r(t))||x();break;case"sd-tag":customElements.get(r(t))||k();break;case"sd-tooltip":customElements.get(r(t))||_()}}))}export{v as S,w as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as s,h as e,F as i,t as o}from"./p-Bg9XySrz.js";import{T as n}from"./p-0VCXAYrh.js";import{d as a}from"./p-DDR0VcRU.js";import{d as l}from"./p-BLNc_TL-.js";import{d as c}from"./p-DTFXzlvq.js";import{d as r}from"./p-ClKABgST.js";import{d}from"./p-BMIgVp9-.js";var h={bg:"#07284A",content:"#FFFFFF"},g={bg:"#FCEFEF",content:"#FB4444"},m={bg:"#FEF1EA",content:"#FF6B00"},p={bg:"#E6F1FF",content:"#0075FF"};const b={default:{bg:h.bg,content:h.content},danger:{bg:g.bg,content:g.content},warning:{bg:m.bg,content:m.content},accent:{bg:p.bg,content:p.content}},u=t(class t extends s{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}trigger="hover";placement="top";color="#01BB4B";tooltipType="default";icon="helpOutline";iconSize=12;label="";name="primary_sm";rightIcon;ariaLabel="";disabled=!1;type="button";useClose=!1;sdClass="";message=[];triggerClass="";triggerStyle="";showTooltip=!1;slotContentHTML="";buttonEl;triggerEl;isAnchorMode=!1;menuEl;hideTimeout;closeTimeout;static CLOSE_ANIM_MS=150;openTooltip=()=>{this.cancelHideTimer(),this.showTooltip=!0,this.menuEl&&this.menuEl.classList.remove("sd-floating-menu--closing")};closeTooltip=()=>{this.menuEl&&this.menuEl.classList.add("sd-floating-menu--closing"),this.closeTimeout=setTimeout((()=>{this.showTooltip=!1}),t.CLOSE_ANIM_MS)};startHideTimer=()=>{this.hideTimeout=setTimeout((()=>this.closeTooltip()),100)};cancelHideTimer=()=>{this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=void 0)};get tooltipOffset(){switch(this.placement??"top"){case"top":return[0,-4];case"bottom":return[0,4];case"left":case"right":return[4,0]}}handleClose=()=>!this.useClose&&this.closeTooltip();async show(){this.openTooltip()}async hide(){this.closeTooltip()}componentWillLoad(){this.isAnchorMode=Array.from(this.el.children).some((t=>"anchor"===t.getAttribute("slot"))),this.isAnchorMode||(this.slotContentHTML=this.el.innerHTML,this.el.replaceChildren()),this.el.classList.toggle("visible",!0)}componentDidRender(){this.triggerEl&&""!==this.triggerStyle&&this.triggerEl.setAttribute("style",this.triggerStyle)}render(){const t=this.trigger??"hover",s=this.placement??"top",o=this.tooltipType??"default",a=this.icon??"helpOutline",l=this.color??"#01BB4B",c=b[o]??b.default,r=()=>this.showTooltip=!this.showTooltip,d=void 0!==this.label&&""!==this.label,h=this.isAnchorMode,g="hover"===t?{onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>!this.useClose&&this.startHideTimer()}:h||!d?{onClick:r}:{},m="click"===t&&!h&&d?{onSdClick:r}:{},p=["sd-tooltip-trigger",this.sdClass,this.triggerClass].filter((t=>void 0!==t&&""!==t)).join(" "),u=this.message&&this.message.length>0?this.message.map((t=>`<div>${t}</div>`)).join(""):this.slotContentHTML;return e(i,{key:"c0d000057ed61fe7b6b4d92bc0df5e0c6d42d714"},e("div",{key:"4ae084008ddec50e912fa81efbe3adbe0428d7ea",ref:t=>this.triggerEl=t,class:p,...g},h?e("slot",{name:"anchor"}):d?e("sd-button",{ref:t=>this.buttonEl=t,name:this.name??"primary_sm",label:this.label,icon:a,rightIcon:this.rightIcon,ariaLabel:this.ariaLabel,disabled:this.disabled,type:this.type??"button",class:"sd-tooltip",...m}):e("sd-icon",{ref:t=>this.buttonEl=t,name:a,size:this.iconSize??12,color:l,class:"sd-tooltip"})),this.showTooltip&&e("sd-floating-portal",{key:"d5a8718b4e4556b989e5439b89296a259d99c636",parentRef:h?this.triggerEl:this.buttonEl,onSdClose:this.handleClose,placement:s,offset:this.tooltipOffset},e("div",{key:"e81f2704ddbc90a19c1e8dd0c4660c4b057ca895",ref:t=>this.menuEl=t,class:{"sd-floating-menu":!0,[`sd-floating-menu--${o}`]:!0,[`sd-floating-menu--${s}`]:!0,"sd-floating-menu--has-close":this.useClose},style:{"--sd-floating-bg":c.bg,"--sd-floating-content":c.content},onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>!this.useClose&&this.startHideTimer()},e("i",{key:"735cfb9956644542afb3b9f65aea127c37d756b2",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${s}`},e(n,{key:"53bac0c98b652b580b53b206d3da77deac0eea77"})),e("div",{key:"50c55e606002225363364ca6b5238a55a25374ba",class:"sd-floating-menu__content",innerHTML:u}),this.useClose&&e("sd-ghost-button",{key:"7ab15f030aef1ecda2a3be0c08af2c7ab4992f1c",class:"sd-floating-menu__close-button",icon:"close",ariaLabel:"close",size:"xxs",onClick:()=>this.closeTooltip()}))))}static get style(){return"sd-tooltip{visibility:hidden !important;display:inline-flex}sd-tooltip.visible{visibility:visible !important}sd-tooltip .sd-tooltip-trigger{display:inline-flex;position:relative;cursor:pointer;align-items:center;justify-content:center}"}},[772,"sd-tooltip",{trigger:[1],placement:[1],color:[1],tooltipType:[1,"tooltip-type"],icon:[1],iconSize:[2,"icon-size"],label:[1],name:[1],rightIcon:[1,"right-icon"],ariaLabel:[1,"aria-label"],disabled:[4],type:[1],useClose:[4,"use-close"],sdClass:[1,"sd-class"],message:[16],triggerClass:[1,"trigger-class"],triggerStyle:[1,"trigger-style"],showTooltip:[32],slotContentHTML:[32],show:[64],hide:[64]}]);function f(){"undefined"!=typeof customElements&&["sd-tooltip","sd-button","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag"].forEach((t=>{switch(t){case"sd-tooltip":customElements.get(o(t))||customElements.define(o(t),u);break;case"sd-button":customElements.get(o(t))||a();break;case"sd-floating-portal":customElements.get(o(t))||l();break;case"sd-ghost-button":customElements.get(o(t))||c();break;case"sd-icon":customElements.get(o(t))||r();break;case"sd-tag":customElements.get(o(t))||d()}}))}export{u as S,f as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as s,c as e,h as a,t as o}from"./p-Bg9XySrz.js";import{d as n}from"./p-DDR0VcRU.js";import{d as c}from"./p-DTFXzlvq.js";import{d as i}from"./p-ClKABgST.js";import{d}from"./p-BMIgVp9-.js";var l={bg:"#07284A",content:"#FFFFFF"},r={bg:"#FB4444",content:"#FFFFFF"},b={bg:"#FFC700",content:"#222222"},u={bg:"#00973C",content:"#FFFFFF"},f={bg:"#005CC9",content:"#FFFFFF"},p={bg:"#E6F1FF",icon:"#0075FF",text:"#222222",textLink:"#555555"};const g={default:"secondary_sm",danger:"danger_outline_sm",caution:"neutral_outline_sm",complete:"neutral_outline_sm",accent:"neutral_outline_sm",info:"secondary_sm"},m={default:{bg:l.bg,content:l.content},danger:{bg:r.bg,content:r.content},caution:{bg:b.bg,content:b.content},complete:{bg:u.bg,content:u.content},accent:{bg:f.bg,content:f.content},info:{bg:p.bg,content:p.text,icon:p.icon,linkColor:p.textLink}},h={iconSize:"16"},_=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=e(this,"sdClose",7),this.buttonClick=e(this,"sdButtonClick",7)}icon;message;link;linkLabel;buttonLabel;useClose=!1;type="default";close;buttonClick;render(){const t=m[this.type]??m.default,s=Number(h.iconSize),e=t.icon??t.content,o=t.linkColor??t.content,n=["default","caution","info"].includes(this.type),c=g[this.type]??g.default;return a("div",{key:"656bf6231262cc7d974adbe5f0ce0053d03aca84",style:{"--sd-toast-bg":t.bg,"--sd-toast-text":t.content,"--sd-toast-icon":e,"--sd-toast-link":o}},a("div",{key:"1e15e50c926ce65cea86db069dd1e79a642da01c",class:"sd-toast",role:"status","aria-live":"polite","aria-atomic":"true"},this.icon&&a("div",{key:"692277c23c4530d9fa0c5e26ea9d3b9759024dea",class:"sd-toast__icon"},a("sd-icon",{key:"0a15993313f3a9d1f27d6ae727c2c248c3390701",name:this.icon,size:s,color:e})),a("div",{key:"9c1af0c9cedbb772b9b59ae80a0ff861066aa0de",class:"sd-toast__content"},a("span",{key:"2aacd89fe1cf31f271da027459a6cfaece3dbdbf",class:"sd-toast__message"},this.message)),this.link&&a("a",{key:"094a68e843d9ab50cea46a506d6ccdc1ebf375d7",href:this.link,class:"sd-toast__link",target:"_blank",rel:"noopener noreferrer"},this.linkLabel||this.link),this.buttonLabel&&a("sd-button",{key:"7dabe182870a01cf285ee7441dfe39b07e943751",class:"sd-toast__button",name:c,label:this.buttonLabel,onSdClick:t=>this.buttonClick.emit(t.detail)}),this.useClose&&a("sd-ghost-button",{key:"2a893c6ace888d8f21ce16c9dbf2a35b23bc9372",class:"sd-toast__close",icon:"close",intent:n?"default":"inverse",ariaLabel:"close",size:"xs",onClick:()=>this.close.emit()})))}static get style(){return"sd-toast{display:block;width:fit-content;height:fit-content}sd-toast .sd-toast{display:flex;width:fit-content;align-items:center;gap:var(--sd-toast-gap, 16px);padding:var(--sd-toast-padding-y, 12px) var(--sd-toast-padding-x, 24px);border-radius:var(--sd-toast-radius, 8px);background-color:var(--sd-toast-bg);color:var(--sd-toast-text);box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}sd-toast .sd-toast__icon{display:flex;align-items:center;flex-shrink:0}sd-toast .sd-toast__content{display:flex;flex:1}sd-toast .sd-toast__message{font-size:14px;line-height:24px;font-weight:500;white-space:nowrap}sd-toast .sd-toast__link{font-size:14px;line-height:24px;font-weight:700;color:var(--sd-toast-link, var(--sd-toast-text));text-decoration:underline;cursor:pointer;transition:opacity 0.2s ease;margin-left:4px;white-space:nowrap}sd-toast .sd-toast__link:hover{opacity:0.8}sd-toast .sd-toast__button{flex-shrink:0}sd-toast .sd-toast__close{flex-shrink:0}"}},[512,"sd-toast",{icon:[1],message:[1],link:[1],linkLabel:[1,"link-label"],buttonLabel:[1,"button-label"],useClose:[4,"use-close"],type:[1]}]);function k(){"undefined"!=typeof customElements&&["sd-toast","sd-button","sd-ghost-button","sd-icon","sd-tag"].forEach((t=>{switch(t){case"sd-toast":customElements.get(o(t))||customElements.define(o(t),_);break;case"sd-button":customElements.get(o(t))||n();break;case"sd-ghost-button":customElements.get(o(t))||c();break;case"sd-icon":customElements.get(o(t))||i();break;case"sd-tag":customElements.get(o(t))||d()}}))}export{_ as S,k as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as s,c as e,h as o,t as i}from"./p-Bg9XySrz.js";import{d as n}from"./p-ClKABgST.js";import{d as a}from"./p-BMIgVp9-.js";var r={size:"16",icon:"12"},d={size:"24",icon:"16"},b={size:"28",icon:"20"},c={size:"36",icon:"24"},l={size:"62",icon:"32"},u={sm:"4",md:"6"},h={opacity:"5%"},g={disabled:"#BBBBBB"},p={content:"#888888",hover:{bg:"#222222"}},m={content:"#E30000",hover:{bg:"#E30000"}},f={content:"#025497",hover:{bg:"#0075FF"}},v={content:"#FFFFFF",disabled:"#E1E1E1",hover:{bg:"#FFFFFF"}};const y={xxs:{size:Number(r.size),icon:Number(r.icon)},xs:{size:Number(d.size),icon:Number(d.icon)},sm:{size:Number(b.size),icon:Number(b.icon)},md:{size:Number(c.size),icon:Number(c.icon)},lg:{size:Number(l.size),icon:Number(l.icon)}},x={xxs:Number(u.sm),xs:Number(u.sm),sm:Number(u.sm),md:Number(u.md),lg:Number(u.md)},z=h.opacity,F={default:p.content,danger:m.content,action:f.content,inverse:v.content},N={default:p.hover.bg,danger:m.hover.bg,action:f.hover.bg,inverse:v.hover.bg},k=g.disabled,w={default:k,danger:k,action:k,inverse:v.disabled},E=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.click=e(this,"sdClick",7)}icon;size="sm";intent="default";ariaLabel="";tooltipLabel="";disabled=!1;click;hasWarnedMissingAriaLabel=!1;componentWillLoad(){this.size??="sm",this.intent??="default",this.ariaLabel??="",this.tooltipLabel??=""}handleClick=t=>{this.disabled?t.preventDefault():this.click.emit(t)};componentWillRender(){this.warnIfMissingAriaLabel()}warnIfMissingAriaLabel(){""===(this.ariaLabel??"").trim()?this.hasWarnedMissingAriaLabel||(console.warn(`[sd-ghost-button] icon-only buttons require \`ariaLabel\`. Received icon="${this.icon}".`),this.hasWarnedMissingAriaLabel=!0):this.hasWarnedMissingAriaLabel=!1}render(){const t=this.size??"sm",s=this.intent??"default",e=y[t]??y.sm,i=this.disabled?w[s]:F[s],n=(this.ariaLabel??"").trim()||void 0,a=(this.tooltipLabel??"").trim(),r=a.length>0;return o("button",{key:"fafdeaa60205f0190cc592ac8fdacbf140e28d6c",class:{"sd-ghost-button":!0,"sd-ghost-button--disabled":this.disabled,"sd-ghost-button--with-tooltip":r},type:"button",disabled:this.disabled,"aria-label":n,style:{"--sd-ghost-button-size":`${e.size}px`,"--sd-ghost-button-radius":`${x[t]}px`,"--sd-ghost-button-hover-bg":N[s],"--sd-ghost-button-hover-opacity":z,"--sd-ghost-button-accent":"#0075FF"},onClick:this.handleClick},r&&o("span",{key:"57425145ccc76a0bf960377cb13ba06e37195fa3",class:"sd-ghost-button__tooltip","aria-hidden":"true"},o("sd-tag",{key:"9d097c96d701431ac92aa7fb305c418bb570bc16",name:"square_xs_grey",label:a})),o("sd-icon",{key:"4b186b2fd33c70f4b47a2c736a53e1ac37bc2ebc",name:this.icon,size:e.icon,color:i}))}static get style(){return'sd-ghost-button{display:inline-flex;width:fit-content;height:fit-content}.sd-ghost-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sd-ghost-button-size);height:var(--sd-ghost-button-size);padding:0;border:none;border-radius:var(--sd-ghost-button-radius);background:transparent;cursor:pointer;box-sizing:border-box;transition:box-shadow 0.2s ease;-webkit-user-select:none;user-select:none}.sd-ghost-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--sd-ghost-button-hover-bg);opacity:0;transition:opacity 0.2s ease;pointer-events:none}.sd-ghost-button:hover:not(.sd-ghost-button--disabled)::before{opacity:var(--sd-ghost-button-hover-opacity)}.sd-ghost-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-ghost-button-accent)}.sd-ghost-button--disabled{cursor:not-allowed}.sd-ghost-button__tooltip{position:absolute;left:50%;bottom:calc(100% + 4px);transform:translateX(-50%) translateY(4px);z-index:1;display:inline-flex;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease}.sd-ghost-button--with-tooltip:hover:not(.sd-ghost-button--disabled) .sd-ghost-button__tooltip,.sd-ghost-button--with-tooltip:focus-visible:not(.sd-ghost-button--disabled) .sd-ghost-button__tooltip{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}'}},[512,"sd-ghost-button",{icon:[1],size:[1],intent:[1],ariaLabel:[1,"aria-label"],tooltipLabel:[1,"tooltip-label"],disabled:[4]}]);function _(){"undefined"!=typeof customElements&&["sd-ghost-button","sd-icon","sd-tag"].forEach((t=>{switch(t){case"sd-ghost-button":customElements.get(i(t))||customElements.define(i(t),E);break;case"sd-icon":customElements.get(i(t))||n();break;case"sd-tag":customElements.get(i(t))||a()}}))}export{E as S,_ as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as s,c as i,h as e,t as o}from"./p-Bg9XySrz.js";const h=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=i(this,"sdClose",3)}get hostEl(){return this}to="body";parentRef=null;offset=[0,4];viewportPadding=0;zIndex=998;open=!1;close;container;wrapper;rafId;isInsideClick=!1;closeTransitionTimer;handleObservedScroll=()=>this.updatePosition();resizeObserver;mutationObserver;scrollParents=[];isObserved=!1;handleOpenChange(){this.syncPortalState()}componentDidLoad(){this.container=this.resolveContainer(),this.syncPortalState()}componentDidRender(){this.syncPortalState()}disconnectedCallback(){if(this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.unobserveParent(),this.wrapper?.parentNode)try{this.wrapper.parentNode.removeChild(this.wrapper)}catch{}}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof s?t:document.body}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"fixed",top:"0",left:"0",zIndex:(this.zIndex??998).toString(),opacity:"0",transition:"opacity 0.15s ease-out",boxSizing:"border-box",visibility:"hidden"}),this.container.appendChild(this.wrapper)}ensureWrapper(){this.wrapper||(this.container||=this.resolveContainer(),this.createWrapper(),this.moveSlotContent())}syncPortalState(){if(!this.open)return this.wrapper&&(this.wrapper.style.transition="opacity 0.15s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="none",this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.closeTransitionTimer=setTimeout((()=>{this.wrapper&&!this.open&&(this.wrapper.style.display="none")}),150)),void this.unobserveParent();this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.ensureWrapper(),this.wrapper&&(this.wrapper.style.display="block",this.wrapper.style.transition="opacity 0.25s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="",this.observeParent(),this.updatePosition())}moveSlotContent(){this.wrapper&&Array.from(this.hostEl.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const t=this.parentRef.getBoundingClientRect(),s=window.innerWidth,i=window.innerHeight,e=this.offset??[0,4],o=Math.max(0,this.viewportPadding??0),h=Math.max(s-2*o,0),n=Math.max(i-2*o,0);this.wrapper.style.maxWidth=`${h}px`,this.wrapper.style.maxHeight=`${n}px`;const r=this.wrapper.getBoundingClientRect(),a=i-t.bottom-e[1]-o;let d=t.bottom+e[1],l=t.left+e[0];a<r.height&&t.top-e[1]-o>a&&(d=t.top-r.height-e[1]);const c=i-o-r.height;d=c<o?o:Math.min(Math.max(d,o),c),t.left+r.width+e[0]>s-o&&(l=t.right-r.width-e[0]);const p=s-o-r.width;l=p<o?o:Math.min(Math.max(l,o),p),this.wrapper.style.top=`${d}px`,this.wrapper.style.left=`${l}px`,this.wrapper.style.visibility="visible",this.wrapper.style.opacity="1"}))}observeParent(){this.parentRef&&!this.isObserved&&(this.observeScrollParents(this.parentRef),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef)),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})),this.isObserved=!0)}unobserveParent(){this.isObserved&&(this.unobserveScrollParents(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.mutationObserver?.disconnect(),this.mutationObserver=void 0,this.isObserved=!1)}observeScrollParents(t){const s=this.getScrollParents(t);s.forEach((t=>{t.addEventListener("scroll",this.handleObservedScroll,{passive:!0})})),this.scrollParents=s}unobserveScrollParents(){this.scrollParents.forEach((t=>{t.removeEventListener("scroll",this.handleObservedScroll)})),this.scrollParents=[]}getScrollParents(t){const s=[];let i=t.parentElement;for(;i;){const{overflow:t,overflowX:e,overflowY:o}=getComputedStyle(i);[t,e,o].some((t=>/(auto|scroll|overlay)/.test(t)))&&s.push(i),i=i.parentElement}return s}isInsideTarget(t){return!(!this.wrapper?.contains(t)&&!this.parentRef?.contains(t))}handleMouseDown(t){this.isInsideClick=this.isInsideTarget(t.target)}handleWindowClick(t){this.isInsideClick?this.isInsideClick=!1:this.isInsideTarget(t.target)||this.close.emit()}render(){return e("slot",{key:"22e09896836d017f33a9c6b92772a00fc85f8997"})}static get watchers(){return{open:[{handleOpenChange:0}]}}},[772,"sd-portal",{to:[1],parentRef:[16],offset:[16],viewportPadding:[2,"viewport-padding"],zIndex:[2,"z-index"],open:[4]},[[9,"scroll","updatePosition"],[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"]],{open:[{handleOpenChange:0}]}]);function n(){"undefined"!=typeof customElements&&["sd-portal"].forEach((t=>{"sd-portal"===t&&(customElements.get(o(t))||customElements.define(o(t),h))}))}export{h as S,n as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as o,c as s,h as e,t as a}from"./p-Bg9XySrz.js";import{s as i}from"./p-BE4tnQ2Z.js";import{m as d}from"./p-DOXMJi-V.js";import{d as n}from"./p-DDR0VcRU.js";import{d as l}from"./p-DTFXzlvq.js";import{d as m}from"./p-ClKABgST.js";import{d as r}from"./p-BMIgVp9-.js";const c={positive:"primary_md",negative:"danger_md",default:"neutral_outline_md"},f={positive:"notificationOutline",negative:"warningOutline",default:null},h={positive:d.modal.confirm.positive.icon,negative:d.modal.confirm.negative.icon,default:""},b=Number(d.modal.confirm.title.icon),p=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=s(this,"sdClose",7),this.cancel=s(this,"sdCancel",7),this.ok=s(this,"sdOk",7)}get el(){return this}hasSlottedContent=!1;customContentRef;slotObserver;type="positive";modalTitle="";titleClass="";topMessage=[];bottomMessage=[];mainButtonName;mainButtonLabel="확인";subButtonLabel="";tagPreset="square_sm_grey";tagLabel="";slotLabel="";tagContents;close;cancel;ok;componentWillLoad(){this.syncHasSlottedContent()}componentDidLoad(){"undefined"!=typeof MutationObserver&&(this.slotObserver=new MutationObserver((()=>this.syncHasSlottedContent())),this.slotObserver.observe(this.el,{childList:!0,characterData:!0}))}componentDidRender(){this.customContentRef&&this.tagContents instanceof o&&("function"==typeof this.customContentRef.replaceChildren?this.customContentRef.replaceChildren(this.tagContents):(this.customContentRef.innerHTML="",this.customContentRef.appendChild(this.tagContents)))}disconnectedCallback(){this.slotObserver?.disconnect()}get resolvedType(){return this.type??"positive"}get resolvedMainButton(){return this.mainButtonName??c[this.resolvedType]}get hasTagContent(){return void 0!==this.tagLabel&&""!==this.tagLabel||void 0!==this.slotLabel&&""!==this.slotLabel}get showContentBox(){return null!=this.tagContents||this.hasTagContent||this.hasSlottedContent}syncHasSlottedContent(){const t=Array.from(this.el.childNodes).some((t=>!(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("sd-confirm-modal"))&&(t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&t.textContent?.trim())));t!==this.hasSlottedContent&&(this.hasSlottedContent=t)}render(){const t=this.resolvedType,o=f[t],s=h[t];return e("div",{key:"51fb051b436cc511aeac2f578832a267e12ef3c4",class:"sd-confirm-modal"},e("sd-ghost-button",{key:"dd9605e312eac8b0602ec558ad5439ea3daa7aa7",class:"sd-confirm-modal__close-button",icon:"close",ariaLabel:"close",onClick:()=>this.close.emit()}),o&&e("sd-icon",{key:"5027ec2d03731338a9197f7b5b910d2adbf83f0e",class:"sd-confirm-modal__icon",name:o,size:b,color:s}),e("h2",{key:"8456707355cc779c169b56abc16b0949909b829e",class:`sd-confirm-modal__title ${this.titleClass??""}`},this.modalTitle),e("div",{key:"d11cb38e749f54ce5767ba9b5cca0129df742aca",class:"sd-confirm-modal__body"},(this.topMessage??[]).length>0&&e("div",{key:"de653458605a9591d7c66d644a143d0f33738b28",class:"sd-confirm-modal__message"},(this.topMessage??[]).map((t=>e("p",{class:"sd-confirm-modal__message-text",innerHTML:i(t)})))),this.showContentBox&&e("div",{key:"0517e400485551ab21f0f5452af764b5ede7a76d",class:"sd-confirm-modal__content-box"},this.tagContents?e("div",{class:"sd-confirm-modal__custom-content",ref:t=>{this.customContentRef=t}}):e("slot",{onSlotchange:()=>this.syncHasSlottedContent()},this.tagLabel&&e("sd-tag",{name:this.tagPreset??"square_sm_grey",label:this.tagLabel}),this.slotLabel&&e("span",{class:"sd-confirm-modal__slot-label"},this.slotLabel))),(this.bottomMessage??[]).length>0&&e("div",{key:"d542a08caee30ed7eb1d22ed85a51be6e1f6855e",class:"sd-confirm-modal__message"},(this.bottomMessage??[]).map((t=>e("p",{class:"sd-confirm-modal__message-text",innerHTML:i(t)}))))),e("div",{key:"02d012e899969ee55cba43c11d9caeaaff65a348",class:"sd-confirm-modal__button"},this.subButtonLabel&&e("sd-button",{key:"fd50d151e515646e5bef5658a1b05b2e26b21461",name:"neutral_outline_md",label:this.subButtonLabel,onSdClick:()=>this.cancel.emit()}),e("sd-button",{key:"0c2092edf0866a8b1f4f432b176d78eedd9655d6",name:this.resolvedMainButton,label:this.mainButtonLabel??"확인",onSdClick:()=>this.ok.emit()})))}static get style(){return"sd-confirm-modal{display:block;width:fit-content;min-width:520px}sd-confirm-modal .sd-confirm-modal{position:relative;padding:var(--sd-modal-modal-confirm-padding-y) var(--sd-modal-modal-confirm-padding-x);border-radius:var(--sd-modal-modal-radius);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.2);background:var(--sd-modal-modal-bg)}sd-confirm-modal .sd-confirm-modal__close-button{position:absolute;top:12px;right:12px}sd-confirm-modal .sd-confirm-modal__icon{display:block;width:var(--sd-modal-modal-confirm-title-icon);height:var(--sd-modal-modal-confirm-title-icon);margin:0 auto var(--sd-modal-modal-confirm-title-gap) auto}sd-confirm-modal .sd-confirm-modal__title{color:var(--sd-modal-modal-confirm-title-color);font-size:var(--sd-modal-modal-confirm-title-typography-font-size);font-weight:var(--sd-modal-modal-confirm-title-typography-font-weight);line-height:var(--sd-modal-modal-confirm-title-typography-line-height);text-align:center;margin:0 0 var(--sd-modal-modal-confirm-body-gap) 0}sd-confirm-modal .sd-confirm-modal__body{display:flex;flex-direction:column;gap:var(--sd-modal-modal-confirm-body-gap)}sd-confirm-modal .sd-confirm-modal__message-text{color:var(--sd-modal-modal-confirm-message-color);font-size:12px;font-weight:400;line-height:20px;text-align:center;margin:0}sd-confirm-modal .sd-confirm-modal__content-box{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 16px;border:1px solid #e1e1e1;border-radius:8px;background:white}sd-confirm-modal .sd-confirm-modal__slot-label{font-size:14px;font-weight:700;line-height:22px;color:var(--sd-modal-modal-confirm-message-color)}sd-confirm-modal .sd-confirm-modal__button{display:flex;justify-content:center;gap:var(--sd-modal-modal-confirm-button-gap);margin-top:40px}"}},[772,"sd-confirm-modal",{type:[1],modalTitle:[1,"modal-title"],titleClass:[1,"title-class"],topMessage:[16],bottomMessage:[16],mainButtonName:[1,"main-button-name"],mainButtonLabel:[1,"main-button-label"],subButtonLabel:[1,"sub-button-label"],tagPreset:[1,"tag-preset"],tagLabel:[1,"tag-label"],slotLabel:[1,"slot-label"],tagContents:[16],hasSlottedContent:[32]}]);function g(){"undefined"!=typeof customElements&&["sd-confirm-modal","sd-button","sd-ghost-button","sd-icon","sd-tag"].forEach((t=>{switch(t){case"sd-confirm-modal":customElements.get(a(t))||customElements.define(a(t),p);break;case"sd-button":customElements.get(a(t))||n();break;case"sd-ghost-button":customElements.get(a(t))||l();break;case"sd-icon":customElements.get(a(t))||m();break;case"sd-tag":customElements.get(a(t))||r()}}))}export{p as S,g as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as t,c as a,h as s,t as r}from"./p-Bg9XySrz.js";import{n as d}from"./p-CCwNgVmC.js";import{i}from"./p-e0ABNkP6.js";import{d as o}from"./p-DDR0VcRU.js";import{d as l}from"./p-BX5uKVOt.js";import{d as n}from"./p-BLNc_TL-.js";import{d as h}from"./p-DTFXzlvq.js";import{d as c}from"./p-ClKABgST.js";import{d as u}from"./p-BMIgVp9-.js";import{d as p}from"./p-Cl5io5TH.js";const x={paddingX:i.textinput.sm.paddingX,paddingY:i.textinput.sm.paddingY,radius:i.textinput.sm.radius,fontSize:i.textinput.sm.typography.fontSize,lineHeight:i.textinput.sm.typography.lineHeight,fontWeight:i.textinput.sm.typography.fontWeight},m={text:i.textinput.text,bg:i.textinput.bg,border:i.textinput.border,resizer:i.textinput.resizer},g=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.input=a(this,"sdUpdate",7),this.focus=a(this,"sdFocus",7),this.blur=a(this,"sdBlur",7)}get host(){return this}value=null;placeholder="입력해 주세요.";disabled=!1;readonly=!1;autoFocus=!1;textareaClass="";textareaStyle={};maxLength;rows;spellcheck=!1;width="";label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";icon=void 0;labelTooltip="";labelTooltipProps=null;rules=[];error=!1;status;focused=!1;hovered=!1;internalValue=null;nativeEl=void 0;formField;name=d();input;focus;blur;valueChanged(e){this.internalValue=e}internalValueChanged(e){e!==this.value&&(this.value=e,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){null!=this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=e=>{this.internalValue=e.target.value};handleFocus=async(e,t)=>{this.focused="focus"===e,"blur"===e?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(t)):this.focus?.emit(t)};render(){return s("sd-field",{key:"526fc1a73f13e5170125a570c5a1c8459931aa25",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,readonly:this.readonly,focused:this.focused,hovered:this.hovered,status:this.status,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-textarea-font-size":`${x.fontSize}px`,"--sd-textarea-line-height":`${x.lineHeight}px`,"--sd-textarea-font-weight":x.fontWeight,"--sd-textarea-padding-x":`${x.paddingX}px`,"--sd-textarea-padding-y":`${x.paddingY}px`,"--sd-textarea-radius":`${x.radius}px`,"--sd-textarea-text-color":m.text.default,"--sd-textarea-placeholder-color":m.text.placeholder,"--sd-textarea-disabled-color":m.text.disabled,"--sd-textarea-bg-color":m.bg.default,"--sd-textarea-disabled-bg-color":m.bg.disabled,"--sd-textarea-border-color":m.border.default,"--sd-textarea-resizer-color":m.resizer.color,"--sd-system-size-field-sm-height":"auto","--sd-system-radius-field-sm":`${x.radius}px`}},s("div",{key:"e3c52fccc564a2488eb9e0d9399437b76e919c6a",class:"sd-textarea__content"},s("textarea",{key:"3253873da3b9591e64a6dfd170c8d9ccb4861599",name:this.name,ref:e=>this.nativeEl=e,class:`sd-textarea__native ${this.textareaClass}`,value:this.internalValue||"",placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readOnly:this.readonly,autofocus:this.autoFocus,maxLength:this.maxLength,rows:this.rows,spellcheck:this.spellcheck,onInput:this.handleInput,onFocus:e=>this.handleFocus("focus",e),onBlur:e=>this.handleFocus("blur",e),style:this.textareaStyle})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-textarea{display:inline-flex}sd-textarea .sd-textarea__content{width:100%;display:flex}sd-textarea .sd-textarea__content .sd-textarea__native{width:100%;min-height:100px;border:none;outline:none;background:transparent;padding:var(--sd-textarea-padding-y) var(--sd-textarea-padding-x);font-family:inherit;font-size:var(--sd-textarea-font-size);line-height:var(--sd-textarea-line-height);font-weight:var(--sd-textarea-font-weight);color:var(--sd-textarea-text-color);resize:vertical}sd-textarea .sd-textarea__content .sd-textarea__native::placeholder{color:var(--sd-textarea-placeholder-color)}sd-textarea .sd-textarea__content .sd-textarea__native:disabled{cursor:not-allowed;color:var(--sd-textarea-disabled-color)}sd-textarea .sd-textarea__content .sd-textarea__native[readonly]{color:var(--sd-system-color-field-text-read-only)}"}},[512,"sd-textarea",{value:[1025],placeholder:[1],disabled:[4],readonly:[4],autoFocus:[4,"auto-focus"],textareaClass:[1,"textarea-class"],textareaStyle:[16],maxLength:[2,"max-length"],rows:[2],spellcheck:[4],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],rules:[16],error:[1028],status:[1],focused:[1028],hovered:[1028],name:[1],internalValue:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function b(){"undefined"!=typeof customElements&&["sd-textarea","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-textarea":customElements.get(r(e))||customElements.define(r(e),g);break;case"sd-button":customElements.get(r(e))||o();break;case"sd-field":customElements.get(r(e))||l();break;case"sd-floating-portal":customElements.get(r(e))||n();break;case"sd-ghost-button":customElements.get(r(e))||h();break;case"sd-icon":customElements.get(r(e))||c();break;case"sd-tag":customElements.get(r(e))||u();break;case"sd-tooltip":customElements.get(r(e))||p()}}))}export{g as S,b as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as a,H as e,c as d,h as n,t as r}from"./p-Bg9XySrz.js";import{u as t,t as l,W as s,C as c}from"./p-BysikR_g.js";import{d as i}from"./p-DTFXzlvq.js";import{d as o}from"./p-ClKABgST.js";import{d as h}from"./p-BMIgVp9-.js";const g=a(class extends e{constructor(a){super(),!1!==a&&this.__registerHost(),this.update=d(this,"sdUpdate",7),this.viewChange=d(this,"sdViewChange",7)}value=null;selectable;events;elevated=!1;currentYear;currentMonth;update;viewChange;dateUtil=t();_eventMapCache;get eventMap(){const a=this._eventMapCache;if(a&&a.src===this.events)return a.map;const e=new Map;return(this.events??[]).forEach((a=>a.dates.forEach((d=>{const n=e.get(d)??[];n.push({color:a.color,label:a.label}),e.set(d,n)})))),this._eventMapCache={src:this.events,map:e},e}get legendItems(){const a=new Set,e=[];return(this.events??[]).forEach((d=>{const n=`${d.color}|${d.label}`;a.has(n)||(a.add(n),e.push({color:d.color,label:d.label}))})),e}componentWillLoad(){this.syncViewFromValue()}handleValueChange(){this.syncViewFromValue()}syncViewFromValue(){const a=this.value||l,[e,d]=a.split("-").map(Number);this.currentYear=e,this.currentMonth=d}formatDate(a,e,d){return`${a}-${String(e).padStart(2,"0")}-${String(d).padStart(2,"0")}`}get cells(){const a=this.currentYear,e=this.currentMonth,d=new Date(a,e-1,1).getDay(),n=new Date(a,e,0).getDate(),r=1===e?12:e-1,t=1===e?a-1:a,l=new Date(t,r,0).getDate(),s=12===e?1:e+1,c=12===e?a+1:a,i=[];for(let a=d-1;a>=0;a--){const e=l-a;i.push({date:this.formatDate(t,r,e),day:e,inCurrentMonth:!1})}for(let d=1;d<=n;d++)i.push({date:this.formatDate(a,e,d),day:d,inCurrentMonth:!0});const o=(7-i.length%7)%7;for(let a=1;a<=o;a++)i.push({date:this.formatDate(c,s,a),day:a,inCurrentMonth:!1});return i}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=a=>{a.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=a=>{a.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=a=>{a.stopPropagation();const{newYear:e,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=e,this.currentMonth=d,this.emitViewChange()};goNextMonth=a=>{a.stopPropagation();const{newYear:e,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=e,this.currentMonth=d,this.emitViewChange()};isDisabled(a){if(!this.selectable)return!1;const[e,d]=this.selectable;return""!==e&&a<e||""!==d&&a>d}handleDayClick(a){this.isDisabled(a.date)||(this.value=a.date,this.update.emit(a.date))}render(){const a={"--calendar-bg":c.bg,"--calendar-padding":`${c.paddingXY}px`,"--calendar-gap":`${c.gap}px`,"--calendar-radius":`${c.radius}px`,"--calendar-header-gap":`${c.header.gap}px`,"--calendar-header-divider":c.header.divider,"--calendar-header-font-size":`${c.header.fontSize}px`,"--calendar-header-line-height":`${c.header.lineHeight}px`,"--calendar-header-font-weight":c.header.fontWeight,"--calendar-week-font-size":`${c.week.fontSize}px`,"--calendar-week-line-height":`${c.week.lineHeight}px`,"--calendar-week-font-weight":c.week.fontWeight,"--calendar-week-color":c.week.color,"--calendar-grid-row-gap":`${c.grid.rowGap}px`,"--calendar-day-size":`${c.day.size}px`,"--calendar-day-circle-size":`${c.day.circleSize}px`,"--calendar-day-circle-radius":`${c.day.circleRadius}px`,"--calendar-day-text":c.day.defaultText,"--calendar-day-hover-text":c.day.hoverText,"--calendar-day-hover-border":c.day.hoverBorder,"--calendar-day-select-bg":c.day.selectBg,"--calendar-day-select-text":c.day.selectText,"--calendar-day-disabled-text":c.day.disabledText,"--calendar-day-font-size":`${c.day.fontSize}px`,"--calendar-day-line-height":`${c.day.lineHeight}px`,"--calendar-day-font-weight":c.day.fontWeight,"--calendar-day-bold-font-weight":c.day.boldFontWeight,"--calendar-day-dot-size":`${c.day.dot.size}px`,"--calendar-day-dot-gap":`${c.day.dot.gap}px`,"--calendar-day-dot-padding-y":`${c.day.dot.paddingY}px`,"--calendar-legend-font-size":`${c.legend.fontSize}px`,"--calendar-legend-line-height":`${c.legend.lineHeight}px`,"--calendar-legend-font-weight":c.legend.fontWeight,"--calendar-legend-gap":`${c.legend.gap}px`,"--calendar-legend-group-gap":`${c.legend.groupGap}px`},e=this.eventMap,d=this.legendItems,r=(this.events?.length??0)>0;return n("div",{key:"e939d5fae94ff8f44bd2167abd78ac331359f35d",class:{"sd-calendar":!0,"sd-calendar--elevated":this.elevated},style:a},n("div",{key:"2dad0f6cfd58d1a4ce430142df0af56ed0a5cfa3",class:"sd-calendar__header"},n("div",{key:"5d7424dc210f3ff9fa28ee5c24e958130449b798",class:"sd-calendar__nav-group"},n("sd-ghost-button",{key:"d15c0d1691492d0bbdb099893701c2538c183513",ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),n("span",{key:"a2e936f9a4626bdd4d48bcd7b513e33f76d4affb",class:"sd-calendar__label"},this.currentYear),n("sd-ghost-button",{key:"c4c50b1a3440ef2eeb1a0ed95c61d3f5b55ba055",ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),n("span",{key:"ec677bd90799db7032f188b521c32f06688c8659",class:"sd-calendar__divider","aria-hidden":"true"}),n("div",{key:"d8ab3d1a8efa607ee6f8cd4c3af5ba2d2af31639",class:"sd-calendar__nav-group sd-calendar__nav-group-month"},n("sd-ghost-button",{key:"1a76dcd9d9655bdac72d78a8bf6c40e546c9c4a1",ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),n("span",{key:"08b4274631b31aa028f14f8d3ecd63d135c125d7",class:"sd-calendar__label sd-calendar__label-month"},this.currentMonth,"월"),n("sd-ghost-button",{key:"ec404faf07c03f7a1949d2379a1313e99b712883",ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth}))),n("div",{key:"98775d3b2d885492347dec3e13258b33936b92bc",class:"sd-calendar__week"},s.map((a=>n("span",{key:a,class:"sd-calendar__week-cell"},a)))),n("div",{key:"87a4739a0ddf26302d22bcb39b545cffab44dd09",class:"sd-calendar__grid"},this.cells.map((a=>{const d=a.inCurrentMonth&&""!==this.value&&this.value===a.date,t=a.inCurrentMonth&&l===a.date,s=a.inCurrentMonth&&this.isDisabled(a.date),c=a.inCurrentMonth?e.get(a.date):void 0;return n("button",{type:"button",key:a.date,class:{"sd-calendar__day":!0,"sd-calendar__day--empty":!a.inCurrentMonth,"sd-calendar__day--today":t,"sd-calendar__day--selected":d,"sd-calendar__day--disabled":s},disabled:!a.inCurrentMonth||s,tabindex:a.inCurrentMonth?void 0:-1,"aria-hidden":a.inCurrentMonth?void 0:"true",onClick:()=>a.inCurrentMonth&&this.handleDayClick(a)},n("span",{class:"sd-calendar__day-circle"},a.inCurrentMonth?a.day:""),r&&n("span",{class:"sd-calendar__dot-row","aria-hidden":"true"},c?.map(((a,e)=>n("span",{key:`${a.color}|${a.label}|${e}`,class:"sd-calendar__dot",style:{backgroundColor:a.color}})))))}))),d.length>0&&[n("span",{key:"9c1c21573694ca6702d19ba451c31cbdb47e727c",class:"sd-calendar__divider-bottom","aria-hidden":"true"}),n("div",{key:"dae2d35ea2971f6c7b1b3ec4774934efb2fcd168",class:"sd-calendar__legend"},d.map((a=>n("span",{key:`${a.color}|${a.label}`,class:"sd-calendar__legend-item"},n("span",{class:"sd-calendar__legend-dot",style:{backgroundColor:a.color},"aria-hidden":"true"}),n("span",{class:"sd-calendar__legend-label"},a.label)))))])}static get watchers(){return{value:[{handleValueChange:0}]}}static get style(){return"sd-calendar{display:block}sd-calendar .sd-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);width:328px;min-height:328px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);user-select:none}sd-calendar .sd-calendar--elevated{box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-calendar .sd-calendar__header{display:flex;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-calendar .sd-calendar__nav-group-month{width:100%}sd-calendar .sd-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-calendar .sd-calendar__label-month{width:100%}sd-calendar .sd-calendar__divider{display:inline-block;width:1px;height:16px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-calendar .sd-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-calendar .sd-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-calendar .sd-calendar__day{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-start;width:var(--calendar-day-size);min-height:var(--calendar-day-circle-size);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__day-circle{display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-calendar .sd-calendar__day:not(:disabled):hover .sd-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-calendar .sd-calendar__day--today .sd-calendar__day-circle{font-weight:700}sd-calendar .sd-calendar__day--selected .sd-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--selected:not(:disabled):hover .sd-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--disabled{color:var(--calendar-day-disabled-text);background:none !important;cursor:not-allowed}sd-calendar .sd-calendar__day--empty{visibility:hidden;pointer-events:none}sd-calendar .sd-calendar__dot-row{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--calendar-day-dot-gap);box-sizing:border-box;width:100%;min-height:14px;padding-top:var(--calendar-day-dot-padding-y);padding-bottom:var(--calendar-day-dot-padding-y)}sd-calendar .sd-calendar__dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%}sd-calendar .sd-calendar__divider-bottom{display:block;width:100%;height:1px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__legend{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:var(--calendar-legend-group-gap);row-gap:4px;font-size:var(--calendar-legend-font-size);line-height:var(--calendar-legend-line-height);font-weight:var(--calendar-legend-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__legend-item{display:inline-flex;align-items:center;gap:var(--calendar-legend-gap)}sd-calendar .sd-calendar__legend-dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%;flex-shrink:0}sd-calendar .sd-calendar__legend-label{display:inline-block}"}},[512,"sd-calendar",{value:[1025],selectable:[16],events:[16],elevated:[4],currentYear:[32],currentMonth:[32]},void 0,{value:[{handleValueChange:0}]}]);function p(){"undefined"!=typeof customElements&&["sd-calendar","sd-ghost-button","sd-icon","sd-tag"].forEach((a=>{switch(a){case"sd-calendar":customElements.get(r(a))||customElements.define(r(a),g);break;case"sd-ghost-button":customElements.get(r(a))||i();break;case"sd-icon":customElements.get(r(a))||o();break;case"sd-tag":customElements.get(r(a))||h()}}))}export{g as S,p as d}
|