maz-ui 4.0.0-beta.2 → 4.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/MazAccordion.DUQCf8vy.css +1 -0
- package/dist/assets/{MazAnimatedCounter.CTG-PC5W.css → MazAnimatedCounter.DkZNPRLp.css} +1 -1
- package/dist/assets/MazAnimatedText.DDqCxrFX.css +1 -0
- package/dist/assets/MazBackdrop.BnhcmjbP.css +1 -0
- package/dist/assets/{MazBadge.DN8tdE8_.css → MazBadge.ChI2DaTU.css} +1 -1
- package/dist/assets/MazBtn.BFhP-9HO.css +1 -0
- package/dist/assets/MazCard.DBuQhXtl.css +1 -0
- package/dist/assets/{MazCardSpotlight.Dy-wuLQq.css → MazCardSpotlight.IbPp_y0j.css} +1 -1
- package/dist/assets/MazCheckbox.aH1IKnrR.css +1 -0
- package/dist/assets/MazChecklist.BzF5KtZ3.css +1 -0
- package/dist/assets/MazDatePicker.8GyrtM-j.css +1 -0
- package/dist/assets/MazDropzone.CXu1QtnY.css +1 -0
- package/dist/assets/MazInput.ByolKDfx.css +1 -0
- package/dist/assets/MazInputCode.FA2z4HQd.css +1 -0
- package/dist/assets/MazInputPhoneNumber.CrXS7DOY.css +1 -0
- package/dist/assets/MazInputTags.KNTpDHof.css +1 -0
- package/dist/assets/MazLazyImg.NlPRN3Nk.css +1 -0
- package/dist/assets/MazLink.CFscNMFr.css +1 -0
- package/dist/assets/MazPickerCalendarMonth.Boe_8k4x.css +1 -0
- package/dist/assets/MazPickerMonthSwitcher.CszcpCcY.css +1 -0
- package/dist/assets/{MazPickerYearSwitcher.Dl30Dwor.css → MazPickerYearSwitcher.Cn-nS-Vv.css} +1 -1
- package/dist/assets/MazPopover.rBpotMKW.css +1 -0
- package/dist/assets/MazPullToRefresh.BQ64UvzA.css +1 -0
- package/dist/assets/MazRadio.aTHM-mpx.css +1 -0
- package/dist/assets/MazRadioButtons.SGytq4d7.css +1 -0
- package/dist/assets/MazReadingProgressBar.CwBVXE3g.css +1 -0
- package/dist/assets/MazSelect.CwjnAZiu.css +1 -0
- package/dist/assets/{MazSelectCountry.D2Qudf0K.css → MazSelectCountry.t3GsKyqw.css} +1 -1
- package/dist/assets/{MazSlider.D5SgmZLH.css → MazSlider.y4qpnD0N.css} +1 -1
- package/dist/assets/MazStepper.BD2gDGAX.css +1 -0
- package/dist/assets/MazSwitch.Bxmh2iFj.css +1 -0
- package/dist/assets/{MazTable.B1tkeUfE.css → MazTable.DMlQdImb.css} +1 -1
- package/dist/assets/MazTableRow.DgBXpK9J.css +1 -0
- package/dist/assets/{MazTabsBar.B9N_jdqU.css → MazTabsBar.gcS2Fc-B.css} +1 -1
- package/dist/assets/{MazTabsContentItem.CHfy19ZF.css → MazTabsContentItem.C84SDmj0.css} +1 -1
- package/dist/assets/MazTextarea.li9dWBax.css +1 -0
- package/dist/assets/{PhoneInput.CyWO76iq.css → PhoneInput.BJiKqOF6.css} +1 -1
- package/dist/assets/{fullscreen-img.pvt6196l.css → fullscreen-img.Bkuz1GOX.css} +1 -1
- package/dist/assets/{toast.kunueRvo.css → toast.CC2VQab8.css} +1 -1
- package/dist/chunks/{MazDatePicker.CT5yJhSN.js → MazDatePicker.De3Ltb2F.js} +29 -31
- package/dist/chunks/{MazDialogPromise.vue_vue_type_script_setup_true_lang.BQvDEofz.js → MazDialogConfirm.vue_vue_type_script_setup_true_lang.Grn2kB3x.js} +78 -18
- package/dist/chunks/{MazDropdown.vue_vue_type_style_index_0_lang.abk1IbMX.js → MazDropdown.vue_vue_type_style_index_0_lang.BES3jpuw.js} +12 -22
- package/dist/chunks/{MazInputPhoneNumber.Uwhn1Q9j.js → MazInputPhoneNumber.Ch-PCGiv.js} +14 -12
- package/dist/chunks/{MazInputPrice.vue_vue_type_script_setup_true_lang.GMKzSu7R.js → MazInputPrice.vue_vue_type_script_setup_true_lang.BA6TDX-T.js} +31 -1
- package/dist/chunks/{MazPickerCalendar.RS6ZMdDK.js → MazPickerCalendar.DKXNI8O4.js} +1 -1
- package/dist/chunks/{MazPickerCalendarMonth.hQBSVkc9.js → MazPickerCalendarMonth.DKBqgrNp.js} +5 -5
- package/dist/chunks/{MazPickerCalendarSwitcher.Cp2ux3E4.js → MazPickerCalendarSwitcher.CzIZol3Z.js} +1 -1
- package/dist/chunks/{MazPickerContainer.DnfB3Dqg.js → MazPickerContainer.Mrh-Q52I.js} +1 -1
- package/dist/chunks/{MazPickerHeader.Dlz2yJ1D.js → MazPickerHeader.Bm9vIrtB.js} +1 -1
- package/dist/chunks/{MazPickerMonthSwitcher.BpfCGGxQ.js → MazPickerMonthSwitcher.BSD2GtY6.js} +5 -6
- package/dist/chunks/{MazPickerTime.EuWWNfid.js → MazPickerTime.D0hilq5b.js} +1 -1
- package/dist/chunks/{MazPickerYearSwitcher.D4aO09D3.js → MazPickerYearSwitcher.BIUYJMvj.js} +8 -27
- package/dist/chunks/{MazSwitch.vue_vue_type_style_index_0_lang.DnCjlD6D.js → MazSwitch.vue_vue_type_style_index_0_lang.CU43Y1ky.js} +2 -2
- package/dist/chunks/{MazTable.vue_vue_type_script_setup_true_lang.bm7ng8fK.js → MazTable.vue_vue_type_script_setup_true_lang.BcTw9Tyh.js} +3 -3
- package/dist/chunks/{PhoneInput.CPjyZ8Sq.js → PhoneInput.BzL1_XS5.js} +5 -4
- package/dist/chunks/{utils.BBuYjMbK.js → dom-events.Bbe7wDQl.js} +221 -115
- package/dist/chunks/{en.BzBlrE0C.js → en.Q_4-KljL.js} +12 -0
- package/dist/chunks/{fullscreen-img.directive.CyOHexcO.js → fullscreen-img.directive.Be383en8.js} +2 -2
- package/dist/chunks/{lazy-img.directive.D5zCo3Zi.js → lazy-img.directive.BLFnGqQa.js} +1 -1
- package/dist/chunks/types.D0Bp_UhS.js +6 -0
- package/dist/chunks/{normalizeString.CFe2M8S_.js → useStringMatching.Ba1yCuA4.js} +40 -1
- package/dist/chunks/{useTranslations.BXuww4ux.js → useTranslations.D5aoYwD7.js} +1 -1
- package/dist/chunks/vClickOutside.DIOiluy0.js +107 -0
- package/dist/components/MazAccordion.js +2 -2
- package/dist/components/MazAnimatedCounter.js +3 -3
- package/dist/components/MazAnimatedText.js +2 -2
- package/dist/components/MazBackdrop.js +3 -3
- package/dist/components/MazBadge.js +5 -4
- package/dist/components/MazBtn.js +9 -7
- package/dist/components/MazCard.js +2 -2
- package/dist/components/MazCardSpotlight.js +4 -4
- package/dist/components/MazCarousel.js +1 -1
- package/dist/components/MazCheckbox.js +10 -12
- package/dist/components/MazChecklist.js +4 -5
- package/dist/components/MazDatePicker.js +1 -1
- package/dist/components/MazDialogConfirm.js +6 -0
- package/dist/components/MazDropdown.js +1 -1
- package/dist/components/MazDropzone.js +5 -5
- package/dist/components/MazGallery.js +2 -2
- package/dist/components/MazInput.js +21 -16
- package/dist/components/MazInputCode.js +2 -2
- package/dist/components/MazInputPhoneNumber.js +1 -1
- package/dist/components/MazInputPrice.js +1 -1
- package/dist/components/MazInputTags.js +2 -2
- package/dist/components/MazLazyImg.js +9 -9
- package/dist/components/MazLink.js +9 -5
- package/dist/components/MazPagination.js +1 -1
- package/dist/components/MazPopover.js +177 -89
- package/dist/components/MazPullToRefresh.js +8 -3
- package/dist/components/MazRadio.js +8 -16
- package/dist/components/MazRadioButtons.js +7 -6
- package/dist/components/MazReadingProgressBar.js +10 -3
- package/dist/components/MazSelect.js +24 -14
- package/dist/components/MazSelectCountry.js +15 -9
- package/dist/components/MazSlider.js +2 -2
- package/dist/components/MazStepper.js +2 -2
- package/dist/components/MazSwitch.js +1 -1
- package/dist/components/MazTable.js +3 -3
- package/dist/components/MazTableCell.js +1 -1
- package/dist/components/MazTableRow.js +3 -3
- package/dist/components/MazTableTitle.js +1 -1
- package/dist/components/MazTabsBar.js +6 -6
- package/dist/components/MazTabsContentItem.js +6 -7
- package/dist/components/MazTextarea.js +24 -3
- package/dist/components/index.js +8 -8
- package/dist/composables/index.js +4 -2
- package/dist/composables/useAos.js +1 -1
- package/dist/composables/useDialog.js +1 -1
- package/dist/composables/useDisplayNames.js +7 -1
- package/dist/composables/useDropzone.js +7 -7
- package/dist/composables/useFormField.js +15 -19
- package/dist/composables/useFormValidator.js +58 -29
- package/dist/composables/useIdleTimeout.js +108 -1
- package/dist/composables/useInjectStrict.js +2 -2
- package/dist/composables/useStringMatching.js +3 -40
- package/dist/composables/useSwipe.js +77 -1
- package/dist/composables/useToast.js +1 -1
- package/dist/composables/useUserVisibility.js +47 -1
- package/dist/composables/useWait.js +1 -1
- package/dist/composables/useWindowSize.js +1 -1
- package/dist/css/main.css +1 -1
- package/dist/directives/index.js +7 -7
- package/dist/directives/vClickOutside.js +4 -102
- package/dist/directives/vFullscreenImg.js +1 -1
- package/dist/directives/vLazyImg.js +2 -2
- package/dist/directives/vTooltip.js +97 -60
- package/dist/index.js +1 -114
- package/dist/plugins/dialog.js +3 -3
- package/dist/plugins/maz-ui.js +150 -143
- package/dist/plugins/toast.js +8 -11
- package/dist/resolvers/MazComponentsResolver.js +7 -1
- package/dist/resolvers/MazDirectivesResolver.js +1 -1
- package/dist/resolvers/MazModulesResolver.js +3 -1
- package/dist/tailwindcss/tailwind.config.js +5 -2
- package/dist/tailwindcss/variables/design-tokens.js +3 -0
- package/dist/types/components/MazAccordion.vue.d.ts +15 -2
- package/dist/types/components/MazBtn.vue.d.ts +1 -0
- package/dist/types/components/MazCard.vue.d.ts +1 -1
- package/dist/types/components/MazCheckbox.vue.d.ts +0 -6
- package/dist/types/components/MazChecklist.vue.d.ts +1 -1
- package/dist/types/components/MazDatePicker.vue.d.ts +15 -23
- package/dist/types/components/MazDialogConfirm/useMazDialogConfirm.d.ts +47 -0
- package/dist/types/components/{MazDialogPromise.vue.d.ts → MazDialogConfirm.vue.d.ts} +43 -10
- package/dist/types/components/MazDropdown.vue.d.ts +12 -12
- package/dist/types/components/MazInput.vue.d.ts +7 -0
- package/dist/types/components/MazInputNumber.vue.d.ts +2 -2
- package/dist/types/components/MazInputPhoneNumber/useLibphonenumber.d.ts +2 -2
- package/dist/types/components/MazInputPhoneNumber/useMazInputPhoneNumber.d.ts +6 -2
- package/dist/types/components/MazInputPhoneNumber.vue.d.ts +38 -15
- package/dist/types/components/MazInputTags.vue.d.ts +1 -1
- package/dist/types/components/MazLazyImg.vue.d.ts +8 -8
- package/dist/types/components/MazLink.vue.d.ts +11 -0
- package/dist/types/components/MazPopover.vue.d.ts +18 -15
- package/dist/types/components/MazRadioButtons.vue.d.ts +1 -1
- package/dist/types/components/MazSelect.vue.d.ts +2 -2
- package/dist/types/components/MazSelectCountry.vue.d.ts +13 -4
- package/dist/types/components/MazStepper.vue.d.ts +13 -2
- package/dist/types/components/MazTable.vue.d.ts +63 -2
- package/dist/types/components/index.d.ts +4 -4
- package/dist/types/components/types.d.ts +1 -0
- package/dist/types/composables/index.d.ts +2 -1
- package/dist/types/composables/useDisplayNames.d.ts +2 -2
- package/dist/types/composables/useDropzone.d.ts +3 -3
- package/dist/types/composables/useFormField.d.ts +16 -56
- package/dist/types/composables/useFormValidator/config.d.ts +2 -2
- package/dist/types/composables/useFormValidator/dom-events.d.ts +19 -0
- package/dist/types/composables/useFormValidator/state-management.d.ts +72 -0
- package/dist/types/composables/useFormValidator/types.d.ts +20 -32
- package/dist/types/composables/useFormValidator/validation.d.ts +37 -0
- package/dist/types/composables/useFormValidator.d.ts +16 -10
- package/dist/types/composables/useIdleTimeout.d.ts +1 -1
- package/dist/types/composables/useInjectStrict.d.ts +1 -1
- package/dist/types/composables/useSwipe.d.ts +1 -1
- package/dist/types/composables/useUserVisibility.d.ts +1 -1
- package/dist/types/directives/vClickOutside.d.ts +11 -18
- package/dist/types/directives/vFullscreenImg/fullscreen-img.directive.d.ts +3 -5
- package/dist/types/directives/vFullscreenImg.d.ts +9 -4
- package/dist/types/directives/vLazyImg/lazy-img.directive.d.ts +3 -5
- package/dist/types/directives/vLazyImg.d.ts +11 -6
- package/dist/types/directives/vTooltip.d.ts +14 -14
- package/dist/types/directives/vZoomImg/zoom-img.directive.d.ts +2 -0
- package/dist/types/directives/vZoomImg.d.ts +9 -5
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins/aos.d.ts +30 -4
- package/dist/types/plugins/dialog/DialogHandler.d.ts +2 -2
- package/dist/types/plugins/dialog.d.ts +2 -4
- package/dist/types/plugins/maz-ui.d.ts +2 -63
- package/dist/types/plugins/toast.d.ts +2 -4
- package/dist/types/plugins/wait.d.ts +2 -3
- package/dist/types/tailwindcss/tailwind.config.d.ts +5 -0
- package/dist/types/tailwindcss/variables/design-tokens.d.ts +3 -0
- package/package.json +42 -39
- package/dist/assets/MazAccordion.esK3rR4p.css +0 -1
- package/dist/assets/MazAnimatedText.BrOwWuqf.css +0 -1
- package/dist/assets/MazBackdrop.DNpnLh63.css +0 -1
- package/dist/assets/MazBtn.BnRxVlqS.css +0 -1
- package/dist/assets/MazCard.C6nDaeIC.css +0 -1
- package/dist/assets/MazCheckbox.C_qIngLy.css +0 -1
- package/dist/assets/MazChecklist.CWK_Gl-t.css +0 -1
- package/dist/assets/MazDatePicker.V5JwKPrQ.css +0 -1
- package/dist/assets/MazDropzone.DafxQwbq.css +0 -1
- package/dist/assets/MazInput.DW2KOJHY.css +0 -1
- package/dist/assets/MazInputCode.CG6EJBEk.css +0 -1
- package/dist/assets/MazInputPhoneNumber.vpA2mrZn.css +0 -1
- package/dist/assets/MazInputTags.B_s9J3sw.css +0 -1
- package/dist/assets/MazLazyImg.BNaVtpfX.css +0 -1
- package/dist/assets/MazLink.CCfbrUs0.css +0 -1
- package/dist/assets/MazPickerCalendarMonth.zkrPVHDv.css +0 -1
- package/dist/assets/MazPickerMonthSwitcher.168v7Hs1.css +0 -1
- package/dist/assets/MazPopover.Bth9NWia.css +0 -1
- package/dist/assets/MazPullToRefresh.DABqbGtK.css +0 -1
- package/dist/assets/MazRadio.DKMFWwy_.css +0 -1
- package/dist/assets/MazRadioButtons.BA4rjgK9.css +0 -1
- package/dist/assets/MazReadingProgressBar.n1Is8_Y3.css +0 -1
- package/dist/assets/MazSelect.DZZpDg8z.css +0 -1
- package/dist/assets/MazStepper.DYMde9uq.css +0 -1
- package/dist/assets/MazSwitch.Z1ZMm7tx.css +0 -1
- package/dist/assets/MazTableRow.B78Bd4Kv.css +0 -1
- package/dist/assets/MazTextarea.Dz11mUeK.css +0 -1
- package/dist/chunks/TextareaAutogrow.C22LQx0k.js +0 -25
- package/dist/chunks/debounceCallback.B69vn57Q.js +0 -7
- package/dist/chunks/formatCurrency.C8NzW9Ii.js +0 -34
- package/dist/chunks/formatDate.DZ_OzdnV.js +0 -21
- package/dist/chunks/getCountryFlagUrl.dQjriBXx.js +0 -9
- package/dist/chunks/idleTimeout.-ICpdeGV.js +0 -111
- package/dist/chunks/isServer.BokzeB-Q.js +0 -6
- package/dist/chunks/isStandaloneMode.BpUpOTbA.js +0 -10
- package/dist/chunks/pascalCase.D_nuQ66I.js +0 -11
- package/dist/chunks/swipeHandler.8emelhOL.js +0 -80
- package/dist/chunks/throttle.DN8ARw0a.js +0 -11
- package/dist/chunks/throttleId.7PhWZjcS.js +0 -62
- package/dist/chunks/userVisibility.BbQSJASv.js +0 -50
- package/dist/chunks/x-mark.CTalOvvY.js +0 -23
- package/dist/components/MazDialogPromise.js +0 -6
- package/dist/types/components/MazDialogPromise/useMazDialogPromise.d.ts +0 -54
- package/dist/types/components/MazInputPhoneNumber/types.d.ts +0 -22
- package/dist/types/composables/useFormValidator/utils.d.ts +0 -116
package/dist/plugins/maz-ui.js
CHANGED
|
@@ -14,26 +14,26 @@ function formatHSL(h, s, l) {
|
|
|
14
14
|
return `${roundedH} ${roundedS}% ${roundedL}%`;
|
|
15
15
|
}
|
|
16
16
|
const LUMINOSITY_OFFSETS = {
|
|
17
|
-
50:
|
|
18
|
-
// Base +
|
|
19
|
-
100:
|
|
20
|
-
// Base +
|
|
21
|
-
200:
|
|
22
|
-
// Base +
|
|
23
|
-
300:
|
|
24
|
-
// Base + 20% = light-medium
|
|
25
|
-
400: 10,
|
|
17
|
+
50: 37.5,
|
|
18
|
+
// Base + 50% = very light
|
|
19
|
+
100: 30,
|
|
20
|
+
// Base + 35% = light
|
|
21
|
+
200: 22.5,
|
|
22
|
+
// Base + 20% = moderately light
|
|
23
|
+
300: 15,
|
|
26
24
|
// Base + 10% = slightly lighter
|
|
25
|
+
400: 7.5,
|
|
26
|
+
// Base + 5% = slightly lighter
|
|
27
27
|
500: 0,
|
|
28
28
|
// Base (original color)
|
|
29
|
-
600: -
|
|
30
|
-
// Base -
|
|
31
|
-
700: -
|
|
32
|
-
// Base -
|
|
33
|
-
800: -
|
|
34
|
-
// Base -
|
|
35
|
-
900: -
|
|
36
|
-
// Base -
|
|
29
|
+
600: -7.5,
|
|
30
|
+
// Base - 5% = slightly darker
|
|
31
|
+
700: -15,
|
|
32
|
+
// Base - 15% = dark
|
|
33
|
+
800: -22.5,
|
|
34
|
+
// Base - 20% = very dark
|
|
35
|
+
900: -30
|
|
36
|
+
// Base - 25% = extremely dark
|
|
37
37
|
};
|
|
38
38
|
function calculateSaturationMultiplier(baseVariant, targetVariant, baseSaturation) {
|
|
39
39
|
if (targetVariant === baseVariant)
|
|
@@ -214,7 +214,8 @@ function generateAllColorScales(colors, prefix) {
|
|
|
214
214
|
}
|
|
215
215
|
}), colorScales;
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
var CSS_IDS = /* @__PURE__ */ ((CSS_IDS2) => (CSS_IDS2.FULL = "maz-theme-full", CSS_IDS2.CRITICAL = "maz-theme-critical", CSS_IDS2))(CSS_IDS || {});
|
|
218
|
+
function injectCSS(css, id) {
|
|
218
219
|
if (typeof document > "u")
|
|
219
220
|
return;
|
|
220
221
|
let styleElement = document.getElementById(id);
|
|
@@ -251,7 +252,7 @@ function getColorMode(colorMode) {
|
|
|
251
252
|
return savedMode && ["light", "dark"].includes(savedMode) ? savedMode : getSystemPrefersDark();
|
|
252
253
|
}
|
|
253
254
|
function getSystemPrefersDark() {
|
|
254
|
-
return typeof window < "u" && typeof
|
|
255
|
+
return typeof globalThis.window < "u" && typeof globalThis.matchMedia == "function" && globalThis.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
255
256
|
}
|
|
256
257
|
function applyDarkMode(darkModeStrategy, isDark) {
|
|
257
258
|
typeof document > "u" || darkModeStrategy !== "class" || (isDark ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark"));
|
|
@@ -260,18 +261,17 @@ function injectThemeCSS(finalPreset, config) {
|
|
|
260
261
|
if (typeof document > "u")
|
|
261
262
|
return;
|
|
262
263
|
const cssOptions = {
|
|
263
|
-
mode:
|
|
264
|
-
prefix: config.prefix
|
|
264
|
+
mode: config.mode
|
|
265
265
|
};
|
|
266
266
|
if (config.injectCriticalCSS) {
|
|
267
267
|
const criticalCSS = generateCriticalCSS(finalPreset, cssOptions);
|
|
268
|
-
injectCSS(criticalCSS,
|
|
268
|
+
injectCSS(criticalCSS, CSS_IDS.CRITICAL);
|
|
269
269
|
}
|
|
270
270
|
if (!config.injectFullCSS)
|
|
271
271
|
return;
|
|
272
272
|
const fullCSS = generateFullCSS(finalPreset, cssOptions);
|
|
273
|
-
config.strategy === "runtime" ? injectCSS(fullCSS,
|
|
274
|
-
injectCSS(fullCSS,
|
|
273
|
+
config.strategy === "runtime" ? injectCSS(fullCSS, CSS_IDS.FULL) : config.strategy === "hybrid" && requestIdleCallback(() => {
|
|
274
|
+
injectCSS(fullCSS, CSS_IDS.FULL);
|
|
275
275
|
}, { timeout: 100 });
|
|
276
276
|
}
|
|
277
277
|
function injectThemeState(app, themeState) {
|
|
@@ -283,20 +283,21 @@ const MazUiTheme = {
|
|
|
283
283
|
preset: "maz-ui",
|
|
284
284
|
strategy: "runtime",
|
|
285
285
|
darkModeStrategy: "class",
|
|
286
|
-
colorMode: "
|
|
287
|
-
prefix: "maz",
|
|
286
|
+
colorMode: options.mode !== "both" ? options.mode : options.colorMode,
|
|
288
287
|
injectCriticalCSS: !0,
|
|
289
288
|
injectFullCSS: !0,
|
|
289
|
+
mode: "both",
|
|
290
290
|
...options
|
|
291
|
-
}, colorMode = getColorMode(config.colorMode), isDark = colorMode === "auto" ? getSystemPrefersDark() === "dark" : colorMode === "dark", themeState = reactive({
|
|
291
|
+
}, colorMode = config.mode !== "both" ? config.mode : getColorMode(config.colorMode), isDark = colorMode === "auto" && config.mode === "both" ? getSystemPrefersDark() === "dark" : colorMode === "dark" || config.mode === "dark", themeState = reactive({
|
|
292
292
|
// @ts-expect-error - empty currentPreset to avoid error
|
|
293
293
|
currentPreset: {},
|
|
294
|
+
mode: config.mode,
|
|
294
295
|
colorMode,
|
|
295
296
|
isDark,
|
|
296
297
|
strategy: config.strategy,
|
|
297
298
|
darkModeStrategy: config.darkModeStrategy
|
|
298
299
|
});
|
|
299
|
-
applyDarkMode(config.darkModeStrategy,
|
|
300
|
+
applyDarkMode(config.darkModeStrategy, isDark), injectThemeState(app, themeState);
|
|
300
301
|
const preset = await getPreset(config.preset), finalPreset = config.overrides ? {
|
|
301
302
|
...preset,
|
|
302
303
|
foundation: {
|
|
@@ -310,157 +311,163 @@ const MazUiTheme = {
|
|
|
310
311
|
} : preset;
|
|
311
312
|
themeState.currentPreset = finalPreset, config.strategy !== "buildtime" && injectThemeCSS(finalPreset, config);
|
|
312
313
|
}
|
|
313
|
-
},
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
es: () => import("../chunks/es.BV1TlfTw.js"),
|
|
317
|
-
|
|
318
|
-
it: () => import("../chunks/it.Be9xhI4P.js"),
|
|
319
|
-
|
|
320
|
-
"
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
|
|
314
|
+
}, defaultLocalesLoaders = {
|
|
315
|
+
"./locales/de.ts": () => import("../chunks/de.B15Maq8Z.js").then((m) => ({ default: m.default })),
|
|
316
|
+
"./locales/en.ts": () => import("../chunks/en.Q_4-KljL.js").then((m) => ({ default: m.default })),
|
|
317
|
+
"./locales/es.ts": () => import("../chunks/es.BV1TlfTw.js").then((m) => ({ default: m.default })),
|
|
318
|
+
"./locales/fr.ts": () => import("../chunks/fr.BVPG-7Dk.js").then((m) => ({ default: m.default })),
|
|
319
|
+
"./locales/it.ts": () => import("../chunks/it.Be9xhI4P.js").then((m) => ({ default: m.default })),
|
|
320
|
+
"./locales/ja.ts": () => import("../chunks/ja.CWU7KYEA.js").then((m) => ({ default: m.default })),
|
|
321
|
+
"./locales/pt.ts": () => import("../chunks/pt.CfaFSxVt.js").then((m) => ({ default: m.default })),
|
|
322
|
+
"./locales/zh-CN.ts": () => import("../chunks/zh-CN.CCkuvk-E.js").then((m) => ({ default: m.default }))
|
|
323
|
+
}, defaultMessagesCache = /* @__PURE__ */ new Map(), globalState = reactive({
|
|
324
|
+
loadedLocales: /* @__PURE__ */ new Set(),
|
|
325
|
+
messages: {},
|
|
326
|
+
userMessages: {},
|
|
327
|
+
loadingPromises: /* @__PURE__ */ new Map()
|
|
328
|
+
});
|
|
329
|
+
function getMessage(obj, path) {
|
|
324
330
|
return path.split(".").reduce((current, key) => current?.[key], obj);
|
|
325
331
|
}
|
|
326
|
-
function
|
|
332
|
+
function setMessage(obj, path, value) {
|
|
327
333
|
const keys = path.split("."), lastKey = keys.pop(), target = keys.reduce((current, key) => ((!current[key] || typeof current[key] != "object") && (current[key] = {}), current[key]), obj);
|
|
328
334
|
target[lastKey] = value;
|
|
329
335
|
}
|
|
330
|
-
function
|
|
336
|
+
function isFlattenedObject(obj) {
|
|
331
337
|
return !obj || typeof obj != "object" ? !1 : Object.keys(obj).some((key) => key.includes("."));
|
|
332
338
|
}
|
|
333
339
|
function flattenToNested(flatObj) {
|
|
334
|
-
if (!
|
|
340
|
+
if (!isFlattenedObject(flatObj))
|
|
335
341
|
return flatObj;
|
|
336
342
|
const nested = {};
|
|
337
343
|
for (const [key, value] of Object.entries(flatObj))
|
|
338
|
-
key.includes(".") ?
|
|
344
|
+
key.includes(".") ? setMessage(nested, key, value) : nested[key] = value;
|
|
339
345
|
return nested;
|
|
340
346
|
}
|
|
341
|
-
function
|
|
347
|
+
function mergeMessages(target, source) {
|
|
342
348
|
const normalizedSource = flattenToNested(source), result = { ...flattenToNested(target) };
|
|
343
349
|
for (const key in normalizedSource)
|
|
344
|
-
normalizedSource[key] && typeof normalizedSource[key] == "object" ? result[key] =
|
|
350
|
+
normalizedSource[key] && typeof normalizedSource[key] == "object" ? result[key] = mergeMessages(result[key] || {}, normalizedSource[key]) : result[key] = normalizedSource[key];
|
|
345
351
|
return result;
|
|
346
352
|
}
|
|
347
353
|
function interpolate(message, variables) {
|
|
348
354
|
return variables ? message.replace(/\{(\w+)\}/g, (match, key) => variables[key] !== void 0 ? String(variables[key]) : match) : message;
|
|
349
355
|
}
|
|
350
|
-
async function
|
|
356
|
+
async function loadDefaultMessages(locale) {
|
|
357
|
+
if (defaultMessagesCache.has(locale))
|
|
358
|
+
return defaultMessagesCache.get(locale);
|
|
359
|
+
const loaderPath = `./locales/${locale}.ts`, loader = defaultLocalesLoaders[loaderPath];
|
|
360
|
+
if (!loader)
|
|
361
|
+
return {};
|
|
362
|
+
try {
|
|
363
|
+
const messages = (await loader()).default;
|
|
364
|
+
return defaultMessagesCache.set(locale, messages), messages;
|
|
365
|
+
} catch (error) {
|
|
366
|
+
return console.error(`Failed to load default messages for locale "${locale}":`, error), {};
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function loadLocale(targetLocale) {
|
|
370
|
+
if (globalState.loadedLocales.has(targetLocale))
|
|
371
|
+
return Promise.resolve();
|
|
372
|
+
if (globalState.loadingPromises.has(targetLocale))
|
|
373
|
+
return globalState.loadingPromises.get(targetLocale);
|
|
374
|
+
const loadingPromise = (async () => {
|
|
375
|
+
try {
|
|
376
|
+
const localeDefaultMessages = await loadDefaultMessages(targetLocale);
|
|
377
|
+
let localeUserMessages = {};
|
|
378
|
+
const userLoader = globalState.userMessages[targetLocale];
|
|
379
|
+
if (userLoader)
|
|
380
|
+
if (typeof userLoader == "function")
|
|
381
|
+
try {
|
|
382
|
+
const userMessages = await userLoader();
|
|
383
|
+
localeUserMessages = "default" in userMessages ? userMessages.default : userMessages;
|
|
384
|
+
} catch (error) {
|
|
385
|
+
console.error(`Failed to load user translations for locale "${targetLocale}":`, error), localeUserMessages = {};
|
|
386
|
+
}
|
|
387
|
+
else
|
|
388
|
+
localeUserMessages = userLoader;
|
|
389
|
+
globalState.messages[targetLocale] = mergeMessages(localeDefaultMessages, localeUserMessages), globalState.loadedLocales.add(targetLocale);
|
|
390
|
+
} catch (error) {
|
|
391
|
+
console.error(`Failed to load translations for locale "${targetLocale}":`, error), globalState.messages[targetLocale] = {}, globalState.loadedLocales.add(targetLocale);
|
|
392
|
+
} finally {
|
|
393
|
+
globalState.loadingPromises.delete(targetLocale);
|
|
394
|
+
}
|
|
395
|
+
})();
|
|
396
|
+
return globalState.loadingPromises.set(targetLocale, loadingPromise), loadingPromise;
|
|
397
|
+
}
|
|
398
|
+
function createMazTranslations(options = {}) {
|
|
351
399
|
const {
|
|
352
400
|
locale: initialLocale = "en",
|
|
353
401
|
fallbackLocale = "en",
|
|
354
402
|
preloadFallback = !0,
|
|
355
403
|
messages = {}
|
|
356
|
-
} = options, locale = ref(initialLocale)
|
|
404
|
+
} = options, locale = ref(initialLocale);
|
|
357
405
|
for (const [loc, msgs] of Object.entries(messages))
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
const userLoader = userMessageLoaders.value[targetLocale];
|
|
369
|
-
userLoader && (typeof userLoader == "function" ? userMessages = await userLoader() : userMessages = userLoader), messagesRef.value[targetLocale] = merge(defaultMessages, userMessages), loadedLocales.value.add(targetLocale);
|
|
370
|
-
} catch (error) {
|
|
371
|
-
console.error(`Failed to load translations for locale "${targetLocale}":`, error), messagesRef.value[targetLocale] = {}, loadedLocales.value.add(targetLocale);
|
|
372
|
-
} finally {
|
|
373
|
-
loadingPromises.value.delete(targetLocale);
|
|
374
|
-
}
|
|
375
|
-
})();
|
|
376
|
-
return loadingPromises.value.set(targetLocale, loadingPromise), loadingPromise;
|
|
377
|
-
}
|
|
378
|
-
const localePromises = [];
|
|
379
|
-
return localePromises.push(loadLocaleMessages(initialLocale)), preloadFallback && fallbackLocale !== initialLocale && localePromises.push(loadLocaleMessages(fallbackLocale)), await Promise.all(localePromises), { locale, t: (key, variables) => {
|
|
380
|
-
let message = get(messagesRef.value[locale.value], key);
|
|
381
|
-
if (!message && locale.value !== fallbackLocale) {
|
|
382
|
-
if (!loadedLocales.value.has(fallbackLocale))
|
|
383
|
-
return loadLocaleMessages(fallbackLocale)?.catch(console.error), console.warn(`Fallback locale "${fallbackLocale}" not loaded yet for key "${key}", loading...`), key;
|
|
384
|
-
message = get(messagesRef.value[fallbackLocale], key);
|
|
406
|
+
globalState.userMessages[loc] = msgs, msgs && typeof msgs == "object" && (globalState.messages[loc] = { ...globalState.messages[loc], ...msgs });
|
|
407
|
+
setTimeout(() => {
|
|
408
|
+
loadLocale(initialLocale).catch(console.error), preloadFallback && fallbackLocale !== initialLocale && loadLocale(fallbackLocale).catch(console.error);
|
|
409
|
+
}, 0);
|
|
410
|
+
function t(key, variables) {
|
|
411
|
+
let message = getMessage(globalState.messages[locale.value], key);
|
|
412
|
+
if (!message && fallbackLocale && locale.value !== fallbackLocale) {
|
|
413
|
+
if (!globalState.loadedLocales.has(fallbackLocale))
|
|
414
|
+
return loadLocale(fallbackLocale).catch(console.error), key;
|
|
415
|
+
message = getMessage(globalState.messages[fallbackLocale], key);
|
|
385
416
|
}
|
|
386
417
|
if (!message && fallbackLocale !== "en" && locale.value !== "en") {
|
|
387
|
-
if (!loadedLocales.
|
|
388
|
-
return
|
|
389
|
-
message =
|
|
418
|
+
if (!globalState.loadedLocales.has("en"))
|
|
419
|
+
return loadLocale("en").catch(console.error), key;
|
|
420
|
+
message = getMessage(globalState.messages.en, key);
|
|
390
421
|
}
|
|
391
|
-
return message ? interpolate(String(message), variables) : (console.warn(`Translation
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
422
|
+
return message ? interpolate(String(message), variables) : (console.warn(`[@maz-ui/translations] Translation not found for key: ${key}`), key);
|
|
423
|
+
}
|
|
424
|
+
async function setLocale(newLocale) {
|
|
425
|
+
globalState.loadedLocales.has(newLocale) || await loadLocale(newLocale), locale.value = newLocale;
|
|
426
|
+
}
|
|
427
|
+
function isLocaleLoaded(localeToCheck) {
|
|
428
|
+
return globalState.loadedLocales.has(localeToCheck);
|
|
429
|
+
}
|
|
430
|
+
function isLocaleLoading(localeToCheck) {
|
|
431
|
+
return globalState.loadingPromises.has(localeToCheck);
|
|
432
|
+
}
|
|
433
|
+
function getAvailableLocales() {
|
|
434
|
+
const locales = /* @__PURE__ */ new Set();
|
|
435
|
+
for (const [path, loader] of Object.entries(defaultLocalesLoaders))
|
|
436
|
+
loader && typeof loader == "function" && locales.add(path.replace("./locales/", "").replace(".ts", ""));
|
|
437
|
+
for (const path of Object.keys(globalState.userMessages))
|
|
438
|
+
locales.add(path);
|
|
439
|
+
return Array.from(locales);
|
|
440
|
+
}
|
|
441
|
+
function getMessages() {
|
|
442
|
+
return globalState.messages;
|
|
443
|
+
}
|
|
444
|
+
function getLoadedLocales() {
|
|
445
|
+
return Object.keys(globalState.messages);
|
|
446
|
+
}
|
|
447
|
+
function setLocaleMessage(targetLocale, messages2) {
|
|
448
|
+
globalState.messages[targetLocale] || (globalState.messages[targetLocale] = {}), globalState.messages[targetLocale] = mergeMessages(globalState.messages[targetLocale], messages2), globalState.loadedLocales.add(targetLocale);
|
|
449
|
+
}
|
|
450
|
+
return {
|
|
451
|
+
locale,
|
|
452
|
+
t,
|
|
453
|
+
setLocale,
|
|
454
|
+
isLocaleLoaded,
|
|
455
|
+
isLocaleLoading,
|
|
456
|
+
getAvailableLocales,
|
|
457
|
+
setLocaleMessage,
|
|
458
|
+
getMessages,
|
|
459
|
+
getLoadedLocales
|
|
460
|
+
};
|
|
395
461
|
}
|
|
396
462
|
const MazTranslations = {
|
|
397
|
-
|
|
398
|
-
const i18n =
|
|
463
|
+
install(app, options = {}) {
|
|
464
|
+
const i18n = createMazTranslations(options);
|
|
399
465
|
return app.config.globalProperties.$mazTranslations = i18n, app.provide("mazTranslations", i18n), i18n;
|
|
400
466
|
}
|
|
401
467
|
}, MazUi = {
|
|
402
|
-
|
|
403
|
-
async install(app, options = {}) {
|
|
468
|
+
install(app, options = {}) {
|
|
404
469
|
const { theme, translations } = options;
|
|
405
470
|
app.use(MazUiTheme, theme), app.use(MazTranslations, translations);
|
|
406
|
-
const pluginPromises = [];
|
|
407
|
-
if (options.plugins?.dialog) {
|
|
408
|
-
const dialogOptions = typeof options.plugins.dialog == "boolean" ? void 0 : options.plugins.dialog;
|
|
409
|
-
pluginPromises.push(
|
|
410
|
-
import("./dialog.js").then(({ DialogPlugin }) => {
|
|
411
|
-
app.use(DialogPlugin, dialogOptions);
|
|
412
|
-
})
|
|
413
|
-
);
|
|
414
|
-
}
|
|
415
|
-
if (options.plugins?.toast) {
|
|
416
|
-
const toastOptions = typeof options.plugins.toast == "boolean" ? void 0 : options.plugins.toast;
|
|
417
|
-
pluginPromises.push(
|
|
418
|
-
import("./toast.js").then(({ ToastPlugin }) => {
|
|
419
|
-
app.use(ToastPlugin, toastOptions);
|
|
420
|
-
})
|
|
421
|
-
);
|
|
422
|
-
}
|
|
423
|
-
if (options.plugins?.wait && pluginPromises.push(
|
|
424
|
-
import("./wait.js").then(({ WaitPlugin }) => {
|
|
425
|
-
app.use(WaitPlugin);
|
|
426
|
-
})
|
|
427
|
-
), options.plugins?.aos) {
|
|
428
|
-
const aosOptions = typeof options.plugins.aos == "boolean" ? void 0 : options.plugins.aos;
|
|
429
|
-
pluginPromises.push(
|
|
430
|
-
import("./aos.js").then(({ AosPlugin }) => {
|
|
431
|
-
app.use(AosPlugin, aosOptions);
|
|
432
|
-
})
|
|
433
|
-
);
|
|
434
|
-
}
|
|
435
|
-
if (options.directives?.vTooltip) {
|
|
436
|
-
const vTooltipOptions = typeof options.directives.vTooltip == "boolean" ? void 0 : options.directives.vTooltip;
|
|
437
|
-
pluginPromises.push(
|
|
438
|
-
import("../directives/vTooltip.js").then(({ vTooltipInstall }) => {
|
|
439
|
-
app.use(vTooltipInstall, vTooltipOptions);
|
|
440
|
-
})
|
|
441
|
-
);
|
|
442
|
-
}
|
|
443
|
-
if (options.directives?.vLazyImg) {
|
|
444
|
-
const vLazyImgOptions = typeof options.directives.vLazyImg == "boolean" ? void 0 : options.directives.vLazyImg;
|
|
445
|
-
pluginPromises.push(
|
|
446
|
-
import("../directives/vLazyImg.js").then(({ vLazyImgInstall }) => {
|
|
447
|
-
app.use(vLazyImgInstall, vLazyImgOptions);
|
|
448
|
-
})
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
options.directives?.vClickOutside && pluginPromises.push(
|
|
452
|
-
import("../directives/vClickOutside.js").then(({ vClickOutsideInstall }) => {
|
|
453
|
-
app.use(vClickOutsideInstall);
|
|
454
|
-
})
|
|
455
|
-
), options.directives?.vFullscreenImg && pluginPromises.push(
|
|
456
|
-
import("../directives/vFullscreenImg.js").then(({ vFullscreenImgInstall }) => {
|
|
457
|
-
app.use(vFullscreenImgInstall);
|
|
458
|
-
})
|
|
459
|
-
), options.directives?.vZoomImg && pluginPromises.push(
|
|
460
|
-
import("../directives/vZoomImg.js").then(({ vZoomImgInstall }) => {
|
|
461
|
-
app.use(vZoomImgInstall);
|
|
462
|
-
})
|
|
463
|
-
), await Promise.all(pluginPromises);
|
|
464
471
|
}
|
|
465
472
|
};
|
|
466
473
|
export {
|
package/dist/plugins/toast.js
CHANGED
|
@@ -3,7 +3,7 @@ import { defineComponent, defineAsyncComponent, ref, computed, watch, onMounted,
|
|
|
3
3
|
import { MazExclamationCircle, MazCheckCircle, MazInformationCircle, MazExclamationTriangle, MazXMark, MazArrowTopRightOnSquare, MazLinkIcon } from "@maz-ui/icons";
|
|
4
4
|
import { useTimer } from "../composables/useTimer.js";
|
|
5
5
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
6
|
-
import '../assets/toast.
|
|
6
|
+
import '../assets/toast.CC2VQab8.css';const _hoisted_1 = ["textContent", "innerHTML"], _hoisted_2 = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "m-toast__progress-bar"
|
|
9
9
|
}, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -148,8 +148,8 @@ import '../assets/toast.kunueRvo.css';const _hoisted_1 = ["textContent", "innerH
|
|
|
148
148
|
class: "m-toast__button",
|
|
149
149
|
onMouseover: _cache[0] || (_cache[0] = ($event) => toggleTimer(!0)),
|
|
150
150
|
onMouseleave: _cache[1] || (_cache[1] = ($event) => toggleTimer(!1)),
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
onTouchstartPassive: _cache[2] || (_cache[2] = ($event) => toggleTimer(!0)),
|
|
152
|
+
onTouchendPassive: _cache[3] || (_cache[3] = ($event) => toggleTimer(!1)),
|
|
153
153
|
onClick: _cache[4] || (_cache[4] = withModifiers(($event) => click($event), ["stop"]))
|
|
154
154
|
}, [
|
|
155
155
|
iconComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(iconComponent.value), {
|
|
@@ -161,13 +161,10 @@ import '../assets/toast.kunueRvo.css';const _hoisted_1 = ["textContent", "innerH
|
|
|
161
161
|
textContent: toDisplayString(_ctx.html ? void 0 : _ctx.message),
|
|
162
162
|
innerHTML: _ctx.html ? _ctx.message : void 0
|
|
163
163
|
}, null, 8, _hoisted_1),
|
|
164
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(internalButtons.value, (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
loading: isActionLoading.value || _button.loading,
|
|
169
|
-
"right-icon": getButtonRightIcon(_button),
|
|
170
|
-
onClick: withModifiers(($event) => onButtonClick(_button, $event), ["stop"])
|
|
164
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(internalButtons.value, (toastButton, index) => (openBlock(), createBlock(unref(MazBtn), mergeProps({ key: index }, { ref_for: !0 }, toastButton, {
|
|
165
|
+
loading: isActionLoading.value || toastButton.loading,
|
|
166
|
+
"right-icon": getButtonRightIcon(toastButton),
|
|
167
|
+
onClick: withModifiers(($event) => onButtonClick(toastButton, $event), ["stop"])
|
|
171
168
|
}), null, 16, ["loading", "right-icon", "onClick"]))), 128)),
|
|
172
169
|
typeof _ctx.timeout == "number" && _ctx.timeout > 0 && !_ctx.persistent ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
173
170
|
createElementVNode("div", {
|
|
@@ -191,7 +188,7 @@ import '../assets/toast.kunueRvo.css';const _hoisted_1 = ["textContent", "innerH
|
|
|
191
188
|
_: 1
|
|
192
189
|
}, 8, ["name"]));
|
|
193
190
|
}
|
|
194
|
-
}), MazToast = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
191
|
+
}), MazToast = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7235a0f8"]]), DEFAULT_OPTIONS = {
|
|
195
192
|
position: "bottom-right",
|
|
196
193
|
timeout: 1e4,
|
|
197
194
|
persistent: !1
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as capitalize } from "../chunks/capitalize.BF6CDS_4.js";
|
|
2
|
+
function camelCase(str) {
|
|
3
|
+
return str.replaceAll(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
|
|
4
|
+
}
|
|
5
|
+
function pascalCase(str) {
|
|
6
|
+
return capitalize(camelCase(str));
|
|
7
|
+
}
|
|
2
8
|
const a = [
|
|
3
9
|
"MazAcademicCap",
|
|
4
10
|
"MazAdjustmentsHorizontal",
|
|
@@ -4,7 +4,7 @@ function MazDirectivesResolver(options) {
|
|
|
4
4
|
type: "directive",
|
|
5
5
|
resolve: (name) => {
|
|
6
6
|
const { devMode = !1, prefix = "" } = options || {};
|
|
7
|
-
return { from: devMode ? "maz-ui/src/directives/index.ts" : "maz-ui/directives", as: `v${capitalize(prefix)}${name.replace(/^v/, "")}`, name: `v${name}` };
|
|
7
|
+
return { from: devMode ? "maz-ui/src/directives/index.ts" : "maz-ui/directives", as: `v${capitalize(prefix)}${capitalize(name.replace(/^v/, ""))}`, name: `v${name}` };
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -18,9 +18,11 @@ const composablesMap = {
|
|
|
18
18
|
useDisplayNames: !0,
|
|
19
19
|
useFreezeValue: !0,
|
|
20
20
|
useDialog: !0,
|
|
21
|
-
useMountComponent: !0
|
|
21
|
+
useMountComponent: !0,
|
|
22
|
+
useDropzone: !0
|
|
22
23
|
}, modulesMap = {
|
|
23
24
|
capitalize: !0,
|
|
25
|
+
getErrorMessage: !0,
|
|
24
26
|
checkAvailability: !0,
|
|
25
27
|
countryCodeToUnicodeFlag: !0,
|
|
26
28
|
formatCurrency: !0,
|
|
@@ -67,7 +67,7 @@ function requirePlugin() {
|
|
|
67
67
|
}
|
|
68
68
|
var pluginExports = /* @__PURE__ */ requirePlugin();
|
|
69
69
|
const plugin = /* @__PURE__ */ getDefaultExportFromCjs(pluginExports);
|
|
70
|
-
function defineMazTailwindConfig(config) {
|
|
70
|
+
function defineMazTailwindConfig(config, { utilities: utilities$1 } = {}) {
|
|
71
71
|
return {
|
|
72
72
|
darkMode: ["class", '[class~="dark"]'],
|
|
73
73
|
content: [],
|
|
@@ -81,7 +81,10 @@ function defineMazTailwindConfig(config) {
|
|
|
81
81
|
},
|
|
82
82
|
plugins: [
|
|
83
83
|
plugin(({ addUtilities }) => {
|
|
84
|
-
addUtilities(
|
|
84
|
+
addUtilities({
|
|
85
|
+
...utilities,
|
|
86
|
+
...utilities$1
|
|
87
|
+
});
|
|
85
88
|
})
|
|
86
89
|
],
|
|
87
90
|
...config
|
|
@@ -3,7 +3,20 @@ export interface MazAccordionProps {
|
|
|
3
3
|
modelValue?: number;
|
|
4
4
|
contentClass?: unknown;
|
|
5
5
|
}
|
|
6
|
-
declare function __VLS_template():
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: Partial<Record<`title-${number}`, (_: {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
}) => any>> & Partial<Record<`content-${number}`, (_: {
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
}) => any>> & {
|
|
13
|
+
content?(_: {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
}): any;
|
|
16
|
+
};
|
|
17
|
+
refs: {};
|
|
18
|
+
rootEl: HTMLDivElement;
|
|
19
|
+
};
|
|
7
20
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
8
21
|
declare const __VLS_component: import('vue').DefineComponent<MazAccordionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
22
|
"update:model-value": (...args: any[]) => void;
|
|
@@ -13,7 +26,7 @@ declare const __VLS_component: import('vue').DefineComponent<MazAccordionProps,
|
|
|
13
26
|
id: string;
|
|
14
27
|
modelValue: number;
|
|
15
28
|
contentClass: undefined;
|
|
16
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
30
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
31
|
export default _default;
|
|
19
32
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'vue';
|
|
2
|
-
import { MazGalleryProps } from './MazGallery.vue';
|
|
3
2
|
import { RouterLinkProps } from 'vue-router';
|
|
3
|
+
import { MazGalleryProps } from './MazGallery.vue';
|
|
4
4
|
type __VLS_Props = MazCardProps;
|
|
5
5
|
export interface MazCardProps {
|
|
6
6
|
/** Card variant: Must be `column | row | row-reverse | column-reverse` */
|
|
@@ -30,12 +30,6 @@ export interface MazCheckboxProps<T = boolean | (string | number)[]> {
|
|
|
30
30
|
warning?: boolean;
|
|
31
31
|
/** The hint text to display below the input. */
|
|
32
32
|
hint?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The tabindex of the checkbox
|
|
35
|
-
* @default 0
|
|
36
|
-
* @type {HTMLAttributes['tabindex']}
|
|
37
|
-
*/
|
|
38
|
-
tabindex?: HTMLAttributes['tabindex'];
|
|
39
33
|
}
|
|
40
34
|
declare const _default: <T extends boolean | (string | number)[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
41
35
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MazTranslationsNestedSchema } from '@maz-ui/translations/src/types.js';
|
|
2
|
+
import { NormalizeStringOptions } from '@maz-ui/utils/src/helpers/normalizeString.js';
|
|
2
3
|
import { DeepPartial } from '@maz-ui/utils/src/ts-helpers/DeepPartial.js';
|
|
3
|
-
import { NormalizeStringOptions } from '@maz-ui/utils/src/utils/normalizeString.js';
|
|
4
4
|
import { MazInputProps } from './MazInput.vue';
|
|
5
5
|
import { MazColor } from './types';
|
|
6
6
|
export type MazChecklistItemOption = {
|