maz-ui 3.37.0 → 3.37.2
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/MazCheckbox.d.ts +4 -0
- package/components/MazCheckbox.mjs +31 -24
- package/components/MazInput.d.ts +2 -0
- package/components/MazInput.mjs +1 -1
- package/components/MazInputNumber.d.ts +2 -0
- package/components/MazInputNumber.mjs +1 -1
- package/components/MazInputPrice.d.ts +8 -0
- package/components/MazInputPrice.mjs +1 -1
- package/components/MazInputTags.d.ts +2 -0
- package/components/MazInputTags.mjs +1 -1
- package/components/MazPhoneNumberInput.d.ts +2 -0
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.d.ts +2 -0
- package/components/MazPicker.mjs +1 -1
- package/components/MazRadio.d.ts +9 -0
- package/components/MazRadio.mjs +44 -37
- package/components/MazSelect.d.ts +2 -0
- package/components/MazSelect.mjs +1 -1
- package/components/MazTable.mjs +1 -1
- package/components/MazTextarea.mjs +1 -1
- package/components/assets/MazCheckbox.css +1 -1
- package/components/assets/MazInput.css +1 -1
- package/components/assets/MazInputNumber.css +1 -1
- package/components/assets/MazInputPrice.css +1 -1
- package/components/assets/MazInputTags.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazPicker.css +1 -1
- package/components/assets/MazRadio.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/assets/MazTextarea.css +1 -1
- package/components/chunks/{MazBtn-C3z_znl5.mjs → MazBtn-Bo51KtKY.mjs} +2 -2
- package/components/chunks/{MazBtn-CuYCQCM2.mjs → MazBtn-CDQAW3fg.mjs} +2 -2
- package/components/chunks/MazBtn-D-Axz-X0.mjs +151 -0
- package/components/chunks/{MazBtn-D7b2VFGB.mjs → MazBtn-Koayc6g_.mjs} +2 -2
- package/components/chunks/{MazBtn-CS2F1-mC.mjs → MazBtn-pLRsSxug.mjs} +2 -2
- package/components/chunks/{MazCheckbox-BTM3Xpxz.mjs → MazCheckbox-CXVe5vda.mjs} +30 -23
- package/components/chunks/{MazCheckbox-COTppi08.mjs → MazCheckbox-DBlQwP82.mjs} +30 -23
- package/components/chunks/{MazIcon-Bspx_Ojq.mjs → MazIcon-BTsi1M-S.mjs} +1 -1
- package/components/chunks/{MazInput-C1r0b8BB.mjs → MazInput-Caas-0Nk.mjs} +19 -17
- package/components/chunks/{MazInputNumber-DJWxTvJ0.mjs → MazInputNumber-CnoCQQzg.mjs} +85 -81
- package/components/chunks/{MazInputPrice-CmX_rC0L.mjs → MazInputPrice---5nCUKm.mjs} +57 -53
- package/components/chunks/{MazInputTags-pm_5HtHM.mjs → MazInputTags-CipoVBP2.mjs} +83 -79
- package/components/chunks/{MazPhoneNumberInput-CVz5eTvG.mjs → MazPhoneNumberInput-CsX6Kqob.mjs} +402 -395
- package/components/chunks/{MazPicker-DP1zd8tt.mjs → MazPicker-CfhI75aw.mjs} +67 -62
- package/components/chunks/{MazPickerCalendar-qjcDNw86.mjs → MazPickerCalendar-DnkNE-Am.mjs} +3 -3
- package/components/chunks/{MazPickerHeader-CozeYkFf.mjs → MazPickerHeader-Vt86yzXS.mjs} +1 -1
- package/components/chunks/{MazPickerMonthSwitcher-aaUELZpE.mjs → MazPickerMonthSwitcher-zfKhsjW1.mjs} +2 -2
- package/components/chunks/{MazPickerShortcuts-ppox8lXf.mjs → MazPickerShortcuts-DUIKfOO8.mjs} +2 -2
- package/components/chunks/{MazPickerTime-DmpypIWr.mjs → MazPickerTime-B2znRxr2.mjs} +2 -2
- package/components/chunks/{MazPickerYearSwitcher-BNBvipzs.mjs → MazPickerYearSwitcher-CB339kof.mjs} +3 -3
- package/components/chunks/{MazSelect-DGEof7R3.mjs → MazSelect-DZeXglR8.mjs} +117 -109
- package/components/chunks/{MazSpinner-CTdeHHNH.mjs → MazSpinner-BAhgxOgg.mjs} +1 -1
- package/components/chunks/{MazSpinner-DmFFdtxB.mjs → MazSpinner-CJaSrYbQ.mjs} +1 -1
- package/components/chunks/{MazSpinner-KKcK5-QF.mjs → MazSpinner-CORsBFCP.mjs} +1 -1
- package/components/chunks/{MazSpinner-DTZHIIMh.mjs → MazSpinner-CVBVegaS.mjs} +1 -1
- package/components/chunks/MazSpinner-CkdjTE0y.mjs +38 -0
- package/components/chunks/{MazSpinner-DZTqt2Yn.mjs → MazSpinner-DECa8Pby.mjs} +1 -1
- package/components/chunks/{MazSpinner-DUVEeU4h.mjs → MazSpinner-Dq4o-_GM.mjs} +1 -1
- package/components/chunks/{MazSpinner-CiPbsWOG.mjs → MazSpinner-DqXjnLKa.mjs} +1 -1
- package/components/chunks/{MazTable-BhDfeDU1.mjs → MazTable-DrFqDO-J.mjs} +214 -199
- package/nuxt/index.json +1 -1
- package/package.json +1 -1
- package/types/components/MazCheckbox.vue.d.ts +4 -0
- package/types/components/MazInput.vue.d.ts +2 -0
- package/types/components/MazInputNumber.vue.d.ts +2 -0
- package/types/components/MazInputPrice.vue.d.ts +8 -0
- package/types/components/MazInputTags.vue.d.ts +2 -0
- package/types/components/MazPhoneNumberInput.vue.d.ts +2 -0
- package/types/components/MazPicker.vue.d.ts +2 -0
- package/types/components/MazRadio.vue.d.ts +9 -0
- package/types/components/MazSelect.vue.d.ts +2 -0
- package/components/chunks/MazBtn-OUDBhJKd.mjs +0 -151
- package/components/chunks/MazSpinner-yPD_Biya.mjs +0 -38
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as b, ref as f, computed as g, onMounted as P, watchEffect as _, openBlock as p, createElementBlock as h, Fragment as A, createCommentVNode as s, mergeProps as C, nextTick as $ } from "vue";
|
|
2
|
-
import { i as q } from "./MazTable-
|
|
2
|
+
import { i as q } from "./MazTable-DrFqDO-J.mjs";
|
|
3
3
|
const H = ["innerHTML"], G = /* @__PURE__ */ b({
|
|
4
4
|
__name: "MazIcon",
|
|
5
5
|
props: {
|
|
@@ -2,9 +2,9 @@ import '../assets/MazInput.css';
|
|
|
2
2
|
import { getCurrentInstance as J, computed as r, defineComponent as K, defineAsyncComponent as m, ref as k, onMounted as Q, useSlots as W, openBlock as n, createElementBlock as v, normalizeClass as I, normalizeStyle as X, createElementVNode as B, createCommentVNode as o, renderSlot as w, createBlock as d, unref as s, resolveDynamicComponent as V, withDirectives as Y, mergeProps as Z, toHandlers as x, vModelDynamic as _, createTextVNode as ee, toDisplayString as te, withModifiers as oe, withCtx as M, createVNode as S } from "vue";
|
|
3
3
|
function ae(i, u) {
|
|
4
4
|
let a;
|
|
5
|
-
return function(...
|
|
5
|
+
return function(...c) {
|
|
6
6
|
clearTimeout(a), a = setTimeout(() => {
|
|
7
|
-
i.apply(this,
|
|
7
|
+
i.apply(this, c);
|
|
8
8
|
}, u);
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -53,11 +53,12 @@ const ne = ({
|
|
|
53
53
|
borderActive: { type: Boolean, default: !1 },
|
|
54
54
|
leftIcon: { default: void 0 },
|
|
55
55
|
rightIcon: { default: void 0 },
|
|
56
|
-
roundedSize: { default: void 0 }
|
|
56
|
+
roundedSize: { default: void 0 },
|
|
57
|
+
block: { type: Boolean }
|
|
57
58
|
},
|
|
58
59
|
emits: ["update:model-value", "focus", "blur", "click", "change"],
|
|
59
60
|
setup(i, { emit: u }) {
|
|
60
|
-
const a = m(() => import("./MazBtn-
|
|
61
|
+
const a = m(() => import("./MazBtn-pLRsSxug.mjs")), c = m(() => import("./MazIcon-Cxrv3_OK.mjs")), z = m(() => import("./eye-slash-tjfxO0LK.mjs")), q = m(() => import("./eye-DqO_Jx56.mjs")), N = m(() => import("./check-CL-vqe79.mjs")), t = i, y = u, b = k(!1), f = k(!1), $ = k(), T = ne({
|
|
61
62
|
componentName: "MazInput",
|
|
62
63
|
providedId: t.id
|
|
63
64
|
});
|
|
@@ -73,7 +74,7 @@ const ne = ({
|
|
|
73
74
|
return "maz-border-success";
|
|
74
75
|
if (t.warning)
|
|
75
76
|
return "maz-border-warning";
|
|
76
|
-
if (
|
|
77
|
+
if (f.value || t.borderActive) {
|
|
77
78
|
if (t.color === "black")
|
|
78
79
|
return "maz-border-black";
|
|
79
80
|
if (t.color === "danger")
|
|
@@ -109,7 +110,7 @@ const ne = ({
|
|
|
109
110
|
return L(e);
|
|
110
111
|
y("update:model-value", e);
|
|
111
112
|
}
|
|
112
|
-
}), R = r(() => (!!t.label || !!t.hint) && (
|
|
113
|
+
}), R = r(() => (!!t.label || !!t.hint) && (f.value || !!E.value || !!t.placeholder || ["date", "month", "week"].includes(t.type))), F = r(() => !!t.label || !!t.hint);
|
|
113
114
|
function U() {
|
|
114
115
|
return !!g["right-icon"] || C.value || !!g["valid-button"] || t.validButton || !!t.rightIcon;
|
|
115
116
|
}
|
|
@@ -117,10 +118,10 @@ const ne = ({
|
|
|
117
118
|
return !!g["left-icon"] || !!t.leftIcon;
|
|
118
119
|
}
|
|
119
120
|
function H(e) {
|
|
120
|
-
y("focus", e),
|
|
121
|
+
y("focus", e), f.value = !0;
|
|
121
122
|
}
|
|
122
123
|
function j(e) {
|
|
123
|
-
y("blur", e),
|
|
124
|
+
y("blur", e), f.value = !1;
|
|
124
125
|
}
|
|
125
126
|
function G(e) {
|
|
126
127
|
return y("change", e);
|
|
@@ -130,13 +131,14 @@ const ne = ({
|
|
|
130
131
|
{
|
|
131
132
|
class: I(["m-input", [
|
|
132
133
|
{
|
|
133
|
-
"--is-focused":
|
|
134
|
+
"--is-focused": f.value || e.borderActive,
|
|
134
135
|
"--should-up": R.value,
|
|
135
136
|
"--has-label": F.value,
|
|
136
137
|
"--is-disabled": e.disabled,
|
|
137
138
|
"--is-readonly": e.readonly,
|
|
138
139
|
"--has-z-2": e.error || e.warning || e.success,
|
|
139
|
-
"--has-state": e.error || e.warning || e.success
|
|
140
|
+
"--has-state": e.error || e.warning || e.success,
|
|
141
|
+
"--block": e.block
|
|
140
142
|
},
|
|
141
143
|
t.class,
|
|
142
144
|
`--${e.color}`,
|
|
@@ -160,7 +162,7 @@ const ne = ({
|
|
|
160
162
|
@slot left-icon - The icon to display on the left of the input
|
|
161
163
|
`),
|
|
162
164
|
e.$slots["left-icon"] || e.leftIcon ? w(e.$slots, "left-icon", { key: 0 }, () => [
|
|
163
|
-
typeof e.leftIcon == "string" ? (n(), d(s(
|
|
165
|
+
typeof e.leftIcon == "string" ? (n(), d(s(c), {
|
|
164
166
|
key: 0,
|
|
165
167
|
name: e.leftIcon,
|
|
166
168
|
class: "maz-text-xl maz-text-muted"
|
|
@@ -225,7 +227,7 @@ const ne = ({
|
|
|
225
227
|
@slot right-icon - The icon to display on the right of the input
|
|
226
228
|
`),
|
|
227
229
|
e.$slots["right-icon"] || e.rightIcon ? w(e.$slots, "right-icon", { key: 0 }, () => [
|
|
228
|
-
typeof e.rightIcon == "string" ? (n(), d(s(
|
|
230
|
+
typeof e.rightIcon == "string" ? (n(), d(s(c), {
|
|
229
231
|
key: 0,
|
|
230
232
|
name: e.rightIcon,
|
|
231
233
|
class: "maz-text-xl maz-text-muted"
|
|
@@ -283,13 +285,13 @@ const ne = ({
|
|
|
283
285
|
/* CLASS, STYLE */
|
|
284
286
|
));
|
|
285
287
|
}
|
|
286
|
-
}),
|
|
288
|
+
}), ce = (i, u) => {
|
|
287
289
|
const a = i.__vccOpts || i;
|
|
288
|
-
for (const [
|
|
289
|
-
a[
|
|
290
|
+
for (const [c, z] of u)
|
|
291
|
+
a[c] = z;
|
|
290
292
|
return a;
|
|
291
|
-
}, me = /* @__PURE__ */
|
|
293
|
+
}, me = /* @__PURE__ */ ce(de, [["__scopeId", "data-v-78090be8"]]);
|
|
292
294
|
export {
|
|
293
295
|
me as M,
|
|
294
|
-
|
|
296
|
+
ce as _
|
|
295
297
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../assets/MazInputNumber.css';
|
|
2
|
-
import { defineComponent as R, defineAsyncComponent as C, useAttrs as ee, useSlots as j, onBeforeMount as
|
|
2
|
+
import { defineComponent as R, defineAsyncComponent as C, useAttrs as ee, useSlots as j, onBeforeMount as ne, computed as s, openBlock as a, createBlock as m, resolveDynamicComponent as V, normalizeClass as B, withCtx as D, createElementBlock as b, createCommentVNode as i, renderSlot as M, unref as f, getCurrentInstance as te, ref as A, onMounted as oe, normalizeStyle as K, createElementVNode as S, withDirectives as le, mergeProps as Y, toHandlers as ae, vModelDynamic as ie, createTextVNode as se, toDisplayString as re, withModifiers as L, createVNode as P, withKeys as O } from "vue";
|
|
3
3
|
const ue = /* @__PURE__ */ R({
|
|
4
4
|
__name: "MazBtn",
|
|
5
5
|
props: {
|
|
@@ -25,15 +25,15 @@ const ue = /* @__PURE__ */ R({
|
|
|
25
25
|
contentClass: { default: void 0 }
|
|
26
26
|
},
|
|
27
27
|
setup(p) {
|
|
28
|
-
const v = C(() => import("./MazSpinner-
|
|
29
|
-
|
|
28
|
+
const v = C(() => import("./MazSpinner-Dq4o-_GM.mjs")), t = C(() => import("./MazIcon-Cxrv3_OK.mjs")), { href: h, to: u } = ee(), $ = j(), r = p;
|
|
29
|
+
ne(() => {
|
|
30
30
|
r.icon && !r.fab && console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
|
|
31
31
|
});
|
|
32
32
|
const o = s(() => h ? "a" : u ? "router-link" : "button"), g = s(
|
|
33
33
|
() => r.pastel ? `--${r.color}-pastel` : r.outline ? `--${r.color}-outline` : `--${r.color}`
|
|
34
34
|
), y = s(
|
|
35
35
|
() => (r.loading || r.disabled) && o.value === "button"
|
|
36
|
-
), z = s(() => y.value ? "--cursor-default" : "--cursor-pointer"), w = s(() => `--is-${r.variant}`), k = s(() => r.loading && r.variant === "button"),
|
|
36
|
+
), z = s(() => y.value ? "--cursor-default" : "--cursor-pointer"), w = s(() => `--is-${r.variant}`), k = s(() => r.loading && r.variant === "button"), n = s(() => !!$["left-icon"] || r.leftIcon), d = s(() => !!$["right-icon"] || r.rightIcon), c = s(() => n.value || d.value), N = s(() => r.fab && (r.icon || !!$.icon)), F = s(() => o.value === "button" ? r.type : void 0);
|
|
37
37
|
return (l, U) => (a(), m(V(o.value), {
|
|
38
38
|
disabled: y.value,
|
|
39
39
|
class: B(["m-btn", [
|
|
@@ -48,7 +48,7 @@ const ue = /* @__PURE__ */ R({
|
|
|
48
48
|
"--fab": l.fab,
|
|
49
49
|
"--loading": l.loading,
|
|
50
50
|
"--disabled": y.value,
|
|
51
|
-
"--icon":
|
|
51
|
+
"--icon": c.value,
|
|
52
52
|
"--rounded": l.rounded,
|
|
53
53
|
"--no-rounded": l.noRounded,
|
|
54
54
|
"--no-padding": l.noPadding,
|
|
@@ -58,7 +58,7 @@ const ue = /* @__PURE__ */ R({
|
|
|
58
58
|
type: F.value
|
|
59
59
|
}, {
|
|
60
60
|
default: D(() => [
|
|
61
|
-
|
|
61
|
+
n.value ? (a(), b(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
key: 0,
|
|
@@ -69,7 +69,7 @@ const ue = /* @__PURE__ */ R({
|
|
|
69
69
|
@slot left-icon - The icon to display on the left of the button
|
|
70
70
|
`),
|
|
71
71
|
M(l.$slots, "left-icon", {}, () => [
|
|
72
|
-
typeof l.leftIcon == "string" ? (a(), m(
|
|
72
|
+
typeof l.leftIcon == "string" ? (a(), m(f(t), {
|
|
73
73
|
key: 0,
|
|
74
74
|
name: l.leftIcon
|
|
75
75
|
}, null, 8, ["name"])) : l.leftIcon ? (a(), m(V(l.leftIcon), { key: 1 })) : i("v-if", !0)
|
|
@@ -89,7 +89,7 @@ const ue = /* @__PURE__ */ R({
|
|
|
89
89
|
@slot icon - The icon to display on the fab button
|
|
90
90
|
`),
|
|
91
91
|
M(l.$slots, "icon", {}, () => [
|
|
92
|
-
typeof l.icon == "string" ? (a(), m(
|
|
92
|
+
typeof l.icon == "string" ? (a(), m(f(t), {
|
|
93
93
|
key: 0,
|
|
94
94
|
name: l.icon
|
|
95
95
|
}, null, 8, ["name"])) : l.icon ? (a(), m(V(l.icon), { key: 1 })) : i("v-if", !0)
|
|
@@ -124,7 +124,7 @@ const ue = /* @__PURE__ */ R({
|
|
|
124
124
|
@slot right-icon - The icon to display on the right of the button
|
|
125
125
|
`),
|
|
126
126
|
M(l.$slots, "right-icon", {}, () => [
|
|
127
|
-
typeof l.rightIcon == "string" ? (a(), m(
|
|
127
|
+
typeof l.rightIcon == "string" ? (a(), m(f(t), {
|
|
128
128
|
key: 0,
|
|
129
129
|
name: l.rightIcon
|
|
130
130
|
}, null, 8, ["name"])) : l.rightIcon ? (a(), m(V(l.rightIcon), { key: 1 })) : i("v-if", !0)
|
|
@@ -133,7 +133,7 @@ const ue = /* @__PURE__ */ R({
|
|
|
133
133
|
2
|
|
134
134
|
/* CLASS */
|
|
135
135
|
)) : i("v-if", !0),
|
|
136
|
-
k.value ? (a(), m(
|
|
136
|
+
k.value ? (a(), m(f(v), {
|
|
137
137
|
key: 4,
|
|
138
138
|
class: "m-btn-loader",
|
|
139
139
|
size: "2em",
|
|
@@ -145,18 +145,18 @@ const ue = /* @__PURE__ */ R({
|
|
|
145
145
|
}, 8, ["disabled", "class", "type"]));
|
|
146
146
|
}
|
|
147
147
|
}), G = (p, v) => {
|
|
148
|
-
const
|
|
148
|
+
const t = p.__vccOpts || p;
|
|
149
149
|
for (const [h, u] of v)
|
|
150
|
-
|
|
151
|
-
return
|
|
150
|
+
t[h] = u;
|
|
151
|
+
return t;
|
|
152
152
|
}, q = /* @__PURE__ */ G(ue, [["__scopeId", "data-v-395e94fc"]]), de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
153
153
|
__proto__: null,
|
|
154
154
|
default: q
|
|
155
155
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
156
156
|
function H(p, v) {
|
|
157
|
-
let
|
|
157
|
+
let t;
|
|
158
158
|
return function(...h) {
|
|
159
|
-
clearTimeout(
|
|
159
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
160
160
|
p.apply(this, h);
|
|
161
161
|
}, v);
|
|
162
162
|
};
|
|
@@ -165,12 +165,12 @@ const me = ({
|
|
|
165
165
|
componentName: p,
|
|
166
166
|
providedId: v
|
|
167
167
|
}) => {
|
|
168
|
-
const
|
|
169
|
-
return s(() => v ?? `${p}-${
|
|
170
|
-
},
|
|
168
|
+
const t = te();
|
|
169
|
+
return s(() => v ?? `${p}-${t == null ? void 0 : t.uid}`);
|
|
170
|
+
}, ce = {
|
|
171
171
|
key: 0,
|
|
172
172
|
class: "m-input-wrapper-left"
|
|
173
|
-
},
|
|
173
|
+
}, fe = { class: "m-input-wrapper-input" }, pe = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"], ve = { key: 0 }, be = {
|
|
174
174
|
key: 1,
|
|
175
175
|
class: "m-input-wrapper-right"
|
|
176
176
|
}, ye = /* @__PURE__ */ R({
|
|
@@ -206,11 +206,12 @@ const me = ({
|
|
|
206
206
|
borderActive: { type: Boolean, default: !1 },
|
|
207
207
|
leftIcon: { default: void 0 },
|
|
208
208
|
rightIcon: { default: void 0 },
|
|
209
|
-
roundedSize: { default: void 0 }
|
|
209
|
+
roundedSize: { default: void 0 },
|
|
210
|
+
block: { type: Boolean }
|
|
210
211
|
},
|
|
211
212
|
emits: ["update:model-value", "focus", "blur", "click", "change"],
|
|
212
213
|
setup(p, { emit: v }) {
|
|
213
|
-
const
|
|
214
|
+
const t = C(() => Promise.resolve().then(() => de)), h = C(() => import("./MazIcon-Cxrv3_OK.mjs")), u = C(() => import("./eye-slash-tjfxO0LK.mjs")), $ = C(() => import("./eye-DqO_Jx56.mjs")), r = C(() => import("./check-CL-vqe79.mjs")), o = p, g = v, y = A(!1), z = A(!1), w = A(), k = me({
|
|
214
215
|
componentName: "MazInput",
|
|
215
216
|
providedId: o.id
|
|
216
217
|
});
|
|
@@ -218,7 +219,7 @@ const me = ({
|
|
|
218
219
|
var e;
|
|
219
220
|
o.autoFocus && ((e = w.value) == null || e.focus());
|
|
220
221
|
});
|
|
221
|
-
const
|
|
222
|
+
const n = s(() => o.type === "password"), d = s(() => y.value ? "text" : o.type), c = s(() => {
|
|
222
223
|
if (!o.noBorder) {
|
|
223
224
|
if (o.error)
|
|
224
225
|
return "maz-border-danger";
|
|
@@ -264,7 +265,7 @@ const me = ({
|
|
|
264
265
|
}
|
|
265
266
|
}), J = s(() => (!!o.label || !!o.hint) && (z.value || !!l.value || !!o.placeholder || ["date", "month", "week"].includes(o.type))), Q = s(() => !!o.label || !!o.hint);
|
|
266
267
|
function W() {
|
|
267
|
-
return !!N["right-icon"] ||
|
|
268
|
+
return !!N["right-icon"] || n.value || !!N["valid-button"] || o.validButton || !!o.rightIcon;
|
|
268
269
|
}
|
|
269
270
|
function X() {
|
|
270
271
|
return !!N["left-icon"] || !!o.leftIcon;
|
|
@@ -289,7 +290,8 @@ const me = ({
|
|
|
289
290
|
"--is-disabled": e.disabled,
|
|
290
291
|
"--is-readonly": e.readonly,
|
|
291
292
|
"--has-z-2": e.error || e.warning || e.success,
|
|
292
|
-
"--has-state": e.error || e.warning || e.success
|
|
293
|
+
"--has-state": e.error || e.warning || e.success,
|
|
294
|
+
"--block": e.block
|
|
293
295
|
},
|
|
294
296
|
o.class,
|
|
295
297
|
`--${e.color}`,
|
|
@@ -303,17 +305,17 @@ const me = ({
|
|
|
303
305
|
{
|
|
304
306
|
class: B(["m-input-wrapper", [
|
|
305
307
|
e.inputClasses,
|
|
306
|
-
|
|
308
|
+
c.value,
|
|
307
309
|
e.roundedSize ? `--rounded-${e.roundedSize}` : { "maz-rounded": !e.noRadius }
|
|
308
310
|
]])
|
|
309
311
|
},
|
|
310
312
|
[
|
|
311
|
-
X() ? (a(), b("div",
|
|
313
|
+
X() ? (a(), b("div", ce, [
|
|
312
314
|
i(`
|
|
313
315
|
@slot left-icon - The icon to display on the left of the input
|
|
314
316
|
`),
|
|
315
317
|
e.$slots["left-icon"] || e.leftIcon ? M(e.$slots, "left-icon", { key: 0 }, () => [
|
|
316
|
-
typeof e.leftIcon == "string" ? (a(), m(
|
|
318
|
+
typeof e.leftIcon == "string" ? (a(), m(f(h), {
|
|
317
319
|
key: 0,
|
|
318
320
|
name: e.leftIcon,
|
|
319
321
|
class: "maz-text-xl maz-text-muted"
|
|
@@ -323,9 +325,9 @@ const me = ({
|
|
|
323
325
|
})) : i("v-if", !0)
|
|
324
326
|
], !0) : i("v-if", !0)
|
|
325
327
|
])) : i("v-if", !0),
|
|
326
|
-
S("div",
|
|
328
|
+
S("div", fe, [
|
|
327
329
|
le(S("input", Y({
|
|
328
|
-
id:
|
|
330
|
+
id: f(k),
|
|
329
331
|
ref_key: "input",
|
|
330
332
|
ref: w,
|
|
331
333
|
"onUpdate:modelValue": I[0] || (I[0] = (E) => T.value = E),
|
|
@@ -378,7 +380,7 @@ const me = ({
|
|
|
378
380
|
@slot right-icon - The icon to display on the right of the input
|
|
379
381
|
`),
|
|
380
382
|
e.$slots["right-icon"] || e.rightIcon ? M(e.$slots, "right-icon", { key: 0 }, () => [
|
|
381
|
-
typeof e.rightIcon == "string" ? (a(), m(
|
|
383
|
+
typeof e.rightIcon == "string" ? (a(), m(f(h), {
|
|
382
384
|
key: 0,
|
|
383
385
|
name: e.rightIcon,
|
|
384
386
|
class: "maz-text-xl maz-text-muted"
|
|
@@ -387,7 +389,7 @@ const me = ({
|
|
|
387
389
|
class: "maz-text-xl maz-text-muted"
|
|
388
390
|
})) : i("v-if", !0)
|
|
389
391
|
], !0) : i("v-if", !0),
|
|
390
|
-
|
|
392
|
+
n.value ? (a(), m(f(t), {
|
|
391
393
|
key: 1,
|
|
392
394
|
color: "transparent",
|
|
393
395
|
tabindex: "-1",
|
|
@@ -395,10 +397,10 @@ const me = ({
|
|
|
395
397
|
onClick: I[2] || (I[2] = L((E) => y.value = !y.value, ["stop"]))
|
|
396
398
|
}, {
|
|
397
399
|
default: D(() => [
|
|
398
|
-
y.value ? (a(), m(
|
|
400
|
+
y.value ? (a(), m(f(u), {
|
|
399
401
|
key: 0,
|
|
400
402
|
class: "maz-text-xl maz-text-muted"
|
|
401
|
-
})) : (a(), m(
|
|
403
|
+
})) : (a(), m(f($), {
|
|
402
404
|
key: 1,
|
|
403
405
|
class: "maz-text-xl maz-text-muted"
|
|
404
406
|
}))
|
|
@@ -410,7 +412,7 @@ const me = ({
|
|
|
410
412
|
@slot valid-button - Replace the valid button by your own
|
|
411
413
|
`),
|
|
412
414
|
e.$slots["valid-button"] || e.validButton ? M(e.$slots, "valid-button", { key: 2 }, () => [
|
|
413
|
-
P(
|
|
415
|
+
P(f(t), {
|
|
414
416
|
color: "transparent",
|
|
415
417
|
disabled: e.disabled,
|
|
416
418
|
tabindex: "-1",
|
|
@@ -420,7 +422,7 @@ const me = ({
|
|
|
420
422
|
type: "submit"
|
|
421
423
|
}, {
|
|
422
424
|
default: D(() => [
|
|
423
|
-
P(
|
|
425
|
+
P(f(r), { class: "maz-text-2xl maz-text-normal" })
|
|
424
426
|
]),
|
|
425
427
|
_: 1
|
|
426
428
|
/* STABLE */
|
|
@@ -436,7 +438,7 @@ const me = ({
|
|
|
436
438
|
/* CLASS, STYLE */
|
|
437
439
|
));
|
|
438
440
|
}
|
|
439
|
-
}), he = /* @__PURE__ */ G(ye, [["__scopeId", "data-v-
|
|
441
|
+
}), he = /* @__PURE__ */ G(ye, [["__scopeId", "data-v-78090be8"]]), ge = {
|
|
440
442
|
xmlns: "http://www.w3.org/2000/svg",
|
|
441
443
|
width: "1em",
|
|
442
444
|
height: "1em",
|
|
@@ -498,59 +500,60 @@ const Ve = { render: Me }, Se = /* @__PURE__ */ R({
|
|
|
498
500
|
size: { default: "md" },
|
|
499
501
|
noButtons: { type: Boolean, default: !1 },
|
|
500
502
|
textCenter: { type: Boolean, default: !0 },
|
|
501
|
-
inputmode: { default: "numeric" }
|
|
503
|
+
inputmode: { default: "numeric" },
|
|
504
|
+
block: { type: Boolean }
|
|
502
505
|
},
|
|
503
506
|
emits: ["update:model-value", "focus", "blur", "click", "update", "change"],
|
|
504
507
|
setup(p, { emit: v }) {
|
|
505
|
-
const
|
|
506
|
-
get: () =>
|
|
507
|
-
set: (
|
|
508
|
+
const t = p, h = v, u = s({
|
|
509
|
+
get: () => t.modelValue,
|
|
510
|
+
set: (n) => g(n)
|
|
508
511
|
});
|
|
509
|
-
function $(
|
|
510
|
-
return Math.round(
|
|
512
|
+
function $(n) {
|
|
513
|
+
return Math.round(n / t.step) * t.step;
|
|
511
514
|
}
|
|
512
|
-
const r = (
|
|
513
|
-
if (typeof
|
|
514
|
-
return
|
|
515
|
-
}, o = H((
|
|
516
|
-
|
|
515
|
+
const r = (n) => {
|
|
516
|
+
if (typeof n == "number")
|
|
517
|
+
return n <= t.min ? t.min : n >= t.max ? t.max : $(n);
|
|
518
|
+
}, o = H((n) => g(n), 300), g = (n) => {
|
|
519
|
+
n = r(n), u.value !== n && h("update:model-value", n);
|
|
517
520
|
};
|
|
518
521
|
g(u.value);
|
|
519
|
-
const y = s(() =>
|
|
520
|
-
if (!(
|
|
521
|
-
if ((u.value === void 0 || u.value === null) && Number.isFinite(
|
|
522
|
-
u.value =
|
|
522
|
+
const y = s(() => t.modelValue && t.modelValue >= t.max), z = s(() => t.modelValue && t.modelValue <= t.min), w = () => {
|
|
523
|
+
if (!(t.disabled || y.value)) {
|
|
524
|
+
if ((u.value === void 0 || u.value === null) && Number.isFinite(t.min)) {
|
|
525
|
+
u.value = t.min;
|
|
523
526
|
return;
|
|
524
527
|
}
|
|
525
|
-
u.value = (u.value ?? 0) + 1 *
|
|
528
|
+
u.value = (u.value ?? 0) + 1 * t.step;
|
|
526
529
|
}
|
|
527
530
|
}, k = () => {
|
|
528
|
-
if (!(
|
|
529
|
-
if ((u.value === void 0 || u.value === null) && Number.isFinite(
|
|
530
|
-
u.value =
|
|
531
|
+
if (!(t.disabled || z.value)) {
|
|
532
|
+
if ((u.value === void 0 || u.value === null) && Number.isFinite(t.min)) {
|
|
533
|
+
u.value = t.min;
|
|
531
534
|
return;
|
|
532
535
|
}
|
|
533
|
-
u.value = (u.value ?? 0) - 1 *
|
|
536
|
+
u.value = (u.value ?? 0) - 1 * t.step;
|
|
534
537
|
}
|
|
535
538
|
};
|
|
536
|
-
return (
|
|
539
|
+
return (n, d) => (a(), b(
|
|
537
540
|
"div",
|
|
538
541
|
{
|
|
539
|
-
class: B(["m-input-number maz-align-center", [`m-input-number--${
|
|
540
|
-
style: K(
|
|
542
|
+
class: B(["m-input-number maz-align-center", [`m-input-number--${n.size}`, t.class, { "--block": n.block }]]),
|
|
543
|
+
style: K(n.style)
|
|
541
544
|
},
|
|
542
545
|
[
|
|
543
|
-
|
|
546
|
+
n.noButtons ? i("v-if", !0) : (a(), m(q, {
|
|
544
547
|
key: 0,
|
|
545
548
|
color: "transparent",
|
|
546
|
-
size:
|
|
549
|
+
size: n.size,
|
|
547
550
|
tabindex: "-1",
|
|
548
551
|
class: "m-input-number__button m-input-number__decrement-button",
|
|
549
|
-
disabled: z.value ||
|
|
552
|
+
disabled: z.value || n.disabled,
|
|
550
553
|
onClick: k
|
|
551
554
|
}, {
|
|
552
555
|
default: D(() => [
|
|
553
|
-
P(
|
|
556
|
+
P(f(Ve), { class: "m-input-number__button__icon" })
|
|
554
557
|
]),
|
|
555
558
|
_: 1
|
|
556
559
|
/* STABLE */
|
|
@@ -558,37 +561,38 @@ const Ve = { render: Me }, Se = /* @__PURE__ */ R({
|
|
|
558
561
|
P(he, Y({
|
|
559
562
|
"model-value": u.value,
|
|
560
563
|
type: "number",
|
|
561
|
-
class: ["m-input-number__input maz-flex-1", { "--no-buttons":
|
|
562
|
-
disabled:
|
|
563
|
-
min:
|
|
564
|
-
max:
|
|
565
|
-
step:
|
|
566
|
-
},
|
|
567
|
-
inputmode:
|
|
568
|
-
size:
|
|
564
|
+
class: ["m-input-number__input maz-flex-1", { "--no-buttons": n.noButtons, "--text-center": n.textCenter }],
|
|
565
|
+
disabled: n.disabled,
|
|
566
|
+
min: n.min,
|
|
567
|
+
max: n.max,
|
|
568
|
+
step: n.step
|
|
569
|
+
}, n.$attrs, {
|
|
570
|
+
inputmode: n.inputmode,
|
|
571
|
+
size: n.size,
|
|
572
|
+
block: "",
|
|
569
573
|
onKeydown: [
|
|
570
574
|
O(L(w, ["prevent"]), ["up"]),
|
|
571
575
|
O(L(k, ["prevent"]), ["down"])
|
|
572
576
|
],
|
|
573
|
-
onFocus: d[0] || (d[0] = (
|
|
574
|
-
onChange: d[1] || (d[1] = (
|
|
575
|
-
onBlur: d[2] || (d[2] = (
|
|
576
|
-
onClick: d[3] || (d[3] = (
|
|
577
|
-
onUpdate: d[4] || (d[4] = (
|
|
578
|
-
"onUpdate:modelValue": d[5] || (d[5] = (
|
|
577
|
+
onFocus: d[0] || (d[0] = (c) => n.$emit("focus", c)),
|
|
578
|
+
onChange: d[1] || (d[1] = (c) => n.$emit("change", c)),
|
|
579
|
+
onBlur: d[2] || (d[2] = (c) => n.$emit("blur", c)),
|
|
580
|
+
onClick: d[3] || (d[3] = (c) => n.$emit("click", c)),
|
|
581
|
+
onUpdate: d[4] || (d[4] = (c) => n.$emit("update", c)),
|
|
582
|
+
"onUpdate:modelValue": d[5] || (d[5] = (c) => f(o)(c))
|
|
579
583
|
}), null, 16, ["model-value", "class", "disabled", "min", "max", "step", "inputmode", "size", "onKeydown"]),
|
|
580
|
-
|
|
584
|
+
n.noButtons ? i("v-if", !0) : (a(), m(q, {
|
|
581
585
|
key: 1,
|
|
582
586
|
color: "transparent",
|
|
583
587
|
"no-shadow": "",
|
|
584
588
|
tabindex: "-1",
|
|
585
|
-
size:
|
|
589
|
+
size: n.size,
|
|
586
590
|
class: "m-input-number__button m-input-number__increment-button",
|
|
587
|
-
disabled: y.value ||
|
|
591
|
+
disabled: y.value || n.disabled,
|
|
588
592
|
onClick: w
|
|
589
593
|
}, {
|
|
590
594
|
default: D(() => [
|
|
591
|
-
P(
|
|
595
|
+
P(f(Be), { class: "m-input-number__button__icon" })
|
|
592
596
|
]),
|
|
593
597
|
_: 1
|
|
594
598
|
/* STABLE */
|