iticket-seatingplan-dev 0.0.1

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/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # iticket-seatingplan docs
2
+
3
+ Installing the package:
4
+
5
+ npm install iticket-seatingplan
6
+
7
+ Importing **SeatingPlan** module in your component:
8
+
9
+ import { SeatingPlan } from 'iticket-seatingplan'
10
+
11
+ Using the **SeatingPlan** component
12
+
13
+ <SeatingPlan
14
+ eventId={eventId}
15
+ showingUid={showingUid}
16
+ sessionId={sessionId}
17
+ showingId={showingId}
18
+ priceAgeId={priceAgeId}
19
+ quantity={quantity}
20
+ price={price}
21
+ callbackFunction={callbackFunction}
22
+ apiKey={apiKey}
23
+ />
24
+
25
+ ## SeatingPlan
26
+
27
+ | Prop | Type | Description |
28
+ | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
+ | eventId | integer | eventId of event.<br />_required_ |
30
+ | showingUid | string | showingUid of the selected showing.<br />_required_ |
31
+ | showingId | integer | showingId of the selected showing.<br />_required_ |
32
+ | sessionId | string | sessionId from the initial CreateBasket endpoint.<br />_required_ |
33
+ | priceAgeId | integer | priceAgeId selected by user.<br />_required_ |
34
+ | quantity | integer | quantity specified by user.<br />_required_ |
35
+ | price | float | price specified by user if it is dynamically priced. Must be >= **priceMinimum** and <= **priceMaximum**. If not supplied, default price will be applied.<br />_optional_ |
36
+ | apiKey | string | API key provided by iTICKET.<br />_required_ |
37
+ | callbackFunction | function | callbackFunction to listen for **SeatingPlan** events.<br />_required_ |
38
+
39
+ ## callbackFunction
40
+
41
+ This function will be triggered any time there is an update to the basket or an error has occurred. Below is a sample callbackFunction that just `console.logs` an event:
42
+
43
+ const callbackFunction = (e) => {
44
+ console.log('event', e)
45
+ }
46
+
47
+ Sample callback results are as follows:
48
+
49
+ - A seat has been added to cart:
50
+
51
+ {
52
+ "type":"cart-change",
53
+ "details":[
54
+ {
55
+ "showingSeatId":4158647,
56
+ "showingId": 84164,
57
+ "rowName":"I",
58
+ "columnName":"13",
59
+ "price": 51,
60
+ "priceAgeName": "ADULT",
61
+ }
62
+ ]
63
+ }
64
+
65
+ - An error has occurred, \*e.g. price specified is greater than or less than the set **priceMinimum** and/or **priceMaximum\***
66
+
67
+ {
68
+ "type":"error",
69
+ "details":{
70
+ "error":{
71
+ "code":403,
72
+ "message":"Price specified not allowed."
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const Badge = props => {
10
+ return /*#__PURE__*/_react.default.createElement("div", {
11
+ className: "badge ".concat(!props.value ? 'badge--none' : '', " ")
12
+ }, /*#__PURE__*/_react.default.createElement("h4", {
13
+ className: "heavy"
14
+ }, props.value || 0));
15
+ };
16
+ var _default = Badge;
17
+ exports.default = _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const Button = props => {
10
+ return /*#__PURE__*/_react.default.createElement("button", {
11
+ className: "btn btn--".concat(props.kind, " CTA"),
12
+ "data-id": props.id,
13
+ type: props.type,
14
+ name: props.name,
15
+ value: props.value,
16
+ disabled: props.disabled,
17
+ onClick: props.handleClick
18
+ }, /*#__PURE__*/_react.default.createElement("h4", null, props.label));
19
+ };
20
+ var _default = Button;
21
+ exports.default = _default;
@@ -0,0 +1,367 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ require("./styles/index.css");
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactLeaflet = require("react-leaflet");
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ const wheelchairSeat = require('.//assets/wheelchair.png');
13
+ const SeatingPlan = _ref => {
14
+ let {
15
+ eventId,
16
+ showingUid,
17
+ sessionId,
18
+ showingId,
19
+ priceAgeId,
20
+ price,
21
+ quantity,
22
+ callbackFunction,
23
+ apiKey
24
+ } = _ref;
25
+ const [position, setPosition] = (0, _react.useState)(null);
26
+ const [height, setHeight] = (0, _react.useState)(0);
27
+ const [width, setWidth] = (0, _react.useState)(0);
28
+ const [seats, setSeats] = (0, _react.useState)([]);
29
+ const [error, setError] = (0, _react.useState)(null);
30
+ const [processing, setProcessing] = (0, _react.useState)(false);
31
+ const [bookedSeats, setBookedSeats] = (0, _react.useState)([]);
32
+ const [chosenSeat, setChosenSeat] = (0, _react.useState)(null);
33
+ const statusColors = {
34
+ unknown: '#95a5a6',
35
+ available: '#2ecc71',
36
+ sold: '#95a5a6',
37
+ reserved: '#95a5a6',
38
+ pending: '#e74c3c',
39
+ booked: '#e74c3c'
40
+ };
41
+ const setInitialColor = s => {
42
+ return {
43
+ fillColor: s.status === 1 ? statusColors.available : s.status === 4 ? statusColors.booked : statusColors.sold,
44
+ color: 'none',
45
+ fillOpacity: 100
46
+ };
47
+ };
48
+ const handleClick = (e, s) => {
49
+ if (s.status !== 1 && s.status !== 4 || processing || bookedSeats.length >= quantity && s.status === 1) {
50
+ if (bookedSeats.length >= quantity) {
51
+ const event = {
52
+ type: 'error',
53
+ details: {
54
+ message: 'Maximum ticket booking quantity specified reached.'
55
+ }
56
+ };
57
+ callbackFunction(event);
58
+ }
59
+ return;
60
+ }
61
+ setChosenSeat({
62
+ circle: e,
63
+ seat: s
64
+ });
65
+ setProcessing(true);
66
+ if (s.status === 1) {
67
+ fetch("https://apim.iticket.co.nz/seatingplan/addseat", {
68
+ method: 'POST',
69
+ body: JSON.stringify({
70
+ basketKey: '',
71
+ eventId: eventId,
72
+ showingId: showingId,
73
+ priceAgeId: priceAgeId,
74
+ seatId: s.showingSeatId,
75
+ status: s.status,
76
+ price: price
77
+ }),
78
+ headers: {
79
+ 'content-type': 'application/json',
80
+ 'session-id': "ASP.NET_SessionId=".concat(sessionId),
81
+ 'showingseat-id': s.showingSeatId
82
+ }
83
+ }).then(response => response.json()).then(response => {
84
+ s.status = 4;
85
+ e.target.setStyle({
86
+ fillColor: statusColors.booked
87
+ });
88
+ setProcessing(false);
89
+ setBookedSeats([...bookedSeats, {
90
+ showingSeatId: s.showingSeatId,
91
+ rowName: s.rowName,
92
+ columnName: s.columnName,
93
+ showingId: showingId,
94
+ price: price || s.defaultPrice,
95
+ priceAgeName: s.priceAgeName
96
+ }]);
97
+ }).catch(error => {
98
+ e.target.setStyle({
99
+ fillColor: statusColors.available
100
+ });
101
+ const event = {
102
+ type: 'error',
103
+ details: s.priceMinimum && s.priceMaximum && (price < s.priceMinimum || price > s.priceMaximum) ? {
104
+ error: {
105
+ code: 403,
106
+ message: 'Price specified not allowed.'
107
+ }
108
+ } : {
109
+ error: {
110
+ code: 500,
111
+ message: 'Oops! Something went wrong. Please try again.'
112
+ }
113
+ }
114
+ };
115
+ callbackFunction(event);
116
+ setProcessing(false);
117
+ });
118
+ } else {
119
+ fetch("https://apim.iticket.co.nz/seatingplan/removeseat", {
120
+ method: 'POST',
121
+ body: JSON.stringify({
122
+ basketKey: '',
123
+ seatId: s.showingSeatId
124
+ }),
125
+ headers: {
126
+ 'content-type': 'application/json',
127
+ 'session-id': "ASP.NET_SessionId=".concat(sessionId),
128
+ 'showingseat-id': s.showingSeatId
129
+ }
130
+ }).then(response => response.json()).then(response => {
131
+ s.status = 1;
132
+ e.target.setStyle({
133
+ fillColor: statusColors.available
134
+ });
135
+ setBookedSeats(bookedSeats.filter(bs => bs.showingSeatId !== s.showingSeatId));
136
+ setProcessing(false);
137
+ }).catch(error => {
138
+ e.target.setStyle({
139
+ fillColor: statusColors.booked
140
+ });
141
+ const event = {
142
+ type: 'error',
143
+ details: {
144
+ error: {
145
+ code: 500,
146
+ message: 'Oops! Something went wrong. Please try again.'
147
+ }
148
+ }
149
+ };
150
+ callbackFunction(event);
151
+ setProcessing(false);
152
+ });
153
+ }
154
+ };
155
+ (0, _react.useEffect)(() => {
156
+ if (!position && !error) {
157
+ fetch("https://ecommerce-main-7edd4c0.zuplo.app/ecommerce/v1/events/".concat(eventId, "/showings/").concat(showingUid, "/seats?priceage=").concat(priceAgeId), {
158
+ headers: {
159
+ 'session-id': sessionId,
160
+ 'Authorization': "Bearer ".concat(apiKey)
161
+ }
162
+ }).then(response => response.json() || null).then(data => {
163
+ const img = new Image();
164
+ img.src = data.background;
165
+ setBookedSeats(data.seats.filter(s => s.status === 4).map(s => ({
166
+ showingSeatId: s.showingSeatId,
167
+ rowName: s.rowName,
168
+ columnName: s.columnName,
169
+ showingId: showingId,
170
+ price: price || s.defaultPrice,
171
+ priceAgeName: s.priceAgeName
172
+ })));
173
+ img.onload = () => {
174
+ setHeight(img.height);
175
+ setWidth(img.width);
176
+ setPosition([img.height * 0.03 / 2, img.width * 0.03 / 2]);
177
+ setSeats(data);
178
+ };
179
+ }).catch(error => {
180
+ setError({
181
+ response: {
182
+ data: {
183
+ message: 'Invalid API Key or unauthorized URL'
184
+ }
185
+ }
186
+ });
187
+ });
188
+ }
189
+ }, [position]);
190
+ (0, _react.useEffect)(() => {
191
+ if (bookedSeats && position && chosenSeat) {
192
+ const event = {
193
+ type: 'cart-change',
194
+ details: bookedSeats
195
+ };
196
+ callbackFunction(event);
197
+ }
198
+ }, [bookedSeats]);
199
+ (0, _react.useEffect)(() => {
200
+ if (processing) {
201
+ chosenSeat === null || chosenSeat === void 0 ? void 0 : chosenSeat.circle.target.setStyle({
202
+ fillOpacity: 0
203
+ });
204
+ }
205
+ }, [chosenSeat]);
206
+
207
+ // return seating plan
208
+ return /*#__PURE__*/_react.default.createElement("div", {
209
+ style: {
210
+ height: '100%'
211
+ }
212
+ }, error ? /*#__PURE__*/_react.default.createElement("div", {
213
+ className: "loading"
214
+ }, /*#__PURE__*/_react.default.createElement("h1", null, "OOPS!"), /*#__PURE__*/_react.default.createElement("div", null, error.response.data.message)) : position ? /*#__PURE__*/_react.default.createElement(_reactLeaflet.MapContainer, {
215
+ center: position,
216
+ zoom: 5,
217
+ scrollWheelZoom: true,
218
+ style: {
219
+ minHeight: '500px',
220
+ height: '100%'
221
+ }
222
+ // onClick={handleClick}
223
+ }, /*#__PURE__*/_react.default.createElement(_reactLeaflet.ImageOverlay, {
224
+ url: seats.background,
225
+ bounds: [[0, 0], [height * 0.03, width * 0.03]],
226
+ zIndex: 10
227
+ }), seats && seats.seats && seats.seats.map((s, i) => /*#__PURE__*/_react.default.createElement("div", {
228
+ key: i
229
+ }, /*#__PURE__*/_react.default.createElement(_reactLeaflet.ImageOverlay, {
230
+ url: "https://iticketseatingplan.blob.core.windows.net/embed/static/media/rippleload.08e6a08dd832819226ef.gif",
231
+ bounds: [[height * 0.03 - s.raw_y * 0.61 - 0.2, s.raw_x * 0.615 - 0.2], [height * 0.03 - s.raw_y * 0.61 + 0.2, s.raw_x * 0.615 + 0.2]],
232
+ opacity: chosenSeat && chosenSeat.seat.showingSeatId === s.showingSeatId ? 100 : 0,
233
+ zIndex: 10
234
+ }), s.status === 6 ? /*#__PURE__*/_react.default.createElement(_reactLeaflet.ImageOverlay, {
235
+ url: wheelchairSeat,
236
+ bounds: [[height * 0.03 - s.raw_y * 0.61 - 0.17, s.raw_x * 0.615 - 0.17], [height * 0.03 - s.raw_y * 0.61 + 0.17, s.raw_x * 0.615 + 0.17]],
237
+ zIndex: 10
238
+ }) : /*#__PURE__*/_react.default.createElement(_reactLeaflet.Circle, {
239
+ center: [
240
+ // (width * 0.03 - (s.raw_y - 11.5)) * 0.65,
241
+ // s.raw_x * 0.64,
242
+ height * 0.03 - s.raw_y * 0.61, s.raw_x * 0.615],
243
+ pathOptions: setInitialColor(s),
244
+ radius: 20000,
245
+ eventHandlers: {
246
+ click: e => handleClick(e, s)
247
+ }
248
+ // value={s}
249
+ }, /*#__PURE__*/_react.default.createElement(_reactLeaflet.Tooltip, {
250
+ direction: 'top',
251
+ offset: [0, height * 0.03 + -30]
252
+ }, s.rowName + '-' + s.columnName))))) : /*#__PURE__*/_react.default.createElement("div", {
253
+ className: "loading"
254
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("svg", {
255
+ width: "105",
256
+ height: "105",
257
+ viewBox: "0 0 105 105",
258
+ xmlns: "http://www.w3.org/2000/svg",
259
+ fill: "#2ecc71"
260
+ }, /*#__PURE__*/_react.default.createElement("circle", {
261
+ cx: "12.5",
262
+ cy: "12.5",
263
+ r: "12.5"
264
+ }, /*#__PURE__*/_react.default.createElement("animate", {
265
+ attributeName: "fill-opacity",
266
+ begin: "0s",
267
+ dur: "1s",
268
+ values: "1;.2;1",
269
+ calcMode: "linear",
270
+ repeatCount: "indefinite"
271
+ })), /*#__PURE__*/_react.default.createElement("circle", {
272
+ cx: "12.5",
273
+ cy: "52.5",
274
+ r: "12.5",
275
+ fillOpacity: ".5"
276
+ }, /*#__PURE__*/_react.default.createElement("animate", {
277
+ attributeName: "fill-opacity",
278
+ begin: "100ms",
279
+ dur: "1s",
280
+ values: "1;.2;1",
281
+ calcMode: "linear",
282
+ repeatCount: "indefinite"
283
+ })), /*#__PURE__*/_react.default.createElement("circle", {
284
+ cx: "52.5",
285
+ cy: "12.5",
286
+ r: "12.5"
287
+ }, /*#__PURE__*/_react.default.createElement("animate", {
288
+ attributeName: "fill-opacity",
289
+ begin: "300ms",
290
+ dur: "1s",
291
+ values: "1;.2;1",
292
+ calcMode: "linear",
293
+ repeatCount: "indefinite"
294
+ })), /*#__PURE__*/_react.default.createElement("circle", {
295
+ cx: "52.5",
296
+ cy: "52.5",
297
+ r: "12.5"
298
+ }, /*#__PURE__*/_react.default.createElement("animate", {
299
+ attributeName: "fill-opacity",
300
+ begin: "600ms",
301
+ dur: "1s",
302
+ values: "1;.2;1",
303
+ calcMode: "linear",
304
+ repeatCount: "indefinite"
305
+ })), /*#__PURE__*/_react.default.createElement("circle", {
306
+ cx: "92.5",
307
+ cy: "12.5",
308
+ r: "12.5"
309
+ }, /*#__PURE__*/_react.default.createElement("animate", {
310
+ attributeName: "fill-opacity",
311
+ begin: "800ms",
312
+ dur: "1s",
313
+ values: "1;.2;1",
314
+ calcMode: "linear",
315
+ repeatCount: "indefinite"
316
+ })), /*#__PURE__*/_react.default.createElement("circle", {
317
+ cx: "92.5",
318
+ cy: "52.5",
319
+ r: "12.5"
320
+ }, /*#__PURE__*/_react.default.createElement("animate", {
321
+ attributeName: "fill-opacity",
322
+ begin: "400ms",
323
+ dur: "1s",
324
+ values: "1;.2;1",
325
+ calcMode: "linear",
326
+ repeatCount: "indefinite"
327
+ })), /*#__PURE__*/_react.default.createElement("circle", {
328
+ cx: "12.5",
329
+ cy: "92.5",
330
+ r: "12.5"
331
+ }, /*#__PURE__*/_react.default.createElement("animate", {
332
+ attributeName: "fill-opacity",
333
+ begin: "700ms",
334
+ dur: "1s",
335
+ values: "1;.2;1",
336
+ calcMode: "linear",
337
+ repeatCount: "indefinite"
338
+ })), /*#__PURE__*/_react.default.createElement("circle", {
339
+ cx: "52.5",
340
+ cy: "92.5",
341
+ r: "12.5"
342
+ }, /*#__PURE__*/_react.default.createElement("animate", {
343
+ attributeName: "fill-opacity",
344
+ begin: "500ms",
345
+ dur: "1s",
346
+ values: "1;.2;1",
347
+ calcMode: "linear",
348
+ repeatCount: "indefinite"
349
+ })), /*#__PURE__*/_react.default.createElement("circle", {
350
+ cx: "92.5",
351
+ cy: "92.5",
352
+ r: "12.5"
353
+ }, /*#__PURE__*/_react.default.createElement("animate", {
354
+ attributeName: "fill-opacity",
355
+ begin: "200ms",
356
+ dur: "1s",
357
+ values: "1;.2;1",
358
+ calcMode: "linear",
359
+ repeatCount: "indefinite"
360
+ })))), /*#__PURE__*/_react.default.createElement("div", {
361
+ style: {
362
+ 'marginTop': '2rem'
363
+ }
364
+ }, "Initialising seating plan...")));
365
+ };
366
+ var _default = SeatingPlan;
367
+ exports.default = _default;
@@ -0,0 +1,695 @@
1
+ body {
2
+ margin: 0;
3
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5
+ sans-serif;
6
+ -webkit-font-smoothing: antialiased;
7
+ -moz-osx-font-smoothing: grayscale;
8
+ }
9
+
10
+ code {
11
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12
+ monospace;
13
+ }
14
+
15
+ .App {
16
+ height: 100%;
17
+ }
18
+
19
+ .loading {
20
+ display: flex;
21
+ justify-content: center;
22
+ align-items: center;
23
+ min-height: 500px;
24
+ flex-direction: column;
25
+ }
26
+
27
+
28
+ g:focus {
29
+ outline: none;
30
+ }
31
+
32
+ path:focus {
33
+ outline: none;
34
+ }
35
+
36
+
37
+
38
+ /* LEAFLET */
39
+
40
+ /* required styles */
41
+
42
+ .leaflet-pane,
43
+ .leaflet-tile,
44
+ .leaflet-marker-icon,
45
+ .leaflet-marker-shadow,
46
+ .leaflet-tile-container,
47
+ .leaflet-pane > svg,
48
+ .leaflet-pane > canvas,
49
+ .leaflet-zoom-box,
50
+ .leaflet-image-layer,
51
+ .leaflet-layer {
52
+ position: absolute;
53
+ left: 0;
54
+ top: 0;
55
+ }
56
+ .leaflet-container {
57
+ overflow: hidden;
58
+ }
59
+ .leaflet-tile,
60
+ .leaflet-marker-icon,
61
+ .leaflet-marker-shadow {
62
+ -webkit-user-select: none;
63
+ -moz-user-select: none;
64
+ user-select: none;
65
+ -webkit-user-drag: none;
66
+ }
67
+ /* Prevents IE11 from highlighting tiles in blue */
68
+ .leaflet-tile::selection {
69
+ background: transparent;
70
+ }
71
+ /* Safari renders non-retina tile on retina better with this, but Chrome is worse */
72
+ .leaflet-safari .leaflet-tile {
73
+ image-rendering: -webkit-optimize-contrast;
74
+ }
75
+ /* hack that prevents hw layers "stretching" when loading new tiles */
76
+ .leaflet-safari .leaflet-tile-container {
77
+ width: 1600px;
78
+ height: 1600px;
79
+ -webkit-transform-origin: 0 0;
80
+ }
81
+ .leaflet-marker-icon,
82
+ .leaflet-marker-shadow {
83
+ display: block;
84
+ }
85
+ /* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
86
+ /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
87
+ .leaflet-container .leaflet-overlay-pane svg {
88
+ max-width: none !important;
89
+ max-height: none !important;
90
+ }
91
+ .leaflet-container .leaflet-marker-pane img,
92
+ .leaflet-container .leaflet-shadow-pane img,
93
+ .leaflet-container .leaflet-tile-pane img,
94
+ .leaflet-container img.leaflet-image-layer,
95
+ .leaflet-container .leaflet-tile {
96
+ max-width: none !important;
97
+ max-height: none !important;
98
+ width: auto;
99
+ padding: 0;
100
+ }
101
+
102
+ .leaflet-container.leaflet-touch-zoom {
103
+ -ms-touch-action: pan-x pan-y;
104
+ touch-action: pan-x pan-y;
105
+ }
106
+ .leaflet-container.leaflet-touch-drag {
107
+ -ms-touch-action: pinch-zoom;
108
+ /* Fallback for FF which doesn't support pinch-zoom */
109
+ touch-action: none;
110
+ touch-action: pinch-zoom;
111
+ }
112
+ .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
113
+ -ms-touch-action: none;
114
+ touch-action: none;
115
+ }
116
+ .leaflet-container {
117
+ -webkit-tap-highlight-color: transparent;
118
+ }
119
+ .leaflet-container a {
120
+ -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
121
+ }
122
+ .leaflet-tile {
123
+ filter: inherit;
124
+ visibility: hidden;
125
+ }
126
+ .leaflet-tile-loaded {
127
+ visibility: inherit;
128
+ }
129
+ .leaflet-zoom-box {
130
+ width: 0;
131
+ height: 0;
132
+ -moz-box-sizing: border-box;
133
+ box-sizing: border-box;
134
+ z-index: 800;
135
+ }
136
+ /* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
137
+ .leaflet-overlay-pane svg {
138
+ -moz-user-select: none;
139
+ }
140
+
141
+ .leaflet-pane { z-index: 400; }
142
+
143
+ .leaflet-tile-pane { z-index: 200; }
144
+ .leaflet-overlay-pane { z-index: 400; }
145
+ .leaflet-shadow-pane { z-index: 500; }
146
+ .leaflet-marker-pane { z-index: 600; }
147
+ .leaflet-tooltip-pane { z-index: 650; }
148
+ .leaflet-popup-pane { z-index: 700; }
149
+
150
+ .leaflet-map-pane canvas { z-index: 100; }
151
+ .leaflet-map-pane svg { z-index: 200; }
152
+
153
+ .leaflet-vml-shape {
154
+ width: 1px;
155
+ height: 1px;
156
+ }
157
+ .lvml {
158
+ behavior: url(#default#VML);
159
+ display: inline-block;
160
+ position: absolute;
161
+ }
162
+
163
+
164
+ /* control positioning */
165
+
166
+ .leaflet-control {
167
+ position: relative;
168
+ z-index: 800;
169
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
170
+ pointer-events: auto;
171
+ }
172
+ .leaflet-top,
173
+ .leaflet-bottom {
174
+ position: absolute;
175
+ z-index: 1000;
176
+ pointer-events: none;
177
+ }
178
+ .leaflet-top {
179
+ top: 0;
180
+ }
181
+ .leaflet-right {
182
+ right: 0;
183
+ }
184
+ .leaflet-bottom {
185
+ bottom: 0;
186
+ }
187
+ .leaflet-left {
188
+ left: 0;
189
+ }
190
+ .leaflet-control {
191
+ float: left;
192
+ clear: both;
193
+ }
194
+ .leaflet-right .leaflet-control {
195
+ float: right;
196
+ }
197
+ .leaflet-top .leaflet-control {
198
+ margin-top: 10px;
199
+ }
200
+ .leaflet-bottom .leaflet-control {
201
+ margin-bottom: 10px;
202
+ }
203
+ .leaflet-left .leaflet-control {
204
+ margin-left: 10px;
205
+ }
206
+ .leaflet-right .leaflet-control {
207
+ margin-right: 10px;
208
+ }
209
+
210
+
211
+ /* zoom and fade animations */
212
+
213
+ .leaflet-fade-anim .leaflet-popup {
214
+ opacity: 0;
215
+ -webkit-transition: opacity 0.2s linear;
216
+ -moz-transition: opacity 0.2s linear;
217
+ transition: opacity 0.2s linear;
218
+ }
219
+ .leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
220
+ opacity: 1;
221
+ }
222
+ .leaflet-zoom-animated {
223
+ -webkit-transform-origin: 0 0;
224
+ -ms-transform-origin: 0 0;
225
+ transform-origin: 0 0;
226
+ }
227
+ svg.leaflet-zoom-animated {
228
+ will-change: transform;
229
+ }
230
+
231
+ .leaflet-zoom-anim .leaflet-zoom-animated {
232
+ -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
233
+ -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
234
+ transition: transform 0.25s cubic-bezier(0,0,0.25,1);
235
+ }
236
+ .leaflet-zoom-anim .leaflet-tile,
237
+ .leaflet-pan-anim .leaflet-tile {
238
+ -webkit-transition: none;
239
+ -moz-transition: none;
240
+ transition: none;
241
+ }
242
+
243
+ .leaflet-zoom-anim .leaflet-zoom-hide {
244
+ visibility: hidden;
245
+ }
246
+
247
+
248
+ /* cursors */
249
+
250
+ .leaflet-interactive {
251
+ cursor: pointer;
252
+ }
253
+ .leaflet-grab {
254
+ cursor: -webkit-grab;
255
+ cursor: -moz-grab;
256
+ cursor: grab;
257
+ }
258
+ .leaflet-crosshair,
259
+ .leaflet-crosshair .leaflet-interactive {
260
+ cursor: crosshair;
261
+ }
262
+ .leaflet-popup-pane,
263
+ .leaflet-control {
264
+ cursor: auto;
265
+ }
266
+ .leaflet-dragging .leaflet-grab,
267
+ .leaflet-dragging .leaflet-grab .leaflet-interactive,
268
+ .leaflet-dragging .leaflet-marker-draggable {
269
+ cursor: move;
270
+ cursor: -webkit-grabbing;
271
+ cursor: -moz-grabbing;
272
+ cursor: grabbing;
273
+ }
274
+
275
+ /* marker & overlays interactivity */
276
+ .leaflet-marker-icon,
277
+ .leaflet-marker-shadow,
278
+ .leaflet-image-layer,
279
+ .leaflet-pane > svg path,
280
+ .leaflet-tile-container {
281
+ pointer-events: none;
282
+ }
283
+
284
+ .leaflet-marker-icon.leaflet-interactive,
285
+ .leaflet-image-layer.leaflet-interactive,
286
+ .leaflet-pane > svg path.leaflet-interactive,
287
+ svg.leaflet-image-layer.leaflet-interactive path {
288
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
289
+ pointer-events: auto;
290
+ }
291
+
292
+ /* visual tweaks */
293
+
294
+ .leaflet-container {
295
+ background: #ddd;
296
+ outline-offset: 1px;
297
+ }
298
+ .leaflet-container a {
299
+ color: #0078A8;
300
+ }
301
+ .leaflet-zoom-box {
302
+ border: 2px dotted #38f;
303
+ background: rgba(255,255,255,0.5);
304
+ }
305
+
306
+
307
+ /* general typography */
308
+ .leaflet-container {
309
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
310
+ font-size: 12px;
311
+ font-size: 0.75rem;
312
+ line-height: 1.5;
313
+ }
314
+
315
+
316
+ /* general toolbar styles */
317
+
318
+ .leaflet-bar {
319
+ box-shadow: 0 1px 5px rgba(0,0,0,0.65);
320
+ border-radius: 4px;
321
+ }
322
+ .leaflet-bar a {
323
+ background-color: #fff;
324
+ border-bottom: 1px solid #ccc;
325
+ width: 26px;
326
+ height: 26px;
327
+ line-height: 26px;
328
+ display: block;
329
+ text-align: center;
330
+ text-decoration: none;
331
+ color: black;
332
+ }
333
+ .leaflet-bar a,
334
+ .leaflet-control-layers-toggle {
335
+ background-position: 50% 50%;
336
+ background-repeat: no-repeat;
337
+ display: block;
338
+ }
339
+ .leaflet-bar a:hover,
340
+ .leaflet-bar a:focus {
341
+ background-color: #f4f4f4;
342
+ }
343
+ .leaflet-bar a:first-child {
344
+ border-top-left-radius: 4px;
345
+ border-top-right-radius: 4px;
346
+ }
347
+ .leaflet-bar a:last-child {
348
+ border-bottom-left-radius: 4px;
349
+ border-bottom-right-radius: 4px;
350
+ border-bottom: none;
351
+ }
352
+ .leaflet-bar a.leaflet-disabled {
353
+ cursor: default;
354
+ background-color: #f4f4f4;
355
+ color: #bbb;
356
+ }
357
+
358
+ .leaflet-touch .leaflet-bar a {
359
+ width: 30px;
360
+ height: 30px;
361
+ line-height: 30px;
362
+ }
363
+ .leaflet-touch .leaflet-bar a:first-child {
364
+ border-top-left-radius: 2px;
365
+ border-top-right-radius: 2px;
366
+ }
367
+ .leaflet-touch .leaflet-bar a:last-child {
368
+ border-bottom-left-radius: 2px;
369
+ border-bottom-right-radius: 2px;
370
+ }
371
+
372
+ /* zoom control */
373
+
374
+ .leaflet-control-zoom-in,
375
+ .leaflet-control-zoom-out {
376
+ font: bold 18px 'Lucida Console', Monaco, monospace;
377
+ text-indent: 1px;
378
+ }
379
+
380
+ .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
381
+ font-size: 22px;
382
+ }
383
+
384
+
385
+ /* layers control */
386
+
387
+ .leaflet-control-layers {
388
+ box-shadow: 0 1px 5px rgba(0,0,0,0.4);
389
+ background: #fff;
390
+ border-radius: 5px;
391
+ }
392
+ .leaflet-control-layers-toggle {
393
+ background-image: url(../assets/layers.png);
394
+ width: 36px;
395
+ height: 36px;
396
+ }
397
+ .leaflet-retina .leaflet-control-layers-toggle {
398
+ background-image: url(../assets/layers-2x.png);
399
+ background-size: 26px 26px;
400
+ }
401
+ .leaflet-touch .leaflet-control-layers-toggle {
402
+ width: 44px;
403
+ height: 44px;
404
+ }
405
+ .leaflet-control-layers .leaflet-control-layers-list,
406
+ .leaflet-control-layers-expanded .leaflet-control-layers-toggle {
407
+ display: none;
408
+ }
409
+ .leaflet-control-layers-expanded .leaflet-control-layers-list {
410
+ display: block;
411
+ position: relative;
412
+ }
413
+ .leaflet-control-layers-expanded {
414
+ padding: 6px 10px 6px 6px;
415
+ color: #333;
416
+ background: #fff;
417
+ }
418
+ .leaflet-control-layers-scrollbar {
419
+ overflow-y: scroll;
420
+ overflow-x: hidden;
421
+ padding-right: 5px;
422
+ }
423
+ .leaflet-control-layers-selector {
424
+ margin-top: 2px;
425
+ position: relative;
426
+ top: 1px;
427
+ }
428
+ .leaflet-control-layers label {
429
+ display: block;
430
+ font-size: 13px;
431
+ font-size: 1.08333em;
432
+ }
433
+ .leaflet-control-layers-separator {
434
+ height: 0;
435
+ border-top: 1px solid #ddd;
436
+ margin: 5px -10px 5px -6px;
437
+ }
438
+
439
+ /* Default icon URLs */
440
+ .leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
441
+ background-image: url(../assets/marker-icon.png);
442
+ }
443
+
444
+
445
+ /* attribution and scale controls */
446
+
447
+ .leaflet-container .leaflet-control-attribution {
448
+ background: #fff;
449
+ background: rgba(255, 255, 255, 0.8);
450
+ margin: 0;
451
+ }
452
+ .leaflet-control-attribution,
453
+ .leaflet-control-scale-line {
454
+ padding: 0 5px;
455
+ color: #333;
456
+ line-height: 1.4;
457
+ }
458
+ .leaflet-control-attribution a {
459
+ text-decoration: none;
460
+ }
461
+ .leaflet-control-attribution a:hover,
462
+ .leaflet-control-attribution a:focus {
463
+ text-decoration: underline;
464
+ }
465
+ .leaflet-attribution-flag {
466
+ display: inline !important;
467
+ vertical-align: baseline !important;
468
+ width: 1em;
469
+ height: 0.6669em;
470
+ }
471
+ .leaflet-left .leaflet-control-scale {
472
+ margin-left: 5px;
473
+ }
474
+ .leaflet-bottom .leaflet-control-scale {
475
+ margin-bottom: 5px;
476
+ }
477
+ .leaflet-control-scale-line {
478
+ border: 2px solid #777;
479
+ border-top: none;
480
+ line-height: 1.1;
481
+ padding: 2px 5px 1px;
482
+ white-space: nowrap;
483
+ -moz-box-sizing: border-box;
484
+ box-sizing: border-box;
485
+ background: rgba(255, 255, 255, 0.8);
486
+ text-shadow: 1px 1px #fff;
487
+ }
488
+ .leaflet-control-scale-line:not(:first-child) {
489
+ border-top: 2px solid #777;
490
+ border-bottom: none;
491
+ margin-top: -2px;
492
+ }
493
+ .leaflet-control-scale-line:not(:first-child):not(:last-child) {
494
+ border-bottom: 2px solid #777;
495
+ }
496
+
497
+ .leaflet-touch .leaflet-control-attribution,
498
+ .leaflet-touch .leaflet-control-layers,
499
+ .leaflet-touch .leaflet-bar {
500
+ box-shadow: none;
501
+ }
502
+ .leaflet-touch .leaflet-control-layers,
503
+ .leaflet-touch .leaflet-bar {
504
+ border: 2px solid rgba(0,0,0,0.2);
505
+ background-clip: padding-box;
506
+ }
507
+
508
+
509
+ /* popup */
510
+
511
+ .leaflet-popup {
512
+ position: absolute;
513
+ text-align: center;
514
+ margin-bottom: 20px;
515
+ }
516
+ .leaflet-popup-content-wrapper {
517
+ padding: 1px;
518
+ text-align: left;
519
+ border-radius: 12px;
520
+ }
521
+ .leaflet-popup-content {
522
+ margin: 13px 24px 13px 20px;
523
+ line-height: 1.3;
524
+ font-size: 13px;
525
+ font-size: 1.08333em;
526
+ min-height: 1px;
527
+ }
528
+ .leaflet-popup-content p {
529
+ margin: 17px 0;
530
+ margin: 1.3em 0;
531
+ }
532
+ .leaflet-popup-tip-container {
533
+ width: 40px;
534
+ height: 20px;
535
+ position: absolute;
536
+ left: 50%;
537
+ margin-top: -1px;
538
+ margin-left: -20px;
539
+ overflow: hidden;
540
+ pointer-events: none;
541
+ }
542
+ .leaflet-popup-tip {
543
+ width: 17px;
544
+ height: 17px;
545
+ padding: 1px;
546
+
547
+ margin: -10px auto 0;
548
+ pointer-events: auto;
549
+
550
+ -webkit-transform: rotate(45deg);
551
+ -moz-transform: rotate(45deg);
552
+ -ms-transform: rotate(45deg);
553
+ transform: rotate(45deg);
554
+ }
555
+ .leaflet-popup-content-wrapper,
556
+ .leaflet-popup-tip {
557
+ background: white;
558
+ color: #333;
559
+ box-shadow: 0 3px 14px rgba(0,0,0,0.4);
560
+ }
561
+ .leaflet-container a.leaflet-popup-close-button {
562
+ position: absolute;
563
+ top: 0;
564
+ right: 0;
565
+ border: none;
566
+ text-align: center;
567
+ width: 24px;
568
+ height: 24px;
569
+ font: 16px/24px Tahoma, Verdana, sans-serif;
570
+ color: #757575;
571
+ text-decoration: none;
572
+ background: transparent;
573
+ }
574
+ .leaflet-container a.leaflet-popup-close-button:hover,
575
+ .leaflet-container a.leaflet-popup-close-button:focus {
576
+ color: #585858;
577
+ }
578
+ .leaflet-popup-scrolled {
579
+ overflow: auto;
580
+ }
581
+
582
+ .leaflet-oldie .leaflet-popup-content-wrapper {
583
+ -ms-zoom: 1;
584
+ }
585
+ .leaflet-oldie .leaflet-popup-tip {
586
+ width: 24px;
587
+ margin: 0 auto;
588
+
589
+ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
590
+ filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
591
+ }
592
+
593
+ .leaflet-oldie .leaflet-control-zoom,
594
+ .leaflet-oldie .leaflet-control-layers,
595
+ .leaflet-oldie .leaflet-popup-content-wrapper,
596
+ .leaflet-oldie .leaflet-popup-tip {
597
+ border: 1px solid #999;
598
+ }
599
+
600
+
601
+ /* div icon */
602
+
603
+ .leaflet-div-icon {
604
+ background: #fff;
605
+ border: 1px solid #666;
606
+ }
607
+
608
+
609
+ /* Tooltip */
610
+ /* Base styles for the element that has a tooltip */
611
+ .leaflet-tooltip {
612
+ position: absolute;
613
+ padding: 6px;
614
+ background-color: #fff;
615
+ border: 1px solid #fff;
616
+ border-radius: 3px;
617
+ color: #222;
618
+ white-space: nowrap;
619
+ -webkit-user-select: none;
620
+ -moz-user-select: none;
621
+ -ms-user-select: none;
622
+ user-select: none;
623
+ pointer-events: none;
624
+ box-shadow: 0 1px 3px rgba(0,0,0,0.4);
625
+ }
626
+ .leaflet-tooltip.leaflet-interactive {
627
+ cursor: pointer;
628
+ pointer-events: auto;
629
+ }
630
+ .leaflet-tooltip-top:before,
631
+ .leaflet-tooltip-bottom:before,
632
+ .leaflet-tooltip-left:before,
633
+ .leaflet-tooltip-right:before {
634
+ position: absolute;
635
+ pointer-events: none;
636
+ border: 6px solid transparent;
637
+ background: transparent;
638
+ content: "";
639
+ }
640
+
641
+ /* Directions */
642
+
643
+ .leaflet-tooltip-bottom {
644
+ margin-top: 6px;
645
+ }
646
+ .leaflet-tooltip-top {
647
+ margin-top: -6px;
648
+ }
649
+ .leaflet-tooltip-bottom:before,
650
+ .leaflet-tooltip-top:before {
651
+ left: 50%;
652
+ margin-left: -6px;
653
+ }
654
+ .leaflet-tooltip-top:before {
655
+ bottom: 0;
656
+ margin-bottom: -12px;
657
+ border-top-color: #fff;
658
+ }
659
+ .leaflet-tooltip-bottom:before {
660
+ top: 0;
661
+ margin-top: -12px;
662
+ margin-left: -6px;
663
+ border-bottom-color: #fff;
664
+ }
665
+ .leaflet-tooltip-left {
666
+ margin-left: -6px;
667
+ }
668
+ .leaflet-tooltip-right {
669
+ margin-left: 6px;
670
+ }
671
+ .leaflet-tooltip-left:before,
672
+ .leaflet-tooltip-right:before {
673
+ top: 50%;
674
+ margin-top: -6px;
675
+ }
676
+ .leaflet-tooltip-left:before {
677
+ right: 0;
678
+ margin-right: -12px;
679
+ border-left-color: #fff;
680
+ }
681
+ .leaflet-tooltip-right:before {
682
+ left: 0;
683
+ margin-left: -12px;
684
+ border-right-color: #fff;
685
+ }
686
+
687
+ /* Printing */
688
+
689
+ @media print {
690
+ /* Prevent printers from removing background-images of controls. */
691
+ .leaflet-control {
692
+ -webkit-print-color-adjust: exact;
693
+ print-color-adjust: exact;
694
+ }
695
+ }
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Badge", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Badge.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Button", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _Button.default;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "SeatingPlan", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _SeatingPlan.default;
22
+ }
23
+ });
24
+ var _Badge = _interopRequireDefault(require("./components/Badge"));
25
+ var _Button = _interopRequireDefault(require("./components/Button"));
26
+ var _SeatingPlan = _interopRequireDefault(require("./components/SeatingPlan"));
27
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "iticket-seatingplan-dev",
3
+ "description": "Seating plan with FLEXi pricing",
4
+ "author": "gedwyne",
5
+ "version": "0.0.1",
6
+ "private": false,
7
+ "keywords": [
8
+ "iticket",
9
+ "seatingplan"
10
+ ],
11
+ "main": "dist/index.js",
12
+ "module": "dist/index.js",
13
+ "files": [
14
+ "dist",
15
+ "README.md"
16
+ ],
17
+ "dependencies": {
18
+ "@babel/polyfill": "^7.12.1",
19
+ "leaflet": "^1.9.3",
20
+ "react-leaflet": "^4.2.1"
21
+ },
22
+ "scripts": {
23
+ "build": "rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files",
24
+ "start": "react-scripts start"
25
+ },
26
+ "browserslist": {
27
+ "production": [
28
+ ">0.2%",
29
+ "not dead",
30
+ "not op_mini all"
31
+ ],
32
+ "development": [
33
+ "last 1 chrome version",
34
+ "last 1 firefox version",
35
+ "last 1 safari version"
36
+ ]
37
+ },
38
+ "devDependencies": {
39
+ "@babel/cli": "^7.22.5",
40
+ "@babel/core": "^7.22.5",
41
+ "@babel/preset-env": "^7.22.5",
42
+ "@babel/preset-react": "^7.22.5"
43
+ }
44
+ }