@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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as u from "react";
|
|
2
|
-
import { useState as m, useEffect as
|
|
3
|
-
import {
|
|
2
|
+
import { useState as m, useEffect as f } from "react";
|
|
3
|
+
import { f as b } from "./useDebounce-CEu2ysPk.js";
|
|
4
4
|
const P = (o = !1) => {
|
|
5
5
|
const [e, a] = u.useState(o);
|
|
6
6
|
return [e, (c) => a((r) => c ?? !r)];
|
|
7
|
-
},
|
|
7
|
+
}, g = (o) => {
|
|
8
8
|
var e;
|
|
9
9
|
return (e = Object.values(o)) == null ? void 0 : e.reduce((a, t) => a + (t == null ? void 0 : t.progress), 0);
|
|
10
10
|
}, x = ({
|
|
@@ -13,14 +13,14 @@ const P = (o = !1) => {
|
|
|
13
13
|
fields: a
|
|
14
14
|
}) => {
|
|
15
15
|
const [t, c] = m(a), r = b({ control: o });
|
|
16
|
-
return
|
|
16
|
+
return f(() => {
|
|
17
17
|
c(
|
|
18
18
|
(n) => n == null ? void 0 : n.map((s) => e.shape[s.name].safeParse(r[s.name]).success && r[s.name] && r[s.name] !== "" ? { ...s, progress: s.maxPercent } : { ...s, progress: 0 })
|
|
19
19
|
);
|
|
20
|
-
}, [r]),
|
|
20
|
+
}, [r]), g(t);
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
23
|
x as a,
|
|
24
24
|
P as u
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=useFieldsProgress-
|
|
26
|
+
//# sourceMappingURL=useFieldsProgress-DvWCpALA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldsProgress-
|
|
1
|
+
{"version":3,"file":"useFieldsProgress-DvWCpALA.js","sources":["../lib/shared/hooks/useBoolean.ts","../lib/shared/hooks/useFieldsProgress.ts"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n\ntype UseBooleanReturn = [value: boolean, action: (val?: boolean) => void]\n\nexport const useBoolean = (initialValue = false): UseBooleanReturn => {\n const [value, setValue] = React.useState(initialValue)\n const action = (val?: boolean) => setValue((prevValue) => val ?? !prevValue)\n\n return [value, action]\n}\n","'use client'\n\nimport { useEffect, useState } from 'react'\nimport { type Control, type FieldValues, type Path, useWatch } from 'react-hook-form'\nimport { type ZodObject, type ZodRawShape } from 'zod'\n\nexport interface ISubscribedField<T extends FieldValues> {\n name: Path<T>\n progress: number\n maxPercent: number\n}\n\ntype TUseFieldsProgress<T extends FieldValues, S extends ZodRawShape> = {\n control: Control<T>\n schema: ZodObject<S>\n fields: ISubscribedField<T>[]\n}\n\nconst formatProgress = <T extends FieldValues>(subscribeFields: ISubscribedField<T>[]) => {\n return Object.values(subscribeFields)?.reduce((acc, value) => {\n return acc + value?.progress\n }, 0)\n}\n\nexport const useFieldsProgress = <T extends FieldValues, S extends ZodRawShape>({\n control,\n schema,\n fields\n}: TUseFieldsProgress<T, S>): number => {\n const [subscribeFields, setSubscribeFields] = useState<ISubscribedField<T>[]>(fields)\n const watchedFields = useWatch({ control })\n\n useEffect(() => {\n setSubscribeFields((prevFields) =>\n prevFields?.map((field) => {\n const fieldSchema = schema.shape[field.name]\n const result = fieldSchema.safeParse(watchedFields[field.name])\n if (result.success && watchedFields[field.name] && watchedFields[field.name] !== '') {\n return { ...field, progress: field.maxPercent }\n } else {\n return { ...field, progress: 0 }\n }\n })\n )\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [watchedFields])\n\n return formatProgress(subscribeFields)\n}\n"],"names":["useBoolean","initialValue","value","setValue","React","val","prevValue","formatProgress","subscribeFields","_a","acc","useFieldsProgress","control","schema","fields","setSubscribeFields","useState","watchedFields","useWatch","useEffect","prevFields","field"],"mappings":";;;AAMa,MAAAA,IAAa,CAACC,IAAe,OAA4B;AACpE,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAM,SAASH,CAAY;AAG9C,SAAA,CAACC,GAFO,CAACG,MAAkBF,EAAS,CAACG,MAAcD,KAAO,CAACC,CAAS,CAEtD;AACvB,GCOMC,IAAiB,CAAwBC,MAA2C;;AACxF,UAAOC,IAAA,OAAO,OAAOD,CAAe,MAA7B,gBAAAC,EAAgC,OAAO,CAACC,GAAKR,MAC3CQ,KAAMR,KAAA,gBAAAA,EAAO,WACnB;AACL,GAEaS,IAAoB,CAA+C;AAAA,EAC9E,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AACF,MAAwC;AACtC,QAAM,CAACN,GAAiBO,CAAkB,IAAIC,EAAgCF,CAAM,GAC9EG,IAAgBC,EAAS,EAAE,SAAAN,GAAS;AAE1C,SAAAO,EAAU,MAAM;AACd,IAAAJ;AAAA,MAAmB,CAACK,MAClBA,KAAA,gBAAAA,EAAY,IAAI,CAACC,MACKR,EAAO,MAAMQ,EAAM,IAAI,EAChB,UAAUJ,EAAcI,EAAM,IAAI,CAAC,EACnD,WAAWJ,EAAcI,EAAM,IAAI,KAAKJ,EAAcI,EAAM,IAAI,MAAM,KACxE,EAAE,GAAGA,GAAO,UAAUA,EAAM,WAAW,IAEvC,EAAE,GAAGA,GAAO,UAAU,EAAE;AAAA,IAGrC;AAAA,EAAA,GAEC,CAACJ,CAAa,CAAC,GAEXV,EAAeC,CAAe;AACvC;"}
|
|
@@ -5011,46 +5011,46 @@ const jn = "dd.MM.yyyy", Yn = (a, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
|
5011
5011
|
day: "text-center"
|
|
5012
5012
|
};
|
|
5013
5013
|
export {
|
|
5014
|
-
|
|
5015
|
-
|
|
5014
|
+
rn as $,
|
|
5015
|
+
_e as A,
|
|
5016
5016
|
Ba as B,
|
|
5017
|
-
|
|
5017
|
+
ee as C,
|
|
5018
5018
|
ue as D,
|
|
5019
5019
|
Ha as E,
|
|
5020
|
-
|
|
5021
|
-
G,
|
|
5022
|
-
|
|
5020
|
+
G as F,
|
|
5021
|
+
P as G,
|
|
5022
|
+
q as H,
|
|
5023
5023
|
y as I,
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5024
|
+
h as J,
|
|
5025
|
+
De as K,
|
|
5026
|
+
he as L,
|
|
5027
|
+
Ce as M,
|
|
5028
5028
|
In as N,
|
|
5029
5029
|
R as O,
|
|
5030
5030
|
I as P,
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5031
|
+
be as Q,
|
|
5032
|
+
se as R,
|
|
5033
|
+
L as S,
|
|
5034
|
+
je as T,
|
|
5035
|
+
H as U,
|
|
5036
|
+
ge as V,
|
|
5037
|
+
ve as W,
|
|
5038
|
+
re as X,
|
|
5039
|
+
Ye as Y,
|
|
5040
5040
|
c as Z,
|
|
5041
|
-
|
|
5041
|
+
l as _,
|
|
5042
5042
|
v as a,
|
|
5043
5043
|
Yr as a$,
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5044
|
+
on as a0,
|
|
5045
|
+
Ga as a1,
|
|
5046
|
+
Qt as a2,
|
|
5047
|
+
qt as a3,
|
|
5048
|
+
Ja as a4,
|
|
5049
|
+
Lt as a5,
|
|
5050
|
+
le as a6,
|
|
5051
|
+
ln as a7,
|
|
5052
|
+
kn as a8,
|
|
5053
|
+
wn as a9,
|
|
5054
5054
|
Cn as aA,
|
|
5055
5055
|
Pn as aB,
|
|
5056
5056
|
xn as aC,
|
|
@@ -5078,27 +5078,27 @@ export {
|
|
|
5078
5078
|
ht as aY,
|
|
5079
5079
|
me as aZ,
|
|
5080
5080
|
Zr as a_,
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5081
|
+
gn as aa,
|
|
5082
|
+
Ae as ab,
|
|
5083
|
+
Q as ac,
|
|
5084
|
+
Ua as ad,
|
|
5085
|
+
fn as ae,
|
|
5086
|
+
Ke as af,
|
|
5087
|
+
pe as ag,
|
|
5088
|
+
et as ah,
|
|
5089
|
+
ae as ai,
|
|
5090
|
+
Qa as aj,
|
|
5091
|
+
_n as ak,
|
|
5092
|
+
vn as al,
|
|
5093
|
+
Ze as am,
|
|
5094
|
+
pn as an,
|
|
5095
|
+
Xa as ao,
|
|
5096
|
+
bn as ap,
|
|
5097
|
+
nn as aq,
|
|
5098
|
+
tn as ar,
|
|
5099
|
+
On as as,
|
|
5100
|
+
Bt as at,
|
|
5101
|
+
cn as au,
|
|
5102
5102
|
Je as av,
|
|
5103
5103
|
Nn as aw,
|
|
5104
5104
|
Dn as ax,
|
|
@@ -5131,17 +5131,17 @@ export {
|
|
|
5131
5131
|
Se as l,
|
|
5132
5132
|
B as m,
|
|
5133
5133
|
K as n,
|
|
5134
|
-
|
|
5134
|
+
Z as o,
|
|
5135
5135
|
Zn as p,
|
|
5136
|
-
|
|
5137
|
-
|
|
5136
|
+
g as q,
|
|
5137
|
+
de as r,
|
|
5138
5138
|
Ht as s,
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5139
|
+
we as t,
|
|
5140
|
+
xe as u,
|
|
5141
|
+
ke as v,
|
|
5142
|
+
$e as w,
|
|
5143
|
+
Le as x,
|
|
5144
|
+
Te as y,
|
|
5145
|
+
U as z
|
|
5146
5146
|
};
|
|
5147
|
-
//# sourceMappingURL=utils-
|
|
5147
|
+
//# sourceMappingURL=utils-CnDzHNQ6.js.map
|