@availity/mui-autocomplete 0.6.0 → 0.6.2
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 +13 -0
- package/dist/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +42 -2
- package/dist/index.mjs +40 -1
- package/package.json +5 -5
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.6.2](https://github.com/Availity/element/compare/@availity/mui-autocomplete@0.6.1...@availity/mui-autocomplete@0.6.2) (2024-07-19)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-form-utils` updated to version `0.6.1`
|
|
10
|
+
* `mui-textfield` updated to version `0.6.1`
|
|
11
|
+
## [0.6.1](https://github.com/Availity/element/compare/@availity/mui-autocomplete@0.6.0...@availity/mui-autocomplete@0.6.1) (2024-07-05)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **mui-autocomplete:** and provider export ([a5e6703](https://github.com/Availity/element/commit/a5e6703fb5544f4e2058c2128b3c8bca2a1b01b9))
|
|
17
|
+
|
|
5
18
|
## [0.6.0](https://github.com/Availity/element/compare/@availity/mui-autocomplete@0.5.2...@availity/mui-autocomplete@0.6.0) (2024-07-01)
|
|
6
19
|
|
|
7
20
|
|
package/dist/index.d.mts
CHANGED
|
@@ -48,4 +48,16 @@ interface OrgAutocompleteProps<Option = Organization, Multiple extends boolean |
|
|
|
48
48
|
}
|
|
49
49
|
declare const OrganizationAutocomplete: ({ apiConfig, queryKey, ...rest }: OrgAutocompleteProps) => react_jsx_runtime.JSX.Element;
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
type Provider = {
|
|
52
|
+
id: string;
|
|
53
|
+
businessName: string;
|
|
54
|
+
uiDisplayName: string;
|
|
55
|
+
aytypical: boolean;
|
|
56
|
+
};
|
|
57
|
+
interface ProviderAutocompleteProps<Option = Provider, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent']> extends Omit<Optional<AsyncAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>, 'queryKey'>, 'loadOptions'> {
|
|
58
|
+
customerId: string;
|
|
59
|
+
apiConfig?: ApiConfig;
|
|
60
|
+
}
|
|
61
|
+
declare const ProviderAutocomplete: ({ apiConfig, customerId, queryKey, ...rest }: ProviderAutocompleteProps) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
export { AsyncAutocomplete, type AsyncAutocompleteProps, Autocomplete, type AutocompleteProps, type OrgAutocompleteProps, type Organization, OrganizationAutocomplete, type Provider, ProviderAutocomplete, type ProviderAutocompleteProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -48,4 +48,16 @@ interface OrgAutocompleteProps<Option = Organization, Multiple extends boolean |
|
|
|
48
48
|
}
|
|
49
49
|
declare const OrganizationAutocomplete: ({ apiConfig, queryKey, ...rest }: OrgAutocompleteProps) => react_jsx_runtime.JSX.Element;
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
type Provider = {
|
|
52
|
+
id: string;
|
|
53
|
+
businessName: string;
|
|
54
|
+
uiDisplayName: string;
|
|
55
|
+
aytypical: boolean;
|
|
56
|
+
};
|
|
57
|
+
interface ProviderAutocompleteProps<Option = Provider, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent']> extends Omit<Optional<AsyncAutocompleteProps<Option, Multiple, DisableClearable, FreeSolo, ChipComponent>, 'queryKey'>, 'loadOptions'> {
|
|
58
|
+
customerId: string;
|
|
59
|
+
apiConfig?: ApiConfig;
|
|
60
|
+
}
|
|
61
|
+
declare const ProviderAutocomplete: ({ apiConfig, customerId, queryKey, ...rest }: ProviderAutocompleteProps) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
export { AsyncAutocomplete, type AsyncAutocompleteProps, Autocomplete, type AutocompleteProps, type OrgAutocompleteProps, type Organization, OrganizationAutocomplete, type Provider, ProviderAutocomplete, type ProviderAutocompleteProps };
|
package/dist/index.js
CHANGED
|
@@ -81,7 +81,8 @@ var src_exports = {};
|
|
|
81
81
|
__export(src_exports, {
|
|
82
82
|
AsyncAutocomplete: () => AsyncAutocomplete,
|
|
83
83
|
Autocomplete: () => Autocomplete,
|
|
84
|
-
OrganizationAutocomplete: () => OrganizationAutocomplete
|
|
84
|
+
OrganizationAutocomplete: () => OrganizationAutocomplete,
|
|
85
|
+
ProviderAutocomplete: () => ProviderAutocomplete
|
|
85
86
|
});
|
|
86
87
|
module.exports = __toCommonJS(src_exports);
|
|
87
88
|
|
|
@@ -206,9 +207,48 @@ var OrganizationAutocomplete = (_a) => {
|
|
|
206
207
|
})
|
|
207
208
|
);
|
|
208
209
|
};
|
|
210
|
+
|
|
211
|
+
// src/lib/ProviderAutocomplete.tsx
|
|
212
|
+
var import_api_axios2 = require("@availity/api-axios");
|
|
213
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
214
|
+
var fetchProviders = (customerId, config) => __async(void 0, null, function* () {
|
|
215
|
+
const resp = yield import_api_axios2.avProvidersApi.getProviders(customerId, config);
|
|
216
|
+
return {
|
|
217
|
+
options: resp.data.providers,
|
|
218
|
+
hasMore: config.params.offset + config.params.limit < resp.data.totalCount,
|
|
219
|
+
offset: config.params.offset
|
|
220
|
+
};
|
|
221
|
+
});
|
|
222
|
+
var ProviderAutocomplete = (_a) => {
|
|
223
|
+
var _b = _a, {
|
|
224
|
+
apiConfig = {},
|
|
225
|
+
customerId,
|
|
226
|
+
queryKey = "prov-autocomplete"
|
|
227
|
+
} = _b, rest = __objRest(_b, [
|
|
228
|
+
"apiConfig",
|
|
229
|
+
"customerId",
|
|
230
|
+
"queryKey"
|
|
231
|
+
]);
|
|
232
|
+
const handleLoadOptions = (offset, limit) => __async(void 0, null, function* () {
|
|
233
|
+
const resp = yield fetchProviders(customerId, __spreadProps(__spreadValues({}, apiConfig), { params: __spreadProps(__spreadValues({}, apiConfig.params), { offset, limit }) }));
|
|
234
|
+
return resp;
|
|
235
|
+
});
|
|
236
|
+
const handleGetOptionLabel = (option) => option.uiDisplayName;
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
238
|
+
AsyncAutocomplete,
|
|
239
|
+
__spreadProps(__spreadValues({
|
|
240
|
+
getOptionLabel: handleGetOptionLabel,
|
|
241
|
+
queryOptions: { enabled: !!customerId },
|
|
242
|
+
queryKey
|
|
243
|
+
}, rest), {
|
|
244
|
+
loadOptions: handleLoadOptions
|
|
245
|
+
})
|
|
246
|
+
);
|
|
247
|
+
};
|
|
209
248
|
// Annotate the CommonJS export names for ESM import in node:
|
|
210
249
|
0 && (module.exports = {
|
|
211
250
|
AsyncAutocomplete,
|
|
212
251
|
Autocomplete,
|
|
213
|
-
OrganizationAutocomplete
|
|
252
|
+
OrganizationAutocomplete,
|
|
253
|
+
ProviderAutocomplete
|
|
214
254
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -173,8 +173,47 @@ var OrganizationAutocomplete = (_a) => {
|
|
|
173
173
|
})
|
|
174
174
|
);
|
|
175
175
|
};
|
|
176
|
+
|
|
177
|
+
// src/lib/ProviderAutocomplete.tsx
|
|
178
|
+
import { avProvidersApi } from "@availity/api-axios";
|
|
179
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
180
|
+
var fetchProviders = (customerId, config) => __async(void 0, null, function* () {
|
|
181
|
+
const resp = yield avProvidersApi.getProviders(customerId, config);
|
|
182
|
+
return {
|
|
183
|
+
options: resp.data.providers,
|
|
184
|
+
hasMore: config.params.offset + config.params.limit < resp.data.totalCount,
|
|
185
|
+
offset: config.params.offset
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
var ProviderAutocomplete = (_a) => {
|
|
189
|
+
var _b = _a, {
|
|
190
|
+
apiConfig = {},
|
|
191
|
+
customerId,
|
|
192
|
+
queryKey = "prov-autocomplete"
|
|
193
|
+
} = _b, rest = __objRest(_b, [
|
|
194
|
+
"apiConfig",
|
|
195
|
+
"customerId",
|
|
196
|
+
"queryKey"
|
|
197
|
+
]);
|
|
198
|
+
const handleLoadOptions = (offset, limit) => __async(void 0, null, function* () {
|
|
199
|
+
const resp = yield fetchProviders(customerId, __spreadProps(__spreadValues({}, apiConfig), { params: __spreadProps(__spreadValues({}, apiConfig.params), { offset, limit }) }));
|
|
200
|
+
return resp;
|
|
201
|
+
});
|
|
202
|
+
const handleGetOptionLabel = (option) => option.uiDisplayName;
|
|
203
|
+
return /* @__PURE__ */ jsx4(
|
|
204
|
+
AsyncAutocomplete,
|
|
205
|
+
__spreadProps(__spreadValues({
|
|
206
|
+
getOptionLabel: handleGetOptionLabel,
|
|
207
|
+
queryOptions: { enabled: !!customerId },
|
|
208
|
+
queryKey
|
|
209
|
+
}, rest), {
|
|
210
|
+
loadOptions: handleLoadOptions
|
|
211
|
+
})
|
|
212
|
+
);
|
|
213
|
+
};
|
|
176
214
|
export {
|
|
177
215
|
AsyncAutocomplete,
|
|
178
216
|
Autocomplete,
|
|
179
|
-
OrganizationAutocomplete
|
|
217
|
+
OrganizationAutocomplete,
|
|
218
|
+
ProviderAutocomplete
|
|
180
219
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-autocomplete",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Availity MUI Autocomplete Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@availity/api-axios": "^8.0.8",
|
|
40
|
-
"@availity/mui-form-utils": "^0.
|
|
41
|
-
"@availity/mui-textfield": "^0.
|
|
40
|
+
"@availity/mui-form-utils": "^0.12.0",
|
|
41
|
+
"@availity/mui-textfield": "^0.6.0",
|
|
42
42
|
"@mui/material": "^5.15.15",
|
|
43
43
|
"@tanstack/react-query": "^4.36.1",
|
|
44
44
|
"react": "18.2.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@availity/api-axios": "^8.0.7",
|
|
51
|
-
"@availity/mui-form-utils": "^0.
|
|
52
|
-
"@availity/mui-textfield": "^0.
|
|
51
|
+
"@availity/mui-form-utils": "^0.12.0",
|
|
52
|
+
"@availity/mui-textfield": "^0.6.0",
|
|
53
53
|
"@mui/material": "^5.11.9",
|
|
54
54
|
"@tanstack/react-query": "^4.36.1",
|
|
55
55
|
"react": ">=16.3.0"
|
package/src/index.ts
CHANGED