create-basicjs 0.1.2 → 0.1.4
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 +1 -1
- package/payload/starter/AGENTS.md +1 -1
- package/payload/starter/_basic/VERSION +1 -1
- package/payload/starter/_basic/comp/left-menu.js +9 -4
- package/payload/starter/_basic/min/left-menu.min.js +1 -1
- package/payload/starter/_basic/tools/check.js +2 -2
- package/payload/templates/panel/index.htm +4 -0
- package/payload/templates/panel/module1/empty-main.htm +0 -1
- package/payload/templates/panel/module10/greenhouse.htm +8 -3
- package/payload/templates/panel/module11/arduino-projects.htm +5 -1
- package/payload/templates/panel/module2/empty-full.htm +0 -1
- package/payload/templates/panel/module3/empty-right.htm +0 -1
- package/payload/templates/panel/module4/empty-main-topbar.htm +0 -1
- package/payload/templates/panel/module5/empty-right-topbar.htm +0 -1
- package/payload/templates/panel/module6/energy-hub.htm +7 -3
- package/payload/templates/panel/module7/3d-printers.htm +0 -1
- package/payload/templates/panel/module8/cold-rooms.htm +4 -1
- package/payload/templates/panel/module9/elevator-fleet.htm +9 -2
package/package.json
CHANGED
|
@@ -79,6 +79,6 @@ window.checkViews = {
|
|
|
79
79
|
};
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
It checks every page, also the ones in folders. A page
|
|
82
|
+
It checks every page, also the ones in folders. A page that can not be checked alone can say `<meta name="basic-check" content="skip">`.
|
|
83
83
|
|
|
84
84
|
The tool needs Chrome or Edge. When it can not run, run `node --check` on the files you changed, and tell the user that the page was not opened.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.4
|
|
@@ -10,7 +10,9 @@ UI COMPONENT TEMPLATE
|
|
|
10
10
|
- The menu opens when the mouse is over it. On a touch device there is no hover, so it opens with a tap:
|
|
11
11
|
the first tap opens the menu (it does not select an item, because the texts are not visible when it is closed),
|
|
12
12
|
the second tap selects the item and closes the menu. A tap outside the menu also closes it.
|
|
13
|
-
-- openOnClick: "auto" (touch device: tap, mouse: hover), 1: always tap, 0: always hover
|
|
13
|
+
-- openOnClick: "auto" (touch device: tap, mouse: hover), 1: always tap, 0: always hover, "direct": a tap selects at
|
|
14
|
+
once and the menu stays closed (2026-11-02, for a short menu with clear icons).
|
|
15
|
+
-- itemHeight: the height of a button item. A page fitted with page.fit() is zoomed: for a finger give Ex: 44 / page.zoom.
|
|
14
16
|
-- leftMenu.setOpenOnClick(1) changes it later.
|
|
15
17
|
|
|
16
18
|
Started Date: December 2024
|
|
@@ -26,6 +28,7 @@ Webpage: https://bug7a.github.io/js-components/
|
|
|
26
28
|
const LeftMenuDefaults = {
|
|
27
29
|
key: "0",
|
|
28
30
|
expandedWidth: 250, // Expanded width on hover
|
|
31
|
+
itemHeight: 40, // The height of a button item
|
|
29
32
|
topBarHeight: 40, // Height of top bar to account for
|
|
30
33
|
backgroundColor: "#141414", // Menu background color
|
|
31
34
|
hoverColor: "rgba(255, 255, 255, 0.05)", // Hover color for buttons
|
|
@@ -82,7 +85,7 @@ const LeftMenu = function(params = {}) {
|
|
|
82
85
|
|
|
83
86
|
const buttonBox = startBox({
|
|
84
87
|
width: "100%",
|
|
85
|
-
height:
|
|
88
|
+
height: box.itemHeight,
|
|
86
89
|
color: "transparent",
|
|
87
90
|
clickable: 1,
|
|
88
91
|
position: "relative",
|
|
@@ -129,7 +132,7 @@ const LeftMenu = function(params = {}) {
|
|
|
129
132
|
if (event) event.stopPropagation();
|
|
130
133
|
|
|
131
134
|
// WHY: Touch device, closed menu: only the icons are visible. The first tap opens the menu, it does not select.
|
|
132
|
-
if (useTapMode && !isExpanded) {
|
|
135
|
+
if (useTapMode && !isExpanded && box.openOnClick !== "direct") {
|
|
133
136
|
expandMenu();
|
|
134
137
|
return;
|
|
135
138
|
}
|
|
@@ -278,6 +281,8 @@ const LeftMenu = function(params = {}) {
|
|
|
278
281
|
box.openOnClick = openOnClick;
|
|
279
282
|
if (openOnClick === "auto") {
|
|
280
283
|
useTapMode = isTouchDevice();
|
|
284
|
+
} else if (openOnClick === "direct") {
|
|
285
|
+
useTapMode = 1;
|
|
281
286
|
} else {
|
|
282
287
|
useTapMode = basic.isOn(openOnClick) ? 1 : 0;
|
|
283
288
|
}
|
|
@@ -465,7 +470,7 @@ const LeftMenu = function(params = {}) {
|
|
|
465
470
|
|
|
466
471
|
// Tap on the menu (also on an empty place of it): open it. (Touch device)
|
|
467
472
|
box.on("click", function() {
|
|
468
|
-
if (useTapMode && !isExpanded) expandMenu();
|
|
473
|
+
if (useTapMode && !isExpanded && box.openOnClick !== "direct") expandMenu();
|
|
469
474
|
});
|
|
470
475
|
|
|
471
476
|
// WHY: Capture, so it also works when the tap is stopped by another object. (Ex: a page that closes its own menu)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* Bismillah */
|
|
2
|
-
"use strict";const LeftMenuDefaults={key:"0",expandedWidth:250,topBarHeight:40,backgroundColor:"#141414",hoverColor:"rgba(255, 255, 255, 0.05)",selectedColor:"#583432",titleColor:"#8E342F",textColor:"rgba(255, 255, 255, 0.6)",selectedTextColor:"rgba(255, 255, 255, 0.95)",invertIconColor:1,openOnClick:"auto",items:[],onItemClick:function(t){},onMenuToggle:function(t){}},LeftMenu=function(t={}){mergeIntoIfMissing(t,LeftMenuDefaults);let o=startObject(t),e=0,n=null,r=0;const
|
|
2
|
+
"use strict";const LeftMenuDefaults={key:"0",expandedWidth:250,itemHeight:40,topBarHeight:40,backgroundColor:"#141414",hoverColor:"rgba(255, 255, 255, 0.05)",selectedColor:"#583432",titleColor:"#8E342F",textColor:"rgba(255, 255, 255, 0.6)",selectedTextColor:"rgba(255, 255, 255, 0.95)",invertIconColor:1,openOnClick:"auto",items:[],onItemClick:function(t){},onMenuToggle:function(t){}},LeftMenu=function(t={}){mergeIntoIfMissing(t,LeftMenuDefaults);let o=startObject(t),e=0,n=null,r=0;const i=[],a=[];o.publicVar=1,o.state="collapsed";const c=function(t,e){if("normal"===e)return t.css.background="transparent",t.icon.opacity=.6,void(t.textLabel.textColor=o.textColor);const n="selected"===e?o.selectedColor:o.hoverColor;t.css.background=`linear-gradient(to right, ${n} 0%, rgba(0,0,0,0) 100%)`,t.icon.opacity=1,t.textLabel.textColor=o.selectedTextColor},l=function(t){const i=startBox({width:"100%",height:o.itemHeight,color:"transparent",clickable:1,position:"relative"});return i.setMotion("background-color 0.2s"),i.cursor="pointer",i.data=t,HGroup({align:"left center",gap:20,padding:[8,0]}),i.icon=Icon({width:24,height:24,color:"transparent",opacity:.6}),i.icon.load(t.icon),1==o.invertIconColor&&(that.css.filter="invert(100%)"),i.textLabel=Label({text:t.text,textColor:o.textColor,fontSize:18,color:"transparent"}),endGroup(),endBox(),i.on("click",function(i,a){a&&a.stopPropagation(),!r||e||"direct"===o.openOnClick?(n!=t.key&&(t.dontSelect||s(t.key),o.onItemClick(t)),r&&p()):u()}),i.on("mouseover",function(){r||n!=t.key&&c(i,"hover")}),i.on("mouseout",function(){r||n!=t.key&&c(i,"normal")}),i},d=function(t){const e=startBox({width:"100%",height:29,color:"transparent",clickable:1,position:"relative"});e.data=t,Box(0,0,100,1,{color:o.titleColor}),that.top=14,that.opacity=.5,AutoLayout({align:"left center",padding:[40,0]});return Label({text:t.text,textColor:o.titleColor,fontSize:12,color:o.backgroundColor,padding:[12,0]}).css={fontWeight:"bold",textTransform:"uppercase"},endAutoLayout(),endBox(),e};o.clearSelection=function(){if(n){const t=a.find(t=>t.data.key===n);t&&"button"===t.data.type&&(c(t,"normal"),t.cursor="pointer"),n=null}};const s=function(t){o.clearSelection();const e=a.find(o=>o.data.key===t);e&&"button"===e.data.type&&(c(e,"selected"),e.cursor="default",n=t)},u=function(){e||(e=1,o.state="expanded",o.width=o.expandedWidth,o.onMenuToggle(1))},p=function(){e&&(e=0,o.state="collapsed",o.width=40,o.onMenuToggle(0))};o.setOpenOnClick=function(t){return o.openOnClick=t,r="auto"===t?window.matchMedia&&window.matchMedia("(hover: none)").matches||window.matchMedia&&window.matchMedia("(pointer: coarse)").matches?1:basic.isMobile():"direct"===t||basic.isOn(t)?1:0,r||p(),r},o.isTapMode=function(){return r};const h=o.remove;o.superRemove=h,o.remove=function(){o&&(page.remove_onResize(f),h.call(o),o=null)},o.addItemToTop=function(t){i.push(t);const e="button"===t.type?l(t):d(t);return a.push(e),o.topBox.add(e),e},o.addItemToBottom=function(t){i.push(t);const e="button"===t.type?l(t):d(t);return a.push(e),o.bottomBox.add(e),e},o.removeItem=function(t){t===n&&o.clearSelection();const e=i.findIndex(o=>o.key===t);if(-1!==e){a[e].remove(),i.splice(e,1),a.splice(e,1)}},o.getSelectedItem=function(){return i.find(t=>t.key===n)},o.setSelectedItem=function(t){s(t)},o.expand=function(){u()},o.collapse=function(){p()},o.toggle=function(){e?p():u()},o.cursor="default",o.color=o.backgroundColor,o.height=`calc(100% - ${o.topBarHeight}px)`,o.width=40,o.bottom=0,o.left=0,o.round=0;o.scrollableBox=startBox(0,30,o.expandedWidth,0),that.color="transparent",that.scrollY=1,o.topBox=VGroup({align:"top left",gap:0,padding:0,height:"auto",width:"100%"}),that.position="relative",o.items.forEach(t=>{o.addItemToTop(t)}),endGroup(),endBox(),o.scrollBar=ScrollBar({scrollableBox:o.scrollableBox,bar_border:0,bar_round:3,bar_borderColor:"rgba(0, 0, 0, 1)",bar_width:4,bar_mouseOverWidth:4,bar_mouseOverColor:"#FFFFFF",bar_opacity:.4,bar_mouseOverOpacity:.9,bar_padding:2,bar_color:"#FFFFFF",neverHide:0,showDots:1});const f=function(){o.scrollableBox.height=o.height-60-o.bottomBox.height-30};return o.bottomBox=VGroup({align:"bottom left",gap:0,padding:0,height:"auto",width:o.expandedWidth}),that.bottom=30,that.left=0,that.color="transparent",o.bottomBox.onResize(function(t){f()}),page.onResize(f),endGroup(),o.setOpenOnClick(o.openOnClick),o.on("mouseenter",function(){r||u()}),o.on("mouseleave",function(){r||p()}),o.on("click",function(){r&&!e&&"direct"!==o.openOnClick&&u()}),o.listenTo(document,"pointerdown",function(t,n){o&&r&&e&&(o.elem.contains(n.target)||p())},!0),endObject(o)};
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// An app with more than one view tells it how to open them (the name of the file is the name of the view):
|
|
11
11
|
// window.checkViews = { orders: function () { App.showPage("orders"); }, settings: function () { App.showPage("settings"); } };
|
|
12
12
|
//
|
|
13
|
-
// Every page is checked, also the ones in folders. A page
|
|
14
|
-
//
|
|
13
|
+
// Every page is checked, also the ones in folders. A page that can not be checked alone says so, and the report counts
|
|
14
|
+
// it as skipped:
|
|
15
15
|
// <meta name="basic-check" content="skip">
|
|
16
16
|
//
|
|
17
17
|
// Exit code: 0 no problem, 1 problems found, 2 could not run.
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
// Ekran bu değerden genişse panel normal boyutta görünür (zoom 1).
|
|
103
103
|
// Daha dar ekranlarda, yerleşim bozulmasın diye panelin tamamı küçülür (zoom out).
|
|
104
104
|
const PAGE_FIT_WIDTH = 650;
|
|
105
|
+
const FINGER_HEIGHT = 44; // px on the screen: a row of the left menu that a finger can hit
|
|
105
106
|
|
|
106
107
|
// NOTE: page.fit(650) -> ekran >= 650px ise zoom 1, değilse zoom = ekranGenisligi / 650.
|
|
107
108
|
const fitPageWidth = function() {
|
|
@@ -239,7 +240,10 @@
|
|
|
239
240
|
// Left Menu
|
|
240
241
|
// WHY: The menu keeps its own default look (dark, red selection) in every theme, so
|
|
241
242
|
// it reads its own ink keys instead of Ink()/T.invertIcon, which follow the page.
|
|
243
|
+
// WHY: page.fit() zooms the page: on a phone the 40 px rows of the menu were 24 px high on the screen.
|
|
244
|
+
const isTouchScreen = window.matchMedia("(hover: none)").matches;
|
|
242
245
|
window.leftMenu = LeftMenu({
|
|
246
|
+
itemHeight: isTouchScreen ? Math.max(40, Math.round(FINGER_HEIGHT / page.zoom)) : 40,
|
|
243
247
|
backgroundColor: T.menu,
|
|
244
248
|
selectedColor: T.menuSelected,
|
|
245
249
|
titleColor: T.menuTitle,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="basic-check" content="skip">
|
|
5
4
|
|
|
6
5
|
<title>Greenhouse</title>
|
|
7
6
|
|
|
@@ -599,9 +598,11 @@
|
|
|
599
598
|
that.elem.style.flexWrap = "wrap";
|
|
600
599
|
|
|
601
600
|
HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
|
|
601
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
602
602
|
that.elem.style.flexWrap = "wrap";
|
|
603
603
|
|
|
604
604
|
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
605
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
605
606
|
Label({ text: "Greenhouse", fontSize: 26, textColor: Ink(0.95) });
|
|
606
607
|
that.elem.style.fontFamily = "opensans-bold";
|
|
607
608
|
lblHouse = Label({ text: "", fontSize: 14, textColor: Ink(0.5) });
|
|
@@ -624,15 +625,18 @@
|
|
|
624
625
|
endGroup();
|
|
625
626
|
|
|
626
627
|
HGroup({ width: "auto", height: "auto", align: "right center", gap: 16 });
|
|
628
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
627
629
|
|
|
628
630
|
VGroup({ width: "auto", height: "auto", align: "right center", gap: 0 });
|
|
631
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
629
632
|
lblClock = Label({ text: "", fontSize: 22, textColor: Ink(0.95) });
|
|
630
633
|
that.elem.style.fontVariantNumeric = "tabular-nums";
|
|
631
|
-
lblWeather = Label({ text: "", fontSize: 12, textColor: Ink(0.5) });
|
|
632
|
-
that.
|
|
634
|
+
lblWeather = Label({ text: "", width: "100%", fontSize: 12, textColor: Ink(0.5) });
|
|
635
|
+
that.css = { whiteSpace: "normal", textAlign: "right", width: "max-content", maxWidth: "100%" }; // WHY: On one line when it fits, wraps on a phone
|
|
633
636
|
endGroup();
|
|
634
637
|
|
|
635
638
|
const btnMore = createButton("More", "top-bar/apps.png", function () { });
|
|
639
|
+
btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
|
|
636
640
|
moreMenu = ContextMenu({
|
|
637
641
|
items: [
|
|
638
642
|
{ text: "Test: Heatwave outside", key: "heatwave" },
|
|
@@ -1348,6 +1352,7 @@
|
|
|
1348
1352
|
});
|
|
1349
1353
|
Theme.fillTableWidth(grpEventHost.table);
|
|
1350
1354
|
grpEventHost.table.elem.style.minWidth = "420px";
|
|
1355
|
+
grpEventHost.scrollX = 1; // WHY: a phone is narrower than the table
|
|
1351
1356
|
setDefaultContainerBox(previous);
|
|
1352
1357
|
};
|
|
1353
1358
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="basic-check" content="skip">
|
|
5
4
|
|
|
6
5
|
<title>Arduino Projects</title>
|
|
7
6
|
|
|
@@ -378,9 +377,11 @@
|
|
|
378
377
|
that.elem.style.flexWrap = "wrap";
|
|
379
378
|
|
|
380
379
|
HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
|
|
380
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
381
381
|
that.elem.style.flexWrap = "wrap";
|
|
382
382
|
|
|
383
383
|
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
384
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
384
385
|
Label({ text: "Arduino Projects", fontSize: 26, textColor: Ink(0.95) });
|
|
385
386
|
that.elem.style.fontFamily = "opensans-bold";
|
|
386
387
|
lblSubtitle = Label({ text: "", fontSize: 14, textColor: Ink(0.5) });
|
|
@@ -404,8 +405,10 @@
|
|
|
404
405
|
endGroup();
|
|
405
406
|
|
|
406
407
|
HGroup({ width: "auto", height: "auto", align: "right center", gap: 16 });
|
|
408
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
407
409
|
|
|
408
410
|
VGroup({ width: "auto", height: "auto", align: "right center", gap: 0 });
|
|
411
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
409
412
|
lblClock = Label({ text: "", fontSize: 22, textColor: Ink(0.95) });
|
|
410
413
|
that.elem.style.fontVariantNumeric = "tabular-nums";
|
|
411
414
|
lblUptime = Label({ text: "", fontSize: 12, textColor: Ink(0.5) });
|
|
@@ -413,6 +416,7 @@
|
|
|
413
416
|
endGroup();
|
|
414
417
|
|
|
415
418
|
const btnMore = createButton("More", "top-bar/apps.png", function () { });
|
|
419
|
+
btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
|
|
416
420
|
moreMenu = ContextMenu({
|
|
417
421
|
items: [
|
|
418
422
|
{ text: "Send a test line to the serial port", key: "serial" },
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="basic-check" content="skip">
|
|
5
4
|
|
|
6
5
|
<title>Energy Hub</title>
|
|
7
6
|
|
|
@@ -578,9 +577,11 @@
|
|
|
578
577
|
that.elem.style.paddingRight = "60px"; // WHY: The close button of the full view is on the right top.
|
|
579
578
|
|
|
580
579
|
HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
|
|
580
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
581
581
|
that.elem.style.flexWrap = "wrap";
|
|
582
582
|
|
|
583
583
|
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
584
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
584
585
|
Label({ text: "Energy Hub", fontSize: 26, textColor: Ink(0.95) });
|
|
585
586
|
that.elem.style.fontFamily = "opensans-bold";
|
|
586
587
|
Label({ text: system.site + " · Solar " + system.pv.peakKw + " kWp · Battery " + system.battery.capacity + " kWh · EV charger", fontSize: 14, textColor: Ink(0.5) });
|
|
@@ -592,15 +593,18 @@
|
|
|
592
593
|
endGroup();
|
|
593
594
|
|
|
594
595
|
HGroup({ width: "auto", height: "auto", align: "right center", gap: 16 });
|
|
596
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
595
597
|
|
|
596
598
|
VGroup({ width: "auto", height: "auto", align: "right center", gap: 0 });
|
|
599
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
597
600
|
lblClock = Label({ text: "", fontSize: 22, textColor: Ink(0.95) });
|
|
598
601
|
that.elem.style.fontVariantNumeric = "tabular-nums";
|
|
599
|
-
lblWeather = Label({ text: "", fontSize: 12, textColor: Ink(0.5) });
|
|
600
|
-
that.
|
|
602
|
+
lblWeather = Label({ text: "", width: "100%", fontSize: 12, textColor: Ink(0.5) });
|
|
603
|
+
that.css = { whiteSpace: "normal", textAlign: "right", width: "max-content", maxWidth: "100%" }; // WHY: On one line when it fits, wraps on a phone
|
|
601
604
|
endGroup();
|
|
602
605
|
|
|
603
606
|
const btnMore = createButton("More", "top-bar/apps.png", function () { });
|
|
607
|
+
btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
|
|
604
608
|
|
|
605
609
|
moreMenu = ContextMenu({
|
|
606
610
|
items: [
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="basic-check" content="skip">
|
|
5
4
|
|
|
6
5
|
<title>Cold Rooms</title>
|
|
7
6
|
|
|
@@ -561,9 +560,11 @@
|
|
|
561
560
|
|
|
562
561
|
// Title and device select
|
|
563
562
|
HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
|
|
563
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
564
564
|
that.elem.style.flexWrap = "wrap";
|
|
565
565
|
|
|
566
566
|
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
567
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
567
568
|
|
|
568
569
|
Label({
|
|
569
570
|
text: "Cold Rooms",
|
|
@@ -617,12 +618,14 @@
|
|
|
617
618
|
|
|
618
619
|
// Buttons
|
|
619
620
|
HGroup({ width: "auto", height: "auto", align: "right center", gap: 10 });
|
|
621
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
620
622
|
|
|
621
623
|
createButton("Refresh", "", function () {
|
|
622
624
|
reconnectDevice(device);
|
|
623
625
|
});
|
|
624
626
|
|
|
625
627
|
btnMore = createButton("More", "top-bar/apps.png", function () { });
|
|
628
|
+
btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
|
|
626
629
|
|
|
627
630
|
// MENU: More actions
|
|
628
631
|
moreMenu = ContextMenu({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="basic-check" content="skip">
|
|
5
4
|
|
|
6
5
|
<title>Elevator Fleet</title>
|
|
7
6
|
|
|
@@ -620,9 +619,11 @@
|
|
|
620
619
|
that.elem.style.flexWrap = "wrap";
|
|
621
620
|
|
|
622
621
|
HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
|
|
622
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
623
623
|
that.elem.style.flexWrap = "wrap";
|
|
624
624
|
|
|
625
625
|
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
626
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
626
627
|
Label({ text: "Elevator Fleet", fontSize: 26, textColor: Ink(0.95) });
|
|
627
628
|
that.elem.style.fontFamily = "opensans-bold";
|
|
628
629
|
lblBuilding = Label({ text: "", fontSize: 14, textColor: Ink(0.5) });
|
|
@@ -656,8 +657,10 @@
|
|
|
656
657
|
endGroup();
|
|
657
658
|
|
|
658
659
|
HGroup({ width: "auto", height: "auto", align: "right center", gap: 10 });
|
|
660
|
+
that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
|
|
659
661
|
|
|
660
662
|
const btnMore = createButton("More", "top-bar/apps.png", function () { });
|
|
663
|
+
btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
|
|
661
664
|
|
|
662
665
|
moreMenu = ContextMenu({
|
|
663
666
|
items: [
|
|
@@ -840,12 +843,15 @@
|
|
|
840
843
|
|
|
841
844
|
VGroup({ width: "100%", height: "auto", align: "left top", gap: 10 });
|
|
842
845
|
MODES.forEach(function (mode) {
|
|
843
|
-
RadioButton({
|
|
846
|
+
const radio = RadioButton({
|
|
844
847
|
group: "carMode", value: mode.value,
|
|
845
848
|
labelText: mode.text + "<br><span style='color:" + Ink(0.4) + "; font-size: 12px'>" + mode.desc + "</span>",
|
|
846
849
|
style: DARK_RADIO_STYLE,
|
|
847
850
|
onChange: function (self) { onModeChange(self.value); },
|
|
848
851
|
});
|
|
852
|
+
// WHY: A long description was cut by the card, on a desktop too
|
|
853
|
+
radio.css = { maxWidth: "100%" };
|
|
854
|
+
radio.label.css.whiteSpace = "normal";
|
|
849
855
|
});
|
|
850
856
|
endGroup();
|
|
851
857
|
|
|
@@ -1475,6 +1481,7 @@
|
|
|
1475
1481
|
});
|
|
1476
1482
|
Theme.fillTableWidth(grpEventHost.table);
|
|
1477
1483
|
grpEventHost.table.elem.style.minWidth = "420px";
|
|
1484
|
+
grpEventHost.scrollX = 1; // WHY: a phone is narrower than the table
|
|
1478
1485
|
setDefaultContainerBox(previous);
|
|
1479
1486
|
};
|
|
1480
1487
|
|