rc-lib-ui 1.4.0 → 1.4.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/dist/control-cards.js +1 -1
- package/dist/hooks.js +6 -6
- package/dist/{index-DWH7tN5F.js → index-sxz_mdqa.js} +50 -42
- package/dist/socket.js +1 -1
- package/package.json +2 -2
package/dist/control-cards.js
CHANGED
|
@@ -8,7 +8,7 @@ import { Box as M, styled as P, Card as xn, Typography as j, Button as yn, Linea
|
|
|
8
8
|
import Ve from "classnames";
|
|
9
9
|
import { createPortal as Un } from "react-dom";
|
|
10
10
|
import { Save as Yn, Close as ge, Delete as Gn, InfoOutlined as Kn, VerifiedUser as Zn, CheckCircle as bn, TaskAlt as Qn } from "@mui/icons-material";
|
|
11
|
-
import { C as Jn } from "./index-
|
|
11
|
+
import { C as Jn } from "./index-sxz_mdqa.js";
|
|
12
12
|
import './control-cards.css';const En = $n(void 0), et = () => {
|
|
13
13
|
const e = hn(En);
|
|
14
14
|
if (!e)
|
package/dist/hooks.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { T as h } from "./index-
|
|
1
|
+
import { useState as T, useRef as l, useEffect as p, useCallback as r } from "react";
|
|
2
|
+
import { T as h } from "./index-sxz_mdqa.js";
|
|
3
3
|
import { s as d } from "./index-B7GqTJat.js";
|
|
4
4
|
const k = ({ defaultIsActive: s = !0, timer: c = 5e3, onDeActive: n, isDefaultPause: u = !1 }) => {
|
|
5
|
-
const [t, a] =
|
|
5
|
+
const [t, a] = T({
|
|
6
6
|
isActive: s
|
|
7
|
-
}), i = d(t, a), e =
|
|
7
|
+
}), i = d(t, a), e = l(null);
|
|
8
8
|
p(() => (e.current = new h(c, () => {
|
|
9
9
|
n && n(), i({ isActive: !1 });
|
|
10
|
-
}), s &&
|
|
10
|
+
}), s && e.current.startTime(), u && e.current.pauseTime(), () => {
|
|
11
11
|
e.current && e.current.resetTime();
|
|
12
12
|
}), [c]);
|
|
13
13
|
const m = r(() => {
|
|
@@ -17,7 +17,7 @@ const k = ({ defaultIsActive: s = !0, timer: c = 5e3, onDeActive: n, isDefaultPa
|
|
|
17
17
|
}, [t.isActive]), o = r(() => {
|
|
18
18
|
e.current && t.isActive && e.current.pauseTime();
|
|
19
19
|
}, [t.isActive]), v = r(() => {
|
|
20
|
-
e.current && t.isActive && e.current.
|
|
20
|
+
e.current && t.isActive && e.current.resumeTime();
|
|
21
21
|
}, [t.isActive]), A = r(() => {
|
|
22
22
|
i({ isActive: !1 }), e.current && e.current.resetTime();
|
|
23
23
|
}, []);
|
|
@@ -1414,7 +1414,7 @@ const resolveConfig = (t) => {
|
|
|
1414
1414
|
return;
|
|
1415
1415
|
const S = AxiosHeaders$1.from(
|
|
1416
1416
|
"getAllResponseHeaders" in f && f.getAllResponseHeaders()
|
|
1417
|
-
),
|
|
1417
|
+
), A = {
|
|
1418
1418
|
data: !i || i === "text" || i === "json" ? f.responseText : f.response,
|
|
1419
1419
|
status: f.status,
|
|
1420
1420
|
statusText: f.statusText,
|
|
@@ -1426,7 +1426,7 @@ const resolveConfig = (t) => {
|
|
|
1426
1426
|
e(R), p();
|
|
1427
1427
|
}, function(R) {
|
|
1428
1428
|
r(R), p();
|
|
1429
|
-
},
|
|
1429
|
+
}, A), f = null;
|
|
1430
1430
|
}
|
|
1431
1431
|
"onloadend" in f ? f.onloadend = w : f.onreadystatechange = function() {
|
|
1432
1432
|
!f || f.readyState !== 4 || f.status === 0 && !(f.responseURL && f.responseURL.indexOf("file:") === 0) || setTimeout(w);
|
|
@@ -1436,15 +1436,15 @@ const resolveConfig = (t) => {
|
|
|
1436
1436
|
r(new AxiosError("Network Error", AxiosError.ERR_NETWORK, t, f)), f = null;
|
|
1437
1437
|
}, f.ontimeout = function() {
|
|
1438
1438
|
let S = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded";
|
|
1439
|
-
const
|
|
1439
|
+
const A = n.transitional || transitionalDefaults;
|
|
1440
1440
|
n.timeoutErrorMessage && (S = n.timeoutErrorMessage), r(new AxiosError(
|
|
1441
1441
|
S,
|
|
1442
|
-
|
|
1442
|
+
A.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
|
1443
1443
|
t,
|
|
1444
1444
|
f
|
|
1445
1445
|
)), f = null;
|
|
1446
|
-
}, o === void 0 && s.setContentType(null), "setRequestHeader" in f && utils$1.forEach(s.toJSON(), function(S,
|
|
1447
|
-
f.setRequestHeader(
|
|
1446
|
+
}, o === void 0 && s.setContentType(null), "setRequestHeader" in f && utils$1.forEach(s.toJSON(), function(S, A) {
|
|
1447
|
+
f.setRequestHeader(A, S);
|
|
1448
1448
|
}), utils$1.isUndefined(n.withCredentials) || (f.withCredentials = !!n.withCredentials), i && i !== "json" && (f.responseType = n.responseType), l && ([g, m] = progressEventReducer(l, !0), f.addEventListener("progress", g)), a && f.upload && ([d, b] = progressEventReducer(a), f.upload.addEventListener("progress", d), f.upload.addEventListener("loadend", b)), (n.cancelToken || n.signal) && (u = (S) => {
|
|
1449
1449
|
f && (r(!S || S.type ? new CanceledError(null, t, f) : S), f.abort(), f = null);
|
|
1450
1450
|
}, n.cancelToken && n.cancelToken.subscribe(u), n.signal && (n.signal.aborted ? u() : n.signal.addEventListener("abort", u)));
|
|
@@ -1623,8 +1623,8 @@ const getBodyLength = async (t) => {
|
|
|
1623
1623
|
credentials: v ? g : void 0
|
|
1624
1624
|
});
|
|
1625
1625
|
let S = await fetch(p);
|
|
1626
|
-
const
|
|
1627
|
-
if (supportsResponseStream && (a ||
|
|
1626
|
+
const A = supportsResponseStream && (u === "stream" || u === "response");
|
|
1627
|
+
if (supportsResponseStream && (a || A && f)) {
|
|
1628
1628
|
const D = {};
|
|
1629
1629
|
["status", "statusText", "headers"].forEach((_) => {
|
|
1630
1630
|
D[_] = S[_];
|
|
@@ -1642,7 +1642,7 @@ const getBodyLength = async (t) => {
|
|
|
1642
1642
|
}
|
|
1643
1643
|
u = u || "text";
|
|
1644
1644
|
let R = await resolvers[utils$1.findKey(resolvers, u) || "text"](S, t);
|
|
1645
|
-
return !
|
|
1645
|
+
return !A && f && f(), await new Promise((D, C) => {
|
|
1646
1646
|
settle(D, C, {
|
|
1647
1647
|
data: R,
|
|
1648
1648
|
headers: AxiosHeaders$1.from(S.headers),
|
|
@@ -2186,29 +2186,29 @@ class SaveRequest {
|
|
|
2186
2186
|
return r.some((n) => n.url === e);
|
|
2187
2187
|
}
|
|
2188
2188
|
}
|
|
2189
|
-
const
|
|
2189
|
+
const T = class {
|
|
2190
2190
|
};
|
|
2191
|
-
c(
|
|
2191
|
+
c(T, "events", (t, e, r, n = "") => new Promise((o, s) => {
|
|
2192
2192
|
let i = 0;
|
|
2193
2193
|
for (let [a, l] of r)
|
|
2194
2194
|
i++, t === "add" ? e.addEventListener(a, l) : e.removeEventListener(a, l), i === r.length && o("");
|
|
2195
|
-
})), c(
|
|
2196
|
-
t.sort((r, n) =>
|
|
2197
|
-
}), c(
|
|
2198
|
-
}), c(
|
|
2199
|
-
let [e, r] =
|
|
2195
|
+
})), c(T, "sortDataByAlphabet", (t, e) => t.sort((r, n) => n[e].trim() < r[e].trim() ? 1 : -1)), c(T, "sortDataByDate", (t, e) => {
|
|
2196
|
+
t.sort((r, n) => T.hasDateLessPeriod(n[e], r[e]) ? 1 : -1);
|
|
2197
|
+
}), c(T, "sortDataByDateAndTime", (t, e) => {
|
|
2198
|
+
}), c(T, "splitDateFromTime", (t) => t.split(" ")), c(T, "reverseDate", (t) => {
|
|
2199
|
+
let [e, r] = T.splitDateFromTime(t);
|
|
2200
2200
|
return e.split(".").reverse().join("-");
|
|
2201
|
-
}), c(
|
|
2201
|
+
}), c(T, "correctionDataISO8601", (t) => {
|
|
2202
2202
|
let e = "";
|
|
2203
2203
|
if (/^\d{2}\.\d{2}\.\d{4}$/.test(t) || /^\d{2}\.\d{2}\.\d{4}\s\d{2}:\d{2}$/.test(t))
|
|
2204
|
-
e =
|
|
2204
|
+
e = T.reverseDate(t);
|
|
2205
2205
|
else if (/^\d{4}-\d{2}-\d{2}$/.test(t))
|
|
2206
2206
|
e = t;
|
|
2207
2207
|
else
|
|
2208
2208
|
throw new Error(`функция correctionDataISO8601 >> date не корректна: ${t}. Требуется один из форматов: дд.мм.гггг | дд.мм.гггг мм:чч | гггг-мм-дд `);
|
|
2209
2209
|
return e;
|
|
2210
|
-
}), c(
|
|
2211
|
-
if (t =
|
|
2210
|
+
}), c(T, "hasDateLessPeriod", (t, e, r) => {
|
|
2211
|
+
if (t = T.correctionDataISO8601(t), e = T.correctionDataISO8601(e), !r || r && !r.dateMinMax || (r == null ? void 0 : r.dateMinMax) === "<=")
|
|
2212
2212
|
return Math.floor(Number(new Date(t))) <= Math.floor(Number(new Date(e)));
|
|
2213
2213
|
if (r && (r == null ? void 0 : r.dateMinMax) === ">=")
|
|
2214
2214
|
return Math.floor(Number(new Date(t))) >= Math.floor(Number(new Date(e)));
|
|
@@ -2216,31 +2216,31 @@ c(x, "events", (t, e, r, n = "") => new Promise((o, s) => {
|
|
|
2216
2216
|
return Math.floor(Number(new Date(t))) < Math.floor(Number(new Date(e)));
|
|
2217
2217
|
if (r && (r == null ? void 0 : r.dateMinMax) === ">")
|
|
2218
2218
|
return Math.floor(Number(new Date(t))) > Math.floor(Number(new Date(e)));
|
|
2219
|
-
}), c(
|
|
2219
|
+
}), c(T, "getEndsWithArr", (t, e) => t.slice(-e)), c(T, "deepMerge", (...t) => {
|
|
2220
2220
|
const e = {}, r = (n) => {
|
|
2221
2221
|
for (const o in n)
|
|
2222
|
-
Object.prototype.hasOwnProperty.call(n, o) && (Object.prototype.toString.call(n[o]) === "[object Object]" ? e[o] =
|
|
2222
|
+
Object.prototype.hasOwnProperty.call(n, o) && (Object.prototype.toString.call(n[o]) === "[object Object]" ? e[o] = T.deepMerge(e[o], n[o]) : e[o] = n[o]);
|
|
2223
2223
|
};
|
|
2224
2224
|
for (let n = 0; n < t.length; n++)
|
|
2225
2225
|
r(t[n]);
|
|
2226
2226
|
return e;
|
|
2227
|
-
}), c(
|
|
2227
|
+
}), c(T, "isJSON", (t) => {
|
|
2228
2228
|
try {
|
|
2229
2229
|
JSON.parse(t);
|
|
2230
2230
|
} catch {
|
|
2231
2231
|
return !1;
|
|
2232
2232
|
}
|
|
2233
2233
|
return !0;
|
|
2234
|
-
}), c(
|
|
2234
|
+
}), c(T, "filterItems", (t, e, r) => t.filter((n) => n[(r == null ? void 0 : r.filteKey) || "name"].toLowerCase().includes(e.toLowerCase()))), c(T, "sortByOnline", (t) => {
|
|
2235
2235
|
const e = [], r = [];
|
|
2236
2236
|
for (let s = 0; t.length > s; s++) {
|
|
2237
2237
|
const i = t[s];
|
|
2238
2238
|
i.online ? e.push(i) : r.push(i);
|
|
2239
2239
|
}
|
|
2240
|
-
const n =
|
|
2240
|
+
const n = T.sortDataByAlphabet(e, "name"), o = T.sortDataByAlphabet(r, "name");
|
|
2241
2241
|
return [...n, ...o];
|
|
2242
2242
|
});
|
|
2243
|
-
let Utils =
|
|
2243
|
+
let Utils = T;
|
|
2244
2244
|
const E = class L {
|
|
2245
2245
|
constructor() {
|
|
2246
2246
|
c(this, "getDecodingError", () => ({
|
|
@@ -2287,7 +2287,7 @@ c(E, "keyCookie", "AuthCookie"), c(E, "cookieOptions", {}), c(E, "registerReques
|
|
|
2287
2287
|
s = { ...s, statusCode: f, data: w, res: m }, f === 200 && p && (E.saveToken(p), s.data = { ...s.data, token: p }), r(s);
|
|
2288
2288
|
},
|
|
2289
2289
|
(m) => {
|
|
2290
|
-
const p = E.errorsHandler.handleError(m), { url: f, status: w, headers: v, error: S, ...
|
|
2290
|
+
const p = E.errorsHandler.handleError(m), { url: f, status: w, headers: v, error: S, ...A } = m, R = typeof S == "string" ? Utils.isJSON(S.trim()) : !1, D = {
|
|
2291
2291
|
headers: v,
|
|
2292
2292
|
status: w,
|
|
2293
2293
|
message: ""
|
|
@@ -2306,7 +2306,7 @@ c(E, "keyCookie", "AuthCookie"), c(E, "cookieOptions", {}), c(E, "registerReques
|
|
|
2306
2306
|
const m = b.status, p = b == null ? void 0 : b.data;
|
|
2307
2307
|
s = { ...s, statusCode: m, data: p, res: b }, r(s);
|
|
2308
2308
|
}).catch((b) => {
|
|
2309
|
-
const m = E.errorsHandler.handleError(b), { code: p, config: f, status: w, message: v, response: S, stack:
|
|
2309
|
+
const m = E.errorsHandler.handleError(b), { code: p, config: f, status: w, message: v, response: S, stack: A } = b, R = {
|
|
2310
2310
|
code: p,
|
|
2311
2311
|
config: f,
|
|
2312
2312
|
status: w || l,
|
|
@@ -2314,7 +2314,7 @@ c(E, "keyCookie", "AuthCookie"), c(E, "cookieOptions", {}), c(E, "registerReques
|
|
|
2314
2314
|
headers: S == null ? void 0 : S.headers,
|
|
2315
2315
|
statusText: S == null ? void 0 : S.statusText,
|
|
2316
2316
|
data: S == null ? void 0 : S.data,
|
|
2317
|
-
stack:
|
|
2317
|
+
stack: A
|
|
2318
2318
|
};
|
|
2319
2319
|
n({ ...d, ...m, errExt: R });
|
|
2320
2320
|
});
|
|
@@ -2443,21 +2443,21 @@ class EventSubscribers {
|
|
|
2443
2443
|
});
|
|
2444
2444
|
}
|
|
2445
2445
|
}
|
|
2446
|
-
const y = class
|
|
2446
|
+
const y = class x {
|
|
2447
2447
|
static setState(e) {
|
|
2448
|
-
|
|
2448
|
+
x.state = { ...x.state, ...e };
|
|
2449
2449
|
}
|
|
2450
2450
|
static getState() {
|
|
2451
|
-
return
|
|
2451
|
+
return x.state;
|
|
2452
2452
|
}
|
|
2453
2453
|
static getIsNetwork() {
|
|
2454
|
-
return
|
|
2454
|
+
return x.state.isNetworkStatus;
|
|
2455
2455
|
}
|
|
2456
2456
|
static request({ keyAction: e, request: r }) {
|
|
2457
2457
|
const { url: n, ...o } = r;
|
|
2458
2458
|
return new Promise((s, i) => {
|
|
2459
|
-
|
|
2460
|
-
const a =
|
|
2459
|
+
x.getIsInit() || x.init();
|
|
2460
|
+
const a = x.getIsNetwork(), l = {
|
|
2461
2461
|
url: n,
|
|
2462
2462
|
keyAction: e,
|
|
2463
2463
|
isErr: !a,
|
|
@@ -2466,7 +2466,7 @@ const y = class A {
|
|
|
2466
2466
|
statusCode: a ? 0 : 520,
|
|
2467
2467
|
isReload: !1
|
|
2468
2468
|
};
|
|
2469
|
-
if (
|
|
2469
|
+
if (x.events.publish("fetch", l), a) {
|
|
2470
2470
|
apiRequest.requestInServer(n, o).then((u) => {
|
|
2471
2471
|
const d = {
|
|
2472
2472
|
isReq: !1,
|
|
@@ -2476,7 +2476,7 @@ const y = class A {
|
|
|
2476
2476
|
msg: "",
|
|
2477
2477
|
...u
|
|
2478
2478
|
};
|
|
2479
|
-
|
|
2479
|
+
x.events.publish("fetch", d), s(d);
|
|
2480
2480
|
}).catch((u) => {
|
|
2481
2481
|
const d = {
|
|
2482
2482
|
//TODO: Проверить. dataErr не верно возвращает
|
|
@@ -2485,11 +2485,11 @@ const y = class A {
|
|
|
2485
2485
|
keyAction: e,
|
|
2486
2486
|
...u
|
|
2487
2487
|
};
|
|
2488
|
-
|
|
2488
|
+
x.events.publish("fetch", d), i(d);
|
|
2489
2489
|
});
|
|
2490
2490
|
return;
|
|
2491
2491
|
}
|
|
2492
|
-
|
|
2492
|
+
x.events.publish("fetch", l), i(l);
|
|
2493
2493
|
});
|
|
2494
2494
|
}
|
|
2495
2495
|
};
|
|
@@ -2725,12 +2725,20 @@ class Timer {
|
|
|
2725
2725
|
this.duration = e, this.remainingTime = e, this.onComplete = r;
|
|
2726
2726
|
}
|
|
2727
2727
|
/**
|
|
2728
|
-
* Запускает
|
|
2728
|
+
* Запускает таймер
|
|
2729
2729
|
*/
|
|
2730
2730
|
startTime() {
|
|
2731
|
-
this.timerId
|
|
2731
|
+
this.timerId === null && (this.isPaused || (this.startTimeCount = Date.now(), this.timerId = setTimeout(() => {
|
|
2732
2732
|
this.complete();
|
|
2733
|
-
}, this.remainingTime));
|
|
2733
|
+
}, this.remainingTime)));
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* Возобновляет таймер после паузы
|
|
2737
|
+
*/
|
|
2738
|
+
resumeTime() {
|
|
2739
|
+
this.timerId === null && this.isPaused && (this.startTimeCount = Date.now(), this.timerId = setTimeout(() => {
|
|
2740
|
+
this.complete();
|
|
2741
|
+
}, this.remainingTime), this.isPaused = !1);
|
|
2734
2742
|
}
|
|
2735
2743
|
/**
|
|
2736
2744
|
* Ставит таймер на паузу
|
package/dist/socket.js
CHANGED
|
@@ -7,7 +7,7 @@ import { c as U } from "./react-CLnE01WS.js";
|
|
|
7
7
|
import { styled as M, Collapse as G } from "@mui/material";
|
|
8
8
|
import L from "classnames";
|
|
9
9
|
import { u as W } from "./browser-DJTk47DY.js";
|
|
10
|
-
import { N as $ } from "./index-
|
|
10
|
+
import { N as $ } from "./index-sxz_mdqa.js";
|
|
11
11
|
const T = {
|
|
12
12
|
statusConnect: "disconnect",
|
|
13
13
|
isOfflineSocket: !1,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rc-lib-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.1",
|
|
5
5
|
"author": "SinGlEBW",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"build:dev": "node buildEditVersion.js"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"dev-classes": "^1.5.
|
|
62
|
+
"dev-classes": "^1.5.8",
|
|
63
63
|
"notistack": "^3.0.2",
|
|
64
64
|
"react-transition-group": "^4.4.5",
|
|
65
65
|
"uuid4": "^2.0.3",
|