maz-ui 3.47.2-beta.7 → 3.47.2-beta.8
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/components/MazBottomSheet.mjs +1 -1
- package/components/MazBtn.mjs +1 -1
- package/components/MazCard.mjs +1 -1
- package/components/MazCarousel.mjs +1 -1
- package/components/MazChecklist.mjs +1 -1
- package/components/MazDialog.mjs +1 -1
- package/components/MazDialogPromise.mjs +1 -1
- package/components/MazDrawer.mjs +1 -1
- package/components/MazDropdown.mjs +1 -1
- package/components/MazIcon.mjs +1 -1
- package/components/MazInput.mjs +1 -1
- package/components/MazInputNumber.mjs +1 -1
- package/components/MazInputPrice.mjs +1 -1
- package/components/MazInputTags.mjs +1 -1
- package/components/MazLink.mjs +1 -1
- package/components/MazPagination.mjs +1 -1
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.mjs +1 -1
- package/components/MazSelect.mjs +1 -1
- package/components/MazStepper.mjs +1 -1
- package/components/MazTable.d.ts +4 -4
- package/components/MazTable.mjs +3 -2
- package/components/MazTableCell.d.ts +1 -5
- package/components/MazTableCell.mjs +19 -22
- package/components/MazTableRow.mjs +16 -16
- package/components/MazTableTitle.d.ts +1 -5
- package/components/MazTableTitle.mjs +18 -21
- package/components/MazTabsBar.mjs +1 -1
- package/components/MazTabsContent.mjs +4 -4
- package/components/MazTabsContentItem.mjs +7 -7
- package/components/assets/MazDropdown.css +1 -1
- package/components/assets/MazPicker.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/assets/MazTableCell.css +1 -1
- package/components/assets/MazTableRow.css +1 -1
- package/components/assets/MazTableTitle.css +1 -1
- package/components/assets/MazTabsBar.css +1 -1
- package/components/chunks/{MazBadge-D-0XgPWR.mjs → MazBadge-qdgVtKdQ.mjs} +1 -1
- package/components/chunks/{MazBottomSheet-C9GWCGys.mjs → MazBottomSheet-DX3dl16f.mjs} +1 -1
- package/components/chunks/{MazBtn-CMyQNKuk.mjs → MazBtn-B1DhLzSq.mjs} +2 -2
- package/components/chunks/{MazBtn-DA2lg-5s.mjs → MazBtn-B6xyipje.mjs} +1 -1
- package/components/chunks/MazBtn-BE_bHLkT.mjs +105 -0
- package/components/chunks/MazBtn-Blj3kViZ.mjs +105 -0
- package/components/chunks/{MazBtn-B0Q6Kw8H.mjs → MazBtn-BtmrmjP3.mjs} +2 -2
- package/components/chunks/{MazBtn-DFLIzh6y.mjs → MazBtn-C0fZIwfM.mjs} +2 -2
- package/components/chunks/MazBtn-CFf5L0DS.mjs +105 -0
- package/components/chunks/MazBtn-CiiCndWt.mjs +105 -0
- package/components/chunks/{MazBtn-DHfi8M3z.mjs → MazBtn-DMcVZ1r9.mjs} +2 -2
- package/components/chunks/{MazBtn-DZb-6vcl.mjs → MazBtn-DWVb9GQ3.mjs} +1 -1
- package/components/chunks/{MazBtn-VU3XSEv8.mjs → MazBtn-DanmhP4R.mjs} +1 -1
- package/components/chunks/{MazBtn-DKyz5Hc0.mjs → MazBtn-DzheqNTG.mjs} +2 -2
- package/components/chunks/MazBtn-FtH-ADjY.mjs +105 -0
- package/components/chunks/{MazBtn-DER-sPjl.mjs → MazBtn-pNpaQRRG.mjs} +2 -2
- package/components/chunks/{MazCard-BkcxQOWL.mjs → MazCard-DMDzDjHR.mjs} +1 -1
- package/components/chunks/{MazCarousel-CSv4VpC9.mjs → MazCarousel-BjBQQBFN.mjs} +1 -1
- package/components/chunks/{MazCheckbox-BHhDBSbJ.mjs → MazCheckbox-9R4fuM8t.mjs} +1 -1
- package/components/chunks/{MazCheckbox-BcwWN7iD.mjs → MazCheckbox-DXcpsRU4.mjs} +1 -1
- package/components/chunks/{MazCheckbox-B9iBXhoG.mjs → MazCheckbox-Dgn0lw5f.mjs} +1 -1
- package/components/chunks/{MazChecklist-DxtYuoEu.mjs → MazChecklist-D_IebAis.mjs} +1 -1
- package/components/chunks/{MazDialog-xPCkmhrE.mjs → MazDialog-Cyo_BtT4.mjs} +1 -1
- package/components/chunks/{MazDialogPromise-dIHWE8dO.mjs → MazDialogPromise-CHyri_Q5.mjs} +2 -2
- package/components/chunks/{MazDropdown-7WqbXnPN.mjs → MazDropdown-urkh4dW3.mjs} +87 -103
- package/components/chunks/{MazExpandAnimation-CUgYZyTw.mjs → MazExpandAnimation-CWDhei53.mjs} +1 -1
- package/components/chunks/{MazGallery-BfdKcDIu.mjs → MazGallery-DNN_xBeg.mjs} +2 -2
- package/components/chunks/{MazIcon-BbvBov5G.mjs → MazIcon-B4CDdmqe.mjs} +1 -1
- package/components/chunks/{MazIcon-DjMuw8Bz.mjs → MazIcon-B7Mn8F75.mjs} +1 -1
- package/components/chunks/MazIcon-BK45d_-V.mjs +4 -0
- package/components/chunks/{MazIcon-DVTWgYB6.mjs → MazIcon-BSgK89NE.mjs} +1 -1
- package/components/chunks/{MazInput-DG-grU7m.mjs → MazInput-CyWYuOsl.mjs} +1 -1
- package/components/chunks/{MazInput-SGx7gJ9r.mjs → MazInput-DFDzf7C1.mjs} +2 -2
- package/components/chunks/{MazInput-DnmjeD0Q.mjs → MazInput-LS_VhQAg.mjs} +2 -2
- package/components/chunks/{MazInputNumber-DoeT5Lcu.mjs → MazInputNumber-qQ6MrK-y.mjs} +2 -2
- package/components/chunks/{MazInputPrice-CZiypHp3.mjs → MazInputPrice-C207E4RH.mjs} +1 -1
- package/components/chunks/{MazInputTags-DGAglIQb.mjs → MazInputTags-a57ZPojk.mjs} +2 -2
- package/components/chunks/{MazLink-yKgOtTlk.mjs → MazLink-Ch-w_Lf_.mjs} +1 -1
- package/components/chunks/{MazLoadingBar-CBNuhilE.mjs → MazLoadingBar-rusnhtnI.mjs} +1 -1
- package/components/chunks/{MazPagination-eJFyS5Nn.mjs → MazPagination-CJEC7Y4E.mjs} +1 -1
- package/components/chunks/{MazPhoneNumberInput-rGR80IeJ.mjs → MazPhoneNumberInput-BUe2kgX6.mjs} +4 -4
- package/components/chunks/{MazPicker-CUpQ552W.mjs → MazPicker-DteyWEwr.mjs} +191 -209
- package/components/chunks/{MazPickerMonthSwitcher-duzi8uZ8.mjs → MazPickerMonthSwitcher-D46P6nV5.mjs} +1 -1
- package/components/chunks/{MazPickerShortcuts-Coq4ITAj.mjs → MazPickerShortcuts-C50DAlfT.mjs} +1 -1
- package/components/chunks/{MazPickerYearSwitcher-vUTntpYE.mjs → MazPickerYearSwitcher-5EW9ebYR.mjs} +1 -1
- package/components/chunks/{MazSelect-DA1D4Aus.mjs → MazSelect-C0rk6m_5.mjs} +3 -3
- package/components/chunks/{MazSelect-DpLBpopb.mjs → MazSelect-CJnsMuMG.mjs} +2 -2
- package/components/chunks/MazSpinner-B2mZYoLS.mjs +34 -0
- package/components/chunks/{MazSpinner-DJM02T-b.mjs → MazSpinner-BxlN_quv.mjs} +1 -1
- package/components/chunks/{MazSpinner-Bi3tSdWr.mjs → MazSpinner-CAR4Mm9l.mjs} +1 -1
- package/components/chunks/MazSpinner-CQAyxmwJ.mjs +34 -0
- package/components/chunks/{MazSpinner-BdOKUqKA.mjs → MazSpinner-CbuG6vB-.mjs} +1 -1
- package/components/chunks/MazSpinner-Cef473zM.mjs +34 -0
- package/components/chunks/{MazSpinner-Bbagpn0P.mjs → MazSpinner-CkOG2EM9.mjs} +1 -1
- package/components/chunks/MazSpinner-CksMqwXP.mjs +34 -0
- package/components/chunks/{MazSpinner-BODHZQ9h.mjs → MazSpinner-CqpyUTWh.mjs} +1 -1
- package/components/chunks/MazSpinner-CtZfuEKt.mjs +34 -0
- package/components/chunks/{MazSpinner-CQpzVTYF.mjs → MazSpinner-CyvYTwaV.mjs} +1 -1
- package/components/chunks/MazSpinner-DCBUvJ_o.mjs +34 -0
- package/components/chunks/MazSpinner-DPdh6vtw.mjs +34 -0
- package/components/chunks/{MazSpinner-CLlK6hHp.mjs → MazSpinner-D_6j7BO6.mjs} +1 -1
- package/components/chunks/{MazSpinner-B8vOa-3i.mjs → MazSpinner-DqZc3-_U.mjs} +1 -1
- package/components/chunks/MazSpinner-XikQHrkW.mjs +34 -0
- package/components/chunks/MazSpinner-q-AqkAjI.mjs +34 -0
- package/components/chunks/{MazStepper-DKPl3uIk.mjs → MazStepper-BWyXIppj.mjs} +1 -1
- package/components/chunks/{MazTable-DBiW_J2i.mjs → MazTable-BpIXKltC.mjs} +126 -126
- package/components/chunks/MazTableCell-DQAaVtw4.mjs +23 -0
- package/components/chunks/MazTableRow-CN415w3y.mjs +30 -0
- package/components/chunks/MazTableTitle-DbCN1l2O.mjs +23 -0
- package/components/chunks/{MazTabsBar-BVg2pxLA.mjs → MazTabsBar-jlclO5zk.mjs} +61 -77
- package/components/chunks/{MazTransitionExpand-2Ft7atX1.mjs → MazTransitionExpand-B2jKLvyg.mjs} +1 -1
- package/components/chunks/{inject-strict-BmiaNiwC.mjs → inject-strict-DEDSuzCz.mjs} +3 -3
- package/modules/chunks/{MazBtn-SZHtOzgz.cjs → MazBtn-BLjl_mR0.cjs} +1 -1
- package/modules/chunks/{MazBtn-y5LW9A2T.mjs → MazBtn-D6K3B6XM.mjs} +2 -2
- package/modules/chunks/{MazIcon-BpVDZGXl.cjs → MazIcon--UTNvIe4.cjs} +1 -1
- package/modules/chunks/{MazIcon-Dj66ziAh.mjs → MazIcon-BRGZkufX.mjs} +1 -1
- package/modules/chunks/{MazSpinner-uMrdk_99.mjs → MazSpinner-9EkSWhvP.mjs} +1 -1
- package/modules/chunks/{MazSpinner-CPT6UF2e.cjs → MazSpinner-B82Q3oFJ.cjs} +1 -1
- package/modules/chunks/{index-BG6gPie5.mjs → index-7UZ6u--K.mjs} +5 -5
- package/modules/chunks/index-fosopmwd.cjs +124 -0
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +1 -1
- package/package.json +1 -1
- package/types/components/MazTable.vue.d.ts +4 -4
- package/types/components/MazTableCell.vue.d.ts +1 -5
- package/types/components/MazTableTitle.vue.d.ts +1 -5
- package/types/modules/helpers/inject-strict.d.ts +2 -1
- package/components/chunks/MazBtn-D_K6k6A7.mjs +0 -105
- package/components/chunks/MazBtn-DnZ_pj-t.mjs +0 -105
- package/components/chunks/MazBtn-DpFjxnMy.mjs +0 -105
- package/components/chunks/MazBtn-DvfMuN3B.mjs +0 -105
- package/components/chunks/MazBtn-IPfW92RY.mjs +0 -105
- package/components/chunks/MazIcon-B3gy-jQ6.mjs +0 -4
- package/components/chunks/MazSpinner-Btv2qATX.mjs +0 -34
- package/components/chunks/MazSpinner-CR8HZnWn.mjs +0 -34
- package/components/chunks/MazSpinner-ChqoF_fX.mjs +0 -34
- package/components/chunks/MazSpinner-D5ciNjTR.mjs +0 -34
- package/components/chunks/MazSpinner-DIPbNESr.mjs +0 -34
- package/components/chunks/MazSpinner-VN2Vol2B.mjs +0 -34
- package/components/chunks/MazSpinner-dm4RUkiD.mjs +0 -34
- package/components/chunks/MazSpinner-oLVdOGaR.mjs +0 -34
- package/components/chunks/MazSpinner-v0FIBDiy.mjs +0 -34
- package/components/chunks/MazTableCell-D10vPzyI.mjs +0 -26
- package/components/chunks/MazTableRow-CSxkhwUM.mjs +0 -30
- package/components/chunks/MazTableTitle-BdRR_MXI.mjs +0 -26
- package/modules/chunks/index-BTegnVLg.cjs +0 -124
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";require('../assets/index.css');var Ot=Object.defineProperty;var Dt=(o,e,t)=>e in o?Ot(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var m=(o,e,t)=>Dt(o,typeof e!="symbol"?e+"":e,t);const s=require("vue");function Q(o,e){const t=s.inject(o,e);if(!t)throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${o.toString()}`);return t}function Vt(){return Q("aos")}function Bt(o){const e={};for(const[t,n]of Object.entries(o))e[t]=Number.parseInt(n,10);return e}function V(){return typeof document<"u"}function Ne(o={}){const{internalWindow:e=V()?window:void 0,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,includeScrollbar:r=!0}=o,i=s.ref(t),a=s.ref(n);function l(){e&&(r?(i.value=e.innerWidth,a.value=e.innerHeight):(i.value=e.document.documentElement.clientWidth,a.value=e.document.documentElement.clientHeight))}return l(),s.onMounted(()=>{e&&window.addEventListener("resize",l,{passive:!0})}),s.onUnmounted(()=>{e&&window.removeEventListener("resize",l)}),{width:i,height:a}}function Pt({initialWidth:o=0,initialHeight:e,includeScrollbar:t,internalWindow:n,listenOrientation:r,breakpoints:i,mediumBreakPoint:a="md",largeBreakPoint:l="lg"}){const{width:c}=Ne({initialWidth:o,initialHeight:e,includeScrollbar:t,internalWindow:n,listenOrientation:r}),u=Bt(i),h=s.computed(()=>c.value>=u[l]),g=s.computed(()=>c.value>=u[a]&&c.value<u[l]),w=s.computed(()=>c.value>=0&&c.value<u[a]);return{width:c,numericBreakpoints:u,isSmallScreen:w,isLargeScreen:h,isMediumScreen:g,breakpoints:i}}function Nt(){return Q("dialog")}function ke(o,e,t){const n={maxAttempts:20,interval:100,...t};let r=0;function i(){const a=o();a!=null?n.expectedValue!==void 0&&a!==n.expectedValue?r<n.maxAttempts?(r++,setTimeout(i,n.interval)):console.warn(n.errorMessage||`[maz-ui](checkAvailability) Nothing found after ${n.maxAttempts} attempts for ref ${a}`):e(a):r<n.maxAttempts?(r++,setTimeout(i,n.interval)):console.warn(n.errorMessage||`[maz-ui](checkAvailability) Nothing found or expected value after ${n.maxAttempts} attempts for ref ${a}`)}i()}function Me(o){const e=s.toValue(o);return Array.isArray(e)?Object.freeze([...e]):typeof e=="object"&&e!==null?Object.freeze({...e}):e}function Ae(o){return o==null||typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}function Mt(o,e){if(o.length!==e.length)return!1;for(const[t,n]of o.entries())if(!J(n,e[t]))return!1;return!0}function $t(o,e){const t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(const r of t)if(!n.includes(r)||!J(o[r],e[r]))return!1;return!0}function J(o,e){return Ae(o)||Ae(e)?o===e:o instanceof Date&&e instanceof Date?o.getTime()===e.getTime():typeof o!=typeof e||Array.isArray(o)!==Array.isArray(e)?!1:Array.isArray(o)&&Array.isArray(e)?Mt(o,e):typeof o=="object"&&typeof e=="object"?$t(o,e):!1}function Ht(o,e,t){const n={};return async function(...r){n[o]||(n[o]={timer:null,promise:null});const i=n[o];return i.timer&&clearTimeout(i.timer),i.promise=new Promise((a,l)=>{i.timer=setTimeout(async()=>{try{a(await e(...r))}catch(c){l(c)}finally{delete n[o]}},t)}),i.promise}}function Ft(o,e,t){const n={};return async(...r)=>{const i=Date.now();return n[o]||(n[o]={promise:null,lastCall:0,lastArgs:[]}),i-n[o].lastCall>=t?(n[o].lastCall=i,e(...r)):(n[o].lastArgs=r,n[o].promise||(n[o].promise=new Promise(a=>{setTimeout(async()=>{n[o].lastCall=Date.now();const l=await e(...n[o].lastArgs);n[o].promise=null,a(l)},t-(i-n[o].lastCall))})),n[o].promise)}}const H={mode:"lazy",scrollToErrorSelector:".has-field-error",debounceTime:300,throttleTime:1e3};function $e(o,e){return Object.keys(e).includes(o)}function Se(o=H.scrollToErrorSelector){const e=document.querySelector(o);e&&e.scrollIntoView({behavior:"smooth",block:"center"})}function qt(o,e){const t={};for(const[n,r]of Object.entries(o)){const i=r;t[n]=e[n].error&&i[0]?i[0].message:void 0}return t}function ze(o){return o==null||o===""}function jt({name:o,hasValidation:e,debouncedFields:t,throttledFields:n}){if(!e)return;const r=String(o);if(t!=null&&t[r]&&(n!=null&&n[r]))throw new Error(`The field "${r}" cannot be both debounced and throttled`);return t!=null&&t[r]?Ht(r,G,typeof t[r]=="number"?t[r]:H.debounceTime):n!=null&&n[r]?Ft(r,G,typeof n[r]=="number"?n[r]:H.throttleTime):G}function He({name:o,schema:e,initialValue:t,fieldState:n,options:r}){const i=e?$e(o,e):!1,a=jt({name:o,hasValidation:i,debouncedFields:r==null?void 0:r.debouncedFields,throttledFields:r==null?void 0:r.throttledFields});return{blurred:!1,dirty:!1,errors:[],error:!1,valid:!i,validating:!1,validated:!1,initialValue:Me(t),validateFunction:a,mode:i?(r==null?void 0:r.mode)??(n==null?void 0:n.mode)??H.mode:void 0}}function Ut({schema:o,payload:e,options:t}){const n={};for(const r in o){const i=r;n[i]=He({name:i,schema:o,options:t,fieldState:n[i],initialValue:e==null?void 0:e[i]})}return n}function _t({fieldsStates:o,payload:e,schema:t,options:n,updateMode:r=!1}){for(const i in t){const a=i;o[a]=Fe({name:a,fieldState:o[a],payload:e,schema:t,options:n,updateMode:r})}}function Fe({name:o,fieldState:e,payload:t,schema:n,options:r,updateMode:i=!0}){const{initialValue:a,mode:l,...c}=He({name:o,schema:n,initialValue:r.defaultValue??t[o],fieldState:e,options:r}),u=i?l??e.mode??H.mode:e.mode;return{...e,initialValue:a,mode:u,...e!=null&&e.mode&&u!==e.mode?c:{}}}function Wt(o){const e={};for(const[t,{errors:n}]of Object.entries(o))e[t]=n;return e}function Rt(o){return o instanceof HTMLInputElement||o instanceof HTMLSelectElement||o instanceof HTMLTextAreaElement?[o]:o.querySelectorAll("input, select, textarea")}function Kt({interactiveElements:o,onBlurHandler:e,mode:t}){o.forEach(n=>{ee(["eager","blur","progressive"],t)&&n.addEventListener("blur",e)})}function Yt({interactiveElements:o,onBlurHandler:e}){o.forEach(t=>{t.removeEventListener("blur",e)})}async function Zt(o,e,t){const n=await to(e),i=await(await Ue("safeParseAsync"))(n.entries[o],t??"");return{result:i,isValid:i.success}}async function G({name:o,fieldState:e,schema:t,payload:n,setError:r=!0,setErrorIfInvalidAndNotEmpty:i=!1}){if(await s.nextTick(),e.validating=!0,!t[o]){e.valid=!0,e.validating=!1,e.validated=!0,e.errors=[],e.error=!1;return}const{result:a,isValid:l}=await Zt(o,t,n[o]);e.valid=l,(r||i&&!l&&!ze(n[o]))&&(e.error=!l),e.errors=a.issues??[],e.validating=!1,e.validated=!0}function qe({name:o,fieldState:e,payload:t,schema:n}){var i;const r={name:o,fieldState:e,payload:t,schema:n,setError:e.mode==="progressive"?e.valid||e.blurred:!0};return(i=e.validateFunction)==null?void 0:i.call(e,r)}function Xt({fieldsStates:o,payload:e,showErrors:t=!0,schema:n}){return Promise.all(Object.keys(o).map(r=>G({name:r,setError:t,fieldState:o[r],payload:e,schema:n,setErrorIfInvalidAndNotEmpty:o[r].mode==="lazy"})))}function je({eventName:o,fieldState:e,isSubmitted:t}){const{dirty:n,blurred:r,mode:i,valid:a}=e;return o==="blur"&&(ee(["lazy","aggressive"],i)||a)||o==="input"&&i==="blur"||!i?!1:t||i==="eager"&&r||i==="blur"&&r||i==="aggressive"&&n||i==="lazy"&&n||i==="progressive"}function Gt({name:o,force:e=!1,payload:t,fieldState:n,schema:r,isSubmitted:i}){const a=t[o],l=!ze(a)&&!J(a,n.initialValue);if(n.dirty=l,n.blurred=n.blurred||(n.mode==="eager"?l:!0),!!(e||je({eventName:"blur",fieldState:n,isSubmitted:i})))return qe({name:o,fieldState:n,schema:r,payload:t})}function Qt({name:o,payload:e,fieldState:t,schema:n,isSubmitted:r,forceValidation:i=!1}){const a=e[o];t.validated=!1;const l=!ze(a)&&!J(a,t.initialValue);if(t.dirty=l,!!(i||je({eventName:"input",fieldState:t,isSubmitted:r})))return qe({name:o,fieldState:t,schema:n,payload:e})}function Le(o){const e=s.getCurrentInstance();if(!e)throw new Error(`${o} must be called within setup()`);return e}function Jt(o,e){var r;const n=((r=Le(e).formContexts)==null?void 0:r.get(o))??s.inject(o);if(!n)throw new Error("useFormField must be used within a form (useFormValidator)");return n}function eo({ref:o,fieldState:e,onBlurHandler:t}){if(!(o||ee(["aggressive","lazy"],e.mode)))return{onBlur:t}}const ge={};async function Ue(o){if(ge[o])return ge[o];const e=await Promise.resolve().then(()=>require("./index-CXVZhyjw.cjs"));return ge[o]=e[o],e[o]}async function to(o){return(await Ue("objectAsync"))(o)}function ee(o,e){return e?o.includes(e):!1}function oo(o,e){const t={formIdentifier:"main-form-validator",...e},{fieldsStates:n,payload:r,options:i,internalSchema:a,errorMessages:l,isSubmitted:c}=Jt(t.formIdentifier,"useFormField"),u=$e(o,a.value)?(e==null?void 0:e.mode)??i.mode:void 0;t.mode=u;const h=s.computed(()=>n.value[o]);if(n.value[o]=Fe({name:o,fieldState:h.value,payload:r.value,schema:a.value,options:{...i,...t}}),t.defaultValue!==void 0&&!J(r.value[o],t.defaultValue)){const E=t.defaultValue;r.value[o]=E,n.value[o].initialValue=Me(E)}u&&G({name:o,fieldState:h.value,payload:r.value,schema:a.value,setError:u==="aggressive",setErrorIfInvalidAndNotEmpty:u==="lazy"});function g(){Gt({name:o,fieldState:h.value,payload:r.value,schema:a.value,isSubmitted:c.value})}const w=s.computed(()=>eo({ref:t.ref,onBlurHandler:g,fieldState:h.value}));if(t.ref&&ee(["eager","blur","progressive"],u)){let E=[];const O=k=>{E=Rt(k),Kt({interactiveElements:E,onBlurHandler:g,mode:u})};s.onMounted(()=>{const k=Le(`useFormField of ${o}`);ke(()=>k.refs[t.ref],d=>{const y=d instanceof HTMLElement?d:d==null?void 0:d.$el;y&&O(y)},{errorMessage:`[maz-ui](useFormField) No element found for ref ${t.ref} for field ${o}`})}),s.onUnmounted(()=>{Yt({interactiveElements:E,onBlurHandler:g})})}return{hasError:s.computed(()=>h.value.error),errors:s.computed(()=>h.value.errors),errorMessage:s.computed(()=>l.value[o]),isValid:s.computed(()=>h.value.valid),isDirty:s.computed(()=>h.value.dirty),isBlurred:s.computed(()=>h.value.blurred),isValidated:s.computed(()=>h.value.validated),isValidating:s.computed(()=>h.value.validating),mode:s.computed(()=>h.value.mode),value:s.computed({get:()=>r.value[o],set:E=>r.value[o]=E}),validationEvents:w}}function no({schema:o,defaultValues:e,model:t,options:n}){const r=Le("useFormValidator"),i={mode:H.mode,scrollToError:H.scrollToErrorSelector,debouncedFields:null,throttledFields:null,identifier:"main-form-validator",...n},a=s.ref(e),l=s.ref({...a.value,...t==null?void 0:t.value}),c=s.ref(o),u=s.ref(Ut({schema:c.value,payload:l.value,options:i})),h=s.ref(!1),g=s.ref(!1),w=s.computed(()=>Object.values(u.value).every(({valid:C})=>C)),E=s.computed(()=>Object.values(u.value).some(({dirty:C})=>C)),O=s.computed(()=>Wt(u.value)),k=s.computed(()=>qt(O.value,u.value));t&&s.watch(l,C=>{t.value={...a.value,...C}},{deep:!0}),s.watch(a,C=>{l.value={...C,...l.value}},{deep:!0}),s.watch(c,C=>{_t({schema:C,fieldsStates:u.value,payload:l.value,options:i}),d()},{deep:!0}),d();function d(C=i.mode==="aggressive"){return Xt({fieldsStates:u.value,payload:l.value,schema:c.value,showErrors:C})}const y=[];async function A(C){await s.nextTick();const S=s.watch(()=>l.value[C],()=>{const B=u.value[C];Qt({name:C,fieldState:B,payload:l.value,schema:c.value,isSubmitted:g.value,forceValidation:ee(["aggressive","lazy","progressive"],B.mode)})},{deep:typeof c.value[C]=="object"});y.push(S)}function v(){for(const C of y)C();for(const C of Object.keys(c.value))A(C)}function L(C,S){return async B=>{if(B==null||B.preventDefault(),!h.value){g.value=!0,h.value=!0;try{await d(!0);const F=typeof S=="string"?S:i.scrollToError;let $;return w.value?$=await C(l.value):typeof F!="boolean"&&Se(F),h.value=!1,$}finally{h.value=!1}}}}const D={fieldsStates:u,payload:l,options:i,internalSchema:c,errorMessages:k,isSubmitted:g};return r.formContexts??(r.formContexts=new Map),r.formContexts.set(i.identifier,D),s.provide(i.identifier,D),v(),{identifier:i.identifier,isDirty:E,isSubmitting:h,isSubmitted:g,isValid:w,errors:O,model:l,fieldsStates:u,validateForm:d,scrollToError:Se,handleSubmit:L,errorMessages:k}}class _e{constructor(e,t){m(this,"defaultOptions",{element:void 0,timeout:60*1e3*5,once:!1,immediate:!0});m(this,"options");m(this,"timeoutHandler");m(this,"isIdle",!1);m(this,"isDestroy",!1);m(this,"startTime",0);m(this,"remainingTime",0);m(this,"lastClientX",-1);m(this,"lastClientY",-1);m(this,"eventNames",["DOMMouseScroll","mousedown","mousemove","mousewheel","MSPointerDown","MSPointerMove","keydown","touchmove","touchstart","wheel","click"]);m(this,"handleEvent",e=>{try{if(this.remainingTime>0)return;if(e.type==="mousemove"){const{clientX:t,clientY:n}=e;if(t===void 0&&n===void 0||t===this.lastClientX&&n===this.lastClientY)return;this.lastClientX=t,this.lastClientY=n}this.resetTimeout(),this.callback({isIdle:this.isIdle,eventType:e.type,instance:this})}catch(t){throw new Error(`[IdleTimeout](handleEvent) ${t}`)}});this.callback=e,this.options={...this.defaultOptions,...t},V()&&this.start()}get element(){return this.options.element??document.body}start(){if(!V()){console.warn("[IdleTimeout](start) you should run this method on client side");return}for(const e of this.eventNames)this.element.addEventListener(e,this.handleEvent);this.resetTimeout(),this.options.immediate&&this.callback({isIdle:!1,instance:this})}pause(){const e=this.startTime+this.options.timeout-Date.now();e<=0||(this.remainingTime=e,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0))}resume(){this.remainingTime<=0||(this.resetTimeout(),this.callback({isIdle:this.isIdle,instance:this}),this.remainingTime=0)}reset(){this.isDestroy=!1,this.isIdle=!1,this.remainingTime=0,this.resetTimeout(),this.callback({isIdle:this.isIdle,instance:this})}destroy(){if(!V()){console.warn("[IdleTimeout](destroy) you should run this method on client side");return}this.isDestroy=!0;for(const e of this.eventNames)this.element.removeEventListener(e,this.handleEvent);this.timeoutHandler&&clearTimeout(this.timeoutHandler)}resetTimeout(){this.isIdle=!1,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0),this.timeoutHandler=setTimeout(this.handleTimeout.bind(this),this.remainingTime||this.options.timeout),this.startTime=Date.now()}handleTimeout(){this.isIdle=!0,this.callback({isIdle:this.isIdle,instance:this}),this.options.once&&this.destroy()}get destroyed(){return this.isDestroy}get timeout(){return this.options.timeout}set timeout(e){this.options.timeout=e}get idle(){return this.isIdle}set idle(e){e?this.handleTimeout():this.reset(),this.callback({isIdle:this.isIdle,instance:this})}}function so({callback:o,options:e}){return new _e(o,e)}function ro({componentName:o,providedId:e}){const t=s.useId();return s.computed(()=>e??`${o}-${t}`)}const We=["af-ZA","sq-AL","ar-DZ","ar-BH","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LB","ar-LY","ar-MA","ar-OM","ar-QA","ar-SA","ar-SY","ar-TN","ar-AE","ar-YE","hy-AM","Cy-az-AZ","Lt-az-AZ","eu-ES","be-BY","bg-BG","ca-ES","zh-CN","zh-HK","zh-MO","zh-SG","zh-TW","zh-CHS","zh-CHT","hr-HR","cs-CZ","da-DK","div-MV","nl-BE","nl-NL","en-AU","en-BZ","en-CA","en-CB","en-IE","en-JM","en-NZ","en-PH","en-ZA","en-TT","en-GB","en-US","en-ZW","et-EE","fo-FO","fa-IR","fi-FI","fr-BE","fr-CA","fr-FR","fr-LU","fr-MC","fr-CH","gl-ES","ka-GE","de-AT","de-DE","de-LI","de-LU","de-CH","el-GR","gu-IN","he-IL","hi-IN","hu-HU","is-IS","id-ID","it-IT","it-CH","ja-JP","kn-IN","kk-KZ","kok-IN","ko-KR","ky-KZ","lv-LV","lt-LT","mk-MK","ms-BN","ms-MY","mr-IN","mn-MN","nb-NO","nn-NO","pl-PL","pt-BR","pt-PT","pa-IN","ro-RO","ru-RU","sa-IN","Cy-sr-SP","Lt-sr-SP","sk-SK","sl-SI","es-AR","es-BO","es-CL","es-CO","es-CR","es-DO","es-EC","es-SV","es-GT","es-HN","es-MX","es-NI","es-PA","es-PY","es-PE","es-PR","es-ES","es-UY","es-VE","sw-KE","sv-FI","sv-SE","syr-SY","ta-IN","tt-RU","te-IN","th-TH","tr-TR","uk-UA","ur-PK","Cy-uz-UZ","Lt-uz-UZ","vi-VN"];function io(o,e){return s.computed(()=>{const t=s.toValue(e),n=s.toValue(o);try{return!t||!n?n:new Intl.DisplayNames([t],{type:"language"}).of(n)||n}catch{return n}})}function ao(o){return s.computed(()=>{const e=s.toValue(o);if(!e)return[];const t=65,n=90,r=new Intl.DisplayNames([e],{type:"language"}),i=[];for(let a=t;a<=n;++a)for(let l=t;l<=n;++l){const c=String.fromCodePoint(a)+String.fromCodePoint(l),u=r.of(c);u&&c.toLocaleLowerCase()!==u.toLocaleLowerCase()&&i.push({language:u,code:c})}return i})}function lo(o){return s.computed(()=>{const e=s.toValue(o);if(!e)return[];const t=new Intl.DisplayNames([e],{type:"language"});return We.map(n=>{try{const r=t.of(n);return!r||n.toLocaleLowerCase()===r.toLocaleLowerCase()?void 0:{language:r,code:n}}catch{return}}).filter(Boolean)})}function uo(o){return{getLanguageDisplayName:({isoCode:e,locale:t})=>io(e,t||o),getAllPossibleLanguages:e=>ao(e||o),getLanguageDisplayNamesForIsoCodes:e=>lo(e||o)}}function Re(o){const e=o.join(", ").match(/\b\w+\b/g);return e?e.length:0}function co(o,e=150){const t=Re([o]);return Math.ceil(t/e)}function mo(o){const e=s.computed(()=>{var a;return typeof o.velocity=="number"?o.velocity:((a=o.velocity)==null?void 0:a.value)??150}),t=s.computed(()=>{var a;return typeof o.contentSelector=="string"?o.contentSelector:(a=o.contentSelector)==null?void 0:a.value}),n=s.computed(()=>{var a,l,c;if(typeof((a=o.contentRef)==null?void 0:a.value)=="object")return(l=o.contentRef.value)==null?void 0:l.textContent;if(t.value&&typeof document<"u"){const u=document.querySelector(t.value);if(u)return u.textContent}return typeof o.content=="string"?o.content:(c=o.content)==null?void 0:c.value}),r=s.computed(()=>co(n.value,e.value)),i=s.computed(()=>Re([n.value]));return{content:n,wordCount:i,velocity:e,duration:r}}const fo={removeAccents:!0,caseSensitive:!1,replaceSpaces:!0,removeSpecialCharacters:!1,trim:!0,normalizeSpaces:!0,removeNumbers:!1,customNormalizationForms:["NFC","NFKD"]};function we(o,e){const t={...fo,...e},n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Î:"I",Ï:"I",í:"I",î:"i",ï:"i",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ç:"C",ç:"c",ÿ:"y",Ñ:"N",ñ:"n",ó:"o"};let r=o.toString();if(t.trim&&(r=r.trim()),t.normalizeSpaces&&(r=r.replaceAll(/\s+/g," ")),t.replaceSpaces&&(r=r.replaceAll(" ","-")),t.removeNumbers&&(r=r.replaceAll(/\d/g,"")),t.removeAccents&&(r=r.replaceAll(/[ÀÁÂÃÄÅÇÈÉÊËÎÏÑÔÕÖØÙÚÛÜàáâãäåçèéêëíîïñóôõöøùúûüÿ]/g,i=>n[i]||i),r=r.replaceAll(/[\u0300-\u036F]/g,"")),t.caseSensitive===!1&&(r=r.toLowerCase()),t.removeSpecialCharacters&&(r=r.replaceAll(/[^\dA-Z-]/gi,"")),t.trim&&(r=r.trim()),t.customNormalizationForms)for(const i of t.customNormalizationForms)r=r.normalize(i);return r}function ho(o,e){const t=o.length,n=e.length,r=[];for(let i=0;i<=t;i++)r[i]=[i];for(let i=0;i<=n;i++)r[0][i]=i;for(let i=1;i<=t;i++)for(let a=1;a<=n;a++){const l=o[i-1]===e[a-1]?0:1;r[i][a]=Math.min(r[i-1][a]+1,r[i][a-1]+1,r[i-1][a-1]+l)}return r[t][n]}function Ke(o,e){const t=ho(o,e),n=Math.max(o.length,e.length);return 1-t/n}function vo(o,e,t=.75){return Ke(o,e)>=t}function po(o,e,t=.75){const n=s.computed(()=>we(typeof o=="string"?o:o.value)),r=s.computed(()=>we(typeof e=="string"?e:e.value)),i=s.computed(()=>typeof t=="number"?t:t.value),a=s.computed(()=>Ke(n.value,r.value));return{isMatching:s.computed(()=>vo(n.value,r.value,i.value)),score:a}}const go={preventDefaultOnTouchMove:!1,preventDefaultOnMouseWheel:!1,threshold:50,immediate:!1,triggerOnEnd:!1};class Ye{constructor(e){m(this,"element");m(this,"xStart");m(this,"yStart");m(this,"xEnd");m(this,"yEnd");m(this,"xDiff");m(this,"yDiff");m(this,"onToucheStartCallback");m(this,"onToucheMoveCallback");m(this,"onToucheEndCallback");m(this,"onMouseWheelCallback");m(this,"start");m(this,"stop");m(this,"options");this.inputOption=e,this.options={...go,...e},this.onToucheStartCallback=this.toucheStartHandler.bind(this),this.onToucheMoveCallback=this.handleTouchMove.bind(this),this.onToucheEndCallback=this.handleTouchEnd.bind(this),this.onMouseWheelCallback=this.handleMouseWheel.bind(this),this.start=this.startListening.bind(this),this.stop=this.stopListening.bind(this),this.options.element&&this.setElement(this.options.element),this.options.immediate&&this.start()}startListening(){this.setElement(this.options.element),this.element.addEventListener("touchstart",this.onToucheStartCallback,{passive:!0}),this.element.addEventListener("touchmove",this.onToucheMoveCallback,{passive:!0}),this.options.triggerOnEnd&&this.element.addEventListener("touchend",this.onToucheEndCallback,{passive:!0}),this.options.preventDefaultOnMouseWheel&&this.element.addEventListener("mousewheel",this.onMouseWheelCallback,{passive:!1})}stopListening(){this.element.removeEventListener("touchstart",this.onToucheStartCallback),this.element.removeEventListener("touchmove",this.onToucheMoveCallback),this.element.removeEventListener("touchend",this.onToucheEndCallback),this.options.preventDefaultOnMouseWheel&&this.element.removeEventListener("mousewheel",this.onMouseWheelCallback)}setElement(e){if(!e){console.error("[maz-ui][SwipeHandler](setElement) Element should be provided. Its can be a string selector or an HTMLElement");return}if(typeof e=="string"){const t=document.querySelector(e);if(!(t instanceof HTMLElement)){console.error("[maz-ui][SwipeHandler](setElement) String selector for element is not found");return}this.element=t}else this.element=e}handleMouseWheel(e){e.preventDefault()}toucheStartHandler(e){this.xStart=e.touches[0].clientX,this.yStart=e.touches[0].clientY,this.emitValuesChanged()}emitValuesChanged(){var e,t;(t=(e=this.options).onValuesChanged)==null||t.call(e,{xStart:this.xStart,yStart:this.yStart,xEnd:this.xEnd,yEnd:this.yEnd,xDiff:this.xDiff,yDiff:this.yDiff})}handleTouchMove(e){this.options.preventDefaultOnTouchMove&&e.cancelable&&e.preventDefault(),this.xEnd=e.touches[0].clientX,this.yEnd=e.touches[0].clientY,!(!this.xStart||!this.yStart)&&(this.xDiff=this.xStart-this.xEnd,this.yDiff=this.yStart-this.yEnd,this.emitValuesChanged(),this.options.triggerOnEnd||this.runCallbacks(e))}handleTouchEnd(e){this.runCallbacks(e),this.emitValuesChanged()}runCallbacks(e){var t,n,r,i,a,l,c,u;typeof this.xDiff!="number"||typeof this.yDiff!="number"||Math.abs(this.xDiff)<this.options.threshold&&Math.abs(this.yDiff)<this.options.threshold||(Math.abs(this.xDiff)>Math.abs(this.yDiff)?this.xDiff>0?(n=(t=this.options).onLeft)==null||n.call(t,e):(i=(r=this.options).onRight)==null||i.call(r,e):this.yDiff>0?(l=(a=this.options).onUp)==null||l.call(a,e):(u=(c=this.options).onDown)==null||u.call(c,e),this.resetValues())}resetValues(){this.xStart=void 0,this.yStart=void 0,this.xEnd=void 0,this.yEnd=void 0,this.xDiff=void 0,this.yDiff=void 0,this.emitValuesChanged()}}function yo(o){const e=s.ref(),t=s.ref(),n=s.ref(),r=s.ref(),i=s.ref(),a=s.ref(),l=s.computed(()=>s.toValue(o.element)),c=new Ye({...o,element:l.value,onValuesChanged(u){e.value=u.xDiff,t.value=u.yDiff,n.value=u.xStart,r.value=u.xEnd,i.value=u.yStart,a.value=u.yEnd}});return{xDiff:e,yDiff:t,xStart:n,xEnd:r,yStart:i,yEnd:a,start:()=>{l.value&&(c.options.element=l.value),c.start()},stop:c.stop}}const bo={darkClass:"dark",lightClass:"light",storageThemeKey:"theme",storageThemeValueDark:"dark",storageThemeValueLight:"light",storageThemeValueSystem:"system",watchChanges:!0},te=s.ref("system"),M=s.ref("system");function xe(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function oe({darkClass:o,lightClass:e,storageThemeKey:t,storageThemeValueDark:n,setLocalStorageValue:r=!0,setSelectedTheme:i=!0}){V()&&(document.documentElement.classList.remove(e),document.documentElement.classList.add(o),te.value=n,i&&(M.value=n),r&&(localStorage[t]=n))}function ne({darkClass:o,lightClass:e,storageThemeKey:t,storageThemeValueLight:n,setLocalStorageValue:r=!0,setSelectedTheme:i=!0}){V()&&(document.documentElement.classList.remove(o),document.documentElement.classList.add(e),te.value=n,i&&(M.value=n),r&&(localStorage[t]=n))}function Ze({setLocalStorageValue:o=!0,...e}){if(V())return document.documentElement.classList.remove(e.darkClass),document.documentElement.classList.remove(e.lightClass),te.value=e.storageThemeValueSystem,M.value=e.storageThemeValueSystem,o&&(localStorage[e.storageThemeKey]=e.storageThemeValueSystem),Ee(e)}function Xe(o){if(!o.defaultTheme)return console.error("[maz-ui](useThemeHandler) No default theme set");if(!["light","dark"].includes(o.defaultTheme))return console.error('[maz-ui](useThemeHandler) Default theme must be "light" or "dark"');switch(o.defaultTheme){case"dark":return oe({...o,setLocalStorageValue:!1,setSelectedTheme:!0});case"light":return ne({...o,setLocalStorageValue:!1,setSelectedTheme:!0})}}function Ee(o){return V()?!localStorage[o.storageThemeKey]&&o.defaultTheme?Xe(o):localStorage[o.storageThemeKey]===o.storageThemeValueDark||!localStorage[o.storageThemeKey]&&xe()||localStorage[o.storageThemeKey]===o.storageThemeValueSystem&&xe()?oe({...o,setLocalStorageValue:!1,setSelectedTheme:!1}):ne({...o,setLocalStorageValue:!1,setSelectedTheme:!1}):void 0}function ye({theme:o,...e}){return o==="system"?Ze(e):o==="dark"?oe(e):ne(e)}function wo(o){return te.value===o.storageThemeValueDark?ne(o):oe(o)}function Eo(o){const e={...bo,...o};function t(){Ee(e)}return s.onMounted(()=>{localStorage[e.storageThemeKey]&&(M.value=localStorage[e.storageThemeKey]),e.watchChanges&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t)}),s.onBeforeUnmount(()=>{e.watchChanges&&window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}),s.watch(M,n=>{switch(localStorage[e.storageThemeKey]=n,n){case e.storageThemeValueDark:{oe(e);break}case e.storageThemeValueLight:{ne(e);break}case e.storageThemeValueSystem:{Ze(e);break}}}),{autoSetTheme:()=>Ee(e),toggleTheme:()=>wo(e),setSystemTheme:()=>ye({...e,theme:"system"}),setDarkTheme:()=>ye({...e,theme:"dark"}),setLightTheme:()=>ye({...e,theme:"light"}),setDefaultTheme:()=>Xe(e),hasDarkTheme:s.computed(()=>M.value===e.storageThemeValueDark),hasLightTheme:s.computed(()=>M.value===e.storageThemeValueLight),hasSystemTheme:s.computed(()=>M.value===e.storageThemeValueSystem),theme:te,selectedTheme:M}}function Ge({timeout:o=1e3,callback:e,remainingTimeUpdate:t=200,callbackOffsetTime:n=0}){const r=s.ref(o),i=s.ref(o);let a;function l(w){typeof w=="number"&&(i.value=w),typeof w=="number"&&(r.value=w),c()}function c(){a||(a=setInterval(()=>{i.value-=t,i.value<=0&&(g(),setTimeout(()=>e==null?void 0:e(),n))},t))}function u(){a&&(clearInterval(a),a=void 0)}function h(){!a&&i.value>0&&c()}function g(){setTimeout(()=>i.value=r.value,n*2),u()}return{remainingTime:i,start:l,pause:u,resume:h,stop:g}}function Co(){return Q("toast")}class Qe{constructor(e,t){m(this,"eventHandlerFunction");m(this,"event","visibilitychange");m(this,"timeoutHandler");m(this,"options");m(this,"defaultOptions",{timeout:5e3,once:!1,immediate:!0});m(this,"isVisible",!1);this.callback=e,this.options={...this.defaultOptions,...t},this.eventHandlerFunction=this.eventHandler.bind(this),V()&&this.start()}start(){if(!V()){console.warn("[UserVisibility](start) you should run this method on client side");return}this.options.immediate&&this.emitCallback(),this.addEventListener()}emitCallback(){this.isVisible=document.visibilityState==="visible",this.callback({isVisible:this.isVisible}),this.options.once&&this.destroy()}eventHandler(){document.visibilityState==="visible"&&!this.isVisible?(this.clearTimeout(),this.emitCallback()):document.visibilityState==="hidden"&&this.initTimeout()}clearTimeout(){this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0)}initTimeout(){this.clearTimeout(),this.timeoutHandler=setTimeout(this.emitCallback.bind(this),this.options.timeout)}addEventListener(){document.addEventListener(this.event,this.eventHandlerFunction)}removeEventListener(){document.removeEventListener(this.event,this.eventHandlerFunction)}destroy(){this.removeEventListener(),this.timeoutHandler&&clearTimeout(this.timeoutHandler)}}function To({callback:o,options:e}){return new Qe(o,e)}function ko(){return Q("wait")}const ce="__maz-click-outside__";function Je(){return document.ontouchstart===null?"touchstart":"click"}async function et(o,e){try{tt(o);const t=e.instance,n=e.value,r=typeof n=="function";if(!r)throw new Error("[maz-ui](vClickOutside) the callback should be a function");await s.nextTick(),o[ce]=a=>{if((!o||a.target&&!o.contains(a.target))&&n&&r)return n.call(t,a)};const i=Je();document.addEventListener(i,o[ce],{passive:!0})}catch(t){console.error("[maz-ui](vClickOutside)",t)}}function tt(o){try{const e=Je();document.removeEventListener(e,o[ce],!1),delete o[ce]}catch(e){console.error("[maz-ui](vClickOutside)",e)}}function zo(o,e){try{if(e.value===e.oldValue)return;et(o,e)}catch(t){console.error("[maz-ui](vClickOutside)",t)}}const ot={mounted:et,updated:zo,unmounted:tt},nt={install:o=>{o.directive("click-outside",ot)}};function st(o,e,t){var a;o.stopPropagation();const n=typeof t.value=="function"?t.value:t.value.handler,r=typeof t.value=="object"?t.value.exclude:void 0;let i=!1;if(r&&r.length>0){for(const l of r)if(!i&&o.target instanceof HTMLElement){const c=(a=document.querySelector(l))==null?void 0:a.getAttribute("id");i=o.target.getAttribute("id")===c}}!e.contains(o.target)&&!i&&(n==null||n())}function rt(){return document.ontouchstart===null?"touchstart":"click"}function Lo(o,e){const t=rt();document.removeEventListener(t,n=>st(n,o,e))}function Io(o,e){if(typeof e.value!="function"&&typeof e.value=="object"&&typeof e.value.handler!="function"){console.error("[maz-ui](vClosable) v-closable directive requires a handler function");return}const t=rt();document.addEventListener(t,n=>st(n,o,e))}const it={mounted:Io,unmounted:Lo},at={install:o=>{o.directive("closable",it)}},Ce={position:"top"};class lt{constructor(e={}){m(this,"options");this.options={...Ce,...e}}getPosition({modifiers:e,value:t}){return e.top?"top":e.bottom?"bottom":e.left?"left":e.right?"right":typeof t=="string"?"top":t.position??this.options.position}getText({value:e}){return typeof e=="string"?e:e.text}getOpen({value:e}){return typeof e=="string"?!1:e.open??!1}getColor({value:e}){return typeof e=="string"?"default":e.color??"default"}create(e,t){e.setAttribute("data-tooltip",this.getText(t)),e.classList.add("m-tooltip");const n=this.getPosition(t);e.classList.add(`m-tooltip--${n}`),e.classList.add(`m-tooltip--${this.getColor(t)}`),this.getOpen(t)&&e.classList.add("m-tooltip--open")}update(e,t){this.remove(e,t),this.create(e,t)}remove(e,t){e.removeAttribute("data-tooltip"),e.classList.remove("m-tooltip"),e.classList.remove("m-tooltip--top"),e.classList.remove("m-tooltip--bottom"),e.classList.remove("m-tooltip--left"),e.classList.remove("m-tooltip--right"),e.classList.remove("m-tooltip--open"),e.classList.remove(`m-tooltip--${this.getColor(t)}`)}}let ie;const Ao={beforeMount(o,e){const t=typeof e.value=="object"?e.value:{};return ie=new lt(t),ie.create(o,e)},updated(o,e){return ie.update(o,e)},unmounted(o,e){return ie.remove(o,e)}},ut={install:(o,e=Ce)=>{const t={...Ce,...e},n=new lt(t);o.directive("tooltip",{beforeMount:n.create.bind(n),updated:n.update.bind(n),unmounted:n.remove.bind(n)})}};function de(o,e){let t=e==null?void 0:e.element;function n(){t&&s.render(null,t)}const r={...e==null?void 0:e.props,...e!=null&&e.addDestroyInProps?{destroy:n}:{}},i=s.createVNode(o,r,e==null?void 0:e.children);return e!=null&&e.app?(i.appContext=e.app._context,t?s.render(i,t):typeof document<"u"&&(t=document.createElement("div"),s.render(i,t))):(t=t??document.body,s.render(i,t)),{vNode:i,destroy:n,el:t}}function ct(o){return!!o}function So(o){return[...o].map(e=>{const t=e.codePointAt(0);return t?t%32+127461:void 0}).filter(ct).map(e=>String.fromCodePoint(e)).join("")}function xo(o,e){let t;return function(...n){clearTimeout(t),t=setTimeout(()=>{o.apply(this,n)},e)}}class Oo{constructor({src:e,identifier:t,once:n=!0,async:r=!0,defer:i=!0}){m(this,"src");m(this,"script");m(this,"once");m(this,"async");m(this,"defer");m(this,"identifier");if(typeof window>"u")throw new TypeError("[ScriptLoader]: Is supported only on browser side");if(!e)throw new Error('[ScriptLoader]: You should provide the attribut "src"');if(!t)throw new Error('[ScriptLoader]: You should provide the attribut "identifier"');this.src=e,this.identifier=t,this.once=n,this.async=r,this.defer=i}removeTag(e){var t;typeof e=="string"?(t=document.head.querySelector(`[data-identifier="${e}"]`))==null||t.remove():e.remove()}load(){const e=window,t=document.head.querySelectorAll(`[data-identifier="${this.identifier}"]`);if(this.once&&e[this.identifier]&&t.length>0)return this.script=e[this.identifier],Promise.resolve(this.script);if(!this.once&&t.length>0)for(const n of t)this.removeTag(n);return this.injectScript()}injectScript(){const e=window;return new Promise((t,n)=>{try{const r=document.createElement("script");r.src=this.src,r.async=this.async,r.defer=this.defer,r.dataset.identifier=this.identifier,r.addEventListener("error",i=>n(new Error(`[ScriptLoader](injectScript) ${i.message}`))),r.addEventListener("load",i=>(this.script=i,e[this.identifier]=i,t(i))),document.head.append(r)}catch(r){throw new Error(`[ScriptLoader](init) ${r}`)}})}}function dt(o){return new Promise(e=>setTimeout(e,o))}function Do(o,e){let t=!1,n,r;return function(...i){t?(clearTimeout(n),n=setTimeout(()=>{Date.now()-r>=e&&(o.apply(this,i),r=Date.now())},Math.max(e-(Date.now()-r),0))):(o.apply(this,i),r=Date.now(),t=!0)}}const Vo=["onKeypress"],Bo={class:"m-fullscreen-img-scroller"},Po=["src","alt"],No=s.defineComponent({__name:"MazFullscreenImg",props:{src:{},clickedElementBounds:{default:void 0},offset:{default:void 0},animation:{default:()=>({duration:300,easing:"ease-in-out"})},openInstanceClass:{default:"m-fullscreen-img-instance"},clickedElement:{},destroy:{type:Function,default:void 0},alt:{default:void 0},zoom:{type:Boolean,default:!0}},emits:["close","previous","next","before-close"],setup(o,{emit:e}){const t=o,n=e,r=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazSpinner-B82Q3oFJ.cjs"))),i=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-DW2WXkoF.cjs"))),a=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./chevron-left-Byr9GkwI.cjs"))),l=s.ref(!1),c=s.ref(!1),u=s.ref(!1),h=s.ref(!1),g=s.ref(!1),w=s.reactive({running:!1,ended:!1}),E=s.ref(t.clickedElement),O=s.computed(()=>t.clickedElement.getBoundingClientRect()),k=s.ref(),d=s.ref(t.src),y=s.ref(t.alt),A=s.ref(),v=s.ref(),L=s.ref(!0),D=s.computed(()=>({"--is-zoomed":g.value,"--invisible":L.value,"--absolute":!g.value}));function C(){var p,b;v.value&&(k.value=((p=v.value)==null?void 0:p.naturalWidth)>((b=v.value)==null?void 0:b.naturalHeight)),l.value=!0,c.value=!1,u.value=!0}s.watch(u,async p=>{p&&z()},{immediate:!0});function S(){n("before-close"),I()}function B(p){p.key==="Escape"&&(p.preventDefault(),S()),(p.key==="ArrowLeft"||p.key==="ArrowRight")&&(p.preventDefault(),K(p.key==="ArrowRight"?"next":"previous"))}function F(){document.documentElement.classList.add("--m-fullscreen-open")}function $(){document.documentElement.classList.remove("--m-fullscreen-open")}function W(){return[...document.querySelectorAll(".m-fullscreen-img-instance")]}function fe(p,b){return b<0?p.length-1:b>=p.length?0:b}async function R(p,b){p.classList.remove(t.openInstanceClass),b.classList.add(t.openInstanceClass);const T=b.getAttribute("data-src"),x=b.getAttribute("data-alt");y.value=x,d.value=T??d.value}function K(p){L.value=!0;const b=document.querySelector(`.m-fullscreen-img-instance.${t.openInstanceClass}`);if(b){const T=W(),x=T.indexOf(b),P=p==="next"?x+1:x-1,N=T[fe(T,P)];E.value=N,N&&R(b,N),n(p),l.value=!1,c.value=!0,ke(()=>l.value===!0,()=>{L.value=!1,g.value?Y():f()},{expectedValue:!0,interval:100,maxAttempts:50})}}function Y(){const p=v.value;if(!p){console.error("[maz-ui](vFullscreenImg) ImgElement is not defined");return}p.style.removeProperty("max-width"),p.style.removeProperty("max-height"),p==null||p.style.removeProperty("top"),p==null||p.style.removeProperty("left"),k.value?(p.style.height="100vh",p.style.removeProperty("width")):(p.style.width="100vw",p.style.removeProperty("height"))}async function he(){g.value?(g.value=!g.value,f()):(g.value=!g.value,Y())}function q(p){var T;w.running=!0,L.value=!1;const b=(T=v.value)==null?void 0:T.animate(p,{duration:t.animation.duration,easing:t.animation.easing});if(!b){console.error("[maz-ui](vFullscreenImg) animation is not defined"),w.running=!1,w.ended=!0;return}return b}function se(p=t.offset??0){const b=E.value.clientWidth||1,T=E.value.clientHeight||1,x=window.innerWidth,P=window.innerHeight,N=Math.min((x-2*p)/b,(P-2*p)/T),ve=(x-b*N)/2,pe=(P-T*N)/2;return{centerX:ve,centerY:pe,width:b,height:T,scale:N}}function re({trigger:p}){const{width:b,height:T,scale:x,centerX:P,centerY:N}=se(),{top:ve,left:pe,width:St,height:xt}=O.value,Ie=[{top:`${ve}px`,left:`${pe}px`,width:`${St}px`,height:`${xt}px`,opacity:0},{top:`${N}px`,left:`${P}px`,width:`${b*x}px`,height:`${T*x}px`,opacity:1}];return{frames:p==="open"?Ie:Ie.reverse()}}function f(){const{height:p,width:b,scale:T}=se(),x=k.value?{width:`${b*T}px`,maxHeight:`${p*T}px`}:{height:`${p*T}px`,maxWidth:`${b*T}px`};if(!v.value){console.error("[maz-ui](vFullscreenImg) ImgElement is not defined");return}k.value?(v.value.style.removeProperty("height"),v.value.style.removeProperty("maxHeight")):(v.value.style.removeProperty("width"),v.value.style.removeProperty("maxWidth")),Object.assign(v.value.style,x)}function z(){const{frames:p}=re({trigger:"open"}),b=q(p);if(!b){console.error("[maz-ui](vFullscreenImg) open animation is not defined"),f();return}b.onfinish=()=>{f(),w.running=!1,w.ended=!0}}function I(){const{frames:p}=re({trigger:"close"}),b=q(p);function T(){var x,P;n("close"),(x=A.value)==null||x.remove(),(P=t.destroy)==null||P.call(t),w.running=!1,w.ended=!0}if(!b){console.error("[maz-ui](vFullscreenImg) close animation is not defined"),T();return}b.onfinish=T}function Z(){g.value||f()}return s.onMounted(()=>{c.value=!0,document.addEventListener("keydown",B),window.addEventListener("resize",Z),F(),h.value=W().length>1}),s.onBeforeUnmount(()=>{document.removeEventListener("keydown",B),window.removeEventListener("resize",Z),$()}),(p,b)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"FullscreenImgElement",ref:A,role:"button",class:"m-fullscreen-img",tabindex:"0",onClick:s.withModifiers(S,["stop"]),onKeypress:s.withKeys(s.withModifiers(S,["prevent"]),["esc"])},[u.value&&h.value?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"m-fullscreen-btn --next",onClick:b[0]||(b[0]=s.withModifiers(T=>K("next"),["stop"]))},[s.createVNode(s.unref(a),{class:"maz-rotate-180"})])):s.createCommentVNode("v-if",!0),u.value&&h.value?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"m-fullscreen-btn --previous",onClick:b[1]||(b[1]=s.withModifiers(T=>K("previous"),["stop"]))},[s.createVNode(s.unref(a))])):s.createCommentVNode("v-if",!0),s.createElementVNode("button",{type:"button",class:"m-fullscreen-btn --close",onClick:S},[s.createVNode(s.unref(i))]),s.createElementVNode("div",Bo,[s.createElementVNode("img",{ref_key:"ImgElement",ref:v,src:d.value,alt:y.value??void 0,tabindex:"0",class:s.normalizeClass([D.value]),onLoad:C,onClick:b[2]||(b[2]=s.withModifiers(T=>p.zoom&&he(),["stop"]))},null,42,Po),s.withDirectives(s.createVNode(s.unref(r),{class:"m-fullscreen-img-loader"},null,512),[[s.vShow,c.value]])])],40,Vo))}}),me=(o,e)=>{const t=o.__vccOpts||o;for(const[n,r]of e)t[n]=r;return t},Mo=me(No,[["__scopeId","data-v-b6e5fc28"]]),Oe="m-fullscreen-is-open";class $o{constructor(){m(this,"options");m(this,"defaultOptions",{scaleOnHover:!1,blurOnHover:!1,disabled:!1,zoom:!0,offset:80,animation:{duration:300,easing:"ease-in-out"}});m(this,"mouseEnterListener");m(this,"mouseLeaveListener");m(this,"renderPreviewListener")}buildOptions(e,t){const n=typeof t.value=="object"?t.value:{src:t.value,alt:void 0},r=(n==null?void 0:n.src)??this.getImgSrc(e),i=(n==null?void 0:n.alt)??this.getImgAlt(e);return{...this.defaultOptions,...n,src:r,alt:i}}get allInstances(){return[...document.querySelectorAll(".m-fullscreen-img-instance")]}getImgSrc(e){var n;const t=((n=this.options)==null?void 0:n.src)||e.getAttribute("src")||e.getAttribute("data-src");if(!t)throw new Error('[maz-ui](fullscreen-img) src of image must be provided by `v-fullscreen=""`, `v-fullscreen="{ src: "" }"`, `src=""` or `data-src=""` atributes');return t}getImgAlt(e){var t;return((t=this.options)==null?void 0:t.alt)||e.getAttribute("alt")||e.getAttribute("data-alt")}create(e,t){if(this.options=this.buildOptions(e,t),this.options.disabled)return;e.style.cursor="move",(this.options.scaleOnHover||this.options.blurOnHover)&&(e.style.transition="all 200ms ease-in-out"),e.classList.add("m-fullscreen-img-instance"),e.setAttribute("data-src",this.getImgSrc(e));const n=this.getImgAlt(e);n&&e.setAttribute("data-alt",n),this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener)}update(e,t){this.options=this.buildOptions(e,t)}remove(e){e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("m-fullscreen-img-instance"),e.style.cursor=""}renderPreview(e){return e.classList.add(Oe),de(Mo,{props:{...this.options,openInstanceClass:Oe,clickedElement:e,clickedElementBounds:e.getBoundingClientRect()},addDestroyInProps:!0})}mouseLeave(e){this.options.scaleOnHover&&(e.style.transform=""),this.options.blurOnHover&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scaleOnHover&&(e.style.transform="scale(1.04)"),this.options.blurOnHover&&(e.style.filter="blur(3px)")}}let ae;const mt={mounted(o,e){return ae=new $o,ae.create(o,e)},updated(o,e){return ae.update(o,e)},unmounted(o){return ae.remove(o)}},ft={install(o){o.directive("fullscreen-img",mt)}},Ho="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Te={baseClass:"m-lazy-img",loadedClass:"m-lazy-loaded",loadingClass:"m-lazy-loading",errorClass:"m-lazy-error",noPhotoClass:"m-lazy-no-photo",noPhoto:!1,observerOnce:!0,loadOnce:!1,noUseErrorPhoto:!1,observerOptions:{threshold:.1}};class ht{constructor(e={}){m(this,"observers",[]);m(this,"defaultOptions",Te);m(this,"options");m(this,"onImgLoadedCallback");m(this,"onImgErrorCallback");m(this,"hasImgLoaded",!1);this.options=this.buildOptions(e),this.onImgLoadedCallback=this.imageIsLoaded.bind(this),this.onImgErrorCallback=this.imageHasError.bind(this)}async loadErrorPhoto(){const{default:e}=await Promise.resolve().then(()=>require("./no-photography-CLNgmzDi.cjs"));return e}buildOptions(e){return{...this.defaultOptions,...e,observerOptions:{...this.defaultOptions.observerOptions,...e.observerOptions}}}removeClass(e,t){e.classList.remove(t)}addClass(e,t){e.classList.add(t)}removeAllStateClasses(e){this.removeClass(e,this.options.loadedClass),this.removeClass(e,this.options.loadingClass),this.removeClass(e,this.options.errorClass),this.removeClass(e,this.options.noPhotoClass)}setBaseClass(e){this.addClass(e,this.options.baseClass)}imageIsLoading(e){var t,n;this.addClass(e,this.options.loadingClass),(n=(t=this.options).onLoading)==null||n.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,n;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),(n=(t=this.options).onLoaded)==null||n.call(t,e)}imageHasError(e){var t,n;this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),(n=(t=this.options).onError)==null||n.call(t,e),this.setDefaultPhoto(e)}getSrc(e){return typeof e.value=="object"?e.value.src:e.value}getImageUrl(e,t){const n=this.getImgElement(e).getAttribute("data-lazy-src");return n||this.getSrc(t)}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const n of t){const r=n.getAttribute("data-lazy-srcset");if(r)n.srcset=r;else return this.imageHasError(e)}else this.imageHasError(e)}hasBgImgMode(e){return e.arg==="bg-image"}isPictureElement(e){return e instanceof HTMLPictureElement}getImgElement(e){return this.isPictureElement(e)?e.querySelector("img"):e}async setDefaultPhoto(e){if(this.options.noUseErrorPhoto)return;const t=this.options.fallbackSrc??this.options.errorPhoto;typeof t=="string"&&this.addClass(e,this.options.noPhotoClass);const n=t??await this.loadErrorPhoto(),r=e.querySelectorAll("source");if(r.length>0)for await(const i of r)i.srcset=n;else this.setImgSrc(e,n)}addEventListenerToImg(e){const t=this.getImgElement(e);t.addEventListener("load",()=>this.onImgLoadedCallback(e),{once:!0}),t.addEventListener("error",n=>this.onImgErrorCallback(e,n),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const n=this.getImageUrl(e,t);if(!n)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${n}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,n))}}setImgSrc(e,t){const n=this.getImgElement(e);n.src=t}handleIntersectionObserver(e,t,n,r){var i,a;this.observers.push(r);for(const l of n)if(l.isIntersecting){if((a=(i=this.options).onIntersecting)==null||a.call(i,l.target),this.options.observerOnce&&r.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const n=(a,l)=>{this.handleIntersectionObserver(e,t,a,l)},r=this.options.observerOptions;new IntersectionObserver(n,r).observe(e)}async imageHandler(e,t,n){if(n==="update")for await(const r of this.observers)r.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,n){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,n)}async add(e,t){if(this.hasBgImgMode(t)&&this.isPictureElement(e))throw new Error(`[MazLazyImg] You can't use the "bg-image" mode with "<picture />" element`);setTimeout(()=>this.setBaseClass(e),0),e.getAttribute("src")||this.setImgSrc(e,Ho),await this.bindUpdateHandler(e,t,"bind")}async update(e,t){t.value!==t.oldValue&&(this.hasImgLoaded=!1,this.removeAllStateClasses(e),await this.bindUpdateHandler(e,t,"update"))}remove(e,t){this.hasImgLoaded=!1,this.hasBgImgMode(t)&&(e.style.backgroundImage=""),this.removeAllStateClasses(e);for(const n of this.observers)n.unobserve(e);this.observers=[]}}let le;const Fo={created(o,e){const t=typeof e.value=="object"?e.value:{};le=new ht(t),le.add(o,e)},updated(o,e){le.update(o,e)},unmounted(o,e){le.remove(o,e)}},vt={install(o,e={}){const t={...Te,...e,observerOptions:{...Te.observerOptions,...e.observerOptions}},n=new ht(t);o.directive("lazy-img",{created:n.add.bind(n),updated:n.update.bind(n),unmounted:n.remove.bind(n)})}},qo=`
|
|
2
|
+
.maz-zoom-img {
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
padding: 1rem;
|
|
9
|
+
z-index: 1050;
|
|
10
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.maz-zoom-img,
|
|
18
|
+
.maz-zoom-img * {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.maz-zoom-img .maz-zoom-img__wrapper {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
min-height: 0;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
max-height: 100%;
|
|
31
|
+
transition: all 300ms ease-in-out;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
transform: scale(0.5);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
transform: scale(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
right: 0;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
51
|
+
border-radius: 1rem;
|
|
52
|
+
z-index: 2;
|
|
53
|
+
min-width: 60px;
|
|
54
|
+
min-height: 60px;
|
|
55
|
+
}
|
|
56
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@-webkit-keyframes spin {
|
|
61
|
+
0% { transform: rotate(0deg); }
|
|
62
|
+
100% { transform: rotate(360deg); }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes spin {
|
|
66
|
+
0% { transform: rotate(0deg); }
|
|
67
|
+
100% { transform: rotate(360deg); }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {
|
|
71
|
+
animation: spin .6s linear infinite;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.maz-zoom-img img {
|
|
75
|
+
max-width: 100%;
|
|
76
|
+
max-height: 100%;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
border-radius: 1rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.maz-zoom-img .maz-zoom-btn {
|
|
82
|
+
margin: 0 auto;
|
|
83
|
+
border: none;
|
|
84
|
+
background-color: hsla(0, 0%, 7%, 0.5);
|
|
85
|
+
box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);
|
|
86
|
+
height: 2.2rem;
|
|
87
|
+
min-height: 2.2rem;
|
|
88
|
+
width: 2.2rem;
|
|
89
|
+
min-width: 2.2rem;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
border-radius: 2.2rem;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
flex: 0 0 auto;
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.maz-zoom-img .maz-zoom-btn svg {
|
|
100
|
+
fill: white;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: 0.5rem;
|
|
106
|
+
right: 0.5rem;
|
|
107
|
+
z-index: 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {
|
|
111
|
+
position: absolute;
|
|
112
|
+
left: 0.5rem;
|
|
113
|
+
z-index: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {
|
|
117
|
+
position: absolute;
|
|
118
|
+
right: 0.5rem;
|
|
119
|
+
z-index: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.maz-zoom-img .maz-zoom-btn:hover {
|
|
123
|
+
background-color: hsl(0, 0%, 0%);
|
|
124
|
+
}`,De={close:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',previous:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>',spinner:'<svg width="40px" height="40px" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" x="0px" y="0px" viewBox="0 0 50 50" xml:space="preserve" class="maz-zoom-img__loader__svg" data-v-6d1cb50c=""><path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path></svg>'};class jo{constructor(e){m(this,"options");m(this,"loader");m(this,"wrapper");m(this,"img");m(this,"keydownHandler");m(this,"onImgLoadedCallback");m(this,"buttonsAdded");m(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1});m(this,"mouseEnterListener");m(this,"mouseLeaveListener");m(this,"renderPreviewListener");if(!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if(typeof e.value=="object"&&!e.value.src)throw new Error("[maz-ui](zoom-img) src of image must be provided");this.buttonsAdded=!1,this.options=this.buildOptions(e),this.keydownHandler=this.keydownLister.bind(this),this.loader=this.getLoader(),this.wrapper=document.createElement("div"),this.wrapper.classList.add("maz-zoom-img__wrapper"),this.wrapper.prepend(this.loader),this.img=document.createElement("img"),this.onImgLoadedCallback=this.onImgLoaded.bind(this),this.imgEventHandler(!0)}buildOptions(e){return{...this.defaultOptions,...typeof e.value=="object"?e.value:{src:e.value}}}get allInstances(){return[...document.querySelectorAll(".maz-zoom-img-instance")]}create(e){this.options.disabled||(e.style.cursor="pointer",setTimeout(()=>e.classList.add("maz-zoom-img-instance")),e.setAttribute("data-zoom-src",this.options.src),this.options.alt&&e.setAttribute("data-zoom-alt",this.options.alt),e.style.transition="all 300ms ease-in-out",this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e,this.options),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener))}update(e){this.options=this.buildOptions(e)}remove(e){this.imgEventHandler(!1),e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("maz-zoom-img-instance"),e.removeAttribute("data-zoom-src"),e.removeAttribute("data-zoom-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle(qo);const n=document.createElement("div");n.classList.add("maz-zoom-img"),n.setAttribute("id","MazImgPreviewFullsize"),n.addEventListener("click",r=>{n.isEqualNode(r.target)&&this.closePreview()}),typeof t=="object"&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),n.append(this.wrapper),document.body.append(n),this.keyboardEventHandler(!0),setTimeout(()=>{n&&n.classList.add("maz-animate")},100)}onImgLoaded(){this.wrapper.style.width=`${this.img.width}px`,this.wrapper.style.minWidth="200px",this.loader.hidden=!0;const e=this.getButton(),t=[],n=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,n){const r=this.getButton("previous"),i=this.getButton("next");t.push(r,i)}this.wrapper.append(e),n&&(this.wrapper.prepend(t[0]),this.wrapper.append(t[1]))}}getLoader(){const e=document.createElement("div");return e.classList.add("maz-zoom-img__loader"),e.innerHTML=De.spinner,e}mouseLeave(e){this.options.scale&&(e.style.transform=""),this.options.blur&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scale&&(e.style.transform="scale(1.1)"),this.options.blur&&(e.style.filter="blur(2px)")}keydownLister(e){e.preventDefault(),(e.key==="Escape"||e.key===" ")&&this.closePreview(),(e.key==="ArrowLeft"||e.key==="ArrowRight")&&this.nextPreviousImage(e.key==="ArrowRight")}getButton(e="close"){const t=document.createElement("button");t.innerHTML=De[e];const n=e==="close"?this.closePreview():this.allInstances?this.nextPreviousImage(e==="next"):null;return t.addEventListener("click",()=>n),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),n=document.querySelector(".maz-zoom-img-instance.maz-is-open");n&&n.classList.remove("maz-is-open"),e&&e.classList.remove("maz-animate"),this.keyboardEventHandler(!1),setTimeout(()=>{e&&e.remove(),t&&t.remove()},300)}getNewInstanceIndex(e){return e<0?this.allInstances.length-1:e>=this.allInstances.length?0:e}nextPreviousImage(e){const t=e,n=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(n){const r=this.allInstances.indexOf(n),i=t?r+1:r-1,a=this.allInstances[this.getNewInstanceIndex(i)];a&&this.useNextInstance(n,a)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const n=t.getAttribute("data-zoom-src"),r=t.getAttribute("data-zoom-alt");this.wrapper.style.width="",this.loader.hidden=!1,n&&this.img.setAttribute("src",n),r&&this.img.setAttribute("alt",r)}addStyle(e){const t=document.createElement("style");t.id="MazPreviewStyle",t.textContent=e,document.head.append(t)}keyboardEventHandler(e){if(e)return document.addEventListener("keydown",this.keydownHandler);document.removeEventListener("keydown",this.keydownHandler)}imgEventHandler(e){if(e)return this.img.addEventListener("load",this.onImgLoadedCallback);this.img.removeEventListener("load",this.onImgLoadedCallback)}}let ue;const pt={created(o,e){ue=new jo(e),ue.create(o)},updated(o,e){ue.update(e)},unmounted(o){ue.remove(o)}},gt={install(o){o.directive("zoom-img",pt)}},Uo=[at,gt,vt,nt,ft,ut],_o={install(o){for(const e of Uo)e.install(o,{})}};function yt(o){return o?(o=o.toString(),o.charAt(0).toUpperCase()+o.slice(1)):""}const Wo={style:"currency",minimumFractionDigits:2,round:!1};function Ro(o,e,t){let n=Number(o);return t.round&&(n=Math.floor(n),t.minimumFractionDigits=0),new Intl.NumberFormat(e,t).format(n)}function Ko(o,e,t){if(o===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");if(e===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");if(t.currency===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.")}function bt(o,e,t){const n={...Wo,...t};Ko(o,e,n);try{return Ro(o,e,n)}catch(r){throw new Error(`[maz-ui](FilterCurrency) ${r}`)}}const Yo={month:"short",day:"numeric",year:"numeric"};function wt(o,e,t){if(e===void 0)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");const n=t??Yo;try{const r=o instanceof Date?o:new Date(o);return new Intl.DateTimeFormat(e,n).format(r)}catch(r){throw new Error(`[maz-ui](FilterDate) ${r}`)}}const Zo={minimumFractionDigits:2};function Et(o,e,t){const n={...Zo,...t};if(o===void 0)throw new TypeError("[maz-ui](FilterNumber) The `number` attribute is required.");if(e===void 0)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute must be a string.");try{return new Intl.NumberFormat(e,n).format(Number(o))}catch(r){throw new Error(`[maz-ui](FilterNumber) ${r}`)}}const Xo={capitalize:yt,currency:bt,date:wt,number:Et},Go={install(o){o.provide("filters",Xo)}},be={delay:100,observer:{root:void 0,rootMargin:"0px",threshold:.2},animation:{once:!0,duration:300,delay:0}};class Ct{constructor(e){m(this,"options");this.options={delay:(e==null?void 0:e.delay)??be.delay,observer:{...be.observer,...e==null?void 0:e.observer},animation:{...be.animation,...e==null?void 0:e.animation}}}handleIntersect(e,t){for(const n of e){const i=n.target.getAttribute("data-maz-aos-children")==="true",a=n.target.getAttribute("data-maz-aos")?[n.target]:[];if(i){const l=[...document.querySelectorAll("[data-maz-aos-anchor]")].map(c=>c.getAttribute("data-maz-aos-anchor")===`#${n.target.id}`?c:void 0);for(const c of l)c&&a.push(c)}for(const l of a){const c=l.getAttribute("data-maz-aos-once"),u=typeof c=="string"?c==="true":this.options.animation.once;if(typeof this.options.observer.threshold=="number"&&n.intersectionRatio>this.options.observer.threshold){const h=l.getAttribute("data-maz-aos-duration"),g=l.getAttribute("data-maz-aos-delay");if(h||(l.style.transitionDuration=`${this.options.animation.duration}ms`,setTimeout(()=>{l.style.transitionDuration="0"},1e3)),g||(l.style.transitionDelay=`${this.options.animation.delay}ms`,setTimeout(()=>{l.style.transitionDelay="0"},1e3)),l.classList.add("maz-aos-animate"),u){const w=l.getAttribute("data-maz-aos-anchor");if(w){const E=document.querySelector(w);E&&t.unobserve(E)}t.unobserve(l)}}else l.classList.remove("maz-aos-animate")}}}async handleObserver(){await dt(this.options.delay);const e=new IntersectionObserver(this.handleIntersect.bind(this),this.options.observer);for(const t of document.querySelectorAll("[data-maz-aos]")){const n=t.getAttribute("data-maz-aos-anchor");if(n){const r=document.querySelector(n);r?(r.setAttribute("data-maz-aos-children","true"),e.observe(r)):console.warn(`[maz-ui](aos) no element found with selector "${n}"`)}else e.observe(t)}}runAnimations(){if(V())return this.handleObserver();console.warn("[MazAos](runAnimations) should be executed on client side")}}let X;const Qo={install:(o,e)=>{X=new Ct(e),o.provide("aos",X),V()&&(e!=null&&e.router?e.router.afterEach(async()=>{X.runAnimations()}):X.runAnimations())}};function Jo(){return X}const Ve="--backdrop-present",en=s.defineComponent({inheritAttrs:!1,__name:"MazBackdrop",props:{modelValue:{type:Boolean,default:!1},teleportSelector:{default:"body"},beforeClose:{type:Function,default:void 0},persistent:{type:Boolean,default:!1},noCloseOnEscKey:{type:Boolean,default:!1},transitionName:{default:"backdrop-anim"},backdropClass:{default:void 0},backdropContentClass:{default:void 0}},emits:["open","close","update:model-value","before-close"],setup(o,{expose:e,emit:t}){const n=o,r=t;function i(){document.documentElement.classList.add(Ve)}async function a(){document.querySelector(".m-backdrop.--present")||document.documentElement.classList.remove(Ve)}const l=s.ref(n.modelValue);function c(){u(!1)}async function u(d){var y;d||(r("before-close"),await((y=n.beforeClose)==null?void 0:y.call(n))),l.value=d}function h(){r("open")}function g(){r("update:model-value",!1),r("close"),k()}function w(){n.persistent||c()}function E(d){!n.noCloseOnEscKey&&d.key==="Escape"&&!n.persistent&&c()}function O(){i(),document.addEventListener("keyup",E,!1)}function k(){document.removeEventListener("keyup",E),a()}return s.onMounted(()=>{n.modelValue?O():k()}),s.watch(()=>n.modelValue,d=>{l.value=d,d?O():k()}),e({onBackdropAnimationEnter:h,onBackdropAnimationLeave:g,onBackdropClicked:w,close:c,present:l,toggleModal:u,onKeyPress:E}),(d,y)=>(s.openBlock(),s.createBlock(s.Teleport,{to:d.teleportSelector},[s.createVNode(s.Transition,{appear:"",name:d.transitionName,onAfterEnter:h,onAfterLeave:g},{default:s.withCtx(()=>[l.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["m-backdrop --present",[d.backdropClass]]),tabindex:"-1",role:"dialog"},[s.createElementVNode("button",{class:s.normalizeClass(["m-backdrop-overlay",{"--disabled":d.persistent}]),tabindex:"-1",onClick:s.withModifiers(w,["self"])},null,2),s.createElementVNode("div",s.mergeProps({class:["m-backdrop-content",d.backdropContentClass]},d.$attrs,{role:"document",tabindex:"0"}),[s.renderSlot(d.$slots,"default",{close:c})],16)],2)):s.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["to"]))}}),tn={key:0,id:"dialogTitle",class:"maz-my-0 maz-text-xl maz-font-semibold"},on={id:"dialogDesc",class:"m-dialog-content"},nn={key:0,class:"m-dialog-footer"},sn=s.defineComponent({__name:"MazDialog",props:{modelValue:{type:Boolean},title:{default:void 0},noClose:{type:Boolean,default:!1},width:{default:"500px"},maxWidth:{default:"95vw"},maxHeight:{default:"95vh"},scrollable:{type:Boolean,default:!1},persistent:{type:Boolean,default:!1},teleportSelector:{},beforeClose:{},noCloseOnEscKey:{type:Boolean},transitionName:{},backdropClass:{},backdropContentClass:{}},emits:["open","close","update:model-value"],setup(o,{expose:e}){const t=o,n=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazBtn-BLjl_mR0.cjs"))),r=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-DW2WXkoF.cjs"))),i=s.useAttrs(),a=s.ref();e({close:()=>{var u,h;return(h=(u=a.value)==null?void 0:u.close)==null?void 0:h.call(u)}});const l=s.computed(()=>({...i,class:void 0,style:void 0})),c=s.computed(()=>({class:i.class,style:i.style}));return(u,h)=>(s.openBlock(),s.createBlock(en,s.mergeProps({...l.value,...t},{ref_key:"backdrop",ref:a,persistent:u.persistent,"model-value":u.modelValue,"transition-name":"modal-anim","aria-labelledby":"dialogTitle","aria-describedby":"dialogDesc",onClose:h[0]||(h[0]=g=>u.$emit("close",g)),onOpen:h[1]||(h[1]=g=>u.$emit("open",g)),"onUpdate:modelValue":h[2]||(h[2]=g=>u.$emit("update:model-value",g))}),{default:s.withCtx(({close:g})=>[s.createElementVNode("div",s.mergeProps({class:["m-dialog",{"--scrollable":u.scrollable}],role:"dialog","aria-modal":"true",style:[{width:u.width,maxWidth:u.maxWidth,maxHeight:u.maxHeight}]},c.value),[s.renderSlot(u.$slots,"header",{close:g},()=>[s.createElementVNode("div",{class:s.normalizeClass(["m-dialog-header",{"--has-title":u.$slots.title||u.title}])},[u.$slots.title||u.title?(s.openBlock(),s.createElementBlock("h2",tn,[s.renderSlot(u.$slots,"title",{},()=>[s.createTextVNode(s.toDisplayString(u.title),1)],!0)])):s.createCommentVNode("v-if",!0),!u.noClose&&!u.persistent?(s.openBlock(),s.createBlock(s.unref(n),{key:1,class:"m-dialog-closebtn",color:"transparent",size:"sm",icon:s.unref(r),onClick:g},null,8,["icon","onClick"])):s.createCommentVNode("v-if",!0)],2)],!0),s.createElementVNode("div",on,[s.renderSlot(u.$slots,"default",{close:g},void 0,!0)]),u.$slots.footer?(s.openBlock(),s.createElementBlock("div",nn,[s.renderSlot(u.$slots,"footer",{close:g},void 0,!0)])):s.createCommentVNode("v-if",!0)],16)]),_:3},16,["persistent","model-value"]))}}),rn=me(sn,[["__scopeId","data-v-50775b17"]]),j={cancelText:"Cancel",confirmText:"Confirm",cancelButton:{text:"Cancel",color:"danger"},confirmButton:{text:"Confirm",color:"success"}},an=s.ref(j),U=s.ref([]);function ln(o,e){return new Promise((t,n)=>{U.value=[...U.value,{id:o,isActive:!0,resolve:async r=>{t(r),await(e==null?void 0:e())},reject:async r=>{n(r),await(e==null?void 0:e())}}]})}function Tt(o){return U.value=U.value.filter(({id:e})=>e!==o),U.value}function Be(o,e,t){var n;e&&((n=e[o])==null||n.call(e,t),e.isActive=!1,setTimeout(()=>{Tt(e.id)},500))}function kt(){return{data:an,dialogState:U,showDialogAndWaitChoice:ln,removeDialogFromState:Tt,rejectDialog:async(o,e=new Error("cancel"),t)=>(await(t==null?void 0:t()),Be("reject",o,e)),resolveDialog:async(o,e="accept",t)=>(await(t==null?void 0:t()),Be("resolve",o,e))}}const un={class:"maz-flex maz-items-center maz-gap-2"},cn=s.defineComponent({__name:"MazDialogPromise",props:{data:{default:void 0},message:{default:void 0},identifier:{default:void 0},buttons:{default:void 0},modelValue:{type:Boolean},title:{},noClose:{type:Boolean},width:{},maxWidth:{},maxHeight:{},scrollable:{type:Boolean},persistent:{type:Boolean},teleportSelector:{},beforeClose:{},noCloseOnEscKey:{type:Boolean},transitionName:{},backdropClass:{},backdropContentClass:{},cancelText:{},cancelButton:{type:[Boolean,Object]},confirmText:{},confirmButton:{type:[Boolean,Object]}},emits:["open","close"],setup(o,{expose:e}){const t=o,n=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazBtn-BLjl_mR0.cjs"))),{dialogState:r,rejectDialog:i,resolveDialog:a,data:l}=kt(),c=s.computed(()=>{var d;return t.buttons??((d=t.data)==null?void 0:d.buttons)??l.value.buttons}),u=s.computed(()=>({...j,...l.value,...t.data})),h=s.computed(()=>{var A,v,L,D;if(!(((A=l.value)==null?void 0:A.cancelButton)??((v=t.data)==null?void 0:v.cancelButton)??j.cancelButton))return;const y={...j.cancelButton,...(L=l.value)==null?void 0:L.cancelButton,...(D=t.data)==null?void 0:D.cancelButton};return{...y,text:t.cancelText||u.value.cancelText||y.text}}),g=s.computed(()=>{var A,v,L,D;if(!(((A=l.value)==null?void 0:A.confirmButton)??((v=t.data)==null?void 0:v.confirmButton)??j.confirmButton))return;const y={...j.confirmButton,...(L=l.value)==null?void 0:L.confirmButton,...(D=t.data)==null?void 0:D.confirmButton};return{...y,text:t.confirmText||u.value.confirmText||y.text}}),w=s.computed(()=>r.value.find(({id:d})=>d===t.identifier)),E=s.ref();e({close:()=>{var d,y;return(y=(d=E.value)==null?void 0:d.close)==null?void 0:y.call(d)}});function O(d){return"type"in d&&(d.type==="resolve"||d.type==="reject")}function k(d,y){return O(y)?y.type==="resolve"?a(d,y.response):i(d,y.response):a(d,void 0,y.action)}return(d,y)=>{var A;return s.openBlock(),s.createBlock(rn,s.mergeProps({ref_key:"dialog",ref:E},{...d.$attrs,...t},{"model-value":((A=w.value)==null?void 0:A.isActive)??d.modelValue??!1,onClose:y[2]||(y[2]=v=>d.$emit("close",v)),onOpen:y[3]||(y[3]=v=>d.$emit("open",v)),"onUpdate:modelValue":y[4]||(y[4]=v=>s.unref(i)(w.value))}),{title:s.withCtx(()=>[s.renderSlot(d.$slots,"title",{},()=>{var v;return[s.createTextVNode(s.toDisplayString(d.title||((v=u.value)==null?void 0:v.title)),1)]})]),default:s.withCtx(()=>[s.renderSlot(d.$slots,"default",{resolve:v=>s.unref(a)(w.value,v),reject:v=>s.unref(i)(w.value,v)},()=>{var v;return[s.createTextVNode(s.toDisplayString(d.message||((v=u.value)==null?void 0:v.message)),1)]})]),footer:s.withCtx(()=>[s.renderSlot(d.$slots,"footer-button",{resolve:v=>s.unref(a)(w.value,v),reject:v=>s.unref(i)(w.value,v)},()=>[s.createElementVNode("div",un,[c.value?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(c.value,(v,L)=>(s.openBlock(),s.createBlock(s.unref(n),s.mergeProps({key:L,ref_for:!0},{...v,type:"button"},{onClick:D=>k(w.value,v)}),{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(v.text),1)]),_:2},1040,["onClick"]))),128)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[h.value?(s.openBlock(),s.createBlock(s.unref(n),s.mergeProps({key:0},h.value,{onClick:y[0]||(y[0]=v=>s.unref(i)(w.value))}),{default:s.withCtx(()=>[s.renderSlot(d.$slots,"cancel-text",{},()=>[s.createTextVNode(s.toDisplayString(h.value.text),1)])]),_:3},16)):s.createCommentVNode("v-if",!0),g.value?(s.openBlock(),s.createBlock(s.unref(n),s.mergeProps({key:1},g.value,{onClick:y[1]||(y[1]=v=>s.unref(a)(w.value))}),{default:s.withCtx(()=>[s.renderSlot(d.$slots,"confirm-text",{},()=>[s.createTextVNode(s.toDisplayString(g.value.text),1)])]),_:3},16)):s.createCommentVNode("v-if",!0)],64))])])]),_:3},16,["model-value"])}}}),Pe={identifier:"main-dialog"};class zt{constructor(e,t=Pe){this.app=e,this.globalOptions=t}open(e){const t={...Pe,...this.globalOptions,...e},{destroy:n,vNode:r}=de(cn,{props:t,app:this.app}),{showDialogAndWaitChoice:i}=kt();function a(){var c,u,h;(u=(c=r.component)==null?void 0:c.exposed)==null||u.close(),(h=t.promiseCallback)==null||h.call(t),setTimeout(()=>{n()},700)}return{promise:i(t.identifier,()=>{a()}),destroy:n,close:a}}}const dn={install(o,e){o.provide("dialog",new zt(o,e))}},mn={class:"m-toast__message-wrapper"},fn={class:"m-toast__message"},hn={class:"maz-flex maz-items-center maz-gap-2"},vn={key:0},pn={key:4,class:"progress-bar maz-absolute maz-inset-x-0 maz-bottom-0 maz-h-1"},gn=s.defineComponent({__name:"MazToast",props:{message:{default:void 0},position:{default:"bottom-right"},maxToasts:{type:[Number,Boolean],default:!1},timeout:{type:[Number,Boolean],default:1e4},queue:{type:Boolean},noPauseOnHover:{type:Boolean},type:{default:"info"},link:{default:void 0},action:{default:void 0},persistent:{type:Boolean},icon:{type:Boolean,default:!0}},emits:["close","click","open"],setup(o,{expose:e,emit:t}){const n=o,r=t,i=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazBtn-BLjl_mR0.cjs"))),a=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-DW2WXkoF.cjs"))),l=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrow-top-right-on-square-PZtr8Zs0.cjs"))),c=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./exclamation-triangle-BtW3be9S.cjs"))),u=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./exclamation-circle-BXs0Yj0f.cjs"))),h=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./information-circle-89FseEuJ.cjs"))),g=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./check-circle-D3i-p-t3.cjs"))),w=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./link-CUxj8BQ5.cjs"))),E=s.ref(),O=s.computed(()=>{if(n.icon)switch(n.type){case"danger":return c;case"info":return h;case"success":return g;case"warning":return u;default:return}}),k=s.computed(()=>n.position.includes("top")?"top":"bottom"),d=s.computed(()=>n.position.includes("left")?"left":n.position.includes("right")?"right":"center"),y=s.computed(()=>d.value!=="center"?d.value==="right"?"m-slide-right":"m-slide-left":k.value==="top"?"m-slide-top":"m-slide-bottom"),A=s.ref(!1),v=s.ref(!1),L=s.ref(),D=`m-toast-container --${k.value} --${d.value}`,C=`.${D.replaceAll(" ",".")}`,S=Ge({callback:q,timeout:typeof n.timeout=="number"?n.timeout:0,callbackOffsetTime:200});function B(){const f=document.querySelector(C);if(!f&&!f){const z=document.body,I=document.createElement("div");I.className=D,z.append(I)}}function F(){const f=document.querySelector(C);return!n.queue&&n.maxToasts===!1?!1:typeof n.maxToasts=="number"&&f?n.maxToasts<=f.childElementCount:f&&f.childElementCount>0}function $(){if(F()){L.value=setTimeout($,250);return}const f=document.querySelector(C);E.value&&f&&f.prepend(E.value),v.value=!0,typeof n.timeout=="number"&&n.timeout>0&&S.start()}const W=s.ref("100%");function fe(){switch(n.type){case"danger":return"maz-bg-danger-700";case"info":return"maz-bg-info-700";case"success":return"maz-bg-success-700";case"warning":return"maz-bg-warning-700";default:return"maz-bg-primary"}}s.watch(S.remainingTime,f=>{if(typeof n.timeout=="number"){const z=100*f/n.timeout;W.value=`${z}%`}});function R(f){r("click",f),n.persistent||q()}async function K(f,z){var I;A.value=!0,await f(),A.value=!1,(I=n.action)!=null&&I.closeToast&&R(z)}function Y(f){n.noPauseOnHover||(f?S.pause():S.resume())}function he(){S.stop(),L.value&&clearTimeout(L.value)}function q(){he(),v.value=!1}e({closeToast:q});function se(){r("open")}function re(){var z;r("close"),(z=E.value)==null||z.remove();const f=document.querySelector(C);f&&!(f!=null&&f.hasChildNodes())&&f.remove()}return s.onMounted(()=>{B(),$()}),(f,z)=>(s.openBlock(),s.createBlock(s.Transition,{name:y.value,onAfterLeave:re,onAfterEnter:se,persisted:""},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("button",{ref_key:"Toaster",ref:E,class:s.normalizeClass(["m-toast",[`--${f.type}`,`--${k.value}`,`--${d.value}`,{"maz-pb-1":typeof f.timeout=="number"&&f.timeout>0,"--persistent":f.persistent}]]),role:"alert",onMouseover:z[2]||(z[2]=I=>Y(!0)),onMouseleave:z[3]||(z[3]=I=>Y(!1)),onClick:z[4]||(z[4]=s.withModifiers(I=>{var Z;return f.link&&!((Z=f.link)!=null&&Z.closeToast)?void 0:R(I)},["stop"]))},[O.value?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(O.value),{key:0,class:"maz-text-2xl"})):s.createCommentVNode("v-if",!0),s.createElementVNode("div",mn,[s.createElementVNode("p",fn,s.toDisplayString(f.message),1)]),f.action?(s.openBlock(),s.createBlock(s.unref(i),{key:1,"data-test":"action-btn",color:f.type,pastel:"",loading:A.value,size:"sm",onClick:z[0]||(z[0]=s.withModifiers(I=>f.action?K(f.action.func,I):void 0,["stop"]))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(f.action.text),1)]),_:1},8,["color","loading"])):s.createCommentVNode("v-if",!0),f.link?(s.openBlock(),s.createBlock(s.unref(i),{key:2,"data-test":"link-btn",color:f.type,pastel:"",size:"xs",href:f.link.href,target:f.link.target??"_self"},{default:s.withCtx(()=>{var I;return[s.createElementVNode("div",hn,[f.link.text?(s.openBlock(),s.createElementBlock("span",vn,s.toDisplayString(f.link.text),1)):s.createCommentVNode("v-if",!0),((I=f.link)==null?void 0:I.target)==="_blank"?(s.openBlock(),s.createBlock(s.unref(l),{key:1,class:"maz-text-xl"})):(s.openBlock(),s.createBlock(s.unref(w),{key:2,class:"maz-text-xl"}))])]}),_:1},8,["color","href","target"])):s.createCommentVNode("v-if",!0),f.persistent?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("button",{key:3,class:"--close",onClick:z[1]||(z[1]=s.withModifiers(I=>R(I),["stop"]))},[s.createVNode(s.unref(a),{class:"--icon maz-text-xl"})])),typeof f.timeout=="number"&&f.timeout>0?(s.openBlock(),s.createElementBlock("div",pn,[s.createElementVNode("div",{style:s.normalizeStyle({width:W.value}),class:s.normalizeClass(["maz-h-full !maz-transition-all !maz-duration-200 !maz-ease-linear",fe()])},null,6)])):s.createCommentVNode("v-if",!0)],34),[[s.vShow,v.value]])]),_:1},8,["name"]))}}),yn=me(gn,[["__scopeId","data-v-c8684398"]]),bn={position:"bottom-right",timeout:1e4,persistent:!1,icon:!0};class Lt{constructor(e,t){this.app=e,this.globalOptions=t}show(e,t){const n={...bn,...this.globalOptions,...t,message:e},{destroy:r,vNode:i}=de(yn,{props:n,app:this.app});return{destroy:r,close:()=>{var a,l;return(l=(a=i.component)==null?void 0:a.exposed)==null?void 0:l.closeToast()}}}getLocalOptions(e,t){return{type:e,...t}}message(e,t){return this.show(e,this.getLocalOptions("theme",t))}success(e,t){return this.show(e,this.getLocalOptions("success",t))}error(e,t){return this.show(e,this.getLocalOptions("danger",t))}info(e,t){return this.show(e,this.getLocalOptions("info",t))}warning(e,t){return this.show(e,this.getLocalOptions("warning",t))}}function wn(o,e){return new Lt(o,e)}const En={install(o,e){o.provide("toast",wn(o,e))}},_="";function Cn(o){return o.filter((e,t,n)=>t===n.indexOf(e))}function Tn(o){return(e=_)=>typeof e=="function"?o.findIndex((...t)=>e(...t))>-1:o.includes(e)}const kn=o=>o.length>0;function zn(o){return(e=_)=>Cn([...o,e])}function Ln(o){return(e=_)=>o.filter(t=>t!==e)}class It{constructor(){m(this,"_loaders",s.ref([]))}get loaders(){return s.computed(()=>this._loaders.value)}stop(e=_){this._loaders.value=Ln(this._loaders.value)(e)}start(e=_){return this._loaders.value=zn(this._loaders.value)(e),()=>this.stop(e)}get anyLoading(){return s.computed(()=>kn(this._loaders.value))}isLoading(e=_){return s.computed(()=>Tn(this._loaders.value)(e)).value}}const At=new It,In={install:o=>{o.provide("wait",At)}};exports.AosHandler=Ct;exports.DialogHandler=zt;exports.IdleTimeout=_e;exports.ScriptLoader=Oo;exports.Swipe=Ye;exports.ToasterHandler=Lt;exports.UserVisibility=Qe;exports.WaitHandler=It;exports._export_sfc=me;exports.capitalize=yt;exports.checkAvailability=ke;exports.countryCodeToUnicodeFlag=So;exports.currency=bt;exports.date=wt;exports.debounce=xo;exports.directive=ot;exports.directive$1=it;exports.directive$2=Ao;exports.directive$3=mt;exports.directive$4=Fo;exports.getInstance=Jo;exports.injectStrict=Q;exports.installDialog=dn;exports.installFilters=Go;exports.installToaster=En;exports.instance=At;exports.isClient=V;exports.isoCodes=We;exports.mount=de;exports.normalizeString=we;exports.number=Et;exports.plugin=_o;exports.plugin$1=nt;exports.plugin$2=at;exports.plugin$3=ut;exports.plugin$4=ft;exports.plugin$5=vt;exports.plugin$6=gt;exports.plugin$7=Qo;exports.plugin$8=In;exports.sleep=dt;exports.throttle=Do;exports.truthyFilter=ct;exports.useAos=Vt;exports.useBreakpoints=Pt;exports.useDialog=Nt;exports.useFormField=oo;exports.useFormValidator=no;exports.useIdleTimeout=so;exports.useInstanceUniqId=ro;exports.useLanguageDisplayNames=uo;exports.useReadingTime=mo;exports.useStringMatching=po;exports.useSwipe=yo;exports.useThemeHandler=Eo;exports.useTimer=Ge;exports.useToast=Co;exports.useUserVisibility=To;exports.useWait=ko;exports.useWindowSize=Ne;exports.vZoomImg=pt;
|
package/modules/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-fosopmwd.cjs");exports.AosHandler=e.AosHandler;exports.DialogHandler=e.DialogHandler;exports.IdleTimeout=e.IdleTimeout;exports.ScriptLoader=e.ScriptLoader;exports.Swipe=e.Swipe;exports.ToasterHandler=e.ToasterHandler;exports.UserVisibility=e.UserVisibility;exports.WaitHandler=e.WaitHandler;exports.capitalize=e.capitalize;exports.checkAvailability=e.checkAvailability;exports.countryCodeToUnicodeFlag=e.countryCodeToUnicodeFlag;exports.currency=e.currency;exports.date=e.date;exports.debounce=e.debounce;exports.getAosInstance=e.getInstance;exports.injectStrict=e.injectStrict;exports.installAos=e.plugin$7;exports.installDialog=e.installDialog;exports.installDirectives=e.plugin;exports.installFilters=e.installFilters;exports.installToaster=e.installToaster;exports.installWait=e.plugin$8;exports.isClient=e.isClient;exports.isoCodes=e.isoCodes;exports.mount=e.mount;exports.normalizeString=e.normalizeString;exports.number=e.number;exports.sleep=e.sleep;exports.throttle=e.throttle;exports.truthyFilter=e.truthyFilter;exports.useAos=e.useAos;exports.useBreakpoints=e.useBreakpoints;exports.useDialog=e.useDialog;exports.useFormField=e.useFormField;exports.useFormValidator=e.useFormValidator;exports.useIdleTimeout=e.useIdleTimeout;exports.useInstanceUniqId=e.useInstanceUniqId;exports.useLanguageDisplayNames=e.useLanguageDisplayNames;exports.useReadingTime=e.useReadingTime;exports.useStringMatching=e.useStringMatching;exports.useSwipe=e.useSwipe;exports.useThemeHandler=e.useThemeHandler;exports.useTimer=e.useTimer;exports.useToast=e.useToast;exports.useUserVisibility=e.useUserVisibility;exports.useWait=e.useWait;exports.useWindowSize=e.useWindowSize;exports.vClickOutside=e.directive;exports.vClickOutsideInstall=e.plugin$1;exports.vClosable=e.directive$1;exports.vClosableInstall=e.plugin$2;exports.vFullscreenImg=e.directive$3;exports.vFullscreenImgInstall=e.plugin$4;exports.vLazyImg=e.directive$4;exports.vLazyImgInstall=e.plugin$5;exports.vTooltip=e.directive$2;exports.vTooltipInstall=e.plugin$3;exports.vZoomImg=e.vZoomImg;exports.vZoomImgInstall=e.plugin$6;exports.waitInstance=e.instance;
|
package/modules/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as e, a0 as i, O as l, S as t, U as n, a3 as o, X as r, a6 as u, H as c, L as d, M as m, I, J as g, N as v, Z as T, i as p, $ as y, a1 as F, s as b, G as C, a2 as S, a5 as h, P as z, g as A, Q as D, R as H, K as k, T as w, V as L, W as U, u as W, a as V, b as O, c as Z, d as f, e as j, f as q, h as x, j as B, k as M, l as N, m as R, n as E, o as G, p as J, q as K, r as P, t as Q, v as X, w as Y, x as $, B as _, A as aa, D as sa, C as ea, y as ia, z as la, F as ta, E as na, a4 as oa } from "./chunks/index-
|
|
1
|
+
import { Y as e, a0 as i, O as l, S as t, U as n, a3 as o, X as r, a6 as u, H as c, L as d, M as m, I, J as g, N as v, Z as T, i as p, $ as y, a1 as F, s as b, G as C, a2 as S, a5 as h, P as z, g as A, Q as D, R as H, K as k, T as w, V as L, W as U, u as W, a as V, b as O, c as Z, d as f, e as j, f as q, h as x, j as B, k as M, l as N, m as R, n as E, o as G, p as J, q as K, r as P, t as Q, v as X, w as Y, x as $, B as _, A as aa, D as sa, C as ea, y as ia, z as la, F as ta, E as na, a4 as oa } from "./chunks/index-7UZ6u--K.mjs";
|
|
2
2
|
export {
|
|
3
3
|
e as AosHandler,
|
|
4
4
|
i as DialogHandler,
|
package/nuxt/index.json
CHANGED
package/package.json
CHANGED
|
@@ -131,18 +131,18 @@ export interface MazTableProps<T extends Row<T>> {
|
|
|
131
131
|
*/
|
|
132
132
|
roundedSize?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
133
133
|
/**
|
|
134
|
-
* Enable
|
|
135
|
-
* @default `
|
|
134
|
+
* Enable scrollable on table
|
|
135
|
+
* @default `false`
|
|
136
136
|
*/
|
|
137
|
-
|
|
137
|
+
scrollable?: boolean;
|
|
138
138
|
}
|
|
139
139
|
export interface MazTableProvide {
|
|
140
140
|
size: Ref<Size>;
|
|
141
141
|
hoverable: Ref<boolean>;
|
|
142
142
|
backgroundEven: Ref<boolean>;
|
|
143
143
|
backgroundOdd: Ref<boolean>;
|
|
144
|
-
truncate: Ref<boolean>;
|
|
145
144
|
}
|
|
145
|
+
export declare const mazTableKey = "maz-table";
|
|
146
146
|
declare const _default: <T extends Row<T>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
147
147
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
148
148
|
readonly "onUpdate:model-value"?: ((value: (string | number | boolean | Row<T>)[] | undefined) => any) | undefined;
|
|
@@ -6,11 +6,7 @@ declare function __VLS_template(): {
|
|
|
6
6
|
attrs: Partial<{}>;
|
|
7
7
|
};
|
|
8
8
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<{
|
|
10
|
-
truncate?: boolean;
|
|
11
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
12
|
-
truncate?: boolean;
|
|
13
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
10
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
11
|
export default _default;
|
|
16
12
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -6,11 +6,7 @@ declare function __VLS_template(): {
|
|
|
6
6
|
attrs: Partial<{}>;
|
|
7
7
|
};
|
|
8
8
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<{
|
|
10
|
-
truncate?: boolean;
|
|
11
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
12
|
-
truncate?: boolean;
|
|
13
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
10
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
11
|
export default _default;
|
|
16
12
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
export declare function injectStrict<T>(key: string | InjectionKey<T> | symbol, fallback?: T): NonNullable<T>;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, defineAsyncComponent as m, useAttrs as $, computed as o, openBlock as t, createBlock as a, resolveDynamicComponent as r, normalizeClass as l, withCtx as S, renderSlot as i, unref as u, createCommentVNode as d, createElementBlock as M, createVNode as w } from "vue";
|
|
2
|
-
import { _ as E } from "./MazSelect-DpLBpopb.mjs";
|
|
3
|
-
import '../assets/MazBtn.css';const F = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "m-btn-loader-container"
|
|
6
|
-
}, O = /* @__PURE__ */ h({
|
|
7
|
-
__name: "MazBtn",
|
|
8
|
-
props: {
|
|
9
|
-
variant: { default: "button" },
|
|
10
|
-
size: { default: "md" },
|
|
11
|
-
color: { default: "primary" },
|
|
12
|
-
type: { default: "button" },
|
|
13
|
-
rounded: { type: Boolean },
|
|
14
|
-
roundedSize: { default: "lg" },
|
|
15
|
-
noRounded: { type: Boolean },
|
|
16
|
-
outline: { type: Boolean },
|
|
17
|
-
pastel: { type: Boolean },
|
|
18
|
-
block: { type: Boolean },
|
|
19
|
-
noUnderline: { type: Boolean },
|
|
20
|
-
loading: { type: Boolean },
|
|
21
|
-
disabled: { type: Boolean },
|
|
22
|
-
fab: { type: Boolean },
|
|
23
|
-
icon: { type: [String, Function, Object], default: void 0 },
|
|
24
|
-
leftIcon: { type: [String, Function, Object], default: void 0 },
|
|
25
|
-
rightIcon: { type: [String, Function, Object], default: void 0 },
|
|
26
|
-
noPadding: { type: Boolean },
|
|
27
|
-
noElevation: { type: Boolean },
|
|
28
|
-
justify: { default: "center" }
|
|
29
|
-
},
|
|
30
|
-
setup(p) {
|
|
31
|
-
const n = p, v = m(() => import("./MazSpinner-v0FIBDiy.mjs")), f = m(() => import("./MazIcon-BbvBov5G.mjs")), { href: z, to: b } = $(), c = o(() => z ? "a" : b ? "router-link" : "button"), g = o(
|
|
32
|
-
() => n.pastel ? `--${n.color}-pastel` : n.outline ? `--${n.color}-outline` : `--${n.color}`
|
|
33
|
-
), y = o(
|
|
34
|
-
() => (n.loading || n.disabled) && c.value === "button"
|
|
35
|
-
), j = o(() => y.value ? "--cursor-default" : "--cursor-pointer"), B = o(() => `--is-${n.variant}`), k = o(() => n.loading && n.variant === "button"), C = o(() => c.value === "button" ? n.type : void 0), s = o(() => n.size === "xl" ? "maz-text-3xl" : n.size === "lg" ? "maz-text-2xl" : n.size === "md" ? "maz-text-xl" : n.size === "sm" ? "maz-text-lg" : n.size === "xs" ? "maz-text-base" : n.size === "mini" ? "maz-text-sm" : "md"), I = o(() => n.justify === "start" ? "maz-justify-start" : n.justify === "end" ? "maz-justify-end" : n.justify === "center" ? "maz-justify-center" : n.justify === "between" ? "maz-justify-between" : n.justify === "around" ? "maz-justify-around" : n.justify === "evenly" ? "maz-justify-evenly" : "maz-justify-center");
|
|
36
|
-
return (e, A) => (t(), a(r(c.value), {
|
|
37
|
-
disabled: y.value || void 0,
|
|
38
|
-
class: l(["m-btn", [
|
|
39
|
-
`--${e.size}`,
|
|
40
|
-
!e.fab && !e.rounded && e.roundedSize && `--rounded-${e.roundedSize}`,
|
|
41
|
-
g.value,
|
|
42
|
-
j.value,
|
|
43
|
-
B.value,
|
|
44
|
-
I.value,
|
|
45
|
-
{
|
|
46
|
-
"--block": e.block,
|
|
47
|
-
"--no-underline": e.noUnderline,
|
|
48
|
-
"--fab": e.fab,
|
|
49
|
-
"--loading": e.loading,
|
|
50
|
-
"--disabled": y.value,
|
|
51
|
-
"--rounded": e.rounded,
|
|
52
|
-
"--no-rounded": e.noRounded,
|
|
53
|
-
"--no-padding": e.noPadding,
|
|
54
|
-
"--no-elevation": e.noElevation
|
|
55
|
-
}
|
|
56
|
-
]]),
|
|
57
|
-
type: C.value
|
|
58
|
-
}, {
|
|
59
|
-
default: S(() => [
|
|
60
|
-
i(e.$slots, "left-icon", {}, () => [
|
|
61
|
-
typeof e.leftIcon == "string" ? (t(), a(u(f), {
|
|
62
|
-
key: 0,
|
|
63
|
-
name: e.leftIcon,
|
|
64
|
-
class: l([s.value])
|
|
65
|
-
}, null, 8, ["name", "class"])) : e.leftIcon ? (t(), a(r(e.leftIcon), {
|
|
66
|
-
key: 1,
|
|
67
|
-
class: l([s.value])
|
|
68
|
-
}, null, 8, ["class"])) : d("v-if", !0)
|
|
69
|
-
], !0),
|
|
70
|
-
i(e.$slots, "icon", {}, () => [
|
|
71
|
-
typeof e.icon == "string" ? (t(), a(u(f), {
|
|
72
|
-
key: 0,
|
|
73
|
-
name: e.icon,
|
|
74
|
-
class: l([s.value])
|
|
75
|
-
}, null, 8, ["name", "class"])) : e.icon ? (t(), a(r(e.icon), {
|
|
76
|
-
key: 1,
|
|
77
|
-
class: l([s.value])
|
|
78
|
-
}, null, 8, ["class"])) : d("v-if", !0)
|
|
79
|
-
], !0),
|
|
80
|
-
i(e.$slots, "default", {}, void 0, !0),
|
|
81
|
-
i(e.$slots, "right-icon", {}, () => [
|
|
82
|
-
typeof e.rightIcon == "string" ? (t(), a(u(f), {
|
|
83
|
-
key: 0,
|
|
84
|
-
name: e.rightIcon,
|
|
85
|
-
class: l([s.value])
|
|
86
|
-
}, null, 8, ["name", "class"])) : e.rightIcon ? (t(), a(r(e.rightIcon), {
|
|
87
|
-
key: 1,
|
|
88
|
-
class: l([s.value])
|
|
89
|
-
}, null, 8, ["class"])) : d("v-if", !0)
|
|
90
|
-
], !0),
|
|
91
|
-
k.value ? (t(), M("div", F, [
|
|
92
|
-
w(u(v), {
|
|
93
|
-
size: "2em",
|
|
94
|
-
color: e.color
|
|
95
|
-
}, null, 8, ["color"])
|
|
96
|
-
])) : d("v-if", !0)
|
|
97
|
-
]),
|
|
98
|
-
_: 3
|
|
99
|
-
/* FORWARDED */
|
|
100
|
-
}, 8, ["disabled", "class", "type"]));
|
|
101
|
-
}
|
|
102
|
-
}), P = /* @__PURE__ */ E(O, [["__scopeId", "data-v-95f33abf"]]);
|
|
103
|
-
export {
|
|
104
|
-
P as default
|
|
105
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, defineAsyncComponent as m, useAttrs as $, computed as o, openBlock as t, createBlock as a, resolveDynamicComponent as r, normalizeClass as l, withCtx as S, renderSlot as i, unref as u, createCommentVNode as d, createElementBlock as M, createVNode as w } from "vue";
|
|
2
|
-
import { _ as E } from "./MazChecklist-DxtYuoEu.mjs";
|
|
3
|
-
import '../assets/MazBtn.css';const F = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "m-btn-loader-container"
|
|
6
|
-
}, O = /* @__PURE__ */ h({
|
|
7
|
-
__name: "MazBtn",
|
|
8
|
-
props: {
|
|
9
|
-
variant: { default: "button" },
|
|
10
|
-
size: { default: "md" },
|
|
11
|
-
color: { default: "primary" },
|
|
12
|
-
type: { default: "button" },
|
|
13
|
-
rounded: { type: Boolean },
|
|
14
|
-
roundedSize: { default: "lg" },
|
|
15
|
-
noRounded: { type: Boolean },
|
|
16
|
-
outline: { type: Boolean },
|
|
17
|
-
pastel: { type: Boolean },
|
|
18
|
-
block: { type: Boolean },
|
|
19
|
-
noUnderline: { type: Boolean },
|
|
20
|
-
loading: { type: Boolean },
|
|
21
|
-
disabled: { type: Boolean },
|
|
22
|
-
fab: { type: Boolean },
|
|
23
|
-
icon: { type: [String, Function, Object], default: void 0 },
|
|
24
|
-
leftIcon: { type: [String, Function, Object], default: void 0 },
|
|
25
|
-
rightIcon: { type: [String, Function, Object], default: void 0 },
|
|
26
|
-
noPadding: { type: Boolean },
|
|
27
|
-
noElevation: { type: Boolean },
|
|
28
|
-
justify: { default: "center" }
|
|
29
|
-
},
|
|
30
|
-
setup(p) {
|
|
31
|
-
const n = p, v = m(() => import("./MazSpinner-CR8HZnWn.mjs")), f = m(() => import("./MazIcon-BbvBov5G.mjs")), { href: z, to: b } = $(), c = o(() => z ? "a" : b ? "router-link" : "button"), g = o(
|
|
32
|
-
() => n.pastel ? `--${n.color}-pastel` : n.outline ? `--${n.color}-outline` : `--${n.color}`
|
|
33
|
-
), y = o(
|
|
34
|
-
() => (n.loading || n.disabled) && c.value === "button"
|
|
35
|
-
), j = o(() => y.value ? "--cursor-default" : "--cursor-pointer"), B = o(() => `--is-${n.variant}`), k = o(() => n.loading && n.variant === "button"), C = o(() => c.value === "button" ? n.type : void 0), s = o(() => n.size === "xl" ? "maz-text-3xl" : n.size === "lg" ? "maz-text-2xl" : n.size === "md" ? "maz-text-xl" : n.size === "sm" ? "maz-text-lg" : n.size === "xs" ? "maz-text-base" : n.size === "mini" ? "maz-text-sm" : "md"), I = o(() => n.justify === "start" ? "maz-justify-start" : n.justify === "end" ? "maz-justify-end" : n.justify === "center" ? "maz-justify-center" : n.justify === "between" ? "maz-justify-between" : n.justify === "around" ? "maz-justify-around" : n.justify === "evenly" ? "maz-justify-evenly" : "maz-justify-center");
|
|
36
|
-
return (e, A) => (t(), a(r(c.value), {
|
|
37
|
-
disabled: y.value || void 0,
|
|
38
|
-
class: l(["m-btn", [
|
|
39
|
-
`--${e.size}`,
|
|
40
|
-
!e.fab && !e.rounded && e.roundedSize && `--rounded-${e.roundedSize}`,
|
|
41
|
-
g.value,
|
|
42
|
-
j.value,
|
|
43
|
-
B.value,
|
|
44
|
-
I.value,
|
|
45
|
-
{
|
|
46
|
-
"--block": e.block,
|
|
47
|
-
"--no-underline": e.noUnderline,
|
|
48
|
-
"--fab": e.fab,
|
|
49
|
-
"--loading": e.loading,
|
|
50
|
-
"--disabled": y.value,
|
|
51
|
-
"--rounded": e.rounded,
|
|
52
|
-
"--no-rounded": e.noRounded,
|
|
53
|
-
"--no-padding": e.noPadding,
|
|
54
|
-
"--no-elevation": e.noElevation
|
|
55
|
-
}
|
|
56
|
-
]]),
|
|
57
|
-
type: C.value
|
|
58
|
-
}, {
|
|
59
|
-
default: S(() => [
|
|
60
|
-
i(e.$slots, "left-icon", {}, () => [
|
|
61
|
-
typeof e.leftIcon == "string" ? (t(), a(u(f), {
|
|
62
|
-
key: 0,
|
|
63
|
-
name: e.leftIcon,
|
|
64
|
-
class: l([s.value])
|
|
65
|
-
}, null, 8, ["name", "class"])) : e.leftIcon ? (t(), a(r(e.leftIcon), {
|
|
66
|
-
key: 1,
|
|
67
|
-
class: l([s.value])
|
|
68
|
-
}, null, 8, ["class"])) : d("v-if", !0)
|
|
69
|
-
], !0),
|
|
70
|
-
i(e.$slots, "icon", {}, () => [
|
|
71
|
-
typeof e.icon == "string" ? (t(), a(u(f), {
|
|
72
|
-
key: 0,
|
|
73
|
-
name: e.icon,
|
|
74
|
-
class: l([s.value])
|
|
75
|
-
}, null, 8, ["name", "class"])) : e.icon ? (t(), a(r(e.icon), {
|
|
76
|
-
key: 1,
|
|
77
|
-
class: l([s.value])
|
|
78
|
-
}, null, 8, ["class"])) : d("v-if", !0)
|
|
79
|
-
], !0),
|
|
80
|
-
i(e.$slots, "default", {}, void 0, !0),
|
|
81
|
-
i(e.$slots, "right-icon", {}, () => [
|
|
82
|
-
typeof e.rightIcon == "string" ? (t(), a(u(f), {
|
|
83
|
-
key: 0,
|
|
84
|
-
name: e.rightIcon,
|
|
85
|
-
class: l([s.value])
|
|
86
|
-
}, null, 8, ["name", "class"])) : e.rightIcon ? (t(), a(r(e.rightIcon), {
|
|
87
|
-
key: 1,
|
|
88
|
-
class: l([s.value])
|
|
89
|
-
}, null, 8, ["class"])) : d("v-if", !0)
|
|
90
|
-
], !0),
|
|
91
|
-
k.value ? (t(), M("div", F, [
|
|
92
|
-
w(u(v), {
|
|
93
|
-
size: "2em",
|
|
94
|
-
color: e.color
|
|
95
|
-
}, null, 8, ["color"])
|
|
96
|
-
])) : d("v-if", !0)
|
|
97
|
-
]),
|
|
98
|
-
_: 3
|
|
99
|
-
/* FORWARDED */
|
|
100
|
-
}, 8, ["disabled", "class", "type"]));
|
|
101
|
-
}
|
|
102
|
-
}), P = /* @__PURE__ */ E(O, [["__scopeId", "data-v-95f33abf"]]);
|
|
103
|
-
export {
|
|
104
|
-
P as default
|
|
105
|
-
};
|