@everymatrix/helper-filters 1.52.6 → 1.53.10

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.
@@ -4,33 +4,77 @@ import "@vaadin/date-picker";
4
4
  import "../../../../../helper-modal/dist/types/index";
5
5
  export class HelperFilters {
6
6
  constructor() {
7
- this.setClientStyling = () => {
8
- let sheet = document.createElement('style');
9
- sheet.innerHTML = this.clientStyling;
10
- this.stylingContainer.prepend(sheet);
11
- };
12
- this.setClientStylingURL = () => {
13
- let cssFile = document.createElement('style');
14
- setTimeout(() => {
15
- cssFile.innerHTML = this.clientStylingUrlContent;
16
- this.stylingContainer.prepend(cssFile);
17
- }, 1);
18
- };
7
+ /**
8
+ * Check if show the filter option by id
9
+ */
19
10
  this.showFilterId = true;
11
+ /**
12
+ * Choose if filter by draw ID or ticket ID. By default is draw ID.
13
+ */
20
14
  this.activateTicketSearch = false;
15
+ /**
16
+ * Game ID
17
+ */
21
18
  this.gameId = '';
19
+ /**
20
+ * Player ID
21
+ */
22
22
  this.playerId = '';
23
+ /**
24
+ * Session ID
25
+ */
23
26
  this.session = '';
27
+ /**
28
+ * Instead of customEvents the widget triggers postMessages
29
+ */
24
30
  this.postMessage = false;
31
+ /**
32
+ * Language
33
+ */
25
34
  this.language = 'en';
35
+ /**
36
+ * Notifies if the quick filters from tickets are active
37
+ */
26
38
  this.quickFiltersActive = false;
39
+ /**
40
+ * Client custom styling via string
41
+ */
27
42
  this.clientStyling = '';
43
+ /**
44
+ * Client custom styling via url content
45
+ */
28
46
  this.clientStylingUrlContent = '';
29
47
  this.showFilterModal = false;
30
48
  this.showClearButton = false;
31
49
  this.filterData = {};
32
50
  this.filterDataReset = { ticketDrawId: '', filterFromCalendar: '', filterToCalendar: '' };
33
51
  this.limitStylingAppends = false;
52
+ this.handleTicketDrawId = (event) => {
53
+ const inputElement = event.target;
54
+ this.filterData.ticketDrawId = inputElement.value;
55
+ };
56
+ this.handleFilterFrom = (event) => {
57
+ const inputElement = event.target;
58
+ let dateArray = inputElement.value.split('-');
59
+ this.filterData.filterFromCalendar = new Date(Number(dateArray[0]), Number(dateArray[1]) - 1, Number(dateArray[2]), 0, 0, 0).toISOString();
60
+ };
61
+ this.handleFilterTo = (event) => {
62
+ const inputElement = event.target;
63
+ let dateArray = inputElement.value.split('-');
64
+ this.filterData.filterToCalendar = new Date(Number(dateArray[0]), Number(dateArray[1]) - 1, Number(dateArray[2]), 23, 59, 59).toISOString();
65
+ };
66
+ this.setClientStyling = () => {
67
+ let sheet = document.createElement('style');
68
+ sheet.innerHTML = this.clientStyling;
69
+ this.stylingContainer.prepend(sheet);
70
+ };
71
+ this.setClientStylingURL = () => {
72
+ let cssFile = document.createElement('style');
73
+ setTimeout(() => {
74
+ cssFile.innerHTML = this.clientStylingUrlContent;
75
+ this.stylingContainer.prepend(cssFile);
76
+ }, 1);
77
+ };
34
78
  }
35
79
  // reset field values each time the filter modal opens
36
80
  componentDidRender() {
@@ -70,27 +114,17 @@ export class HelperFilters {
70
114
  this.modalCloseEvent();
71
115
  this.showClearButton = true;
72
116
  this.filterSelectionHandler(this.filterData);
73
- console.log(this.showClearButton);
74
117
  }
75
118
  resetSearch() {
76
119
  this.showClearButton = false;
77
120
  this.filterSelectionResetHandler(this.filterDataReset);
78
121
  this.filterData = {};
79
122
  }
80
- handleTicketDrawId(event) {
81
- this.filterData.ticketDrawId = event.target.value;
82
- }
83
- handleFilterFrom(event) {
84
- this.filterData.filterFromCalendar = new Date(event.target.value).toISOString();
85
- }
86
- handleFilterTo(event) {
87
- this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
88
- }
89
123
  render() {
90
- return (h("div", { key: 'd74774bd58fa3df6b0038fd979fb4aec4262d43d', class: "HelperFilters", ref: el => this.stylingContainer = el }, h("div", { key: '0827128924ba350888ae81e67e0306e536b15047', class: "FilterButtonsWrapper" }, h("button", { key: '73ae5aff5896195cd895410caf44dccfa1ac5cfc', class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate('filterOpen', this.language)), console.log('in filter Open', this.showClearButton, this.quickFiltersActive), (this.showClearButton || this.quickFiltersActive) ?
124
+ return (h("div", { key: '285e81fe3f4ba59c4a17445e8a296408a21ac15c', class: "HelperFilters", ref: el => this.stylingContainer = el }, h("div", { key: 'e1839ec68ae9f4d54a97b7e0bc81fd5bd9c6b924', class: "FilterButtonsWrapper" }, h("button", { key: '5b6b2402dad6d7c1c315ffd5a2e251e898c8db5b', class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate('filterOpen', this.language)), (this.showClearButton || this.quickFiltersActive) ?
91
125
  h("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate('filterClear', this.language))
92
126
  :
93
- null), h("helper-modal", { key: 'add83df2714fdb69e8dfa7a0f5d1eb0d526fc2b4', "title-modal": "Filter Modal", visible: this.showFilterModal, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { key: '861b04161876b557184fe49c514867788147e4b9', class: "FilterModalHeader" }, h("h3", { key: '7471430912f301ff995c401b08298d9006816216', class: "FilterModalTitle" }, this.activateTicketSearch ? translate('filterModalTicketTitle', this.language) : translate('filterModalDrawTitle', this.language))), h("div", { key: 'af6bd8e253f332c8724e1bb40100ba5e1e59838f', class: "FilterModalBody" }, h("input", { key: '9edc7e14b801d40d4861625264f82b2fa213a770', 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", { key: '9665b359f9d6da19f120eb9bb315c4b144c80ced' }, translate('filterOrDate', this.language)), h("div", { key: 'd155c7d73a719aaedc581f51aa97cf21ec3125df', class: "FilterCalendarWrapper" }, h("vaadin-date-picker", { key: '586fb38bc5c718a4afa06ebec96bec0fd46949eb', value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h("vaadin-date-picker", { key: '42e8965b2c740c19c53687c114faf6aa22f11de8', value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h("div", { key: '7529eef1b25d130d183a55e45862418444054d3c', class: "FilterModalFooter" }, h("button", { key: '7dac7dc7b01c1c66dde7c6670a352f597b3f75fc', class: "FilterModalButton", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));
127
+ null), h("helper-modal", { key: 'c60e5024e590e3c2217c4d2698f86a5b6d33562a', "title-modal": "Filter Modal", visible: this.showFilterModal, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { key: 'd0fcf27d381016db6c6460973cefbb28187cbd01', class: "FilterModalHeader" }, h("h3", { key: 'ab73abba95ea9654c902db1f4650b7bc004c62c5', class: "FilterModalTitle" }, this.activateTicketSearch ? translate('filterModalTicketTitle', this.language) : translate('filterModalDrawTitle', this.language))), h("div", { key: '13dff7787135e8e35dadfb23b1acdf9ea11a995b', class: "FilterModalBody" }, this.showFilterId && h("div", { key: '6c773a1b5a5af00c6c2c69aaa24c2f2fa766356a' }, h("input", { key: 'f6ba11c2abaa1977358f08a923db1b7c12290ef1', id: "FilterById", type: "text", value: this.filterData.ticketDrawId, onInput: this.handleTicketDrawId, class: "FilterModalSearch", placeholder: this.activateTicketSearch ? translate('filterTicketPlaceholder', this.language) : translate('filterDrawPlaceholder', this.language) }), h("p", { key: '39fd8bfc2422a227cf118672213b0499298c73bc' }, translate('filterOrDate', this.language))), h("div", { key: 'f86cf8390870b64ed646c94c312198a21f99f565', class: "FilterCalendarWrapper" }, h("vaadin-date-picker", { key: 'cddc64eda6025e2a3568f86e0e039ded55530ab1', value: this.filterData.filterFromCalendar, onChange: this.handleFilterFrom, placeholder: translate('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h("vaadin-date-picker", { key: '0963561d635097452964f55bccf5182cde88e0c2', value: this.filterData.filterToCalendar, onChange: this.handleFilterTo, placeholder: translate('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h("div", { key: '5f880497e96ba7e55fb1f46b073d8b6259feded5', class: "FilterModalFooter" }, h("button", { key: '64cb6b50666e8a9879e3fc10df8ab36315357cef', class: "FilterModalButton", onClick: () => this.filterSearch() }, translate('filterModalButton', this.language))))));
94
128
  }
95
129
  static get is() { return "helper-filters"; }
96
130
  static get encapsulation() { return "shadow"; }
@@ -120,6 +154,8 @@ export class HelperFilters {
120
154
  "tags": [],
121
155
  "text": "Check if show the filter option by id"
122
156
  },
157
+ "getter": false,
158
+ "setter": false,
123
159
  "attribute": "show-filter-id",
124
160
  "reflect": true,
125
161
  "defaultValue": "true"
@@ -138,6 +174,8 @@ export class HelperFilters {
138
174
  "tags": [],
139
175
  "text": "Choose if filter by draw ID or ticket ID. By default is draw ID."
140
176
  },
177
+ "getter": false,
178
+ "setter": false,
141
179
  "attribute": "activate-ticket-search",
142
180
  "reflect": true,
143
181
  "defaultValue": "false"
@@ -156,6 +194,8 @@ export class HelperFilters {
156
194
  "tags": [],
157
195
  "text": "Game ID"
158
196
  },
197
+ "getter": false,
198
+ "setter": false,
159
199
  "attribute": "game-id",
160
200
  "reflect": true,
161
201
  "defaultValue": "''"
@@ -174,6 +214,8 @@ export class HelperFilters {
174
214
  "tags": [],
175
215
  "text": "Player ID"
176
216
  },
217
+ "getter": false,
218
+ "setter": false,
177
219
  "attribute": "player-id",
178
220
  "reflect": true,
179
221
  "defaultValue": "''"
@@ -192,6 +234,8 @@ export class HelperFilters {
192
234
  "tags": [],
193
235
  "text": "Session ID"
194
236
  },
237
+ "getter": false,
238
+ "setter": false,
195
239
  "attribute": "session",
196
240
  "reflect": true,
197
241
  "defaultValue": "''"
@@ -210,6 +254,8 @@ export class HelperFilters {
210
254
  "tags": [],
211
255
  "text": "Instead of customEvents the widget triggers postMessages"
212
256
  },
257
+ "getter": false,
258
+ "setter": false,
213
259
  "attribute": "post-message",
214
260
  "reflect": true,
215
261
  "defaultValue": "false"
@@ -228,6 +274,8 @@ export class HelperFilters {
228
274
  "tags": [],
229
275
  "text": "Language"
230
276
  },
277
+ "getter": false,
278
+ "setter": false,
231
279
  "attribute": "language",
232
280
  "reflect": true,
233
281
  "defaultValue": "'en'"
@@ -246,6 +294,8 @@ export class HelperFilters {
246
294
  "tags": [],
247
295
  "text": "Notifies if the quick filters from tickets are active"
248
296
  },
297
+ "getter": false,
298
+ "setter": false,
249
299
  "attribute": "quick-filters-active",
250
300
  "reflect": true,
251
301
  "defaultValue": "false"
@@ -264,6 +314,8 @@ export class HelperFilters {
264
314
  "tags": [],
265
315
  "text": "Client custom styling via string"
266
316
  },
317
+ "getter": false,
318
+ "setter": false,
267
319
  "attribute": "client-styling",
268
320
  "reflect": true,
269
321
  "defaultValue": "''"
@@ -282,6 +334,8 @@ export class HelperFilters {
282
334
  "tags": [],
283
335
  "text": "Client custom styling via url content"
284
336
  },
337
+ "getter": false,
338
+ "setter": false,
285
339
  "attribute": "client-styling-url-content",
286
340
  "reflect": true,
287
341
  "defaultValue": "''"
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-65288f86.js';
2
- export { s as setNonce } from './index-65288f86.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-82b8e4db.js';
2
+ export { s as setNonce } from './index-82b8e4db.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.25.1 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var patchBrowser = () => {
9
9
  const importMeta = import.meta.url;