@scbt-ecom/ui 0.77.2 → 0.78.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/{index-PZSikNMt.js → index-BUV7eJPv.js} +3331 -3295
- package/dist/index-BUV7eJPv.js.map +1 -0
- package/dist/lib/shared/ui/dialog/Dialog.d.ts +0 -1
- package/dist/lib/widgets/buttonWithHandlers/model/types.d.ts +5 -1
- package/dist/lib/widgets/dynamicFormDialog/DynamicFormDialog.d.ts +33 -0
- package/dist/lib/widgets/dynamicFormDialog/index.d.ts +1 -0
- package/dist/lib/widgets/dynamicFormDialog/model/index.d.ts +1 -0
- package/dist/lib/widgets/dynamicFormDialog/model/types.d.ts +18 -0
- package/dist/lib/widgets/index.d.ts +1 -0
- package/dist/lib/widgets/model/helpers.d.ts +2 -1
- package/dist/ui.js +523 -559
- package/dist/ui.js.map +1 -1
- package/dist/widget.js +665 -616
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-PZSikNMt.js.map +0 -1
- package/dist/lib/widgets/dynamicForm/model/getDynamicSchema.d.ts +0 -0
|
@@ -12,4 +12,8 @@ export type ScrollHandler = {
|
|
|
12
12
|
export type SubmitHandler = {
|
|
13
13
|
handler: 'submit';
|
|
14
14
|
};
|
|
15
|
-
export type
|
|
15
|
+
export type DialogHandler = {
|
|
16
|
+
handler: 'dialog';
|
|
17
|
+
dialogId: string;
|
|
18
|
+
};
|
|
19
|
+
export type ButtonHandlerOptions = NavigateHandler | ScrollHandler | SubmitHandler | DialogHandler;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { Approvement, ApprovementType } from './model';
|
|
3
|
+
import { FieldValidation } from '../../../src/shared/utils';
|
|
4
|
+
import { Uncontrolled } from '../../shared/ui';
|
|
5
|
+
import { FieldElement } from '../fieldMapper';
|
|
6
|
+
type SubmitProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
7
|
+
submitCallback: <T extends FieldValues>(values: T) => void;
|
|
8
|
+
children: string;
|
|
9
|
+
};
|
|
10
|
+
type ApprovementClasses = {
|
|
11
|
+
checkbox?: React.ComponentProps<typeof Uncontrolled.CheckboxBase>['classes'];
|
|
12
|
+
content?: string;
|
|
13
|
+
};
|
|
14
|
+
type DynamicFormDialogClasses = {
|
|
15
|
+
root?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
fields?: string;
|
|
18
|
+
form?: string;
|
|
19
|
+
approvement?: ApprovementClasses;
|
|
20
|
+
submit?: string;
|
|
21
|
+
};
|
|
22
|
+
export type DynamicFormDialogProps<AType extends ApprovementType> = React.DialogHTMLAttributes<HTMLDialogElement> & {
|
|
23
|
+
fields: FieldElement<any, any, {
|
|
24
|
+
validation: FieldValidation;
|
|
25
|
+
}>[];
|
|
26
|
+
title: string;
|
|
27
|
+
approvement: Approvement<AType>;
|
|
28
|
+
dialogId: string;
|
|
29
|
+
submitProps?: SubmitProps;
|
|
30
|
+
classes?: DynamicFormDialogClasses;
|
|
31
|
+
};
|
|
32
|
+
export declare const DynamicFormDialog: <AType extends ApprovementType>({ fields, title, approvement, submitProps, dialogId, classes, ...props }: DynamicFormDialogProps<AType>) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export default DynamicFormDialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DynamicFormDialog } from './DynamicFormDialog';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './types';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type ApprovementDisabled = {
|
|
2
|
+
type: 'off';
|
|
3
|
+
};
|
|
4
|
+
type ApprovementCheckbox = {
|
|
5
|
+
type: 'checkbox';
|
|
6
|
+
content: string;
|
|
7
|
+
};
|
|
8
|
+
type ApprovementText = {
|
|
9
|
+
type: 'text';
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
export type ApprovementType = 'off' | 'checkbox' | 'text';
|
|
13
|
+
export type Approvement<Type extends ApprovementType> = Type extends 'checkbox' ? ApprovementCheckbox : Type extends 'text' ? ApprovementText : ApprovementDisabled;
|
|
14
|
+
export type ProgressField = {
|
|
15
|
+
progress: number;
|
|
16
|
+
maxPercent: number;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -10,6 +10,7 @@ export * from './interLinking';
|
|
|
10
10
|
export * from './usefulInfo';
|
|
11
11
|
export * from './fieldMapper';
|
|
12
12
|
export * from './dynamicForm';
|
|
13
|
+
export * from './dynamicFormDialog';
|
|
13
14
|
export * from './buttonWithHandlers';
|
|
14
15
|
export * from './model';
|
|
15
16
|
export * from './fallbacksView';
|
|
@@ -5,6 +5,7 @@ export declare const WIDGET_LIST_MAP: {
|
|
|
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 }: import('..').DynamicFormProps<AType, CType, PType>) => import("react/jsx-runtime").JSX.Element)>;
|
|
8
|
+
readonly formDialog: import('react').LazyExoticComponent<(<AType extends import('../dynamicFormDialog/model').ApprovementType>({ fields, title, approvement, submitProps, dialogId, classes, ...props }: import('../dynamicFormDialog/DynamicFormDialog').DynamicFormDialogProps<AType>) => import("react/jsx-runtime").JSX.Element)>;
|
|
8
9
|
readonly stepper: import('react').LazyExoticComponent<({ headline, details, variant, classes }: import('..').StepperProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
10
|
readonly benefit: import('react').LazyExoticComponent<({ headline, details, variant, classes }: import('..').BenefitProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
11
|
readonly longBanner: import('react').LazyExoticComponent<(<Enabled extends boolean>({ headline, buttonConfig, intent, details, image, classes }: import('..').LongBannerProps<Enabled>) => import("react/jsx-runtime").JSX.Element)>;
|
|
@@ -13,4 +14,4 @@ export declare const WIDGET_LIST_MAP: {
|
|
|
13
14
|
readonly footer: import('react').LazyExoticComponent<(<Enabled extends boolean>({ socialsLinks, phones, ligal, copyright, classes, details, siteMap }: import('..').FooterProps<Enabled>) => import("react/jsx-runtime").JSX.Element)>;
|
|
14
15
|
};
|
|
15
16
|
export declare const KEYS_OF_WIDGET_LIST: readonly AllowedWidgets[];
|
|
16
|
-
export declare const widgetIds: Record<"form" | "header" | "seoHeader" | "banner" | "calculator" | "stepper" | "benefit" | "longBanner" | "usefulInfo" | "interLinking" | "footer", "form" | "header" | "seoHeader" | "banner" | "calculator" | "stepper" | "benefit" | "longBanner" | "usefulInfo" | "interLinking" | "footer">;
|
|
17
|
+
export declare const widgetIds: Record<"form" | "header" | "seoHeader" | "banner" | "calculator" | "formDialog" | "stepper" | "benefit" | "longBanner" | "usefulInfo" | "interLinking" | "footer", "form" | "header" | "seoHeader" | "banner" | "calculator" | "formDialog" | "stepper" | "benefit" | "longBanner" | "usefulInfo" | "interLinking" | "footer">;
|