@salutejs/plasma-new-hope 0.229.0-canary.1666.12456056975.0 → 0.230.0-canary.1670.12462995068.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/cjs/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/cjs/components/Breadcrumbs/utils/index.js +38 -0
- package/cjs/components/Breadcrumbs/utils/index.js.map +1 -1
- package/cjs/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +3 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +75 -0
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +112 -0
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.js +3 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +25 -0
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Select/Select.js +3 -2
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.css +109 -0
- package/cjs/components/Select/ui/Inner/Inner.js +1 -1
- package/cjs/components/Select/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.css +112 -0
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -2
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.css +91 -0
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +7 -0
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/cjs/components/TextArea/TextArea.js +6 -0
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextField/TextField.js +1 -0
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/engines/common.js +36 -0
- package/cjs/engines/common.js.map +1 -1
- package/cjs/engines/linaria.js +3 -3
- package/cjs/engines/linaria.js.map +1 -1
- package/emotion/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/emotion/cjs/components/Breadcrumbs/utils/index.js +37 -1
- package/emotion/cjs/components/Calendar/utils/getDateWithModification.js +3 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +4 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/cjs/components/Dropdown/Dropdown.js +4 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/emotion/cjs/components/Select/Select.js +4 -3
- package/emotion/cjs/components/Select/ui/Inner/Inner.js +3 -3
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +3 -3
- package/emotion/cjs/components/TextArea/TextArea.js +7 -1
- package/emotion/cjs/components/TextField/TextField.js +2 -1
- package/emotion/cjs/engines/common.js +42 -2
- package/emotion/cjs/engines/emotion.js +4 -4
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/emotion/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/emotion/es/components/Breadcrumbs/utils/index.js +35 -0
- package/emotion/es/components/Calendar/utils/getDateWithModification.js +1 -1
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +2 -2
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/es/components/Dropdown/Dropdown.js +2 -2
- package/emotion/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/emotion/es/components/Select/Select.js +2 -2
- package/emotion/es/components/Select/ui/Inner/Inner.js +1 -1
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +1 -1
- package/emotion/es/components/TextArea/TextArea.js +8 -2
- package/emotion/es/components/TextField/TextField.js +2 -1
- package/emotion/es/engines/common.js +40 -0
- package/emotion/es/engines/emotion.js +2 -2
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/es/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/es/components/Breadcrumbs/utils/index.js +37 -1
- package/es/components/Breadcrumbs/utils/index.js.map +1 -1
- package/es/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +3 -3
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +75 -0
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +112 -0
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Dropdown/Dropdown.js +3 -3
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +25 -0
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Select/Select.js +3 -3
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.css +109 -0
- package/es/components/Select/ui/Inner/Inner.js +1 -1
- package/es/components/Select/ui/Inner/Inner.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.css +112 -0
- package/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Slider/components/Double/Double.css +91 -0
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +7 -0
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/es/components/TextArea/TextArea.js +7 -1
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextField/TextField.js +1 -0
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/engines/common.js +36 -2
- package/es/engines/common.js.map +1 -1
- package/es/engines/linaria.js +1 -1
- package/es/engines/linaria.js.map +1 -1
- package/package.json +5 -17
- package/styled-components/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/styled-components/cjs/components/Breadcrumbs/utils/index.js +37 -1
- package/styled-components/cjs/components/Calendar/utils/getDateWithModification.js +3 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +4 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/cjs/components/Dropdown/Dropdown.js +4 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/styled-components/cjs/components/Select/Select.js +4 -3
- package/styled-components/cjs/components/Select/ui/Inner/Inner.js +3 -3
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +3 -3
- package/styled-components/cjs/components/TextArea/TextArea.js +6 -0
- package/styled-components/cjs/components/TextField/TextField.js +1 -0
- package/styled-components/cjs/engines/common.js +42 -2
- package/styled-components/cjs/engines/styled-components.js +3 -3
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/styled-components/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/styled-components/es/components/Breadcrumbs/utils/index.js +35 -0
- package/styled-components/es/components/Calendar/utils/getDateWithModification.js +1 -1
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +2 -2
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/es/components/Dropdown/Dropdown.js +2 -2
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/styled-components/es/components/Select/Select.js +2 -2
- package/styled-components/es/components/Select/ui/Inner/Inner.js +1 -1
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +1 -1
- package/styled-components/es/components/TextArea/TextArea.js +7 -1
- package/styled-components/es/components/TextField/TextField.js +1 -0
- package/styled-components/es/engines/common.js +40 -0
- package/styled-components/es/engines/styled-components.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/types/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/types/components/Breadcrumbs/utils/index.d.ts +5 -2
- package/types/components/Breadcrumbs/utils/index.d.ts.map +1 -1
- package/types/components/Calendar/utils/getDateWithModification.d.ts +1 -1
- package/types/components/Calendar/utils/getDateWithModification.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts +2 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +2 -1
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts +2 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/engines/common.d.ts +3 -1
- package/types/engines/common.d.ts.map +1 -1
- package/cjs/components/Breadcrumbs/ui/BreadcrumbShorter/BreadcrumbShorter.css +0 -3
- package/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -44
- package/cjs/components/Breadcrumbs/utils/getShortItems.js.map +0 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -10
- package/cjs/components/Combobox/ComboboxNew/Combobox.context.js.map +0 -1
- package/cjs/components/Dropdown/Dropdown.context.js +0 -10
- package/cjs/components/Dropdown/Dropdown.context.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.css +0 -27
- package/cjs/components/Select/Select.context.js +0 -10
- package/cjs/components/Select/Select.context.js.map +0 -1
- package/cjs/engines/utils.js +0 -40
- package/cjs/engines/utils.js.map +0 -1
- package/emotion/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -42
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -8
- package/emotion/cjs/components/Dropdown/Dropdown.context.js +0 -8
- package/emotion/cjs/components/Select/Select.context.js +0 -8
- package/emotion/cjs/engines/utils.js +0 -42
- package/emotion/es/components/Breadcrumbs/utils/getShortItems.js +0 -35
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -2
- package/emotion/es/components/Dropdown/Dropdown.context.js +0 -2
- package/emotion/es/components/Select/Select.context.js +0 -2
- package/emotion/es/engines/utils.js +0 -36
- package/es/components/Breadcrumbs/ui/BreadcrumbShorter/BreadcrumbShorter.css +0 -3
- package/es/components/Breadcrumbs/utils/getShortItems.js +0 -39
- package/es/components/Breadcrumbs/utils/getShortItems.js.map +0 -1
- package/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -6
- package/es/components/Combobox/ComboboxNew/Combobox.context.js.map +0 -1
- package/es/components/Dropdown/Dropdown.context.js +0 -6
- package/es/components/Dropdown/Dropdown.context.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.css +0 -27
- package/es/components/Select/Select.context.js +0 -6
- package/es/components/Select/Select.context.js.map +0 -1
- package/es/engines/utils.js +0 -35
- package/es/engines/utils.js.map +0 -1
- package/styled-components/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -42
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -8
- package/styled-components/cjs/components/Dropdown/Dropdown.context.js +0 -8
- package/styled-components/cjs/components/Select/Select.context.js +0 -8
- package/styled-components/cjs/engines/utils.js +0 -42
- package/styled-components/es/components/Breadcrumbs/utils/getShortItems.js +0 -35
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -2
- package/styled-components/es/components/Dropdown/Dropdown.context.js +0 -2
- package/styled-components/es/components/Select/Select.context.js +0 -2
- package/styled-components/es/engines/utils.js +0 -36
- package/types/components/Breadcrumbs/utils/getShortItems.d.ts +0 -6
- package/types/components/Breadcrumbs/utils/getShortItems.d.ts.map +0 -1
- package/types/components/Combobox/ComboboxNew/Combobox.context.d.ts +0 -4
- package/types/components/Combobox/ComboboxNew/Combobox.context.d.ts.map +0 -1
- package/types/components/Dropdown/Dropdown.context.d.ts +0 -4
- package/types/components/Dropdown/Dropdown.context.d.ts.map +0 -1
- package/types/components/Select/Select.context.d.ts +0 -4
- package/types/components/Select/Select.context.d.ts.map +0 -1
- package/types/engines/utils.d.ts +0 -4
- package/types/engines/utils.d.ts.map +0 -1
- /package/cjs/components/Breadcrumbs/utils/{getShortItems.css → index.css} +0 -0
- /package/es/components/Breadcrumbs/utils/{getShortItems.css → index.css} +0 -0
@@ -8,7 +8,6 @@ var base$1 = require('./variations/_size/base.js');
|
|
8
8
|
var base = require('./variations/_view/base.js');
|
9
9
|
var Breadcrumbs_styles = require('./Breadcrumbs.styles.js');
|
10
10
|
var index = require('./utils/index.js');
|
11
|
-
var getShortItems = require('./utils/getShortItems.js');
|
12
11
|
|
13
12
|
var breadcrumbsRoot = function breadcrumbsRoot(Root) {
|
14
13
|
return /*#__PURE__*/React.forwardRef(function (_ref, outerRootRef) {
|
@@ -23,7 +22,7 @@ var breadcrumbsRoot = function breadcrumbsRoot(Root) {
|
|
23
22
|
color: "inherit",
|
24
23
|
size: index.convertIconSize(size)
|
25
24
|
});
|
26
|
-
var renderItems =
|
25
|
+
var renderItems = index.getRenderItems(items, renderSeparator, showItems);
|
27
26
|
var itemsWithSeparator = index.addSeparator(renderItems, renderSeparator);
|
28
27
|
return /*#__PURE__*/React.createElement(Root, {
|
29
28
|
ref: outerRootRef,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { BreadcrumbsProps } from './Breadcrumbs.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base, Separator } from './Breadcrumbs.styles';\nimport { addSeparator, convertIconSize
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { BreadcrumbsProps } from './Breadcrumbs.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base, Separator } from './Breadcrumbs.styles';\nimport { addSeparator, convertIconSize, getRenderItems } from './utils';\n\nexport const breadcrumbsRoot = (Root: RootProps<HTMLDivElement, BreadcrumbsProps>) =>\n forwardRef<HTMLDivElement, BreadcrumbsProps>(\n ({ view, size, separator, items, showItems = items.length, className }, outerRootRef) => {\n const renderSeparator = separator ?? <Separator color=\"inherit\" size={convertIconSize(size)} />;\n const renderItems: ReactNode[] = getRenderItems(items, renderSeparator, showItems);\n const itemsWithSeparator = addSeparator(renderItems, renderSeparator);\n\n return (\n <Root ref={outerRootRef} size={size} view={view} className={cx(className)} items={items}>\n {itemsWithSeparator.map((item, index) => (\n <React.Fragment key={index}>{item}</React.Fragment>\n ))}\n </Root>\n );\n },\n );\n\nexport const breadcrumbsConfig = {\n name: 'Breadcrumbs',\n tag: 'div',\n layout: breadcrumbsRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["breadcrumbsRoot","Root","forwardRef","_ref","outerRootRef","view","size","separator","items","_ref$showItems","showItems","length","className","renderSeparator","React","createElement","Separator","color","convertIconSize","renderItems","getRenderItems","itemsWithSeparator","addSeparator","ref","cx","map","item","index","Fragment","key","breadcrumbsConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;IAWaA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,IAAiD,EAAA;AAAA,EAAA,oBAC7EC,gBAAU,CACN,UAAAC,IAAA,EAAwEC,YAAY,EAAK;AAAA,IAAA,IAAtFC,IAAI,GAAAF,IAAA,CAAJE,IAAI;MAAEC,IAAI,GAAAH,IAAA,CAAJG,IAAI;MAAEC,SAAS,GAAAJ,IAAA,CAATI,SAAS;MAAEC,KAAK,GAAAL,IAAA,CAALK,KAAK;MAAAC,cAAA,GAAAN,IAAA,C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AJA,uBAAI;AACJC,EAAAA,UAAU,EAAE;AACR9B,IAAAA,IAAI,EAAE;AACF+B,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD/B,IAAAA,IAAI,EAAE;AACF8B,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlC,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -2,6 +2,23 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
+
var React = require('react');
|
6
|
+
var BreadcrumbShorter = require('../ui/BreadcrumbShorter/BreadcrumbShorter.js');
|
7
|
+
var Breadcrumbs_styles = require('../Breadcrumbs.styles.js');
|
8
|
+
|
9
|
+
var shortItems = function shortItems(items, renderSeparator, showItems) {
|
10
|
+
if (!showItems || showItems < 2 || items.length <= showItems) {
|
11
|
+
return items;
|
12
|
+
}
|
13
|
+
var leftSlice = Math.floor(showItems / 2);
|
14
|
+
var rightSlice = items.length - leftSlice - showItems % 2;
|
15
|
+
var renderItems = items.slice(leftSlice, rightSlice);
|
16
|
+
var shorter = /*#__PURE__*/React.createElement(BreadcrumbShorter.BreadcrumbShorter, {
|
17
|
+
separator: renderSeparator
|
18
|
+
}, renderItems);
|
19
|
+
items.splice(leftSlice, rightSlice - leftSlice, shorter);
|
20
|
+
return items;
|
21
|
+
};
|
5
22
|
var convertIconSize = function convertIconSize(size) {
|
6
23
|
switch (size) {
|
7
24
|
case 's':
|
@@ -11,6 +28,25 @@ var convertIconSize = function convertIconSize(size) {
|
|
11
28
|
return 's';
|
12
29
|
}
|
13
30
|
};
|
31
|
+
var getRenderItems = function getRenderItems(items, renderSeparator, showItems) {
|
32
|
+
var renderItems = shortItems(items.map(function (item) {
|
33
|
+
if (item.renderItem) {
|
34
|
+
return item.renderItem();
|
35
|
+
}
|
36
|
+
var title = item.title,
|
37
|
+
disabled = item.disabled,
|
38
|
+
href = item.href,
|
39
|
+
onClick = item.onClick;
|
40
|
+
return /*#__PURE__*/React.createElement(Breadcrumbs_styles.StyledLink, {
|
41
|
+
tabIndex: 0,
|
42
|
+
href: href,
|
43
|
+
disabled: disabled,
|
44
|
+
onClick: onClick,
|
45
|
+
isHref: Boolean(href || onClick)
|
46
|
+
}, title);
|
47
|
+
}), renderSeparator, showItems);
|
48
|
+
return renderItems;
|
49
|
+
};
|
14
50
|
var addSeparator = function addSeparator(items, renderSeparator) {
|
15
51
|
return items.flatMap(function (item, idx) {
|
16
52
|
return idx < items.length - 1 ? [item, renderSeparator] : [item];
|
@@ -19,4 +55,6 @@ var addSeparator = function addSeparator(items, renderSeparator) {
|
|
19
55
|
|
20
56
|
exports.addSeparator = addSeparator;
|
21
57
|
exports.convertIconSize = convertIconSize;
|
58
|
+
exports.getRenderItems = getRenderItems;
|
59
|
+
exports.shortItems = shortItems;
|
22
60
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Breadcrumbs/utils/index.
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Breadcrumbs/utils/index.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\n\nimport { BreadcrumbShorter } from '../ui/BreadcrumbShorter/BreadcrumbShorter';\nimport { StyledLink } from '../Breadcrumbs.styles';\nimport { BreadcrumbsItem } from '../Breadcrumbs.types';\n\nexport const shortItems = (items: ReactNode[], renderSeparator: ReactNode, showItems?: number) => {\n if (!showItems || showItems < 2 || items.length <= showItems) {\n return items;\n }\n\n const leftSlice = Math.floor(showItems / 2);\n const rightSlice = items.length - leftSlice - (showItems % 2);\n\n const renderItems: ReactNode[] = items.slice(leftSlice, rightSlice);\n const shorter = <BreadcrumbShorter separator={renderSeparator}>{renderItems}</BreadcrumbShorter>;\n items.splice(leftSlice, rightSlice - leftSlice, shorter);\n return items;\n};\n\nexport const convertIconSize = (size?: string) => {\n switch (size) {\n case 's':\n case 'xs':\n return 'xs';\n default:\n return 's';\n }\n};\n\nexport const getRenderItems = (items: BreadcrumbsItem[], renderSeparator: ReactNode, showItems?: number) => {\n const renderItems = shortItems(\n items.map((item: BreadcrumbsItem) => {\n if (item.renderItem) {\n return item.renderItem();\n }\n\n const { title, disabled, href, onClick } = item;\n\n return (\n <StyledLink\n tabIndex={0}\n href={href}\n disabled={disabled}\n onClick={onClick}\n isHref={Boolean(href || onClick)}\n >\n {title}\n </StyledLink>\n );\n }),\n renderSeparator,\n showItems,\n );\n\n return renderItems;\n};\n\nexport const addSeparator = (items: ReactNode[], renderSeparator: ReactNode) => {\n return items.flatMap((item, idx) => (idx < items.length - 1 ? [item, renderSeparator] : [item]));\n};\n"],"names":["shortItems","items","renderSeparator","showItems","length","leftSlice","Math","floor","rightSlice","renderItems","slice","shorter","React","createElement","BreadcrumbShorter","separator","splice","convertIconSize","size","getRenderItems","map","item","renderItem","title","disabled","href","onClick","StyledLink","tabIndex","isHref","Boolean","addSeparator","flatMap","idx"],"mappings":";;;;;;;;AAMO,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,KAAkB,EAAEC,eAA0B,EAAEC,SAAkB,EAAK;AAC9F,EAAA,IAAI,CAACA,SAAS,IAAIA,SAAS,GAAG,CAAC,IAAIF,KAAK,CAACG,MAAM,IAAID,SAAS,EAAE;AAC1D,IAAA,OAAOF,KAAK,CAAA;AAChB,GAAA;EAEA,IAAMI,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACJ,SAAS,GAAG,CAAC,CAAC,CAAA;EAC3C,IAAMK,UAAU,GAAGP,KAAK,CAACG,MAAM,GAAGC,SAAS,GAAIF,SAAS,GAAG,CAAE,CAAA;EAE7D,IAAMM,WAAwB,GAAGR,KAAK,CAACS,KAAK,CAACL,SAAS,EAAEG,UAAU,CAAC,CAAA;AACnE,EAAA,IAAMG,OAAO,gBAAGC,KAAA,CAAAC,aAAA,CAACC,mCAAiB,EAAA;AA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AAC,CAAA;AAED,EAAA,OAAOM,WAAW,CAAA;AACtB,EAAC;AAEM,IAAMsB,YAAY,GAAG,SAAfA,YAAYA,CAAI9B,KAAkB,EAAEC,eAA0B,EAAK;AAC5E,EAAA,OAAOD,KAAK,CAAC+B,OAAO,CAAC,UAACX,IAAI,EAAEY,GAAG,EAAA;AAAA,IAAA,OAAMA,GAAG,GAAGhC,KAAK,CAACG,MAAM,GAAG,CAAC,GAAG,CAACiB,IAAI,EAAEnB,eAAe,CAAC,GAAG,CAACmB,IAAI,CAAC,CAAA;AAAA,GAAC,CAAC,CAAA;AACpG;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getDateWithModification.js","sources":["../../../../src/components/Calendar/utils/getDateWithModification.ts"],"sourcesContent":["import type { DateItem, DateObject, DisabledDay, EventDay } from '../Calendar.types';\nimport { CalendarState, CalendarStateType } from '../store/types';\n\nimport { getPropsMap } from './calendarGridHelper';\n\ntype GetDatesWithModificationsArgs = {\n dates: DateItem[];\n type: CalendarStateType;\n eventList?: EventDay[];\n disabledList?: DisabledDay[];\n includeEdgeDates?: boolean;\n min?: Date;\n max?: Date;\n};\n\ntype DateOperationHandler = {\n [k in CalendarStateType]: {\n [t in 'add' | 'subtract']: (date: Date) => number;\n };\n};\n\nconst dateOperationHandler: DateOperationHandler = {\n Days: {\n add: (date: Date) => date.setDate(date.getDate() + 1),\n subtract: (date: Date) => date.setDate(date.getDate() - 1),\n },\n Months: {\n add: (date: Date) => date.setMonth(date.getMonth() + 1),\n subtract: (date: Date) => date.setMonth(date.getMonth() - 1),\n },\n Quarters: {\n add: (date: Date) => date.setMonth(date.getMonth() + 3),\n subtract: (date: Date) => date.setMonth(date.getMonth() - 3),\n },\n Years: {\n add: (date: Date) => date.setFullYear(date.getFullYear() + 1),\n subtract: (date: Date) => date.setFullYear(date.getFullYear() - 1),\n },\n};\n\nconst normalizeDate = (date: Date, type: CalendarStateType) => {\n if (type === CalendarState.Months || type === CalendarState.Years) {\n date.setDate(1);\n }\n\n if (type === CalendarState.Years) {\n date.setMonth(0);\n }\n};\n\nconst isDisabledNextDate = ({ year, monthIndex, day }: DateObject, type: CalendarStateType, max?: Date) => {\n if (!max) {\n return false;\n }\n\n const maxDate = new Date(max);\n\n normalizeDate(maxDate, type);\n\n const currentDate = new Date(year, monthIndex, day);\n dateOperationHandler[type].add(currentDate);\n\n let isOut = true;\n\n while (isOut && currentDate <= maxDate) {\n isOut = maxDate <= currentDate;\n\n dateOperationHandler[type].add(currentDate);\n }\n\n return isOut;\n};\n\nconst isDisabledPreviousDate = ({ year, monthIndex, day }: DateObject, type: CalendarStateType, min?: Date) => {\n if (!min) {\n return false;\n }\n\n const minDate = new Date(min);\n\n normalizeDate(minDate, type);\n\n const currentDate = new Date(year, monthIndex, day);\n dateOperationHandler[type].subtract(currentDate);\n\n let isOut = true;\n\n while (isOut && currentDate >= minDate) {\n isOut = minDate >= currentDate;\n\n dateOperationHandler[type].subtract(currentDate);\n }\n\n return isOut;\n};\n\nconst getDisabledDates = (list: DateObject[], type: CalendarStateType, min?: Date, max?: Date) => {\n const disabledDate: string[] = [];\n\n if (isDisabledPreviousDate(list[0], type, min)) {\n disabledDate.push('previous');\n }\n\n if (isDisabledNextDate(list[list.length - 1], type, max)) {\n disabledDate.push('next');\n }\n\n return disabledDate.join(',');\n};\n\nconst isDisabledArrowLeft = (date: Date, min?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(currentDate.getDate() - 1);\n\n return (min && min >= currentDate) || (min && min >= date);\n};\n\nconst isDisabledArrowRight = (date: Date, max?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(currentDate.getDate() + 1);\n\n return (max && max <= currentDate) || (max && max <= date);\n};\n\nconst isDisabledArrowUp = (date: Date, min?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(date.getDate() - 7);\n\n return min && min >= currentDate;\n};\n\nconst isDisabledArrowDown = (date: Date, max?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(date.getDate() + 7);\n\n return max && max <= currentDate;\n};\n\nconst getDisabledArrowKey = (currentDate: Date, min?: Date, max?: Date) => {\n const disabledArrowKey: string[] = [];\n\n if (isDisabledArrowLeft(currentDate, min)) {\n disabledArrowKey.push('left');\n }\n\n if (isDisabledArrowRight(currentDate, max)) {\n disabledArrowKey.push('right');\n }\n\n if (isDisabledArrowDown(currentDate, max)) {\n disabledArrowKey.push('down');\n }\n\n if (isDisabledArrowUp(currentDate, min)) {\n disabledArrowKey.push('up');\n }\n\n return disabledArrowKey.join(',');\n};\n\n/**\n * Метод модифицирующий дату (добавляющий свойства events и disabled).\n */\nexport const getDatesWithModifications = ({\n dates,\n type,\n eventList = [],\n disabledList = [],\n includeEdgeDates,\n min,\n max,\n}: GetDatesWithModificationsArgs) => {\n const eventsMap = getPropsMap(eventList);\n const disabledDatesMap = getPropsMap(disabledList);\n\n const filteredDates =\n type === CalendarState.Days ? dates.filter(({ isDayInCurrentMonth }) => isDayInCurrentMonth) : dates;\n const datesList = filteredDates.map(({ date }) => date);\n\n const disabledDates = getDisabledDates(datesList, type, min, max);\n\n return dates.map((dateItem) => {\n const { date } = dateItem;\n const { year, monthIndex, day } = date;\n\n const keyDate = `${year}-${monthIndex}-${day}`;\n const currentDate = new Date(year, monthIndex, day);\n\n const minDate = min && new Date(min);\n minDate && normalizeDate(minDate, type);\n\n const maxDate = max && new Date(max);\n maxDate && normalizeDate(maxDate, type);\n\n let minValue: boolean | undefined;\n let maxValue: boolean | undefined;\n\n if (type === CalendarState.Days) {\n minValue = min && (includeEdgeDates ? min > currentDate : min >= currentDate);\n maxValue = max && (includeEdgeDates ? max < currentDate : max <= currentDate);\n } else {\n minValue = minDate && minDate > currentDate;\n maxValue = maxDate && maxDate < currentDate;\n }\n\n const isOutOfMinMaxRange = minValue || maxValue;\n\n dateItem.events = eventsMap.get(keyDate);\n dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;\n\n dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;\n dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max);\n dateItem.disabledDates = disabledDates;\n\n return dateItem;\n });\n};\n"],"names":["dateOperationHandler","Days","add","date","setDate","getDate","subtract","Months","setMonth","getMonth","Quarters","Years","setFullYear","getFullYear","normalizeDate","type","CalendarState","isDisabledNextDate","_ref","max","year","monthIndex","day","maxDate","Date","currentDate","isOut","isDisabledPreviousDate","_ref2","min","minDate","getDisabledDates","list","disabledDate","push","length","join","isDisabledArrowLeft","isDisabledArrowRight","isDisabledArrowUp","isDisabledArrowDown","getDisabledArrowKey","disabledArrowKey","getDatesWithModifications","_ref3","dates","_ref3$eventList","eventList","_ref3$disabledList","disabledList","includeEdgeDates","eventsMap","getPropsMap","disabledDatesMap","filteredDates","filter","_ref4","isDayInCurrentMonth","datesList","map","_ref5","disabledDates","dateItem","keyDate","concat","minValue","maxValue","isOutOfMinMaxRange","events","get","disabled","has"],"mappings":";;;;;;;AAqBA,IAAMA,oBAA0C,GAAG;AAC/CC,EAAAA,IAAI,EAAE;IACFC,GAAG,EAAE,SAAAA,GAAAA,CAACC,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACC,OAAO,CAACD,IAAI,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;IACrDC,QAAQ,EAAE,SAAAA,QAAAA,CAACH,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACC,OAAO,CAACD,IAAI,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;GAC7D;AACDE,EAAAA,MAAM,EAAE;IACJL,GAAG,EAAE,SAAAA,GAAAA,CAACC,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACK,QAAQ,CAACL,IAAI,CAACM,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;IACvDH,QAAQ,EAAE,SAAAA,QAAAA,CAACH,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACK,QAAQ,CAACL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C,IAAA,OAAOC,QAAQ,CAAA;AACnB,GAAC,CAAC,CAAA;AACN;;;;"}
|
1
|
+
{"version":3,"file":"getDateWithModification.js","sources":["../../../../src/components/Calendar/utils/getDateWithModification.ts"],"sourcesContent":["import type { DateItem, DateObject, DisabledDay, EventDay } from '../Calendar.types';\nimport type { CalendarStateType } from '..';\nimport { CalendarState } from '../store/types';\n\nimport { getPropsMap } from '.';\n\ntype GetDatesWithModificationsArgs = {\n dates: DateItem[];\n type: CalendarStateType;\n eventList?: EventDay[];\n disabledList?: DisabledDay[];\n includeEdgeDates?: boolean;\n min?: Date;\n max?: Date;\n};\n\ntype DateOperationHandler = {\n [k in CalendarStateType]: {\n [t in 'add' | 'subtract']: (date: Date) => number;\n };\n};\n\nconst dateOperationHandler: DateOperationHandler = {\n Days: {\n add: (date: Date) => date.setDate(date.getDate() + 1),\n subtract: (date: Date) => date.setDate(date.getDate() - 1),\n },\n Months: {\n add: (date: Date) => date.setMonth(date.getMonth() + 1),\n subtract: (date: Date) => date.setMonth(date.getMonth() - 1),\n },\n Quarters: {\n add: (date: Date) => date.setMonth(date.getMonth() + 3),\n subtract: (date: Date) => date.setMonth(date.getMonth() - 3),\n },\n Years: {\n add: (date: Date) => date.setFullYear(date.getFullYear() + 1),\n subtract: (date: Date) => date.setFullYear(date.getFullYear() - 1),\n },\n};\n\nconst normalizeDate = (date: Date, type: CalendarStateType) => {\n if (type === CalendarState.Months || type === CalendarState.Years) {\n date.setDate(1);\n }\n\n if (type === CalendarState.Years) {\n date.setMonth(0);\n }\n};\n\nconst isDisabledNextDate = ({ year, monthIndex, day }: DateObject, type: CalendarStateType, max?: Date) => {\n if (!max) {\n return false;\n }\n\n const maxDate = new Date(max);\n\n normalizeDate(maxDate, type);\n\n const currentDate = new Date(year, monthIndex, day);\n dateOperationHandler[type].add(currentDate);\n\n let isOut = true;\n\n while (isOut && currentDate <= maxDate) {\n isOut = maxDate <= currentDate;\n\n dateOperationHandler[type].add(currentDate);\n }\n\n return isOut;\n};\n\nconst isDisabledPreviousDate = ({ year, monthIndex, day }: DateObject, type: CalendarStateType, min?: Date) => {\n if (!min) {\n return false;\n }\n\n const minDate = new Date(min);\n\n normalizeDate(minDate, type);\n\n const currentDate = new Date(year, monthIndex, day);\n dateOperationHandler[type].subtract(currentDate);\n\n let isOut = true;\n\n while (isOut && currentDate >= minDate) {\n isOut = minDate >= currentDate;\n\n dateOperationHandler[type].subtract(currentDate);\n }\n\n return isOut;\n};\n\nconst getDisabledDates = (list: DateObject[], type: CalendarStateType, min?: Date, max?: Date) => {\n const disabledDate: string[] = [];\n\n if (isDisabledPreviousDate(list[0], type, min)) {\n disabledDate.push('previous');\n }\n\n if (isDisabledNextDate(list[list.length - 1], type, max)) {\n disabledDate.push('next');\n }\n\n return disabledDate.join(',');\n};\n\nconst isDisabledArrowLeft = (date: Date, min?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(currentDate.getDate() - 1);\n\n return (min && min >= currentDate) || (min && min >= date);\n};\n\nconst isDisabledArrowRight = (date: Date, max?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(currentDate.getDate() + 1);\n\n return (max && max <= currentDate) || (max && max <= date);\n};\n\nconst isDisabledArrowUp = (date: Date, min?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(date.getDate() - 7);\n\n return min && min >= currentDate;\n};\n\nconst isDisabledArrowDown = (date: Date, max?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(date.getDate() + 7);\n\n return max && max <= currentDate;\n};\n\nconst getDisabledArrowKey = (currentDate: Date, min?: Date, max?: Date) => {\n const disabledArrowKey: string[] = [];\n\n if (isDisabledArrowLeft(currentDate, min)) {\n disabledArrowKey.push('left');\n }\n\n if (isDisabledArrowRight(currentDate, max)) {\n disabledArrowKey.push('right');\n }\n\n if (isDisabledArrowDown(currentDate, max)) {\n disabledArrowKey.push('down');\n }\n\n if (isDisabledArrowUp(currentDate, min)) {\n disabledArrowKey.push('up');\n }\n\n return disabledArrowKey.join(',');\n};\n\n/**\n * Метод модифицирующий дату (добавляющий свойства events и disabled).\n */\nexport const getDatesWithModifications = ({\n dates,\n type,\n eventList = [],\n disabledList = [],\n includeEdgeDates,\n min,\n max,\n}: GetDatesWithModificationsArgs) => {\n const eventsMap = getPropsMap(eventList);\n const disabledDatesMap = getPropsMap(disabledList);\n\n const filteredDates =\n type === CalendarState.Days ? dates.filter(({ isDayInCurrentMonth }) => isDayInCurrentMonth) : dates;\n const datesList = filteredDates.map(({ date }) => date);\n\n const disabledDates = getDisabledDates(datesList, type, min, max);\n\n return dates.map((dateItem) => {\n const { date } = dateItem;\n const { year, monthIndex, day } = date;\n\n const keyDate = `${year}-${monthIndex}-${day}`;\n const currentDate = new Date(year, monthIndex, day);\n\n const minDate = min && new Date(min);\n minDate && normalizeDate(minDate, type);\n\n const maxDate = max && new Date(max);\n maxDate && normalizeDate(maxDate, type);\n\n let minValue: boolean | undefined;\n let maxValue: boolean | undefined;\n\n if (type === CalendarState.Days) {\n minValue = min && (includeEdgeDates ? min > currentDate : min >= currentDate);\n maxValue = max && (includeEdgeDates ? max < currentDate : max <= currentDate);\n } else {\n minValue = minDate && minDate > currentDate;\n maxValue = maxDate && maxDate < currentDate;\n }\n\n const isOutOfMinMaxRange = minValue || maxValue;\n\n dateItem.events = eventsMap.get(keyDate);\n dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;\n\n dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;\n dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max);\n dateItem.disabledDates = disabledDates;\n\n return dateItem;\n });\n};\n"],"names":["dateOperationHandler","Days","add","date","setDate","getDate","subtract","Months","setMonth","getMonth","Quarters","Years","setFullYear","getFullYear","normalizeDate","type","CalendarState","isDisabledNextDate","_ref","max","year","monthIndex","day","maxDate","Date","currentDate","isOut","isDisabledPreviousDate","_ref2","min","minDate","getDisabledDates","list","disabledDate","push","length","join","isDisabledArrowLeft","isDisabledArrowRight","isDisabledArrowUp","isDisabledArrowDown","getDisabledArrowKey","disabledArrowKey","getDatesWithModifications","_ref3","dates","_ref3$eventList","eventList","_ref3$disabledList","disabledList","includeEdgeDates","eventsMap","getPropsMap","disabledDatesMap","filteredDates","filter","_ref4","isDayInCurrentMonth","datesList","map","_ref5","disabledDates","dateItem","keyDate","concat","minValue","maxValue","isOutOfMinMaxRange","events","get","disabled","has"],"mappings":";;;;;;;AAsBA,IAAMA,oBAA0C,GAAG;AAC/CC,EAAAA,IAAI,EAAE;IACFC,GAAG,EAAE,SAAAA,GAAAA,CAACC,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACC,OAAO,CAACD,IAAI,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;IACrDC,QAAQ,EAAE,SAAAA,QAAAA,CAACH,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACC,OAAO,CAACD,IAAI,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;GAC7D;AACDE,EAAAA,MAAM,EAAE;IACJL,GAAG,EAAE,SAAAA,GAAAA,CAACC,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACK,QAAQ,CAACL,IAAI,CAACM,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;IACvDH,QAAQ,EAAE,SAAAA,QAAAA,CAACH,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACK,QAAQ,CAACL,IAAI,CAACM,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;GAC/D;AACDC,EAAAA,QAAQ,EAAE;IACNR,GAAG,EAAE,SAAAA,GAAAA,CAACC,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACK,QAAQ,CAACL,IAAI,CAACM,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;IACvDH,QAAQ,EAAE,SAAAA,QAAAA,CAACH,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACK,QAAQ,CA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IAAI,KAAKC,mBAAa,CAACf,IAAI,EAAE;AAC7BgE,MAAAA,QAAQ,GAAGpC,GAAG,KAAKqB,gBAAgB,GAAGrB,GAAG,GAAGJ,WAAW,GAAGI,GAAG,IAAIJ,WAAW,CAAC,CAAA;AAC7EyC,MAAAA,QAAQ,GAAG/C,GAAG,KAAK+B,gBAAgB,GAAG/B,GAAG,GAAGM,WAAW,GAAGN,GAAG,IAAIM,WAAW,CAAC,CAAA;AACjF,KAAC,MAAM;AACHwC,MAAAA,QAAQ,GAAGnC,OAAO,IAAIA,OAAO,GAAGL,WAAW,CAAA;AAC3CyC,MAAAA,QAAQ,GAAG3C,OAAO,IAAIA,OAAO,GAAGE,WAAW,CAAA;AAC/C,KAAA;AAEA,IAAA,IAAM0C,kBAAkB,GAAGF,QAAQ,IAAIC,QAAQ,CAAA;IAE/CJ,QAAQ,CAACM,MAAM,GAAGjB,SAAS,CAACkB,GAAG,CAACN,OAAO,CAAC,CAAA;IACxCD,QAAQ,CAACQ,QAAQ,GAAGjB,gBAAgB,CAACkB,GAAG,CAACR,OAAO,CAAC,IAAII,kBAAkB,CAAA;IAEvEL,QAAQ,CAACK,kBAAkB,GAAGA,kBAAkB,CAAA;IAChDL,QAAQ,CAACpB,gBAAgB,GAAGD,mBAAmB,CAAChB,WAAW,EAAEI,GAAG,EAAEV,GAAG,CAAC,CAAA;IACtE2C,QAAQ,CAACD,aAAa,GAAGA,aAAa,CAAA;AAEtC,IAAA,OAAOC,QAAQ,CAAA;AACnB,GAAC,CAAC,CAAA;AACN;;;;"}
|
@@ -13,7 +13,6 @@ var Combobox_styles = require('./Combobox.styles.js');
|
|
13
13
|
var base = require('./variations/_view/base.js');
|
14
14
|
var base$1 = require('./variations/_size/base.js');
|
15
15
|
var SelectNative = require('./ui/SelectNative/SelectNative.js');
|
16
|
-
var Combobox_context = require('./Combobox.context.js');
|
17
16
|
var initialItemsTransform = require('./utils/initialItemsTransform.js');
|
18
17
|
var getInitialValue = require('./utils/getInitialValue.js');
|
19
18
|
var filterItems = require('./utils/filterItems.js');
|
@@ -30,6 +29,7 @@ var getItemId = require('./utils/getItemId.js');
|
|
30
29
|
var Inner = require('./ui/Inner/Inner.js');
|
31
30
|
|
32
31
|
var _excluded = ["name", "multiple", "value", "onChange", "defaultValue", "isTargetAmount", "targetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "keepPlaceholder", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect", "renderValue", "zIndex", "beforeList", "afterList"];
|
32
|
+
var Context = /*#__PURE__*/React.createContext({});
|
33
33
|
|
34
34
|
/**
|
35
35
|
* Поле ввода с выпадающим списком и возможностью фильтрации и выбора элементов.
|
@@ -400,7 +400,7 @@ var comboboxRoot = function comboboxRoot(Root) {
|
|
400
400
|
onChange: onChange,
|
401
401
|
onSetValue: setInternalValue,
|
402
402
|
ref: ref
|
403
|
-
}), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
403
|
+
}), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Context.Provider, {
|
404
404
|
value: {
|
405
405
|
focusedPath: focusedPath,
|
406
406
|
checked: checked,
|
@@ -519,6 +519,7 @@ var comboboxConfig = {
|
|
519
519
|
}
|
520
520
|
};
|
521
521
|
|
522
|
+
exports.Context = Context;
|
522
523
|
exports.comboboxConfig = comboboxConfig;
|
523
524
|
exports.comboboxRoot = comboboxRoot;
|
524
525
|
//# sourceMappingURL=Combobox.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.js","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, useLayoutEffect, useRef } from 'react';\nimport type { ChangeEvent, ForwardedRef } 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 { 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';\nimport { SelectNative } from './ui/SelectNative/SelectNative';\nimport { Context } from './Combobox.context';\n\n/**\n * Поле ввода с выпадающим списком и возможностью фильтрации и выбора элементов.\n */\n\nexport const comboboxRoot = (Root: RootProps<HTMLInputElement, Omit<ComboboxProps, 'items'>>) =>\n forwardRef<HTMLInputElement, ComboboxProps>((props, ref) => {\n const {\n name,\n multiple,\n value: outerValue,\n onChange: outerOnChange,\n defaultValue,\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 keepPlaceholder,\n readOnly = false,\n disabled = false,\n alwaysOpened = false,\n filter,\n closeAfterSelect: outerCloseAfterSelect,\n renderValue,\n zIndex,\n beforeList,\n afterList,\n ...rest\n } = props;\n\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 // Эта функция срабатывает при изменении Combobox и\n // при изменении нативного Select для формы (срабатывает только после изменения internalValue и рендера).\n const onChange = (newValue: string | Array<string> | ChangeEvent<HTMLSelectElement> | null) => {\n // Условие для отправки изменений наружу\n if (outerOnChange) {\n // Условие для отправки если комбобокс используется без формы.\n if (!name && (typeof newValue === 'string' || Array.isArray(newValue))) {\n outerOnChange(newValue as any);\n }\n\n // Условие для отправки если комбобокс используется с формой.\n if (name && typeof newValue === 'object' && !Array.isArray(newValue)) {\n outerOnChange(newValue as any);\n }\n }\n\n // Условие для изменения внутреннего значения (только если newValue строка или массив строк).\n if (typeof newValue === 'string' || Array.isArray(newValue)) {\n setInternalValue(newValue);\n }\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 multiple,\n value,\n textValue,\n valueToItemMap,\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 useLayoutEffect(() => {\n if (defaultValue) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n return (\n <Root\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n name={name}\n >\n {name && (\n <SelectNative\n items={valueToItemMap}\n name={name}\n value={internalValue}\n multiple={multiple}\n onChange={onChange}\n onSetValue={setInternalValue}\n ref={ref as ForwardedRef<HTMLInputElement>}\n />\n )}\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={name ? inputRef : (inputForkRef as ForwardedRef<HTMLInputElement>)}\n inputWrapperRef={referenceRef}\n value={textValue}\n onChange={handleTextValueChange}\n size={size}\n view={view}\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 labelPlacement={labelPlacement}\n keepPlaceholder={keepPlaceholder}\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 zIndex={zIndex}\n >\n <Root\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n name={name}\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 {beforeList}\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\n {afterList}\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":["comboboxRoot","Root","forwardRef","props","ref","_valueToItemMap$get","_valueToItemMap$get2","_getItemByFocused","name","multiple","outerValue","value","outerOnChange","onChange","defaultValue","isTargetAmount","targetAmount","items","_props$placement","placement","label","placeholder","helperText","contentLeft","textBefore","textAfter","_props$variant","variant","listOverflow","listHeight","listWidth","portal","renderItem","view","size","labelPlacement","keepPlaceholder","_props$readOnly","readOnly","_props$disabled","disabled","_props$alwaysOpened","alwaysOpened","filter","outerCloseAfterSelect","closeAfterSelect","renderValue","zIndex","beforeList","afterList","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","Array","isArray","_typeof","handleClickArrow","handleTextValueChange","e","target","handleChipsChange","chipLabels","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","SelectNative","onSetValue","Context","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","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA;AACA;AACA;;IAEaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBACxFC,gBAAU,CAAkC,UAACC,KAAK,EAAEC,GAAG,EAAK;AAAA,IAAA,IAAAC,mBAAA,EAAAC,oBAAA,EAAAC,iBAAA,CAAA;AACxD,IAAA,IACIC,IAAI,GAmCJL,KAAK,CAnCLK,IAAI;MACJC,QAAQ,GAkCRN,KAAK,CAlCLM,QAAQ;MACDC,UAAU,GAiCjBP,KAAK,CAjCLQ,KAAK;MACKC,aAAa,GAgCvBT,KAAK,CAhCLU,QAAQ;MACRC,YAAY,GA+BZX,KAAK,CA/BLW,YAAY;MACZC,cAAc,GA8BdZ,KAAK,CA9BLY,cAAc;MACdC,YAAY,GA6BZb,KAAK,CA7BLa,YAAY;MACZC,KAAK,GA4BLd,KAAK,CA5BLc,KAAK;MAAAC,gBAAA,GA4BLf,KAAK,CA3BLgB,SAAS;AAATA,MAAAA,SAAS,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,cAAc,GAAAA,gBAAA;MAC1BE,KAAK,GA0BLjB,KAAK,CA1BL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A,YAAY,EAAEA,YAAa;AAC3BoC,QAAAA,KAAK,EAAEA,KAAM;AACbpG,QAAAA,SAAS,EAAEA,SAAAA;AAAU,OACxB,CAAC,CAAA;KACL,CACJ,EAEAmB,SACD,CACF,CACO,CACH,CACjB,CACH,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAM0J,cAAc,GAAG;AAC1BnM,EAAAA,IAAI,EAAE,QAAQ;AACdoM,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7M,YAAY;AACpB8M,EAAAA,IAAI,EAAJA,oBAAI;AACJC,EAAAA,UAAU,EAAE;AACR9K,IAAAA,IAAI,EAAE;AACF+K,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD/K,IAAAA,IAAI,EAAE;AACF8K,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACD5K,IAAAA,QAAQ,EAAE;AACN0K,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlL,IAAAA,IAAI,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, ForwardedRef } 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';\nimport { SelectNative } from './ui/SelectNative/SelectNative';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Поле ввода с выпадающим списком и возможностью фильтрации и выбора элементов.\n */\n\nexport const comboboxRoot = (Root: RootProps<HTMLInputElement, Omit<ComboboxProps, 'items'>>) =>\n forwardRef<HTMLInputElement, ComboboxProps>((props, ref) => {\n const {\n name,\n multiple,\n value: outerValue,\n onChange: outerOnChange,\n defaultValue,\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 keepPlaceholder,\n readOnly = false,\n disabled = false,\n alwaysOpened = false,\n filter,\n closeAfterSelect: outerCloseAfterSelect,\n renderValue,\n zIndex,\n beforeList,\n afterList,\n ...rest\n } = props;\n\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 // Эта функция срабатывает при изменении Combobox и\n // при изменении нативного Select для формы (срабатывает только после изменения internalValue и рендера).\n const onChange = (newValue: string | Array<string> | ChangeEvent<HTMLSelectElement> | null) => {\n // Условие для отправки изменений наружу\n if (outerOnChange) {\n // Условие для отправки если комбобокс используется без формы.\n if (!name && (typeof newValue === 'string' || Array.isArray(newValue))) {\n outerOnChange(newValue as any);\n }\n\n // Условие для отправки если комбобокс используется с формой.\n if (name && typeof newValue === 'object' && !Array.isArray(newValue)) {\n outerOnChange(newValue as any);\n }\n }\n\n // Условие для изменения внутреннего значения (только если newValue строка или массив строк).\n if (typeof newValue === 'string' || Array.isArray(newValue)) {\n setInternalValue(newValue);\n }\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 multiple,\n value,\n textValue,\n valueToItemMap,\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 useLayoutEffect(() => {\n if (defaultValue) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n return (\n <Root\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n name={name}\n >\n {name && (\n <SelectNative\n items={valueToItemMap}\n name={name}\n value={internalValue}\n multiple={multiple}\n onChange={onChange}\n onSetValue={setInternalValue}\n ref={ref as ForwardedRef<HTMLInputElement>}\n />\n )}\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={name ? inputRef : (inputForkRef as ForwardedRef<HTMLInputElement>)}\n inputWrapperRef={referenceRef}\n value={textValue}\n onChange={handleTextValueChange}\n size={size}\n view={view}\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 labelPlacement={labelPlacement}\n keepPlaceholder={keepPlaceholder}\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 zIndex={zIndex}\n >\n <Root\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n name={name}\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 {beforeList}\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\n {afterList}\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","name","multiple","outerValue","value","outerOnChange","onChange","defaultValue","isTargetAmount","targetAmount","items","_props$placement","placement","label","placeholder","helperText","contentLeft","textBefore","textAfter","_props$variant","variant","listOverflow","listHeight","listWidth","portal","renderItem","view","size","labelPlacement","keepPlaceholder","_props$readOnly","readOnly","_props$disabled","disabled","_props$alwaysOpened","alwaysOpened","filter","outerCloseAfterSelect","closeAfterSelect","renderValue","zIndex","beforeList","afterList","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","Array","isArray","_typeof","handleClickArrow","handleTextValueChange","e","target","handleChipsChange","chipLabels","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","SelectNative","onSetValue","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","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BaA,OAAO,gBAAGC,mBAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;;IAEaC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBACxFC,gBAAU,CAAkC,UAACC,KAAK,EAAEC,GAAG,EAAK;AAAA,IAAA,IAAAC,mBAAA,EAAAC,oBAAA,EAAAC,iBAAA,CAAA;AACxD,IAAA,IACIC,IAAI,GAmCJL,KAAK,CAnCLK,IAAI;MACJC,QAAQ,GAkCRN,KAAK,CAlCLM,QAAQ;MACDC,UAAU,GAiCjBP,KAAK,CAjCLQ,KAAK;MACKC,aAAa,GAgCvBT,KAAK,CAhCLU,QAAQ;MACRC,YAAY,GA+BZX,KAAK,CA/BLW,YAAY;MACZC,cAAc,GA8BdZ,KAAK,CA9BLY,cAAc;MACdC,YAAY,GA6BZb,KAAK,CA7BLa,YAAY;MACZC,KAAK,GA4BLd,KAAK,CA5BLc,KAAK;MAAAC,gBAAA,GA4BLf,KAAK,CA3BLgB,SAAS;AAATA,MAAAA,SAAS,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,cAAc,GAAAA,gBAAA;MAC1BE,KAAK,GA0BLjB,KAAK,CA1BLiB,KAAK;MACLC,WAAW,GAyBXlB,KAAK,CAzBLkB,WAAW;MACXC,UAAU,GAwBVnB,KAAK,CAxBLmB,UAAU;MACVC,WAAW,GAuBXpB,KAAK,CAvBLoB,WAAW;MACXC,UAAU,GAsBVrB,K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