@alisaitteke/seatmap-canvas 2.0.0
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/.eslintrc.json +15 -0
- package/.github/FUNDING.yml +4 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/workflows/codeql-analysis.yml +29 -0
- package/.github/workflows/npm-publish-packages.yml +35 -0
- package/.github/workflows/webpack.yml +22 -0
- package/AUTHORS +3 -0
- package/LICENSE +21 -0
- package/README.md +160 -0
- package/SECURITY.md +21 -0
- package/_config.yml +1 -0
- package/assets/banner_ui.png +0 -0
- package/assets/bn.jpg +0 -0
- package/assets/logo.jpg +0 -0
- package/assets/logo_small.jpg +0 -0
- package/assets/zoom_out.svg +11 -0
- package/examples/basic/bootstrap.min.css +7 -0
- package/examples/basic/index.html +201 -0
- package/examples/basic/jquery.min.js +2 -0
- package/examples/data/data.json +70007 -0
- package/examples/data/small.json +1307 -0
- package/examples/data/tiny.json +119 -0
- package/examples/old/index.html +262 -0
- package/package.json +59 -0
- package/src/lib/canvas.index.ts +122 -0
- package/src/lib/config.ts +11 -0
- package/src/lib/decorators/dom.ts +40 -0
- package/src/lib/decorators/index.ts +6 -0
- package/src/lib/dev.tools.ts +18 -0
- package/src/lib/enums/global.ts +67 -0
- package/src/lib/models/block.model.ts +170 -0
- package/src/lib/models/coordinate.model.ts +43 -0
- package/src/lib/models/data.model.ts +105 -0
- package/src/lib/models/defaults.model.ts +125 -0
- package/src/lib/models/global.model.ts +24 -0
- package/src/lib/models/label.model.ts +58 -0
- package/src/lib/models/legend.model.ts +56 -0
- package/src/lib/models/model.base.ts +32 -0
- package/src/lib/models/seat.model.ts +182 -0
- package/src/lib/svg/event.manager.ts +56 -0
- package/src/lib/svg/legend/legend.circle.ts +28 -0
- package/src/lib/svg/legend/legend.item.ts +50 -0
- package/src/lib/svg/legend/legend.title.ts +27 -0
- package/src/lib/svg/legend.ts +55 -0
- package/src/lib/svg/stage/blocks/block-item/block-item.bounds.ts +51 -0
- package/src/lib/svg/stage/blocks/block-item/block-item.index.ts +173 -0
- package/src/lib/svg/stage/blocks/block-item/block-item.info.index.ts +38 -0
- package/src/lib/svg/stage/blocks/block-item/block-item.labels.index.ts +41 -0
- package/src/lib/svg/stage/blocks/block-item/block-item.mask.ts +67 -0
- package/src/lib/svg/stage/blocks/block-item/block-item.seats.index.ts +81 -0
- package/src/lib/svg/stage/blocks/block-item/bound/bound-item.index.ts +43 -0
- package/src/lib/svg/stage/blocks/block-item/info/title.ts +30 -0
- package/src/lib/svg/stage/blocks/block-item/label/label-item.circle.ts +27 -0
- package/src/lib/svg/stage/blocks/block-item/label/label-item.index.ts +46 -0
- package/src/lib/svg/stage/blocks/block-item/label/label-item.title.ts +27 -0
- package/src/lib/svg/stage/blocks/block-item/seat/seat-item.check.ts +45 -0
- package/src/lib/svg/stage/blocks/block-item/seat/seat-item.circle.ts +30 -0
- package/src/lib/svg/stage/blocks/block-item/seat/seat-item.index.ts +159 -0
- package/src/lib/svg/stage/blocks/block-item/seat/seat-item.title.ts +27 -0
- package/src/lib/svg/stage/blocks/blocks.index.ts +68 -0
- package/src/lib/svg/stage/blocks.search-circle.ts +86 -0
- package/src/lib/svg/stage/multi-select/rect.ts +36 -0
- package/src/lib/svg/stage/multi-select.ts +107 -0
- package/src/lib/svg/stage/search-circle/circle.ts +37 -0
- package/src/lib/svg/stage/stage.index.ts +41 -0
- package/src/lib/svg/svg.base.ts +217 -0
- package/src/lib/svg/svg.index.ts +76 -0
- package/src/lib/svg/tooltip/rect.ts +66 -0
- package/src/lib/svg/tooltip/title.ts +57 -0
- package/src/lib/svg/tooltip.ts +92 -0
- package/src/lib/svg/zoom-out.bg.ts +35 -0
- package/src/lib/svg/zoom.manager.ts +440 -0
- package/src/lib/window.manager.ts +40 -0
- package/src/scss/lib.scss +10 -0
- package/src/scss/style.scss +221 -0
- package/tsconfig.json +28 -0
- package/webpack.environments/development.js +58 -0
- package/webpack.environments/production.js +52 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
enum BLOCK_EVENT {
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export enum EventType {
|
|
12
|
+
ADD_BLOCK = "BLOCK.ADD",
|
|
13
|
+
REMOVE_BLOCK = "BLOCK.REMOVE",
|
|
14
|
+
CLICK_BLOCK = "BLOCK.CLICK",
|
|
15
|
+
MOUSEENTER_BLOCK = "BLOCK.MOUSEENTER",
|
|
16
|
+
TOUCHSTART_BLOCK = "BLOCK.TOUCHSTART",
|
|
17
|
+
MOUSEDOWN_BLOCK = "BLOCK.MOUSEDOWN",
|
|
18
|
+
MOUSEUP_BLOCK = "BLOCK.MOUSEUP",
|
|
19
|
+
MOUSEMOVE_BLOCK = "BLOCK.MOUSEMOVE",
|
|
20
|
+
MOUSELEAVE_BLOCK = "BLOCK.MOUSELEAVE",
|
|
21
|
+
UPDATE_BLOCK = "BLOCK.UPDATE",
|
|
22
|
+
CLICK_SEAT = "SEAT.CLICK",
|
|
23
|
+
TOUCHSTART_SEAT = "SEAT.TOUCHSTART",
|
|
24
|
+
MOUSEMOVE_SEAT = "SEAT.MOUSEMOVE",
|
|
25
|
+
MOUSEDOWN_SEAT = "SEAT.MOUSEDOWN",
|
|
26
|
+
MOUSEENTER_SEAT = "SEAT.MOUSEENTER",
|
|
27
|
+
MOUSELEAVE_SEAT = "SEAT.MOUSELEAVE",
|
|
28
|
+
MOUSEOUT_SEAT = "SEAT.MOUSEOUT",
|
|
29
|
+
ADD_SEAT = "SEAT.ADD",
|
|
30
|
+
REMOVE_SEAT = "SEAT.REMOVE",
|
|
31
|
+
ZOOM_LEVEL_CHANGE = "ZOOM_LEVEL_CHANGE",
|
|
32
|
+
BOUND_CLICK = "BOUND.CLICK",
|
|
33
|
+
|
|
34
|
+
MOUSE_MOVE = "MOUSE.MOVE",
|
|
35
|
+
|
|
36
|
+
RESIZE_WINDOW = "WINDOW.RESIZE",
|
|
37
|
+
|
|
38
|
+
CLICK_ZOOMOUT = "ZOOM-OUT-BG.CLICK",
|
|
39
|
+
MOUSEMOVE_ZOOMOUT = "ZOOM-OUT-BG.MOUSEMOVE",
|
|
40
|
+
|
|
41
|
+
KEYDOWN_SVG = "KEYDOWN.SEATMAP-SVG",
|
|
42
|
+
KEYUP_SVG = "KEYUP.SEATMAP-SVG",
|
|
43
|
+
|
|
44
|
+
MULTI_SELECT_ENABLE = "MULTI_SELECT_ENABLE",
|
|
45
|
+
MULTI_SELECT_DISABLE = "MULTI_SELECT_DISABLE",
|
|
46
|
+
|
|
47
|
+
BEST_AVAILABLE_ENABLE = "BEST_AVAILABLE_ENABLE",
|
|
48
|
+
MBEST_AVAILABLE_DISABLE = "MBEST_AVAILABLE_DISABLE",
|
|
49
|
+
|
|
50
|
+
READY = "READY"
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export enum ZoomLevel {
|
|
55
|
+
VENUE = "VENUE",
|
|
56
|
+
BLOCK = "BLOCK",
|
|
57
|
+
SEAT = "SEAT"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export enum SeatAction {
|
|
61
|
+
HOVER = "hover",
|
|
62
|
+
FOCUS = "focus",
|
|
63
|
+
LEAVE = "leave",
|
|
64
|
+
SELECT = "select",
|
|
65
|
+
NORMAL = "normal"
|
|
66
|
+
|
|
67
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import SeatModel from "./seat.model";
|
|
8
|
+
import LabelModel from "./label.model";
|
|
9
|
+
import ModelBase from "./model.base";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export default class BlockModel extends ModelBase {
|
|
13
|
+
private _id: string;
|
|
14
|
+
private _seats: Array<SeatModel>;
|
|
15
|
+
private _labels: Array<LabelModel>;
|
|
16
|
+
private _title: String;
|
|
17
|
+
private _bounds: any;
|
|
18
|
+
private _width: number;
|
|
19
|
+
private _height: number;
|
|
20
|
+
private _x: number;
|
|
21
|
+
private _y: number;
|
|
22
|
+
private _color: string;
|
|
23
|
+
private _border_color: string;
|
|
24
|
+
private _bbox: any;
|
|
25
|
+
private _zoom_bbox: any;
|
|
26
|
+
|
|
27
|
+
constructor(item: any) {
|
|
28
|
+
super();
|
|
29
|
+
this.id = item.id ? item.id : (Math.random() * 1000).toString();
|
|
30
|
+
this.width = item.width || null;
|
|
31
|
+
this.height = item.height || null;
|
|
32
|
+
this.x = item.x || null;
|
|
33
|
+
this.y = item.y || null;
|
|
34
|
+
this.bounds = item._bounds || [];
|
|
35
|
+
this.color = item.color || "#f1f1f1";
|
|
36
|
+
this.border_color = item.border_color || "#f1f1f1";
|
|
37
|
+
this.title = item.title;
|
|
38
|
+
|
|
39
|
+
this.labels = item.labels.map((item: any) => {
|
|
40
|
+
item.block = this;
|
|
41
|
+
return new LabelModel(item);
|
|
42
|
+
}) || [];
|
|
43
|
+
|
|
44
|
+
this.seats = item.seats.map((item: any) => {
|
|
45
|
+
item.block = this;
|
|
46
|
+
let seat:SeatModel = new SeatModel(item);
|
|
47
|
+
return seat;
|
|
48
|
+
}) || [];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
get seats(): Array<SeatModel> {
|
|
52
|
+
return this._seats;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
set seats(value: Array<SeatModel>) {
|
|
56
|
+
this._seats = value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get labels(): Array<LabelModel> {
|
|
60
|
+
return this._labels;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
set labels(value: Array<LabelModel>) {
|
|
64
|
+
this._labels = value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
get title(): String {
|
|
68
|
+
return this._title;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
set title(value: String) {
|
|
72
|
+
this._title = value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get bounds(): any {
|
|
76
|
+
return this._bounds;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
set bounds(value: any) {
|
|
80
|
+
this._bounds = value;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
get width(): number {
|
|
84
|
+
return this._width;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
set width(value: number) {
|
|
88
|
+
this._width = value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get height(): number {
|
|
92
|
+
return this._height;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
set height(value: number) {
|
|
96
|
+
this._height = value;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get x(): number {
|
|
100
|
+
return this._x;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
set x(value: number) {
|
|
104
|
+
this._x = value;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
get y(): number {
|
|
108
|
+
return this._y;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
set y(value: number) {
|
|
112
|
+
this._y = value;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
get id(): string {
|
|
116
|
+
return this._id;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
set id(value: string) {
|
|
120
|
+
this._id = value;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
get color(): string {
|
|
124
|
+
return this._color;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
set color(value: string) {
|
|
128
|
+
this._color = value;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
get border_color(): string {
|
|
133
|
+
return this._border_color;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
set border_color(value: string) {
|
|
137
|
+
this._border_color = value;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
get bbox(): any {
|
|
142
|
+
return this._bbox;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
set bbox(value: any) {
|
|
146
|
+
this._bbox = value;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
get zoom_bbox(): any {
|
|
151
|
+
return this._zoom_bbox;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
set zoom_bbox(value: any) {
|
|
155
|
+
this._zoom_bbox = value;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
toJson() {
|
|
159
|
+
return {
|
|
160
|
+
id: this.id,
|
|
161
|
+
title: this.title,
|
|
162
|
+
x: this.x,
|
|
163
|
+
y: this.y,
|
|
164
|
+
color: this.color,
|
|
165
|
+
width: this.width,
|
|
166
|
+
height: this.height
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class CoordinateModel {
|
|
8
|
+
|
|
9
|
+
private _x: number;
|
|
10
|
+
private _y: number;
|
|
11
|
+
|
|
12
|
+
constructor(item?: any) {
|
|
13
|
+
this.x = item.x || 0;
|
|
14
|
+
this.y = item.y || 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toArray() {
|
|
18
|
+
return [this.x, this.y];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
get x(): number {
|
|
23
|
+
return this._x;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set x(value: number) {
|
|
27
|
+
this._x = value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get y(): number {
|
|
31
|
+
return this._y;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set y(value: number) {
|
|
35
|
+
this._y = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
toJson() {
|
|
39
|
+
return {}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import BlockModel from "./block.model";
|
|
8
|
+
import {EventType} from "../enums/global";
|
|
9
|
+
import EventManager from "../svg/event.manager";
|
|
10
|
+
import {SeatMapCanvas} from "../canvas.index";
|
|
11
|
+
import {SeatItem} from "../svg/stage/blocks/block-item/seat/seat-item.index";
|
|
12
|
+
import SeatModel from "./seat.model";
|
|
13
|
+
|
|
14
|
+
interface BlockQuery {
|
|
15
|
+
id?: number | string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default class DataModel {
|
|
19
|
+
private blocks: Array<BlockModel>;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
private eventManager: EventManager;
|
|
23
|
+
public addEventListener: any;
|
|
24
|
+
|
|
25
|
+
constructor(private _self: SeatMapCanvas) {
|
|
26
|
+
this.blocks = [];
|
|
27
|
+
this.eventManager = _self.eventManager;
|
|
28
|
+
this.addEventListener = _self.eventManager.addEventListener;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public addBlock(block_data: any): this {
|
|
32
|
+
this.blocks.push(new BlockModel(block_data));
|
|
33
|
+
this.eventManager.dispatch(EventType.ADD_BLOCK, [block_data]);
|
|
34
|
+
this.eventManager.dispatch(EventType.UPDATE_BLOCK, this.blocks);
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public addBulkBlock(block_data: Array<BlockModel>): this {
|
|
39
|
+
block_data.map((item: any) => {
|
|
40
|
+
this.blocks.push(new BlockModel(item));
|
|
41
|
+
});
|
|
42
|
+
this.eventManager.dispatch(EventType.ADD_BLOCK, [block_data]);
|
|
43
|
+
this.eventManager.dispatch(EventType.UPDATE_BLOCK, this.blocks);
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public replaceData(block_data: Array<any>): this {
|
|
48
|
+
this.blocks = [];
|
|
49
|
+
this.addBulkBlock(block_data);
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public getBlock(id: string | number): BlockModel {
|
|
54
|
+
return this.blocks.find((item: BlockModel) => item.id === id);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public getBlocks(blockId?: string): Array<BlockModel> {
|
|
58
|
+
if (blockId)
|
|
59
|
+
return [this.getBlock(blockId)];
|
|
60
|
+
return this.blocks;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public removeBlock(id: string | number): this {
|
|
64
|
+
this.filterBlock({id: id}).map((item: BlockModel, index: number) => {
|
|
65
|
+
this.blocks.splice(index, 1);
|
|
66
|
+
});
|
|
67
|
+
this.eventManager.dispatch(EventType.REMOVE_BLOCK, id);
|
|
68
|
+
this.eventManager.dispatch(EventType.UPDATE_BLOCK, this.blocks);
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public getSeat(seatId: string | number, blockId: string | number): SeatModel {
|
|
73
|
+
let block: BlockModel = this.getBlock(blockId);
|
|
74
|
+
if (block) {
|
|
75
|
+
return block.seats.find(seat => seat.id == seatId)
|
|
76
|
+
} else {
|
|
77
|
+
console.error(new Error('Block not found!'));
|
|
78
|
+
new Error('Block not found')
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public getSelectedSeats(blockId?: string): Array<SeatModel> {
|
|
84
|
+
let blocks = this.getBlocks(blockId);
|
|
85
|
+
let selectedSeats: Array<SeatModel> = [];
|
|
86
|
+
blocks.forEach((item: BlockModel) => {
|
|
87
|
+
item.seats.forEach(seatItem => {
|
|
88
|
+
if (seatItem.selected)
|
|
89
|
+
selectedSeats.push(seatItem)
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
return selectedSeats;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public filterBlock(query: BlockQuery): Array<BlockModel> {
|
|
96
|
+
return this.blocks.filter((item: BlockModel) => item.id === query.id)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
toJson() {
|
|
101
|
+
return {
|
|
102
|
+
blocks: this.blocks
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// @todo legend show hide function
|
|
8
|
+
|
|
9
|
+
export default class DefaultsModel {
|
|
10
|
+
min_zoom: number = 0.1;
|
|
11
|
+
max_zoom: number = 1.9;
|
|
12
|
+
animation_speed: number = 600;
|
|
13
|
+
resizable: boolean = false;
|
|
14
|
+
container: any = null;
|
|
15
|
+
zoom_focus_circle_radius: number = 60;
|
|
16
|
+
click_enable_sold_seats: boolean = false;
|
|
17
|
+
zoom_out_button: string = null;
|
|
18
|
+
legend_show: boolean = false;
|
|
19
|
+
canvas_stageout_control: boolean = true;
|
|
20
|
+
seat_style: {
|
|
21
|
+
radius: number,
|
|
22
|
+
color: string,
|
|
23
|
+
not_salable: string,
|
|
24
|
+
selected: string,
|
|
25
|
+
hover: string,
|
|
26
|
+
focus: string,
|
|
27
|
+
focus_out: string,
|
|
28
|
+
check_color: string
|
|
29
|
+
};
|
|
30
|
+
block_style: {
|
|
31
|
+
fill: string
|
|
32
|
+
stroke: string,
|
|
33
|
+
border_width: number,
|
|
34
|
+
title_color: string,
|
|
35
|
+
title_font_size: string
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
legend_style: {
|
|
39
|
+
radius: number,
|
|
40
|
+
padding: number,
|
|
41
|
+
font_size: number
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
label_style: {
|
|
45
|
+
color: string
|
|
46
|
+
bg: string
|
|
47
|
+
font_size: number
|
|
48
|
+
radius: number
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
tooltip_style: {
|
|
52
|
+
border_width: string,
|
|
53
|
+
width: number,
|
|
54
|
+
height: number,
|
|
55
|
+
color: string,
|
|
56
|
+
bg: string
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
lang: {
|
|
60
|
+
selectable: string,
|
|
61
|
+
non_selectable: string,
|
|
62
|
+
your_selection: string
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
constructor(config: any) {
|
|
66
|
+
|
|
67
|
+
this.zoom_focus_circle_radius = config.zoom_focus_circle_radius ? config.zoom_focus_circle_radius : this.zoom_focus_circle_radius;
|
|
68
|
+
this.click_enable_sold_seats = config.click_enable_sold_seats ? config.click_enable_sold_seats : this.click_enable_sold_seats;
|
|
69
|
+
this.max_zoom = config.max_zoom ? config.max_zoom : this.max_zoom;
|
|
70
|
+
|
|
71
|
+
this.resizable = config.resizable ? config.resizable : this.resizable;
|
|
72
|
+
this.zoom_out_button = config.zoom_out_button ? config.zoom_out_button : ".zoom-out-button";
|
|
73
|
+
this.legend_show = config.legend_show == false ? config.legend_show : true;
|
|
74
|
+
this.canvas_stageout_control = config.canvas_stageout_control == false ? config.canvas_stageout_control : true;
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
this.seat_style = {
|
|
78
|
+
radius: config.seat_style && config.seat_style.radius || 12,
|
|
79
|
+
color: config.seat_style && config.seat_style.color || "#77b2ff",
|
|
80
|
+
not_salable: config.seat_style && config.seat_style.not_salable || "#ccc9c9",
|
|
81
|
+
selected: config.seat_style && config.seat_style.selected || "#51ff48",
|
|
82
|
+
hover: config.seat_style && config.seat_style.hover || "#4770ff",
|
|
83
|
+
focus: config.seat_style && config.seat_style.focus || "#6293d2",
|
|
84
|
+
focus_out: config.seat_style && config.seat_style.focus_out || "#ff001c",
|
|
85
|
+
check_color: config.seat_style && config.seat_style.check_color || "#ffffff",
|
|
86
|
+
};
|
|
87
|
+
this.block_style = {
|
|
88
|
+
fill: config.block_style && config.block_style.fill || "#ffffff",
|
|
89
|
+
stroke: config.block_style && config.block_style.stroke || "#ffffff",
|
|
90
|
+
border_width: config.block_style && config.block_style.border_width || 4,
|
|
91
|
+
title_color: config.block_style && config.block_style.title_color || "#000000",
|
|
92
|
+
title_font_size: config.block_style && config.block_style.title_font_size || 28,
|
|
93
|
+
};
|
|
94
|
+
this.label_style = {
|
|
95
|
+
color: config.label_style && config.label_style.color || "#000000",
|
|
96
|
+
bg: config.label_style && config.label_style.bg || "#ffffff",
|
|
97
|
+
font_size: config.label_style && config.label_style.font_size || 12,
|
|
98
|
+
radius: config.label_style && config.label_style.radius || 12,
|
|
99
|
+
};
|
|
100
|
+
this.legend_style = {
|
|
101
|
+
radius: config.legend_style && config.legend_style.radius || 12,
|
|
102
|
+
padding: config.legend_style && config.legend_style.padding || 36,
|
|
103
|
+
font_size: config.legend_style && config.legend_style.font_size || 100,
|
|
104
|
+
};
|
|
105
|
+
this.tooltip_style = {
|
|
106
|
+
border_width: config.tooltip_style && config.tooltip_style.border_width || 1,
|
|
107
|
+
width: config.tooltip_style && config.tooltip_style.width || 140,
|
|
108
|
+
height: config.tooltip_style && config.tooltip_style.height || 58,
|
|
109
|
+
color: config.tooltip_style && config.tooltip_style.color || "#000000",
|
|
110
|
+
bg: config.tooltip_style && config.tooltip_style.bg || "#ffffff"
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
this.lang = {
|
|
114
|
+
selectable: config.lang && config.lang.selectable || "Selectable",
|
|
115
|
+
non_selectable: config.lang && config.lang.non_selectable || "Non Selectable or Rezerved",
|
|
116
|
+
your_selection: config.lang && config.lang.your_selection || "Your Selection",
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
getAll(): this {
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import DefaultsModel from "./defaults.model";
|
|
7
|
+
import DataModel from "./data.model";
|
|
8
|
+
import {SeatMapCanvas} from "../canvas.index";
|
|
9
|
+
import ZoomManager from "../svg/zoom.manager";
|
|
10
|
+
import EventManager from "../svg/event.manager";
|
|
11
|
+
import Svg from "../svg/svg.index";
|
|
12
|
+
import WindowManager from "../window.manager";
|
|
13
|
+
|
|
14
|
+
export interface GlobalModel {
|
|
15
|
+
config: DefaultsModel,
|
|
16
|
+
eventManager: EventManager,
|
|
17
|
+
windowManager:WindowManager,
|
|
18
|
+
data: DataModel,
|
|
19
|
+
root: SeatMapCanvas,
|
|
20
|
+
zoomManager: ZoomManager,
|
|
21
|
+
svg:Svg,
|
|
22
|
+
multi_select:boolean,
|
|
23
|
+
best_available:boolean
|
|
24
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
import BlockModel from "./block.model";
|
|
9
|
+
import ModelBase from "./model.base";
|
|
10
|
+
|
|
11
|
+
export default class LabelModel extends ModelBase {
|
|
12
|
+
private _x: number;
|
|
13
|
+
private _y: number;
|
|
14
|
+
private _title: string;
|
|
15
|
+
|
|
16
|
+
private _block: BlockModel;
|
|
17
|
+
|
|
18
|
+
constructor(item: any) {
|
|
19
|
+
super();
|
|
20
|
+
this.x = item.x;
|
|
21
|
+
this.y = item.y;
|
|
22
|
+
this.title = item.title;
|
|
23
|
+
this.block = item.block;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
get x(): number {
|
|
28
|
+
return this._x;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
set x(value: number) {
|
|
32
|
+
this._x = value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
get y(): number {
|
|
36
|
+
return this._y;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
set y(value: number) {
|
|
40
|
+
this._y = value;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get title(): string {
|
|
44
|
+
return this._title;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
set title(value: string) {
|
|
48
|
+
this._title = value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
get block(): BlockModel {
|
|
52
|
+
return this._block;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
set block(value: BlockModel) {
|
|
56
|
+
this._block = value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
import ModelBase from "./model.base";
|
|
9
|
+
|
|
10
|
+
export default class LegendModel extends ModelBase {
|
|
11
|
+
private _x: number;
|
|
12
|
+
private _y: number;
|
|
13
|
+
private _title: string;
|
|
14
|
+
private _color:string;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
constructor(item: any) {
|
|
18
|
+
super();
|
|
19
|
+
this.x = item.x;
|
|
20
|
+
this.y = item.y;
|
|
21
|
+
this.title = item.title;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
get x(): number {
|
|
26
|
+
return this._x;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
set x(value: number) {
|
|
30
|
+
this._x = value;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get y(): number {
|
|
34
|
+
return this._y;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
set y(value: number) {
|
|
38
|
+
this._y = value;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get title(): string {
|
|
42
|
+
return this._title;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
set title(value: string) {
|
|
46
|
+
this._title = value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get color(): string {
|
|
50
|
+
return this._color;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
set color(value: string) {
|
|
54
|
+
this._color = value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $project.fileName
|
|
3
|
+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default class ModelBase {
|
|
7
|
+
private _child_index: number = null;
|
|
8
|
+
private _item_type: string;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
get child_index(): number {
|
|
17
|
+
return this._child_index;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
set child_index(value: number) {
|
|
21
|
+
this._child_index = value;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
get item_type(): string {
|
|
26
|
+
return this._item_type;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
set item_type(value: string) {
|
|
30
|
+
this._item_type = value;
|
|
31
|
+
}
|
|
32
|
+
}
|