@salutejs/plasma-new-hope 0.195.1-dev.0 → 0.195.2-canary.1577.11955096429.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Autocomplete/Autocomplete.css +2 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +2 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +2 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +2 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +2 -1
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -1
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +2 -1
- package/cjs/components/Pagination/Pagination.css +2 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -1
- package/cjs/components/Range/Range.css +2 -1
- package/cjs/components/Select/Select.css +2 -1
- package/cjs/components/Select/ui/Inner/Inner.css +2 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.css +2 -1
- package/cjs/components/Select/ui/Target/Target.css +2 -1
- package/cjs/components/Select/ui/Target/Target.js +2 -1
- package/cjs/components/Select/ui/Target/Target.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +2 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +4 -2
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/cjs/components/Slider/Slider.css +2 -1
- package/cjs/components/Slider/components/Double/Double.css +2 -1
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +2 -1
- package/cjs/components/TextField/TextField.js +7 -4
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.css +2 -1
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +17 -3
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +7 -1
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
- package/cjs/components/TextField/ui/TextFieldChip/{TextFieldChip.styles_1y8n7la.css → TextFieldChip.styles_1yosnxc.css} +1 -0
- package/cjs/index.css +2 -1
- package/emotion/cjs/components/Select/ui/Target/Target.js +2 -1
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +4 -2
- package/emotion/cjs/components/TextField/TextField.js +8 -5
- package/emotion/cjs/components/TextField/TextField.template-doc.mdx +13 -3
- package/emotion/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +17 -3
- package/emotion/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +12 -3
- package/emotion/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +8 -1
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -0
- package/emotion/cjs/examples/plasma_web/components/Select/Select.stories.tsx +8 -1
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -0
- package/emotion/es/components/Select/ui/Target/Target.js +2 -1
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +4 -2
- package/emotion/es/components/TextField/TextField.js +8 -5
- package/emotion/es/components/TextField/TextField.template-doc.mdx +13 -3
- package/emotion/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +18 -4
- package/emotion/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +11 -2
- package/emotion/es/examples/plasma_b2c/components/Select/Select.stories.tsx +8 -1
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -0
- package/emotion/es/examples/plasma_web/components/Select/Select.stories.tsx +8 -1
- package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -0
- package/es/components/Autocomplete/Autocomplete.css +2 -1
- package/es/components/Combobox/ComboboxNew/Combobox.css +2 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +2 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +2 -1
- package/es/components/DatePicker/RangeDate/RangeDate.css +2 -1
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -1
- package/es/components/DatePicker/SingleDate/SingleDate.css +2 -1
- package/es/components/Pagination/Pagination.css +2 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -1
- package/es/components/Range/Range.css +2 -1
- package/es/components/Select/Select.css +2 -1
- package/es/components/Select/ui/Inner/Inner.css +2 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.css +2 -1
- package/es/components/Select/ui/Target/Target.css +2 -1
- package/es/components/Select/ui/Target/Target.js +2 -1
- package/es/components/Select/ui/Target/Target.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +2 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +4 -2
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/es/components/Slider/Slider.css +2 -1
- package/es/components/Slider/components/Double/Double.css +2 -1
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +2 -1
- package/es/components/TextField/TextField.js +7 -4
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.css +2 -1
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +18 -4
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +7 -2
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
- package/es/components/TextField/ui/TextFieldChip/{TextFieldChip.styles_1y8n7la.css → TextFieldChip.styles_1yosnxc.css} +1 -0
- package/es/index.css +2 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Select/ui/Target/Target.js +2 -1
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +4 -2
- package/styled-components/cjs/components/TextField/TextField.js +7 -4
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +13 -3
- package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +17 -3
- package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +10 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +8 -1
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -0
- package/styled-components/cjs/examples/plasma_web/components/Select/Select.stories.tsx +8 -1
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -0
- package/styled-components/es/components/Select/ui/Target/Target.js +2 -1
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +4 -2
- package/styled-components/es/components/TextField/TextField.js +7 -4
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +13 -3
- package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +18 -4
- package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +9 -1
- package/styled-components/es/examples/plasma_b2c/components/Select/Select.stories.tsx +8 -1
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -0
- package/styled-components/es/examples/plasma_web/components/Select/Select.stories.tsx +8 -1
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -0
- package/types/components/Autocomplete/Autocomplete.types.d.ts +3 -2
- package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
- package/types/components/Autocomplete/ui/TextField/TextField.styles.d.ts +16 -0
- package/types/components/Autocomplete/ui/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Target/Target.styles.d.ts +16 -0
- package/types/components/Combobox/ComboboxNew/ui/Target/Target.styles.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts +16 -0
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts.map +1 -1
- package/types/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.d.ts +6 -0
- package/types/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.d.ts.map +1 -1
- package/types/components/Range/Range.styles.d.ts +16 -0
- package/types/components/Range/Range.styles.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +5 -0
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/ui/Target/Target.d.ts +1 -1
- package/types/components/Select/ui/Target/Target.d.ts.map +1 -1
- package/types/components/Select/ui/Target/Target.types.d.ts +1 -1
- package/types/components/Select/ui/Target/Target.types.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts +16 -0
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.types.d.ts +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.types.d.ts.map +1 -1
- package/types/components/Slider/components/Double/Double.styles.d.ts +16 -0
- 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 +8 -0
- package/types/components/TextField/TextField.types.d.ts.map +1 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.d.ts.map +1 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.styles.d.ts +1 -0
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.styles.d.ts.map +1 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.types.d.ts +5 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Autocomplete/Autocomplete.d.ts +553 -3
- package/types/examples/plasma_b2c/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Mask/Mask.d.ts +16 -0
- package/types/examples/plasma_b2c/components/Mask/Mask.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Select/Select.d.ts +6 -0
- package/types/examples/plasma_b2c/components/Select/Select.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts +16 -0
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Autocomplete/Autocomplete.d.ts +553 -3
- package/types/examples/plasma_web/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Mask/Mask.d.ts +16 -0
- package/types/examples/plasma_web/components/Mask/Mask.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Select/Select.d.ts +6 -0
- package/types/examples/plasma_web/components/Select/Select.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextField/TextField.d.ts +16 -0
- package/types/examples/plasma_web/components/TextField/TextField.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","labelPlacement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AAAA,GAAG,EAAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACD5K,IAAAA,QAAQ,EAAE;AACNwK,MAAAA,GAAG,EAAEM,MAAW;AAChBF,MAAAA,KAAK,EAAE,IAAA;KACV;AACDxM,IAAAA,cAAc,EAAE;AACZoM,MAAAA,GAAG,EAAEO,MAAAA;KACR;AACD7L,IAAAA,QAAQ,EAAE;AACNsL,MAAAA,GAAG,EAAEQ,MAAAA;KACR;AACD5L,IAAAA,QAAQ,EAAE;AACNoL,MAAAA,GAAG,EAAES,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNpL,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
|
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 chipType = 'default',\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 =\n !contentLeft && isChipsVisible && chipType === 'default' ? classes.hasEmptyContentLeft : undefined;\n const wrapperWithoutRightContent =\n !contentRight && isChipsVisible && chipType === 'default' ? 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 chipType={chipType}\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","_ref$chipType","chipType","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","labelPlac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,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACD7K,IAAAA,IAAI,EAAE;AACF4K,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDtK,IAAAA,KAAK,EAAE;AACHoK,MAAAA,GAAG,EAAEG,MAAQ;AACbC,MAAAA,KAAK,EAAE,IAAA;KACV;AACD5K,IAAAA,QAAQ,EAAE;AACNwK,MAAAA,GAAG,EAAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACD9K,IAAAA,QAAQ,EAAE;AACN0K,MAAAA,GAAG,EAAEM,MAAW;AAChBF,MAAAA,KAAK,EAAE,IAAA;KACV;AACD1M,IAAAA,cAAc,EAAE;AACZsM,MAAAA,GAAG,EAAEO,MAAAA;KACR;AACD/L,IAAAA,QAAQ,EAAE;AACNwL,MAAAA,GAAG,EAAEQ,MAAAA;KACR;AACD9L,IAAAA,QAAQ,EAAE;AACNsL,MAAAA,GAAG,EAAES,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtL,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -18,4 +18,5 @@
|
|
18
18
|
.Chip_styles_1mwwhiw_swddmyi__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-right-content-margin-left);margin-right:var(--plasma-chip-right-content-margin-right);}
|
19
19
|
.Chip_styles_1mwwhiw_s1pcflhj__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-clear-content-margin-left);margin-right:var(--plasma-chip-clear-content-margin-right);color:var(--plasma-chip-close-icon-color);}
|
20
20
|
|
21
|
-
.
|
21
|
+
.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb{--plasma-chip-color:var(--plasma-textfield__chip-color);--plasma-chip-background:var(--plasma-textfield__chip-background);--plasma-chip-color-hover:var(--plasma-textfield__chip-color-hover);--plasma-chip-background-hover:var(--plasma-textfield__chip-background-hover);--plasma-chip-color-active:var(--plasma-textfield__chip-color-active);--plasma-chip-background-active:var(--plasma-textfield__chip-background-active);--plasma-chip-background-readonly:var(--plasma-textfield__chip-background-readonly);--plasma-chip-color-readonly:var(--plasma-textfield__chip-color-readonly);--plasma-chip-background-readonly-hover:var(--plasma-textfield__chip-background-readonly-hover);--plasma-chip-color-readonly-hover:var(--plasma-textfield__chip-color-readonly-hover);--plasma-chip-border-radius:var(--plasma-textfield__chip-border-radius);--plasma-chip-width:var(--plasma-textfield__chip-width);--plasma-chip-height:var(--plasma-textfield__chip-height);--plasma-chip-padding-right:var(--plasma-textfield__chip-padding-right);--plasma-chip-padding-left:var(--plasma-textfield__chip-padding-left);--plasma-chip-font-family:var(--plasma-textfield__chip-font-family);--plasma-chip-font-size:var(--plasma-textfield__chip-font-size);--plasma-chip-font-style:var(--plasma-textfield__chip-font-style);--plasma-chip-font-weight:var(--plasma-textfield__chip-font-weight);--plasma-chip-letter-spacing:var(--plasma-textfield__chip-letter-spacing);--plasma-chip-lineheight:var(--plasma-textfield__chip-line-height);--plasma-chip-clear-content-margin-left:var(--plasma-textfield__chip-clear-content-margin-left);--plasma-chip-clear-content-margin-right:var(--plasma-textfield__chip-clear-content-margin-right);--plasma-chip-scale-hover:var(--plasma-textfield__chip-scale-hover);--plasma-chip-scale-active:var(--plasma-textfield__chip-scale-active);--plasma-chip-close-icon-size:var(--plasma-textfield__chip-close-icon-size);--plasma-chip-close-icon-color:var(--plasma-textfield__chip-close-icon-color);--plasma-chip-focus-color:var(--plasma-textfield-focus-color);-webkit-scroll-snap-align:center;-moz-scroll-snap-align:center;-ms-scroll-snap-align:center;scroll-snap-align:center;-webkit-scroll-snap-stop:normal;-moz-scroll-snap-stop:normal;-ms-scroll-snap-stop:normal;scroll-snap-stop:normal;position:relative;}.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:calc(var(--plasma-textfield__chip-border-radius) - 0.1rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb.TextFieldChip_styles_1yosnxc_focusVisible__b8a89acb:focus::before,.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-textfield-focus-color);}.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb[readonly]{opacity:var(--plasma-textfield__chip-opacity-readonly);}
|
22
|
+
.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb{display:block;-webkit-flex:none;-ms-flex:none;flex:none;background:none;border:none;outline:none;padding:0;white-space:nowrap;cursor:pointer;font-family:var(--plasma-textfield-font-family);font-size:var(--plasma-textfield-font-size);font-style:var(--plasma-textfield-font-style);font-weight:var(--plasma-textfield-font-weight);-webkit-letter-spacing:var(--plasma-textfield-letter-spacing);-moz-letter-spacing:var(--plasma-textfield-letter-spacing);-ms-letter-spacing:var(--plasma-textfield-letter-spacing);letter-spacing:var(--plasma-textfield-letter-spacing);line-height:var(--plasma-textfield-line-height);color:var(--plasma-textfield-color);position:relative;}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:calc(var(--plasma-textfield__chip-border-radius) - 0.1rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb.TextFieldChip_styles_1yosnxc_focusVisible__b8a89acb:focus::before,.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-textfield-focus-color);}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb:after{content:',';}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb:last-child:after{content:'';}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { forwardRef } from 'react';
|
2
|
-
import { StyledChip } from './TextFieldChip.styles.js';
|
2
|
+
import { StyledChip, TextChip } from './TextFieldChip.styles.js';
|
3
3
|
|
4
4
|
/**
|
5
5
|
* Чип, отображающий выбранный элемент
|
@@ -12,14 +12,23 @@ var TextFieldChip = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
12
12
|
onClick = _ref.onClick,
|
13
13
|
onClear = _ref.onClear,
|
14
14
|
onKeyDown = _ref.onKeyDown,
|
15
|
-
_forceChipManipulationWithReadonly = _ref._forceChipManipulationWithReadonly
|
15
|
+
_forceChipManipulationWithReadonly = _ref._forceChipManipulationWithReadonly,
|
16
|
+
chipType = _ref.chipType;
|
16
17
|
var onClearHandle = function onClearHandle() {
|
17
18
|
return onClear(id);
|
18
19
|
};
|
19
20
|
var onKeyDownHandle = function onKeyDownHandle(event) {
|
20
21
|
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event, id);
|
21
22
|
};
|
22
|
-
|
23
|
+
var handleClick = function handleClick(e) {
|
24
|
+
if (onClick) {
|
25
|
+
onClick(e);
|
26
|
+
}
|
27
|
+
if (onClear) {
|
28
|
+
onClear(id);
|
29
|
+
}
|
30
|
+
};
|
31
|
+
return chipType === 'default' ? /*#__PURE__*/React.createElement(StyledChip, {
|
23
32
|
ref: ref,
|
24
33
|
tabIndex: -1,
|
25
34
|
disabled: disabled,
|
@@ -33,7 +42,12 @@ var TextFieldChip = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
33
42
|
// @ts-ignore
|
34
43
|
,
|
35
44
|
_forceChipManipulationWithReadonly: _forceChipManipulationWithReadonly
|
36
|
-
})
|
45
|
+
}) : /*#__PURE__*/React.createElement(TextChip, {
|
46
|
+
ref: ref,
|
47
|
+
tabIndex: -1,
|
48
|
+
onClick: handleClick,
|
49
|
+
onKeyDown: onKeyDownHandle
|
50
|
+
}, text);
|
37
51
|
});
|
38
52
|
|
39
53
|
export { TextFieldChip };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextFieldChip.js","sources":["../../../../../src/components/TextField/ui/TextFieldChip/TextFieldChip.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { StyledChip } from './TextFieldChip.styles';\nimport type { TextFieldChipProps } from './TextFieldChip.types';\n\n/**\n * Чип, отображающий выбранный элемент\n */\nexport const TextFieldChip = forwardRef<\n HTMLButtonElement,\n TextFieldChipProps & { _forceChipManipulationWithReadonly: any }\n>(({ id, text, disabled, readOnly, onClick, onClear, onKeyDown, _forceChipManipulationWithReadonly }
|
1
|
+
{"version":3,"file":"TextFieldChip.js","sources":["../../../../../src/components/TextField/ui/TextFieldChip/TextFieldChip.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { StyledChip, TextChip } from './TextFieldChip.styles';\nimport type { TextFieldChipProps } from './TextFieldChip.types';\n\n/**\n * Чип, отображающий выбранный элемент\n */\nexport const TextFieldChip = forwardRef<\n HTMLButtonElement,\n TextFieldChipProps & { _forceChipManipulationWithReadonly: any }\n>(\n (\n { id, text, disabled, readOnly, onClick, onClear, onKeyDown, _forceChipManipulationWithReadonly, chipType },\n ref,\n ) => {\n const onClearHandle = () => onClear(id);\n\n const onKeyDownHandle = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event, id);\n };\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (onClick) {\n onClick(e);\n }\n\n if (onClear) {\n onClear(id);\n }\n };\n\n return chipType === 'default' ? (\n <StyledChip\n ref={ref}\n tabIndex={-1}\n disabled={disabled}\n readOnly={readOnly}\n onClick={onClick}\n onClear={onClearHandle}\n onKeyDown={onKeyDownHandle}\n text={`${text}`}\n // TODO: #1547\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n _forceChipManipulationWithReadonly={_forceChipManipulationWithReadonly}\n />\n ) : (\n <TextChip ref={ref} tabIndex={-1} onClick={handleClick} onKeyDown={onKeyDownHandle}>\n {text}\n </TextChip>\n );\n },\n);\n"],"names":["TextFieldChip","forwardRef","_ref","ref","id","text","disabled","readOnly","onClick","onClear","onKeyDown","_forceChipManipulationWithReadonly","chipType","onClearHandle","onKeyDownHandle","event","handleClick","e","React","createElement","StyledChip","tabIndex","concat","TextChip"],"mappings":";;;AAKA;AACA;AACA;AACO,IAAMA,aAAa,gBAAGC,UAAU,CAInC,UAAAC,IAAA,EAEIC,GAAG,EACF;AAAA,EAAA,IAFCC,EAAE,GAAAF,IAAA,CAAFE,EAAE;IAAEC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IAAEC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAEC,OAAO,GAAAN,IAAA,CAAPM,OAAO;IAAEC,OAAO,GAAAP,IAAA,CAAPO,OAAO;IAAEC,SAAS,GAAAR,IAAA,CAATQ,SAAS;IAAEC,kCAAkC,GAAAT,IAAA,CAAlCS,kCAAkC;IAAEC,QAAQ,GAAAV,IAAA,CAARU,QAAQ,CAAA;AAGzG,EAAA,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,GAAA;IAAA,OAASJ,OAAO,CAACL,EAAE,CAAC,CAAA;AAAA,GAAA,CAAA;AAEvC,EAAA,IAAMU,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,KAA6C,EAAK;IACvEL,SAAS,KAAA,IAAA,IAATA,SAAS,KAATA,KAAAA,CAAAA,IAAAA,SAAS,CAAGK,KAAK,EAAEX,EAAE,CAAC,CAAA;GACzB,CAAA;AAED,EAAA,IAAMY,WAAW,GAAG,SAAdA,WAAWA,CAAIC,CAAsC,EAAK;AAC5D,IAAA,IAAIT,OAAO,EAAE;MACTA,OAAO,CAACS,CAAC,CAAC,CAAA;AACd,KAAA;AAEA,IAAA,IAAIR,OAAO,EAAE;MACTA,OAAO,CAACL,EAAE,CAAC,CAAA;AACf,KAAA;GACH,CAAA;EAED,OAAOQ,QAAQ,KAAK,SAAS,gBACzBM,KAAA,CAAAC,aAAA,CAACC,UAAU,EAAA;AACPjB,IAAAA,GAAG,EAAEA,GAAI;IACTkB,QAAQ,EAAE,CAAC,CAAE;AACbf,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,OAAO,EAAEI,aAAc;AACvBH,IAAAA,SAAS,EAAEI,eAAgB;IAC3BT,IAAI,EAAA,EAAA,CAAAiB,MAAA,CAAKjB,IAAI,CAAA;AACb;AACA;AACA;AAAA;AACAM,IAAAA,kCAAkC,EAAEA,kCAAAA;AAAmC,GAC1E,CAAC,gBAEFO,KAAA,CAAAC,aAAA,CAACI,QAAQ,EAAA;AAACpB,IAAAA,GAAG,EAAEA,GAAI;IAACkB,QAAQ,EAAE,CAAC,CAAE;AAACb,IAAAA,OAAO,EAAEQ,WAAY;AAACN,IAAAA,SAAS,EAAEI,eAAAA;AAAgB,GAAA,EAC9ET,IACK,CACb,CAAA;AACL,CACJ;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import './TextFieldChip.
|
1
|
+
import './TextFieldChip.styles_1yosnxc.css';
|
2
2
|
import { styled } from '@linaria/react';
|
3
3
|
import { component, mergeConfig } from '../../../../engines/common.js';
|
4
4
|
import { chipConfig } from '../../../Chip/Chip.js';
|
@@ -16,6 +16,11 @@ var StyledChip = /*#__PURE__*/styled(_exp())({
|
|
16
16
|
"class": "s32p7ut",
|
17
17
|
propsAsIs: true
|
18
18
|
});
|
19
|
+
var TextChip = /*#__PURE__*/styled('button')({
|
20
|
+
name: "TextChip",
|
21
|
+
"class": "t4nir3h",
|
22
|
+
propsAsIs: false
|
23
|
+
});
|
19
24
|
|
20
|
-
export { StyledChip };
|
25
|
+
export { StyledChip, TextChip };
|
21
26
|
//# sourceMappingURL=TextFieldChip.styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextFieldChip.styles.js","sources":["../../../../../src/components/TextField/ui/TextFieldChip/TextFieldChip.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { chipConfig, chipTokens } from '../../../Chip';\nimport { component, mergeConfig } from '../../../../engines';\nimport { tokens } from '../../TextField.tokens';\nimport { addFocus } from '../../../../mixins';\n\n// issue #823\nconst mergedConfig = mergeConfig(chipConfig);\nconst Chip = component(mergedConfig);\n\n// NOTE: Необходимое переопределение токенов из компонента Chip т.к. используются его части\nexport const StyledChip = styled(Chip)`\n ${chipTokens.color}: var(${tokens.chipColor});\n ${chipTokens.background}: var(${tokens.chipBackground});\n ${chipTokens.colorHover}: var(${tokens.chipColorHover});\n ${chipTokens.backgroundHover}: var(${tokens.chipBackgroundHover});\n ${chipTokens.colorActive}: var(${tokens.chipColorActive});\n ${chipTokens.backgroundActive}: var(${tokens.chipBackgroundActive});\n ${chipTokens.backgroundReadOnly}: var(${tokens.chipBackgroundReadOnly});\n ${chipTokens.colorReadOnly}: var(${tokens.chipColorReadOnly});\n ${chipTokens.backgroundReadOnlyHover}: var(${tokens.chipBackgroundReadOnlyHover});\n ${chipTokens.colorReadOnlyHover}: var(${tokens.chipColorReadOnlyHover});\n ${chipTokens.borderRadius}: var(${tokens.chipBorderRadius});\n ${chipTokens.width}: var(${tokens.chipWidth});\n ${chipTokens.height}: var(${tokens.chipHeight});\n ${chipTokens.paddingRight}: var(${tokens.chipPaddingRight});\n ${chipTokens.paddingLeft}: var(${tokens.chipPaddingLeft});\n ${chipTokens.fontFamily}: var(${tokens.chipFontFamily});\n ${chipTokens.fontSize}: var(${tokens.chipFontSize});\n ${chipTokens.fontStyle}: var(${tokens.chipFontStyle});\n ${chipTokens.fontWeight}: var(${tokens.chipFontWeight});\n ${chipTokens.letterSpacing}: var(${tokens.chipLetterSpacing});\n ${chipTokens.lineHeight}: var(${tokens.chipLineHeight});\n ${chipTokens.clearContentMarginLeft}: var(${tokens.chipClearContentMarginLeft});\n ${chipTokens.clearContentMarginRight}: var(${tokens.chipClearContentMarginRight});\n ${chipTokens.scaleHover}: var(${tokens.chipScaleHover});\n ${chipTokens.scaleActive}: var(${tokens.chipScaleActive});\n ${chipTokens.closeIconSize}: var(${tokens.chipCloseIconSize});\n ${chipTokens.closeIconColor}: var(${tokens.chipCloseIconColor});\n ${chipTokens.focusColor}: var(${tokens.focusColor});\n\n scroll-snap-align: center;\n scroll-snap-stop: normal;\n\n ${addFocus({\n outlineOffset: '0.0625rem',\n outlineSize: '0.0625rem',\n outlineRadius: `calc(var(${tokens.chipBorderRadius}) - 0.1rem)`,\n outlineColor: `var(${tokens.focusColor})`,\n })}\n\n &[readonly] {\n opacity: var(${tokens.chipOpacityReadonly});\n }\n`;\n"],"names":["mergedConfig","mergeConfig","chipConfig","Chip","component","_exp","StyledChip","styled","name","class","propsAsIs"],"mappings":";;;;AAOA;AACA,IAAMA,YAAY,gBAAGC,WAAW,CAACC,UAAU,CAAC,CAAA;AAC5C,IAAMC,IAAI,gBAAGC,SAAS,CAACJ,YAAY,CAAC,CAAA;;AAEpC;AAAA,IAAAK,IAAA,GAVkBA,SAUlBA,IAAAA,GAAA;AAAA,EAAA,OACiCF,IAAI,CAAA;AAAA,CAAA,CAAA;AAA9B,IAAMG,UAAU,gBAAGC,MAAM,CAAAF,IAAA,EAAA,CAAA,CAAA;AAAAG,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA,CA2C/B;;;;"}
|
1
|
+
{"version":3,"file":"TextFieldChip.styles.js","sources":["../../../../../src/components/TextField/ui/TextFieldChip/TextFieldChip.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { chipConfig, chipTokens } from '../../../Chip';\nimport { component, mergeConfig } from '../../../../engines';\nimport { tokens } from '../../TextField.tokens';\nimport { addFocus } from '../../../../mixins';\n\n// issue #823\nconst mergedConfig = mergeConfig(chipConfig);\nconst Chip = component(mergedConfig);\n\n// NOTE: Необходимое переопределение токенов из компонента Chip т.к. используются его части\nexport const StyledChip = styled(Chip)`\n ${chipTokens.color}: var(${tokens.chipColor});\n ${chipTokens.background}: var(${tokens.chipBackground});\n ${chipTokens.colorHover}: var(${tokens.chipColorHover});\n ${chipTokens.backgroundHover}: var(${tokens.chipBackgroundHover});\n ${chipTokens.colorActive}: var(${tokens.chipColorActive});\n ${chipTokens.backgroundActive}: var(${tokens.chipBackgroundActive});\n ${chipTokens.backgroundReadOnly}: var(${tokens.chipBackgroundReadOnly});\n ${chipTokens.colorReadOnly}: var(${tokens.chipColorReadOnly});\n ${chipTokens.backgroundReadOnlyHover}: var(${tokens.chipBackgroundReadOnlyHover});\n ${chipTokens.colorReadOnlyHover}: var(${tokens.chipColorReadOnlyHover});\n ${chipTokens.borderRadius}: var(${tokens.chipBorderRadius});\n ${chipTokens.width}: var(${tokens.chipWidth});\n ${chipTokens.height}: var(${tokens.chipHeight});\n ${chipTokens.paddingRight}: var(${tokens.chipPaddingRight});\n ${chipTokens.paddingLeft}: var(${tokens.chipPaddingLeft});\n ${chipTokens.fontFamily}: var(${tokens.chipFontFamily});\n ${chipTokens.fontSize}: var(${tokens.chipFontSize});\n ${chipTokens.fontStyle}: var(${tokens.chipFontStyle});\n ${chipTokens.fontWeight}: var(${tokens.chipFontWeight});\n ${chipTokens.letterSpacing}: var(${tokens.chipLetterSpacing});\n ${chipTokens.lineHeight}: var(${tokens.chipLineHeight});\n ${chipTokens.clearContentMarginLeft}: var(${tokens.chipClearContentMarginLeft});\n ${chipTokens.clearContentMarginRight}: var(${tokens.chipClearContentMarginRight});\n ${chipTokens.scaleHover}: var(${tokens.chipScaleHover});\n ${chipTokens.scaleActive}: var(${tokens.chipScaleActive});\n ${chipTokens.closeIconSize}: var(${tokens.chipCloseIconSize});\n ${chipTokens.closeIconColor}: var(${tokens.chipCloseIconColor});\n ${chipTokens.focusColor}: var(${tokens.focusColor});\n\n scroll-snap-align: center;\n scroll-snap-stop: normal;\n\n ${addFocus({\n outlineOffset: '0.0625rem',\n outlineSize: '0.0625rem',\n outlineRadius: `calc(var(${tokens.chipBorderRadius}) - 0.1rem)`,\n outlineColor: `var(${tokens.focusColor})`,\n })}\n\n &[readonly] {\n opacity: var(${tokens.chipOpacityReadonly});\n }\n`;\n\nexport const TextChip = styled.button`\n display: block;\n flex: none;\n background: none;\n border: none;\n outline: none;\n padding: 0;\n white-space: nowrap;\n cursor: pointer;\n\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.letterSpacing});\n line-height: var(${tokens.lineHeight});\n color: var(${tokens.color});\n\n ${addFocus({\n outlineOffset: '0.0625rem',\n outlineSize: '0.0625rem',\n outlineRadius: `calc(var(${tokens.chipBorderRadius}) - 0.1rem)`,\n outlineColor: `var(${tokens.focusColor})`,\n })}\n\n &:after {\n content: ',';\n }\n\n &:last-child {\n &:after {\n content: '';\n }\n }\n`;\n"],"names":["mergedConfig","mergeConfig","chipConfig","Chip","component","_exp","StyledChip","styled","name","class","propsAsIs","TextChip"],"mappings":";;;;AAOA;AACA,IAAMA,YAAY,gBAAGC,WAAW,CAACC,UAAU,CAAC,CAAA;AAC5C,IAAMC,IAAI,gBAAGC,SAAS,CAACJ,YAAY,CAAC,CAAA;;AAEpC;AAAA,IAAAK,IAAA,GAVkBA,SAUlBA,IAAAA,GAAA;AAAA,EAAA,OACiCF,IAAI,CAAA;AAAA,CAAA,CAAA;AAA9B,IAAMG,UAAU,gBAAGC,MAAM,CAAAF,IAAA,EAAA,CAAA,CAAA;AAAAG,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA,CA2C/B,EAAA;AAEM,IAAMC,QAAQ,gBAAGJ,MAAM,CAAA,QAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,UAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAkC7B;;;;"}
|
@@ -1 +1,2 @@
|
|
1
1
|
.s32p7ut{--plasma-chip-color:var(--plasma-textfield__chip-color);--plasma-chip-background:var(--plasma-textfield__chip-background);--plasma-chip-color-hover:var(--plasma-textfield__chip-color-hover);--plasma-chip-background-hover:var(--plasma-textfield__chip-background-hover);--plasma-chip-color-active:var(--plasma-textfield__chip-color-active);--plasma-chip-background-active:var(--plasma-textfield__chip-background-active);--plasma-chip-background-readonly:var(--plasma-textfield__chip-background-readonly);--plasma-chip-color-readonly:var(--plasma-textfield__chip-color-readonly);--plasma-chip-background-readonly-hover:var(--plasma-textfield__chip-background-readonly-hover);--plasma-chip-color-readonly-hover:var(--plasma-textfield__chip-color-readonly-hover);--plasma-chip-border-radius:var(--plasma-textfield__chip-border-radius);--plasma-chip-width:var(--plasma-textfield__chip-width);--plasma-chip-height:var(--plasma-textfield__chip-height);--plasma-chip-padding-right:var(--plasma-textfield__chip-padding-right);--plasma-chip-padding-left:var(--plasma-textfield__chip-padding-left);--plasma-chip-font-family:var(--plasma-textfield__chip-font-family);--plasma-chip-font-size:var(--plasma-textfield__chip-font-size);--plasma-chip-font-style:var(--plasma-textfield__chip-font-style);--plasma-chip-font-weight:var(--plasma-textfield__chip-font-weight);--plasma-chip-letter-spacing:var(--plasma-textfield__chip-letter-spacing);--plasma-chip-lineheight:var(--plasma-textfield__chip-line-height);--plasma-chip-clear-content-margin-left:var(--plasma-textfield__chip-clear-content-margin-left);--plasma-chip-clear-content-margin-right:var(--plasma-textfield__chip-clear-content-margin-right);--plasma-chip-scale-hover:var(--plasma-textfield__chip-scale-hover);--plasma-chip-scale-active:var(--plasma-textfield__chip-scale-active);--plasma-chip-close-icon-size:var(--plasma-textfield__chip-close-icon-size);--plasma-chip-close-icon-color:var(--plasma-textfield__chip-close-icon-color);--plasma-chip-focus-color:var(--plasma-textfield-focus-color);-webkit-scroll-snap-align:center;-moz-scroll-snap-align:center;-ms-scroll-snap-align:center;scroll-snap-align:center;-webkit-scroll-snap-stop:normal;-moz-scroll-snap-stop:normal;-ms-scroll-snap-stop:normal;scroll-snap-stop:normal;position:relative;}.s32p7ut::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:calc(var(--plasma-textfield__chip-border-radius) - 0.1rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.s32p7ut.focus-visible:focus::before,.s32p7ut[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-textfield-focus-color);}.s32p7ut[readonly]{opacity:var(--plasma-textfield__chip-opacity-readonly);}
|
2
|
+
.t4nir3h{display:block;-webkit-flex:none;-ms-flex:none;flex:none;background:none;border:none;outline:none;padding:0;white-space:nowrap;cursor:pointer;font-family:var(--plasma-textfield-font-family);font-size:var(--plasma-textfield-font-size);font-style:var(--plasma-textfield-font-style);font-weight:var(--plasma-textfield-font-weight);-webkit-letter-spacing:var(--plasma-textfield-letter-spacing);-moz-letter-spacing:var(--plasma-textfield-letter-spacing);-ms-letter-spacing:var(--plasma-textfield-letter-spacing);letter-spacing:var(--plasma-textfield-letter-spacing);line-height:var(--plasma-textfield-line-height);color:var(--plasma-textfield-color);position:relative;}.t4nir3h::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:calc(var(--plasma-textfield__chip-border-radius) - 0.1rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.t4nir3h.focus-visible:focus::before,.t4nir3h[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-textfield-focus-color);}.t4nir3h:after{content:',';}.t4nir3h:last-child:after{content:'';}
|
package/es/index.css
CHANGED
@@ -197,7 +197,8 @@
|
|
197
197
|
|
198
198
|
.TextField_styles_j7dqpn_s8yezh4__f79fd7d8{position:absolute;border-radius:50%;background-color:var(--plasma-textfield__indicator-color);}.TextField_styles_j7dqpn_s8yezh4__f79fd7d8.TextField_styles_j7dqpn_labelPlacementOuter__f79fd7d8{width:var(--plasma-textfield__indicator-size-outer);height:var(--plasma-textfield__indicator-size-outer);inset:var(--plasma-textfield__indicator-placement-outer);}.TextField_styles_j7dqpn_s8yezh4__f79fd7d8.TextField_styles_j7dqpn_labelPlacementOuter__f79fd7d8.TextField_styles_j7dqpn_requiredAlignRight__f79fd7d8{inset:var(--plasma-textfield__indicator-placement-outer-right);}.TextField_styles_j7dqpn_s8yezh4__f79fd7d8.TextField_styles_j7dqpn_labelPlacementOuter__f79fd7d8.TextField_styles_j7dqpn_requiredAlignRight__f79fd7d8.TextField_styles_j7dqpn_textfieldHasHint__f79fd7d8{right:calc(-1 * var(--plasma-textfield__indicator-size-outer));}.TextField_styles_j7dqpn_s8yezh4__f79fd7d8.TextField_styles_j7dqpn_labelPlacementInner__f79fd7d8{width:var(--plasma-textfield__indicator-size-inner);height:var(--plasma-textfield__indicator-size-inner);inset:var(--plasma-textfield__indicator-placement-inner);}.TextField_styles_j7dqpn_s8yezh4__f79fd7d8.TextField_styles_j7dqpn_labelPlacementInner__f79fd7d8.TextField_styles_j7dqpn_requiredAlignRight__f79fd7d8{inset:var(--plasma-textfield__indicator-placement-inner-right);}
|
199
199
|
|
200
|
-
.
|
200
|
+
.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb{--plasma-chip-color:var(--plasma-textfield__chip-color);--plasma-chip-background:var(--plasma-textfield__chip-background);--plasma-chip-color-hover:var(--plasma-textfield__chip-color-hover);--plasma-chip-background-hover:var(--plasma-textfield__chip-background-hover);--plasma-chip-color-active:var(--plasma-textfield__chip-color-active);--plasma-chip-background-active:var(--plasma-textfield__chip-background-active);--plasma-chip-background-readonly:var(--plasma-textfield__chip-background-readonly);--plasma-chip-color-readonly:var(--plasma-textfield__chip-color-readonly);--plasma-chip-background-readonly-hover:var(--plasma-textfield__chip-background-readonly-hover);--plasma-chip-color-readonly-hover:var(--plasma-textfield__chip-color-readonly-hover);--plasma-chip-border-radius:var(--plasma-textfield__chip-border-radius);--plasma-chip-width:var(--plasma-textfield__chip-width);--plasma-chip-height:var(--plasma-textfield__chip-height);--plasma-chip-padding-right:var(--plasma-textfield__chip-padding-right);--plasma-chip-padding-left:var(--plasma-textfield__chip-padding-left);--plasma-chip-font-family:var(--plasma-textfield__chip-font-family);--plasma-chip-font-size:var(--plasma-textfield__chip-font-size);--plasma-chip-font-style:var(--plasma-textfield__chip-font-style);--plasma-chip-font-weight:var(--plasma-textfield__chip-font-weight);--plasma-chip-letter-spacing:var(--plasma-textfield__chip-letter-spacing);--plasma-chip-lineheight:var(--plasma-textfield__chip-line-height);--plasma-chip-clear-content-margin-left:var(--plasma-textfield__chip-clear-content-margin-left);--plasma-chip-clear-content-margin-right:var(--plasma-textfield__chip-clear-content-margin-right);--plasma-chip-scale-hover:var(--plasma-textfield__chip-scale-hover);--plasma-chip-scale-active:var(--plasma-textfield__chip-scale-active);--plasma-chip-close-icon-size:var(--plasma-textfield__chip-close-icon-size);--plasma-chip-close-icon-color:var(--plasma-textfield__chip-close-icon-color);--plasma-chip-focus-color:var(--plasma-textfield-focus-color);-webkit-scroll-snap-align:center;-moz-scroll-snap-align:center;-ms-scroll-snap-align:center;scroll-snap-align:center;-webkit-scroll-snap-stop:normal;-moz-scroll-snap-stop:normal;-ms-scroll-snap-stop:normal;scroll-snap-stop:normal;position:relative;}.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:calc(var(--plasma-textfield__chip-border-radius) - 0.1rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb.TextFieldChip_styles_1yosnxc_focusVisible__b8a89acb:focus::before,.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-textfield-focus-color);}.TextFieldChip_styles_1yosnxc_s32p7ut__b8a89acb[readonly]{opacity:var(--plasma-textfield__chip-opacity-readonly);}
|
201
|
+
.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb{display:block;-webkit-flex:none;-ms-flex:none;flex:none;background:none;border:none;outline:none;padding:0;white-space:nowrap;cursor:pointer;font-family:var(--plasma-textfield-font-family);font-size:var(--plasma-textfield-font-size);font-style:var(--plasma-textfield-font-style);font-weight:var(--plasma-textfield-font-weight);-webkit-letter-spacing:var(--plasma-textfield-letter-spacing);-moz-letter-spacing:var(--plasma-textfield-letter-spacing);-ms-letter-spacing:var(--plasma-textfield-letter-spacing);letter-spacing:var(--plasma-textfield-letter-spacing);line-height:var(--plasma-textfield-line-height);color:var(--plasma-textfield-color);position:relative;}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:calc(var(--plasma-textfield__chip-border-radius) - 0.1rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb.TextFieldChip_styles_1yosnxc_focusVisible__b8a89acb:focus::before,.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-textfield-focus-color);}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb:after{content:',';}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb:last-child:after{content:'';}
|
201
202
|
|
202
203
|
.TextField_1lzb2r1_bpunezx__7d079491{display:block;}
|
203
204
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.195.
|
3
|
+
"version": "0.195.2-canary.1577.11955096429.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -129,5 +129,5 @@
|
|
129
129
|
"sideEffects": [
|
130
130
|
"*.css"
|
131
131
|
],
|
132
|
-
"gitHead": "
|
132
|
+
"gitHead": "361773a56ce6c552e147ee02d018ef3e4da4aab0"
|
133
133
|
}
|
@@ -82,6 +82,7 @@ var Target = exports.Target = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
82
82
|
onChange: onChange,
|
83
83
|
labelToItemMap: labelToItemMap,
|
84
84
|
chipView: chipView,
|
85
|
-
requiredProps: requiredProps
|
85
|
+
requiredProps: requiredProps,
|
86
|
+
chipType: selectProps.chipType
|
86
87
|
});
|
87
88
|
});
|
@@ -42,7 +42,8 @@ var Textfield = exports.Textfield = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
42
42
|
onChange = _ref.onChange,
|
43
43
|
labelToItemMap = _ref.labelToItemMap,
|
44
44
|
chipView = _ref.chipView,
|
45
|
-
requiredProps = _ref.requiredProps
|
45
|
+
requiredProps = _ref.requiredProps,
|
46
|
+
chipType = _ref.chipType;
|
46
47
|
var withArrowInverse = opened ? _Select.classes.arrowInverse : undefined;
|
47
48
|
var getChips = function getChips() {
|
48
49
|
if (multiselect && Array.isArray(value)) {
|
@@ -113,7 +114,8 @@ var Textfield = exports.Textfield = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
113
114
|
}, multiselect ? {
|
114
115
|
enumerationType: 'chip',
|
115
116
|
chips: getChips(),
|
116
|
-
onChangeChips: handleChipsChange
|
117
|
+
onChangeChips: handleChipsChange,
|
118
|
+
chipType: chipType
|
117
119
|
} : {
|
118
120
|
enumerationType: 'plain'
|
119
121
|
}, {
|
@@ -23,7 +23,7 @@ var _TextField2 = /*#__PURE__*/require("./TextField.tokens");
|
|
23
23
|
var _ui = /*#__PURE__*/require("./ui");
|
24
24
|
var _hooks2 = /*#__PURE__*/require("./hooks");
|
25
25
|
var _Hint = /*#__PURE__*/require("./ui/Hint/Hint");
|
26
|
-
var _excluded = ["id", "className", "style", "contentLeft", "contentRight", "label", "labelPlacement", "textBefore", "textAfter", "placeholder", "leftHelper", "enumerationType", "requiredPlacement", "titleCaption", "hintTrigger", "hintText", "hintView", "hintSize", "hintTargetIcon", "hintPlacement", "hintHasArrow", "hintOffset", "hintWidth", "hintContentLeft", "view", "size", "readOnly", "disabled", "required", "clear", "optional", "hasDivider", "value", "chips", "onChange", "onChangeChips", "onSearch", "onKeyDown"];
|
26
|
+
var _excluded = ["id", "className", "style", "contentLeft", "contentRight", "label", "labelPlacement", "textBefore", "textAfter", "placeholder", "leftHelper", "enumerationType", "requiredPlacement", "titleCaption", "hintTrigger", "hintText", "hintView", "hintSize", "hintTargetIcon", "hintPlacement", "hintHasArrow", "hintOffset", "hintWidth", "hintContentLeft", "view", "size", "readOnly", "disabled", "required", "clear", "optional", "hasDivider", "value", "chips", "chipType", "onChange", "onChangeChips", "onSearch", "onKeyDown"];
|
27
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
28
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
29
29
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
@@ -86,6 +86,8 @@ var textFieldRoot = exports.textFieldRoot = function textFieldRoot(Root) {
|
|
86
86
|
hasDivider = _ref.hasDivider,
|
87
87
|
outerValue = _ref.value,
|
88
88
|
values = _ref.chips,
|
89
|
+
_ref$chipType = _ref.chipType,
|
90
|
+
chipType = _ref$chipType === void 0 ? 'default' : _ref$chipType,
|
89
91
|
onChange = _ref.onChange,
|
90
92
|
onChangeChips = _ref.onChangeChips,
|
91
93
|
onSearch = _ref.onSearch,
|
@@ -134,8 +136,8 @@ var textFieldRoot = exports.textFieldRoot = function textFieldRoot(Root) {
|
|
134
136
|
var requiredPlacementClass = requiredPlacement === 'right' ? _TextField2.classes.requiredAlignRight : undefined;
|
135
137
|
var labelPlacementClass = innerLabelPlacementValue ? _TextField2.classes["".concat(innerLabelPlacementValue, "LabelPlacement")] : undefined;
|
136
138
|
var hasValueClass = hasValue ? _TextField2.classes.hasValue : undefined;
|
137
|
-
var wrapperWithoutLeftContent = !contentLeft && isChipsVisible ? _TextField2.classes.hasEmptyContentLeft : undefined;
|
138
|
-
var wrapperWithoutRightContent = !contentRight && isChipsVisible ? _TextField2.classes.hasEmptyContentRight : undefined;
|
139
|
+
var wrapperWithoutLeftContent = !contentLeft && isChipsVisible && chipType === 'default' ? _TextField2.classes.hasEmptyContentLeft : undefined;
|
140
|
+
var wrapperWithoutRightContent = !contentRight && isChipsVisible && chipType === 'default' ? _TextField2.classes.hasEmptyContentRight : undefined;
|
139
141
|
var hintRef = (0, _hooks.useOutsideClick)(function () {
|
140
142
|
setIsHintVisible(false);
|
141
143
|
});
|
@@ -326,7 +328,8 @@ var textFieldRoot = exports.textFieldRoot = function textFieldRoot(Root) {
|
|
326
328
|
onClear: function onClear() {
|
327
329
|
return onChipClear(chipId, index);
|
328
330
|
},
|
329
|
-
onClick: onChipClick
|
331
|
+
onClick: onChipClick,
|
332
|
+
chipType: chipType
|
330
333
|
// TODO: #1547
|
331
334
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
332
335
|
// @ts-ignore
|
@@ -62,7 +62,7 @@ export function App() {
|
|
62
62
|
```
|
63
63
|
|
64
64
|
### Статус поля
|
65
|
-
Статус поля задается с помощью свойства `status`.
|
65
|
+
Статус поля задается с помощью свойства `status`.
|
66
66
|
Возможные значения свойства: `success`, `warning` и `error`.
|
67
67
|
На отображение TextField так же влияют свойства `clear` и `hasDivider`:
|
68
68
|
|
@@ -150,7 +150,7 @@ export function App() {
|
|
150
150
|
```
|
151
151
|
|
152
152
|
### Режим ввода
|
153
|
-
С помощью свойства `enumerationType` можно вводить элементы как теги.
|
153
|
+
С помощью свойства `enumerationType` можно вводить элементы как теги. Свойство `chipType` изменяет внешний вид чипа.
|
154
154
|
По нажатию Enter, после ввода нужного текста, он преобразуется в Chip:
|
155
155
|
|
156
156
|
```tsx live
|
@@ -166,7 +166,17 @@ export function App() {
|
|
166
166
|
size="l"
|
167
167
|
enumerationType="chip"
|
168
168
|
helperText="Подсказка снизу"
|
169
|
-
|
169
|
+
chips={["Значение 1"]}
|
170
|
+
/>
|
171
|
+
|
172
|
+
<TextField
|
173
|
+
placeholder="Введите значение"
|
174
|
+
defaultValue="Значение"
|
175
|
+
size="l"
|
176
|
+
enumerationType="chip"
|
177
|
+
helperText="Подсказка снизу"
|
178
|
+
chips={["Значение 1"]}
|
179
|
+
chipType="text"
|
170
180
|
/>
|
171
181
|
</div>
|
172
182
|
);
|
@@ -20,14 +20,23 @@ var TextFieldChip = exports.TextFieldChip = /*#__PURE__*/(0, _react.forwardRef)(
|
|
20
20
|
onClick = _ref.onClick,
|
21
21
|
onClear = _ref.onClear,
|
22
22
|
onKeyDown = _ref.onKeyDown,
|
23
|
-
_forceChipManipulationWithReadonly = _ref._forceChipManipulationWithReadonly
|
23
|
+
_forceChipManipulationWithReadonly = _ref._forceChipManipulationWithReadonly,
|
24
|
+
chipType = _ref.chipType;
|
24
25
|
var onClearHandle = function onClearHandle() {
|
25
26
|
return onClear(id);
|
26
27
|
};
|
27
28
|
var onKeyDownHandle = function onKeyDownHandle(event) {
|
28
29
|
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event, id);
|
29
30
|
};
|
30
|
-
|
31
|
+
var handleClick = function handleClick(e) {
|
32
|
+
if (onClick) {
|
33
|
+
onClick(e);
|
34
|
+
}
|
35
|
+
if (onClear) {
|
36
|
+
onClear(id);
|
37
|
+
}
|
38
|
+
};
|
39
|
+
return chipType === 'default' ? /*#__PURE__*/_react["default"].createElement(_TextFieldChip.StyledChip, {
|
31
40
|
ref: ref,
|
32
41
|
tabIndex: -1,
|
33
42
|
disabled: disabled,
|
@@ -41,5 +50,10 @@ var TextFieldChip = exports.TextFieldChip = /*#__PURE__*/(0, _react.forwardRef)(
|
|
41
50
|
// @ts-ignore
|
42
51
|
,
|
43
52
|
_forceChipManipulationWithReadonly: _forceChipManipulationWithReadonly
|
44
|
-
})
|
53
|
+
}) : /*#__PURE__*/_react["default"].createElement(_TextFieldChip.TextChip, {
|
54
|
+
ref: ref,
|
55
|
+
tabIndex: -1,
|
56
|
+
onClick: handleClick,
|
57
|
+
onKeyDown: onKeyDownHandle
|
58
|
+
}, text);
|
45
59
|
});
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.StyledChip = void 0;
|
6
|
+
exports.TextChip = exports.StyledChip = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
8
|
var _Chip = /*#__PURE__*/require("../../../Chip");
|
9
9
|
var _engines = /*#__PURE__*/require("../../../../engines");
|
@@ -22,4 +22,12 @@ var StyledChip = exports.StyledChip = /*#__PURE__*/(0, _styledComponents["defaul
|
|
22
22
|
outlineSize: '0.0625rem',
|
23
23
|
outlineRadius: /*#__PURE__*/"calc(var(".concat(_TextField.tokens.chipBorderRadius, ") - 0.1rem)"),
|
24
24
|
outlineColor: /*#__PURE__*/"var(".concat(_TextField.tokens.focusColor, ")")
|
25
|
-
}), _TextField.tokens.chipOpacityReadonly);
|
25
|
+
}), _TextField.tokens.chipOpacityReadonly);
|
26
|
+
var TextChip = exports.TextChip = /*#__PURE__*/_styledComponents["default"].button.withConfig({
|
27
|
+
componentId: "plasma-new-hope__sc-1mypbcr-1"
|
28
|
+
})(["display:block;flex:none;background:none;border:none;outline:none;padding:0;white-space:nowrap;cursor:pointer;font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");color:var(", ");", " &:after{content:',';}&:last-child{&:after{content:'';}}"], _TextField.tokens.fontFamily, _TextField.tokens.fontSize, _TextField.tokens.fontStyle, _TextField.tokens.fontWeight, _TextField.tokens.letterSpacing, _TextField.tokens.lineHeight, _TextField.tokens.color, /*#__PURE__*/(0, _mixins.addFocus)({
|
29
|
+
outlineOffset: '0.0625rem',
|
30
|
+
outlineSize: '0.0625rem',
|
31
|
+
outlineRadius: /*#__PURE__*/"calc(var(".concat(_TextField.tokens.chipBorderRadius, ") - 0.1rem)"),
|
32
|
+
outlineColor: /*#__PURE__*/"var(".concat(_TextField.tokens.focusColor, ")")
|
33
|
+
}));
|