@everymatrix/lottery-game-page 1.44.0 → 1.45.2

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.
Files changed (194) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/{helper-filters_2.cjs.entry.js → helper-accordion_13.cjs.entry.js} +3329 -1000
  3. package/dist/cjs/helper-pagination.cjs.entry.js +195 -226
  4. package/dist/cjs/index-f3851683.js +1345 -0
  5. package/dist/cjs/index.cjs.js +0 -2
  6. package/dist/cjs/loader.cjs.js +7 -15
  7. package/dist/cjs/lottery-game-page.cjs.js +16 -12
  8. package/dist/collection/collection-manifest.json +4 -10
  9. package/dist/collection/components/lottery-game-page/index.js +1 -0
  10. package/dist/collection/components/lottery-game-page/lottery-game-page.css +1 -1
  11. package/dist/collection/components/lottery-game-page/lottery-game-page.js +580 -646
  12. package/dist/collection/index.js +0 -1
  13. package/dist/collection/utils/locale.utils.js +117 -118
  14. package/dist/collection/utils/utils.js +4 -5
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/{helper-filters_2.entry.js → helper-accordion_13.entry.js} +3319 -1001
  17. package/dist/esm/helper-pagination.entry.js +195 -226
  18. package/dist/esm/index-8248702b.js +1316 -0
  19. package/dist/esm/index.js +0 -2
  20. package/dist/esm/loader.js +8 -16
  21. package/dist/esm/lottery-game-page.js +14 -13
  22. package/dist/lottery-game-page/index.esm.js +0 -2
  23. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -2
  24. package/dist/lottery-game-page/p-4254ae78.entry.js +3567 -0
  25. package/dist/lottery-game-page/p-89956c67.entry.js +1 -0
  26. package/dist/lottery-game-page/p-8f2c63c7.js +2 -0
  27. package/dist/lottery-game-page/p-e1255160.js +1 -0
  28. package/dist/stencil.config.dev.js +17 -0
  29. package/dist/stencil.config.js +12 -45
  30. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.d.ts +2 -0
  31. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.dev.d.ts +2 -0
  32. package/dist/types/components/lottery-game-page/index.d.ts +1 -0
  33. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +98 -98
  34. package/dist/types/components.d.ts +18 -2
  35. package/dist/types/stencil-public-runtime.d.ts +142 -33
  36. package/loader/cdn.js +1 -3
  37. package/loader/index.cjs.js +1 -3
  38. package/loader/index.d.ts +13 -1
  39. package/loader/index.es2017.js +1 -3
  40. package/loader/index.js +1 -3
  41. package/loader/package.json +1 -0
  42. package/package.json +13 -7
  43. package/dist/assets/chrono_desktop.png +0 -0
  44. package/dist/assets/chrono_lottery_mobile.png +0 -0
  45. package/dist/cjs/helper-accordion.cjs.entry.js +0 -134
  46. package/dist/cjs/helper-accordion.cjs.entry.js.map +0 -1
  47. package/dist/cjs/helper-filters_2.cjs.entry.js.map +0 -1
  48. package/dist/cjs/helper-modal.cjs.entry.js +0 -78
  49. package/dist/cjs/helper-modal.cjs.entry.js.map +0 -1
  50. package/dist/cjs/helper-pagination.cjs.entry.js.map +0 -1
  51. package/dist/cjs/helper-tab.cjs.entry.js +0 -70
  52. package/dist/cjs/helper-tab.cjs.entry.js.map +0 -1
  53. package/dist/cjs/helper-tabs.cjs.entry.js +0 -76
  54. package/dist/cjs/helper-tabs.cjs.entry.js.map +0 -1
  55. package/dist/cjs/index-cd44e726.js +0 -1326
  56. package/dist/cjs/index-cd44e726.js.map +0 -1
  57. package/dist/cjs/index.cjs.js.map +0 -1
  58. package/dist/cjs/loader.cjs.js.map +0 -1
  59. package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -281
  60. package/dist/cjs/lottery-bullet_2.cjs.entry.js.map +0 -1
  61. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -240
  62. package/dist/cjs/lottery-draw-results-history.cjs.entry.js.map +0 -1
  63. package/dist/cjs/lottery-game-details.cjs.entry.js +0 -53
  64. package/dist/cjs/lottery-game-details.cjs.entry.js.map +0 -1
  65. package/dist/cjs/lottery-game-page.cjs.entry.js +0 -456
  66. package/dist/cjs/lottery-game-page.cjs.entry.js.map +0 -1
  67. package/dist/cjs/lottery-game-page.cjs.js.map +0 -1
  68. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -132
  69. package/dist/cjs/lottery-ticket-controller.cjs.entry.js.map +0 -1
  70. package/dist/cjs/lottery-ticket.cjs.entry.js +0 -233
  71. package/dist/cjs/lottery-ticket.cjs.entry.js.map +0 -1
  72. package/dist/collection/components/lottery-game-page/lottery-game-page.js.map +0 -1
  73. package/dist/collection/index.js.map +0 -1
  74. package/dist/collection/utils/locale.utils.js.map +0 -1
  75. package/dist/collection/utils/utils.js.map +0 -1
  76. package/dist/components/helper-accordion.js +0 -8
  77. package/dist/components/helper-accordion.js.map +0 -1
  78. package/dist/components/helper-accordion2.js +0 -161
  79. package/dist/components/helper-accordion2.js.map +0 -1
  80. package/dist/components/helper-filters.js +0 -8
  81. package/dist/components/helper-filters.js.map +0 -1
  82. package/dist/components/helper-filters2.js +0 -23566
  83. package/dist/components/helper-filters2.js.map +0 -1
  84. package/dist/components/helper-modal.js +0 -8
  85. package/dist/components/helper-modal.js.map +0 -1
  86. package/dist/components/helper-modal2.js +0 -96
  87. package/dist/components/helper-modal2.js.map +0 -1
  88. package/dist/components/helper-pagination.js +0 -293
  89. package/dist/components/helper-pagination.js.map +0 -1
  90. package/dist/components/helper-tab.js +0 -8
  91. package/dist/components/helper-tab.js.map +0 -1
  92. package/dist/components/helper-tab2.js +0 -89
  93. package/dist/components/helper-tab2.js.map +0 -1
  94. package/dist/components/helper-tabs.js +0 -8
  95. package/dist/components/helper-tabs.js.map +0 -1
  96. package/dist/components/helper-tabs2.js +0 -105
  97. package/dist/components/helper-tabs2.js.map +0 -1
  98. package/dist/components/index.d.ts +0 -26
  99. package/dist/components/index.js +0 -3
  100. package/dist/components/index.js.map +0 -1
  101. package/dist/components/lottery-bullet.js +0 -8
  102. package/dist/components/lottery-bullet.js.map +0 -1
  103. package/dist/components/lottery-bullet2.js +0 -94
  104. package/dist/components/lottery-bullet2.js.map +0 -1
  105. package/dist/components/lottery-draw-results-history.js +0 -8
  106. package/dist/components/lottery-draw-results-history.js.map +0 -1
  107. package/dist/components/lottery-draw-results-history2.js +0 -298
  108. package/dist/components/lottery-draw-results-history2.js.map +0 -1
  109. package/dist/components/lottery-draw-results.js +0 -8
  110. package/dist/components/lottery-draw-results.js.map +0 -1
  111. package/dist/components/lottery-draw-results2.js +0 -346
  112. package/dist/components/lottery-draw-results2.js.map +0 -1
  113. package/dist/components/lottery-game-details.js +0 -8
  114. package/dist/components/lottery-game-details.js.map +0 -1
  115. package/dist/components/lottery-game-details2.js +0 -87
  116. package/dist/components/lottery-game-details2.js.map +0 -1
  117. package/dist/components/lottery-game-page.d.ts +0 -11
  118. package/dist/components/lottery-game-page.js +0 -572
  119. package/dist/components/lottery-game-page.js.map +0 -1
  120. package/dist/components/lottery-grid.js +0 -8
  121. package/dist/components/lottery-grid.js.map +0 -1
  122. package/dist/components/lottery-grid2.js +0 -248
  123. package/dist/components/lottery-grid2.js.map +0 -1
  124. package/dist/components/lottery-ticket-controller.js +0 -8
  125. package/dist/components/lottery-ticket-controller.js.map +0 -1
  126. package/dist/components/lottery-ticket-controller2.js +0 -185
  127. package/dist/components/lottery-ticket-controller2.js.map +0 -1
  128. package/dist/components/lottery-ticket.js +0 -8
  129. package/dist/components/lottery-ticket.js.map +0 -1
  130. package/dist/components/lottery-ticket2.js +0 -276
  131. package/dist/components/lottery-ticket2.js.map +0 -1
  132. package/dist/esm/helper-accordion.entry.js +0 -130
  133. package/dist/esm/helper-accordion.entry.js.map +0 -1
  134. package/dist/esm/helper-filters_2.entry.js.map +0 -1
  135. package/dist/esm/helper-modal.entry.js +0 -74
  136. package/dist/esm/helper-modal.entry.js.map +0 -1
  137. package/dist/esm/helper-pagination.entry.js.map +0 -1
  138. package/dist/esm/helper-tab.entry.js +0 -66
  139. package/dist/esm/helper-tab.entry.js.map +0 -1
  140. package/dist/esm/helper-tabs.entry.js +0 -72
  141. package/dist/esm/helper-tabs.entry.js.map +0 -1
  142. package/dist/esm/index-d1baacd4.js +0 -1298
  143. package/dist/esm/index-d1baacd4.js.map +0 -1
  144. package/dist/esm/index.js.map +0 -1
  145. package/dist/esm/loader.js.map +0 -1
  146. package/dist/esm/lottery-bullet_2.entry.js +0 -276
  147. package/dist/esm/lottery-bullet_2.entry.js.map +0 -1
  148. package/dist/esm/lottery-draw-results-history.entry.js +0 -236
  149. package/dist/esm/lottery-draw-results-history.entry.js.map +0 -1
  150. package/dist/esm/lottery-game-details.entry.js +0 -49
  151. package/dist/esm/lottery-game-details.entry.js.map +0 -1
  152. package/dist/esm/lottery-game-page.entry.js +0 -452
  153. package/dist/esm/lottery-game-page.entry.js.map +0 -1
  154. package/dist/esm/lottery-game-page.js.map +0 -1
  155. package/dist/esm/lottery-ticket-controller.entry.js +0 -128
  156. package/dist/esm/lottery-ticket-controller.entry.js.map +0 -1
  157. package/dist/esm/lottery-ticket.entry.js +0 -229
  158. package/dist/esm/lottery-ticket.entry.js.map +0 -1
  159. package/dist/esm/polyfills/core-js.js +0 -11
  160. package/dist/esm/polyfills/css-shim.js +0 -1
  161. package/dist/esm/polyfills/dom.js +0 -79
  162. package/dist/esm/polyfills/es5-html-element.js +0 -1
  163. package/dist/esm/polyfills/index.js +0 -34
  164. package/dist/esm/polyfills/system.js +0 -6
  165. package/dist/lottery-game-page/index.esm.js.map +0 -1
  166. package/dist/lottery-game-page/lottery-game-page.esm.js.map +0 -1
  167. package/dist/lottery-game-page/p-12340c50.entry.js +0 -2921
  168. package/dist/lottery-game-page/p-12340c50.entry.js.map +0 -1
  169. package/dist/lottery-game-page/p-15309f9a.entry.js +0 -2
  170. package/dist/lottery-game-page/p-15309f9a.entry.js.map +0 -1
  171. package/dist/lottery-game-page/p-167c9dbe.entry.js +0 -2
  172. package/dist/lottery-game-page/p-167c9dbe.entry.js.map +0 -1
  173. package/dist/lottery-game-page/p-20e0c81c.entry.js +0 -2
  174. package/dist/lottery-game-page/p-20e0c81c.entry.js.map +0 -1
  175. package/dist/lottery-game-page/p-59a96854.entry.js +0 -2
  176. package/dist/lottery-game-page/p-59a96854.entry.js.map +0 -1
  177. package/dist/lottery-game-page/p-662d9dac.entry.js +0 -2
  178. package/dist/lottery-game-page/p-662d9dac.entry.js.map +0 -1
  179. package/dist/lottery-game-page/p-66729e9c.entry.js +0 -2
  180. package/dist/lottery-game-page/p-66729e9c.entry.js.map +0 -1
  181. package/dist/lottery-game-page/p-721345a7.entry.js +0 -2
  182. package/dist/lottery-game-page/p-721345a7.entry.js.map +0 -1
  183. package/dist/lottery-game-page/p-76c280ec.entry.js +0 -2
  184. package/dist/lottery-game-page/p-76c280ec.entry.js.map +0 -1
  185. package/dist/lottery-game-page/p-cd4aa6a4.entry.js +0 -2
  186. package/dist/lottery-game-page/p-cd4aa6a4.entry.js.map +0 -1
  187. package/dist/lottery-game-page/p-e765c7d9.js +0 -2
  188. package/dist/lottery-game-page/p-e765c7d9.js.map +0 -1
  189. package/dist/lottery-game-page/p-e86e2389.entry.js +0 -2
  190. package/dist/lottery-game-page/p-e86e2389.entry.js.map +0 -1
  191. package/dist/lottery-game-page/p-f399eef1.entry.js +0 -2
  192. package/dist/lottery-game-page/p-f399eef1.entry.js.map +0 -1
  193. package/dist/stencil.config.js.map +0 -1
  194. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
@@ -1,276 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-d1baacd4.js';
2
-
3
- const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
4
-
5
- const LotteryBullet = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
9
- /**
10
- * Value of the bullet
11
- */
12
- this.value = '0';
13
- /**
14
- * Marks if the bullet should be selectable
15
- */
16
- this.selectable = true;
17
- /**
18
- * Marks if the bullet should be selected
19
- */
20
- this.isSelected = false;
21
- /**
22
- * Client custom styling via string
23
- */
24
- this.clientStyling = '';
25
- /**
26
- * Client custom styling via url content
27
- */
28
- this.clientStylingUrlContent = '';
29
- this.limitStylingAppends = false;
30
- this.select = () => {
31
- if (this.selectable) {
32
- this.isSelected = !this.isSelected;
33
- this.bulletEvent.emit({
34
- value: this.value,
35
- selected: this.isSelected
36
- });
37
- }
38
- };
39
- this.setClientStyling = () => {
40
- let sheet = document.createElement('style');
41
- sheet.innerHTML = this.clientStyling;
42
- this.stylingContainer.prepend(sheet);
43
- };
44
- this.setClientStylingURL = () => {
45
- let cssFile = document.createElement('style');
46
- setTimeout(() => {
47
- cssFile.innerHTML = this.clientStylingUrlContent;
48
- this.stylingContainer.prepend(cssFile);
49
- }, 1);
50
- };
51
- }
52
- componentDidRender() {
53
- // start custom styling area
54
- if (!this.limitStylingAppends && this.stylingContainer) {
55
- if (this.clientStyling)
56
- this.setClientStyling();
57
- if (this.clientStylingUrlContent)
58
- this.setClientStylingURL();
59
- this.limitStylingAppends = true;
60
- }
61
- // end custom styling area
62
- }
63
- render() {
64
- return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
65
- }
66
- };
67
- LotteryBullet.style = lotteryBulletCss;
68
-
69
- const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}";
70
-
71
- const LotteryGrid = class {
72
- constructor(hostRef) {
73
- registerInstance(this, hostRef);
74
- this.gridFilledEvent = createEvent(this, "gridFilled", 7);
75
- this.gridDirtyEvent = createEvent(this, "gridDirty", 7);
76
- /**
77
- * Number of bullets of grid
78
- */
79
- this.totalNumbers = 0;
80
- /**
81
- * Number of maximum bullets that can be selected
82
- */
83
- this.maximumAllowed = 0;
84
- /**
85
- * Minimum allowed of bullets
86
- */
87
- this.minimumAllowed = 1;
88
- /**
89
- * Allows the user to select numbers on the grid
90
- */
91
- this.selectable = true;
92
- /**
93
- * Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
94
- */
95
- this.selectedNumbers = '';
96
- /**
97
- * Show only selected numbers
98
- */
99
- this.displaySelected = false;
100
- /**
101
- * Language
102
- */
103
- this.language = 'en';
104
- /**
105
- * Personalize grid for ticket
106
- */
107
- this.gridType = '';
108
- /**
109
- * Client custom styling via string
110
- */
111
- this.clientStyling = '';
112
- /**
113
- * Client custom styling via url content
114
- */
115
- this.clientStylingUrlContent = '';
116
- this.numbers = [];
117
- this.limitStylingAppends = false;
118
- this.selectedCounter = 0;
119
- this.setClientStyling = () => {
120
- let sheet = document.createElement('style');
121
- sheet.innerHTML = this.clientStyling;
122
- this.stylingContainer.prepend(sheet);
123
- };
124
- this.setClientStylingURL = () => {
125
- let cssFile = document.createElement('style');
126
- setTimeout(() => {
127
- cssFile.innerHTML = this.clientStylingUrlContent;
128
- this.stylingContainer.prepend(cssFile);
129
- }, 1);
130
- };
131
- }
132
- connectedCallback() {
133
- let selected = [];
134
- if (this.selectedNumbers.length > 0) {
135
- selected = this.selectedNumbers.split(',');
136
- this.selectedCounter = selected.length;
137
- }
138
- if (this.displaySelected) {
139
- selected.forEach((item) => {
140
- this.numbers.push({
141
- number: item,
142
- selected: true,
143
- selectable: this.selectable
144
- });
145
- });
146
- }
147
- else {
148
- [...Array(this.totalNumbers).keys()]
149
- .map(number => (number + 1).toString())
150
- .forEach((number) => {
151
- this.numbers.push({
152
- number,
153
- selected: selected.indexOf(number) >= 0 ? true : false,
154
- selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
155
- });
156
- });
157
- }
158
- }
159
- componentDidRender() {
160
- // start custom styling area
161
- if (!this.limitStylingAppends && this.stylingContainer) {
162
- if (this.clientStyling)
163
- this.setClientStyling();
164
- if (this.clientStylingUrlContent)
165
- this.setClientStylingURL();
166
- this.limitStylingAppends = true;
167
- }
168
- // end custom styling area
169
- }
170
- // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
171
- shuffleArray(array) {
172
- const result = [];
173
- while (array.length > 0) {
174
- const randomIndex = Math.floor(Math.random() * (array.length));
175
- result.push(array.splice(randomIndex, 1)[0]);
176
- }
177
- return result;
178
- }
179
- lotteryBulletSelectionHandler(event) {
180
- this.numbers = this.numbers.map((item) => {
181
- if (item.number == event.detail.value) {
182
- return {
183
- number: item.number,
184
- selected: event.detail.selected,
185
- selectable: item.selectable
186
- };
187
- }
188
- return {
189
- number: item.number,
190
- selected: item.selected,
191
- selectable: item.selectable
192
- };
193
- });
194
- if (event.detail.selected) {
195
- this.selectedCounter += 1;
196
- if (this.selectedCounter == this.maximumAllowed) {
197
- this.numbers = this.numbers.map((item) => {
198
- return {
199
- number: item.number,
200
- selected: item.selected,
201
- selectable: item.selected ? true : false
202
- };
203
- });
204
- this.gridFilledEvent.emit({
205
- id: this.ticketId,
206
- index: this.gridIndex,
207
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
208
- });
209
- }
210
- }
211
- else {
212
- if (this.selectedCounter == this.maximumAllowed) {
213
- this.numbers = this.numbers.map((item) => {
214
- return {
215
- number: item.number,
216
- selected: item.selected,
217
- selectable: true
218
- };
219
- });
220
- this.gridDirtyEvent.emit({
221
- id: this.ticketId,
222
- index: this.gridIndex,
223
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
224
- });
225
- }
226
- this.selectedCounter -= 1;
227
- }
228
- }
229
- async resetSelectionHandler(event) {
230
- if (event.detail && event.detail == this.ticketId) {
231
- this.selectedCounter = 0;
232
- this.numbers = this.numbers.map((item) => {
233
- return {
234
- number: item.number,
235
- selected: false,
236
- selectable: this.selectable
237
- };
238
- });
239
- this.gridDirtyEvent.emit({
240
- id: this.ticketId,
241
- index: this.gridIndex,
242
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
243
- });
244
- }
245
- }
246
- async autoSelectionHandler(event) {
247
- if (event.detail && event.detail == this.ticketId) {
248
- this.resetSelectionHandler(event);
249
- let array = [...Array(this.totalNumbers).keys()]
250
- .map(number => number + 1);
251
- array = this.shuffleArray(array);
252
- array = array.slice(0, this.minimumAllowed);
253
- this.numbers = this.numbers.map((item) => {
254
- return {
255
- number: item.number,
256
- selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
257
- selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
258
- };
259
- });
260
- this.gridFilledEvent.emit({
261
- id: this.ticketId,
262
- index: this.gridIndex,
263
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
264
- });
265
- this.selectedCounter = this.maximumAllowed;
266
- }
267
- }
268
- render() {
269
- return (h("div", { class: "GridContainer", ref: el => this.stylingContainer = el }, h("div", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
270
- }
271
- };
272
- LotteryGrid.style = lotteryGridCss;
273
-
274
- export { LotteryBullet as lottery_bullet, LotteryGrid as lottery_grid };
275
-
276
- //# sourceMappingURL=lottery-bullet_2.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"lottery-bullet.lottery-grid.entry.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,i8FAAi8F;;MCC78F,aAAa;EACxB;;;;;;IAIE,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;;;;IAIjB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;;;;IAIvB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;;;;IAIxB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;;;;IAIxB,IAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC;IAClC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACjC,IAAI,CAAC,MAAM,GAAG;MACZ,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;UACpB,KAAK,EAAE,IAAI,CAAC,KAAK;UACjB,QAAQ,EAAE,IAAI,CAAC,UAAU;SAC1B,CAAC,CAAC;OACJ;KACF,CAAC;IACF,IAAI,CAAC,gBAAgB,GAAG;MACtB,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;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C,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC;OACzF,CAAC,CAAC;MACH,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC;KAC5C;GACF;EACD,MAAM;IACJ,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,gBAAgB,GAAG,EAAE,EAAE,EAChF,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,KAAK,QAAQ,GAAG,iBAAiB,GAAG,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE,IAAI,EACnH,CAAC,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,CAAC,aAAa,EAAE,4BAA4B,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;GACnN;;;;;;","names":[],"sources":["../lottery-bullet/dist/collection/components/lottery-bullet/lottery-bullet.css?tag=lottery-bullet&encapsulation=shadow","../lottery-bullet/dist/collection/components/lottery-bullet/lottery-bullet.js","../lottery-grid/dist/collection/components/lottery-grid/lottery-grid.css?tag=lottery-grid&encapsulation=shadow","../lottery-grid/dist/collection/components/lottery-grid/lottery-grid.js"],"sourcesContent":["@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/*** Animation - Show */\n@-webkit-keyframes Circle {\n 0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n}\n@keyframes Circle {\n 0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n}\n/*** Animation - Hover */\n@-webkit-keyframes hover-rotate {\n 0% {\n -webkit-transform: scale(1) rotateZ(0);\n transform: scale(1) rotateZ(0);\n }\n 50% {\n -webkit-transform: scale(1.2) rotateZ(180deg);\n transform: scale(1.22) rotateZ(180deg);\n }\n 100% {\n -webkit-transform: scale(1) rotateZ(360deg);\n transform: scale(1) rotateZ(360deg);\n }\n}\n@keyframes hover-rotate {\n 0% {\n -webkit-transform: scale(1) rotateZ(0);\n transform: scale(1) rotateZ(0);\n }\n 50% {\n -webkit-transform: scale(1.2) rotateZ(180deg);\n transform: scale(1.2) rotateZ(180deg);\n }\n 100% {\n -webkit-transform: scale(1) rotateZ(360deg);\n transform: scale(1) rotateZ(360deg);\n }\n}\n/*** Animation - Selected */\n@-webkit-keyframes selected-scaleUp {\n 0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n }\n 100% {\n -webkit-transform: scale(1.2);\n transform: scale(1.2);\n }\n}\n@keyframes selected-scaleUp {\n 0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n}\n.Circle {\n -webkit-animation: Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n cursor: pointer;\n color: #000000;\n display: block;\n height: 30px;\n width: 30px;\n margin: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n justify-content: center;\n align-items: center;\n border: solid 2px #ffffff;\n background: radial-gradient(circle at top, white 0%, white 100%);\n font-weight: bold;\n border-radius: 50%;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5);\n user-select: none;\n font-size: 16px;\n line-height: 16px;\n font-weight: 600;\n position: relative;\n}\n.Circle:hover {\n -webkit-animation: hover-rotate 0.4s linear both;\n animation: hover-rotate 0.4s linear both;\n background: radial-gradient(circle at top, white 0%, #f1f1f1 100%);\n}\n.Circle.Selected {\n -webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n color: #ffffff;\n background: #9EC258;\n background: -webkit-radial-gradient(top, #00958f, #004D4A);\n background: -moz-radial-gradient(top, #00958f, #004D4A);\n background: radial-gradient(to bottom, #00958f, #004D4A);\n border: solid 2px #00958f;\n}\n.Circle.Disabled {\n -webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n color: #f1f1f1;\n background: #D4D4D4;\n border: solid 2px #D4D4D4;\n cursor: default;\n}\n.Circle.DisabledSelected {\n -webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n color: #f1f1f1;\n background: #9EC258;\n background: -webkit-radial-gradient(top, #00958f, #004D4A);\n background: -moz-radial-gradient(top, #00958f, #004D4A);\n background: radial-gradient(to bottom, #00958f, #004D4A);\n border: solid 2px #D4D4D4;\n cursor: default;\n}","import { Component, h, Prop, Event, State } from '@stencil/core';\nexport class LotteryBullet {\n constructor() {\n /**\n * Value of the bullet\n */\n this.value = '0';\n /**\n * Marks if the bullet should be selectable\n */\n this.selectable = true;\n /**\n * Marks if the bullet should be selected\n */\n this.isSelected = false;\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.limitStylingAppends = false;\n this.select = () => {\n if (this.selectable) {\n this.isSelected = !this.isSelected;\n this.bulletEvent.emit({\n value: this.value,\n selected: this.isSelected\n });\n }\n };\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n render() {\n return (h(\"div\", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));\n }\n static get is() { return \"lottery-bullet\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-bullet.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-bullet.css\"]\n }; }\n static get properties() { return {\n \"value\": {\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\": \"Value of the bullet\"\n },\n \"attribute\": \"value\",\n \"reflect\": true,\n \"defaultValue\": \"'0'\"\n },\n \"selectable\": {\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\": \"Marks if the bullet should be selectable\"\n },\n \"attribute\": \"selectable\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n },\n \"isSelected\": {\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\": \"Marks if the bullet should be selected\"\n },\n \"attribute\": \"is-selected\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"clientStyling\": {\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\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\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\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"bulletEvent\",\n \"name\": \"lotteryBulletSelection\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"When a bullet is selected/deselected this event is emmited\"\n },\n \"complexType\": {\n \"original\": \"BulletEvent\",\n \"resolved\": \"BulletEvent\",\n \"references\": {\n \"BulletEvent\": {\n \"location\": \"import\",\n \"path\": \"./lottery-bullet.types\"\n }\n }\n }\n }]; }\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.GridContainer {\n display: flex;\n flex-direction: column;\n max-width: 1200px;\n}\n\n.Grid {\n margin-top: 10px 0 10px 0;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 20px;\n}\n.Grid.TicketGrid {\n gap: 5px;\n}","import { Component, h, Prop, Listen, State, Event } from '@stencil/core';\n// import { translate } from '../../utils/locale.utils';\nimport '@everymatrix/lottery-bullet';\nexport class LotteryGrid {\n constructor() {\n /**\n * Number of bullets of grid\n */\n this.totalNumbers = 0;\n /**\n * Number of maximum bullets that can be selected\n */\n this.maximumAllowed = 0;\n /**\n * Minimum allowed of bullets\n */\n this.minimumAllowed = 1;\n /**\n * Allows the user to select numbers on the grid\n */\n this.selectable = true;\n /**\n * Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')\n */\n this.selectedNumbers = '';\n /**\n * Show only selected numbers\n */\n this.displaySelected = false;\n /**\n * Language\n */\n this.language = 'en';\n /**\n * Personalize grid for ticket\n */\n this.gridType = '';\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.numbers = [];\n this.limitStylingAppends = false;\n this.selectedCounter = 0;\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n connectedCallback() {\n let selected = [];\n if (this.selectedNumbers.length > 0) {\n selected = this.selectedNumbers.split(',');\n this.selectedCounter = selected.length;\n }\n if (this.displaySelected) {\n selected.forEach((item) => {\n this.numbers.push({\n number: item,\n selected: true,\n selectable: this.selectable\n });\n });\n }\n else {\n [...Array(this.totalNumbers).keys()]\n .map(number => (number + 1).toString())\n .forEach((number) => {\n this.numbers.push({\n number,\n selected: selected.indexOf(number) >= 0 ? true : false,\n selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable\n });\n });\n }\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices\n shuffleArray(array) {\n const result = [];\n while (array.length > 0) {\n const randomIndex = Math.floor(Math.random() * (array.length));\n result.push(array.splice(randomIndex, 1)[0]);\n }\n return result;\n }\n lotteryBulletSelectionHandler(event) {\n this.numbers = this.numbers.map((item) => {\n if (item.number == event.detail.value) {\n return {\n number: item.number,\n selected: event.detail.selected,\n selectable: item.selectable\n };\n }\n return {\n number: item.number,\n selected: item.selected,\n selectable: item.selectable\n };\n });\n if (event.detail.selected) {\n this.selectedCounter += 1;\n if (this.selectedCounter == this.maximumAllowed) {\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: item.selected,\n selectable: item.selected ? true : false\n };\n });\n this.gridFilledEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n }\n else {\n if (this.selectedCounter == this.maximumAllowed) {\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: item.selected,\n selectable: true\n };\n });\n this.gridDirtyEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n this.selectedCounter -= 1;\n }\n }\n async resetSelectionHandler(event) {\n if (event.detail && event.detail == this.ticketId) {\n this.selectedCounter = 0;\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: false,\n selectable: this.selectable\n };\n });\n this.gridDirtyEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n }\n async autoSelectionHandler(event) {\n if (event.detail && event.detail == this.ticketId) {\n this.resetSelectionHandler(event);\n let array = [...Array(this.totalNumbers).keys()]\n .map(number => number + 1);\n array = this.shuffleArray(array);\n array = array.slice(0, this.minimumAllowed);\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,\n selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,\n };\n });\n this.gridFilledEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n this.selectedCounter = this.maximumAllowed;\n }\n }\n render() {\n return (h(\"div\", { class: \"GridContainer\", ref: el => this.stylingContainer = el },\n h(\"div\", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h(\"div\", null,\n h(\"lottery-bullet\", { value: item.number, selectable: item.selectable, \"is-selected\": item.selected, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent }))))));\n }\n static get is() { return \"lottery-grid\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-grid.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-grid.css\"]\n }; }\n static get properties() { return {\n \"ticketId\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Identifier for the ticket\"\n },\n \"attribute\": \"ticket-id\",\n \"reflect\": true\n },\n \"totalNumbers\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of bullets of grid\"\n },\n \"attribute\": \"total-numbers\",\n \"reflect\": true,\n \"defaultValue\": \"0\"\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\": true\n },\n \"maximumAllowed\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of maximum bullets that can be selected\"\n },\n \"attribute\": \"maximum-allowed\",\n \"reflect\": true,\n \"defaultValue\": \"0\"\n },\n \"minimumAllowed\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Minimum allowed of bullets\"\n },\n \"attribute\": \"minimum-allowed\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"selectable\": {\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\": \"Allows the user to select numbers on the grid\"\n },\n \"attribute\": \"selectable\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n },\n \"selectedNumbers\": {\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\": \"Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')\"\n },\n \"attribute\": \"selected-numbers\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"displaySelected\": {\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\": \"Show only selected numbers\"\n },\n \"attribute\": \"display-selected\",\n \"reflect\": true,\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\": true,\n \"defaultValue\": \"'en'\"\n },\n \"gridIndex\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The index of the number\"\n },\n \"attribute\": \"grid-index\",\n \"reflect\": true\n },\n \"gridType\": {\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\": \"Personalize grid for ticket\"\n },\n \"attribute\": \"grid-type\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStyling\": {\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\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\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\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"numbers\": {},\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"gridFilledEvent\",\n \"name\": \"gridFilled\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"When the grid is completed, it emits this event with selected numbers\"\n },\n \"complexType\": {\n \"original\": \"GridEvent\",\n \"resolved\": \"GridEvent\",\n \"references\": {\n \"GridEvent\": {\n \"location\": \"import\",\n \"path\": \"./lottery-grid.types\"\n }\n }\n }\n }, {\n \"method\": \"gridDirtyEvent\",\n \"name\": \"gridDirty\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"When the grid is uncomplete after being completed once (reset or change), it emits this event\"\n },\n \"complexType\": {\n \"original\": \"GridEvent\",\n \"resolved\": \"GridEvent\",\n \"references\": {\n \"GridEvent\": {\n \"location\": \"import\",\n \"path\": \"./lottery-grid.types\"\n }\n }\n }\n }]; }\n static get listeners() { return [{\n \"name\": \"lotteryBulletSelection\",\n \"method\": \"lotteryBulletSelectionHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"resetSelection\",\n \"method\": \"resetSelectionHandler\",\n \"target\": \"document\",\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"autoSelection\",\n \"method\": \"autoSelectionHandler\",\n \"target\": \"document\",\n \"capture\": false,\n \"passive\": false\n }]; }\n}\n"],"version":3}
@@ -1,236 +0,0 @@
1
- import { r as registerInstance, h } from './index-d1baacd4.js';
2
-
3
- const DEFAULT_LANGUAGE = 'en';
4
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
5
- const TRANSLATIONS = {
6
- en: {
7
- drawResultsHeader: 'Draw results history',
8
- drawId: 'Draw ID',
9
- drawDate: 'Draw Date',
10
- drawNumbersGridA: 'Draw numbers Grid A',
11
- viewAllResults: 'View All',
12
- lastFiveDraws: 'Last 5 Draws',
13
- lastTenDraws: 'Last 10 Draws',
14
- lastFifteenDraws: 'Last 15 Draws',
15
- allDrawResultsHistory: 'All Draw Results History',
16
- noResults: 'No results',
17
- fetchingResults: 'Fetching results'
18
- },
19
- ro: {
20
- drawResultsHeader: 'Istoricul extragerilor',
21
- drawId: 'ID-ul extragerii',
22
- drawDate: 'Data extragerii',
23
- drawNumbersGridA: 'Numerele extrase Grid A',
24
- viewAllResults: 'Vezi toate rezultatele',
25
- lastFiveDraws: 'Ultimile 5 extrageri',
26
- lastTenDraws: 'Ultimile 10 extrageri',
27
- lastFifteenDraws: 'Ultimile 15 extrageri',
28
- allDrawResultsHistory: 'Istoricul tuturor extragerilor',
29
- noResults: 'Niciun rezultat',
30
- fetchingResults: 'Se obtin rezultatele'
31
- },
32
- fr: {
33
- drawResultsHeader: 'Dessiner l\'historique des résultats',
34
- drawId: 'ID de tirage',
35
- drawDate: 'Date du tirage',
36
- drawNumbersGridA: 'Tirage des numéros Grille',
37
- viewAllResults: 'Voir tout',
38
- lastFiveDraws: '5 derniers tirages',
39
- lastTenDraws: '10 derniers tirages',
40
- lastFifteenDraws: '15 derniers tirages',
41
- allDrawResultsHistory: 'Historique des résultats de tous les tirages',
42
- noResults: 'Aucun résultat',
43
- fetchingResults: 'Récupération des résultats'
44
- },
45
- ar: {
46
- drawResultsHeader: 'سجل نتائج السحب',
47
- drawId: 'معرّف السحب',
48
- drawDate: 'تاريخ السحب',
49
- drawNumbersGridA: 'شبكة أرقام السحب',
50
- viewAllResults: 'عرض الكل',
51
- lastFiveDraws: 'آخر 5 سحوبات',
52
- lastTenDraws: 'آخر 10 سحوبات',
53
- lastFifteenDraws: 'آخر 15 سحبًا',
54
- allDrawResultsHistory: 'سجل نتائج كل السحوبات',
55
- noResults: 'لا توجد نتائج',
56
- fetchingResults: 'جلب النتائج'
57
- },
58
- hr: {
59
- drawResultsHeader: 'Povijest rezultata izvlačenja',
60
- drawId: 'ID izvlačenja',
61
- drawDate: 'Datum izvlačenja',
62
- drawNumbersGridA: 'Izvučeni brojevi tablica A',
63
- viewAllResults: 'Pogledaj sve',
64
- lastFiveDraws: 'Zadnjih 5 izvlačenja',
65
- lastTenDraws: 'Zadnjih 10 izvlačenja',
66
- lastFifteenDraws: 'Zadnjih 15 izvlačenja',
67
- allDrawResultsHistory: 'Povijest svih rezultata izvlačenja',
68
- noResults: 'Nema rezultata',
69
- fetchingResults: 'Dohvaćanje rezultata'
70
- },
71
- };
72
- const translate = (key, customLang) => {
73
- const lang = customLang;
74
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
75
- };
76
-
77
- const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #009993;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.DrawResultsSection{max-width:600px;margin:0px auto}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:#009993;padding:10px;text-align:center;color:#fff;padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:#009993;color:#fff;outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton{cursor:pointer;width:max-content;border-radius:4px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .QuickFilterButton:hover{background:#F1F1F1}.FilterSection helper-filters{margin-left:auto}";
78
-
79
- const LotteryDrawResultsHistory = class {
80
- constructor(hostRef) {
81
- registerInstance(this, hostRef);
82
- /**
83
- * The number of results to be displayed
84
- */
85
- this.numberOfResults = 3;
86
- /**
87
- *Language
88
- */
89
- this.language = 'en';
90
- /**
91
- * Client custom styling via string
92
- */
93
- this.clientStyling = '';
94
- /**
95
- * Client custom styling via url content
96
- */
97
- this.clientStylingUrlContent = '';
98
- this.drawData = [];
99
- this.winningDataSetsData = [''];
100
- this.displayAllDrawsResults = true;
101
- this.showQuickFilters = true;
102
- this.dateFiltersFrom = '';
103
- this.dateFiltersTo = '';
104
- this.isLoading = false;
105
- this.noResults = false;
106
- this.limitStylingAppends = false;
107
- this.getDrawsData = () => {
108
- let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
109
- if (this.dateFiltersFrom)
110
- url.searchParams.append('from', this.dateFiltersFrom);
111
- if (this.dateFiltersTo)
112
- url.searchParams.append('to', this.dateFiltersTo);
113
- fetch(url.href)
114
- .then((res) => {
115
- if (res.status >= 300) {
116
- throw new Error('There was an error while fetching the data');
117
- }
118
- return res.json();
119
- })
120
- .then((data) => {
121
- this.winningDataSetsData = data.items.filter(draw => draw.winningNumbers);
122
- this.drawData = this.winningDataSetsData.map((item) => item);
123
- })
124
- .catch((err) => {
125
- console.log('err', err);
126
- })
127
- .finally(() => {
128
- this.isLoading = false;
129
- this.noResults = this.drawData.filter(draw => draw.winningNumbers).length == 0 ? true : false;
130
- });
131
- };
132
- this.filterResults = (resultsNumber) => {
133
- this.numberOfResults = resultsNumber;
134
- this.displayAllDrawsResults = true;
135
- };
136
- this.getDrawResults = (drawID) => {
137
- let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID}`);
138
- let drawOptions = {
139
- method: "GET",
140
- headers: {
141
- 'Content-Type': "application/json",
142
- 'Accept': 'application/json',
143
- },
144
- };
145
- fetch(url.href, drawOptions)
146
- .then((response) => {
147
- if (response.status == 404)
148
- this.noResults = true;
149
- return response.json();
150
- })
151
- .then((data) => {
152
- this.drawData = [data].map((item) => item);
153
- })
154
- .catch((err) => {
155
- console.log('err', err);
156
- })
157
- .finally(() => {
158
- this.isLoading = false;
159
- });
160
- };
161
- this.viewAllResults = () => {
162
- this.numberOfResults = this.drawData.length;
163
- this.displayAllDrawsResults = false;
164
- window.scrollTo({ top: 0, behavior: 'smooth' });
165
- };
166
- this.setClientStyling = () => {
167
- let sheet = document.createElement('style');
168
- sheet.innerHTML = this.clientStyling;
169
- this.stylingContainer.prepend(sheet);
170
- };
171
- this.setClientStylingURL = () => {
172
- let cssFile = document.createElement('style');
173
- setTimeout(() => {
174
- cssFile.innerHTML = this.clientStylingUrlContent;
175
- this.stylingContainer.prepend(cssFile);
176
- }, 1);
177
- };
178
- }
179
- // Filters events
180
- // @Listen('filterDraw')
181
- // filtersDrawHandler(event: CustomEvent<any>):void {
182
- // this.isLoading = true;
183
- // this.showQuickFilters = false;
184
- // }
185
- filtersHandler(event) {
186
- this.showQuickFilters = false;
187
- this.isLoading = true;
188
- if (event.detail.ticketDrawId) {
189
- this.getDrawResults(event.detail.ticketDrawId);
190
- }
191
- else {
192
- this.dateFiltersFrom = event.detail.filterFromCalendar;
193
- this.dateFiltersTo = event.detail.filterToCalendar;
194
- this.getDrawsData();
195
- }
196
- }
197
- clearFiltersHandler() {
198
- this.showQuickFilters = true;
199
- this.dateFiltersFrom = '';
200
- this.dateFiltersTo = '';
201
- this.drawData = this.winningDataSetsData;
202
- this.isLoading = true;
203
- this.getDrawsData();
204
- }
205
- connectedCallback() {
206
- if (this.showQuickFilters)
207
- this.getDrawsData();
208
- }
209
- disconnectedCallback() {
210
- clearInterval(this.interval);
211
- }
212
- componentDidRender() {
213
- // start custom styling area
214
- if (!this.limitStylingAppends && this.stylingContainer) {
215
- if (this.clientStyling)
216
- this.setClientStyling();
217
- if (this.clientStylingUrlContent)
218
- this.setClientStylingURL();
219
- this.limitStylingAppends = true;
220
- }
221
- // end custom styling area
222
- }
223
- render() {
224
- let gridHeader = h("div", { class: "DrawResultsHeader" }, this.displayAllDrawsResults ? h("h4", null, translate('drawResultsHeader', this.language)) :
225
- [h("div", { class: "DrawResultsHeaderContent" }, h("h4", null, translate('allDrawResultsHistory', this.language)), h("div", { class: "FilterSection" }, this.showQuickFilters &&
226
- h("div", { class: "FilterResultsContainer" }, h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(5) }, translate('lastFiveDraws', this.language)), h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(10) }, translate('lastTenDraws', this.language)), h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(15) }, translate('lastFifteenDraws', this.language))), h("helper-filters", { "show-filter-id": "true", "activate-ticket-search": "false", "game-id": this.gameId, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))),
227
- ]);
228
- return h("section", { class: "GridWrapper", ref: el => this.stylingContainer = el }, h("div", { class: "DrawResultsSection" }, h("div", { class: "DrawResultsAreaHistory" }, gridHeader, h("div", { class: "HistoryGridWrapper" }, h("div", { class: "HistoryGrid" }, this.isLoading &&
229
- h("p", null, translate('fetchingResults', this.language)), !this.isLoading && !this.noResults && this.drawData.map((item) => h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, "draw-id": item.id, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })).reverse().slice(0, this.numberOfResults), !this.isLoading && this.noResults && (h("p", null, translate('noResults', this.language))))), this.displayAllDrawsResults && h("button", { class: "ViewAllResults", onClick: this.viewAllResults }, translate('viewAllResults', this.language)))));
230
- }
231
- };
232
- LotteryDrawResultsHistory.style = lotteryDrawResultsHistoryCss;
233
-
234
- export { LotteryDrawResultsHistory as lottery_draw_results_history };
235
-
236
- //# sourceMappingURL=lottery-draw-results-history.entry.js.map