@salutejs/plasma-new-hope 0.195.0-canary.1572.11914481185.0 → 0.195.0-dev.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Badge/Badge.css +4 -4
- package/cjs/components/Badge/Badge.js +17 -7
- package/cjs/components/Badge/Badge.js.map +1 -1
- package/cjs/components/Badge/Badge.tokens.js +10 -5
- package/cjs/components/Badge/Badge.tokens.js.map +1 -1
- package/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/cjs/components/Badge/variations/_clear/base.js.map +1 -1
- package/cjs/components/Badge/variations/_clear/base_wiboj8.css +1 -0
- package/cjs/components/Badge/variations/_size/base.js +1 -1
- package/cjs/components/Badge/variations/_size/base.js.map +1 -1
- package/{es/components/Badge/variations/_size/base_to0y5x.css → cjs/components/Badge/variations/_size/base_bu5opk.css} +1 -1
- package/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/cjs/components/Badge/variations/_transparent/base.js.map +1 -1
- package/cjs/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
- package/cjs/components/Badge/variations/_view/base.js +1 -1
- package/cjs/components/Badge/variations/_view/base.js.map +1 -1
- package/cjs/components/Badge/variations/_view/base_j3xzf3.css +1 -0
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/cjs/components/Calendar/store/reducer.js +2 -2
- package/cjs/components/Calendar/store/reducer.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +18 -4
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +5 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +5 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +5 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +5 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +5 -4
- package/cjs/components/Dropdown/Dropdown.css +5 -4
- package/cjs/components/Dropdown/Dropdown.js +4 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +5 -4
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +7 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_1b439rx.css → DropdownItem.styles_14yih1y.css} +1 -0
- package/cjs/components/Select/Select.js +0 -1
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +18 -3
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/cjs/index.css +9 -8
- package/emotion/cjs/components/Badge/Badge.js +17 -7
- package/emotion/cjs/components/Badge/Badge.template-doc.mdx +40 -16
- package/emotion/cjs/components/Badge/Badge.tokens.js +10 -6
- package/emotion/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/emotion/cjs/components/Badge/variations/_size/base.js +2 -1
- package/emotion/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/emotion/cjs/components/Badge/variations/_view/base.js +1 -1
- package/emotion/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/emotion/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/emotion/cjs/components/Calendar/store/reducer.js +2 -2
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -4
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/cjs/components/Dropdown/Dropdown.js +4 -2
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +15 -11
- package/emotion/cjs/components/Select/Select.js +0 -1
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
- package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +14 -14
- package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
- package/emotion/es/components/Badge/Badge.js +18 -8
- package/emotion/es/components/Badge/Badge.template-doc.mdx +40 -16
- package/emotion/es/components/Badge/Badge.tokens.js +9 -5
- package/emotion/es/components/Badge/variations/_clear/base.js +2 -2
- package/emotion/es/components/Badge/variations/_size/base.js +3 -2
- package/emotion/es/components/Badge/variations/_transparent/base.js +2 -2
- package/emotion/es/components/Badge/variations/_view/base.js +2 -2
- package/emotion/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/emotion/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/emotion/es/components/Calendar/store/reducer.js +2 -2
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +22 -4
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/es/components/Dropdown/Dropdown.js +4 -2
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +15 -11
- package/emotion/es/components/Select/Select.js +0 -1
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
- package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +14 -14
- package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
- package/es/components/Badge/Badge.css +4 -4
- package/es/components/Badge/Badge.js +20 -10
- package/es/components/Badge/Badge.js.map +1 -1
- package/es/components/Badge/Badge.tokens.js +10 -6
- package/es/components/Badge/Badge.tokens.js.map +1 -1
- package/es/components/Badge/variations/_clear/base.js +1 -1
- package/es/components/Badge/variations/_clear/base.js.map +1 -1
- package/es/components/Badge/variations/_clear/base_wiboj8.css +1 -0
- package/es/components/Badge/variations/_size/base.js +1 -1
- package/es/components/Badge/variations/_size/base.js.map +1 -1
- package/{cjs/components/Badge/variations/_size/base_to0y5x.css → es/components/Badge/variations/_size/base_bu5opk.css} +1 -1
- package/es/components/Badge/variations/_transparent/base.js +1 -1
- package/es/components/Badge/variations/_transparent/base.js.map +1 -1
- package/es/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
- package/es/components/Badge/variations/_view/base.js +1 -1
- package/es/components/Badge/variations/_view/base.js.map +1 -1
- package/es/components/Badge/variations/_view/base_j3xzf3.css +1 -0
- package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/es/components/Calendar/store/reducer.js +2 -2
- package/es/components/Calendar/store/reducer.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +19 -5
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +5 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +5 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +5 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +5 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +5 -4
- package/es/components/Dropdown/Dropdown.css +5 -4
- package/es/components/Dropdown/Dropdown.js +4 -2
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +5 -4
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +7 -2
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_1b439rx.css → DropdownItem.styles_14yih1y.css} +1 -0
- package/es/components/Select/Select.js +0 -1
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +19 -4
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/es/index.css +9 -8
- package/package.json +3 -2
- package/styled-components/cjs/components/Badge/Badge.js +17 -7
- package/styled-components/cjs/components/Badge/Badge.template-doc.mdx +40 -16
- package/styled-components/cjs/components/Badge/Badge.tokens.js +10 -6
- package/styled-components/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/styled-components/cjs/components/Badge/variations/_size/base.js +2 -1
- package/styled-components/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/styled-components/cjs/components/Badge/variations/_view/base.js +1 -1
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/styled-components/cjs/components/Calendar/store/reducer.js +2 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -4
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/cjs/components/Dropdown/Dropdown.js +4 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -2
- package/styled-components/cjs/components/Select/Select.js +0 -1
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +5 -5
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
- package/styled-components/es/components/Badge/Badge.js +18 -8
- package/styled-components/es/components/Badge/Badge.template-doc.mdx +40 -16
- package/styled-components/es/components/Badge/Badge.tokens.js +9 -5
- package/styled-components/es/components/Badge/variations/_clear/base.js +2 -2
- package/styled-components/es/components/Badge/variations/_size/base.js +3 -2
- package/styled-components/es/components/Badge/variations/_transparent/base.js +2 -2
- package/styled-components/es/components/Badge/variations/_view/base.js +2 -2
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/styled-components/es/components/Calendar/store/reducer.js +2 -2
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +22 -4
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/es/components/Dropdown/Dropdown.js +4 -2
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -2
- package/styled-components/es/components/Select/Select.js +0 -1
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +5 -5
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
- package/types/components/Badge/Badge.d.ts.map +1 -1
- package/types/components/Badge/Badge.tokens.d.ts +8 -4
- package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
- package/types/components/Badge/Badge.types.d.ts +18 -5
- package/types/components/Badge/Badge.types.d.ts.map +1 -1
- package/types/components/Badge/variations/_clear/base.d.ts.map +1 -1
- package/types/components/Badge/variations/_size/base.d.ts.map +1 -1
- package/types/components/Calendar/store/reducer.d.ts +1 -1
- package/types/components/Calendar/store/reducer.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 -2
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +50 -2
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +11 -6
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/index.d.ts +1 -0
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +1 -0
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +1 -2
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +61 -4
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +25 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.d.ts +61 -4
- package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts +25 -1
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/cjs/components/Badge/variations/_clear/base_oopyb7.css +0 -1
- package/cjs/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
- package/cjs/components/Badge/variations/_view/base_qlxank.css +0 -1
- package/es/components/Badge/variations/_clear/base_oopyb7.css +0 -1
- package/es/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
- package/es/components/Badge/variations/_view/base_qlxank.css +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarDouble.js","sources":["../../../../src/components/Calendar/CalendarDouble/CalendarDouble.tsx"],"sourcesContent":["import React, {\n useState,\n useCallback,\n useMemo,\n forwardRef,\n HTMLAttributes,\n KeyboardEvent,\n useEffect,\n useReducer,\n} from 'react';\n\nimport type { Calendar, CalendarConfigProps, DateObject } from '../Calendar.types';\nimport { YEAR_RENDER_COUNT, getNextDate, isValueUpdate } from '../utils';\nimport { useKeyNavigation, useCalendarNavigation, useCalendarDateChange } from '../hooks';\nimport { CalendarDays, CalendarHeader, CalendarMonths, CalendarQuarters, CalendarYears } from '../ui';\nimport { RootProps } from '../../../engines/types';\nimport { getInitialState, reducer, sizeMap } from '../store/reducer';\nimport { ActionType, CalendarState } from '../store/types';\nimport { IsOutOfRange } from '../CalendarBase/CalendarBase.styles';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { StyledCalendar, StyledSeparator, StyledWrapper } from './CalendarDouble.styles';\n\nexport type CalendarDoubleProps = Calendar & CalendarConfigProps;\n\n/**\n * Компонент двойного календаря.\n */\nexport const calendarDoubleRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarDoubleProps>(\n (\n {\n value: externalValue,\n min,\n max,\n includeEdgeDates,\n type = 'Days',\n eventList,\n disabledList,\n eventMonthList,\n disabledMonthList,\n eventQuarterList,\n disabledQuarterList,\n eventYearList,\n disabledYearList,\n onChangeValue,\n locale = 'ru',\n ...rest\n },\n outerRootRef,\n ) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n\n const [hoveredItem, setHoveredItem] = useState<DateObject | undefined>();\n const [prevType, setPrevType] = useState(type);\n const [prevValue, setPrevValue] = useState(value);\n const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0);\n\n const [state, dispatch] = useReducer(reducer, getInitialState(value, min, type, true));\n\n const { date, calendarState, startYear, size } = state;\n\n const [firstDate, setFirstDate] = useState<DateObject>(date);\n const [secondDate, setSecondDate] = useState<DateObject>(date);\n\n const { handleNext, handlePrev } = useCalendarNavigation({\n calendarState,\n date,\n dispatch,\n });\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs, isOutOfRange] = useKeyNavigation({\n isDouble: true,\n size,\n calendarState,\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const {\n handleOnChangeDay,\n handleOnChangeMonth,\n handleOnChangeQuarter,\n handleOnChangeYear,\n handleUpdateCalendarState,\n } = useCalendarDateChange({ type, onChangeValue, onSelectIndexes, dispatch });\n\n const updateSecondDate = () => {\n if (calendarState === CalendarState.Days) {\n const [nextYear, nextMonthIndex] = getNextDate(date.year, date.monthIndex);\n setSecondDate({ year: nextYear, monthIndex: nextMonthIndex, day: date.day });\n }\n\n if (calendarState === CalendarState.Months || calendarState === CalendarState.Quarters) {\n setSecondDate({ year: date.year + 1, monthIndex: date.monthIndex, day: date.day });\n }\n\n if (calendarState === CalendarState.Years) {\n setSecondDate({ year: startYear + YEAR_RENDER_COUNT, monthIndex: date.monthIndex, day: date.day });\n }\n };\n\n const getBoundaryDates = () => {\n // NOTE: Если установить индекс дня равным \"0\", то берется последнее число предыдущего месяца\n if (calendarState === CalendarState.Days) {\n return [\n new Date(firstDate.year, firstDate.monthIndex, 1),\n new Date(secondDate.year, secondDate.monthIndex + 1, 0),\n ];\n }\n\n if (calendarState === CalendarState.Months || calendarState === CalendarState.Quarters) {\n return [new Date(firstDate.year, 0), new Date(secondDate.year, 12, 0)];\n }\n\n const endVisibleYear = startYear + YEAR_RENDER_COUNT * 2 - 1;\n return [new Date(startYear, 0), new Date(endVisibleYear, 11)];\n };\n\n // Изменяем ключ каждый раз как пытаемся перейти на даты которые находятся за пределами min/max ограничений.\n // Это необходимо для того чтобы screen-reader корректно озвучивал уведомление aria-live=\"assertive\"\n // о том что нет доступных дат\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setOutOfRangeKey((previousState) => Number(!previousState));\n\n onKeyDown(event);\n },\n [onKeyDown],\n );\n\n useEffect(() => {\n if (prevType !== calendarState) {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState, size: sizeMap[calendarState].double },\n });\n\n setPrevType(calendarState);\n }\n }, [calendarState]);\n\n useEffect(() => {\n if (!prevValue) {\n setPrevValue(value);\n }\n\n if ((value && prevValue && isValueUpdate(value, prevValue)) || (value && !prevValue)) {\n const [minVisibleDate, maxVisibleDate] = getBoundaryDates();\n\n if (value > maxVisibleDate || value < minVisibleDate) {\n dispatch({\n type: ActionType.UPDATE_DATE,\n payload: { value },\n });\n }\n\n setPrevValue(value);\n }\n }, [value, prevValue]);\n\n useEffect(() => {\n setFirstDate(date);\n\n updateSecondDate();\n }, [date, calendarState]);\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n {isOutOfRange && (\n <IsOutOfRange\n key={outOfRangeKey}\n aria-atomic=\"true\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-relevant=\"additions\"\n >\n Далее нет доступных дат.\n </IsOutOfRange>\n )}\n <CalendarHeader\n isDouble\n size={rest.size}\n firstDate={firstDate}\n secondDate={secondDate}\n startYear={startYear}\n type={calendarState}\n onPrev={handlePrev}\n onNext={handleNext}\n onUpdateCalendarState={handleUpdateCalendarState}\n locale={locale}\n />\n\n <StyledWrapper>\n {calendarState === CalendarState.Days && (\n <>\n <CalendarDays\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredItem}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n />\n <StyledSeparator />\n <CalendarDays\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredItem}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Months && (\n <>\n <CalendarMonths\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n />\n <StyledSeparator />\n <CalendarMonths\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Quarters && (\n <>\n <CalendarQuarters\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n />\n <StyledSeparator />\n <CalendarQuarters\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Years && (\n <>\n <CalendarYears\n value={externalValue}\n date={firstDate}\n startYear={startYear}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n />\n <StyledSeparator />\n <CalendarYears\n value={externalValue}\n date={secondDate}\n startYear={startYear + YEAR_RENDER_COUNT}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n isSecond\n />\n </>\n )}\n </StyledWrapper>\n </Root>\n );\n },\n );\n\nexport const calendarDoubleConfig = {\n name: 'CalendarDouble',\n tag: 'div',\n layout: calendarDoubleRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarDoubleRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","includeEdgeDates","_ref$type","type","eventList","disabledList","eventMonthList","disabledMonthList","eventQuarterList","disabledQuarterList","eventYearList","disabledYearList","onChangeValue","_ref$locale","locale","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredItem","setHoveredItem","_useState3","_useState4","prevType","setPrevType","_useState5","_useState6","prevValue","setPrevValue","_useState7","_useState8","outOfRangeKey","setOutOfRangeKey","_useReducer","useReducer","reducer","getInitialState","_useReducer2","state","dispatch","date","calendarState","startYear","size","_useState9","_useState10","firstDate","setFirstDate","_useState11","_useState12","secondDate","setSecondDate","_useCalendarNavigatio","useCalendarNavigation","handleNext","handlePrev","_useKeyNavigation","useKeyNavigation","isDouble","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","isOutOfRange","_useCalendarDateChang","useCalendarDateChange","handleOnChangeDay","handleOnChangeMonth","handleOnChangeQuarter","handleOnChangeYear","handleUpdateCalendarState","updateSecondDate","CalendarState","Days","_getNextDate","getNextDate","year","monthIndex","_getNextDate2","nextYear","nextMonthIndex","day","Months","Quarters","Years","YEAR_RENDER_COUNT","getBoundaryDates","Date","endVisibleYear","handleKeyDown","useCallback","event","previousState","Number","useEffect","ActionType","UPDATE_CALENDAR_STATE","payload","sizeMap","isValueUpdate","_getBoundaryDates","_getBoundaryDates2","minVisibleDate","maxVisibleDate","UPDATE_DATE","React","createElement","_extends","ref","IsOutOfRange","key","role","CalendarHeader","onUpdateCalendarState","StyledWrapper","Fragment","CalendarDays","hoveredDay","onChangeDay","onHoverDay","onSetSelected","_StyledSeparator","StyledSeparator","isSecond","CalendarMonths","hoveredMonth","onChangeMonth","onHoverMonth","_StyledSeparator2","CalendarQuarters","hoveredQuarter","onChangeQuarter","onHoverQuarter","_StyledSeparator3","CalendarYears","hoveredYear","onChangeYear","onHoverYear","_StyledSeparator4","calendarDoubleConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC9FC,UAAU,CACN,UAAAC,IAAA,EAmBIC,YAAY,EACX;AAAA,IAAA,IAlBUC,aAAa,GAAAF,IAAA,CAApBG,KAAK;MACLC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MACHC,gBAAgB,GAAAN,IAAA,CAAhBM,gBAAgB;MAAAC,SAAA,GAAAP,IAAA,CAChBQ,IAAI;AAAJ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/CalendarDouble/CalendarDouble.tsx"],"sourcesContent":["import React, {\n useState,\n useCallback,\n useMemo,\n forwardRef,\n HTMLAttributes,\n KeyboardEvent,\n useEffect,\n useReducer,\n} from 'react';\n\nimport type { Calendar, CalendarConfigProps, DateObject } from '../Calendar.types';\nimport { YEAR_RENDER_COUNT, getNextDate, isValueUpdate } from '../utils';\nimport { useKeyNavigation, useCalendarNavigation, useCalendarDateChange } from '../hooks';\nimport { CalendarDays, CalendarHeader, CalendarMonths, CalendarQuarters, CalendarYears } from '../ui';\nimport { RootProps } from '../../../engines/types';\nimport { getInitialState, reducer, sizeMap } from '../store/reducer';\nimport { ActionType, CalendarState } from '../store/types';\nimport { IsOutOfRange } from '../CalendarBase/CalendarBase.styles';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { StyledCalendar, StyledSeparator, StyledWrapper } from './CalendarDouble.styles';\n\nexport type CalendarDoubleProps = Calendar & CalendarConfigProps;\n\n/**\n * Компонент двойного календаря.\n */\nexport const calendarDoubleRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarDoubleProps>(\n (\n {\n value: externalValue,\n min,\n max,\n includeEdgeDates,\n type = 'Days',\n eventList,\n disabledList,\n eventMonthList,\n disabledMonthList,\n eventQuarterList,\n disabledQuarterList,\n eventYearList,\n disabledYearList,\n onChangeValue,\n locale = 'ru',\n ...rest\n },\n outerRootRef,\n ) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n\n const [hoveredItem, setHoveredItem] = useState<DateObject | undefined>();\n const [prevType, setPrevType] = useState(type);\n const [prevValue, setPrevValue] = useState(value);\n const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0);\n\n const [state, dispatch] = useReducer(reducer, getInitialState(value, type, true));\n\n const { date, calendarState, startYear, size } = state;\n\n const [firstDate, setFirstDate] = useState<DateObject>(date);\n const [secondDate, setSecondDate] = useState<DateObject>(date);\n\n const { handleNext, handlePrev } = useCalendarNavigation({\n calendarState,\n date,\n dispatch,\n });\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs, isOutOfRange] = useKeyNavigation({\n isDouble: true,\n size,\n calendarState,\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const {\n handleOnChangeDay,\n handleOnChangeMonth,\n handleOnChangeQuarter,\n handleOnChangeYear,\n handleUpdateCalendarState,\n } = useCalendarDateChange({ type, onChangeValue, onSelectIndexes, dispatch });\n\n const updateSecondDate = () => {\n if (calendarState === CalendarState.Days) {\n const [nextYear, nextMonthIndex] = getNextDate(date.year, date.monthIndex);\n setSecondDate({ year: nextYear, monthIndex: nextMonthIndex, day: date.day });\n }\n\n if (calendarState === CalendarState.Months || calendarState === CalendarState.Quarters) {\n setSecondDate({ year: date.year + 1, monthIndex: date.monthIndex, day: date.day });\n }\n\n if (calendarState === CalendarState.Years) {\n setSecondDate({ year: startYear + YEAR_RENDER_COUNT, monthIndex: date.monthIndex, day: date.day });\n }\n };\n\n const getBoundaryDates = () => {\n // NOTE: Если установить индекс дня равным \"0\", то берется последнее число предыдущего месяца\n if (calendarState === CalendarState.Days) {\n return [\n new Date(firstDate.year, firstDate.monthIndex, 1),\n new Date(secondDate.year, secondDate.monthIndex + 1, 0),\n ];\n }\n\n if (calendarState === CalendarState.Months || calendarState === CalendarState.Quarters) {\n return [new Date(firstDate.year, 0), new Date(secondDate.year, 12, 0)];\n }\n\n const endVisibleYear = startYear + YEAR_RENDER_COUNT * 2 - 1;\n return [new Date(startYear, 0), new Date(endVisibleYear, 11)];\n };\n\n // Изменяем ключ каждый раз как пытаемся перейти на даты которые находятся за пределами min/max ограничений.\n // Это необходимо для того чтобы screen-reader корректно озвучивал уведомление aria-live=\"assertive\"\n // о том что нет доступных дат\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setOutOfRangeKey((previousState) => Number(!previousState));\n\n onKeyDown(event);\n },\n [onKeyDown],\n );\n\n useEffect(() => {\n if (prevType !== calendarState) {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState, size: sizeMap[calendarState].double },\n });\n\n setPrevType(calendarState);\n }\n }, [calendarState]);\n\n useEffect(() => {\n if (!prevValue) {\n setPrevValue(value);\n }\n\n if ((value && prevValue && isValueUpdate(value, prevValue)) || (value && !prevValue)) {\n const [minVisibleDate, maxVisibleDate] = getBoundaryDates();\n\n if (value > maxVisibleDate || value < minVisibleDate) {\n dispatch({\n type: ActionType.UPDATE_DATE,\n payload: { value },\n });\n }\n\n setPrevValue(value);\n }\n }, [value, prevValue]);\n\n useEffect(() => {\n setFirstDate(date);\n\n updateSecondDate();\n }, [date, calendarState]);\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n {isOutOfRange && (\n <IsOutOfRange\n key={outOfRangeKey}\n aria-atomic=\"true\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-relevant=\"additions\"\n >\n Далее нет доступных дат.\n </IsOutOfRange>\n )}\n <CalendarHeader\n isDouble\n size={rest.size}\n firstDate={firstDate}\n secondDate={secondDate}\n startYear={startYear}\n type={calendarState}\n onPrev={handlePrev}\n onNext={handleNext}\n onUpdateCalendarState={handleUpdateCalendarState}\n locale={locale}\n />\n\n <StyledWrapper>\n {calendarState === CalendarState.Days && (\n <>\n <CalendarDays\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredItem}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n />\n <StyledSeparator />\n <CalendarDays\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredItem}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Months && (\n <>\n <CalendarMonths\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n />\n <StyledSeparator />\n <CalendarMonths\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Quarters && (\n <>\n <CalendarQuarters\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n />\n <StyledSeparator />\n <CalendarQuarters\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Years && (\n <>\n <CalendarYears\n value={externalValue}\n date={firstDate}\n startYear={startYear}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n />\n <StyledSeparator />\n <CalendarYears\n value={externalValue}\n date={secondDate}\n startYear={startYear + YEAR_RENDER_COUNT}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n isSecond\n />\n </>\n )}\n </StyledWrapper>\n </Root>\n );\n },\n );\n\nexport const calendarDoubleConfig = {\n name: 'CalendarDouble',\n tag: 'div',\n layout: calendarDoubleRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarDoubleRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","includeEdgeDates","_ref$type","type","eventList","disabledList","eventMonthList","disabledMonthList","eventQuarterList","disabledQuarterList","eventYearList","disabledYearList","onChangeValue","_ref$locale","locale","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredItem","setHoveredItem","_useState3","_useState4","prevType","setPrevType","_useState5","_useState6","prevValue","setPrevValue","_useState7","_useState8","outOfRangeKey","setOutOfRangeKey","_useReducer","useReducer","reducer","getInitialState","_useReducer2","state","dispatch","date","calendarState","startYear","size","_useState9","_useState10","firstDate","setFirstDate","_useState11","_useState12","secondDate","setSecondDate","_useCalendarNavigatio","useCalendarNavigation","handleNext","handlePrev","_useKeyNavigation","useKeyNavigation","isDouble","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","isOutOfRange","_useCalendarDateChang","useCalendarDateChange","handleOnChangeDay","handleOnChangeMonth","handleOnChangeQuarter","handleOnChangeYear","handleUpdateCalendarState","updateSecondDate","CalendarState","Days","_getNextDate","getNextDate","year","monthIndex","_getNextDate2","nextYear","nextMonthIndex","day","Months","Quarters","Years","YEAR_RENDER_COUNT","getBoundaryDates","Date","endVisibleYear","handleKeyDown","useCallback","event","previousState","Number","useEffect","ActionType","UPDATE_CALENDAR_STATE","payload","sizeMap","isValueUpdate","_getBoundaryDates","_getBoundaryDates2","minVisibleDate","maxVisibleDate","UPDATE_DATE","React","createElement","_extends","ref","IsOutOfRange","key","role","CalendarHeader","onUpdateCalendarState","StyledWrapper","Fragment","CalendarDays","hoveredDay","onChangeDay","onHoverDay","onSetSelected","_StyledSeparator","StyledSeparator","isSecond","CalendarMonths","hoveredMonth","onChangeMonth","onHoverMonth","_StyledSeparator2","CalendarQuarters","hoveredQuarter","onChangeQuarter","onHoverQuarter","_StyledSeparator3","CalendarYears","hoveredYear","onChangeYear","onHoverYear","_StyledSeparator4","calendarDoubleConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC9FC,UAAU,CACN,UAAAC,IAAA,EAmBIC,YAAY,EACX;AAAA,IAAA,IAlBUC,aAAa,GAAAF,IAAA,CAApBG,KAAK;MACLC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MACHC,gBAAgB,GAAAN,IAAA,CAAhBM,gBAAgB;MAAAC,S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= {
|
|
20
20
|
"double": [3, 1]
|
21
21
|
}
|
22
22
|
};
|
23
|
-
var getInitialState = function getInitialState(value,
|
24
|
-
var initDate = value ||
|
23
|
+
var getInitialState = function getInitialState(value, calendarState, isDouble) {
|
24
|
+
var initDate = value || new Date();
|
25
25
|
var date = getDateFromValue(initDate);
|
26
26
|
var resSize = isDouble ? sizeMap[calendarState]["double"] : sizeMap[calendarState].single;
|
27
27
|
return {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"reducer.js","sources":["../../../../src/components/Calendar/store/reducer.ts"],"sourcesContent":["import { getDateFromValue, getNextDate, getPrevDate, getStartYear } from '../utils';\n\nimport { CalendarStateType, Action, ActionType, InitialState, SizeMap } from './types';\n\nexport const sizeMap: SizeMap = {\n Days: {\n single: [5, 6],\n double: [11, 6],\n },\n Months: {\n single: [3, 2],\n double: [7, 2],\n },\n Years: {\n single: [3, 2],\n double: [7, 2],\n },\n Quarters: {\n single: [1, 1],\n double: [3, 1],\n },\n};\n\nexport const getInitialState = (\n value: Date | undefined,\n min: Date | undefined,\n calendarState: CalendarStateType,\n isDouble?: boolean,\n): InitialState => {\n const initDate = value || min || new Date();\n const date = getDateFromValue(initDate);\n\n const resSize: [number, number] = isDouble ? sizeMap[calendarState].double : sizeMap[calendarState].single;\n\n return {\n date: { ...date, day: value !== undefined ? date.day : 0 },\n startYear: getStartYear(date.year),\n calendarState,\n size: resSize,\n };\n};\n\nexport const reducer = (state: InitialState, action: Action): InitialState => {\n switch (action.type) {\n case ActionType.PREVIOUS_MONTH: {\n const { year, monthIndex } = action.payload;\n const [prevYear, prevMonthIndex] = getPrevDate(year, monthIndex);\n\n return {\n ...state,\n date: {\n day: state.date.day,\n monthIndex: prevMonthIndex,\n year: prevYear,\n },\n };\n }\n case ActionType.NEXT_MONTH: {\n const { monthIndex, year } = action.payload;\n const [nextYear, nextMonthIndex] = getNextDate(year, monthIndex);\n\n return {\n ...state,\n date: {\n day: state.date.day,\n monthIndex: nextMonthIndex,\n year: nextYear,\n },\n };\n }\n case ActionType.PREVIOUS_YEAR: {\n const { step } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear - step,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year: state.date.year - step,\n },\n };\n }\n case ActionType.NEXT_YEAR: {\n const { step } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear + step,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year: state.date.year + step,\n },\n };\n }\n case ActionType.PREVIOUS_START_YEAR: {\n const { yearsCount } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear - yearsCount,\n };\n }\n case ActionType.NEXT_START_YEAR: {\n const { yearsCount } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear + yearsCount,\n };\n }\n case ActionType.UPDATE_DATE: {\n const { value } = action.payload;\n const date = getDateFromValue(value);\n const startYear = getStartYear(value.getFullYear());\n\n return {\n ...state,\n date,\n startYear,\n };\n }\n case ActionType.UPDATE_MONTH: {\n const { calendarState, monthIndex, size } = action.payload;\n\n return {\n ...state,\n size,\n calendarState,\n date: {\n day: state.date.day,\n monthIndex,\n year: state.date.year,\n },\n };\n }\n case ActionType.UPDATE_YEAR: {\n const { calendarState, year, size } = action.payload;\n\n return {\n ...state,\n size,\n calendarState,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year,\n },\n };\n }\n case ActionType.UPDATE_CALENDAR_STATE: {\n const { calendarState, size } = action.payload;\n\n return {\n ...state,\n calendarState,\n size: size || state.size,\n };\n }\n default:\n return state;\n }\n};\n"],"names":["sizeMap","Days","single","Months","Years","Quarters","getInitialState","value","min","calendarState","isDouble","initDate","Date","date","getDateFromValue","resSize","_objectSpread","day","undefined","startYear","getStartYear","year","size","reducer","state","action","type","ActionType","PREVIOUS_MONTH","_action$payload","payload","monthIndex","_getPrevDate","getPrevDate","_getPrevDate2","_slicedToArray","prevYear","prevMonthIndex","NEXT_MONTH","_action$payload2","_getNextDate","getNextDate","_getNextDate2","nextYear","nextMonthIndex","PREVIOUS_YEAR","step","NEXT_YEAR","PREVIOUS_START_YEAR","yearsCount","NEXT_START_YEAR","UPDATE_DATE","getFullYear","UPDATE_MONTH","_action$payload3","UPDATE_YEAR","_action$payload4","UPDATE_CALENDAR_STATE","_action$payload5"],"mappings":";;;;AAIO,IAAMA,OAAgB,GAAG;AAC5BC,EAAAA,IAAI,EAAE;AACFC,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,EAAE,EAAE,CAAC,CAAA;GACjB;AACDC,EAAAA,MAAM,EAAE;AACJD,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;GAChB;AACDE,EAAAA,KAAK,EAAE;AACHF,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;GAChB;AACDG,EAAAA,QAAQ,EAAE;AACNH,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;AACjB,GAAA;AACJ,EAAC;AAEYI,IAAAA,eAAe,GAAG,SAAlBA,eAAeA,CACxBC,KAAuB,EACvBC,GAAqB,EACrBC,aAAgC,EAChCC,QAAkB,EACH;EACf,IAAMC,QAAQ,GAAGJ,KAAK,IAAIC,GAAG,IAAI,IAAII,IAAI,EAAE,CAAA;AAC3C,EAAA,IAAMC,IAAI,GAAGC,gBAAgB,CAACH,QAAQ,CAAC,CAAA;AAEvC,EAAA,IAAMI,OAAyB,GAAGL,QAAQ,GAAGV,OAAO,CAACS,aAAa,CAAC,CAAA,QAAA,CAAO,GAAGT,OAAO,CAACS,aAAa,CAAC,CAACP,MAAM,CAAA;EAE1G,OAAO;AACHW,IAAAA,IAAI,EAAAG,cAAA,CAAAA,cAAA,KAAOH,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b,UAAAA,aAAa,EAAbA,cAAa;AACbI,UAAAA,IAAI,EAAE;AACFI,YAAAA,GAAG,EAAEO,KAAK,CAACX,IAAI,CAACI,GAAG;AACnBc,YAAAA,UAAU,EAAEP,KAAK,CAACX,IAAI,CAACkB,UAAU;AACjCV,YAAAA,IAAI,EAAJA,MAAAA;AACJ,WAAA;AAAC,SAAA,CAAA,CAAA;AAET,OAAA;IACA,KAAKM,UAAU,CAAC8B,qBAAqB;AAAE,MAAA;AACnC,QAAA,IAAAC,gBAAA,GAAgCjC,MAAM,CAACK,OAAO;UAAtCrB,eAAa,GAAAiD,gBAAA,CAAbjD,aAAa;UAAEa,MAAI,GAAAoC,gBAAA,CAAJpC,IAAI,CAAA;AAE3B,QAAA,OAAAN,cAAA,CAAAA,cAAA,CAAA,EAAA,EACOQ,KAAK,CAAA,EAAA,EAAA,EAAA;AACRf,UAAAA,aAAa,EAAbA,eAAa;AACba,UAAAA,IAAI,EAAEA,MAAI,IAAIE,KAAK,CAACF,IAAAA;AAAI,SAAA,CAAA,CAAA;AAEhC,OAAA;AACA,IAAA;AACI,MAAA,OAAOE,KAAK,CAAA;AACpB,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"reducer.js","sources":["../../../../src/components/Calendar/store/reducer.ts"],"sourcesContent":["import { getDateFromValue, getNextDate, getPrevDate, getStartYear } from '../utils';\n\nimport { CalendarStateType, Action, ActionType, InitialState, SizeMap } from './types';\n\nexport const sizeMap: SizeMap = {\n Days: {\n single: [5, 6],\n double: [11, 6],\n },\n Months: {\n single: [3, 2],\n double: [7, 2],\n },\n Years: {\n single: [3, 2],\n double: [7, 2],\n },\n Quarters: {\n single: [1, 1],\n double: [3, 1],\n },\n};\n\nexport const getInitialState = (\n value: Date | undefined,\n calendarState: CalendarStateType,\n isDouble?: boolean,\n): InitialState => {\n const initDate = value || new Date();\n const date = getDateFromValue(initDate);\n\n const resSize: [number, number] = isDouble ? sizeMap[calendarState].double : sizeMap[calendarState].single;\n\n return {\n date: { ...date, day: value !== undefined ? date.day : 0 },\n startYear: getStartYear(date.year),\n calendarState,\n size: resSize,\n };\n};\n\nexport const reducer = (state: InitialState, action: Action): InitialState => {\n switch (action.type) {\n case ActionType.PREVIOUS_MONTH: {\n const { year, monthIndex } = action.payload;\n const [prevYear, prevMonthIndex] = getPrevDate(year, monthIndex);\n\n return {\n ...state,\n date: {\n day: state.date.day,\n monthIndex: prevMonthIndex,\n year: prevYear,\n },\n };\n }\n case ActionType.NEXT_MONTH: {\n const { monthIndex, year } = action.payload;\n const [nextYear, nextMonthIndex] = getNextDate(year, monthIndex);\n\n return {\n ...state,\n date: {\n day: state.date.day,\n monthIndex: nextMonthIndex,\n year: nextYear,\n },\n };\n }\n case ActionType.PREVIOUS_YEAR: {\n const { step } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear - step,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year: state.date.year - step,\n },\n };\n }\n case ActionType.NEXT_YEAR: {\n const { step } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear + step,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year: state.date.year + step,\n },\n };\n }\n case ActionType.PREVIOUS_START_YEAR: {\n const { yearsCount } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear - yearsCount,\n };\n }\n case ActionType.NEXT_START_YEAR: {\n const { yearsCount } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear + yearsCount,\n };\n }\n case ActionType.UPDATE_DATE: {\n const { value } = action.payload;\n const date = getDateFromValue(value);\n const startYear = getStartYear(value.getFullYear());\n\n return {\n ...state,\n date,\n startYear,\n };\n }\n case ActionType.UPDATE_MONTH: {\n const { calendarState, monthIndex, size } = action.payload;\n\n return {\n ...state,\n size,\n calendarState,\n date: {\n day: state.date.day,\n monthIndex,\n year: state.date.year,\n },\n };\n }\n case ActionType.UPDATE_YEAR: {\n const { calendarState, year, size } = action.payload;\n\n return {\n ...state,\n size,\n calendarState,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year,\n },\n };\n }\n case ActionType.UPDATE_CALENDAR_STATE: {\n const { calendarState, size } = action.payload;\n\n return {\n ...state,\n calendarState,\n size: size || state.size,\n };\n }\n default:\n return state;\n }\n};\n"],"names":["sizeMap","Days","single","Months","Years","Quarters","getInitialState","value","calendarState","isDouble","initDate","Date","date","getDateFromValue","resSize","_objectSpread","day","undefined","startYear","getStartYear","year","size","reducer","state","action","type","ActionType","PREVIOUS_MONTH","_action$payload","payload","monthIndex","_getPrevDate","getPrevDate","_getPrevDate2","_slicedToArray","prevYear","prevMonthIndex","NEXT_MONTH","_action$payload2","_getNextDate","getNextDate","_getNextDate2","nextYear","nextMonthIndex","PREVIOUS_YEAR","step","NEXT_YEAR","PREVIOUS_START_YEAR","yearsCount","NEXT_START_YEAR","UPDATE_DATE","getFullYear","UPDATE_MONTH","_action$payload3","UPDATE_YEAR","_action$payload4","UPDATE_CALENDAR_STATE","_action$payload5"],"mappings":";;;;AAIO,IAAMA,OAAgB,GAAG;AAC5BC,EAAAA,IAAI,EAAE;AACFC,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,EAAE,EAAE,CAAC,CAAA;GACjB;AACDC,EAAAA,MAAM,EAAE;AACJD,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;GAChB;AACDE,EAAAA,KAAK,EAAE;AACHF,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;GAChB;AACDG,EAAAA,QAAQ,EAAE;AACNH,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;AACjB,GAAA;AACJ,EAAC;AAEM,IAAMI,eAAe,GAAG,SAAlBA,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A;AAAC,SAAA,CAAA,CAAA;AAET,OAAA;IACA,KAAKM,UAAU,CAAC4B,WAAW;AAAE,MAAA;AACzB,QAAA,IAAAC,gBAAA,GAAsC/B,MAAM,CAACK,OAAO;UAA5CrB,cAAa,GAAA+C,gBAAA,CAAb/C,aAAa;UAAEY,MAAI,GAAAmC,gBAAA,CAAJnC,IAAI;UAAEC,KAAI,GAAAkC,gBAAA,CAAJlC,IAAI,CAAA;AAEjC,QAAA,OAAAN,cAAA,CAAAA,cAAA,CAAA,EAAA,EACOQ,KAAK,CAAA,EAAA,EAAA,EAAA;AACRF,UAAAA,IAAI,EAAJA,KAAI;AACJb,UAAAA,aAAa,EAAbA,cAAa;AACbI,UAAAA,IAAI,EAAE;AACFI,YAAAA,GAAG,EAAEO,KAAK,CAACX,IAAI,CAACI,GAAG;AACnBc,YAAAA,UAAU,EAAEP,KAAK,CAACX,IAAI,CAACkB,UAAU;AACjCV,YAAAA,IAAI,EAAJA,MAAAA;AACJ,WAAA;AAAC,SAAA,CAAA,CAAA;AAET,OAAA;IACA,KAAKM,UAAU,CAAC8B,qBAAqB;AAAE,MAAA;AACnC,QAAA,IAAAC,gBAAA,GAAgCjC,MAAM,CAACK,OAAO;UAAtCrB,eAAa,GAAAiD,gBAAA,CAAbjD,aAAa;UAAEa,MAAI,GAAAoC,gBAAA,CAAJpC,IAAI,CAAA;AAE3B,QAAA,OAAAN,cAAA,CAAAA,cAAA,CAAA,EAAA,EACOQ,KAAK,CAAA,EAAA,EAAA,EAAA;AACRf,UAAAA,aAAa,EAAbA,eAAa;AACba,UAAAA,IAAI,EAAEA,MAAI,IAAIE,KAAK,CAACF,IAAAA;AAAI,SAAA,CAAA,CAAA;AAEhC,OAAA;AACA,IAAA;AACI,MAAA,OAAOE,KAAK,CAAA;AACpB,GAAA;AACJ;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
2
|
import React, { forwardRef, useMemo, useState, useRef, useReducer, useLayoutEffect, createContext } from 'react';
|
3
3
|
import { useForkRef, safeUseId } from '@salutejs/plasma-core';
|
4
4
|
import { classes } from './Combobox.tokens.js';
|
@@ -178,9 +178,24 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
178
178
|
|
179
179
|
// Обработчик чипов
|
180
180
|
var handleChipsChange = function handleChipsChange(chipLabels) {
|
181
|
-
|
182
|
-
|
183
|
-
|
181
|
+
if (!Array.isArray(value)) return;
|
182
|
+
|
183
|
+
// TODO: #1564
|
184
|
+
// Из лейблов чипов получаем value у item и далее прокидываем его в onChange.
|
185
|
+
if (renderValue && !isTargetAmount) {
|
186
|
+
var resultValues = _toConsumableArray(value);
|
187
|
+
value.forEach(function (_, index) {
|
188
|
+
var labelAfterRenderValue = renderValue(labelToItemMap.get(valueToItemMap.get(value[index]).label));
|
189
|
+
if (!chipLabels.includes(labelAfterRenderValue)) {
|
190
|
+
resultValues.splice(index, 1);
|
191
|
+
}
|
192
|
+
});
|
193
|
+
onChange(resultValues);
|
194
|
+
} else {
|
195
|
+
onChange(chipLabels.map(function (chipLabel) {
|
196
|
+
return labelToItemMap.get(chipLabel).value;
|
197
|
+
}));
|
198
|
+
}
|
184
199
|
};
|
185
200
|
|
186
201
|
// Обработчик открытия/закрытия выпадающего списка
|
@@ -349,7 +364,6 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
349
364
|
handleItemClick: handleItemClick,
|
350
365
|
variant: variant,
|
351
366
|
renderItem: renderItem,
|
352
|
-
valueToItemMap: valueToItemMap,
|
353
367
|
treeId: treeId
|
354
368
|
}
|
355
369
|
}, /*#__PURE__*/React.createElement(FloatingPopover, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.js","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, createContext, useLayoutEffect, useRef } from 'react';\nimport type { ChangeEvent } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../engines';\nimport { isEmpty } from '../../../utils';\nimport { useOutsideClick } from '../../../hooks';\nimport { sizeToIconSize } from '../../Select/utils';\n\nimport { classes } from './Combobox.tokens';\nimport { FloatingPopover } from './FloatingPopover';\nimport { useKeyNavigation, getItemByFocused } from './hooks/useKeyboardNavigation';\nimport {\n initialItemsTransform,\n updateAncestors,\n updateDescendants,\n updateSingleAncestors,\n filterItems,\n getItemId,\n getInitialValue,\n} from './utils';\nimport { Inner, StyledTextField } from './ui';\nimport { pathReducer, focusedPathReducer } from './reducers';\nimport { getPathMap, getTreeMaps } from './hooks/getPathMaps';\nimport { Ul, base, StyledArrow, IconArrowWrapper, StyledEmptyState } from './Combobox.styles';\nimport type { ItemContext, ComboboxProps } from './Combobox.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { ItemOptionTransformed } from './ui/Inner/ui/Item/Item.types';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Поле ввода с выпадающим списком и возможностью фильтрации и выбора элементов.\n */\nexport const comboboxRoot = (Root: RootProps<HTMLInputElement, Omit<ComboboxProps, 'items'>>) =>\n forwardRef<HTMLInputElement, ComboboxProps>((props, ref) => {\n const {\n multiple,\n value: outerValue,\n onChange: outerOnChange,\n isTargetAmount,\n targetAmount,\n items,\n placement = 'bottom-start',\n label,\n placeholder,\n helperText,\n contentLeft,\n textBefore,\n textAfter,\n variant = 'normal',\n listOverflow,\n listHeight,\n listWidth,\n portal,\n renderItem,\n view,\n size,\n labelPlacement,\n readOnly = false,\n disabled = false,\n alwaysOpened = false,\n filter,\n closeAfterSelect: outerCloseAfterSelect,\n renderValue,\n ...rest\n } = props;\n const transformedItems = useMemo(() => initialItemsTransform(items || []), [items]);\n\n // Создаем структуры для быстрой работы с деревом\n const [valueToCheckedMap, valueToItemMap, labelToItemMap] = useMemo(() => getTreeMaps(transformedItems), [\n items,\n ]);\n\n const [textValue, setTextValue] = useState(valueToItemMap.get(outerValue as string)?.label || '');\n const [internalValue, setInternalValue] = useState<string | string[]>(multiple ? [] : '');\n\n const value =\n outerValue !== null && outerValue !== undefined\n ? getInitialValue(outerValue, valueToItemMap)\n : internalValue;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const floatingPopoverRef = useRef<HTMLDivElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n const treeId = safeUseId();\n\n const filteredItems = filterItems(\n transformedItems,\n textValue,\n valueToItemMap.get(value as string)?.label as string,\n filter,\n );\n\n const [pathMap, focusedToValueMap] = useMemo(() => getPathMap(filteredItems), [filteredItems, textValue]);\n\n // Состояния дерева элементов\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n const [checked, setChecked] = useState(valueToCheckedMap);\n\n const isCurrentListOpen = alwaysOpened || Boolean(path[0]);\n const activeDescendantItemValue = getItemByFocused(focusedPath, focusedToValueMap)?.value || '';\n const withArrowInverse = isCurrentListOpen ? classes.arrowInverse : undefined;\n const closeAfterSelect = outerCloseAfterSelect ?? !multiple;\n\n // Логика работы при клике за пределами выпадающего списка\n const targetRef = useOutsideClick<HTMLUListElement>(() => {\n if (!isCurrentListOpen) {\n return;\n }\n\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n\n // Проверяем, отличается ли значение в инпуте от выбранного value после закрытия дропдауна.\n // Если изменилось, то возвращаем label выбранного айтема.\n // Если нет выбранного элемента, то стираем значение инпута.\n if (textValue !== value) {\n if (isEmpty(value)) {\n setTextValue('');\n } else {\n setTextValue(valueToItemMap.get(value as string)?.label || '');\n }\n }\n }, floatingPopoverRef);\n\n const onChange = (newValue: string | Array<string>) => {\n if (outerOnChange) {\n outerOnChange(newValue as any);\n }\n\n setInternalValue(newValue);\n };\n\n const handleClickArrow = () => {\n if (disabled || readOnly) {\n return;\n }\n\n if (isCurrentListOpen) {\n dispatchPath({ type: 'reset' });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n }\n\n dispatchFocusedPath({ type: 'reset' });\n };\n\n // Обработчик изменения значения в инпуте\n const handleTextValueChange = (e: ChangeEvent<HTMLInputElement>) => {\n setTextValue(e.target.value);\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'reset' });\n };\n\n // Обработчик чипов\n const handleChipsChange = (chipLabels: any[]) => {\n onChange(chipLabels.map((chipLabel) => labelToItemMap.get(chipLabel)!.value));\n };\n\n // Обработчик открытия/закрытия выпадающего списка\n const handleListToggle = (opened: boolean) => {\n if (disabled || readOnly) {\n return;\n }\n\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n }\n };\n\n // Обработчик выбора чекбоксов (только при multiple)\n const handleCheckboxChange = (item: ItemOptionTransformed) => {\n if (!multiple) {\n return;\n }\n\n const checkedCopy = new Map(checked);\n\n if (!checkedCopy.get(item.value)) {\n checkedCopy.set(item.value, true);\n updateDescendants(item, checkedCopy, true);\n } else {\n checkedCopy.set(item.value, false);\n updateDescendants(item, checkedCopy, false);\n }\n\n updateAncestors(item, checkedCopy);\n\n const newValues: Array<string> = [];\n\n valueToItemMap.forEach((item, key) => {\n if (checkedCopy.get(key)) {\n newValues.push(item.value);\n }\n });\n\n if (!alwaysOpened && closeAfterSelect) {\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n }\n\n if (onChange) {\n onChange(newValues);\n }\n\n // После выбора/снятия чекбокса скроллим к инпуту\n setTimeout(() => {\n if (inputRef.current) {\n inputRef.current.scrollIntoView({\n behavior: 'smooth',\n inline: 'start',\n });\n }\n }, 1);\n };\n\n // Обработчик клика по айтему выпадающего списка\n const handleItemClick = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (!isEmpty(item?.items)) {\n return;\n }\n\n if (multiple) {\n handleCheckboxChange(item);\n return;\n }\n\n if (e) {\n e.stopPropagation();\n }\n\n const isCurrentChecked = checked.get(item.value);\n\n if (!alwaysOpened && closeAfterSelect) {\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n }\n\n if (onChange) {\n onChange(isCurrentChecked ? '' : item.value);\n }\n };\n\n const getChips = (): string[] => {\n if (multiple && Array.isArray(value)) {\n if (value.length === 0) return [];\n\n if (isTargetAmount) {\n return [`Выбрано ${targetAmount || value.length}`];\n }\n\n const renderValueMapper =\n renderValue && ((stringValue: string) => renderValue(valueToItemMap.get(stringValue)!));\n const valueToItemMapper = (stringValue: string) => valueToItemMap.get(stringValue)!.label;\n\n return value.map(renderValueMapper || valueToItemMapper);\n }\n\n return [];\n };\n\n const handlePressDown = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item.items)) {\n handleItemClick(item, e);\n } else if (multiple) {\n handleCheckboxChange(item);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleListToggle,\n handlePressDown,\n setTextValue,\n });\n\n // В данном эффекте мы следим за изменениями value снаружи и вносим коррективы в дерево чекбоксов.\n // Пример: когда юзер очистил value извне, тогда нужно пройтись по элементам и выключить все чекбоксы.\n useLayoutEffect(() => {\n const checkedCopy = new Map(checked);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isEmpty(value)) {\n if (Array.isArray(value)) {\n value.forEach((val) => {\n checkedCopy.set(val, true);\n updateDescendants(valueToItemMap.get(val)!, checkedCopy, true);\n updateAncestors(valueToItemMap.get(val)!, checkedCopy);\n });\n } else {\n checkedCopy.set(value, 'done');\n updateSingleAncestors(valueToItemMap.get(value)!, checkedCopy, 'dot');\n }\n }\n\n setChecked(checkedCopy);\n\n setTextValue(valueToItemMap.get(value as string)?.label || '');\n\n // В deps мы кладем именно outerValue и internalValue, а не просто value.\n // Т.к. вначале нужно отфильтровать и провалидировать outerValue и результат положить в переменную.\n // А переменную, содержащую сложные типы данных, нельзя помещать в deps.\n }, [outerValue, internalValue, items]);\n\n return (\n <Root size={size} view={view} labelPlacement={labelPlacement} disabled={disabled} readOnly={readOnly}>\n <div>\n <Context.Provider\n value={{\n focusedPath,\n checked,\n multiple,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n valueToItemMap,\n treeId,\n }}\n >\n <FloatingPopover\n ref={floatingPopoverRef}\n opened={isCurrentListOpen}\n onToggle={(opened: boolean) => opened && handleListToggle(true)}\n placement={placement}\n portal={portal}\n listWidth={listWidth}\n target={(referenceRef) => (\n <StyledTextField\n ref={inputForkRef}\n inputWrapperRef={referenceRef}\n value={textValue}\n onChange={handleTextValueChange}\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n label={label}\n placeholder={placeholder}\n contentLeft={contentLeft}\n contentRight={\n <IconArrowWrapper disabled={disabled} onClick={handleClickArrow}>\n <StyledArrow\n color=\"inherit\"\n size={sizeToIconSize(size)}\n className={withArrowInverse}\n />\n </IconArrowWrapper>\n }\n textBefore={textBefore}\n textAfter={textAfter}\n onKeyDown={onKeyDown}\n leftHelper={helperText}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-controls={`${treeId}_tree_level_1`}\n aria-expanded={isCurrentListOpen}\n aria-activedescendant={\n activeDescendantItemValue ? getItemId(treeId, activeDescendantItemValue) : ''\n }\n {...(multiple\n ? {\n enumerationType: 'chip',\n chips: getChips(),\n onChangeChips: handleChipsChange,\n }\n : { enumerationType: 'plain' })}\n {...rest}\n onEnterDisabled // Пропс для отключения обработчика Enter внутри Textfield\n />\n )}\n >\n <Root\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n >\n <Ul\n role=\"tree\"\n id={`${treeId}_tree_level_1`}\n aria-multiselectable={Boolean(multiple)}\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n ref={targetRef}\n >\n {isEmpty(filteredItems) ? (\n <StyledEmptyState\n className={classes.emptyStateWrapper}\n size={size}\n description=\"Ничего не найдено\"\n />\n ) : (\n filteredItems.map((item, index) => (\n <Inner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listWidth={listWidth}\n />\n ))\n )}\n </Ul>\n </Root>\n </FloatingPopover>\n </Context.Provider>\n </div>\n </Root>\n );\n });\n\nexport const comboboxConfig = {\n name: 'Select',\n tag: 'div',\n layout: comboboxRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n readOnly: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n labelPlacement: 'outer',\n },\n};\n"],"names":["Context","createContext","comboboxRoot","Root","forwardRef","props","ref","_valueToItemMap$get","_valueToItemMap$get2","_getItemByFocused","multiple","outerValue","value","outerOnChange","onChange","isTargetAmount","targetAmount","items","_props$placement","placement","label","placeholder","helperText","contentLeft","textBefore","textAfter","_props$variant","variant","listOverflow","listHeight","listWidth","portal","renderItem","view","size","labelPlacement","_props$readOnly","readOnly","_props$disabled","disabled","_props$alwaysOpened","alwaysOpened","filter","outerCloseAfterSelect","closeAfterSelect","renderValue","rest","_objectWithoutProperties","_excluded","transformedItems","useMemo","initialItemsTransform","_useMemo","getTreeMaps","_useMemo2","_slicedToArray","valueToCheckedMap","valueToItemMap","labelToItemMap","_useState","useState","get","_useState2","textValue","setTextValue","_useState3","_useState4","internalValue","setInternalValue","undefined","getInitialValue","inputRef","useRef","floatingPopoverRef","inputForkRef","useForkRef","treeId","safeUseId","filteredItems","filterItems","_useMemo3","getPathMap","_useMemo4","pathMap","focusedToValueMap","_useReducer","useReducer","pathReducer","_useReducer2","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useState5","_useState6","checked","setChecked","isCurrentListOpen","Boolean","activeDescendantItemValue","getItemByFocused","withArrowInverse","classes","arrowInverse","targetRef","useOutsideClick","type","isEmpty","_valueToItemMap$get3","newValue","handleClickArrow","handleTextValueChange","e","target","handleChipsChange","chipLabels","map","chipLabel","handleListToggle","opened","handleCheckboxChange","item","checkedCopy","Map","set","updateDescendants","updateAncestors","newValues","forEach","key","push","setTimeout","current","scrollIntoView","behavior","inline","handleItemClick","stopPropagation","isCurrentChecked","getChips","Array","isArray","length","concat","renderValueMapper","stringValue","valueToItemMapper","handlePressDown","_useKeyNavigation","useKeyNavigation","onKeyDown","useLayoutEffect","_valueToItemMap$get4","_","val","updateSingleAncestors","React","createElement","Provider","FloatingPopover","onToggle","referenceRef","StyledTextField","_extends","inputWrapperRef","contentRight","IconArrowWrapper","onClick","StyledArrow","color","sizeToIconSize","className","leftHelper","role","getItemId","enumerationType","chips","onChangeChips","onEnterDisabled","Ul","id","StyledEmptyState","emptyStateWrapper","description","index","Inner","currentLevel","comboboxConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IA8BaA,OAAO,gBAAGC,aAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBACxFC,UAAU,CAAkC,UAACC,KAAK,EAAEC,GAAG,EAAK;AAAA,IAAA,IAAAC,mBAAA,EAAAC,oBAAA,EAAAC,iBAAA,CAAA;AACxD,IAAA,IACIC,QAAQ,GA6BRL,KAAK,CA7BLK,QAAQ;MACDC,UAAU,GA4BjBN,KAAK,CA5BLO,KAAK;MACKC,aAAa,GA2BvBR,KAAK,CA3BLS,QAAQ;MACRC,cAAc,GA0Bd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AAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAG;AACTC,IAAAA,cAAc,EAAE,OAAA;AACpB,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"Combobox.js","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, createContext, useLayoutEffect, useRef } from 'react';\nimport type { ChangeEvent } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../engines';\nimport { isEmpty } from '../../../utils';\nimport { useOutsideClick } from '../../../hooks';\nimport { sizeToIconSize } from '../../Select/utils';\n\nimport { classes } from './Combobox.tokens';\nimport { FloatingPopover } from './FloatingPopover';\nimport { useKeyNavigation, getItemByFocused } from './hooks/useKeyboardNavigation';\nimport {\n initialItemsTransform,\n updateAncestors,\n updateDescendants,\n updateSingleAncestors,\n filterItems,\n getItemId,\n getInitialValue,\n} from './utils';\nimport { Inner, StyledTextField } from './ui';\nimport { pathReducer, focusedPathReducer } from './reducers';\nimport { getPathMap, getTreeMaps } from './hooks/getPathMaps';\nimport { Ul, base, StyledArrow, IconArrowWrapper, StyledEmptyState } from './Combobox.styles';\nimport type { ItemContext, ComboboxProps } from './Combobox.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { ItemOptionTransformed } from './ui/Inner/ui/Item/Item.types';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Поле ввода с выпадающим списком и возможностью фильтрации и выбора элементов.\n */\nexport const comboboxRoot = (Root: RootProps<HTMLInputElement, Omit<ComboboxProps, 'items'>>) =>\n forwardRef<HTMLInputElement, ComboboxProps>((props, ref) => {\n const {\n multiple,\n value: outerValue,\n onChange: outerOnChange,\n isTargetAmount,\n targetAmount,\n items,\n placement = 'bottom-start',\n label,\n placeholder,\n helperText,\n contentLeft,\n textBefore,\n textAfter,\n variant = 'normal',\n listOverflow,\n listHeight,\n listWidth,\n portal,\n renderItem,\n view,\n size,\n labelPlacement,\n readOnly = false,\n disabled = false,\n alwaysOpened = false,\n filter,\n closeAfterSelect: outerCloseAfterSelect,\n renderValue,\n ...rest\n } = props;\n const transformedItems = useMemo(() => initialItemsTransform(items || []), [items]);\n\n // Создаем структуры для быстрой работы с деревом\n const [valueToCheckedMap, valueToItemMap, labelToItemMap] = useMemo(() => getTreeMaps(transformedItems), [\n items,\n ]);\n\n const [textValue, setTextValue] = useState(valueToItemMap.get(outerValue as string)?.label || '');\n const [internalValue, setInternalValue] = useState<string | string[]>(multiple ? [] : '');\n\n const value =\n outerValue !== null && outerValue !== undefined\n ? getInitialValue(outerValue, valueToItemMap)\n : internalValue;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const floatingPopoverRef = useRef<HTMLDivElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n const treeId = safeUseId();\n\n const filteredItems = filterItems(\n transformedItems,\n textValue,\n valueToItemMap.get(value as string)?.label as string,\n filter,\n );\n\n const [pathMap, focusedToValueMap] = useMemo(() => getPathMap(filteredItems), [filteredItems, textValue]);\n\n // Состояния дерева элементов\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n const [checked, setChecked] = useState(valueToCheckedMap);\n\n const isCurrentListOpen = alwaysOpened || Boolean(path[0]);\n const activeDescendantItemValue = getItemByFocused(focusedPath, focusedToValueMap)?.value || '';\n const withArrowInverse = isCurrentListOpen ? classes.arrowInverse : undefined;\n const closeAfterSelect = outerCloseAfterSelect ?? !multiple;\n\n // Логика работы при клике за пределами выпадающего списка\n const targetRef = useOutsideClick<HTMLUListElement>(() => {\n if (!isCurrentListOpen) {\n return;\n }\n\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n\n // Проверяем, отличается ли значение в инпуте от выбранного value после закрытия дропдауна.\n // Если изменилось, то возвращаем label выбранного айтема.\n // Если нет выбранного элемента, то стираем значение инпута.\n if (textValue !== value) {\n if (isEmpty(value)) {\n setTextValue('');\n } else {\n setTextValue(valueToItemMap.get(value as string)?.label || '');\n }\n }\n }, floatingPopoverRef);\n\n const onChange = (newValue: string | Array<string>) => {\n if (outerOnChange) {\n outerOnChange(newValue as any);\n }\n\n setInternalValue(newValue);\n };\n\n const handleClickArrow = () => {\n if (disabled || readOnly) {\n return;\n }\n\n if (isCurrentListOpen) {\n dispatchPath({ type: 'reset' });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n }\n\n dispatchFocusedPath({ type: 'reset' });\n };\n\n // Обработчик изменения значения в инпуте\n const handleTextValueChange = (e: ChangeEvent<HTMLInputElement>) => {\n setTextValue(e.target.value);\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'reset' });\n };\n\n // Обработчик чипов\n const handleChipsChange = (chipLabels: any[]) => {\n if (!Array.isArray(value)) return;\n\n // TODO: #1564\n // Из лейблов чипов получаем value у item и далее прокидываем его в onChange.\n if (renderValue && !isTargetAmount) {\n const resultValues = [...value];\n\n value.forEach((_, index) => {\n const labelAfterRenderValue = renderValue(\n labelToItemMap.get(valueToItemMap.get(value[index])!.label)!,\n );\n\n if (!chipLabels.includes(labelAfterRenderValue)) {\n resultValues.splice(index, 1);\n }\n });\n\n onChange(resultValues);\n } else {\n onChange(chipLabels.map((chipLabel) => labelToItemMap.get(chipLabel)!.value));\n }\n };\n\n // Обработчик открытия/закрытия выпадающего списка\n const handleListToggle = (opened: boolean) => {\n if (disabled || readOnly) {\n return;\n }\n\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n }\n };\n\n // Обработчик выбора чекбоксов (только при multiple)\n const handleCheckboxChange = (item: ItemOptionTransformed) => {\n if (!multiple) {\n return;\n }\n\n const checkedCopy = new Map(checked);\n\n if (!checkedCopy.get(item.value)) {\n checkedCopy.set(item.value, true);\n updateDescendants(item, checkedCopy, true);\n } else {\n checkedCopy.set(item.value, false);\n updateDescendants(item, checkedCopy, false);\n }\n\n updateAncestors(item, checkedCopy);\n\n const newValues: Array<string> = [];\n\n valueToItemMap.forEach((item, key) => {\n if (checkedCopy.get(key)) {\n newValues.push(item.value);\n }\n });\n\n if (!alwaysOpened && closeAfterSelect) {\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n }\n\n if (onChange) {\n onChange(newValues);\n }\n\n // После выбора/снятия чекбокса скроллим к инпуту\n setTimeout(() => {\n if (inputRef.current) {\n inputRef.current.scrollIntoView({\n behavior: 'smooth',\n inline: 'start',\n });\n }\n }, 1);\n };\n\n // Обработчик клика по айтему выпадающего списка\n const handleItemClick = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (!isEmpty(item?.items)) {\n return;\n }\n\n if (multiple) {\n handleCheckboxChange(item);\n return;\n }\n\n if (e) {\n e.stopPropagation();\n }\n\n const isCurrentChecked = checked.get(item.value);\n\n if (!alwaysOpened && closeAfterSelect) {\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n }\n\n if (onChange) {\n onChange(isCurrentChecked ? '' : item.value);\n }\n };\n\n const getChips = (): string[] => {\n if (multiple && Array.isArray(value)) {\n if (value.length === 0) return [];\n\n if (isTargetAmount) {\n return [`Выбрано ${targetAmount || value.length}`];\n }\n\n const renderValueMapper =\n renderValue && ((stringValue: string) => renderValue(valueToItemMap.get(stringValue)!));\n const valueToItemMapper = (stringValue: string) => valueToItemMap.get(stringValue)!.label;\n\n return value.map(renderValueMapper || valueToItemMapper);\n }\n\n return [];\n };\n\n const handlePressDown = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item.items)) {\n handleItemClick(item, e);\n } else if (multiple) {\n handleCheckboxChange(item);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleListToggle,\n handlePressDown,\n setTextValue,\n });\n\n // В данном эффекте мы следим за изменениями value снаружи и вносим коррективы в дерево чекбоксов.\n // Пример: когда юзер очистил value извне, тогда нужно пройтись по элементам и выключить все чекбоксы.\n useLayoutEffect(() => {\n const checkedCopy = new Map(checked);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isEmpty(value)) {\n if (Array.isArray(value)) {\n value.forEach((val) => {\n checkedCopy.set(val, true);\n updateDescendants(valueToItemMap.get(val)!, checkedCopy, true);\n updateAncestors(valueToItemMap.get(val)!, checkedCopy);\n });\n } else {\n checkedCopy.set(value, 'done');\n updateSingleAncestors(valueToItemMap.get(value)!, checkedCopy, 'dot');\n }\n }\n\n setChecked(checkedCopy);\n\n setTextValue(valueToItemMap.get(value as string)?.label || '');\n\n // В deps мы кладем именно outerValue и internalValue, а не просто value.\n // Т.к. вначале нужно отфильтровать и провалидировать outerValue и результат положить в переменную.\n // А переменную, содержащую сложные типы данных, нельзя помещать в deps.\n }, [outerValue, internalValue, items]);\n\n return (\n <Root size={size} view={view} labelPlacement={labelPlacement} disabled={disabled} readOnly={readOnly}>\n <div>\n <Context.Provider\n value={{\n focusedPath,\n checked,\n multiple,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n treeId,\n }}\n >\n <FloatingPopover\n ref={floatingPopoverRef}\n opened={isCurrentListOpen}\n onToggle={(opened: boolean) => opened && handleListToggle(true)}\n placement={placement}\n portal={portal}\n listWidth={listWidth}\n target={(referenceRef) => (\n <StyledTextField\n ref={inputForkRef}\n inputWrapperRef={referenceRef}\n value={textValue}\n onChange={handleTextValueChange}\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n label={label}\n placeholder={placeholder}\n contentLeft={contentLeft}\n contentRight={\n <IconArrowWrapper disabled={disabled} onClick={handleClickArrow}>\n <StyledArrow\n color=\"inherit\"\n size={sizeToIconSize(size)}\n className={withArrowInverse}\n />\n </IconArrowWrapper>\n }\n textBefore={textBefore}\n textAfter={textAfter}\n onKeyDown={onKeyDown}\n leftHelper={helperText}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-controls={`${treeId}_tree_level_1`}\n aria-expanded={isCurrentListOpen}\n aria-activedescendant={\n activeDescendantItemValue ? getItemId(treeId, activeDescendantItemValue) : ''\n }\n {...(multiple\n ? {\n enumerationType: 'chip',\n chips: getChips(),\n onChangeChips: handleChipsChange,\n }\n : { enumerationType: 'plain' })}\n {...rest}\n onEnterDisabled // Пропс для отключения обработчика Enter внутри Textfield\n />\n )}\n >\n <Root\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n >\n <Ul\n role=\"tree\"\n id={`${treeId}_tree_level_1`}\n aria-multiselectable={Boolean(multiple)}\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n ref={targetRef}\n >\n {isEmpty(filteredItems) ? (\n <StyledEmptyState\n className={classes.emptyStateWrapper}\n size={size}\n description=\"Ничего не найдено\"\n />\n ) : (\n filteredItems.map((item, index) => (\n <Inner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listWidth={listWidth}\n />\n ))\n )}\n </Ul>\n </Root>\n </FloatingPopover>\n </Context.Provider>\n </div>\n </Root>\n );\n });\n\nexport const comboboxConfig = {\n name: 'Select',\n tag: 'div',\n layout: comboboxRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n readOnly: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n labelPlacement: 'outer',\n },\n};\n"],"names":["Context","createContext","comboboxRoot","Root","forwardRef","props","ref","_valueToItemMap$get","_valueToItemMap$get2","_getItemByFocused","multiple","outerValue","value","outerOnChange","onChange","isTargetAmount","targetAmount","items","_props$placement","placement","label","placeholder","helperText","contentLeft","textBefore","textAfter","_props$variant","variant","listOverflow","listHeight","listWidth","portal","renderItem","view","size","labelPlacement","_props$readOnly","readOnly","_props$disabled","disabled","_props$alwaysOpened","alwaysOpened","filter","outerCloseAfterSelect","closeAfterSelect","renderValue","rest","_objectWithoutProperties","_excluded","transformedItems","useMemo","initialItemsTransform","_useMemo","getTreeMaps","_useMemo2","_slicedToArray","valueToCheckedMap","valueToItemMap","labelToItemMap","_useState","useState","get","_useState2","textValue","setTextValue","_useState3","_useState4","internalValue","setInternalValue","undefined","getInitialValue","inputRef","useRef","floatingPopoverRef","inputForkRef","useForkRef","treeId","safeUseId","filteredItems","filterItems","_useMemo3","getPathMap","_useMemo4","pathMap","focusedToValueMap","_useReducer","useReducer","pathReducer","_useReducer2","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useState5","_useState6","checked","setChecked","isCurrentListOpen","Boolean","activeDescendantItemValue","getItemByFocused","withArrowInverse","classes","arrowInverse","targetRef","useOutsideClick","type","isEmpty","_valueToItemMap$get3","newValue","handleClickArrow","handleTextValueChange","e","target","handleChipsChange","chipLabels","Array","isArray","resultValues","_toConsumableArray","forEach","_","index","labelAfterRenderValue","includes","splice","map","chipLabel","handleListToggle","opened","handleCheckboxChange","item","checkedCopy","Map","set","updateDescendants","updateAncestors","newValues","key","push","setTimeout","current","scrollIntoView","behavior","inline","handleItemClick","stopPropagation","isCurrentChecked","getChips","length","concat","renderValueMapper","stringValue","valueToItemMapper","handlePressDown","_useKeyNavigation","useKeyNavigation","onKeyDown","useLayoutEffect","_valueToItemMap$get4","val","updateSingleAncestors","React","createElement","Provider","FloatingPopover","onToggle","referenceRef","StyledTextField","_extends","inputWrapperRef","contentRight","IconArrowWrapper","onClick","StyledArrow","color","sizeToIconSize","className","leftHelper","role","getItemId","enumerationType","chips","onChangeChips","onEnterDisabled","Ul","id","StyledEmptyState","emptyStateWrapper","description","Inner","currentLevel","comboboxConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;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ref) {
|
|
35
35
|
handleItemClick = _useContext.handleItemClick,
|
36
36
|
variant = _useContext.variant,
|
37
37
|
renderItem = _useContext.renderItem,
|
38
|
-
valueToItemMap = _useContext.valueToItemMap,
|
39
38
|
treeId = _useContext.treeId;
|
40
39
|
var disabledClassName = disabled ? classes.dropdownItemIsDisabled : undefined;
|
41
40
|
var focusedClass = currentLevel === focusedPath.length - 1 && index === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? classes.dropdownItemIsFocused : undefined;
|
@@ -89,7 +88,7 @@ var Item = function Item(_ref) {
|
|
89
88
|
}))), !multiple && checked.get(item.value) === 'done' && /*#__PURE__*/React.createElement(IconDone, {
|
90
89
|
size: sizeToIconSize(size, variant),
|
91
90
|
color: "inherit"
|
92
|
-
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(
|
91
|
+
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(item)) : /*#__PURE__*/React.createElement(StyledWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
|
93
92
|
view: "default",
|
94
93
|
size: "l",
|
95
94
|
contentLeft: contentLeft,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Item.js","sources":["../../../../../../../../src/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.tsx"],"sourcesContent":["import React, { useRef, FC, useContext } from 'react';\n\nimport { sizeToIconSize, getItemId } from '../../../../utils';\nimport { classes } from '../../../../Combobox.tokens';\nimport { cx, isEmpty } from '../../../../../../../utils';\nimport { IconDisclosureRightCentered, IconDone } from '../../../../../../_Icon';\nimport { Context } from '../../../../Combobox';\nimport { useDidMountEffect } from '../../../../../../../hooks';\n\nimport { ItemProps } from './Item.types';\nimport {\n StyledWrapper,\n StyledText,\n Wrapper,\n DisclosureIconWrapper,\n StyledCheckbox,\n IconWrapper,\n StyledIndicator,\n StyledCheckboxWrapper,\n StyledCell,\n} from './Item.styles';\n\nexport const Item: FC<ItemProps> = ({\n item,\n path,\n currentLevel,\n index,\n ariaControls,\n ariaExpanded,\n ariaLevel,\n ariaLabel,\n}) => {\n const { value, label, disabled, contentLeft, contentRight } = item;\n\n const ref = useRef<HTMLLIElement | null>(null);\n\n const {\n focusedPath,\n checked,\n multiple,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n
|
1
|
+
{"version":3,"file":"Item.js","sources":["../../../../../../../../src/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.tsx"],"sourcesContent":["import React, { useRef, FC, useContext } from 'react';\n\nimport { sizeToIconSize, getItemId } from '../../../../utils';\nimport { classes } from '../../../../Combobox.tokens';\nimport { cx, isEmpty } from '../../../../../../../utils';\nimport { IconDisclosureRightCentered, IconDone } from '../../../../../../_Icon';\nimport { Context } from '../../../../Combobox';\nimport { useDidMountEffect } from '../../../../../../../hooks';\n\nimport { ItemProps } from './Item.types';\nimport {\n StyledWrapper,\n StyledText,\n Wrapper,\n DisclosureIconWrapper,\n StyledCheckbox,\n IconWrapper,\n StyledIndicator,\n StyledCheckboxWrapper,\n StyledCell,\n} from './Item.styles';\n\nexport const Item: FC<ItemProps> = ({\n item,\n path,\n currentLevel,\n index,\n ariaControls,\n ariaExpanded,\n ariaLevel,\n ariaLabel,\n}) => {\n const { value, label, disabled, contentLeft, contentRight } = item;\n\n const ref = useRef<HTMLLIElement | null>(null);\n\n const {\n focusedPath,\n checked,\n multiple,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n treeId,\n } = useContext(Context);\n\n const disabledClassName = disabled ? classes.dropdownItemIsDisabled : undefined;\n\n const focusedClass =\n currentLevel === focusedPath.length - 1 && index === focusedPath?.[currentLevel]\n ? classes.dropdownItemIsFocused\n : undefined;\n const activeClass = value === path?.[currentLevel + 1] ? classes.dropdownItemIsActive : undefined;\n\n useDidMountEffect(() => {\n if (focusedClass && ref?.current) {\n ref.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, [focusedClass]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) return;\n\n e.stopPropagation();\n\n handleCheckboxChange(item);\n };\n\n const handleClick = (e: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n e.stopPropagation();\n return;\n }\n\n handleItemClick(item, e);\n };\n\n return (\n <Wrapper\n className={cx(disabledClassName, focusedClass, activeClass)}\n id={getItemId(treeId, value)}\n ref={ref}\n onClick={handleClick}\n variant={variant}\n role=\"treeitem\"\n aria-controls={ariaControls}\n aria-expanded={ariaExpanded}\n aria-level={ariaLevel}\n aria-label={ariaLabel}\n aria-selected={Boolean(checked.get(item.value))}\n >\n <IconWrapper variant={variant}>\n {multiple && (\n <StyledCheckboxWrapper onClick={(e) => e.stopPropagation()}>\n <StyledCheckbox\n checked={Boolean(checked.get(item.value))}\n indeterminate={checked.get(item.value) === 'indeterminate'}\n onChange={handleChange}\n />\n </StyledCheckboxWrapper>\n )}\n\n {!multiple && checked.get(item.value) === 'dot' && <StyledIndicator size=\"s\" view=\"default\" />}\n\n {!multiple && checked.get(item.value) === 'done' && (\n <IconDone size={sizeToIconSize(size, variant)} color=\"inherit\" />\n )}\n </IconWrapper>\n\n {renderItem ? (\n <StyledText>{renderItem(item)}</StyledText>\n ) : (\n <StyledWrapper>\n <StyledCell\n view=\"default\"\n size=\"l\"\n contentLeft={contentLeft}\n contentRight={contentRight}\n alignContentLeft=\"center\"\n alignContentRight=\"center\"\n title={label}\n />\n </StyledWrapper>\n )}\n\n {!isEmpty(item.items) && (\n <DisclosureIconWrapper>\n <IconDisclosureRightCentered size={sizeToIconSize(size, variant)} color=\"inherit\" />\n </DisclosureIconWrapper>\n )}\n </Wrapper>\n );\n};\n"],"names":["Item","_ref","item","path","currentLevel","index","ariaControls","ariaExpanded","ariaLevel","ariaLabel","value","label","disabled","contentLeft","contentRight","ref","useRef","_useContext","useContext","Context","focusedPath","checked","multiple","size","handleCheckboxChange","handleItemClick","variant","renderItem","treeId","disabledClassName","classes","dropdownItemIsDisabled","undefined","focusedClass","length","dropdownItemIsFocused","activeClass","dropdownItemIsActive","useDidMountEffect","current","scrollIntoView","behavior","block","inline","handleChange","e","stopPropagation","handleClick","React","createElement","Wrapper","className","cx","id","getItemId","onClick","role","Boolean","get","IconWrapper","StyledCheckboxWrapper","StyledCheckbox","indeterminate","onChange","_StyledIndicator","StyledIndicator","view","IconDone","sizeToIconSize","color","StyledText","StyledWrapper","StyledCell","alignContentLeft","alignContentRight","title","isEmpty","items","DisclosureIconWrapper","IconDisclosureRightCentered"],"mappings":";;;;;;;;;;;;;IAsBaA,IAAmB,GAAG,SAAtBA,IAAmBA,CAAAC,IAAA,EAS1B;AAAA,EAAA,IARFC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,SAAS,GAAAR,IAAA,CAATQ,SAAS,CAAA;AAET,EAAA,IAAQC,KAAK,GAAiDR,IAAI,CAA1DQ,KAAK;IAAEC,KAAK,GAA0CT,IAAI,CAAnDS,KAAK;IAAEC,QAAQ,GAAgCV,IAAI,CAA5CU,QAAQ;IAAEC,WAAW,GAAmBX,IAAI,CAAlCW,WAAW;IAAEC,YAAY,GAAKZ,IAAI,CAArBY,YAAY,CAAA;AAEzD,EAAA,IAAMC,GAAG,GAAGC,MAAM,CAAuB,IAAI,CAAC,CAAA;AAE9C,EAAA,IAAAC,WAAA,GAUIC,UAAU,CAACC,OAAO,CAAC;IATnBC,WAAW,GAAAH,WAAA,CAAXG,WAAW;IACXC,OAAO,GAAAJ,WAAA,CAAPI,OAAO;IACPC,QAAQ,GAAAL,WAAA,CAARK,QAAQ;IACRC,IAAI,GAAAN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AAK,EAAEhE,KAAAA;GACV,CACU,CAClB,EAEA,CAACiE,OAAO,CAAC1E,IAAI,CAAC2E,KAAK,CAAC,iBACjB7B,KAAA,CAAAC,aAAA,CAAC6B,qBAAqB,qBAClB9B,KAAA,CAAAC,aAAA,CAAC8B,2BAA2B,EAAA;AAACxD,IAAAA,IAAI,EAAE6C,cAAc,CAAC7C,IAAI,EAAEG,OAAO,CAAE;AAAC2C,IAAAA,KAAK,EAAC,SAAA;GAAW,CAChE,CAEtB,CAAC,CAAA;AAElB;;;;"}
|
@@ -26,11 +26,12 @@
|
|
26
26
|
|
27
27
|
.CellTextbox_styles_rgpies_cz0uqdu__c842929b{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-cell-textbox-gap);}
|
28
28
|
|
29
|
-
.
|
29
|
+
.DropdownItem_styles_14yih1y_c1gkzlls__bf539568{--plasma-cell-title-color:var(--text-primary);--plasma-cell-background-color:var(--plasma-colors-transparent);--plasma-cell-padding:var(--plasma-dropdown-cell-padding);--plasma-cell-padding-left-content:var(--plasma-dropdown-cell-padding-left-content);--plasma-cell-padding-content:var(--plasma-dropdown-cell-padding-content);--plasma-cell-padding-right-content:var(--plasma-dropdown-cell-padding-right-content);--plasma-cell-textbox-gap:var(--plasma-dropdown-cell-textbox-gap);--plasma-cell-gap:var(--plasma-dropdown-cell-gap);--plasma-cell-title-font-family:var(--plasma-dropdown-cell-title-font-family);--plasma-cell-title-font-size:var(--plasma-dropdown-cell-title-font-size);--plasma-cell-title-font-style:var(--plasma-dropdown-cell-title-font-style);--plasma-cell-title-font-weight:var(--plasma-dropdown-cell-title-font-weight);--plasma-cell-title-letter-spacing:var(--plasma-dropdown-cell-title-letter-spacing);--plasma-cell-title-line-height:var(--plasma-dropdown-cell-title-line-height);width:100%;}
|
30
30
|
|
31
|
-
.
|
32
|
-
.
|
33
|
-
.
|
31
|
+
.DropdownItem_styles_14yih1y_d1m97l2m__bf539568{line-height:0;color:var(--text-secondary);}
|
32
|
+
.DropdownItem_styles_14yih1y_doib72h__bf539568{height:1px;margin-top:var(--doib72h-0);margin-right:var(--plasma-dropdown-divider-margin-right);margin-bottom:var(--doib72h-1);margin-left:var(--plasma-dropdown-divider-margin-left);background:var(--plasma-dropdown-divider-color);}
|
33
|
+
.DropdownItem_styles_14yih1y_w6l2f0g__bf539568{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:var(--plasma-dropdown-item-height);margin:0;box-sizing:content-box;padding:var(--w6l2f0g-0);font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background-color:var(--plasma-colors-transparent);border-radius:var(--plasma-dropdown-border-radius);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-right:0.125rem solid transparent;border-left:0.125rem solid transparent;background-clip:padding-box;position:relative;}.DropdownItem_styles_14yih1y_w6l2f0g__bf539568:hover:not(.DropdownItem_styles_14yih1y_dropdownItemIsDisabled__bf539568){cursor:pointer;background-color:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_14yih1y_w6l2f0g__bf539568.DropdownItem_styles_14yih1y_dropdownItemIsActive__bf539568{background-color:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_14yih1y_w6l2f0g__bf539568.DropdownItem_styles_14yih1y_dropdownItemIsDisabled__bf539568{opacity:0.4;cursor:not-allowed;}.DropdownItem_styles_14yih1y_w6l2f0g__bf539568:focus{outline:none;}.DropdownItem_styles_14yih1y_w6l2f0g__bf539568::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.DropdownItem_styles_14yih1y_w6l2f0g__bf539568.DropdownItem_styles_14yih1y_dropdownItemIsFocused__bf539568:before{outline:none;box-shadow:0 0 0 0.0625rem var(--surface-accent);}
|
34
|
+
.DropdownItem_styles_14yih1y_r1jav4ek__bf539568{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-flex:1;-ms-flex:1;flex:1;}
|
34
35
|
|
35
36
|
.DropdownItem_styles_1lyg81y_s1iqs5in__b17ea060{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-dropdown-item-content-left-width);color:var(--plasma-dropdown-item-content-left-color);}
|
36
37
|
.DropdownItem_styles_1lyg81y_sfg3dyd__b17ea060{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-dropdown-item-content-right-width);color:var(--plasma-dropdown-item-content-right-color);}
|