cedro 0.1.3 → 0.1.5
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/src/core/application.core.ts +19 -1
- package/src/index.ts +9 -8
- package/src/interfaces/application.interface.ts +4 -0
- package/src/interfaces/widget.interface.ts +10 -3
- package/src/types/orientation.type.ts +1 -0
- package/src/ui/Icon.ui.ts +3 -9
- package/src/ui/IconButton.ui.ts +39 -3
- package/src/ui/accordion.ts +71 -0
- package/src/ui/button.ui.ts +18 -1
- package/src/ui/buttonColor.ui.ts +24 -0
- package/src/ui/buttonmenu.ui.ts +59 -0
- package/src/ui/buttonstack.ui.ts +94 -0
- package/src/ui/checkbox.ui.ts +8 -0
- package/src/ui/datagrid.ui.ts +231 -0
- package/src/ui/draggable.ui.ts +165 -0
- package/src/ui/hpanel.ui.ts +127 -0
- package/src/ui/iconButtonMenu.ui.ts +59 -0
- package/src/ui/index.ts +46 -2
- package/src/ui/loading.ui.ts +10 -0
- package/src/ui/menu.ui.ts +41 -47
- package/src/ui/progressbar.ui.ts +74 -0
- package/src/ui/radiobutton.ts +8 -0
- package/src/ui/scroll.ui.ts +184 -0
- package/src/ui/select.ui.ts +3 -0
- package/src/ui/styles/accordion.css +9 -0
- package/src/ui/styles/button.css +0 -3
- package/src/ui/styles/buttoncolor.css +8 -0
- package/src/ui/styles/datagrid.css +36 -0
- package/src/ui/styles/draggable.css +9 -0
- package/src/ui/styles/hpanel.css +12 -0
- package/src/ui/styles/loading.css +12 -0
- package/src/ui/styles/loading.svg +49 -0
- package/src/ui/styles/main.css +7 -0
- package/src/ui/styles/menu.css +0 -1
- package/src/ui/styles/progressbar.css +19 -0
- package/src/ui/styles/scroll.css +4 -0
- package/src/ui/styles/stackbutton.css +205 -0
- package/src/ui/styles/tabs.css +78 -0
- package/src/ui/styles/textarea.css +13 -0
- package/src/ui/styles/textbox.css +66 -0
- package/src/ui/styles/toolbar.css +19 -0
- package/src/ui/styles/valuebar.css +26 -0
- package/src/ui/styles/vpanel.css +12 -0
- package/src/ui/styles/vstackbutton.css +202 -0
- package/src/ui/switch.ui.ts +7 -0
- package/src/ui/tabs.ui.ts +182 -0
- package/src/ui/textarea.ui.ts +20 -0
- package/src/ui/textbox.ui.ts +9 -0
- package/src/ui/toggle.ui.ts +49 -0
- package/src/ui/toolbar.ui.ts +38 -10
- package/src/ui/valuebar.ui.ts +116 -0
- package/src/ui/vpanel.ui.ts +128 -0
- package/src/ui/widget.ui.ts +63 -4
package/src/ui/menu.ui.ts
CHANGED
|
@@ -3,13 +3,16 @@ import { IWidget } from "../interfaces/widget.interface";
|
|
|
3
3
|
import { IconButton } from "./IconButton.ui";
|
|
4
4
|
import { Widget, WidgetAlignTypes, WidgetTypes } from "./widget.ui";
|
|
5
5
|
|
|
6
|
+
const MENU_OPTION_HEIGHT = 40;
|
|
7
|
+
|
|
6
8
|
export class Menu extends Widget {
|
|
7
9
|
background: Widget;
|
|
8
10
|
options: Map<string, IconButton>;
|
|
11
|
+
optionsWidth: Array<number>;
|
|
9
12
|
triggeredById: string | null;
|
|
10
13
|
triggeredBy: IWidget | null;
|
|
11
14
|
triggeredBySearchCode: any;
|
|
12
|
-
|
|
15
|
+
|
|
13
16
|
constructor(id: string, trigeredById: string | null, parent: IWidget | null = null) {
|
|
14
17
|
super(id, "div", parent);
|
|
15
18
|
|
|
@@ -20,16 +23,17 @@ export class Menu extends Widget {
|
|
|
20
23
|
|
|
21
24
|
this.triggeredById = trigeredById;
|
|
22
25
|
this.setType(WidgetTypes.CUSTOM);
|
|
26
|
+
this.setAlign(WidgetAlignTypes.VERTICAL);
|
|
27
|
+
this.setPadding(4);
|
|
23
28
|
|
|
24
29
|
this.triggeredBy = null;
|
|
25
30
|
|
|
26
31
|
this.options = new Map<string, IconButton>();
|
|
32
|
+
this.optionsWidth = new Array<number>();
|
|
27
33
|
|
|
28
34
|
this.addClass("WUIMenu");
|
|
29
35
|
this.addClass("WUIMenuTransparent");
|
|
30
36
|
|
|
31
|
-
this.withCalculation = false;
|
|
32
|
-
|
|
33
37
|
this.triggeredBySearchCode = setInterval(() => {
|
|
34
38
|
if (!this.triggeredById) {
|
|
35
39
|
clearInterval(this.triggeredBySearchCode);
|
|
@@ -64,44 +68,26 @@ export class Menu extends Widget {
|
|
|
64
68
|
this.background.setVisible(false);
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
private setFreeOptionWidth(): void {
|
|
68
|
-
for (const [, dataOption] of this.options) {
|
|
69
|
-
const option = dataOption as IconButton;
|
|
70
|
-
option.deleteClass("WUIMenuOptions100w");
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
71
|
private getMaxWidth(): number {
|
|
75
|
-
this.
|
|
76
|
-
this.deleteClass("WUIMenuHidden");
|
|
77
|
-
this.addClass("WUIMenuTransparent");
|
|
78
|
-
let maxWidth = 0;
|
|
79
|
-
for (const [, dataOption] of this.options) {
|
|
80
|
-
const option = dataOption as IconButton;
|
|
81
|
-
const optionWidth = option.getBody().clientWidth;
|
|
82
|
-
|
|
83
|
-
if (optionWidth > maxWidth) {
|
|
84
|
-
maxWidth = optionWidth;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return maxWidth;
|
|
72
|
+
return Math.max(...this.optionsWidth) * 1.1;
|
|
88
73
|
}
|
|
89
74
|
|
|
90
75
|
wakeUp(): void {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
76
|
+
const maxWidth = this.getMaxWidth();
|
|
77
|
+
let menuWidth = 0;
|
|
78
|
+
if (this.triggeredBy) {
|
|
79
|
+
const triggerWidth = this.triggeredBy.getBody().clientWidth;
|
|
80
|
+
if (triggerWidth > maxWidth) {
|
|
81
|
+
menuWidth = triggerWidth;
|
|
82
|
+
} else {
|
|
83
|
+
menuWidth = maxWidth;
|
|
98
84
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this.setW(maxWidth);
|
|
102
|
-
this.withCalculation = true;
|
|
85
|
+
} else {
|
|
86
|
+
menuWidth = maxWidth;
|
|
103
87
|
}
|
|
104
88
|
|
|
89
|
+
this.setW(menuWidth);
|
|
90
|
+
|
|
105
91
|
this.background.setVisible(true);
|
|
106
92
|
this.background.raisteTop();
|
|
107
93
|
|
|
@@ -110,6 +96,8 @@ export class Menu extends Widget {
|
|
|
110
96
|
this.deleteClass("WUIMenuHidden");
|
|
111
97
|
this.addClass("WUIMenuVisible");
|
|
112
98
|
|
|
99
|
+
this.render();
|
|
100
|
+
|
|
113
101
|
if (this.triggeredBy) {
|
|
114
102
|
const position = this.triggeredBy.getPosition(false);
|
|
115
103
|
|
|
@@ -118,7 +106,7 @@ export class Menu extends Widget {
|
|
|
118
106
|
|
|
119
107
|
const screenW = window.innerWidth;
|
|
120
108
|
const screenH = window.innerHeight;
|
|
121
|
-
const menuW =
|
|
109
|
+
const menuW = menuWidth;
|
|
122
110
|
const menuH = this.getBody().clientHeight;
|
|
123
111
|
let positionX = position.x;
|
|
124
112
|
let positionY = position.y;
|
|
@@ -126,8 +114,8 @@ export class Menu extends Widget {
|
|
|
126
114
|
let openRight = true;
|
|
127
115
|
let openBottom = true;
|
|
128
116
|
|
|
129
|
-
if (position.x + menuW
|
|
130
|
-
positionX = screenW - menuW
|
|
117
|
+
if (position.x + menuW > screenW) {
|
|
118
|
+
positionX = screenW - menuW;
|
|
131
119
|
openRight = false;
|
|
132
120
|
}
|
|
133
121
|
|
|
@@ -140,18 +128,16 @@ export class Menu extends Widget {
|
|
|
140
128
|
this.setX(positionX);
|
|
141
129
|
this.setY(positionY + triggerH);
|
|
142
130
|
} else if (openRight && !openBottom) {
|
|
143
|
-
this.setX(positionX
|
|
131
|
+
this.setX(positionX);
|
|
144
132
|
this.setY(positionY);
|
|
145
133
|
} else if (!openRight && openBottom) {
|
|
146
134
|
/*abajo izq: Works!*/
|
|
147
|
-
this.setX(positionX
|
|
135
|
+
this.setX(positionX);
|
|
148
136
|
this.setY(positionY + triggerH);
|
|
149
137
|
} else if (!openRight && !openBottom) {
|
|
150
|
-
this.setX(positionX
|
|
138
|
+
this.setX(positionX);
|
|
151
139
|
this.setY(positionY - triggerH);
|
|
152
140
|
}
|
|
153
|
-
|
|
154
|
-
//this.setY(positionY);
|
|
155
141
|
}
|
|
156
142
|
}
|
|
157
143
|
|
|
@@ -165,17 +151,19 @@ export class Menu extends Widget {
|
|
|
165
151
|
}
|
|
166
152
|
|
|
167
153
|
public clearOptions(): void {
|
|
154
|
+
this.optionsWidth = new Array<number>();
|
|
168
155
|
this.options.clear();
|
|
169
156
|
this.removeAllChilds();
|
|
170
|
-
this.withCalculation = false;
|
|
171
157
|
}
|
|
172
158
|
|
|
173
159
|
addOption(id: string, icon: string, label: string) {
|
|
174
|
-
const newOption = new IconButton(id, icon,
|
|
175
|
-
newOption.setType(WidgetTypes.
|
|
176
|
-
newOption.setAlign(WidgetAlignTypes.
|
|
160
|
+
const newOption = new IconButton(id, icon, null);
|
|
161
|
+
newOption.setType(WidgetTypes.FILL);
|
|
162
|
+
newOption.setAlign(WidgetAlignTypes.VERTICAL);
|
|
177
163
|
newOption.setText(label);
|
|
178
|
-
newOption.
|
|
164
|
+
newOption.setFixedSize(MENU_OPTION_HEIGHT);
|
|
165
|
+
//newOption.addClass("WUIMenuOptions");
|
|
166
|
+
//newOption.setH(MENU_OPTION_HEIGHT);
|
|
179
167
|
|
|
180
168
|
newOption.subscribe({
|
|
181
169
|
event: "click",
|
|
@@ -187,5 +175,11 @@ export class Menu extends Widget {
|
|
|
187
175
|
});
|
|
188
176
|
|
|
189
177
|
this.options.set(id, newOption);
|
|
178
|
+
|
|
179
|
+
const width = newOption.getBody().clientWidth;
|
|
180
|
+
this.optionsWidth.push(width);
|
|
181
|
+
const height = this.options.size * MENU_OPTION_HEIGHT;
|
|
182
|
+
this.addChild(newOption);
|
|
183
|
+
this.setH(height);
|
|
190
184
|
}
|
|
191
185
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Label } from "./label.ui";
|
|
2
|
+
import "./styles/progressbar.css";
|
|
3
|
+
import { Widget } from "./widget.ui";
|
|
4
|
+
|
|
5
|
+
const PROGRESS_BAR_HEIGHT = 40;
|
|
6
|
+
|
|
7
|
+
//icono para el progress bar interactivo humidity_high
|
|
8
|
+
|
|
9
|
+
export class ProgressBar extends Widget {
|
|
10
|
+
private value: number;
|
|
11
|
+
private paddingBar: number;
|
|
12
|
+
|
|
13
|
+
private bar: Widget;
|
|
14
|
+
private lblValue: Label;
|
|
15
|
+
|
|
16
|
+
public constructor(id: string, parent: Widget | null = null) {
|
|
17
|
+
super(id, "div", parent);
|
|
18
|
+
|
|
19
|
+
this.setH(PROGRESS_BAR_HEIGHT);
|
|
20
|
+
|
|
21
|
+
this.paddingBar = 0;
|
|
22
|
+
|
|
23
|
+
this.bar = new Widget(id + ".bar", "div", this);
|
|
24
|
+
this.bar.addClass("WUIProgressBarBar");
|
|
25
|
+
|
|
26
|
+
this.value = 0;
|
|
27
|
+
this.addClass("WUIProgressBarContainer");
|
|
28
|
+
|
|
29
|
+
this.lblValue = new Label(id + ".value", "span", this);
|
|
30
|
+
this.lblValue.setText(this.value + "%");
|
|
31
|
+
|
|
32
|
+
this.lblValue.addClass("WUIProgressBarLabel");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public setPaddingBar(p: number): void {
|
|
36
|
+
this.paddingBar = p;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public hideLabel(): void {
|
|
40
|
+
this.lblValue.setVisible(false);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public displayLabel(): void {
|
|
44
|
+
this.lblValue.setVisible(true);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public render(): void {
|
|
48
|
+
super.render();
|
|
49
|
+
|
|
50
|
+
const padding = this.paddingBar;
|
|
51
|
+
const width = this.getW() - padding;
|
|
52
|
+
const height = this.getH();
|
|
53
|
+
const widthBar = width * (this.value / 100);
|
|
54
|
+
|
|
55
|
+
this.lblValue.setX(width / 2 - this.lblValue.getW() / 2);
|
|
56
|
+
this.lblValue.setY(height / 2 - this.lblValue.getH() / 2);
|
|
57
|
+
this.lblValue.raisteTop();
|
|
58
|
+
|
|
59
|
+
this.bar.setX(padding);
|
|
60
|
+
this.bar.setY(padding);
|
|
61
|
+
this.bar.setW(widthBar);
|
|
62
|
+
this.bar.setH(height - padding * 2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public setValue(value: number): void {
|
|
66
|
+
this.value = value;
|
|
67
|
+
this.lblValue.setText(this.value + "%");
|
|
68
|
+
this.render();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public getValue(): number {
|
|
72
|
+
return this.value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ToggleButton } from "./toggle.ui";
|
|
2
|
+
import { Widget } from "./widget.ui";
|
|
3
|
+
|
|
4
|
+
export class RadioButton extends ToggleButton {
|
|
5
|
+
constructor(id: string, text: string = "", parent: Widget | null = null) {
|
|
6
|
+
super(id, text, "radio_button_unchecked", "radio_button_checked", parent);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { OrientationTypes } from "src/types/orientation.type";
|
|
2
|
+
import "./styles/scroll.css";
|
|
3
|
+
import { Widget, WidgetTypes } from "./widget.ui";
|
|
4
|
+
import { Draggable } from "./draggable.ui";
|
|
5
|
+
|
|
6
|
+
const SCROLL_SIZE = 10;
|
|
7
|
+
|
|
8
|
+
type ScrollData = {
|
|
9
|
+
scrollHeight: number;
|
|
10
|
+
areaHeight: number;
|
|
11
|
+
scrollBarHeight: number;
|
|
12
|
+
scrollWidth: number;
|
|
13
|
+
areaWidth: number;
|
|
14
|
+
scrollBarWidth: number;
|
|
15
|
+
scrollWidt: number;
|
|
16
|
+
availablePositionSize: number;
|
|
17
|
+
ratioScroll: number;
|
|
18
|
+
position: number;
|
|
19
|
+
scrollPositionY: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export class Scroll extends Widget {
|
|
23
|
+
contentArea: Widget;
|
|
24
|
+
orientation: OrientationTypes;
|
|
25
|
+
drag: Draggable;
|
|
26
|
+
|
|
27
|
+
constructor(id: string, contentArea: Widget, orientation: OrientationTypes = "vertical") {
|
|
28
|
+
super(id, "div", contentArea.getParent());
|
|
29
|
+
|
|
30
|
+
this.contentArea = contentArea;
|
|
31
|
+
this.orientation = orientation;
|
|
32
|
+
|
|
33
|
+
this.setType(WidgetTypes.CUSTOM);
|
|
34
|
+
|
|
35
|
+
this.getBody().style.overflow = "hidden";
|
|
36
|
+
this.getBody().style.position = "absolute";
|
|
37
|
+
|
|
38
|
+
this.addClass("WUIScrollbar");
|
|
39
|
+
|
|
40
|
+
this.drag = new Draggable(this, orientation);
|
|
41
|
+
|
|
42
|
+
this.contentArea.subscribe({
|
|
43
|
+
event: "wheel",
|
|
44
|
+
then: (e, _w) => {
|
|
45
|
+
const wheel = e as WheelEvent;
|
|
46
|
+
this.contentArea.getBody().scrollBy(0, wheel.deltaY);
|
|
47
|
+
this.render();
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
this.subscribe({
|
|
52
|
+
event: "drag",
|
|
53
|
+
then: (_e, _w) => {
|
|
54
|
+
this.updateScrollPositionByScrollbar();
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private getScrollData(): ScrollData {
|
|
60
|
+
let returnData: ScrollData = {
|
|
61
|
+
scrollHeight: 0,
|
|
62
|
+
areaHeight: 0,
|
|
63
|
+
scrollBarHeight: 0,
|
|
64
|
+
scrollWidth: 0,
|
|
65
|
+
areaWidth: 0,
|
|
66
|
+
scrollBarWidth: 0,
|
|
67
|
+
scrollWidt: 0,
|
|
68
|
+
availablePositionSize: 0,
|
|
69
|
+
ratioScroll: 0,
|
|
70
|
+
position: 0,
|
|
71
|
+
scrollPositionY: 0,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (this.orientation === "vertical") {
|
|
75
|
+
returnData.scrollHeight = this.contentArea.getBody().scrollHeight;
|
|
76
|
+
returnData.areaHeight = this.contentArea.getH();
|
|
77
|
+
returnData.scrollBarHeight =
|
|
78
|
+
returnData.areaHeight * (returnData.areaHeight / returnData.scrollHeight);
|
|
79
|
+
returnData.availablePositionSize =
|
|
80
|
+
returnData.areaHeight - returnData.scrollBarHeight - 1;
|
|
81
|
+
returnData.ratioScroll =
|
|
82
|
+
this.contentArea.getBody().scrollTop /
|
|
83
|
+
(returnData.areaHeight - returnData.scrollBarHeight);
|
|
84
|
+
returnData.position = returnData.availablePositionSize * returnData.ratioScroll;
|
|
85
|
+
|
|
86
|
+
if (returnData.scrollBarHeight >= returnData.areaHeight) {
|
|
87
|
+
returnData.scrollBarHeight = returnData.areaHeight;
|
|
88
|
+
}
|
|
89
|
+
} else if (this.orientation === "horizontal") {
|
|
90
|
+
returnData.scrollWidth = this.contentArea.getBody().scrollWidth;
|
|
91
|
+
returnData.areaWidth = this.contentArea.getW();
|
|
92
|
+
returnData.scrollBarWidth =
|
|
93
|
+
returnData.areaWidth * (returnData.areaWidth / returnData.scrollWidth);
|
|
94
|
+
returnData.availablePositionSize = returnData.areaWidth - returnData.scrollBarWidth - 1;
|
|
95
|
+
returnData.ratioScroll =
|
|
96
|
+
this.contentArea.getBody().scrollLeft /
|
|
97
|
+
(returnData.areaWidth - returnData.scrollBarWidth);
|
|
98
|
+
returnData.position = returnData.availablePositionSize * returnData.ratioScroll;
|
|
99
|
+
returnData.scrollPositionY = this.contentArea.getH() + this.contentArea.getY();
|
|
100
|
+
if (returnData.scrollBarWidth >= returnData.areaWidth) {
|
|
101
|
+
returnData.scrollBarWidth = returnData.areaWidth;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return returnData;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private updateScrollPositionByScrollbar(): void {
|
|
108
|
+
const scrollData = this.getScrollData();
|
|
109
|
+
|
|
110
|
+
if (this.orientation === "vertical") {
|
|
111
|
+
const recorrido = scrollData.scrollHeight - scrollData.areaHeight;
|
|
112
|
+
const maxY = this.drag.maxY ? this.drag.maxY : 1;
|
|
113
|
+
const ratio = (this.getY() - this.contentArea.getY()) / maxY;
|
|
114
|
+
this.contentArea.getBody().scrollTop = recorrido * ratio;
|
|
115
|
+
} else if (this.orientation === "horizontal") {
|
|
116
|
+
const recorrido = scrollData.scrollWidth - scrollData.areaWidth;
|
|
117
|
+
const maxX = this.drag.maxX ? this.drag.maxX : 1;
|
|
118
|
+
const ratio = (this.getX() - this.contentArea.getX()) / maxX;
|
|
119
|
+
this.contentArea.getBody().scrollLeft = recorrido * ratio;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public render(): void {
|
|
124
|
+
super.render();
|
|
125
|
+
|
|
126
|
+
const scrollData = this.getScrollData();
|
|
127
|
+
|
|
128
|
+
if (this.orientation === "vertical") {
|
|
129
|
+
if (scrollData.areaHeight < scrollData.scrollHeight) {
|
|
130
|
+
this.setVisible(true);
|
|
131
|
+
} else {
|
|
132
|
+
this.setVisible(false);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
this.setX(this.contentArea.getX() + this.contentArea.getW() - SCROLL_SIZE - 1);
|
|
137
|
+
this.setY(1 + this.contentArea.getY() + scrollData.position);
|
|
138
|
+
this.setH(scrollData.scrollBarHeight);
|
|
139
|
+
this.setW(SCROLL_SIZE);
|
|
140
|
+
this.raisteTop();
|
|
141
|
+
|
|
142
|
+
const minY = 1 + this.contentArea.getY();
|
|
143
|
+
const maxY = this.contentArea.getY() + scrollData.availablePositionSize;
|
|
144
|
+
|
|
145
|
+
this.drag.setMinY(minY);
|
|
146
|
+
this.drag.setMaxY(maxY);
|
|
147
|
+
|
|
148
|
+
if (this.getY() > maxY) {
|
|
149
|
+
this.setY(maxY);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (this.getY() < minY) {
|
|
153
|
+
this.setY(minY);
|
|
154
|
+
}
|
|
155
|
+
} else if (this.orientation === "horizontal") {
|
|
156
|
+
if (scrollData.areaWidth < scrollData.scrollWidth) {
|
|
157
|
+
this.setVisible(true);
|
|
158
|
+
} else {
|
|
159
|
+
this.setVisible(false);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
this.setX(1 + this.contentArea.getX() + scrollData.position);
|
|
164
|
+
this.setY(scrollData.scrollPositionY - SCROLL_SIZE - 1);
|
|
165
|
+
this.setW(scrollData.scrollBarWidth);
|
|
166
|
+
this.setH(SCROLL_SIZE);
|
|
167
|
+
this.raisteTop();
|
|
168
|
+
|
|
169
|
+
const minX = 1 + this.contentArea.getX();
|
|
170
|
+
const maxX = this.contentArea.getX() + scrollData.availablePositionSize;
|
|
171
|
+
|
|
172
|
+
this.drag.setMinX(minX);
|
|
173
|
+
this.drag.setMaxX(maxX);
|
|
174
|
+
|
|
175
|
+
if (this.getX() > maxX) {
|
|
176
|
+
this.setX(maxX);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (this.getX() < minX) {
|
|
180
|
+
this.setX(minX);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
package/src/ui/select.ui.ts
CHANGED
|
@@ -37,8 +37,11 @@ export class Select extends Textbox {
|
|
|
37
37
|
|
|
38
38
|
this.menu.wakeUp();
|
|
39
39
|
|
|
40
|
+
console.log(this.getBody().clientWidth, this.menu.getBody().clientWidth);
|
|
41
|
+
|
|
40
42
|
if (this.getBody().clientWidth > this.menu.getBody().clientWidth) {
|
|
41
43
|
this.menu.setW(this.getBody().clientWidth);
|
|
44
|
+
this.menu.resize();
|
|
42
45
|
}
|
|
43
46
|
},
|
|
44
47
|
});
|
package/src/ui/styles/button.css
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
border-radius: 0.25rem;
|
|
13
13
|
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
|
|
14
14
|
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
15
|
-
text-transform: uppercase;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
.WUIButton-text-color-primary {
|
|
@@ -89,7 +88,6 @@
|
|
|
89
88
|
border-radius: 0.25rem;
|
|
90
89
|
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
|
|
91
90
|
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
92
|
-
text-transform: uppercase;
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
.WUIButton-outlined-color-primary {
|
|
@@ -173,7 +171,6 @@
|
|
|
173
171
|
border-radius: 0.25rem;
|
|
174
172
|
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
|
|
175
173
|
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
176
|
-
text-transform: uppercase;
|
|
177
174
|
}
|
|
178
175
|
|
|
179
176
|
.WUIButton-contained-color-primary {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.WUIDataGrid {
|
|
2
|
+
background-color: transparent;
|
|
3
|
+
border-left: solid 0.13rem;
|
|
4
|
+
border-top: solid 0.13rem;
|
|
5
|
+
border-bottom: solid 0.13rem;
|
|
6
|
+
border-right: solid 0.13rem;
|
|
7
|
+
border-radius: 0.25rem;
|
|
8
|
+
border-color: var(--palette-divider);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.WUIDataGrid-Header {
|
|
12
|
+
border-bottom: solid 1px var(--palette-divider);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.WUIDataGrid-HeaderLabel:hover {
|
|
16
|
+
border-bottom: solid 1px var(--palette-divider);
|
|
17
|
+
background-color: var(--palette-action-hover) !important;
|
|
18
|
+
cursor: default;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.WUIDataGrid-HeaderLabel {
|
|
22
|
+
border-right: solid 1px var(--palette-divider);
|
|
23
|
+
/*border-bottom: solid 1px var(--palette-primary-text-light);*/
|
|
24
|
+
padding-left: 5px;
|
|
25
|
+
font-weight: bold;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.WUIDataGrid-Row {
|
|
29
|
+
border-bottom: solid 1px var(--palette-divider);
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.WUIDataGrid-Row:hover {
|
|
34
|
+
border-bottom: solid 1px var(--palette-divider);
|
|
35
|
+
background-color: var(--palette-action-hover) !important;
|
|
36
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.WUILoading {
|
|
2
|
+
background-color: var(--palette-background-default);
|
|
3
|
+
background-image: url("loading.svg");
|
|
4
|
+
background-position: center;
|
|
5
|
+
background-repeat: no-repeat;
|
|
6
|
+
position: absolute !important;
|
|
7
|
+
left: 0px;
|
|
8
|
+
top: 0px;
|
|
9
|
+
right: 0px;
|
|
10
|
+
bottom: 0px;
|
|
11
|
+
opacity: 0.8;
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="256" height="256" style="shape-rendering: auto; display: block; background: transparent;" xmlns:xlink="http://www.w3.org/1999/xlink"><g><g transform="rotate(0 50 50)">
|
|
2
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
3
|
+
<animate repeatCount="indefinite" begin="-1.5027322404371584s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
4
|
+
</rect>
|
|
5
|
+
</g><g transform="rotate(30 50 50)">
|
|
6
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
7
|
+
<animate repeatCount="indefinite" begin="-1.366120218579235s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
8
|
+
</rect>
|
|
9
|
+
</g><g transform="rotate(60 50 50)">
|
|
10
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
11
|
+
<animate repeatCount="indefinite" begin="-1.2295081967213115s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
12
|
+
</rect>
|
|
13
|
+
</g><g transform="rotate(90 50 50)">
|
|
14
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
15
|
+
<animate repeatCount="indefinite" begin="-1.0928961748633879s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
16
|
+
</rect>
|
|
17
|
+
</g><g transform="rotate(120 50 50)">
|
|
18
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
19
|
+
<animate repeatCount="indefinite" begin="-0.9562841530054644s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
20
|
+
</rect>
|
|
21
|
+
</g><g transform="rotate(150 50 50)">
|
|
22
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
23
|
+
<animate repeatCount="indefinite" begin="-0.819672131147541s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
24
|
+
</rect>
|
|
25
|
+
</g><g transform="rotate(180 50 50)">
|
|
26
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
27
|
+
<animate repeatCount="indefinite" begin="-0.6830601092896175s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
28
|
+
</rect>
|
|
29
|
+
</g><g transform="rotate(210 50 50)">
|
|
30
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
31
|
+
<animate repeatCount="indefinite" begin="-0.5464480874316939s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
32
|
+
</rect>
|
|
33
|
+
</g><g transform="rotate(240 50 50)">
|
|
34
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
35
|
+
<animate repeatCount="indefinite" begin="-0.4098360655737705s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
36
|
+
</rect>
|
|
37
|
+
</g><g transform="rotate(270 50 50)">
|
|
38
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
39
|
+
<animate repeatCount="indefinite" begin="-0.27322404371584696s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
40
|
+
</rect>
|
|
41
|
+
</g><g transform="rotate(300 50 50)">
|
|
42
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
43
|
+
<animate repeatCount="indefinite" begin="-0.13661202185792348s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
44
|
+
</rect>
|
|
45
|
+
</g><g transform="rotate(330 50 50)">
|
|
46
|
+
<rect fill="#878787" height="12" width="6" ry="6" rx="3" y="24" x="47">
|
|
47
|
+
<animate repeatCount="indefinite" begin="0s" dur="1.639344262295082s" keyTimes="0;1" values="1;0" attributeName="opacity"></animate>
|
|
48
|
+
</rect>
|
|
49
|
+
</g><g></g></g><!-- [ldio] generated by https://loading.io --></svg>
|
package/src/ui/styles/main.css
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
-moz-box-sizing: border-box;
|
|
4
|
+
-webkit-box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
body {
|
|
2
8
|
font-family: "Roboto", sans-serif;
|
|
3
9
|
background-color: var(--palette-background-default);
|
|
4
10
|
color: var(--palette-text-secondary);
|
|
11
|
+
overflow: hidden;
|
|
5
12
|
}
|
|
6
13
|
|
|
7
14
|
h1,
|
package/src/ui/styles/menu.css
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.WUIProgressBarContainer {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
border: solid 2px var(--palette-divider);
|
|
4
|
+
border-radius: 7px;
|
|
5
|
+
background-color: var(--palette-background-default);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.WUIProgressBarBar {
|
|
9
|
+
position: absolute;
|
|
10
|
+
left: 0px;
|
|
11
|
+
top: 0px;
|
|
12
|
+
border-radius: 6px;
|
|
13
|
+
background-color: var(--palette-primary-dark);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.WUIProgressBarLabel {
|
|
17
|
+
position: absolute;
|
|
18
|
+
color: var(--palette-primary-light);
|
|
19
|
+
}
|