maz-ui 3.29.1 → 3.29.3

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.
@@ -1,19 +1,19 @@
1
1
  import "./assets/MazDropdown.css";
2
- import { computed as K, defineComponent as P, defineAsyncComponent as M, getCurrentInstance as G, ref as B, watch as E, openBlock as f, createElementBlock as v, unref as u, normalizeClass as b, normalizeStyle as J, createElementVNode as k, withModifiers as A, createCommentVNode as d, toDisplayString as $, renderSlot as y, createVNode as O, mergeProps as Q, withCtx as h, createBlock as I, Transition as W, Fragment as L, renderList as X, resolveDynamicComponent as Y, createTextVNode as Z } from "vue";
3
- const x = ({
4
- componentName: m,
2
+ import { computed as K, defineComponent as P, defineAsyncComponent as M, getCurrentInstance as G, ref as B, watch as E, openBlock as p, createElementBlock as k, unref as u, normalizeClass as v, normalizeStyle as J, createElementVNode as b, withModifiers as A, createCommentVNode as c, toDisplayString as $, renderSlot as w, createVNode as O, mergeProps as Q, withCtx as h, createBlock as I, Transition as W, withDirectives as X, Fragment as S, renderList as Y, resolveDynamicComponent as Z, createTextVNode as x, vShow as _ } from "vue";
3
+ const ee = ({
4
+ componentName: f,
5
5
  instance: i,
6
- providedId: c
7
- }) => K(() => c ?? `${m}-${i == null ? void 0 : i.uid}`);
8
- function _(m, i) {
9
- let c;
10
- return function(...w) {
11
- clearTimeout(c), c = setTimeout(() => {
12
- m.apply(this, w);
6
+ providedId: d
7
+ }) => K(() => d ?? `${f}-${i == null ? void 0 : i.uid}`);
8
+ function oe(f, i) {
9
+ let d;
10
+ return function(...y) {
11
+ clearTimeout(d), d = setTimeout(() => {
12
+ f.apply(this, y);
13
13
  }, i);
14
14
  };
15
15
  }
16
- const ee = ["id"], oe = ["aria-expanded", "onClick"], ne = { class: "maz-sr-only" }, te = { class: "maz-flex maz-items-center maz-gap-2" }, se = /* @__PURE__ */ P({
16
+ const ne = ["id"], te = ["aria-expanded", "onClick"], le = { class: "maz-sr-only" }, re = { class: "maz-flex maz-items-center maz-gap-2" }, ae = /* @__PURE__ */ P({
17
17
  inheritAttrs: !1,
18
18
  __name: "MazDropdown",
19
19
  props: {
@@ -42,17 +42,17 @@ const ee = ["id"], oe = ["aria-expanded", "onClick"], ne = { class: "maz-sr-only
42
42
  */
43
43
  "update:open"
44
44
  ],
45
- setup(m, { emit: i }) {
46
- const c = M(() => import("./chunks/MazBtn-1wfj_m47.mjs").then((e) => e.M)), w = M(() => import("./chunks/chevron-down-bC0s_0yH.mjs")), l = m, C = i, D = x({
45
+ setup(f, { emit: i }) {
46
+ const d = M(() => import("./chunks/MazBtn-1wfj_m47.mjs").then((e) => e.M)), y = M(() => import("./chunks/chevron-down-bC0s_0yH.mjs")), l = f, C = i, D = ee({
47
47
  componentName: "MazCheckbox",
48
48
  instance: G(),
49
49
  providedId: l.id
50
50
  }), r = B(l.open), t = B();
51
- function N() {
51
+ function L() {
52
52
  s(!r.value);
53
53
  }
54
- function S() {
55
- ["click"].includes(l.trigger) && N();
54
+ function N() {
55
+ ["click"].includes(l.trigger) && L();
56
56
  }
57
57
  function F() {
58
58
  ["hover", "both"].includes(l.trigger) && s(!0);
@@ -68,7 +68,7 @@ const ee = ["id"], oe = ["aria-expanded", "onClick"], ne = { class: "maz-sr-only
68
68
  }
69
69
  const s = (e) => {
70
70
  l.disabled || (r.value = e, C("update:open", e));
71
- }, a = _((e) => {
71
+ }, a = oe((e) => {
72
72
  s(e);
73
73
  }, 200);
74
74
  async function j(e, n) {
@@ -85,11 +85,11 @@ const ee = ["id"], oe = ["aria-expanded", "onClick"], ne = { class: "maz-sr-only
85
85
  ["ArrowDown", "ArrowUp", "Enter"].includes(e.key) && r.value === !1 && (e.preventDefault(), s(!0));
86
86
  }
87
87
  function H(e) {
88
- var p;
88
+ var m;
89
89
  e.preventDefault();
90
90
  const n = e.key;
91
91
  r.value || s(!0);
92
- const o = (p = l.items) == null ? void 0 : p.length;
92
+ const o = (m = l.items) == null ? void 0 : m.length;
93
93
  o && (typeof t.value == "number" ? t.value === o - 1 && n === "ArrowDown" ? t.value = 0 : t.value === 0 && n === "ArrowUp" ? t.value = o - 1 : t.value = n === "ArrowDown" ? t.value + 1 : t.value - 1 : t.value = n === "ArrowDown" ? 0 : o - 1);
94
94
  }
95
95
  return E(
@@ -100,66 +100,68 @@ const ee = ["id"], oe = ["aria-expanded", "onClick"], ne = { class: "maz-sr-only
100
100
  ), E(
101
101
  () => l.open,
102
102
  (e) => s(e)
103
- ), (e, n) => (f(), v("div", {
103
+ ), (e, n) => (p(), k("div", {
104
104
  id: u(D),
105
- class: b(["m-dropdown", [l.class]]),
105
+ class: v(["m-dropdown", [l.class]]),
106
106
  style: J(e.style)
107
107
  }, [
108
- k("div", {
108
+ b("div", {
109
109
  role: "button",
110
110
  tabindex: "0",
111
111
  class: "maz-h-full maz-w-full maz-outline-none",
112
112
  "aria-expanded": r.value,
113
113
  "aria-haspopup": "menu",
114
- onClick: A(S, ["stop"]),
114
+ onClick: A(N, ["stop"]),
115
115
  onFocus: F,
116
116
  onBlur: V,
117
117
  onKeydown: q,
118
118
  onMouseenter: T,
119
119
  onMouseleave: U
120
120
  }, [
121
- d(`
121
+ c(`
122
122
  @slot Custom Element
123
123
  @binding {Boolen} is-open close function
124
124
  @default \`<MazBtn />\`
125
125
  `),
126
- k(
126
+ b(
127
127
  "span",
128
- ne,
128
+ le,
129
129
  $(e.screenReaderDescription),
130
130
  1
131
131
  /* TEXT */
132
132
  ),
133
- y(e.$slots, "element", { isOpen: r.value }, () => [
134
- O(u(c), Q({
133
+ w(e.$slots, "element", { isOpen: r.value }, () => [
134
+ O(u(d), Q({
135
135
  color: e.color,
136
136
  disabled: e.disabled
137
137
  }, e.$attrs, { tabindex: "-1" }), {
138
138
  default: h(() => [
139
- k("span", te, [
140
- d(" @slot Button text "),
141
- y(e.$slots, "default"),
142
- e.noChevron ? d("v-if", !0) : (f(), I(u(w), {
139
+ b("span", re, [
140
+ c(" @slot Button text "),
141
+ w(e.$slots, "default"),
142
+ e.noChevron ? c("v-if", !0) : (p(), I(u(y), {
143
143
  key: 0,
144
- class: b([{ "maz-rotate-180": r.value }, "maz-text-lg maz-transition-transform maz-duration-200 maz-ease-in-out"])
144
+ class: v([{ "maz-rotate-180": r.value }, "maz-text-lg maz-transition-transform maz-duration-200 maz-ease-in-out"])
145
145
  }, null, 8, ["class"]))
146
146
  ]),
147
- d(" @slot Menu Label ")
147
+ c(" @slot Menu Label ")
148
148
  ]),
149
149
  _: 3
150
150
  /* FORWARDED */
151
151
  }, 16, ["color", "disabled"])
152
152
  ])
153
- ], 40, oe),
154
- O(W, { name: "maz-scale-fade" }, {
153
+ ], 40, te),
154
+ O(W, {
155
+ name: "maz-scale-fade",
156
+ persisted: ""
157
+ }, {
155
158
  default: h(() => [
156
- r.value ? (f(), v(
159
+ X(b(
157
160
  "div",
158
161
  {
159
- key: 0,
160
162
  role: "menu",
161
163
  "aria-label": "Menu",
162
- class: b(["menu", {
164
+ class: v(["menu", {
163
165
  "--top": e.position.includes("top"),
164
166
  "--left": e.position.includes("left"),
165
167
  "--right": e.position.includes("right"),
@@ -172,27 +174,27 @@ const ee = ["id"], oe = ["aria-expanded", "onClick"], ne = { class: "maz-sr-only
172
174
  onMouseleave: n[3] || (n[3] = (o) => ["hover", "both"].includes(e.trigger) ? u(a)(!1) : void 0)
173
175
  },
174
176
  [
175
- (f(!0), v(
176
- L,
177
+ (p(!0), k(
178
+ S,
177
179
  null,
178
- X(e.items, (o, p) => (f(), v(
179
- L,
180
+ Y(e.items, (o, m) => (p(), k(
181
+ S,
180
182
  null,
181
183
  [
182
- d(`
184
+ c(`
183
185
  @slot Custom menu item
184
186
  @binding {Object} item - menu item
185
187
  `),
186
- y(e.$slots, "menuitem", { item: o }, () => [
187
- (f(), I(Y(o.to ? "router-link" : o.action ? "button" : "a"), {
188
- key: p,
188
+ w(e.$slots, "menuitem", { item: o }, () => [
189
+ (p(), I(Z(o.to ? "router-link" : o.action ? "button" : "a"), {
190
+ key: m,
189
191
  href: o.href,
190
192
  tabindex: "-1",
191
193
  target: o.href ? o.target ?? "_self" : void 0,
192
194
  type: o.action ? "button" : void 0,
193
- class: b([[
195
+ class: v([[
194
196
  {
195
- "--is-keyboard-selected": t.value === p
197
+ "--is-keyboard-selected": t.value === m
196
198
  },
197
199
  o.class
198
200
  ], "menuitem"]),
@@ -200,12 +202,12 @@ const ee = ["id"], oe = ["aria-expanded", "onClick"], ne = { class: "maz-sr-only
200
202
  onClick: A((R) => o.action ? j(o, R) : g(), ["stop"])
201
203
  }, {
202
204
  default: h(() => [
203
- d(`
205
+ c(`
204
206
  @slot Custom menu item label
205
207
  @binding {Object} item - menu item
206
208
  `),
207
- y(e.$slots, "menuitem-label", { item: o }, () => [
208
- Z(
209
+ w(e.$slots, "menuitem-label", { item: o }, () => [
210
+ x(
209
211
  $(o.label),
210
212
  1
211
213
  /* TEXT */
@@ -226,14 +228,16 @@ const ee = ["id"], oe = ["aria-expanded", "onClick"], ne = { class: "maz-sr-only
226
228
  ],
227
229
  34
228
230
  /* CLASS, NEED_HYDRATION */
229
- )) : d("v-if", !0)
231
+ ), [
232
+ [_, r.value]
233
+ ])
230
234
  ]),
231
235
  _: 3
232
236
  /* FORWARDED */
233
237
  })
234
- ], 14, ee));
238
+ ], 14, ne));
235
239
  }
236
240
  });
237
241
  export {
238
- se as default
242
+ ae as default
239
243
  };
@@ -1,23 +1,32 @@
1
- import { defineComponent as t, defineAsyncComponent as n, openBlock as o, createElementBlock as a, createVNode as l, unref as s, renderSlot as m, createCommentVNode as c } from "vue";
2
- const d = { class: "maz-fixed maz-inset-0 maz-z-default-backdrop maz-flex maz-flex-col maz-gap-2 maz-bg-overlay maz-text-center maz-backdrop-blur maz-flex-center" }, i = { key: 0 }, u = /* @__PURE__ */ t({
1
+ import "./assets/MazFullscreenLoader.css";
2
+ import { defineComponent as s, defineAsyncComponent as l, onMounted as m, onUnmounted as c, openBlock as o, createElementBlock as n, createVNode as d, unref as u, renderSlot as i, createCommentVNode as p } from "vue";
3
+ const z = { class: "maz-fixed maz-inset-0 maz-z-default-backdrop maz-flex maz-flex-col maz-gap-2 maz-bg-overlay maz-text-center maz-backdrop-blur maz-flex-center" }, f = { key: 0 }, C = /* @__PURE__ */ s({
3
4
  __name: "MazFullscreenLoader",
4
5
  props: {
5
6
  color: { default: "primary" },
6
7
  size: { default: "3em" }
7
8
  },
8
- setup(p) {
9
- const r = n(() => import("./chunks/MazSpinner-FtzF9BUn.mjs"));
10
- return (e, z) => (o(), a("div", d, [
11
- l(s(r), {
9
+ setup(_) {
10
+ const t = l(() => import("./chunks/MazSpinner-FtzF9BUn.mjs")), a = () => {
11
+ document.documentElement.classList.add("--maz-fullscreen-loader-present");
12
+ }, r = async () => {
13
+ document.documentElement.classList.remove("--maz-fullscreen-loader-present");
14
+ };
15
+ return m(() => {
16
+ a();
17
+ }), c(() => {
18
+ r();
19
+ }), (e, k) => (o(), n("div", z, [
20
+ d(u(t), {
12
21
  color: e.color,
13
22
  size: e.size
14
23
  }, null, 8, ["color", "size"]),
15
- e.$slots.default ? (o(), a("span", i, [
16
- m(e.$slots, "default")
17
- ])) : c("v-if", !0)
24
+ e.$slots.default ? (o(), n("span", f, [
25
+ i(e.$slots, "default")
26
+ ])) : p("v-if", !0)
18
27
  ]));
19
28
  }
20
29
  });
21
30
  export {
22
- u as default
31
+ C as default
23
32
  };
@@ -1,4 +1,4 @@
1
- import { a as f } from "./chunks/MazInputNumber-m-H5m2ud.mjs";
1
+ import { a as f } from "./chunks/MazInputNumber-nZPwmWuy.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,185 +1,4 @@
1
- import "./assets/MazPullToRefresh.css";
2
- import { defineComponent as P, computed as p, ref as _, watch as R, onUnmounted as x, resolveComponent as V, openBlock as c, createElementBlock as v, normalizeClass as M, normalizeStyle as Y, renderSlot as f, createCommentVNode as y, createElementVNode as b, createVNode as $, pushScopeId as N, popScopeId as A } from "vue";
3
- function L() {
4
- return typeof document < "u";
5
- }
6
- function H() {
7
- if (!L())
8
- return !1;
9
- const o = navigator, d = window.matchMedia("(display-mode: standalone)").matches;
10
- return o.standalone || d;
11
- }
12
- const k = (o) => (N("data-v-a874f56d"), o = o(), A(), o), q = {
13
- key: 0,
14
- class: "header-text"
15
- }, D = /* @__PURE__ */ k(() => /* @__PURE__ */ b(
16
- "span",
17
- null,
18
- "Pull to refresh",
19
- -1
20
- /* HOISTED */
21
- )), F = {
22
- key: 1,
23
- class: "header-text"
24
- }, O = /* @__PURE__ */ k(() => /* @__PURE__ */ b(
25
- "span",
26
- null,
27
- " Release to refresh ",
28
- -1
29
- /* HOISTED */
30
- )), U = {
31
- key: 2,
32
- class: "header-text"
33
- }, j = { class: "maz-flex maz-flex-col maz-flex-center" }, G = /* @__PURE__ */ P({
34
- __name: "MazPullToRefresh",
35
- props: {
36
- distance: { default: 100 },
37
- offset: { default: 0 },
38
- action: { type: Function, default: void 0 },
39
- containerSelector: { default: void 0 },
40
- headerClass: { default: void 0 },
41
- spinnerColor: { default: "theme" },
42
- disabled: { type: Boolean, default: !1 },
43
- standaloneMode: { type: Boolean, default: !1 }
44
- },
45
- emits: ["loaded", "start", "error", "finish", "response"],
46
- setup(o, { emit: d }) {
47
- const a = o, r = d, l = p(
48
- () => a.disabled || a.action === void 0 || a.standaloneMode && L() && !H()
49
- ), m = _({
50
- top: 0,
51
- bottom: 0
52
- }), t = _({
53
- from: -1,
54
- to: -1,
55
- distance: 0,
56
- available: !1,
57
- state: "end"
58
- }), i = _(!1), s = p(() => {
59
- if (typeof document > "u" || l.value)
60
- return;
61
- const e = a.containerSelector ? document.querySelector(a.containerSelector) : document.body;
62
- if (!e)
63
- throw new Error("MazPullToRefresh - container not found");
64
- return e;
65
- }), h = p(() => t.value.state !== "move" && t.value.state !== "end" || l.value ? 0 : t.value.distance > a.distance ? a.distance : t.value.distance);
66
- function T(e) {
67
- const { top: n, height: u } = e.getBoundingClientRect();
68
- m.value = {
69
- top: n,
70
- bottom: window.innerHeight - (u + n + a.offset)
71
- };
72
- }
73
- function g(e) {
74
- i.value = e;
75
- }
76
- function w(e) {
77
- if (i.value || m.value.top < 0 && m.value.bottom < 0 || l.value)
78
- return;
79
- const n = e.touches.item(0);
80
- n && (t.value.state = "start", t.value.from = n.pageY);
81
- }
82
- function S(e) {
83
- if (i.value || t.value.from < 0 || window.scrollY > 0 || l.value)
84
- return;
85
- const n = e.touches.item(0);
86
- if (!n)
87
- return;
88
- t.value.to = n.pageY;
89
- const u = t.value.to - t.value.from;
90
- t.value.distance = u > 0 ? u : 0, t.value.available = t.value.distance >= a.distance, t.value.state = "move";
91
- }
92
- function E() {
93
- i.value || l.value || (h.value === a.distance && t.value.state === "move" && window.scrollY <= 0 ? B() : z());
94
- }
95
- function z() {
96
- t.value = {
97
- from: -1,
98
- to: -1,
99
- distance: 0,
100
- available: !1,
101
- state: "end"
102
- };
103
- }
104
- async function B() {
105
- var e;
106
- try {
107
- g(!0), r("start");
108
- const n = await ((e = a.action) == null ? void 0 : e.call(a));
109
- r("loaded"), r("response", n);
110
- } catch (n) {
111
- throw r("error", n), n;
112
- } finally {
113
- z(), g(!1), r("finish");
114
- }
115
- }
116
- R(
117
- () => l.value,
118
- (e) => {
119
- e === !0 ? C() : I();
120
- },
121
- { immediate: !0 }
122
- );
123
- function I() {
124
- !s.value || l.value || document === void 0 || (s.value.addEventListener("touchstart", w), s.value.addEventListener("touchmove", S), s.value.addEventListener("touchend", E), T(s.value));
125
- }
126
- function C() {
127
- !s.value || document === void 0 || (s.value.removeEventListener("touchstart", w), s.value.removeEventListener("touchmove", S), s.value.removeEventListener("touchend", E));
128
- }
129
- return x(() => {
130
- C();
131
- }), (e, n) => {
132
- const u = V("MazSpinner");
133
- return c(), v(
134
- "div",
135
- {
136
- class: M(["m-pull-to-refresh", { "--available": t.value.available || h.value > 10 }])
137
- },
138
- [
139
- l.value ? y("v-if", !0) : (c(), v(
140
- "div",
141
- {
142
- key: 0,
143
- class: M(["loading-header", e.headerClass]),
144
- style: Y({ height: h.value + "px" })
145
- },
146
- [
147
- t.value.available ? t.value.available && !i.value ? (c(), v("div", F, [
148
- f(e.$slots, "pull-ready", {}, () => [
149
- O
150
- ], !0)
151
- ])) : y("v-if", !0) : (c(), v("div", q, [
152
- f(e.$slots, "pull-before", {}, () => [
153
- D
154
- ], !0)
155
- ])),
156
- i.value ? (c(), v("div", U, [
157
- f(e.$slots, "pull-loading", {}, () => [
158
- b("div", j, [
159
- $(u, {
160
- color: e.spinnerColor,
161
- size: "2.5em"
162
- }, null, 8, ["color"])
163
- ])
164
- ], !0)
165
- ])) : y("v-if", !0)
166
- ],
167
- 6
168
- /* CLASS, STYLE */
169
- )),
170
- f(e.$slots, "default", {}, void 0, !0)
171
- ],
172
- 2
173
- /* CLASS */
174
- );
175
- };
176
- }
177
- }), J = (o, d) => {
178
- const a = o.__vccOpts || o;
179
- for (const [r, l] of d)
180
- a[r] = l;
181
- return a;
182
- }, W = /* @__PURE__ */ J(G, [["__scopeId", "data-v-a874f56d"]]);
1
+ import { M as f } from "./chunks/MazPullToRefresh-l6zWVzfv.mjs";
183
2
  export {
184
- W as default
3
+ f as default
185
4
  };