@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.
Files changed (79) hide show
  1. package/.eslintrc.json +15 -0
  2. package/.github/FUNDING.yml +4 -0
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. package/.github/workflows/codeql-analysis.yml +29 -0
  6. package/.github/workflows/npm-publish-packages.yml +35 -0
  7. package/.github/workflows/webpack.yml +22 -0
  8. package/AUTHORS +3 -0
  9. package/LICENSE +21 -0
  10. package/README.md +160 -0
  11. package/SECURITY.md +21 -0
  12. package/_config.yml +1 -0
  13. package/assets/banner_ui.png +0 -0
  14. package/assets/bn.jpg +0 -0
  15. package/assets/logo.jpg +0 -0
  16. package/assets/logo_small.jpg +0 -0
  17. package/assets/zoom_out.svg +11 -0
  18. package/examples/basic/bootstrap.min.css +7 -0
  19. package/examples/basic/index.html +201 -0
  20. package/examples/basic/jquery.min.js +2 -0
  21. package/examples/data/data.json +70007 -0
  22. package/examples/data/small.json +1307 -0
  23. package/examples/data/tiny.json +119 -0
  24. package/examples/old/index.html +262 -0
  25. package/package.json +59 -0
  26. package/src/lib/canvas.index.ts +122 -0
  27. package/src/lib/config.ts +11 -0
  28. package/src/lib/decorators/dom.ts +40 -0
  29. package/src/lib/decorators/index.ts +6 -0
  30. package/src/lib/dev.tools.ts +18 -0
  31. package/src/lib/enums/global.ts +67 -0
  32. package/src/lib/models/block.model.ts +170 -0
  33. package/src/lib/models/coordinate.model.ts +43 -0
  34. package/src/lib/models/data.model.ts +105 -0
  35. package/src/lib/models/defaults.model.ts +125 -0
  36. package/src/lib/models/global.model.ts +24 -0
  37. package/src/lib/models/label.model.ts +58 -0
  38. package/src/lib/models/legend.model.ts +56 -0
  39. package/src/lib/models/model.base.ts +32 -0
  40. package/src/lib/models/seat.model.ts +182 -0
  41. package/src/lib/svg/event.manager.ts +56 -0
  42. package/src/lib/svg/legend/legend.circle.ts +28 -0
  43. package/src/lib/svg/legend/legend.item.ts +50 -0
  44. package/src/lib/svg/legend/legend.title.ts +27 -0
  45. package/src/lib/svg/legend.ts +55 -0
  46. package/src/lib/svg/stage/blocks/block-item/block-item.bounds.ts +51 -0
  47. package/src/lib/svg/stage/blocks/block-item/block-item.index.ts +173 -0
  48. package/src/lib/svg/stage/blocks/block-item/block-item.info.index.ts +38 -0
  49. package/src/lib/svg/stage/blocks/block-item/block-item.labels.index.ts +41 -0
  50. package/src/lib/svg/stage/blocks/block-item/block-item.mask.ts +67 -0
  51. package/src/lib/svg/stage/blocks/block-item/block-item.seats.index.ts +81 -0
  52. package/src/lib/svg/stage/blocks/block-item/bound/bound-item.index.ts +43 -0
  53. package/src/lib/svg/stage/blocks/block-item/info/title.ts +30 -0
  54. package/src/lib/svg/stage/blocks/block-item/label/label-item.circle.ts +27 -0
  55. package/src/lib/svg/stage/blocks/block-item/label/label-item.index.ts +46 -0
  56. package/src/lib/svg/stage/blocks/block-item/label/label-item.title.ts +27 -0
  57. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.check.ts +45 -0
  58. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.circle.ts +30 -0
  59. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.index.ts +159 -0
  60. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.title.ts +27 -0
  61. package/src/lib/svg/stage/blocks/blocks.index.ts +68 -0
  62. package/src/lib/svg/stage/blocks.search-circle.ts +86 -0
  63. package/src/lib/svg/stage/multi-select/rect.ts +36 -0
  64. package/src/lib/svg/stage/multi-select.ts +107 -0
  65. package/src/lib/svg/stage/search-circle/circle.ts +37 -0
  66. package/src/lib/svg/stage/stage.index.ts +41 -0
  67. package/src/lib/svg/svg.base.ts +217 -0
  68. package/src/lib/svg/svg.index.ts +76 -0
  69. package/src/lib/svg/tooltip/rect.ts +66 -0
  70. package/src/lib/svg/tooltip/title.ts +57 -0
  71. package/src/lib/svg/tooltip.ts +92 -0
  72. package/src/lib/svg/zoom-out.bg.ts +35 -0
  73. package/src/lib/svg/zoom.manager.ts +440 -0
  74. package/src/lib/window.manager.ts +40 -0
  75. package/src/scss/lib.scss +10 -0
  76. package/src/scss/style.scss +221 -0
  77. package/tsconfig.json +28 -0
  78. package/webpack.environments/development.js +58 -0
  79. package/webpack.environments/production.js +52 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "eslint:recommended",
3
+ "parserOptions": {
4
+ "sourceType": "module",
5
+ "ecmaVersion": 8
6
+ },
7
+ "env": {
8
+ "es6": true,
9
+ "node": true,
10
+ "browser": true
11
+ },
12
+ "rules": {
13
+ "no-cond-assign": 0
14
+ }
15
+ }
@@ -0,0 +1,4 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: alisaitteke
4
+ patreon: alisait
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,29 @@
1
+ name: "CodeQL"
2
+ on:
3
+ push:
4
+ branches: [ develop ]
5
+ pull_request:
6
+ branches: [ develop ]
7
+ jobs:
8
+ analyze:
9
+ name: Analyze
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ actions: read
13
+ contents: read
14
+ security-events: write
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ language: [ 'javascript' ]
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v3
22
+ - name: Initialize CodeQL
23
+ uses: github/codeql-action/init@v2
24
+ with:
25
+ languages: ${{ matrix.language }}
26
+ - name: Autobuild
27
+ uses: github/codeql-action/autobuild@v2
28
+ - name: Perform CodeQL Analysis
29
+ uses: github/codeql-action/analyze@v2
@@ -0,0 +1,35 @@
1
+ name: Package Publish
2
+ on:
3
+ workflow_dispatch:
4
+ release:
5
+ types: [created]
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ master ]
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ - run: yarn install
19
+ - run: yarn build
20
+ publish-npm:
21
+ needs: build
22
+ runs-on: ubuntu-latest
23
+ permissions:
24
+ contents: read
25
+ packages: write
26
+ steps:
27
+ - uses: actions/checkout@v3
28
+ - uses: actions/setup-node@v3
29
+ with:
30
+ node-version: 16
31
+ registry-url: 'https://registry.npmjs.org'
32
+ always-auth: true
33
+ - run: yarn publish
34
+ env:
35
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,22 @@
1
+ name: NodeJS with Webpack
2
+ on:
3
+ push:
4
+ branches: [ develop ]
5
+ pull_request:
6
+ branches: [ develop ]
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ matrix:
12
+ node-version: [16.x]
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - name: Run install
16
+ uses: borales/actions-yarn@v4
17
+ with:
18
+ cmd: install
19
+ - name: Build production bundle
20
+ uses: borales/actions-yarn@v4
21
+ with:
22
+ cmd: build
package/AUTHORS ADDED
@@ -0,0 +1,3 @@
1
+ List of Acorn contributors. Updated before every release.
2
+
3
+ Ali Sait TEKE
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Ali Sait TEKE
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 ADDED
@@ -0,0 +1,160 @@
1
+ [![LIVE DEMO](https://raw.githubusercontent.com/seatmap/canvas/master/assets/banner_ui.png?raw=true)](https://alisaitteke.github.io/seatmap-canvas)
2
+
3
+ [LIVE DEMO](https://alisaitteke.github.io/seatmap-canvas/)
4
+ # Seatmap Canvas
5
+ An opensource seat selection
6
+ ---
7
+
8
+ [![LIVE DEMO](https://raw.githubusercontent.com/seatmap/canvas/master/assets/bn.jpg?raw=true)](https://alisaitteke.github.io/seatmap-canvas)
9
+
10
+
11
+
12
+ ## What does it do?
13
+ #### In any organization
14
+ - Seat selection
15
+ - Seat categorizing
16
+ - Locating
17
+ - Turnstile and Gate information
18
+
19
+
20
+ ## Installation
21
+
22
+ <pre>
23
+ npm i <a href="https://www.npmjs.com/package/@seatmap/canvas">@seatmap/canvas</a> --save
24
+ </pre>
25
+
26
+ ### Github registry install
27
+ <pre>
28
+ npm i <a href="https://npm.pkg.github.com/alisaitteke/seatmap-canvas">@alisaitteke/seatmap-canvas</a> --save
29
+ </pre>
30
+
31
+
32
+
33
+
34
+ #### Example Config
35
+ ```json
36
+ {
37
+ "resizable": true,
38
+ "seat_style": {
39
+ "radius": 12,
40
+ "color": "#6796ff",
41
+ "hover": "#5671ff",
42
+ "not_salable": "#424747",
43
+ "selected": "#56aa45",
44
+ "focus": "#435fa4",
45
+ "focus_out": "#56aa45"
46
+ },
47
+ "block_style": {
48
+ "fill": "#e2e2e2",
49
+ "stroke": "#e2e2e2"
50
+ },
51
+ "label_style": {
52
+ "color": "#000",
53
+ "radius": 12,
54
+ "font-size": "12px",
55
+ "bg": "#ffffff"
56
+ }
57
+ }
58
+
59
+ ```
60
+
61
+ #### Usage
62
+ ```js
63
+ var seatmap = new SeatmapCanvas(".seats_container",config);
64
+ ```
65
+
66
+ #### Seat Model
67
+ ```json
68
+ {
69
+ "id": 1,
70
+ "title": "49",
71
+ "x": 0,
72
+ "y": 0,
73
+ "salable": true,
74
+ "note": "note test",
75
+ "color":"#ffffff",
76
+ "custom_data": {
77
+ "any": "things"
78
+ }
79
+ }
80
+ ```
81
+
82
+
83
+ #### Block Model
84
+ ```json
85
+ {
86
+ "blocks": [
87
+ {
88
+ "id": 1,
89
+ "title": "Test Block 1",
90
+ "color": "#2c2828",
91
+ "labels": [
92
+ {
93
+ "title": "A",
94
+ "x": -30,
95
+ "y": 0
96
+ },
97
+ {
98
+ "title": "B",
99
+ "x": 120,
100
+ "y": 30
101
+ }
102
+ ],
103
+ "seats": [
104
+ {
105
+ "id": 1,
106
+ "x": 0,
107
+ "y": 0,
108
+ "salable": true,
109
+ "note": "note test",
110
+ "title": "49"
111
+ },
112
+ {
113
+ "id": 2,
114
+ "x": 30,
115
+ "y": 0,
116
+ "salable": true,
117
+ "note": "note test",
118
+ "title": "47"
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+ }
124
+
125
+ ```
126
+
127
+ #### Set Block Data
128
+ ```js
129
+ seatmap.setData(data);
130
+ ```
131
+
132
+ #### Seat Click Trigger
133
+ ```js
134
+ seatmap.addEventListener("seat_click", (seat) => {
135
+ console.log(seat);
136
+ if (seat.selected) {
137
+ seatmap.seatUnselect(seat);
138
+ } else {
139
+ seatmap.seatSelect(seat);
140
+ }
141
+ });
142
+ ```
143
+
144
+ #### Activated unsalable seat click
145
+ ##### click_enable_sold_seats param add to config object
146
+ ```javascript
147
+ let config = {
148
+ click_enable_sold_seats: true // default false
149
+ }
150
+ ```
151
+
152
+ #### Get selected seat
153
+ ```javascript
154
+ seatmap.addEventListener("seat_click", (seat) => {
155
+ var data = torch.getSelectedSeats();
156
+ });
157
+ ```
158
+ ## Contributors
159
+
160
+ Ali Sait TEKE <alisaitt@gmail.com>
package/SECURITY.md ADDED
@@ -0,0 +1,21 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Use this section to tell people about which versions of your project are
6
+ currently being supported with security updates.
7
+
8
+ | Version | Supported |
9
+ | ------- | ------------------ |
10
+ | 5.1.x | :white_check_mark: |
11
+ | 5.0.x | :x: |
12
+ | 4.0.x | :white_check_mark: |
13
+ | < 4.0 | :x: |
14
+
15
+ ## Reporting a Vulnerability
16
+
17
+ Use this section to tell people how to report a vulnerability.
18
+
19
+ Tell them where to go, how often they can expect to get an update on a
20
+ reported vulnerability, what to expect if the vulnerability is accepted or
21
+ declined, etc.
package/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-cayman
Binary file
package/assets/bn.jpg ADDED
Binary file
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="192.9px" height="192.9px" viewBox="0 0 192.9 192.9" enable-background="new 0 0 192.9 192.9" xml:space="preserve">
6
+ <g>
7
+ <path fill="#010101" d="M192.9,183.3l-65.7-65.7c10.3-12.3,16.4-28.4,16.4-45.8C143.7,32.2,111.5,0,71.8,0S0,32.2,0,71.8
8
+ s32.2,71.8,71.8,71.8c17.4,0,33.2-6.2,45.8-16.4l65.7,65.7L192.9,183.3z M13.7,71.8c0-32.2,26-58.2,58.2-58.2s58.2,26,58.2,58.2
9
+ S104,130,71.8,130S13.7,104,13.7,71.8z M47.9,65h47.9v13.7H47.9V65z"/>
10
+ </g>
11
+ </svg>