tauri-kargo-tools 0.1.6 → 0.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-kargo-tools",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "",
5
5
  "files": ["src"],
6
6
  "exports": { "./*": "./src/*" },
@@ -0,0 +1,13 @@
1
+ import { Space } from "../model/space";
2
+ import { applySize, Builder, Ctx } from "../vue-builder";
3
+
4
+ /* ----------- Flow ----------- */
5
+ export function buildSpace<T extends object>(builder:Builder,node: Space, ctx: Ctx<T>) {
6
+ const div = document.createElement('div');
7
+
8
+ div.style.visibility ="hidden"
9
+ applySize(div, node.width, node.height);
10
+ ctx.add(div);
11
+
12
+ }
13
+
@@ -0,0 +1,5 @@
1
+ export interface Space {
2
+ kind:"space"
3
+ width?:number | string;
4
+ height?:number | string;
5
+ }
@@ -448,7 +448,7 @@ export class Panel {
448
448
  bp.idx = 2
449
449
  this.buttons.push(bp)
450
450
  bp = new ButtonPanel()
451
- bp.elementPanel = new BaseAvecLog()
451
+ bp.elementPanel = new BaseAvecMenu()
452
452
  bp.name = "Compute"
453
453
  bp.idx = 3
454
454
  this.buttons.push(bp)
@@ -4,7 +4,7 @@ import { ElementPanel } from "./test-model-panel"
4
4
 
5
5
 
6
6
 
7
- export class Base extends ElementPanel {
7
+ export class Base extends ElementPanel {
8
8
  op!: string
9
9
  a!: number
10
10
  b!: number
@@ -105,6 +105,10 @@ defineVue(MenuOp, {
105
105
  action: "mul",
106
106
  width: "100%"
107
107
  },
108
+ {
109
+ kind: 'space',
110
+ height: 10
111
+ },
108
112
  {
109
113
  kind: 'staticButton',
110
114
  label: '/',
@@ -15,6 +15,7 @@ import { buildLabel, buildStaticLabel } from "./builder/label";
15
15
  import { buildListOfVue } from "./builder/list-of-vue";
16
16
  import { buildMenu } from "./builder/menu";
17
17
  import { buildSelect } from "./builder/select";
18
+ import { buildSpace } from "./builder/space";
18
19
  import { buildSingleVue } from "./builder/vue";
19
20
  import { Listener, Unlisten } from "./listener";
20
21
  import { getListener } from "./listener-factory";
@@ -29,6 +30,7 @@ import { LabelNode, StaticLabelNode } from "./model/label";
29
30
  import { ListVueNode } from "./model/list-of-vue";
30
31
  import { MenuNode } from "./model/menu";
31
32
  import { SelectNode } from "./model/select";
33
+ import { Space } from "./model/space";
32
34
  import { SingleVueNode } from "./model/vue";
33
35
  import {
34
36
  Vue, UINode
@@ -204,6 +206,7 @@ export class Builder {
204
206
  case 'custom': buildCustom(this, node as CustomNode<T, any, any>, ctx); break;
205
207
  case "bootVue": buildBootVue(this, node as BootVueNode<T, any>, ctx); break;
206
208
  case 'staticBootVue': buildStaticBootVue(this, node as StaticBootVueNode<T>, ctx); break;
209
+ case "space":buildSpace(this,node as Space,ctx);
207
210
  }
208
211
  }
209
212
  }
package/src/vue-model.ts CHANGED
@@ -14,6 +14,7 @@ import { LabelNode, StaticLabelNode } from "./model/label";
14
14
  import { ListVueNode } from "./model/list-of-vue";
15
15
  import { MenuNode } from "./model/menu";
16
16
  import { SelectNode } from "./model/select";
17
+ import { Space } from "./model/space";
17
18
  import { SingleVueNode } from "./model/vue";
18
19
 
19
20
  /* ===================== Types utils et exports ===================== */
@@ -83,6 +84,7 @@ export type UINode<T extends object> =
83
84
  | CustomNode<T>
84
85
  | StaticLabelNode<T>
85
86
  | BootVueNode<T>
87
+ | Space
86
88
  | StaticBootVueNode<T>;
87
89
 
88
90
  /* ===================== UI (déclaratif uniquement) ===================== */
@@ -167,6 +169,12 @@ export class Vue<T extends object> {
167
169
  this.cursor.push(node as unknown as UINode<T>);
168
170
  return this;
169
171
  }
172
+ space(width: string, height: string) {
173
+ const space: Space = { kind: "space", width: width, height: height }
174
+ this.cursor.push(space);
175
+ return this;
176
+
177
+ }
170
178
 
171
179
  /* ------------ Img ------------ */
172
180
  img<NK extends KeysOfType<T, string>>(opts: {
@@ -366,7 +374,7 @@ export class Vue<T extends object> {
366
374
  width?: number | string; height?: number | string;
367
375
  closeOnBackdrop?: boolean; closeOnEsc?: boolean; modal?: boolean;
368
376
  visible?: KeysOfType<T, boolean>; enable?: KeysOfType<T, boolean>;
369
- useVisibility?: boolean;
377
+ useVisibility?: boolean;
370
378
  action?: KeysOfType<T, () => void>;
371
379
  /** Nouveau : rendu du bouton trigger */
372
380
  type?: ButtonContentType;
@@ -390,7 +398,7 @@ export class Vue<T extends object> {
390
398
  width?: number | string; height?: number | string;
391
399
  closeOnBackdrop?: boolean; closeOnEsc?: boolean; modal?: boolean;
392
400
  visible?: KeysOfType<T, boolean>; enable?: KeysOfType<T, boolean>;
393
- useVisibility?: boolean;
401
+ useVisibility?: boolean;
394
402
  action?: KeysOfType<T, () => void>;
395
403
  /** Nouveau : rendu du bouton trigger */
396
404
  type?: ButtonContentType;
@@ -409,7 +417,7 @@ export class Vue<T extends object> {
409
417
  id?: string; class?: string | string[];
410
418
  width?: number | string; height?: number | string;
411
419
  visible?: KeysOfType<T, boolean>; enable?: KeysOfType<T, boolean>;
412
- useVisibility?: boolean;
420
+ useVisibility?: boolean;
413
421
  /** Nom de la méthode de T: () => HTMLElement */
414
422
  factory: FK;
415
423
  /** Nom de la méthode d'init: () => void (optionnelle) */