@everymatrix/lottery-game-page 0.0.16 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helper-accordion_2.cjs.entry.js +124 -0
- package/dist/cjs/helper-modal.cjs.entry.js +1 -1
- package/dist/cjs/helper-tab.cjs.entry.js +11 -8
- package/dist/cjs/{index-81cb3b3b.js → index-614098f4.js} +5 -47
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/lottery-game-details.cjs.entry.js +1 -1
- package/dist/cjs/lottery-game-page.cjs.entry.js +53 -13
- package/dist/cjs/lottery-game-page.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -49
- package/dist/collection/components/lottery-game-page/lottery-game-page.css +27 -7
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +22 -5
- package/dist/collection/utils/locale.utils.js +33 -6
- package/dist/components/helper-accordion2.js +7 -2
- package/dist/components/helper-tab2.js +12 -8
- package/dist/components/helper-tabs2.js +1 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +0 -14
- package/dist/components/lottery-game-page.js +65 -65
- package/dist/esm/helper-accordion_2.entry.js +119 -0
- package/dist/esm/helper-modal.entry.js +1 -1
- package/dist/esm/helper-tab.entry.js +11 -8
- package/dist/esm/{index-be84da79.js → index-0fa076cd.js} +5 -47
- package/dist/esm/loader.js +3 -3
- package/dist/esm/lottery-game-details.entry.js +1 -1
- package/dist/esm/lottery-game-page.entry.js +53 -13
- package/dist/esm/lottery-game-page.js +3 -3
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/lottery-game-page/p-2d7ccc96.js +1 -0
- package/dist/lottery-game-page/{p-88f81126.entry.js → p-6183a920.entry.js} +1 -1
- package/dist/lottery-game-page/p-74eea5ec.entry.js +1 -0
- package/dist/lottery-game-page/p-75f13007.entry.js +1 -0
- package/dist/lottery-game-page/p-97d1602e.entry.js +1 -0
- package/dist/lottery-game-page/{p-a1dd3eb2.entry.js → p-d04141f7.entry.js} +1 -1
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/helper-accordion.cjs.entry.js +0 -88
- package/dist/cjs/helper-filters_2.cjs.entry.js +0 -22490
- package/dist/cjs/helper-pagination.cjs.entry.js +0 -188
- package/dist/cjs/helper-tabs.cjs.entry.js +0 -38
- package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -202
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -124
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -69
- package/dist/cjs/lottery-ticket.cjs.entry.js +0 -146
- package/dist/components/helper-filters.js +0 -6
- package/dist/components/helper-filters2.js +0 -22348
- package/dist/components/helper-pagination.js +0 -216
- package/dist/components/lottery-bullet.js +0 -6
- package/dist/components/lottery-bullet2.js +0 -57
- package/dist/components/lottery-draw-results-history.js +0 -6
- package/dist/components/lottery-draw-results-history2.js +0 -175
- package/dist/components/lottery-draw-results.js +0 -6
- package/dist/components/lottery-draw-results2.js +0 -218
- package/dist/components/lottery-grid.js +0 -6
- package/dist/components/lottery-grid2.js +0 -197
- package/dist/components/lottery-ticket-controller.js +0 -6
- package/dist/components/lottery-ticket-controller2.js +0 -118
- package/dist/components/lottery-ticket.js +0 -6
- package/dist/components/lottery-ticket2.js +0 -184
- package/dist/esm/helper-accordion.entry.js +0 -84
- package/dist/esm/helper-filters_2.entry.js +0 -22485
- package/dist/esm/helper-pagination.entry.js +0 -184
- package/dist/esm/helper-tabs.entry.js +0 -34
- package/dist/esm/lottery-bullet_2.entry.js +0 -197
- package/dist/esm/lottery-draw-results-history.entry.js +0 -120
- package/dist/esm/lottery-ticket-controller.entry.js +0 -65
- package/dist/esm/lottery-ticket.entry.js +0 -142
- package/dist/lottery-game-page/p-010895a3.entry.js +0 -1
- package/dist/lottery-game-page/p-08581ede.entry.js +0 -1
- package/dist/lottery-game-page/p-09f983c6.entry.js +0 -1
- package/dist/lottery-game-page/p-0c7ada78.entry.js +0 -1
- package/dist/lottery-game-page/p-2932d2a7.entry.js +0 -1
- package/dist/lottery-game-page/p-48831184.entry.js +0 -1
- package/dist/lottery-game-page/p-50298d2c.entry.js +0 -1
- package/dist/lottery-game-page/p-6736fa79.entry.js +0 -1
- package/dist/lottery-game-page/p-91420518.js +0 -2
- package/dist/lottery-game-page/p-95b37270.entry.js +0 -2849
- package/dist/lottery-game-page/p-caf09eaf.entry.js +0 -1
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$2 } from './lottery-bullet2.js';
|
|
3
|
-
import { d as defineCustomElement$1 } from './lottery-grid2.js';
|
|
4
|
-
|
|
5
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
6
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
7
|
-
const TRANSLATIONS = {
|
|
8
|
-
en: {
|
|
9
|
-
loading: 'Loading, please wait ...',
|
|
10
|
-
error: 'It was an error while trying to fetch the data',
|
|
11
|
-
grid: 'Grid',
|
|
12
|
-
multiplier: 'Multiplier',
|
|
13
|
-
numberOfDraws: 'Number of draws',
|
|
14
|
-
wagerPerDraw: 'Wager per draw',
|
|
15
|
-
resetButton: 'Reset',
|
|
16
|
-
autoButton: 'I feel lucky'
|
|
17
|
-
},
|
|
18
|
-
ro: {
|
|
19
|
-
loading: 'Se incarca, va rugam asteptati ...',
|
|
20
|
-
error: 'A fost o eroare in timp ce asteptam datele',
|
|
21
|
-
grid: 'Grid',
|
|
22
|
-
multiplier: 'Multiplicator',
|
|
23
|
-
numberOfDraws: 'Numarul de extrageri',
|
|
24
|
-
wagerPerDraw: 'Pariul per extragere',
|
|
25
|
-
resetButton: 'Reseteaza',
|
|
26
|
-
autoButton: 'Ma simt norocos'
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
const translate = (key, customLang) => {
|
|
30
|
-
const lang = customLang;
|
|
31
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;background-color:transparent;border:none;align-items:center;justify-content:center;height:20px;margin:0;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);width:30px;align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}";
|
|
35
|
-
|
|
36
|
-
const LotteryTicket = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
37
|
-
constructor() {
|
|
38
|
-
super();
|
|
39
|
-
this.__registerHost();
|
|
40
|
-
this.__attachShadow();
|
|
41
|
-
this.ticketCompleted = createEvent(this, "ticketCompleted", 7);
|
|
42
|
-
this.autoSelection = createEvent(this, "autoSelection", 7);
|
|
43
|
-
this.resetSelection = createEvent(this, "resetSelection", 7);
|
|
44
|
-
this.stakeChange = createEvent(this, "stakeChange", 7);
|
|
45
|
-
this.multiplierChange = createEvent(this, "multiplierChange", 7);
|
|
46
|
-
/**
|
|
47
|
-
* Number of grids of a ticket
|
|
48
|
-
*/
|
|
49
|
-
this.numberOfGrids = 1;
|
|
50
|
-
/**
|
|
51
|
-
* Option to have the ticket registered for multiple draws
|
|
52
|
-
*/
|
|
53
|
-
this.multipleDraws = true;
|
|
54
|
-
/**
|
|
55
|
-
* Shows the reset button
|
|
56
|
-
*/
|
|
57
|
-
this.resetButton = false;
|
|
58
|
-
/**
|
|
59
|
-
* Shows the auto-pick button
|
|
60
|
-
*/
|
|
61
|
-
this.autoPick = false;
|
|
62
|
-
/**
|
|
63
|
-
* Language
|
|
64
|
-
*/
|
|
65
|
-
this.language = 'en';
|
|
66
|
-
this.multiplier = false;
|
|
67
|
-
this.numberOfDraws = 1;
|
|
68
|
-
this.isLoading = true;
|
|
69
|
-
this.hasErrors = false;
|
|
70
|
-
this.ticketDone = false;
|
|
71
|
-
}
|
|
72
|
-
connectedCallback() {
|
|
73
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
74
|
-
fetch(url.href)
|
|
75
|
-
.then((response) => {
|
|
76
|
-
if (response.ok) {
|
|
77
|
-
return response.json();
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
// Throw error
|
|
81
|
-
this.hasErrors = true;
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
.then((data) => {
|
|
85
|
-
this.isLoading = false;
|
|
86
|
-
this.gameData = data;
|
|
87
|
-
this.grids = [...Array(data.rules.boards.length).keys()];
|
|
88
|
-
})
|
|
89
|
-
.catch((err) => {
|
|
90
|
-
this.isLoading = false;
|
|
91
|
-
this.hasErrors = true;
|
|
92
|
-
console.error('Error!', err);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
multiplierChangeHandler(e) {
|
|
96
|
-
this.multiplier = e.target ? e.target.checked : false;
|
|
97
|
-
this.multiplierChange.emit(this.multiplier);
|
|
98
|
-
}
|
|
99
|
-
drawsChangeHandler(event) {
|
|
100
|
-
this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });
|
|
101
|
-
this.ticketCompleted.emit(this.ticket);
|
|
102
|
-
}
|
|
103
|
-
gridFilledHandler(event) {
|
|
104
|
-
this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });
|
|
105
|
-
this.ticketDone = true;
|
|
106
|
-
this.ticketCompleted.emit(this.ticket);
|
|
107
|
-
}
|
|
108
|
-
toggleAutoSelection() {
|
|
109
|
-
this.ticketDone = true;
|
|
110
|
-
this.autoSelection.emit(this.ticketId);
|
|
111
|
-
}
|
|
112
|
-
toggleResetSelection() {
|
|
113
|
-
this.ticketDone = false;
|
|
114
|
-
this.resetSelection.emit(this.ticketId);
|
|
115
|
-
}
|
|
116
|
-
changeStake(event) {
|
|
117
|
-
this.stakeChange.emit({
|
|
118
|
-
ticketId: this.ticketId,
|
|
119
|
-
stake: event.target.value
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
render() {
|
|
123
|
-
if (this.isLoading) {
|
|
124
|
-
return (h("div", null, h("p", null, translate('loading', this.language))));
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
if (this.hasErrors) {
|
|
128
|
-
return (h("div", null, h("p", null, translate('error', this.language))));
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
const { rules } = this.gameData;
|
|
132
|
-
return (h("div", { class: "TicketContainer" }, h("p", null, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
133
|
-
h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language)), this.autoPick && !this.ticketDone &&
|
|
134
|
-
h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language)), this.grids.map((item, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), h("lottery-grid", { "grid-index": index, "maximum-allowed": rules.boards[index].maximumAllowed, "minimum-allowed": rules.boards[index].minimumAllowed, "total-numbers": rules.boards[index].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
|
|
135
|
-
h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
136
|
-
h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, rules.stakes.length > 1 ? h("div", null, h("select", { class: "InputDefault", onChange: (event) => this.changeStake(event) }, rules.stakes.map((item) => h("option", { value: item.amount }, item.amount, " ", item.currency)))) : h("div", null, h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))));
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
static get watchers() { return {
|
|
141
|
-
"numberOfDraws": ["drawsChangeHandler"]
|
|
142
|
-
}; }
|
|
143
|
-
static get style() { return lotteryTicketCss; }
|
|
144
|
-
}, [1, "lottery-ticket", {
|
|
145
|
-
"endpoint": [1],
|
|
146
|
-
"gameId": [1, "game-id"],
|
|
147
|
-
"numberOfGrids": [2, "number-of-grids"],
|
|
148
|
-
"multipleDraws": [4, "multiple-draws"],
|
|
149
|
-
"ticketId": [2, "ticket-id"],
|
|
150
|
-
"resetButton": [4, "reset-button"],
|
|
151
|
-
"autoPick": [4, "auto-pick"],
|
|
152
|
-
"language": [1],
|
|
153
|
-
"multiplier": [32],
|
|
154
|
-
"numberOfDraws": [32],
|
|
155
|
-
"isLoading": [32],
|
|
156
|
-
"hasErrors": [32],
|
|
157
|
-
"ticketDone": [32]
|
|
158
|
-
}, [[0, "gridFilled", "gridFilledHandler"]]]);
|
|
159
|
-
function defineCustomElement() {
|
|
160
|
-
if (typeof customElements === "undefined") {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
const components = ["lottery-ticket", "lottery-bullet", "lottery-grid"];
|
|
164
|
-
components.forEach(tagName => { switch (tagName) {
|
|
165
|
-
case "lottery-ticket":
|
|
166
|
-
if (!customElements.get(tagName)) {
|
|
167
|
-
customElements.define(tagName, LotteryTicket);
|
|
168
|
-
}
|
|
169
|
-
break;
|
|
170
|
-
case "lottery-bullet":
|
|
171
|
-
if (!customElements.get(tagName)) {
|
|
172
|
-
defineCustomElement$2();
|
|
173
|
-
}
|
|
174
|
-
break;
|
|
175
|
-
case "lottery-grid":
|
|
176
|
-
if (!customElements.get(tagName)) {
|
|
177
|
-
defineCustomElement$1();
|
|
178
|
-
}
|
|
179
|
-
break;
|
|
180
|
-
} });
|
|
181
|
-
}
|
|
182
|
-
defineCustomElement();
|
|
183
|
-
|
|
184
|
-
export { LotteryTicket as L, defineCustomElement as d };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-be84da79.js';
|
|
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;margin-bottom:1px;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}.Content{border-radius:4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{border-radius:4px;margin-top:10px;cursor:pointer;text-transform:capitalize;display:block;font-size:12px;text-align:center;padding:8px 20px;width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
|
|
19
|
-
|
|
20
|
-
const Accordion = class {
|
|
21
|
-
constructor(hostRef) {
|
|
22
|
-
registerInstance(this, hostRef);
|
|
23
|
-
this.accordionEvent = createEvent(this, "helperAccordionAction", 7);
|
|
24
|
-
/**
|
|
25
|
-
* Title (top header)
|
|
26
|
-
*/
|
|
27
|
-
this.headerTitle = '';
|
|
28
|
-
/**
|
|
29
|
-
* SubTitle (top header)
|
|
30
|
-
*/
|
|
31
|
-
this.headerSubtitle = '';
|
|
32
|
-
/**
|
|
33
|
-
* Description
|
|
34
|
-
*/
|
|
35
|
-
this.description = '';
|
|
36
|
-
/**
|
|
37
|
-
* Enables footer content
|
|
38
|
-
*/
|
|
39
|
-
this.footer = false;
|
|
40
|
-
/**
|
|
41
|
-
* Enables footer button for tab deletion
|
|
42
|
-
*/
|
|
43
|
-
this.deleteTab = false;
|
|
44
|
-
/**
|
|
45
|
-
* Activates postMessages as events for actions from the widget
|
|
46
|
-
*/
|
|
47
|
-
this.postMessage = false;
|
|
48
|
-
/**
|
|
49
|
-
* Name of the event emitter by the action button
|
|
50
|
-
*/
|
|
51
|
-
this.eventName = 'helperAccordionAction';
|
|
52
|
-
/**
|
|
53
|
-
* Collapsed
|
|
54
|
-
*/
|
|
55
|
-
this.collapsed = true;
|
|
56
|
-
/**
|
|
57
|
-
* Language
|
|
58
|
-
*/
|
|
59
|
-
this.language = 'en';
|
|
60
|
-
}
|
|
61
|
-
// @TODO fix the `any` type :)
|
|
62
|
-
connectedCallback() {
|
|
63
|
-
this.showContent = !this.collapsed;
|
|
64
|
-
}
|
|
65
|
-
toggleContent() {
|
|
66
|
-
this.showContent = !this.showContent;
|
|
67
|
-
}
|
|
68
|
-
deleteAction() {
|
|
69
|
-
if (this.postMessage) {
|
|
70
|
-
// @TODO maybe change the name type, this one sucks
|
|
71
|
-
window.postMessage({ type: this.eventName }, window.location.href);
|
|
72
|
-
}
|
|
73
|
-
this.accordionEvent.emit();
|
|
74
|
-
}
|
|
75
|
-
render() {
|
|
76
|
-
return (h("div", { class: "Wrapper" }, h("div", { class: "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 &&
|
|
77
|
-
h("div", null, h("div", { class: "Content" }, h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
78
|
-
h("div", null, this.deleteTab &&
|
|
79
|
-
h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
Accordion.style = helperAccordionCss;
|
|
83
|
-
|
|
84
|
-
export { Accordion as helper_accordion };
|