@snack-uikit/tree 0.8.14-preview-ef08d0db.0 → 0.8.14-preview-95f36d41.0

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.
@@ -191,7 +191,7 @@ function TreeNode(_a) {
191
191
  return;
192
192
  }
193
193
  };
194
- const getNodeActions = Boolean(nested) ? parentActions : nodeActions;
194
+ const getNodeActions = nested ? parentActions : nodeActions;
195
195
  return (0, jsx_runtime_1.jsxs)("div", Object.assign({
196
196
  role: 'presentation',
197
197
  className: (0, classnames_1.default)(styles_module_scss_1.default.treeNode, className)
@@ -202,7 +202,7 @@ function TreeNode(_a) {
202
202
  horizontal: true,
203
203
  visible: showLines,
204
204
  "data-test-id": constants_1.TEST_IDS.line
205
- }), !parentNode && !Boolean(nested) && (0, jsx_runtime_1.jsx)(TreeLine_1.TreeLine, {
205
+ }), !parentNode && !nested && (0, jsx_runtime_1.jsx)(TreeLine_1.TreeLine, {
206
206
  visible: false
207
207
  }), isExpandable && (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, {
208
208
  size: 'xs',
@@ -138,8 +138,8 @@ export function TreeNode(_a) {
138
138
  return;
139
139
  }
140
140
  };
141
- const getNodeActions = Boolean(nested) ? parentActions : nodeActions;
142
- return (_jsxs("div", Object.assign({ role: 'presentation', className: cn(styles.treeNode, className) }, extractSupportProps(rest), { "data-node-id": id, children: [parentNode && (_jsx(TreeLine, { halfWidth: Boolean(nested), horizontal: true, visible: showLines, "data-test-id": TEST_IDS.line })), !parentNode && !Boolean(nested) && _jsx(TreeLine, { visible: false }), isExpandable && (_jsx(ButtonFunction, { size: 'xs', icon: _jsx(ChevronRightSVG, {}), loading: isLoading, onClick: onChevronClick, "data-expanded": isExpanded || undefined, className: styles.treeNodeExpandButton, tabIndex: -1, "data-test-id": TEST_IDS.chevron })), _jsxs("div", { role: 'treeitem', "aria-expanded": isExpanded, "aria-selected": isSelectable ? isSelected : undefined, "aria-disabled": disabled, "data-multiselect": isMultiSelect || undefined, "data-droplist-active": isDroplistOpen || isDroplistTriggerFocused || undefined, onClick: handleClick, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: resetFocusPosition, tabIndex: tabIndexAvailable ? 0 : -1, className: styles.treeNodeContent, "data-test-id": TEST_IDS.item, ref: ref, children: [(isMultiSelect || showToggle) && (_jsxs("div", { className: styles.treeNodeCheckboxWrap, children: [isMultiSelect && (_jsx(Checkbox, { size: 's', disabled: disabled, checked: isSelected, indeterminate: !isSelected && (nestedNodesSelection === null || nestedNodesSelection === void 0 ? void 0 : nestedNodesSelection.someSelected), onChange: handleSelect, onClick: stopPropagationClick, "data-test-id": TEST_IDS.checkbox, tabIndex: -1 })), showToggle && (_jsx(Radio, { size: 's', checked: isSelected, disabled: disabled || (!isSelected && (nestedNodesSelection === null || nestedNodesSelection === void 0 ? void 0 : nestedNodesSelection.someSelected)), "data-test-id": TEST_IDS.radio, tabIndex: -1 }))] })), treeNodeIcon && (_jsx("div", { className: styles.treeNodeIcon, "data-test-id": TEST_IDS.icon, children: treeNodeIcon })), _jsxs(Typography.SansBodyM, { tag: 'div', className: styles.treeNodeTitle, children: [typeof title === 'string' && _jsx(TruncateString, { text: title, "data-test-id": TEST_IDS.title }), typeof title !== 'string' && title({ id, disabled, nested })] }), getNodeActions && (_jsx(TreeNodeActions, { getNodeActions: getNodeActions, node: {
141
+ const getNodeActions = nested ? parentActions : nodeActions;
142
+ return (_jsxs("div", Object.assign({ role: 'presentation', className: cn(styles.treeNode, className) }, extractSupportProps(rest), { "data-node-id": id, children: [parentNode && (_jsx(TreeLine, { halfWidth: Boolean(nested), horizontal: true, visible: showLines, "data-test-id": TEST_IDS.line })), !parentNode && !nested && _jsx(TreeLine, { visible: false }), isExpandable && (_jsx(ButtonFunction, { size: 'xs', icon: _jsx(ChevronRightSVG, {}), loading: isLoading, onClick: onChevronClick, "data-expanded": isExpanded || undefined, className: styles.treeNodeExpandButton, tabIndex: -1, "data-test-id": TEST_IDS.chevron })), _jsxs("div", { role: 'treeitem', "aria-expanded": isExpanded, "aria-selected": isSelectable ? isSelected : undefined, "aria-disabled": disabled, "data-multiselect": isMultiSelect || undefined, "data-droplist-active": isDroplistOpen || isDroplistTriggerFocused || undefined, onClick: handleClick, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: resetFocusPosition, tabIndex: tabIndexAvailable ? 0 : -1, className: styles.treeNodeContent, "data-test-id": TEST_IDS.item, ref: ref, children: [(isMultiSelect || showToggle) && (_jsxs("div", { className: styles.treeNodeCheckboxWrap, children: [isMultiSelect && (_jsx(Checkbox, { size: 's', disabled: disabled, checked: isSelected, indeterminate: !isSelected && (nestedNodesSelection === null || nestedNodesSelection === void 0 ? void 0 : nestedNodesSelection.someSelected), onChange: handleSelect, onClick: stopPropagationClick, "data-test-id": TEST_IDS.checkbox, tabIndex: -1 })), showToggle && (_jsx(Radio, { size: 's', checked: isSelected, disabled: disabled || (!isSelected && (nestedNodesSelection === null || nestedNodesSelection === void 0 ? void 0 : nestedNodesSelection.someSelected)), "data-test-id": TEST_IDS.radio, tabIndex: -1 }))] })), treeNodeIcon && (_jsx("div", { className: styles.treeNodeIcon, "data-test-id": TEST_IDS.icon, children: treeNodeIcon })), _jsxs(Typography.SansBodyM, { tag: 'div', className: styles.treeNodeTitle, children: [typeof title === 'string' && _jsx(TruncateString, { text: title, "data-test-id": TEST_IDS.title }), typeof title !== 'string' && title({ id, disabled, nested })] }), getNodeActions && (_jsx(TreeNodeActions, { getNodeActions: getNodeActions, node: {
143
143
  id,
144
144
  title,
145
145
  disabled,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Tree",
7
- "version": "0.8.14-preview-ef08d0db.0",
7
+ "version": "0.8.14-preview-95f36d41.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -38,14 +38,14 @@
38
38
  "dependencies": {
39
39
  "@snack-uikit/button": "0.19.5",
40
40
  "@snack-uikit/icons": "0.24.1",
41
- "@snack-uikit/list": "0.22.1-preview-ef08d0db.0",
42
- "@snack-uikit/toggles": "0.13.2",
43
- "@snack-uikit/truncate-string": "0.6.2",
41
+ "@snack-uikit/list": "0.22.1-preview-95f36d41.0",
42
+ "@snack-uikit/toggles": "0.13.3-preview-95f36d41.0",
43
+ "@snack-uikit/truncate-string": "0.6.3-preview-95f36d41.0",
44
44
  "@snack-uikit/typography": "0.8.3",
45
45
  "@snack-uikit/utils": "3.6.0",
46
46
  "classnames": "2.5.1",
47
47
  "react-transition-state": "2.1.1",
48
48
  "uncontrollable": "8.0.4"
49
49
  },
50
- "gitHead": "14adfd6eef16f278bd45da263b6e1c43e0e105b6"
50
+ "gitHead": "e866724aaa8b037109a05efa3e188a2c17989aa6"
51
51
  }
@@ -203,7 +203,7 @@ export function TreeNode({
203
203
  }
204
204
  };
205
205
 
206
- const getNodeActions = Boolean(nested) ? parentActions : nodeActions;
206
+ const getNodeActions = nested ? parentActions : nodeActions;
207
207
 
208
208
  return (
209
209
  <div
@@ -216,7 +216,7 @@ export function TreeNode({
216
216
  <TreeLine halfWidth={Boolean(nested)} horizontal visible={showLines} data-test-id={TEST_IDS.line} />
217
217
  )}
218
218
 
219
- {!parentNode && !Boolean(nested) && <TreeLine visible={false} />}
219
+ {!parentNode && !nested && <TreeLine visible={false} />}
220
220
 
221
221
  {isExpandable && (
222
222
  <ButtonFunction