@sellmate/design-system 1.18.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-badge.cjs.entry.js +1 -1
- package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
- package/dist/cjs/sd-calendar_2.cjs.entry.js +5 -5
- package/dist/cjs/sd-callout.cjs.entry.js +1 -1
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-chip-input.cjs.entry.js +29 -2
- package/dist/cjs/sd-chip.cjs.entry.js +1 -1
- package/dist/cjs/sd-circle-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-picker_7.cjs.entry.js +9 -9
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +1 -1
- package/dist/cjs/sd-divider.cjs.entry.js +1 -1
- package/dist/cjs/sd-field_3.cjs.entry.js +8 -8
- package/dist/cjs/{sd-ghost-button_2.cjs.entry.js → sd-ghost-button_3.cjs.entry.js} +264 -10
- package/dist/cjs/sd-key-value-table.cjs.entry.js +12 -6
- package/dist/cjs/sd-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-loading-container.cjs.entry.js +2 -2
- package/dist/cjs/sd-pagination_4.cjs.entry.js +8 -8
- package/dist/cjs/sd-popup.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-list-item_2.cjs.entry.js +6 -6
- package/dist/cjs/sd-select_3.cjs.entry.js +8 -8
- package/dist/cjs/sd-switch.cjs.entry.js +1 -1
- package/dist/cjs/sd-table.cjs.entry.js +10 -9
- package/dist/cjs/sd-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sd-td.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast.cjs.entry.js +2 -2
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/collection/components/sd-badge/sd-badge.js +1 -1
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +1 -1
- package/dist/collection/components/sd-calendar/sd-calendar.js +3 -3
- package/dist/collection/components/sd-callout/sd-callout.js +1 -1
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-chip/sd-chip.js +1 -1
- package/dist/collection/components/sd-chip-input/sd-chip-input.js +48 -2
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +1 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +2 -2
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
- package/dist/collection/components/sd-divider/sd-divider.js +1 -1
- package/dist/collection/components/sd-field/sd-field.js +5 -5
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.css +2 -17
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +21 -12
- package/dist/collection/components/sd-input/sd-input.js +2 -2
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.config.js +1 -0
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.css +10 -3
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.js +17 -12
- package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
- package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
- package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
- package/dist/collection/components/sd-popup/sd-popup.js +1 -1
- package/dist/collection/components/sd-portal/sd-portal.js +34 -3
- package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
- package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
- package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
- package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
- package/dist/collection/components/sd-select/sd-select.js +4 -4
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.css +4 -1
- package/dist/collection/components/sd-table/sd-table.js +15 -14
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +2 -2
- package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
- package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
- package/dist/collection/components/sd-tag/sd-tag.js +2 -2
- package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
- package/dist/collection/components/sd-toast/sd-toast.js +2 -2
- package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/components/{p-CH6cVc2a.js → p-5GcM22aW.js} +1 -1
- package/dist/components/p-B7PHGGFH.js +1 -0
- package/dist/components/{p-DMS9mQsg.js → p-BHW1fnDC.js} +1 -1
- package/dist/components/{p-B3SKaQId.js → p-BZjIn1hr.js} +1 -1
- package/dist/components/{p-CzCu_NDl.js → p-Bd-fDbVE.js} +1 -1
- package/dist/components/p-BeYMZ1fR.js +1 -0
- package/dist/components/{p-79DExV92.js → p-BuFzlA0M.js} +1 -1
- package/dist/components/{p-CQWZv8vY.js → p-BzUU-npj.js} +1 -1
- package/dist/components/p-CEhI4kUA.js +1 -0
- package/dist/components/{p-4HPAPKne.js → p-CQozoo2-.js} +1 -1
- package/dist/components/p-Cfko62rU.js +1 -0
- package/dist/components/{p-hzCGj0On.js → p-ChncPmp-.js} +1 -1
- package/dist/components/p-CiEAVQT4.js +1 -0
- package/dist/components/p-CjYYBlrZ.js +1 -0
- package/dist/components/p-CvSqieCH.js +1 -0
- package/dist/components/p-DAJIg-VD.js +1 -0
- package/dist/components/p-DRgPF0Fp.js +1 -0
- package/dist/components/p-DYOyb7rq.js +1 -0
- package/dist/components/{p-BD8OoYud.js → p-DaMzYzXI.js} +1 -1
- package/dist/components/{p-BMIgVp9-.js → p-De7UsPPk.js} +1 -1
- package/dist/components/p-Df1g_kVH.js +1 -0
- package/dist/components/p-DpfXh55-.js +1 -0
- package/dist/components/{p-B_5uwji5.js → p-E5buAge1.js} +1 -1
- package/dist/components/{p-BLNc_TL-.js → p-P2jWtk8J.js} +1 -1
- package/dist/components/{p-C_r3z9VA.js → p-lmVlfugh.js} +1 -1
- package/dist/components/p-nruUh8p1.js +1 -0
- package/dist/components/p-pSthmtsz.js +1 -0
- package/dist/components/p-vTnMooAF.js +1 -0
- package/dist/components/sd-action-modal.js +1 -1
- package/dist/components/sd-badge.js +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-calendar.js +1 -1
- package/dist/components/sd-callout.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-chip-input.js +1 -1
- package/dist/components/sd-chip.js +1 -1
- package/dist/components/sd-circle-progress.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-picker-trigger.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker-calendar.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-divider.js +1 -1
- package/dist/components/sd-dropdown-button.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-file-picker.js +1 -1
- package/dist/components/sd-floating-portal.js +1 -1
- package/dist/components/sd-ghost-button.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-key-value-table.js +1 -1
- package/dist/components/sd-linear-progress.js +1 -1
- package/dist/components/sd-loading-container.js +1 -1
- package/dist/components/sd-loading-modal.js +1 -1
- package/dist/components/sd-modal-container.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/sd-popup.js +1 -1
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-select-list-item-search.js +1 -1
- package/dist/components/sd-select-list-item.js +1 -1
- package/dist/components/sd-select-listbox.js +1 -1
- package/dist/components/sd-select-trigger.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-switch.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tabs.js +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.js +1 -1
- package/dist/components/sd-toast-container.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-80bde621.entry.js → p-08343698.entry.js} +1 -1
- package/dist/design-system/{p-bbbc4b27.entry.js → p-2151e081.entry.js} +1 -1
- package/dist/design-system/p-316b8a08.entry.js +1 -0
- package/dist/design-system/{p-f5190934.entry.js → p-4acfc5f9.entry.js} +1 -1
- package/dist/design-system/{p-22484d65.entry.js → p-5039241c.entry.js} +1 -1
- package/dist/design-system/p-52f551a1.entry.js +1 -0
- package/dist/design-system/{p-d726d8e7.entry.js → p-54853a2b.entry.js} +1 -1
- package/dist/design-system/p-5eaa12af.entry.js +1 -0
- package/dist/design-system/{p-827f067b.entry.js → p-646a7830.entry.js} +1 -1
- package/dist/design-system/p-717eba5f.entry.js +1 -0
- package/dist/design-system/{p-8f90620b.entry.js → p-9289eb14.entry.js} +1 -1
- package/dist/design-system/{p-b4b20a86.entry.js → p-98e0b332.entry.js} +1 -1
- package/dist/design-system/{p-9124a1af.entry.js → p-9c38ee79.entry.js} +1 -1
- package/dist/design-system/{p-c318b762.entry.js → p-a4331364.entry.js} +1 -1
- package/dist/design-system/{p-683c3b91.entry.js → p-a5a586da.entry.js} +1 -1
- package/dist/design-system/{p-1602a5fa.entry.js → p-aa1c6202.entry.js} +1 -1
- package/dist/design-system/{p-8a84a4fe.entry.js → p-ae344950.entry.js} +1 -1
- package/dist/design-system/p-b291baab.entry.js +1 -0
- package/dist/design-system/{p-e93dda25.entry.js → p-b63b8df9.entry.js} +1 -1
- package/dist/design-system/{p-3caf2c5b.entry.js → p-bdb7492c.entry.js} +1 -1
- package/dist/design-system/{p-cc5f5bff.entry.js → p-c47198fc.entry.js} +1 -1
- package/dist/design-system/p-c995e6c3.entry.js +1 -0
- package/dist/design-system/{p-9095aab6.entry.js → p-cb80327c.entry.js} +1 -1
- package/dist/design-system/{p-7ed5aed5.entry.js → p-ccf1a3fc.entry.js} +1 -1
- package/dist/design-system/{p-4e1d76b8.entry.js → p-df7c721d.entry.js} +1 -1
- package/dist/design-system/p-e3990243.entry.js +1 -0
- package/dist/design-system/{p-81aa23d1.entry.js → p-e9d1dbb5.entry.js} +1 -1
- package/dist/design-system/p-faf7b64c.entry.js +1 -0
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sd-badge.entry.js +1 -1
- package/dist/esm/sd-barcode-input.entry.js +1 -1
- package/dist/esm/sd-calendar_2.entry.js +5 -5
- package/dist/esm/sd-callout.entry.js +1 -1
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-chip-input.entry.js +29 -2
- package/dist/esm/sd-chip.entry.js +1 -1
- package/dist/esm/sd-circle-progress.entry.js +1 -1
- package/dist/esm/sd-confirm-modal_2.entry.js +3 -3
- package/dist/esm/sd-date-picker_7.entry.js +9 -9
- package/dist/esm/sd-date-range-picker-calendar.entry.js +1 -1
- package/dist/esm/sd-divider.entry.js +1 -1
- package/dist/esm/sd-field_3.entry.js +8 -8
- package/dist/esm/{sd-ghost-button_2.entry.js → sd-ghost-button_3.entry.js} +265 -12
- package/dist/esm/sd-key-value-table.entry.js +12 -6
- package/dist/esm/sd-linear-progress.entry.js +1 -1
- package/dist/esm/sd-loading-container.entry.js +2 -2
- package/dist/esm/sd-pagination_4.entry.js +8 -8
- package/dist/esm/sd-popup.entry.js +1 -1
- package/dist/esm/sd-select-list-item_2.entry.js +6 -6
- package/dist/esm/sd-select_3.entry.js +8 -8
- package/dist/esm/sd-switch.entry.js +1 -1
- package/dist/esm/sd-table.entry.js +10 -9
- package/dist/esm/sd-tabs.entry.js +1 -1
- package/dist/esm/sd-td.entry.js +1 -1
- package/dist/esm/sd-toast-container.entry.js +1 -1
- package/dist/esm/sd-toast.entry.js +2 -2
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/types/components/sd-chip-input/sd-chip-input.d.ts +4 -0
- package/dist/types/components/sd-ghost-button/sd-ghost-button.d.ts +7 -1
- package/dist/types/components/sd-key-value-table/sd-key-value-table.config.d.ts +1 -0
- package/dist/types/components/sd-key-value-table/sd-key-value-table.d.ts +5 -3
- package/dist/types/components/sd-portal/sd-portal.d.ts +1 -0
- package/dist/types/components/sd-table/sd-table.d.ts +1 -1
- package/dist/types/components.d.ts +35 -29
- package/hydrate/index.js +153 -101
- package/hydrate/index.mjs +153 -101
- package/package.json +3 -3
- package/dist/cjs/sd-portal.cjs.entry.js +0 -243
- package/dist/components/p-AI4YlQmL.js +0 -1
- package/dist/components/p-B-4ulKJj.js +0 -1
- package/dist/components/p-BX5uKVOt.js +0 -1
- package/dist/components/p-BYTrIk62.js +0 -1
- package/dist/components/p-Bzo51vnP.js +0 -1
- package/dist/components/p-C0tkFuhj.js +0 -1
- package/dist/components/p-C3wv8gVC.js +0 -1
- package/dist/components/p-CXRFEcE_.js +0 -1
- package/dist/components/p-Cl5io5TH.js +0 -1
- package/dist/components/p-DAOeioSV.js +0 -1
- package/dist/components/p-DTFXzlvq.js +0 -1
- package/dist/components/p-Dr5Q2ZKB.js +0 -1
- package/dist/components/p-DyVh4pNL.js +0 -1
- package/dist/components/p-Ng3JMPxb.js +0 -1
- package/dist/components/p-qJeUUOyB.js +0 -1
- package/dist/design-system/p-0a772d43.entry.js +0 -1
- package/dist/design-system/p-12306783.entry.js +0 -1
- package/dist/design-system/p-43529bba.entry.js +0 -1
- package/dist/design-system/p-46da89f2.entry.js +0 -1
- package/dist/design-system/p-8a025f91.entry.js +0 -1
- package/dist/design-system/p-a263af1b.entry.js +0 -1
- package/dist/design-system/p-a532d998.entry.js +0 -1
- package/dist/design-system/p-bcd7d358.entry.js +0 -1
- package/dist/design-system/p-ff939fbd.entry.js +0 -1
- package/dist/esm/sd-portal.entry.js +0 -241
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as a,H as e,c as d,h as n,t as r}from"./p-Bg9XySrz.js";import{u as t,t as l,W as s,C as c}from"./p-BysikR_g.js";import{d as i}from"./p-DTFXzlvq.js";import{d as o}from"./p-ClKABgST.js";import{d as h}from"./p-BMIgVp9-.js";const g=a(class extends e{constructor(a){super(),!1!==a&&this.__registerHost(),this.update=d(this,"sdUpdate",7),this.viewChange=d(this,"sdViewChange",7)}value=null;selectable;events;elevated=!1;currentYear;currentMonth;update;viewChange;dateUtil=t();_eventMapCache;get eventMap(){const a=this._eventMapCache;if(a&&a.src===this.events)return a.map;const e=new Map;return(this.events??[]).forEach((a=>a.dates.forEach((d=>{const n=e.get(d)??[];n.push({color:a.color,label:a.label}),e.set(d,n)})))),this._eventMapCache={src:this.events,map:e},e}get legendItems(){const a=new Set,e=[];return(this.events??[]).forEach((d=>{const n=`${d.color}|${d.label}`;a.has(n)||(a.add(n),e.push({color:d.color,label:d.label}))})),e}componentWillLoad(){this.syncViewFromValue()}handleValueChange(){this.syncViewFromValue()}syncViewFromValue(){const a=this.value||l,[e,d]=a.split("-").map(Number);this.currentYear=e,this.currentMonth=d}formatDate(a,e,d){return`${a}-${String(e).padStart(2,"0")}-${String(d).padStart(2,"0")}`}get cells(){const a=this.currentYear,e=this.currentMonth,d=new Date(a,e-1,1).getDay(),n=new Date(a,e,0).getDate(),r=1===e?12:e-1,t=1===e?a-1:a,l=new Date(t,r,0).getDate(),s=12===e?1:e+1,c=12===e?a+1:a,i=[];for(let a=d-1;a>=0;a--){const e=l-a;i.push({date:this.formatDate(t,r,e),day:e,inCurrentMonth:!1})}for(let d=1;d<=n;d++)i.push({date:this.formatDate(a,e,d),day:d,inCurrentMonth:!0});const o=(7-i.length%7)%7;for(let a=1;a<=o;a++)i.push({date:this.formatDate(c,s,a),day:a,inCurrentMonth:!1});return i}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=a=>{a.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=a=>{a.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=a=>{a.stopPropagation();const{newYear:e,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=e,this.currentMonth=d,this.emitViewChange()};goNextMonth=a=>{a.stopPropagation();const{newYear:e,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=e,this.currentMonth=d,this.emitViewChange()};isDisabled(a){if(!this.selectable)return!1;const[e,d]=this.selectable;return""!==e&&a<e||""!==d&&a>d}handleDayClick(a){this.isDisabled(a.date)||(this.value=a.date,this.update.emit(a.date))}render(){const a={"--calendar-bg":c.bg,"--calendar-padding":`${c.paddingXY}px`,"--calendar-gap":`${c.gap}px`,"--calendar-radius":`${c.radius}px`,"--calendar-header-gap":`${c.header.gap}px`,"--calendar-header-divider":c.header.divider,"--calendar-header-font-size":`${c.header.fontSize}px`,"--calendar-header-line-height":`${c.header.lineHeight}px`,"--calendar-header-font-weight":c.header.fontWeight,"--calendar-week-font-size":`${c.week.fontSize}px`,"--calendar-week-line-height":`${c.week.lineHeight}px`,"--calendar-week-font-weight":c.week.fontWeight,"--calendar-week-color":c.week.color,"--calendar-grid-row-gap":`${c.grid.rowGap}px`,"--calendar-day-size":`${c.day.size}px`,"--calendar-day-circle-size":`${c.day.circleSize}px`,"--calendar-day-circle-radius":`${c.day.circleRadius}px`,"--calendar-day-text":c.day.defaultText,"--calendar-day-hover-text":c.day.hoverText,"--calendar-day-hover-border":c.day.hoverBorder,"--calendar-day-select-bg":c.day.selectBg,"--calendar-day-select-text":c.day.selectText,"--calendar-day-disabled-text":c.day.disabledText,"--calendar-day-font-size":`${c.day.fontSize}px`,"--calendar-day-line-height":`${c.day.lineHeight}px`,"--calendar-day-font-weight":c.day.fontWeight,"--calendar-day-bold-font-weight":c.day.boldFontWeight,"--calendar-day-dot-size":`${c.day.dot.size}px`,"--calendar-day-dot-gap":`${c.day.dot.gap}px`,"--calendar-day-dot-padding-y":`${c.day.dot.paddingY}px`,"--calendar-legend-font-size":`${c.legend.fontSize}px`,"--calendar-legend-line-height":`${c.legend.lineHeight}px`,"--calendar-legend-font-weight":c.legend.fontWeight,"--calendar-legend-gap":`${c.legend.gap}px`,"--calendar-legend-group-gap":`${c.legend.groupGap}px`},e=this.eventMap,d=this.legendItems,r=(this.events?.length??0)>0;return n("div",{key:"e939d5fae94ff8f44bd2167abd78ac331359f35d",class:{"sd-calendar":!0,"sd-calendar--elevated":this.elevated},style:a},n("div",{key:"2dad0f6cfd58d1a4ce430142df0af56ed0a5cfa3",class:"sd-calendar__header"},n("div",{key:"5d7424dc210f3ff9fa28ee5c24e958130449b798",class:"sd-calendar__nav-group"},n("sd-ghost-button",{key:"d15c0d1691492d0bbdb099893701c2538c183513",ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),n("span",{key:"a2e936f9a4626bdd4d48bcd7b513e33f76d4affb",class:"sd-calendar__label"},this.currentYear),n("sd-ghost-button",{key:"c4c50b1a3440ef2eeb1a0ed95c61d3f5b55ba055",ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),n("span",{key:"ec677bd90799db7032f188b521c32f06688c8659",class:"sd-calendar__divider","aria-hidden":"true"}),n("div",{key:"d8ab3d1a8efa607ee6f8cd4c3af5ba2d2af31639",class:"sd-calendar__nav-group sd-calendar__nav-group-month"},n("sd-ghost-button",{key:"1a76dcd9d9655bdac72d78a8bf6c40e546c9c4a1",ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),n("span",{key:"08b4274631b31aa028f14f8d3ecd63d135c125d7",class:"sd-calendar__label sd-calendar__label-month"},this.currentMonth,"월"),n("sd-ghost-button",{key:"ec404faf07c03f7a1949d2379a1313e99b712883",ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth}))),n("div",{key:"98775d3b2d885492347dec3e13258b33936b92bc",class:"sd-calendar__week"},s.map((a=>n("span",{key:a,class:"sd-calendar__week-cell"},a)))),n("div",{key:"87a4739a0ddf26302d22bcb39b545cffab44dd09",class:"sd-calendar__grid"},this.cells.map((a=>{const d=a.inCurrentMonth&&""!==this.value&&this.value===a.date,t=a.inCurrentMonth&&l===a.date,s=a.inCurrentMonth&&this.isDisabled(a.date),c=a.inCurrentMonth?e.get(a.date):void 0;return n("button",{type:"button",key:a.date,class:{"sd-calendar__day":!0,"sd-calendar__day--empty":!a.inCurrentMonth,"sd-calendar__day--today":t,"sd-calendar__day--selected":d,"sd-calendar__day--disabled":s},disabled:!a.inCurrentMonth||s,tabindex:a.inCurrentMonth?void 0:-1,"aria-hidden":a.inCurrentMonth?void 0:"true",onClick:()=>a.inCurrentMonth&&this.handleDayClick(a)},n("span",{class:"sd-calendar__day-circle"},a.inCurrentMonth?a.day:""),r&&n("span",{class:"sd-calendar__dot-row","aria-hidden":"true"},c?.map(((a,e)=>n("span",{key:`${a.color}|${a.label}|${e}`,class:"sd-calendar__dot",style:{backgroundColor:a.color}})))))}))),d.length>0&&[n("span",{key:"9c1c21573694ca6702d19ba451c31cbdb47e727c",class:"sd-calendar__divider-bottom","aria-hidden":"true"}),n("div",{key:"dae2d35ea2971f6c7b1b3ec4774934efb2fcd168",class:"sd-calendar__legend"},d.map((a=>n("span",{key:`${a.color}|${a.label}`,class:"sd-calendar__legend-item"},n("span",{class:"sd-calendar__legend-dot",style:{backgroundColor:a.color},"aria-hidden":"true"}),n("span",{class:"sd-calendar__legend-label"},a.label)))))])}static get watchers(){return{value:[{handleValueChange:0}]}}static get style(){return"sd-calendar{display:block}sd-calendar .sd-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);width:328px;min-height:328px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);user-select:none}sd-calendar .sd-calendar--elevated{box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-calendar .sd-calendar__header{display:flex;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-calendar .sd-calendar__nav-group-month{width:100%}sd-calendar .sd-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-calendar .sd-calendar__label-month{width:100%}sd-calendar .sd-calendar__divider{display:inline-block;width:1px;height:16px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-calendar .sd-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-calendar .sd-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-calendar .sd-calendar__day{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-start;width:var(--calendar-day-size);min-height:var(--calendar-day-circle-size);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__day-circle{display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-calendar .sd-calendar__day:not(:disabled):hover .sd-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-calendar .sd-calendar__day--today .sd-calendar__day-circle{font-weight:700}sd-calendar .sd-calendar__day--selected .sd-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--selected:not(:disabled):hover .sd-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--disabled{color:var(--calendar-day-disabled-text);background:none !important;cursor:not-allowed}sd-calendar .sd-calendar__day--empty{visibility:hidden;pointer-events:none}sd-calendar .sd-calendar__dot-row{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--calendar-day-dot-gap);box-sizing:border-box;width:100%;min-height:14px;padding-top:var(--calendar-day-dot-padding-y);padding-bottom:var(--calendar-day-dot-padding-y)}sd-calendar .sd-calendar__dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%}sd-calendar .sd-calendar__divider-bottom{display:block;width:100%;height:1px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__legend{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:var(--calendar-legend-group-gap);row-gap:4px;font-size:var(--calendar-legend-font-size);line-height:var(--calendar-legend-line-height);font-weight:var(--calendar-legend-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__legend-item{display:inline-flex;align-items:center;gap:var(--calendar-legend-gap)}sd-calendar .sd-calendar__legend-dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%;flex-shrink:0}sd-calendar .sd-calendar__legend-label{display:inline-block}"}},[512,"sd-calendar",{value:[1025],selectable:[16],events:[16],elevated:[4],currentYear:[32],currentMonth:[32]},void 0,{value:[{handleValueChange:0}]}]);function p(){"undefined"!=typeof customElements&&["sd-calendar","sd-ghost-button","sd-icon","sd-tag"].forEach((a=>{switch(a){case"sd-calendar":customElements.get(r(a))||customElements.define(r(a),g);break;case"sd-ghost-button":customElements.get(r(a))||i();break;case"sd-icon":customElements.get(r(a))||o();break;case"sd-tag":customElements.get(r(a))||h()}}))}export{g as S,p as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,a as s,d as i,f as h,h as a,H as n}from"./p-CAxodB5I.js";import{T as r}from"./p-sZMi_32I.js";import{T as l,a as o,b as d,c,d as u}from"./p-Cmg10jpN.js";import"./p-D6GUzecR.js";import"./p-BJfiMC9H.js";let b=(t=21)=>{let e="",s=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&s[t]];return e};const g=class{constructor(s){t(this,s),this.sdSelectChange=e(this,"sdSelectChange",7),this.sdPageChange=e(this,"sdPageChange",7),this.sdRowsPerPageChange=e(this,"sdRowsPerPageChange",7),this.sdVirtualUpdate=e(this,"sdVirtualUpdate",7),this.sdVirtualReachEnd=e(this,"sdVirtualReachEnd",7)}static DEFAULT_NO_DATA_LABEL="데이터가 없습니다.";get el(){return s(this)}tableId=b(8);fallbackTableId=b(8);columns=[];rows;selected=[];rowKey="id";selectable=!1;resizable=!1;width;height;stickyHeader=!1;stickyColumn={left:0,right:0};useTop=!1;noDataLabel=g.DEFAULT_NO_DATA_LABEL;resolvedNoDataLabel=g.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(String(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(t){this.resolvedNoDataLabel="string"==typeof t&&t.trim().length>0&&"undefined"!==t&&"null"!==t?t:g.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,h=s+t.clientWidth<t.scrollWidth;this.scrolledLeft===i&&this.scrolledRight===h||(this.scrolledLeft=i,this.scrolledRight=h,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.ceil(t.scrollHeight),s=Math.max(60,e);s!==this.noDataBodyHeight&&(this.noDataBodyHeight=s)})),this.noDataContentResizeObserver.observe(t),i((()=>{if(!this.noDataContentEl)return;const t=Math.ceil(this.noDataContentEl.scrollHeight),e=Math.max(60,t);e!==this.noDataBodyHeight&&(this.noDataBodyHeight=e)})))}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:h}=this.calculateVisibleRange(e,s);if(!Number.isFinite(i)||!Number.isFinite(h))return;const a=this.vsStart!==i||this.vsEnd!==h;if(!a&&!t)return;this.vsStart=i,this.vsEnd=h;const n=i*this.effectiveRowHeight,r=Math.max(0,(this.rowCount-h)*this.effectiveRowHeight),l=this.queryChildEl("sd-tbody");l?.setSpacersSync?.(n,r),a&&this.sdVirtualUpdate.emit({from:i,to:h}),this.maybeEmitVirtualReachEnd(i,h)}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,h=this.columnWidths[t],a=e=>{const a=this.columns[t];if(null==a)return;const n=a.maxWidth||9999,r=e.clientX-i,l=Math.min(Math.max(h+(s?-r:r),a.minWidth||50),n);this.columnWidths=this.columnWidths.map(((e,s)=>s===t?l:e));const o=this.queryChildEl("sd-thead");o?.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?.()}))},n=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",n)}getStickyStyleSync(t){const e=this.columnWidths.slice(0,t).reduce(((t,e)=>t+e),this.selectable?o: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],h={"--sticky-left-offset":`${e}px`,"--sticky-right-offset":`${s}px`};return i?.autoWidth||(h.width=`${this.columnWidths[t]}px`,h.minWidth=`${this.columnWidths[t]}px`,h.maxWidth=`${this.columnWidths[t]}px`),h}async getStickyStyle(t){return this.getStickyStyleSync(t)}spanKey(t,e){return`${t}::${e}`}requestAllTrUpdate(){this.queryAllTr().forEach((t=>{"function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():h(t)}))}registerSpanSync(t,e,s,i){if(null==t||""===e)return;const h=Math.max(1,Math.floor(s||1)),a=Math.max(1,Math.floor(i||1)),n=this.spanKey(t,e),r=this.spanRegistry.get(n);if(1===h&&1===a){if(!r)return;return this.spanRegistry.delete(n),void this.requestAllTrUpdate()}r&&r.rowspan===h&&r.colspan===a||(this.spanRegistry.set(n,{rowspan:h,colspan:a}),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),h=(s??"").trim();""!==h?this.cellClassRegistry.set(i,h):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 h=i[s];if(null==h)continue;const a=this.spanRegistry.get(this.spanKey(t,"string"==typeof h.field?h.field:h.name));if(a&&s+a.colspan>e)return!0}const h=this.resolveRowIndex(t);if(null==h)return!1;for(const[t,s]of this.spanRegistry){if(s.rowspan<=1)continue;const a=t.indexOf("::");if(a<0)continue;const n=t.slice(0,a),r=t.slice(a+2),l=this.resolveRowIndex(n);if(null==l)continue;if(l>=h)continue;if(l+s.rowspan<=h)continue;const o=i.findIndex((t=>("string"==typeof t.field?t.field:t.name)===r));if(!(o<0)&&o<=e&&o+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))),h=Math.max(0,this.toFiniteNumber(t,0)),a=Math.max(0,this.toFiniteNumber(e,0)),n=Math.max(0,Math.floor(this.toFiniteNumber(this.rowCount,0))),r=Math.floor(h/s),l=Math.ceil(a/s);return{start:Math.max(0,r-i),end:Math.min(n,r+l+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 a("sd-tr",{key:i,"row-key":String(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 a(n,{key:"337909d6279baf60effec188eb60422ce47c0585",style:{"--table-radius":`${u}px`,"--table-border-color":c.color,"--table-border-width":`${c.width}px`,"--table-body-font-family":d.fontFamily,"--table-body-font-weight":d.fontWeight,"--table-body-font-size":`${d.fontSize}px`,"--table-body-line-height":`${d.lineHeight}px`,"--table-body-text-decoration":d.textDecoration,"--table-selectable-width":`${o}px`,"--table-host-height":e?void 0!==this.height?`max(${this.height}, ${s}px)`:`max(${s}px, 100%)`:this.height??"100%"}},a("div",{key:"46d53ced85e1700da3c6ca082d5752c0bb4a155b",class:"sd-table__container",style:{"--table-width":this.width,"--pagination-height":(this.pagination&&this.rowCount>0&&!this.useVirtualScroll?48:0)+"px"}},a("div",{key:"159fad6dec16b3328d0da4ce22ae6bca537046e9",class:{"sd-table__wrapper":!0,"sd-table__wrapper--use-top":this.useTop}},a("div",{key:"22acbc7de61e11807b1a8919090286bb04a98bed",class:{"sd-table__scroll-container":!0,"sd-table__scroll-container--loading":this.isLoading,"sd-table__scroll-container--no-data":e}},this.isLoading&&a("div",{key:"040736d35428396068d5237a17f23f8f70ba2541",class:"sd-table__loading",style:{top:`${this.loadingScrollTop}px`}},a("sd-circle-progress",{key:"eae076a71161e315951692f051522b8b5f094271",indeterminate:!0})),e&&a(a.Fragment,null,a("div",{key:"e8bdf5ae38a77988fce0a60ae9309f5d03b34928",class:"sd-table__no-data-header-overlay"}),a("div",{key:"d6ce4d4479eb927137b1afd5494a91494568b274",class:"sd-table__no-data"},a("div",{key:"cfccc6382e7d0cc76d7f50515cd157ccd56cbac8",class:"sd-table__no-data-content",ref:t=>{this.noDataContentEl=t,t&&this.syncNoDataContentObserver()}},a("slot",{key:"45a2df0c0fa234408ca5a5fb76b5a74729cad482",name:"no-data"},a("span",{key:"a126d8ce4149ac87e55f5a6acc67bbb3a650cdf4"},this.resolvedNoDataLabel))))),a("table",{key:"aa4b94ed02700edd1846ca51235f47fe7de570be",class:this.tableClasses},this.autoThead?a("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange},a("sd-thead",{rows:this.rows??[]})):a("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange}),this.autoTbody?a("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange},a("sd-tbody",{rows:this.rows??[]},this.renderAutoRows())):a("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange})))),this.pagination&&this.pagination.rowsPerPage>0&&this.rowCount>0&&!this.useVirtualScroll&&a("div",{key:"f4d357d62af40e3ea8f35c799b4409c7deb2606f",class:"sd-table__pagination"},a("sd-pagination",{key:"6aad139f1f06d1851f30b5c8331899fe9d23ba37",currentPage:this.useInternalPagination?this.currentPage:this.pagination.page,lastPage:this.useInternalPagination?this.lastPageNumber:this.pagination.lastPage,onSdPageChange:t=>this.changePage(t.detail)}),this.useRowsPerPageSelect&&a("sd-select",{key:"85aa19726fca6dce007d8ffcc5550de8115546cb",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}]}}};g.style="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--use-top{border-radius:0 0 var(--table-radius, 8px) var(--table-radius, 8px)}.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%)}";export{g as sd_table}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as d,H as r}from"./p-CAxodB5I.js";import{s as e}from"./p-BJfiMC9H.js";const a={default:e.color.divider.default},s=class{constructor(d){i(this,d)}vertical=!1;render(){return d(r,{key:"886ca68599a925678d7c598daeff3bf653db513d",style:{"--sd-divider-color":a.default}},d("hr",{key:"e213413f041cda5d18a74f8c0225c840d92f7dac","aria-orientation":this.vertical?"vertical":"horizontal"}))}};s.style="sd-divider{flex-shrink:0;line-height:0}:where(sd-divider:not([vertical])){display:block;width:100%;height:1px}:where(sd-divider[vertical]){display:inline-block;align-self:stretch;width:1px}sd-divider hr{display:block;width:100%;height:100%;margin:0;border:0;background-color:var(--sd-divider-color)}";export{s as sd_divider}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-CAxodB5I.js";var n={size:"16",icon:"12"},s={size:"24",icon:"16"},o={size:"28",icon:"20"},a={size:"36",icon:"24"},d={size:"62",icon:"32"},r={sm:"4",md:"6"},c={opacity:"5%"},g={disabled:"#BBBBBB"},h={content:"#888888",hover:{bg:"#222222"}},b={content:"#E30000",hover:{bg:"#E30000"}},l={content:"#025497",hover:{bg:"#0075FF"}},u={content:"#FFFFFF",disabled:"#E1E1E1",hover:{bg:"#FFFFFF"}};const p={xxs:{size:Number(n.size),icon:Number(n.icon)},xs:{size:Number(s.size),icon:Number(s.icon)},sm:{size:Number(o.size),icon:Number(o.icon)},md:{size:Number(a.size),icon:Number(a.icon)},lg:{size:Number(d.size),icon:Number(d.icon)}},f={xxs:Number(r.sm),xs:Number(r.sm),sm:Number(r.sm),md:Number(r.md),lg:Number(r.md)},x=c.opacity,m={default:h.content,danger:b.content,action:l.content,inverse:u.content},y={default:h.hover.bg,danger:b.hover.bg,action:l.hover.bg,inverse:u.hover.bg},v=g.disabled,F={default:v,danger:v,action:v,inverse:u.disabled},z=class{constructor(i){t(this,i),this.click=e(this,"sdClick",7)}icon;size="sm";intent="default";ariaLabel="";tooltipLabel="";disabled=!1;click;hasWarnedMissingAriaLabel=!1;componentWillLoad(){this.size??="sm",this.intent??="default",this.ariaLabel??="",this.tooltipLabel??=""}handleClick=t=>{this.disabled?t.preventDefault():this.click.emit(t)};componentWillRender(){this.warnIfMissingAriaLabel()}warnIfMissingAriaLabel(){""===(this.ariaLabel??"").trim()?this.hasWarnedMissingAriaLabel||(console.warn(`[sd-ghost-button] icon-only buttons require \`ariaLabel\`. Received icon="${this.icon}".`),this.hasWarnedMissingAriaLabel=!0):this.hasWarnedMissingAriaLabel=!1}render(){const t=this.size??"sm",e=this.intent??"default",n=p[t]??p.sm,s=this.disabled?F[e]:m[e],o=(this.ariaLabel??"").trim()||void 0,a=(this.tooltipLabel??"").trim(),d=a.length>0;return i("button",{key:"fafdeaa60205f0190cc592ac8fdacbf140e28d6c",class:{"sd-ghost-button":!0,"sd-ghost-button--disabled":this.disabled,"sd-ghost-button--with-tooltip":d},type:"button",disabled:this.disabled,"aria-label":o,style:{"--sd-ghost-button-size":`${n.size}px`,"--sd-ghost-button-radius":`${f[t]}px`,"--sd-ghost-button-hover-bg":y[e],"--sd-ghost-button-hover-opacity":x,"--sd-ghost-button-accent":"#0075FF"},onClick:this.handleClick},d&&i("span",{key:"57425145ccc76a0bf960377cb13ba06e37195fa3",class:"sd-ghost-button__tooltip","aria-hidden":"true"},i("sd-tag",{key:"9d097c96d701431ac92aa7fb305c418bb570bc16",name:"square_xs_grey",label:a})),i("sd-icon",{key:"4b186b2fd33c70f4b47a2c736a53e1ac37bc2ebc",name:this.icon,size:n.icon,color:s}))}};z.style='sd-ghost-button{display:inline-flex;width:fit-content;height:fit-content}.sd-ghost-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sd-ghost-button-size);height:var(--sd-ghost-button-size);padding:0;border:none;border-radius:var(--sd-ghost-button-radius);background:transparent;cursor:pointer;box-sizing:border-box;transition:box-shadow 0.2s ease;-webkit-user-select:none;user-select:none}.sd-ghost-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--sd-ghost-button-hover-bg);opacity:0;transition:opacity 0.2s ease;pointer-events:none}.sd-ghost-button:hover:not(.sd-ghost-button--disabled)::before{opacity:var(--sd-ghost-button-hover-opacity)}.sd-ghost-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-ghost-button-accent)}.sd-ghost-button--disabled{cursor:not-allowed}.sd-ghost-button__tooltip{position:absolute;left:50%;bottom:calc(100% + 4px);transform:translateX(-50%) translateY(4px);z-index:1;display:inline-flex;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease}.sd-ghost-button--with-tooltip:hover:not(.sd-ghost-button--disabled) .sd-ghost-button__tooltip,.sd-ghost-button--with-tooltip:focus-visible:not(.sd-ghost-button--disabled) .sd-ghost-button__tooltip{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}';var k={height:"20",paddingX:"8",gap:"4",typography:{fontSize:"11",fontWeight:"500",lineHeight:"18"},radius:"6"},_={height:"24",paddingX:"8",gap:"4",typography:{fontSize:"12",fontWeight:"700",lineHeight:"20"},radius:"6"},$={height:"28",paddingX:"12",gap:"6",typography:{fontSize:"14",fontWeight:"700",lineHeight:"24"},radius:"8"},w={content:"#FB4444",bg:"#FCEFEF"},E={content:"#FF6B00",bg:"#FEF1EA"},N={content:"#916C0D",bg:"#FFF7DD"},W={content:"#00973C",bg:"#E8F9EF"},B={content:"#0075FF",bg:"#E6F1FF"},C={content:"#006AC1",bg:"#EAF5FE"},S={content:"#004290",bg:"#EFF6FF"},L={content:"#737373",bg:"#EEEEEE"};const X=["xs","sm","md"],j=["grey","red","orange","yellow","green","blue","darkblue","indigo"],q={grey:{background:L.bg,content:L.content,icon:L.content},red:{background:w.bg,content:w.content,icon:w.content},orange:{background:E.bg,content:E.content,icon:E.content},yellow:{background:N.bg,content:N.content,icon:N.content},green:{background:W.bg,content:W.content,icon:W.content},blue:{background:B.bg,content:B.content,icon:B.content},darkblue:{background:C.bg,content:C.content,icon:C.content},indigo:{background:S.bg,content:S.content,icon:S.content}},A={xs:{height:`${k.height}px`,paddingX:`${k.paddingX}px`,gap:`${k.gap}px`,fontSize:`${k.typography.fontSize}px`,fontWeight:k.typography.fontWeight,lineHeight:`${k.typography.lineHeight}px`,iconSize:12,radius:`${k.radius}px`},sm:{height:`${_.height}px`,paddingX:`${_.paddingX}px`,gap:`${_.gap}px`,fontSize:`${_.typography.fontSize}px`,fontWeight:_.typography.fontWeight,lineHeight:`${_.typography.lineHeight}px`,iconSize:16,radius:`${_.radius}px`},md:{height:`${$.height}px`,paddingX:`${$.paddingX}px`,gap:`${$.gap}px`,fontSize:`${$.typography.fontSize}px`,fontWeight:$.typography.fontWeight,lineHeight:`${$.typography.lineHeight}px`,iconSize:16,radius:`${$.radius}px`}},H={xs:{...A.xs,radius:"999px"},sm:{...A.sm,radius:"999px"},md:{...A.md,radius:"999px"}},I=Object.fromEntries(["square","pill"].flatMap((t=>X.flatMap((e=>j.map((i=>[`${t}_${e}_${i}`,{shape:t,size:e,color:i,..."square"===t?A[e]:H[e],...q[i]}]))))))),D=class{constructor(e){t(this,e)}name="square_sm_grey";label="";icon;isLeft=!0;componentWillLoad(){this.name=this.name??"square_sm_grey"}get resolvedName(){if(!Object.prototype.hasOwnProperty.call(I,this.name))throw new Error(`Invalid sd-tag name: "${this.name}"`);return this.name}get resolvedConfig(){return I[this.resolvedName]}renderIcon(t,e){return null==this.icon?null:i("sd-icon",{class:"sd-tag__icon",name:this.icon,size:e,color:t})}render(){const t=this.resolvedConfig,e=this.renderIcon(t.icon,t.iconSize);return i("span",{key:"b4d86dee7290a74d73fd27a9a4133c5c0ef9b750",class:"sd-tag",style:{"--sd-tag-background":t.background,"--sd-tag-content":t.content,"--sd-tag-height":t.height,"--sd-tag-padding-x":t.paddingX,"--sd-tag-gap":t.gap,"--sd-tag-font-size":t.fontSize,"--sd-tag-font-weight":t.fontWeight,"--sd-tag-line-height":t.lineHeight,"--sd-tag-radius":t.radius},"aria-label":this.label||"tag"},this.icon&&this.isLeft&&e,i("span",{key:"490c703ca9ce3d0516b1da89fec18045a750d715",class:"sd-tag__label"},this.label),this.icon&&!this.isLeft&&e)}};D.style="sd-tag{display:inline-flex;width:fit-content;height:fit-content}.sd-tag{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-tag-gap, 5px);min-height:var(--sd-tag-height, 24px);padding:0 var(--sd-tag-padding-x, 8px);border-radius:var(--sd-tag-radius, 4px);background:var(--sd-tag-background, #f3f3f3);color:var(--sd-tag-content, #7a7a7a);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}.sd-tag__icon{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center}.sd-tag__label{display:inline-flex;align-items:center;justify-content:center;min-width:0;font-size:var(--sd-tag-font-size, 12px);font-weight:var(--sd-tag-font-weight, 700);line-height:var(--sd-tag-line-height, 20px)}";export{z as sd_ghost_button,D as sd_tag}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,a as i,h as e}from"./p-CAxodB5I.js";const h=class{constructor(i){t(this,i),this.close=s(this,"sdClose",3)}get hostEl(){return i(this)}to="body";parentRef=null;offset=[0,4];viewportPadding=0;zIndex=998;open=!1;close;container;wrapper;rafId;isInsideClick=!1;closeTransitionTimer;handleObservedScroll=()=>this.updatePosition();resizeObserver;mutationObserver;scrollParents=[];isObserved=!1;handleOpenChange(){this.syncPortalState()}componentDidLoad(){this.container=this.resolveContainer(),this.syncPortalState()}componentDidRender(){this.syncPortalState()}disconnectedCallback(){if(this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.unobserveParent(),this.wrapper?.parentNode)try{this.wrapper.parentNode.removeChild(this.wrapper)}catch{}}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof HTMLElement?t:document.body}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"fixed",top:"0",left:"0",zIndex:(this.zIndex??998).toString(),opacity:"0",transition:"opacity 0.15s ease-out",boxSizing:"border-box",visibility:"hidden"}),this.container.appendChild(this.wrapper)}ensureWrapper(){this.wrapper||(this.container||=this.resolveContainer(),this.createWrapper(),this.moveSlotContent())}syncPortalState(){if(!this.open)return this.wrapper&&(this.wrapper.style.transition="opacity 0.15s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="none",this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.closeTransitionTimer=setTimeout((()=>{this.wrapper&&!this.open&&(this.wrapper.style.display="none")}),150)),void this.unobserveParent();this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.ensureWrapper(),this.wrapper&&(this.wrapper.style.display="block",this.wrapper.style.transition="opacity 0.25s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="",this.observeParent(),this.updatePosition())}moveSlotContent(){this.wrapper&&Array.from(this.hostEl.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const t=this.parentRef.getBoundingClientRect(),s=window.innerWidth,i=window.innerHeight,e=this.offset??[0,4],h=Math.max(0,this.viewportPadding??0),o=Math.max(s-2*h,0),n=Math.max(i-2*h,0);this.wrapper.style.maxWidth=`${o}px`,this.wrapper.style.maxHeight=`${n}px`;const r=this.wrapper.getBoundingClientRect(),a=i-t.bottom-e[1]-h;let c=t.bottom+e[1],l=t.left+e[0];a<r.height&&t.top-e[1]-h>a&&(c=t.top-r.height-e[1]);const d=i-h-r.height;c=d<h?h:Math.min(Math.max(c,h),d),t.left+r.width+e[0]>s-h&&(l=t.right-r.width-e[0]);const u=s-h-r.width;l=u<h?h:Math.min(Math.max(l,h),u),this.wrapper.style.top=`${c}px`,this.wrapper.style.left=`${l}px`,this.wrapper.style.visibility="visible",this.wrapper.style.opacity="1"}))}observeParent(){this.parentRef&&!this.isObserved&&(this.observeScrollParents(this.parentRef),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef)),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})),this.isObserved=!0)}unobserveParent(){this.isObserved&&(this.unobserveScrollParents(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.mutationObserver?.disconnect(),this.mutationObserver=void 0,this.isObserved=!1)}observeScrollParents(t){const s=this.getScrollParents(t);s.forEach((t=>{t.addEventListener("scroll",this.handleObservedScroll,{passive:!0})})),this.scrollParents=s}unobserveScrollParents(){this.scrollParents.forEach((t=>{t.removeEventListener("scroll",this.handleObservedScroll)})),this.scrollParents=[]}getScrollParents(t){const s=[];let i=t.parentElement;for(;i;){const{overflow:t,overflowX:e,overflowY:h}=getComputedStyle(i);[t,e,h].some((t=>/(auto|scroll|overlay)/.test(t)))&&s.push(i),i=i.parentElement}return s}isInsideTarget(t){return!(!this.wrapper?.contains(t)&&!this.parentRef?.contains(t))}handleMouseDown(t){this.isInsideClick=this.isInsideTarget(t.target)}handleWindowClick(t){this.isInsideClick?this.isInsideClick=!1:this.isInsideTarget(t.target)||this.close.emit()}render(){return e("slot",{key:"22e09896836d017f33a9c6b92772a00fc85f8997"})}static get watchers(){return{open:[{handleOpenChange:0}]}}};export{h as sd_portal}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,h as e,H as s}from"./p-CAxodB5I.js";import{p as c}from"./p-D1vaasIp.js";import{s as t}from"./p-BJfiMC9H.js";var a={track:"#EEEEEE",arc:"#2D8DFF"};const o=c.progress.color.label,i=t.color.fg.tertiary,l={primary:{arc:a.arc,track:a.track},inverse:{arc:"#FFFFFF",track:"transparent"},error:{arc:"#E30000",track:a.track},complete:{arc:"#01BB4B",track:a.track}},n=2*Math.PI*34,p=class{constructor(e){r(this,e)}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 r=l[this.type]??l.primary,c={"--sd-circle-progress-track":r.track,"--sd-circle-progress-arc":r.arc,"--sd-circle-progress-label-color":o,"--sd-circle-progress-percent-color":0===this.clampedValue?i:r.arc},t={};this.indeterminate||(t.strokeDasharray=`${this.clampedValue/100*n} ${n}`,t.strokeDashoffset="0");const a=!this.indeterminate;return e(s,{key:"35b4dc433f5e2bbd02dc3422b286da179472082f",style:c},e("svg",{key:"de1d3e44eccf421491a1107ba234e1562917945b",class:"sd-circle-progress",viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg"},e("circle",{key:"b0a54a2e155222a416a6bdcb75f4fe54d9de8270",class:"sd-circle-progress__track",cx:40,cy:40,r:34,fill:"none","stroke-width":12}),e("circle",{key:"6bc314b3fce758d41a3499e9d87b7158b15777a5",class:"sd-circle-progress__arc",cx:40,cy:40,r:34,fill:"none","stroke-width":12,"stroke-linecap":"round",style:t})),a&&e("span",{key:"16ec46b178d5f2f2f5ad245703c2f4362b8df261",class:"sd-circle-progress__percent"},Math.round(this.clampedValue),"%"),this.label&&e("span",{key:"c199799d2466c75f91f1bc1f20fdb7e71c64ba0e",class:"sd-circle-progress__label"},this.label))}};p.style='@charset "UTF-8";sd-circle-progress{display:inline-flex;flex-direction:column;align-items:center;gap:8px}sd-circle-progress .sd-circle-progress{width:80px;height:80px}sd-circle-progress .sd-circle-progress__track{stroke:var(--sd-circle-progress-track)}sd-circle-progress .sd-circle-progress__arc{stroke:var(--sd-circle-progress-arc);transform:rotate(-90deg);transform-origin:center center;transition:stroke-dasharray 0.4s linear, stroke-dashoffset 0.4s linear}sd-circle-progress .sd-circle-progress__percent{text-align:center;color:var(--sd-circle-progress-percent-color);font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;font-size:16px;font-weight:700;line-height:26px}sd-circle-progress .sd-circle-progress__label{text-align:center;color:var(--sd-circle-progress-label-color);font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;font-size:12px;font-weight:400;line-height:20px}sd-circle-progress{}sd-circle-progress[indeterminate] .sd-circle-progress{animation:sd-circle-progress-spin 2s linear infinite;transform-origin:center center}sd-circle-progress[indeterminate] .sd-circle-progress__arc{transform:none;transition:none;animation:sd-circle-progress-spin-path 1.5s ease-in-out infinite}@keyframes sd-circle-progress-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes sd-circle-progress-spin-path{0%{stroke-dasharray:1, 340;stroke-dashoffset:0}50%{stroke-dasharray:151, 340;stroke-dashoffset:-60}100%{stroke-dasharray:151, 340;stroke-dashoffset:-211}}';export{p as sd_circle_progress}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as i,a as t,h as s}from"./p-CAxodB5I.js";import{n as d}from"./p-CCwNgVmC.js";import{D as n,a}from"./p-d24F7UcR.js";import{i as r}from"./p-e0ABNkP6.js";import{f as o}from"./p-BOJJ_sQS.js";import"./p-laVsm9VM.js";const l=class{constructor(t){e(this,t),this.update=i(this,"sdUpdate",7),this.viewChange=i(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return t(this)}value=null;size="sm";placeholder="YYYY-MM-DD";selectable;disabled=!1;width="";label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;name=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),l.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{e.stopPropagation(),this.closeDropdown(),this.value=e.detail;const i=this.value;requestAnimationFrame((()=>{this.update.emit(i)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=a[this.size]??a.sm;return s("sd-field",{key:"9e1e5cb7419027db803248a657d0d134be049637",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`,"--sd-system-color-field-border-default":n.border.default,"--sd-system-color-field-border-focus":n.border.focus,"--sd-system-color-field-bg-default":n.bg.default}},s("div",{key:"fbd9adeaa08d19cac34b045aba2b3fbb8d4adc8c",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},s("sd-date-picker-trigger",{key:"d51161c4b1eedcfd90832c9b6d049559ff5df08b",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&s("sd-portal",{key:"d6588d3991eff39eb717d4211b38d68f093aace5",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},s("sd-calendar",{key:"0dc6a8074fcfa63630aab7f0b126caa9f4c7b234",elevated:!0,value:this.value,selectable:this.selectable,onSdUpdate:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}};l.style="sd-date-picker{display:inline-flex}sd-date-picker sd-portal{display:none}sd-date-picker .sd-date-picker{position:relative;width:100%;height:100%}";const h=class{constructor(t){e(this,t),this.update=i(this,"sdUpdate",7),this.viewChange=i(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return t(this)}value=null;size="sm";placeholder="YYYY-MM-DD ~ YYYY-MM-DD";selectable;maxRange;disabled=!1;width="";label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;name=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),h.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{this.closeDropdown(),this.value=e.detail;const i=this.value;requestAnimationFrame((()=>{this.update.emit(i)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};get displayText(){return null==this.value||""===this.value[0]||""===this.value[1]?"":`${this.value[0]} ~ ${this.value[1]}`}disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=a[this.size]??a.sm;return s("sd-field",{key:"89eaeb8978796508650aec5f3ccdeb7df16fb6f4",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`,"--sd-system-color-field-border-default":n.border.default,"--sd-system-color-field-border-focus":n.border.focus,"--sd-system-color-field-bg-default":n.bg.default}},s("div",{key:"f3ce583e53edbc451ab6c0592c0ab2ed87e07a06",class:"sd-date-range-picker",ref:e=>{this.triggerRef=e}},s("sd-date-picker-trigger",{key:"53086fd3d15dc2c05364a66fdf767e09c6c19fac",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&s("sd-portal",{key:"5ee1499ee9a224a9c653095e9914ed20cbaca2a1",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},s("sd-date-range-picker-calendar",{key:"7c7479dacf57c996a708435857d2b5f7900509fd",value:this.value,selectable:this.selectable,maxRange:this.maxRange,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}};h.style="sd-date-range-picker{display:inline-flex}sd-date-range-picker sd-portal{display:none}sd-date-range-picker .sd-date-range-picker{position:relative;width:100%;height:100%}";var c={sm:{height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const p={height:c.sm.height,paddingX:c.sm.paddingX,gap:c.sm.gap,radius:c.sm.radius,fontSize:c.sm.typography.fontSize,lineHeight:c.sm.typography.lineHeight,fontWeight:c.sm.typography.fontWeight,iconSize:c.sm.icon},u={text:c.text,icon:{default:"#888888",disabled:c.icon.disabled}},f=class{constructor(t){e(this,t),this.update=i(this,"sdUpdate",7),this.reject=i(this,"sdReject",7)}get el(){return t(this)}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name=d();label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";width="";rules;error=!1;status;icon=void 0;labelTooltip="";labelTooltipProps=null;focused=!1;hovered=!1;internalValue=null;showTooltip=!1;fileInputRef;fileNamesRef;formField;update;reject;valueChanged(e){this.internalValue=e}componentDidLoad(){this.checkOverflow()}componentDidUpdate(){this.checkOverflow()}async sdValidate(){return this.formField?.sdValidate()??Promise.resolve(!0)}async sdReset(){const e=this.multiple?[]:null;this.value=e,this.internalValue=e,this.fileInputRef&&(this.fileInputRef.value=""),await(this.formField?.sdResetValidation())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e,i=0){const t=this.toBytes(this.maxFileSize),s=this.toBytes(this.maxTotalSize),d=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=d&&i+e.length>d)return{accepted:[],rejected:e,reason:"max-files"};if(null!=t){const i=e.filter((e=>e.size>t));if(i.length>0)return{accepted:[],rejected:i,reason:"max-file-size"}}return null!=s&&e.reduce(((e,i)=>e+i.size),0)>s?{accepted:[],rejected:e,reason:"max-total-size"}:{accepted:e,rejected:[]}}handleFileChange=e=>{const i=e.target.files;if(!i||0===i.length)return;const t=Array.from(i);if(this.multiple){const e=Array.isArray(this.internalValue)?this.internalValue:[],{accepted:i,rejected:s,reason:d}=this.validateFiles(t,e.length);if(this.fileInputRef&&(this.fileInputRef.value=""),null!=d)return void this.reject?.emit({files:s,reason:d});const n=[...e,...i];this.internalValue=n,this.value=n,this.update?.emit(this.value)}else{const{accepted:e,rejected:i,reason:s}=this.validateFiles(t);if(null!=s)return this.reject?.emit({files:i,reason:s}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=e[0],this.value=this.internalValue,this.update?.emit(this.value)}};handleClear=e=>{if(this.disabled)return;e.stopPropagation();const i=this.multiple?[]:null;this.value=i,this.internalValue=i,this.update?.emit(i),this.fileInputRef&&(this.fileInputRef.value="")};handleClick=()=>{this.disabled||this.fileInputRef?.click()};hasFiles(){return!this.multiple&&!!this.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}hasChips(){return Array.isArray(this.internalValue)&&this.internalValue.length>0}getDisplayText(){return this.hasFiles()&&this.internalValue?.name||(this.placeholder??"Click to upload")}handleChipRemove=e=>{if(!Array.isArray(this.internalValue))return;const i=[...this.internalValue];i.splice(e,1),this.internalValue=i,this.value=i,this.update?.emit(this.value)};renderChipList(){return this.hasChips()?s("div",{class:"sd-file-picker__chip-list"},this.internalValue.map(((e,i)=>s("sd-chip",{value:e.name,onSdRemove:()=>this.handleChipRemove(i)})))):null}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?u.icon.disabled:u.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),t={"--sd-file-picker-font-size":`${p.fontSize}px`,"--sd-file-picker-line-height":`${p.lineHeight}px`,"--sd-file-picker-font-weight":p.fontWeight,"--sd-file-picker-padding-x":`${p.paddingX}px`,"--sd-file-picker-gap":`${p.gap}px`,"--sd-file-picker-text-color":u.text.default,"--sd-file-picker-placeholder-color":u.text.placeholder,"--sd-file-picker-disabled-color":u.text.disabled,"--sd-system-size-field-sm-height":`${p.height}px`,"--sd-system-radius-field-sm":`${p.radius}px`},d=s("div",{role:"button",tabindex:this.disabled?-1:0,class:"sd-file-picker__content",onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},s("input",{ref:e=>this.fileInputRef=e,type:"file",class:"sd-file-picker__input",disabled:this.disabled,multiple:this.multiple,accept:this.accept,onInput:this.handleFileChange,"aria-label":this.placeholder??"Click to upload"}),s("sd-icon",{name:"attachFile",size:Number(p.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),s("div",{ref:e=>this.fileNamesRef=e,class:{"sd-file-picker__text":!0,"sd-file-picker__text--placeholder":!e,"sd-file-picker__text--active":e}},i),!this.disabled&&e&&s("sd-ghost-button",{icon:"close",size:"xxs",ariaLabel:"clear",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&s("div",{class:"sd-file-picker__tooltip"},i));return this.inline?s("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},d,this.renderChipList()):s("div",{class:"sd-file-picker__wrapper",style:t},s("sd-field",{name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},d),this.renderChipList())}static get watchers(){return{value:[{valueChanged:0}]}}};f.style="sd-file-picker{display:flex;flex-direction:column;width:100%}.sd-file-picker__wrapper{display:flex;flex-direction:column;width:100%}.sd-file-picker__chip-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:998;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}";const b=r.textinput.sm,g=r.textinput.md,m={sm:{height:b.height,paddingX:b.paddingX,gap:b.gap,radius:b.radius,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight,fontWeight:b.typography.fontWeight},md:{height:g.height,paddingX:g.paddingX,gap:g.gap,radius:g.radius,fontSize:g.typography.fontSize,lineHeight:g.typography.lineHeight,fontWeight:g.typography.fontWeight}},_={text:r.textinput.text,icon:r.textinput.icon},x=class{constructor(t){e(this,t),this.input=i(this,"sdUpdate",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get host(){return t(this)}value=null;type="text";size="sm";addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;autocomplete="";maxlength;minlength;inputmode;enterkeyhint;spellcheck=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;passwordVisible=!1;nativeEl=void 0;formField;name=d();input;focus;blur;valueChanged(e){this.internalValue=e}internalValueChanged(e){e!==this.value&&(this.value=e,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){null!=this.value&&""!==this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=e=>{this.internalValue=e.target.value};handleFocus=async(e,i)=>{this.focused="focus"===e,"blur"===e?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(i)):this.focus?.emit(i)};render(){const e=m[this.size]??m.sm;return s("sd-field",{key:"64e7a3ba5e223341336248ba31e621b4416987fd",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,readonly:this.readonly,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-input-font-size":`${e.fontSize}px`,"--sd-input-line-height":`${e.lineHeight}px`,"--sd-input-font-weight":e.fontWeight,"--sd-input-padding-x":`${e.paddingX}px`,"--sd-input-gap":`${e.gap}px`,"--sd-input-text-color":_.text.default,"--sd-input-placeholder-color":_.text.placeholder,"--sd-input-disabled-color":_.text.disabled,"--sd-input-icon-color":_.icon.default,"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`}},s("label",{key:"b66e286c35cc14c1eb02badcaaff24b38ff0a7b3",class:"sd-input__content"},s("slot",{key:"dc8b900eb2b38c18b85663bc930e810be77bdbd7",name:"prefix"}),s("input",{key:"36d35464338838aaaeff6f728020241d33a493ec",name:this.name,ref:e=>this.nativeEl=e,class:`sd-input__native ${this.inputClass}`,type:"password"===this.type&&this.passwordVisible?"text":this.type??"text",value:this.internalValue||"",placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,autocomplete:this.autocomplete||void 0,maxlength:this.maxlength,minlength:this.minlength,inputmode:this.inputmode,enterkeyhint:this.enterkeyhint,spellcheck:this.spellcheck,onInput:this.handleInput,onFocus:e=>this.handleFocus("focus",e),onBlur:e=>this.handleFocus("blur",e),style:this.inputStyle}),s("slot",{key:"4f30d4a59794c0692f367d41af4311e191c5427b",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&!this.readonly&&s("sd-ghost-button",{key:"247da41512f20d8e562f345b08bd5bc13486734b",icon:"close",ariaLabel:"clear",size:"xxs",disabled:this.disabled,class:"sd-input__clear-icon",onClick:async()=>{this.disabled||this.readonly||(this.internalValue="",await(this.formField?.sdValidate()))}}),"password"===this.type&&s("sd-ghost-button",{key:"70c596ef0072bf369bd59e2c58d0a6f8c6fd1b11",icon:this.passwordVisible?"visibilityOn":"visibilityOff",ariaLabel:"visibility",size:"xxs",disabled:this.disabled||this.readonly,class:"sd-input__password-icon",onClick:()=>{this.disabled||this.readonly||(this.passwordVisible=!this.passwordVisible)}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}};x.style="sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}sd-input{display:inline-flex}sd-input .sd-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-input-text-color);font-size:var(--sd-input-font-size);line-height:var(--sd-input-line-height);font-weight:var(--sd-input-font-weight);padding:0 var(--sd-input-padding-x);gap:var(--sd-input-gap)}sd-input .sd-input__content .sd-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-input .sd-input__content .sd-input__native[disabled]{cursor:not-allowed;color:var(--sd-input-disabled-color)}sd-input .sd-input__content .sd-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-input .sd-input__content .sd-input__native::placeholder{color:var(--sd-input-placeholder-color)}sd-input .sd-input__content .sd-input__clear-icon,sd-input .sd-input__content .sd-input__password-icon{flex-shrink:0}sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__password-icon,sd-input .sd-input__content .sd-input__native[readonly]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[readonly]~.sd-input__password-icon{cursor:not-allowed;pointer-events:none}";var v={numberInput:{sm:{height:"28",paddingX:"6",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"8",radius:"6",typography:{fontWeight:"400",fontSize:"14",lineHeight:"24"}},border:{default:"#AAAAAA",focus:"#0075FF",danger:"#FB4444"},bg:{default:"#FFFFFF"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},stepper:{sm:{size:"20"},md:{size:"24"},radius:"4",bg:{default:"#EFF6FF",disabled:"#EEEEEE"},icon:{default:"#0075FF",disabled:"#BBBBBB"}}}};const y=v.numberInput.sm,k=v.numberInput.md,w={sm:{height:y.height,paddingX:y.paddingX,radius:y.radius,fontSize:y.typography.fontSize,lineHeight:y.typography.lineHeight,fontWeight:y.typography.fontWeight},md:{height:k.height,paddingX:k.paddingX,radius:k.radius,fontSize:k.typography.fontSize,lineHeight:k.typography.lineHeight,fontWeight:k.typography.fontWeight}},z={border:v.numberInput.border,bg:v.numberInput.bg,text:v.numberInput.text},C={sm:{size:v.numberInput.stepper.sm.size},md:{size:v.numberInput.stepper.md.size},radius:v.numberInput.stepper.radius,bg:v.numberInput.stepper.bg,icon:v.numberInput.stepper.icon},A=o.field.hint,T=o.field.errorMessage,F=o.field.contents.gap,$=class{constructor(t){e(this,t),this.update=i(this,"sdUpdate",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get el(){return t(this)}size="sm";min=Number.NEGATIVE_INFINITY;max=Number.POSITIVE_INFINITY;step=1;useButton=!1;useDecimal=!1;value=null;label;labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;width;rules=[];autoFocus=!1;status;hint="";errorMessage="";inputPrefix="";inputSuffix="";inputClass="";readonly=!1;inputStyle={};error=!1;focused=!1;hovered=!1;internalValue=null;displayValue="";nativeEl=void 0;formField;name=d();update;focus;blur;toNumber(e){if(null==e||""===e)return null;if("number"==typeof e)return isNaN(e)?null:e;if("string"==typeof e)return this.parseInput(e);const i=Number(e);return isNaN(i)?null:i}formatWithCommas(e){if(null==e||isNaN(e))return"";const i=e<0,t=Math.abs(e),[s,d]=t.toString().split("."),n=(+s).toLocaleString(),a=i?"-"+n:n;return void 0!==d&&""!==d?a+"."+d:String(a)}parseInput(e){if(""===e.trim())return null;const i=e.replace(/,/g,"").trim();if(!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(i))return null;const t=parseFloat(i);return isNaN(t)||!this.useDecimal&&i.includes(".")?null:t}clampMinMax(e){return isNaN(e)?0:Math.min(Math.max(e,this.min),this.max)}updateDisplay(){this.displayValue=this.formatWithCommas(this.internalValue)}isIncrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue>=this.max}isDecrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue<=this.min}valueChanged(e){const i=this.toNumber(e);this.internalValue=null!==i?this.clampMinMax(i):null,this.updateDisplay()}internalValueChanged(e){this.updateDisplay(),e!==this.value&&(this.value=e,this.update?.emit(e))}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async sdGetNativeElement(){return this.nativeEl||null}componentWillLoad(){const e=this.toNumber(this.value);null!==e&&(this.internalValue=this.clampMinMax(e)),this.updateDisplay()}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=e=>{const i=e.target,t=i.value;if(""===t)return this.internalValue=null,void(this.displayValue="");const s=t.replace(/,/g,""),d=(s.match(/\./g)||[]).length;if(d>1)return void(i.value=this.displayValue);if("-"===s||"."===s||"-."===s)return void(i.value=s);if(s.endsWith(".")&&1===d){const e=s.slice(0,-1),t=this.parseInput(e);if(null!==t){const e=this.formatWithCommas(t);return void(i.value=e+".")}}const n=this.parseInput(s);if(null!==n){if(n<this.min)return void(i.value=this.displayValue);if(n>this.max)return void(i.value=this.displayValue);this.internalValue=n,this.displayValue=this.formatWithCommas(n),i.value=this.displayValue}else i.value=this.displayValue};handleFocus=e=>{this.focused=!0,this.focus?.emit(e)};handleBlur=async e=>{this.updateDisplay(),this.nativeEl&&(this.nativeEl.value=this.displayValue),this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.focused=!1,this.blur?.emit(e)};handleKeyDown=e=>{"ArrowUp"===e.key?(e.preventDefault(),this.handleIncrement()):"ArrowDown"===e.key&&(e.preventDefault(),this.handleDecrement())};handleIncrement=()=>{if(this.isIncrementDisabled())return;const e=this.internalValue??this.min??0;let i=e+this.step;i>this.max&&(i=this.max),i!==e&&(this.internalValue=i)};handleDecrement=()=>{if(this.isDecrementDisabled())return;const e=this.internalValue??this.min??0;let i=e-this.step;i<this.min&&(i=this.min),i!==e&&(this.internalValue=i)};render(){const e=w[this.size]??w.sm,i="md"===this.size?14:12;return s("sd-field",{key:"ad212dcbaf8e19cac070e6bdfa292ca614480fbc",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,readonly:this.readonly,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-number-input-font-size":`${e.fontSize}px`,"--sd-number-input-line-height":`${e.lineHeight}px`,"--sd-number-input-font-weight":e.fontWeight,"--sd-number-input-padding-x":`${e.paddingX}px`,"--sd-number-input-text-color":z.text.default,"--sd-number-input-placeholder-color":z.text.placeholder,"--sd-number-input-disabled-color":z.text.disabled,"--sd-number-input-stepper-size":`${C[this.size]?.size??C.sm.size}px`,"--sd-number-input-stepper-radius":`${C.radius}px`,"--sd-number-input-stepper-bg":C.bg.default,"--sd-number-input-stepper-bg-disabled":C.bg.disabled,"--sd-number-input-stepper-icon-color":C.icon.default,"--sd-number-input-stepper-icon-disabled":C.icon.disabled,"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`,"--sd-system-color-field-border-default":z.border.default,"--sd-system-color-field-border-focus":z.border.focus,"--sd-system-color-field-border-danger":z.border.danger,"--sd-system-color-field-bg-default":z.bg.default,"--sd-textinput-input-text-error-message":T.color,"--sd-textinput-input-error-message-typography-font-size":`${T.typography.fontSize}px`,"--sd-textinput-input-error-message-typography-line-height":`${T.typography.lineHeight}px`,"--sd-textinput-input-text-hint":A.color,"--sd-textinput-input-hint-typography-font-size":`${A.typography.fontSize}px`,"--sd-textinput-input-hint-typography-line-height":`${A.typography.lineHeight}px`,"--sd-textinput-input-contents-gap":`${F}px`}},s("div",{key:"b9c403df166e2f05f815ebf3851b6517b8afbd2a",class:{"sd-number-input__content":!0,"sd-number-input__content--no-stepper":!this.useButton}},this.useButton&&s("button",{key:"206f45b19bf8dd56b65ff55fb65d760e36d80ba7",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},s("sd-icon",{key:"d39cadc9a83cf7a0170144b8734a90f71d7aa9d1",name:"minus",size:i,color:this.isDecrementDisabled()?C.icon.disabled:C.icon.default})),this.inputPrefix&&s("span",{key:"0c97309540467d56ee3415001df7a027ba581a3d",class:"sd-number-input__prefix"},this.inputPrefix),s("input",{key:"9462f0c7ac028c038894ad184c7cf052e366e48c",name:this.name,ref:e=>this.nativeEl=e,class:`sd-number-input__native ${this.inputClass}`,type:"text",inputMode:"numeric",value:this.displayValue,placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,style:{textAlign:this.useButton?"center":"right",...this.inputStyle}}),this.inputSuffix&&s("span",{key:"fdd4f4e680fe5de55cb68c848615ec6b00f00430",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&s("button",{key:"8cdfcc46a010fb0f503b48c34290fd096403524a",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},s("sd-icon",{key:"ec8826370cd9d8c6054ca6ab216de6baa62d90db",name:"add",size:i,color:this.isIncrementDisabled()?C.icon.disabled:C.icon.default}))))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}};$.style="sd-number-input{display:inline-flex}sd-number-input .sd-number-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;gap:var(--sd-number-input-padding-x);color:var(--sd-number-input-text-color);font-size:var(--sd-number-input-font-size);line-height:var(--sd-number-input-line-height);font-weight:var(--sd-number-input-font-weight);padding:0 var(--sd-number-input-padding-x)}sd-number-input .sd-number-input__content--no-stepper{padding:0 calc(var(--sd-number-input-padding-x) * 2)}sd-number-input .sd-number-input__content .sd-number-input__native{width:100%;height:100%;min-width:0;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;padding-block:0;padding-inline:0}sd-number-input .sd-number-input__content .sd-number-input__native[disabled]{cursor:not-allowed;color:var(--sd-number-input-disabled-color)}sd-number-input .sd-number-input__content .sd-number-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-number-input .sd-number-input__content .sd-number-input__native::placeholder{color:var(--sd-number-input-placeholder-color)}sd-number-input .sd-number-input__content .sd-number-input__prefix,sd-number-input .sd-number-input__content .sd-number-input__suffix{flex-shrink:0;white-space:nowrap;color:var(--sd-number-input-placeholder-color);font-size:inherit;line-height:inherit}sd-number-input .sd-number-input__content .sd-number-input__stepper{flex-shrink:0;width:var(--sd-number-input-stepper-size);height:var(--sd-number-input-stepper-size);border:none;border-radius:var(--sd-number-input-stepper-radius);background-color:var(--sd-number-input-stepper-bg);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.15s ease}sd-number-input .sd-number-input__content .sd-number-input__stepper:hover:not(:disabled){filter:brightness(0.95)}sd-number-input .sd-number-input__content .sd-number-input__stepper:disabled{background-color:var(--sd-number-input-stepper-bg-disabled);cursor:not-allowed}";const M=class{constructor(t){e(this,t),this.change=i(this,"sdUpdate",7)}value;options=[];direction="vertical";disabled=!1;groupName;change;valueChanged(e){this.value=e}handleRadioChange=e=>{if(this.disabled)return;const i=this.options.find((i=>String(i.value)===String(e))),t=i?i.value:e;this.value=t,this.change?.emit(t)};getGroupClasses(){return["sd-radio-group",`sd-radio-group--${this.direction??"vertical"}`].join(" ")}render(){return s("div",{key:"d60a7fed2bbe1cd2d577827b10c99627aabbda66",class:this.getGroupClasses(),role:"radiogroup"},this.options.map((e=>s("sd-radio",{key:`radio-${e.value}`,val:String(e.value),value:String(this.value),label:e.label,disabled:this.disabled||!!e.disabled,onSdUpdate:({detail:e})=>this.handleRadioChange(e)}))))}static get watchers(){return{value:[{valueChanged:0}]}}};M.style='sd-radio{display:inline-flex;width:fit-content;height:var(--sd-radio-line-height);line-height:0}sd-radio .sd-radio{cursor:pointer;display:inline-flex;align-items:center;gap:var(--sd-radio-gap);height:var(--sd-radio-line-height);max-height:var(--sd-radio-line-height)}sd-radio .sd-radio>input{position:absolute;width:0;height:0;opacity:0;pointer-events:none}sd-radio .sd-radio>input:focus-visible+.sd-radio__circle{box-shadow:0 0 0 2px white, 0 0 0 4px var(--sd-radio-checked-border);outline:none}sd-radio .sd-radio__circle{position:relative;width:var(--sd-radio-size);height:var(--sd-radio-size);border-radius:50%;border:var(--sd-radio-border-width) solid var(--sd-radio-unchecked-border);box-sizing:border-box;background:var(--sd-radio-unchecked-bg);display:inline-flex;flex-shrink:0}sd-radio .sd-radio__label{font-size:var(--sd-radio-font-size);font-weight:var(--sd-radio-font-weight);color:var(--sd-radio-label-color);line-height:var(--sd-radio-line-height);display:inline-flex;flex-direction:column}sd-radio .sd-radio__label::before{content:attr(data-label);height:0;font-weight:var(--sd-radio-selected-font-weight);visibility:hidden;overflow:hidden;user-select:none;pointer-events:none}sd-radio .sd-radio:hover:not(.sd-radio--disabled) .sd-radio__circle{background:var(--sd-radio-unchecked-bg-hover);border-color:var(--sd-radio-unchecked-border-hover)}sd-radio .sd-radio--checked .sd-radio__label{font-weight:var(--sd-radio-selected-font-weight)}sd-radio .sd-radio--checked .sd-radio__circle{border-color:var(--sd-radio-checked-border)}sd-radio .sd-radio--checked .sd-radio__circle::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:var(--sd-radio-dot-size);height:var(--sd-radio-dot-size);border-radius:50%;background:var(--sd-radio-checked-dot)}sd-radio .sd-radio--disabled{cursor:not-allowed}sd-radio .sd-radio--disabled .sd-radio__label{color:var(--sd-radio-label-disabled-color)}sd-radio .sd-radio--disabled .sd-radio__circle{background:var(--sd-radio-disabled-bg);border-color:var(--sd-radio-disabled-border)}sd-radio .sd-radio--disabled.sd-radio--checked .sd-radio__circle::after{background:var(--sd-radio-disabled-dot)}sd-radio-group{display:inline-block}sd-radio-group .sd-radio-group{display:flex}sd-radio-group .sd-radio-group--vertical{flex-direction:column;gap:8px}sd-radio-group .sd-radio-group--horizontal{flex-direction:row;align-items:center;gap:20px}';const S={paddingX:r.textinput.sm.paddingX,paddingY:r.textinput.sm.paddingY,radius:r.textinput.sm.radius,fontSize:r.textinput.sm.typography.fontSize,lineHeight:r.textinput.sm.typography.lineHeight,fontWeight:r.textinput.sm.typography.fontWeight},V={text:r.textinput.text,bg:r.textinput.bg,border:r.textinput.border,resizer:r.textinput.resizer},L=class{constructor(t){e(this,t),this.input=i(this,"sdUpdate",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get host(){return t(this)}value=null;placeholder="입력해 주세요.";disabled=!1;readonly=!1;autoFocus=!1;textareaClass="";textareaStyle={};maxLength;rows;spellcheck=!1;width="";label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";icon=void 0;labelTooltip="";labelTooltipProps=null;rules=[];error=!1;status;focused=!1;hovered=!1;internalValue=null;nativeEl=void 0;formField;name=d();input;focus;blur;valueChanged(e){this.internalValue=e}internalValueChanged(e){e!==this.value&&(this.value=e,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){null!=this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=e=>{this.internalValue=e.target.value};handleFocus=async(e,i)=>{this.focused="focus"===e,"blur"===e?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(i)):this.focus?.emit(i)};render(){return s("sd-field",{key:"526fc1a73f13e5170125a570c5a1c8459931aa25",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,readonly:this.readonly,focused:this.focused,hovered:this.hovered,status:this.status,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-textarea-font-size":`${S.fontSize}px`,"--sd-textarea-line-height":`${S.lineHeight}px`,"--sd-textarea-font-weight":S.fontWeight,"--sd-textarea-padding-x":`${S.paddingX}px`,"--sd-textarea-padding-y":`${S.paddingY}px`,"--sd-textarea-radius":`${S.radius}px`,"--sd-textarea-text-color":V.text.default,"--sd-textarea-placeholder-color":V.text.placeholder,"--sd-textarea-disabled-color":V.text.disabled,"--sd-textarea-bg-color":V.bg.default,"--sd-textarea-disabled-bg-color":V.bg.disabled,"--sd-textarea-border-color":V.border.default,"--sd-textarea-resizer-color":V.resizer.color,"--sd-system-size-field-sm-height":"auto","--sd-system-radius-field-sm":`${S.radius}px`}},s("div",{key:"e3c52fccc564a2488eb9e0d9399437b76e919c6a",class:"sd-textarea__content"},s("textarea",{key:"3253873da3b9591e64a6dfd170c8d9ccb4861599",name:this.name,ref:e=>this.nativeEl=e,class:`sd-textarea__native ${this.textareaClass}`,value:this.internalValue||"",placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readOnly:this.readonly,autofocus:this.autoFocus,maxLength:this.maxLength,rows:this.rows,spellcheck:this.spellcheck,onInput:this.handleInput,onFocus:e=>this.handleFocus("focus",e),onBlur:e=>this.handleFocus("blur",e),style:this.textareaStyle})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}};L.style="sd-textarea{display:inline-flex}sd-textarea .sd-textarea__content{width:100%;display:flex}sd-textarea .sd-textarea__content .sd-textarea__native{width:100%;min-height:100px;border:none;outline:none;background:transparent;padding:var(--sd-textarea-padding-y) var(--sd-textarea-padding-x);font-family:inherit;font-size:var(--sd-textarea-font-size);line-height:var(--sd-textarea-line-height);font-weight:var(--sd-textarea-font-weight);color:var(--sd-textarea-text-color);resize:vertical}sd-textarea .sd-textarea__content .sd-textarea__native::placeholder{color:var(--sd-textarea-placeholder-color)}sd-textarea .sd-textarea__content .sd-textarea__native:disabled{cursor:not-allowed;color:var(--sd-textarea-disabled-color)}sd-textarea .sd-textarea__content .sd-textarea__native[readonly]{color:var(--sd-system-color-field-text-read-only)}";export{l as sd_date_picker,h as sd_date_range_picker,f as sd_file_picker,x as sd_input,$ as sd_number_input,M as sd_radio_group,L as sd_textarea}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,h as r,F as e}from"./p-CAxodB5I.js";const s=class{constructor(r){d(this,r)}bordered=!1;sdClass="";render(){return r(e,{key:"bf7511e8d9fccc98adf963ae20f59710bb0d00f3"},r("div",{key:"729a6053062c3959ee1e9561f5673c8a75a4dc9d",class:`sd-card ${this.bordered?"sd-card--bordered":""} ${this.sdClass}`},r("slot",{key:"11ec4fa43f694901a85879ec04e146ace90be435"})))}};s.style="sd-card{display:block;height:fit-content}sd-card .sd-card{border-radius:8px;background:white}sd-card .sd-card--bordered{border:1px solid #E1E1E1}";export{s as sd_card}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,a as s,h as e}from"./p-CAxodB5I.js";import{n}from"./p-CCwNgVmC.js";import{s as h}from"./p-BJfiMC9H.js";import{l as d,a as p}from"./p-U8VaRj9c.js";import{C as o,a,b as r}from"./p-DDj5KTBF.js";var l={minHeight:"36",paddingX:"12",paddingY:"6",radius:"4",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:"400",fontSize:"12",lineHeight:"20"}},c={minHeight:"40",paddingX:"16",paddingY:"8",radius:"6",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:"400",fontSize:"14",lineHeight:"24"}},u={placeholder:"#AAAAAA"};const g={sm:{minHeight:l.minHeight,paddingX:l.paddingX,paddingY:l.paddingY,radius:l.radius,fontSize:l.typography.fontSize,lineHeight:l.typography.lineHeight,fontWeight:l.typography.fontWeight,fontFamily:l.typography.fontFamily},md:{minHeight:c.minHeight,paddingX:c.paddingX,paddingY:c.paddingY,radius:c.radius,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight,fontFamily:c.typography.fontFamily}},f={text:{placeholder:u.placeholder}},m={chipGap:`${{gap:"8"}.gap}px`},v=h.typography.feedback.sm.regular,b={fontSize:`${v.fontSize}px`,fontWeight:`${v.fontWeight}`,color:u.placeholder},y=p.listItem,x={radius:`${d.listBox.radius}px`,maxHeight:"260px",itemPaddingY:`${y.paddingY}px`,itemPaddingX:`${y.paddingLeft.depth1}px`,itemPaddingRight:`${y.paddingRight}px`,itemGap:`${y.gap}px`,itemFontSize:`${y.typography.default.fontSize}px`,itemFontWeight:y.typography.default.fontWeight,itemFontWeightSelected:y.typography.selected.fontWeight,itemLineHeight:`${y.typography.default.lineHeight}px`,itemFontFamily:y.typography.default.fontFamily,itemColor:y.content.default,itemColorHover:y.content.hover,itemBgHover:y.bg.hover,emptyColor:"#888888",emptyFontSize:"12px",emptyLineHeight:"20px"},w=class{constructor(s){i(this,s),this.update=t(this,"sdUpdate",7),this.focusEvent=t(this,"sdFocus",7),this.blurEvent=t(this,"sdBlur",7),this.inputEvent=t(this,"sdInput",7)}static SUGGESTIONS_VIEWPORT_PADDING=8;get host(){return s(this)}values=[];errors=[];disabledChips=[];size="sm";disabled=!1;placeholder="입력해 주세요.";name=n();rules=[];error=!1;useReset=!1;maxCount;suggestions=[];loadingSuggestions=!1;recommendedItems=[];loadingRecommendedItems=!1;label="";labelWidth="";hint="";errorMessage="";width="";status;icon=void 0;labelTooltip="";labelTooltipProps=null;internalValues=[];internalErrors=[];focused=!1;hovered=!1;inputValue="";activeSuggestionIndex=-1;suppressSuggestions=!1;suppressRecommendations=!1;inputEl;formField;chipInputRef;get value(){return this.internalValues}valuesChanged(i){this.internalValues=Array.isArray(i)?[...i]:[]}errorsChanged(i){Array.isArray(i)&&(this.internalErrors=[...i])}suggestionsChanged(i){Array.isArray(i)||(this.suggestions=[]),this.activeSuggestionIndex=-1,this.suppressSuggestions=!1}recommendedItemsChanged(i){Array.isArray(i)||(this.recommendedItems=[]),this.activeSuggestionIndex=-1}componentWillLoad(){this.internalValues=Array.isArray(this.values)?[...this.values]:[],Array.isArray(this.errors)&&(this.internalErrors=[...this.errors]),this.inputValue=this.inputValue??""}getChipError(i){return"function"==typeof this.errors?this.errors(this.internalValues?.[i]??""):this.internalErrors?.[i]??!1}getChipDisabled(i){return!!this.disabled||("function"==typeof this.disabledChips?this.disabledChips(this.internalValues?.[i]??""):this.disabledChips?.[i]??!1)}update;focusEvent;blurEvent;inputEvent;async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}async sdFocus(){return this.formField?.sdFocus()}addChip=i=>{if(null!=this.maxCount&&this.internalValues.length>=this.maxCount)return;const t=[...this.internalValues,i];if(this.internalValues=t,this.values=t,Array.isArray(this.errors)){const i=[...this.internalErrors,!1];this.internalErrors=i,this.errors=i}Array.isArray(this.disabledChips)&&(this.disabledChips=[...this.disabledChips,!1]),null!=this.inputEl&&(this.inputEl.value=""),this.inputValue="",this.activeSuggestionIndex=-1,this.suppressSuggestions=!0,this.update.emit(t),this.inputEvent.emit(""),this.inputEl?.focus(),this.suppressRecommendations=!0};handleChipRemove=i=>{const t=this.internalValues.filter(((t,s)=>s!==i));if(this.internalValues=t,this.values=t,Array.isArray(this.errors)){const t=this.internalErrors.filter(((t,s)=>s!==i));this.internalErrors=t,this.errors=t}Array.isArray(this.disabledChips)&&(this.disabledChips=this.disabledChips.filter(((t,s)=>s!==i))),this.update.emit(t),this.inputEl?.focus(),this.suppressRecommendations=!0};handleKeyDown=i=>{const t=i.target,s=this.suggestions??[],e=this.recommendedItems??[],n=this.focused&&""!==this.inputValue&&!this.suppressSuggestions&&(s.length>0||this.loadingSuggestions),h=this.focused&&""===this.inputValue&&!this.suppressRecommendations&&(e.length>0||this.loadingRecommendedItems),d=n?s:e;if(n||h){if("ArrowDown"===i.key)return i.preventDefault(),void(this.activeSuggestionIndex=Math.min(this.activeSuggestionIndex+1,d.length-1));if("ArrowUp"===i.key)return i.preventDefault(),void(this.activeSuggestionIndex=Math.max(this.activeSuggestionIndex-1,-1));if("Escape"===i.key)return n&&(this.suppressSuggestions=!0),h&&(this.suppressRecommendations=!0),void(this.activeSuggestionIndex=-1);if("Enter"===i.key&&this.activeSuggestionIndex>=0)return i.preventDefault(),void this.addChip(d[this.activeSuggestionIndex])}if("Enter"!==i.key||i.isComposing||""===t.value.trim()){if("Backspace"===i.key&&""===t.value&&this.internalValues.length>0){if(this.getChipDisabled(this.internalValues.length-1))return;i.preventDefault();const t=this.internalValues.slice(0,-1);if(this.internalValues=t,this.values=t,Array.isArray(this.errors)){const i=this.internalErrors.slice(0,-1);this.internalErrors=i,this.errors=i}Array.isArray(this.disabledChips)&&(this.disabledChips=this.disabledChips.slice(0,-1)),this.update.emit(t)}}else{if(null!=this.maxCount&&this.internalValues.length>=this.maxCount)return;i.preventDefault(),this.addChip(t.value.trim())}};handleInput=i=>{const t=i.target.value,s=""===t;""===this.inputValue!==s&&(this.activeSuggestionIndex=-1,s&&(this.suppressRecommendations=!1)),this.inputValue=t,this.suppressSuggestions=!1,this.inputEvent.emit(t)};handleFocus=()=>{this.focused=!0,this.suppressRecommendations=!1,this.focusEvent.emit()};handleBlur=()=>{this.focused=!1,this.activeSuggestionIndex=-1,this.blurEvent.emit()};closeSuggestions=()=>{this.focused=!1,this.activeSuggestionIndex=-1,this.suppressSuggestions=!0,this.suppressRecommendations=!0};handleContainerClick=()=>{this.disabled||this.inputEl?.focus()};handleResetInput=()=>{const i=this.internalValues.reduce(((i,t,s)=>(this.getChipDisabled(s)&&i.push(s),i)),[]),t=i.map((i=>this.internalValues[i]));if(this.internalValues=t,this.values=t,Array.isArray(this.errors)){const t=i.map((i=>this.internalErrors[i]??!1));this.internalErrors=t,this.errors=t}else this.internalErrors=[];if(Array.isArray(this.disabledChips)){const t=this.disabledChips;this.disabledChips=i.map((i=>t[i]))}this.update.emit(t),this.inputEl?.focus()};render(){const i=g[this.size]??g.sm,t={[`--sd-system-size-field-${this.size}-height`]:"auto",[`--sd-system-radius-field-${this.size}`]:`${i.radius}px`,"--sd-chip-input-min-height":`${i.minHeight}px`,"--sd-chip-input-padding-x":`${i.paddingX}px`,"--sd-chip-input-padding-y":`${i.paddingY}px`,"--sd-chip-input-font-size":`${i.fontSize}px`,"--sd-chip-input-line-height":`${i.lineHeight}px`,"--sd-chip-input-font-weight":i.fontWeight,"--sd-chip-input-font-family":i.fontFamily,"--sd-chip-input-chip-gap":m.chipGap,"--sd-chip-input-placeholder-color":f.text.placeholder,"--sd-chip-input-reset-gap":m.chipGap,"--sd-chip-input-divider-color":"#E1E1E1","--sd-chip-input-field-height":r.height,"--sd-chip-input-field-padding-x":r.paddingX,"--sd-chip-input-field-radius":r.radius,"--sd-chip-input-field-border-width":r.borderWidth,"--sd-chip-input-field-bg":a.bg.default,"--sd-chip-input-field-border-color":"transparent","--sd-chip-input-field-content":a.content.focus,"--sd-chip-input-field-font-size":o.focus.fontSize,"--sd-chip-input-field-font-weight":o.focus.fontWeight,"--sd-chip-input-field-line-height":o.focus.lineHeight,"--sd-chip-input-field-font-family":o.focus.fontFamily,"--sd-chip-input-max-count-font-size":b.fontSize,"--sd-chip-input-max-count-font-weight":b.fontWeight,"--sd-chip-input-max-count-color":b.color,"--sd-chip-input-suggestions-radius":x.radius,"--sd-chip-input-suggestions-max-height":x.maxHeight,"--sd-chip-input-suggestion-padding-y":x.itemPaddingY,"--sd-chip-input-suggestion-padding-x":x.itemPaddingX,"--sd-chip-input-suggestion-padding-right":x.itemPaddingRight,"--sd-chip-input-suggestion-gap":x.itemGap,"--sd-chip-input-suggestion-font-size":x.itemFontSize,"--sd-chip-input-suggestion-font-weight":x.itemFontWeight,"--sd-chip-input-suggestion-font-weight-selected":x.itemFontWeightSelected,"--sd-chip-input-suggestion-line-height":x.itemLineHeight,"--sd-chip-input-suggestion-font-family":x.itemFontFamily,"--sd-chip-input-suggestion-color":x.itemColor,"--sd-chip-input-suggestion-color-hover":x.itemColorHover,"--sd-chip-input-suggestion-bg-hover":x.itemBgHover,"--sd-chip-input-suggestions-empty-color":x.emptyColor,"--sd-chip-input-suggestions-empty-font-size":x.emptyFontSize,"--sd-chip-input-suggestions-empty-line-height":x.emptyLineHeight},s=null!=this.maxCount&&this.internalValues.length>=this.maxCount,n=this.useReset&&this.internalValues.length>0||null!=this.maxCount,h=this.suggestions??[],d=this.recommendedItems??[],p=this.focused&&""!==this.inputValue&&!this.suppressSuggestions&&(h.length>0||this.loadingSuggestions),l=p||this.focused&&""===this.inputValue&&!this.suppressRecommendations&&(d.length>0||this.loadingRecommendedItems),c=p?h:d,u=p?this.loadingSuggestions&&0===h.length:this.loadingRecommendedItems&&0===d.length,v={width:`${this.chipInputRef?.offsetWidth??0}px`,display:"flex",flexDirection:"column",boxSizing:"border-box",background:"#FFFFFF",borderRadius:x.radius,boxShadow:"2px 2px 12px 2px rgba(0, 0, 0, 0.1)",maxHeight:x.maxHeight,minHeight:"0",overflowY:"auto",overflowX:"hidden",outline:"none"},y={display:"flex",alignItems:"center",gap:x.itemGap,padding:`${x.itemPaddingY} ${x.itemPaddingRight} ${x.itemPaddingY} ${x.itemPaddingX}`,fontSize:x.itemFontSize,lineHeight:x.itemLineHeight,fontWeight:x.itemFontWeight,fontFamily:x.itemFontFamily,color:x.itemColor,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},_={padding:"12px",textAlign:"center",fontSize:x.emptyFontSize,lineHeight:x.emptyLineHeight,fontFamily:x.itemFontFamily,color:x.emptyColor};return e("sd-field",{key:"6ff0688cd9a076cd81693364bfeb6a98b5bf018e",name:this.name,label:this.label,labelWidth:this.labelWidth,hint:this.hint,errorMessage:this.errorMessage,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,width:this.width,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:i=>this.formField=i,style:t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},e("div",{key:"0c6ae92de4dcb44ed4fbcd12f1dddef93cec12db",class:"sd-chip-input",ref:i=>this.chipInputRef=i,onClick:this.handleContainerClick},(this.internalValues??[]).map(((i,t)=>e("sd-chip",{key:t,value:i,error:this.getChipError(t),disabled:this.getChipDisabled(t),editable:!1,onSdRemove:()=>this.handleChipRemove(t)}))),!s&&e("div",{key:"df111f3110b444ed296db8c6b7f00d9209f858af",class:{"sd-chip-input__field":!0,"sd-chip-input__field--filled":""!==this.inputValue,"sd-chip-input__field--empty":""===this.inputValue&&this.internalValues.length>0&&!this.focused},"data-value":""!==this.inputValue?this.inputValue:0===this.internalValues.length?this.placeholder:""},e("input",{key:"8e170c84cedab36edbdd0a84e7e2e1ac0fba9632",ref:i=>this.inputEl=i,class:"sd-chip-input__input",placeholder:0===this.internalValues.length?this.placeholder:"",disabled:this.disabled,size:1,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur})),n&&e("div",{key:"5b30bb4f89c9d3c9b18870acccad22bd97e1d748",class:"sd-chip-input__reset"},""===this.inputValue&&e("span",{key:"6fbf74a5a77b70789a609d28f5c4b6dd2aab57ef",class:"sd-chip-input__divider"}),null!=this.maxCount&&e("span",{key:"fbb21a27bdd2aa38870cfd8d16b7e5293769eaf3",class:"sd-chip-input__max-count"},"최대 ",this.maxCount,"개"),this.useReset&&this.internalValues.length>0&&e("sd-text-link",{key:"83626145602b13d7a00ef955a6db59f41c152529",icon:"reset",iconColor:"#888888",label:"입력 초기화",underline:!0,disabled:this.disabled,style:{"--sd-text-link-color":"#555555"},onSdClick:this.handleResetInput})),l&&e("sd-portal",{key:"1682a89b513098f192f776af782aa9ee432574e8",open:l,parentRef:this.chipInputRef??null,viewportPadding:w.SUGGESTIONS_VIEWPORT_PADDING,onSdClose:this.closeSuggestions},e("div",{key:"3efb484bd5616e411824f7014a759a34a9e93d8b",class:"sd-chip-input__suggestions",role:"listbox",style:v},u&&e("div",{key:"b5b1d5e6db03f6fe60864b6c19e9b2c753468447",class:"sd-chip-input__suggestions-empty",style:_},"불러오는 중..."),c.map(((i,t)=>e("div",{key:i,class:{"sd-chip-input__suggestion-item":!0,"sd-chip-input__suggestion-item--active":t===this.activeSuggestionIndex},role:"option",tabIndex:-1,"aria-selected":t===this.activeSuggestionIndex,style:t===this.activeSuggestionIndex?{...y,background:x.itemBgHover,color:x.itemColorHover,fontWeight:x.itemFontWeightSelected}:y,onMouseDown:t=>{t.preventDefault(),this.addChip(i)}},i)))))))}static get watchers(){return{values:[{valuesChanged:0}],errors:[{errorsChanged:0}],suggestions:[{suggestionsChanged:0}],recommendedItems:[{recommendedItemsChanged:0}]}}};w.style="sd-chip-input{display:inline-flex}sd-chip-input .sd-chip-input{position:relative;width:100%;isolation:isolate;min-height:var(--sd-chip-input-min-height);display:flex;flex-flow:row wrap;align-items:center;gap:var(--sd-chip-input-chip-gap);padding:var(--sd-chip-input-padding-y) var(--sd-chip-input-padding-x);cursor:text}sd-chip-input .sd-chip-input__reset{display:inline-flex;align-items:center;gap:var(--sd-chip-input-reset-gap);flex-shrink:0}sd-chip-input .sd-chip-input__divider{display:inline-block;width:1px;height:12px;background-color:var(--sd-chip-input-divider-color);flex-shrink:0}sd-chip-input .sd-chip-input__max-count{font-size:var(--sd-chip-input-max-count-font-size);font-weight:var(--sd-chip-input-max-count-font-weight);color:var(--sd-chip-input-max-count-color);white-space:nowrap;flex-shrink:0}sd-chip-input .sd-chip-input__field{flex:0 0 auto;display:inline-grid;grid-template-columns:minmax(0, max-content);align-items:center;min-width:1ch;max-width:100%;height:var(--sd-chip-input-field-height);box-sizing:border-box;padding:0;border:none;border-radius:0;background:transparent;overflow:hidden}sd-chip-input .sd-chip-input__field::after{content:attr(data-value);grid-area:1/1;visibility:hidden;white-space:pre;font-size:var(--sd-chip-input-field-font-size);line-height:var(--sd-chip-input-field-line-height);font-weight:var(--sd-chip-input-field-font-weight);font-family:var(--sd-chip-input-field-font-family)}sd-chip-input .sd-chip-input__field--filled{padding:0 var(--sd-chip-input-field-padding-x);border:var(--sd-chip-input-field-border-width) solid var(--sd-chip-input-field-border-color);border-radius:var(--sd-chip-input-field-radius);background:var(--sd-chip-input-field-bg)}sd-chip-input .sd-chip-input__field--empty{position:absolute;top:0;left:0;width:0;height:0;min-width:0;overflow:hidden}sd-chip-input .sd-chip-input__input{grid-area:1/1;width:100%;min-width:1ch;height:var(--sd-chip-input-field-height);margin:0;padding:0;border:none;outline:none;overflow:hidden;text-overflow:ellipsis;background:transparent;font-size:var(--sd-chip-input-field-font-size);line-height:var(--sd-chip-input-field-line-height);font-weight:var(--sd-chip-input-field-font-weight);font-family:var(--sd-chip-input-field-font-family);color:var(--sd-chip-input-field-content)}sd-chip-input .sd-chip-input__input[disabled]{cursor:not-allowed;pointer-events:none}sd-chip-input .sd-chip-input__input::placeholder{color:var(--sd-chip-input-placeholder-color)}sd-chip-input .sd-chip-input__suggestions{display:flex;flex-direction:column;box-sizing:border-box;background:white;border-radius:var(--sd-chip-input-suggestions-radius);box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);max-height:var(--sd-chip-input-suggestions-max-height);min-height:0;overflow-y:auto;overflow-x:hidden;outline:none}sd-chip-input .sd-chip-input__suggestion-item{display:flex;align-items:center;gap:var(--sd-chip-input-suggestion-gap);padding:var(--sd-chip-input-suggestion-padding-y) var(--sd-chip-input-suggestion-padding-right) var(--sd-chip-input-suggestion-padding-y) var(--sd-chip-input-suggestion-padding-x);font-size:var(--sd-chip-input-suggestion-font-size);line-height:var(--sd-chip-input-suggestion-line-height);font-weight:var(--sd-chip-input-suggestion-font-weight);font-family:var(--sd-chip-input-suggestion-font-family);color:var(--sd-chip-input-suggestion-color);cursor:pointer;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-chip-input .sd-chip-input__suggestion-item--active{background:var(--sd-chip-input-suggestion-bg-hover);color:var(--sd-chip-input-suggestion-color-hover);font-weight:var(--sd-chip-input-suggestion-font-weight-selected)}sd-chip-input .sd-chip-input__suggestions-empty{padding:12px;text-align:center;font-size:var(--sd-chip-input-suggestions-empty-font-size);line-height:var(--sd-chip-input-suggestions-empty-line-height);font-family:var(--sd-chip-input-suggestion-font-family);color:var(--sd-chip-input-suggestions-empty-color)}";export{w as sd_chip_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as l}from"./p-CAxodB5I.js";import{s as a}from"./p-BJfiMC9H.js";import{t as d}from"./p-D6GUzecR.js";const s=d.table,r=Number(s.keyValue.height),i=Number(s.radius),n=Number(s.keyValue.body.padding),o=Number(s.header.gap),u=Number(s.content.gap),v=Number(s.border.width),b=Number(s.keyValue.search.paddingX),k={border:s.border.color,thBg:s.header.bg,thLabel:a.color.fg.primary,required:a.color.fg.accent,helpIcon:a.color.fg.success,tdBg:a.color.bg.frame,tdText:a.color.fg.primary,searchBg:s.keyValue.search.bg},h={labelFontFamily:s.header.typography.fontFamily,labelFontSize:Number(s.header.typography.fontSize),labelFontWeight:700,labelLineHeight:Number(s.header.typography.lineHeight),tdFontFamily:s.body.typography.fontFamily,tdFontSize:Number(s.body.typography.fontSize),tdFontWeight:Number(s.body.typography.fontWeight),tdLineHeight:Number(s.body.typography.lineHeight)},c=class{constructor(l){e(this,l),this.change=t(this,"sdChange",7),this.searchEvent=t(this,"sdSearch",7)}fields=[];search=!1;useTop=!1;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 l("sd-input",{width:"100%",...e.options??{},onSdUpdate:t});case"textarea":return l("sd-textarea",{width:"100%",...e.options??{},onSdUpdate:t});case"number-input":return l("sd-number-input",{width:"100%",...e.options??{},onSdUpdate:t});case"select":return l("sd-select",{width:"100%",...e.options??{},onSdUpdate:t});case"radio":{const{value:a,direction:d,...s}=e.options??{};return l("sd-radio-group",{...s,value:a,direction:d??"horizontal",onSdUpdate:t})}case"checkbox":{const{value:a,...d}=e.options??{};return l("sd-checkbox",{...d,value:a,onSdUpdate:t})}case"date-picker":return l("sd-date-picker",{width:"100%",...e.options??{},onSdUpdate:t});case"date-range-picker":return l("sd-date-range-picker",{width:"100%",...e.options??{},onSdUpdate:t});case"file-picker":return l("sd-file-picker",{width:"100%",...e.options??{},onSdUpdate:t});default:return l("span",{class:"sd-key-value-table__text"},e.options?.value??"")}}renderHelpIcon(e){return l("span",{class:"sd-key-value-table__help"},l("sd-tooltip",{icon:"helpOutline",iconSize:16,color:k.helpIcon,trigger:"hover"},e))}computeAutoSkipTh(){const e=this.fields.map((e=>e.map((()=>!1))));return this.fields.forEach(((t,l)=>{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[l+t];d&&a<d.length&&(d[a]=!0)}}))})),e}computeMaxCols(e){let t=0;return this.fields.forEach(((l,a)=>{let d=0;l.forEach(((t,l)=>{let s;s=t.hideTh?0:e[a]?.[l]?1:null!=t.thColSpan&&t.thColSpan>1?t.thColSpan:1,d+=s+(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,a){const d=null!=e.thRowSpan&&e.thRowSpan>1?e.thRowSpan:void 0,s=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 l("th",{key:`th-${t}-${a}`,class:r,style:i,scope:"row",rowSpan:d,colSpan:s},l("div",{class:"sd-key-value-table__th-inner"},l("span",{class:"sd-key-value-table__label"},e.label,e.required&&l("sd-icon",{class:"sd-key-value-table__required",name:"star",size:12,color:k.required,label:"required"})),e.helpText&&this.renderHelpIcon(e.helpText)))}renderTd(e,t,a){return l("td",{key:`td-${t}-${a}`,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},l("div",{class:"sd-key-value-table__td-inner"},l("slot",{name:`field-${e.name}`},this.renderField(e))))}warnDuplicateNames(){const e=new Set,t=new Set;this.fields.forEach((l=>l.forEach((l=>{e.has(l.name)?t.add(l.name):e.add(l.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":`${r}px`,"--sd-kvt-th-width":"120px","--sd-kvt-radius":`${i}px`,"--sd-kvt-padding":`${n}px`,"--sd-kvt-gap":`${o}px`,"--sd-kvt-label-gap":`${u}px`,"--sd-kvt-border-width":`${v}px`,"--sd-kvt-border-color":k.border,"--sd-kvt-th-bg":k.thBg,"--sd-kvt-th-color":k.thLabel,"--sd-kvt-required-color":k.required,"--sd-kvt-td-bg":k.tdBg,"--sd-kvt-td-color":k.tdText,"--sd-kvt-label-font-family":h.labelFontFamily,"--sd-kvt-label-font-size":`${h.labelFontSize}px`,"--sd-kvt-label-font-weight":`${h.labelFontWeight}`,"--sd-kvt-label-line-height":`${h.labelLineHeight}px`,"--sd-kvt-td-font-family":h.tdFontFamily,"--sd-kvt-td-font-size":`${h.tdFontSize}px`,"--sd-kvt-td-font-weight":`${h.tdFontWeight}`,"--sd-kvt-td-line-height":`${h.tdLineHeight}px`,"--sd-kvt-search-bg":k.searchBg,"--sd-kvt-search-padding-x":`${b}px`};this.warnDuplicateNames();const t=this.computeAutoSkipTh(),a=this.computeMaxCols(t),d=l("table",{class:{"sd-key-value-table":!0,"sd-key-value-table--use-top":this.useTop},style:e},l("colgroup",null,Array.from({length:a},((e,t)=>{if(t%2!=0)return l("col",{key:`col-${t}`});const a=t/2,d=this.fields.reduce(((e,t)=>null!=e?e:t[a]?.thWidth),void 0);return l("col",{key:`col-${t}`,style:{width:null!=d?"number"==typeof d?`${d}px`:d:"120px"}})}))),l("tbody",null,this.fields.map(((e,a)=>l("tr",{class:"sd-key-value-table__row",key:`row-${a}`},e.map(((e,l)=>[e.hideTh||t[a][l]?null:this.renderTh(e,a,l),this.renderTd(e,a,l)])))))));return this.search?l("div",{class:{"sd-key-value-table__wrapper":!0,"sd-key-value-table__wrapper--use-top":this.useTop},style:e},d,l("div",{class:"sd-key-value-table__search-panel"},l("sd-button",{label:"검색",name:"neutral_outline_md",onSdClick:this.handleSearchClick}))):d}};c.style="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--use-top{border-top-left-radius:0;border-top-right-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--use-top{border-top-left-radius:0;border-top-right-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);padding:var(--sd-kvt-padding);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{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{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)}";export{c as sd_key_value_table}
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, a as getElement, h } from './index-CAxodB5I.js';
|
|
2
|
-
|
|
3
|
-
const SdPortal = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
this.close = createEvent(this, "sdClose", 3);
|
|
7
|
-
}
|
|
8
|
-
get hostEl() { return getElement(this); }
|
|
9
|
-
to = 'body';
|
|
10
|
-
parentRef = null;
|
|
11
|
-
offset = [0, 4];
|
|
12
|
-
viewportPadding = 0;
|
|
13
|
-
zIndex = 998;
|
|
14
|
-
open = false;
|
|
15
|
-
close;
|
|
16
|
-
container;
|
|
17
|
-
wrapper;
|
|
18
|
-
rafId;
|
|
19
|
-
isInsideClick = false;
|
|
20
|
-
closeTransitionTimer;
|
|
21
|
-
handleObservedScroll = () => this.updatePosition();
|
|
22
|
-
resizeObserver;
|
|
23
|
-
mutationObserver;
|
|
24
|
-
scrollParents = [];
|
|
25
|
-
isObserved = false;
|
|
26
|
-
handleOpenChange() {
|
|
27
|
-
this.syncPortalState();
|
|
28
|
-
}
|
|
29
|
-
componentDidLoad() {
|
|
30
|
-
this.container = this.resolveContainer();
|
|
31
|
-
this.syncPortalState();
|
|
32
|
-
}
|
|
33
|
-
componentDidRender() {
|
|
34
|
-
this.syncPortalState();
|
|
35
|
-
}
|
|
36
|
-
disconnectedCallback() {
|
|
37
|
-
if (this.closeTransitionTimer)
|
|
38
|
-
clearTimeout(this.closeTransitionTimer);
|
|
39
|
-
this.unobserveParent();
|
|
40
|
-
if (this.wrapper?.parentNode) {
|
|
41
|
-
try {
|
|
42
|
-
this.wrapper.parentNode.removeChild(this.wrapper);
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
// Stencil spec mock DOM can already detach the wrapper before this callback runs.
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
resolveContainer() {
|
|
50
|
-
const el = typeof this.to === 'string' ? document.querySelector(this.to) : this.to;
|
|
51
|
-
return el instanceof HTMLElement ? el : document.body;
|
|
52
|
-
}
|
|
53
|
-
createWrapper() {
|
|
54
|
-
this.wrapper = document.createElement('div');
|
|
55
|
-
Object.assign(this.wrapper.style, {
|
|
56
|
-
position: 'fixed',
|
|
57
|
-
top: '0',
|
|
58
|
-
left: '0',
|
|
59
|
-
zIndex: (this.zIndex ?? 998).toString(),
|
|
60
|
-
opacity: '0',
|
|
61
|
-
transition: 'opacity 0.15s ease-out',
|
|
62
|
-
boxSizing: 'border-box',
|
|
63
|
-
visibility: 'hidden',
|
|
64
|
-
});
|
|
65
|
-
this.container.appendChild(this.wrapper);
|
|
66
|
-
}
|
|
67
|
-
ensureWrapper() {
|
|
68
|
-
if (this.wrapper)
|
|
69
|
-
return;
|
|
70
|
-
this.container ||= this.resolveContainer();
|
|
71
|
-
this.createWrapper();
|
|
72
|
-
this.moveSlotContent();
|
|
73
|
-
}
|
|
74
|
-
syncPortalState() {
|
|
75
|
-
if (!this.open) {
|
|
76
|
-
if (this.wrapper) {
|
|
77
|
-
this.wrapper.style.transition = 'opacity 0.15s ease-out';
|
|
78
|
-
this.wrapper.style.opacity = '0';
|
|
79
|
-
this.wrapper.style.pointerEvents = 'none';
|
|
80
|
-
if (this.closeTransitionTimer)
|
|
81
|
-
clearTimeout(this.closeTransitionTimer);
|
|
82
|
-
this.closeTransitionTimer = setTimeout(() => {
|
|
83
|
-
if (this.wrapper && !this.open) {
|
|
84
|
-
this.wrapper.style.display = 'none';
|
|
85
|
-
}
|
|
86
|
-
}, 150);
|
|
87
|
-
}
|
|
88
|
-
this.unobserveParent();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (this.closeTransitionTimer)
|
|
92
|
-
clearTimeout(this.closeTransitionTimer);
|
|
93
|
-
this.ensureWrapper();
|
|
94
|
-
if (!this.wrapper)
|
|
95
|
-
return;
|
|
96
|
-
this.wrapper.style.display = 'block';
|
|
97
|
-
this.wrapper.style.transition = 'opacity 0.25s ease-out';
|
|
98
|
-
this.wrapper.style.opacity = '0';
|
|
99
|
-
this.wrapper.style.pointerEvents = '';
|
|
100
|
-
this.observeParent();
|
|
101
|
-
this.updatePosition();
|
|
102
|
-
}
|
|
103
|
-
moveSlotContent() {
|
|
104
|
-
if (!this.wrapper)
|
|
105
|
-
return;
|
|
106
|
-
const nodes = Array.from(this.hostEl.childNodes).filter(n => n.nodeType !== Node.COMMENT_NODE);
|
|
107
|
-
nodes.forEach(n => this.wrapper.appendChild(n));
|
|
108
|
-
}
|
|
109
|
-
// 위치 갱신 (scroll / resize)
|
|
110
|
-
updatePosition() {
|
|
111
|
-
if (this.rafId !== undefined)
|
|
112
|
-
cancelAnimationFrame(this.rafId);
|
|
113
|
-
this.rafId = requestAnimationFrame(() => {
|
|
114
|
-
if (!this.parentRef || !this.wrapper)
|
|
115
|
-
return;
|
|
116
|
-
const parentRect = this.parentRef.getBoundingClientRect();
|
|
117
|
-
const viewport = {
|
|
118
|
-
width: window.innerWidth,
|
|
119
|
-
height: window.innerHeight,
|
|
120
|
-
};
|
|
121
|
-
const offset = this.offset ?? [0, 4];
|
|
122
|
-
const viewportPadding = Math.max(0, this.viewportPadding ?? 0);
|
|
123
|
-
const maxWidth = Math.max(viewport.width - viewportPadding * 2, 0);
|
|
124
|
-
const maxHeight = Math.max(viewport.height - viewportPadding * 2, 0);
|
|
125
|
-
this.wrapper.style.maxWidth = `${maxWidth}px`;
|
|
126
|
-
this.wrapper.style.maxHeight = `${maxHeight}px`;
|
|
127
|
-
const wrapperRect = this.wrapper.getBoundingClientRect();
|
|
128
|
-
const availableBelow = viewport.height - parentRect.bottom - offset[1] - viewportPadding;
|
|
129
|
-
const availableAbove = parentRect.top - offset[1] - viewportPadding;
|
|
130
|
-
let top = parentRect.bottom + offset[1];
|
|
131
|
-
let left = parentRect.left + offset[0];
|
|
132
|
-
if (availableBelow < wrapperRect.height && availableAbove > availableBelow) {
|
|
133
|
-
top = parentRect.top - wrapperRect.height - offset[1];
|
|
134
|
-
}
|
|
135
|
-
const minTop = viewportPadding;
|
|
136
|
-
const maxTop = viewport.height - viewportPadding - wrapperRect.height;
|
|
137
|
-
if (maxTop < minTop) {
|
|
138
|
-
top = minTop;
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
top = Math.min(Math.max(top, minTop), maxTop);
|
|
142
|
-
}
|
|
143
|
-
if (parentRect.left + wrapperRect.width + offset[0] > viewport.width - viewportPadding) {
|
|
144
|
-
left = parentRect.right - wrapperRect.width - offset[0];
|
|
145
|
-
}
|
|
146
|
-
const minLeft = viewportPadding;
|
|
147
|
-
const maxLeft = viewport.width - viewportPadding - wrapperRect.width;
|
|
148
|
-
if (maxLeft < minLeft) {
|
|
149
|
-
left = minLeft;
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
left = Math.min(Math.max(left, minLeft), maxLeft);
|
|
153
|
-
}
|
|
154
|
-
this.wrapper.style.top = `${top}px`;
|
|
155
|
-
this.wrapper.style.left = `${left}px`;
|
|
156
|
-
this.wrapper.style.visibility = 'visible';
|
|
157
|
-
this.wrapper.style.opacity = '1';
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
// parentRef의 이동 / 크기변경 감지
|
|
161
|
-
observeParent() {
|
|
162
|
-
if (!this.parentRef || this.isObserved)
|
|
163
|
-
return;
|
|
164
|
-
this.observeScrollParents(this.parentRef);
|
|
165
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
166
|
-
this.resizeObserver = new ResizeObserver(() => this.updatePosition());
|
|
167
|
-
this.resizeObserver.observe(this.parentRef);
|
|
168
|
-
}
|
|
169
|
-
if (typeof MutationObserver !== 'undefined') {
|
|
170
|
-
this.mutationObserver = new MutationObserver(() => this.updatePosition());
|
|
171
|
-
this.mutationObserver.observe(document.body, {
|
|
172
|
-
childList: true,
|
|
173
|
-
subtree: true,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
this.isObserved = true;
|
|
177
|
-
}
|
|
178
|
-
unobserveParent() {
|
|
179
|
-
if (!this.isObserved)
|
|
180
|
-
return;
|
|
181
|
-
this.unobserveScrollParents();
|
|
182
|
-
this.resizeObserver?.disconnect();
|
|
183
|
-
this.resizeObserver = undefined;
|
|
184
|
-
this.mutationObserver?.disconnect();
|
|
185
|
-
this.mutationObserver = undefined;
|
|
186
|
-
this.isObserved = false;
|
|
187
|
-
}
|
|
188
|
-
observeScrollParents(element) {
|
|
189
|
-
const nextScrollParents = this.getScrollParents(element);
|
|
190
|
-
nextScrollParents.forEach(parent => {
|
|
191
|
-
parent.addEventListener('scroll', this.handleObservedScroll, { passive: true });
|
|
192
|
-
});
|
|
193
|
-
this.scrollParents = nextScrollParents;
|
|
194
|
-
}
|
|
195
|
-
unobserveScrollParents() {
|
|
196
|
-
this.scrollParents.forEach(parent => {
|
|
197
|
-
parent.removeEventListener('scroll', this.handleObservedScroll);
|
|
198
|
-
});
|
|
199
|
-
this.scrollParents = [];
|
|
200
|
-
}
|
|
201
|
-
getScrollParents(element) {
|
|
202
|
-
const scrollParents = [];
|
|
203
|
-
let currentElement = element.parentElement;
|
|
204
|
-
while (currentElement) {
|
|
205
|
-
const { overflow, overflowX, overflowY } = getComputedStyle(currentElement);
|
|
206
|
-
const isScrollable = [overflow, overflowX, overflowY].some(value => /(auto|scroll|overlay)/.test(value));
|
|
207
|
-
if (isScrollable) {
|
|
208
|
-
scrollParents.push(currentElement);
|
|
209
|
-
}
|
|
210
|
-
currentElement = currentElement.parentElement;
|
|
211
|
-
}
|
|
212
|
-
return scrollParents;
|
|
213
|
-
}
|
|
214
|
-
isInsideTarget(target) {
|
|
215
|
-
return !!((this.wrapper?.contains(target)) ||
|
|
216
|
-
(this.parentRef?.contains(target)));
|
|
217
|
-
}
|
|
218
|
-
// 외부 클릭 감지
|
|
219
|
-
handleMouseDown(e) {
|
|
220
|
-
this.isInsideClick = this.isInsideTarget(e.target);
|
|
221
|
-
}
|
|
222
|
-
handleWindowClick(e) {
|
|
223
|
-
if (this.isInsideClick) {
|
|
224
|
-
this.isInsideClick = false;
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
if (this.isInsideTarget(e.target))
|
|
228
|
-
return;
|
|
229
|
-
this.close.emit();
|
|
230
|
-
}
|
|
231
|
-
render() {
|
|
232
|
-
return h("slot", { key: '22e09896836d017f33a9c6b92772a00fc85f8997' });
|
|
233
|
-
}
|
|
234
|
-
static get watchers() { return {
|
|
235
|
-
"open": [{
|
|
236
|
-
"handleOpenChange": 0
|
|
237
|
-
}]
|
|
238
|
-
}; }
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
export { SdPortal as sd_portal };
|