maz-ui 3.8.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/MazAvatar.d.ts +9 -4
- package/components/MazAvatar.mjs +4 -3
- package/components/MazAvatar.umd.js +2 -2
- package/components/MazBackdrop.d.ts +1 -0
- package/components/MazBackdrop.mjs +1 -1
- package/components/MazBackdrop.umd.js +1 -1
- package/components/MazBadge.d.ts +6 -1
- package/components/MazBottomSheet.d.ts +7 -2
- package/components/MazBottomSheet.mjs +6 -6
- package/components/MazBottomSheet.umd.js +2 -2
- package/components/MazBtn.d.ts +9 -4
- package/components/MazBtn.mjs +3 -3
- package/components/MazBtn.umd.js +2 -2
- package/components/MazCard.d.ts +12 -7
- package/components/MazCard.mjs +117 -130
- package/components/MazCard.umd.js +2 -2
- package/components/MazCarousel.d.ts +9 -4
- package/components/MazCarousel.mjs +3 -3
- package/components/MazCarousel.umd.js +2 -2
- package/components/MazChart.d.ts +20 -81
- package/components/MazChart.mjs +64 -123
- package/components/MazChart.umd.js +2 -2
- package/components/MazCheckbox.d.ts +6 -1
- package/components/MazDialog.d.ts +13 -8
- package/components/MazDialog.mjs +5 -5
- package/components/MazDialog.umd.js +2 -2
- package/components/MazDialogPromise.d.ts +12 -7
- package/components/MazDialogPromise.mjs +5 -5
- package/components/MazDialogPromise.umd.js +2 -2
- package/components/MazDrawer.d.ts +9 -4
- package/components/MazDrawer.mjs +3 -3
- package/components/MazDrawer.umd.js +2 -2
- package/components/MazDropzone.d.ts +3 -2
- package/components/MazDropzone.mjs +1 -1
- package/components/MazDropzone.umd.js +1 -1
- package/components/MazGallery.d.ts +4 -22
- package/components/MazGallery.mjs +113 -126
- package/components/MazGallery.umd.js +2 -2
- package/components/MazIcon.d.ts +1 -0
- package/components/MazIcon.mjs +1 -1
- package/components/MazIcon.umd.js +1 -1
- package/components/MazInput.d.ts +2 -1
- package/components/MazInput.mjs +5 -5
- package/components/MazInput.umd.js +2 -2
- package/components/MazInputNumber.d.ts +2 -1
- package/components/MazInputNumber.mjs +5 -5
- package/components/MazInputNumber.umd.js +2 -2
- package/components/MazInputPrice.d.ts +6 -1
- package/components/MazInputPrice.mjs +5 -5
- package/components/MazInputPrice.umd.js +2 -2
- package/components/MazInputTags.d.ts +2 -1
- package/components/MazInputTags.mjs +5 -5
- package/components/MazInputTags.umd.js +2 -2
- package/components/MazLazyImg.d.ts +6 -1
- package/components/MazLazyImg.mjs +4 -3
- package/components/MazLazyImg.umd.js +2 -2
- package/components/MazPhoneNumberInput.d.ts +2 -1
- package/components/MazPhoneNumberInput.mjs +5 -5
- package/components/MazPhoneNumberInput.umd.js +2 -2
- package/components/MazPicker/MazPickerCalendar.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarDays.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +5 -4
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +5 -4
- package/components/MazPicker/MazPickerCalendarSwitcher.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerContainer.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerFooter.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerHeader.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerMonthSwitcher.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerShortcuts.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerTime.vue.d.ts +1 -0
- package/components/MazPicker/MazPickerYearSwitcher.vue.d.ts +1 -0
- package/components/MazPicker.d.ts +2 -1
- package/components/MazPicker.mjs +20 -20
- package/components/MazPicker.umd.js +2 -2
- package/components/MazRadioButtons.d.ts +7 -2
- package/components/MazSelect.d.ts +8 -3
- package/components/MazSelect.mjs +5 -5
- package/components/MazSelect.umd.js +2 -2
- package/components/MazSlider.d.ts +2 -1
- package/components/MazSpinner.d.ts +1 -0
- package/components/MazStepper.d.ts +7 -2
- package/components/MazStepper.mjs +1 -1
- package/components/MazStepper.umd.js +1 -1
- package/components/MazSwitch.d.ts +2 -1
- package/components/MazSwitch.mjs +1 -1
- package/components/MazSwitch.umd.js +1 -1
- package/components/MazTabsBar.d.ts +1 -0
- package/components/MazTabsBar.mjs +3 -3
- package/components/MazTabsBar.umd.js +2 -2
- package/components/MazTabsContent.d.ts +6 -1
- package/components/MazTabsContent.mjs +1 -1
- package/components/MazTabsContent.umd.js +1 -1
- package/components/MazTabsContentItem.d.ts +6 -1
- package/components/MazTabsContentItem.mjs +3 -4
- package/components/MazTabsContentItem.umd.js +2 -2
- package/components/MazTextarea.d.ts +2 -1
- package/components/MazTransitionExpand.d.ts +6 -1
- package/maz-ui.d.ts +9 -4
- package/modules/maz-ui.mjs +1 -0
- package/modules/maz-ui.umd.js +1 -1
- package/package.json +36 -36
- package/components/MazChart/includes.d.ts +0 -11
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode("@-webkit-keyframes maz-spin-34f40819{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes maz-spin-34f40819{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.m-spinner[data-v-34f40819]{-webkit-animation:maz-spin-34f40819 1s linear infinite;animation:maz-spin-34f40819 1s linear infinite;fill:currentColor;margin:0!important}.m-spinner--normal[data-v-34f40819]{color:var(--maz-color-text)}.m-spinner--primary[data-v-34f40819]{color:var(--maz-color-primary)}.m-spinner--secondary[data-v-34f40819]{color:var(--maz-color-secondary)}.m-spinner--info[data-v-34f40819]{color:var(--maz-color-info)}.m-spinner--warning[data-v-34f40819]{color:var(--maz-color-warning)}.m-spinner--danger[data-v-34f40819]{color:var(--maz-color-danger)}.m-spinner--success[data-v-34f40819]{color:var(--maz-color-success)}.m-spinner--black[data-v-34f40819]{color:var(--maz-color-black)}.m-spinner--white[data-v-34f40819],.m-spinner--transparent[data-v-34f40819]{color:var(--maz-color-white)}@-webkit-keyframes passing-through{0%{opacity:0;-webkit-transform:translateY(40px);transform:translateY(40px)}30%,70%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}to{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}}@keyframes passing-through{0%{opacity:0;-webkit-transform:translateY(40px);transform:translateY(40px)}30%,70%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}to{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}}@-webkit-keyframes slide-in{0%{opacity:0;-webkit-transform:translateY(40px);transform:translateY(40px)}30%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes slide-in{0%{opacity:0;-webkit-transform:translateY(40px);transform:translateY(40px)}30%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1)}10%{-webkit-transform:scale(1.1);transform:scale(1.1)}20%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1)}10%{-webkit-transform:scale(1.1);transform:scale(1.1)}20%{-webkit-transform:scale(1);transform:scale(1)}}.maz-dropzone{margin:0;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:auto;border-radius:var(--maz-border-radius);border-width:var(--maz-border-width);border-style:dashed;border-color:var(--maz-color-bg-light);background-color:var(--maz-color-bg);padding:1rem;text-align:center;outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:all;transition-property:all;-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;-webkit-transition-timing-function:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);min-height:245px}.maz-dropzone:not(.dz-clickable){background-color:var(--maz-color-bg-light)}.maz-dropzone.dz-clickable,.maz-dropzone.dz-clickable.dz-message,.maz-dropzone.dz-clickable.dz-message *{cursor:pointer}.maz-dropzone .dz-message{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.maz-dropzone.dz-clickable:hover,.maz-dropzone.dz-clickable:focus{border-color:var(--maz-color-bg-lighter);background-color:var(--maz-color-bg-light)}.maz-dropzone.dz-clickable:hover .maz-dropzone__main-icon,.maz-dropzone.dz-clickable:focus .maz-dropzone__main-icon{color:var(--maz-color-primary);-webkit-transition-property:all;transition-property:all;-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;-webkit-transition-timing-function:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.maz-dropzone.dz-started .dz-message{display:none}.maz-dropzone.dz-drag-hover{border-style:solid}.maz-dropzone.dz-drag-hover .dz-message{opacity:.5}.maz-dropzone .dz-message .dz-button{cursor:pointer;border-style:none;background-color:transparent;padding:0}.maz-dropzone .dz-details{position:absolute;top:0px;right:0px;bottom:0px;left:0px;z-index:20;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:var(--maz-border-radius);padding:2rem 1rem;text-align:center;line-height:2.5rem;color:var(--maz-color-white);opacity:0;background-color:var(--maz-color-primary-alpha);-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.maz-dropzone .dz-details .dz-size span{font-size:1rem;line-height:1.5rem;color:var(--maz-color-white)}.maz-dropzone .dz-details .dz-filename{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.maz-dropzone .dz-details .dz-filename span{color:#fff;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.maz-dropzone .dz-image{overflow:hidden;position:relative;display:block;z-index:10;width:100%;height:100%;margin:0 auto;border-radius:var(--maz-border-radius);border-color:var(--maz-color-bg-lighter)}.maz-dropzone .dz-image img{display:block}.maz-dropzone .dz-image>div[data-dz-thumbnail-bg]{width:inherit;height:inherit;background-size:cover;background-repeat:no-repeat;background-position:center}.maz-dropzone .dz-preview{position:relative;display:inline-block;vertical-align:top;margin:0;min-height:auto;height:100%;background:transparent;max-width:200px;overflow:hidden}.maz-dropzone .dz-preview:not(:last-child){margin-right:.5rem}.maz-dropzone .dz-preview.dz-file-preview .dz-image{border-radius:20px;background:#999;background:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#ddd));background:linear-gradient(to bottom,#eee,#ddd)}.maz-dropzone .dz-preview.dz-file-preview .dz-details{opacity:1}.maz-dropzone .dz-preview.dz-image-preview{background-color:transparent}.maz-dropzone .dz-preview.dz-image-preview .dz-details{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.maz-dropzone .dz-preview .dz-remove{text-align:center;display:block;cursor:pointer;position:absolute;z-index:30;color:#fff;top:inherit;left:5px;right:5px;bottom:5px;padding:10px 5px;border:2px white solid;text-decoration:none;text-transform:uppercase;font-size:.8rem;opacity:0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:var(--maz-border-radius)}.maz-dropzone .dz-preview .dz-remove:hover{background-color:var(--maz-color-white);color:var(--maz-color-primary)}.maz-dropzone .dz-preview:hover{z-index:1000}.maz-dropzone .dz-preview:hover .dz-details,.maz-dropzone .dz-preview:hover .dz-remove{opacity:1}.maz-dropzone .dz-preview:hover .dz-image img{-webkit-transform:scale(1.05,1.05);transform:scale(1.05);-webkit-filter:blur(8px);filter:blur(8px)}.maz-dropzone .dz-preview .dz-error-message{pointer-events:none;z-index:1000;position:absolute;display:block;display:none;opacity:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease;border-radius:8px;top:130px;background:#be2626;background:-webkit-gradient(linear,left top,left bottom,from(#be2626),to(#a92222));background:linear-gradient(to bottom,#be2626,#a92222);padding:.5em 1.2em;color:#fff;margin-left:auto;margin-right:auto;left:0;width:100%;text-align:center}.maz-dropzone .dz-preview .dz-success-mark,.maz-dropzone .dz-preview .dz-error-mark{pointer-events:none;opacity:0;z-index:500;position:absolute;display:block;margin-left:auto;margin-top:auto;width:100%;top:30%;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.maz-dropzone .dz-preview .dz-success-mark .material-icons,.maz-dropzone .dz-preview .dz-error-mark .material-icons{background-color:var(--maz-color-success-alpha);border-radius:50%;color:#fff;font-size:70px}.maz-dropzone .dz-preview .dz-error-mark .material-icons{background-color:var(--maz-color-danger-alpha)}.maz-dropzone .dz-preview.dz-success .dz-success-mark{-webkit-animation:passing-through 3s cubic-bezier(.77,0,.175,1);animation:passing-through 3s cubic-bezier(.77,0,.175,1)}.maz-dropzone .dz-preview.dz-error .dz-error-message{display:block}.maz-dropzone .dz-preview.dz-error .dz-error-mark{opacity:1;-webkit-animation:slide-in 3s cubic-bezier(.77,0,.175,1);animation:slide-in 3s cubic-bezier(.77,0,.175,1)}.maz-dropzone .dz-preview.dz-error .dz-details{background-color:var(--maz-color-danger-alpha)}.maz-dropzone .dz-preview.dz-error:hover .dz-error-message{opacity:1;pointer-events:auto}.maz-dropzone .dz-preview.dz-error .dz-remove:hover{color:var(--maz-color-danger)}.maz-dropzone .dz-preview .dz-progress{opacity:1;z-index:1000;pointer-events:none;position:absolute;height:1rem;top:50%;margin-top:-.5rem;-webkit-transform:scale(1);transform:scale(1);overflow:visible;width:50%;left:25%;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.maz-dropzone .dz-preview .dz-progress .dz-upload{-webkit-transition:width .3s ease-in-out;transition:width .3s ease-in-out;position:absolute;top:0px;right:0px;bottom:0px;left:0px;width:0px;border-radius:9999px;background-color:var(--maz-color-success)}.maz-dropzone .dz-preview .dz-progress .progress-title{display:inline-block;position:relative;top:-30px}.maz-dropzone .dz-preview.dz-processing .dz-progress{opacity:1;-webkit-transition:all .2s linear;transition:all .2s linear}.maz-dropzone .dz-preview.dz-complete .dz-progress{opacity:0;-webkit-transition:opacity .4s ease-in;transition:opacity .4s ease-in}.maz-dropzone .dz-preview:not(.dz-processing) .dz-progress{-webkit-animation:pulse 6s ease infinite;animation:pulse 6s ease infinite}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode("@-webkit-keyframes maz-spin-34f40819{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes maz-spin-34f40819{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.m-spinner[data-v-34f40819]{-webkit-animation:maz-spin-34f40819 1s linear infinite;animation:maz-spin-34f40819 1s linear infinite;fill:currentColor;margin:0!important}.m-spinner--normal[data-v-34f40819]{color:var(--maz-color-text)}.m-spinner--primary[data-v-34f40819]{color:var(--maz-color-primary)}.m-spinner--secondary[data-v-34f40819]{color:var(--maz-color-secondary)}.m-spinner--info[data-v-34f40819]{color:var(--maz-color-info)}.m-spinner--warning[data-v-34f40819]{color:var(--maz-color-warning)}.m-spinner--danger[data-v-34f40819]{color:var(--maz-color-danger)}.m-spinner--success[data-v-34f40819]{color:var(--maz-color-success)}.m-spinner--black[data-v-34f40819]{color:var(--maz-color-black)}.m-spinner--white[data-v-34f40819],.m-spinner--transparent[data-v-34f40819]{color:var(--maz-color-white)}@-webkit-keyframes passing-through{0%{opacity:0;-webkit-transform:translateY(40px);transform:translateY(40px)}30%,70%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}to{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}}@keyframes passing-through{0%{opacity:0;-webkit-transform:translateY(40px);transform:translateY(40px)}30%,70%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}to{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}}@-webkit-keyframes slide-in{0%{opacity:0;-webkit-transform:translateY(40px);transform:translateY(40px)}30%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes slide-in{0%{opacity:0;-webkit-transform:translateY(40px);transform:translateY(40px)}30%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1)}10%{-webkit-transform:scale(1.1);transform:scale(1.1)}20%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1)}10%{-webkit-transform:scale(1.1);transform:scale(1.1)}20%{-webkit-transform:scale(1);transform:scale(1)}}.maz-dropzone{margin:0;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:auto;border-radius:var(--maz-border-radius);border-width:var(--maz-border-width);border-style:dashed;border-color:var(--maz-color-bg-light);background-color:var(--maz-color-bg);padding:1rem;text-align:center;outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:all;transition-property:all;-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;-webkit-transition-timing-function:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);min-height:245px}.maz-dropzone:not(.dz-clickable){background-color:var(--maz-color-bg-light)}.maz-dropzone.dz-clickable,.maz-dropzone.dz-clickable.dz-message,.maz-dropzone.dz-clickable.dz-message *{cursor:pointer}.maz-dropzone .dz-message{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.maz-dropzone.dz-clickable:hover,.maz-dropzone.dz-clickable:focus{border-color:var(--maz-color-bg-lighter);background-color:var(--maz-color-bg-light)}.maz-dropzone.dz-clickable:hover .maz-dropzone__main-icon,.maz-dropzone.dz-clickable:focus .maz-dropzone__main-icon{color:var(--maz-color-primary);-webkit-transition-property:all;transition-property:all;-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;-webkit-transition-timing-function:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.maz-dropzone.dz-started .dz-message{display:none}.maz-dropzone.dz-drag-hover{border-style:solid}.maz-dropzone.dz-drag-hover .dz-message{opacity:.5}.maz-dropzone .dz-message .dz-button{cursor:pointer;border-style:none;background-color:transparent;padding:0}.maz-dropzone .dz-details{position:absolute;inset:0px;z-index:20;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:var(--maz-border-radius);padding:2rem 1rem;text-align:center;line-height:2.5rem;color:var(--maz-color-white);opacity:0;background-color:var(--maz-color-primary-alpha);-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.maz-dropzone .dz-details .dz-size span{font-size:1rem;line-height:1.5rem;color:var(--maz-color-white)}.maz-dropzone .dz-details .dz-filename{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.maz-dropzone .dz-details .dz-filename span{color:#fff;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.maz-dropzone .dz-image{overflow:hidden;position:relative;display:block;z-index:10;width:100%;height:100%;margin:0 auto;border-radius:var(--maz-border-radius);border-color:var(--maz-color-bg-lighter)}.maz-dropzone .dz-image img{display:block}.maz-dropzone .dz-image>div[data-dz-thumbnail-bg]{width:inherit;height:inherit;background-size:cover;background-repeat:no-repeat;background-position:center}.maz-dropzone .dz-preview{position:relative;display:inline-block;vertical-align:top;margin:0;min-height:auto;height:100%;background:transparent;max-width:200px;overflow:hidden}.maz-dropzone .dz-preview:not(:last-child){margin-right:.5rem}.maz-dropzone .dz-preview.dz-file-preview .dz-image{border-radius:20px;background:#999;background:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#ddd));background:linear-gradient(to bottom,#eee,#ddd)}.maz-dropzone .dz-preview.dz-file-preview .dz-details{opacity:1}.maz-dropzone .dz-preview.dz-image-preview{background-color:transparent}.maz-dropzone .dz-preview.dz-image-preview .dz-details{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.maz-dropzone .dz-preview .dz-remove{text-align:center;display:block;cursor:pointer;position:absolute;z-index:30;color:#fff;top:inherit;left:5px;right:5px;bottom:5px;padding:10px 5px;border:2px white solid;text-decoration:none;text-transform:uppercase;font-size:.8rem;opacity:0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:var(--maz-border-radius)}.maz-dropzone .dz-preview .dz-remove:hover{background-color:var(--maz-color-white);color:var(--maz-color-primary)}.maz-dropzone .dz-preview:hover{z-index:1000}.maz-dropzone .dz-preview:hover .dz-details,.maz-dropzone .dz-preview:hover .dz-remove{opacity:1}.maz-dropzone .dz-preview:hover .dz-image img{-webkit-transform:scale(1.05,1.05);transform:scale(1.05);-webkit-filter:blur(8px);filter:blur(8px)}.maz-dropzone .dz-preview .dz-error-message{pointer-events:none;z-index:1000;position:absolute;display:block;display:none;opacity:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease;border-radius:8px;top:130px;background:#be2626;background:-webkit-gradient(linear,left top,left bottom,from(#be2626),to(#a92222));background:linear-gradient(to bottom,#be2626,#a92222);padding:.5em 1.2em;color:#fff;margin-left:auto;margin-right:auto;left:0;width:100%;text-align:center}.maz-dropzone .dz-preview .dz-success-mark,.maz-dropzone .dz-preview .dz-error-mark{pointer-events:none;opacity:0;z-index:500;position:absolute;display:block;margin-left:auto;margin-top:auto;width:100%;top:30%;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.maz-dropzone .dz-preview .dz-success-mark .material-icons,.maz-dropzone .dz-preview .dz-error-mark .material-icons{background-color:var(--maz-color-success-alpha);border-radius:50%;color:#fff;font-size:70px}.maz-dropzone .dz-preview .dz-error-mark .material-icons{background-color:var(--maz-color-danger-alpha)}.maz-dropzone .dz-preview.dz-success .dz-success-mark{-webkit-animation:passing-through 3s cubic-bezier(.77,0,.175,1);animation:passing-through 3s cubic-bezier(.77,0,.175,1)}.maz-dropzone .dz-preview.dz-error .dz-error-message{display:block}.maz-dropzone .dz-preview.dz-error .dz-error-mark{opacity:1;-webkit-animation:slide-in 3s cubic-bezier(.77,0,.175,1);animation:slide-in 3s cubic-bezier(.77,0,.175,1)}.maz-dropzone .dz-preview.dz-error .dz-details{background-color:var(--maz-color-danger-alpha)}.maz-dropzone .dz-preview.dz-error:hover .dz-error-message{opacity:1;pointer-events:auto}.maz-dropzone .dz-preview.dz-error .dz-remove:hover{color:var(--maz-color-danger)}.maz-dropzone .dz-preview .dz-progress{opacity:1;z-index:1000;pointer-events:none;position:absolute;height:1rem;top:50%;margin-top:-.5rem;-webkit-transform:scale(1);transform:scale(1);overflow:visible;width:50%;left:25%;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.maz-dropzone .dz-preview .dz-progress .dz-upload{-webkit-transition:width .3s ease-in-out;transition:width .3s ease-in-out;position:absolute;inset:0px;width:0px;border-radius:9999px;background-color:var(--maz-color-success)}.maz-dropzone .dz-preview .dz-progress .progress-title{display:inline-block;position:relative;top:-30px}.maz-dropzone .dz-preview.dz-processing .dz-progress{opacity:1;-webkit-transition:all .2s linear;transition:all .2s linear}.maz-dropzone .dz-preview.dz-complete .dz-progress{opacity:0;-webkit-transition:opacity .4s ease-in;transition:opacity .4s ease-in}.maz-dropzone .dz-preview:not(.dz-processing) .dz-progress{-webkit-animation:pulse 6s ease infinite;animation:pulse 6s ease infinite}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|
|
2
2
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MazDropzone={},e.Vue)}(this,(function(e,t){"use strict";const o=["width","height"],n=[(e=>(t.pushScopeId("data-v-34f40819"),e=e(),t.popScopeId(),e))((()=>t.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)))],s=(e,t)=>{const o=e.__vccOpts||e;for(const[n,s]of t)o[n]=s;return o},l=s(t.defineComponent({__name:"MazSpinner",props:{size:{type:String,default:"2em"},color:{type:String,default:"normal",validator:e=>["normal","info","white","success","warning","danger","primary","black","secondary","transparent"].includes(e)}},setup:e=>(s,l)=>(t.openBlock(),t.createElementBlock("svg",{width:e.size,height:e.size,version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50","xml:space":"preserve",class:t.normalizeClass(["m-spinner",`m-spinner--${e.color}`]),style:{"enable-background":"new 0 0 50 50"}},n,10,o))}),[["__scopeId","data-v-34f40819"]]),a=t.defineComponent({name:"MazDropzone",components:{MazSpinner:l},props:{options:{type:Object,required:!0},height:{type:[Number,String],default:"245px"},width:{type:[Number,String],default:"100%"},noDestroyOnUnmount:{type:Boolean,default:!1}},emits:["thumbnail","error","drop","dragstart","dragend","dragenter","dragover","dragleave","paste","addedfile","addedfiles","removedfile","success","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","canceled","canceledmultiple","complete","completemultiple","maxfilesexceeded","maxfilesreached","queuecomplete","reset"],setup(e,{emit:o}){const n=t.ref(),s=t.ref(!1);let l;const a=t.ref(),r=t.computed((()=>({width:"number"==typeof e.width?`${e.width}px`:e.width,height:"number"==typeof e.height?`${e.height}px`:e.height}))),i=(e,t)=>{let n;o("thumbnail",{file:e,dataUrl:t}),e.previewElement.classList.remove("dz-file-preview");e.previewElement.querySelectorAll("[data-dz-thumbnail-bg]").forEach((o=>{n=o,n.alt=e.name,n.style.backgroundImage=`url('${t}')`})),"success"===e.status&&l.emit("complete",e)},d=(e,t,n)=>{o("error",{file:e,message:t,xhr:n}),l.options.autoRemoveOnError&&setTimeout((()=>l.removeFile(e)),3e3)},p=(e,t,n)=>{o("error",{files:e,message:t,xhr:n}),l.options.autoRemoveOnError&&setTimeout((()=>{for(const t of e)l.removeFile(t)}),3e3)};t.onMounted((async()=>{const t={parallelUploads:e.options.maxFiles,previewTemplate:'<div class="dz-preview dz-file-preview maz-flex-1">\n <div class="dz-image">\n <div data-dz-thumbnail-bg></div>\n </div>\n <div class="dz-details">\n <div class="dz-filename"><span data-dz-name></span></div>\n <div class="dz-size"><span data-dz-size></span></div>\n </div>\n <div class="dz-progress">\n <span class="dz-upload" data-dz-uploadprogress></span>\n </div>\n <div class="dz-success-mark">\n <svg class="material-icons" xmlns="http://www.w3.org/2000/svg" height="6rem" viewBox="0 0 24 24" width="6rem" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/></svg>\n </div>\n <div class="dz-error-mark">\n <svg class="material-icons" xmlns="http://www.w3.org/2000/svg" height="6rem" viewBox="0 0 24 24" width="6rem" fill="currentColor"><path d="M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/></svg>\n </div>\n</div>',addRemoveLinks:!0};if(n.value){const{default:r}=await import("dropzone");l=new r(n.value,{...t,...e.options}),l&&(a.value=l.options,s.value=!0,l.on("thumbnail",i),l.on("error",d),l.on("errormultiple",p),l.on("drop",(e=>o("drop",e))),l.on("dragstart",(e=>o("dragstart",e))),l.on("dragend",(e=>o("dragend",e))),l.on("dragenter",(e=>o("dragenter",e))),l.on("dragover",(e=>o("dragover",e))),l.on("dragleave",(e=>o("dragleave",e))),l.on("paste",(e=>o("paste",e))),l.on("addedfile",(e=>o("addedfile",e))),l.on("addedfiles",(e=>o("addedfiles",e))),l.on("removedfile",(e=>o("removedfile",e))),l.on("success",((e,t)=>o("success",{file:e,response:t}))),l.on("successmultiple",((e,t)=>o("success",{files:e,responseText:t}))),l.on("processing",(e=>o("processing",e))),l.on("processingmultiple",(e=>o("processingmultiple",e))),l.on("uploadprogress",((e,t,n)=>o("uploadprogress",{file:e,progress:t,bytesSent:n}))),l.on("totaluploadprogress",((e,t,n)=>o("totaluploadprogress",{totalProgress:e,totalBytes:t,totalBytesSent:n}))),l.on("sending",((e,t,n)=>o("sending",{file:e,xhr:t,formData:n}))),l.on("sendingmultiple",((e,t,n)=>o("sendingmultiple",{files:e,xhr:t,formData:n}))),l.on("canceled",(e=>o("canceled",e))),l.on("canceledmultiple",(e=>o("canceledmultiple",e))),l.on("complete",(e=>o("complete",e))),l.on("completemultiple",(e=>o("completemultiple",e))),l.on("maxfilesexceeded",(e=>o("maxfilesexceeded",e))),l.on("maxfilesreached",(e=>o("maxfilesreached",e))),l.on("queuecomplete",(()=>{c().every((e=>e.manuallyAdded))||o("queuecomplete")})),l.on("reset",(()=>o("reset"))))}}));const c=()=>l.getAcceptedFiles();return t.onBeforeUnmount((()=>{e.noDestroyOnUnmount||l.destroy()})),{ButtonElement:n,dropzoneReady:s,dropzoneOptions:a,dropzoneStyle:r,setOption:(e,t)=>(l.options={...l.options,[e]:t},l.options),manuallyAddFile:(e,t)=>{l.emit("addedfile",e),l.emit("thumbnail",e,t),l.files.push(e)},removeAllFiles:e=>l.removeAllFiles(e),processQueue:()=>l.processQueue(),destroy:()=>l.destroy(),disable:()=>l.disable(),enable:()=>l.enable(),accept:(e,t)=>l.accept(e,t),addFile:e=>l.addFile(e),resizeImage:(e,t,o,n,s)=>l.resizeImage(e,t,o,n,s),cancelUpload:e=>l.cancelUpload(e),getAcceptedFiles:c,getRejectedFiles:()=>l.getRejectedFiles(),getFilesWithStatus:()=>l.getFilesWithStatus(status),getQueuedFiles:()=>l.getQueuedFiles(),getUploadingFiles:()=>l.getUploadingFiles(),getAddedFiles:()=>l.getAddedFiles(),getActiveFiles:()=>l.getActiveFiles()}}}),r={class:"dz-message"},i=t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",height:"2em",width:"2em",viewBox:"0 0 24 24",fill:"currentColor",class:"maz-dropzone__main-icon maz-text-normal","aria-hidden":"true"},[t.createElementVNode("path",{d:"M0 0h24v24H0V0z",fill:"none"}),t.createElementVNode("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"})],-1),d={class:"maz-my-2 maz-text-normal"},p={class:"maz-my-0 maz-text-muted"};const c=s(a,[["render",function(e,o,n,s,l,a){const c=t.resolveComponent("MazSpinner");return t.openBlock(),t.createElementBlock("button",{ref:"ButtonElement",type:"button",name:"maz-dropzone",class:"maz-dropzone",style:t.normalizeStyle([e.dropzoneStyle])},[e.dropzoneReady?t.renderSlot(e.$slots,"default",{key:0,options:e.dropzoneOptions},(()=>{var o,n;return[t.createElementVNode("div",r,[t.renderSlot(e.$slots,"icon",{},(()=>[i])),t.createElementVNode("p",d,t.toDisplayString(null==(o=e.dropzoneOptions)?void 0:o.dictDefaultMessage),1),t.createElementVNode("p",p,t.toDisplayString(null==(n=e.dropzoneOptions)?void 0:n.dictFilesDescriptions),1)])]})):(t.openBlock(),t.createBlock(c,{key:1}))],4)}]]);e.default=c,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** __vue_virtual_code_placeholder */
|
|
1
2
|
import { type PropType } from 'vue';
|
|
2
3
|
import type { MazGalleryImage } from './types';
|
|
3
4
|
export type { MazGalleryImage } from './types';
|
|
@@ -54,26 +55,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
55
|
type: BooleanConstructor;
|
|
55
56
|
default: boolean;
|
|
56
57
|
};
|
|
57
|
-
}, {
|
|
58
|
-
sizeStyle: import("vue").ComputedRef<{
|
|
59
|
-
height?: string | undefined;
|
|
60
|
-
minHeight?: string | undefined;
|
|
61
|
-
flex?: string | number | undefined;
|
|
62
|
-
width?: string | undefined;
|
|
63
|
-
}>;
|
|
64
|
-
imagesCount: import("vue").ComputedRef<number>;
|
|
65
|
-
shouldHaveRemainingLayer: (index: number) => boolean | 0;
|
|
66
|
-
imagesShown: import("vue").ComputedRef<{
|
|
67
|
-
src: string;
|
|
68
|
-
alt?: string | undefined;
|
|
69
|
-
}[]>;
|
|
70
|
-
numberImagesRemaining: import("vue").ComputedRef<number>;
|
|
71
|
-
imagesHidden: import("vue").ComputedRef<{
|
|
72
|
-
src: string;
|
|
73
|
-
alt?: string | undefined;
|
|
74
|
-
}[]>;
|
|
75
|
-
NoPhotographyIcon: string;
|
|
76
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
77
59
|
images: {
|
|
78
60
|
type: PropType<MazGalleryImage[]>;
|
|
79
61
|
default: () => never[];
|
|
@@ -129,12 +111,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
129
111
|
}>>, {
|
|
130
112
|
lazy: boolean;
|
|
131
113
|
blur: boolean;
|
|
114
|
+
width: string | number;
|
|
115
|
+
height: string | number;
|
|
132
116
|
images: MazGalleryImage[];
|
|
133
117
|
imagesShownCount: number;
|
|
134
118
|
noRemaining: boolean;
|
|
135
|
-
height: string | number;
|
|
136
119
|
noHeight: boolean;
|
|
137
|
-
width: string | number;
|
|
138
120
|
noWidth: boolean;
|
|
139
121
|
noRadius: boolean;
|
|
140
122
|
noZoom: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".m-gallery[data-v-b0789787]{position:relative;overflow:hidden}.m-gallery__hidden[data-v-b0789787]{display:none}.m-gallery__item[data-v-b0789787]{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-b0789787]{left:0;height:100%}.m-gallery__item--1[data-v-b0789787]:not(:last-child){width:50%}.m-gallery__item--2[data-v-b0789787]{left:50%;width:50%;height:50%}.m-gallery__item--2[data-v-b0789787]:last-child{height:100%}.m-gallery__item--2[data-v-b0789787]:nth-last-child(4){width:25%}.m-gallery__item--3[data-v-b0789787]{top:50%;left:50%;width:25%}.m-gallery__item--3[data-v-b0789787]:last-child{width:50%}.m-gallery__item--3[data-v-b0789787]:nth-last-child(3){top:0;left:75%}.m-gallery__item--4[data-v-b0789787]{border-top-width:2px;border-color:transparent;top:50%;left:50%;width:25%}.m-gallery__item--4[data-v-b0789787]:last-child{left:75%;width:25%}.m-gallery__item--5[data-v-b0789787]{border-top-width:2px;border-color:transparent;top:50%;left:75%;width:25%}.m-gallery__item[data-v-b0789787]:first-child{border-left:0}.m-gallery__item--3[data-v-b0789787]:last-child,.m-gallery__item--3[data-v-b0789787]:nth-last-child(2),.m-gallery__item--4[data-v-b0789787]:last-child,.m-gallery__item--5[data-v-b0789787]{border-top-width:2px;border-color:transparent}.m-gallery__item__image[data-v-b0789787]{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-b0789787]{position:absolute;inset:0}.m-gallery__remaining-layer a span[data-v-b0789787]{color:#fff;font-size:2rem}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => {
|
|
5
5
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
6
|
return value;
|
|
7
7
|
};
|
|
8
|
-
import { inject, defineComponent, ref, computed, onMounted, watchEffect, openBlock, createElementBlock, Fragment, createCommentVNode, mergeProps, nextTick, onBeforeMount,
|
|
8
|
+
import { inject, defineComponent, ref, computed, onMounted, watchEffect, openBlock, createElementBlock, Fragment, createCommentVNode, mergeProps, nextTick, onBeforeMount, normalizeClass, normalizeStyle, unref, createElementVNode, renderList, withDirectives, toDisplayString, createVNode } from "vue";
|
|
9
9
|
const style = `
|
|
10
10
|
.maz-zoom-img {
|
|
11
11
|
position: fixed;
|
|
@@ -470,6 +470,7 @@ class LazyImg {
|
|
|
470
470
|
const dataSrc = this.getImgElement(el).getAttribute("data-src");
|
|
471
471
|
if (dataSrc)
|
|
472
472
|
return dataSrc;
|
|
473
|
+
binding.value;
|
|
473
474
|
const bindingSrc = typeof binding.value === "object" ? binding.value.src : binding.value;
|
|
474
475
|
if (!bindingSrc)
|
|
475
476
|
console.warn(`[maz-ui][MazLazyImg] src url is not defined`);
|
|
@@ -791,12 +792,15 @@ const noPhotography = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin
|
|
|
791
792
|
__proto__: null,
|
|
792
793
|
default: NoPhotographyIcon
|
|
793
794
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
795
|
+
const _hoisted_1 = { class: "m-gallery__wrapper maz-flex maz-flex-1" };
|
|
796
|
+
const _hoisted_2 = ["alt"];
|
|
797
|
+
const _hoisted_3 = {
|
|
798
|
+
key: 0,
|
|
799
|
+
class: "m-gallery__remaining-layer maz-flex maz-bg-overlay maz-flex-center"
|
|
800
|
+
};
|
|
801
|
+
const _hoisted_4 = { class: "maz-text-2xl maz-text-white" };
|
|
802
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
803
|
+
__name: "MazGallery",
|
|
800
804
|
props: {
|
|
801
805
|
// Array of string or object: `['https://via.placeholder.com/500', 'https://via.placeholder.com/600']` or `[{ slug: 'https://via.placeholder.com/500', alt: 'image descripton' }, { slug: 'https://via.placeholder.com/600', alt: 'image descripton' }]`
|
|
802
806
|
images: {
|
|
@@ -828,7 +832,9 @@ const _sfc_main = defineComponent({
|
|
|
828
832
|
// Scale animation effect on image hover
|
|
829
833
|
scale: { type: Boolean, default: true }
|
|
830
834
|
},
|
|
831
|
-
setup(
|
|
835
|
+
setup(__props) {
|
|
836
|
+
const props = __props;
|
|
837
|
+
const lazyImgArgument = "bg-image";
|
|
832
838
|
onBeforeMount(() => {
|
|
833
839
|
if (props.imagesShownCount > 5)
|
|
834
840
|
console.warn('[MazUI](m-gallery) The maximum of "images-shown-count" is 5');
|
|
@@ -866,18 +872,106 @@ const _sfc_main = defineComponent({
|
|
|
866
872
|
const shouldHaveRemainingLayer = (index) => {
|
|
867
873
|
return numberImagesRemaining.value && index + 1 === imagesShown.value.length && !props.noRemaining;
|
|
868
874
|
};
|
|
869
|
-
return {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
875
|
+
return (_ctx, _cache) => {
|
|
876
|
+
return __props.images.length > 0 || __props.hasEmptyLayer ? (openBlock(), createElementBlock(
|
|
877
|
+
"div",
|
|
878
|
+
{
|
|
879
|
+
key: 0,
|
|
880
|
+
class: normalizeClass(["m-gallery maz-flex", { "maz-rounded": !__props.noRadius }]),
|
|
881
|
+
style: normalizeStyle([unref(sizeStyle)])
|
|
882
|
+
},
|
|
883
|
+
[
|
|
884
|
+
createElementVNode("section", _hoisted_1, [
|
|
885
|
+
(openBlock(true), createElementBlock(
|
|
886
|
+
Fragment,
|
|
887
|
+
null,
|
|
888
|
+
renderList(unref(imagesShown), (image, i) => {
|
|
889
|
+
return openBlock(), createElementBlock(
|
|
890
|
+
"figure",
|
|
891
|
+
{
|
|
892
|
+
key: i,
|
|
893
|
+
class: normalizeClass(["m-gallery__item !maz-my-0 maz-flex maz-flex-center", [`m-gallery__item--${i + 1}`]])
|
|
894
|
+
},
|
|
895
|
+
[
|
|
896
|
+
withDirectives(createElementVNode("img", {
|
|
897
|
+
class: "m-gallery__item__image maz-flex-1",
|
|
898
|
+
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
899
|
+
alt: image.alt,
|
|
900
|
+
loading: "lazy"
|
|
901
|
+
}, null, 8, _hoisted_2), [
|
|
902
|
+
[unref(vZoomImg), {
|
|
903
|
+
src: image.src,
|
|
904
|
+
alt: image.alt,
|
|
905
|
+
disabled: __props.noZoom || shouldHaveRemainingLayer(i),
|
|
906
|
+
blur: __props.blur,
|
|
907
|
+
scale: __props.scale
|
|
908
|
+
}],
|
|
909
|
+
[unref(vLazyImg), { src: image.src, disabled: !__props.lazy }, lazyImgArgument]
|
|
910
|
+
]),
|
|
911
|
+
shouldHaveRemainingLayer(i) ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [
|
|
912
|
+
createElementVNode(
|
|
913
|
+
"span",
|
|
914
|
+
_hoisted_4,
|
|
915
|
+
"+" + toDisplayString(unref(numberImagesRemaining)),
|
|
916
|
+
1
|
|
917
|
+
/* TEXT */
|
|
918
|
+
)
|
|
919
|
+
])), [
|
|
920
|
+
[unref(vZoomImg), {
|
|
921
|
+
src: image.src,
|
|
922
|
+
alt: image.alt,
|
|
923
|
+
disabled: __props.noZoom,
|
|
924
|
+
blur: false,
|
|
925
|
+
scale: __props.scale
|
|
926
|
+
}]
|
|
927
|
+
]) : createCommentVNode("v-if", true)
|
|
928
|
+
],
|
|
929
|
+
2
|
|
930
|
+
/* CLASS */
|
|
931
|
+
);
|
|
932
|
+
}),
|
|
933
|
+
128
|
|
934
|
+
/* KEYED_FRAGMENT */
|
|
935
|
+
)),
|
|
936
|
+
__props.hasEmptyLayer && __props.images.length === 0 ? (openBlock(), createElementBlock(
|
|
937
|
+
"div",
|
|
938
|
+
{
|
|
939
|
+
key: 0,
|
|
940
|
+
class: normalizeClass(["flex-center maz-flex maz-w-full maz-bg-color-light maz-text-normal", { "maz-rounded-xl": !__props.noRadius }]),
|
|
941
|
+
style: normalizeStyle([unref(sizeStyle)])
|
|
942
|
+
},
|
|
943
|
+
[
|
|
944
|
+
createVNode(_sfc_main$1, {
|
|
945
|
+
src: unref(NoPhotographyIcon),
|
|
946
|
+
size: "2rem"
|
|
947
|
+
}, null, 8, ["src"])
|
|
948
|
+
],
|
|
949
|
+
6
|
|
950
|
+
/* CLASS, STYLE */
|
|
951
|
+
)) : createCommentVNode("v-if", true)
|
|
952
|
+
]),
|
|
953
|
+
(openBlock(true), createElementBlock(
|
|
954
|
+
Fragment,
|
|
955
|
+
null,
|
|
956
|
+
renderList(unref(imagesHidden), (image, i) => {
|
|
957
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
958
|
+
key: i,
|
|
959
|
+
class: "m-gallery__hidden"
|
|
960
|
+
})), [
|
|
961
|
+
[unref(vZoomImg), { src: image.src, disabled: __props.noZoom }]
|
|
962
|
+
]);
|
|
963
|
+
}),
|
|
964
|
+
128
|
|
965
|
+
/* KEYED_FRAGMENT */
|
|
966
|
+
))
|
|
967
|
+
],
|
|
968
|
+
6
|
|
969
|
+
/* CLASS, STYLE */
|
|
970
|
+
)) : createCommentVNode("v-if", true);
|
|
877
971
|
};
|
|
878
972
|
}
|
|
879
973
|
});
|
|
880
|
-
const
|
|
974
|
+
const MazGallery_vue_vue_type_style_index_0_scoped_b0789787_lang = "";
|
|
881
975
|
const _export_sfc = (sfc, props) => {
|
|
882
976
|
const target = sfc.__vccOpts || sfc;
|
|
883
977
|
for (const [key, val] of props) {
|
|
@@ -885,114 +979,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
885
979
|
}
|
|
886
980
|
return target;
|
|
887
981
|
};
|
|
888
|
-
const
|
|
889
|
-
const _hoisted_2 = ["alt"];
|
|
890
|
-
const _hoisted_3 = {
|
|
891
|
-
key: 0,
|
|
892
|
-
class: "m-gallery__remaining-layer maz-flex maz-bg-overlay maz-flex-center"
|
|
893
|
-
};
|
|
894
|
-
const _hoisted_4 = { class: "maz-text-2xl maz-text-white" };
|
|
895
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
896
|
-
const _component_MazIcon = resolveComponent("MazIcon");
|
|
897
|
-
const _directive_zoom_img = resolveDirective("zoom-img");
|
|
898
|
-
const _directive_lazy_img = resolveDirective("lazy-img");
|
|
899
|
-
return _ctx.images.length > 0 || _ctx.hasEmptyLayer ? (openBlock(), createElementBlock(
|
|
900
|
-
"div",
|
|
901
|
-
{
|
|
902
|
-
key: 0,
|
|
903
|
-
class: normalizeClass(["m-gallery maz-flex", { "maz-rounded": !_ctx.noRadius }]),
|
|
904
|
-
style: normalizeStyle([_ctx.sizeStyle])
|
|
905
|
-
},
|
|
906
|
-
[
|
|
907
|
-
createElementVNode("section", _hoisted_1, [
|
|
908
|
-
(openBlock(true), createElementBlock(
|
|
909
|
-
Fragment,
|
|
910
|
-
null,
|
|
911
|
-
renderList(_ctx.imagesShown, (image, i) => {
|
|
912
|
-
return openBlock(), createElementBlock(
|
|
913
|
-
"figure",
|
|
914
|
-
{
|
|
915
|
-
key: i,
|
|
916
|
-
class: normalizeClass(["m-gallery__item !maz-my-0 maz-flex maz-flex-center", [`m-gallery__item--${i + 1}`]])
|
|
917
|
-
},
|
|
918
|
-
[
|
|
919
|
-
withDirectives(createElementVNode("img", {
|
|
920
|
-
class: "m-gallery__item__image maz-flex-1",
|
|
921
|
-
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
922
|
-
alt: image.alt,
|
|
923
|
-
loading: "lazy"
|
|
924
|
-
}, null, 8, _hoisted_2), [
|
|
925
|
-
[_directive_zoom_img, {
|
|
926
|
-
src: image.src,
|
|
927
|
-
alt: image.alt,
|
|
928
|
-
disabled: _ctx.noZoom || _ctx.shouldHaveRemainingLayer(i),
|
|
929
|
-
blur: _ctx.blur,
|
|
930
|
-
scale: _ctx.scale
|
|
931
|
-
}],
|
|
932
|
-
[_directive_lazy_img, { src: image.src, disabled: !_ctx.lazy }, "bg-image"]
|
|
933
|
-
]),
|
|
934
|
-
_ctx.shouldHaveRemainingLayer(i) ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [
|
|
935
|
-
createElementVNode(
|
|
936
|
-
"span",
|
|
937
|
-
_hoisted_4,
|
|
938
|
-
"+" + toDisplayString(_ctx.numberImagesRemaining),
|
|
939
|
-
1
|
|
940
|
-
/* TEXT */
|
|
941
|
-
)
|
|
942
|
-
])), [
|
|
943
|
-
[_directive_zoom_img, {
|
|
944
|
-
src: image.src,
|
|
945
|
-
alt: image.alt,
|
|
946
|
-
disabled: _ctx.noZoom,
|
|
947
|
-
blur: false,
|
|
948
|
-
scale: _ctx.scale
|
|
949
|
-
}]
|
|
950
|
-
]) : createCommentVNode("v-if", true)
|
|
951
|
-
],
|
|
952
|
-
2
|
|
953
|
-
/* CLASS */
|
|
954
|
-
);
|
|
955
|
-
}),
|
|
956
|
-
128
|
|
957
|
-
/* KEYED_FRAGMENT */
|
|
958
|
-
)),
|
|
959
|
-
_ctx.hasEmptyLayer && _ctx.images.length === 0 ? (openBlock(), createElementBlock(
|
|
960
|
-
"div",
|
|
961
|
-
{
|
|
962
|
-
key: 0,
|
|
963
|
-
class: normalizeClass(["flex-center maz-flex maz-w-full maz-bg-color-light maz-text-normal", { "maz-rounded-xl": !_ctx.noRadius }]),
|
|
964
|
-
style: normalizeStyle([_ctx.sizeStyle])
|
|
965
|
-
},
|
|
966
|
-
[
|
|
967
|
-
createVNode(_component_MazIcon, {
|
|
968
|
-
src: _ctx.NoPhotographyIcon,
|
|
969
|
-
size: "2rem"
|
|
970
|
-
}, null, 8, ["src"])
|
|
971
|
-
],
|
|
972
|
-
6
|
|
973
|
-
/* CLASS, STYLE */
|
|
974
|
-
)) : createCommentVNode("v-if", true)
|
|
975
|
-
]),
|
|
976
|
-
(openBlock(true), createElementBlock(
|
|
977
|
-
Fragment,
|
|
978
|
-
null,
|
|
979
|
-
renderList(_ctx.imagesHidden, (image, i) => {
|
|
980
|
-
return withDirectives((openBlock(), createElementBlock("div", {
|
|
981
|
-
key: i,
|
|
982
|
-
class: "m-gallery__hidden"
|
|
983
|
-
})), [
|
|
984
|
-
[_directive_zoom_img, { src: image.src, disabled: _ctx.noZoom }]
|
|
985
|
-
]);
|
|
986
|
-
}),
|
|
987
|
-
128
|
|
988
|
-
/* KEYED_FRAGMENT */
|
|
989
|
-
))
|
|
990
|
-
],
|
|
991
|
-
6
|
|
992
|
-
/* CLASS, STYLE */
|
|
993
|
-
)) : createCommentVNode("v-if", true);
|
|
994
|
-
}
|
|
995
|
-
const MazGallery = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e9dc5a9e"]]);
|
|
982
|
+
const MazGallery = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b0789787"]]);
|
|
996
983
|
export {
|
|
997
984
|
MazGallery as default
|
|
998
985
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MazGallery={},e.Vue)}(this,(function(e,t){"use strict";var s=Object.defineProperty,o=(e,t,o)=>(((e,t,o)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o})(e,"symbol"!=typeof t?t+"":t,o),o);const n={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 i{constructor(e){if(o(this,"options"),o(this,"loader"),o(this,"wrapper"),o(this,"img"),o(this,"keydownHandler"),o(this,"onImgLoadedCallback"),o(this,"buttonsAdded"),o(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1}),o(this,"mouseEnterListener"),o(this,"mouseLeaveListener"),o(this,"renderPreviewListener"),!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if("object"==typeof e.value&&!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,..."object"==typeof e.value?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-src",this.options.src),this.options.alt&&e.setAttribute("data-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-src"),e.removeAttribute("data-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle("\n.maz-zoom-img {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1rem;\n z-index: 1050;\n background-color: hsla(238, 15%, 40%, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n\n.maz-zoom-img,\n.maz-zoom-img * {\n box-sizing: border-box;\n}\n\n.maz-zoom-img .maz-zoom-img__wrapper {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 0;\n min-height: 0;\n max-width: 100%;\n max-height: 100%;\n transition: all 300ms ease-in-out;\n opacity: 0;\n transform: scale(0.5);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {\n opacity: 1;\n transform: scale(1);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: hsla(238, 15%, 40%, 0.7);\n border-radius: 1rem;\n z-index: 2;\n min-width: 60px;\n min-height: 60px;\n}\n.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {\n display: none;\n}\n\n@-webkit-keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {\n animation: spin .6s linear infinite;\n}\n\n.maz-zoom-img img {\n max-width: 100%;\n max-height: 100%;\n min-width: 0;\n border-radius: 1rem;\n}\n\n.maz-zoom-img .maz-zoom-btn {\n margin: 0 auto;\n border: none;\n background-color: hsla(0, 0%, 7%, 0.5);\n box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);\n height: 2.2rem;\n min-height: 2.2rem;\n width: 2.2rem;\n min-width: 2.2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2.2rem;\n cursor: pointer;\n flex: 0 0 auto;\n outline: none;\n}\n\n.maz-zoom-img .maz-zoom-btn svg {\n fill: white;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {\n position: absolute;\n left: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {\n position: absolute;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn:hover {\n background-color: hsl(0, 0%, 0%);\n}");const s=document.createElement("div");s.classList.add("maz-zoom-img"),s.setAttribute("id","MazImgPreviewFullsize"),s.addEventListener("click",(e=>{s.isEqualNode(e.target)&&this.closePreview()})),"object"==typeof t&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),s.append(this.wrapper),document.body.append(s),this.keyboardEventHandler(!0),setTimeout((()=>{s&&s.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=[],s=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,s){const e=this.getButton("previous"),s=this.getButton("next");t.push(e,s)}this.wrapper.append(e),s&&(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=n.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(),"Escape"!==e.key&&" "!==e.key||this.closePreview(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||this.nextPreviousImage("ArrowRight"===e.key)}getButton(e="close"){const t=document.createElement("button");return t.innerHTML=n[e],t.addEventListener("click",(()=>{"close"===e?this.closePreview():this.allInstances&&this.nextPreviousImage("next"===e)})),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),s=document.querySelector(".maz-zoom-img-instance.maz-is-open");s&&s.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,s=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(s){const e=this.allInstances.indexOf(s),o=t?e+1:e-1,n=this.allInstances[this.getNewInstanceIndex(o)];n&&this.useNextInstance(s,n)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const s=t.getAttribute("data-src"),o=t.getAttribute("data-alt");this.wrapper.style.width="",this.loader.hidden=!1,s&&this.img.setAttribute("src",s),o&&this.img.setAttribute("alt",o)}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 a;const r={created(e,t){a=new i(t),a.create(e)},updated(e,t){a.update(t)},unmounted(e){a.remove(e)}},l={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 m{constructor(e={}){o(this,"observers",[]),o(this,"defaultOptions",l),o(this,"options"),o(this,"onImgLoadedCallback"),o(this,"onImgErrorCallback"),o(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((()=>p));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,s;this.addClass(e,this.options.loadingClass),null==(s=(t=this.options).onLoading)||s.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,s;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),null==(s=(t=this.options).onLoaded)||s.call(t,e)}imageHasError(e,t){var s,o;console.warn("[maz-ui][MazLazyImg] Error while loading image",t),this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),null==(o=(s=this.options).onError)||o.call(s,e),this.setDefaultPhoto(e)}getImageUrl(e,t){const s=this.getImgElement(e).getAttribute("data-src");if(s)return s;const o="object"==typeof t.value?t.value.src:t.value;return o||console.warn("[maz-ui][MazLazyImg] src url is not defined"),o}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const s of t){const e=s.getAttribute("data-srcset");e?s.srcset=e:console.warn('[maz-ui][MazLazyImg] the "[data-srcset]" attribute is not provided on "<source />"')}else console.warn('[maz-ui][MazLazyImg] No "<source />" elements provided into the "<picture />" element'),this.imageHasError(e)}hasBgImgMode(e){return"bg-image"===e.arg}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.errorPhoto??await this.loadErrorPhoto(),s=e.querySelectorAll("source");if(s.length>0)for await(const o of s)o.srcset=t;else this.setImgSrc(e,t)}addEventListenerToImg(e){const t=this.getImgElement(e);t.addEventListener("load",(()=>this.onImgLoadedCallback(e)),{once:!0}),t.addEventListener("error",(t=>this.onImgErrorCallback(e,t)),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const s=this.getImageUrl(e,t);if(!s)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${s}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,s))}}setImgSrc(e,t){this.getImgElement(e).src=t}handleIntersectionObserver(e,t,s,o){var n,i;this.observers.push(o);for(const a of s)if(a.isIntersecting){if(null==(i=(n=this.options).onIntersecting)||i.call(n,a.target),this.options.observerOnce&&o.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const s=this.options.observerOptions;new IntersectionObserver(((s,o)=>{this.handleIntersectionObserver(e,t,s,o)}),s).observe(e)}async imageHandler(e,t,s){if("update"===s)for await(const o of this.observers)o.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,s){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,s)}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,"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),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 s of this.observers)s.unobserve(e);this.observers=[]}}let d;const c={created(e,t){const s="object"==typeof t.value?t.value:{};d=new m(s),d.add(e,t)},updated(e,t){d.update(e,t)},unmounted(e,t){d.remove(e,t)}};const u=["innerHTML"],h=t.defineComponent({__name:"MazIcon",props:{src:{type:String,default:void 0},path:{type:String,default:void 0},name:{type:String,default:void 0},size:{type:String,default:"1.5rem"},title:{type:String,default:void 0},transformSource:{type:Function,default:e=>e}},emits:["loaded","unloaded","error"],setup(e,{emit:s}){const o=e,n={},i=t.ref(),a=t.ref(),r=()=>{try{return function(e,s){const o=t.inject(e,s);if(!o)throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${e}`);return o}("mazIconPath")}catch{return}},l=t.computed((()=>o.path??r())),m=t.computed((()=>o.src?o.src:l.value?`${l.value}/${o.name}.svg`:`/${o.name}.svg`));t.onMounted((()=>{o.name||o.src||console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop')}));const d=e=>{const t={},s=e.attributes;if(!s)return t;for(let o=s.length-1;o>=0;o--)t[s[o].name]=s[o].value;return t},c=e=>{let t=e.cloneNode(!0);return t=o.transformSource(e),o.title&&((e,t)=>{const s=e.querySelectorAll("title");if(s.length>0)s[0].textContent=t;else{const s=document.createElementNS("http://www.w3.org/2000/svg","title");s.textContent=t,e.append(s)}})(t,o.title),e.innerHTML},h=e=>new Promise(((t,s)=>{const n=new XMLHttpRequest;n.open("GET",e,!0),n.addEventListener("load",(()=>{if(n.status>=200&&n.status<400)try{const e=new DOMParser;let i=e.parseFromString(n.responseText,"text/xml").querySelectorAll("svg")[0];i?(i=o.transformSource(i),t(i)):s(new Error('Loaded file is not valid SVG"'))}catch(e){s(e)}else s(new Error("Error loading SVG"))})),n.addEventListener("error",(()=>s())),n.send()}));return t.watchEffect((()=>(async e=>{n[e]||(n[e]=h(e));try{i.value=await n[e],await t.nextTick(),s("loaded",a.value)}catch(o){i.value&&(i.value=void 0,s("unloaded")),delete n[e],s("error",o)}})(m.value))),(s,o)=>{return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createCommentVNode(" eslint-disable vue/no-v-html "),t.createCommentVNode(" eslint-disable vue/html-self-closing "),i.value?(t.openBlock(),t.createElementBlock("svg",t.mergeProps({key:0,ref_key:"svgElem",ref:a,width:"1em",height:"1em"},{...d(i.value),...(n=s.$attrs,Object.keys(n).reduce(((e,t)=>(!1!==n[t]&&null!==n[t]&&void 0!==n[t]&&(e[t]=n[t]),e)),{}))},{style:`font-size: ${e.size}`,innerHTML:c(i.value)}),null,16,u)):t.createCommentVNode("v-if",!0),t.createCommentVNode(" eslint-enable vue/no-v-html "),t.createCommentVNode(" eslint-enable vue/html-self-closing ")],2112);var n}}}),g="data:image/svg+xml;base64,PHN2ZwogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB2aWV3Qm94PSIwIDAgMjQgMjQiCiAgc3Ryb2tlPSJub25lIgogIGZpbGw9ImN1cnJlbnRDb2xvciIKICBhcmlhLWhpZGRlbj0idHJ1ZSIKPgogIDxnPgogICAgPHJlY3QgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0IiAvPgogICAgPGc+CiAgICAgIDxwYXRoCiAgICAgICAgZD0iTTguOSw2LjA3TDcuNDgsNC42Nkw5LDNoNmwxLjgzLDJIMjBjMS4xLDAsMiwwLjksMiwydjEyYzAsMC4wNS0wLjAxLDAuMS0wLjAyLDAuMTZMMjAsMTcuMTdWN2gtNC4wNWwtMS44My0ySDkuODggTDguOSw2LjA3eiBNMjAuNDksMjMuMzFMMTguMTcsMjFINGMtMS4xLDAtMi0wLjktMi0yVjdjMC0wLjU5LDAuMjctMS4xMiwwLjY4LTEuNDlsLTItMkwyLjEsMi4xbDE5LjgsMTkuOEwyMC40OSwyMy4zMXogTTkuMTksMTIuMDJDOS4wOCwxMi4zMyw5LDEyLjY1LDksMTNjMCwxLjY2LDEuMzQsMywzLDNjMC4zNSwwLDAuNjctMC4wOCwwLjk4LTAuMTlMOS4xOSwxMi4wMnogTTE2LjE3LDE5bC0xLjY4LTEuNjggQzEzLjc2LDE3Ljc1LDEyLjkxLDE4LDEyLDE4Yy0yLjc2LDAtNS0yLjI0LTUtNWMwLTAuOTEsMC4yNS0xLjc2LDAuNjgtMi40OUw0LjE3LDdINHYxMkgxNi4xN3ogTTE0LjgxLDExLjk4bDIuMDcsMi4wNyBDMTYuOTYsMTMuNzEsMTcsMTMuMzYsMTcsMTNjMC0yLjc2LTIuMjQtNS01LTVjLTAuMzYsMC0wLjcxLDAuMDQtMS4wNiwwLjEybDIuMDcsMi4wN0MxMy44NSwxMC40OSwxNC41MSwxMS4xNSwxNC44MSwxMS45OHoiCiAgICAgIC8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K",p=Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"})),v=t.defineComponent({components:{MazIcon:h},directives:{"zoom-img":r,"lazy-img":c},props:{images:{type:Array,default:()=>[]},imagesShownCount:{type:Number,default:5},noRemaining:{type:Boolean,default:!1},height:{type:[Number,String],default:150},noHeight:{type:Boolean,default:!1},width:{type:[Number,String],default:"100%"},noWidth:{type:Boolean,default:!1},noRadius:{type:Boolean,default:!1},noZoom:{type:Boolean,default:!1},hasEmptyLayer:{type:Boolean,default:!0},lazy:{type:Boolean,default:!0},blur:{type:Boolean,default:!0},scale:{type:Boolean,default:!0}},setup(e){t.onBeforeMount((()=>{e.imagesShownCount>5&&console.warn('[MazUI](m-gallery) The maximum of "images-shown-count" is 5')}));const s=t.computed((()=>{const{height:t,width:s,noWidth:o,noHeight:n}=e;return{...o?{}:{flex:"0 0 "+typeof s=="number"?`${s}px`:s,width:"number"==typeof s?`${s}px`:s},...n?{}:{height:"number"==typeof t?`${t}px`:`${t}`,minHeight:"number"==typeof t?`${t}px`:`${t}`}}})),o=t.computed((()=>e.imagesShownCount<=5?e.imagesShownCount:5)),n=t.computed((()=>e.images.length-(e.images.length<o.value?e.images.length:o.value))),i=t.computed((()=>e.images.map((e=>"object"==typeof e?e:{src:e,alt:void 0})))),a=t.computed((()=>i.value.slice(0,o.value))),r=t.computed((()=>i.value.slice(o.value,e.images.length)));return{sizeStyle:s,imagesCount:o,shouldHaveRemainingLayer:t=>n.value&&t+1===a.value.length&&!e.noRemaining,imagesShown:a,numberImagesRemaining:n,imagesHidden:r,NoPhotographyIcon:g}}}),z={class:"m-gallery__wrapper maz-flex maz-flex-1"},y=["alt"],w={key:0,class:"m-gallery__remaining-layer maz-flex maz-bg-overlay maz-flex-center"},b={class:"maz-text-2xl maz-text-white"};const L=((e,t)=>{const s=e.__vccOpts||e;for(const[o,n]of t)s[o]=n;return s})(v,[["render",function(e,s,o,n,i,a){const r=t.resolveComponent("MazIcon"),l=t.resolveDirective("zoom-img"),m=t.resolveDirective("lazy-img");return e.images.length>0||e.hasEmptyLayer?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["m-gallery maz-flex",{"maz-rounded":!e.noRadius}]),style:t.normalizeStyle([e.sizeStyle])},[t.createElementVNode("section",z,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.imagesShown,((s,o)=>(t.openBlock(),t.createElementBlock("figure",{key:o,class:t.normalizeClass(["m-gallery__item !maz-my-0 maz-flex maz-flex-center",[`m-gallery__item--${o+1}`]])},[t.withDirectives(t.createElementVNode("img",{class:"m-gallery__item__image maz-flex-1",src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",alt:s.alt,loading:"lazy"},null,8,y),[[l,{src:s.src,alt:s.alt,disabled:e.noZoom||e.shouldHaveRemainingLayer(o),blur:e.blur,scale:e.scale}],[m,{src:s.src,disabled:!e.lazy},"bg-image"]]),e.shouldHaveRemainingLayer(o)?t.withDirectives((t.openBlock(),t.createElementBlock("div",w,[t.createElementVNode("span",b,"+"+t.toDisplayString(e.numberImagesRemaining),1)])),[[l,{src:s.src,alt:s.alt,disabled:e.noZoom,blur:!1,scale:e.scale}]]):t.createCommentVNode("v-if",!0)],2)))),128)),e.hasEmptyLayer&&0===e.images.length?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["flex-center maz-flex maz-w-full maz-bg-color-light maz-text-normal",{"maz-rounded-xl":!e.noRadius}]),style:t.normalizeStyle([e.sizeStyle])},[t.createVNode(r,{src:e.NoPhotographyIcon,size:"2rem"},null,8,["src"])],6)):t.createCommentVNode("v-if",!0)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.imagesHidden,((s,o)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:o,class:"m-gallery__hidden"})),[[l,{src:s.src,disabled:e.noZoom}]]))),128))],6)):t.createCommentVNode("v-if",!0)}],["__scopeId","data-v-e9dc5a9e"]]);e.default=L,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".m-gallery[data-v-b0789787]{position:relative;overflow:hidden}.m-gallery__hidden[data-v-b0789787]{display:none}.m-gallery__item[data-v-b0789787]{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-b0789787]{left:0;height:100%}.m-gallery__item--1[data-v-b0789787]:not(:last-child){width:50%}.m-gallery__item--2[data-v-b0789787]{left:50%;width:50%;height:50%}.m-gallery__item--2[data-v-b0789787]:last-child{height:100%}.m-gallery__item--2[data-v-b0789787]:nth-last-child(4){width:25%}.m-gallery__item--3[data-v-b0789787]{top:50%;left:50%;width:25%}.m-gallery__item--3[data-v-b0789787]:last-child{width:50%}.m-gallery__item--3[data-v-b0789787]:nth-last-child(3){top:0;left:75%}.m-gallery__item--4[data-v-b0789787]{border-top-width:2px;border-color:transparent;top:50%;left:50%;width:25%}.m-gallery__item--4[data-v-b0789787]:last-child{left:75%;width:25%}.m-gallery__item--5[data-v-b0789787]{border-top-width:2px;border-color:transparent;top:50%;left:75%;width:25%}.m-gallery__item[data-v-b0789787]:first-child{border-left:0}.m-gallery__item--3[data-v-b0789787]:last-child,.m-gallery__item--3[data-v-b0789787]:nth-last-child(2),.m-gallery__item--4[data-v-b0789787]:last-child,.m-gallery__item--5[data-v-b0789787]{border-top-width:2px;border-color:transparent}.m-gallery__item__image[data-v-b0789787]{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-b0789787]{position:absolute;inset:0}.m-gallery__remaining-layer a span[data-v-b0789787]{color:#fff;font-size:2rem}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MazGallery={},e.Vue)}(this,(function(e,t){"use strict";var s=Object.defineProperty,n=(e,t,n)=>(((e,t,n)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const o={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 i{constructor(e){if(n(this,"options"),n(this,"loader"),n(this,"wrapper"),n(this,"img"),n(this,"keydownHandler"),n(this,"onImgLoadedCallback"),n(this,"buttonsAdded"),n(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1}),n(this,"mouseEnterListener"),n(this,"mouseLeaveListener"),n(this,"renderPreviewListener"),!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if("object"==typeof e.value&&!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,..."object"==typeof e.value?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-src",this.options.src),this.options.alt&&e.setAttribute("data-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-src"),e.removeAttribute("data-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle("\n.maz-zoom-img {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1rem;\n z-index: 1050;\n background-color: hsla(238, 15%, 40%, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n\n.maz-zoom-img,\n.maz-zoom-img * {\n box-sizing: border-box;\n}\n\n.maz-zoom-img .maz-zoom-img__wrapper {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 0;\n min-height: 0;\n max-width: 100%;\n max-height: 100%;\n transition: all 300ms ease-in-out;\n opacity: 0;\n transform: scale(0.5);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {\n opacity: 1;\n transform: scale(1);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: hsla(238, 15%, 40%, 0.7);\n border-radius: 1rem;\n z-index: 2;\n min-width: 60px;\n min-height: 60px;\n}\n.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {\n display: none;\n}\n\n@-webkit-keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {\n animation: spin .6s linear infinite;\n}\n\n.maz-zoom-img img {\n max-width: 100%;\n max-height: 100%;\n min-width: 0;\n border-radius: 1rem;\n}\n\n.maz-zoom-img .maz-zoom-btn {\n margin: 0 auto;\n border: none;\n background-color: hsla(0, 0%, 7%, 0.5);\n box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);\n height: 2.2rem;\n min-height: 2.2rem;\n width: 2.2rem;\n min-width: 2.2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2.2rem;\n cursor: pointer;\n flex: 0 0 auto;\n outline: none;\n}\n\n.maz-zoom-img .maz-zoom-btn svg {\n fill: white;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {\n position: absolute;\n left: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {\n position: absolute;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn:hover {\n background-color: hsl(0, 0%, 0%);\n}");const s=document.createElement("div");s.classList.add("maz-zoom-img"),s.setAttribute("id","MazImgPreviewFullsize"),s.addEventListener("click",(e=>{s.isEqualNode(e.target)&&this.closePreview()})),"object"==typeof t&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),s.append(this.wrapper),document.body.append(s),this.keyboardEventHandler(!0),setTimeout((()=>{s&&s.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=[],s=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,s){const e=this.getButton("previous"),s=this.getButton("next");t.push(e,s)}this.wrapper.append(e),s&&(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=o.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(),"Escape"!==e.key&&" "!==e.key||this.closePreview(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||this.nextPreviousImage("ArrowRight"===e.key)}getButton(e="close"){const t=document.createElement("button");return t.innerHTML=o[e],t.addEventListener("click",(()=>{"close"===e?this.closePreview():this.allInstances&&this.nextPreviousImage("next"===e)})),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),s=document.querySelector(".maz-zoom-img-instance.maz-is-open");s&&s.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,s=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(s){const e=this.allInstances.indexOf(s),n=t?e+1:e-1,o=this.allInstances[this.getNewInstanceIndex(n)];o&&this.useNextInstance(s,o)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const s=t.getAttribute("data-src"),n=t.getAttribute("data-alt");this.wrapper.style.width="",this.loader.hidden=!1,s&&this.img.setAttribute("src",s),n&&this.img.setAttribute("alt",n)}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 a;const r={created(e,t){a=new i(t),a.create(e)},updated(e,t){a.update(t)},unmounted(e){a.remove(e)}},l={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 m{constructor(e={}){n(this,"observers",[]),n(this,"defaultOptions",l),n(this,"options"),n(this,"onImgLoadedCallback"),n(this,"onImgErrorCallback"),n(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((()=>p));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,s;this.addClass(e,this.options.loadingClass),null==(s=(t=this.options).onLoading)||s.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,s;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),null==(s=(t=this.options).onLoaded)||s.call(t,e)}imageHasError(e,t){var s,n;console.warn("[maz-ui][MazLazyImg] Error while loading image",t),this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),null==(n=(s=this.options).onError)||n.call(s,e),this.setDefaultPhoto(e)}getImageUrl(e,t){const s=this.getImgElement(e).getAttribute("data-src");if(s)return s;t.value;const n="object"==typeof t.value?t.value.src:t.value;return n||console.warn("[maz-ui][MazLazyImg] src url is not defined"),n}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const s of t){const e=s.getAttribute("data-srcset");e?s.srcset=e:console.warn('[maz-ui][MazLazyImg] the "[data-srcset]" attribute is not provided on "<source />"')}else console.warn('[maz-ui][MazLazyImg] No "<source />" elements provided into the "<picture />" element'),this.imageHasError(e)}hasBgImgMode(e){return"bg-image"===e.arg}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.errorPhoto??await this.loadErrorPhoto(),s=e.querySelectorAll("source");if(s.length>0)for await(const n of s)n.srcset=t;else this.setImgSrc(e,t)}addEventListenerToImg(e){const t=this.getImgElement(e);t.addEventListener("load",(()=>this.onImgLoadedCallback(e)),{once:!0}),t.addEventListener("error",(t=>this.onImgErrorCallback(e,t)),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const s=this.getImageUrl(e,t);if(!s)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${s}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,s))}}setImgSrc(e,t){this.getImgElement(e).src=t}handleIntersectionObserver(e,t,s,n){var o,i;this.observers.push(n);for(const a of s)if(a.isIntersecting){if(null==(i=(o=this.options).onIntersecting)||i.call(o,a.target),this.options.observerOnce&&n.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const s=this.options.observerOptions;new IntersectionObserver(((s,n)=>{this.handleIntersectionObserver(e,t,s,n)}),s).observe(e)}async imageHandler(e,t,s){if("update"===s)for await(const n of this.observers)n.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,s){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,s)}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,"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),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 s of this.observers)s.unobserve(e);this.observers=[]}}let d;const c={created(e,t){const s="object"==typeof t.value?t.value:{};d=new m(s),d.add(e,t)},updated(e,t){d.update(e,t)},unmounted(e,t){d.remove(e,t)}};const u=["innerHTML"],h=t.defineComponent({__name:"MazIcon",props:{src:{type:String,default:void 0},path:{type:String,default:void 0},name:{type:String,default:void 0},size:{type:String,default:"1.5rem"},title:{type:String,default:void 0},transformSource:{type:Function,default:e=>e}},emits:["loaded","unloaded","error"],setup(e,{emit:s}){const n=e,o={},i=t.ref(),a=t.ref(),r=()=>{try{return function(e,s){const n=t.inject(e,s);if(!n)throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${e}`);return n}("mazIconPath")}catch{return}},l=t.computed((()=>n.path??r())),m=t.computed((()=>n.src?n.src:l.value?`${l.value}/${n.name}.svg`:`/${n.name}.svg`));t.onMounted((()=>{n.name||n.src||console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop')}));const d=e=>{const t={},s=e.attributes;if(!s)return t;for(let n=s.length-1;n>=0;n--)t[s[n].name]=s[n].value;return t},c=e=>{let t=e.cloneNode(!0);return t=n.transformSource(e),n.title&&((e,t)=>{const s=e.querySelectorAll("title");if(s.length>0)s[0].textContent=t;else{const s=document.createElementNS("http://www.w3.org/2000/svg","title");s.textContent=t,e.append(s)}})(t,n.title),e.innerHTML},h=e=>new Promise(((t,s)=>{const o=new XMLHttpRequest;o.open("GET",e,!0),o.addEventListener("load",(()=>{if(o.status>=200&&o.status<400)try{const e=new DOMParser;let i=e.parseFromString(o.responseText,"text/xml").querySelectorAll("svg")[0];i?(i=n.transformSource(i),t(i)):s(new Error('Loaded file is not valid SVG"'))}catch(e){s(e)}else s(new Error("Error loading SVG"))})),o.addEventListener("error",(()=>s())),o.send()}));return t.watchEffect((()=>(async e=>{o[e]||(o[e]=h(e));try{i.value=await o[e],await t.nextTick(),s("loaded",a.value)}catch(n){i.value&&(i.value=void 0,s("unloaded")),delete o[e],s("error",n)}})(m.value))),(s,n)=>{return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createCommentVNode(" eslint-disable vue/no-v-html "),t.createCommentVNode(" eslint-disable vue/html-self-closing "),i.value?(t.openBlock(),t.createElementBlock("svg",t.mergeProps({key:0,ref_key:"svgElem",ref:a,width:"1em",height:"1em"},{...d(i.value),...(o=s.$attrs,Object.keys(o).reduce(((e,t)=>(!1!==o[t]&&null!==o[t]&&void 0!==o[t]&&(e[t]=o[t]),e)),{}))},{style:`font-size: ${e.size}`,innerHTML:c(i.value)}),null,16,u)):t.createCommentVNode("v-if",!0),t.createCommentVNode(" eslint-enable vue/no-v-html "),t.createCommentVNode(" eslint-enable vue/html-self-closing ")],2112);var o}}}),g="data:image/svg+xml;base64,PHN2ZwogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB2aWV3Qm94PSIwIDAgMjQgMjQiCiAgc3Ryb2tlPSJub25lIgogIGZpbGw9ImN1cnJlbnRDb2xvciIKICBhcmlhLWhpZGRlbj0idHJ1ZSIKPgogIDxnPgogICAgPHJlY3QgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0IiAvPgogICAgPGc+CiAgICAgIDxwYXRoCiAgICAgICAgZD0iTTguOSw2LjA3TDcuNDgsNC42Nkw5LDNoNmwxLjgzLDJIMjBjMS4xLDAsMiwwLjksMiwydjEyYzAsMC4wNS0wLjAxLDAuMS0wLjAyLDAuMTZMMjAsMTcuMTdWN2gtNC4wNWwtMS44My0ySDkuODggTDguOSw2LjA3eiBNMjAuNDksMjMuMzFMMTguMTcsMjFINGMtMS4xLDAtMi0wLjktMi0yVjdjMC0wLjU5LDAuMjctMS4xMiwwLjY4LTEuNDlsLTItMkwyLjEsMi4xbDE5LjgsMTkuOEwyMC40OSwyMy4zMXogTTkuMTksMTIuMDJDOS4wOCwxMi4zMyw5LDEyLjY1LDksMTNjMCwxLjY2LDEuMzQsMywzLDNjMC4zNSwwLDAuNjctMC4wOCwwLjk4LTAuMTlMOS4xOSwxMi4wMnogTTE2LjE3LDE5bC0xLjY4LTEuNjggQzEzLjc2LDE3Ljc1LDEyLjkxLDE4LDEyLDE4Yy0yLjc2LDAtNS0yLjI0LTUtNWMwLTAuOTEsMC4yNS0xLjc2LDAuNjgtMi40OUw0LjE3LDdINHYxMkgxNi4xN3ogTTE0LjgxLDExLjk4bDIuMDcsMi4wNyBDMTYuOTYsMTMuNzEsMTcsMTMuMzYsMTcsMTNjMC0yLjc2LTIuMjQtNS01LTVjLTAuMzYsMC0wLjcxLDAuMDQtMS4wNiwwLjEybDIuMDcsMi4wN0MxMy44NSwxMC40OSwxNC41MSwxMS4xNSwxNC44MSwxMS45OHoiCiAgICAgIC8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K",p=Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"})),v={class:"m-gallery__wrapper maz-flex maz-flex-1"},z=["alt"],y={key:0,class:"m-gallery__remaining-layer maz-flex maz-bg-overlay maz-flex-center"},w={class:"maz-text-2xl maz-text-white"},f=((e,t)=>{const s=e.__vccOpts||e;for(const[n,o]of t)s[n]=o;return s})(t.defineComponent({__name:"MazGallery",props:{images:{type:Array,default:()=>[]},imagesShownCount:{type:Number,default:5},noRemaining:{type:Boolean,default:!1},height:{type:[Number,String],default:150},noHeight:{type:Boolean,default:!1},width:{type:[Number,String],default:"100%"},noWidth:{type:Boolean,default:!1},noRadius:{type:Boolean,default:!1},noZoom:{type:Boolean,default:!1},hasEmptyLayer:{type:Boolean,default:!0},lazy:{type:Boolean,default:!0},blur:{type:Boolean,default:!0},scale:{type:Boolean,default:!0}},setup(e){const s=e;t.onBeforeMount((()=>{s.imagesShownCount>5&&console.warn('[MazUI](m-gallery) The maximum of "images-shown-count" is 5')}));const n=t.computed((()=>{const{height:e,width:t,noWidth:n,noHeight:o}=s;return{...n?{}:{flex:"0 0 "+typeof t=="number"?`${t}px`:t,width:"number"==typeof t?`${t}px`:t},...o?{}:{height:"number"==typeof e?`${e}px`:`${e}`,minHeight:"number"==typeof e?`${e}px`:`${e}`}}})),o=t.computed((()=>s.imagesShownCount<=5?s.imagesShownCount:5)),i=t.computed((()=>s.images.length-(s.images.length<o.value?s.images.length:o.value))),a=t.computed((()=>s.images.map((e=>"object"==typeof e?e:{src:e,alt:void 0})))),l=t.computed((()=>a.value.slice(0,o.value))),m=t.computed((()=>a.value.slice(o.value,s.images.length))),d=e=>i.value&&e+1===l.value.length&&!s.noRemaining;return(s,o)=>e.images.length>0||e.hasEmptyLayer?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["m-gallery maz-flex",{"maz-rounded":!e.noRadius}]),style:t.normalizeStyle([t.unref(n)])},[t.createElementVNode("section",v,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(l),((s,n)=>(t.openBlock(),t.createElementBlock("figure",{key:n,class:t.normalizeClass(["m-gallery__item !maz-my-0 maz-flex maz-flex-center",[`m-gallery__item--${n+1}`]])},[t.withDirectives(t.createElementVNode("img",{class:"m-gallery__item__image maz-flex-1",src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",alt:s.alt,loading:"lazy"},null,8,z),[[t.unref(r),{src:s.src,alt:s.alt,disabled:e.noZoom||d(n),blur:e.blur,scale:e.scale}],[t.unref(c),{src:s.src,disabled:!e.lazy},"bg-image"]]),d(n)?t.withDirectives((t.openBlock(),t.createElementBlock("div",y,[t.createElementVNode("span",w,"+"+t.toDisplayString(t.unref(i)),1)])),[[t.unref(r),{src:s.src,alt:s.alt,disabled:e.noZoom,blur:!1,scale:e.scale}]]):t.createCommentVNode("v-if",!0)],2)))),128)),e.hasEmptyLayer&&0===e.images.length?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["flex-center maz-flex maz-w-full maz-bg-color-light maz-text-normal",{"maz-rounded-xl":!e.noRadius}]),style:t.normalizeStyle([t.unref(n)])},[t.createVNode(h,{src:t.unref(g),size:"2rem"},null,8,["src"])],6)):t.createCommentVNode("v-if",!0)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(m),((s,n)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:n,class:"m-gallery__hidden"})),[[t.unref(r),{src:s.src,disabled:e.noZoom}]]))),128))],6)):t.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-b0789787"]]);e.default=f,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/components/MazIcon.d.ts
CHANGED
package/components/MazIcon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".m-gallery[data-v-b0789787]{position:relative;overflow:hidden}.m-gallery__hidden[data-v-b0789787]{display:none}.m-gallery__item[data-v-b0789787]{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-b0789787]{left:0;height:100%}.m-gallery__item--1[data-v-b0789787]:not(:last-child){width:50%}.m-gallery__item--2[data-v-b0789787]{left:50%;width:50%;height:50%}.m-gallery__item--2[data-v-b0789787]:last-child{height:100%}.m-gallery__item--2[data-v-b0789787]:nth-last-child(4){width:25%}.m-gallery__item--3[data-v-b0789787]{top:50%;left:50%;width:25%}.m-gallery__item--3[data-v-b0789787]:last-child{width:50%}.m-gallery__item--3[data-v-b0789787]:nth-last-child(3){top:0;left:75%}.m-gallery__item--4[data-v-b0789787]{border-top-width:2px;border-color:transparent;top:50%;left:50%;width:25%}.m-gallery__item--4[data-v-b0789787]:last-child{left:75%;width:25%}.m-gallery__item--5[data-v-b0789787]{border-top-width:2px;border-color:transparent;top:50%;left:75%;width:25%}.m-gallery__item[data-v-b0789787]:first-child{border-left:0}.m-gallery__item--3[data-v-b0789787]:last-child,.m-gallery__item--3[data-v-b0789787]:nth-last-child(2),.m-gallery__item--4[data-v-b0789787]:last-child,.m-gallery__item--5[data-v-b0789787]{border-top-width:2px;border-color:transparent}.m-gallery__item__image[data-v-b0789787]{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-b0789787]{position:absolute;inset:0}.m-gallery__remaining-layer a span[data-v-b0789787]{color:#fff;font-size:2rem}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
|
|
2
2
|
import { inject, defineComponent, ref, computed, onMounted, watchEffect, openBlock, createElementBlock, Fragment, createCommentVNode, mergeProps, nextTick } from "vue";
|
|
3
3
|
function injectStrict(key, fallback) {
|
|
4
4
|
const resolved = inject(key, fallback);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".m-gallery[data-v-b0789787]{position:relative;overflow:hidden}.m-gallery__hidden[data-v-b0789787]{display:none}.m-gallery__item[data-v-b0789787]{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-b0789787]{left:0;height:100%}.m-gallery__item--1[data-v-b0789787]:not(:last-child){width:50%}.m-gallery__item--2[data-v-b0789787]{left:50%;width:50%;height:50%}.m-gallery__item--2[data-v-b0789787]:last-child{height:100%}.m-gallery__item--2[data-v-b0789787]:nth-last-child(4){width:25%}.m-gallery__item--3[data-v-b0789787]{top:50%;left:50%;width:25%}.m-gallery__item--3[data-v-b0789787]:last-child{width:50%}.m-gallery__item--3[data-v-b0789787]:nth-last-child(3){top:0;left:75%}.m-gallery__item--4[data-v-b0789787]{border-top-width:2px;border-color:transparent;top:50%;left:50%;width:25%}.m-gallery__item--4[data-v-b0789787]:last-child{left:75%;width:25%}.m-gallery__item--5[data-v-b0789787]{border-top-width:2px;border-color:transparent;top:50%;left:75%;width:25%}.m-gallery__item[data-v-b0789787]:first-child{border-left:0}.m-gallery__item--3[data-v-b0789787]:last-child,.m-gallery__item--3[data-v-b0789787]:nth-last-child(2),.m-gallery__item--4[data-v-b0789787]:last-child,.m-gallery__item--5[data-v-b0789787]{border-top-width:2px;border-color:transparent}.m-gallery__item__image[data-v-b0789787]{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-b0789787]{position:absolute;inset:0}.m-gallery__remaining-layer a span[data-v-b0789787]{color:#fff;font-size:2rem}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
|
|
2
2
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MazIcon={},e.Vue)}(this,(function(e,t){"use strict";const n=["innerHTML"],r=t.defineComponent({__name:"MazIcon",props:{src:{type:String,default:void 0},path:{type:String,default:void 0},name:{type:String,default:void 0},size:{type:String,default:"1.5rem"},title:{type:String,default:void 0},transformSource:{type:Function,default:e=>e}},emits:["loaded","unloaded","error"],setup(e,{emit:r}){const o=e,l={},a=t.ref(),i=t.ref(),s=()=>{try{return function(e,n){const r=t.inject(e,n);if(!r)throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${e}`);return r}("mazIconPath")}catch{return}},u=t.computed((()=>o.path??s())),c=t.computed((()=>o.src?o.src:u.value?`${u.value}/${o.name}.svg`:`/${o.name}.svg`));t.onMounted((()=>{o.name||o.src||console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop')}));const d=e=>{const t={},n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t},m=e=>{let t=e.cloneNode(!0);return t=o.transformSource(e),o.title&&((e,t)=>{const n=e.querySelectorAll("title");if(n.length>0)n[0].textContent=t;else{const n=document.createElementNS("http://www.w3.org/2000/svg","title");n.textContent=t,e.append(n)}})(t,o.title),e.innerHTML},f=e=>new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.addEventListener("load",(()=>{if(r.status>=200&&r.status<400)try{const e=new DOMParser;let l=e.parseFromString(r.responseText,"text/xml").querySelectorAll("svg")[0];l?(l=o.transformSource(l),t(l)):n(new Error('Loaded file is not valid SVG"'))}catch(e){n(e)}else n(new Error("Error loading SVG"))})),r.addEventListener("error",(()=>n())),r.send()}));return t.watchEffect((()=>(async e=>{l[e]||(l[e]=f(e));try{a.value=await l[e],await t.nextTick(),r("loaded",i.value)}catch(n){a.value&&(a.value=void 0,r("unloaded")),delete l[e],r("error",n)}})(c.value))),(r,o)=>{return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createCommentVNode(" eslint-disable vue/no-v-html "),t.createCommentVNode(" eslint-disable vue/html-self-closing "),a.value?(t.openBlock(),t.createElementBlock("svg",t.mergeProps({key:0,ref_key:"svgElem",ref:i,width:"1em",height:"1em"},{...d(a.value),...(l=r.$attrs,Object.keys(l).reduce(((e,t)=>(!1!==l[t]&&null!==l[t]&&void 0!==l[t]&&(e[t]=l[t]),e)),{}))},{style:`font-size: ${e.size}`,innerHTML:m(a.value)}),null,16,n)):t.createCommentVNode("v-if",!0),t.createCommentVNode(" eslint-enable vue/no-v-html "),t.createCommentVNode(" eslint-enable vue/html-self-closing ")],2112);var l}}});e.default=r,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/components/MazInput.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** __vue_virtual_code_placeholder */
|
|
1
2
|
import { type PropType } from 'vue';
|
|
2
3
|
import type { Color, ModelValueSimple, Size } from './types';
|
|
3
4
|
export type { Color, Size, ModelValueSimple } from './types';
|
|
@@ -246,6 +247,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
246
247
|
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
247
248
|
onUpdate?: ((...args: any[]) => any) | undefined;
|
|
248
249
|
}, {
|
|
250
|
+
disabled: boolean;
|
|
249
251
|
label: string;
|
|
250
252
|
error: boolean;
|
|
251
253
|
success: boolean;
|
|
@@ -256,7 +258,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
256
258
|
required: boolean;
|
|
257
259
|
name: string;
|
|
258
260
|
modelValue: ModelValueSimple;
|
|
259
|
-
disabled: boolean;
|
|
260
261
|
leftIcon: string;
|
|
261
262
|
rightIcon: string;
|
|
262
263
|
id: string;
|