maz-ui 3.5.0 → 3.6.1
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/MazAvatar.d.ts +156 -149
- package/components/MazAvatar.mjs +656 -0
- package/components/MazAvatar.umd.js +2 -0
- package/components/MazBackdrop.d.ts +89 -89
- package/components/MazBackdrop.mjs +140 -0
- package/components/MazBackdrop.umd.js +2 -0
- package/components/MazBadge.d.ts +73 -68
- package/components/MazBadge.mjs +61 -0
- package/components/MazBadge.umd.js +2 -0
- package/components/MazBottomSheet.d.ts +36 -29
- package/components/MazBottomSheet.mjs +553 -0
- package/components/MazBottomSheet.umd.js +2 -0
- package/components/MazBtn.d.ts +178 -171
- package/components/MazBtn.mjs +371 -0
- package/components/MazBtn.umd.js +2 -0
- package/components/MazCard.d.ts +194 -183
- package/components/MazCard.mjs +1390 -0
- package/components/MazCard.umd.js +2 -0
- package/components/MazCarousel.d.ts +24 -16
- package/components/MazCarousel.mjs +469 -0
- package/components/MazCarousel.umd.js +2 -0
- package/components/MazChart/includes.d.ts +11 -11
- package/components/MazChart.d.ts +114 -114
- package/components/MazChart.mjs +135 -0
- package/components/MazChart.umd.js +2 -0
- package/components/MazCheckbox.d.ts +54 -49
- package/components/MazCheckbox.mjs +86 -0
- package/components/MazCheckbox.umd.js +2 -0
- package/components/MazDialog.d.ts +40 -29
- package/components/MazDialog.mjs +566 -0
- package/components/MazDialog.umd.js +2 -0
- package/components/MazDialogPromise/use-maz-dialog-promise.d.ts +30 -30
- package/components/MazDialogPromise.d.ts +36 -28
- package/components/MazDialogPromise.mjs +692 -0
- package/components/MazDialogPromise.umd.js +2 -0
- package/components/MazDrawer.d.ts +69 -59
- package/components/MazDrawer.mjs +572 -0
- package/components/MazDrawer.umd.js +2 -0
- package/components/MazDropzone.d.ts +128 -128
- package/components/MazDropzone.mjs +369 -0
- package/components/MazDropzone.umd.js +2 -0
- package/components/MazGallery.d.ts +144 -144
- package/components/MazGallery.mjs +948 -0
- package/components/MazGallery.umd.js +2 -0
- package/components/MazIcon.d.ts +64 -66
- package/components/MazIcon.mjs +161 -0
- package/components/MazIcon.umd.js +2 -0
- package/components/MazInput.d.ts +276 -276
- package/components/MazInput.mjs +750 -0
- package/components/MazInput.umd.js +2 -0
- package/components/MazInputNumber.d.ts +65 -67
- package/components/MazInputNumber.mjs +857 -0
- package/components/MazInputNumber.umd.js +2 -0
- package/components/MazInputPrice.d.ts +69 -64
- package/components/MazInputPrice.mjs +889 -0
- package/components/MazInputPrice.umd.js +2 -0
- package/components/MazInputTags.d.ts +94 -96
- package/components/MazInputTags.mjs +904 -0
- package/components/MazInputTags.umd.js +2 -0
- package/components/MazLazyImg.d.ts +85 -80
- package/components/MazLazyImg.mjs +376 -0
- package/components/MazLazyImg.umd.js +2 -0
- package/components/MazPhoneNumberInput/constantes/locales.d.ts +12 -12
- package/components/MazPhoneNumberInput/types.d.ts +21 -21
- package/components/MazPhoneNumberInput/utils/countries-name-list-by-iso-code.d.ts +2 -2
- package/components/MazPhoneNumberInput/utils/index.d.ts +12 -12
- package/components/MazPhoneNumberInput.d.ts +253 -255
- package/components/MazPhoneNumberInput.mjs +1904 -0
- package/components/MazPhoneNumberInput.umd.js +2 -0
- package/components/MazPicker/MazPickerCalendar.vue.d.ts +135 -137
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarDays.vue.d.ts +20 -22
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +112 -114
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +122 -124
- package/components/MazPicker/MazPickerCalendarSwitcher.vue.d.ts +36 -38
- package/components/MazPicker/MazPickerContainer.vue.d.ts +210 -212
- package/components/MazPicker/MazPickerFooter.vue.d.ts +16 -0
- package/components/MazPicker/MazPickerHeader.vue.d.ts +82 -84
- package/components/MazPicker/MazPickerMonthSwitcher.vue.d.ts +41 -43
- package/components/MazPicker/MazPickerShortcuts.vue.d.ts +60 -62
- package/components/MazPicker/MazPickerTime.vue.d.ts +127 -129
- package/components/MazPicker/MazPickerYearSwitcher.vue.d.ts +33 -35
- package/components/MazPicker/types.d.ts +15 -15
- package/components/MazPicker/utils.d.ts +54 -54
- package/components/MazPicker.d.ts +311 -313
- package/components/MazPicker.mjs +2942 -0
- package/components/MazPicker.umd.js +2 -0
- package/components/MazRadioButtons.d.ts +77 -69
- package/components/MazRadioButtons.mjs +80 -0
- package/components/MazRadioButtons.umd.js +2 -0
- package/components/MazSelect.d.ts +185 -176
- package/components/MazSelect.mjs +1082 -0
- package/components/MazSelect.umd.js +2 -0
- package/components/MazSlider/utils.d.ts +15 -15
- package/components/MazSlider.d.ts +94 -96
- package/components/MazSlider.mjs +377 -0
- package/components/MazSlider.umd.js +2 -0
- package/components/MazSpinner.d.ts +28 -30
- package/components/MazSpinner.mjs +59 -0
- package/components/MazSpinner.umd.js +2 -0
- package/components/MazStepper.d.ts +71 -73
- package/components/MazStepper.mjs +227 -0
- package/components/MazStepper.umd.js +2 -0
- package/components/MazSwitch.d.ts +54 -56
- package/components/MazSwitch.mjs +61 -0
- package/components/MazSwitch.umd.js +2 -0
- package/components/MazTabsBar.d.ts +47 -49
- package/components/MazTabsBar.mjs +470 -0
- package/components/MazTabsBar.umd.js +2 -0
- package/components/MazTabsContent.d.ts +21 -16
- package/components/MazTabsContent.mjs +89 -0
- package/components/MazTabsContent.umd.js +2 -0
- package/components/MazTabsContentItem.d.ts +19 -14
- package/components/MazTabsContentItem.mjs +61 -0
- package/components/MazTabsContentItem.umd.js +2 -0
- package/components/MazTextarea/textarea-autogrow.d.ts +9 -9
- package/components/MazTextarea.d.ts +123 -125
- package/components/MazTextarea.mjs +260 -0
- package/components/MazTextarea.umd.js +2 -0
- package/components/MazTransitionExpand.d.ts +9 -4
- package/components/MazTransitionExpand.mjs +62 -0
- package/components/MazTransitionExpand.umd.js +2 -0
- package/components/index.d.ts +33 -33
- package/components/index.mjs +35 -0
- package/components/index.umd.js +35 -0
- package/components/no_photo-410a8f01.mjs +4 -0
- package/components/types.d.ts +17 -17
- package/css/main.css +1 -1
- package/maz-ui.d.ts +234 -232
- package/modules/maz-ui.mjs +1892 -0
- package/modules/maz-ui.umd.js +2 -0
- package/modules/no_photo-410a8f01.mjs +4 -0
- package/package.json +43 -52
- package/tailwindcss/tailwind.config.js +6 -7
- package/tailwindcss/utils/colors.js +1 -3
- package/tailwindcss/variables/breakpoints.js +1 -2
- package/tailwindcss/variables/utilities.js +1 -2
- package/tailwindcss/variables/z-indexes.js +1 -1
- package/components/MazAvatar.js +0 -3
- package/components/MazBackdrop.js +0 -3
- package/components/MazBadge.js +0 -1
- package/components/MazBottomSheet.js +0 -3
- package/components/MazBtn.js +0 -3
- package/components/MazCard.js +0 -3
- package/components/MazCarousel.js +0 -3
- package/components/MazChart.js +0 -1
- package/components/MazCheckbox.js +0 -1
- package/components/MazDialog.js +0 -3
- package/components/MazDialogPromise.js +0 -3
- package/components/MazDrawer.js +0 -3
- package/components/MazDropzone.js +0 -3
- package/components/MazGallery.js +0 -3
- package/components/MazIcon.js +0 -3
- package/components/MazInput.js +0 -3
- package/components/MazInputNumber.js +0 -3
- package/components/MazInputPrice.js +0 -3
- package/components/MazInputTags.js +0 -3
- package/components/MazLazyImg.js +0 -3
- package/components/MazPhoneNumberInput.js +0 -3
- package/components/MazPicker.js +0 -3
- package/components/MazRadioButtons.js +0 -1
- package/components/MazSelect.js +0 -3
- package/components/MazSlider.js +0 -3
- package/components/MazSpinner.js +0 -1
- package/components/MazStepper.js +0 -1
- package/components/MazSwitch.js +0 -1
- package/components/MazTabsBar.js +0 -3
- package/components/MazTabsContent.js +0 -1
- package/components/MazTabsContentItem.js +0 -3
- package/components/MazTextarea.js +0 -1
- package/components/MazTransitionExpand.js +0 -1
- package/components/index.js +0 -35
- package/components/no_photo-a72545e4.js +0 -1
- package/modules/index.js +0 -3
- package/modules/no_photo-a72545e4.js +0 -1
|
@@ -0,0 +1,1390 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode(".m-gallery[data-v-680a27a0]{position:relative;overflow:hidden}.m-gallery__hidden[data-v-680a27a0]{display:none}.m-gallery__item[data-v-680a27a0]{position:absolute;top:0px;margin:0;height:50%;width:100%;overflow:hidden;border-left-width:2px;border-color:transparent;padding:0}.m-gallery__item--1[data-v-680a27a0]{left:0;height:100%}.m-gallery__item--1[data-v-680a27a0]:not(:last-child){width:50%}.m-gallery__item--2[data-v-680a27a0]{left:50%;width:50%;height:50%}.m-gallery__item--2[data-v-680a27a0]:last-child{height:100%}.m-gallery__item--2[data-v-680a27a0]:nth-last-child(4){width:25%}.m-gallery__item--3[data-v-680a27a0]{top:50%;left:50%;width:25%}.m-gallery__item--3[data-v-680a27a0]:last-child{width:50%}.m-gallery__item--3[data-v-680a27a0]:nth-last-child(3){top:0;left:75%}.m-gallery__item--4[data-v-680a27a0]{border-top-width:2px;border-color:transparent;top:50%;left:50%;width:25%}.m-gallery__item--4[data-v-680a27a0]:last-child{left:75%;width:25%}.m-gallery__item--5[data-v-680a27a0]{border-top-width:2px;border-color:transparent;top:50%;left:75%;width:25%}.m-gallery__item[data-v-680a27a0]:first-child{border-left:0}.m-gallery__item--3[data-v-680a27a0]:last-child,.m-gallery__item--3[data-v-680a27a0]:nth-last-child(2),.m-gallery__item--4[data-v-680a27a0]:last-child,.m-gallery__item--5[data-v-680a27a0]{border-top-width:2px;border-color:transparent}.m-gallery__item__image[data-v-680a27a0]{height:100%;max-width:100%;width:100%;background-position:center center;background-size:cover;background-repeat:no-repeat;background-color:#0000007f}.m-gallery__remaining-layer[data-v-680a27a0]{position:absolute;top:0;bottom:0;right:0;left:0}.m-gallery__remaining-layer a span[data-v-680a27a0]{color:#fff;font-size:2rem}@-webkit-keyframes maz-spin-503fe527{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes maz-spin-503fe527{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.m-spinner[data-v-503fe527]{-webkit-animation:maz-spin-503fe527 1s linear infinite;animation:maz-spin-503fe527 1s linear infinite;fill:currentColor;color:var(--maz-color-white);margin:0!important}.m-spinner--primary[data-v-503fe527]{color:var(--maz-color-primary)}.m-spinner--secondary[data-v-503fe527]{color:var(--maz-color-secondary)}.m-spinner--info[data-v-503fe527]{color:var(--maz-color-info)}.m-spinner--warning[data-v-503fe527]{color:var(--maz-color-warning)}.m-spinner--danger[data-v-503fe527]{color:var(--maz-color-danger)}.m-spinner--success[data-v-503fe527]{color:var(--maz-color-success)}.m-spinner--black[data-v-503fe527]{color:var(--maz-color-black)}.m-spinner--white[data-v-503fe527],.m-spinner--transparent[data-v-503fe527]{color:var(--maz-color-white)}.m-btn[data-v-7673d151]{border-width:var(--maz-border-width);border-style:solid;border-color:transparent;text-align:center;font-size:1rem;line-height:1.5rem;color:var(--maz-color-text)}.m-btn span[data-v-7673d151]{line-height:1}.m-btn__icon-left[data-v-7673d151]{margin-right:.5rem;margin-left:-.25rem;line-height:1}.m-btn__icon-right[data-v-7673d151]{margin-left:.5rem;margin-right:-.25rem;line-height:1}.m-btn.--cursor-pointer[data-v-7673d151]{cursor:pointer}.m-btn.--cursor-default[data-v-7673d151]{cursor:default}.m-btn.--is-link[data-v-7673d151]{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1)}.m-btn.--is-link[data-v-7673d151]:not(.--no-leading){line-height:2.25rem}.m-btn.--is-link[data-v-7673d151]:not(:disabled):hover:not(.--no-underline),.m-btn.--is-link[data-v-7673d151]:not(:disabled):focus:not(.--no-underline){text-decoration-line:underline}.m-btn.--is-link.--secondary[data-v-7673d151]{color:var(--maz-color-secondary)}.m-btn.--is-link.--info[data-v-7673d151]{color:var(--maz-color-info)}.m-btn.--is-link.--warning[data-v-7673d151]{color:var(--maz-color-warning-600)}.m-btn.--is-link.--danger[data-v-7673d151]{color:var(--maz-color-danger-600)}.m-btn.--is-link.--success[data-v-7673d151]{color:var(--maz-color-success-600)}.m-btn.--is-link.--white[data-v-7673d151]{color:var(--maz-color-white)}.m-btn.--is-link.--black[data-v-7673d151]{color:var(--maz-color-black)}.m-btn.--is-button[data-v-7673d151]{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;overflow:hidden;border-radius:var(--maz-border-radius);border-color:transparent;background-color:transparent;font-weight:500;text-decoration-line:none;-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1)}.m-btn.--is-button.--rounded[data-v-7673d151]{border-radius:9999px}.m-btn.--is-button.--xl[data-v-7673d151]{padding:1.325rem 2rem;font-size:1.25rem;line-height:1.75rem}.m-btn.--is-button.--lg[data-v-7673d151]{padding:1rem 1.5rem;font-size:1.125rem;line-height:1.75rem}.m-btn.--is-button.--md[data-v-7673d151]{padding:.88rem 1rem;font-size:1rem;line-height:1.5rem}.m-btn.--is-button.--sm[data-v-7673d151]{padding:.625rem .75rem;font-size:.875rem;line-height:1.25rem}.m-btn.--is-button.--xs[data-v-7673d151]{padding:.3rem .5rem;font-size:.875rem;line-height:1.25rem}.m-btn.--is-button.--mini[data-v-7673d151]{padding:.2rem .25rem;font-size:.75rem;line-height:1rem}.m-btn.--is-button.--icon[data-v-7673d151]{padding-top:.5rem;padding-bottom:.5rem}.m-btn.--is-button[data-v-7673d151]{-webkit-transition:background .3s ease-in-out 0ms,color .3s ease-in-out 0ms;transition:background .3s ease-in-out 0ms,color .3s ease-in-out 0ms}.m-btn.--is-button[data-v-7673d151]:not(.--disabled):hover,.m-btn.--is-button[data-v-7673d151]:not(.--disabled):focus{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.m-btn.--is-button.--fab[data-v-7673d151]{display:-webkit-box;display:-ms-flexbox;display:flex;height:3rem;width:3rem;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding:0}.m-btn.--is-button.--fab[data-v-7673d151]:not(.--no-elevation){-webkit-box-shadow:0 5px 10px 0 hsla(0,0%,0%,.05);box-shadow:0 5px 10px #0000000d}.m-btn.--is-button.--block[data-v-7673d151]{width:100%}.m-btn.--is-button.--primary[data-v-7673d151]{background-color:var(--maz-color-primary);color:var(--maz-color-primary-contrast)}.m-btn.--is-button.--primary[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--primary[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-primary-600)}.m-btn.--is-button.--secondary[data-v-7673d151]{background-color:var(--maz-color-secondary);color:var(--maz-color-secondary-contrast)}.m-btn.--is-button.--secondary[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--secondary[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-secondary-600)}.m-btn.--is-button.--info[data-v-7673d151]{background-color:var(--maz-color-info);color:var(--maz-color-info-contrast)}.m-btn.--is-button.--info[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--info[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-info-600)}.m-btn.--is-button.--success[data-v-7673d151]{background-color:var(--maz-color-success);color:var(--maz-color-success-contrast)}.m-btn.--is-button.--success[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--success[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-success-600)}.m-btn.--is-button.--warning[data-v-7673d151]{background-color:var(--maz-color-warning);color:var(--maz-color-warning-contrast)}.m-btn.--is-button.--warning[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--warning[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-warning-600)}.m-btn.--is-button.--danger[data-v-7673d151]{background-color:var(--maz-color-danger);color:var(--maz-color-white)}.m-btn.--is-button.--danger[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--danger[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-danger-600)}.m-btn.--is-button.--white[data-v-7673d151]{background-color:var(--maz-color-white);color:var(--maz-color-white-contrast)}.m-btn.--is-button.--white[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--white[data-v-7673d151]:not(:disabled):focus{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.m-btn.--is-button.--black[data-v-7673d151]{background-color:var(--maz-color-black);color:var(--maz-color-black-contrast)}.m-btn.--is-button.--black[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--black[data-v-7673d151]:not(:disabled):focus{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.m-btn.--is-button.--transparent[data-v-7673d151]{background-color:transparent}.m-btn.--is-button.--transparent[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--transparent[data-v-7673d151]:not(:disabled):focus{background-color:#0000001f}.m-btn.--is-button.--primary-outline[data-v-7673d151]{border-color:var(--maz-color-primary);color:var(--maz-color-primary)}.m-btn.--is-button.--primary-outline[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--primary-outline[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-primary);color:var(--maz-color-primary-contrast)}.m-btn.--is-button.--secondary-outline[data-v-7673d151]{border-color:var(--maz-color-secondary);color:var(--maz-color-secondary)}.m-btn.--is-button.--secondary-outline[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--secondary-outline[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-secondary);color:var(--maz-color-white)}.m-btn.--is-button.--info-outline[data-v-7673d151]{border-color:var(--maz-color-info);color:var(--maz-color-info)}.m-btn.--is-button.--info-outline[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--info-outline[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-info);color:var(--maz-color-white)}.m-btn.--is-button.--success-outline[data-v-7673d151]{border-color:var(--maz-color-success);color:var(--maz-color-success)}.m-btn.--is-button.--success-outline[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--success-outline[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-success);color:var(--maz-color-white)}.m-btn.--is-button.--danger-outline[data-v-7673d151]{border-color:var(--maz-color-danger);color:var(--maz-color-danger)}.m-btn.--is-button.--danger-outline[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--danger-outline[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-danger);color:var(--maz-color-white)}.m-btn.--is-button.--warning-outline[data-v-7673d151]{border-color:var(--maz-color-warning);color:var(--maz-color-warning)}.m-btn.--is-button.--warning-outline[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--warning-outline[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-warning);color:var(--maz-color-white)}.m-btn.--is-button.--white-outline[data-v-7673d151]{border-color:var(--maz-color-white);color:var(--maz-color-white)}.m-btn.--is-button.--white-outline[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--white-outline[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-white);color:var(--maz-color-white)}.m-btn.--is-button.--black-outline[data-v-7673d151]{border-color:var(--maz-color-black);color:var(--maz-color-black)}.m-btn.--is-button.--black-outline[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--black-outline[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-black);color:var(--maz-color-black)}.m-btn.--is-button.--primary-pastel[data-v-7673d151]{background-color:var(--maz-color-primary-50);color:var(--maz-color-primary)}.m-btn.--is-button.--primary-pastel[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--primary-pastel[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-primary);color:var(--maz-color-primary-contrast)}.m-btn.--is-button.--secondary-pastel[data-v-7673d151]{background-color:var(--maz-color-secondary-50);color:var(--maz-color-secondary)}.m-btn.--is-button.--secondary-pastel[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--secondary-pastel[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-secondary);color:var(--maz-color-secondary-contrast)}.m-btn.--is-button.--info-pastel[data-v-7673d151]{background-color:var(--maz-color-info-50);color:var(--maz-color-info)}.m-btn.--is-button.--info-pastel[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--info-pastel[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-info);color:var(--maz-color-info-contrast)}.m-btn.--is-button.--success-pastel[data-v-7673d151]{background-color:var(--maz-color-success-50);color:var(--maz-color-success)}.m-btn.--is-button.--success-pastel[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--success-pastel[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-success);color:var(--maz-color-success-contrast)}.m-btn.--is-button.--danger-pastel[data-v-7673d151]{background-color:var(--maz-color-danger-50);color:var(--maz-color-danger)}.m-btn.--is-button.--danger-pastel[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--danger-pastel[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-danger);color:var(--maz-color-danger-contrast)}.m-btn.--is-button.--warning-pastel[data-v-7673d151]{background-color:var(--maz-color-warning-50);color:var(--maz-color-warning)}.m-btn.--is-button.--warning-pastel[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--warning-pastel[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-warning);color:var(--maz-color-warning-contrast)}.m-btn.--is-button.--white-pastel[data-v-7673d151]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity));color:var(--maz-color-white)}.m-btn.--is-button.--white-pastel[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--white-pastel[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-white);color:var(--maz-color-white-contrast)}.m-btn.--is-button.--black-pastel[data-v-7673d151]{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity));color:var(--maz-color-black)}.m-btn.--is-button.--black-pastel[data-v-7673d151]:not(:disabled):hover,.m-btn.--is-button.--black-pastel[data-v-7673d151]:not(:disabled):focus{background-color:var(--maz-color-black);color:var(--maz-color-black-contrast)}.m-btn.--is-button.--disabled[data-v-7673d151]{cursor:not-allowed;background-color:var(--maz-color-bg-lighter);--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.m-btn.--is-button.--no-padding[data-v-7673d151]{padding:0}.m-btn.--is-button .m-btn__loading-wrapper[data-v-7673d151]{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.m-btn.--is-button .m-btn__loading-wrapper.--primary[data-v-7673d151]{background-color:var(--maz-color-primary)}.m-btn.--is-button .m-btn__loading-wrapper.--secondary[data-v-7673d151]{background-color:var(--maz-color-secondary)}.m-btn.--is-button .m-btn__loading-wrapper.--info[data-v-7673d151]{background-color:var(--maz-color-info)}.m-btn.--is-button .m-btn__loading-wrapper.--warning[data-v-7673d151]{background-color:var(--maz-color-warning)}.m-btn.--is-button .m-btn__loading-wrapper.--success[data-v-7673d151]{background-color:var(--maz-color-success)}.m-btn.--is-button .m-btn__loading-wrapper.--danger[data-v-7673d151]{background-color:var(--maz-color-danger)}.m-btn.--is-button .m-btn__loading-wrapper.--white[data-v-7673d151]{background-color:var(--maz-color-white)}.m-btn.--is-button .m-btn__loading-wrapper.--black[data-v-7673d151]{background-color:var(--maz-color-black)}.m-transition-expand[data-v-b5d3ee9f],.m-transition-expand *[data-v-b5d3ee9f]{will-change:height;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.m-card[data-v-34ee12c8]{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;max-height:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background-color:var(--maz-color-bg)}.m-card__header[data-v-34ee12c8]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:.75rem 1rem;-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;transition-duration:.15s;-webkit-transition-delay:.2s;transition-delay:.2s}.m-card__header.--is-collapsable[data-v-34ee12c8]:hover{background-color:var(--maz-color-bg-lighter)}.m-card__collapse-icon[data-v-34ee12c8]{--tw-rotate: 0deg;-webkit-transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.2s;transition-duration:.2s}.m-card__collapse-icon.--is-open[data-v-34ee12c8]{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.m-card__wrapper[data-v-34ee12c8]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 1 0%;flex:1 1 0%}.m-card__wrapper--row[data-v-34ee12c8]{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.m-card__wrapper--row-reverse[data-v-34ee12c8]{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.m-card__wrapper--column[data-v-34ee12c8]{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.m-card__wrapper--column-reverse[data-v-34ee12c8]{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.m-card--linked[data-v-34ee12c8]{-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:scale(1);transform:scale(1)}.m-card--linked[data-v-34ee12c8]:hover:not(.m-card--no-scale){z-index:1;-webkit-transform:scale(1.02);transform:scale(1.02)}.m-card--linked .m-card__wrapper[data-v-34ee12c8]{cursor:pointer;text-decoration-line:none}.m-card--linked .m-card__wrapper[data-v-34ee12c8]:hover{text-decoration-line:none}.m-card__content__wrapper[data-v-34ee12c8]{position:relative;max-width:100%}.m-card__title[data-v-34ee12c8],.m-card__title>*[data-v-34ee12c8]{font-size:1.2em;color:var(--maz-color-text)}.m-card__subtitle[data-v-34ee12c8],.m-card__subtitle>*[data-v-34ee12c8]{font-size:1.1em;color:var(--maz-color-muted)}.m-card__gallery__wrapper[data-v-34ee12c8]{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden}.m-card__actions[data-v-34ee12c8]{position:absolute;top:0px;left:0px;z-index:2}.m-card__actions>*[data-v-34ee12c8]:not(:last-child){margin-right:.5rem}html.dark .m-card[data-v-34ee12c8]{background-color:var(--maz-color-bg-light)}")),document.head.appendChild(o)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => {
|
|
5
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
import { inject, defineComponent, ref, computed, onMounted, watchEffect, openBlock, createElementBlock, mergeProps, createCommentVNode, nextTick, onBeforeMount, resolveComponent, resolveDirective, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, withDirectives, toDisplayString, createVNode, pushScopeId, popScopeId, useAttrs, useSlots, createBlock, resolveDynamicComponent, unref, withCtx, renderSlot, TransitionGroup, watch, withModifiers, vShow } from "vue";
|
|
9
|
+
const style = `
|
|
10
|
+
.maz-zoom-img {
|
|
11
|
+
position: fixed;
|
|
12
|
+
top: 0;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
padding: 2.5rem;
|
|
17
|
+
z-index: 1050;
|
|
18
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.maz-zoom-img,
|
|
26
|
+
.maz-zoom-img * {
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.maz-zoom-img .maz-zoom-img__wrapper {
|
|
31
|
+
position: relative;
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
min-height: 0;
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
max-height: 100%;
|
|
39
|
+
transition: all 300ms ease-in-out;
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: scale(0.5);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
transform: scale(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
left: 0;
|
|
54
|
+
right: 0;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
59
|
+
border-radius: 1rem;
|
|
60
|
+
z-index: 2;
|
|
61
|
+
min-width: 60px;
|
|
62
|
+
min-height: 60px;
|
|
63
|
+
}
|
|
64
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@-webkit-keyframes spin {
|
|
69
|
+
0% { transform: rotate(0deg); }
|
|
70
|
+
100% { transform: rotate(360deg); }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@keyframes spin {
|
|
74
|
+
0% { transform: rotate(0deg); }
|
|
75
|
+
100% { transform: rotate(360deg); }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {
|
|
79
|
+
animation: spin .6s linear infinite;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.maz-zoom-img img {
|
|
83
|
+
max-width: 100%;
|
|
84
|
+
max-height: 100%;
|
|
85
|
+
min-width: 0;
|
|
86
|
+
border-radius: 1rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.maz-zoom-img .maz-zoom-btn {
|
|
90
|
+
margin: 0 auto;
|
|
91
|
+
border: none;
|
|
92
|
+
background-color: hsla(0, 0%, 7%, 0.5);
|
|
93
|
+
box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);
|
|
94
|
+
height: 2.2rem;
|
|
95
|
+
min-height: 2.2rem;
|
|
96
|
+
width: 2.2rem;
|
|
97
|
+
min-width: 2.2rem;
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
border-radius: 2.2rem;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
flex: 0 0 auto;
|
|
104
|
+
outline: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.maz-zoom-img .maz-zoom-btn svg {
|
|
108
|
+
fill: white;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 0.5rem;
|
|
114
|
+
right: 0.5rem;
|
|
115
|
+
z-index: 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {
|
|
119
|
+
position: absolute;
|
|
120
|
+
left: 0.5rem;
|
|
121
|
+
z-index: 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {
|
|
125
|
+
position: absolute;
|
|
126
|
+
right: 0.5rem;
|
|
127
|
+
z-index: 1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.maz-zoom-img .maz-zoom-btn:hover {
|
|
131
|
+
background-color: hsl(0, 0%, 0%);
|
|
132
|
+
}`;
|
|
133
|
+
const svgs = {
|
|
134
|
+
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>',
|
|
135
|
+
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>',
|
|
136
|
+
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>',
|
|
137
|
+
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>'
|
|
138
|
+
};
|
|
139
|
+
class VueZoomImg {
|
|
140
|
+
constructor(binding) {
|
|
141
|
+
__publicField(this, "options");
|
|
142
|
+
__publicField(this, "loader");
|
|
143
|
+
__publicField(this, "wrapper");
|
|
144
|
+
__publicField(this, "img");
|
|
145
|
+
__publicField(this, "keydownHandler");
|
|
146
|
+
__publicField(this, "onImgLoadedCallback");
|
|
147
|
+
__publicField(this, "buttonsAdded");
|
|
148
|
+
__publicField(this, "defaultOptions", {
|
|
149
|
+
scale: true,
|
|
150
|
+
blur: true,
|
|
151
|
+
disabled: false
|
|
152
|
+
});
|
|
153
|
+
__publicField(this, "mouseEnterListener");
|
|
154
|
+
__publicField(this, "mouseLeaveListener");
|
|
155
|
+
__publicField(this, "renderPreviewListener");
|
|
156
|
+
if (!binding.value) {
|
|
157
|
+
throw new Error(
|
|
158
|
+
'[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`'
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
if (typeof binding.value === "object" && !binding.value.src) {
|
|
162
|
+
throw new Error("[maz-ui](zoom-img) src of image must be provided");
|
|
163
|
+
}
|
|
164
|
+
this.buttonsAdded = false;
|
|
165
|
+
this.options = this.buildOptions(binding);
|
|
166
|
+
this.keydownHandler = this.keydownLister.bind(this);
|
|
167
|
+
this.loader = this.getLoader();
|
|
168
|
+
this.wrapper = document.createElement("div");
|
|
169
|
+
this.wrapper.classList.add("maz-zoom-img__wrapper");
|
|
170
|
+
this.wrapper.prepend(this.loader);
|
|
171
|
+
this.img = document.createElement("img");
|
|
172
|
+
this.onImgLoadedCallback = this.onImgLoaded.bind(this);
|
|
173
|
+
this.imgEventHandler(true);
|
|
174
|
+
}
|
|
175
|
+
buildOptions(binding) {
|
|
176
|
+
return {
|
|
177
|
+
...this.defaultOptions,
|
|
178
|
+
...typeof binding.value === "object" ? binding.value : { src: binding.value }
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
get allInstances() {
|
|
182
|
+
return [
|
|
183
|
+
...document.querySelectorAll(".maz-zoom-img-instance")
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
create(el) {
|
|
187
|
+
if (this.options.disabled)
|
|
188
|
+
return;
|
|
189
|
+
el.style.cursor = "pointer";
|
|
190
|
+
setTimeout(() => el.classList.add("maz-zoom-img-instance"));
|
|
191
|
+
el.setAttribute("data-src", this.options.src);
|
|
192
|
+
if (this.options.alt)
|
|
193
|
+
el.setAttribute("data-alt", this.options.alt);
|
|
194
|
+
el.style.transition = "all 300ms ease-in-out";
|
|
195
|
+
this.mouseEnterListener = () => this.mouseEnter(el);
|
|
196
|
+
this.mouseLeaveListener = () => this.mouseLeave(el);
|
|
197
|
+
this.renderPreviewListener = () => this.renderPreview(el, this.options);
|
|
198
|
+
el.addEventListener("mouseenter", this.mouseEnterListener);
|
|
199
|
+
el.addEventListener("mouseleave", this.mouseLeaveListener);
|
|
200
|
+
el.addEventListener("click", this.renderPreviewListener);
|
|
201
|
+
}
|
|
202
|
+
update(binding) {
|
|
203
|
+
this.options = this.buildOptions(binding);
|
|
204
|
+
}
|
|
205
|
+
remove(el) {
|
|
206
|
+
this.imgEventHandler(false);
|
|
207
|
+
el.removeEventListener("mouseenter", this.mouseEnterListener);
|
|
208
|
+
el.removeEventListener("mouseleave", this.mouseLeaveListener);
|
|
209
|
+
el.removeEventListener("click", this.renderPreviewListener);
|
|
210
|
+
el.classList.remove("maz-zoom-img-instance");
|
|
211
|
+
el.removeAttribute("data-src");
|
|
212
|
+
el.removeAttribute("data-alt");
|
|
213
|
+
el.style.cursor = "";
|
|
214
|
+
}
|
|
215
|
+
renderPreview(el, options) {
|
|
216
|
+
el.classList.add("maz-is-open");
|
|
217
|
+
this.addStyle(style);
|
|
218
|
+
const container = document.createElement("div");
|
|
219
|
+
container.classList.add("maz-zoom-img");
|
|
220
|
+
container.setAttribute("id", "MazImgPreviewFullsize");
|
|
221
|
+
container.addEventListener("click", (e) => {
|
|
222
|
+
if (container.isEqualNode(e.target)) {
|
|
223
|
+
this.closePreview();
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
if (typeof options === "object") {
|
|
227
|
+
this.img.setAttribute("src", options.src);
|
|
228
|
+
if (options.alt)
|
|
229
|
+
this.img.setAttribute("alt", options.alt);
|
|
230
|
+
this.img.id = "MazImgElement";
|
|
231
|
+
}
|
|
232
|
+
this.wrapper.append(this.img);
|
|
233
|
+
container.append(this.wrapper);
|
|
234
|
+
document.body.append(container);
|
|
235
|
+
this.keyboardEventHandler(true);
|
|
236
|
+
setTimeout(() => {
|
|
237
|
+
if (container)
|
|
238
|
+
container.classList.add("maz-animate");
|
|
239
|
+
}, 100);
|
|
240
|
+
}
|
|
241
|
+
onImgLoaded() {
|
|
242
|
+
this.wrapper.style.width = `${this.img.width}px`;
|
|
243
|
+
this.wrapper.style.minWidth = `200px`;
|
|
244
|
+
this.loader.hidden = true;
|
|
245
|
+
const closeButton = this.getButton();
|
|
246
|
+
const buttons = [];
|
|
247
|
+
const hasMultipleInstance = this.allInstances.length > 1;
|
|
248
|
+
if (!this.buttonsAdded) {
|
|
249
|
+
this.buttonsAdded = true;
|
|
250
|
+
if (hasMultipleInstance) {
|
|
251
|
+
const previousButton = this.getButton("previous");
|
|
252
|
+
const nextButton = this.getButton("next");
|
|
253
|
+
buttons.push(previousButton, nextButton);
|
|
254
|
+
}
|
|
255
|
+
this.wrapper.append(closeButton);
|
|
256
|
+
if (hasMultipleInstance) {
|
|
257
|
+
this.wrapper.prepend(buttons[0]);
|
|
258
|
+
this.wrapper.append(buttons[1]);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
getLoader() {
|
|
263
|
+
const loader = document.createElement("div");
|
|
264
|
+
loader.classList.add("maz-zoom-img__loader");
|
|
265
|
+
loader.innerHTML = svgs.spinner;
|
|
266
|
+
return loader;
|
|
267
|
+
}
|
|
268
|
+
mouseLeave(el) {
|
|
269
|
+
if (this.options.scale)
|
|
270
|
+
el.style.transform = "";
|
|
271
|
+
if (this.options.blur)
|
|
272
|
+
el.style.filter = "";
|
|
273
|
+
el.style.zIndex = "";
|
|
274
|
+
}
|
|
275
|
+
mouseEnter(el) {
|
|
276
|
+
el.style.zIndex = "1";
|
|
277
|
+
if (this.options.scale)
|
|
278
|
+
el.style.transform = "scale(1.1)";
|
|
279
|
+
if (this.options.blur)
|
|
280
|
+
el.style.filter = "blur(2px)";
|
|
281
|
+
}
|
|
282
|
+
keydownLister(e) {
|
|
283
|
+
e.preventDefault();
|
|
284
|
+
if (e.key === "Escape" || e.key === " ") {
|
|
285
|
+
this.closePreview();
|
|
286
|
+
}
|
|
287
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
288
|
+
this.nextPreviousImage(e.key === "ArrowRight");
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
getButton(iconName = "close") {
|
|
292
|
+
const button = document.createElement("button");
|
|
293
|
+
button.innerHTML = svgs[iconName];
|
|
294
|
+
button.addEventListener("click", () => {
|
|
295
|
+
iconName === "close" ? this.closePreview() : this.allInstances ? this.nextPreviousImage(iconName === "next") : null;
|
|
296
|
+
});
|
|
297
|
+
button.classList.add("maz-zoom-btn");
|
|
298
|
+
button.classList.add(`maz-zoom-btn--${iconName}`);
|
|
299
|
+
return button;
|
|
300
|
+
}
|
|
301
|
+
closePreview() {
|
|
302
|
+
const container = document.querySelector(
|
|
303
|
+
"#MazImgPreviewFullsize"
|
|
304
|
+
);
|
|
305
|
+
const style2 = document.querySelector("#MazPreviewStyle");
|
|
306
|
+
const instance2 = document.querySelector(
|
|
307
|
+
".maz-zoom-img-instance.maz-is-open"
|
|
308
|
+
);
|
|
309
|
+
if (instance2)
|
|
310
|
+
instance2.classList.remove("maz-is-open");
|
|
311
|
+
if (container)
|
|
312
|
+
container.classList.remove("maz-animate");
|
|
313
|
+
this.keyboardEventHandler(false);
|
|
314
|
+
setTimeout(() => {
|
|
315
|
+
if (container)
|
|
316
|
+
container.remove();
|
|
317
|
+
if (style2)
|
|
318
|
+
style2.remove();
|
|
319
|
+
}, 300);
|
|
320
|
+
}
|
|
321
|
+
getNewInstanceIndex(newInstanceIndex) {
|
|
322
|
+
return newInstanceIndex < 0 ? this.allInstances.length - 1 : newInstanceIndex >= this.allInstances.length ? 0 : newInstanceIndex;
|
|
323
|
+
}
|
|
324
|
+
nextPreviousImage(isNext) {
|
|
325
|
+
const selectNextInstance = isNext;
|
|
326
|
+
const currentInstance = document.querySelector(
|
|
327
|
+
".maz-zoom-img-instance.maz-is-open"
|
|
328
|
+
);
|
|
329
|
+
if (currentInstance) {
|
|
330
|
+
const currentInstanceIndex = this.allInstances.indexOf(currentInstance);
|
|
331
|
+
const newInstanceIndex = selectNextInstance ? currentInstanceIndex + 1 : currentInstanceIndex - 1;
|
|
332
|
+
const nextInstance = this.allInstances[this.getNewInstanceIndex(newInstanceIndex)];
|
|
333
|
+
if (nextInstance) {
|
|
334
|
+
this.useNextInstance(currentInstance, nextInstance);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
useNextInstance(currentInstance, nextInstance) {
|
|
339
|
+
currentInstance.classList.remove("maz-is-open");
|
|
340
|
+
nextInstance.classList.add("maz-is-open");
|
|
341
|
+
const src = nextInstance.getAttribute("data-src");
|
|
342
|
+
const alt = nextInstance.getAttribute("data-alt");
|
|
343
|
+
this.wrapper.style.width = "";
|
|
344
|
+
this.loader.hidden = false;
|
|
345
|
+
if (src)
|
|
346
|
+
this.img.setAttribute("src", src);
|
|
347
|
+
if (alt)
|
|
348
|
+
this.img.setAttribute("alt", alt);
|
|
349
|
+
}
|
|
350
|
+
addStyle(styleString) {
|
|
351
|
+
const style2 = document.createElement("style");
|
|
352
|
+
style2.id = "MazPreviewStyle";
|
|
353
|
+
style2.textContent = styleString;
|
|
354
|
+
document.head.append(style2);
|
|
355
|
+
}
|
|
356
|
+
keyboardEventHandler(add) {
|
|
357
|
+
if (add)
|
|
358
|
+
return document.addEventListener("keydown", this.keydownHandler);
|
|
359
|
+
document.removeEventListener("keydown", this.keydownHandler);
|
|
360
|
+
}
|
|
361
|
+
imgEventHandler(add) {
|
|
362
|
+
if (add)
|
|
363
|
+
return this.img.addEventListener("load", this.onImgLoadedCallback);
|
|
364
|
+
this.img.removeEventListener("load", this.onImgLoadedCallback);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
let instance$1;
|
|
368
|
+
const vZoomImg = {
|
|
369
|
+
created(el, binding) {
|
|
370
|
+
instance$1 = new VueZoomImg(binding);
|
|
371
|
+
instance$1.create(el);
|
|
372
|
+
},
|
|
373
|
+
updated(_el, binding) {
|
|
374
|
+
instance$1.update(binding);
|
|
375
|
+
},
|
|
376
|
+
unmounted(el) {
|
|
377
|
+
instance$1.remove(el);
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
const EMPTY_PHOTO = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
381
|
+
const DEFAULT_OPTIONS = {
|
|
382
|
+
baseClass: "m-lazy-img",
|
|
383
|
+
loadedClass: "m-lazy-loaded",
|
|
384
|
+
loadingClass: "m-lazy-loading",
|
|
385
|
+
errorClass: "m-lazy-error",
|
|
386
|
+
noPhotoClass: "m-lazy-no-photo",
|
|
387
|
+
noPhoto: false,
|
|
388
|
+
observerOnce: true,
|
|
389
|
+
loadOnce: false,
|
|
390
|
+
noUseErrorPhoto: false,
|
|
391
|
+
observerOptions: {
|
|
392
|
+
threshold: 0.1
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
class LazyImg {
|
|
396
|
+
constructor(opts = {}) {
|
|
397
|
+
__publicField(this, "observers", []);
|
|
398
|
+
__publicField(this, "defaultOptions", DEFAULT_OPTIONS);
|
|
399
|
+
__publicField(this, "options");
|
|
400
|
+
__publicField(this, "onImgLoadedCallback");
|
|
401
|
+
__publicField(this, "onImgErrorCallback");
|
|
402
|
+
__publicField(this, "hasImgLoaded", false);
|
|
403
|
+
this.options = this.buildOptions(opts);
|
|
404
|
+
this.onImgLoadedCallback = this.imageIsLoaded.bind(this);
|
|
405
|
+
this.onImgErrorCallback = this.imageHasError.bind(this);
|
|
406
|
+
}
|
|
407
|
+
async loadErrorPhoto() {
|
|
408
|
+
const { default: photo } = await import("./no_photo-410a8f01.mjs");
|
|
409
|
+
return photo;
|
|
410
|
+
}
|
|
411
|
+
buildOptions(opts) {
|
|
412
|
+
return {
|
|
413
|
+
...this.defaultOptions,
|
|
414
|
+
...opts,
|
|
415
|
+
observerOptions: {
|
|
416
|
+
...this.defaultOptions.observerOptions,
|
|
417
|
+
...opts.observerOptions
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
removeClass(el, className) {
|
|
422
|
+
el.classList.remove(className);
|
|
423
|
+
}
|
|
424
|
+
addClass(el, className) {
|
|
425
|
+
el.classList.add(className);
|
|
426
|
+
}
|
|
427
|
+
removeAllStateClasses(el) {
|
|
428
|
+
this.removeClass(el, this.options.loadedClass);
|
|
429
|
+
this.removeClass(el, this.options.loadingClass);
|
|
430
|
+
this.removeClass(el, this.options.errorClass);
|
|
431
|
+
this.removeClass(el, this.options.noPhotoClass);
|
|
432
|
+
}
|
|
433
|
+
setBaseClass(el) {
|
|
434
|
+
this.addClass(el, this.options.baseClass);
|
|
435
|
+
}
|
|
436
|
+
imageIsLoading(el) {
|
|
437
|
+
var _a, _b;
|
|
438
|
+
this.addClass(el, this.options.loadingClass);
|
|
439
|
+
(_b = (_a = this.options).onLoading) == null ? void 0 : _b.call(_a, el);
|
|
440
|
+
}
|
|
441
|
+
imageHasNoPhoto(el) {
|
|
442
|
+
this.removeClass(el, this.options.loadingClass);
|
|
443
|
+
this.addClass(el, this.options.noPhotoClass);
|
|
444
|
+
this.setDefaultPhoto(el);
|
|
445
|
+
}
|
|
446
|
+
imageIsLoaded(el) {
|
|
447
|
+
var _a, _b;
|
|
448
|
+
this.hasImgLoaded = true;
|
|
449
|
+
this.removeClass(el, this.options.loadingClass);
|
|
450
|
+
this.addClass(el, this.options.loadedClass);
|
|
451
|
+
(_b = (_a = this.options).onLoaded) == null ? void 0 : _b.call(_a, el);
|
|
452
|
+
}
|
|
453
|
+
imageHasError(el, event) {
|
|
454
|
+
var _a, _b;
|
|
455
|
+
console.warn(`[maz-ui][MazLazyImg] Error while loading image`, event);
|
|
456
|
+
this.removeClass(el, this.options.loadingClass);
|
|
457
|
+
this.addClass(el, this.options.errorClass);
|
|
458
|
+
(_b = (_a = this.options).onError) == null ? void 0 : _b.call(_a, el);
|
|
459
|
+
this.setDefaultPhoto(el);
|
|
460
|
+
}
|
|
461
|
+
getImageUrl(el, binding) {
|
|
462
|
+
const dataSrc = this.getImgElement(el).getAttribute("data-src");
|
|
463
|
+
if (dataSrc)
|
|
464
|
+
return dataSrc;
|
|
465
|
+
const bindingSrc = typeof binding.value === "object" ? binding.value.src : binding.value;
|
|
466
|
+
if (!bindingSrc)
|
|
467
|
+
console.warn(`[maz-ui][MazLazyImg] src url is not defined`);
|
|
468
|
+
return bindingSrc;
|
|
469
|
+
}
|
|
470
|
+
async setPictureSourceUrls(el) {
|
|
471
|
+
const sourceElements = el.querySelectorAll("source");
|
|
472
|
+
if (sourceElements.length > 0) {
|
|
473
|
+
for await (const source of sourceElements) {
|
|
474
|
+
const srcSet = source.getAttribute("data-srcset");
|
|
475
|
+
if (srcSet) {
|
|
476
|
+
source.srcset = srcSet;
|
|
477
|
+
} else {
|
|
478
|
+
console.warn(
|
|
479
|
+
'[maz-ui][MazLazyImg] the "[data-srcset]" attribute is not provided on "<source />"'
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
} else {
|
|
484
|
+
console.warn(
|
|
485
|
+
'[maz-ui][MazLazyImg] No "<source />" elements provided into the "<picture />" element'
|
|
486
|
+
);
|
|
487
|
+
this.imageHasError(el);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
hasBgImgMode(binding) {
|
|
491
|
+
return binding.arg === "bg-image";
|
|
492
|
+
}
|
|
493
|
+
isPictureElement(el) {
|
|
494
|
+
return el instanceof HTMLPictureElement;
|
|
495
|
+
}
|
|
496
|
+
getImgElement(el) {
|
|
497
|
+
const isPictureElement = this.isPictureElement(el);
|
|
498
|
+
return isPictureElement ? el.querySelector("img") : el;
|
|
499
|
+
}
|
|
500
|
+
async setDefaultPhoto(el) {
|
|
501
|
+
if (this.options.noUseErrorPhoto)
|
|
502
|
+
return;
|
|
503
|
+
const errorPhoto = this.options.errorPhoto ?? await this.loadErrorPhoto();
|
|
504
|
+
const sourceElements = el.querySelectorAll("source");
|
|
505
|
+
if (sourceElements.length > 0) {
|
|
506
|
+
for await (const source of sourceElements) {
|
|
507
|
+
source.srcset = errorPhoto;
|
|
508
|
+
}
|
|
509
|
+
} else {
|
|
510
|
+
this.setImgSrc(el, errorPhoto);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
addEventListenerToImg(el) {
|
|
514
|
+
const imgElement = this.getImgElement(el);
|
|
515
|
+
imgElement.addEventListener("load", () => this.onImgLoadedCallback(el), {
|
|
516
|
+
once: true
|
|
517
|
+
});
|
|
518
|
+
imgElement.addEventListener(
|
|
519
|
+
"error",
|
|
520
|
+
(err) => this.onImgErrorCallback(el, err),
|
|
521
|
+
{ once: true }
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
async loadImage(el, binding) {
|
|
525
|
+
this.imageIsLoading(el);
|
|
526
|
+
if (this.isPictureElement(el)) {
|
|
527
|
+
this.addEventListenerToImg(el);
|
|
528
|
+
await this.setPictureSourceUrls(el);
|
|
529
|
+
} else {
|
|
530
|
+
const imageUrl = this.getImageUrl(el, binding);
|
|
531
|
+
if (!imageUrl)
|
|
532
|
+
return this.imageHasError(el);
|
|
533
|
+
if (this.hasBgImgMode(binding)) {
|
|
534
|
+
el.style.backgroundImage = `url('${imageUrl}')`;
|
|
535
|
+
this.imageIsLoaded(el);
|
|
536
|
+
} else {
|
|
537
|
+
this.addEventListenerToImg(el);
|
|
538
|
+
this.setImgSrc(el, imageUrl);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
setImgSrc(el, src) {
|
|
543
|
+
const imgElement = this.getImgElement(el);
|
|
544
|
+
imgElement.src = src;
|
|
545
|
+
}
|
|
546
|
+
handleIntersectionObserver(el, binding, entries, observer) {
|
|
547
|
+
var _a, _b;
|
|
548
|
+
this.observers.push(observer);
|
|
549
|
+
for (const entry of entries) {
|
|
550
|
+
if (entry.isIntersecting) {
|
|
551
|
+
(_b = (_a = this.options).onIntersecting) == null ? void 0 : _b.call(_a, entry.target);
|
|
552
|
+
if (this.options.observerOnce) {
|
|
553
|
+
observer.unobserve(el);
|
|
554
|
+
}
|
|
555
|
+
if (this.options.loadOnce && this.hasImgLoaded)
|
|
556
|
+
return;
|
|
557
|
+
this.loadImage(el, binding);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
createObserver(el, binding) {
|
|
562
|
+
const observerCallback = (entries, intersectionObserver) => {
|
|
563
|
+
this.handleIntersectionObserver(
|
|
564
|
+
el,
|
|
565
|
+
binding,
|
|
566
|
+
entries,
|
|
567
|
+
intersectionObserver
|
|
568
|
+
);
|
|
569
|
+
};
|
|
570
|
+
const observerOptions = this.options.observerOptions;
|
|
571
|
+
const observer = new IntersectionObserver(observerCallback, observerOptions);
|
|
572
|
+
observer.observe(el);
|
|
573
|
+
}
|
|
574
|
+
async imageHandler(el, binding, type) {
|
|
575
|
+
if (type === "update") {
|
|
576
|
+
for await (const observer of this.observers)
|
|
577
|
+
observer.unobserve(el);
|
|
578
|
+
}
|
|
579
|
+
if (window.IntersectionObserver) {
|
|
580
|
+
this.createObserver(el, binding);
|
|
581
|
+
} else {
|
|
582
|
+
this.loadImage(el, binding);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
async bindUpdateHandler(el, binding, type) {
|
|
586
|
+
if (this.options.noPhoto)
|
|
587
|
+
return this.imageHasNoPhoto(el);
|
|
588
|
+
await this.imageHandler(el, binding, type);
|
|
589
|
+
}
|
|
590
|
+
async add(el, binding) {
|
|
591
|
+
if (this.hasBgImgMode(binding) && this.isPictureElement(el)) {
|
|
592
|
+
throw new Error(
|
|
593
|
+
`[MazLazyImg] You can't use the "bg-image" mode with "<picture />" element`
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
setTimeout(() => this.setBaseClass(el), 0);
|
|
597
|
+
if (!el.getAttribute("src"))
|
|
598
|
+
this.setImgSrc(el, EMPTY_PHOTO);
|
|
599
|
+
await this.bindUpdateHandler(el, binding, "bind");
|
|
600
|
+
}
|
|
601
|
+
async update(el, binding) {
|
|
602
|
+
if (binding.value !== binding.oldValue) {
|
|
603
|
+
this.hasImgLoaded = false;
|
|
604
|
+
this.removeAllStateClasses(el);
|
|
605
|
+
await this.bindUpdateHandler(el, binding, "update");
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
remove(el, binding) {
|
|
609
|
+
this.hasImgLoaded = false;
|
|
610
|
+
if (this.hasBgImgMode(binding))
|
|
611
|
+
el.style.backgroundImage = "";
|
|
612
|
+
this.removeAllStateClasses(el);
|
|
613
|
+
for (const observer of this.observers)
|
|
614
|
+
observer.unobserve(el);
|
|
615
|
+
this.observers = [];
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
let instance;
|
|
619
|
+
const vLazyImg = {
|
|
620
|
+
created(el, binding) {
|
|
621
|
+
const options = typeof binding.value === "object" ? binding.value : {};
|
|
622
|
+
instance = new LazyImg(options);
|
|
623
|
+
instance.add(el, binding);
|
|
624
|
+
},
|
|
625
|
+
updated(el, binding) {
|
|
626
|
+
instance.update(el, binding);
|
|
627
|
+
},
|
|
628
|
+
unmounted(el, binding) {
|
|
629
|
+
instance.remove(el, binding);
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
function injectStrict(key, fallback) {
|
|
633
|
+
const resolved = inject(key, fallback);
|
|
634
|
+
if (!resolved) {
|
|
635
|
+
throw new Error(`[maz-ui](injectStrict) Could not resolve ${key}`);
|
|
636
|
+
}
|
|
637
|
+
return resolved;
|
|
638
|
+
}
|
|
639
|
+
const _hoisted_1$4 = ["innerHTML"];
|
|
640
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
641
|
+
__name: "MazIcon",
|
|
642
|
+
props: {
|
|
643
|
+
src: { type: String, default: void 0 },
|
|
644
|
+
path: { type: String, default: void 0 },
|
|
645
|
+
name: { type: String, default: void 0 },
|
|
646
|
+
size: { type: String, default: "1.5rem" },
|
|
647
|
+
title: { type: String, default: void 0 },
|
|
648
|
+
transformSource: {
|
|
649
|
+
type: Function,
|
|
650
|
+
default: (svg) => svg
|
|
651
|
+
}
|
|
652
|
+
},
|
|
653
|
+
emits: ["loaded", "unloaded", "error"],
|
|
654
|
+
setup(__props, { emit: emits }) {
|
|
655
|
+
const props = __props;
|
|
656
|
+
const cache = {};
|
|
657
|
+
const svgElSource = ref();
|
|
658
|
+
const svgElem = ref();
|
|
659
|
+
const getMazIconPath = () => {
|
|
660
|
+
try {
|
|
661
|
+
return injectStrict("mazIconPath");
|
|
662
|
+
} catch {
|
|
663
|
+
return void 0;
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
const iconPath = computed(() => props.path ?? getMazIconPath());
|
|
667
|
+
const fullSrc = computed(() => {
|
|
668
|
+
if (props.src) {
|
|
669
|
+
return props.src;
|
|
670
|
+
} else if (iconPath.value) {
|
|
671
|
+
return `${iconPath.value}/${props.name}.svg`;
|
|
672
|
+
} else {
|
|
673
|
+
return `/${props.name}.svg`;
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
onMounted(() => {
|
|
677
|
+
if (!props.name && !props.src) {
|
|
678
|
+
console.error(
|
|
679
|
+
'[maz-ui](MazIcon) you should provide "name" or "src" as prop'
|
|
680
|
+
);
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
const setTitle = (svg, title) => {
|
|
684
|
+
const titleTags = svg.querySelectorAll("title");
|
|
685
|
+
if (titleTags.length > 0) {
|
|
686
|
+
titleTags[0].textContent = title;
|
|
687
|
+
} else {
|
|
688
|
+
const titleEl = document.createElementNS(
|
|
689
|
+
"http://www.w3.org/2000/svg",
|
|
690
|
+
"title"
|
|
691
|
+
);
|
|
692
|
+
titleEl.textContent = title;
|
|
693
|
+
svg.append(titleEl);
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
const filterAttrs = (attrs) => {
|
|
697
|
+
return Object.keys(attrs).reduce((result, key) => {
|
|
698
|
+
if (attrs[key] !== false && attrs[key] !== null && attrs[key] !== void 0) {
|
|
699
|
+
result[key] = attrs[key];
|
|
700
|
+
}
|
|
701
|
+
return result;
|
|
702
|
+
}, {});
|
|
703
|
+
};
|
|
704
|
+
const getSvgAttrs = (svgEl) => {
|
|
705
|
+
const svgAttrs = {};
|
|
706
|
+
const attrs = svgEl.attributes;
|
|
707
|
+
if (!attrs) {
|
|
708
|
+
return svgAttrs;
|
|
709
|
+
}
|
|
710
|
+
for (let i = attrs.length - 1; i >= 0; i--) {
|
|
711
|
+
svgAttrs[attrs[i].name] = attrs[i].value;
|
|
712
|
+
}
|
|
713
|
+
return svgAttrs;
|
|
714
|
+
};
|
|
715
|
+
const getSvgContent = (svgEl) => {
|
|
716
|
+
let svgElNode = svgEl.cloneNode(true);
|
|
717
|
+
svgElNode = props.transformSource(svgEl);
|
|
718
|
+
if (props.title) {
|
|
719
|
+
setTitle(svgElNode, props.title);
|
|
720
|
+
}
|
|
721
|
+
return svgEl.innerHTML;
|
|
722
|
+
};
|
|
723
|
+
const getSource = async (src) => {
|
|
724
|
+
if (!cache[src]) {
|
|
725
|
+
cache[src] = download(src);
|
|
726
|
+
}
|
|
727
|
+
try {
|
|
728
|
+
svgElSource.value = await cache[src];
|
|
729
|
+
await nextTick();
|
|
730
|
+
emits("loaded", svgElem.value);
|
|
731
|
+
} catch (error) {
|
|
732
|
+
if (svgElSource.value) {
|
|
733
|
+
svgElSource.value = void 0;
|
|
734
|
+
emits("unloaded");
|
|
735
|
+
}
|
|
736
|
+
delete cache[src];
|
|
737
|
+
emits("error", error);
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
const download = (url) => {
|
|
741
|
+
return new Promise((resolve, reject) => {
|
|
742
|
+
const request = new XMLHttpRequest();
|
|
743
|
+
request.open("GET", url, true);
|
|
744
|
+
request.addEventListener("load", () => {
|
|
745
|
+
if (request.status >= 200 && request.status < 400) {
|
|
746
|
+
try {
|
|
747
|
+
const parser = new DOMParser();
|
|
748
|
+
const result = parser.parseFromString(
|
|
749
|
+
request.responseText,
|
|
750
|
+
"text/xml"
|
|
751
|
+
);
|
|
752
|
+
let svgEl = result.querySelectorAll("svg")[0];
|
|
753
|
+
if (svgEl) {
|
|
754
|
+
svgEl = props.transformSource(svgEl);
|
|
755
|
+
resolve(svgEl);
|
|
756
|
+
} else {
|
|
757
|
+
reject(new Error('Loaded file is not valid SVG"'));
|
|
758
|
+
}
|
|
759
|
+
} catch (error) {
|
|
760
|
+
reject(error);
|
|
761
|
+
}
|
|
762
|
+
} else {
|
|
763
|
+
reject(new Error("Error loading SVG"));
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
request.addEventListener("error", () => reject());
|
|
767
|
+
request.send();
|
|
768
|
+
});
|
|
769
|
+
};
|
|
770
|
+
watchEffect(() => getSource(fullSrc.value));
|
|
771
|
+
return (_ctx, _cache) => {
|
|
772
|
+
return svgElSource.value ? (openBlock(), createElementBlock("svg", mergeProps({
|
|
773
|
+
key: 0,
|
|
774
|
+
ref_key: "svgElem",
|
|
775
|
+
ref: svgElem,
|
|
776
|
+
width: "1em",
|
|
777
|
+
height: "1em"
|
|
778
|
+
}, {
|
|
779
|
+
...getSvgAttrs(svgElSource.value),
|
|
780
|
+
...filterAttrs(_ctx.$attrs)
|
|
781
|
+
}, {
|
|
782
|
+
style: `font-size: ${__props.size}`,
|
|
783
|
+
innerHTML: getSvgContent(svgElSource.value)
|
|
784
|
+
}), null, 16, _hoisted_1$4)) : createCommentVNode("", true);
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
const NoPhotographyIcon = "data:image/svg+xml;base64,PHN2ZwogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNCAyNCIKICB2aWV3Qm94PSIwIDAgMjQgMjQiCiAgZmlsbD0iY3VycmVudENvbG9yIgo+CiAgPGc+CiAgICA8cmVjdCBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiB3aWR0aD0iMjQiIC8+CiAgICA8Zz4KICAgICAgPHBhdGgKICAgICAgICBkPSJNOC45LDYuMDdMNy40OCw0LjY2TDksM2g2bDEuODMsMkgyMGMxLjEsMCwyLDAuOSwyLDJ2MTJjMCwwLjA1LTAuMDEsMC4xLTAuMDIsMC4xNkwyMCwxNy4xN1Y3aC00LjA1bC0xLjgzLTJIOS44OCBMOC45LDYuMDd6IE0yMC40OSwyMy4zMUwxOC4xNywyMUg0Yy0xLjEsMC0yLTAuOS0yLTJWN2MwLTAuNTksMC4yNy0xLjEyLDAuNjgtMS40OWwtMi0yTDIuMSwyLjFsMTkuOCwxOS44TDIwLjQ5LDIzLjMxeiBNOS4xOSwxMi4wMkM5LjA4LDEyLjMzLDksMTIuNjUsOSwxM2MwLDEuNjYsMS4zNCwzLDMsM2MwLjM1LDAsMC42Ny0wLjA4LDAuOTgtMC4xOUw5LjE5LDEyLjAyeiBNMTYuMTcsMTlsLTEuNjgtMS42OCBDMTMuNzYsMTcuNzUsMTIuOTEsMTgsMTIsMThjLTIuNzYsMC01LTIuMjQtNS01YzAtMC45MSwwLjI1LTEuNzYsMC42OC0yLjQ5TDQuMTcsN0g0djEySDE2LjE3eiBNMTQuODEsMTEuOThsMi4wNywyLjA3IEMxNi45NiwxMy43MSwxNywxMy4zNiwxNywxM2MwLTIuNzYtMi4yNC01LTUtNWMtMC4zNiwwLTAuNzEsMC4wNC0xLjA2LDAuMTJsMi4wNywyLjA3QzEzLjg1LDEwLjQ5LDE0LjUxLDExLjE1LDE0LjgxLDExLjk4eiIKICAgICAgLz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=";
|
|
789
|
+
const _sfc_main$4 = defineComponent({
|
|
790
|
+
components: { MazIcon: _sfc_main$5 },
|
|
791
|
+
directives: {
|
|
792
|
+
"zoom-img": vZoomImg,
|
|
793
|
+
"lazy-img": vLazyImg
|
|
794
|
+
},
|
|
795
|
+
props: {
|
|
796
|
+
images: {
|
|
797
|
+
type: Array,
|
|
798
|
+
default: () => []
|
|
799
|
+
},
|
|
800
|
+
imagesShownCount: { type: Number, default: 5 },
|
|
801
|
+
noRemaining: { type: Boolean, default: false },
|
|
802
|
+
height: { type: [Number, String], default: 150 },
|
|
803
|
+
noHeight: { type: Boolean, default: false },
|
|
804
|
+
width: { type: [Number, String], default: "100%" },
|
|
805
|
+
noWidth: { type: Boolean, default: false },
|
|
806
|
+
noRadius: { type: Boolean, default: false },
|
|
807
|
+
noZoom: { type: Boolean, default: false },
|
|
808
|
+
hasEmptyLayer: { type: Boolean, default: true },
|
|
809
|
+
lazy: { type: Boolean, default: true },
|
|
810
|
+
blur: { type: Boolean, default: true },
|
|
811
|
+
scale: { type: Boolean, default: true }
|
|
812
|
+
},
|
|
813
|
+
setup(props) {
|
|
814
|
+
onBeforeMount(() => {
|
|
815
|
+
if (props.imagesShownCount > 5)
|
|
816
|
+
console.warn(
|
|
817
|
+
'[MazUI](m-gallery) The maximum of "images-shown-count" is 5'
|
|
818
|
+
);
|
|
819
|
+
});
|
|
820
|
+
const sizeStyle = computed(() => {
|
|
821
|
+
const { height, width, noWidth, noHeight } = props;
|
|
822
|
+
return {
|
|
823
|
+
...noWidth ? {} : {
|
|
824
|
+
flex: "0 0 " + typeof width === "number" ? `${width}px` : width,
|
|
825
|
+
width: typeof width === "number" ? `${width}px` : width
|
|
826
|
+
},
|
|
827
|
+
...noHeight ? {} : {
|
|
828
|
+
height: typeof height === "number" ? `${height}px` : `${height}`,
|
|
829
|
+
minHeight: typeof height === "number" ? `${height}px` : `${height}`
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
});
|
|
833
|
+
const imagesCount = computed(() => {
|
|
834
|
+
return props.imagesShownCount <= 5 ? props.imagesShownCount : 5;
|
|
835
|
+
});
|
|
836
|
+
const numberImagesRemaining = computed(() => {
|
|
837
|
+
return props.images.length - (props.images.length < imagesCount.value ? props.images.length : imagesCount.value);
|
|
838
|
+
});
|
|
839
|
+
const imagesNormalized = computed(() => {
|
|
840
|
+
return props.images.map(
|
|
841
|
+
(image) => typeof image === "object" ? image : { src: image, alt: void 0 }
|
|
842
|
+
);
|
|
843
|
+
});
|
|
844
|
+
const imagesShown = computed(() => {
|
|
845
|
+
return imagesNormalized.value.slice(0, imagesCount.value);
|
|
846
|
+
});
|
|
847
|
+
const imagesHidden = computed(() => {
|
|
848
|
+
return imagesNormalized.value.slice(
|
|
849
|
+
imagesCount.value,
|
|
850
|
+
props.images.length
|
|
851
|
+
);
|
|
852
|
+
});
|
|
853
|
+
const shouldHaveRemainingLayer = (index) => {
|
|
854
|
+
return numberImagesRemaining.value && index + 1 === imagesShown.value.length && !props.noRemaining;
|
|
855
|
+
};
|
|
856
|
+
return {
|
|
857
|
+
sizeStyle,
|
|
858
|
+
imagesCount,
|
|
859
|
+
shouldHaveRemainingLayer,
|
|
860
|
+
imagesShown,
|
|
861
|
+
numberImagesRemaining,
|
|
862
|
+
imagesHidden,
|
|
863
|
+
NoPhotographyIcon
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
const MazGallery_vue_vue_type_style_index_0_scoped_680a27a0_lang = "";
|
|
868
|
+
const _export_sfc = (sfc, props) => {
|
|
869
|
+
const target = sfc.__vccOpts || sfc;
|
|
870
|
+
for (const [key, val] of props) {
|
|
871
|
+
target[key] = val;
|
|
872
|
+
}
|
|
873
|
+
return target;
|
|
874
|
+
};
|
|
875
|
+
const _hoisted_1$3 = { class: "m-gallery__wrapper maz-flex maz-flex-1" };
|
|
876
|
+
const _hoisted_2$3 = ["alt"];
|
|
877
|
+
const _hoisted_3$3 = {
|
|
878
|
+
key: 0,
|
|
879
|
+
class: "m-gallery__remaining-layer maz-flex maz-bg-overlay maz-flex-center"
|
|
880
|
+
};
|
|
881
|
+
const _hoisted_4$1 = { class: "maz-text-2xl maz-text-white" };
|
|
882
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
883
|
+
const _component_MazIcon = resolveComponent("MazIcon");
|
|
884
|
+
const _directive_zoom_img = resolveDirective("zoom-img");
|
|
885
|
+
const _directive_lazy_img = resolveDirective("lazy-img");
|
|
886
|
+
return _ctx.images.length > 0 || _ctx.hasEmptyLayer ? (openBlock(), createElementBlock("div", {
|
|
887
|
+
key: 0,
|
|
888
|
+
class: normalizeClass(["m-gallery maz-flex", { "maz-rounded-xl": !_ctx.noRadius }]),
|
|
889
|
+
style: normalizeStyle([_ctx.sizeStyle])
|
|
890
|
+
}, [
|
|
891
|
+
createElementVNode("section", _hoisted_1$3, [
|
|
892
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.imagesShown, (image, i) => {
|
|
893
|
+
return openBlock(), createElementBlock("figure", {
|
|
894
|
+
key: i,
|
|
895
|
+
class: normalizeClass(["m-gallery__item !maz-my-0 maz-flex maz-flex-center", [`m-gallery__item--${i + 1}`]])
|
|
896
|
+
}, [
|
|
897
|
+
withDirectives(createElementVNode("img", {
|
|
898
|
+
class: "m-gallery__item__image maz-flex-1",
|
|
899
|
+
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
900
|
+
alt: image.alt
|
|
901
|
+
}, null, 8, _hoisted_2$3), [
|
|
902
|
+
[_directive_zoom_img, {
|
|
903
|
+
src: image.src,
|
|
904
|
+
alt: image.alt,
|
|
905
|
+
disabled: _ctx.noZoom || _ctx.shouldHaveRemainingLayer(i),
|
|
906
|
+
blur: _ctx.blur,
|
|
907
|
+
scale: _ctx.scale
|
|
908
|
+
}],
|
|
909
|
+
[_directive_lazy_img, { src: image.src, disabled: !_ctx.lazy }, "bg-image"]
|
|
910
|
+
]),
|
|
911
|
+
_ctx.shouldHaveRemainingLayer(i) ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
912
|
+
createElementVNode("span", _hoisted_4$1, "+" + toDisplayString(_ctx.numberImagesRemaining), 1)
|
|
913
|
+
])), [
|
|
914
|
+
[_directive_zoom_img, {
|
|
915
|
+
src: image.src,
|
|
916
|
+
alt: image.alt,
|
|
917
|
+
disabled: _ctx.noZoom,
|
|
918
|
+
blur: false,
|
|
919
|
+
scale: _ctx.scale
|
|
920
|
+
}]
|
|
921
|
+
]) : createCommentVNode("", true)
|
|
922
|
+
], 2);
|
|
923
|
+
}), 128)),
|
|
924
|
+
_ctx.hasEmptyLayer && _ctx.images.length === 0 ? (openBlock(), createElementBlock("div", {
|
|
925
|
+
key: 0,
|
|
926
|
+
class: normalizeClass(["flex-center maz-flex maz-w-full maz-bg-color-light maz-text-normal", { "maz-rounded-xl": !_ctx.noRadius }]),
|
|
927
|
+
style: normalizeStyle([_ctx.sizeStyle])
|
|
928
|
+
}, [
|
|
929
|
+
createVNode(_component_MazIcon, {
|
|
930
|
+
src: _ctx.NoPhotographyIcon,
|
|
931
|
+
size: "2rem"
|
|
932
|
+
}, null, 8, ["src"])
|
|
933
|
+
], 6)) : createCommentVNode("", true)
|
|
934
|
+
]),
|
|
935
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.imagesHidden, (image, i) => {
|
|
936
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
937
|
+
key: i,
|
|
938
|
+
class: "m-gallery__hidden"
|
|
939
|
+
})), [
|
|
940
|
+
[_directive_zoom_img, { src: image.src, disabled: _ctx.noZoom }]
|
|
941
|
+
]);
|
|
942
|
+
}), 128))
|
|
943
|
+
], 6)) : createCommentVNode("", true);
|
|
944
|
+
}
|
|
945
|
+
const MazGallery = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render], ["__scopeId", "data-v-680a27a0"]]);
|
|
946
|
+
const _withScopeId = (n) => (pushScopeId("data-v-503fe527"), n = n(), popScopeId(), n);
|
|
947
|
+
const _hoisted_1$2 = ["width", "height"];
|
|
948
|
+
const _hoisted_2$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("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" }, null, -1));
|
|
949
|
+
const _hoisted_3$2 = [
|
|
950
|
+
_hoisted_2$2
|
|
951
|
+
];
|
|
952
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
953
|
+
__name: "MazSpinner",
|
|
954
|
+
props: {
|
|
955
|
+
size: { type: String, default: "2em" },
|
|
956
|
+
color: {
|
|
957
|
+
type: String,
|
|
958
|
+
default: "primary",
|
|
959
|
+
validator: (value) => {
|
|
960
|
+
return [
|
|
961
|
+
"info",
|
|
962
|
+
"white",
|
|
963
|
+
"success",
|
|
964
|
+
"warning",
|
|
965
|
+
"danger",
|
|
966
|
+
"primary",
|
|
967
|
+
"black",
|
|
968
|
+
"secondary",
|
|
969
|
+
"transparent"
|
|
970
|
+
].includes(value);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
setup(__props) {
|
|
975
|
+
return (_ctx, _cache) => {
|
|
976
|
+
return openBlock(), createElementBlock("svg", {
|
|
977
|
+
width: __props.size,
|
|
978
|
+
height: __props.size,
|
|
979
|
+
version: "1.1",
|
|
980
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
981
|
+
x: "0px",
|
|
982
|
+
y: "0px",
|
|
983
|
+
viewBox: "0 0 50 50",
|
|
984
|
+
"xml:space": "preserve",
|
|
985
|
+
class: normalizeClass(["m-spinner", `m-spinner--${__props.color}`]),
|
|
986
|
+
style: { "enable-background": "new 0 0 50 50" }
|
|
987
|
+
}, _hoisted_3$2, 10, _hoisted_1$2);
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
});
|
|
991
|
+
const MazSpinner_vue_vue_type_style_index_0_scoped_503fe527_lang = "";
|
|
992
|
+
const MazSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-503fe527"]]);
|
|
993
|
+
const _hoisted_1$1 = {
|
|
994
|
+
key: 0,
|
|
995
|
+
class: "m-btn__icon-left maz-flex maz-flex-center"
|
|
996
|
+
};
|
|
997
|
+
const _hoisted_2$1 = { class: "maz-flex maz-flex-center" };
|
|
998
|
+
const _hoisted_3$1 = {
|
|
999
|
+
key: 1,
|
|
1000
|
+
class: "m-btn__icon-right maz-flex maz-flex-center"
|
|
1001
|
+
};
|
|
1002
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1003
|
+
__name: "MazBtn",
|
|
1004
|
+
props: {
|
|
1005
|
+
variant: {
|
|
1006
|
+
type: String,
|
|
1007
|
+
default: "button",
|
|
1008
|
+
validator: (value) => {
|
|
1009
|
+
return ["button", "link"].includes(value);
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
size: {
|
|
1013
|
+
type: String,
|
|
1014
|
+
default: "md",
|
|
1015
|
+
validator: (value) => {
|
|
1016
|
+
return ["mini", "xs", "sm", "md", "lg", "xl"].includes(value);
|
|
1017
|
+
}
|
|
1018
|
+
},
|
|
1019
|
+
color: {
|
|
1020
|
+
type: String,
|
|
1021
|
+
default: "primary",
|
|
1022
|
+
validator: (value) => {
|
|
1023
|
+
return [
|
|
1024
|
+
"primary",
|
|
1025
|
+
"secondary",
|
|
1026
|
+
"info",
|
|
1027
|
+
"success",
|
|
1028
|
+
"warning",
|
|
1029
|
+
"danger",
|
|
1030
|
+
"white",
|
|
1031
|
+
"black",
|
|
1032
|
+
"transparent"
|
|
1033
|
+
].includes(value);
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
type: {
|
|
1037
|
+
type: String,
|
|
1038
|
+
default: "button",
|
|
1039
|
+
validator: (value) => {
|
|
1040
|
+
return ["button", "submit"].includes(value);
|
|
1041
|
+
}
|
|
1042
|
+
},
|
|
1043
|
+
rounded: { type: Boolean, default: false },
|
|
1044
|
+
outline: { type: Boolean, default: false },
|
|
1045
|
+
pastel: { type: Boolean, default: false },
|
|
1046
|
+
block: { type: Boolean, default: false },
|
|
1047
|
+
noUnderline: { type: Boolean, default: false },
|
|
1048
|
+
noLeading: { type: Boolean, default: false },
|
|
1049
|
+
loading: { type: Boolean, default: false },
|
|
1050
|
+
disabled: { type: Boolean, default: false },
|
|
1051
|
+
fab: { type: Boolean, default: false },
|
|
1052
|
+
leftIcon: { type: String, default: void 0 },
|
|
1053
|
+
rightIcon: { type: String, default: void 0 },
|
|
1054
|
+
noPadding: { type: Boolean, default: false },
|
|
1055
|
+
noElevation: { type: Boolean, default: false }
|
|
1056
|
+
},
|
|
1057
|
+
setup(__props) {
|
|
1058
|
+
const props = __props;
|
|
1059
|
+
const { href, to } = useAttrs();
|
|
1060
|
+
const slots = useSlots();
|
|
1061
|
+
const component = computed(() => {
|
|
1062
|
+
if (href)
|
|
1063
|
+
return "a";
|
|
1064
|
+
else if (to)
|
|
1065
|
+
return "router-link";
|
|
1066
|
+
return "button";
|
|
1067
|
+
});
|
|
1068
|
+
const btnColorClass = computed(
|
|
1069
|
+
() => props.pastel ? `--${props.color}-pastel` : props.outline || props.loading ? `--${props.color}-outline` : `--${props.color}`
|
|
1070
|
+
);
|
|
1071
|
+
const isDisabled = computed(
|
|
1072
|
+
() => (props.loading || props.disabled) && component.value === "button"
|
|
1073
|
+
);
|
|
1074
|
+
const cursorClass = computed(
|
|
1075
|
+
() => isDisabled.value ? "--cursor-default" : "--cursor-pointer"
|
|
1076
|
+
);
|
|
1077
|
+
const variantClass = computed(() => `--is-${props.variant}`);
|
|
1078
|
+
const loaderBgColorClass = computed(() => `--${props.color}`);
|
|
1079
|
+
const loaderColor = computed(
|
|
1080
|
+
() => ["white"].includes(props.color) ? "black" : "white"
|
|
1081
|
+
);
|
|
1082
|
+
const hasLoader = computed(() => props.loading && props.variant === "button");
|
|
1083
|
+
const hasLeftIcon = computed(() => !!slots["left-icon"] || props.leftIcon);
|
|
1084
|
+
const hasRightIcon = computed(() => !!slots["right-icon"] || props.rightIcon);
|
|
1085
|
+
const hasIcon = computed(() => hasLeftIcon.value || hasRightIcon.value);
|
|
1086
|
+
const btnType = computed(
|
|
1087
|
+
() => component.value === "button" ? props.type : void 0
|
|
1088
|
+
);
|
|
1089
|
+
return (_ctx, _cache) => {
|
|
1090
|
+
return openBlock(), createBlock(resolveDynamicComponent(unref(component)), mergeProps(_ctx.$attrs, {
|
|
1091
|
+
disabled: unref(isDisabled),
|
|
1092
|
+
class: ["m-btn", [
|
|
1093
|
+
`--${__props.size}`,
|
|
1094
|
+
unref(btnColorClass),
|
|
1095
|
+
unref(cursorClass),
|
|
1096
|
+
unref(variantClass),
|
|
1097
|
+
{
|
|
1098
|
+
"--block": __props.block,
|
|
1099
|
+
"--no-underline": __props.noUnderline,
|
|
1100
|
+
"--no-leading": __props.noLeading,
|
|
1101
|
+
"--fab": __props.fab,
|
|
1102
|
+
"--loading": __props.loading,
|
|
1103
|
+
"--disabled": unref(isDisabled),
|
|
1104
|
+
"--icon": unref(hasIcon),
|
|
1105
|
+
"--rounded": __props.rounded,
|
|
1106
|
+
"--no-padding": __props.noPadding,
|
|
1107
|
+
"--no-elevation": __props.noElevation
|
|
1108
|
+
}
|
|
1109
|
+
]],
|
|
1110
|
+
type: unref(btnType)
|
|
1111
|
+
}), {
|
|
1112
|
+
default: withCtx(() => [
|
|
1113
|
+
unref(hasLeftIcon) ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1114
|
+
renderSlot(_ctx.$slots, "left-icon", {}, () => [
|
|
1115
|
+
__props.leftIcon ? (openBlock(), createBlock(_sfc_main$5, {
|
|
1116
|
+
key: 0,
|
|
1117
|
+
name: __props.leftIcon
|
|
1118
|
+
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
1119
|
+
], true)
|
|
1120
|
+
])) : createCommentVNode("", true),
|
|
1121
|
+
createElementVNode("span", _hoisted_2$1, [
|
|
1122
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1123
|
+
]),
|
|
1124
|
+
unref(hasRightIcon) ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
1125
|
+
renderSlot(_ctx.$slots, "right-icon", {}, () => [
|
|
1126
|
+
__props.rightIcon ? (openBlock(), createBlock(_sfc_main$5, {
|
|
1127
|
+
key: 0,
|
|
1128
|
+
name: __props.rightIcon
|
|
1129
|
+
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
1130
|
+
], true)
|
|
1131
|
+
])) : createCommentVNode("", true),
|
|
1132
|
+
unref(hasLoader) ? (openBlock(), createElementBlock("div", {
|
|
1133
|
+
key: 2,
|
|
1134
|
+
class: normalizeClass(["m-btn__loading-wrapper", unref(loaderBgColorClass)])
|
|
1135
|
+
}, [
|
|
1136
|
+
createVNode(MazSpinner, {
|
|
1137
|
+
size: "2em",
|
|
1138
|
+
color: unref(loaderColor)
|
|
1139
|
+
}, null, 8, ["color"])
|
|
1140
|
+
], 2)) : createCommentVNode("", true)
|
|
1141
|
+
]),
|
|
1142
|
+
_: 3
|
|
1143
|
+
}, 16, ["disabled", "class", "type"]);
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
const MazBtn_vue_vue_type_style_index_0_scoped_7673d151_lang = "";
|
|
1148
|
+
const MazBtn = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7673d151"]]);
|
|
1149
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1150
|
+
__name: "MazTransitionExpand",
|
|
1151
|
+
setup(__props) {
|
|
1152
|
+
const enter = (element) => {
|
|
1153
|
+
const width = getComputedStyle(element).width;
|
|
1154
|
+
element.style.width = width;
|
|
1155
|
+
element.style.position = "absolute";
|
|
1156
|
+
element.style.visibility = "hidden";
|
|
1157
|
+
element.style.height = "auto";
|
|
1158
|
+
element.style.top = "bottom";
|
|
1159
|
+
const height = getComputedStyle(element).height;
|
|
1160
|
+
element.style.width = "";
|
|
1161
|
+
element.style.position = "";
|
|
1162
|
+
element.style.visibility = "";
|
|
1163
|
+
element.style.height = "0px";
|
|
1164
|
+
getComputedStyle(element).height;
|
|
1165
|
+
nextTick(() => {
|
|
1166
|
+
element.style.height = height;
|
|
1167
|
+
});
|
|
1168
|
+
};
|
|
1169
|
+
const afterEnter = (element) => {
|
|
1170
|
+
element.style.height = "auto";
|
|
1171
|
+
};
|
|
1172
|
+
const leave = (element) => {
|
|
1173
|
+
const height = getComputedStyle(element).height;
|
|
1174
|
+
element.style.height = height;
|
|
1175
|
+
getComputedStyle(element).height;
|
|
1176
|
+
nextTick(() => {
|
|
1177
|
+
element.style.height = "0px";
|
|
1178
|
+
});
|
|
1179
|
+
};
|
|
1180
|
+
return (_ctx, _cache) => {
|
|
1181
|
+
return openBlock(), createBlock(TransitionGroup, {
|
|
1182
|
+
class: "m-transition-expand",
|
|
1183
|
+
name: "maz-expand",
|
|
1184
|
+
tag: "div",
|
|
1185
|
+
onEnter: _cache[0] || (_cache[0] = (el) => enter(el)),
|
|
1186
|
+
onAfterEnter: _cache[1] || (_cache[1] = (el) => afterEnter(el)),
|
|
1187
|
+
onLeave: _cache[2] || (_cache[2] = (el) => leave(el))
|
|
1188
|
+
}, {
|
|
1189
|
+
default: withCtx(() => [
|
|
1190
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1191
|
+
]),
|
|
1192
|
+
_: 3
|
|
1193
|
+
});
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
const MazTransitionExpand_vue_vue_type_style_index_0_scoped_b5d3ee9f_lang = "";
|
|
1198
|
+
const MazTransitionExpand = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b5d3ee9f"]]);
|
|
1199
|
+
const ChevronDownIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIGFyaWEtaGlkZGVuPSJ0cnVlIj4KICA8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTE5IDlsLTcgNy03LTciLz4KPC9zdmc+Cg==";
|
|
1200
|
+
const _hoisted_1 = {
|
|
1201
|
+
key: 0,
|
|
1202
|
+
class: "m-card__gallery__wrapper"
|
|
1203
|
+
};
|
|
1204
|
+
const _hoisted_2 = { class: "maz-min-w-0 maz-flex-1" };
|
|
1205
|
+
const _hoisted_3 = {
|
|
1206
|
+
key: 0,
|
|
1207
|
+
class: "m-card__title"
|
|
1208
|
+
};
|
|
1209
|
+
const _hoisted_4 = {
|
|
1210
|
+
key: 1,
|
|
1211
|
+
class: "m-card__subtitle"
|
|
1212
|
+
};
|
|
1213
|
+
const _hoisted_5 = {
|
|
1214
|
+
key: 2,
|
|
1215
|
+
class: "m-card__content"
|
|
1216
|
+
};
|
|
1217
|
+
const _hoisted_6 = {
|
|
1218
|
+
key: 2,
|
|
1219
|
+
class: "m-card__actions maz-flex maz-p-2"
|
|
1220
|
+
};
|
|
1221
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1222
|
+
__name: "MazCard",
|
|
1223
|
+
props: {
|
|
1224
|
+
images: {
|
|
1225
|
+
type: Array,
|
|
1226
|
+
default: void 0
|
|
1227
|
+
},
|
|
1228
|
+
orientation: {
|
|
1229
|
+
type: String,
|
|
1230
|
+
default: "column",
|
|
1231
|
+
validator: (value) => {
|
|
1232
|
+
return ["column", "row", "row-reverse", "column-reverse"].includes(
|
|
1233
|
+
value
|
|
1234
|
+
);
|
|
1235
|
+
}
|
|
1236
|
+
},
|
|
1237
|
+
href: { type: String, default: void 0 },
|
|
1238
|
+
hrefTarget: { type: String, default: "_self" },
|
|
1239
|
+
footerAlign: { type: String, default: "right" },
|
|
1240
|
+
galleryWidth: { type: [String, Number], default: 200 },
|
|
1241
|
+
galleryHeight: { type: [String, Number], default: 150 },
|
|
1242
|
+
zoom: { type: Boolean, default: false },
|
|
1243
|
+
elevation: { type: Boolean, default: true },
|
|
1244
|
+
radius: { type: Boolean, default: true },
|
|
1245
|
+
bordered: { type: Boolean, default: false },
|
|
1246
|
+
imagesShowCount: { type: Number, default: 3 },
|
|
1247
|
+
noRemaining: { type: Boolean, default: true },
|
|
1248
|
+
scale: { type: Boolean, default: true },
|
|
1249
|
+
wrapperClass: { type: String, default: void 0 },
|
|
1250
|
+
noPadding: { type: Boolean, default: false },
|
|
1251
|
+
overflowHidden: { type: Boolean, default: false },
|
|
1252
|
+
collapsable: { type: Boolean, default: false },
|
|
1253
|
+
collapseOpen: { type: Boolean, default: false }
|
|
1254
|
+
},
|
|
1255
|
+
setup(__props) {
|
|
1256
|
+
const props = __props;
|
|
1257
|
+
const slots = useSlots();
|
|
1258
|
+
const isOpen = ref(props.collapsable ? props.collapseOpen : true);
|
|
1259
|
+
watch(
|
|
1260
|
+
() => props.collapseOpen,
|
|
1261
|
+
(value) => {
|
|
1262
|
+
if (props.collapsable)
|
|
1263
|
+
isOpen.value = value;
|
|
1264
|
+
}
|
|
1265
|
+
);
|
|
1266
|
+
const isColumnVariant = computed(
|
|
1267
|
+
() => ["column", "column-reverse"].includes(props.orientation)
|
|
1268
|
+
);
|
|
1269
|
+
const haveSomeContent = computed(() => {
|
|
1270
|
+
const supportedSlots = /* @__PURE__ */ new Set(["default", "title", "subtitle", "content"]);
|
|
1271
|
+
return Object.keys(slots).some((val) => supportedSlots.has(val));
|
|
1272
|
+
});
|
|
1273
|
+
const galleryWidthComputed = computed(
|
|
1274
|
+
() => haveSomeContent.value ? props.galleryWidth : "100%"
|
|
1275
|
+
);
|
|
1276
|
+
const footerAlignClass = computed(
|
|
1277
|
+
() => props.footerAlign === "right" ? "maz-text-right" : "maz-text-left"
|
|
1278
|
+
);
|
|
1279
|
+
return (_ctx, _cache) => {
|
|
1280
|
+
return openBlock(), createElementBlock("div", {
|
|
1281
|
+
class: normalizeClass(["m-card", [
|
|
1282
|
+
{
|
|
1283
|
+
"m-card--linked": __props.href,
|
|
1284
|
+
"m-card--no-scale": !__props.scale,
|
|
1285
|
+
"maz-elevation": __props.elevation,
|
|
1286
|
+
"maz-overflow-hidden": __props.overflowHidden || !isOpen.value,
|
|
1287
|
+
"maz-rounded": __props.radius,
|
|
1288
|
+
"maz-border-2 maz-border-solid maz-border-color-lighter": __props.bordered
|
|
1289
|
+
}
|
|
1290
|
+
]])
|
|
1291
|
+
}, [
|
|
1292
|
+
_ctx.$slots["header"] || __props.collapsable ? (openBlock(), createBlock(resolveDynamicComponent(__props.collapsable ? "button" : "div"), {
|
|
1293
|
+
key: 0,
|
|
1294
|
+
class: normalizeClass(["m-card__header maz-rounded-t-xl maz-border-b-2", [
|
|
1295
|
+
isOpen.value ? "maz-border-color-lighter" : "maz-border-transparent",
|
|
1296
|
+
{ "--is-collapsable": __props.collapsable }
|
|
1297
|
+
]]),
|
|
1298
|
+
tabindex: "-1",
|
|
1299
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => __props.collapsable ? isOpen.value = !isOpen.value : void 0, ["stop"]))
|
|
1300
|
+
}, {
|
|
1301
|
+
default: withCtx(() => [
|
|
1302
|
+
renderSlot(_ctx.$slots, "header", {}, void 0, true),
|
|
1303
|
+
__props.collapsable ? (openBlock(), createBlock(MazBtn, {
|
|
1304
|
+
key: 0,
|
|
1305
|
+
color: "transparent",
|
|
1306
|
+
class: "maz-ml-2 maz-text-sm",
|
|
1307
|
+
size: "xs",
|
|
1308
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => isOpen.value = !isOpen.value, ["stop"]))
|
|
1309
|
+
}, {
|
|
1310
|
+
default: withCtx(() => [
|
|
1311
|
+
createVNode(_sfc_main$5, {
|
|
1312
|
+
src: unref(ChevronDownIcon),
|
|
1313
|
+
class: normalizeClass([{ "--is-open": isOpen.value }, "m-card__collapse-icon maz-h-6"])
|
|
1314
|
+
}, null, 8, ["src", "class"])
|
|
1315
|
+
]),
|
|
1316
|
+
_: 1
|
|
1317
|
+
})) : createCommentVNode("", true)
|
|
1318
|
+
]),
|
|
1319
|
+
_: 3
|
|
1320
|
+
}, 8, ["class"])) : createCommentVNode("", true),
|
|
1321
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.href ? "a" : "div"), {
|
|
1322
|
+
class: normalizeClass(["m-card__wrapper", [`m-card__wrapper--${__props.orientation}`, { "m-card__link": __props.href }]]),
|
|
1323
|
+
href: __props.href,
|
|
1324
|
+
target: __props.href ? __props.hrefTarget : null
|
|
1325
|
+
}, {
|
|
1326
|
+
default: withCtx(() => [
|
|
1327
|
+
__props.images ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1328
|
+
createVNode(MazGallery, {
|
|
1329
|
+
radius: __props.radius,
|
|
1330
|
+
width: unref(galleryWidthComputed),
|
|
1331
|
+
height: __props.galleryHeight,
|
|
1332
|
+
"images-shown-count": __props.imagesShowCount,
|
|
1333
|
+
images: __props.images,
|
|
1334
|
+
zoom: __props.zoom,
|
|
1335
|
+
"no-width": unref(isColumnVariant),
|
|
1336
|
+
"no-height": !unref(isColumnVariant) && unref(haveSomeContent),
|
|
1337
|
+
"no-remaining": __props.noRemaining,
|
|
1338
|
+
class: "m-card__gallery maz-flex-1"
|
|
1339
|
+
}, null, 8, ["radius", "width", "height", "images-shown-count", "images", "zoom", "no-width", "no-height", "no-remaining"])
|
|
1340
|
+
])) : createCommentVNode("", true),
|
|
1341
|
+
createElementVNode("div", _hoisted_2, [
|
|
1342
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.collapsable ? MazTransitionExpand : "div"), null, {
|
|
1343
|
+
default: withCtx(() => [
|
|
1344
|
+
withDirectives(createElementVNode("div", {
|
|
1345
|
+
class: normalizeClass([[__props.wrapperClass, { "maz-p-4": !__props.noPadding && !__props.collapsable }], "m-card__content__wrapper"])
|
|
1346
|
+
}, [
|
|
1347
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1348
|
+
_ctx.$slots["title"] ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1349
|
+
renderSlot(_ctx.$slots, "title", {}, void 0, true)
|
|
1350
|
+
])) : createCommentVNode("", true),
|
|
1351
|
+
_ctx.$slots["subtitle"] ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
1352
|
+
renderSlot(_ctx.$slots, "subtitle", {}, void 0, true)
|
|
1353
|
+
])) : createCommentVNode("", true),
|
|
1354
|
+
_ctx.$slots["content"] ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
1355
|
+
renderSlot(_ctx.$slots, "content", {}, void 0, true)
|
|
1356
|
+
])) : createCommentVNode("", true)
|
|
1357
|
+
], true)
|
|
1358
|
+
], 2), [
|
|
1359
|
+
[vShow, isOpen.value]
|
|
1360
|
+
])
|
|
1361
|
+
]),
|
|
1362
|
+
_: 3
|
|
1363
|
+
}))
|
|
1364
|
+
])
|
|
1365
|
+
]),
|
|
1366
|
+
_: 3
|
|
1367
|
+
}, 8, ["class", "href", "target"])),
|
|
1368
|
+
_ctx.$slots["footer"] ? (openBlock(), createElementBlock("div", {
|
|
1369
|
+
key: 1,
|
|
1370
|
+
class: normalizeClass(["m-card__footer maz-overflow-x-auto maz-p-3", [
|
|
1371
|
+
{
|
|
1372
|
+
"maz-border-t-2 maz-border-color-lighter": unref(isColumnVariant) && unref(haveSomeContent)
|
|
1373
|
+
},
|
|
1374
|
+
unref(footerAlignClass)
|
|
1375
|
+
]])
|
|
1376
|
+
}, [
|
|
1377
|
+
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
1378
|
+
], 2)) : createCommentVNode("", true),
|
|
1379
|
+
_ctx.$slots["actions"] ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
1380
|
+
renderSlot(_ctx.$slots, "actions", {}, void 0, true)
|
|
1381
|
+
])) : createCommentVNode("", true)
|
|
1382
|
+
], 2);
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
const MazCard_vue_vue_type_style_index_0_scoped_34ee12c8_lang = "";
|
|
1387
|
+
const MazCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-34ee12c8"]]);
|
|
1388
|
+
export {
|
|
1389
|
+
MazCard as default
|
|
1390
|
+
};
|