verstak 0.24.265 → 0.24.267
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 +28 -32
- package/build/dist/source/html/El.js +79 -81
- package/package.json +1 -1
|
@@ -9,13 +9,11 @@ export type El<T = any, M = any> = {
|
|
|
9
9
|
kind: ElKind;
|
|
10
10
|
area: ElArea;
|
|
11
11
|
width: Range;
|
|
12
|
-
widthJustMin: string;
|
|
13
|
-
widthGrowth: number | undefined;
|
|
14
12
|
height: Range;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
alignment: Align;
|
|
14
|
+
extraAlignment: Align;
|
|
15
|
+
stretchingStrengthX: number | undefined;
|
|
16
|
+
stretchingStrengthY: number | undefined;
|
|
19
17
|
contentWrapping: boolean;
|
|
20
18
|
overlayVisible: boolean | undefined;
|
|
21
19
|
readonly style: CSSStyleDeclaration;
|
|
@@ -37,15 +35,17 @@ export type ElCoords = {
|
|
|
37
35
|
y2: number;
|
|
38
36
|
};
|
|
39
37
|
export declare enum Align {
|
|
40
|
-
default = 16,
|
|
41
|
-
stretch = 0,
|
|
42
38
|
left = 1,
|
|
43
39
|
centerX = 2,
|
|
44
40
|
right = 3,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
stretchX = 4,
|
|
42
|
+
top = 8,
|
|
43
|
+
centerY = 16,
|
|
44
|
+
bottom = 24,
|
|
45
|
+
stretchY = 32,
|
|
46
|
+
center = 18,
|
|
47
|
+
stretch = 36,
|
|
48
|
+
default = 0
|
|
49
49
|
}
|
|
50
50
|
export type Range = {
|
|
51
51
|
readonly min?: string;
|
|
@@ -69,11 +69,11 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
69
69
|
private _area;
|
|
70
70
|
private _coords;
|
|
71
71
|
private _width;
|
|
72
|
-
private _widthGrowth;
|
|
73
72
|
private _height;
|
|
74
|
-
private
|
|
75
|
-
private
|
|
76
|
-
private
|
|
73
|
+
private _alignment;
|
|
74
|
+
private _extraAlignment;
|
|
75
|
+
private _stretchingStrengthX;
|
|
76
|
+
private _stretchingStrengthY;
|
|
77
77
|
private _contentWrapping;
|
|
78
78
|
private _overlayVisible;
|
|
79
79
|
private _hasStylingPresets;
|
|
@@ -88,20 +88,16 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
88
88
|
set area(value: ElArea);
|
|
89
89
|
get width(): Range;
|
|
90
90
|
set width(value: Range);
|
|
91
|
-
get widthJustMin(): string;
|
|
92
|
-
set widthJustMin(value: string);
|
|
93
|
-
get widthGrowth(): number | undefined;
|
|
94
|
-
set widthGrowth(value: number | undefined);
|
|
95
91
|
get height(): Range;
|
|
96
92
|
set height(value: Range);
|
|
97
|
-
get
|
|
98
|
-
set
|
|
99
|
-
get
|
|
100
|
-
set
|
|
101
|
-
get
|
|
102
|
-
set
|
|
103
|
-
get
|
|
104
|
-
set
|
|
93
|
+
get alignment(): Align;
|
|
94
|
+
set alignment(value: Align);
|
|
95
|
+
get extraAlignment(): Align;
|
|
96
|
+
set extraAlignment(value: Align);
|
|
97
|
+
get stretchingStrengthX(): number | undefined;
|
|
98
|
+
set stretchingStrengthX(value: number | undefined);
|
|
99
|
+
get stretchingStrengthY(): number | undefined;
|
|
100
|
+
set stretchingStrengthY(value: number | undefined);
|
|
105
101
|
get contentWrapping(): boolean;
|
|
106
102
|
set contentWrapping(value: boolean);
|
|
107
103
|
get overlayVisible(): boolean | undefined;
|
|
@@ -135,14 +131,14 @@ export declare class CursorCommandDriver extends ElDriver<Element, unknown> {
|
|
|
135
131
|
export declare class Apply {
|
|
136
132
|
static kind<T extends Element>(element: El<T, any>, value: ElKind): void;
|
|
137
133
|
static coords<T extends Element>(element: El<T, any>, value: ElCoords | undefined): void;
|
|
138
|
-
static widthGrowth<T extends Element>(element: El<T, any>, value: number): void;
|
|
139
134
|
static minWidth<T extends Element>(element: El<T, any>, value: string): void;
|
|
140
135
|
static maxWidth<T extends Element>(element: El<T, any>, value: string): void;
|
|
141
|
-
static heightGrowth<T extends Element>(element: El<T, any>, value: number): void;
|
|
142
136
|
static minHeight<T extends Element>(element: El<T, any>, value: string): void;
|
|
143
137
|
static maxHeight<T extends Element>(element: El<T, any>, value: string): void;
|
|
144
|
-
static
|
|
145
|
-
static
|
|
138
|
+
static alignment<T extends Element>(element: El<T, any>, value: Align): void;
|
|
139
|
+
static extraAlignment<T extends Element>(element: El<T, any>, value: Align): void;
|
|
140
|
+
static stretchFactorX<T extends Element>(element: El<T, any>, value: number): void;
|
|
141
|
+
static stretchFactorY<T extends Element>(element: El<T, any>, value: number): void;
|
|
146
142
|
static contentWrapping<T extends Element>(element: El<T, any>, value: boolean): void;
|
|
147
143
|
static overlayVisible<T extends Element>(element: El<T, any>, value: boolean | undefined): void;
|
|
148
144
|
static stylingPreset<T extends Element>(element: El<T, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
@@ -17,15 +17,17 @@ export var ElKind;
|
|
|
17
17
|
})(ElKind || (ElKind = {}));
|
|
18
18
|
export var Align;
|
|
19
19
|
(function (Align) {
|
|
20
|
-
Align[Align["default"] = 16] = "default";
|
|
21
|
-
Align[Align["stretch"] = 0] = "stretch";
|
|
22
20
|
Align[Align["left"] = 1] = "left";
|
|
23
21
|
Align[Align["centerX"] = 2] = "centerX";
|
|
24
22
|
Align[Align["right"] = 3] = "right";
|
|
25
|
-
Align[Align["
|
|
26
|
-
Align[Align["
|
|
27
|
-
Align[Align["
|
|
28
|
-
Align[Align["
|
|
23
|
+
Align[Align["stretchX"] = 4] = "stretchX";
|
|
24
|
+
Align[Align["top"] = 8] = "top";
|
|
25
|
+
Align[Align["centerY"] = 16] = "centerY";
|
|
26
|
+
Align[Align["bottom"] = 24] = "bottom";
|
|
27
|
+
Align[Align["stretchY"] = 32] = "stretchY";
|
|
28
|
+
Align[Align["center"] = 18] = "center";
|
|
29
|
+
Align[Align["stretch"] = 36] = "stretch";
|
|
30
|
+
Align[Align["default"] = 0] = "default";
|
|
29
31
|
})(Align || (Align = {}));
|
|
30
32
|
export class ElImpl {
|
|
31
33
|
constructor(node) {
|
|
@@ -39,11 +41,11 @@ export class ElImpl {
|
|
|
39
41
|
this._area = undefined;
|
|
40
42
|
this._coords = UndefinedElCoords;
|
|
41
43
|
this._width = { min: "", max: "" };
|
|
42
|
-
this._widthGrowth = undefined;
|
|
43
44
|
this._height = { min: "", max: "" };
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
45
|
+
this._alignment = Align.default;
|
|
46
|
+
this._extraAlignment = Align.default;
|
|
47
|
+
this._stretchingStrengthX = undefined;
|
|
48
|
+
this._stretchingStrengthY = undefined;
|
|
47
49
|
this._contentWrapping = true;
|
|
48
50
|
this._overlayVisible = undefined;
|
|
49
51
|
this._hasStylingPresets = false;
|
|
@@ -102,15 +104,6 @@ export class ElImpl {
|
|
|
102
104
|
if (updated)
|
|
103
105
|
this._width = value;
|
|
104
106
|
}
|
|
105
|
-
get widthJustMin() { var _a; return (_a = this._width.min) !== null && _a !== void 0 ? _a : ""; }
|
|
106
|
-
set widthJustMin(value) { this.width = { min: value }; }
|
|
107
|
-
get widthGrowth() { return this._widthGrowth; }
|
|
108
|
-
set widthGrowth(value) {
|
|
109
|
-
if (value !== this._widthGrowth) {
|
|
110
|
-
Apply.widthGrowth(this, value !== null && value !== void 0 ? value : 0);
|
|
111
|
-
this._widthGrowth = value;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
107
|
get height() { return this._height; }
|
|
115
108
|
set height(value) {
|
|
116
109
|
var _a, _b;
|
|
@@ -127,27 +120,32 @@ export class ElImpl {
|
|
|
127
120
|
if (updated)
|
|
128
121
|
this._height = value;
|
|
129
122
|
}
|
|
130
|
-
get
|
|
131
|
-
set
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Apply.heightGrowth(this, value !== null && value !== void 0 ? value : 0);
|
|
136
|
-
this._heightGrowth = value;
|
|
123
|
+
get alignment() { return this._alignment; }
|
|
124
|
+
set alignment(value) {
|
|
125
|
+
if (value !== this._alignment) {
|
|
126
|
+
Apply.alignment(this, value);
|
|
127
|
+
this._alignment = value;
|
|
137
128
|
}
|
|
138
129
|
}
|
|
139
|
-
get
|
|
140
|
-
set
|
|
141
|
-
if (value !== this.
|
|
142
|
-
Apply.
|
|
143
|
-
this.
|
|
130
|
+
get extraAlignment() { return this._extraAlignment; }
|
|
131
|
+
set extraAlignment(value) {
|
|
132
|
+
if (value !== this._extraAlignment) {
|
|
133
|
+
Apply.extraAlignment(this, value);
|
|
134
|
+
this._extraAlignment = value;
|
|
144
135
|
}
|
|
145
136
|
}
|
|
146
|
-
get
|
|
147
|
-
set
|
|
148
|
-
if (value !== this.
|
|
149
|
-
Apply.
|
|
150
|
-
this.
|
|
137
|
+
get stretchingStrengthX() { return this._stretchingStrengthX; }
|
|
138
|
+
set stretchingStrengthX(value) {
|
|
139
|
+
if (value !== this._stretchingStrengthX) {
|
|
140
|
+
Apply.stretchFactorX(this, value !== null && value !== void 0 ? value : 0);
|
|
141
|
+
this._stretchingStrengthX = value;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
get stretchingStrengthY() { return this._stretchingStrengthY; }
|
|
145
|
+
set stretchingStrengthY(value) {
|
|
146
|
+
if (value !== this._stretchingStrengthY) {
|
|
147
|
+
Apply.stretchFactorY(this, value !== null && value !== void 0 ? value : 0);
|
|
148
|
+
this._stretchingStrengthY = value;
|
|
151
149
|
}
|
|
152
150
|
}
|
|
153
151
|
get contentWrapping() { return this._contentWrapping; }
|
|
@@ -325,19 +323,6 @@ export class Apply {
|
|
|
325
323
|
s.gridArea = "";
|
|
326
324
|
}
|
|
327
325
|
}
|
|
328
|
-
static widthGrowth(element, value) {
|
|
329
|
-
if (element.native instanceof HTMLElement) {
|
|
330
|
-
const s = element.native.style;
|
|
331
|
-
if (value > 0) {
|
|
332
|
-
s.flexGrow = `${value}`;
|
|
333
|
-
s.flexBasis = "0";
|
|
334
|
-
}
|
|
335
|
-
else {
|
|
336
|
-
s.flexGrow = "";
|
|
337
|
-
s.flexBasis = "";
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
326
|
static minWidth(element, value) {
|
|
342
327
|
if (element.native instanceof HTMLElement)
|
|
343
328
|
element.native.style.minWidth = `${value}`;
|
|
@@ -346,27 +331,6 @@ export class Apply {
|
|
|
346
331
|
if (element.native instanceof HTMLElement)
|
|
347
332
|
element.native.style.maxWidth = `${value}`;
|
|
348
333
|
}
|
|
349
|
-
static heightGrowth(element, value) {
|
|
350
|
-
const bNode = element.node;
|
|
351
|
-
const driver = bNode.driver;
|
|
352
|
-
if (driver.isPartition) {
|
|
353
|
-
if (element.native instanceof HTMLElement) {
|
|
354
|
-
const s = element.native.style;
|
|
355
|
-
if (value > 0)
|
|
356
|
-
s.flexGrow = `${value}`;
|
|
357
|
-
else
|
|
358
|
-
s.flexGrow = "";
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
const hostDriver = bNode.host.driver;
|
|
363
|
-
if (hostDriver.isPartition) {
|
|
364
|
-
const host = bNode.host.seat.instance;
|
|
365
|
-
Apply.boundsAlignment(element, Align.stretch);
|
|
366
|
-
Apply.heightGrowth(host.element, value);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
334
|
static minHeight(element, value) {
|
|
371
335
|
if (element.native instanceof HTMLElement)
|
|
372
336
|
element.native.style.minHeight = `${value}`;
|
|
@@ -375,11 +339,24 @@ export class Apply {
|
|
|
375
339
|
if (element.native instanceof HTMLElement)
|
|
376
340
|
element.native.style.maxHeight = `${value}`;
|
|
377
341
|
}
|
|
378
|
-
static
|
|
342
|
+
static alignment(element, value) {
|
|
343
|
+
if (element.native instanceof HTMLElement) {
|
|
344
|
+
const s = element.native.style;
|
|
345
|
+
if (value !== Align.default) {
|
|
346
|
+
const v = AlignToCss[(value >> 3) & 0b11];
|
|
347
|
+
const h = AlignToCss[value & 0b11];
|
|
348
|
+
s.alignSelf = v;
|
|
349
|
+
s.justifySelf = h;
|
|
350
|
+
}
|
|
351
|
+
else
|
|
352
|
+
s.alignSelf = s.justifySelf = "";
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
static extraAlignment(element, value) {
|
|
379
356
|
if (element.native instanceof HTMLElement) {
|
|
380
357
|
const s = element.native.style;
|
|
381
|
-
if (
|
|
382
|
-
const v = AlignToCss[(value >>
|
|
358
|
+
if (value !== Align.default) {
|
|
359
|
+
const v = AlignToCss[(value >> 3) & 0b11];
|
|
383
360
|
const h = AlignToCss[value & 0b11];
|
|
384
361
|
const t = TextAlignCss[value & 0b11];
|
|
385
362
|
s.justifyContent = v;
|
|
@@ -390,17 +367,38 @@ export class Apply {
|
|
|
390
367
|
s.justifyContent = s.alignContent = s.textAlign = "";
|
|
391
368
|
}
|
|
392
369
|
}
|
|
393
|
-
static
|
|
370
|
+
static stretchFactorX(element, value) {
|
|
394
371
|
if (element.native instanceof HTMLElement) {
|
|
395
372
|
const s = element.native.style;
|
|
396
|
-
if (
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
373
|
+
if (value > 0) {
|
|
374
|
+
s.flexGrow = `${value}`;
|
|
375
|
+
s.flexBasis = "0";
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
s.flexGrow = "";
|
|
379
|
+
s.flexBasis = "";
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
static stretchFactorY(element, value) {
|
|
384
|
+
const bNode = element.node;
|
|
385
|
+
const driver = bNode.driver;
|
|
386
|
+
if (driver.isPartition) {
|
|
387
|
+
if (element.native instanceof HTMLElement) {
|
|
388
|
+
const s = element.native.style;
|
|
389
|
+
if (value > 0)
|
|
390
|
+
s.flexGrow = `${value}`;
|
|
391
|
+
else
|
|
392
|
+
s.flexGrow = "";
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
const hostDriver = bNode.host.driver;
|
|
397
|
+
if (hostDriver.isPartition) {
|
|
398
|
+
const host = bNode.host.seat.instance;
|
|
399
|
+
Apply.alignment(element, Align.stretch);
|
|
400
|
+
Apply.stretchFactorY(host.element, value);
|
|
401
401
|
}
|
|
402
|
-
else
|
|
403
|
-
s.alignSelf = s.justifySelf = "";
|
|
404
402
|
}
|
|
405
403
|
}
|
|
406
404
|
static contentWrapping(element, value) {
|