@etsoo/materialui 1.6.66 → 1.6.67
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/lib/cjs/AutocompleteExtendedProps.d.ts +3 -2
- package/lib/cjs/ComboBox.js +1 -1
- package/lib/cjs/Tiplist.js +1 -1
- package/lib/mjs/AutocompleteExtendedProps.d.ts +3 -2
- package/lib/mjs/ComboBox.js +1 -1
- package/lib/mjs/Tiplist.js +1 -1
- package/package.json +1 -1
- package/src/AutocompleteExtendedProps.ts +10 -2
- package/src/ComboBox.tsx +1 -1
- package/src/Tiplist.tsx +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataTypes } from "@etsoo/shared";
|
|
2
|
-
import { AutocompleteProps } from "@mui/material/Autocomplete";
|
|
2
|
+
import { AutocompleteChangeReason, AutocompleteProps } from "@mui/material/Autocomplete";
|
|
3
3
|
import { ChangeEventHandler } from "react";
|
|
4
4
|
/**
|
|
5
5
|
* Autocomplete extended props
|
|
@@ -74,6 +74,7 @@ export type AutocompleteExtendedProps<T extends object, D extends DataTypes.Keys
|
|
|
74
74
|
* Value change handler
|
|
75
75
|
* @param value New value
|
|
76
76
|
* @param input Input element
|
|
77
|
+
* @param reason Reason for the change, 'undefined' for initial value change
|
|
77
78
|
*/
|
|
78
|
-
onValueChange?: (value: T | null, input?: HTMLInputElement | null) => void;
|
|
79
|
+
onValueChange?: (value: T | null, input?: HTMLInputElement | null, reason?: AutocompleteChangeReason) => void;
|
|
79
80
|
};
|
package/lib/cjs/ComboBox.js
CHANGED
|
@@ -133,7 +133,7 @@ function ComboBox(props) {
|
|
|
133
133
|
if (onChange != null)
|
|
134
134
|
onChange(event, value, reason, details);
|
|
135
135
|
if (onValueChange)
|
|
136
|
-
onValueChange(value, inputRef.current);
|
|
136
|
+
onValueChange(value, inputRef.current, reason);
|
|
137
137
|
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? ((0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionKey: getOptionKey, ...rest }), onAdd && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", onClick: () => {
|
|
138
138
|
onAdd(doLoadData);
|
|
139
139
|
}, title: addLabel, children: (0, jsx_runtime_1.jsx)(Add_1.default, {}) }))] })] }));
|
package/lib/cjs/Tiplist.js
CHANGED
|
@@ -183,7 +183,7 @@ function Tiplist(props) {
|
|
|
183
183
|
if (onChange != null)
|
|
184
184
|
onChange(event, value, reason, details);
|
|
185
185
|
if (onValueChange)
|
|
186
|
-
onValueChange(value, inputRef.current);
|
|
186
|
+
onValueChange(value, inputRef.current, reason);
|
|
187
187
|
// For clear case
|
|
188
188
|
if (reason === "clear") {
|
|
189
189
|
stateUpdate({ options: [], open: event.type === "click" });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataTypes } from "@etsoo/shared";
|
|
2
|
-
import { AutocompleteProps } from "@mui/material/Autocomplete";
|
|
2
|
+
import { AutocompleteChangeReason, AutocompleteProps } from "@mui/material/Autocomplete";
|
|
3
3
|
import { ChangeEventHandler } from "react";
|
|
4
4
|
/**
|
|
5
5
|
* Autocomplete extended props
|
|
@@ -74,6 +74,7 @@ export type AutocompleteExtendedProps<T extends object, D extends DataTypes.Keys
|
|
|
74
74
|
* Value change handler
|
|
75
75
|
* @param value New value
|
|
76
76
|
* @param input Input element
|
|
77
|
+
* @param reason Reason for the change, 'undefined' for initial value change
|
|
77
78
|
*/
|
|
78
|
-
onValueChange?: (value: T | null, input?: HTMLInputElement | null) => void;
|
|
79
|
+
onValueChange?: (value: T | null, input?: HTMLInputElement | null, reason?: AutocompleteChangeReason) => void;
|
|
79
80
|
};
|
package/lib/mjs/ComboBox.js
CHANGED
|
@@ -127,7 +127,7 @@ export function ComboBox(props) {
|
|
|
127
127
|
if (onChange != null)
|
|
128
128
|
onChange(event, value, reason, details);
|
|
129
129
|
if (onValueChange)
|
|
130
|
-
onValueChange(value, inputRef.current);
|
|
130
|
+
onValueChange(value, inputRef.current, reason);
|
|
131
131
|
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (_jsx(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (_jsx(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionKey: getOptionKey, ...rest }), onAdd && (_jsx(IconButton, { size: "small", onClick: () => {
|
|
132
132
|
onAdd(doLoadData);
|
|
133
133
|
}, title: addLabel, children: _jsx(AddIcon, {}) }))] })] }));
|
package/lib/mjs/Tiplist.js
CHANGED
|
@@ -177,7 +177,7 @@ export function Tiplist(props) {
|
|
|
177
177
|
if (onChange != null)
|
|
178
178
|
onChange(event, value, reason, details);
|
|
179
179
|
if (onValueChange)
|
|
180
|
-
onValueChange(value, inputRef.current);
|
|
180
|
+
onValueChange(value, inputRef.current, reason);
|
|
181
181
|
// For clear case
|
|
182
182
|
if (reason === "clear") {
|
|
183
183
|
stateUpdate({ options: [], open: event.type === "click" });
|
package/package.json
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { DataTypes } from "@etsoo/shared";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AutocompleteChangeReason,
|
|
4
|
+
AutocompleteProps
|
|
5
|
+
} from "@mui/material/Autocomplete";
|
|
3
6
|
import { ChangeEventHandler } from "react";
|
|
4
7
|
|
|
5
8
|
/**
|
|
@@ -97,6 +100,11 @@ export type AutocompleteExtendedProps<
|
|
|
97
100
|
* Value change handler
|
|
98
101
|
* @param value New value
|
|
99
102
|
* @param input Input element
|
|
103
|
+
* @param reason Reason for the change, 'undefined' for initial value change
|
|
100
104
|
*/
|
|
101
|
-
onValueChange?: (
|
|
105
|
+
onValueChange?: (
|
|
106
|
+
value: T | null,
|
|
107
|
+
input?: HTMLInputElement | null,
|
|
108
|
+
reason?: AutocompleteChangeReason
|
|
109
|
+
) => void;
|
|
102
110
|
};
|
package/src/ComboBox.tsx
CHANGED
|
@@ -268,7 +268,7 @@ export function ComboBox<
|
|
|
268
268
|
// Custom
|
|
269
269
|
if (onChange != null) onChange(event, value, reason, details);
|
|
270
270
|
|
|
271
|
-
if (onValueChange) onValueChange(value, inputRef.current);
|
|
271
|
+
if (onValueChange) onValueChange(value, inputRef.current, reason);
|
|
272
272
|
}}
|
|
273
273
|
openOnFocus={openOnFocus}
|
|
274
274
|
sx={sx}
|
package/src/Tiplist.tsx
CHANGED
|
@@ -318,7 +318,7 @@ export function Tiplist<
|
|
|
318
318
|
// Custom
|
|
319
319
|
if (onChange != null) onChange(event, value, reason, details);
|
|
320
320
|
|
|
321
|
-
if (onValueChange) onValueChange(value, inputRef.current);
|
|
321
|
+
if (onValueChange) onValueChange(value, inputRef.current, reason);
|
|
322
322
|
|
|
323
323
|
// For clear case
|
|
324
324
|
if (reason === "clear") {
|