jamespot-react-components 1.3.73 → 1.3.75
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/jamespot-react-components/src/components/Editors/components/EditorImageUpload.d.ts +3 -2
- package/dist/jamespot-react-components/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.d.ts +6 -34
- package/dist/jamespot-react-components/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.types.d.ts +25 -10
- package/dist/jamespot-react-components/src/components/Form/Input/JRCInputCheckbox/JRCInputReorderCheckbox.d.ts +3 -17
- package/dist/jamespot-react-components/src/components/Form/Input/JRCInputCheckbox/JRCInputReorderCheckbox.stories.d.ts +2 -2
- package/dist/jamespot-react-components/src/components/Form/Input/JRCInputFile/JRCInputFile.d.ts +18 -11
- package/dist/jamespot-react-components/src/components/Form/Input/JRCInputImage/types.d.ts +12 -1
- package/dist/jamespot-react-components/src/components/JRCCalendar/JRCEventStatusButton.d.ts +2 -1
- package/dist/jamespot-react-components/src/components/Widgets/JRCWidgetSlider/JRCWidgetArticleSliderEditorSlide.d.ts +1 -1
- package/dist/jamespot-react-components/src/types.d.ts +1 -1
- package/dist/jamespot-react-components.cjs +343 -343
- package/dist/jamespot-react-components.js +6280 -6145
- package/package.json +22 -22
package/dist/jamespot-react-components/src/components/Editors/components/EditorImageUpload.d.ts
CHANGED
|
@@ -5,8 +5,9 @@ type EditorImageUploadProps = {
|
|
|
5
5
|
initialFile?: jFileLittle;
|
|
6
6
|
allowCustomRatio?: boolean;
|
|
7
7
|
children(open: () => void, openCrop: () => void): ReactElement<HTMLElement>;
|
|
8
|
-
onUploadSuccess: (file: jFileLittle) => void;
|
|
8
|
+
onUploadSuccess: (file: jFileLittle | undefined) => void;
|
|
9
9
|
onLoading?: (isLoading: boolean) => void;
|
|
10
|
+
deferServerCalls?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const EditorImageUpload: ({ token, children, initialFile, onUploadSuccess, onLoading, allowCustomRatio, }: EditorImageUploadProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const EditorImageUpload: ({ token, children, initialFile, onUploadSuccess, onLoading, allowCustomRatio, deferServerCalls, }: EditorImageUploadProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1,43 +1,15 @@
|
|
|
1
|
-
import { ForwardedRef, ReactElement
|
|
2
|
-
import { ControllerRenderProps, FieldValues } from 'react-hook-form';
|
|
3
|
-
import { DataCy } from '../../../../types/dataAttributes';
|
|
1
|
+
import { ForwardedRef, ReactElement } from 'react';
|
|
2
|
+
import { ControllerRenderProps, FieldValues, Path } from 'react-hook-form';
|
|
4
3
|
import { PartialBy } from '../../../../types/utils';
|
|
5
|
-
import {
|
|
4
|
+
import { CheckboxProps, JRCInputCheckboxProps } from './JRCInputCheckbox.types';
|
|
6
5
|
export declare const ReadOnlyBorder: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
-
type
|
|
8
|
-
label: string | ReactElement;
|
|
9
|
-
value: string | number | TFieldValues;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
recommended?: boolean;
|
|
12
|
-
description?: string;
|
|
13
|
-
};
|
|
14
|
-
type CheckboxProps<TFieldValues> = DataCy & {
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
checkboxMode?: 'checkbox' | 'toggle' | 'radio';
|
|
17
|
-
options: Array<CheckboxOption<TFieldValues>>;
|
|
18
|
-
direction?: 'row' | 'column' | 'two-columns';
|
|
19
|
-
variant?: 'default' | 'outlined';
|
|
20
|
-
labelPosition?: 'before' | 'after';
|
|
21
|
-
SortByChecked?: boolean;
|
|
22
|
-
noMargin?: boolean;
|
|
23
|
-
backgroundOnHover?: boolean;
|
|
24
|
-
backgroundOnSelect?: boolean;
|
|
25
|
-
valueTypeIsBoolean?: boolean;
|
|
26
|
-
inverted?: boolean;
|
|
27
|
-
readOnly?: boolean;
|
|
28
|
-
getReadOnlyLabel?: (value: TFieldValues) => ReactNode;
|
|
29
|
-
limit?: number;
|
|
30
|
-
};
|
|
31
|
-
type JRCInputCheckboxProps<TFieldValues extends FieldValues = FieldValues> = CheckboxProps<TFieldValues> & JRCInputFieldProps<TFieldValues>;
|
|
32
|
-
type NativeCheckboxProps<TFieldValues extends FieldValues = FieldValues> = CheckboxProps<TFieldValues> & PartialBy<Omit<ControllerRenderProps<TFieldValues>, 'value' | 'ref'>, 'onBlur'> & {
|
|
6
|
+
type NativeCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = CheckboxProps<TFieldValues, TName> & PartialBy<Omit<ControllerRenderProps<TFieldValues, TName>, 'ref'>, 'onBlur'> & {
|
|
33
7
|
ref?: ForwardedRef<HTMLInputElement>;
|
|
34
|
-
} & {
|
|
35
|
-
value: TFieldValues | TFieldValues[];
|
|
36
8
|
htmlFor?: string;
|
|
37
9
|
};
|
|
38
10
|
export declare const ReadOnlyUl: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
|
|
39
|
-
export declare const JRCInputCheckboxRaw: <
|
|
11
|
+
export declare const JRCInputCheckboxRaw: <TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>>(props: NativeCheckboxProps<TFieldValues, TName> & {
|
|
40
12
|
margin?: string;
|
|
41
13
|
}) => ReactElement;
|
|
42
|
-
export declare function JRCInputCheckbox<TFieldValues extends FieldValues = FieldValues>({ name, control, rules, label, htmlFor, labelIsLegend, description, helper, direction, labelPosition, checkboxMode, backgroundOnHover, backgroundOnSelect, SortByChecked, valueTypeIsBoolean, ...props }: JRCInputCheckboxProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function JRCInputCheckbox<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>>({ name, control, rules, label, htmlFor, labelIsLegend, description, helper, direction, labelPosition, checkboxMode, backgroundOnHover, backgroundOnSelect, SortByChecked, valueTypeIsBoolean, ...props }: JRCInputCheckboxProps<TFieldValues, TName>): import("react/jsx-runtime").JSX.Element;
|
|
43
15
|
export {};
|
|
@@ -1,26 +1,41 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { ControllerRenderProps, FieldValues } from 'react-hook-form';
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { ControllerRenderProps, FieldValues, Path, PathValue } from 'react-hook-form';
|
|
3
|
+
import { DataCy } from '../../../../types/dataAttributes';
|
|
3
4
|
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
4
|
-
export type CheckboxValue<
|
|
5
|
-
export type CheckboxOption<TFieldValues extends FieldValues = FieldValues> = {
|
|
5
|
+
export type CheckboxValue<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = PathValue<TFieldValues, TName> extends (infer E)[] ? E : PathValue<TFieldValues, TName>;
|
|
6
|
+
export type CheckboxOption<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = {
|
|
6
7
|
label: string | ReactElement;
|
|
7
|
-
value: CheckboxValue<TFieldValues>;
|
|
8
|
+
value: CheckboxValue<TFieldValues, TName>;
|
|
8
9
|
disabled?: boolean;
|
|
10
|
+
recommended?: boolean;
|
|
9
11
|
description?: string;
|
|
10
12
|
};
|
|
11
|
-
export type
|
|
13
|
+
export type CheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = DataCy & {
|
|
12
14
|
disabled?: boolean;
|
|
13
15
|
checkboxMode?: 'checkbox' | 'toggle' | 'radio';
|
|
14
|
-
options: CheckboxOption<TFieldValues>[];
|
|
16
|
+
options: CheckboxOption<TFieldValues, TName>[];
|
|
15
17
|
direction?: 'row' | 'column' | 'two-columns';
|
|
16
18
|
variant?: 'default' | 'outlined';
|
|
17
19
|
labelPosition?: 'before' | 'after';
|
|
18
20
|
SortByChecked?: boolean;
|
|
21
|
+
noMargin?: boolean;
|
|
19
22
|
backgroundOnHover?: boolean;
|
|
20
23
|
backgroundOnSelect?: boolean;
|
|
21
24
|
valueTypeIsBoolean?: boolean;
|
|
25
|
+
inverted?: boolean;
|
|
26
|
+
readOnly?: boolean;
|
|
27
|
+
getReadOnlyLabel?: (value: CheckboxValue<TFieldValues, TName>) => ReactNode;
|
|
28
|
+
limit?: number;
|
|
22
29
|
};
|
|
23
|
-
export type JRCInputCheckboxProps<TFieldValues extends FieldValues = FieldValues> =
|
|
24
|
-
|
|
25
|
-
value: TFieldValues | TFieldValues[];
|
|
30
|
+
export type JRCInputCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = CheckboxProps<TFieldValues, TName> & Omit<JRCInputFieldProps<TFieldValues>, 'name'> & {
|
|
31
|
+
name: TName;
|
|
26
32
|
};
|
|
33
|
+
export type InputCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = CheckboxProps<TFieldValues, TName> & ControllerRenderProps<TFieldValues, TName>;
|
|
34
|
+
export type CheckboxReorderProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = CheckboxProps<TFieldValues, TName> & {
|
|
35
|
+
getLabel?: (option: CheckboxOption<TFieldValues, TName>) => ReactNode;
|
|
36
|
+
canReorder?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type JRCInputCheckboxReorderProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = CheckboxReorderProps<TFieldValues, TName> & Omit<JRCInputFieldProps<TFieldValues>, 'name'> & {
|
|
39
|
+
name: TName;
|
|
40
|
+
};
|
|
41
|
+
export type InputCheckboxReorderProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = CheckboxReorderProps<TFieldValues, TName> & ControllerRenderProps<TFieldValues, TName>;
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
5
|
-
type CheckboxOption<TFieldValues> = {
|
|
6
|
-
label: string | ReactElement;
|
|
7
|
-
value: string | number | TFieldValues;
|
|
8
|
-
};
|
|
9
|
-
type CheckboxProps<TFieldValues> = DataCy & {
|
|
10
|
-
options: Array<CheckboxOption<TFieldValues>>;
|
|
11
|
-
readOnly?: boolean;
|
|
12
|
-
getLabel?: (option: CheckboxOption<TFieldValues>) => ReactNode;
|
|
13
|
-
canReorder?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type JRCInputCheckboxProps<TFieldValues extends FieldValues = FieldValues> = CheckboxProps<TFieldValues> & JRCInputFieldProps<TFieldValues>;
|
|
16
|
-
export declare function JRCInputReorderCheckbox<TFieldValues extends FieldValues = FieldValues>({ name, control, rules, label, htmlFor, labelIsLegend, description, helper, margin, ...props }: JRCInputCheckboxProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
1
|
+
import { FieldValues, Path } from 'react-hook-form';
|
|
2
|
+
import { JRCInputCheckboxReorderProps } from './JRCInputCheckbox.types';
|
|
3
|
+
export declare function JRCInputReorderCheckbox<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>>({ name, control, rules, label, htmlFor, labelIsLegend, description, helper, margin, ...props }: JRCInputCheckboxReorderProps<TFieldValues, TName>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
|
-
import {
|
|
2
|
+
import { JRCInputCheckboxReorderProps } from './JRCInputCheckbox.types';
|
|
3
3
|
declare const _default: Meta;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const InputReorderCheckbox: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react-webpack5').ReactRenderer,
|
|
5
|
+
export declare const InputReorderCheckbox: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react-webpack5').ReactRenderer, JRCInputCheckboxReorderProps<any>>;
|
package/dist/jamespot-react-components/src/components/Form/Input/JRCInputFile/JRCInputFile.d.ts
CHANGED
|
@@ -3,27 +3,34 @@ import { DataCy } from '../../../../types/dataAttributes';
|
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
import { ApiWrapper, jFileLittle } from '../../../../../../jamespot-user-api/src';
|
|
5
5
|
import { ComponentPropsWithoutRef } from 'react';
|
|
6
|
-
|
|
7
|
-
token?: string
|
|
6
|
+
type BaseInputFileProps = DataCy & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange'> & {
|
|
7
|
+
token?: string;
|
|
8
8
|
attrName?: string;
|
|
9
9
|
onLoading?: (state: boolean) => void;
|
|
10
10
|
value: ApiWrapper<jFileLittle>[];
|
|
11
|
-
onChange: (files: ApiWrapper<jFileLittle>[]) => void;
|
|
12
11
|
showLoading?: boolean;
|
|
13
12
|
};
|
|
13
|
+
type UploadHandler = (files: ApiWrapper<jFileLittle>[]) => void;
|
|
14
|
+
type ExternalUploadHandler = (files: File[]) => void | Promise<void>;
|
|
15
|
+
type deferServerCallsProps = {
|
|
16
|
+
deferServerCalls: true;
|
|
17
|
+
onChange: ExternalUploadHandler;
|
|
18
|
+
};
|
|
19
|
+
type StandardChangeProps = {
|
|
20
|
+
deferServerCalls?: false;
|
|
21
|
+
onChange: UploadHandler;
|
|
22
|
+
};
|
|
23
|
+
export type NativeInputFileProps = BaseInputFileProps & (deferServerCallsProps | StandardChangeProps);
|
|
14
24
|
export type JRCInputFileProps<T extends FieldValues = FieldValues> = JRCInputFieldProps<T> & Omit<NativeInputFileProps, 'value' | 'onChange'>;
|
|
15
|
-
export declare const InputFile: import('react').ForwardRefExoticComponent<
|
|
16
|
-
token?: string | undefined;
|
|
17
|
-
attrName?: string;
|
|
18
|
-
onLoading?: (state: boolean) => void;
|
|
19
|
-
value: ApiWrapper<jFileLittle>[];
|
|
20
|
-
onChange: (files: ApiWrapper<jFileLittle>[]) => void;
|
|
21
|
-
showLoading?: boolean;
|
|
22
|
-
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
25
|
+
export declare const InputFile: import('react').ForwardRefExoticComponent<NativeInputFileProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
23
26
|
/**
|
|
24
27
|
* Component used as a <input type="file"/>
|
|
25
28
|
* @param props JRCInputFieldProps
|
|
29
|
+
* @param props.token - Authentication token for file uploads (required).
|
|
30
|
+
* @param props.deferServerCalls - If true, skips server-side upload and calls onChange with raw File[].
|
|
31
|
+
* @param props.onLoading - Callback to indicate loading state.
|
|
26
32
|
* validation props: required
|
|
27
33
|
* @returns JSX.Element
|
|
28
34
|
*/
|
|
29
35
|
export declare function JRCInputFile<T extends FieldValues = FieldValues>(props: JRCInputFileProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -25,10 +25,21 @@ export type NativeInputImageProps = DataCy & Omit<ComponentPropsWithoutRef<'inpu
|
|
|
25
25
|
readOnlyImg?: string;
|
|
26
26
|
initialValue?: jFileLittle | undefined;
|
|
27
27
|
value: jFileLittle | undefined;
|
|
28
|
-
onChange: (
|
|
28
|
+
onChange: (file: jFileLittle | File | undefined) => void;
|
|
29
29
|
disableCrop?: boolean;
|
|
30
30
|
buttonsPosition?: 'inside' | 'under';
|
|
31
31
|
allowCustomRatio?: boolean;
|
|
32
32
|
zIndex?: number;
|
|
33
|
+
/** When true, skip server-side calls (jamespot.file.deleteImage, jamespot.file.update) — the caller manages image mutations externally */
|
|
34
|
+
deferServerCalls?: boolean;
|
|
35
|
+
/** Called instead of file.update when deferServerCalls=true and user crops an existing server file */
|
|
36
|
+
onCrop?: (settings: {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
w: number;
|
|
40
|
+
h: number;
|
|
41
|
+
rotation: number;
|
|
42
|
+
killSize: boolean;
|
|
43
|
+
}) => void;
|
|
33
44
|
};
|
|
34
45
|
export type JRCInputImageProps<T extends FieldValues = FieldValues> = JRCInputFieldProps<T> & Omit<NativeInputImageProps, 'value' | 'onChange'>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UserResponseStatus } from '../../../../jamespot-user-api/src';
|
|
2
2
|
type JRCEventStatusButtonProps = {
|
|
3
3
|
eventType: string;
|
|
4
|
+
eventAddress?: string | undefined;
|
|
4
5
|
eventIsVisio?: boolean;
|
|
5
6
|
onUpdateStatus: (status: UserResponseStatus) => void;
|
|
6
7
|
canSubscribe?: boolean;
|
|
@@ -9,5 +10,5 @@ type JRCEventStatusButtonProps = {
|
|
|
9
10
|
noGestion?: boolean;
|
|
10
11
|
loading: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const JRCEventStatusButton: ({ onUpdateStatus, eventType, eventIsVisio, canSubscribe, status, urlGestion, noGestion, loading, }: JRCEventStatusButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export declare const JRCEventStatusButton: ({ onUpdateStatus, eventType, eventAddress, eventIsVisio, canSubscribe, status, urlGestion, noGestion, loading, }: JRCEventStatusButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
14
|
export {};
|
|
@@ -5,7 +5,7 @@ export declare const JRCWidgetArticleSliderEditorSlide: ({ forceOpen, title, tex
|
|
|
5
5
|
file?: jFileLittle;
|
|
6
6
|
token?: string;
|
|
7
7
|
onUploadStart: () => void;
|
|
8
|
-
onUploadSuccess: (response: jFileLittle) => void;
|
|
8
|
+
onUploadSuccess: (response: jFileLittle | undefined) => void;
|
|
9
9
|
onSave: (slide: Partial<WidgetArticleSlideAttributes>) => void;
|
|
10
10
|
onClickDelete: () => void;
|
|
11
11
|
} & Pick<WidgetArticleSlideAttributes, "title" | "text" | "opacityColor" | "opacityFilter" | "displayAs" | "backgroundSize" | "backgroundPosition">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ export type { JRCEllipsisProps } from './components/Deprecated/Deprecated_JRCEll
|
|
|
6
6
|
export * from './components/Form/Common/types';
|
|
7
7
|
export type { JRCInputFieldProps, NameControl } from './components/Form/Input/Common/JRCFormFieldRenderer.types';
|
|
8
8
|
export type { FormControls } from './components/Form/Input/Common/useFormControls';
|
|
9
|
-
export type { CheckboxOption, CheckboxValue,
|
|
9
|
+
export type { CheckboxOption, CheckboxValue, CheckboxProps, InputCheckboxProps, JRCInputCheckboxProps, } from './components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.types';
|
|
10
10
|
export type { JRCInputDateProps } from './components/Form/Input/JRCInputDate/JRCInputDate';
|
|
11
11
|
export type { JRCInputDateTimeProps } from './components/Form/Input/JRCInputDateTime/JRCInputDateTime';
|
|
12
12
|
export type { JRCInputFileProps } from './components/Form/Input/JRCInputFile/JRCInputFile';
|