@availity/mui-controlled-form 1.2.1 → 1.2.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
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.2.2](https://github.com/Availity/element/compare/@availity/mui-controlled-form@1.2.1...@availity/mui-controlled-form@1.2.2) (2025-04-08)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-datepicker` updated to version `1.2.1`
|
|
10
|
+
* `theme-provider` updated to version `1.2.1`
|
|
5
11
|
## [1.2.1](https://github.com/Availity/element/compare/@availity/mui-controlled-form@1.2.0...@availity/mui-controlled-form@1.2.1) (2025-04-04)
|
|
6
12
|
|
|
7
13
|
### Dependency Updates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-controlled-form",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Availity MUI/react-hook-form controlled form components - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@availity/mui-autocomplete": "^1.0.10",
|
|
44
44
|
"@availity/mui-checkbox": "^1.0.1",
|
|
45
|
-
"@availity/mui-datepicker": "^1.0.
|
|
45
|
+
"@availity/mui-datepicker": "^1.0.8",
|
|
46
46
|
"@availity/mui-form-utils": "^1.1.0",
|
|
47
47
|
"@availity/mui-textfield": "^1.1.2",
|
|
48
48
|
"react-hook-form": "^7.54.2"
|
|
@@ -81,6 +81,51 @@ export const _ControlledAsyncAutoComplete: StoryObj<typeof ControlledAsyncAutoco
|
|
|
81
81
|
},
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
+
export const _ControlledAsyncAutoCompleteMultiple: StoryObj<typeof ControlledAsyncAutocomplete> = {
|
|
85
|
+
render: (args) => {
|
|
86
|
+
const methods = useForm({ defaultValues: { controlledAsyncAutocomplete: [] } });
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<QueryClientProvider client={client}>
|
|
90
|
+
<FormProvider {...methods}>
|
|
91
|
+
<form onSubmit={methods.handleSubmit((data) => data)}>
|
|
92
|
+
<ControlledAsyncAutocomplete {...args} />
|
|
93
|
+
<Grid container direction="row" justifyContent="space-between" marginTop={1}>
|
|
94
|
+
<Button
|
|
95
|
+
disabled={!methods?.formState?.isSubmitSuccessful}
|
|
96
|
+
children="Reset"
|
|
97
|
+
color="secondary"
|
|
98
|
+
onClick={() => methods.reset()}
|
|
99
|
+
/>
|
|
100
|
+
<Button type="submit" disabled={methods?.formState?.isSubmitSuccessful} children="Submit" />
|
|
101
|
+
</Grid>
|
|
102
|
+
{methods?.formState?.isSubmitSuccessful ? (
|
|
103
|
+
<Paper sx={{ padding: '1.5rem', marginTop: '1.5rem' }}>
|
|
104
|
+
<Typography variant="h2">Submitted Values</Typography>
|
|
105
|
+
<pre data-testid="result">{JSON.stringify(methods.getValues(), null, 2)}</pre>
|
|
106
|
+
</Paper>
|
|
107
|
+
) : null}
|
|
108
|
+
</form>
|
|
109
|
+
</FormProvider>
|
|
110
|
+
</QueryClientProvider>
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
args: {
|
|
114
|
+
name: 'controlledAsyncAutocomplete',
|
|
115
|
+
FieldProps: { label: 'Async Select', helperText: 'Helper Text', fullWidth: false, required: true },
|
|
116
|
+
getOptionLabel: (val: Option) => val.label,
|
|
117
|
+
isOptionEqualToValue: (option, value) => option.label === value.label,
|
|
118
|
+
loadOptions,
|
|
119
|
+
limit: 5,
|
|
120
|
+
queryKey: 'example',
|
|
121
|
+
rules: { required: 'This is required.' },
|
|
122
|
+
defaultToFirstOption: true,
|
|
123
|
+
disableClearable: true,
|
|
124
|
+
multiple: true,
|
|
125
|
+
filterSelectedOptions: true,
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
|
|
84
129
|
export const _ControlledAsyncAutoCompleteDefaultToOnlyOption: StoryObj<typeof ControlledAsyncAutocomplete> = {
|
|
85
130
|
render: (args) => {
|
|
86
131
|
const methods = useForm();
|