verstak 0.24.132 → 0.24.134

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,12 @@ 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
+ widthOnlyMin: string;
13
+ widthOnlyGrowth: number;
14
+ height: Range;
15
+ heightOnlyMin: string;
16
+ heightOnlyGrowth: number;
17
17
  contentAlignment: Align;
18
18
  elementAlignment: Align;
19
19
  contentWrapping: boolean;
@@ -47,14 +47,13 @@ export declare enum Align {
47
47
  bottom = 12,
48
48
  center = 10
49
49
  }
50
- export type ElasticSize = {
51
- cells?: number;
52
- min?: string;
53
- max?: string;
54
- growth?: number;
50
+ export type Range = {
51
+ readonly min?: string;
52
+ readonly max?: string;
53
+ readonly growth?: number;
55
54
  };
56
- export type TrackSize = ElasticSize & {
57
- track?: string | number;
55
+ export type MarkedRange = Range & {
56
+ readonly marker?: string;
58
57
  };
59
58
  export type ElArea = undefined | string | {
60
59
  cellsOverWidth?: number;
@@ -70,12 +69,8 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
70
69
  private _kind;
71
70
  private _area;
72
71
  private _coords;
73
- private _widthGrowth;
74
- private _minWidth;
75
- private _maxWidth;
76
- private _heightGrowth;
77
- private _minHeight;
78
- private _maxHeight;
72
+ private _width;
73
+ private _height;
79
74
  private _contentAlignment;
80
75
  private _elementAlignment;
81
76
  private _contentWrapping;
@@ -90,18 +85,18 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
90
85
  set kind(value: ElKind);
91
86
  get area(): ElArea;
92
87
  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);
88
+ get width(): Range;
89
+ set width(value: Range);
90
+ get widthOnlyMin(): string;
91
+ set widthOnlyMin(value: string);
92
+ get widthOnlyGrowth(): number;
93
+ set widthOnlyGrowth(value: number);
94
+ get height(): Range;
95
+ set height(value: Range);
96
+ get heightOnlyMin(): string;
97
+ set heightOnlyMin(value: string);
98
+ get heightOnlyGrowth(): number;
99
+ set heightOnlyGrowth(value: number);
105
100
  get contentAlignment(): Align;
106
101
  set contentAlignment(value: Align);
107
102
  get elementAlignment(): Align;
@@ -141,7 +136,7 @@ export declare class Apply {
141
136
  static coords<T extends Element>(element: El<T, any>, value: ElCoords | undefined): void;
142
137
  static widthGrowth<T extends Element>(element: El<T, any>, value: number): void;
143
138
  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;
139
+ static maxWidth<T extends Element>(element: El<T, any>, value: string): void;
145
140
  static heightGrowth<T extends Element>(element: El<T, any>, value: number): void;
146
141
  static minHeight<T extends Element>(element: El<T, any>, value: string): void;
147
142
  static maxHeight<T extends Element>(element: El<T, any>, value: string): void;
@@ -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,54 @@ 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 widthOnlyMin() { var _a; return (_a = this._width.min) !== null && _a !== void 0 ? _a : ""; }
108
+ set widthOnlyMin(value) { this.width = { min: value }; }
109
+ get widthOnlyGrowth() { var _a; return (_a = this._width.growth) !== null && _a !== void 0 ? _a : 0; }
110
+ set widthOnlyGrowth(value) { this.width = { growth: value }; }
111
+ get height() { return this._height; }
112
+ set height(value) {
113
+ var _a, _b, _c;
114
+ const w = this._height;
115
+ let updated = false;
116
+ if (value.min !== w.min) {
117
+ Apply.minHeight(this, (_a = value.min) !== null && _a !== void 0 ? _a : "");
118
+ updated = true;
117
119
  }
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;
120
+ if (value.max !== w.max) {
121
+ Apply.maxHeight(this, (_b = value.max) !== null && _b !== void 0 ? _b : "");
122
+ updated = true;
124
123
  }
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;
124
+ if (value.growth !== w.growth) {
125
+ Apply.heightGrowth(this, (_c = value.growth) !== null && _c !== void 0 ? _c : 0);
126
+ updated = true;
131
127
  }
128
+ if (updated)
129
+ this._height = value;
132
130
  }
131
+ get heightOnlyMin() { var _a; return (_a = this._height.min) !== null && _a !== void 0 ? _a : ""; }
132
+ set heightOnlyMin(value) { this.height = { min: value }; }
133
+ get heightOnlyGrowth() { var _a; return (_a = this._height.growth) !== null && _a !== void 0 ? _a : 0; }
134
+ set heightOnlyGrowth(value) { this.height = { growth: value }; }
133
135
  get contentAlignment() { return this._contentAlignment; }
134
136
  set contentAlignment(value) {
135
137
  if (value !== this._contentAlignment) {
@@ -336,7 +338,7 @@ export class Apply {
336
338
  if (element.native instanceof HTMLElement)
337
339
  element.native.style.minWidth = `${value}`;
338
340
  }
339
- static applyMaxWidth(element, value) {
341
+ static maxWidth(element, value) {
340
342
  if (element.native instanceof HTMLElement)
341
343
  element.native.style.maxWidth = `${value}`;
342
344
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.24.132",
3
+ "version": "0.24.134",
4
4
  "description": "Verstak - Front-End Library",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",