@everymatrix/casino-jackpot-winner 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/dist/casino-jackpot-winner/casino-jackpot-winner.esm.js +1 -1
- package/dist/casino-jackpot-winner/p-ac5b2e9b.entry.js +1 -0
- package/dist/casino-jackpot-winner/p-d8aa97f8.js +2 -0
- package/dist/casino-jackpot-winner/p-e1255160.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-jackpot-winner.cjs.entry.js +299 -787
- package/dist/cjs/casino-jackpot-winner.cjs.js +17 -11
- package/dist/cjs/index-043b8326.js +1191 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/casino-jackpot-winner/casino-jackpot-winner.css +1 -1
- package/dist/collection/components/casino-jackpot-winner/casino-jackpot-winner.js +181 -199
- package/dist/collection/components/casino-jackpot-winner/index.js +1 -0
- package/dist/collection/decorators/base.decorator.js +9 -9
- package/dist/collection/decorators/locale.decorator.js +27 -27
- package/dist/collection/decorators/style.decorator.js +21 -21
- package/dist/collection/decorators/style.util.js +28 -28
- package/dist/collection/renders/Layout.js +2 -3
- package/dist/collection/renders/ListLoader.js +8 -8
- package/dist/collection/renders/Loader.js +2 -7
- package/dist/collection/renders/User.js +10 -13
- package/dist/collection/renders/images.js +15 -15
- package/dist/collection/renders/index.js +10 -10
- package/dist/collection/utils/business.js +10 -10
- package/dist/collection/utils/currencySymbols.js +170 -170
- package/dist/collection/utils/fetch.js +12 -12
- package/dist/collection/utils/translation.js +9 -9
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-jackpot-winner.entry.js +299 -787
- package/dist/esm/casino-jackpot-winner.js +14 -11
- package/dist/esm/index-a3763668.js +1163 -0
- package/dist/esm/loader.js +7 -13
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +12 -29
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-jackpot-winner/.stencil/packages/stencil/casino-jackpot-winner/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-jackpot-winner/.stencil/packages/stencil/casino-jackpot-winner/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/casino-jackpot-winner/casino-jackpot-winner.d.ts +44 -44
- package/dist/types/components/casino-jackpot-winner/index.d.ts +1 -0
- package/dist/types/renders/ListLoader.d.ts +4 -4
- package/dist/types/renders/User.d.ts +2 -2
- package/dist/types/renders/index.d.ts +4 -4
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/currencySymbols.d.ts +170 -170
- package/dist/types/utils/translation.d.ts +10 -10
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -8
- package/dist/assets/logo.svg +0 -1
- package/dist/assets/winner1.svg +0 -59
- package/dist/assets/winner2.svg +0 -37
- package/dist/assets/winner3.svg +0 -124
- package/dist/assets/winner4.svg +0 -88
- package/dist/casino-jackpot-winner/p-4584d40b.entry.js +0 -1
- package/dist/casino-jackpot-winner/p-849daf58.js +0 -1
- package/dist/cjs/index-a0c6f675.js +0 -1298
- package/dist/components/casino-jackpot-winner.d.ts +0 -11
- package/dist/components/casino-jackpot-winner.js +0 -864
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/esm/index-426eb6f0.js +0 -1271
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-jackpot-winner/.stencil/packages/casino-jackpot-winner/stencil.config.d.ts +0 -2
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,20 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-043b8326.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return index.promiseResolve();
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const defineCustomElements = (win, options) => {
|
|
15
|
-
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
-
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["casino-jackpot-winner.cjs",[[1,"casino-jackpot-winner",{"endpoint":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"currency":[1],"locale":[32],"users":[32],"isLoading":[32]}]]]], options);
|
|
18
|
-
});
|
|
8
|
+
const defineCustomElements = async (win, options) => {
|
|
9
|
+
if (typeof window === 'undefined') return undefined;
|
|
10
|
+
await appGlobals.globalScripts();
|
|
11
|
+
return index.bootstrapLazy([["casino-jackpot-winner.cjs",[[1,"casino-jackpot-winner",{"endpoint":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"currency":[1],"locale":[32],"users":[32],"isLoading":[32]},null,{"endpoint":["watchForUpdateUsers"],"language":["watchForUpdateUsers"]}]]]], options);
|
|
19
12
|
};
|
|
20
13
|
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
21
15
|
exports.defineCustomElements = defineCustomElements;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"
|
|
3
|
+
"components/casino-jackpot-winner/casino-jackpot-winner.js"
|
|
4
4
|
],
|
|
5
5
|
"compiler": {
|
|
6
6
|
"name": "@stencil/core",
|
|
7
|
-
"version": "
|
|
8
|
-
"typescriptVersion": "
|
|
7
|
+
"version": "4.20.0",
|
|
8
|
+
"typescriptVersion": "5.5.3"
|
|
9
9
|
},
|
|
10
10
|
"collections": [],
|
|
11
11
|
"bundles": []
|
|
@@ -1,208 +1,190 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { RenderJackpotWinner } from '../../renders';
|
|
6
|
-
import { getWinners } from '../../utils/business';
|
|
7
|
-
import { setDefaultStyle } from '../../renders/images';
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { RenderJackpotWinner } from "../../renders";
|
|
3
|
+
import { getWinners } from "../../utils/business";
|
|
4
|
+
import { setDefaultStyle } from "../../renders/images";
|
|
8
5
|
export class CasinoJackpotWinner {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
constructor() {
|
|
7
|
+
this.isComponentLoaded = false;
|
|
8
|
+
this.endpoint = undefined;
|
|
9
|
+
this.language = 'en';
|
|
10
|
+
this.clientStyling = '';
|
|
11
|
+
this.clientStylingUrl = '';
|
|
12
|
+
this.translationUrl = '';
|
|
13
|
+
this.currency = 'EUR';
|
|
14
|
+
this.locale = undefined;
|
|
15
|
+
this.users = [];
|
|
16
|
+
this.isLoading = true;
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
const { isLoading, users, currency, locale } = this;
|
|
20
|
+
return (h(RenderJackpotWinner, { key: '9e70f595e00e43837f307403b93e08c36a9e8071', isLoading, users, currency, locale }));
|
|
21
|
+
}
|
|
22
|
+
async updateUsers() {
|
|
23
|
+
if (!this.endpoint)
|
|
24
|
+
return;
|
|
25
|
+
this.isLoading = true;
|
|
26
|
+
this.users = await getWinners(this.endpoint, this.language, this.currency);
|
|
27
|
+
this.isLoading = false;
|
|
28
|
+
}
|
|
29
|
+
watchForUpdateUsers() {
|
|
30
|
+
if (!this.isComponentLoaded)
|
|
31
|
+
return;
|
|
32
|
+
this.updateUsers();
|
|
33
|
+
}
|
|
18
34
|
/**
|
|
19
|
-
*
|
|
35
|
+
* define for @Style Decorator
|
|
20
36
|
*/
|
|
21
|
-
|
|
37
|
+
componentDidLoad() {
|
|
38
|
+
setDefaultStyle(this.host.shadowRoot);
|
|
39
|
+
this.isComponentLoaded = true;
|
|
40
|
+
this.updateUsers();
|
|
41
|
+
}
|
|
22
42
|
/**
|
|
23
|
-
*
|
|
43
|
+
* define for @Locale and @Style
|
|
24
44
|
*/
|
|
25
|
-
|
|
45
|
+
componentShouldUpdate() { }
|
|
26
46
|
/**
|
|
27
|
-
*
|
|
47
|
+
* define for @Locale
|
|
28
48
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"resolved": "string",
|
|
170
|
-
"references": {}
|
|
171
|
-
},
|
|
172
|
-
"required": false,
|
|
173
|
-
"optional": false,
|
|
174
|
-
"docs": {
|
|
175
|
-
"tags": [],
|
|
176
|
-
"text": "Currency of the widget"
|
|
177
|
-
},
|
|
178
|
-
"attribute": "currency",
|
|
179
|
-
"reflect": false,
|
|
180
|
-
"defaultValue": "'EUR'"
|
|
49
|
+
componentWillLoad() { }
|
|
50
|
+
static get is() { return "casino-jackpot-winner"; }
|
|
51
|
+
static get encapsulation() { return "shadow"; }
|
|
52
|
+
static get originalStyleUrls() {
|
|
53
|
+
return {
|
|
54
|
+
"$": ["casino-jackpot-winner.scss"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static get styleUrls() {
|
|
58
|
+
return {
|
|
59
|
+
"$": ["casino-jackpot-winner.css"]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
static get properties() {
|
|
63
|
+
return {
|
|
64
|
+
"endpoint": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"mutable": false,
|
|
67
|
+
"complexType": {
|
|
68
|
+
"original": "string",
|
|
69
|
+
"resolved": "string",
|
|
70
|
+
"references": {}
|
|
71
|
+
},
|
|
72
|
+
"required": false,
|
|
73
|
+
"optional": false,
|
|
74
|
+
"docs": {
|
|
75
|
+
"tags": [],
|
|
76
|
+
"text": "Endpoint URL for the source of data"
|
|
77
|
+
},
|
|
78
|
+
"attribute": "endpoint",
|
|
79
|
+
"reflect": false
|
|
80
|
+
},
|
|
81
|
+
"language": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "string",
|
|
86
|
+
"resolved": "string",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "Language of the widget"
|
|
94
|
+
},
|
|
95
|
+
"attribute": "language",
|
|
96
|
+
"reflect": false,
|
|
97
|
+
"defaultValue": "'en'"
|
|
98
|
+
},
|
|
99
|
+
"clientStyling": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "string",
|
|
104
|
+
"resolved": "string",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Client custom styling via string"
|
|
112
|
+
},
|
|
113
|
+
"attribute": "client-styling",
|
|
114
|
+
"reflect": false,
|
|
115
|
+
"defaultValue": "''"
|
|
116
|
+
},
|
|
117
|
+
"clientStylingUrl": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"mutable": false,
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "string",
|
|
122
|
+
"resolved": "string",
|
|
123
|
+
"references": {}
|
|
124
|
+
},
|
|
125
|
+
"required": false,
|
|
126
|
+
"optional": false,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [],
|
|
129
|
+
"text": "Client custom styling via url"
|
|
130
|
+
},
|
|
131
|
+
"attribute": "client-styling-url",
|
|
132
|
+
"reflect": false,
|
|
133
|
+
"defaultValue": "''"
|
|
134
|
+
},
|
|
135
|
+
"translationUrl": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"mutable": false,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "string",
|
|
140
|
+
"resolved": "string",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": "translation via url"
|
|
148
|
+
},
|
|
149
|
+
"attribute": "translation-url",
|
|
150
|
+
"reflect": false,
|
|
151
|
+
"defaultValue": "''"
|
|
152
|
+
},
|
|
153
|
+
"currency": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "string",
|
|
158
|
+
"resolved": "string",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": "Currency of the widget"
|
|
166
|
+
},
|
|
167
|
+
"attribute": "currency",
|
|
168
|
+
"reflect": false,
|
|
169
|
+
"defaultValue": "'EUR'"
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
static get states() {
|
|
174
|
+
return {
|
|
175
|
+
"locale": {},
|
|
176
|
+
"users": {},
|
|
177
|
+
"isLoading": {}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
static get elementRef() { return "host"; }
|
|
181
|
+
static get watchers() {
|
|
182
|
+
return [{
|
|
183
|
+
"propName": "endpoint",
|
|
184
|
+
"methodName": "watchForUpdateUsers"
|
|
185
|
+
}, {
|
|
186
|
+
"propName": "language",
|
|
187
|
+
"methodName": "watchForUpdateUsers"
|
|
188
|
+
}];
|
|
181
189
|
}
|
|
182
|
-
}; }
|
|
183
|
-
static get states() { return {
|
|
184
|
-
"locale": {},
|
|
185
|
-
"users": {},
|
|
186
|
-
"isLoading": {}
|
|
187
|
-
}; }
|
|
188
|
-
static get elementRef() { return "host"; }
|
|
189
|
-
static get watchers() { return [{
|
|
190
|
-
"propName": "endpoint",
|
|
191
|
-
"methodName": "watchForUpdateUsers"
|
|
192
|
-
}, {
|
|
193
|
-
"propName": "language",
|
|
194
|
-
"methodName": "watchForUpdateUsers"
|
|
195
|
-
}]; }
|
|
196
190
|
}
|
|
197
|
-
__decorate([
|
|
198
|
-
Locale(),
|
|
199
|
-
__metadata("design:type", String)
|
|
200
|
-
], CasinoJackpotWinner.prototype, "language", void 0);
|
|
201
|
-
__decorate([
|
|
202
|
-
Style(),
|
|
203
|
-
__metadata("design:type", String)
|
|
204
|
-
], CasinoJackpotWinner.prototype, "clientStyling", void 0);
|
|
205
|
-
__decorate([
|
|
206
|
-
Style(),
|
|
207
|
-
__metadata("design:type", String)
|
|
208
|
-
], CasinoJackpotWinner.prototype, "clientStylingUrl", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CasinoJackpotWinner } from './casino-jackpot-winner';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export const apply = (proto, lifecycle, run) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
proto[lifecycle] = function (...args) {
|
|
7
|
-
run.bind(this, ...args).call();
|
|
8
|
-
if (existLifeCycle) {
|
|
9
|
-
return existLifeCycle.bind(this, ...args).call();
|
|
2
|
+
const existLifeCycle = proto[lifecycle];
|
|
3
|
+
if (!existLifeCycle) {
|
|
4
|
+
throw new Error('lifecycle ' + lifecycle + ' not defined');
|
|
10
5
|
}
|
|
11
|
-
|
|
6
|
+
proto[lifecycle] = function (...args) {
|
|
7
|
+
run.bind(this, ...args).call();
|
|
8
|
+
if (existLifeCycle) {
|
|
9
|
+
return existLifeCycle.bind(this, ...args).call();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
12
|
};
|
|
@@ -2,39 +2,39 @@ import { apply } from "./base.decorator";
|
|
|
2
2
|
import { translation } from "../utils/translation";
|
|
3
3
|
import { fetcher } from "../utils/fetch";
|
|
4
4
|
const getLocale = (_translations, language) => {
|
|
5
|
-
|
|
5
|
+
return _translations[language] || _translations['en'];
|
|
6
6
|
};
|
|
7
7
|
function setLocale() {
|
|
8
|
-
|
|
8
|
+
this.locale = getLocale(this.translation, this.language);
|
|
9
9
|
}
|
|
10
10
|
async function setLocaleByUrl(isInit = true) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
if (this.translationUrl) {
|
|
12
|
+
this.translation = await fetcher(this.translationUrl);
|
|
13
|
+
setLocale.bind(this).call();
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
if (!isInit) {
|
|
17
|
+
this.translation = translation;
|
|
18
|
+
setLocale.bind(this).call();
|
|
19
|
+
}
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
21
|
}
|
|
22
22
|
export const Locale = () => {
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
return (proto, prop) => {
|
|
25
|
-
apply(proto, 'componentWillLoad', async function () {
|
|
26
|
-
this.translation = translation;
|
|
27
|
-
setLocale.bind(this).call();
|
|
28
|
-
setLocaleByUrl.bind(this, true).call();
|
|
29
|
-
});
|
|
30
23
|
// @ts-ignore
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
return (proto, prop) => {
|
|
25
|
+
apply(proto, 'componentWillLoad', async function () {
|
|
26
|
+
this.translation = translation;
|
|
27
|
+
setLocale.bind(this).call();
|
|
28
|
+
setLocaleByUrl.bind(this, true).call();
|
|
29
|
+
});
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
apply(proto, 'componentShouldUpdate', async function (newValue, oldValue, key) {
|
|
32
|
+
if (key === 'language') {
|
|
33
|
+
setLocale.bind(this).call();
|
|
34
|
+
}
|
|
35
|
+
if (key === 'translationUrl') {
|
|
36
|
+
setLocaleByUrl.bind(this, false).call();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
40
|
};
|
|
@@ -2,27 +2,27 @@ import { getElement } from "@stencil/core";
|
|
|
2
2
|
import { apply } from "./base.decorator";
|
|
3
3
|
import { setClientStyling, setClientStylingUrl } from "./style.util";
|
|
4
4
|
const matchStyleProcess = (root, value, key) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
switch (key) {
|
|
6
|
+
case 'clientStyling':
|
|
7
|
+
setClientStyling(root, value);
|
|
8
|
+
break;
|
|
9
|
+
case 'clientStylingUrl':
|
|
10
|
+
setClientStylingUrl(root, value);
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
13
|
};
|
|
14
14
|
export const Style = () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
return (proto, prop) => {
|
|
16
|
+
apply(proto, 'componentDidLoad', function () {
|
|
17
|
+
const root = getElement(this).shadowRoot;
|
|
18
|
+
matchStyleProcess(root, this[prop], prop);
|
|
19
|
+
});
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
apply(proto, 'componentShouldUpdate', function (newValue, oldValue, key) {
|
|
22
|
+
if (key !== prop)
|
|
23
|
+
return;
|
|
24
|
+
const root = getElement(this).shadowRoot;
|
|
25
|
+
matchStyleProcess(root, this[prop], prop);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
28
|
};
|