mhz-helpers 1.4.26 → 1.4.28
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/dist/api/index.js +1 -1
- package/dist/{api-v9K4y7eZ.js → api-BlMWo-Ec.js} +19 -12
- package/dist/query/index.js +2 -2
- package/dist/test/index.d.ts +4 -1
- package/dist/test/index.js +4 -1
- package/dist/usePage/index.js +6 -3
- package/dist/usePageLock/index.js +4 -1
- package/dist/useTimer/index.js +16 -14
- package/package.json +11 -11
package/dist/api/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "../api-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "../api-BlMWo-Ec.js";
|
|
2
2
|
export { i as api, n as deleteAuthHeader, r as handleError, t as setAuthHeader, e as setBaseURL };
|
|
@@ -898,7 +898,13 @@ function Mt(e, t, n) {
|
|
|
898
898
|
var Nt = (e) => e instanceof B ? { ...e } : e;
|
|
899
899
|
function W(e, t) {
|
|
900
900
|
t ||= {};
|
|
901
|
-
let n =
|
|
901
|
+
let n = Object.create(null);
|
|
902
|
+
Object.defineProperty(n, "hasOwnProperty", {
|
|
903
|
+
value: Object.prototype.hasOwnProperty,
|
|
904
|
+
enumerable: !1,
|
|
905
|
+
writable: !0,
|
|
906
|
+
configurable: !0
|
|
907
|
+
});
|
|
902
908
|
function r(e, t, n, r) {
|
|
903
909
|
return D.isPlainObject(e) && D.isPlainObject(t) ? D.merge.call({ caseless: r }, e, t) : D.isPlainObject(t) ? D.merge({}, t) : D.isArray(t) ? t.slice() : t;
|
|
904
910
|
}
|
|
@@ -944,6 +950,7 @@ function W(e, t) {
|
|
|
944
950
|
httpsAgent: o,
|
|
945
951
|
cancelToken: o,
|
|
946
952
|
socketPath: o,
|
|
953
|
+
allowedSocketPaths: o,
|
|
947
954
|
responseEncoding: o,
|
|
948
955
|
validateStatus: s,
|
|
949
956
|
headers: (e, t, n) => i(Nt(e), Nt(t), n, !0)
|
|
@@ -960,19 +967,19 @@ function W(e, t) {
|
|
|
960
967
|
//#endregion
|
|
961
968
|
//#region ../../node_modules/axios/lib/helpers/resolveConfig.js
|
|
962
969
|
var Pt = (e) => {
|
|
963
|
-
let t = W({}, e),
|
|
964
|
-
if (t.headers =
|
|
965
|
-
if (P.hasStandardBrowserEnv || P.hasStandardBrowserWebWorkerEnv)
|
|
966
|
-
else if (D.isFunction(
|
|
967
|
-
let e =
|
|
970
|
+
let t = W({}, e), n = (e) => D.hasOwnProp(t, e) ? t[e] : void 0, r = n("data"), i = n("withXSRFToken"), a = n("xsrfHeaderName"), o = n("xsrfCookieName"), s = n("headers"), c = n("auth"), l = n("baseURL"), u = n("allowAbsoluteUrls"), d = n("url");
|
|
971
|
+
if (t.headers = s = B.from(s), t.url = $e(Mt(l, d, u), e.params, e.paramsSerializer), c && s.set("Authorization", "Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))), D.isFormData(r)) {
|
|
972
|
+
if (P.hasStandardBrowserEnv || P.hasStandardBrowserWebWorkerEnv) s.setContentType(void 0);
|
|
973
|
+
else if (D.isFunction(r.getHeaders)) {
|
|
974
|
+
let e = r.getHeaders(), t = ["content-type", "content-length"];
|
|
968
975
|
Object.entries(e).forEach(([e, n]) => {
|
|
969
|
-
t.includes(e.toLowerCase()) &&
|
|
976
|
+
t.includes(e.toLowerCase()) && s.set(e, n);
|
|
970
977
|
});
|
|
971
978
|
}
|
|
972
979
|
}
|
|
973
|
-
if (P.hasStandardBrowserEnv && (D.isFunction(
|
|
974
|
-
let e =
|
|
975
|
-
e &&
|
|
980
|
+
if (P.hasStandardBrowserEnv && (D.isFunction(i) && (i = i(t)), i === !0 || i == null && Ot(t.url))) {
|
|
981
|
+
let e = a && o && kt.read(o);
|
|
982
|
+
e && s.set(a, e);
|
|
976
983
|
}
|
|
977
984
|
return t;
|
|
978
985
|
}, Ft = typeof XMLHttpRequest < "u" && function(e) {
|
|
@@ -1263,7 +1270,7 @@ function $t(e) {
|
|
|
1263
1270
|
}
|
|
1264
1271
|
//#endregion
|
|
1265
1272
|
//#region ../../node_modules/axios/lib/env/data.js
|
|
1266
|
-
var en = "1.15.
|
|
1273
|
+
var en = "1.15.2", J = {};
|
|
1267
1274
|
[
|
|
1268
1275
|
"object",
|
|
1269
1276
|
"boolean",
|
|
@@ -1292,7 +1299,7 @@ function nn(e, t, n) {
|
|
|
1292
1299
|
if (typeof e != "object") throw new O("options must be an object", O.ERR_BAD_OPTION_VALUE);
|
|
1293
1300
|
let r = Object.keys(e), i = r.length;
|
|
1294
1301
|
for (; i-- > 0;) {
|
|
1295
|
-
let a = r[i], o = t[a];
|
|
1302
|
+
let a = r[i], o = Object.prototype.hasOwnProperty.call(t, a) ? t[a] : void 0;
|
|
1296
1303
|
if (o) {
|
|
1297
1304
|
let t = e[a], n = t === void 0 || o(t, a, e);
|
|
1298
1305
|
if (n !== !0) throw new O("option " + a + " must be " + n, O.ERR_BAD_OPTION_VALUE);
|
package/dist/query/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, o as t, r as n, s as r } from "../api-
|
|
1
|
+
import { n as e, o as t, r as n, s as r } from "../api-BlMWo-Ec.js";
|
|
2
2
|
import { logout as i } from "../useAuth/index.js";
|
|
3
3
|
import * as a from "vue";
|
|
4
4
|
//#region ../../node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
@@ -924,7 +924,7 @@ var ge = class extends o {
|
|
|
924
924
|
}
|
|
925
925
|
};
|
|
926
926
|
function _e(e, t) {
|
|
927
|
-
return _(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
927
|
+
return _(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && _(t.retryOnMount, e) === !1);
|
|
928
928
|
}
|
|
929
929
|
function I(e, t) {
|
|
930
930
|
return _e(e, t) || e.state.data !== void 0 && L(e, t, t.refetchOnMount);
|
package/dist/test/index.d.ts
CHANGED
|
@@ -2,4 +2,7 @@ import { NodeTransform } from '@vue/compiler-core';
|
|
|
2
2
|
export declare function dataTest(value: string): string;
|
|
3
3
|
export declare const removeDataTest: NodeTransform;
|
|
4
4
|
export declare function wait(time?: number): Promise<void>;
|
|
5
|
-
export declare function withSetup<T>(composable: () => Promise<T>): Promise<
|
|
5
|
+
export declare function withSetup<T>(composable: () => Promise<T>): Promise<{
|
|
6
|
+
app: import('vue').App<Element>;
|
|
7
|
+
router: import('vue-router').Router;
|
|
8
|
+
}>;
|
package/dist/test/index.js
CHANGED
|
@@ -33,7 +33,10 @@ async function c(a) {
|
|
|
33
33
|
}));
|
|
34
34
|
c.use(o);
|
|
35
35
|
let l = document.createElement("div");
|
|
36
|
-
document.body.append(l), c.mount(l), await s
|
|
36
|
+
return document.body.append(l), c.mount(l), await s, {
|
|
37
|
+
app: c,
|
|
38
|
+
router: o
|
|
39
|
+
};
|
|
37
40
|
}
|
|
38
41
|
//#endregion
|
|
39
42
|
export { a as dataTest, o as removeDataTest, s as wait, c as withSetup };
|
package/dist/usePage/index.js
CHANGED
|
@@ -73,10 +73,13 @@ function s() {
|
|
|
73
73
|
function c(e) {
|
|
74
74
|
o.value = e;
|
|
75
75
|
}
|
|
76
|
-
return n(() =>
|
|
77
|
-
e
|
|
76
|
+
return n(() => a.query.page, (e) => {
|
|
77
|
+
let t = Number(e || 1);
|
|
78
|
+
o.value !== t && (o.value = t);
|
|
79
|
+
}), n(() => o.value, (t) => {
|
|
80
|
+
t !== Number(a.query.page || 1) && e.replace({
|
|
78
81
|
path: a.path,
|
|
79
|
-
query: { page:
|
|
82
|
+
query: { page: t }
|
|
80
83
|
});
|
|
81
84
|
}), {
|
|
82
85
|
page: o,
|
|
@@ -3,7 +3,10 @@ import { onBeforeUnmount as e, onMounted as t, ref as n } from "vue";
|
|
|
3
3
|
function r() {
|
|
4
4
|
let r = n();
|
|
5
5
|
async function i() {
|
|
6
|
-
|
|
6
|
+
a();
|
|
7
|
+
try {
|
|
8
|
+
r.value = await navigator.wakeLock?.request();
|
|
9
|
+
} catch {}
|
|
7
10
|
}
|
|
8
11
|
function a() {
|
|
9
12
|
r.value?.release(), r.value = void 0;
|
package/dist/useTimer/index.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { addZero as e } from "../date/index.js";
|
|
2
|
-
import { computed as t,
|
|
2
|
+
import { computed as t, onBeforeUnmount as n, shallowRef as r } from "vue";
|
|
3
3
|
//#region src/composables/useTimer.ts
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
function c() {
|
|
7
|
-
r.value++, r.value === 60 && (i.value++, r.value = 0);
|
|
8
|
-
}
|
|
4
|
+
function i() {
|
|
5
|
+
let i = r(0), a = r(0), o = t(() => `${e(a.value)}:${e(i.value)}`), s = t(() => a.value * 60 + i.value), c = null;
|
|
9
6
|
function l() {
|
|
10
|
-
|
|
7
|
+
i.value++, i.value === 60 && (a.value++, i.value = 0);
|
|
11
8
|
}
|
|
12
9
|
function u() {
|
|
13
|
-
|
|
10
|
+
c ||= setInterval(l, 1e3);
|
|
11
|
+
}
|
|
12
|
+
function d() {
|
|
13
|
+
c &&= (clearInterval(c), null), i.value = 0, a.value = 0;
|
|
14
14
|
}
|
|
15
|
-
return {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
return n(() => {
|
|
16
|
+
c &&= (clearInterval(c), null);
|
|
17
|
+
}), {
|
|
18
|
+
timer: o,
|
|
19
|
+
duration: s,
|
|
20
|
+
startTimer: u,
|
|
21
|
+
stopTimer: d
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
//#endregion
|
|
23
|
-
export {
|
|
25
|
+
export { i as useTimer };
|
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.4.
|
|
4
|
+
"version": "1.4.28",
|
|
5
5
|
"author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"test:cov": "NODE_OPTIONS='--no-experimental-webstorage' vitest run --coverage"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@tanstack/vue-query": "5.
|
|
27
|
+
"@tanstack/vue-query": "5.100.1",
|
|
28
28
|
"@vueuse/core": "14.2.1",
|
|
29
29
|
"@vueuse/integrations": "14.2.1",
|
|
30
30
|
"async-validator": "4.2.5",
|
|
31
|
-
"axios": "1.15.
|
|
31
|
+
"axios": "1.15.2",
|
|
32
32
|
"vue": "3.6.0-beta.10",
|
|
33
|
-
"vue-router": "5.0.
|
|
33
|
+
"vue-router": "5.0.6"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@eslint/js": "10.0.1",
|
|
37
37
|
"@types/node": "25.6.0",
|
|
38
38
|
"@vitejs/plugin-vue": "6.0.6",
|
|
39
|
-
"@vitest/coverage-v8": "4.1.
|
|
39
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
40
40
|
"eslint": "10.2.1",
|
|
41
41
|
"eslint-config-prettier": "10.1.8",
|
|
42
42
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
@@ -44,29 +44,29 @@
|
|
|
44
44
|
"eslint-plugin-prettier": "5.5.5",
|
|
45
45
|
"eslint-plugin-sonarjs": "4.0.3",
|
|
46
46
|
"eslint-plugin-unicorn": "64.0.0",
|
|
47
|
-
"eslint-plugin-vue": "10.
|
|
47
|
+
"eslint-plugin-vue": "10.9.0",
|
|
48
48
|
"globals": "17.5.0",
|
|
49
49
|
"happy-dom": "20.9.0",
|
|
50
50
|
"postcss-html": "1.8.1",
|
|
51
51
|
"prettier": "3.8.3",
|
|
52
|
-
"stylelint": "17.
|
|
52
|
+
"stylelint": "17.9.0",
|
|
53
53
|
"stylelint-config-recess-order": "7.7.0",
|
|
54
54
|
"stylelint-config-recommended-scss": "17.0.1",
|
|
55
55
|
"stylelint-config-recommended-vue": "1.6.1",
|
|
56
56
|
"stylelint-order": "8.1.1",
|
|
57
57
|
"stylelint-prettier": "5.0.3",
|
|
58
58
|
"typescript": "6.0.3",
|
|
59
|
-
"typescript-eslint": "8.
|
|
60
|
-
"vite": "8.0.
|
|
59
|
+
"typescript-eslint": "8.59.0",
|
|
60
|
+
"vite": "8.0.10",
|
|
61
61
|
"vite-plugin-dts": "4.5.4",
|
|
62
|
-
"vitest": "4.1.
|
|
62
|
+
"vitest": "4.1.5",
|
|
63
63
|
"vue-eslint-parser": "10.4.0",
|
|
64
64
|
"vue-linters-config": "0.5.7",
|
|
65
65
|
"vue-tsc": "3.2.7"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"vue": "3.6.0-beta.10",
|
|
69
|
-
"vue-router": "5.0.
|
|
69
|
+
"vue-router": "5.0.6"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"npm": ">=11.7.0",
|