@sellmate/design-system 1.0.41 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/sd-button_20.cjs.entry.js +10 -2
- package/dist/cjs/sd-confirm-modal.cjs.entry.js +4 -4
- package/dist/cjs/sd-modal-container.cjs.entry.js +17 -9
- package/dist/cjs/sd-popover.cjs.entry.js +10 -2
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +5 -5
- package/dist/collection/components/sd-modal-container/sd-modal-container.js +18 -10
- package/dist/collection/components/sd-popover/sd-popover.js +10 -2
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +10 -2
- package/dist/components/{p-DGA1KNaL.js → p-AfdVu7_V.js} +1 -1
- package/dist/components/{p-CHq9aVFe.js → p-B2IPxQNl.js} +1 -1
- package/dist/components/{p-D6ayf5l7.js → p-BZJDhQ6h.js} +1 -1
- package/dist/components/p-CArAuWdh.js +1 -0
- package/dist/components/p-CnZPI5RL.js +1 -0
- package/dist/components/{p-DpqpugGF.js → p-jaHdAlr9.js} +1 -1
- package/dist/components/{p-DZ8T3piH.js → p-jk3tAdJg.js} +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-input.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-popover.js +1 -1
- package/dist/components/sd-select-dropdown.js +1 -1
- package/dist/components/sd-select-group.js +1 -1
- package/dist/components/sd-select-multiple-group.js +1 -1
- package/dist/components/sd-select-multiple.js +1 -1
- package/dist/components/sd-select-search-input.js +1 -1
- package/dist/components/sd-select-v2.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-ae3b8832.entry.js → p-4921c569.entry.js} +1 -1
- package/dist/design-system/p-535b0778.entry.js +1 -0
- package/dist/design-system/p-6db4e8c7.entry.js +1 -0
- package/dist/design-system/p-f91f4fcc.entry.js +1 -0
- package/dist/esm/sd-button_20.entry.js +10 -2
- package/dist/esm/sd-confirm-modal.entry.js +4 -4
- package/dist/esm/sd-modal-container.entry.js +17 -9
- package/dist/esm/sd-popover.entry.js +10 -2
- package/dist/types/components/sd-confirm-modal/sd-confirm-modal.d.ts +1 -1
- package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +3 -0
- package/dist/types/components/sd-popover/sd-popover.d.ts +1 -0
- package/dist/types/components/sd-tooltip/sd-tooltip.d.ts +1 -0
- package/dist/types/components.d.ts +2 -2
- package/hydrate/index.js +41 -17
- package/hydrate/index.mjs +41 -17
- package/package.json +1 -1
- package/dist/components/p-C4sDmQQ3.js +0 -1
- package/dist/components/p-Pdmk6q_e.js +0 -1
- package/dist/design-system/p-40614adb.entry.js +0 -1
- package/dist/design-system/p-a3c9d924.entry.js +0 -1
- package/dist/design-system/p-d63e0f4c.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,g as t,h as e,F as o}from"./p-B8tGP77V.js";import{T as i}from"./p-BeCHKP_I.js";var a={icon:"12",color:"#888888"},n="#07284A";const c=class{constructor(t){s(this,t)}get el(){return t(this)}show=!1;placement="bottom";color="#01BB4B";icon="helpOutline";iconSize=12;label="";buttonSize="sm";buttonVariant="primary";menuTitle;messages=[];buttons=[];menuClass="";noHover=!0;useClose=!1;showPopover=!1;slotContent="";watchShowHandler(s){this.showPopover=s}componentWillLoad(){this.showPopover=this.show,this.slotContent=this.el.innerHTML}buttonEl;get popoverOffset(){switch(this.placement){case"top":return[0,-4];case"bottom":return[0,4];case"left":case"right":return[4,0]}}handleClose=()=>{this.showPopover=!1};render(){return e(o,{key:"f367ea2ada0fda7c28c943bd7bd48785b1810999"},this.label?e("sd-button",{ref:s=>this.buttonEl=s,label:this.label,icon:this.icon,size:this.buttonSize,color:this.color,variant:this.buttonVariant,class:"sd-popover",onSdClick:()=>this.showPopover=!this.showPopover}):e("sd-icon",{ref:s=>this.buttonEl=s,name:this.icon,size:this.iconSize,color:this.color,class:"sd-popover",onClick:()=>this.showPopover=!this.showPopover}),this.showPopover&&e("sd-floating-portal",{key:"afdb58bfdf25af2adc45a7b81221c1859b517a5a",parentRef:this.buttonEl,onSdClose:this.handleClose,placement:this.placement,offset:this.popoverOffset},e("div",{key:"38757707dd8c055674edbc2381409f5fd8712c8d",class:{"sd-floating-menu":!0,"sd-floating-menu--popover":!0,[`sd-floating-menu--${this.placement}`]:!0,[this.menuClass]:!!this.menuClass},style:{"--sd-floating-bg":n}},e("i",{key:"333bae4cb23470121d63d4d8b34a1d2b15837e7d",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}`},e(i,{key:"617781bb6fc8957576eb149471fd8bf0f44ca552"})),e("div",{key:"8c57d49782edd344c8c2c0b9bf44fff8ec154159",class:"sd-floating-menu__content"},this.menuTitle&&e("div",{key:"a06b93124684cb96910ffa2603cf7410a01d6381",class:"sd-floating-menu__title"},this.menuTitle),this.messages.length>0&&e("div",{key:"24691930b8ae03a3c92ed8e74dae708b5e64f03b",class:"sd-floating-menu__messages"},this.messages.map((s=>e("div",null,s)))),this.buttons.length>0&&e("div",{key:"d73cd4cc978711857c4c946dd2a1c1b64bb5feb6",class:`sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}`},this.buttons.map((s=>e("sd-button",{...s}))))),this.useClose&&e("button",{key:"cda218024d04b03fc2931afa99f0127bc7a9c4c5",title:"close",class:"sd-floating-menu__close-button",onClick:()=>this.handleClose()},e("sd-icon",{key:"3f41ebce27fd4bab823370d6bbe25b5caed9d5e1",name:"close",size:a.icon,color:a.color})))))}static get watchers(){return{show:[{watchShowHandler:0}]}}};c.style="sd-popover{position:relative;cursor:pointer;display:inline-flex}";export{c as sd_popover}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,g as s,h as i}from"./p-B8tGP77V.js";let e=0;const o=class{constructor(s){t(this,s)}get el(){return s(this)}entries=[];isVisible=!1;isBackdropVisible=!1;contentRef;containerDismissTimerId;handleKeydown(t){if("Escape"===t.key){const t=this.getTopEntry();if(!t)return;if(t.persistent)return void this.shakeModal(t.modalEl);this.requestDismiss(t.id,"close")}}async open(t,s){const i="modal-"+ ++e,o=this.createConfirmModal(i,t);return this.containerDismissTimerId&&(clearTimeout(this.containerDismissTimerId),this.containerDismissTimerId=void 0),this.entries=[...this.entries??[],{id:i,modalEl:o,chain:s,persistent:!!t.persistent,closeAction:t.closeAction??"none",closing:!1}],this.isVisible=!0,requestAnimationFrame((()=>{this.contentRef&&(this.contentRef.appendChild(o),this.waitForModalReady(o).then((()=>{requestAnimationFrame((()=>{const t=(this.entries??[]).find((t=>t.id===i));t&&!t.closing&&o.isConnected&&(this.isBackdropVisible=!0,o.classList.add("sd-modal-container__modal--visible"))}))})))})),i}async update(t,s){const i=(this.entries??[]).find((s=>s.id===t));i&&!i.closing&&this.applyProps(i.modalEl,s)}createConfirmModal(t,s){const i=document.createElement("sd-confirm-modal");return i.setAttribute("data-modal-id",t),i.classList.add("sd-modal-container__modal"),this.applyProps(i,s),i.addEventListener("sdOk",(()=>{this.requestDismiss(t,"confirm")})),i.addEventListener("sdClose",(()=>{this.requestDismiss(t,"close")})),i}applyProps(t,s){this.hasOwnProp(s,"type")&&this.setAttr(t,"type",s.type),this.hasOwnProp(s,"title")&&this.setAttr(t,"modal-title",s.title),this.hasOwnProp(s,"titleClass")&&this.setAttr(t,"title-class",s.titleClass),this.hasOwnProp(s,"mainButtonLabel")&&this.setAttr(t,"main-button-label",s.mainButtonLabel),this.hasOwnProp(s,"mainButtonName")&&this.setAttr(t,"main-button-name",s.mainButtonName),this.hasOwnProp(s,"subButtonLabel")&&this.setAttr(t,"sub-button-label",s.subButtonLabel),this.hasOwnProp(s,"tagPreset")&&this.setAttr(t,"tag-preset",s.tagPreset),this.hasOwnProp(s,"tagLabel")&&this.setAttr(t,"tag-label",s.tagLabel),this.hasOwnProp(s,"slotLabel")&&this.setAttr(t,"slot-label",s.slotLabel),this.hasOwnProp(s,"topMessage")&&(t.topMessage=s.topMessage??[]),this.hasOwnProp(s,"bottomMessage")&&(t.bottomMessage=s.bottomMessage??[]),this.hasOwnProp(s,"tagContents")&&(t.tagContents=s.tagContents)}handleBackdropClick=()=>{const t=this.getTopEntry();t&&(t.persistent?this.shakeModal(t.modalEl):this.requestDismiss(t.id,"close"))};shakeModal(t){const s="sd-modal-container__modal--shake";t.classList.remove(s),t.addEventListener("animationend",(()=>t.classList.remove(s)),{once:!0}),requestAnimationFrame((()=>{t.classList.add(s)}))}disconnectedCallback(){(this.entries??[]).forEach((t=>{t.dismissTimerId&&clearTimeout(t.dismissTimerId)})),this.containerDismissTimerId&&clearTimeout(this.containerDismissTimerId)}getTopEntry(){return[...this.entries??[]].reverse().find((t=>!t.closing))}requestDismiss(t,s){const i=(this.entries??[]).find((s=>s.id===t));if(!i||i.closing)return;i.modalEl.classList.remove("sd-modal-container__modal--visible"),0===(this.entries??[]).filter((s=>s.id!==t&&!s.closing)).length&&(this.isBackdropVisible=!1);const e=setTimeout((()=>{this.finalizeDismiss(t)}),350);this.entries=(this.entries??[]).map((s=>s.id===t?{...s,closing:!0,dismissTimerId:e}:s)),"close"===s?"ok"===i.closeAction?i.chain._triggerOk():"cancel"===i.closeAction&&i.chain._triggerCancel():("confirm"===s&&i.chain._triggerOk(),"cancel"===s&&i.chain._triggerCancel())}finalizeDismiss(t){const s=(this.entries??[]).find((s=>s.id===t));if(!s)return;s.dismissTimerId&&clearTimeout(s.dismissTimerId),s.modalEl.remove();const i=(this.entries??[]).filter((s=>s.id!==t));this.entries=i,0===i.length&&(this.containerDismissTimerId=setTimeout((()=>{0===(this.entries??[]).length&&(this.isVisible=!1),this.containerDismissTimerId=void 0}),350))}waitForModalReady(t){const s=t.componentOnReady;return"function"==typeof s?s.call(t).then((()=>{})):new Promise((t=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>t()))}))}))}hasOwnProp(t,s){return Object.prototype.hasOwnProperty.call(t,s)}setAttr(t,s,i){null!=i&&t.setAttribute(s,i)}render(){return this.isVisible?i("div",{class:"sd-modal-container"},i("div",{class:{"sd-modal-container__backdrop":!0,"sd-modal-container__backdrop--visible":this.isBackdropVisible},onClick:this.handleBackdropClick}),i("div",{class:"sd-modal-container__content",ref:t=>{this.contentRef=t}})):null}};o.style="sd-modal-container{display:block}sd-modal-container .sd-modal-container{position:fixed;inset:0;z-index:var(--sd-modal-container-z-index, 10000);display:flex;align-items:center;justify-content:center}sd-modal-container .sd-modal-container__backdrop{position:absolute;inset:0;background:rgba(0, 0, 0, 0.4);opacity:0;transition:opacity 0.3s ease-out}sd-modal-container .sd-modal-container__backdrop--visible{opacity:1}sd-modal-container .sd-modal-container__content{position:relative;z-index:1;display:grid;place-items:center}sd-modal-container .sd-modal-container__content>*{grid-row:1;grid-column:1}sd-modal-container .sd-modal-container__modal{opacity:0;transform:scale(0);transition:opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)}sd-modal-container .sd-modal-container__modal--visible{opacity:1;transform:scale(1)}sd-modal-container .sd-modal-container__modal--shake{animation:modal-shake 0.3s ease-out}@keyframes modal-shake{0%,100%{transform:scale(1)}25%{transform:scale(1.03)}50%{transform:scale(0.97)}75%{transform:scale(1.01)}}";export{o as sd_modal_container}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as t,g as i,h as e}from"./p-B8tGP77V.js";var s={title:{icon:"32"},positive:{icon:"#0075FF"},negative:{icon:"#E30000"}},a={size:"20",color:"#888888"};const d={positive:"primary_md",negative:"danger_md",default:"neutral_outline_md"},n={positive:"notificationOutline",negative:"warningOutline",default:null},l={positive:s.positive.icon,negative:s.negative.icon,default:""},c=Number(s.title.icon),m=Number(a.size),r=a.color,f=class{constructor(i){o(this,i),this.close=t(this,"sdClose"),this.ok=t(this,"sdOk")}get el(){return i(this)}hasSlottedContent=!1;customContentRef;slotObserver;type="positive";modalTitle="";titleClass="";topMessage=[];bottomMessage=[];mainButtonName;mainButtonLabel="확인";subButtonLabel="";tagPreset="square_sm_grey";tagLabel="";slotLabel="";tagContents;close;ok;componentWillLoad(){this.syncHasSlottedContent()}componentDidLoad(){"undefined"!=typeof MutationObserver&&(this.slotObserver=new MutationObserver((()=>this.syncHasSlottedContent())),this.slotObserver.observe(this.el,{childList:!0,characterData:!0}))}componentDidRender(){this.customContentRef&&this.tagContents instanceof HTMLElement&&("function"==typeof this.customContentRef.replaceChildren?this.customContentRef.replaceChildren(this.tagContents):(this.customContentRef.innerHTML="",this.customContentRef.appendChild(this.tagContents)))}disconnectedCallback(){this.slotObserver?.disconnect()}get resolvedMainButton(){return this.mainButtonName??d[this.type]}get hasTagContent(){return!(!this.tagLabel&&!this.slotLabel)}get showContentBox(){return!!this.tagContents||this.hasTagContent||this.hasSlottedContent}syncHasSlottedContent(){const o=Array.from(this.el.childNodes).some((o=>!(o.nodeType===Node.ELEMENT_NODE&&o.classList.contains("sd-confirm-modal"))&&(o.nodeType===Node.ELEMENT_NODE||o.nodeType===Node.TEXT_NODE&&o.textContent?.trim())));o!==this.hasSlottedContent&&(this.hasSlottedContent=o)}render(){const o=n[this.type],t=l[this.type];return e("div",{key:"9dd835c1020a29e99257690b5d4d6038b13fe5e4",class:"sd-confirm-modal"},e("sd-icon",{key:"17fea9642aabb047a8017c37beffe3e0b64707c2",class:"sd-confirm-modal__close-button",name:"close",size:m,color:r,onClick:()=>this.close.emit()}),o&&e("sd-icon",{key:"5198d65dbac64b483f63f8a65f7cad987a14e24b",class:"sd-confirm-modal__icon",name:o,size:c,color:t}),e("h2",{key:"045887b2224ed46f4d6158a2d3ffc25261a0156d",class:`sd-confirm-modal__title ${this.titleClass}`},this.modalTitle),e("div",{key:"7f9ce8c5bef7a8f9ee580671ccdb79c093066ee3",class:"sd-confirm-modal__body"},(this.topMessage??[]).length>0&&e("div",{key:"ac533ca4a1dc011d0bbb0c5c72c14228f680741a",class:"sd-confirm-modal__message"},(this.topMessage??[]).map((o=>e("p",{class:"sd-confirm-modal__message-text",innerHTML:o})))),this.showContentBox&&e("div",{key:"2fde04429ca9efb0b9ae30116e9a0fd7f57b904e",class:"sd-confirm-modal__content-box"},this.tagContents?e("div",{class:"sd-confirm-modal__custom-content",ref:o=>{this.customContentRef=o}}):e("slot",{onSlotchange:()=>this.syncHasSlottedContent()},this.tagLabel&&e("sd-tag",{name:this.tagPreset,label:this.tagLabel}),this.slotLabel&&e("span",{class:"sd-confirm-modal__slot-label"},this.slotLabel))),(this.bottomMessage??[]).length>0&&e("div",{key:"5f97a8bf91a60b553b21d80f4b133d2c79e97ba6",class:"sd-confirm-modal__message"},(this.bottomMessage??[]).map((o=>e("p",{class:"sd-confirm-modal__message-text",innerHTML:o}))))),e("div",{key:"4cde2779f11b274d71b90dd75584f8ccd9d3044d",class:"sd-confirm-modal__button"},this.subButtonLabel&&e("sd-button-v2",{key:"9e64571f556c6cfdb9c69dc70e54a2f4bdec7bb6",name:"neutral_outline_md",label:this.subButtonLabel,onSdClick:()=>this.close.emit()}),e("sd-button-v2",{key:"dd86f7cce973862d94e26910341995f743e1944b",name:this.resolvedMainButton,label:this.mainButtonLabel,onSdClick:()=>this.ok.emit()})))}};f.style="sd-confirm-modal{display:block;width:fit-content;min-width:520px}sd-confirm-modal .sd-confirm-modal{position:relative;padding:var(--sd-modal-modal-confirm-padding-y) var(--sd-modal-modal-confirm-padding-x);border-radius:var(--sd-modal-modal-radius);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.2);background:var(--sd-modal-modal-bg)}sd-confirm-modal .sd-confirm-modal__close-button{position:absolute;top:16px;right:16px;cursor:pointer}sd-confirm-modal .sd-confirm-modal__icon{display:block;width:var(--sd-modal-modal-confirm-title-icon);height:var(--sd-modal-modal-confirm-title-icon);margin:0 auto var(--sd-modal-modal-confirm-title-gap) auto}sd-confirm-modal .sd-confirm-modal__title{color:var(--sd-modal-modal-confirm-title-color);font-size:var(--sd-modal-modal-confirm-title-typography-font-size);font-weight:var(--sd-modal-modal-confirm-title-typography-font-weight);line-height:var(--sd-modal-modal-confirm-title-typography-line-height);text-align:center;margin:0 0 var(--sd-modal-modal-confirm-body-gap) 0}sd-confirm-modal .sd-confirm-modal__body{display:flex;flex-direction:column;gap:var(--sd-modal-modal-confirm-body-gap)}sd-confirm-modal .sd-confirm-modal__message-text{color:var(--sd-modal-modal-confirm-message-color);font-size:12px;font-weight:400;line-height:22px;text-align:center;margin:0}sd-confirm-modal .sd-confirm-modal__content-box{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 16px;border:1px solid #e1e1e1;border-radius:8px;background:white}sd-confirm-modal .sd-confirm-modal__slot-label{font-size:14px;font-weight:700;line-height:22px;color:var(--sd-modal-modal-confirm-message-color)}sd-confirm-modal .sd-confirm-modal__button{display:flex;justify-content:center;gap:var(--sd-modal-modal-confirm-button-gap);margin-top:32px}";export{f as sd_confirm_modal}
|
|
@@ -5134,6 +5134,14 @@ const SdTooltip = class {
|
|
|
5134
5134
|
showTooltip = false;
|
|
5135
5135
|
slotContentHTML = '';
|
|
5136
5136
|
buttonEl;
|
|
5137
|
+
get tooltipOffset() {
|
|
5138
|
+
switch (this.placement) {
|
|
5139
|
+
case 'top': return [0, -4];
|
|
5140
|
+
case 'bottom': return [0, 4];
|
|
5141
|
+
case 'left': return [4, 0];
|
|
5142
|
+
case 'right': return [4, 0];
|
|
5143
|
+
}
|
|
5144
|
+
}
|
|
5137
5145
|
handleClose = () => {
|
|
5138
5146
|
this.showTooltip = false;
|
|
5139
5147
|
};
|
|
@@ -5160,14 +5168,14 @@ const SdTooltip = class {
|
|
|
5160
5168
|
: {
|
|
5161
5169
|
onSdClick: () => (this.showTooltip = !this.showTooltip),
|
|
5162
5170
|
};
|
|
5163
|
-
return (h(Fragment, { key: '
|
|
5171
|
+
return (h(Fragment, { key: '2890811dd681299b155d191d6d6023441db6debc' }, this.label ? (h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-tooltip", ...buttonTrigger })) : (h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-tooltip", ...handleTrigger })), this.showTooltip && (h("sd-floating-portal", { key: '666cf59e0548af92eff225cd91b485824b82249d', parentRef: this.buttonEl, onSdClose: this.handleClose.bind(this), placement: this.placement, offset: this.tooltipOffset }, h("div", { key: 'ad5285750f95fdb0829372dd3b45d96035a02315', class: {
|
|
5164
5172
|
'sd-floating-menu': true,
|
|
5165
5173
|
[`sd-floating-menu--${this.tooltipType}`]: true,
|
|
5166
5174
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
5167
5175
|
}, style: {
|
|
5168
5176
|
'--sd-floating-bg': typeConfig.bg,
|
|
5169
5177
|
'--sd-floating-content': typeConfig.content,
|
|
5170
|
-
} }, h("i", { key: '
|
|
5178
|
+
} }, h("i", { key: 'ee92f004dbd17de84a3410bd555da735c5fcb4ca', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, h(TooltipArrow, { key: '04ccadfa1de8bcf3b64218e6e048fcbf09ff3301' })), h("div", { key: '0534c8cec5c79c8b0df3950d554a1b62d1e3b32b', class: "sd-floating-menu__content", innerHTML: this.slotContentHTML }))))));
|
|
5171
5179
|
}
|
|
5172
5180
|
};
|
|
5173
5181
|
SdTooltip.style = sdTooltipCss();
|
|
@@ -45,7 +45,7 @@ const SdConfirmModal = class {
|
|
|
45
45
|
constructor(hostRef) {
|
|
46
46
|
registerInstance(this, hostRef);
|
|
47
47
|
this.close = createEvent(this, "sdClose");
|
|
48
|
-
this.
|
|
48
|
+
this.ok = createEvent(this, "sdOk");
|
|
49
49
|
}
|
|
50
50
|
get el() { return getElement(this); }
|
|
51
51
|
hasSlottedContent = false;
|
|
@@ -64,7 +64,7 @@ const SdConfirmModal = class {
|
|
|
64
64
|
slotLabel = '';
|
|
65
65
|
tagContents;
|
|
66
66
|
close;
|
|
67
|
-
|
|
67
|
+
ok;
|
|
68
68
|
componentWillLoad() {
|
|
69
69
|
this.syncHasSlottedContent();
|
|
70
70
|
}
|
|
@@ -112,9 +112,9 @@ const SdConfirmModal = class {
|
|
|
112
112
|
render() {
|
|
113
113
|
const iconName = CONFIRM_MODAL_ICON_MAP[this.type];
|
|
114
114
|
const iconColor = CONFIRM_MODAL_ICON_COLOR[this.type];
|
|
115
|
-
return (h("div", { key: '
|
|
115
|
+
return (h("div", { key: '9dd835c1020a29e99257690b5d4d6038b13fe5e4', class: "sd-confirm-modal" }, h("sd-icon", { key: '17fea9642aabb047a8017c37beffe3e0b64707c2', class: "sd-confirm-modal__close-button", name: "close", size: CLOSE_ICON_SIZE, color: CLOSE_ICON_COLOR, onClick: () => this.close.emit() }), iconName && (h("sd-icon", { key: '5198d65dbac64b483f63f8a65f7cad987a14e24b', class: "sd-confirm-modal__icon", name: iconName, size: TITLE_ICON_SIZE, color: iconColor })), h("h2", { key: '045887b2224ed46f4d6158a2d3ffc25261a0156d', class: `sd-confirm-modal__title ${this.titleClass}` }, this.modalTitle), h("div", { key: '7f9ce8c5bef7a8f9ee580671ccdb79c093066ee3', class: "sd-confirm-modal__body" }, (this.topMessage ?? []).length > 0 && (h("div", { key: 'ac533ca4a1dc011d0bbb0c5c72c14228f680741a', class: "sd-confirm-modal__message" }, (this.topMessage ?? []).map(msg => (h("p", { class: "sd-confirm-modal__message-text", innerHTML: msg }))))), this.showContentBox && (h("div", { key: '2fde04429ca9efb0b9ae30116e9a0fd7f57b904e', class: "sd-confirm-modal__content-box" }, this.tagContents ? (h("div", { class: "sd-confirm-modal__custom-content", ref: el => {
|
|
116
116
|
this.customContentRef = el;
|
|
117
|
-
} })) : (h("slot", { onSlotchange: () => this.syncHasSlottedContent() }, this.tagLabel && h("sd-tag", { name: this.tagPreset, label: this.tagLabel }), this.slotLabel && (h("span", { class: "sd-confirm-modal__slot-label" }, this.slotLabel)))))), (this.bottomMessage ?? []).length > 0 && (h("div", { key: '
|
|
117
|
+
} })) : (h("slot", { onSlotchange: () => this.syncHasSlottedContent() }, this.tagLabel && h("sd-tag", { name: this.tagPreset, label: this.tagLabel }), this.slotLabel && (h("span", { class: "sd-confirm-modal__slot-label" }, this.slotLabel)))))), (this.bottomMessage ?? []).length > 0 && (h("div", { key: '5f97a8bf91a60b553b21d80f4b133d2c79e97ba6', class: "sd-confirm-modal__message" }, (this.bottomMessage ?? []).map(msg => (h("p", { class: "sd-confirm-modal__message-text", innerHTML: msg })))))), h("div", { key: '4cde2779f11b274d71b90dd75584f8ccd9d3044d', class: "sd-confirm-modal__button" }, this.subButtonLabel && (h("sd-button-v2", { key: '9e64571f556c6cfdb9c69dc70e54a2f4bdec7bb6', name: SUB_BUTTON_PRESET, label: this.subButtonLabel, onSdClick: () => this.close.emit() })), h("sd-button-v2", { key: 'dd86f7cce973862d94e26910341995f743e1944b', name: this.resolvedMainButton, label: this.mainButtonLabel, onSdClick: () => this.ok.emit() }))));
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
SdConfirmModal.style = sdConfirmModalCss();
|
|
@@ -23,7 +23,7 @@ const SdModalContainer = class {
|
|
|
23
23
|
this.shakeModal(top.modalEl);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
this.requestDismiss(top.id, '
|
|
26
|
+
this.requestDismiss(top.id, 'close');
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
async open(options, chain) {
|
|
@@ -33,7 +33,7 @@ const SdModalContainer = class {
|
|
|
33
33
|
clearTimeout(this.containerDismissTimerId);
|
|
34
34
|
this.containerDismissTimerId = undefined;
|
|
35
35
|
}
|
|
36
|
-
this.entries = [...(this.entries ?? []), { id, modalEl, chain, persistent: !!options.persistent, closing: false }];
|
|
36
|
+
this.entries = [...(this.entries ?? []), { id, modalEl, chain, persistent: !!options.persistent, closeAction: options.closeAction ?? 'none', closing: false }];
|
|
37
37
|
this.isVisible = true;
|
|
38
38
|
requestAnimationFrame(() => {
|
|
39
39
|
if (this.contentRef) {
|
|
@@ -62,11 +62,11 @@ const SdModalContainer = class {
|
|
|
62
62
|
el.setAttribute('data-modal-id', id);
|
|
63
63
|
el.classList.add('sd-modal-container__modal');
|
|
64
64
|
this.applyProps(el, options);
|
|
65
|
-
el.addEventListener('
|
|
65
|
+
el.addEventListener('sdOk', () => {
|
|
66
66
|
this.requestDismiss(id, 'confirm');
|
|
67
67
|
});
|
|
68
68
|
el.addEventListener('sdClose', () => {
|
|
69
|
-
this.requestDismiss(id, '
|
|
69
|
+
this.requestDismiss(id, 'close');
|
|
70
70
|
});
|
|
71
71
|
return el;
|
|
72
72
|
}
|
|
@@ -107,7 +107,7 @@ const SdModalContainer = class {
|
|
|
107
107
|
this.shakeModal(top.modalEl);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
this.requestDismiss(top.id, '
|
|
110
|
+
this.requestDismiss(top.id, 'close');
|
|
111
111
|
};
|
|
112
112
|
shakeModal(modalEl) {
|
|
113
113
|
const cls = 'sd-modal-container__modal--shake';
|
|
@@ -141,10 +141,18 @@ const SdModalContainer = class {
|
|
|
141
141
|
this.finalizeDismiss(id);
|
|
142
142
|
}, ANIMATION_DURATION);
|
|
143
143
|
this.entries = (this.entries ?? []).map(item => item.id === id ? { ...item, closing: true, dismissTimerId } : item);
|
|
144
|
-
if (reason === '
|
|
145
|
-
entry.
|
|
146
|
-
|
|
147
|
-
entry.
|
|
144
|
+
if (reason === 'close') {
|
|
145
|
+
if (entry.closeAction === 'ok')
|
|
146
|
+
entry.chain._triggerOk();
|
|
147
|
+
else if (entry.closeAction === 'cancel')
|
|
148
|
+
entry.chain._triggerCancel();
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
if (reason === 'confirm')
|
|
152
|
+
entry.chain._triggerOk();
|
|
153
|
+
if (reason === 'cancel')
|
|
154
|
+
entry.chain._triggerCancel();
|
|
155
|
+
}
|
|
148
156
|
}
|
|
149
157
|
finalizeDismiss(id) {
|
|
150
158
|
const entry = (this.entries ?? []).find(item => item.id === id);
|
|
@@ -42,18 +42,26 @@ const SdPopover = class {
|
|
|
42
42
|
this.slotContent = this.el.innerHTML;
|
|
43
43
|
}
|
|
44
44
|
buttonEl;
|
|
45
|
+
get popoverOffset() {
|
|
46
|
+
switch (this.placement) {
|
|
47
|
+
case 'top': return [0, -4];
|
|
48
|
+
case 'bottom': return [0, 4];
|
|
49
|
+
case 'left': return [4, 0];
|
|
50
|
+
case 'right': return [4, 0];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
45
53
|
handleClose = () => {
|
|
46
54
|
this.showPopover = false;
|
|
47
55
|
};
|
|
48
56
|
render() {
|
|
49
|
-
return (h(Fragment, { key: '
|
|
57
|
+
return (h(Fragment, { key: 'f367ea2ada0fda7c28c943bd7bd48785b1810999' }, this.label ? (h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-popover", onSdClick: () => (this.showPopover = !this.showPopover) })) : (h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })), this.showPopover && (h("sd-floating-portal", { key: 'afdb58bfdf25af2adc45a7b81221c1859b517a5a', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement, offset: this.popoverOffset }, h("div", { key: '38757707dd8c055674edbc2381409f5fd8712c8d', class: {
|
|
50
58
|
'sd-floating-menu': true,
|
|
51
59
|
'sd-floating-menu--popover': true,
|
|
52
60
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
53
61
|
[this.menuClass]: !!this.menuClass,
|
|
54
62
|
}, style: {
|
|
55
63
|
'--sd-floating-bg': popoverTokens.popover.bg,
|
|
56
|
-
} }, h("i", { key: '
|
|
64
|
+
} }, h("i", { key: '333bae4cb23470121d63d4d8b34a1d2b15837e7d', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, h(TooltipArrow, { key: '617781bb6fc8957576eb149471fd8bf0f44ca552' })), h("div", { key: '8c57d49782edd344c8c2c0b9bf44fff8ec154159', class: "sd-floating-menu__content" }, this.menuTitle && h("div", { key: 'a06b93124684cb96910ffa2603cf7410a01d6381', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (h("div", { key: '24691930b8ae03a3c92ed8e74dae708b5e64f03b', class: "sd-floating-menu__messages" }, this.messages.map(message => (h("div", null, message))))), this.buttons.length > 0 && (h("div", { key: 'd73cd4cc978711857c4c946dd2a1c1b64bb5feb6', class: `sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (h("sd-button", { ...button })))))), this.useClose && (h("button", { key: 'cda218024d04b03fc2931afa99f0127bc7a9c4c5', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, h("sd-icon", { key: '3f41ebce27fd4bab823370d6bbe25b5caed9d5e1', name: "close", size: popoverTokens.popover.close.icon, color: popoverTokens.popover.close.color }))))))));
|
|
57
65
|
}
|
|
58
66
|
static get watchers() { return {
|
|
59
67
|
"show": [{
|
|
@@ -18,7 +18,7 @@ export declare class SdConfirmModal {
|
|
|
18
18
|
slotLabel: string;
|
|
19
19
|
tagContents?: HTMLElement;
|
|
20
20
|
close: EventEmitter<void>;
|
|
21
|
-
|
|
21
|
+
ok: EventEmitter<void>;
|
|
22
22
|
componentWillLoad(): void;
|
|
23
23
|
componentDidLoad(): void;
|
|
24
24
|
componentDidRender(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ConfirmModalType, ConfirmModalMainButton } from '../sd-confirm-modal/sd-confirm-modal.config';
|
|
2
2
|
import type { TagName } from '../sd-tag/sd-tag.config';
|
|
3
|
+
export type CloseAction = 'ok' | 'cancel' | 'none';
|
|
3
4
|
export interface ConfirmModalOptions {
|
|
4
5
|
type?: ConfirmModalType;
|
|
5
6
|
title?: string;
|
|
@@ -14,12 +15,14 @@ export interface ConfirmModalOptions {
|
|
|
14
15
|
slotLabel?: string;
|
|
15
16
|
tagContents?: HTMLElement;
|
|
16
17
|
persistent?: boolean;
|
|
18
|
+
closeAction?: CloseAction;
|
|
17
19
|
}
|
|
18
20
|
export interface ModalEntry {
|
|
19
21
|
id: string;
|
|
20
22
|
modalEl: HTMLElement;
|
|
21
23
|
chain: ModalDialogChainLike;
|
|
22
24
|
persistent: boolean;
|
|
25
|
+
closeAction: CloseAction;
|
|
23
26
|
closing: boolean;
|
|
24
27
|
dismissTimerId?: ReturnType<typeof setTimeout>;
|
|
25
28
|
}
|
|
@@ -2059,7 +2059,7 @@ declare global {
|
|
|
2059
2059
|
};
|
|
2060
2060
|
interface HTMLSdConfirmModalElementEventMap {
|
|
2061
2061
|
"sdClose": void;
|
|
2062
|
-
"
|
|
2062
|
+
"sdOk": void;
|
|
2063
2063
|
}
|
|
2064
2064
|
interface HTMLSdConfirmModalElement extends Components.SdConfirmModal, HTMLStencilElement {
|
|
2065
2065
|
addEventListener<K extends keyof HTMLSdConfirmModalElementEventMap>(type: K, listener: (this: HTMLSdConfirmModalElement, ev: SdConfirmModalCustomEvent<HTMLSdConfirmModalElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -3053,7 +3053,7 @@ declare namespace LocalJSX {
|
|
|
3053
3053
|
*/
|
|
3054
3054
|
"modalTitle"?: string;
|
|
3055
3055
|
"onSdClose"?: (event: SdConfirmModalCustomEvent<void>) => void;
|
|
3056
|
-
"
|
|
3056
|
+
"onSdOk"?: (event: SdConfirmModalCustomEvent<void>) => void;
|
|
3057
3057
|
/**
|
|
3058
3058
|
* @default ''
|
|
3059
3059
|
*/
|
package/hydrate/index.js
CHANGED
|
@@ -6221,7 +6221,7 @@ class SdConfirmModal {
|
|
|
6221
6221
|
constructor(hostRef) {
|
|
6222
6222
|
registerInstance(this, hostRef);
|
|
6223
6223
|
this.close = createEvent(this, "sdClose");
|
|
6224
|
-
this.
|
|
6224
|
+
this.ok = createEvent(this, "sdOk");
|
|
6225
6225
|
}
|
|
6226
6226
|
get el() { return getElement(this); }
|
|
6227
6227
|
hasSlottedContent = false;
|
|
@@ -6240,7 +6240,7 @@ class SdConfirmModal {
|
|
|
6240
6240
|
slotLabel = '';
|
|
6241
6241
|
tagContents;
|
|
6242
6242
|
close;
|
|
6243
|
-
|
|
6243
|
+
ok;
|
|
6244
6244
|
componentWillLoad() {
|
|
6245
6245
|
this.syncHasSlottedContent();
|
|
6246
6246
|
}
|
|
@@ -6288,9 +6288,9 @@ class SdConfirmModal {
|
|
|
6288
6288
|
render() {
|
|
6289
6289
|
const iconName = CONFIRM_MODAL_ICON_MAP[this.type];
|
|
6290
6290
|
const iconColor = CONFIRM_MODAL_ICON_COLOR[this.type];
|
|
6291
|
-
return (hAsync("div", { key: '
|
|
6291
|
+
return (hAsync("div", { key: '9dd835c1020a29e99257690b5d4d6038b13fe5e4', class: "sd-confirm-modal" }, hAsync("sd-icon", { key: '17fea9642aabb047a8017c37beffe3e0b64707c2', class: "sd-confirm-modal__close-button", name: "close", size: CLOSE_ICON_SIZE, color: CLOSE_ICON_COLOR, onClick: () => this.close.emit() }), iconName && (hAsync("sd-icon", { key: '5198d65dbac64b483f63f8a65f7cad987a14e24b', class: "sd-confirm-modal__icon", name: iconName, size: TITLE_ICON_SIZE, color: iconColor })), hAsync("h2", { key: '045887b2224ed46f4d6158a2d3ffc25261a0156d', class: `sd-confirm-modal__title ${this.titleClass}` }, this.modalTitle), hAsync("div", { key: '7f9ce8c5bef7a8f9ee580671ccdb79c093066ee3', class: "sd-confirm-modal__body" }, (this.topMessage ?? []).length > 0 && (hAsync("div", { key: 'ac533ca4a1dc011d0bbb0c5c72c14228f680741a', class: "sd-confirm-modal__message" }, (this.topMessage ?? []).map(msg => (hAsync("p", { class: "sd-confirm-modal__message-text", innerHTML: msg }))))), this.showContentBox && (hAsync("div", { key: '2fde04429ca9efb0b9ae30116e9a0fd7f57b904e', class: "sd-confirm-modal__content-box" }, this.tagContents ? (hAsync("div", { class: "sd-confirm-modal__custom-content", ref: el => {
|
|
6292
6292
|
this.customContentRef = el;
|
|
6293
|
-
} })) : (hAsync("slot", { onSlotchange: () => this.syncHasSlottedContent() }, this.tagLabel && hAsync("sd-tag", { name: this.tagPreset, label: this.tagLabel }), this.slotLabel && (hAsync("span", { class: "sd-confirm-modal__slot-label" }, this.slotLabel)))))), (this.bottomMessage ?? []).length > 0 && (hAsync("div", { key: '
|
|
6293
|
+
} })) : (hAsync("slot", { onSlotchange: () => this.syncHasSlottedContent() }, this.tagLabel && hAsync("sd-tag", { name: this.tagPreset, label: this.tagLabel }), this.slotLabel && (hAsync("span", { class: "sd-confirm-modal__slot-label" }, this.slotLabel)))))), (this.bottomMessage ?? []).length > 0 && (hAsync("div", { key: '5f97a8bf91a60b553b21d80f4b133d2c79e97ba6', class: "sd-confirm-modal__message" }, (this.bottomMessage ?? []).map(msg => (hAsync("p", { class: "sd-confirm-modal__message-text", innerHTML: msg })))))), hAsync("div", { key: '4cde2779f11b274d71b90dd75584f8ccd9d3044d', class: "sd-confirm-modal__button" }, this.subButtonLabel && (hAsync("sd-button-v2", { key: '9e64571f556c6cfdb9c69dc70e54a2f4bdec7bb6', name: SUB_BUTTON_PRESET, label: this.subButtonLabel, onSdClick: () => this.close.emit() })), hAsync("sd-button-v2", { key: 'dd86f7cce973862d94e26910341995f743e1944b', name: this.resolvedMainButton, label: this.mainButtonLabel, onSdClick: () => this.ok.emit() }))));
|
|
6294
6294
|
}
|
|
6295
6295
|
static get style() { return sdConfirmModalCss(); }
|
|
6296
6296
|
static get cmpMeta() { return {
|
|
@@ -10078,7 +10078,7 @@ class SdModalContainer {
|
|
|
10078
10078
|
this.shakeModal(top.modalEl);
|
|
10079
10079
|
return;
|
|
10080
10080
|
}
|
|
10081
|
-
this.requestDismiss(top.id, '
|
|
10081
|
+
this.requestDismiss(top.id, 'close');
|
|
10082
10082
|
}
|
|
10083
10083
|
}
|
|
10084
10084
|
async open(options, chain) {
|
|
@@ -10088,7 +10088,7 @@ class SdModalContainer {
|
|
|
10088
10088
|
clearTimeout(this.containerDismissTimerId);
|
|
10089
10089
|
this.containerDismissTimerId = undefined;
|
|
10090
10090
|
}
|
|
10091
|
-
this.entries = [...(this.entries ?? []), { id, modalEl, chain, persistent: !!options.persistent, closing: false }];
|
|
10091
|
+
this.entries = [...(this.entries ?? []), { id, modalEl, chain, persistent: !!options.persistent, closeAction: options.closeAction ?? 'none', closing: false }];
|
|
10092
10092
|
this.isVisible = true;
|
|
10093
10093
|
requestAnimationFrame(() => {
|
|
10094
10094
|
if (this.contentRef) {
|
|
@@ -10117,11 +10117,11 @@ class SdModalContainer {
|
|
|
10117
10117
|
el.setAttribute('data-modal-id', id);
|
|
10118
10118
|
el.classList.add('sd-modal-container__modal');
|
|
10119
10119
|
this.applyProps(el, options);
|
|
10120
|
-
el.addEventListener('
|
|
10120
|
+
el.addEventListener('sdOk', () => {
|
|
10121
10121
|
this.requestDismiss(id, 'confirm');
|
|
10122
10122
|
});
|
|
10123
10123
|
el.addEventListener('sdClose', () => {
|
|
10124
|
-
this.requestDismiss(id, '
|
|
10124
|
+
this.requestDismiss(id, 'close');
|
|
10125
10125
|
});
|
|
10126
10126
|
return el;
|
|
10127
10127
|
}
|
|
@@ -10162,7 +10162,7 @@ class SdModalContainer {
|
|
|
10162
10162
|
this.shakeModal(top.modalEl);
|
|
10163
10163
|
return;
|
|
10164
10164
|
}
|
|
10165
|
-
this.requestDismiss(top.id, '
|
|
10165
|
+
this.requestDismiss(top.id, 'close');
|
|
10166
10166
|
};
|
|
10167
10167
|
shakeModal(modalEl) {
|
|
10168
10168
|
const cls = 'sd-modal-container__modal--shake';
|
|
@@ -10196,10 +10196,18 @@ class SdModalContainer {
|
|
|
10196
10196
|
this.finalizeDismiss(id);
|
|
10197
10197
|
}, ANIMATION_DURATION);
|
|
10198
10198
|
this.entries = (this.entries ?? []).map(item => item.id === id ? { ...item, closing: true, dismissTimerId } : item);
|
|
10199
|
-
if (reason === '
|
|
10200
|
-
entry.
|
|
10201
|
-
|
|
10202
|
-
entry.
|
|
10199
|
+
if (reason === 'close') {
|
|
10200
|
+
if (entry.closeAction === 'ok')
|
|
10201
|
+
entry.chain._triggerOk();
|
|
10202
|
+
else if (entry.closeAction === 'cancel')
|
|
10203
|
+
entry.chain._triggerCancel();
|
|
10204
|
+
}
|
|
10205
|
+
else {
|
|
10206
|
+
if (reason === 'confirm')
|
|
10207
|
+
entry.chain._triggerOk();
|
|
10208
|
+
if (reason === 'cancel')
|
|
10209
|
+
entry.chain._triggerCancel();
|
|
10210
|
+
}
|
|
10203
10211
|
}
|
|
10204
10212
|
finalizeDismiss(id) {
|
|
10205
10213
|
const entry = (this.entries ?? []).find(item => item.id === id);
|
|
@@ -10714,18 +10722,26 @@ class SdPopover {
|
|
|
10714
10722
|
this.slotContent = this.el.innerHTML;
|
|
10715
10723
|
}
|
|
10716
10724
|
buttonEl;
|
|
10725
|
+
get popoverOffset() {
|
|
10726
|
+
switch (this.placement) {
|
|
10727
|
+
case 'top': return [0, -4];
|
|
10728
|
+
case 'bottom': return [0, 4];
|
|
10729
|
+
case 'left': return [4, 0];
|
|
10730
|
+
case 'right': return [4, 0];
|
|
10731
|
+
}
|
|
10732
|
+
}
|
|
10717
10733
|
handleClose = () => {
|
|
10718
10734
|
this.showPopover = false;
|
|
10719
10735
|
};
|
|
10720
10736
|
render() {
|
|
10721
|
-
return (hAsync(Fragment, { key: '
|
|
10737
|
+
return (hAsync(Fragment, { key: 'f367ea2ada0fda7c28c943bd7bd48785b1810999' }, this.label ? (hAsync("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-popover", onSdClick: () => (this.showPopover = !this.showPopover) })) : (hAsync("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })), this.showPopover && (hAsync("sd-floating-portal", { key: 'afdb58bfdf25af2adc45a7b81221c1859b517a5a', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement, offset: this.popoverOffset }, hAsync("div", { key: '38757707dd8c055674edbc2381409f5fd8712c8d', class: {
|
|
10722
10738
|
'sd-floating-menu': true,
|
|
10723
10739
|
'sd-floating-menu--popover': true,
|
|
10724
10740
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
10725
10741
|
[this.menuClass]: !!this.menuClass,
|
|
10726
10742
|
}, style: {
|
|
10727
10743
|
'--sd-floating-bg': popoverTokens.popover.bg,
|
|
10728
|
-
} }, hAsync("i", { key: '
|
|
10744
|
+
} }, hAsync("i", { key: '333bae4cb23470121d63d4d8b34a1d2b15837e7d', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, hAsync(TooltipArrow, { key: '617781bb6fc8957576eb149471fd8bf0f44ca552' })), hAsync("div", { key: '8c57d49782edd344c8c2c0b9bf44fff8ec154159', class: "sd-floating-menu__content" }, this.menuTitle && hAsync("div", { key: 'a06b93124684cb96910ffa2603cf7410a01d6381', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (hAsync("div", { key: '24691930b8ae03a3c92ed8e74dae708b5e64f03b', class: "sd-floating-menu__messages" }, this.messages.map(message => (hAsync("div", null, message))))), this.buttons.length > 0 && (hAsync("div", { key: 'd73cd4cc978711857c4c946dd2a1c1b64bb5feb6', class: `sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (hAsync("sd-button", { ...button })))))), this.useClose && (hAsync("button", { key: 'cda218024d04b03fc2931afa99f0127bc7a9c4c5', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, hAsync("sd-icon", { key: '3f41ebce27fd4bab823370d6bbe25b5caed9d5e1', name: "close", size: popoverTokens.popover.close.icon, color: popoverTokens.popover.close.color }))))))));
|
|
10729
10745
|
}
|
|
10730
10746
|
static get watchers() { return {
|
|
10731
10747
|
"show": [{
|
|
@@ -15794,6 +15810,14 @@ class SdTooltip {
|
|
|
15794
15810
|
showTooltip = false;
|
|
15795
15811
|
slotContentHTML = '';
|
|
15796
15812
|
buttonEl;
|
|
15813
|
+
get tooltipOffset() {
|
|
15814
|
+
switch (this.placement) {
|
|
15815
|
+
case 'top': return [0, -4];
|
|
15816
|
+
case 'bottom': return [0, 4];
|
|
15817
|
+
case 'left': return [4, 0];
|
|
15818
|
+
case 'right': return [4, 0];
|
|
15819
|
+
}
|
|
15820
|
+
}
|
|
15797
15821
|
handleClose = () => {
|
|
15798
15822
|
this.showTooltip = false;
|
|
15799
15823
|
};
|
|
@@ -15820,14 +15844,14 @@ class SdTooltip {
|
|
|
15820
15844
|
: {
|
|
15821
15845
|
onSdClick: () => (this.showTooltip = !this.showTooltip),
|
|
15822
15846
|
};
|
|
15823
|
-
return (hAsync(Fragment, { key: '
|
|
15847
|
+
return (hAsync(Fragment, { key: '2890811dd681299b155d191d6d6023441db6debc' }, this.label ? (hAsync("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-tooltip", ...buttonTrigger })) : (hAsync("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-tooltip", ...handleTrigger })), this.showTooltip && (hAsync("sd-floating-portal", { key: '666cf59e0548af92eff225cd91b485824b82249d', parentRef: this.buttonEl, onSdClose: this.handleClose.bind(this), placement: this.placement, offset: this.tooltipOffset }, hAsync("div", { key: 'ad5285750f95fdb0829372dd3b45d96035a02315', class: {
|
|
15824
15848
|
'sd-floating-menu': true,
|
|
15825
15849
|
[`sd-floating-menu--${this.tooltipType}`]: true,
|
|
15826
15850
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
15827
15851
|
}, style: {
|
|
15828
15852
|
'--sd-floating-bg': typeConfig.bg,
|
|
15829
15853
|
'--sd-floating-content': typeConfig.content,
|
|
15830
|
-
} }, hAsync("i", { key: '
|
|
15854
|
+
} }, hAsync("i", { key: 'ee92f004dbd17de84a3410bd555da735c5fcb4ca', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, hAsync(TooltipArrow, { key: '04ccadfa1de8bcf3b64218e6e048fcbf09ff3301' })), hAsync("div", { key: '0534c8cec5c79c8b0df3950d554a1b62d1e3b32b', class: "sd-floating-menu__content", innerHTML: this.slotContentHTML }))))));
|
|
15831
15855
|
}
|
|
15832
15856
|
static get style() { return sdTooltipCss(); }
|
|
15833
15857
|
static get cmpMeta() { return {
|