@inseefr/lunatic 2.6.2 → 2.6.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.
Files changed (129) hide show
  1. package/README.md +49 -3
  2. package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +3 -3
  3. package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +7 -1
  4. package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +0 -2
  5. package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +4 -2
  6. package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +3 -3
  7. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +2 -1
  8. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +2 -1
  9. package/lib/components/checkbox/commons/checkbox-option.js +3 -1
  10. package/lib/components/commons/components/combo-box/combo-box-container.js +1 -2
  11. package/lib/components/commons/components/combo-box/combo-box.js +2 -2
  12. package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +3 -1
  13. package/lib/components/commons/components/combo-box/selection/input.js +3 -1
  14. package/lib/components/commons/components/combo-box/selection/selection.js +3 -1
  15. package/lib/components/commons/components/errors/errors.js +12 -10
  16. package/lib/components/commons/components/errors/errors.spec.js +6 -6
  17. package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +2 -0
  18. package/lib/components/component-set/html/component-set.js +2 -2
  19. package/lib/components/datepicker/html/__snapshots__/datepicker.spec.tsx.snap +2 -0
  20. package/lib/components/datepicker/html/datepicker-input.js +4 -2
  21. package/lib/components/datepicker/html/datepicker.js +3 -3
  22. package/lib/components/datepicker/lunatic-datepicker.js +2 -1
  23. package/lib/components/dropdown/lunatic-dropdown.js +2 -1
  24. package/lib/components/input/html/__snapshots__/input.spec.tsx.snap +2 -0
  25. package/lib/components/input/html/input.js +3 -3
  26. package/lib/components/input/lunatic-input.js +2 -1
  27. package/lib/components/input-number/html/__snapshots__/input-number.spec.tsx.snap +2 -2
  28. package/lib/components/input-number/html/input-number-thousand.js +4 -17
  29. package/lib/components/input-number/html/input-number.js +3 -5
  30. package/lib/components/input-number/lunatic-input-number.js +2 -3
  31. package/lib/components/lunatic-components.js +2 -11
  32. package/lib/components/radio/html/radio-group-content.js +4 -2
  33. package/lib/components/radio/html/radio-group.js +3 -3
  34. package/lib/components/radio/html/radio-option.js +3 -1
  35. package/lib/components/radio/lunatic-radio-group.js +2 -1
  36. package/lib/components/suggester/find-best-label/find-best-label.js +6 -6
  37. package/lib/components/suggester/idb-suggester/idb-suggester.js +4 -3
  38. package/lib/components/suggester/lunatic-suggester.js +7 -4
  39. package/lib/components/suggester/searching/create-searching.js +20 -39
  40. package/lib/components/switch/html/switch.js +2 -2
  41. package/lib/components/switch/lunatic-switch.js +2 -1
  42. package/lib/components/table/lunatic-table.js +2 -2
  43. package/lib/components/textarea/html/__snapshots__/textarea.spec.tsx.snap +2 -0
  44. package/lib/components/textarea/html/textarea.js +6 -4
  45. package/lib/components/textarea/lunatic-textarea.js +6 -3
  46. package/lib/hooks/use-auto-focus.js +26 -0
  47. package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +1 -1
  48. package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +2 -1
  49. package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +1 -1
  50. package/lib/src/components/checkbox/commons/checkbox-option.d.ts +1 -0
  51. package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +2 -2
  52. package/lib/src/components/commons/components/combo-box/combo-box.d.ts +2 -2
  53. package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +4 -6
  54. package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +1 -0
  55. package/lib/src/components/commons/components/combo-box/selection/input.d.ts +1 -0
  56. package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -1
  57. package/lib/src/components/commons/components/errors/errors.d.ts +6 -3
  58. package/lib/src/components/datepicker/html/datepicker-input.d.ts +2 -1
  59. package/lib/src/components/datepicker/html/datepicker.d.ts +1 -1
  60. package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +1 -1
  61. package/lib/src/components/dropdown/html/dropdown.d.ts +3 -1
  62. package/lib/src/components/input/html/input.d.ts +2 -2
  63. package/lib/src/components/input-number/html/input-number-thousand.d.ts +2 -2
  64. package/lib/src/components/input-number/html/input-number.d.ts +2 -3
  65. package/lib/src/components/radio/html/radio-group-content.d.ts +2 -1
  66. package/lib/src/components/radio/html/radio-group.d.ts +1 -1
  67. package/lib/src/components/radio/html/radio-option.d.ts +1 -0
  68. package/lib/src/components/suggester/find-best-label/find-best-label.d.ts +1 -1
  69. package/lib/src/components/suggester/html/suggester.d.ts +1 -1
  70. package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +5 -2
  71. package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
  72. package/lib/src/components/suggester/searching/create-searching.d.ts +1 -1
  73. package/lib/src/components/switch/html/switch.d.ts +1 -1
  74. package/lib/src/components/textarea/html/textarea.d.ts +3 -2
  75. package/lib/src/components/type.d.ts +4 -3
  76. package/lib/src/hooks/use-auto-focus.d.ts +6 -0
  77. package/lib/src/use-lunatic/actions.d.ts +3 -0
  78. package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +418 -0
  79. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +20 -0
  80. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +1 -0
  81. package/lib/src/use-lunatic/type.d.ts +2 -1
  82. package/lib/src/use-lunatic/use-lunatic.d.ts +8 -5
  83. package/lib/src/use-lunatic/use-suggesters.d.ts +2 -1
  84. package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +1 -1
  85. package/lib/src/utils/suggester-workers/worker-path.d.ts +6 -0
  86. package/lib/stories/behaviour/cleaning/source.json +151 -0
  87. package/lib/stories/behaviour/cleaning/test.stories.js +84 -0
  88. package/lib/stories/{questionnaires-test → behaviour}/controls/controls.stories.js +5 -5
  89. package/lib/stories/{questionnaires-test → behaviour/others}/test.stories.js +7 -7
  90. package/lib/stories/{paste-questionnaire → behaviour/paste}/test.stories.js +3 -3
  91. package/lib/stories/{resizing-questionnaire → behaviour/resizing}/test.stories.js +3 -3
  92. package/lib/use-lunatic/commons/fill-components/fill-component-required.js +23 -0
  93. package/lib/use-lunatic/commons/fill-components/fill-components.js +2 -1
  94. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +2 -0
  95. package/lib/use-lunatic/initial-state.js +2 -1
  96. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +7 -1
  97. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +12 -3
  98. package/lib/use-lunatic/reducer/reduce-on-init.js +4 -2
  99. package/lib/use-lunatic/use-lunatic.js +19 -8
  100. package/lib/use-lunatic/use-lunatic.test.js +34 -2
  101. package/lib/use-lunatic/use-suggesters.js +4 -3
  102. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +4 -3
  103. package/lib/utils/suggester-workers/worker-path.js +29 -0
  104. package/package.json +15 -10
  105. package/scripts/build/add-workers-to-public.js +44 -0
  106. package/scripts/build/workers-paths.js +44 -0
  107. package/workers-release/lunatic-append-worker-0.3.0-experimental.js +2 -0
  108. package/workers-release/lunatic-append-worker-0.3.0-experimental.js.LICENSE.txt +34 -0
  109. package/workers-release/lunatic-label-worker-0.3.0-experimental.js +2 -0
  110. package/workers-release/lunatic-label-worker-0.3.0-experimental.js.LICENSE.txt +13 -0
  111. package/workers-release/lunatic-searching-worker-0.3.0-experimental.js +2 -0
  112. package/workers-release/lunatic-searching-worker-0.3.0-experimental.js.LICENSE.txt +34 -0
  113. package/lib/src/utils/store-tools/worker-path.d.ts +0 -1
  114. package/lib/utils/store-tools/worker-path.js +0 -13
  115. package/lib/utils/suggester-workers/create-worker.js +0 -55
  116. /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +0 -0
  117. /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +0 -0
  118. /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees2_PasPageFin.json +0 -0
  119. /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees_PasPageFin.json +0 -0
  120. /package/lib/stories/{questionnaires-test → behaviour}/controls/boucles-n.json +0 -0
  121. /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.json +0 -0
  122. /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.stories.js +0 -0
  123. /package/lib/stories/{questionnaires-test → behaviour/others}/V2_DeclarationsSimples.json +0 -0
  124. /package/lib/stories/{questionnaires-test → behaviour/others}/V2_MinMaxSum_Boucles.json +0 -0
  125. /package/lib/stories/{questionnaires-test → behaviour/others}/V2_QuestSimple_Boucles.json +0 -0
  126. /package/lib/stories/{questionnaires-test → behaviour/others}/V2_TCMRallyeGames.json +0 -0
  127. /package/lib/stories/{questionnaires-test → behaviour/others}/test-dylan.json +0 -0
  128. /package/lib/stories/{paste-questionnaire → behaviour/paste}/source.json +0 -0
  129. /package/lib/stories/{resizing-questionnaire → behaviour/resizing}/source.json +0 -0
@@ -1,9 +1,9 @@
1
1
  import { type ReactNode } from 'react';
2
- import type { LunaticBaseProps } from '../../../type';
3
2
  import './combo-box.scss';
4
3
  import type { ComboBoxOptionType } from './combo-box.type';
5
4
  import { type PanelProps } from './panel/panel';
6
5
  import { type SelectionProps } from './selection/selection';
6
+ import type { LunaticError } from '../../../../use-lunatic/type';
7
7
  type Props = SelectionProps & PanelProps & {
8
8
  className?: string;
9
9
  classNamePrefix?: string;
@@ -13,7 +13,7 @@ type Props = SelectionProps & PanelProps & {
13
13
  getOptionValue?: (o: ComboBoxOptionType) => string;
14
14
  label?: ReactNode;
15
15
  description?: ReactNode;
16
- errors?: LunaticBaseProps['errors'];
16
+ errors?: LunaticError[];
17
17
  onChange?: (s: string | null) => void;
18
18
  onSelect: (s: string | null) => void;
19
19
  options: ComboBoxOptionType[];
@@ -12,6 +12,7 @@ export declare const Default: Story<{
12
12
  id?: string | undefined;
13
13
  classNamePrefix?: string | undefined;
14
14
  readOnly?: boolean | undefined;
15
+ invalid?: boolean | undefined;
15
16
  } & import("./selection/label-selection").LabelSelectionProps & import("./panel/panel").PanelProps & {
16
17
  className?: string | undefined;
17
18
  classNamePrefix?: string | undefined;
@@ -21,9 +22,7 @@ export declare const Default: Story<{
21
22
  getOptionValue?: ((o: ComboBoxOptionType) => string) | undefined;
22
23
  label?: import("react").ReactNode;
23
24
  description?: import("react").ReactNode;
24
- errors?: {
25
- [id: string]: import("../../../..").LunaticError[];
26
- } | undefined;
25
+ errors?: import("../../../..").LunaticError[] | undefined;
27
26
  onChange?: ((s: string | null) => void) | undefined;
28
27
  onSelect: (s: string | null) => void;
29
28
  options: ComboBoxOptionType[];
@@ -38,6 +37,7 @@ export declare const Editable: Story<{
38
37
  id?: string | undefined;
39
38
  classNamePrefix?: string | undefined;
40
39
  readOnly?: boolean | undefined;
40
+ invalid?: boolean | undefined;
41
41
  } & import("./selection/label-selection").LabelSelectionProps & import("./panel/panel").PanelProps & {
42
42
  className?: string | undefined;
43
43
  classNamePrefix?: string | undefined;
@@ -47,9 +47,7 @@ export declare const Editable: Story<{
47
47
  getOptionValue?: ((o: ComboBoxOptionType) => string) | undefined;
48
48
  label?: import("react").ReactNode;
49
49
  description?: import("react").ReactNode;
50
- errors?: {
51
- [id: string]: import("../../../..").LunaticError[];
52
- } | undefined;
50
+ errors?: import("../../../..").LunaticError[] | undefined;
53
51
  onChange?: ((s: string | null) => void) | undefined;
54
52
  onSelect: (s: string | null) => void;
55
53
  options: ComboBoxOptionType[];
@@ -4,6 +4,7 @@ type LabelOrInputTypeProps = LabelSelectionProps & InputProps & {
4
4
  editable?: boolean;
5
5
  expanded?: boolean;
6
6
  readOnly?: boolean;
7
+ invalid?: boolean;
7
8
  };
8
9
  /**
9
10
  * Display the input or the label of the selection based on the state of the Suggester.
@@ -5,6 +5,7 @@ export type InputProps = {
5
5
  value?: string;
6
6
  labelledBy?: string;
7
7
  focused?: boolean;
8
+ invalid?: boolean;
8
9
  } & HTMLAttributes<HTMLInputElement>;
9
10
  declare const _default: React.ComponentType<Record<string, unknown>>;
10
11
  export default _default;
@@ -8,5 +8,6 @@ export type SelectionProps = {
8
8
  id?: string;
9
9
  classNamePrefix?: string;
10
10
  readOnly?: boolean;
11
+ invalid?: boolean;
11
12
  } & LabelSelectionProps;
12
- export declare function Selection({ labelRenderer, placeholder, search, expanded, disabled, readOnly, focused, onChange, selectedIndex, options, editable, labelId, id, classNamePrefix, }: SelectionProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function Selection({ labelRenderer, placeholder, search, expanded, disabled, readOnly, focused, onChange, selectedIndex, options, editable, labelId, id, classNamePrefix, invalid, }: SelectionProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,11 @@
1
1
  import './errors.scss';
2
2
  import type { LunaticError } from '../../../../use-lunatic/type';
3
3
  type Props = {
4
- errors?: Record<string, LunaticError[]>;
5
- activeId?: string;
4
+ errors?: LunaticError[];
6
5
  };
7
- declare function Errors({ errors, activeId }: Props): import("react/jsx-runtime").JSX.Element | null;
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;
@@ -8,6 +8,7 @@ export type Props = {
8
8
  onChange?: ChangeEventHandler<HTMLInputElement>;
9
9
  min?: string;
10
10
  max?: string;
11
+ invalid?: boolean;
11
12
  };
12
- declare function DatepickerInput({ id, disabled, readOnly, labelId, value, onChange, min, max, }: Props): import("react/jsx-runtime").JSX.Element;
13
+ declare function DatepickerInput({ id, disabled, readOnly, labelId, value, onChange, min, max, invalid, }: Props): import("react/jsx-runtime").JSX.Element;
13
14
  export default DatepickerInput;
@@ -4,7 +4,7 @@ import type { LunaticError } from '../../../use-lunatic/type';
4
4
  type Props = {
5
5
  label?: ReactNode;
6
6
  description?: ReactNode;
7
- errors?: Record<string, LunaticError[]>;
7
+ errors?: LunaticError[];
8
8
  disabled?: boolean;
9
9
  readOnly?: boolean;
10
10
  min?: string;
@@ -9,7 +9,7 @@ type Props = {
9
9
  className?: string;
10
10
  value: string | null;
11
11
  label?: ReactNode;
12
- errors?: Record<string, LunaticError[]>;
12
+ errors?: LunaticError[];
13
13
  description?: ReactNode;
14
14
  readOnly?: boolean;
15
15
  };
@@ -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
- } & Pick<LunaticComponentProps<'Dropdown'>, 'id' | 'disabled' | 'options' | 'writable' | 'value' | 'description' | 'label' | 'errors'>;
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,11 +1,11 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import './input.scss';
3
- import type { LunaticBaseProps } from '../../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: LunaticBaseProps['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, min, max, decimals, }: Props) => import("react/jsx-runtime").JSX.Element;
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?: LunaticBaseProps['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?: Record<string, LunaticError[]>;
16
+ errors?: LunaticError[];
17
17
  className?: string;
18
18
  shortcut?: boolean;
19
19
  disabled?: boolean;
@@ -17,6 +17,7 @@ export type Props = {
17
17
  labelledBy?: string;
18
18
  label?: ReactNode;
19
19
  codeModality?: string;
20
+ invalid?: boolean;
20
21
  };
21
22
  declare const _default: import("react").ComponentType<Props>;
22
23
  export default _default;
@@ -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;
@@ -19,7 +19,7 @@ type Props = {
19
19
  }>;
20
20
  label?: ReactNode;
21
21
  description?: ReactNode;
22
- errors?: Record<string, LunaticError[]>;
22
+ errors?: LunaticError[];
23
23
  };
24
24
  declare const _default: import("react").ComponentType<Props>;
25
25
  export default _default;
@@ -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' | 'errors'> & {
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 {};
@@ -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;
@@ -11,7 +11,7 @@ type Props = {
11
11
  onClick: (v: boolean) => void;
12
12
  id: string;
13
13
  label: ReactNode;
14
- errors?: Record<string, LunaticError[]>;
14
+ errors?: LunaticError[];
15
15
  };
16
16
  declare const _default: import("react").ComponentType<Props>;
17
17
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import './textarea.scss';
3
- import type { LunaticBaseProps } from '../../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?: LunaticBaseProps['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, LunaticExpression, 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, LunaticExpression, 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: number;
63
+ min?: number;
64
64
  max: number;
65
65
  decimals: number;
66
66
  unit?: string;
@@ -237,6 +237,7 @@ type ComponentPropsByType = {
237
237
  };
238
238
  Suggester: LunaticBaseProps<string | null> & {
239
239
  storeName: string;
240
+ workersBasePath?: string;
240
241
  getSuggesterStatus: (name: string) => {
241
242
  status: SuggesterStatus;
242
243
  timestamp: number;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Focus the first focusable element in the wrapper when the "key" changes and is defined
3
+ */
4
+ export declare function useAutoFocus(wrapperRef: {
5
+ current: HTMLDivElement | null;
6
+ }, key?: string): void;
@@ -28,6 +28,7 @@ export type ActionHandleChange = {
28
28
  paginatedLoop?: unknown;
29
29
  shallowIteration?: unknown;
30
30
  lengths?: number[];
31
+ onChange?: LunaticState['handleChange'];
31
32
  };
32
33
  };
33
34
  };
@@ -53,6 +54,7 @@ export type ActionInit = {
53
54
  goNextPage: () => void;
54
55
  goPreviousPage: () => void;
55
56
  withOverview: boolean;
57
+ workersBasePath?: string;
56
58
  };
57
59
  };
58
60
  export type ActionOnSetWaiting = {
@@ -113,6 +115,7 @@ export declare const onInit: (payload: {
113
115
  goNextPage: () => void;
114
116
  goPreviousPage: () => void;
115
117
  withOverview: boolean;
118
+ workersBasePath?: string | undefined;
116
119
  }) => ActionInit & {
117
120
  type: ActionKind.ON_INIT;
118
121
  };