@okta/odyssey-react-mui 1.8.0 → 1.8.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 +10 -0
- package/dist/@types/react-augment.d.js +2 -0
- package/dist/@types/react-augment.d.js.map +1 -0
- package/dist/Autocomplete.js +34 -23
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Checkbox.js +16 -7
- package/dist/Checkbox.js.map +1 -1
- package/dist/Field.js +2 -0
- package/dist/Field.js.map +1 -1
- package/dist/FieldComponentProps.js.map +1 -1
- package/dist/NativeSelect.js +24 -8
- package/dist/NativeSelect.js.map +1 -1
- package/dist/PasswordField.js +21 -5
- package/dist/PasswordField.js.map +1 -1
- package/dist/RadioGroup.js +11 -8
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchField.js +19 -16
- package/dist/SearchField.js.map +1 -1
- package/dist/Select.js +36 -18
- package/dist/Select.js.map +1 -1
- package/dist/TextField.js +22 -6
- package/dist/TextField.js.map +1 -1
- package/dist/inputUtils.js +46 -0
- package/dist/inputUtils.js.map +1 -0
- package/dist/labs/VirtualizedAutocomplete.js +29 -23
- package/dist/labs/VirtualizedAutocomplete.js.map +1 -1
- package/dist/src/Autocomplete.d.ts +2 -3
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/Field.d.ts +5 -1
- package/dist/src/Field.d.ts.map +1 -1
- package/dist/src/FieldComponentProps.d.ts +4 -0
- package/dist/src/FieldComponentProps.d.ts.map +1 -1
- package/dist/src/NativeSelect.d.ts +19 -44
- package/dist/src/NativeSelect.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts +10 -2
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/SearchField.d.ts +12 -4
- package/dist/src/SearchField.d.ts.map +1 -1
- package/dist/src/Select.d.ts +6 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/TextField.d.ts +8 -0
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/src/inputUtils.d.ts +47 -0
- package/dist/src/inputUtils.d.ts.map +1 -0
- package/dist/src/labs/VirtualizedAutocomplete.d.ts.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/@types/react-augment.d.ts +19 -0
- package/src/Autocomplete.tsx +52 -44
- package/src/Checkbox.tsx +16 -9
- package/src/Field.tsx +6 -0
- package/src/FieldComponentProps.ts +4 -0
- package/src/NativeSelect.tsx +81 -26
- package/src/PasswordField.tsx +34 -4
- package/src/RadioGroup.tsx +12 -10
- package/src/SearchField.tsx +27 -19
- package/src/Select.tsx +52 -26
- package/src/TextField.tsx +35 -5
- package/src/inputUtils.ts +76 -0
- package/src/labs/VirtualizedAutocomplete.tsx +48 -42
- package/dist/src/useControlledState.d.ts +0 -28
- package/dist/src/useControlledState.d.ts.map +0 -1
- package/dist/useControlledState.js +0 -33
- package/dist/useControlledState.js.map +0 -1
- package/src/useControlledState.ts +0 -56
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { useMemo } from "react";
|
|
14
|
+
export const ComponentControlledState = {
|
|
15
|
+
CONTROLLED: "CONTROLLED",
|
|
16
|
+
UNCONTROLLED: "UNCONTROLLED"
|
|
17
|
+
};
|
|
18
|
+
export const getControlState = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
controlledValue,
|
|
21
|
+
uncontrolledValue
|
|
22
|
+
} = _ref;
|
|
23
|
+
if (uncontrolledValue !== undefined || controlledValue === undefined) {
|
|
24
|
+
return ComponentControlledState.UNCONTROLLED;
|
|
25
|
+
}
|
|
26
|
+
return ComponentControlledState.CONTROLLED;
|
|
27
|
+
};
|
|
28
|
+
export const useInputValues = _ref2 => {
|
|
29
|
+
let {
|
|
30
|
+
defaultValue,
|
|
31
|
+
value,
|
|
32
|
+
controlState
|
|
33
|
+
} = _ref2;
|
|
34
|
+
const inputValues = useMemo(() => {
|
|
35
|
+
if (controlState === ComponentControlledState.CONTROLLED) {
|
|
36
|
+
return {
|
|
37
|
+
value
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
defaultValue
|
|
42
|
+
};
|
|
43
|
+
}, [defaultValue, value]);
|
|
44
|
+
return inputValues;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=inputUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputUtils.js","names":["useMemo","ComponentControlledState","CONTROLLED","UNCONTROLLED","getControlState","_ref","controlledValue","uncontrolledValue","undefined","useInputValues","_ref2","defaultValue","value","controlState","inputValues"],"sources":["../src/inputUtils.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useMemo } from \"react\";\n\ntype UseControlledStateProps<Value> = {\n controlledValue?: Value;\n uncontrolledValue?: Value;\n};\n\nexport const ComponentControlledState = {\n CONTROLLED: \"CONTROLLED\",\n UNCONTROLLED: \"UNCONTROLLED\",\n};\n\nexport type ModeType = keyof typeof ComponentControlledState;\nexport type ModeTypeValue = (typeof ComponentControlledState)[ModeType];\n\nexport const getControlState = <Value>({\n controlledValue,\n uncontrolledValue,\n}: UseControlledStateProps<Value>): ModeTypeValue => {\n if (uncontrolledValue !== undefined || controlledValue === undefined) {\n return ComponentControlledState.UNCONTROLLED;\n }\n return ComponentControlledState.CONTROLLED;\n};\n\ntype InputValueProps<Value> = {\n defaultValue?: Value;\n value?: Value;\n controlState: ModeTypeValue;\n};\n\ntype InputValue<Value> =\n | {\n defaultValue: Value | undefined;\n value?: undefined;\n }\n | {\n value: Value | undefined;\n defaultValue?: undefined;\n };\n\n/**\n * In components that support being used in a controlled or uncontrolled way, the defaultValue and value props need\n * to be suppled values in a mutually exclusive way.\n * If a `value` is being provided to the component, then it is being used in a controlled manner and `defaultValue` needs to be undefined.\n * If `value` is undefined, then that means the component is being used in an uncontrolled way and `defaultValue` is either Value or undefined.\n * This helper helps ensure this mutual exclusivity between the 2 props so the component can operate as expected.\n *\n * @param {InputValueProps<Value>}: { defaultValue: Value | undefined, value: Value | undefined }\n * @returns {InputValue<Value>}: { defaultValue: Value | undefined, value?: undefined } | { defaultValue?: undefined, value: Value }\n */\nexport const useInputValues = <Value>({\n defaultValue,\n value,\n controlState,\n}: InputValueProps<Value>): InputValue<Value> => {\n const inputValues = useMemo(() => {\n if (controlState === ComponentControlledState.CONTROLLED) {\n return { value };\n }\n return { defaultValue };\n }, [defaultValue, value]);\n return inputValues;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,OAAO;AAO/B,OAAO,MAAMC,wBAAwB,GAAG;EACtCC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE;AAChB,CAAC;AAKD,OAAO,MAAMC,eAAe,GAAGC,IAAA,IAGsB;EAAA,IAHd;IACrCC,eAAe;IACfC;EAC8B,CAAC,GAAAF,IAAA;EAC/B,IAAIE,iBAAiB,KAAKC,SAAS,IAAIF,eAAe,KAAKE,SAAS,EAAE;IACpE,OAAOP,wBAAwB,CAACE,YAAY;EAC9C;EACA,OAAOF,wBAAwB,CAACC,UAAU;AAC5C,CAAC;AA4BD,OAAO,MAAMO,cAAc,GAAGC,KAAA,IAImB;EAAA,IAJX;IACpCC,YAAY;IACZC,KAAK;IACLC;EACsB,CAAC,GAAAH,KAAA;EACvB,MAAMI,WAAW,GAAGd,OAAO,CAAC,MAAM;IAChC,IAAIa,YAAY,KAAKZ,wBAAwB,CAACC,UAAU,EAAE;MACxD,OAAO;QAAEU;MAAM,CAAC;IAClB;IACA,OAAO;MAAED;IAAa,CAAC;EACzB,CAAC,EAAE,CAACA,YAAY,EAAEC,KAAK,CAAC,CAAC;EACzB,OAAOE,WAAW;AACpB,CAAC"}
|
|
@@ -11,9 +11,9 @@ import _InputBase from "@mui/material/InputBase";
|
|
|
11
11
|
*
|
|
12
12
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
|
-
import { memo, useCallback, useMemo } from "react";
|
|
14
|
+
import { memo, useCallback, useMemo, useRef } from "react";
|
|
15
15
|
import { Field } from "../Field.js";
|
|
16
|
-
import {
|
|
16
|
+
import { ComponentControlledState, getControlState, useInputValues } from "../inputUtils.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
const VirtualizedAutocomplete = _ref => {
|
|
19
19
|
let {
|
|
@@ -40,6 +40,29 @@ const VirtualizedAutocomplete = _ref => {
|
|
|
40
40
|
getIsOptionEqualToValue,
|
|
41
41
|
testId
|
|
42
42
|
} = _ref;
|
|
43
|
+
const controlledStateRef = useRef(getControlState({
|
|
44
|
+
controlledValue: value,
|
|
45
|
+
uncontrolledValue: defaultValue
|
|
46
|
+
}));
|
|
47
|
+
const defaultValueProp = useMemo(() => {
|
|
48
|
+
if (hasMultipleChoices) {
|
|
49
|
+
return defaultValue === undefined ? [] : defaultValue;
|
|
50
|
+
}
|
|
51
|
+
return defaultValue ?? undefined;
|
|
52
|
+
}, [defaultValue, hasMultipleChoices]);
|
|
53
|
+
const valueProps = useInputValues({
|
|
54
|
+
defaultValue: defaultValueProp,
|
|
55
|
+
value: value,
|
|
56
|
+
controlState: controlledStateRef.current
|
|
57
|
+
});
|
|
58
|
+
const inputValueProp = useMemo(() => {
|
|
59
|
+
if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {
|
|
60
|
+
return {
|
|
61
|
+
inputValue
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}, [inputValue]);
|
|
43
66
|
const renderInput = useCallback(_ref2 => {
|
|
44
67
|
let {
|
|
45
68
|
InputLabelProps,
|
|
@@ -77,32 +100,17 @@ const VirtualizedAutocomplete = _ref => {
|
|
|
77
100
|
}
|
|
78
101
|
});
|
|
79
102
|
}, [errorMessage, hint, isOptional, label, nameOverride]);
|
|
80
|
-
const defaultValuesProp = useMemo(() => {
|
|
81
|
-
if (hasMultipleChoices) {
|
|
82
|
-
return defaultValue === undefined ? [] : defaultValue;
|
|
83
|
-
}
|
|
84
|
-
return defaultValue ?? undefined;
|
|
85
|
-
}, [defaultValue, hasMultipleChoices]);
|
|
86
|
-
const [localValue, setLocalValue] = useControlledState({
|
|
87
|
-
controlledValue: value,
|
|
88
|
-
uncontrolledValue: defaultValuesProp
|
|
89
|
-
});
|
|
90
|
-
const [localInputValue, setLocalInputValue] = useControlledState({
|
|
91
|
-
controlledValue: inputValue,
|
|
92
|
-
uncontrolledValue: undefined
|
|
93
|
-
});
|
|
94
103
|
const onChange = useCallback((event, value, reason, details) => {
|
|
95
|
-
setLocalValue(value);
|
|
96
104
|
onChangeProp?.(event, value, reason, details);
|
|
97
|
-
}, [onChangeProp
|
|
105
|
+
}, [onChangeProp]);
|
|
98
106
|
const onInputChange = useCallback((event, value, reason) => {
|
|
99
|
-
setLocalInputValue(value);
|
|
100
107
|
onInputChangeProp?.(event, value, reason);
|
|
101
|
-
}, [onInputChangeProp
|
|
108
|
+
}, [onInputChangeProp]);
|
|
102
109
|
return _jsx(_Autocomplete, {
|
|
110
|
+
...valueProps,
|
|
111
|
+
...inputValueProp,
|
|
103
112
|
"aria-disabled": isDisabled,
|
|
104
113
|
"data-se": testId,
|
|
105
|
-
defaultValue: defaultValuesProp,
|
|
106
114
|
disableCloseOnSelect: hasMultipleChoices,
|
|
107
115
|
disabled: isDisabled,
|
|
108
116
|
freeSolo: isCustomValueAllowed,
|
|
@@ -118,8 +126,6 @@ const VirtualizedAutocomplete = _ref => {
|
|
|
118
126
|
options: options,
|
|
119
127
|
readOnly: isReadOnly,
|
|
120
128
|
renderInput: renderInput,
|
|
121
|
-
value: localValue,
|
|
122
|
-
inputValue: localInputValue,
|
|
123
129
|
isOptionEqualToValue: getIsOptionEqualToValue
|
|
124
130
|
});
|
|
125
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualizedAutocomplete.js","names":["memo","useCallback","useMemo","Field","useControlledState","jsx","_jsx","VirtualizedAutocomplete","_ref","defaultValue","errorMessage","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isLoading","isOptional","isReadOnly","hint","label","ListboxComponent","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","value","getIsOptionEqualToValue","testId","renderInput","_ref2","InputLabelProps","InputProps","params","fieldType","hasVisibleLabel","htmlFor","renderFieldComponent","_ref3","ariaDescribedBy","errorMessageElementId","labelElementId","_InputBase","inputProps","required","defaultValuesProp","undefined","localValue","setLocalValue","controlledValue","uncontrolledValue","localInputValue","setLocalInputValue","event","reason","details","_Autocomplete","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","loading","multiple","readOnly","isOptionEqualToValue","MemoizedAutocomplete","displayName"],"sources":["../../src/labs/VirtualizedAutocomplete.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n InputBase,\n UseAutocompleteProps,\n AutocompleteValue,\n} from \"@mui/material\";\nimport { memo, useCallback, useMemo } from \"react\";\n\nimport { Field } from \"../Field\";\nimport { FieldComponentProps } from \"../FieldComponentProps\";\nimport type { SeleniumProps } from \"../SeleniumProps\";\nimport { useControlledState } from \"../useControlledState\";\n\nexport type AutocompleteProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n> = {\n /**\n * The default value. Use when the component is not controlled.\n * @default props.multiple ? [] : null\n */\n defaultValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"defaultValue\"];\n /**\n * Enables multiple choice selection\n */\n hasMultipleChoices?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"multiple\"];\n /**\n * The value for the input\n */\n inputValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"inputValue\"];\n /**\n * Allows the input of custom values\n */\n isCustomValueAllowed?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"freeSolo\"];\n /**\n * Disables the Autocomplete input\n */\n isDisabled?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"disabled\"];\n /**\n * Displays a loading indicator\n */\n isLoading?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"loading\"];\n /**\n * Makes the Autocomplete input read-only\n */\n isReadOnly?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"readOnly\"];\n /**\n * The label text for the autocomplete input\n */\n label: string;\n /**\n * The component used to render the listbox.\n */\n ListboxComponent?: React.JSXElementConstructor<\n React.HTMLAttributes<HTMLElement>\n >;\n /**\n * Callback fired when the autocomplete loses focus.\n */\n onBlur?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onBlur\"];\n /**\n * Callback fired when a selection is made.\n */\n onChange?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"];\n /**\n * Callback fired when the textbox receives typed characters.\n */\n onInputChange?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"];\n /**\n * Callback fired when the autocomplete gains focus.\n */\n onFocus?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onFocus\"];\n /**\n * The options for the Autocomplete input\n */\n options: ReadonlyArray<OptionType>;\n /**\n * The value of the Autocomplete input\n */\n value?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"value\"];\n\n /**\n * Used to determine if the option represents the given value. Uses strict equality by default if none provided.\n * Both arguments need to be handled, an option can only match with one value.\n * option: the option to test\n * value: the value to test against\n *\n * You will need to implement this function if your `option` items are objects.\n */\n getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;\n} & Pick<\n FieldComponentProps,\n \"errorMessage\" | \"hint\" | \"id\" | \"isOptional\" | \"name\"\n> &\n SeleniumProps;\n\nconst VirtualizedAutocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n>({\n defaultValue,\n errorMessage,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isLoading,\n isOptional = false,\n isReadOnly,\n hint,\n label,\n ListboxComponent,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n getIsOptionEqualToValue,\n testId,\n}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const renderInput = useCallback(\n ({ InputLabelProps, InputProps, ...params }) => (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n id={InputLabelProps.htmlFor}\n hint={hint}\n label={label}\n isOptional={isOptional}\n renderFieldComponent={({\n ariaDescribedBy,\n id,\n errorMessageElementId,\n labelElementId,\n }) => (\n <InputBase\n {...params}\n {...InputProps}\n inputProps={{\n ...params.inputProps,\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n }}\n aria-describedby={ariaDescribedBy}\n id={id}\n name={nameOverride ?? id}\n required={!isOptional}\n />\n )}\n />\n ),\n [errorMessage, hint, isOptional, label, nameOverride]\n );\n\n const defaultValuesProp = useMemo<\n | AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >\n | undefined\n >(() => {\n if (hasMultipleChoices) {\n return defaultValue === undefined\n ? ([] as AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >)\n : defaultValue;\n }\n return defaultValue ?? undefined;\n }, [defaultValue, hasMultipleChoices]);\n\n const [localValue, setLocalValue] = useControlledState({\n controlledValue: value,\n uncontrolledValue: defaultValuesProp,\n });\n\n const [localInputValue, setLocalInputValue] = useControlledState({\n controlledValue: inputValue,\n uncontrolledValue: undefined,\n });\n\n const onChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"]\n >\n >(\n (event, value, reason, details) => {\n setLocalValue(value);\n onChangeProp?.(event, value, reason, details);\n },\n [onChangeProp, setLocalValue]\n );\n\n const onInputChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"]\n >\n >(\n (event, value, reason) => {\n setLocalInputValue(value);\n onInputChangeProp?.(event, value, reason);\n },\n [onInputChangeProp, setLocalInputValue]\n );\n\n return (\n <MuiAutocomplete\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n data-se={testId}\n defaultValue={defaultValuesProp}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n id={idOverride}\n ListboxComponent={ListboxComponent}\n loading={isLoading}\n multiple={hasMultipleChoices}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n value={localValue}\n inputValue={localInputValue}\n isOptionEqualToValue={getIsOptionEqualToValue}\n />\n );\n};\n\n// Need the `typeof Autocomplete` because generics don't get passed through\nconst MemoizedAutocomplete = memo(\n VirtualizedAutocomplete\n) as typeof VirtualizedAutocomplete;\n// @ts-expect-error displayName is expected to not be on `typeof Autocomplete`\nMemoizedAutocomplete.displayName = \"Autocomplete\";\n\nexport { MemoizedAutocomplete as VirtualizedAutocomplete };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA,SAASA,IAAI,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAE1CC,KAAK;AAAA,SAGLC,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAkJ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AE0C,iBAAkB;IAChCY,oBAAoB,EAAEpD,kBAAmB;IACzCqD,QAAQ,EAAEhD,UAAW;IACrBiD,QAAQ,EAAElD,oBAAqB;IAC/BmD,qBAAqB,EAAE,IAAK;IAC5BtD,EAAE,EAAEC,UAAW;IACfS,gBAAgB,EAAEA,gBAAiB;IACnC6C,OAAO,EAAElD,SAAU;IACnBmD,QAAQ,EAAEzD,kBAAmB;IAC7Bc,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBE,aAAa,EAAEA,aAAc;IAC7BE,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBsC,QAAQ,EAAElD,UAAW;IACrBgB,WAAW,EAAEA,WAAY;IACzBH,KAAK,EAAEqB,UAAW;IAClBvC,UAAU,EAAE2C,eAAgB;IAC5Ba,oBAAoB,EAAErC;EAAwB,CAC/C,CAAC;AAEN,CAAC;AAGD,MAAMsC,oBAAoB,GAAGvE,IAAI,CAC/BO,uBACF,CAAmC;AAEnCgE,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIhE,uBAAuB"}
|
|
1
|
+
{"version":3,"file":"VirtualizedAutocomplete.js","names":["memo","useCallback","useMemo","useRef","Field","ComponentControlledState","getControlState","useInputValues","jsx","_jsx","VirtualizedAutocomplete","_ref","defaultValue","errorMessage","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isLoading","isOptional","isReadOnly","hint","label","ListboxComponent","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","value","getIsOptionEqualToValue","testId","controlledStateRef","controlledValue","uncontrolledValue","defaultValueProp","undefined","valueProps","controlState","current","inputValueProp","CONTROLLED","renderInput","_ref2","InputLabelProps","InputProps","params","fieldType","hasVisibleLabel","htmlFor","renderFieldComponent","_ref3","ariaDescribedBy","errorMessageElementId","labelElementId","_InputBase","inputProps","required","event","reason","details","_Autocomplete","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","loading","multiple","readOnly","isOptionEqualToValue","MemoizedAutocomplete","displayName"],"sources":["../../src/labs/VirtualizedAutocomplete.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n InputBase,\n UseAutocompleteProps,\n AutocompleteValue,\n} from \"@mui/material\";\nimport { memo, useCallback, useMemo, useRef } from \"react\";\n\nimport { Field } from \"../Field\";\nimport { FieldComponentProps } from \"../FieldComponentProps\";\nimport type { SeleniumProps } from \"../SeleniumProps\";\nimport {\n ComponentControlledState,\n getControlState,\n useInputValues,\n} from \"../inputUtils\";\n\nexport type AutocompleteProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n> = {\n /**\n * The default value. Use when the component is not controlled.\n * @default props.multiple ? [] : null\n */\n defaultValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"defaultValue\"];\n /**\n * Enables multiple choice selection\n */\n hasMultipleChoices?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"multiple\"];\n /**\n * The value for the input\n */\n inputValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"inputValue\"];\n /**\n * Allows the input of custom values\n */\n isCustomValueAllowed?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"freeSolo\"];\n /**\n * Disables the Autocomplete input\n */\n isDisabled?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"disabled\"];\n /**\n * Displays a loading indicator\n */\n isLoading?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"loading\"];\n /**\n * Makes the Autocomplete input read-only\n */\n isReadOnly?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"readOnly\"];\n /**\n * The label text for the autocomplete input\n */\n label: string;\n /**\n * The component used to render the listbox.\n */\n ListboxComponent?: React.JSXElementConstructor<\n React.HTMLAttributes<HTMLElement>\n >;\n /**\n * Callback fired when the autocomplete loses focus.\n */\n onBlur?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onBlur\"];\n /**\n * Callback fired when a selection is made.\n */\n onChange?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"];\n /**\n * Callback fired when the textbox receives typed characters.\n */\n onInputChange?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"];\n /**\n * Callback fired when the autocomplete gains focus.\n */\n onFocus?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onFocus\"];\n /**\n * The options for the Autocomplete input\n */\n options: ReadonlyArray<OptionType>;\n /**\n * The value of the Autocomplete input\n */\n value?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"value\"];\n\n /**\n * Used to determine if the option represents the given value. Uses strict equality by default if none provided.\n * Both arguments need to be handled, an option can only match with one value.\n * option: the option to test\n * value: the value to test against\n *\n * You will need to implement this function if your `option` items are objects.\n */\n getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;\n} & Pick<\n FieldComponentProps,\n \"errorMessage\" | \"hint\" | \"id\" | \"isOptional\" | \"name\"\n> &\n SeleniumProps;\n\nconst VirtualizedAutocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n>({\n defaultValue,\n errorMessage,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isLoading,\n isOptional = false,\n isReadOnly,\n hint,\n label,\n ListboxComponent,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n getIsOptionEqualToValue,\n testId,\n}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const controlledStateRef = useRef(\n getControlState({ controlledValue: value, uncontrolledValue: defaultValue })\n );\n const defaultValueProp = useMemo<\n | AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >\n | undefined\n >(() => {\n if (hasMultipleChoices) {\n return defaultValue === undefined\n ? ([] as AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >)\n : defaultValue;\n }\n return defaultValue ?? undefined;\n }, [defaultValue, hasMultipleChoices]);\n\n const valueProps = useInputValues({\n defaultValue: defaultValueProp,\n value: value,\n controlState: controlledStateRef.current,\n });\n\n const inputValueProp = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { inputValue };\n }\n return undefined;\n }, [inputValue]);\n\n const renderInput = useCallback(\n ({ InputLabelProps, InputProps, ...params }) => (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n id={InputLabelProps.htmlFor}\n hint={hint}\n label={label}\n isOptional={isOptional}\n renderFieldComponent={({\n ariaDescribedBy,\n id,\n errorMessageElementId,\n labelElementId,\n }) => (\n <InputBase\n {...params}\n {...InputProps}\n inputProps={{\n ...params.inputProps,\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n }}\n aria-describedby={ariaDescribedBy}\n id={id}\n name={nameOverride ?? id}\n required={!isOptional}\n />\n )}\n />\n ),\n [errorMessage, hint, isOptional, label, nameOverride]\n );\n const onChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"]\n >\n >(\n (event, value, reason, details) => {\n onChangeProp?.(event, value, reason, details);\n },\n [onChangeProp]\n );\n\n const onInputChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"]\n >\n >(\n (event, value, reason) => {\n onInputChangeProp?.(event, value, reason);\n },\n [onInputChangeProp]\n );\n\n return (\n <MuiAutocomplete\n {...valueProps}\n {...inputValueProp}\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n data-se={testId}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n id={idOverride}\n ListboxComponent={ListboxComponent}\n loading={isLoading}\n multiple={hasMultipleChoices}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n isOptionEqualToValue={getIsOptionEqualToValue}\n />\n );\n};\n\n// Need the `typeof Autocomplete` because generics don't get passed through\nconst MemoizedAutocomplete = memo(\n VirtualizedAutocomplete\n) as typeof VirtualizedAutocomplete;\n// @ts-expect-error displayName is expected to not be on `typeof Autocomplete`\nMemoizedAutocomplete.displayName = \"Autocomplete\";\n\nexport { MemoizedAutocomplete as VirtualizedAutocomplete };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA,SAASA,IAAI,EAAEC,WAAW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W,CAU/B,CAAC+D,KAAK,EAAE7B,KAAK,EAAE8B,MAAM,KAAK;IACxBjC,iBAAiB,GAAGgC,KAAK,EAAE7B,KAAK,EAAE8B,MAAM,CAAC;EAC3C,CAAC,EACD,CAACjC,iBAAiB,CACpB,CAAC;EAED,OACEvB,IAAA,CAAA0D,aAAA;IAAA,GACMxB,UAAU;IAAA,GACVG,cAAc;IAElB,iBAAe3B,UAAW;IAC1B,WAASkB,MAAO;IAChB+B,oBAAoB,EAAEtD,kBAAmB;IACzCuD,QAAQ,EAAElD,UAAW;IACrBmD,QAAQ,EAAEpD,oBAAqB;IAC/BqD,qBAAqB,EAAE,IAAK;IAC5BxD,EAAE,EAAEC,UAAW;IACfS,gBAAgB,EAAEA,gBAAiB;IACnC+C,OAAO,EAAEpD,SAAU;IACnBqD,QAAQ,EAAE3D,kBAAmB;IAC7Bc,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBE,aAAa,EAAEA,aAAc;IAC7BE,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBwC,QAAQ,EAAEpD,UAAW;IACrB0B,WAAW,EAAEA,WAAY;IACzB2B,oBAAoB,EAAEvC;EAAwB,CAC/C,CAAC;AAEN,CAAC;AAGD,MAAMwC,oBAAoB,GAAG5E,IAAI,CAC/BU,uBACF,CAAmC;AAEnCkE,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIlE,uBAAuB"}
|
|
@@ -15,7 +15,6 @@ import type { SeleniumProps } from "./SeleniumProps";
|
|
|
15
15
|
export type AutocompleteProps<OptionType, HasMultipleChoices extends boolean | undefined, IsCustomValueAllowed extends boolean | undefined> = {
|
|
16
16
|
/**
|
|
17
17
|
* The default value. Use when the component is not controlled.
|
|
18
|
-
* @default props.multiple ? [] : null
|
|
19
18
|
*/
|
|
20
19
|
defaultValue?: UseAutocompleteProps<OptionType, HasMultipleChoices, undefined, IsCustomValueAllowed>["defaultValue"];
|
|
21
20
|
/**
|
|
@@ -79,7 +78,7 @@ export type AutocompleteProps<OptionType, HasMultipleChoices extends boolean | u
|
|
|
79
78
|
* You will need to implement this function if your `option` items are objects.
|
|
80
79
|
*/
|
|
81
80
|
getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;
|
|
82
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "id" | "isOptional" | "name"> & SeleniumProps;
|
|
83
|
-
declare const MemoizedAutocomplete: <OptionType, HasMultipleChoices extends boolean | undefined, IsCustomValueAllowed extends boolean | undefined>({ defaultValue, errorMessage, hasMultipleChoices, id: idOverride, inputValue, isCustomValueAllowed, isDisabled, isLoading, isOptional, isReadOnly, hint, label, name: nameOverride, onBlur, onChange: onChangeProp, onInputChange: onInputChangeProp, onFocus, options, value, getIsOptionEqualToValue, testId, }: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => JSX.Element;
|
|
81
|
+
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "id" | "isOptional" | "name" | "isFullWidth"> & SeleniumProps;
|
|
82
|
+
declare const MemoizedAutocomplete: <OptionType, HasMultipleChoices extends boolean | undefined, IsCustomValueAllowed extends boolean | undefined>({ defaultValue, errorMessage, hasMultipleChoices, id: idOverride, inputValue, isCustomValueAllowed, isDisabled, isFullWidth, isLoading, isOptional, isReadOnly, hint, label, name: nameOverride, onBlur, onChange: onChangeProp, onInputChange: onInputChangeProp, onFocus, options, value, getIsOptionEqualToValue, testId, }: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => JSX.Element;
|
|
84
83
|
export { MemoizedAutocomplete as Autocomplete };
|
|
85
84
|
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/Autocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,iBAAiB,IAAI,oBA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BAA4C,CAAC;AAIvE,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAIH,OAAO,EAEL,aAAa,IAAI,gBAAgB,EAGlC,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,sBAAsB,0CAA2C,CAAC;AAE/E,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;IACnD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,CAAC,GACzD,iBAAiB,CAAC,gBAAgB,CAAC,GACnC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/Checkbox.tsx"],"names":[],"mappings":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
|
+
/**
|
|
48
|
+
* If `true`, the component can stretch to fill the width of the container.
|
|
49
|
+
*/
|
|
50
|
+
isFullWidth?: boolean;
|
|
47
51
|
/**
|
|
48
52
|
* If `true`, the `input` element is not required.
|
|
49
53
|
*/
|
|
@@ -67,6 +71,6 @@ export type FieldProps = {
|
|
|
67
71
|
labelElementId: string;
|
|
68
72
|
}) => ReactElement;
|
|
69
73
|
};
|
|
70
|
-
declare const MemoizedField: import("react").MemoExoticComponent<({ errorMessage, fieldType, hasVisibleLabel, hint, id: idOverride, isDisabled: isDisabledProp, isRadioGroup, isOptional, label, renderFieldComponent, }: FieldProps) => JSX.Element>;
|
|
74
|
+
declare const MemoizedField: import("react").MemoExoticComponent<({ errorMessage, fieldType, hasVisibleLabel, hint, id: idOverride, isDisabled: isDisabledProp, isFullWidth, isRadioGroup, isOptional, label, renderFieldComponent, }: FieldProps) => JSX.Element>;
|
|
71
75
|
export { MemoizedField as Field };
|
|
72
76
|
//# sourceMappingURL=Field.d.ts.map
|
package/dist/src/Field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/Field.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,YAAY,EAAW,MAAM,OAAO,CAAC;AAcpD,eAAO,MAAM,eAAe,8BAA+B,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5C;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,eAAe,CA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EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,oBAAoB,EAAE,CAAC,EACrB,eAAe,EACf,MAAM,EACN,qBAAqB,EACrB,EAAE,EACF,cAAc,GACf,EAAE;QACD,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC;QACX,cAAc,EAAE,MAAM,CAAC;KACxB,KAAK,YAAY,CAAC;CACpB,CAAC;AA6EF,QAAA,MAAM,aAAa,4MA/DhB,UAAU,iBA+DoB,CAAC;AAGlC,OAAO,EAAE,aAAa,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -26,6 +26,10 @@ export type FieldComponentProps = {
|
|
|
26
26
|
* If `true`, the component is disabled.
|
|
27
27
|
*/
|
|
28
28
|
isDisabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, the component can stretch to fill the width of the container.
|
|
31
|
+
*/
|
|
32
|
+
isFullWidth?: boolean;
|
|
29
33
|
/**
|
|
30
34
|
* If `true`, the `input` element is not required.
|
|
31
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldComponentProps.d.ts","sourceRoot":"","sources":["../../src/FieldComponentProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"FieldComponentProps.d.ts","sourceRoot":"","sources":["../../src/FieldComponentProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -9,62 +9,35 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { ReactElement } from "react";
|
|
12
|
+
import React, { ReactElement } from "react";
|
|
13
13
|
import { SelectProps as MuiSelectProps } from "@mui/material";
|
|
14
14
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
15
15
|
import type { SeleniumProps } from "./SeleniumProps";
|
|
16
|
+
import { ForwardRefWithType } from "./@types/react-augment";
|
|
16
17
|
export type NativeSelectOption = {
|
|
17
18
|
text: string;
|
|
18
19
|
value?: string;
|
|
19
20
|
type?: "heading" | "option";
|
|
20
21
|
};
|
|
21
|
-
export type
|
|
22
|
+
export type NativeSelectValueType<HasMultipleChoices> = HasMultipleChoices extends true ? string[] : string;
|
|
23
|
+
export type NativeSelectProps<Value extends NativeSelectValueType<HasMultipleChoices>, HasMultipleChoices extends boolean> = {
|
|
22
24
|
/**
|
|
23
25
|
* The options or optgroup elements within the NativeSelect
|
|
24
26
|
*/
|
|
25
27
|
children?: ReactElement<"option"> | ReactElement<"optgroup">;
|
|
26
28
|
/**
|
|
27
|
-
* The default value of the NativeSelect.
|
|
29
|
+
* The default value of the NativeSelect. Use when component is uncontrolled
|
|
28
30
|
*/
|
|
29
|
-
defaultValue?:
|
|
31
|
+
defaultValue?: Value;
|
|
30
32
|
/**
|
|
31
|
-
* If `true`, the
|
|
33
|
+
* If `true`, the Select allows multiple selections
|
|
32
34
|
*/
|
|
33
|
-
|
|
35
|
+
hasMultipleChoices?: HasMultipleChoices;
|
|
34
36
|
/**
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
label: string;
|
|
38
|
-
/**
|
|
39
|
-
* Callback fired when the NativeSelect loses focus
|
|
40
|
-
*/
|
|
41
|
-
onBlur?: MuiSelectProps["onBlur"];
|
|
42
|
-
/**
|
|
43
|
-
* Callback fired when the value of the NativeSelect changes
|
|
44
|
-
*/
|
|
45
|
-
onChange?: MuiSelectProps["onChange"];
|
|
46
|
-
/**
|
|
47
|
-
* Callback fired when the NativeSelect gains focus
|
|
48
|
-
*/
|
|
49
|
-
onFocus?: MuiSelectProps["onFocus"];
|
|
50
|
-
/**
|
|
51
|
-
* The value or values selected in the NativeSelect
|
|
52
|
-
*/
|
|
53
|
-
value?: string | string[];
|
|
54
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "id" | "isDisabled" | "isOptional"> & SeleniumProps;
|
|
55
|
-
declare const MemoizedNativeSelect: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<{
|
|
56
|
-
/**
|
|
57
|
-
* The options or optgroup elements within the NativeSelect
|
|
58
|
-
*/
|
|
59
|
-
children?: ReactElement<"option", string | import("react").JSXElementConstructor<any>> | ReactElement<"optgroup", string | import("react").JSXElementConstructor<any>> | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* The default value of the NativeSelect. Only applicable if `value` is not provided
|
|
62
|
-
*/
|
|
63
|
-
defaultValue?: string | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* If `true`, the NativeSelect allows multiple selections
|
|
37
|
+
* @deprecated Use `hasMultipleChoices` instead
|
|
66
38
|
*/
|
|
67
|
-
|
|
39
|
+
/** **Deprecated:** use `hasMultipleChoices` */
|
|
40
|
+
isMultiSelect?: HasMultipleChoices;
|
|
68
41
|
/**
|
|
69
42
|
* The label text for the NativeSelect
|
|
70
43
|
*/
|
|
@@ -72,19 +45,21 @@ declare const MemoizedNativeSelect: import("react").MemoExoticComponent<import("
|
|
|
72
45
|
/**
|
|
73
46
|
* Callback fired when the NativeSelect loses focus
|
|
74
47
|
*/
|
|
75
|
-
onBlur?: MuiSelectProps["onBlur"];
|
|
48
|
+
onBlur?: MuiSelectProps<Value>["onBlur"];
|
|
76
49
|
/**
|
|
77
50
|
* Callback fired when the value of the NativeSelect changes
|
|
78
51
|
*/
|
|
79
|
-
onChange?: MuiSelectProps["onChange"];
|
|
52
|
+
onChange?: MuiSelectProps<Value>["onChange"];
|
|
80
53
|
/**
|
|
81
54
|
* Callback fired when the NativeSelect gains focus
|
|
82
55
|
*/
|
|
83
|
-
onFocus?: MuiSelectProps["onFocus"];
|
|
56
|
+
onFocus?: MuiSelectProps<Value>["onFocus"];
|
|
57
|
+
options: Value;
|
|
84
58
|
/**
|
|
85
|
-
* The value or values selected in the NativeSelect
|
|
59
|
+
* The value or values selected in the NativeSelect. Use when component is controlled
|
|
86
60
|
*/
|
|
87
|
-
value?:
|
|
88
|
-
} & Pick<FieldComponentProps, "
|
|
61
|
+
value?: Value;
|
|
62
|
+
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "id" | "isDisabled" | "isOptional" | "isFullWidth"> & SeleniumProps;
|
|
63
|
+
declare const MemoizedNativeSelect: React.MemoExoticComponent<ForwardRefWithType>;
|
|
89
64
|
export { MemoizedNativeSelect as NativeSelect };
|
|
90
65
|
//# sourceMappingURL=NativeSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeSelect.d.ts","sourceRoot":"","sources":["../../src/NativeSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"NativeSelect.d.ts","sourceRoot":"","sources":["../../src/NativeSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EACZ,YAAY,EAMb,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,WAAW,IAAI,cAAc,EAC9B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,kBAAkB,IAClD,kBAAkB,SAAS,IAAI,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,iBAAiB,CAC3B,KAAK,SAAS,qBAAqB,CAAC,kBAAkB,CAAC,EACvD,kBAAkB,SAAS,OAAO,IAChC;IACF;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IAC7D;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB;;OAEG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;OAEG;IACH,+CAA+C;IAC/C,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC;IAC7C;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,GAAG,IAAI,CACN,mBAAmB,EACnB,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa,CAC7E,GACC,aAAa,CAAC;AA0GhB,QAAA,MAAM,oBAAoB,+CAAqB,CAAC;AAGhD,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -19,6 +19,10 @@ export type PasswordFieldProps = {
|
|
|
19
19
|
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
20
20
|
*/
|
|
21
21
|
autoCompleteType?: "current-password" | "new-password";
|
|
22
|
+
/**
|
|
23
|
+
* initial value for input. Use when component in uncontrolled.
|
|
24
|
+
*/
|
|
25
|
+
defaultValue?: string;
|
|
22
26
|
/**
|
|
23
27
|
* If `true`, the component will receive focus automatically.
|
|
24
28
|
*/
|
|
@@ -48,7 +52,7 @@ export type PasswordFieldProps = {
|
|
|
48
52
|
*/
|
|
49
53
|
placeholder?: string;
|
|
50
54
|
/**
|
|
51
|
-
* The value of the `input` element
|
|
55
|
+
* The value of the `input` element. Use when component is controlled.
|
|
52
56
|
*/
|
|
53
57
|
value?: string;
|
|
54
58
|
} & FieldComponentProps & SeleniumProps;
|
|
@@ -59,6 +63,10 @@ declare const MemoizedPasswordField: import("react").MemoExoticComponent<import(
|
|
|
59
63
|
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
60
64
|
*/
|
|
61
65
|
autoCompleteType?: "current-password" | "new-password" | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* initial value for input. Use when component in uncontrolled.
|
|
68
|
+
*/
|
|
69
|
+
defaultValue?: string | undefined;
|
|
62
70
|
/**
|
|
63
71
|
* If `true`, the component will receive focus automatically.
|
|
64
72
|
*/
|
|
@@ -88,7 +96,7 @@ declare const MemoizedPasswordField: import("react").MemoExoticComponent<import(
|
|
|
88
96
|
*/
|
|
89
97
|
placeholder?: string | undefined;
|
|
90
98
|
/**
|
|
91
|
-
* The value of the `input` element
|
|
99
|
+
* The value of the `input` element. Use when component is controlled.
|
|
92
100
|
*/
|
|
93
101
|
value?: string | undefined;
|
|
94
102
|
} & FieldComponentProps & SeleniumProps & import("react").RefAttributes<HTMLInputElement>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../src/PasswordField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../src/PasswordField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAAC;IACvD;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;IACnE;;OAEG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IACtE;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;IACpE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,mBAAmB,GACrB,aAAa,CAAC;AAyIhB,QAAA,MAAM,qBAAqB;IApLzB;;;;OAIG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;WACI,MAAM;IACb;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;2FA4I4C,CAAC;AAGlD,OAAO,EAAE,qBAAqB,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/RadioGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,KAAK,eAAe,IAAI,kBAAkB,EAC3C,MAAM,eAAe,CAAC;AACvB,OAAO,EAAQ,YAAY,
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/RadioGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,KAAK,eAAe,IAAI,kBAAkB,EAC3C,MAAM,eAAe,CAAC;AACvB,OAAO,EAAQ,YAAY,EAAuB,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC7B,GAAG,IAAI,CACN,mBAAmB,EACnB,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,GAAG,MAAM,CACvD,GACC,aAAa,CAAC;AA8DhB,QAAA,MAAM,kBAAkB,sLAhDrB,eAAe,iBAgDyB,CAAC;AAG5C,OAAO,EAAE,kBAAkB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -19,6 +19,10 @@ export type SearchFieldProps = {
|
|
|
19
19
|
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
20
20
|
*/
|
|
21
21
|
autoCompleteType?: InputHTMLAttributes<HTMLInputElement>["autoComplete"];
|
|
22
|
+
/**
|
|
23
|
+
* The value of the `input` element to use when uncontrolled.
|
|
24
|
+
*/
|
|
25
|
+
defaultValue?: string;
|
|
22
26
|
/**
|
|
23
27
|
* If `true`, the component will receive focus automatically.
|
|
24
28
|
*/
|
|
@@ -56,10 +60,10 @@ export type SearchFieldProps = {
|
|
|
56
60
|
*/
|
|
57
61
|
placeholder?: string;
|
|
58
62
|
/**
|
|
59
|
-
* The value of the `input` element,
|
|
63
|
+
* The value of the `input` element, to use when controlled.
|
|
60
64
|
*/
|
|
61
65
|
value?: string;
|
|
62
|
-
} & Pick<FieldComponentProps, "id" | "isDisabled" | "name"> & SeleniumProps;
|
|
66
|
+
} & Pick<FieldComponentProps, "id" | "isDisabled" | "name" | "isFullWidth"> & SeleniumProps;
|
|
63
67
|
declare const MemoizedSearchField: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<{
|
|
64
68
|
/**
|
|
65
69
|
* This prop helps users to fill forms faster, especially on mobile devices.
|
|
@@ -67,6 +71,10 @@ declare const MemoizedSearchField: import("react").MemoExoticComponent<import("r
|
|
|
67
71
|
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
68
72
|
*/
|
|
69
73
|
autoCompleteType?: InputHTMLAttributes<HTMLInputElement>["autoComplete"];
|
|
74
|
+
/**
|
|
75
|
+
* The value of the `input` element to use when uncontrolled.
|
|
76
|
+
*/
|
|
77
|
+
defaultValue?: string | undefined;
|
|
70
78
|
/**
|
|
71
79
|
* If `true`, the component will receive focus automatically.
|
|
72
80
|
*/
|
|
@@ -104,9 +112,9 @@ declare const MemoizedSearchField: import("react").MemoExoticComponent<import("r
|
|
|
104
112
|
*/
|
|
105
113
|
placeholder?: string | undefined;
|
|
106
114
|
/**
|
|
107
|
-
* The value of the `input` element,
|
|
115
|
+
* The value of the `input` element, to use when controlled.
|
|
108
116
|
*/
|
|
109
117
|
value?: string | undefined;
|
|
110
|
-
} & Pick<FieldComponentProps, "id" | "name" | "isDisabled"> & SeleniumProps & import("react").RefAttributes<HTMLInputElement>>>;
|
|
118
|
+
} & Pick<FieldComponentProps, "id" | "name" | "isDisabled" | "isFullWidth"> & SeleniumProps & import("react").RefAttributes<HTMLInputElement>>>;
|
|
111
119
|
export { MemoizedSearchField as SearchField };
|
|
112
120
|
//# sourceMappingURL=SearchField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.d.ts","sourceRoot":"","sources":["../../src/SearchField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"SearchField.d.ts","sourceRoot":"","sources":["../../src/SearchField.tsx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EH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;WACI,MAAM;IACb;;OAEG;;IAEH;;OAEG;qBACa,IAAI;IACpB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;+IAwHwC,CAAC;AAG9C,OAAO,EAAE,mBAAmB,IAAI,WAAW,EAAE,CAAC"}
|
package/dist/src/Select.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ export type SelectOption = {
|
|
|
20
20
|
};
|
|
21
21
|
export type SelectValueType<HasMultipleChoices> = HasMultipleChoices extends true ? string[] : string;
|
|
22
22
|
export type SelectProps<Value extends SelectValueType<HasMultipleChoices>, HasMultipleChoices extends boolean> = {
|
|
23
|
+
/**
|
|
24
|
+
* The default value. Use when the component is not controlled.
|
|
25
|
+
*/
|
|
26
|
+
defaultValue?: MuiSelectProps<Value>["defaultValue"];
|
|
23
27
|
/**
|
|
24
28
|
* If `true`, the Select allows multiple selections
|
|
25
29
|
*/
|
|
@@ -53,7 +57,7 @@ export type SelectProps<Value extends SelectValueType<HasMultipleChoices>, HasMu
|
|
|
53
57
|
* The value or values selected in the Select
|
|
54
58
|
*/
|
|
55
59
|
value?: Value;
|
|
56
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "id" | "isDisabled" | "isOptional" | "name"> & SeleniumProps;
|
|
57
|
-
declare const MemoizedSelect: import("react").MemoExoticComponent<(<Value extends SelectValueType<HasMultipleChoices>, HasMultipleChoices extends boolean>({ errorMessage, hasMultipleChoices: hasMultipleChoicesProp, hint, id: idOverride, isDisabled, isMultiSelect, isOptional, label, name: nameOverride, onBlur, onChange: onChangeProp, onFocus, options, testId, value, }: SelectProps<Value, HasMultipleChoices>) => JSX.Element)>;
|
|
60
|
+
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "id" | "isDisabled" | "isOptional" | "name" | "isFullWidth"> & SeleniumProps;
|
|
61
|
+
declare const MemoizedSelect: import("react").MemoExoticComponent<(<Value extends SelectValueType<HasMultipleChoices>, HasMultipleChoices extends boolean>({ defaultValue, errorMessage, hasMultipleChoices: hasMultipleChoicesProp, hint, id: idOverride, isDisabled, isFullWidth, isMultiSelect, isOptional, label, name: nameOverride, onBlur, onChange: onChangeProp, onFocus, options, testId, value, }: SelectProps<Value, HasMultipleChoices>) => JSX.Element)>;
|
|
58
62
|
export { MemoizedSelect as Select };
|
|
59
63
|
//# sourceMappingURL=Select.d.ts.map
|
package/dist/src/Select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAYH,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAYH,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOrD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,kBAAkB,IAC5C,kBAAkB,SAAS,IAAI,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,WAAW,CACrB,KAAK,SAAS,eAAe,CAAC,kBAAkB,CAAC,EACjD,kBAAkB,SAAS,OAAO,IAChC;IACF;;OAEG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC;IACrD;;OAEG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;OAEG;IACH,+CAA+C;IAC/C,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC;IAC7C;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3C;;OAEG;IACH,OAAO,EAAE,CAAC,MAAM,GAAG,YAAY,CAAC,EAAE,CAAC;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,GAAG,IAAI,CACN,mBAAmB,EACjB,cAAc,GACd,MAAM,GACN,IAAI,GACJ,YAAY,GACZ,YAAY,GACZ,MAAM,GACN,aAAa,CAChB,GACC,aAAa,CAAC;AA6MhB,QAAA,MAAM,cAAc,0aAAe,CAAC;AAGpC,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
|
package/dist/src/TextField.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ export type TextFieldProps = {
|
|
|
20
20
|
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
21
21
|
*/
|
|
22
22
|
autoCompleteType?: InputHTMLAttributes<HTMLInputElement>["autoComplete"];
|
|
23
|
+
/**
|
|
24
|
+
* The default value. Use when the component is not controlled.
|
|
25
|
+
*/
|
|
26
|
+
defaultValue?: string;
|
|
23
27
|
/**
|
|
24
28
|
* End `InputAdornment` for this component.
|
|
25
29
|
*/
|
|
@@ -72,6 +76,10 @@ declare const MemoizedTextField: import("react").MemoExoticComponent<import("rea
|
|
|
72
76
|
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
73
77
|
*/
|
|
74
78
|
autoCompleteType?: InputHTMLAttributes<HTMLInputElement>["autoComplete"];
|
|
79
|
+
/**
|
|
80
|
+
* The default value. Use when the component is not controlled.
|
|
81
|
+
*/
|
|
82
|
+
defaultValue?: string | undefined;
|
|
75
83
|
/**
|
|
76
84
|
* End `InputAdornment` for this component.
|
|
77
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/TextField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAEjB,mBAAmB,EAEnB,YAAY,
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/TextField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAEjB,mBAAmB,EAEnB,YAAY,EAGb,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,mBAAmB,oDAMtB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,cAAc,CAAC,CAAC;IACzE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACrC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;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