@sellmate/design-system 1.0.40 → 1.0.42
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/component.textinput-43trvZ5m.js +41 -0
- package/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +0 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-barcode-input.cjs.entry.js +162 -0
- package/dist/cjs/sd-button-v2_2.cjs.entry.js +4 -4
- package/dist/cjs/sd-button_20.cjs.entry.js +44 -69
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-confirm-modal.cjs.entry.js +124 -0
- package/dist/cjs/sd-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +3 -3
- 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-modal-container.cjs.entry.js +17 -73
- package/dist/cjs/sd-popover.cjs.entry.js +10 -2
- package/dist/cjs/sd-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-group.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-multiple.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-option-group.cjs.entry.js +3 -3
- package/dist/cjs/sd-select-v2-list-item_2.cjs.entry.js +7 -16
- package/dist/cjs/sd-select-v2-listbox_2.cjs.entry.js +181 -14
- package/dist/cjs/sd-select-v2.cjs.entry.js +13 -21
- package/dist/cjs/{sd-select-v2.config-DZrPJ6OS.js → sd-select-v2.config-BJXi4hMP.js} +12 -7
- package/dist/cjs/sd-text-link.cjs.entry.js +3 -3
- 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-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.config.js +34 -0
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.css +72 -0
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +750 -0
- package/dist/collection/components/sd-button-v2/sd-button-v2.js +2 -2
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.config.js +4 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.css +17 -17
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +7 -7
- 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 +4 -4
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +3 -3
- package/dist/collection/components/sd-field/sd-field.js +4 -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 +2 -2
- package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.js +1 -1
- package/dist/collection/components/sd-modal-container/sd-modal-container.js +19 -118
- 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 +10 -2
- package/dist/collection/components/sd-portal/sd-portal.js +1 -1
- 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-group/sd-select-group.js +1 -1
- 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-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.css +6 -6
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.js +3 -12
- package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.css +1 -0
- package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.js +185 -16
- package/dist/collection/components/sd-select-v2/sd-select-v2-trigger/sd-select-v2-trigger.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2.config.js +12 -7
- package/dist/collection/components/sd-select-v2/sd-select-v2.js +13 -21
- package/dist/collection/components/sd-tag/sd-tag.js +2 -2
- package/dist/collection/components/sd-text-link/sd-text-link.js +3 -3
- 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-toast-container/sd-toast-container.js +1 -1
- 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/collection/components/sd-tooltip/sd-tooltip.js +10 -2
- package/dist/collection/utils/modal.js +0 -9
- package/dist/components/index.js +1 -1
- package/dist/components/{p-8oyZJ0FK.js → p-6FZWkn3V.js} +1 -1
- package/dist/components/p-AfdVu7_V.js +1 -0
- package/dist/components/{p-PcxVERcm.js → p-B2IPxQNl.js} +1 -1
- package/dist/components/{p-DBCQtIY4.js → p-BBKrHUCP.js} +1 -1
- package/dist/components/{p-A5atk1St.js → p-BKtAiyh0.js} +1 -1
- package/dist/components/{p-5UN9Ry8A.js → p-BXuZFSsU.js} +1 -1
- package/dist/components/{p-CZN_I4v-.js → p-BZJDhQ6h.js} +1 -1
- package/dist/components/{p-CKi7RueC.js → p-BfqA9RSe.js} +1 -1
- package/dist/components/{p-2JXqy61T.js → p-Bo7U7jA2.js} +1 -1
- package/dist/components/{p-VztCEgcN.js → p-C7dgr7sG.js} +1 -1
- package/dist/components/p-CArAuWdh.js +1 -0
- package/dist/components/{p-vznqVg6E.js → p-CPr3lzac.js} +1 -1
- package/dist/components/{p-DEBuE-pW.js → p-CV1qJByG.js} +1 -1
- package/dist/components/p-CXjMXCNh.js +1 -0
- package/dist/components/p-CbjDAdZ_.js +1 -0
- package/dist/components/p-CnZPI5RL.js +1 -0
- package/dist/components/{p-du_AmhYu.js → p-CrJXDjO0.js} +1 -1
- package/dist/components/{p-DtCG-y6d.js → p-Cx2K_zB2.js} +1 -1
- package/dist/components/{p-CJZIwyH-.js → p-D3H3ILJG.js} +1 -1
- package/dist/components/{p-BNNjhCQc.js → p-DgDoP1wQ.js} +1 -1
- package/dist/components/{p-DPjPJkXv.js → p-DvQzT5XM.js} +1 -1
- package/dist/components/{p-CjZTu6hh.js → p-UaMNiu8y.js} +1 -1
- package/dist/components/p-gHb970iC.js +1 -0
- package/dist/components/p-jaHdAlr9.js +1 -0
- package/dist/components/{p-Ese2dRYD.js → p-jk3tAdJg.js} +1 -1
- package/dist/components/p-qbtTff3q.js +1 -0
- package/dist/components/{sd-notice-modal.d.ts → sd-barcode-input.d.ts} +4 -4
- package/dist/components/sd-barcode-input.js +1 -0
- package/dist/components/sd-button-v2.js +1 -1
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-calendar.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-confirm-modal.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.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-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-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-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-group.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-v2-list-item-search.js +1 -1
- package/dist/components/sd-select-v2-list-item.js +1 -1
- package/dist/components/sd-select-v2-listbox.js +1 -1
- package/dist/components/sd-select-v2-trigger.js +1 -1
- package/dist/components/sd-select-v2.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-text-link.js +1 -1
- package/dist/components/sd-textarea.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-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.css +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/index.esm.js +1 -1
- package/dist/design-system/p-0174f3c5.entry.js +1 -0
- package/dist/design-system/{p-8e0cc9be.entry.js → p-0dee408f.entry.js} +1 -1
- package/dist/design-system/{p-fb71301e.entry.js → p-4301b50d.entry.js} +1 -1
- package/dist/design-system/p-4921c569.entry.js +1 -0
- package/dist/design-system/{p-2408d1ab.entry.js → p-50b1196b.entry.js} +1 -1
- package/dist/design-system/p-535b0778.entry.js +1 -0
- package/dist/design-system/{p-7ce76a05.entry.js → p-57b1e335.entry.js} +1 -1
- package/dist/design-system/{p-6a34e6b8.entry.js → p-5ce3142c.entry.js} +1 -1
- package/dist/design-system/{p-d8b04e91.entry.js → p-634797a4.entry.js} +1 -1
- package/dist/design-system/{p-b71d0858.entry.js → p-63a43fc9.entry.js} +1 -1
- package/dist/design-system/{p-72b09ede.entry.js → p-6a371d98.entry.js} +1 -1
- package/dist/design-system/p-6db4e8c7.entry.js +1 -0
- package/dist/design-system/{p-36ba5f33.entry.js → p-7368eb09.entry.js} +1 -1
- package/dist/design-system/p-868ce552.entry.js +1 -0
- package/dist/design-system/p-9eea4660.entry.js +1 -0
- package/dist/design-system/p-CbjDAdZ_.js +1 -0
- package/dist/design-system/{p-9933475e.entry.js → p-aaf91535.entry.js} +1 -1
- package/dist/design-system/{p-e96c881f.entry.js → p-c1963b5e.entry.js} +1 -1
- package/dist/design-system/{p-63f997d7.entry.js → p-dc6246be.entry.js} +1 -1
- package/dist/design-system/p-e39687d0.entry.js +1 -0
- package/dist/design-system/p-f91f4fcc.entry.js +1 -0
- package/dist/design-system/{p-f9075737.entry.js → p-f9cf0d6f.entry.js} +1 -1
- package/dist/design-system/{p-b79756cc.entry.js → p-fdde3de0.entry.js} +1 -1
- package/dist/design-system/p-feb80c2f.entry.js +1 -0
- package/dist/design-system/{p-BOmBg3kj.js → p-o9Ugc4Ua.js} +1 -1
- package/dist/esm/component.textinput-CbjDAdZ_.js +39 -0
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/index.js +0 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sd-barcode-input.entry.js +160 -0
- package/dist/esm/sd-button-v2_2.entry.js +4 -4
- package/dist/esm/sd-button_20.entry.js +39 -64
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-confirm-modal.entry.js +122 -0
- package/dist/esm/sd-date-picker.entry.js +1 -1
- package/dist/esm/sd-dropdown-button.entry.js +3 -3
- package/dist/esm/sd-file-picker.entry.js +3 -3
- package/dist/esm/sd-guide.entry.js +2 -2
- package/dist/esm/sd-modal-container.entry.js +17 -73
- package/dist/esm/sd-popover.entry.js +10 -2
- package/dist/esm/sd-progress.entry.js +2 -2
- package/dist/esm/sd-select-group.entry.js +1 -1
- package/dist/esm/sd-select-multiple.entry.js +1 -1
- package/dist/esm/sd-select-option-group.entry.js +3 -3
- package/dist/esm/sd-select-v2-list-item_2.entry.js +7 -16
- package/dist/esm/sd-select-v2-listbox_2.entry.js +181 -14
- package/dist/esm/{sd-select-v2.config-BOmBg3kj.js → sd-select-v2.config-o9Ugc4Ua.js} +12 -7
- package/dist/esm/sd-select-v2.entry.js +13 -21
- package/dist/esm/sd-text-link.entry.js +3 -3
- package/dist/esm/sd-toast-container.entry.js +1 -1
- package/dist/esm/sd-toast.entry.js +2 -2
- package/dist/esm/sd-toggle-button.entry.js +1 -1
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/types/components/sd-barcode-input/sd-barcode-input.config.d.ts +38 -0
- package/dist/types/components/sd-barcode-input/sd-barcode-input.d.ts +50 -0
- package/dist/types/components/sd-confirm-modal/sd-confirm-modal.config.d.ts +4 -3
- package/dist/types/components/sd-confirm-modal/sd-confirm-modal.d.ts +1 -1
- package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +3 -13
- package/dist/types/components/sd-modal-container/sd-modal-container.d.ts +2 -5
- package/dist/types/components/sd-popover/sd-popover.d.ts +1 -0
- package/dist/types/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.d.ts +0 -1
- package/dist/types/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.d.ts +44 -2
- package/dist/types/components/sd-select-v2/sd-select-v2.config.d.ts +4 -0
- package/dist/types/components/sd-select-v2/sd-select-v2.d.ts +0 -1
- package/dist/types/components/sd-tooltip/sd-tooltip.d.ts +1 -0
- package/dist/types/components.d.ts +249 -130
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/modal.d.ts +3 -4
- package/hydrate/index.js +584 -368
- package/hydrate/index.mjs +584 -368
- package/package.json +1 -1
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +0 -199
- package/dist/collection/components/sd-notice-modal/sd-notice-modal.config.js +0 -3
- package/dist/collection/components/sd-notice-modal/sd-notice-modal.css +0 -61
- package/dist/collection/components/sd-notice-modal/sd-notice-modal.js +0 -324
- package/dist/components/p-BDUKWznE.js +0 -1
- package/dist/components/p-BzfvfP0u.js +0 -1
- package/dist/components/p-C-AFCWLs.js +0 -1
- package/dist/components/p-CN-WKnUJ.js +0 -1
- package/dist/components/p-C_L-UaCP.js +0 -1
- package/dist/components/p-CrYrMUpQ.js +0 -1
- package/dist/components/p-D0PYeSW9.js +0 -1
- package/dist/components/p-DLe_Tu-I.js +0 -1
- package/dist/components/p-H9Vl4enQ.js +0 -1
- package/dist/components/sd-notice-modal.js +0 -1
- package/dist/design-system/p-10945e57.entry.js +0 -1
- package/dist/design-system/p-342f48ab.entry.js +0 -1
- package/dist/design-system/p-3ded14dc.entry.js +0 -1
- package/dist/design-system/p-951e5615.entry.js +0 -1
- package/dist/design-system/p-9c6fea35.entry.js +0 -1
- package/dist/design-system/p-9d431ea6.entry.js +0 -1
- package/dist/design-system/p-ba393cc8.entry.js +0 -1
- package/dist/design-system/p-df1f9832.entry.js +0 -1
- package/dist/esm/sd-confirm-modal_2.entry.js +0 -196
- package/dist/types/components/sd-notice-modal/sd-notice-modal.config.d.ts +0 -5
- package/dist/types/components/sd-notice-modal/sd-notice-modal.d.ts +0 -28
|
@@ -242,17 +242,17 @@ export class SdNumberInput {
|
|
|
242
242
|
const inputStyles = {
|
|
243
243
|
textAlign: this.useButton ? 'center' : 'right',
|
|
244
244
|
};
|
|
245
|
-
return (h("sd-field", { key: '
|
|
245
|
+
return (h("sd-field", { key: '7c278ee43828ff5619efe471b7f2a8c6ea09c300', name: this.name, label: this.label, addonLabel: this.addonLabel, hint: this.hint, errorMessage: this.errorMessage, 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: '10987e5255b183d774affb873866d2fab5721997', class: {
|
|
246
246
|
'sd-number-input': true,
|
|
247
247
|
[this.getInputStatus()]: true,
|
|
248
248
|
'sd-number-input--with-buttons': this.useButton,
|
|
249
|
-
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, h("input", { key: '
|
|
249
|
+
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, h("input", { key: 'ea09e409d3c4c0a9e59b57b8f0d9211ca271b0ed', 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: '3539fa8237cde3c5220934d18152bd6e3c20b979', class: "sd-number-input__buttons" }, h("button", { key: '4b48a586dbe4509a9c780c1d23b06252f3e5cf55', type: "button", class: {
|
|
250
250
|
'sd-number-input__button': true,
|
|
251
251
|
'sd-number-input__button--decrement': true,
|
|
252
|
-
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, h("sd-icon", { key: '
|
|
252
|
+
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, h("sd-icon", { key: '25076f714328a1bce556ecff6317573c98bd8214', name: "minus", size: 12, color: this.isDecrementDisabled() ? 'grey_45' : 'brilliantblue_70' })), h("button", { key: '99b5951b072d6bdbd1f36f217d441604aada3f4b', type: "button", class: {
|
|
253
253
|
'sd-number-input__button': true,
|
|
254
254
|
'sd-number-input__button--increment': true,
|
|
255
|
-
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: '
|
|
255
|
+
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: '13e8eda3bb5042bd65381057159dd60f04ecf69d', name: "add", size: 12, color: this.isIncrementDisabled() ? 'grey_45' : 'brilliantblue_70' })))))));
|
|
256
256
|
}
|
|
257
257
|
static get is() { return "sd-number-input"; }
|
|
258
258
|
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: 'fe61b181ec08d65564d8e68787403a7a83a90631', class: this.paginationClasses }, h("div", { key: '79237017bd874cf9bfa9af51e66f06ec641cefcf', 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: '416e4c3b231a8a9987cce6bd4359edc759c134ee', class: "append-btns" }, this.renderNextButtons())));
|
|
77
77
|
}
|
|
78
78
|
static get is() { return "sd-pagination"; }
|
|
79
79
|
static get originalStyleUrls() {
|
|
@@ -27,18 +27,26 @@ export class SdPopover {
|
|
|
27
27
|
this.slotContent = this.el.innerHTML;
|
|
28
28
|
}
|
|
29
29
|
buttonEl;
|
|
30
|
+
get popoverOffset() {
|
|
31
|
+
switch (this.placement) {
|
|
32
|
+
case 'top': return [0, -4];
|
|
33
|
+
case 'bottom': return [0, 4];
|
|
34
|
+
case 'left': return [4, 0];
|
|
35
|
+
case 'right': return [4, 0];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
30
38
|
handleClose = () => {
|
|
31
39
|
this.showPopover = false;
|
|
32
40
|
};
|
|
33
41
|
render() {
|
|
34
|
-
return (h(Fragment, { key: '
|
|
42
|
+
return (h(Fragment, { key: 'f367ea2ada0fda7c28c943bd7bd48785b1810999' }, 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: 'afdb58bfdf25af2adc45a7b81221c1859b517a5a', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement, offset: this.popoverOffset }, h("div", { key: '38757707dd8c055674edbc2381409f5fd8712c8d', class: {
|
|
35
43
|
'sd-floating-menu': true,
|
|
36
44
|
'sd-floating-menu--popover': true,
|
|
37
45
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
38
46
|
[this.menuClass]: !!this.menuClass,
|
|
39
47
|
}, style: {
|
|
40
48
|
'--sd-floating-bg': popoverTokens.popover.bg,
|
|
41
|
-
} }, h("i", { key: '
|
|
49
|
+
} }, h("i", { key: '333bae4cb23470121d63d4d8b34a1d2b15837e7d', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, h(TooltipArrow, { key: '617781bb6fc8957576eb149471fd8bf0f44ca552' })), h("div", { key: '8c57d49782edd344c8c2c0b9bf44fff8ec154159', class: "sd-floating-menu__content" }, this.menuTitle && h("div", { key: 'a06b93124684cb96910ffa2603cf7410a01d6381', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (h("div", { key: '24691930b8ae03a3c92ed8e74dae708b5e64f03b', class: "sd-floating-menu__messages" }, this.messages.map(message => (h("div", null, message))))), this.buttons.length > 0 && (h("div", { key: 'd73cd4cc978711857c4c946dd2a1c1b64bb5feb6', 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: 'cda218024d04b03fc2931afa99f0127bc7a9c4c5', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, h("sd-icon", { key: '3f41ebce27fd4bab823370d6bbe25b5caed9d5e1', name: "close", size: popoverTokens.popover.close.icon, color: popoverTokens.popover.close.color }))))))));
|
|
42
50
|
}
|
|
43
51
|
static get is() { return "sd-popover"; }
|
|
44
52
|
static get originalStyleUrls() {
|
|
@@ -220,7 +220,7 @@ export class SdPortal {
|
|
|
220
220
|
this.close.emit();
|
|
221
221
|
}
|
|
222
222
|
render() {
|
|
223
|
-
return h("slot", { key: '
|
|
223
|
+
return h("slot", { key: '04581cb6d22882520a7da534d19dcbec7b540af7' });
|
|
224
224
|
}
|
|
225
225
|
static get is() { return "sd-portal"; }
|
|
226
226
|
static get properties() {
|
|
@@ -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: 'b97a1ba0ad800ada8a2e87aab6108a77053a3ed5', 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: '6a182e4ade2d9c361a85d3fda62f08f62f4722a3', 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: '70bea150872ff4b70b70d358972b14bf0ad2bdf2', 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: '79ebdc72ca4a905f700dc6293d8033a5ec22d679', 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: '2e04258ee26b376794a5ebe76503875e48dd3ff2', 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: '82fd2b838c46c47b51b93a23e5a837708fb944b1', 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: 'fc0821ce63f445bed3dfce51668ece1831914f86', 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: '6a9b19f5910132be045e3a2cc33546307e3d5cb9', 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() {
|
|
@@ -270,7 +270,7 @@ export class SdSelectGroup extends BaseDropdownEvent {
|
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
272
|
render() {
|
|
273
|
-
return (h("sd-field", { key: '
|
|
273
|
+
return (h("sd-field", { key: '822acc0b4200ab415646218d0f059b45f348f5ea', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, addonLabel: this.addonLabel, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: { '--field-width': this.width || '200px' } }, h("div", { key: 'f5a76e913d116469a9d3d9c777d5a3ad62ea42b7', class: {
|
|
274
274
|
'sd-select-group': true,
|
|
275
275
|
'sd-select-group--open': this.isOpen,
|
|
276
276
|
'sd-select-group--disabled': this.disabled,
|
|
@@ -150,7 +150,7 @@ export class SdSelectMultiple extends BaseDropdownEvent {
|
|
|
150
150
|
this.handleOptionSelection(option);
|
|
151
151
|
};
|
|
152
152
|
render() {
|
|
153
|
-
return (h("sd-field", { key: '
|
|
153
|
+
return (h("sd-field", { key: '315be9fce15876ab835f0a6609657dfc04b4f9cf', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, h("div", { key: 'db4754bd0710e217119e02827e9e9db3285a5c74', class: {
|
|
154
154
|
'sd-select-multiple': true,
|
|
155
155
|
'sd-select-multiple--open': this.isOpen,
|
|
156
156
|
'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: '809d58fbd23e57920785835b37f00b66b579a96c', 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: 'f2ff05ee37333111548779d9fe78d0c4b91c9a1e', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (h("sd-checkbox", { key: '4ca8aaffb38af21f27d429f6c937b1da3374c24a', 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: 'b4b2943e68b98ce82c32e78a9841aae3be4d8e5f', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (h("span", { key: '6e1414b3738c43f8bd5d308b57440d34f9e1b7fa', 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() {
|
package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.css
CHANGED
|
@@ -24,10 +24,6 @@ sd-select-v2-list-item .sd-select-v2-list-item--depth1-group {
|
|
|
24
24
|
sd-select-v2-list-item .sd-select-v2-list-item--depth2-group {
|
|
25
25
|
font-weight: 500;
|
|
26
26
|
}
|
|
27
|
-
sd-select-v2-list-item .sd-select-v2-list-item--selectable:not(.sd-select-v2-list-item--disabled):hover {
|
|
28
|
-
background: var(--list-item-bg-hover);
|
|
29
|
-
color: var(--list-item-color-hover);
|
|
30
|
-
}
|
|
31
27
|
sd-select-v2-list-item .sd-select-v2-list-item--focused.sd-select-v2-list-item--selectable:not(.sd-select-v2-list-item--disabled) {
|
|
32
28
|
background: var(--list-item-bg-hover);
|
|
33
29
|
color: var(--list-item-color-hover);
|
|
@@ -36,7 +32,7 @@ sd-select-v2-list-item .sd-select-v2-list-item--selected:not(.sd-select-v2-list-
|
|
|
36
32
|
font-weight: 700;
|
|
37
33
|
color: var(--list-item-bg-hover);
|
|
38
34
|
}
|
|
39
|
-
sd-select-v2-list-item .sd-select-v2-list-item--selected
|
|
35
|
+
sd-select-v2-list-item .sd-select-v2-list-item--selected.sd-select-v2-list-item--focused {
|
|
40
36
|
color: var(--list-item-color-hover);
|
|
41
37
|
}
|
|
42
38
|
sd-select-v2-list-item .sd-select-v2-list-item--disabled {
|
|
@@ -44,7 +40,8 @@ sd-select-v2-list-item .sd-select-v2-list-item--disabled {
|
|
|
44
40
|
cursor: not-allowed;
|
|
45
41
|
}
|
|
46
42
|
sd-select-v2-list-item .sd-select-v2-list-item__label {
|
|
47
|
-
flex: 1;
|
|
43
|
+
flex: 0 1 auto;
|
|
44
|
+
min-width: 0;
|
|
48
45
|
white-space: nowrap;
|
|
49
46
|
overflow: hidden;
|
|
50
47
|
text-overflow: ellipsis;
|
|
@@ -54,6 +51,9 @@ sd-select-v2-list-item .sd-select-v2-list-item__count {
|
|
|
54
51
|
font-weight: 500;
|
|
55
52
|
color: var(--list-item-color-disabled);
|
|
56
53
|
}
|
|
54
|
+
sd-select-v2-list-item .sd-select-v2-list-item--group.sd-select-v2-list-item--focused .sd-select-v2-list-item__count {
|
|
55
|
+
color: #ffffff;
|
|
56
|
+
}
|
|
57
57
|
sd-select-v2-list-item .sd-select-v2-list-item__checkbox {
|
|
58
58
|
flex-shrink: 0;
|
|
59
59
|
}
|
package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.js
CHANGED
|
@@ -64,7 +64,7 @@ export class SdSelectV2ListItem {
|
|
|
64
64
|
if (isDepth1Group) {
|
|
65
65
|
cssVars['--list-item-border-top'] = `${LIST_ITEM_COLORS.depth1.borderWidth}px solid ${LIST_ITEM_COLORS.depth1.border}`;
|
|
66
66
|
}
|
|
67
|
-
return (h("div", { key: '
|
|
67
|
+
return (h("div", { key: 'af73e77fdeb673b1862b7bd0b153ee0726a3f5db', class: {
|
|
68
68
|
'sd-select-v2-list-item': true,
|
|
69
69
|
'sd-select-v2-list-item--group': isGroup,
|
|
70
70
|
'sd-select-v2-list-item--depth1-group': isDepth1Group,
|
|
@@ -74,7 +74,7 @@ export class SdSelectV2ListItem {
|
|
|
74
74
|
'sd-select-v2-list-item--focused': this.isFocused,
|
|
75
75
|
'sd-select-v2-list-item--selectable': this.isSelectable && !this.option.disabled,
|
|
76
76
|
'sd-select-v2-list-item--disabled': !!this.option.disabled,
|
|
77
|
-
}, style: cssVars, onClick: this.handleClick }, this.useCheckbox && (h("sd-checkbox", { key: '
|
|
77
|
+
}, style: cssVars, onClick: this.handleClick }, this.useCheckbox && (h("sd-checkbox", { key: '8cfcf0375fc756562c4ac698c843bfde3ec3750c', value: this.isSelected === null ? null : !!this.isSelected, disabled: this.option.disabled, class: "sd-select-v2-list-item__checkbox", onClick: this.handleCheckboxClick, onSdUpdate: this.handleCheckboxUpdate })), h("span", { key: '1a993c125767559c9cd27f343983b26a24413a93', class: "sd-select-v2-list-item__label" }, this.option.label), this.countInfo && (h("span", { key: '377d0d6c6acab983aff2471fc0f4f78eaa637370', class: "sd-select-v2-list-item__count" }, "(", this.countInfo.selected, "/", this.countInfo.total, ")"))));
|
|
78
78
|
}
|
|
79
79
|
static get is() { return "sd-select-v2-list-item"; }
|
|
80
80
|
static get originalStyleUrls() {
|
|
@@ -26,15 +26,6 @@ export class SdSelectV2ListItemSearch {
|
|
|
26
26
|
this.searchFilter.emit(this.searchText);
|
|
27
27
|
}, SEARCH_DEBOUNCE_MS);
|
|
28
28
|
};
|
|
29
|
-
handleKeyDown = (e) => {
|
|
30
|
-
if (e.key === 'Enter') {
|
|
31
|
-
e.preventDefault();
|
|
32
|
-
e.stopPropagation();
|
|
33
|
-
if (this.debounceTimer)
|
|
34
|
-
clearTimeout(this.debounceTimer);
|
|
35
|
-
this.searchFilter.emit(this.searchText);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
29
|
handleClear = (e) => {
|
|
39
30
|
e.stopPropagation();
|
|
40
31
|
this.searchText = '';
|
|
@@ -50,12 +41,12 @@ export class SdSelectV2ListItemSearch {
|
|
|
50
41
|
clearTimeout(this.debounceTimer);
|
|
51
42
|
}
|
|
52
43
|
render() {
|
|
53
|
-
return (h("div", { key: '
|
|
44
|
+
return (h("div", { key: '7e0f812a04f8f72e41916aad1c2bd8313dac44c7', class: {
|
|
54
45
|
'sd-select-v2-list-item-search': true,
|
|
55
46
|
'sd-select-v2-list-item-search--scrolled': this.isScrolled,
|
|
56
|
-
} }, h("div", { key: '
|
|
47
|
+
} }, h("div", { key: 'f9df679b4cab727ba2c29293194556dad00bf46b', class: "sd-select-v2-list-item-search__inner" }, h("sd-icon", { key: '5f9eb6de82437a6344cc3a0042a24196cb7392a5', name: "search", size: 16, color: "grey_70", class: "sd-select-v2-list-item-search__icon" }), h("input", { key: '382b15077dd49e3addceca6026953c6065a5f60c', ref: el => {
|
|
57
48
|
this.inputEl = el;
|
|
58
|
-
}, type: "text", class: "sd-select-v2-list-item-search__input", placeholder: "\uAC80\uC0C9\uC5B4 \uC785\uB825", value: this.searchText, onInput: this.handleInput,
|
|
49
|
+
}, type: "text", class: "sd-select-v2-list-item-search__input", placeholder: "\uAC80\uC0C9\uC5B4 \uC785\uB825", value: this.searchText, onInput: this.handleInput, onFocus: () => this.searchFocus.emit() }), this.searchText && (h("button", { key: '00830db3b8d303993acf0787e3818e36f7c2c19c', type: "button", class: "sd-select-v2-list-item-search__clear", onClick: this.handleClear }, h("sd-icon", { key: 'a40a022ec7a3ea9d4bda28e7b5fd41850966c716', name: "close", size: 12, color: "#888888" }))))));
|
|
59
50
|
}
|
|
60
51
|
static get is() { return "sd-select-v2-list-item-search"; }
|
|
61
52
|
static get originalStyleUrls() {
|
package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.js
CHANGED
|
@@ -10,7 +10,12 @@ export class SdSelectV2Listbox {
|
|
|
10
10
|
maxHeight = '260px';
|
|
11
11
|
searchKeyword = '';
|
|
12
12
|
isScrolled = false;
|
|
13
|
+
focusedIndex = -1;
|
|
13
14
|
optionSelect;
|
|
15
|
+
listEl;
|
|
16
|
+
lastScrolledIndex = -1;
|
|
17
|
+
keydownAttached = false;
|
|
18
|
+
suppressHover = false;
|
|
14
19
|
get isDepth() {
|
|
15
20
|
return this.name === 'default_depth' || this.name === 'multi_depth';
|
|
16
21
|
}
|
|
@@ -60,9 +65,9 @@ export class SdSelectV2Listbox {
|
|
|
60
65
|
const selectedValues = this.getSelectedValues();
|
|
61
66
|
if (selectedValues.size === 0)
|
|
62
67
|
return false;
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
const leaves = this.collectVisibleLeaves(option);
|
|
69
|
+
if (leaves.length === 0)
|
|
70
|
+
return false;
|
|
66
71
|
const selectedCount = leaves.filter(l => selectedValues.has(l.value)).length;
|
|
67
72
|
if (selectedCount === 0)
|
|
68
73
|
return false;
|
|
@@ -74,10 +79,9 @@ export class SdSelectV2Listbox {
|
|
|
74
79
|
if (!this.isMulti || !option.children)
|
|
75
80
|
return undefined;
|
|
76
81
|
const selectedValues = this.getSelectedValues();
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
return { selected: selectedCount, total: totalLeaves.length };
|
|
82
|
+
const leaves = this.collectVisibleLeaves(option);
|
|
83
|
+
const selectedCount = leaves.filter(l => selectedValues.has(l.value)).length;
|
|
84
|
+
return { selected: selectedCount, total: leaves.length };
|
|
81
85
|
}
|
|
82
86
|
findOriginalOption(value, options) {
|
|
83
87
|
for (const opt of options) {
|
|
@@ -96,21 +100,177 @@ export class SdSelectV2Listbox {
|
|
|
96
100
|
return [option];
|
|
97
101
|
return option.children.flatMap(child => this.collectLeaves(child));
|
|
98
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Returns the leaves currently visible to the user for the given (possibly
|
|
105
|
+
* filtered) option. When a group's own label matched the search keyword its
|
|
106
|
+
* `children` is emptied by `filterTree`; in that case we fall back to the
|
|
107
|
+
* full original subtree because the user has no way to deselect descendants
|
|
108
|
+
* individually.
|
|
109
|
+
*/
|
|
110
|
+
collectVisibleLeaves(option) {
|
|
111
|
+
if (!option.children)
|
|
112
|
+
return [option];
|
|
113
|
+
if (option.children.length === 0) {
|
|
114
|
+
const original = this.findOriginalOption(option.value, this.options);
|
|
115
|
+
return original ? this.collectLeaves(original) : [];
|
|
116
|
+
}
|
|
117
|
+
return option.children.flatMap(child => this.collectVisibleLeaves(child));
|
|
118
|
+
}
|
|
119
|
+
get navigableOptions() {
|
|
120
|
+
const items = [];
|
|
121
|
+
const walk = (opts) => {
|
|
122
|
+
for (const opt of opts) {
|
|
123
|
+
const isGroup = !!opt.children;
|
|
124
|
+
const isSelectable = !isGroup || this.isMulti;
|
|
125
|
+
if (isSelectable && !opt.disabled)
|
|
126
|
+
items.push(opt);
|
|
127
|
+
if (isGroup && opt.children && opt.children.length > 0)
|
|
128
|
+
walk(opt.children);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
walk(this.filteredOptions);
|
|
132
|
+
return items;
|
|
133
|
+
}
|
|
134
|
+
isOptionFocused(option) {
|
|
135
|
+
if (this.focusedIndex < 0)
|
|
136
|
+
return false;
|
|
137
|
+
const focused = this.navigableOptions[this.focusedIndex];
|
|
138
|
+
// filterTree 가 매 호출마다 옵션 객체를 새로 복제하기 때문에 참조 비교
|
|
139
|
+
// (=== / indexOf) 는 검색이 적용된 동안 항상 실패한다. 고유 식별자인
|
|
140
|
+
// value 로 비교해야 한다.
|
|
141
|
+
return !!focused && focused.value === option.value;
|
|
142
|
+
}
|
|
143
|
+
resetFocusOnFilter() {
|
|
144
|
+
// 필터가 바뀌면 이전 인덱스가 가리키던 항목이 사라질 수 있으므로
|
|
145
|
+
// 새 결과의 첫 항목으로 옮긴다. 결과가 비면 -1.
|
|
146
|
+
const items = this.navigableOptions;
|
|
147
|
+
this.focusedIndex = items.length > 0 ? 0 : -1;
|
|
148
|
+
// 키보드 네비게이션 직후 마우스가 한 번도 안 움직인 채로 사용자가
|
|
149
|
+
// 검색을 시작했다면 hover suppression 이 켜진 상태로 남아있을 수 있다.
|
|
150
|
+
// 검색이라는 명백한 사용자 의도 전환 시점에 강제로 해제한다.
|
|
151
|
+
if (this.suppressHover) {
|
|
152
|
+
document.removeEventListener('mousemove', this.releaseHoverSuppress, true);
|
|
153
|
+
this.suppressHover = false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
99
156
|
handleSearchFilter = (e) => {
|
|
100
157
|
this.searchKeyword = e.detail;
|
|
101
158
|
};
|
|
102
159
|
handleScroll = (e) => {
|
|
103
160
|
this.isScrolled = e.target.scrollTop > 0;
|
|
104
161
|
};
|
|
162
|
+
emitOptionSelect(option) {
|
|
163
|
+
this.optionSelect.emit({
|
|
164
|
+
option,
|
|
165
|
+
leaves: this.collectVisibleLeaves(option),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
105
168
|
handleOptionClick = (e) => {
|
|
106
169
|
e.stopPropagation();
|
|
107
|
-
this.
|
|
170
|
+
this.emitOptionSelect(e.detail);
|
|
171
|
+
};
|
|
172
|
+
handleOptionHover = (option) => {
|
|
173
|
+
if (this.suppressHover)
|
|
174
|
+
return;
|
|
175
|
+
const idx = this.navigableOptions.findIndex(o => o.value === option.value);
|
|
176
|
+
if (idx >= 0)
|
|
177
|
+
this.focusedIndex = idx;
|
|
178
|
+
};
|
|
179
|
+
releaseHoverSuppress = () => {
|
|
180
|
+
this.suppressHover = false;
|
|
181
|
+
document.removeEventListener('mousemove', this.releaseHoverSuppress, true);
|
|
182
|
+
};
|
|
183
|
+
handleKeyDown = (e) => {
|
|
184
|
+
const items = this.navigableOptions;
|
|
185
|
+
if (e.key === 'ArrowDown') {
|
|
186
|
+
if (items.length === 0)
|
|
187
|
+
return;
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
e.stopPropagation();
|
|
190
|
+
this.focusedIndex = this.focusedIndex < 0 ? 0 : (this.focusedIndex + 1) % items.length;
|
|
191
|
+
this.beginHoverSuppression();
|
|
192
|
+
}
|
|
193
|
+
else if (e.key === 'ArrowUp') {
|
|
194
|
+
if (items.length === 0)
|
|
195
|
+
return;
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
e.stopPropagation();
|
|
198
|
+
this.focusedIndex = this.focusedIndex <= 0 ? items.length - 1 : this.focusedIndex - 1;
|
|
199
|
+
this.beginHoverSuppression();
|
|
200
|
+
}
|
|
201
|
+
else if (e.key === 'Enter') {
|
|
202
|
+
if (this.focusedIndex < 0 || this.focusedIndex >= items.length)
|
|
203
|
+
return;
|
|
204
|
+
e.preventDefault();
|
|
205
|
+
e.stopPropagation();
|
|
206
|
+
this.emitOptionSelect(items[this.focusedIndex]);
|
|
207
|
+
}
|
|
108
208
|
};
|
|
209
|
+
/**
|
|
210
|
+
* 키보드로 인덱스를 옮기면 자동 스크롤이 일어나는데, 정지한 마우스 커서
|
|
211
|
+
* 아래로 다른 항목이 미끄러져 들어오면서 mouseenter 가 발화해 인덱스를
|
|
212
|
+
* 다시 덮어쓰는 문제를 막는다. 실제로 마우스가 한 번이라도 움직이기 전까지
|
|
213
|
+
* hover 갱신을 무시한다.
|
|
214
|
+
*/
|
|
215
|
+
beginHoverSuppression() {
|
|
216
|
+
if (this.suppressHover)
|
|
217
|
+
return;
|
|
218
|
+
this.suppressHover = true;
|
|
219
|
+
document.addEventListener('mousemove', this.releaseHoverSuppress, true);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* 리스트 컨테이너 내부에서만 스크롤한다. `scrollIntoView` 는 조상 스크롤
|
|
223
|
+
* 컨테이너(=문서 자체)까지 함께 스크롤시키므로 사용하지 않는다.
|
|
224
|
+
*/
|
|
225
|
+
scrollFocusedIntoView() {
|
|
226
|
+
const list = this.listEl;
|
|
227
|
+
const focusedEl = list?.querySelector('.sd-select-v2-list-item--focused');
|
|
228
|
+
if (!list || !focusedEl)
|
|
229
|
+
return;
|
|
230
|
+
const listRect = list.getBoundingClientRect();
|
|
231
|
+
const itemRect = focusedEl.getBoundingClientRect();
|
|
232
|
+
if (itemRect.top < listRect.top) {
|
|
233
|
+
list.scrollTop += itemRect.top - listRect.top;
|
|
234
|
+
}
|
|
235
|
+
else if (itemRect.bottom > listRect.bottom) {
|
|
236
|
+
list.scrollTop += itemRect.bottom - listRect.bottom;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* sd-portal 이 슬롯 노드를 body 로 이동시키면서 disconnect → connect 가
|
|
241
|
+
* 발생하므로, 키보드 리스너는 한 번만 실행되는 componentDidLoad 가 아니라
|
|
242
|
+
* connectedCallback / disconnectedCallback 에 묶어 매번 재부착한다.
|
|
243
|
+
* capture phase 로 잡아 포커스가 검색 input 에 있어도 ↑/↓/Enter 가
|
|
244
|
+
* input 의 기본 동작(커서 이동)·페이지 스크롤보다 먼저 처리되도록 한다.
|
|
245
|
+
*/
|
|
246
|
+
connectedCallback() {
|
|
247
|
+
if (!this.keydownAttached) {
|
|
248
|
+
document.addEventListener('keydown', this.handleKeyDown, true);
|
|
249
|
+
this.keydownAttached = true;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
disconnectedCallback() {
|
|
253
|
+
if (this.keydownAttached) {
|
|
254
|
+
document.removeEventListener('keydown', this.handleKeyDown, true);
|
|
255
|
+
this.keydownAttached = false;
|
|
256
|
+
}
|
|
257
|
+
if (this.suppressHover) {
|
|
258
|
+
document.removeEventListener('mousemove', this.releaseHoverSuppress, true);
|
|
259
|
+
this.suppressHover = false;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
componentDidRender() {
|
|
263
|
+
if (this.focusedIndex !== this.lastScrolledIndex) {
|
|
264
|
+
this.lastScrolledIndex = this.focusedIndex;
|
|
265
|
+
if (this.focusedIndex >= 0)
|
|
266
|
+
this.scrollFocusedIntoView();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
109
269
|
renderOptions(options, depth = 1) {
|
|
110
270
|
return options.map(option => {
|
|
111
271
|
const isGroup = !!option.children;
|
|
112
272
|
return [
|
|
113
|
-
h("sd-select-v2-list-item", { option: option, depth: depth, isSelected: isGroup ? this.getGroupSelectionState(option) : this.isOptionSelected(option), useCheckbox: this.isMulti, countInfo: this.getCountInfo(option), onSdListItemClick: this.handleOptionClick }),
|
|
273
|
+
h("sd-select-v2-list-item", { option: option, depth: depth, isSelected: isGroup ? this.getGroupSelectionState(option) : this.isOptionSelected(option), isFocused: this.isOptionFocused(option), useCheckbox: this.isMulti, countInfo: this.getCountInfo(option), onSdListItemClick: this.handleOptionClick, onMouseEnter: () => this.handleOptionHover(option) }),
|
|
114
274
|
isGroup && option.children ? this.renderOptions(option.children, depth + 1) : null,
|
|
115
275
|
];
|
|
116
276
|
});
|
|
@@ -123,7 +283,9 @@ export class SdSelectV2Listbox {
|
|
|
123
283
|
'--listbox-radius': `${LIST_BOX_LAYOUT.radius}px`,
|
|
124
284
|
'--listbox-padding-bottom': `${LIST_BOX_LAYOUT.paddingBottom}px`,
|
|
125
285
|
};
|
|
126
|
-
return (h("div", { key: '
|
|
286
|
+
return (h("div", { key: 'f47839574d0c149ab4aa2a3912b51318ec815b55', class: "sd-select-v2-listbox", style: cssVars }, this.showSearch && (h("sd-select-v2-list-item-search", { key: '3c3f9fd3e0c935da59bc7727af5c719b76b309d5', isScrolled: this.isScrolled, onSdSearchFilter: this.handleSearchFilter })), h("div", { key: '4d4ef6c7c543689abb9ed085e07e613deca6c8d8', class: "sd-select-v2-listbox__list", onScroll: this.handleScroll, ref: el => {
|
|
287
|
+
this.listEl = el;
|
|
288
|
+
} }, this.isEmpty ? (h("div", { class: "sd-select-v2-listbox__empty" }, EMPTY_MESSAGE)) : this.isDepth ? (this.renderOptions(this.filteredOptions)) : (this.filteredOptions.map(option => (h("sd-select-v2-list-item", { option: option, depth: 1, isSelected: this.isOptionSelected(option), isFocused: this.isOptionFocused(option), useCheckbox: this.isMulti, onSdListItemClick: this.handleOptionClick, onMouseEnter: () => this.handleOptionHover(option) })))))));
|
|
127
289
|
}
|
|
128
290
|
static get is() { return "sd-select-v2-listbox"; }
|
|
129
291
|
static get originalStyleUrls() {
|
|
@@ -302,7 +464,8 @@ export class SdSelectV2Listbox {
|
|
|
302
464
|
static get states() {
|
|
303
465
|
return {
|
|
304
466
|
"searchKeyword": {},
|
|
305
|
-
"isScrolled": {}
|
|
467
|
+
"isScrolled": {},
|
|
468
|
+
"focusedIndex": {}
|
|
306
469
|
};
|
|
307
470
|
}
|
|
308
471
|
static get events() {
|
|
@@ -317,17 +480,23 @@ export class SdSelectV2Listbox {
|
|
|
317
480
|
"text": ""
|
|
318
481
|
},
|
|
319
482
|
"complexType": {
|
|
320
|
-
"original": "
|
|
321
|
-
"resolved": "
|
|
483
|
+
"original": "SelectV2OptionSelectDetail",
|
|
484
|
+
"resolved": "SelectV2OptionSelectDetail",
|
|
322
485
|
"references": {
|
|
323
|
-
"
|
|
486
|
+
"SelectV2OptionSelectDetail": {
|
|
324
487
|
"location": "import",
|
|
325
488
|
"path": "../sd-select-v2.config",
|
|
326
|
-
"id": "src/components/sd-select-v2/sd-select-v2.config.ts::
|
|
327
|
-
"referenceLocation": "
|
|
489
|
+
"id": "src/components/sd-select-v2/sd-select-v2.config.ts::SelectV2OptionSelectDetail",
|
|
490
|
+
"referenceLocation": "SelectV2OptionSelectDetail"
|
|
328
491
|
}
|
|
329
492
|
}
|
|
330
493
|
}
|
|
331
494
|
}];
|
|
332
495
|
}
|
|
496
|
+
static get watchers() {
|
|
497
|
+
return [{
|
|
498
|
+
"propName": "searchKeyword",
|
|
499
|
+
"methodName": "resetFocusOnFilter"
|
|
500
|
+
}];
|
|
501
|
+
}
|
|
333
502
|
}
|
package/dist/collection/components/sd-select-v2/sd-select-v2-trigger/sd-select-v2-trigger.js
CHANGED
|
@@ -26,11 +26,11 @@ export class SdSelectV2Trigger {
|
|
|
26
26
|
: SELECT_COLORS.icon.default,
|
|
27
27
|
'--trigger-icon-color': this.disabled ? SELECT_COLORS.icon.disabled : SELECT_COLORS.icon.default,
|
|
28
28
|
};
|
|
29
|
-
return (h("div", { key: '
|
|
29
|
+
return (h("div", { key: '2cf4cc98bbfc8808f84d1d6b9dbfbb4f1afee272', class: {
|
|
30
30
|
'sd-select-v2-trigger': true,
|
|
31
31
|
'sd-select-v2-trigger--open': this.isOpen,
|
|
32
32
|
'sd-select-v2-trigger--disabled': this.disabled,
|
|
33
|
-
}, style: cssVars, onClick: this.handleClick }, h("div", { key: '
|
|
33
|
+
}, style: cssVars, onClick: this.handleClick }, h("div", { key: '8835de30555a7ef7846afacad8ec6ee5482b36cf', class: "sd-select-v2-trigger__content" }, h("span", { key: '5afd6845dc9b412a3cd87e6a16de8bd506b38dbb', class: "sd-select-v2-trigger__text" }, hasValue ? this.displayText : this.placeholder), h("sd-icon", { key: '727d44f2814321bc80ca5a9d127ce5676f0bfdc6', name: "arrowDown", size: 12, color: "var(--trigger-icon-color)", class: {
|
|
34
34
|
'sd-select-v2-trigger__icon': true,
|
|
35
35
|
'sd-select-v2-trigger__icon--open': this.isOpen,
|
|
36
36
|
} }))));
|