@sellmate/design-system 1.23.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-action-modal.cjs.entry.js +1 -1
- package/dist/cjs/sd-badge.cjs.entry.js +1 -1
- package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
- package/dist/cjs/sd-calendar_2.cjs.entry.js +5 -5
- package/dist/cjs/sd-callout.cjs.entry.js +1 -1
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-chip-input.cjs.entry.js +4 -4
- package/dist/cjs/sd-chip.cjs.entry.js +1 -1
- package/dist/cjs/sd-circle-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-picker_7.cjs.entry.js +10 -10
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +1 -1
- package/dist/cjs/sd-divider.cjs.entry.js +1 -1
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-field_3.cjs.entry.js +8 -8
- package/dist/cjs/sd-ghost-button_3.cjs.entry.js +20 -12
- package/dist/cjs/sd-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-loading-container.cjs.entry.js +2 -2
- package/dist/cjs/sd-pagination_4.cjs.entry.js +8 -8
- package/dist/cjs/sd-popover.cjs.entry.js +3 -3
- package/dist/cjs/sd-popup.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-list-item_2.cjs.entry.js +6 -6
- package/dist/cjs/sd-select_3.cjs.entry.js +8 -8
- package/dist/cjs/sd-switch.cjs.entry.js +1 -1
- package/dist/cjs/sd-table.cjs.entry.js +6 -6
- package/dist/cjs/sd-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sd-td.cjs.entry.js +1 -1
- package/dist/cjs/sd-text-link.cjs.entry.js +22 -4
- package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast.cjs.entry.js +2 -2
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/collection/components/sd-action-modal/sd-action-modal.js +1 -1
- package/dist/collection/components/sd-badge/sd-badge.js +1 -1
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +1 -1
- package/dist/collection/components/sd-calendar/sd-calendar.js +3 -3
- package/dist/collection/components/sd-callout/sd-callout.js +1 -1
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-chip/sd-chip.js +1 -1
- package/dist/collection/components/sd-chip-input/sd-chip-input.js +4 -4
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +1 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +2 -2
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
- package/dist/collection/components/sd-divider/sd-divider.js +1 -1
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.css +4 -4
- package/dist/collection/components/sd-field/sd-field.js +5 -5
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.css +4 -0
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +2 -2
- package/dist/collection/components/sd-input/sd-input.js +2 -2
- package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
- package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
- package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
- package/dist/collection/components/sd-popover/sd-popover.js +3 -3
- package/dist/collection/components/sd-popup/sd-popup.js +1 -1
- package/dist/collection/components/sd-portal/sd-portal.js +15 -7
- package/dist/collection/components/sd-radio/sd-radio.js +1 -1
- package/dist/collection/components/sd-radio-button/sd-radio-button.js +1 -1
- package/dist/collection/components/sd-radio-group/sd-radio-group.js +1 -1
- package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
- package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
- package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
- package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
- package/dist/collection/components/sd-select/sd-select.js +4 -4
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.js +6 -6
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +2 -2
- package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
- package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
- package/dist/collection/components/sd-tag/sd-tag.js +2 -2
- package/dist/collection/components/sd-text-link/sd-text-link.css +17 -0
- package/dist/collection/components/sd-text-link/sd-text-link.js +46 -3
- package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
- package/dist/collection/components/sd-toast/sd-toast.js +2 -2
- package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/components/{p-Btpf6Xpg.js → p-0U99W-3Z.js} +1 -1
- package/dist/components/{p-kDokArZu.js → p-1cW-9wVB.js} +1 -1
- package/dist/components/{p-4I0LJNSg.js → p-B8uvCE1e.js} +1 -1
- package/dist/components/{p-IMWw_SJ1.js → p-BZUlNC0d.js} +1 -1
- package/dist/components/{p-DgZ_vzrA.js → p-BoH7ykYx.js} +1 -1
- package/dist/components/{p-C2cNc56z.js → p-BoPkOevJ.js} +1 -1
- package/dist/components/{p-BYgT6mRD.js → p-Bqfoe_ek.js} +1 -1
- package/dist/components/{p-BFMUpKa2.js → p-BtVuPyhl.js} +1 -1
- package/dist/components/{p-CpBPNHYe.js → p-C-Cje7aS.js} +1 -1
- package/dist/components/p-C4_oeGm-.js +1 -0
- package/dist/components/p-C5uz_eFs.js +1 -0
- package/dist/components/{p-Dj1iJxUT.js → p-CBXH-GWN.js} +1 -1
- package/dist/components/{p-DfKZyde8.js → p-CNwoxvpg.js} +1 -1
- package/dist/components/{p-DnHzWLdY.js → p-Ck2aozmE.js} +1 -1
- package/dist/components/{p-BwgUEhOa.js → p-CtNDxhxx.js} +1 -1
- package/dist/components/{p-ClBvavih.js → p-D-a6H314.js} +1 -1
- package/dist/components/p-D6noGX38.js +1 -0
- package/dist/components/{p-CGJ1L8_Y.js → p-D8T1XeGP.js} +1 -1
- package/dist/components/{p-BJMpxQSk.js → p-DMvWCQfX.js} +1 -1
- package/dist/components/{p-2-7UYvqL.js → p-DNRm9_Bv.js} +1 -1
- package/dist/components/{p-BLsuwMw4.js → p-DPmMT-y0.js} +1 -1
- package/dist/components/p-D_SxeDkS.js +1 -0
- package/dist/components/{p-lL2VxD2V.js → p-DcJ7u2_W.js} +1 -1
- package/dist/components/{p-C_g09O6z.js → p-DyfR6eGl.js} +1 -1
- package/dist/components/{p-BRKeMTWI.js → p-Fwb7LRwv.js} +1 -1
- package/dist/components/{p-iORPryb0.js → p-PMD-Col0.js} +1 -1
- package/dist/components/{p-BUB0CcPo.js → p-PXhjh7pH.js} +1 -1
- package/dist/components/{p-DDahT3Mp.js → p-Ycs3I9cT.js} +1 -1
- package/dist/components/{p-BDm6daTX.js → p-fzFFhJlr.js} +1 -1
- package/dist/components/{p-C9rjLN0u.js → p-h9_f4fUW.js} +1 -1
- package/dist/components/{p-CZpcFpSk.js → p-qbClgrdG.js} +1 -1
- package/dist/components/sd-action-modal.js +1 -1
- package/dist/components/sd-badge.js +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-calendar.js +1 -1
- package/dist/components/sd-callout.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-chip-input.js +1 -1
- package/dist/components/sd-chip.js +1 -1
- package/dist/components/sd-circle-progress.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-picker-trigger.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker-calendar.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-divider.js +1 -1
- package/dist/components/sd-dropdown-button.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-file-picker.js +1 -1
- package/dist/components/sd-floating-portal.js +1 -1
- package/dist/components/sd-ghost-button.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-key-value-table.js +1 -1
- package/dist/components/sd-linear-progress.js +1 -1
- package/dist/components/sd-loading-container.js +1 -1
- package/dist/components/sd-loading-modal.js +1 -1
- package/dist/components/sd-modal-container.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/sd-popup.js +1 -1
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-radio-button.js +1 -1
- package/dist/components/sd-radio-group.js +1 -1
- package/dist/components/sd-radio.js +1 -1
- package/dist/components/sd-select-list-item-search.js +1 -1
- package/dist/components/sd-select-list-item.js +1 -1
- package/dist/components/sd-select-listbox.js +1 -1
- package/dist/components/sd-select-trigger.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-switch.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tabs.js +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +1 -1
- package/dist/components/sd-text-link.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.js +1 -1
- package/dist/components/sd-toast-container.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/p-0d5d2723.entry.js +1 -0
- package/dist/design-system/{p-1e9793d6.entry.js → p-210123b1.entry.js} +1 -1
- package/dist/design-system/{p-578683b5.entry.js → p-21d8f192.entry.js} +1 -1
- package/dist/design-system/p-2fb9a5e6.entry.js +1 -0
- package/dist/design-system/{p-b29569d7.entry.js → p-3b71d1d4.entry.js} +1 -1
- package/dist/design-system/{p-64d63a3f.entry.js → p-43d521c4.entry.js} +1 -1
- package/dist/design-system/{p-45651573.entry.js → p-5a67c40d.entry.js} +1 -1
- package/dist/design-system/{p-86e54f19.entry.js → p-5b184e17.entry.js} +1 -1
- package/dist/design-system/{p-43316703.entry.js → p-6b20c76b.entry.js} +1 -1
- package/dist/design-system/{p-e897484c.entry.js → p-6f77fc76.entry.js} +1 -1
- package/dist/design-system/{p-586602a8.entry.js → p-74e605c0.entry.js} +1 -1
- package/dist/design-system/{p-b2ef677a.entry.js → p-8001447c.entry.js} +1 -1
- package/dist/design-system/{p-f280e59d.entry.js → p-8862e3e3.entry.js} +1 -1
- package/dist/design-system/{p-93f876ce.entry.js → p-90a360ca.entry.js} +1 -1
- package/dist/design-system/{p-1e1a5c69.entry.js → p-9afc1f7c.entry.js} +1 -1
- package/dist/design-system/{p-6cd3da51.entry.js → p-9b53de38.entry.js} +1 -1
- package/dist/design-system/{p-a5fe8b9a.entry.js → p-9ea2fbec.entry.js} +1 -1
- package/dist/design-system/{p-d10efe7e.entry.js → p-a1438f7d.entry.js} +1 -1
- package/dist/design-system/{p-956956af.entry.js → p-a49cf337.entry.js} +1 -1
- package/dist/design-system/{p-e018fdb1.entry.js → p-a505459f.entry.js} +1 -1
- package/dist/design-system/{p-df5e8dba.entry.js → p-a8d69ab2.entry.js} +1 -1
- package/dist/design-system/{p-e94bd6d7.entry.js → p-b4df75b9.entry.js} +1 -1
- package/dist/design-system/p-ba5bb1ee.entry.js +1 -0
- package/dist/design-system/{p-8101c564.entry.js → p-c7ff7bc8.entry.js} +1 -1
- package/dist/design-system/{p-b7e80770.entry.js → p-c8e86fb4.entry.js} +1 -1
- package/dist/design-system/{p-496d3684.entry.js → p-cb63d4cf.entry.js} +1 -1
- package/dist/design-system/p-d4097b87.entry.js +1 -0
- package/dist/design-system/{p-60f3ce4f.entry.js → p-d6329729.entry.js} +1 -1
- package/dist/design-system/{p-9b7d3077.entry.js → p-e77fe58a.entry.js} +1 -1
- package/dist/design-system/{p-43c79402.entry.js → p-f1e0ba30.entry.js} +1 -1
- package/dist/design-system/{p-3c4b57b5.entry.js → p-f418055d.entry.js} +1 -1
- package/dist/design-system/{p-c4c81918.entry.js → p-f9c0013c.entry.js} +1 -1
- package/dist/design-system/{p-a42bcc11.entry.js → p-fb609583.entry.js} +1 -1
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sd-action-modal.entry.js +1 -1
- package/dist/esm/sd-badge.entry.js +1 -1
- package/dist/esm/sd-barcode-input.entry.js +1 -1
- package/dist/esm/sd-calendar_2.entry.js +5 -5
- package/dist/esm/sd-callout.entry.js +1 -1
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-chip-input.entry.js +4 -4
- package/dist/esm/sd-chip.entry.js +1 -1
- package/dist/esm/sd-circle-progress.entry.js +1 -1
- package/dist/esm/sd-confirm-modal_2.entry.js +3 -3
- package/dist/esm/sd-date-picker_7.entry.js +10 -10
- package/dist/esm/sd-date-range-picker-calendar.entry.js +1 -1
- package/dist/esm/sd-divider.entry.js +1 -1
- package/dist/esm/sd-dropdown-button.entry.js +1 -1
- package/dist/esm/sd-field_3.entry.js +8 -8
- package/dist/esm/sd-ghost-button_3.entry.js +20 -12
- package/dist/esm/sd-linear-progress.entry.js +1 -1
- package/dist/esm/sd-loading-container.entry.js +2 -2
- package/dist/esm/sd-pagination_4.entry.js +8 -8
- package/dist/esm/sd-popover.entry.js +3 -3
- package/dist/esm/sd-popup.entry.js +1 -1
- package/dist/esm/sd-radio-button.entry.js +1 -1
- package/dist/esm/sd-radio.entry.js +1 -1
- package/dist/esm/sd-select-list-item_2.entry.js +6 -6
- package/dist/esm/sd-select_3.entry.js +8 -8
- package/dist/esm/sd-switch.entry.js +1 -1
- package/dist/esm/sd-table.entry.js +6 -6
- package/dist/esm/sd-tabs.entry.js +1 -1
- package/dist/esm/sd-td.entry.js +1 -1
- package/dist/esm/sd-text-link.entry.js +23 -5
- package/dist/esm/sd-toast-container.entry.js +1 -1
- package/dist/esm/sd-toast.entry.js +2 -2
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/types/components/sd-text-link/sd-text-link.d.ts +8 -0
- package/dist/types/components.d.ts +9 -0
- package/hydrate/index.js +129 -101
- package/hydrate/index.mjs +129 -101
- package/package.json +1 -1
- package/dist/components/p-BdFwmTyS.js +0 -1
- package/dist/components/p-BeKMwT89.js +0 -1
- package/dist/components/p-ChwRSZ6R.js +0 -1
- package/dist/components/p-Dn93jl-w.js +0 -1
- package/dist/design-system/p-7233ffb7.entry.js +0 -1
- package/dist/design-system/p-829b7e4f.entry.js +0 -1
- package/dist/design-system/p-b1f4e1e5.entry.js +0 -1
- package/dist/design-system/p-ccbf8687.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as e,h as d,t as i}from"./p-CEVDmQdt.js";import{s as o}from"./p-BJfiMC9H.js";import{s as n}from"./p-BE4tnQ2Z.js";import{d as s}from"./p-C3rOud8J.js";import{d as u}from"./p-BdFwmTyS.js";import{d as g}from"./p-BnhzUsGP.js";import{d as a}from"./p-ChwRSZ6R.js";import{d as r}from"./p-CGJ1L8_Y.js";const{button:p,contents:b}={button:{height:"28",paddingX:"12",radius:"9999",gap:"6",typography:{fontSize:"12",fontWeight:"500",lineHeight:"20"},icon:{default:"#00973C",active:"#FFFFFF"},border:{width:"1",default:"#E1E1E1"},bg:{default:"#FFFFFF",tip:"#00973C",notion:"#1F8AE1"},text:{default:"#222222",active:"#FFFFFF"}},contents:{paddingX:"24",paddingY:"20",gap:"12",title:{gap:"8"},row:{gap:"8"},body:{gap:"2"},typography:{title:{fontWeight:"700",fontSize:"16",lineHeight:"26"},body:{fontWeight:"400",fontSize:"12",lineHeight:"20"},color:"#222222"},icon:"#00973C",radius:"8"}},c=o.color.fg.primary,l={button:{height:p.height+"px",paddingX:p.paddingX+"px",radius:p.radius+"px",gap:p.gap+"px",fontSize:p.typography.fontSize+"px",fontWeight:p.typography.fontWeight,lineHeight:p.typography.lineHeight+"px",iconColorDefault:p.icon.default,iconColorActive:p.icon.active,iconColorNotion:c,borderWidth:p.border.width+"px",borderColor:p.border.default,bgDefault:p.bg.default,bgTip:p.bg.tip,bgNotion:p.bg.notion,textDefault:p.text.default,textActive:p.text.active},contents:{paddingX:b.paddingX+"px",paddingY:b.paddingY+"px",gap:b.gap+"px",rowGap:b.row.gap+"px",bodyGap:b.body.gap+"px",titleGap:b.title.gap+"px",radius:b.radius+"px",iconColor:b.icon,iconColorNotion:c,titleFontSize:b.typography.title.fontSize+"px",titleFontWeight:b.typography.title.fontWeight,titleLineHeight:b.typography.title.lineHeight+"px",bodyFontSize:b.typography.body.fontSize+"px",bodyFontWeight:b.typography.body.fontWeight,bodyLineHeight:b.typography.body.lineHeight+"px",textColor:b.typography.color}},_={tip:"활용 TIP",notion:"사용법 안내"},h={tip:"helpOutline",notion:"notion"},f=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}type="tip";label="";message="";url="";popupTitle="";popupWidth;popupShow=!1;guideRef;handleClickGuide=()=>{"notion"!==this.type?this.popupShow=!this.popupShow:""!==this.url&&window.open(this.url,"_blank","noopener,noreferrer")};closeDropdown=()=>{this.popupShow=!1};get guideStyle(){const{button:t,contents:e}=l;return{"--sd-guide-button-height":t.height,"--sd-guide-button-padding-x":t.paddingX,"--sd-guide-button-radius":t.radius,"--sd-guide-button-gap":t.gap,"--sd-guide-button-font-size":t.fontSize,"--sd-guide-button-font-weight":t.fontWeight,"--sd-guide-button-line-height":t.lineHeight,"--sd-guide-button-border-width":t.borderWidth,"--sd-guide-button-border-color":t.borderColor,"--sd-guide-button-bg-default":t.bgDefault,"--sd-guide-button-bg-tip":t.bgTip,"--sd-guide-button-bg-notion":t.bgNotion,"--sd-guide-button-text-default":t.textDefault,"--sd-guide-button-text-active":t.textActive,"--sd-guide-button-icon-color-default":t.iconColorDefault,"--sd-guide-button-icon-color-active":t.iconColorActive,"--sd-guide-button-icon-color-notion":t.iconColorNotion,"--sd-guide-contents-padding-x":e.paddingX,"--sd-guide-contents-padding-y":e.paddingY,"--sd-guide-contents-gap":e.gap,"--sd-guide-contents-row-gap":e.rowGap,"--sd-guide-contents-body-gap":e.bodyGap,"--sd-guide-contents-title-gap":e.titleGap,"--sd-guide-contents-radius":e.radius,"--sd-guide-contents-title-font-size":e.titleFontSize,"--sd-guide-contents-title-font-weight":e.titleFontWeight,"--sd-guide-contents-title-line-height":e.titleLineHeight,"--sd-guide-contents-body-font-size":e.bodyFontSize,"--sd-guide-contents-body-font-weight":e.bodyFontWeight,"--sd-guide-contents-body-line-height":e.bodyLineHeight,"--sd-guide-contents-text-color":e.textColor}}render(){const{contents:t}=l,e=this.popupShow,i=_[this.type??"tip"],o=h[this.type??"tip"],n="notion"===(this.type??"tip")?t.iconColorNotion:t.iconColor,s=["sd-guide__button","sd-guide__button--type-"+(this.type??"tip")];return e&&s.push("sd-guide__button--active"),d("div",{key:"d89a517d78a8f9624c94d320291e5a4b5bd0715d",class:"sd-guide",style:this.guideStyle},d("sd-button",{key:"6e959f0f5fd6f816fd1cef4545852b860d30de85",ref:t=>this.guideRef=t,class:s.join(" "),name:e?"primary_sm":"neutral_outline_sm",label:this.label||i,icon:o,onSdClick:this.handleClickGuide}),this.popupShow&&d("sd-portal",{key:"a837cababa5504400293729ad28e4dcd2450eeec",open:this.popupShow,parentRef:this.guideRef,onSdClose:this.closeDropdown,offset:[0,4]},d("div",{key:"61dd3c574495f85021495d80865e162999368f9c",class:"sd-guide__popup",style:{...this.guideStyle,width:null!=this.popupWidth?this.popupWidth+"px":"426px"}},d("sd-ghost-button",{key:"dbf8aebd1be4b5286bf726d22e0a5f80c29e867f",class:"sd-guide__popup__close",icon:"close",ariaLabel:"close",size:"sm",onSdClick:this.closeDropdown}),d("div",{key:"5a08fa823bb8839e654d7bb2ba027df2dc68b85b",class:"sd-guide__popup__header"},d("sd-icon",{key:"1dda43d100b4f5f3b7fa81115a1ac4bfbd584a51",name:o,size:24,color:n}),d("h3",{key:"cfe6342f44f4e1355397ed94d6db74807f917548",class:"sd-guide__popup__title"},this.popupTitle||i)),d("ul",{key:"9acc2f507ed3d3d6f1fda27a9e5cf66dcc2f619d",class:"sd-guide__popup__list"},this.renderListItem(this.message)))))}renderListItem(t,e=0){const d=[];if(Array.isArray(t)){const i=t.map((t=>this.renderListItem(t,e+1)));d.push(...i.flat())}else d.push(this.renderLi(t,e));return d}renderLi=(t,e)=>d("li",{class:"sd-guide__popup__list__item sd-guide__popup__list__item--depth-"+e},d("p",{innerHTML:n(t)}));static get style(){return'@charset "UTF-8";sd-guide{display:inline-flex;align-items:center;height:fit-content;width:fit-content}.sd-guide{display:inline-flex;align-items:center;height:fit-content;width:fit-content}.sd-guide .sd-guide__button .sd-button{min-height:var(--sd-guide-button-height);padding:0 var(--sd-guide-button-padding-x);border-radius:var(--sd-guide-button-radius);border:var(--sd-guide-button-border-width) solid var(--sd-guide-button-border-color);background:var(--sd-guide-button-bg-default);color:var(--sd-guide-button-text-default) !important;transition:none;display:flex;align-items:center;gap:var(--sd-guide-button-gap);--sd-button-bg-hover:var(--sd-guide-button-bg-default);--sd-button-current-icon:var(--sd-guide-button-icon-color-default)}.sd-guide .sd-guide__button .sd-button .sd-button__content{color:var(--sd-guide-button-text-default) !important;gap:var(--sd-guide-button-gap)}.sd-guide .sd-guide__button .sd-button .sd-button__content .sd-button__label{margin-left:0;color:var(--sd-guide-button-text-default) !important;font-size:var(--sd-guide-button-font-size);font-weight:var(--sd-guide-button-font-weight);line-height:var(--sd-guide-button-line-height)}.sd-guide .sd-guide__button--type-notion .sd-button{--sd-button-current-icon:var(--sd-guide-button-icon-color-notion)}.sd-guide .sd-guide__button--active .sd-button{color:var(--sd-guide-button-text-active) !important;--sd-button-current-icon:var(--sd-guide-button-icon-color-active)}.sd-guide .sd-guide__button--active .sd-button .sd-button__content{color:var(--sd-guide-button-text-active) !important}.sd-guide .sd-guide__button--active .sd-button .sd-button__content .sd-button__label{color:var(--sd-guide-button-text-active) !important}.sd-guide .sd-guide__button--type-tip.sd-guide__button--active .sd-button{background:var(--sd-guide-button-bg-tip);border-color:var(--sd-guide-button-bg-tip);--sd-button-bg-hover:var(--sd-guide-button-bg-tip)}.sd-guide .sd-guide__button--type-notion.sd-guide__button--active .sd-button{background:var(--sd-guide-button-bg-notion);border-color:var(--sd-guide-button-bg-notion);--sd-button-bg-hover:var(--sd-guide-button-bg-notion)}.sd-guide__popup{position:relative;padding:var(--sd-guide-contents-padding-y) var(--sd-guide-contents-padding-x);border-radius:var(--sd-guide-contents-radius);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.1);background:white}.sd-guide__popup>.sd-guide__popup__close{position:absolute;top:12px;right:12px}.sd-guide__popup__header{display:flex;align-items:center;gap:var(--sd-guide-contents-title-gap);margin-bottom:var(--sd-guide-contents-gap)}.sd-guide__popup__header .sd-guide__popup__title{margin-top:0;margin-bottom:0;font-size:var(--sd-guide-contents-title-font-size);font-weight:var(--sd-guide-contents-title-font-weight);line-height:var(--sd-guide-contents-title-line-height);color:var(--sd-guide-contents-text-color)}.sd-guide__popup__list{width:100%;padding:0;margin:0}.sd-guide__popup__list__item{display:flex;width:100%;align-items:start;list-style:none;color:var(--sd-guide-contents-text-color);font-size:var(--sd-guide-contents-body-font-size);font-weight:var(--sd-guide-contents-body-font-weight);line-height:var(--sd-guide-contents-body-line-height)}.sd-guide__popup__list__item p{width:100%;padding:0;margin:0;word-wrap:break-word;word-break:break-word;white-space:normal;overflow-wrap:break-word;min-width:0}.sd-guide__popup__list__item::before{display:block;content:"-";width:6px;color:var(--sd-guide-contents-text-color);font-size:var(--sd-guide-contents-body-font-size);font-weight:var(--sd-guide-contents-body-font-weight);line-height:var(--sd-guide-contents-body-line-height);margin-left:10px;margin-right:12px;flex-shrink:0}.sd-guide__popup__list__item--depth-1:not(:first-child){margin-top:var(--sd-guide-contents-row-gap)}.sd-guide__popup__list__item--depth-2{margin-top:var(--sd-guide-contents-body-gap)}.sd-guide__popup__list__item--depth-2::before{content:"•"}.sd-guide__popup__list__item--depth-2{padding-left:26px}'}},[512,"sd-guide",{type:[513],label:[513],message:[1],url:[1],popupTitle:[1,"popup-title"],popupWidth:[2,"popup-width"],popupShow:[32]}]),m=f,v=function(){"undefined"!=typeof customElements&&["sd-guide","sd-button","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-guide":customElements.get(i(t))||customElements.define(i(t),f);break;case"sd-button":customElements.get(i(t))||s();break;case"sd-ghost-button":customElements.get(i(t))||u();break;case"sd-icon":customElements.get(i(t))||g();break;case"sd-portal":customElements.get(i(t))||a();break;case"sd-tag":customElements.get(i(t))||r()}}))};export{m as SdGuide,v as defineCustomElement}
|
|
1
|
+
import{p as t,H as e,h as d,t as i}from"./p-CEVDmQdt.js";import{s as o}from"./p-BJfiMC9H.js";import{s as n}from"./p-BE4tnQ2Z.js";import{d as s}from"./p-C3rOud8J.js";import{d as u}from"./p-C4_oeGm-.js";import{d as g}from"./p-BnhzUsGP.js";import{d as a}from"./p-D_SxeDkS.js";import{d as r}from"./p-D8T1XeGP.js";const{button:p,contents:b}={button:{height:"28",paddingX:"12",radius:"9999",gap:"6",typography:{fontSize:"12",fontWeight:"500",lineHeight:"20"},icon:{default:"#00973C",active:"#FFFFFF"},border:{width:"1",default:"#E1E1E1"},bg:{default:"#FFFFFF",tip:"#00973C",notion:"#1F8AE1"},text:{default:"#222222",active:"#FFFFFF"}},contents:{paddingX:"24",paddingY:"20",gap:"12",title:{gap:"8"},row:{gap:"8"},body:{gap:"2"},typography:{title:{fontWeight:"700",fontSize:"16",lineHeight:"26"},body:{fontWeight:"400",fontSize:"12",lineHeight:"20"},color:"#222222"},icon:"#00973C",radius:"8"}},c=o.color.fg.primary,l={button:{height:p.height+"px",paddingX:p.paddingX+"px",radius:p.radius+"px",gap:p.gap+"px",fontSize:p.typography.fontSize+"px",fontWeight:p.typography.fontWeight,lineHeight:p.typography.lineHeight+"px",iconColorDefault:p.icon.default,iconColorActive:p.icon.active,iconColorNotion:c,borderWidth:p.border.width+"px",borderColor:p.border.default,bgDefault:p.bg.default,bgTip:p.bg.tip,bgNotion:p.bg.notion,textDefault:p.text.default,textActive:p.text.active},contents:{paddingX:b.paddingX+"px",paddingY:b.paddingY+"px",gap:b.gap+"px",rowGap:b.row.gap+"px",bodyGap:b.body.gap+"px",titleGap:b.title.gap+"px",radius:b.radius+"px",iconColor:b.icon,iconColorNotion:c,titleFontSize:b.typography.title.fontSize+"px",titleFontWeight:b.typography.title.fontWeight,titleLineHeight:b.typography.title.lineHeight+"px",bodyFontSize:b.typography.body.fontSize+"px",bodyFontWeight:b.typography.body.fontWeight,bodyLineHeight:b.typography.body.lineHeight+"px",textColor:b.typography.color}},_={tip:"활용 TIP",notion:"사용법 안내"},h={tip:"helpOutline",notion:"notion"},f=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}type="tip";label="";message="";url="";popupTitle="";popupWidth;popupShow=!1;guideRef;handleClickGuide=()=>{"notion"!==this.type?this.popupShow=!this.popupShow:""!==this.url&&window.open(this.url,"_blank","noopener,noreferrer")};closeDropdown=()=>{this.popupShow=!1};get guideStyle(){const{button:t,contents:e}=l;return{"--sd-guide-button-height":t.height,"--sd-guide-button-padding-x":t.paddingX,"--sd-guide-button-radius":t.radius,"--sd-guide-button-gap":t.gap,"--sd-guide-button-font-size":t.fontSize,"--sd-guide-button-font-weight":t.fontWeight,"--sd-guide-button-line-height":t.lineHeight,"--sd-guide-button-border-width":t.borderWidth,"--sd-guide-button-border-color":t.borderColor,"--sd-guide-button-bg-default":t.bgDefault,"--sd-guide-button-bg-tip":t.bgTip,"--sd-guide-button-bg-notion":t.bgNotion,"--sd-guide-button-text-default":t.textDefault,"--sd-guide-button-text-active":t.textActive,"--sd-guide-button-icon-color-default":t.iconColorDefault,"--sd-guide-button-icon-color-active":t.iconColorActive,"--sd-guide-button-icon-color-notion":t.iconColorNotion,"--sd-guide-contents-padding-x":e.paddingX,"--sd-guide-contents-padding-y":e.paddingY,"--sd-guide-contents-gap":e.gap,"--sd-guide-contents-row-gap":e.rowGap,"--sd-guide-contents-body-gap":e.bodyGap,"--sd-guide-contents-title-gap":e.titleGap,"--sd-guide-contents-radius":e.radius,"--sd-guide-contents-title-font-size":e.titleFontSize,"--sd-guide-contents-title-font-weight":e.titleFontWeight,"--sd-guide-contents-title-line-height":e.titleLineHeight,"--sd-guide-contents-body-font-size":e.bodyFontSize,"--sd-guide-contents-body-font-weight":e.bodyFontWeight,"--sd-guide-contents-body-line-height":e.bodyLineHeight,"--sd-guide-contents-text-color":e.textColor}}render(){const{contents:t}=l,e=this.popupShow,i=_[this.type??"tip"],o=h[this.type??"tip"],n="notion"===(this.type??"tip")?t.iconColorNotion:t.iconColor,s=["sd-guide__button","sd-guide__button--type-"+(this.type??"tip")];return e&&s.push("sd-guide__button--active"),d("div",{key:"d89a517d78a8f9624c94d320291e5a4b5bd0715d",class:"sd-guide",style:this.guideStyle},d("sd-button",{key:"6e959f0f5fd6f816fd1cef4545852b860d30de85",ref:t=>this.guideRef=t,class:s.join(" "),name:e?"primary_sm":"neutral_outline_sm",label:this.label||i,icon:o,onSdClick:this.handleClickGuide}),this.popupShow&&d("sd-portal",{key:"a837cababa5504400293729ad28e4dcd2450eeec",open:this.popupShow,parentRef:this.guideRef,onSdClose:this.closeDropdown,offset:[0,4]},d("div",{key:"61dd3c574495f85021495d80865e162999368f9c",class:"sd-guide__popup",style:{...this.guideStyle,width:null!=this.popupWidth?this.popupWidth+"px":"426px"}},d("sd-ghost-button",{key:"dbf8aebd1be4b5286bf726d22e0a5f80c29e867f",class:"sd-guide__popup__close",icon:"close",ariaLabel:"close",size:"sm",onSdClick:this.closeDropdown}),d("div",{key:"5a08fa823bb8839e654d7bb2ba027df2dc68b85b",class:"sd-guide__popup__header"},d("sd-icon",{key:"1dda43d100b4f5f3b7fa81115a1ac4bfbd584a51",name:o,size:24,color:n}),d("h3",{key:"cfe6342f44f4e1355397ed94d6db74807f917548",class:"sd-guide__popup__title"},this.popupTitle||i)),d("ul",{key:"9acc2f507ed3d3d6f1fda27a9e5cf66dcc2f619d",class:"sd-guide__popup__list"},this.renderListItem(this.message)))))}renderListItem(t,e=0){const d=[];if(Array.isArray(t)){const i=t.map((t=>this.renderListItem(t,e+1)));d.push(...i.flat())}else d.push(this.renderLi(t,e));return d}renderLi=(t,e)=>d("li",{class:"sd-guide__popup__list__item sd-guide__popup__list__item--depth-"+e},d("p",{innerHTML:n(t)}));static get style(){return'@charset "UTF-8";sd-guide{display:inline-flex;align-items:center;height:fit-content;width:fit-content}.sd-guide{display:inline-flex;align-items:center;height:fit-content;width:fit-content}.sd-guide .sd-guide__button .sd-button{min-height:var(--sd-guide-button-height);padding:0 var(--sd-guide-button-padding-x);border-radius:var(--sd-guide-button-radius);border:var(--sd-guide-button-border-width) solid var(--sd-guide-button-border-color);background:var(--sd-guide-button-bg-default);color:var(--sd-guide-button-text-default) !important;transition:none;display:flex;align-items:center;gap:var(--sd-guide-button-gap);--sd-button-bg-hover:var(--sd-guide-button-bg-default);--sd-button-current-icon:var(--sd-guide-button-icon-color-default)}.sd-guide .sd-guide__button .sd-button .sd-button__content{color:var(--sd-guide-button-text-default) !important;gap:var(--sd-guide-button-gap)}.sd-guide .sd-guide__button .sd-button .sd-button__content .sd-button__label{margin-left:0;color:var(--sd-guide-button-text-default) !important;font-size:var(--sd-guide-button-font-size);font-weight:var(--sd-guide-button-font-weight);line-height:var(--sd-guide-button-line-height)}.sd-guide .sd-guide__button--type-notion .sd-button{--sd-button-current-icon:var(--sd-guide-button-icon-color-notion)}.sd-guide .sd-guide__button--active .sd-button{color:var(--sd-guide-button-text-active) !important;--sd-button-current-icon:var(--sd-guide-button-icon-color-active)}.sd-guide .sd-guide__button--active .sd-button .sd-button__content{color:var(--sd-guide-button-text-active) !important}.sd-guide .sd-guide__button--active .sd-button .sd-button__content .sd-button__label{color:var(--sd-guide-button-text-active) !important}.sd-guide .sd-guide__button--type-tip.sd-guide__button--active .sd-button{background:var(--sd-guide-button-bg-tip);border-color:var(--sd-guide-button-bg-tip);--sd-button-bg-hover:var(--sd-guide-button-bg-tip)}.sd-guide .sd-guide__button--type-notion.sd-guide__button--active .sd-button{background:var(--sd-guide-button-bg-notion);border-color:var(--sd-guide-button-bg-notion);--sd-button-bg-hover:var(--sd-guide-button-bg-notion)}.sd-guide__popup{position:relative;padding:var(--sd-guide-contents-padding-y) var(--sd-guide-contents-padding-x);border-radius:var(--sd-guide-contents-radius);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.1);background:white}.sd-guide__popup>.sd-guide__popup__close{position:absolute;top:12px;right:12px}.sd-guide__popup__header{display:flex;align-items:center;gap:var(--sd-guide-contents-title-gap);margin-bottom:var(--sd-guide-contents-gap)}.sd-guide__popup__header .sd-guide__popup__title{margin-top:0;margin-bottom:0;font-size:var(--sd-guide-contents-title-font-size);font-weight:var(--sd-guide-contents-title-font-weight);line-height:var(--sd-guide-contents-title-line-height);color:var(--sd-guide-contents-text-color)}.sd-guide__popup__list{width:100%;padding:0;margin:0}.sd-guide__popup__list__item{display:flex;width:100%;align-items:start;list-style:none;color:var(--sd-guide-contents-text-color);font-size:var(--sd-guide-contents-body-font-size);font-weight:var(--sd-guide-contents-body-font-weight);line-height:var(--sd-guide-contents-body-line-height)}.sd-guide__popup__list__item p{width:100%;padding:0;margin:0;word-wrap:break-word;word-break:break-word;white-space:normal;overflow-wrap:break-word;min-width:0}.sd-guide__popup__list__item::before{display:block;content:"-";width:6px;color:var(--sd-guide-contents-text-color);font-size:var(--sd-guide-contents-body-font-size);font-weight:var(--sd-guide-contents-body-font-weight);line-height:var(--sd-guide-contents-body-line-height);margin-left:10px;margin-right:12px;flex-shrink:0}.sd-guide__popup__list__item--depth-1:not(:first-child){margin-top:var(--sd-guide-contents-row-gap)}.sd-guide__popup__list__item--depth-2{margin-top:var(--sd-guide-contents-body-gap)}.sd-guide__popup__list__item--depth-2::before{content:"•"}.sd-guide__popup__list__item--depth-2{padding-left:26px}'}},[512,"sd-guide",{type:[513],label:[513],message:[1],url:[1],popupTitle:[1,"popup-title"],popupWidth:[2,"popup-width"],popupShow:[32]}]),m=f,v=function(){"undefined"!=typeof customElements&&["sd-guide","sd-button","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-guide":customElements.get(i(t))||customElements.define(i(t),f);break;case"sd-button":customElements.get(i(t))||s();break;case"sd-ghost-button":customElements.get(i(t))||u();break;case"sd-icon":customElements.get(i(t))||g();break;case"sd-portal":customElements.get(i(t))||a();break;case"sd-tag":customElements.get(i(t))||r()}}))};export{m as SdGuide,v as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as
|
|
1
|
+
import{S as o,d as p}from"./p-PXhjh7pH.js";const s=o,r=p;export{s as SdInput,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as t,c as s,h as a,t as d}from"./p-CEVDmQdt.js";import{s as l}from"./p-BJfiMC9H.js";import{t as r}from"./p-D6GUzecR.js";import{d as i}from"./p-C3rOud8J.js";import{d as o}from"./p-BLsuwMw4.js";import{d as n}from"./p-D3dq5pt5.js";import{d as u}from"./p-DDahT3Mp.js";import{d as c}from"./p-ClBvavih.js";import{d as p}from"./p-C9rjLN0u.js";import{d as b}from"./p-lL2VxD2V.js";import{d as k}from"./p-kDokArZu.js";import{d as v}from"./p-BFMUpKa2.js";import{d as m}from"./p-C2cNc56z.js";import{d as h}from"./p-BJMpxQSk.js";import{d as y}from"./p-BdFwmTyS.js";import{d as f}from"./p-BnhzUsGP.js";import{d as g}from"./p-BUB0CcPo.js";import{d as _}from"./p-DnHzWLdY.js";import{d as w}from"./p-ChwRSZ6R.js";import{d as x}from"./p-Dj1iJxUT.js";import{d as j}from"./p-2-7UYvqL.js";import{d as E}from"./p-BDm6daTX.js";import{d as S}from"./p-BwgUEhOa.js";import{d as N}from"./p-DfKZyde8.js";import{d as z}from"./p-IMWw_SJ1.js";import{d as B}from"./p-iORPryb0.js";import{d as T}from"./p-CGJ1L8_Y.js";import{d as U}from"./p-BYgT6mRD.js";import{d as C}from"./p-CpBPNHYe.js";const D=r.table,F=Number(D.keyValue.height),L=Number(D.radius),q=Number(D.header.paddingX),M=Number(D.keyValue.body.padding),H=Number(D.header.gap),J=Number(D.content.gap),R=Number(D.border.width),Y=Number(D.keyValue.search.paddingX),$={border:D.border.color,thBg:D.header.bg,thLabel:l.color.fg.primary,required:l.color.fg.accent,helpIcon:l.color.fg.success,tdBg:l.color.bg.frame,tdText:l.color.fg.primary,searchBg:D.keyValue.search.bg},A={labelFontFamily:D.header.typography.fontFamily,labelFontSize:Number(D.header.typography.fontSize),labelFontWeight:700,labelLineHeight:Number(D.header.typography.lineHeight),tdFontFamily:D.body.typography.fontFamily,tdFontSize:Number(D.body.typography.fontSize),tdFontWeight:Number(D.body.typography.fontWeight),tdLineHeight:Number(D.body.typography.lineHeight)},O=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.change=s(this,"sdChange",7),this.searchEvent=s(this,"sdSearch",7)}fields=[];search=!1;radius="default";change;searchEvent;emit=(e,t)=>{this.change.emit({name:e,value:t})};handleSearchClick=()=>{this.searchEvent.emit()};renderField(e){const t=t=>this.emit(e.name,t.detail);switch(e.type){case"input":return a("sd-input",{width:"100%",...e.options??{},onSdUpdate:t});case"textarea":return a("sd-textarea",{width:"100%",...e.options??{},onSdUpdate:t});case"number-input":return a("sd-number-input",{width:"100%",...e.options??{},onSdUpdate:t});case"select":return a("sd-select",{width:"100%",...e.options??{},onSdUpdate:t});case"radio":{const{value:s,direction:d,...l}=e.options??{};return a("sd-radio-group",{...l,value:s,direction:d??"horizontal",onSdUpdate:t})}case"checkbox":{const{value:s,...d}=e.options??{};return a("sd-checkbox",{...d,value:s,onSdUpdate:t})}case"date-picker":return a("sd-date-picker",{width:"100%",...e.options??{},onSdUpdate:t});case"date-range-picker":return a("sd-date-range-picker",{width:"100%",...e.options??{},onSdUpdate:t});case"file-picker":return a("sd-file-picker",{width:"100%",...e.options??{},onSdUpdate:t});default:return a("span",{class:"sd-key-value-table__text"},e.options?.value??"")}}renderHelpIcon(e){return a("span",{class:"sd-key-value-table__help"},a("sd-tooltip",{icon:"helpOutline",iconSize:16,color:$.helpIcon,trigger:"hover"},e))}computeAutoSkipTh(){const e=this.fields.map((e=>e.map((()=>!1))));return this.fields.forEach(((t,s)=>{t.forEach(((t,a)=>{const d=null!=t.thRowSpan&&t.thRowSpan>1?t.thRowSpan:1;if(!(d<=1))for(let t=1;t<d;t++){const d=e[s+t];d&&a<d.length&&(d[a]=!0)}}))})),e}computeMaxCols(e){let t=0;return this.fields.forEach(((s,a)=>{let d=0;s.forEach(((t,s)=>{let l;l=t.hideTh?0:e[a]?.[s]?1:null!=t.thColSpan&&t.thColSpan>1?t.thColSpan:1,d+=l+(null!=t.tdColSpan&&t.tdColSpan>1?t.tdColSpan:1)})),d>t&&(t=d)})),t}buildThStyle(e){const t={...e};return null!=e.color&&(t["--sd-kvt-th-color"]=e.color),null!=e.background&&(t["--sd-kvt-th-bg"]=e.background),null!=e.backgroundColor&&(t["--sd-kvt-th-bg"]=e.backgroundColor),null!=e.fontFamily&&(t["--sd-kvt-label-font-family"]=e.fontFamily),null!=e.fontSize&&(t["--sd-kvt-label-font-size"]=e.fontSize),null!=e.fontWeight&&(t["--sd-kvt-label-font-weight"]=e.fontWeight),null!=e.lineHeight&&(t["--sd-kvt-label-line-height"]=e.lineHeight),t}renderTh(e,t,s){const d=null!=e.thRowSpan&&e.thRowSpan>1?e.thRowSpan:void 0,l=null!=e.thColSpan&&e.thColSpan>1?e.thColSpan:void 0,r={"sd-key-value-table__th":!0};"string"==typeof e.thClass?r[e.thClass]=!0:Array.isArray(e.thClass)&&e.thClass.forEach((e=>r[e]=!0));const i=null!=e.thStyle?this.buildThStyle(e.thStyle):void 0;return a("th",{key:`th-${t}-${s}`,class:r,style:i,scope:"row",rowSpan:d,colSpan:l},a("div",{class:"sd-key-value-table__th-inner"},a("span",{class:"sd-key-value-table__label"},e.label,e.required&&a("sd-icon",{class:"sd-key-value-table__required",name:"star",size:12,color:$.required,label:"required"})),e.helpText&&this.renderHelpIcon(e.helpText)))}renderTd(e,t,s){return a("td",{key:`td-${t}-${s}`,class:"sd-key-value-table__td",rowSpan:null!=e.tdRowSpan&&e.tdRowSpan>1?e.tdRowSpan:void 0,colSpan:null!=e.tdColSpan&&e.tdColSpan>1?e.tdColSpan:void 0},a("div",{class:"sd-key-value-table__td-inner"},a("slot",{name:"field-"+e.name},this.renderField(e))))}warnDuplicateNames(){const e=new Set,t=new Set;this.fields.forEach((s=>s.forEach((s=>{e.has(s.name)?t.add(s.name):e.add(s.name)})))),t.size>0&&console.warn(`[sd-key-value-table] Duplicate field name(s) detected: ${[...t].join(", ")}. Slot names ("field-{name}") and sdChange events rely on unique names.`)}render(){if(0===this.fields.length)return null;const e={"--sd-kvt-row-height":F+"px","--sd-kvt-th-width":"120px","--sd-kvt-radius":L+"px","--sd-kvt-th-padding-x":q+"px","--sd-kvt-padding":M+"px","--sd-kvt-gap":H+"px","--sd-kvt-label-gap":J+"px","--sd-kvt-border-width":R+"px","--sd-kvt-border-color":$.border,"--sd-kvt-th-bg":$.thBg,"--sd-kvt-th-color":$.thLabel,"--sd-kvt-required-color":$.required,"--sd-kvt-td-bg":$.tdBg,"--sd-kvt-td-color":$.tdText,"--sd-kvt-label-font-family":A.labelFontFamily,"--sd-kvt-label-font-size":A.labelFontSize+"px","--sd-kvt-label-font-weight":""+A.labelFontWeight,"--sd-kvt-label-line-height":A.labelLineHeight+"px","--sd-kvt-td-font-family":A.tdFontFamily,"--sd-kvt-td-font-size":A.tdFontSize+"px","--sd-kvt-td-font-weight":""+A.tdFontWeight,"--sd-kvt-td-line-height":A.tdLineHeight+"px","--sd-kvt-search-bg":$.searchBg,"--sd-kvt-search-padding-x":Y+"px"};this.warnDuplicateNames();const t=this.computeAutoSkipTh(),s=this.computeMaxCols(t),d=a("table",{class:{"sd-key-value-table":!0,"sd-key-value-table--radius-useTop":"useTop"===this.radius,"sd-key-value-table--radius-full":"full"===this.radius},style:e},a("colgroup",null,Array.from({length:s},((e,t)=>{if(t%2!=0)return a("col",{key:"col-"+t});const s=t/2,d=this.fields.reduce(((e,t)=>null!=e?e:t[s]?.thWidth),void 0);return a("col",{key:"col-"+t,style:{width:null!=d?"number"==typeof d?d+"px":d:"120px"}})}))),a("tbody",null,this.fields.map(((e,s)=>a("tr",{class:"sd-key-value-table__row",key:"row-"+s},e.map(((e,a)=>[e.hideTh||t[s][a]?null:this.renderTh(e,s,a),this.renderTd(e,s,a)])))))));return this.search?a("div",{class:{"sd-key-value-table__wrapper":!0,"sd-key-value-table__wrapper--radius-useTop":"useTop"===this.radius,"sd-key-value-table__wrapper--radius-full":"full"===this.radius},style:e},d,a("div",{class:"sd-key-value-table__search-panel"},a("sd-button",{label:"검색",name:"neutral_outline_md",onSdClick:this.handleSearchClick}))):d}static get style(){return"sd-key-value-table{display:block}sd-key-value-table .sd-key-value-table__wrapper{display:flex;align-items:stretch;width:100%;border:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color);border-radius:var(--sd-kvt-radius);overflow:hidden}sd-key-value-table .sd-key-value-table__wrapper .sd-key-value-table{flex:1 1 auto;border:0;border-radius:0}sd-key-value-table .sd-key-value-table__wrapper.sd-key-value-table__wrapper--radius-useTop{border-top-left-radius:0;border-top-right-radius:0}sd-key-value-table .sd-key-value-table__wrapper.sd-key-value-table__wrapper--radius-full{border-radius:0}sd-key-value-table .sd-key-value-table__search-panel{display:flex;align-items:center;justify-content:center;flex:0 0 auto;padding:var(--sd-kvt-padding) var(--sd-kvt-search-padding-x);background:var(--sd-kvt-search-bg);border-left:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color)}sd-key-value-table .sd-key-value-table{width:100%;table-layout:fixed;border:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color);border-radius:var(--sd-kvt-radius);border-collapse:separate;border-spacing:0;overflow:hidden}sd-key-value-table .sd-key-value-table.sd-key-value-table--radius-useTop{border-top-left-radius:0;border-top-right-radius:0}sd-key-value-table .sd-key-value-table.sd-key-value-table--radius-full{border-radius:0}sd-key-value-table .sd-key-value-table__th,sd-key-value-table .sd-key-value-table__td{height:var(--sd-kvt-row-height);box-sizing:border-box;vertical-align:middle;text-align:left;font-weight:normal;border-top:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color)}sd-key-value-table .sd-key-value-table tbody>tr:first-child>.sd-key-value-table__th,sd-key-value-table .sd-key-value-table tbody>tr:first-child>.sd-key-value-table__td{border-top:0}sd-key-value-table .sd-key-value-table__th{padding:var(--sd-kvt-padding) var(--sd-kvt-th-padding-x);width:var(--sd-kvt-th-width);background:var(--sd-kvt-th-bg);color:var(--sd-kvt-th-color)}sd-key-value-table .sd-key-value-table__th-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--sd-kvt-gap);width:100%;height:100%}sd-key-value-table .sd-key-value-table__label{display:inline-flex;align-items:center;gap:var(--sd-kvt-label-gap);font-family:var(--sd-kvt-label-font-family);font-size:var(--sd-kvt-label-font-size);font-weight:var(--sd-kvt-label-font-weight);line-height:var(--sd-kvt-label-line-height);color:var(--sd-kvt-th-color)}sd-key-value-table .sd-key-value-table__required{display:inline-flex;align-items:center;flex-shrink:0}sd-key-value-table .sd-key-value-table__help{display:inline-flex;align-items:center;flex-shrink:0}sd-key-value-table .sd-key-value-table__td{padding:var(--sd-kvt-padding);background:var(--sd-kvt-td-bg);color:var(--sd-kvt-td-color)}sd-key-value-table .sd-key-value-table__td-inner{display:flex;align-items:center;width:100%;height:100%}sd-key-value-table .sd-key-value-table__td-inner>slot{display:block;flex:1 1 auto;min-width:0}sd-key-value-table .sd-key-value-table__td-inner sd-input,sd-key-value-table .sd-key-value-table__td-inner sd-textarea,sd-key-value-table .sd-key-value-table__td-inner sd-number-input,sd-key-value-table .sd-key-value-table__td-inner sd-select,sd-key-value-table .sd-key-value-table__td-inner sd-date-picker,sd-key-value-table .sd-key-value-table__td-inner sd-date-range-picker,sd-key-value-table .sd-key-value-table__td-inner sd-file-picker{width:100%}sd-key-value-table .sd-key-value-table__text{font-family:var(--sd-kvt-td-font-family);font-size:var(--sd-kvt-td-font-size);font-weight:var(--sd-kvt-td-font-weight);line-height:var(--sd-kvt-td-line-height);color:var(--sd-kvt-td-color)}"}},[772,"sd-key-value-table",{fields:[16],search:[4],radius:[1]}]),P=O,W=function(){"undefined"!=typeof customElements&&["sd-key-value-table","sd-button","sd-calendar","sd-checkbox","sd-chip","sd-date-picker","sd-date-picker-trigger","sd-date-range-picker","sd-date-range-picker-calendar","sd-field","sd-file-picker","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-number-input","sd-portal","sd-radio","sd-radio-group","sd-select","sd-select-list-item","sd-select-list-item-search","sd-select-listbox","sd-select-trigger","sd-tag","sd-textarea","sd-tooltip"].forEach((e=>{switch(e){case"sd-key-value-table":customElements.get(d(e))||customElements.define(d(e),O);break;case"sd-button":customElements.get(d(e))||i();break;case"sd-calendar":customElements.get(d(e))||o();break;case"sd-checkbox":customElements.get(d(e))||n();break;case"sd-chip":customElements.get(d(e))||u();break;case"sd-date-picker":customElements.get(d(e))||c();break;case"sd-date-picker-trigger":customElements.get(d(e))||p();break;case"sd-date-range-picker":customElements.get(d(e))||b();break;case"sd-date-range-picker-calendar":customElements.get(d(e))||k();break;case"sd-field":customElements.get(d(e))||v();break;case"sd-file-picker":customElements.get(d(e))||m();break;case"sd-floating-portal":customElements.get(d(e))||h();break;case"sd-ghost-button":customElements.get(d(e))||y();break;case"sd-icon":customElements.get(d(e))||f();break;case"sd-input":customElements.get(d(e))||g();break;case"sd-number-input":customElements.get(d(e))||_();break;case"sd-portal":customElements.get(d(e))||w();break;case"sd-radio":customElements.get(d(e))||x();break;case"sd-radio-group":customElements.get(d(e))||j();break;case"sd-select":customElements.get(d(e))||E();break;case"sd-select-list-item":customElements.get(d(e))||S();break;case"sd-select-list-item-search":customElements.get(d(e))||N();break;case"sd-select-listbox":customElements.get(d(e))||z();break;case"sd-select-trigger":customElements.get(d(e))||B();break;case"sd-tag":customElements.get(d(e))||T();break;case"sd-textarea":customElements.get(d(e))||U();break;case"sd-tooltip":customElements.get(d(e))||C()}}))};export{P as SdKeyValueTable,W as defineCustomElement}
|
|
1
|
+
import{p as e,H as t,c as s,h as a,t as d}from"./p-CEVDmQdt.js";import{s as l}from"./p-BJfiMC9H.js";import{t as r}from"./p-D6GUzecR.js";import{d as i}from"./p-C3rOud8J.js";import{d as o}from"./p-DPmMT-y0.js";import{d as n}from"./p-D3dq5pt5.js";import{d as u}from"./p-Ycs3I9cT.js";import{d as c}from"./p-D-a6H314.js";import{d as p}from"./p-h9_f4fUW.js";import{d as k}from"./p-DcJ7u2_W.js";import{d as b}from"./p-1cW-9wVB.js";import{d as v}from"./p-BtVuPyhl.js";import{d as m}from"./p-BoPkOevJ.js";import{d as h}from"./p-DMvWCQfX.js";import{d as y}from"./p-C4_oeGm-.js";import{d as f}from"./p-BnhzUsGP.js";import{d as g}from"./p-PXhjh7pH.js";import{d as _}from"./p-Ck2aozmE.js";import{d as x}from"./p-D_SxeDkS.js";import{d as w}from"./p-CBXH-GWN.js";import{d as j}from"./p-DNRm9_Bv.js";import{d as E}from"./p-fzFFhJlr.js";import{d as S}from"./p-CtNDxhxx.js";import{d as N}from"./p-CNwoxvpg.js";import{d as C}from"./p-BZUlNC0d.js";import{d as z}from"./p-PMD-Col0.js";import{d as D}from"./p-D8T1XeGP.js";import{d as T}from"./p-Bqfoe_ek.js";import{d as U}from"./p-C-Cje7aS.js";const B=r.table,F=Number(B.keyValue.height),q=Number(B.radius),H=Number(B.header.paddingX),P=Number(B.keyValue.body.padding),W=Number(B.header.gap),G=Number(B.content.gap),J=Number(B.border.width),M=Number(B.keyValue.search.paddingX),$={border:B.border.color,thBg:B.header.bg,thLabel:l.color.fg.primary,required:l.color.fg.accent,helpIcon:l.color.fg.success,tdBg:l.color.bg.frame,tdText:l.color.fg.primary,searchBg:B.keyValue.search.bg},X={labelFontFamily:B.header.typography.fontFamily,labelFontSize:Number(B.header.typography.fontSize),labelFontWeight:700,labelLineHeight:Number(B.header.typography.lineHeight),tdFontFamily:B.body.typography.fontFamily,tdFontSize:Number(B.body.typography.fontSize),tdFontWeight:Number(B.body.typography.fontWeight),tdLineHeight:Number(B.body.typography.lineHeight)},A=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.change=s(this,"sdChange",7),this.searchEvent=s(this,"sdSearch",7)}fields=[];search=!1;radius="default";change;searchEvent;emit=(e,t)=>{this.change.emit({name:e,value:t})};handleSearchClick=()=>{this.searchEvent.emit()};renderField(e){const t=t=>this.emit(e.name,t.detail);switch(e.type){case"input":return a("sd-input",{width:"100%",...e.options??{},onSdUpdate:t});case"textarea":return a("sd-textarea",{width:"100%",...e.options??{},onSdUpdate:t});case"number-input":return a("sd-number-input",{width:"100%",...e.options??{},onSdUpdate:t});case"select":return a("sd-select",{width:"100%",...e.options??{},onSdUpdate:t});case"radio":{const{value:s,direction:d,...l}=e.options??{};return a("sd-radio-group",{...l,value:s,direction:d??"horizontal",onSdUpdate:t})}case"checkbox":{const{value:s,...d}=e.options??{};return a("sd-checkbox",{...d,value:s,onSdUpdate:t})}case"date-picker":return a("sd-date-picker",{width:"100%",...e.options??{},onSdUpdate:t});case"date-range-picker":return a("sd-date-range-picker",{width:"100%",...e.options??{},onSdUpdate:t});case"file-picker":return a("sd-file-picker",{width:"100%",...e.options??{},onSdUpdate:t});default:return a("span",{class:"sd-key-value-table__text"},e.options?.value??"")}}renderHelpIcon(e){return a("span",{class:"sd-key-value-table__help"},a("sd-tooltip",{icon:"helpOutline",iconSize:16,color:$.helpIcon,trigger:"hover"},e))}computeAutoSkipTh(){const e=this.fields.map((e=>e.map((()=>!1))));return this.fields.forEach(((t,s)=>{t.forEach(((t,a)=>{const d=null!=t.thRowSpan&&t.thRowSpan>1?t.thRowSpan:1;if(!(d<=1))for(let t=1;t<d;t++){const d=e[s+t];d&&a<d.length&&(d[a]=!0)}}))})),e}computeMaxCols(e){let t=0;return this.fields.forEach(((s,a)=>{let d=0;s.forEach(((t,s)=>{let l;l=t.hideTh?0:e[a]?.[s]?1:null!=t.thColSpan&&t.thColSpan>1?t.thColSpan:1,d+=l+(null!=t.tdColSpan&&t.tdColSpan>1?t.tdColSpan:1)})),d>t&&(t=d)})),t}buildThStyle(e){const t={...e};return null!=e.color&&(t["--sd-kvt-th-color"]=e.color),null!=e.background&&(t["--sd-kvt-th-bg"]=e.background),null!=e.backgroundColor&&(t["--sd-kvt-th-bg"]=e.backgroundColor),null!=e.fontFamily&&(t["--sd-kvt-label-font-family"]=e.fontFamily),null!=e.fontSize&&(t["--sd-kvt-label-font-size"]=e.fontSize),null!=e.fontWeight&&(t["--sd-kvt-label-font-weight"]=e.fontWeight),null!=e.lineHeight&&(t["--sd-kvt-label-line-height"]=e.lineHeight),t}renderTh(e,t,s){const d=null!=e.thRowSpan&&e.thRowSpan>1?e.thRowSpan:void 0,l=null!=e.thColSpan&&e.thColSpan>1?e.thColSpan:void 0,r={"sd-key-value-table__th":!0};"string"==typeof e.thClass?r[e.thClass]=!0:Array.isArray(e.thClass)&&e.thClass.forEach((e=>r[e]=!0));const i=null!=e.thStyle?this.buildThStyle(e.thStyle):void 0;return a("th",{key:`th-${t}-${s}`,class:r,style:i,scope:"row",rowSpan:d,colSpan:l},a("div",{class:"sd-key-value-table__th-inner"},a("span",{class:"sd-key-value-table__label"},e.label,e.required&&a("sd-icon",{class:"sd-key-value-table__required",name:"star",size:12,color:$.required,label:"required"})),e.helpText&&this.renderHelpIcon(e.helpText)))}renderTd(e,t,s){return a("td",{key:`td-${t}-${s}`,class:"sd-key-value-table__td",rowSpan:null!=e.tdRowSpan&&e.tdRowSpan>1?e.tdRowSpan:void 0,colSpan:null!=e.tdColSpan&&e.tdColSpan>1?e.tdColSpan:void 0},a("div",{class:"sd-key-value-table__td-inner"},a("slot",{name:"field-"+e.name},this.renderField(e))))}warnDuplicateNames(){const e=new Set,t=new Set;this.fields.forEach((s=>s.forEach((s=>{e.has(s.name)?t.add(s.name):e.add(s.name)})))),t.size>0&&console.warn(`[sd-key-value-table] Duplicate field name(s) detected: ${[...t].join(", ")}. Slot names ("field-{name}") and sdChange events rely on unique names.`)}render(){if(0===this.fields.length)return null;const e={"--sd-kvt-row-height":F+"px","--sd-kvt-th-width":"120px","--sd-kvt-radius":q+"px","--sd-kvt-th-padding-x":H+"px","--sd-kvt-padding":P+"px","--sd-kvt-gap":W+"px","--sd-kvt-label-gap":G+"px","--sd-kvt-border-width":J+"px","--sd-kvt-border-color":$.border,"--sd-kvt-th-bg":$.thBg,"--sd-kvt-th-color":$.thLabel,"--sd-kvt-required-color":$.required,"--sd-kvt-td-bg":$.tdBg,"--sd-kvt-td-color":$.tdText,"--sd-kvt-label-font-family":X.labelFontFamily,"--sd-kvt-label-font-size":X.labelFontSize+"px","--sd-kvt-label-font-weight":""+X.labelFontWeight,"--sd-kvt-label-line-height":X.labelLineHeight+"px","--sd-kvt-td-font-family":X.tdFontFamily,"--sd-kvt-td-font-size":X.tdFontSize+"px","--sd-kvt-td-font-weight":""+X.tdFontWeight,"--sd-kvt-td-line-height":X.tdLineHeight+"px","--sd-kvt-search-bg":$.searchBg,"--sd-kvt-search-padding-x":M+"px"};this.warnDuplicateNames();const t=this.computeAutoSkipTh(),s=this.computeMaxCols(t),d=a("table",{class:{"sd-key-value-table":!0,"sd-key-value-table--radius-useTop":"useTop"===this.radius,"sd-key-value-table--radius-full":"full"===this.radius},style:e},a("colgroup",null,Array.from({length:s},((e,t)=>{if(t%2!=0)return a("col",{key:"col-"+t});const s=t/2,d=this.fields.reduce(((e,t)=>null!=e?e:t[s]?.thWidth),void 0);return a("col",{key:"col-"+t,style:{width:null!=d?"number"==typeof d?d+"px":d:"120px"}})}))),a("tbody",null,this.fields.map(((e,s)=>a("tr",{class:"sd-key-value-table__row",key:"row-"+s},e.map(((e,a)=>[e.hideTh||t[s][a]?null:this.renderTh(e,s,a),this.renderTd(e,s,a)])))))));return this.search?a("div",{class:{"sd-key-value-table__wrapper":!0,"sd-key-value-table__wrapper--radius-useTop":"useTop"===this.radius,"sd-key-value-table__wrapper--radius-full":"full"===this.radius},style:e},d,a("div",{class:"sd-key-value-table__search-panel"},a("sd-button",{label:"검색",name:"neutral_outline_md",onSdClick:this.handleSearchClick}))):d}static get style(){return"sd-key-value-table{display:block}sd-key-value-table .sd-key-value-table__wrapper{display:flex;align-items:stretch;width:100%;border:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color);border-radius:var(--sd-kvt-radius);overflow:hidden}sd-key-value-table .sd-key-value-table__wrapper .sd-key-value-table{flex:1 1 auto;border:0;border-radius:0}sd-key-value-table .sd-key-value-table__wrapper.sd-key-value-table__wrapper--radius-useTop{border-top-left-radius:0;border-top-right-radius:0}sd-key-value-table .sd-key-value-table__wrapper.sd-key-value-table__wrapper--radius-full{border-radius:0}sd-key-value-table .sd-key-value-table__search-panel{display:flex;align-items:center;justify-content:center;flex:0 0 auto;padding:var(--sd-kvt-padding) var(--sd-kvt-search-padding-x);background:var(--sd-kvt-search-bg);border-left:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color)}sd-key-value-table .sd-key-value-table{width:100%;table-layout:fixed;border:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color);border-radius:var(--sd-kvt-radius);border-collapse:separate;border-spacing:0;overflow:hidden}sd-key-value-table .sd-key-value-table.sd-key-value-table--radius-useTop{border-top-left-radius:0;border-top-right-radius:0}sd-key-value-table .sd-key-value-table.sd-key-value-table--radius-full{border-radius:0}sd-key-value-table .sd-key-value-table__th,sd-key-value-table .sd-key-value-table__td{height:var(--sd-kvt-row-height);box-sizing:border-box;vertical-align:middle;text-align:left;font-weight:normal;border-top:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color)}sd-key-value-table .sd-key-value-table tbody>tr:first-child>.sd-key-value-table__th,sd-key-value-table .sd-key-value-table tbody>tr:first-child>.sd-key-value-table__td{border-top:0}sd-key-value-table .sd-key-value-table__th{padding:var(--sd-kvt-padding) var(--sd-kvt-th-padding-x);width:var(--sd-kvt-th-width);background:var(--sd-kvt-th-bg);color:var(--sd-kvt-th-color)}sd-key-value-table .sd-key-value-table__th-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--sd-kvt-gap);width:100%;height:100%}sd-key-value-table .sd-key-value-table__label{display:inline-flex;align-items:center;gap:var(--sd-kvt-label-gap);font-family:var(--sd-kvt-label-font-family);font-size:var(--sd-kvt-label-font-size);font-weight:var(--sd-kvt-label-font-weight);line-height:var(--sd-kvt-label-line-height);color:var(--sd-kvt-th-color)}sd-key-value-table .sd-key-value-table__required{display:inline-flex;align-items:center;flex-shrink:0}sd-key-value-table .sd-key-value-table__help{display:inline-flex;align-items:center;flex-shrink:0}sd-key-value-table .sd-key-value-table__td{padding:var(--sd-kvt-padding);background:var(--sd-kvt-td-bg);color:var(--sd-kvt-td-color)}sd-key-value-table .sd-key-value-table__td-inner{display:flex;align-items:center;width:100%;height:100%}sd-key-value-table .sd-key-value-table__td-inner>slot{display:block;flex:1 1 auto;min-width:0}sd-key-value-table .sd-key-value-table__td-inner sd-input,sd-key-value-table .sd-key-value-table__td-inner sd-textarea,sd-key-value-table .sd-key-value-table__td-inner sd-number-input,sd-key-value-table .sd-key-value-table__td-inner sd-select,sd-key-value-table .sd-key-value-table__td-inner sd-date-picker,sd-key-value-table .sd-key-value-table__td-inner sd-date-range-picker,sd-key-value-table .sd-key-value-table__td-inner sd-file-picker{width:100%}sd-key-value-table .sd-key-value-table__text{font-family:var(--sd-kvt-td-font-family);font-size:var(--sd-kvt-td-font-size);font-weight:var(--sd-kvt-td-font-weight);line-height:var(--sd-kvt-td-line-height);color:var(--sd-kvt-td-color)}"}},[772,"sd-key-value-table",{fields:[16],search:[4],radius:[1]}]),I=A,L=function(){"undefined"!=typeof customElements&&["sd-key-value-table","sd-button","sd-calendar","sd-checkbox","sd-chip","sd-date-picker","sd-date-picker-trigger","sd-date-range-picker","sd-date-range-picker-calendar","sd-field","sd-file-picker","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-number-input","sd-portal","sd-radio","sd-radio-group","sd-select","sd-select-list-item","sd-select-list-item-search","sd-select-listbox","sd-select-trigger","sd-tag","sd-textarea","sd-tooltip"].forEach((e=>{switch(e){case"sd-key-value-table":customElements.get(d(e))||customElements.define(d(e),A);break;case"sd-button":customElements.get(d(e))||i();break;case"sd-calendar":customElements.get(d(e))||o();break;case"sd-checkbox":customElements.get(d(e))||n();break;case"sd-chip":customElements.get(d(e))||u();break;case"sd-date-picker":customElements.get(d(e))||c();break;case"sd-date-picker-trigger":customElements.get(d(e))||p();break;case"sd-date-range-picker":customElements.get(d(e))||k();break;case"sd-date-range-picker-calendar":customElements.get(d(e))||b();break;case"sd-field":customElements.get(d(e))||v();break;case"sd-file-picker":customElements.get(d(e))||m();break;case"sd-floating-portal":customElements.get(d(e))||h();break;case"sd-ghost-button":customElements.get(d(e))||y();break;case"sd-icon":customElements.get(d(e))||f();break;case"sd-input":customElements.get(d(e))||g();break;case"sd-number-input":customElements.get(d(e))||_();break;case"sd-portal":customElements.get(d(e))||x();break;case"sd-radio":customElements.get(d(e))||w();break;case"sd-radio-group":customElements.get(d(e))||j();break;case"sd-select":customElements.get(d(e))||E();break;case"sd-select-list-item":customElements.get(d(e))||S();break;case"sd-select-list-item-search":customElements.get(d(e))||N();break;case"sd-select-listbox":customElements.get(d(e))||C();break;case"sd-select-trigger":customElements.get(d(e))||z();break;case"sd-tag":customElements.get(d(e))||D();break;case"sd-textarea":customElements.get(d(e))||T();break;case"sd-tooltip":customElements.get(d(e))||U()}}))};export{I as SdKeyValueTable,L as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as r,h as s,d as a,t as l}from"./p-CEVDmQdt.js";import{p as i}from"./p-D1vaasIp.js";import{s as o}from"./p-BJfiMC9H.js";const t={track:i.progress.color.track,label:i.progress.color.label,valueOnFill:i.progress.bar.text,valueZero:o.color.fg.tertiary},n={primary:i.progress.active.color,error:i.progress.error.color,complete:i.progress.success.color},d=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}indeterminate=!1;value=0;type="primary";label;get clampedValue(){return Number.isFinite(this.value)?Math.max(0,Math.min(100,this.value)):0}render(){const e=n[this.type]??n.primary,r={"--sd-linear-progress-track-color":t.track,"--sd-linear-progress-fill-color":e,"--sd-linear-progress-value-color":0===this.clampedValue?t.valueZero:e,"--sd-linear-progress-value-on-fill":t.valueOnFill,"--sd-linear-progress-label-color":t.label},l=this.indeterminate?{}:{width:this.clampedValue+"%"},i={clipPath:`inset(0 ${100-this.clampedValue}% 0 0)`},o=Math.round(this.clampedValue)+"%";return s(a,{key:"
|
|
1
|
+
import{p as e,H as r,h as s,d as a,t as l}from"./p-CEVDmQdt.js";import{p as i}from"./p-D1vaasIp.js";import{s as o}from"./p-BJfiMC9H.js";const t={track:i.progress.color.track,label:i.progress.color.label,valueOnFill:i.progress.bar.text,valueZero:o.color.fg.tertiary},n={primary:i.progress.active.color,error:i.progress.error.color,complete:i.progress.success.color},d=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}indeterminate=!1;value=0;type="primary";label;get clampedValue(){return Number.isFinite(this.value)?Math.max(0,Math.min(100,this.value)):0}render(){const e=n[this.type]??n.primary,r={"--sd-linear-progress-track-color":t.track,"--sd-linear-progress-fill-color":e,"--sd-linear-progress-value-color":0===this.clampedValue?t.valueZero:e,"--sd-linear-progress-value-on-fill":t.valueOnFill,"--sd-linear-progress-label-color":t.label},l=this.indeterminate?{}:{width:this.clampedValue+"%"},i={clipPath:`inset(0 ${100-this.clampedValue}% 0 0)`},o=Math.round(this.clampedValue)+"%";return s(a,{key:"8ca7707d3d3da0e761b6534c1301dde83ee82cf5",style:r},s("div",{key:"0cee50f047b64cb4bdf0512aaa00cbfe2257bd8b",class:"sd-linear-progress__track"},s("div",{key:"f9e6c3f21edfcf583d2254f72a2f33359b5cc0b6",class:"sd-linear-progress__fill",style:l}),!this.indeterminate&&s("span",{key:"6586b4d39c2e8535dfee352ce78f0ab7f82c8c52",class:"sd-linear-progress__value sd-linear-progress__value--on-track"},o),!this.indeterminate&&s("span",{key:"9e35001008fb5c38094dcb22c0961c072e9603a4",class:"sd-linear-progress__value sd-linear-progress__value--on-fill",style:i},o)),this.label&&s("span",{key:"800e17a8a527e45134e8d4049bb133960bc0219d",class:"sd-linear-progress__label"},this.label))}static get style(){return'sd-linear-progress{display:inline-flex;flex-direction:column;gap:12px;width:100%}sd-linear-progress .sd-linear-progress__track{position:relative;width:100%;height:20px;border-radius:9999px;background-color:var(--sd-linear-progress-track-color);overflow:hidden}sd-linear-progress .sd-linear-progress__fill{position:absolute;inset:0 auto 0 0;height:100%;background-color:var(--sd-linear-progress-fill-color);border-radius:inherit;transition:width 0.4s linear}sd-linear-progress .sd-linear-progress__value{position:absolute;top:50%;left:0;right:0;transform:translateY(-50%);text-align:center;font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;font-size:12px;font-weight:700;line-height:20px;pointer-events:none;user-select:none}sd-linear-progress .sd-linear-progress__value--on-track{color:var(--sd-linear-progress-value-color)}sd-linear-progress .sd-linear-progress__value--on-fill{color:var(--sd-linear-progress-value-on-fill)}sd-linear-progress .sd-linear-progress__label{text-align:center;color:var(--sd-linear-progress-label-color);font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;font-size:12px;font-weight:400;line-height:20px}sd-linear-progress[indeterminate] .sd-linear-progress__fill{inset:0;width:auto;transform-origin:left center;transition:none;animation:sd-linear-progress-indeterminate 1.2s linear infinite}@keyframes sd-linear-progress-indeterminate{0%{transform:translateX(-100%) scaleX(0.2)}50%{transform:translateX(20%) scaleX(0.6)}100%{transform:translateX(120%) scaleX(0.2)}}'}},[512,"sd-linear-progress",{indeterminate:[516],value:[2],type:[513],label:[1]}]),p=d,c=function(){"undefined"!=typeof customElements&&["sd-linear-progress"].forEach((e=>{"sd-linear-progress"===e&&(customElements.get(l(e))||customElements.define(l(e),d))}))};export{p as SdLinearProgress,c as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as i,h as n,t as s}from"./p-CEVDmQdt.js";import{d as t}from"./p-
|
|
1
|
+
import{p as e,H as i,h as n,t as s}from"./p-CEVDmQdt.js";import{d as t}from"./p-D6noGX38.js";const a=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost()}visible=!1;message="";async show(e={}){this.message=e.message??"",this.visible=!0}async hide(){this.visible=!1}render(){return n("div",{key:"19729567b6041e3220c11c569be814f51b31c388",class:{"sd-loading-container":!0,"sd-loading-container--visible":this.visible},"aria-hidden":this.visible?"false":"true"},n("div",{key:"50e6ac53e4515dc305e7a840362f2beb30714674",class:"sd-loading-container__backdrop"}),n("div",{key:"2f0943599188cb0800139f5ab543bab679f3bfee",class:"sd-loading-container__content"},n("sd-circle-progress",{key:"a5977418272a167fe76073734be5a36ffa3136ab",indeterminate:!0,type:"inverse"}),this.message&&n("p",{key:"9285adc663909fafb762e84ad5dd108c6ba2c972",class:"sd-loading-container__message"},this.message)))}static get style(){return"sd-loading-container .sd-loading-container{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:var(--sd-loading-container-z-index, 999);opacity:0;visibility:hidden;transition:opacity 0.2s ease, visibility 0s linear 0.2s;pointer-events:none}sd-loading-container .sd-loading-container--visible{opacity:1;visibility:visible;transition:opacity 0.2s ease, visibility 0s linear 0s;pointer-events:auto}sd-loading-container .sd-loading-container__backdrop{position:absolute;inset:0;background:rgba(0, 0, 0, 0.4)}sd-loading-container .sd-loading-container__content{position:relative;display:flex;flex-direction:column;align-items:center;gap:16px}sd-loading-container .sd-loading-container__message{margin:0;color:#ffffff;font-size:14px;font-weight:500;line-height:22px;text-align:center;max-width:400px;word-break:keep-all}"}},[512,"sd-loading-container",{visible:[32],message:[32],show:[64],hide:[64]}]),o=a,d=function(){"undefined"!=typeof customElements&&["sd-loading-container","sd-circle-progress"].forEach((e=>{switch(e){case"sd-loading-container":customElements.get(s(e))||customElements.define(s(e),a);break;case"sd-circle-progress":customElements.get(s(e))||t()}}))};export{o as SdLoadingContainer,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as
|
|
1
|
+
import{S as o,d as s}from"./p-0U99W-3Z.js";const p=o,r=s;export{p as SdLoadingModal,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as s,h as o,t as e}from"./p-CEVDmQdt.js";import{u as i,r as a,s as n,i as d,a as r}from"./p-DRVnqiWc.js";import{d as l}from"./p-C3rOud8J.js";import{d as c}from"./p-
|
|
1
|
+
import{p as t,H as s,h as o,t as e}from"./p-CEVDmQdt.js";import{u as i,r as a,s as n,i as d,a as r}from"./p-DRVnqiWc.js";import{d as l}from"./p-C3rOud8J.js";import{d as c}from"./p-D6noGX38.js";import{d as m}from"./p-Fwb7LRwv.js";import{d as u}from"./p-C4_oeGm-.js";import{d as h}from"./p-BnhzUsGP.js";import{d as p}from"./p-0U99W-3Z.js";import{d as b}from"./p-D_SxeDkS.js";import{d as f}from"./p-D8T1XeGP.js";let _=0;const g=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}autoRemove=!1;entries=[];layerRefs=new Map;async open(t,s){const o="modal-"+ ++_,e=this.createConfirmModal(o,t);return this.attachModalEventListeners(o,e),this.mountEntry({id:o,modalEl:e,modalRef:s,persistent:!!t.persistent,closing:!1,backdropVisible:!1}),o}async openLoading(t,s){const o="modal-"+ ++_,e=this.createLoadingModal(o,t);return this.attachLoadingModalEventListeners(o,e),this.mountEntry({id:o,modalEl:e,modalRef:s,persistent:!!t.persistent,closing:!1,backdropVisible:!1}),o}async createCustom(t,s,o){const e="modal-"+ ++_;return t.setAttribute("data-modal-id",e),t.classList.add("sd-modal-container__modal"),this.attachModalEventListeners(e,t),this.mountEntry({id:e,modalEl:t,modalRef:o,persistent:!!s.persistent,closing:!1,backdropVisible:!1}),e}componentDidRender(){if(Array.isArray(this.entries))for(const t of this.entries){if(t.closing||t.modalEl.isConnected)continue;const s=this.layerRefs.get(t.id);if(!s)continue;const{id:o,modalEl:e}=t;s.appendChild(e),this.waitForModalReady(e).then((()=>{requestAnimationFrame((()=>{const t=this.entries.find((t=>t.id===o));t&&!t.closing&&e.isConnected&&(this.entries=this.entries.map((t=>t.id===o?{...t,backdropVisible:!0}:t)),e.classList.add("sd-modal-container__modal--visible"),this.focusInitialElement(e))}))}))}}disconnectedCallback(){for(const t of this.entries??[])t.dismissTimerId&&clearTimeout(t.dismissTimerId),i(t.id)}async dismissById(t,s){this.entries.find((s=>s.id===t))&&this.requestDismiss(t,s)}async update(t,s){const o=this.entries.find((s=>s.id===t&&!s.closing));o&&("sd-loading-modal"!==o.modalEl.tagName.toLowerCase()?this.applyProps(o.modalEl,s):this.applyLoadingProps(o.modalEl,s))}mountEntry(t){const s="undefined"!=typeof document?document.activeElement:null;this.entries=[...this.entries??[],{...t,previousActiveElement:s}],a({id:t.id,persistent:t.persistent,requestClose:()=>this.dispatchClose(t.id),shake:()=>this.shakeModal(t.modalEl),setZIndex:t=>{this.el.style.setProperty("--sd-modal-container-z-index",t+"")}})}attachModalEventListeners(t,s){s.addEventListener("sdOk",(()=>{const s=this.entries.find((s=>s.id===t));s?.modalRef._hasSubmit?.()?s.modalRef._triggerSubmit?.():this.requestDismiss(t,"confirm")})),s.addEventListener("sdCancel",(()=>this.requestDismiss(t,"cancel"))),s.addEventListener("sdClose",(()=>this.requestDismiss(t,"close")))}attachLoadingModalEventListeners(t,s){s.addEventListener("sdClick",(()=>{const s=this.entries.find((s=>s.id===t));s?.modalRef._triggerClick?.()}))}dispatchClose(t){const s=this.entries.find((s=>s.id===t));s?.modalEl.dispatchEvent(new CustomEvent("sdClose"))}requestDismiss(t,s){const o=this.entries.find((s=>s.id===t));if(!o||o.closing)return;o.modalEl.classList.remove("sd-modal-container__modal--visible");const e=setTimeout((()=>{this.finalizeDismiss(t)}),350);n(t,!1),this.entries=(this.entries??[]).map((s=>s.id===t?{...s,closing:!0,dismissTimerId:e,backdropVisible:!1}:s)),"confirm"===s?o.modalRef._triggerOk():"cancel"===s?o.modalRef._triggerCancel():"close"===s&&o.modalRef._triggerClose()}finalizeDismiss(t){const s=this.entries.find((s=>s.id===t));s&&(s.dismissTimerId&&clearTimeout(s.dismissTimerId),s.modalEl.remove(),i(t),this.restoreFocus(s.previousActiveElement),s.modalRef._triggerDismissed(),this.layerRefs.delete(t),this.entries=(this.entries??[]).filter((s=>s.id!==t)),this.autoRemove&&0===this.entries.length&&this.el.remove())}createConfirmModal(t,s){const o=document.createElement("sd-confirm-modal");return o.setAttribute("data-modal-id",t),o.classList.add("sd-modal-container__modal"),this.applyProps(o,s),o}createLoadingModal(t,s){const o=document.createElement("sd-loading-modal");return o.setAttribute("data-modal-id",t),o.classList.add("sd-modal-container__modal"),this.applyLoadingProps(o,s),o}applyLoadingProps(t,s){this.hasOwnProp(s,"state")&&this.setAttr(t,"state",s.state),this.hasOwnProp(s,"message")&&(Array.isArray(s.message)?t.message=s.message:this.setAttr(t,"message",s.message)),this.hasOwnProp(s,"useButton")&&(s.useButton?t.setAttribute("use-button",""):t.removeAttribute("use-button")),this.hasOwnProp(s,"buttonLabel")&&this.setAttr(t,"button-label",s.buttonLabel),this.hasOwnProp(s,"width")&&this.setAttr(t,"width",null!=s.width?s.width+"":void 0),this.hasOwnProp(s,"height")&&this.setAttr(t,"height",null!=s.height?s.height+"":void 0),this.hasOwnProp(s,"progress")&&(t.progress=s.progress)}applyProps(t,s){this.hasOwnProp(s,"type")&&this.setAttr(t,"type",s.type),this.hasOwnProp(s,"title")&&this.setAttr(t,"modal-title",s.title),this.hasOwnProp(s,"titleClass")&&this.setAttr(t,"title-class",s.titleClass),this.hasOwnProp(s,"mainButtonLabel")&&this.setAttr(t,"main-button-label",s.mainButtonLabel),this.hasOwnProp(s,"mainButtonName")&&this.setAttr(t,"main-button-name",s.mainButtonName),this.hasOwnProp(s,"subButtonLabel")&&this.setAttr(t,"sub-button-label",s.subButtonLabel),this.hasOwnProp(s,"tagPreset")&&this.setAttr(t,"tag-preset",s.tagPreset),this.hasOwnProp(s,"tagLabel")&&this.setAttr(t,"tag-label",s.tagLabel),this.hasOwnProp(s,"slotLabel")&&this.setAttr(t,"slot-label",s.slotLabel),this.hasOwnProp(s,"topMessage")&&(t.topMessage=s.topMessage??[]),this.hasOwnProp(s,"bottomMessage")&&(t.bottomMessage=s.bottomMessage??[]),this.hasOwnProp(s,"tagContents")&&(t.tagContents=s.tagContents)}handleBackdropClick(t){d(t)&&r(t)}focusInitialElement(t){const s=this.getInitialFocusTarget(t);s?.focus()}getInitialFocusTarget(t){const s=t.querySelector("[autofocus]");if(s)return s;const o=t.querySelector(".sd-confirm-modal__button sd-button:last-of-type button,.sd-action-modal__footer > sd-button button,.sd-loading-modal__button sd-button button");if(o)return o;const e=Array.from(t.querySelectorAll('a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])')),i=e.find((t=>!t.closest(".sd-action-modal__close, .sd-confirm-modal__close-button")));return e.length>0?i??e[0]:(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t)}restoreFocus(t){t&&"function"==typeof t.focus&&t.isConnected&&t.focus()}shakeModal(t){const s="sd-modal-container__modal--shake";t.classList.remove(s),t.addEventListener("animationend",(()=>t.classList.remove(s)),{once:!0}),requestAnimationFrame((()=>{t.classList.add(s)}))}waitForModalReady(t){const s=t.componentOnReady;return"function"==typeof s?s.call(t).then((()=>{})):new Promise((t=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>t()))}))}))}hasOwnProp(t,s){return Object.prototype.hasOwnProperty.call(t,s)}setAttr(t,s,o){null!=o&&t.setAttribute(s,o)}render(){return 0===(this.entries?.length??0)?null:o("div",{class:"sd-modal-container"},this.entries.map(((t,s)=>o("div",{key:t.id,class:"sd-modal-container__layer",style:{zIndex:s+1+""},"data-modal-id":t.id,ref:s=>{s&&this.layerRefs.set(t.id,s)}},o("div",{class:{"sd-modal-container__backdrop":!0,"sd-modal-container__backdrop--visible":t.backdropVisible},onClick:()=>this.handleBackdropClick(t.id)})))))}static get style(){return"sd-modal-container{display:block}sd-modal-container .sd-modal-container{position:fixed;inset:0;z-index:var(--sd-modal-container-z-index, 997);pointer-events:none}sd-modal-container .sd-modal-container__layer{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none}sd-modal-container .sd-modal-container__backdrop{position:absolute;inset:0;background:rgba(0, 0, 0, 0.4);opacity:0;transition:opacity 0.3s ease-out;pointer-events:none}sd-modal-container .sd-modal-container__backdrop--visible{opacity:1;pointer-events:auto}sd-modal-container .sd-modal-container__modal{position:relative;z-index:1;opacity:0;transform:scale(0);pointer-events:auto;transition:opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)}sd-modal-container .sd-modal-container__modal--visible{opacity:1;transform:scale(1)}sd-modal-container .sd-modal-container__modal--shake{animation:modal-shake 0.3s ease-out}@keyframes modal-shake{0%,100%{transform:scale(1)}25%{transform:scale(1.03)}50%{transform:scale(0.97)}75%{transform:scale(1.01)}}"}},[512,"sd-modal-container",{autoRemove:[4,"auto-remove"],entries:[32],open:[64],openLoading:[64],createCustom:[64],dismissById:[64],update:[64]}]),y=g,k=function(){"undefined"!=typeof customElements&&["sd-modal-container","sd-button","sd-circle-progress","sd-confirm-modal","sd-ghost-button","sd-icon","sd-loading-modal","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-modal-container":customElements.get(e(t))||customElements.define(e(t),g);break;case"sd-button":customElements.get(e(t))||l();break;case"sd-circle-progress":customElements.get(e(t))||c();break;case"sd-confirm-modal":customElements.get(e(t))||m();break;case"sd-ghost-button":customElements.get(e(t))||u();break;case"sd-icon":customElements.get(e(t))||h();break;case"sd-loading-modal":customElements.get(e(t))||p();break;case"sd-portal":customElements.get(e(t))||b();break;case"sd-tag":customElements.get(e(t))||f()}}))};export{y as SdModalContainer,k as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as s}from"./p-
|
|
1
|
+
import{S as o,d as s}from"./p-Ck2aozmE.js";const a=o,m=s;export{a as SdNumberInput,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as
|
|
1
|
+
import{S as o,d as s}from"./p-BoH7ykYx.js";const p=o,r=s;export{p as SdPagination,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as o,F as
|
|
1
|
+
import{p as e,H as s,c as t,h as o,F as a,t as i}from"./p-CEVDmQdt.js";import{T as n}from"./p-B3bERWUt.js";import{d as l}from"./p-C3rOud8J.js";import{d as c}from"./p-DMvWCQfX.js";import{d}from"./p-C4_oeGm-.js";import{d as r}from"./p-BnhzUsGP.js";import{d as b}from"./p-D_SxeDkS.js";import{d as m}from"./p-D8T1XeGP.js";import{d as f}from"./p-C5uz_eFs.js";var h={bg:"#07284A"};const p=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.showChange=t(this,"sdShowChange",7)}get el(){return this}show=!1;placement="bottom";color="#01BB4B";icon="helpOutline";iconSize=12;label="";name="primary_sm";rightIcon;ariaLabel="";disabled=!1;type="button";menuTitle;leftLink;button;menuClass="";slotContentHTML="";showChange;buttonEl;setShow=e=>{this.show!==e&&(this.show=e,this.showChange.emit(e))};get popoverOffset(){switch(this.placement??"bottom"){case"top":return[0,-4];case"bottom":return[0,4];case"left":case"right":return[4,0]}}handleClose=()=>this.setShow(!1);componentWillLoad(){this.slotContentHTML=this.el.innerHTML,this.el.innerHTML=""}render(){const e=this.placement??"bottom",s=this.color??"#01BB4B",t=this.icon??"helpOutline",i=this.iconSize??12,l=this.menuClass??"",c=this.leftLink,d=this.button,r=!!c||!!d;return o(a,{key:"163802d6f0954b87902bbf957831f311829e63dc"},""!==this.label?o("sd-button",{ref:e=>this.buttonEl=e,name:this.name??"primary_sm",label:this.label,icon:t,rightIcon:this.rightIcon,ariaLabel:this.ariaLabel||this.label||t||"Open popover",disabled:this.disabled,type:this.type??"button",class:"sd-popover",onSdClick:()=>this.setShow(!this.show)}):o("sd-icon",{ref:e=>this.buttonEl=e,name:t,size:i,color:s,class:"sd-popover",onClick:()=>this.setShow(!this.show)}),this.show&&o("sd-floating-portal",{key:"1bd73048fd65916a400840c572d988c445dd662b",parentRef:this.buttonEl,onSdClose:this.handleClose,placement:e,offset:this.popoverOffset},o("div",{key:"f3791b078c7970174d9394ffcbb19beb450f12c5",class:{"sd-floating-menu":!0,"sd-floating-menu--popover":!0,["sd-floating-menu--"+e]:!0,[l]:""!==l},style:{"--sd-floating-bg":h.bg}},o("i",{key:"f9ab66a933669a057a1da5188cb82ca9e5f17ed6",class:"sd-floating-menu__arrow sd-floating-menu__arrow--"+e},o(n,{key:"6ea9ca3bacd2c84c468e5f00fa33e93e61a6bf9d"})),o("div",{key:"91d094cd45973bcc5ea6e6016510006f41956546",class:"sd-floating-menu__content"},this.menuTitle&&o("div",{key:"ebe9a1e130792d7e60ca9abef9020dff6c0bd4c4",class:"sd-floating-menu__title"},this.menuTitle),this.slotContentHTML&&o("div",{key:"b898402e77f125099b29f6bd8eb5384a70aa671a",class:"sd-floating-menu__messages",innerHTML:this.slotContentHTML}),r&&o("div",{key:"e797202b27ff538d4148f3b6782b33f58fc6bc2f",class:{"sd-floating-menu__buttons":!0,"sd-floating-menu__buttons--with-link":!!c}},c&&o("sd-text-link",{key:"fdeacc2b97c997d0c7385bab5260e060a70292e6",class:"sd-floating-menu__left-link",label:c.label,icon:c.icon??"",iconColor:c.iconColor??"",rightArrow:c.rightArrow??"none",underline:!!c.underline,disabled:!!c.disabled,onSdClick:c.onClick}),d&&o("sd-button",{key:"4a56e7e714517edcbea075e7d4521f0a54388e9f",name:d.name??"secondary_xs",label:d.label,icon:d.icon,rightIcon:d.rightIcon,ariaLabel:d.ariaLabel||d.label||d.icon||"Open popover",disabled:d.disabled,type:d.type,onSdClick:d.onClick}))),o("sd-ghost-button",{key:"ca713f6a07637b014c58923db2ff7af1f3ae98a8",class:"sd-floating-menu__close-button",icon:"close",ariaLabel:"close",size:"xs",onClick:this.handleClose}))))}static get style(){return"sd-popover{position:relative;cursor:pointer;display:inline-flex}"}},[512,"sd-popover",{show:[1028],placement:[513],color:[513],icon:[513],iconSize:[514,"icon-size"],label:[1],name:[1],rightIcon:[1,"right-icon"],ariaLabel:[1,"aria-label"],disabled:[4],type:[1],menuTitle:[1,"menu-title"],leftLink:[16],button:[16],menuClass:[1,"menu-class"],slotContentHTML:[32]}]),u=p,g=function(){"undefined"!=typeof customElements&&["sd-popover","sd-button","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag","sd-text-link"].forEach((e=>{switch(e){case"sd-popover":customElements.get(i(e))||customElements.define(i(e),p);break;case"sd-button":customElements.get(i(e))||l();break;case"sd-floating-portal":customElements.get(i(e))||c();break;case"sd-ghost-button":customElements.get(i(e))||d();break;case"sd-icon":customElements.get(i(e))||r();break;case"sd-portal":customElements.get(i(e))||b();break;case"sd-tag":customElements.get(i(e))||m();break;case"sd-text-link":customElements.get(i(e))||f()}}))};export{u as SdPopover,g as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p,H as e,c as o,h as t,t as d}from"./p-CEVDmQdt.js";import{s}from"./p-BJfiMC9H.js";import{d as
|
|
1
|
+
import{p,H as e,c as o,h as t,t as d}from"./p-CEVDmQdt.js";import{s}from"./p-BJfiMC9H.js";import{d as a}from"./p-C3rOud8J.js";import{d as i}from"./p-BnhzUsGP.js";const{popup:r}={popup:{header:{bg:{default:"#07284A",inverse:"#FFFFFF"},title:{default:"#FFFFFF",inverse:"#004290"},typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontWeight:"700",fontSize:"18",lineHeight:"30"}},footer:{bg:"#FFFFFF",paddingX:"20",paddingY:"8",gap:"16"},bg:"#EEEEEE"}},u=s.shadow.spread.md,n={bodyBg:r.bg},f={bg:{default:r.header.bg.default,light:r.header.bg.inverse},titleColor:{default:r.header.title.default,light:r.header.title.inverse},fontFamily:r.header.typography.fontFamily,fontWeight:r.header.typography.fontWeight,fontSize:Number(r.header.typography.fontSize),lineHeight:Number(r.header.typography.lineHeight),height:50,paddingX:16,paddingY:10},l={bg:r.footer.bg,paddingX:Number(r.footer.paddingX),paddingY:Number(r.footer.paddingY),gap:Number(r.footer.gap),height:52,slotHeight:36,shadow:`${u.x}px ${u.y}px ${u.blur}px ${u.spread}px ${u.color}`},h={name:"primary_md",label:"확인"},b=p(class extends e{constructor(p){super(),!1!==p&&this.__registerHost(),this.submit=o(this,"sdSubmit",7)}popupTitle="";type="default";useFooter=!0;submitButtonProps;submit;render(){const p={...h,...this.submitButtonProps};return t("div",{key:"9138fc14fe3accf97fe3a5bae4dd089d658a2198",class:"sd-popup sd-popup--"+this.type,style:{"--sd-popup-bg":n.bodyBg,"--sd-popup-header-bg":f.bg[this.type],"--sd-popup-header-title-color":f.titleColor[this.type],"--sd-popup-header-font-family":f.fontFamily,"--sd-popup-header-font-weight":f.fontWeight,"--sd-popup-header-font-size":f.fontSize+"px","--sd-popup-header-line-height":f.lineHeight+"px","--sd-popup-header-height":f.height+"px","--sd-popup-header-padding-x":f.paddingX+"px","--sd-popup-header-padding-y":f.paddingY+"px","--sd-popup-footer-bg":l.bg,"--sd-popup-footer-padding-x":l.paddingX+"px","--sd-popup-footer-padding-y":l.paddingY+"px","--sd-popup-footer-gap":l.gap+"px","--sd-popup-footer-height":l.height+"px","--sd-popup-footer-slot-height":l.slotHeight+"px","--sd-popup-footer-shadow":l.shadow}},t("header",{key:"545591be690bc16f8b78875548dcd13ffaaaa521",class:"sd-popup__header"},t("h2",{key:"2a9e959ecac6a0be2bd97019e74bee23ab0c2ecc",class:"sd-popup__title"},this.popupTitle)),t("div",{key:"f6e1053a8af7b1c87cb4adab5f8f5d51f970bc82",class:"sd-popup__body"},t("slot",{key:"9f66b2873cb0a8e7409709a400d91fc569da12b5"})),this.useFooter&&t("footer",{key:"fce908fd8f5bab94fee22184287072debce1b3ba",class:"sd-popup__footer"},t("div",{key:"c4db14ca27f56154cfb01728133bd3cdbd1ce7e7",class:"sd-popup__footer-slot sd-popup__footer-slot--left"},t("slot",{key:"7b9e920b1c322eb28de40fb2e9b02f03aa9b64e8",name:"footer-left"})),t("sd-button",{key:"87cb9bcbc9fb1657d1021609ce855118bd7c9b96",...p,class:"sd-popup__submit",onSdClick:()=>this.submit.emit()})))}static get style(){return"sd-popup{display:block;width:100%;height:100%}sd-popup .sd-popup{display:flex;flex-direction:column;width:100%;height:100%;background:var(--sd-popup-bg);overflow:hidden;box-sizing:border-box}sd-popup .sd-popup__header{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:100%;height:var(--sd-popup-header-height);padding:var(--sd-popup-header-padding-y) var(--sd-popup-header-padding-x);background:var(--sd-popup-header-bg);box-sizing:border-box}sd-popup .sd-popup__title{margin:0;color:var(--sd-popup-header-title-color);font-family:var(--sd-popup-header-font-family);font-weight:var(--sd-popup-header-font-weight);font-size:var(--sd-popup-header-font-size);line-height:var(--sd-popup-header-line-height);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-popup .sd-popup__body{flex:1 1 auto;min-height:0;overflow:auto}sd-popup .sd-popup__footer{display:flex;align-items:center;flex-shrink:0;width:100%;height:var(--sd-popup-footer-height);padding:var(--sd-popup-footer-padding-y) var(--sd-popup-footer-padding-x);gap:var(--sd-popup-footer-gap);background:var(--sd-popup-footer-bg);box-shadow:var(--sd-popup-footer-shadow);box-sizing:border-box;position:relative;z-index:1}sd-popup .sd-popup__footer-slot{display:flex;align-items:center;height:var(--sd-popup-footer-slot-height)}sd-popup .sd-popup__footer-slot--left{justify-content:flex-start;flex:1 1 auto;min-width:0}sd-popup .sd-popup__footer-slot:empty{display:none}sd-popup .sd-popup__submit{flex-shrink:0;margin-left:auto}"}},[772,"sd-popup",{popupTitle:[1,"popup-title"],type:[1],useFooter:[4,"use-footer"],submitButtonProps:[16]}]),g=b,c=function(){"undefined"!=typeof customElements&&["sd-popup","sd-button","sd-icon"].forEach((p=>{switch(p){case"sd-popup":customElements.get(d(p))||customElements.define(d(p),b);break;case"sd-button":customElements.get(d(p))||a();break;case"sd-icon":customElements.get(d(p))||i()}}))};export{g as SdPopup,c as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as s}from"./p-
|
|
1
|
+
import{S as o,d as s}from"./p-D_SxeDkS.js";const p=o,r=s;export{p as SdPortal,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as o,c as e,h as d,t as i}from"./p-CEVDmQdt.js";var r={height:"24",paddingX:"8",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},n={height:"28",paddingX:"12",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},
|
|
1
|
+
import{p as t,H as o,c as e,h as d,t as i}from"./p-CEVDmQdt.js";var r={height:"24",paddingX:"8",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},n={height:"28",paddingX:"12",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},s="4",a={width:"1",default:"#CCCCCC",select:"#0075FF",disabled:"#CCCCCC"},b={default:"#FFFFFF",hover:"#0075FF",select:"#FFFFFF",disabled:"#E1E1E1"},l={default:"#555555",hover:"#FFFFFF",select:"#0075FF",disabled:"#888888"},u={gap:"-1"};const c={xs:{height:Number(r.height),paddingX:Number(r.paddingX),fontSize:Number(r.typography.fontSize),lineHeight:Number(r.typography.lineHeight),fontWeight:r.typography.fontWeight,fontFamily:r.typography.fontFamily,textDecoration:r.typography.textDecoration},sm:{height:Number(n.height),paddingX:Number(n.paddingX),fontSize:Number(n.typography.fontSize),lineHeight:Number(n.typography.lineHeight),fontWeight:n.typography.fontWeight,fontFamily:n.typography.fontFamily,textDecoration:n.typography.textDecoration}},h=Number(s),p=Number(a.width),g=Number(u.gap),f={border:{default:a.default,select:a.select,disabled:a.disabled},bg:{default:b.default,hover:b.hover,select:b.select,disabled:b.disabled},content:{default:l.default,hover:l.hover,select:l.select,disabled:l.disabled}},m=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.change=e(this,"sdUpdate",7)}value;options=[];size="sm";disabled=!1;name;change;componentWillLoad(){this.size??="sm",this.options??=[],this.disabled??=!1}handleRadioChange=(t,o)=>{this.disabled||o||(this.value=t,this.change.emit(t))};isOptionSelected(t){return this.value===t.value}isOptionDisabled(t){return this.disabled||!!t.disabled}getButtonClasses(t){const o=["sd-radio-button__option",this.isOptionSelected(t)?"sd-radio-button__option--selected":"sd-radio-button__option--unselected"];return this.isOptionDisabled(t)&&o.push("sd-radio-button__option--disabled"),o.join(" ")}getGroupClasses(){return["sd-radio-button","sd-radio-button--"+(this.size??"sm")].join(" ")}_groupName;get groupName(){return null!=this._groupName&&""!==this._groupName||(this._groupName=null!=this.name&&""!==this.name?this.name:"sd-radio-button-"+crypto.randomUUID()),this._groupName}render(){const t=c[this.size??"sm"]??c.sm,o={"--sd-radio-button-height":t.height+"px","--sd-radio-button-padding-x":t.paddingX+"px","--sd-radio-button-font-family":t.fontFamily,"--sd-radio-button-font-weight":t.fontWeight,"--sd-radio-button-font-size":t.fontSize+"px","--sd-radio-button-line-height":t.lineHeight+"px","--sd-radio-button-text-decoration":t.textDecoration,"--sd-radio-button-radius":h+"px","--sd-radio-button-border-width":p+"px","--sd-radio-button-group-gap":g+"px","--sd-radio-button-border-default":f.border.default,"--sd-radio-button-border-select":f.border.select,"--sd-radio-button-border-disabled":f.border.disabled,"--sd-radio-button-bg-default":f.bg.default,"--sd-radio-button-bg-hover":f.bg.hover,"--sd-radio-button-bg-select":f.bg.select,"--sd-radio-button-bg-disabled":f.bg.disabled,"--sd-radio-button-content-default":f.content.default,"--sd-radio-button-content-hover":f.content.hover,"--sd-radio-button-content-select":f.content.select,"--sd-radio-button-content-disabled":f.content.disabled};return d("div",{key:"17355ebde09f652f5b94b4f70f09f68ef44cd29d",class:this.getGroupClasses(),style:o,role:"radiogroup","aria-disabled":""+this.disabled},this.options.map((t=>{const o=this.isOptionSelected(t),e=this.isOptionDisabled(t);return d("label",{key:"radio-"+t.value,class:this.getButtonClasses(t),"aria-label":t.label||"radio option","data-label":t.label},d("input",{type:"radio",name:this.groupName,value:""+t.value,checked:o,disabled:e,onInput:()=>this.handleRadioChange(t.value,t.disabled)}),t.label&&d("span",{class:"sd-radio-button__label"},t.label))})))}static get style(){return"sd-radio-button{display:inline-flex;width:fit-content;height:fit-content}.sd-radio-button{display:inline-flex;flex-flow:row nowrap;gap:0}.sd-radio-button__option{display:flex;align-items:center;justify-content:center;position:relative;box-sizing:border-box;height:var(--sd-radio-button-height);padding:0 var(--sd-radio-button-padding-x);border:var(--sd-radio-button-border-width) solid var(--sd-radio-button-border-default);background-color:var(--sd-radio-button-bg-default);color:var(--sd-radio-button-content-default);font-family:var(--sd-radio-button-font-family);font-weight:var(--sd-radio-button-font-weight);font-size:var(--sd-radio-button-font-size);line-height:var(--sd-radio-button-line-height);text-decoration:var(--sd-radio-button-text-decoration);cursor:pointer;user-select:none;-webkit-user-select:none;transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease}.sd-radio-button__option input{display:none}.sd-radio-button__option:not(:first-child){margin-left:var(--sd-radio-button-group-gap)}.sd-radio-button__option:first-child{border-top-left-radius:var(--sd-radio-button-radius);border-bottom-left-radius:var(--sd-radio-button-radius)}.sd-radio-button__option:last-child{border-top-right-radius:var(--sd-radio-button-radius);border-bottom-right-radius:var(--sd-radio-button-radius)}.sd-radio-button__option:only-child{border-radius:var(--sd-radio-button-radius)}.sd-radio-button__option--selected{background-color:var(--sd-radio-button-bg-select);border-color:var(--sd-radio-button-border-select);color:var(--sd-radio-button-content-select);z-index:1}.sd-radio-button__option:hover:not(.sd-radio-button__option--disabled){background-color:var(--sd-radio-button-bg-hover);border-color:var(--sd-radio-button-border-select);color:var(--sd-radio-button-content-hover);z-index:2}.sd-radio-button__option--disabled{background-color:var(--sd-radio-button-bg-disabled);border-color:var(--sd-radio-button-border-disabled);color:var(--sd-radio-button-content-disabled);cursor:not-allowed}.sd-radio-button__label{user-select:none;-webkit-user-select:none}"}},[512,"sd-radio-button",{value:[1032],options:[1040],size:[1],disabled:[4],name:[1]}]),v=m,_=function(){"undefined"!=typeof customElements&&["sd-radio-button"].forEach((t=>{"sd-radio-button"===t&&(customElements.get(i(t))||customElements.define(i(t),m))}))};export{v as SdRadioButton,_ as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as s}from"./p-
|
|
1
|
+
import{S as o,d as s}from"./p-DNRm9_Bv.js";const m=o,p=s;export{m as SdRadioGroup,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as s}from"./p-
|
|
1
|
+
import{S as o,d as s}from"./p-CBXH-GWN.js";const p=o,r=s;export{p as SdRadio,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as
|
|
1
|
+
import{S as o,d as p}from"./p-CNwoxvpg.js";const s=o,r=p;export{s as SdSelectListItemSearch,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as s}from"./p-
|
|
1
|
+
import{S as o,d as s}from"./p-CtNDxhxx.js";const t=o,x=s;export{t as SdSelectListItem,x as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as s}from"./p-
|
|
1
|
+
import{S as o,d as s}from"./p-BZUlNC0d.js";const p=o,r=s;export{p as SdSelectListbox,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as
|
|
1
|
+
import{S as o,d as s}from"./p-PMD-Col0.js";const p=o,r=s;export{p as SdSelectTrigger,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as o,d as
|
|
1
|
+
import{S as o,d as r}from"./p-fzFFhJlr.js";const s=o,p=r;export{s as SdSelect,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as s,H as t,c as i,h as
|
|
1
|
+
import{p as s,H as t,c as i,h as e,t as d}from"./p-CEVDmQdt.js";var c="20",a="2",h="9999",o={size:"16",default:"#FFFFFF",disabled:"#EEEEEE"},n={on:"#0075FF",off:"#CCCCCC",disabled:{on:"#BBDAFF",off:"#E1E1E1"}},r={typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontWeight:"500",fontSize:"12",textDecoration:"none",lineHeight:"20"}},w="6";const l=Number("32"),b=Number(c),f=Number(a),g=Number(h),k=Number(o.size),p=Number(w),u={knobDefault:o.default,knobDisabled:o.disabled,bgOn:n.on,bgOff:n.off,bgDisabledOn:n.disabled.on,bgDisabledOff:n.disabled.off},m={fontFamily:r.typography.fontFamily,fontWeight:r.typography.fontWeight,fontSize:Number(r.typography.fontSize),lineHeight:Number(r.typography.lineHeight),textDecoration:r.typography.textDecoration},v=s(class extends t{constructor(s){super(),!1!==s&&this.__registerHost(),this.change=i(this,"sdUpdate",7)}value=!1;label="";disabled=!1;change;get switchClasses(){const s=["sd-switch",this.value?"sd-switch--on":"sd-switch--off"];return this.disabled&&s.push("sd-switch--disabled"),s.join(" ")}handleChange=()=>{if(this.disabled)return;const s=!this.value;this.value=s,this.change.emit(s)};render(){return e("label",{key:"f63559e7ee0523e475e26e80bc568d9b79f03c2a","aria-label":this.label||"switch",class:this.switchClasses,style:{"--sd-switch-track-width":l+"px","--sd-switch-track-height":b+"px","--sd-switch-track-padding":f+"px","--sd-switch-track-radius":g+"px","--sd-switch-knob-size":k+"px","--sd-switch-knob-offset":l-k-2*f+"px","--sd-switch-knob-default":u.knobDefault,"--sd-switch-knob-disabled":u.knobDisabled,"--sd-switch-bg-on":u.bgOn,"--sd-switch-bg-off":u.bgOff,"--sd-switch-bg-disabled-on":u.bgDisabledOn,"--sd-switch-bg-disabled-off":u.bgDisabledOff,"--sd-switch-gap":p+"px","--sd-switch-font-family":m.fontFamily,"--sd-switch-font-weight":m.fontWeight,"--sd-switch-font-size":m.fontSize+"px","--sd-switch-line-height":m.lineHeight+"px","--sd-switch-text-decoration":m.textDecoration}},e("input",{key:"f1d0697ba500514923aeb6d514761641e34e6080",type:"checkbox",checked:this.value,disabled:this.disabled,onInput:this.handleChange}),e("div",{key:"988ccaf702365c76c76e11246e5de7035509cfa0",class:"sd-switch__track"},e("div",{key:"5a413a7e89054f5f93821f098f4d3173c09ce180",class:"sd-switch__knob"})),this.label&&e("span",{key:"b1674d9039d0d1e9dc9c01525fc2e6b97c139ed1",class:"sd-switch__label"},this.label))}static get style(){return"sd-switch{display:inline-block;line-height:0}sd-switch .sd-switch{cursor:pointer;display:inline-flex;align-items:center;gap:var(--sd-switch-gap)}sd-switch .sd-switch>input{display:none}sd-switch .sd-switch__track{position:relative;width:var(--sd-switch-track-width);height:var(--sd-switch-track-height);border-radius:var(--sd-switch-track-radius);background:var(--sd-switch-bg-off);transition:background-color 0.2s ease}sd-switch .sd-switch__knob{position:absolute;top:var(--sd-switch-track-padding);left:var(--sd-switch-track-padding);width:var(--sd-switch-knob-size);height:var(--sd-switch-knob-size);border-radius:50%;background:var(--sd-switch-knob-default);box-shadow:0 2px 4px rgba(0, 0, 0, 0.16);transition:transform 0.2s ease}sd-switch .sd-switch__label{font-family:var(--sd-switch-font-family);font-weight:var(--sd-switch-font-weight);font-size:var(--sd-switch-font-size);line-height:var(--sd-switch-line-height);text-decoration:var(--sd-switch-text-decoration)}sd-switch .sd-switch--on .sd-switch__track{background:var(--sd-switch-bg-on)}sd-switch .sd-switch--on .sd-switch__knob{transform:translateX(var(--sd-switch-knob-offset))}sd-switch .sd-switch--disabled{cursor:not-allowed}sd-switch .sd-switch--disabled .sd-switch__knob{background:var(--sd-switch-knob-disabled)}sd-switch .sd-switch--disabled.sd-switch--on .sd-switch__track{background:var(--sd-switch-bg-disabled-on)}sd-switch .sd-switch--disabled.sd-switch--off .sd-switch__track{background:var(--sd-switch-bg-disabled-off)}"}},[512,"sd-switch",{value:[1028],label:[1],disabled:[4]}]),y=v,_=function(){"undefined"!=typeof customElements&&["sd-switch"].forEach((s=>{"sd-switch"===s&&(customElements.get(d(s))||customElements.define(d(s),v))}))};export{y as SdSwitch,_ as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,e as i,f as a,h as n,d as h,t as o}from"./p-CEVDmQdt.js";import{T as r}from"./p-sZMi_32I.js";import{T as l,a as d,b as c,c as u,d as b}from"./p-Cmg10jpN.js";import{d as g}from"./p-C3rOud8J.js";import{d as f}from"./p-D3dq5pt5.js";import{d as p}from"./p-Dn93jl-w.js";import{d as m}from"./p-BFMUpKa2.js";import{d as y}from"./p-BJMpxQSk.js";import{d as w}from"./p-BdFwmTyS.js";import{d as C}from"./p-BnhzUsGP.js";import{d as S}from"./p-DgZ_vzrA.js";import{d as v}from"./p-ChwRSZ6R.js";import{d as k}from"./p-BDm6daTX.js";import{d as x}from"./p-BwgUEhOa.js";import{d as _}from"./p-DfKZyde8.js";import{d as R}from"./p-IMWw_SJ1.js";import{d as P}from"./p-iORPryb0.js";import{d as E}from"./p-CGJ1L8_Y.js";import{d as M}from"./p-4I0LJNSg.js";import{d as I}from"./p-C_g09O6z.js";import{d as A}from"./p-CpBPNHYe.js";import{d as j}from"./p-CaQ-qyG-.js";let T=(t=21)=>{let e="",s=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&s[t]];return e};const L=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.sdSelectChange=s(this,"sdSelectChange",7),this.sdPageChange=s(this,"sdPageChange",7),this.sdRowsPerPageChange=s(this,"sdRowsPerPageChange",7),this.sdVirtualUpdate=s(this,"sdVirtualUpdate",7),this.sdVirtualReachEnd=s(this,"sdVirtualReachEnd",7)}static DEFAULT_NO_DATA_LABEL="데이터가 없습니다.";get el(){return this}tableId=T(8);fallbackTableId=T(8);columns=[];rows;selected=[];rowKey="id";selectable=!1;resizable=!1;width;height;stickyHeader=!1;stickyColumn={left:0,right:0};radius="default";noDataLabel=t.DEFAULT_NO_DATA_LABEL;resolvedNoDataLabel=t.DEFAULT_NO_DATA_LABEL;isLoading=!1;pagination;useInternalPagination=!1;useRowsPerPageSelect=!1;dense=!1;useVirtualScroll=!1;rowHeight;get effectiveRowHeight(){return null!=this.rowHeight?this.rowHeight:Number(this.dense?l.dense.height:l.default.height)}virtualBuffer=5;virtualEndThreshold=10;rowsPerPageOption=[{label:"10개씩 보기",value:10},{label:"25개씩 보기",value:25},{label:"50개씩 보기",value:50},{label:"100개씩 보기",value:100}];sdSelectChange;sdPageChange;sdRowsPerPageChange;sdVirtualUpdate;sdVirtualReachEnd;currentPage=1;innerRowsPerPage=10;innerSelected=new Set;columnWidths=[];scrolledLeft=!1;scrolledRight=!1;rowCount=0;loadingScrollTop=0;noDataBodyHeight=60;autoThead=!1;autoTbody=!1;vsStart=0;vsEnd=0;lastReachEndNotifiedRowCount=-1;scrollContainer=null;noDataContentEl=null;noDataContentResizeObserver;onScroll;spanRegistry=new Map;useFrameRegistry=new Map;cellClassRegistry=new Map;rowIndexMap=new Map;rebuildRowIndexMap(){if(this.rowIndexMap.clear(),!Array.isArray(this.rows))return;const t=this.rowKey;this.rows.forEach(((e,s)=>{const i=e?.[t];null!=i&&this.rowIndexMap.set(i+"",s)}))}resolveRowIndex(t){const e=this.rowIndexMap.get(t);if(void 0!==e)return e;const s=Number(t);return Number.isFinite(s)?s:null}toFiniteNumber(t,e){const s="number"==typeof t?t:Number(t);return Number.isFinite(s)?s:e}isRowsPerPageValue(t){return null===t||"string"==typeof t||"number"==typeof t}isValidTableId(t){return"string"==typeof t&&t.trim().length>0&&"undefined"!==t&&"null"!==t}getResolvedTableId(){if(this.isValidTableId(this.tableId))return this.tableId;const t=this.el?.getAttribute(r);return this.isValidTableId(t)?t:this.fallbackTableId}syncTableIdAttribute(){const t=this.getResolvedTableId();this.el?.getAttribute(r)!==t&&this.el.setAttribute(r,t)}handleIsLoadingChange(t){t&&(this.loadingScrollTop=this.scrollContainer?.scrollTop??0),this.syncNoDataContentObserver()}handleUseVirtualScrollChange(t){t&&i((()=>this.propagateVirtualUpdate()))}handleColumnsChange(t){this.columnWidths=t.map((t=>t.autoWidth?0:parseInt(t.width||"120",10))),this.refreshChildrenConfig()}handleRowsChange(t){Array.isArray(t)&&(this.rowCount=t.length,this.rebuildRowIndexMap(),this.useVirtualScroll&&this.propagateVirtualUpdate(!0),this.pushRowsToChildren(t),this.syncNoDataContentObserver())}handleRowKeyChange(){this.rebuildRowIndexMap()}handleTableIdChange(){this.syncTableIdAttribute()}handleNoDataLabelChange(e){this.resolvedNoDataLabel="string"==typeof e&&e.trim().length>0&&"undefined"!==e&&"null"!==e?e:t.DEFAULT_NO_DATA_LABEL}handleConfigChange(){this.refreshChildrenConfig()}handleSelectedChange(t){this.innerSelected=new Set(t)}handlePaginationChange(t){null!=t?.page&&t.page!==this.currentPage&&(this.currentPage=t.page),null!=t?.rowsPerPage&&t.rowsPerPage!==this.innerRowsPerPage&&(this.innerRowsPerPage=t.rowsPerPage)}detectChildren(){const t=!!this.el.querySelector(":scope > sd-thead"),e=!!this.el.querySelector(":scope > sd-tbody");this.autoThead=!t,this.autoTbody=!e}componentWillLoad(){this.syncTableIdAttribute(),this.handleNoDataLabelChange(this.noDataLabel),this.detectChildren(),this.innerSelected=new Set(this.selected||[]),this.columnWidths=(this.columns||[]).map((t=>t.autoWidth?0:parseInt(t.width||"120",10))),this.rebuildRowIndexMap(),null!=this.pagination?.page&&(this.currentPage=this.pagination.page),null!=this.pagination?.rowsPerPage&&(this.innerRowsPerPage=this.pagination.rowsPerPage);const t=this.el;t.isRowSelectedSync=this.isRowSelectedSync.bind(this),t.updateRowSelectSync=this.updateRowSelectSync.bind(this),t.toggleSelectAllSync=this.toggleSelectAllSync.bind(this),t.getIsAllCheckedSync=this.getIsAllCheckedSync.bind(this),t.getStickyStyleSync=this.getStickyStyleSync.bind(this),t.setRowCountSync=this.setRowCountSync.bind(this),t.handleResize=this.handleResize.bind(this),t.getPaginationInfoSync=this.getPaginationInfoSync.bind(this),t.getVirtualScrollRangeSync=this.getVirtualScrollRangeSync.bind(this),t.getConfigSync=this.getConfigSync.bind(this),t.getTableIdSync=()=>this.getResolvedTableId(),t.getVirtualScrollConfigSync=this.getVirtualScrollConfigSync.bind(this),t.calculateVisibleRange=this.calculateVisibleRange.bind(this),t.registerSpanSync=this.registerSpanSync.bind(this),t.unregisterSpanSync=this.unregisterSpanSync.bind(this),t.getSpanSync=this.getSpanSync.bind(this),t.isCoveredSync=this.isCoveredSync.bind(this),t.hasRowspanSync=this.hasRowspanSync.bind(this),t.registerCellClassSync=this.registerCellClassSync.bind(this),t.unregisterCellClassSync=this.unregisterCellClassSync.bind(this),t.getCellClassSync=this.getCellClassSync.bind(this),t.registerUseFrameSync=this.registerUseFrameSync.bind(this),t.unregisterUseFrameSync=this.unregisterUseFrameSync.bind(this),t.hasUseFrameInRowSync=this.hasUseFrameInRowSync.bind(this),t.isCellUseFrameSync=this.isCellUseFrameSync.bind(this),Array.isArray(this.rows)&&(this.rowCount=this.rows.length,this.pushRowsToChildren(this.rows))}componentDidLoad(){Array.isArray(this.rows)&&this.pushRowsToChildren(this.rows),i((()=>{const t=this.el.shadowRoot?.querySelector(".sd-table__scroll-container");if(!t)return;let e=!1;this.onScroll=()=>{const s=t.scrollLeft,i=s>0,a=s+t.clientWidth<t.scrollWidth;this.scrolledLeft===i&&this.scrolledRight===a||(this.scrolledLeft=i,this.scrolledRight=a,this.refreshChildrenConfig()),this.useVirtualScroll&&!e&&(e=!0,requestAnimationFrame((()=>{e=!1,this.propagateVirtualUpdate()})))},this.scrollContainer=t,t.addEventListener("scroll",this.onScroll,{passive:!0}),this.onScroll(),this.useVirtualScroll&&this.propagateVirtualUpdate()})),this.syncNoDataContentObserver()}disconnectedCallback(){this.scrollContainer&&this.onScroll&&this.scrollContainer.removeEventListener("scroll",this.onScroll),this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=void 0}syncNoDataContentObserver(){if(0!==this.rowCount||this.isLoading)return this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=void 0,void(this.noDataBodyHeight=60);this.observeNoDataContentHeight()}observeNoDataContentHeight(){if("undefined"==typeof ResizeObserver)return;const t=this.noDataContentEl;t&&(this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=new ResizeObserver((()=>{const e=Math.max(60,Math.ceil(t.scrollHeight));e!==this.noDataBodyHeight&&(this.noDataBodyHeight=e)})),this.noDataContentResizeObserver.observe(t),i((()=>{if(!this.noDataContentEl)return;const t=Math.max(60,Math.ceil(this.noDataContentEl.scrollHeight));t!==this.noDataBodyHeight&&(this.noDataBodyHeight=t)})))}queryChildEl(t){return this.el.querySelector(t)??this.el.shadowRoot?.querySelector(t)??null}queryAllTr(){return[...Array.from(this.el.querySelectorAll("sd-tr")),...Array.from(this.el.shadowRoot?.querySelectorAll("sd-tr")??[])]}pushRowsToChildren(t){const e=this.queryChildEl("sd-tbody");e&&(e.rows=t);const s=this.queryChildEl("sd-thead");s&&(s.rows=t)}handleStructureSlotChange=()=>{Array.isArray(this.rows)&&this.pushRowsToChildren(this.rows),this.refreshChildrenConfig()};refreshChildrenSelection(){const t=this.queryChildEl("sd-thead");t?.refreshSelection?.(),this.queryAllTr().forEach((t=>t.refreshSelection?.()))}refreshChildrenConfig(){const t=this.queryChildEl("sd-thead");t?.refreshConfig?.(),this.queryAllTr().forEach((t=>t.refreshConfig?.()))}maybeEmitVirtualReachEnd(t,e){const s=Math.max(1,this.virtualEndThreshold);e>=Math.max(0,this.rowCount-s)&&this.lastReachEndNotifiedRowCount!==this.rowCount&&(this.lastReachEndNotifiedRowCount=this.rowCount,this.sdVirtualReachEnd.emit({from:t,to:e,rowCount:this.rowCount,threshold:s}))}propagateVirtualUpdate(t=!1){if(!this.scrollContainer||!this.useVirtualScroll)return;const e=this.toFiniteNumber(this.scrollContainer.scrollTop,0),s=this.toFiniteNumber(this.scrollContainer.clientHeight,0),{start:i,end:a}=this.calculateVisibleRange(e,s);if(!Number.isFinite(i)||!Number.isFinite(a))return;const n=this.vsStart!==i||this.vsEnd!==a;if(!n&&!t)return;this.vsStart=i,this.vsEnd=a;const h=i*this.effectiveRowHeight,o=Math.max(0,(this.rowCount-a)*this.effectiveRowHeight),r=this.queryChildEl("sd-tbody");r?.setSpacersSync?.(h,o),n&&this.sdVirtualUpdate.emit({from:i,to:a}),this.maybeEmitVirtualReachEnd(i,a)}getVirtualScrollConfigSync(){return{useVirtualScroll:this.useVirtualScroll,rowHeight:this.effectiveRowHeight,virtualBuffer:this.virtualBuffer,vsStart:this.vsStart,vsEnd:this.vsEnd,rowCount:this.rowCount}}getConfigSync(){return{columns:this.columns,selectable:this.selectable,resizable:this.resizable,stickyColumn:this.stickyColumn,stickyHeader:this.stickyHeader,scrolledLeft:this.scrolledLeft,scrolledRight:this.scrolledRight,columnWidths:this.columnWidths,dense:this.dense}}registerUseFrameSync(t,e){if(null==t||""===e)return;let s=this.useFrameRegistry.get(t);s||(s=new Set,this.useFrameRegistry.set(t,s)),s.add(e)}unregisterUseFrameSync(t,e){if(null==t||""===e)return;const s=this.useFrameRegistry.get(t);s&&(s.delete(e),0===s.size&&this.useFrameRegistry.delete(t))}hasUseFrameInRowSync(t){const e=this.useFrameRegistry.get(t);return null!=e&&e.size>0}isCellUseFrameSync(t,e){return this.useFrameRegistry.get(t)?.has(e)??!1}isRowSelectedSync(t){return Array.from(this.innerSelected).some((e=>e[this.rowKey??"id"]===t[this.rowKey??"id"]))}async isRowSelected(t){return this.isRowSelectedSync(t)}updateRowSelectSync(t){const e=Array.from(this.innerSelected),s=this.isRowSelectedSync(t)?e.filter((e=>e[this.rowKey??"id"]!==t[this.rowKey??"id"])):[...e,t];s.length!==e.length&&(this.innerSelected=new Set(s),this.selected=Array.from(this.innerSelected),this.sdSelectChange.emit(Array.from(this.innerSelected)),this.refreshChildrenSelection())}async updateRowSelect(t){this.updateRowSelectSync(t)}toggleSelectAllSync(t,e){if(t){const t=new Set([...e]);this.innerSelected=new Set([...this.innerSelected,...t])}else{const t=e.map((t=>t[this.rowKey??"id"]));this.innerSelected=new Set([...this.innerSelected].filter((e=>!t.includes(e[this.rowKey??"id"]))))}this.selected=Array.from(this.innerSelected),this.sdSelectChange.emit(Array.from(this.innerSelected)),this.refreshChildrenSelection()}async toggleSelectAll(t,e){this.toggleSelectAllSync(t,e)}getIsAllCheckedSync(t){const e=t.length,s=t.filter((t=>Array.from(this.innerSelected).some((e=>e[this.rowKey??"id"]===t[this.rowKey??"id"])))).length;return 0!==s&&(s===e||null)}async getIsAllChecked(t){return this.getIsAllCheckedSync(t)}changePage(t){this.useInternalPagination?(this.currentPage=t,this.sdPageChange.emit(this.currentPage),this.updateRowsVisibility()):this.sdPageChange.emit(t)}updateRowsVisibility(){this.queryAllTr().forEach((t=>t.updateVisibility?.()))}changeRowsPerPage(t){const e=null!=t&&""!==t?Number(t):0;if(!this.useInternalPagination)return void this.sdRowsPerPageChange.emit(e);this.innerRowsPerPage=e;const s=Math.max(1,Math.ceil(this.rowCount/e));this.currentPage>s&&(this.currentPage=s),this.sdRowsPerPageChange.emit(e),this.updateRowsVisibility()}get lastPageNumber(){if(this.useInternalPagination)return Math.max(1,Math.ceil(this.rowCount/this.innerRowsPerPage));const{lastPage:t,rowsPerPage:e=10}=this.pagination||{};return t??Math.max(1,Math.ceil(this.rowCount/e))}handleResize(t,e,s=!1){if("undefined"==typeof document)return;const i=e.clientX,a=this.columnWidths[t],n=e=>{const n=this.columns[t];if(null==n)return;const h=n.maxWidth||9999,o=e.clientX-i,r=Math.min(Math.max(a+(s?-o:o),n.minWidth||50),h);this.columnWidths=this.columnWidths.map(((e,s)=>s===t?r:e));const l=this.queryChildEl("sd-thead");l?.setColumnWidths?.(this.columnWidths),this.queryAllTr().forEach((t=>t.setColumnWidths?.(this.columnWidths)));const d=this.stickyColumn?.right||0,c=this.columns.filter((t=>!1!==t.visible)).length;d>0&&t===c-d&&requestAnimationFrame((()=>{this.onScroll?.()}))},h=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",h)}getStickyStyleSync(t){const e=this.columnWidths.slice(0,t).reduce(((t,e)=>t+e),this.selectable?d:0),s=this.columnWidths.filter(((e,s)=>s>=this.columns.filter((t=>!1!==t.visible)).length-(this.stickyColumn?.right||0)&&s>t)).reduce(((t,e)=>t+e),0),i=this.columns.filter((t=>!1!==t.visible))[t],a={"--sticky-left-offset":e+"px","--sticky-right-offset":s+"px"};return i?.autoWidth||(a.width=this.columnWidths[t]+"px",a.minWidth=this.columnWidths[t]+"px",a.maxWidth=this.columnWidths[t]+"px"),a}async getStickyStyle(t){return this.getStickyStyleSync(t)}spanKey(t,e){return`${t}::${e}`}requestAllTrUpdate(){this.queryAllTr().forEach((t=>{"function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():a(t)}))}registerSpanSync(t,e,s,i){if(null==t||""===e)return;const a=Math.max(1,Math.floor(s||1)),n=Math.max(1,Math.floor(i||1)),h=this.spanKey(t,e),o=this.spanRegistry.get(h);if(1===a&&1===n){if(!o)return;return this.spanRegistry.delete(h),void this.requestAllTrUpdate()}o&&o.rowspan===a&&o.colspan===n||(this.spanRegistry.set(h,{rowspan:a,colspan:n}),this.requestAllTrUpdate())}unregisterSpanSync(t,e){if(null==t||""===e)return;const s=this.spanKey(t,e);this.spanRegistry.has(s)&&(this.spanRegistry.delete(s),this.requestAllTrUpdate())}getSpanSync(t,e){return this.spanRegistry.get(this.spanKey(t,e))}registerCellClassSync(t,e,s){if(null==t||""===e)return;const i=this.spanKey(t,e),a=(s??"").trim();""!==a?this.cellClassRegistry.set(i,a):this.cellClassRegistry.delete(i)}unregisterCellClassSync(t,e){null!=t&&""!==e&&this.cellClassRegistry.delete(this.spanKey(t,e))}getCellClassSync(t,e){return this.cellClassRegistry.get(this.spanKey(t,e))}hasRowspanSync(){for(const t of this.spanRegistry.values())if(t.rowspan>1)return!0;return!1}isCoveredSync(t,e,s){if(0===this.spanRegistry.size)return!1;const i=s.filter((t=>!1!==t.visible));for(let s=0;s<e;s++){const a=i[s];if(null==a)continue;const n=this.spanRegistry.get(this.spanKey(t,"string"==typeof a.field?a.field:a.name));if(n&&s+n.colspan>e)return!0}const a=this.resolveRowIndex(t);if(null==a)return!1;for(const[t,s]of this.spanRegistry){if(s.rowspan<=1)continue;const n=t.indexOf("::");if(n<0)continue;const h=t.slice(0,n),o=t.slice(n+2),r=this.resolveRowIndex(h);if(null==r)continue;if(r>=a)continue;if(r+s.rowspan<=a)continue;const l=i.findIndex((t=>("string"==typeof t.field?t.field:t.name)===o));if(!(l<0)&&l<=e&&l+s.colspan>e)return!0}return!1}setRowCountSync(t){const e=Math.max(0,Math.floor(this.toFiniteNumber(t,0)));e!==this.rowCount&&(this.lastReachEndNotifiedRowCount=-1),this.rowCount=e,this.useVirtualScroll&&this.propagateVirtualUpdate(!0)}async setRowCount(t){this.setRowCountSync(t)}calculateVisibleRange(t,e){const s=Math.max(1,this.toFiniteNumber(this.effectiveRowHeight,40)),i=Math.max(0,Math.floor(this.toFiniteNumber(this.virtualBuffer,5))),a=Math.max(0,this.toFiniteNumber(t,0)),n=Math.max(0,this.toFiniteNumber(e,0)),h=Math.max(0,Math.floor(this.toFiniteNumber(this.rowCount,0))),o=Math.floor(a/s),r=Math.ceil(n/s);return{start:Math.max(0,o-i),end:Math.min(h,o+r+i)}}getPaginationInfoSync(){if(!this.useInternalPagination||!this.pagination)return null;const t=(this.currentPage-1)*this.innerRowsPerPage;return{startIndex:t,endIndex:t+this.innerRowsPerPage,currentPage:this.currentPage,rowsPerPage:this.innerRowsPerPage}}async getPaginationInfo(){return this.getPaginationInfoSync()}getVirtualScrollRangeSync(){return this.useVirtualScroll&&this.vsEnd>0?{from:this.vsStart,to:this.vsEnd}:null}renderAutoRows(){if(this.useVirtualScroll)return null;const t=this.rows??[],e=this.getPaginationInfoSync(),s=e?.startIndex??0;return(e?t.slice(e.startIndex,e.endIndex):t).map(((t,e)=>{const i=s+e;return n("sd-tr",{key:i,"row-key":i+"",row:t})}))}get tableClasses(){return["sd-table",this.stickyHeader&&"sd-table--sticky-header",this.selectable&&"sd-table--selectable",this.resizable&&"sd-table--resizable",(this.selectable||(this.stickyColumn?.left??0)>0||(this.stickyColumn?.right??0)>0)&&"sd-table--sticky-column",this.scrolledLeft&&"sd-table--scrolled-left",this.scrolledRight&&"sd-table--scrolled-right",0===this.rowCount&&!this.isLoading&&"sd-table--no-data"].filter(Boolean).join(" ")}render(){const t=this.getResolvedTableId(),e=0===this.rowCount&&!this.isLoading,s=36+this.noDataBodyHeight;return n(h,{key:"2606b0d7fc3657a8021a6dfc64672996b756f762",style:{"--table-radius":b+"px","--table-border-color":u.color,"--table-border-width":u.width+"px","--table-body-font-family":c.fontFamily,"--table-body-font-weight":c.fontWeight,"--table-body-font-size":c.fontSize+"px","--table-body-line-height":c.lineHeight+"px","--table-body-text-decoration":c.textDecoration,"--table-selectable-width":d+"px","--table-host-height":e?void 0!==this.height?`max(${this.height}, ${s}px)`:`max(${s}px, 100%)`:this.height??"100%"}},n("div",{key:"4def416edfe630ead35b80cb2f04081a89740f62",class:"sd-table__container",style:{"--table-width":this.width,"--pagination-height":(this.pagination&&this.rowCount>0&&!this.useVirtualScroll?48:0)+"px"}},n("div",{key:"316a359f2be84895719f452e056dcd2f54cd5b56",class:{"sd-table__wrapper":!0,"sd-table__wrapper--radius-useTop":"useTop"===this.radius,"sd-table__wrapper--radius-full":"full"===this.radius}},n("div",{key:"e798b58104f56b3250a7d74261a8c320a8049f28",class:{"sd-table__scroll-container":!0,"sd-table__scroll-container--loading":this.isLoading,"sd-table__scroll-container--no-data":e}},this.isLoading&&n("div",{key:"af91877075c8d4ed8b608bdfdc7f04bd844f5574",class:"sd-table__loading",style:{top:this.loadingScrollTop+"px"}},n("sd-circle-progress",{key:"2422c7020046fa468dbaaf34220230737cb6b02e",indeterminate:!0})),e&&n(n.Fragment,null,n("div",{key:"bd5c2237d8c3a34cc4bf12a187f471e22ce02efd",class:"sd-table__no-data-header-overlay"}),n("div",{key:"1e0da67564879a175e89a3482195742b1b4451dc",class:"sd-table__no-data"},n("div",{key:"391bc76e748d64b84c39de669396b2f5f288e5a1",class:"sd-table__no-data-content",ref:t=>{this.noDataContentEl=t,t&&this.syncNoDataContentObserver()}},n("slot",{key:"3e2e26f4951d9b834ae811906c137a78067fecab",name:"no-data"},n("span",{key:"54ed0371d60f5312376d8ffab50efd9ec0947729"},this.resolvedNoDataLabel))))),n("table",{key:"46cab11834ca3f5aa9010bd6f603d301b2a54c9c",class:this.tableClasses},this.autoThead?n("slot",{name:t+"-head",onSlotchange:this.handleStructureSlotChange},n("sd-thead",{rows:this.rows??[]})):n("slot",{name:t+"-head",onSlotchange:this.handleStructureSlotChange}),this.autoTbody?n("slot",{name:t+"-body",onSlotchange:this.handleStructureSlotChange},n("sd-tbody",{rows:this.rows??[]},this.renderAutoRows())):n("slot",{name:t+"-body",onSlotchange:this.handleStructureSlotChange})))),this.pagination&&this.pagination.rowsPerPage>0&&this.rowCount>0&&!this.useVirtualScroll&&n("div",{key:"b9c738172d4e2993f15f6a7e051406d3b7e8d568",class:"sd-table__pagination"},n("sd-pagination",{key:"62c199e61dd2010f2c19aabb3599d75a561ef83d",currentPage:this.useInternalPagination?this.currentPage:this.pagination.page,lastPage:this.useInternalPagination?this.lastPageNumber:this.pagination.lastPage,onSdPageChange:t=>this.changePage(t.detail)}),this.useRowsPerPageSelect&&n("sd-select",{key:"5f305858818e720bf5a53499777d2f5aac843487",value:this.useInternalPagination?this.innerRowsPerPage:this.pagination.rowsPerPage,options:this.rowsPerPageOption,width:"128px",emitValue:!0,onSdUpdate:t=>{this.isRowsPerPageValue(t.detail)&&this.changeRowsPerPage(t.detail)}}))))}static get watchers(){return{isLoading:[{handleIsLoadingChange:0}],useVirtualScroll:[{handleUseVirtualScrollChange:0}],columns:[{handleColumnsChange:0}],rows:[{handleRowsChange:0}],rowKey:[{handleRowKeyChange:0}],tableId:[{handleTableIdChange:0}],noDataLabel:[{handleNoDataLabelChange:0}],selectable:[{handleConfigChange:0}],resizable:[{handleConfigChange:0}],stickyColumn:[{handleConfigChange:0}],stickyHeader:[{handleConfigChange:0}],dense:[{handleConfigChange:0}],selected:[{handleSelectedChange:0}],pagination:[{handlePaginationChange:0}]}}static get style(){return"sd-table,:host{display:block;width:100%;height:var(--table-host-height);max-width:100%;min-width:0}sd-table *,:host *{box-sizing:border-box}.sd-table__container{height:100%;width:var(--table-width, 100%);max-width:100%;min-width:0;color:#222222;display:flex;flex-direction:column}.sd-table__wrapper{width:100%;min-width:0;height:calc(100% - var(--pagination-height, 0px));border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);border-radius:var(--table-radius, 8px);overflow:hidden}.sd-table__wrapper--radius-useTop{border-radius:0 0 var(--table-radius, 8px) var(--table-radius, 8px)}.sd-table__wrapper--radius-full{border-radius:0}.sd-table__scroll-container{width:100%;height:100%;display:flex;flex-direction:column;position:relative;font-family:var(--table-body-font-family, inherit);font-weight:var(--table-body-font-weight, 400);font-size:var(--table-body-font-size, 12px);line-height:var(--table-body-line-height, 20px);text-decoration:var(--table-body-text-decoration, none);overflow:auto;background:#FFFFFF}.sd-table__scroll-container--loading{overflow:hidden !important;pointer-events:none}.sd-table__scroll-container--no-data{overflow:hidden;pointer-events:none}.sd-table__no-data{position:absolute;top:36px;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;font-size:var(--table-body-font-size, 12px);color:#888888;pointer-events:none;z-index:200;background:rgba(255, 255, 255, 0.6)}.sd-table__no-data-header-overlay{position:absolute;top:0;left:0;right:0;height:36px;background:rgba(255, 255, 255, 0.6);z-index:210;pointer-events:none}.sd-table__no-data-content{pointer-events:auto;min-height:60px;width:100%;display:flex;align-items:center;justify-content:center}.sd-table__loading{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(255, 255, 255, 0.6);z-index:200;display:flex;align-items:center;justify-content:center;pointer-events:none}.sd-table{background-color:white;display:table;width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.sd-table--selectable sd-thead,.sd-table--selectable sd-tbody{--selectable:true}.sd-table--sticky-header sd-thead thead{position:sticky;top:0;z-index:120}.sd-table--sticky-column sd-thead,.sd-table--sticky-column sd-tbody{--sticky-column:true}.sd-table--scrolled-left sd-thead,.sd-table--scrolled-left sd-tbody{--scrolled-left:true}.sd-table--scrolled-right sd-thead,.sd-table--scrolled-right sd-tbody{--scrolled-right:true}.sd-table--resizable sd-thead{--resizable:true}.sd-table--no-data sd-thead{opacity:0.4}.sd-table__pagination{position:relative;background:#F9F9F9;height:48px;display:flex;align-items:center;justify-content:center;border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);margin-top:-1px;border-radius:var(--table-radius, 8px)}.sd-table__pagination sd-select{position:absolute;right:10px;top:50%;transform:translateY(-50%)}"}},[769,"sd-table",{tableId:[513,"table-id"],columns:[16],rows:[16],selected:[1040],rowKey:[1,"row-key"],selectable:[4],resizable:[4],width:[1],height:[1],stickyHeader:[4,"sticky-header"],stickyColumn:[16],radius:[1],noDataLabel:[1,"no-data-label"],isLoading:[4,"is-loading"],pagination:[16],useInternalPagination:[4,"use-internal-pagination"],useRowsPerPageSelect:[4,"use-rows-per-page-select"],dense:[4],useVirtualScroll:[4,"use-virtual-scroll"],rowHeight:[2,"row-height"],virtualBuffer:[2,"virtual-buffer"],virtualEndThreshold:[2,"virtual-end-threshold"],rowsPerPageOption:[16],resolvedNoDataLabel:[32],currentPage:[32],innerRowsPerPage:[32],innerSelected:[32],columnWidths:[32],scrolledLeft:[32],scrolledRight:[32],rowCount:[32],loadingScrollTop:[32],noDataBodyHeight:[32],autoThead:[32],autoTbody:[32],isRowSelected:[64],updateRowSelect:[64],toggleSelectAll:[64],getIsAllChecked:[64],getStickyStyle:[64],setRowCount:[64],getPaginationInfo:[64]},void 0,{isLoading:[{handleIsLoadingChange:0}],useVirtualScroll:[{handleUseVirtualScrollChange:0}],columns:[{handleColumnsChange:0}],rows:[{handleRowsChange:0}],rowKey:[{handleRowKeyChange:0}],tableId:[{handleTableIdChange:0}],noDataLabel:[{handleNoDataLabelChange:0}],selectable:[{handleConfigChange:0}],resizable:[{handleConfigChange:0}],stickyColumn:[{handleConfigChange:0}],stickyHeader:[{handleConfigChange:0}],dense:[{handleConfigChange:0}],selected:[{handleSelectedChange:0}],pagination:[{handlePaginationChange:0}]}]),z=L,D=function(){"undefined"!=typeof customElements&&["sd-table","sd-button","sd-checkbox","sd-circle-progress","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-pagination","sd-portal","sd-select","sd-select-list-item","sd-select-list-item-search","sd-select-listbox","sd-select-trigger","sd-tag","sd-tbody","sd-thead","sd-tooltip","sd-tr"].forEach((t=>{switch(t){case"sd-table":customElements.get(o(t))||customElements.define(o(t),L);break;case"sd-button":customElements.get(o(t))||g();break;case"sd-checkbox":customElements.get(o(t))||f();break;case"sd-circle-progress":customElements.get(o(t))||p();break;case"sd-field":customElements.get(o(t))||m();break;case"sd-floating-portal":customElements.get(o(t))||y();break;case"sd-ghost-button":customElements.get(o(t))||w();break;case"sd-icon":customElements.get(o(t))||C();break;case"sd-pagination":customElements.get(o(t))||S();break;case"sd-portal":customElements.get(o(t))||v();break;case"sd-select":customElements.get(o(t))||k();break;case"sd-select-list-item":customElements.get(o(t))||x();break;case"sd-select-list-item-search":customElements.get(o(t))||_();break;case"sd-select-listbox":customElements.get(o(t))||R();break;case"sd-select-trigger":customElements.get(o(t))||P();break;case"sd-tag":customElements.get(o(t))||E();break;case"sd-tbody":customElements.get(o(t))||M();break;case"sd-thead":customElements.get(o(t))||I();break;case"sd-tooltip":customElements.get(o(t))||A();break;case"sd-tr":customElements.get(o(t))||j()}}))};export{z as SdTable,D as defineCustomElement}
|
|
1
|
+
import{p as t,H as e,c as s,e as i,f as a,h as n,d as h,t as o}from"./p-CEVDmQdt.js";import{T as r}from"./p-sZMi_32I.js";import{T as l,a as d,b as c,c as u,d as b}from"./p-Cmg10jpN.js";import{d as g}from"./p-C3rOud8J.js";import{d as f}from"./p-D3dq5pt5.js";import{d as p}from"./p-D6noGX38.js";import{d as m}from"./p-BtVuPyhl.js";import{d as y}from"./p-DMvWCQfX.js";import{d as C}from"./p-C4_oeGm-.js";import{d as w}from"./p-BnhzUsGP.js";import{d as S}from"./p-BoH7ykYx.js";import{d as v}from"./p-D_SxeDkS.js";import{d as k}from"./p-fzFFhJlr.js";import{d as x}from"./p-CtNDxhxx.js";import{d as _}from"./p-CNwoxvpg.js";import{d as R}from"./p-BZUlNC0d.js";import{d as P}from"./p-PMD-Col0.js";import{d as E}from"./p-D8T1XeGP.js";import{d as M}from"./p-B8uvCE1e.js";import{d as A}from"./p-DyfR6eGl.js";import{d as I}from"./p-C-Cje7aS.js";import{d as j}from"./p-CaQ-qyG-.js";let D=(t=21)=>{let e="",s=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&s[t]];return e};const T=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.sdSelectChange=s(this,"sdSelectChange",7),this.sdPageChange=s(this,"sdPageChange",7),this.sdRowsPerPageChange=s(this,"sdRowsPerPageChange",7),this.sdVirtualUpdate=s(this,"sdVirtualUpdate",7),this.sdVirtualReachEnd=s(this,"sdVirtualReachEnd",7)}static DEFAULT_NO_DATA_LABEL="데이터가 없습니다.";get el(){return this}tableId=D(8);fallbackTableId=D(8);columns=[];rows;selected=[];rowKey="id";selectable=!1;resizable=!1;width;height;stickyHeader=!1;stickyColumn={left:0,right:0};radius="default";noDataLabel=t.DEFAULT_NO_DATA_LABEL;resolvedNoDataLabel=t.DEFAULT_NO_DATA_LABEL;isLoading=!1;pagination;useInternalPagination=!1;useRowsPerPageSelect=!1;dense=!1;useVirtualScroll=!1;rowHeight;get effectiveRowHeight(){return null!=this.rowHeight?this.rowHeight:Number(this.dense?l.dense.height:l.default.height)}virtualBuffer=5;virtualEndThreshold=10;rowsPerPageOption=[{label:"10개씩 보기",value:10},{label:"25개씩 보기",value:25},{label:"50개씩 보기",value:50},{label:"100개씩 보기",value:100}];sdSelectChange;sdPageChange;sdRowsPerPageChange;sdVirtualUpdate;sdVirtualReachEnd;currentPage=1;innerRowsPerPage=10;innerSelected=new Set;columnWidths=[];scrolledLeft=!1;scrolledRight=!1;rowCount=0;loadingScrollTop=0;noDataBodyHeight=60;autoThead=!1;autoTbody=!1;vsStart=0;vsEnd=0;lastReachEndNotifiedRowCount=-1;scrollContainer=null;noDataContentEl=null;noDataContentResizeObserver;onScroll;spanRegistry=new Map;useFrameRegistry=new Map;cellClassRegistry=new Map;rowIndexMap=new Map;rebuildRowIndexMap(){if(this.rowIndexMap.clear(),!Array.isArray(this.rows))return;const t=this.rowKey;this.rows.forEach(((e,s)=>{const i=e?.[t];null!=i&&this.rowIndexMap.set(i+"",s)}))}resolveRowIndex(t){const e=this.rowIndexMap.get(t);if(void 0!==e)return e;const s=Number(t);return Number.isFinite(s)?s:null}toFiniteNumber(t,e){const s="number"==typeof t?t:Number(t);return Number.isFinite(s)?s:e}isRowsPerPageValue(t){return null===t||"string"==typeof t||"number"==typeof t}isValidTableId(t){return"string"==typeof t&&t.trim().length>0&&"undefined"!==t&&"null"!==t}getResolvedTableId(){if(this.isValidTableId(this.tableId))return this.tableId;const t=this.el?.getAttribute(r);return this.isValidTableId(t)?t:this.fallbackTableId}syncTableIdAttribute(){const t=this.getResolvedTableId();this.el?.getAttribute(r)!==t&&this.el.setAttribute(r,t)}handleIsLoadingChange(t){t&&(this.loadingScrollTop=this.scrollContainer?.scrollTop??0),this.syncNoDataContentObserver()}handleUseVirtualScrollChange(t){t&&i((()=>this.propagateVirtualUpdate()))}handleColumnsChange(t){this.columnWidths=t.map((t=>t.autoWidth?0:parseInt(t.width||"120",10))),this.refreshChildrenConfig()}handleRowsChange(t){Array.isArray(t)&&(this.rowCount=t.length,this.rebuildRowIndexMap(),this.useVirtualScroll&&this.propagateVirtualUpdate(!0),this.pushRowsToChildren(t),this.syncNoDataContentObserver())}handleRowKeyChange(){this.rebuildRowIndexMap()}handleTableIdChange(){this.syncTableIdAttribute()}handleNoDataLabelChange(e){this.resolvedNoDataLabel="string"==typeof e&&e.trim().length>0&&"undefined"!==e&&"null"!==e?e:t.DEFAULT_NO_DATA_LABEL}handleConfigChange(){this.refreshChildrenConfig()}handleSelectedChange(t){this.innerSelected=new Set(t)}handlePaginationChange(t){null!=t?.page&&t.page!==this.currentPage&&(this.currentPage=t.page),null!=t?.rowsPerPage&&t.rowsPerPage!==this.innerRowsPerPage&&(this.innerRowsPerPage=t.rowsPerPage)}detectChildren(){const t=!!this.el.querySelector(":scope > sd-thead"),e=!!this.el.querySelector(":scope > sd-tbody");this.autoThead=!t,this.autoTbody=!e}componentWillLoad(){this.syncTableIdAttribute(),this.handleNoDataLabelChange(this.noDataLabel),this.detectChildren(),this.innerSelected=new Set(this.selected||[]),this.columnWidths=(this.columns||[]).map((t=>t.autoWidth?0:parseInt(t.width||"120",10))),this.rebuildRowIndexMap(),null!=this.pagination?.page&&(this.currentPage=this.pagination.page),null!=this.pagination?.rowsPerPage&&(this.innerRowsPerPage=this.pagination.rowsPerPage);const t=this.el;t.isRowSelectedSync=this.isRowSelectedSync.bind(this),t.updateRowSelectSync=this.updateRowSelectSync.bind(this),t.toggleSelectAllSync=this.toggleSelectAllSync.bind(this),t.getIsAllCheckedSync=this.getIsAllCheckedSync.bind(this),t.getStickyStyleSync=this.getStickyStyleSync.bind(this),t.setRowCountSync=this.setRowCountSync.bind(this),t.handleResize=this.handleResize.bind(this),t.getPaginationInfoSync=this.getPaginationInfoSync.bind(this),t.getVirtualScrollRangeSync=this.getVirtualScrollRangeSync.bind(this),t.getConfigSync=this.getConfigSync.bind(this),t.getTableIdSync=()=>this.getResolvedTableId(),t.getVirtualScrollConfigSync=this.getVirtualScrollConfigSync.bind(this),t.calculateVisibleRange=this.calculateVisibleRange.bind(this),t.registerSpanSync=this.registerSpanSync.bind(this),t.unregisterSpanSync=this.unregisterSpanSync.bind(this),t.getSpanSync=this.getSpanSync.bind(this),t.isCoveredSync=this.isCoveredSync.bind(this),t.hasRowspanSync=this.hasRowspanSync.bind(this),t.registerCellClassSync=this.registerCellClassSync.bind(this),t.unregisterCellClassSync=this.unregisterCellClassSync.bind(this),t.getCellClassSync=this.getCellClassSync.bind(this),t.registerUseFrameSync=this.registerUseFrameSync.bind(this),t.unregisterUseFrameSync=this.unregisterUseFrameSync.bind(this),t.hasUseFrameInRowSync=this.hasUseFrameInRowSync.bind(this),t.isCellUseFrameSync=this.isCellUseFrameSync.bind(this),Array.isArray(this.rows)&&(this.rowCount=this.rows.length,this.pushRowsToChildren(this.rows))}componentDidLoad(){Array.isArray(this.rows)&&this.pushRowsToChildren(this.rows),i((()=>{const t=this.el.shadowRoot?.querySelector(".sd-table__scroll-container");if(!t)return;let e=!1;this.onScroll=()=>{const s=t.scrollLeft,i=s>0,a=s+t.clientWidth<t.scrollWidth;this.scrolledLeft===i&&this.scrolledRight===a||(this.scrolledLeft=i,this.scrolledRight=a,this.refreshChildrenConfig()),this.useVirtualScroll&&!e&&(e=!0,requestAnimationFrame((()=>{e=!1,this.propagateVirtualUpdate()})))},this.scrollContainer=t,t.addEventListener("scroll",this.onScroll,{passive:!0}),this.onScroll(),this.useVirtualScroll&&this.propagateVirtualUpdate()})),this.syncNoDataContentObserver()}disconnectedCallback(){this.scrollContainer&&this.onScroll&&this.scrollContainer.removeEventListener("scroll",this.onScroll),this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=void 0}syncNoDataContentObserver(){if(0!==this.rowCount||this.isLoading)return this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=void 0,void(this.noDataBodyHeight=60);this.observeNoDataContentHeight()}observeNoDataContentHeight(){if("undefined"==typeof ResizeObserver)return;const t=this.noDataContentEl;t&&(this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=new ResizeObserver((()=>{const e=Math.max(60,Math.ceil(t.scrollHeight));e!==this.noDataBodyHeight&&(this.noDataBodyHeight=e)})),this.noDataContentResizeObserver.observe(t),i((()=>{if(!this.noDataContentEl)return;const t=Math.max(60,Math.ceil(this.noDataContentEl.scrollHeight));t!==this.noDataBodyHeight&&(this.noDataBodyHeight=t)})))}queryChildEl(t){return this.el.querySelector(t)??this.el.shadowRoot?.querySelector(t)??null}queryAllTr(){return[...Array.from(this.el.querySelectorAll("sd-tr")),...Array.from(this.el.shadowRoot?.querySelectorAll("sd-tr")??[])]}pushRowsToChildren(t){const e=this.queryChildEl("sd-tbody");e&&(e.rows=t);const s=this.queryChildEl("sd-thead");s&&(s.rows=t)}handleStructureSlotChange=()=>{Array.isArray(this.rows)&&this.pushRowsToChildren(this.rows),this.refreshChildrenConfig()};refreshChildrenSelection(){const t=this.queryChildEl("sd-thead");t?.refreshSelection?.(),this.queryAllTr().forEach((t=>t.refreshSelection?.()))}refreshChildrenConfig(){const t=this.queryChildEl("sd-thead");t?.refreshConfig?.(),this.queryAllTr().forEach((t=>t.refreshConfig?.()))}maybeEmitVirtualReachEnd(t,e){const s=Math.max(1,this.virtualEndThreshold);e>=Math.max(0,this.rowCount-s)&&this.lastReachEndNotifiedRowCount!==this.rowCount&&(this.lastReachEndNotifiedRowCount=this.rowCount,this.sdVirtualReachEnd.emit({from:t,to:e,rowCount:this.rowCount,threshold:s}))}propagateVirtualUpdate(t=!1){if(!this.scrollContainer||!this.useVirtualScroll)return;const e=this.toFiniteNumber(this.scrollContainer.scrollTop,0),s=this.toFiniteNumber(this.scrollContainer.clientHeight,0),{start:i,end:a}=this.calculateVisibleRange(e,s);if(!Number.isFinite(i)||!Number.isFinite(a))return;const n=this.vsStart!==i||this.vsEnd!==a;if(!n&&!t)return;this.vsStart=i,this.vsEnd=a;const h=i*this.effectiveRowHeight,o=Math.max(0,(this.rowCount-a)*this.effectiveRowHeight),r=this.queryChildEl("sd-tbody");r?.setSpacersSync?.(h,o),n&&this.sdVirtualUpdate.emit({from:i,to:a}),this.maybeEmitVirtualReachEnd(i,a)}getVirtualScrollConfigSync(){return{useVirtualScroll:this.useVirtualScroll,rowHeight:this.effectiveRowHeight,virtualBuffer:this.virtualBuffer,vsStart:this.vsStart,vsEnd:this.vsEnd,rowCount:this.rowCount}}getConfigSync(){return{columns:this.columns,selectable:this.selectable,resizable:this.resizable,stickyColumn:this.stickyColumn,stickyHeader:this.stickyHeader,scrolledLeft:this.scrolledLeft,scrolledRight:this.scrolledRight,columnWidths:this.columnWidths,dense:this.dense}}registerUseFrameSync(t,e){if(null==t||""===e)return;let s=this.useFrameRegistry.get(t);s||(s=new Set,this.useFrameRegistry.set(t,s)),s.add(e)}unregisterUseFrameSync(t,e){if(null==t||""===e)return;const s=this.useFrameRegistry.get(t);s&&(s.delete(e),0===s.size&&this.useFrameRegistry.delete(t))}hasUseFrameInRowSync(t){const e=this.useFrameRegistry.get(t);return null!=e&&e.size>0}isCellUseFrameSync(t,e){return this.useFrameRegistry.get(t)?.has(e)??!1}isRowSelectedSync(t){return Array.from(this.innerSelected).some((e=>e[this.rowKey??"id"]===t[this.rowKey??"id"]))}async isRowSelected(t){return this.isRowSelectedSync(t)}updateRowSelectSync(t){const e=Array.from(this.innerSelected),s=this.isRowSelectedSync(t)?e.filter((e=>e[this.rowKey??"id"]!==t[this.rowKey??"id"])):[...e,t];s.length!==e.length&&(this.innerSelected=new Set(s),this.selected=Array.from(this.innerSelected),this.sdSelectChange.emit(Array.from(this.innerSelected)),this.refreshChildrenSelection())}async updateRowSelect(t){this.updateRowSelectSync(t)}toggleSelectAllSync(t,e){if(t){const t=new Set([...e]);this.innerSelected=new Set([...this.innerSelected,...t])}else{const t=e.map((t=>t[this.rowKey??"id"]));this.innerSelected=new Set([...this.innerSelected].filter((e=>!t.includes(e[this.rowKey??"id"]))))}this.selected=Array.from(this.innerSelected),this.sdSelectChange.emit(Array.from(this.innerSelected)),this.refreshChildrenSelection()}async toggleSelectAll(t,e){this.toggleSelectAllSync(t,e)}getIsAllCheckedSync(t){const e=t.length,s=t.filter((t=>Array.from(this.innerSelected).some((e=>e[this.rowKey??"id"]===t[this.rowKey??"id"])))).length;return 0!==s&&(s===e||null)}async getIsAllChecked(t){return this.getIsAllCheckedSync(t)}changePage(t){this.useInternalPagination?(this.currentPage=t,this.sdPageChange.emit(this.currentPage),this.updateRowsVisibility()):this.sdPageChange.emit(t)}updateRowsVisibility(){this.queryAllTr().forEach((t=>t.updateVisibility?.()))}changeRowsPerPage(t){const e=null!=t&&""!==t?Number(t):0;if(!this.useInternalPagination)return void this.sdRowsPerPageChange.emit(e);this.innerRowsPerPage=e;const s=Math.max(1,Math.ceil(this.rowCount/e));this.currentPage>s&&(this.currentPage=s),this.sdRowsPerPageChange.emit(e),this.updateRowsVisibility()}get lastPageNumber(){if(this.useInternalPagination)return Math.max(1,Math.ceil(this.rowCount/this.innerRowsPerPage));const{lastPage:t,rowsPerPage:e=10}=this.pagination||{};return t??Math.max(1,Math.ceil(this.rowCount/e))}handleResize(t,e,s=!1){if("undefined"==typeof document)return;const i=e.clientX,a=this.columnWidths[t],n=e=>{const n=this.columns[t];if(null==n)return;const h=n.maxWidth||9999,o=e.clientX-i,r=Math.min(Math.max(a+(s?-o:o),n.minWidth||50),h);this.columnWidths=this.columnWidths.map(((e,s)=>s===t?r:e));const l=this.queryChildEl("sd-thead");l?.setColumnWidths?.(this.columnWidths),this.queryAllTr().forEach((t=>t.setColumnWidths?.(this.columnWidths)));const d=this.stickyColumn?.right||0,c=this.columns.filter((t=>!1!==t.visible)).length;d>0&&t===c-d&&requestAnimationFrame((()=>{this.onScroll?.()}))},h=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",h)}getStickyStyleSync(t){const e=this.columnWidths.slice(0,t).reduce(((t,e)=>t+e),this.selectable?d:0),s=this.columnWidths.filter(((e,s)=>s>=this.columns.filter((t=>!1!==t.visible)).length-(this.stickyColumn?.right||0)&&s>t)).reduce(((t,e)=>t+e),0),i=this.columns.filter((t=>!1!==t.visible))[t],a={"--sticky-left-offset":e+"px","--sticky-right-offset":s+"px"};return i?.autoWidth||(a.width=this.columnWidths[t]+"px",a.minWidth=this.columnWidths[t]+"px",a.maxWidth=this.columnWidths[t]+"px"),a}async getStickyStyle(t){return this.getStickyStyleSync(t)}spanKey(t,e){return`${t}::${e}`}requestAllTrUpdate(){this.queryAllTr().forEach((t=>{"function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():a(t)}))}registerSpanSync(t,e,s,i){if(null==t||""===e)return;const a=Math.max(1,Math.floor(s||1)),n=Math.max(1,Math.floor(i||1)),h=this.spanKey(t,e),o=this.spanRegistry.get(h);if(1===a&&1===n){if(!o)return;return this.spanRegistry.delete(h),void this.requestAllTrUpdate()}o&&o.rowspan===a&&o.colspan===n||(this.spanRegistry.set(h,{rowspan:a,colspan:n}),this.requestAllTrUpdate())}unregisterSpanSync(t,e){if(null==t||""===e)return;const s=this.spanKey(t,e);this.spanRegistry.has(s)&&(this.spanRegistry.delete(s),this.requestAllTrUpdate())}getSpanSync(t,e){return this.spanRegistry.get(this.spanKey(t,e))}registerCellClassSync(t,e,s){if(null==t||""===e)return;const i=this.spanKey(t,e),a=(s??"").trim();""!==a?this.cellClassRegistry.set(i,a):this.cellClassRegistry.delete(i)}unregisterCellClassSync(t,e){null!=t&&""!==e&&this.cellClassRegistry.delete(this.spanKey(t,e))}getCellClassSync(t,e){return this.cellClassRegistry.get(this.spanKey(t,e))}hasRowspanSync(){for(const t of this.spanRegistry.values())if(t.rowspan>1)return!0;return!1}isCoveredSync(t,e,s){if(0===this.spanRegistry.size)return!1;const i=s.filter((t=>!1!==t.visible));for(let s=0;s<e;s++){const a=i[s];if(null==a)continue;const n=this.spanRegistry.get(this.spanKey(t,"string"==typeof a.field?a.field:a.name));if(n&&s+n.colspan>e)return!0}const a=this.resolveRowIndex(t);if(null==a)return!1;for(const[t,s]of this.spanRegistry){if(s.rowspan<=1)continue;const n=t.indexOf("::");if(n<0)continue;const h=t.slice(0,n),o=t.slice(n+2),r=this.resolveRowIndex(h);if(null==r)continue;if(r>=a)continue;if(r+s.rowspan<=a)continue;const l=i.findIndex((t=>("string"==typeof t.field?t.field:t.name)===o));if(!(l<0)&&l<=e&&l+s.colspan>e)return!0}return!1}setRowCountSync(t){const e=Math.max(0,Math.floor(this.toFiniteNumber(t,0)));e!==this.rowCount&&(this.lastReachEndNotifiedRowCount=-1),this.rowCount=e,this.useVirtualScroll&&this.propagateVirtualUpdate(!0)}async setRowCount(t){this.setRowCountSync(t)}calculateVisibleRange(t,e){const s=Math.max(1,this.toFiniteNumber(this.effectiveRowHeight,40)),i=Math.max(0,Math.floor(this.toFiniteNumber(this.virtualBuffer,5))),a=Math.max(0,this.toFiniteNumber(t,0)),n=Math.max(0,this.toFiniteNumber(e,0)),h=Math.max(0,Math.floor(this.toFiniteNumber(this.rowCount,0))),o=Math.floor(a/s),r=Math.ceil(n/s);return{start:Math.max(0,o-i),end:Math.min(h,o+r+i)}}getPaginationInfoSync(){if(!this.useInternalPagination||!this.pagination)return null;const t=(this.currentPage-1)*this.innerRowsPerPage;return{startIndex:t,endIndex:t+this.innerRowsPerPage,currentPage:this.currentPage,rowsPerPage:this.innerRowsPerPage}}async getPaginationInfo(){return this.getPaginationInfoSync()}getVirtualScrollRangeSync(){return this.useVirtualScroll&&this.vsEnd>0?{from:this.vsStart,to:this.vsEnd}:null}renderAutoRows(){if(this.useVirtualScroll)return null;const t=this.rows??[],e=this.getPaginationInfoSync(),s=e?.startIndex??0;return(e?t.slice(e.startIndex,e.endIndex):t).map(((t,e)=>{const i=s+e;return n("sd-tr",{key:i,"row-key":i+"",row:t})}))}get tableClasses(){return["sd-table",this.stickyHeader&&"sd-table--sticky-header",this.selectable&&"sd-table--selectable",this.resizable&&"sd-table--resizable",(this.selectable||(this.stickyColumn?.left??0)>0||(this.stickyColumn?.right??0)>0)&&"sd-table--sticky-column",this.scrolledLeft&&"sd-table--scrolled-left",this.scrolledRight&&"sd-table--scrolled-right",0===this.rowCount&&!this.isLoading&&"sd-table--no-data"].filter(Boolean).join(" ")}render(){const t=this.getResolvedTableId(),e=0===this.rowCount&&!this.isLoading,s=36+this.noDataBodyHeight;return n(h,{key:"288633055ee4be465a96964b11d6c032fecd603f",style:{"--table-radius":b+"px","--table-border-color":u.color,"--table-border-width":u.width+"px","--table-body-font-family":c.fontFamily,"--table-body-font-weight":c.fontWeight,"--table-body-font-size":c.fontSize+"px","--table-body-line-height":c.lineHeight+"px","--table-body-text-decoration":c.textDecoration,"--table-selectable-width":d+"px","--table-host-height":e?void 0!==this.height?`max(${this.height}, ${s}px)`:`max(${s}px, 100%)`:this.height??"100%"}},n("div",{key:"ab9878f8515bddc3058aafb1806310677fc9f360",class:"sd-table__container",style:{"--table-width":this.width,"--pagination-height":(this.pagination&&this.rowCount>0&&!this.useVirtualScroll?48:0)+"px"}},n("div",{key:"9f7f16a5cbf27f32a2209586f5b2604066bba4b4",class:{"sd-table__wrapper":!0,"sd-table__wrapper--radius-useTop":"useTop"===this.radius,"sd-table__wrapper--radius-full":"full"===this.radius}},n("div",{key:"c16e48a6dc55ddcf398a7053a93d6e1595fc83da",class:{"sd-table__scroll-container":!0,"sd-table__scroll-container--loading":this.isLoading,"sd-table__scroll-container--no-data":e}},this.isLoading&&n("div",{key:"1bc3cd25cbd34d912aee00dc43ad961f442a8d2a",class:"sd-table__loading",style:{top:this.loadingScrollTop+"px"}},n("sd-circle-progress",{key:"3c157990784d6f9e58fef6ff0e6b36ffd87d3a0d",indeterminate:!0})),e&&n(n.Fragment,null,n("div",{key:"ebb3e4560cc9729d496110e4f159a25737e26bca",class:"sd-table__no-data-header-overlay"}),n("div",{key:"c9b02b2aef01542a2fe5be0578d31ce72566bff6",class:"sd-table__no-data"},n("div",{key:"6ab6d9b90ef703b4865eedbf19deff2a04e9d278",class:"sd-table__no-data-content",ref:t=>{this.noDataContentEl=t,t&&this.syncNoDataContentObserver()}},n("slot",{key:"072b90261f1a0817ccc20d8d5d5346bdcd223304",name:"no-data"},n("span",{key:"bbef2b4c13f8cf7736f02b11d149fe00af3cb567"},this.resolvedNoDataLabel))))),n("table",{key:"2d7beab7b8fd42f5bfc4b2b5c9538e6cd7a08b2a",class:this.tableClasses},this.autoThead?n("slot",{name:t+"-head",onSlotchange:this.handleStructureSlotChange},n("sd-thead",{rows:this.rows??[]})):n("slot",{name:t+"-head",onSlotchange:this.handleStructureSlotChange}),this.autoTbody?n("slot",{name:t+"-body",onSlotchange:this.handleStructureSlotChange},n("sd-tbody",{rows:this.rows??[]},this.renderAutoRows())):n("slot",{name:t+"-body",onSlotchange:this.handleStructureSlotChange})))),this.pagination&&this.pagination.rowsPerPage>0&&this.rowCount>0&&!this.useVirtualScroll&&n("div",{key:"ee81359d024a466a2730c2e7df7a4a0f2b319de3",class:"sd-table__pagination"},n("sd-pagination",{key:"069c72080181324d82c9ef207398e11d7766cb34",currentPage:this.useInternalPagination?this.currentPage:this.pagination.page,lastPage:this.useInternalPagination?this.lastPageNumber:this.pagination.lastPage,onSdPageChange:t=>this.changePage(t.detail)}),this.useRowsPerPageSelect&&n("sd-select",{key:"ce1798a0c99cff78318087d25bfc1ece86993e4a",value:this.useInternalPagination?this.innerRowsPerPage:this.pagination.rowsPerPage,options:this.rowsPerPageOption,width:"128px",emitValue:!0,onSdUpdate:t=>{this.isRowsPerPageValue(t.detail)&&this.changeRowsPerPage(t.detail)}}))))}static get watchers(){return{isLoading:[{handleIsLoadingChange:0}],useVirtualScroll:[{handleUseVirtualScrollChange:0}],columns:[{handleColumnsChange:0}],rows:[{handleRowsChange:0}],rowKey:[{handleRowKeyChange:0}],tableId:[{handleTableIdChange:0}],noDataLabel:[{handleNoDataLabelChange:0}],selectable:[{handleConfigChange:0}],resizable:[{handleConfigChange:0}],stickyColumn:[{handleConfigChange:0}],stickyHeader:[{handleConfigChange:0}],dense:[{handleConfigChange:0}],selected:[{handleSelectedChange:0}],pagination:[{handlePaginationChange:0}]}}static get style(){return"sd-table,:host{display:block;width:100%;height:var(--table-host-height);max-width:100%;min-width:0}sd-table *,:host *{box-sizing:border-box}.sd-table__container{height:100%;width:var(--table-width, 100%);max-width:100%;min-width:0;color:#222222;display:flex;flex-direction:column}.sd-table__wrapper{width:100%;min-width:0;height:calc(100% - var(--pagination-height, 0px));border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);border-radius:var(--table-radius, 8px);overflow:hidden}.sd-table__wrapper--radius-useTop{border-radius:0 0 var(--table-radius, 8px) var(--table-radius, 8px)}.sd-table__wrapper--radius-full{border-radius:0}.sd-table__scroll-container{width:100%;height:100%;display:flex;flex-direction:column;position:relative;font-family:var(--table-body-font-family, inherit);font-weight:var(--table-body-font-weight, 400);font-size:var(--table-body-font-size, 12px);line-height:var(--table-body-line-height, 20px);text-decoration:var(--table-body-text-decoration, none);overflow:auto;background:#FFFFFF}.sd-table__scroll-container--loading{overflow:hidden !important;pointer-events:none}.sd-table__scroll-container--no-data{overflow:hidden;pointer-events:none}.sd-table__no-data{position:absolute;top:36px;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;font-size:var(--table-body-font-size, 12px);color:#888888;pointer-events:none;z-index:200;background:rgba(255, 255, 255, 0.6)}.sd-table__no-data-header-overlay{position:absolute;top:0;left:0;right:0;height:36px;background:rgba(255, 255, 255, 0.6);z-index:210;pointer-events:none}.sd-table__no-data-content{pointer-events:auto;min-height:60px;width:100%;display:flex;align-items:center;justify-content:center}.sd-table__loading{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(255, 255, 255, 0.6);z-index:200;display:flex;align-items:center;justify-content:center;pointer-events:none}.sd-table{background-color:white;display:table;width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.sd-table--selectable sd-thead,.sd-table--selectable sd-tbody{--selectable:true}.sd-table--sticky-header sd-thead thead{position:sticky;top:0;z-index:120}.sd-table--sticky-column sd-thead,.sd-table--sticky-column sd-tbody{--sticky-column:true}.sd-table--scrolled-left sd-thead,.sd-table--scrolled-left sd-tbody{--scrolled-left:true}.sd-table--scrolled-right sd-thead,.sd-table--scrolled-right sd-tbody{--scrolled-right:true}.sd-table--resizable sd-thead{--resizable:true}.sd-table--no-data sd-thead{opacity:0.4}.sd-table__pagination{position:relative;background:#F9F9F9;height:48px;display:flex;align-items:center;justify-content:center;border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);margin-top:-1px;border-radius:var(--table-radius, 8px)}.sd-table__pagination sd-select{position:absolute;right:10px;top:50%;transform:translateY(-50%)}"}},[769,"sd-table",{tableId:[513,"table-id"],columns:[16],rows:[16],selected:[1040],rowKey:[1,"row-key"],selectable:[4],resizable:[4],width:[1],height:[1],stickyHeader:[4,"sticky-header"],stickyColumn:[16],radius:[1],noDataLabel:[1,"no-data-label"],isLoading:[4,"is-loading"],pagination:[16],useInternalPagination:[4,"use-internal-pagination"],useRowsPerPageSelect:[4,"use-rows-per-page-select"],dense:[4],useVirtualScroll:[4,"use-virtual-scroll"],rowHeight:[2,"row-height"],virtualBuffer:[2,"virtual-buffer"],virtualEndThreshold:[2,"virtual-end-threshold"],rowsPerPageOption:[16],resolvedNoDataLabel:[32],currentPage:[32],innerRowsPerPage:[32],innerSelected:[32],columnWidths:[32],scrolledLeft:[32],scrolledRight:[32],rowCount:[32],loadingScrollTop:[32],noDataBodyHeight:[32],autoThead:[32],autoTbody:[32],isRowSelected:[64],updateRowSelect:[64],toggleSelectAll:[64],getIsAllChecked:[64],getStickyStyle:[64],setRowCount:[64],getPaginationInfo:[64]},void 0,{isLoading:[{handleIsLoadingChange:0}],useVirtualScroll:[{handleUseVirtualScrollChange:0}],columns:[{handleColumnsChange:0}],rows:[{handleRowsChange:0}],rowKey:[{handleRowKeyChange:0}],tableId:[{handleTableIdChange:0}],noDataLabel:[{handleNoDataLabelChange:0}],selectable:[{handleConfigChange:0}],resizable:[{handleConfigChange:0}],stickyColumn:[{handleConfigChange:0}],stickyHeader:[{handleConfigChange:0}],dense:[{handleConfigChange:0}],selected:[{handleSelectedChange:0}],pagination:[{handlePaginationChange:0}]}]),z=T,L=function(){"undefined"!=typeof customElements&&["sd-table","sd-button","sd-checkbox","sd-circle-progress","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-pagination","sd-portal","sd-select","sd-select-list-item","sd-select-list-item-search","sd-select-listbox","sd-select-trigger","sd-tag","sd-tbody","sd-thead","sd-tooltip","sd-tr"].forEach((t=>{switch(t){case"sd-table":customElements.get(o(t))||customElements.define(o(t),T);break;case"sd-button":customElements.get(o(t))||g();break;case"sd-checkbox":customElements.get(o(t))||f();break;case"sd-circle-progress":customElements.get(o(t))||p();break;case"sd-field":customElements.get(o(t))||m();break;case"sd-floating-portal":customElements.get(o(t))||y();break;case"sd-ghost-button":customElements.get(o(t))||C();break;case"sd-icon":customElements.get(o(t))||w();break;case"sd-pagination":customElements.get(o(t))||S();break;case"sd-portal":customElements.get(o(t))||v();break;case"sd-select":customElements.get(o(t))||k();break;case"sd-select-list-item":customElements.get(o(t))||x();break;case"sd-select-list-item-search":customElements.get(o(t))||_();break;case"sd-select-listbox":customElements.get(o(t))||R();break;case"sd-select-trigger":customElements.get(o(t))||P();break;case"sd-tag":customElements.get(o(t))||E();break;case"sd-tbody":customElements.get(o(t))||M();break;case"sd-thead":customElements.get(o(t))||A();break;case"sd-tooltip":customElements.get(o(t))||I();break;case"sd-tr":customElements.get(o(t))||j()}}))};export{z as SdTable,L as defineCustomElement}
|