verstak 0.96.26022 → 0.96.26024

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.
@@ -1,10 +1,10 @@
1
- import { ReactiveTreeNode, derivative } from "reactronic";
1
+ import { ReactiveTreeNode, setBasis } from "reactronic";
2
2
  import { Block, OnClick } from "verstak";
3
3
  import { rxModel } from "./common/Utils.js";
4
4
  import { Theme } from "./Theme.js";
5
5
  import { Icon } from "./Icon.v.js";
6
6
  export function Button(declaration) {
7
- return (Block(derivative(declaration, {
7
+ return (Block(setBasis(declaration, {
8
8
  preparation() {
9
9
  var _a;
10
10
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({
@@ -1,8 +1,8 @@
1
- import { derivative } from "reactronic";
1
+ import { setBasis } from "reactronic";
2
2
  import { Block } from "verstak";
3
3
  import { Theme } from "./Theme.js";
4
4
  export function Icon(name, declaration) {
5
- return (Block(derivative(declaration, {
5
+ return (Block(setBasis(declaration, {
6
6
  signalArgs: { name },
7
7
  body() {
8
8
  const theme = Theme.current.icon;
@@ -1,8 +1,8 @@
1
- import { derivative } from "reactronic";
1
+ import { setBasis } from "reactronic";
2
2
  import { Block } from "verstak";
3
3
  import { rxModel } from "./common/Utils.js";
4
4
  export function Image(declaration) {
5
- return (Block(derivative(declaration, {
5
+ return (Block(setBasis(declaration, {
6
6
  preparation() {
7
7
  var _a;
8
8
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({ source: undefined }));
@@ -1,10 +1,10 @@
1
- import { Mode, derivative } from "reactronic";
2
- import { Block, OnFocus, rowBreak, Fragment, KeyboardModifiers, Horizontal, Vertical } from "verstak";
1
+ import { Mode, setBasis } from "reactronic";
2
+ import { Block, OnFocus, rowBreak, Fragment, KeyboardModifiers, H, V } from "verstak";
3
3
  import { rxModel } from "./common/Utils.js";
4
4
  import { Theme } from "./Theme.js";
5
5
  import { Icon } from "./Icon.v.js";
6
6
  export function Input(declaration) {
7
- return (Block(derivative(declaration, {
7
+ return (Block(setBasis(declaration, {
8
8
  preparation() {
9
9
  var _a;
10
10
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = composeInputModel());
@@ -48,8 +48,8 @@ function InputField(model, styling) {
48
48
  preparation(el, base) {
49
49
  const e = this.native;
50
50
  this.useStylingPreset(styling.field);
51
- this.horizontally = Horizontal.stretch;
52
- this.vertically = Vertical.stretch;
51
+ this.selfAlignmentHorizontal = H.stretch;
52
+ this.selfAlignmentVertical = V.stretch;
53
53
  this.textIsEditable = true;
54
54
  e.tabIndex = 0;
55
55
  e.dataForSensor.focus = model;
@@ -1,14 +1,10 @@
1
1
  import { RxObject } from "reactronic";
2
- export declare class RealTimeClock extends RxObject {
2
+ export declare class LiveTime extends RxObject {
3
3
  hour: number;
4
4
  minute: number;
5
5
  second: number;
6
6
  ms: number;
7
7
  interval: number;
8
- paused: boolean;
9
8
  constructor(interval?: number);
10
- pause(value?: boolean): void;
11
9
  private tick;
12
- protected activate(): void;
13
- private put;
14
10
  }
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { RxObject, transaction, reaction } from "reactronic";
11
- export class RealTimeClock extends RxObject {
10
+ import { RxObject, transaction } from "reactronic";
11
+ export class LiveTime extends RxObject {
12
12
  constructor(interval = 1000) {
13
13
  super();
14
14
  this.hour = 0;
@@ -16,49 +16,27 @@ export class RealTimeClock extends RxObject {
16
16
  this.second = 0;
17
17
  this.ms = 0;
18
18
  this.interval = 0;
19
- this.paused = false;
20
19
  this.interval = interval;
21
- this.put(new Date());
22
- }
23
- pause(value = true) {
24
- this.paused = value;
20
+ this.tick();
25
21
  }
26
22
  tick() {
27
23
  let calibration = 0;
28
24
  try {
29
25
  const now = new Date();
30
- this.put(now);
26
+ this.hour = now.getHours();
27
+ this.minute = now.getMinutes();
28
+ this.second = now.getSeconds();
29
+ this.ms = now.getMilliseconds();
31
30
  calibration = now.getTime() % this.interval;
32
31
  }
33
32
  finally {
34
33
  setTimeout(() => this.tick(), this.interval - calibration);
35
34
  }
36
35
  }
37
- activate() {
38
- this.tick();
39
- }
40
- put(time) {
41
- this.hour = time.getHours();
42
- this.minute = time.getMinutes();
43
- this.second = time.getSeconds();
44
- this.ms = time.getMilliseconds();
45
- }
46
36
  }
47
37
  __decorate([
48
38
  transaction,
49
39
  __metadata("design:type", Function),
50
- __metadata("design:paramtypes", [Boolean]),
51
- __metadata("design:returntype", void 0)
52
- ], RealTimeClock.prototype, "pause", null);
53
- __decorate([
54
- transaction,
55
- __metadata("design:type", Function),
56
- __metadata("design:paramtypes", []),
57
- __metadata("design:returntype", void 0)
58
- ], RealTimeClock.prototype, "tick", null);
59
- __decorate([
60
- reaction,
61
- __metadata("design:type", Function),
62
40
  __metadata("design:paramtypes", []),
63
41
  __metadata("design:returntype", void 0)
64
- ], RealTimeClock.prototype, "activate", null);
42
+ ], LiveTime.prototype, "tick", null);
@@ -1,8 +1,8 @@
1
- import { Mode, derivative } from "reactronic";
1
+ import { Mode, setBasis } from "reactronic";
2
2
  import { Block } from "verstak";
3
3
  import { rxModel } from "./common/Utils.js";
4
4
  export function Spinner(declaration) {
5
- return (Block(derivative(declaration, {
5
+ return (Block(setBasis(declaration, {
6
6
  preparation() {
7
7
  var _a;
8
8
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = composeSpinnerModel());
@@ -1,10 +1,10 @@
1
- import { ReactiveTreeNode, Mode, derivative } from "reactronic";
1
+ import { ReactiveTreeNode, Mode, setBasis } from "reactronic";
2
2
  import { Block, OnClick } from "verstak";
3
3
  import { rxModel } from "./common/Utils.js";
4
4
  import { Theme } from "./Theme.js";
5
5
  import { Icon } from "./Icon.v.js";
6
6
  export function Toggle(declaration) {
7
- return (Block(derivative(declaration, {
7
+ return (Block(setBasis(declaration, {
8
8
  preparation() {
9
9
  var _a;
10
10
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({
@@ -7,4 +7,4 @@ export * from "./Toggle.v.js";
7
7
  export * from "./Markdown.v.js";
8
8
  export * from "./Theme.js";
9
9
  export { rxModel } from "./common/Utils.js";
10
- export { RealTimeClock } from "./RealTimeClock.js";
10
+ export { LiveTime } from "./LiveTime.js";
@@ -7,4 +7,4 @@ export * from "./Toggle.v.js";
7
7
  export * from "./Markdown.v.js";
8
8
  export * from "./Theme.js";
9
9
  export { rxModel } from "./common/Utils.js";
10
- export { RealTimeClock } from "./RealTimeClock.js";
10
+ export { LiveTime } from "./LiveTime.js";
@@ -8,12 +8,14 @@ export type El<T = any, M = any> = {
8
8
  place: ElPlace;
9
9
  width: Range;
10
10
  height: Range;
11
- horizontally: Horizontal | undefined;
12
- contentHorizontally: Horizontal | undefined;
13
- vertically: Vertical | undefined;
14
- contentVertically: Vertical | undefined;
15
- stretchingStrengthHorizontally: number | undefined;
16
- stretchingStrengthVertically: number | undefined;
11
+ alignmentHorizontal: H | undefined;
12
+ alignmentVertical: V | undefined;
13
+ alignmentVerticalRowWise: V | undefined;
14
+ selfAlignmentHorizontal: H | undefined;
15
+ selfAlignmentVertical: V | undefined;
16
+ selfAlignmentVerticalRowWise: V | undefined;
17
+ selfStretchingStrengthHorizontal: number | undefined;
18
+ selfStretchingStrengthVertical: number | undefined;
17
19
  contentWrapping: boolean;
18
20
  overlayVisible: boolean | undefined;
19
21
  text: string | undefined;
@@ -48,16 +50,16 @@ export type ElCoords = {
48
50
  x2: number;
49
51
  y2: number;
50
52
  };
51
- export declare enum Horizontal {
52
- left = 0,
53
- center = 1,
53
+ export declare enum H {
54
+ center = 0,
55
+ left = 1,
54
56
  right = 2,
55
57
  stretch = 3,
56
58
  stretchAndFix = 4
57
59
  }
58
- export declare enum Vertical {
59
- top = 0,
60
- center = 1,
60
+ export declare enum V {
61
+ center = 0,
62
+ top = 1,
61
63
  bottom = 2,
62
64
  stretch = 3,
63
65
  stretchAndFix = 4
@@ -8,22 +8,22 @@ export var ElKind;
8
8
  ElKind[ElKind["cursor"] = 5] = "cursor";
9
9
  ElKind[ElKind["native"] = 6] = "native";
10
10
  })(ElKind || (ElKind = {}));
11
- export var Horizontal;
12
- (function (Horizontal) {
13
- Horizontal[Horizontal["left"] = 0] = "left";
14
- Horizontal[Horizontal["center"] = 1] = "center";
15
- Horizontal[Horizontal["right"] = 2] = "right";
16
- Horizontal[Horizontal["stretch"] = 3] = "stretch";
17
- Horizontal[Horizontal["stretchAndFix"] = 4] = "stretchAndFix";
18
- })(Horizontal || (Horizontal = {}));
19
- export var Vertical;
20
- (function (Vertical) {
21
- Vertical[Vertical["top"] = 0] = "top";
22
- Vertical[Vertical["center"] = 1] = "center";
23
- Vertical[Vertical["bottom"] = 2] = "bottom";
24
- Vertical[Vertical["stretch"] = 3] = "stretch";
25
- Vertical[Vertical["stretchAndFix"] = 4] = "stretchAndFix";
26
- })(Vertical || (Vertical = {}));
11
+ export var H;
12
+ (function (H) {
13
+ H[H["center"] = 0] = "center";
14
+ H[H["left"] = 1] = "left";
15
+ H[H["right"] = 2] = "right";
16
+ H[H["stretch"] = 3] = "stretch";
17
+ H[H["stretchAndFix"] = 4] = "stretchAndFix";
18
+ })(H || (H = {}));
19
+ export var V;
20
+ (function (V) {
21
+ V[V["center"] = 0] = "center";
22
+ V[V["top"] = 1] = "top";
23
+ V[V["bottom"] = 2] = "bottom";
24
+ V[V["stretch"] = 3] = "stretch";
25
+ V[V["stretchAndFix"] = 4] = "stretchAndFix";
26
+ })(V || (V = {}));
27
27
  export var Direction;
28
28
  (function (Direction) {
29
29
  Direction[Direction["horizontal"] = 0] = "horizontal";
@@ -1,5 +1,5 @@
1
1
  import { ReactiveTreeNode, BaseDriver } from "reactronic";
2
- import { El, ElKind, Horizontal, Vertical, Range, ElPlace, Direction } from "./El.js";
2
+ import { El, ElKind, H, V, Range, ElPlace, Direction } from "./El.js";
3
3
  export declare class ElDriver<T extends Element, M = unknown> extends BaseDriver<El<T, M>> {
4
4
  create(node: ReactiveTreeNode<El<T, M>>): El<T, M>;
5
5
  }
@@ -15,12 +15,14 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
15
15
  private _coords;
16
16
  private _width;
17
17
  private _height;
18
- private _horizontal;
19
- private _vertical;
20
- private _contentHorizontal;
21
- private _contentVertical;
22
- private _stretchingStrengthHorizontally;
23
- private _stretchingStrengthVertically;
18
+ private _alignmentHorizontal;
19
+ private _alignmentVertical;
20
+ private _alignmentVerticalRowWise;
21
+ private _selfAlignmentHorizontal;
22
+ private _selfAlignmentVertical;
23
+ private _selfAlignmentVerticalRowWise;
24
+ private _selfStretchingStrengthHorizontal;
25
+ private _selfStretchingStrengthVertical;
24
26
  private _contentWrapping;
25
27
  private _overlayVisible;
26
28
  private _text;
@@ -59,18 +61,22 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
59
61
  minPx: number;
60
62
  maxPx: number;
61
63
  });
62
- get horizontally(): Horizontal | undefined;
63
- set horizontally(value: Horizontal | undefined);
64
- get vertically(): Vertical | undefined;
65
- set vertically(value: Vertical | undefined);
66
- get contentHorizontally(): Horizontal | undefined;
67
- set contentHorizontally(value: Horizontal | undefined);
68
- get contentVertically(): Vertical | undefined;
69
- set contentVertically(value: Vertical | undefined);
70
- get stretchingStrengthHorizontally(): number | undefined;
71
- set stretchingStrengthHorizontally(value: number | undefined);
72
- get stretchingStrengthVertically(): number | undefined;
73
- set stretchingStrengthVertically(value: number | undefined);
64
+ get alignmentHorizontal(): H | undefined;
65
+ set alignmentHorizontal(value: H | undefined);
66
+ get alignmentVertical(): V | undefined;
67
+ set alignmentVertical(value: V | undefined);
68
+ get alignmentVerticalRowWise(): V | undefined;
69
+ set alignmentVerticalRowWise(value: V | undefined);
70
+ get selfAlignmentHorizontal(): H | undefined;
71
+ set selfAlignmentHorizontal(value: H | undefined);
72
+ get selfAlignmentVertical(): V | undefined;
73
+ set selfAlignmentVertical(value: V | undefined);
74
+ get selfAlignmentVerticalRowWise(): V | undefined;
75
+ set selfAlignmentVerticalRowWise(value: V | undefined);
76
+ get selfStretchingStrengthHorizontal(): number | undefined;
77
+ set selfStretchingStrengthHorizontal(value: number | undefined);
78
+ get selfStretchingStrengthVertical(): number | undefined;
79
+ set selfStretchingStrengthVertical(value: number | undefined);
74
80
  get contentWrapping(): boolean;
75
81
  set contentWrapping(value: boolean);
76
82
  get overlayVisible(): boolean | undefined;
@@ -95,10 +101,14 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
95
101
  private static applyCoords;
96
102
  private static applyWidth;
97
103
  private static applyHeight;
98
- private static applyHorizontal;
99
- private static applyVertical;
100
- private static applyStretchingStrengthH;
101
- private static applyStretchingStrengthV;
104
+ private static applyAlignmentHorizontal;
105
+ private static applyAlignmentVertical;
106
+ private static applyAlignmentVerticalRowWise;
107
+ private static applySelfAlignmentHorizontal;
108
+ private static applyPartitionAlignmentVertical;
109
+ private static applySelfAlignmentVertical;
110
+ private static applySelfStretchingStrengthHorizontal;
111
+ private static applySelfStretchingStrengthVertical;
102
112
  private static applyContentWrapping;
103
113
  private static applyOverlayVisible;
104
114
  static applySealed<T extends Element>(element: El<T, any>, value: Direction | undefined): void;
@@ -151,4 +161,10 @@ export declare const Constants: {
151
161
  kindAttrName: string;
152
162
  ownReactiveTreeNodeKey: symbol;
153
163
  };
164
+ export declare const StylingClassNameByAlignmentHorizontal: Array<string>;
165
+ export declare const StylingClassNameByAlignmentVertical: Array<string>;
166
+ export declare const StylingClassNameByAlignmentVerticalRowWise: Array<string>;
167
+ export declare const StylingClassNameBySelfAlignmentHorizontal: Array<string>;
168
+ export declare const StylingClassNameBySelfAlignmentVertical: Array<string>;
169
+ export declare const StylingClassNameByPartitionAlignmentVertical: Array<string>;
154
170
  export {};