@everymatrix/helper-filters 0.1.3 → 0.1.7

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-0c5bb1ff.js');
3
+ const index = require('./index-d16cebbc.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-filters.cjs",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]]], options);
18
+ return index.bootstrapLazy([["helper-filters_2.cjs",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]],[1,"helper-modal",{"titleModal":[1,"title-modal"],"visible":[1540]}]]]], options);
19
19
  });
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-0c5bb1ff.js');
6
- require('@everymatrix/helper-modal');
5
+ const index = require('./index-d16cebbc.js');
6
+ require('@vaadin/date-picker');
7
7
 
8
8
  const DEFAULT_LANGUAGE = 'en';
9
9
  const SUPPORTED_LANGUAGES = ['ro', 'en'];
@@ -129,9 +129,47 @@ const HelperFilters = class {
129
129
  this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
130
130
  }
131
131
  render() {
132
- return (index.h("div", { class: "HelperFilters" }, index.h("div", { class: "FilterButtonsWrapper" }, index.h("button", { class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate('filterOpen', this.language)), this.showClearButton ? index.h("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate('filterClear', this.language)) : null), index.h("helper-modal", { "title-modal": "Filter Modal", visible: this.showFilterModal }, index.h("div", { class: "FilterModalHeader" }, index.h("h3", { class: "FilterModalTitle" }, this.activateTicketSearch ? translate('filterModalTicketTitle', this.language) : translate('filterModalDrawTitle', this.language))), index.h("div", { class: "FilterModalBody" }, index.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) }), index.h("p", null, translate('filterOrDate', this.language)), index.h("div", { class: "FilterCalendarWrapper" })), index.h("div", { class: "FilterModalFooter" }, index.h("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));
132
+ return (index.h("div", { class: "HelperFilters" }, index.h("div", { class: "FilterButtonsWrapper" }, index.h("button", { class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate('filterOpen', this.language)), this.showClearButton ? index.h("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate('filterClear', this.language)) : null), index.h("helper-modal", { "title-modal": "Filter Modal", visible: this.showFilterModal }, index.h("div", { class: "FilterModalHeader" }, index.h("h3", { class: "FilterModalTitle" }, this.activateTicketSearch ? translate('filterModalTicketTitle', this.language) : translate('filterModalDrawTitle', this.language))), index.h("div", { class: "FilterModalBody" }, index.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) }), index.h("p", null, translate('filterOrDate', this.language)), index.h("div", { class: "FilterCalendarWrapper" }, index.h("vaadin-date-picker", { value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate('filterFromCalendar', this.language), class: "VaadinDatePicker" }), index.h("vaadin-date-picker", { value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate('filterToCalendar', this.language), class: "VaadinDatePicker" }))), index.h("div", { class: "FilterModalFooter" }, index.h("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));
133
133
  }
134
134
  };
135
135
  HelperFilters.style = helperFiltersCss;
136
136
 
137
+ /**
138
+ * @name isMobile
139
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
140
+ * @param {String} userAgent window.navigator.userAgent
141
+ * @returns {Boolean} true or false
142
+ */
143
+ const isMobile = (userAgent) => {
144
+ return !!(userAgent.toLowerCase().match(/android/i) ||
145
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
146
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
147
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
148
+ };
149
+
150
+ const helperModalCss = ":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px #848e97;box-shadow:2px 2px 2px rgba(0, 0, 0, 0.007);font-size:14px;padding:10px 10px 5px 10px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:#FFF;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:#000}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:#000}";
151
+
152
+ const HelperModal = class {
153
+ constructor(hostRef) {
154
+ index.registerInstance(this, hostRef);
155
+ this.cancel = index.createEvent(this, "modalCloseEvent", 7);
156
+ /**
157
+ * Toggles if the helper is visible or not
158
+ */
159
+ this.visible = true;
160
+ this.userAgent = window.navigator.userAgent;
161
+ }
162
+ handleHelperModalClose() {
163
+ this.visible = false;
164
+ this.cancel.emit();
165
+ }
166
+ ;
167
+ render() {
168
+ return ((this.visible &&
169
+ index.h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper" }, index.h("div", { class: "HelperModalWrapper HelperModalVisible" }, index.h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') }, index.h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), index.h("slot", null))))));
170
+ }
171
+ };
172
+ HelperModal.style = helperModalCss;
173
+
137
174
  exports.helper_filters = HelperFilters;
175
+ exports.helper_modal = HelperModal;
@@ -502,11 +502,14 @@ const patch = (oldVNode, newVNode) => {
502
502
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
503
503
  const oldChildren = oldVNode.$children$;
504
504
  const newChildren = newVNode.$children$;
505
+ const tag = newVNode.$tag$;
505
506
  const text = newVNode.$text$;
506
507
  if (text === null) {
507
508
  // element node
508
509
  {
509
- {
510
+ if (tag === 'slot')
511
+ ;
512
+ else {
510
513
  // either this is the first render of an element OR it's an update
511
514
  // AND we already know it's possible it could have changed
512
515
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -539,9 +542,14 @@ const patch = (oldVNode, newVNode) => {
539
542
  };
540
543
  const renderVdom = (hostRef, renderFnResults) => {
541
544
  const hostElm = hostRef.$hostElement$;
545
+ const cmpMeta = hostRef.$cmpMeta$;
542
546
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
543
547
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
544
548
  hostTagName = hostElm.tagName;
549
+ if (cmpMeta.$attrsToReflect$) {
550
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
551
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
552
+ }
545
553
  rootVnode.$tag$ = null;
546
554
  rootVnode.$flags$ |= 4 /* isHost */;
547
555
  hostRef.$vnode$ = rootVnode;
@@ -892,6 +900,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
892
900
  .map(([propName, m]) => {
893
901
  const attrName = m[1] || propName;
894
902
  attrNameToPropName.set(attrName, propName);
903
+ if (m[0] & 512 /* ReflectAttr */) {
904
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
905
+ }
895
906
  return attrName;
896
907
  });
897
908
  }
@@ -1052,6 +1063,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1052
1063
  {
1053
1064
  cmpMeta.$listeners$ = compactMeta[3];
1054
1065
  }
1066
+ {
1067
+ cmpMeta.$attrsToReflect$ = [];
1068
+ }
1055
1069
  const tagName = cmpMeta.$tagName$;
1056
1070
  const HostElement = class extends HTMLElement {
1057
1071
  // StencilLazyHost
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-0c5bb1ff.js');
5
+ const index = require('./index-d16cebbc.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-filters.cjs",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]]], options);
17
+ return index.bootstrapLazy([["helper-filters_2.cjs",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]],[1,"helper-modal",{"titleModal":[1,"title-modal"],"visible":[1540]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -7,6 +7,13 @@
7
7
  "version": "2.15.2",
8
8
  "typescriptVersion": "4.5.4"
9
9
  },
10
- "collections": [],
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/helper-modal",
13
+ "tags": [
14
+ "helper-modal"
15
+ ]
16
+ }
17
+ ],
11
18
  "bundles": []
12
19
  }
@@ -1,7 +1,6 @@
1
1
  import { Component, h, State, Prop, Event, Listen } from '@stencil/core';
2
2
  import { translate } from '../../utils/locale.utils';
3
- // import '@vaadin/date-picker';
4
- // import '@vaadin/vaadin-date-picker/vaadin-date-picker.js';
3
+ import '@vaadin/date-picker';
5
4
  import '@everymatrix/helper-modal';
6
5
  export class HelperFilters {
7
6
  constructor() {
@@ -99,7 +98,9 @@ export class HelperFilters {
99
98
  h("div", { class: "FilterModalBody" },
100
99
  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) }),
101
100
  h("p", null, translate('filterOrDate', this.language)),
102
- h("div", { class: "FilterCalendarWrapper" })),
101
+ h("div", { class: "FilterCalendarWrapper" },
102
+ h("vaadin-date-picker", { value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate('filterFromCalendar', this.language), class: "VaadinDatePicker" }),
103
+ h("vaadin-date-picker", { value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate('filterToCalendar', this.language), class: "VaadinDatePicker" }))),
103
104
  h("div", { class: "FilterModalFooter" },
104
105
  h("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));
105
106
  }
@@ -1,5 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import '@everymatrix/helper-modal';
2
+ import '@vaadin/date-picker';
3
+ import { d as defineCustomElement$2 } from './helper-modal2.js';
3
4
 
4
5
  const DEFAULT_LANGUAGE = 'en';
5
6
  const SUPPORTED_LANGUAGES = ['ro', 'en'];
@@ -127,7 +128,7 @@ const HelperFilters$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
127
128
  this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
128
129
  }
129
130
  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
+ 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("vaadin-date-picker", { value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h("vaadin-date-picker", { value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h("div", { class: "FilterModalFooter" }, h("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));
131
132
  }
132
133
  static get style() { return helperFiltersCss; }
133
134
  }, [1, "helper-filters", {
@@ -147,16 +148,20 @@ function defineCustomElement$1() {
147
148
  if (typeof customElements === "undefined") {
148
149
  return;
149
150
  }
150
- const components = ["helper-filters"];
151
+ const components = ["helper-filters", "helper-modal"];
151
152
  components.forEach(tagName => { switch (tagName) {
152
153
  case "helper-filters":
153
154
  if (!customElements.get(tagName)) {
154
155
  customElements.define(tagName, HelperFilters$1);
155
156
  }
156
157
  break;
158
+ case "helper-modal":
159
+ if (!customElements.get(tagName)) {
160
+ defineCustomElement$2();
161
+ }
162
+ break;
157
163
  } });
158
164
  }
159
- defineCustomElement$1();
160
165
 
161
166
  const HelperFilters = HelperFilters$1;
162
167
  const defineCustomElement = defineCustomElement$1;
@@ -0,0 +1,6 @@
1
+ import { H as HelperModal$1, d as defineCustomElement$1 } from './helper-modal2.js';
2
+
3
+ const HelperModal = HelperModal$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { HelperModal, defineCustomElement };
@@ -0,0 +1,58 @@
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 helperModalCss = ":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px #848e97;box-shadow:2px 2px 2px rgba(0, 0, 0, 0.007);font-size:14px;padding:10px 10px 5px 10px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:#FFF;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:#000}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:#000}";
17
+
18
+ const HelperModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
19
+ constructor() {
20
+ super();
21
+ this.__registerHost();
22
+ this.__attachShadow();
23
+ this.cancel = createEvent(this, "modalCloseEvent", 7);
24
+ /**
25
+ * Toggles if the helper is visible or not
26
+ */
27
+ this.visible = true;
28
+ this.userAgent = window.navigator.userAgent;
29
+ }
30
+ handleHelperModalClose() {
31
+ this.visible = false;
32
+ this.cancel.emit();
33
+ }
34
+ ;
35
+ render() {
36
+ return ((this.visible &&
37
+ h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper" }, h("div", { class: "HelperModalWrapper HelperModalVisible" }, h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') }, h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), h("slot", null))))));
38
+ }
39
+ static get style() { return helperModalCss; }
40
+ }, [1, "helper-modal", {
41
+ "titleModal": [1, "title-modal"],
42
+ "visible": [1540]
43
+ }]);
44
+ function defineCustomElement() {
45
+ if (typeof customElements === "undefined") {
46
+ return;
47
+ }
48
+ const components = ["helper-modal"];
49
+ components.forEach(tagName => { switch (tagName) {
50
+ case "helper-modal":
51
+ if (!customElements.get(tagName)) {
52
+ customElements.define(tagName, HelperModal);
53
+ }
54
+ break;
55
+ } });
56
+ }
57
+
58
+ export { HelperModal as H, defineCustomElement as d };
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-f5eea413.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-1b3528e3.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-filters",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]]], options);
16
+ return bootstrapLazy([["helper-filters_2",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]],[1,"helper-modal",{"titleModal":[1,"title-modal"],"visible":[1540]}]]]], options);
17
17
  });
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-f5eea413.js';
2
- import '@everymatrix/helper-modal';
1
+ import { r as registerInstance, c as createEvent, h } from './index-1b3528e3.js';
2
+ import '@vaadin/date-picker';
3
3
 
4
4
  const DEFAULT_LANGUAGE = 'en';
5
5
  const SUPPORTED_LANGUAGES = ['ro', 'en'];
@@ -125,9 +125,46 @@ const HelperFilters = class {
125
125
  this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
126
126
  }
127
127
  render() {
128
- 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))))));
128
+ 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("vaadin-date-picker", { value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h("vaadin-date-picker", { value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h("div", { class: "FilterModalFooter" }, h("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));
129
129
  }
130
130
  };
131
131
  HelperFilters.style = helperFiltersCss;
132
132
 
133
- export { HelperFilters as helper_filters };
133
+ /**
134
+ * @name isMobile
135
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
136
+ * @param {String} userAgent window.navigator.userAgent
137
+ * @returns {Boolean} true or false
138
+ */
139
+ const isMobile = (userAgent) => {
140
+ return !!(userAgent.toLowerCase().match(/android/i) ||
141
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
142
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
143
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
144
+ };
145
+
146
+ const helperModalCss = ":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px #848e97;box-shadow:2px 2px 2px rgba(0, 0, 0, 0.007);font-size:14px;padding:10px 10px 5px 10px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:#FFF;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:#000}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:#000}";
147
+
148
+ const HelperModal = class {
149
+ constructor(hostRef) {
150
+ registerInstance(this, hostRef);
151
+ this.cancel = createEvent(this, "modalCloseEvent", 7);
152
+ /**
153
+ * Toggles if the helper is visible or not
154
+ */
155
+ this.visible = true;
156
+ this.userAgent = window.navigator.userAgent;
157
+ }
158
+ handleHelperModalClose() {
159
+ this.visible = false;
160
+ this.cancel.emit();
161
+ }
162
+ ;
163
+ render() {
164
+ return ((this.visible &&
165
+ h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper" }, h("div", { class: "HelperModalWrapper HelperModalVisible" }, h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') }, h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), h("slot", null))))));
166
+ }
167
+ };
168
+ HelperModal.style = helperModalCss;
169
+
170
+ export { HelperFilters as helper_filters, HelperModal as helper_modal };
@@ -480,11 +480,14 @@ const patch = (oldVNode, newVNode) => {
480
480
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
481
481
  const oldChildren = oldVNode.$children$;
482
482
  const newChildren = newVNode.$children$;
483
+ const tag = newVNode.$tag$;
483
484
  const text = newVNode.$text$;
484
485
  if (text === null) {
485
486
  // element node
486
487
  {
487
- {
488
+ if (tag === 'slot')
489
+ ;
490
+ else {
488
491
  // either this is the first render of an element OR it's an update
489
492
  // AND we already know it's possible it could have changed
490
493
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -517,9 +520,14 @@ const patch = (oldVNode, newVNode) => {
517
520
  };
518
521
  const renderVdom = (hostRef, renderFnResults) => {
519
522
  const hostElm = hostRef.$hostElement$;
523
+ const cmpMeta = hostRef.$cmpMeta$;
520
524
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
521
525
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
522
526
  hostTagName = hostElm.tagName;
527
+ if (cmpMeta.$attrsToReflect$) {
528
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
529
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
530
+ }
523
531
  rootVnode.$tag$ = null;
524
532
  rootVnode.$flags$ |= 4 /* isHost */;
525
533
  hostRef.$vnode$ = rootVnode;
@@ -870,6 +878,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
870
878
  .map(([propName, m]) => {
871
879
  const attrName = m[1] || propName;
872
880
  attrNameToPropName.set(attrName, propName);
881
+ if (m[0] & 512 /* ReflectAttr */) {
882
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
883
+ }
873
884
  return attrName;
874
885
  });
875
886
  }
@@ -1030,6 +1041,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1030
1041
  {
1031
1042
  cmpMeta.$listeners$ = compactMeta[3];
1032
1043
  }
1044
+ {
1045
+ cmpMeta.$attrsToReflect$ = [];
1046
+ }
1033
1047
  const tagName = cmpMeta.$tagName$;
1034
1048
  const HostElement = class extends HTMLElement {
1035
1049
  // StencilLazyHost
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-f5eea413.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-1b3528e3.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-filters",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]]], options);
13
+ return bootstrapLazy([["helper-filters_2",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]],[1,"helper-modal",{"titleModal":[1,"title-modal"],"visible":[1540]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -1 +1 @@
1
- import{p as e,b as a}from"./p-645ae858.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((e=>a([["p-a9ea4855",[[1,"helper-filters",{showFilterId:[4,"show-filter-id"],activateTicketSearch:[4,"activate-ticket-search"],gameId:[1,"game-id"],playerId:[1,"player-id"],session:[1],postMessage:[4,"post-message"],language:[1],showFilterModal:[32],showClearButton:[32],filterData:[32],filterDataReset:[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]]],e)));
1
+ import{p as e,b as t}from"./p-2cd626f1.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-43dedb1d",[[1,"helper-filters",{showFilterId:[4,"show-filter-id"],activateTicketSearch:[4,"activate-ticket-search"],gameId:[1,"game-id"],playerId:[1,"player-id"],session:[1],postMessage:[4,"post-message"],language:[1],showFilterModal:[32],showClearButton:[32],filterData:[32],filterDataReset:[32]},[[0,"modalCloseEvent","modalCloseEvent"]]],[1,"helper-modal",{titleModal:[1,"title-modal"],visible:[1540]}]]]],e)));
@@ -0,0 +1 @@
1
+ let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=(e,t,n)=>{n&&n.map((([n,l,s])=>{const r=e,c=u(t,s),i=a(n);o.ael(r,l,c,i),(t.o=t.o||[]).push((()=>o.rel(r,l,c,i)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){G(e)}},a=e=>0!=(2&e),f=new WeakMap,h=e=>"sc-"+e.h,d={},$=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!$(l))&&(l+=""),s&&o?r[r.length-1].$+=l:r.push(s?m(null,l):l),o=s)};if(c(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=m(e,null);return i.m=t,r.length>0&&(i.p=r),i},m=(e,t)=>({t:0,S:e,$:t,g:null,p:null,m:null}),p={},b=(e,t,n,s,r,c)=>{if(n!==s){let i=B(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(i||"o"!==t[0]||"n"!==t[1]){const l=$(s);if((i||l&&null!==s)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&c||r)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):B(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},w=/\s/,S=e=>e?e.split(w):[],g=(e,t,n,l)=>{const s=11===t.g.nodeType&&t.g.host?t.g.host:t.g,o=e&&e.m||d,r=t.m||d;for(l in o)l in r||b(s,l,o[l],void 0,n,t.t);for(l in r)b(s,l,o[l],r[l],n,t.t)},j=(t,n,l)=>{let o,r,c=n.p[l],i=0;if(null!==c.$)o=c.g=s.createTextNode(c.$);else if(o=c.g=s.createElement(c.S),g(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.p)for(i=0;i<c.p.length;++i)r=j(t,c,i),r&&o.appendChild(r);return o},v=(e,n,l,s,o,r)=>{let c,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=j(null,l,o),c&&(s[o].g=c,i.insertBefore(c,n)))},M=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.g.remove()},k=(e,t)=>e.S===t.S,C=(e,t)=>{const n=t.g=e.g,l=e.p,s=t.p,o=t.$;null===o?("slot"===t.S||g(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,c=t.length-1,i=t[0],u=t[c],a=l.length-1,f=l[0],h=l[a];for(;o<=c&&r<=a;)null==i?i=t[++o]:null==u?u=t[--c]:null==f?f=l[++r]:null==h?h=l[--a]:k(i,f)?(C(i,f),i=t[++o],f=l[++r]):k(u,h)?(C(u,h),u=t[--c],h=l[--a]):k(i,h)?(C(i,h),e.insertBefore(i.g,u.g.nextSibling),i=t[++o],h=l[--a]):k(u,f)?(C(u,f),e.insertBefore(u.g,i.g),u=t[--c],f=l[++r]):(s=j(t&&t[r],n,r),f=l[++r],s&&i.g.parentNode.insertBefore(s,i.g));o>c?v(e,null==l[a+1]?null:l[a+1].g,n,l,r,a):r>a&&M(t,o,c)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.$!==o&&(n.data=o)},O=(e,t,n)=>{const l=(e=>V(e).j)(e);return{emit:e=>P(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},P=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},x=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},E=(e,t)=>{if(e.t|=16,!(4&e.t))return x(e,e.M),ne((()=>N(e,t)));e.t|=512},N=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>U(n,e,t))),e.u=null)),W(void 0,(()=>R(e,n,t)))},R=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.k,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=K.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=f.get(e=e.head||e);o||f.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);T(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>A(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},T=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.k,r=n.C||m(null,null),c=(e=>e&&e.S===p)(l)?l:y(null,null,l);t=s.tagName,o.O&&(c.m=c.m||{},o.O.map((([e,t])=>c.m[t]=s[e]))),c.S=null,c.t|=4,n.C=c,c.g=r.g=s.shadowRoot||s,e=s["s-sc"],C(r,c)})(n,l)}catch(e){G(e,n.j)}return null},A=e=>{const t=e.j,n=e.M;U(e.i,"componentDidRender"),64&e.t||(e.t|=64,q(t),e.P(t),n||L()),e.v&&(e.v(),e.v=void 0),512&e.t&&te((()=>E(e,!1))),e.t&=-517},L=()=>{q(s.documentElement),te((()=>P(l,"appload",{detail:{namespace:"helper-filters"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){G(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),q=e=>e.classList.add("hydrated"),D=(e,t,n)=>{if(t.N){const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>V(this).R.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=V(e),o=s.R.get(t),r=s.t,c=s.i;n=((e,t)=>null==e||$(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.N[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.R.set(t,n),c&&2==(18&r)&&E(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.O.push([e,s]),s}))}}return e},F=(e,t={})=>{const n=[],r=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let y,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],N:t[2],T:t[3]};l.N=t[2],l.T=t[3],l.O=[];const s=l.h,a=class extends HTMLElement{constructor(e){super(e),z(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=V(e),n=t.k,l=()=>{};if(1&t.t)i(e,t,n.T);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){x(t,t.M=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=J(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(D(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){G(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=h(n);if(!K.has(t)){const l=()=>{};((e,t,n)=>{let l=K.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,K.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,r=()=>E(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=V(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return V(this).A}};l.L=e[0],r.includes(s)||u.get(s)||(n.push(s),u.define(s,D(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>y=setTimeout(L,30)))},H=new WeakMap,V=e=>H.get(e),_=(e,t)=>H.set(t.i=e,t),z=(e,t)=>{const n={t:0,j:e,k:t,R:new Map};return n.A=new Promise((e=>n.P=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.T),H.set(e,n)},B=(e,t)=>t in e,G=(e,t)=>(0,console.error)(e,t),I=new Map,J=e=>{const t=e.h.replace(/-/g,"_"),n=e.L,l=I.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(I.set(n,e),e[t])),G)},K=new Map,Q=[],X=[],Y=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?te(ee):o.raf(ee))},Z=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){G(e)}e.length=0},ee=()=>{Z(Q),Z(X),(n=Q.length>0)&&o.raf(ee)},te=e=>r().then(e),ne=Y(X,!0);export{F as b,O as c,y as h,r as p,_ as r}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as r}from"./p-2cd626f1.js";import"@vaadin/date-picker";const l=["ro","en"],i={en:{filterOpen:"Filter",filterClear:"Clear",filterModalTicketTitle:"Ticket Results",filterModalDrawTitle:"Draws Results History",filterTicketPlaceholder:"Search for a ticket ID",filterDrawPlaceholder:"Search for a draw ID",filterDateRangePlaceholder:"Date Range",filterModalButton:"Search",filterFromCalendar:"From",filterToCalendar:"To",filterOrDate:"or search by date"},ro:{filterOpen:"Filtrare",filterClear:"Stergere",filterModalTicketTitle:"Rezultatele biletelor",filterModalDrawTitle:"Rezultatele draw-urilor",filterTicketPlaceholder:"Cauta ID bilet",filterDrawPlaceholder:"Cauta ID draw",filterDateRangePlaceholder:"Perioada",filterModalButton:"Cauta",filterOrDate:"sau cauta dupa data"}},a=(e,t)=>{const r=t;return i[void 0!==r&&l.includes(r)?r:"en"][e]},o=class{constructor(r){e(this,r),this.filterDraw=t(this,"filterDraw",7),this.filterSelection=t(this,"filterSelection",7),this.filterSelectionReset=t(this,"filterSelectionReset",7),this.showFilterId=!0,this.activateTicketSearch=!1,this.gameId="",this.playerId="",this.session="",this.postMessage=!1,this.language="en",this.showFilterModal=!1,this.showClearButton=!1,this.filterData={},this.filterDataReset={ticketDrawId:"",filterFromCalendar:"",filterToCalendar:""}}componentDidRender(){this.filterData.ticketDrawId=null,this.filterData.filterFromCalendar=null,this.filterData.filterToCalendar=null,document.getElementById("#FilterById")&&(document.getElementById("#FilterById").value="")}filterSelectionHandler(e){this.postMessage&&window.postMessage({type:"filterSelection",event:e},window.location.href),this.filterData.ticketDrawId&&this.filterDraw.emit(e),(this.filterData.filterFromCalendar||this.filterData.filterToCalendar)&&this.filterSelection.emit(e)}filterSelectionResetHandler(e){this.postMessage&&window.postMessage({type:"filterSelectionReset",event:e},window.location.href),this.filterSelectionReset.emit(e)}modalCloseEvent(){this.showFilterModal=!1}toggleFilterModal(){this.showFilterModal=!0}filterSearch(){this.modalCloseEvent(),this.showClearButton=!0,this.filterSelectionHandler(this.filterData)}resetSearch(){this.showClearButton=!1,this.filterSelectionResetHandler(this.filterDataReset),this.filterData={}}handleTicketDrawId(e){this.filterData.ticketDrawId=e.target.value}handleFilterFrom(e){this.filterData.filterFromCalendar=new Date(e.target.value).toISOString()}handleFilterTo(e){this.filterData.filterToCalendar=new Date(e.target.value).toISOString()}render(){return r("div",{class:"HelperFilters"},r("div",{class:"FilterButtonsWrapper"},r("button",{class:"FilterOpen",onClick:()=>this.toggleFilterModal()},a("filterOpen",this.language)),this.showClearButton?r("button",{class:"FilterClear",onClick:()=>this.resetSearch()},a("filterClear",this.language)):null),r("helper-modal",{"title-modal":"Filter Modal",visible:this.showFilterModal},r("div",{class:"FilterModalHeader"},r("h3",{class:"FilterModalTitle"},a(this.activateTicketSearch?"filterModalTicketTitle":"filterModalDrawTitle",this.language))),r("div",{class:"FilterModalBody"},r("input",{id:"FilterById",type:"text",value:this.filterData.ticketDrawId,onInput:e=>this.handleTicketDrawId(e),class:"FilterModalSearch",placeholder:a(this.activateTicketSearch?"filterTicketPlaceholder":"filterDrawPlaceholder",this.language)}),r("p",null,a("filterOrDate",this.language)),r("div",{class:"FilterCalendarWrapper"},r("vaadin-date-picker",{value:this.filterData.filterFromCalendar,onChange:e=>this.handleFilterFrom(e),placeholder:a("filterFromCalendar",this.language),class:"VaadinDatePicker"}),r("vaadin-date-picker",{value:this.filterData.filterToCalendar,onChange:e=>this.handleFilterTo(e),placeholder:a("filterToCalendar",this.language),class:"VaadinDatePicker"}))),r("div",{class:"FilterModalFooter"},r("button",{class:"FilterModalButton",onClick:()=>this.filterSearch()},a("filterModalButton",this.language)))))}};o.style='@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}';const s=e=>!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),d=class{constructor(r){e(this,r),this.cancel=t(this,"modalCloseEvent",7),this.visible=!0,this.userAgent=window.navigator.userAgent}handleHelperModalClose(){this.visible=!1,this.cancel.emit()}render(){return this.visible&&r("div",{class:this.visible?"HelperModalWrapper HelperModalVisible":"HelperModalWrapper"},r("div",{class:"HelperModalWrapper HelperModalVisible"},r("div",{class:"HelperModalContent"+(s(this.userAgent)?" HelperModalMobileContent":"")},r("span",{class:"HelperModalClose"+(s(this.userAgent)?" HelperModalMobileClose":""),onClick:this.handleHelperModalClose.bind(this)},"X"),r("slot",null))))}};d.style=":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px #848e97;box-shadow:2px 2px 2px rgba(0, 0, 0, 0.007);font-size:14px;padding:10px 10px 5px 10px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:#FFF;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:#000}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:#000}";export{o as helper_filters,d as helper_modal}
@@ -9,8 +9,6 @@ export const config = {
9
9
  esmLoaderPath: '../loader',
10
10
  },
11
11
  {
12
- autoDefineCustomElements: true,
13
- generateTypeDeclarations: true,
14
12
  type: 'dist-custom-elements',
15
13
  },
16
14
  {
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ import '@vaadin/date-picker';
2
3
  import '@everymatrix/helper-modal';
3
4
  export declare class HelperFilters {
4
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/helper-filters",
3
- "version": "0.1.3",
3
+ "version": "0.1.7",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -15,5 +15,8 @@
15
15
  ],
16
16
  "publishConfig": {
17
17
  "access": "public"
18
+ },
19
+ "dependencies": {
20
+ "@vaadin/date-picker": "^23.1.5"
18
21
  }
19
22
  }
@@ -1 +0,0 @@
1
- let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=(e,t,n)=>{n&&n.map((([n,l,s])=>{const r=e,c=u(t,s),i=a(n);o.ael(r,l,c,i),(t.o=t.o||[]).push((()=>o.rel(r,l,c,i)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){G(e)}},a=e=>0!=(2&e),f=new WeakMap,h=e=>"sc-"+e.h,d={},$=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!$(l))&&(l+=""),s&&o?r[r.length-1].$+=l:r.push(s?m(null,l):l),o=s)};if(c(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=m(e,null);return i.m=t,r.length>0&&(i.p=r),i},m=(e,t)=>({t:0,S:e,$:t,g:null,p:null,m:null}),p={},b=(e,t,n,s,r,c)=>{if(n!==s){let i=B(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(i||"o"!==t[0]||"n"!==t[1]){const l=$(s);if((i||l&&null!==s)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&c||r)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):B(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},w=/\s/,S=e=>e?e.split(w):[],g=(e,t,n,l)=>{const s=11===t.g.nodeType&&t.g.host?t.g.host:t.g,o=e&&e.m||d,r=t.m||d;for(l in o)l in r||b(s,l,o[l],void 0,n,t.t);for(l in r)b(s,l,o[l],r[l],n,t.t)},j=(t,n,l)=>{let o,r,c=n.p[l],i=0;if(null!==c.$)o=c.g=s.createTextNode(c.$);else if(o=c.g=s.createElement(c.S),g(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.p)for(i=0;i<c.p.length;++i)r=j(t,c,i),r&&o.appendChild(r);return o},v=(e,n,l,s,o,r)=>{let c,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=j(null,l,o),c&&(s[o].g=c,i.insertBefore(c,n)))},M=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.g.remove()},k=(e,t)=>e.S===t.S,C=(e,t)=>{const n=t.g=e.g,l=e.p,s=t.p,o=t.$;null===o?(g(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,c=t.length-1,i=t[0],u=t[c],a=l.length-1,f=l[0],h=l[a];for(;o<=c&&r<=a;)null==i?i=t[++o]:null==u?u=t[--c]:null==f?f=l[++r]:null==h?h=l[--a]:k(i,f)?(C(i,f),i=t[++o],f=l[++r]):k(u,h)?(C(u,h),u=t[--c],h=l[--a]):k(i,h)?(C(i,h),e.insertBefore(i.g,u.g.nextSibling),i=t[++o],h=l[--a]):k(u,f)?(C(u,f),e.insertBefore(u.g,i.g),u=t[--c],f=l[++r]):(s=j(t&&t[r],n,r),f=l[++r],s&&i.g.parentNode.insertBefore(s,i.g));o>c?v(e,null==l[a+1]?null:l[a+1].g,n,l,r,a):r>a&&M(t,o,c)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.$!==o&&(n.data=o)},O=(e,t,n)=>{const l=(e=>V(e).j)(e);return{emit:e=>P(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},P=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},x=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},E=(e,t)=>{if(e.t|=16,!(4&e.t))return x(e,e.M),ne((()=>N(e,t)));e.t|=512},N=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>U(n,e,t))),e.u=null)),W(void 0,(()=>R(e,n,t)))},R=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.k,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=K.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=f.get(e=e.head||e);o||f.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);T(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>A(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},T=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C||m(null,null),r=(e=>e&&e.S===p)(l)?l:y(null,null,l);t=s.tagName,r.S=null,r.t|=4,n.C=r,r.g=o.g=s.shadowRoot||s,e=s["s-sc"],C(o,r)})(n,l)}catch(e){G(e,n.j)}return null},A=e=>{const t=e.j,n=e.M;U(e.i,"componentDidRender"),64&e.t||(e.t|=64,q(t),e.O(t),n||L()),e.v&&(e.v(),e.v=void 0),512&e.t&&te((()=>E(e,!1))),e.t&=-517},L=()=>{q(s.documentElement),te((()=>P(l,"appload",{detail:{namespace:"helper-filters"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){G(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),q=e=>e.classList.add("hydrated"),D=(e,t,n)=>{if(t.P){const l=Object.entries(t.P),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>V(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=V(e),o=s.N.get(t),r=s.t,c=s.i;n=((e,t)=>null==e||$(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.P[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.N.set(t,n),c&&2==(18&r)&&E(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},F=(e,t={})=>{const n=[],r=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let y,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],P:t[2],R:t[3]};l.P=t[2],l.R=t[3];const s=l.h,a=class extends HTMLElement{constructor(e){super(e),z(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=V(e),n=t.k,l=()=>{};if(1&t.t)i(e,t,n.R);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){x(t,t.M=n);break}}n.P&&Object.entries(n.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=J(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(D(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){G(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=h(n);if(!K.has(t)){const l=()=>{};((e,t,n)=>{let l=K.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,K.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,r=()=>E(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=V(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return V(this).T}};l.A=e[0],r.includes(s)||u.get(s)||(n.push(s),u.define(s,D(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>y=setTimeout(L,30)))},H=new WeakMap,V=e=>H.get(e),_=(e,t)=>H.set(t.i=e,t),z=(e,t)=>{const n={t:0,j:e,k:t,N:new Map};return n.T=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.R),H.set(e,n)},B=(e,t)=>t in e,G=(e,t)=>(0,console.error)(e,t),I=new Map,J=e=>{const t=e.h.replace(/-/g,"_"),n=e.A,l=I.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(I.set(n,e),e[t])),G)},K=new Map,Q=[],X=[],Y=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?te(ee):o.raf(ee))},Z=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){G(e)}e.length=0},ee=()=>{Z(Q),Z(X),(n=Q.length>0)&&o.raf(ee)},te=e=>r().then(e),ne=Y(X,!0);export{F as b,O as c,y as h,r as p,_ as r}
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as r}from"./p-645ae858.js";import"@everymatrix/helper-modal";const l=["ro","en"],i={en:{filterOpen:"Filter",filterClear:"Clear",filterModalTicketTitle:"Ticket Results",filterModalDrawTitle:"Draws Results History",filterTicketPlaceholder:"Search for a ticket ID",filterDrawPlaceholder:"Search for a draw ID",filterDateRangePlaceholder:"Date Range",filterModalButton:"Search",filterFromCalendar:"From",filterToCalendar:"To",filterOrDate:"or search by date"},ro:{filterOpen:"Filtrare",filterClear:"Stergere",filterModalTicketTitle:"Rezultatele biletelor",filterModalDrawTitle:"Rezultatele draw-urilor",filterTicketPlaceholder:"Cauta ID bilet",filterDrawPlaceholder:"Cauta ID draw",filterDateRangePlaceholder:"Perioada",filterModalButton:"Cauta",filterOrDate:"sau cauta dupa data"}},a=(e,t)=>{const r=t;return i[void 0!==r&&l.includes(r)?r:"en"][e]},o=class{constructor(r){e(this,r),this.filterDraw=t(this,"filterDraw",7),this.filterSelection=t(this,"filterSelection",7),this.filterSelectionReset=t(this,"filterSelectionReset",7),this.showFilterId=!0,this.activateTicketSearch=!1,this.gameId="",this.playerId="",this.session="",this.postMessage=!1,this.language="en",this.showFilterModal=!1,this.showClearButton=!1,this.filterData={},this.filterDataReset={ticketDrawId:"",filterFromCalendar:"",filterToCalendar:""}}componentDidRender(){this.filterData.ticketDrawId=null,this.filterData.filterFromCalendar=null,this.filterData.filterToCalendar=null,document.getElementById("#FilterById")&&(document.getElementById("#FilterById").value="")}filterSelectionHandler(e){this.postMessage&&window.postMessage({type:"filterSelection",event:e},window.location.href),this.filterData.ticketDrawId&&this.filterDraw.emit(e),(this.filterData.filterFromCalendar||this.filterData.filterToCalendar)&&this.filterSelection.emit(e)}filterSelectionResetHandler(e){this.postMessage&&window.postMessage({type:"filterSelectionReset",event:e},window.location.href),this.filterSelectionReset.emit(e)}modalCloseEvent(){this.showFilterModal=!1}toggleFilterModal(){this.showFilterModal=!0}filterSearch(){this.modalCloseEvent(),this.showClearButton=!0,this.filterSelectionHandler(this.filterData)}resetSearch(){this.showClearButton=!1,this.filterSelectionResetHandler(this.filterDataReset),this.filterData={}}handleTicketDrawId(e){this.filterData.ticketDrawId=e.target.value}handleFilterFrom(e){this.filterData.filterFromCalendar=new Date(e.target.value).toISOString()}handleFilterTo(e){this.filterData.filterToCalendar=new Date(e.target.value).toISOString()}render(){return r("div",{class:"HelperFilters"},r("div",{class:"FilterButtonsWrapper"},r("button",{class:"FilterOpen",onClick:()=>this.toggleFilterModal()},a("filterOpen",this.language)),this.showClearButton?r("button",{class:"FilterClear",onClick:()=>this.resetSearch()},a("filterClear",this.language)):null),r("helper-modal",{"title-modal":"Filter Modal",visible:this.showFilterModal},r("div",{class:"FilterModalHeader"},r("h3",{class:"FilterModalTitle"},a(this.activateTicketSearch?"filterModalTicketTitle":"filterModalDrawTitle",this.language))),r("div",{class:"FilterModalBody"},r("input",{id:"FilterById",type:"text",value:this.filterData.ticketDrawId,onInput:e=>this.handleTicketDrawId(e),class:"FilterModalSearch",placeholder:a(this.activateTicketSearch?"filterTicketPlaceholder":"filterDrawPlaceholder",this.language)}),r("p",null,a("filterOrDate",this.language)),r("div",{class:"FilterCalendarWrapper"})),r("div",{class:"FilterModalFooter"},r("button",{class:"FilterModalButton",onClick:()=>this.filterSearch()},a("filterModalButton",this.language)))))}};o.style='@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}';export{o as helper_filters}