dev-classes 1.0.10 → 1.0.12
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/classes/DateProcessing/DateProcessing.d.ts +80 -0
- package/dist/classes/DateProcessing/DateProcessing.js +108 -0
- package/dist/classes/{Numbers.d.ts → Numbers/Numbers.d.ts} +1 -0
- package/dist/classes/{Numbers.js → Numbers/Numbers.js} +9 -2
- package/dist/classes/SocketApi/SocketApi.js +27 -19
- package/dist/classes/SocketApi/deps/ConfigInfoConnect/ConfigInfoConnect.d.ts +2 -0
- package/dist/classes/SocketApi/deps/ConfigInfoConnect/ConfigInfoConnect.types.d.ts +7 -0
- package/dist/classes/SocketApi/deps/WsApi/WsApi.d.ts +2 -2
- package/dist/classes/SocketApi/deps/WsApi/WsApi.js +1 -1
- package/dist/classes/SocketApi/deps/WsApi/WsApi.types.d.ts +17 -0
- package/dist/classes/SocketApi/deps/WsApi/index.d.ts +1 -1
- package/dist/classes/{Utils.d.ts → Utils/Utils.d.ts} +4 -2
- package/dist/classes/{Utils.js → Utils/Utils.js} +11 -12
- package/dist/index.d.ts +8 -9
- package/dist/index.js +17 -24
- package/package.json +1 -1
- package/dist/browser-DJTk47DY.js +0 -12
- package/dist/classes/DateProcessing.d.ts +0 -63
- package/dist/classes/DateProcessing.js +0 -127
- package/dist/classes/Lodash.d.ts +0 -4
- package/dist/classes/Lodash.js +0 -9
- /package/dist/classes/{Color.d.ts → Color/Color.d.ts} +0 -0
- /package/dist/classes/{Color.js → Color/Color.js} +0 -0
- /package/dist/classes/{ControlAppBySocket.d.ts → ControlAppBySocket/ControlAppBySocket.d.ts} +0 -0
- /package/dist/classes/{ControlAppBySocket.js → ControlAppBySocket/ControlAppBySocket.js} +0 -0
- /package/dist/classes/{Delay.d.ts → Delay/Delay.d.ts} +0 -0
- /package/dist/classes/{Delay.js → Delay/Delay.js} +0 -0
- /package/dist/classes/{DownloadFile.d.ts → DownloadFile/DownloadFile.d.ts} +0 -0
- /package/dist/classes/{DownloadFile.js → DownloadFile/DownloadFile.js} +0 -0
- /package/dist/classes/{ProcessingWS.d.ts → ProcessingWS/ProcessingWS.d.ts} +0 -0
- /package/dist/classes/{ProcessingWS.js → ProcessingWS/ProcessingWS.js} +0 -0
- /package/dist/classes/SocketApi/deps/ConfigInfoConnect/{types.d.js → ConfigInfoConnect.types.js} +0 -0
- /package/dist/classes/SocketApi/deps/WsApi/{types.d.js → WsApi.types.js} +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare const itemsMonths: readonly ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"];
|
|
2
|
+
declare const itemsWeek: readonly ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"];
|
|
3
|
+
export interface DateProcessingI {
|
|
4
|
+
getActiveColorClassInDiffDate(a: string, b: string, c: string): string;
|
|
5
|
+
getClassByDifferenceDay(a: string, b: {
|
|
6
|
+
className: string;
|
|
7
|
+
diffDay: number;
|
|
8
|
+
}[]): string;
|
|
9
|
+
getMinMaxDate(a: string, b: string, c: string): Record<'minDate' | 'maxDate' | 'minMaxMonth', string>;
|
|
10
|
+
splitDateFromTime(a: string): string[];
|
|
11
|
+
getCorrectDateAndTime(a: string): [string, string];
|
|
12
|
+
reverseDate(a: string): string;
|
|
13
|
+
correctionDataISO8601(a: string): string;
|
|
14
|
+
isDateDMY(a: string): boolean;
|
|
15
|
+
correctionDateAndRemoveYear(a: string, b?: Partial<{
|
|
16
|
+
isYear: boolean;
|
|
17
|
+
}>): string;
|
|
18
|
+
correctionDateWithOutCurrentYear(a: string, b?: Partial<{
|
|
19
|
+
shortYear: boolean;
|
|
20
|
+
}>): string;
|
|
21
|
+
correctionShortYear(a: string): string;
|
|
22
|
+
correctionDate(a: string, b?: Partial<Record<'isRemoveYear' | 'shortYear' | 'withOutCurrentYear', boolean>>): string;
|
|
23
|
+
hasDateLessPeriod(a: string, b: string, c?: {
|
|
24
|
+
dateMinMax: '<=' | '>=' | '<' | '>';
|
|
25
|
+
}): boolean;
|
|
26
|
+
hasDateLessPeriods(a: string, b: string, c: string, d?: {
|
|
27
|
+
dateMinMax: '<=' | '>=' | '<' | '>';
|
|
28
|
+
}): Record<'one' | 'two', boolean>;
|
|
29
|
+
getDi(a: string, b: string): number;
|
|
30
|
+
getDifferenceDates(a: string, b: string): number;
|
|
31
|
+
hasDateLessInNumber(a: string, b: string, c: number): boolean;
|
|
32
|
+
correctionCurrentYear(a: [string], b?: number): string[];
|
|
33
|
+
getChunkFromDate(a: string, b: 'day' | 'month' | 'year', c?: {
|
|
34
|
+
isBeforeZero: boolean;
|
|
35
|
+
}): string;
|
|
36
|
+
getNameMonthByNumber(a: number): (typeof itemsMonths)[number];
|
|
37
|
+
minMaxMountStr(a: Record<'minDate' | 'maxDate', string>): {
|
|
38
|
+
minMaxMonth: string;
|
|
39
|
+
};
|
|
40
|
+
getDatesToCurrentDate(a: string[]): string[];
|
|
41
|
+
getDayOfWeek(a: string): (typeof itemsWeek)[number] | null;
|
|
42
|
+
cropSecond(a: string): string;
|
|
43
|
+
getRenderDate(a: string, b?: {
|
|
44
|
+
withOutCurrentYear: boolean;
|
|
45
|
+
}): 'Сегодня' | 'Вчера' | 'Позавчера' | string;
|
|
46
|
+
getCurrentDate(): string;
|
|
47
|
+
getDaysInMonth(a: number, b: number): number;
|
|
48
|
+
getCurrentYear(): number;
|
|
49
|
+
}
|
|
50
|
+
export declare class DateProcessing {
|
|
51
|
+
static getActiveColorClassInDiffDate: DateProcessingI['getActiveColorClassInDiffDate'];
|
|
52
|
+
static getClassByDifferenceDay: DateProcessingI['getClassByDifferenceDay'];
|
|
53
|
+
static getMinMaxDate: DateProcessingI['getMinMaxDate'];
|
|
54
|
+
static splitDateFromTime: DateProcessingI['splitDateFromTime'];
|
|
55
|
+
static getCorrectDateAndTime: DateProcessingI['getCorrectDateAndTime'];
|
|
56
|
+
static reverseDate: DateProcessingI['reverseDate'];
|
|
57
|
+
static correctionDataISO8601: DateProcessingI['correctionDataISO8601'];
|
|
58
|
+
static isDateDMY: DateProcessingI['isDateDMY'];
|
|
59
|
+
static isDateISO8601: (date: string) => boolean;
|
|
60
|
+
static correctionDateAndRemoveYear: DateProcessingI['correctionDateAndRemoveYear'];
|
|
61
|
+
static correctionDateWithOutCurrentYear: DateProcessingI['correctionDateWithOutCurrentYear'];
|
|
62
|
+
static correctionShortYear: DateProcessingI['correctionShortYear'];
|
|
63
|
+
static correctionDate: DateProcessingI['correctionDate'];
|
|
64
|
+
static hasDateLessPeriod: DateProcessingI['hasDateLessPeriod'];
|
|
65
|
+
static hasDateLessPeriods: DateProcessingI['hasDateLessPeriods'];
|
|
66
|
+
static getDifferenceDates: DateProcessingI['getDifferenceDates'];
|
|
67
|
+
static hasDateLessInNumber: DateProcessingI['hasDateLessInNumber'];
|
|
68
|
+
static correctionCurrentYear: DateProcessingI['correctionCurrentYear'];
|
|
69
|
+
static getChunkFromDate: DateProcessingI['getChunkFromDate'];
|
|
70
|
+
static getNameMonthByNumber: DateProcessingI['getNameMonthByNumber'];
|
|
71
|
+
static minMaxMountStr: DateProcessingI['minMaxMountStr'];
|
|
72
|
+
static getDatesToCurrentDate: DateProcessingI['getDatesToCurrentDate'];
|
|
73
|
+
static getDayOfWeek: DateProcessingI['getDayOfWeek'];
|
|
74
|
+
static cropSecond: DateProcessingI['cropSecond'];
|
|
75
|
+
static getRenderDate: DateProcessingI['getRenderDate'];
|
|
76
|
+
static getCurrentDate: DateProcessingI['getCurrentDate'];
|
|
77
|
+
static getCurrentYear: DateProcessingI['getCurrentYear'];
|
|
78
|
+
static getDaysInMonth: DateProcessingI['getDaysInMonth'];
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var D = (e, t, r) => t in e ? o(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var a = (e, t, r) => (D(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
const itemsMonths = ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"], itemsWeek = ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"], _DateProcessing = class _DateProcessing {
|
|
5
|
+
};
|
|
6
|
+
a(_DateProcessing, "getActiveColorClassInDiffDate", (e, t, r) => {
|
|
7
|
+
let s = "";
|
|
8
|
+
return e && t && _DateProcessing.hasDateLessPeriod(e, t) && (s = r), s;
|
|
9
|
+
}), a(_DateProcessing, "getClassByDifferenceDay", (e, t) => {
|
|
10
|
+
let r = "", s = t.sort((n, c) => n.diffDay - c.diffDay);
|
|
11
|
+
for (let n = 0; n < s.length; n++) {
|
|
12
|
+
let c = s[n];
|
|
13
|
+
const i = _DateProcessing.getDifferenceDates(e, _DateProcessing.getCurrentDate());
|
|
14
|
+
if (c.diffDay < i) {
|
|
15
|
+
r = c.className;
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return r;
|
|
20
|
+
}), a(_DateProcessing, "getMinMaxDate", (e, t, r) => {
|
|
21
|
+
let s = { minDate: "", maxDate: "", minMaxMonth: "" };
|
|
22
|
+
return /^\d{2}\.\d{2}\.\d{4}$/.test(e) || /^\d{2}\.\d{2}$/.test(e) ? (!t && !r ? (s.minDate = e, s.maxDate = e) : t ? r ? t && r && (s.minDate = _DateProcessing.hasDateLessPeriod(e, t, { dateMinMax: "<=" }) ? e : t, s.maxDate = _DateProcessing.hasDateLessPeriod(e, r, { dateMinMax: ">=" }) ? e : r) : (s.minDate = _DateProcessing.hasDateLessPeriod(e, t, { dateMinMax: "<=" }) ? e : t, s.maxDate = e) : (s.minDate = e, s.maxDate = _DateProcessing.hasDateLessPeriod(e, r, { dateMinMax: ">=" }) ? e : r), { ...s, ..._DateProcessing.minMaxMountStr(s) }) : (console.error('функция getMinMaxDate >> формат дат не соответствует формату: "дд.мм.гггг"'), { minDate: t, maxDate: r, ..._DateProcessing.minMaxMountStr(s) });
|
|
23
|
+
}), a(_DateProcessing, "splitDateFromTime", (e) => e.split(e.includes("T") ? "T" : " ")), a(_DateProcessing, "getCorrectDateAndTime", (e) => {
|
|
24
|
+
let t = e.match(/\D/), r, s;
|
|
25
|
+
t && t[0] === ":" ? [r, s] = _DateProcessing.splitDateFromTime(e) : [s, r] = _DateProcessing.splitDateFromTime(e), s = _DateProcessing.correctionDateAndRemoveYear(s, { isYear: !0 });
|
|
26
|
+
let n = r.split(":");
|
|
27
|
+
return n.length === 3 && (n.length = 2, r = n.join(":")), [s, r];
|
|
28
|
+
}), a(_DateProcessing, "reverseDate", (e) => e.split("-").reverse().join("-")), a(_DateProcessing, "correctionDataISO8601", (e) => {
|
|
29
|
+
let t = "";
|
|
30
|
+
if (_DateProcessing.isDateDMY(e)) {
|
|
31
|
+
let [r, s] = _DateProcessing.splitDateFromTime(e);
|
|
32
|
+
t = r.split(".").reverse().join("-");
|
|
33
|
+
} else if (_DateProcessing.isDateISO8601(e))
|
|
34
|
+
t = e;
|
|
35
|
+
else
|
|
36
|
+
throw new Error(`функция correctionDataISO8601 >> date не корректна: ${e}. Требуется один из форматов: дд.мм.гггг | дд.мм.гггг мм:чч | гггг-мм-дд `);
|
|
37
|
+
return t;
|
|
38
|
+
}), a(_DateProcessing, "isDateDMY", (e) => /^\d{2}\.\d{2}\.\d{4}$/.test(e) || /^\d{2}\.\d{2}\.\d{4}\s\d{2}:\d{2}$/.test(e)), a(_DateProcessing, "isDateISO8601", (e) => /^\d{4}-\d{2}-\d{2}$/.test(e) || /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e)), a(_DateProcessing, "correctionDateAndRemoveYear", (e, t) => {
|
|
39
|
+
const r = !!(t != null && t.isYear);
|
|
40
|
+
e = _DateProcessing.correctionDataISO8601(e);
|
|
41
|
+
let s = e.split("-").reverse(), n = s;
|
|
42
|
+
return r || (n = s.slice(0, 2)), n.join(".");
|
|
43
|
+
}), a(_DateProcessing, "correctionDateWithOutCurrentYear", (e, t) => {
|
|
44
|
+
const r = !!(t != null && t.shortYear);
|
|
45
|
+
e = _DateProcessing.correctionDataISO8601(e);
|
|
46
|
+
const s = +_DateProcessing.getChunkFromDate(e, "year") == +_DateProcessing.getChunkFromDate(_DateProcessing.getCurrentDate(), "year");
|
|
47
|
+
return s ? _DateProcessing.correctionDateAndRemoveYear(e, { isYear: !s }) : r ? _DateProcessing.correctionShortYear(e) : _DateProcessing.correctionDateAndRemoveYear(e, { isYear: !0 });
|
|
48
|
+
}), a(_DateProcessing, "correctionShortYear", (e) => {
|
|
49
|
+
const t = _DateProcessing.splitDateFromTime(e)[0].split("-").reverse(), r = t.splice(-1);
|
|
50
|
+
return `${t.join(".")}.${r[0].slice(2)}`;
|
|
51
|
+
}), a(_DateProcessing, "correctionDate", (e, t) => (e = _DateProcessing.correctionDataISO8601(e), t != null && t.isRemoveYear ? _DateProcessing.correctionDateAndRemoveYear(e) : t != null && t.shortYear ? t != null && t.withOutCurrentYear ? _DateProcessing.correctionDateWithOutCurrentYear(e, { shortYear: !0 }) : _DateProcessing.correctionShortYear(e) : t != null && t.withOutCurrentYear ? _DateProcessing.correctionDateWithOutCurrentYear(e) : _DateProcessing.correctionDateAndRemoveYear(e, { isYear: !0 }))), a(_DateProcessing, "hasDateLessPeriod", (date, period, option) => {
|
|
52
|
+
const dateMinMax = option != null && option.dateMinMax ? option == null ? void 0 : option.dateMinMax : "<=";
|
|
53
|
+
date = _DateProcessing.correctionDataISO8601(date), period = _DateProcessing.correctionDataISO8601(period);
|
|
54
|
+
const str = `${Math.floor(Number(new Date(date)))} ${dateMinMax} ${Math.floor(Number(new Date(period)))}`, result = eval(str);
|
|
55
|
+
return result;
|
|
56
|
+
}), a(_DateProcessing, "hasDateLessPeriods", (e, t, r, s) => ({
|
|
57
|
+
one: _DateProcessing.hasDateLessPeriod(e, r, s),
|
|
58
|
+
two: _DateProcessing.hasDateLessPeriod(t, r, s)
|
|
59
|
+
})), a(_DateProcessing, "getDifferenceDates", (e, t) => {
|
|
60
|
+
const r = new Date(_DateProcessing.correctionDataISO8601(e)), s = new Date(_DateProcessing.correctionDataISO8601(t)), n = 1e3 * 60 * 60 * 24, c = s.getTime() - r.getTime();
|
|
61
|
+
return Math.round(c / n);
|
|
62
|
+
}), a(_DateProcessing, "hasDateLessInNumber", (e, t, r) => {
|
|
63
|
+
const s = _DateProcessing.getDifferenceDates(e, t);
|
|
64
|
+
return r <= s;
|
|
65
|
+
}), a(_DateProcessing, "correctionCurrentYear", (e, t) => {
|
|
66
|
+
const r = /* @__PURE__ */ new Date(), s = t || r.getFullYear();
|
|
67
|
+
return e.map((n) => _DateProcessing.hasDateLessPeriod(`${t}-${n}`, r.toJSON().split("T")[0], { dateMinMax: ">" }) ? `${s - 1}-${n}` : `${t}-${n}`);
|
|
68
|
+
}), a(_DateProcessing, "getChunkFromDate", (e, t, r) => {
|
|
69
|
+
e = _DateProcessing.correctionDataISO8601(e);
|
|
70
|
+
const s = e.split("-");
|
|
71
|
+
switch (t) {
|
|
72
|
+
case "day":
|
|
73
|
+
return r != null && r.isBeforeZero ? s[2] : String(parseInt(s[2]));
|
|
74
|
+
case "month":
|
|
75
|
+
return r != null && r.isBeforeZero ? s[1] : String(parseInt(s[1]));
|
|
76
|
+
case "year":
|
|
77
|
+
return s[0];
|
|
78
|
+
}
|
|
79
|
+
}), a(_DateProcessing, "getNameMonthByNumber", (e) => e > 0 && e < 13 ? itemsMonths[Number(e) - 1] : itemsMonths[0]), a(_DateProcessing, "minMaxMountStr", (e) => ({
|
|
80
|
+
minMaxMonth: _DateProcessing.getNameMonthByNumber(
|
|
81
|
+
Number(_DateProcessing.getChunkFromDate(e.minDate, "month", { isBeforeZero: !1 }))
|
|
82
|
+
) + " - " + _DateProcessing.getNameMonthByNumber(
|
|
83
|
+
Number(_DateProcessing.getChunkFromDate(e.maxDate, "month", { isBeforeZero: !1 }))
|
|
84
|
+
)
|
|
85
|
+
})), a(_DateProcessing, "getDatesToCurrentDate", (e) => e.filter((t) => _DateProcessing.hasDateLessPeriod(t, _DateProcessing.getCurrentDate()))), a(_DateProcessing, "getDayOfWeek", (e) => {
|
|
86
|
+
let t = _DateProcessing.correctionDataISO8601(e);
|
|
87
|
+
const r = new Date(t).getDay();
|
|
88
|
+
return isNaN(r) ? null : itemsWeek[r];
|
|
89
|
+
}), a(_DateProcessing, "cropSecond", (e) => e.replace(/:\w+$/, "")), a(_DateProcessing, "getRenderDate", (e, t) => {
|
|
90
|
+
const r = !!(t != null && t.withOutCurrentYear), s = _DateProcessing.getCurrentDate();
|
|
91
|
+
switch (_DateProcessing.getDifferenceDates(e, s)) {
|
|
92
|
+
case 0:
|
|
93
|
+
return "Сегодня";
|
|
94
|
+
case 1:
|
|
95
|
+
return "Вчера";
|
|
96
|
+
case 2:
|
|
97
|
+
return "Позавчера";
|
|
98
|
+
default:
|
|
99
|
+
return _DateProcessing.correctionDate(e, { shortYear: !0, withOutCurrentYear: r });
|
|
100
|
+
}
|
|
101
|
+
}), a(_DateProcessing, "getCurrentDate", () => {
|
|
102
|
+
const e = /* @__PURE__ */ new Date(), t = _DateProcessing.getCurrentYear(), r = e.toJSON().split("T")[0].slice(5);
|
|
103
|
+
return `${t}-${r}`;
|
|
104
|
+
}), a(_DateProcessing, "getCurrentYear", () => (/* @__PURE__ */ new Date()).getFullYear()), a(_DateProcessing, "getDaysInMonth", (e, t) => new Date(t, e, 0).getDate());
|
|
105
|
+
let DateProcessing = _DateProcessing;
|
|
106
|
+
export {
|
|
107
|
+
DateProcessing
|
|
108
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var s = (t, r, e) => r in t ? a(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var n = (t, r, e) => (s(t, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
+
class o {
|
|
2
5
|
static getOnlyTheStringNumbers(r) {
|
|
3
6
|
return r.split("").filter((e) => !Number.isNaN(Number.parseInt(e))).join("");
|
|
4
7
|
}
|
|
@@ -12,6 +15,10 @@ class s {
|
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
}
|
|
18
|
+
n(o, "randomNumber", () => {
|
|
19
|
+
const r = /* @__PURE__ */ new Date();
|
|
20
|
+
return Math.floor(Math.random() * r.getTime());
|
|
21
|
+
});
|
|
15
22
|
export {
|
|
16
|
-
|
|
23
|
+
o as Numbers
|
|
17
24
|
};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
var p = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var u = (n, e, s) => e in n ? p(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s;
|
|
3
|
+
var a = (n, e, s) => (u(n, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
+
import { WsApi as C } from "./deps/WsApi/WsApi.js";
|
|
5
|
+
const R = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
6
|
+
function A(n) {
|
|
7
|
+
return R.test(n);
|
|
8
|
+
}
|
|
9
|
+
function o() {
|
|
10
|
+
var n = URL.createObjectURL(new Blob()), e = n.toString();
|
|
11
|
+
return URL.revokeObjectURL(n), e.split(/[:\/]/g).pop().toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
o.valid = A;
|
|
14
|
+
class d {
|
|
7
15
|
watchTimeOffReConnect(e) {
|
|
8
16
|
}
|
|
9
17
|
watchReConnect(e) {
|
|
@@ -23,16 +31,16 @@ const t = class t {
|
|
|
23
31
|
console.trace(), t.state.isDisconnect || (t.state.isDisconnect = !0, console.log("DISCONNECT WS"), t.wsApi.internet.removeWatcherInternet(), t.wsApi.setStatus("disconnect"), t.resetSocket(), t.resetState(), t.wsApi.resetState());
|
|
24
32
|
}
|
|
25
33
|
static send(e) {
|
|
26
|
-
return new Promise((s,
|
|
27
|
-
var
|
|
34
|
+
return new Promise((s, r) => {
|
|
35
|
+
var i;
|
|
28
36
|
console.log("send: ", e);
|
|
29
|
-
let { action:
|
|
37
|
+
let { action: w, ...v } = e;
|
|
30
38
|
if (!t.wsApi.state.ws || t.wsApi.state.ws.readyState !== 1) {
|
|
31
|
-
t.wsApi.state.arrSaveReq.some((
|
|
39
|
+
t.wsApi.state.arrSaveReq.some((f) => f.action === e.action) || (t.wsApi.state.arrSaveReq.push(e), console.log("сохранили запрос в arrSaveReq: ", t.wsApi.state.arrSaveReq));
|
|
32
40
|
return;
|
|
33
41
|
}
|
|
34
|
-
const
|
|
35
|
-
t.wsApi.totalInfoReqPromise.push({ action:
|
|
42
|
+
const l = o();
|
|
43
|
+
t.wsApi.totalInfoReqPromise.push({ action: w, reqId: l, resolve: s, reject: r }), (i = t.wsApi.state.ws) == null || i.send(JSON.stringify(e)), t.wsApi.state.arrSaveReq.length && !t.wsApi.state.isRequestArrSaveReq && (t.wsApi.state.isRequestArrSaveReq = !0);
|
|
36
44
|
});
|
|
37
45
|
}
|
|
38
46
|
static connect() {
|
|
@@ -65,16 +73,16 @@ const t = class t {
|
|
|
65
73
|
console.dir("CONNECT WS"), t.resetSocket(), t.state.isDisconnect = !1, t.wsApi.state.ws = new WebSocket(t.wsApi.state.url), t.wsApi.setStatus("pending"), t.wsApi.addEvents();
|
|
66
74
|
}
|
|
67
75
|
};
|
|
68
|
-
|
|
76
|
+
a(t, "wsApi", new C()), a(t, "watch", new d()), a(t, "state", {
|
|
69
77
|
isDisconnect: !0,
|
|
70
78
|
initConnect: !1,
|
|
71
79
|
isReConnect: !1
|
|
72
|
-
}),
|
|
80
|
+
}), a(t, "saveID", {
|
|
73
81
|
idConnect: null,
|
|
74
82
|
checkConnect: null
|
|
75
|
-
}),
|
|
83
|
+
}), a(t, "stateDefault", t.copyState(t.state)), a(t, "setOptions", (e = t.wsApi.configWs) => {
|
|
76
84
|
t.state.initConnect || (t.wsApi.configWs = e, t.wsApi.internet.addWatcherInternet());
|
|
77
|
-
}),
|
|
85
|
+
}), a(t, "getEndReq", () => t.wsApi.state.arrSaveReq), a(t, "socketReConnect", () => {
|
|
78
86
|
t.saveID.idConnect ? (console.groupCollapsed("Процесс idConnect уже запущен"), console.log("SocketApi.saveID: ", t.saveID), console.groupEnd()) : (t.state.isReConnect = !0, t.watch.watchReConnect(!0), t.createConnect(), t.wsApi.startActionEvery(
|
|
79
87
|
() => t.wsApi.state.statusConnect === "ready" ? !0 : (t.createConnect(), !1),
|
|
80
88
|
{
|
|
@@ -90,11 +98,11 @@ n(t, "wsApi", new u()), n(t, "watch", new A()), n(t, "state", {
|
|
|
90
98
|
}
|
|
91
99
|
}
|
|
92
100
|
).then(t.setInfoConnect).catch(t.setInfoConnect));
|
|
93
|
-
}),
|
|
101
|
+
}), a(t, "setInfoConnect", (e) => {
|
|
94
102
|
e.status || t.close(), t.watch.watchTimeOffReConnect(e), t.watch.watchReConnect(!1), t.state.isReConnect = !1;
|
|
95
103
|
});
|
|
96
|
-
let
|
|
97
|
-
window.SocketApi =
|
|
104
|
+
let c = t;
|
|
105
|
+
window.SocketApi = c;
|
|
98
106
|
export {
|
|
99
|
-
|
|
107
|
+
c as SocketApi
|
|
100
108
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ConnectOptions_P, EventNameType, StatusConnectWsAPI, SubscriberType, WsApiStateDefaultI, WsApiStateSaveDefaultI } from './WsApi.types';
|
|
1
2
|
import { InternetWatcher } from '../InternetWatcher/InternetWatcher';
|
|
2
|
-
import {
|
|
3
|
-
import { DelaysPromise } from '../../../Delay';
|
|
3
|
+
import { DelaysPromise } from '../../../Delay/Delay';
|
|
4
4
|
|
|
5
5
|
export declare class WsApi extends DelaysPromise {
|
|
6
6
|
configWs: ConnectOptions_P;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var l = Object.defineProperty;
|
|
2
2
|
var c = (n, a, e) => a in n ? l(n, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[a] = e;
|
|
3
3
|
var r = (n, a, e) => (c(n, typeof a != "symbol" ? a + "" : a, e), e);
|
|
4
|
-
import { DelaysPromise as d } from "../../../Delay.js";
|
|
4
|
+
import { DelaysPromise as d } from "../../../Delay/Delay.js";
|
|
5
5
|
import { InternetWatcher as v } from "../InternetWatcher/InternetWatcher.js";
|
|
6
6
|
class E extends d {
|
|
7
7
|
constructor() {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ConnectOptions_P {
|
|
2
|
+
timeReConnect: number;
|
|
3
|
+
}
|
|
4
|
+
export type EventNameType = "msg" | "status";
|
|
5
|
+
export type SubscribersEventsType = Record<EventNameType, any[]>;
|
|
6
|
+
export type SubscriberType<T> = (msg: T) => void;
|
|
7
|
+
export type StatusConnectWsAPI = "pending" | "ready" | "error" | "close" | "disconnect";
|
|
8
|
+
export interface WsApiStateDefaultI {
|
|
9
|
+
statusConnect: StatusConnectWsAPI;
|
|
10
|
+
ws: null | WebSocket;
|
|
11
|
+
url: string;
|
|
12
|
+
}
|
|
13
|
+
export interface WsApiStateSaveDefaultI {
|
|
14
|
+
isRequestArrSaveReq: boolean;
|
|
15
|
+
arrSaveReq: any[];
|
|
16
|
+
subscribersEvents: SubscribersEventsType;
|
|
17
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './WsApi';
|
|
2
|
-
export * from './types
|
|
2
|
+
export * from './WsApi.types';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare class Utils {
|
|
2
2
|
static events(status: 'add' | 'remove', who: any, entriesEvents: any, msg?: string): Promise<unknown>;
|
|
3
|
-
static sortDataByAlphabet: (arrData:
|
|
3
|
+
static sortDataByAlphabet: (arrData: {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}[], sortKey: string) => void;
|
|
4
6
|
static sortDataByDate: (data: any[], keyDate: string) => void;
|
|
5
7
|
static sortDataByDateAndTime: (data: any[], keyDate: string) => void;
|
|
6
8
|
private static splitDateFromTime;
|
|
@@ -9,5 +11,5 @@ export declare class Utils {
|
|
|
9
11
|
static hasDateLessPeriod: (date: string, period: string, option?: {
|
|
10
12
|
dateMinMax: '<=' | '>=' | '<' | '>';
|
|
11
13
|
}) => boolean | undefined;
|
|
12
|
-
static
|
|
14
|
+
static getEndsWithArr: (arr: any[], countEnd: any) => any[];
|
|
13
15
|
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var s = (n, t, e) => (
|
|
4
|
-
import { u as v } from "../browser-DJTk47DY.js";
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var v = (n, t, e) => t in n ? M(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var s = (n, t, e) => (v(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
4
|
const a = class a {
|
|
6
|
-
static events(t, e, r,
|
|
7
|
-
return console.log(`##########--------<{ ${t === "add" ? "Создаём" : "Удаляем"} пачку ивентов ${
|
|
8
|
-
let
|
|
9
|
-
for (let [
|
|
10
|
-
|
|
5
|
+
static events(t, e, r, c = "") {
|
|
6
|
+
return console.log(`##########--------<{ ${t === "add" ? "Создаём" : "Удаляем"} пачку ивентов ${c}}>---------#########`), new Promise((d, u) => {
|
|
7
|
+
let f = 0;
|
|
8
|
+
for (let [D, l] of r)
|
|
9
|
+
f++, t === "add" ? e.addEventListener ? e.addEventListener(D, l) : e.on ? e.on(D, l) : console.log("Utils.events:>> ", 'Отсутствует метод "addEventListener"') : e.removeEventListener ? e.removeEventListener(D, l) : e.off ? e.off(D, l) : console.log("Utils.events:>> ", 'Отсутствует метод "removeEventListener"'), f === r.length && d("");
|
|
11
10
|
});
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
13
|
s(a, "sortDataByAlphabet", (t, e) => {
|
|
15
|
-
t.sort((r,
|
|
14
|
+
t.sort((r, c) => c[e].trim() < r[e].trim() ? 1 : -1);
|
|
16
15
|
}), s(a, "sortDataByDate", (t, e) => {
|
|
17
|
-
t.sort((r,
|
|
16
|
+
t.sort((r, c) => a.hasDateLessPeriod(c[e], r[e]) ? 1 : -1);
|
|
18
17
|
}), s(a, "sortDataByDateAndTime", (t, e) => {
|
|
19
18
|
}), s(a, "splitDateFromTime", (t) => t.split(" ")), s(a, "reverseDate", (t) => {
|
|
20
19
|
let [e, r] = a.splitDateFromTime(t);
|
|
@@ -37,7 +36,7 @@ s(a, "sortDataByAlphabet", (t, e) => {
|
|
|
37
36
|
return Math.floor(Number(new Date(t))) < Math.floor(Number(new Date(e)));
|
|
38
37
|
if (r && (r == null ? void 0 : r.dateMinMax) === ">")
|
|
39
38
|
return Math.floor(Number(new Date(t))) > Math.floor(Number(new Date(e)));
|
|
40
|
-
}), s(a, "
|
|
39
|
+
}), s(a, "getEndsWithArr", (t, e) => t.slice(-e));
|
|
41
40
|
let m = a;
|
|
42
41
|
export {
|
|
43
42
|
m as Utils
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export * from './classes/Color';
|
|
2
|
-
export * from './classes/ControlAppBySocket';
|
|
3
|
-
export * from './classes/DateProcessing';
|
|
4
|
-
export * from './classes/Delay';
|
|
5
|
-
export * from './classes/DownloadFile';
|
|
6
|
-
export * from './classes/
|
|
7
|
-
export * from './classes/
|
|
8
|
-
export * from './classes/
|
|
9
|
-
export * from './classes/Utils';
|
|
1
|
+
export * from './classes/Color/Color';
|
|
2
|
+
export * from './classes/ControlAppBySocket/ControlAppBySocket';
|
|
3
|
+
export * from './classes/DateProcessing/DateProcessing';
|
|
4
|
+
export * from './classes/Delay/Delay';
|
|
5
|
+
export * from './classes/DownloadFile/DownloadFile';
|
|
6
|
+
export * from './classes/Numbers/Numbers';
|
|
7
|
+
export * from './classes/ProcessingWS/ProcessingWS';
|
|
8
|
+
export * from './classes/Utils/Utils';
|
|
10
9
|
export * from './classes/SocketApi/SocketApi';
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import { Color as e } from "./classes/Color.js";
|
|
2
|
-
import { ControlAppBySocket as
|
|
3
|
-
import { DateProcessing as
|
|
4
|
-
import { DelaysPromise as
|
|
5
|
-
import { DownloadFile as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { SocketApi as C } from "./classes/SocketApi/SocketApi.js";
|
|
1
|
+
import { Color as e } from "./classes/Color/Color.js";
|
|
2
|
+
import { ControlAppBySocket as p } from "./classes/ControlAppBySocket/ControlAppBySocket.js";
|
|
3
|
+
import { DateProcessing as f } from "./classes/DateProcessing/DateProcessing.js";
|
|
4
|
+
import { DelaysPromise as s } from "./classes/Delay/Delay.js";
|
|
5
|
+
import { DownloadFile as l } from "./classes/DownloadFile/DownloadFile.js";
|
|
6
|
+
import { Numbers as n } from "./classes/Numbers/Numbers.js";
|
|
7
|
+
import { ProcessingWS as D } from "./classes/ProcessingWS/ProcessingWS.js";
|
|
8
|
+
import { Utils as S } from "./classes/Utils/Utils.js";
|
|
9
|
+
import { SocketApi as k } from "./classes/SocketApi/SocketApi.js";
|
|
11
10
|
export {
|
|
12
11
|
e as Color,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
k as Utils,
|
|
22
|
-
f as currentFullDate,
|
|
23
|
-
n as currentMonthDay,
|
|
24
|
-
x as currentYear,
|
|
25
|
-
s as randomNumber,
|
|
26
|
-
l as yearRange
|
|
12
|
+
p as ControlAppBySocket,
|
|
13
|
+
f as DateProcessing,
|
|
14
|
+
s as DelaysPromise,
|
|
15
|
+
l as DownloadFile,
|
|
16
|
+
n as Numbers,
|
|
17
|
+
D as ProcessingWS,
|
|
18
|
+
k as SocketApi,
|
|
19
|
+
S as Utils
|
|
27
20
|
};
|
package/package.json
CHANGED
package/dist/browser-DJTk47DY.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const a = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
2
|
-
function r(t) {
|
|
3
|
-
return a.test(t);
|
|
4
|
-
}
|
|
5
|
-
function u() {
|
|
6
|
-
var t = URL.createObjectURL(new Blob()), e = t.toString();
|
|
7
|
-
return URL.revokeObjectURL(t), e.split(/[:\/]/g).pop().toLowerCase();
|
|
8
|
-
}
|
|
9
|
-
u.valid = r;
|
|
10
|
-
export {
|
|
11
|
-
u
|
|
12
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export declare class DateProcessing {
|
|
2
|
-
static getActiveColorClassInDiffDate: (date1: any, date2: any, activeClass: any) => string;
|
|
3
|
-
static getClassByDifferenceDay: (date: any, colorsConfig: {
|
|
4
|
-
className: string;
|
|
5
|
-
diffDay: number;
|
|
6
|
-
}[]) => string;
|
|
7
|
-
static getMinMaxDate: (date: string, minDate: string, maxDate: string) => {
|
|
8
|
-
minMaxMonth: string;
|
|
9
|
-
minDate: string;
|
|
10
|
-
maxDate: string;
|
|
11
|
-
};
|
|
12
|
-
static splitDateFromTime: (dateTime: string) => string[];
|
|
13
|
-
static getCorrectDateAndTime: (dateTime: any) => [date: string, time: string];
|
|
14
|
-
static reverseDate: (datePPR: any) => string;
|
|
15
|
-
static correctionDataISO8601: (date: string) => string;
|
|
16
|
-
static isDateDMY: (date: string) => boolean;
|
|
17
|
-
static isDateISO8601: (date: string) => boolean;
|
|
18
|
-
static correctionDateAndRemoveYear: (datePPR: string, options?: {
|
|
19
|
-
isYear: boolean;
|
|
20
|
-
}) => string;
|
|
21
|
-
static correctionDateWithOutCurrentYear: (date: string, options?: {
|
|
22
|
-
shortYear: boolean;
|
|
23
|
-
}) => string;
|
|
24
|
-
static correctionShortYear: (date: string) => string;
|
|
25
|
-
static correctionDate: (date: string, options?: Partial<Record<'isRemoveYear' | 'shortYear' | 'withOutCurrentYear', boolean>>) => string;
|
|
26
|
-
static hasDateLessPeriod: (date: string, period: string, option?: {
|
|
27
|
-
dateMinMax: '<=' | '>=' | '<' | '>';
|
|
28
|
-
}) => boolean | undefined;
|
|
29
|
-
static hasDateLessPeriodV2: (date1: string, date2: string, period: string, option?: {
|
|
30
|
-
dateMinMax: '<=' | '>=' | '<' | '>';
|
|
31
|
-
}) => {
|
|
32
|
-
one: boolean | undefined;
|
|
33
|
-
two: boolean | undefined;
|
|
34
|
-
};
|
|
35
|
-
static hasDateLessInNumber: (date1: string, date2: string, number?: number) => number | boolean;
|
|
36
|
-
static correctionCurrentYear: (periods: any, Year?: number) => any;
|
|
37
|
-
static correctionCurrentDate: (date: any) => string;
|
|
38
|
-
static getMinMaxDateV2: (date: string, obMinMaxDate: any) => void;
|
|
39
|
-
static getChunkFromDate: (date: string, getChunk: 'day' | 'month' | 'year', option?: {
|
|
40
|
-
isBeforeZero: boolean;
|
|
41
|
-
}) => string;
|
|
42
|
-
static convertMonthNumberInName: (month: any) => string;
|
|
43
|
-
static MinMaxMountStr: (obMinMaxDate: any) => {
|
|
44
|
-
minMaxMonth: string;
|
|
45
|
-
};
|
|
46
|
-
static sortDataByAlphabet: (arrData: any) => void;
|
|
47
|
-
static getEndsWithArr: (arr: any[], countEnd: any) => any[];
|
|
48
|
-
static filterPeriodsRelativeCurrentDate: (periods: string[]) => string[];
|
|
49
|
-
static getCollectionPeriodsFullDate: (collectionPeriodsDate: any, reqYear: any) => any;
|
|
50
|
-
static sortDataByDate: (data: any[], keyDate: string) => void;
|
|
51
|
-
static getNameKeyByNumber: (data: any) => string[];
|
|
52
|
-
static getDayOfWeek(date: any): string | null;
|
|
53
|
-
static cropSecond: (time: any) => any;
|
|
54
|
-
static getCurrentDate: () => string;
|
|
55
|
-
static getRenderDate: (date: string, option?: {
|
|
56
|
-
withOutCurrentYear: boolean;
|
|
57
|
-
}) => string;
|
|
58
|
-
}
|
|
59
|
-
export declare const currentYear: number;
|
|
60
|
-
export declare const currentMonthDay: string;
|
|
61
|
-
export declare const currentFullDate: string;
|
|
62
|
-
export declare let yearRange: string;
|
|
63
|
-
export declare const randomNumber: () => number;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
var Y = Object.defineProperty;
|
|
2
|
-
var N = (l, e, r) => e in l ? Y(l, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : l[e] = r;
|
|
3
|
-
var n = (l, e, r) => (N(l, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
-
const t = class t {
|
|
5
|
-
static getDayOfWeek(e) {
|
|
6
|
-
let r = t.correctionDataISO8601(e);
|
|
7
|
-
const a = new Date(r).getDay();
|
|
8
|
-
return isNaN(a) ? null : ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"][a];
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
n(t, "getActiveColorClassInDiffDate", (e, r, a) => {
|
|
12
|
-
let s = "";
|
|
13
|
-
return e && r && t.hasDateLessPeriod(e, r) && (s = a), s;
|
|
14
|
-
}), n(t, "getClassByDifferenceDay", (e, r) => {
|
|
15
|
-
let a = "", s = r.sort((c, u) => c.diffDay - u.diffDay);
|
|
16
|
-
for (let c = 0; c < s.length; c++) {
|
|
17
|
-
let u = s[c], m = t.hasDateLessInNumber(e, o);
|
|
18
|
-
if (u.diffDay < m) {
|
|
19
|
-
a = u.className;
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
}), n(t, "getMinMaxDate", (e, r, a) => {
|
|
25
|
-
let s = {
|
|
26
|
-
minDate: "",
|
|
27
|
-
maxDate: "",
|
|
28
|
-
minMaxMonth: ""
|
|
29
|
-
};
|
|
30
|
-
return /^\d{2}\.\d{2}\.\d{4}$/.test(e) || /^\d{2}\.\d{2}$/.test(e) ? (!r && !a ? (s.minDate = e, s.maxDate = e) : r ? a ? r && a && (s.minDate = t.hasDateLessPeriod(e, r, { dateMinMax: "<=" }) ? e : r, s.maxDate = t.hasDateLessPeriod(e, a, { dateMinMax: ">=" }) ? e : a) : (s.minDate = t.hasDateLessPeriod(e, r, { dateMinMax: "<=" }) ? e : r, s.maxDate = e) : (s.minDate = e, s.maxDate = t.hasDateLessPeriod(e, a, { dateMinMax: ">=" }) ? e : a), { ...s, ...t.MinMaxMountStr(s) }) : (console.error('функция getMinMaxDate >> формат дат не соответствует формату: "дд.мм.гггг"'), { minDate: r, maxDate: a, ...t.MinMaxMountStr(s) });
|
|
31
|
-
}), n(t, "splitDateFromTime", (e) => {
|
|
32
|
-
const r = e.includes("T");
|
|
33
|
-
return e.split(r ? "T" : " ");
|
|
34
|
-
}), n(t, "getCorrectDateAndTime", (e) => {
|
|
35
|
-
let r = e.match(/\D/), a, s;
|
|
36
|
-
r && r[0] === ":" ? [a, s] = t.splitDateFromTime(e) : [s, a] = t.splitDateFromTime(e), s = t.correctionDateAndRemoveYear(s, { isYear: !0 });
|
|
37
|
-
let c = a.split(":");
|
|
38
|
-
return c.length === 3 && (c.length = 2, a = c.join(":")), [s, a];
|
|
39
|
-
}), n(t, "reverseDate", (e) => {
|
|
40
|
-
let [r, a] = t.splitDateFromTime(e);
|
|
41
|
-
return r.split(".").reverse().join("-");
|
|
42
|
-
}), n(t, "correctionDataISO8601", (e) => {
|
|
43
|
-
let r = "";
|
|
44
|
-
if (t.isDateDMY(e))
|
|
45
|
-
r = t.reverseDate(e);
|
|
46
|
-
else if (t.isDateISO8601(e))
|
|
47
|
-
r = e;
|
|
48
|
-
else
|
|
49
|
-
throw new Error(`функция correctionDataISO8601 >> date не корректна: ${e}. Требуется один из форматов: дд.мм.гггг | дд.мм.гггг мм:чч | гггг-мм-дд `);
|
|
50
|
-
return r;
|
|
51
|
-
}), n(t, "isDateDMY", (e) => !!(/^\d{2}\.\d{2}\.\d{4}$/.test(e) || /^\d{2}\.\d{2}\.\d{4}\s\d{2}:\d{2}$/.test(e))), n(t, "isDateISO8601", (e) => !!(/^\d{4}-\d{2}-\d{2}$/.test(e) || /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e))), n(t, "correctionDateAndRemoveYear", (e, r = { isYear: !1 }) => {
|
|
52
|
-
e = t.correctionDataISO8601(e);
|
|
53
|
-
let a = e.split("-").reverse(), s = a;
|
|
54
|
-
return r.isYear || (s = a.slice(0, 2)), s.join(".");
|
|
55
|
-
}), n(t, "correctionDateWithOutCurrentYear", (e, r) => {
|
|
56
|
-
e = t.correctionDataISO8601(e);
|
|
57
|
-
const a = +t.getChunkFromDate(e, "year") === i;
|
|
58
|
-
return a ? t.correctionDateAndRemoveYear(e, { isYear: !a }) : r != null && r.shortYear ? t.correctionShortYear(e) : t.correctionDateAndRemoveYear(e, { isYear: !0 });
|
|
59
|
-
}), n(t, "correctionShortYear", (e) => {
|
|
60
|
-
let r = t.splitDateFromTime(e)[0].split("-").reverse(), a = r.splice(-1);
|
|
61
|
-
return `${r.join(".")}.${a[0].slice(2)}`;
|
|
62
|
-
}), n(t, "correctionDate", (e, r) => (e = t.correctionDataISO8601(e), r != null && r.isRemoveYear ? t.correctionDateAndRemoveYear(e) : r != null && r.shortYear ? r != null && r.withOutCurrentYear ? t.correctionDateWithOutCurrentYear(e, { shortYear: !0 }) : t.correctionShortYear(e) : r != null && r.withOutCurrentYear ? t.correctionDateWithOutCurrentYear(e) : t.correctionDateAndRemoveYear(e, { isYear: !0 }))), n(t, "hasDateLessPeriod", (e, r, a) => {
|
|
63
|
-
if (e = t.correctionDataISO8601(e), r = t.correctionDataISO8601(r), !a || a && !a.dateMinMax || (a == null ? void 0 : a.dateMinMax) === "<=")
|
|
64
|
-
return Math.floor(Number(new Date(e))) <= Math.floor(Number(new Date(r)));
|
|
65
|
-
if (a && (a == null ? void 0 : a.dateMinMax) === ">=")
|
|
66
|
-
return Math.floor(Number(new Date(e))) >= Math.floor(Number(new Date(r)));
|
|
67
|
-
if (a && (a == null ? void 0 : a.dateMinMax) === "<")
|
|
68
|
-
return Math.floor(Number(new Date(e))) < Math.floor(Number(new Date(r)));
|
|
69
|
-
if (a && (a == null ? void 0 : a.dateMinMax) === ">")
|
|
70
|
-
return Math.floor(Number(new Date(e))) > Math.floor(Number(new Date(r)));
|
|
71
|
-
}), n(t, "hasDateLessPeriodV2", (e, r, a, s) => ({
|
|
72
|
-
one: t.hasDateLessPeriod(e, a, s),
|
|
73
|
-
two: t.hasDateLessPeriod(r, a, s)
|
|
74
|
-
})), n(t, "hasDateLessInNumber", (e, r, a) => {
|
|
75
|
-
const s = new Date(t.correctionDataISO8601(e)), c = new Date(t.correctionDataISO8601(r)), u = 1e3 * 60 * 60 * 24, m = c.getTime() - s.getTime(), D = Math.round(m / u);
|
|
76
|
-
return a ? a <= D : D;
|
|
77
|
-
}), n(t, "correctionCurrentYear", (e, r) => {
|
|
78
|
-
const a = /* @__PURE__ */ new Date(), s = r || a.getFullYear();
|
|
79
|
-
return e.map((c) => t.hasDateLessPeriod(`${s}-${c}`, a.toJSON().split("T")[0], { dateMinMax: ">" }) ? `${s - 1}-${c}` : `${s}-${c}`);
|
|
80
|
-
}), n(t, "correctionCurrentDate", (e) => ((/* @__PURE__ */ new Date()).getFullYear(), t.correctionDate(e, { isRemoveYear: !0, shortYear: !0 }))), n(t, "getMinMaxDateV2", (e, r) => {
|
|
81
|
-
e = e.split(" ")[0], t.isDateDMY(e) && (!r.minDate && !r.maxDate ? (r.minDate = e, r.maxDate = e) : r.minDate ? r.maxDate ? r.minDate && r.maxDate && (r.minDate = t.hasDateLessPeriod(e, r.minDate, { dateMinMax: "<=" }) ? e : r.minDate, r.maxDate = t.hasDateLessPeriod(e, r.maxDate, { dateMinMax: ">=" }) ? e : r.maxDate) : (r.minDate = t.hasDateLessPeriod(e, r.minDate, { dateMinMax: "<=" }) ? e : r.minDate, r.maxDate = e) : (r.minDate = e, r.maxDate = t.hasDateLessPeriod(e, r.maxDate, { dateMinMax: ">=" }) ? e : r.maxDate)), r.minMaxMonth = t.MinMaxMountStr(r).minMaxMonth;
|
|
82
|
-
}), n(t, "getChunkFromDate", (e, r, a) => {
|
|
83
|
-
e = t.correctionDataISO8601(e);
|
|
84
|
-
const s = e.split("-");
|
|
85
|
-
switch (r) {
|
|
86
|
-
case "day":
|
|
87
|
-
return a != null && a.isBeforeZero ? s[2] : s[0].slice(-1);
|
|
88
|
-
case "month":
|
|
89
|
-
return a != null && a.isBeforeZero ? s[1] : s[1].slice(-1);
|
|
90
|
-
case "year":
|
|
91
|
-
return s[0];
|
|
92
|
-
}
|
|
93
|
-
}), n(t, "convertMonthNumberInName", (e) => e ? ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"][Number(e) - 1] : "----"), n(t, "MinMaxMountStr", (e) => ({
|
|
94
|
-
minMaxMonth: t.convertMonthNumberInName(t.getChunkFromDate(e.minDate, "month", { isBeforeZero: !1 })) + " - " + t.convertMonthNumberInName(t.getChunkFromDate(e.maxDate, "month", { isBeforeZero: !1 }))
|
|
95
|
-
})), n(t, "sortDataByAlphabet", (e) => {
|
|
96
|
-
e.sort((r, a) => a.name.trim() < r.name.trim() ? 1 : -1);
|
|
97
|
-
}), n(t, "getEndsWithArr", (e, r) => e.slice(-r)), n(t, "filterPeriodsRelativeCurrentDate", (e) => e.filter((r) => t.hasDateLessPeriod(r, o))), n(t, "getCollectionPeriodsFullDate", (e, r) => e.map((a) => `${r}-${a}`)), n(t, "sortDataByDate", (e, r) => {
|
|
98
|
-
e.sort((a, s) => t.hasDateLessPeriod(s[r], a[r]) ? 1 : -1);
|
|
99
|
-
}), n(t, "getNameKeyByNumber", (e) => {
|
|
100
|
-
let r = [];
|
|
101
|
-
for (let a = 0; a < e.length; a++)
|
|
102
|
-
for (let [s, c] of Object.entries(e[a]))
|
|
103
|
-
typeof c == "number" && (!s.length || !r.some((u) => u === s)) && r.push(s);
|
|
104
|
-
return r;
|
|
105
|
-
}), n(t, "cropSecond", (e) => e.replace(/:\w+$/, "")), n(t, "getCurrentDate", () => {
|
|
106
|
-
const e = /* @__PURE__ */ new Date(), r = e.getFullYear(), a = e.toJSON().split("T")[0].slice(5);
|
|
107
|
-
return `${r}-${a}`;
|
|
108
|
-
}), n(t, "getRenderDate", (e, r = { withOutCurrentYear: !1 }) => {
|
|
109
|
-
const a = t.getCurrentDate();
|
|
110
|
-
if (e === a)
|
|
111
|
-
return "Сегодня";
|
|
112
|
-
const s = t.hasDateLessInNumber(e, a);
|
|
113
|
-
return s === 1 ? "Вчера" : s === 2 ? "Позавчера" : t.correctionDate(e, { shortYear: !0, withOutCurrentYear: r.withOutCurrentYear });
|
|
114
|
-
});
|
|
115
|
-
let f = t;
|
|
116
|
-
window.DateProcessing = f;
|
|
117
|
-
const h = /* @__PURE__ */ new Date(), i = h.getFullYear(), C = h.toJSON().split("T")[0].slice(5), o = `${i}-${C}`;
|
|
118
|
-
let w = `${i} - ${i + 1}`;
|
|
119
|
-
const S = () => Math.floor(Math.random() * h.getTime());
|
|
120
|
-
export {
|
|
121
|
-
f as DateProcessing,
|
|
122
|
-
o as currentFullDate,
|
|
123
|
-
C as currentMonthDay,
|
|
124
|
-
i as currentYear,
|
|
125
|
-
S as randomNumber,
|
|
126
|
-
w as yearRange
|
|
127
|
-
};
|
package/dist/classes/Lodash.d.ts
DELETED
package/dist/classes/Lodash.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var a = Object.defineProperty;
|
|
2
|
-
var r = (i, t, e) => t in i ? a(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
-
var s = (i, t, e) => (r(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
class c {
|
|
5
|
-
}
|
|
6
|
-
s(c, "filter", (t, e) => t.filter((l) => !e.includes(l))), s(c, "getItemsID", (t) => t.map((e) => e.id));
|
|
7
|
-
export {
|
|
8
|
-
c as Lodash
|
|
9
|
-
};
|
|
File without changes
|
|
File without changes
|
/package/dist/classes/{ControlAppBySocket.d.ts → ControlAppBySocket/ControlAppBySocket.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/classes/SocketApi/deps/ConfigInfoConnect/{types.d.js → ConfigInfoConnect.types.js}
RENAMED
|
File without changes
|
|
File without changes
|