@sellmate/design-system 1.0.21 → 1.0.23
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/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/{select-keyboard-navigation-CtstKOb3.js → base-dropdown-event-BTPlZ1KF.js} +0 -38
- package/dist/cjs/component.button-C6xBMwHf.js +115 -0
- package/dist/cjs/design-system.cjs.js +4 -3
- package/dist/cjs/{index-D-PnW6jc.js → index-Qvv0fGgj.js} +9 -117
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/sd-badge.cjs.entry.js +2 -2
- package/dist/cjs/sd-button-v2.cjs.entry.js +86 -0
- package/dist/cjs/sd-button-v2.config-BK45EPK_.js +203 -0
- package/dist/cjs/sd-button_21.cjs.entry.js +121 -67
- package/dist/cjs/sd-card.cjs.entry.js +2 -2
- package/dist/cjs/sd-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +274 -0
- package/dist/cjs/sd-file-picker.cjs.entry.js +4 -4
- package/dist/cjs/sd-form.cjs.entry.js +1 -1
- package/dist/cjs/sd-guide.cjs.entry.js +3 -3
- package/dist/cjs/sd-popover.cjs.entry.js +4 -4
- package/dist/cjs/sd-progress.cjs.entry.js +3 -3
- package/dist/cjs/sd-radio-button-group.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-multiple-group.cjs.entry.js +4 -3
- package/dist/cjs/sd-select-multiple.cjs.entry.js +5 -4
- package/dist/cjs/sd-select-option-group.cjs.entry.js +4 -4
- package/dist/cjs/sd-tabs.cjs.entry.js +7 -9
- package/dist/cjs/sd-tag.cjs.entry.js +96 -38
- package/dist/cjs/sd-toast.cjs.entry.js +3 -3
- package/dist/cjs/sd-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/sd-toggle.cjs.entry.js +2 -2
- package/dist/cjs/select-keyboard-navigation-s2wP37xZ.js +40 -0
- package/dist/cjs/{tooltipArrow-CMyNLSC-.js → tooltipArrow-Mb2Dhc7T.js} +1 -1
- package/dist/collection/collection-manifest.json +4 -2
- package/dist/collection/components/sd-badge/sd-badge.js +1 -1
- package/dist/collection/components/sd-button-v2/sd-button-v2.config.js +190 -0
- package/dist/collection/components/sd-button-v2/sd-button-v2.css +120 -0
- package/dist/collection/components/sd-button-v2/sd-button-v2.js +249 -0
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +1 -1
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +2 -2
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +62 -0
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.css +171 -0
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +384 -0
- package/dist/collection/components/sd-field/sd-field.js +3 -3
- package/dist/collection/components/sd-file-picker/sd-file-picker.js +3 -3
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
- package/dist/collection/components/sd-guide/sd-guide.js +2 -2
- package/dist/collection/components/sd-icon/sd-icon.js +1 -1
- package/dist/collection/components/sd-input/sd-input.js +1 -1
- package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.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 +2 -2
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-portal/sd-portal.js +89 -19
- package/dist/collection/components/sd-progress/sd-progress.js +2 -2
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-tabs/sd-tabs.js +6 -8
- package/dist/collection/components/sd-tag/sd-tag.config.js +70 -0
- package/dist/collection/components/sd-tag/sd-tag.css +26 -56
- package/dist/collection/components/sd-tag/sd-tag.js +51 -104
- package/dist/collection/components/sd-textarea/sd-textarea.js +2 -2
- package/dist/collection/components/sd-toast/sd-toast.js +2 -2
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-toggle-button/sd-toggle-button.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-DdOM8yc2.js → p-2FdkYfts.js} +1 -1
- package/dist/components/{p-CWg2auF3.js → p-B1o7vc2v.js} +1 -1
- package/dist/components/p-B1vJXa29.js +1 -0
- package/dist/components/p-BFO8hHjW.js +1 -0
- package/dist/components/{p-CbQobmaB.js → p-BKTfQGcR.js} +1 -1
- package/dist/components/{p-D0U1cMbs.js → p-BNuWMSR_.js} +1 -1
- package/dist/components/{p-B-UC5tW2.js → p-BxXKe48B.js} +1 -1
- package/dist/components/p-CAZeEBeS.js +1 -0
- package/dist/components/{p-D35gOcGh.js → p-CDzGasXW.js} +1 -1
- package/dist/components/{p-MmKik3mL.js → p-CVvYLd5J.js} +1 -1
- package/dist/components/{p-CU5TiEeI.js → p-CdCMe4bN.js} +1 -1
- package/dist/components/{p-rn5S2icF.js → p-CwM24aVj.js} +1 -1
- package/dist/components/p-Cy6HMEsK.js +1 -0
- package/dist/components/{p-BVFlD1Lp.js → p-CzHa12Ax.js} +1 -1
- package/dist/components/{p-Cef06v8S.js → p-Czq-8oT7.js} +1 -1
- package/dist/components/{p-DdNQILvd.js → p-D-ian_bu.js} +1 -1
- package/dist/components/{p-qSu-ayDy.js → p-D9mJxIjm.js} +1 -1
- package/dist/components/{p-J-Yn0oS3.js → p-DYoNy5I7.js} +1 -1
- package/dist/components/p-Dc4UTGgQ.js +1 -0
- package/dist/components/p-Dun2lZmi.js +1 -0
- package/dist/components/{p-C1XPuuO-.js → p-G4t0nGLP.js} +1 -1
- package/dist/components/p-NAapFxTw.js +1 -0
- package/dist/components/p-VKF2AWs1.js +1 -0
- package/dist/components/{p-C0yQ73oI.js → p-hfbNb5UF.js} +1 -1
- package/dist/components/sd-badge.js +1 -1
- package/dist/components/sd-button-v2.d.ts +11 -0
- package/dist/components/sd-button-v2.js +1 -0
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-dropdown-button.d.ts +11 -0
- package/dist/components/sd-dropdown-button.js +1 -0
- 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-form.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-loading-spinner.js +1 -1
- package/dist/components/sd-modal-card.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-portal.js +1 -1
- package/dist/components/sd-progress.js +1 -1
- package/dist/components/sd-radio-button-group.js +1 -1
- package/dist/components/sd-radio-group.js +1 -1
- package/dist/components/sd-radio.js +1 -1
- package/dist/components/sd-select-dropdown.js +1 -1
- package/dist/components/sd-select-multiple-group.js +1 -1
- package/dist/components/sd-select-multiple.js +1 -1
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select-search-input.js +1 -1
- package/dist/components/sd-select.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-textarea.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle-button.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-3d03b19e.entry.js → p-02c5ab69.entry.js} +1 -1
- package/dist/design-system/{p-3301c280.entry.js → p-1b80635f.entry.js} +1 -1
- package/dist/design-system/p-285cc646.entry.js +1 -0
- package/dist/design-system/{p-8fde8570.entry.js → p-3565f871.entry.js} +1 -1
- package/dist/design-system/{p-0406b7f9.entry.js → p-5032c700.entry.js} +1 -1
- package/dist/design-system/{p-d6b38732.entry.js → p-5094848f.entry.js} +1 -1
- package/dist/design-system/p-59a52297.entry.js +1 -0
- package/dist/design-system/p-712c1ef1.entry.js +1 -0
- package/dist/design-system/{p-3e07e92a.entry.js → p-83f320e6.entry.js} +1 -1
- package/dist/design-system/{p-32c27eca.entry.js → p-8b013328.entry.js} +1 -1
- package/dist/design-system/{p-d021a375.entry.js → p-9563ffe1.entry.js} +1 -1
- package/dist/design-system/p-B8tGP77V.js +2 -0
- package/dist/design-system/p-BeCHKP_I.js +1 -0
- package/dist/design-system/p-CRdYeSBK.js +1 -0
- package/dist/design-system/p-DQuL1Twl.js +1 -0
- package/dist/design-system/p-Dc4UTGgQ.js +1 -0
- package/dist/design-system/p-VKF2AWs1.js +1 -0
- package/dist/design-system/p-a3025f1f.entry.js +1 -0
- package/dist/design-system/p-b1e45f3f.entry.js +1 -0
- package/dist/design-system/{p-d344fa9d.entry.js → p-c0655cd1.entry.js} +1 -1
- package/dist/design-system/p-d8a141e7.entry.js +1 -0
- package/dist/design-system/p-df3d3a2a.entry.js +1 -0
- package/dist/design-system/{p-8f99cd66.entry.js → p-e6d84ecf.entry.js} +1 -1
- package/dist/design-system/p-e7d7ceb4.entry.js +1 -0
- package/dist/design-system/{p-646ed990.entry.js → p-ea26b8e9.entry.js} +1 -1
- package/dist/design-system/p-f1b31194.entry.js +1 -0
- package/dist/design-system/p-f81d3798.entry.js +1 -0
- package/dist/design-system/p-xxEHPVkL.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/{select-keyboard-navigation-D8-D-mJX.js → base-dropdown-event-CRdYeSBK.js} +1 -37
- package/dist/esm/component.button-Dc4UTGgQ.js +113 -0
- package/dist/esm/design-system.js +4 -3
- package/dist/esm/{index-C_an1PQ3.js → index-B8tGP77V.js} +10 -117
- package/dist/esm/loader.js +4 -3
- package/dist/esm/sd-badge.entry.js +2 -2
- package/dist/esm/sd-button-v2.config-BWmcscrt.js +193 -0
- package/dist/esm/sd-button-v2.entry.js +84 -0
- package/dist/esm/sd-button_21.entry.js +116 -62
- package/dist/esm/sd-card.entry.js +2 -2
- package/dist/esm/sd-date-picker.entry.js +2 -2
- package/dist/esm/sd-dropdown-button.entry.js +272 -0
- package/dist/esm/sd-file-picker.entry.js +4 -4
- package/dist/esm/sd-form.entry.js +1 -1
- package/dist/esm/sd-guide.entry.js +3 -3
- package/dist/esm/sd-popover.entry.js +4 -4
- package/dist/esm/sd-progress.entry.js +3 -3
- package/dist/esm/sd-radio-button-group.entry.js +1 -1
- package/dist/esm/sd-radio-group.entry.js +1 -1
- package/dist/esm/sd-select-multiple-group.entry.js +3 -2
- package/dist/esm/sd-select-multiple.entry.js +4 -3
- package/dist/esm/sd-select-option-group.entry.js +4 -4
- package/dist/esm/sd-tabs.entry.js +7 -9
- package/dist/esm/sd-tag.entry.js +96 -38
- package/dist/esm/sd-toast.entry.js +3 -3
- package/dist/esm/sd-toggle-button.entry.js +2 -2
- package/dist/esm/sd-toggle.entry.js +2 -2
- package/dist/esm/select-keyboard-navigation-xxEHPVkL.js +37 -0
- package/dist/esm/{tooltipArrow-BTp0AVR2.js → tooltipArrow-Pdc3NIc9.js} +1 -1
- package/dist/types/components/sd-button-v2/sd-button-v2.config.d.ts +178 -0
- package/dist/types/components/sd-button-v2/sd-button-v2.d.ts +18 -0
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.config.d.ts +55 -0
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.d.ts +34 -0
- package/dist/types/components/sd-portal/sd-portal.d.ts +9 -0
- package/dist/types/components/sd-tabs/sd-tabs.d.ts +1 -1
- package/dist/types/components/sd-tag/sd-tag.config.d.ts +23 -0
- package/dist/types/components/sd-tag/sd-tag.d.ts +6 -10
- package/dist/types/components.d.ts +168 -27
- package/dist/types/index.d.ts +2 -0
- package/hydrate/index.js +1069 -755
- package/hydrate/index.mjs +1069 -755
- package/package.json +2 -2
- package/dist/components/p-B82gJZ4z.js +0 -1
- package/dist/components/p-C6J-ZZxF.js +0 -1
- package/dist/components/p-CDehvEQ5.js +0 -1
- package/dist/components/p-CHAh-_qx.js +0 -1
- package/dist/components/p-CaEyReID.js +0 -1
- package/dist/design-system/p-103de692.entry.js +0 -1
- package/dist/design-system/p-3edd59b5.entry.js +0 -1
- package/dist/design-system/p-55c13597.entry.js +0 -1
- package/dist/design-system/p-679e4367.entry.js +0 -1
- package/dist/design-system/p-822233ee.entry.js +0 -1
- package/dist/design-system/p-Bak0zfmv.js +0 -1
- package/dist/design-system/p-C_an1PQ3.js +0 -2
- package/dist/design-system/p-D8-D-mJX.js +0 -1
- package/dist/design-system/p-ab3b6f63.entry.js +0 -1
- package/dist/design-system/p-de339565.entry.js +0 -1
- package/dist/design-system/p-fc0e636b.entry.js +0 -1
|
@@ -11,25 +11,31 @@ export class SdPortal {
|
|
|
11
11
|
wrapper;
|
|
12
12
|
rafId;
|
|
13
13
|
isInsideClick = false;
|
|
14
|
+
handleObservedScroll = () => this.updatePosition();
|
|
14
15
|
resizeObserver;
|
|
15
16
|
mutationObserver;
|
|
17
|
+
scrollParents = [];
|
|
18
|
+
isObserved = false;
|
|
19
|
+
handleOpenChange() {
|
|
20
|
+
this.syncPortalState();
|
|
21
|
+
}
|
|
16
22
|
componentDidLoad() {
|
|
17
23
|
this.container = this.resolveContainer();
|
|
18
|
-
this.
|
|
19
|
-
this.moveSlotContent();
|
|
20
|
-
this.updatePosition();
|
|
21
|
-
this.observeParent();
|
|
24
|
+
this.syncPortalState();
|
|
22
25
|
}
|
|
23
26
|
componentDidRender() {
|
|
24
|
-
|
|
25
|
-
return;
|
|
26
|
-
this.wrapper.style.display = this.open ? 'block' : 'none';
|
|
27
|
-
if (this.open)
|
|
28
|
-
this.updatePosition();
|
|
27
|
+
this.syncPortalState();
|
|
29
28
|
}
|
|
30
29
|
disconnectedCallback() {
|
|
31
30
|
this.unobserveParent();
|
|
32
|
-
this.wrapper?.
|
|
31
|
+
if (this.wrapper?.parentNode) {
|
|
32
|
+
try {
|
|
33
|
+
this.wrapper.parentNode.removeChild(this.wrapper);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Stencil spec mock DOM can already detach the wrapper before this callback runs.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
33
39
|
}
|
|
34
40
|
resolveContainer() {
|
|
35
41
|
const el = typeof this.to === 'string' ? document.querySelector(this.to) : this.to;
|
|
@@ -44,6 +50,26 @@ export class SdPortal {
|
|
|
44
50
|
});
|
|
45
51
|
this.container.appendChild(this.wrapper);
|
|
46
52
|
}
|
|
53
|
+
ensureWrapper() {
|
|
54
|
+
if (this.wrapper)
|
|
55
|
+
return;
|
|
56
|
+
this.container ||= this.resolveContainer();
|
|
57
|
+
this.createWrapper();
|
|
58
|
+
this.moveSlotContent();
|
|
59
|
+
}
|
|
60
|
+
syncPortalState() {
|
|
61
|
+
if (!this.open) {
|
|
62
|
+
this.wrapper && (this.wrapper.style.display = 'none');
|
|
63
|
+
this.unobserveParent();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.ensureWrapper();
|
|
67
|
+
if (!this.wrapper)
|
|
68
|
+
return;
|
|
69
|
+
this.wrapper.style.display = 'block';
|
|
70
|
+
this.observeParent();
|
|
71
|
+
this.updatePosition();
|
|
72
|
+
}
|
|
47
73
|
moveSlotContent() {
|
|
48
74
|
if (!this.wrapper)
|
|
49
75
|
return;
|
|
@@ -85,19 +111,57 @@ export class SdPortal {
|
|
|
85
111
|
}
|
|
86
112
|
// parentRef의 이동 / 크기변경 감지
|
|
87
113
|
observeParent() {
|
|
88
|
-
if (!this.parentRef)
|
|
114
|
+
if (!this.parentRef || this.isObserved)
|
|
89
115
|
return;
|
|
90
|
-
this.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
116
|
+
this.observeScrollParents(this.parentRef);
|
|
117
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
118
|
+
this.resizeObserver = new ResizeObserver(() => this.updatePosition());
|
|
119
|
+
this.resizeObserver.observe(this.parentRef);
|
|
120
|
+
}
|
|
121
|
+
if (typeof MutationObserver !== 'undefined') {
|
|
122
|
+
this.mutationObserver = new MutationObserver(() => this.updatePosition());
|
|
123
|
+
this.mutationObserver.observe(document.body, {
|
|
124
|
+
childList: true,
|
|
125
|
+
subtree: true,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
this.isObserved = true;
|
|
97
129
|
}
|
|
98
130
|
unobserveParent() {
|
|
131
|
+
if (!this.isObserved)
|
|
132
|
+
return;
|
|
133
|
+
this.unobserveScrollParents();
|
|
99
134
|
this.resizeObserver?.disconnect();
|
|
135
|
+
this.resizeObserver = undefined;
|
|
100
136
|
this.mutationObserver?.disconnect();
|
|
137
|
+
this.mutationObserver = undefined;
|
|
138
|
+
this.isObserved = false;
|
|
139
|
+
}
|
|
140
|
+
observeScrollParents(element) {
|
|
141
|
+
const nextScrollParents = this.getScrollParents(element);
|
|
142
|
+
nextScrollParents.forEach(parent => {
|
|
143
|
+
parent.addEventListener('scroll', this.handleObservedScroll, { passive: true });
|
|
144
|
+
});
|
|
145
|
+
this.scrollParents = nextScrollParents;
|
|
146
|
+
}
|
|
147
|
+
unobserveScrollParents() {
|
|
148
|
+
this.scrollParents.forEach(parent => {
|
|
149
|
+
parent.removeEventListener('scroll', this.handleObservedScroll);
|
|
150
|
+
});
|
|
151
|
+
this.scrollParents = [];
|
|
152
|
+
}
|
|
153
|
+
getScrollParents(element) {
|
|
154
|
+
const scrollParents = [];
|
|
155
|
+
let currentElement = element.parentElement;
|
|
156
|
+
while (currentElement) {
|
|
157
|
+
const { overflow, overflowX, overflowY } = getComputedStyle(currentElement);
|
|
158
|
+
const isScrollable = [overflow, overflowX, overflowY].some(value => /(auto|scroll|overlay)/.test(value));
|
|
159
|
+
if (isScrollable) {
|
|
160
|
+
scrollParents.push(currentElement);
|
|
161
|
+
}
|
|
162
|
+
currentElement = currentElement.parentElement;
|
|
163
|
+
}
|
|
164
|
+
return scrollParents;
|
|
101
165
|
}
|
|
102
166
|
// 외부 클릭 감지
|
|
103
167
|
handleMouseDown(e) {
|
|
@@ -113,7 +177,7 @@ export class SdPortal {
|
|
|
113
177
|
this.close.emit();
|
|
114
178
|
}
|
|
115
179
|
render() {
|
|
116
|
-
return h("slot", { key: '
|
|
180
|
+
return h("slot", { key: 'ceaa6bed28e3b1bd1a539091434fd7acee6a0e4b' });
|
|
117
181
|
}
|
|
118
182
|
static get is() { return "sd-portal"; }
|
|
119
183
|
static get properties() {
|
|
@@ -245,6 +309,12 @@ export class SdPortal {
|
|
|
245
309
|
}];
|
|
246
310
|
}
|
|
247
311
|
static get elementRef() { return "hostEl"; }
|
|
312
|
+
static get watchers() {
|
|
313
|
+
return [{
|
|
314
|
+
"propName": "open",
|
|
315
|
+
"methodName": "handleOpenChange"
|
|
316
|
+
}];
|
|
317
|
+
}
|
|
248
318
|
static get listeners() {
|
|
249
319
|
return [{
|
|
250
320
|
"name": "scroll",
|
|
@@ -33,10 +33,10 @@ export class SdProgress {
|
|
|
33
33
|
return this.statusColor[this.progressStatus];
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h("div", { key: '
|
|
36
|
+
return (h("div", { key: 'a9b7c4a0bb44f7455ea21f632d3ec8edbcc97522', style: {
|
|
37
37
|
'--progress-color': this.progressColor,
|
|
38
38
|
'--progress-percentage': `${this.progressPercentage}%`,
|
|
39
|
-
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && h("div", { key: '
|
|
39
|
+
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && h("div", { key: 'ff0dfde8b43315883d2e4f17aa5e426fb6bf54ee', class: "sd-progress__label" }, this.label)));
|
|
40
40
|
}
|
|
41
41
|
renderBarProgress() {
|
|
42
42
|
return (h("div", { class: `sd-progress__bar sd-progress__bar--${this.progressStatus}` }, h("div", { class: ['sd-progress__bar__percent', this.progressPercentage < 100 ? 'proceed' : ''].join(' ') }), h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--left" }, this.progressPercentage, "%"), h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--right" }, this.progressPercentage, "%")));
|
|
@@ -144,10 +144,10 @@ export class SdSelectDropdown {
|
|
|
144
144
|
this.isScrolled = scrollTop > 0;
|
|
145
145
|
};
|
|
146
146
|
render() {
|
|
147
|
-
return (h("div", { key: '
|
|
147
|
+
return (h("div", { key: '5e56cf091a3c3d510bf932933c33a8c3d85e23ef', class: {
|
|
148
148
|
'sd-select-dropdown': true,
|
|
149
149
|
'sd-select-dropdown--ready': this.isDropdownReady,
|
|
150
|
-
}, style: this.dropdownSize, onScroll: this.handleDropdownScroll, ref: el => (this.dropdownRef = el) }, this.searchable && (h("sd-select-search-input", { key: '
|
|
150
|
+
}, style: this.dropdownSize, onScroll: this.handleDropdownScroll, ref: el => (this.dropdownRef = el) }, this.searchable && (h("sd-select-search-input", { key: 'd965a2a5f31507fb6dca30968edf6334d42b4160', ref: el => (this.searchRef = el), isScrolled: this.isScrolled, searchText: this.searchText, onSdSearchInput: (event) => (this.searchText = event.detail || ''), onSdSearchFocus: () => (this.itemIndex = -1) })), this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("slot", { name: `option-${option.value}` }, h("sd-select-option", { option: option, index: index, isSelected: this.isOptionSelected(option.value), isFocused: index === this.itemIndex, onOptionClick: ({ detail }) => this.optionClick.emit(detail), useCheckbox: this.useCheckbox }))))) : (h("slot", { name: "option-placeholder" }, h("div", { class: 'sd-select-option-placeholder' }, this.optionPlaceholder)))));
|
|
151
151
|
}
|
|
152
152
|
static get is() { return "sd-select-dropdown"; }
|
|
153
153
|
static get originalStyleUrls() {
|
|
@@ -24,7 +24,7 @@ export class SdSelectOption {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
render() {
|
|
27
|
-
return (h("div", { key: '
|
|
27
|
+
return (h("div", { key: '2f88e7ffe5bce12bc3f352d47d0ebed51a1c69ac', class: {
|
|
28
28
|
'sd-select__option': true,
|
|
29
29
|
'sd-select__option--selected': this.isSelected,
|
|
30
30
|
'sd-select__option--disabled': !!this.option.disabled,
|
package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js
CHANGED
|
@@ -16,17 +16,17 @@ export class SdSelectSearchInput {
|
|
|
16
16
|
input?.focus({ preventScroll: true });
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h("div", { key: '
|
|
19
|
+
return (h("div", { key: 'da5faa18fac3c974dcfef4050efe580edcb1bb42', class: {
|
|
20
20
|
'sd-select-search-input': true,
|
|
21
21
|
'sd-select-search-input--scrolled': !!this.isScrolled,
|
|
22
|
-
}, onClick: event => event.stopPropagation() }, h("sd-input", { key: '
|
|
22
|
+
}, onClick: event => event.stopPropagation() }, h("sd-input", { key: 'c469ef89d7600626b19ecd94416849825736ff9f', ref: el => (this.searchRef = el), value: this.searchText, placeholder: "\uAC80\uC0C9", clearable: true, inputStyle: { 'padding-left': '8px' }, autofocus: true, onSdUpdate: event => {
|
|
23
23
|
this.searchInput.emit(String(event?.detail));
|
|
24
24
|
}, onSdFocus: () => {
|
|
25
25
|
this.searchFocus.emit();
|
|
26
26
|
}, onKeyDown: event => {
|
|
27
27
|
if (event.code === 'Enter')
|
|
28
28
|
event.stopPropagation();
|
|
29
|
-
} }, h("sd-icon", { key: '
|
|
29
|
+
} }, h("sd-icon", { key: '478a6adda3b53aabf614028bd57a8f987f93cdb6', name: "search", size: 16, color: "#737373", style: { marginRight: '4px' }, slot: "prefix" }))));
|
|
30
30
|
}
|
|
31
31
|
static get is() { return "sd-select-search-input"; }
|
|
32
32
|
static get originalStyleUrls() {
|
|
@@ -145,7 +145,7 @@ export class SdSelectMultiple extends BaseDropdownEvent {
|
|
|
145
145
|
this.handleOptionSelection(option);
|
|
146
146
|
};
|
|
147
147
|
render() {
|
|
148
|
-
return (h("sd-field", { key: '
|
|
148
|
+
return (h("sd-field", { key: '9395a273b4205854e6fd7e96f26f93c201e6e959', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, useLabelRequired: this.useLabelRequired, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, h("div", { key: '451758e8c90b79e7ddb3b35226d28ee4a43a3832', class: {
|
|
149
149
|
'sd-select-multiple': true,
|
|
150
150
|
'sd-select-multiple--open': this.isOpen,
|
|
151
151
|
'sd-select-multiple--disabled': this.disabled,
|
|
@@ -39,7 +39,7 @@ export class SdSelectOptionGroup {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
render() {
|
|
42
|
-
return (h("div", { key: '
|
|
42
|
+
return (h("div", { key: '7581caff61d1257d653b6f58b8d76c21225b3cc5', class: {
|
|
43
43
|
'sd-select__option-group': true,
|
|
44
44
|
'sd-select__option-group--selected': !!this.isSelected,
|
|
45
45
|
'sd-select__option-group--disabled': !!this.option.disabled,
|
|
@@ -48,10 +48,10 @@ export class SdSelectOptionGroup {
|
|
|
48
48
|
'sd-select__option-group--group': this.option.type === 'group',
|
|
49
49
|
'sd-select__option-group--subgroup': this.option.type === 'subgroup',
|
|
50
50
|
'sd-select__option-group--item': this.option.type === 'item',
|
|
51
|
-
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, h("div", { key: '
|
|
51
|
+
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, h("div", { key: 'ddb33f6afaa6bc6d6dd3dc494f6ec74b9c023a42', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (h("sd-checkbox", { key: '14f2c7fc347718d2909e5006bf2500a9a51b0a66', value: this.isSelected, disabled: this.option.disabled, onClick: e => {
|
|
52
52
|
e.preventDefault();
|
|
53
53
|
this.handleClick(this.option, this.isSelected, e);
|
|
54
|
-
} })), h("span", { key: '
|
|
54
|
+
} })), h("span", { key: '99415ed662cc2f8f29d31e3811eb4496f8fcac47', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (h("span", { key: 'a3c7dc6455a94ecd4587f8b13b4d1f10e3b58819', class: "sd-select__option-group__count-indicator" }, `(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))));
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "sd-select-option-group"; }
|
|
57
57
|
static get originalStyleUrls() {
|
|
@@ -35,16 +35,14 @@ export class SdTabs {
|
|
|
35
35
|
}
|
|
36
36
|
return classes.join(' ');
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
return { bgColor: '#E5E5E5', textColor: '#737373' };
|
|
38
|
+
getBadgeName(tab) {
|
|
39
|
+
const color = this.isTabSelected(tab) ? 'blue' : 'grey';
|
|
40
|
+
return `square_${this.size}_${color}`;
|
|
43
41
|
}
|
|
44
42
|
render() {
|
|
45
|
-
return (h("div", { key: '
|
|
46
|
-
const
|
|
47
|
-
return (h("div", { key: `tab-${index}`, class: this.getTabClasses(tab), "aria-label": tab.label || 'tab', onClick: () => this.handleTabClick(tab.value) }, h("span", { "data-label": tab.label, class: "sd-tabs__label" }, tab.label), tab.badge && (h("sd-tag", {
|
|
43
|
+
return (h("div", { key: 'bc86d4c1775bed6c2d323c9446e2c50631afed7c', class: this.getContainerClasses() }, this.tabs.map((tab, index) => {
|
|
44
|
+
const badgeName = this.getBadgeName(tab);
|
|
45
|
+
return (h("div", { key: `tab-${index}`, class: this.getTabClasses(tab), "aria-label": tab.label || 'tab', onClick: () => this.handleTabClick(tab.value) }, h("span", { "data-label": tab.label, class: "sd-tabs__label" }, tab.label), tab.badge && (h("sd-tag", { name: badgeName, label: tab.badge.toString() }))));
|
|
48
46
|
})));
|
|
49
47
|
}
|
|
50
48
|
static get is() { return "sd-tabs"; }
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const TAG_SHAPES = ['square', 'pill'];
|
|
2
|
+
export const TAG_SIZES = ['sm', 'md', 'lg'];
|
|
3
|
+
export const TAG_COLORS = [
|
|
4
|
+
'grey',
|
|
5
|
+
'red',
|
|
6
|
+
'orange',
|
|
7
|
+
'yellow',
|
|
8
|
+
'green',
|
|
9
|
+
'blue',
|
|
10
|
+
'darkblue',
|
|
11
|
+
'indigo',
|
|
12
|
+
];
|
|
13
|
+
const TAG_COLOR_CONFIG = {
|
|
14
|
+
grey: { background: '#EEEEEE', content: '#737373', icon: '#737373' },
|
|
15
|
+
red: { background: '#FCEFEF', content: '#FB4444', icon: '#FB4444' },
|
|
16
|
+
orange: { background: '#FEF1EA', content: '#FF6B00', icon: '#FF6B00' },
|
|
17
|
+
yellow: { background: '#FFF7DD', content: '#916C0D', icon: '#CA9611' },
|
|
18
|
+
green: { background: '#E8F9EF', content: '#00973C', icon: '#12B553' },
|
|
19
|
+
blue: { background: '#E6F1FF', content: '#0075FF', icon: '#0075FF' },
|
|
20
|
+
darkblue: { background: '#EAF5FE', content: '#006AC1', icon: '#006AC1' },
|
|
21
|
+
indigo: { background: '#EFF6FF', content: '#004290', icon: '#004290' },
|
|
22
|
+
};
|
|
23
|
+
const SQUARE_SIZE_CONFIG = {
|
|
24
|
+
sm: {
|
|
25
|
+
height: '20px',
|
|
26
|
+
paddingX: '6px',
|
|
27
|
+
gap: '4px',
|
|
28
|
+
fontSize: '11px',
|
|
29
|
+
fontWeight: '500',
|
|
30
|
+
iconSize: 12,
|
|
31
|
+
radius: '4px',
|
|
32
|
+
},
|
|
33
|
+
md: {
|
|
34
|
+
height: '24px',
|
|
35
|
+
paddingX: '8px',
|
|
36
|
+
gap: '4px',
|
|
37
|
+
fontSize: '12px',
|
|
38
|
+
fontWeight: '700',
|
|
39
|
+
iconSize: 16,
|
|
40
|
+
radius: '4px',
|
|
41
|
+
},
|
|
42
|
+
lg: {
|
|
43
|
+
height: '28px',
|
|
44
|
+
paddingX: '10px',
|
|
45
|
+
gap: '4px',
|
|
46
|
+
fontSize: '14px',
|
|
47
|
+
fontWeight: '700',
|
|
48
|
+
iconSize: 16,
|
|
49
|
+
radius: '5px',
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const PILL_SIZE_CONFIG = {
|
|
53
|
+
sm: { ...SQUARE_SIZE_CONFIG.sm, radius: '999px' },
|
|
54
|
+
md: { ...SQUARE_SIZE_CONFIG.md, radius: '999px' },
|
|
55
|
+
lg: { ...SQUARE_SIZE_CONFIG.lg, radius: '999px' },
|
|
56
|
+
};
|
|
57
|
+
export const TAG_CONFIG = Object.fromEntries(TAG_SHAPES.flatMap(shape => TAG_SIZES.flatMap(size => TAG_COLORS.map(color => {
|
|
58
|
+
const sizeConfig = shape === 'square' ? SQUARE_SIZE_CONFIG[size] : PILL_SIZE_CONFIG[size];
|
|
59
|
+
return [
|
|
60
|
+
`${shape}_${size}_${color}`,
|
|
61
|
+
{
|
|
62
|
+
shape,
|
|
63
|
+
size,
|
|
64
|
+
color,
|
|
65
|
+
...sizeConfig,
|
|
66
|
+
...TAG_COLOR_CONFIG[color],
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
}))));
|
|
70
|
+
export const isTagName = (value) => Object.prototype.hasOwnProperty.call(TAG_CONFIG, value);
|
|
@@ -1,68 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
display: inline-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
:host([full-width]) {
|
|
6
|
-
display: block;
|
|
1
|
+
sd-tag {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
width: fit-content;
|
|
4
|
+
height: fit-content;
|
|
7
5
|
}
|
|
8
6
|
|
|
9
7
|
.sd-tag {
|
|
10
8
|
display: inline-flex;
|
|
11
|
-
width: 100%;
|
|
12
9
|
align-items: center;
|
|
13
10
|
justify-content: center;
|
|
14
|
-
gap:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
border-radius: 4px;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
gap: var(--sd-tag-gap, 5px);
|
|
12
|
+
min-height: var(--sd-tag-height, 24px);
|
|
13
|
+
padding: 0 var(--sd-tag-padding-x, 8px);
|
|
14
|
+
border-radius: var(--sd-tag-radius, 4px);
|
|
15
|
+
background: var(--sd-tag-background, #f3f3f3);
|
|
16
|
+
color: var(--sd-tag-content, #7a7a7a);
|
|
17
|
+
box-sizing: border-box;
|
|
21
18
|
white-space: nowrap;
|
|
22
19
|
-webkit-user-select: none;
|
|
23
20
|
user-select: none;
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
}
|
|
26
|
-
.sd-tag__content {
|
|
27
|
-
display: inline-block;
|
|
28
|
-
width: 100%;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
white-space: nowrap;
|
|
31
|
-
text-overflow: ellipsis;
|
|
32
|
-
}
|
|
33
|
-
.sd-tag--custom-color {
|
|
34
|
-
background: var(--tag-bg-color);
|
|
35
|
-
color: var(--tag-text-color);
|
|
36
|
-
}
|
|
37
|
-
.sd-tag--sm {
|
|
38
|
-
padding: 0 6px;
|
|
39
|
-
font-size: 11px;
|
|
40
|
-
line-height: 18px;
|
|
41
|
-
height: 20px;
|
|
42
|
-
border-radius: 4px;
|
|
43
|
-
}
|
|
44
|
-
.sd-tag--md {
|
|
45
|
-
padding: 0 8px;
|
|
46
|
-
font-size: 12px;
|
|
47
|
-
font-weight: 700;
|
|
48
|
-
line-height: 20px;
|
|
49
|
-
height: 24px;
|
|
50
|
-
border-radius: 4px;
|
|
51
21
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
border-radius: 5px;
|
|
59
|
-
}
|
|
60
|
-
.sd-tag--rounded.sd-tag--sm {
|
|
61
|
-
border-radius: 20px;
|
|
62
|
-
}
|
|
63
|
-
.sd-tag--rounded.sd-tag--md {
|
|
64
|
-
border-radius: 20px;
|
|
22
|
+
|
|
23
|
+
.sd-tag__icon {
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
flex: 0 0 auto;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
65
28
|
}
|
|
66
|
-
|
|
67
|
-
|
|
29
|
+
|
|
30
|
+
.sd-tag__label {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
font-size: var(--sd-tag-font-size, 12px);
|
|
36
|
+
font-weight: var(--sd-tag-font-weight, 700);
|
|
37
|
+
line-height: 1;
|
|
68
38
|
}
|