verstak 0.24.131 → 0.24.133
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/build/dist/source/html/El.d.ts +29 -40
- package/build/dist/source/html/El.js +49 -51
- package/package.json +1 -1
|
@@ -8,12 +8,10 @@ export type El<T = any, M = any> = {
|
|
|
8
8
|
model: M;
|
|
9
9
|
kind: ElKind;
|
|
10
10
|
area: ElArea;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
minHeight: string;
|
|
16
|
-
maxHeight: string;
|
|
11
|
+
width: Range;
|
|
12
|
+
widthFixed: string;
|
|
13
|
+
height: Range;
|
|
14
|
+
heightFixed: string;
|
|
17
15
|
contentAlignment: Align;
|
|
18
16
|
elementAlignment: Align;
|
|
19
17
|
contentWrapping: boolean;
|
|
@@ -38,23 +36,22 @@ export type ElCoords = {
|
|
|
38
36
|
};
|
|
39
37
|
export declare enum Align {
|
|
40
38
|
default = 16,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
fit = 0,
|
|
40
|
+
left = 1,
|
|
41
|
+
centerX = 2,
|
|
42
|
+
right = 3,
|
|
43
|
+
top = 4,
|
|
44
|
+
centerY = 8,
|
|
45
|
+
bottom = 12,
|
|
46
|
+
center = 10
|
|
49
47
|
}
|
|
50
|
-
export type
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
growth?: number;
|
|
48
|
+
export type Range = {
|
|
49
|
+
readonly min?: string;
|
|
50
|
+
readonly max?: string;
|
|
51
|
+
readonly growth?: number;
|
|
55
52
|
};
|
|
56
|
-
export type
|
|
57
|
-
|
|
53
|
+
export type MarkedRange = Range & {
|
|
54
|
+
readonly marker?: string;
|
|
58
55
|
};
|
|
59
56
|
export type ElArea = undefined | string | {
|
|
60
57
|
cellsOverWidth?: number;
|
|
@@ -70,12 +67,8 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
70
67
|
private _kind;
|
|
71
68
|
private _area;
|
|
72
69
|
private _coords;
|
|
73
|
-
private
|
|
74
|
-
private
|
|
75
|
-
private _maxWidth;
|
|
76
|
-
private _heightGrowth;
|
|
77
|
-
private _minHeight;
|
|
78
|
-
private _maxHeight;
|
|
70
|
+
private _width;
|
|
71
|
+
private _height;
|
|
79
72
|
private _contentAlignment;
|
|
80
73
|
private _elementAlignment;
|
|
81
74
|
private _contentWrapping;
|
|
@@ -90,18 +83,14 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
90
83
|
set kind(value: ElKind);
|
|
91
84
|
get area(): ElArea;
|
|
92
85
|
set area(value: ElArea);
|
|
93
|
-
get
|
|
94
|
-
set
|
|
95
|
-
get
|
|
96
|
-
set
|
|
97
|
-
get
|
|
98
|
-
set
|
|
99
|
-
get
|
|
100
|
-
set
|
|
101
|
-
get minHeight(): string;
|
|
102
|
-
set minHeight(value: string);
|
|
103
|
-
get maxHeight(): string;
|
|
104
|
-
set maxHeight(value: string);
|
|
86
|
+
get width(): Range;
|
|
87
|
+
set width(value: Range);
|
|
88
|
+
get widthFixed(): string;
|
|
89
|
+
set widthFixed(value: string);
|
|
90
|
+
get height(): Range;
|
|
91
|
+
set height(value: Range);
|
|
92
|
+
get heightFixed(): string;
|
|
93
|
+
set heightFixed(value: string);
|
|
105
94
|
get contentAlignment(): Align;
|
|
106
95
|
set contentAlignment(value: Align);
|
|
107
96
|
get elementAlignment(): Align;
|
|
@@ -141,7 +130,7 @@ export declare class Apply {
|
|
|
141
130
|
static coords<T extends Element>(element: El<T, any>, value: ElCoords | undefined): void;
|
|
142
131
|
static widthGrowth<T extends Element>(element: El<T, any>, value: number): void;
|
|
143
132
|
static minWidth<T extends Element>(element: El<T, any>, value: string): void;
|
|
144
|
-
static
|
|
133
|
+
static maxWidth<T extends Element>(element: El<T, any>, value: string): void;
|
|
145
134
|
static heightGrowth<T extends Element>(element: El<T, any>, value: number): void;
|
|
146
135
|
static minHeight<T extends Element>(element: El<T, any>, value: string): void;
|
|
147
136
|
static maxHeight<T extends Element>(element: El<T, any>, value: string): void;
|
|
@@ -18,14 +18,14 @@ export var ElKind;
|
|
|
18
18
|
export var Align;
|
|
19
19
|
(function (Align) {
|
|
20
20
|
Align[Align["default"] = 16] = "default";
|
|
21
|
-
Align[Align["
|
|
22
|
-
Align[Align["
|
|
23
|
-
Align[Align["
|
|
24
|
-
Align[Align["
|
|
25
|
-
Align[Align["
|
|
26
|
-
Align[Align["
|
|
27
|
-
Align[Align["
|
|
28
|
-
Align[Align["
|
|
21
|
+
Align[Align["fit"] = 0] = "fit";
|
|
22
|
+
Align[Align["left"] = 1] = "left";
|
|
23
|
+
Align[Align["centerX"] = 2] = "centerX";
|
|
24
|
+
Align[Align["right"] = 3] = "right";
|
|
25
|
+
Align[Align["top"] = 4] = "top";
|
|
26
|
+
Align[Align["centerY"] = 8] = "centerY";
|
|
27
|
+
Align[Align["bottom"] = 12] = "bottom";
|
|
28
|
+
Align[Align["center"] = 10] = "center";
|
|
29
29
|
})(Align || (Align = {}));
|
|
30
30
|
export class ElImpl {
|
|
31
31
|
constructor(node) {
|
|
@@ -38,12 +38,8 @@ export class ElImpl {
|
|
|
38
38
|
this._kind = ElKind.part;
|
|
39
39
|
this._area = undefined;
|
|
40
40
|
this._coords = UndefinedElCoords;
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this._maxWidth = "";
|
|
44
|
-
this._heightGrowth = 0;
|
|
45
|
-
this._minHeight = "";
|
|
46
|
-
this._maxHeight = "";
|
|
41
|
+
this._width = { min: "", max: "", growth: 0 };
|
|
42
|
+
this._height = { min: "", max: "", growth: 0 };
|
|
47
43
|
this._contentAlignment = Align.default;
|
|
48
44
|
this._elementAlignment = Align.default;
|
|
49
45
|
this._contentWrapping = true;
|
|
@@ -88,48 +84,50 @@ export class ElImpl {
|
|
|
88
84
|
else
|
|
89
85
|
this.rowBreak();
|
|
90
86
|
}
|
|
91
|
-
get
|
|
92
|
-
set
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
get width() { return this._width; }
|
|
88
|
+
set width(value) {
|
|
89
|
+
var _a, _b, _c;
|
|
90
|
+
const w = this._width;
|
|
91
|
+
let updated = false;
|
|
92
|
+
if (value.min !== w.min) {
|
|
93
|
+
Apply.minWidth(this, (_a = value.min) !== null && _a !== void 0 ? _a : "");
|
|
94
|
+
updated = true;
|
|
96
95
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (value !== this._minWidth) {
|
|
101
|
-
Apply.minWidth(this, value);
|
|
102
|
-
this._minWidth = value;
|
|
96
|
+
if (value.max !== w.max) {
|
|
97
|
+
Apply.maxWidth(this, (_b = value.max) !== null && _b !== void 0 ? _b : "");
|
|
98
|
+
updated = true;
|
|
103
99
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (value !== this._maxWidth) {
|
|
108
|
-
Apply.applyMaxWidth(this, value);
|
|
109
|
-
this._maxWidth = value;
|
|
100
|
+
if (value.growth !== w.growth) {
|
|
101
|
+
Apply.widthGrowth(this, (_c = value.growth) !== null && _c !== void 0 ? _c : 0);
|
|
102
|
+
updated = true;
|
|
110
103
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
104
|
+
if (updated)
|
|
105
|
+
this._width = value;
|
|
106
|
+
}
|
|
107
|
+
get widthFixed() { var _a; return (_a = this._width.min) !== null && _a !== void 0 ? _a : ""; }
|
|
108
|
+
set widthFixed(value) { this.width = { min: value }; }
|
|
109
|
+
get height() { return this._height; }
|
|
110
|
+
set height(value) {
|
|
111
|
+
var _a, _b, _c;
|
|
112
|
+
const w = this._height;
|
|
113
|
+
let updated = false;
|
|
114
|
+
if (value.min !== w.min) {
|
|
115
|
+
Apply.minHeight(this, (_a = value.min) !== null && _a !== void 0 ? _a : "");
|
|
116
|
+
updated = true;
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (value !== this._minHeight) {
|
|
122
|
-
Apply.minHeight(this, value);
|
|
123
|
-
this._minHeight = value;
|
|
118
|
+
if (value.max !== w.max) {
|
|
119
|
+
Apply.maxHeight(this, (_b = value.max) !== null && _b !== void 0 ? _b : "");
|
|
120
|
+
updated = true;
|
|
124
121
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (value !== this._maxHeight) {
|
|
129
|
-
Apply.maxHeight(this, value);
|
|
130
|
-
this._maxHeight = value;
|
|
122
|
+
if (value.growth !== w.growth) {
|
|
123
|
+
Apply.heightGrowth(this, (_c = value.growth) !== null && _c !== void 0 ? _c : 0);
|
|
124
|
+
updated = true;
|
|
131
125
|
}
|
|
126
|
+
if (updated)
|
|
127
|
+
this._height = value;
|
|
132
128
|
}
|
|
129
|
+
get heightFixed() { var _a; return (_a = this._height.min) !== null && _a !== void 0 ? _a : ""; }
|
|
130
|
+
set heightFixed(value) { this.height = { min: value }; }
|
|
133
131
|
get contentAlignment() { return this._contentAlignment; }
|
|
134
132
|
set contentAlignment(value) {
|
|
135
133
|
if (value !== this._contentAlignment) {
|
|
@@ -336,7 +334,7 @@ export class Apply {
|
|
|
336
334
|
if (element.native instanceof HTMLElement)
|
|
337
335
|
element.native.style.minWidth = `${value}`;
|
|
338
336
|
}
|
|
339
|
-
static
|
|
337
|
+
static maxWidth(element, value) {
|
|
340
338
|
if (element.native instanceof HTMLElement)
|
|
341
339
|
element.native.style.maxWidth = `${value}`;
|
|
342
340
|
}
|
|
@@ -356,7 +354,7 @@ export class Apply {
|
|
|
356
354
|
const hostDriver = bNode.host.driver;
|
|
357
355
|
if (hostDriver.isPartitionSeparator) {
|
|
358
356
|
const host = bNode.host.seat.instance;
|
|
359
|
-
Apply.elementAlignment(element, Align.
|
|
357
|
+
Apply.elementAlignment(element, Align.fit);
|
|
360
358
|
Apply.heightGrowth(host.element, value);
|
|
361
359
|
}
|
|
362
360
|
}
|