verstak 0.24.271 → 0.24.273
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 +42 -37
- package/build/dist/source/html/El.js +122 -125
- package/build/dist/source/html/ElUtils.d.ts +14 -0
- package/build/dist/source/html/ElUtils.js +38 -9
- package/build/dist/source/html/Elements.d.ts +3 -3
- package/build/dist/source/html/Elements.js +69 -61
- package/build/dist/source/html/Handlers.d.ts +2 -1
- package/build/dist/source/html/Handlers.js +4 -2
- package/build/dist/source/html/HtmlElements.js +1 -1
- package/build/dist/source/html/SplitViewMath.js +20 -16
- package/build/dist/source/html/sensors/BasePointerSensor.d.ts +1 -2
- package/build/dist/source/html/sensors/BasePointerSensor.js +2 -2
- package/build/dist/source/html/sensors/ButtonSensor.d.ts +1 -2
- package/build/dist/source/html/sensors/ButtonSensor.js +2 -2
- package/build/dist/source/html/sensors/DataForSensor.d.ts +1 -0
- package/build/dist/source/html/sensors/DataForSensor.js +3 -3
- package/build/dist/source/html/sensors/FocusSensor.js +1 -1
- package/build/dist/source/html/sensors/HtmlDragSensor.d.ts +1 -2
- package/build/dist/source/html/sensors/HtmlDragSensor.js +2 -2
- package/build/dist/source/html/sensors/HtmlElementSensor.d.ts +1 -2
- package/build/dist/source/html/sensors/HtmlElementSensor.js +1 -6
- package/build/dist/source/html/sensors/HtmlSensors.js +3 -3
- package/build/dist/source/html/sensors/PointerSensor.d.ts +1 -2
- package/build/dist/source/html/sensors/PointerSensor.js +2 -2
- package/package.json +2 -2
|
@@ -8,15 +8,16 @@ export type El<T = any, M = any> = {
|
|
|
8
8
|
area: ElArea;
|
|
9
9
|
width: Range;
|
|
10
10
|
height: Range;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
horizontal: PosH | undefined;
|
|
12
|
+
contentHorizontal: PosH | undefined;
|
|
13
|
+
vertical: PosV | undefined;
|
|
14
|
+
contentVertical: PosV | undefined;
|
|
15
|
+
stretchingStrengthH: number | undefined;
|
|
16
|
+
stretchingStrengthV: number | undefined;
|
|
17
17
|
contentWrapping: boolean;
|
|
18
18
|
overlayVisible: boolean | undefined;
|
|
19
|
-
|
|
19
|
+
sealed: Direction | undefined;
|
|
20
|
+
splitView: Direction | undefined;
|
|
20
21
|
widthPx: {
|
|
21
22
|
minPx: number;
|
|
22
23
|
maxPx: number;
|
|
@@ -30,7 +31,7 @@ export type El<T = any, M = any> = {
|
|
|
30
31
|
useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
|
|
31
32
|
};
|
|
32
33
|
export declare enum ElKind {
|
|
33
|
-
|
|
34
|
+
panel = 0,
|
|
34
35
|
table = 1,
|
|
35
36
|
note = 2,
|
|
36
37
|
group = 3,
|
|
@@ -45,13 +46,13 @@ export type ElCoords = {
|
|
|
45
46
|
x2: number;
|
|
46
47
|
y2: number;
|
|
47
48
|
};
|
|
48
|
-
export declare enum
|
|
49
|
+
export declare enum PosH {
|
|
49
50
|
left = 0,
|
|
50
51
|
center = 1,
|
|
51
52
|
right = 2,
|
|
52
53
|
stretch = 3
|
|
53
54
|
}
|
|
54
|
-
export declare enum
|
|
55
|
+
export declare enum PosV {
|
|
55
56
|
top = 0,
|
|
56
57
|
center = 1,
|
|
57
58
|
bottom = 2,
|
|
@@ -69,7 +70,7 @@ export type ElArea = undefined | string | {
|
|
|
69
70
|
cellsOverWidth?: number;
|
|
70
71
|
cellsOverHeight?: number;
|
|
71
72
|
};
|
|
72
|
-
export declare enum
|
|
73
|
+
export declare enum Direction {
|
|
73
74
|
horizontal = 0,
|
|
74
75
|
vertical = 1
|
|
75
76
|
}
|
|
@@ -88,20 +89,21 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
88
89
|
private _coords;
|
|
89
90
|
private _width;
|
|
90
91
|
private _height;
|
|
91
|
-
private
|
|
92
|
-
private
|
|
93
|
-
private
|
|
94
|
-
private
|
|
95
|
-
private
|
|
96
|
-
private
|
|
92
|
+
private _horizontal;
|
|
93
|
+
private _vertical;
|
|
94
|
+
private _contentHorizontal;
|
|
95
|
+
private _contentVertical;
|
|
96
|
+
private _stretchingStrengthH;
|
|
97
|
+
private _stretchingStrengthV;
|
|
97
98
|
private _contentWrapping;
|
|
98
99
|
private _overlayVisible;
|
|
100
|
+
private _sealed;
|
|
99
101
|
private _splitView;
|
|
100
102
|
private _hasStylingPresets;
|
|
101
103
|
constructor(node: RxNode<El<T, M>>);
|
|
102
104
|
prepareForUpdate(): void;
|
|
103
105
|
get index(): number;
|
|
104
|
-
get
|
|
106
|
+
get isPanel(): boolean;
|
|
105
107
|
get isTable(): boolean;
|
|
106
108
|
get isAuxiliary(): boolean;
|
|
107
109
|
get kind(): ElKind;
|
|
@@ -132,24 +134,26 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
132
134
|
});
|
|
133
135
|
get preferredHeightUsed(): boolean;
|
|
134
136
|
set preferredHeightUsed(value: boolean);
|
|
135
|
-
get
|
|
136
|
-
set
|
|
137
|
-
get
|
|
138
|
-
set
|
|
139
|
-
get
|
|
140
|
-
set
|
|
141
|
-
get
|
|
142
|
-
set
|
|
143
|
-
get
|
|
144
|
-
set
|
|
145
|
-
get
|
|
146
|
-
set
|
|
137
|
+
get horizontal(): PosH | undefined;
|
|
138
|
+
set horizontal(value: PosH | undefined);
|
|
139
|
+
get vertical(): PosV | undefined;
|
|
140
|
+
set vertical(value: PosV | undefined);
|
|
141
|
+
get contentHorizontal(): PosH | undefined;
|
|
142
|
+
set contentHorizontal(value: PosH | undefined);
|
|
143
|
+
get contentVertical(): PosV | undefined;
|
|
144
|
+
set contentVertical(value: PosV | undefined);
|
|
145
|
+
get stretchingStrengthH(): number | undefined;
|
|
146
|
+
set stretchingStrengthH(value: number | undefined);
|
|
147
|
+
get stretchingStrengthV(): number | undefined;
|
|
148
|
+
set stretchingStrengthV(value: number | undefined);
|
|
147
149
|
get contentWrapping(): boolean;
|
|
148
150
|
set contentWrapping(value: boolean);
|
|
149
151
|
get overlayVisible(): boolean | undefined;
|
|
150
152
|
set overlayVisible(value: boolean | undefined);
|
|
151
|
-
get
|
|
152
|
-
set
|
|
153
|
+
get sealed(): Direction | undefined;
|
|
154
|
+
set sealed(value: Direction | undefined);
|
|
155
|
+
get splitView(): Direction | undefined;
|
|
156
|
+
set splitView(value: Direction | undefined);
|
|
153
157
|
get partitionSizeInSplitViewPx(): number;
|
|
154
158
|
get style(): CSSStyleDeclaration;
|
|
155
159
|
useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
|
|
@@ -160,13 +164,14 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
160
164
|
private static applyCoords;
|
|
161
165
|
private static applyWidth;
|
|
162
166
|
private static applyHeight;
|
|
163
|
-
private static
|
|
164
|
-
private static
|
|
165
|
-
private static
|
|
166
|
-
private static
|
|
167
|
+
private static applyHorizontal;
|
|
168
|
+
private static applyVertical;
|
|
169
|
+
private static applyStretchingStrengthH;
|
|
170
|
+
private static applyStretchingStrengthV;
|
|
167
171
|
private static applyContentWrapping;
|
|
168
172
|
private static applyOverlayVisible;
|
|
169
|
-
static
|
|
173
|
+
static applySealed<T extends Element>(element: El<T, any>, value: Direction | undefined): void;
|
|
174
|
+
static applySplitView<T extends Element>(element: El<T, any>, value: Direction | undefined): void;
|
|
170
175
|
private static applyStylingPreset;
|
|
171
176
|
}
|
|
172
177
|
export declare class ElLayoutInfo {
|
|
@@ -11,7 +11,7 @@ import { RxNode, BaseDriver, Transaction, obs, ObservableObject } from "reactron
|
|
|
11
11
|
import { equalElCoords, parseElCoords } from "./ElUtils.js";
|
|
12
12
|
export var ElKind;
|
|
13
13
|
(function (ElKind) {
|
|
14
|
-
ElKind[ElKind["
|
|
14
|
+
ElKind[ElKind["panel"] = 0] = "panel";
|
|
15
15
|
ElKind[ElKind["table"] = 1] = "table";
|
|
16
16
|
ElKind[ElKind["note"] = 2] = "note";
|
|
17
17
|
ElKind[ElKind["group"] = 3] = "group";
|
|
@@ -20,25 +20,25 @@ export var ElKind;
|
|
|
20
20
|
ElKind[ElKind["cursor"] = 6] = "cursor";
|
|
21
21
|
ElKind[ElKind["native"] = 7] = "native";
|
|
22
22
|
})(ElKind || (ElKind = {}));
|
|
23
|
-
export var
|
|
24
|
-
(function (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})(
|
|
30
|
-
export var
|
|
31
|
-
(function (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})(
|
|
37
|
-
export var
|
|
38
|
-
(function (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})(
|
|
23
|
+
export var PosH;
|
|
24
|
+
(function (PosH) {
|
|
25
|
+
PosH[PosH["left"] = 0] = "left";
|
|
26
|
+
PosH[PosH["center"] = 1] = "center";
|
|
27
|
+
PosH[PosH["right"] = 2] = "right";
|
|
28
|
+
PosH[PosH["stretch"] = 3] = "stretch";
|
|
29
|
+
})(PosH || (PosH = {}));
|
|
30
|
+
export var PosV;
|
|
31
|
+
(function (PosV) {
|
|
32
|
+
PosV[PosV["top"] = 0] = "top";
|
|
33
|
+
PosV[PosV["center"] = 1] = "center";
|
|
34
|
+
PosV[PosV["bottom"] = 2] = "bottom";
|
|
35
|
+
PosV[PosV["stretch"] = 3] = "stretch";
|
|
36
|
+
})(PosV || (PosV = {}));
|
|
37
|
+
export var Direction;
|
|
38
|
+
(function (Direction) {
|
|
39
|
+
Direction[Direction["horizontal"] = 0] = "horizontal";
|
|
40
|
+
Direction[Direction["vertical"] = 1] = "vertical";
|
|
41
|
+
})(Direction || (Direction = {}));
|
|
42
42
|
class Size extends ObservableObject {
|
|
43
43
|
constructor() {
|
|
44
44
|
super();
|
|
@@ -66,14 +66,15 @@ export class ElImpl {
|
|
|
66
66
|
this._coords = UndefinedElCoords;
|
|
67
67
|
this._width = Transaction.separate(() => new Size());
|
|
68
68
|
this._height = Transaction.separate(() => new Size());
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
69
|
+
this._horizontal = undefined;
|
|
70
|
+
this._vertical = undefined;
|
|
71
|
+
this._contentHorizontal = undefined;
|
|
72
|
+
this._contentVertical = undefined;
|
|
73
|
+
this._stretchingStrengthH = undefined;
|
|
74
|
+
this._stretchingStrengthV = undefined;
|
|
75
75
|
this._contentWrapping = true;
|
|
76
76
|
this._overlayVisible = undefined;
|
|
77
|
+
this._sealed = undefined;
|
|
77
78
|
this._splitView = undefined;
|
|
78
79
|
this._hasStylingPresets = false;
|
|
79
80
|
}
|
|
@@ -82,7 +83,7 @@ export class ElImpl {
|
|
|
82
83
|
this._hasStylingPresets = false;
|
|
83
84
|
}
|
|
84
85
|
get index() { return this.node.seat.index; }
|
|
85
|
-
get
|
|
86
|
+
get isPanel() { return this.kind === ElKind.panel; }
|
|
86
87
|
get isTable() { return this.kind === ElKind.table; }
|
|
87
88
|
get isAuxiliary() { return this.kind > ElKind.note; }
|
|
88
89
|
get kind() { return this._kind; }
|
|
@@ -119,7 +120,7 @@ export class ElImpl {
|
|
|
119
120
|
get width() { return this._width.raw; }
|
|
120
121
|
set width(value) {
|
|
121
122
|
const w = this._width.raw;
|
|
122
|
-
if (value.min !== w.min || value.max !== w.max) {
|
|
123
|
+
if (value.min !== w.min || value.max !== w.max || value.preferred !== undefined) {
|
|
123
124
|
ElImpl.applyWidth(this, value);
|
|
124
125
|
this._width.raw = value;
|
|
125
126
|
this._width.preferredUsed = false;
|
|
@@ -142,7 +143,7 @@ export class ElImpl {
|
|
|
142
143
|
get height() { return this._height.raw; }
|
|
143
144
|
set height(value) {
|
|
144
145
|
const h = this._height.raw;
|
|
145
|
-
if (value.min !== h.min || value.max !== h.max) {
|
|
146
|
+
if (value.min !== h.min || value.max !== h.max || value.preferred !== undefined) {
|
|
146
147
|
ElImpl.applyHeight(this, value);
|
|
147
148
|
this._height.raw = value;
|
|
148
149
|
this._height.preferredUsed = false;
|
|
@@ -162,52 +163,52 @@ export class ElImpl {
|
|
|
162
163
|
set preferredHeightUsed(value) {
|
|
163
164
|
this._height.preferredUsed = value;
|
|
164
165
|
}
|
|
165
|
-
get
|
|
166
|
-
set
|
|
167
|
-
const existing = this.
|
|
166
|
+
get horizontal() { return this._horizontal; }
|
|
167
|
+
set horizontal(value) {
|
|
168
|
+
const existing = this._horizontal;
|
|
168
169
|
if (value !== existing) {
|
|
169
|
-
ElImpl.
|
|
170
|
-
this.
|
|
170
|
+
ElImpl.applyHorizontal(this, existing, value, this._contentHorizontal, this._contentHorizontal, this._stretchingStrengthH);
|
|
171
|
+
this._horizontal = value;
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
|
-
get
|
|
174
|
-
set
|
|
175
|
-
const existing = this.
|
|
174
|
+
get vertical() { return this._vertical; }
|
|
175
|
+
set vertical(value) {
|
|
176
|
+
const existing = this._vertical;
|
|
176
177
|
if (value !== existing) {
|
|
177
|
-
ElImpl.
|
|
178
|
-
this.
|
|
178
|
+
ElImpl.applyVertical(this, existing, value, this._contentVertical, this._contentVertical, this._stretchingStrengthV);
|
|
179
|
+
this._vertical = value;
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
|
-
get
|
|
182
|
-
set
|
|
183
|
-
const existing = this.
|
|
182
|
+
get contentHorizontal() { return this._contentHorizontal; }
|
|
183
|
+
set contentHorizontal(value) {
|
|
184
|
+
const existing = this._contentHorizontal;
|
|
184
185
|
if (value !== existing) {
|
|
185
|
-
ElImpl.
|
|
186
|
-
this.
|
|
186
|
+
ElImpl.applyHorizontal(this, this._horizontal, this._horizontal, existing, value, this._stretchingStrengthH);
|
|
187
|
+
this._contentHorizontal = value;
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
get
|
|
190
|
-
set
|
|
191
|
-
const existing = this.
|
|
190
|
+
get contentVertical() { return this._contentVertical; }
|
|
191
|
+
set contentVertical(value) {
|
|
192
|
+
const existing = this._contentVertical;
|
|
192
193
|
if (value !== existing) {
|
|
193
|
-
ElImpl.
|
|
194
|
-
this.
|
|
194
|
+
ElImpl.applyVertical(this, this._vertical, this._vertical, existing, value, this._stretchingStrengthV);
|
|
195
|
+
this._contentVertical = value;
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
|
-
get
|
|
198
|
-
set
|
|
199
|
-
const existing = this.
|
|
198
|
+
get stretchingStrengthH() { return this._stretchingStrengthH; }
|
|
199
|
+
set stretchingStrengthH(value) {
|
|
200
|
+
const existing = this._stretchingStrengthH;
|
|
200
201
|
if (value !== existing) {
|
|
201
|
-
ElImpl.
|
|
202
|
-
this.
|
|
202
|
+
ElImpl.applyStretchingStrengthH(this, existing, value);
|
|
203
|
+
this._stretchingStrengthH = value;
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
|
-
get
|
|
206
|
-
set
|
|
207
|
-
const existing = this.
|
|
206
|
+
get stretchingStrengthV() { return this._stretchingStrengthV; }
|
|
207
|
+
set stretchingStrengthV(value) {
|
|
208
|
+
const existing = this._stretchingStrengthV;
|
|
208
209
|
if (value !== existing) {
|
|
209
|
-
ElImpl.
|
|
210
|
-
this.
|
|
210
|
+
ElImpl.applyStretchingStrengthV(this, existing, value);
|
|
211
|
+
this._stretchingStrengthV = value;
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
get contentWrapping() { return this._contentWrapping; }
|
|
@@ -224,6 +225,13 @@ export class ElImpl {
|
|
|
224
225
|
this._overlayVisible = value;
|
|
225
226
|
}
|
|
226
227
|
}
|
|
228
|
+
get sealed() { return this._sealed; }
|
|
229
|
+
set sealed(value) {
|
|
230
|
+
if (value !== this._sealed) {
|
|
231
|
+
ElImpl.applySealed(this, value);
|
|
232
|
+
this._sealed = value;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
227
235
|
get splitView() { return this._splitView; }
|
|
228
236
|
set splitView(value) {
|
|
229
237
|
if (value !== this._splitView) {
|
|
@@ -282,7 +290,7 @@ export class ElImpl {
|
|
|
282
290
|
const node = element.node;
|
|
283
291
|
const owner = node.owner;
|
|
284
292
|
const ownerEl = owner.element;
|
|
285
|
-
if (ownerEl.splitView ===
|
|
293
|
+
if (ownerEl.splitView === Direction.horizontal) {
|
|
286
294
|
}
|
|
287
295
|
else {
|
|
288
296
|
s.minWidth = (_a = value.min) !== null && _a !== void 0 ? _a : "";
|
|
@@ -295,17 +303,17 @@ export class ElImpl {
|
|
|
295
303
|
const node = element.node;
|
|
296
304
|
const owner = node.owner;
|
|
297
305
|
const ownerEl = owner.element;
|
|
298
|
-
if (ownerEl.splitView ===
|
|
306
|
+
if (ownerEl.splitView === Direction.vertical) {
|
|
299
307
|
}
|
|
300
308
|
else {
|
|
301
309
|
s.minHeight = (_a = value.min) !== null && _a !== void 0 ? _a : "";
|
|
302
310
|
s.maxHeight = (_b = value.max) !== null && _b !== void 0 ? _b : "";
|
|
303
311
|
}
|
|
304
312
|
}
|
|
305
|
-
static
|
|
306
|
-
var _a;
|
|
307
|
-
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary =
|
|
308
|
-
newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary =
|
|
313
|
+
static applyHorizontal(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
|
|
314
|
+
var _a, _b;
|
|
315
|
+
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = PosH.left);
|
|
316
|
+
newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = PosH.left);
|
|
309
317
|
oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
|
|
310
318
|
newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
|
|
311
319
|
const css = element.style;
|
|
@@ -318,8 +326,8 @@ export class ElImpl {
|
|
|
318
326
|
}
|
|
319
327
|
let isEffectiveAlignerX = false;
|
|
320
328
|
if (hostLayout) {
|
|
321
|
-
const isAligner = newPrimary ===
|
|
322
|
-
newPrimary ===
|
|
329
|
+
const isAligner = newPrimary === PosH.center ||
|
|
330
|
+
newPrimary === PosH.right;
|
|
323
331
|
isEffectiveAlignerX = isAligner && (hostLayout.alignerX === undefined ||
|
|
324
332
|
element.index <= hostLayout.alignerX.index);
|
|
325
333
|
if (hostLayout.alignerX === element) {
|
|
@@ -330,7 +338,7 @@ export class ElImpl {
|
|
|
330
338
|
}
|
|
331
339
|
else {
|
|
332
340
|
if (isEffectiveAlignerX) {
|
|
333
|
-
const existingAlignerCss = (_a = hostLayout.alignerX) === null || _a === void 0 ? void 0 : _a.style;
|
|
341
|
+
const existingAlignerCss = (_b = (_a = hostLayout.alignerX) === null || _a === void 0 ? void 0 : _a.native) === null || _b === void 0 ? void 0 : _b.style;
|
|
334
342
|
if (existingAlignerCss)
|
|
335
343
|
existingAlignerCss.marginLeft = "";
|
|
336
344
|
hostLayout.alignerX = element;
|
|
@@ -339,63 +347,63 @@ export class ElImpl {
|
|
|
339
347
|
}
|
|
340
348
|
switch (newPrimary) {
|
|
341
349
|
default:
|
|
342
|
-
case
|
|
350
|
+
case PosH.left:
|
|
343
351
|
css.justifySelf = "start";
|
|
344
|
-
if (oldPrimary ===
|
|
352
|
+
if (oldPrimary === PosH.center) {
|
|
345
353
|
css.marginLeft = "";
|
|
346
354
|
css.marginRight = "";
|
|
347
355
|
}
|
|
348
|
-
else if (oldPrimary ===
|
|
356
|
+
else if (oldPrimary === PosH.right)
|
|
349
357
|
css.marginLeft = "";
|
|
350
358
|
break;
|
|
351
|
-
case
|
|
359
|
+
case PosH.center:
|
|
352
360
|
css.justifySelf = "center";
|
|
353
361
|
if (hostLayout)
|
|
354
362
|
css.marginLeft = isEffectiveAlignerX ? "auto" : "";
|
|
355
363
|
css.marginRight = "auto";
|
|
356
364
|
break;
|
|
357
|
-
case
|
|
365
|
+
case PosH.right:
|
|
358
366
|
css.justifySelf = "end";
|
|
359
367
|
if (hostLayout)
|
|
360
368
|
css.marginLeft = isEffectiveAlignerX ? "auto" : "";
|
|
361
|
-
if (oldPrimary ===
|
|
369
|
+
if (oldPrimary === PosH.center)
|
|
362
370
|
css.marginRight = "";
|
|
363
371
|
break;
|
|
364
|
-
case
|
|
372
|
+
case PosH.stretch:
|
|
365
373
|
css.justifySelf = "stretch";
|
|
366
|
-
if (oldPrimary ===
|
|
374
|
+
if (oldPrimary === PosH.center) {
|
|
367
375
|
css.marginLeft = "";
|
|
368
376
|
css.marginRight = "";
|
|
369
377
|
}
|
|
370
|
-
else if (oldPrimary ===
|
|
378
|
+
else if (oldPrimary === PosH.right)
|
|
371
379
|
css.marginLeft = "";
|
|
372
380
|
break;
|
|
373
381
|
}
|
|
374
382
|
switch (newInside) {
|
|
375
383
|
default:
|
|
376
|
-
case
|
|
384
|
+
case PosH.left:
|
|
377
385
|
css.alignItems = "start";
|
|
378
386
|
css.textAlign = "left";
|
|
379
387
|
break;
|
|
380
|
-
case
|
|
388
|
+
case PosH.center:
|
|
381
389
|
css.alignItems = "center";
|
|
382
390
|
css.textAlign = "center";
|
|
383
391
|
break;
|
|
384
|
-
case
|
|
392
|
+
case PosH.right:
|
|
385
393
|
css.alignItems = "end";
|
|
386
394
|
css.textAlign = "right";
|
|
387
395
|
break;
|
|
388
|
-
case
|
|
396
|
+
case PosH.stretch:
|
|
389
397
|
css.alignItems = "stretch";
|
|
390
398
|
css.textAlign = "justify";
|
|
391
399
|
break;
|
|
392
400
|
}
|
|
393
|
-
if (newPrimary ===
|
|
394
|
-
ElImpl.
|
|
401
|
+
if (newPrimary === PosH.stretch && strength === undefined)
|
|
402
|
+
ElImpl.applyStretchingStrengthH(element, 0, 1);
|
|
395
403
|
}
|
|
396
|
-
static
|
|
397
|
-
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary =
|
|
398
|
-
newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary =
|
|
404
|
+
static applyVertical(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
|
|
405
|
+
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = PosV.top);
|
|
406
|
+
newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = PosV.top);
|
|
399
407
|
oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
|
|
400
408
|
newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
|
|
401
409
|
const css = element.style;
|
|
@@ -410,10 +418,10 @@ export class ElImpl {
|
|
|
410
418
|
}
|
|
411
419
|
let isEffectiveAlignerY = false;
|
|
412
420
|
if (hostLayout) {
|
|
413
|
-
const isAligner = newPrimary ===
|
|
414
|
-
newPrimary ===
|
|
421
|
+
const isAligner = newPrimary === PosV.center ||
|
|
422
|
+
newPrimary === PosV.bottom;
|
|
415
423
|
isEffectiveAlignerY = isAligner && (hostLayout.alignerY === undefined ||
|
|
416
|
-
hostLayout.alignerY.
|
|
424
|
+
hostLayout.alignerY.vertical !== PosV.center);
|
|
417
425
|
if (hostLayout.alignerY === element) {
|
|
418
426
|
if (!isEffectiveAlignerY) {
|
|
419
427
|
hostCss.marginTop = "";
|
|
@@ -428,62 +436,45 @@ export class ElImpl {
|
|
|
428
436
|
}
|
|
429
437
|
switch (newPrimary) {
|
|
430
438
|
default:
|
|
431
|
-
case
|
|
439
|
+
case PosV.top:
|
|
432
440
|
css.alignSelf = "start";
|
|
433
441
|
break;
|
|
434
|
-
case
|
|
442
|
+
case PosV.center:
|
|
435
443
|
css.alignSelf = "center";
|
|
436
444
|
break;
|
|
437
|
-
case
|
|
445
|
+
case PosV.bottom:
|
|
438
446
|
css.alignSelf = "end";
|
|
439
447
|
break;
|
|
440
|
-
case
|
|
448
|
+
case PosV.stretch:
|
|
441
449
|
css.alignSelf = "stretch";
|
|
442
450
|
break;
|
|
443
451
|
}
|
|
444
452
|
switch (newInside) {
|
|
445
453
|
default:
|
|
446
|
-
case
|
|
454
|
+
case PosV.top:
|
|
447
455
|
css.justifyContent = "start";
|
|
448
456
|
break;
|
|
449
|
-
case
|
|
457
|
+
case PosV.center:
|
|
450
458
|
css.justifyContent = "center";
|
|
451
459
|
break;
|
|
452
|
-
case
|
|
460
|
+
case PosV.bottom:
|
|
453
461
|
css.justifyContent = "end";
|
|
454
462
|
break;
|
|
455
|
-
case
|
|
463
|
+
case PosV.stretch:
|
|
456
464
|
css.justifyContent = "stretch";
|
|
457
465
|
break;
|
|
458
466
|
}
|
|
459
|
-
if (newPrimary ===
|
|
460
|
-
ElImpl.
|
|
467
|
+
if (newPrimary === PosV.stretch && strength === undefined)
|
|
468
|
+
ElImpl.applyStretchingStrengthV(element, 0, 1);
|
|
461
469
|
}
|
|
462
|
-
static
|
|
463
|
-
var _a;
|
|
470
|
+
static applyStretchingStrengthH(element, existing, value) {
|
|
464
471
|
const s = element.style;
|
|
465
472
|
const host = element.node.host;
|
|
466
|
-
if (host.driver.isPartition
|
|
473
|
+
if (host.driver.isPartition) {
|
|
467
474
|
const hostEl = host.element;
|
|
468
|
-
hostEl.
|
|
469
|
-
let delta = 0;
|
|
475
|
+
hostEl._stretchingStrengthH = value;
|
|
470
476
|
existing !== null && existing !== void 0 ? existing : (existing = 0);
|
|
471
477
|
value !== null && value !== void 0 ? value : (value = 0);
|
|
472
|
-
if (existing === 0) {
|
|
473
|
-
if (value !== 0)
|
|
474
|
-
delta = 1;
|
|
475
|
-
}
|
|
476
|
-
else if (value === 0) {
|
|
477
|
-
if (existing !== 0)
|
|
478
|
-
delta = -1;
|
|
479
|
-
}
|
|
480
|
-
if (delta !== 0) {
|
|
481
|
-
const count = (_a = hostEl._stretchingStrengthX) !== null && _a !== void 0 ? _a : 0 + delta;
|
|
482
|
-
if (count === 1)
|
|
483
|
-
s.alignSelf = "stretch";
|
|
484
|
-
else if (count === 0)
|
|
485
|
-
s.alignSelf = "";
|
|
486
|
-
}
|
|
487
478
|
}
|
|
488
479
|
value !== null && value !== void 0 ? value : (value = 0);
|
|
489
480
|
if (value > 0) {
|
|
@@ -495,12 +486,12 @@ export class ElImpl {
|
|
|
495
486
|
s.flexBasis = "";
|
|
496
487
|
}
|
|
497
488
|
}
|
|
498
|
-
static
|
|
489
|
+
static applyStretchingStrengthV(element, existing, value) {
|
|
499
490
|
var _a;
|
|
500
491
|
const host = element.node.host;
|
|
501
|
-
if (host.driver.isPartition
|
|
492
|
+
if (host.driver.isPartition) {
|
|
502
493
|
const hostElement = host.element;
|
|
503
|
-
hostElement.
|
|
494
|
+
hostElement._stretchingStrengthV = value;
|
|
504
495
|
let delta = 0;
|
|
505
496
|
existing !== null && existing !== void 0 ? existing : (existing = 0);
|
|
506
497
|
value !== null && value !== void 0 ? value : (value = 0);
|
|
@@ -513,7 +504,7 @@ export class ElImpl {
|
|
|
513
504
|
delta = -1;
|
|
514
505
|
}
|
|
515
506
|
if (delta !== 0) {
|
|
516
|
-
const count = (_a = hostElement.
|
|
507
|
+
const count = (_a = hostElement._stretchingStrengthV) !== null && _a !== void 0 ? _a : 0 + delta;
|
|
517
508
|
const s = hostElement.style;
|
|
518
509
|
if (count === 1)
|
|
519
510
|
s.flexGrow = `${value}`;
|
|
@@ -566,11 +557,17 @@ export class ElImpl {
|
|
|
566
557
|
s.position = s.display = s.left = s.right = s.top = s.bottom = "";
|
|
567
558
|
}
|
|
568
559
|
}
|
|
560
|
+
static applySealed(element, value) {
|
|
561
|
+
const e = element.native;
|
|
562
|
+
if (e instanceof HTMLElement) {
|
|
563
|
+
Transaction.separate(() => e.sensors.resize.observeResizing(element, value !== undefined));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
569
566
|
static applySplitView(element, value) {
|
|
570
567
|
const e = element.native;
|
|
571
568
|
if (e instanceof HTMLElement) {
|
|
569
|
+
element.sealed = value;
|
|
572
570
|
e.style.position = value !== undefined ? "relative" : "";
|
|
573
|
-
Transaction.separate(() => e.sensors.resize.observeResizing(element, value !== undefined));
|
|
574
571
|
}
|
|
575
572
|
}
|
|
576
573
|
static applyStylingPreset(element, secondary, styleName, enabled) {
|
|
@@ -812,7 +809,7 @@ const VerstakDriversByLayout = [
|
|
|
812
809
|
const owner = el.node.owner.element;
|
|
813
810
|
s.position = "absolute";
|
|
814
811
|
s.zIndex = `${Number.MAX_SAFE_INTEGER}`;
|
|
815
|
-
if (owner.splitView ===
|
|
812
|
+
if (owner.splitView === Direction.horizontal) {
|
|
816
813
|
s.width = "4px";
|
|
817
814
|
s.marginLeft = "-2px";
|
|
818
815
|
s.top = s.bottom = "0";
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { ElCoords } from "./El.js";
|
|
2
2
|
export declare function objectHasMember<T>(obj: any, member: string): obj is T;
|
|
3
3
|
export declare function clamp(value: number, min: number, max: number): number;
|
|
4
|
+
export declare function parseLetters(value: string): number;
|
|
4
5
|
export declare function emitLetters(n: number): string;
|
|
6
|
+
export declare function parseSignedLetters(letters: string): number;
|
|
7
|
+
export declare function emitSignedLetters(num: number): string;
|
|
8
|
+
export declare function parseSignedNumber(number: string): number;
|
|
9
|
+
export declare function emitSignedNumber(num: number): string;
|
|
10
|
+
export declare function parseSign(value: string): {
|
|
11
|
+
sign: number;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function emitSign(sign: number, num: number | string): string;
|
|
5
15
|
export declare function parseElCoords(text: string, result: ElCoords): ElCoords;
|
|
6
16
|
export declare function emitElCoords(value: ElCoords): string;
|
|
7
17
|
export declare function emitCellPosition(x: number, y: number): string;
|
|
8
18
|
export declare function equalElCoords(a: ElCoords, b: ElCoords): boolean;
|
|
19
|
+
export declare function isWhitespace(char: number): boolean;
|
|
20
|
+
export declare function isDigit(input: number, index?: number): boolean;
|
|
21
|
+
export declare function isCapitalLetter(ch: number): boolean;
|
|
22
|
+
export declare function isLowercaseLetter(ch: number): boolean;
|