verstak 0.24.270 → 0.24.271
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 +46 -20
- package/build/dist/source/html/El.js +170 -87
- package/build/dist/source/html/Elements.js +113 -65
- package/build/dist/source/html/Handlers.d.ts +1 -1
- package/build/dist/source/html/SplitViewMath.d.ts +15 -6
- package/build/dist/source/html/SplitViewMath.js +190 -123
- package/build/dist/source/html/api.d.ts +1 -0
- package/build/dist/source/html/api.js +1 -0
- package/build/dist/source/html/sensors/KeyboardSensor.d.ts +1 -0
- package/build/dist/source/html/sensors/KeyboardSensor.js +5 -0
- package/package.json +1 -1
|
@@ -8,13 +8,24 @@ export type El<T = any, M = any> = {
|
|
|
8
8
|
area: ElArea;
|
|
9
9
|
width: Range;
|
|
10
10
|
height: Range;
|
|
11
|
-
alignment:
|
|
12
|
-
alignmentInside:
|
|
11
|
+
alignment: Alignment | undefined;
|
|
12
|
+
alignmentInside: Alignment | undefined;
|
|
13
|
+
verticalAlignment: VerticalAlignment | undefined;
|
|
14
|
+
verticalAlignmentInside: VerticalAlignment | undefined;
|
|
13
15
|
stretchingStrengthX: number | undefined;
|
|
14
16
|
stretchingStrengthY: number | undefined;
|
|
15
17
|
contentWrapping: boolean;
|
|
16
18
|
overlayVisible: boolean | undefined;
|
|
17
19
|
splitView: SplitView | undefined;
|
|
20
|
+
widthPx: {
|
|
21
|
+
minPx: number;
|
|
22
|
+
maxPx: number;
|
|
23
|
+
};
|
|
24
|
+
heightPx: {
|
|
25
|
+
minPx: number;
|
|
26
|
+
maxPx: number;
|
|
27
|
+
};
|
|
28
|
+
partitionSizeInSplitViewPx: number;
|
|
18
29
|
readonly style: CSSStyleDeclaration;
|
|
19
30
|
useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
|
|
20
31
|
};
|
|
@@ -34,22 +45,22 @@ export type ElCoords = {
|
|
|
34
45
|
x2: number;
|
|
35
46
|
y2: number;
|
|
36
47
|
};
|
|
37
|
-
export declare enum
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
stretchXY = 63
|
|
48
|
+
export declare enum Alignment {
|
|
49
|
+
left = 0,
|
|
50
|
+
center = 1,
|
|
51
|
+
right = 2,
|
|
52
|
+
stretch = 3
|
|
53
|
+
}
|
|
54
|
+
export declare enum VerticalAlignment {
|
|
55
|
+
top = 0,
|
|
56
|
+
center = 1,
|
|
57
|
+
bottom = 2,
|
|
58
|
+
stretch = 3
|
|
49
59
|
}
|
|
50
60
|
export type Range = {
|
|
51
61
|
readonly min?: string;
|
|
52
62
|
readonly max?: string;
|
|
63
|
+
readonly preferred?: string;
|
|
53
64
|
};
|
|
54
65
|
export type MarkedRange = Range & {
|
|
55
66
|
readonly marker?: string;
|
|
@@ -78,7 +89,9 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
78
89
|
private _width;
|
|
79
90
|
private _height;
|
|
80
91
|
private _alignment;
|
|
92
|
+
private _verticalAlignment;
|
|
81
93
|
private _alignmentInside;
|
|
94
|
+
private _verticalAlignmentInside;
|
|
82
95
|
private _stretchingStrengthX;
|
|
83
96
|
private _stretchingStrengthY;
|
|
84
97
|
private _contentWrapping;
|
|
@@ -105,6 +118,8 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
105
118
|
minPx: number;
|
|
106
119
|
maxPx: number;
|
|
107
120
|
});
|
|
121
|
+
get preferredWidthUsed(): boolean;
|
|
122
|
+
set preferredWidthUsed(value: boolean);
|
|
108
123
|
get height(): Range;
|
|
109
124
|
set height(value: Range);
|
|
110
125
|
get heightPx(): {
|
|
@@ -115,10 +130,16 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
115
130
|
minPx: number;
|
|
116
131
|
maxPx: number;
|
|
117
132
|
});
|
|
118
|
-
get
|
|
119
|
-
set
|
|
120
|
-
get
|
|
121
|
-
set
|
|
133
|
+
get preferredHeightUsed(): boolean;
|
|
134
|
+
set preferredHeightUsed(value: boolean);
|
|
135
|
+
get alignment(): Alignment | undefined;
|
|
136
|
+
set alignment(value: Alignment | undefined);
|
|
137
|
+
get verticalAlignment(): VerticalAlignment | undefined;
|
|
138
|
+
set verticalAlignment(value: VerticalAlignment | undefined);
|
|
139
|
+
get alignmentInside(): Alignment | undefined;
|
|
140
|
+
set alignmentInside(value: Alignment | undefined);
|
|
141
|
+
get verticalAlignmentInside(): VerticalAlignment | undefined;
|
|
142
|
+
set verticalAlignmentInside(value: VerticalAlignment | undefined);
|
|
122
143
|
get stretchingStrengthX(): number | undefined;
|
|
123
144
|
set stretchingStrengthX(value: number | undefined);
|
|
124
145
|
get stretchingStrengthY(): number | undefined;
|
|
@@ -129,6 +150,7 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
129
150
|
set overlayVisible(value: boolean | undefined);
|
|
130
151
|
get splitView(): SplitView | undefined;
|
|
131
152
|
set splitView(value: SplitView | undefined);
|
|
153
|
+
get partitionSizeInSplitViewPx(): number;
|
|
132
154
|
get style(): CSSStyleDeclaration;
|
|
133
155
|
useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
|
|
134
156
|
protected children(onlyAfter?: ElImpl): Generator<ElImpl>;
|
|
@@ -139,6 +161,7 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
139
161
|
private static applyWidth;
|
|
140
162
|
private static applyHeight;
|
|
141
163
|
private static applyAlignment;
|
|
164
|
+
private static applyVerticalAlignment;
|
|
142
165
|
private static applyStretchingStrengthX;
|
|
143
166
|
private static applyStretchingStrengthY;
|
|
144
167
|
private static applyContentWrapping;
|
|
@@ -157,8 +180,11 @@ export declare class ElLayoutInfo {
|
|
|
157
180
|
effectiveSizePx: number;
|
|
158
181
|
offsetXpx: number;
|
|
159
182
|
offsetYpx: number;
|
|
160
|
-
|
|
161
|
-
|
|
183
|
+
contentSizeXpx: number;
|
|
184
|
+
contentSizeYpx: number;
|
|
185
|
+
borderSizeYpx: number;
|
|
186
|
+
borderSizeXpx: number;
|
|
187
|
+
isConstrained: boolean;
|
|
162
188
|
constructor(prev: ElLayoutInfo);
|
|
163
189
|
}
|
|
164
190
|
declare enum ElLayoutInfoFlags {
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { RxNode, BaseDriver, Transaction, obs, ObservableObject } from "reactronic";
|
|
2
11
|
import { equalElCoords, parseElCoords } from "./ElUtils.js";
|
|
3
12
|
export var ElKind;
|
|
4
13
|
(function (ElKind) {
|
|
@@ -11,25 +20,34 @@ export var ElKind;
|
|
|
11
20
|
ElKind[ElKind["cursor"] = 6] = "cursor";
|
|
12
21
|
ElKind[ElKind["native"] = 7] = "native";
|
|
13
22
|
})(ElKind || (ElKind = {}));
|
|
14
|
-
export var
|
|
15
|
-
(function (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})(
|
|
23
|
+
export var Alignment;
|
|
24
|
+
(function (Alignment) {
|
|
25
|
+
Alignment[Alignment["left"] = 0] = "left";
|
|
26
|
+
Alignment[Alignment["center"] = 1] = "center";
|
|
27
|
+
Alignment[Alignment["right"] = 2] = "right";
|
|
28
|
+
Alignment[Alignment["stretch"] = 3] = "stretch";
|
|
29
|
+
})(Alignment || (Alignment = {}));
|
|
30
|
+
export var VerticalAlignment;
|
|
31
|
+
(function (VerticalAlignment) {
|
|
32
|
+
VerticalAlignment[VerticalAlignment["top"] = 0] = "top";
|
|
33
|
+
VerticalAlignment[VerticalAlignment["center"] = 1] = "center";
|
|
34
|
+
VerticalAlignment[VerticalAlignment["bottom"] = 2] = "bottom";
|
|
35
|
+
VerticalAlignment[VerticalAlignment["stretch"] = 3] = "stretch";
|
|
36
|
+
})(VerticalAlignment || (VerticalAlignment = {}));
|
|
28
37
|
export var SplitView;
|
|
29
38
|
(function (SplitView) {
|
|
30
39
|
SplitView[SplitView["horizontal"] = 0] = "horizontal";
|
|
31
40
|
SplitView[SplitView["vertical"] = 1] = "vertical";
|
|
32
41
|
})(SplitView || (SplitView = {}));
|
|
42
|
+
class Size extends ObservableObject {
|
|
43
|
+
constructor() {
|
|
44
|
+
super();
|
|
45
|
+
this.raw = { min: "", max: "" };
|
|
46
|
+
this.minPx = 0;
|
|
47
|
+
this.maxPx = Number.POSITIVE_INFINITY;
|
|
48
|
+
this.preferredUsed = false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
33
51
|
export class ElDriver extends BaseDriver {
|
|
34
52
|
allocate(node) {
|
|
35
53
|
return new ElImpl(node);
|
|
@@ -46,10 +64,12 @@ export class ElImpl {
|
|
|
46
64
|
this._kind = ElKind.part;
|
|
47
65
|
this._area = undefined;
|
|
48
66
|
this._coords = UndefinedElCoords;
|
|
49
|
-
this._width =
|
|
50
|
-
this._height =
|
|
51
|
-
this._alignment =
|
|
52
|
-
this.
|
|
67
|
+
this._width = Transaction.separate(() => new Size());
|
|
68
|
+
this._height = Transaction.separate(() => new Size());
|
|
69
|
+
this._alignment = undefined;
|
|
70
|
+
this._verticalAlignment = undefined;
|
|
71
|
+
this._alignmentInside = undefined;
|
|
72
|
+
this._verticalAlignmentInside = undefined;
|
|
53
73
|
this._stretchingStrengthX = undefined;
|
|
54
74
|
this._stretchingStrengthY = undefined;
|
|
55
75
|
this._contentWrapping = true;
|
|
@@ -102,6 +122,7 @@ export class ElImpl {
|
|
|
102
122
|
if (value.min !== w.min || value.max !== w.max) {
|
|
103
123
|
ElImpl.applyWidth(this, value);
|
|
104
124
|
this._width.raw = value;
|
|
125
|
+
this._width.preferredUsed = false;
|
|
105
126
|
}
|
|
106
127
|
}
|
|
107
128
|
get widthPx() { return this._width; }
|
|
@@ -112,12 +133,19 @@ export class ElImpl {
|
|
|
112
133
|
if (value.maxPx !== w.maxPx)
|
|
113
134
|
this._width.maxPx = value.maxPx;
|
|
114
135
|
}
|
|
136
|
+
get preferredWidthUsed() {
|
|
137
|
+
return this._width.preferredUsed;
|
|
138
|
+
}
|
|
139
|
+
set preferredWidthUsed(value) {
|
|
140
|
+
this._width.preferredUsed = value;
|
|
141
|
+
}
|
|
115
142
|
get height() { return this._height.raw; }
|
|
116
143
|
set height(value) {
|
|
117
144
|
const h = this._height.raw;
|
|
118
145
|
if (value.min !== h.min || value.max !== h.max) {
|
|
119
146
|
ElImpl.applyHeight(this, value);
|
|
120
147
|
this._height.raw = value;
|
|
148
|
+
this._height.preferredUsed = false;
|
|
121
149
|
}
|
|
122
150
|
}
|
|
123
151
|
get heightPx() { return this._height; }
|
|
@@ -128,22 +156,44 @@ export class ElImpl {
|
|
|
128
156
|
if (value.maxPx !== w.maxPx)
|
|
129
157
|
this._height.maxPx = value.maxPx;
|
|
130
158
|
}
|
|
159
|
+
get preferredHeightUsed() {
|
|
160
|
+
return this._height.preferredUsed;
|
|
161
|
+
}
|
|
162
|
+
set preferredHeightUsed(value) {
|
|
163
|
+
this._height.preferredUsed = value;
|
|
164
|
+
}
|
|
131
165
|
get alignment() { return this._alignment; }
|
|
132
166
|
set alignment(value) {
|
|
133
167
|
const existing = this._alignment;
|
|
134
168
|
if (value !== existing) {
|
|
135
|
-
ElImpl.applyAlignment(this, existing, value, this._alignmentInside, this._alignmentInside, this._stretchingStrengthX
|
|
169
|
+
ElImpl.applyAlignment(this, existing, value, this._alignmentInside, this._alignmentInside, this._stretchingStrengthX);
|
|
136
170
|
this._alignment = value;
|
|
137
171
|
}
|
|
138
172
|
}
|
|
173
|
+
get verticalAlignment() { return this._verticalAlignment; }
|
|
174
|
+
set verticalAlignment(value) {
|
|
175
|
+
const existing = this._verticalAlignment;
|
|
176
|
+
if (value !== existing) {
|
|
177
|
+
ElImpl.applyVerticalAlignment(this, existing, value, this._verticalAlignmentInside, this._verticalAlignmentInside, this._stretchingStrengthY);
|
|
178
|
+
this._verticalAlignment = value;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
139
181
|
get alignmentInside() { return this._alignmentInside; }
|
|
140
182
|
set alignmentInside(value) {
|
|
141
183
|
const existing = this._alignmentInside;
|
|
142
184
|
if (value !== existing) {
|
|
143
|
-
ElImpl.applyAlignment(this, this._alignment, this._alignment, existing, value, this._stretchingStrengthX
|
|
185
|
+
ElImpl.applyAlignment(this, this._alignment, this._alignment, existing, value, this._stretchingStrengthX);
|
|
144
186
|
this._alignmentInside = value;
|
|
145
187
|
}
|
|
146
188
|
}
|
|
189
|
+
get verticalAlignmentInside() { return this._verticalAlignmentInside; }
|
|
190
|
+
set verticalAlignmentInside(value) {
|
|
191
|
+
const existing = this._verticalAlignmentInside;
|
|
192
|
+
if (value !== existing) {
|
|
193
|
+
ElImpl.applyVerticalAlignment(this, this._verticalAlignment, this._verticalAlignment, existing, value, this._stretchingStrengthY);
|
|
194
|
+
this._verticalAlignmentInside = value;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
147
197
|
get stretchingStrengthX() { return this._stretchingStrengthX; }
|
|
148
198
|
set stretchingStrengthX(value) {
|
|
149
199
|
const existing = this._stretchingStrengthX;
|
|
@@ -181,6 +231,12 @@ export class ElImpl {
|
|
|
181
231
|
this._splitView = value;
|
|
182
232
|
}
|
|
183
233
|
}
|
|
234
|
+
get partitionSizeInSplitViewPx() {
|
|
235
|
+
var _a;
|
|
236
|
+
if (this.layoutInfo === undefined)
|
|
237
|
+
this.layoutInfo = new ElLayoutInfo(InitialElLayoutInfo);
|
|
238
|
+
return (_a = this.layoutInfo.effectiveSizePx) !== null && _a !== void 0 ? _a : 0;
|
|
239
|
+
}
|
|
184
240
|
get style() { return this.native.style; }
|
|
185
241
|
useStylingPreset(stylingPresetName, enabled) {
|
|
186
242
|
ElImpl.applyStylingPreset(this, this._hasStylingPresets, stylingPresetName, enabled);
|
|
@@ -246,24 +302,24 @@ export class ElImpl {
|
|
|
246
302
|
s.maxHeight = (_b = value.max) !== null && _b !== void 0 ? _b : "";
|
|
247
303
|
}
|
|
248
304
|
}
|
|
249
|
-
static applyAlignment(element, oldPrimary, newPrimary, oldInside, newInside,
|
|
305
|
+
static applyAlignment(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
|
|
250
306
|
var _a;
|
|
307
|
+
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = Alignment.left);
|
|
308
|
+
newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = Alignment.left);
|
|
309
|
+
oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
|
|
310
|
+
newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
|
|
251
311
|
const css = element.style;
|
|
252
312
|
let hostLayout = undefined;
|
|
253
|
-
let hostCss = undefined;
|
|
254
313
|
if (element.node.host.driver.isPartition) {
|
|
255
314
|
const hostEl = element.node.host.element;
|
|
256
|
-
hostCss = hostEl.style;
|
|
257
315
|
hostLayout = hostEl.layoutInfo;
|
|
258
316
|
if (hostLayout === undefined)
|
|
259
317
|
hostLayout = hostEl.layoutInfo = new ElLayoutInfo(InitialElLayoutInfo);
|
|
260
318
|
}
|
|
261
|
-
if (newInside === Align.default)
|
|
262
|
-
newInside = newPrimary;
|
|
263
319
|
let isEffectiveAlignerX = false;
|
|
264
320
|
if (hostLayout) {
|
|
265
|
-
const isAligner =
|
|
266
|
-
|
|
321
|
+
const isAligner = newPrimary === Alignment.center ||
|
|
322
|
+
newPrimary === Alignment.right;
|
|
267
323
|
isEffectiveAlignerX = isAligner && (hostLayout.alignerX === undefined ||
|
|
268
324
|
element.index <= hostLayout.alignerX.index);
|
|
269
325
|
if (hostLayout.alignerX === element) {
|
|
@@ -281,65 +337,83 @@ export class ElImpl {
|
|
|
281
337
|
}
|
|
282
338
|
}
|
|
283
339
|
}
|
|
284
|
-
switch (newPrimary
|
|
340
|
+
switch (newPrimary) {
|
|
285
341
|
default:
|
|
286
|
-
case
|
|
342
|
+
case Alignment.left:
|
|
287
343
|
css.justifySelf = "start";
|
|
288
|
-
if (
|
|
344
|
+
if (oldPrimary === Alignment.center) {
|
|
289
345
|
css.marginLeft = "";
|
|
290
346
|
css.marginRight = "";
|
|
291
347
|
}
|
|
292
|
-
else if (
|
|
348
|
+
else if (oldPrimary === Alignment.right)
|
|
293
349
|
css.marginLeft = "";
|
|
294
350
|
break;
|
|
295
|
-
case
|
|
351
|
+
case Alignment.center:
|
|
296
352
|
css.justifySelf = "center";
|
|
297
353
|
if (hostLayout)
|
|
298
354
|
css.marginLeft = isEffectiveAlignerX ? "auto" : "";
|
|
299
355
|
css.marginRight = "auto";
|
|
300
356
|
break;
|
|
301
|
-
case
|
|
357
|
+
case Alignment.right:
|
|
302
358
|
css.justifySelf = "end";
|
|
303
359
|
if (hostLayout)
|
|
304
360
|
css.marginLeft = isEffectiveAlignerX ? "auto" : "";
|
|
305
|
-
if (
|
|
361
|
+
if (oldPrimary === Alignment.center)
|
|
306
362
|
css.marginRight = "";
|
|
307
363
|
break;
|
|
308
|
-
case
|
|
364
|
+
case Alignment.stretch:
|
|
309
365
|
css.justifySelf = "stretch";
|
|
310
|
-
if (
|
|
366
|
+
if (oldPrimary === Alignment.center) {
|
|
311
367
|
css.marginLeft = "";
|
|
312
368
|
css.marginRight = "";
|
|
313
369
|
}
|
|
314
|
-
else if (
|
|
370
|
+
else if (oldPrimary === Alignment.right)
|
|
315
371
|
css.marginLeft = "";
|
|
316
372
|
break;
|
|
317
373
|
}
|
|
318
|
-
switch (newInside
|
|
374
|
+
switch (newInside) {
|
|
319
375
|
default:
|
|
320
|
-
case
|
|
376
|
+
case Alignment.left:
|
|
321
377
|
css.alignItems = "start";
|
|
322
378
|
css.textAlign = "left";
|
|
323
379
|
break;
|
|
324
|
-
case
|
|
380
|
+
case Alignment.center:
|
|
325
381
|
css.alignItems = "center";
|
|
326
382
|
css.textAlign = "center";
|
|
327
383
|
break;
|
|
328
|
-
case
|
|
384
|
+
case Alignment.right:
|
|
329
385
|
css.alignItems = "end";
|
|
330
386
|
css.textAlign = "right";
|
|
331
387
|
break;
|
|
332
|
-
case
|
|
388
|
+
case Alignment.stretch:
|
|
333
389
|
css.alignItems = "stretch";
|
|
334
390
|
css.textAlign = "justify";
|
|
335
391
|
break;
|
|
336
392
|
}
|
|
393
|
+
if (newPrimary === Alignment.stretch && strength === undefined)
|
|
394
|
+
ElImpl.applyStretchingStrengthX(element, 0, 1);
|
|
395
|
+
}
|
|
396
|
+
static applyVerticalAlignment(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
|
|
397
|
+
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = VerticalAlignment.top);
|
|
398
|
+
newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = VerticalAlignment.top);
|
|
399
|
+
oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
|
|
400
|
+
newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
|
|
401
|
+
const css = element.style;
|
|
402
|
+
let hostLayout = undefined;
|
|
403
|
+
let hostCss = undefined;
|
|
404
|
+
if (element.node.host.driver.isPartition) {
|
|
405
|
+
const hostEl = element.node.host.element;
|
|
406
|
+
hostCss = hostEl.style;
|
|
407
|
+
hostLayout = hostEl.layoutInfo;
|
|
408
|
+
if (hostLayout === undefined)
|
|
409
|
+
hostLayout = hostEl.layoutInfo = new ElLayoutInfo(InitialElLayoutInfo);
|
|
410
|
+
}
|
|
337
411
|
let isEffectiveAlignerY = false;
|
|
338
412
|
if (hostLayout) {
|
|
339
|
-
const isAligner =
|
|
340
|
-
|
|
413
|
+
const isAligner = newPrimary === VerticalAlignment.center ||
|
|
414
|
+
newPrimary === VerticalAlignment.bottom;
|
|
341
415
|
isEffectiveAlignerY = isAligner && (hostLayout.alignerY === undefined ||
|
|
342
|
-
|
|
416
|
+
hostLayout.alignerY.verticalAlignment !== VerticalAlignment.center);
|
|
343
417
|
if (hostLayout.alignerY === element) {
|
|
344
418
|
if (!isEffectiveAlignerY) {
|
|
345
419
|
hostCss.marginTop = "";
|
|
@@ -352,39 +426,37 @@ export class ElImpl {
|
|
|
352
426
|
}
|
|
353
427
|
}
|
|
354
428
|
}
|
|
355
|
-
switch (newPrimary
|
|
429
|
+
switch (newPrimary) {
|
|
356
430
|
default:
|
|
357
|
-
case
|
|
431
|
+
case VerticalAlignment.top:
|
|
358
432
|
css.alignSelf = "start";
|
|
359
433
|
break;
|
|
360
|
-
case
|
|
434
|
+
case VerticalAlignment.center:
|
|
361
435
|
css.alignSelf = "center";
|
|
362
436
|
break;
|
|
363
|
-
case
|
|
437
|
+
case VerticalAlignment.bottom:
|
|
364
438
|
css.alignSelf = "end";
|
|
365
439
|
break;
|
|
366
|
-
case
|
|
440
|
+
case VerticalAlignment.stretch:
|
|
367
441
|
css.alignSelf = "stretch";
|
|
368
442
|
break;
|
|
369
443
|
}
|
|
370
|
-
switch (newInside
|
|
444
|
+
switch (newInside) {
|
|
371
445
|
default:
|
|
372
|
-
case
|
|
446
|
+
case VerticalAlignment.top:
|
|
373
447
|
css.justifyContent = "start";
|
|
374
448
|
break;
|
|
375
|
-
case
|
|
449
|
+
case VerticalAlignment.center:
|
|
376
450
|
css.justifyContent = "center";
|
|
377
451
|
break;
|
|
378
|
-
case
|
|
452
|
+
case VerticalAlignment.bottom:
|
|
379
453
|
css.justifyContent = "end";
|
|
380
454
|
break;
|
|
381
|
-
case
|
|
455
|
+
case VerticalAlignment.stretch:
|
|
382
456
|
css.justifyContent = "stretch";
|
|
383
457
|
break;
|
|
384
458
|
}
|
|
385
|
-
if (
|
|
386
|
-
ElImpl.applyStretchingStrengthX(element, 0, 1);
|
|
387
|
-
if (alignedY(newPrimary, Align.stretchY) && strengthY === undefined)
|
|
459
|
+
if (newPrimary === VerticalAlignment.stretch && strength === undefined)
|
|
388
460
|
ElImpl.applyStretchingStrengthY(element, 0, 1);
|
|
389
461
|
}
|
|
390
462
|
static applyStretchingStrengthX(element, existing, value) {
|
|
@@ -497,24 +569,7 @@ export class ElImpl {
|
|
|
497
569
|
static applySplitView(element, value) {
|
|
498
570
|
const e = element.native;
|
|
499
571
|
if (e instanceof HTMLElement) {
|
|
500
|
-
|
|
501
|
-
if (value !== undefined) {
|
|
502
|
-
s.display = "flex";
|
|
503
|
-
s.position = "relative";
|
|
504
|
-
if (value === SplitView.horizontal) {
|
|
505
|
-
s.flexDirection = "row";
|
|
506
|
-
s.overflow = "scroll hidden";
|
|
507
|
-
}
|
|
508
|
-
else {
|
|
509
|
-
s.flexDirection = "column";
|
|
510
|
-
s.overflow = "hidden scroll";
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
s.display = "";
|
|
515
|
-
s.position = "";
|
|
516
|
-
s.overflow = "";
|
|
517
|
-
}
|
|
572
|
+
e.style.position = value !== undefined ? "relative" : "";
|
|
518
573
|
Transaction.separate(() => e.sensors.resize.observeResizing(element, value !== undefined));
|
|
519
574
|
}
|
|
520
575
|
}
|
|
@@ -539,10 +594,45 @@ export class ElLayoutInfo {
|
|
|
539
594
|
this.effectiveSizePx = 0;
|
|
540
595
|
this.offsetXpx = 0;
|
|
541
596
|
this.offsetYpx = 0;
|
|
542
|
-
this.
|
|
543
|
-
this.
|
|
597
|
+
this.contentSizeXpx = 0;
|
|
598
|
+
this.contentSizeYpx = 0;
|
|
599
|
+
this.borderSizeXpx = 0;
|
|
600
|
+
this.borderSizeYpx = 0;
|
|
601
|
+
this.isConstrained = false;
|
|
544
602
|
}
|
|
545
603
|
}
|
|
604
|
+
__decorate([
|
|
605
|
+
obs,
|
|
606
|
+
__metadata("design:type", Number)
|
|
607
|
+
], ElLayoutInfo.prototype, "effectiveSizePx", void 0);
|
|
608
|
+
__decorate([
|
|
609
|
+
obs,
|
|
610
|
+
__metadata("design:type", Number)
|
|
611
|
+
], ElLayoutInfo.prototype, "offsetXpx", void 0);
|
|
612
|
+
__decorate([
|
|
613
|
+
obs,
|
|
614
|
+
__metadata("design:type", Number)
|
|
615
|
+
], ElLayoutInfo.prototype, "offsetYpx", void 0);
|
|
616
|
+
__decorate([
|
|
617
|
+
obs,
|
|
618
|
+
__metadata("design:type", Number)
|
|
619
|
+
], ElLayoutInfo.prototype, "contentSizeXpx", void 0);
|
|
620
|
+
__decorate([
|
|
621
|
+
obs,
|
|
622
|
+
__metadata("design:type", Number)
|
|
623
|
+
], ElLayoutInfo.prototype, "contentSizeYpx", void 0);
|
|
624
|
+
__decorate([
|
|
625
|
+
obs,
|
|
626
|
+
__metadata("design:type", Number)
|
|
627
|
+
], ElLayoutInfo.prototype, "borderSizeYpx", void 0);
|
|
628
|
+
__decorate([
|
|
629
|
+
obs,
|
|
630
|
+
__metadata("design:type", Number)
|
|
631
|
+
], ElLayoutInfo.prototype, "borderSizeXpx", void 0);
|
|
632
|
+
__decorate([
|
|
633
|
+
obs,
|
|
634
|
+
__metadata("design:type", Boolean)
|
|
635
|
+
], ElLayoutInfo.prototype, "isConstrained", void 0);
|
|
546
636
|
var ElLayoutInfoFlags;
|
|
547
637
|
(function (ElLayoutInfoFlags) {
|
|
548
638
|
ElLayoutInfoFlags[ElLayoutInfoFlags["none"] = 0] = "none";
|
|
@@ -552,7 +642,7 @@ var ElLayoutInfoFlags;
|
|
|
552
642
|
ElLayoutInfoFlags[ElLayoutInfoFlags["childrenRelayoutIsNeeded"] = 8] = "childrenRelayoutIsNeeded";
|
|
553
643
|
})(ElLayoutInfoFlags || (ElLayoutInfoFlags = {}));
|
|
554
644
|
const UndefinedElCoords = Object.freeze({ x1: 0, y1: 0, x2: 0, y2: 0 });
|
|
555
|
-
export const InitialElLayoutInfo = Object.freeze(new ElLayoutInfo({ x: 1, y: 1, runningMaxX: 0, runningMaxY: 0, flags: ElLayoutInfoFlags.none, effectiveSizePx: 0, offsetXpx: 0, offsetYpx: 0,
|
|
645
|
+
export const InitialElLayoutInfo = Object.freeze(new ElLayoutInfo({ x: 1, y: 1, runningMaxX: 0, runningMaxY: 0, flags: ElLayoutInfoFlags.none, effectiveSizePx: 0, offsetXpx: 0, offsetYpx: 0, contentSizeXpx: 0, contentSizeYpx: 0, borderSizeXpx: 0, borderSizeYpx: 0, isConstrained: false }));
|
|
556
646
|
function getElCoordsAndAdjustLayoutInfo(isRegularElement, area, maxX, maxY, prevElLayoutInfo, layoutInfo) {
|
|
557
647
|
var _a, _b;
|
|
558
648
|
let result;
|
|
@@ -722,7 +812,6 @@ const VerstakDriversByLayout = [
|
|
|
722
812
|
const owner = el.node.owner.element;
|
|
723
813
|
s.position = "absolute";
|
|
724
814
|
s.zIndex = `${Number.MAX_SAFE_INTEGER}`;
|
|
725
|
-
s.backgroundColor = "#00BB00";
|
|
726
815
|
if (owner.splitView === SplitView.horizontal) {
|
|
727
816
|
s.width = "4px";
|
|
728
817
|
s.marginLeft = "-2px";
|
|
@@ -741,9 +830,3 @@ const VerstakDriversByLayout = [
|
|
|
741
830
|
el => {
|
|
742
831
|
},
|
|
743
832
|
];
|
|
744
|
-
function alignedX(align, like) {
|
|
745
|
-
return (align & 0b00000011) == (like & 0b00000011);
|
|
746
|
-
}
|
|
747
|
-
function alignedY(align, like) {
|
|
748
|
-
return (align & 0b00011000) == (like & 0b00011000);
|
|
749
|
-
}
|