@inseefr/lunatic 2.7.1 → 2.7.3
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/README.md +45 -11
- package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +3 -3
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +2 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +0 -2
- package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +4 -2
- package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +3 -3
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +2 -2
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +2 -1
- package/lib/components/checkbox/commons/checkbox-option.js +3 -1
- package/lib/components/commons/components/combo-box/combo-box-container.js +1 -2
- package/lib/components/commons/components/combo-box/combo-box.js +2 -2
- package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +3 -1
- package/lib/components/commons/components/combo-box/selection/input.js +3 -1
- package/lib/components/commons/components/combo-box/selection/selection.js +3 -1
- package/lib/components/commons/components/errors/errors.js +12 -10
- package/lib/components/commons/components/errors/errors.spec.js +6 -6
- package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +2 -0
- package/lib/components/component-set/html/component-set.js +2 -2
- package/lib/components/datepicker/html/DatepickerField.js +47 -0
- package/lib/components/datepicker/html/__snapshots__/datepicker.spec.tsx.snap +209 -17
- package/lib/components/datepicker/html/datepicker.js +104 -21
- package/lib/components/datepicker/html/datepicker.scss +19 -1
- package/lib/components/datepicker/html/datepicker.spec.js +71 -23
- package/lib/components/datepicker/lunatic-datepicker.js +5 -2
- package/lib/components/dropdown/lunatic-dropdown.js +2 -1
- package/lib/components/duration/duration.js +6 -7
- package/lib/components/duration/duration.scss +6 -14
- package/lib/components/duration/durationInput.js +14 -8
- package/lib/components/duration/durationUtils.js +38 -8
- package/lib/components/input/html/__snapshots__/input.spec.tsx.snap +2 -0
- package/lib/components/input/html/input.js +3 -3
- package/lib/components/input/lunatic-input.js +2 -1
- package/lib/components/input-number/html/__snapshots__/input-number.spec.tsx.snap +2 -2
- package/lib/components/input-number/html/input-number-thousand.js +4 -17
- package/lib/components/input-number/html/input-number.js +3 -5
- package/lib/components/input-number/lunatic-input-number.js +2 -3
- package/lib/components/loop/block-for-loop.js +3 -3
- package/lib/components/loop/roster-for-loop/__snapshots__/roster-for-loop.spec.tsx.snap +88 -0
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +7 -3
- package/lib/components/loop/roster-for-loop/roster-for-loop.spec.js +46 -0
- package/lib/components/lunatic-components.js +2 -11
- package/lib/components/radio/html/radio-group-content.js +4 -2
- package/lib/components/radio/html/radio-group.js +3 -3
- package/lib/components/radio/html/radio-option.js +3 -1
- package/lib/components/radio/lunatic-radio-group.js +2 -1
- package/lib/components/suggester/find-best-label/find-best-label.js +5 -5
- package/lib/components/suggester/idb-suggester/check-store.js +6 -3
- package/lib/components/suggester/idb-suggester/idb-suggester.js +8 -7
- package/lib/components/suggester/idb-suggester/suggester-status.js +1 -4
- package/lib/components/suggester/lunatic-suggester.js +7 -4
- package/lib/components/suggester/searching/create-searching.js +19 -42
- package/lib/components/suggester-loader-widget/loader-row.js +4 -2
- package/lib/components/suggester-loader-widget/loader.js +5 -4
- package/lib/components/suggester-loader-widget/widget.js +8 -8
- package/lib/components/switch/html/switch.js +2 -2
- package/lib/components/switch/lunatic-switch.js +2 -1
- package/lib/components/table/lunatic-table.js +2 -2
- package/lib/components/textarea/html/__snapshots__/textarea.spec.tsx.snap +2 -0
- package/lib/components/textarea/html/textarea.js +6 -4
- package/lib/components/textarea/lunatic-textarea.js +6 -3
- package/lib/hooks/use-auto-focus.js +26 -0
- package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +1 -1
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +2 -1
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +1 -1
- package/lib/src/components/checkbox/commons/checkbox-option.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/combo-box.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/selection/input.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -1
- package/lib/src/components/commons/components/errors/errors.d.ts +6 -3
- package/lib/src/components/datepicker/html/DatepickerField.d.ts +12 -0
- package/lib/src/components/datepicker/html/datepicker.d.ts +4 -3
- package/lib/src/components/datepicker/lunatic-datepicker.d.ts +1 -0
- package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown.d.ts +3 -1
- package/lib/src/components/duration/durationInput.d.ts +6 -2
- package/lib/src/components/duration/durationUtils.d.ts +24 -7
- package/lib/src/components/input/html/input.d.ts +2 -2
- package/lib/src/components/input-number/html/input-number-thousand.d.ts +2 -2
- package/lib/src/components/input-number/html/input-number.d.ts +2 -3
- package/lib/src/components/radio/html/radio-group-content.d.ts +2 -1
- package/lib/src/components/radio/html/radio-group.d.ts +1 -1
- package/lib/src/components/radio/html/radio-option.d.ts +1 -0
- package/lib/src/components/suggester/find-best-label/find-best-label.d.ts +1 -1
- package/lib/src/components/suggester/html/suggester.d.ts +1 -1
- package/lib/src/components/suggester/idb-suggester/check-store.d.ts +5 -2
- package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +5 -2
- package/lib/src/components/suggester/idb-suggester/suggester-status.d.ts +1 -4
- package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
- package/lib/src/components/suggester/searching/create-searching.d.ts +1 -1
- package/lib/src/components/suggester-loader-widget/loader-row.d.ts +2 -1
- package/lib/src/components/suggester-loader-widget/loader.d.ts +2 -1
- package/lib/src/components/suggester-loader-widget/widget.d.ts +3 -2
- package/lib/src/components/switch/html/switch.d.ts +1 -1
- package/lib/src/components/textarea/html/textarea.d.ts +3 -2
- package/lib/src/components/type.d.ts +5 -3
- package/lib/src/hooks/use-auto-focus.d.ts +6 -0
- package/lib/src/use-lunatic/actions.d.ts +2 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +383 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-value.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-component-value.spec.d.ts +1 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +20 -0
- package/lib/src/use-lunatic/commons/variables/lunatic-variables-store.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +1 -0
- package/lib/src/use-lunatic/type.d.ts +1 -0
- package/lib/src/use-lunatic/use-lunatic.d.ts +8 -3
- package/lib/src/use-lunatic/use-suggesters.d.ts +2 -1
- package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +2 -2
- package/lib/src/utils/suggester-workers/worker-path.d.ts +6 -0
- package/lib/stories/behaviour/cleaning/source.json +151 -0
- package/lib/stories/behaviour/cleaning/test.stories.js +83 -0
- package/lib/stories/{questionnaires-test → behaviour}/controls/controls.stories.js +5 -5
- package/lib/stories/{questionnaires-test → behaviour/others}/test.stories.js +7 -7
- package/lib/stories/{paste-questionnaire → behaviour/paste}/test.stories.js +5 -4
- package/lib/stories/{resizing-questionnaire → behaviour/resizing}/test.stories.js +5 -4
- package/lib/stories/date-picker/datepicker.stories.js +32 -29
- package/lib/stories/duration/duration.stories.js +4 -4
- package/lib/stories/duration/{source.json → mois.json} +1 -1
- package/lib/stories/duration/{source1.json → time.json} +1 -1
- package/lib/stories/loop/not-paginated-loop.stories.js +35 -0
- package/lib/stories/loop/source-bloc.json +2 -2
- package/lib/stories/loop/source-not-paginated.json +138 -0
- package/lib/stories/loop/source-paginated.json +2 -2
- package/lib/stories/suggester/suggester.stories.js +6 -37
- package/lib/stories/utils/referentiel.js +38 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-required.js +23 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-value.spec.js +67 -0
- package/lib/use-lunatic/commons/fill-components/fill-components.js +2 -1
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +2 -0
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.js +15 -0
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.spec.js +9 -1
- package/lib/use-lunatic/initial-state.js +2 -1
- package/lib/use-lunatic/reducer/reduce-on-init.js +4 -2
- package/lib/use-lunatic/use-lunatic.js +7 -3
- package/lib/use-lunatic/use-suggesters.js +55 -38
- package/lib/utils/env.js +9 -1
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +5 -4
- package/lib/utils/suggester-workers/create-worker.js +7 -1
- package/lib/utils/suggester-workers/worker-path.js +29 -0
- package/package.json +24 -11
- package/scripts/build/add-workers-to-public.js +44 -0
- package/scripts/build/workers-paths.js +45 -0
- package/workers-release/lunatic-append-worker-0.3.0.js +2 -0
- package/workers-release/lunatic-append-worker-0.3.0.js.LICENSE.txt +34 -0
- package/workers-release/lunatic-label-worker-0.3.0.js +2 -0
- package/workers-release/lunatic-label-worker-0.3.0.js.LICENSE.txt +13 -0
- package/workers-release/lunatic-search-worker-0.3.0.js +2 -0
- package/workers-release/lunatic-search-worker-0.3.0.js.LICENSE.txt +34 -0
- package/lib/components/datepicker/html/datepicker-container.js +0 -17
- package/lib/components/datepicker/html/datepicker-input.js +0 -35
- package/lib/env.d.js +0 -1
- package/lib/src/components/datepicker/html/datepicker-container.d.ts +0 -3
- package/lib/src/components/datepicker/html/datepicker-input.d.ts +0 -13
- package/lib/src/utils/get-component-value.d.ts +0 -5
- package/lib/src/utils/store-tools/worker-path.d.ts +0 -1
- package/lib/utils/get-component-value.js +0 -34
- package/lib/utils/get-component-value.test.js +0 -57
- package/lib/utils/store-tools/worker-path.js +0 -13
- package/lib/utils/suggester-workers/create-worker-ts.js +0 -54
- /package/lib/src/{utils/get-component-value.test.d.ts → components/loop/roster-for-loop/roster-for-loop.spec.d.ts} +0 -0
- /package/lib/src/utils/suggester-workers/{create-worker-ts.d.ts → create-worker.d.ts} +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees2_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/boucles-n.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.stories.js +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_DeclarationsSimples.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_MinMaxSum_Boucles.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_QuestSimple_Boucles.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_TCMRallyeGames.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/test-dylan.json +0 -0
- /package/lib/stories/{paste-questionnaire → behaviour/paste}/source.json +0 -0
- /package/lib/stories/{resizing-questionnaire → behaviour/resizing}/source.json +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import './errors.scss';
|
|
2
2
|
import type { LunaticError } from '../../../../use-lunatic/type';
|
|
3
3
|
type Props = {
|
|
4
|
-
errors?:
|
|
5
|
-
activeId?: string;
|
|
4
|
+
errors?: LunaticError[];
|
|
6
5
|
};
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Display a list of error as simple red text
|
|
8
|
+
*/
|
|
9
|
+
declare function Errors({ errors }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export declare function getComponentErrors(errors?: Record<string, LunaticError[]>, componentId?: string): LunaticError[] | undefined;
|
|
8
11
|
export default Errors;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description: string;
|
|
5
|
+
max?: number;
|
|
6
|
+
onChange: (value: number) => void;
|
|
7
|
+
value?: number;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function DatepickerField({ label, id, description, onChange, value, max, readOnly, disabled, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import './datepicker.scss';
|
|
3
2
|
import type { LunaticError } from '../../../use-lunatic/type';
|
|
3
|
+
import './datepicker.scss';
|
|
4
4
|
type Props = {
|
|
5
5
|
label?: ReactNode;
|
|
6
6
|
description?: ReactNode;
|
|
7
|
-
errors?:
|
|
7
|
+
errors?: LunaticError[];
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
readOnly?: boolean;
|
|
10
10
|
min?: string;
|
|
11
11
|
max?: string;
|
|
12
12
|
id?: string;
|
|
13
13
|
value?: string;
|
|
14
|
-
onChange: (s: string) => void;
|
|
14
|
+
onChange: (s: string | null) => void;
|
|
15
|
+
format?: string;
|
|
15
16
|
};
|
|
16
17
|
declare const _default: import("react").ComponentType<Props>;
|
|
17
18
|
export default _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './dropdown.scss';
|
|
3
3
|
import type { LunaticComponentProps } from '../../type';
|
|
4
|
+
import type { LunaticError } from '../../../use-lunatic/type';
|
|
4
5
|
export type DropdownProps = {
|
|
5
6
|
onSelect: (v: string | null) => void;
|
|
6
7
|
className?: string;
|
|
7
8
|
readOnly?: boolean;
|
|
8
|
-
|
|
9
|
+
errors?: LunaticError[];
|
|
10
|
+
} & Pick<LunaticComponentProps<'Dropdown'>, 'id' | 'disabled' | 'options' | 'writable' | 'value' | 'description' | 'label'>;
|
|
9
11
|
declare const _default: import("react").ComponentType<DropdownProps>;
|
|
10
12
|
export default _default;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
import { type Formats } from './durationUtils';
|
|
2
|
-
|
|
3
|
+
type Props = {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
id?: string;
|
|
3
6
|
value: string | null;
|
|
4
7
|
format: Formats;
|
|
5
8
|
onChange: (s: string | null) => void;
|
|
6
|
-
}
|
|
9
|
+
};
|
|
10
|
+
declare const DurationInput: ({ value, format, onChange, label }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
11
|
export default DurationInput;
|
|
@@ -7,19 +7,35 @@ export type DurationValue = {
|
|
|
7
7
|
export type Formats = 'PTnHnM' | 'PnYnM';
|
|
8
8
|
export declare const propsByUnit: {
|
|
9
9
|
hours: {
|
|
10
|
-
min:
|
|
11
|
-
max:
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
size: number;
|
|
13
|
+
style: {
|
|
14
|
+
width: string;
|
|
15
|
+
};
|
|
12
16
|
};
|
|
13
17
|
minutes: {
|
|
14
|
-
min:
|
|
15
|
-
max:
|
|
18
|
+
min: number;
|
|
19
|
+
max: number;
|
|
20
|
+
size: number;
|
|
21
|
+
style: {
|
|
22
|
+
width: string;
|
|
23
|
+
};
|
|
16
24
|
};
|
|
17
25
|
months: {
|
|
18
|
-
min:
|
|
19
|
-
max:
|
|
26
|
+
min: number;
|
|
27
|
+
max: number;
|
|
28
|
+
size: number;
|
|
29
|
+
style: {
|
|
30
|
+
width: string;
|
|
31
|
+
};
|
|
20
32
|
};
|
|
21
33
|
years: {
|
|
22
|
-
min:
|
|
34
|
+
min: number;
|
|
35
|
+
size: number;
|
|
36
|
+
style: {
|
|
37
|
+
width: string;
|
|
38
|
+
};
|
|
23
39
|
};
|
|
24
40
|
};
|
|
25
41
|
export declare const labelByUnit: {
|
|
@@ -28,3 +44,4 @@ export declare const labelByUnit: {
|
|
|
28
44
|
months: string;
|
|
29
45
|
years: string;
|
|
30
46
|
};
|
|
47
|
+
export declare function clampDuration(value: number | null, unit: keyof typeof propsByUnit): number | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import './input.scss';
|
|
3
|
-
import type {
|
|
3
|
+
import type { LunaticError } from '../../../use-lunatic/type';
|
|
4
4
|
type Props = {
|
|
5
5
|
label?: ReactNode;
|
|
6
6
|
onChange: (v: string) => void;
|
|
7
7
|
description?: string;
|
|
8
|
-
errors
|
|
8
|
+
errors?: LunaticError[];
|
|
9
9
|
value?: string | null;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
readOnly?: boolean;
|
|
@@ -6,9 +6,9 @@ type Props = {
|
|
|
6
6
|
readOnly?: boolean;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
labelId?: string;
|
|
9
|
-
min?: number;
|
|
10
9
|
max?: number;
|
|
11
10
|
decimals?: number;
|
|
11
|
+
invalid?: boolean;
|
|
12
12
|
};
|
|
13
|
-
declare const InputNumberThousand: ({ id, onChange, value, disabled, readOnly, required, labelId,
|
|
13
|
+
declare const InputNumberThousand: ({ id, onChange, value, disabled, readOnly, required, labelId, max, decimals, invalid, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default InputNumberThousand;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import { type LunaticBaseProps } from '../../type';
|
|
3
2
|
import './input-number.scss';
|
|
3
|
+
import type { LunaticError } from '../../../use-lunatic/type';
|
|
4
4
|
type Props = {
|
|
5
5
|
id?: string;
|
|
6
6
|
onChange?: (n: number | null) => void;
|
|
@@ -9,13 +9,12 @@ type Props = {
|
|
|
9
9
|
readOnly?: boolean;
|
|
10
10
|
required?: boolean;
|
|
11
11
|
labelId?: string;
|
|
12
|
-
min?: number;
|
|
13
12
|
max?: number;
|
|
14
13
|
decimals?: number;
|
|
15
14
|
label?: ReactNode;
|
|
16
15
|
description?: string;
|
|
17
16
|
unit?: string;
|
|
18
|
-
errors?:
|
|
17
|
+
errors?: LunaticError[];
|
|
19
18
|
};
|
|
20
19
|
declare const _default: import("react").ComponentType<Props>;
|
|
21
20
|
export default _default;
|
|
@@ -13,6 +13,7 @@ export type Props = {
|
|
|
13
13
|
shortcut?: boolean;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
readOnly?: boolean;
|
|
16
|
+
invalid?: boolean;
|
|
16
17
|
};
|
|
17
|
-
declare function RadioGroupContent({ options, value, id, onClick, checkboxStyle, shortcut, disabled, readOnly, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function RadioGroupContent({ options, value, id, onClick, checkboxStyle, shortcut, disabled, readOnly, invalid, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export default RadioGroupContent;
|
|
@@ -13,7 +13,7 @@ export type RadioGroupProps = {
|
|
|
13
13
|
label?: ReactNode;
|
|
14
14
|
onSelect: (v: string | null) => void;
|
|
15
15
|
checkboxStyle?: boolean;
|
|
16
|
-
errors?:
|
|
16
|
+
errors?: LunaticError[];
|
|
17
17
|
className?: string;
|
|
18
18
|
shortcut?: boolean;
|
|
19
19
|
disabled?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function findBestLabel(option: unknown, search: unknown): Promise<unknown>;
|
|
1
|
+
declare function findBestLabel(option: unknown, search: unknown, workersBasePath?: string): Promise<unknown>;
|
|
2
2
|
export default findBestLabel;
|
|
@@ -2,7 +2,10 @@ import { type PropsWithChildren } from 'react';
|
|
|
2
2
|
type Props = PropsWithChildren<{
|
|
3
3
|
storeName: string;
|
|
4
4
|
version: number;
|
|
5
|
-
|
|
5
|
+
onInfo: (v: any) => void;
|
|
6
6
|
}>;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Check the store info displaying a message while it is fetching
|
|
9
|
+
*/
|
|
10
|
+
declare function CheckStore({ storeName, version, onInfo, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export default CheckStore;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { LunaticError } from '../../../use-lunatic/type';
|
|
1
2
|
import type { LunaticComponentProps } from '../../type';
|
|
2
|
-
type Props = Pick<LunaticComponentProps<'Suggester'>, 'storeName' | 'idbVersion' | 'id' | 'className' | 'optionRenderer' | 'labelRenderer' | 'disabled' | 'readOnly' | 'value' | 'label' | 'description' | 'getSuggesterStatus'
|
|
3
|
+
type Props = Pick<LunaticComponentProps<'Suggester'>, 'storeName' | 'idbVersion' | 'id' | 'className' | 'optionRenderer' | 'labelRenderer' | 'disabled' | 'readOnly' | 'value' | 'label' | 'description' | 'getSuggesterStatus'> & {
|
|
4
|
+
errors?: LunaticError[];
|
|
3
5
|
onSelect: (v: string | null) => void;
|
|
6
|
+
workersBasePath?: string;
|
|
4
7
|
};
|
|
5
|
-
export declare function IDBSuggester({ storeName, idbVersion, id, className, optionRenderer, labelRenderer, onSelect, disabled, value, label, description, getSuggesterStatus, errors, readOnly, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function IDBSuggester({ storeName, idbVersion, id, className, optionRenderer, labelRenderer, onSelect, disabled, value, label, description, getSuggesterStatus, errors, readOnly, workersBasePath, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export {};
|
|
@@ -17,10 +17,7 @@ type Props = PropsWithChildren<{
|
|
|
17
17
|
description?: ReactNode;
|
|
18
18
|
}>;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* it notifies users through SuggesterNotification, a customizable component.
|
|
22
|
-
* @param {} param0
|
|
23
|
-
* @returns
|
|
20
|
+
* Check the status of suggester status and shows a warning / error
|
|
24
21
|
*/
|
|
25
22
|
export declare function SuggesterStatus({ children, storeName, getSuggesterStatus, label, description, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
26
23
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LunaticComponentProps } from '../type';
|
|
2
|
-
declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, readOnly, errors, label, description, preferences, declarations, missing, missingResponse, management, response, className, getSuggesterStatus, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, readOnly, errors, label, description, preferences, declarations, missing, missingResponse, management, response, className, getSuggesterStatus, workersBasePath, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default LunaticSuggester;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComboBoxOptionType } from '../../commons/components/combo-box/combo-box.type';
|
|
2
2
|
export declare function isWorkerCompatible(): boolean;
|
|
3
|
-
declare function createSearching(name: string, version: string): (search: string | null) => Promise<{
|
|
3
|
+
declare function createSearching(name: string, version: string, workersBasePath?: string): (search: string | null) => Promise<{
|
|
4
4
|
results: ComboBoxOptionType[];
|
|
5
5
|
}>;
|
|
6
6
|
export default createSearching;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { SuggesterType } from '../../use-lunatic/type-source';
|
|
2
2
|
type Props = {
|
|
3
3
|
storeInfo: SuggesterType;
|
|
4
|
+
workersBasePath?: string;
|
|
4
5
|
idbVersion: number;
|
|
5
6
|
fetchStore: () => Promise<unknown[]>;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
onRefresh: (s: string) => void;
|
|
8
9
|
};
|
|
9
|
-
declare function LoaderRow({ storeInfo, idbVersion, fetchStore, onRefresh, disabled, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function LoaderRow({ storeInfo, workersBasePath, idbVersion, fetchStore, onRefresh, disabled, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default LoaderRow;
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
handleClick: (n: number) => void;
|
|
8
8
|
start?: boolean;
|
|
9
9
|
store: SuggesterType;
|
|
10
|
+
workersBasePath?: string;
|
|
10
11
|
};
|
|
11
|
-
declare function Loader({ start, db, store, idbVersion, fetch, post, handleClick, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function Loader({ start, db, store, workersBasePath, idbVersion, fetch, post, handleClick, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export default Loader;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import './widget.scss';
|
|
2
1
|
import type { SuggesterType } from '../../use-lunatic/type-source';
|
|
2
|
+
import './widget.scss';
|
|
3
3
|
type Props = {
|
|
4
4
|
absolute?: boolean;
|
|
5
5
|
source: {
|
|
6
6
|
suggesters: Array<SuggesterType>;
|
|
7
7
|
};
|
|
8
|
+
workersBasePath?: string;
|
|
8
9
|
onRefresh: () => void;
|
|
9
10
|
getStoreInfo: (s: string) => {
|
|
10
11
|
idbVersion: number;
|
|
11
12
|
fetch: () => Promise<unknown[]>;
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
|
-
declare function SuggesterLoaderWidget({ source, getStoreInfo, onRefresh, absolute, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function SuggesterLoaderWidget({ source, workersBasePath, getStoreInfo, onRefresh, absolute, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default SuggesterLoaderWidget;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import './textarea.scss';
|
|
3
|
-
import type
|
|
3
|
+
import { type LunaticError } from '../../../use-lunatic/type';
|
|
4
4
|
type Props = {
|
|
5
5
|
id?: string;
|
|
6
6
|
rows?: number;
|
|
@@ -11,8 +11,9 @@ type Props = {
|
|
|
11
11
|
label?: ReactNode;
|
|
12
12
|
value?: string | number | null;
|
|
13
13
|
description?: string;
|
|
14
|
-
errors?:
|
|
14
|
+
errors?: LunaticError[];
|
|
15
15
|
readOnly?: boolean;
|
|
16
|
+
required?: boolean;
|
|
16
17
|
};
|
|
17
18
|
declare const _default: import("react").ComponentType<Props>;
|
|
18
19
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { LunaticComponentDefinition, LunaticError, LunaticState } from '../use-lunatic/type';
|
|
2
1
|
import type { CSSProperties, FunctionComponent, ReactNode } from 'react';
|
|
3
|
-
import { SuggesterStatus } from '../use-lunatic/use-suggesters';
|
|
4
2
|
import useLunatic from '../use-lunatic';
|
|
5
3
|
import type { FilledLunaticComponentProps } from '../use-lunatic/commons/fill-components/fill-components';
|
|
4
|
+
import type { LunaticComponentDefinition, LunaticError, LunaticState } from '../use-lunatic/type';
|
|
5
|
+
import { SuggesterStatus } from '../use-lunatic/use-suggesters';
|
|
6
6
|
type Formats = 'PTnHnM' | 'PnYnM';
|
|
7
7
|
export type VtlExpression = {
|
|
8
8
|
value: string;
|
|
@@ -60,7 +60,7 @@ export type SuggesterOption = {
|
|
|
60
60
|
};
|
|
61
61
|
type ComponentPropsByType = {
|
|
62
62
|
InputNumber: LunaticBaseProps<number | null> & {
|
|
63
|
-
min
|
|
63
|
+
min?: number;
|
|
64
64
|
max: number;
|
|
65
65
|
decimals: number;
|
|
66
66
|
unit?: string;
|
|
@@ -129,6 +129,7 @@ type ComponentPropsByType = {
|
|
|
129
129
|
iteration: LunaticState['pager']['iteration'];
|
|
130
130
|
};
|
|
131
131
|
Datepicker: LunaticBaseProps<string | null> & {
|
|
132
|
+
format: 'YYYY-MM-DD' | 'YYYY-MM' | 'YYYY';
|
|
132
133
|
min?: string;
|
|
133
134
|
max?: string;
|
|
134
135
|
response: {
|
|
@@ -236,6 +237,7 @@ type ComponentPropsByType = {
|
|
|
236
237
|
};
|
|
237
238
|
Suggester: LunaticBaseProps<string | null> & {
|
|
238
239
|
storeName: string;
|
|
240
|
+
workersBasePath?: string;
|
|
239
241
|
getSuggesterStatus: (name: string) => {
|
|
240
242
|
status: SuggesterStatus;
|
|
241
243
|
timestamp: number;
|
|
@@ -40,6 +40,7 @@ export type ActionInit = {
|
|
|
40
40
|
goNextPage: () => void;
|
|
41
41
|
goPreviousPage: () => void;
|
|
42
42
|
withOverview: boolean;
|
|
43
|
+
workersBasePath?: string;
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
export type ActionOnSetWaiting = {
|
|
@@ -100,6 +101,7 @@ export declare const onInit: (payload: {
|
|
|
100
101
|
goNextPage: () => void;
|
|
101
102
|
goPreviousPage: () => void;
|
|
102
103
|
withOverview: boolean;
|
|
104
|
+
workersBasePath?: string | undefined;
|
|
103
105
|
}) => ActionInit & {
|
|
104
106
|
type: ActionKind.ON_INIT;
|
|
105
107
|
};
|