@scbt-ecom/ui 0.82.4 → 0.84.0
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/config.js +118 -326
- package/dist/config.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +224 -0
- package/dist/constants.js.map +1 -0
- package/dist/hooks.js +2 -2
- package/dist/{index-DvwaDy1x.js → index-5WLPawT4.js} +10835 -11449
- package/dist/index-5WLPawT4.js.map +1 -0
- package/dist/{index-9VvWDfzt.js → index-BO81H324.js} +2 -2
- package/dist/{index-9VvWDfzt.js.map → index-BO81H324.js.map} +1 -1
- package/dist/lib/exports/constants.d.ts +1 -0
- package/dist/lib/shared/constants/designSystem/index.d.ts +1 -0
- package/dist/lib/shared/constants/designSystem/types.d.ts +2 -0
- package/dist/lib/shared/ui/customLink/CustomLink.d.ts +2 -1
- package/dist/lib/shared/utils/index.d.ts +2 -0
- package/dist/lib/shared/utils/renderImage.d.ts +6 -0
- package/dist/lib/shared/utils/sessionStorage.d.ts +2 -0
- package/dist/lib/widgets/banner/Banner.d.ts +9 -14
- package/dist/lib/widgets/index.d.ts +1 -0
- package/dist/lib/widgets/infoBlock/InfoBlock.d.ts +19 -0
- package/dist/lib/widgets/infoBlock/index.d.ts +1 -0
- package/dist/lib/widgets/infoBlock/ui/LinksList.d.ts +10 -0
- package/dist/lib/widgets/infoBlock/ui/RootContent.d.ts +22 -0
- package/dist/lib/widgets/infoBlock/ui/index.d.ts +1 -0
- package/dist/lib/widgets/model/helpers.d.ts +2 -1
- package/dist/mergeRefs-Danc3mp8.js +640 -0
- package/dist/mergeRefs-Danc3mp8.js.map +1 -0
- package/dist/renderImage-D1GvKq_K.js +49 -0
- package/dist/renderImage-D1GvKq_K.js.map +1 -0
- package/dist/ui.js +7 -7
- package/dist/{useDebounce-maGDilFr.js → useDebounce-CEu2ysPk.js} +3 -3
- package/dist/{useDebounce-maGDilFr.js.map → useDebounce-CEu2ysPk.js.map} +1 -1
- package/dist/{useFieldsProgress-egXj013a.js → useFieldsProgress-DvWCpALA.js} +6 -6
- package/dist/{useFieldsProgress-egXj013a.js.map → useFieldsProgress-DvWCpALA.js.map} +1 -1
- package/dist/{utils-Bu1Zg675.js → utils-CnDzHNQ6.js} +62 -62
- package/dist/{utils-Bu1Zg675.js.map → utils-CnDzHNQ6.js.map} +1 -1
- package/dist/utils.js +48 -28
- package/dist/utils.js.map +1 -1
- package/dist/validation.js +2 -2
- package/dist/widget.js +413 -352
- package/dist/widget.js.map +1 -1
- package/package.json +5 -1
- package/dist/index-DvwaDy1x.js.map +0 -1
- package/dist/lib/widgets/banner/model/constants.d.ts +0 -15
- package/dist/localStorageActions-DRn18qhh.js +0 -47
- package/dist/localStorageActions-DRn18qhh.js.map +0 -1
- package/dist/mergeRefs-qDToYXtM.js +0 -12
- package/dist/mergeRefs-qDToYXtM.js.map +0 -1
package/dist/utils.js
CHANGED
|
@@ -1,47 +1,67 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { T as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { a as w, c as I, l as R, r as D, s as N } from "./renderImage-D1GvKq_K.js";
|
|
2
|
+
import { T as a } from "./typeGuards-CSiImkUY.js";
|
|
3
|
+
import { c as V } from "./typeGuards-CSiImkUY.js";
|
|
4
|
+
import { i as v } from "./isClient-C9aZtt2Q.js";
|
|
5
|
+
import { m as C } from "./mergeRefs-Danc3mp8.js";
|
|
5
6
|
const t = [];
|
|
6
7
|
for (let e = 0; e < 256; ++e)
|
|
7
8
|
t.push((e + 256).toString(16).slice(1));
|
|
8
|
-
function
|
|
9
|
+
function u(e, n = 0) {
|
|
9
10
|
return (t[e[n + 0]] + t[e[n + 1]] + t[e[n + 2]] + t[e[n + 3]] + "-" + t[e[n + 4]] + t[e[n + 5]] + "-" + t[e[n + 6]] + t[e[n + 7]] + "-" + t[e[n + 8]] + t[e[n + 9]] + "-" + t[e[n + 10]] + t[e[n + 11]] + t[e[n + 12]] + t[e[n + 13]] + t[e[n + 14]] + t[e[n + 15]]).toLowerCase();
|
|
10
11
|
}
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
12
|
+
let o;
|
|
13
|
+
const l = new Uint8Array(16);
|
|
14
|
+
function d() {
|
|
15
|
+
if (!o) {
|
|
15
16
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
16
17
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
17
|
-
|
|
18
|
+
o = crypto.getRandomValues.bind(crypto);
|
|
18
19
|
}
|
|
19
|
-
return
|
|
20
|
+
return o(l);
|
|
20
21
|
}
|
|
21
|
-
const
|
|
22
|
-
function
|
|
22
|
+
const m = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), i = { randomUUID: m };
|
|
23
|
+
function g(e, n, s) {
|
|
23
24
|
var c;
|
|
24
|
-
if (
|
|
25
|
-
return
|
|
25
|
+
if (i.randomUUID && !e)
|
|
26
|
+
return i.randomUUID();
|
|
26
27
|
e = e || {};
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
28
|
+
const r = e.random ?? ((c = e.rng) == null ? void 0 : c.call(e)) ?? d();
|
|
29
|
+
if (r.length < 16)
|
|
29
30
|
throw new Error("Random bytes length must be >= 16");
|
|
30
|
-
return
|
|
31
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, u(r);
|
|
31
32
|
}
|
|
32
|
-
const p = () =>
|
|
33
|
+
const p = () => g(), S = (e, n) => {
|
|
33
34
|
console.error(n ?? "process all the cases");
|
|
35
|
+
}, U = (e, n) => {
|
|
36
|
+
if (!sessionStorage)
|
|
37
|
+
return console.warn("Session storage can be used only in client side");
|
|
38
|
+
if (a.isNil(n)) return;
|
|
39
|
+
const s = JSON.stringify(n);
|
|
40
|
+
sessionStorage.setItem(e, s);
|
|
41
|
+
}, x = (e) => {
|
|
42
|
+
if (!sessionStorage)
|
|
43
|
+
return console.warn("Session storage can be used only in client side"), null;
|
|
44
|
+
const n = sessionStorage.getItem(e);
|
|
45
|
+
if (a.isNull(n)) return null;
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(n);
|
|
48
|
+
} catch {
|
|
49
|
+
return n;
|
|
50
|
+
}
|
|
34
51
|
};
|
|
35
52
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
a as TypeGuards,
|
|
54
|
+
S as assertUnreachable,
|
|
55
|
+
w as capitalize,
|
|
56
|
+
V as cn,
|
|
57
|
+
I as createPhoneNumber,
|
|
58
|
+
x as getSessionStorage,
|
|
41
59
|
p as getUuid,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
v as isClient,
|
|
61
|
+
R as localStorageActions,
|
|
62
|
+
C as mergeRefs,
|
|
63
|
+
D as renderImage,
|
|
64
|
+
N as scrollToElement,
|
|
65
|
+
U as setSessionStorage
|
|
46
66
|
};
|
|
47
67
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js","../lib/shared/utils/uuid.ts","../lib/shared/utils/assertUnreachable.ts"],"sourcesContent":["import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n","import { v4 as uuid } from 'uuid'\n\nexport const getUuid = () => uuid()\n","// @ts-expect-error - x\nexport const assertUnreachable = (x: never, msg?: string): never => {\n console.error(msg ?? 'process all the cases')\n}\n"],"names":["byteToHex","i","unsafeStringify","arr","offset","getRandomValues","rnds8","rng","randomUUID","native","v4","options","buf","rnds","_a","getUuid","uuid","assertUnreachable","x","msg"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js","../lib/shared/utils/uuid.ts","../lib/shared/utils/assertUnreachable.ts","../lib/shared/utils/sessionStorage.ts"],"sourcesContent":["import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n","import { v4 as uuid } from 'uuid'\n\nexport const getUuid = () => uuid()\n","// @ts-expect-error - x\nexport const assertUnreachable = (x: never, msg?: string): never => {\n console.error(msg ?? 'process all the cases')\n}\n","import { TypeGuards } from './typeGuards'\n\nexport const setSessionStorage = <T>(key: string, value: T) => {\n if (!sessionStorage) {\n return console.warn('Session storage can be used only in client side')\n }\n\n if (TypeGuards.isNil(value)) return\n\n const payload = JSON.stringify(value)\n\n sessionStorage.setItem(key, payload)\n}\n\nexport const getSessionStorage = <T>(key: string): T | null => {\n if (!sessionStorage) {\n console.warn('Session storage can be used only in client side')\n return null\n }\n\n const item = sessionStorage.getItem(key)\n\n if (TypeGuards.isNull(item)) return null\n\n try {\n return JSON.parse(item) as T\n } catch {\n return item as T\n }\n}\n"],"names":["byteToHex","i","unsafeStringify","arr","offset","getRandomValues","rnds8","rng","randomUUID","native","v4","options","buf","rnds","_a","getUuid","uuid","assertUnreachable","x","msg","setSessionStorage","key","value","TypeGuards","payload","getSessionStorage","item"],"mappings":";;;;;AACA,MAAMA,IAAY,CAAE;AACpB,SAASC,IAAI,G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AAGC,GAASC,GAAKR,GAAQ;;AAC9B,MAAIK,EAAO,cAAsB,CAACE;AAC9B,WAAOF,EAAO,WAAY;AAE9B,EAAAE,IAAUA,KAAW,CAAE;AACvB,QAAME,IAAOF,EAAQ,YAAUG,IAAAH,EAAQ,QAAR,gBAAAG,EAAA,KAAAH,OAAmBJ,EAAK;AACvD,MAAIM,EAAK,SAAS;AACd,UAAM,IAAI,MAAM,mCAAmC;AAEvD,SAAAA,EAAK,CAAC,IAAKA,EAAK,CAAC,IAAI,KAAQ,IAC7BA,EAAK,CAAC,IAAKA,EAAK,CAAC,IAAI,KAAQ,KAWtBX,EAAgBW,CAAI;AAC/B;ACvBa,MAAAE,IAAU,MAAMC,EAAK,GCDrBC,IAAoB,CAACC,GAAUC,MAAwB;AAC1D,UAAA,MAAMA,KAAO,uBAAuB;AAC9C,GCDaC,IAAoB,CAAIC,GAAaC,MAAa;AAC7D,MAAI,CAAC;AACI,WAAA,QAAQ,KAAK,iDAAiD;AAGnE,MAAAC,EAAW,MAAMD,CAAK,EAAG;AAEvB,QAAAE,IAAU,KAAK,UAAUF,CAAK;AAErB,iBAAA,QAAQD,GAAKG,CAAO;AACrC,GAEaC,IAAoB,CAAIJ,MAA0B;AAC7D,MAAI,CAAC;AACH,mBAAQ,KAAK,iDAAiD,GACvD;AAGH,QAAAK,IAAO,eAAe,QAAQL,CAAG;AAEvC,MAAIE,EAAW,OAAOG,CAAI,EAAU,QAAA;AAEhC,MAAA;AACK,WAAA,KAAK,MAAMA,CAAI;AAAA,EAAA,QAChB;AACC,WAAAA;AAAA,EAAA;AAEX;","x_google_ignoreList":[0,1,2,3]}
|
package/dist/validation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as l, b as y, a as F, z as R } from "./index-
|
|
2
|
-
import { s as i, Z as a, p as u, i as r, c as I } from "./utils-
|
|
1
|
+
import { Z as l, b as y, a as F, z as R } from "./index-BO81H324.js";
|
|
2
|
+
import { s as i, Z as a, p as u, i as r, c as I } from "./utils-CnDzHNQ6.js";
|
|
3
3
|
const E = /^[\u0400-\u04FF\u00CB\u00EB -]+$/, m = /^(?:[^-]+(?:-[^-]+){0,4}|[^-]+)$/, _ = /^[a-zA-Zа-яА-ЯёЁ]+(?:\s*-\s*[a-zA-Zа-яА-ЯёЁ]+){0,4}(?:\s+[a-zA-Zа-яА-ЯёЁ]+(?:\s*-\s*[a-zA-Zа-яА-ЯёЁ]+){0,4})?$/i, t = {
|
|
4
4
|
REQUIRED: "Поле обязательно к заполнению",
|
|
5
5
|
MIN_LENGTH: "Минимальная длина символов должна быть не менее",
|