@scbt-ecom/ui 0.58.0 → 0.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks.js +2 -2
- package/dist/{index-Bnb3sS3q.js → index-mSNqlGXI.js} +45 -42
- package/dist/{index-Bnb3sS3q.js.map → index-mSNqlGXI.js.map} +1 -1
- package/dist/ui.js +3 -3
- package/dist/{useDebounce-CK7Ghu8F.js → useDebounce-QgEEiWs9.js} +7 -7
- package/dist/{useDebounce-CK7Ghu8F.js.map → useDebounce-QgEEiWs9.js.map} +1 -1
- package/dist/{useFieldsProgress-BeFcsVuB.js → useFieldsProgress-BXzIWmGP.js} +7 -7
- package/dist/{useFieldsProgress-BeFcsVuB.js.map → useFieldsProgress-BXzIWmGP.js.map} +1 -1
- package/dist/utils.js +10 -11
- package/dist/utils.js.map +1 -1
- package/dist/uuid-2wKG15vy.js +25 -0
- package/dist/uuid-2wKG15vy.js.map +1 -0
- package/dist/widget.js +962 -544
- package/dist/widget.js.map +1 -1
- package/dist/widgets/index.d.ts +1 -0
- package/dist/widgets/model/helpers.d.ts +2 -1
- package/dist/widgets/seoHeader/SeoHeader.d.ts +1 -2
- package/dist/widgets/seoHeader/index.d.ts +1 -0
- package/dist/widgets/usefulInfo/UsefulInfo.d.ts +14 -2
- package/dist/widgets/usefulInfo/model/types.d.ts +9 -34
- package/dist/widgets/usefulInfo/ui/RenderEntity.d.ts +13 -2
- package/dist/widgets/usefulInfo/ui/Tabs.d.ts +6 -1
- package/dist/widgets/usefulInfo/ui/subEntities/documents/Documents.d.ts +23 -2
- package/dist/widgets/usefulInfo/ui/subEntities/documents/ui/document/Document.d.ts +9 -1
- package/dist/widgets/usefulInfo/ui/subEntities/html/Html.d.ts +11 -2
- package/dist/widgets/usefulInfo/ui/subEntities/table/Table.d.ts +32 -2
- package/dist/widgets/usefulInfo/ui/subEntities/table/model/utils.d.ts +2 -1
- package/dist/widgets/usefulInfo/ui/subEntities/table/ui/DesktopHeadings.d.ts +9 -4
- package/dist/widgets/usefulInfo/ui/subEntities/table/ui/DesktopRow.d.ts +9 -4
- package/dist/widgets/usefulInfo/ui/subEntities/table/ui/MobileRow.d.ts +13 -6
- package/dist/widgets/usefulInfo/ui/subEntities/table/ui/TableBody.d.ts +16 -6
- package/package.json +1 -1
- package/dist/uuid-DQgafI7K.js +0 -24
- package/dist/uuid-DQgafI7K.js.map +0 -1
package/dist/widgets/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const WIDGET_LIST: readonly ["header", "footer", "interLinking", "stepper", "usefulInfo", "longBanner", "banner", "benefit"];
|
|
1
|
+
export declare const WIDGET_LIST: readonly ["header", "footer", "interLinking", "stepper", "usefulInfo", "longBanner", "banner", "benefit", "form", "seoHeader"];
|
|
2
|
+
export declare const widgetIds: Record<"header" | "footer" | "interLinking" | "stepper" | "usefulInfo" | "longBanner" | "banner" | "benefit" | "form" | "seoHeader", "header" | "footer" | "interLinking" | "stepper" | "usefulInfo" | "longBanner" | "banner" | "benefit" | "form" | "seoHeader">;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Category, SeoHeaderHelpers } from './model';
|
|
2
|
-
type SeoHeaderProps = {
|
|
2
|
+
export type SeoHeaderProps = {
|
|
3
3
|
categories: Category[];
|
|
4
4
|
helpers: SeoHeaderHelpers[];
|
|
5
5
|
phone: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const SeoHeader: ({ categories, helpers, phone }: SeoHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SeoHeader, type SeoHeaderProps } from './SeoHeader';
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import { Tab } from './model';
|
|
1
|
+
import { EntitiesAccordionsConfig, Tab } from './model';
|
|
2
|
+
import { EntityClasses, TabsClasses } from './ui';
|
|
3
|
+
export type UsefulInfoClasses = {
|
|
4
|
+
root?: string;
|
|
5
|
+
container?: string;
|
|
6
|
+
tabsWrapper?: string;
|
|
7
|
+
tabs?: TabsClasses;
|
|
8
|
+
headline?: string;
|
|
9
|
+
contentWrapper?: string;
|
|
10
|
+
entityClasses?: EntityClasses;
|
|
11
|
+
};
|
|
2
12
|
export type UsefulInfoProps = {
|
|
3
13
|
headline: string;
|
|
4
14
|
tabs: Tab[];
|
|
15
|
+
classes?: UsefulInfoClasses;
|
|
16
|
+
accordionsConfig?: EntitiesAccordionsConfig;
|
|
5
17
|
};
|
|
6
|
-
export declare const UsefulInfo: ({ headline, tabs }: UsefulInfoProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export declare const UsefulInfo: ({ headline, tabs, classes, accordionsConfig }: UsefulInfoProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,50 +1,25 @@
|
|
|
1
|
+
import { EntityDocumentsProps, EntityHtmlProps, EntityTableProps } from '../ui/subEntities';
|
|
2
|
+
import { AccordionProps } from '../../../shared/ui';
|
|
1
3
|
export type SubEntityDetailsConfig = {
|
|
2
4
|
isAccordion: boolean;
|
|
3
5
|
accordionTitle: string;
|
|
4
6
|
};
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
row: TableCell[];
|
|
10
|
-
};
|
|
11
|
-
export type TableHeading = {
|
|
12
|
-
heading: string;
|
|
13
|
-
};
|
|
14
|
-
export type EntityTable = {
|
|
15
|
-
title?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
columnsVariant: 'twoCols' | 'threeCols';
|
|
18
|
-
tableVariant: 'separator' | 'filled';
|
|
19
|
-
headings?: TableHeading[];
|
|
20
|
-
rows: TableRow[];
|
|
21
|
-
config?: SubEntityDetailsConfig;
|
|
22
|
-
};
|
|
23
|
-
export type EntityDocuments = {
|
|
24
|
-
iconType: 'documentOutline' | 'documentFilled';
|
|
25
|
-
title?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
docs: {
|
|
28
|
-
url: string;
|
|
29
|
-
size: string;
|
|
30
|
-
label: string;
|
|
31
|
-
}[];
|
|
32
|
-
config?: SubEntityDetailsConfig;
|
|
33
|
-
};
|
|
34
|
-
export type EntityHtml = {
|
|
35
|
-
html: string;
|
|
36
|
-
config?: SubEntityDetailsConfig;
|
|
7
|
+
export type EntitiesAccordionsConfig = {
|
|
8
|
+
htmlAccordion?: Partial<AccordionProps>;
|
|
9
|
+
documentAccordion?: Partial<AccordionProps>;
|
|
10
|
+
tableAccordion?: Partial<AccordionProps>;
|
|
37
11
|
};
|
|
38
12
|
export type EntityVariant = 'HTML' | 'TABLE' | 'DOCUMENTS';
|
|
39
|
-
export type EntityDetailsVariant = EntityHtml | EntityDocuments | EntityTable;
|
|
40
13
|
export type Entity<Variant extends EntityVariant = EntityVariant> = {
|
|
41
14
|
variant: Variant;
|
|
42
|
-
details: Variant extends 'HTML' ?
|
|
15
|
+
details: Variant extends 'HTML' ? EntityHtmlProps[] : Variant extends 'TABLE' ? EntityTableProps[] : EntityDocumentsProps[];
|
|
43
16
|
};
|
|
44
17
|
export type Contents = {
|
|
45
18
|
entity: Entity;
|
|
19
|
+
entityId: string;
|
|
46
20
|
};
|
|
47
21
|
export type Tab = {
|
|
48
22
|
tabName: string;
|
|
49
23
|
contents: Contents[];
|
|
24
|
+
tabId: string;
|
|
50
25
|
};
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import { Entity } from '../model';
|
|
1
|
+
import { EntitiesAccordionsConfig, Entity } from '../model';
|
|
2
|
+
import { EntityDocumentsClasses, EntityHtmlClasses, EntityTableClasses } from './subEntities';
|
|
3
|
+
export type EntityClasses = {
|
|
4
|
+
entityWrapper?: string;
|
|
5
|
+
entities?: {
|
|
6
|
+
html?: EntityHtmlClasses;
|
|
7
|
+
documents?: EntityDocumentsClasses;
|
|
8
|
+
table?: EntityTableClasses;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
2
11
|
export interface RenderEntityProps {
|
|
3
12
|
entity: Entity;
|
|
13
|
+
classes?: EntityClasses;
|
|
14
|
+
accordionsConfig?: EntitiesAccordionsConfig;
|
|
4
15
|
}
|
|
5
|
-
export declare const RenderEntity: ({ entity }: RenderEntityProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const RenderEntity: ({ entity, classes, accordionsConfig }: RenderEntityProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export type TabsClasses = {
|
|
3
|
+
tabs?: string;
|
|
4
|
+
button?: string;
|
|
5
|
+
};
|
|
2
6
|
export interface TabsProps {
|
|
3
7
|
tabsNames?: string[];
|
|
4
8
|
activeTab?: number;
|
|
5
9
|
setActiveTab: Dispatch<SetStateAction<number>>;
|
|
10
|
+
classes?: TabsClasses;
|
|
6
11
|
}
|
|
7
|
-
export declare const Tabs: ({ tabsNames, activeTab, setActiveTab }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const Tabs: ({ tabsNames, activeTab, setActiveTab, classes }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { EntitiesAccordionsConfig, SubEntityDetailsConfig } from '../../../model';
|
|
2
|
+
import { DocumentClasses } from './ui/document';
|
|
3
|
+
export type EntityDocumentsClasses = {
|
|
4
|
+
wrapper?: string;
|
|
5
|
+
headline?: string;
|
|
6
|
+
documentsWrapper?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
singleDocument?: DocumentClasses;
|
|
9
|
+
};
|
|
10
|
+
export type EntityDocumentsProps = {
|
|
11
|
+
iconType: 'documentOutline' | 'documentFilled';
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
docs: {
|
|
15
|
+
url: string;
|
|
16
|
+
size: string;
|
|
17
|
+
label: string;
|
|
18
|
+
}[];
|
|
19
|
+
config?: SubEntityDetailsConfig;
|
|
20
|
+
classes?: EntityDocumentsClasses;
|
|
21
|
+
accordionConfig?: EntitiesAccordionsConfig['documentAccordion'];
|
|
22
|
+
};
|
|
23
|
+
export declare const Documents: ({ docs, config, title, iconType, description, classes, accordionConfig }: EntityDocumentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { IconNames } from './model/utils';
|
|
2
|
+
export type DocumentClasses = {
|
|
3
|
+
link?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
wrapper?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
size?: string;
|
|
8
|
+
};
|
|
2
9
|
export interface DocumentProps {
|
|
3
10
|
label: string;
|
|
4
11
|
size: string;
|
|
5
12
|
url: string;
|
|
6
13
|
iconType: IconNames;
|
|
14
|
+
classes?: DocumentClasses;
|
|
7
15
|
}
|
|
8
|
-
export declare const Document: ({ label, size, url, iconType }: DocumentProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Document: ({ label, size, url, iconType, classes }: DocumentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { EntitiesAccordionsConfig, SubEntityDetailsConfig } from '../../../model';
|
|
2
|
+
export type EntityHtmlClasses = {
|
|
3
|
+
html?: string;
|
|
4
|
+
};
|
|
5
|
+
export type EntityHtmlProps = {
|
|
6
|
+
html: string;
|
|
7
|
+
config?: SubEntityDetailsConfig;
|
|
8
|
+
classes?: EntityHtmlClasses;
|
|
9
|
+
accordionConfig?: EntitiesAccordionsConfig['htmlAccordion'];
|
|
10
|
+
};
|
|
11
|
+
export declare const Html: ({ html, config, classes, accordionConfig }: EntityHtmlProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { EntitiesAccordionsConfig, SubEntityDetailsConfig } from '../../../model';
|
|
2
|
+
import { TableBodyClasses } from './ui/TableBody';
|
|
3
|
+
export type EntityTableClasses = {
|
|
4
|
+
wrapper?: string;
|
|
5
|
+
headline?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
tableBody?: TableBodyClasses;
|
|
8
|
+
};
|
|
9
|
+
export type TableCell = {
|
|
10
|
+
cell: string;
|
|
11
|
+
cellId: string;
|
|
12
|
+
};
|
|
13
|
+
export type TableRow = {
|
|
14
|
+
row: TableCell[];
|
|
15
|
+
rowId: string;
|
|
16
|
+
};
|
|
17
|
+
export type TableHeading = {
|
|
18
|
+
heading: string;
|
|
19
|
+
headingId: string;
|
|
20
|
+
};
|
|
21
|
+
export type EntityTableProps = {
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
columnsVariant: 'twoCols' | 'threeCols';
|
|
25
|
+
tableVariant: 'separator' | 'filled';
|
|
26
|
+
headings?: TableHeading[];
|
|
27
|
+
rows: TableRow[];
|
|
28
|
+
config?: SubEntityDetailsConfig;
|
|
29
|
+
classes?: EntityTableClasses;
|
|
30
|
+
accordionConfig?: EntitiesAccordionsConfig['documentAccordion'];
|
|
31
|
+
};
|
|
32
|
+
export declare const Table: ({ tableVariant, description, columnsVariant, config, rows, title, headings, accordionConfig, classes }: EntityTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { TableHeading, TableRow } from '
|
|
1
|
+
import { TableHeading, TableRow } from '../Table';
|
|
2
2
|
export declare const transformMobileRows: (rows: TableRow[], headings?: TableHeading[]) => {
|
|
3
3
|
rows: {
|
|
4
4
|
row: {
|
|
5
5
|
heading: string | undefined;
|
|
6
6
|
cell: string;
|
|
7
|
+
cellId: string;
|
|
7
8
|
}[];
|
|
8
9
|
}[];
|
|
9
10
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EntityTableProps } from '../Table';
|
|
2
|
+
export type DesktopHeadingClasses = {
|
|
3
|
+
row?: string;
|
|
4
|
+
cell?: string;
|
|
5
|
+
};
|
|
2
6
|
interface DesktopHeadingsProps {
|
|
3
|
-
headings:
|
|
4
|
-
columnsVariant:
|
|
7
|
+
headings: EntityTableProps['headings'];
|
|
8
|
+
columnsVariant: EntityTableProps['columnsVariant'];
|
|
9
|
+
classes?: DesktopHeadingClasses;
|
|
5
10
|
}
|
|
6
|
-
export declare const DesktopHeadings: ({ headings, columnsVariant }: DesktopHeadingsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const DesktopHeadings: ({ headings, columnsVariant, classes }: DesktopHeadingsProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
12
|
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EntityTableProps, TableRow } from '../Table';
|
|
2
|
+
export type DesktopRowClasses = {
|
|
3
|
+
row?: string;
|
|
4
|
+
cell?: string;
|
|
5
|
+
};
|
|
2
6
|
type DesktopRowProps = {
|
|
3
7
|
row: TableRow['row'];
|
|
4
|
-
tableVariant:
|
|
5
|
-
columnsVariant:
|
|
8
|
+
tableVariant: EntityTableProps['tableVariant'];
|
|
9
|
+
columnsVariant: EntityTableProps['columnsVariant'];
|
|
6
10
|
rowIndex: number;
|
|
11
|
+
classes?: DesktopRowClasses;
|
|
7
12
|
};
|
|
8
|
-
export declare const DesktopRow: ({ row, tableVariant, columnsVariant, rowIndex }: DesktopRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const DesktopRow: ({ row, tableVariant, columnsVariant, rowIndex, classes }: DesktopRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
14
|
export {};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface
|
|
1
|
+
import { EntityTableProps } from '../Table';
|
|
2
|
+
interface FormattedRow {
|
|
3
3
|
cell: string;
|
|
4
4
|
heading?: string;
|
|
5
5
|
}
|
|
6
|
+
export type MobileRowClasses = {
|
|
7
|
+
row?: string;
|
|
8
|
+
wrapper?: string;
|
|
9
|
+
heading?: string;
|
|
10
|
+
cell?: string;
|
|
11
|
+
};
|
|
6
12
|
export interface MobileRowProps {
|
|
7
|
-
row:
|
|
8
|
-
tableVariant:
|
|
9
|
-
columnsVariant:
|
|
13
|
+
row: FormattedRow[];
|
|
14
|
+
tableVariant: EntityTableProps['tableVariant'];
|
|
15
|
+
columnsVariant: EntityTableProps['columnsVariant'];
|
|
10
16
|
headingsExist: boolean;
|
|
17
|
+
classes?: MobileRowClasses;
|
|
11
18
|
}
|
|
12
|
-
export declare const MobileRow: ({ row, tableVariant, columnsVariant, headingsExist }: MobileRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const MobileRow: ({ row, tableVariant, columnsVariant, headingsExist, classes }: MobileRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
20
|
export {};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EntityTableProps } from '../Table';
|
|
2
|
+
import { DesktopHeadingClasses } from './DesktopHeadings';
|
|
3
|
+
import { DesktopRowClasses } from './DesktopRow';
|
|
4
|
+
import { MobileRowClasses } from './MobileRow';
|
|
5
|
+
export type TableBodyClasses = {
|
|
6
|
+
wrapper?: string;
|
|
7
|
+
desktopHeading: DesktopHeadingClasses;
|
|
8
|
+
desktopRow?: DesktopRowClasses;
|
|
9
|
+
mobileRow?: MobileRowClasses;
|
|
10
|
+
};
|
|
2
11
|
interface TableBodyProps {
|
|
3
|
-
tableVariant:
|
|
4
|
-
rows:
|
|
5
|
-
headings?:
|
|
6
|
-
columnsVariant:
|
|
12
|
+
tableVariant: EntityTableProps['tableVariant'];
|
|
13
|
+
rows: EntityTableProps['rows'];
|
|
14
|
+
headings?: EntityTableProps['headings'];
|
|
15
|
+
columnsVariant: EntityTableProps['columnsVariant'];
|
|
16
|
+
classes?: TableBodyClasses;
|
|
7
17
|
}
|
|
8
|
-
export declare const TableBody: ({ tableVariant, rows, headings, columnsVariant }: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const TableBody: ({ tableVariant, rows, headings, columnsVariant, classes }: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
19
|
export {};
|
package/package.json
CHANGED
package/dist/uuid-DQgafI7K.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { v4 as c } from "uuid";
|
|
2
|
-
function x(e, r = "x xxx xxx-xx-xx") {
|
|
3
|
-
let o = r;
|
|
4
|
-
for (let t = 0; t < e.length; t++)
|
|
5
|
-
o = o.replace("x", e[t]);
|
|
6
|
-
return o;
|
|
7
|
-
}
|
|
8
|
-
const l = {
|
|
9
|
-
behavior: "smooth",
|
|
10
|
-
block: "center"
|
|
11
|
-
}, a = ({ widgetId: e, config: r = {} }) => {
|
|
12
|
-
const { behavior: o, block: t } = { ...l, ...r }, n = document.getElementById(e);
|
|
13
|
-
if (!n) {
|
|
14
|
-
console.error("Такого элемента в DOM не существует", e);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
n.scrollIntoView({ behavior: o, block: t });
|
|
18
|
-
}, m = () => c();
|
|
19
|
-
export {
|
|
20
|
-
x as c,
|
|
21
|
-
m as g,
|
|
22
|
-
a as s
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=uuid-DQgafI7K.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uuid-DQgafI7K.js","sources":["../lib/shared/utils/createPhoneNumber.ts","../lib/shared/utils/scrollToElement.ts","../lib/shared/utils/uuid.ts"],"sourcesContent":["export function createPhoneNumber(numbers: string, phoneMask: string = 'x xxx xxx-xx-xx'): string {\n let mask = phoneMask\n\n for (let i = 0; i < numbers.length; i++) {\n mask = mask.replace('x', numbers[i])\n }\n\n return mask\n}\n","import type { AllowedWidgets } from '$/widgets'\n\ntype ScrollConfig = {\n behavior?: ScrollBehavior\n block?: ScrollLogicalPosition\n}\n\ntype ScrollElement = {\n widgetId: AllowedWidgets\n config?: ScrollConfig\n}\n\nconst DEFAULT_SCROLL_CONFIG: Required<ScrollConfig> = {\n behavior: 'smooth',\n block: 'center'\n}\n\nexport const scrollToElement = ({ widgetId, config = {} }: ScrollElement) => {\n const { behavior, block } = { ...DEFAULT_SCROLL_CONFIG, ...config }\n\n const element = document.getElementById(widgetId)\n if (!element) {\n console.error('Такого элемента в DOM не существует', widgetId)\n return\n }\n\n element.scrollIntoView({ behavior, block })\n}\n","import { v4 as uuid } from 'uuid'\n\nexport const getUuid = () => uuid()\n"],"names":["createPhoneNumber","numbers","phoneMask","mask","i","DEFAULT_SCROLL_CONFIG","scrollToElement","widgetId","config","behavior","block","element","getUuid","uuid"],"mappings":";AAAgB,SAAAA,EAAkBC,GAAiBC,IAAoB,mBAA2B;AAChG,MAAIC,IAAOD;AAEX,WAASE,IAAI,GAAGA,IAAIH,EAAQ,QAAQG;AAClC,IAAAD,IAAOA,EAAK,QAAQ,KAAKF,EAAQG,CAAC,CAAC;AAG9B,SAAAD;AACT;ACIA,MAAME,IAAgD;AAAA,EACpD,UAAU;AAAA,EACV,OAAO;AACT,GAEaC,IAAkB,CAAC,EAAE,UAAAC,GAAU,QAAAC,IAAS,SAAwB;AACrE,QAAA,EAAE,UAAAC,GAAU,OAAAC,EAAM,IAAI,EAAE,GAAGL,GAAuB,GAAGG,EAAO,GAE5DG,IAAU,SAAS,eAAeJ,CAAQ;AAChD,MAAI,CAACI,GAAS;AACJ,YAAA,MAAM,uCAAuCJ,CAAQ;AAC7D;AAAA,EAAA;AAGF,EAAAI,EAAQ,eAAe,EAAE,UAAAF,GAAU,OAAAC,EAAA,CAAO;AAC5C,GCzBaE,IAAU,MAAMC,EAAK;"}
|