sample-ui-component-library 0.0.5-dev → 0.0.6-dev

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sample-ui-component-library",
3
- "version": "0.0.5-dev",
3
+ "version": "0.0.6-dev",
4
4
  "description": "A library which contains sample UI elements that can be used for populating layouts.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -17,9 +17,15 @@ import {
17
17
  */
18
18
  function Tab({id, label, onSelectTab}) {
19
19
  const { attributes, listeners, setNodeRef, transform } = useDraggable({id});
20
+
21
+ const style = {
22
+ transform: transform
23
+ ? `translate3d(${transform.x}px, ${transform.y}px, 0)`
24
+ : undefined
25
+ };
20
26
 
21
27
  return (
22
- <div ref={setNodeRef} id={id} onClick={onSelectTab} className="tab" {...listeners} {...attributes}>
28
+ <div ref={setNodeRef} style={style} id={id} onClick={onSelectTab} className="tab" {...listeners} {...attributes}>
23
29
  {label}
24
30
  </div>
25
31
  );
@@ -35,6 +35,7 @@ function useEvent(fn) {
35
35
  */
36
36
  const TreeNode = ({id, node, onRowClick}) => {
37
37
  const { attributes, listeners, setNodeRef, transform } = useDraggable({id});
38
+
38
39
  /**
39
40
  * Gets the appropriate icon for the node based on its type and collapsed state.
40
41
  * @returns <JSX>
@@ -51,9 +52,15 @@ const TreeNode = ({id, node, onRowClick}) => {
51
52
  * Sets the background color of the row if the node is selected.
52
53
  */
53
54
  const getRowStyle = () => {
55
+ const style = {
56
+ transform: transform
57
+ ? `translate3d(${transform.x}px, ${transform.y}px, 0)`
58
+ : undefined
59
+ };
54
60
  if (node.selected) {
55
- return {"backgroundColor": SELECTED_FILE_COLOR};
61
+ style["backgroundColor"] = SELECTED_FILE_COLOR;
56
62
  }
63
+ return style;
57
64
  }
58
65
 
59
66