@availity/mui-autocomplete 2.2.7 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,157 +1,64 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __getProtoOf = Object.getPrototypeOf;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
- var __export = (target, all) => {
38
- for (var name in all)
39
- __defProp(target, name, { get: all[name], enumerable: true });
40
- };
41
- var __copyProps = (to, from, except, desc) => {
42
- if (from && typeof from === "object" || typeof from === "function") {
43
- for (let key of __getOwnPropNames(from))
44
- if (!__hasOwnProp.call(to, key) && key !== except)
45
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
- }
47
- return to;
48
- };
49
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
- // If the importer is in node compatibility mode or this is not an ESM
51
- // file that has been converted to a CommonJS file using a Babel-
52
- // compatible transform (i.e. "__esModule" has not been set), then set
53
- // "default" to the CommonJS "module.exports" for node compatibility.
54
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
- mod
56
- ));
57
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
- var __async = (__this, __arguments, generator) => {
59
- return new Promise((resolve, reject) => {
60
- var fulfilled = (value) => {
61
- try {
62
- step(generator.next(value));
63
- } catch (e) {
64
- reject(e);
65
- }
66
- };
67
- var rejected = (value) => {
68
- try {
69
- step(generator.throw(value));
70
- } catch (e) {
71
- reject(e);
72
- }
73
- };
74
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
75
- step((generator = generator.apply(__this, __arguments)).next());
76
- });
77
- };
78
-
79
- // src/index.ts
80
- var index_exports = {};
81
- __export(index_exports, {
82
- AsyncAutocomplete: () => AsyncAutocomplete,
83
- Autocomplete: () => Autocomplete,
84
- CodesAutocomplete: () => CodesAutocomplete,
85
- OrganizationAutocomplete: () => OrganizationAutocomplete,
86
- ProviderAutocomplete: () => ProviderAutocomplete,
87
- createFilterOptions: () => import_Autocomplete2.createFilterOptions,
88
- fetchCodes: () => fetchCodes,
89
- fetchOrgs: () => fetchOrgs,
90
- fetchProviders: () => fetchProviders,
91
- handleGetCodesOptionLabel: () => handleGetCodesOptionLabel,
92
- handleGetOrgOptionLabel: () => handleGetOrgOptionLabel,
93
- handleGetProviderOptionLabel: () => handleGetProviderOptionLabel
94
- });
95
- module.exports = __toCommonJS(index_exports);
96
-
97
1
  // src/lib/Autocomplete.tsx
98
- var import_react = require("react");
99
- var import_Autocomplete = __toESM(require("@mui/material/Autocomplete"));
100
- var import_CircularProgress = __toESM(require("@mui/material/CircularProgress"));
101
- var import_IconButton = __toESM(require("@mui/material/IconButton"));
102
- var import_mui_textfield = require("@availity/mui-textfield");
103
- var import_mui_form_utils = require("@availity/mui-form-utils");
104
- var import_Autocomplete2 = require("@mui/material/Autocomplete");
105
- var import_jsx_runtime = require("react/jsx-runtime");
106
- var PopupIndicatorWrapper = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
107
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_form_utils.SelectDivider, { orientation: "vertical", className: "MuiSelect-avEndAdornmentDivider" }),
108
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_IconButton.default, __spreadProps(__spreadValues({}, props), { ref }))
2
+ import { forwardRef } from "react";
3
+ import {
4
+ default as MuiAutocomplete
5
+ } from "@mui/material/Autocomplete";
6
+ import CircularProgress from "@mui/material/CircularProgress";
7
+ import { default as MuiIconButton } from "@mui/material/IconButton";
8
+ import { TextField } from "@availity/mui-textfield";
9
+ import { SelectDivider, SelectExpandIcon } from "@availity/mui-form-utils";
10
+ import { createFilterOptions } from "@mui/material/Autocomplete";
11
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
+ var PopupIndicatorWrapper = forwardRef((props, ref) => /* @__PURE__ */ jsxs(Fragment, { children: [
13
+ /* @__PURE__ */ jsx(SelectDivider, { orientation: "vertical", className: "MuiSelect-avEndAdornmentDivider" }),
14
+ /* @__PURE__ */ jsx(MuiIconButton, { ...props, ref })
109
15
  ] }));
110
16
  var progressSx = { marginRight: ".5rem" };
111
- var LoadingIndicator = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CircularProgress.default, { "aria-label": "Loading", size: 20, sx: progressSx });
112
- var Autocomplete = (_a) => {
113
- var _b = _a, {
114
- FieldProps
115
- } = _b, props = __objRest(_b, [
116
- "FieldProps"
117
- ]);
17
+ var LoadingIndicator = () => /* @__PURE__ */ jsx(CircularProgress, { "aria-label": "Loading", size: 20, sx: progressSx });
18
+ var Autocomplete = ({
19
+ FieldProps,
20
+ ...props
21
+ }) => {
118
22
  const defaultProps = {
119
23
  fullWidth: true,
120
24
  size: "small"
121
25
  };
122
26
  const resolvedProps = (params) => ({
123
- InputProps: __spreadProps(__spreadValues(__spreadValues({}, params == null ? void 0 : params.InputProps), FieldProps == null ? void 0 : FieldProps.InputProps), {
124
- endAdornment: props.loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
125
- (params == null ? void 0 : params.InputProps.endAdornment) || null,
126
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingIndicator, {})
127
- ] }) : (params == null ? void 0 : params.InputProps.endAdornment) || null
128
- }),
129
- inputProps: __spreadProps(__spreadValues({}, params == null ? void 0 : params.inputProps), {
27
+ InputProps: {
28
+ ...params?.InputProps,
29
+ ...FieldProps?.InputProps,
30
+ endAdornment: props.loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
31
+ params?.InputProps.endAdornment || null,
32
+ /* @__PURE__ */ jsx(LoadingIndicator, {})
33
+ ] }) : params?.InputProps.endAdornment || null
34
+ },
35
+ inputProps: {
36
+ ...params?.inputProps,
130
37
  // appease the Level Access scanning tools
131
- "aria-controls": (params == null ? void 0 : params.inputProps["aria-controls"]) || ""
132
- })
38
+ "aria-controls": params?.inputProps["aria-controls"] || ""
39
+ }
133
40
  });
134
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
135
- import_Autocomplete.default,
136
- __spreadValues(__spreadValues({
137
- renderInput: (params) => {
138
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_textfield.TextField, __spreadValues(__spreadValues(__spreadValues({}, params), FieldProps), resolvedProps(params)));
139
- },
140
- popupIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_form_utils.SelectExpandIcon, { className: "MuiSelect-avExpandIcon" }),
141
- slotProps: { popupIndicator: { component: PopupIndicatorWrapper } }
142
- }, props), defaultProps)
41
+ return /* @__PURE__ */ jsx(
42
+ MuiAutocomplete,
43
+ {
44
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, ...FieldProps, ...resolvedProps(params) }),
45
+ popupIcon: /* @__PURE__ */ jsx(SelectExpandIcon, { className: "MuiSelect-avExpandIcon" }),
46
+ slotProps: { popupIndicator: { component: PopupIndicatorWrapper } },
47
+ ...props,
48
+ ...defaultProps
49
+ }
143
50
  );
144
51
  };
145
52
 
146
53
  // src/lib/AsyncAutocomplete.tsx
147
- var import_react3 = require("react");
148
- var import_react_query = require("@tanstack/react-query");
54
+ import { useState as useState2, useRef, useEffect as useEffect2, useCallback } from "react";
55
+ import { useInfiniteQuery } from "@tanstack/react-query";
149
56
 
150
57
  // src/lib/util.tsx
151
- var import_react2 = require("react");
58
+ import { useEffect, useState } from "react";
152
59
  var useDebounce = (value, delay) => {
153
- const [debouncedValue, setDebouncedValue] = (0, import_react2.useState)("");
154
- (0, import_react2.useEffect)(() => {
60
+ const [debouncedValue, setDebouncedValue] = useState("");
61
+ useEffect(() => {
155
62
  const timer = setTimeout(() => {
156
63
  setDebouncedValue(value);
157
64
  }, delay);
@@ -163,51 +70,39 @@ var useDebounce = (value, delay) => {
163
70
  };
164
71
 
165
72
  // src/lib/AsyncAutocomplete.tsx
166
- var import_jsx_runtime2 = require("react/jsx-runtime");
167
- var AsyncAutocomplete = (_a) => {
168
- var _b = _a, {
169
- loadOptions,
170
- limit = 50,
171
- queryKey,
172
- ListboxProps,
173
- queryOptions,
174
- watchParams,
175
- debounceTimeout = 350,
176
- FieldProps,
177
- onInputChange,
178
- prependOptions = []
179
- } = _b, rest = __objRest(_b, [
180
- "loadOptions",
181
- "limit",
182
- "queryKey",
183
- "ListboxProps",
184
- "queryOptions",
185
- "watchParams",
186
- "debounceTimeout",
187
- "FieldProps",
188
- "onInputChange",
189
- "prependOptions"
190
- ]);
191
- const [inputValue, setInputValue] = (0, import_react3.useState)("");
192
- const listboxRef = (0, import_react3.useRef)(null);
193
- const setListboxRef = (0, import_react3.useCallback)((node) => {
73
+ import { jsx as jsx2 } from "react/jsx-runtime";
74
+ var AsyncAutocomplete = ({
75
+ loadOptions,
76
+ limit = 50,
77
+ queryKey,
78
+ ListboxProps,
79
+ queryOptions,
80
+ watchParams,
81
+ debounceTimeout = 350,
82
+ FieldProps,
83
+ onInputChange,
84
+ prependOptions = [],
85
+ ...rest
86
+ }) => {
87
+ const [inputValue, setInputValue] = useState2("");
88
+ const listboxRef = useRef(null);
89
+ const setListboxRef = useCallback((node) => {
194
90
  listboxRef.current = node;
195
91
  }, []);
196
92
  const handleInputPropsOnChange = (event) => {
197
- var _a2;
198
93
  setInputValue(event.target.value);
199
- if ((_a2 = FieldProps == null ? void 0 : FieldProps.InputProps) == null ? void 0 : _a2.onChange) FieldProps.InputProps.onChange(event);
94
+ if (FieldProps?.InputProps?.onChange) FieldProps.InputProps.onChange(event);
200
95
  };
201
96
  const debouncedInput = useDebounce(inputValue, debounceTimeout);
202
- const { isLoading, isFetching, data, hasNextPage, fetchNextPage } = (0, import_react_query.useInfiniteQuery)(__spreadValues({
97
+ const { isLoading, isFetching, data, hasNextPage, fetchNextPage } = useInfiniteQuery({
203
98
  queryKey: [queryKey, limit, debouncedInput, watchParams],
204
- queryFn: (_0) => __async(null, [_0], function* ({ pageParam = 0 }) {
205
- return loadOptions(pageParam, limit, debouncedInput);
206
- }),
99
+ queryFn: ({ pageParam }) => loadOptions(pageParam, limit, debouncedInput),
100
+ initialPageParam: 0,
207
101
  staleTime: 1e4,
208
- getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.offset + limit : void 0
209
- }, queryOptions));
210
- const options = (data == null ? void 0 : data.pages) ? data.pages.map((page) => page.options).flat() : [];
102
+ getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.offset + limit : void 0,
103
+ ...queryOptions
104
+ });
105
+ const options = data?.pages ? data.pages.flatMap((page) => page.options) : [];
211
106
  const finalOptions = prependOptions.length > 0 ? [
212
107
  ...prependOptions,
213
108
  ...options.filter(
@@ -218,179 +113,174 @@ var AsyncAutocomplete = (_a) => {
218
113
  ] : options;
219
114
  const handleOnInputChange = (event, value, reason) => {
220
115
  if (reason === "clear") {
221
- setInputValue(event.target.value);
116
+ setInputValue(value);
222
117
  } else if (reason === "blur") {
223
118
  setInputValue(value);
224
119
  }
225
120
  if (onInputChange) onInputChange(event, value, reason);
226
121
  };
227
- const handleAddingOptions = (event) => __async(null, null, function* () {
122
+ const handleAddingOptions = async (event) => {
228
123
  const listboxNode = event.currentTarget;
229
124
  const difference = listboxNode.scrollHeight - (listboxNode.scrollTop + listboxNode.clientHeight);
230
125
  if (difference <= 10 && !isLoading && !isFetching && hasNextPage) {
231
126
  fetchNextPage();
232
127
  }
233
- });
234
- (0, import_react3.useEffect)(() => {
235
- var _a2;
128
+ };
129
+ useEffect2(() => {
236
130
  if (hasNextPage) {
237
- (_a2 = listboxRef.current) == null ? void 0 : _a2.dispatchEvent(new UIEvent("scroll"));
131
+ listboxRef.current?.dispatchEvent(new UIEvent("scroll"));
238
132
  }
239
- }, [data == null ? void 0 : data.pages.length, hasNextPage]);
240
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
133
+ }, [data?.pages.length, hasNextPage]);
134
+ return /* @__PURE__ */ jsx2(
241
135
  Autocomplete,
242
- __spreadProps(__spreadValues({}, rest), {
136
+ {
137
+ ...rest,
243
138
  onInputChange: handleOnInputChange,
244
- FieldProps: __spreadProps(__spreadValues({}, FieldProps), {
245
- InputProps: __spreadProps(__spreadValues({}, FieldProps == null ? void 0 : FieldProps.InputProps), {
139
+ FieldProps: {
140
+ ...FieldProps,
141
+ InputProps: {
142
+ ...FieldProps?.InputProps,
246
143
  onChange: handleInputPropsOnChange
247
- })
248
- }),
144
+ }
145
+ },
249
146
  loading: isFetching,
250
147
  options: finalOptions,
251
- ListboxProps: __spreadProps(__spreadValues({}, ListboxProps), {
148
+ ListboxProps: {
149
+ ...ListboxProps,
252
150
  ref: setListboxRef,
253
151
  onScroll: handleAddingOptions,
254
152
  onPointerEnter: handleAddingOptions
255
- })
256
- })
153
+ }
154
+ }
257
155
  );
258
156
  };
259
157
 
260
158
  // src/lib/CodesAutocomplete.tsx
261
- var import_api_axios = require("@availity/api-axios");
262
- var import_jsx_runtime3 = require("react/jsx-runtime");
263
- var fetchCodes = (config) => __async(null, null, function* () {
264
- const resp = yield import_api_axios.avCodesApi.query(config);
159
+ import { avCodesApi } from "@availity/api-axios";
160
+ import { jsx as jsx3 } from "react/jsx-runtime";
161
+ var fetchCodes = async (config) => {
162
+ const resp = await avCodesApi.query(config);
265
163
  return {
266
164
  options: resp.data.codes,
267
165
  hasMore: config.params.offset + config.params.limit < resp.data.totalCount,
268
166
  offset: config.params.offset
269
167
  };
270
- });
168
+ };
271
169
  var handleGetCodesOptionLabel = (option) => [option.code, option.value].filter(Boolean).join(" - ");
272
- var CodesAutocomplete = (_a) => {
273
- var _b = _a, {
274
- apiConfig = {},
275
- queryOptions,
276
- queryKey = "codes-autocomplete",
277
- list,
278
- watchParams
279
- } = _b, rest = __objRest(_b, [
280
- "apiConfig",
281
- "queryOptions",
282
- "queryKey",
283
- "list",
284
- "watchParams"
285
- ]);
286
- const handleLoadOptions = (offset, limit, inputValue) => __async(null, null, function* () {
287
- const resp = yield fetchCodes(__spreadProps(__spreadValues({}, apiConfig), {
288
- params: __spreadProps(__spreadValues({}, apiConfig.params), { list, offset, limit, q: inputValue })
289
- }));
290
- return __spreadProps(__spreadValues({}, resp), {
291
- options: resp.options
170
+ var CodesAutocomplete = ({
171
+ apiConfig = {},
172
+ queryOptions,
173
+ queryKey = "codes-autocomplete",
174
+ list,
175
+ watchParams,
176
+ ...rest
177
+ }) => {
178
+ const handleLoadOptions = async (offset, limit, inputValue) => {
179
+ const resp = await fetchCodes({
180
+ ...apiConfig,
181
+ params: { ...apiConfig.params, list, offset, limit, q: inputValue }
292
182
  });
293
- });
294
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
183
+ return {
184
+ ...resp,
185
+ options: resp.options
186
+ };
187
+ };
188
+ return /* @__PURE__ */ jsx3(
295
189
  AsyncAutocomplete,
296
- __spreadProps(__spreadValues({
190
+ {
297
191
  getOptionLabel: handleGetCodesOptionLabel,
298
192
  queryKey,
299
- queryOptions: __spreadValues({ enabled: !!list }, queryOptions),
300
- watchParams: __spreadValues({ list }, watchParams)
301
- }, rest), {
193
+ queryOptions: { enabled: !!list, ...queryOptions },
194
+ watchParams: { list, ...watchParams },
195
+ ...rest,
302
196
  loadOptions: handleLoadOptions
303
- })
197
+ }
304
198
  );
305
199
  };
306
200
 
307
201
  // src/lib/OrganizationAutocomplete.tsx
308
- var import_api_axios2 = require("@availity/api-axios");
309
- var import_qs = __toESM(require("qs"));
310
- var import_jsx_runtime4 = require("react/jsx-runtime");
311
- var fetchOrgs = (config) => __async(null, null, function* () {
312
- const configWithParamsSerializer = __spreadProps(__spreadValues({}, config), {
202
+ import { avOrganizationsApi } from "@availity/api-axios";
203
+ import qs from "qs";
204
+ import { jsx as jsx4 } from "react/jsx-runtime";
205
+ var fetchOrgs = async (config) => {
206
+ const configWithParamsSerializer = {
207
+ ...config,
313
208
  paramsSerializer: {
314
- serialize: (params) => import_qs.default.stringify(params, { arrayFormat: "repeat" })
209
+ serialize: (params) => qs.stringify(params, { arrayFormat: "repeat" })
315
210
  }
316
- });
317
- const resp = yield import_api_axios2.avOrganizationsApi.getOrganizations(configWithParamsSerializer);
211
+ };
212
+ const resp = await avOrganizationsApi.getOrganizations(configWithParamsSerializer);
318
213
  return {
319
214
  options: resp.data.organizations,
320
215
  hasMore: config.params.offset + config.params.limit < resp.data.totalCount,
321
216
  offset: config.params.offset
322
217
  };
323
- });
218
+ };
324
219
  var handleGetOrgOptionLabel = (org) => org.name;
325
- var OrganizationAutocomplete = (_a) => {
326
- var _b = _a, {
327
- apiConfig = {},
328
- queryKey = "org-autocomplete"
329
- } = _b, rest = __objRest(_b, [
330
- "apiConfig",
331
- "queryKey"
332
- ]);
333
- const handleLoadOptions = (offset, limit) => __async(null, null, function* () {
334
- const resp = yield fetchOrgs(__spreadProps(__spreadValues({}, apiConfig), { params: __spreadProps(__spreadValues({ dropdown: true }, apiConfig.params), { offset, limit }) }));
335
- return __spreadProps(__spreadValues({}, resp), {
220
+ var OrganizationAutocomplete = ({
221
+ apiConfig = {},
222
+ queryKey = "org-autocomplete",
223
+ ...rest
224
+ }) => {
225
+ const handleLoadOptions = async (offset, limit) => {
226
+ const resp = await fetchOrgs({ ...apiConfig, params: { dropdown: true, ...apiConfig.params, offset, limit } });
227
+ return {
228
+ ...resp,
336
229
  options: resp.options
337
- });
338
- });
339
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
230
+ };
231
+ };
232
+ return /* @__PURE__ */ jsx4(
340
233
  AsyncAutocomplete,
341
- __spreadProps(__spreadValues({
234
+ {
342
235
  getOptionLabel: handleGetOrgOptionLabel,
343
- queryKey
344
- }, rest), {
236
+ queryKey,
237
+ ...rest,
345
238
  loadOptions: handleLoadOptions
346
- })
239
+ }
347
240
  );
348
241
  };
349
242
 
350
243
  // src/lib/ProviderAutocomplete.tsx
351
- var import_api_axios3 = require("@availity/api-axios");
352
- var import_jsx_runtime5 = require("react/jsx-runtime");
353
- var fetchProviders = (customerId, config) => __async(null, null, function* () {
354
- const resp = yield import_api_axios3.avProvidersApi.getProviders(customerId, config);
244
+ import { avProvidersApi } from "@availity/api-axios";
245
+ import { jsx as jsx5 } from "react/jsx-runtime";
246
+ var fetchProviders = async (customerId, config) => {
247
+ const resp = await avProvidersApi.getProviders(customerId, config);
355
248
  return {
356
249
  options: resp.data.providers,
357
250
  hasMore: config.params.offset + config.params.limit < resp.data.totalCount,
358
251
  offset: config.params.offset
359
252
  };
360
- });
253
+ };
361
254
  var handleGetProviderOptionLabel = (option) => option.uiDisplayName;
362
- var ProviderAutocomplete = (_a) => {
363
- var _b = _a, {
364
- apiConfig = {},
365
- customerId,
366
- queryKey = "prov-autocomplete"
367
- } = _b, rest = __objRest(_b, [
368
- "apiConfig",
369
- "customerId",
370
- "queryKey"
371
- ]);
372
- const handleLoadOptions = (offset, limit, inputValue) => __async(null, null, function* () {
373
- const resp = yield fetchProviders(customerId, __spreadProps(__spreadValues({}, apiConfig), {
374
- params: __spreadProps(__spreadValues({}, apiConfig.params), { offset, limit, q: inputValue })
375
- }));
376
- return __spreadProps(__spreadValues({}, resp), {
377
- options: resp.options
255
+ var ProviderAutocomplete = ({
256
+ apiConfig = {},
257
+ customerId,
258
+ queryKey = "prov-autocomplete",
259
+ ...rest
260
+ }) => {
261
+ const handleLoadOptions = async (offset, limit, inputValue) => {
262
+ const resp = await fetchProviders(customerId, {
263
+ ...apiConfig,
264
+ params: { ...apiConfig.params, offset, limit, q: inputValue }
378
265
  });
379
- });
380
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
266
+ return {
267
+ ...resp,
268
+ options: resp.options
269
+ };
270
+ };
271
+ return /* @__PURE__ */ jsx5(
381
272
  AsyncAutocomplete,
382
- __spreadProps(__spreadValues({
273
+ {
383
274
  getOptionLabel: handleGetProviderOptionLabel,
384
275
  queryOptions: { enabled: !!customerId },
385
276
  queryKey,
386
- watchParams: { customerId }
387
- }, rest), {
277
+ watchParams: { customerId },
278
+ ...rest,
388
279
  loadOptions: handleLoadOptions
389
- })
280
+ }
390
281
  );
391
282
  };
392
- // Annotate the CommonJS export names for ESM import in node:
393
- 0 && (module.exports = {
283
+ export {
394
284
  AsyncAutocomplete,
395
285
  Autocomplete,
396
286
  CodesAutocomplete,
@@ -403,4 +293,4 @@ var ProviderAutocomplete = (_a) => {
403
293
  handleGetCodesOptionLabel,
404
294
  handleGetOrgOptionLabel,
405
295
  handleGetProviderOptionLabel
406
- });
296
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-autocomplete",
3
- "version": "2.2.7",
3
+ "version": "3.0.0",
4
4
  "description": "Availity MUI Autocomplete Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -21,19 +21,17 @@
21
21
  "author": "Availity Developers <AVOSS@availity.com>",
22
22
  "browser": "./dist/index.js",
23
23
  "main": "./dist/index.js",
24
- "module": "./dist/index.mjs",
25
24
  "types": "./dist/index.d.ts",
26
25
  "exports": {
27
- "./package.json": "./package.json",
28
26
  ".": {
29
27
  "types": "./dist/index.d.ts",
30
- "import": "./dist/index.mjs",
31
- "require": "./dist/index.js"
32
- }
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./package.json": "./package.json"
33
31
  },
34
32
  "scripts": {
35
- "build": "tsup src/index.ts --format esm,cjs --dts",
36
- "dev": "tsup src/index.ts --format esm,cjs --watch --dts",
33
+ "build": "tsup src/index.ts --format esm --dts",
34
+ "dev": "tsup src/index.ts --format esm --watch --dts",
37
35
  "clean": "rm -rf dist",
38
36
  "clean:nm": "rm -rf node_modules",
39
37
  "bundlesize": "bundlesize",
@@ -41,31 +39,32 @@
41
39
  "publish:canary": "yarn npm publish --access public --tag canary"
42
40
  },
43
41
  "dependencies": {
44
- "@mui/types": "^7.4.7",
45
- "qs": "^6.15.0"
42
+ "@mui/types": "^7.4.12",
43
+ "qs": "^6.15.2"
46
44
  },
47
45
  "devDependencies": {
48
- "@availity/api-axios": "^12.2.1",
49
- "@availity/mui-form-utils": "^2.0.6",
50
- "@availity/mui-icon": "^2.1.0",
51
- "@availity/mui-textfield": "^2.0.6",
52
- "@mui/material": "^7.3.4",
53
- "@tanstack/react-query": "^4.36.1",
54
- "react": "19.2.0",
55
- "react-dom": "19.2.0",
56
- "tsup": "^8.4.0",
57
- "typescript": "^5.4.5"
46
+ "@availity/api-axios": "^13.2.0",
47
+ "@availity/mui-form-utils": "^3.0.0",
48
+ "@availity/mui-icon": "^3.0.0",
49
+ "@availity/mui-textfield": "^3.0.0",
50
+ "@mui/material": "^7.3.11",
51
+ "@tanstack/react-query": "^5.101.0",
52
+ "react": "19.2.7",
53
+ "react-dom": "19.2.7",
54
+ "tsup": "^8.5.1",
55
+ "typescript": "^5.9.3"
58
56
  },
59
57
  "peerDependencies": {
60
58
  "@availity/api-axios": "^12.0.0",
61
- "@availity/mui-form-utils": "^2.0.6",
62
- "@availity/mui-textfield": "^2.0.6",
59
+ "@availity/mui-form-utils": "^3.0.0",
60
+ "@availity/mui-textfield": "^3.0.0",
63
61
  "@mui/material": "^7.0.0",
64
- "@tanstack/react-query": "^4.36.1",
62
+ "@tanstack/react-query": "^5.101.0",
65
63
  "react": ">=17.0.0"
66
64
  },
67
65
  "publishConfig": {
68
66
  "access": "public"
69
67
  },
70
- "sideEffects": false
68
+ "sideEffects": false,
69
+ "type": "module"
71
70
  }