@everymatrix/casino-tournaments-filter-controller 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.
package/index.html DELETED
@@ -1,37 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset='utf-8'>
5
- <meta name='viewport' content='width=device-width,initial-scale=1'>
6
-
7
- <title>
8
- casino-tournaments-filter-controller
9
- </title>
10
- <link rel="stylesheet" href="public/reset.css">
11
- <script src='dist/casino-tournaments-filter-controller.js'></script>
12
- </head>
13
-
14
- <body>
15
- <style>
16
- html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
17
- .header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
18
- .header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
19
- .header__name { color: #fff; }
20
- .header__name span { margin-right: 10px; font-weight: bold; }
21
- .webcomponent { padding: 10px 20px; }
22
- </style>
23
- <header class="header">
24
- <div class="header__logo">
25
- <svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
26
- </div>
27
- <h1 class="header__name">
28
- <span>WEBCOMPONENT:</span> casino-tournaments-filter-controller
29
- </h1>
30
- </header>
31
-
32
- <div class="webcomponent">
33
- <casino-tournaments-filter-controller></casino-tournaments-filter-controller>
34
- </div>
35
-
36
- </body>
37
- </html>
package/index.js DELETED
@@ -1 +0,0 @@
1
- import './dist/casino-tournaments-filter-controller.js';
Binary file
package/public/reset.css DELETED
@@ -1,48 +0,0 @@
1
- /* http://meyerweb.com/eric/tools/css/reset/
2
- v2.0 | 20110126
3
- License: none (public domain)
4
- */
5
-
6
- html, body, div, span, applet, object, iframe,
7
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
- a, abbr, acronym, address, big, cite, code,
9
- del, dfn, em, img, ins, kbd, q, s, samp,
10
- small, strike, strong, sub, sup, tt, var,
11
- b, u, i, center,
12
- dl, dt, dd, ol, ul, li,
13
- fieldset, form, label, legend,
14
- table, caption, tbody, tfoot, thead, tr, th, td,
15
- article, aside, canvas, details, embed,
16
- figure, figcaption, footer, header, hgroup,
17
- menu, nav, output, ruby, section, summary,
18
- time, mark, audio, video {
19
- margin: 0;
20
- padding: 0;
21
- border: 0;
22
- font-size: 100%;
23
- font: inherit;
24
- vertical-align: baseline;
25
- }
26
- /* HTML5 display-role reset for older browsers */
27
- article, aside, details, figcaption, figure,
28
- footer, header, hgroup, menu, nav, section {
29
- display: block;
30
- }
31
- body {
32
- line-height: 1;
33
- }
34
- ol, ul {
35
- list-style: none;
36
- }
37
- blockquote, q {
38
- quotes: none;
39
- }
40
- blockquote:before, blockquote:after,
41
- q:before, q:after {
42
- content: '';
43
- content: none;
44
- }
45
- table {
46
- border-collapse: collapse;
47
- border-spacing: 0;
48
- }
package/rollup.config.js DELETED
@@ -1,67 +0,0 @@
1
- import svelte from 'rollup-plugin-svelte';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import resolve from '@rollup/plugin-node-resolve';
4
- import serve from 'rollup-plugin-dev-server';
5
- import livereload from 'rollup-plugin-livereload';
6
- import { terser } from 'rollup-plugin-terser';
7
- import sveltePreprocess from 'svelte-preprocess';
8
- import typescript from '@rollup/plugin-typescript';
9
- import uglify from 'rollup-plugin-uglify';
10
- import image from '@rollup/plugin-image';
11
-
12
- const production = process.env.NODE_ENV == 'production';
13
- const dev = process.env.NODE_ENV == 'development';
14
-
15
- export default {
16
- input: 'src/index.ts',
17
- output: {
18
- sourcemap: true,
19
- format: 'umd',
20
- name: 'app',
21
- file: 'dist/casino-tournaments-filter-controller.js',
22
- },
23
- plugins: [
24
- svelte({
25
- preprocess: sveltePreprocess(),
26
- compilerOptions: {
27
- // @TODO check generate and hydratable
28
- // generate: 'ssr',
29
- // hydratable: true,
30
- // enable run-time checks when not in production
31
- customElement: true,
32
- dev: !production
33
- }
34
- }),
35
- image(),
36
- commonjs(),
37
- resolve({
38
- browser: true,
39
- dedupe: ['svelte']
40
- }),
41
- dev && serve({
42
- open: true,
43
- verbose: true,
44
- allowCrossOrigin: true,
45
- historyApiFallback: false,
46
- host: 'localhost',
47
- port: 5050,
48
- }),
49
- dev && livereload({ watch: ['', 'dist'] }),
50
- typescript({
51
- sourceMap: !production,
52
- inlineSources: !production,
53
- }),
54
- // If we're building for production (npm run build
55
- // instead of npm run dev), minify
56
- production &&
57
- terser({
58
- output: {
59
- comments: "all"
60
- },
61
- }),
62
- production && uglify.uglify()
63
- ],
64
- watch: {
65
- clearScreen: false
66
- }
67
- };
@@ -1,291 +0,0 @@
1
- <svelte:options tag={null} />
2
-
3
- <script lang="ts">
4
- import { onMount } from 'svelte';
5
- import { getDevice, isMobile } from 'rvhelper';
6
- import { _, addNewMessages, setLocale } from './i18n';
7
- import { TRANSLATIONS } from './translations';
8
-
9
- // Array as string, without empty spaces (ex: "All,Scheduled,Ongoing,Finished");
10
- export let filters:string = '';
11
- export let activefilters:string = '';
12
- export let translationurl:string = '';
13
-
14
- export let clientstyling:string = '';
15
- export let clientstylingurl:string = '';
16
-
17
- let customStylingContainer: HTMLElement;
18
- let displayNone:boolean = false;
19
-
20
- let hasErrors:boolean = false;
21
- let filterItems:any = [];
22
- let filterNumber:number = 0;
23
- let activeIndexes:Array<Number> = new Array(100);
24
- let allActive:boolean = true;
25
- let userAgent:string = window.navigator.userAgent;
26
- let shownStatus:string = '';
27
-
28
- const setTranslationUrl = ():void => {
29
- let url:string = translationurl;
30
-
31
- fetch(url).then((res:any) => res.json())
32
- .then((res) => {
33
- Object.keys(res).forEach((item:any):void => {
34
- addNewMessages(item, res[item]);
35
- });
36
- }).catch((err:any) => {
37
- console.log(err);
38
- });
39
- }
40
-
41
-
42
- Object.keys(TRANSLATIONS).forEach((item:any) => {
43
- addNewMessages(item, TRANSLATIONS[item]);
44
- });
45
-
46
- const makeButtonActive = (item:String, index:Number) => {
47
- if (index == 0) {
48
- allActive = true;
49
- activeIndexes = new Array(filterNumber);
50
-
51
- window.postMessage({ type: 'TournamentsFiltersSelected', filters: ['All']}, window.location.href);
52
- } else {
53
- allActive = false;
54
-
55
- if (activeIndexes[index] == 1) {
56
- activeIndexes[index] = 0;
57
-
58
- if (activeIndexes.indexOf(1) == -1) {
59
- allActive = true;
60
- }
61
- } else {
62
- activeIndexes[index] = 1;
63
- }
64
-
65
- if (activeIndexes.indexOf(1) == -1) {
66
- window.postMessage({ type: 'TournamentsFiltersSelected', filters: ['All']}, window.location.href);
67
- } else {
68
- let message:Array<String> = [];
69
-
70
- for (let i = 0; i < filterItems.length; i++) {
71
- if (activeIndexes[i] == 1) {
72
- message.push(filterItems[i]);
73
- }
74
- }
75
-
76
- window.postMessage({ type: 'TournamentsFiltersSelected', filters: message }, window.location.href);
77
- }
78
- }
79
- }
80
-
81
- const matchFilter = (filter:string) => {
82
- if (filter == 'Scheduled') {
83
- return $_('scheduled');
84
- }
85
-
86
- if (filter == 'Ongoing') {
87
- return $_('ongoing');
88
- }
89
-
90
- if (filter == 'Finished') {
91
- return $_('finished');
92
- }
93
-
94
- if (filter == 'All') {
95
- return $_('all');
96
- }
97
- }
98
-
99
- const processFilters = () => {
100
- filterItems = filters.split(',');
101
- filterNumber = filterItems.length;
102
- }
103
-
104
- const setActiveFilters = () => {
105
- let items = activefilters.split(',');
106
-
107
- activeIndexes = new Array(filterNumber);
108
-
109
- if (items.indexOf('All') != -1) {
110
- allActive = true;
111
- } else {
112
- allActive = false;
113
-
114
- items.forEach((item) => {
115
- let index = filterItems.indexOf(item);
116
-
117
- if (index > 0) {
118
- $: activeIndexes[index] = 1;
119
- }
120
- });
121
- }
122
- }
123
-
124
- const setClientStyling = ():void => {
125
- let sheet = document.createElement('style');
126
- sheet.innerHTML = clientstyling;
127
- customStylingContainer.appendChild(sheet);
128
- }
129
-
130
- const setClientStylingURL = ():void => {
131
- displayNone = true;
132
-
133
- let url:URL = new URL(clientstylingurl);
134
- let cssFile:HTMLElement = document.createElement('style');
135
-
136
- fetch(url.href)
137
- .then((res:any) => res.text())
138
- .then((data:any) => {
139
- cssFile.innerHTML = data
140
-
141
- setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
142
- setTimeout(() => { displayNone = false; }, 500);
143
- });
144
- }
145
-
146
- $: customStylingContainer && clientstyling && setClientStyling();
147
- $: customStylingContainer && clientstylingurl && setClientStylingURL();
148
- $: translationurl && setTranslationUrl();
149
- $: filters && processFilters();
150
- $: activefilters && setActiveFilters();
151
- </script>
152
-
153
- <div bind:this={customStylingContainer} class="FiltersController { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }" part="FiltersController { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }">
154
- {#if filterItems.length > 0}
155
- <ul class="FiltersList { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }" part="FiltersList { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }">
156
- <li class="FiltersTitle { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }" part="FiltersTitle { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }">
157
- {$_('tournaments')}:
158
- </li>
159
- {#each filterItems as filter, index}
160
- <li class="FiltersItem" part="FiltersItem" on:click={() => makeButtonActive(filter, index)}>
161
- <button class="{activeIndexes[index] == 1 || (allActive && index == 0) ? 'Active' : ''} { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }" part="{activeIndexes[index] == 1 || (allActive && index == 0) ? 'Active' : ''} { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }">
162
- {#if activeIndexes[index] == 1 || (allActive && index == 0)}
163
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check" part="bi bi-check" viewBox="0 0 16 16">
164
- <path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"/>
165
- </svg>
166
- {/if}
167
- <div class="FilterButton { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }" part="FilterButton { isMobile(userAgent) ? 'MobileClass' : 'Non-MobileClass/empty' }">
168
- {#if filter == 'Scheduled'}
169
- {$_('scheduled')}
170
- {/if}
171
- {#if filter == 'Ongoing'}
172
- {$_('ongoing')}
173
- {/if}
174
- {#if filter == 'Finished'}
175
- {$_('finished')}
176
- {/if}
177
- {#if filter == 'All'}
178
- {$_('all')}
179
- {/if}
180
- </div>
181
- </button>
182
- </li>
183
- {/each}
184
- </ul>
185
- {/if}
186
- </div>
187
-
188
-
189
- <style lang="scss">
190
-
191
-
192
- *,
193
- *::before,
194
- *::after {
195
- margin: 0;
196
- padding: 0;
197
- list-style: none;
198
- text-decoration: none;
199
- outline: none;
200
- box-sizing: border-box;
201
- }
202
-
203
- ul {
204
- display: flex;
205
- gap: 10px;
206
- overflow-x: auto;
207
-
208
- &.MobileClass {
209
- padding-top: 21px;
210
- }
211
- }
212
-
213
- li:first-child {
214
- height: 100%;
215
- position: realtive;
216
- padding: 1em 0;
217
- margin: 0;
218
- font-size: 14px;
219
- text-align:center;
220
- letter-spacing: 0px;
221
- color: var(--emfe-w-color-white, #FFFFFF);
222
- opacity: 1;
223
- }
224
-
225
- li.MobileClass {
226
- position: absolute;
227
- left: 10px;
228
- top: -15px;
229
- font-size: 14px;
230
- height: auto;
231
- }
232
-
233
- button {
234
- display: flex;
235
- align-items: center;
236
- background-color: transparent;
237
- justify-content: center;
238
- padding: 10px;
239
- height: 40px;
240
- border: 1px solid var(--emfe-w-color-white, #FFFFFF);
241
- min-width: 40px;
242
- text-align: center;
243
- color: var(--emfe-w-color-white, #FFFFFF);
244
- &.MobileClass {
245
- height: 30px;
246
- }
247
- }
248
-
249
- button:hover {
250
- background-color: var(--emfe-w-color-gray-100, #E6E6E6);
251
- border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
252
- color: var(--emfe-w-color-black, #000000);
253
- cursor: pointer;
254
- }
255
-
256
- .FiltersController {
257
- color: var(--emfe-w-color-white, #FFFFFF);
258
- display: flex;
259
- justify-content: flex-end;
260
- margin-bottom: 20px;
261
- &.MobileClass {
262
- justify-content: flex-start;
263
- margin-bottom: 10px;
264
- }
265
-
266
- .FilterButton {
267
- font-size: 14px;
268
- letter-spacing: 0px;
269
- opacity: 1;
270
- text-transform: uppercase;
271
- &.MobileClass {
272
- font-size: 10px;
273
- }
274
- }
275
-
276
- .Active {
277
- background-color: var(--emfe-w-color-gray-300, #58586B);
278
- border: 1px solid var(--emfe-w-color-gray-300, #58586B);
279
- }
280
-
281
- .Active:hover {
282
- background-color: var(--emfe-w-color-gray-300, #58586B);
283
- border: 1px solid var(--emfe-w-color-gray-300, #58586B);
284
- }
285
-
286
- }
287
-
288
-
289
-
290
-
291
- </style>
package/src/i18n.js DELETED
@@ -1,27 +0,0 @@
1
- import {
2
- dictionary,
3
- locale,
4
- addMessages,
5
- _
6
- } from 'svelte-i18n';
7
-
8
- function setupI18n({ withLocale: _locale, translations }) {
9
- locale.subscribe((data) => {
10
- if (data == null) {
11
- dictionary.set(translations);
12
- locale.set(_locale);
13
- }
14
- }); // maybe we will need this to make sure that the i18n is set up only once
15
- /*dictionary.set(translations);
16
- locale.set(_locale);*/
17
- }
18
-
19
- function addNewMessages(lang, dict) {
20
- addMessages(lang, dict);
21
- }
22
-
23
- function setLocale(_locale) {
24
- locale.set(_locale);
25
- }
26
-
27
- export { _, setupI18n, addNewMessages, setLocale };
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- import CasinoTournamentsFilterController from './CasinoTournamentsFilterController.svelte';
2
-
3
- !customElements.get('casino-tournaments-filter-controller') && customElements.define('casino-tournaments-filter-controller', CasinoTournamentsFilterController);
4
- export default CasinoTournamentsFilterController;
@@ -1,72 +0,0 @@
1
- export const TRANSLATIONS = {
2
- "en": {
3
- "tournaments": "Tournaments",
4
- "all": "All",
5
- "scheduled": "Scheduled",
6
- "ongoing": "Ongoing",
7
- "finished": "Finished"
8
- },
9
- "hr": {
10
- "tournaments": "Turniri",
11
- "all": "Svi",
12
- "scheduled": "Planirani",
13
- "ongoing": "U tijeku",
14
- "finished": "Završeni"
15
- },
16
- "zh-hk": {
17
- "tournaments": "錦標賽",
18
- "all": "全部",
19
- "scheduled": "預定的",
20
- "ongoing": "進行中",
21
- "finished": "完成的"
22
- },
23
- "fr": {
24
- "tournaments": "Tournois",
25
- "all": "Tous",
26
- "scheduled": "Programmé",
27
- "ongoing": "En cours",
28
- "finished": "Fini"
29
- },
30
- "ro": {
31
- "tournaments": "Turnee",
32
- "all": "Toate",
33
- "scheduled": "Programate",
34
- "ongoing": "În curs",
35
- "finished": "Finalizat"
36
- },
37
- "tr": {
38
- "tournaments": "Turnuvalar",
39
- "all": "Hepsi",
40
- "scheduled": "Planlanmış",
41
- "ongoing": "Devam ediyor",
42
- "finished": "Tamamlanmış"
43
- },
44
- "el": {
45
- "tournaments": "Τουρνουά",
46
- "all": "Όλα",
47
- "scheduled": "Προγραμματισμένα",
48
- "ongoing": "Τρέχοντα",
49
- "finished": "Ολοκληρωμένα"
50
- },
51
- "es": {
52
- "tournaments": "Torneos",
53
- "all": "Todos",
54
- "scheduled": "Programado",
55
- "ongoing": "En vivo",
56
- "finished": "Finalizado"
57
- },
58
- "hu": {
59
- "tournaments": "Versenyek",
60
- "all": "Mind",
61
- "scheduled": "Ütemezés",
62
- "ongoing": "Folyamatban",
63
- "finished": "Befejezett"
64
- },
65
- "pt": {
66
- "tournaments": "Torneios",
67
- "all": "Tudo",
68
- "scheduled": "Agendado",
69
- "ongoing": "Em progresso",
70
- "finished": "Finalizado"
71
- }
72
- }
@@ -1,13 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- import CasinoTournamentsFilterController from '../src/CasinoTournamentsFilterController';
4
-
5
- // This default export determines where your story goes in the story list
6
- export default {
7
- title: 'CasinoTournamentsFilterController',
8
- };
9
-
10
- // 👇 We create a “template” of how args map to rendering
11
- const CasinoTournamentsFilterController = ({ aProperty }) => html`<casino-tournaments-filter-controller></casino-tournaments-filter-controller>`;
12
-
13
- export const FirstStory = CasinoTournamentsFilterController.bind({});
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
-
4
- "include": ["src/**/*"],
5
- "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
6
- }