@fluid-topics/ft-tree-selector 1.2.42 → 1.2.44

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.
@@ -1,6 +1,6 @@
1
1
  import { css } from "lit";
2
2
  import { designSystemVariables, FtCssVariableFactory, setVariable } from "@fluid-topics/ft-wc-utils";
3
- import { FtButtonCssVariables, FtButtonDenseCssVariables } from "@fluid-topics/ft-button";
3
+ import { FtButtonCssVariables } from "@fluid-topics/ft-button";
4
4
  import { FtTypographyCssVariables } from "@fluid-topics/ft-typography";
5
5
  export const FtTreeSelectorCssVariables = {
6
6
  expandButtonColor: FtCssVariableFactory.extend("--ft-tree-selector-expand-button-color", "Color of the expand button", designSystemVariables.colorOnSurfaceMedium),
@@ -54,33 +54,26 @@ export const styles = css `
54
54
  position: relative;
55
55
  }
56
56
 
57
- [part="level"] [part="children"] {
58
- padding-left: calc((${FtButtonCssVariables.iconSize} / 2))
57
+ [part="level"] > [part="children"] {
58
+ padding-left: 14px; /* Align vertical line with the tip of the expand arrow */
59
59
  }
60
60
 
61
61
  [part="children"] [part="children"] {
62
- padding-left: calc((${FtButtonCssVariables.iconSize} / 2) + ${FtTreeSelectorCssVariables.levelPadding})
62
+ padding-left: calc(14px + ${FtTreeSelectorCssVariables.levelPadding})
63
63
  }
64
64
 
65
- [part="children"] [part="level"] [part="actions"] {
65
+ [part="children"] > [part="level"] > [part="actions"] {
66
66
  padding-left: ${FtTreeSelectorCssVariables.levelPadding}
67
67
  }
68
68
 
69
- /* Padding for when the leaf is brother of an expandable.*/
70
- [part="children"].with-expandable > [part="level"].leaf [part="actions"] {
71
- padding-left: calc(${FtButtonCssVariables.iconSize} + ${FtButtonDenseCssVariables.horizontalPadding} + ${FtTreeSelectorCssVariables.levelPadding});
72
- }
73
-
74
- /* Padding for when the leaf is brother of an expandable and at first level.*/
75
- .ft-tree-selector.with-expandable > [part="level"].leaf [part="actions"] {
76
- padding-left: calc(${FtButtonCssVariables.iconSize} + ${FtButtonDenseCssVariables.horizontalPadding});
77
- }
78
-
79
- .expandable [part="level"].leaf [part="actions"] {
80
- padding-left: calc(${FtTreeSelectorCssVariables.levelPadding} + ${FtButtonCssVariables.iconSize});
69
+ .with-expandable [part="expand"] {
70
+ width: 28px;
81
71
  }
82
72
 
83
73
  [part="expand"] {
74
+ ${setVariable(FtButtonCssVariables.iconSize, "24px")};
75
+ ${setVariable(FtButtonCssVariables.horizontalPadding, "4px")};
76
+ display: block;
84
77
  ${setVariable(FtButtonCssVariables.color, FtTreeSelectorCssVariables.expandButtonColor)};
85
78
  ${setVariable(FtButtonCssVariables.backgroundColor, FtTreeSelectorCssVariables.expandButtonBackgroundColor)};
86
79
  flex-shrink: 0;
@@ -96,9 +89,9 @@ export const styles = css `
96
89
  position: relative;
97
90
  }
98
91
 
99
- [part="children"] [part="level"] [part="actions"]:before,
100
- [part="children"] [part="level"]:after,
101
- [part="children"] [part="level"]:last-child [part="actions"]:after {
92
+ [part="children"] > [part="level"] > [part="actions"]:before,
93
+ [part="children"] > [part="level"]:after,
94
+ [part="children"] > [part="level"]:last-child > [part="actions"]:after {
102
95
  position: absolute;
103
96
  content: "";
104
97
  left: 0;
@@ -108,19 +101,19 @@ export const styles = css `
108
101
  /* Vertical lines */
109
102
 
110
103
  /* For all level except the last one, the vertical line is on the left of all the "[part="level"]" container to auto-scale with the content*/
111
- [part="children"] [part="level"]:after {
104
+ [part="children"] > [part="level"]:after {
112
105
  border-left: 1px solid ${FtTreeSelectorCssVariables.treeLinesColor};
113
106
  height: 100%;
114
107
  top: 0;
115
108
  }
116
109
 
117
- [part="children"] [part="level"]:last-child:after {
110
+ [part="children"] > [part="level"]:last-child:after {
118
111
  border: none;
119
112
  }
120
113
 
121
114
  /* For the last level of a tree, the line should stop at the middle of the parent node. So we need to move it to "actions". Moving it allow the label
122
115
  to be longer than one line and the tree line to remain aline */
123
- [part="children"] [part="level"]:last-child [part="actions"]:after {
116
+ [part="children"] > [part="level"]:last-child > [part="actions"]:after {
124
117
  border-left: 1px solid ${FtTreeSelectorCssVariables.treeLinesColor};
125
118
  height: 50%;
126
119
  bottom: 50%;
@@ -130,16 +123,16 @@ export const styles = css `
130
123
  /* Horizontal lines */
131
124
 
132
125
  /*The actions support the horizontal line, this allow the label to be longer than one line and the tree lien to remain aline */
133
- [part="children"] [part="level"] [part="actions"]:before {
126
+ [part="children"] > [part="level"] > [part="actions"]:before {
134
127
  border-top: 1px solid ${FtTreeSelectorCssVariables.treeLinesColor};
135
- width: ${FtTreeSelectorCssVariables.levelPadding};
128
+ width: calc(${FtTreeSelectorCssVariables.levelPadding} - 2px);
136
129
  height: 100%;
137
130
  top: 50%;
138
131
  }
139
132
 
140
- [part="children"] [part="level"].leaf [part="actions"]:before {
133
+ [part="children"] > [part="level"].leaf > [part="actions"]:before {
141
134
  border-top: 1px solid ${FtTreeSelectorCssVariables.treeLinesColor};
142
- width: 42px;
135
+ width: calc(${FtTreeSelectorCssVariables.levelPadding} + 26px);
143
136
  height: 100%;
144
137
  top: 50%
145
138
  }
@@ -13,7 +13,3 @@ export interface FtTreeChangedDetail {
13
13
  value: string;
14
14
  selected: boolean;
15
15
  }
16
- export interface FtTreeExpandedChangeDetail {
17
- value: string;
18
- expanded: boolean;
19
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-tree-selector",
3
- "version": "1.2.42",
3
+ "version": "1.2.44",
4
4
  "description": "A hierarchical selector for tree\n",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,11 +19,11 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-wc-utils": "1.2.42",
22
+ "@fluid-topics/ft-wc-utils": "1.2.44",
23
23
  "lit": "3.1.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@fluid-topics/ft-wc-test-utils": "1.2.42"
26
+ "@fluid-topics/ft-wc-test-utils": "1.2.44"
27
27
  },
28
- "gitHead": "072e48eee7ad88adbaf13ada77bcda7fdd2baab4"
28
+ "gitHead": "9cbc1788339e7a5d3d4dc94c36ec5a28f31dba6c"
29
29
  }