maz-ui 4.7.5 → 4.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/MazAccordion.CKnz73h4.js +1 -0
- package/dist/chunks/MazAlert.B8hE7wet.js +1 -0
- package/dist/chunks/MazAnimatedCounter.GLLYbZAz.js +1 -0
- package/dist/chunks/MazAnimatedElement._8NY8WgC.js +1 -0
- package/dist/chunks/MazAnimatedText.BSZ8FNf-.js +1 -0
- package/dist/chunks/MazAvatar.vO5VNPi8.js +1 -0
- package/dist/chunks/MazBackdrop.Cjbwi8-V.js +1 -0
- package/dist/chunks/MazBadge.BBZJgHXm.js +1 -0
- package/dist/chunks/MazBottomSheet.WgZ6qobx.js +1 -0
- package/dist/chunks/MazBtn.Cc9C1v2l.js +1 -0
- package/dist/chunks/MazBtnGroup.3B1XcqWM.js +1 -0
- package/dist/chunks/MazCard.YYC0LaHY.js +1 -0
- package/dist/chunks/MazCardSpotlight.SpZF61hl.js +1 -0
- package/dist/chunks/MazCarousel.1NT4jcvR.js +1 -0
- package/dist/chunks/MazChart.CDZ2PBTC.js +1 -0
- package/dist/chunks/MazCheckbox.DurIbKdf.js +1 -0
- package/dist/chunks/MazChecklist.D9ezwGpQ.js +1 -0
- package/dist/chunks/MazCircularProgressBar.rATx_hD9.js +1 -0
- package/dist/chunks/MazContainer.zXcfMOs-.js +1 -0
- package/dist/chunks/MazDatePicker.KUP34cbV.js +1 -0
- package/dist/chunks/MazDialog.CtKF3Xzo.js +1 -0
- package/dist/chunks/MazDialogConfirm.CAAHeBPE.js +1 -0
- package/dist/chunks/MazDrawer.Dc_RGG8a.js +1 -0
- package/dist/chunks/MazDropdown.2DUcivzO.js +1 -0
- package/dist/chunks/MazDropzone.CiWiPcFM.js +1 -0
- package/dist/chunks/MazExpandAnimation.CMMwtuQA.js +1 -0
- package/dist/chunks/MazFullscreenLoader.BIVRcZJ8.js +1 -0
- package/dist/chunks/MazGallery.CEmGy0K9.js +1 -0
- package/dist/chunks/MazIcon.ZWAk25ZX.js +1 -0
- package/dist/chunks/MazInput.DJjWLaKg.js +1 -0
- package/dist/chunks/MazInputCode.DKnl3i-X.js +1 -0
- package/dist/chunks/MazInputNumber.B42Mn-9h.js +1 -0
- package/dist/chunks/MazInputPhoneNumber.CLivThtK.js +1 -0
- package/dist/chunks/MazInputPrice.BeL-M944.js +1 -0
- package/dist/chunks/MazInputTags.CIVT9F6Q.js +1 -0
- package/dist/chunks/MazLazyImg.-EMwandx.js +1 -0
- package/dist/chunks/MazLink.BOpxMATj.js +1 -0
- package/dist/chunks/MazLoadingBar.C86AX2Tk.js +1 -0
- package/dist/chunks/MazPagination.CNNKXBsg.js +1 -0
- package/dist/chunks/MazPickerCalendarDays.CSZZbk5Z.js +1 -0
- package/dist/chunks/MazPickerCalendarGrid.DrUHBH6-.js +1 -0
- package/dist/chunks/MazPickerContainer.BZ74M74V.js +1 -0
- package/dist/chunks/MazPopover.Co8BEopX.js +1 -0
- package/dist/chunks/MazPullToRefresh.DMtb6Oa3.js +1 -0
- package/dist/chunks/MazRadio.75ipjTw2.js +1 -0
- package/dist/chunks/MazRadioButtons.DenHCgB3.js +1 -0
- package/dist/chunks/MazReadMore.CDXacQIw.js +1 -0
- package/dist/chunks/MazReadingProgressBar.828Y0mxA.js +1 -0
- package/dist/chunks/MazSelect.yYFAbBb5.js +1 -0
- package/dist/chunks/MazSelectCountry.DvVgk2es.js +1 -0
- package/dist/chunks/MazSkeleton.BewTYJC2.js +1 -0
- package/dist/chunks/MazSlider.BS5QHWK6.js +1 -0
- package/dist/chunks/MazSpinner.D3NN2pow.js +1 -0
- package/dist/chunks/MazStepper.DTu8HG9T.js +1 -0
- package/dist/chunks/MazSwitch.Dvmj-rTW.js +1 -0
- package/dist/chunks/MazTable.DnOehvN6.js +1 -0
- package/dist/chunks/MazTableCell.xbm2NGWL.js +1 -0
- package/dist/chunks/MazTableRow.B5dJiXk1.js +1 -0
- package/dist/chunks/MazTableTitle.DNA_1mCy.js +1 -0
- package/dist/chunks/MazTabs.-0-YP3QQ.js +1 -0
- package/dist/chunks/MazTabsBar.D2JVKMS7.js +1 -0
- package/dist/chunks/MazTabsContent.C9omK25X.js +1 -0
- package/dist/chunks/MazTabsContentItem.mJEAS5R8.js +1 -0
- package/dist/chunks/MazTextarea.BliEP5G5.js +1 -0
- package/dist/chunks/MazUiProvider.BgN8V0lD.js +1 -0
- package/dist/chunks/_plugin-vue_export-helper.ChmETRGw.js +1 -0
- package/dist/chunks/dialog.DexeIC3K.js +1 -0
- package/dist/chunks/dom-events.BPrKJiCz.js +1 -0
- package/dist/chunks/resolveLinkComponent.DAc3sqGH.js +1 -0
- package/dist/chunks/toast.UQ8RRuT9.js +1 -0
- package/dist/chunks/types.DDbvTVqf.js +1 -0
- package/dist/chunks/useMazInputPhoneNumber.B_qQ0ldP.js +1 -0
- package/dist/chunks/utils.B8bfGQxN.js +1 -0
- package/dist/chunks/vFullscreenImg.CZeRh3mw.js +1 -0
- package/dist/chunks/vLazyImg.CXmd3Lp0.js +1 -0
- package/dist/chunks/vZoomImg.CaAHb98S.js +124 -0
- package/dist/components/MazAccordion.js +1 -86
- package/dist/components/MazAlert.js +1 -85
- package/dist/components/MazAnimatedCounter.js +1 -73
- package/dist/components/MazAnimatedElement.js +1 -44
- package/dist/components/MazAnimatedText.js +1 -103
- package/dist/components/MazAvatar.js +1 -125
- package/dist/components/MazBackdrop.js +1 -163
- package/dist/components/MazBadge.js +1 -29
- package/dist/components/MazBottomSheet.js +1 -55
- package/dist/components/MazBtn.js +1 -109
- package/dist/components/MazBtnGroup.js +1 -44
- package/dist/components/MazCard.js +1 -184
- package/dist/components/MazCardSpotlight.js +1 -81
- package/dist/components/MazCarousel.js +1 -104
- package/dist/components/MazChart.js +1 -4
- package/dist/components/MazCheckbox.js +1 -128
- package/dist/components/MazChecklist.js +1 -133
- package/dist/components/MazCircularProgressBar.js +1 -131
- package/dist/components/MazContainer.js +1 -71
- package/dist/components/MazDatePicker/MazPickerCalendar.js +1 -113
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarDays.js +1 -19
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarGrid.js +1 -181
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarMonth.js +1 -75
- package/dist/components/MazDatePicker/MazPickerCalendarSwitcher.js +1 -90
- package/dist/components/MazDatePicker/MazPickerContainer.js +1 -116
- package/dist/components/MazDatePicker/MazPickerHeader.js +1 -126
- package/dist/components/MazDatePicker/MazPickerMonthSwitcher.js +1 -82
- package/dist/components/MazDatePicker/MazPickerShortcuts.js +1 -55
- package/dist/components/MazDatePicker/MazPickerTime.js +1 -178
- package/dist/components/MazDatePicker/MazPickerYearSwitcher.js +1 -95
- package/dist/components/MazDatePicker.js +1 -466
- package/dist/components/MazDatePicker.vue.d.ts +2 -6
- package/dist/components/MazDialog.js +1 -115
- package/dist/components/MazDialog.vue.d.ts +2 -6
- package/dist/components/MazDialogConfirm.js +1 -6
- package/dist/components/MazDialogConfirm.vue.d.ts +2 -6
- package/dist/components/MazDrawer.js +1 -70
- package/dist/components/MazDropdown.js +1 -277
- package/dist/components/MazDropdown.vue.d.ts +2 -6
- package/dist/components/MazDropzone.js +1 -533
- package/dist/components/MazExpandAnimation.js +1 -46
- package/dist/components/MazFullscreenLoader.js +1 -38
- package/dist/components/MazGallery.js +1 -105
- package/dist/components/MazIcon.js +1 -114
- package/dist/components/MazInput.js +1 -256
- package/dist/components/MazInputCode.js +1 -152
- package/dist/components/MazInputNumber.js +1 -152
- package/dist/components/MazInputPhoneNumber/PhoneInput.js +1 -114
- package/dist/components/MazInputPhoneNumber.js +1 -253
- package/dist/components/MazInputPrice.js +1 -4
- package/dist/components/MazInputTags.js +1 -145
- package/dist/components/MazLazyImg.js +1 -62
- package/dist/components/MazLink.js +1 -80
- package/dist/components/MazLoadingBar.js +1 -24
- package/dist/components/MazPagination.js +1 -184
- package/dist/components/MazPopover.js +1 -326
- package/dist/components/MazPullToRefresh.js +1 -145
- package/dist/components/MazRadio.js +1 -103
- package/dist/components/MazRadioButtons.js +1 -135
- package/dist/components/MazReadMore.js +1 -110
- package/dist/components/MazReadingProgressBar.js +1 -68
- package/dist/components/MazSelect.js +1 -413
- package/dist/components/MazSelectCountry.js +1 -192
- package/dist/components/MazSkeleton.js +1 -50
- package/dist/components/MazSlider.js +1 -205
- package/dist/components/MazSpinner.js +1 -27
- package/dist/components/MazStepper.js +1 -170
- package/dist/components/MazSwitch.js +1 -4
- package/dist/components/MazTable.js +1 -8
- package/dist/components/MazTableCell.js +1 -18
- package/dist/components/MazTableRow.js +1 -26
- package/dist/components/MazTableTitle.js +1 -18
- package/dist/components/MazTabs.js +1 -4
- package/dist/components/MazTabsBar.js +1 -138
- package/dist/components/MazTabsContent.js +1 -4
- package/dist/components/MazTabsContentItem.js +1 -37
- package/dist/components/MazTextarea.js +1 -147
- package/dist/components/MazUiProvider.js +1 -4
- package/dist/components/index.js +1 -127
- package/dist/composables/index.js +1 -44
- package/dist/composables/useAos.js +1 -7
- package/dist/composables/useBreakpoints.js +1 -34
- package/dist/composables/useDialog.js +1 -7
- package/dist/composables/useDisplayNames.js +1 -111
- package/dist/composables/useDropzone.js +1 -66
- package/dist/composables/useFormField.js +1 -101
- package/dist/composables/useFormValidator.js +1 -163
- package/dist/composables/useFreezeValue.js +1 -8
- package/dist/composables/useIdleTimeout.js +1 -10
- package/dist/composables/useInjectStrict.js +1 -10
- package/dist/composables/useInstanceUniqId.js +1 -12
- package/dist/composables/useMountComponent.js +1 -16
- package/dist/composables/useMutationObserver.js +1 -37
- package/dist/composables/useReadingTime.js +1 -33
- package/dist/composables/useStringMatching.js +1 -42
- package/dist/composables/useSwipe.js +1 -26
- package/dist/composables/useTimer.js +1 -36
- package/dist/composables/useToast.js +1 -14
- package/dist/composables/useUserVisibility.js +1 -10
- package/dist/composables/useWait.js +1 -7
- package/dist/composables/useWindowSize.js +1 -21
- package/dist/directives/index.js +1 -19
- package/dist/directives/vClickOutside.js +1 -104
- package/dist/directives/vFullscreenImg.js +1 -10
- package/dist/directives/vLazyImg.js +1 -23
- package/dist/directives/vTooltip.js +1 -161
- package/dist/directives/vZoomImg.js +1 -286
- package/dist/index.js +1 -1
- package/dist/plugins/aos.js +1 -89
- package/dist/plugins/dialog.js +1 -61
- package/dist/plugins/index.js +1 -17
- package/dist/plugins/maz-ui.js +1 -11
- package/dist/plugins/toast.js +1 -261
- package/dist/plugins/wait.js +1 -43
- package/dist/resolvers/MazComponentsResolver.js +1 -18
- package/dist/resolvers/MazDirectivesResolver.js +1 -14
- package/dist/resolvers/MazModulesResolver.js +1 -76
- package/dist/resolvers/index.js +1 -8
- package/dist/tailwindcss/index.js +1 -20
- package/dist/tailwindcss/tailwind.config.js +1 -35
- package/dist/tailwindcss/utils/colors.js +1 -25
- package/dist/tailwindcss/variables/breakpoints.js +1 -29
- package/dist/tailwindcss/variables/colors.js +1 -33
- package/dist/tailwindcss/variables/design-tokens.js +1 -42
- package/dist/tailwindcss/variables/utilities.js +1 -20
- package/dist/tailwindcss/variables/z-indexes.js +1 -17
- package/package.json +12 -13
- package/dist/chunks/MazChart.vue_vue_type_script_setup_true_lang.DpG9UYdm.js +0 -50
- package/dist/chunks/MazDialogConfirm.vue_vue_type_script_setup_true_lang.BB2rYkwY.js +0 -215
- package/dist/chunks/MazInputPrice.vue_vue_type_script_setup_true_lang.DcNkyw1C.js +0 -77
- package/dist/chunks/MazSwitch.vue_vue_type_style_index_0_lang.lYfYsI0R.js +0 -84
- package/dist/chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js +0 -517
- package/dist/chunks/MazTabs.vue_vue_type_script_setup_true_lang.CiIFxs7J.js +0 -28
- package/dist/chunks/MazTabsContent.vue_vue_type_script_setup_true_lang.MO7zA8LZ.js +0 -26
- package/dist/chunks/MazUiProvider.vue_vue_type_script_setup_true_lang.DtnM1DOn.js +0 -34
- package/dist/chunks/_plugin-vue_export-helper.B--vMWp3.js +0 -9
- package/dist/chunks/dom-events.DTx6Kblx.js +0 -368
- package/dist/chunks/fullscreen-img.directive.BJieSSIt.js +0 -321
- package/dist/chunks/lazy-img.directive.GRfYbidn.js +0 -174
- package/dist/chunks/resolveLinkComponent.CKR2McYy.js +0 -8
- package/dist/chunks/types.D0Bp_UhS.js +0 -6
- package/dist/chunks/useMazInputPhoneNumber.Os-2y9bz.js +0 -157
- package/dist/chunks/utils.D89Q5cCP.js +0 -207
- /package/dist/assets/{fullscreen-img.DFp1SMPU.css → vFullscreenImg.DFp1SMPU.css} +0 -0
package/dist/plugins/aos.js
CHANGED
|
@@ -1,89 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { sleep } from "@maz-ui/utils/helpers/sleep";
|
|
3
|
-
const DEFAULT_OPTIONS = {
|
|
4
|
-
delay: 100,
|
|
5
|
-
observer: {
|
|
6
|
-
root: void 0,
|
|
7
|
-
rootMargin: "0px",
|
|
8
|
-
threshold: 0.2
|
|
9
|
-
},
|
|
10
|
-
animation: {
|
|
11
|
-
once: !0,
|
|
12
|
-
duration: 300,
|
|
13
|
-
delay: 0
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
class AosHandler {
|
|
17
|
-
options;
|
|
18
|
-
constructor(options) {
|
|
19
|
-
this.options = {
|
|
20
|
-
delay: options?.delay ?? DEFAULT_OPTIONS.delay,
|
|
21
|
-
observer: {
|
|
22
|
-
...DEFAULT_OPTIONS.observer,
|
|
23
|
-
...options?.observer
|
|
24
|
-
},
|
|
25
|
-
animation: {
|
|
26
|
-
...DEFAULT_OPTIONS.animation,
|
|
27
|
-
...options?.animation
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
32
|
-
handleIntersect(entries, observer) {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const hasChildren = entry.target.getAttribute("data-maz-aos-children") === "true", animateElements = entry.target.getAttribute("data-maz-aos") ? [entry.target] : [];
|
|
35
|
-
if (hasChildren) {
|
|
36
|
-
const children = Array.from(document.querySelectorAll("[data-maz-aos-anchor]"), (child) => child.getAttribute("data-maz-aos-anchor") === `#${entry.target.id}` ? child : void 0);
|
|
37
|
-
for (const child of children)
|
|
38
|
-
child && animateElements.push(child);
|
|
39
|
-
}
|
|
40
|
-
for (const element of animateElements) {
|
|
41
|
-
const once = element.getAttribute("data-maz-aos-once"), useOnce = typeof once == "string" ? once === "true" : this.options.animation.once;
|
|
42
|
-
if (typeof this.options.observer.threshold == "number" && entry.intersectionRatio > this.options.observer.threshold) {
|
|
43
|
-
const duration = element.getAttribute("data-maz-aos-duration"), delay = element.getAttribute("data-maz-aos-delay"), animationDuration = duration ? Number.parseInt(duration) : this.options.animation.duration, animationDelay = delay ? Number.parseInt(delay) : this.options.animation.delay, totalAnimationTime = animationDuration + animationDelay;
|
|
44
|
-
duration || (element.style.transitionDuration = `${this.options.animation.duration}ms`), delay || (element.style.transitionDelay = `${this.options.animation.delay}ms`), element.classList.add("maz-aos-animate"), useOnce && setTimeout(() => {
|
|
45
|
-
const parentAnchor = element.getAttribute("data-maz-aos-anchor");
|
|
46
|
-
if (parentAnchor) {
|
|
47
|
-
const anchorElement = document.querySelector(parentAnchor);
|
|
48
|
-
anchorElement && observer.unobserve(anchorElement);
|
|
49
|
-
}
|
|
50
|
-
observer.unobserve(element);
|
|
51
|
-
}, totalAnimationTime + 100);
|
|
52
|
-
} else useOnce || element.classList.remove("maz-aos-animate");
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
async handleObserver() {
|
|
57
|
-
await sleep(this.options.delay);
|
|
58
|
-
const observer = new IntersectionObserver(this.handleIntersect.bind(this), this.options.observer);
|
|
59
|
-
for (const element of document.querySelectorAll("[data-maz-aos]")) {
|
|
60
|
-
const anchorAttr = element.getAttribute("data-maz-aos-anchor");
|
|
61
|
-
if (anchorAttr) {
|
|
62
|
-
const anchorElement = document.querySelector(anchorAttr);
|
|
63
|
-
anchorElement ? (anchorElement.setAttribute("data-maz-aos-children", "true"), observer.observe(anchorElement)) : console.warn(`[maz-ui](aos) no element found with selector "${anchorAttr}"`);
|
|
64
|
-
} else
|
|
65
|
-
observer.observe(element);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
runAnimations() {
|
|
69
|
-
if (isClient())
|
|
70
|
-
return this.handleObserver();
|
|
71
|
-
console.warn("[MazAos](runAnimations) should be executed on client side");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
let instance;
|
|
75
|
-
const AosPlugin = {
|
|
76
|
-
install: (app, options) => {
|
|
77
|
-
instance = new AosHandler(options), app.provide("mazAos", instance), app.config.globalProperties.$mazAos = instance, isClient() && (options?.router ? options.router.afterEach(() => {
|
|
78
|
-
instance.runAnimations();
|
|
79
|
-
}) : instance.runAnimations());
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
function getAosInstance() {
|
|
83
|
-
return instance;
|
|
84
|
-
}
|
|
85
|
-
export {
|
|
86
|
-
AosHandler,
|
|
87
|
-
AosPlugin,
|
|
88
|
-
getAosInstance
|
|
89
|
-
};
|
|
1
|
+
import{sleep}from"@maz-ui/utils/helpers/sleep";import{isClient}from"@maz-ui/utils/helpers/isClient";var DEFAULT_OPTIONS={delay:100,observer:{root:void 0,rootMargin:`0px`,threshold:.2},animation:{once:!0,duration:300,delay:0}};var AosHandler=class{options;constructor(options){this.options={delay:options?.delay??DEFAULT_OPTIONS.delay,observer:{...DEFAULT_OPTIONS.observer,...options?.observer},animation:{...DEFAULT_OPTIONS.animation,...options?.animation}}}handleIntersect(entries,observer){for(let entry of entries){let hasChildren=entry.target.getAttribute(`data-maz-aos-children`)===`true`;let animateElements=entry.target.getAttribute(`data-maz-aos`)?[entry.target]:[];if(hasChildren){let children=Array.from(document.querySelectorAll(`[data-maz-aos-anchor]`),child=>child.getAttribute(`data-maz-aos-anchor`)===`#${entry.target.id}`?child:void 0);for(let child of children)child&&animateElements.push(child)}for(let element of animateElements){let once=element.getAttribute(`data-maz-aos-once`);let useOnce=typeof once==`string`?once===`true`:this.options.animation.once;if(typeof this.options.observer.threshold==`number`&&entry.intersectionRatio>this.options.observer.threshold){let duration=element.getAttribute(`data-maz-aos-duration`);let delay=element.getAttribute(`data-maz-aos-delay`);let totalAnimationTime=(duration?Number.parseInt(duration):this.options.animation.duration)+(delay?Number.parseInt(delay):this.options.animation.delay);duration||(element.style.transitionDuration=`${this.options.animation.duration}ms`),delay||(element.style.transitionDelay=`${this.options.animation.delay}ms`),element.classList.add(`maz-aos-animate`),useOnce&&setTimeout(()=>{let parentAnchor=element.getAttribute(`data-maz-aos-anchor`);if(parentAnchor){let anchorElement=document.querySelector(parentAnchor);anchorElement&&observer.unobserve(anchorElement)}observer.unobserve(element)},totalAnimationTime+100)}else useOnce||element.classList.remove(`maz-aos-animate`)}}}async handleObserver(){await sleep(this.options.delay);let observer=new IntersectionObserver(this.handleIntersect.bind(this),this.options.observer);for(let element of document.querySelectorAll(`[data-maz-aos]`)){let anchorAttr=element.getAttribute(`data-maz-aos-anchor`);if(anchorAttr){let anchorElement=document.querySelector(anchorAttr);anchorElement?(anchorElement.setAttribute(`data-maz-aos-children`,`true`),observer.observe(anchorElement)):console.warn(`[maz-ui](aos) no element found with selector "${anchorAttr}"`)}else observer.observe(element)}}runAnimations(){if(isClient())return this.handleObserver();console.warn(`[MazAos](runAnimations) should be executed on client side`)}};var instance;var AosPlugin={install:(app,options)=>{instance=new AosHandler(options),app.provide(`mazAos`,instance),app.config.globalProperties.$mazAos=instance,isClient()&&(options?.router?options.router.afterEach(()=>{instance.runAnimations()}):instance.runAnimations())}};function getAosInstance(){return instance}export{AosHandler,AosPlugin,getAosInstance};
|
package/dist/plugins/dialog.js
CHANGED
|
@@ -1,61 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useMountComponent } from "../composables/useMountComponent.js";
|
|
3
|
-
const DEFAULT_OPTIONS = {
|
|
4
|
-
identifier: "main-dialog"
|
|
5
|
-
};
|
|
6
|
-
class DialogHandler {
|
|
7
|
-
constructor(app, globalOptions = DEFAULT_OPTIONS) {
|
|
8
|
-
this.app = app, this.globalOptions = globalOptions;
|
|
9
|
-
}
|
|
10
|
-
activeDialogs = /* @__PURE__ */ new Map();
|
|
11
|
-
open(options) {
|
|
12
|
-
const props = {
|
|
13
|
-
...DEFAULT_OPTIONS,
|
|
14
|
-
...this.globalOptions,
|
|
15
|
-
...options
|
|
16
|
-
}, { removeDialogFromState } = useMazDialogConfirm(), existing = this.activeDialogs.get(props.identifier);
|
|
17
|
-
existing && (existing.cleanupTimer && clearTimeout(existing.cleanupTimer), removeDialogFromState(props.identifier), existing.destroy(), this.activeDialogs.delete(props.identifier));
|
|
18
|
-
const { destroy, vNode } = useMountComponent(_sfc_main, {
|
|
19
|
-
props,
|
|
20
|
-
app: this.app
|
|
21
|
-
}), entry = { destroy };
|
|
22
|
-
this.activeDialogs.set(props.identifier, entry);
|
|
23
|
-
const { showDialogAndWaitChoice } = useMazDialogConfirm(), scheduleDestroy = () => {
|
|
24
|
-
const timer = setTimeout(() => {
|
|
25
|
-
this.activeDialogs.get(props.identifier) === entry && (destroy(), this.activeDialogs.delete(props.identifier));
|
|
26
|
-
}, 700);
|
|
27
|
-
entry.cleanupTimer = timer;
|
|
28
|
-
}, close = () => {
|
|
29
|
-
vNode.component?.exposed?.isActive?.value && (vNode.component?.exposed?.close(), props.onClose?.(), scheduleDestroy());
|
|
30
|
-
};
|
|
31
|
-
return (async () => {
|
|
32
|
-
try {
|
|
33
|
-
const response = await showDialogAndWaitChoice(props.identifier);
|
|
34
|
-
props.onAccept && props.onAccept(response);
|
|
35
|
-
} catch (error) {
|
|
36
|
-
const response = error;
|
|
37
|
-
props.onReject && props.onReject(response);
|
|
38
|
-
} finally {
|
|
39
|
-
scheduleDestroy();
|
|
40
|
-
}
|
|
41
|
-
})(), {
|
|
42
|
-
destroy: () => {
|
|
43
|
-
entry.cleanupTimer && clearTimeout(entry.cleanupTimer), destroy(), this.activeDialogs.get(props.identifier) === entry && this.activeDialogs.delete(props.identifier);
|
|
44
|
-
},
|
|
45
|
-
close
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const DialogPlugin = {
|
|
50
|
-
install(app, options) {
|
|
51
|
-
const dialogHandler = new DialogHandler(app, options);
|
|
52
|
-
app.provide("mazDialog", dialogHandler), app.config.globalProperties.$mazDialog = {
|
|
53
|
-
open: dialogHandler.open.bind(dialogHandler),
|
|
54
|
-
globalOptions: dialogHandler.globalOptions
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
export {
|
|
59
|
-
DialogHandler,
|
|
60
|
-
DialogPlugin
|
|
61
|
-
};
|
|
1
|
+
import"../chunks/MazBackdrop.Cjbwi8-V.js";import"../chunks/MazDialog.CtKF3Xzo.js";import{n as DialogHandler,t as DialogPlugin}from"../chunks/dialog.DexeIC3K.js";export{DialogHandler,DialogPlugin};
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
import { AosHandler,
|
|
2
|
-
import { DialogPlugin } from "./dialog.js";
|
|
3
|
-
import { MazUi } from "./maz-ui.js";
|
|
4
|
-
import { ToastHandler, ToastPlugin } from "./toast.js";
|
|
5
|
-
import { WaitHandler, WaitPlugin, waitInstance } from "./wait.js";
|
|
6
|
-
export {
|
|
7
|
-
AosHandler,
|
|
8
|
-
AosPlugin,
|
|
9
|
-
DialogPlugin,
|
|
10
|
-
MazUi,
|
|
11
|
-
ToastHandler,
|
|
12
|
-
ToastPlugin,
|
|
13
|
-
WaitHandler,
|
|
14
|
-
WaitPlugin,
|
|
15
|
-
getAosInstance,
|
|
16
|
-
waitInstance
|
|
17
|
-
};
|
|
1
|
+
import"../chunks/MazBackdrop.Cjbwi8-V.js";import"../chunks/MazDialog.CtKF3Xzo.js";import{WaitHandler,WaitPlugin,waitInstance}from"./wait.js";import{n as ToastHandler,t as ToastPlugin}from"../chunks/toast.UQ8RRuT9.js";import{MazUi}from"./maz-ui.js";import{t as DialogPlugin}from"../chunks/dialog.DexeIC3K.js";import{AosHandler,AosPlugin,getAosInstance}from"./aos.js";export{AosHandler,AosPlugin,DialogPlugin,MazUi,ToastHandler,ToastPlugin,WaitHandler,WaitPlugin,getAosInstance,waitInstance};
|
package/dist/plugins/maz-ui.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MazUiTranslations } from "@maz-ui/translations";
|
|
3
|
-
const MazUi = {
|
|
4
|
-
install(app, options) {
|
|
5
|
-
const { theme, translations } = options;
|
|
6
|
-
app.use(MazUiTheme, theme), app.use(MazUiTranslations, translations);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
MazUi
|
|
11
|
-
};
|
|
1
|
+
import{MazUiTheme}from"@maz-ui/themes/plugin";import{MazUiTranslations}from"@maz-ui/translations";var MazUi={install(app,options){let{theme,translations}=options;app.use(MazUiTheme,theme),app.use(MazUiTranslations,translations)}};export{MazUi};
|
package/dist/plugins/toast.js
CHANGED
|
@@ -1,261 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineComponent, defineAsyncComponent, ref, computed, watch, onMounted, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, withModifiers, resolveDynamicComponent, createCommentVNode, toDisplayString, createElementBlock, Fragment, renderList, unref, mergeProps, normalizeStyle, createVNode, vShow } from "vue";
|
|
3
|
-
import { MazExclamationCircle, MazCheckCircle, MazInformationCircle, MazExclamationTriangle, MazXMark, MazArrowTopRightOnSquare, MazLinkIcon } from "@maz-ui/icons/lazy";
|
|
4
|
-
import { useTimer } from "../composables/useTimer.js";
|
|
5
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
6
|
-
import '../assets/toast.DG6Qv7r7.css';const _hoisted_1 = ["textContent", "innerHTML"], _hoisted_2 = {
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "m-toast__progress-bar"
|
|
9
|
-
}, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
-
__name: "MazToast",
|
|
11
|
-
props: {
|
|
12
|
-
message: {},
|
|
13
|
-
type: { default: "info" },
|
|
14
|
-
destroy: { type: Function },
|
|
15
|
-
html: { type: Boolean, default: !1 },
|
|
16
|
-
maxToasts: { type: [Number, Boolean], default: !1 },
|
|
17
|
-
queue: { type: Boolean },
|
|
18
|
-
position: { default: "bottom-right" },
|
|
19
|
-
pauseOnHover: { type: Boolean, default: !0 },
|
|
20
|
-
timeout: { type: [Number, Boolean], default: 1e4 },
|
|
21
|
-
persistent: { type: Boolean },
|
|
22
|
-
icon: { type: [Boolean, Function, Object], default: !0 },
|
|
23
|
-
button: {},
|
|
24
|
-
buttons: {}
|
|
25
|
-
},
|
|
26
|
-
emits: ["close", "click", "open"],
|
|
27
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
28
|
-
const emits = __emit, MazBtn = defineAsyncComponent(() => import("../components/MazBtn.js")), Toast = ref(), internalButtons = computed(() => {
|
|
29
|
-
const buttonArray = [];
|
|
30
|
-
return __props.button && buttonArray.push(__props.button), __props.buttons && buttonArray.push(...__props.buttons), buttonArray;
|
|
31
|
-
}), iconComponent = computed(() => {
|
|
32
|
-
if (__props.icon)
|
|
33
|
-
switch (__props.type) {
|
|
34
|
-
case "destructive":
|
|
35
|
-
return MazExclamationTriangle;
|
|
36
|
-
case "info":
|
|
37
|
-
return MazInformationCircle;
|
|
38
|
-
case "success":
|
|
39
|
-
return MazCheckCircle;
|
|
40
|
-
case "warning":
|
|
41
|
-
return MazExclamationCircle;
|
|
42
|
-
default:
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
}), positionY = computed(() => __props.position.includes("top") ? "top" : "bottom"), positionX = computed(() => __props.position.includes("left") ? "left" : __props.position.includes("right") ? "right" : "center"), transitionName = computed(() => positionX.value !== "center" ? positionX.value === "right" ? "m-slide-right" : "m-slide-left" : positionY.value === "top" ? "m-slide-top" : "m-slide-bottom"), isActive = ref(!1), queueTimer = ref(), containerClassName = `m-toast-container m-reset-css --${positionY.value} --${positionX.value}`, selectorContainerClass = `.${containerClassName.replaceAll(" ", ".")}`, timer = useTimer({
|
|
46
|
-
callback: closeToast,
|
|
47
|
-
timeout: typeof __props.timeout == "number" ? __props.timeout : 0,
|
|
48
|
-
callbackOffsetTime: 200
|
|
49
|
-
});
|
|
50
|
-
function createParents() {
|
|
51
|
-
const container = document.querySelector(selectorContainerClass);
|
|
52
|
-
if (!container && !container) {
|
|
53
|
-
const body = document.body, toCreate = document.createElement("div");
|
|
54
|
-
toCreate.className = containerClassName, body.append(toCreate);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function shouldQueue() {
|
|
58
|
-
const container = document.querySelector(selectorContainerClass);
|
|
59
|
-
return !__props.queue && __props.maxToasts === !1 ? !1 : typeof __props.maxToasts == "number" && container ? __props.maxToasts <= container.childElementCount : container && container.childElementCount > 0;
|
|
60
|
-
}
|
|
61
|
-
function showNotice() {
|
|
62
|
-
if (shouldQueue()) {
|
|
63
|
-
queueTimer.value = setTimeout(showNotice, 250);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const container = document.querySelector(selectorContainerClass);
|
|
67
|
-
Toast.value && container && container.prepend(Toast.value), isActive.value = !0, typeof __props.timeout == "number" && __props.timeout > 0 && !__props.persistent && timer.start();
|
|
68
|
-
}
|
|
69
|
-
const progressBarWidth = ref("100%");
|
|
70
|
-
function getProgressBarColor() {
|
|
71
|
-
switch (__props.type) {
|
|
72
|
-
case "destructive":
|
|
73
|
-
return "maz-bg-destructive-800";
|
|
74
|
-
case "info":
|
|
75
|
-
return "maz-bg-info-800";
|
|
76
|
-
case "success":
|
|
77
|
-
return "maz-bg-success-800";
|
|
78
|
-
case "warning":
|
|
79
|
-
return "maz-bg-warning-800";
|
|
80
|
-
default:
|
|
81
|
-
return "maz-bg-contrast-foreground";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
watch(
|
|
85
|
-
timer.remainingTime,
|
|
86
|
-
(remainingTime) => {
|
|
87
|
-
if (typeof __props.timeout == "number") {
|
|
88
|
-
const percent = 100 * remainingTime / __props.timeout;
|
|
89
|
-
progressBarWidth.value = `${percent}%`;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
function click(event, shouldClose = !0) {
|
|
94
|
-
emits("click", event), shouldClose && closeToast();
|
|
95
|
-
}
|
|
96
|
-
const isActionLoading = ref(!1);
|
|
97
|
-
async function onButtonClick(button, event) {
|
|
98
|
-
button.onClick && (isActionLoading.value = !0, timer.pause(), await button.onClick(), timer.resume(), isActionLoading.value = !1), click(event, button.closeToast ?? !1);
|
|
99
|
-
}
|
|
100
|
-
function toggleTimer(shouldPause) {
|
|
101
|
-
!__props.pauseOnHover || __props.persistent || isActionLoading.value || (shouldPause ? timer.pause() : timer.resume());
|
|
102
|
-
}
|
|
103
|
-
function stopTimer() {
|
|
104
|
-
timer.stop(), queueTimer.value && clearTimeout(queueTimer.value);
|
|
105
|
-
}
|
|
106
|
-
function closeToast() {
|
|
107
|
-
stopTimer(), isActive.value = !1;
|
|
108
|
-
}
|
|
109
|
-
function onAnimationEnter() {
|
|
110
|
-
emits("open");
|
|
111
|
-
}
|
|
112
|
-
function onAnimationLeave() {
|
|
113
|
-
emits("close"), Toast.value?.remove(), __props.destroy?.();
|
|
114
|
-
const container = document.querySelector(selectorContainerClass);
|
|
115
|
-
container && !container?.hasChildNodes() && container.remove();
|
|
116
|
-
}
|
|
117
|
-
function getButtonRightIcon(button) {
|
|
118
|
-
return !button.to && !button.href ? button.rightIcon : button.target === "_blank" ? MazArrowTopRightOnSquare : MazLinkIcon;
|
|
119
|
-
}
|
|
120
|
-
return __expose({
|
|
121
|
-
/**
|
|
122
|
-
* Close the toast
|
|
123
|
-
* @description This is used to close the toast
|
|
124
|
-
*/
|
|
125
|
-
closeToast
|
|
126
|
-
}), onMounted(() => {
|
|
127
|
-
createParents(), showNotice();
|
|
128
|
-
}), (_ctx, _cache) => (openBlock(), createBlock(Transition, {
|
|
129
|
-
name: transitionName.value,
|
|
130
|
-
appear: "",
|
|
131
|
-
onAfterLeave: onAnimationLeave,
|
|
132
|
-
onAfterEnter: onAnimationEnter
|
|
133
|
-
}, {
|
|
134
|
-
default: withCtx(() => [
|
|
135
|
-
withDirectives(createElementVNode("div", {
|
|
136
|
-
ref_key: "Toast",
|
|
137
|
-
ref: Toast,
|
|
138
|
-
class: normalizeClass(["m-toast m-reset-css", [
|
|
139
|
-
`--${__props.type}`,
|
|
140
|
-
`--${positionY.value}`,
|
|
141
|
-
`--${positionX.value}`,
|
|
142
|
-
{ "--persistent": __props.persistent }
|
|
143
|
-
]])
|
|
144
|
-
}, [
|
|
145
|
-
createElementVNode("button", {
|
|
146
|
-
role: "alert",
|
|
147
|
-
class: "m-toast__button",
|
|
148
|
-
onMouseover: _cache[0] || (_cache[0] = ($event) => toggleTimer(!0)),
|
|
149
|
-
onMouseleave: _cache[1] || (_cache[1] = ($event) => toggleTimer(!1)),
|
|
150
|
-
onTouchstartPassive: _cache[2] || (_cache[2] = ($event) => toggleTimer(!0)),
|
|
151
|
-
onTouchendPassive: _cache[3] || (_cache[3] = ($event) => toggleTimer(!1)),
|
|
152
|
-
onClick: _cache[4] || (_cache[4] = withModifiers(($event) => click($event), ["stop"]))
|
|
153
|
-
}, [
|
|
154
|
-
iconComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(iconComponent.value), {
|
|
155
|
-
key: 0,
|
|
156
|
-
class: "maz-text-2xl"
|
|
157
|
-
})) : createCommentVNode("", !0),
|
|
158
|
-
createElementVNode("div", {
|
|
159
|
-
class: "m-toast__message",
|
|
160
|
-
textContent: toDisplayString(__props.html ? void 0 : __props.message),
|
|
161
|
-
innerHTML: __props.html ? __props.message : void 0
|
|
162
|
-
}, null, 8, _hoisted_1),
|
|
163
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(internalButtons.value, (toastButton, index) => (openBlock(), createBlock(unref(MazBtn), mergeProps({ key: index }, { ref_for: !0 }, {
|
|
164
|
-
...toastButton,
|
|
165
|
-
onClick: void 0
|
|
166
|
-
}, {
|
|
167
|
-
loading: isActionLoading.value || toastButton.loading,
|
|
168
|
-
"right-icon": getButtonRightIcon(toastButton),
|
|
169
|
-
onClick: withModifiers(($event) => onButtonClick(toastButton, $event), ["stop"])
|
|
170
|
-
}), null, 16, ["loading", "right-icon", "onClick"]))), 128)),
|
|
171
|
-
typeof __props.timeout == "number" && __props.timeout > 0 && !__props.persistent ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
172
|
-
createElementVNode("div", {
|
|
173
|
-
style: normalizeStyle({
|
|
174
|
-
width: progressBarWidth.value
|
|
175
|
-
}),
|
|
176
|
-
class: normalizeClass(["m-toast__progress-bar-inner", getProgressBarColor()])
|
|
177
|
-
}, null, 6)
|
|
178
|
-
])) : createCommentVNode("", !0)
|
|
179
|
-
], 32),
|
|
180
|
-
createElementVNode("button", {
|
|
181
|
-
class: "m-toast__close",
|
|
182
|
-
onClick: _cache[5] || (_cache[5] = withModifiers(($event) => click($event), ["stop"]))
|
|
183
|
-
}, [
|
|
184
|
-
createVNode(unref(MazXMark), { class: "m-toast__close-icon" })
|
|
185
|
-
])
|
|
186
|
-
], 2), [
|
|
187
|
-
[vShow, isActive.value]
|
|
188
|
-
])
|
|
189
|
-
]),
|
|
190
|
-
_: 1
|
|
191
|
-
}, 8, ["name"]));
|
|
192
|
-
}
|
|
193
|
-
}), MazToast = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2a4224e0"]]), DEFAULT_OPTIONS = {
|
|
194
|
-
position: "bottom-right",
|
|
195
|
-
timeout: 1e4,
|
|
196
|
-
persistent: !1
|
|
197
|
-
};
|
|
198
|
-
class ToastHandler {
|
|
199
|
-
constructor(app, globalOptions) {
|
|
200
|
-
this.app = app, this.globalOptions = globalOptions;
|
|
201
|
-
}
|
|
202
|
-
show(message, options) {
|
|
203
|
-
const props = {
|
|
204
|
-
...DEFAULT_OPTIONS,
|
|
205
|
-
...this.globalOptions,
|
|
206
|
-
...options,
|
|
207
|
-
message
|
|
208
|
-
}, { destroy, vNode } = useMountComponent(MazToast, {
|
|
209
|
-
props,
|
|
210
|
-
app: this.app
|
|
211
|
-
});
|
|
212
|
-
return {
|
|
213
|
-
destroy,
|
|
214
|
-
close: () => vNode.component?.exposed?.closeToast()
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
getLocalOptions(options) {
|
|
218
|
-
const DEFAULT_BUTTON_OPTIONS = {
|
|
219
|
-
size: "xs",
|
|
220
|
-
color: options?.type ?? "contrast",
|
|
221
|
-
closeToast: !1
|
|
222
|
-
}, button = options?.button ? {
|
|
223
|
-
...DEFAULT_BUTTON_OPTIONS,
|
|
224
|
-
...options.button
|
|
225
|
-
} : void 0, buttons = options?.buttons?.map((button2) => ({
|
|
226
|
-
...DEFAULT_BUTTON_OPTIONS,
|
|
227
|
-
...button2
|
|
228
|
-
}));
|
|
229
|
-
return {
|
|
230
|
-
type: options?.type ?? "contrast",
|
|
231
|
-
...options,
|
|
232
|
-
buttons,
|
|
233
|
-
button
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
message(message, options) {
|
|
237
|
-
return this.show(message, this.getLocalOptions(options));
|
|
238
|
-
}
|
|
239
|
-
success(message, options) {
|
|
240
|
-
return this.show(message, this.getLocalOptions({ ...options, type: "success" }));
|
|
241
|
-
}
|
|
242
|
-
error(message, options) {
|
|
243
|
-
return this.show(message, this.getLocalOptions({ ...options, type: "destructive" }));
|
|
244
|
-
}
|
|
245
|
-
info(message, options) {
|
|
246
|
-
return this.show(message, this.getLocalOptions({ ...options, type: "info" }));
|
|
247
|
-
}
|
|
248
|
-
warning(message, options) {
|
|
249
|
-
return this.show(message, this.getLocalOptions({ ...options, type: "warning" }));
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
const ToastPlugin = {
|
|
253
|
-
install(app, options) {
|
|
254
|
-
const toastHandler = new ToastHandler(app, options);
|
|
255
|
-
app.provide("mazToast", toastHandler), app.config.globalProperties.$mazToast = toastHandler;
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
export {
|
|
259
|
-
ToastHandler,
|
|
260
|
-
ToastPlugin
|
|
261
|
-
};
|
|
1
|
+
import{n as ToastHandler,t as ToastPlugin}from"../chunks/toast.UQ8RRuT9.js";export{ToastHandler,ToastPlugin};
|
package/dist/plugins/wait.js
CHANGED
|
@@ -1,43 +1 @@
|
|
|
1
|
-
import { ref, computed }
|
|
2
|
-
const DEFAULT_LOADER = "maz-wait-default-loader";
|
|
3
|
-
function uniq(array) {
|
|
4
|
-
return array.filter((el, index, arr) => index === arr.indexOf(el));
|
|
5
|
-
}
|
|
6
|
-
function contains(array) {
|
|
7
|
-
return (predicate = DEFAULT_LOADER) => array.includes(predicate);
|
|
8
|
-
}
|
|
9
|
-
const hasItems = (array) => array.length > 0;
|
|
10
|
-
function push(array) {
|
|
11
|
-
return (item = DEFAULT_LOADER) => uniq([...array, item]);
|
|
12
|
-
}
|
|
13
|
-
function pop(array) {
|
|
14
|
-
return (item = DEFAULT_LOADER) => array.filter((_item) => _item !== item);
|
|
15
|
-
}
|
|
16
|
-
class WaitHandler {
|
|
17
|
-
_loaders = ref([]);
|
|
18
|
-
get loaders() {
|
|
19
|
-
return computed(() => this._loaders.value);
|
|
20
|
-
}
|
|
21
|
-
stop(loaderId = DEFAULT_LOADER) {
|
|
22
|
-
return this._loaders.value = pop(this._loaders.value)(loaderId), this;
|
|
23
|
-
}
|
|
24
|
-
start(loaderId = DEFAULT_LOADER) {
|
|
25
|
-
return this._loaders.value = push(this._loaders.value)(loaderId), this;
|
|
26
|
-
}
|
|
27
|
-
isLoading(loaderId = DEFAULT_LOADER) {
|
|
28
|
-
return computed(() => contains(this._loaders.value)(loaderId)).value;
|
|
29
|
-
}
|
|
30
|
-
get anyLoading() {
|
|
31
|
-
return computed(() => hasItems(this._loaders.value));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const waitInstance = new WaitHandler(), WaitPlugin = {
|
|
35
|
-
install: (app) => {
|
|
36
|
-
app.provide("mazWait", waitInstance), app.config.globalProperties.$mazWait = waitInstance;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
WaitHandler,
|
|
41
|
-
WaitPlugin,
|
|
42
|
-
waitInstance
|
|
43
|
-
};
|
|
1
|
+
import{computed,ref}from"vue";var DEFAULT_LOADER=`maz-wait-default-loader`;function uniq(array){return array.filter((el,index,arr)=>index===arr.indexOf(el))}function contains(array){return(predicate=DEFAULT_LOADER)=>array.includes(predicate)}var hasItems=array=>array.length>0;function push(array){return(item=DEFAULT_LOADER)=>uniq([...array,item])}function pop(array){return(item=DEFAULT_LOADER)=>array.filter(_item=>_item!==item)}var WaitHandler=class{_loaders=ref([]);get loaders(){return computed(()=>this._loaders.value)}stop(loaderId=DEFAULT_LOADER){return this._loaders.value=pop(this._loaders.value)(loaderId),this}start(loaderId=DEFAULT_LOADER){return this._loaders.value=push(this._loaders.value)(loaderId),this}isLoading(loaderId=DEFAULT_LOADER){return computed(()=>contains(this._loaders.value)(loaderId)).value}get anyLoading(){return computed(()=>hasItems(this._loaders.value))}};var waitInstance=new WaitHandler;var WaitPlugin={install:app=>{app.provide(`mazWait`,waitInstance),app.config.globalProperties.$mazWait=waitInstance}};export{WaitHandler,WaitPlugin,waitInstance};
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { pascalCase } from "@maz-ui/utils/helpers/pascalCase";
|
|
3
|
-
const mazRegexPascalCase = /^(Maz[A-Z])/, mazRegexKebabCase = /^(maz-[a-z])/;
|
|
4
|
-
function MazComponentsResolver(options) {
|
|
5
|
-
return {
|
|
6
|
-
type: "component",
|
|
7
|
-
resolve: (name) => {
|
|
8
|
-
const { devMode = !1 } = options || {}, base = devMode ? "maz-ui/src/components" : "maz-ui/components", extension = devMode ? ".vue" : "";
|
|
9
|
-
if (mazRegexPascalCase.test(name) && !iconList.includes(name))
|
|
10
|
-
return { from: `${base}/${name}${extension}` };
|
|
11
|
-
if (mazRegexKebabCase.test(name))
|
|
12
|
-
return { from: `${base}/${pascalCase(name)}` };
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
MazComponentsResolver
|
|
18
|
-
};
|
|
1
|
+
import{iconList}from"@maz-ui/icons/icon-list";import{pascalCase}from"@maz-ui/utils/helpers/pascalCase";var mazRegexPascalCase=/^(Maz[A-Z])/;var mazRegexKebabCase=/^(maz-[a-z])/;function MazComponentsResolver(options){return{type:`component`,resolve:name=>{let{devMode=!1}=options||{};let base=devMode?`maz-ui/src/components`:`maz-ui/components`;let extension=devMode?`.vue`:``;if(mazRegexPascalCase.test(name)&&!iconList.includes(name))return{from:`${base}/${name}${extension}`};if(mazRegexKebabCase.test(name))return{from:`${base}/${pascalCase(name)}`}}}}export{MazComponentsResolver};
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
const vRegex = /^v/;
|
|
3
|
-
function MazDirectivesResolver(options) {
|
|
4
|
-
return {
|
|
5
|
-
type: "directive",
|
|
6
|
-
resolve: (name) => {
|
|
7
|
-
const { devMode = !1, prefix = "" } = options || {};
|
|
8
|
-
return { from: devMode ? "maz-ui/src/directives/index.ts" : "maz-ui/directives", as: `v${capitalize(prefix)}${capitalize(name.replace(vRegex, ""))}`, name: `v${name}` };
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
MazDirectivesResolver
|
|
14
|
-
};
|
|
1
|
+
import{capitalize}from"@maz-ui/utils/helpers/capitalize";var vRegex=/^v/;function MazDirectivesResolver(options){return{type:`directive`,resolve:name=>{let{devMode=!1,prefix=``}=options||{};return{from:devMode?`maz-ui/src/directives/index.ts`:`maz-ui/directives`,as:`v${capitalize(prefix)}${capitalize(name.replace(vRegex,``))}`,name:`v${name}`}}}}export{MazDirectivesResolver};
|
|
@@ -1,76 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
const composablesMap = {
|
|
3
|
-
useInjectStrict: !0,
|
|
4
|
-
useAos: !0,
|
|
5
|
-
useBreakpoints: !0,
|
|
6
|
-
useFormField: !0,
|
|
7
|
-
useFormValidator: !0,
|
|
8
|
-
useIdleTimeout: !0,
|
|
9
|
-
useInstanceUniqId: !0,
|
|
10
|
-
useReadingTime: !0,
|
|
11
|
-
useStringMatching: !0,
|
|
12
|
-
useSwipe: !0,
|
|
13
|
-
useTimer: !0,
|
|
14
|
-
useToast: !0,
|
|
15
|
-
useUserVisibility: !0,
|
|
16
|
-
useWait: !0,
|
|
17
|
-
useWindowSize: !0,
|
|
18
|
-
useDisplayNames: !0,
|
|
19
|
-
useFreezeValue: !0,
|
|
20
|
-
useDialog: !0,
|
|
21
|
-
useMountComponent: !0,
|
|
22
|
-
useDropzone: !0,
|
|
23
|
-
useMutationObserver: !0
|
|
24
|
-
}, modulesMap = {
|
|
25
|
-
capitalize: !0,
|
|
26
|
-
getErrorMessage: !0,
|
|
27
|
-
checkAvailability: !0,
|
|
28
|
-
countryCodeToUnicodeFlag: !0,
|
|
29
|
-
formatCurrency: !0,
|
|
30
|
-
formatDate: !0,
|
|
31
|
-
debounce: !0,
|
|
32
|
-
isClient: !0,
|
|
33
|
-
isServer: !0,
|
|
34
|
-
normalizeString: !0,
|
|
35
|
-
formatNumber: !0,
|
|
36
|
-
sleep: !0,
|
|
37
|
-
throttle: !0,
|
|
38
|
-
truthyFilter: !0,
|
|
39
|
-
IdleTimeout: !0,
|
|
40
|
-
throttleId: !0,
|
|
41
|
-
pascalCase: !0,
|
|
42
|
-
camelCase: !0,
|
|
43
|
-
isStandaloneMode: !0,
|
|
44
|
-
debounceId: !0,
|
|
45
|
-
getCountryFlagUrl: !0,
|
|
46
|
-
isEqual: !0,
|
|
47
|
-
debounceCallback: !0,
|
|
48
|
-
ScriptLoader: !0,
|
|
49
|
-
Swipe: !0,
|
|
50
|
-
UserVisibility: !0,
|
|
51
|
-
TextareaAutogrow: !0,
|
|
52
|
-
kebabCase: !0,
|
|
53
|
-
snakeCase: !0,
|
|
54
|
-
upperFirst: !0,
|
|
55
|
-
formatJson: !0
|
|
56
|
-
}, useRegex = /^use/;
|
|
57
|
-
function MazModulesResolver(options) {
|
|
58
|
-
return (name) => {
|
|
59
|
-
const { devMode = !1, prefix = "" } = options || {}, base = devMode ? "maz-ui/src" : "maz-ui", extension = devMode ? "/index.ts" : "";
|
|
60
|
-
if (modulesMap[name] === !0)
|
|
61
|
-
return {
|
|
62
|
-
from: `${base}${extension}`,
|
|
63
|
-
name,
|
|
64
|
-
as: `${prefix.toLowerCase()}${capitalize(name)}`
|
|
65
|
-
};
|
|
66
|
-
if (composablesMap[name] === !0)
|
|
67
|
-
return {
|
|
68
|
-
from: `${base}/composables${extension}`,
|
|
69
|
-
name,
|
|
70
|
-
as: `use${capitalize(prefix)}${name.replace(useRegex, "")}`
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export {
|
|
75
|
-
MazModulesResolver
|
|
76
|
-
};
|
|
1
|
+
import{capitalize}from"@maz-ui/utils/helpers/capitalize";var composablesMap={useInjectStrict:!0,useAos:!0,useBreakpoints:!0,useFormField:!0,useFormValidator:!0,useIdleTimeout:!0,useInstanceUniqId:!0,useReadingTime:!0,useStringMatching:!0,useSwipe:!0,useTimer:!0,useToast:!0,useUserVisibility:!0,useWait:!0,useWindowSize:!0,useDisplayNames:!0,useFreezeValue:!0,useDialog:!0,useMountComponent:!0,useDropzone:!0,useMutationObserver:!0};var modulesMap={capitalize:!0,getErrorMessage:!0,checkAvailability:!0,countryCodeToUnicodeFlag:!0,formatCurrency:!0,formatDate:!0,debounce:!0,isClient:!0,isServer:!0,normalizeString:!0,formatNumber:!0,sleep:!0,throttle:!0,truthyFilter:!0,IdleTimeout:!0,throttleId:!0,pascalCase:!0,camelCase:!0,isStandaloneMode:!0,debounceId:!0,getCountryFlagUrl:!0,isEqual:!0,debounceCallback:!0,ScriptLoader:!0,Swipe:!0,UserVisibility:!0,TextareaAutogrow:!0,kebabCase:!0,snakeCase:!0,upperFirst:!0,formatJson:!0};var useRegex=/^use/;function MazModulesResolver(options){return name=>{let{devMode=!1,prefix=``}=options||{};let base=devMode?`maz-ui/src`:`maz-ui`;let extension=devMode?`/index.ts`:``;if(modulesMap[name]===!0)return{from:`${base}${extension}`,name,as:`${prefix.toLowerCase()}${capitalize(name)}`};if(composablesMap[name]===!0)return{from:`${base}/composables${extension}`,name,as:`use${capitalize(prefix)}${name.replace(useRegex,``)}`}}}export{MazModulesResolver};
|
package/dist/resolvers/index.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MazDirectivesResolver } from "./MazDirectivesResolver.js";
|
|
3
|
-
import { MazModulesResolver } from "./MazModulesResolver.js";
|
|
4
|
-
export {
|
|
5
|
-
MazComponentsResolver,
|
|
6
|
-
MazDirectivesResolver,
|
|
7
|
-
MazModulesResolver
|
|
8
|
-
};
|
|
1
|
+
import{MazModulesResolver}from"./MazModulesResolver.js";import{MazDirectivesResolver}from"./MazDirectivesResolver.js";import{MazComponentsResolver}from"./MazComponentsResolver.js";export{MazComponentsResolver,MazDirectivesResolver,MazModulesResolver};
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createScaleColor, createSimpleColor, getColors } from "./utils/colors.js";
|
|
3
|
-
import { getNumericScreensFromTailwind, screens } from "./variables/breakpoints.js";
|
|
4
|
-
import { baseColors, colorScales, noForegroundColors, scaleColors } from "./variables/colors.js";
|
|
5
|
-
import { designTokens } from "./variables/design-tokens.js";
|
|
6
|
-
import { zIndex } from "./variables/z-indexes.js";
|
|
7
|
-
export {
|
|
8
|
-
baseColors,
|
|
9
|
-
colorScales,
|
|
10
|
-
createScaleColor,
|
|
11
|
-
createSimpleColor,
|
|
12
|
-
defineMazTailwindConfig,
|
|
13
|
-
designTokens,
|
|
14
|
-
getColors,
|
|
15
|
-
getNumericScreensFromTailwind,
|
|
16
|
-
noForegroundColors,
|
|
17
|
-
scaleColors,
|
|
18
|
-
screens,
|
|
19
|
-
zIndex
|
|
20
|
-
};
|
|
1
|
+
import{getNumericScreensFromTailwind,screens}from"./variables/breakpoints.js";import{baseColors,colorScales,noForegroundColors,scaleColors}from"./variables/colors.js";import{createScaleColor,createSimpleColor,getColors}from"./utils/colors.js";import{designTokens}from"./variables/design-tokens.js";import{zIndex}from"./variables/z-indexes.js";import{defineMazTailwindConfig}from"./tailwind.config.js";export{baseColors,colorScales,createScaleColor,createSimpleColor,defineMazTailwindConfig,designTokens,getColors,getNumericScreensFromTailwind,noForegroundColors,scaleColors,screens,zIndex};
|