@dxtmisha/functional-basic 1.2.8 → 1.3.3
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/CHANGELOG.md +31 -0
- package/ai-description.txt +12 -3
- package/ai-doc.ru.txt +50 -1
- package/ai-doc.txt +50 -1
- package/ai-types.txt +326 -470
- package/dist/library.js +74 -61
- package/dist/src/classes/GeoFlag.d.ts +7 -0
- package/dist/src/functions/getKey.d.ts +1 -1
- package/dist/src/functions/getLength.d.ts +10 -0
- package/dist/src/functions/isTab.d.ts +8 -0
- package/dist/src/library.d.ts +2 -0
- package/dist/src/types/geoTypes.d.ts +2 -0
- package/package.json +4 -3
package/dist/library.js
CHANGED
|
@@ -1245,7 +1245,8 @@ var Oe = class {
|
|
|
1245
1245
|
get(e, t = "application/json;charset=UTF-8") {
|
|
1246
1246
|
if (e === null) return;
|
|
1247
1247
|
let r = { ...S(this.headers) };
|
|
1248
|
-
|
|
1248
|
+
if (n(e)) for (let t in e) r[t.toLowerCase()] = e[t];
|
|
1249
|
+
return l(t) && (r["content-type"] = t), r;
|
|
1249
1250
|
}
|
|
1250
1251
|
getByRequest(e, t, n = "application/json;charset=UTF-8") {
|
|
1251
1252
|
return e instanceof FormData ? this.get(t, null) : this.get(t, n);
|
|
@@ -2645,7 +2646,7 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
2645
2646
|
constructor(e = O.getLocation()) {
|
|
2646
2647
|
w(this, "code", void 0), this.code = e;
|
|
2647
2648
|
}
|
|
2648
|
-
get(t = this.
|
|
2649
|
+
get(t = this.getCode()) {
|
|
2649
2650
|
let n = O.find(t);
|
|
2650
2651
|
if (n) {
|
|
2651
2652
|
var r;
|
|
@@ -2656,11 +2657,15 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
2656
2657
|
standard: n.standard,
|
|
2657
2658
|
icon: (r = e.flags) == null ? void 0 : r[n.country],
|
|
2658
2659
|
label: t,
|
|
2659
|
-
value: n.country
|
|
2660
|
+
value: n.country,
|
|
2661
|
+
phoneCode: n.phoneCode
|
|
2660
2662
|
};
|
|
2661
2663
|
}
|
|
2662
2664
|
}
|
|
2663
|
-
|
|
2665
|
+
getCode() {
|
|
2666
|
+
return this.code || O.getLocation();
|
|
2667
|
+
}
|
|
2668
|
+
getFlag(e = this.getCode()) {
|
|
2664
2669
|
var t;
|
|
2665
2670
|
return (t = this.get(e)) == null ? void 0 : t.icon;
|
|
2666
2671
|
}
|
|
@@ -4363,8 +4368,13 @@ function En(e) {
|
|
|
4363
4368
|
return (t = (n = e == null ? void 0 : e.key) == null ? e == null ? void 0 : e.code : n) == null ? e == null || (r = e.keyCode) == null ? void 0 : r.toString() : t;
|
|
4364
4369
|
}
|
|
4365
4370
|
//#endregion
|
|
4366
|
-
//#region src/functions/
|
|
4371
|
+
//#region src/functions/getLength.ts
|
|
4367
4372
|
function Dn(e) {
|
|
4373
|
+
return e == null ? 0 : typeof e == "string" || Array.isArray(e) ? e.length : e instanceof Map || e instanceof Set ? e.size : t(e) ? Object.keys(e).length : 0;
|
|
4374
|
+
}
|
|
4375
|
+
//#endregion
|
|
4376
|
+
//#region src/functions/getLengthOfAllArray.ts
|
|
4377
|
+
function On(e) {
|
|
4368
4378
|
return r(e, (e) => {
|
|
4369
4379
|
var t;
|
|
4370
4380
|
return (t = e == null ? void 0 : e.length) == null ? 0 : t;
|
|
@@ -4372,41 +4382,41 @@ function Dn(e) {
|
|
|
4372
4382
|
}
|
|
4373
4383
|
//#endregion
|
|
4374
4384
|
//#region src/functions/getMaxLengthAllArray.ts
|
|
4375
|
-
function
|
|
4385
|
+
function kn(e) {
|
|
4376
4386
|
if (!l(e)) return 0;
|
|
4377
|
-
let t =
|
|
4387
|
+
let t = On(e);
|
|
4378
4388
|
return t.length > 1e4 ? t.reduce((e, t) => Math.max(e, t)) : Math.max(...t);
|
|
4379
4389
|
}
|
|
4380
4390
|
//#endregion
|
|
4381
4391
|
//#region src/functions/getMinLengthAllArray.ts
|
|
4382
|
-
function
|
|
4392
|
+
function An(e) {
|
|
4383
4393
|
if (!l(e)) return 0;
|
|
4384
|
-
let t =
|
|
4394
|
+
let t = On(e);
|
|
4385
4395
|
return t.length > 1e4 ? t.reduce((e, t) => Math.min(e, t)) : Math.min(...t);
|
|
4386
4396
|
}
|
|
4387
4397
|
//#endregion
|
|
4388
4398
|
//#region src/functions/getMouseClientX.ts
|
|
4389
|
-
function
|
|
4399
|
+
function jn(e) {
|
|
4390
4400
|
var t, n;
|
|
4391
4401
|
return (e == null ? void 0 : e.clientX) || (e == null || (t = e.targetTouches) == null || (t = t[0]) == null ? void 0 : t.clientX) || (e == null || (n = e.touches) == null || (n = n[0]) == null ? void 0 : n.clientX) || 0;
|
|
4392
4402
|
}
|
|
4393
4403
|
//#endregion
|
|
4394
4404
|
//#region src/functions/getMouseClientY.ts
|
|
4395
|
-
function
|
|
4405
|
+
function Mn(e) {
|
|
4396
4406
|
var t, n;
|
|
4397
4407
|
return (e == null ? void 0 : e.clientY) || (e == null || (t = e.targetTouches) == null || (t = t[0]) == null ? void 0 : t.clientY) || (e == null || (n = e.touches) == null || (n = n[0]) == null ? void 0 : n.clientY) || 0;
|
|
4398
4408
|
}
|
|
4399
4409
|
//#endregion
|
|
4400
4410
|
//#region src/functions/getMouseClient.ts
|
|
4401
|
-
function
|
|
4411
|
+
function Nn(e) {
|
|
4402
4412
|
return {
|
|
4403
|
-
x:
|
|
4404
|
-
y:
|
|
4413
|
+
x: jn(e),
|
|
4414
|
+
y: Mn(e)
|
|
4405
4415
|
};
|
|
4406
4416
|
}
|
|
4407
4417
|
//#endregion
|
|
4408
4418
|
//#region src/functions/getObjectByKeys.ts
|
|
4409
|
-
function
|
|
4419
|
+
function Pn(e, t) {
|
|
4410
4420
|
let r = {};
|
|
4411
4421
|
return n(e) && t.forEach((t) => {
|
|
4412
4422
|
t in e && e[t] !== void 0 && (r[t] = e[t]);
|
|
@@ -4414,7 +4424,7 @@ function Nn(e, t) {
|
|
|
4414
4424
|
}
|
|
4415
4425
|
//#endregion
|
|
4416
4426
|
//#region src/functions/getObjectNoUndefined.ts
|
|
4417
|
-
function
|
|
4427
|
+
function Fn(e, t = void 0) {
|
|
4418
4428
|
let n = {};
|
|
4419
4429
|
return r(e, (e, r) => {
|
|
4420
4430
|
e !== t && (n[r] = e);
|
|
@@ -4422,42 +4432,42 @@ function Pn(e, t = void 0) {
|
|
|
4422
4432
|
}
|
|
4423
4433
|
//#endregion
|
|
4424
4434
|
//#region src/functions/getObjectOrNone.ts
|
|
4425
|
-
function
|
|
4435
|
+
function In(e) {
|
|
4426
4436
|
return n(e) ? e : {};
|
|
4427
4437
|
}
|
|
4428
4438
|
//#endregion
|
|
4429
4439
|
//#region src/functions/getOnlyText.ts
|
|
4430
|
-
function
|
|
4440
|
+
function Ln(e) {
|
|
4431
4441
|
return F(e).replace(/[^\p{L}\p{N}\s]+/gu, "").trim();
|
|
4432
4442
|
}
|
|
4433
4443
|
//#endregion
|
|
4434
4444
|
//#region src/functions/strFill.ts
|
|
4435
|
-
function
|
|
4445
|
+
function Rn(e, t) {
|
|
4436
4446
|
return String(e).repeat(t);
|
|
4437
4447
|
}
|
|
4438
4448
|
//#endregion
|
|
4439
4449
|
//#region src/functions/getRandomText.ts
|
|
4440
|
-
function
|
|
4450
|
+
function zn(e, t, n = "#", r = 2, i = 12) {
|
|
4441
4451
|
let a = f(e, t), o = [];
|
|
4442
|
-
for (let e = 0; e < a; e++) o.push(
|
|
4452
|
+
for (let e = 0; e < a; e++) o.push(Rn(n, f(r, i)));
|
|
4443
4453
|
return o.join(" ");
|
|
4444
4454
|
}
|
|
4445
4455
|
//#endregion
|
|
4446
4456
|
//#region src/functions/getStepPercent.ts
|
|
4447
|
-
function
|
|
4457
|
+
function Bn(e, t) {
|
|
4448
4458
|
let n = e == null ? 0 : e;
|
|
4449
4459
|
return t > n ? 100 / (t - n) : 0;
|
|
4450
4460
|
}
|
|
4451
4461
|
//#endregion
|
|
4452
4462
|
//#region src/functions/getStepValue.ts
|
|
4453
|
-
function
|
|
4463
|
+
function Vn(e, t) {
|
|
4454
4464
|
let n = e == null ? 0 : e;
|
|
4455
4465
|
return t > n ? (t - n) / 100 : 0;
|
|
4456
4466
|
}
|
|
4457
4467
|
//#endregion
|
|
4458
4468
|
//#region src/functions/goScroll.ts
|
|
4459
|
-
var
|
|
4460
|
-
function
|
|
4469
|
+
var Hn = 0;
|
|
4470
|
+
function Un(e, t, n) {
|
|
4461
4471
|
if (!s()) return;
|
|
4462
4472
|
let r = t == null ? void 0 : t.closest(e);
|
|
4463
4473
|
if (t && r && r.scrollHeight !== r.offsetHeight) {
|
|
@@ -4465,12 +4475,12 @@ function Hn(e, t, n) {
|
|
|
4465
4475
|
if (n) {
|
|
4466
4476
|
let a = n.getBoundingClientRect();
|
|
4467
4477
|
r.scrollTop = t.offsetTop - (a.top - e.top) - (a.height / 2 - i.height / 2), r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = t.offsetTop + t.offsetHeight - r.offsetHeight);
|
|
4468
|
-
} else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top -
|
|
4478
|
+
} else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top - Hn : r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = i.top - e.top + i.height - e.height + Hn);
|
|
4469
4479
|
}
|
|
4470
4480
|
}
|
|
4471
4481
|
//#endregion
|
|
4472
4482
|
//#region src/functions/goScrollSmooth.ts
|
|
4473
|
-
function
|
|
4483
|
+
function Wn(e, t, n = 0) {
|
|
4474
4484
|
if (!s()) return;
|
|
4475
4485
|
let r = (t == null ? void 0 : t.behavior) || "smooth";
|
|
4476
4486
|
if ("scrollIntoView" in e && !n) {
|
|
@@ -4492,7 +4502,7 @@ function Un(e, t, n = 0) {
|
|
|
4492
4502
|
}
|
|
4493
4503
|
//#endregion
|
|
4494
4504
|
//#region src/functions/goScrollTo.ts
|
|
4495
|
-
function
|
|
4505
|
+
function Gn(e, t, n = "smooth") {
|
|
4496
4506
|
if (!s() || !e || !t) return;
|
|
4497
4507
|
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
4498
4508
|
e.scrollBy({
|
|
@@ -4503,13 +4513,13 @@ function Wn(e, t, n = "smooth") {
|
|
|
4503
4513
|
}
|
|
4504
4514
|
//#endregion
|
|
4505
4515
|
//#region src/functions/isShare.ts
|
|
4506
|
-
function
|
|
4516
|
+
function Kn() {
|
|
4507
4517
|
return s() && typeof navigator < "u" && !!navigator.share;
|
|
4508
4518
|
}
|
|
4509
4519
|
//#endregion
|
|
4510
4520
|
//#region src/functions/handleShare.ts
|
|
4511
|
-
async function
|
|
4512
|
-
if (
|
|
4521
|
+
async function qn(e) {
|
|
4522
|
+
if (Kn() && navigator.canShare && navigator.canShare(e)) try {
|
|
4513
4523
|
return await navigator.share(e), !0;
|
|
4514
4524
|
} catch (e) {
|
|
4515
4525
|
T.on({
|
|
@@ -4522,12 +4532,12 @@ async function Kn(e) {
|
|
|
4522
4532
|
}
|
|
4523
4533
|
//#endregion
|
|
4524
4534
|
//#region src/functions/inArray.ts
|
|
4525
|
-
function
|
|
4535
|
+
function Jn(e, t) {
|
|
4526
4536
|
return e.includes(t);
|
|
4527
4537
|
}
|
|
4528
4538
|
//#endregion
|
|
4529
4539
|
//#region src/functions/initScrollbarOffset.ts
|
|
4530
|
-
async function
|
|
4540
|
+
async function Yn() {
|
|
4531
4541
|
if (s()) {
|
|
4532
4542
|
let e = await At.get();
|
|
4533
4543
|
document.body.style.setProperty("--sys-scrollbar-offset", `${e}px`);
|
|
@@ -4535,7 +4545,7 @@ async function Jn() {
|
|
|
4535
4545
|
}
|
|
4536
4546
|
//#endregion
|
|
4537
4547
|
//#region src/functions/intersectKey.ts
|
|
4538
|
-
function
|
|
4548
|
+
function Xn(e, n) {
|
|
4539
4549
|
let i = {};
|
|
4540
4550
|
return t(e) && t(n) && r(e, (e, t) => {
|
|
4541
4551
|
t in n && (i[t] = e);
|
|
@@ -4543,7 +4553,7 @@ function Yn(e, n) {
|
|
|
4543
4553
|
}
|
|
4544
4554
|
//#endregion
|
|
4545
4555
|
//#region src/functions/isDifferent.ts
|
|
4546
|
-
function
|
|
4556
|
+
function Zn(e, t) {
|
|
4547
4557
|
let n = Object.keys(e).length !== Object.keys(t).length;
|
|
4548
4558
|
return n || r(e, (e, r) => {
|
|
4549
4559
|
e !== (t == null ? void 0 : t[r]) && (n = !0);
|
|
@@ -4551,7 +4561,7 @@ function Xn(e, t) {
|
|
|
4551
4561
|
}
|
|
4552
4562
|
//#endregion
|
|
4553
4563
|
//#region src/functions/isElementVisible.ts
|
|
4554
|
-
function
|
|
4564
|
+
function Qn(e) {
|
|
4555
4565
|
if (!s()) return !1;
|
|
4556
4566
|
let t = k(e);
|
|
4557
4567
|
if (!t || "isConnected" in t && t.isConnected === !1) return !1;
|
|
@@ -4560,16 +4570,16 @@ function Zn(e) {
|
|
|
4560
4570
|
}
|
|
4561
4571
|
//#endregion
|
|
4562
4572
|
//#region src/functions/isInput.ts
|
|
4563
|
-
var
|
|
4573
|
+
var $n = (e) => {
|
|
4564
4574
|
if (e instanceof HTMLElement) {
|
|
4565
4575
|
let t = e.tagName.toLowerCase();
|
|
4566
|
-
return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true");
|
|
4576
|
+
return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true") && !(e != null && e.readOnly) && !(e != null && e.disabled);
|
|
4567
4577
|
}
|
|
4568
4578
|
return !1;
|
|
4569
|
-
},
|
|
4579
|
+
}, er = (e, t) => e.code === "Space" || e.code === "Enter" || e.key === " " || e.key === "Spacebar" || e.key === "Enter" || e.keyCode === 13 || e.keyCode === 32 ? t === void 0 ? !$n(e.target) : !t : !1;
|
|
4570
4580
|
//#endregion
|
|
4571
4581
|
//#region src/functions/isFloat.ts
|
|
4572
|
-
function
|
|
4582
|
+
function tr(e) {
|
|
4573
4583
|
switch (typeof e) {
|
|
4574
4584
|
case "number": return !0;
|
|
4575
4585
|
case "string": return /^-?\d+(\.\d+)?$/.test(e);
|
|
@@ -4578,18 +4588,21 @@ function er(e) {
|
|
|
4578
4588
|
}
|
|
4579
4589
|
//#endregion
|
|
4580
4590
|
//#region src/functions/isIntegerBetween.ts
|
|
4581
|
-
function
|
|
4591
|
+
function nr(e, t) {
|
|
4582
4592
|
let n = Math.floor(t);
|
|
4583
4593
|
return e >= n && e < n + 1;
|
|
4584
4594
|
}
|
|
4585
4595
|
//#endregion
|
|
4586
4596
|
//#region src/functions/isSelectedByList.ts
|
|
4587
|
-
function
|
|
4597
|
+
function rr(e, t) {
|
|
4588
4598
|
return Array.isArray(e) ? e.every((e) => b(e, t)) : b(e, t);
|
|
4589
4599
|
}
|
|
4590
4600
|
//#endregion
|
|
4601
|
+
//#region src/functions/isTab.ts
|
|
4602
|
+
var ir = (e) => e.key === "Tab" || e.code === "Tab" || e.keyCode === 9;
|
|
4603
|
+
//#endregion
|
|
4591
4604
|
//#region src/functions/removeCommonPrefix.ts
|
|
4592
|
-
function
|
|
4605
|
+
function ar(e, t) {
|
|
4593
4606
|
if (e.startsWith(t)) return e.slice(t.length).trim();
|
|
4594
4607
|
let n = 0;
|
|
4595
4608
|
for (; e[n] === t[n] && n < e.length && n < t.length;) n++;
|
|
@@ -4597,13 +4610,13 @@ function rr(e, t) {
|
|
|
4597
4610
|
}
|
|
4598
4611
|
//#endregion
|
|
4599
4612
|
//#region src/functions/replaceComponentName.ts
|
|
4600
|
-
var
|
|
4613
|
+
var or = (e, t, n) => {
|
|
4601
4614
|
var r;
|
|
4602
4615
|
return e == null || (r = e.replace(RegExp(`<${t}`, "ig"), `<${n}`)) == null || (r = r.replace(RegExp(`</${t}`, "ig"), `</${n}`)) == null ? void 0 : r.trim();
|
|
4603
4616
|
};
|
|
4604
4617
|
//#endregion
|
|
4605
4618
|
//#region src/functions/uniqueArray.ts
|
|
4606
|
-
function
|
|
4619
|
+
function sr(e) {
|
|
4607
4620
|
return [...new Set(e)];
|
|
4608
4621
|
}
|
|
4609
4622
|
//#endregion
|
|
@@ -4612,12 +4625,12 @@ function $(e, n, i = !0) {
|
|
|
4612
4625
|
let a = Z(e);
|
|
4613
4626
|
return t(e) && t(n) && r(n, (n, r) => {
|
|
4614
4627
|
let o = e == null ? void 0 : e[r];
|
|
4615
|
-
t(o) && t(n) ? i && Array.isArray(o) && Array.isArray(n) ? a[r] = Z(
|
|
4628
|
+
t(o) && t(n) ? i && Array.isArray(o) && Array.isArray(n) ? a[r] = Z(sr([...o, ...n])) : a[r] = $(Array.isArray(o) ? { ...o } : o, n, i) : a[r] = t(n) ? Z(n) : n;
|
|
4616
4629
|
}), a;
|
|
4617
4630
|
}
|
|
4618
4631
|
//#endregion
|
|
4619
4632
|
//#region src/functions/replaceTemplate.ts
|
|
4620
|
-
function
|
|
4633
|
+
function cr(e, t) {
|
|
4621
4634
|
let n = e;
|
|
4622
4635
|
return r(t, (e, t) => {
|
|
4623
4636
|
n = n.replace(Lt(`[${t}]`), S(e));
|
|
@@ -4625,7 +4638,7 @@ function or(e, t) {
|
|
|
4625
4638
|
}
|
|
4626
4639
|
//#endregion
|
|
4627
4640
|
//#region src/functions/secondToTime.ts
|
|
4628
|
-
function
|
|
4641
|
+
function lr(e, t) {
|
|
4629
4642
|
let n = y(e);
|
|
4630
4643
|
if (n > 0) {
|
|
4631
4644
|
let e = String(Math.floor(n / 60)).padStart(2, "0"), r = String(n % 60).padStart(2, "0");
|
|
@@ -4635,7 +4648,7 @@ function sr(e, t) {
|
|
|
4635
4648
|
}
|
|
4636
4649
|
//#endregion
|
|
4637
4650
|
//#region src/functions/setValues.ts
|
|
4638
|
-
function
|
|
4651
|
+
function ur(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: a = !0, notEmpty: o = !1 }) {
|
|
4639
4652
|
if (n) {
|
|
4640
4653
|
if (i(e)) {
|
|
4641
4654
|
let n = e.indexOf(t), i = [...e];
|
|
@@ -4647,7 +4660,7 @@ function cr(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: a = !0, no
|
|
|
4647
4660
|
}
|
|
4648
4661
|
//#endregion
|
|
4649
4662
|
//#region src/functions/splice.ts
|
|
4650
|
-
function
|
|
4663
|
+
function dr(e, n, i) {
|
|
4651
4664
|
if (t(e) && t(n)) {
|
|
4652
4665
|
if (i) {
|
|
4653
4666
|
let a = {}, o = !1;
|
|
@@ -4661,34 +4674,34 @@ function lr(e, n, i) {
|
|
|
4661
4674
|
}
|
|
4662
4675
|
//#endregion
|
|
4663
4676
|
//#region src/functions/toCamelCaseFirst.ts
|
|
4664
|
-
function
|
|
4677
|
+
function fr(e) {
|
|
4665
4678
|
return it(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
|
|
4666
4679
|
}
|
|
4667
4680
|
//#endregion
|
|
4668
4681
|
//#region src/functions/toKebabCase.ts
|
|
4669
|
-
function
|
|
4682
|
+
function pr(e) {
|
|
4670
4683
|
return e.toString().trim().replace(/[^\w-. ]+/g, "").replace(/[ .]+/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (e) => `${e.toLowerCase()}`).replace(/^[A-Z]/, (e) => e.toLowerCase()).replace(/(?<=[\w ])[A-Z]/g, (e) => `-${e.toLowerCase()}`).replace(/[A-Z]/g, (e) => e.toLowerCase());
|
|
4671
4684
|
}
|
|
4672
4685
|
//#endregion
|
|
4673
4686
|
//#region src/functions/toNumberByMax.ts
|
|
4674
|
-
function
|
|
4687
|
+
function mr(e, t, n, r) {
|
|
4675
4688
|
let i = y(e), a = y(t);
|
|
4676
|
-
return t && a < i ? `${
|
|
4689
|
+
return t && a < i ? `${hr(a, n, r)}+` : hr(i, n, r);
|
|
4677
4690
|
}
|
|
4678
|
-
var
|
|
4691
|
+
var hr = (e, t, n) => t ? new R(n).number(e) : e;
|
|
4679
4692
|
//#endregion
|
|
4680
4693
|
//#region src/functions/toPercent.ts
|
|
4681
|
-
function
|
|
4694
|
+
function gr(e, t) {
|
|
4682
4695
|
return e === 0 ? t : 1 / e * t;
|
|
4683
4696
|
}
|
|
4684
4697
|
//#endregion
|
|
4685
4698
|
//#region src/functions/toPercentBy100.ts
|
|
4686
|
-
function
|
|
4687
|
-
return
|
|
4699
|
+
function _r(e, t) {
|
|
4700
|
+
return gr(e, t) * 100;
|
|
4688
4701
|
}
|
|
4689
4702
|
//#endregion
|
|
4690
4703
|
//#region src/functions/uint8ArrayToBase64.ts
|
|
4691
|
-
function
|
|
4704
|
+
function vr(e) {
|
|
4692
4705
|
let t = "";
|
|
4693
4706
|
for (let n of e) t += String.fromCharCode(n);
|
|
4694
4707
|
if (s()) return window.btoa(t);
|
|
@@ -4700,7 +4713,7 @@ function gr(e) {
|
|
|
4700
4713
|
}
|
|
4701
4714
|
//#endregion
|
|
4702
4715
|
//#region src/functions/writeClipboardData.ts
|
|
4703
|
-
async function
|
|
4716
|
+
async function yr(e) {
|
|
4704
4717
|
if (s()) try {
|
|
4705
4718
|
await navigator.clipboard.writeText(e);
|
|
4706
4719
|
} catch (n) {
|
|
@@ -4709,4 +4722,4 @@ async function _r(e) {
|
|
|
4709
4722
|
}
|
|
4710
4723
|
}
|
|
4711
4724
|
//#endregion
|
|
4712
|
-
export { P as Api, M as ApiCache, Ae as ApiDataReturn, je as ApiDefault, Pe as ApiError, Me as ApiErrorItem, Ne as ApiErrorStorage, Fe as ApiHeaders, Le as ApiHydration, He as ApiInstance, N as ApiMethodItem, Re as ApiPreparation, Ve as ApiResponse, Oe as ApiStatus, Ue as BroadcastMessage, Ke as Cache, Ge as CacheItem, qe as CacheStatic, tt as Cookie, Qe as CookieBlock, Ze as CookieBlockInstance, I as CookieStorage, D as DataStorage, rt as Datetime, T as ErrorCenter, le as ErrorCenterHandler, ue as ErrorCenterInstance, Ce as EventItem, at as Formatters, H as FormattersType, ot as GEO_FLAG_ICON_NAME, O as Geo, st as GeoFlag, ye as GeoInstance, R as GeoIntl, ct as GeoPhone, lt as Global, dt as Hash, ut as HashInstance, mt as Icons, j as Loading, Te as LoadingInstance, Dt as Meta, G as MetaManager, Tt as MetaOg, St as MetaOpenGraphAge, bt as MetaOpenGraphAvailability, xt as MetaOpenGraphCondition, Ct as MetaOpenGraphGender, q as MetaOpenGraphTag, yt as MetaOpenGraphType, vt as MetaRobots, Ot as MetaStatic, K as MetaTag, Et as MetaTwitter, wt as MetaTwitterCard, J as MetaTwitterTag, kt as ResumableTimer, At as ScrollbarWidth, Ht as SearchList, Ft as SearchListData, It as SearchListItem, Bt as SearchListMatcher, Vt as SearchListOptions, E as ServerStorage, Wt as StorageCallback, Yt as TRANSLATE_GLOBAL_PREFIX, Xt as TRANSLATE_TIME_OUT, $t as Translate, Zt as TranslateFile, Qt as TranslateInstance, Pt as addTagHighlightMatch, F as anyToString, qt as applyTemplate, en as arrFill, on as blobToBase64, sn as capitalize, Z as copyObject, cn as copyObjectLite, U as createElement, ln as domQuerySelector, un as domQuerySelectorAll, W as encodeAttribute, ae as encodeLiteAttribute, mn as ensureMaxSize, Y as escapeExp, hn as eventStopPropagation, S as executeFunction, ze as executePromise, r as forEach, gn as frame, _n as getArrayHighlightMatch, vn as getAttributes, yn as getClipboardData, nt as getColumn, bn as getCurrentDate, xn as getCurrentTime, k as getElement, Cn as getElementId, dn as getElementImage, ht as getElementItem, xe as getElementOrWindow, fe as getElementSafeScript, Rt as getExactSearchExp, Lt as getExp, Tn as getFirst, pe as getHydrationData, V as getItemByPath, En as getKey, Dn as
|
|
4725
|
+
export { P as Api, M as ApiCache, Ae as ApiDataReturn, je as ApiDefault, Pe as ApiError, Me as ApiErrorItem, Ne as ApiErrorStorage, Fe as ApiHeaders, Le as ApiHydration, He as ApiInstance, N as ApiMethodItem, Re as ApiPreparation, Ve as ApiResponse, Oe as ApiStatus, Ue as BroadcastMessage, Ke as Cache, Ge as CacheItem, qe as CacheStatic, tt as Cookie, Qe as CookieBlock, Ze as CookieBlockInstance, I as CookieStorage, D as DataStorage, rt as Datetime, T as ErrorCenter, le as ErrorCenterHandler, ue as ErrorCenterInstance, Ce as EventItem, at as Formatters, H as FormattersType, ot as GEO_FLAG_ICON_NAME, O as Geo, st as GeoFlag, ye as GeoInstance, R as GeoIntl, ct as GeoPhone, lt as Global, dt as Hash, ut as HashInstance, mt as Icons, j as Loading, Te as LoadingInstance, Dt as Meta, G as MetaManager, Tt as MetaOg, St as MetaOpenGraphAge, bt as MetaOpenGraphAvailability, xt as MetaOpenGraphCondition, Ct as MetaOpenGraphGender, q as MetaOpenGraphTag, yt as MetaOpenGraphType, vt as MetaRobots, Ot as MetaStatic, K as MetaTag, Et as MetaTwitter, wt as MetaTwitterCard, J as MetaTwitterTag, kt as ResumableTimer, At as ScrollbarWidth, Ht as SearchList, Ft as SearchListData, It as SearchListItem, Bt as SearchListMatcher, Vt as SearchListOptions, E as ServerStorage, Wt as StorageCallback, Yt as TRANSLATE_GLOBAL_PREFIX, Xt as TRANSLATE_TIME_OUT, $t as Translate, Zt as TranslateFile, Qt as TranslateInstance, Pt as addTagHighlightMatch, F as anyToString, qt as applyTemplate, en as arrFill, on as blobToBase64, sn as capitalize, Z as copyObject, cn as copyObjectLite, U as createElement, ln as domQuerySelector, un as domQuerySelectorAll, W as encodeAttribute, ae as encodeLiteAttribute, mn as ensureMaxSize, Y as escapeExp, hn as eventStopPropagation, S as executeFunction, ze as executePromise, r as forEach, gn as frame, _n as getArrayHighlightMatch, vn as getAttributes, yn as getClipboardData, nt as getColumn, bn as getCurrentDate, xn as getCurrentTime, k as getElement, Cn as getElementId, dn as getElementImage, ht as getElementItem, xe as getElementOrWindow, fe as getElementSafeScript, Rt as getExactSearchExp, Lt as getExp, Tn as getFirst, pe as getHydrationData, V as getItemByPath, En as getKey, Dn as getLength, On as getLengthOfAllArray, kn as getMaxLengthAllArray, An as getMinLengthAllArray, Nn as getMouseClient, jn as getMouseClientX, Mn as getMouseClientY, Pn as getObjectByKeys, Fn as getObjectNoUndefined, In as getObjectOrNone, Ln as getOnlyText, zn as getRandomText, o as getRequestString, zt as getSearchExp, jt as getSeparatingSearchExp, Bn as getStepPercent, Vn as getStepValue, Un as goScroll, Wn as goScrollSmooth, Gn as goScrollTo, qn as handleShare, Jn as inArray, wn as initGetElementId, Yn as initScrollbarOffset, Xn as intersectKey, Jt as isApiSuccess, i as isArray, Zn as isDifferent, oe as isDomData, s as isDomRuntime, Qn as isElementVisible, er as isEnter, l as isFilled, tr as isFloat, x as isFunction, Se as isInDom, $n as isInput, nr as isIntegerBetween, c as isNull, p as isNumber, t as isObject, n as isObjectNotArray, u as isOnLine, b as isSelected, rr as isSelectedByList, Kn as isShare, d as isString, ir as isTab, be as isWindow, f as random, ar as removeCommonPrefix, or as replaceComponentName, $ as replaceRecursive, cr as replaceTemplate, pn as resizeImageByMax, lr as secondToTime, gt as setElementItem, ur as setValues, ee as sleep, dr as splice, Rn as strFill, Je as strSplit, A as toArray, it as toCamelCase, fr as toCamelCaseFirst, L as toDate, pr as toKebabCase, y as toNumber, mr as toNumberByMax, gr as toPercent, _r as toPercentBy100, a as toString, Ye as transformation, vr as uint8ArrayToBase64, sr as uniqueArray, yr as writeClipboardData };
|
|
@@ -30,6 +30,13 @@ export declare class GeoFlag {
|
|
|
30
30
|
* @returns country information / информация о стране
|
|
31
31
|
*/
|
|
32
32
|
get(code?: string): GeoFlagItem | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the country code.
|
|
35
|
+
*
|
|
36
|
+
* Возвращает код страны.
|
|
37
|
+
* @returns country code / код страны
|
|
38
|
+
*/
|
|
39
|
+
getCode(): string;
|
|
33
40
|
/**
|
|
34
41
|
* Returns the identifier of the flag icon.
|
|
35
42
|
*
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the length or size of various data types including Arrays, Objects, Maps, Sets, and Strings.
|
|
3
|
+
* If the value is null, undefined, or an unsupported type (e.g. number, boolean), it returns 0.
|
|
4
|
+
*
|
|
5
|
+
* Возвращает длину или размер различных типов данных, включая массивы, объекты, Map, Set и строки.
|
|
6
|
+
* Если значение равно null, undefined или имеет неподдерживаемый тип (например, число, булево), возвращает 0.
|
|
7
|
+
* @param value input value to measure / входное значение для измерения
|
|
8
|
+
* @returns the length or size of the value / длина или размер значения
|
|
9
|
+
*/
|
|
10
|
+
export declare function getLength(value: any): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the pressed key is Tab.
|
|
3
|
+
*
|
|
4
|
+
* Проверяет, является ли нажатая клавиша Tab.
|
|
5
|
+
* @param event - event object / объект события
|
|
6
|
+
* @returns true if tab pressed / true, если нажат tab
|
|
7
|
+
*/
|
|
8
|
+
export declare const isTab: (event: KeyboardEvent) => boolean;
|
package/dist/src/library.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export * from './functions/getFirst';
|
|
|
92
92
|
export * from './functions/getHydrationData';
|
|
93
93
|
export * from './functions/getItemByPath';
|
|
94
94
|
export * from './functions/getKey';
|
|
95
|
+
export * from './functions/getLength';
|
|
95
96
|
export * from './functions/getLengthOfAllArray';
|
|
96
97
|
export * from './functions/getMaxLengthAllArray';
|
|
97
98
|
export * from './functions/getMinLengthAllArray';
|
|
@@ -137,6 +138,7 @@ export * from './functions/isSelected';
|
|
|
137
138
|
export * from './functions/isSelectedByList';
|
|
138
139
|
export * from './functions/isShare';
|
|
139
140
|
export * from './functions/isString';
|
|
141
|
+
export * from './functions/isTab';
|
|
140
142
|
export * from './functions/isWindow';
|
|
141
143
|
export * from './functions/random';
|
|
142
144
|
export * from './functions/removeCommonPrefix';
|
|
@@ -53,6 +53,8 @@ export interface GeoFlagItem {
|
|
|
53
53
|
label: string;
|
|
54
54
|
/** Value for selection/ Значение для выбора */
|
|
55
55
|
value: string;
|
|
56
|
+
/** Phone country code/ Телефонный код страны */
|
|
57
|
+
phoneCode?: string;
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
60
|
* Extended geographic flag item with national language information/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/functional-basic",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Foundational utility library for modern web development — HTTP client, geolocation, i18n, SEO meta tags, caching, storage, DOM utilities, and more. Framework-agnostic, zero dependencies, TypeScript-first.",
|
|
7
7
|
"keywords": [
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dev": "vite",
|
|
52
52
|
"build": "vite build",
|
|
53
53
|
"preview": "vite preview",
|
|
54
|
-
"test": "vitest",
|
|
54
|
+
"test": "NODE_OPTIONS=\"--no-webstorage\" vitest",
|
|
55
55
|
"library": "dxt-library",
|
|
56
56
|
"types": "dxt-types",
|
|
57
57
|
"prepublishOnly": "npm run library && npm run build",
|
|
@@ -83,5 +83,6 @@
|
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@dxtmisha/media": "*"
|
|
85
85
|
},
|
|
86
|
-
"sideEffects": false
|
|
86
|
+
"sideEffects": false,
|
|
87
|
+
"ui-priority": 100
|
|
87
88
|
}
|