@hh.ru/magritte-ui-tree-selector 1.1.3 → 1.1.5
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-f9d346a8.js → ItemContent-ad35f8ca.js} +2 -2
- package/{ItemContent-f9d346a8.js.map → ItemContent-ad35f8ca.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 +13 -13
- 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-ad35f8ca.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-1-
|
|
10
|
+
var styles = {"wrapper":"magritte-wrapper___GHKV6_1-1-5","letter":"magritte-letter___yZOCU_1-1-5","icon":"magritte-icon___kO3Fj_1-1-5","iconActive":"magritte-iconActive___4yrG5_1-1-5","content":"magritte-content___ZRc6R_1-1-5","with-action":"magritte-with-action___-lsFP_1-1-5","withAction":"magritte-with-action___-lsFP_1-1-5","children":"magritte-children___kq-eq_1-1-5","with-letter":"magritte-with-letter___skx30_1-1-5","withLetter":"magritte-with-letter___skx30_1-1-5","with-chevron":"magritte-with-chevron___VOytc_1-1-5","withChevron":"magritte-with-chevron___VOytc_1-1-5","with-shift":"magritte-with-shift___ZErxZ_1-1-5","withShift":"magritte-with-shift___ZErxZ_1-1-5"};
|
|
11
11
|
|
|
12
12
|
const ItemContent = ({ item, hasAction, hasChildren, letter, expanded, onExpansion, hasChildrenOnLevel, hasLetterOnLevel, selected, onChange, indeterminate, singleChoice, hasActionOnLevel, }) => {
|
|
13
13
|
const handleExpandableClick = useCallback(() => onExpansion && onExpansion(item.id), [item.id, onExpansion]);
|
|
@@ -17,4 +17,4 @@ const ItemContent = ({ item, hasAction, hasChildren, letter, expanded, onExpansi
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { ItemContent as I, styles as s };
|
|
20
|
-
//# sourceMappingURL=ItemContent-
|
|
20
|
+
//# sourceMappingURL=ItemContent-ad35f8ca.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemContent-
|
|
1
|
+
{"version":3,"file":"ItemContent-ad35f8ca.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 hasChildrenOnLevel: boolean;\n selected: boolean;\n onChange: (id: string, isSelected: boolean) => void;\n indeterminate: boolean;\n singleChoice?: boolean;\n hasActionOnLevel: boolean;\n hasLetterOnLevel: boolean;\n}\n\nconst ItemContent = <A extends AdditionalDefault>({\n item,\n hasAction,\n hasChildren,\n letter,\n expanded,\n onExpansion,\n hasChildrenOnLevel,\n hasLetterOnLevel,\n selected,\n onChange,\n indeterminate,\n singleChoice,\n hasActionOnLevel,\n}: ItemContent<A>): ReactElement => {\n const handleExpandableClick = useCallback(() => onExpansion && onExpansion(item.id), [item.id, onExpansion]);\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 {hasActionOnLevel && hasChildren && !hasAction && (\n <div className={styles.icon}>\n <DotFilledSize24 initial=\"tertiary\" />\n </div>\n )}\n\n {(hasChildrenOnLevel || hasChildren) && (\n <div\n className={classnames(styles.icon, {\n [styles.iconActive]: hasChildren,\n })}\n onClick={handleExpandableClick}\n >\n {expanded && hasChildren && <ChevronDownOutlinedSize24 initial=\"tertiary\" />}\n {!expanded && hasChildren && <ChevronUpOutlinedSize24 initial=\"tertiary\" />}\n {hasChildrenOnLevel && !hasChildren && <DotFilledSize24 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,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,gBAAgB,GACH,KAAkB;IAC/B,MAAM,qBAAqB,GAAG,WAAW,CAAC,MAAM,WAAW,IAAI,WA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,EACA,SAAS,IACLA,GAAC,CAAA,MAAM,IACH,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,GAC5B,IACF,SAAS,YAGjBA,GAAC,CAAA,QAAQ,cAAE,IAAI,CAAC,IAAI,EAAY,CAAA,EAAA,CAC7B,CACL,EAAA,CAAA,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-ad35f8ca.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-ad35f8ca.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
|
@@ -6,7 +6,7 @@ import { useIndeterminate } from './useIndeterminate.js';
|
|
|
6
6
|
import './Item.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import 'classnames';
|
|
9
|
-
import './ItemContent-
|
|
9
|
+
import './ItemContent-ad35f8ca.js';
|
|
10
10
|
import '@hh.ru/magritte-ui-cell';
|
|
11
11
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
12
12
|
import './Action.js';
|
|
@@ -7,7 +7,7 @@ import { useSelected } from './useSelected.js';
|
|
|
7
7
|
import './ItemsList.js';
|
|
8
8
|
import './Item.js';
|
|
9
9
|
import 'classnames';
|
|
10
|
-
import './ItemContent-
|
|
10
|
+
import './ItemContent-ad35f8ca.js';
|
|
11
11
|
import '@hh.ru/magritte-ui-cell';
|
|
12
12
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
13
13
|
import './Action.js';
|
package/index.css
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
.magritte-wrapper___GHKV6_1-1-
|
|
1
|
+
.magritte-wrapper___GHKV6_1-1-5{
|
|
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-1-
|
|
7
|
+
.magritte-letter___yZOCU_1-1-5{
|
|
8
8
|
width:24px;
|
|
9
9
|
flex-shrink:0;
|
|
10
10
|
text-align:center;
|
|
11
11
|
}
|
|
12
|
-
.magritte-icon___kO3Fj_1-1-
|
|
12
|
+
.magritte-icon___kO3Fj_1-1-5{
|
|
13
13
|
flex-shrink:0;
|
|
14
14
|
line-height:0;
|
|
15
15
|
width:24px;
|
|
16
16
|
}
|
|
17
|
-
.magritte-iconActive___4yrG5_1-1-
|
|
17
|
+
.magritte-iconActive___4yrG5_1-1-5{
|
|
18
18
|
cursor:pointer;
|
|
19
19
|
}
|
|
20
|
-
.magritte-content___ZRc6R_1-1-
|
|
20
|
+
.magritte-content___ZRc6R_1-1-5{
|
|
21
21
|
flex-grow:1;
|
|
22
22
|
}
|
|
23
|
-
.magritte-with-action___-lsFP_1-1-
|
|
23
|
+
.magritte-with-action___-lsFP_1-1-5 > .magritte-children___kq-eq_1-1-5{
|
|
24
24
|
padding-left:36px;
|
|
25
25
|
}
|
|
26
|
-
.magritte-with-action___-lsFP_1-1-
|
|
26
|
+
.magritte-with-action___-lsFP_1-1-5.magritte-with-letter___skx30_1-1-5 > .magritte-children___kq-eq_1-1-5{
|
|
27
27
|
padding-left:72px;
|
|
28
28
|
}
|
|
29
|
-
.magritte-with-action___-lsFP_1-1-
|
|
29
|
+
.magritte-with-action___-lsFP_1-1-5.magritte-with-chevron___VOytc_1-1-5 > .magritte-children___kq-eq_1-1-5{
|
|
30
30
|
padding-left:72px;
|
|
31
31
|
}
|
|
32
|
-
.magritte-with-action___-lsFP_1-1-
|
|
32
|
+
.magritte-with-action___-lsFP_1-1-5.magritte-with-letter___skx30_1-1-5.magritte-with-chevron___VOytc_1-1-5 > .magritte-children___kq-eq_1-1-5{
|
|
33
33
|
padding-left:108px;
|
|
34
34
|
}
|
|
35
|
-
.magritte-with-letter___skx30_1-1-
|
|
35
|
+
.magritte-with-letter___skx30_1-1-5 > .magritte-children___kq-eq_1-1-5{
|
|
36
36
|
padding-left:36px;
|
|
37
37
|
}
|
|
38
|
-
.magritte-with-letter___skx30_1-1-
|
|
38
|
+
.magritte-with-letter___skx30_1-1-5.magritte-with-chevron___VOytc_1-1-5 > .magritte-children___kq-eq_1-1-5{
|
|
39
39
|
padding-left:72px;
|
|
40
40
|
}
|
|
41
|
-
.magritte-with-chevron___VOytc_1-1-
|
|
41
|
+
.magritte-with-chevron___VOytc_1-1-5 > .magritte-children___kq-eq_1-1-5{
|
|
42
42
|
padding-left:36px;
|
|
43
43
|
}
|
|
44
|
-
.magritte-with-shift___ZErxZ_1-1-
|
|
44
|
+
.magritte-with-shift___ZErxZ_1-1-5{
|
|
45
45
|
margin-left:-36px;
|
|
46
46
|
}
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import './ItemsList.js';
|
|
|
5
5
|
import './Item.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'classnames';
|
|
8
|
-
import './ItemContent-
|
|
8
|
+
import './ItemContent-ad35f8ca.js';
|
|
9
9
|
import '@hh.ru/magritte-ui-cell';
|
|
10
10
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
11
11
|
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.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"test": "yarn root:test $(pwd)"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@hh.ru/magritte-ui-cell": "2.2.
|
|
23
|
-
"@hh.ru/magritte-ui-checkbox-radio": "3.0.
|
|
22
|
+
"@hh.ru/magritte-ui-cell": "2.2.11",
|
|
23
|
+
"@hh.ru/magritte-ui-checkbox-radio": "3.0.2",
|
|
24
24
|
"@hh.ru/magritte-ui-icon": "7.1.6",
|
|
25
25
|
"@hh.ru/magritte-ui-mock-component": "1.0.10",
|
|
26
26
|
"@hh.ru/magritte-ui-theme-provider": "1.1.22",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "6fd7a0b7f2af780bd38bc43b2066bf6ec986eec3"
|
|
37
37
|
}
|