@okta/odyssey-react-mui 1.9.22 → 1.9.23
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 +4 -0
- package/dist/Autocomplete.js +3 -1
- package/dist/Autocomplete.js.map +1 -1
- package/dist/CheckboxGroup.js +2 -0
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/ErrorMessageList.js +45 -0
- package/dist/ErrorMessageList.js.map +1 -0
- package/dist/Field.js +6 -4
- package/dist/Field.js.map +1 -1
- package/dist/FieldComponentProps.js.map +1 -1
- package/dist/FieldError.js +9 -2
- package/dist/FieldError.js.map +1 -1
- package/dist/NativeSelect.js +2 -0
- package/dist/NativeSelect.js.map +1 -1
- package/dist/PasswordField.js +2 -0
- package/dist/PasswordField.js.map +1 -1
- package/dist/RadioGroup.js +2 -0
- package/dist/RadioGroup.js.map +1 -1
- package/dist/Select.js +2 -0
- package/dist/Select.js.map +1 -1
- package/dist/TextField.js +2 -0
- package/dist/TextField.js.map +1 -1
- package/dist/labs/VirtualizedAutocomplete.js +2 -0
- package/dist/labs/VirtualizedAutocomplete.js.map +1 -1
- package/dist/src/Autocomplete.d.ts +2 -2
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/CheckboxGroup.d.ts +2 -2
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/ErrorMessageList.d.ts +18 -0
- package/dist/src/ErrorMessageList.d.ts.map +1 -0
- package/dist/src/Field.d.ts +9 -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/FieldError.d.ts +3 -2
- package/dist/src/FieldError.d.ts.map +1 -1
- package/dist/src/NativeSelect.d.ts +1 -1
- package/dist/src/NativeSelect.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts +2 -2
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/Select.d.ts +2 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/src/labs/VirtualizedAutocomplete.d.ts +2 -2
- package/dist/src/labs/VirtualizedAutocomplete.d.ts.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Autocomplete.tsx +12 -1
- package/src/CheckboxGroup.tsx +7 -1
- package/src/ErrorMessageList.tsx +51 -0
- package/src/Field.tsx +22 -4
- package/src/FieldComponentProps.ts +4 -0
- package/src/FieldError.tsx +15 -3
- package/src/NativeSelect.tsx +3 -0
- package/src/PasswordField.tsx +2 -0
- package/src/RadioGroup.tsx +9 -1
- package/src/Select.tsx +3 -0
- package/src/TextField.tsx +2 -0
- package/src/labs/VirtualizedAutocomplete.tsx +3 -1
package/dist/Select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","names":["memo","useCallback","useEffect","useMemo","useRef","useState","useImperativeHandle","Field","CheckIcon","ComponentControlledState","useInputValues","getControlState","jsx","_jsx","jsxs","_jsxs","CONTROLLED","Select","_ref","defaultValue","errorMessage","hasMultipleChoices","hasMultipleChoicesProp","hint","HintLinkComponent","id","idOverride","inputFocusRef","isDisabled","isFullWidth","isMultiSelect","isOptional","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","options","testId","translate","value","undefined","controlledStateRef","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","current","inputRef","element","focus","inputValues","controlState","event","child","target","split","normalizedOptions","map","option","text","type","renderValue","selected","renderedChips","item","selectedOption","find","_Chip","filter","Boolean","length","_Box","children","_ListSubheader","_MenuItem","_Checkbox","checked","includes","_ListItemSecondaryAction","renderFieldComponent","_ref2","ariaDescribedBy","errorMessageElementId","labelElementId","_Select","labelId","multiple","fieldType","hasVisibleLabel","MemoizedSelect","displayName"],"sources":["../src/Select.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-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 memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from \"react\";\nimport {\n Box,\n Checkbox as MuiCheckbox,\n Chip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem,\n Select as MuiSelect,\n} from \"@mui/material\";\nimport { SelectProps as MuiSelectProps } from \"@mui/material\";\n\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { CheckIcon } from \"./icons.generated\";\nimport type { AllowedProps } from \"./AllowedProps\";\nimport {\n ComponentControlledState,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\nimport { FocusHandle } from \"./@types/react-augment\";\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n};\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select to expose focus()\n */\n inputFocusRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n AllowedProps;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean\n>({\n defaultValue,\n errorMessage,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputFocusRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect]\n );\n const controlledStateRef = useRef(\n getControlState({ controlledValue: value, uncontrolledValue: defaultValue })\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue\n );\n const inputRef = useRef<HTMLSelectElement>(null);\n\n useImperativeHandle(\n inputFocusRef,\n () => {\n const element = inputRef.current;\n return {\n focus: () => {\n element && element.focus();\n },\n };\n },\n []\n );\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" ? value.split(\",\") : value) as Value\n );\n }\n onChangeProp?.(event, child);\n },\n [onChangeProp]\n );\n\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const normalizedOptions = useMemo(\n () =>\n options.map((option) =>\n typeof option === \"object\"\n ? {\n text: option.text,\n value: option.value || option.text,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n }\n : { text: option, value: option, type: \"option\" }\n ),\n [options]\n );\n\n const renderValue = useCallback(\n (selected: Value) => {\n // If the selected value isn't an array, then we don't need to display\n // chips and should fall back to the default render behavior\n if (typeof selected === \"string\") {\n return undefined;\n }\n\n // Convert the selected options array into <Chip>s\n const renderedChips = selected\n .map((item: string) => {\n const selectedOption = normalizedOptions.find(\n (option) => option.value === item\n );\n\n if (!selectedOption) {\n return null;\n }\n\n return <Chip key={item} label={selectedOption.text} />;\n })\n .filter(Boolean);\n\n if (renderedChips.length === 0) {\n return null;\n }\n\n // We need the <Box> to surround the <Chip>s for\n // proper styling\n return <Box>{renderedChips}</Box>;\n },\n [normalizedOptions]\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const children = useMemo(\n () =>\n normalizedOptions.map((option) => {\n if (option.type === \"heading\") {\n return <ListSubheader key={option.text}>{option.text}</ListSubheader>;\n }\n return (\n <MenuItem key={option.value} value={option.value}>\n {hasMultipleChoices && (\n <MuiCheckbox\n checked={internalSelectedValues?.includes(option.value)}\n />\n )}\n {option.text}\n {internalSelectedValues === option.value && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n children={children}\n data-se={testId}\n id={id}\n inputRef={inputRef}\n labelId={labelElementId}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n />\n ),\n [\n children,\n inputValues,\n hasMultipleChoices,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n renderValue,\n testId,\n translate,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,mBAAmB,QACd,OAAO;AAAC,SAYNC,KAAK;AAAA,SAELC,SAAS;AAAA,SAGhBC,wBAAwB,EACxBC,cAAc,EACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAsFjB,MAAM;EAAEC;AAAW,CAAC,GAAGP,wBAAwB;AAC/C,MAAMQ,MAAM,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|
|
1
|
+
{"version":3,"file":"Select.js","names":["memo","useCallback","useEffect","useMemo","useRef","useState","useImperativeHandle","Field","CheckIcon","ComponentControlledState","useInputValues","getControlState","jsx","_jsx","jsxs","_jsxs","CONTROLLED","Select","_ref","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","hint","HintLinkComponent","id","idOverride","inputFocusRef","isDisabled","isFullWidth","isMultiSelect","isOptional","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","options","testId","translate","value","undefined","controlledStateRef","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","current","inputRef","element","focus","inputValues","controlState","event","child","target","split","normalizedOptions","map","option","text","type","renderValue","selected","renderedChips","item","selectedOption","find","_Chip","filter","Boolean","length","_Box","children","_ListSubheader","_MenuItem","_Checkbox","checked","includes","_ListItemSecondaryAction","renderFieldComponent","_ref2","ariaDescribedBy","errorMessageElementId","labelElementId","_Select","labelId","multiple","fieldType","hasVisibleLabel","MemoizedSelect","displayName"],"sources":["../src/Select.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-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 memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from \"react\";\nimport {\n Box,\n Checkbox as MuiCheckbox,\n Chip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem,\n Select as MuiSelect,\n} from \"@mui/material\";\nimport { SelectProps as MuiSelectProps } from \"@mui/material\";\n\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { CheckIcon } from \"./icons.generated\";\nimport type { AllowedProps } from \"./AllowedProps\";\nimport {\n ComponentControlledState,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\nimport { FocusHandle } from \"./@types/react-augment\";\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n};\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select to expose focus()\n */\n inputFocusRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n AllowedProps;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean\n>({\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputFocusRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect]\n );\n const controlledStateRef = useRef(\n getControlState({ controlledValue: value, uncontrolledValue: defaultValue })\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue\n );\n const inputRef = useRef<HTMLSelectElement>(null);\n\n useImperativeHandle(\n inputFocusRef,\n () => {\n const element = inputRef.current;\n return {\n focus: () => {\n element && element.focus();\n },\n };\n },\n []\n );\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" ? value.split(\",\") : value) as Value\n );\n }\n onChangeProp?.(event, child);\n },\n [onChangeProp]\n );\n\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const normalizedOptions = useMemo(\n () =>\n options.map((option) =>\n typeof option === \"object\"\n ? {\n text: option.text,\n value: option.value || option.text,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n }\n : { text: option, value: option, type: \"option\" }\n ),\n [options]\n );\n\n const renderValue = useCallback(\n (selected: Value) => {\n // If the selected value isn't an array, then we don't need to display\n // chips and should fall back to the default render behavior\n if (typeof selected === \"string\") {\n return undefined;\n }\n\n // Convert the selected options array into <Chip>s\n const renderedChips = selected\n .map((item: string) => {\n const selectedOption = normalizedOptions.find(\n (option) => option.value === item\n );\n\n if (!selectedOption) {\n return null;\n }\n\n return <Chip key={item} label={selectedOption.text} />;\n })\n .filter(Boolean);\n\n if (renderedChips.length === 0) {\n return null;\n }\n\n // We need the <Box> to surround the <Chip>s for\n // proper styling\n return <Box>{renderedChips}</Box>;\n },\n [normalizedOptions]\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const children = useMemo(\n () =>\n normalizedOptions.map((option) => {\n if (option.type === \"heading\") {\n return <ListSubheader key={option.text}>{option.text}</ListSubheader>;\n }\n return (\n <MenuItem key={option.value} value={option.value}>\n {hasMultipleChoices && (\n <MuiCheckbox\n checked={internalSelectedValues?.includes(option.value)}\n />\n )}\n {option.text}\n {internalSelectedValues === option.value && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n children={children}\n data-se={testId}\n id={id}\n inputRef={inputRef}\n labelId={labelElementId}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n />\n ),\n [\n children,\n inputValues,\n hasMultipleChoices,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n renderValue,\n testId,\n translate,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,mBAAmB,QACd,OAAO;AAAC,SAYNC,KAAK;AAAA,SAELC,SAAS;AAAA,SAGhBC,wBAAwB,EACxBC,cAAc,EACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAuFjB,MAAM;EAAEC;AAAW,CAAC,GAAGP,wBAAwB;AAC/C,MAAMQ,MAAM,GAAGC,IAAA,IAyB+B;EAAA,IAtB5C;IACAC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAChBC,kBAAkB,EAAEC,sBAAsB;IAC1CC,IAAI;IACJC,iBAAiB;IACjBC,EAAE,EAAEC,UAAU;IACdC,aAAa;IACbC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,aAAa;IACbC,UAAU,GAAG,KAAK;IAClBC,KAAK;IACLC,IAAI,EAAEC,YAAY;IAClBC,MAAM;IACNC,QAAQ,EAAEC,YAAY;IACtBC,OAAO;IACPC,OAAO;IACPC,MAAM;IACNC,SAAS;IACTC;EACsC,CAAC,GAAAzB,IAAA;EACvC,MAAMI,kBAAkB,GAAGnB,OAAO,CAChC,MACEoB,sBAAsB,KAAKqB,SAAS,GAChCb,aAAa,GACbR,sBAAsB,EAC5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jB0B,WAAW,EAAE3C,kBAAkB,GAAG2C,WAAW,GAAGrB,SAAU;MAC1DF,SAAS,EAAEA;IAAU,CACtB,CAAC;EAAA,CACH,EACD,CACEkC,QAAQ,EACRtB,WAAW,EACXhC,kBAAkB,EAClBa,YAAY,EACZC,MAAM,EACNC,QAAQ,EACRE,OAAO,EACP0B,WAAW,EACXxB,MAAM,EACNC,SAAS,CAEb,CAAC;EAED,OACE7B,IAAA,CAACN,KAAK;IACJa,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCsE,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACfpE,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbkD,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMU,cAAc,GAAG7F,IAAI,CAACiB,MAAM,CAAC;AACnC4E,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAI5E,MAAM"}
|
package/dist/TextField.js
CHANGED
|
@@ -24,6 +24,7 @@ const TextField = forwardRef((_ref, ref) => {
|
|
|
24
24
|
hasInitialFocus,
|
|
25
25
|
endAdornment,
|
|
26
26
|
errorMessage,
|
|
27
|
+
errorMessageList,
|
|
27
28
|
hint,
|
|
28
29
|
HintLinkComponent,
|
|
29
30
|
id: idOverride,
|
|
@@ -110,6 +111,7 @@ const TextField = forwardRef((_ref, ref) => {
|
|
|
110
111
|
}, [autoCompleteType, inputValues, hasInitialFocus, endAdornment, isMultiline, nameOverride, onBlur, onChange, onFocus, placeholder, isOptional, isReadOnly, ref, startAdornment, testId, translate, type]);
|
|
111
112
|
return _jsx(Field, {
|
|
112
113
|
errorMessage: errorMessage,
|
|
114
|
+
errorMessageList: errorMessageList,
|
|
113
115
|
fieldType: "single",
|
|
114
116
|
hasVisibleLabel: true,
|
|
115
117
|
hint: hint,
|
package/dist/TextField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","textFieldTypeValues","TextField","_ref","ref","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessage","hint","HintLinkComponent","id","idOverride","inputFocusRef","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","translate","type","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","inputRef","element","focus","event","renderFieldComponent","_ref2","ariaDescribedBy","errorMessageElementId","labelElementId","_InputBase","inputProps","autoComplete","autoFocus","_InputAdornment","position","children","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-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 ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { AllowedProps } from \"./AllowedProps\";\nimport { useInputValues, getControlState } from \"./inputUtils\";\nimport { FocusHandle } from \"./@types/react-augment\";\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField to expose focus()\n */\n inputFocusRef?: React.RefObject<FocusHandle>;\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n AllowedProps;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputFocusRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n translate,\n type = \"text\",\n value: value,\n },\n ref\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n })\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputFocusRef,\n () => {\n const element = inputRef.current;\n return {\n focus: () => {\n element && element.focus();\n },\n };\n },\n []\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <InputBase\n {...inputValues}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n }}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n data-se={testId}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\" translate={translate}>\n {endAdornment}\n </InputAdornment>\n )\n }\n id={id}\n inputRef={inputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\" translate={translate}>\n {startAdornment}\n </InputAdornment>\n )\n }\n type={type}\n translate={translate}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n translate,\n type,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAINC,KAAK;AAAA,SAELC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGxC,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AAgEV,MAAMC,SAAS,GAAGX,UAAU,CAC1B,CAAAY,IAAA,EA4BEC,GAAG,KACA;EAAA,IA5BH;IACEC,gBAAgB;IAChBC,YAAY;IACZC,eAAe;IACfC,YAAY;IACZC,YAAY;IACZC,IAAI;IACJC,iBAAiB;IACjBC,EAAE,EAAEC,UAAU;IACdC,aAAa;IACbC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,KAAK;IACLC,IAAI,EAAEC,YAAY;IAClBC,MAAM;IACNC,QAAQ,EAAEC,YAAY;IACtBC,OAAO;IACPC,WAAW;IACXC,cAAc;IACdC,MAAM;IACNC,SAAS;IACTC,IAAI,GAAG,MAAM;IACbC,KAAK,EAAEA;EACT,CAAC,GAAA7B,IAAA;EAGD,MAAM8B,kBAAkB,GAAGtC,MAAM,CAC/BG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I,IAAI,EAAEC,YAAY,IAAIV,EAAG;MACzBW,MAAM,EAAEA,MAAO;MACfC,QAAQ,EAAEA,QAAS;MACnBE,OAAO,EAAEA,OAAQ;MACjBC,WAAW,EAAEA,WAAY;MACzB6B,QAAQ,EAAErC,UAAW;MACrBf,GAAG,EAAEA,GAAI;MACTqD,QAAQ,EAAE,CAACvC,UAAW;MACtBU,cAAc,EACZA,cAAc,IACZ5B,IAAA,CAAAoD,eAAA;QAAgBC,QAAQ,EAAC,OAAO;QAACvB,SAAS,EAAEA,SAAU;QAAAwB,QAAA,EACnD1B;MAAc,CACD,CAEnB;MACDG,IAAI,EAAEA,IAAK;MACXD,SAAS,EAAEA;IAAU,CACtB,CAAC;EAAA,CACH,EACD,CACEzB,gBAAgB,EAChB+B,WAAW,EACX7B,eAAe,EACfC,YAAY,EACZS,WAAW,EACXK,YAAY,EACZC,MAAM,EACNC,QAAQ,EACRE,OAAO,EACPC,WAAW,EACXT,UAAU,EACVC,UAAU,EACVf,GAAG,EACHwB,cAAc,EACdC,MAAM,EACNC,SAAS,EACTC,IAAI,CAER,CAAC;EAED,OACE/B,IAAA,CAACJ,KAAK;IACJa,YAAY,EAAEA,YAAa;IAC3BiD,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACfjD,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbuB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMiB,iBAAiB,GAAGpE,IAAI,CAACU,SAAS,CAAC;AACzC0D,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAI1D,SAAS"}
|
|
1
|
+
{"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","textFieldTypeValues","TextField","_ref","ref","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","inputFocusRef","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","translate","type","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","inputRef","element","focus","event","renderFieldComponent","_ref2","ariaDescribedBy","errorMessageElementId","labelElementId","_InputBase","inputProps","autoComplete","autoFocus","_InputAdornment","position","children","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-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 ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { AllowedProps } from \"./AllowedProps\";\nimport { useInputValues, getControlState } from \"./inputUtils\";\nimport { FocusHandle } from \"./@types/react-augment\";\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField to expose focus()\n */\n inputFocusRef?: React.RefObject<FocusHandle>;\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n AllowedProps;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputFocusRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n translate,\n type = \"text\",\n value: value,\n },\n ref\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n })\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputFocusRef,\n () => {\n const element = inputRef.current;\n return {\n focus: () => {\n element && element.focus();\n },\n };\n },\n []\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <InputBase\n {...inputValues}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n }}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n data-se={testId}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\" translate={translate}>\n {endAdornment}\n </InputAdornment>\n )\n }\n id={id}\n inputRef={inputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\" translate={translate}>\n {startAdornment}\n </InputAdornment>\n )\n }\n type={type}\n translate={translate}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n translate,\n type,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAINC,KAAK;AAAA,SAELC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGxC,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AAgEV,MAAMC,SAAS,GAAGX,UAAU,CAC1B,CAAAY,IAAA,EA6BEC,GAAG,KACA;EAAA,IA7BH;IACEC,gBAAgB;IAChBC,YAAY;IACZC,eAAe;IACfC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAChBC,IAAI;IACJC,iBAAiB;IACjBC,EAAE,EAAEC,UAAU;IACdC,aAAa;IACbC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,KAAK;IACLC,IAAI,EAAEC,YAAY;IAClBC,MAAM;IACNC,QAAQ,EAAEC,YAAY;IACtBC,OAAO;IACPC,WAAW;IACXC,cAAc;IACdC,MAAM;IACNC,SAAS;IACTC,IAAI,GAAG,MAAM;IACbC,KAAK,EAAEA;EACT,CAAC,GAAA9B,IAAA;EAGD,MAAM+B,kBAAkB,GAAGvC,MAAM,CAC/BG,eAAe,CAAC;IACdqC,eAAe,EAAEF,KAAK;IACtBG,iBAAiB,EAAE9B;EACrB,CAAC,CACH,CAAC;EACD,MAAM+B,WAAW,GAAGxC,cAAc,CAAC;IACjCS,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A,WAAY;MACzB6B,QAAQ,EAAErC,UAAW;MACrBhB,GAAG,EAAEA,GAAI;MACTsD,QAAQ,EAAE,CAACvC,UAAW;MACtBU,cAAc,EACZA,cAAc,IACZ7B,IAAA,CAAAqD,eAAA;QAAgBC,QAAQ,EAAC,OAAO;QAACvB,SAAS,EAAEA,SAAU;QAAAwB,QAAA,EACnD1B;MAAc,CACD,CAEnB;MACDG,IAAI,EAAEA,IAAK;MACXD,SAAS,EAAEA;IAAU,CACtB,CAAC;EAAA,CACH,EACD,CACE1B,gBAAgB,EAChBgC,WAAW,EACX9B,eAAe,EACfC,YAAY,EACZU,WAAW,EACXK,YAAY,EACZC,MAAM,EACNC,QAAQ,EACRE,OAAO,EACPC,WAAW,EACXT,UAAU,EACVC,UAAU,EACVhB,GAAG,EACHyB,cAAc,EACdC,MAAM,EACNC,SAAS,EACTC,IAAI,CAER,CAAC;EAED,OACEhC,IAAA,CAACJ,KAAK;IACJa,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCiD,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACfjD,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbuB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMiB,iBAAiB,GAAGrE,IAAI,CAACU,SAAS,CAAC;AACzC2D,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAI3D,SAAS"}
|
|
@@ -19,6 +19,7 @@ const VirtualizedAutocomplete = _ref => {
|
|
|
19
19
|
let {
|
|
20
20
|
defaultValue,
|
|
21
21
|
errorMessage,
|
|
22
|
+
errorMessageList,
|
|
22
23
|
hasMultipleChoices,
|
|
23
24
|
id: idOverride,
|
|
24
25
|
inputValue,
|
|
@@ -72,6 +73,7 @@ const VirtualizedAutocomplete = _ref => {
|
|
|
72
73
|
} = _ref2;
|
|
73
74
|
return _jsx(Field, {
|
|
74
75
|
errorMessage: errorMessage,
|
|
76
|
+
errorMessageList: errorMessageList,
|
|
75
77
|
fieldType: "single",
|
|
76
78
|
hasVisibleLabel: true,
|
|
77
79
|
id: InputLabelProps.htmlFor,
|
|
@@ -1 +1 @@
|
|
|
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","translate","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 { AllowedProps } from \"../AllowedProps\";\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 AllowedProps;\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 translate,\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 translate={translate}\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,EAAEC,MAAM,QAAQ,OAAO;AAAC,SAElDC,KAAK;AAAA,SAIZC,wBAAwB,EACxBC,eAAe,EACfC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAmJhB,MAAMC,uBAAuB,GAAGC,IAAA,IA4B+C;EAAA,IAxB7E;IACAC,YAAY;IACZC,YAAY;IACZC,kBAAkB;IAClBC,EAAE,EAAEC,UAAU;IACdC,UAAU;IACVC,oBAAoB;IACpBC,UAAU;IACVC,SAAS;IACTC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,IAAI;IACJC,KAAK;IACLC,gBAAgB;IAChBC,IAAI,EA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AAE,IAAK;IAC5BzD,EAAE,EAAEC,UAAW;IACfS,gBAAgB,EAAEA,gBAAiB;IACnCgD,OAAO,EAAErD,SAAU;IACnBsD,QAAQ,EAAE5D,kBAAmB;IAC7Bc,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBE,aAAa,EAAEA,aAAc;IAC7BE,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjByC,QAAQ,EAAErD,UAAW;IACrB2B,WAAW,EAAEA,WAAY;IACzB2B,oBAAoB,EAAExC,uBAAwB;IAC9CE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAGD,MAAMuC,oBAAoB,GAAG7E,IAAI,CAC/BU,uBACF,CAAmC;AAEnCmE,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAInE,uBAAuB"}
|
|
1
|
+
{"version":3,"file":"VirtualizedAutocomplete.js","names":["memo","useCallback","useMemo","useRef","Field","ComponentControlledState","getControlState","useInputValues","jsx","_jsx","VirtualizedAutocomplete","_ref","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isLoading","isOptional","isReadOnly","hint","label","ListboxComponent","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","value","getIsOptionEqualToValue","testId","translate","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 { AllowedProps } from \"../AllowedProps\";\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\" | \"errorMessageList\" | \"hint\" | \"id\" | \"isOptional\" | \"name\"\n> &\n AllowedProps;\n\nconst VirtualizedAutocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n>({\n defaultValue,\n errorMessage,\n errorMessageList,\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 translate,\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 errorMessageList={errorMessageList}\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 translate={translate}\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,EAAEC,MAAM,QAAQ,OAAO;AAAC,SAElDC,KAAK;AAAA,SAIZC,wBAAwB,EACxBC,eAAe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EAAE+B,MAAM,KAAK;IACxBlC,iBAAiB,GAAGiC,KAAK,EAAE9B,KAAK,EAAE+B,MAAM,CAAC;EAC3C,CAAC,EACD,CAAClC,iBAAiB,CACpB,CAAC;EAED,OACExB,IAAA,CAAA4D,aAAA;IAAA,GACMxB,UAAU;IAAA,GACVG,cAAc;IAElB,iBAAe5B,UAAW;IAC1B,WAASkB,MAAO;IAChBgC,oBAAoB,EAAEvD,kBAAmB;IACzCwD,QAAQ,EAAEnD,UAAW;IACrBoD,QAAQ,EAAErD,oBAAqB;IAC/BsD,qBAAqB,EAAE,IAAK;IAC5BzD,EAAE,EAAEC,UAAW;IACfS,gBAAgB,EAAEA,gBAAiB;IACnCgD,OAAO,EAAErD,SAAU;IACnBsD,QAAQ,EAAE5D,kBAAmB;IAC7Bc,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBE,aAAa,EAAEA,aAAc;IAC7BE,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjByC,QAAQ,EAAErD,UAAW;IACrB2B,WAAW,EAAEA,WAAY;IACzB2B,oBAAoB,EAAExC,uBAAwB;IAC9CE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAGD,MAAMuC,oBAAoB,GAAG9E,IAAI,CAC/BU,uBACF,CAAmC;AAEnCoE,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIpE,uBAAuB"}
|
|
@@ -78,7 +78,7 @@ export type AutocompleteProps<OptionType, HasMultipleChoices extends boolean | u
|
|
|
78
78
|
* You will need to implement this function if your `option` items are objects.
|
|
79
79
|
*/
|
|
80
80
|
getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;
|
|
81
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "HintLinkComponent" | "id" | "isFullWidth" | "isOptional" | "name"> & AllowedProps;
|
|
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, HintLinkComponent, label, name: nameOverride, onBlur, onChange: onChangeProp, onInputChange: onInputChangeProp, onFocus, options, value, getIsOptionEqualToValue, testId, translate, }: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => JSX.Element;
|
|
81
|
+
} & Pick<FieldComponentProps, "errorMessage" | "errorMessageList" | "hint" | "HintLinkComponent" | "id" | "isFullWidth" | "isOptional" | "name"> & AllowedProps;
|
|
82
|
+
declare const MemoizedAutocomplete: <OptionType, HasMultipleChoices extends boolean | undefined, IsCustomValueAllowed extends boolean | undefined>({ defaultValue, errorMessage, errorMessageList, hasMultipleChoices, id: idOverride, inputValue, isCustomValueAllowed, isDisabled, isFullWidth, isLoading, isOptional, isReadOnly, hint, HintLinkComponent, label, name: nameOverride, onBlur, onChange: onChangeProp, onInputChange: onInputChangeProp, onFocus, options, value, getIsOptionEqualToValue, testId, translate, }: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => JSX.Element;
|
|
83
83
|
export { MemoizedAutocomplete as Autocomplete };
|
|
84
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,oBAAoB,EAEzC,oBAAoB,EAErB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOnD,MAAM,MAAM,iBAAiB,CAC3B,UAAU,EACV,kBAAkB,SAAS,OAAO,GAAG,SAAS,EAC9C,oBAAoB,SAA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ACT,oBAAoB,CACrB,CAAC,SAAS,CAAC,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAC1B,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,oBAAoB,CACrB,CAAC,OAAO,CAAC,CAAC;IAEX;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;CAC9E,GAAG,IAAI,CACN,mBAAmB,EACjB,cAAc,GACd,kBAAkB,GAClB,MAAM,GACN,mBAAmB,GACnB,IAAI,GACJ,aAAa,GACb,YAAY,GACZ,MAAM,CACT,GACC,YAAY,CAAC;AAiLf,QAAA,MAAM,oBAAoB,wjBAA4C,CAAC;AAIvE,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -26,7 +26,7 @@ export type CheckboxGroupProps = {
|
|
|
26
26
|
* The label text for the CheckboxGroup
|
|
27
27
|
*/
|
|
28
28
|
label: string;
|
|
29
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "HintLinkComponent" | "isDisabled"> & AllowedProps;
|
|
30
|
-
declare const MemoizedCheckboxGroup: import("react").MemoExoticComponent<({ children, errorMessage, hint, HintLinkComponent, isDisabled, isRequired, label, testId, translate, }: CheckboxGroupProps) => JSX.Element>;
|
|
29
|
+
} & Pick<FieldComponentProps, "errorMessage" | "errorMessageList" | "hint" | "HintLinkComponent" | "isDisabled"> & AllowedProps;
|
|
30
|
+
declare const MemoizedCheckboxGroup: import("react").MemoExoticComponent<({ children, errorMessage, errorMessageList, hint, HintLinkComponent, isDisabled, isRequired, label, testId, translate, }: CheckboxGroupProps) => JSX.Element>;
|
|
31
31
|
export { MemoizedCheckboxGroup as CheckboxGroup };
|
|
32
32
|
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../src/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAQ,YAAY,EAAe,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,QAAQ,EACJ,YAAY,CAAC,OAAO,QAAQ,CAAC,GAC7B,KAAK,CAAC,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;IACzC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CACN,mBAAmB,
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../src/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAQ,YAAY,EAAe,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,QAAQ,EACJ,YAAY,CAAC,OAAO,QAAQ,CAAC,GAC7B,KAAK,CAAC,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;IACzC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CACN,mBAAmB,EACjB,cAAc,GACd,kBAAkB,GAClB,MAAM,GACN,mBAAmB,GACnB,YAAY,CACf,GACC,YAAY,CAAC;AA6Cf,QAAA,MAAM,qBAAqB,iKAhCxB,kBAAkB,iBAgC4B,CAAC;AAGlD,OAAO,EAAE,qBAAqB,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2022-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
|
+
/// <reference types="react" />
|
|
13
|
+
export type ErrorMessageListProps = {
|
|
14
|
+
errorMessages: string[];
|
|
15
|
+
};
|
|
16
|
+
declare const MemoizedErrorMessageList: import("react").MemoExoticComponent<({ errorMessages }: ErrorMessageListProps) => JSX.Element>;
|
|
17
|
+
export { MemoizedErrorMessageList as ErrorMessageList };
|
|
18
|
+
//# sourceMappingURL=ErrorMessageList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorMessageList.d.ts","sourceRoot":"","sources":["../../src/ErrorMessageList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAMH,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA6BF,QAAA,MAAM,wBAAwB,0DAtBe,qBAAqB,iBAsBX,CAAC;AAGxD,OAAO,EAAE,wBAAwB,IAAI,gBAAgB,EAAE,CAAC"}
|
package/dist/src/Field.d.ts
CHANGED
|
@@ -13,6 +13,14 @@ import { ReactElement } from "react";
|
|
|
13
13
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
14
14
|
export declare const fieldTypeValues: readonly ["single", "group"];
|
|
15
15
|
export type FieldProps = {
|
|
16
|
+
/**
|
|
17
|
+
* If `error` is not undefined, the `input` will indicate an error.
|
|
18
|
+
*/
|
|
19
|
+
errorMessage?: string;
|
|
20
|
+
/**
|
|
21
|
+
* If `error` is not undefined, the `input` will indicate an error.
|
|
22
|
+
*/
|
|
23
|
+
errorMessageList?: string[];
|
|
16
24
|
/**
|
|
17
25
|
* The field type determines how ARIA components are setup. It's important to use this to denote if you expect only one component (like a text field) or multiple (like a radio group).
|
|
18
26
|
*/
|
|
@@ -48,6 +56,6 @@ export type FieldProps = {
|
|
|
48
56
|
labelElementId: string;
|
|
49
57
|
}) => ReactElement;
|
|
50
58
|
};
|
|
51
|
-
declare const MemoizedField: import("react").MemoExoticComponent<({ errorMessage, fieldType, hasVisibleLabel, hint, HintLinkComponent, id: idOverride, isDisabled: isDisabledProp, isFullWidth, isRadioGroup, isOptional, label, renderFieldComponent, }: FieldProps & Pick<FieldComponentProps, "errorMessage" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "isFullWidth" | "isOptional">) => JSX.Element>;
|
|
59
|
+
declare const MemoizedField: import("react").MemoExoticComponent<({ errorMessage, errorMessageList, fieldType, hasVisibleLabel, hint, HintLinkComponent, id: idOverride, isDisabled: isDisabledProp, isFullWidth, isRadioGroup, isOptional, label, renderFieldComponent, }: FieldProps & Pick<FieldComponentProps, "errorMessage" | "errorMessageList" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "isFullWidth" | "isOptional">) => JSX.Element>;
|
|
52
60
|
export { MemoizedField as Field };
|
|
53
61
|
//# 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;AAOpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAS5D,eAAO,MAAM,eAAe,8BAA+B,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,SAAS,EAAE,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5C;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;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;
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/Field.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,YAAY,EAAW,MAAM,OAAO,CAAC;AAOpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAS5D,eAAO,MAAM,eAAe,8BAA+B,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,SAAS,EAAE,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5C;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;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;AAoGF,QAAA,MAAM,aAAa,iPApFhB,UAAU,GACX,KACE,mBAAmB,EACjB,cAAc,GACd,kBAAkB,GAClB,MAAM,GACN,mBAAmB,GACnB,IAAI,GACJ,YAAY,GACZ,aAAa,GACb,YAAY,CACf,iBAyE8B,CAAC;AAGlC,OAAO,EAAE,aAAa,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -16,6 +16,10 @@ export type FieldComponentProps = {
|
|
|
16
16
|
* If `error` is not undefined, the `input` will indicate an error.
|
|
17
17
|
*/
|
|
18
18
|
errorMessage?: string;
|
|
19
|
+
/**
|
|
20
|
+
* If `error` is not undefined, the `input` will indicate multiple errors.
|
|
21
|
+
*/
|
|
22
|
+
errorMessageList?: string[];
|
|
19
23
|
/**
|
|
20
24
|
* The helper text content.
|
|
21
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldComponentProps.d.ts","sourceRoot":"","sources":["../../src/FieldComponentProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,iBAAiB,CAAC,EAAE,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC;IAClD;;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"}
|
|
1
|
+
{"version":3,"file":"FieldComponentProps.d.ts","sourceRoot":"","sources":["../../src/FieldComponentProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,iBAAiB,CAAC,EAAE,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC;IAClD;;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"}
|
package/dist/src/FieldError.d.ts
CHANGED
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
import type { AllowedProps } from "./AllowedProps";
|
|
14
14
|
export type FieldErrorProps = {
|
|
15
15
|
id?: string;
|
|
16
|
-
|
|
16
|
+
message?: string;
|
|
17
|
+
messageList?: string[];
|
|
17
18
|
} & AllowedProps;
|
|
18
|
-
declare const MemoizedFieldError: import("react").MemoExoticComponent<({ id,
|
|
19
|
+
declare const MemoizedFieldError: import("react").MemoExoticComponent<({ id, message, messageList, testId, translate, }: FieldErrorProps) => JSX.Element>;
|
|
19
20
|
export { MemoizedFieldError as FieldError };
|
|
20
21
|
//# sourceMappingURL=FieldError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldError.d.ts","sourceRoot":"","sources":["../../src/FieldError.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;
|
|
1
|
+
{"version":3,"file":"FieldError.d.ts","sourceRoot":"","sources":["../../src/FieldError.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,YAAY,CAAC;AAwBjB,QAAA,MAAM,kBAAkB,yFAhBrB,eAAe,iBAgByB,CAAC;AAG5C,OAAO,EAAE,kBAAkB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -59,7 +59,7 @@ export type NativeSelectProps<Value extends NativeSelectValueType<HasMultipleCho
|
|
|
59
59
|
* The value or values selected in the NativeSelect. Use when component is controlled
|
|
60
60
|
*/
|
|
61
61
|
value?: Value;
|
|
62
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "isFullWidth" | "isOptional"> & AllowedProps;
|
|
62
|
+
} & Pick<FieldComponentProps, "errorMessage" | "errorMessageList" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "isFullWidth" | "isOptional"> & AllowedProps;
|
|
63
63
|
declare const MemoizedNativeSelect: React.MemoExoticComponent<ForwardRefWithType>;
|
|
64
64
|
export { MemoizedNativeSelect as NativeSelect };
|
|
65
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,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,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,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,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|
|
|
1
|
-
{"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../src/PasswordField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,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,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC7C;;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,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../src/PasswordField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,kBAAkB,E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|
package/dist/src/RadioGroup.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export type RadioGroupProps = {
|
|
|
35
35
|
* The `value` on the selected Radio
|
|
36
36
|
*/
|
|
37
37
|
value?: RadioProps["value"];
|
|
38
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "name"> & AllowedProps;
|
|
39
|
-
declare const MemoizedRadioGroup: import("react").MemoExoticComponent<({ children, defaultValue, errorMessage, hint, HintLinkComponent, id: idOverride, isDisabled, label, name: nameOverride, onChange: onChangeProp, testId, translate, value, }: RadioGroupProps) => JSX.Element>;
|
|
38
|
+
} & Pick<FieldComponentProps, "errorMessage" | "errorMessageList" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "name"> & AllowedProps;
|
|
39
|
+
declare const MemoizedRadioGroup: import("react").MemoExoticComponent<({ children, defaultValue, errorMessage, errorMessageList, hint, HintLinkComponent, id: idOverride, isDisabled, label, name: nameOverride, onChange: onChangeProp, testId, translate, value, }: RadioGroupProps) => JSX.Element>;
|
|
40
40
|
export { MemoizedRadioGroup as RadioGroup };
|
|
41
41
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -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,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,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAA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eAAe,iBAmDyB,CAAC;AAG5C,OAAO,EAAE,kBAAkB,IAAI,UAAU,EAAE,CAAC"}
|
package/dist/src/Select.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export type SelectProps<Value extends SelectValueType<HasMultipleChoices>, HasMu
|
|
|
62
62
|
* The value or values selected in the Select
|
|
63
63
|
*/
|
|
64
64
|
value?: Value;
|
|
65
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "isFullWidth" | "isOptional" | "name"> & AllowedProps;
|
|
66
|
-
declare const MemoizedSelect: import("react").MemoExoticComponent<(<Value extends SelectValueType<HasMultipleChoices>, HasMultipleChoices extends boolean>({ defaultValue, errorMessage, hasMultipleChoices: hasMultipleChoicesProp, hint, HintLinkComponent, id: idOverride, inputFocusRef, isDisabled, isFullWidth, isMultiSelect, isOptional, label, name: nameOverride, onBlur, onChange: onChangeProp, onFocus, options, testId, translate, value, }: SelectProps<Value, HasMultipleChoices>) => JSX.Element)>;
|
|
65
|
+
} & Pick<FieldComponentProps, "errorMessage" | "errorMessageList" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "isFullWidth" | "isOptional" | "name"> & AllowedProps;
|
|
66
|
+
declare const MemoizedSelect: import("react").MemoExoticComponent<(<Value extends SelectValueType<HasMultipleChoices>, HasMultipleChoices extends boolean>({ defaultValue, errorMessage, errorMessageList, hasMultipleChoices: hasMultipleChoicesProp, hint, HintLinkComponent, id: idOverride, inputFocusRef, isDisabled, isFullWidth, isMultiSelect, isOptional, label, name: nameOverride, onBlur, onChange: onChangeProp, onFocus, options, testId, translate, value, }: SelectProps<Value, HasMultipleChoices>) => JSX.Element)>;
|
|
67
67
|
export { MemoizedSelect as Select };
|
|
68
68
|
//# 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":[],"m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;;OAEG;;IAEH;;OAEG;;0FA0JoC,CAAC;AAG1C,OAAO,EAAE,iBAAiB,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -84,7 +84,7 @@ export type AutocompleteProps<OptionType, HasMultipleChoices extends boolean | u
|
|
|
84
84
|
* You will need to implement this function if your `option` items are objects.
|
|
85
85
|
*/
|
|
86
86
|
getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;
|
|
87
|
-
} & Pick<FieldComponentProps, "errorMessage" | "hint" | "id" | "isOptional" | "name"> & AllowedProps;
|
|
88
|
-
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, ListboxComponent, name: nameOverride, onBlur, onChange: onChangeProp, onInputChange: onInputChangeProp, onFocus, options, value, getIsOptionEqualToValue, testId, translate, }: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => JSX.Element;
|
|
87
|
+
} & Pick<FieldComponentProps, "errorMessage" | "errorMessageList" | "hint" | "id" | "isOptional" | "name"> & AllowedProps;
|
|
88
|
+
declare const MemoizedAutocomplete: <OptionType, HasMultipleChoices extends boolean | undefined, IsCustomValueAllowed extends boolean | undefined>({ defaultValue, errorMessage, errorMessageList, hasMultipleChoices, id: idOverride, inputValue, isCustomValueAllowed, isDisabled, isLoading, isOptional, isReadOnly, hint, label, ListboxComponent, name: nameOverride, onBlur, onChange: onChangeProp, onInputChange: onInputChangeProp, onFocus, options, value, getIsOptionEqualToValue, testId, translate, }: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => JSX.Element;
|
|
89
89
|
export { MemoizedAutocomplete as VirtualizedAutocomplete };
|
|
90
90
|
//# sourceMappingURL=VirtualizedAutocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualizedAut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BAAkB,EAClB,SAAS,EACT,oBAAoB,CACrB,CAAC,UAAU,CAAC,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAC5C,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAClC,CAAC;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAC3B,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,oBAAoB,CACrB,CAAC,QAAQ,CAAC,CAAC;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAC7B,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,oBAAoB,CACrB,CAAC,UAAU,CAAC,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAClC,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,oBAAoB,CACrB,CAAC,eAAe,CAAC,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAC5B,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,oBAAoB,CACrB,CAAC,SAAS,CAAC,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAC1B,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,oBAAoB,CACrB,CAAC,OAAO,CAAC,CAAC;IAEX;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;CAC9E,GAAG,IAAI,CACN,mBAAmB,EACnB,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"VirtualizedAutocomplete.d.ts","sourceRoot":"","sources":["../../../src/labs/VirtualizedAutocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;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