@m4l/components 9.2.52 → 9.2.54-beta.1
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/.storybook/utils/getStylesColorsByMode.d.ts +4 -4
- package/components/Chip/Chip.js +3 -1
- package/components/Chip/types.d.ts +4 -0
- package/components/DataGrid/constants.d.ts +21 -0
- package/components/DataGrid/constants.js +24 -1
- package/components/DataGrid/index.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +3 -2
- package/components/DynamicFilter/types.d.ts +2 -2
- package/components/ObjectLogs/subcomponents/ObjectLogsByOthers/ObjectLogsByOthers.js +1 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +30 -19
- package/components/hook-form/RHFAutocomplete/tests/common.d.ts +37 -0
- package/components/hook-form/RHFAutocomplete/types.d.ts +3 -8
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +32 -5
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +49 -84
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsyncStyles.d.ts +2 -2
- package/components/hook-form/RHFAutocompleteAsync/hooks/useFetchOptions.d.ts +5 -0
- package/components/hook-form/RHFAutocompleteAsync/hooks/useFetchOptions.js +64 -0
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.d.ts +14 -0
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +74 -0
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteSlotsAsync.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/tests/OnChangFilterParmsDefined.test.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/OnChangFilterParmsUndefined.test.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/RHFAutocompleteReducer.test.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/common.d.ts +41 -0
- package/components/hook-form/RHFAutocompleteAsync/types.d.ts +120 -4
- package/components/hook-form/RHFAutocompleteAsync/types.js +44 -0
- package/components/hook-form/RHFTextField/RHFTextField.js +3 -2
- package/components/mui_extended/Autocomplete/Autocomplete.d.ts +7 -0
- package/components/mui_extended/Autocomplete/Autocomplete.js +68 -196
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +27 -16
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.d.ts +14 -0
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +47 -0
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.d.ts +21 -0
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +31 -0
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.d.ts +23 -0
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +135 -0
- package/components/mui_extended/Autocomplete/icons.d.ts +4 -0
- package/components/mui_extended/Autocomplete/icons.js +7 -0
- package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +7 -2
- package/components/mui_extended/Autocomplete/renderOptions/index.js +7 -6
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +6 -7
- package/components/mui_extended/Autocomplete/types.d.ts +2 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +13 -10
- package/index.js +8 -6
- package/mockServiceWorker.js +1 -1
- package/package.json +3 -3
- package/storybook/components/extended/mui/Autocomplete/AutoComple.stories.d.ts +1 -0
- package/storybook/hook-form/RHFAutocomplete/RHFAutocomplete.stories.d.ts +8 -6
- package/storybook/hook-form/RHFAutocomplete/constants.d.ts +23 -0
- package/storybook/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.stories.d.ts +11 -4
- package/storybook/hook-form/RHFAutocompleteAsync/constants.d.ts +10 -1
- package/storybook/hook-form/RHFAutocompleteAsync/handlers.d.ts +1 -0
- package/components/hook-form/RHFAutocomplete/oldTypes.d.ts +0 -43
- /package/components/hook-form/RHFAutocomplete/{RHFAutocomplete.test.d.ts → tests/RHFAutocomplete.test.d.ts} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
2
3
|
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
3
|
-
|
|
4
|
+
const MemoizedMenuItem = memo(MenuItem);
|
|
5
|
+
const renderOption = (optionProps, option) => {
|
|
4
6
|
const { className, ...otherOptionProps } = optionProps;
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
MemoizedMenuItem,
|
|
7
9
|
{
|
|
8
10
|
...otherOptionProps,
|
|
9
11
|
selected: option.selected,
|
|
10
12
|
color: "default",
|
|
11
|
-
key: option.id || option.label,
|
|
12
13
|
label: option.label,
|
|
13
14
|
disabled: option.disabled,
|
|
14
15
|
startIcon: option.startAdornment,
|
|
@@ -16,7 +17,7 @@ function renderOption(optionProps, option) {
|
|
|
16
17
|
size: option.size
|
|
17
18
|
}
|
|
18
19
|
);
|
|
19
|
-
}
|
|
20
|
+
};
|
|
20
21
|
export {
|
|
21
22
|
renderOption as r
|
|
22
23
|
};
|
|
@@ -44,7 +44,7 @@ styled(Typography, {
|
|
|
44
44
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
45
45
|
slot: AutocompleteSlots.typography
|
|
46
46
|
})(autocompleteSyles?.typography);
|
|
47
|
-
|
|
47
|
+
styled(Image, {
|
|
48
48
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
49
49
|
slot: AutocompleteSlots.image
|
|
50
50
|
})(autocompleteSyles?.image);
|
|
@@ -65,13 +65,12 @@ const AdormentsStyled = styled("div", {
|
|
|
65
65
|
slot: AutocompleteSlots.adorments
|
|
66
66
|
})(autocompleteSyles?.adorments);
|
|
67
67
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
AutocompleteRootStyled as A,
|
|
69
|
+
CircularProgressStyled as C,
|
|
70
|
+
IconButtonStyled as I,
|
|
71
71
|
PopperComponentStyled as P,
|
|
72
72
|
RenderInputStyled as R,
|
|
73
73
|
SkeletonAutocompleteStyled as S,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
AutocompleteRootStyled as c
|
|
74
|
+
AdormentsStyled as a,
|
|
75
|
+
ChipStyled as b
|
|
77
76
|
};
|
|
@@ -32,11 +32,13 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined> exte
|
|
|
32
32
|
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
33
33
|
getOptionUrlImage?: (option: T) => string;
|
|
34
34
|
onChange: (event: ChangeEvent<{}> | undefined, value: T | T[] | null, reason: AutocompleteChangeReason) => void;
|
|
35
|
+
htmlFor?: string;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Represents the owner state of the Autocomplete component for styling purposes.
|
|
38
39
|
*/
|
|
39
40
|
export interface AutocompleteOwnerState extends Pick<BaseAutocompleteProps, 'size' | 'variant'> {
|
|
41
|
+
error?: boolean;
|
|
40
42
|
disabled?: boolean;
|
|
41
43
|
multiple?: boolean;
|
|
42
44
|
}
|
|
@@ -27,7 +27,7 @@ const useDynamicFilterAndSort = (props) => {
|
|
|
27
27
|
setCookie,
|
|
28
28
|
getCookie,
|
|
29
29
|
filterSortAutomatic = true,
|
|
30
|
-
visibleRefresh,
|
|
30
|
+
visibleRefresh = false,
|
|
31
31
|
withExternalRefresh
|
|
32
32
|
} = props;
|
|
33
33
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
@@ -91,16 +91,19 @@ const useDynamicFilterAndSort = (props) => {
|
|
|
91
91
|
}
|
|
92
92
|
}, [onChangeFilterSort, prefixCookie, setCookie, setInvisibleBadge, isValidFilters]);
|
|
93
93
|
const onRefresh = useCallback(() => {
|
|
94
|
-
if (
|
|
95
|
-
fireOnChangeFilterRef.current
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
fireOnChangeSortRef.current
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
if (!filterSortAutomatic) {
|
|
95
|
+
if (fireOnChangeFilterRef.current) {
|
|
96
|
+
fireOnChangeFilterRef.current.fireOnChangeFilter();
|
|
97
|
+
}
|
|
98
|
+
if (fireOnChangeSortRef.current) {
|
|
99
|
+
fireOnChangeSortRef.current.fireOnChangeSort();
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
if (isValidFilters()) {
|
|
103
|
+
onChangeFilterSort(eventRefs.current);
|
|
104
|
+
}
|
|
102
105
|
}
|
|
103
|
-
}, [
|
|
106
|
+
}, [filterSortAutomatic, isValidFilters, onChangeFilterSort]);
|
|
104
107
|
const leftActions = useMemo(() => /* @__PURE__ */ jsxs(StackLeftActionsStyled, { direction: "row", ownerState: {}, ...getPropDataTestId(M4LDYNAMIC_KEY_FILTER_AND_SORT, DynamicFilterAndSortSlots.stackLeftActions, dataTestId), children: [
|
|
105
108
|
/* @__PURE__ */ jsx(Badge, { badgeContent: "", size: "small", color: "primary", invisible: invisibleBadge.filter, children: /* @__PURE__ */ jsx(ToggleIconButton, { icon: `${host_static_assets}/${environment_assets}/${ICON_PATH_FILTER}`, isToggled: togglesLeftActions.filter, onToggle: () => handleToggles("filter") }) }),
|
|
106
109
|
/* @__PURE__ */ jsx(Badge, { badgeContent: "", size: "small", color: "primary", invisible: invisibleBadge.sort, children: /* @__PURE__ */ jsx(ToggleIconButton, { icon: `${host_static_assets}/${environment_assets}/${ICON_PATH_SORT}`, isToggled: togglesLeftActions.sort, onToggle: () => handleToggles("sort") }) })
|
package/index.js
CHANGED
|
@@ -34,6 +34,7 @@ import { D as D2 } from "./components/DataGrid/DataGrid.js";
|
|
|
34
34
|
import { g as g5 } from "./components/DataGrid/dictionary.js";
|
|
35
35
|
import { N, T as T2 } from "./components/DataGrid/subcomponents/editors/TextEditor/index.js";
|
|
36
36
|
import { g as g6 } from "./components/DataGrid/utils/getDataGridRowsFromSet.js";
|
|
37
|
+
import { c as c2 } from "./components/DataGrid/constants.js";
|
|
37
38
|
import { C as C2 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/formatter.js";
|
|
38
39
|
import { u as u3 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.js";
|
|
39
40
|
import { C as C3 } from "./components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.js";
|
|
@@ -120,7 +121,7 @@ import { D as D8 } from "./components/formatters/DistanceToNowFormatter/Distance
|
|
|
120
121
|
import { g as g18 } from "./components/formatters/dictionary.js";
|
|
121
122
|
import { G } from "./components/GridLayout/GridLayout.js";
|
|
122
123
|
import { R as R3 } from "./components/GridLayout/subcomponents/Responsive/index.js";
|
|
123
|
-
import { c as
|
|
124
|
+
import { c as c3, d as d3, e } from "./components/GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
124
125
|
import { i, k } from "./components/GridLayout/utils.js";
|
|
125
126
|
import { w } from "./components/GridLayout/subcomponents/withSizeProvider/index.js";
|
|
126
127
|
import { H as H2 } from "./components/HelmetPage/index.js";
|
|
@@ -179,7 +180,7 @@ import { W } from "./components/WindowBase/WindowBase.js";
|
|
|
179
180
|
import { u as u15 } from "./components/WindowBase/hooks/useWindowToolsMF/index.js";
|
|
180
181
|
import { a as a9, u as u16 } from "./components/WindowBase/hooks/useDynamicMFParameters/index.js";
|
|
181
182
|
import { M as M6, W as W2, a as a10 } from "./components/WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js";
|
|
182
|
-
import { c as
|
|
183
|
+
import { c as c4 } from "./components/WindowBase/contexts/DynamicMFParmsContext/store.js";
|
|
183
184
|
import { D as D9, a as a11, M as M7 } from "./components/WindowBase/contexts/DynamicMFParmsContext/DynamicMFParmsContext.js";
|
|
184
185
|
import { W as W3 } from "./components/WindowConfirm/WindowConfirm.js";
|
|
185
186
|
import { a as a12, g as g27 } from "./components/ModalDialog/dictionary.js";
|
|
@@ -203,7 +204,7 @@ import { u as u27 } from "./hooks/useSvgColor/useSvgColor.js";
|
|
|
203
204
|
import { u as u28 } from "./hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js";
|
|
204
205
|
import { u as u29 } from "./hooks/useDataGridPersistence/useDataGridPersistence.js";
|
|
205
206
|
import { u as u30 } from "./hooks/usePopoverContainer/usePopoverContainer.js";
|
|
206
|
-
import { c as
|
|
207
|
+
import { c as c5 } from "./utils/capitalizeFirstLetter.js";
|
|
207
208
|
import { i as i2 } from "./utils/isValidDate.js";
|
|
208
209
|
import { g as g30 } from "./utils/getComponentUtilityClass.js";
|
|
209
210
|
import { g as g31 } from "./utils/getPaletteColor.js";
|
|
@@ -256,6 +257,7 @@ export {
|
|
|
256
257
|
C10 as ColumnSetCheckFormatter,
|
|
257
258
|
C11 as ColumnUncertaintyFormatter,
|
|
258
259
|
C15 as ConcatenatedFormatter,
|
|
260
|
+
c2 as DATAGRID_SEMANTIC_WIDTHS,
|
|
259
261
|
D as DICTIONARY,
|
|
260
262
|
D2 as DataGrid,
|
|
261
263
|
D7 as DateFormatter,
|
|
@@ -374,11 +376,11 @@ export {
|
|
|
374
376
|
W3 as WindowConfirm,
|
|
375
377
|
W2 as WindowToolsMFContext,
|
|
376
378
|
a10 as WindowToolsMFProvider,
|
|
377
|
-
|
|
379
|
+
c3 as addLayoutItemToBreakPointIfNoExists,
|
|
378
380
|
d3 as addLayoutItemToBreakPoints,
|
|
379
|
-
|
|
381
|
+
c5 as capitalizeFirstLetter,
|
|
380
382
|
e as cloneLayouts,
|
|
381
|
-
|
|
383
|
+
c4 as createDynamicMFStore,
|
|
382
384
|
c as createToaster,
|
|
383
385
|
d as defaultCommonActionsDictionary,
|
|
384
386
|
d2 as dragResizeWindowRNDClasses,
|
package/mockServiceWorker.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Please do NOT serve this file on production.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const PACKAGE_VERSION = '2.
|
|
11
|
+
const PACKAGE_VERSION = '2.8.2'
|
|
12
12
|
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
|
|
13
13
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
14
14
|
const activeClientIds = new Set()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.54-beta.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "M4L Components",
|
|
6
6
|
"lint-staged": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"@googlemaps/js-api-loader": "^1.16.6",
|
|
12
12
|
"@hookform/resolvers": "^2.9.5",
|
|
13
13
|
"@m4l/core": "^2.0.0",
|
|
14
|
-
"@m4l/graphics": "
|
|
15
|
-
"@m4l/styles": "
|
|
14
|
+
"@m4l/graphics": "7.1.2-beta.1",
|
|
15
|
+
"@m4l/styles": "7.1.29-beta.1",
|
|
16
16
|
"@microlink/react-json-view": "^1.23.3",
|
|
17
17
|
"@mui/lab": "5.0.0-alpha.173",
|
|
18
18
|
"@mui/material": "5.16.7",
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { RHFAutocompleteProps } from '../../../src/components/hook-form/RHFAutocomplete/types';
|
|
3
|
-
|
|
4
|
-
id: number;
|
|
5
|
-
label: string;
|
|
6
|
-
imageUrl?: string;
|
|
7
|
-
};
|
|
3
|
+
import { OptionType } from './constants';
|
|
8
4
|
declare const meta: Meta<RHFAutocompleteProps<OptionType>>;
|
|
9
5
|
export default meta;
|
|
10
6
|
type Story = StoryObj<RHFAutocompleteProps<OptionType>>;
|
|
11
7
|
export declare const Default: Story;
|
|
12
|
-
export declare const
|
|
8
|
+
export declare const InitialNull: Story;
|
|
9
|
+
/**
|
|
10
|
+
* Preselected Option With not Options
|
|
11
|
+
*/
|
|
12
|
+
export declare const PreselectedOptionNotOptions: Story;
|
|
13
|
+
export declare const Multiple: Story;
|
|
14
|
+
export declare const MultiplePreselected: Story;
|
|
13
15
|
export declare const WithImages: Story;
|
|
14
16
|
export declare const LoadingState: Story;
|
|
15
17
|
export declare const Disabled: Story;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const FIELD_NAME_INITIAL_NULL = "rhf-autocomplete-initial-null";
|
|
2
|
+
export declare const FIELD_NAME_REQUIRED = "rhf-autocomplete";
|
|
3
|
+
export declare const FIELD_NAME_PRESELECTED = "rhf-autocomplete-preselected";
|
|
4
|
+
export declare const FIELD_NAME_PRESELECTED_NOT_IN_OPTIONS = "rhf-autocomplete-preselected-not-in-options";
|
|
5
|
+
export declare const FIELD_NAME_PRESELECTED_MULTIPLE = "rhf-autocomplete-preselected-multiple";
|
|
6
|
+
export declare const FIELD_NAME_PRESELECTED_MULTIPLE_NOT_IN_OPTIONS = "rhf-autocomplete-preselected-multiple-not-in-options";
|
|
7
|
+
export type OptionType = {
|
|
8
|
+
id: number;
|
|
9
|
+
label: string;
|
|
10
|
+
imageUrl?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const RHFAUTOCOMPLETE_OPTIONS_MOCK: OptionType[];
|
|
13
|
+
export declare const RHFAUTOCOMPLETE_OPTIONS_WITH_IMAGES_MOCK: OptionType[];
|
|
14
|
+
export declare const VALIDATION_SCHEMA: import('yup/lib/object').OptionalObjectSchema<{
|
|
15
|
+
"rhf-autocomplete": import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
16
|
+
}, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<{
|
|
17
|
+
"rhf-autocomplete": import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
18
|
+
}>>;
|
|
19
|
+
export declare const INITIAL_VALUES: {
|
|
20
|
+
"rhf-autocomplete-initial-null": null;
|
|
21
|
+
"rhf-autocomplete-preselected": OptionType;
|
|
22
|
+
"rhf-autocomplete-preselected-multiple": OptionType[];
|
|
23
|
+
};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { RHFAutocompleteAsyncProps } from '../../../src/components/hook-form/RHFAutocompleteAsync/types';
|
|
3
3
|
type OptionType = {
|
|
4
4
|
id: number;
|
|
5
5
|
name: string;
|
|
6
6
|
};
|
|
7
|
-
declare const meta: Meta<
|
|
7
|
+
declare const meta: Meta<RHFAutocompleteAsyncProps<OptionType>>;
|
|
8
8
|
export default meta;
|
|
9
|
-
type Story = StoryObj<
|
|
9
|
+
type Story = StoryObj<RHFAutocompleteAsyncProps<OptionType>>;
|
|
10
10
|
export declare const Default: Story;
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const PreselectedOption: Story;
|
|
12
|
+
/**
|
|
13
|
+
* Preselected Option Not Loaded In Options when combo open
|
|
14
|
+
*/
|
|
15
|
+
export declare const PreselectedOptionNotLoadedInOptions: Story;
|
|
16
|
+
export declare const Multiple: Story;
|
|
17
|
+
export declare const MultiplePreselected: Story;
|
|
18
|
+
export declare const MultiplePreselectedNotLoadedInOptions: Story;
|
|
12
19
|
export declare const WithCustomFiltering: Story;
|
|
13
20
|
export declare const LoadingState: Story;
|
|
14
21
|
export declare const Disabled: Story;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
export declare const FIELD_NAME_REQUIRED = "rhf-autocomplete-async";
|
|
2
|
+
export declare const FIELD_NAME_PRESELECTED = "rhf-autocomplete-async-preselected";
|
|
3
|
+
export declare const FIELD_NAME_PRESELECTED_NOT_IN_OPTIONS = "rhf-autocomplete-async-preselected-not-in-options";
|
|
4
|
+
export declare const FIELD_NAME_PRESELECTED_MULTIPLE = "rhf-autocomplete-async-preselected-multiple";
|
|
5
|
+
export declare const FIELD_NAME_PRESELECTED_MULTIPLE_NOT_IN_OPTIONS = "rhf-autocomplete-async-preselected-multiple-not-in-options";
|
|
1
6
|
export declare const RHFAUTOCOMPLETEASYNC_MSW_MOCK: {
|
|
2
7
|
id: number;
|
|
3
8
|
name: string;
|
|
4
9
|
}[];
|
|
5
|
-
export declare const
|
|
10
|
+
export declare const VALIDATION_SCHEMA: import('yup/lib/object').OptionalObjectSchema<{
|
|
11
|
+
"rhf-autocomplete-async": import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
12
|
+
}, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<{
|
|
13
|
+
"rhf-autocomplete-async": import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
14
|
+
}>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MSW_HANDLERS: import('msw').HttpHandler[];
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AutocompleteCloseReason, AutocompleteInputChangeReason, TextFieldProps } from '@mui/material';
|
|
2
|
-
import { LabelProps } from '../../Label/types';
|
|
3
|
-
export type GetOptionString<T> = (option: T | null) => string;
|
|
4
|
-
export type RHFAutocompleteVariants = 'info' | 'success' | 'warning';
|
|
5
|
-
export type ImageProps<T> = (RHFAutocompleteTypeImageProps<T> & {
|
|
6
|
-
imageScale?: boolean;
|
|
7
|
-
imageRepeat?: never;
|
|
8
|
-
}) | (RHFAutocompleteTypeImageProps<T> & {
|
|
9
|
-
imageRepeat: boolean;
|
|
10
|
-
imageScale?: never;
|
|
11
|
-
});
|
|
12
|
-
export interface RHFAutocompleteBaseProps<T> extends Omit<TextFieldProps, 'label' | 'variant' | 'helperText'>, Omit<LabelProps, 'label'> {
|
|
13
|
-
name: string;
|
|
14
|
-
options: Array<T>;
|
|
15
|
-
getOptionLabel: (option: T) => string;
|
|
16
|
-
isOptionEqualToValue: (option: T, value: T) => boolean;
|
|
17
|
-
skeletonWidth?: string | number;
|
|
18
|
-
skeletonHeight?: string | number;
|
|
19
|
-
loading?: boolean;
|
|
20
|
-
refresh?: () => void;
|
|
21
|
-
label?: string;
|
|
22
|
-
variant?: RHFAutocompleteVariants;
|
|
23
|
-
helperMessage?: string;
|
|
24
|
-
onOpen?: (event: React.SyntheticEvent) => void;
|
|
25
|
-
onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason) => void;
|
|
26
|
-
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
27
|
-
multiple?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface RHFAutocompleteTypeTextProps {
|
|
30
|
-
type: 'text';
|
|
31
|
-
}
|
|
32
|
-
export interface RHFAutocompleteTypeImageProps<T> {
|
|
33
|
-
type: 'image';
|
|
34
|
-
getOptionUrlImage: (option: T) => string;
|
|
35
|
-
}
|
|
36
|
-
export type RHFAutocompleteProps<T> = (RHFAutocompleteBaseProps<T> & ImageProps<T>) | (RHFAutocompleteBaseProps<T> & RHFAutocompleteTypeTextProps);
|
|
37
|
-
export interface OwnerState extends Pick<RHFAutocompleteProps<any>, 'size' | 'disabled'>, Pick<ImageProps<any>, 'imageScale' | 'imageRepeat'> {
|
|
38
|
-
isFocus: boolean;
|
|
39
|
-
isTabSelected: boolean;
|
|
40
|
-
semantics: RHFAutocompleteVariants | 'error' | null;
|
|
41
|
-
variant?: 'withImage';
|
|
42
|
-
multiple: boolean;
|
|
43
|
-
}
|
|
File without changes
|