verstak 0.24.131 → 0.24.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,12 +8,10 @@ export type El<T = any, M = any> = {
8
8
  model: M;
9
9
  kind: ElKind;
10
10
  area: ElArea;
11
- widthGrowth: number;
12
- minWidth: string;
13
- maxWidth: string;
14
- heightGrowth: number;
15
- minHeight: string;
16
- maxHeight: string;
11
+ width: Range;
12
+ widthFixed: string;
13
+ height: Range;
14
+ heightFixed: string;
17
15
  contentAlignment: Align;
18
16
  elementAlignment: Align;
19
17
  contentWrapping: boolean;
@@ -38,23 +36,22 @@ export type ElCoords = {
38
36
  };
39
37
  export declare enum Align {
40
38
  default = 16,
41
- toBounds = 0,
42
- toLeft = 1,
43
- toCenterX = 2,
44
- toRight = 3,
45
- toTop = 4,
46
- toCenterY = 8,
47
- toBottom = 12,
48
- toCenter = 10
39
+ fit = 0,
40
+ left = 1,
41
+ centerX = 2,
42
+ right = 3,
43
+ top = 4,
44
+ centerY = 8,
45
+ bottom = 12,
46
+ center = 10
49
47
  }
50
- export type ElasticSize = {
51
- cells?: number;
52
- min?: string;
53
- max?: string;
54
- growth?: number;
48
+ export type Range = {
49
+ readonly min?: string;
50
+ readonly max?: string;
51
+ readonly growth?: number;
55
52
  };
56
- export type TrackSize = ElasticSize & {
57
- track?: string | number;
53
+ export type MarkedRange = Range & {
54
+ readonly marker?: string;
58
55
  };
59
56
  export type ElArea = undefined | string | {
60
57
  cellsOverWidth?: number;
@@ -70,12 +67,8 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
70
67
  private _kind;
71
68
  private _area;
72
69
  private _coords;
73
- private _widthGrowth;
74
- private _minWidth;
75
- private _maxWidth;
76
- private _heightGrowth;
77
- private _minHeight;
78
- private _maxHeight;
70
+ private _width;
71
+ private _height;
79
72
  private _contentAlignment;
80
73
  private _elementAlignment;
81
74
  private _contentWrapping;
@@ -90,18 +83,14 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
90
83
  set kind(value: ElKind);
91
84
  get area(): ElArea;
92
85
  set area(value: ElArea);
93
- get widthGrowth(): number;
94
- set widthGrowth(value: number);
95
- get minWidth(): string;
96
- set minWidth(value: string);
97
- get maxWidth(): string;
98
- set maxWidth(value: string);
99
- get heightGrowth(): number;
100
- set heightGrowth(value: number);
101
- get minHeight(): string;
102
- set minHeight(value: string);
103
- get maxHeight(): string;
104
- set maxHeight(value: string);
86
+ get width(): Range;
87
+ set width(value: Range);
88
+ get widthFixed(): string;
89
+ set widthFixed(value: string);
90
+ get height(): Range;
91
+ set height(value: Range);
92
+ get heightFixed(): string;
93
+ set heightFixed(value: string);
105
94
  get contentAlignment(): Align;
106
95
  set contentAlignment(value: Align);
107
96
  get elementAlignment(): Align;
@@ -141,7 +130,7 @@ export declare class Apply {
141
130
  static coords<T extends Element>(element: El<T, any>, value: ElCoords | undefined): void;
142
131
  static widthGrowth<T extends Element>(element: El<T, any>, value: number): void;
143
132
  static minWidth<T extends Element>(element: El<T, any>, value: string): void;
144
- static applyMaxWidth<T extends Element>(element: El<T, any>, value: string): void;
133
+ static maxWidth<T extends Element>(element: El<T, any>, value: string): void;
145
134
  static heightGrowth<T extends Element>(element: El<T, any>, value: number): void;
146
135
  static minHeight<T extends Element>(element: El<T, any>, value: string): void;
147
136
  static maxHeight<T extends Element>(element: El<T, any>, value: string): void;
@@ -18,14 +18,14 @@ export var ElKind;
18
18
  export var Align;
19
19
  (function (Align) {
20
20
  Align[Align["default"] = 16] = "default";
21
- Align[Align["toBounds"] = 0] = "toBounds";
22
- Align[Align["toLeft"] = 1] = "toLeft";
23
- Align[Align["toCenterX"] = 2] = "toCenterX";
24
- Align[Align["toRight"] = 3] = "toRight";
25
- Align[Align["toTop"] = 4] = "toTop";
26
- Align[Align["toCenterY"] = 8] = "toCenterY";
27
- Align[Align["toBottom"] = 12] = "toBottom";
28
- Align[Align["toCenter"] = 10] = "toCenter";
21
+ Align[Align["fit"] = 0] = "fit";
22
+ Align[Align["left"] = 1] = "left";
23
+ Align[Align["centerX"] = 2] = "centerX";
24
+ Align[Align["right"] = 3] = "right";
25
+ Align[Align["top"] = 4] = "top";
26
+ Align[Align["centerY"] = 8] = "centerY";
27
+ Align[Align["bottom"] = 12] = "bottom";
28
+ Align[Align["center"] = 10] = "center";
29
29
  })(Align || (Align = {}));
30
30
  export class ElImpl {
31
31
  constructor(node) {
@@ -38,12 +38,8 @@ export class ElImpl {
38
38
  this._kind = ElKind.part;
39
39
  this._area = undefined;
40
40
  this._coords = UndefinedElCoords;
41
- this._widthGrowth = 0;
42
- this._minWidth = "";
43
- this._maxWidth = "";
44
- this._heightGrowth = 0;
45
- this._minHeight = "";
46
- this._maxHeight = "";
41
+ this._width = { min: "", max: "", growth: 0 };
42
+ this._height = { min: "", max: "", growth: 0 };
47
43
  this._contentAlignment = Align.default;
48
44
  this._elementAlignment = Align.default;
49
45
  this._contentWrapping = true;
@@ -88,48 +84,50 @@ export class ElImpl {
88
84
  else
89
85
  this.rowBreak();
90
86
  }
91
- get widthGrowth() { return this._widthGrowth; }
92
- set widthGrowth(value) {
93
- if (value !== this._widthGrowth) {
94
- Apply.widthGrowth(this, value);
95
- this._widthGrowth = value;
87
+ get width() { return this._width; }
88
+ set width(value) {
89
+ var _a, _b, _c;
90
+ const w = this._width;
91
+ let updated = false;
92
+ if (value.min !== w.min) {
93
+ Apply.minWidth(this, (_a = value.min) !== null && _a !== void 0 ? _a : "");
94
+ updated = true;
96
95
  }
97
- }
98
- get minWidth() { return this._minWidth; }
99
- set minWidth(value) {
100
- if (value !== this._minWidth) {
101
- Apply.minWidth(this, value);
102
- this._minWidth = value;
96
+ if (value.max !== w.max) {
97
+ Apply.maxWidth(this, (_b = value.max) !== null && _b !== void 0 ? _b : "");
98
+ updated = true;
103
99
  }
104
- }
105
- get maxWidth() { return this._maxWidth; }
106
- set maxWidth(value) {
107
- if (value !== this._maxWidth) {
108
- Apply.applyMaxWidth(this, value);
109
- this._maxWidth = value;
100
+ if (value.growth !== w.growth) {
101
+ Apply.widthGrowth(this, (_c = value.growth) !== null && _c !== void 0 ? _c : 0);
102
+ updated = true;
110
103
  }
111
- }
112
- get heightGrowth() { return this._heightGrowth; }
113
- set heightGrowth(value) {
114
- if (value !== this._heightGrowth) {
115
- Apply.heightGrowth(this, value);
116
- this._heightGrowth = value;
104
+ if (updated)
105
+ this._width = value;
106
+ }
107
+ get widthFixed() { var _a; return (_a = this._width.min) !== null && _a !== void 0 ? _a : ""; }
108
+ set widthFixed(value) { this.width = { min: value }; }
109
+ get height() { return this._height; }
110
+ set height(value) {
111
+ var _a, _b, _c;
112
+ const w = this._height;
113
+ let updated = false;
114
+ if (value.min !== w.min) {
115
+ Apply.minHeight(this, (_a = value.min) !== null && _a !== void 0 ? _a : "");
116
+ updated = true;
117
117
  }
118
- }
119
- get minHeight() { return this._minHeight; }
120
- set minHeight(value) {
121
- if (value !== this._minHeight) {
122
- Apply.minHeight(this, value);
123
- this._minHeight = value;
118
+ if (value.max !== w.max) {
119
+ Apply.maxHeight(this, (_b = value.max) !== null && _b !== void 0 ? _b : "");
120
+ updated = true;
124
121
  }
125
- }
126
- get maxHeight() { return this._maxHeight; }
127
- set maxHeight(value) {
128
- if (value !== this._maxHeight) {
129
- Apply.maxHeight(this, value);
130
- this._maxHeight = value;
122
+ if (value.growth !== w.growth) {
123
+ Apply.heightGrowth(this, (_c = value.growth) !== null && _c !== void 0 ? _c : 0);
124
+ updated = true;
131
125
  }
126
+ if (updated)
127
+ this._height = value;
132
128
  }
129
+ get heightFixed() { var _a; return (_a = this._height.min) !== null && _a !== void 0 ? _a : ""; }
130
+ set heightFixed(value) { this.height = { min: value }; }
133
131
  get contentAlignment() { return this._contentAlignment; }
134
132
  set contentAlignment(value) {
135
133
  if (value !== this._contentAlignment) {
@@ -336,7 +334,7 @@ export class Apply {
336
334
  if (element.native instanceof HTMLElement)
337
335
  element.native.style.minWidth = `${value}`;
338
336
  }
339
- static applyMaxWidth(element, value) {
337
+ static maxWidth(element, value) {
340
338
  if (element.native instanceof HTMLElement)
341
339
  element.native.style.maxWidth = `${value}`;
342
340
  }
@@ -356,7 +354,7 @@ export class Apply {
356
354
  const hostDriver = bNode.host.driver;
357
355
  if (hostDriver.isPartitionSeparator) {
358
356
  const host = bNode.host.seat.instance;
359
- Apply.elementAlignment(element, Align.toBounds);
357
+ Apply.elementAlignment(element, Align.fit);
360
358
  Apply.heightGrowth(host.element, value);
361
359
  }
362
360
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.24.131",
3
+ "version": "0.24.133",
4
4
  "description": "Verstak - Front-End Library",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",