@sellmate/design-system 1.0.21 → 1.0.22
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/{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 +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- 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 +119 -65
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +274 -0
- package/dist/cjs/sd-file-picker.cjs.entry.js +3 -3
- package/dist/cjs/sd-guide.cjs.entry.js +2 -2
- package/dist/cjs/sd-popover.cjs.entry.js +2 -2
- package/dist/cjs/sd-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-multiple-group.cjs.entry.js +3 -2
- package/dist/cjs/sd-select-multiple.cjs.entry.js +4 -3
- package/dist/cjs/sd-select-option-group.cjs.entry.js +3 -3
- package/dist/cjs/sd-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/cjs/select-keyboard-navigation-s2wP37xZ.js +40 -0
- package/dist/collection/collection-manifest.json +3 -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-textarea/sd-textarea.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/{p-D0U1cMbs.js → p-B4p2JGMI.js} +1 -1
- package/dist/components/p-Bd9o9P1x.js +1 -0
- package/dist/components/{p-rn5S2icF.js → p-BsQEKShq.js} +1 -1
- package/dist/components/{p-CbQobmaB.js → p-CAJmL8nc.js} +1 -1
- package/dist/components/p-CWlCxabU.js +1 -0
- package/dist/components/p-Cy6HMEsK.js +1 -0
- package/dist/components/{p-C1XPuuO-.js → p-CysnHGj4.js} +1 -1
- package/dist/components/{p-qSu-ayDy.js → p-D4kmO3k7.js} +1 -1
- package/dist/components/{p-DdOM8yc2.js → p-DB52ADSW.js} +1 -1
- package/dist/components/{p-J-Yn0oS3.js → p-DExqkuUY.js} +1 -1
- package/dist/components/{p-MmKik3mL.js → p-DF2wExtn.js} +1 -1
- package/dist/components/{p-D35gOcGh.js → p-DFgtwoFG.js} +1 -1
- package/dist/components/{p-BVFlD1Lp.js → p-DYsHXden.js} +1 -1
- package/dist/components/{p-CWg2auF3.js → p-DZqrfwuw.js} +1 -1
- package/dist/components/p-Dc4UTGgQ.js +1 -0
- package/dist/components/{p-CU5TiEeI.js → p-DyeU47vV.js} +1 -1
- package/dist/components/p-Hvt2oWRk.js +1 -0
- package/dist/components/{p-Cef06v8S.js → p-JyVgfdnC.js} +1 -1
- package/dist/components/p-VKF2AWs1.js +1 -0
- 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-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-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-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-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-2ca338f9.entry.js +1 -0
- package/dist/design-system/p-322dbf53.entry.js +1 -0
- package/dist/design-system/p-3885ca10.entry.js +1 -0
- package/dist/design-system/{p-d6b38732.entry.js → p-40da6e22.entry.js} +1 -1
- package/dist/design-system/{p-679e4367.entry.js → p-47d37199.entry.js} +1 -1
- package/dist/design-system/{p-3301c280.entry.js → p-6c34df5b.entry.js} +1 -1
- package/dist/design-system/p-7d35c7a7.entry.js +1 -0
- package/dist/design-system/{p-3d03b19e.entry.js → p-938940a7.entry.js} +1 -1
- package/dist/design-system/p-9650c304.entry.js +1 -0
- package/dist/design-system/{p-8f99cd66.entry.js → p-9ad83ffb.entry.js} +1 -1
- package/dist/design-system/p-CRdYeSBK.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-d344fa9d.entry.js → p-a547f366.entry.js} +1 -1
- package/dist/design-system/{p-3e07e92a.entry.js → p-b2ab1c50.entry.js} +1 -1
- package/dist/design-system/p-d38f59b3.entry.js +1 -0
- package/dist/design-system/{p-822233ee.entry.js → p-e5c3927f.entry.js} +1 -1
- package/dist/design-system/p-xxEHPVkL.js +1 -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 +1 -1
- package/dist/esm/loader.js +1 -1
- 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 +114 -60
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-date-picker.entry.js +1 -1
- package/dist/esm/sd-dropdown-button.entry.js +272 -0
- package/dist/esm/sd-file-picker.entry.js +3 -3
- package/dist/esm/sd-guide.entry.js +2 -2
- package/dist/esm/sd-popover.entry.js +2 -2
- package/dist/esm/sd-progress.entry.js +2 -2
- package/dist/esm/sd-select-multiple-group.entry.js +2 -1
- package/dist/esm/sd-select-multiple.entry.js +3 -2
- package/dist/esm/sd-select-option-group.entry.js +3 -3
- package/dist/esm/sd-toggle-button.entry.js +1 -1
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/esm/select-keyboard-navigation-xxEHPVkL.js +37 -0
- 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.d.ts +153 -0
- package/dist/types/index.d.ts +2 -0
- package/hydrate/index.js +881 -148
- package/hydrate/index.mjs +881 -148
- 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-CHAh-_qx.js +0 -1
- package/dist/design-system/p-103de692.entry.js +0 -1
- package/dist/design-system/p-55c13597.entry.js +0 -1
- package/dist/design-system/p-D8-D-mJX.js +0 -1
- package/dist/design-system/p-de339565.entry.js +0 -1
- package/dist/design-system/p-fc0e636b.entry.js +0 -1
|
@@ -47,9 +47,9 @@ export class SdGuide {
|
|
|
47
47
|
};
|
|
48
48
|
render() {
|
|
49
49
|
const { name: iconName, size: iconSize, color: iconColor } = GUIDE_ICON[this.type];
|
|
50
|
-
return (h("div", { key: '
|
|
50
|
+
return (h("div", { key: '3e6914fc5c99e8f95d5ed613ddd61271bc4e91f9', class: "sd-guide", style: {
|
|
51
51
|
'--sd-guide-color': GUIDE_ICON[this.type].color,
|
|
52
|
-
} }, h("sd-button", { key: '
|
|
52
|
+
} }, h("sd-button", { key: 'b8e5be2cecec423cb2695c47c9493281c867dbde', ref: el => (this.guideRef = el), class: this.guideClass, variant: this.popupShow ? 'primary' : 'outline', label: this.label || GUIDE_LABEL[this.type], size: "sm", color: this.popupShow ? GUIDE_ICON[this.type].color : 'grey_45', icon: iconName, iconColor: this.popupShow ? 'white' : iconColor, iconSize: iconSize, noHover: this.popupShow, onSdClick: this.handleClickGuide }), this.type === 'help' && this.popupShow && (h("sd-portal", { key: '7d87b81704d2912f9a4bbe22ff702063da9ca0ff', open: this.popupShow, parentRef: this.guideRef, onSdClose: this.closeDropdown, offset: [0, 4] }, h("div", { key: 'd34d55e52ecb3b0a72356dcd86c2127217da4af5', style: { position: 'absolute', width: '0px', height: '0px' } }, h("div", { key: '396bf4845c0e9167440c623c876f895705b973e9', class: "sd-guide__popup", style: { width: this.popupWidth ? this.popupWidth + 'px' : '426px' } }, h("sd-button", { key: '6a678e322df5d9daffd09188daebbbcc0e757ed9', class: "sd-guide__popup__close", icon: "close", color: "grey_65", size: "md", variant: "ghost", noHover: true, onSdClick: this.closeDropdown }), h("div", { key: '8b4abeac25a09b1eb8ee8285d2afff9a0a470c6c', class: "sd-guide__popup__header" }, h("sd-icon", { key: 'b6216567fa83cf131e97c10f2b9f827b13f660a3', name: "helpOutline", size: 24, color: "green_65" }), h("h3", { key: '5a87da148989c89e196fee9a96bbb51e516dca4d', class: "sd-guide__popup__title" }, this.popupTitle || GUIDE_LABEL[this.type])), h("ul", { key: 'a4ebb25ecef588ca5367006adb6aaf446fbd59a9', class: "sd-guide__popup__list" }, this.renderListItem(this.message))))))));
|
|
53
53
|
}
|
|
54
54
|
// 현재 2depth까지만 스타일 적용
|
|
55
55
|
renderListItem(message, depth = 0) {
|
|
@@ -25,7 +25,7 @@ export class SdIcon {
|
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
27
|
const IconComponent = Icons[this.name]?.[this.size];
|
|
28
|
-
return (h("i", { key: '
|
|
28
|
+
return (h("i", { key: '2c1ef942e674d6dc85911f9a87c6859e0e86a706', class: this.getIconClasses(), style: this.iconStyle }, h(IconComponent, { key: 'fa1bc7cd1cf4dc5ec2565f5bbfe65e8137673204', color: this.resolvedColor })));
|
|
29
29
|
}
|
|
30
30
|
static get is() { return "sd-icon"; }
|
|
31
31
|
static get originalStyleUrls() {
|
|
@@ -85,7 +85,7 @@ export class SdInput {
|
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
render() {
|
|
88
|
-
return (h("sd-field", { key: '
|
|
88
|
+
return (h("sd-field", { key: '757bf7b330f93ec9cd344098bdf124b999e04bb5', name: this.name, label: this.label, insideLabel: this.insideLabel, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, useLabelRequired: this.useLabelRequired, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false) }, h("label", { key: '2dde85e905d77bb6337a2ad10a9f0f872fed5e8a', class: "sd-input__content", style: { width: '100%' } }, h("slot", { key: '20f47646ca476bf6ca6412ebb9e6aac0c72e7eab', name: "prefix" }), h("input", { key: 'a4f4f1594c80a8d834db7d6125110b4c65ad9906', name: this.name, ref: el => (this.nativeEl = el), class: `sd-input__native ${this.inputClass}`, type: this.type, value: this.internalValue || '', placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, onInput: this.handleInput, onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event), style: this.inputStyle }), h("slot", { key: '35c7c173d72cbc295ad8f6e12f94bfe96e9f98d1', name: "suffix" }), this.clearable && this.internalValue && (h("sd-icon", { key: '82bf96b1a01516e0a7ea0dd735509511aa8a0e05', name: "close", color: "grey_65", size: "16", class: "sd-input__clear-icon", onClick: async () => {
|
|
89
89
|
this.internalValue = '';
|
|
90
90
|
await this.formField?.sdValidate();
|
|
91
91
|
} })))));
|
|
@@ -6,7 +6,7 @@ export class SdLoadingSpinner {
|
|
|
6
6
|
return resolveColor(this.color);
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return (h(Fragment, { key: '
|
|
9
|
+
return (h(Fragment, { key: '1a4edb8be9cc83ab900cd615ee30958d9822e98b' }, h("svg", { key: '634070026b58303bf3423b10f37ed6603179b9b1', class: "sd-loading-spinner", width: "72px", height: "72px", viewBox: "25 25 50 50", style: { color: this.resolvedColor } }, h("circle", { key: 'fda3f7e4f787176f6030e19a3f2c1dd59326d35a', class: "path", cx: "50", cy: "50", r: "20", fill: "none", stroke: "currentColor", "stroke-width": "5", "stroke-miterlimit": "10" }))));
|
|
10
10
|
}
|
|
11
11
|
static get is() { return "sd-loading-spinner"; }
|
|
12
12
|
static get originalStyleUrls() {
|
|
@@ -240,17 +240,17 @@ export class SdNumberInput {
|
|
|
240
240
|
const inputStyles = {
|
|
241
241
|
textAlign: this.useButton ? 'center' : 'right',
|
|
242
242
|
};
|
|
243
|
-
return (h("sd-field", { key: '
|
|
243
|
+
return (h("sd-field", { key: '837e3b5c34396eb83adcf52f3242d24ad122be0a', name: this.name, label: this.label, insideLabel: this.insideLabel, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, ref: el => (this.formField = el), style: inputWidth }, h("label", { key: '57000cb104bb65b1827e2cdb059bad004c236b2a', class: {
|
|
244
244
|
'sd-number-input': true,
|
|
245
245
|
[this.getInputStatus()]: true,
|
|
246
246
|
'sd-number-input--with-buttons': this.useButton,
|
|
247
|
-
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, h("input", { key: '
|
|
247
|
+
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, h("input", { key: 'da7fe761d7e2528dd299d6ee5867bc7a5e0983ee', name: this.name, ref: el => (this.nativeEl = el), class: `sd-number-input__input ${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, style: inputStyles, onFocus: this.handleFocus, onBlur: this.handleBlur }), this.useButton && (h("div", { key: '3a58c1b9da818dbe0d4d29b79816bbc81288be49', class: "sd-number-input__buttons" }, h("button", { key: '507b418d1aea67247d10fcba514b51cc966b3ce9', type: "button", class: {
|
|
248
248
|
'sd-number-input__button': true,
|
|
249
249
|
'sd-number-input__button--decrement': true,
|
|
250
|
-
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, h("sd-icon", { key: '
|
|
250
|
+
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, h("sd-icon", { key: 'e0b28e6cf9a5c9d578688e45f7db227516f6373f', name: "minus", size: 12, color: this.isDecrementDisabled() ? 'grey_45' : 'brilliantblue_70' })), h("button", { key: '813bf64d160888e610da067fef9dea11375dd51b', type: "button", class: {
|
|
251
251
|
'sd-number-input__button': true,
|
|
252
252
|
'sd-number-input__button--increment': true,
|
|
253
|
-
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: '
|
|
253
|
+
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: '6677d8b46b123e5534bfa8b2fcb45276d9b70782', name: "add", size: 12, color: this.isIncrementDisabled() ? 'grey_45' : 'brilliantblue_70' })))))));
|
|
254
254
|
}
|
|
255
255
|
static get is() { return "sd-number-input"; }
|
|
256
256
|
static get originalStyleUrls() {
|
|
@@ -68,12 +68,12 @@ export class SdPagination {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
render() {
|
|
71
|
-
return (h("div", { key: '
|
|
71
|
+
return (h("div", { key: '1adbe18d363ff7946e900929d0dfaec1a1807d45', class: this.paginationClasses }, h("div", { key: '104eb4ac5fa9e8564c8730f34aefca4e0ac31cc6', class: "prepend-btns" }, this.renderPrevButtons()), this.simple ? (h("div", { class: "pagination-info" }, h("span", { class: "current-page" }, this.currentPage), h("span", null, "/"), h("span", { class: "last-page" }, this.lastPage))) : (this.pageNumbers.map(n => (h("button", { type: "button", "aria-current": this.currentPage === n ? 'page' : undefined, class: {
|
|
72
72
|
'pagination-btn': true,
|
|
73
73
|
'pagination-btn--selected': this.currentPage === n,
|
|
74
74
|
}, disabled: this.currentPage === n, style: {
|
|
75
75
|
'--pagination-btn-width': `${this.buttonWidth}px`,
|
|
76
|
-
}, onClick: () => this.handlePageChange(n) }, n)))), h("div", { key: '
|
|
76
|
+
}, onClick: () => this.handlePageChange(n) }, n)))), h("div", { key: 'e596b6a182e22ae4a8e95d5babb548d3bfba373d', class: "append-btns" }, this.renderNextButtons())));
|
|
77
77
|
}
|
|
78
78
|
static get is() { return "sd-pagination"; }
|
|
79
79
|
static get originalStyleUrls() {
|
|
@@ -30,11 +30,11 @@ export class SdPopover {
|
|
|
30
30
|
this.showPopover = false;
|
|
31
31
|
};
|
|
32
32
|
render() {
|
|
33
|
-
return (h(Fragment, { key: '
|
|
33
|
+
return (h(Fragment, { key: '4c256f17bc8601f889d18e2b8ee9ce5b4436b75e' }, this.label ? (h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-popover", onSdClick: () => (this.showPopover = !this.showPopover) })) : (h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })), this.showPopover && (h("sd-floating-portal", { key: 'd1a8ef964dc6b9458b47d2d2e0d1eb25662e1537', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement }, h("div", { key: '1aef778cbd469b16fe145957ea05c0ccbc2af8e7', class: {
|
|
34
34
|
'sd-floating-menu': true,
|
|
35
35
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
36
36
|
[this.menuClass]: !!this.menuClass,
|
|
37
|
-
} }, h("i", { key: '
|
|
37
|
+
} }, h("i", { key: 'ff8f07f418d3bdcaf15b7e058158b91bd1cd2185', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, h(TooltipArrow, { key: '9b1fb0577a5dcdf54ec1cc60935a9c3c1aa8319c' })), h("div", { key: '0bfd33f6dde24fcdca635cbee04d2bc618f15185', class: "sd-floating-menu__content" }, this.menuTitle && h("div", { key: 'de381d79af2f5d976e5cbccf5ed2b60aae9e6f26', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (h("div", { key: '316f3398861cc9e54f5c16bd08c7b45422857ae1', class: "sd-floating-menu__messages" }, this.messages.map(message => (h("div", null, message))))), this.buttons.length > 0 && (h("div", { key: '2466d39c9105310821a509cc8d493d34b27bbb7d', class: `sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (h("sd-button", { ...button })))))), this.useClose && (h("button", { key: 'd9cf295dfe0a20e9f79f371292520d9c757df55d', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, h("sd-icon", { key: '3ecc02bbfc890b1f66c57160041882c27153e44b', name: "close", size: "12", color: "gery_55" }))))))));
|
|
38
38
|
}
|
|
39
39
|
static get is() { return "sd-popover"; }
|
|
40
40
|
static get originalStyleUrls() {
|
|
@@ -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: 'be76727404b0172e1049ae572acf4eacd4ea4a25' });
|
|
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: 'a11cc2a22ad1628d63882ca1e5f7f1e3715ba719', 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: 'dbc62a8fa4039127356f8b734482e1d0eb26c22b', 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: 'd69eabae6b1769212fb4755413de8e54ede8a213', 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: '7e9937e5b38a038b4b7bb0cd09ef4a69a336c673', 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: 'b9844296973b6e85d3c3e3652671e89f470ec7a9', 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: '2d211645dc4041411e187f248a260a23b7c544f6', 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: 'c609af0ab36359c8ccaea5827821dbc509d13eac', 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: '96a511b1f8625c883ec50d5e2985ff396d7b57c7', 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: '9f78c7a47f580ba6d64fbc4a69e2f1f72f30e66f', 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: 'fab43f26f83788991067096f8574421ddeb0a829', 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: '70ab9a558faf068cfc4eb0a5f6a29453ceedc6ec', 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: 'ca5dc0033231ab204a8688f98453742cdbde7d26', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (h("sd-checkbox", { key: 'bba6cb9fe649f6eda82ba287f73d0142e02c53c2', 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: '7d03c080b7f5b92881389bfec787015a6ac55fa1', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (h("span", { key: '7066453f92eac7549569db6854e3dc32515d80b9', 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() {
|
|
@@ -75,10 +75,10 @@ export class SdTextarea {
|
|
|
75
75
|
}
|
|
76
76
|
render() {
|
|
77
77
|
const maxLengthCounter = this.getMaxLengthCounter();
|
|
78
|
-
return (h("div", { key: '
|
|
78
|
+
return (h("div", { key: 'd538d3ab99c174f1fedc92c547fcba61d1097608', class: {
|
|
79
79
|
'sd-textarea': true,
|
|
80
80
|
[this.getTextareaStatus()]: true,
|
|
81
|
-
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false) }, h("div", { key: '
|
|
81
|
+
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false) }, h("div", { key: '1f4b6059d56e673568e4662f423bf6c76b781ad7', class: "sd-textarea__content" }, h("textarea", { key: '812814fdfc3044ba796830be47d5e5f93a423734', name: this.name, ref: el => (this.nativeEl = el), class: `sd-textarea__native ${this.textareaClass}`, value: this.internalValue || '', placeholder: this.placeholder, disabled: this.disabled, autofocus: this.autoFocus, maxLength: this.maxLength, onInput: this.handleInput.bind(this), onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event) })), this.hasFooter() && (h("div", { key: '2ea2c482ea874607411d1f4ecaabb99d095122ad', class: "sd-textarea__footer" }, this.helpText !== undefined && h("span", { key: 'b14afd0acf981bbbd3cef6bd7490f3a3fe9b443a', class: "sd-textarea__help-text" }, this.helpText), maxLengthCounter !== null && h("span", { key: '2aa68acd081a61d22010c799621b06fa49e7b8a6', class: "sd-textarea__counter" }, maxLengthCounter)))));
|
|
82
82
|
}
|
|
83
83
|
static get is() { return "sd-textarea"; }
|
|
84
84
|
static get originalStyleUrls() {
|
|
@@ -28,7 +28,7 @@ export class SdToggle {
|
|
|
28
28
|
this.change.emit(newValue);
|
|
29
29
|
};
|
|
30
30
|
render() {
|
|
31
|
-
return (h("label", { key: '
|
|
31
|
+
return (h("label", { key: '96e1e542413ede219dddf64f80112c1267973507', "aria-label": this.label || 'toggle', class: this.toggleClasses }, h("input", { key: '301ea8516df99c351fc7162ef80db112778d55ad', type: "checkbox", checked: this.value, disabled: this.disabled, onInput: this.handleChange }), this.label && h("span", { key: '7382cf219c544aec9169a69a07856948512d2ac1', class: "sd-toggle__label" }, this.label), h("div", { key: 'f9d6c5d4e94f12a64c242026974d71b8b8b140c7', class: "sd-toggle__track" }, h("div", { key: '2798217a6e9766c0e6d3cc6ed333c54a0106d978', class: "sd-toggle__thumb" }))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "sd-toggle"; }
|
|
34
34
|
static get originalStyleUrls() {
|
|
@@ -32,7 +32,7 @@ export class SdToggleButton {
|
|
|
32
32
|
this.change.emit(newValue);
|
|
33
33
|
};
|
|
34
34
|
render() {
|
|
35
|
-
return (h("label", { key: '
|
|
35
|
+
return (h("label", { key: '65bd84349d293e027829dc8a7e80c1bbee123b25', class: this.buttonClasses, "aria-label": this.label || 'toggle button' }, this.label, h("input", { key: 'f03c1a1dd64d608766c0996539cb6422efa99ef7', style: { display: 'none' }, type: "checkbox", onInput: this.handleChange })));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "sd-toggle-button"; }
|
|
38
38
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as t}from"./p-CDehvEQ5.js";class s{static instance;activeDropdowns=new Set;static getInstance(){return s.instance||(s.instance=new s),s.instance}register(t){this.activeDropdowns.add(t)}unregister(t){this.activeDropdowns.delete(t)}openDropdown(t){this.activeDropdowns.forEach((s=>{s!==t&&s.isOpen&&s.closeDropdown()}))}closeAllDropdowns(){this.activeDropdowns.forEach((t=>{t.isOpen&&t.closeDropdown()}))}}const e=s.getInstance(),i=class extends t{constructor(){super(!1)}documentClickHandler;documentKeydownHandler;initializeEvent(){e.register(this),this.initializeEventHandlers()}cleanupEvent(){e.unregister(this),this.cleanup()}initializeEventHandlers(){this.documentClickHandler=t=>this.handleDocumentClick(t),this.documentKeydownHandler=t=>this.handleDocumentKeydown(t)}addGlobalEventListeners(){this.documentClickHandler&&document.addEventListener("click",this.documentClickHandler),this.documentKeydownHandler&&document.addEventListener("keydown",this.documentKeydownHandler)}removeGlobalEventListeners(){this.documentClickHandler&&document.removeEventListener("click",this.documentClickHandler),this.documentKeydownHandler&&document.removeEventListener("keydown",this.documentKeydownHandler)}onDropdownToggle(t){t&&!this.disabled?(e.openDropdown(this),this.addGlobalEventListeners()):this.removeGlobalEventListeners()}cleanup(){this.removeGlobalEventListeners()}closeDropdown(){this.isOpen=!1}};
|
|
1
|
+
import{H as t}from"./p-CDehvEQ5.js";class s{static instance;activeDropdowns=new Set;static getInstance(){return s.instance||(s.instance=new s),s.instance}register(t){this.activeDropdowns.add(t)}unregister(t){this.activeDropdowns.delete(t)}openDropdown(t){this.activeDropdowns.forEach((s=>{s!==t&&s.isOpen&&s.closeDropdown()}))}closeAllDropdowns(){this.activeDropdowns.forEach((t=>{t.isOpen&&t.closeDropdown()}))}}const e=s.getInstance(),i=class extends t{constructor(){super(!1)}documentClickHandler;documentKeydownHandler;initializeEvent(){e.register(this),this.initializeEventHandlers()}cleanupEvent(){e.unregister(this),this.cleanup()}initializeEventHandlers(){this.documentClickHandler=t=>this.handleDocumentClick(t),this.documentKeydownHandler=t=>this.handleDocumentKeydown(t)}addGlobalEventListeners(){this.documentClickHandler&&document.addEventListener("click",this.documentClickHandler),this.documentKeydownHandler&&document.addEventListener("keydown",this.documentKeydownHandler)}removeGlobalEventListeners(){this.documentClickHandler&&document.removeEventListener("click",this.documentClickHandler),this.documentKeydownHandler&&document.removeEventListener("keydown",this.documentKeydownHandler)}onDropdownToggle(t){t&&!this.disabled?(e.openDropdown(this),this.addGlobalEventListeners()):this.removeGlobalEventListeners()}cleanup(){this.removeGlobalEventListeners()}closeDropdown(){this.isOpen=!1}};export{i as B}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,c as s,h as t,t as i}from"./p-CDehvEQ5.js";import{B as o}from"./p-B4p2JGMI.js";import{S as l}from"./p-Cy6HMEsK.js";import{n as r}from"./p-CCwNgVmC.js";import{d}from"./p-Hvt2oWRk.js";import{d as n}from"./p-DExqkuUY.js";import{d as a}from"./p-DZqrfwuw.js";import{d as c}from"./p-DF2wExtn.js";import{d as h}from"./p-CAJmL8nc.js";import{d as p}from"./p-DYsHXden.js";import{d as m}from"./p-CWlCxabU.js";import{d as u}from"./p-CysnHGj4.js";import{d as f}from"./p-JyVgfdnC.js";import{d as b}from"./p-DyeU47vV.js";import{d as w}from"./p-DFgtwoFG.js";const g=e(class extends o{constructor(e){super(!1),!1!==e&&this.__registerHost(),this.update=s(this,"sdUpdate"),this.dropDownShow=s(this,"sdDropDownShow")}get el(){return this}value=null;options=[];placeholder="선택";optionPlaceholder="선택지가 없습니다.";width="200px";dropdownHeight="260px";autoFocus=!1;disabled=!1;clearable=!1;searchable=!1;label="";insideLabel=!1;useLabelRequired=!1;labelTooltip="";labelTooltipProps=null;rules=[];error=!1;optionRenderer;isOpen=!1;itemIndex=-1;isScrolled=!1;update;dropDownShow;selectRef;triggerRef;formField;filteredOptions=this.options;dropDownWidth=this.width;name=r();async sdOpen(){this.isOpen=!0}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async isOpenChanged(){this.onDropdownToggle(this.isOpen),this.dropDownShow?.emit({isOpen:this.isOpen}),!1===this.isOpen&&await(this.formField?.sdValidate())}componentWillLoad(){this.initializeEvent()}componentDidLoad(){this.autoFocus&&this.selectRef?.focus()}componentDidRender(){const e=this.triggerRef,s=e?.getBoundingClientRect();this.dropDownWidth=s?.width?`${s.width}px`:this.width}disconnectedCallback(){this.cleanupEvent()}handleDocumentClick(e){this.selectRef?.contains(e.target)||(this.isOpen=!1)}handleDocumentKeydown(e){if(e.stopPropagation(),["ArrowDown","ArrowUp","Enter","Escape"].includes(e.key))switch(e.preventDefault(),e.key){case"ArrowDown":case"ArrowUp":const s=new l(this.searchable,this.filteredOptions).getNextIndex(this.itemIndex,e.key);this.itemIndex=s;break;case"Enter":const t=this.filteredOptions[this.itemIndex];t&&!t.disabled&&(this.value=t.value,this.isOpen=!1);break;case"Escape":this.isOpen=!1}}getSelectedOption(){return this.options.find((e=>e.value===this.value))}closeDropdown(){this.isOpen=!1}handleTriggerClick=e=>{e.stopPropagation(),this.disabled||(this.isOpen=!this.isOpen,this.dropDownShow?.emit({isOpen:this.isOpen}))};handleOptionClick=e=>{const{option:s,event:t}=e;if(t.stopPropagation(),!s.disabled){this.value=s.value,this.isOpen=!1;const e=this.getSelectedOption();this.update?.emit({value:e?.value||null,option:e||null})}};render(){return t("sd-field",{key:"ad737ef5facfd4f2c8dfdbfc2c97010aa82ba39e",label:this.label,name:this.name,rules:this.rules,error:this.error,disabled:this.disabled,useLabelRequired:this.useLabelRequired,insideLabel:this.insideLabel,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e},t("div",{key:"ecff910f0d0d6b02f29c2f21a4264b1a573a9170",class:{"sd-select":!0,"sd-select--disabled":this.disabled,"sd-select--error":!!this.error,"sd-select--label":!!this.label},ref:e=>this.selectRef=e},this.renderTrigger(),this.renderDropdown()))}renderTrigger(){const e=this.getSelectedOption();return t("div",{class:"sd-select__trigger",tabindex:this.disabled?-1:0,onClick:this.handleTriggerClick,ref:e=>this.triggerRef=e},t("span",{class:"sd-select__value"},e?e.label:this.placeholder),this.clearable&&e&&!this.disabled&&t("sd-icon",{key:"clear-icon",name:"close",size:10,color:"#888",class:"sd-select__clear",onClick:async e=>{e.stopPropagation(),this.value=null,await(this.formField?.sdValidate())}}),t("sd-icon",{key:"arrow-icon",name:"arrowDown",color:"#888",class:{"sd-select__arrow":!0,"sd-select__arrow--open":this.isOpen}}))}renderDropdown(){if(!1===this.isOpen)return null;const e=this.selectRef?.querySelector(".sd-select__trigger")||this.selectRef;return t("sd-portal",{open:this.isOpen,parentRef:e,onSdClose:this.closeDropdown},t("sd-select-dropdown",{value:this.value,options:this.options,itemIndex:this.itemIndex,width:this.dropDownWidth,dropdownHeight:this.dropdownHeight,searchable:this.searchable,optionPlaceholder:this.optionPlaceholder,onSdOptionClick:({detail:e})=>this.handleOptionClick(e),onSdOptionFiltered:({detail:e})=>this.filteredOptions=e}))}static get watchers(){return{isOpen:[{isOpenChanged:0}]}}static get style(){return"sd-select{display:inline-flex;flex-flow:column nowrap;height:fit-content}sd-select *:focus,sd-select *:focus-visible,sd-select *:focus-within{outline:none !important}sd-select .sd-select{width:100%}sd-select .sd-select .sd-select__trigger{padding:4px 28px 4px 12px;display:flex;width:100%;height:100%;align-items:center}sd-select .sd-select .sd-select__trigger .sd-select__value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:20px;font-size:12px;font-weight:400;text-align:left}sd-select .sd-select .sd-select__trigger .sd-select__clear{margin:0 4px;width:8px;height:8px;background-color:transparent;outline:none;border:none}sd-select .sd-select .sd-select__arrow{position:absolute;top:8px;right:8px;width:12px;height:12px;color:#888888;transition:transform 0.3s ease;margin-left:8px}sd-select .sd-select .sd-select__arrow--open{transform:rotate(180deg)}"}},[512,"sd-select",{value:[1032],options:[1040],placeholder:[1],optionPlaceholder:[1,"option-placeholder"],width:[1],dropdownHeight:[1,"dropdown-height"],autoFocus:[4,"auto-focus"],disabled:[4],clearable:[4],searchable:[4],label:[1],insideLabel:[4,"inside-label"],useLabelRequired:[4,"use-label-required"],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],rules:[16],error:[4],optionRenderer:[16],isOpen:[32],itemIndex:[32],isScrolled:[32],sdOpen:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{isOpen:[{isOpenChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["sd-select","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-icon","sd-input","sd-portal","sd-select-dropdown","sd-select-option","sd-select-search-input","sd-tooltip"].forEach((e=>{switch(e){case"sd-select":customElements.get(i(e))||customElements.define(i(e),g);break;case"sd-button":customElements.get(i(e))||d();break;case"sd-checkbox":customElements.get(i(e))||n();break;case"sd-field":customElements.get(i(e))||a();break;case"sd-floating-portal":customElements.get(i(e))||c();break;case"sd-icon":customElements.get(i(e))||h();break;case"sd-input":customElements.get(i(e))||p();break;case"sd-portal":customElements.get(i(e))||m();break;case"sd-select-dropdown":customElements.get(i(e))||u();break;case"sd-select-option":customElements.get(i(e))||f();break;case"sd-select-search-input":customElements.get(i(e))||b();break;case"sd-tooltip":customElements.get(i(e))||w()}}))}export{g as S,x as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as o,H as e,c as t,h as s,t as p}from"./p-CDehvEQ5.js";import{d as i}from"./p-
|
|
1
|
+
import{p as o,H as e,c as t,h as s,t as p}from"./p-CDehvEQ5.js";import{d as i}from"./p-DExqkuUY.js";import{d as c}from"./p-CAJmL8nc.js";const r=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.optionClick=t(this,"optionClick")}get el(){return this}option;index;isSelected=!1;isFocused=!1;optionStyle;disabled=!1;useCheckbox=!1;useIndicator=!0;countInfo={selectedCount:0,totalCount:0};isHovered=!1;async isDisabled(){return!!this.option.disabled||"group"===this.option.type||"subgroup"===this.option.type}optionClick;handleClick=(o,e,t)=>{t.stopPropagation(),"group"!==o.type&&"subgroup"!==o.type&&(this.option.disabled||this.disabled)||this.optionClick.emit({option:this.option,isSelected:e,index:this.index,event:t})};render(){return s("div",{key:"70ab9a558faf068cfc4eb0a5f6a29453ceedc6ec",class:{"sd-select__option-group":!0,"sd-select__option-group--selected":!!this.isSelected,"sd-select__option-group--disabled":!!this.option.disabled,"sd-select__option-group--focused":this.isFocused,"sd-select__option-group--use-checkbox":this.useCheckbox,"sd-select__option-group--group":"group"===this.option.type,"sd-select__option-group--subgroup":"subgroup"===this.option.type,"sd-select__option-group--item":"item"===this.option.type},onMouseEnter:()=>this.isHovered=!0,onMouseLeave:()=>this.isHovered=!1,style:this.optionStyle,"data-index":this.index,onClick:o=>this.handleClick(this.option,this.isSelected,o)},s("div",{key:"ca5dc0033231ab204a8688f98453742cdbde7d26",class:"sd-select__option-group__label-wrapper"},this.useCheckbox&&s("sd-checkbox",{key:"bba6cb9fe649f6eda82ba287f73d0142e02c53c2",value:this.isSelected,disabled:this.option.disabled,onClick:o=>{o.preventDefault(),this.handleClick(this.option,this.isSelected,o)}}),s("span",{key:"7d03c080b7f5b92881389bfec787015a6ac55fa1",class:"sd-select__option-group-label"},this.option.label),this.useIndicator&&"item"!==this.option.type&&s("span",{key:"7066453f92eac7549569db6854e3dc32515d80b9",class:"sd-select__option-group__count-indicator"},`(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))}static get style(){return"sd-select-option-group{display:block;height:fit-content}sd-select-option-group .sd-select__option-group{display:flex;padding:4px 12px;padding-left:12px;font-size:12px;line-height:20px;cursor:pointer}sd-select-option-group .sd-select__option-group.sd-select__option-group--group:not(.sd-select__option-group--use-checkbox),sd-select-option-group .sd-select__option-group.sd-select__option-group--subgroup:not(.sd-select__option-group--use-checkbox){cursor:default !important}sd-select-option-group .sd-select__option-group.sd-select__option-group--group{background-color:#F5FAFF !important;color:#333333 !important;font-weight:700}sd-select-option-group .sd-select__option-group.sd-select__option-group--subgroup{padding-left:20px;background-color:#F9F9F9 !important;color:#333333 !important;font-weight:500}sd-select-option-group .sd-select__option-group.sd-select__option-group--item{padding-left:28px}sd-select-option-group .sd-select__option-group sd-checkbox__bg{border-color:#888888}sd-select-option-group .sd-select__option-group__label-wrapper{display:flex;width:100%;column-gap:8px;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}sd-select-option-group .sd-select__option-group__label-wrapper sd-checkbox{flex-shrink:0}sd-select-option-group .sd-select__option-group__label-wrapper .sd-select__option-group-label{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-select-option-group .sd-select__option-group__label-wrapper .sd-select__option-group__count-indicator{width:fit-content;flex-shrink:0;font-size:12px;font-weight:500;color:#888888}sd-select-option-group .sd-select__option-group--focused{background-color:#E6F1FF}sd-select-option-group .sd-select__option-group--selected.sd-select__option-group--item:not(:hover):not(.sd-select__option-group--use-checkbox),sd-select-option-group .sd-select__option-group--focused.sd-select__option-group--item:not(:hover):not(.sd-select__option-group--use-checkbox){color:#0075FF;font-weight:700}sd-select-option-group .sd-select__option-group--disabled{color:#AAAAAA;cursor:not-allowed}sd-select-option-group .sd-select__option-group:hover:not(.sd-select__option-group--disabled){background-color:#0075FF;color:white}sd-select-option-group .sd-select__option-group:hover.sd-select__option-group--selected:not(.sd-select__option-group--group):not(.sd-select__option-group--subgroup) sd-checkbox .sd-checkbox__bg{border-color:white !important}"}},[512,"sd-select-option-group",{option:[16],index:[2],isSelected:[4,"is-selected"],isFocused:[4,"is-focused"],optionStyle:[16],disabled:[4],useCheckbox:[4,"use-checkbox"],useIndicator:[4,"use-indicator"],countInfo:[16],isHovered:[32],isDisabled:[64]}]);function n(){"undefined"!=typeof customElements&&["sd-select-option-group","sd-checkbox","sd-icon"].forEach((o=>{switch(o){case"sd-select-option-group":customElements.get(p(o))||customElements.define(p(o),r);break;case"sd-checkbox":customElements.get(p(o))||i();break;case"sd-icon":customElements.get(p(o))||c()}}))}export{r as S,n as d}
|