@everymatrix/lottery-ticket-controller 0.0.3
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/dist/cjs/index-498fdd8e.js +1134 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js +71 -0
- package/dist/cjs/lottery-ticket-controller.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.css +3 -0
- package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.js +309 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.js +2 -0
- package/dist/components/lottery-ticket-controller.d.ts +11 -0
- package/dist/components/lottery-ticket-controller.js +98 -0
- package/dist/esm/index-4b81518c.js +1108 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/lottery-ticket-controller.entry.js +67 -0
- package/dist/esm/lottery-ticket-controller.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-ticket-controller/index.esm.js +0 -0
- package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -0
- package/dist/lottery-ticket-controller/p-5186fd30.entry.js +1 -0
- package/dist/lottery-ticket-controller/p-fe83d21a.js +2 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-ticket-controller/.stencil/packages/lottery-ticket-controller/stencil.config.d.ts +2 -0
- package/dist/types/components/lottery-ticket-controller/lottery-ticket-controller.d.ts +56 -0
- package/dist/types/components.d.ts +138 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-498fdd8e.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.17.0 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["lottery-ticket-controller.cjs",[[1,"lottery-ticket-controller",{"endpoint":[1],"ticketId":[2,"ticket-id"],"ticketDescription":[1,"ticket-description"],"gameId":[1,"game-id"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"numberOfGrids":[2,"number-of-grids"],"last":[4],"language":[1],"autoPick":[4,"auto-pick"],"resetButton":[4,"reset-button"]},[[0,"helperAccordionAction","helperAccordionActionHandler"]]]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-498fdd8e.js');
|
|
6
|
+
require('@everymatrix/helper-accordion');
|
|
7
|
+
require('@everymatrix/lottery-ticket');
|
|
8
|
+
|
|
9
|
+
const lotteryTicketControllerCss = ":host{display:block}";
|
|
10
|
+
|
|
11
|
+
const LotteryTicketController = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.deleteTicketEvent = index.createEvent(this, "deleteTicket", 7);
|
|
15
|
+
/**
|
|
16
|
+
* Endpoint URL for the source of data (NorWAy standard)
|
|
17
|
+
*/
|
|
18
|
+
this.endpoint = '';
|
|
19
|
+
/**
|
|
20
|
+
* Ticket number
|
|
21
|
+
*/
|
|
22
|
+
this.ticketId = 1;
|
|
23
|
+
/**
|
|
24
|
+
* Activates postMessages as events for actions from the widget
|
|
25
|
+
*/
|
|
26
|
+
this.postMessage = false;
|
|
27
|
+
/**
|
|
28
|
+
* Name of the event emitter by the action button
|
|
29
|
+
*/
|
|
30
|
+
this.eventName = 'deleteTicketAction';
|
|
31
|
+
/**
|
|
32
|
+
* Collapsed
|
|
33
|
+
*/
|
|
34
|
+
this.collapsed = true;
|
|
35
|
+
/**
|
|
36
|
+
* Number of grids?
|
|
37
|
+
*/
|
|
38
|
+
this.numberOfGrids = 1;
|
|
39
|
+
/**
|
|
40
|
+
* This toggles if the last ticket added should be expanded or not
|
|
41
|
+
*/
|
|
42
|
+
this.last = false;
|
|
43
|
+
/**
|
|
44
|
+
* Language
|
|
45
|
+
*/
|
|
46
|
+
this.language = 'en';
|
|
47
|
+
/**
|
|
48
|
+
* Shows the auto-pick button
|
|
49
|
+
*/
|
|
50
|
+
this.autoPick = false;
|
|
51
|
+
/**
|
|
52
|
+
* Shows the reset button
|
|
53
|
+
*/
|
|
54
|
+
this.resetButton = false;
|
|
55
|
+
}
|
|
56
|
+
// @TODO fix the `any` type
|
|
57
|
+
helperAccordionActionHandler() {
|
|
58
|
+
if (this.postMessage) {
|
|
59
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
60
|
+
}
|
|
61
|
+
this.deleteTicketEvent.emit({
|
|
62
|
+
ticketId: this.ticketId
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return (index.h("div", null, index.h("helper-accordion", { "header-title": 'Ticket ' + this.ticketId, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language }, index.h("div", { slot: "accordionContent" }, index.h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick })))));
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
LotteryTicketController.style = lotteryTicketControllerCss;
|
|
70
|
+
|
|
71
|
+
exports.lottery_ticket_controller = LotteryTicketController;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-498fdd8e.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.17.0 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('lottery-ticket-controller.cjs.js', document.baseURI).href));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["lottery-ticket-controller.cjs",[[1,"lottery-ticket-controller",{"endpoint":[1],"ticketId":[2,"ticket-id"],"ticketDescription":[1,"ticket-description"],"gameId":[1,"game-id"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"numberOfGrids":[2,"number-of-grids"],"last":[4],"language":[1],"autoPick":[4,"auto-pick"],"resetButton":[4,"reset-button"]},[[0,"helperAccordionAction","helperAccordionActionHandler"]]]]]], options);
|
|
19
|
+
});
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { Component, h, Listen, Prop, Event } from '@stencil/core';
|
|
2
|
+
import '@everymatrix/helper-accordion';
|
|
3
|
+
import '@everymatrix/lottery-ticket';
|
|
4
|
+
export class LotteryTicketController {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Endpoint URL for the source of data (NorWAy standard)
|
|
8
|
+
*/
|
|
9
|
+
this.endpoint = '';
|
|
10
|
+
/**
|
|
11
|
+
* Ticket number
|
|
12
|
+
*/
|
|
13
|
+
this.ticketId = 1;
|
|
14
|
+
/**
|
|
15
|
+
* Activates postMessages as events for actions from the widget
|
|
16
|
+
*/
|
|
17
|
+
this.postMessage = false;
|
|
18
|
+
/**
|
|
19
|
+
* Name of the event emitter by the action button
|
|
20
|
+
*/
|
|
21
|
+
this.eventName = 'deleteTicketAction';
|
|
22
|
+
/**
|
|
23
|
+
* Collapsed
|
|
24
|
+
*/
|
|
25
|
+
this.collapsed = true;
|
|
26
|
+
/**
|
|
27
|
+
* Number of grids?
|
|
28
|
+
*/
|
|
29
|
+
this.numberOfGrids = 1;
|
|
30
|
+
/**
|
|
31
|
+
* This toggles if the last ticket added should be expanded or not
|
|
32
|
+
*/
|
|
33
|
+
this.last = false;
|
|
34
|
+
/**
|
|
35
|
+
* Language
|
|
36
|
+
*/
|
|
37
|
+
this.language = 'en';
|
|
38
|
+
/**
|
|
39
|
+
* Shows the auto-pick button
|
|
40
|
+
*/
|
|
41
|
+
this.autoPick = false;
|
|
42
|
+
/**
|
|
43
|
+
* Shows the reset button
|
|
44
|
+
*/
|
|
45
|
+
this.resetButton = false;
|
|
46
|
+
}
|
|
47
|
+
// @TODO fix the `any` type
|
|
48
|
+
helperAccordionActionHandler() {
|
|
49
|
+
if (this.postMessage) {
|
|
50
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
51
|
+
}
|
|
52
|
+
this.deleteTicketEvent.emit({
|
|
53
|
+
ticketId: this.ticketId
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
return (h("div", null,
|
|
58
|
+
h("helper-accordion", { "header-title": 'Ticket ' + this.ticketId, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language },
|
|
59
|
+
h("div", { slot: "accordionContent" },
|
|
60
|
+
h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick })))));
|
|
61
|
+
}
|
|
62
|
+
static get is() { return "lottery-ticket-controller"; }
|
|
63
|
+
static get encapsulation() { return "shadow"; }
|
|
64
|
+
static get originalStyleUrls() { return {
|
|
65
|
+
"$": ["lottery-ticket-controller.scss"]
|
|
66
|
+
}; }
|
|
67
|
+
static get styleUrls() { return {
|
|
68
|
+
"$": ["lottery-ticket-controller.css"]
|
|
69
|
+
}; }
|
|
70
|
+
static get properties() { return {
|
|
71
|
+
"endpoint": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string",
|
|
76
|
+
"resolved": "string",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": "Endpoint URL for the source of data (NorWAy standard)"
|
|
84
|
+
},
|
|
85
|
+
"attribute": "endpoint",
|
|
86
|
+
"reflect": false,
|
|
87
|
+
"defaultValue": "''"
|
|
88
|
+
},
|
|
89
|
+
"ticketId": {
|
|
90
|
+
"type": "number",
|
|
91
|
+
"mutable": false,
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "number",
|
|
94
|
+
"resolved": "number",
|
|
95
|
+
"references": {}
|
|
96
|
+
},
|
|
97
|
+
"required": false,
|
|
98
|
+
"optional": false,
|
|
99
|
+
"docs": {
|
|
100
|
+
"tags": [],
|
|
101
|
+
"text": "Ticket number"
|
|
102
|
+
},
|
|
103
|
+
"attribute": "ticket-id",
|
|
104
|
+
"reflect": false,
|
|
105
|
+
"defaultValue": "1"
|
|
106
|
+
},
|
|
107
|
+
"ticketDescription": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "string",
|
|
112
|
+
"resolved": "string",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": "Ticket header description"
|
|
120
|
+
},
|
|
121
|
+
"attribute": "ticket-description",
|
|
122
|
+
"reflect": false
|
|
123
|
+
},
|
|
124
|
+
"gameId": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "string",
|
|
129
|
+
"resolved": "string",
|
|
130
|
+
"references": {}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": "ID of the lottery game"
|
|
137
|
+
},
|
|
138
|
+
"attribute": "game-id",
|
|
139
|
+
"reflect": false
|
|
140
|
+
},
|
|
141
|
+
"postMessage": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "boolean",
|
|
146
|
+
"resolved": "boolean",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": "Activates postMessages as events for actions from the widget"
|
|
154
|
+
},
|
|
155
|
+
"attribute": "post-message",
|
|
156
|
+
"reflect": false,
|
|
157
|
+
"defaultValue": "false"
|
|
158
|
+
},
|
|
159
|
+
"eventName": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"mutable": false,
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "string",
|
|
164
|
+
"resolved": "string",
|
|
165
|
+
"references": {}
|
|
166
|
+
},
|
|
167
|
+
"required": false,
|
|
168
|
+
"optional": false,
|
|
169
|
+
"docs": {
|
|
170
|
+
"tags": [],
|
|
171
|
+
"text": "Name of the event emitter by the action button"
|
|
172
|
+
},
|
|
173
|
+
"attribute": "event-name",
|
|
174
|
+
"reflect": false,
|
|
175
|
+
"defaultValue": "'deleteTicketAction'"
|
|
176
|
+
},
|
|
177
|
+
"collapsed": {
|
|
178
|
+
"type": "boolean",
|
|
179
|
+
"mutable": false,
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "boolean",
|
|
182
|
+
"resolved": "boolean",
|
|
183
|
+
"references": {}
|
|
184
|
+
},
|
|
185
|
+
"required": false,
|
|
186
|
+
"optional": false,
|
|
187
|
+
"docs": {
|
|
188
|
+
"tags": [],
|
|
189
|
+
"text": "Collapsed"
|
|
190
|
+
},
|
|
191
|
+
"attribute": "collapsed",
|
|
192
|
+
"reflect": false,
|
|
193
|
+
"defaultValue": "true"
|
|
194
|
+
},
|
|
195
|
+
"numberOfGrids": {
|
|
196
|
+
"type": "number",
|
|
197
|
+
"mutable": false,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "number",
|
|
200
|
+
"resolved": "number",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": false,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Number of grids?"
|
|
208
|
+
},
|
|
209
|
+
"attribute": "number-of-grids",
|
|
210
|
+
"reflect": false,
|
|
211
|
+
"defaultValue": "1"
|
|
212
|
+
},
|
|
213
|
+
"last": {
|
|
214
|
+
"type": "boolean",
|
|
215
|
+
"mutable": false,
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "boolean",
|
|
218
|
+
"resolved": "boolean",
|
|
219
|
+
"references": {}
|
|
220
|
+
},
|
|
221
|
+
"required": false,
|
|
222
|
+
"optional": false,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": "This toggles if the last ticket added should be expanded or not"
|
|
226
|
+
},
|
|
227
|
+
"attribute": "last",
|
|
228
|
+
"reflect": false,
|
|
229
|
+
"defaultValue": "false"
|
|
230
|
+
},
|
|
231
|
+
"language": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"mutable": false,
|
|
234
|
+
"complexType": {
|
|
235
|
+
"original": "string",
|
|
236
|
+
"resolved": "string",
|
|
237
|
+
"references": {}
|
|
238
|
+
},
|
|
239
|
+
"required": false,
|
|
240
|
+
"optional": false,
|
|
241
|
+
"docs": {
|
|
242
|
+
"tags": [],
|
|
243
|
+
"text": "Language"
|
|
244
|
+
},
|
|
245
|
+
"attribute": "language",
|
|
246
|
+
"reflect": false,
|
|
247
|
+
"defaultValue": "'en'"
|
|
248
|
+
},
|
|
249
|
+
"autoPick": {
|
|
250
|
+
"type": "boolean",
|
|
251
|
+
"mutable": false,
|
|
252
|
+
"complexType": {
|
|
253
|
+
"original": "boolean",
|
|
254
|
+
"resolved": "boolean",
|
|
255
|
+
"references": {}
|
|
256
|
+
},
|
|
257
|
+
"required": false,
|
|
258
|
+
"optional": false,
|
|
259
|
+
"docs": {
|
|
260
|
+
"tags": [],
|
|
261
|
+
"text": "Shows the auto-pick button"
|
|
262
|
+
},
|
|
263
|
+
"attribute": "auto-pick",
|
|
264
|
+
"reflect": false,
|
|
265
|
+
"defaultValue": "false"
|
|
266
|
+
},
|
|
267
|
+
"resetButton": {
|
|
268
|
+
"type": "boolean",
|
|
269
|
+
"mutable": false,
|
|
270
|
+
"complexType": {
|
|
271
|
+
"original": "boolean",
|
|
272
|
+
"resolved": "boolean",
|
|
273
|
+
"references": {}
|
|
274
|
+
},
|
|
275
|
+
"required": false,
|
|
276
|
+
"optional": false,
|
|
277
|
+
"docs": {
|
|
278
|
+
"tags": [],
|
|
279
|
+
"text": "Shows the reset button"
|
|
280
|
+
},
|
|
281
|
+
"attribute": "reset-button",
|
|
282
|
+
"reflect": false,
|
|
283
|
+
"defaultValue": "false"
|
|
284
|
+
}
|
|
285
|
+
}; }
|
|
286
|
+
static get events() { return [{
|
|
287
|
+
"method": "deleteTicketEvent",
|
|
288
|
+
"name": "deleteTicket",
|
|
289
|
+
"bubbles": true,
|
|
290
|
+
"cancelable": true,
|
|
291
|
+
"composed": true,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": ""
|
|
295
|
+
},
|
|
296
|
+
"complexType": {
|
|
297
|
+
"original": "any",
|
|
298
|
+
"resolved": "any",
|
|
299
|
+
"references": {}
|
|
300
|
+
}
|
|
301
|
+
}]; }
|
|
302
|
+
static get listeners() { return [{
|
|
303
|
+
"name": "helperAccordionAction",
|
|
304
|
+
"method": "helperAccordionActionHandler",
|
|
305
|
+
"target": undefined,
|
|
306
|
+
"capture": false,
|
|
307
|
+
"passive": false
|
|
308
|
+
}]; }
|
|
309
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* LotteryTicketController custom elements */
|
|
2
|
+
export { LotteryTicketController as LotteryTicketController } from '../types/components/lottery-ticket-controller/lottery-ticket-controller';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Used to manually set the base path where assets can be found.
|
|
6
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
7
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
8
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
9
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
10
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
11
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
12
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
13
|
+
*/
|
|
14
|
+
export declare const setAssetPath: (path: string) => void;
|
|
15
|
+
|
|
16
|
+
export interface SetPlatformOptions {
|
|
17
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
18
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
19
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
22
|
+
export * from '../types';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface LotteryTicketController extends Components.LotteryTicketController, HTMLElement {}
|
|
4
|
+
export const LotteryTicketController: {
|
|
5
|
+
prototype: LotteryTicketController;
|
|
6
|
+
new (): LotteryTicketController;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import '@everymatrix/helper-accordion';
|
|
3
|
+
import '@everymatrix/lottery-ticket';
|
|
4
|
+
|
|
5
|
+
const lotteryTicketControllerCss = ":host{display:block}";
|
|
6
|
+
|
|
7
|
+
const LotteryTicketController$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.deleteTicketEvent = createEvent(this, "deleteTicket", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Endpoint URL for the source of data (NorWAy standard)
|
|
15
|
+
*/
|
|
16
|
+
this.endpoint = '';
|
|
17
|
+
/**
|
|
18
|
+
* Ticket number
|
|
19
|
+
*/
|
|
20
|
+
this.ticketId = 1;
|
|
21
|
+
/**
|
|
22
|
+
* Activates postMessages as events for actions from the widget
|
|
23
|
+
*/
|
|
24
|
+
this.postMessage = false;
|
|
25
|
+
/**
|
|
26
|
+
* Name of the event emitter by the action button
|
|
27
|
+
*/
|
|
28
|
+
this.eventName = 'deleteTicketAction';
|
|
29
|
+
/**
|
|
30
|
+
* Collapsed
|
|
31
|
+
*/
|
|
32
|
+
this.collapsed = true;
|
|
33
|
+
/**
|
|
34
|
+
* Number of grids?
|
|
35
|
+
*/
|
|
36
|
+
this.numberOfGrids = 1;
|
|
37
|
+
/**
|
|
38
|
+
* This toggles if the last ticket added should be expanded or not
|
|
39
|
+
*/
|
|
40
|
+
this.last = false;
|
|
41
|
+
/**
|
|
42
|
+
* Language
|
|
43
|
+
*/
|
|
44
|
+
this.language = 'en';
|
|
45
|
+
/**
|
|
46
|
+
* Shows the auto-pick button
|
|
47
|
+
*/
|
|
48
|
+
this.autoPick = false;
|
|
49
|
+
/**
|
|
50
|
+
* Shows the reset button
|
|
51
|
+
*/
|
|
52
|
+
this.resetButton = false;
|
|
53
|
+
}
|
|
54
|
+
// @TODO fix the `any` type
|
|
55
|
+
helperAccordionActionHandler() {
|
|
56
|
+
if (this.postMessage) {
|
|
57
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
58
|
+
}
|
|
59
|
+
this.deleteTicketEvent.emit({
|
|
60
|
+
ticketId: this.ticketId
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
return (h("div", null, h("helper-accordion", { "header-title": 'Ticket ' + this.ticketId, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language }, h("div", { slot: "accordionContent" }, h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick })))));
|
|
65
|
+
}
|
|
66
|
+
static get style() { return lotteryTicketControllerCss; }
|
|
67
|
+
}, [1, "lottery-ticket-controller", {
|
|
68
|
+
"endpoint": [1],
|
|
69
|
+
"ticketId": [2, "ticket-id"],
|
|
70
|
+
"ticketDescription": [1, "ticket-description"],
|
|
71
|
+
"gameId": [1, "game-id"],
|
|
72
|
+
"postMessage": [4, "post-message"],
|
|
73
|
+
"eventName": [1, "event-name"],
|
|
74
|
+
"collapsed": [4],
|
|
75
|
+
"numberOfGrids": [2, "number-of-grids"],
|
|
76
|
+
"last": [4],
|
|
77
|
+
"language": [1],
|
|
78
|
+
"autoPick": [4, "auto-pick"],
|
|
79
|
+
"resetButton": [4, "reset-button"]
|
|
80
|
+
}, [[0, "helperAccordionAction", "helperAccordionActionHandler"]]]);
|
|
81
|
+
function defineCustomElement$1() {
|
|
82
|
+
if (typeof customElements === "undefined") {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const components = ["lottery-ticket-controller"];
|
|
86
|
+
components.forEach(tagName => { switch (tagName) {
|
|
87
|
+
case "lottery-ticket-controller":
|
|
88
|
+
if (!customElements.get(tagName)) {
|
|
89
|
+
customElements.define(tagName, LotteryTicketController$1);
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
} });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const LotteryTicketController = LotteryTicketController$1;
|
|
96
|
+
const defineCustomElement = defineCustomElement$1;
|
|
97
|
+
|
|
98
|
+
export { LotteryTicketController, defineCustomElement };
|