@everymatrix/lottery-ticket-controller 0.1.4 → 0.1.5
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_2.cjs.entry.js +156 -0
- package/dist/cjs/{index-95915aab.js → index-4814ed9d.js} +1 -40
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-ticket-controller.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +0 -18
- package/dist/components/lottery-ticket-controller.js +3 -20
- package/dist/esm/helper-accordion_2.entry.js +151 -0
- package/dist/esm/{index-e3877ca0.js → index-116c3025.js} +1 -40
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-ticket-controller.js +2 -2
- package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -1
- package/dist/lottery-ticket-controller/p-b4ec0994.js +1 -0
- package/dist/lottery-ticket-controller/p-efb11dcf.entry.js +1 -0
- package/package.json +1 -1
- package/dist/cjs/helper-accordion_5.cjs.entry.js +0 -514
- package/dist/components/lottery-bullet.js +0 -6
- package/dist/components/lottery-bullet2.js +0 -56
- package/dist/components/lottery-grid.js +0 -6
- package/dist/components/lottery-grid2.js +0 -196
- package/dist/components/lottery-ticket.js +0 -6
- package/dist/components/lottery-ticket2.js +0 -208
- package/dist/esm/helper-accordion_5.entry.js +0 -506
- package/dist/lottery-ticket-controller/p-3971b8e6.js +0 -1
- package/dist/lottery-ticket-controller/p-95406ad0.entry.js +0 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4814ed9d.js');
|
|
6
|
+
require('@everymatrix/lottery-ticket');
|
|
7
|
+
|
|
8
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
9
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
10
|
+
const TRANSLATIONS = {
|
|
11
|
+
en: {
|
|
12
|
+
deleteTicket: 'Delete ticket'
|
|
13
|
+
},
|
|
14
|
+
ro: {
|
|
15
|
+
deleteTicket: 'Sterge biletul'
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const translate = (key, customLang) => {
|
|
19
|
+
const lang = customLang;
|
|
20
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
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}";
|
|
24
|
+
|
|
25
|
+
const Accordion = class {
|
|
26
|
+
constructor(hostRef) {
|
|
27
|
+
index.registerInstance(this, hostRef);
|
|
28
|
+
this.accordionEvent = index.createEvent(this, "helperAccordionAction", 7);
|
|
29
|
+
/**
|
|
30
|
+
* Flag for ticket history
|
|
31
|
+
*/
|
|
32
|
+
this.ticketHistoryFlag = false;
|
|
33
|
+
/**
|
|
34
|
+
* Title (top header)
|
|
35
|
+
*/
|
|
36
|
+
this.headerTitle = '';
|
|
37
|
+
/**
|
|
38
|
+
* SubTitle (top header)
|
|
39
|
+
*/
|
|
40
|
+
this.headerSubtitle = '';
|
|
41
|
+
/**
|
|
42
|
+
* Description
|
|
43
|
+
*/
|
|
44
|
+
this.description = '';
|
|
45
|
+
/**
|
|
46
|
+
* Enables footer content
|
|
47
|
+
*/
|
|
48
|
+
this.footer = false;
|
|
49
|
+
/**
|
|
50
|
+
* Enables footer button for tab deletion
|
|
51
|
+
*/
|
|
52
|
+
this.deleteTab = false;
|
|
53
|
+
/**
|
|
54
|
+
* Activates postMessages as events for actions from the widget
|
|
55
|
+
*/
|
|
56
|
+
this.postMessage = false;
|
|
57
|
+
/**
|
|
58
|
+
* Name of the event emitter by the action button
|
|
59
|
+
*/
|
|
60
|
+
this.eventName = 'helperAccordionAction';
|
|
61
|
+
/**
|
|
62
|
+
* Collapsed
|
|
63
|
+
*/
|
|
64
|
+
this.collapsed = true;
|
|
65
|
+
/**
|
|
66
|
+
* Language
|
|
67
|
+
*/
|
|
68
|
+
this.language = 'en';
|
|
69
|
+
}
|
|
70
|
+
// @TODO fix the `any` type :)
|
|
71
|
+
connectedCallback() {
|
|
72
|
+
this.showContent = !this.collapsed;
|
|
73
|
+
}
|
|
74
|
+
toggleContent() {
|
|
75
|
+
this.showContent = !this.showContent;
|
|
76
|
+
}
|
|
77
|
+
deleteAction() {
|
|
78
|
+
if (this.postMessage) {
|
|
79
|
+
// @TODO maybe change the name type, this one sucks
|
|
80
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
81
|
+
}
|
|
82
|
+
this.accordionEvent.emit();
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return (index.h("div", { class: "Wrapper" }, index.h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, index.h("p", { class: "Title" }, this.headerTitle), index.h("p", { class: "Subtitle" }, this.headerSubtitle), index.h("p", { class: "Subtitle" }, this.description), index.h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
|
|
86
|
+
index.h("div", null, index.h("div", { class: "Content" }, index.h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
87
|
+
index.h("div", null, this.deleteTab &&
|
|
88
|
+
index.h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
Accordion.style = helperAccordionCss;
|
|
92
|
+
|
|
93
|
+
const lotteryTicketControllerCss = ":host{display:block}";
|
|
94
|
+
|
|
95
|
+
const LotteryTicketController = class {
|
|
96
|
+
constructor(hostRef) {
|
|
97
|
+
index.registerInstance(this, hostRef);
|
|
98
|
+
this.deleteTicketEvent = index.createEvent(this, "deleteTicket", 7);
|
|
99
|
+
/**
|
|
100
|
+
* Endpoint URL for the source of data (NorWAy standard)
|
|
101
|
+
*/
|
|
102
|
+
this.endpoint = '';
|
|
103
|
+
/**
|
|
104
|
+
* Ticket number
|
|
105
|
+
*/
|
|
106
|
+
this.ticketId = 1;
|
|
107
|
+
/**
|
|
108
|
+
* Activates postMessages as events for actions from the widget
|
|
109
|
+
*/
|
|
110
|
+
this.postMessage = false;
|
|
111
|
+
/**
|
|
112
|
+
* Name of the event emitter by the action button
|
|
113
|
+
*/
|
|
114
|
+
this.eventName = 'deleteTicketAction';
|
|
115
|
+
/**
|
|
116
|
+
* Collapsed
|
|
117
|
+
*/
|
|
118
|
+
this.collapsed = true;
|
|
119
|
+
/**
|
|
120
|
+
* Number of grids?
|
|
121
|
+
*/
|
|
122
|
+
this.numberOfGrids = 1;
|
|
123
|
+
/**
|
|
124
|
+
* This toggles if the last ticket added should be expanded or not
|
|
125
|
+
*/
|
|
126
|
+
this.last = false;
|
|
127
|
+
/**
|
|
128
|
+
* Language
|
|
129
|
+
*/
|
|
130
|
+
this.language = 'en';
|
|
131
|
+
/**
|
|
132
|
+
* Shows the auto-pick button
|
|
133
|
+
*/
|
|
134
|
+
this.autoPick = false;
|
|
135
|
+
/**
|
|
136
|
+
* Shows the reset button
|
|
137
|
+
*/
|
|
138
|
+
this.resetButton = false;
|
|
139
|
+
}
|
|
140
|
+
// @TODO fix the `any` type
|
|
141
|
+
helperAccordionActionHandler() {
|
|
142
|
+
if (this.postMessage) {
|
|
143
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
144
|
+
}
|
|
145
|
+
this.deleteTicketEvent.emit({
|
|
146
|
+
ticketId: this.ticketId
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
render() {
|
|
150
|
+
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 })))));
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
LotteryTicketController.style = lotteryTicketControllerCss;
|
|
154
|
+
|
|
155
|
+
exports.helper_accordion = Accordion;
|
|
156
|
+
exports.lottery_ticket_controller = LotteryTicketController;
|
|
@@ -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 =
|
|
53
|
+
const target = elm;
|
|
54
54
|
const handler = hostListenerProxy(hostRef, method);
|
|
55
55
|
const opts = hostListenerOpts(flags);
|
|
56
56
|
plt.ael(target, name, handler, opts);
|
|
@@ -74,13 +74,6 @@ 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
|
-
};
|
|
84
77
|
// prettier-ignore
|
|
85
78
|
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
86
79
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
@@ -797,7 +790,6 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
797
790
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
798
791
|
// check our new property value against our internal value
|
|
799
792
|
const hostRef = getHostRef(ref);
|
|
800
|
-
const elm = hostRef.$hostElement$ ;
|
|
801
793
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
802
794
|
const flags = hostRef.$flags$;
|
|
803
795
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -810,22 +802,6 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
810
802
|
// set our new value!
|
|
811
803
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
812
804
|
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
|
-
}
|
|
829
805
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
830
806
|
// looks like this value actually changed, so we've got work to do!
|
|
831
807
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -838,9 +814,6 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
838
814
|
};
|
|
839
815
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
840
816
|
if (cmpMeta.$members$) {
|
|
841
|
-
if (Cstr.watchers) {
|
|
842
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
843
|
-
}
|
|
844
817
|
// It's better to have a const than two Object.entries()
|
|
845
818
|
const members = Object.entries(cmpMeta.$members$);
|
|
846
819
|
const prototype = Cstr.prototype;
|
|
@@ -945,12 +918,6 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
945
918
|
endLoad();
|
|
946
919
|
}
|
|
947
920
|
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
|
-
}
|
|
954
921
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
955
922
|
Cstr.isProxied = true;
|
|
956
923
|
}
|
|
@@ -974,9 +941,6 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
974
941
|
{
|
|
975
942
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
976
943
|
}
|
|
977
|
-
{
|
|
978
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
979
|
-
}
|
|
980
944
|
endNewInstance();
|
|
981
945
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
982
946
|
}
|
|
@@ -1099,9 +1063,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1099
1063
|
{
|
|
1100
1064
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1101
1065
|
}
|
|
1102
|
-
{
|
|
1103
|
-
cmpMeta.$watchers$ = {};
|
|
1104
|
-
}
|
|
1105
1066
|
const tagName = cmpMeta.$tagName$;
|
|
1106
1067
|
const HostElement = class extends HTMLElement {
|
|
1107
1068
|
// StencilLazyHost
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-4814ed9d.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -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([["helper-
|
|
17
|
+
return index.bootstrapLazy([["helper-accordion_2.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,"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]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-4814ed9d.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["helper-
|
|
18
|
+
return index.bootstrapLazy([["helper-accordion_2.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,"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]}]]]], options);
|
|
19
19
|
});
|
|
@@ -13,24 +13,6 @@
|
|
|
13
13
|
"tags": [
|
|
14
14
|
"helper-accordion"
|
|
15
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
16
|
}
|
|
35
17
|
],
|
|
36
18
|
"bundles": []
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import
|
|
3
|
-
import { d as defineCustomElement$
|
|
4
|
-
import { d as defineCustomElement$3 } from './lottery-grid2.js';
|
|
5
|
-
import { d as defineCustomElement$2 } from './lottery-ticket2.js';
|
|
2
|
+
import '@everymatrix/lottery-ticket';
|
|
3
|
+
import { d as defineCustomElement$2 } from './helper-accordion2.js';
|
|
6
4
|
|
|
7
5
|
const lotteryTicketControllerCss = ":host{display:block}";
|
|
8
6
|
|
|
@@ -84,7 +82,7 @@ function defineCustomElement$1() {
|
|
|
84
82
|
if (typeof customElements === "undefined") {
|
|
85
83
|
return;
|
|
86
84
|
}
|
|
87
|
-
const components = ["lottery-ticket-controller", "helper-accordion"
|
|
85
|
+
const components = ["lottery-ticket-controller", "helper-accordion"];
|
|
88
86
|
components.forEach(tagName => { switch (tagName) {
|
|
89
87
|
case "lottery-ticket-controller":
|
|
90
88
|
if (!customElements.get(tagName)) {
|
|
@@ -92,21 +90,6 @@ function defineCustomElement$1() {
|
|
|
92
90
|
}
|
|
93
91
|
break;
|
|
94
92
|
case "helper-accordion":
|
|
95
|
-
if (!customElements.get(tagName)) {
|
|
96
|
-
defineCustomElement$5();
|
|
97
|
-
}
|
|
98
|
-
break;
|
|
99
|
-
case "lottery-bullet":
|
|
100
|
-
if (!customElements.get(tagName)) {
|
|
101
|
-
defineCustomElement$4();
|
|
102
|
-
}
|
|
103
|
-
break;
|
|
104
|
-
case "lottery-grid":
|
|
105
|
-
if (!customElements.get(tagName)) {
|
|
106
|
-
defineCustomElement$3();
|
|
107
|
-
}
|
|
108
|
-
break;
|
|
109
|
-
case "lottery-ticket":
|
|
110
93
|
if (!customElements.get(tagName)) {
|
|
111
94
|
defineCustomElement$2();
|
|
112
95
|
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-116c3025.js';
|
|
2
|
+
import '@everymatrix/lottery-ticket';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
5
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
6
|
+
const TRANSLATIONS = {
|
|
7
|
+
en: {
|
|
8
|
+
deleteTicket: 'Delete ticket'
|
|
9
|
+
},
|
|
10
|
+
ro: {
|
|
11
|
+
deleteTicket: 'Sterge biletul'
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
const translate = (key, customLang) => {
|
|
15
|
+
const lang = customLang;
|
|
16
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
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}";
|
|
20
|
+
|
|
21
|
+
const Accordion = class {
|
|
22
|
+
constructor(hostRef) {
|
|
23
|
+
registerInstance(this, hostRef);
|
|
24
|
+
this.accordionEvent = createEvent(this, "helperAccordionAction", 7);
|
|
25
|
+
/**
|
|
26
|
+
* Flag for ticket history
|
|
27
|
+
*/
|
|
28
|
+
this.ticketHistoryFlag = false;
|
|
29
|
+
/**
|
|
30
|
+
* Title (top header)
|
|
31
|
+
*/
|
|
32
|
+
this.headerTitle = '';
|
|
33
|
+
/**
|
|
34
|
+
* SubTitle (top header)
|
|
35
|
+
*/
|
|
36
|
+
this.headerSubtitle = '';
|
|
37
|
+
/**
|
|
38
|
+
* Description
|
|
39
|
+
*/
|
|
40
|
+
this.description = '';
|
|
41
|
+
/**
|
|
42
|
+
* Enables footer content
|
|
43
|
+
*/
|
|
44
|
+
this.footer = false;
|
|
45
|
+
/**
|
|
46
|
+
* Enables footer button for tab deletion
|
|
47
|
+
*/
|
|
48
|
+
this.deleteTab = false;
|
|
49
|
+
/**
|
|
50
|
+
* Activates postMessages as events for actions from the widget
|
|
51
|
+
*/
|
|
52
|
+
this.postMessage = false;
|
|
53
|
+
/**
|
|
54
|
+
* Name of the event emitter by the action button
|
|
55
|
+
*/
|
|
56
|
+
this.eventName = 'helperAccordionAction';
|
|
57
|
+
/**
|
|
58
|
+
* Collapsed
|
|
59
|
+
*/
|
|
60
|
+
this.collapsed = true;
|
|
61
|
+
/**
|
|
62
|
+
* Language
|
|
63
|
+
*/
|
|
64
|
+
this.language = 'en';
|
|
65
|
+
}
|
|
66
|
+
// @TODO fix the `any` type :)
|
|
67
|
+
connectedCallback() {
|
|
68
|
+
this.showContent = !this.collapsed;
|
|
69
|
+
}
|
|
70
|
+
toggleContent() {
|
|
71
|
+
this.showContent = !this.showContent;
|
|
72
|
+
}
|
|
73
|
+
deleteAction() {
|
|
74
|
+
if (this.postMessage) {
|
|
75
|
+
// @TODO maybe change the name type, this one sucks
|
|
76
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
77
|
+
}
|
|
78
|
+
this.accordionEvent.emit();
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
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 &&
|
|
82
|
+
h("div", null, h("div", { class: "Content" }, h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
83
|
+
h("div", null, this.deleteTab &&
|
|
84
|
+
h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
Accordion.style = helperAccordionCss;
|
|
88
|
+
|
|
89
|
+
const lotteryTicketControllerCss = ":host{display:block}";
|
|
90
|
+
|
|
91
|
+
const LotteryTicketController = class {
|
|
92
|
+
constructor(hostRef) {
|
|
93
|
+
registerInstance(this, hostRef);
|
|
94
|
+
this.deleteTicketEvent = createEvent(this, "deleteTicket", 7);
|
|
95
|
+
/**
|
|
96
|
+
* Endpoint URL for the source of data (NorWAy standard)
|
|
97
|
+
*/
|
|
98
|
+
this.endpoint = '';
|
|
99
|
+
/**
|
|
100
|
+
* Ticket number
|
|
101
|
+
*/
|
|
102
|
+
this.ticketId = 1;
|
|
103
|
+
/**
|
|
104
|
+
* Activates postMessages as events for actions from the widget
|
|
105
|
+
*/
|
|
106
|
+
this.postMessage = false;
|
|
107
|
+
/**
|
|
108
|
+
* Name of the event emitter by the action button
|
|
109
|
+
*/
|
|
110
|
+
this.eventName = 'deleteTicketAction';
|
|
111
|
+
/**
|
|
112
|
+
* Collapsed
|
|
113
|
+
*/
|
|
114
|
+
this.collapsed = true;
|
|
115
|
+
/**
|
|
116
|
+
* Number of grids?
|
|
117
|
+
*/
|
|
118
|
+
this.numberOfGrids = 1;
|
|
119
|
+
/**
|
|
120
|
+
* This toggles if the last ticket added should be expanded or not
|
|
121
|
+
*/
|
|
122
|
+
this.last = false;
|
|
123
|
+
/**
|
|
124
|
+
* Language
|
|
125
|
+
*/
|
|
126
|
+
this.language = 'en';
|
|
127
|
+
/**
|
|
128
|
+
* Shows the auto-pick button
|
|
129
|
+
*/
|
|
130
|
+
this.autoPick = false;
|
|
131
|
+
/**
|
|
132
|
+
* Shows the reset button
|
|
133
|
+
*/
|
|
134
|
+
this.resetButton = false;
|
|
135
|
+
}
|
|
136
|
+
// @TODO fix the `any` type
|
|
137
|
+
helperAccordionActionHandler() {
|
|
138
|
+
if (this.postMessage) {
|
|
139
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
140
|
+
}
|
|
141
|
+
this.deleteTicketEvent.emit({
|
|
142
|
+
ticketId: this.ticketId
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
render() {
|
|
146
|
+
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 })))));
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
LotteryTicketController.style = lotteryTicketControllerCss;
|
|
150
|
+
|
|
151
|
+
export { Accordion as helper_accordion, LotteryTicketController as lottery_ticket_controller };
|
|
@@ -28,7 +28,7 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
|
28
28
|
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
29
29
|
if (listeners) {
|
|
30
30
|
listeners.map(([flags, name, method]) => {
|
|
31
|
-
const target =
|
|
31
|
+
const target = elm;
|
|
32
32
|
const handler = hostListenerProxy(hostRef, method);
|
|
33
33
|
const opts = hostListenerOpts(flags);
|
|
34
34
|
plt.ael(target, name, handler, opts);
|
|
@@ -52,13 +52,6 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
52
52
|
consoleError(e);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
56
|
-
if (flags & 4 /* TargetDocument */)
|
|
57
|
-
return doc;
|
|
58
|
-
if (flags & 8 /* TargetWindow */)
|
|
59
|
-
return win;
|
|
60
|
-
return elm;
|
|
61
|
-
};
|
|
62
55
|
// prettier-ignore
|
|
63
56
|
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
64
57
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
@@ -775,7 +768,6 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
775
768
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
776
769
|
// check our new property value against our internal value
|
|
777
770
|
const hostRef = getHostRef(ref);
|
|
778
|
-
const elm = hostRef.$hostElement$ ;
|
|
779
771
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
780
772
|
const flags = hostRef.$flags$;
|
|
781
773
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -788,22 +780,6 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
788
780
|
// set our new value!
|
|
789
781
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
790
782
|
if (instance) {
|
|
791
|
-
// get an array of method names of watch functions to call
|
|
792
|
-
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
793
|
-
const watchMethods = cmpMeta.$watchers$[propName];
|
|
794
|
-
if (watchMethods) {
|
|
795
|
-
// this instance is watching for when this property changed
|
|
796
|
-
watchMethods.map((watchMethodName) => {
|
|
797
|
-
try {
|
|
798
|
-
// fire off each of the watch methods that are watching this property
|
|
799
|
-
instance[watchMethodName](newVal, oldVal, propName);
|
|
800
|
-
}
|
|
801
|
-
catch (e) {
|
|
802
|
-
consoleError(e, elm);
|
|
803
|
-
}
|
|
804
|
-
});
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
783
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
808
784
|
// looks like this value actually changed, so we've got work to do!
|
|
809
785
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -816,9 +792,6 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
816
792
|
};
|
|
817
793
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
818
794
|
if (cmpMeta.$members$) {
|
|
819
|
-
if (Cstr.watchers) {
|
|
820
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
821
|
-
}
|
|
822
795
|
// It's better to have a const than two Object.entries()
|
|
823
796
|
const members = Object.entries(cmpMeta.$members$);
|
|
824
797
|
const prototype = Cstr.prototype;
|
|
@@ -923,12 +896,6 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
923
896
|
endLoad();
|
|
924
897
|
}
|
|
925
898
|
if (!Cstr.isProxied) {
|
|
926
|
-
// we've never proxied this Constructor before
|
|
927
|
-
// let's add the getters/setters to its prototype before
|
|
928
|
-
// the first time we create an instance of the implementation
|
|
929
|
-
{
|
|
930
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
931
|
-
}
|
|
932
899
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
933
900
|
Cstr.isProxied = true;
|
|
934
901
|
}
|
|
@@ -952,9 +919,6 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
952
919
|
{
|
|
953
920
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
954
921
|
}
|
|
955
|
-
{
|
|
956
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
957
|
-
}
|
|
958
922
|
endNewInstance();
|
|
959
923
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
960
924
|
}
|
|
@@ -1077,9 +1041,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1077
1041
|
{
|
|
1078
1042
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1079
1043
|
}
|
|
1080
|
-
{
|
|
1081
|
-
cmpMeta.$watchers$ = {};
|
|
1082
|
-
}
|
|
1083
1044
|
const tagName = cmpMeta.$tagName$;
|
|
1084
1045
|
const HostElement = class extends HTMLElement {
|
|
1085
1046
|
// StencilLazyHost
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-116c3025.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["helper-
|
|
13
|
+
return bootstrapLazy([["helper-accordion_2",[[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,"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]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-116c3025.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["helper-
|
|
16
|
+
return bootstrapLazy([["helper-accordion_2",[[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,"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]}]]]], options);
|
|
17
17
|
});
|