@salutejs/plasma-new-hope 0.229.0-canary.1666.12456056975.0 → 0.230.0-canary.1670.12462995068.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/cjs/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/cjs/components/Breadcrumbs/utils/index.js +38 -0
- package/cjs/components/Breadcrumbs/utils/index.js.map +1 -1
- package/cjs/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +3 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +75 -0
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +112 -0
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.js +3 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +25 -0
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Select/Select.js +3 -2
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.css +109 -0
- package/cjs/components/Select/ui/Inner/Inner.js +1 -1
- package/cjs/components/Select/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.css +112 -0
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -2
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.css +91 -0
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +7 -0
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/cjs/components/TextArea/TextArea.js +6 -0
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextField/TextField.js +1 -0
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/engines/common.js +36 -0
- package/cjs/engines/common.js.map +1 -1
- package/cjs/engines/linaria.js +3 -3
- package/cjs/engines/linaria.js.map +1 -1
- package/emotion/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/emotion/cjs/components/Breadcrumbs/utils/index.js +37 -1
- package/emotion/cjs/components/Calendar/utils/getDateWithModification.js +3 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +4 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/cjs/components/Dropdown/Dropdown.js +4 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/emotion/cjs/components/Select/Select.js +4 -3
- package/emotion/cjs/components/Select/ui/Inner/Inner.js +3 -3
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +3 -3
- package/emotion/cjs/components/TextArea/TextArea.js +7 -1
- package/emotion/cjs/components/TextField/TextField.js +2 -1
- package/emotion/cjs/engines/common.js +42 -2
- package/emotion/cjs/engines/emotion.js +4 -4
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/emotion/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/emotion/es/components/Breadcrumbs/utils/index.js +35 -0
- package/emotion/es/components/Calendar/utils/getDateWithModification.js +1 -1
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +2 -2
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/es/components/Dropdown/Dropdown.js +2 -2
- package/emotion/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/emotion/es/components/Select/Select.js +2 -2
- package/emotion/es/components/Select/ui/Inner/Inner.js +1 -1
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +1 -1
- package/emotion/es/components/TextArea/TextArea.js +8 -2
- package/emotion/es/components/TextField/TextField.js +2 -1
- package/emotion/es/engines/common.js +40 -0
- package/emotion/es/engines/emotion.js +2 -2
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/es/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/es/components/Breadcrumbs/utils/index.js +37 -1
- package/es/components/Breadcrumbs/utils/index.js.map +1 -1
- package/es/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +3 -3
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +75 -0
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +112 -0
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Dropdown/Dropdown.js +3 -3
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +25 -0
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Select/Select.js +3 -3
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.css +109 -0
- package/es/components/Select/ui/Inner/Inner.js +1 -1
- package/es/components/Select/ui/Inner/Inner.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.css +112 -0
- package/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Slider/components/Double/Double.css +91 -0
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +7 -0
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/es/components/TextArea/TextArea.js +7 -1
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextField/TextField.js +1 -0
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/engines/common.js +36 -2
- package/es/engines/common.js.map +1 -1
- package/es/engines/linaria.js +1 -1
- package/es/engines/linaria.js.map +1 -1
- package/package.json +5 -17
- package/styled-components/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/styled-components/cjs/components/Breadcrumbs/utils/index.js +37 -1
- package/styled-components/cjs/components/Calendar/utils/getDateWithModification.js +3 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +4 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/cjs/components/Dropdown/Dropdown.js +4 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/styled-components/cjs/components/Select/Select.js +4 -3
- package/styled-components/cjs/components/Select/ui/Inner/Inner.js +3 -3
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +3 -3
- package/styled-components/cjs/components/TextArea/TextArea.js +6 -0
- package/styled-components/cjs/components/TextField/TextField.js +1 -0
- package/styled-components/cjs/engines/common.js +42 -2
- package/styled-components/cjs/engines/styled-components.js +3 -3
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/styled-components/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/styled-components/es/components/Breadcrumbs/utils/index.js +35 -0
- package/styled-components/es/components/Calendar/utils/getDateWithModification.js +1 -1
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +2 -2
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/es/components/Dropdown/Dropdown.js +2 -2
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/styled-components/es/components/Select/Select.js +2 -2
- package/styled-components/es/components/Select/ui/Inner/Inner.js +1 -1
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +1 -1
- package/styled-components/es/components/TextArea/TextArea.js +7 -1
- package/styled-components/es/components/TextField/TextField.js +1 -0
- package/styled-components/es/engines/common.js +40 -0
- package/styled-components/es/engines/styled-components.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/types/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/types/components/Breadcrumbs/utils/index.d.ts +5 -2
- package/types/components/Breadcrumbs/utils/index.d.ts.map +1 -1
- package/types/components/Calendar/utils/getDateWithModification.d.ts +1 -1
- package/types/components/Calendar/utils/getDateWithModification.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts +2 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +2 -1
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts +2 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/engines/common.d.ts +3 -1
- package/types/engines/common.d.ts.map +1 -1
- package/cjs/components/Breadcrumbs/ui/BreadcrumbShorter/BreadcrumbShorter.css +0 -3
- package/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -44
- package/cjs/components/Breadcrumbs/utils/getShortItems.js.map +0 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -10
- package/cjs/components/Combobox/ComboboxNew/Combobox.context.js.map +0 -1
- package/cjs/components/Dropdown/Dropdown.context.js +0 -10
- package/cjs/components/Dropdown/Dropdown.context.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.css +0 -27
- package/cjs/components/Select/Select.context.js +0 -10
- package/cjs/components/Select/Select.context.js.map +0 -1
- package/cjs/engines/utils.js +0 -40
- package/cjs/engines/utils.js.map +0 -1
- package/emotion/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -42
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -8
- package/emotion/cjs/components/Dropdown/Dropdown.context.js +0 -8
- package/emotion/cjs/components/Select/Select.context.js +0 -8
- package/emotion/cjs/engines/utils.js +0 -42
- package/emotion/es/components/Breadcrumbs/utils/getShortItems.js +0 -35
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -2
- package/emotion/es/components/Dropdown/Dropdown.context.js +0 -2
- package/emotion/es/components/Select/Select.context.js +0 -2
- package/emotion/es/engines/utils.js +0 -36
- package/es/components/Breadcrumbs/ui/BreadcrumbShorter/BreadcrumbShorter.css +0 -3
- package/es/components/Breadcrumbs/utils/getShortItems.js +0 -39
- package/es/components/Breadcrumbs/utils/getShortItems.js.map +0 -1
- package/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -6
- package/es/components/Combobox/ComboboxNew/Combobox.context.js.map +0 -1
- package/es/components/Dropdown/Dropdown.context.js +0 -6
- package/es/components/Dropdown/Dropdown.context.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.css +0 -27
- package/es/components/Select/Select.context.js +0 -6
- package/es/components/Select/Select.context.js.map +0 -1
- package/es/engines/utils.js +0 -35
- package/es/engines/utils.js.map +0 -1
- package/styled-components/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -42
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -8
- package/styled-components/cjs/components/Dropdown/Dropdown.context.js +0 -8
- package/styled-components/cjs/components/Select/Select.context.js +0 -8
- package/styled-components/cjs/engines/utils.js +0 -42
- package/styled-components/es/components/Breadcrumbs/utils/getShortItems.js +0 -35
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -2
- package/styled-components/es/components/Dropdown/Dropdown.context.js +0 -2
- package/styled-components/es/components/Select/Select.context.js +0 -2
- package/styled-components/es/engines/utils.js +0 -36
- package/types/components/Breadcrumbs/utils/getShortItems.d.ts +0 -6
- package/types/components/Breadcrumbs/utils/getShortItems.d.ts.map +0 -1
- package/types/components/Combobox/ComboboxNew/Combobox.context.d.ts +0 -4
- package/types/components/Combobox/ComboboxNew/Combobox.context.d.ts.map +0 -1
- package/types/components/Dropdown/Dropdown.context.d.ts +0 -4
- package/types/components/Dropdown/Dropdown.context.d.ts.map +0 -1
- package/types/components/Select/Select.context.d.ts +0 -4
- package/types/components/Select/Select.context.d.ts.map +0 -1
- package/types/engines/utils.d.ts +0 -4
- package/types/engines/utils.d.ts.map +0 -1
- /package/cjs/components/Breadcrumbs/utils/{getShortItems.css → index.css} +0 -0
- /package/es/components/Breadcrumbs/utils/{getShortItems.css → index.css} +0 -0
@@ -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';\nimport { getInputWidth } from './getInputWidth';\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 keepPlaceholder,\n textBefore,\n textAfter,\n placeholder,\n leftHelper,\n enumerationType = 'plain',\n requiredPlacement = 'right',\n titleCaption,\n chipView = 'default',\n chipValidator,\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 onFocus,\n onBlur,\n\n ...rest\n },\n ref,\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const inputContainerRef = 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 [hasFocus, setHasFocus] = useState(false);\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 innerKeepPlaceholder = keepPlaceholder && labelPlacement === 'inner';\n const hasPlaceholder = Boolean(placeholder) && (innerKeepPlaceholder || !hasInnerLabel);\n let hasTextAfter = Boolean(textAfter);\n let hasTextBefore = textBefore && !isChipEnumeration;\n if (labelPlacement === 'inner') {\n if (!hasValue && !hasPlaceholder && !hasFocus) {\n hasTextAfter = false;\n hasTextBefore = false;\n }\n }\n\n const hasPlaceholderPadding = hasInnerLabel && keepPlaceholder && size !== 'xs';\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 const keepPlaceholderClass = hasPlaceholder && placeholderShown && classes.keepPlaceholder;\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 const { value } = event.target as HTMLInputElement;\n if (hasTextAfter) {\n const textWidth = getInputWidth(event.currentTarget, inputContainerRef.current);\n event.currentTarget.style.width = `${textWidth}px`;\n }\n setHasValue(Boolean(value));\n };\n\n useEffect(() => {\n if (hasTextAfter && inputRef.current) {\n const textWidth = getInputWidth(inputRef.current, inputContainerRef.current);\n inputRef.current.style.width = `${textWidth}px`;\n } else {\n inputRef.current?.style.removeProperty('width');\n }\n }, [hasTextAfter]);\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n setHasFocus(true);\n onFocus?.(event);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n setHasFocus(false);\n onBlur?.(event);\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 chipView={chipView}\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 {Boolean(textBefore && isChipEnumeration) && (\n <StyledTextBefore>{textBefore}</StyledTextBefore>\n )}\n {isChipEnumeration && Boolean(chips?.length) && (\n <StyledChips className={classes.chipsWrapper}>\n {chips?.map(({ id: chipId, text }, index) => {\n const validationView = chipValidator?.(String(text));\n const resView = validationView?.view || chipView;\n\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 view={resView}\n rootWrapper={Root}\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 ref={inputContainerRef} hasDynamicWidth={hasTextAfter}>\n {hasTextBefore && <StyledTextBefore>{textBefore}</StyledTextBefore>}\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, keepPlaceholderClass)}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n onInput={handleInput}\n onChange={handleChange}\n onKeyDown={handleOnKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n />\n {hasInnerLabel && (\n <Label id={labelId} htmlFor={innerId}>\n {innerLabelValue}\n {optionalTextNode}\n </Label>\n )}\n {placeholderShown && !hasValue && (\n <InputPlaceholder hasPadding={hasPlaceholderPadding}>\n {hasTextBefore && <StyledTextBefore isHidden>{textBefore}</StyledTextBefore>}\n {innerPlaceholderValue}\n {hasPlaceholderOptional && optionalTextNode}\n </InputPlaceholder>\n )}\n {hasTextAfter && <StyledTextAfter>{textAfter}</StyledTextAfter>}\n </InputContainer>\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$current4","id","className","style","contentLeft","contentRight","label","labelPlacement","keepPlaceholder","textBefore","textAfter","placeholder","leftHelper","_ref$enumerationType","enumerationType","_ref$requiredPlacemen","requiredPlacement","titleCaption","_ref$chipView","chipView","chipValidator","_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","onFocus","onBlur","rest","contentRef","useRef","inputContainerRef","inputRef","inputForkRef","useForkRef","chipsRefs","controlledRefs","_useState","useState","Boolean","current","defaultValue","_useState2","_slicedToArray","hasValue","setHasValue","_useState3","_useState4","hasFocus","setHasFocus","_useState5","_useState6","setChips","_useState7","_useState8","isHintVisible","setIsHintVisible","uniqId","safeUseId","innerId","labelId","helperTextId","isDefaultView","isChipEnumeration","isChipsVisible","length","withHasChips","classes","hasChips","undefined","hasLabelValue","hasInnerLabel","hasOuterLabel","innerKeepPlaceholder","hasPlaceholder","hasTextAfter","hasTextBefore","hasPlaceholderPadding","innerLabelValue","innerLabelPlacementValue","innerPlaceholderValue","placeholderShown","clearClass","hasDividerClass","hasHintClass","hasHint","requiredPlacementClass","requiredAlignRight","labelPlacementClass","concat","hasValueClass","keepPlaceholderClass","wrapperWithoutLeftContent","hasEmptyContentLeft","wrapperWithoutRightContent","hasEmptyContentRight","hintRef","useOutsideClick","hintInnerRef","hintForkRef","handleInput","event","_ref2","target","textWidth","getInputWidth","currentTarget","width","useEffect","_inputRef$current2","removeProperty","handleFocus","handleBlur","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","map","text","_inputRef$current3","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","chipsWrapper","_ref3","chipId","validationView","String","resView","TextFieldChip","key","onClear","rootWrapper","_forceChipManipulationWithReadonly","InputContainer","hasDynamicWidth","Input","onInput","InputPlaceholder","hasPadding","isHidden","StyledTextAfter","StyledContentRight","LeftHelper","textFieldConfig","name","tag","layout","variations","css","viewCSS","sizeCSS","clearCSS","attrs","disabledCSS","readOnlyCSS","labelPlacementCSS","hintViewCSS","hintSizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAMA,YAAY,GAAG,UAAU,CAAA;AAExB,IAAMC,IAAI,GAGhB,UAAA;AAED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AAA,GAAG,EAAEK,WAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACD3M,IAAAA,QAAQ,EAAE;AACNuM,MAAAA,GAAG,EAAEM,WAAW;AAChBF,MAAAA,KAAK,EAAE,IAAA;KACV;AACD3O,IAAAA,cAAc,EAAE;AACZuO,MAAAA,GAAG,EAAEO,WAAAA;KACR;AACD5N,IAAAA,QAAQ,EAAE;AACNqN,MAAAA,GAAG,EAAEQ,WAAAA;KACR;AACD3N,IAAAA,QAAQ,EAAE;AACNmN,MAAAA,GAAG,EAAES,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNnN,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';\nimport { getInputWidth } from './getInputWidth';\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 keepPlaceholder,\n textBefore,\n textAfter,\n placeholder,\n leftHelper,\n enumerationType = 'plain',\n requiredPlacement = 'right',\n titleCaption,\n chipView = 'default',\n chipValidator,\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 onFocus,\n onBlur,\n\n ...rest\n },\n ref,\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const inputContainerRef = 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 [hasFocus, setHasFocus] = useState(false);\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 innerKeepPlaceholder = keepPlaceholder && labelPlacement === 'inner';\n const hasPlaceholder = Boolean(placeholder) && (innerKeepPlaceholder || !hasInnerLabel);\n let hasTextAfter = Boolean(textAfter);\n let hasTextBefore = textBefore && !isChipEnumeration;\n if (labelPlacement === 'inner') {\n if (!hasValue && !hasPlaceholder && !hasFocus) {\n hasTextAfter = false;\n hasTextBefore = false;\n }\n }\n\n const hasPlaceholderPadding = hasInnerLabel && keepPlaceholder && size !== 'xs';\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 const keepPlaceholderClass = hasPlaceholder && placeholderShown && classes.keepPlaceholder;\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 const { value } = event.target as HTMLInputElement;\n if (hasTextAfter) {\n const textWidth = getInputWidth(event.currentTarget, inputContainerRef.current);\n event.currentTarget.style.width = `${textWidth}px`;\n }\n setHasValue(Boolean(value));\n };\n\n useEffect(() => {\n if (hasTextAfter && inputRef.current) {\n const textWidth = getInputWidth(inputRef.current, inputContainerRef.current);\n inputRef.current.style.width = `${textWidth}px`;\n } else {\n inputRef.current?.style.removeProperty('width');\n }\n }, [hasTextAfter]);\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n setHasFocus(true);\n onFocus?.(event);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n setHasFocus(false);\n onBlur?.(event);\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 chipView={chipView}\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 {Boolean(textBefore && isChipEnumeration) && (\n <StyledTextBefore>{textBefore}</StyledTextBefore>\n )}\n {isChipEnumeration && Boolean(chips?.length) && (\n <StyledChips className={classes.chipsWrapper}>\n {chips?.map(({ id: chipId, text }, index) => {\n const validationView = chipValidator?.(String(text));\n const resView = validationView?.view || chipView;\n\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 view={resView}\n rootWrapper={Root}\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 ref={inputContainerRef} hasDynamicWidth={hasTextAfter}>\n {hasTextBefore && <StyledTextBefore>{textBefore}</StyledTextBefore>}\n <Input\n ref={inputForkRef}\n id={innerId}\n value={outerValue}\n required={required}\n aria-labelledby={labelId}\n aria-describedby={helperTextId}\n placeholder={innerPlaceholderValue}\n className={cx(hasValueClass, keepPlaceholderClass)}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n onInput={handleInput}\n onChange={handleChange}\n onKeyDown={handleOnKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n />\n {hasInnerLabel && (\n <Label id={labelId} htmlFor={innerId}>\n {innerLabelValue}\n {optionalTextNode}\n </Label>\n )}\n {placeholderShown && !hasValue && (\n <InputPlaceholder hasPadding={hasPlaceholderPadding}>\n {hasTextBefore && <StyledTextBefore isHidden>{textBefore}</StyledTextBefore>}\n {innerPlaceholderValue}\n {hasPlaceholderOptional && optionalTextNode}\n </InputPlaceholder>\n )}\n {hasTextAfter && <StyledTextAfter>{textAfter}</StyledTextAfter>}\n </InputContainer>\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$current4","id","className","style","contentLeft","contentRight","label","labelPlacement","keepPlaceholder","textBefore","textAfter","placeholder","leftHelper","_ref$enumerationType","enumerationType","_ref$requiredPlacemen","requiredPlacement","titleCaption","_ref$chipView","chipView","chipValidator","_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","onFocus","onBlur","rest","contentRef","useRef","inputContainerRef","inputRef","inputForkRef","useForkRef","chipsRefs","controlledRefs","_useState","useState","Boolean","current","defaultValue","_useState2","_slicedToArray","hasValue","setHasValue","_useState3","_useState4","hasFocus","setHasFocus","_useState5","_useState6","setChips","_useState7","_useState8","isHintVisible","setIsHintVisible","uniqId","safeUseId","innerId","labelId","helperTextId","isDefaultView","isChipEnumeration","isChipsVisible","length","withHasChips","classes","hasChips","undefined","hasLabelValue","hasInnerLabel","hasOuterLabel","innerKeepPlaceholder","hasPlaceholder","hasTextAfter","hasTextBefore","hasPlaceholderPadding","innerLabelValue","innerLabelPlacementValue","innerPlaceholderValue","placeholderShown","clearClass","hasDividerClass","hasHintClass","hasHint","requiredPlacementClass","requiredAlignRight","labelPlacementClass","concat","hasValueClass","keepPlaceholderClass","wrapperWithoutLeftContent","hasEmptyContentLeft","wrapperWithoutRightContent","hasEmptyContentRight","hintRef","useOutsideClick","hintInnerRef","hintForkRef","handleInput","event","_ref2","target","textWidth","getInputWidth","currentTarget","width","useEffect","_inputRef$current2","removeProperty","handleFocus","handleBlur","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","map","text","_inputRef$current3","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","chipsWrapper","_ref3","chipId","validationView","String","resView","TextFieldChip","key","onClear","rootWrapper","_forceChipManipulationWithReadonly","InputContainer","hasDynamicWidth","Input","onInput","InputPlaceholder","hasPadding","isHidden","StyledTextAfter","StyledContentRight","LeftHelper","textFieldConfig","name","tag","layout","variations","css","viewCSS","sizeCSS","clearCSS","attrs","disabledCSS","readOnlyCSS","labelPlacementCSS","hintViewCSS","hintSizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,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,EA2DIC,GAAG,EACF;IAAA,IAAAC,iBAAA,EAAAC,kBAAA,CAAA;AAAA,IAAA,IA1DGC,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,CAALS,KAAK;MACLC,cAAc,GAAAV,IAAA,CAAdU,cAAc;MACdC,eAAe,GAAAX,IAAA,CAAfW,eAAe;MACfC,UAAU,GAAAZ,IAAA,CAAVY,UAAU;MACVC,SAAS,GAAAb,IAAA,CAATa,SAAS;MACTC,WAAW,GAAAd,IAAA,CAAXc,WAAW;MACXC,UAAU,GAAAf,IAAA,CAAVe,UAAU;MAAAC,oBAAA,GAAAhB,IAAA,CACViB,eAAe;AAAfA,MAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,oBAAA;MAAAE,qBAAA,GAAAlB,IAAA,CACzBmB,iBAAiB;AAAjBA,MAAAA,iBAA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A,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAElP,aAAa;AACrBF,EAAAA,IAAI,EAAJA,IAAI;AACJqP,EAAAA,UAAU,EAAE;AACRzM,IAAAA,IAAI,EAAE;AACF0M,MAAAA,GAAG,EAAEC,WAAAA;KACR;AACD1M,IAAAA,IAAI,EAAE;AACFyM,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDnM,IAAAA,KAAK,EAAE;AACHiM,MAAAA,GAAG,EAAEG,WAAQ;AACbC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDzM,IAAAA,QAAQ,EAAE;AACNqM,MAAAA,GAAG,EAAEK,WAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACD3M,IAAAA,QAAQ,EAAE;AACNuM,MAAAA,GAAG,EAAEM,WAAW;AAChBF,MAAAA,KAAK,EAAE,IAAA;KACV;AACD3O,IAAAA,cAAc,EAAE;AACZuO,MAAAA,GAAG,EAAEO,WAAAA;KACR;AACD5N,IAAAA,QAAQ,EAAE;AACNqN,MAAAA,GAAG,EAAEQ,WAAAA;KACR;AACD3N,IAAAA,QAAQ,EAAE;AACNmN,MAAAA,GAAG,EAAES,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNnN,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;;"}
|
package/cjs/engines/common.js
CHANGED
@@ -6,6 +6,40 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.j
|
|
6
6
|
var React = require('react');
|
7
7
|
var linaria = require('./linaria.js');
|
8
8
|
|
9
|
+
//
|
10
|
+
// Тип HTMLAttributesOmitOnChange требуется чтобы использовать компонент с кастомным пропсом onChange
|
11
|
+
//
|
12
|
+
|
13
|
+
var getStaticVariants = function getStaticVariants(config) {
|
14
|
+
if (!config.variations) {
|
15
|
+
return [];
|
16
|
+
}
|
17
|
+
var res = [];
|
18
|
+
var variations = config.variations;
|
19
|
+
|
20
|
+
// eslint-disable-next-line guard-for-in
|
21
|
+
for (var key in variations) {
|
22
|
+
var css = variations[key].css;
|
23
|
+
css && res.push(css);
|
24
|
+
}
|
25
|
+
return res;
|
26
|
+
};
|
27
|
+
var getDynamicVariants = function getDynamicVariants(config) {
|
28
|
+
return function (props) {
|
29
|
+
var res = [];
|
30
|
+
|
31
|
+
// eslint-disable-next-line guard-for-in
|
32
|
+
for (var key in config.variations) {
|
33
|
+
if (key in props) {
|
34
|
+
var variant = config.variations[key];
|
35
|
+
var css = variant[props[key]];
|
36
|
+
// no css for { modifier: true }
|
37
|
+
css && Array.isArray(css) ? res.push.apply(res, _rollupPluginBabelHelpers.toConsumableArray(css)) : res.push(css);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
return res;
|
41
|
+
};
|
42
|
+
};
|
9
43
|
var mergeConfig = function mergeConfig(baseConfig, userConfig) {
|
10
44
|
var res = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, baseConfig), userConfig);
|
11
45
|
if (res.variations) {
|
@@ -43,5 +77,7 @@ function component(config) {
|
|
43
77
|
}
|
44
78
|
|
45
79
|
exports.component = component;
|
80
|
+
exports.getDynamicVariants = getDynamicVariants;
|
81
|
+
exports.getStaticVariants = getStaticVariants;
|
46
82
|
exports.mergeConfig = mergeConfig;
|
47
83
|
//# sourceMappingURL=common.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesWithoutOnChange,\n HTMLAttributesWithoutOnChangeAndDefaultValue,\n} from './types';\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["
|
1
|
+
{"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLAnyAttributes,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesWithoutOnChange,\n HTMLAttributesWithoutOnChangeAndDefaultValue,\n} from './types';\n\n//\n// Тип HTMLAttributesOmitOnChange требуется чтобы использовать компонент с кастомным пропсом onChange\n//\n\nexport const getStaticVariants = (config: ComponentConfig) => {\n if (!config.variations) {\n return [];\n }\n const res = [];\n const { variations } = config;\n\n // eslint-disable-next-line guard-for-in\n for (const key in variations) {\n const { css } = variations[key];\n css && res.push(css);\n }\n\n return res;\n};\n\nexport const getDynamicVariants = (config: ComponentConfig) => {\n return (props: HTMLAnyAttributes) => {\n const res = [];\n\n // eslint-disable-next-line guard-for-in\n for (const key in config.variations) {\n if (key in props) {\n const variant = config.variations[key];\n\n const css = variant[props[key]];\n // no css for { modifier: true }\n css && Array.isArray(css) ? res.push(...css) : res.push(css);\n }\n }\n\n return res;\n };\n};\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["getStaticVariants","config","variations","res","key","css","push","getDynamicVariants","props","variant","Array","isArray","apply","_toConsumableArray","mergeConfig","baseConfig","userConfig","_objectSpread","attrs","defaults","component","Comp","layout","_component","React","forwardRef","ref","createElement","_extends"],"mappings":";;;;;;;;AAaA;AACA;AACA;;IAEaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,MAAuB,EAAK;AAC1D,EAAA,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE;AACpB,IAAA,OAAO,EAAE,CAAA;AACb,GAAA;EACA,IAAMC,GAAG,GAAG,EAAE,CAAA;AACd,EAAA,IAAQD,UAAU,GAAKD,MAAM,CAArBC,UAAU,CAAA;;AAElB;AACA,EAAA,KAAK,IAAME,GAAG,IAAIF,UAAU,EAAE;AAC1B,IAAA,IAAQG,GAAG,GAAKH,UAAU,CAACE,GAAG,CAAC,CAAvBC,GAAG,CAAA;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A,MAAM,KAANA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAM,CAAEkB,QAAQ,EAAMX,KAAK,EAAA;AAAEkB,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAAA,GACtD,CAAC,CAAA;AACN;;;;;;;"}
|
package/cjs/engines/linaria.js
CHANGED
@@ -6,7 +6,7 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.j
|
|
6
6
|
var React = require('react');
|
7
7
|
var core = require('@linaria/core');
|
8
8
|
require('focus-visible');
|
9
|
-
var
|
9
|
+
var common = require('./common.js');
|
10
10
|
|
11
11
|
var _excluded = ["className"];
|
12
12
|
/* eslint-disable no-underscore-dangle */
|
@@ -14,8 +14,8 @@ var _component = function _component(componentConfig) {
|
|
14
14
|
var tag = componentConfig.tag,
|
15
15
|
base = componentConfig.base,
|
16
16
|
name = componentConfig.name;
|
17
|
-
var staticVariants =
|
18
|
-
var dynamicVariants =
|
17
|
+
var staticVariants = common.getStaticVariants(componentConfig);
|
18
|
+
var dynamicVariants = common.getDynamicVariants(componentConfig);
|
19
19
|
var Root = tag;
|
20
20
|
var component = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
21
21
|
var className = props.className,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"linaria.js","sources":["../../src/engines/linaria.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cx } from '@linaria/core';\n\n// TODO: #1008 Избавиться от импортов и переделать addFocus\nimport 'focus-visible';\nimport { getStaticVariants, getDynamicVariants } from './
|
1
|
+
{"version":3,"file":"linaria.js","sources":["../../src/engines/linaria.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cx } from '@linaria/core';\n\n// TODO: #1008 Избавиться от импортов и переделать addFocus\nimport 'focus-visible';\nimport { getStaticVariants, getDynamicVariants } from './common';\nimport type { ComponentConfig, HTMLAnyAttributes } from './types';\n\n/* eslint-disable no-underscore-dangle */\nexport const _component = (componentConfig: ComponentConfig) => {\n const { tag, base, name } = componentConfig;\n const staticVariants = getStaticVariants(componentConfig);\n const dynamicVariants = getDynamicVariants(componentConfig);\n const Root = tag as React.ElementType;\n\n const component = forwardRef<HTMLElement, HTMLAnyAttributes>((props, ref) => {\n const { className, ...rest } = props;\n const variants = dynamicVariants(rest);\n const cls = cx(className, base as string, ...(staticVariants as string[]), ...variants);\n\n // styled-components do it inside\n // filter props\n const baseProps: HTMLAnyAttributes = {};\n for (const key in rest) {\n if (!(key in componentConfig.variations)) {\n baseProps[key] = rest[key];\n }\n }\n\n baseProps.ref = ref;\n\n // styled-components do it inside\n // add props that should be attr( disabled for example)\n const htmlAttrs: HTMLAnyAttributes = {};\n for (const key in componentConfig.variations || {}) {\n if (key in rest) {\n const variant = componentConfig.variations[key];\n\n const { attrs } = variant;\n if (typeof attrs === 'boolean') {\n htmlAttrs[key] = rest[key];\n }\n }\n }\n\n return <Root className={cls} {...htmlAttrs} {...baseProps} />;\n });\n if (name) {\n component.displayName = name;\n }\n return component;\n};\n"],"names":["_component","componentConfig","tag","base","name","staticVariants","getStaticVariants","dynamicVariants","getDynamicVariants","Root","component","forwardRef","props","ref","className","rest","_objectWithoutProperties","_excluded","variants","cls","cx","apply","concat","_toConsumableArray","baseProps","key","variations","htmlAttrs","variant","attrs","React","createElement","_extends","displayName"],"mappings":";;;;;;;;;;;AAQA;IACaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,eAAgC,EAAK;AAC5D,EAAA,IAAQC,GAAG,GAAiBD,eAAe,CAAnCC,GAAG;IAAEC,IAAI,GAAWF,eAAe,CAA9BE,IAAI;IAAEC,IAAI,GAAKH,eAAe,CAAxBG,IAAI,CAAA;AACvB,EAAA,IAAMC,cAAc,GAAGC,wBAAiB,CAACL,eAAe,CAAC,CAAA;AACzD,EAAA,IAAMM,eAAe,GAAGC,yBAAkB,CAACP,eAAe,CAAC,CAAA;EAC3D,IAAMQ,IAAI,GAAGP,GAA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,OAAA;AACJ,KAAA;AAEA,IAAA,oBAAOK,KAAA,CAAAC,aAAA,CAACtB,IAAI,EAAAuB,iCAAA,CAAA;AAAClB,MAAAA,SAAS,EAAEK,GAAAA;AAAI,KAAA,EAAKQ,SAAS,EAAMH,SAAS,CAAG,CAAC,CAAA;AACjE,GAAC,CAAC,CAAA;AACF,EAAA,IAAIpB,IAAI,EAAE;IACNM,SAAS,CAACuB,WAAW,GAAG7B,IAAI,CAAA;AAChC,GAAA;AACA,EAAA,OAAOM,SAAS,CAAA;AACpB;;;;"}
|
@@ -11,7 +11,6 @@ var _base = /*#__PURE__*/require("./variations/_size/base");
|
|
11
11
|
var _base2 = /*#__PURE__*/require("./variations/_view/base");
|
12
12
|
var _Breadcrumbs = /*#__PURE__*/require("./Breadcrumbs.styles");
|
13
13
|
var _utils2 = /*#__PURE__*/require("./utils");
|
14
|
-
var _getShortItems = /*#__PURE__*/require("./utils/getShortItems");
|
15
14
|
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); }
|
16
15
|
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; }
|
17
16
|
var breadcrumbsRoot = exports.breadcrumbsRoot = function breadcrumbsRoot(Root) {
|
@@ -27,7 +26,7 @@ var breadcrumbsRoot = exports.breadcrumbsRoot = function breadcrumbsRoot(Root) {
|
|
27
26
|
color: "inherit",
|
28
27
|
size: (0, _utils2.convertIconSize)(size)
|
29
28
|
});
|
30
|
-
var renderItems = (0,
|
29
|
+
var renderItems = (0, _utils2.getRenderItems)(items, renderSeparator, showItems);
|
31
30
|
var itemsWithSeparator = (0, _utils2.addSeparator)(renderItems, renderSeparator);
|
32
31
|
return /*#__PURE__*/_react["default"].createElement(Root, {
|
33
32
|
ref: outerRootRef,
|
@@ -3,7 +3,24 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.convertIconSize = exports.addSeparator = void 0;
|
6
|
+
exports.shortItems = exports.getRenderItems = exports.convertIconSize = exports.addSeparator = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _BreadcrumbShorter = /*#__PURE__*/require("../ui/BreadcrumbShorter/BreadcrumbShorter");
|
9
|
+
var _Breadcrumbs = /*#__PURE__*/require("../Breadcrumbs.styles");
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
var shortItems = exports.shortItems = function shortItems(items, renderSeparator, showItems) {
|
12
|
+
if (!showItems || showItems < 2 || items.length <= showItems) {
|
13
|
+
return items;
|
14
|
+
}
|
15
|
+
var leftSlice = Math.floor(showItems / 2);
|
16
|
+
var rightSlice = items.length - leftSlice - showItems % 2;
|
17
|
+
var renderItems = items.slice(leftSlice, rightSlice);
|
18
|
+
var shorter = /*#__PURE__*/_react["default"].createElement(_BreadcrumbShorter.BreadcrumbShorter, {
|
19
|
+
separator: renderSeparator
|
20
|
+
}, renderItems);
|
21
|
+
items.splice(leftSlice, rightSlice - leftSlice, shorter);
|
22
|
+
return items;
|
23
|
+
};
|
7
24
|
var convertIconSize = exports.convertIconSize = function convertIconSize(size) {
|
8
25
|
switch (size) {
|
9
26
|
case 's':
|
@@ -13,6 +30,25 @@ var convertIconSize = exports.convertIconSize = function convertIconSize(size) {
|
|
13
30
|
return 's';
|
14
31
|
}
|
15
32
|
};
|
33
|
+
var getRenderItems = exports.getRenderItems = function getRenderItems(items, renderSeparator, showItems) {
|
34
|
+
var renderItems = shortItems(items.map(function (item) {
|
35
|
+
if (item.renderItem) {
|
36
|
+
return item.renderItem();
|
37
|
+
}
|
38
|
+
var title = item.title,
|
39
|
+
disabled = item.disabled,
|
40
|
+
href = item.href,
|
41
|
+
onClick = item.onClick;
|
42
|
+
return /*#__PURE__*/_react["default"].createElement(_Breadcrumbs.StyledLink, {
|
43
|
+
tabIndex: 0,
|
44
|
+
href: href,
|
45
|
+
disabled: disabled,
|
46
|
+
onClick: onClick,
|
47
|
+
isHref: Boolean(href || onClick)
|
48
|
+
}, title);
|
49
|
+
}), renderSeparator, showItems);
|
50
|
+
return renderItems;
|
51
|
+
};
|
16
52
|
var addSeparator = exports.addSeparator = function addSeparator(items, renderSeparator) {
|
17
53
|
return items.flatMap(function (item, idx) {
|
18
54
|
return idx < items.length - 1 ? [item, renderSeparator] : [item];
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.getDatesWithModifications = void 0;
|
7
7
|
var _types = /*#__PURE__*/require("../store/types");
|
8
|
-
var
|
8
|
+
var _ = /*#__PURE__*/require(".");
|
9
9
|
var dateOperationHandler = {
|
10
10
|
Days: {
|
11
11
|
add: function add(date) {
|
@@ -144,8 +144,8 @@ var getDatesWithModifications = exports.getDatesWithModifications = function get
|
|
144
144
|
includeEdgeDates = _ref3.includeEdgeDates,
|
145
145
|
min = _ref3.min,
|
146
146
|
max = _ref3.max;
|
147
|
-
var eventsMap = (0,
|
148
|
-
var disabledDatesMap = (0,
|
147
|
+
var eventsMap = (0, _.getPropsMap)(eventList);
|
148
|
+
var disabledDatesMap = (0, _.getPropsMap)(disabledList);
|
149
149
|
var filteredDates = type === _types.CalendarState.Days ? dates.filter(function (_ref4) {
|
150
150
|
var isDayInCurrentMonth = _ref4.isDayInCurrentMonth;
|
151
151
|
return isDayInCurrentMonth;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.comboboxRoot = exports.comboboxConfig = void 0;
|
6
|
+
exports.comboboxRoot = exports.comboboxConfig = exports.Context = void 0;
|
7
7
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
8
8
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
9
9
|
var _utils = /*#__PURE__*/require("../../../utils");
|
@@ -20,7 +20,6 @@ var _Combobox2 = /*#__PURE__*/require("./Combobox.styles");
|
|
20
20
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
21
21
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
22
22
|
var _SelectNative = /*#__PURE__*/require("./ui/SelectNative/SelectNative");
|
23
|
-
var _Combobox3 = /*#__PURE__*/require("./Combobox.context");
|
24
23
|
var _excluded = ["name", "multiple", "value", "onChange", "defaultValue", "isTargetAmount", "targetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "keepPlaceholder", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect", "renderValue", "zIndex", "beforeList", "afterList"];
|
25
24
|
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); }
|
26
25
|
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; }
|
@@ -38,6 +37,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
38
37
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
39
38
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
40
39
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
40
|
+
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({});
|
41
|
+
|
41
42
|
/**
|
42
43
|
* Поле ввода с выпадающим списком и возможностью фильтрации и выбора элементов.
|
43
44
|
*/
|
@@ -407,7 +408,7 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
407
408
|
onChange: onChange,
|
408
409
|
onSetValue: setInternalValue,
|
409
410
|
ref: ref
|
410
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(
|
411
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(Context.Provider, {
|
411
412
|
value: {
|
412
413
|
focusedPath: focusedPath,
|
413
414
|
checked: checked,
|
@@ -10,7 +10,7 @@ var _utils = /*#__PURE__*/require("../../../../utils");
|
|
10
10
|
var _Combobox = /*#__PURE__*/require("../../../../Combobox.tokens");
|
11
11
|
var _utils2 = /*#__PURE__*/require("../../../../../../../utils");
|
12
12
|
var _Icon = /*#__PURE__*/require("../../../../../../_Icon");
|
13
|
-
var _Combobox2 = /*#__PURE__*/require("../../../../Combobox
|
13
|
+
var _Combobox2 = /*#__PURE__*/require("../../../../Combobox");
|
14
14
|
var _hooks = /*#__PURE__*/require("../../../../../../../hooks");
|
15
15
|
var _Item = /*#__PURE__*/require("./Item.styles");
|
16
16
|
var _StyledIndicator;
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
exports.dropdownRoot = exports.dropdownConfig = void 0;
|
7
|
+
exports.dropdownRoot = exports.dropdownConfig = exports.Context = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
9
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
10
10
|
var _utils = /*#__PURE__*/require("../../utils");
|
@@ -20,7 +20,6 @@ var _Dropdown2 = /*#__PURE__*/require("./Dropdown.tokens");
|
|
20
20
|
var _useKeyboardNavigation = /*#__PURE__*/require("./hooks/useKeyboardNavigation");
|
21
21
|
var _useHashMaps3 = /*#__PURE__*/require("./hooks/useHashMaps");
|
22
22
|
var _FloatingPopover = /*#__PURE__*/require("./FloatingPopover");
|
23
|
-
var _Dropdown3 = /*#__PURE__*/require("./Dropdown.context");
|
24
23
|
var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "alwaysOpened", "portal", "renderItem", "zIndex", "beforeList", "afterList"];
|
25
24
|
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); }
|
26
25
|
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; }
|
@@ -33,6 +32,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
33
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
34
33
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
35
34
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
35
|
+
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({});
|
36
|
+
|
36
37
|
/**
|
37
38
|
* Выпадающий список.
|
38
39
|
*/
|
@@ -135,7 +136,7 @@ var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
|
|
135
136
|
}),
|
136
137
|
onKeyDown = _useKeyNavigation.onKeyDown;
|
137
138
|
var isCurrentListOpen = alwaysOpened || Boolean(path[0]);
|
138
|
-
return /*#__PURE__*/_react["default"].createElement(
|
139
|
+
return /*#__PURE__*/_react["default"].createElement(Context.Provider, {
|
139
140
|
value: {
|
140
141
|
focusedPath: focusedPath,
|
141
142
|
size: size,
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.DropdownInner = void 0;
|
7
7
|
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
8
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
9
|
-
var
|
9
|
+
var _ = /*#__PURE__*/require("..");
|
10
10
|
var _Dropdown = /*#__PURE__*/require("../../Dropdown.styles");
|
11
11
|
var _FloatingPopover = /*#__PURE__*/require("../../FloatingPopover");
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
@@ -44,7 +44,7 @@ var DropdownInner = exports.DropdownInner = function DropdownInner(_ref) {
|
|
44
44
|
opened: isCurrentListOpen,
|
45
45
|
onToggle: handleToggle,
|
46
46
|
trigger: trigger,
|
47
|
-
target: /*#__PURE__*/_react["default"].createElement(
|
47
|
+
target: /*#__PURE__*/_react["default"].createElement(_.DropdownItem, {
|
48
48
|
item: item,
|
49
49
|
index: index,
|
50
50
|
path: path,
|
@@ -77,7 +77,7 @@ var DropdownInner = exports.DropdownInner = function DropdownInner(_ref) {
|
|
77
77
|
});
|
78
78
|
})));
|
79
79
|
}
|
80
|
-
return /*#__PURE__*/_react["default"].createElement(
|
80
|
+
return /*#__PURE__*/_react["default"].createElement(_.DropdownItem, {
|
81
81
|
item: item,
|
82
82
|
path: path,
|
83
83
|
index: index,
|
@@ -9,7 +9,7 @@ var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react")
|
|
9
9
|
var _Dropdown = /*#__PURE__*/require("../../Dropdown.tokens");
|
10
10
|
var _utils = /*#__PURE__*/require("../../../../utils");
|
11
11
|
var _Icon = /*#__PURE__*/require("../../../_Icon");
|
12
|
-
var _Dropdown2 = /*#__PURE__*/require("../../Dropdown
|
12
|
+
var _Dropdown2 = /*#__PURE__*/require("../../Dropdown");
|
13
13
|
var _utils2 = /*#__PURE__*/require("../../utils");
|
14
14
|
var _DropdownItem = /*#__PURE__*/require("./DropdownItem.styles");
|
15
15
|
var _excluded = ["value", "label", "disabled", "isDisabled", "contentLeft", "contentRight", "dividerBefore", "dividerAfter", "className"];
|