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
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { f as formatDate } from "./
|
|
1
|
+
import { defineComponent, ref, computed, createElementBlock, openBlock, createElementVNode, createVNode, withModifiers, withCtx, unref, Fragment, renderList, createBlock, normalizeClass, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
import { MazChevronLeft, MazXMark } from "@maz-ui/icons";
|
|
3
|
+
import { f as formatDate, i as isSameDate } from "./MazDatePicker.De3Ltb2F.js";
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
5
|
import MazBtn from "../components/MazBtn.js";
|
|
6
|
-
import { i as isSameDate } from "./MazDatePicker.CT5yJhSN.js";
|
|
7
6
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper.B--vMWp3.js";
|
|
8
|
-
import '../assets/MazPickerYearSwitcher.
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
width: "1em",
|
|
11
|
-
height: "1em",
|
|
12
|
-
fill: "none",
|
|
13
|
-
viewBox: "0 0 24 24"
|
|
14
|
-
};
|
|
15
|
-
function render(_ctx, _cache) {
|
|
16
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [
|
|
17
|
-
createElementVNode("path", {
|
|
18
|
-
stroke: "currentColor",
|
|
19
|
-
"stroke-linecap": "round",
|
|
20
|
-
"stroke-linejoin": "round",
|
|
21
|
-
"stroke-width": "1.5",
|
|
22
|
-
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
23
|
-
}, null, -1)
|
|
24
|
-
]));
|
|
25
|
-
}
|
|
26
|
-
const ChevronLeft = { render }, _hoisted_1 = { class: "maz-picker-year-switcher" }, _hoisted_2 = { class: "maz-picker-year-switcher__header" }, _hoisted_3 = { class: "maz-flex maz-space-x-2" }, _hoisted_4 = { class: "maz-picker-year-switcher__main" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
import '../assets/MazPickerYearSwitcher.Cn-nS-Vv.css';const _hoisted_1 = { class: "maz-picker-year-switcher" }, _hoisted_2 = { class: "maz-picker-year-switcher__header" }, _hoisted_3 = { class: "maz-flex maz-space-x-2" }, _hoisted_4 = { class: "maz-picker-year-switcher__main" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
27
8
|
__name: "MazPickerYearSwitcher",
|
|
28
9
|
props: {
|
|
29
10
|
color: { type: String, required: !0 },
|
|
@@ -60,7 +41,7 @@ const ChevronLeft = { render }, _hoisted_1 = { class: "maz-picker-year-switcher"
|
|
|
60
41
|
onClick: withModifiers(previousYears, ["stop"])
|
|
61
42
|
}, {
|
|
62
43
|
default: withCtx(() => [
|
|
63
|
-
createVNode(unref(
|
|
44
|
+
createVNode(unref(MazChevronLeft), { class: "maz-text-lg" })
|
|
64
45
|
]),
|
|
65
46
|
_: 1
|
|
66
47
|
}),
|
|
@@ -71,7 +52,7 @@ const ChevronLeft = { render }, _hoisted_1 = { class: "maz-picker-year-switcher"
|
|
|
71
52
|
onClick: withModifiers(nextYears, ["stop"])
|
|
72
53
|
}, {
|
|
73
54
|
default: withCtx(() => [
|
|
74
|
-
createVNode(unref(
|
|
55
|
+
createVNode(unref(MazChevronLeft), { class: "maz-rotate-180 maz-text-lg" })
|
|
75
56
|
]),
|
|
76
57
|
_: 1
|
|
77
58
|
})
|
|
@@ -83,7 +64,7 @@ const ChevronLeft = { render }, _hoisted_1 = { class: "maz-picker-year-switcher"
|
|
|
83
64
|
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.$emit("close", $event), ["stop"]))
|
|
84
65
|
}, {
|
|
85
66
|
default: withCtx(() => [
|
|
86
|
-
createVNode(unref(
|
|
67
|
+
createVNode(unref(MazXMark), { class: "maz-text-lg" })
|
|
87
68
|
]),
|
|
88
69
|
_: 1
|
|
89
70
|
})
|
|
@@ -107,7 +88,7 @@ const ChevronLeft = { render }, _hoisted_1 = { class: "maz-picker-year-switcher"
|
|
|
107
88
|
])
|
|
108
89
|
]));
|
|
109
90
|
}
|
|
110
|
-
}), MazPickerYearSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
91
|
+
}), MazPickerYearSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0fb2d673"]]);
|
|
111
92
|
export {
|
|
112
93
|
MazPickerYearSwitcher as default
|
|
113
94
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, ref, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createElementVNode, createCommentVNode, mergeProps, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
3
|
-
import '../assets/MazSwitch.
|
|
3
|
+
import '../assets/MazSwitch.Bxmh2iFj.css';const _hoisted_1 = ["for", "aria-checked"], _hoisted_2 = ["id", "name", "checked", "aria-label", "disabled"], _hoisted_3 = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "m-switch__text"
|
|
6
6
|
}, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -25,7 +25,7 @@ import '../assets/MazSwitch.Z1ZMm7tx.css';const _hoisted_1 = ["for", "aria-check
|
|
|
25
25
|
const props = __props, emits = __emit, instanceId = useInstanceUniqId({
|
|
26
26
|
componentName: "MazSwitch",
|
|
27
27
|
providedId: props.id
|
|
28
|
-
}), bgColorClassVar = computed(() => `hsl(var(--maz-${props.color})
|
|
28
|
+
}), bgColorClassVar = computed(() => `hsl(var(--maz-${props.color}))`);
|
|
29
29
|
function emit() {
|
|
30
30
|
emits("update:model-value", !props.modelValue), emits("change", !props.modelValue);
|
|
31
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, useCssVars, defineAsyncComponent, computed, toRefs, provide, ref, watch, useSlots, onBeforeMount, createElementBlock, openBlock, normalizeClass, createCommentVNode, createElementVNode, renderSlot, toDisplayString, createBlock, createVNode, unref, normalizeStyle, createTextVNode, withCtx, Fragment, renderList } from "vue";
|
|
2
2
|
import { MazMagnifyingGlass, MazArrowUp, MazChevronDoubleLeft, MazChevronLeft } from "@maz-ui/icons";
|
|
3
|
-
import { u as useTranslations } from "./useTranslations.
|
|
3
|
+
import { u as useTranslations } from "./useTranslations.D5aoYwD7.js";
|
|
4
4
|
const _hoisted_1 = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "m-table-header"
|
|
@@ -64,8 +64,8 @@ const _hoisted_1 = {
|
|
|
64
64
|
emits: ["update:model-value", "update:search-query", "update:page", "update:page-size"],
|
|
65
65
|
setup(__props, { emit: __emit }) {
|
|
66
66
|
useCssVars((_ctx) => ({
|
|
67
|
-
"
|
|
68
|
-
|
|
67
|
+
"4483cedd": _ctx.tableLayout,
|
|
68
|
+
"67d872bc": _ctx.captionSide
|
|
69
69
|
}));
|
|
70
70
|
const props = __props, emits = __emit, MazBtn = defineAsyncComponent(() => import("../components/MazBtn.js")), MazCheckbox = defineAsyncComponent(() => import("../components/MazCheckbox.js")), MazInput = defineAsyncComponent(() => import("../components/MazInput.js")), MazLoadingBar = defineAsyncComponent(() => import("../components/MazLoadingBar.js")), MazSelect = defineAsyncComponent(() => import("../components/MazSelect.js")), MazTableCell = defineAsyncComponent(() => import("../components/MazTableCell.js")), MazTableRowComponent = defineAsyncComponent(() => import("../components/MazTableRow.js")), MazTableTitle = defineAsyncComponent(() => import("../components/MazTableTitle.js")), { t } = useTranslations(), messages = computed(() => ({
|
|
71
71
|
noResults: props.translations?.noResults ?? t("table.noResults"),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent, mergeModels, useModel, ref, computed, onMounted, watch, useTemplateRef, createBlock, openBlock, mergeProps, unref } from "vue";
|
|
2
|
-
import { u as useTranslations } from "./useTranslations.
|
|
2
|
+
import { u as useTranslations } from "./useTranslations.D5aoYwD7.js";
|
|
3
3
|
import { useInjectStrict } from "../composables/useInjectStrict.js";
|
|
4
4
|
import MazInput from "../components/MazInput.js";
|
|
5
|
-
import { u as useLibphonenumber } from "./MazInputPhoneNumber.
|
|
5
|
+
import { u as useLibphonenumber } from "./MazInputPhoneNumber.Ch-PCGiv.js";
|
|
6
6
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper.B--vMWp3.js";
|
|
7
|
-
import '../assets/PhoneInput.
|
|
7
|
+
import '../assets/PhoneInput.BJiKqOF6.css';const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "PhoneInput",
|
|
9
9
|
props: /* @__PURE__ */ mergeModels({
|
|
10
10
|
style: {},
|
|
@@ -36,6 +36,7 @@ import '../assets/PhoneInput.CyWO76iq.css';const _sfc_main = /* @__PURE__ */ def
|
|
|
36
36
|
block: { type: Boolean },
|
|
37
37
|
name: {},
|
|
38
38
|
autocomplete: {},
|
|
39
|
+
loading: { type: Boolean },
|
|
39
40
|
locales: {},
|
|
40
41
|
example: { type: Boolean },
|
|
41
42
|
hasRadius: { type: Boolean },
|
|
@@ -114,7 +115,7 @@ import '../assets/PhoneInput.CyWO76iq.css';const _sfc_main = /* @__PURE__ */ def
|
|
|
114
115
|
onBlur: _cache[1] || (_cache[1] = ($event) => inputFocused.value = !1)
|
|
115
116
|
}), null, 16, ["id", "model-value", "disabled", "color", "error", "size", "success", "name", "inputmode", "autocomplete", "class"]));
|
|
116
117
|
}
|
|
117
|
-
}), PhoneInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
118
|
+
}), PhoneInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c6ce171d"]]);
|
|
118
119
|
export {
|
|
119
120
|
PhoneInput as default
|
|
120
121
|
};
|
|
@@ -1,18 +1,130 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getCurrentInstance, inject, nextTick } from "vue";
|
|
1
|
+
import { nextTick, getCurrentInstance, inject } from "vue";
|
|
3
2
|
import { useFreezeValue } from "../composables/useFreezeValue.js";
|
|
3
|
+
function debounceId(identifier, func, delay) {
|
|
4
|
+
const debouncedFunctions = {};
|
|
5
|
+
return function(...args) {
|
|
6
|
+
debouncedFunctions[identifier] || (debouncedFunctions[identifier] = { timer: null, promise: null });
|
|
7
|
+
const debounced = debouncedFunctions[identifier];
|
|
8
|
+
return debounced.timer && clearTimeout(debounced.timer), debounced.promise = new Promise((resolve, reject) => {
|
|
9
|
+
debounced.timer = setTimeout(async () => {
|
|
10
|
+
try {
|
|
11
|
+
resolve(await func(...args));
|
|
12
|
+
} catch (error) {
|
|
13
|
+
reject(error);
|
|
14
|
+
} finally {
|
|
15
|
+
delete debouncedFunctions[identifier];
|
|
16
|
+
}
|
|
17
|
+
}, delay);
|
|
18
|
+
}), debounced.promise;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function isPrimitive(value) {
|
|
22
|
+
return value == null || typeof value == "string" || typeof value == "number" || typeof value == "boolean" || typeof value == "symbol" || typeof value == "bigint";
|
|
23
|
+
}
|
|
24
|
+
function isEqualArrays(a, b) {
|
|
25
|
+
if (a.length !== b.length)
|
|
26
|
+
return !1;
|
|
27
|
+
for (const [i, element] of a.entries())
|
|
28
|
+
if (!isEqual(element, b[i]))
|
|
29
|
+
return !1;
|
|
30
|
+
return !0;
|
|
31
|
+
}
|
|
32
|
+
function isEqualObjects(a, b) {
|
|
33
|
+
const keysA = Object.keys(a), keysB = Object.keys(b);
|
|
34
|
+
if (keysA.length !== keysB.length)
|
|
35
|
+
return !1;
|
|
36
|
+
for (const key of keysA)
|
|
37
|
+
if (!keysB.includes(key) || !isEqual(a[key], b[key]))
|
|
38
|
+
return !1;
|
|
39
|
+
return !0;
|
|
40
|
+
}
|
|
41
|
+
function isEqual(a, b) {
|
|
42
|
+
return isPrimitive(a) || isPrimitive(b) ? a === b : a instanceof Date && b instanceof Date ? a.getTime() === b.getTime() : typeof a != typeof b || Array.isArray(a) !== Array.isArray(b) ? !1 : Array.isArray(a) && Array.isArray(b) ? isEqualArrays(a, b) : typeof a == "object" && typeof b == "object" ? isEqualObjects(a, b) : !1;
|
|
43
|
+
}
|
|
44
|
+
function throttleId(identifier, func, interval) {
|
|
45
|
+
const state = {};
|
|
46
|
+
return async (...args) => {
|
|
47
|
+
const now = Date.now();
|
|
48
|
+
return state[identifier] || (state[identifier] = { promise: null, lastCall: 0, lastArgs: [] }), now - state[identifier].lastCall >= interval ? (state[identifier].lastCall = now, func(...args)) : (state[identifier].lastArgs = args, state[identifier].promise || (state[identifier].promise = new Promise((resolve) => {
|
|
49
|
+
setTimeout(
|
|
50
|
+
async () => {
|
|
51
|
+
state[identifier].lastCall = Date.now();
|
|
52
|
+
const result = await func(...state[identifier].lastArgs);
|
|
53
|
+
state[identifier].promise = null, resolve(result);
|
|
54
|
+
},
|
|
55
|
+
interval - (now - state[identifier].lastCall)
|
|
56
|
+
);
|
|
57
|
+
})), state[identifier].promise);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
4
60
|
const CONFIG = {
|
|
5
61
|
mode: "lazy",
|
|
6
62
|
scrollToErrorSelector: ".has-field-error",
|
|
7
63
|
debounceTime: 300,
|
|
8
64
|
throttleTime: 1e3
|
|
9
65
|
};
|
|
10
|
-
function
|
|
11
|
-
return
|
|
66
|
+
function isEmptyValue(value) {
|
|
67
|
+
return value == null || value === "";
|
|
12
68
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
69
|
+
const storeValidbot = {};
|
|
70
|
+
async function getValibotValidationMethod(methodName) {
|
|
71
|
+
if (storeValidbot[methodName])
|
|
72
|
+
return storeValidbot[methodName];
|
|
73
|
+
const valibot = await import("valibot");
|
|
74
|
+
return storeValidbot[methodName] = valibot[methodName], valibot[methodName];
|
|
75
|
+
}
|
|
76
|
+
async function getValidationSchema(formSchema) {
|
|
77
|
+
return (await getValibotValidationMethod("objectAsync"))(formSchema);
|
|
78
|
+
}
|
|
79
|
+
async function getFieldValidationResult(name, schema, value) {
|
|
80
|
+
const fieldSchema = await getValidationSchema(schema), result = await (await getValibotValidationMethod("safeParseAsync"))(fieldSchema.entries[name], value ?? "");
|
|
81
|
+
return {
|
|
82
|
+
result,
|
|
83
|
+
isValid: result.success
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
async function setFieldValidationState({
|
|
87
|
+
name,
|
|
88
|
+
fieldState,
|
|
89
|
+
schema,
|
|
90
|
+
payload,
|
|
91
|
+
setError = !0,
|
|
92
|
+
setErrorIfInvalidAndNotEmpty = !1
|
|
93
|
+
}) {
|
|
94
|
+
if (await nextTick(), fieldState.validating)
|
|
95
|
+
return Promise.resolve();
|
|
96
|
+
fieldState.validating = !0;
|
|
97
|
+
try {
|
|
98
|
+
if (!schema[name]) {
|
|
99
|
+
fieldState.valid = !0, fieldState.validating = !1, fieldState.validated = !0, fieldState.errors = [], fieldState.error = !1;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const { result, isValid } = await getFieldValidationResult(name, schema, payload[name]);
|
|
103
|
+
fieldState.valid = isValid;
|
|
104
|
+
const shouldSetError = setError || setErrorIfInvalidAndNotEmpty && !isValid && !isEmptyValue(payload[name]), shouldPreserveError = fieldState.blurred && !isValid && fieldState.mode && ["eager", "blur", "progressive"].includes(fieldState.mode);
|
|
105
|
+
(shouldSetError || shouldPreserveError) && (fieldState.error = !isValid), fieldState.errors = result.issues ?? [], fieldState.validated = !0;
|
|
106
|
+
} finally {
|
|
107
|
+
fieldState.validating = !1;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function validateForm({
|
|
111
|
+
fieldsStates,
|
|
112
|
+
payload,
|
|
113
|
+
setErrors = !0,
|
|
114
|
+
schema
|
|
115
|
+
}) {
|
|
116
|
+
return Promise.all(
|
|
117
|
+
Object.keys(fieldsStates).map(
|
|
118
|
+
(name) => setFieldValidationState({
|
|
119
|
+
name,
|
|
120
|
+
setError: setErrors,
|
|
121
|
+
fieldState: fieldsStates[name],
|
|
122
|
+
payload,
|
|
123
|
+
schema,
|
|
124
|
+
setErrorIfInvalidAndNotEmpty: fieldsStates[name].mode === "lazy"
|
|
125
|
+
})
|
|
126
|
+
)
|
|
127
|
+
);
|
|
16
128
|
}
|
|
17
129
|
function getErrorMessages(errors, fieldsStates) {
|
|
18
130
|
const errorMessages = {};
|
|
@@ -22,8 +134,11 @@ function getErrorMessages(errors, fieldsStates) {
|
|
|
22
134
|
}
|
|
23
135
|
return errorMessages;
|
|
24
136
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
137
|
+
function getFieldsErrors(fieldsStates) {
|
|
138
|
+
const fieldsErrors = {};
|
|
139
|
+
for (const [name, fieldState] of Object.entries(fieldsStates))
|
|
140
|
+
fieldsErrors[name] = fieldState.errors;
|
|
141
|
+
return fieldsErrors;
|
|
27
142
|
}
|
|
28
143
|
function getValidateFunction({
|
|
29
144
|
name,
|
|
@@ -72,6 +187,9 @@ function getFieldState({
|
|
|
72
187
|
mode: hasValidation ? options?.mode ?? fieldState?.mode ?? CONFIG.mode : void 0
|
|
73
188
|
};
|
|
74
189
|
}
|
|
190
|
+
function fieldHasValidation(field, schema) {
|
|
191
|
+
return Object.keys(schema).includes(field);
|
|
192
|
+
}
|
|
75
193
|
function getFieldsStates({
|
|
76
194
|
schema,
|
|
77
195
|
payload,
|
|
@@ -131,90 +249,6 @@ function updateFieldState({
|
|
|
131
249
|
...fieldState?.mode && newMode !== fieldState.mode ? rest : {}
|
|
132
250
|
};
|
|
133
251
|
}
|
|
134
|
-
function getFieldsErrors(fieldsStates) {
|
|
135
|
-
const fieldsErrors = {};
|
|
136
|
-
for (const [name, { errors }] of Object.entries(fieldsStates))
|
|
137
|
-
fieldsErrors[name] = errors;
|
|
138
|
-
return fieldsErrors;
|
|
139
|
-
}
|
|
140
|
-
function findInteractiveElements(el) {
|
|
141
|
-
return el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement ? [el] : el instanceof HTMLElement ? el.querySelectorAll(
|
|
142
|
-
"input, select, textarea"
|
|
143
|
-
) : [];
|
|
144
|
-
}
|
|
145
|
-
function addEventToInteractiveElements({
|
|
146
|
-
interactiveElements,
|
|
147
|
-
onBlur,
|
|
148
|
-
mode
|
|
149
|
-
}) {
|
|
150
|
-
interactiveElements.forEach((element) => {
|
|
151
|
-
hasModeIncludes(["eager", "blur", "progressive"], mode) && element.addEventListener("blur", onBlur);
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
function removeEventFromInteractiveElements({
|
|
155
|
-
interactiveElements,
|
|
156
|
-
onBlur
|
|
157
|
-
}) {
|
|
158
|
-
interactiveElements.forEach((element) => {
|
|
159
|
-
element.removeEventListener("blur", onBlur);
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
async function getFieldValidationResult(name, schema, value) {
|
|
163
|
-
const fieldSchema = await getValidationSchema(schema), result = await (await getValibotValidationMethod("safeParseAsync"))(fieldSchema.entries[name], value ?? "");
|
|
164
|
-
return {
|
|
165
|
-
result,
|
|
166
|
-
isValid: result.success
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
async function setFieldValidationState({
|
|
170
|
-
name,
|
|
171
|
-
fieldState,
|
|
172
|
-
schema,
|
|
173
|
-
payload,
|
|
174
|
-
setError = !0,
|
|
175
|
-
setErrorIfInvalidAndNotEmpty = !1
|
|
176
|
-
}) {
|
|
177
|
-
if (await nextTick(), fieldState.validating = !0, !schema[name]) {
|
|
178
|
-
fieldState.valid = !0, fieldState.validating = !1, fieldState.validated = !0, fieldState.errors = [], fieldState.error = !1;
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
const { result, isValid } = await getFieldValidationResult(name, schema, payload[name]);
|
|
182
|
-
fieldState.valid = isValid, (setError || setErrorIfInvalidAndNotEmpty && !isValid && !isEmptyValue(payload[name])) && (fieldState.error = !isValid), fieldState.errors = result.issues ?? [], fieldState.validating = !1, fieldState.validated = !0;
|
|
183
|
-
}
|
|
184
|
-
function validateField({
|
|
185
|
-
name,
|
|
186
|
-
fieldState,
|
|
187
|
-
payload,
|
|
188
|
-
schema
|
|
189
|
-
}) {
|
|
190
|
-
const validationParams = {
|
|
191
|
-
name,
|
|
192
|
-
fieldState,
|
|
193
|
-
payload,
|
|
194
|
-
schema,
|
|
195
|
-
setError: fieldState.mode === "progressive" ? fieldState.valid || fieldState.blurred : !0
|
|
196
|
-
};
|
|
197
|
-
return fieldState.validateFunction?.(validationParams);
|
|
198
|
-
}
|
|
199
|
-
function validateForm({
|
|
200
|
-
fieldsStates,
|
|
201
|
-
payload,
|
|
202
|
-
showErrors = !0,
|
|
203
|
-
schema
|
|
204
|
-
}) {
|
|
205
|
-
return Promise.all(
|
|
206
|
-
Object.keys(fieldsStates).map(
|
|
207
|
-
(name) => setFieldValidationState({
|
|
208
|
-
name,
|
|
209
|
-
setError: showErrors,
|
|
210
|
-
fieldState: fieldsStates[name],
|
|
211
|
-
payload,
|
|
212
|
-
schema,
|
|
213
|
-
setErrorIfInvalidAndNotEmpty: fieldsStates[name].mode === "lazy"
|
|
214
|
-
})
|
|
215
|
-
)
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
252
|
function canExecuteValidation({
|
|
219
253
|
eventName,
|
|
220
254
|
fieldState,
|
|
@@ -233,11 +267,12 @@ function handleFieldBlur({
|
|
|
233
267
|
}) {
|
|
234
268
|
const fieldValue = payload[name], isDirty = !isEqual(fieldValue, fieldState.initialValue);
|
|
235
269
|
if (fieldState.dirty = isDirty, fieldState.blurred = fieldState.blurred || (fieldState.mode === "eager" ? isDirty : !0), !!(force || canExecuteValidation({ eventName: "blur", fieldState, isSubmitted })))
|
|
236
|
-
return
|
|
270
|
+
return fieldState.validateFunction?.({
|
|
237
271
|
name,
|
|
238
272
|
fieldState,
|
|
239
273
|
schema,
|
|
240
|
-
payload
|
|
274
|
+
payload,
|
|
275
|
+
setError: fieldState.mode === "progressive" ? fieldState.validated || fieldState.blurred : !0
|
|
241
276
|
});
|
|
242
277
|
}
|
|
243
278
|
function handleFieldInput({
|
|
@@ -252,13 +287,17 @@ function handleFieldInput({
|
|
|
252
287
|
fieldState.validated = !1;
|
|
253
288
|
const isDirty = !isEqual(fieldValue, fieldState.initialValue);
|
|
254
289
|
if (fieldState.dirty = isDirty, !!(forceValidation || canExecuteValidation({ eventName: "input", fieldState, isSubmitted })))
|
|
255
|
-
return
|
|
290
|
+
return fieldState.validateFunction?.({
|
|
256
291
|
name,
|
|
257
292
|
fieldState,
|
|
258
293
|
schema,
|
|
259
|
-
payload
|
|
294
|
+
payload,
|
|
295
|
+
setError: fieldState.mode === "progressive" ? fieldState.validated || fieldState.blurred : !0
|
|
260
296
|
});
|
|
261
297
|
}
|
|
298
|
+
function hasModeIncludes(modes, value) {
|
|
299
|
+
return value ? modes.includes(value) : !1;
|
|
300
|
+
}
|
|
262
301
|
function getInstance(composableName) {
|
|
263
302
|
const instance = getCurrentInstance();
|
|
264
303
|
if (!instance)
|
|
@@ -271,6 +310,85 @@ function getContext(identifier, composableName) {
|
|
|
271
310
|
throw new Error("useFormField must be used within a form (useFormValidator)");
|
|
272
311
|
return context;
|
|
273
312
|
}
|
|
313
|
+
function scrollToError(selector = CONFIG.scrollToErrorSelector) {
|
|
314
|
+
const element = document.querySelector(selector);
|
|
315
|
+
element && element.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
316
|
+
}
|
|
317
|
+
function findInteractiveElements(el) {
|
|
318
|
+
if (isInteractiveElement(el))
|
|
319
|
+
return [el];
|
|
320
|
+
const selector = [
|
|
321
|
+
// Standard form elements
|
|
322
|
+
"input",
|
|
323
|
+
"select",
|
|
324
|
+
"textarea",
|
|
325
|
+
"button",
|
|
326
|
+
// Focusable elements
|
|
327
|
+
"a[href]",
|
|
328
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
329
|
+
// Elements with interactive ARIA roles
|
|
330
|
+
'[role="button"]',
|
|
331
|
+
'[role="textbox"]',
|
|
332
|
+
'[role="combobox"]',
|
|
333
|
+
'[role="listbox"]',
|
|
334
|
+
'[role="slider"]',
|
|
335
|
+
'[role="spinbutton"]',
|
|
336
|
+
'[role="switch"]',
|
|
337
|
+
'[role="checkbox"]',
|
|
338
|
+
'[role="radio"]',
|
|
339
|
+
'[role="menuitem"]',
|
|
340
|
+
'[role="option"]',
|
|
341
|
+
// Contenteditable elements
|
|
342
|
+
'[contenteditable="true"]',
|
|
343
|
+
// Custom interactive elements (common patterns)
|
|
344
|
+
"[data-interactive]",
|
|
345
|
+
".interactive",
|
|
346
|
+
"[data-clickable]"
|
|
347
|
+
].join(", ");
|
|
348
|
+
return Array.from(el.querySelectorAll(selector)).filter(isInteractiveElement);
|
|
349
|
+
}
|
|
350
|
+
function isInteractiveElement(el) {
|
|
351
|
+
if (el.getAttribute("tabindex") === "-1")
|
|
352
|
+
return !1;
|
|
353
|
+
if (el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement || el instanceof HTMLButtonElement || el instanceof HTMLAnchorElement && el.href || el.hasAttribute("tabindex") && el.getAttribute("tabindex") !== "-1")
|
|
354
|
+
return !0;
|
|
355
|
+
const interactiveRoles = [
|
|
356
|
+
"button",
|
|
357
|
+
"textbox",
|
|
358
|
+
"combobox",
|
|
359
|
+
"listbox",
|
|
360
|
+
"slider",
|
|
361
|
+
"spinbutton",
|
|
362
|
+
"switch",
|
|
363
|
+
"checkbox",
|
|
364
|
+
"radio",
|
|
365
|
+
"menuitem",
|
|
366
|
+
"option"
|
|
367
|
+
], role = el.getAttribute("role");
|
|
368
|
+
return role && interactiveRoles.includes(role) || el.getAttribute("contenteditable") === "true" ? !0 : el.hasAttribute("data-interactive") || el.hasAttribute("data-clickable") || el.classList.contains("interactive");
|
|
369
|
+
}
|
|
370
|
+
const activeListeners = /* @__PURE__ */ new WeakMap();
|
|
371
|
+
function addEventToInteractiveElements({
|
|
372
|
+
interactiveElements,
|
|
373
|
+
onBlur,
|
|
374
|
+
mode
|
|
375
|
+
}) {
|
|
376
|
+
interactiveElements.forEach((element) => {
|
|
377
|
+
if (hasModeIncludes(["eager", "blur", "progressive"], mode)) {
|
|
378
|
+
const existingListeners = activeListeners.get(element);
|
|
379
|
+
existingListeners?.has("blur") && element.removeEventListener("blur", existingListeners.get("blur")), element.addEventListener("blur", onBlur), activeListeners.has(element) || activeListeners.set(element, /* @__PURE__ */ new Map()), activeListeners.get(element).set("blur", onBlur);
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
function removeEventFromInteractiveElements({
|
|
384
|
+
interactiveElements,
|
|
385
|
+
onBlur
|
|
386
|
+
}) {
|
|
387
|
+
interactiveElements.forEach((element) => {
|
|
388
|
+
const existingListeners = activeListeners.get(element);
|
|
389
|
+
existingListeners?.has("blur") && (element.removeEventListener("blur", onBlur), existingListeners.delete("blur"), existingListeners.size === 0 && activeListeners.delete(element));
|
|
390
|
+
});
|
|
391
|
+
}
|
|
274
392
|
function getValidationEvents({
|
|
275
393
|
hasRef,
|
|
276
394
|
fieldState,
|
|
@@ -281,35 +399,23 @@ function getValidationEvents({
|
|
|
281
399
|
onBlur
|
|
282
400
|
};
|
|
283
401
|
}
|
|
284
|
-
const storeValidbot = {};
|
|
285
|
-
async function getValibotValidationMethod(methodName) {
|
|
286
|
-
if (storeValidbot[methodName])
|
|
287
|
-
return storeValidbot[methodName];
|
|
288
|
-
const valibot = await import("valibot");
|
|
289
|
-
return storeValidbot[methodName] = valibot[methodName], valibot[methodName];
|
|
290
|
-
}
|
|
291
|
-
async function getValidationSchema(formSchema) {
|
|
292
|
-
return (await getValibotValidationMethod("objectAsync"))(formSchema);
|
|
293
|
-
}
|
|
294
|
-
function hasModeIncludes(modes, value) {
|
|
295
|
-
return value ? modes.includes(value) : !1;
|
|
296
|
-
}
|
|
297
402
|
export {
|
|
298
403
|
CONFIG as C,
|
|
299
404
|
getFieldsStates as a,
|
|
300
405
|
getFieldsErrors as b,
|
|
301
406
|
getErrorMessages as c,
|
|
302
|
-
|
|
407
|
+
handleFieldInput as d,
|
|
303
408
|
getContext as e,
|
|
304
409
|
fieldHasValidation as f,
|
|
305
410
|
getInstance as g,
|
|
306
|
-
|
|
411
|
+
hasModeIncludes as h,
|
|
307
412
|
updateFieldState as i,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
413
|
+
isEqual as j,
|
|
414
|
+
setFieldValidationState as k,
|
|
415
|
+
getValidationEvents as l,
|
|
311
416
|
findInteractiveElements as m,
|
|
312
417
|
addEventToInteractiveElements as n,
|
|
418
|
+
handleFieldBlur as o,
|
|
313
419
|
removeEventFromInteractiveElements as r,
|
|
314
420
|
scrollToError as s,
|
|
315
421
|
updateFieldsStates as u,
|
|
@@ -127,12 +127,24 @@ const en = {
|
|
|
127
127
|
lastPage: "Last Page, page {page}"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
+
/**
|
|
131
|
+
* This is the translation for the carousel component.
|
|
132
|
+
* The keys are:
|
|
133
|
+
* - ariaLabel.previousButton: The aria-label for the previous button.
|
|
134
|
+
* - ariaLabel.nextButton: The aria-label for the next button.
|
|
135
|
+
*/
|
|
130
136
|
carousel: {
|
|
131
137
|
ariaLabel: {
|
|
132
138
|
previousButton: "Scroll to previous items",
|
|
133
139
|
nextButton: "Scroll to next items"
|
|
134
140
|
}
|
|
135
141
|
},
|
|
142
|
+
/**
|
|
143
|
+
* This is the translation for the checklist component.
|
|
144
|
+
* The keys are:
|
|
145
|
+
* - noResultsFound: The translation for the no results found text.
|
|
146
|
+
* - searchInput.placeholder: The translation for the search input placeholder.
|
|
147
|
+
*/
|
|
136
148
|
checklist: {
|
|
137
149
|
noResultsFound: "No results found",
|
|
138
150
|
searchInput: {
|
package/dist/chunks/{fullscreen-img.directive.CyOHexcO.js → fullscreen-img.directive.Be383en8.js}
RENAMED
|
@@ -4,7 +4,7 @@ import { MazChevronLeft, MazXMark } from "@maz-ui/icons";
|
|
|
4
4
|
import { c as checkAvailability } from "./checkAvailability.aTpZidex.js";
|
|
5
5
|
import MazSpinner from "../components/MazSpinner.js";
|
|
6
6
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper.B--vMWp3.js";
|
|
7
|
-
import '../assets/fullscreen-img.
|
|
7
|
+
import '../assets/fullscreen-img.Bkuz1GOX.css';const _hoisted_1 = ["onKeypress"], _hoisted_2 = { class: "m-fullscreen-img-scroller" }, _hoisted_3 = ["src", "alt"], _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "MazFullscreenImg",
|
|
9
9
|
props: {
|
|
10
10
|
src: {},
|
|
@@ -231,7 +231,7 @@ import '../assets/fullscreen-img.pvt6196l.css';const _hoisted_1 = ["onKeypress"]
|
|
|
231
231
|
])
|
|
232
232
|
], 40, _hoisted_1));
|
|
233
233
|
}
|
|
234
|
-
}), MazFullscreenImg = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
234
|
+
}), MazFullscreenImg = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c0b12968"]]), STATE_OPEN_CLASS = "m-fullscreen-is-open";
|
|
235
235
|
class FullscreenImgHandler {
|
|
236
236
|
options = void 0;
|
|
237
237
|
defaultOptions = {
|
|
@@ -134,7 +134,7 @@ class LazyImg {
|
|
|
134
134
|
async imageHandler(el, binding, type) {
|
|
135
135
|
if (type === "update")
|
|
136
136
|
for await (const observer of this.observers) observer.unobserve(el);
|
|
137
|
-
|
|
137
|
+
globalThis.IntersectionObserver ? this.createObserver(el, binding) : this.loadImage(el, binding);
|
|
138
138
|
}
|
|
139
139
|
async bindUpdateHandler(el, binding, type) {
|
|
140
140
|
await this.imageHandler(el, binding, type);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { computed, toValue } from "vue";
|
|
1
2
|
const defaultOptions = {
|
|
2
3
|
removeAccents: !0,
|
|
3
4
|
caseSensitive: !1,
|
|
@@ -64,6 +65,44 @@ function normalizeString(input, options) {
|
|
|
64
65
|
result = result.normalize(form);
|
|
65
66
|
return result;
|
|
66
67
|
}
|
|
68
|
+
function levenshteinDistance(string1, string2) {
|
|
69
|
+
const length1 = string1.length, length2 = string2.length, matrix = [];
|
|
70
|
+
for (let index = 0; index <= length1; index++)
|
|
71
|
+
matrix[index] = [index];
|
|
72
|
+
for (let index = 0; index <= length2; index++)
|
|
73
|
+
matrix[0][index] = index;
|
|
74
|
+
for (let index = 1; index <= length1; index++)
|
|
75
|
+
for (let index_ = 1; index_ <= length2; index_++) {
|
|
76
|
+
const cost = string1[index - 1] === string2[index_ - 1] ? 0 : 1;
|
|
77
|
+
matrix[index][index_] = Math.min(
|
|
78
|
+
matrix[index - 1][index_] + 1,
|
|
79
|
+
matrix[index][index_ - 1] + 1,
|
|
80
|
+
matrix[index - 1][index_ - 1] + cost
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return matrix[length1][length2];
|
|
84
|
+
}
|
|
85
|
+
function getMatchingScore(string1, string2) {
|
|
86
|
+
const distance = levenshteinDistance(string1, string2), maxLength = Math.max(string1.length, string2.length);
|
|
87
|
+
return maxLength === 0 ? 1 : 1 - distance / maxLength;
|
|
88
|
+
}
|
|
89
|
+
function getMatchingResults(string1, string2, threshold = 0.75) {
|
|
90
|
+
return getMatchingScore(string1, string2) >= threshold;
|
|
91
|
+
}
|
|
92
|
+
function useStringMatching(string1, string2, threshold = 0.75) {
|
|
93
|
+
const _string1 = computed(
|
|
94
|
+
() => normalizeString(toValue(string1))
|
|
95
|
+
), _string2 = computed(
|
|
96
|
+
() => normalizeString(toValue(string2))
|
|
97
|
+
), _threshold = computed(() => toValue(threshold)), score = computed(() => getMatchingScore(_string1.value, _string2.value));
|
|
98
|
+
return {
|
|
99
|
+
isMatching: computed(
|
|
100
|
+
() => getMatchingResults(_string1.value, _string2.value, _threshold.value)
|
|
101
|
+
),
|
|
102
|
+
score
|
|
103
|
+
};
|
|
104
|
+
}
|
|
67
105
|
export {
|
|
68
|
-
normalizeString as n
|
|
106
|
+
normalizeString as n,
|
|
107
|
+
useStringMatching as u
|
|
69
108
|
};
|