@erag/vue-toastification 1.1.1 → 1.1.2
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/README.md +7 -8
- package/dist/style.css +1 -1
- package/dist/vue-toastification.js +1 -1
- package/dist/vue-toastification.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -214,16 +214,15 @@ const logout = async () => {
|
|
|
214
214
|
| --------- | ------------------------- | ------------------ | --------------------------------------- |
|
|
215
215
|
| `confirm` | `(options: ModalOptions)` | `Promise<boolean>` | Opens modal. Returns true if confirmed. |
|
|
216
216
|
|
|
217
|
-
|
|
218
217
|
#### `ModalOptions` Interface
|
|
219
218
|
|
|
220
|
-
| Property
|
|
221
|
-
|
|
|
222
|
-
| `title`
|
|
223
|
-
| `message`
|
|
224
|
-
| `confirmText` | `string`
|
|
225
|
-
| `cancelText`
|
|
226
|
-
| `type`
|
|
219
|
+
| Property | Type | Default | Description |
|
|
220
|
+
| :------------ | :-------------------------------- | :----------- | :------------------------------------------ |
|
|
221
|
+
| `title` | `string` | **Required** | The bold heading of the modal. |
|
|
222
|
+
| `message` | `string` | **Required** | The descriptive text body. |
|
|
223
|
+
| `confirmText` | `string` | `'Confirm'` | Label for the action button. |
|
|
224
|
+
| `cancelText` | `string` | `'Cancel'` | Label for the cancel button. |
|
|
225
|
+
| `type` | `'danger' \| 'warning' \| 'info'` | `'info'` | Controls button colors (Danger = Red, etc). |
|
|
227
226
|
|
|
228
227
|
---
|
|
229
228
|
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.erag-toast[data-v-a3013926]{--toast-bg: #fff;--toast-color: #333;width:320px;background:var(--toast-bg);color:#fff;border-radius:6px;border:1px solid rgba(0,0,0,.05);overflow:hidden;box-shadow:0 4px 15px #00000026;position:relative;display:flex;align-items:center;padding:0 10px 0 12px;margin-bottom:10px;transform:translateY(20px);opacity:0;transition:transform .3s cubic-bezier(.68,-.55,.27,1.55),opacity .3s ease}.erag-toast.erag-show[data-v-a3013926]{transform:translateY(0)!important;opacity:1}.erag-toast[data-v-a3013926]:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--toast-color);opacity:.15;transform:translate(-100%);pointer-events:none;z-index:0}.erag-toast.erag-show[data-v-a3013926]:before{animation:eragProgressLayer-a3013926 var(--duration) linear forwards}.erag-toast-icon[data-v-a3013926]{width:20px;height:20px;margin-right:12px;display:flex;align-items:center;justify-content:center;z-index:1;color:#fff}.erag-toast-icon[data-v-a3013926] svg{width:100%;height:100%}.erag-toast-content[data-v-a3013926]{padding:9px 0;position:relative;z-index:1;flex:1}.erag-toast-content strong[data-v-a3013926]{display:block;font-size:14px;margin-bottom:2px;color:inherit;line-height:1.2}.erag-toast-content span[data-v-a3013926]{font-size:12px;opacity:.9;line-height:1.2}.erag-toast-content.erag-single-line[data-v-a3013926]{padding:17px 0}.erag-toast-content strong[data-v-a3013926]{display:block;font-size:15px;margin-bottom:2px;color:inherit;line-height:1.2}.erag-toast-content.erag-single-line strong[data-v-a3013926]{margin-bottom:0}.erag-toast-content span[data-v-a3013926]{font-size:16px;opacity:.9;line-height:1.2}.erag-toast-close[data-v-a3013926]{background:transparent;border:none;color:#fff;opacity:.7;cursor:pointer;padding:6px;margin-left:8px;z-index:2;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all .2s}.erag-toast-close[data-v-a3013926]:hover{opacity:1;background:#0000001a}.erag-toast-close svg[data-v-a3013926]{width:12px;height:12px}.erag-toast.erag-success[data-v-a3013926]{--toast-bg: #27ae60}.erag-toast.erag-error[data-v-a3013926]{--toast-bg: #c0392b}.erag-toast.erag-warning[data-v-a3013926]{--toast-bg: #d35400}.erag-toast.erag-info[data-v-a3013926]{--toast-bg: #2980b9}@keyframes eragProgressLayer-a3013926{0%{transform:translate(-100%)}to{transform:translate(0)}}.erag-toast-container[data-v-
|
|
1
|
+
.erag-toast[data-v-a3013926]{--toast-bg: #fff;--toast-color: #333;width:320px;background:var(--toast-bg);color:#fff;border-radius:6px;border:1px solid rgba(0,0,0,.05);overflow:hidden;box-shadow:0 4px 15px #00000026;position:relative;display:flex;align-items:center;padding:0 10px 0 12px;margin-bottom:10px;transform:translateY(20px);opacity:0;transition:transform .3s cubic-bezier(.68,-.55,.27,1.55),opacity .3s ease}.erag-toast.erag-show[data-v-a3013926]{transform:translateY(0)!important;opacity:1}.erag-toast[data-v-a3013926]:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--toast-color);opacity:.15;transform:translate(-100%);pointer-events:none;z-index:0}.erag-toast.erag-show[data-v-a3013926]:before{animation:eragProgressLayer-a3013926 var(--duration) linear forwards}.erag-toast-icon[data-v-a3013926]{width:20px;height:20px;margin-right:12px;display:flex;align-items:center;justify-content:center;z-index:1;color:#fff}.erag-toast-icon[data-v-a3013926] svg{width:100%;height:100%}.erag-toast-content[data-v-a3013926]{padding:9px 0;position:relative;z-index:1;flex:1}.erag-toast-content strong[data-v-a3013926]{display:block;font-size:14px;margin-bottom:2px;color:inherit;line-height:1.2}.erag-toast-content span[data-v-a3013926]{font-size:12px;opacity:.9;line-height:1.2}.erag-toast-content.erag-single-line[data-v-a3013926]{padding:17px 0}.erag-toast-content strong[data-v-a3013926]{display:block;font-size:15px;margin-bottom:2px;color:inherit;line-height:1.2}.erag-toast-content.erag-single-line strong[data-v-a3013926]{margin-bottom:0}.erag-toast-content span[data-v-a3013926]{font-size:16px;opacity:.9;line-height:1.2}.erag-toast-close[data-v-a3013926]{background:transparent;border:none;color:#fff;opacity:.7;cursor:pointer;padding:6px;margin-left:8px;z-index:2;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all .2s}.erag-toast-close[data-v-a3013926]:hover{opacity:1;background:#0000001a}.erag-toast-close svg[data-v-a3013926]{width:12px;height:12px}.erag-toast.erag-success[data-v-a3013926]{--toast-bg: #27ae60}.erag-toast.erag-error[data-v-a3013926]{--toast-bg: #c0392b}.erag-toast.erag-warning[data-v-a3013926]{--toast-bg: #d35400}.erag-toast.erag-info[data-v-a3013926]{--toast-bg: #2980b9}@keyframes eragProgressLayer-a3013926{0%{transform:translate(-100%)}to{transform:translate(0)}}.erag-toast-container[data-v-0c442d00]{position:fixed;z-index:9999;display:flex;flex-direction:column}.erag-toast-container.erag-top-left[data-v-0c442d00]{top:20px;left:20px}.erag-toast-container.erag-top-center[data-v-0c442d00]{top:20px;left:50%;transform:translate(-50%)}.erag-toast-container.erag-top-right[data-v-0c442d00]{top:20px;right:20px}.erag-toast-container.erag-bottom-left[data-v-0c442d00]{bottom:20px;left:20px}.erag-toast-container.erag-bottom-center[data-v-0c442d00]{bottom:20px;left:50%;transform:translate(-50%)}.erag-toast-container.erag-bottom-right[data-v-0c442d00]{bottom:20px;right:20px}.erag-toast-list-move[data-v-0c442d00],.erag-toast-list-enter-active[data-v-0c442d00],.erag-toast-list-leave-active[data-v-0c442d00]{transition:all .4s ease}.erag-toast-list-enter-from[data-v-0c442d00],.erag-toast-list-leave-to[data-v-0c442d00]{opacity:0;transform:translate(30px)}.erag-toast-list-leave-active[data-v-0c442d00]{position:absolute;opacity:0!important;width:320px!important;z-index:-1!important}.erag-modal-backdrop[data-v-13c52896]{position:fixed;top:0;left:0;width:100%;height:100%;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.erag-modal-container[data-v-13c52896]{background:#fff;width:90%;max-width:450px;border-radius:8px;box-shadow:0 20px 25px -5px #0000001a;overflow:hidden;font-family:inherit}.erag-modal-body[data-v-13c52896]{padding:24px;display:flex;gap:16px}.erag-modal-icon-wrapper[data-v-13c52896]{width:40px;height:40px;border-radius:50%;background:#fee2e2;color:#dc2626;display:flex;align-items:center;justify-content:center;flex-shrink:0}.erag-modal-icon-wrapper svg[data-v-13c52896]{width:24px;height:24px}.erag-modal-text h3[data-v-13c52896]{margin:0 0 8px;font-size:18px;color:#111827;font-weight:600}.erag-modal-text p[data-v-13c52896]{margin:0;font-size:14px;color:#6b7280;line-height:1.5}.erag-modal-footer[data-v-13c52896]{background:#f9fafb;padding:12px 24px;display:flex;justify-content:flex-end;gap:12px}button[data-v-13c52896]{padding:8px 16px;border-radius:6px;font-weight:500;font-size:14px;cursor:pointer;border:1px solid transparent;transition:all .2s}.erag-btn-cancel[data-v-13c52896]{background:#fff;color:#374151;border-color:#d1d5db;box-shadow:0 1px 2px #0000000d}.erag-btn-cancel[data-v-13c52896]:hover{background:#f3f4f6}.erag-btn-confirm.danger[data-v-13c52896]{background:#dc2626;color:#fff}.erag-btn-confirm.danger[data-v-13c52896]:hover{background:#b91c1c}.erag-modal-fade-enter-active[data-v-13c52896],.erag-modal-fade-leave-active[data-v-13c52896]{transition:opacity .2s}.erag-modal-fade-enter-from[data-v-13c52896],.erag-modal-fade-leave-to[data-v-13c52896]{opacity:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.VueToastification={},c.Vue))})(this,function(c,e){"use strict";const l=e.reactive({toasts:[],position:"bottom-right"});let E=0;const p=()=>{const a=(o,n,s,i=4500,d)=>{const f=E++;d&&(l.position=d);const g={id:f,type:o,title:n,message:s,duration:i};l.toasts.push(g),i>0&&setTimeout(()=>{r(f)},i+500)},r=o=>{const n=l.toasts.findIndex(s=>s.id===o);n!==-1&&l.toasts.splice(n,1)};return{state:l,show:a,remove:r,setPosition:o=>{l.position=o},success:(o,n="Success",s,i)=>a("success",n,o,s,i),error:(o,n="Error",s,i)=>a("error",n,o,s,i),warning:(o,n="Warning",s,i)=>a("warning",n,o,s,i),info:(o,n="Info",s,i)=>a("info",n,o,s,i)}},_={error:'<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>',info:'<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"></path></svg>',success:'<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>',warning:'<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>'},T=["innerHTML"],x=e.defineComponent({__name:"Toast",props:{id:{},type:{},title:{},message:{},duration:{}},emits:["close"],setup(a,{emit:r}){const t=a,o=r,n=e.ref(!1),s=e.computed(()=>_[t.type]||_.info),i=e.computed(()=>{const y=t.title&&t.title.trim().length>0,h=t.message&&t.message.trim().length>0;return!y||!h});let d=null;e.onMounted(()=>{requestAnimationFrame(()=>{n.value=!0}),f()});const f=()=>{d=setTimeout(()=>{g()},t.duration)},g=()=>{o("close",t.id)},$=()=>{},I=()=>{};return e.onBeforeUnmount(()=>{d&&clearTimeout(d)}),(y,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["erag-toast",[`erag-${a.type}`,{"erag-show":n.value}]]),style:e.normalizeStyle({"--duration":a.duration+"ms"}),onMouseenter:$,onMouseleave:I},[e.createElementVNode("div",{class:"erag-toast-icon",innerHTML:s.value},null,8,T),e.createElementVNode("div",{class:e.normalizeClass(["erag-toast-content",{"erag-single-line":i.value}])},[e.createElementVNode("strong",null,e.toDisplayString(a.title),1),e.createElementVNode("span",null,e.toDisplayString(a.message),1)],2),e.createElementVNode("button",{class:"erag-toast-close",onClick:g},[...h[0]||(h[0]=[e.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[e.createElementVNode("path",{fill:"currentColor",d:"M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"})],-1)])])],38))}}),u=(a,r)=>{const t=a.__vccOpts||a;for(const[o,n]of r)t[o]=n;return t},V=u(x,[["__scopeId","data-v-a3013926"]]),k=u(e.defineComponent({__name:"ToastContainer",setup(a){const{state:r,remove:t}=p();return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["erag-toast-container",`erag-${e.unref(r).position}`])},[e.createVNode(e.TransitionGroup,{name:"erag-toast-list"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).toasts,s=>(e.openBlock(),e.createBlock(V,{id:s.id,key:s.id,type:s.type,title:s.title,message:s.message,duration:s.duration,onClose:i=>e.unref(t)(s.id)},null,8,["id","type","title","message","duration","onClose"]))),128))]),_:1})],2))}}),[["__scopeId","data-v-
|
|
1
|
+
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.VueToastification={},c.Vue))})(this,function(c,e){"use strict";const l=e.reactive({toasts:[],position:"bottom-right"});let E=0;const p=()=>{const a=(o,n,s,i=4500,d)=>{const f=E++;d&&(l.position=d);const g={id:f,type:o,title:n,message:s,duration:i};l.toasts.push(g),i>0&&setTimeout(()=>{r(f)},i+500)},r=o=>{const n=l.toasts.findIndex(s=>s.id===o);n!==-1&&l.toasts.splice(n,1)};return{state:l,show:a,remove:r,setPosition:o=>{l.position=o},success:(o,n="Success",s,i)=>a("success",n,o,s,i),error:(o,n="Error",s,i)=>a("error",n,o,s,i),warning:(o,n="Warning",s,i)=>a("warning",n,o,s,i),info:(o,n="Info",s,i)=>a("info",n,o,s,i)}},_={error:'<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>',info:'<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"></path></svg>',success:'<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>',warning:'<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>'},T=["innerHTML"],x=e.defineComponent({__name:"Toast",props:{id:{},type:{},title:{},message:{},duration:{}},emits:["close"],setup(a,{emit:r}){const t=a,o=r,n=e.ref(!1),s=e.computed(()=>_[t.type]||_.info),i=e.computed(()=>{const y=t.title&&t.title.trim().length>0,h=t.message&&t.message.trim().length>0;return!y||!h});let d=null;e.onMounted(()=>{requestAnimationFrame(()=>{n.value=!0}),f()});const f=()=>{d=setTimeout(()=>{g()},t.duration)},g=()=>{o("close",t.id)},$=()=>{},I=()=>{};return e.onBeforeUnmount(()=>{d&&clearTimeout(d)}),(y,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["erag-toast",[`erag-${a.type}`,{"erag-show":n.value}]]),style:e.normalizeStyle({"--duration":a.duration+"ms"}),onMouseenter:$,onMouseleave:I},[e.createElementVNode("div",{class:"erag-toast-icon",innerHTML:s.value},null,8,T),e.createElementVNode("div",{class:e.normalizeClass(["erag-toast-content",{"erag-single-line":i.value}])},[e.createElementVNode("strong",null,e.toDisplayString(a.title),1),e.createElementVNode("span",null,e.toDisplayString(a.message),1)],2),e.createElementVNode("button",{class:"erag-toast-close",onClick:g},[...h[0]||(h[0]=[e.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[e.createElementVNode("path",{fill:"currentColor",d:"M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"})],-1)])])],38))}}),u=(a,r)=>{const t=a.__vccOpts||a;for(const[o,n]of r)t[o]=n;return t},V=u(x,[["__scopeId","data-v-a3013926"]]),k=u(e.defineComponent({__name:"ToastContainer",setup(a){const{state:r,remove:t}=p();return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["erag-toast-container",`erag-${e.unref(r).position}`])},[e.createVNode(e.TransitionGroup,{name:"erag-toast-list"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).toasts,s=>(e.openBlock(),e.createBlock(V,{id:s.id,key:s.id,type:s.type,title:s.title,message:s.message,duration:s.duration,onClose:i=>e.unref(t)(s.id)},null,8,["id","type","title","message","duration","onClose"]))),128))]),_:1})],2))}}),[["__scopeId","data-v-0c442d00"]]),m=e.reactive({isOpen:!1,options:{title:"",message:"",confirmText:"Confirm",cancelText:"Cancel",type:"info"}});let w;const C=()=>({state:m,confirm:t=>(m.options={...m.options,...t},m.isOpen=!0,new Promise(o=>{w=o})),handleAction:t=>{m.isOpen=!1,w&&w(t)}}),M={key:0,class:"erag-modal-backdrop"},N={class:"erag-modal-container"},B={class:"erag-modal-body"},z={class:"erag-modal-text"},b={class:"erag-modal-footer"},S=u(e.defineComponent({__name:"Modal",setup(a){const{state:r,handleAction:t}=C();return(o,n)=>(e.openBlock(),e.createBlock(e.Transition,{name:"erag-modal-fade"},{default:e.withCtx(()=>[e.unref(r).isOpen?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",N,[e.createElementVNode("div",B,[e.createElementVNode("div",{class:e.normalizeClass(["erag-modal-icon-wrapper",e.unref(r).options.type])},[...n[2]||(n[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})],-1)])],2),e.createElementVNode("div",z,[e.createElementVNode("h3",null,e.toDisplayString(e.unref(r).options.title),1),e.createElementVNode("p",null,e.toDisplayString(e.unref(r).options.message),1)])]),e.createElementVNode("div",b,[e.createElementVNode("button",{class:"erag-btn-cancel",onClick:n[0]||(n[0]=s=>e.unref(t)(!1))},e.toDisplayString(e.unref(r).options.cancelText||"Cancel"),1),e.createElementVNode("button",{class:e.normalizeClass(["erag-btn-confirm",e.unref(r).options.type]),onClick:n[1]||(n[1]=s=>e.unref(t)(!0))},e.toDisplayString(e.unref(r).options.confirmText||"Confirm"),3)])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-13c52896"]]),L={install(a,r={}){if(!document.getElementById("erag-toast-container")){const t=document.createElement("div");t.id="erag-toast-container",document.body.appendChild(t);const o=e.createVNode(k);e.render(o,t)}if(!document.getElementById("erag-modal-container")){const t=document.createElement("div");t.id="erag-modal-container",document.body.appendChild(t);const o=e.createVNode(S);e.render(o,t)}if(r.position){const{setPosition:t}=p();t(r.position)}a.config.globalProperties.$toast=p()}};c.default=L,c.useModal=C,c.useToast=p,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|