@m3ui-vue/m3ui-vue 1.3.5 → 1.3.6

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.
Files changed (59) hide show
  1. package/dist/API.md +76 -16
  2. package/dist/{MButton-Bl_BSUep.js → MButton-D5eJiDza.js} +2 -2
  3. package/dist/{MButton-Bl_BSUep.js.map → MButton-D5eJiDza.js.map} +1 -1
  4. package/dist/{MDialog-D_Yik8ou.js → MDialog-WqB0jewp.js} +2 -2
  5. package/dist/{MDialog-D_Yik8ou.js.map → MDialog-WqB0jewp.js.map} +1 -1
  6. package/dist/{MListItem-BxifHJdU.js → MListItem-Cf-C2Ru-.js} +2 -2
  7. package/dist/{MListItem-BxifHJdU.js.map → MListItem-Cf-C2Ru-.js.map} +1 -1
  8. package/dist/{MLoadingIndicator-BxbFhSX6.js → MLoadingIndicator-D4GzEZoH.js} +2 -2
  9. package/dist/{MLoadingIndicator-BxbFhSX6.js.map → MLoadingIndicator-D4GzEZoH.js.map} +1 -1
  10. package/dist/{MSeekBar-BeN9QcB3.js → MSeekBar-B19xoWE3.js} +2 -2
  11. package/dist/{MSeekBar-BeN9QcB3.js.map → MSeekBar-B19xoWE3.js.map} +1 -1
  12. package/dist/{MSlider-BVSbJlGS.js → MSlider-9RoiuebS.js} +2 -2
  13. package/dist/{MSlider-BVSbJlGS.js.map → MSlider-9RoiuebS.js.map} +1 -1
  14. package/dist/{MSpinner-C2SUnWk4.js → MSpinner-BNF8MN-L.js} +2 -2
  15. package/dist/{MSpinner-C2SUnWk4.js.map → MSpinner-BNF8MN-L.js.map} +1 -1
  16. package/dist/{MTextField-CEkWSZ2v.js → MTextField-CuG0T3qh.js} +2 -2
  17. package/dist/{MTextField-CEkWSZ2v.js.map → MTextField-CuG0T3qh.js.map} +1 -1
  18. package/dist/{MTooltip-CodJGEO-.js → MTooltip-Bv7yxngk.js} +4 -4
  19. package/dist/{MTooltip-CodJGEO-.js.map → MTooltip-Bv7yxngk.js.map} +1 -1
  20. package/dist/api.json +1 -1
  21. package/dist/code-editor.js +1 -1
  22. package/dist/components/MFloorPlan.vue.d.ts +192 -14
  23. package/dist/components/MFloorPlanInspector.vue.d.ts +12 -12
  24. package/dist/components/MMap.vue.d.ts +2 -2
  25. package/dist/components/MPdfViewer.vue.d.ts +2 -2
  26. package/dist/composables/useFloorPlan.d.ts +10 -3
  27. package/dist/composables/useLocale.d.ts +9 -0
  28. package/dist/draw.js +2 -2
  29. package/dist/flow.js +1 -1
  30. package/dist/gantt.js +1 -1
  31. package/dist/index.d.ts +1 -1
  32. package/dist/locales/index.js +56 -0
  33. package/dist/locales/index.js.map +1 -1
  34. package/dist/m3ui-vue.css +1 -1
  35. package/dist/m3ui.js +2796 -1797
  36. package/dist/m3ui.js.map +1 -1
  37. package/dist/map.js +5 -5
  38. package/dist/media.js +4 -4
  39. package/dist/pdf.js +4 -4
  40. package/dist/rich-text-editor.js +4 -4
  41. package/dist/styles.css +1 -1
  42. package/dist/{useLocale-CaWwi-b6.js → useLocale-D2ucaY-l.js} +9 -1
  43. package/dist/useLocale-D2ucaY-l.js.map +1 -0
  44. package/package.json +1 -1
  45. package/src/__tests__/MFloorPlan.test.ts +331 -0
  46. package/src/components/MFloorPlan.vue +1143 -86
  47. package/src/components/MFloorPlanInspector.vue +21 -6
  48. package/src/components/MFloorPlanToolbar.vue +4 -3
  49. package/src/composables/useFloorPlan.ts +7 -3
  50. package/src/composables/useLocale.ts +17 -0
  51. package/src/index.ts +1 -1
  52. package/src/locales/de.ts +8 -0
  53. package/src/locales/es.ts +8 -0
  54. package/src/locales/fr.ts +8 -0
  55. package/src/locales/ja.ts +8 -0
  56. package/src/locales/ko.ts +8 -0
  57. package/src/locales/pt.ts +8 -0
  58. package/src/locales/zh.ts +8 -0
  59. package/dist/useLocale-CaWwi-b6.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-CaWwi-b6.js";
1
+ import { i as e } from "./useLocale-D2ucaY-l.js";
2
2
  import { t } from "./MIcon-Bxh9j135.js";
3
3
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y } from "vue";
@@ -16,6 +16,8 @@ export interface FloorTable {
16
16
  status?: string;
17
17
  /** A small badge: minutes seated, the total, a count… */
18
18
  badge?: string | number;
19
+ /** Seats taken (numbered from 1, clockwise from the top-left), drawn in the status color */
20
+ activeSeats?: number[];
19
21
  data?: Record<string, unknown>;
20
22
  }
21
23
  /** Tables joined together (drawn as one group) */
@@ -34,6 +36,11 @@ export interface FloorArea {
34
36
  height: number;
35
37
  /** An M3 color role or any CSS color */
36
38
  color?: string;
39
+ /**
40
+ * A zone of any shape (an L-shaped room): its corners. x / y / width / height are then the box around them, kept up
41
+ * to date. Double-click a rectangular zone's edge to give it corners
42
+ */
43
+ points?: [number, number][];
37
44
  }
38
45
  /** A wall: a line through its points */
39
46
  export interface FloorWall {
@@ -51,6 +58,8 @@ export interface FloorDecor {
51
58
  width?: number;
52
59
  height?: number;
53
60
  rotation?: number;
61
+ /** Mirrored across its length: a door hinged on the other side */
62
+ flip?: boolean;
54
63
  /** The text of a label (or a caption under the others) */
55
64
  label?: string;
56
65
  }
@@ -62,12 +71,22 @@ export interface FloorDecorKind {
62
71
  icon?: string;
63
72
  width: number;
64
73
  height: number;
65
- /** `box` a rounded rectangle, `round` a circle, `bar` a thin slab (doors, windows), `text` the item's label only */
66
- shape?: 'box' | 'round' | 'bar' | 'text';
74
+ /**
75
+ * `box` a rounded rectangle, `round` a circle, `bar` a thin slab, `door` an opening with its leaf and swing (as on an
76
+ * architect's plan), `window` a framed pane, `text` the item's label only. A door or window cuts the wall it sits on
77
+ */
78
+ shape?: 'box' | 'round' | 'bar' | 'door' | 'window' | 'text';
67
79
  /** Fill: an M3 color role (`surface`, `primary`…) or any CSS color */
68
80
  color?: string;
69
81
  }
70
- /** What's picked on the plan besides tables: a zone, a wall (and one of its corners) or a decor item */
82
+ /** Real lengths for the plan: `per` plan units make one `unit` (100 and 'm': a plan unit is a centimeter) */
83
+ export interface FloorMeasure {
84
+ unit: string;
85
+ per: number;
86
+ /** Decimals shown (default 2) */
87
+ decimals?: number;
88
+ }
89
+ /** What's picked on the plan besides tables: a zone, a wall (and one of its corners, as a zone of any shape) or a decor item */
71
90
  export type FloorPick = {
72
91
  kind: 'area' | 'wall' | 'decor';
73
92
  id: string | number;
@@ -98,12 +117,63 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
98
117
  * the squares between the points while walls, zones and decor snap to the points (a plan of cells)
99
118
  */
100
119
  tableSnap?: "point" | "cell";
120
+ /**
121
+ * Snapping steps per grid square for walls, zones and decor: 2 puts them on the points and halfway between them
122
+ * (tables keep to the grid). Drawn as smaller dots
123
+ */
124
+ subgrid?: number;
101
125
  /** Draw chairs from `seats` */
102
126
  chairs?: boolean;
127
+ /**
128
+ * Real lengths: while editing, the picked wall's or zone's sides, the wall being drawn, and the picked table's or
129
+ * decor's size are labeled in your unit (the inspector's sizes too)
130
+ */
131
+ measure?: FloorMeasure;
132
+ /** Number the chairs (1 from the top-left, clockwise); in service a click on one emits `seat-click` */
133
+ seatNumbers?: boolean;
103
134
  /** Decor kinds of yours, or the built-in ones restyled (merged over them by name) */
104
135
  decorKinds?: Record<string, FloorDecorKind>;
105
- /** The handle that turns the picked table or decor (off when your app doesn't keep angles) */
106
- rotatable?: boolean;
136
+ /** What the turning handle turns: everything (`true`), nothing, or only these kinds (`['decor']` when your app keeps no tables' angles) */
137
+ rotatable?: boolean | ("table" | "decor")[];
138
+ /**
139
+ * Tables placed by cell: their `x` / `y` are a column and a row (whole numbers from 0), each cell this many plan
140
+ * units wide. A table's middle sits in the middle of its cell and steps a cell at a time, and every table you get
141
+ * back (`update:tables`, `move`, events, slots) is in columns and rows. Zones, walls and decor stay in plan units
142
+ */
143
+ cellSize?: number;
144
+ /**
145
+ * Zoom and pan: Ctrl + wheel or a pinch zooms (from the plan's own size up to `maxZoom`), the wheel, two fingers,
146
+ * a middle-button drag or (outside editing, or with a finger) a drag on empty floor pans, with + / − / fit buttons
147
+ */
148
+ zoomable?: boolean;
149
+ maxZoom?: number;
150
+ /** The zoom buttons, when zoomable */
151
+ zoomControls?: boolean;
152
+ /** An image under everything (a scanned floor plan to trace over), placed in plan units (default: the whole plan) */
153
+ backgroundImage?: string;
154
+ backgroundBox?: {
155
+ x: number;
156
+ y: number;
157
+ width: number;
158
+ height: number;
159
+ };
160
+ /** Its opacity */
161
+ backgroundOpacity?: number;
162
+ /** Which point of a table `x` / `y` name: its middle (default) or its top-left corner (unturned), as your data keeps it */
163
+ tableOrigin?: "center" | "corner";
164
+ /**
165
+ * Tables that overlap while editing: `warn` outlines them (default), `prevent` also undoes a move or a resize that
166
+ * would make one overlap another, `allow` says nothing
167
+ */
168
+ overlap?: "allow" | "warn" | "prevent";
169
+ /**
170
+ * How a resize handle steps (tables and decor): `grid` whole grid squares, `subgrid` the snapping step of walls
171
+ * and zones (`subgrid`), `free` not at all. The change steps, not the size: a table drawn a little smaller than its
172
+ * square keeps that margin and grows by whole squares
173
+ */
174
+ resizeSnap?: "grid" | "subgrid" | "free";
175
+ /** The handle that resizes the selected table (off when your tables keep one size) */
176
+ resizable?: boolean;
107
177
  /** Dragging (or nudging) a merged table moves its whole merge with it */
108
178
  dragMerged?: boolean;
109
179
  /**
@@ -112,21 +182,35 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
112
182
  * on its own (to bring the ones being merged together)
113
183
  */
114
184
  selectable?: "none" | "single" | "multiple";
185
+ /**
186
+ * In service, a table carried onto another one emits `transfer` (to move its party, its bill): a mouse drags it, a
187
+ * finger holds it down first. The table itself doesn't move
188
+ */
189
+ transferable?: boolean;
190
+ /** Whether a table's party may go to another table: `true`, or `false` / a reason (`transfer-refused` carries it) */
191
+ canTransfer?: (from: FloorTable, to: FloorTable) => boolean | string;
115
192
  /** Whether these tables may be merged: `true`, or `false` / a reason to refuse (shown by `merge-refused`) */
116
193
  canMerge?: (ids: (string | number)[]) => boolean | string;
117
194
  /** Accessible name */
118
195
  label?: string;
119
196
  } & {
197
+ /** The tables as you keep them: plan units, or cells (`cellSize`), by their middle or corner (`tableOrigin`) */
120
198
  tables?: FloorTable[];
121
199
  merges?: FloorMerge[];
122
200
  selection?: (string | number)[];
123
201
  areas?: FloorArea[];
124
202
  walls?: FloorWall[];
125
203
  decor?: FloorDecor[];
126
- /** While editing: `select` moves things, `wall` draws a wall (click each corner, double-click or Enter to end), `area` drags out a zone */
127
- tool?: "select" | "wall" | "area";
204
+ /**
205
+ * While editing: `select` moves things, `wall` draws a wall (click each corner, double-click or Enter to end), `area`
206
+ * drags out a rectangular zone, `polygon` draws a zone of any shape corner by corner (click the first corner, double-click
207
+ * or Enter to close it)
208
+ */
209
+ tool?: "select" | "wall" | "area" | "polygon";
128
210
  /** While editing: the zone, wall (and corner) or decor item picked, for an inspector of your own */
129
211
  picked?: FloorPick;
212
+ /** Zoom (1: the whole plan; up to `maxZoom`), with `zoomable` */
213
+ zoom?: number;
130
214
  }, {
131
215
  /** Everything above and more, for MFloorPlanToolbar / MFloorPlanInspector outside the plan (`:plan="plan"`) */
132
216
  context: FloorPlanContext;
@@ -146,6 +230,12 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
146
230
  duplicate: () => void;
147
231
  /** Remove tables, taking them out of their merges (Delete does it for the selection) */
148
232
  removeTables: (ids: (string | number)[]) => void;
233
+ /** Zoom (with `zoomable`): to a level, keeping the plan point under (px, py) in place; and centering on a plan point */
234
+ zoomTo: (z: number, px?: number, py?: number) => void;
235
+ centerOn: (x: number, y: number, z?: number) => void;
236
+ /** The plan as a standalone SVG string, or a PNG Blob (`pixelRatio` px per plan unit) */
237
+ toSVG: () => string;
238
+ toPNG: (pixelRatio?: number) => Promise<Blob>;
149
239
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
150
240
  split: (merge: FloorMerge) => any;
151
241
  move: (moved: {
@@ -153,7 +243,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
153
243
  x: number;
154
244
  y: number;
155
245
  }[]) => any;
156
- "update:tool": (value: "area" | "select" | "wall") => any;
246
+ "update:tool": (value: "area" | "select" | "polygon" | "wall") => any;
157
247
  "update:selection": (value: (string | number)[]) => any;
158
248
  "update:tables": (value: FloorTable[]) => any;
159
249
  "update:merges": (value: FloorMerge[]) => any;
@@ -161,8 +251,12 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
161
251
  "update:walls": (value: FloorWall[]) => any;
162
252
  "update:decor": (value: FloorDecor[]) => any;
163
253
  "update:picked": (value: FloorPick) => any;
254
+ "update:zoom": (value: number) => any;
164
255
  merge: (merge: FloorMerge) => any;
165
256
  "merge-refused": (ids: (string | number)[], reason: string) => any;
257
+ transfer: (from: FloorTable, to: FloorTable) => any;
258
+ "seat-click": (table: FloorTable, seat: number, event: MouseEvent) => any;
259
+ "transfer-refused": (from: FloorTable, to: FloorTable, reason: string) => any;
166
260
  "table-click": (table: FloorTable, event: MouseEvent | KeyboardEvent) => any;
167
261
  }, string, import("vue").PublicProps, Readonly<{
168
262
  /** The plan's size in plan units */
@@ -181,12 +275,63 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
181
275
  * the squares between the points while walls, zones and decor snap to the points (a plan of cells)
182
276
  */
183
277
  tableSnap?: "point" | "cell";
278
+ /**
279
+ * Snapping steps per grid square for walls, zones and decor: 2 puts them on the points and halfway between them
280
+ * (tables keep to the grid). Drawn as smaller dots
281
+ */
282
+ subgrid?: number;
184
283
  /** Draw chairs from `seats` */
185
284
  chairs?: boolean;
285
+ /**
286
+ * Real lengths: while editing, the picked wall's or zone's sides, the wall being drawn, and the picked table's or
287
+ * decor's size are labeled in your unit (the inspector's sizes too)
288
+ */
289
+ measure?: FloorMeasure;
290
+ /** Number the chairs (1 from the top-left, clockwise); in service a click on one emits `seat-click` */
291
+ seatNumbers?: boolean;
186
292
  /** Decor kinds of yours, or the built-in ones restyled (merged over them by name) */
187
293
  decorKinds?: Record<string, FloorDecorKind>;
188
- /** The handle that turns the picked table or decor (off when your app doesn't keep angles) */
189
- rotatable?: boolean;
294
+ /** What the turning handle turns: everything (`true`), nothing, or only these kinds (`['decor']` when your app keeps no tables' angles) */
295
+ rotatable?: boolean | ("table" | "decor")[];
296
+ /**
297
+ * Tables placed by cell: their `x` / `y` are a column and a row (whole numbers from 0), each cell this many plan
298
+ * units wide. A table's middle sits in the middle of its cell and steps a cell at a time, and every table you get
299
+ * back (`update:tables`, `move`, events, slots) is in columns and rows. Zones, walls and decor stay in plan units
300
+ */
301
+ cellSize?: number;
302
+ /**
303
+ * Zoom and pan: Ctrl + wheel or a pinch zooms (from the plan's own size up to `maxZoom`), the wheel, two fingers,
304
+ * a middle-button drag or (outside editing, or with a finger) a drag on empty floor pans, with + / − / fit buttons
305
+ */
306
+ zoomable?: boolean;
307
+ maxZoom?: number;
308
+ /** The zoom buttons, when zoomable */
309
+ zoomControls?: boolean;
310
+ /** An image under everything (a scanned floor plan to trace over), placed in plan units (default: the whole plan) */
311
+ backgroundImage?: string;
312
+ backgroundBox?: {
313
+ x: number;
314
+ y: number;
315
+ width: number;
316
+ height: number;
317
+ };
318
+ /** Its opacity */
319
+ backgroundOpacity?: number;
320
+ /** Which point of a table `x` / `y` name: its middle (default) or its top-left corner (unturned), as your data keeps it */
321
+ tableOrigin?: "center" | "corner";
322
+ /**
323
+ * Tables that overlap while editing: `warn` outlines them (default), `prevent` also undoes a move or a resize that
324
+ * would make one overlap another, `allow` says nothing
325
+ */
326
+ overlap?: "allow" | "warn" | "prevent";
327
+ /**
328
+ * How a resize handle steps (tables and decor): `grid` whole grid squares, `subgrid` the snapping step of walls
329
+ * and zones (`subgrid`), `free` not at all. The change steps, not the size: a table drawn a little smaller than its
330
+ * square keeps that margin and grows by whole squares
331
+ */
332
+ resizeSnap?: "grid" | "subgrid" | "free";
333
+ /** The handle that resizes the selected table (off when your tables keep one size) */
334
+ resizable?: boolean;
190
335
  /** Dragging (or nudging) a merged table moves its whole merge with it */
191
336
  dragMerged?: boolean;
192
337
  /**
@@ -195,21 +340,35 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
195
340
  * on its own (to bring the ones being merged together)
196
341
  */
197
342
  selectable?: "none" | "single" | "multiple";
343
+ /**
344
+ * In service, a table carried onto another one emits `transfer` (to move its party, its bill): a mouse drags it, a
345
+ * finger holds it down first. The table itself doesn't move
346
+ */
347
+ transferable?: boolean;
348
+ /** Whether a table's party may go to another table: `true`, or `false` / a reason (`transfer-refused` carries it) */
349
+ canTransfer?: (from: FloorTable, to: FloorTable) => boolean | string;
198
350
  /** Whether these tables may be merged: `true`, or `false` / a reason to refuse (shown by `merge-refused`) */
199
351
  canMerge?: (ids: (string | number)[]) => boolean | string;
200
352
  /** Accessible name */
201
353
  label?: string;
202
354
  } & {
355
+ /** The tables as you keep them: plan units, or cells (`cellSize`), by their middle or corner (`tableOrigin`) */
203
356
  tables?: FloorTable[];
204
357
  merges?: FloorMerge[];
205
358
  selection?: (string | number)[];
206
359
  areas?: FloorArea[];
207
360
  walls?: FloorWall[];
208
361
  decor?: FloorDecor[];
209
- /** While editing: `select` moves things, `wall` draws a wall (click each corner, double-click or Enter to end), `area` drags out a zone */
210
- tool?: "select" | "wall" | "area";
362
+ /**
363
+ * While editing: `select` moves things, `wall` draws a wall (click each corner, double-click or Enter to end), `area`
364
+ * drags out a rectangular zone, `polygon` draws a zone of any shape corner by corner (click the first corner, double-click
365
+ * or Enter to close it)
366
+ */
367
+ tool?: "select" | "wall" | "area" | "polygon";
211
368
  /** While editing: the zone, wall (and corner) or decor item picked, for an inspector of your own */
212
369
  picked?: FloorPick;
370
+ /** Zoom (1: the whole plan; up to `maxZoom`), with `zoomable` */
371
+ zoom?: number;
213
372
  }> & Readonly<{
214
373
  onSplit?: ((merge: FloorMerge) => any) | undefined;
215
374
  onMove?: ((moved: {
@@ -217,7 +376,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
217
376
  x: number;
218
377
  y: number;
219
378
  }[]) => any) | undefined;
220
- "onUpdate:tool"?: ((value: "area" | "select" | "wall") => any) | undefined;
379
+ "onUpdate:tool"?: ((value: "area" | "select" | "polygon" | "wall") => any) | undefined;
221
380
  "onUpdate:selection"?: ((value: (string | number)[]) => any) | undefined;
222
381
  "onUpdate:tables"?: ((value: FloorTable[]) => any) | undefined;
223
382
  "onUpdate:merges"?: ((value: FloorMerge[]) => any) | undefined;
@@ -225,20 +384,33 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
225
384
  "onUpdate:walls"?: ((value: FloorWall[]) => any) | undefined;
226
385
  "onUpdate:decor"?: ((value: FloorDecor[]) => any) | undefined;
227
386
  "onUpdate:picked"?: ((value: FloorPick) => any) | undefined;
387
+ "onUpdate:zoom"?: ((value: number) => any) | undefined;
228
388
  onMerge?: ((merge: FloorMerge) => any) | undefined;
229
389
  "onMerge-refused"?: ((ids: (string | number)[], reason: string) => any) | undefined;
390
+ onTransfer?: ((from: FloorTable, to: FloorTable) => any) | undefined;
391
+ "onSeat-click"?: ((table: FloorTable, seat: number, event: MouseEvent) => any) | undefined;
392
+ "onTransfer-refused"?: ((from: FloorTable, to: FloorTable, reason: string) => any) | undefined;
230
393
  "onTable-click"?: ((table: FloorTable, event: MouseEvent | KeyboardEvent) => any) | undefined;
231
394
  }>, {
232
395
  width: number;
233
396
  height: number;
234
397
  grid: number;
398
+ maxZoom: number;
235
399
  selectable: "none" | "single" | "multiple";
400
+ zoomable: boolean;
401
+ resizable: boolean;
236
402
  showGrid: boolean;
403
+ overlap: "allow" | "warn" | "prevent";
404
+ subgrid: number;
237
405
  statuses: Record<string, FloorStatus>;
238
406
  editable: boolean;
239
407
  tableSnap: "point" | "cell";
240
408
  chairs: boolean;
241
- rotatable: boolean;
409
+ rotatable: boolean | ("table" | "decor")[];
410
+ zoomControls: boolean;
411
+ backgroundOpacity: number;
412
+ tableOrigin: "center" | "corner";
413
+ resizeSnap: "grid" | "subgrid" | "free";
242
414
  dragMerged: boolean;
243
415
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
244
416
  area?: (props: {
@@ -246,6 +418,12 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
246
418
  picked: boolean;
247
419
  scale: number;
248
420
  }) => any;
421
+ } & {
422
+ area?: (props: {
423
+ area: FloorArea;
424
+ picked: boolean;
425
+ scale: number;
426
+ }) => any;
249
427
  } & {
250
428
  decor?: (props: {
251
429
  item: FloorDecor;
@@ -10,34 +10,34 @@ type __VLS_Props = {
10
10
  /** Merge and split buttons */
11
11
  merging?: boolean;
12
12
  };
13
- declare var __VLS_34: {
13
+ declare var __VLS_48: {
14
14
  table: FloorTable;
15
15
  update: (p: Partial<FloorTable>) => void;
16
- }, __VLS_65: {
16
+ }, __VLS_79: {
17
17
  ids: (string | number)[];
18
- }, __VLS_117: {
18
+ }, __VLS_131: {
19
19
  area: FloorArea;
20
20
  update: (p: Partial<FloorArea>) => void;
21
- }, __VLS_147: {
21
+ }, __VLS_169: {
22
22
  wall: FloorWall;
23
23
  update: (p: Partial<FloorWall>) => void;
24
- }, __VLS_198: {
24
+ }, __VLS_220: {
25
25
  item: FloorDecor;
26
26
  kind: import("./MFloorPlan.vue").FloorDecorKind | undefined;
27
27
  update: (p: Partial<FloorDecor>) => void;
28
- }, __VLS_216: {};
28
+ }, __VLS_246: {};
29
29
  type __VLS_Slots = {} & {
30
- table?: (props: typeof __VLS_34) => any;
30
+ table?: (props: typeof __VLS_48) => any;
31
31
  } & {
32
- tables?: (props: typeof __VLS_65) => any;
32
+ tables?: (props: typeof __VLS_79) => any;
33
33
  } & {
34
- area?: (props: typeof __VLS_117) => any;
34
+ area?: (props: typeof __VLS_131) => any;
35
35
  } & {
36
- wall?: (props: typeof __VLS_147) => any;
36
+ wall?: (props: typeof __VLS_169) => any;
37
37
  } & {
38
- decor?: (props: typeof __VLS_198) => any;
38
+ decor?: (props: typeof __VLS_220) => any;
39
39
  } & {
40
- empty?: (props: typeof __VLS_216) => any;
40
+ empty?: (props: typeof __VLS_246) => any;
41
41
  };
42
42
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
43
43
  plan: {
@@ -62,15 +62,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
62
62
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
63
63
  ready: (map: Maplibre.Map) => any;
64
64
  click: (event: Maplibre.MapMouseEvent) => any;
65
- "update:center": (center: [number, number]) => any;
66
65
  "update:zoom": (zoom: number) => any;
66
+ "update:center": (center: [number, number]) => any;
67
67
  "update:bearing": (bearing: number) => any;
68
68
  "update:pitch": (pitch: number) => any;
69
69
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
70
70
  onReady?: ((map: Maplibre.Map) => any) | undefined;
71
71
  onClick?: ((event: Maplibre.MapMouseEvent) => any) | undefined;
72
- "onUpdate:center"?: ((center: [number, number]) => any) | undefined;
73
72
  "onUpdate:zoom"?: ((zoom: number) => any) | undefined;
73
+ "onUpdate:center"?: ((center: [number, number]) => any) | undefined;
74
74
  "onUpdate:bearing"?: ((bearing: number) => any) | undefined;
75
75
  "onUpdate:pitch"?: ((pitch: number) => any) | undefined;
76
76
  }>, {
@@ -88,9 +88,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
88
88
  }) => any;
89
89
  "update:tool": (args_0: PdfTool) => any;
90
90
  "update:page": (args_0: number) => any;
91
+ "update:zoom": (args_0: PdfZoom) => any;
91
92
  "update:rotation": (args_0: number) => any;
92
93
  loaded: (args_0: import("pdfjs-dist/types/src/display/api").PDFDocumentProxy) => any;
93
- "update:zoom": (args_0: PdfZoom) => any;
94
94
  "update:annotations": (args_0: PdfAnnotation[]) => any;
95
95
  "update:sidebar": (args_0: "outline" | "thumbnails" | null) => any;
96
96
  "annotation-click": (args_0: PdfAnnotation) => any;
@@ -139,9 +139,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
139
139
  }) => any) | undefined;
140
140
  "onUpdate:tool"?: ((args_0: PdfTool) => any) | undefined;
141
141
  "onUpdate:page"?: ((args_0: number) => any) | undefined;
142
+ "onUpdate:zoom"?: ((args_0: PdfZoom) => any) | undefined;
142
143
  "onUpdate:rotation"?: ((args_0: number) => any) | undefined;
143
144
  onLoaded?: ((args_0: import("pdfjs-dist/types/src/display/api").PDFDocumentProxy) => any) | undefined;
144
- "onUpdate:zoom"?: ((args_0: PdfZoom) => any) | undefined;
145
145
  "onUpdate:annotations"?: ((args_0: PdfAnnotation[]) => any) | undefined;
146
146
  "onUpdate:sidebar"?: ((args_0: "outline" | "thumbnails" | null) => any) | undefined;
147
147
  "onAnnotation-click"?: ((args_0: PdfAnnotation) => any) | undefined;
@@ -1,7 +1,7 @@
1
1
  import { type ComputedRef, type InjectionKey, type Ref } from 'vue';
2
2
  import type { M3Locale } from './useLocale';
3
- import type { FloorArea, FloorDecor, FloorDecorKind, FloorMerge, FloorPick, FloorStatus, FloorTable, FloorWall } from '../components/MFloorPlan.vue';
4
- export type FloorTool = 'select' | 'wall' | 'area';
3
+ import type { FloorArea, FloorDecor, FloorDecorKind, FloorMeasure, FloorMerge, FloorPick, FloorStatus, FloorTable, FloorWall } from '../components/MFloorPlan.vue';
4
+ export type FloorTool = 'select' | 'wall' | 'area' | 'polygon';
5
5
  export type FloorItemKind = 'table' | 'area' | 'wall' | 'decor';
6
6
  /**
7
7
  * An MFloorPlan's state and actions. MFloorPlanToolbar and MFloorPlanInspector are built on it, and so can controls
@@ -18,10 +18,17 @@ export interface FloorPlanContext {
18
18
  picked: Ref<FloorPick>;
19
19
  tool: Ref<FloorTool>;
20
20
  editable: ComputedRef<boolean>;
21
- /** A wall is being drawn (tool `wall`): finish it (also double-click / Enter) or cancel it (Escape) */
21
+ /** A wall (tool `wall`) or a zone of any shape (tool `polygon`) is being drawn: finish it (also double-click / Enter) or cancel it (Escape) */
22
22
  drawingWall: ComputedRef<boolean>;
23
23
  finishWall(): void;
24
24
  cancelWall(): void;
25
+ /** A table's size in plan units (its own, or the default for its shape and seats) */
26
+ tableSize(table: FloorTable): {
27
+ w: number;
28
+ h: number;
29
+ };
30
+ /** The plan's real lengths (`measure`), if it has them */
31
+ measure: ComputedRef<FloorMeasure | undefined>;
25
32
  /** The decor kinds: built-in ones merged with `decorKinds` */
26
33
  kinds: ComputedRef<Record<string, FloorDecorKind>>;
27
34
  statuses: ComputedRef<Record<string, FloorStatus>>;
@@ -361,6 +361,15 @@ export interface M3Locale {
361
361
  floorSquare: string;
362
362
  floorLong: string;
363
363
  floorAngle: string;
364
+ /** A door's button: hinge it on the other side */
365
+ floorFlip: string;
366
+ floorZoomIn: string;
367
+ floorZoomOut: string;
368
+ floorZoomFit: string;
369
+ floorOverlaps: string;
370
+ floorSeatN: string;
371
+ floorDrawShape: string;
372
+ floorShapeHint: string;
364
373
  floorColor: string;
365
374
  floorThickness: string;
366
375
  floorWidth: string;
package/dist/draw.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as e } from "./useLocale-CaWwi-b6.js";
1
+ import { i as e } from "./useLocale-D2ucaY-l.js";
2
2
  import { t } from "./MIconButton-DoNotQ9v.js";
3
- import { n, t as r } from "./MTooltip-CodJGEO-.js";
3
+ import { n, t as r } from "./MTooltip-Bv7yxngk.js";
4
4
  import { n as i, t as a } from "./MMenuItem-Bih0h4-n.js";
5
5
  import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, inject as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, openBlock as C, provide as ee, ref as w, renderList as T, renderSlot as E, shallowRef as D, toDisplayString as te, unref as O, useId as ne, useModel as k, vModelText as re, watch as ie, withCtx as A, withDirectives as j, withKeys as ae, withModifiers as M } from "vue";
6
6
  //#region src/composables/drawGeometry.ts
package/dist/flow.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-CaWwi-b6.js";
1
+ import { i as e } from "./useLocale-D2ucaY-l.js";
2
2
  import { r as t, t as n, u as r } from "./MIconButton-DoNotQ9v.js";
3
3
  import { a as i, c as a, d as o, i as s, l as c, n as l, o as u, r as d, s as f, t as p, u as m } from "./flowPaths-DzW-aiET.js";
4
4
  import { Fragment as h, Transition as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createTextVNode as S, createVNode as C, defineComponent as w, inject as T, mergeProps as ee, nextTick as E, normalizeClass as D, normalizeStyle as O, onBeforeUnmount as te, onMounted as ne, openBlock as k, provide as re, reactive as ie, ref as A, renderList as ae, renderSlot as oe, shallowReactive as se, shallowRef as ce, toDisplayString as le, toRaw as ue, unref as j, useSlots as de, vShow as fe, watch as pe, withCtx as me, withDirectives as M, withModifiers as he } from "vue";
package/dist/gantt.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-CaWwi-b6.js";
1
+ import { i as e } from "./useLocale-D2ucaY-l.js";
2
2
  import { f as t, l as n, t as r, u as i } from "./MIconButton-DoNotQ9v.js";
3
3
  import { t as a } from "./MSegmentedButton-DL9JtJFX.js";
4
4
  import { t as o } from "./flowPaths-DzW-aiET.js";
package/dist/index.d.ts CHANGED
@@ -123,7 +123,7 @@ export type { FloorTablePreset } from './components/MFloorPlanToolbar.vue';
123
123
  export { default as MFloorPlanInspector } from './components/MFloorPlanInspector.vue';
124
124
  export { useFloorPlan, floorDecorName } from './composables/useFloorPlan';
125
125
  export type { FloorPlanContext, FloorTool, FloorItemKind } from './composables/useFloorPlan';
126
- export type { FloorTable, FloorMerge, FloorStatus, FloorArea, FloorWall, FloorDecor, FloorPick, FloorDecorKind, FloorDecorBuiltin } from './components/MFloorPlan.vue';
126
+ export type { FloorTable, FloorMerge, FloorStatus, FloorArea, FloorWall, FloorDecor, FloorPick, FloorDecorKind, FloorDecorBuiltin, FloorMeasure } from './components/MFloorPlan.vue';
127
127
  export { default as MImageCropper } from './components/MImageCropper.vue';
128
128
  export { default as MFixed } from './components/MFixed.vue';
129
129
  export { default as MFooter } from './components/MFooter.vue';
@@ -355,6 +355,14 @@ var e = {
355
355
  floorSquare: "Cuadrada",
356
356
  floorLong: "Larga",
357
357
  floorAngle: "Ángulo",
358
+ floorFlip: "Invertir",
359
+ floorZoomIn: "Acercar",
360
+ floorZoomOut: "Alejar",
361
+ floorZoomFit: "Plano entero",
362
+ floorOverlaps: "Se superpone con otra mesa",
363
+ floorSeatN: "Asiento {n}",
364
+ floorDrawShape: "Zona con forma",
365
+ floorShapeHint: "Arrastrá sus esquinas; doble clic en un borde agrega una, Supr quita la elegida",
358
366
  floorColor: "Color",
359
367
  floorThickness: "Grosor",
360
368
  floorWidth: "Ancho",
@@ -750,6 +758,14 @@ var e = {
750
758
  floorSquare: "Carrée",
751
759
  floorLong: "Longue",
752
760
  floorAngle: "Angle",
761
+ floorFlip: "Inverser",
762
+ floorZoomIn: "Zoom avant",
763
+ floorZoomOut: "Zoom arrière",
764
+ floorZoomFit: "Plan entier",
765
+ floorOverlaps: "Chevauche une autre table",
766
+ floorSeatN: "Place {n}",
767
+ floorDrawShape: "Zone de forme libre",
768
+ floorShapeHint: "Faites glisser ses coins ; double-cliquez sur un bord pour en ajouter un, Suppr retire celui choisi",
753
769
  floorColor: "Couleur",
754
770
  floorThickness: "Épaisseur",
755
771
  floorWidth: "Largeur",
@@ -1145,6 +1161,14 @@ var e = {
1145
1161
  floorSquare: "Quadrada",
1146
1162
  floorLong: "Longa",
1147
1163
  floorAngle: "Ângulo",
1164
+ floorFlip: "Inverter",
1165
+ floorZoomIn: "Aproximar",
1166
+ floorZoomOut: "Afastar",
1167
+ floorZoomFit: "Planta inteira",
1168
+ floorOverlaps: "Sobrepõe outra mesa",
1169
+ floorSeatN: "Lugar {n}",
1170
+ floorDrawShape: "Zona com forma",
1171
+ floorShapeHint: "Arraste os cantos; clique duas vezes numa borda para adicionar um, Delete remove o escolhido",
1148
1172
  floorColor: "Cor",
1149
1173
  floorThickness: "Espessura",
1150
1174
  floorWidth: "Largura",
@@ -1540,6 +1564,14 @@ var e = {
1540
1564
  floorSquare: "Quadratisch",
1541
1565
  floorLong: "Lang",
1542
1566
  floorAngle: "Winkel",
1567
+ floorFlip: "Spiegeln",
1568
+ floorZoomIn: "Vergrößern",
1569
+ floorZoomOut: "Verkleinern",
1570
+ floorZoomFit: "Ganzer Plan",
1571
+ floorOverlaps: "Überlappt einen anderen Tisch",
1572
+ floorSeatN: "Platz {n}",
1573
+ floorDrawShape: "Zone mit freier Form",
1574
+ floorShapeHint: "Ecken ziehen; Doppelklick auf eine Kante fügt eine hinzu, Entf entfernt die gewählte",
1543
1575
  floorColor: "Farbe",
1544
1576
  floorThickness: "Stärke",
1545
1577
  floorWidth: "Breite",
@@ -1935,6 +1967,14 @@ var e = {
1935
1967
  floorSquare: "四角",
1936
1968
  floorLong: "長方形",
1937
1969
  floorAngle: "角度",
1970
+ floorFlip: "反転",
1971
+ floorZoomIn: "拡大",
1972
+ floorZoomOut: "縮小",
1973
+ floorZoomFit: "全体を表示",
1974
+ floorOverlaps: "他のテーブルと重なっています",
1975
+ floorSeatN: "席 {n}",
1976
+ floorDrawShape: "自由な形のエリア",
1977
+ floorShapeHint: "角をドラッグ。辺をダブルクリックで角を追加、Deleteで選んだ角を削除",
1938
1978
  floorColor: "色",
1939
1979
  floorThickness: "厚さ",
1940
1980
  floorWidth: "幅",
@@ -2330,6 +2370,14 @@ var e = {
2330
2370
  floorSquare: "方形",
2331
2371
  floorLong: "长形",
2332
2372
  floorAngle: "角度",
2373
+ floorFlip: "翻转",
2374
+ floorZoomIn: "放大",
2375
+ floorZoomOut: "缩小",
2376
+ floorZoomFit: "整个平面图",
2377
+ floorOverlaps: "与另一张桌子重叠",
2378
+ floorSeatN: "座位 {n}",
2379
+ floorDrawShape: "任意形状区域",
2380
+ floorShapeHint: "拖动其角点;双击边添加角点,Delete 删除所选角点",
2333
2381
  floorColor: "颜色",
2334
2382
  floorThickness: "厚度",
2335
2383
  floorWidth: "宽度",
@@ -2725,6 +2773,14 @@ var e = {
2725
2773
  floorSquare: "정사각형",
2726
2774
  floorLong: "긴형",
2727
2775
  floorAngle: "각도",
2776
+ floorFlip: "뒤집기",
2777
+ floorZoomIn: "확대",
2778
+ floorZoomOut: "축소",
2779
+ floorZoomFit: "전체 보기",
2780
+ floorOverlaps: "다른 테이블과 겹침",
2781
+ floorSeatN: "좌석 {n}",
2782
+ floorDrawShape: "자유 형태 구역",
2783
+ floorShapeHint: "모서리를 드래그하세요. 가장자리를 더블클릭하면 모서리가 추가되고, Delete로 선택한 모서리를 지웁니다",
2728
2784
  floorColor: "색상",
2729
2785
  floorThickness: "두께",
2730
2786
  floorWidth: "너비",