@availity/mui-autocomplete 1.2.4 → 1.2.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.2.5](https://github.com/Availity/element/compare/@availity/mui-autocomplete@1.2.4...@availity/mui-autocomplete@1.2.5) (2025-07-17)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **mui-autocomplete:** fix the multiple prop type for async autocompletes ([3b904a4](https://github.com/Availity/element/commit/3b904a4f88b250433d75ff4a439aab10adc238e9))
11
+
5
12
  ## [1.2.4](https://github.com/Availity/element/compare/@availity/mui-autocomplete@1.2.3...@availity/mui-autocomplete@1.2.4) (2025-06-18)
6
13
 
7
14
 
package/dist/index.d.mts CHANGED
@@ -56,7 +56,7 @@ interface CodesAutocompleteProps<Option = Code, Multiple extends boolean | undef
56
56
  apiConfig?: ApiConfig;
57
57
  }
58
58
  declare const handleGetCodesOptionLabel: (option: Code) => string;
59
- declare const CodesAutocomplete: ({ apiConfig, queryOptions, queryKey, list, watchParams, ...rest }: CodesAutocompleteProps) => react_jsx_runtime.JSX.Element;
59
+ declare const CodesAutocomplete: <Option = Code, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">({ apiConfig, queryOptions, queryKey, list, watchParams, ...rest }: CodesAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react_jsx_runtime.JSX.Element;
60
60
 
61
61
  type Organization = {
62
62
  customerId: string;
@@ -75,7 +75,7 @@ interface OrgAutocompleteProps<Option = Organization, Multiple extends boolean |
75
75
  apiConfig?: ApiConfig;
76
76
  }
77
77
  declare const handleGetOrgOptionLabel: (org: Organization) => string;
78
- declare const OrganizationAutocomplete: ({ apiConfig, queryKey, ...rest }: OrgAutocompleteProps) => react_jsx_runtime.JSX.Element;
78
+ declare const OrganizationAutocomplete: <Option = Organization, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">({ apiConfig, queryKey, ...rest }: OrgAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react_jsx_runtime.JSX.Element;
79
79
 
80
80
  type Provider = {
81
81
  id: string;
@@ -134,6 +134,6 @@ interface ProviderAutocompleteProps<Option = Provider, Multiple extends boolean
134
134
  apiConfig?: ApiConfig;
135
135
  }
136
136
  declare const handleGetProviderOptionLabel: (option: Provider) => string;
137
- declare const ProviderAutocomplete: ({ apiConfig, customerId, queryKey, ...rest }: ProviderAutocompleteProps) => react_jsx_runtime.JSX.Element;
137
+ declare const ProviderAutocomplete: <Option = Provider, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">({ apiConfig, customerId, queryKey, ...rest }: ProviderAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react_jsx_runtime.JSX.Element;
138
138
 
139
139
  export { AsyncAutocomplete, type AsyncAutocompleteProps, Autocomplete, type AutocompleteProps, type Code, CodesAutocomplete, type CodesAutocompleteProps, type OrgAutocompleteProps, type Organization, OrganizationAutocomplete, type Provider, ProviderAutocomplete, type ProviderAutocompleteProps, fetchCodes, fetchOrgs, fetchProviders, handleGetCodesOptionLabel, handleGetOrgOptionLabel, handleGetProviderOptionLabel };
package/dist/index.d.ts CHANGED
@@ -56,7 +56,7 @@ interface CodesAutocompleteProps<Option = Code, Multiple extends boolean | undef
56
56
  apiConfig?: ApiConfig;
57
57
  }
58
58
  declare const handleGetCodesOptionLabel: (option: Code) => string;
59
- declare const CodesAutocomplete: ({ apiConfig, queryOptions, queryKey, list, watchParams, ...rest }: CodesAutocompleteProps) => react_jsx_runtime.JSX.Element;
59
+ declare const CodesAutocomplete: <Option = Code, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">({ apiConfig, queryOptions, queryKey, list, watchParams, ...rest }: CodesAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react_jsx_runtime.JSX.Element;
60
60
 
61
61
  type Organization = {
62
62
  customerId: string;
@@ -75,7 +75,7 @@ interface OrgAutocompleteProps<Option = Organization, Multiple extends boolean |
75
75
  apiConfig?: ApiConfig;
76
76
  }
77
77
  declare const handleGetOrgOptionLabel: (org: Organization) => string;
78
- declare const OrganizationAutocomplete: ({ apiConfig, queryKey, ...rest }: OrgAutocompleteProps) => react_jsx_runtime.JSX.Element;
78
+ declare const OrganizationAutocomplete: <Option = Organization, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">({ apiConfig, queryKey, ...rest }: OrgAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react_jsx_runtime.JSX.Element;
79
79
 
80
80
  type Provider = {
81
81
  id: string;
@@ -134,6 +134,6 @@ interface ProviderAutocompleteProps<Option = Provider, Multiple extends boolean
134
134
  apiConfig?: ApiConfig;
135
135
  }
136
136
  declare const handleGetProviderOptionLabel: (option: Provider) => string;
137
- declare const ProviderAutocomplete: ({ apiConfig, customerId, queryKey, ...rest }: ProviderAutocompleteProps) => react_jsx_runtime.JSX.Element;
137
+ declare const ProviderAutocomplete: <Option = Provider, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">({ apiConfig, customerId, queryKey, ...rest }: ProviderAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react_jsx_runtime.JSX.Element;
138
138
 
139
139
  export { AsyncAutocomplete, type AsyncAutocompleteProps, Autocomplete, type AutocompleteProps, type Code, CodesAutocomplete, type CodesAutocompleteProps, type OrgAutocompleteProps, type Organization, OrganizationAutocomplete, type Provider, ProviderAutocomplete, type ProviderAutocompleteProps, fetchCodes, fetchOrgs, fetchProviders, handleGetCodesOptionLabel, handleGetOrgOptionLabel, handleGetProviderOptionLabel };
package/dist/index.js CHANGED
@@ -264,7 +264,9 @@ var CodesAutocomplete = (_a) => {
264
264
  const resp = yield fetchCodes(__spreadProps(__spreadValues({}, apiConfig), {
265
265
  params: __spreadProps(__spreadValues({}, apiConfig.params), { list, offset, limit, q: inputValue })
266
266
  }));
267
- return resp;
267
+ return __spreadProps(__spreadValues({}, resp), {
268
+ options: resp.options
269
+ });
268
270
  });
269
271
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
270
272
  AsyncAutocomplete,
@@ -307,7 +309,9 @@ var OrganizationAutocomplete = (_a) => {
307
309
  ]);
308
310
  const handleLoadOptions = (offset, limit) => __async(void 0, null, function* () {
309
311
  const resp = yield fetchOrgs(__spreadProps(__spreadValues({}, apiConfig), { params: __spreadProps(__spreadValues({ dropdown: true }, apiConfig.params), { offset, limit }) }));
310
- return resp;
312
+ return __spreadProps(__spreadValues({}, resp), {
313
+ options: resp.options
314
+ });
311
315
  });
312
316
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
313
317
  AsyncAutocomplete,
@@ -346,7 +350,9 @@ var ProviderAutocomplete = (_a) => {
346
350
  const resp = yield fetchProviders(customerId, __spreadProps(__spreadValues({}, apiConfig), {
347
351
  params: __spreadProps(__spreadValues({}, apiConfig.params), { offset, limit, q: inputValue })
348
352
  }));
349
- return resp;
353
+ return __spreadProps(__spreadValues({}, resp), {
354
+ options: resp.options
355
+ });
350
356
  });
351
357
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
352
358
  AsyncAutocomplete,
package/dist/index.mjs CHANGED
@@ -222,7 +222,9 @@ var CodesAutocomplete = (_a) => {
222
222
  const resp = yield fetchCodes(__spreadProps(__spreadValues({}, apiConfig), {
223
223
  params: __spreadProps(__spreadValues({}, apiConfig.params), { list, offset, limit, q: inputValue })
224
224
  }));
225
- return resp;
225
+ return __spreadProps(__spreadValues({}, resp), {
226
+ options: resp.options
227
+ });
226
228
  });
227
229
  return /* @__PURE__ */ jsx3(
228
230
  AsyncAutocomplete,
@@ -265,7 +267,9 @@ var OrganizationAutocomplete = (_a) => {
265
267
  ]);
266
268
  const handleLoadOptions = (offset, limit) => __async(void 0, null, function* () {
267
269
  const resp = yield fetchOrgs(__spreadProps(__spreadValues({}, apiConfig), { params: __spreadProps(__spreadValues({ dropdown: true }, apiConfig.params), { offset, limit }) }));
268
- return resp;
270
+ return __spreadProps(__spreadValues({}, resp), {
271
+ options: resp.options
272
+ });
269
273
  });
270
274
  return /* @__PURE__ */ jsx4(
271
275
  AsyncAutocomplete,
@@ -304,7 +308,9 @@ var ProviderAutocomplete = (_a) => {
304
308
  const resp = yield fetchProviders(customerId, __spreadProps(__spreadValues({}, apiConfig), {
305
309
  params: __spreadProps(__spreadValues({}, apiConfig.params), { offset, limit, q: inputValue })
306
310
  }));
307
- return resp;
311
+ return __spreadProps(__spreadValues({}, resp), {
312
+ options: resp.options
313
+ });
308
314
  });
309
315
  return /* @__PURE__ */ jsx5(
310
316
  AsyncAutocomplete,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-autocomplete",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Availity MUI Autocomplete Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -12,13 +12,6 @@ const meta: Meta<typeof AsyncAutocomplete> = {
12
12
  args: {
13
13
  id: 'example',
14
14
  },
15
- argTypes: {
16
- multiple: {
17
- table: {
18
- disable: true,
19
- },
20
- },
21
- },
22
15
  };
23
16
 
24
17
  export default meta;
@@ -11,13 +11,6 @@ const meta: Meta<typeof CodesAutocomplete> = {
11
11
  args: {
12
12
  id: 'example',
13
13
  },
14
- argTypes: {
15
- multiple: {
16
- table: {
17
- disable: true,
18
- },
19
- },
20
- },
21
14
  };
22
15
 
23
16
  export default meta;
@@ -37,26 +37,35 @@ export interface CodesAutocompleteProps<
37
37
 
38
38
  export const handleGetCodesOptionLabel = (option: Code) => [option.code, option.value].filter(Boolean).join(' - ');
39
39
 
40
- export const CodesAutocomplete = ({
40
+ export const CodesAutocomplete = <
41
+ Option = Code,
42
+ Multiple extends boolean | undefined = false,
43
+ DisableClearable extends boolean | undefined = false,
44
+ FreeSolo extends boolean | undefined = false,
45
+ ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent'],
46
+ >({
41
47
  apiConfig = {},
42
48
  queryOptions,
43
49
  queryKey = 'codes-autocomplete',
44
50
  list,
45
51
  watchParams,
46
52
  ...rest
47
- }: CodesAutocompleteProps) => {
53
+ }: CodesAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => {
48
54
  const handleLoadOptions = async (offset: number, limit: number, inputValue: string) => {
49
55
  const resp = await fetchCodes({
50
56
  ...apiConfig,
51
57
  params: { ...apiConfig.params, list, offset, limit, q: inputValue },
52
58
  });
53
59
 
54
- return resp;
60
+ return {
61
+ ...resp,
62
+ options: resp.options as Option[],
63
+ };
55
64
  };
56
65
 
57
66
  return (
58
67
  <AsyncAutocomplete
59
- getOptionLabel={handleGetCodesOptionLabel}
68
+ getOptionLabel={handleGetCodesOptionLabel as (option: Option) => string}
60
69
  queryKey={queryKey}
61
70
  queryOptions={{ enabled: !!list, ...queryOptions }}
62
71
  watchParams={{ list, ...watchParams }}
@@ -11,13 +11,6 @@ const meta: Meta<typeof OrganizationAutocomplete> = {
11
11
  args: {
12
12
  id: 'example',
13
13
  },
14
- argTypes: {
15
- multiple: {
16
- table: {
17
- disable: true,
18
- },
19
- },
20
- },
21
14
  };
22
15
 
23
16
  export default meta;
@@ -49,20 +49,29 @@ export interface OrgAutocompleteProps<
49
49
 
50
50
  export const handleGetOrgOptionLabel = (org: Organization) => org.name;
51
51
 
52
- export const OrganizationAutocomplete = ({
52
+ export const OrganizationAutocomplete = <
53
+ Option = Organization,
54
+ Multiple extends boolean | undefined = false,
55
+ DisableClearable extends boolean | undefined = false,
56
+ FreeSolo extends boolean | undefined = false,
57
+ ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent'],
58
+ >({
53
59
  apiConfig = {},
54
60
  queryKey = 'org-autocomplete',
55
61
  ...rest
56
- }: OrgAutocompleteProps) => {
62
+ }: OrgAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => {
57
63
  const handleLoadOptions = async (offset: number, limit: number) => {
58
64
  const resp = await fetchOrgs({ ...apiConfig, params: { dropdown: true, ...apiConfig.params, offset, limit } });
59
65
 
60
- return resp;
66
+ return {
67
+ ...resp,
68
+ options: resp.options as Option[],
69
+ };
61
70
  };
62
71
 
63
72
  return (
64
73
  <AsyncAutocomplete
65
- getOptionLabel={handleGetOrgOptionLabel}
74
+ getOptionLabel={handleGetOrgOptionLabel as (option: Option) => string}
66
75
  queryKey={queryKey}
67
76
  {...rest}
68
77
  loadOptions={handleLoadOptions}
@@ -11,13 +11,6 @@ const meta: Meta<typeof ProviderAutocomplete> = {
11
11
  args: {
12
12
  id: 'example',
13
13
  },
14
- argTypes: {
15
- multiple: {
16
- table: {
17
- disable: true,
18
- },
19
- },
20
- },
21
14
  };
22
15
 
23
16
  export default meta;
@@ -64,24 +64,33 @@ export interface ProviderAutocompleteProps<
64
64
 
65
65
  export const handleGetProviderOptionLabel = (option: Provider) => option.uiDisplayName;
66
66
 
67
- export const ProviderAutocomplete = ({
67
+ export const ProviderAutocomplete = <
68
+ Option = Provider,
69
+ Multiple extends boolean | undefined = false,
70
+ DisableClearable extends boolean | undefined = false,
71
+ FreeSolo extends boolean | undefined = false,
72
+ ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent'],
73
+ >({
68
74
  apiConfig = {},
69
75
  customerId,
70
76
  queryKey = 'prov-autocomplete',
71
77
  ...rest
72
- }: ProviderAutocompleteProps) => {
78
+ }: ProviderAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>) => {
73
79
  const handleLoadOptions = async (offset: number, limit: number, inputValue: string) => {
74
80
  const resp = await fetchProviders(customerId, {
75
81
  ...apiConfig,
76
82
  params: { ...apiConfig.params, offset, limit, q: inputValue },
77
83
  });
78
84
 
79
- return resp;
85
+ return {
86
+ ...resp,
87
+ options: resp.options as Option[],
88
+ };
80
89
  };
81
90
 
82
91
  return (
83
92
  <AsyncAutocomplete
84
- getOptionLabel={handleGetProviderOptionLabel}
93
+ getOptionLabel={handleGetProviderOptionLabel as (option: Option) => string}
85
94
  queryOptions={{ enabled: !!customerId }}
86
95
  queryKey={queryKey}
87
96
  watchParams={{ customerId }}