@everymatrix/lottery-pagination 1.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-249d3d4d.js +1186 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/lottery-pagination-e934e1e8.js +247 -0
- package/dist/cjs/lottery-pagination.cjs.entry.js +10 -0
- package/dist/cjs/lottery-pagination.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/lottery-pagination/index.js +1 -0
- package/dist/collection/components/lottery-pagination/lottery-pagination.css +136 -0
- package/dist/collection/components/lottery-pagination/lottery-pagination.js +440 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +43 -0
- package/dist/collection/utils/utils.js +15 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-49de5c89.js +1159 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/lottery-pagination-50564510.js +245 -0
- package/dist/esm/lottery-pagination.entry.js +2 -0
- package/dist/esm/lottery-pagination.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-pagination/index.esm.js +1 -0
- package/dist/lottery-pagination/lottery-pagination.esm.js +1 -0
- package/dist/lottery-pagination/p-9e29d391.js +1 -0
- package/dist/lottery-pagination/p-ce0101e8.js +2 -0
- package/dist/lottery-pagination/p-e0782a32.entry.js +1 -0
- package/dist/lottery-pagination/p-e1255160.js +1 -0
- package/dist/stencil.config.dev.js +16 -0
- package/dist/stencil.config.js +17 -0
- package/dist/storybook/main.js +21 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/storybook/main.d.ts +3 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/storybook/preview.d.ts +70 -0
- package/dist/types/components/lottery-pagination/index.d.ts +1 -0
- package/dist/types/components/lottery-pagination/lottery-pagination.d.ts +97 -0
- package/dist/types/components.d.ts +146 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1680 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +8 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { b as bootstrapLazy } from './index-49de5c89.js';
|
|
2
|
+
export { s as setNonce } from './index-49de5c89.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await globalScripts();
|
|
8
|
+
return bootstrapLazy([["lottery-pagination",[[1,"lottery-pagination",{"nextPage":[1540,"next-page"],"prevPage":[1540,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"clientStyling":[1537,"client-styling"],"clientStylingUrlContent":[1537,"client-styling-url-content"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"isReset":[1540,"is-reset"],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32],"limitStylingAppends":[32]}]]]], options);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { defineCustomElements };
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-49de5c89.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name isMobile
|
|
5
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
6
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
7
|
+
* @returns {Boolean} true or false
|
|
8
|
+
*/
|
|
9
|
+
const isMobile = (userAgent) => {
|
|
10
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
11
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
12
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
13
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
17
|
+
const TRANSLATIONS = {
|
|
18
|
+
en: {
|
|
19
|
+
firstPage: 'First',
|
|
20
|
+
previousPage: 'Previous',
|
|
21
|
+
nextPage: 'Next',
|
|
22
|
+
lastPage: 'Last'
|
|
23
|
+
},
|
|
24
|
+
ro: {
|
|
25
|
+
firstPage: 'Prima',
|
|
26
|
+
previousPage: 'Anterior',
|
|
27
|
+
nextPage: 'Urmatoarea',
|
|
28
|
+
lastPage: 'Ultima'
|
|
29
|
+
},
|
|
30
|
+
fr: {
|
|
31
|
+
firstPage: 'First',
|
|
32
|
+
previousPage: 'Previous',
|
|
33
|
+
nextPage: 'Next',
|
|
34
|
+
lastPage: 'Last'
|
|
35
|
+
},
|
|
36
|
+
ar: {
|
|
37
|
+
firstPage: 'First',
|
|
38
|
+
previousPage: 'Previous',
|
|
39
|
+
nextPage: 'Next',
|
|
40
|
+
lastPage: 'Last'
|
|
41
|
+
},
|
|
42
|
+
hu: {
|
|
43
|
+
firstPage: 'First',
|
|
44
|
+
previousPage: 'Previous',
|
|
45
|
+
nextPage: 'Következő',
|
|
46
|
+
lastPage: 'Last'
|
|
47
|
+
},
|
|
48
|
+
hr: {
|
|
49
|
+
firstPage: 'Prva',
|
|
50
|
+
previousPage: 'Prethodna',
|
|
51
|
+
nextPage: 'Slijedeća',
|
|
52
|
+
lastPage: 'Zadnja'
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const translate = (key, customLang) => {
|
|
56
|
+
const lang = customLang;
|
|
57
|
+
return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const lotteryPaginationCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:var(--emw--color-background, #009993);border-color:var(--emw--color-typography, #009993)}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:var(--emw--button-text-color, #000);cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:var(--emw--color-background, #009993);border-color:var(--emw--color-typography, #009993);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:var(--emw--color-background, #009993);border-color:var(--emw--color-typography, #009993);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));opacity:0.8}button{width:100px;height:32px;border:1px solid var(--emw--color-gray-transparency-30, #524e52);border-radius:5px;background:var(--emw--color-gray-transparency-30, #524e52);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:var(--emw--color-primary-variant, #004D4A);border-color:var(--emw--color-primary-variant, #004D4A)}button:disabled{background-color:var(--emw--color-gray-transparency-80, #ccc);border-color:var(--emw--color-gray-transparency-80, #ccc);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:14px}}@media screen and (max-width: 480px){button{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:var(--emw--color-background, #009993);border-color:var(--emw--color-typography, #009993);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}}";
|
|
61
|
+
const LotteryPaginationStyle0 = lotteryPaginationCss;
|
|
62
|
+
|
|
63
|
+
const LotteryPagination = class {
|
|
64
|
+
constructor(hostRef) {
|
|
65
|
+
registerInstance(this, hostRef);
|
|
66
|
+
this.hpPageChange = createEvent(this, "hpPageChange", 7);
|
|
67
|
+
this.userAgent = window.navigator.userAgent;
|
|
68
|
+
this.currentPage = 1;
|
|
69
|
+
/**
|
|
70
|
+
* Navigation logic
|
|
71
|
+
*/
|
|
72
|
+
this.navigateTo = (navigationPage) => {
|
|
73
|
+
switch (navigationPage) {
|
|
74
|
+
case 'firstPage':
|
|
75
|
+
this.offsetInt = 0;
|
|
76
|
+
break;
|
|
77
|
+
case 'lastPage':
|
|
78
|
+
this.offsetInt = this.endInt * this.limitInt;
|
|
79
|
+
break;
|
|
80
|
+
case 'previousPage':
|
|
81
|
+
this.offsetInt -= this.limitInt;
|
|
82
|
+
this.nextPage = true;
|
|
83
|
+
break;
|
|
84
|
+
case 'nextPage':
|
|
85
|
+
this.offsetInt += this.limitInt;
|
|
86
|
+
// this.nextPage = this.currentPage > this.endInt ? false : this.nextPage;
|
|
87
|
+
this.nextPage = this.offsetInt / this.limitInt >= this.endInt ? false : this.nextPage;
|
|
88
|
+
break;
|
|
89
|
+
case 'fivePagesBack':
|
|
90
|
+
this.offsetInt -= this.limitInt * 5;
|
|
91
|
+
this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;
|
|
92
|
+
break;
|
|
93
|
+
case 'fivePagesForward':
|
|
94
|
+
this.offsetInt += this.limitInt * 5;
|
|
95
|
+
this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;
|
|
96
|
+
this.nextPage = this.offsetInt / this.limitInt >= this.endInt ? false : this.nextPage;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
this.previousPage = !this.offsetInt ? false : true;
|
|
100
|
+
this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Handle navigation from here
|
|
104
|
+
*/
|
|
105
|
+
this.paginationNavigation = (pageNumber, index) => {
|
|
106
|
+
if (!isNaN(pageNumber)) {
|
|
107
|
+
if (pageNumber === 1) {
|
|
108
|
+
this.offsetInt = pageNumber - 1;
|
|
109
|
+
this.previousPage = false;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.offsetInt = (pageNumber - 1) * this.limitInt;
|
|
113
|
+
if (pageNumber > this.endInt) {
|
|
114
|
+
this.nextPage = false;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
this.nextPage = true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
if (index === 0 && this.currentPage <= 4) {
|
|
124
|
+
this.navigateTo('firstPage');
|
|
125
|
+
}
|
|
126
|
+
else if (index === 0 && this.currentPage > 4) {
|
|
127
|
+
this.navigateTo('fivePagesBack');
|
|
128
|
+
}
|
|
129
|
+
else if (index === 4 && this.endInt - this.currentPage >= 2) {
|
|
130
|
+
this.navigateTo('fivePagesForward');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
this.setClientStyling = () => {
|
|
135
|
+
let sheet = document.createElement('style');
|
|
136
|
+
sheet.innerHTML = this.clientStyling;
|
|
137
|
+
this.stylingContainer.prepend(sheet);
|
|
138
|
+
};
|
|
139
|
+
this.setClientStylingURL = () => {
|
|
140
|
+
let cssFile = document.createElement('style');
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
143
|
+
this.stylingContainer.prepend(cssFile);
|
|
144
|
+
}, 1);
|
|
145
|
+
};
|
|
146
|
+
this.nextPage = false;
|
|
147
|
+
this.prevPage = false;
|
|
148
|
+
this.offset = 0;
|
|
149
|
+
this.limit = 10;
|
|
150
|
+
this.total = 1;
|
|
151
|
+
this.language = 'en';
|
|
152
|
+
this.clientStyling = '';
|
|
153
|
+
this.clientStylingUrlContent = '';
|
|
154
|
+
this.arrowsActive = undefined;
|
|
155
|
+
this.secondaryArrowsActive = undefined;
|
|
156
|
+
this.numberedNavActive = undefined;
|
|
157
|
+
this.isReset = false;
|
|
158
|
+
this.offsetInt = undefined;
|
|
159
|
+
this.lastPage = false;
|
|
160
|
+
this.previousPage = false;
|
|
161
|
+
this.limitInt = undefined;
|
|
162
|
+
this.totalInt = undefined;
|
|
163
|
+
this.pagesArray = [];
|
|
164
|
+
this.endInt = 0;
|
|
165
|
+
this.limitStylingAppends = false;
|
|
166
|
+
}
|
|
167
|
+
componentWillRender() {
|
|
168
|
+
this.offsetInt = this.offset;
|
|
169
|
+
this.limitInt = this.limit;
|
|
170
|
+
this.nextPage = this.isReset ? true : this.nextPage;
|
|
171
|
+
this.currentPage = (this.offsetInt / this.limitInt) + 1;
|
|
172
|
+
this.limitInt = this.limit;
|
|
173
|
+
this.totalInt = this.total;
|
|
174
|
+
this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
|
|
175
|
+
this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
|
|
176
|
+
/**
|
|
177
|
+
* Construct numbered navigation area based on current page position
|
|
178
|
+
*/
|
|
179
|
+
if (this.currentPage == 1 || this.currentPage == 2) {
|
|
180
|
+
if (this.endInt > 3) {
|
|
181
|
+
this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
|
|
182
|
+
this.pagesArray.push('...');
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
this.pagesArray = Array.from({ length: this.endInt + 1 }, (_, i) => i + 1);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
|
|
189
|
+
this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
|
|
190
|
+
this.pagesArray.push('...');
|
|
191
|
+
this.pagesArray.unshift('...');
|
|
192
|
+
}
|
|
193
|
+
else if ((this.endInt - this.currentPage) < 3) {
|
|
194
|
+
if (this.endInt > 4) {
|
|
195
|
+
this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
|
|
196
|
+
this.pagesArray.unshift('...');
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
this.pagesArray = Array.from({ length: this.endInt + 1 }, (_, i) => i + 1);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
componentDidRender() {
|
|
204
|
+
this.isReset = false;
|
|
205
|
+
// start custom styling area
|
|
206
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
207
|
+
if (this.clientStyling)
|
|
208
|
+
this.setClientStyling();
|
|
209
|
+
if (this.clientStylingUrlContent)
|
|
210
|
+
this.setClientStylingURL();
|
|
211
|
+
this.limitStylingAppends = true;
|
|
212
|
+
}
|
|
213
|
+
// end custom styling area
|
|
214
|
+
}
|
|
215
|
+
render() {
|
|
216
|
+
/**
|
|
217
|
+
* Center navigation area
|
|
218
|
+
*/
|
|
219
|
+
let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
|
|
220
|
+
return (h("li", { class: 'PaginationItem' + (item === this.currentPage ? ' ActiveItem' : ' ') + ' ' + (isMobile(this.userAgent) ? 'MobileButtons' : '') }, h("button", { disabled: item === this.currentPage ? true : false, onClick: this.paginationNavigation.bind(this, item, index) }, h("span", null, item))));
|
|
221
|
+
}));
|
|
222
|
+
/**
|
|
223
|
+
* Left navigation area
|
|
224
|
+
*/
|
|
225
|
+
let buttonSecondaryLeftSide = h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'firstPage') }, h("span", { class: "NavigationButton" }, translate('firstPage', this.language)), h("span", { class: "NavigationIcon" }));
|
|
226
|
+
let buttonsLeftSide = h("div", { class: "LeftItems" }, this.secondaryArrowsActive && buttonSecondaryLeftSide, h("button", { disabled: this.prevPage && this.currentPage !== 1 ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') }, h("span", { class: "NavigationButton" }, translate('previousPage', this.language)), h("span", { class: "NavigationIcon" })));
|
|
227
|
+
if (isMobile(this.userAgent)) {
|
|
228
|
+
buttonsLeftSide =
|
|
229
|
+
h("div", { class: "LeftItems" }, h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') }, h("span", { class: "NavigationButton" }, translate('previousPage', this.language)), h("span", { class: "NavigationIcon" })));
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Right navigation area
|
|
233
|
+
*/
|
|
234
|
+
let buttonSecondaryRightSide = h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'lastPage') }, h("span", { class: "NavigationButton" }, translate('lastPage', this.language)), h("span", { class: "NavigationIcon" }));
|
|
235
|
+
let buttonsRightSide = h("div", { class: "RightItems" }, h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') }, h("span", { class: "NavigationButton" }, translate('nextPage', this.language)), h("span", { class: "NavigationIcon" })), this.secondaryArrowsActive && buttonSecondaryRightSide);
|
|
236
|
+
if (isMobile(this.userAgent)) {
|
|
237
|
+
buttonsRightSide =
|
|
238
|
+
h("div", { class: "RightItems" }, h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') }, h("span", { class: "NavigationButton" }, translate('nextPage', this.language)), h("span", { class: "NavigationIcon" })));
|
|
239
|
+
}
|
|
240
|
+
return (h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el }, this.arrowsActive && buttonsLeftSide, this.numberedNavActive && navigationArea, this.arrowsActive && buttonsRightSide));
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
LotteryPagination.style = LotteryPaginationStyle0;
|
|
244
|
+
|
|
245
|
+
export { LotteryPagination as L };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-49de5c89.js';
|
|
2
|
+
export { s as setNonce } from './index-49de5c89.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
var patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== "") {
|
|
12
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(async (options) => {
|
|
18
|
+
await globalScripts();
|
|
19
|
+
return bootstrapLazy([["lottery-pagination",[[1,"lottery-pagination",{"nextPage":[1540,"next-page"],"prevPage":[1540,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"clientStyling":[1537,"client-styling"],"clientStylingUrlContent":[1537,"client-styling-url-content"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"isReset":[1540,"is-reset"],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32],"limitStylingAppends":[32]}]]]], options);
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './esm/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{L as LotteryPagination}from"./p-9e29d391.js";import"./p-ce0101e8.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,b as t}from"./p-ce0101e8.js";export{s as setNonce}from"./p-ce0101e8.js";import{g as a}from"./p-e1255160.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((async e=>(await a(),t([["p-e0782a32",[[1,"lottery-pagination",{nextPage:[1540,"next-page"],prevPage:[1540,"prev-page"],offset:[1538],limit:[1538],total:[1538],language:[1537],clientStyling:[1537,"client-styling"],clientStylingUrlContent:[1537,"client-styling-url-content"],arrowsActive:[1540,"arrows-active"],secondaryArrowsActive:[1540,"secondary-arrows-active"],numberedNavActive:[1540,"numbered-nav-active"],isReset:[1540,"is-reset"],offsetInt:[32],lastPage:[32],previousPage:[32],limitInt:[32],totalInt:[32],pagesArray:[32],endInt:[32],limitStylingAppends:[32]}]]]],e))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s}from"./p-ce0101e8.js";const a=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),e={en:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ro:{firstPage:"Prima",previousPage:"Anterior",nextPage:"Urmatoarea",lastPage:"Ultima"},fr:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ar:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},hu:{firstPage:"First",previousPage:"Previous",nextPage:"Következő",lastPage:"Last"},hr:{firstPage:"Prva",previousPage:"Prethodna",nextPage:"Slijedeća",lastPage:"Zadnja"}},o=(t,i)=>e[void 0!==i&&i in e?i:"en"][t],r=class{constructor(s){t(this,s),this.hpPageChange=i(this,"hpPageChange",7),this.userAgent=window.navigator.userAgent,this.currentPage=1,this.navigateTo=t=>{switch(t){case"firstPage":this.offsetInt=0;break;case"lastPage":this.offsetInt=this.endInt*this.limitInt;break;case"previousPage":this.offsetInt-=this.limitInt,this.nextPage=!0;break;case"nextPage":this.offsetInt+=this.limitInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage;break;case"fivePagesBack":this.offsetInt-=5*this.limitInt,this.offsetInt=this.offsetInt<=0?0:this.offsetInt;break;case"fivePagesForward":this.offsetInt+=5*this.limitInt,this.offsetInt=this.offsetInt/this.limitInt>=this.endInt?this.endInt*this.limitInt:this.offsetInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage}this.previousPage=!!this.offsetInt,this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.paginationNavigation=(t,i)=>{isNaN(t)?0===i&&this.currentPage<=4?this.navigateTo("firstPage"):0===i&&this.currentPage>4?this.navigateTo("fivePagesBack"):4===i&&this.endInt-this.currentPage>=2&&this.navigateTo("fivePagesForward"):(1===t?(this.offsetInt=t-1,this.previousPage=!1):(this.offsetInt=(t-1)*this.limitInt,this.nextPage=!(t>this.endInt)),this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt}))},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.nextPage=!1,this.prevPage=!1,this.offset=0,this.limit=10,this.total=1,this.language="en",this.clientStyling="",this.clientStylingUrlContent="",this.arrowsActive=void 0,this.secondaryArrowsActive=void 0,this.numberedNavActive=void 0,this.isReset=!1,this.offsetInt=void 0,this.lastPage=!1,this.previousPage=!1,this.limitInt=void 0,this.totalInt=void 0,this.pagesArray=[],this.endInt=0,this.limitStylingAppends=!1}componentWillRender(){this.offsetInt=this.offset,this.limitInt=this.limit,this.nextPage=!!this.isReset||this.nextPage,this.currentPage=this.offsetInt/this.limitInt+1,this.limitInt=this.limit,this.totalInt=this.total,this.endInt=Math.ceil(this.totalInt/this.limitInt)-1,this.lastPage=!(this.offsetInt>=this.endInt*this.limitInt),1==this.currentPage||2==this.currentPage?this.endInt>3?(this.pagesArray=Array.from({length:4},((t,i)=>i+1)),this.pagesArray.push("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,i)=>i+1)):this.currentPage>=3&&this.endInt-this.currentPage>=2?(this.pagesArray=Array.from({length:3},((t,i)=>this.currentPage+i-1)),this.pagesArray.push("..."),this.pagesArray.unshift("...")):this.endInt-this.currentPage<3&&(this.endInt>4?(this.pagesArray=Array.from({length:4},((t,i)=>this.endInt-2+i)),this.pagesArray.unshift("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,i)=>i+1)))}componentDidRender(){this.isReset=!1,!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){let t=s("ul",{class:"PaginationArea"},this.pagesArray.map(((t,i)=>s("li",{class:"PaginationItem"+(t===this.currentPage?" ActiveItem":" ")+" "+(a(this.userAgent)?"MobileButtons":"")},s("button",{disabled:t===this.currentPage,onClick:this.paginationNavigation.bind(this,t,i)},s("span",null,t)))))),i=s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"firstPage")},s("span",{class:"NavigationButton"},o("firstPage",this.language)),s("span",{class:"NavigationIcon"})),e=s("div",{class:"LeftItems"},this.secondaryArrowsActive&&i,s("button",{disabled:!this.prevPage||1===this.currentPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},o("previousPage",this.language)),s("span",{class:"NavigationIcon"})));a(this.userAgent)&&(e=s("div",{class:"LeftItems"},s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},o("previousPage",this.language)),s("span",{class:"NavigationIcon"}))));let r=s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"lastPage")},s("span",{class:"NavigationButton"},o("lastPage",this.language)),s("span",{class:"NavigationIcon"})),n=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},o("nextPage",this.language)),s("span",{class:"NavigationIcon"})),this.secondaryArrowsActive&&r);return a(this.userAgent)&&(n=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},o("nextPage",this.language)),s("span",{class:"NavigationIcon"})))),s("div",{id:"PaginationContainer",ref:t=>this.stylingContainer=t},this.arrowsActive&&e,this.numberedNavActive&&t,this.arrowsActive&&n)}};r.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:var(--emw--color-background, #009993);border-color:var(--emw--color-typography, #009993)}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:var(--emw--button-text-color, #000);cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:var(--emw--color-background, #009993);border-color:var(--emw--color-typography, #009993);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:var(--emw--color-background, #009993);border-color:var(--emw--color-typography, #009993);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));opacity:0.8}button{width:100px;height:32px;border:1px solid var(--emw--color-gray-transparency-30, #524e52);border-radius:5px;background:var(--emw--color-gray-transparency-30, #524e52);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:var(--emw--color-primary-variant, #004D4A);border-color:var(--emw--color-primary-variant, #004D4A)}button:disabled{background-color:var(--emw--color-gray-transparency-80, #ccc);border-color:var(--emw--color-gray-transparency-80, #ccc);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:14px}}@media screen and (max-width: 480px){button{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:var(--emw--color-background, #009993);border-color:var(--emw--color-typography, #009993);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}}';export{r as L}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",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)},h=e=>Promise.resolve(e),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,d=[],y=[],$=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&f.l?v(b):f.raf(b))},w=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},b=()=>{w(d),w(y),(m=d.length>0)&&f.raf(b)},v=e=>h().then(e),S=$(y,!0),g={},j=e=>"object"==(e=typeof e)||"function"===e;function E(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>k,map:()=>C,ok:()=>O,unwrap:()=>x,unwrapErr:()=>P});var O=e=>({isOk:!0,isErr:!1,value:e}),k=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return k(e.value);throw"should never get here"}var M,x=e=>{if(e.isOk)return e.value;throw e.value},P=e=>{if(e.isErr)return e.value;throw e.value},R=(e,t,...n)=>{let l=null,o=!1,s=!1;const r=[],i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!j(l))&&(l+=""),o&&s?r[r.length-1].i+=l:r.push(o?A(null,l):l),s=o)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=A(e,null);return c.u=t,r.length>0&&(c.h=r),c},A=(e,t)=>({l:0,p:e,i:t,m:null,h:null,u:null}),D={},H=(e,t,l)=>{const o=(e=>n(e).$hostElement$)(e);return{emit:e=>T(o,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},T=(e,t,n)=>{const l=f.ce(t,n);return e.dispatchEvent(l),l},F=new WeakMap,N=e=>"sc-"+e.$,U=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=L(n),s=L(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||("function"==typeof e.__lookupSetter__(t)?e[t]=o:e.setAttribute(t,o))}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(q);t=t.replace(G,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},W=/\s/,L=e=>e?e.split(W):[],q="Capture",G=RegExp(q+"$"),V=(e,t,n)=>{const l=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||g,s=t.u||g;for(const e of _(Object.keys(o)))e in s||U(l,e,o[e],void 0,n,t.l);for(const e of _(Object.keys(s)))U(l,e,o[e],s[e],n,t.l)};function _(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var z=!1,B=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.m=a.createTextNode(l.i);else if(o=l.m=a.createElement(l.p),V(null,l,z),o.getRootNode().querySelector("body"),l.h)for(r=0;r<l.h.length;++r)s=B(e,l,r),s&&o.appendChild(s);return o["s-hn"]=M,o},I=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=B(null,n,o),r&&(l[o].m=r,Y(i,r,t)))},J=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.m;X(t),e&&e.remove()}}},K=(e,t)=>e.p===t.p,Q=(e,t,n=!1)=>{const l=t.m=e.m,o=e.h,s=t.h,r=t.i;null===r?(V(e,t,z),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r=0,i=0,c=t.length-1,u=t[0],a=t[c],f=l.length-1,h=l[0],p=l[f];for(;r<=c&&i<=f;)null==u?u=t[++r]:null==a?a=t[--c]:null==h?h=l[++i]:null==p?p=l[--f]:K(u,h)?(Q(u,h,o),u=t[++r],h=l[++i]):K(a,p)?(Q(a,p,o),a=t[--c],p=l[--f]):K(u,p)?(Q(u,p,o),Y(e,u.m,a.m.nextSibling),u=t[++r],p=l[--f]):K(a,h)?(Q(a,h,o),Y(e,a.m,u.m),a=t[--c],h=l[++i]):(s=B(t&&t[i],n,i),h=l[++i],s&&Y(u.m.parentNode,s,u.m));r>c?I(e,null==l[f+1]?null:l[f+1].m,n,l,i,f):i>f&&J(t,r,c)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),I(l,null,t,s,0,s.length-1)):!n&&null!==o&&J(o,0,o.length-1)):e.i!==r&&(l.data=r)},X=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(X)},Y=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Z=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},ee=(e,t)=>{if(e.l|=16,!(4&e.l))return Z(e,e.S),S((()=>te(e,t)));e.l|=512},te=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=ne(l,(()=>ce(n,"componentWillRender"))),ne(l,(()=>oe(e,n,t)))},ne=(e,t)=>le(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),le=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,oe=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.j,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=N(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=F.get(e=e.head||e);if(r||F.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const l=null!=(n=f.O)?n:E(a);if(null!=l&&s.setAttribute("nonce",l),!(1&t.l))if("HEAD"===e.nodeName){const t=e.querySelectorAll("link[rel=preconnect]"),n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(s,n)}else if("host"in e)if(p){const t=new CSSStyleSheet;t.replaceSync(o),e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");t?t.innerHTML=o+t.innerHTML:e.prepend(s)}else e.append(s);1&t.l&&"HEAD"!==e.nodeName&&e.insertBefore(s,null)}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&2&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);se(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>re(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},se=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.j,s=e.k||A(null,null),r=(e=>e&&e.p===D)(t)?t:R(null,null,t);if(M=l.tagName,o.C&&(r.u=r.u||{},o.C.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.p=null,r.l|=4,e.k=r,r.m=s.m=l.shadowRoot||l,Q(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},re=e=>{const t=e.$hostElement$,n=e.S;ce(e.t,"componentDidRender"),64&e.l||(e.l|=64,ue(t),e.M(t),n||ie()),e.v&&(e.v(),e.v=void 0),512&e.l&&v((()=>ee(e,!1))),e.l&=-517},ie=()=>{ue(a.documentElement),v((()=>T(u,"appload",{detail:{namespace:"lottery-pagination"}})))},ce=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ue=e=>e.classList.add("hydrated"),ae=(e,t,l)=>{var o,s;const r=e.prototype;if(t.P){const i=Object.entries(null!=(o=t.P)?o:{});if(i.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(r,e,{get(){return((e,t)=>n(this).R.get(t))(0,e)},set(l){((e,t,l,o)=>{const s=n(e);if(!s)throw Error(`Couldn't find host element for "${o.$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const r=s.R.get(t),i=s.l,c=s.t;l=((e,t)=>null==e||j(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,o.P[t][0]),8&i&&void 0!==r||l===r||Number.isNaN(r)&&Number.isNaN(l)||(s.R.set(t,l),c&&2==(18&i)&&ee(s,!1))})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;r.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var i;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),r=null==l?void 0:l.l;if(r&&!(8&r)&&128&r&&s!==o){const n=l.t,r=null==(i=t.A)?void 0:i[e];null==r||r.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=t.A)?s:{}),...i.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.C)||o.push([e,s])),s}))]))}}return e},fe=(e,l={})=>{var o;const h=[],m=l.exclude||[],d=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),w=a.createElement("style"),b=[];let v,S=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let g=!1;if(e.map((e=>{e[1].map((l=>{const o={l:l[0],$:l[1],P:l[2],D:l[3]};4&o.l&&(g=!0),o.P=l[2],o.C=[];const c=o.$,u=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,j:n,R:new Map};l.H=new Promise((e=>l.M=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,o),1&o.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${o.$}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),S?b.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.j,o=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.H)&&t.H.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){Z(t,t.S=n);break}}l.P&&Object.entries(l.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.T){const e=(e=>{const t=e.$.replace(/-/g,"_"),n=e.T;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.$}#${t.F}" was not found`);l.isProxied||(ae(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,o()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=N(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);p&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.S,c=()=>ee(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)||(null==e?void 0:e.H)&&e.H.then((()=>{}))}})()))}componentOnReady(){return n(this).H}};o.T=e[0],m.includes(c)||d.get(c)||(h.push(c),d.define(c,ae(u,o,1)))}))})),h.length>0&&(g&&(w.textContent+=c),w.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",w.innerHTML.length)){w.setAttribute("data-styles","");const e=null!=(o=f.O)?o:E(a);null!=e&&w.setAttribute("nonce",e),y.insertBefore(w,$?$.nextSibling:y.firstChild)}S=!1,b.length?b.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(ie,30)))},he=e=>f.O=e;export{fe as b,H as c,R as h,h as p,l as r,he as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{L as lottery_pagination}from"./p-9e29d391.js";import"./p-ce0101e8.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'lottery-pagination',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'www'
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'lottery-pagination',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'dist',
|
|
14
|
+
esmLoaderPath: '../loader'
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as path from "path";
|
|
2
|
+
const config = {
|
|
3
|
+
stories: ['../**/*.@(mdx|stories.@(js|ts|tsx))'],
|
|
4
|
+
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', 'storybook-dark-mode'],
|
|
5
|
+
docs: {
|
|
6
|
+
defaultName: 'Documentation',
|
|
7
|
+
autodocs: 'tag'
|
|
8
|
+
},
|
|
9
|
+
framework: {
|
|
10
|
+
name: '@storybook/web-components-vite',
|
|
11
|
+
options: {}
|
|
12
|
+
},
|
|
13
|
+
viteFinal: async (config) => {
|
|
14
|
+
return Object.assign(Object.assign({}, config), { resolve: {
|
|
15
|
+
alias: {
|
|
16
|
+
'lottery-pagination': path.resolve(__dirname, '../../../../dist/packages/stencil/lottery-pagination')
|
|
17
|
+
}
|
|
18
|
+
} });
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default config;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { themes } from "@storybook/theming";
|
|
2
|
+
export const parameters = {
|
|
3
|
+
darkMode: {
|
|
4
|
+
dark: Object.assign(Object.assign({}, themes.dark), { appBg: 'black' }),
|
|
5
|
+
light: Object.assign(Object.assign({}, themes.normal), { appBg: 'green' }),
|
|
6
|
+
current: 'light',
|
|
7
|
+
stylePreview: true
|
|
8
|
+
}
|
|
9
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const parameters: {
|
|
2
|
+
darkMode: {
|
|
3
|
+
dark: {
|
|
4
|
+
appBg: string;
|
|
5
|
+
base: "light" | "dark";
|
|
6
|
+
colorPrimary: string;
|
|
7
|
+
colorSecondary: string;
|
|
8
|
+
appContentBg: string;
|
|
9
|
+
appPreviewBg: string;
|
|
10
|
+
appBorderColor: string;
|
|
11
|
+
appBorderRadius: number;
|
|
12
|
+
fontBase: string;
|
|
13
|
+
fontCode: string;
|
|
14
|
+
textColor: string;
|
|
15
|
+
textInverseColor: string;
|
|
16
|
+
textMutedColor: string;
|
|
17
|
+
barTextColor: string;
|
|
18
|
+
barHoverColor: string;
|
|
19
|
+
barSelectedColor: string;
|
|
20
|
+
barBg: string;
|
|
21
|
+
buttonBg: string;
|
|
22
|
+
buttonBorder: string;
|
|
23
|
+
booleanBg: string;
|
|
24
|
+
booleanSelectedBg: string;
|
|
25
|
+
inputBg: string;
|
|
26
|
+
inputBorder: string;
|
|
27
|
+
inputTextColor: string;
|
|
28
|
+
inputBorderRadius: number;
|
|
29
|
+
brandTitle?: string;
|
|
30
|
+
brandUrl?: string;
|
|
31
|
+
brandImage?: string;
|
|
32
|
+
brandTarget?: string;
|
|
33
|
+
gridCellSize?: number;
|
|
34
|
+
};
|
|
35
|
+
light: {
|
|
36
|
+
appBg: string;
|
|
37
|
+
base: "light" | "dark";
|
|
38
|
+
colorPrimary: string;
|
|
39
|
+
colorSecondary: string;
|
|
40
|
+
appContentBg: string;
|
|
41
|
+
appPreviewBg: string;
|
|
42
|
+
appBorderColor: string;
|
|
43
|
+
appBorderRadius: number;
|
|
44
|
+
fontBase: string;
|
|
45
|
+
fontCode: string;
|
|
46
|
+
textColor: string;
|
|
47
|
+
textInverseColor: string;
|
|
48
|
+
textMutedColor: string;
|
|
49
|
+
barTextColor: string;
|
|
50
|
+
barHoverColor: string;
|
|
51
|
+
barSelectedColor: string;
|
|
52
|
+
barBg: string;
|
|
53
|
+
buttonBg: string;
|
|
54
|
+
buttonBorder: string;
|
|
55
|
+
booleanBg: string;
|
|
56
|
+
booleanSelectedBg: string;
|
|
57
|
+
inputBg: string;
|
|
58
|
+
inputBorder: string;
|
|
59
|
+
inputTextColor: string;
|
|
60
|
+
inputBorderRadius: number;
|
|
61
|
+
brandTitle?: string;
|
|
62
|
+
brandUrl?: string;
|
|
63
|
+
brandImage?: string;
|
|
64
|
+
brandTarget?: string;
|
|
65
|
+
gridCellSize?: number;
|
|
66
|
+
};
|
|
67
|
+
current: string;
|
|
68
|
+
stylePreview: boolean;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LotteryPagination } from './lottery-pagination';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class LotteryPagination {
|
|
3
|
+
/**
|
|
4
|
+
* Next page string value - determines if the next page is disabled or active
|
|
5
|
+
*/
|
|
6
|
+
nextPage: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Previous page string value - determines if the previous page is disabled or active
|
|
9
|
+
*/
|
|
10
|
+
prevPage: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The received offset
|
|
13
|
+
*/
|
|
14
|
+
offset: number;
|
|
15
|
+
/**
|
|
16
|
+
* The received limit for the number of pages
|
|
17
|
+
*/
|
|
18
|
+
limit: number;
|
|
19
|
+
/**
|
|
20
|
+
* The received total number of pages
|
|
21
|
+
*/
|
|
22
|
+
total: number;
|
|
23
|
+
/**
|
|
24
|
+
* Language
|
|
25
|
+
*/
|
|
26
|
+
language: string;
|
|
27
|
+
/**
|
|
28
|
+
* Client custom styling via string
|
|
29
|
+
*/
|
|
30
|
+
clientStyling: string;
|
|
31
|
+
/**
|
|
32
|
+
* Client custom styling via url content
|
|
33
|
+
*/
|
|
34
|
+
clientStylingUrlContent: string;
|
|
35
|
+
/**
|
|
36
|
+
* Customize pagination: Activate pagination arrows
|
|
37
|
+
*/
|
|
38
|
+
arrowsActive: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Customize pagination: Activate pagination secondary arrows
|
|
41
|
+
*/
|
|
42
|
+
secondaryArrowsActive: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Customize pagination: Activate pagination numbered navigation
|
|
45
|
+
*/
|
|
46
|
+
numberedNavActive: boolean;
|
|
47
|
+
isReset: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Component working variable for offset
|
|
50
|
+
*/
|
|
51
|
+
private offsetInt;
|
|
52
|
+
/**
|
|
53
|
+
* Component working variable for last page
|
|
54
|
+
*/
|
|
55
|
+
lastPage: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Component working variable for prvious page
|
|
58
|
+
*/
|
|
59
|
+
previousPage: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Component working variable for limit
|
|
62
|
+
*/
|
|
63
|
+
private limitInt;
|
|
64
|
+
/**
|
|
65
|
+
* Component working variable for total
|
|
66
|
+
*/
|
|
67
|
+
private totalInt;
|
|
68
|
+
/**
|
|
69
|
+
* In component working variable for the array of pages
|
|
70
|
+
*/
|
|
71
|
+
private pagesArray;
|
|
72
|
+
/**
|
|
73
|
+
* In component working variable for last page
|
|
74
|
+
*/
|
|
75
|
+
private endInt;
|
|
76
|
+
private userAgent;
|
|
77
|
+
currentPage: number;
|
|
78
|
+
/**
|
|
79
|
+
* Event that handles the navigation, updating the offset, limit and total values
|
|
80
|
+
*/
|
|
81
|
+
hpPageChange: EventEmitter<any>;
|
|
82
|
+
private limitStylingAppends;
|
|
83
|
+
private stylingContainer;
|
|
84
|
+
/**
|
|
85
|
+
* Navigation logic
|
|
86
|
+
*/
|
|
87
|
+
navigateTo: (navigationPage: string) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Handle navigation from here
|
|
90
|
+
*/
|
|
91
|
+
paginationNavigation: (pageNumber: number, index: any) => void;
|
|
92
|
+
componentWillRender(): void;
|
|
93
|
+
componentDidRender(): void;
|
|
94
|
+
setClientStyling: () => void;
|
|
95
|
+
setClientStylingURL: () => void;
|
|
96
|
+
render(): any;
|
|
97
|
+
}
|