@everymatrix/lottery-tipping-ticket-history 0.0.1

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 (81) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/general-multi-select_10.cjs.entry.js +9635 -0
  3. package/dist/cjs/index-4ef2d32a.js +1380 -0
  4. package/dist/cjs/index.cjs.js +10 -0
  5. package/dist/cjs/loader.cjs.js +15 -0
  6. package/dist/cjs/lottery-tipping-ticket-history-e9d19600.js +2915 -0
  7. package/dist/cjs/lottery-tipping-ticket-history.cjs.js +25 -0
  8. package/dist/collection/collection-manifest.json +42 -0
  9. package/dist/collection/components/lottery-tipping-filter/index.js +1 -0
  10. package/dist/collection/components/lottery-tipping-filter/lottery-tipping-filter.css +42 -0
  11. package/dist/collection/components/lottery-tipping-filter/lottery-tipping-filter.js +333 -0
  12. package/dist/collection/components/lottery-tipping-pagination/index.js +1 -0
  13. package/dist/collection/components/lottery-tipping-pagination/lottery-tipping-pagination.css +70 -0
  14. package/dist/collection/components/lottery-tipping-pagination/lottery-tipping-pagination.js +336 -0
  15. package/dist/collection/components/lottery-tipping-panel/index.js +1 -0
  16. package/dist/collection/components/lottery-tipping-panel/lottery-tipping-panel.css +58 -0
  17. package/dist/collection/components/lottery-tipping-panel/lottery-tipping-panel.js +152 -0
  18. package/dist/collection/components/lottery-tipping-ticket-history/index.js +1 -0
  19. package/dist/collection/components/lottery-tipping-ticket-history/lottery-tipping-ticket-history.css +232 -0
  20. package/dist/collection/components/lottery-tipping-ticket-history/lottery-tipping-ticket-history.js +625 -0
  21. package/dist/collection/index.js +1 -0
  22. package/dist/collection/models/index.js +5 -0
  23. package/dist/collection/utils/locale.utils.js +127 -0
  24. package/dist/collection/utils/utils.js +177 -0
  25. package/dist/esm/app-globals-0f993ce5.js +3 -0
  26. package/dist/esm/general-multi-select_10.entry.js +9623 -0
  27. package/dist/esm/index-e620a22a.js +1351 -0
  28. package/dist/esm/index.js +2 -0
  29. package/dist/esm/loader.js +11 -0
  30. package/dist/esm/lottery-tipping-ticket-history-0d11da88.js +2904 -0
  31. package/dist/esm/lottery-tipping-ticket-history.js +20 -0
  32. package/dist/index.cjs.js +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/lottery-tipping-ticket-history/app-globals-0f993ce5.js +1 -0
  35. package/dist/lottery-tipping-ticket-history/general-multi-select_10.entry.js +7975 -0
  36. package/dist/lottery-tipping-ticket-history/index-e620a22a.js +2 -0
  37. package/dist/lottery-tipping-ticket-history/index.esm.js +1 -0
  38. package/dist/lottery-tipping-ticket-history/lottery-tipping-ticket-history-0d11da88.js +1 -0
  39. package/dist/lottery-tipping-ticket-history/lottery-tipping-ticket-history.esm.js +1 -0
  40. package/dist/static/add.svg +8 -0
  41. package/dist/static/delete.svg +37 -0
  42. package/dist/static/dropdown.svg +2 -0
  43. package/dist/static/dropup.svg +1 -0
  44. package/dist/static/info.svg +6 -0
  45. package/dist/static/left-arrow.svg +15 -0
  46. package/dist/static/loading.svg +10 -0
  47. package/dist/static/right-arrow.svg +15 -0
  48. package/dist/stencil.config.dev.js +19 -0
  49. package/dist/stencil.config.js +19 -0
  50. package/dist/storybook/main.js +43 -0
  51. package/dist/storybook/preview.js +9 -0
  52. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  53. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/packages/stencil/lottery-tipping-ticket-history/stencil.config.d.ts +2 -0
  54. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/packages/stencil/lottery-tipping-ticket-history/stencil.config.dev.d.ts +2 -0
  55. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/packages/stencil/lottery-tipping-ticket-history/storybook/main.d.ts +3 -0
  56. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/packages/stencil/lottery-tipping-ticket-history/storybook/preview.d.ts +70 -0
  57. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/tools/plugins/index.d.ts +3 -0
  58. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  59. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  60. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  61. package/dist/types/components/lottery-tipping-filter/index.d.ts +1 -0
  62. package/dist/types/components/lottery-tipping-filter/lottery-tipping-filter.d.ts +43 -0
  63. package/dist/types/components/lottery-tipping-pagination/index.d.ts +1 -0
  64. package/dist/types/components/lottery-tipping-pagination/lottery-tipping-pagination.d.ts +29 -0
  65. package/dist/types/components/lottery-tipping-panel/index.d.ts +1 -0
  66. package/dist/types/components/lottery-tipping-panel/lottery-tipping-panel.d.ts +17 -0
  67. package/dist/types/components/lottery-tipping-ticket-history/index.d.ts +1 -0
  68. package/dist/types/components/lottery-tipping-ticket-history/lottery-tipping-ticket-history.d.ts +95 -0
  69. package/dist/types/components.d.ts +224 -0
  70. package/dist/types/index.d.ts +1 -0
  71. package/dist/types/models/index.d.ts +137 -0
  72. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  73. package/dist/types/utils/locale.utils.d.ts +2 -0
  74. package/dist/types/utils/utils.d.ts +10 -0
  75. package/loader/cdn.js +1 -0
  76. package/loader/index.cjs.js +1 -0
  77. package/loader/index.d.ts +24 -0
  78. package/loader/index.es2017.js +1 -0
  79. package/loader/index.js +2 -0
  80. package/loader/package.json +11 -0
  81. package/package.json +27 -0
@@ -0,0 +1,127 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ filter: 'Filter',
6
+ clear: 'Clear',
7
+ searchByTicketId: 'Search by Ticket ID',
8
+ enterTicketId: 'Enter Ticket ID',
9
+ searchByTicketType: 'Search by Ticket Type',
10
+ selectTicketType: 'Select Ticket Type',
11
+ searchByDate: 'Search by Date',
12
+ from: 'From',
13
+ to: 'To',
14
+ normal: 'Normal',
15
+ subscription: 'Subscription',
16
+ ticketsHistory: 'Tickets History',
17
+ settled: 'Settled',
18
+ purchased: 'Purchased',
19
+ canceled: 'Canceled',
20
+ noData: 'No data Avaliable.',
21
+ ticketId: 'Ticket ID:',
22
+ ticketType: 'Ticket Type:',
23
+ ticketAmount: 'Ticket Amount:',
24
+ lineDetail: 'Line Detail:',
25
+ seeDetails: 'See Details',
26
+ numberOfDraw: 'Number of Draw:',
27
+ ticketResult: 'Ticket Result:',
28
+ drawId: 'Draw ID:',
29
+ drawDate: 'Draw Date:',
30
+ result: 'Result:',
31
+ prize: 'Prize:',
32
+ bettingType: 'Betting Type:'
33
+ },
34
+ ro: {
35
+ ticketsHistory: 'Istoric bilete',
36
+ settled: 'Decontat',
37
+ purchased: 'Achiziționat',
38
+ canceled: 'Anulat',
39
+ noData: 'Nu sunt date disponibile.',
40
+ ticketId: 'ID bilet:',
41
+ ticketType: 'Tip bilet:',
42
+ ticketAmount: 'Suma biletului:',
43
+ lineDetail: 'Detaliu linie:',
44
+ seeDetails: 'Vezi detalii',
45
+ numberOfDraw: 'Număr de extrageri:',
46
+ ticketResult: 'Rezultat bilet:',
47
+ drawId: 'ID extragere:',
48
+ drawDate: 'Data extragerii:',
49
+ result: 'Rezultat:',
50
+ prize: 'Premiu:',
51
+ bettingType: 'Tip de pariu:'
52
+ },
53
+ fr: {
54
+ ticketsHistory: 'Historique des billets',
55
+ settled: 'Réglé',
56
+ purchased: 'Acheté',
57
+ canceled: 'Annulé',
58
+ noData: 'Aucune donnée disponible.',
59
+ ticketId: 'ID du billet:',
60
+ ticketType: 'Type de billet:',
61
+ ticketAmount: 'Montant du billet:',
62
+ lineDetail: 'Détail de la ligne:',
63
+ seeDetails: 'Voir les détails',
64
+ numberOfDraw: 'Nombre de tirages:',
65
+ ticketResult: 'Résultat du billet:',
66
+ drawId: 'ID du tirage:',
67
+ drawDate: 'Date du tirage:',
68
+ result: 'Résultat:',
69
+ prize: 'Prix:',
70
+ bettingType: 'Type de pari:'
71
+ },
72
+ ar: {
73
+ ticketsHistory: 'سجل التذاكر',
74
+ settled: 'تمت التسوية',
75
+ purchased: 'تم شراؤها',
76
+ canceled: 'تم الإلغاء',
77
+ noData: 'لا توجد بيانات متاحة.',
78
+ ticketId: 'معرف التذكرة:',
79
+ ticketType: 'نوع التذكرة:',
80
+ ticketAmount: 'مبلغ التذكرة:',
81
+ lineDetail: 'تفاصيل الخط:',
82
+ seeDetails: 'انظر التفاصيل',
83
+ numberOfDraw: 'عدد السحوبات:',
84
+ ticketResult: 'نتيجة التذكرة:',
85
+ drawId: 'معرف السحب:',
86
+ drawDate: 'تاريخ السحب:',
87
+ result: 'النتيجة:',
88
+ prize: 'الجائزة:',
89
+ bettingType: 'نوع الرهان:'
90
+ },
91
+ hr: {
92
+ ticketsHistory: 'Povijest listića',
93
+ settled: 'Riješeno',
94
+ purchased: 'Kupljeno',
95
+ canceled: 'Otkazano',
96
+ noData: 'Nema dostupnih podataka.',
97
+ ticketId: 'ID listića:',
98
+ ticketType: 'Vrsta listića:',
99
+ ticketAmount: 'Iznos listića:',
100
+ lineDetail: 'Detalji linije:',
101
+ seeDetails: 'Vidi detalje',
102
+ numberOfDraw: 'Broj izvlačenja:',
103
+ ticketResult: 'Rezultat listića:',
104
+ drawId: 'ID izvlačenja:',
105
+ drawDate: 'Datum izvlačenja:',
106
+ result: 'Rezultat:',
107
+ prize: 'Nagrada:',
108
+ bettingType: 'Vrsta oklade:'
109
+ }
110
+ };
111
+ export const translate = (key, customLang, replacements) => {
112
+ const lang = customLang;
113
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
114
+ if (replacements) {
115
+ Object.keys(replacements).forEach((placeholder) => {
116
+ translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
117
+ });
118
+ }
119
+ return translation;
120
+ };
121
+ export const getTranslations = (data) => {
122
+ Object.keys(data).forEach((item) => {
123
+ for (let key in data[item]) {
124
+ TRANSLATIONS[item][key] = data[item][key];
125
+ }
126
+ });
127
+ };
@@ -0,0 +1,177 @@
1
+ export function format(first, middle, last) {
2
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
+ }
4
+ export const generateUUID = () => {
5
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
6
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
7
+ return v.toString(16);
8
+ });
9
+ };
10
+ export function fetchRequest(url, method = 'GET', body = null, headers = {}) {
11
+ return new Promise((resolve, reject) => {
12
+ const uuid = generateUUID();
13
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
14
+ if (method !== 'GET' && method !== 'HEAD') {
15
+ headersOrigin['X-Idempotency-Key'] = uuid;
16
+ }
17
+ const options = {
18
+ method,
19
+ headers: headersOrigin,
20
+ body: null
21
+ };
22
+ if (body && method !== 'GET' && method !== 'HEAD') {
23
+ options.body = JSON.stringify(body);
24
+ }
25
+ else {
26
+ delete options.body;
27
+ }
28
+ fetch(url, options)
29
+ .then((response) => {
30
+ if (!response.ok) {
31
+ return response.json().then((errorData) => {
32
+ const error = {
33
+ status: response.status,
34
+ statusText: response.statusText,
35
+ code: errorData.code || 'UNKNOWN_ERROR',
36
+ message: errorData.message || 'An unknown error occurred',
37
+ data: errorData.data || null
38
+ };
39
+ reject(error);
40
+ }, () => reject({
41
+ status: response.status,
42
+ statusText: response.statusText,
43
+ code: 'PARSE_ERROR',
44
+ message: 'Failed to parse error response'
45
+ }));
46
+ }
47
+ else {
48
+ return response.json();
49
+ }
50
+ })
51
+ .then((data) => resolve(data), (error) => reject(error));
52
+ });
53
+ }
54
+ export const fetcher = (url) => fetch(url, {
55
+ method: 'GET',
56
+ headers: {
57
+ 'x-scheme': 'application/json',
58
+ Accept: 'application/json'
59
+ }
60
+ }).then((r) => r.json());
61
+ function isEmptyValueOfArray(arr) {
62
+ if (arr.length === 0) {
63
+ return true;
64
+ }
65
+ const len = arr.length;
66
+ let count = 0;
67
+ for (let i = 0; i < len; i++) {
68
+ if (isEmptyValue(arr[i])) {
69
+ count++;
70
+ }
71
+ else {
72
+ return false;
73
+ }
74
+ }
75
+ if (count === len) {
76
+ return true;
77
+ }
78
+ return false;
79
+ }
80
+ function isEmptyValueOfObject(obj) {
81
+ if (Object.keys(obj).length === 0) {
82
+ return true;
83
+ }
84
+ const len = Object.keys(obj).length;
85
+ let count = 0;
86
+ for (const val of Object.values(obj)) {
87
+ if (isEmptyValue(val)) {
88
+ count++;
89
+ }
90
+ else {
91
+ return false;
92
+ }
93
+ }
94
+ if (count === len) {
95
+ return true;
96
+ }
97
+ return false;
98
+ }
99
+ export function isEmptyValue(value, allowZero) {
100
+ if (value === null || value === undefined || value === '') {
101
+ return true;
102
+ }
103
+ else if (value === 0 && allowZero) {
104
+ return false;
105
+ }
106
+ else if (Array.isArray(value)) {
107
+ return isEmptyValueOfArray(value);
108
+ }
109
+ else if (Object.prototype.toString.call(value) === '[object Object]') {
110
+ return isEmptyValueOfObject(value);
111
+ }
112
+ else {
113
+ return !value;
114
+ }
115
+ }
116
+ export function toQueryParams(params) {
117
+ const finalParams = {};
118
+ Object.entries(params).forEach(([key, value]) => {
119
+ if (!isEmptyValue(value, true)) {
120
+ finalParams[key] = value;
121
+ }
122
+ });
123
+ const queryString = Object.entries(finalParams)
124
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
125
+ .join('&');
126
+ return queryString ? `?${queryString}` : '';
127
+ }
128
+ const bulletMap = {
129
+ '0': '1',
130
+ '1': 'X',
131
+ '2': '2'
132
+ };
133
+ export function parseBulletNumber(numberArr) {
134
+ const bulletArr = [];
135
+ Object.keys(bulletMap).forEach((key) => {
136
+ bulletArr.push({
137
+ isSelected: numberArr.includes(Number(key)),
138
+ value: bulletMap[key]
139
+ });
140
+ });
141
+ return bulletArr;
142
+ }
143
+ export function parseEachLineNumber(numbers) {
144
+ const result = [];
145
+ const matchRes = [];
146
+ for (let i = 0; i < numbers.length; i += 2) {
147
+ const [resultNumber, matchNumber] = [numbers[i], numbers[i + 1]];
148
+ if (!matchRes[matchNumber]) {
149
+ matchRes[matchNumber] = [resultNumber];
150
+ }
151
+ else {
152
+ matchRes[matchNumber].push(resultNumber);
153
+ }
154
+ }
155
+ matchRes.forEach((matchArr) => {
156
+ result.push(parseBulletNumber(matchArr));
157
+ });
158
+ return result;
159
+ }
160
+ export function thousandSeperator(value) {
161
+ if (value === 0) {
162
+ return '0';
163
+ }
164
+ if (!value) {
165
+ return '';
166
+ }
167
+ value = value.toString();
168
+ const parts = value.split('.');
169
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
170
+ return parts.join('.');
171
+ }
172
+ export const isMobile = (userAgent) => {
173
+ return !!(userAgent.toLowerCase().match(/android/i) ||
174
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
175
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
176
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
177
+ };
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };