mhz-helpers 1.2.5 → 1.2.7
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.
|
@@ -2,7 +2,7 @@ export * from './useAuth';
|
|
|
2
2
|
export * from './useInfiniteScroll';
|
|
3
3
|
export * from './usePage';
|
|
4
4
|
export * from './usePagination';
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './usePwa';
|
|
6
6
|
export * from './useRouteId';
|
|
7
7
|
export * from './useValidate';
|
|
8
8
|
export * from './useCalendar';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface IPromptEvent extends Event {
|
|
2
2
|
prompt: () => Promise<void>;
|
|
3
3
|
}
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function usePwa(): {
|
|
5
5
|
installPWA: () => Promise<void>;
|
|
6
6
|
isShowInstallPWA: import('vue').Ref<boolean, boolean>;
|
|
7
7
|
isPWACanBeInstalled: import('vue').Ref<boolean, boolean>;
|
package/dist/helpers/date.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
type TLocale = 'ru' | 'en';
|
|
2
|
+
type TDate = string | Date | null;
|
|
1
3
|
export declare function addZero(value: number): string;
|
|
2
|
-
export declare function formatDuration(duration?: number, lang?:
|
|
3
|
-
export declare function formatDate(dateRaw?:
|
|
4
|
-
export declare function formatDateTime(dateRaw?:
|
|
5
|
-
export declare function subtractDates(dateFuture?:
|
|
4
|
+
export declare function formatDuration(duration?: number, lang?: TLocale): string;
|
|
5
|
+
export declare function formatDate(dateRaw?: TDate, lang?: TLocale): string;
|
|
6
|
+
export declare function formatDateTime(dateRaw?: TDate, lang?: TLocale): string;
|
|
7
|
+
export declare function subtractDates(dateFuture?: TDate, datePast?: TDate, lang?: TLocale, isRawResult?: boolean): string | number;
|
|
6
8
|
export interface IDatesGap {
|
|
7
9
|
dateFrom: Date;
|
|
8
10
|
dateTo: Date;
|
|
@@ -17,3 +19,4 @@ export interface IWeekDays {
|
|
|
17
19
|
}
|
|
18
20
|
export declare function getFirstAndLastDays(count: number, isMonth: boolean): IWeekDays[];
|
|
19
21
|
export declare function getOneYearFromNow(): string;
|
|
22
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ const vr = Ie("string"), U = Ie("function"), bn = Ie("number"), ve = (t) => t !=
|
|
|
34
34
|
let e;
|
|
35
35
|
return t && (typeof FormData == "function" && t instanceof FormData || U(t.append) && ((e = Ue(t)) === "formdata" || // detect form-data instance
|
|
36
36
|
e === "object" && U(t.toString) && t.toString() === "[object FormData]"));
|
|
37
|
-
},
|
|
37
|
+
}, Fr = H("URLSearchParams"), [Pr, xr, Dr, qr] = ["ReadableStream", "Request", "Response", "Headers"].map(H), Nr = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
38
38
|
function we(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
39
39
|
if (t === null || typeof t > "u")
|
|
40
40
|
return;
|
|
@@ -119,7 +119,7 @@ const _r = (t, e, n, { allOwnKeys: r } = {}) => (we(e, (s, i) => {
|
|
|
119
119
|
function(n, r, s) {
|
|
120
120
|
return r.toUpperCase() + s;
|
|
121
121
|
}
|
|
122
|
-
),
|
|
122
|
+
), Ft = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), Vr = H("RegExp"), On = (t, e) => {
|
|
123
123
|
const n = Object.getOwnPropertyDescriptors(t), r = {};
|
|
124
124
|
we(n, (s, i) => {
|
|
125
125
|
let o;
|
|
@@ -190,7 +190,7 @@ const Xr = (t) => {
|
|
|
190
190
|
isObject: ve,
|
|
191
191
|
isPlainObject: Ae,
|
|
192
192
|
isEmptyObject: Or,
|
|
193
|
-
isReadableStream:
|
|
193
|
+
isReadableStream: Pr,
|
|
194
194
|
isRequest: xr,
|
|
195
195
|
isResponse: Dr,
|
|
196
196
|
isHeaders: qr,
|
|
@@ -201,7 +201,7 @@ const Xr = (t) => {
|
|
|
201
201
|
isRegExp: Vr,
|
|
202
202
|
isFunction: U,
|
|
203
203
|
isStream: Tr,
|
|
204
|
-
isURLSearchParams:
|
|
204
|
+
isURLSearchParams: Fr,
|
|
205
205
|
isTypedArray: jr,
|
|
206
206
|
isFileList: Ar,
|
|
207
207
|
forEach: we,
|
|
@@ -218,8 +218,8 @@ const Xr = (t) => {
|
|
|
218
218
|
forEachEntry: Qr,
|
|
219
219
|
matchAll: Br,
|
|
220
220
|
isHTMLForm: Hr,
|
|
221
|
-
hasOwnProperty:
|
|
222
|
-
hasOwnProp:
|
|
221
|
+
hasOwnProperty: Ft,
|
|
222
|
+
hasOwnProp: Ft,
|
|
223
223
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
224
224
|
reduceDescriptors: On,
|
|
225
225
|
freezeMethods: Kr,
|
|
@@ -295,7 +295,7 @@ function Xe(t) {
|
|
|
295
295
|
function An(t) {
|
|
296
296
|
return h.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function Pt(t, e, n) {
|
|
299
299
|
return t ? t.concat(e).map(function(s, i) {
|
|
300
300
|
return s = An(s), !n && i ? "[" + s + "]" : s;
|
|
301
301
|
}).join(n ? "." : "") : e;
|
|
@@ -338,12 +338,12 @@ function Me(t, e, n) {
|
|
|
338
338
|
return d = An(d), m.forEach(function(v, O) {
|
|
339
339
|
!(h.isUndefined(v) || v === null) && e.append(
|
|
340
340
|
// eslint-disable-next-line no-nested-ternary
|
|
341
|
-
o === !0 ?
|
|
341
|
+
o === !0 ? Pt([d], O, i) : o === null ? d : d + "[]",
|
|
342
342
|
f(v)
|
|
343
343
|
);
|
|
344
344
|
}), !1;
|
|
345
345
|
}
|
|
346
|
-
return Xe(y) ? !0 : (e.append(
|
|
346
|
+
return Xe(y) ? !0 : (e.append(Pt(p, d, i), f(y)), !1);
|
|
347
347
|
}
|
|
348
348
|
const l = [], g = Object.assign(ss, {
|
|
349
349
|
defaultVisitor: c,
|
|
@@ -470,7 +470,7 @@ class Dt {
|
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
const
|
|
473
|
+
const Fn = {
|
|
474
474
|
silentJSONParsing: !0,
|
|
475
475
|
forcedJSONParsing: !0,
|
|
476
476
|
clarifyTimeoutError: !1
|
|
@@ -514,7 +514,7 @@ function ms(t) {
|
|
|
514
514
|
i = n[r], e[i] = t[i];
|
|
515
515
|
return e;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function Pn(t) {
|
|
518
518
|
function e(n, r, s, i) {
|
|
519
519
|
let o = n[i++];
|
|
520
520
|
if (o === "__proto__") return !0;
|
|
@@ -540,12 +540,12 @@ function gs(t, e, n) {
|
|
|
540
540
|
return (n || JSON.stringify)(t);
|
|
541
541
|
}
|
|
542
542
|
const Oe = {
|
|
543
|
-
transitional:
|
|
543
|
+
transitional: Fn,
|
|
544
544
|
adapter: ["xhr", "http", "fetch"],
|
|
545
545
|
transformRequest: [function(e, n) {
|
|
546
546
|
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = h.isObject(e);
|
|
547
547
|
if (i && h.isHTMLForm(e) && (e = new FormData(e)), h.isFormData(e))
|
|
548
|
-
return s ? JSON.stringify(
|
|
548
|
+
return s ? JSON.stringify(Pn(e)) : e;
|
|
549
549
|
if (h.isArrayBuffer(e) || h.isBuffer(e) || h.isStream(e) || h.isFile(e) || h.isBlob(e) || h.isReadableStream(e))
|
|
550
550
|
return e;
|
|
551
551
|
if (h.isArrayBufferView(e))
|
|
@@ -867,7 +867,7 @@ function Ts(t, e) {
|
|
|
867
867
|
}, r - l)));
|
|
868
868
|
}, () => s && o(s)];
|
|
869
869
|
}
|
|
870
|
-
const
|
|
870
|
+
const Pe = (t, e, n = 3) => {
|
|
871
871
|
let r = 0;
|
|
872
872
|
const s = As(50, 250);
|
|
873
873
|
return Ts((i) => {
|
|
@@ -896,7 +896,7 @@ const Fe = (t, e, n = 3) => {
|
|
|
896
896
|
}, _t = (t) => (...e) => h.asap(() => t(...e)), Cs = N.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (n) => (n = new URL(n, N.origin), t.protocol === n.protocol && t.host === n.host && (e || t.port === n.port)))(
|
|
897
897
|
new URL(N.origin),
|
|
898
898
|
N.navigator && /(msie|trident)/i.test(N.navigator.userAgent)
|
|
899
|
-
) : () => !0,
|
|
899
|
+
) : () => !0, Fs = N.hasStandardBrowserEnv ? (
|
|
900
900
|
// Standard browser envs support document.cookie
|
|
901
901
|
{
|
|
902
902
|
write(t, e, n, r, s, i) {
|
|
@@ -923,14 +923,14 @@ const Fe = (t, e, n = 3) => {
|
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
925
|
);
|
|
926
|
-
function
|
|
926
|
+
function Ps(t) {
|
|
927
927
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
928
928
|
}
|
|
929
929
|
function xs(t, e) {
|
|
930
930
|
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
931
931
|
}
|
|
932
932
|
function qn(t, e, n) {
|
|
933
|
-
let r = !
|
|
933
|
+
let r = !Ps(e);
|
|
934
934
|
return t && (r || n == !1) ? xs(t, e) : e;
|
|
935
935
|
}
|
|
936
936
|
const Ut = (t) => t instanceof I ? { ...t } : t;
|
|
@@ -1015,7 +1015,7 @@ const Nn = (t) => {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
1017
|
if (N.hasStandardBrowserEnv && (r && h.isFunction(r) && (r = r(e)), r || r !== !1 && Cs(e.url))) {
|
|
1018
|
-
const f = s && i &&
|
|
1018
|
+
const f = s && i && Fs.read(i);
|
|
1019
1019
|
f && o.set(s, f);
|
|
1020
1020
|
}
|
|
1021
1021
|
return e;
|
|
@@ -1043,10 +1043,10 @@ const Nn = (t) => {
|
|
|
1043
1043
|
config: t,
|
|
1044
1044
|
request: p
|
|
1045
1045
|
};
|
|
1046
|
-
Dn(function(
|
|
1047
|
-
n(
|
|
1048
|
-
}, function(
|
|
1049
|
-
r(
|
|
1046
|
+
Dn(function(F) {
|
|
1047
|
+
n(F), d();
|
|
1048
|
+
}, function(F) {
|
|
1049
|
+
r(F), d();
|
|
1050
1050
|
}, S), p = null;
|
|
1051
1051
|
}
|
|
1052
1052
|
"onloadend" in p ? p.onloadend = m : p.onreadystatechange = function() {
|
|
@@ -1057,7 +1057,7 @@ const Nn = (t) => {
|
|
|
1057
1057
|
r(new E("Network Error", E.ERR_NETWORK, t, p)), p = null;
|
|
1058
1058
|
}, p.ontimeout = function() {
|
|
1059
1059
|
let O = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1060
|
-
const S = s.transitional ||
|
|
1060
|
+
const S = s.transitional || Fn;
|
|
1061
1061
|
s.timeoutErrorMessage && (O = s.timeoutErrorMessage), r(new E(
|
|
1062
1062
|
O,
|
|
1063
1063
|
S.clarifyTimeoutError ? E.ETIMEDOUT : E.ECONNABORTED,
|
|
@@ -1066,7 +1066,7 @@ const Nn = (t) => {
|
|
|
1066
1066
|
)), p = null;
|
|
1067
1067
|
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && h.forEach(o.toJSON(), function(O, S) {
|
|
1068
1068
|
p.setRequestHeader(S, O);
|
|
1069
|
-
}), h.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), a && a !== "json" && (p.responseType = s.responseType), f && ([g, y] =
|
|
1069
|
+
}), h.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), a && a !== "json" && (p.responseType = s.responseType), f && ([g, y] = Pe(f, !0), p.addEventListener("progress", g)), u && p.upload && ([l, b] = Pe(u), p.upload.addEventListener("progress", l), p.upload.addEventListener("loadend", b)), (s.cancelToken || s.signal) && (c = (v) => {
|
|
1070
1070
|
p && (r(!v || v.type ? new le(null, t, p) : v), p.abort(), p = null);
|
|
1071
1071
|
}, s.cancelToken && s.cancelToken.subscribe(c), s.signal && (s.signal.aborted ? c() : s.signal.addEventListener("abort", c)));
|
|
1072
1072
|
const w = Rs(s.url);
|
|
@@ -1228,11 +1228,11 @@ const Ls = async (t) => {
|
|
|
1228
1228
|
duplex: "half"
|
|
1229
1229
|
}), T;
|
|
1230
1230
|
if (h.isFormData(r) && (T = S.headers.get("content-type")) && c.setContentType(T), S.body) {
|
|
1231
|
-
const [
|
|
1231
|
+
const [F, C] = Nt(
|
|
1232
1232
|
p,
|
|
1233
|
-
|
|
1233
|
+
Pe(_t(u))
|
|
1234
1234
|
);
|
|
1235
|
-
r = It(S.body, Mt,
|
|
1235
|
+
r = It(S.body, Mt, F, C);
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
1238
|
h.isString(l) || (l = l ? "include" : "omit");
|
|
@@ -1253,12 +1253,12 @@ const Ls = async (t) => {
|
|
|
1253
1253
|
["status", "statusText", "headers"].forEach((M) => {
|
|
1254
1254
|
S[M] = w[M];
|
|
1255
1255
|
});
|
|
1256
|
-
const T = h.toFiniteNumber(w.headers.get("content-length")), [
|
|
1256
|
+
const T = h.toFiniteNumber(w.headers.get("content-length")), [F, C] = a && Nt(
|
|
1257
1257
|
T,
|
|
1258
|
-
|
|
1258
|
+
Pe(_t(a), !0)
|
|
1259
1259
|
) || [];
|
|
1260
1260
|
w = new Response(
|
|
1261
|
-
It(w.body, Mt,
|
|
1261
|
+
It(w.body, Mt, F, () => {
|
|
1262
1262
|
C && C(), d && d();
|
|
1263
1263
|
}),
|
|
1264
1264
|
S
|
|
@@ -1679,26 +1679,26 @@ function Ln(t) {
|
|
|
1679
1679
|
return Ln(te(t, s));
|
|
1680
1680
|
}, n;
|
|
1681
1681
|
}
|
|
1682
|
-
const
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1682
|
+
const P = Ln(Oe);
|
|
1683
|
+
P.Axios = ee;
|
|
1684
|
+
P.CanceledError = le;
|
|
1685
|
+
P.CancelToken = $s;
|
|
1686
|
+
P.isCancel = xn;
|
|
1687
|
+
P.VERSION = Mn;
|
|
1688
|
+
P.toFormData = Me;
|
|
1689
|
+
P.AxiosError = E;
|
|
1690
|
+
P.Cancel = P.CanceledError;
|
|
1691
|
+
P.all = function(e) {
|
|
1692
1692
|
return Promise.all(e);
|
|
1693
1693
|
};
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1694
|
+
P.spread = Vs;
|
|
1695
|
+
P.isAxiosError = Ks;
|
|
1696
|
+
P.mergeConfig = te;
|
|
1697
|
+
P.AxiosHeaders = I;
|
|
1698
|
+
P.formToJSON = (t) => Pn(h.isHTMLForm(t) ? new FormData(t) : t);
|
|
1699
|
+
P.getAdapter = In.getAdapter;
|
|
1700
|
+
P.HttpStatusCode = tt;
|
|
1701
|
+
P.default = P;
|
|
1702
1702
|
const {
|
|
1703
1703
|
Axios: _o,
|
|
1704
1704
|
AxiosError: Uo,
|
|
@@ -1716,7 +1716,7 @@ const {
|
|
|
1716
1716
|
formToJSON: Wo,
|
|
1717
1717
|
getAdapter: zo,
|
|
1718
1718
|
mergeConfig: Jo
|
|
1719
|
-
} =
|
|
1719
|
+
} = P, je = P;
|
|
1720
1720
|
function Go(t) {
|
|
1721
1721
|
je.defaults.baseURL = t;
|
|
1722
1722
|
}
|
|
@@ -1741,14 +1741,14 @@ function zs(t, e) {
|
|
|
1741
1741
|
return `${n ? `${n} ${s}. ` : ""}${nt(r)} ${i}.`;
|
|
1742
1742
|
}
|
|
1743
1743
|
function Zo(t, e) {
|
|
1744
|
-
return !t || isNaN(new Date(t).getTime()) ? "0" : new Intl.DateTimeFormat(e === "ru" ? "ru-RU" : "en-EN", {
|
|
1744
|
+
return !t || Number.isNaN(new Date(t).getTime()) ? "0" : new Intl.DateTimeFormat(e === "ru" ? "ru-RU" : "en-EN", {
|
|
1745
1745
|
year: "numeric",
|
|
1746
1746
|
month: "short",
|
|
1747
1747
|
day: "numeric"
|
|
1748
1748
|
}).format(new Date(t)) || "0";
|
|
1749
1749
|
}
|
|
1750
1750
|
function ea(t, e) {
|
|
1751
|
-
return !t || isNaN(new Date(t).getTime()) ? "0" : new Intl.DateTimeFormat(e === "ru" ? "ru-RU" : "en-EN", {
|
|
1751
|
+
return !t || Number.isNaN(new Date(t).getTime()) ? "0" : new Intl.DateTimeFormat(e === "ru" ? "ru-RU" : "en-EN", {
|
|
1752
1752
|
year: "numeric",
|
|
1753
1753
|
month: "short",
|
|
1754
1754
|
day: "numeric",
|
|
@@ -1759,7 +1759,7 @@ function ea(t, e) {
|
|
|
1759
1759
|
function ta(t, e, n, r) {
|
|
1760
1760
|
if (!t || !e) return "0";
|
|
1761
1761
|
const s = new Date(t), i = new Date(e);
|
|
1762
|
-
if (isNaN(s.getTime()) || isNaN(i.getTime())) return "0";
|
|
1762
|
+
if (Number.isNaN(s.getTime()) || Number.isNaN(i.getTime())) return "0";
|
|
1763
1763
|
const o = Math.floor((s.getTime() - i.getTime()) / 1e3);
|
|
1764
1764
|
return r ? o : zs(o, n);
|
|
1765
1765
|
}
|
|
@@ -1770,15 +1770,13 @@ function na(t) {
|
|
|
1770
1770
|
function ra(t, e) {
|
|
1771
1771
|
const n = [];
|
|
1772
1772
|
for (let r = 0; r < t; r++) {
|
|
1773
|
-
const s = /* @__PURE__ */ new Date(), i = new Date(
|
|
1774
|
-
|
|
1775
|
-
);
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
dateTo: o,
|
|
1781
|
-
label: `${i.toLocaleDateString("ru").slice(0, -5)} - ${o.toLocaleDateString("ru").slice(0, -5)}`
|
|
1773
|
+
const s = /* @__PURE__ */ new Date(), i = s.getDay() === 0 ? -6 : 1, o = new Date(s.setDate(e ? 1 : s.getDate() - s.getDay() + i - r * 7));
|
|
1774
|
+
e && o.setMonth(s.getMonth() - r);
|
|
1775
|
+
const a = e ? new Date(s.getFullYear(), s.getMonth() + 1 - r, 0) : new Date(s.setDate(s.getDate() - s.getDay() + 7));
|
|
1776
|
+
o.setHours(0, 0, 0, 0), a.setHours(23, 59, 59), n.push({
|
|
1777
|
+
dateFrom: o,
|
|
1778
|
+
dateTo: a,
|
|
1779
|
+
label: `${o.toLocaleDateString("ru").slice(0, -5)} - ${a.toLocaleDateString("ru").slice(0, -5)}`
|
|
1782
1780
|
});
|
|
1783
1781
|
}
|
|
1784
1782
|
return n.reverse();
|
|
@@ -1797,10 +1795,10 @@ function oa(t, e) {
|
|
|
1797
1795
|
return t === "/" ? t === e : t.includes(e) && e !== "/";
|
|
1798
1796
|
}
|
|
1799
1797
|
function aa(t) {
|
|
1800
|
-
return t === null || isNaN(t) ? "" : `${t > 0 ? "+" : ""}${t}%`;
|
|
1798
|
+
return t === null || Number.isNaN(t) ? "" : `${t > 0 ? "+" : ""}${t}%`;
|
|
1801
1799
|
}
|
|
1802
1800
|
function ua(t, e) {
|
|
1803
|
-
return e === 0 || isNaN(e) || isNaN(t) ? 0 : Math.round((t - e) / e * 100);
|
|
1801
|
+
return e === 0 || Number.isNaN(e) || Number.isNaN(t) ? 0 : Math.round((t - e) / e * 100);
|
|
1804
1802
|
}
|
|
1805
1803
|
var fe = class {
|
|
1806
1804
|
constructor() {
|
|
@@ -3289,7 +3287,7 @@ var ci = class {
|
|
|
3289
3287
|
this.#i = C;
|
|
3290
3288
|
}
|
|
3291
3289
|
this.#i && (b = this.#i, g = this.#h, y = Date.now(), d = "error");
|
|
3292
|
-
const m = c.fetchStatus === "fetching", w = d === "pending", v = d === "error", O = w && m, S = g !== void 0,
|
|
3290
|
+
const m = c.fetchStatus === "fetching", w = d === "pending", v = d === "error", O = w && m, S = g !== void 0, F = {
|
|
3293
3291
|
status: d,
|
|
3294
3292
|
fetchStatus: c.fetchStatus,
|
|
3295
3293
|
isPending: w,
|
|
@@ -3319,9 +3317,9 @@ var ci = class {
|
|
|
3319
3317
|
};
|
|
3320
3318
|
if (this.options.experimental_prefetchInRender) {
|
|
3321
3319
|
const C = (G) => {
|
|
3322
|
-
|
|
3320
|
+
F.status === "error" ? G.reject(F.error) : F.data !== void 0 && G.resolve(F.data);
|
|
3323
3321
|
}, M = () => {
|
|
3324
|
-
const G = this.#a =
|
|
3322
|
+
const G = this.#a = F.promise = ut();
|
|
3325
3323
|
C(G);
|
|
3326
3324
|
}, K = this.#a;
|
|
3327
3325
|
switch (K.status) {
|
|
@@ -3329,14 +3327,14 @@ var ci = class {
|
|
|
3329
3327
|
t.queryHash === n.queryHash && C(K);
|
|
3330
3328
|
break;
|
|
3331
3329
|
case "fulfilled":
|
|
3332
|
-
(
|
|
3330
|
+
(F.status === "error" || F.data !== K.value) && M();
|
|
3333
3331
|
break;
|
|
3334
3332
|
case "rejected":
|
|
3335
|
-
(
|
|
3333
|
+
(F.status !== "error" || F.error !== K.reason) && M();
|
|
3336
3334
|
break;
|
|
3337
3335
|
}
|
|
3338
3336
|
}
|
|
3339
|
-
return
|
|
3337
|
+
return F;
|
|
3340
3338
|
}
|
|
3341
3339
|
updateResult() {
|
|
3342
3340
|
const t = this.#r, e = this.createResult(this.#e, this.options);
|
|
@@ -4141,9 +4139,9 @@ const tr = {
|
|
|
4141
4139
|
x̧: "x",
|
|
4142
4140
|
Z̧: "Z",
|
|
4143
4141
|
z̧: "z"
|
|
4144
|
-
}, Ci = Object.keys(tr).join("|"),
|
|
4145
|
-
function
|
|
4146
|
-
return t.replace(
|
|
4142
|
+
}, Ci = Object.keys(tr).join("|"), Fi = new RegExp(Ci, "g");
|
|
4143
|
+
function Pi(t) {
|
|
4144
|
+
return t.replace(Fi, (e) => tr[e]);
|
|
4147
4145
|
}
|
|
4148
4146
|
/**
|
|
4149
4147
|
* @name match-sorter
|
|
@@ -4232,7 +4230,7 @@ function Xt(t, e) {
|
|
|
4232
4230
|
let {
|
|
4233
4231
|
keepDiacritics: n
|
|
4234
4232
|
} = e;
|
|
4235
|
-
return t = `${t}`, n || (t =
|
|
4233
|
+
return t = `${t}`, n || (t = Pi(t)), t;
|
|
4236
4234
|
}
|
|
4237
4235
|
function Ni(t, e) {
|
|
4238
4236
|
let n = e;
|
|
@@ -4672,7 +4670,7 @@ async function Oa(t) {
|
|
|
4672
4670
|
}), s = hr(r);
|
|
4673
4671
|
s.use(e);
|
|
4674
4672
|
const i = document.createElement("div");
|
|
4675
|
-
document.body.
|
|
4673
|
+
document.body.append(i), s.mount(i), await n;
|
|
4676
4674
|
}
|
|
4677
4675
|
function Ea(t) {
|
|
4678
4676
|
document.querySelector(t)?.scrollTo(0, 0);
|
|
@@ -4686,7 +4684,7 @@ function Hi(t) {
|
|
|
4686
4684
|
rr.value = t;
|
|
4687
4685
|
}
|
|
4688
4686
|
function $i(t, e, n) {
|
|
4689
|
-
Ki(n), e(),
|
|
4687
|
+
Ki(n), e(), globalThis.location.href = t;
|
|
4690
4688
|
}
|
|
4691
4689
|
function Ra(t) {
|
|
4692
4690
|
if (!document.cookie) return;
|
|
@@ -4731,22 +4729,14 @@ function Ca(t, e) {
|
|
|
4731
4729
|
...s
|
|
4732
4730
|
};
|
|
4733
4731
|
}
|
|
4734
|
-
function
|
|
4732
|
+
function Fa(t) {
|
|
4735
4733
|
const e = wt(), n = Ot(), r = q({
|
|
4736
4734
|
page: n.query.page && +(n.query.page > 0) ? Number(n.query.page) : 1,
|
|
4737
4735
|
sort: { value: n.query.sort?.toString(), isAsc: n.query.dir !== "desc" },
|
|
4738
4736
|
filter: { ...t }
|
|
4739
4737
|
});
|
|
4740
4738
|
function s(a) {
|
|
4741
|
-
typeof a == "string" ? r.value
|
|
4742
|
-
page: 1,
|
|
4743
|
-
sort: { value: a, isAsc: !0 },
|
|
4744
|
-
filter: {}
|
|
4745
|
-
} : r.value = {
|
|
4746
|
-
...r.value,
|
|
4747
|
-
page: 1,
|
|
4748
|
-
sort: a
|
|
4749
|
-
};
|
|
4739
|
+
r.value = typeof a == "string" ? { page: 1, sort: { value: a, isAsc: !0 }, filter: {} } : { ...r.value, page: 1, sort: a };
|
|
4750
4740
|
}
|
|
4751
4741
|
function i(a) {
|
|
4752
4742
|
r.value.page = a > 0 ? a : 1;
|
|
@@ -4772,7 +4762,7 @@ function Pa(t) {
|
|
|
4772
4762
|
}
|
|
4773
4763
|
), { query: r, resetQuery: s, setQueryPage: i, setQueryFilter: o };
|
|
4774
4764
|
}
|
|
4775
|
-
function
|
|
4765
|
+
function Pa() {
|
|
4776
4766
|
const t = wt(), e = Ot(), n = q(Number(e.query.page || 1));
|
|
4777
4767
|
function r() {
|
|
4778
4768
|
n.value = 1;
|
|
@@ -4808,9 +4798,9 @@ function Da() {
|
|
|
4808
4798
|
s(o) && (e.value = !0, t.value = !0, n.value = o);
|
|
4809
4799
|
}
|
|
4810
4800
|
return dn(() => {
|
|
4811
|
-
|
|
4801
|
+
globalThis.addEventListener("beforeinstallprompt", i);
|
|
4812
4802
|
}), pn(() => {
|
|
4813
|
-
|
|
4803
|
+
globalThis.removeEventListener("beforeinstallprompt", i);
|
|
4814
4804
|
}), {
|
|
4815
4805
|
installPWA: r,
|
|
4816
4806
|
isShowInstallPWA: t,
|
|
@@ -4960,13 +4950,13 @@ function Xi() {
|
|
|
4960
4950
|
return !1;
|
|
4961
4951
|
}
|
|
4962
4952
|
}
|
|
4963
|
-
function
|
|
4964
|
-
return Xi() ?
|
|
4953
|
+
function Fe(t, e, n) {
|
|
4954
|
+
return Xi() ? Fe = Reflect.construct.bind() : Fe = function(s, i, o) {
|
|
4965
4955
|
var a = [null];
|
|
4966
4956
|
a.push.apply(a, i);
|
|
4967
4957
|
var u = Function.bind.apply(s, a), f = new u();
|
|
4968
4958
|
return o && ge(f, o.prototype), f;
|
|
4969
|
-
},
|
|
4959
|
+
}, Fe.apply(null, arguments);
|
|
4970
4960
|
}
|
|
4971
4961
|
function Yi(t) {
|
|
4972
4962
|
return Function.toString.call(t).indexOf("[native code]") !== -1;
|
|
@@ -4982,7 +4972,7 @@ function yt(t) {
|
|
|
4982
4972
|
e.set(r, s);
|
|
4983
4973
|
}
|
|
4984
4974
|
function s() {
|
|
4985
|
-
return
|
|
4975
|
+
return Fe(r, arguments, pt(this).constructor);
|
|
4986
4976
|
}
|
|
4987
4977
|
return s.prototype = Object.create(r.prototype, {
|
|
4988
4978
|
constructor: {
|
|
@@ -5498,17 +5488,17 @@ var bt = gt(), ue = /* @__PURE__ */ (function() {
|
|
|
5498
5488
|
return ro(g, u, function(d, p) {
|
|
5499
5489
|
var m = d.rule, w = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
|
|
5500
5490
|
w = w && (m.required || !m.required && d.value), m.field = d.field;
|
|
5501
|
-
function v(T,
|
|
5502
|
-
return Z({},
|
|
5491
|
+
function v(T, F) {
|
|
5492
|
+
return Z({}, F, {
|
|
5503
5493
|
fullField: m.fullField + "." + T,
|
|
5504
5494
|
fullFields: m.fullFields ? [].concat(m.fullFields, [T]) : [T]
|
|
5505
5495
|
});
|
|
5506
5496
|
}
|
|
5507
5497
|
function O(T) {
|
|
5508
5498
|
T === void 0 && (T = []);
|
|
5509
|
-
var
|
|
5510
|
-
!u.suppressWarning &&
|
|
5511
|
-
var C =
|
|
5499
|
+
var F = Array.isArray(T) ? T : [T];
|
|
5500
|
+
!u.suppressWarning && F.length && t.warning("async-validator:", F), F.length && m.message !== void 0 && (F = [].concat(m.message));
|
|
5501
|
+
var C = F.map(rn(m, a));
|
|
5512
5502
|
if (u.first && C.length)
|
|
5513
5503
|
return y[m.field] = 1, p(C);
|
|
5514
5504
|
if (!w)
|
|
@@ -5572,8 +5562,8 @@ ue.register = function(e, n) {
|
|
|
5572
5562
|
ue.warning = sr;
|
|
5573
5563
|
ue.messages = bt;
|
|
5574
5564
|
ue.validators = pe;
|
|
5575
|
-
const
|
|
5576
|
-
function
|
|
5565
|
+
const Fo = ue.default || ue;
|
|
5566
|
+
function Po(t, e, n = {}) {
|
|
5577
5567
|
const {
|
|
5578
5568
|
validateOption: r = {},
|
|
5579
5569
|
immediate: s = !0,
|
|
@@ -5584,7 +5574,7 @@ function Fo(t, e, n = {}) {
|
|
|
5584
5574
|
}), l = Q(() => {
|
|
5585
5575
|
var p;
|
|
5586
5576
|
return ((p = a.value) == null ? void 0 : p.fields) || {};
|
|
5587
|
-
}), g = Q(() => new
|
|
5577
|
+
}), g = Q(() => new Fo(oe(e))), b = async () => {
|
|
5588
5578
|
u.value = !1, f.value = !1;
|
|
5589
5579
|
try {
|
|
5590
5580
|
await g.value.validate(o.value, r), f.value = !0, a.value = null;
|
|
@@ -5633,7 +5623,7 @@ const Ee = {
|
|
|
5633
5623
|
max: { en: "Maximum symbols", ru: "Максимальное количество символов" }
|
|
5634
5624
|
};
|
|
5635
5625
|
function Na(t, e, n = "ru") {
|
|
5636
|
-
const r = Q(() => Object.entries(e).reduce((l, [g, b]) => (Array.isArray(b) ?
|
|
5626
|
+
const r = Q(() => Object.entries(e).reduce((l, [g, b]) => (l[g] = Array.isArray(b) ? b.map((y) => typeof y == "function" ? y(n) : y) : [], l), {})), { errorFields: s, isFinished: i, pass: o } = Po(t, r, {
|
|
5637
5627
|
validateOption: { suppressWarning: !0 }
|
|
5638
5628
|
}), a = q(0);
|
|
5639
5629
|
function u() {
|
|
@@ -5660,7 +5650,7 @@ function Ua(t = "ru") {
|
|
|
5660
5650
|
}
|
|
5661
5651
|
function Ia(t = "ru") {
|
|
5662
5652
|
return {
|
|
5663
|
-
validator: (e, n) => /^[a-zA-Zа-яА-ЯёЁ\s-]+$/.test(n) ||
|
|
5653
|
+
validator: (e, n) => /^[a-zA-Zа-яА-ЯёЁ\s-]+$/.test(n) || n.length === 0,
|
|
5664
5654
|
type: "string",
|
|
5665
5655
|
message: Ee.letters[t]
|
|
5666
5656
|
};
|
|
@@ -5758,11 +5748,11 @@ export {
|
|
|
5758
5748
|
La as useCalendar,
|
|
5759
5749
|
Ta as useInfiniteScroll,
|
|
5760
5750
|
pa as useMutation,
|
|
5761
|
-
|
|
5762
|
-
Pa as usePage,
|
|
5751
|
+
Fa as usePage,
|
|
5763
5752
|
ja as usePageLock,
|
|
5764
|
-
|
|
5753
|
+
Pa as usePageNumber,
|
|
5765
5754
|
xa as usePagination,
|
|
5755
|
+
Da as usePwa,
|
|
5766
5756
|
da as useQuery,
|
|
5767
5757
|
Xn as useQueryClient,
|
|
5768
5758
|
qa as useRouteId,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mhz-helpers",
|
|
3
3
|
"description": "Mhz helpers and composables",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.7",
|
|
5
5
|
"author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "vite build",
|
|
21
|
-
"lint": "eslint
|
|
21
|
+
"lint": "eslint **/*.{js,ts}",
|
|
22
22
|
"ts": "vue-tsc --noEmit",
|
|
23
23
|
"test": "vitest run",
|
|
24
24
|
"test:cov": "vitest run --coverage"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"vite-plugin-dts": "4.5.4",
|
|
62
62
|
"vitest": "3.2.4",
|
|
63
63
|
"vue-eslint-parser": "10.2.0",
|
|
64
|
-
"vue-linters-config": "0.4.
|
|
64
|
+
"vue-linters-config": "0.4.2",
|
|
65
65
|
"vue-tsc": "3.0.6"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
File without changes
|