@salutejs/plasma-new-hope 0.194.0-canary.1562.11852874401.0 → 0.194.0-canary.1565.11870784206.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +4 -5
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +4 -5
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +4 -5
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +4 -5
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +4 -5
- package/cjs/components/Dropdown/Dropdown.css +4 -5
- package/cjs/components/Dropdown/Dropdown.js +2 -4
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -5
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -7
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_14yih1y.css → DropdownItem.styles_1b439rx.css} +0 -1
- package/cjs/components/Select/Select.js +1 -0
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/TextField/TextField.js +27 -3
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/hooks/useValidation.js +273 -0
- package/cjs/components/TextField/hooks/useValidation.js.map +1 -0
- package/cjs/index.css +4 -5
- package/cjs/utils/constants.js +4 -0
- package/cjs/utils/constants.js.map +1 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/cjs/components/Dropdown/Dropdown.js +2 -4
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +11 -15
- package/emotion/cjs/components/Select/Select.js +1 -0
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/cjs/components/TextField/TextField.js +27 -4
- package/emotion/cjs/components/TextField/TextField.template-doc.mdx +330 -0
- package/emotion/cjs/components/TextField/hooks/index.js +8 -1
- package/emotion/cjs/components/TextField/hooks/useValidation.js +276 -0
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +253 -1
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +252 -0
- package/emotion/cjs/utils/constants.js +4 -2
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/es/components/Dropdown/Dropdown.js +2 -4
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -4
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +11 -15
- package/emotion/es/components/Select/Select.js +1 -0
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/es/components/TextField/TextField.js +28 -5
- package/emotion/es/components/TextField/TextField.template-doc.mdx +330 -0
- package/emotion/es/components/TextField/hooks/index.js +2 -1
- package/emotion/es/components/TextField/hooks/useValidation.js +270 -0
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +253 -1
- package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +252 -0
- package/emotion/es/utils/constants.js +3 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +4 -5
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +4 -5
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +4 -5
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +4 -5
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +4 -5
- package/es/components/Dropdown/Dropdown.css +4 -5
- package/es/components/Dropdown/Dropdown.js +2 -4
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -5
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -4
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +2 -7
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_14yih1y.css → DropdownItem.styles_1b439rx.css} +0 -1
- package/es/components/Select/Select.js +1 -0
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/TextField/TextField.js +27 -3
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/hooks/useValidation.js +269 -0
- package/es/components/TextField/hooks/useValidation.js.map +1 -0
- package/es/index.css +4 -5
- package/es/utils/constants.js +3 -1
- package/es/utils/constants.js.map +1 -1
- package/package.json +2 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/cjs/components/Dropdown/Dropdown.js +2 -4
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +2 -5
- package/styled-components/cjs/components/Select/Select.js +1 -0
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/cjs/components/TextField/TextField.js +26 -3
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +330 -0
- package/styled-components/cjs/components/TextField/hooks/index.js +8 -1
- package/styled-components/cjs/components/TextField/hooks/useValidation.js +276 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +253 -1
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +252 -0
- package/styled-components/cjs/utils/constants.js +4 -2
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/es/components/Dropdown/Dropdown.js +2 -4
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -4
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +2 -5
- package/styled-components/es/components/Select/Select.js +1 -0
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/es/components/TextField/TextField.js +27 -4
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +330 -0
- package/styled-components/es/components/TextField/hooks/index.js +2 -1
- package/styled-components/es/components/TextField/hooks/useValidation.js +270 -0
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +253 -1
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +252 -0
- package/styled-components/es/utils/constants.js +3 -1
- package/types/components/Autocomplete/Autocomplete.types.d.ts +2 -2
- package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
- package/types/components/Autocomplete/ui/TextField/TextField.styles.d.ts +1676 -92
- package/types/components/Autocomplete/ui/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +2 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Target/Target.styles.d.ts +1676 -92
- package/types/components/Combobox/ComboboxNew/ui/Target/Target.styles.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts +1676 -92
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +2 -50
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +6 -11
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/index.d.ts +0 -1
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +0 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Range/Range.styles.d.ts +1676 -92
- package/types/components/Range/Range.styles.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +2 -1
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts +1676 -92
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
- package/types/components/Slider/components/Double/Double.styles.d.ts +1676 -92
- package/types/components/Slider/components/Double/Double.styles.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/components/TextField/TextField.types.d.ts +51 -1
- package/types/components/TextField/TextField.types.d.ts.map +1 -1
- package/types/components/TextField/hooks/index.d.ts +1 -0
- package/types/components/TextField/hooks/index.d.ts.map +1 -1
- package/types/components/TextField/hooks/useValidation.d.ts +7 -0
- package/types/components/TextField/hooks/useValidation.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Autocomplete/Autocomplete.d.ts +64 -2
- package/types/examples/plasma_b2c/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +1 -25
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Mask/Mask.d.ts +2732 -92
- package/types/examples/plasma_b2c/components/Mask/Mask.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts +1676 -92
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Autocomplete/Autocomplete.d.ts +64 -2
- package/types/examples/plasma_web/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts +1 -25
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Mask/Mask.d.ts +2732 -92
- package/types/examples/plasma_web/components/Mask/Mask.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextField/TextField.d.ts +1676 -92
- package/types/examples/plasma_web/components/TextField/TextField.d.ts.map +1 -1
- package/types/utils/constants.d.ts +2 -0
- package/types/utils/constants.d.ts.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextField.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { FormEventHandler, ChangeEventHandler, KeyboardEvent, ChangeEvent, MouseEventHandler } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\nimport { css } from '@linaria/core';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\n\nimport type { ChipValues, TextFieldPrimitiveValue, TextFieldProps, TextFieldRootProps } from './TextField.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as clearCSS } from './variations/_clear/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_read-only/base';\nimport { base as labelPlacementCSS } from './variations/_label-placement/base';\nimport { base as hintViewCSS } from './variations/_hint-view/base';\nimport { base as hintSizeCSS } from './variations/_hint-size/base';\nimport {\n Input,\n InputContainer,\n LeftHelper,\n Label,\n InputWrapper,\n InputLabelWrapper,\n StyledContentLeft,\n StyledContentRight,\n StyledChips,\n StyledTextBefore,\n StyledTextAfter,\n StyledIndicator,\n StyledOptionalText,\n InputPlaceholder,\n OuterLabelWrapper,\n TitleCaption,\n StyledHintWrapper,\n StyledIndicatorWrapper,\n} from './TextField.styles';\nimport { classes } from './TextField.tokens';\nimport { TextFieldChip } from './ui';\nimport { useKeyNavigation } from './hooks';\nimport { HintComponent } from './ui/Hint/Hint';\n\nconst optionalText = 'optional';\n\nexport const base = css`\n /* NOTE: Webkit не применяет opacity к inline тегам */\n display: block;\n`;\n\nconst HINT_DEFAULT_OFFSET: [number, number] = [0, 0];\n\nexport const textFieldRoot = (Root: RootProps<HTMLDivElement, TextFieldRootProps>) =>\n forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n style,\n\n // layout\n contentLeft,\n contentRight,\n label,\n labelPlacement,\n textBefore,\n textAfter,\n placeholder,\n leftHelper,\n enumerationType = 'plain',\n requiredPlacement = 'right',\n titleCaption,\n\n // hint\n hintTrigger = 'hover',\n hintText,\n hintView = 'default',\n hintSize = 'm',\n hintTargetIcon,\n hintPlacement = 'auto',\n hintHasArrow,\n hintOffset = HINT_DEFAULT_OFFSET,\n hintWidth,\n hintContentLeft,\n\n // variations\n view,\n size,\n readOnly = false,\n disabled = false,\n required = false,\n clear = false,\n optional,\n hasDivider,\n\n // controlled\n value: outerValue,\n chips: values,\n\n // events\n onChange,\n onChangeChips,\n onSearch,\n onKeyDown,\n\n ...rest\n },\n ref,\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n\n const controlledRefs = { contentRef, inputRef, chipsRefs };\n\n const [hasValue, setHasValue] = useState(\n Boolean(outerValue) || Boolean(inputRef?.current?.value) || Boolean(rest?.defaultValue),\n );\n const [chips, setChips] = useState<Array<ChipValues>>([]);\n const [isHintVisible, setIsHintVisible] = useState(false);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const labelId = safeUseId();\n const helperTextId = safeUseId();\n\n const isDefaultView = view === 'default' || readOnly || disabled;\n\n const isChipEnumeration = enumerationType === 'chip';\n const isChipsVisible = isChipEnumeration && Boolean(chips?.length);\n const withHasChips = isChipsVisible ? classes.hasChips : undefined;\n\n const hasLabelValue = Boolean(label);\n const hasInnerLabel = size !== 'xs' && labelPlacement === 'inner' && !isChipsVisible && hasLabelValue;\n const hasOuterLabel = labelPlacement === 'outer' && hasLabelValue;\n const hasPlaceholder = Boolean(placeholder) && !hasInnerLabel;\n\n const innerLabelValue = hasInnerLabel || hasOuterLabel ? label : undefined;\n const innerLabelPlacementValue = labelPlacement === 'inner' && !hasInnerLabel ? undefined : labelPlacement;\n\n const innerPlaceholderValue = hasPlaceholder ? placeholder : undefined;\n const placeholderShown = Boolean(innerPlaceholderValue) && !hasValue;\n\n const clearClass = clear ? classes.clear : undefined;\n const hasDividerClass = hasDivider ? classes.hasDivider : undefined;\n const hasHintClass = hintText ? classes.hasHint : undefined;\n const requiredPlacementClass = requiredPlacement === 'right' ? classes.requiredAlignRight : undefined;\n const labelPlacementClass = innerLabelPlacementValue\n ? classes[`${innerLabelPlacementValue}LabelPlacement` as keyof typeof classes]\n : undefined;\n const hasValueClass = hasValue ? classes.hasValue : undefined;\n\n const wrapperWithoutLeftContent = !contentLeft && isChipsVisible ? classes.hasEmptyContentLeft : undefined;\n const wrapperWithoutRightContent =\n !contentRight && isChipsVisible ? classes.hasEmptyContentRight : undefined;\n\n const hintRef = useOutsideClick<HTMLDivElement>(() => {\n setIsHintVisible(false);\n });\n const hintInnerRef = useRef<HTMLDivElement>(null);\n const hintForkRef = useForkRef(hintRef, hintInnerRef);\n\n const handleInput: FormEventHandler<HTMLInputElement> = (event) => {\n setHasValue(Boolean((event.target as HTMLInputElement).value));\n };\n\n const handleHintShow = () => setIsHintVisible(true);\n const handleHintHide = () => setIsHintVisible(false);\n const handleHintClick: MouseEventHandler = (event) => {\n if (!hintText || hintTrigger !== 'click') {\n return;\n }\n\n event.stopPropagation();\n const targetIsPopover = event.target === hintInnerRef.current;\n const rootHasTarget = hintInnerRef.current?.contains(event.target as Element);\n\n if (!targetIsPopover && !rootHasTarget) {\n setIsHintVisible(true);\n }\n };\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n if (disabled || readOnly) {\n return;\n }\n\n const { maxLength, value } = event.target;\n\n if (maxLength !== -1 && value.length > maxLength) {\n return;\n }\n\n onChange?.(event);\n };\n\n const updateChips = (newChips: Array<ChipValues>, newValues: Array<TextFieldPrimitiveValue>) => {\n setChips(newChips);\n onChangeChips?.(newValues);\n };\n\n const { handleInputKeydown, handleChipKeyDown, onChipClear, handleContentKeyDown } = useKeyNavigation({\n controlledRefs,\n disabled,\n readOnly,\n chips,\n enumerationType,\n updateChips,\n onSearch,\n onChange,\n onEnterDisabled: (rest as any).onEnterDisabled,\n });\n\n const onChipClick = (event: React.MouseEvent<HTMLButtonElement>) => event.stopPropagation();\n\n const handleInputFocus = () => {\n if (readOnly || disabled || !inputRef?.current) {\n return;\n }\n\n inputRef.current.scrollTo({\n top: 0,\n left: inputRef.current.offsetLeft,\n behavior: 'smooth',\n });\n\n inputRef.current.focus();\n };\n\n const getRef = (element: HTMLButtonElement | null, index: number) => {\n if (element && chipsRefs?.current) {\n chipsRefs.current[index] = element;\n }\n };\n\n const handleOnKeyDown = (event: ChangeEvent<HTMLInputElement> & KeyboardEvent<HTMLInputElement>) => {\n handleInputKeydown(event);\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n\n useEffect(() => {\n if (!isChipEnumeration && !values?.length) {\n return;\n }\n\n const newChips =\n values?.map((value, index) => ({\n id: `${index}_${value}`,\n text: value,\n })) || [];\n\n setChips(newChips);\n }, [isChipEnumeration, values]);\n\n useEffect(() => {\n setHasValue(Boolean(rest?.defaultValue));\n }, [rest.defaultValue]);\n\n useEffect(() => {\n setHasValue(Boolean(outerValue) || Boolean(inputRef?.current?.value));\n }, [outerValue, inputRef?.current?.value]);\n\n const innerOptional = Boolean(required ? false : optional);\n const hasPlaceholderOptional = innerOptional && !innerLabelValue && !hasOuterLabel;\n const optionalTextNode = innerOptional ? (\n <StyledOptionalText>\n {Boolean(hasPlaceholderOptional ? innerPlaceholderValue : innerLabelValue) && '\\xa0'}\n {optionalText}\n </StyledOptionalText>\n ) : null;\n\n return (\n <Root\n view={view}\n size={size}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n clear={clear}\n labelPlacement={innerLabelPlacementValue}\n onClick={handleInputFocus}\n className={cx(\n labelPlacementClass,\n clearClass,\n hasDividerClass,\n hasHintClass,\n classes.textFieldGroupItem,\n className,\n )}\n style={style}\n {...(hintText && { hintView, hintSize })}\n >\n {(hasOuterLabel || titleCaption) && (\n <OuterLabelWrapper isInnerLabel={labelPlacement === 'inner'}>\n {hasOuterLabel && (\n <StyledIndicatorWrapper>\n <Label id={labelId} htmlFor={id}>\n {innerLabelValue}\n </Label>\n\n {hintText && (\n <StyledHintWrapper>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n {required && (\n <StyledIndicator\n className={cx(\n classes.outerLabelPlacement,\n requiredPlacementClass,\n hasHintClass,\n )}\n />\n )}\n {optionalTextNode}\n </StyledIndicatorWrapper>\n )}\n {titleCaption && <TitleCaption>{titleCaption}</TitleCaption>}\n </OuterLabelWrapper>\n )}\n <InputWrapper\n // Ref для внутреннего использования. Не отдается наружу.\n ref={(rest as any).inputWrapperRef}\n // TODO: #1544, и после убрать classes.inputWrapper\n className={cx(\n withHasChips,\n wrapperWithoutLeftContent,\n wrapperWithoutRightContent,\n classes.inputWrapper,\n )}\n >\n {!hasOuterLabel && (\n <>\n {required && (\n <StyledIndicator\n className={cx(classes.innerLabelPlacement, requiredPlacementClass)}\n />\n )}\n {hintText && (\n <StyledHintWrapper className={classes.innerLabelPlacement}>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n </>\n )}\n {contentLeft && (\n <StyledContentLeft isClear={clear} isDefaultView={isDefaultView}>\n {contentLeft}\n </StyledContentLeft>\n )}\n <InputLabelWrapper\n tabIndex={-1}\n ref={contentRef}\n onKeyDown={handleContentKeyDown}\n className={withHasChips}\n >\n {textBefore && <StyledTextBefore>{textBefore}</StyledTextBefore>}\n {isChipEnumeration && Boolean(chips?.length) && (\n <StyledChips>\n {chips?.map(({ id: chipId, text }, index) => {\n return (\n <TextFieldChip\n id={chipId}\n ref={(element) => getRef(element, index)}\n key={`${chipId}_${index}`}\n disabled={disabled}\n readOnly={readOnly}\n value={text}\n text={text}\n onKeyDown={(event) => handleChipKeyDown(event, chipId, index)}\n onClear={() => onChipClear(chipId, index)}\n onClick={onChipClick}\n // TODO: #1547\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n _forceChipManipulationWithReadonly={\n // eslint-disable-next-line no-underscore-dangle\n (rest as any)._forceChipManipulationWithReadonly\n }\n />\n );\n })}\n </StyledChips>\n )}\n <InputContainer>\n <Input\n ref={inputForkRef}\n id={innerId}\n value={outerValue}\n aria-labelledby={labelId}\n aria-describedby={helperTextId}\n placeholder={innerPlaceholderValue}\n className={cx(hasValueClass)}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n onInput={handleInput}\n onChange={handleChange}\n onKeyDown={handleOnKeyDown}\n {...rest}\n />\n {hasInnerLabel && (\n <Label id={labelId} htmlFor={innerId}>\n {innerLabelValue}\n {optionalTextNode}\n </Label>\n )}\n {placeholderShown && !hasValue && (\n <InputPlaceholder>\n {innerPlaceholderValue}\n {hasPlaceholderOptional && optionalTextNode}\n </InputPlaceholder>\n )}\n </InputContainer>\n {textAfter && <StyledTextAfter>{textAfter}</StyledTextAfter>}\n </InputLabelWrapper>\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </InputWrapper>\n {leftHelper && <LeftHelper id={helperTextId}>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const textFieldConfig = {\n name: 'TextField',\n tag: 'div',\n layout: textFieldRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n clear: {\n css: clearCSS,\n attrs: true,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n labelPlacement: {\n css: labelPlacementCSS,\n },\n hintView: {\n css: hintViewCSS,\n },\n hintSize: {\n css: hintSizeCSS,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["optionalText","base","HINT_DEFAULT_OFFSET","textFieldRoot","Root","forwardRef","_ref","ref","_inputRef$current","_inputRef$current3","id","className","style","contentLeft","contentRight","label","labelPlacement","textBefore","textAfter","placeholder","leftHelper","_ref$enumerationType","enumerationType","_ref$requiredPlacemen","requiredPlacement","titleCaption","_ref$hintTrigger","hintTrigger","hintText","_ref$hintView","hintView","_ref$hintSize","hintSize","hintTargetIcon","_ref$hintPlacement","hintPlacement","hintHasArrow","_ref$hintOffset","hintOffset","hintWidth","hintContentLeft","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$required","required","_ref$clear","clear","optional","hasDivider","outerValue","value","values","chips","onChange","onChangeChips","onSearch","onKeyDown","rest","contentRef","useRef","inputRef","inputForkRef","useForkRef","chipsRefs","controlledRefs","_useState","useState","Boolean","current","defaultValue","_useState2","_slicedToArray","hasValue","setHasValue","_useState3","_useState4","setChips","_useState5","_useState6","isHintVisible","setIsHintVisible","uniqId","safeUseId","innerId","labelId","helperTextId","isDefaultView","isChipEnumeration","isChipsVisible","length","withHasChips","classes","hasChips","undefined","hasLabelValue","hasInnerLabel","hasOuterLabel","hasPlaceholder","innerLabelValue","innerLabelPlacementValue","innerPlaceholderValue","placeholderShown","clearClass","hasDividerClass","hasHintClass","hasHint","requiredPlacementClass","requiredAlignRight","labelPlacementClass","concat","hasValueClass","wrapperWithoutLeftContent","hasEmptyContentLeft","wrapperWithoutRightContent","hasEmptyContentRight","hintRef","useOutsideClick","hintInnerRef","hintForkRef","handleInput","event","target","handleHintShow","handleHintHide","handleHintClick","_hintInnerRef$current","stopPropagation","targetIsPopover","rootHasTarget","contains","handleChange","_event$target","maxLength","updateChips","newChips","newValues","_useKeyNavigation","useKeyNavigation","onEnterDisabled","handleInputKeydown","handleChipKeyDown","onChipClear","handleContentKeyDown","onChipClick","handleInputFocus","scrollTo","top","left","offsetLeft","behavior","focus","getRef","element","index","handleOnKeyDown","useEffect","map","text","_inputRef$current2","innerOptional","hasPlaceholderOptional","optionalTextNode","React","createElement","StyledOptionalText","_extends","onClick","cx","textFieldGroupItem","OuterLabelWrapper","isInnerLabel","StyledIndicatorWrapper","Label","htmlFor","StyledHintWrapper","HintComponent","StyledIndicator","outerLabelPlacement","TitleCaption","InputWrapper","inputWrapperRef","inputWrapper","Fragment","innerLabelPlacement","StyledContentLeft","isClear","InputLabelWrapper","tabIndex","StyledTextBefore","StyledChips","_ref2","chipId","TextFieldChip","key","onClear","_forceChipManipulationWithReadonly","InputContainer","Input","onInput","InputPlaceholder","StyledTextAfter","StyledContentRight","LeftHelper","textFieldConfig","name","tag","layout","variations","css","viewCSS","sizeCSS","clearCSS","attrs","disabledCSS","readOnlyCSS","labelPlacementCSS","hintViewCSS","hintSizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAMA,YAAY,GAAG,UAAU,CAAA;AAExB,IAAMC,IAAI,GAGhB,UAAA;AAED,IAAMC,mBAAqC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAEvCC,aAAa,GAAGA,SAAhBA,aAAaA,CAAIC,IAAmD,EAAA;AAAA,EAAA,oBAC7EC,gBAAU,CACN,UAAAC,IAAA,EAqDIC,GAAG,EACF;IAAA,IAAAC,iBAAA,EAAAC,kBAAA,CAAA;AAAA,IAAA,IApDGC,EAAE,GAAAJ,IAAA,CAAFI,EAAE;MACFC,SAAS,GAAAL,IAAA,CAATK,SAAS;MACTC,KAAK,GAAAN,IAAA,CAALM,KAAK;MAGLC,WAAW,GAAAP,IAAA,CAAXO,WAAW;MACXC,YAAY,GAAAR,IAAA,CAAZQ,YAAY;MACZC,KAAK,GAAAT,IAAA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sx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type {\n FormEventHandler,\n ChangeEventHandler,\n KeyboardEvent,\n ChangeEvent,\n MouseEventHandler,\n FocusEvent,\n} from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\nimport { css } from '@linaria/core';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\n\nimport type { ChipValues, TextFieldPrimitiveValue, TextFieldProps, TextFieldRootProps } from './TextField.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as clearCSS } from './variations/_clear/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_read-only/base';\nimport { base as labelPlacementCSS } from './variations/_label-placement/base';\nimport { base as hintViewCSS } from './variations/_hint-view/base';\nimport { base as hintSizeCSS } from './variations/_hint-size/base';\nimport {\n Input,\n InputContainer,\n LeftHelper,\n Label,\n InputWrapper,\n InputLabelWrapper,\n StyledContentLeft,\n StyledContentRight,\n StyledChips,\n StyledTextBefore,\n StyledTextAfter,\n StyledIndicator,\n StyledOptionalText,\n InputPlaceholder,\n OuterLabelWrapper,\n TitleCaption,\n StyledHintWrapper,\n StyledIndicatorWrapper,\n} from './TextField.styles';\nimport { classes } from './TextField.tokens';\nimport { TextFieldChip } from './ui';\nimport { useKeyNavigation, useValidation } from './hooks';\nimport { HintComponent } from './ui/Hint/Hint';\n\nconst optionalText = 'optional';\n\nexport const base = css`\n /* NOTE: Webkit не применяет opacity к inline тегам */\n display: block;\n`;\n\nconst HINT_DEFAULT_OFFSET: [number, number] = [0, 0];\n\nexport const textFieldRoot = (Root: RootProps<HTMLDivElement, TextFieldRootProps>) =>\n forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n style,\n\n // layout\n contentLeft,\n contentRight,\n label,\n labelPlacement,\n textBefore,\n textAfter,\n placeholder,\n leftHelper,\n enumerationType = 'plain',\n requiredPlacement = 'right',\n titleCaption,\n\n // hint\n hintTrigger = 'hover',\n hintText,\n hintView = 'default',\n hintSize = 'm',\n hintTargetIcon,\n hintPlacement = 'auto',\n hintHasArrow,\n hintOffset = HINT_DEFAULT_OFFSET,\n hintWidth,\n hintContentLeft,\n\n // variations\n view,\n size,\n readOnly = false,\n disabled = false,\n required = false,\n clear = false,\n optional,\n hasDivider,\n\n // controlled\n value: outerValue,\n chips: values,\n\n // validation\n validationType,\n options,\n passwordHidden,\n onValidate,\n\n // events\n onChange,\n onBlur,\n onChangeChips,\n onSearch,\n onKeyDown,\n\n ...rest\n },\n ref,\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n\n const controlledRefs = { contentRef, inputRef, chipsRefs };\n\n const [hasValue, setHasValue] = useState(\n Boolean(outerValue) || Boolean(inputRef?.current?.value) || Boolean(rest?.defaultValue),\n );\n const [chips, setChips] = useState<Array<ChipValues>>([]);\n const [isHintVisible, setIsHintVisible] = useState(false);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const labelId = safeUseId();\n const helperTextId = safeUseId();\n\n const isDefaultView = view === 'default' || readOnly || disabled;\n\n const isChipEnumeration = enumerationType === 'chip';\n const isChipsVisible = isChipEnumeration && Boolean(chips?.length);\n const withHasChips = isChipsVisible ? classes.hasChips : undefined;\n\n const hasLabelValue = Boolean(label);\n const hasInnerLabel = size !== 'xs' && labelPlacement === 'inner' && !isChipsVisible && hasLabelValue;\n const hasOuterLabel = labelPlacement === 'outer' && hasLabelValue;\n const hasPlaceholder = Boolean(placeholder) && !hasInnerLabel;\n\n const innerLabelValue = hasInnerLabel || hasOuterLabel ? label : undefined;\n const innerLabelPlacementValue = labelPlacement === 'inner' && !hasInnerLabel ? undefined : labelPlacement;\n\n const innerPlaceholderValue = hasPlaceholder ? placeholder : undefined;\n const placeholderShown = Boolean(innerPlaceholderValue) && !hasValue;\n\n const clearClass = clear ? classes.clear : undefined;\n const hasDividerClass = hasDivider ? classes.hasDivider : undefined;\n const hasHintClass = hintText ? classes.hasHint : undefined;\n const requiredPlacementClass = requiredPlacement === 'right' ? classes.requiredAlignRight : undefined;\n const labelPlacementClass = innerLabelPlacementValue\n ? classes[`${innerLabelPlacementValue}LabelPlacement` as keyof typeof classes]\n : undefined;\n const hasValueClass = hasValue ? classes.hasValue : undefined;\n\n const wrapperWithoutLeftContent = !contentLeft && isChipsVisible ? classes.hasEmptyContentLeft : undefined;\n const wrapperWithoutRightContent =\n !contentRight && isChipsVisible ? classes.hasEmptyContentRight : undefined;\n\n const isPasswordHidden = validationType === 'password' && passwordHidden;\n\n const hintRef = useOutsideClick<HTMLDivElement>(() => {\n setIsHintVisible(false);\n });\n const hintInnerRef = useRef<HTMLDivElement>(null);\n const hintForkRef = useForkRef(hintRef, hintInnerRef);\n\n const handleInput: FormEventHandler<HTMLInputElement> = (event) => {\n setHasValue(Boolean((event.target as HTMLInputElement).value));\n };\n\n const handleHintShow = () => setIsHintVisible(true);\n const handleHintHide = () => setIsHintVisible(false);\n const handleHintClick: MouseEventHandler = (event) => {\n if (!hintText || hintTrigger !== 'click') {\n return;\n }\n\n event.stopPropagation();\n const targetIsPopover = event.target === hintInnerRef.current;\n const rootHasTarget = hintInnerRef.current?.contains(event.target as Element);\n\n if (!targetIsPopover && !rootHasTarget) {\n setIsHintVisible(true);\n }\n };\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n if (disabled || readOnly) {\n return;\n }\n\n const { maxLength, value } = event.target;\n\n if (maxLength !== -1 && value.length > maxLength) {\n return;\n }\n\n onChange?.(event);\n };\n\n const updateChips = (newChips: Array<ChipValues>, newValues: Array<TextFieldPrimitiveValue>) => {\n setChips(newChips);\n onChangeChips?.(newValues);\n };\n\n const { handleValidationBlur, handleValidationKeyDown } = useValidation({\n validationType,\n options,\n onValidate,\n });\n\n const { handleInputKeydown, handleChipKeyDown, onChipClear, handleContentKeyDown } = useKeyNavigation({\n controlledRefs,\n disabled,\n readOnly,\n chips,\n enumerationType,\n updateChips,\n onSearch,\n onChange,\n onEnterDisabled: (rest as any).onEnterDisabled,\n });\n\n const onChipClick = (event: React.MouseEvent<HTMLButtonElement>) => event.stopPropagation();\n\n const handleInputFocus = () => {\n if (readOnly || disabled || !inputRef?.current) {\n return;\n }\n\n inputRef.current.scrollTo({\n top: 0,\n left: inputRef.current.offsetLeft,\n behavior: 'smooth',\n });\n\n inputRef.current.focus();\n };\n\n const handleInputBlur = (event: FocusEvent<HTMLInputElement>) => {\n if (onBlur) {\n onBlur(event);\n }\n\n handleValidationBlur(event);\n };\n\n const getRef = (element: HTMLButtonElement | null, index: number) => {\n if (element && chipsRefs?.current) {\n chipsRefs.current[index] = element;\n }\n };\n\n const handleOnKeyDown = (event: ChangeEvent<HTMLInputElement> & KeyboardEvent<HTMLInputElement>) => {\n handleInputKeydown(event);\n handleValidationKeyDown(event);\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n\n useEffect(() => {\n if (!isChipEnumeration && !values?.length) {\n return;\n }\n\n const newChips =\n values?.map((value, index) => ({\n id: `${index}_${value}`,\n text: value,\n })) || [];\n\n setChips(newChips);\n }, [isChipEnumeration, values]);\n\n useEffect(() => {\n setHasValue(Boolean(rest?.defaultValue));\n }, [rest.defaultValue]);\n\n useEffect(() => {\n setHasValue(Boolean(outerValue) || Boolean(inputRef?.current?.value));\n }, [outerValue, inputRef?.current?.value]);\n\n const innerOptional = Boolean(required ? false : optional);\n const hasPlaceholderOptional = innerOptional && !innerLabelValue && !hasOuterLabel;\n const optionalTextNode = innerOptional ? (\n <StyledOptionalText>\n {Boolean(hasPlaceholderOptional ? innerPlaceholderValue : innerLabelValue) && '\\xa0'}\n {optionalText}\n </StyledOptionalText>\n ) : null;\n\n return (\n <Root\n view={view}\n size={size}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n clear={clear}\n labelPlacement={innerLabelPlacementValue}\n onClick={handleInputFocus}\n className={cx(\n labelPlacementClass,\n clearClass,\n hasDividerClass,\n hasHintClass,\n classes.textFieldGroupItem,\n className,\n )}\n style={style}\n {...(hintText && { hintView, hintSize })}\n >\n {(hasOuterLabel || titleCaption) && (\n <OuterLabelWrapper isInnerLabel={labelPlacement === 'inner'}>\n {hasOuterLabel && (\n <StyledIndicatorWrapper>\n <Label id={labelId} htmlFor={id}>\n {innerLabelValue}\n </Label>\n\n {hintText && (\n <StyledHintWrapper>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n {required && (\n <StyledIndicator\n className={cx(\n classes.outerLabelPlacement,\n requiredPlacementClass,\n hasHintClass,\n )}\n />\n )}\n {optionalTextNode}\n </StyledIndicatorWrapper>\n )}\n {titleCaption && <TitleCaption>{titleCaption}</TitleCaption>}\n </OuterLabelWrapper>\n )}\n <InputWrapper\n // Ref для внутреннего использования. Не отдается наружу.\n ref={(rest as any).inputWrapperRef}\n // TODO: #1544, и после убрать classes.inputWrapper\n className={cx(\n withHasChips,\n wrapperWithoutLeftContent,\n wrapperWithoutRightContent,\n classes.inputWrapper,\n )}\n >\n {!hasOuterLabel && (\n <>\n {required && (\n <StyledIndicator\n className={cx(classes.innerLabelPlacement, requiredPlacementClass)}\n />\n )}\n {hintText && (\n <StyledHintWrapper className={classes.innerLabelPlacement}>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n </>\n )}\n {contentLeft && (\n <StyledContentLeft isClear={clear} isDefaultView={isDefaultView}>\n {contentLeft}\n </StyledContentLeft>\n )}\n <InputLabelWrapper\n tabIndex={-1}\n ref={contentRef}\n onKeyDown={handleContentKeyDown}\n className={withHasChips}\n >\n {textBefore && <StyledTextBefore>{textBefore}</StyledTextBefore>}\n {isChipEnumeration && Boolean(chips?.length) && (\n <StyledChips>\n {chips?.map(({ id: chipId, text }, index) => {\n return (\n <TextFieldChip\n id={chipId}\n ref={(element) => getRef(element, index)}\n key={`${chipId}_${index}`}\n disabled={disabled}\n readOnly={readOnly}\n value={text}\n text={text}\n onKeyDown={(event) => handleChipKeyDown(event, chipId, index)}\n onClear={() => onChipClear(chipId, index)}\n onClick={onChipClick}\n // TODO: #1547\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n _forceChipManipulationWithReadonly={\n // eslint-disable-next-line no-underscore-dangle\n (rest as any)._forceChipManipulationWithReadonly\n }\n />\n );\n })}\n </StyledChips>\n )}\n <InputContainer>\n <Input\n ref={inputForkRef}\n id={innerId}\n value={outerValue}\n aria-labelledby={labelId}\n aria-describedby={helperTextId}\n placeholder={innerPlaceholderValue}\n className={cx(hasValueClass)}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n onInput={handleInput}\n onChange={handleChange}\n onKeyDown={handleOnKeyDown}\n onBlur={handleInputBlur}\n {...rest}\n {...(isPasswordHidden && { type: 'password' })}\n />\n {hasInnerLabel && (\n <Label id={labelId} htmlFor={innerId}>\n {innerLabelValue}\n {optionalTextNode}\n </Label>\n )}\n {placeholderShown && !hasValue && (\n <InputPlaceholder>\n {innerPlaceholderValue}\n {hasPlaceholderOptional && optionalTextNode}\n </InputPlaceholder>\n )}\n </InputContainer>\n {textAfter && <StyledTextAfter>{textAfter}</StyledTextAfter>}\n </InputLabelWrapper>\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </InputWrapper>\n {leftHelper && <LeftHelper id={helperTextId}>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const textFieldConfig = {\n name: 'TextField',\n tag: 'div',\n layout: textFieldRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n clear: {\n css: clearCSS,\n attrs: true,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n labelPlacement: {\n css: labelPlacementCSS,\n },\n hintView: {\n css: hintViewCSS,\n },\n hintSize: {\n css: hintSizeCSS,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["optionalText","base","HINT_DEFAULT_OFFSET","textFieldRoot","Root","forwardRef","_ref","ref","_inputRef$current","_inputRef$current3","id","className","style","contentLeft","contentRight","label","labelPlacement","textBefore","textAfter","placeholder","leftHelper","_ref$enumerationType","enumerationType","_ref$requiredPlacemen","requiredPlacement","titleCaption","_ref$hintTrigger","hintTrigger","hintText","_ref$hintView","hintView","_ref$hintSize","hintSize","hintTargetIcon","_ref$hintPlacement","hintPlacement","hintHasArrow","_ref$hintOffset","hintOffset","hintWidth","hintContentLeft","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$required","required","_ref$clear","clear","optional","hasDivider","outerValue","value","values","chips","validationType","options","passwordHidden","onValidate","onChange","onBlur","onChangeChips","onSearch","onKeyDown","rest","contentRef","useRef","inputRef","inputForkRef","useForkRef","chipsRefs","controlledRefs","_useState","useState","Boolean","current","defaultValue","_useState2","_slicedToArray","hasValue","setHasValue","_useState3","_useState4","setChips","_useState5","_useState6","isHintVisible","setIsHintVisible","uniqId","safeUseId","innerId","labelId","helperTextId","isDefaultView","isChipEnumeration","isChipsVisible","length","withHasChips","classes","hasChips","undefined","hasLabelValue","hasInnerLabel","hasOuterLabel","hasPlaceholder","innerLabelValue","innerLabelPlacementValue","innerPlaceholderValue","placeholderShown","clearClass","hasDividerClass","hasHintClass","hasHint","requiredPlacementClass","requiredAlignRight","labelPlacementClass","concat","hasValueClass","wrapperWithoutLeftContent","hasEmptyContentLeft","wrapperWithoutRightContent","hasEmptyContentRight","isPasswordHidden","hintRef","useOutsideClick","hintInnerRef","hintForkRef","handleInput","event","target","handleHintShow","handleHintHide","handleHintClick","_hintInnerRef$current","stopPropagation","targetIsPopover","rootHasTarget","contains","handleChange","_event$target","maxLength","updateChips","newChips","newValues","_useValidation","useValidation","handleValidationBlur","handleValidationKeyDown","_useKeyNavigation","useKeyNavigation","onEnterDisabled","handleInputKeydown","handleChipKeyDown","onChipClear","handleContentKeyDown","onChipClick","handleInputFocus","scrollTo","top","left","offsetLeft","behavior","focus","handleInputBlur","getRef","element","index","handleOnKeyDown","useEffect","map","text","_inputRef$current2","innerOptional","hasPlaceholderOptional","optionalTextNode","React","createElement","StyledOptionalText","_extends","onClick","cx","textFieldGroupItem","OuterLabelWrapper","isInnerLabel","StyledIndicatorWrapper","Label","htmlFor","StyledHintWrapper","HintComponent","StyledIndicator","outerLabelPlacement","TitleCaption","InputWrapper","inputWrapperRef","inputWrapper","Fragment","innerLabelPlacement","StyledContentLeft","isClear","InputLabelWrapper","tabIndex","StyledTextBefore","StyledChips","_ref2","chipId","TextFieldChip","key","onClear","_forceChipManipulationWithReadonly","InputContainer","Input","onInput","type","InputPlaceholder","StyledTextAfter","StyledContentRight","LeftHelper","textFieldConfig","name","tag","layout","variations","css","viewCSS","sizeCSS","clearCSS","attrs","disabledCSS","readOnlyCSS","labelPlacementCSS","hintViewCSS","hintSizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAMA,YAAY,GAAG,UAAU,CAAA;AAExB,IAAMC,IAAI,GAGhB,UAAA;AAED,IAAMC,mBAAqC,GAAG,CAAC,CAAC,EAA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AAA;AACV,GAAA;AACJ;;;;;;"}
|
@@ -0,0 +1,273 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
6
|
+
var React = require('react');
|
7
|
+
var constants = require('../../../utils/constants.js');
|
8
|
+
|
9
|
+
var getUniqueKeys = function getUniqueKeys(lengthOptions) {
|
10
|
+
return lengthOptions.map(function (option) {
|
11
|
+
return option.replace(/min|max|Length/g, '');
|
12
|
+
});
|
13
|
+
};
|
14
|
+
var validateLenghtOptions = function validateLenghtOptions(options) {
|
15
|
+
var _options$minLength, _options$maxLength;
|
16
|
+
if (!options) {
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
var minHash = Object.keys(options).filter(function (key) {
|
20
|
+
return key.startsWith('min');
|
21
|
+
});
|
22
|
+
var maxHash = Object.keys(options).filter(function (key) {
|
23
|
+
return key.startsWith('max');
|
24
|
+
});
|
25
|
+
var minMaxUniqueKeys = (minHash === null || minHash === void 0 ? void 0 : minHash.length) >= (maxHash === null || maxHash === void 0 ? void 0 : maxHash.length) ? getUniqueKeys(minHash) : getUniqueKeys(maxHash);
|
26
|
+
var globalMinValue = Number(options === null || options === void 0 || (_options$minLength = options.minLength) === null || _options$minLength === void 0 ? void 0 : _options$minLength.value);
|
27
|
+
var globalMaxValue = Number(options === null || options === void 0 || (_options$maxLength = options.maxLength) === null || _options$maxLength === void 0 ? void 0 : _options$maxLength.value);
|
28
|
+
if (globalMinValue <= 0) {
|
29
|
+
console.error('minLength must be more than 0');
|
30
|
+
}
|
31
|
+
if (globalMaxValue <= 0) {
|
32
|
+
console.error('maxLength must be more than 0');
|
33
|
+
}
|
34
|
+
if (globalMaxValue <= globalMinValue) {
|
35
|
+
console.error('maxLength must be more than minLength');
|
36
|
+
}
|
37
|
+
minMaxUniqueKeys.forEach(function (key) {
|
38
|
+
var _options$optionMinKey, _options$optionMaxKey;
|
39
|
+
var optionMinKey = "min".concat(key, "Length");
|
40
|
+
var optionMaxKey = "max".concat(key, "Length");
|
41
|
+
var minValue = Number(options === null || options === void 0 || (_options$optionMinKey = options[optionMinKey]) === null || _options$optionMinKey === void 0 ? void 0 : _options$optionMinKey.value);
|
42
|
+
var maxValue = Number(options === null || options === void 0 || (_options$optionMaxKey = options[optionMaxKey]) === null || _options$optionMaxKey === void 0 ? void 0 : _options$optionMaxKey.value);
|
43
|
+
if (!minValue || minValue <= 0) {
|
44
|
+
console.error("".concat(optionMinKey, " must be more than 0"));
|
45
|
+
}
|
46
|
+
if (!maxValue || maxValue <= 0) {
|
47
|
+
console.error("".concat(optionMaxKey, " must be more than 0"));
|
48
|
+
}
|
49
|
+
if (maxValue <= minValue) {
|
50
|
+
console.error("".concat(optionMaxKey, " must be more than ").concat(optionMinKey));
|
51
|
+
}
|
52
|
+
});
|
53
|
+
};
|
54
|
+
var validateWithLengthOptions = function validateWithLengthOptions(value, options, optionKey) {
|
55
|
+
var _options$optionMinKey2, _options$optionMaxKey2;
|
56
|
+
var optionMinKey = "min".concat(optionKey, "Length");
|
57
|
+
var optionMaxKey = "max".concat(optionKey, "Length");
|
58
|
+
var minValue = Number((_options$optionMinKey2 = options[optionMinKey]) === null || _options$optionMinKey2 === void 0 ? void 0 : _options$optionMinKey2.value);
|
59
|
+
var maxValue = Number((_options$optionMaxKey2 = options[optionMaxKey]) === null || _options$optionMaxKey2 === void 0 ? void 0 : _options$optionMaxKey2.value);
|
60
|
+
if (minValue && value.length < minValue) {
|
61
|
+
var _options$optionMinKey3;
|
62
|
+
return {
|
63
|
+
isValid: false,
|
64
|
+
errorMessage: ((_options$optionMinKey3 = options[optionMinKey]) === null || _options$optionMinKey3 === void 0 ? void 0 : _options$optionMinKey3.errorMessage) || "".concat(optionMinKey, " is too short")
|
65
|
+
};
|
66
|
+
}
|
67
|
+
if (maxValue && value.length > maxValue) {
|
68
|
+
var _options$optionMaxKey3;
|
69
|
+
return {
|
70
|
+
isValid: false,
|
71
|
+
errorMessage: ((_options$optionMaxKey3 = options[optionMaxKey]) === null || _options$optionMaxKey3 === void 0 ? void 0 : _options$optionMaxKey3.errorMessage) || "".concat(optionMaxKey, " is too long")
|
72
|
+
};
|
73
|
+
}
|
74
|
+
return {
|
75
|
+
isValid: true
|
76
|
+
};
|
77
|
+
};
|
78
|
+
var validateEmailDomainsLists = function validateEmailDomainsLists(blacklistDomains, whitelistDomains) {
|
79
|
+
if (!(blacklistDomains !== null && blacklistDomains !== void 0 && blacklistDomains.length) || !(whitelistDomains !== null && whitelistDomains !== void 0 && whitelistDomains.length)) {
|
80
|
+
return;
|
81
|
+
}
|
82
|
+
var uniqueDomains = new Set([].concat(_rollupPluginBabelHelpers.toConsumableArray(blacklistDomains), _rollupPluginBabelHelpers.toConsumableArray(whitelistDomains)));
|
83
|
+
if (uniqueDomains.size !== blacklistDomains.length + whitelistDomains.length) {
|
84
|
+
console.error('Blacklisted domains must not overlap whitelisted domains');
|
85
|
+
}
|
86
|
+
};
|
87
|
+
var validateWithDomainsLists = function validateWithDomainsLists(domainWithZone, options) {
|
88
|
+
var _options$whitelistDom, _options$blacklistDom, _options$blacklistDom2, _options$whitelistDom2;
|
89
|
+
if (!((_options$whitelistDom = options.whitelistDomains) !== null && _options$whitelistDom !== void 0 && (_options$whitelistDom = _options$whitelistDom.value) !== null && _options$whitelistDom !== void 0 && _options$whitelistDom.length) && !((_options$blacklistDom = options.blacklistDomains) !== null && _options$blacklistDom !== void 0 && (_options$blacklistDom = _options$blacklistDom.value) !== null && _options$blacklistDom !== void 0 && _options$blacklistDom.length)) {
|
90
|
+
return {
|
91
|
+
isValid: true
|
92
|
+
};
|
93
|
+
}
|
94
|
+
if (options !== null && options !== void 0 && (_options$blacklistDom2 = options.blacklistDomains) !== null && _options$blacklistDom2 !== void 0 && (_options$blacklistDom2 = _options$blacklistDom2.value) !== null && _options$blacklistDom2 !== void 0 && _options$blacklistDom2.includes(domainWithZone)) {
|
95
|
+
var _options$blacklistDom3;
|
96
|
+
return {
|
97
|
+
isValid: false,
|
98
|
+
errorMessage: ((_options$blacklistDom3 = options.blacklistDomains) === null || _options$blacklistDom3 === void 0 ? void 0 : _options$blacklistDom3.errorMessage) || 'Domain is blacklisted'
|
99
|
+
};
|
100
|
+
}
|
101
|
+
if (!(options !== null && options !== void 0 && (_options$whitelistDom2 = options.whitelistDomains) !== null && _options$whitelistDom2 !== void 0 && (_options$whitelistDom2 = _options$whitelistDom2.value) !== null && _options$whitelistDom2 !== void 0 && _options$whitelistDom2.includes(domainWithZone))) {
|
102
|
+
var _options$whitelistDom3;
|
103
|
+
return {
|
104
|
+
isValid: false,
|
105
|
+
errorMessage: ((_options$whitelistDom3 = options.whitelistDomains) === null || _options$whitelistDom3 === void 0 ? void 0 : _options$whitelistDom3.errorMessage) || 'Domain is not whitelisted'
|
106
|
+
};
|
107
|
+
}
|
108
|
+
return {
|
109
|
+
isValid: true
|
110
|
+
};
|
111
|
+
};
|
112
|
+
var validateEmail = function validateEmail(email, options) {
|
113
|
+
var _options$customEmailR, _options$minLength2, _options$maxLength2;
|
114
|
+
if (!email) {
|
115
|
+
return {
|
116
|
+
isValid: true
|
117
|
+
};
|
118
|
+
}
|
119
|
+
var emailRegex = (options === null || options === void 0 || (_options$customEmailR = options.customEmailRegex) === null || _options$customEmailR === void 0 ? void 0 : _options$customEmailR.value) || constants.emailPattern;
|
120
|
+
if (!emailRegex.test(email)) {
|
121
|
+
var _options$customEmailR2;
|
122
|
+
return {
|
123
|
+
isValid: false,
|
124
|
+
errorMessage: (options === null || options === void 0 || (_options$customEmailR2 = options.customEmailRegex) === null || _options$customEmailR2 === void 0 ? void 0 : _options$customEmailR2.errorMessage) || 'Invalid email'
|
125
|
+
};
|
126
|
+
}
|
127
|
+
if (!options) {
|
128
|
+
return {
|
129
|
+
isValid: true
|
130
|
+
};
|
131
|
+
}
|
132
|
+
if ((_options$minLength2 = options.minLength) !== null && _options$minLength2 !== void 0 && _options$minLength2.value && email.length < options.minLength.value) {
|
133
|
+
var _options$minLength3;
|
134
|
+
return {
|
135
|
+
isValid: false,
|
136
|
+
errorMessage: ((_options$minLength3 = options.minLength) === null || _options$minLength3 === void 0 ? void 0 : _options$minLength3.errorMessage) || 'Email is too short'
|
137
|
+
};
|
138
|
+
}
|
139
|
+
if ((_options$maxLength2 = options.maxLength) !== null && _options$maxLength2 !== void 0 && _options$maxLength2.value && email.length > options.maxLength.value) {
|
140
|
+
var _options$maxLength3;
|
141
|
+
return {
|
142
|
+
isValid: false,
|
143
|
+
errorMessage: ((_options$maxLength3 = options.maxLength) === null || _options$maxLength3 === void 0 ? void 0 : _options$maxLength3.errorMessage) || 'Email is too long'
|
144
|
+
};
|
145
|
+
}
|
146
|
+
var emailHost = email.split('@')[0];
|
147
|
+
var emailDomainWithZone = email.split('@')[1];
|
148
|
+
var emailZone = emailDomainWithZone.split('.').pop();
|
149
|
+
if (!(emailZone !== null && emailZone !== void 0 && emailZone.length)) {
|
150
|
+
var _options$customEmailR3;
|
151
|
+
return {
|
152
|
+
isValid: false,
|
153
|
+
errorMessage: ((_options$customEmailR3 = options.customEmailRegex) === null || _options$customEmailR3 === void 0 ? void 0 : _options$customEmailR3.errorMessage) || 'Invalid email'
|
154
|
+
};
|
155
|
+
}
|
156
|
+
var emailDomain = emailDomainWithZone.substring(0, emailDomainWithZone.length - (emailZone.length + 1));
|
157
|
+
var hostValidation = validateWithLengthOptions(emailHost, options, 'Host');
|
158
|
+
if (!hostValidation.isValid) {
|
159
|
+
return hostValidation;
|
160
|
+
}
|
161
|
+
var domainValidation = validateWithLengthOptions(emailDomain, options, 'Domain');
|
162
|
+
if (!domainValidation.isValid) {
|
163
|
+
return domainValidation;
|
164
|
+
}
|
165
|
+
var zoneValidation = validateWithLengthOptions(emailZone, options, 'Zone');
|
166
|
+
if (!zoneValidation.isValid) {
|
167
|
+
return zoneValidation;
|
168
|
+
}
|
169
|
+
var domainWithZoneValidation = validateWithDomainsLists(emailDomainWithZone, options);
|
170
|
+
if (!domainWithZoneValidation.isValid) {
|
171
|
+
return domainWithZoneValidation;
|
172
|
+
}
|
173
|
+
return {
|
174
|
+
isValid: true
|
175
|
+
};
|
176
|
+
};
|
177
|
+
var validatePassword = function validatePassword(password, options) {
|
178
|
+
var _options$minLength4, _options$maxLength4, _options$includeUpper, _options$includeLower, _options$includeDigit, _options$includeSpeci;
|
179
|
+
if (!password || !options) {
|
180
|
+
return {
|
181
|
+
isValid: true
|
182
|
+
};
|
183
|
+
}
|
184
|
+
if ((_options$minLength4 = options.minLength) !== null && _options$minLength4 !== void 0 && _options$minLength4.value && password.length < options.minLength.value) {
|
185
|
+
var _options$minLength5;
|
186
|
+
return {
|
187
|
+
isValid: false,
|
188
|
+
errorMessage: ((_options$minLength5 = options.minLength) === null || _options$minLength5 === void 0 ? void 0 : _options$minLength5.errorMessage) || 'Password is too short'
|
189
|
+
};
|
190
|
+
}
|
191
|
+
if ((_options$maxLength4 = options.maxLength) !== null && _options$maxLength4 !== void 0 && _options$maxLength4.value && password.length > options.maxLength.value) {
|
192
|
+
var _options$maxLength5;
|
193
|
+
return {
|
194
|
+
isValid: false,
|
195
|
+
errorMessage: ((_options$maxLength5 = options.maxLength) === null || _options$maxLength5 === void 0 ? void 0 : _options$maxLength5.errorMessage) || 'Password is too long'
|
196
|
+
};
|
197
|
+
}
|
198
|
+
var lowercasedPassword = password.toLowerCase();
|
199
|
+
var uppercasedPassword = password.toUpperCase();
|
200
|
+
if ((_options$includeUpper = options.includeUppercase) !== null && _options$includeUpper !== void 0 && _options$includeUpper.value && password === lowercasedPassword) {
|
201
|
+
var _options$includeUpper2;
|
202
|
+
return {
|
203
|
+
isValid: false,
|
204
|
+
errorMessage: ((_options$includeUpper2 = options.includeUppercase) === null || _options$includeUpper2 === void 0 ? void 0 : _options$includeUpper2.errorMessage) || 'Password must contain at least one uppercase letter'
|
205
|
+
};
|
206
|
+
}
|
207
|
+
if ((_options$includeLower = options.includeLowercase) !== null && _options$includeLower !== void 0 && _options$includeLower.value && password === uppercasedPassword) {
|
208
|
+
var _options$includeLower2;
|
209
|
+
return {
|
210
|
+
isValid: false,
|
211
|
+
errorMessage: ((_options$includeLower2 = options.includeLowercase) === null || _options$includeLower2 === void 0 ? void 0 : _options$includeLower2.errorMessage) || 'Password must contain at least one lowercase letter'
|
212
|
+
};
|
213
|
+
}
|
214
|
+
if ((_options$includeDigit = options.includeDigits) !== null && _options$includeDigit !== void 0 && _options$includeDigit.value && !/\d/.test(password)) {
|
215
|
+
var _options$includeDigit2;
|
216
|
+
return {
|
217
|
+
isValid: false,
|
218
|
+
errorMessage: ((_options$includeDigit2 = options.includeDigits) === null || _options$includeDigit2 === void 0 ? void 0 : _options$includeDigit2.errorMessage) || 'Password must contain digits'
|
219
|
+
};
|
220
|
+
}
|
221
|
+
if ((_options$includeSpeci = options.includeSpecialSymbols) !== null && _options$includeSpeci !== void 0 && _options$includeSpeci.value && !constants.specialCharacters.test(password)) {
|
222
|
+
var _options$includeSpeci2;
|
223
|
+
return {
|
224
|
+
isValid: false,
|
225
|
+
errorMessage: ((_options$includeSpeci2 = options.includeSpecialSymbols) === null || _options$includeSpeci2 === void 0 ? void 0 : _options$includeSpeci2.errorMessage) || 'Password must contain special characters'
|
226
|
+
};
|
227
|
+
}
|
228
|
+
return {
|
229
|
+
isValid: true
|
230
|
+
};
|
231
|
+
};
|
232
|
+
var validationVariants = {
|
233
|
+
email: validateEmail,
|
234
|
+
password: validatePassword
|
235
|
+
};
|
236
|
+
var useValidation = function useValidation(_ref) {
|
237
|
+
var validationType = _ref.validationType,
|
238
|
+
options = _ref.options,
|
239
|
+
onValidate = _ref.onValidate;
|
240
|
+
var handleValidationBlur = function handleValidationBlur(event) {
|
241
|
+
if (!validationType) {
|
242
|
+
return;
|
243
|
+
}
|
244
|
+
var validationResult = validationVariants[validationType](event.target.value, options);
|
245
|
+
onValidate === null || onValidate === void 0 || onValidate(validationResult);
|
246
|
+
};
|
247
|
+
var handleValidationKeyDown = function handleValidationKeyDown(event) {
|
248
|
+
if (!validationType) {
|
249
|
+
return;
|
250
|
+
}
|
251
|
+
if (event.keyCode === constants.keyCodes.Enter) {
|
252
|
+
event.preventDefault();
|
253
|
+
var _ref2 = event.target,
|
254
|
+
value = _ref2.value;
|
255
|
+
var validationResult = validationVariants[validationType](value, options);
|
256
|
+
onValidate === null || onValidate === void 0 || onValidate(validationResult);
|
257
|
+
}
|
258
|
+
};
|
259
|
+
React.useEffect(function () {
|
260
|
+
validateLenghtOptions(options);
|
261
|
+
if (validationType === 'email') {
|
262
|
+
var _whitelistDomains, _blacklistDomains;
|
263
|
+
validateEmailDomainsLists(options === null || options === void 0 || (_whitelistDomains = options.whitelistDomains) === null || _whitelistDomains === void 0 ? void 0 : _whitelistDomains.value, (_blacklistDomains = options.blacklistDomains) === null || _blacklistDomains === void 0 ? void 0 : _blacklistDomains.value);
|
264
|
+
}
|
265
|
+
}, []);
|
266
|
+
return {
|
267
|
+
handleValidationBlur: handleValidationBlur,
|
268
|
+
handleValidationKeyDown: handleValidationKeyDown
|
269
|
+
};
|
270
|
+
};
|
271
|
+
|
272
|
+
exports.useValidation = useValidation;
|
273
|
+
//# sourceMappingURL=useValidation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useValidation.js","sources":["../../../../src/components/TextField/hooks/useValidation.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { FocusEvent, KeyboardEvent } from 'react';\n\nimport type { EmailValidationOptions, PasswordValidationOptions, UseValidationArgs } from '../TextField.types';\nimport { constants } from '../../../utils';\n\nconst getUniqueKeys = (lengthOptions: string[]) => {\n return lengthOptions.map((option) => option.replace(/min|max|Length/g, ''));\n};\n\nconst validateLenghtOptions = (options?: PasswordValidationOptions | EmailValidationOptions) => {\n if (!options) {\n return;\n }\n\n const minHash = Object.keys(options).filter((key) => {\n return key.startsWith('min');\n });\n const maxHash = Object.keys(options).filter((key) => {\n return key.startsWith('max');\n });\n\n const minMaxUniqueKeys = minHash?.length >= maxHash?.length ? getUniqueKeys(minHash) : getUniqueKeys(maxHash);\n\n const globalMinValue = Number(options?.minLength?.value);\n const globalMaxValue = Number(options?.maxLength?.value);\n\n if (globalMinValue <= 0) {\n console.error('minLength must be more than 0');\n }\n\n if (globalMaxValue <= 0) {\n console.error('maxLength must be more than 0');\n }\n\n if (globalMaxValue <= globalMinValue) {\n console.error('maxLength must be more than minLength');\n }\n\n minMaxUniqueKeys.forEach((key) => {\n const optionMinKey = `min${key}Length` as keyof typeof options;\n const optionMaxKey = `max${key}Length` as keyof typeof options;\n\n const minValue = Number(options?.[optionMinKey]?.value);\n const maxValue = Number(options?.[optionMaxKey]?.value);\n\n if (!minValue || minValue <= 0) {\n console.error(`${optionMinKey} must be more than 0`);\n }\n\n if (!maxValue || maxValue <= 0) {\n console.error(`${optionMaxKey} must be more than 0`);\n }\n\n if (maxValue <= minValue) {\n console.error(`${optionMaxKey} must be more than ${optionMinKey}`);\n }\n });\n};\n\nconst validateWithLengthOptions = (\n value: string,\n options: PasswordValidationOptions | EmailValidationOptions,\n optionKey: string,\n) => {\n const optionMinKey = `min${optionKey}Length` as keyof typeof options;\n const optionMaxKey = `max${optionKey}Length` as keyof typeof options;\n\n const minValue = Number(options[optionMinKey]?.value);\n const maxValue = Number(options[optionMaxKey]?.value);\n\n if (minValue && value.length < minValue) {\n return {\n isValid: false,\n errorMessage: options[optionMinKey]?.errorMessage || `${optionMinKey} is too short`,\n };\n }\n\n if (maxValue && value.length > maxValue) {\n return {\n isValid: false,\n errorMessage: options[optionMaxKey]?.errorMessage || `${optionMaxKey} is too long`,\n };\n }\n\n return { isValid: true };\n};\n\nconst validateEmailDomainsLists = (blacklistDomains?: string[], whitelistDomains?: string[]) => {\n if (!blacklistDomains?.length || !whitelistDomains?.length) {\n return;\n }\n\n const uniqueDomains = new Set([...blacklistDomains, ...whitelistDomains]);\n\n if (uniqueDomains.size !== blacklistDomains.length + whitelistDomains.length) {\n console.error('Blacklisted domains must not overlap whitelisted domains');\n }\n};\n\nconst validateWithDomainsLists = (domainWithZone: string, options: EmailValidationOptions) => {\n if (!options.whitelistDomains?.value?.length && !options.blacklistDomains?.value?.length) {\n return { isValid: true };\n }\n\n if (options?.blacklistDomains?.value?.includes(domainWithZone)) {\n return {\n isValid: false,\n errorMessage: options.blacklistDomains?.errorMessage || 'Domain is blacklisted',\n };\n }\n\n if (!options?.whitelistDomains?.value?.includes(domainWithZone)) {\n return {\n isValid: false,\n errorMessage: options.whitelistDomains?.errorMessage || 'Domain is not whitelisted',\n };\n }\n\n return { isValid: true };\n};\n\nconst validateEmail = (email: string, options?: EmailValidationOptions) => {\n if (!email) {\n return { isValid: true };\n }\n\n const emailRegex = options?.customEmailRegex?.value || constants.emailPattern;\n if (!emailRegex.test(email)) {\n return { isValid: false, errorMessage: options?.customEmailRegex?.errorMessage || 'Invalid email' };\n }\n\n if (!options) {\n return { isValid: true };\n }\n\n if (options.minLength?.value && email.length < options.minLength.value) {\n return { isValid: false, errorMessage: options.minLength?.errorMessage || 'Email is too short' };\n }\n\n if (options.maxLength?.value && email.length > options.maxLength.value) {\n return { isValid: false, errorMessage: options.maxLength?.errorMessage || 'Email is too long' };\n }\n\n const emailHost = email.split('@')[0];\n const emailDomainWithZone = email.split('@')[1];\n const emailZone = emailDomainWithZone.split('.').pop();\n\n if (!emailZone?.length) {\n return { isValid: false, errorMessage: options.customEmailRegex?.errorMessage || 'Invalid email' };\n }\n\n const emailDomain = emailDomainWithZone.substring(0, emailDomainWithZone.length - (emailZone.length + 1));\n\n const hostValidation = validateWithLengthOptions(emailHost, options, 'Host');\n if (!hostValidation.isValid) {\n return hostValidation;\n }\n\n const domainValidation = validateWithLengthOptions(emailDomain, options, 'Domain');\n if (!domainValidation.isValid) {\n return domainValidation;\n }\n\n const zoneValidation = validateWithLengthOptions(emailZone, options, 'Zone');\n if (!zoneValidation.isValid) {\n return zoneValidation;\n }\n\n const domainWithZoneValidation = validateWithDomainsLists(emailDomainWithZone, options);\n if (!domainWithZoneValidation.isValid) {\n return domainWithZoneValidation;\n }\n\n return { isValid: true };\n};\n\nconst validatePassword = (password: string, options?: PasswordValidationOptions) => {\n if (!password || !options) {\n return { isValid: true };\n }\n\n if (options.minLength?.value && password.length < options.minLength.value) {\n return { isValid: false, errorMessage: options.minLength?.errorMessage || 'Password is too short' };\n }\n\n if (options.maxLength?.value && password.length > options.maxLength.value) {\n return { isValid: false, errorMessage: options.maxLength?.errorMessage || 'Password is too long' };\n }\n\n const lowercasedPassword = password.toLowerCase();\n const uppercasedPassword = password.toUpperCase();\n\n if (options.includeUppercase?.value && password === lowercasedPassword) {\n return {\n isValid: false,\n errorMessage:\n options.includeUppercase?.errorMessage || 'Password must contain at least one uppercase letter',\n };\n }\n\n if (options.includeLowercase?.value && password === uppercasedPassword) {\n return {\n isValid: false,\n errorMessage:\n options.includeLowercase?.errorMessage || 'Password must contain at least one lowercase letter',\n };\n }\n\n if (options.includeDigits?.value && !/\\d/.test(password)) {\n return { isValid: false, errorMessage: options.includeDigits?.errorMessage || 'Password must contain digits' };\n }\n\n if (options.includeSpecialSymbols?.value && !constants.specialCharacters.test(password)) {\n return {\n isValid: false,\n errorMessage: options.includeSpecialSymbols?.errorMessage || 'Password must contain special characters',\n };\n }\n\n return { isValid: true };\n};\n\nconst validationVariants = {\n email: validateEmail,\n password: validatePassword,\n};\n\nexport const useValidation = ({ validationType, options, onValidate }: UseValidationArgs) => {\n const handleValidationBlur = (event: FocusEvent<HTMLInputElement>) => {\n if (!validationType) {\n return;\n }\n\n const validationResult = validationVariants[validationType](event.target.value, options);\n\n onValidate?.(validationResult);\n };\n\n const handleValidationKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (!validationType) {\n return;\n }\n\n if (event.keyCode === constants.keyCodes.Enter) {\n event.preventDefault();\n const { value } = event.target as HTMLInputElement;\n\n const validationResult = validationVariants[validationType](value, options);\n\n onValidate?.(validationResult);\n }\n };\n\n useEffect(() => {\n validateLenghtOptions(options);\n if (validationType === 'email') {\n validateEmailDomainsLists(\n (options as EmailValidationOptions)?.whitelistDomains?.value,\n (options as EmailValidationOptions).blacklistDomains?.value,\n );\n }\n }, []);\n\n return {\n handleValidationBlur,\n handleValidationKeyDown,\n };\n};\n"],"names":["getUniqueKeys","lengthOptions","map","option","replace","validateLenghtOptions","options","_options$minLength","_options$maxLength","minHash","Object","keys","filter","key","startsWith","maxHash","minMaxUniqueKeys","length","globalMinValue","Number","minLength","value","globalMaxValue","maxLength","console","error","forEach","_options$optionMinKey","_options$optionMaxKey","optionMinKey","concat","optionMaxKey","minValue","maxValue","validateWithLengthOptions","optionKey","_options$optionMinKey2","_options$optionMaxKey2","_options$optionMinKey3","isValid","errorMessage","_options$optionMaxKey3","validateEmailDomainsLists","blacklistDomains","whitelistDomains","uniqueDomains","Set","_toConsumableArray","size","validateWithDomainsLists","domainWithZone","_options$whitelistDom","_options$blacklistDom","_options$blacklistDom2","_options$whitelistDom2","includes","_options$blacklistDom3","_options$whitelistDom3","validateEmail","email","_options$customEmailR","_options$minLength2","_options$maxLength2","emailRegex","customEmailRegex","constants","test","_options$customEmailR2","_options$minLength3","_options$maxLength3","emailHost","split","emailDomainWithZone","emailZone","pop","_options$customEmailR3","emailDomain","substring","hostValidation","domainValidation","zoneValidation","domainWithZoneValidation","validatePassword","password","_options$minLength4","_options$maxLength4","_options$includeUpper","_options$includeLower","_options$includeDigit","_options$includeSpeci","_options$minLength5","_options$maxLength5","lowercasedPassword","toLowerCase","uppercasedPassword","toUpperCase","includeUppercase","_options$includeUpper2","includeLowercase","_options$includeLower2","includeDigits","_options$includeDigit2","includeSpecialSymbols","_options$includeSpeci2","validationVariants","useValidation","_ref","validationType","onValidate","handleValidationBlur","event","validationResult","target","handleValidationKeyDown","keyCode","Enter","preventDefault","_ref2","useEffect","_whitelistDomains","_blacklistDomains"],"mappings":";;;;;;;;AAMA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,aAAuB,EAAK;AAC/C,EAAA,O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ApBA,oBAAoB;AACpBI,IAAAA,uBAAuB,EAAvBA,uBAAAA;GACH,CAAA;AACL;;;;"}
|
package/cjs/index.css
CHANGED
@@ -392,12 +392,11 @@
|
|
392
392
|
|
393
393
|
.DropdownHeader_styles_196gwgm_s133b1g2__3510806e{background:var(--plasma-dropdown-header-background);font-family:var(--plasma-dropdown-header-font-family);font-size:var(--plasma-dropdown-header-font-size);font-style:var(--plasma-dropdown-header-font-style);font-weight:var(--plasma-dropdown-header-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-header-line-height);-moz-letter-spacing:var(--plasma-dropdown-header-line-height);-ms-letter-spacing:var(--plasma-dropdown-header-line-height);letter-spacing:var(--plasma-dropdown-header-line-height);line-height:var(--plasma-dropdown-header-font-weight);width:var(--plasma-dropdown-header-width);height:var(--plasma-dropdown-header-height);padding:var(--plasma-dropdown-header-padding-top) var(--plasma-dropdown-header-padding-right) var(--plasma-dropdown-header-padding-bottom) var(--plasma-dropdown-header-padding-left);margin:var(--plasma-dropdown-header-margin-top) var(--plasma-dropdown-header-margin-right) var(--plasma-dropdown-header-margin-bottom) var(--plasma-dropdown-header-margin-left);}
|
394
394
|
|
395
|
-
.
|
395
|
+
.DropdownItem_styles_1b439rx_c1gkzlls__ed711128{--plasma-cell-title-color:var(--text-primary);--plasma-cell-background-color:var(--plasma-colors-transparent);--plasma-cell-padding:var(--plasma-dropdown-cell-padding);--plasma-cell-padding-left-content:var(--plasma-dropdown-cell-padding-left-content);--plasma-cell-padding-content:var(--plasma-dropdown-cell-padding-content);--plasma-cell-padding-right-content:var(--plasma-dropdown-cell-padding-right-content);--plasma-cell-textbox-gap:var(--plasma-dropdown-cell-textbox-gap);--plasma-cell-gap:var(--plasma-dropdown-cell-gap);--plasma-cell-title-font-family:var(--plasma-dropdown-cell-title-font-family);--plasma-cell-title-font-size:var(--plasma-dropdown-cell-title-font-size);--plasma-cell-title-font-style:var(--plasma-dropdown-cell-title-font-style);--plasma-cell-title-font-weight:var(--plasma-dropdown-cell-title-font-weight);--plasma-cell-title-letter-spacing:var(--plasma-dropdown-cell-title-letter-spacing);--plasma-cell-title-line-height:var(--plasma-dropdown-cell-title-line-height);width:100%;}
|
396
396
|
|
397
|
-
.
|
398
|
-
.
|
399
|
-
.
|
400
|
-
.DropdownItem_styles_14yih1y_r1jav4ek__bf539568{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-flex:1;-ms-flex:1;flex:1;}
|
397
|
+
.DropdownItem_styles_1b439rx_d1m97l2m__ed711128{line-height:0;color:var(--text-secondary);}
|
398
|
+
.DropdownItem_styles_1b439rx_doib72h__ed711128{height:1px;margin-top:var(--doib72h-0);margin-right:var(--plasma-dropdown-divider-margin-right);margin-bottom:var(--doib72h-1);margin-left:var(--plasma-dropdown-divider-margin-left);background:var(--plasma-dropdown-divider-color);}
|
399
|
+
.DropdownItem_styles_1b439rx_w6l2f0g__ed711128{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:var(--plasma-dropdown-item-height);margin:0;box-sizing:content-box;padding:var(--w6l2f0g-0);font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background-color:var(--plasma-colors-transparent);border-radius:var(--plasma-dropdown-border-radius);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-right:0.125rem solid transparent;border-left:0.125rem solid transparent;background-clip:padding-box;position:relative;}.DropdownItem_styles_1b439rx_w6l2f0g__ed711128:hover:not(.DropdownItem_styles_1b439rx_dropdownItemIsDisabled__ed711128){cursor:pointer;background-color:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_1b439rx_w6l2f0g__ed711128.DropdownItem_styles_1b439rx_dropdownItemIsActive__ed711128{background-color:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_1b439rx_w6l2f0g__ed711128.DropdownItem_styles_1b439rx_dropdownItemIsDisabled__ed711128{opacity:0.4;cursor:not-allowed;}.DropdownItem_styles_1b439rx_w6l2f0g__ed711128:focus{outline:none;}.DropdownItem_styles_1b439rx_w6l2f0g__ed711128::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.DropdownItem_styles_1b439rx_w6l2f0g__ed711128.DropdownItem_styles_1b439rx_dropdownItemIsFocused__ed711128:before{outline:none;box-shadow:0 0 0 0.0625rem var(--surface-accent);}
|
401
400
|
|
402
401
|
.DropdownItem_styles_1lyg81y_s1iqs5in__b17ea060{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-dropdown-item-content-left-width);color:var(--plasma-dropdown-item-content-left-color);}
|
403
402
|
.DropdownItem_styles_1lyg81y_sfg3dyd__b17ea060{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-dropdown-item-content-right-width);color:var(--plasma-dropdown-item-content-right-color);}
|
package/cjs/utils/constants.js
CHANGED
@@ -15,6 +15,10 @@ var keyCodes = {
|
|
15
15
|
Space: 32,
|
16
16
|
Escape: 27
|
17
17
|
};
|
18
|
+
var emailPattern = /^[^\s@]+@([^\s@.,]+\.)+[^\s@.,]{2,}$/;
|
19
|
+
var specialCharacters = /[!@#$%^&*(),.?":{}|<>]/;
|
18
20
|
|
21
|
+
exports.emailPattern = emailPattern;
|
19
22
|
exports.keyCodes = keyCodes;
|
23
|
+
exports.specialCharacters = specialCharacters;
|
20
24
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../src/utils/constants.ts"],"sourcesContent":["export const keyCodes = {\n PageUp: 33,\n PageDown: 34,\n Home: 36,\n End: 35,\n Left: 37,\n Right: 39,\n Up: 38,\n Down: 40,\n Enter: 13,\n Space: 32,\n Escape: 27,\n};\n"],"names":["keyCodes","PageUp","PageDown","Home","End","Left","Right","Up","Down","Enter","Space","Escape"],"mappings":";;;;AAAO,IAAMA,QAAQ,GAAG;AACpBC,EAAAA,MAAM,EAAE,EAAE;AACVC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,GAAG,EAAE,EAAE;AACPC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,EAAE,EAAE,EAAE;AACNC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAE,EAAA;AACZ
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/utils/constants.ts"],"sourcesContent":["export const keyCodes = {\n PageUp: 33,\n PageDown: 34,\n Home: 36,\n End: 35,\n Left: 37,\n Right: 39,\n Up: 38,\n Down: 40,\n Enter: 13,\n Space: 32,\n Escape: 27,\n};\n\nexport const emailPattern = /^[^\\s@]+@([^\\s@.,]+\\.)+[^\\s@.,]{2,}$/;\nexport const specialCharacters = /[!@#$%^&*(),.?\":{}|<>]/;\n"],"names":["keyCodes","PageUp","PageDown","Home","End","Left","Right","Up","Down","Enter","Space","Escape","emailPattern","specialCharacters"],"mappings":";;;;AAAO,IAAMA,QAAQ,GAAG;AACpBC,EAAAA,MAAM,EAAE,EAAE;AACVC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,GAAG,EAAE,EAAE;AACPC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,EAAE,EAAE,EAAE;AACNC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAE,EAAA;AACZ,EAAC;AAEM,IAAMC,YAAY,GAAG,uCAAsC;AAC3D,IAAMC,iBAAiB,GAAG;;;;;;"}
|
@@ -357,6 +357,7 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
357
357
|
handleItemClick: handleItemClick,
|
358
358
|
variant: variant,
|
359
359
|
renderItem: renderItem,
|
360
|
+
valueToItemMap: valueToItemMap,
|
360
361
|
treeId: treeId
|
361
362
|
}
|
362
363
|
}, /*#__PURE__*/_react["default"].createElement(_FloatingPopover.FloatingPopover, {
|