platform-calendar-seatmap 2.1.12 → 2.1.13
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/.github/workflows/main.yml +49 -49
- package/LICENSE +21 -21
- package/README.md +36 -36
- package/custom.d.ts +8 -8
- package/dist/canvas/CanvasRegistry.d.ts +47 -0
- package/dist/canvas/CanvasRenderer.d.ts +54 -0
- package/dist/canvas/HitTestIndex.d.ts +32 -0
- package/dist/canvas/SeatDrawer.d.ts +6 -0
- package/dist/canvas/index.d.ts +7 -0
- package/dist/canvas/types.d.ts +73 -0
- package/dist/canvas/useCanvasElement.d.ts +25 -0
- package/dist/components/actionsHandler/ActionsHandler.d.ts +1 -0
- package/dist/components/app/App.d.ts +1 -0
- package/dist/components/numberingSettings/NumberingSettings.d.ts +2 -0
- package/dist/components/sceneContainer/SceneContainer.d.ts +1 -0
- package/dist/components/seatTooltip/SeatTooltip.d.ts +2 -0
- package/dist/components/seatTooltip/SeatTooltipPortal.d.ts +7 -1
- package/dist/helpers/functions/seatMap.d.ts +12 -2
- package/dist/helpers/functions/statistics.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +0 -980
- package/dist/store/reducers/elementSelector/types.d.ts +1 -1
- package/dist/store/reducers/main/actionCreators.d.ts +3 -2
- package/dist/store/reducers/main/actionTypes.d.ts +2 -1
- package/dist/store/reducers/main/selectors.d.ts +2 -1
- package/dist/store/reducers/main/types.d.ts +10 -3
- package/dist/store/reducers/rootReducer.d.ts +2 -2
- package/dist/store/reducers/seatMap/selectors.d.ts +24 -24
- package/package.json +60 -60
- package/tsconfig.json +36 -35
- package/dist/components/elements/table/round/Round.d.ts +0 -24
- package/dist/components/elements/table/square/Square.d.ts +0 -24
- package/dist/hooks/useElementVisibility.d.ts +0 -11
- package/dist/hooks/useRowVirtualization.d.ts +0 -23
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
name: Publish to npm
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main_needtofix
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
publish:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@v2
|
|
15
|
-
|
|
16
|
-
- name: Set up Node.js
|
|
17
|
-
uses: actions/setup-node@v3
|
|
18
|
-
with:
|
|
19
|
-
node-version: '20'
|
|
20
|
-
registry-url: 'https://registry.npmjs.org/'
|
|
21
|
-
|
|
22
|
-
- name: Set Git user configuration
|
|
23
|
-
run: |
|
|
24
|
-
git config --global user.name "Boomtech dev"
|
|
25
|
-
git config --global user.email "dev@boomte.ch"
|
|
26
|
-
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: npm install
|
|
29
|
-
|
|
30
|
-
- name: Run build
|
|
31
|
-
run: npm run build
|
|
32
|
-
|
|
33
|
-
- name: Run build
|
|
34
|
-
run: git status
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- name: Bump version (patch)
|
|
38
|
-
run: |
|
|
39
|
-
npm version patch
|
|
40
|
-
git push origin main
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- name: Configure npm for authentication
|
|
44
|
-
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > ~/.npmrc
|
|
45
|
-
|
|
46
|
-
- name: Publish to npm
|
|
47
|
-
run: npm publish
|
|
48
|
-
env:
|
|
49
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main_needtofix
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v2
|
|
15
|
+
|
|
16
|
+
- name: Set up Node.js
|
|
17
|
+
uses: actions/setup-node@v3
|
|
18
|
+
with:
|
|
19
|
+
node-version: '20'
|
|
20
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
21
|
+
|
|
22
|
+
- name: Set Git user configuration
|
|
23
|
+
run: |
|
|
24
|
+
git config --global user.name "Boomtech dev"
|
|
25
|
+
git config --global user.email "dev@boomte.ch"
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: npm install
|
|
29
|
+
|
|
30
|
+
- name: Run build
|
|
31
|
+
run: npm run build
|
|
32
|
+
|
|
33
|
+
- name: Run build
|
|
34
|
+
run: git status
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
- name: Bump version (patch)
|
|
38
|
+
run: |
|
|
39
|
+
npm version patch
|
|
40
|
+
git push origin main
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
- name: Configure npm for authentication
|
|
44
|
+
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > ~/.npmrc
|
|
45
|
+
|
|
46
|
+
- name: Publish to npm
|
|
47
|
+
run: npm publish
|
|
48
|
+
env:
|
|
49
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 sam-mfb
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 sam-mfb
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
# Boom Calendar
|
|
2
|
-
|
|
3
|
-
Powerful and customizable calendar package.
|
|
4
|
-
|
|
5
|
-
# Installation
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
npm install --save platform-calendar-seatmap
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
# Code Example
|
|
12
|
-
|
|
13
|
-
Here's an example of basic usage:
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import SeatMap from 'platform-calendar-seatmap';
|
|
18
|
-
|
|
19
|
-
const App = () => {
|
|
20
|
-
return <SeatMap />;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default App;
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
How to start project locally:
|
|
27
|
-
|
|
28
|
-
npm i in root directory
|
|
29
|
-
|
|
30
|
-
npm start in root directory
|
|
31
|
-
|
|
32
|
-
npm i in example folder
|
|
33
|
-
|
|
34
|
-
npm start in example folder
|
|
35
|
-
|
|
36
|
-
Full documentation is on the way.
|
|
1
|
+
# Boom Calendar
|
|
2
|
+
|
|
3
|
+
Powerful and customizable calendar package.
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
npm install --save platform-calendar-seatmap
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
# Code Example
|
|
12
|
+
|
|
13
|
+
Here's an example of basic usage:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import SeatMap from 'platform-calendar-seatmap';
|
|
18
|
+
|
|
19
|
+
const App = () => {
|
|
20
|
+
return <SeatMap />;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default App;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
How to start project locally:
|
|
27
|
+
|
|
28
|
+
npm i in root directory
|
|
29
|
+
|
|
30
|
+
npm start in root directory
|
|
31
|
+
|
|
32
|
+
npm i in example folder
|
|
33
|
+
|
|
34
|
+
npm start in example folder
|
|
35
|
+
|
|
36
|
+
Full documentation is on the way.
|
package/custom.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare module '*.svg' {
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
const ReactComponent: React.FC<React.SVGProps<SVGSVGElement> & { title?: string }>;
|
|
4
|
-
|
|
5
|
-
export default ReactComponent;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
declare module '*.module.css';
|
|
1
|
+
declare module '*.svg' {
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
const ReactComponent: React.FC<React.SVGProps<SVGSVGElement> & { title?: string }>;
|
|
4
|
+
|
|
5
|
+
export default ReactComponent;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module '*.module.css';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CanvasRenderer } from './CanvasRenderer';
|
|
2
|
+
import { CanvasSeat } from './types';
|
|
3
|
+
export interface CanvasElementEntry {
|
|
4
|
+
elementId: string | number;
|
|
5
|
+
elementType: string;
|
|
6
|
+
elementTitle: string;
|
|
7
|
+
renderer: CanvasRenderer;
|
|
8
|
+
canvas: HTMLCanvasElement;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Global registry of all canvas-rendered seat elements.
|
|
12
|
+
* MouseSeatSelector uses this to perform hit-testing on canvas elements.
|
|
13
|
+
*/
|
|
14
|
+
declare class CanvasRegistryClass {
|
|
15
|
+
private entries;
|
|
16
|
+
register(entry: CanvasElementEntry): void;
|
|
17
|
+
unregister(elementId: string | number): void;
|
|
18
|
+
/**
|
|
19
|
+
* Given a pointer position, find the canvas element under the pointer
|
|
20
|
+
* and hit-test its spatial index.
|
|
21
|
+
*/
|
|
22
|
+
hitTestAll(clientX: number, clientY: number): {
|
|
23
|
+
entry: CanvasElementEntry;
|
|
24
|
+
seat: CanvasSeat;
|
|
25
|
+
} | null;
|
|
26
|
+
/**
|
|
27
|
+
* Find the canvas element entry whose canvas contains the given point.
|
|
28
|
+
*/
|
|
29
|
+
findCanvasAt(clientX: number, clientY: number): CanvasElementEntry | null;
|
|
30
|
+
/**
|
|
31
|
+
* Query all seats within a screen-space rectangle from a specific element's canvas.
|
|
32
|
+
*/
|
|
33
|
+
queryRectInElement(elementId: string | number, screenLeft: number, screenTop: number, screenRight: number, screenBottom: number): CanvasSeat[];
|
|
34
|
+
getEntry(elementId: string | number): CanvasElementEntry | undefined;
|
|
35
|
+
getAllEntries(): CanvasElementEntry[];
|
|
36
|
+
/**
|
|
37
|
+
* Set preview-selected seat IDs on a specific element's renderer and redraw.
|
|
38
|
+
* Used during mouse drag selection to highlight seats in real-time.
|
|
39
|
+
*/
|
|
40
|
+
setPreviewSelection(elementId: string | number, ids: Set<string | number>): void;
|
|
41
|
+
/**
|
|
42
|
+
* Clear preview selection on a specific element's renderer.
|
|
43
|
+
*/
|
|
44
|
+
clearPreviewSelection(elementId: string | number): void;
|
|
45
|
+
}
|
|
46
|
+
export declare const CanvasRegistry: CanvasRegistryClass;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CanvasSeat, SeatDrawOptions } from './types';
|
|
2
|
+
import { HitTestIndex } from './HitTestIndex';
|
|
3
|
+
export declare class CanvasRenderer {
|
|
4
|
+
private canvas;
|
|
5
|
+
private ctx;
|
|
6
|
+
private dpr;
|
|
7
|
+
private logicalWidth;
|
|
8
|
+
private logicalHeight;
|
|
9
|
+
readonly hitIndex: HitTestIndex;
|
|
10
|
+
private lastSeats;
|
|
11
|
+
private lastOptions;
|
|
12
|
+
constructor(canvas: HTMLCanvasElement);
|
|
13
|
+
/**
|
|
14
|
+
* Set the logical (CSS) size of the canvas and adjust for device pixel ratio.
|
|
15
|
+
*/
|
|
16
|
+
setSize(width: number, height: number): void;
|
|
17
|
+
getLogicalSize(): {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Convert a mouse/pointer event position to local canvas coordinates.
|
|
23
|
+
*/
|
|
24
|
+
eventToLocal(clientX: number, clientY: number): {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Convert local canvas coordinates to screen (client) coordinates.
|
|
30
|
+
*/
|
|
31
|
+
localToScreen(localX: number, localY: number): {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Clear the canvas and redraw all seats.
|
|
37
|
+
*/
|
|
38
|
+
render(seats: CanvasSeat[], options: SeatDrawOptions): void;
|
|
39
|
+
/**
|
|
40
|
+
* Rebuild the hit-test index with the given seats.
|
|
41
|
+
*/
|
|
42
|
+
buildHitIndex(seats: CanvasSeat[]): void;
|
|
43
|
+
/**
|
|
44
|
+
* Full draw cycle: rebuild index + render.
|
|
45
|
+
*/
|
|
46
|
+
draw(seats: CanvasSeat[], options: SeatDrawOptions): void;
|
|
47
|
+
/**
|
|
48
|
+
* Update the preview-selected seat IDs and immediately redraw.
|
|
49
|
+
* Used by MouseSeatSelector to highlight seats during drag gestures.
|
|
50
|
+
*/
|
|
51
|
+
setPreviewSelection(ids: Set<string | number>): void;
|
|
52
|
+
getCanvas(): HTMLCanvasElement;
|
|
53
|
+
destroy(): void;
|
|
54
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CanvasSeat, HitTestResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Spatial index for efficient (x, y) -> seat lookup on canvas.
|
|
4
|
+
* Uses a flat grid approach: divide the canvas into cells, each cell
|
|
5
|
+
* contains references to seats whose bounding box overlaps it.
|
|
6
|
+
*/
|
|
7
|
+
export declare class HitTestIndex {
|
|
8
|
+
private seats;
|
|
9
|
+
private seatById;
|
|
10
|
+
private seatByCoord;
|
|
11
|
+
private cellSize;
|
|
12
|
+
private grid;
|
|
13
|
+
private boundsMinX;
|
|
14
|
+
private boundsMinY;
|
|
15
|
+
constructor(cellSize?: number);
|
|
16
|
+
clear(): void;
|
|
17
|
+
build(seats: CanvasSeat[]): void;
|
|
18
|
+
/**
|
|
19
|
+
* Find the seat at the given local (canvas) coordinates.
|
|
20
|
+
* Returns null if no seat is at that position.
|
|
21
|
+
*/
|
|
22
|
+
hitTest(localX: number, localY: number): HitTestResult | null;
|
|
23
|
+
/**
|
|
24
|
+
* Find all seats whose bounding box overlaps the given rectangle.
|
|
25
|
+
* Coordinates are in local (canvas) space.
|
|
26
|
+
*/
|
|
27
|
+
queryRect(rx: number, ry: number, rw: number, rh: number): CanvasSeat[];
|
|
28
|
+
getSeatById(id: string | number): CanvasSeat | undefined;
|
|
29
|
+
getSeatByCoord(row: number, col: number): CanvasSeat | undefined;
|
|
30
|
+
getAllSeats(): CanvasSeat[];
|
|
31
|
+
getSeatsCount(): number;
|
|
32
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CanvasSeat, SeatDrawOptions } from './types';
|
|
2
|
+
export declare function drawSeat(ctx: CanvasRenderingContext2D, seat: CanvasSeat, options: SeatDrawOptions): void;
|
|
3
|
+
export declare function drawArcWedge(ctx: CanvasRenderingContext2D, cx: number, cy: number, innerR: number, outerR: number, startDeg: number, endDeg: number, fillColor: string, hideInnerHole?: boolean): void;
|
|
4
|
+
export declare function drawArcRowBanding(ctx: CanvasRenderingContext2D, cx: number, cy: number, innerR: number, outerR: number, startDeg: number, endDeg: number, rows: number, bandColor: string): void;
|
|
5
|
+
export declare function drawTableShape(ctx: CanvasRenderingContext2D, cx: number, cy: number, width: number, height: number, shape: 0 | 1, // 0 = round, 1 = square
|
|
6
|
+
color: string): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CanvasRenderer } from './CanvasRenderer';
|
|
2
|
+
export { CanvasRegistry } from './CanvasRegistry';
|
|
3
|
+
export { HitTestIndex } from './HitTestIndex';
|
|
4
|
+
export { drawSeat, drawArcWedge, drawArcRowBanding, drawTableShape } from './SeatDrawer';
|
|
5
|
+
export { useCanvasElement } from './useCanvasElement';
|
|
6
|
+
export type { CanvasSeat, CanvasElementConfig, HitTestResult, CanvasTooltipAnchor, SeatDrawOptions, T_SeatStatus, T_IconType } from './types';
|
|
7
|
+
export type { CanvasElementEntry } from './CanvasRegistry';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { T_Seat, T_Ticket } from 'platform-calendar-helpers';
|
|
2
|
+
import { T_SeatColors } from 'helpers/constants/seatColors';
|
|
3
|
+
import { T_ElementType_SeatMap } from 'store/reducers/elementSelector/types';
|
|
4
|
+
export type T_SeatStatus = 'available' | 'locked' | 'unassigned' | 'sold';
|
|
5
|
+
export type T_IconType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
6
|
+
export interface CanvasSeat {
|
|
7
|
+
id: string | number;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
color: string;
|
|
13
|
+
iconType: T_IconType;
|
|
14
|
+
status: T_SeatStatus;
|
|
15
|
+
selected: boolean;
|
|
16
|
+
hidden: boolean;
|
|
17
|
+
accessible: boolean;
|
|
18
|
+
locked: boolean;
|
|
19
|
+
label: string;
|
|
20
|
+
displayLabel?: string;
|
|
21
|
+
seatNumber?: string | number;
|
|
22
|
+
rowLabel?: string;
|
|
23
|
+
rowIndex: number;
|
|
24
|
+
colIndex: number;
|
|
25
|
+
seat: T_Seat;
|
|
26
|
+
ticketId?: number | string;
|
|
27
|
+
filteredOut: boolean;
|
|
28
|
+
filterHighlighted: boolean;
|
|
29
|
+
rotation?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface CanvasElementConfig {
|
|
32
|
+
elementId: string | number;
|
|
33
|
+
elementType: T_ElementType_SeatMap;
|
|
34
|
+
elementTitle?: string;
|
|
35
|
+
seatSize: number;
|
|
36
|
+
seatGap: number;
|
|
37
|
+
seatColors: T_SeatColors;
|
|
38
|
+
soldSeatIds: Set<string | number>;
|
|
39
|
+
ticketIds: {
|
|
40
|
+
[key: string | number]: boolean;
|
|
41
|
+
};
|
|
42
|
+
ticketsByIds: {
|
|
43
|
+
[key: number]: T_Ticket;
|
|
44
|
+
};
|
|
45
|
+
ticketColors?: Record<string, string>;
|
|
46
|
+
isViewOnly: boolean;
|
|
47
|
+
showNumber: boolean;
|
|
48
|
+
currencySymbol: string;
|
|
49
|
+
highlightedTicketIds: string[];
|
|
50
|
+
hideTicketAssignmentColors: boolean;
|
|
51
|
+
flatNumbering?: boolean;
|
|
52
|
+
iconType: T_IconType;
|
|
53
|
+
/** When "full", displayLabel already contains "Row X, Seat Y" — tooltip should not add row/seat prefixes */
|
|
54
|
+
separator?: 'none' | 'hyphen' | 'dot' | 'space' | 'full';
|
|
55
|
+
}
|
|
56
|
+
export interface HitTestResult {
|
|
57
|
+
seatId: string | number;
|
|
58
|
+
seat: CanvasSeat;
|
|
59
|
+
screenX: number;
|
|
60
|
+
screenY: number;
|
|
61
|
+
}
|
|
62
|
+
export interface CanvasTooltipAnchor {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
}
|
|
68
|
+
export interface SeatDrawOptions {
|
|
69
|
+
hoveredSeatId: string | number | null;
|
|
70
|
+
preSelectedIds: Set<string | number>;
|
|
71
|
+
isViewOnly: boolean;
|
|
72
|
+
isEditActive: boolean;
|
|
73
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CanvasRenderer } from './CanvasRenderer';
|
|
2
|
+
import { CanvasElementConfig } from './types';
|
|
3
|
+
import { T_Seat } from 'platform-calendar-helpers';
|
|
4
|
+
interface UseCanvasElementOptions {
|
|
5
|
+
config: CanvasElementConfig;
|
|
6
|
+
seats: T_Seat[][];
|
|
7
|
+
computePosition: (rowIndex: number, colIndex: number, seat: T_Seat) => {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
rotation?: number;
|
|
11
|
+
} | null;
|
|
12
|
+
canvasWidth: number;
|
|
13
|
+
canvasHeight: number;
|
|
14
|
+
padding?: number;
|
|
15
|
+
}
|
|
16
|
+
interface UseCanvasElementReturn {
|
|
17
|
+
canvasRef: (node: HTMLCanvasElement | null) => void;
|
|
18
|
+
rendererRef: React.RefObject<CanvasRenderer | null>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Hook that manages a canvas element for rendering seats.
|
|
22
|
+
* Handles: drawing, hit-testing, tooltip, selection, hover.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useCanvasElement(options: UseCanvasElementOptions): UseCanvasElementReturn;
|
|
25
|
+
export {};
|
|
@@ -8,6 +8,8 @@ import { T_NumberingConfig } from 'helpers/constants/numberingStyles';
|
|
|
8
8
|
type T_Props = {
|
|
9
9
|
config: Partial<T_NumberingConfig>;
|
|
10
10
|
onChange: (config: Partial<T_NumberingConfig>) => void;
|
|
11
|
+
/** Hide the "Include row prefix" option (e.g. for arc section which uses full format) */
|
|
12
|
+
hideRowPrefix?: boolean;
|
|
11
13
|
};
|
|
12
14
|
declare const NumberingSettings: FC<T_Props>;
|
|
13
15
|
export { NumberingSettings };
|
|
@@ -18,4 +18,6 @@ export interface T_SeatTooltipData {
|
|
|
18
18
|
currencySymbol?: string;
|
|
19
19
|
/** When true, rows are irrelevant — don't show row info in the tooltip */
|
|
20
20
|
flatNumbering?: boolean;
|
|
21
|
+
/** When "full", label already contains "Row X, Seat Y" — never show row separately or add prefixes */
|
|
22
|
+
separator?: 'none' | 'hyphen' | 'dot' | 'space' | 'full';
|
|
21
23
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { T_SeatTooltipData } from './SeatTooltip';
|
|
3
|
+
type T_TooltipAnchor = HTMLElement | {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
};
|
|
3
9
|
type T_TooltipAPI = {
|
|
4
|
-
show: (data: T_SeatTooltipData,
|
|
10
|
+
show: (data: T_SeatTooltipData, anchor: T_TooltipAnchor) => void;
|
|
5
11
|
hide: () => void;
|
|
6
12
|
};
|
|
7
13
|
export declare const useSeatTooltip: () => T_TooltipAPI;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { T_Seat, T_SeatMap, T_Element_ArcSection } from 'platform-calendar-helpers';
|
|
1
|
+
import { T_Seat, T_SeatMap, T_Element, T_Element_ArcSection } from 'platform-calendar-helpers';
|
|
2
|
+
import { T_Element_Aisle } from 'helpers/types/aisle';
|
|
2
3
|
import { T_SelectedSeats } from 'store/reducers/elementSelector/types';
|
|
3
4
|
declare const removeFakeElementsFromSeatMap: (_seatMap: T_SeatMap) => {
|
|
4
5
|
elements: {
|
|
@@ -14,6 +15,7 @@ declare const removeFakeElementsFromSeatMap: (_seatMap: T_SeatMap) => {
|
|
|
14
15
|
name: string;
|
|
15
16
|
backgroundColor?: string;
|
|
16
17
|
seatSize?: number;
|
|
18
|
+
zoomMode?: "buttons" | "wheel" | "both";
|
|
17
19
|
};
|
|
18
20
|
declare const addFakeElementsToSeatMap: (_seatMap: T_SeatMap) => T_SeatMap;
|
|
19
21
|
/**
|
|
@@ -33,6 +35,14 @@ declare const getArcSectionBoundingBox: (arc: T_Element_ArcSection, seatSize?: n
|
|
|
33
35
|
* (Previously this set locked:true on sold seats, which then got copied on paste/duplicate.)
|
|
34
36
|
*/
|
|
35
37
|
declare const disableSoldSeats: (seatMap: T_SeatMap, _soldSeats: T_Seat[]) => T_SeatMap;
|
|
38
|
+
/**
|
|
39
|
+
* Estimates the bounding box size of an element based on its type and properties.
|
|
40
|
+
* Uses heuristics since exact rendered size depends on DOM — this is intentionally approximate.
|
|
41
|
+
*/
|
|
42
|
+
declare const estimateElementSize: (element: T_Element | T_Element_Aisle, elementType: string) => {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
36
46
|
type T_GetElementInitialPositionParams = {
|
|
37
47
|
sceneCoords: {
|
|
38
48
|
x: number;
|
|
@@ -66,4 +76,4 @@ declare const getElementInitialPosition: (params: T_GetElementInitialPositionPar
|
|
|
66
76
|
* @returns true if the element has sold seats, false otherwise
|
|
67
77
|
*/
|
|
68
78
|
declare const hasSoldSeats: (elementId: string | number, elementType: "tables" | "seatingGroup" | "arcSection", soldSeats: T_SelectedSeats[keyof T_SelectedSeats][]) => boolean;
|
|
69
|
-
export { removeFakeElementsFromSeatMap, addFakeElementsToSeatMap, getElementInitialPosition, getArcSectionBoundingBox, disableSoldSeats, hasSoldSeats };
|
|
79
|
+
export { removeFakeElementsFromSeatMap, addFakeElementsToSeatMap, getElementInitialPosition, getArcSectionBoundingBox, estimateElementSize, disableSoldSeats, hasSoldSeats };
|
|
@@ -102,15 +102,17 @@ export type T_Statistics = {
|
|
|
102
102
|
soldCount: number;
|
|
103
103
|
availableCount: number;
|
|
104
104
|
unassignedCount: number;
|
|
105
|
+
assignedCount: number;
|
|
105
106
|
lockedCount: number;
|
|
106
107
|
hiddenCount: number;
|
|
107
108
|
occupancyPercentage: number;
|
|
108
109
|
};
|
|
109
110
|
/**
|
|
110
|
-
* Calculate detailed seat statistics (unassigned, locked, hidden counts)
|
|
111
|
+
* Calculate detailed seat statistics (unassigned, assigned, locked, hidden counts)
|
|
111
112
|
*/
|
|
112
113
|
export declare const calculateDetailedStatistics: (seatMap: T_SeatMap, soldSeats: T_SelectedSeats[keyof T_SelectedSeats][], tickets?: T_Ticket[]) => {
|
|
113
114
|
unassignedCount: number;
|
|
115
|
+
assignedCount: number;
|
|
114
116
|
lockedCount: number;
|
|
115
117
|
hiddenCount: number;
|
|
116
118
|
};
|