verstak 0.24.272 → 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 +32 -32
- package/build/dist/source/html/El.js +95 -95
- package/build/dist/source/html/Elements.d.ts +3 -3
- package/build/dist/source/html/Elements.js +5 -5
- package/build/dist/source/html/Handlers.d.ts +2 -1
- package/build/dist/source/html/Handlers.js +3 -3
- package/build/dist/source/html/HtmlElements.js +1 -1
- package/build/dist/source/html/SplitViewMath.js +15 -11
- package/package.json +2 -2
|
@@ -8,12 +8,12 @@ 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;
|
|
@@ -31,7 +31,7 @@ export type El<T = any, M = any> = {
|
|
|
31
31
|
useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
|
|
32
32
|
};
|
|
33
33
|
export declare enum ElKind {
|
|
34
|
-
|
|
34
|
+
panel = 0,
|
|
35
35
|
table = 1,
|
|
36
36
|
note = 2,
|
|
37
37
|
group = 3,
|
|
@@ -46,13 +46,13 @@ export type ElCoords = {
|
|
|
46
46
|
x2: number;
|
|
47
47
|
y2: number;
|
|
48
48
|
};
|
|
49
|
-
export declare enum
|
|
49
|
+
export declare enum PosH {
|
|
50
50
|
left = 0,
|
|
51
51
|
center = 1,
|
|
52
52
|
right = 2,
|
|
53
53
|
stretch = 3
|
|
54
54
|
}
|
|
55
|
-
export declare enum
|
|
55
|
+
export declare enum PosV {
|
|
56
56
|
top = 0,
|
|
57
57
|
center = 1,
|
|
58
58
|
bottom = 2,
|
|
@@ -89,12 +89,12 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
89
89
|
private _coords;
|
|
90
90
|
private _width;
|
|
91
91
|
private _height;
|
|
92
|
-
private
|
|
93
|
-
private
|
|
94
|
-
private
|
|
95
|
-
private
|
|
96
|
-
private
|
|
97
|
-
private
|
|
92
|
+
private _horizontal;
|
|
93
|
+
private _vertical;
|
|
94
|
+
private _contentHorizontal;
|
|
95
|
+
private _contentVertical;
|
|
96
|
+
private _stretchingStrengthH;
|
|
97
|
+
private _stretchingStrengthV;
|
|
98
98
|
private _contentWrapping;
|
|
99
99
|
private _overlayVisible;
|
|
100
100
|
private _sealed;
|
|
@@ -103,7 +103,7 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
103
103
|
constructor(node: RxNode<El<T, M>>);
|
|
104
104
|
prepareForUpdate(): void;
|
|
105
105
|
get index(): number;
|
|
106
|
-
get
|
|
106
|
+
get isPanel(): boolean;
|
|
107
107
|
get isTable(): boolean;
|
|
108
108
|
get isAuxiliary(): boolean;
|
|
109
109
|
get kind(): ElKind;
|
|
@@ -134,18 +134,18 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
134
134
|
});
|
|
135
135
|
get preferredHeightUsed(): boolean;
|
|
136
136
|
set preferredHeightUsed(value: boolean);
|
|
137
|
-
get
|
|
138
|
-
set
|
|
139
|
-
get
|
|
140
|
-
set
|
|
141
|
-
get
|
|
142
|
-
set
|
|
143
|
-
get
|
|
144
|
-
set
|
|
145
|
-
get
|
|
146
|
-
set
|
|
147
|
-
get
|
|
148
|
-
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);
|
|
149
149
|
get contentWrapping(): boolean;
|
|
150
150
|
set contentWrapping(value: boolean);
|
|
151
151
|
get overlayVisible(): boolean | undefined;
|
|
@@ -164,10 +164,10 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
164
164
|
private static applyCoords;
|
|
165
165
|
private static applyWidth;
|
|
166
166
|
private static applyHeight;
|
|
167
|
-
private static
|
|
168
|
-
private static
|
|
169
|
-
private static
|
|
170
|
-
private static
|
|
167
|
+
private static applyHorizontal;
|
|
168
|
+
private static applyVertical;
|
|
169
|
+
private static applyStretchingStrengthH;
|
|
170
|
+
private static applyStretchingStrengthV;
|
|
171
171
|
private static applyContentWrapping;
|
|
172
172
|
private static applyOverlayVisible;
|
|
173
173
|
static applySealed<T extends Element>(element: El<T, any>, value: Direction | undefined): void;
|
|
@@ -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,20 +20,20 @@ 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
|
-
})(
|
|
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
37
|
export var Direction;
|
|
38
38
|
(function (Direction) {
|
|
39
39
|
Direction[Direction["horizontal"] = 0] = "horizontal";
|
|
@@ -66,12 +66,12 @@ 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
77
|
this._sealed = undefined;
|
|
@@ -83,7 +83,7 @@ export class ElImpl {
|
|
|
83
83
|
this._hasStylingPresets = false;
|
|
84
84
|
}
|
|
85
85
|
get index() { return this.node.seat.index; }
|
|
86
|
-
get
|
|
86
|
+
get isPanel() { return this.kind === ElKind.panel; }
|
|
87
87
|
get isTable() { return this.kind === ElKind.table; }
|
|
88
88
|
get isAuxiliary() { return this.kind > ElKind.note; }
|
|
89
89
|
get kind() { return this._kind; }
|
|
@@ -120,7 +120,7 @@ export class ElImpl {
|
|
|
120
120
|
get width() { return this._width.raw; }
|
|
121
121
|
set width(value) {
|
|
122
122
|
const w = this._width.raw;
|
|
123
|
-
if (value.min !== w.min || value.max !== w.max) {
|
|
123
|
+
if (value.min !== w.min || value.max !== w.max || value.preferred !== undefined) {
|
|
124
124
|
ElImpl.applyWidth(this, value);
|
|
125
125
|
this._width.raw = value;
|
|
126
126
|
this._width.preferredUsed = false;
|
|
@@ -143,7 +143,7 @@ export class ElImpl {
|
|
|
143
143
|
get height() { return this._height.raw; }
|
|
144
144
|
set height(value) {
|
|
145
145
|
const h = this._height.raw;
|
|
146
|
-
if (value.min !== h.min || value.max !== h.max) {
|
|
146
|
+
if (value.min !== h.min || value.max !== h.max || value.preferred !== undefined) {
|
|
147
147
|
ElImpl.applyHeight(this, value);
|
|
148
148
|
this._height.raw = value;
|
|
149
149
|
this._height.preferredUsed = false;
|
|
@@ -163,52 +163,52 @@ export class ElImpl {
|
|
|
163
163
|
set preferredHeightUsed(value) {
|
|
164
164
|
this._height.preferredUsed = value;
|
|
165
165
|
}
|
|
166
|
-
get
|
|
167
|
-
set
|
|
168
|
-
const existing = this.
|
|
166
|
+
get horizontal() { return this._horizontal; }
|
|
167
|
+
set horizontal(value) {
|
|
168
|
+
const existing = this._horizontal;
|
|
169
169
|
if (value !== existing) {
|
|
170
|
-
ElImpl.
|
|
171
|
-
this.
|
|
170
|
+
ElImpl.applyHorizontal(this, existing, value, this._contentHorizontal, this._contentHorizontal, this._stretchingStrengthH);
|
|
171
|
+
this._horizontal = value;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
get
|
|
175
|
-
set
|
|
176
|
-
const existing = this.
|
|
174
|
+
get vertical() { return this._vertical; }
|
|
175
|
+
set vertical(value) {
|
|
176
|
+
const existing = this._vertical;
|
|
177
177
|
if (value !== existing) {
|
|
178
|
-
ElImpl.
|
|
179
|
-
this.
|
|
178
|
+
ElImpl.applyVertical(this, existing, value, this._contentVertical, this._contentVertical, this._stretchingStrengthV);
|
|
179
|
+
this._vertical = value;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
get
|
|
183
|
-
set
|
|
184
|
-
const existing = this.
|
|
182
|
+
get contentHorizontal() { return this._contentHorizontal; }
|
|
183
|
+
set contentHorizontal(value) {
|
|
184
|
+
const existing = this._contentHorizontal;
|
|
185
185
|
if (value !== existing) {
|
|
186
|
-
ElImpl.
|
|
187
|
-
this.
|
|
186
|
+
ElImpl.applyHorizontal(this, this._horizontal, this._horizontal, existing, value, this._stretchingStrengthH);
|
|
187
|
+
this._contentHorizontal = value;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
get
|
|
191
|
-
set
|
|
192
|
-
const existing = this.
|
|
190
|
+
get contentVertical() { return this._contentVertical; }
|
|
191
|
+
set contentVertical(value) {
|
|
192
|
+
const existing = this._contentVertical;
|
|
193
193
|
if (value !== existing) {
|
|
194
|
-
ElImpl.
|
|
195
|
-
this.
|
|
194
|
+
ElImpl.applyVertical(this, this._vertical, this._vertical, existing, value, this._stretchingStrengthV);
|
|
195
|
+
this._contentVertical = value;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
get
|
|
199
|
-
set
|
|
200
|
-
const existing = this.
|
|
198
|
+
get stretchingStrengthH() { return this._stretchingStrengthH; }
|
|
199
|
+
set stretchingStrengthH(value) {
|
|
200
|
+
const existing = this._stretchingStrengthH;
|
|
201
201
|
if (value !== existing) {
|
|
202
|
-
ElImpl.
|
|
203
|
-
this.
|
|
202
|
+
ElImpl.applyStretchingStrengthH(this, existing, value);
|
|
203
|
+
this._stretchingStrengthH = value;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
get
|
|
207
|
-
set
|
|
208
|
-
const existing = this.
|
|
206
|
+
get stretchingStrengthV() { return this._stretchingStrengthV; }
|
|
207
|
+
set stretchingStrengthV(value) {
|
|
208
|
+
const existing = this._stretchingStrengthV;
|
|
209
209
|
if (value !== existing) {
|
|
210
|
-
ElImpl.
|
|
211
|
-
this.
|
|
210
|
+
ElImpl.applyStretchingStrengthV(this, existing, value);
|
|
211
|
+
this._stretchingStrengthV = value;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
get contentWrapping() { return this._contentWrapping; }
|
|
@@ -310,10 +310,10 @@ export class ElImpl {
|
|
|
310
310
|
s.maxHeight = (_b = value.max) !== null && _b !== void 0 ? _b : "";
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
static
|
|
313
|
+
static applyHorizontal(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
|
|
314
314
|
var _a, _b;
|
|
315
|
-
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary =
|
|
316
|
-
newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary =
|
|
315
|
+
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = PosH.left);
|
|
316
|
+
newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = PosH.left);
|
|
317
317
|
oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
|
|
318
318
|
newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
|
|
319
319
|
const css = element.style;
|
|
@@ -326,8 +326,8 @@ export class ElImpl {
|
|
|
326
326
|
}
|
|
327
327
|
let isEffectiveAlignerX = false;
|
|
328
328
|
if (hostLayout) {
|
|
329
|
-
const isAligner = newPrimary ===
|
|
330
|
-
newPrimary ===
|
|
329
|
+
const isAligner = newPrimary === PosH.center ||
|
|
330
|
+
newPrimary === PosH.right;
|
|
331
331
|
isEffectiveAlignerX = isAligner && (hostLayout.alignerX === undefined ||
|
|
332
332
|
element.index <= hostLayout.alignerX.index);
|
|
333
333
|
if (hostLayout.alignerX === element) {
|
|
@@ -347,63 +347,63 @@ export class ElImpl {
|
|
|
347
347
|
}
|
|
348
348
|
switch (newPrimary) {
|
|
349
349
|
default:
|
|
350
|
-
case
|
|
350
|
+
case PosH.left:
|
|
351
351
|
css.justifySelf = "start";
|
|
352
|
-
if (oldPrimary ===
|
|
352
|
+
if (oldPrimary === PosH.center) {
|
|
353
353
|
css.marginLeft = "";
|
|
354
354
|
css.marginRight = "";
|
|
355
355
|
}
|
|
356
|
-
else if (oldPrimary ===
|
|
356
|
+
else if (oldPrimary === PosH.right)
|
|
357
357
|
css.marginLeft = "";
|
|
358
358
|
break;
|
|
359
|
-
case
|
|
359
|
+
case PosH.center:
|
|
360
360
|
css.justifySelf = "center";
|
|
361
361
|
if (hostLayout)
|
|
362
362
|
css.marginLeft = isEffectiveAlignerX ? "auto" : "";
|
|
363
363
|
css.marginRight = "auto";
|
|
364
364
|
break;
|
|
365
|
-
case
|
|
365
|
+
case PosH.right:
|
|
366
366
|
css.justifySelf = "end";
|
|
367
367
|
if (hostLayout)
|
|
368
368
|
css.marginLeft = isEffectiveAlignerX ? "auto" : "";
|
|
369
|
-
if (oldPrimary ===
|
|
369
|
+
if (oldPrimary === PosH.center)
|
|
370
370
|
css.marginRight = "";
|
|
371
371
|
break;
|
|
372
|
-
case
|
|
372
|
+
case PosH.stretch:
|
|
373
373
|
css.justifySelf = "stretch";
|
|
374
|
-
if (oldPrimary ===
|
|
374
|
+
if (oldPrimary === PosH.center) {
|
|
375
375
|
css.marginLeft = "";
|
|
376
376
|
css.marginRight = "";
|
|
377
377
|
}
|
|
378
|
-
else if (oldPrimary ===
|
|
378
|
+
else if (oldPrimary === PosH.right)
|
|
379
379
|
css.marginLeft = "";
|
|
380
380
|
break;
|
|
381
381
|
}
|
|
382
382
|
switch (newInside) {
|
|
383
383
|
default:
|
|
384
|
-
case
|
|
384
|
+
case PosH.left:
|
|
385
385
|
css.alignItems = "start";
|
|
386
386
|
css.textAlign = "left";
|
|
387
387
|
break;
|
|
388
|
-
case
|
|
388
|
+
case PosH.center:
|
|
389
389
|
css.alignItems = "center";
|
|
390
390
|
css.textAlign = "center";
|
|
391
391
|
break;
|
|
392
|
-
case
|
|
392
|
+
case PosH.right:
|
|
393
393
|
css.alignItems = "end";
|
|
394
394
|
css.textAlign = "right";
|
|
395
395
|
break;
|
|
396
|
-
case
|
|
396
|
+
case PosH.stretch:
|
|
397
397
|
css.alignItems = "stretch";
|
|
398
398
|
css.textAlign = "justify";
|
|
399
399
|
break;
|
|
400
400
|
}
|
|
401
|
-
if (newPrimary ===
|
|
402
|
-
ElImpl.
|
|
401
|
+
if (newPrimary === PosH.stretch && strength === undefined)
|
|
402
|
+
ElImpl.applyStretchingStrengthH(element, 0, 1);
|
|
403
403
|
}
|
|
404
|
-
static
|
|
405
|
-
oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary =
|
|
406
|
-
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);
|
|
407
407
|
oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
|
|
408
408
|
newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
|
|
409
409
|
const css = element.style;
|
|
@@ -418,10 +418,10 @@ export class ElImpl {
|
|
|
418
418
|
}
|
|
419
419
|
let isEffectiveAlignerY = false;
|
|
420
420
|
if (hostLayout) {
|
|
421
|
-
const isAligner = newPrimary ===
|
|
422
|
-
newPrimary ===
|
|
421
|
+
const isAligner = newPrimary === PosV.center ||
|
|
422
|
+
newPrimary === PosV.bottom;
|
|
423
423
|
isEffectiveAlignerY = isAligner && (hostLayout.alignerY === undefined ||
|
|
424
|
-
hostLayout.alignerY.
|
|
424
|
+
hostLayout.alignerY.vertical !== PosV.center);
|
|
425
425
|
if (hostLayout.alignerY === element) {
|
|
426
426
|
if (!isEffectiveAlignerY) {
|
|
427
427
|
hostCss.marginTop = "";
|
|
@@ -436,43 +436,43 @@ export class ElImpl {
|
|
|
436
436
|
}
|
|
437
437
|
switch (newPrimary) {
|
|
438
438
|
default:
|
|
439
|
-
case
|
|
439
|
+
case PosV.top:
|
|
440
440
|
css.alignSelf = "start";
|
|
441
441
|
break;
|
|
442
|
-
case
|
|
442
|
+
case PosV.center:
|
|
443
443
|
css.alignSelf = "center";
|
|
444
444
|
break;
|
|
445
|
-
case
|
|
445
|
+
case PosV.bottom:
|
|
446
446
|
css.alignSelf = "end";
|
|
447
447
|
break;
|
|
448
|
-
case
|
|
448
|
+
case PosV.stretch:
|
|
449
449
|
css.alignSelf = "stretch";
|
|
450
450
|
break;
|
|
451
451
|
}
|
|
452
452
|
switch (newInside) {
|
|
453
453
|
default:
|
|
454
|
-
case
|
|
454
|
+
case PosV.top:
|
|
455
455
|
css.justifyContent = "start";
|
|
456
456
|
break;
|
|
457
|
-
case
|
|
457
|
+
case PosV.center:
|
|
458
458
|
css.justifyContent = "center";
|
|
459
459
|
break;
|
|
460
|
-
case
|
|
460
|
+
case PosV.bottom:
|
|
461
461
|
css.justifyContent = "end";
|
|
462
462
|
break;
|
|
463
|
-
case
|
|
463
|
+
case PosV.stretch:
|
|
464
464
|
css.justifyContent = "stretch";
|
|
465
465
|
break;
|
|
466
466
|
}
|
|
467
|
-
if (newPrimary ===
|
|
468
|
-
ElImpl.
|
|
467
|
+
if (newPrimary === PosV.stretch && strength === undefined)
|
|
468
|
+
ElImpl.applyStretchingStrengthV(element, 0, 1);
|
|
469
469
|
}
|
|
470
|
-
static
|
|
470
|
+
static applyStretchingStrengthH(element, existing, value) {
|
|
471
471
|
const s = element.style;
|
|
472
472
|
const host = element.node.host;
|
|
473
473
|
if (host.driver.isPartition) {
|
|
474
474
|
const hostEl = host.element;
|
|
475
|
-
hostEl.
|
|
475
|
+
hostEl._stretchingStrengthH = value;
|
|
476
476
|
existing !== null && existing !== void 0 ? existing : (existing = 0);
|
|
477
477
|
value !== null && value !== void 0 ? value : (value = 0);
|
|
478
478
|
}
|
|
@@ -486,12 +486,12 @@ export class ElImpl {
|
|
|
486
486
|
s.flexBasis = "";
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
static
|
|
489
|
+
static applyStretchingStrengthV(element, existing, value) {
|
|
490
490
|
var _a;
|
|
491
491
|
const host = element.node.host;
|
|
492
492
|
if (host.driver.isPartition) {
|
|
493
493
|
const hostElement = host.element;
|
|
494
|
-
hostElement.
|
|
494
|
+
hostElement._stretchingStrengthV = value;
|
|
495
495
|
let delta = 0;
|
|
496
496
|
existing !== null && existing !== void 0 ? existing : (existing = 0);
|
|
497
497
|
value !== null && value !== void 0 ? value : (value = 0);
|
|
@@ -504,7 +504,7 @@ export class ElImpl {
|
|
|
504
504
|
delta = -1;
|
|
505
505
|
}
|
|
506
506
|
if (delta !== 0) {
|
|
507
|
-
const count = (_a = hostElement.
|
|
507
|
+
const count = (_a = hostElement._stretchingStrengthV) !== null && _a !== void 0 ? _a : 0 + delta;
|
|
508
508
|
const s = hostElement.style;
|
|
509
509
|
if (count === 1)
|
|
510
510
|
s.flexGrow = `${value}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RxNodeDecl, RxNodeDriver, RxNode, Delegate, MergedItem } from "reactronic";
|
|
2
2
|
import { CursorCommandDriver, El, ElArea } from "./El.js";
|
|
3
3
|
import { HtmlDriver } from "./HtmlDriver.js";
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function Panel<M = unknown>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
|
|
5
5
|
export declare function Table<M = unknown, R = void>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
|
|
6
6
|
export declare function row<T = void>(builder?: (element: void) => T, shiftCursorDown?: number): void;
|
|
7
7
|
export declare function Splitter<M = unknown, R = void>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
|
|
@@ -12,13 +12,13 @@ export declare function Note(content: string, formatted?: boolean, declaration?:
|
|
|
12
12
|
export declare function Group<M = unknown, R = void>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
|
|
13
13
|
export declare function Handling<M = unknown>(onChange: Delegate<El<void, M>>): RxNode<El<void, M>>;
|
|
14
14
|
export declare function SyntheticElement<M = unknown>(declaration?: RxNodeDecl<El<void, M>>, preset?: RxNodeDecl<El<void, M>>): RxNode<El<void, M>>;
|
|
15
|
-
export declare class
|
|
15
|
+
export declare class PanelDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
16
16
|
update(node: RxNode<El<T>>): void | Promise<void>;
|
|
17
17
|
child(ownerNode: RxNode<El<T, any>>, childDriver: RxNodeDriver<any>, childDeclaration?: RxNodeDecl<any> | undefined, childPreset?: RxNodeDecl<any> | undefined): MergedItem<RxNode> | undefined;
|
|
18
18
|
}
|
|
19
19
|
export declare function isSplitViewPartition(childDriver: RxNodeDriver): boolean;
|
|
20
20
|
export declare const Drivers: {
|
|
21
|
-
|
|
21
|
+
panel: PanelDriver<HTMLElement>;
|
|
22
22
|
table: HtmlDriver<HTMLElement, any>;
|
|
23
23
|
note: HtmlDriver<HTMLElement, any>;
|
|
24
24
|
group: HtmlDriver<HTMLElement, any>;
|
|
@@ -4,8 +4,8 @@ import { getPrioritiesForEmptySpaceDistribution, getPrioritiesForSizeChanging, r
|
|
|
4
4
|
import { Axis, BodyFontSize, Dimension, toPx } from "./Sizes.js";
|
|
5
5
|
import { HtmlDriver } from "./HtmlDriver.js";
|
|
6
6
|
import { clamp } from "./ElUtils.js";
|
|
7
|
-
export function
|
|
8
|
-
return RxNode.declare(Drivers.
|
|
7
|
+
export function Panel(declaration, preset) {
|
|
8
|
+
return RxNode.declare(Drivers.panel, declaration, preset);
|
|
9
9
|
}
|
|
10
10
|
export function Table(declaration, preset) {
|
|
11
11
|
return RxNode.declare(Drivers.table, declaration, preset);
|
|
@@ -108,7 +108,7 @@ export function Handling(onChange) {
|
|
|
108
108
|
export function SyntheticElement(declaration, preset) {
|
|
109
109
|
return RxNode.declare(Drivers.synthetic, declaration, preset);
|
|
110
110
|
}
|
|
111
|
-
export class
|
|
111
|
+
export class PanelDriver extends HtmlDriver {
|
|
112
112
|
update(node) {
|
|
113
113
|
rowBreak();
|
|
114
114
|
const result = super.update(node);
|
|
@@ -157,7 +157,7 @@ export class SectionDriver extends HtmlDriver {
|
|
|
157
157
|
if (el.splitView !== undefined) {
|
|
158
158
|
SyntheticElement({
|
|
159
159
|
mode: Mode.independentUpdate,
|
|
160
|
-
triggers: {
|
|
160
|
+
triggers: { stamp: el.node.stamp },
|
|
161
161
|
onChange: () => {
|
|
162
162
|
const native = el.native;
|
|
163
163
|
const isHorizontal = el.splitView === Direction.horizontal;
|
|
@@ -261,7 +261,7 @@ function overrideMethod(declaration, method, func) {
|
|
|
261
261
|
: (el, base) => { base(); func(el); };
|
|
262
262
|
}
|
|
263
263
|
export const Drivers = {
|
|
264
|
-
|
|
264
|
+
panel: new PanelDriver(Constants.element, false, el => el.kind = ElKind.panel),
|
|
265
265
|
table: new HtmlDriver(Constants.element, false, el => el.kind = ElKind.table),
|
|
266
266
|
note: new HtmlDriver(Constants.element, false, el => el.kind = ElKind.note),
|
|
267
267
|
group: new HtmlDriver(Constants.group, false, el => el.kind = ElKind.group),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ToggleRef } from "reactronic";
|
|
2
2
|
import { FocusModel } from "./sensors/FocusSensor.js";
|
|
3
3
|
import { ResizedElement } from "./sensors/ResizeSensor.js";
|
|
4
|
-
|
|
4
|
+
import { PointerSensor } from "./sensors/PointerSensor.js";
|
|
5
|
+
export declare function OnClick(target: HTMLElement, action: ((pointer: PointerSensor) => void) | ToggleRef | undefined, key?: string): void;
|
|
5
6
|
export declare function OnResize(target: HTMLElement, action: ((element: ResizedElement) => void) | undefined, key?: string): void;
|
|
6
7
|
export declare function OnFocus(target: HTMLElement, model: FocusModel, switchEditMode?: ((model: FocusModel) => void) | undefined, key?: string): void;
|
|
@@ -8,9 +8,9 @@ export function OnClick(target, action, key) {
|
|
|
8
8
|
triggers: { target },
|
|
9
9
|
onChange: el => {
|
|
10
10
|
const pointer = target.sensors.pointer;
|
|
11
|
-
if (pointer.clicked) {
|
|
11
|
+
if (target.dataForSensor.click !== undefined && pointer.clicked === target.dataForSensor.click || target.dataForSensor.click === undefined && pointer.clicked) {
|
|
12
12
|
if (action instanceof Function) {
|
|
13
|
-
unobs(() => action());
|
|
13
|
+
unobs(() => action(pointer));
|
|
14
14
|
}
|
|
15
15
|
else if (action instanceof ToggleRef) {
|
|
16
16
|
unobs(() => action.toggle());
|
|
@@ -44,7 +44,7 @@ export function OnFocus(target, model, switchEditMode = undefined, key) {
|
|
|
44
44
|
el.node.configureReactronic({ throttling: 0 });
|
|
45
45
|
},
|
|
46
46
|
onChange: el => {
|
|
47
|
-
if (switchEditMode === undefined && !target.hasAttribute("tabindex"))
|
|
47
|
+
if (switchEditMode === undefined && !(target instanceof HTMLInputElement || target.hasAttribute("tabindex")))
|
|
48
48
|
console.warn(`"${key !== null && key !== void 0 ? key : "noname"}" element must have "tabindex" attribute set in order to be focusable`);
|
|
49
49
|
if (switchEditMode !== undefined) {
|
|
50
50
|
switchEditMode(model);
|
|
@@ -2,7 +2,7 @@ import { RxNode } from "reactronic";
|
|
|
2
2
|
import { ElKind } from "./El.js";
|
|
3
3
|
import { StaticDriver, HtmlDriver, SvgDriver } from "./HtmlDriver.js";
|
|
4
4
|
export function Page(declaration, preset) {
|
|
5
|
-
const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.
|
|
5
|
+
const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.panel);
|
|
6
6
|
return RxNode.declare(driver, declaration, preset);
|
|
7
7
|
}
|
|
8
8
|
export function A(declaration, preset) { return RxNode.declare(HtmlTags.a, declaration, preset); }
|
|
@@ -181,9 +181,8 @@ export function getPrioritiesForSizeChanging(isHorizontal, children, indexes) {
|
|
|
181
181
|
const manuallyResizable = [];
|
|
182
182
|
const items = Array.from(children.items()).filter(x => isSplitViewPartition(x.instance.driver));
|
|
183
183
|
for (let i = items.length - 1; i >= 0; i--) {
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
const strength = (_a = (isHorizontal ? el.stretchingStrengthX : el.stretchingStrengthY)) !== null && _a !== void 0 ? _a : 1;
|
|
184
|
+
const el = items[i].instance.element;
|
|
185
|
+
const strength = (_a = (isHorizontal ? el.stretchingStrengthH : el.stretchingStrengthV)) !== null && _a !== void 0 ? _a : 1;
|
|
187
186
|
if (!indexes.includes(i)) {
|
|
188
187
|
if (strength > 0)
|
|
189
188
|
resizable.push(1 << i);
|
|
@@ -191,15 +190,20 @@ export function getPrioritiesForSizeChanging(isHorizontal, children, indexes) {
|
|
|
191
190
|
manuallyResizable.push(1 << i);
|
|
192
191
|
}
|
|
193
192
|
}
|
|
193
|
+
let r = 0;
|
|
194
|
+
let mr = 0;
|
|
194
195
|
for (const i of indexes) {
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
const strength = (_b = (isHorizontal ? el.stretchingStrengthX : el.stretchingStrengthY)) !== null && _b !== void 0 ? _b : 1;
|
|
196
|
+
const el = items[i].instance.element;
|
|
197
|
+
const strength = (_b = (isHorizontal ? el.stretchingStrengthH : el.stretchingStrengthV)) !== null && _b !== void 0 ? _b : 1;
|
|
198
198
|
if (strength > 0)
|
|
199
|
-
|
|
199
|
+
r |= 1 << i;
|
|
200
200
|
else
|
|
201
|
-
|
|
201
|
+
mr |= 1 << i;
|
|
202
202
|
}
|
|
203
|
+
if (r > 0)
|
|
204
|
+
resizable.push(r);
|
|
205
|
+
if (mr > 0)
|
|
206
|
+
manuallyResizable.push(mr);
|
|
203
207
|
return { resizable, manuallyResizable };
|
|
204
208
|
}
|
|
205
209
|
export function getPrioritiesForEmptySpaceDistribution(isHorizontal, children) {
|
|
@@ -210,7 +214,7 @@ export function getPrioritiesForEmptySpaceDistribution(isHorizontal, children) {
|
|
|
210
214
|
for (const child of children.items()) {
|
|
211
215
|
if (isSplitViewPartition(child.instance.driver)) {
|
|
212
216
|
const el = child.instance.element;
|
|
213
|
-
const strength = (_a = (isHorizontal ? el.
|
|
217
|
+
const strength = (_a = (isHorizontal ? el.stretchingStrengthH : el.stretchingStrengthV)) !== null && _a !== void 0 ? _a : 1;
|
|
214
218
|
if (strength > 0)
|
|
215
219
|
r |= 1 << i;
|
|
216
220
|
else
|
|
@@ -224,7 +228,7 @@ function getFractionCount(isHorizontal, children, vector, index, force = false)
|
|
|
224
228
|
var _a;
|
|
225
229
|
let result = 0;
|
|
226
230
|
for (const i of indexes(vector, index)) {
|
|
227
|
-
const growth = (_a = (isHorizontal ? children[i].element.
|
|
231
|
+
const growth = (_a = (isHorizontal ? children[i].element.stretchingStrengthH : children[i].element.stretchingStrengthV)) !== null && _a !== void 0 ? _a : 1;
|
|
228
232
|
result += growth > 0 ? growth : (force ? 1 : 0);
|
|
229
233
|
}
|
|
230
234
|
return result;
|
|
@@ -269,7 +273,7 @@ function distribute(sign, deltaPx, index, priorities, sizesPx, isHorizontal, for
|
|
|
269
273
|
for (const i of indexes(vector, sign * index)) {
|
|
270
274
|
const child = sizesPx[i].node;
|
|
271
275
|
const initialSizePx = sizesPx[i].sizePx;
|
|
272
|
-
const strength = isHorizontal ? ((_a = child.element.
|
|
276
|
+
const strength = isHorizontal ? ((_a = child.element.stretchingStrengthH) !== null && _a !== void 0 ? _a : 1) : ((_b = child.element.stretchingStrengthV) !== null && _b !== void 0 ? _b : 1);
|
|
273
277
|
const growth = strength > 0 ? strength : (force ? 1 : 0);
|
|
274
278
|
const newSizePx = initialSizePx + sign * (growth * fractionSizePx);
|
|
275
279
|
const size = isHorizontal ? sizesPx[i].node.element.widthPx : sizesPx[i].node.element.heightPx;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verstak",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.273",
|
|
4
4
|
"description": "Verstak - Front-End Library",
|
|
5
5
|
"publisher": "Nezaboodka Software",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/nezaboodka/verstak/blob/master/README.md#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"reactronic": "^0.24.
|
|
34
|
+
"reactronic": "^0.24.271"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "20.11.17",
|