@alisaitteke/seatmap-canvas 2.3.0 → 2.4.2

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 (194) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE +1 -1
  3. package/README.md +15 -5
  4. package/dist/cjs/seatmap.canvas.css +151 -0
  5. package/dist/cjs/seatmap.canvas.js +40 -0
  6. package/dist/cjs/seatmap.canvas.js.map +1 -0
  7. package/dist/cjs/types/canvas.index.browser.d.ts +2 -0
  8. package/dist/cjs/types/canvas.index.d.ts +23 -0
  9. package/dist/cjs/types/config.d.ts +3 -0
  10. package/dist/cjs/types/decorators/dom.d.ts +8 -0
  11. package/dist/cjs/types/decorators/index.d.ts +1 -0
  12. package/dist/cjs/types/dev.tools.d.ts +6 -0
  13. package/{src/lib/enums/global.ts → dist/cjs/types/enums/global.d.ts} +4 -25
  14. package/dist/cjs/types/models/block.model.d.ts +29 -0
  15. package/dist/cjs/types/models/coordinate.model.d.ts +7 -0
  16. package/dist/cjs/types/models/data.model.d.ts +26 -0
  17. package/dist/cjs/types/models/defaults.model.d.ts +32 -0
  18. package/dist/cjs/types/models/global.model.d.ts +18 -0
  19. package/dist/cjs/types/models/label.model.d.ts +9 -0
  20. package/dist/cjs/types/models/legend.model.d.ts +8 -0
  21. package/dist/cjs/types/models/model.base.d.ts +5 -0
  22. package/dist/cjs/types/models/seat.model.d.ts +40 -0
  23. package/dist/cjs/types/models/styles/block.style.d.ts +7 -0
  24. package/dist/cjs/types/models/styles/label.style.d.ts +6 -0
  25. package/dist/cjs/types/models/styles/legend.style.d.ts +6 -0
  26. package/dist/cjs/types/models/styles/seat.style.d.ts +12 -0
  27. package/dist/cjs/types/models/styles/tooltip.style.d.ts +7 -0
  28. package/dist/cjs/types/svg/event.manager.d.ts +12 -0
  29. package/dist/cjs/types/svg/legend/legend.circle.d.ts +7 -0
  30. package/dist/cjs/types/svg/legend/legend.item.d.ts +13 -0
  31. package/dist/cjs/types/svg/legend/legend.title.d.ts +7 -0
  32. package/dist/cjs/types/svg/legend.d.ts +8 -0
  33. package/dist/cjs/types/svg/stage/blocks/block-item/block-item.bounds.d.ts +12 -0
  34. package/dist/cjs/types/svg/stage/blocks/block-item/block-item.index.d.ts +23 -0
  35. package/dist/cjs/types/svg/stage/blocks/block-item/block-item.info.index.d.ts +11 -0
  36. package/dist/cjs/types/svg/stage/blocks/block-item/block-item.labels.index.d.ts +11 -0
  37. package/dist/cjs/types/svg/stage/blocks/block-item/block-item.mask.d.ts +12 -0
  38. package/dist/cjs/types/svg/stage/blocks/block-item/block-item.seats.index.d.ts +15 -0
  39. package/dist/cjs/types/svg/stage/blocks/block-item/bound/bound-item.index.d.ts +12 -0
  40. package/dist/cjs/types/svg/stage/blocks/block-item/info/title.d.ts +7 -0
  41. package/dist/cjs/types/svg/stage/blocks/block-item/label/label-item.circle.d.ts +7 -0
  42. package/dist/cjs/types/svg/stage/blocks/block-item/label/label-item.index.d.ts +13 -0
  43. package/dist/cjs/types/svg/stage/blocks/block-item/label/label-item.title.d.ts +7 -0
  44. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.check.d.ts +10 -0
  45. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.circle.d.ts +7 -0
  46. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +28 -0
  47. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.title.d.ts +7 -0
  48. package/dist/cjs/types/svg/stage/blocks/blocks.index.d.ts +13 -0
  49. package/dist/cjs/types/svg/stage/blocks.search-circle.d.ts +12 -0
  50. package/dist/cjs/types/svg/stage/multi-select/rect.d.ts +7 -0
  51. package/dist/cjs/types/svg/stage/multi-select.d.ts +13 -0
  52. package/dist/cjs/types/svg/stage/search-circle/circle.d.ts +7 -0
  53. package/dist/cjs/types/svg/stage/stage.index.d.ts +11 -0
  54. package/dist/cjs/types/svg/svg.base.d.ts +35 -0
  55. package/dist/cjs/types/svg/svg.index.d.ts +16 -0
  56. package/dist/cjs/types/svg/tooltip/rect.d.ts +8 -0
  57. package/dist/cjs/types/svg/tooltip/title.d.ts +10 -0
  58. package/dist/cjs/types/svg/tooltip.d.ts +15 -0
  59. package/dist/cjs/types/svg/zoom-out.bg.d.ts +7 -0
  60. package/dist/cjs/types/svg/zoom.manager.d.ts +41 -0
  61. package/dist/cjs/types/window.manager.d.ts +9 -0
  62. package/dist/dependencies.txt +849 -0
  63. package/dist/esm/seatmap.canvas.css +151 -0
  64. package/dist/esm/seatmap.canvas.js +16 -0
  65. package/dist/esm/seatmap.canvas.js.map +1 -0
  66. package/dist/esm/types/canvas.index.browser.d.ts +2 -0
  67. package/dist/esm/types/canvas.index.d.ts +23 -0
  68. package/dist/esm/types/config.d.ts +3 -0
  69. package/dist/esm/types/decorators/dom.d.ts +8 -0
  70. package/dist/esm/types/decorators/index.d.ts +1 -0
  71. package/dist/esm/types/dev.tools.d.ts +6 -0
  72. package/dist/esm/types/enums/global.d.ts +46 -0
  73. package/dist/esm/types/models/block.model.d.ts +29 -0
  74. package/dist/esm/types/models/coordinate.model.d.ts +7 -0
  75. package/dist/esm/types/models/data.model.d.ts +26 -0
  76. package/dist/esm/types/models/defaults.model.d.ts +32 -0
  77. package/dist/esm/types/models/global.model.d.ts +18 -0
  78. package/dist/esm/types/models/label.model.d.ts +9 -0
  79. package/dist/esm/types/models/legend.model.d.ts +8 -0
  80. package/dist/esm/types/models/model.base.d.ts +5 -0
  81. package/dist/esm/types/models/seat.model.d.ts +40 -0
  82. package/dist/esm/types/models/styles/block.style.d.ts +7 -0
  83. package/dist/esm/types/models/styles/label.style.d.ts +6 -0
  84. package/dist/esm/types/models/styles/legend.style.d.ts +6 -0
  85. package/dist/esm/types/models/styles/seat.style.d.ts +12 -0
  86. package/dist/esm/types/models/styles/tooltip.style.d.ts +7 -0
  87. package/dist/esm/types/svg/event.manager.d.ts +12 -0
  88. package/dist/esm/types/svg/legend/legend.circle.d.ts +7 -0
  89. package/dist/esm/types/svg/legend/legend.item.d.ts +13 -0
  90. package/dist/esm/types/svg/legend/legend.title.d.ts +7 -0
  91. package/dist/esm/types/svg/legend.d.ts +8 -0
  92. package/dist/esm/types/svg/stage/blocks/block-item/block-item.bounds.d.ts +12 -0
  93. package/dist/esm/types/svg/stage/blocks/block-item/block-item.index.d.ts +23 -0
  94. package/dist/esm/types/svg/stage/blocks/block-item/block-item.info.index.d.ts +11 -0
  95. package/dist/esm/types/svg/stage/blocks/block-item/block-item.labels.index.d.ts +11 -0
  96. package/dist/esm/types/svg/stage/blocks/block-item/block-item.mask.d.ts +12 -0
  97. package/dist/esm/types/svg/stage/blocks/block-item/block-item.seats.index.d.ts +15 -0
  98. package/dist/esm/types/svg/stage/blocks/block-item/bound/bound-item.index.d.ts +12 -0
  99. package/dist/esm/types/svg/stage/blocks/block-item/info/title.d.ts +7 -0
  100. package/dist/esm/types/svg/stage/blocks/block-item/label/label-item.circle.d.ts +7 -0
  101. package/dist/esm/types/svg/stage/blocks/block-item/label/label-item.index.d.ts +13 -0
  102. package/dist/esm/types/svg/stage/blocks/block-item/label/label-item.title.d.ts +7 -0
  103. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.check.d.ts +10 -0
  104. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.circle.d.ts +7 -0
  105. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +28 -0
  106. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.title.d.ts +7 -0
  107. package/dist/esm/types/svg/stage/blocks/blocks.index.d.ts +13 -0
  108. package/dist/esm/types/svg/stage/blocks.search-circle.d.ts +12 -0
  109. package/dist/esm/types/svg/stage/multi-select/rect.d.ts +7 -0
  110. package/dist/esm/types/svg/stage/multi-select.d.ts +13 -0
  111. package/dist/esm/types/svg/stage/search-circle/circle.d.ts +7 -0
  112. package/dist/esm/types/svg/stage/stage.index.d.ts +11 -0
  113. package/dist/esm/types/svg/svg.base.d.ts +35 -0
  114. package/dist/esm/types/svg/svg.index.d.ts +16 -0
  115. package/dist/esm/types/svg/tooltip/rect.d.ts +8 -0
  116. package/dist/esm/types/svg/tooltip/title.d.ts +10 -0
  117. package/dist/esm/types/svg/tooltip.d.ts +15 -0
  118. package/dist/esm/types/svg/zoom-out.bg.d.ts +7 -0
  119. package/dist/esm/types/svg/zoom.manager.d.ts +41 -0
  120. package/dist/esm/types/window.manager.d.ts +9 -0
  121. package/dist/types.d.ts +533 -0
  122. package/package.json +10 -14
  123. package/.eslintrc.json +0 -15
  124. package/.github/FUNDING.yml +0 -4
  125. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  126. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  127. package/.github/workflows/codeql-analysis.yml +0 -29
  128. package/.github/workflows/npm-publish-packages.yml +0 -35
  129. package/.github/workflows/publish.yml +0 -106
  130. package/.github/workflows/webpack.yml +0 -22
  131. package/.opencommitignore +0 -2
  132. package/AUTHORS +0 -3
  133. package/SECURITY.md +0 -21
  134. package/_config.yml +0 -1
  135. package/assets/banner_ui.png +0 -0
  136. package/assets/bn.jpg +0 -0
  137. package/assets/logo.jpg +0 -0
  138. package/assets/logo_small.jpg +0 -0
  139. package/assets/zoom_out.svg +0 -11
  140. package/cog.toml +0 -19
  141. package/dist/cjs/index.js +0 -16
  142. package/examples/index.html +0 -171
  143. package/rollup.config.js +0 -56
  144. package/src/lib/canvas.index.ts +0 -121
  145. package/src/lib/config.ts +0 -11
  146. package/src/lib/decorators/dom.ts +0 -40
  147. package/src/lib/decorators/index.ts +0 -6
  148. package/src/lib/dev.tools.ts +0 -18
  149. package/src/lib/models/block.model.ts +0 -65
  150. package/src/lib/models/coordinate.model.ts +0 -26
  151. package/src/lib/models/data.model.ts +0 -125
  152. package/src/lib/models/defaults.model.ts +0 -131
  153. package/src/lib/models/global.model.ts +0 -24
  154. package/src/lib/models/label.model.ts +0 -25
  155. package/src/lib/models/legend.model.ts +0 -24
  156. package/src/lib/models/model.base.ts +0 -15
  157. package/src/lib/models/seat.model.ts +0 -74
  158. package/src/lib/svg/event.manager.ts +0 -48
  159. package/src/lib/svg/legend/legend.circle.ts +0 -28
  160. package/src/lib/svg/legend/legend.item.ts +0 -53
  161. package/src/lib/svg/legend/legend.title.ts +0 -27
  162. package/src/lib/svg/legend.ts +0 -55
  163. package/src/lib/svg/stage/blocks/block-item/block-item.bounds.ts +0 -51
  164. package/src/lib/svg/stage/blocks/block-item/block-item.index.ts +0 -185
  165. package/src/lib/svg/stage/blocks/block-item/block-item.info.index.ts +0 -39
  166. package/src/lib/svg/stage/blocks/block-item/block-item.labels.index.ts +0 -41
  167. package/src/lib/svg/stage/blocks/block-item/block-item.mask.ts +0 -67
  168. package/src/lib/svg/stage/blocks/block-item/block-item.seats.index.ts +0 -81
  169. package/src/lib/svg/stage/blocks/block-item/bound/bound-item.index.ts +0 -43
  170. package/src/lib/svg/stage/blocks/block-item/info/title.ts +0 -30
  171. package/src/lib/svg/stage/blocks/block-item/label/label-item.circle.ts +0 -27
  172. package/src/lib/svg/stage/blocks/block-item/label/label-item.index.ts +0 -46
  173. package/src/lib/svg/stage/blocks/block-item/label/label-item.title.ts +0 -27
  174. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.check.ts +0 -52
  175. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.circle.ts +0 -30
  176. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.index.ts +0 -159
  177. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.title.ts +0 -27
  178. package/src/lib/svg/stage/blocks/blocks.index.ts +0 -71
  179. package/src/lib/svg/stage/blocks.search-circle.ts +0 -86
  180. package/src/lib/svg/stage/multi-select/rect.ts +0 -36
  181. package/src/lib/svg/stage/multi-select.ts +0 -107
  182. package/src/lib/svg/stage/search-circle/circle.ts +0 -37
  183. package/src/lib/svg/stage/stage.index.ts +0 -41
  184. package/src/lib/svg/svg.base.ts +0 -229
  185. package/src/lib/svg/svg.index.ts +0 -76
  186. package/src/lib/svg/tooltip/rect.ts +0 -66
  187. package/src/lib/svg/tooltip/title.ts +0 -48
  188. package/src/lib/svg/tooltip.ts +0 -93
  189. package/src/lib/svg/zoom-out.bg.ts +0 -35
  190. package/src/lib/svg/zoom.manager.ts +0 -448
  191. package/src/lib/window.manager.ts +0 -40
  192. package/src/scss/lib.scss +0 -10
  193. package/src/scss/style.scss +0 -221
  194. package/tsconfig.json +0 -32
@@ -1,27 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
- import SvgBase from "../../../../svg.base";
7
- import {dom} from "../../../../../decorators/dom";
8
- import {LabelItem} from "./label-item.index";
9
-
10
- @dom({
11
- tag: "circle",
12
- class: "label-circle",
13
- autoGenerate: false
14
- })
15
- export class LabelItemCircle extends SvgBase {
16
-
17
- constructor(public parent: LabelItem) {
18
- super(parent);
19
- this.attr("r", this.global.config.label_style.radius);
20
- this.attr("fill", this.global.config.label_style.bg);
21
- return this;
22
- }
23
-
24
- update(): this {
25
- return this;
26
- }
27
- }
@@ -1,46 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
-
7
- import SvgBase from "../../../../svg.base";
8
- import {dom} from "../../../../../decorators/dom";
9
- import {LabelItemCircle} from "./label-item.circle";
10
- import {CoordinateModel} from "../../../../../models/coordinate.model";
11
- import Labels from "../block-item.labels.index";
12
- import LabelModel from "../../../../../models/label.model";
13
- import {LabelItemTitle} from "./label-item.title";
14
-
15
-
16
- @dom({
17
- tag: "g",
18
- class: "label",
19
- autoGenerate: false
20
- })
21
- export class LabelItem extends SvgBase {
22
-
23
- public circle: LabelItemCircle;
24
- public coordinates: CoordinateModel;
25
-
26
- constructor(public parent: Labels, public item: LabelModel) {
27
- super(parent);
28
- this.coordinates = new CoordinateModel(item);
29
- this.attr("transform", "translate(" + this.coordinates.toArray() + ")");
30
- return this;
31
- }
32
-
33
-
34
- update(): this {
35
- this.circle = new LabelItemCircle(this);
36
- this.addChild(this.circle);
37
-
38
- this.circle = new LabelItemTitle(this);
39
- this.addChild(this.circle);
40
-
41
- this.updateChilds();
42
-
43
- this.circle.node.text(this.item.title);
44
- return this;
45
- }
46
- }
@@ -1,27 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
- import SvgBase from "../../../../svg.base";
7
- import {dom} from "../../../../../decorators/dom";
8
- import {LabelItem} from "./label-item.index";
9
-
10
- @dom({
11
- tag: "text",
12
- class: "label-text",
13
- autoGenerate: false
14
- })
15
- export class LabelItemTitle extends SvgBase {
16
-
17
- constructor(public parent: LabelItem) {
18
- super(parent);
19
- this.attr("fill", this.global.config.label_style.color);
20
- this.attr("font-size", this.global.config.label_style.font_size);
21
- return this;
22
- }
23
-
24
- update(): this {
25
- return this;
26
- }
27
- }
@@ -1,52 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
- import SvgBase from "../../../../svg.base";
7
- import {dom} from "../../../../../decorators/dom";
8
- import {SeatItem} from "./seat-item.index";
9
-
10
- @dom({
11
- tag: "text",
12
- class: "seat-check",
13
- autoGenerate: false
14
- })
15
- export class SeatItemCheck extends SvgBase {
16
-
17
- constructor(public parent: SeatItem) {
18
- super(parent);
19
- // this.attr("d", "M12.9,953.7l-6.3,6.5l-2.9-2.5l-2.1,2.4l4.1,3.5l1.1,1l1.1-1.1l7.3-7.6L12.9,953.7L12.9,953.7z");
20
- this.text('\uf005')
21
- this.attr("class", 'fa');
22
- // this.attr("fill", '#ff0000');
23
-
24
- this.attr("fill", this.global.config.seat_style.check_icon_color);
25
- this.attr("transform", "translate(-7,4) scale(0.8)");
26
- this.attr("pointer-events", "none");
27
- this.attr("display", "none");
28
- this.attr("opacity", 0);
29
-
30
- return this;
31
- }
32
-
33
- update(): this {
34
- return this;
35
- }
36
-
37
- afterGenerate() {
38
- this.node.style("pointer-events", "none");
39
- }
40
-
41
- show():this {
42
- this.node.attr("display", "block");
43
- this.node.attr("opacity", 1);
44
- return this;
45
- }
46
-
47
- hide():this {
48
- this.node.attr("display", "none");
49
- this.node.attr("opacity", 0);
50
- return this;
51
- }
52
- }
@@ -1,30 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
- import SvgBase from "../../../../svg.base";
7
- import {dom} from "../../../../../decorators/dom";
8
- import {SeatItem} from "./seat-item.index";
9
-
10
- @dom({
11
- tag: "circle",
12
- class: "seat-circle",
13
- autoGenerate: false
14
- })
15
- export class SeatItemCircle extends SvgBase {
16
-
17
- constructor(public parent: SeatItem) {
18
- super(parent);
19
- this.attr("block-id", parent.item.block.id);
20
- this.attr("r", this.global.config.seat_style.radius);
21
- this.attr("fill", this.global.config.seat_style.color);
22
- this.attr("stroke", "rgba(0,0,0,0.3)");
23
- this.attr("stroke-width", 1);
24
- return this;
25
- }
26
-
27
- update(): this {
28
- return this;
29
- }
30
- }
@@ -1,159 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2018 Ali Sait TEKE
4
- */
5
-
6
-
7
- import SvgBase from "../../../../svg.base";
8
- import {dom} from "../../../../../decorators/dom";
9
- import SeatModel from "../../../../../models/seat.model";
10
- import Seats from "../block-item.seats.index";
11
- import {SeatItemCircle} from "./seat-item.circle";
12
- import {CoordinateModel} from "../../../../../models/coordinate.model";
13
- import {SeatItemTitle} from "./seat-item.title";
14
- import {SeatAction} from "../../../../../enums/global";
15
- import {SeatItemCheck} from "./seat-item.check";
16
-
17
-
18
- @dom({
19
- tag: "g",
20
- class: "seat",
21
- autoGenerate: false
22
- })
23
- export class SeatItem extends SvgBase {
24
-
25
- public circle: SeatItemCircle;
26
- public title: SeatItemTitle;
27
- public coordinates: CoordinateModel;
28
- public check: SeatItemCheck;
29
-
30
- constructor(public parent: Seats, public item: SeatModel) {
31
- super(parent);
32
- this.coordinates = new CoordinateModel(item);
33
- this.attr("transform", "translate(" + this.coordinates.toArray() + ")");
34
- this.item.svg = this;
35
- return this;
36
- }
37
-
38
- public setColor(color: string, animation: boolean = false): this {
39
- if (animation) {
40
- this.circle.node.transition().duration(this.global.config.animation_speed).attr("fill", color);
41
- } else {
42
- this.circle.node.attr("fill", color);
43
- }
44
-
45
- return this;
46
- }
47
-
48
- public updateColor(color: string | null = null): this {
49
- this.setColor(this.getColor());
50
- return this;
51
- }
52
-
53
- public select(color: string | null = null): this {
54
- this.item.selected = true;
55
- this.node.classed("selected", true);
56
- this.circle.node.attr("fill", this.global.config.seat_style.selected);
57
- this.check.show();
58
- return this;
59
- }
60
-
61
- public unSelect(): this {
62
- this.item.selected = false;
63
- this.node.classed("selected", false);
64
- this.circle.node.attr("fill", this.global.config.seat_style.color);
65
- this.check.hide();
66
- return this;
67
- }
68
-
69
- public isSelected(): Boolean {
70
- return this.item.selected;
71
- }
72
-
73
- public isSalable(): Boolean {
74
- return this.item.salable;
75
- }
76
-
77
- public hover() {
78
- this.setColor(this.global.config.seat_style.hover);
79
- }
80
-
81
- public blur() {
82
- this.setColor(this.getColor());
83
- }
84
-
85
- public getColor(action: SeatAction| null = null): string {
86
-
87
- if (this.isSalable()) {
88
-
89
- if (action == SeatAction.FOCUS) {
90
- if (this.isSelected()) {
91
- return this.global.config.seat_style.focus_out;
92
- } else {
93
- return this.global.config.seat_style.focus;
94
- }
95
-
96
- } else if (action == SeatAction.HOVER) {
97
- if (this.isSelected()) {
98
- return this.global.config.seat_style.selected;
99
- } else {
100
- return this.global.config.seat_style.hover;
101
- }
102
- }
103
- else if (action == SeatAction.LEAVE) {
104
- if (this.isSelected()) {
105
- return this.global.config.seat_style.selected;
106
- } else {
107
- return this.global.config.seat_style.color;
108
- }
109
- }
110
- else if (action == SeatAction.SELECT) {
111
- if (this.isSelected()) {
112
- return this.global.config.seat_style.selected;
113
- } else {
114
- return this.global.config.seat_style.selected;
115
- }
116
- } else {
117
- if (this.isSelected()) {
118
- return this.global.config.seat_style.selected;
119
- } else {
120
- return this.global.config.seat_style.color;
121
- }
122
- }
123
-
124
- } else {
125
- return this.global.config.seat_style.not_salable;
126
- }
127
-
128
- }
129
-
130
- update(): this {
131
- this.circle = new SeatItemCircle(this);
132
- this.addChild(this.circle);
133
-
134
-
135
- this.check = new SeatItemCheck(this).addTo(this);
136
-
137
-
138
-
139
- // this.title = new SeatItemTitle(this);
140
- // this.addChild(this.title);
141
-
142
-
143
- this.updateChilds();
144
-
145
- //this.title.node.text(this.item.title);
146
-
147
- return this;
148
- }
149
-
150
- afterGenerate(){
151
- this.setColor(this.getColor());
152
- if(this.item.selected){
153
- this.check.show()
154
- }else{
155
- this.check.hide()
156
- }
157
-
158
- }
159
- }
@@ -1,27 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
- import SvgBase from "../../../../svg.base";
7
- import {dom} from "../../../../../decorators/dom";
8
- import {SeatItem} from "./seat-item.index";
9
-
10
- @dom({
11
- tag: "text",
12
- class: "label-text",
13
- autoGenerate: false
14
- })
15
- export class SeatItemTitle extends SvgBase {
16
-
17
- constructor(public parent: SeatItem) {
18
- super(parent);
19
- this.attr("fill", this.global.config.label_style.color);
20
- this.attr("font-size", 10);
21
- return this;
22
- }
23
-
24
- update(): this {
25
- return this;
26
- }
27
- }
@@ -1,71 +0,0 @@
1
- /*
2
- * blocks.ts
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
- import {polygonHull} from 'd3-polygon'
7
-
8
- import StageManager from "../stage.index";
9
- import Block from "./block-item/block-item.index";
10
- import SvgBase from "../../svg.base";
11
- import {dom} from "../../../decorators/dom";
12
- import SeatModel from "../../../models/seat.model";
13
- import {SeatItem} from "./block-item/seat/seat-item.index";
14
- import BlockModel from "../../../models/block.model";
15
- import LabelModel from "../../../models/label.model";
16
-
17
- @dom({
18
- tag: "g",
19
- class: "blocks",
20
- autoGenerate: false
21
- })
22
- export default class Blocks extends SvgBase {
23
-
24
- public seats: Array<SeatItem>;
25
-
26
-
27
- constructor(public parent: StageManager) {
28
- super(parent);
29
- return this;
30
- }
31
-
32
- public update(): this {
33
- this.clear();
34
- this.global.data.getBlocks().map((block_item: BlockModel) => {
35
- let _blockItem = new Block(this, block_item);
36
- let _seats = block_item.seats;
37
-
38
-
39
- // algorithm problem fixed
40
- if (_seats && _seats.length) {
41
- _seats[0].y += 0.0001;
42
- _seats[0].x += 0.0001;
43
- }
44
-
45
- let bound_items: Array<any> = _seats.map((item: SeatModel) => [item.x, item.y]).concat(block_item.labels.map((item: LabelModel) => [item.x, item.y]));
46
- block_item.bounds = polygonHull(bound_items);
47
-
48
- this.addChild(_blockItem);
49
- });
50
- this.updateChilds();
51
- this.seats = this.node.selectAll(".seat");
52
-
53
- return this;
54
- }
55
-
56
- public getBlock(id: any): Block | null {
57
- const block = this.getBlocks().find((block: Block) => block.item.id == id)
58
- if (block)
59
- return block;
60
- else
61
- return null;
62
- }
63
-
64
- public getBlocks(): Array<Block> {
65
- return this.getChilds(Block.name);
66
- }
67
-
68
- public center() {
69
-
70
- }
71
- }
@@ -1,86 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
-
7
- import {dom} from "../../decorators";
8
- import SvgBase from "../svg.base";
9
- import Circle from "./search-circle/circle";
10
- import {EventType, ZoomLevel} from "../../enums/global";
11
- import Stage from "./stage.index";
12
-
13
- @dom({
14
- tag: "g",
15
- class: "search-circle",
16
- autoGenerate: false
17
- })
18
- export default class BlocksSearchCircle extends SvgBase {
19
-
20
-
21
- public circle: Circle;
22
- public is_enable: boolean = true;
23
-
24
- constructor(public parent: Stage) {
25
- super(parent);
26
- this.global.eventManager.addEventListener(EventType.MOUSE_MOVE, (mouse: any) => {
27
- if (this.global.zoomManager.zoomLevel === ZoomLevel.BLOCK && this.is_enable) {
28
- this.node.attr("transform", "translate(" + mouse + ")");
29
- }
30
- });
31
-
32
- this.global.eventManager.addEventListener(EventType.ZOOM_LEVEL_CHANGE, (zoom_level: any) => {
33
- if (zoom_level.level === ZoomLevel.VENUE || zoom_level.level === ZoomLevel.SEAT) {
34
- this.node.classed("show", false);
35
- }
36
- });
37
-
38
-
39
- this.global.eventManager.addEventListener(EventType.MULTI_SELECT_ENABLE, () => {
40
- this.disable();
41
- });
42
- this.global.eventManager.addEventListener(EventType.MULTI_SELECT_DISABLE, () => {
43
- this.enable();
44
- });
45
-
46
-
47
- return this;
48
- }
49
-
50
- update(): this {
51
-
52
- this.clear();
53
- this.circle = new Circle(this);
54
- this.addChild(this.circle);
55
- this.updateChilds();
56
-
57
-
58
- this.parent.blocks.node.on("mouseleave.search", () => {
59
- this.node.classed("show", false);
60
- });
61
-
62
- this.parent.blocks.node.on("mousemove.search", () => {
63
- if (this.global.zoomManager.zoomLevel === ZoomLevel.VENUE) {
64
- this.node.classed("show", false);
65
- } else if (this.global.zoomManager.zoomLevel === ZoomLevel.BLOCK) {
66
- this.node.classed("show", true);
67
- } else if (this.global.zoomManager.zoomLevel === ZoomLevel.SEAT) {
68
- this.node.classed("show", false);
69
- }
70
- });
71
-
72
- return this;
73
- }
74
-
75
- public enable(): this {
76
- this.is_enable = true;
77
- this.node.style("display", "block");
78
- return this;
79
- }
80
-
81
- public disable(): this {
82
- this.is_enable = false;
83
- this.node.style("display", "none");
84
- return this;
85
- }
86
- }
@@ -1,36 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
-
7
- import {dom} from "../../../decorators";
8
- import SvgBase from "./../../svg.base";
9
- import MultiSelect from "../multi-select";
10
-
11
- @dom({
12
- tag: "rect",
13
- class: "multi-select-rect",
14
- autoGenerate: false
15
- })
16
- export default class MultiSelectRect extends SvgBase {
17
-
18
-
19
- constructor(public parent: MultiSelect) {
20
- super(parent);
21
- this.attr("width", 250);
22
- this.attr("height", 250);
23
-
24
- this.attr("x", 250);
25
- this.attr("y", 250);
26
-
27
- this.attr("fill", "none");
28
- this.attr("stroke", "rgba(0,0,0,0.5)");
29
- this.attr("stroke-width", "3px");
30
- this.attr("stroke-dasharray", "4");
31
- }
32
-
33
- update() {
34
-
35
- }
36
- }
@@ -1,107 +0,0 @@
1
- /*
2
- * $project.fileName
3
- * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
- */
5
-
6
- import {mouse as d3Mouse} from 'd3-selection'
7
-
8
- import SvgBase from "../svg.base";
9
- import Svg from "../svg.index";
10
- import MultiSelectRect from "./multi-select/rect";
11
- import {EventType} from "../../enums/global";
12
-
13
-
14
- import {dom} from "../../decorators";
15
-
16
- @dom({
17
- tag: "g",
18
- class: "multi-select-tools",
19
- autoGenerate: false
20
- })
21
- export default class MultiSelect extends SvgBase {
22
-
23
-
24
- public rect: MultiSelectRect;
25
- public enable: boolean;
26
- public start: boolean;
27
-
28
- public points: any = {
29
- start: null,
30
- end: null
31
- };
32
-
33
- constructor(public parent: Svg) {
34
- super(parent);
35
- this.enable = false;
36
- this.start = false;
37
-
38
-
39
- // this.global.eventManager.addEventListener(EventType.MOUSEDOWN_BLOCK, (e: any, node: any, mouse: any) => {
40
- //
41
- // });
42
- this.global.eventManager.addEventListener(EventType.MOUSEUP_BLOCK, () => {
43
- if (this.global.multi_select && this.start) {
44
- //console.log("up");
45
- }
46
- });
47
-
48
- return this;
49
- }
50
-
51
- update(): this {
52
-
53
- this.rect = new MultiSelectRect(this).addTo(this);
54
- this.updateChilds();
55
-
56
- return this;
57
- }
58
-
59
- afterGenerate() {
60
-
61
- this.parent.stage.node.on("mousedown", () => {
62
- if (!this.global.multi_select) return;
63
- // console.log("e", e);
64
- // console.log("mouse", mouse);
65
- // console.log("mouse", mouse);
66
- let mouse = d3Mouse(this.parent.stage.node.node());
67
- if (this.start) {
68
- this.start = false;
69
-
70
- this.points.end = mouse;
71
- let width = this.points.end[0] - this.points.start[0];
72
- let height = this.points.end[1] - this.points.start[1];
73
-
74
-
75
- this.rect.node.attr("width", width);
76
- this.rect.node.attr("height", height);
77
- this.rect.node.attr("x", this.points.start[0]);
78
- this.rect.node.attr("y", this.points.end[0]);
79
-
80
- this.points.start = null;
81
- this.points.end = null;
82
- } else {
83
- this.start = true;
84
- this.points.start = mouse;
85
-
86
- }
87
-
88
- });
89
- this.parent.stage.node.on("mousemove", () => {
90
- if (this.global.multi_select) {
91
- if (this.start) {
92
- let mouse = d3Mouse(this.parent.stage.node.node());
93
- let width = mouse[0] - this.points.start[0];
94
- let height = mouse[1] - this.points.start[1];
95
-
96
- this.points.end = mouse;
97
-
98
- this.rect.node.attr("width", width);
99
- this.rect.node.attr("height", height);
100
- this.rect.node.attr("x", this.points.start[0]);
101
- this.rect.node.attr("y", this.points.end[0]);
102
- }
103
- }
104
-
105
- });
106
- }
107
- }