@hh.ru/magritte-ui-tree-selector 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Item.js +1 -1
- package/{ItemContent-74eb482b.js → ItemContent-1be2cb46.js} +2 -2
- package/{ItemContent-74eb482b.js.map → ItemContent-1be2cb46.js.map} +1 -1
- package/ItemContent.js +1 -1
- package/ItemsList.js +1 -1
- package/TreeSelector.js +1 -1
- package/UncontrolledTreeSelector.js +1 -1
- package/index.css +11 -11
- package/index.js +1 -1
- package/package.json +4 -4
package/Item.js
CHANGED
|
@@ -2,7 +2,7 @@ import './index.css';
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { s as styles, I as ItemContent } from './ItemContent-
|
|
5
|
+
import { s as styles, I as ItemContent } from './ItemContent-1be2cb46.js';
|
|
6
6
|
import '@hh.ru/magritte-ui-cell';
|
|
7
7
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
8
8
|
import './Action.js';
|
|
@@ -7,7 +7,7 @@ import { DotFilledSize24, ChevronDownOutlinedSize24, ChevronUpOutlinedSize24 } f
|
|
|
7
7
|
import { Action } from './Action.js';
|
|
8
8
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
9
9
|
|
|
10
|
-
var styles = {"wrapper":"magritte-wrapper___GHKV6_1-3-
|
|
10
|
+
var styles = {"wrapper":"magritte-wrapper___GHKV6_1-3-2","letter":"magritte-letter___yZOCU_1-3-2","icon":"magritte-icon___kO3Fj_1-3-2","space":"magritte-space___xTO79_1-3-2","iconActive":"magritte-iconActive___4yrG5_1-3-2","content":"magritte-content___ZRc6R_1-3-2","with-shift":"magritte-with-shift___ZErxZ_1-3-2","withShift":"magritte-with-shift___ZErxZ_1-3-2","with-indent":"magritte-with-indent___MH9Vy_1-3-2","withIndent":"magritte-with-indent___MH9Vy_1-3-2","item":"magritte-item___2LtOL_1-3-2","children":"magritte-children___kq-eq_1-3-2","with-two-boxes":"magritte-with-two-boxes___LWOy2_1-3-2","withTwoBoxes":"magritte-with-two-boxes___LWOy2_1-3-2","with-three-boxes":"magritte-with-three-boxes___cyVao_1-3-2","withThreeBoxes":"magritte-with-three-boxes___cyVao_1-3-2"};
|
|
11
11
|
|
|
12
12
|
const ItemContent = ({ item, hasAction, hasChildren, letter, expanded, onExpansion, hasLetterOnLevel, selected, onChange, indeterminate, singleChoice, hasDot, maxControlsOnLevel, }) => {
|
|
13
13
|
const handleExpandableClick = useCallback(() => onExpansion && onExpansion(item.id), [item.id, onExpansion]);
|
|
@@ -19,4 +19,4 @@ const ItemContent = ({ item, hasAction, hasChildren, letter, expanded, onExpansi
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export { ItemContent as I, styles as s };
|
|
22
|
-
//# sourceMappingURL=ItemContent-
|
|
22
|
+
//# sourceMappingURL=ItemContent-1be2cb46.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemContent-
|
|
1
|
+
{"version":3,"file":"ItemContent-1be2cb46.js","sources":["../src/ItemContent.tsx"],"sourcesContent":["import { ReactElement, useCallback } from 'react';\nimport classnames from 'classnames';\n\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport { ChevronDownOutlinedSize24, ChevronUpOutlinedSize24, DotFilledSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Action } from '@hh.ru/magritte-ui-tree-selector/Action';\nimport { AdditionalDefault, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './tree-selector-item.less';\n\ninterface ItemContent<A extends AdditionalDefault> {\n item: TreeModel<A>;\n hasChildren: boolean;\n hasAction: boolean;\n letter?: string;\n onExpansion: (id: string) => void;\n expanded?: boolean;\n selected: boolean;\n onChange: (id: string, isSelected: boolean) => void;\n indeterminate: boolean;\n singleChoice?: boolean;\n hasLetterOnLevel: boolean;\n hasDot: boolean;\n maxControlsOnLevel: number;\n}\n\nconst ItemContent = <A extends AdditionalDefault>({\n item,\n hasAction,\n hasChildren,\n letter,\n expanded,\n onExpansion,\n hasLetterOnLevel,\n selected,\n onChange,\n indeterminate,\n singleChoice,\n hasDot,\n maxControlsOnLevel,\n}: ItemContent<A>): ReactElement => {\n const handleExpandableClick = useCallback(() => onExpansion && onExpansion(item.id), [item.id, onExpansion]);\n const currentActionCount = +hasDot + +hasAction + +hasChildren;\n const neededSpacesCount = maxControlsOnLevel - currentActionCount;\n\n return (\n <div className={styles.wrapper}>\n {(letter || hasLetterOnLevel) && (\n <div className={styles.letter}>\n {letter && (\n <Text typography=\"subtitle-1-semibold\" style=\"secondary\" Element=\"span\">\n {letter}\n </Text>\n )}\n </div>\n )}\n {hasDot && (\n <div className={styles.icon}>\n <DotFilledSize24 initial=\"tertiary\" />\n </div>\n )}\n\n {[...Array(neededSpacesCount).keys()].map((_, i) => (\n <div key={i} className={styles.space} />\n ))}\n\n {hasChildren && (\n <div\n className={classnames(styles.icon, {\n [styles.iconActive]: hasChildren,\n })}\n onClick={handleExpandableClick}\n >\n {expanded && <ChevronDownOutlinedSize24 initial=\"tertiary\" />}\n {!expanded && <ChevronUpOutlinedSize24 initial=\"tertiary\" />}\n </div>\n )}\n\n <Cell\n left={\n hasAction ? (\n <Action\n selected={selected}\n onChange={onChange}\n id={item.id}\n indeterminate={indeterminate}\n singleChoice={singleChoice}\n />\n ) : undefined\n }\n >\n <CellText>{item.text}</CellText>\n </Cell>\n </div>\n );\n};\n\nexport { ItemContent };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;AA2BA,MAAM,WAAW,GAAG,CAA8B,EAC9C,IAAI,EACJ,SAAS,EACT,WAAW,EACX,MAAM,EACN,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,MAAM,EACN,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EACF,OAAO,EAAE,qBAAqB,EAAA,QAAA,EAAA,CAE7B,QAAQ,IAAIC,GAAA,CAAC,yBAAyB,EAAA,EAAC,OAAO,EAAC,UAAU,EAAG,CAAA,EAC5D,CAAC,QAAQ,IAAIA,GAAC,CAAA,uBAAuB,IAAC,OAAO,EAAC,UAAU,EAAA,CAAG,IAC1D,CACT,EAEDA,GAAC,CAAA,IAAI,IACD,IAAI,EACA,SAAS,IACLA,GAAA,CAAC,MAAM,EAAA,EACH,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,GAC5B,IACF,SAAS,EAGjB,QAAA,EAAAA,GAAA,CAAC,QAAQ,EAAA,EAAA,QAAA,EAAE,IAAI,CAAC,IAAI,GAAY,EAC7B,CAAA,CAAA,EAAA,CACL,EACR;AACN;;;;"}
|
package/ItemContent.js
CHANGED
|
@@ -6,6 +6,6 @@ import '@hh.ru/magritte-ui-cell';
|
|
|
6
6
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
7
7
|
import './Action.js';
|
|
8
8
|
import '@hh.ru/magritte-ui-typography';
|
|
9
|
-
export { I as ItemContent } from './ItemContent-
|
|
9
|
+
export { I as ItemContent } from './ItemContent-1be2cb46.js';
|
|
10
10
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
11
11
|
//# sourceMappingURL=ItemContent.js.map
|
package/ItemsList.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Item } from './Item.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'classnames';
|
|
6
|
-
import './ItemContent-
|
|
6
|
+
import './ItemContent-1be2cb46.js';
|
|
7
7
|
import '@hh.ru/magritte-ui-cell';
|
|
8
8
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
9
9
|
import './Action.js';
|
package/TreeSelector.js
CHANGED
|
@@ -12,7 +12,7 @@ import { useIndeterminate } from './useIndeterminate.js';
|
|
|
12
12
|
import { useRenderInput } from './useRenderInput.js';
|
|
13
13
|
import './Item.js';
|
|
14
14
|
import 'classnames';
|
|
15
|
-
import './ItemContent-
|
|
15
|
+
import './ItemContent-1be2cb46.js';
|
|
16
16
|
import '@hh.ru/magritte-ui-cell';
|
|
17
17
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
18
18
|
import './Action.js';
|
|
@@ -10,7 +10,7 @@ import '@hh.ru/magritte-ui-spacing';
|
|
|
10
10
|
import './ItemsList.js';
|
|
11
11
|
import './Item.js';
|
|
12
12
|
import 'classnames';
|
|
13
|
-
import './ItemContent-
|
|
13
|
+
import './ItemContent-1be2cb46.js';
|
|
14
14
|
import '@hh.ru/magritte-ui-cell';
|
|
15
15
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
16
16
|
import './Action.js';
|
package/index.css
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
.magritte-wrapper___GHKV6_1-3-
|
|
1
|
+
.magritte-wrapper___GHKV6_1-3-2{
|
|
2
2
|
display:flex;
|
|
3
3
|
padding:12px 0;
|
|
4
4
|
gap:12px;
|
|
5
5
|
align-items:center;
|
|
6
6
|
}
|
|
7
|
-
.magritte-letter___yZOCU_1-3-
|
|
7
|
+
.magritte-letter___yZOCU_1-3-2{
|
|
8
8
|
width:24px;
|
|
9
9
|
flex-shrink:0;
|
|
10
10
|
text-align:center;
|
|
11
11
|
}
|
|
12
|
-
.magritte-icon___kO3Fj_1-3-
|
|
13
|
-
.magritte-space___xTO79_1-3-
|
|
12
|
+
.magritte-icon___kO3Fj_1-3-2,
|
|
13
|
+
.magritte-space___xTO79_1-3-2{
|
|
14
14
|
flex-shrink:0;
|
|
15
15
|
line-height:0;
|
|
16
16
|
width:24px;
|
|
17
17
|
}
|
|
18
|
-
.magritte-iconActive___4yrG5_1-3-
|
|
18
|
+
.magritte-iconActive___4yrG5_1-3-2{
|
|
19
19
|
cursor:pointer;
|
|
20
20
|
}
|
|
21
|
-
.magritte-content___ZRc6R_1-3-
|
|
21
|
+
.magritte-content___ZRc6R_1-3-2{
|
|
22
22
|
flex-grow:1;
|
|
23
23
|
}
|
|
24
|
-
.magritte-with-shift___ZErxZ_1-3-
|
|
24
|
+
.magritte-with-shift___ZErxZ_1-3-2{
|
|
25
25
|
margin-left:-36px;
|
|
26
26
|
}
|
|
27
|
-
.magritte-with-indent___MH9Vy_1-3-
|
|
27
|
+
.magritte-with-indent___MH9Vy_1-3-2{
|
|
28
28
|
margin-left:36px;
|
|
29
29
|
}
|
|
30
|
-
.magritte-item___2LtOL_1-3-
|
|
30
|
+
.magritte-item___2LtOL_1-3-2 > .magritte-children___kq-eq_1-3-2{
|
|
31
31
|
padding-left:36px;
|
|
32
32
|
}
|
|
33
|
-
.magritte-item___2LtOL_1-3-
|
|
33
|
+
.magritte-item___2LtOL_1-3-2.magritte-with-two-boxes___LWOy2_1-3-2 > .magritte-children___kq-eq_1-3-2{
|
|
34
34
|
padding-left:72px;
|
|
35
35
|
}
|
|
36
|
-
.magritte-item___2LtOL_1-3-
|
|
36
|
+
.magritte-item___2LtOL_1-3-2.magritte-with-three-boxes___cyVao_1-3-2 > .magritte-children___kq-eq_1-3-2{
|
|
37
37
|
padding-left:108px;
|
|
38
38
|
}
|
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import '@hh.ru/magritte-ui-spacing';
|
|
|
9
9
|
import './ItemsList.js';
|
|
10
10
|
import './Item.js';
|
|
11
11
|
import 'classnames';
|
|
12
|
-
import './ItemContent-
|
|
12
|
+
import './ItemContent-1be2cb46.js';
|
|
13
13
|
import '@hh.ru/magritte-ui-cell';
|
|
14
14
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
15
15
|
import './Action.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-tree-selector",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@hh.ru/magritte-common-fuzzy-search": "1.0.4",
|
|
23
23
|
"@hh.ru/magritte-ui-breakpoint": "4.0.2",
|
|
24
|
-
"@hh.ru/magritte-ui-card": "6.0.
|
|
24
|
+
"@hh.ru/magritte-ui-card": "6.0.6",
|
|
25
25
|
"@hh.ru/magritte-ui-cell": "2.2.12",
|
|
26
|
-
"@hh.ru/magritte-ui-checkable-card": "3.0.
|
|
26
|
+
"@hh.ru/magritte-ui-checkable-card": "3.0.9",
|
|
27
27
|
"@hh.ru/magritte-ui-checkbox-radio": "3.0.3",
|
|
28
28
|
"@hh.ru/magritte-ui-icon": "7.1.7",
|
|
29
29
|
"@hh.ru/magritte-ui-input": "5.0.21",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "cb9ae2f8bc2a076dcb5e45ab962cd0ff27c92f1d"
|
|
43
43
|
}
|