@rettangoli/ui 1.0.13 → 1.0.14
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/dist/rettangoli-iife-layout.min.js +82 -50
- package/dist/rettangoli-iife-ui.min.js +67 -35
- package/package.json +1 -1
- package/src/components/sidebar/sidebar.store.js +2 -0
- package/src/components/sidebar/sidebar.view.yaml +1 -1
- package/src/primitives/view.js +8 -33
- package/src/styles/scrollStyles.js +32 -0
package/package.json
CHANGED
|
@@ -141,6 +141,7 @@ export const selectViewData = ({ props }) => {
|
|
|
141
141
|
const headerWidth = itemWidth;
|
|
142
142
|
|
|
143
143
|
const ah = mode === 'shrunk-lg' || mode === 'shrunk-md' ? 'c' : '';
|
|
144
|
+
const listAttrString = mode === 'full' ? 'sv' : 'sv hsb';
|
|
144
145
|
|
|
145
146
|
return {
|
|
146
147
|
containerAttrString,
|
|
@@ -163,6 +164,7 @@ export const selectViewData = ({ props }) => {
|
|
|
163
164
|
headerWidth,
|
|
164
165
|
selectedItemId,
|
|
165
166
|
ah,
|
|
167
|
+
listAttrString,
|
|
166
168
|
showHeader,
|
|
167
169
|
rightBorderWidth,
|
|
168
170
|
};
|
|
@@ -75,7 +75,7 @@ template:
|
|
|
75
75
|
- rtgl-text s=lg: ${header.label}
|
|
76
76
|
$else:
|
|
77
77
|
- rtgl-text s=lg: ${header.label}
|
|
78
|
-
- rtgl-view w=f h=1fg
|
|
78
|
+
- rtgl-view w=f h=1fg ph=${headerPadding} pb=lg g=xs ah=${ah} ${listAttrString}:
|
|
79
79
|
- $for item, i in items:
|
|
80
80
|
- $if item.type == "groupLabel":
|
|
81
81
|
- $if showGroupLabels:
|
package/src/primitives/view.js
CHANGED
|
@@ -28,15 +28,6 @@ const normalizeRawCssValue = (value) => {
|
|
|
28
28
|
return normalizedValue.length > 0 ? normalizedValue : null;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const normalizeDimensionOrRawCssValue = (value) => {
|
|
32
|
-
const normalizedValue = normalizeRawCssValue(value);
|
|
33
|
-
if (normalizedValue === null) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return dimensionWithUnit(normalizedValue);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
31
|
// Internal implementation without uhtml
|
|
41
32
|
class RettangoliViewElement extends HTMLElement {
|
|
42
33
|
static styleSheet = null;
|
|
@@ -102,9 +93,7 @@ class RettangoliViewElement extends HTMLElement {
|
|
|
102
93
|
"bgs",
|
|
103
94
|
"bgp",
|
|
104
95
|
"bgr",
|
|
105
|
-
"
|
|
106
|
-
"spi",
|
|
107
|
-
"stg",
|
|
96
|
+
"hsb",
|
|
108
97
|
"hide",
|
|
109
98
|
"show",
|
|
110
99
|
"sh",
|
|
@@ -178,15 +167,6 @@ class RettangoliViewElement extends HTMLElement {
|
|
|
178
167
|
const backgroundRepeat = normalizeRawCssValue(
|
|
179
168
|
this.getAttribute(addSizePrefix("bgr")),
|
|
180
169
|
);
|
|
181
|
-
const scrollBehavior = normalizeRawCssValue(
|
|
182
|
-
this.getAttribute(addSizePrefix("sbh")),
|
|
183
|
-
);
|
|
184
|
-
const scrollPaddingInline = normalizeDimensionOrRawCssValue(
|
|
185
|
-
this.getAttribute(addSizePrefix("spi")),
|
|
186
|
-
);
|
|
187
|
-
const scrollTargetGroup = normalizeRawCssValue(
|
|
188
|
-
this.getAttribute(addSizePrefix("stg")),
|
|
189
|
-
);
|
|
190
170
|
|
|
191
171
|
if (zIndex !== null) {
|
|
192
172
|
this._styles[size]["z-index"] = zIndex;
|
|
@@ -216,18 +196,6 @@ class RettangoliViewElement extends HTMLElement {
|
|
|
216
196
|
this._styles[size]["background-repeat"] = backgroundRepeat;
|
|
217
197
|
}
|
|
218
198
|
|
|
219
|
-
if (scrollBehavior !== null) {
|
|
220
|
-
this._styles[size]["scroll-behavior"] = scrollBehavior;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (scrollPaddingInline !== null) {
|
|
224
|
-
this._styles[size]["scroll-padding-inline"] = scrollPaddingInline;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
if (scrollTargetGroup !== null) {
|
|
228
|
-
this._styles[size]["scroll-target-group"] = scrollTargetGroup;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
199
|
applyDimensionToStyleBucket({
|
|
232
200
|
styleBucket: this._styles[size],
|
|
233
201
|
axis: "width",
|
|
@@ -335,6 +303,7 @@ class RettangoliViewElement extends HTMLElement {
|
|
|
335
303
|
// Handle scroll properties
|
|
336
304
|
const scrollHorizontal = this.hasAttribute(addSizePrefix("sh"));
|
|
337
305
|
const scrollVertical = this.hasAttribute(addSizePrefix("sv"));
|
|
306
|
+
const hideScrollbar = this.hasAttribute(addSizePrefix("hsb"));
|
|
338
307
|
const overflow = this.getAttribute(addSizePrefix("overflow"));
|
|
339
308
|
|
|
340
309
|
if (scrollHorizontal && scrollVertical) {
|
|
@@ -355,6 +324,12 @@ class RettangoliViewElement extends HTMLElement {
|
|
|
355
324
|
this._styles[size]["overflow"] = "hidden";
|
|
356
325
|
this._styles[size]["flex-wrap"] = "nowrap";
|
|
357
326
|
}
|
|
327
|
+
|
|
328
|
+
if (hideScrollbar) {
|
|
329
|
+
this._styles[size]["-ms-overflow-style"] = "none";
|
|
330
|
+
this._styles[size]["scrollbar-gutter"] = "auto";
|
|
331
|
+
this._styles[size]["scrollbar-width"] = "none";
|
|
332
|
+
}
|
|
358
333
|
});
|
|
359
334
|
|
|
360
335
|
// Update styles only if changed
|
|
@@ -48,5 +48,37 @@ export default css`
|
|
|
48
48
|
overflow: hidden;
|
|
49
49
|
flex-wrap: nowrap;
|
|
50
50
|
}
|
|
51
|
+
:host([hsb])::-webkit-scrollbar {
|
|
52
|
+
width: 0;
|
|
53
|
+
height: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@media only screen and (max-width: 1280px) {
|
|
57
|
+
:host([xl-hsb])::-webkit-scrollbar {
|
|
58
|
+
width: 0;
|
|
59
|
+
height: 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media only screen and (max-width: 1024px) {
|
|
64
|
+
:host([lg-hsb])::-webkit-scrollbar {
|
|
65
|
+
width: 0;
|
|
66
|
+
height: 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media only screen and (max-width: 768px) {
|
|
71
|
+
:host([md-hsb])::-webkit-scrollbar {
|
|
72
|
+
width: 0;
|
|
73
|
+
height: 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media only screen and (max-width: 640px) {
|
|
78
|
+
:host([sm-hsb])::-webkit-scrollbar {
|
|
79
|
+
width: 0;
|
|
80
|
+
height: 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
51
83
|
|
|
52
84
|
`
|