@c8y/style 1024.16.19 → 1024.18.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/style",
3
- "version": "1024.16.19",
3
+ "version": "1024.18.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity GmbH",
6
6
  "description": "Styles for Cumulocity IoT applications",
@@ -1,5 +1,4 @@
1
- @use "../../../../variables/index" as *;
2
-
1
+ @use '../../../../variables/index' as *;
3
2
 
4
3
  /**
5
4
  * resizaule grid - Component styles
@@ -18,8 +17,9 @@ c8y-resizable-grid {
18
17
  height: 100%;
19
18
  position: relative;
20
19
 
21
- // This CSS variable is set by the component and used here
20
+ // These CSS variables are set by the component and used here
22
21
  --col-a-width: var(--c8y-resizable-grid-default-width, 560px);
22
+ --col-a-height: var(--c8y-resizable-grid-default-height, 280px);
23
23
  }
24
24
 
25
25
  .resizable-grid-container {
@@ -44,10 +44,93 @@ c8y-resizable-grid {
44
44
  }
45
45
 
46
46
  &:has(.collapsed) {
47
- .resizer > i{
47
+ .resizer > i {
48
48
  display: block;
49
49
  }
50
50
  }
51
+
52
+ // Vertical (top/bottom) split: stack panes and size col-a by height instead of width.
53
+ &--vertical {
54
+ flex-direction: column;
55
+
56
+ // Below `md` the surrounding full-page layout provides no definite height (it is only
57
+ // defined from `md` up), so a fixed-height resizable split cannot be bounded — dragging
58
+ // would push content off-screen and clip it. Fall back to naturally-stacked panes with
59
+ // the divider hidden, so the page scrolls normally and all content stays reachable.
60
+ .col-a,
61
+ .col-b {
62
+ width: 100%;
63
+ height: auto;
64
+ min-height: 0;
65
+ flex: 0 0 auto;
66
+ }
67
+
68
+ .resizer {
69
+ display: none;
70
+ }
71
+
72
+ // Content that fills its height via flex (e.g. a Monaco editor, whose inner container is
73
+ // `height: 100%`) has no definite height to resolve against once the panes stack, so it
74
+ // collapses to zero. Give such editors a definite height in the stacked layout via a
75
+ // fixed flex-basis (`!important` overrides the `.flex-grow` utility on the editor).
76
+ c8y-editor {
77
+ flex: 0 0 240px !important;
78
+ }
79
+
80
+ @media (min-width: $screen-md-min) {
81
+ // In the bounded resizable layout the editor fills the pane via flex again.
82
+ c8y-editor {
83
+ flex: 1 1 auto !important;
84
+ }
85
+
86
+ // col-a's dragged size is its flex-basis (not a rigid height) and it is allowed to
87
+ // shrink. This keeps col-a + resizer + col-b within the container height, so dragging
88
+ // the divider down shrinks the bottom pane instead of pushing it off-screen.
89
+ .col-a {
90
+ flex: 0 1 var(--col-a-height);
91
+ }
92
+
93
+ .col-b {
94
+ flex: 1 1 0;
95
+ }
96
+
97
+ .collapsed {
98
+ width: 100% !important;
99
+ height: auto !important;
100
+ min-height: 0 !important;
101
+ min-width: 0;
102
+ flex: 0 0 0 !important;
103
+ }
104
+
105
+ .expanded {
106
+ width: 100% !important;
107
+ height: auto !important;
108
+ flex: 1 1 auto !important;
109
+ }
110
+
111
+ .resizer {
112
+ display: block;
113
+ width: 100%;
114
+ height: $size-8;
115
+ flex: 0 0 8px;
116
+ cursor: row-resize;
117
+
118
+ &::before {
119
+ top: 50%;
120
+ left: 0;
121
+ right: 0;
122
+ bottom: auto;
123
+ width: auto;
124
+ height: 1px;
125
+ transform: translateY(-50%);
126
+ }
127
+
128
+ > i {
129
+ transform: translate(-50%, -50%) rotate(90deg);
130
+ }
131
+ }
132
+ }
133
+ }
51
134
  }
52
135
 
53
136
  .col-a {
@@ -58,7 +141,7 @@ c8y-resizable-grid {
58
141
  display: flex;
59
142
  flex-direction: column;
60
143
 
61
- >* {
144
+ > * {
62
145
  flex: 1;
63
146
  min-height: 0;
64
147
  }
@@ -71,7 +154,7 @@ c8y-resizable-grid {
71
154
  display: flex;
72
155
  flex-direction: column;
73
156
 
74
- >* {
157
+ > * {
75
158
  flex: 1;
76
159
  min-height: 0;
77
160
  }
@@ -96,7 +179,7 @@ c8y-resizable-grid {
96
179
  background: $component-border-color;
97
180
  }
98
181
 
99
- >i {
182
+ > i {
100
183
  position: absolute;
101
184
  top: 50%;
102
185
  left: 50%;
@@ -104,22 +187,23 @@ c8y-resizable-grid {
104
187
  background-color: $component-background-default;
105
188
  border-radius: 50%;
106
189
  color: $component-color-text-muted;
107
- &::before{
190
+ &::before {
108
191
  transition: all 0.3s ease;
109
192
  display: block;
110
193
  }
111
194
  }
112
195
 
113
196
  .is-resizing &,
114
- &:hover, &:focus {
197
+ &:hover,
198
+ &:focus {
115
199
  &::before {
116
200
  background: $component-color-focus;
117
201
  }
118
202
 
119
- >i {
203
+ > i {
120
204
  color: $component-color-focus;
121
205
  display: block;
122
- &::before{
206
+ &::before {
123
207
  scale: 2;
124
208
  }
125
209
  }
@@ -130,8 +214,6 @@ c8y-resizable-grid {
130
214
  overflow-y: auto;
131
215
  }
132
216
 
133
-
134
-
135
217
  // Global styles applied when resizing to prevent text selection
136
218
  body.no-select {
137
219
  user-select: none;