maz-ui 3.29.0 → 3.29.1
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/MazAvatar.d.ts +11 -0
- package/components/MazAvatar.mjs +1 -1
- package/components/MazBadge.d.ts +3 -3
- package/components/MazBadge.mjs +1 -1
- package/components/MazPullToRefresh.d.ts +88 -0
- package/components/MazPullToRefresh.mjs +185 -0
- package/components/assets/MazAccordion.css +1 -1
- package/components/assets/MazAvatar.css +1 -1
- package/components/assets/MazBadge.css +1 -1
- package/components/assets/MazPullToRefresh.css +1 -0
- package/components/chunks/MazAvatar-0JzIvOc4.mjs +134 -0
- package/components/chunks/{MazLazyImg-65QIsZ1B.mjs → MazLazyImg-evGMN9Pe.mjs} +2 -2
- package/components/chunks/{MazSpinner-W3TVtT8l.mjs → MazSpinner-J65FS2NQ.mjs} +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.mjs +1 -0
- package/modules/chunks/{MazBtn-OU9ti0GG.mjs → MazBtn-23G6MO1u.mjs} +2 -2
- package/modules/chunks/{MazBtn-5jYVOHi5.cjs → MazBtn-BVge7L6B.cjs} +1 -1
- package/modules/chunks/{MazIcon-mIVA-wm3.mjs → MazIcon-3ecUGYyh.mjs} +1 -1
- package/modules/chunks/{MazIcon-O-Sd2-b9.cjs → MazIcon-tK6rWxmD.cjs} +1 -1
- package/modules/chunks/{MazSpinner-Me_ta933.mjs → MazSpinner-CKpey7-9.mjs} +1 -1
- package/modules/chunks/{MazSpinner-ElCcZG5D.cjs → MazSpinner-Yp72xl7m.cjs} +1 -1
- package/modules/chunks/index-t7LFFnFX.cjs +124 -0
- package/modules/chunks/{index-AC4Cl2MH.mjs → index-w7bAz52b.mjs} +395 -347
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +24 -22
- package/nuxt/index.d.mts +10 -0
- package/nuxt/index.d.ts +10 -0
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +14 -0
- package/package.json +1 -1
- package/tailwindcss/tailwind.config.ts +3 -1
- package/tailwindcss/utils/colors.ts +2 -1
- package/tailwindcss/variables/breakpoints.ts +14 -0
- package/tailwindcss/variables/utilities.ts +3 -1
- package/tailwindcss/variables/z-indexes.ts +2 -1
- package/types/components/MazAvatar.vue.d.ts +11 -0
- package/types/components/MazBadge.vue.d.ts +3 -3
- package/types/components/MazPullToRefresh.vue.d.ts +88 -0
- package/types/components/index.d.ts +1 -0
- package/types/modules/composables/index.d.ts +2 -0
- package/types/modules/composables/use-breakpoints.d.ts +38 -0
- package/types/modules/composables/use-window-size.d.ts +32 -0
- package/types/modules/helpers/is-standalone-mode.d.ts +1 -0
- package/types/tailwindcss/tailwind.config.d.ts +2 -0
- package/types/tailwindcss/variables/breakpoints.d.ts +1 -0
- package/components/chunks/MazAvatar-HJMP2asX.mjs +0 -127
- package/modules/chunks/index-f0w7PwtX.cjs +0 -124
|
@@ -71,6 +71,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
71
71
|
type: NumberConstructor;
|
|
72
72
|
default: undefined;
|
|
73
73
|
};
|
|
74
|
+
roundedSize: {
|
|
75
|
+
type: PropType<"sm" | "md" | "lg" | "xl" | "none" | "full">;
|
|
76
|
+
default: string;
|
|
77
|
+
validator: (value: string) => boolean;
|
|
78
|
+
};
|
|
74
79
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
75
80
|
click: (...args: any[]) => void;
|
|
76
81
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -143,6 +148,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
143
148
|
type: NumberConstructor;
|
|
144
149
|
default: undefined;
|
|
145
150
|
};
|
|
151
|
+
roundedSize: {
|
|
152
|
+
type: PropType<"sm" | "md" | "lg" | "xl" | "none" | "full">;
|
|
153
|
+
default: string;
|
|
154
|
+
validator: (value: string) => boolean;
|
|
155
|
+
};
|
|
146
156
|
}>> & {
|
|
147
157
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
148
158
|
}, {
|
|
@@ -163,6 +173,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
163
173
|
buttonColor: Color;
|
|
164
174
|
noClickableIcon: boolean;
|
|
165
175
|
letterCount: number;
|
|
176
|
+
roundedSize: "sm" | "md" | "lg" | "xl" | "none" | "full";
|
|
166
177
|
}, {}>, {
|
|
167
178
|
"round-text"?(_: {}): any;
|
|
168
179
|
icon?(_: {}): any;
|
package/components/MazAvatar.mjs
CHANGED
package/components/MazBadge.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
24
24
|
default: boolean;
|
|
25
25
|
};
|
|
26
26
|
roundedSize: {
|
|
27
|
-
type:
|
|
27
|
+
type: PropType<"sm" | "md" | "lg" | "xl" | "none" | "full">;
|
|
28
28
|
default: string;
|
|
29
29
|
validator: (value: string) => boolean;
|
|
30
30
|
};
|
|
@@ -51,7 +51,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
51
51
|
default: boolean;
|
|
52
52
|
};
|
|
53
53
|
roundedSize: {
|
|
54
|
-
type:
|
|
54
|
+
type: PropType<"sm" | "md" | "lg" | "xl" | "none" | "full">;
|
|
55
55
|
default: string;
|
|
56
56
|
validator: (value: string) => boolean;
|
|
57
57
|
};
|
|
@@ -60,8 +60,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
60
60
|
color: BadgeColor;
|
|
61
61
|
outline: boolean;
|
|
62
62
|
pastel: boolean;
|
|
63
|
+
roundedSize: "sm" | "md" | "lg" | "xl" | "none" | "full";
|
|
63
64
|
nowrap: boolean;
|
|
64
|
-
roundedSize: string;
|
|
65
65
|
}, {}>, {
|
|
66
66
|
default?(_: {}): any;
|
|
67
67
|
}>;
|
package/components/MazBadge.mjs
CHANGED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Color } from './types';
|
|
2
|
+
export type { Color } from './types';
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
distance?: number | undefined;
|
|
5
|
+
offset?: number | undefined;
|
|
6
|
+
action?: (() => unknown) | undefined;
|
|
7
|
+
containerSelector?: string | undefined;
|
|
8
|
+
headerClass?: string | undefined;
|
|
9
|
+
spinnerColor?: Color | undefined;
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
standaloneMode?: boolean | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
distance: number;
|
|
14
|
+
offset: number;
|
|
15
|
+
action: undefined;
|
|
16
|
+
containerSelector: undefined;
|
|
17
|
+
headerClass: undefined;
|
|
18
|
+
spinnerColor: string;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
standaloneMode: boolean;
|
|
21
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
error: (...args: any[]) => void;
|
|
23
|
+
loaded: (...args: any[]) => void;
|
|
24
|
+
start: (...args: any[]) => void;
|
|
25
|
+
finish: (...args: any[]) => void;
|
|
26
|
+
response: (...args: any[]) => void;
|
|
27
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
28
|
+
distance?: number | undefined;
|
|
29
|
+
offset?: number | undefined;
|
|
30
|
+
action?: (() => unknown) | undefined;
|
|
31
|
+
containerSelector?: string | undefined;
|
|
32
|
+
headerClass?: string | undefined;
|
|
33
|
+
spinnerColor?: Color | undefined;
|
|
34
|
+
disabled?: boolean | undefined;
|
|
35
|
+
standaloneMode?: boolean | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
distance: number;
|
|
38
|
+
offset: number;
|
|
39
|
+
action: undefined;
|
|
40
|
+
containerSelector: undefined;
|
|
41
|
+
headerClass: undefined;
|
|
42
|
+
spinnerColor: string;
|
|
43
|
+
disabled: boolean;
|
|
44
|
+
standaloneMode: boolean;
|
|
45
|
+
}>>> & {
|
|
46
|
+
onError?: ((...args: any[]) => any) | undefined;
|
|
47
|
+
onLoaded?: ((...args: any[]) => any) | undefined;
|
|
48
|
+
onStart?: ((...args: any[]) => any) | undefined;
|
|
49
|
+
onFinish?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
onResponse?: ((...args: any[]) => any) | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
action: () => unknown;
|
|
54
|
+
offset: number;
|
|
55
|
+
distance: number;
|
|
56
|
+
containerSelector: string;
|
|
57
|
+
headerClass: string;
|
|
58
|
+
spinnerColor: Color;
|
|
59
|
+
standaloneMode: boolean;
|
|
60
|
+
}, {}>, {
|
|
61
|
+
"pull-before"?(_: {}): any;
|
|
62
|
+
"pull-ready"?(_: {}): any;
|
|
63
|
+
"pull-loading"?(_: {}): any;
|
|
64
|
+
default?(_: {}): any;
|
|
65
|
+
}>;
|
|
66
|
+
export default _default;
|
|
67
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
68
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
69
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
70
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
71
|
+
} : {
|
|
72
|
+
type: import('vue').PropType<T[K]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
type __VLS_WithDefaults<P, D> = {
|
|
77
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
78
|
+
default: D[K];
|
|
79
|
+
}> : P[K];
|
|
80
|
+
};
|
|
81
|
+
type __VLS_Prettify<T> = {
|
|
82
|
+
[K in keyof T]: T[K];
|
|
83
|
+
} & {};
|
|
84
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
85
|
+
new (): {
|
|
86
|
+
$slots: S;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
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"]]);
|
|
183
|
+
export {
|
|
184
|
+
W as default
|
|
185
|
+
};
|