@salutejs/plasma-new-hope 0.335.0-canary.2194.17367251959.0 → 0.335.0-canary.2196.17400757003.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Autocomplete/Autocomplete.js +4 -1
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Autocomplete/FloatingPopover.js +5 -4
- package/cjs/components/Autocomplete/FloatingPopover.js.map +1 -1
- package/cjs/components/Calendar/Calendar.tokens.js +1 -0
- package/cjs/components/Calendar/Calendar.tokens.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +15 -30
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +24 -0
- package/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js.map +1 -0
- package/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
- package/cjs/components/DatePicker/DatePicker.tokens.js.map +1 -1
- package/cjs/components/DatePicker/DatePickerBase.styles.js +1 -1
- package/cjs/components/DatePicker/DatePickerBase.styles.js.map +1 -1
- package/cjs/components/DatePicker/{DatePickerBase.styles_10sa0ht.css → DatePickerBase.styles_1fnt3hc.css} +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +4 -4
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +1 -1
- package/{es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_1n0dbxm.css → cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_160e4y4.css} +2 -2
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +2 -2
- package/cjs/components/Popup/Popup.js +8 -67
- package/cjs/components/Popup/Popup.js.map +1 -1
- package/cjs/components/Popup/ui/Draggable/Draggable.js +33 -0
- package/cjs/components/Popup/ui/Draggable/Draggable.js.map +1 -0
- package/cjs/components/Popup/ui/Resizable/Resizable.js +79 -0
- package/cjs/components/Popup/ui/Resizable/Resizable.js.map +1 -0
- package/cjs/components/Slider/ui/Handler/Handler.js +3 -3
- package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/cjs/components/Tooltip/Tooltip.js +22 -45
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/components/Tooltip/hooks/useDelayedTooltip.js +49 -0
- package/cjs/components/Tooltip/hooks/useDelayedTooltip.js.map +1 -0
- package/cjs/components/Tree/Tree.css +6 -6
- package/cjs/components/Tree/Tree.js +9 -2
- package/cjs/components/Tree/Tree.js.map +1 -1
- package/cjs/components/Tree/Tree.styles.js +1 -1
- package/cjs/components/Tree/Tree.styles.js.map +1 -1
- package/cjs/components/Tree/Tree.styles_6sla5y.css +7 -0
- package/cjs/components/Tree/Tree.tokens.js +2 -1
- package/cjs/components/Tree/Tree.tokens.js.map +1 -1
- package/cjs/index.css +10 -10
- package/emotion/cjs/components/Autocomplete/Autocomplete.js +3 -1
- package/emotion/cjs/components/Autocomplete/FloatingPopover.js +31 -4
- package/emotion/cjs/components/Calendar/Calendar.tokens.js +1 -0
- package/emotion/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +26 -44
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +25 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/index.js +4 -0
- package/emotion/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
- package/emotion/cjs/components/DatePicker/DatePickerBase.styles.js +5 -5
- package/emotion/cjs/components/Popup/Popup.js +7 -69
- package/emotion/cjs/components/Popup/ui/Draggable/Draggable.js +75 -0
- package/emotion/cjs/components/Popup/ui/Resizable/Resizable.js +114 -0
- package/emotion/cjs/components/Popup/ui/index.js +20 -0
- package/emotion/cjs/components/Tooltip/Tooltip.js +19 -41
- package/emotion/cjs/components/Tooltip/hooks/index.js +11 -0
- package/emotion/cjs/components/Tooltip/hooks/useDelayedTooltip.js +93 -0
- package/emotion/cjs/components/Tree/Tree.js +7 -2
- package/emotion/cjs/components/Tree/Tree.styles.js +13 -13
- package/emotion/cjs/components/Tree/Tree.tokens.js +2 -1
- package/emotion/cjs/examples/components/Calendar/CalendarBase.config.js +5 -5
- package/emotion/cjs/examples/components/Calendar/CalendarDouble.config.js +5 -5
- package/emotion/cjs/examples/components/Chip/Chip.config.js +13 -14
- package/emotion/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/emotion/cjs/examples/components/DatePicker/DatePicker.config.js +7 -7
- package/emotion/es/components/Autocomplete/Autocomplete.js +3 -1
- package/emotion/es/components/Autocomplete/FloatingPopover.js +31 -4
- package/emotion/es/components/Calendar/Calendar.tokens.js +1 -0
- package/emotion/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +12 -30
- package/emotion/es/components/Combobox/ComboboxNew/utils/getTextValue.js +16 -0
- package/emotion/es/components/Combobox/ComboboxNew/utils/index.js +1 -0
- package/emotion/es/components/DatePicker/DatePicker.tokens.js +1 -0
- package/emotion/es/components/DatePicker/DatePickerBase.styles.js +5 -5
- package/emotion/es/components/Popup/Popup.js +6 -63
- package/emotion/es/components/Popup/ui/Draggable/Draggable.js +19 -0
- package/emotion/es/components/Popup/ui/Resizable/Resizable.js +63 -0
- package/emotion/es/components/Popup/ui/index.js +2 -0
- package/emotion/es/components/Tooltip/Tooltip.js +20 -42
- package/emotion/es/components/Tooltip/hooks/index.js +1 -0
- package/emotion/es/components/Tooltip/hooks/useDelayedTooltip.js +83 -0
- package/emotion/es/components/Tree/Tree.js +7 -2
- package/emotion/es/components/Tree/Tree.styles.js +13 -13
- package/emotion/es/components/Tree/Tree.tokens.js +2 -1
- package/emotion/es/examples/components/Calendar/CalendarBase.config.js +5 -5
- package/emotion/es/examples/components/Calendar/CalendarDouble.config.js +5 -5
- package/emotion/es/examples/components/Chip/Chip.config.js +13 -14
- package/emotion/es/examples/components/Combobox/Combobox.js +7 -0
- package/emotion/es/examples/components/DatePicker/DatePicker.config.js +7 -7
- package/es/components/Autocomplete/Autocomplete.js +4 -1
- package/es/components/Autocomplete/Autocomplete.js.map +1 -1
- package/es/components/Autocomplete/FloatingPopover.js +6 -5
- package/es/components/Autocomplete/FloatingPopover.js.map +1 -1
- package/es/components/Calendar/Calendar.tokens.js +1 -0
- package/es/components/Calendar/Calendar.tokens.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +15 -30
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/utils/getTextValue.js +20 -0
- package/es/components/Combobox/ComboboxNew/utils/getTextValue.js.map +1 -0
- package/es/components/DatePicker/DatePicker.tokens.js +1 -0
- package/es/components/DatePicker/DatePicker.tokens.js.map +1 -1
- package/es/components/DatePicker/DatePickerBase.styles.js +1 -1
- package/es/components/DatePicker/DatePickerBase.styles.js.map +1 -1
- package/es/components/DatePicker/{DatePickerBase.styles_10sa0ht.css → DatePickerBase.styles_1fnt3hc.css} +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.css +4 -4
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +1 -1
- package/{cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_1n0dbxm.css → es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_160e4y4.css} +2 -2
- package/es/components/DatePicker/SingleDate/SingleDate.css +2 -2
- package/es/components/Popup/Popup.js +7 -65
- package/es/components/Popup/Popup.js.map +1 -1
- package/es/components/Popup/ui/Draggable/Draggable.js +24 -0
- package/es/components/Popup/ui/Draggable/Draggable.js.map +1 -0
- package/es/components/Popup/ui/Resizable/Resizable.js +71 -0
- package/es/components/Popup/ui/Resizable/Resizable.js.map +1 -0
- package/es/components/Slider/ui/Handler/Handler.js +2 -2
- package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/es/components/Tooltip/Tooltip.js +23 -46
- package/es/components/Tooltip/Tooltip.js.map +1 -1
- package/es/components/Tooltip/hooks/useDelayedTooltip.js +45 -0
- package/es/components/Tooltip/hooks/useDelayedTooltip.js.map +1 -0
- package/es/components/Tree/Tree.css +6 -6
- package/es/components/Tree/Tree.js +9 -2
- package/es/components/Tree/Tree.js.map +1 -1
- package/es/components/Tree/Tree.styles.js +1 -1
- package/es/components/Tree/Tree.styles.js.map +1 -1
- package/es/components/Tree/Tree.styles_6sla5y.css +7 -0
- package/es/components/Tree/Tree.tokens.js +2 -1
- package/es/components/Tree/Tree.tokens.js.map +1 -1
- package/es/index.css +10 -10
- package/package.json +4 -4
- package/styled-components/cjs/components/Autocomplete/Autocomplete.js +3 -1
- package/styled-components/cjs/components/Autocomplete/FloatingPopover.js +31 -4
- package/styled-components/cjs/components/Calendar/Calendar.tokens.js +1 -0
- package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +26 -44
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +25 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/index.js +4 -0
- package/styled-components/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
- package/styled-components/cjs/components/DatePicker/DatePickerBase.styles.js +3 -3
- package/styled-components/cjs/components/Popup/Popup.js +7 -69
- package/styled-components/cjs/components/Popup/ui/Draggable/Draggable.js +75 -0
- package/styled-components/cjs/components/Popup/ui/Resizable/Resizable.js +114 -0
- package/styled-components/cjs/components/Popup/ui/index.js +20 -0
- package/styled-components/cjs/components/Tooltip/Tooltip.js +18 -40
- package/styled-components/cjs/components/Tooltip/hooks/index.js +11 -0
- package/styled-components/cjs/components/Tooltip/hooks/useDelayedTooltip.js +93 -0
- package/styled-components/cjs/components/Tree/Tree.js +7 -2
- package/styled-components/cjs/components/Tree/Tree.styles.js +13 -10
- package/styled-components/cjs/components/Tree/Tree.tokens.js +2 -1
- package/styled-components/cjs/examples/components/Calendar/CalendarBase.config.js +8 -4
- package/styled-components/cjs/examples/components/Calendar/CalendarDouble.config.js +8 -4
- package/styled-components/cjs/examples/components/Chip/Chip.config.js +0 -21
- package/styled-components/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/styled-components/cjs/examples/components/DatePicker/DatePicker.config.js +8 -4
- package/styled-components/es/components/Autocomplete/Autocomplete.js +3 -1
- package/styled-components/es/components/Autocomplete/FloatingPopover.js +31 -4
- package/styled-components/es/components/Calendar/Calendar.tokens.js +1 -0
- package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +12 -30
- package/styled-components/es/components/Combobox/ComboboxNew/utils/getTextValue.js +16 -0
- package/styled-components/es/components/Combobox/ComboboxNew/utils/index.js +1 -0
- package/styled-components/es/components/DatePicker/DatePicker.tokens.js +1 -0
- package/styled-components/es/components/DatePicker/DatePickerBase.styles.js +3 -3
- package/styled-components/es/components/Popup/Popup.js +6 -63
- package/styled-components/es/components/Popup/ui/Draggable/Draggable.js +19 -0
- package/styled-components/es/components/Popup/ui/Resizable/Resizable.js +63 -0
- package/styled-components/es/components/Popup/ui/index.js +2 -0
- package/styled-components/es/components/Tooltip/Tooltip.js +19 -41
- package/styled-components/es/components/Tooltip/hooks/index.js +1 -0
- package/styled-components/es/components/Tooltip/hooks/useDelayedTooltip.js +83 -0
- package/styled-components/es/components/Tree/Tree.js +7 -2
- package/styled-components/es/components/Tree/Tree.styles.js +13 -10
- package/styled-components/es/components/Tree/Tree.tokens.js +2 -1
- package/styled-components/es/examples/components/Calendar/CalendarBase.config.js +8 -4
- package/styled-components/es/examples/components/Calendar/CalendarDouble.config.js +8 -4
- package/styled-components/es/examples/components/Chip/Chip.config.js +0 -21
- package/styled-components/es/examples/components/Combobox/Combobox.js +0 -7
- package/styled-components/es/examples/components/DatePicker/DatePicker.config.js +8 -4
- package/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/components/Autocomplete/Autocomplete.types.d.ts +6 -0
- package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
- package/types/components/Calendar/Calendar.tokens.d.ts +1 -0
- package/types/components/Calendar/Calendar.tokens.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/utils/getTextValue.d.ts +4 -0
- package/types/components/Combobox/ComboboxNew/utils/getTextValue.d.ts.map +1 -0
- package/types/components/Combobox/ComboboxNew/utils/index.d.ts +1 -0
- package/types/components/Combobox/ComboboxNew/utils/index.d.ts.map +1 -1
- package/types/components/DatePicker/DatePicker.tokens.d.ts +1 -0
- package/types/components/DatePicker/DatePicker.tokens.d.ts.map +1 -1
- package/types/components/DatePicker/DatePickerBase.styles.d.ts.map +1 -1
- package/types/components/Popup/Popup.d.ts.map +1 -1
- package/types/components/Popup/ui/Draggable/Draggable.d.ts +6 -0
- package/types/components/Popup/ui/Draggable/Draggable.d.ts.map +1 -0
- package/types/components/Popup/ui/Resizable/Resizable.d.ts +7 -0
- package/types/components/Popup/ui/Resizable/Resizable.d.ts.map +1 -0
- package/types/components/Popup/ui/index.d.ts +3 -0
- package/types/components/Popup/ui/index.d.ts.map +1 -0
- package/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/types/components/Tooltip/Tooltip.types.d.ts +31 -20
- package/types/components/Tooltip/Tooltip.types.d.ts.map +1 -1
- package/types/components/Tooltip/hooks/index.d.ts +2 -0
- package/types/components/Tooltip/hooks/index.d.ts.map +1 -0
- package/types/components/Tooltip/hooks/useDelayedTooltip.d.ts +7 -0
- package/types/components/Tooltip/hooks/useDelayedTooltip.d.ts.map +1 -0
- package/types/components/Tree/Tree.d.ts.map +1 -1
- package/types/components/Tree/Tree.styles.d.ts.map +1 -1
- package/types/components/Tree/Tree.tokens.d.ts +1 -0
- package/types/components/Tree/Tree.tokens.d.ts.map +1 -1
- package/types/components/Tree/Tree.types.d.ts +11 -4
- package/types/components/Tree/Tree.types.d.ts.map +1 -1
- package/types/examples/components/Autocomplete/Autocomplete.d.ts +8 -0
- package/types/examples/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/components/Calendar/CalendarBase.config.d.ts.map +1 -1
- package/types/examples/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
- package/types/examples/components/Chip/Chip.config.d.ts +0 -1
- package/types/examples/components/Chip/Chip.config.d.ts.map +1 -1
- package/types/examples/components/Chip/Chip.d.ts +0 -1
- package/types/examples/components/Chip/Chip.d.ts.map +1 -1
- package/types/examples/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/components/DatePicker/DatePicker.config.d.ts.map +1 -1
- package/cjs/components/Tree/Tree.styles_1w91oy6.css +0 -7
- package/es/components/Tree/Tree.styles_1w91oy6.css +0 -7
@@ -19,7 +19,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
19
|
|
20
20
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
21
21
|
|
22
|
-
var _excluded = ["value", "defaultValue", "onChange", "suggestions", "view", "size", "labelPlacement", "keepPlaceholder", "disabled", "readOnly", "label", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "onScroll", "listMaxHeight", "listWidth", "portal", "zIndex", "filter", "onSuggestionSelect", "threshold", "renderList", "renderListEnd", "renderItem", "onSearch", "hintText", "hintView", "hintSize", "beforeList", "afterList", "virtual", "_offset"];
|
22
|
+
var _excluded = ["value", "defaultValue", "onChange", "suggestions", "view", "size", "labelPlacement", "keepPlaceholder", "disabled", "readOnly", "label", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "onScroll", "listMaxHeight", "listWidth", "portal", "zIndex", "filter", "onSuggestionSelect", "threshold", "renderList", "renderListEnd", "renderItem", "onSearch", "hintText", "hintView", "hintSize", "beforeList", "afterList", "virtual", "flip", "_offset"];
|
23
23
|
|
24
24
|
/**
|
25
25
|
* Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.
|
@@ -66,6 +66,8 @@ var autocompleteRoot = function autocompleteRoot(Root) {
|
|
66
66
|
afterList = _ref.afterList,
|
67
67
|
_ref$virtual = _ref.virtual,
|
68
68
|
virtual = _ref$virtual === void 0 ? false : _ref$virtual,
|
69
|
+
_ref$flip = _ref.flip,
|
70
|
+
flip = _ref$flip === void 0 ? false : _ref$flip,
|
69
71
|
_offset = _ref._offset,
|
70
72
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
71
73
|
var _useReducer = React.useReducer(focusedReducer.focusedReducer, null),
|
@@ -148,6 +150,7 @@ var autocompleteRoot = function autocompleteRoot(Root) {
|
|
148
150
|
zIndex: zIndex,
|
149
151
|
listWidth: listWidth,
|
150
152
|
offset: _offset,
|
153
|
+
flip: flip,
|
151
154
|
target: function target(referenceRef) {
|
152
155
|
return /*#__PURE__*/React__default.default.createElement(TextField_styles.StyledTextField, _rollupPluginBabelHelpers.extends({
|
153
156
|
ref: ref,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Autocomplete.js","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useRef } from 'react';\nimport { safeUseId } from 'src/utils';\nimport { useDidMountEffect, useOutsideClick } from 'src/hooks';\nimport { RootProps } from 'src/engines';\n\nimport { FloatingPopover } from './FloatingPopover';\nimport { focusedReducer } from './reducers/focusedReducer';\nimport { SuggestionItem, StyledTextField, VirtualList } from './ui';\nimport { Ul, InfiniteLoaderWrapper, base, StyledLeftHelper, ListWrapper } from './Autocomplete.styles';\nimport type { AutocompleteProps, SuggestionItemType } from './Autocomplete.types';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\n\n/**\n * Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.\n */\nexport const autocompleteRoot = (Root: RootProps<HTMLInputElement, Omit<AutocompleteProps, 'hintText'>>) =>\n forwardRef<HTMLInputElement, AutocompleteProps>(\n (\n {\n value: outerValue,\n defaultValue,\n onChange,\n suggestions,\n view,\n size,\n labelPlacement,\n keepPlaceholder,\n disabled,\n readOnly,\n label,\n leftHelper,\n contentLeft,\n contentRight,\n textBefore,\n textAfter,\n onScroll,\n listMaxHeight = '25rem',\n listWidth,\n portal,\n zIndex,\n filter,\n onSuggestionSelect,\n threshold = 2,\n renderList,\n renderListEnd,\n renderItem,\n onSearch,\n hintText,\n hintView = 'default',\n hintSize = 'm',\n beforeList,\n afterList,\n virtual = false,\n // @ts-ignore\n _offset,\n ...rest\n },\n ref,\n ) => {\n const [focused, dispatchFocused] = useReducer(focusedReducer, null);\n const [innerValue, setInnerValue] = useState<string>(defaultValue || '');\n const [isOpen, setIsOpen] = useState(false);\n\n const listId = safeUseId();\n const value = outerValue ?? innerValue;\n\n const helperTextId = safeUseId();\n const floatingPopoverRef = useRef<HTMLDivElement>(null);\n\n const targetRef = useOutsideClick<HTMLUListElement>(() => {\n setIsOpen(false);\n }, floatingPopoverRef);\n\n const handleFocus = () => {\n if (value.toString().length >= threshold) {\n setIsOpen(true);\n }\n };\n\n const handleItemClick = (e: SuggestionItemType) => {\n setInnerValue(e.label);\n\n if (onSuggestionSelect) {\n onSuggestionSelect(e);\n }\n\n setIsOpen(false);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = e.target.value;\n\n setInnerValue(currentValue);\n\n if (onChange) {\n onChange(e);\n }\n\n if (currentValue.toString().length >= threshold) {\n setIsOpen(true);\n } else {\n setIsOpen(false);\n }\n };\n\n const defaultFilterCallback = ({ label }: { label: string }) => {\n return label.toLowerCase().includes(value.toString().toLowerCase());\n };\n\n const helperTextStopPropagation = (event: React.MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n const finalResults = suggestions?.filter(filter || defaultFilterCallback) || [];\n\n const { onKeyDown } = useKeyNavigation({\n isOpen,\n setIsOpen,\n focused,\n dispatchFocused,\n finalResults,\n handleItemClick,\n });\n\n useDidMountEffect(() => {\n dispatchFocused({ type: 'reset' });\n }, [value]);\n\n return (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n hintView={hintView}\n hintSize={hintSize}\n >\n <FloatingPopover\n ref={floatingPopoverRef}\n opened={isOpen}\n portal={portal}\n zIndex={zIndex}\n listWidth={listWidth}\n offset={_offset}\n target={(referenceRef) => (\n <StyledTextField\n ref={ref}\n inputWrapperRef={referenceRef}\n value={value}\n onChange={handleChange}\n onSearch={focused === null ? onSearch : undefined}\n size={size}\n view={view}\n disabled={disabled}\n readOnly={readOnly}\n label={label}\n contentLeft={contentLeft}\n contentRight={contentRight}\n textBefore={textBefore}\n textAfter={textAfter}\n onFocus={handleFocus}\n onKeyDown={onKeyDown}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-controls={listId}\n aria-expanded={isOpen}\n aria-activedescendant={`${listId}/${focused}`}\n aria-describedby={helperTextId}\n hintText={String(hintText || '')}\n labelPlacement={labelPlacement}\n keepPlaceholder={keepPlaceholder}\n leftHelper={\n leftHelper && (\n <StyledLeftHelper onClick={helperTextStopPropagation}>\n {leftHelper}\n </StyledLeftHelper>\n )\n }\n {...rest}\n />\n )}\n >\n {(renderList && renderList(finalResults)) ||\n (Boolean(finalResults.length) && (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n >\n <ListWrapper>\n <Ul\n ref={targetRef}\n id={listId}\n role=\"listbox\"\n aria-label={label}\n onScroll={virtual ? undefined : onScroll}\n listMaxHeight={listMaxHeight}\n virtual={virtual}\n >\n {virtual ? (\n <VirtualList\n items={finalResults}\n onClick={handleItemClick}\n listId={listId}\n listMaxHeight={listMaxHeight}\n onScroll={onScroll}\n renderItem={renderItem}\n />\n ) : (\n <>\n {beforeList}\n\n {finalResults.map((suggestion, index) => (\n <SuggestionItem\n key={index}\n item={suggestion}\n onClick={handleItemClick}\n id={`${listId}/${index}`}\n focused={focused === index}\n renderItem={renderItem}\n />\n ))}\n\n {afterList}\n </>\n )}\n\n {renderListEnd && (\n <InfiniteLoaderWrapper>{renderListEnd()}</InfiniteLoaderWrapper>\n )}\n </Ul>\n </ListWrapper>\n </Root>\n ))}\n </FloatingPopover>\n </Root>\n );\n },\n );\n\nexport const autocompleteConfig = {\n name: 'Autocomplete',\n tag: 'div',\n layout: autocompleteRoot,\n base,\n defaults: {\n view: 'default',\n size: 'l',\n labelPlacement: 'outer',\n },\n variations: {\n view: {\n css: '',\n },\n },\n};\n"],"names":["autocompleteRoot","Root","forwardRef","_ref","ref","_StyledLeftHelper","outerValue","value","defaultValue","onChange","suggestions","view","size","labelPlacement","keepPlaceholder","disabled","readOnly","label","leftHelper","contentLeft","contentRight","textBefore","textAfter","onScroll","_ref$listMaxHeight","listMaxHeight","listWidth","portal","zIndex","filter","onSuggestionSelect","_ref$threshold","threshold","renderList","renderListEnd","renderItem","onSearch","hintText","_ref$hintView","hintView","_ref$hintSize","hintSize","beforeList","afterList","_ref$virtual","virtual","_offset","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","focusedReducer","_useReducer2","_slicedToArray","focused","dispatchFocused","_useState","useState","_useState2","innerValue","setInnerValue","_useState3","_useState4","isOpen","setIsOpen","listId","safeUseId","helperTextId","floatingPopoverRef","useRef","targetRef","useOutsideClick","handleFocus","toString","length","handleItemClick","e","handleChange","currentValue","target","defaultFilterCallback","_ref2","toLowerCase","includes","helperTextStopPropagation","event","stopPropagation","finalResults","_useKeyNavigation","useKeyNavigation","onKeyDown","useDidMountEffect","type","React","createElement","FloatingPopover","opened","offset","referenceRef","StyledTextField","_extends","inputWrapperRef","undefined","onFocus","role","concat","String","StyledLeftHelper","onClick","Boolean","ListWrapper","Ul","id","VirtualList","items","Fragment","map","suggestion","index","SuggestionItem","key","item","InfiniteLoaderWrapper","autocompleteConfig","name","tag","layout","base","defaults","variations","css"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAsE,EAAA;AAAA,EAAA,oBACnGC,gBAAU,CACN,UAAAC,IAAA,EAwCIC,GAAG,EACF;AAAA,IAAA,IAAAC,iBAAA,CAAA;AAAA,IAAA,IAvCUC,UAAU,GAAAH,IAAA,CAAjBI,KAAK;MACLC,YAAY,GAAAL,IAAA,CAAZK,YAAY;MACZC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MACRC,WAAW,GAAAP,IAAA,CAAXO,WAAW;MACXC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,IAAI,GAAAT,IAAA,CAAJS,IAAI;MACJC,cAAc,GAAAV,IAAA,CAAdU,cAAc;MACdC,eAAe,GAAAX,IAAA,CAAfW,eAAe;MACfC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;MACRC,QAAQ,GAAAb,IAAA,CAARa,QAAQ;MACRC,KAAK,GAAAd,IAAA,CAALc,KAAK;MACLC,UAAU,GAAAf,IAAA,CAAVe,UAAU;MACVC,WAAW,GAAAhB,IAAA,CAAXgB,WAAW;MACXC,YAAY,GAAAjB,IAAA,CAAZiB,YAAY;MACZC,UAAU,GAAAlB,IAAA,CAAVkB,UAAU;MACVC,SAAS,GAAAnB,IAAA,CAATmB,SAAS;MACTC,QAAQ,GAAApB,IAAA,CAARoB,QAAQ;MAAAC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aAAA,CAACyB,6BAAc,EAAA;AACXC,QAAAA,GAAG,EAAEF,KAAM;AACXG,QAAAA,IAAI,EAAEJ,UAAW;AACjBT,QAAAA,OAAO,EAAEjC,eAAgB;QACzBqC,EAAE,EAAA,EAAA,CAAAP,MAAA,CAAKxC,MAAM,OAAAwC,MAAA,CAAIa,KAAK,CAAG;QACzBhE,OAAO,EAAEA,OAAO,KAAKgE,KAAM;AAC3BpF,QAAAA,UAAU,EAAEA,UAAAA;AAAW,OAC1B,CAAC,CAAA;KACL,CAAC,EAEDQ,SACH,CACL,EAEAT,aAAa,iBACV4D,sBAAA,CAAAC,aAAA,CAAC4B,yCAAqB,EAAA,IAAA,EAAEzF,aAAa,EAA0B,CAEnE,CACK,CACX,CAED,CACf,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM0F,kBAAkB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE/H,gBAAgB;AACxBgI,EAAAA,IAAI,EAAJA,wBAAI;AACJC,EAAAA,QAAQ,EAAE;AACNtH,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAG;AACTC,IAAAA,cAAc,EAAE,OAAA;GACnB;AACDqH,EAAAA,UAAU,EAAE;AACRvH,IAAAA,IAAI,EAAE;AACFwH,MAAAA,GAAG,EAAE,EAAA;AACT,KAAA;AACJ,GAAA;AACJ;;;;;"}
|
1
|
+
{"version":3,"file":"Autocomplete.js","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useRef } from 'react';\nimport { safeUseId } from 'src/utils';\nimport { useDidMountEffect, useOutsideClick } from 'src/hooks';\nimport { RootProps } from 'src/engines';\n\nimport { FloatingPopover } from './FloatingPopover';\nimport { focusedReducer } from './reducers/focusedReducer';\nimport { SuggestionItem, StyledTextField, VirtualList } from './ui';\nimport { Ul, InfiniteLoaderWrapper, base, StyledLeftHelper, ListWrapper } from './Autocomplete.styles';\nimport type { AutocompleteProps, SuggestionItemType } from './Autocomplete.types';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\n\n/**\n * Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.\n */\nexport const autocompleteRoot = (Root: RootProps<HTMLInputElement, Omit<AutocompleteProps, 'hintText'>>) =>\n forwardRef<HTMLInputElement, AutocompleteProps>(\n (\n {\n value: outerValue,\n defaultValue,\n onChange,\n suggestions,\n view,\n size,\n labelPlacement,\n keepPlaceholder,\n disabled,\n readOnly,\n label,\n leftHelper,\n contentLeft,\n contentRight,\n textBefore,\n textAfter,\n onScroll,\n listMaxHeight = '25rem',\n listWidth,\n portal,\n zIndex,\n filter,\n onSuggestionSelect,\n threshold = 2,\n renderList,\n renderListEnd,\n renderItem,\n onSearch,\n hintText,\n hintView = 'default',\n hintSize = 'm',\n beforeList,\n afterList,\n virtual = false,\n flip = false,\n // @ts-ignore\n _offset,\n ...rest\n },\n ref,\n ) => {\n const [focused, dispatchFocused] = useReducer(focusedReducer, null);\n const [innerValue, setInnerValue] = useState<string>(defaultValue || '');\n const [isOpen, setIsOpen] = useState(false);\n\n const listId = safeUseId();\n const value = outerValue ?? innerValue;\n\n const helperTextId = safeUseId();\n const floatingPopoverRef = useRef<HTMLDivElement>(null);\n\n const targetRef = useOutsideClick<HTMLUListElement>(() => {\n setIsOpen(false);\n }, floatingPopoverRef);\n\n const handleFocus = () => {\n if (value.toString().length >= threshold) {\n setIsOpen(true);\n }\n };\n\n const handleItemClick = (e: SuggestionItemType) => {\n setInnerValue(e.label);\n\n if (onSuggestionSelect) {\n onSuggestionSelect(e);\n }\n\n setIsOpen(false);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = e.target.value;\n\n setInnerValue(currentValue);\n\n if (onChange) {\n onChange(e);\n }\n\n if (currentValue.toString().length >= threshold) {\n setIsOpen(true);\n } else {\n setIsOpen(false);\n }\n };\n\n const defaultFilterCallback = ({ label }: { label: string }) => {\n return label.toLowerCase().includes(value.toString().toLowerCase());\n };\n\n const helperTextStopPropagation = (event: React.MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n const finalResults = suggestions?.filter(filter || defaultFilterCallback) || [];\n\n const { onKeyDown } = useKeyNavigation({\n isOpen,\n setIsOpen,\n focused,\n dispatchFocused,\n finalResults,\n handleItemClick,\n });\n\n useDidMountEffect(() => {\n dispatchFocused({ type: 'reset' });\n }, [value]);\n\n return (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n hintView={hintView}\n hintSize={hintSize}\n >\n <FloatingPopover\n ref={floatingPopoverRef}\n opened={isOpen}\n portal={portal}\n zIndex={zIndex}\n listWidth={listWidth}\n offset={_offset}\n flip={flip}\n target={(referenceRef) => (\n <StyledTextField\n ref={ref}\n inputWrapperRef={referenceRef}\n value={value}\n onChange={handleChange}\n onSearch={focused === null ? onSearch : undefined}\n size={size}\n view={view}\n disabled={disabled}\n readOnly={readOnly}\n label={label}\n contentLeft={contentLeft}\n contentRight={contentRight}\n textBefore={textBefore}\n textAfter={textAfter}\n onFocus={handleFocus}\n onKeyDown={onKeyDown}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-controls={listId}\n aria-expanded={isOpen}\n aria-activedescendant={`${listId}/${focused}`}\n aria-describedby={helperTextId}\n hintText={String(hintText || '')}\n labelPlacement={labelPlacement}\n keepPlaceholder={keepPlaceholder}\n leftHelper={\n leftHelper && (\n <StyledLeftHelper onClick={helperTextStopPropagation}>\n {leftHelper}\n </StyledLeftHelper>\n )\n }\n {...rest}\n />\n )}\n >\n {(renderList && renderList(finalResults)) ||\n (Boolean(finalResults.length) && (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n >\n <ListWrapper>\n <Ul\n ref={targetRef}\n id={listId}\n role=\"listbox\"\n aria-label={label}\n onScroll={virtual ? undefined : onScroll}\n listMaxHeight={listMaxHeight}\n virtual={virtual}\n >\n {virtual ? (\n <VirtualList\n items={finalResults}\n onClick={handleItemClick}\n listId={listId}\n listMaxHeight={listMaxHeight}\n onScroll={onScroll}\n renderItem={renderItem}\n />\n ) : (\n <>\n {beforeList}\n\n {finalResults.map((suggestion, index) => (\n <SuggestionItem\n key={index}\n item={suggestion}\n onClick={handleItemClick}\n id={`${listId}/${index}`}\n focused={focused === index}\n renderItem={renderItem}\n />\n ))}\n\n {afterList}\n </>\n )}\n\n {renderListEnd && (\n <InfiniteLoaderWrapper>{renderListEnd()}</InfiniteLoaderWrapper>\n )}\n </Ul>\n </ListWrapper>\n </Root>\n ))}\n </FloatingPopover>\n </Root>\n );\n },\n );\n\nexport const autocompleteConfig = {\n name: 'Autocomplete',\n tag: 'div',\n layout: autocompleteRoot,\n base,\n defaults: {\n view: 'default',\n size: 'l',\n labelPlacement: 'outer',\n },\n variations: {\n view: {\n css: '',\n },\n },\n};\n"],"names":["autocompleteRoot","Root","forwardRef","_ref","ref","_StyledLeftHelper","outerValue","value","defaultValue","onChange","suggestions","view","size","labelPlacement","keepPlaceholder","disabled","readOnly","label","leftHelper","contentLeft","contentRight","textBefore","textAfter","onScroll","_ref$listMaxHeight","listMaxHeight","listWidth","portal","zIndex","filter","onSuggestionSelect","_ref$threshold","threshold","renderList","renderListEnd","renderItem","onSearch","hintText","_ref$hintView","hintView","_ref$hintSize","hintSize","beforeList","afterList","_ref$virtual","virtual","_ref$flip","flip","_offset","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","focusedReducer","_useReducer2","_slicedToArray","focused","dispatchFocused","_useState","useState","_useState2","innerValue","setInnerValue","_useState3","_useState4","isOpen","setIsOpen","listId","safeUseId","helperTextId","floatingPopoverRef","useRef","targetRef","useOutsideClick","handleFocus","toString","length","handleItemClick","e","handleChange","currentValue","target","defaultFilterCallback","_ref2","toLowerCase","includes","helperTextStopPropagation","event","stopPropagation","finalResults","_useKeyNavigation","useKeyNavigation","onKeyDown","useDidMountEffect","type","React","createElement","FloatingPopover","opened","offset","referenceRef","StyledTextField","_extends","inputWrapperRef","undefined","onFocus","role","concat","String","StyledLeftHelper","onClick","Boolean","ListWrapper","Ul","id","VirtualList","items","Fragment","map","suggestion","index","SuggestionItem","key","item","InfiniteLoaderWrapper","autocompleteConfig","name","tag","layout","base","defaults","variations","css"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAsE,EAAA;AAAA,EAAA,oBACnGC,gBAAU,CACN,UAAAC,IAAA,EAyCIC,GAAG,EACF;AAAA,IAAA,IAAAC,iBAAA,CAAA;AAAA,IAAA,IAxCUC,UAAU,GAAAH,IAAA,CAAjBI,KAAK;MACLC,YAAY,GAAAL,IAAA,CAAZK,YAAY;MACZC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MACRC,WAAW,GAAAP,IAAA,CAAXO,WAAW;MACXC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,IAAI,GAAAT,IAAA,CAAJS,IAAI;MACJC,cAAc,GAAAV,IAAA,CAAdU,cAAc;MACdC,eAAe,GAAAX,IAAA,CAAfW,eAAe;MACfC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;MACRC,QAAQ,GAAAb,IAAA,CAARa,QAAQ;MACRC,KAAK,GAAAd,IAAA,CAALc,KAAK;MACLC,UAAU,GAAAf,IAAA,CAAVe,UAAU;MACVC,WAAW,GAAAhB,IAAA,CAAXgB,WAAW;MACXC,YAAY,GAAAjB,IAAA,CAAZiB,YAAY;MACZC,UAAU,GAAAlB,IAAA,CAAVkB,UAAU;MACVC,SAAS,GAAAnB,IAAA,CAATmB,SAAS;MACTC,QAAQ,GAAApB,IAAA,CAARoB,QAAQ;MAAAC,kBAAA,GAAArB,IAAA,CACRsB,aAAa;AAAbA,MAAAA,aAAa,GAAAD,kBAAA,K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AAG,CAAC,UAACC,UAAU,EAAEC,KAAK,EAAA;AAAA,MAAA,oBAChCzB,sBAAA,CAAAC,aAAA,CAACyB,6BAAc,EAAA;AACXC,QAAAA,GAAG,EAAEF,KAAM;AACXG,QAAAA,IAAI,EAAEJ,UAAW;AACjBT,QAAAA,OAAO,EAAEjC,eAAgB;QACzBqC,EAAE,EAAA,EAAA,CAAAP,MAAA,CAAKxC,MAAM,OAAAwC,MAAA,CAAIa,KAAK,CAAG;QACzBhE,OAAO,EAAEA,OAAO,KAAKgE,KAAM;AAC3BtF,QAAAA,UAAU,EAAEA,UAAAA;AAAW,OAC1B,CAAC,CAAA;KACL,CAAC,EAEDQ,SACH,CACL,EAEAT,aAAa,iBACV8D,sBAAA,CAAAC,aAAA,CAAC4B,yCAAqB,EAAA,IAAA,EAAE3F,aAAa,EAA0B,CAEnE,CACK,CACX,CAED,CACf,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM4F,kBAAkB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEjI,gBAAgB;AACxBkI,EAAAA,IAAI,EAAJA,wBAAI;AACJC,EAAAA,QAAQ,EAAE;AACNxH,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAG;AACTC,IAAAA,cAAc,EAAE,OAAA;GACnB;AACDuH,EAAAA,UAAU,EAAE;AACRzH,IAAAA,IAAI,EAAE;AACF0H,MAAAA,GAAG,EAAE,EAAA;AACT,KAAA;AACJ,GAAA;AACJ;;;;;"}
|
@@ -18,7 +18,8 @@ var FloatingPopover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
18
18
|
portal = _ref.portal,
|
19
19
|
zIndex = _ref.zIndex,
|
20
20
|
listWidth = _ref.listWidth,
|
21
|
-
offset = _ref.offset
|
21
|
+
offset = _ref.offset,
|
22
|
+
flipFlag = _ref.flip;
|
22
23
|
var _useFloating = react.useFloating({
|
23
24
|
whileElementsMounted: function whileElementsMounted(referenceEl, floatingEl, update) {
|
24
25
|
return react.autoUpdate(referenceEl, floatingEl, update, {
|
@@ -32,9 +33,9 @@ var FloatingPopover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
32
33
|
middleware: [react.offset({
|
33
34
|
mainAxis: (offset === null || offset === void 0 ? void 0 : offset[1]) || 0,
|
34
35
|
alignmentAxis: (offset === null || offset === void 0 ? void 0 : offset[0]) || 0
|
35
|
-
})
|
36
|
+
})].concat(_rollupPluginBabelHelpers.toConsumableArray(flipFlag ? [react.flip({
|
36
37
|
fallbackAxisSideDirection: 'end'
|
37
|
-
}), react.shift(), react.size({
|
38
|
+
})] : []), [react.shift(), react.size({
|
38
39
|
apply: function apply(_ref2) {
|
39
40
|
var rects = _ref2.rects,
|
40
41
|
elements = _ref2.elements;
|
@@ -42,7 +43,7 @@ var FloatingPopover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
42
43
|
width: listWidth || "".concat(rects.reference.width, "px")
|
43
44
|
});
|
44
45
|
}
|
45
|
-
})]
|
46
|
+
})])
|
46
47
|
}),
|
47
48
|
refs = _useFloating.refs,
|
48
49
|
floatingStyles = _useFloating.floatingStyles;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FloatingPopover.js","sources":["../../../src/components/Autocomplete/FloatingPopover.tsx"],"sourcesContent":["import {\n flip,\n shift,\n size,\n useFloating,\n FloatingPortal,\n autoUpdate,\n offset as offsetMiddleware,\n} from '@floating-ui/react';\nimport React, { forwardRef } from 'react';\nimport { safeUseId } from 'src/utils';\n\nimport type { FloatingPopoverProps } from './Autocomplete.types';\n\nconst FloatingPopover = forwardRef<HTMLDivElement, FloatingPopoverProps>(\n ({ target, children, opened, portal, zIndex, listWidth, offset }, ref) => {\n const { refs, floatingStyles } = useFloating({\n whileElementsMounted(referenceEl, floatingEl, update) {\n return autoUpdate(referenceEl, floatingEl, update, {\n ancestorScroll: false,\n ancestorResize: false,\n layoutShift: false,\n });\n },\n placement: 'bottom-start',\n open: opened,\n middleware: [\n offsetMiddleware({\n mainAxis: offset?.[1] || 0,\n alignmentAxis: offset?.[0] || 0,\n }),\n flip({ fallbackAxisSideDirection: 'end' }),\n shift(),\n size({\n apply({ rects, elements }) {\n Object.assign(elements.floating.style, {\n width: listWidth || `${rects.reference.width}px`,\n });\n },\n }),\n ],\n });\n\n const wrappedId = safeUseId();\n\n // Проверка на target. Это может быть как ReactNode, так и функция, в которую пробрасывается ref.\n // Это нужно для более тонкой настройки reference-элемента, вокруг которого и будет позиционироваться выпадашка.\n // Пример: когда в Textfield под инпутом находится helperText (или еще что-либо),\n // но выпадающий список должен позиционироваться непосредственно возле самого инпута.\n const isTargetAsFunction = typeof target === 'function';\n\n return (\n <div ref={ref} id={wrappedId} style={{ position: 'relative' }}>\n <div ref={isTargetAsFunction ? undefined : refs.setReference}>\n {typeof target === 'function' ? target(refs.setReference as any) : target}\n </div>\n\n {opened && (\n // root - принимает ref контейнера портала.\n // id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\n <FloatingPortal {...getFloatingPortalProps(portal, wrappedId)}>\n <div ref={refs.setFloating} style={{ ...floatingStyles, zIndex: zIndex || 1000 }}>\n {children}\n </div>\n </FloatingPortal>\n )}\n </div>\n );\n },\n);\n\ntype FloatingPortalReturnedProps = {\n root?: React.RefObject<HTMLElement>;\n id?: string;\n};\n\n// root - принимает ref контейнера портала.\n// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\nconst getFloatingPortalProps = (\n portal: FloatingPopoverProps['portal'],\n wrappedId: string,\n): FloatingPortalReturnedProps => {\n if (!portal) {\n return { id: wrappedId };\n }\n\n if (typeof portal === 'string') {\n return { id: portal };\n }\n\n return { root: portal };\n};\n\nexport { FloatingPopover };\n"],"names":["FloatingPopover","forwardRef","_ref","ref","target","children","opened","portal","zIndex","listWidth","offset","_useFloating","useFloating","whileElementsMounted","referenceEl","floatingEl","update","autoUpdate","ancestorScroll","ancestorResize","layoutShift","placement","open","middleware","offsetMiddleware","mainAxis","alignmentAxis","
|
1
|
+
{"version":3,"file":"FloatingPopover.js","sources":["../../../src/components/Autocomplete/FloatingPopover.tsx"],"sourcesContent":["import {\n flip,\n shift,\n size,\n useFloating,\n FloatingPortal,\n autoUpdate,\n offset as offsetMiddleware,\n} from '@floating-ui/react';\nimport React, { forwardRef } from 'react';\nimport { safeUseId } from 'src/utils';\n\nimport type { FloatingPopoverProps } from './Autocomplete.types';\n\nconst FloatingPopover = forwardRef<HTMLDivElement, FloatingPopoverProps>(\n ({ target, children, opened, portal, zIndex, listWidth, offset, flip: flipFlag }, ref) => {\n const { refs, floatingStyles } = useFloating({\n whileElementsMounted(referenceEl, floatingEl, update) {\n return autoUpdate(referenceEl, floatingEl, update, {\n ancestorScroll: false,\n ancestorResize: false,\n layoutShift: false,\n });\n },\n placement: 'bottom-start',\n open: opened,\n middleware: [\n offsetMiddleware({\n mainAxis: offset?.[1] || 0,\n alignmentAxis: offset?.[0] || 0,\n }),\n ...(flipFlag ? [flip({ fallbackAxisSideDirection: 'end' })] : []),\n shift(),\n size({\n apply({ rects, elements }) {\n Object.assign(elements.floating.style, {\n width: listWidth || `${rects.reference.width}px`,\n });\n },\n }),\n ],\n });\n\n const wrappedId = safeUseId();\n\n // Проверка на target. Это может быть как ReactNode, так и функция, в которую пробрасывается ref.\n // Это нужно для более тонкой настройки reference-элемента, вокруг которого и будет позиционироваться выпадашка.\n // Пример: когда в Textfield под инпутом находится helperText (или еще что-либо),\n // но выпадающий список должен позиционироваться непосредственно возле самого инпута.\n const isTargetAsFunction = typeof target === 'function';\n\n return (\n <div ref={ref} id={wrappedId} style={{ position: 'relative' }}>\n <div ref={isTargetAsFunction ? undefined : refs.setReference}>\n {typeof target === 'function' ? target(refs.setReference as any) : target}\n </div>\n\n {opened && (\n // root - принимает ref контейнера портала.\n // id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\n <FloatingPortal {...getFloatingPortalProps(portal, wrappedId)}>\n <div ref={refs.setFloating} style={{ ...floatingStyles, zIndex: zIndex || 1000 }}>\n {children}\n </div>\n </FloatingPortal>\n )}\n </div>\n );\n },\n);\n\ntype FloatingPortalReturnedProps = {\n root?: React.RefObject<HTMLElement>;\n id?: string;\n};\n\n// root - принимает ref контейнера портала.\n// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\nconst getFloatingPortalProps = (\n portal: FloatingPopoverProps['portal'],\n wrappedId: string,\n): FloatingPortalReturnedProps => {\n if (!portal) {\n return { id: wrappedId };\n }\n\n if (typeof portal === 'string') {\n return { id: portal };\n }\n\n return { root: portal };\n};\n\nexport { FloatingPopover };\n"],"names":["FloatingPopover","forwardRef","_ref","ref","target","children","opened","portal","zIndex","listWidth","offset","flipFlag","flip","_useFloating","useFloating","whileElementsMounted","referenceEl","floatingEl","update","autoUpdate","ancestorScroll","ancestorResize","layoutShift","placement","open","middleware","offsetMiddleware","mainAxis","alignmentAxis","concat","_toConsumableArray","fallbackAxisSideDirection","shift","size","apply","_ref2","rects","elements","Object","assign","floating","style","width","reference","refs","floatingStyles","wrappedId","safeUseId","isTargetAsFunction","React","createElement","id","position","undefined","setReference","FloatingPortal","getFloatingPortalProps","setFloating","_objectSpread","root"],"mappings":";;;;;;;;;;;;;AAcMA,IAAAA,eAAe,gBAAGC,gBAAU,CAC9B,UAAAC,IAAA,EAAkFC,GAAG,EAAK;AAAA,EAAA,IAAvFC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IAAEC,MAAM,GAAAL,IAAA,CAANK,MAAM;IAAEC,MAAM,GAAAN,IAAA,CAANM,MAAM;IAAEC,SAAS,GAAAP,IAAA,CAATO,SAAS;IAAEC,MAAM,GAAAR,IAAA,CAANQ,MAAM;IAAQC,QAAQ,GAAAT,IAAA,CAAdU,IAAI,CAAA;EAChE,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EACa;EAC9B,IAAI,CAACvC,MAAM,EAAE;IACT,OAAO;AAAE4C,MAAAA,EAAE,EAAEL,SAAAA;KAAW,CAAA;AAC5B,GAAA;AAEA,EAAA,IAAI,OAAOvC,MAAM,KAAK,QAAQ,EAAE;IAC5B,OAAO;AAAE4C,MAAAA,EAAE,EAAE5C,MAAAA;KAAQ,CAAA;AACzB,GAAA;EAEA,OAAO;AAAEoD,IAAAA,IAAI,EAAEpD,MAAAA;GAAQ,CAAA;AAC3B,CAAC;;;;"}
|
@@ -80,6 +80,7 @@ var tokens = {
|
|
80
80
|
calendarHeaderWrapperPadding: '--plasma-calendar-header-wrapper-padding',
|
81
81
|
calendarHeaderArrowGap: '--plasma-calendar-arrow-container-gap',
|
82
82
|
calendarHeaderArrowPadding: '--plasma-calendar-arrow-container-padding',
|
83
|
+
calendarArrowHeaderCustomSize: '--plasma-calendar-arrow-custom-size',
|
83
84
|
calendarHeaderPadding: '--plasma-calendar-header-padding',
|
84
85
|
calendarHeaderDateGap: '--plasma-calendar-header-date-gap',
|
85
86
|
calendarHeaderFontFamily: '--plasma-calendar-header-font-family',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Calendar.tokens.js","sources":["../../../src/components/Calendar/Calendar.tokens.ts"],"sourcesContent":["export const classes = {\n dayOfWeek: 'day-of-week',\n dayInCurrentMonth: 'day-in-current-month',\n disabled: 'item-disabled',\n disabledCurrent: 'item-disabled-current',\n sideInRange: 'item-side-in-range',\n inRange: 'item-in-range',\n sideLeft: 'item-side-left',\n sideRight: 'item-side-right',\n selectableItem: 'item-selectable',\n selectedItem: 'item-selected',\n currentItem: 'item-current',\n hoveredItem: 'item-hovered',\n doubleHeaderDate: 'double-header-date',\n doubleHeaderLastDateWrapper: 'double-header--last-date-wrapper',\n disabledPrevButton: 'disabled-prev-button',\n stretched: 'plasma-calendar-stretched',\n};\n\nexport const innerTokens = {\n dateStructureFontFamily: '--plasma-calendar-date-structure-font-family',\n dateStructureFontSize: '--plasma-calendar-date-structure-font-size',\n dateStructureFontStyle: '--plasma-calendar-date-structure-font-style',\n dateStructureFontWeight: '--plasma-calendar-date-structure-font-weight',\n dateStructureFontLetterSpacing: '--plasma-calendar-date-structure-font-letter-spacing',\n dateStructureFontLineHeight: '--plasma-calendar-date-structure-line-height',\n\n dateStructureSelectedFontWeight: '--plasma-calendar-date-structure-selected-font-weight',\n\n dateStructureBorderRadius: '--plasma-calendar-date-structure-border-radius',\n};\n\nexport const tokens = {\n calendarContainerWidth: '--plasma-calendar-container-width',\n calendarContainerHeight: '--plasma-calendar-container-height',\n calendarBorderWidth: '--plasma-calendar-border-width',\n calendarBorderColor: '--plasma-calendar-border-color',\n\n /* Токены размера сетки лет */\n calendarYearsPadding: '--plasma-calendar-years-padding',\n calendarYearItemBorderRadius: '--plasma-calendar-year-item-border-radius',\n\n calendarYearFontFamily: '--plasma-calendar-year-font-family',\n calendarYearFontSize: '--plasma-calendar-year-font-size',\n calendarYearFontStyle: '--plasma-calendar-year-font-style',\n calendarYearFontLetterSpacing: '--plasma-calendar-year-font-letter-spacing',\n calendarYearFontLineHeight: '--plasma-calendar-year-line-height',\n calendarYearFontWeight: '--plasma-calendar-year-font-weight',\n calendarYearSelectedFontWeight: '--plasma-calendar-year-selected-font-weight',\n\n /* Токены размера сетки дней */\n calendarQuartersPadding: '--plasma-calendar-quarters-padding',\n calendarQuarterItemBorderRadius: '--plasma-calendar-quarter-item-border-radius',\n\n calendarQuarterFontFamily: '--plasma-calendar-quarter-font-family',\n calendarQuarterFontSize: '--plasma-calendar-quarter-font-size',\n calendarQuarterFontStyle: '--plasma-calendar-quarter-font-style',\n calendarQuarterFontLetterSpacing: '--plasma-calendar-quarter-font-letter-spacing',\n calendarQuarterFontLineHeight: '--plasma-calendar-quarter-line-height',\n calendarQuarterFontWeight: '--plasma-calendar-quarter-font-weight',\n calendarQuarterSelectedFontWeight: '--plasma-calendar-quarter-selected-font-weight',\n\n /* Токены размера сетки месяцев */\n calendarMonthsPadding: '--plasma-calendar-months-padding',\n calendarMonthItemBorderRadius: '--plasma-calendar-month-item-border-radius',\n\n calendarMonthFontFamily: '--plasma-calendar-month-font-family',\n calendarMonthFontSize: '--plasma-calendar-month-font-size',\n calendarMonthFontStyle: '--plasma-calendar-month-font-style',\n calendarMonthFontLetterSpacing: '--plasma-calendar-month-font-letter-spacing',\n calendarMonthFontLineHeight: '--plasma-calendar-month-line-height',\n calendarMonthFontWeight: '--plasma-calendar-month-font-weight',\n calendarMonthSelectedFontWeight: '--plasma-calendar-month-selected-font-weight',\n\n /* Токены размера сетки дней */\n calendarDaysPadding: '--plasma-calendar-days-padding',\n calendarDayItemBorderRadius: '--plasma-calendar-day-item-border-radius',\n\n calendarDayFontFamily: '--plasma-calendar-day-font-family',\n calendarDayFontSize: '--plasma-calendar-day-font-size',\n calendarDayFontStyle: '--plasma-calendar-day-font-style',\n calendarDayFontLetterSpacing: '--plasma-calendar-day-font-letter-spacing',\n calendarDayFontLineHeight: '--plasma-calendar-day-line-height',\n calendarDayFontWeight: '--plasma-calendar-day-font-weight',\n calendarDaySelectedFontWeight: '--plasma-calendar-day-selected-font-weight',\n\n calendarDayOfWeekColor: '--plasma-calendar-day-of-the-week-color',\n\n /* Токены шапки календаря */\n calendarHeaderWrapperPadding: '--plasma-calendar-header-wrapper-padding',\n calendarHeaderArrowGap: '--plasma-calendar-arrow-container-gap',\n calendarHeaderArrowPadding: '--plasma-calendar-arrow-container-padding',\n\n calendarHeaderPadding: '--plasma-calendar-header-padding',\n calendarHeaderDateGap: '--plasma-calendar-header-date-gap',\n\n calendarHeaderFontFamily: '--plasma-calendar-header-font-family',\n calendarHeaderFontSize: '--plasma-calendar-header-font-size',\n calendarHeaderFontStyle: '--plasma-calendar-header-font-style',\n calendarHeaderFontLetterSpacing: '--plasma-calendar-header-font-letter-spacing',\n calendarHeaderFontLineHeight: '--plasma-calendar-header-line-height',\n calendarHeaderFontWeight: '--plasma-calendar-header-font-weight',\n calendarHeaderFontWeightBold: '--plasma-calendar-header-font-weight-bold',\n calendarHeaderArrowColor: '--plasma-calendar-header-arrow-color',\n\n /* Токены стрелок навигации календаря */\n iconButtonColor: '--plasma-calendar-icon-button-color',\n iconButtonBackgroundColor: '--plasma-calendar-icon-button-background',\n iconButtonColorHover: '--plasma-calendar-icon-button-color-hover',\n iconButtonBackgroundColorHover: '--plasma-calendar-icon-button-background-hover',\n iconButtonColorActive: '--plasma-calendar-icon-button-color-active',\n iconButtonBackgroundColorActive: '--plasma-calendar-icon-button-background-active',\n iconButtonHeight: '--plasma-calendar-icon-button-height',\n iconButtonWidth: '--plasma-calendar-icon-button-width',\n iconButtonPadding: '--plasma-calendar-icon-button-padding',\n iconButtonRadius: '--plasma-calendar-icon-button-radius',\n iconButtonFocusColor: '--plasma-calendar-icon-button-focus-color',\n\n calendarBackgroundColor: '--plasma-calendar-background',\n calendarSelectedItemBackground: '--plasma-calendar-selected-item-background',\n calendarSelectedItemColor: '--plasma-calendar-selected-item-color',\n calendarSelectableItemBackgroundHover: '--plasma-calendar-selectable-item-bg-hover',\n calendarCurrentItemBorderColor: '--plasma-calendar-current-item-border-color',\n calendarCurrentItemBorderWidth: '--plasma-calendar-current-item-border-width',\n calendarCurrentItemBackgroundHover: '--plasma-calendar-current-item-bg-hover',\n calendarCurrentItemColorHover: '--plasma-calendar-current-item-color-hover',\n calendarCurrentItemChildBackgroundHover: '--plasma-calendar-current-item-child-bg-hover',\n calendarActiveItemBackground: '--plasma-calendar-active-item-bg',\n calendarActiveItemColor: '--plasma-calendar-active-item-color',\n calendarHoveredItemBackground: '--plasma-calendar-hovered-item-bg',\n calendarHoveredItemColor: '--plasma-calendar-hovered-item-color',\n calendarSeparatorBackground: '--plasma-calendar-separator-background',\n calendarRangeBackground: '--plasma-calendar-range-background',\n calendarOutlineFocusColor: '--plasma-calendar-outline-focus-color',\n calendarContentPrimaryColor: '--plasma-calendar-content-primary-color',\n calendarContentPrimaryDisabledColor: '--plasma-calendar-content-primary-disabled-color',\n calendarContentSecondaryColor: '--plasma-calendar-content-secondary-color',\n calendarContentSecondaryDisabledColor: '--plasma-calendar-content-secondary-disabled-color',\n calendarDisabledOpacity: '--plasma-calendar-disabled-opacity',\n};\n"],"names":["classes","dayOfWeek","dayInCurrentMonth","disabled","disabledCurrent","sideInRange","inRange","sideLeft","sideRight","selectableItem","selectedItem","currentItem","hoveredItem","doubleHeaderDate","doubleHeaderLastDateWrapper","disabledPrevButton","stretched","innerTokens","dateStructureFontFamily","dateStructureFontSize","dateStructureFontStyle","dateStructureFontWeight","dateStructureFontLetterSpacing","dateStructureFontLineHeight","dateStructureSelectedFontWeight","dateStructureBorderRadius","tokens","calendarContainerWidth","calendarContainerHeight","calendarBorderWidth","calendarBorderColor","calendarYearsPadding","calendarYearItemBorderRadius","calendarYearFontFamily","calendarYearFontSize","calendarYearFontStyle","calendarYearFontLetterSpacing","calendarYearFontLineHeight","calendarYearFontWeight","calendarYearSelectedFontWeight","calendarQuartersPadding","calendarQuarterItemBorderRadius","calendarQuarterFontFamily","calendarQuarterFontSize","calendarQuarterFontStyle","calendarQuarterFontLetterSpacing","calendarQuarterFontLineHeight","calendarQuarterFontWeight","calendarQuarterSelectedFontWeight","calendarMonthsPadding","calendarMonthItemBorderRadius","calendarMonthFontFamily","calendarMonthFontSize","calendarMonthFontStyle","calendarMonthFontLetterSpacing","calendarMonthFontLineHeight","calendarMonthFontWeight","calendarMonthSelectedFontWeight","calendarDaysPadding","calendarDayItemBorderRadius","calendarDayFontFamily","calendarDayFontSize","calendarDayFontStyle","calendarDayFontLetterSpacing","calendarDayFontLineHeight","calendarDayFontWeight","calendarDaySelectedFontWeight","calendarDayOfWeekColor","calendarHeaderWrapperPadding","calendarHeaderArrowGap","calendarHeaderArrowPadding","calendarHeaderPadding","calendarHeaderDateGap","calendarHeaderFontFamily","calendarHeaderFontSize","calendarHeaderFontStyle","calendarHeaderFontLetterSpacing","calendarHeaderFontLineHeight","calendarHeaderFontWeight","calendarHeaderFontWeightBold","calendarHeaderArrowColor","iconButtonColor","iconButtonBackgroundColor","iconButtonColorHover","iconButtonBackgroundColorHover","iconButtonColorActive","iconButtonBackgroundColorActive","iconButtonHeight","iconButtonWidth","iconButtonPadding","iconButtonRadius","iconButtonFocusColor","calendarBackgroundColor","calendarSelectedItemBackground","calendarSelectedItemColor","calendarSelectableItemBackgroundHover","calendarCurrentItemBorderColor","calendarCurrentItemBorderWidth","calendarCurrentItemBackgroundHover","calendarCurrentItemColorHover","calendarCurrentItemChildBackgroundHover","calendarActiveItemBackground","calendarActiveItemColor","calendarHoveredItemBackground","calendarHoveredItemColor","calendarSeparatorBackground","calendarRangeBackground","calendarOutlineFocusColor","calendarContentPrimaryColor","calendarContentPrimaryDisabledColor","calendarContentSecondaryColor","calendarContentSecondaryDisabledColor","calendarDisabledOpacity"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,SAAS,EAAE,aAAa;AACxBC,EAAAA,iBAAiB,EAAE,sBAAsB;AACzCC,EAAAA,QAAQ,EAAE,eAAe;AACzBC,EAAAA,eAAe,EAAE,uBAAuB;AACxCC,EAAAA,WAAW,EAAE,oBAAoB;AACjCC,EAAAA,OAAO,EAAE,eAAe;AACxBC,EAAAA,QAAQ,EAAE,gBAAgB;AAC1BC,EAAAA,SAAS,EAAE,iBAAiB;AAC5BC,EAAAA,cAAc,EAAE,iBAAiB;AACjCC,EAAAA,YAAY,EAAE,eAAe;AAC7BC,EAAAA,WAAW,EAAE,cAAc;AAC3BC,EAAAA,WAAW,EAAE,cAAc;AAC3BC,EAAAA,gBAAgB,EAAE,oBAAoB;AACtCC,EAAAA,2BAA2B,EAAE,kCAAkC;AAC/DC,EAAAA,kBAAkB,EAAE,sBAAsB;AAC1CC,EAAAA,SAAS,EAAE,2BAAA;AACf,EAAC;AAEM,IAAMC,WAAW,GAAG;AACvBC,EAAAA,uBAAuB,EAAE,8CAA8C;AACvEC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,sBAAsB,EA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;AAChFC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,+BAA+B,EAAE,iDAAiD;AAClFC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,eAAe,EAAE,qCAAqC;AACtDC,EAAAA,iBAAiB,EAAE,uCAAuC;AAC1DC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,oBAAoB,EAAE,2CAA2C;AAEjEC,EAAAA,uBAAuB,EAAE,8BAA8B;AACvDC,EAAAA,8BAA8B,EAAE,4CAA4C;AAC5EC,EAAAA,yBAAyB,EAAE,uCAAuC;AAClEC,EAAAA,qCAAqC,EAAE,4CAA4C;AACnFC,EAAAA,8BAA8B,EAAE,6CAA6C;AAC7EC,EAAAA,8BAA8B,EAAE,6CAA6C;AAC7EC,EAAAA,kCAAkC,EAAE,yCAAyC;AAC7EC,EAAAA,6BAA6B,EAAE,4CAA4C;AAC3EC,EAAAA,uCAAuC,EAAE,+CAA+C;AACxFC,EAAAA,4BAA4B,EAAE,kCAAkC;AAChEC,EAAAA,uBAAuB,EAAE,qCAAqC;AAC9DC,EAAAA,6BAA6B,EAAE,mCAAmC;AAClEC,EAAAA,wBAAwB,EAAE,sCAAsC;AAChEC,EAAAA,2BAA2B,EAAE,wCAAwC;AACrEC,EAAAA,uBAAuB,EAAE,oCAAoC;AAC7DC,EAAAA,yBAAyB,EAAE,uCAAuC;AAClEC,EAAAA,2BAA2B,EAAE,yCAAyC;AACtEC,EAAAA,mCAAmC,EAAE,kDAAkD;AACvFC,EAAAA,6BAA6B,EAAE,2CAA2C;AAC1EC,EAAAA,qCAAqC,EAAE,oDAAoD;AAC3FC,EAAAA,uBAAuB,EAAE,oCAAA;AAC7B;;;;;;"}
|
1
|
+
{"version":3,"file":"Calendar.tokens.js","sources":["../../../src/components/Calendar/Calendar.tokens.ts"],"sourcesContent":["export const classes = {\n dayOfWeek: 'day-of-week',\n dayInCurrentMonth: 'day-in-current-month',\n disabled: 'item-disabled',\n disabledCurrent: 'item-disabled-current',\n sideInRange: 'item-side-in-range',\n inRange: 'item-in-range',\n sideLeft: 'item-side-left',\n sideRight: 'item-side-right',\n selectableItem: 'item-selectable',\n selectedItem: 'item-selected',\n currentItem: 'item-current',\n hoveredItem: 'item-hovered',\n doubleHeaderDate: 'double-header-date',\n doubleHeaderLastDateWrapper: 'double-header--last-date-wrapper',\n disabledPrevButton: 'disabled-prev-button',\n stretched: 'plasma-calendar-stretched',\n};\n\nexport const innerTokens = {\n dateStructureFontFamily: '--plasma-calendar-date-structure-font-family',\n dateStructureFontSize: '--plasma-calendar-date-structure-font-size',\n dateStructureFontStyle: '--plasma-calendar-date-structure-font-style',\n dateStructureFontWeight: '--plasma-calendar-date-structure-font-weight',\n dateStructureFontLetterSpacing: '--plasma-calendar-date-structure-font-letter-spacing',\n dateStructureFontLineHeight: '--plasma-calendar-date-structure-line-height',\n\n dateStructureSelectedFontWeight: '--plasma-calendar-date-structure-selected-font-weight',\n\n dateStructureBorderRadius: '--plasma-calendar-date-structure-border-radius',\n};\n\nexport const tokens = {\n calendarContainerWidth: '--plasma-calendar-container-width',\n calendarContainerHeight: '--plasma-calendar-container-height',\n calendarBorderWidth: '--plasma-calendar-border-width',\n calendarBorderColor: '--plasma-calendar-border-color',\n\n /* Токены размера сетки лет */\n calendarYearsPadding: '--plasma-calendar-years-padding',\n calendarYearItemBorderRadius: '--plasma-calendar-year-item-border-radius',\n\n calendarYearFontFamily: '--plasma-calendar-year-font-family',\n calendarYearFontSize: '--plasma-calendar-year-font-size',\n calendarYearFontStyle: '--plasma-calendar-year-font-style',\n calendarYearFontLetterSpacing: '--plasma-calendar-year-font-letter-spacing',\n calendarYearFontLineHeight: '--plasma-calendar-year-line-height',\n calendarYearFontWeight: '--plasma-calendar-year-font-weight',\n calendarYearSelectedFontWeight: '--plasma-calendar-year-selected-font-weight',\n\n /* Токены размера сетки дней */\n calendarQuartersPadding: '--plasma-calendar-quarters-padding',\n calendarQuarterItemBorderRadius: '--plasma-calendar-quarter-item-border-radius',\n\n calendarQuarterFontFamily: '--plasma-calendar-quarter-font-family',\n calendarQuarterFontSize: '--plasma-calendar-quarter-font-size',\n calendarQuarterFontStyle: '--plasma-calendar-quarter-font-style',\n calendarQuarterFontLetterSpacing: '--plasma-calendar-quarter-font-letter-spacing',\n calendarQuarterFontLineHeight: '--plasma-calendar-quarter-line-height',\n calendarQuarterFontWeight: '--plasma-calendar-quarter-font-weight',\n calendarQuarterSelectedFontWeight: '--plasma-calendar-quarter-selected-font-weight',\n\n /* Токены размера сетки месяцев */\n calendarMonthsPadding: '--plasma-calendar-months-padding',\n calendarMonthItemBorderRadius: '--plasma-calendar-month-item-border-radius',\n\n calendarMonthFontFamily: '--plasma-calendar-month-font-family',\n calendarMonthFontSize: '--plasma-calendar-month-font-size',\n calendarMonthFontStyle: '--plasma-calendar-month-font-style',\n calendarMonthFontLetterSpacing: '--plasma-calendar-month-font-letter-spacing',\n calendarMonthFontLineHeight: '--plasma-calendar-month-line-height',\n calendarMonthFontWeight: '--plasma-calendar-month-font-weight',\n calendarMonthSelectedFontWeight: '--plasma-calendar-month-selected-font-weight',\n\n /* Токены размера сетки дней */\n calendarDaysPadding: '--plasma-calendar-days-padding',\n calendarDayItemBorderRadius: '--plasma-calendar-day-item-border-radius',\n\n calendarDayFontFamily: '--plasma-calendar-day-font-family',\n calendarDayFontSize: '--plasma-calendar-day-font-size',\n calendarDayFontStyle: '--plasma-calendar-day-font-style',\n calendarDayFontLetterSpacing: '--plasma-calendar-day-font-letter-spacing',\n calendarDayFontLineHeight: '--plasma-calendar-day-line-height',\n calendarDayFontWeight: '--plasma-calendar-day-font-weight',\n calendarDaySelectedFontWeight: '--plasma-calendar-day-selected-font-weight',\n\n calendarDayOfWeekColor: '--plasma-calendar-day-of-the-week-color',\n\n /* Токены шапки календаря */\n calendarHeaderWrapperPadding: '--plasma-calendar-header-wrapper-padding',\n calendarHeaderArrowGap: '--plasma-calendar-arrow-container-gap',\n calendarHeaderArrowPadding: '--plasma-calendar-arrow-container-padding',\n calendarArrowHeaderCustomSize: '--plasma-calendar-arrow-custom-size',\n\n calendarHeaderPadding: '--plasma-calendar-header-padding',\n calendarHeaderDateGap: '--plasma-calendar-header-date-gap',\n\n calendarHeaderFontFamily: '--plasma-calendar-header-font-family',\n calendarHeaderFontSize: '--plasma-calendar-header-font-size',\n calendarHeaderFontStyle: '--plasma-calendar-header-font-style',\n calendarHeaderFontLetterSpacing: '--plasma-calendar-header-font-letter-spacing',\n calendarHeaderFontLineHeight: '--plasma-calendar-header-line-height',\n calendarHeaderFontWeight: '--plasma-calendar-header-font-weight',\n calendarHeaderFontWeightBold: '--plasma-calendar-header-font-weight-bold',\n calendarHeaderArrowColor: '--plasma-calendar-header-arrow-color',\n\n /* Токены стрелок навигации календаря */\n iconButtonColor: '--plasma-calendar-icon-button-color',\n iconButtonBackgroundColor: '--plasma-calendar-icon-button-background',\n iconButtonColorHover: '--plasma-calendar-icon-button-color-hover',\n iconButtonBackgroundColorHover: '--plasma-calendar-icon-button-background-hover',\n iconButtonColorActive: '--plasma-calendar-icon-button-color-active',\n iconButtonBackgroundColorActive: '--plasma-calendar-icon-button-background-active',\n iconButtonHeight: '--plasma-calendar-icon-button-height',\n iconButtonWidth: '--plasma-calendar-icon-button-width',\n iconButtonPadding: '--plasma-calendar-icon-button-padding',\n iconButtonRadius: '--plasma-calendar-icon-button-radius',\n iconButtonFocusColor: '--plasma-calendar-icon-button-focus-color',\n\n calendarBackgroundColor: '--plasma-calendar-background',\n calendarSelectedItemBackground: '--plasma-calendar-selected-item-background',\n calendarSelectedItemColor: '--plasma-calendar-selected-item-color',\n calendarSelectableItemBackgroundHover: '--plasma-calendar-selectable-item-bg-hover',\n calendarCurrentItemBorderColor: '--plasma-calendar-current-item-border-color',\n calendarCurrentItemBorderWidth: '--plasma-calendar-current-item-border-width',\n calendarCurrentItemBackgroundHover: '--plasma-calendar-current-item-bg-hover',\n calendarCurrentItemColorHover: '--plasma-calendar-current-item-color-hover',\n calendarCurrentItemChildBackgroundHover: '--plasma-calendar-current-item-child-bg-hover',\n calendarActiveItemBackground: '--plasma-calendar-active-item-bg',\n calendarActiveItemColor: '--plasma-calendar-active-item-color',\n calendarHoveredItemBackground: '--plasma-calendar-hovered-item-bg',\n calendarHoveredItemColor: '--plasma-calendar-hovered-item-color',\n calendarSeparatorBackground: '--plasma-calendar-separator-background',\n calendarRangeBackground: '--plasma-calendar-range-background',\n calendarOutlineFocusColor: '--plasma-calendar-outline-focus-color',\n calendarContentPrimaryColor: '--plasma-calendar-content-primary-color',\n calendarContentPrimaryDisabledColor: '--plasma-calendar-content-primary-disabled-color',\n calendarContentSecondaryColor: '--plasma-calendar-content-secondary-color',\n calendarContentSecondaryDisabledColor: '--plasma-calendar-content-secondary-disabled-color',\n calendarDisabledOpacity: '--plasma-calendar-disabled-opacity',\n};\n"],"names":["classes","dayOfWeek","dayInCurrentMonth","disabled","disabledCurrent","sideInRange","inRange","sideLeft","sideRight","selectableItem","selectedItem","currentItem","hoveredItem","doubleHeaderDate","doubleHeaderLastDateWrapper","disabledPrevButton","stretched","innerTokens","dateStructureFontFamily","dateStructureFontSize","dateStructureFontStyle","dateStructureFontWeight","dateStructureFontLetterSpacing","dateStructureFontLineHeight","dateStructureSelectedFontWeight","dateStructureBorderRadius","tokens","calendarContainerWidth","calendarContainerHeight","calendarBorderWidth","calendarBorderColor","calendarYearsPadding","calendarYearItemBorderRadius","calendarYearFontFamily","calendarYearFontSize","calendarYearFontStyle","calendarYearFontLetterSpacing","calendarYearFontLineHeight","calendarYearFontWeight","calendarYearSelectedFontWeight","calendarQuartersPadding","calendarQuarterItemBorderRadius","calendarQuarterFontFamily","calendarQuarterFontSize","calendarQuarterFontStyle","calendarQuarterFontLetterSpacing","calendarQuarterFontLineHeight","calendarQuarterFontWeight","calendarQuarterSelectedFontWeight","calendarMonthsPadding","calendarMonthItemBorderRadius","calendarMonthFontFamily","calendarMonthFontSize","calendarMonthFontStyle","calendarMonthFontLetterSpacing","calendarMonthFontLineHeight","calendarMonthFontWeight","calendarMonthSelectedFontWeight","calendarDaysPadding","calendarDayItemBorderRadius","calendarDayFontFamily","calendarDayFontSize","calendarDayFontStyle","calendarDayFontLetterSpacing","calendarDayFontLineHeight","calendarDayFontWeight","calendarDaySelectedFontWeight","calendarDayOfWeekColor","calendarHeaderWrapperPadding","calendarHeaderArrowGap","calendarHeaderArrowPadding","calendarArrowHeaderCustomSize","calendarHeaderPadding","calendarHeaderDateGap","calendarHeaderFontFamily","calendarHeaderFontSize","calendarHeaderFontStyle","calendarHeaderFontLetterSpacing","calendarHeaderFontLineHeight","calendarHeaderFontWeight","calendarHeaderFontWeightBold","calendarHeaderArrowColor","iconButtonColor","iconButtonBackgroundColor","iconButtonColorHover","iconButtonBackgroundColorHover","iconButtonColorActive","iconButtonBackgroundColorActive","iconButtonHeight","iconButtonWidth","iconButtonPadding","iconButtonRadius","iconButtonFocusColor","calendarBackgroundColor","calendarSelectedItemBackground","calendarSelectedItemColor","calendarSelectableItemBackgroundHover","calendarCurrentItemBorderColor","calendarCurrentItemBorderWidth","calendarCurrentItemBackgroundHover","calendarCurrentItemColorHover","calendarCurrentItemChildBackgroundHover","calendarActiveItemBackground","calendarActiveItemColor","calendarHoveredItemBackground","calendarHoveredItemColor","calendarSeparatorBackground","calendarRangeBackground","calendarOutlineFocusColor","calendarContentPrimaryColor","calendarContentPrimaryDisabledColor","calendarContentSecondaryColor","calendarContentSecondaryDisabledColor","calendarDisabledOpacity"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,SAAS,EAAE,aAAa;AACxBC,EAAAA,iBAAiB,EAAE,sBAAsB;AACzCC,EAAAA,QAAQ,EAAE,eAAe;AACzBC,EAAAA,eAAe,EAAE,uBAAuB;AACxCC,EAAAA,WAAW,EAAE,oBAAoB;AACjCC,EAAAA,OAAO,EAAE,eAAe;AACxBC,EAAAA,QAAQ,EAAE,gBAAgB;AAC1BC,EAAAA,SAAS,EAAE,iBAA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BAA2B,EAAE,wCAAwC;AACrEC,EAAAA,uBAAuB,EAAE,oCAAoC;AAC7DC,EAAAA,yBAAyB,EAAE,uCAAuC;AAClEC,EAAAA,2BAA2B,EAAE,yCAAyC;AACtEC,EAAAA,mCAAmC,EAAE,kDAAkD;AACvFC,EAAAA,6BAA6B,EAAE,2CAA2C;AAC1EC,EAAAA,qCAAqC,EAAE,oDAAoD;AAC3FC,EAAAA,uBAAuB,EAAE,oCAAA;AAC7B;;;;;;"}
|
@@ -60,20 +60,20 @@ var CalendarHeader = function CalendarHeader(_ref) {
|
|
60
60
|
if (type === types.CalendarState.Days) {
|
61
61
|
return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, /*#__PURE__*/React__default.default.createElement(CalendarHeader_styles.StyledHeaderDate, null, constants.MONTH_NAMES[locale][date.monthIndex]), /*#__PURE__*/React__default.default.createElement(CalendarHeader_styles.StyledHeaderDate, null, date.year, /*#__PURE__*/React__default.default.createElement(CalendarHeader_styles.StyledHeaderArrow, {
|
62
62
|
color: "inherit",
|
63
|
-
|
63
|
+
sizeCustomProperty: Calendar_tokens.tokens.calendarArrowHeaderCustomSize
|
64
64
|
})));
|
65
65
|
}
|
66
66
|
if (type === types.CalendarState.Months || type === types.CalendarState.Quarters) {
|
67
67
|
return /*#__PURE__*/React__default.default.createElement(CalendarHeader_styles.StyledHeaderDate, null, date.year, /*#__PURE__*/React__default.default.createElement(CalendarHeader_styles.StyledHeaderArrow, {
|
68
68
|
color: "inherit",
|
69
|
-
|
69
|
+
sizeCustomProperty: Calendar_tokens.tokens.calendarArrowHeaderCustomSize
|
70
70
|
}));
|
71
71
|
}
|
72
72
|
if (type === types.CalendarState.Years) {
|
73
73
|
var yearValue = secondPart ? startYear + 12 : startYear;
|
74
74
|
return /*#__PURE__*/React__default.default.createElement(CalendarHeader_styles.StyledHeaderDate, null, yearValue, "\u2014", yearValue + constants.YEAR_RENDER_COUNT - 1, /*#__PURE__*/React__default.default.createElement(CalendarHeader_styles.StyledHeaderArrow, {
|
75
75
|
color: "inherit",
|
76
|
-
|
76
|
+
sizeCustomProperty: Calendar_tokens.tokens.calendarArrowHeaderCustomSize
|
77
77
|
}));
|
78
78
|
}
|
79
79
|
return '';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarHeader.js","sources":["../../../../../src/components/Calendar/ui/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import React from 'react';\nimport type { MouseEvent } from 'react';\n\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../_Icon';\nimport { CalendarState } from '../../store/types';\nimport { getCalendarType, MONTH_NAMES, YEAR_RENDER_COUNT, I18N } from '../../utils';\nimport type { DateObject } from '../../Calendar.types';\nimport { classes } from '../../Calendar.tokens';\nimport { sizeMap } from '../../store/reducer';\nimport { cx } from '../../../../utils';\n\nimport type { CalendarHeaderProps } from './CalendarHeader.types';\nimport {\n StyledArrow,\n StyledArrows,\n StyledCalendarHeader,\n StyledDoubleHeaderWrapper,\n StyledHeader,\n StyledHeaderDate,\n StyledHeaderDouble,\n StyledNavigation,\n StyledHeaderArrow,\n} from './CalendarHeader.styles';\n\n/**\n * Компонент шапки календаря.\n */\nexport const CalendarHeader: React.FC<CalendarHeaderProps> = ({\n type = 'Days',\n startYear = 0,\n size,\n firstDate,\n secondDate,\n isDouble,\n onPrev,\n onNext,\n onUpdateCalendarState,\n locale,\n}) => {\n const handleCalendarState = () => {\n const newSize: [number, number] = isDouble ? sizeMap.Months.double : sizeMap.Months.single;\n\n if (type === CalendarState.Days) {\n onUpdateCalendarState?.(CalendarState.Months, newSize);\n }\n\n if (type === CalendarState.Months || type === CalendarState.Quarters) {\n onUpdateCalendarState?.(CalendarState.Years, newSize);\n }\n };\n\n const handlePrev = (event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n\n if (startYear <= 0) {\n return;\n }\n onPrev();\n };\n\n const handleNext = (event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n\n onNext();\n };\n\n const getHeaderContent = (date?: DateObject, secondPart?: boolean) => {\n if (!date) {\n return '';\n }\n\n if (type === CalendarState.Days) {\n return (\n <>\n <StyledHeaderDate>{MONTH_NAMES[locale][date.monthIndex]}</StyledHeaderDate>\n <StyledHeaderDate>\n {date.year}\n <StyledHeaderArrow color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledHeaderDate>\n </>\n );\n }\n\n if (type === CalendarState.Months || type === CalendarState.Quarters) {\n return (\n <StyledHeaderDate>\n {date.year}\n <StyledHeaderArrow color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledHeaderDate>\n );\n }\n\n if (type === CalendarState.Years) {\n const yearValue = secondPart ? startYear + 12 : startYear;\n\n return (\n <StyledHeaderDate>\n {yearValue}—{yearValue + YEAR_RENDER_COUNT - 1}\n <StyledHeaderArrow color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledHeaderDate>\n );\n }\n\n return '';\n };\n\n const currentCalendarType = getCalendarType(type, locale);\n\n const PreviousButton = () => (\n <StyledArrow\n className={cx(startYear <= 0 && classes.disabledPrevButton)}\n aria-label={`${I18N.previous[locale]} ${currentCalendarType}`}\n onClick={handlePrev}\n >\n <IconDisclosureLeft color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledArrow>\n );\n\n const NextButton = () => (\n <StyledArrow aria-label={`${I18N.next[locale]} ${currentCalendarType}`} onClick={handleNext}>\n <IconDisclosureRight color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledArrow>\n );\n\n return (\n <StyledCalendarHeader>\n {isDouble ? (\n <StyledNavigation>\n <StyledDoubleHeaderWrapper>\n <PreviousButton />\n <StyledHeaderDouble onClick={handleCalendarState} aria-live=\"polite\">\n {getHeaderContent(firstDate)}\n </StyledHeaderDouble>\n </StyledDoubleHeaderWrapper>\n <StyledDoubleHeaderWrapper className={classes.doubleHeaderLastDateWrapper}>\n <StyledHeaderDouble onClick={handleCalendarState} aria-live=\"polite\">\n {getHeaderContent(secondDate, true)}\n </StyledHeaderDouble>\n <NextButton />\n </StyledDoubleHeaderWrapper>\n </StyledNavigation>\n ) : (\n <>\n <StyledHeader\n type=\"button\"\n aria-live=\"polite\"\n id=\"id-grid-label\"\n onClick={handleCalendarState}\n tabIndex={0}\n >\n {getHeaderContent(firstDate)}\n </StyledHeader>\n <StyledArrows>\n <PreviousButton />\n <NextButton />\n </StyledArrows>\n </>\n )}\n </StyledCalendarHeader>\n );\n};\n"],"names":["CalendarHeader","_ref","_ref$type","type","_ref$startYear","startYear","size","firstDate","secondDate","isDouble","onPrev","onNext","onUpdateCalendarState","locale","handleCalendarState","newSize","sizeMap","Months","single","CalendarState","Days","Quarters","Years","handlePrev","event","stopPropagation","handleNext","getHeaderContent","date","secondPart","React","createElement","Fragment","StyledHeaderDate","MONTH_NAMES","monthIndex","year","StyledHeaderArrow","color","yearValue","YEAR_RENDER_COUNT","currentCalendarType","getCalendarType","PreviousButton","StyledArrow","className","cx","classes","disabledPrevButton","concat","I18N","previous","onClick","IconDisclosureLeft","NextButton","next","IconDisclosureRight","StyledCalendarHeader","StyledNavigation","StyledDoubleHeaderWrapper","StyledHeaderDouble","doubleHeaderLastDateWrapper","StyledHeader","id","tabIndex","StyledArrows"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EAWpD;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAVFE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IAAAE,cAAA,GAAAH,IAAA,CACbI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,cAAA;IACbE,IAAI,GAAAL,IAAA,CAAJK,IAAI;IACJC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,UAAU,GAAAP,IAAA,CAAVO,UAAU;IAC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,IAAAA,OAAO,EAAEtC,mBAAoB;AAC7BkD,IAAAA,QAAQ,EAAE,CAAA;AAAE,GAAA,EAEXrC,gBAAgB,CAACpB,SAAS,CACjB,CAAC,eACfuB,sBAAA,CAAAC,aAAA,CAACkC,kCAAY,EAAA,IAAA,eACTnC,sBAAA,CAAAC,aAAA,CAACY,cAAc,EAAA,IAAE,CAAC,eAClBb,sBAAA,CAAAC,aAAA,CAACuB,UAAU,EAAA,IAAE,CACH,CAChB,CAEY,CAAC,CAAA;AAE/B;;;;"}
|
1
|
+
{"version":3,"file":"CalendarHeader.js","sources":["../../../../../src/components/Calendar/ui/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import React from 'react';\nimport type { MouseEvent } from 'react';\n\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../_Icon';\nimport { CalendarState } from '../../store/types';\nimport { getCalendarType, MONTH_NAMES, YEAR_RENDER_COUNT, I18N } from '../../utils';\nimport type { DateObject } from '../../Calendar.types';\nimport { classes, tokens } from '../../Calendar.tokens';\nimport { sizeMap } from '../../store/reducer';\nimport { cx } from '../../../../utils';\n\nimport type { CalendarHeaderProps } from './CalendarHeader.types';\nimport {\n StyledArrow,\n StyledArrows,\n StyledCalendarHeader,\n StyledDoubleHeaderWrapper,\n StyledHeader,\n StyledHeaderDate,\n StyledHeaderDouble,\n StyledNavigation,\n StyledHeaderArrow,\n} from './CalendarHeader.styles';\n\n/**\n * Компонент шапки календаря.\n */\nexport const CalendarHeader: React.FC<CalendarHeaderProps> = ({\n type = 'Days',\n startYear = 0,\n size,\n firstDate,\n secondDate,\n isDouble,\n onPrev,\n onNext,\n onUpdateCalendarState,\n locale,\n}) => {\n const handleCalendarState = () => {\n const newSize: [number, number] = isDouble ? sizeMap.Months.double : sizeMap.Months.single;\n\n if (type === CalendarState.Days) {\n onUpdateCalendarState?.(CalendarState.Months, newSize);\n }\n\n if (type === CalendarState.Months || type === CalendarState.Quarters) {\n onUpdateCalendarState?.(CalendarState.Years, newSize);\n }\n };\n\n const handlePrev = (event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n\n if (startYear <= 0) {\n return;\n }\n onPrev();\n };\n\n const handleNext = (event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n\n onNext();\n };\n\n const getHeaderContent = (date?: DateObject, secondPart?: boolean) => {\n if (!date) {\n return '';\n }\n\n if (type === CalendarState.Days) {\n return (\n <>\n <StyledHeaderDate>{MONTH_NAMES[locale][date.monthIndex]}</StyledHeaderDate>\n <StyledHeaderDate>\n {date.year}\n <StyledHeaderArrow color=\"inherit\" sizeCustomProperty={tokens.calendarArrowHeaderCustomSize} />\n </StyledHeaderDate>\n </>\n );\n }\n\n if (type === CalendarState.Months || type === CalendarState.Quarters) {\n return (\n <StyledHeaderDate>\n {date.year}\n <StyledHeaderArrow color=\"inherit\" sizeCustomProperty={tokens.calendarArrowHeaderCustomSize} />\n </StyledHeaderDate>\n );\n }\n\n if (type === CalendarState.Years) {\n const yearValue = secondPart ? startYear + 12 : startYear;\n\n return (\n <StyledHeaderDate>\n {yearValue}—{yearValue + YEAR_RENDER_COUNT - 1}\n <StyledHeaderArrow color=\"inherit\" sizeCustomProperty={tokens.calendarArrowHeaderCustomSize} />\n </StyledHeaderDate>\n );\n }\n\n return '';\n };\n\n const currentCalendarType = getCalendarType(type, locale);\n\n const PreviousButton = () => (\n <StyledArrow\n className={cx(startYear <= 0 && classes.disabledPrevButton)}\n aria-label={`${I18N.previous[locale]} ${currentCalendarType}`}\n onClick={handlePrev}\n >\n <IconDisclosureLeft color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledArrow>\n );\n\n const NextButton = () => (\n <StyledArrow aria-label={`${I18N.next[locale]} ${currentCalendarType}`} onClick={handleNext}>\n <IconDisclosureRight color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledArrow>\n );\n\n return (\n <StyledCalendarHeader>\n {isDouble ? (\n <StyledNavigation>\n <StyledDoubleHeaderWrapper>\n <PreviousButton />\n <StyledHeaderDouble onClick={handleCalendarState} aria-live=\"polite\">\n {getHeaderContent(firstDate)}\n </StyledHeaderDouble>\n </StyledDoubleHeaderWrapper>\n <StyledDoubleHeaderWrapper className={classes.doubleHeaderLastDateWrapper}>\n <StyledHeaderDouble onClick={handleCalendarState} aria-live=\"polite\">\n {getHeaderContent(secondDate, true)}\n </StyledHeaderDouble>\n <NextButton />\n </StyledDoubleHeaderWrapper>\n </StyledNavigation>\n ) : (\n <>\n <StyledHeader\n type=\"button\"\n aria-live=\"polite\"\n id=\"id-grid-label\"\n onClick={handleCalendarState}\n tabIndex={0}\n >\n {getHeaderContent(firstDate)}\n </StyledHeader>\n <StyledArrows>\n <PreviousButton />\n <NextButton />\n </StyledArrows>\n </>\n )}\n </StyledCalendarHeader>\n );\n};\n"],"names":["CalendarHeader","_ref","_ref$type","type","_ref$startYear","startYear","size","firstDate","secondDate","isDouble","onPrev","onNext","onUpdateCalendarState","locale","handleCalendarState","newSize","sizeMap","Months","single","CalendarState","Days","Quarters","Years","handlePrev","event","stopPropagation","handleNext","getHeaderContent","date","secondPart","React","createElement","Fragment","StyledHeaderDate","MONTH_NAMES","monthIndex","year","StyledHeaderArrow","color","sizeCustomProperty","tokens","calendarArrowHeaderCustomSize","yearValue","YEAR_RENDER_COUNT","currentCalendarType","getCalendarType","PreviousButton","StyledArrow","className","cx","classes","disabledPrevButton","concat","I18N","previous","onClick","IconDisclosureLeft","NextButton","next","IconDisclosureRight","StyledCalendarHeader","StyledNavigation","StyledDoubleHeaderWrapper","StyledHeaderDouble","doubleHeaderLastDateWrapper","StyledHeader","id","tabIndex","StyledArrows"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EAWpD;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAVFE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,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AAE,QAAA,EACIF,IAAAA,eAAAA,sBAAA,CAAAC,aAAA,CAACkC,kCAAY,EAAA;AACT9D,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,WAAA,EAAU,QAAQ;AAClB+D,IAAAA,EAAE,EAAC,eAAe;AAClBX,IAAAA,OAAO,EAAEzC,mBAAoB;AAC7BqD,IAAAA,QAAQ,EAAE,CAAA;AAAE,GAAA,EAEXxC,gBAAgB,CAACpB,SAAS,CACjB,CAAC,eACfuB,sBAAA,CAAAC,aAAA,CAACqC,kCAAY,EAAA,IAAA,eACTtC,sBAAA,CAAAC,aAAA,CAACe,cAAc,EAAA,IAAE,CAAC,eAClBhB,sBAAA,CAAAC,aAAA,CAAC0B,UAAU,EAAA,IAAE,CACH,CAChB,CAEY,CAAC,CAAA;AAE/B;;;;"}
|
@@ -15,6 +15,7 @@ var base$1 = require('./variations/_size/base.js');
|
|
15
15
|
var SelectNative = require('./ui/SelectNative/SelectNative.js');
|
16
16
|
var Combobox_context = require('./Combobox.context.js');
|
17
17
|
var initialItemsTransform = require('./utils/initialItemsTransform.js');
|
18
|
+
var getTextValue = require('./utils/getTextValue.js');
|
18
19
|
var react = require('../../../utils/react.js');
|
19
20
|
var filterItems = require('./utils/filterItems.js');
|
20
21
|
var pathReducer = require('./reducers/pathReducer.js');
|
@@ -24,6 +25,7 @@ var isEmpty = require('../../../utils/isEmpty.js');
|
|
24
25
|
var updateDescendants = require('./utils/updateDescendants.js');
|
25
26
|
var updateAncestors = require('./utils/updateAncestors.js');
|
26
27
|
var updateSingleAncestors = require('./utils/updateSingleAncestors.js');
|
28
|
+
var useDidMountLayoutEffect = require('../../../hooks/useDidMountLayoutEffect.js');
|
27
29
|
var Target_styles = require('./ui/Target/Target.styles.js');
|
28
30
|
var sizeToIconSize = require('../../Select/utils/sizeToIconSize.js');
|
29
31
|
var getItemId = require('./utils/getItemId.js');
|
@@ -44,7 +46,7 @@ var _excluded = ["name", "multiple", "value", "onChange", "defaultValue", "isTar
|
|
44
46
|
|
45
47
|
var comboboxRoot = function comboboxRoot(Root) {
|
46
48
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
47
|
-
var
|
49
|
+
var _getItemByFocused, _StyledLeftHelper;
|
48
50
|
var name = props.name,
|
49
51
|
multiple = props.multiple,
|
50
52
|
outerValue = props.value,
|
@@ -106,7 +108,7 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
106
108
|
valueToCheckedMap = _useMemo2[0],
|
107
109
|
valueToItemMap = _useMemo2[1],
|
108
110
|
labelToItemMap = _useMemo2[2];
|
109
|
-
var _useState = React.useState(multiple
|
111
|
+
var _useState = React.useState(getTextValue.getTextValue(multiple, outerValue, valueToItemMap, renderValue)),
|
110
112
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
111
113
|
textValue = _useState2[0],
|
112
114
|
setTextValue = _useState2[1];
|
@@ -120,8 +122,7 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
120
122
|
var inputForkRef = plasmaCore.useForkRef(inputRef, ref);
|
121
123
|
var treeId = react.safeUseId();
|
122
124
|
var filteredItems = React.useMemo(function () {
|
123
|
-
|
124
|
-
return filterItems.filterItems(transformedItems, textValue, ((_valueToItemMap$get2 = valueToItemMap.get(value)) === null || _valueToItemMap$get2 === void 0 ? void 0 : _valueToItemMap$get2.label) || value, filter);
|
125
|
+
return filterItems.filterItems(transformedItems, textValue, getTextValue.getTextValue(multiple, value, valueToItemMap, renderValue), filter);
|
125
126
|
}, [transformedItems, textValue, filter]);
|
126
127
|
var _useMemo3 = React.useMemo(function () {
|
127
128
|
return getPathMaps.getPathMap(filteredItems);
|
@@ -164,19 +165,8 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
164
165
|
onToggle(false);
|
165
166
|
}
|
166
167
|
|
167
|
-
//
|
168
|
-
|
169
|
-
// Если нет выбранного элемента, то стираем значение инпута.
|
170
|
-
if (textValue !== value) {
|
171
|
-
if (isEmpty.isEmpty(value)) {
|
172
|
-
setTextValue('');
|
173
|
-
} else if (multiple) {
|
174
|
-
setTextValue('');
|
175
|
-
} else {
|
176
|
-
var _valueToItemMap$get3;
|
177
|
-
setTextValue(((_valueToItemMap$get3 = valueToItemMap.get(value)) === null || _valueToItemMap$get3 === void 0 ? void 0 : _valueToItemMap$get3.label) || value || '');
|
178
|
-
}
|
179
|
-
}
|
168
|
+
// Возвращаем актуальное значение поля ввода после закрытия выпадающего списка.
|
169
|
+
setTextValue(getTextValue.getTextValue(multiple, value, valueToItemMap, renderValue));
|
180
170
|
}, floatingPopoverRef);
|
181
171
|
|
182
172
|
// Эта функция срабатывает при изменении Combobox и
|
@@ -184,12 +174,12 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
184
174
|
var onChange = function onChange(newValue, item) {
|
185
175
|
// Условие для отправки изменений наружу
|
186
176
|
if (props.onChange) {
|
187
|
-
// Условие для
|
177
|
+
// Условие для отправки, если комбобокс используется без формы.
|
188
178
|
if (!props.name && (typeof newValue === 'string' || Array.isArray(newValue))) {
|
189
179
|
props.onChange(newValue, item || null);
|
190
180
|
}
|
191
181
|
|
192
|
-
// Условие для
|
182
|
+
// Условие для отправки, если комбобокс используется с формой.
|
193
183
|
if (props.name && _rollupPluginBabelHelpers.typeof(newValue) === 'object' && !Array.isArray(newValue)) {
|
194
184
|
props.onChange(newValue);
|
195
185
|
}
|
@@ -241,9 +231,9 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
241
231
|
if (renderValue && !isTargetAmount) {
|
242
232
|
var resultValues = _rollupPluginBabelHelpers.toConsumableArray(value);
|
243
233
|
value.forEach(function (_, index) {
|
244
|
-
var _valueToItemMap$
|
234
|
+
var _valueToItemMap$get;
|
245
235
|
var stringValue = value[index];
|
246
|
-
var label = (_valueToItemMap$
|
236
|
+
var label = (_valueToItemMap$get = valueToItemMap.get(stringValue)) === null || _valueToItemMap$get === void 0 ? void 0 : _valueToItemMap$get.label;
|
247
237
|
var labelAfterRenderValue = renderValue(label ? labelToItemMap.get(label) : {
|
248
238
|
value: stringValue,
|
249
239
|
label: stringValue.toString()
|
@@ -372,8 +362,8 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
372
362
|
});
|
373
363
|
};
|
374
364
|
var valueToItemMapper = function valueToItemMapper(stringValue) {
|
375
|
-
var _valueToItemMap$
|
376
|
-
return ((_valueToItemMap$
|
365
|
+
var _valueToItemMap$get2;
|
366
|
+
return ((_valueToItemMap$get2 = valueToItemMap.get(stringValue)) === null || _valueToItemMap$get2 === void 0 ? void 0 : _valueToItemMap$get2.label) || stringValue.toString();
|
377
367
|
};
|
378
368
|
return value.map(renderValueMapper || valueToItemMapper);
|
379
369
|
}
|
@@ -433,10 +423,6 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
433
423
|
}
|
434
424
|
}
|
435
425
|
setChecked(checkedCopy);
|
436
|
-
if (!multiple && textValue === value && valueToItemMap.has(value)) {
|
437
|
-
var _valueToItemMap$get6;
|
438
|
-
setTextValue(((_valueToItemMap$get6 = valueToItemMap.get(value)) === null || _valueToItemMap$get6 === void 0 ? void 0 : _valueToItemMap$get6.label) || '');
|
439
|
-
}
|
440
426
|
|
441
427
|
// В deps мы кладем именно outerValue и internalValue, а не просто value.
|
442
428
|
// Т.к. вначале нужно отфильтровать и провалидировать outerValue и результат положить в переменную.
|
@@ -444,9 +430,8 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
444
430
|
}, [outerValue, internalValue, items]);
|
445
431
|
|
446
432
|
// При изменении value нужно возвращать значение в инпуте к исходному.
|
447
|
-
|
448
|
-
|
449
|
-
setTextValue(multiple ? '' : ((_valueToItemMap$get7 = valueToItemMap.get(value)) === null || _valueToItemMap$get7 === void 0 ? void 0 : _valueToItemMap$get7.label) || (value === null || value === void 0 ? void 0 : value.toString()) || '');
|
433
|
+
useDidMountLayoutEffect.useDidMountLayoutEffect(function () {
|
434
|
+
setTextValue(getTextValue.getTextValue(multiple, value, valueToItemMap, renderValue));
|
450
435
|
}, [outerValue, internalValue]);
|
451
436
|
React.useLayoutEffect(function () {
|
452
437
|
if (defaultValue) {
|