maz-ui 3.46.1-beta.3 → 3.46.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/MazAccordion.d.ts +1 -1
- package/components/MazAvatar.mjs +1 -1
- package/components/MazBottomSheet.mjs +1 -1
- package/components/MazBtn.d.ts +0 -4
- package/components/MazBtn.mjs +1 -1
- package/components/MazCard.mjs +1 -1
- package/components/MazCardSpotlight.d.ts +1 -1
- package/components/MazCarousel.mjs +1 -1
- package/components/MazCheckbox.mjs +61 -61
- package/components/MazDialog.mjs +1 -1
- package/components/MazDialogPromise.mjs +1 -1
- package/components/MazDrawer.mjs +1 -1
- package/components/MazDropdown.d.ts +13 -0
- package/components/MazDropdown.mjs +115 -107
- package/components/MazIcon.mjs +55 -67
- package/components/MazInput.mjs +1 -1
- package/components/MazInputNumber.mjs +1 -1
- package/components/MazInputPrice.mjs +1 -1
- package/components/MazInputTags.mjs +1 -1
- package/components/MazLazyImg.d.ts +2 -0
- package/components/MazLazyImg.mjs +1 -1
- package/components/MazLink.mjs +1 -1
- package/components/MazPagination.mjs +1 -1
- package/components/MazPhoneNumberInput.d.ts +2 -2
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.mjs +1 -1
- package/components/MazSelect.d.ts +4 -0
- package/components/MazSelect.mjs +1 -1
- package/components/MazStepper.mjs +1 -1
- package/components/MazSwitch.mjs +33 -33
- package/components/MazTable.d.ts +32 -3
- package/components/MazTable.mjs +1 -1
- package/components/assets/MazBtn.css +1 -1
- package/components/assets/MazCheckbox.css +1 -1
- package/components/assets/MazDropdown.css +1 -1
- package/components/assets/MazInputNumber.css +1 -1
- package/components/assets/MazInputTags.css +1 -1
- package/components/assets/MazLazyImg.css +1 -1
- package/components/assets/MazPagination.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazPicker.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazSwitch.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/chunks/{MazAvatar-BXZpFUaZ.mjs → MazAvatar-BmaVqPui.mjs} +1 -1
- package/components/chunks/{MazBottomSheet-DQTlEDlz.mjs → MazBottomSheet-s9lLaK1M.mjs} +1 -1
- package/components/chunks/MazBtn-BMmuCciQ.mjs +116 -0
- package/components/chunks/MazBtn-BXdap6JU.mjs +116 -0
- package/components/chunks/MazBtn-CHABo63Y.mjs +116 -0
- package/components/chunks/MazBtn-CVB5qDjV.mjs +121 -0
- package/components/chunks/MazBtn-CXxOU7fp.mjs +116 -0
- package/components/chunks/MazBtn-CZSXnr3w.mjs +116 -0
- package/components/chunks/MazBtn-CwYBz6QO.mjs +116 -0
- package/components/chunks/MazBtn-DIE2eM-g.mjs +116 -0
- package/components/chunks/MazBtn-DKD-ZMaF.mjs +116 -0
- package/components/chunks/MazBtn-DarjZUV4.mjs +124 -0
- package/components/chunks/MazBtn-OKT5-Y4s.mjs +116 -0
- package/components/chunks/MazBtn-e3abHT2L.mjs +116 -0
- package/components/chunks/{MazCard-BapktHxt.mjs → MazCard-BaJ5Ee3I.mjs} +1 -1
- package/components/chunks/{MazCarousel-DYdWCLk7.mjs → MazCarousel-Bb4fpVqN.mjs} +1 -1
- package/components/chunks/{MazCheckbox-SCDhMssn.mjs → MazCheckbox-8n6NtRBb.mjs} +32 -32
- package/components/chunks/{MazCheckbox-q5o-NFLo.mjs → MazCheckbox-C4diNXJq.mjs} +32 -32
- package/components/chunks/{MazDialog-DbEp5ZrT.mjs → MazDialog-Bv2PzQBz.mjs} +1 -1
- package/components/chunks/{MazDialogPromise-B2WdAwbv.mjs → MazDialogPromise-BZLP9sXZ.mjs} +2 -2
- package/components/chunks/{MazExpandAnimation-BFyvL-vh.mjs → MazExpandAnimation-Bkw_wFTi.mjs} +1 -1
- package/components/chunks/{MazGallery-HtChfMa_.mjs → MazGallery-C9secrXc.mjs} +2 -2
- package/components/chunks/MazIcon-BaJm2s8_.mjs +101 -0
- package/components/chunks/MazIcon-BbvBov5G.mjs +106 -0
- package/components/chunks/MazIcon-CudB1a0D.mjs +101 -0
- package/components/chunks/{MazInput-fbdOvhry.mjs → MazInput-B3RzuuNv.mjs} +1 -1
- package/components/chunks/{MazInputNumber-mu9wEfTT.mjs → MazInputNumber-mLgq5obR.mjs} +198 -232
- package/components/chunks/{MazInputPrice-Y6lalrWq.mjs → MazInputPrice-DhYRBqTS.mjs} +1 -1
- package/components/chunks/{MazInputTags-DVYW4SbE.mjs → MazInputTags-DinwbXaD.mjs} +201 -238
- package/components/chunks/{MazLazyImg-D2seDVoC.mjs → MazLazyImg-RHZ9wOy2.mjs} +7 -5
- package/components/chunks/{MazLazyImg-Db6BYACF.mjs → MazLazyImg-i-z6hcwF.mjs} +10 -8
- package/components/chunks/{MazLink-HJI1YmdA.mjs → MazLink-Dl9ePCGm.mjs} +1 -1
- package/components/chunks/MazPagination-Cqnr19iI.mjs +360 -0
- package/components/chunks/MazPhoneNumberInput-C3GdtqN2.mjs +1821 -0
- package/components/chunks/{MazPicker-BPH4sy2Q.mjs → MazPicker-DA92HhwS.mjs} +541 -575
- package/components/chunks/{MazPickerMonthSwitcher-Ca4BqrF-.mjs → MazPickerMonthSwitcher-CPWkw0Hq.mjs} +1 -1
- package/components/chunks/{MazPickerShortcuts-Bs2RMdC_.mjs → MazPickerShortcuts-Fwcoqg5M.mjs} +1 -1
- package/components/chunks/{MazPickerYearSwitcher-Bg_0ecwk.mjs → MazPickerYearSwitcher-DfSXPGfT.mjs} +1 -1
- package/components/chunks/{MazSelect-BTrnZLF5.mjs → MazSelect-DPTuyc26.mjs} +133 -129
- package/components/chunks/{MazSpinner-BAHWcgal.mjs → MazSpinner-5w4SkOOl.mjs} +1 -1
- package/components/chunks/MazSpinner-B-mc1FWS.mjs +37 -0
- package/components/chunks/{MazSpinner-CLfp6QHS.mjs → MazSpinner-BCHAzmqS.mjs} +1 -1
- package/components/chunks/{MazSpinner-2KA4ECS_.mjs → MazSpinner-BCQzF6j-.mjs} +1 -1
- package/components/chunks/MazSpinner-BEqvmPiV.mjs +37 -0
- package/components/chunks/MazSpinner-BoG1T_ZX.mjs +37 -0
- package/components/chunks/MazSpinner-BpjK60ul.mjs +37 -0
- package/components/chunks/MazSpinner-ByWRmwig.mjs +37 -0
- package/components/chunks/{MazSpinner-BhFMGOGc.mjs → MazSpinner-C2ok6AlJ.mjs} +1 -1
- package/components/chunks/{MazSpinner-38KAnd2e.mjs → MazSpinner-CFJmcsGl.mjs} +1 -1
- package/components/chunks/{MazSpinner-D9K-TsT7.mjs → MazSpinner-CVBz5HIx.mjs} +1 -1
- package/components/chunks/{MazSpinner-CShEq13p.mjs → MazSpinner-DEdQlQr1.mjs} +1 -1
- package/components/chunks/{MazSpinner-AyzqowuD.mjs → MazSpinner-DhHVVBJE.mjs} +1 -1
- package/components/chunks/MazSpinner-DuGaC-cw.mjs +37 -0
- package/components/chunks/MazSpinner-Iwon82He.mjs +37 -0
- package/components/chunks/MazSpinner-JbfjMNFL.mjs +37 -0
- package/components/chunks/MazSpinner-QgcgF5j5.mjs +37 -0
- package/components/chunks/MazSpinner-yQGVxaFm.mjs +37 -0
- package/components/chunks/{MazStepper-BmCk5RfP.mjs → MazStepper-DRWtYHZR.mjs} +1 -1
- package/components/chunks/MazTable-CrtVI-dp.mjs +2015 -0
- package/components/chunks/{MazTransitionExpand-D9pcEmUk.mjs → MazTransitionExpand-BoTQeNNf.mjs} +1 -1
- package/css/main.css +1 -1
- package/modules/assets/MazBtn.css +1 -1
- package/modules/chunks/MazBtn-BG2dUdHV.cjs +9 -0
- package/modules/chunks/MazBtn-BeqYSSYI.mjs +116 -0
- package/modules/chunks/MazIcon-BqfELHOt.mjs +101 -0
- package/modules/chunks/MazIcon-RkWxQ8JM.cjs +1 -0
- package/modules/chunks/{MazSpinner-g6fliUmS.mjs → MazSpinner-DgSRxVEo.mjs} +1 -1
- package/modules/chunks/{MazSpinner-zX9CPyJB.cjs → MazSpinner-GfL807jq.cjs} +1 -1
- package/modules/chunks/{index-BLdtEKD5.cjs → index-CE2CsQsx.cjs} +4 -4
- package/modules/chunks/{index-Bpj_Jr6I.mjs → index-aKGx1nxl.mjs} +4 -4
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +1 -1
- package/package.json +1 -1
- package/types/components/MazAccordion.vue.d.ts +1 -1
- package/types/components/MazBtn.vue.d.ts +0 -4
- package/types/components/MazCardSpotlight.vue.d.ts +1 -1
- package/types/components/MazDropdown.vue.d.ts +13 -0
- package/types/components/MazLazyImg.vue.d.ts +2 -0
- package/types/components/MazPhoneNumberInput.vue.d.ts +2 -2
- package/types/components/MazSelect.vue.d.ts +4 -0
- package/types/components/MazTable.vue.d.ts +32 -3
- package/types/modules/helpers/country-flag-from-flagcn.d.ts +7 -0
- package/components/chunks/MazBtn-6D9MhUfI.mjs +0 -150
- package/components/chunks/MazBtn-B2A4nNWi.mjs +0 -150
- package/components/chunks/MazBtn-B9mpn5c4.mjs +0 -150
- package/components/chunks/MazBtn-BTxqbijR.mjs +0 -158
- package/components/chunks/MazBtn-BYAmxCNV.mjs +0 -150
- package/components/chunks/MazBtn-BkBaNYfi.mjs +0 -150
- package/components/chunks/MazBtn-BkT-9nbu.mjs +0 -150
- package/components/chunks/MazBtn-C6b9OPzf.mjs +0 -150
- package/components/chunks/MazBtn-CTDhJ_fQ.mjs +0 -155
- package/components/chunks/MazBtn-CofOhh-q.mjs +0 -150
- package/components/chunks/MazBtn-CwkvhgML.mjs +0 -150
- package/components/chunks/MazBtn-DgmsRNq_.mjs +0 -150
- package/components/chunks/MazIcon-BDGxCy9M.mjs +0 -118
- package/components/chunks/MazIcon-BW5X0uLg.mjs +0 -113
- package/components/chunks/MazIcon-DiRrHbn4.mjs +0 -113
- package/components/chunks/MazPagination-BOUDMaJO.mjs +0 -394
- package/components/chunks/MazPhoneNumberInput-DjWHMKpM.mjs +0 -1579
- package/components/chunks/MazSpinner-BLp7sE5i.mjs +0 -37
- package/components/chunks/MazSpinner-C91Lm_Xp.mjs +0 -37
- package/components/chunks/MazSpinner-CCIMQLA1.mjs +0 -37
- package/components/chunks/MazSpinner-CLQy7iCO.mjs +0 -37
- package/components/chunks/MazSpinner-D7CMPaDb.mjs +0 -37
- package/components/chunks/MazSpinner-D8uk4SQh.mjs +0 -37
- package/components/chunks/MazSpinner-D_Xqx8Vb.mjs +0 -37
- package/components/chunks/MazSpinner-JgB1pud8.mjs +0 -37
- package/components/chunks/MazSpinner-gYRmfrSM.mjs +0 -37
- package/components/chunks/MazSpinner-hPbKGN5o.mjs +0 -37
- package/components/chunks/MazTable-DsZV0t--.mjs +0 -1999
- package/modules/chunks/MazBtn-B5URGSZl.cjs +0 -9
- package/modules/chunks/MazBtn-DRuL8cjg.mjs +0 -150
- package/modules/chunks/MazIcon-BskR2yy9.cjs +0 -1
- package/modules/chunks/MazIcon-CKc-vAA8.mjs +0 -113
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { defineComponent as F, defineAsyncComponent as h, useAttrs as j, useSlots as E, onBeforeMount as O, computed as l, openBlock as n, createBlock as a, resolveDynamicComponent as r, normalizeClass as s, withCtx as R, createElementBlock as u, createCommentVNode as t, renderSlot as d, unref as c } from "vue";
|
|
2
|
-
import { _ as w } from "./MazInputPrice-Y6lalrWq.mjs";
|
|
3
|
-
import '../assets/MazBtn.css';const A = /* @__PURE__ */ F({
|
|
4
|
-
__name: "MazBtn",
|
|
5
|
-
props: {
|
|
6
|
-
variant: { default: "button" },
|
|
7
|
-
size: { default: "md" },
|
|
8
|
-
color: { default: "primary" },
|
|
9
|
-
type: { default: "button" },
|
|
10
|
-
rounded: { type: Boolean },
|
|
11
|
-
roundedSize: { default: "lg" },
|
|
12
|
-
noRounded: { type: Boolean },
|
|
13
|
-
outline: { type: Boolean },
|
|
14
|
-
pastel: { type: Boolean },
|
|
15
|
-
block: { type: Boolean },
|
|
16
|
-
noUnderline: { type: Boolean },
|
|
17
|
-
loading: { type: Boolean },
|
|
18
|
-
disabled: { type: Boolean },
|
|
19
|
-
fab: { type: Boolean },
|
|
20
|
-
icon: { type: [String, Function, Object], default: void 0 },
|
|
21
|
-
leftIcon: { type: [String, Function, Object], default: void 0 },
|
|
22
|
-
rightIcon: { type: [String, Function, Object], default: void 0 },
|
|
23
|
-
noPadding: { type: Boolean },
|
|
24
|
-
noElevation: { type: Boolean },
|
|
25
|
-
contentClass: { default: void 0 }
|
|
26
|
-
},
|
|
27
|
-
setup(g) {
|
|
28
|
-
const o = g, z = h(() => import("./MazSpinner-D7CMPaDb.mjs")), f = h(() => import("./MazIcon-BDGxCy9M.mjs")), { href: k, to: B } = j(), p = E();
|
|
29
|
-
O(() => {
|
|
30
|
-
o.icon && !o.fab && console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
|
|
31
|
-
});
|
|
32
|
-
const v = l(() => k ? "a" : B ? "router-link" : "button"), I = l(
|
|
33
|
-
() => o.pastel ? `--${o.color}-pastel` : o.outline ? `--${o.color}-outline` : `--${o.color}`
|
|
34
|
-
), b = l(
|
|
35
|
-
() => (o.loading || o.disabled) && v.value === "button"
|
|
36
|
-
), C = l(() => b.value ? "--cursor-default" : "--cursor-pointer"), $ = l(() => `--is-${o.variant}`), i = l(() => o.loading && o.variant === "button"), m = l(() => !!p["left-icon"] || o.leftIcon), y = l(() => !!p["right-icon"] || o.rightIcon), S = l(() => m.value || y.value), M = l(() => o.fab && (o.icon || !!p.icon)), T = l(() => v.value === "button" ? o.type : void 0);
|
|
37
|
-
return (e, D) => (n(), a(r(v.value), {
|
|
38
|
-
disabled: b.value || void 0,
|
|
39
|
-
class: s(["m-btn", [
|
|
40
|
-
`--${e.size}`,
|
|
41
|
-
!e.fab && !e.rounded && e.roundedSize && `--rounded-${e.roundedSize}`,
|
|
42
|
-
I.value,
|
|
43
|
-
C.value,
|
|
44
|
-
$.value,
|
|
45
|
-
{
|
|
46
|
-
"--block": e.block,
|
|
47
|
-
"--no-underline": e.noUnderline,
|
|
48
|
-
"--fab": e.fab,
|
|
49
|
-
"--loading": e.loading,
|
|
50
|
-
"--disabled": b.value,
|
|
51
|
-
"--icon": S.value,
|
|
52
|
-
"--rounded": e.rounded,
|
|
53
|
-
"--no-rounded": e.noRounded,
|
|
54
|
-
"--no-padding": e.noPadding,
|
|
55
|
-
"--no-elevation": e.noElevation
|
|
56
|
-
}
|
|
57
|
-
]]),
|
|
58
|
-
type: T.value
|
|
59
|
-
}, {
|
|
60
|
-
default: R(() => [
|
|
61
|
-
m.value ? (n(), u(
|
|
62
|
-
"div",
|
|
63
|
-
{
|
|
64
|
-
key: 0,
|
|
65
|
-
class: s(["m-btn__icon-left maz-flex maz-flex-center", { "maz-invisible": i.value }])
|
|
66
|
-
},
|
|
67
|
-
[
|
|
68
|
-
t(`
|
|
69
|
-
@slot left-icon - The icon to display on the left of the button
|
|
70
|
-
`),
|
|
71
|
-
d(e.$slots, "left-icon", {}, () => [
|
|
72
|
-
typeof e.leftIcon == "string" ? (n(), a(c(f), {
|
|
73
|
-
key: 0,
|
|
74
|
-
name: e.leftIcon
|
|
75
|
-
}, null, 8, ["name"])) : e.leftIcon ? (n(), a(r(e.leftIcon), { key: 1 })) : t("v-if", !0)
|
|
76
|
-
], !0)
|
|
77
|
-
],
|
|
78
|
-
2
|
|
79
|
-
/* CLASS */
|
|
80
|
-
)) : t("v-if", !0),
|
|
81
|
-
M.value ? (n(), u(
|
|
82
|
-
"div",
|
|
83
|
-
{
|
|
84
|
-
key: 1,
|
|
85
|
-
class: s(["m-btn__icon", { "maz-invisible": i.value }])
|
|
86
|
-
},
|
|
87
|
-
[
|
|
88
|
-
t(`
|
|
89
|
-
@slot icon - The icon to display on the fab button
|
|
90
|
-
`),
|
|
91
|
-
d(e.$slots, "icon", {}, () => [
|
|
92
|
-
typeof e.icon == "string" ? (n(), a(c(f), {
|
|
93
|
-
key: 0,
|
|
94
|
-
name: e.icon
|
|
95
|
-
}, null, 8, ["name"])) : e.icon ? (n(), a(r(e.icon), { key: 1 })) : t("v-if", !0)
|
|
96
|
-
], !0)
|
|
97
|
-
],
|
|
98
|
-
2
|
|
99
|
-
/* CLASS */
|
|
100
|
-
)) : t("v-if", !0),
|
|
101
|
-
e.$slots.default ? (n(), u(
|
|
102
|
-
"span",
|
|
103
|
-
{
|
|
104
|
-
key: 2,
|
|
105
|
-
class: s([{ "maz-invisible": i.value }, e.contentClass])
|
|
106
|
-
},
|
|
107
|
-
[
|
|
108
|
-
t(`
|
|
109
|
-
@slot default - The content of the button
|
|
110
|
-
`),
|
|
111
|
-
d(e.$slots, "default", {}, void 0, !0)
|
|
112
|
-
],
|
|
113
|
-
2
|
|
114
|
-
/* CLASS */
|
|
115
|
-
)) : t("v-if", !0),
|
|
116
|
-
y.value ? (n(), u(
|
|
117
|
-
"div",
|
|
118
|
-
{
|
|
119
|
-
key: 3,
|
|
120
|
-
class: s(["m-btn__icon-right", { "maz-invisible": i.value }])
|
|
121
|
-
},
|
|
122
|
-
[
|
|
123
|
-
t(`
|
|
124
|
-
@slot right-icon - The icon to display on the right of the button
|
|
125
|
-
`),
|
|
126
|
-
d(e.$slots, "right-icon", {}, () => [
|
|
127
|
-
typeof e.rightIcon == "string" ? (n(), a(c(f), {
|
|
128
|
-
key: 0,
|
|
129
|
-
name: e.rightIcon
|
|
130
|
-
}, null, 8, ["name"])) : e.rightIcon ? (n(), a(r(e.rightIcon), { key: 1 })) : t("v-if", !0)
|
|
131
|
-
], !0)
|
|
132
|
-
],
|
|
133
|
-
2
|
|
134
|
-
/* CLASS */
|
|
135
|
-
)) : t("v-if", !0),
|
|
136
|
-
i.value ? (n(), a(c(z), {
|
|
137
|
-
key: 4,
|
|
138
|
-
class: "m-btn-loader",
|
|
139
|
-
size: "2em",
|
|
140
|
-
color: e.color
|
|
141
|
-
}, null, 8, ["color"])) : t("v-if", !0)
|
|
142
|
-
]),
|
|
143
|
-
_: 3
|
|
144
|
-
/* FORWARDED */
|
|
145
|
-
}, 8, ["disabled", "class", "type"]));
|
|
146
|
-
}
|
|
147
|
-
}), U = /* @__PURE__ */ w(A, [["__scopeId", "data-v-9e61f4b3"]]);
|
|
148
|
-
export {
|
|
149
|
-
U as default
|
|
150
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { inject as b, defineComponent as C, ref as g, computed as p, onMounted as P, watchEffect as _, openBlock as h, createElementBlock as S, Fragment as $, createCommentVNode as s, mergeProps as A, nextTick as q } from "vue";
|
|
2
|
-
function H(l, d) {
|
|
3
|
-
const o = b(l, d);
|
|
4
|
-
if (!o)
|
|
5
|
-
throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${l}`);
|
|
6
|
-
return o;
|
|
7
|
-
}
|
|
8
|
-
const I = ["innerHTML"], G = /* @__PURE__ */ C({
|
|
9
|
-
__name: "MazIcon",
|
|
10
|
-
props: {
|
|
11
|
-
/** The source path of the SVG file - e.g: `/icons/home.svg` */
|
|
12
|
-
src: { type: String, default: void 0 },
|
|
13
|
-
/** The path of the folder where the SVG files are stored - e.g: `/icons` */
|
|
14
|
-
path: { type: String, default: void 0 },
|
|
15
|
-
/** The name of the SVG file - e.g: `home` */
|
|
16
|
-
name: { type: String, default: void 0 },
|
|
17
|
-
/** The size of the SVG file - e.g: `1em` */
|
|
18
|
-
size: { type: String, default: void 0 },
|
|
19
|
-
/** The title of the SVG file - e.g: `Home` */
|
|
20
|
-
title: { type: String, default: void 0 },
|
|
21
|
-
/** The function to transform the source of the SVG file - e.g: `(svg) => svg` */
|
|
22
|
-
transformSource: {
|
|
23
|
-
type: Function,
|
|
24
|
-
default: (l) => l
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
emits: ["loaded", "unloaded", "error"],
|
|
28
|
-
setup(l, { emit: d }) {
|
|
29
|
-
const o = l, f = d, a = {}, i = g(), v = g();
|
|
30
|
-
function w() {
|
|
31
|
-
try {
|
|
32
|
-
return H("mazIconPath");
|
|
33
|
-
} catch {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const m = p(() => o.path ?? w()), E = p(() => o.src ? o.src : m.value ? `${m.value}/${o.name}.svg` : `/${o.name}.svg`);
|
|
38
|
-
P(() => {
|
|
39
|
-
!o.name && !o.src && console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop');
|
|
40
|
-
});
|
|
41
|
-
function y(e, n) {
|
|
42
|
-
const t = e.querySelectorAll("title");
|
|
43
|
-
if (t.length > 0)
|
|
44
|
-
t[0].textContent = n;
|
|
45
|
-
else {
|
|
46
|
-
const r = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
|
47
|
-
r.textContent = n, e.append(r);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function z(e) {
|
|
51
|
-
return Object.keys(e).reduce((n, t) => (e[t] !== !1 && e[t] !== null && e[t] !== void 0 && (n[t] = e[t]), n), {});
|
|
52
|
-
}
|
|
53
|
-
function M(e) {
|
|
54
|
-
const n = {}, t = e.attributes;
|
|
55
|
-
if (!t)
|
|
56
|
-
return n;
|
|
57
|
-
for (let r = t.length - 1; r >= 0; r--)
|
|
58
|
-
n[t[r].name] = t[r].value;
|
|
59
|
-
return n;
|
|
60
|
-
}
|
|
61
|
-
function T(e) {
|
|
62
|
-
let n = e.cloneNode(!0);
|
|
63
|
-
return n = o.transformSource(e), o.title && y(n, o.title), e.innerHTML;
|
|
64
|
-
}
|
|
65
|
-
async function x(e) {
|
|
66
|
-
a[e] || (a[e] = L(e));
|
|
67
|
-
try {
|
|
68
|
-
i.value = await a[e], await q(), f("loaded", v.value);
|
|
69
|
-
} catch (n) {
|
|
70
|
-
i.value && (i.value = void 0, f("unloaded")), delete a[e], f("error", n);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function L(e) {
|
|
74
|
-
return new Promise((n, t) => {
|
|
75
|
-
const r = new XMLHttpRequest();
|
|
76
|
-
r.open("GET", e, !0), r.addEventListener("load", () => {
|
|
77
|
-
if (r.status >= 200 && r.status < 400)
|
|
78
|
-
try {
|
|
79
|
-
let c = new DOMParser().parseFromString(r.responseText, "text/xml").querySelectorAll("svg")[0];
|
|
80
|
-
c ? (c = o.transformSource(c), n(c)) : t(new Error('Loaded file is not valid SVG"'));
|
|
81
|
-
} catch (u) {
|
|
82
|
-
t(u);
|
|
83
|
-
}
|
|
84
|
-
else
|
|
85
|
-
t(new Error("Error loading SVG"));
|
|
86
|
-
}), r.addEventListener("error", (u) => t(u)), r.send();
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return _(() => x(E.value)), (e, n) => (h(), S(
|
|
90
|
-
$,
|
|
91
|
-
null,
|
|
92
|
-
[
|
|
93
|
-
s(" eslint-disable vue/no-v-html "),
|
|
94
|
-
s(" eslint-disable vue/html-self-closing "),
|
|
95
|
-
i.value ? (h(), S("svg", A({
|
|
96
|
-
key: 0,
|
|
97
|
-
ref_key: "svgElem",
|
|
98
|
-
ref: v,
|
|
99
|
-
width: "1em",
|
|
100
|
-
height: "1em"
|
|
101
|
-
}, {
|
|
102
|
-
...M(i.value),
|
|
103
|
-
...z(e.$attrs)
|
|
104
|
-
}, {
|
|
105
|
-
style: `font-size: ${l.size}`,
|
|
106
|
-
innerHTML: T(i.value)
|
|
107
|
-
}), null, 16, I)) : s("v-if", !0),
|
|
108
|
-
s(" eslint-enable vue/no-v-html "),
|
|
109
|
-
s(" eslint-enable vue/html-self-closing ")
|
|
110
|
-
],
|
|
111
|
-
2112
|
|
112
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
113
|
-
));
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
export {
|
|
117
|
-
G as default
|
|
118
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { defineComponent as b, ref as v, computed as g, onMounted as P, watchEffect as _, openBlock as p, createElementBlock as h, Fragment as A, createCommentVNode as i, mergeProps as C, nextTick as $ } from "vue";
|
|
2
|
-
import { i as q } from "./MazTable-DsZV0t--.mjs";
|
|
3
|
-
const H = ["innerHTML"], G = /* @__PURE__ */ b({
|
|
4
|
-
__name: "MazIcon",
|
|
5
|
-
props: {
|
|
6
|
-
/** The source path of the SVG file - e.g: `/icons/home.svg` */
|
|
7
|
-
src: { type: String, default: void 0 },
|
|
8
|
-
/** The path of the folder where the SVG files are stored - e.g: `/icons` */
|
|
9
|
-
path: { type: String, default: void 0 },
|
|
10
|
-
/** The name of the SVG file - e.g: `home` */
|
|
11
|
-
name: { type: String, default: void 0 },
|
|
12
|
-
/** The size of the SVG file - e.g: `1em` */
|
|
13
|
-
size: { type: String, default: void 0 },
|
|
14
|
-
/** The title of the SVG file - e.g: `Home` */
|
|
15
|
-
title: { type: String, default: void 0 },
|
|
16
|
-
/** The function to transform the source of the SVG file - e.g: `(svg) => svg` */
|
|
17
|
-
transformSource: {
|
|
18
|
-
type: Function,
|
|
19
|
-
default: (s) => s
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
emits: ["loaded", "unloaded", "error"],
|
|
23
|
-
setup(s, { emit: S }) {
|
|
24
|
-
const o = s, d = S, a = {}, l = v(), f = v();
|
|
25
|
-
function w() {
|
|
26
|
-
try {
|
|
27
|
-
return q("mazIconPath");
|
|
28
|
-
} catch {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const m = g(() => o.path ?? w()), y = g(() => o.src ? o.src : m.value ? `${m.value}/${o.name}.svg` : `/${o.name}.svg`);
|
|
33
|
-
P(() => {
|
|
34
|
-
!o.name && !o.src && console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop');
|
|
35
|
-
});
|
|
36
|
-
function E(e, n) {
|
|
37
|
-
const t = e.querySelectorAll("title");
|
|
38
|
-
if (t.length > 0)
|
|
39
|
-
t[0].textContent = n;
|
|
40
|
-
else {
|
|
41
|
-
const r = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
|
42
|
-
r.textContent = n, e.append(r);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function M(e) {
|
|
46
|
-
return Object.keys(e).reduce((n, t) => (e[t] !== !1 && e[t] !== null && e[t] !== void 0 && (n[t] = e[t]), n), {});
|
|
47
|
-
}
|
|
48
|
-
function z(e) {
|
|
49
|
-
const n = {}, t = e.attributes;
|
|
50
|
-
if (!t)
|
|
51
|
-
return n;
|
|
52
|
-
for (let r = t.length - 1; r >= 0; r--)
|
|
53
|
-
n[t[r].name] = t[r].value;
|
|
54
|
-
return n;
|
|
55
|
-
}
|
|
56
|
-
function T(e) {
|
|
57
|
-
let n = e.cloneNode(!0);
|
|
58
|
-
return n = o.transformSource(e), o.title && E(n, o.title), e.innerHTML;
|
|
59
|
-
}
|
|
60
|
-
async function x(e) {
|
|
61
|
-
a[e] || (a[e] = L(e));
|
|
62
|
-
try {
|
|
63
|
-
l.value = await a[e], await $(), d("loaded", f.value);
|
|
64
|
-
} catch (n) {
|
|
65
|
-
l.value && (l.value = void 0, d("unloaded")), delete a[e], d("error", n);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function L(e) {
|
|
69
|
-
return new Promise((n, t) => {
|
|
70
|
-
const r = new XMLHttpRequest();
|
|
71
|
-
r.open("GET", e, !0), r.addEventListener("load", () => {
|
|
72
|
-
if (r.status >= 200 && r.status < 400)
|
|
73
|
-
try {
|
|
74
|
-
let c = new DOMParser().parseFromString(r.responseText, "text/xml").querySelectorAll("svg")[0];
|
|
75
|
-
c ? (c = o.transformSource(c), n(c)) : t(new Error('Loaded file is not valid SVG"'));
|
|
76
|
-
} catch (u) {
|
|
77
|
-
t(u);
|
|
78
|
-
}
|
|
79
|
-
else
|
|
80
|
-
t(new Error("Error loading SVG"));
|
|
81
|
-
}), r.addEventListener("error", (u) => t(u)), r.send();
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return _(() => x(y.value)), (e, n) => (p(), h(
|
|
85
|
-
A,
|
|
86
|
-
null,
|
|
87
|
-
[
|
|
88
|
-
i(" eslint-disable vue/no-v-html "),
|
|
89
|
-
i(" eslint-disable vue/html-self-closing "),
|
|
90
|
-
l.value ? (p(), h("svg", C({
|
|
91
|
-
key: 0,
|
|
92
|
-
ref_key: "svgElem",
|
|
93
|
-
ref: f,
|
|
94
|
-
width: "1em",
|
|
95
|
-
height: "1em"
|
|
96
|
-
}, {
|
|
97
|
-
...z(l.value),
|
|
98
|
-
...M(e.$attrs)
|
|
99
|
-
}, {
|
|
100
|
-
style: `font-size: ${s.size}`,
|
|
101
|
-
innerHTML: T(l.value)
|
|
102
|
-
}), null, 16, H)) : i("v-if", !0),
|
|
103
|
-
i(" eslint-enable vue/no-v-html "),
|
|
104
|
-
i(" eslint-enable vue/html-self-closing ")
|
|
105
|
-
],
|
|
106
|
-
2112
|
|
107
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
108
|
-
));
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
export {
|
|
112
|
-
G as default
|
|
113
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { defineComponent as b, ref as v, computed as g, onMounted as P, watchEffect as _, openBlock as p, createElementBlock as h, Fragment as A, createCommentVNode as i, mergeProps as C, nextTick as $ } from "vue";
|
|
2
|
-
import { i as q } from "./MazPhoneNumberInput-DjWHMKpM.mjs";
|
|
3
|
-
const H = ["innerHTML"], G = /* @__PURE__ */ b({
|
|
4
|
-
__name: "MazIcon",
|
|
5
|
-
props: {
|
|
6
|
-
/** The source path of the SVG file - e.g: `/icons/home.svg` */
|
|
7
|
-
src: { type: String, default: void 0 },
|
|
8
|
-
/** The path of the folder where the SVG files are stored - e.g: `/icons` */
|
|
9
|
-
path: { type: String, default: void 0 },
|
|
10
|
-
/** The name of the SVG file - e.g: `home` */
|
|
11
|
-
name: { type: String, default: void 0 },
|
|
12
|
-
/** The size of the SVG file - e.g: `1em` */
|
|
13
|
-
size: { type: String, default: void 0 },
|
|
14
|
-
/** The title of the SVG file - e.g: `Home` */
|
|
15
|
-
title: { type: String, default: void 0 },
|
|
16
|
-
/** The function to transform the source of the SVG file - e.g: `(svg) => svg` */
|
|
17
|
-
transformSource: {
|
|
18
|
-
type: Function,
|
|
19
|
-
default: (s) => s
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
emits: ["loaded", "unloaded", "error"],
|
|
23
|
-
setup(s, { emit: S }) {
|
|
24
|
-
const o = s, d = S, a = {}, l = v(), f = v();
|
|
25
|
-
function w() {
|
|
26
|
-
try {
|
|
27
|
-
return q("mazIconPath");
|
|
28
|
-
} catch {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const m = g(() => o.path ?? w()), y = g(() => o.src ? o.src : m.value ? `${m.value}/${o.name}.svg` : `/${o.name}.svg`);
|
|
33
|
-
P(() => {
|
|
34
|
-
!o.name && !o.src && console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop');
|
|
35
|
-
});
|
|
36
|
-
function E(e, n) {
|
|
37
|
-
const t = e.querySelectorAll("title");
|
|
38
|
-
if (t.length > 0)
|
|
39
|
-
t[0].textContent = n;
|
|
40
|
-
else {
|
|
41
|
-
const r = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
|
42
|
-
r.textContent = n, e.append(r);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function M(e) {
|
|
46
|
-
return Object.keys(e).reduce((n, t) => (e[t] !== !1 && e[t] !== null && e[t] !== void 0 && (n[t] = e[t]), n), {});
|
|
47
|
-
}
|
|
48
|
-
function z(e) {
|
|
49
|
-
const n = {}, t = e.attributes;
|
|
50
|
-
if (!t)
|
|
51
|
-
return n;
|
|
52
|
-
for (let r = t.length - 1; r >= 0; r--)
|
|
53
|
-
n[t[r].name] = t[r].value;
|
|
54
|
-
return n;
|
|
55
|
-
}
|
|
56
|
-
function T(e) {
|
|
57
|
-
let n = e.cloneNode(!0);
|
|
58
|
-
return n = o.transformSource(e), o.title && E(n, o.title), e.innerHTML;
|
|
59
|
-
}
|
|
60
|
-
async function x(e) {
|
|
61
|
-
a[e] || (a[e] = L(e));
|
|
62
|
-
try {
|
|
63
|
-
l.value = await a[e], await $(), d("loaded", f.value);
|
|
64
|
-
} catch (n) {
|
|
65
|
-
l.value && (l.value = void 0, d("unloaded")), delete a[e], d("error", n);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function L(e) {
|
|
69
|
-
return new Promise((n, t) => {
|
|
70
|
-
const r = new XMLHttpRequest();
|
|
71
|
-
r.open("GET", e, !0), r.addEventListener("load", () => {
|
|
72
|
-
if (r.status >= 200 && r.status < 400)
|
|
73
|
-
try {
|
|
74
|
-
let c = new DOMParser().parseFromString(r.responseText, "text/xml").querySelectorAll("svg")[0];
|
|
75
|
-
c ? (c = o.transformSource(c), n(c)) : t(new Error('Loaded file is not valid SVG"'));
|
|
76
|
-
} catch (u) {
|
|
77
|
-
t(u);
|
|
78
|
-
}
|
|
79
|
-
else
|
|
80
|
-
t(new Error("Error loading SVG"));
|
|
81
|
-
}), r.addEventListener("error", (u) => t(u)), r.send();
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return _(() => x(y.value)), (e, n) => (p(), h(
|
|
85
|
-
A,
|
|
86
|
-
null,
|
|
87
|
-
[
|
|
88
|
-
i(" eslint-disable vue/no-v-html "),
|
|
89
|
-
i(" eslint-disable vue/html-self-closing "),
|
|
90
|
-
l.value ? (p(), h("svg", C({
|
|
91
|
-
key: 0,
|
|
92
|
-
ref_key: "svgElem",
|
|
93
|
-
ref: f,
|
|
94
|
-
width: "1em",
|
|
95
|
-
height: "1em"
|
|
96
|
-
}, {
|
|
97
|
-
...z(l.value),
|
|
98
|
-
...M(e.$attrs)
|
|
99
|
-
}, {
|
|
100
|
-
style: `font-size: ${s.size}`,
|
|
101
|
-
innerHTML: T(l.value)
|
|
102
|
-
}), null, 16, H)) : i("v-if", !0),
|
|
103
|
-
i(" eslint-enable vue/no-v-html "),
|
|
104
|
-
i(" eslint-enable vue/html-self-closing ")
|
|
105
|
-
],
|
|
106
|
-
2112
|
|
107
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
108
|
-
));
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
export {
|
|
112
|
-
G as default
|
|
113
|
-
};
|