@everymatrix/lottery-ticket-controller 0.0.3 → 0.1.4
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/helper-accordion_5.cjs.entry.js +514 -0
- package/dist/cjs/{index-498fdd8e.js → index-95915aab.js} +136 -12
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/lottery-ticket-controller.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +27 -2
- package/dist/components/helper-accordion.js +6 -0
- package/dist/components/helper-accordion2.js +115 -0
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +0 -1
- package/dist/components/lottery-bullet.js +6 -0
- package/dist/components/lottery-bullet2.js +56 -0
- package/dist/components/lottery-grid.js +6 -0
- package/dist/components/lottery-grid2.js +196 -0
- package/dist/components/lottery-ticket-controller.js +25 -3
- package/dist/components/lottery-ticket.js +6 -0
- package/dist/components/lottery-ticket2.js +208 -0
- package/dist/esm/helper-accordion_5.entry.js +506 -0
- package/dist/esm/{index-4b81518c.js → index-e3877ca0.js} +136 -12
- package/dist/esm/loader.js +3 -3
- package/dist/esm/lottery-ticket-controller.js +3 -3
- package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -1
- package/dist/lottery-ticket-controller/p-3971b8e6.js +1 -0
- package/dist/lottery-ticket-controller/p-95406ad0.entry.js +1 -0
- package/dist/types/components.d.ts +1 -5
- package/package.json +1 -1
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -71
- package/dist/esm/lottery-ticket-controller.entry.js +0 -67
- package/dist/lottery-ticket-controller/p-5186fd30.entry.js +0 -1
- package/dist/lottery-ticket-controller/p-fe83d21a.js +0 -2
|
@@ -50,7 +50,7 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
|
50
50
|
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
51
51
|
if (listeners) {
|
|
52
52
|
listeners.map(([flags, name, method]) => {
|
|
53
|
-
const target = elm;
|
|
53
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
54
54
|
const handler = hostListenerProxy(hostRef, method);
|
|
55
55
|
const opts = hostListenerOpts(flags);
|
|
56
56
|
plt.ael(target, name, handler, opts);
|
|
@@ -74,6 +74,13 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
74
74
|
consoleError(e);
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
78
|
+
if (flags & 4 /* TargetDocument */)
|
|
79
|
+
return doc;
|
|
80
|
+
if (flags & 8 /* TargetWindow */)
|
|
81
|
+
return win;
|
|
82
|
+
return elm;
|
|
83
|
+
};
|
|
77
84
|
// prettier-ignore
|
|
78
85
|
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
79
86
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
@@ -105,7 +112,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
105
112
|
};
|
|
106
113
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
107
114
|
let scopeId = getScopeId(cmpMeta);
|
|
108
|
-
|
|
115
|
+
let style = styles.get(scopeId);
|
|
109
116
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
110
117
|
// so the fallback is to always use the document for the root node in those cases
|
|
111
118
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -185,7 +192,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
185
192
|
let child = null;
|
|
186
193
|
let simple = false;
|
|
187
194
|
let lastSimple = false;
|
|
188
|
-
|
|
195
|
+
let vNodeChildren = [];
|
|
189
196
|
const walk = (c) => {
|
|
190
197
|
for (let i = 0; i < c.length; i++) {
|
|
191
198
|
child = c[i];
|
|
@@ -209,6 +216,19 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
209
216
|
}
|
|
210
217
|
};
|
|
211
218
|
walk(children);
|
|
219
|
+
if (vnodeData) {
|
|
220
|
+
{
|
|
221
|
+
const classData = vnodeData.className || vnodeData.class;
|
|
222
|
+
if (classData) {
|
|
223
|
+
vnodeData.class =
|
|
224
|
+
typeof classData !== 'object'
|
|
225
|
+
? classData
|
|
226
|
+
: Object.keys(classData)
|
|
227
|
+
.filter((k) => classData[k])
|
|
228
|
+
.join(' ');
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
212
232
|
const vnode = newVNode(nodeName, null);
|
|
213
233
|
vnode.$attrs$ = vnodeData;
|
|
214
234
|
if (vNodeChildren.length > 0) {
|
|
@@ -242,14 +262,60 @@ const isHost = (node) => node && node.$tag$ === Host;
|
|
|
242
262
|
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
243
263
|
if (oldValue !== newValue) {
|
|
244
264
|
let isProp = isMemberInElement(elm, memberName);
|
|
245
|
-
memberName.toLowerCase();
|
|
246
|
-
{
|
|
265
|
+
let ln = memberName.toLowerCase();
|
|
266
|
+
if (memberName === 'class') {
|
|
267
|
+
const classList = elm.classList;
|
|
268
|
+
const oldClasses = parseClassList(oldValue);
|
|
269
|
+
const newClasses = parseClassList(newValue);
|
|
270
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
271
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
272
|
+
}
|
|
273
|
+
else if ((!isProp ) &&
|
|
274
|
+
memberName[0] === 'o' &&
|
|
275
|
+
memberName[1] === 'n') {
|
|
276
|
+
// Event Handlers
|
|
277
|
+
// so if the member name starts with "on" and the 3rd characters is
|
|
278
|
+
// a capital letter, and it's not already a member on the element,
|
|
279
|
+
// then we're assuming it's an event listener
|
|
280
|
+
if (memberName[2] === '-') {
|
|
281
|
+
// on- prefixed events
|
|
282
|
+
// allows to be explicit about the dom event to listen without any magic
|
|
283
|
+
// under the hood:
|
|
284
|
+
// <my-cmp on-click> // listens for "click"
|
|
285
|
+
// <my-cmp on-Click> // listens for "Click"
|
|
286
|
+
// <my-cmp on-ionChange> // listens for "ionChange"
|
|
287
|
+
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
|
288
|
+
memberName = memberName.slice(3);
|
|
289
|
+
}
|
|
290
|
+
else if (isMemberInElement(win, ln)) {
|
|
291
|
+
// standard event
|
|
292
|
+
// the JSX attribute could have been "onMouseOver" and the
|
|
293
|
+
// member name "onmouseover" is on the window's prototype
|
|
294
|
+
// so let's add the listener "mouseover", which is all lowercased
|
|
295
|
+
memberName = ln.slice(2);
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
// custom event
|
|
299
|
+
// the JSX attribute could have been "onMyCustomEvent"
|
|
300
|
+
// so let's trim off the "on" prefix and lowercase the first character
|
|
301
|
+
// and add the listener "myCustomEvent"
|
|
302
|
+
// except for the first character, we keep the event name case
|
|
303
|
+
memberName = ln[2] + memberName.slice(3);
|
|
304
|
+
}
|
|
305
|
+
if (oldValue) {
|
|
306
|
+
plt.rel(elm, memberName, oldValue, false);
|
|
307
|
+
}
|
|
308
|
+
if (newValue) {
|
|
309
|
+
plt.ael(elm, memberName, newValue, false);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
247
313
|
// Set property if it exists and it's not a SVG
|
|
248
314
|
const isComplex = isComplexType(newValue);
|
|
249
315
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
250
316
|
try {
|
|
251
317
|
if (!elm.tagName.includes('-')) {
|
|
252
|
-
|
|
318
|
+
let n = newValue == null ? '' : newValue;
|
|
253
319
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
254
320
|
if (memberName === 'list') {
|
|
255
321
|
isProp = false;
|
|
@@ -280,6 +346,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
280
346
|
}
|
|
281
347
|
}
|
|
282
348
|
};
|
|
349
|
+
const parseClassListRegex = /\s/;
|
|
350
|
+
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
283
351
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
284
352
|
// if the element passed in is a shadow root, which is a document fragment
|
|
285
353
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
@@ -304,11 +372,15 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
304
372
|
};
|
|
305
373
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
306
374
|
// tslint:disable-next-line: prefer-const
|
|
307
|
-
|
|
375
|
+
let newVNode = newParentVNode.$children$[childIndex];
|
|
308
376
|
let i = 0;
|
|
309
377
|
let elm;
|
|
310
378
|
let childNode;
|
|
311
|
-
{
|
|
379
|
+
if (newVNode.$text$ !== null) {
|
|
380
|
+
// create text node
|
|
381
|
+
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
312
384
|
// create element
|
|
313
385
|
elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
|
|
314
386
|
// add css classes, attrs, props, listeners, etc.
|
|
@@ -437,10 +509,14 @@ const patch = (oldVNode, newVNode) => {
|
|
|
437
509
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
438
510
|
const oldChildren = oldVNode.$children$;
|
|
439
511
|
const newChildren = newVNode.$children$;
|
|
440
|
-
|
|
512
|
+
const tag = newVNode.$tag$;
|
|
513
|
+
const text = newVNode.$text$;
|
|
514
|
+
if (text === null) {
|
|
441
515
|
// element node
|
|
442
516
|
{
|
|
443
|
-
|
|
517
|
+
if (tag === 'slot')
|
|
518
|
+
;
|
|
519
|
+
else {
|
|
444
520
|
// either this is the first render of an element OR it's an update
|
|
445
521
|
// AND we already know it's possible it could have changed
|
|
446
522
|
// this updates the element's css classes, attrs, props, listeners, etc.
|
|
@@ -452,6 +528,11 @@ const patch = (oldVNode, newVNode) => {
|
|
|
452
528
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
453
529
|
}
|
|
454
530
|
else if (newChildren !== null) {
|
|
531
|
+
// no old child vnodes, but there are new child vnodes to add
|
|
532
|
+
if (oldVNode.$text$ !== null) {
|
|
533
|
+
// the old vnode was text, so be sure to clear it out
|
|
534
|
+
elm.textContent = '';
|
|
535
|
+
}
|
|
455
536
|
// add the new vnode children
|
|
456
537
|
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
457
538
|
}
|
|
@@ -460,6 +541,11 @@ const patch = (oldVNode, newVNode) => {
|
|
|
460
541
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
461
542
|
}
|
|
462
543
|
}
|
|
544
|
+
else if (oldVNode.$text$ !== text) {
|
|
545
|
+
// update the text content for the text only vnode
|
|
546
|
+
// and also only if the text is different than before
|
|
547
|
+
elm.data = text;
|
|
548
|
+
}
|
|
463
549
|
};
|
|
464
550
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
465
551
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -711,6 +797,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
711
797
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
712
798
|
// check our new property value against our internal value
|
|
713
799
|
const hostRef = getHostRef(ref);
|
|
800
|
+
const elm = hostRef.$hostElement$ ;
|
|
714
801
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
715
802
|
const flags = hostRef.$flags$;
|
|
716
803
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -723,6 +810,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
723
810
|
// set our new value!
|
|
724
811
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
725
812
|
if (instance) {
|
|
813
|
+
// get an array of method names of watch functions to call
|
|
814
|
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
815
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
816
|
+
if (watchMethods) {
|
|
817
|
+
// this instance is watching for when this property changed
|
|
818
|
+
watchMethods.map((watchMethodName) => {
|
|
819
|
+
try {
|
|
820
|
+
// fire off each of the watch methods that are watching this property
|
|
821
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
822
|
+
}
|
|
823
|
+
catch (e) {
|
|
824
|
+
consoleError(e, elm);
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
}
|
|
726
829
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
727
830
|
// looks like this value actually changed, so we've got work to do!
|
|
728
831
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -735,6 +838,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
735
838
|
};
|
|
736
839
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
737
840
|
if (cmpMeta.$members$) {
|
|
841
|
+
if (Cstr.watchers) {
|
|
842
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
843
|
+
}
|
|
738
844
|
// It's better to have a const than two Object.entries()
|
|
739
845
|
const members = Object.entries(cmpMeta.$members$);
|
|
740
846
|
const prototype = Cstr.prototype;
|
|
@@ -839,6 +945,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
839
945
|
endLoad();
|
|
840
946
|
}
|
|
841
947
|
if (!Cstr.isProxied) {
|
|
948
|
+
// we've never proxied this Constructor before
|
|
949
|
+
// let's add the getters/setters to its prototype before
|
|
950
|
+
// the first time we create an instance of the implementation
|
|
951
|
+
{
|
|
952
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
953
|
+
}
|
|
842
954
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
843
955
|
Cstr.isProxied = true;
|
|
844
956
|
}
|
|
@@ -862,7 +974,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
862
974
|
{
|
|
863
975
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
864
976
|
}
|
|
977
|
+
{
|
|
978
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
979
|
+
}
|
|
865
980
|
endNewInstance();
|
|
981
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
866
982
|
}
|
|
867
983
|
if (Cstr.style) {
|
|
868
984
|
// this component has styles but we haven't registered them yet
|
|
@@ -891,6 +1007,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
891
1007
|
schedule();
|
|
892
1008
|
}
|
|
893
1009
|
};
|
|
1010
|
+
const fireConnectedCallback = (instance) => {
|
|
1011
|
+
{
|
|
1012
|
+
safeCall(instance, 'connectedCallback');
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
894
1015
|
const connectedCallback = (elm) => {
|
|
895
1016
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
896
1017
|
const hostRef = getHostRef(elm);
|
|
@@ -934,6 +1055,8 @@ const connectedCallback = (elm) => {
|
|
|
934
1055
|
// reattach any event listeners to the host
|
|
935
1056
|
// since they would have been removed when disconnected
|
|
936
1057
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1058
|
+
// fire off connectedCallback() on component instance
|
|
1059
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
937
1060
|
}
|
|
938
1061
|
endConnected();
|
|
939
1062
|
}
|
|
@@ -976,6 +1099,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
976
1099
|
{
|
|
977
1100
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
978
1101
|
}
|
|
1102
|
+
{
|
|
1103
|
+
cmpMeta.$watchers$ = {};
|
|
1104
|
+
}
|
|
979
1105
|
const tagName = cmpMeta.$tagName$;
|
|
980
1106
|
const HostElement = class extends HTMLElement {
|
|
981
1107
|
// StencilLazyHost
|
|
@@ -1070,9 +1196,7 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1070
1196
|
if (module) {
|
|
1071
1197
|
return module[exportName];
|
|
1072
1198
|
}
|
|
1073
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
1074
1199
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1075
|
-
/* @vite-ignore */
|
|
1076
1200
|
/* webpackInclude: /\.entry\.js$/ */
|
|
1077
1201
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1078
1202
|
/* webpackMode: "lazy" */
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-95915aab.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["
|
|
17
|
+
return index.bootstrapLazy([["helper-accordion_5.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"]]],[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32],"isCustomSelect":[32],"amountInfo":[32]},[[8,"click","checkForClickOutside"],[0,"gridFilled","gridFilledHandler"]]],[1,"helper-accordion",{"ticketHistoryFlag":[4,"ticket-history-flag"],"headerTitle":[1,"header-title"],"headerSubtitle":[1,"header-subtitle"],"description":[1],"footer":[4],"deleteTab":[4,"delete-tab"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"language":[1],"showContent":[32]}],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-95915aab.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
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));
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["
|
|
18
|
+
return index.bootstrapLazy([["helper-accordion_5.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"]]],[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32],"isCustomSelect":[32],"amountInfo":[32]},[[8,"click","checkForClickOutside"],[0,"gridFilled","gridFilledHandler"]]],[1,"helper-accordion",{"ticketHistoryFlag":[4,"ticket-history-flag"],"headerTitle":[1,"header-title"],"headerSubtitle":[1,"header-subtitle"],"description":[1],"footer":[4],"deleteTab":[4,"delete-tab"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"language":[1],"showContent":[32]}],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
19
19
|
});
|
|
@@ -4,9 +4,34 @@
|
|
|
4
4
|
],
|
|
5
5
|
"compiler": {
|
|
6
6
|
"name": "@stencil/core",
|
|
7
|
-
"version": "2.
|
|
7
|
+
"version": "2.15.2",
|
|
8
8
|
"typescriptVersion": "4.5.4"
|
|
9
9
|
},
|
|
10
|
-
"collections": [
|
|
10
|
+
"collections": [
|
|
11
|
+
{
|
|
12
|
+
"name": "@everymatrix/helper-accordion",
|
|
13
|
+
"tags": [
|
|
14
|
+
"helper-accordion"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "@everymatrix/lottery-bullet",
|
|
19
|
+
"tags": [
|
|
20
|
+
"lottery-bullet"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "@everymatrix/lottery-grid",
|
|
25
|
+
"tags": [
|
|
26
|
+
"lottery-grid"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "@everymatrix/lottery-ticket",
|
|
31
|
+
"tags": [
|
|
32
|
+
"lottery-ticket"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
11
36
|
"bundles": []
|
|
12
37
|
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
5
|
+
const TRANSLATIONS = {
|
|
6
|
+
en: {
|
|
7
|
+
deleteTicket: 'Delete ticket'
|
|
8
|
+
},
|
|
9
|
+
ro: {
|
|
10
|
+
deleteTicket: 'Sterge biletul'
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
const translate = (key, customLang) => {
|
|
14
|
+
const lang = customLang;
|
|
15
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:4px 4px 0 0;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
|
|
19
|
+
|
|
20
|
+
const Accordion = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.__registerHost();
|
|
24
|
+
this.__attachShadow();
|
|
25
|
+
this.accordionEvent = createEvent(this, "helperAccordionAction", 7);
|
|
26
|
+
/**
|
|
27
|
+
* Flag for ticket history
|
|
28
|
+
*/
|
|
29
|
+
this.ticketHistoryFlag = false;
|
|
30
|
+
/**
|
|
31
|
+
* Title (top header)
|
|
32
|
+
*/
|
|
33
|
+
this.headerTitle = '';
|
|
34
|
+
/**
|
|
35
|
+
* SubTitle (top header)
|
|
36
|
+
*/
|
|
37
|
+
this.headerSubtitle = '';
|
|
38
|
+
/**
|
|
39
|
+
* Description
|
|
40
|
+
*/
|
|
41
|
+
this.description = '';
|
|
42
|
+
/**
|
|
43
|
+
* Enables footer content
|
|
44
|
+
*/
|
|
45
|
+
this.footer = false;
|
|
46
|
+
/**
|
|
47
|
+
* Enables footer button for tab deletion
|
|
48
|
+
*/
|
|
49
|
+
this.deleteTab = false;
|
|
50
|
+
/**
|
|
51
|
+
* Activates postMessages as events for actions from the widget
|
|
52
|
+
*/
|
|
53
|
+
this.postMessage = false;
|
|
54
|
+
/**
|
|
55
|
+
* Name of the event emitter by the action button
|
|
56
|
+
*/
|
|
57
|
+
this.eventName = 'helperAccordionAction';
|
|
58
|
+
/**
|
|
59
|
+
* Collapsed
|
|
60
|
+
*/
|
|
61
|
+
this.collapsed = true;
|
|
62
|
+
/**
|
|
63
|
+
* Language
|
|
64
|
+
*/
|
|
65
|
+
this.language = 'en';
|
|
66
|
+
}
|
|
67
|
+
// @TODO fix the `any` type :)
|
|
68
|
+
connectedCallback() {
|
|
69
|
+
this.showContent = !this.collapsed;
|
|
70
|
+
}
|
|
71
|
+
toggleContent() {
|
|
72
|
+
this.showContent = !this.showContent;
|
|
73
|
+
}
|
|
74
|
+
deleteAction() {
|
|
75
|
+
if (this.postMessage) {
|
|
76
|
+
// @TODO maybe change the name type, this one sucks
|
|
77
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
78
|
+
}
|
|
79
|
+
this.accordionEvent.emit();
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
return (h("div", { class: "Wrapper" }, h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle" }, this.description), h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
|
|
83
|
+
h("div", null, h("div", { class: "Content" }, h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
84
|
+
h("div", null, this.deleteTab &&
|
|
85
|
+
h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
|
|
86
|
+
}
|
|
87
|
+
static get style() { return helperAccordionCss; }
|
|
88
|
+
}, [1, "helper-accordion", {
|
|
89
|
+
"ticketHistoryFlag": [4, "ticket-history-flag"],
|
|
90
|
+
"headerTitle": [1, "header-title"],
|
|
91
|
+
"headerSubtitle": [1, "header-subtitle"],
|
|
92
|
+
"description": [1],
|
|
93
|
+
"footer": [4],
|
|
94
|
+
"deleteTab": [4, "delete-tab"],
|
|
95
|
+
"postMessage": [4, "post-message"],
|
|
96
|
+
"eventName": [1, "event-name"],
|
|
97
|
+
"collapsed": [4],
|
|
98
|
+
"language": [1],
|
|
99
|
+
"showContent": [32]
|
|
100
|
+
}]);
|
|
101
|
+
function defineCustomElement() {
|
|
102
|
+
if (typeof customElements === "undefined") {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const components = ["helper-accordion"];
|
|
106
|
+
components.forEach(tagName => { switch (tagName) {
|
|
107
|
+
case "helper-accordion":
|
|
108
|
+
if (!customElements.get(tagName)) {
|
|
109
|
+
customElements.define(tagName, Accordion);
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
} });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { Accordion as A, defineCustomElement as d };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* LotteryTicketController custom elements */
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Used to manually set the base path where assets can be found.
|
|
@@ -19,4 +20,7 @@ export interface SetPlatformOptions {
|
|
|
19
20
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
21
|
}
|
|
21
22
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
22
26
|
export * from '../types';
|
package/dist/components/index.js
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
|
|
4
|
+
|
|
5
|
+
const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
|
|
11
|
+
/**
|
|
12
|
+
* Value of the bullet
|
|
13
|
+
*/
|
|
14
|
+
this.value = '0';
|
|
15
|
+
/**
|
|
16
|
+
* Marks if the bullet should be selectable
|
|
17
|
+
*/
|
|
18
|
+
this.selectable = true;
|
|
19
|
+
/**
|
|
20
|
+
* Marks if the bullet should be selected
|
|
21
|
+
*/
|
|
22
|
+
this.isSelected = false;
|
|
23
|
+
this.select = () => {
|
|
24
|
+
if (this.selectable) {
|
|
25
|
+
this.isSelected = !this.isSelected;
|
|
26
|
+
this.bulletEvent.emit({
|
|
27
|
+
value: this.value,
|
|
28
|
+
selected: this.isSelected
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
|
|
35
|
+
}
|
|
36
|
+
static get style() { return lotteryBulletCss; }
|
|
37
|
+
}, [1, "lottery-bullet", {
|
|
38
|
+
"value": [1],
|
|
39
|
+
"selectable": [4],
|
|
40
|
+
"isSelected": [4, "is-selected"]
|
|
41
|
+
}]);
|
|
42
|
+
function defineCustomElement() {
|
|
43
|
+
if (typeof customElements === "undefined") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const components = ["lottery-bullet"];
|
|
47
|
+
components.forEach(tagName => { switch (tagName) {
|
|
48
|
+
case "lottery-bullet":
|
|
49
|
+
if (!customElements.get(tagName)) {
|
|
50
|
+
customElements.define(tagName, LotteryBullet);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
} });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { LotteryBullet as L, defineCustomElement as d };
|