@scbt-ecom/ui 0.81.0 → 0.81.2
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/{index-BatWr8jg.js → index-CkOdCUEp.js} +3255 -3246
- package/dist/{index-BatWr8jg.js.map → index-CkOdCUEp.js.map} +1 -1
- package/dist/lib/shared/ui/modal/index.d.ts +1 -1
- package/dist/lib/shared/utils/index.d.ts +1 -0
- package/dist/lib/shared/utils/localStorageActions.d.ts +5 -0
- package/dist/lib/widgets/banner/model/types.d.ts +3 -8
- package/dist/lib/widgets/benefit/model/types.d.ts +2 -5
- package/dist/lib/widgets/benefit/ui/BenefitItem.d.ts +2 -5
- package/dist/lib/widgets/calculator/CalculatorView.d.ts +9 -2
- package/dist/lib/widgets/calculator/ui/calculatorFields/CalculatorFields.d.ts +10 -2
- package/dist/lib/widgets/calculator/ui/calculatorFields/ui/AdditionalSlider.d.ts +6 -1
- package/dist/lib/widgets/calculator/ui/calculatorFields/ui/CalculatorModal.d.ts +9 -1
- package/dist/lib/widgets/calculator/ui/calculatorInfo/CalculatorInfo.d.ts +11 -3
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/AssistHint.d.ts +10 -2
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/CalculatedBlock.d.ts +7 -1
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/CalculatorInfoBody.d.ts +5 -1
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/CalculatorInfoFooter.d.ts +10 -7
- package/dist/lib/widgets/calculator/ui/calculatorInfo/ui/CalculatorInfoHead.d.ts +7 -1
- package/dist/lib/widgets/header/model/types.d.ts +4 -6
- package/dist/lib/widgets/model/helpers.d.ts +1 -1
- package/dist/lib/widgets/seoHeader/SeoHeader.d.ts +6 -2
- package/dist/localStorageActions-DRn18qhh.js +47 -0
- package/dist/localStorageActions-DRn18qhh.js.map +1 -0
- package/dist/ui.js +2 -2
- package/dist/utils.js +21 -20
- package/dist/widget.js +1605 -1552
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
- package/dist/capitalize-B7CPmCdk.js +0 -23
- package/dist/capitalize-B7CPmCdk.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Modal } from './Modal';
|
|
1
|
+
export { Modal, type ModalProps } from './Modal';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ButtonProps } from '../../../shared/ui';
|
|
1
|
+
import { ButtonWithHandlersProps } from '../../buttonWithHandlers';
|
|
3
2
|
export interface BannerClasses {
|
|
4
3
|
root?: string;
|
|
5
4
|
container?: string;
|
|
@@ -17,15 +16,11 @@ export interface BannerClasses {
|
|
|
17
16
|
}
|
|
18
17
|
export type ButtonsConfig = {
|
|
19
18
|
primary: {
|
|
20
|
-
buttonContent:
|
|
21
|
-
handlerOptions: ButtonHandlerOptions;
|
|
22
|
-
};
|
|
19
|
+
buttonContent: ButtonWithHandlersProps;
|
|
23
20
|
enabled: boolean;
|
|
24
21
|
};
|
|
25
22
|
secondary?: {
|
|
26
|
-
buttonContent:
|
|
27
|
-
handlerOptions: ButtonHandlerOptions;
|
|
28
|
-
};
|
|
23
|
+
buttonContent: ButtonWithHandlersProps;
|
|
29
24
|
enabled: boolean;
|
|
30
25
|
};
|
|
31
26
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ButtonHandlerOptions } from '../../buttonWithHandlers';
|
|
2
|
+
import { ButtonWithHandlersProps } from '../../buttonWithHandlers';
|
|
4
3
|
import { allowedBannersBackgroundColors } from '../../../shared/constants';
|
|
5
4
|
import { backgroundBenefitColors, BackgroundBenefitColorsValues } from './constants';
|
|
6
5
|
export type Colors = keyof typeof allowedBannersBackgroundColors;
|
|
@@ -10,9 +9,7 @@ export type Img = {
|
|
|
10
9
|
alt: string;
|
|
11
10
|
};
|
|
12
11
|
export type Details = {
|
|
13
|
-
button?:
|
|
14
|
-
handlerOptions: ButtonHandlerOptions;
|
|
15
|
-
};
|
|
12
|
+
button?: ButtonWithHandlersProps;
|
|
16
13
|
img?: ReactElement | Img;
|
|
17
14
|
title: string;
|
|
18
15
|
subtitle: string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { BackgroundBenefitColorsValues } from '../model/constants';
|
|
3
|
-
import { ButtonProps } from '../../../shared/ui';
|
|
4
3
|
import { Img } from '../model/types';
|
|
5
|
-
import {
|
|
4
|
+
import { ButtonWithHandlersProps } from '../../buttonWithHandlers';
|
|
6
5
|
export type BenefitItemClasses = {
|
|
7
6
|
root?: string;
|
|
8
7
|
button?: string;
|
|
@@ -20,9 +19,7 @@ export interface BenefitItemProps {
|
|
|
20
19
|
mobileImg?: boolean;
|
|
21
20
|
classes?: BenefitItemClasses;
|
|
22
21
|
withButton?: boolean;
|
|
23
|
-
button?:
|
|
24
|
-
handlerOptions: ButtonHandlerOptions;
|
|
25
|
-
};
|
|
22
|
+
button?: ButtonWithHandlersProps;
|
|
26
23
|
variant?: 'twoCards' | 'threeCards' | 'fourCards';
|
|
27
24
|
color?: BackgroundBenefitColorsValues;
|
|
28
25
|
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
-
import { CalculatorFieldsProps, CalculatorInfoProps, CalculatorTab } from './ui';
|
|
2
|
+
import { CalculatorFieldsClasses, CalculatorFieldsProps, CalculatorInfoClasses, CalculatorInfoProps, CalculatorTab } from './ui';
|
|
3
|
+
type CalculatorViewClasses = {
|
|
4
|
+
root?: string;
|
|
5
|
+
calculatorFields?: CalculatorFieldsClasses;
|
|
6
|
+
calculatorInfo?: CalculatorInfoClasses;
|
|
7
|
+
};
|
|
3
8
|
export interface CalculatorViewProps<T extends FieldValues = FieldValues> extends CalculatorTab {
|
|
4
9
|
calculatorInfoConfig: CalculatorInfoProps;
|
|
5
10
|
calculatorFieldsConfig: CalculatorFieldsProps<T>;
|
|
11
|
+
classes?: CalculatorViewClasses;
|
|
6
12
|
}
|
|
7
|
-
export declare const CalculatorView: <T extends FieldValues>({ calculatorInfoConfig, calculatorFieldsConfig }: CalculatorViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const CalculatorView: <T extends FieldValues>({ calculatorInfoConfig, calculatorFieldsConfig, classes }: CalculatorViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
-
import { AdditionalSliderGroupConfig, CalculatorModalProps, CheckboxGroupProps, RadioGroupProps, SelectGroupProps, SlidersGroupProps, SwitchGroupProps } from './ui';
|
|
2
|
+
import { AdditionalSliderGroupConfig, CalculatorModalClasses, CalculatorModalProps, CheckboxGroupProps, RadioGroupProps, SelectGroupProps, SlidersGroupProps, SwitchGroupProps } from './ui';
|
|
3
|
+
export type CalculatorFieldsClasses = {
|
|
4
|
+
rootFieldsWrapper?: string;
|
|
5
|
+
selectFieldsWrapper?: string;
|
|
6
|
+
checkboxFieldsWrapper?: string;
|
|
7
|
+
switchFieldsWrapper?: string;
|
|
8
|
+
modalClasses?: CalculatorModalClasses;
|
|
9
|
+
};
|
|
3
10
|
export interface CalculatorFieldsProps<T extends FieldValues> {
|
|
11
|
+
classes?: CalculatorFieldsClasses;
|
|
4
12
|
modalConfig?: CalculatorModalProps;
|
|
5
13
|
fieldsGroup: {
|
|
6
14
|
selectGroupConfig?: SelectGroupProps<T>;
|
|
@@ -15,4 +23,4 @@ export interface CalculatorFieldsProps<T extends FieldValues> {
|
|
|
15
23
|
};
|
|
16
24
|
};
|
|
17
25
|
}
|
|
18
|
-
export declare const CalculatorFields: <T extends FieldValues>({ modalConfig, fieldsGroup }: CalculatorFieldsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const CalculatorFields: <T extends FieldValues>({ modalConfig, fieldsGroup, classes }: CalculatorFieldsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
2
|
import { AdditionalSliderGroupConfig, SlidersGroupProps } from './FieldsGroup';
|
|
3
|
+
export type AdditionalSliderClasses = {
|
|
4
|
+
wrapper?: string;
|
|
5
|
+
block?: string;
|
|
6
|
+
};
|
|
3
7
|
interface AdditionalSliderProps<T extends FieldValues> {
|
|
4
8
|
additionalSliderGroupConfig: AdditionalSliderGroupConfig<T>;
|
|
5
9
|
slidersGroupConfig: SlidersGroupProps<T>;
|
|
10
|
+
classes?: AdditionalSliderClasses;
|
|
6
11
|
}
|
|
7
|
-
export declare const AdditionalSlider: <T extends FieldValues>({ slidersGroupConfig, additionalSliderGroupConfig }: AdditionalSliderProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export declare const AdditionalSlider: <T extends FieldValues>({ slidersGroupConfig, additionalSliderGroupConfig, classes }: AdditionalSliderProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
13
|
export {};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { ModalContentVariant } from '../../../model';
|
|
2
|
+
import { ModalProps } from '../../../../../shared/ui';
|
|
3
|
+
export type CalculatorModalClasses = {
|
|
4
|
+
wrapper?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
button?: string;
|
|
7
|
+
};
|
|
2
8
|
export interface CalculatorModalProps {
|
|
3
9
|
triggerText: string;
|
|
4
10
|
contentVariant: ModalContentVariant;
|
|
5
11
|
modalTitle?: string;
|
|
6
12
|
description?: string;
|
|
13
|
+
classes?: CalculatorModalClasses;
|
|
14
|
+
modalProps?: ModalProps;
|
|
7
15
|
}
|
|
8
|
-
export declare const CalculatorModal: ({ triggerText, modalTitle, description, contentVariant }: CalculatorModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const CalculatorModal: ({ triggerText, modalTitle, description, classes, modalProps, contentVariant }: CalculatorModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import { CalculatedBlockProps, CalculatedInfoBodyProps, CalculatorInfoFooterProps, CalculatorInfoHeadProps } from './ui';
|
|
2
|
-
export
|
|
1
|
+
import { CalculatedBlockClasses, CalculatedBlockProps, CalculatedInfoBodyProps, CalculatorInfoBodyClasses, CalculatorInfoFooterClasses, CalculatorInfoFooterProps, CalculatorInfoHeadClasses, CalculatorInfoHeadProps } from './ui';
|
|
2
|
+
export type CalculatorInfoClasses = {
|
|
3
|
+
wrapper?: string;
|
|
4
|
+
calculatedBlock?: CalculatedBlockClasses;
|
|
5
|
+
calculatedInfoHead?: CalculatorInfoHeadClasses;
|
|
6
|
+
calculatorInfoBody?: CalculatorInfoBodyClasses;
|
|
7
|
+
calculatorInfoFooter?: CalculatorInfoFooterClasses;
|
|
8
|
+
};
|
|
9
|
+
export interface CalculatorInfoProps extends Omit<CalculatedBlockProps, 'classes'>, Omit<CalculatorInfoHeadProps, 'classes'>, Omit<CalculatedInfoBodyProps, 'classes'>, Omit<CalculatorInfoFooterProps, 'classes'> {
|
|
10
|
+
classes?: CalculatorInfoClasses;
|
|
3
11
|
}
|
|
4
|
-
export declare const CalculatorInfo: ({ rootDescription, bottomDescription, rootValue, title, subtitle, buttonsConfig, infoList, suffix, assistHint }: CalculatorInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const CalculatorInfo: ({ rootDescription, bottomDescription, rootValue, title, subtitle, buttonsConfig, infoList, suffix, assistHint, classes }: CalculatorInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { AllowedIcons } from '../../../../../shared/ui';
|
|
1
|
+
import { AllowedIcons, PopoverProps } from '../../../../../shared/ui';
|
|
2
|
+
export type AssistHintClasses = {
|
|
3
|
+
wrapper?: string;
|
|
4
|
+
block?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
};
|
|
2
8
|
export interface AssistHintProps {
|
|
3
9
|
iconName: AllowedIcons;
|
|
4
10
|
text: string;
|
|
5
11
|
hint?: string;
|
|
12
|
+
classes?: AssistHintClasses;
|
|
13
|
+
popoverProps?: PopoverProps;
|
|
6
14
|
}
|
|
7
|
-
export declare const AssistHint: ({ iconName, text, hint }: AssistHintProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const AssistHint: ({ iconName, text, hint, classes, popoverProps }: AssistHintProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { CalculatorSuffix, CalculatorValue } from '../../../model';
|
|
2
|
+
export type CalculatedBlockClasses = {
|
|
3
|
+
wrapper?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
};
|
|
2
7
|
export interface CalculatedBlockProps {
|
|
3
8
|
rootDescription: string;
|
|
4
9
|
rootValue: CalculatorValue;
|
|
5
10
|
suffix: CalculatorSuffix;
|
|
11
|
+
classes?: CalculatedBlockClasses;
|
|
6
12
|
}
|
|
7
|
-
export declare const CalculatedBlock: ({ rootDescription, rootValue, suffix }: CalculatedBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const CalculatedBlock: ({ rootDescription, rootValue, suffix, classes }: CalculatedBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { InfoListItemDTO } from './InfoListItem';
|
|
2
|
+
export type CalculatorInfoBodyClasses = {
|
|
3
|
+
wrapper?: string;
|
|
4
|
+
};
|
|
2
5
|
export interface CalculatedInfoBodyProps {
|
|
3
6
|
infoList: InfoListItemDTO[];
|
|
7
|
+
classes?: CalculatorInfoBodyClasses;
|
|
4
8
|
}
|
|
5
|
-
export declare const CalculatorInfoBody: ({ infoList }: CalculatedInfoBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const CalculatorInfoBody: ({ infoList, classes }: CalculatedInfoBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AssistHintProps } from './AssistHint';
|
|
3
|
-
|
|
1
|
+
import { ButtonWithHandlersProps } from '../../../../buttonWithHandlers';
|
|
2
|
+
import { AssistHintClasses, AssistHintProps } from './AssistHint';
|
|
3
|
+
export type CalculatorInfoFooterClasses = {
|
|
4
|
+
assistHint?: AssistHintClasses;
|
|
5
|
+
buttonsWrapper?: string;
|
|
6
|
+
bottomDescription?: string;
|
|
7
|
+
};
|
|
4
8
|
export interface CalculatorInfoFooterProps {
|
|
5
9
|
assistHint?: AssistHintProps;
|
|
6
|
-
buttonsConfig:
|
|
7
|
-
handlerOptions: ButtonHandlerOptions;
|
|
8
|
-
}>;
|
|
10
|
+
buttonsConfig: ButtonWithHandlersProps[];
|
|
9
11
|
bottomDescription?: string;
|
|
12
|
+
classes?: CalculatorInfoFooterClasses;
|
|
10
13
|
}
|
|
11
|
-
export declare const CalculatorInfoFooter: ({ assistHint, buttonsConfig, bottomDescription }: CalculatorInfoFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const CalculatorInfoFooter: ({ assistHint, buttonsConfig, bottomDescription, classes }: CalculatorInfoFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
export type CalculatorInfoHeadClasses = {
|
|
2
|
+
wrapper?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
};
|
|
1
6
|
export interface CalculatorInfoHeadProps {
|
|
2
7
|
title?: string;
|
|
3
8
|
subtitle?: string;
|
|
9
|
+
classes?: CalculatorInfoHeadClasses;
|
|
4
10
|
}
|
|
5
|
-
export declare const CalculatorInfoHead: ({ subtitle, title }: CalculatorInfoHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const CalculatorInfoHead: ({ subtitle, title, classes }: CalculatorInfoHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BrandLogoVariant,
|
|
1
|
+
import { ButtonWithHandlersProps } from '../../buttonWithHandlers';
|
|
2
|
+
import { BrandLogoVariant, PhoneViewProps } from '../../../shared/ui';
|
|
3
3
|
type HeaderClasses = {
|
|
4
|
-
|
|
4
|
+
root?: string;
|
|
5
5
|
container?: string;
|
|
6
6
|
wrapper?: string;
|
|
7
7
|
logo?: string;
|
|
@@ -22,9 +22,7 @@ export interface HeaderWithPhone {
|
|
|
22
22
|
}
|
|
23
23
|
export interface HeaderWithButton {
|
|
24
24
|
variant: 'withButton';
|
|
25
|
-
details:
|
|
26
|
-
handlerOptions: ButtonHandlerOptions;
|
|
27
|
-
};
|
|
25
|
+
details: ButtonWithHandlersProps;
|
|
28
26
|
}
|
|
29
27
|
export type HeaderVariant<Type extends HeaderVariantType> = Type extends 'withButton' ? HeaderWithButton : Type extends 'withPhone' ? HeaderWithPhone : HeaderEmptyProps;
|
|
30
28
|
export type HeaderProps<Type extends HeaderVariantType> = CommonHeaderProps & HeaderVariant<Type>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type AllowedWidgets = keyof typeof WIDGET_LIST_MAP;
|
|
2
2
|
export declare const WIDGET_LIST_MAP: {
|
|
3
3
|
readonly header: import('react').LazyExoticComponent<(<Type extends import('../header/model/types').HeaderVariantType>(props: import('../header/model/types').HeaderProps<Type>) => import("react/jsx-runtime").JSX.Element)>;
|
|
4
|
-
readonly seoHeader: import('react').LazyExoticComponent<({ categories, helpers, phone, breadcrumbs }: import('..').SeoHeaderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
+
readonly seoHeader: import('react').LazyExoticComponent<({ categories, helpers, phone, breadcrumbs, classes }: import('..').SeoHeaderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
5
|
readonly banner: import('react').LazyExoticComponent<({ variant, ...props }: import('..').BannerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
6
6
|
readonly calculator: import('react').LazyExoticComponent<({ calculators, headline }: import('..').CalculatorProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
7
|
readonly form: import('react').LazyExoticComponent<(<AType extends import('../dynamicForm/model').ApprovementType, CType extends import('../dynamicForm/model').ChipsType, PType extends import('../dynamicForm/model').ProgressType>({ fields, title, progress, approvement, chips, submitProps, classes, buttonGroup }: import('..').DynamicFormProps<AType, CType, PType>) => import("react/jsx-runtime").JSX.Element)>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Breadcrumb } from '../breadcrumbs
|
|
1
|
+
import { Breadcrumb } from '../breadcrumbs';
|
|
2
2
|
import { Category, SeoHeaderHelpers } from './model';
|
|
3
|
+
export type SeoHeaderClasses = {
|
|
4
|
+
root?: string;
|
|
5
|
+
};
|
|
3
6
|
export type SeoHeaderProps = {
|
|
4
7
|
categories: Category[];
|
|
5
8
|
helpers: SeoHeaderHelpers[];
|
|
6
9
|
breadcrumbs: Breadcrumb[];
|
|
7
10
|
phone: string;
|
|
11
|
+
classes?: SeoHeaderClasses;
|
|
8
12
|
};
|
|
9
|
-
export declare const SeoHeader: ({ categories, helpers, phone, breadcrumbs }: SeoHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const SeoHeader: ({ categories, helpers, phone, breadcrumbs, classes }: SeoHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
export default SeoHeader;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { T as l } from "./typeGuards-CSiImkUY.js";
|
|
2
|
+
function n(t, e = "x xxx xxx-xx-xx") {
|
|
3
|
+
let o = e;
|
|
4
|
+
for (let r = 0; r < t.length; r++)
|
|
5
|
+
o = o.replace("x", t[r]);
|
|
6
|
+
return o;
|
|
7
|
+
}
|
|
8
|
+
const a = {
|
|
9
|
+
behavior: "smooth",
|
|
10
|
+
block: "center"
|
|
11
|
+
}, i = ({ widgetId: t, config: e = {} }) => {
|
|
12
|
+
const { behavior: o, block: r } = { ...a, ...e }, s = document.getElementById(t);
|
|
13
|
+
if (!s) {
|
|
14
|
+
console.error("Такого элемента в DOM не существует", t);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
s.scrollIntoView({ behavior: o, block: r });
|
|
18
|
+
}, m = (t) => t.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join("-"), x = {
|
|
19
|
+
setItem: (t, e) => {
|
|
20
|
+
if (l.isNil(e))
|
|
21
|
+
return;
|
|
22
|
+
const o = JSON.stringify(e);
|
|
23
|
+
localStorage.setItem(t, o);
|
|
24
|
+
},
|
|
25
|
+
getItem: (t) => {
|
|
26
|
+
const e = localStorage.getItem(t);
|
|
27
|
+
if (l.isNull(e))
|
|
28
|
+
return null;
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(e);
|
|
31
|
+
} catch {
|
|
32
|
+
return e;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
clearItems: (...t) => {
|
|
36
|
+
t.forEach((e) => {
|
|
37
|
+
localStorage.removeItem(e);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
m as a,
|
|
43
|
+
n as c,
|
|
44
|
+
x as l,
|
|
45
|
+
i as s
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=localStorageActions-DRn18qhh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localStorageActions-DRn18qhh.js","sources":["../lib/shared/utils/createPhoneNumber.ts","../lib/shared/utils/scrollToElement.ts","../lib/shared/utils/capitalize.ts","../lib/shared/utils/localStorageActions.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","export const capitalize = (str: string) => {\n return str\n .split('-')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join('-')\n}\n","import { TypeGuards } from './typeGuards'\n\nexport const localStorageActions = {\n setItem: <T>(key: string, value: T): void => {\n if (TypeGuards.isNil(value)) {\n return\n }\n const stringifiesPayload = JSON.stringify(value)\n localStorage.setItem(key, stringifiesPayload)\n },\n\n getItem: <T>(key: string): T | null => {\n const item = localStorage.getItem(key)\n\n if (TypeGuards.isNull(item)) {\n return null\n }\n\n try {\n return JSON.parse(item) as T\n } catch {\n return item as T\n }\n },\n\n clearItems: (...keys: string[]): void => {\n keys.forEach((key) => {\n localStorage.removeItem(key)\n })\n }\n}\n"],"names":["createPhoneNumber","numbers","phoneMask","mask","i","DEFAULT_SCROLL_CONFIG","scrollToElement","widgetId","config","behavior","block","element","capitalize","str","word","localStorageActions","key","value","TypeGuards","stringifiesPayload","item","keys"],"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,GC3BaE,IAAa,CAACC,MAClBA,EACJ,MAAM,GAAG,EACT,IAAI,CAACC,MAASA,EAAK,OAAO,CAAC,EAAE,YAAY,IAAIA,EAAK,MAAM,CAAC,EAAE,YAAa,CAAA,EACxE,KAAK,GAAG,GCFAC,IAAsB;AAAA,EACjC,SAAS,CAAIC,GAAaC,MAAmB;AACvC,QAAAC,EAAW,MAAMD,CAAK;AACxB;AAEI,UAAAE,IAAqB,KAAK,UAAUF,CAAK;AAClC,iBAAA,QAAQD,GAAKG,CAAkB;AAAA,EAC9C;AAAA,EAEA,SAAS,CAAIH,MAA0B;AAC/B,UAAAI,IAAO,aAAa,QAAQJ,CAAG;AAEjC,QAAAE,EAAW,OAAOE,CAAI;AACjB,aAAA;AAGL,QAAA;AACK,aAAA,KAAK,MAAMA,CAAI;AAAA,IAAA,QAChB;AACC,aAAAA;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,YAAY,IAAIC,MAAyB;AAClC,IAAAA,EAAA,QAAQ,CAACL,MAAQ;AACpB,mBAAa,WAAWA,CAAG;AAAA,IAAA,CAC5B;AAAA,EAAA;AAEL;"}
|
package/dist/ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as C, l as On, q as An, B as ge, F as Tn, G as Nn, J as jn, K as Hn, N as Be, O as Wt, T as Gn, V as zn, W as et, X as kn, A as Bn, I as Ne, H as qn, Y as Un, Z as Kn, _ as Xn } from "./index-
|
|
2
|
-
import { v as yi, a3 as Fi, w as _i, C as Ii, D as Mi, a4 as Vi, a6 as Pi, L as $i, M as bi, a5 as Ei, P as Di, u as Li, y as Oi, U as Ai, t as Ti, $ as Ni, a1 as ji, a0 as Hi, a2 as Gi, a7 as zi } from "./index-
|
|
1
|
+
import { k as C, l as On, q as An, B as ge, F as Tn, G as Nn, J as jn, K as Hn, N as Be, O as Wt, T as Gn, V as zn, W as et, X as kn, A as Bn, I as Ne, H as qn, Y as Un, Z as Kn, _ as Xn } from "./index-CkOdCUEp.js";
|
|
2
|
+
import { v as yi, a3 as Fi, w as _i, C as Ii, D as Mi, a4 as Vi, a6 as Pi, L as $i, M as bi, a5 as Ei, P as Di, u as Li, y as Oi, U as Ai, t as Ti, $ as Ni, a1 as ji, a0 as Hi, a2 as Gi, a7 as zi } from "./index-CkOdCUEp.js";
|
|
3
3
|
import * as ce from "react";
|
|
4
4
|
import { forwardRef as Q, useState as oe, useRef as je, useCallback as Se, useEffect as ve, isValidElement as He, cloneElement as Qt, Children as Ie } from "react";
|
|
5
5
|
import { c as F, T as Tt } from "./typeGuards-CSiImkUY.js";
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as U, c as x,
|
|
2
|
-
import { T as
|
|
3
|
-
import { i as
|
|
1
|
+
import { a as U, c as x, l as b, s as h } from "./localStorageActions-DRn18qhh.js";
|
|
2
|
+
import { T as R, c as D } from "./typeGuards-CSiImkUY.js";
|
|
3
|
+
import { i as S } from "./isClient-C9aZtt2Q.js";
|
|
4
4
|
import { m as V } from "./mergeRefs-qDToYXtM.js";
|
|
5
5
|
const t = [];
|
|
6
6
|
for (let n = 0; n < 256; ++n)
|
|
@@ -8,36 +8,37 @@ for (let n = 0; n < 256; ++n)
|
|
|
8
8
|
function d(n, e = 0) {
|
|
9
9
|
return (t[n[e + 0]] + t[n[e + 1]] + t[n[e + 2]] + t[n[e + 3]] + "-" + t[n[e + 4]] + t[n[e + 5]] + "-" + t[n[e + 6]] + t[n[e + 7]] + "-" + t[n[e + 8]] + t[n[e + 9]] + "-" + t[n[e + 10]] + t[n[e + 11]] + t[n[e + 12]] + t[n[e + 13]] + t[n[e + 14]] + t[n[e + 15]]).toLowerCase();
|
|
10
10
|
}
|
|
11
|
-
let
|
|
11
|
+
let r;
|
|
12
12
|
const m = new Uint8Array(16);
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
13
|
+
function a() {
|
|
14
|
+
if (!r) {
|
|
15
15
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
16
16
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
17
|
-
|
|
17
|
+
r = crypto.getRandomValues.bind(crypto);
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return r(m);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
function
|
|
23
|
-
var
|
|
21
|
+
const i = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), c = { randomUUID: i };
|
|
22
|
+
function l(n, e, p) {
|
|
23
|
+
var u;
|
|
24
24
|
if (c.randomUUID && !n)
|
|
25
25
|
return c.randomUUID();
|
|
26
26
|
n = n || {};
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
27
|
+
const o = n.random ?? ((u = n.rng) == null ? void 0 : u.call(n)) ?? a();
|
|
28
|
+
if (o.length < 16)
|
|
29
29
|
throw new Error("Random bytes length must be >= 16");
|
|
30
|
-
return
|
|
30
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, d(o);
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const y = () => l();
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
R as TypeGuards,
|
|
35
35
|
U as capitalize,
|
|
36
|
-
|
|
36
|
+
D as cn,
|
|
37
37
|
x as createPhoneNumber,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
y as getUuid,
|
|
39
|
+
S as isClient,
|
|
40
|
+
b as localStorageActions,
|
|
40
41
|
V as mergeRefs,
|
|
41
|
-
|
|
42
|
+
h as scrollToElement
|
|
42
43
|
};
|
|
43
44
|
//# sourceMappingURL=utils.js.map
|