@everymatrix/lottery-game-page 0.1.5 → 0.1.6
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 +126 -0
- package/dist/cjs/helper-accordion_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{lottery-draw-results.cjs.entry.js → helper-filters_2.cjs.entry.js} +133 -1
- package/dist/cjs/helper-filters_2.cjs.entry.js.map +1 -0
- package/dist/cjs/helper-modal.cjs.entry.js +3 -1
- package/dist/cjs/helper-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/helper-pagination.cjs.entry.js +190 -0
- package/dist/cjs/helper-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/helper-tab.cjs.entry.js +38 -0
- package/dist/cjs/helper-tab.cjs.entry.js.map +1 -0
- package/dist/cjs/{index-614098f4.js → index-65086a23.js} +9 -0
- package/dist/cjs/index-65086a23.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +4 -2
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js +164 -0
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js.map +1 -0
- package/dist/cjs/lottery-game-details.cjs.entry.js +21 -0
- package/dist/cjs/lottery-game-details.cjs.entry.js.map +1 -0
- package/dist/cjs/lottery-game-page.cjs.entry.js +3 -4
- package/dist/cjs/lottery-game-page.cjs.entry.js.map +1 -0
- package/dist/cjs/lottery-game-page.cjs.js +4 -2
- package/dist/cjs/lottery-game-page.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +37 -0
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +1 -1
- package/dist/collection/components/lottery-game-page/lottery-game-page.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/utils/locale.utils.js +1 -0
- package/dist/collection/utils/locale.utils.js.map +1 -0
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/helper-accordion.js +8 -0
- package/dist/components/helper-accordion.js.map +1 -0
- package/dist/components/helper-accordion2.js +118 -0
- package/dist/components/helper-accordion2.js.map +1 -0
- package/dist/components/helper-filters.js +8 -0
- package/dist/components/helper-filters.js.map +1 -0
- package/dist/components/helper-filters2.js +168 -0
- package/dist/components/helper-filters2.js.map +1 -0
- package/dist/components/helper-modal.js +2 -0
- package/dist/components/helper-modal.js.map +1 -0
- package/dist/components/helper-modal2.js +2 -0
- package/dist/components/helper-modal2.js.map +1 -0
- package/dist/components/helper-pagination.js +218 -0
- package/dist/components/helper-pagination.js.map +1 -0
- package/dist/components/helper-tab.js +8 -0
- package/dist/components/helper-tab.js.map +1 -0
- package/dist/components/helper-tab2.js +54 -0
- package/dist/components/helper-tab2.js.map +1 -0
- package/dist/components/helper-tabs.js +8 -0
- package/dist/components/helper-tabs.js.map +1 -0
- package/dist/components/helper-tabs2.js +65 -0
- package/dist/components/helper-tabs2.js.map +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/lottery-draw-results-history.js +8 -0
- package/dist/components/lottery-draw-results-history.js.map +1 -0
- package/dist/components/lottery-draw-results-history2.js +207 -0
- package/dist/components/lottery-draw-results-history2.js.map +1 -0
- package/dist/components/lottery-draw-results.js +2 -0
- package/dist/components/lottery-draw-results.js.map +1 -0
- package/dist/components/lottery-draw-results2.js +2 -0
- package/dist/components/lottery-draw-results2.js.map +1 -0
- package/dist/components/lottery-game-details.js +8 -0
- package/dist/components/lottery-game-details.js.map +1 -0
- package/dist/components/lottery-game-details2.js +51 -0
- package/dist/components/lottery-game-details2.js.map +1 -0
- package/dist/components/lottery-game-page.js +42 -7
- package/dist/components/lottery-game-page.js.map +1 -0
- package/dist/esm/helper-accordion_2.entry.js +121 -0
- package/dist/esm/helper-accordion_2.entry.js.map +1 -0
- package/dist/esm/{lottery-draw-results.entry.js → helper-filters_2.entry.js} +133 -2
- package/dist/esm/helper-filters_2.entry.js.map +1 -0
- package/dist/esm/helper-modal.entry.js +3 -1
- package/dist/esm/helper-modal.entry.js.map +1 -0
- package/dist/esm/helper-pagination.entry.js +186 -0
- package/dist/esm/helper-pagination.entry.js.map +1 -0
- package/dist/esm/helper-tab.entry.js +34 -0
- package/dist/esm/helper-tab.entry.js.map +1 -0
- package/dist/esm/{index-0fa076cd.js → index-11dea618.js} +9 -0
- package/dist/esm/index-11dea618.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +4 -2
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/lottery-draw-results-history.entry.js +160 -0
- package/dist/esm/lottery-draw-results-history.entry.js.map +1 -0
- package/dist/esm/lottery-game-details.entry.js +17 -0
- package/dist/esm/lottery-game-details.entry.js.map +1 -0
- package/dist/esm/lottery-game-page.entry.js +3 -4
- package/dist/esm/lottery-game-page.entry.js.map +1 -0
- package/dist/esm/lottery-game-page.js +4 -2
- package/dist/esm/lottery-game-page.js.map +1 -0
- package/dist/lottery-game-page/index.esm.js +2 -0
- package/dist/lottery-game-page/index.esm.js.map +1 -0
- package/dist/lottery-game-page/lottery-game-page.esm.js +2 -1
- package/dist/lottery-game-page/lottery-game-page.esm.js.map +1 -0
- package/dist/lottery-game-page/p-0ffa81cc.entry.js +2 -0
- package/dist/lottery-game-page/p-0ffa81cc.entry.js.map +1 -0
- package/dist/lottery-game-page/p-3a9ad86b.js +2 -0
- package/dist/lottery-game-page/p-3a9ad86b.js.map +1 -0
- package/dist/lottery-game-page/p-3e00e24b.entry.js +2 -0
- package/dist/lottery-game-page/p-3e00e24b.entry.js.map +1 -0
- package/dist/lottery-game-page/p-4a79f68c.entry.js +2 -0
- package/dist/lottery-game-page/p-4a79f68c.entry.js.map +1 -0
- package/dist/lottery-game-page/p-978fd922.entry.js +2 -0
- package/dist/lottery-game-page/p-978fd922.entry.js.map +1 -0
- package/dist/lottery-game-page/p-bd53d31a.entry.js +2 -0
- package/dist/lottery-game-page/p-bd53d31a.entry.js.map +1 -0
- package/dist/lottery-game-page/p-bfa5e84c.entry.js +2 -0
- package/dist/lottery-game-page/p-bfa5e84c.entry.js.map +1 -0
- package/dist/lottery-game-page/p-dedb92e5.entry.js +2 -0
- package/dist/lottery-game-page/p-dedb92e5.entry.js.map +1 -0
- package/dist/lottery-game-page/p-f4592d65.entry.js +2 -0
- package/dist/lottery-game-page/p-f4592d65.entry.js.map +1 -0
- package/dist/stencil.config.js +7 -1
- package/dist/stencil.config.js.map +1 -0
- package/package.json +2 -2
- package/dist/lottery-game-page/p-2d7ccc96.js +0 -1
- package/dist/lottery-game-page/p-6183a920.entry.js +0 -1
- package/dist/lottery-game-page/p-9ca649d9.entry.js +0 -1
- package/dist/lottery-game-page/p-e98ee83a.entry.js +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
defineCustomElement();
|
|
115
|
+
|
|
116
|
+
export { Accordion as A, defineCustomElement as d };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=helper-accordion2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"helper-accordion2.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACzC,MAAM,YAAY,GAAG;AACrB,EAAE,EAAE,EAAE;AACN,IAAI,YAAY,EAAE,eAAe;AACjC,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,YAAY,EAAE,gBAAgB;AAClC,GAAG;AACH,CAAC,CAAC;AACK,MAAM,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AAK,EAAE,SAAS,EAAE,EACnC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,iBAAiB,KAAK,IAAI,GAAG,qBAAqB,GAAG,QAAQ,EAAE,EACpF,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,EAC5C,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,EAClD,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,EAC/C,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,EACpG,IAAI,CAAC,WAAW;MACd,CAAC,CAAC,KAAK,EAAE,IAAI,EACX,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAC3B,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,EACvC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW;QAC7B,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS;UAC3B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAAE,EAAE,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;GACrI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../helper-accordion/dist/collection/utils/locale.utils.js","../helper-accordion/dist/collection/components/helper-accordion/helper-accordion.css?tag=helper-accordion&encapsulation=shadow","../helper-accordion/dist/collection/components/helper-accordion/helper-accordion.js"],"sourcesContent":["const DEFAULT_LANGUAGE = 'en';\nconst SUPPORTED_LANGUAGES = ['ro', 'en'];\nconst TRANSLATIONS = {\n en: {\n deleteTicket: 'Delete ticket'\n },\n ro: {\n deleteTicket: 'Sterge biletul'\n },\n};\nexport const translate = (key, customLang) => {\n const lang = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n","@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n.Header {\n border-radius: 4px 4px 0 0;\n background: #009993;\n display: flex;\n gap: 30px;\n border: 1px solid #009993;\n padding: 8px 10px;\n user-select: none;\n}\n.Header:hover {\n background: #00ABA4;\n}\n.Header .Title,\n.Header .Subtitle,\n.Header .Description {\n margin: 0;\n font-size: 14px;\n color: #fff;\n}\n.Header .Expand {\n margin-left: auto;\n color: #FFF;\n width: 17px;\n height: 17px;\n cursor: pointer;\n text-align: center;\n transform: rotate(90deg);\n font-size: 20px;\n user-select: none;\n}\n\n.HeaderTicketHistory {\n border-radius: 4px;\n background: #F1F1F1;\n display: flex;\n gap: 30px;\n border: 1px solid #009993;\n padding: 8px 10px;\n user-select: none;\n margin-bottom: 5px;\n}\n.HeaderTicketHistory:hover {\n background: #00ABA4;\n}\n.HeaderTicketHistory .Title,\n.HeaderTicketHistory .Subtitle,\n.HeaderTicketHistory .Description {\n margin: 0;\n font-size: 14px;\n color: #000;\n}\n.HeaderTicketHistory .Expand {\n margin-left: auto;\n color: #FFF;\n width: 17px;\n height: 17px;\n cursor: pointer;\n text-align: center;\n transform: rotate(90deg);\n font-size: 20px;\n user-select: none;\n}\n\n.Content {\n border-radius: 0 0 4px 4px;\n background: #fff;\n border: 1px solid #009993;\n padding: 10px 15px;\n user-select: none;\n color: #000;\n margin-bottom: 10px;\n}\n\n.ActionButton {\n cursor: pointer;\n display: inline-block;\n border-radius: 4px;\n margin: 20px 0 10px;\n text-transform: uppercase;\n font-size: 12px;\n text-align: center;\n padding: 8px 20px;\n min-width: 80px;\n background: #FF3D00;\n border: 1px solid #FF3D00;\n color: #FFF;\n}\n.ActionButton:hover {\n background: #FF6536;\n border: 1px solid #FF3D00;\n}","import { Component, Prop, h, State, Event } from '@stencil/core';\nimport { translate } from '../../utils/locale.utils';\nexport class Accordion {\n constructor() {\n /**\n * Flag for ticket history\n */\n this.ticketHistoryFlag = false;\n /**\n * Title (top header)\n */\n this.headerTitle = '';\n /**\n * SubTitle (top header)\n */\n this.headerSubtitle = '';\n /**\n * Description\n */\n this.description = '';\n /**\n * Enables footer content\n */\n this.footer = false;\n /**\n * Enables footer button for tab deletion\n */\n this.deleteTab = false;\n /**\n * Activates postMessages as events for actions from the widget\n */\n this.postMessage = false;\n /**\n * Name of the event emitter by the action button\n */\n this.eventName = 'helperAccordionAction';\n /**\n * Collapsed\n */\n this.collapsed = true;\n /**\n * Language\n */\n this.language = 'en';\n }\n // @TODO fix the `any` type :)\n connectedCallback() {\n this.showContent = !this.collapsed;\n }\n toggleContent() {\n this.showContent = !this.showContent;\n }\n deleteAction() {\n if (this.postMessage) {\n // @TODO maybe change the name type, this one sucks\n window.postMessage({ type: this.eventName }, window.location.href);\n }\n this.accordionEvent.emit();\n }\n render() {\n return (h(\"div\", { class: \"Wrapper\" },\n h(\"div\", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' },\n h(\"p\", { class: \"Title\" }, this.headerTitle),\n h(\"p\", { class: \"Subtitle\" }, this.headerSubtitle),\n h(\"p\", { class: \"Subtitle\" }, this.description),\n h(\"span\", { class: \"Expand\", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')),\n this.showContent &&\n h(\"div\", null,\n h(\"div\", { class: \"Content\" },\n h(\"slot\", { name: 'accordionContent' }),\n this.footer && this.showContent &&\n h(\"div\", null, this.deleteTab &&\n h(\"span\", { class: \"ActionButton\", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));\n }\n static get is() { return \"helper-accordion\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"helper-accordion.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"helper-accordion.css\"]\n }; }\n static get properties() { return {\n \"ticketHistoryFlag\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Flag for ticket history\"\n },\n \"attribute\": \"ticket-history-flag\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"headerTitle\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Title (top header)\"\n },\n \"attribute\": \"header-title\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"headerSubtitle\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"SubTitle (top header)\"\n },\n \"attribute\": \"header-subtitle\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"description\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Description\"\n },\n \"attribute\": \"description\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"footer\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Enables footer content\"\n },\n \"attribute\": \"footer\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"deleteTab\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Enables footer button for tab deletion\"\n },\n \"attribute\": \"delete-tab\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"postMessage\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Activates postMessages as events for actions from the widget\"\n },\n \"attribute\": \"post-message\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"eventName\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Name of the event emitter by the action button\"\n },\n \"attribute\": \"event-name\",\n \"reflect\": false,\n \"defaultValue\": \"'helperAccordionAction'\"\n },\n \"collapsed\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Collapsed\"\n },\n \"attribute\": \"collapsed\",\n \"reflect\": false,\n \"defaultValue\": \"true\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": false,\n \"defaultValue\": \"'en'\"\n }\n }; }\n static get states() { return {\n \"showContent\": {}\n }; }\n static get events() { return [{\n \"method\": \"accordionEvent\",\n \"name\": \"helperAccordionAction\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Action event\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }]; }\n}\n"],"version":3}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { H as HelperFilters$1, d as defineCustomElement$1 } from './helper-filters2.js';
|
|
2
|
+
|
|
3
|
+
const HelperFilters = HelperFilters$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { HelperFilters, defineCustomElement };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=helper-filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"helper-filters.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$1 } from './helper-modal2.js';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
5
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
6
|
+
const TRANSLATIONS = {
|
|
7
|
+
en: {
|
|
8
|
+
filterOpen: 'Filter',
|
|
9
|
+
filterClear: 'Clear',
|
|
10
|
+
filterModalTicketTitle: 'Ticket Results',
|
|
11
|
+
filterModalDrawTitle: 'Draws Results History',
|
|
12
|
+
filterTicketPlaceholder: 'Search for a ticket ID',
|
|
13
|
+
filterDrawPlaceholder: 'Search for a draw ID',
|
|
14
|
+
filterDateRangePlaceholder: 'Date Range',
|
|
15
|
+
filterModalButton: 'Search',
|
|
16
|
+
filterFromCalendar: 'From',
|
|
17
|
+
filterToCalendar: 'To',
|
|
18
|
+
filterOrDate: 'or search by date'
|
|
19
|
+
},
|
|
20
|
+
ro: {
|
|
21
|
+
filterOpen: 'Filtrare',
|
|
22
|
+
filterClear: 'Stergere',
|
|
23
|
+
filterModalTicketTitle: 'Rezultatele biletelor',
|
|
24
|
+
filterModalDrawTitle: 'Rezultatele draw-urilor',
|
|
25
|
+
filterTicketPlaceholder: 'Cauta ID bilet',
|
|
26
|
+
filterDrawPlaceholder: 'Cauta ID draw',
|
|
27
|
+
filterDateRangePlaceholder: 'Perioada',
|
|
28
|
+
filterModalButton: 'Cauta',
|
|
29
|
+
filterOrDate: 'sau cauta dupa data'
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const translate = (key, customLang) => {
|
|
33
|
+
const lang = customLang;
|
|
34
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const helperFiltersCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.FilterButtonsWrapper{display:flex;justify-content:flex-end;gap:5px}.FilterButtonsWrapper .FilterOpen{cursor:pointer;border-radius:4px;padding:8px 15px;width:max-content;border:1px solid #00958f;background:#00958f;color:#FFF;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterOpen:hover{background:#00958f;color:#FFF}.FilterButtonsWrapper .FilterClear{cursor:pointer;border-radius:4px;padding:8px 15px;width:max-content;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterClear:hover{background:#00958f;color:#FFF}.FilterModalHeader,.FilterModalBody,.FilterModalFooter{display:flex;flex-direction:column;gap:5px;align-items:center;margin:20px 0}.FilterModalHeader .FilterModalTitle,.FilterModalBody .FilterModalTitle,.FilterModalFooter .FilterModalTitle{margin:0;padding:0;font-weight:700;font-size:16px;color:#009993;text-transform:uppercase}.FilterModalHeader .FilterModalSearch,.FilterModalBody .FilterModalSearch,.FilterModalFooter .FilterModalSearch{border-radius:4px;background:#e8ebef;color:#263445;width:100%;height:26px;max-width:280px;padding:5px;font-size:15px;border:none;outline:#009993}.FilterModalHeader .FilterCalendarWrapper,.FilterModalBody .FilterCalendarWrapper,.FilterModalFooter .FilterCalendarWrapper{display:flex;gap:5px}.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker{width:50%;max-width:143px}.FilterModalHeader .FilterModalButton,.FilterModalBody .FilterModalButton,.FilterModalFooter .FilterModalButton{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;border:1px solid #00958f;background:#00958f;color:#FFF;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.FilterModalHeader .FilterModalButton:hover,.FilterModalBody .FilterModalButton:hover,.FilterModalFooter .FilterModalButton:hover{background:#00958f;color:#FFF}.FilterModalHeader p,.FilterModalBody p,.FilterModalFooter p{margin:5px 0}";
|
|
38
|
+
|
|
39
|
+
const HelperFilters = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.__registerHost();
|
|
43
|
+
this.__attachShadow();
|
|
44
|
+
this.filterDraw = createEvent(this, "filterDraw", 7);
|
|
45
|
+
this.filterSelection = createEvent(this, "filterSelection", 7);
|
|
46
|
+
this.filterSelectionReset = createEvent(this, "filterSelectionReset", 7);
|
|
47
|
+
/**
|
|
48
|
+
* Check if show the filter option by id
|
|
49
|
+
*/
|
|
50
|
+
this.showFilterId = true;
|
|
51
|
+
/**
|
|
52
|
+
* Choose if filter by draw ID or ticket ID. By default is draw ID.
|
|
53
|
+
*/
|
|
54
|
+
this.activateTicketSearch = false;
|
|
55
|
+
/**
|
|
56
|
+
* Game ID
|
|
57
|
+
*/
|
|
58
|
+
this.gameId = '';
|
|
59
|
+
/**
|
|
60
|
+
* Player ID
|
|
61
|
+
*/
|
|
62
|
+
this.playerId = '';
|
|
63
|
+
/**
|
|
64
|
+
* Session ID
|
|
65
|
+
*/
|
|
66
|
+
this.session = '';
|
|
67
|
+
/**
|
|
68
|
+
* Instead of customEvents the widget triggers postMessages
|
|
69
|
+
*/
|
|
70
|
+
this.postMessage = false;
|
|
71
|
+
/**
|
|
72
|
+
* Language
|
|
73
|
+
*/
|
|
74
|
+
this.language = 'en';
|
|
75
|
+
this.showFilterModal = false;
|
|
76
|
+
this.showClearButton = false;
|
|
77
|
+
this.filterData = {};
|
|
78
|
+
this.filterDataReset = { ticketDrawId: '', filterFromCalendar: '', filterToCalendar: '' };
|
|
79
|
+
}
|
|
80
|
+
// reset field values each time the filter modal opens
|
|
81
|
+
componentDidRender() {
|
|
82
|
+
this.filterData.ticketDrawId = null;
|
|
83
|
+
this.filterData.filterFromCalendar = null;
|
|
84
|
+
this.filterData.filterToCalendar = null;
|
|
85
|
+
// @TODO: to way binding?
|
|
86
|
+
if (document.getElementById('#FilterById'))
|
|
87
|
+
document.getElementById('#FilterById').value = '';
|
|
88
|
+
}
|
|
89
|
+
filterSelectionHandler(event) {
|
|
90
|
+
if (this.postMessage)
|
|
91
|
+
window.postMessage({ type: 'filterSelection', event }, window.location.href);
|
|
92
|
+
if (this.filterData.ticketDrawId)
|
|
93
|
+
this.filterDraw.emit(event);
|
|
94
|
+
if (this.filterData.filterFromCalendar || this.filterData.filterToCalendar)
|
|
95
|
+
this.filterSelection.emit(event);
|
|
96
|
+
}
|
|
97
|
+
filterSelectionResetHandler(event) {
|
|
98
|
+
if (this.postMessage)
|
|
99
|
+
window.postMessage({ type: 'filterSelectionReset', event }, window.location.href);
|
|
100
|
+
this.filterSelectionReset.emit(event);
|
|
101
|
+
}
|
|
102
|
+
modalCloseEvent() {
|
|
103
|
+
this.showFilterModal = false;
|
|
104
|
+
}
|
|
105
|
+
// Toggle filter modal
|
|
106
|
+
toggleFilterModal() {
|
|
107
|
+
this.showFilterModal = true;
|
|
108
|
+
}
|
|
109
|
+
// Filter search
|
|
110
|
+
filterSearch() {
|
|
111
|
+
this.modalCloseEvent();
|
|
112
|
+
this.showClearButton = true;
|
|
113
|
+
this.filterSelectionHandler(this.filterData);
|
|
114
|
+
}
|
|
115
|
+
resetSearch() {
|
|
116
|
+
this.showClearButton = false;
|
|
117
|
+
this.filterSelectionResetHandler(this.filterDataReset);
|
|
118
|
+
this.filterData = {};
|
|
119
|
+
}
|
|
120
|
+
handleTicketDrawId(event) {
|
|
121
|
+
this.filterData.ticketDrawId = event.target.value;
|
|
122
|
+
}
|
|
123
|
+
handleFilterFrom(event) {
|
|
124
|
+
this.filterData.filterFromCalendar = new Date(event.target.value).toISOString();
|
|
125
|
+
}
|
|
126
|
+
handleFilterTo(event) {
|
|
127
|
+
this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
|
|
128
|
+
}
|
|
129
|
+
render() {
|
|
130
|
+
return (h("div", { class: "HelperFilters" }, h("div", { class: "FilterButtonsWrapper" }, h("button", { class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate('filterOpen', this.language)), this.showClearButton ? h("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate('filterClear', this.language)) : null), h("helper-modal", { "title-modal": "Filter Modal", visible: this.showFilterModal }, h("div", { class: "FilterModalHeader" }, h("h3", { class: "FilterModalTitle" }, this.activateTicketSearch ? translate('filterModalTicketTitle', this.language) : translate('filterModalDrawTitle', this.language))), h("div", { class: "FilterModalBody" }, h("input", { id: "FilterById", type: "text", value: this.filterData.ticketDrawId, onInput: (event) => this.handleTicketDrawId(event), class: "FilterModalSearch", placeholder: this.activateTicketSearch ? translate('filterTicketPlaceholder', this.language) : translate('filterDrawPlaceholder', this.language) }), h("p", null, translate('filterOrDate', this.language)), h("div", { class: "FilterCalendarWrapper" })), h("div", { class: "FilterModalFooter" }, h("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));
|
|
131
|
+
}
|
|
132
|
+
static get style() { return helperFiltersCss; }
|
|
133
|
+
}, [1, "helper-filters", {
|
|
134
|
+
"showFilterId": [4, "show-filter-id"],
|
|
135
|
+
"activateTicketSearch": [4, "activate-ticket-search"],
|
|
136
|
+
"gameId": [1, "game-id"],
|
|
137
|
+
"playerId": [1, "player-id"],
|
|
138
|
+
"session": [1],
|
|
139
|
+
"postMessage": [4, "post-message"],
|
|
140
|
+
"language": [1],
|
|
141
|
+
"showFilterModal": [32],
|
|
142
|
+
"showClearButton": [32],
|
|
143
|
+
"filterData": [32],
|
|
144
|
+
"filterDataReset": [32]
|
|
145
|
+
}, [[0, "modalCloseEvent", "modalCloseEvent"]]]);
|
|
146
|
+
function defineCustomElement() {
|
|
147
|
+
if (typeof customElements === "undefined") {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const components = ["helper-filters", "helper-modal"];
|
|
151
|
+
components.forEach(tagName => { switch (tagName) {
|
|
152
|
+
case "helper-filters":
|
|
153
|
+
if (!customElements.get(tagName)) {
|
|
154
|
+
customElements.define(tagName, HelperFilters);
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
case "helper-modal":
|
|
158
|
+
if (!customElements.get(tagName)) {
|
|
159
|
+
defineCustomElement$1();
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
} });
|
|
163
|
+
}
|
|
164
|
+
defineCustomElement();
|
|
165
|
+
|
|
166
|
+
export { HelperFilters as H, defineCustomElement as d };
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=helper-filters2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"helper-filters2.js","mappings":";;;AAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,mBAAmB,GAAG,CAAC,IAAI,EA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EAAE,CAAC,EACrT,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EACtD,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC,CAAC,EAC/C,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EACrC,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAAE,EAAE,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;GAC1I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../helper-filters/dist/collection/utils/locale.utils.js","../helper-filters/dist/collection/components/helper-filters/helper-filters.css?tag=helper-filters&encapsulation=shadow","../helper-filters/dist/collection/components/helper-filters/helper-filters.js"],"sourcesContent":["const DEFAULT_LANGUAGE = 'en';\nconst SUPPORTED_LANGUAGES = ['ro', 'en'];\nconst TRANSLATIONS = {\n en: {\n filterOpen: 'Filter',\n filterClear: 'Clear',\n filterModalTicketTitle: 'Ticket Results',\n filterModalDrawTitle: 'Draws Results History',\n filterTicketPlaceholder: 'Search for a ticket ID',\n filterDrawPlaceholder: 'Search for a draw ID',\n filterDateRangePlaceholder: 'Date Range',\n filterModalButton: 'Search',\n filterFromCalendar: 'From',\n filterToCalendar: 'To',\n filterOrDate: 'or search by date'\n },\n ro: {\n filterOpen: 'Filtrare',\n filterClear: 'Stergere',\n filterModalTicketTitle: 'Rezultatele biletelor',\n filterModalDrawTitle: 'Rezultatele draw-urilor',\n filterTicketPlaceholder: 'Cauta ID bilet',\n filterDrawPlaceholder: 'Cauta ID draw',\n filterDateRangePlaceholder: 'Perioada',\n filterModalButton: 'Cauta',\n filterOrDate: 'sau cauta dupa data'\n },\n};\nexport const translate = (key, customLang) => {\n const lang = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n","@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n.FilterButtonsWrapper {\n display: flex;\n justify-content: flex-end;\n gap: 5px;\n}\n.FilterButtonsWrapper .FilterOpen {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 15px;\n width: max-content;\n border: 1px solid #00958f;\n background: #00958f;\n color: #FFF;\n font-size: 12px;\n transition: all 0.2s linear;\n text-align: center;\n letter-spacing: 0;\n}\n.FilterButtonsWrapper .FilterOpen:hover {\n background: #00958f;\n color: #FFF;\n}\n.FilterButtonsWrapper .FilterClear {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 15px;\n width: max-content;\n border: 1px solid #00958f;\n background: #FFF;\n color: #000;\n font-size: 12px;\n transition: all 0.2s linear;\n text-align: center;\n letter-spacing: 0;\n}\n.FilterButtonsWrapper .FilterClear:hover {\n background: #00958f;\n color: #FFF;\n}\n\n.FilterModalHeader,\n.FilterModalBody,\n.FilterModalFooter {\n display: flex;\n flex-direction: column;\n gap: 5px;\n align-items: center;\n margin: 20px 0;\n}\n.FilterModalHeader .FilterModalTitle,\n.FilterModalBody .FilterModalTitle,\n.FilterModalFooter .FilterModalTitle {\n margin: 0;\n padding: 0;\n font-weight: 700;\n font-size: 16px;\n color: #009993;\n text-transform: uppercase;\n}\n.FilterModalHeader .FilterModalSearch,\n.FilterModalBody .FilterModalSearch,\n.FilterModalFooter .FilterModalSearch {\n border-radius: 4px;\n background: #e8ebef;\n color: #263445;\n width: 100%;\n height: 26px;\n max-width: 280px;\n padding: 5px;\n font-size: 15px;\n border: none;\n outline: #009993;\n}\n.FilterModalHeader .FilterCalendarWrapper,\n.FilterModalBody .FilterCalendarWrapper,\n.FilterModalFooter .FilterCalendarWrapper {\n display: flex;\n gap: 5px;\n}\n.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,\n.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,\n.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker {\n width: 50%;\n max-width: 143px;\n}\n.FilterModalHeader .FilterModalButton,\n.FilterModalBody .FilterModalButton,\n.FilterModalFooter .FilterModalButton {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 60px;\n width: max-content;\n margin: 5px;\n border: 1px solid #00958f;\n background: #00958f;\n color: #FFF;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.FilterModalHeader .FilterModalButton:hover,\n.FilterModalBody .FilterModalButton:hover,\n.FilterModalFooter .FilterModalButton:hover {\n background: #00958f;\n color: #FFF;\n}\n.FilterModalHeader p,\n.FilterModalBody p,\n.FilterModalFooter p {\n margin: 5px 0;\n}","import { Component, h, State, Prop, Event, Listen } from '@stencil/core';\nimport { translate } from '../../utils/locale.utils';\n// import '@vaadin/date-picker';\n// import '@vaadin/vaadin-date-picker/vaadin-date-picker.js';\nimport '@everymatrix/helper-modal';\nexport class HelperFilters {\n constructor() {\n /**\n * Check if show the filter option by id\n */\n this.showFilterId = true;\n /**\n * Choose if filter by draw ID or ticket ID. By default is draw ID.\n */\n this.activateTicketSearch = false;\n /**\n * Game ID\n */\n this.gameId = '';\n /**\n * Player ID\n */\n this.playerId = '';\n /**\n * Session ID\n */\n this.session = '';\n /**\n * Instead of customEvents the widget triggers postMessages\n */\n this.postMessage = false;\n /**\n * Language\n */\n this.language = 'en';\n this.showFilterModal = false;\n this.showClearButton = false;\n this.filterData = {};\n this.filterDataReset = { ticketDrawId: '', filterFromCalendar: '', filterToCalendar: '' };\n }\n // reset field values each time the filter modal opens\n componentDidRender() {\n this.filterData.ticketDrawId = null;\n this.filterData.filterFromCalendar = null;\n this.filterData.filterToCalendar = null;\n // @TODO: to way binding?\n if (document.getElementById('#FilterById'))\n document.getElementById('#FilterById').value = '';\n }\n filterSelectionHandler(event) {\n if (this.postMessage)\n window.postMessage({ type: 'filterSelection', event }, window.location.href);\n if (this.filterData.ticketDrawId)\n this.filterDraw.emit(event);\n if (this.filterData.filterFromCalendar || this.filterData.filterToCalendar)\n this.filterSelection.emit(event);\n ;\n }\n filterSelectionResetHandler(event) {\n if (this.postMessage)\n window.postMessage({ type: 'filterSelectionReset', event }, window.location.href);\n this.filterSelectionReset.emit(event);\n }\n modalCloseEvent() {\n this.showFilterModal = false;\n }\n // Toggle filter modal\n toggleFilterModal() {\n this.showFilterModal = true;\n }\n // Filter search\n filterSearch() {\n this.modalCloseEvent();\n this.showClearButton = true;\n this.filterSelectionHandler(this.filterData);\n }\n resetSearch() {\n this.showClearButton = false;\n this.filterSelectionResetHandler(this.filterDataReset);\n this.filterData = {};\n }\n handleTicketDrawId(event) {\n this.filterData.ticketDrawId = event.target.value;\n }\n handleFilterFrom(event) {\n this.filterData.filterFromCalendar = new Date(event.target.value).toISOString();\n }\n handleFilterTo(event) {\n this.filterData.filterToCalendar = new Date(event.target.value).toISOString();\n }\n render() {\n return (h(\"div\", { class: \"HelperFilters\" },\n h(\"div\", { class: \"FilterButtonsWrapper\" },\n h(\"button\", { class: \"FilterOpen\", onClick: () => this.toggleFilterModal() }, translate('filterOpen', this.language)),\n this.showClearButton ? h(\"button\", { class: \"FilterClear\", onClick: () => this.resetSearch() }, translate('filterClear', this.language)) : null),\n h(\"helper-modal\", { \"title-modal\": \"Filter Modal\", visible: this.showFilterModal },\n h(\"div\", { class: \"FilterModalHeader\" },\n h(\"h3\", { class: \"FilterModalTitle\" }, this.activateTicketSearch ? translate('filterModalTicketTitle', this.language) : translate('filterModalDrawTitle', this.language))),\n h(\"div\", { class: \"FilterModalBody\" },\n h(\"input\", { id: \"FilterById\", type: \"text\", value: this.filterData.ticketDrawId, onInput: (event) => this.handleTicketDrawId(event), class: \"FilterModalSearch\", placeholder: this.activateTicketSearch ? translate('filterTicketPlaceholder', this.language) : translate('filterDrawPlaceholder', this.language) }),\n h(\"p\", null, translate('filterOrDate', this.language)),\n h(\"div\", { class: \"FilterCalendarWrapper\" })),\n h(\"div\", { class: \"FilterModalFooter\" },\n h(\"button\", { class: \"FilterModalButton\", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));\n }\n static get is() { return \"helper-filters\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"helper-filters.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"helper-filters.css\"]\n }; }\n static get properties() { return {\n \"showFilterId\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Check if show the filter option by id\"\n },\n \"attribute\": \"show-filter-id\",\n \"reflect\": false,\n \"defaultValue\": \"true\"\n },\n \"activateTicketSearch\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Choose if filter by draw ID or ticket ID. By default is draw ID.\"\n },\n \"attribute\": \"activate-ticket-search\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"gameId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Game ID\"\n },\n \"attribute\": \"game-id\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"playerId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Player ID\"\n },\n \"attribute\": \"player-id\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"session\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Session ID\"\n },\n \"attribute\": \"session\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"postMessage\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Instead of customEvents the widget triggers postMessages\"\n },\n \"attribute\": \"post-message\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": false,\n \"defaultValue\": \"'en'\"\n }\n }; }\n static get states() { return {\n \"showFilterModal\": {},\n \"showClearButton\": {},\n \"filterData\": {},\n \"filterDataReset\": {}\n }; }\n static get events() { return [{\n \"method\": \"filterDraw\",\n \"name\": \"filterDraw\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"HelperFilters\",\n \"resolved\": \"HelperFilters\",\n \"references\": {\n \"HelperFilters\": {\n \"location\": \"global\"\n }\n }\n }\n }, {\n \"method\": \"filterSelection\",\n \"name\": \"filterSelection\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"HelperFilters\",\n \"resolved\": \"HelperFilters\",\n \"references\": {\n \"HelperFilters\": {\n \"location\": \"global\"\n }\n }\n }\n }, {\n \"method\": \"filterSelectionReset\",\n \"name\": \"filterSelectionReset\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"HelperFilters\",\n \"resolved\": \"HelperFilters\",\n \"references\": {\n \"HelperFilters\": {\n \"location\": \"global\"\n }\n }\n }\n }]; }\n static get listeners() { return [{\n \"name\": \"modalCloseEvent\",\n \"method\": \"modalCloseEvent\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }]; }\n}\n"],"version":3}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"helper-modal.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"helper-modal2.js","mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,QAAQ,GAAG,CAAC,SAAS,KAAK;AACvC,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;AACrD,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC;AACnD,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC;AACtD,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC,CAAC;AACvF,CAAC;;ACXD,MAAM,cAAc,GAAG,y/BAAy/B;;MCEngC,WAAW;EACtB;;;;;;;;IAIE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;GAC7C;EACD,sBAAsB;IACpB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;GACpB;;EAED,MAAM;IACJ,SAAS,IAAI,CAAC,OAAO;MACnB,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,GAAG,uCAAuC,GAAG,oBAAoB,EAAE,EAC/F,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,uCAAuC,EAAE,EACzD,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,oBAAoB,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,2BAA2B,GAAG,EAAE,CAAC,EAAE,EACtG,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,kBAAkB,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,yBAAyB,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,EAC5J,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG;GAC9B;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../helper-modal/dist/collection/utils/utils.js","../helper-modal/dist/collection/components/helper-modal/helper-modal.css?tag=helper-modal&encapsulation=shadow","../helper-modal/dist/collection/components/helper-modal/helper-modal.js"],"sourcesContent":["/**\n * @name isMobile\n * @description A method that returns if the browser used to access the app is from a mobile device or not\n * @param {String} userAgent window.navigator.userAgent\n * @returns {Boolean} true or false\n */\nexport const isMobile = (userAgent) => {\n return !!(userAgent.toLowerCase().match(/android/i) ||\n userAgent.toLowerCase().match(/blackberry|bb/i) ||\n userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||\n userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));\n};\n/**\n * @name getDevice\n * @description A method that returns the type of the device\n * @param {String} userAgent window.navigator.userAgent\n * @returns {String} Android/iPhone/iPad/PC\n */\nexport const getDevice = (userAgent) => {\n if (userAgent.toLowerCase().match(/android/i)) {\n return 'Android';\n }\n if (userAgent.toLowerCase().match(/iphone/i)) {\n return 'iPhone';\n }\n if (userAgent.toLowerCase().match(/ipad|ipod/i)) {\n return 'iPad';\n }\n return 'PC';\n};\n",":host {\n display: block;\n}\n\n.HelperModalWrapper {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.7);\n opacity: 0;\n visibility: hidden;\n transform: scale(1.1);\n transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;\n z-index: 1;\n}\n\n.HelperModalVisible {\n opacity: 1;\n visibility: visible;\n transform: scale(1);\n transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;\n}\n\n.HelperModalContent {\n position: relative;\n border: solid 1px #848e97;\n box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.007);\n font-size: 14px;\n padding: 10px 10px 5px 10px;\n background-color: #fff;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border-radius: 4px;\n width: 600px;\n max-height: 600px;\n overflow-y: scroll;\n}\n\n.HelperModalMobileContent {\n background: #FFF;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border-radius: 4px;\n width: 80%;\n max-height: 350px;\n}\n\n.HelperModalClose {\n cursor: pointer;\n position: absolute;\n top: 15px;\n right: 15px;\n font-size: 20px;\n color: #000;\n}\n\n.HelperModalMobileClose {\n position: absolute;\n top: 15px;\n right: 15px;\n font-size: 20px;\n color: #000;\n}","import { Component, Event, h, Prop } from '@stencil/core';\nimport { isMobile } from \"../../utils/utils\";\nexport class HelperModal {\n constructor() {\n /**\n * Toggles if the helper is visible or not\n */\n this.visible = true;\n this.userAgent = window.navigator.userAgent;\n }\n handleHelperModalClose() {\n this.visible = false;\n this.cancel.emit();\n }\n ;\n render() {\n return ((this.visible &&\n h(\"div\", { class: this.visible ? \"HelperModalWrapper HelperModalVisible\" : \"HelperModalWrapper\" },\n h(\"div\", { class: \"HelperModalWrapper HelperModalVisible\" },\n h(\"div\", { class: \"HelperModalContent\" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') },\n h(\"span\", { class: \"HelperModalClose\" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, \"X\"),\n h(\"slot\", null))))));\n }\n static get is() { return \"helper-modal\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"helper-modal.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"helper-modal.css\"]\n }; }\n static get properties() { return {\n \"titleModal\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Modal title\"\n },\n \"attribute\": \"title-modal\",\n \"reflect\": false\n },\n \"visible\": {\n \"type\": \"boolean\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Toggles if the helper is visible or not\"\n },\n \"attribute\": \"visible\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n }\n }; }\n static get events() { return [{\n \"method\": \"cancel\",\n \"name\": \"modalCloseEvent\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The event triggered when the modal is closed\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }]; }\n}\n"],"version":3}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name isMobile
|
|
5
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
6
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
7
|
+
* @returns {Boolean} true or false
|
|
8
|
+
*/
|
|
9
|
+
const isMobile = (userAgent) => {
|
|
10
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
11
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
12
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
13
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
17
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
18
|
+
const TRANSLATIONS = {
|
|
19
|
+
en: {
|
|
20
|
+
firstPage: 'First',
|
|
21
|
+
previousPage: 'Previous',
|
|
22
|
+
nextPage: 'Next',
|
|
23
|
+
lastPage: 'Last'
|
|
24
|
+
},
|
|
25
|
+
ro: {
|
|
26
|
+
firstPage: 'Prima',
|
|
27
|
+
previousPage: 'Anterior',
|
|
28
|
+
nextPage: 'Urmatoarea',
|
|
29
|
+
lastPage: 'Ultima'
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const translate = (key, customLang) => {
|
|
33
|
+
const lang = customLang;
|
|
34
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const helperPaginationCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}#PaginationContainer{width:100%;margin-top:20px;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:#009993;border-color:#009993}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:#000;cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:#009993;border-color:#009993;color:#fff}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:#009993;border-color:#009993;color:#fff;opacity:0.8}button{width:100px;height:32px;border:1px solid #524e52;border-radius:5px;background:#524e52;color:#fff;font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:#004D4A;border-color:#004D4A}button:disabled{background-color:#ccc;border-color:#ccc;color:#fff;cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:12px}}@media screen and (max-width: 480px){button{width:70px;font-size:10px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:10px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:#009993;border-color:#009993;color:#fff}}";
|
|
38
|
+
|
|
39
|
+
const HelperPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.__registerHost();
|
|
43
|
+
this.__attachShadow();
|
|
44
|
+
this.hpPageChange = createEvent(this, "hpPageChange", 7);
|
|
45
|
+
/**
|
|
46
|
+
* First page boolean value - determines if the page is disabled or active
|
|
47
|
+
*/
|
|
48
|
+
this.firstPage = false;
|
|
49
|
+
/**
|
|
50
|
+
* Previous page boolean value - determines if the page is disabled or active
|
|
51
|
+
*/
|
|
52
|
+
this.previousPage = false;
|
|
53
|
+
/**
|
|
54
|
+
* The received offset
|
|
55
|
+
*/
|
|
56
|
+
this.offset = 0;
|
|
57
|
+
/**
|
|
58
|
+
* The received limit for the number of pages
|
|
59
|
+
*/
|
|
60
|
+
this.limit = 1;
|
|
61
|
+
/**
|
|
62
|
+
* The received total number of pages
|
|
63
|
+
*/
|
|
64
|
+
this.total = 1;
|
|
65
|
+
/**
|
|
66
|
+
* Language
|
|
67
|
+
*/
|
|
68
|
+
this.language = 'en';
|
|
69
|
+
/**
|
|
70
|
+
* In component working variable for the array of pages
|
|
71
|
+
*/
|
|
72
|
+
this.pagesArray = [];
|
|
73
|
+
/**
|
|
74
|
+
* In component working variable for last page
|
|
75
|
+
*/
|
|
76
|
+
this.endInt = 0;
|
|
77
|
+
this.userAgent = window.navigator.userAgent;
|
|
78
|
+
this.currentPage = 1;
|
|
79
|
+
/**
|
|
80
|
+
* Navigation logic
|
|
81
|
+
*/
|
|
82
|
+
this.navigateTo = (navigationPage) => {
|
|
83
|
+
switch (navigationPage) {
|
|
84
|
+
case 'firstPage':
|
|
85
|
+
this.offsetInt = 0;
|
|
86
|
+
break;
|
|
87
|
+
case 'lastPage':
|
|
88
|
+
this.offsetInt = this.endInt * this.limitInt;
|
|
89
|
+
break;
|
|
90
|
+
case 'previousPage':
|
|
91
|
+
this.offsetInt -= 10;
|
|
92
|
+
break;
|
|
93
|
+
case 'nextPage':
|
|
94
|
+
this.offsetInt += 10;
|
|
95
|
+
break;
|
|
96
|
+
case 'fivePagesBack':
|
|
97
|
+
this.offsetInt -= 30;
|
|
98
|
+
this.offsetInt = this.offsetInt < 0 ? 0 : this.offsetInt;
|
|
99
|
+
break;
|
|
100
|
+
case 'fivePagesForward':
|
|
101
|
+
this.offsetInt += 30;
|
|
102
|
+
this.offsetInt = this.offsetInt / 10 >= this.endInt ? this.endInt * 10 : this.offsetInt;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Handle navigation from here
|
|
109
|
+
*/
|
|
110
|
+
this.paginationNavigation = (pageNumber, index) => {
|
|
111
|
+
if (!isNaN(pageNumber)) {
|
|
112
|
+
if (pageNumber === 1) {
|
|
113
|
+
this.offsetInt = pageNumber - 1;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.offsetInt = (pageNumber - 1) * 10;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
if (index === 0 && this.currentPage <= 4) {
|
|
121
|
+
this.navigateTo('firstPage');
|
|
122
|
+
}
|
|
123
|
+
else if (index === 0 && this.currentPage > 4) {
|
|
124
|
+
this.navigateTo('fivePagesBack');
|
|
125
|
+
}
|
|
126
|
+
else if (index === 4 && this.endInt - this.currentPage >= 2) {
|
|
127
|
+
this.navigateTo('fivePagesForward');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
this.currentPage = this.offsetInt;
|
|
131
|
+
this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
componentWillRender() {
|
|
135
|
+
this.offsetInt = this.offset;
|
|
136
|
+
this.currentPage = this.offsetInt / this.limitInt + 1;
|
|
137
|
+
this.limitInt = this.limit;
|
|
138
|
+
this.totalInt = this.total;
|
|
139
|
+
this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
|
|
140
|
+
this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
|
|
141
|
+
/**
|
|
142
|
+
* Construct numbered navigation area based on current page position
|
|
143
|
+
*/
|
|
144
|
+
if (this.currentPage === 1 || this.currentPage === 2) {
|
|
145
|
+
this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
|
|
146
|
+
this.pagesArray.push('...');
|
|
147
|
+
}
|
|
148
|
+
else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
|
|
149
|
+
this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
|
|
150
|
+
this.pagesArray.push('...');
|
|
151
|
+
this.pagesArray.unshift('...');
|
|
152
|
+
}
|
|
153
|
+
else if ((this.endInt - this.currentPage) < 3) {
|
|
154
|
+
this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
|
|
155
|
+
this.pagesArray.unshift('...');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
render() {
|
|
159
|
+
/**
|
|
160
|
+
* Center navigation area
|
|
161
|
+
*/
|
|
162
|
+
let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
|
|
163
|
+
return (h("li", { class: 'PaginationItem' + (item === this.currentPage ? ' ActiveItem' : ' ') + ' ' + (isMobile(this.userAgent) ? 'MobileButtons' : '') }, h("button", { disabled: item === this.currentPage ? true : false, onClick: this.paginationNavigation.bind(this, item, index) }, h("span", null, item))));
|
|
164
|
+
}));
|
|
165
|
+
/**
|
|
166
|
+
* Left navigation area
|
|
167
|
+
*/
|
|
168
|
+
let buttonsLeftSide = h("div", { class: "LeftItems" }, h("button", { disabled: !this.previousPage, onClick: this.navigateTo.bind(this, 'firstPage') }, translate('firstPage', this.language)), h("button", { disabled: !this.previousPage ? true : false, onClick: this.navigateTo.bind(this, 'previousPage') }, translate('previousPage', this.language)));
|
|
169
|
+
if (isMobile(this.userAgent)) {
|
|
170
|
+
buttonsLeftSide =
|
|
171
|
+
h("div", { class: "LeftItems" }, h("button", { disabled: !this.previousPage ? true : false, onClick: this.navigateTo.bind(this, 'previousPage') }, translate('previousPage', this.language)));
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Right navigation area
|
|
175
|
+
*/
|
|
176
|
+
let buttonsRightSide = h("div", { class: "RightItems" }, h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'nextPage') }, translate('nextPage', this.language)), h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'lastPage') }, translate('lastPage', this.language)));
|
|
177
|
+
if (isMobile(this.userAgent)) {
|
|
178
|
+
buttonsRightSide =
|
|
179
|
+
h("div", { class: "RightItems" }, h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'nextPage') }, translate('nextPage', this.language)));
|
|
180
|
+
}
|
|
181
|
+
return (h("div", { id: "PaginationContainer" }, buttonsLeftSide, navigationArea, buttonsRightSide));
|
|
182
|
+
}
|
|
183
|
+
static get style() { return helperPaginationCss; }
|
|
184
|
+
}, [1, "helper-pagination", {
|
|
185
|
+
"firstPage": [1540, "first-page"],
|
|
186
|
+
"previousPage": [1540, "previous-page"],
|
|
187
|
+
"offset": [1538],
|
|
188
|
+
"limit": [1538],
|
|
189
|
+
"total": [1538],
|
|
190
|
+
"language": [1],
|
|
191
|
+
"offsetInt": [32],
|
|
192
|
+
"lastPage": [32],
|
|
193
|
+
"limitInt": [32],
|
|
194
|
+
"totalInt": [32],
|
|
195
|
+
"pagesArray": [32],
|
|
196
|
+
"endInt": [32]
|
|
197
|
+
}]);
|
|
198
|
+
function defineCustomElement$1() {
|
|
199
|
+
if (typeof customElements === "undefined") {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const components = ["helper-pagination"];
|
|
203
|
+
components.forEach(tagName => { switch (tagName) {
|
|
204
|
+
case "helper-pagination":
|
|
205
|
+
if (!customElements.get(tagName)) {
|
|
206
|
+
customElements.define(tagName, HelperPagination$1);
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
} });
|
|
210
|
+
}
|
|
211
|
+
defineCustomElement$1();
|
|
212
|
+
|
|
213
|
+
const HelperPagination = HelperPagination$1;
|
|
214
|
+
const defineCustomElement = defineCustomElement$1;
|
|
215
|
+
|
|
216
|
+
export { HelperPagination, defineCustomElement };
|
|
217
|
+
|
|
218
|
+
//# sourceMappingURL=helper-pagination.js.map
|