@hh.ru/magritte-ui-tree-selector 1.4.0 → 1.4.1

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 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-f98f0b9a.js';
5
+ import { s as styles, I as ItemContent } from './ItemContent-d63a26ba.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-4-0","letter":"magritte-letter___yZOCU_1-4-0","icon":"magritte-icon___kO3Fj_1-4-0","space":"magritte-space___xTO79_1-4-0","iconActive":"magritte-iconActive___4yrG5_1-4-0","content":"magritte-content___ZRc6R_1-4-0","with-shift":"magritte-with-shift___ZErxZ_1-4-0","withShift":"magritte-with-shift___ZErxZ_1-4-0","with-indent":"magritte-with-indent___MH9Vy_1-4-0","withIndent":"magritte-with-indent___MH9Vy_1-4-0","item":"magritte-item___2LtOL_1-4-0","children":"magritte-children___kq-eq_1-4-0","with-two-boxes":"magritte-with-two-boxes___LWOy2_1-4-0","withTwoBoxes":"magritte-with-two-boxes___LWOy2_1-4-0","with-three-boxes":"magritte-with-three-boxes___cyVao_1-4-0","withThreeBoxes":"magritte-with-three-boxes___cyVao_1-4-0"};
10
+ var styles = {"wrapper":"magritte-wrapper___GHKV6_1-4-1","letter":"magritte-letter___yZOCU_1-4-1","icon":"magritte-icon___kO3Fj_1-4-1","space":"magritte-space___xTO79_1-4-1","iconActive":"magritte-iconActive___4yrG5_1-4-1","content":"magritte-content___ZRc6R_1-4-1","with-shift":"magritte-with-shift___ZErxZ_1-4-1","withShift":"magritte-with-shift___ZErxZ_1-4-1","with-indent":"magritte-with-indent___MH9Vy_1-4-1","withIndent":"magritte-with-indent___MH9Vy_1-4-1","item":"magritte-item___2LtOL_1-4-1","children":"magritte-children___kq-eq_1-4-1","with-two-boxes":"magritte-with-two-boxes___LWOy2_1-4-1","withTwoBoxes":"magritte-with-two-boxes___LWOy2_1-4-1","with-three-boxes":"magritte-with-three-boxes___cyVao_1-4-1","withThreeBoxes":"magritte-with-three-boxes___cyVao_1-4-1"};
11
11
 
12
12
  const ItemContent = ({ item, hasAction, hasChildren, letter, isExpanded, isDisabled, onExpansion, hasLetterOnLevel, isSelected, onChange, isIndeterminate, 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, isExpanded, isDisab
19
19
  };
20
20
 
21
21
  export { ItemContent as I, styles as s };
22
- //# sourceMappingURL=ItemContent-f98f0b9a.js.map
22
+ //# sourceMappingURL=ItemContent-d63a26ba.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ItemContent-f98f0b9a.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 isExpanded: boolean;\n isSelected: boolean;\n isDisabled: boolean;\n onChange: (id: string, isSelected: boolean) => void;\n isIndeterminate: 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 isExpanded,\n isDisabled,\n onExpansion,\n hasLetterOnLevel,\n isSelected,\n onChange,\n isIndeterminate,\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 {isExpanded && <ChevronDownOutlinedSize24 initial=\"tertiary\" />}\n {!isExpanded && <ChevronUpOutlinedSize24 initial=\"tertiary\" />}\n </div>\n )}\n\n <Cell\n disabled={isDisabled}\n left={\n hasAction ? (\n <Action\n selected={isSelected}\n onChange={onChange}\n id={item.id}\n indeterminate={isIndeterminate}\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":";;;;;;;;;;AA4BA,MAAM,WAAW,GAAG,CAA8B,EAC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ACRD,IACI,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE;AAC/B,oBAAA,CAAC,MAAM,CAAC,UAAU,GAAG,WAAW;AACnC,iBAAA,CAAC,EACF,OAAO,EAAE,qBAAqB,EAAA,QAAA,EAAA,CAE7B,UAAU,IAAIC,GAAA,CAAC,yBAAyB,EAAA,EAAC,OAAO,EAAC,UAAU,GAAG,EAC9D,CAAC,UAAU,IAAIA,GAAA,CAAC,uBAAuB,EAAA,EAAC,OAAO,EAAC,UAAU,GAAG,CAC5D,EAAA,CAAA,CACT,EAEDA,GAAC,CAAA,IAAI,EACD,EAAA,QAAQ,EAAE,UAAU,EACpB,IAAI,EACA,SAAS,IACLA,GAAA,CAAC,MAAM,EACH,EAAA,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,aAAa,EAAE,eAAe,EAC9B,YAAY,EAAE,YAAY,EAC5B,CAAA,IACF,SAAS,EAGjB,QAAA,EAAAA,GAAA,CAAC,QAAQ,EAAA,EAAA,QAAA,EAAE,IAAI,CAAC,IAAI,GAAY,EAC7B,CAAA,CAAA,EAAA,CACL,EACR;AACN;;;;"}
1
+ {"version":3,"file":"ItemContent-d63a26ba.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 isExpanded: boolean;\n isSelected: boolean;\n isDisabled: boolean;\n onChange: (id: string, isSelected: boolean) => void;\n isIndeterminate: 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 isExpanded,\n isDisabled,\n onExpansion,\n hasLetterOnLevel,\n isSelected,\n onChange,\n isIndeterminate,\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 {isExpanded && <ChevronDownOutlinedSize24 initial=\"tertiary\" />}\n {!isExpanded && <ChevronUpOutlinedSize24 initial=\"tertiary\" />}\n </div>\n )}\n\n <Cell\n disabled={isDisabled}\n left={\n hasAction ? (\n <Action\n selected={isSelected}\n onChange={onChange}\n id={item.id}\n indeterminate={isIndeterminate}\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":";;;;;;;;;;AA4BA,MAAM,WAAW,G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AC,EAED,WAAW,KACRD,IACI,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE;AAC/B,oBAAA,CAAC,MAAM,CAAC,UAAU,GAAG,WAAW;AACnC,iBAAA,CAAC,EACF,OAAO,EAAE,qBAAqB,EAAA,QAAA,EAAA,CAE7B,UAAU,IAAIC,GAAA,CAAC,yBAAyB,EAAA,EAAC,OAAO,EAAC,UAAU,GAAG,EAC9D,CAAC,UAAU,IAAIA,GAAA,CAAC,uBAAuB,EAAA,EAAC,OAAO,EAAC,UAAU,GAAG,CAC5D,EAAA,CAAA,CACT,EAEDA,GAAC,CAAA,IAAI,EACD,EAAA,QAAQ,EAAE,UAAU,EACpB,IAAI,EACA,SAAS,IACLA,GAAA,CAAC,MAAM,EACH,EAAA,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,aAAa,EAAE,eAAe,EAC9B,YAAY,EAAE,YAAY,EAC5B,CAAA,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-f98f0b9a.js';
9
+ export { I as ItemContent } from './ItemContent-d63a26ba.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-f98f0b9a.js';
6
+ import './ItemContent-d63a26ba.js';
7
7
  import '@hh.ru/magritte-ui-cell';
8
8
  import '@hh.ru/magritte-ui-icon/icon';
9
9
  import './Action.js';
@@ -14,7 +14,7 @@ const MobileParentItem = ({ collection, item, selected, onClick, }) => {
14
14
  });
15
15
  return count;
16
16
  }, [collection, selected, item.id]);
17
- return (jsx(Card, { padding: 16, borderRadius: 12, showBorder: true, actionCard: true, onClick: onClick, children: jsx(Cell, { right: jsx(LabelRight, { counter: childrenSelectedCount ? childrenSelectedCount.toString() : undefined }), children: jsx(CellText, { children: item.text }) }) }));
17
+ return (jsx(Card, { padding: 16, borderRadius: 12, showBorder: true, actionCard: true, onClick: onClick, children: jsx(Cell, { right: jsx(LabelRight, { badge: childrenSelectedCount ? childrenSelectedCount.toString() : undefined }), children: jsx(CellText, { children: item.text }) }) }));
18
18
  };
19
19
 
20
20
  export { MobileParentItem };
@@ -1 +1 @@
1
- {"version":3,"file":"MobileParentItem.js","sources":["../src/MobileParentItem.tsx"],"sourcesContent":["import { ReactElement, useMemo } from 'react';\n\nimport { Card } from '@hh.ru/magritte-ui-card';\nimport { Cell, CellText, LabelRight } from '@hh.ru/magritte-ui-cell';\nimport TreeCollection from '@hh.ru/magritte-ui-tree-selector/collection/treeCollection';\nimport { AdditionalDefault, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\n\ninterface MobileParentItemProps<A extends AdditionalDefault> {\n collection: TreeCollection<A>;\n item: TreeModel<A>;\n selected: string[];\n onClick: () => void;\n}\n\nexport const MobileParentItem = <A extends AdditionalDefault>({\n collection,\n item,\n selected,\n onClick,\n}: MobileParentItemProps<A>): ReactElement => {\n const childrenSelectedCount = useMemo(() => {\n let count = 0;\n collection.walkChildren(item.id, (model) => {\n if (selected.includes(model.id)) {\n count += 1;\n }\n });\n\n return count;\n }, [collection, selected, item.id]);\n\n return (\n <Card padding={16} borderRadius={12} showBorder actionCard onClick={onClick}>\n <Cell right={<LabelRight counter={childrenSelectedCount ? childrenSelectedCount.toString() : undefined} />}>\n <CellText>{item.text}</CellText>\n </Cell>\n </Card>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAcO,MAAM,gBAAgB,GAAG,CAA8B,EAC1D,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,OAAO,GACgB,KAAkB;AACzC,IAAA,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAK;QACvC,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,KAAK,KAAI;YACvC,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;gBAC7B,KAAK,IAAI,CAAC,CAAC;AACd,aAAA;AACL,SAAC,CAAC,CAAC;AAEH,QAAA,OAAO,KAAK,CAAC;KAChB,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAEpC,QACIA,GAAC,CAAA,IAAI,EAAC,EAAA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,UAAU,EAAC,IAAA,EAAA,UAAU,EAAC,IAAA,EAAA,OAAO,EAAE,OAAO,EACvE,QAAA,EAAAA,GAAA,CAAC,IAAI,EAAA,EAAC,KAAK,EAAEA,GAAC,CAAA,UAAU,IAAC,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,GAAG,SAAS,EAAI,CAAA,EAAA,QAAA,EACtGA,GAAC,CAAA,QAAQ,EAAE,EAAA,QAAA,EAAA,IAAI,CAAC,IAAI,EAAY,CAAA,EAAA,CAC7B,EACJ,CAAA,EACT;AACN;;;;"}
1
+ {"version":3,"file":"MobileParentItem.js","sources":["../src/MobileParentItem.tsx"],"sourcesContent":["import { ReactElement, useMemo } from 'react';\n\nimport { Card } from '@hh.ru/magritte-ui-card';\nimport { Cell, CellText, LabelRight } from '@hh.ru/magritte-ui-cell';\nimport TreeCollection from '@hh.ru/magritte-ui-tree-selector/collection/treeCollection';\nimport { AdditionalDefault, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\n\ninterface MobileParentItemProps<A extends AdditionalDefault> {\n collection: TreeCollection<A>;\n item: TreeModel<A>;\n selected: string[];\n onClick: () => void;\n}\n\nexport const MobileParentItem = <A extends AdditionalDefault>({\n collection,\n item,\n selected,\n onClick,\n}: MobileParentItemProps<A>): ReactElement => {\n const childrenSelectedCount = useMemo(() => {\n let count = 0;\n collection.walkChildren(item.id, (model) => {\n if (selected.includes(model.id)) {\n count += 1;\n }\n });\n\n return count;\n }, [collection, selected, item.id]);\n\n return (\n <Card padding={16} borderRadius={12} showBorder actionCard onClick={onClick}>\n <Cell right={<LabelRight badge={childrenSelectedCount ? childrenSelectedCount.toString() : undefined} />}>\n <CellText>{item.text}</CellText>\n </Cell>\n </Card>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAcO,MAAM,gBAAgB,GAAG,CAA8B,EAC1D,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,OAAO,GACgB,KAAkB;AACzC,IAAA,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAK;QACvC,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,KAAK,KAAI;YACvC,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;gBAC7B,KAAK,IAAI,CAAC,CAAC;AACd,aAAA;AACL,SAAC,CAAC,CAAC;AAEH,QAAA,OAAO,KAAK,CAAC;KAChB,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAEpC,QACIA,GAAC,CAAA,IAAI,EAAC,EAAA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,UAAU,EAAC,IAAA,EAAA,UAAU,EAAC,IAAA,EAAA,OAAO,EAAE,OAAO,EACvE,QAAA,EAAAA,GAAA,CAAC,IAAI,EAAA,EAAC,KAAK,EAAEA,GAAC,CAAA,UAAU,IAAC,KAAK,EAAE,qBAAqB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,GAAG,SAAS,EAAI,CAAA,EAAA,QAAA,EACpGA,GAAC,CAAA,QAAQ,EAAE,EAAA,QAAA,EAAA,IAAI,CAAC,IAAI,EAAY,CAAA,EAAA,CAC7B,EACJ,CAAA,EACT;AACN;;;;"}
package/TreeSelector.js CHANGED
@@ -11,7 +11,7 @@ import '@hh.ru/magritte-ui-spacing';
11
11
  import './ItemsList.js';
12
12
  import './Item.js';
13
13
  import 'classnames';
14
- import './ItemContent-f98f0b9a.js';
14
+ import './ItemContent-d63a26ba.js';
15
15
  import '@hh.ru/magritte-ui-cell';
16
16
  import '@hh.ru/magritte-ui-icon/icon';
17
17
  import './Action.js';
@@ -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-f98f0b9a.js';
15
+ import './ItemContent-d63a26ba.js';
16
16
  import '@hh.ru/magritte-ui-cell';
17
17
  import '@hh.ru/magritte-ui-icon/icon';
18
18
  import './Action.js';
package/index.css CHANGED
@@ -1,38 +1,38 @@
1
- .magritte-wrapper___GHKV6_1-4-0{
1
+ .magritte-wrapper___GHKV6_1-4-1{
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-4-0{
7
+ .magritte-letter___yZOCU_1-4-1{
8
8
  width:24px;
9
9
  flex-shrink:0;
10
10
  text-align:center;
11
11
  }
12
- .magritte-icon___kO3Fj_1-4-0,
13
- .magritte-space___xTO79_1-4-0{
12
+ .magritte-icon___kO3Fj_1-4-1,
13
+ .magritte-space___xTO79_1-4-1{
14
14
  flex-shrink:0;
15
15
  line-height:0;
16
16
  width:24px;
17
17
  }
18
- .magritte-iconActive___4yrG5_1-4-0{
18
+ .magritte-iconActive___4yrG5_1-4-1{
19
19
  cursor:pointer;
20
20
  }
21
- .magritte-content___ZRc6R_1-4-0{
21
+ .magritte-content___ZRc6R_1-4-1{
22
22
  flex-grow:1;
23
23
  }
24
- .magritte-with-shift___ZErxZ_1-4-0{
24
+ .magritte-with-shift___ZErxZ_1-4-1{
25
25
  margin-left:-36px;
26
26
  }
27
- .magritte-with-indent___MH9Vy_1-4-0{
27
+ .magritte-with-indent___MH9Vy_1-4-1{
28
28
  margin-left:36px;
29
29
  }
30
- .magritte-item___2LtOL_1-4-0 > .magritte-children___kq-eq_1-4-0{
30
+ .magritte-item___2LtOL_1-4-1 > .magritte-children___kq-eq_1-4-1{
31
31
  padding-left:36px;
32
32
  }
33
- .magritte-item___2LtOL_1-4-0.magritte-with-two-boxes___LWOy2_1-4-0 > .magritte-children___kq-eq_1-4-0{
33
+ .magritte-item___2LtOL_1-4-1.magritte-with-two-boxes___LWOy2_1-4-1 > .magritte-children___kq-eq_1-4-1{
34
34
  padding-left:72px;
35
35
  }
36
- .magritte-item___2LtOL_1-4-0.magritte-with-three-boxes___cyVao_1-4-0 > .magritte-children___kq-eq_1-4-0{
36
+ .magritte-item___2LtOL_1-4-1.magritte-with-three-boxes___cyVao_1-4-1 > .magritte-children___kq-eq_1-4-1{
37
37
  padding-left:108px;
38
38
  }
package/index.js CHANGED
@@ -18,7 +18,7 @@ import '@hh.ru/magritte-ui-spacing';
18
18
  import './ItemsList.js';
19
19
  import './Item.js';
20
20
  import 'classnames';
21
- import './ItemContent-f98f0b9a.js';
21
+ import './ItemContent-d63a26ba.js';
22
22
  import '@hh.ru/magritte-ui-cell';
23
23
  import '@hh.ru/magritte-ui-icon/icon';
24
24
  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.4.0",
3
+ "version": "1.4.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -21,16 +21,16 @@
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.6",
25
- "@hh.ru/magritte-ui-cell": "2.2.12",
26
- "@hh.ru/magritte-ui-checkable-card": "3.0.9",
27
- "@hh.ru/magritte-ui-checkbox-radio": "3.0.3",
28
- "@hh.ru/magritte-ui-icon": "7.1.7",
29
- "@hh.ru/magritte-ui-input": "5.0.21",
24
+ "@hh.ru/magritte-ui-card": "6.0.7",
25
+ "@hh.ru/magritte-ui-cell": "3.0.0",
26
+ "@hh.ru/magritte-ui-checkable-card": "3.0.10",
27
+ "@hh.ru/magritte-ui-checkbox-radio": "3.0.4",
28
+ "@hh.ru/magritte-ui-icon": "7.1.8",
29
+ "@hh.ru/magritte-ui-input": "5.0.22",
30
30
  "@hh.ru/magritte-ui-mock-component": "1.0.10",
31
- "@hh.ru/magritte-ui-spacing": "2.0.23",
32
- "@hh.ru/magritte-ui-theme-provider": "1.1.23",
33
- "@hh.ru/magritte-ui-typography": "3.0.10"
31
+ "@hh.ru/magritte-ui-spacing": "2.0.24",
32
+ "@hh.ru/magritte-ui-theme-provider": "1.1.24",
33
+ "@hh.ru/magritte-ui-typography": "3.0.11"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "classnames": ">=2.3.2",
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "079f9054662c714de59315a0d7652297c5817647"
42
+ "gitHead": "2096654db9454114e1dbf70e7a7786d7e5b688b8"
43
43
  }