@everymatrix/general-slider-navigation 1.44.0 → 1.45.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.
Files changed (55) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/carousel-component_2.cjs.entry.js +392 -419
  3. package/dist/cjs/general-slider-navigation.cjs.js +17 -11
  4. package/dist/cjs/index-88d9137e.js +1269 -0
  5. package/dist/cjs/loader.cjs.js +7 -13
  6. package/dist/collection/collection-manifest.json +4 -4
  7. package/dist/collection/components/carousel-component/carousel-component.css +0 -2
  8. package/dist/collection/components/carousel-component/carousel-component.js +360 -400
  9. package/dist/collection/components/general-slider-navigation/general-slider-navigation.js +293 -310
  10. package/dist/collection/components/general-slider-navigation/index.js +1 -0
  11. package/dist/collection/utils/locale.utils.js +56 -56
  12. package/dist/collection/utils/utils.js +39 -39
  13. package/dist/esm/app-globals-0f993ce5.js +3 -0
  14. package/dist/esm/carousel-component_2.entry.js +392 -419
  15. package/dist/esm/general-slider-navigation.js +14 -11
  16. package/dist/esm/index-c749968b.js +1242 -0
  17. package/dist/esm/loader.js +7 -13
  18. package/dist/general-slider-navigation/general-slider-navigation.esm.js +1 -1
  19. package/dist/general-slider-navigation/p-8c0cd4b3.js +2 -0
  20. package/dist/general-slider-navigation/p-c1626bea.entry.js +1 -0
  21. package/dist/general-slider-navigation/p-e1255160.js +1 -0
  22. package/dist/stencil.config.dev.js +17 -0
  23. package/dist/stencil.config.js +14 -19
  24. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-slider-navigation/.stencil/packages/stencil/general-slider-navigation/stencil.config.d.ts +2 -0
  25. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-slider-navigation/.stencil/packages/stencil/general-slider-navigation/stencil.config.dev.d.ts +2 -0
  26. package/dist/types/components/carousel-component/carousel-component.d.ts +70 -77
  27. package/dist/types/components/general-slider-navigation/general-slider-navigation.d.ts +54 -54
  28. package/dist/types/components/general-slider-navigation/index.d.ts +1 -0
  29. package/dist/types/components.d.ts +0 -16
  30. package/dist/types/stencil-public-runtime.d.ts +142 -33
  31. package/loader/cdn.js +1 -3
  32. package/loader/index.cjs.js +1 -3
  33. package/loader/index.d.ts +13 -1
  34. package/loader/index.es2017.js +1 -3
  35. package/loader/index.js +1 -3
  36. package/loader/package.json +1 -0
  37. package/package.json +8 -1
  38. package/dist/cjs/index-d69ac031.js +0 -1269
  39. package/dist/components/carousel-component.d.ts +0 -11
  40. package/dist/components/carousel-component.js +0 -6
  41. package/dist/components/carousel-component2.js +0 -386
  42. package/dist/components/general-slider-navigation.d.ts +0 -11
  43. package/dist/components/general-slider-navigation.js +0 -144
  44. package/dist/components/index.d.ts +0 -26
  45. package/dist/components/index.js +0 -1
  46. package/dist/esm/index-a33109c0.js +0 -1243
  47. package/dist/esm/polyfills/core-js.js +0 -11
  48. package/dist/esm/polyfills/css-shim.js +0 -1
  49. package/dist/esm/polyfills/dom.js +0 -79
  50. package/dist/esm/polyfills/es5-html-element.js +0 -1
  51. package/dist/esm/polyfills/index.js +0 -34
  52. package/dist/esm/polyfills/system.js +0 -6
  53. package/dist/general-slider-navigation/p-6da4364f.entry.js +0 -1
  54. package/dist/general-slider-navigation/p-734ecc50.js +0 -1
  55. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-slider-navigation/.stencil/packages/general-slider-navigation/stencil.config.d.ts +0 -2
@@ -1,318 +1,301 @@
1
- import { Component, Prop, State, Watch, h } from '@stencil/core';
2
- import { getDevicePlatform } from '../../utils/utils';
3
- import { getTranslations, translate } from '../../utils/locale.utils';
1
+ import { h } from "@stencil/core";
2
+ import { getDevicePlatform } from "../../utils/utils";
3
+ import { getTranslations, translate } from "../../utils/locale.utils";
4
4
  export class GeneralSliderNavigation {
5
- constructor() {
6
- /**
7
- * Client custom styling via inline style
8
- */
9
- this.clientStyling = '';
10
- /**
11
- * Client custom styling via url
12
- */
13
- this.clientStylingUrl = '';
14
- /**
15
- * CMS Endpoint stage
16
- */
17
- this.cmsEnv = 'stage';
18
- /**
19
- * Language of the widget
20
- */
21
- this.language = 'en';
22
- /**
23
- * User roles
24
- */
25
- this.userRoles = 'everyone';
26
- /**
27
- * Show bullet navigation under slides
28
- */
29
- this.bulletNavigation = true;
30
- /**
31
- * Mobile width for sliders
32
- */
33
- this.sliderMobileWidth = 200;
34
- /**
35
- * Desktop width for sliders
36
- */
37
- this.sliderDesktopWidth = 300;
38
- /**
39
- * Translation via url
40
- */
41
- this.translationUrl = '';
42
- this.isLoading = true;
43
- this.hasErrors = false;
44
- this.device = '';
45
- }
46
- handleNewTranslations() {
47
- getTranslations(this.translationUrl);
48
- }
49
- watchEndpoint(newValue, oldValue) {
50
- if (newValue && newValue != oldValue && this.cmsEndpoint) {
51
- this.getGeneralSliderNavigation().then((GeneralSliderNavigation) => {
52
- this.sliderData = GeneralSliderNavigation;
53
- });
5
+ constructor() {
6
+ this.clientStyling = '';
7
+ this.clientStylingUrl = '';
8
+ this.cmsEndpoint = undefined;
9
+ this.cmsEnv = 'stage';
10
+ this.language = 'en';
11
+ this.userRoles = 'everyone';
12
+ this.bulletNavigation = true;
13
+ this.slideTimer = undefined;
14
+ this.sliderMobileWidth = 200;
15
+ this.sliderDesktopWidth = 300;
16
+ this.translationUrl = '';
17
+ this.isLoading = true;
18
+ this.hasErrors = false;
19
+ this.device = '';
54
20
  }
55
- }
56
- async componentWillLoad() {
57
- if (this.translationUrl.length > 2) {
58
- await getTranslations(this.translationUrl);
21
+ handleNewTranslations() {
22
+ getTranslations(this.translationUrl);
59
23
  }
60
- if (this.cmsEndpoint && this.language) {
61
- return this.getGeneralSliderNavigation().then((GeneralSliderNavigation) => {
62
- this.sliderData = GeneralSliderNavigation;
63
- });
24
+ watchEndpoint(newValue, oldValue) {
25
+ if (newValue && newValue != oldValue && this.cmsEndpoint) {
26
+ this.getGeneralSliderNavigation().then((GeneralSliderNavigation) => {
27
+ this.sliderData = GeneralSliderNavigation;
28
+ });
29
+ }
64
30
  }
65
- }
66
- getGeneralSliderNavigation() {
67
- let url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
68
- url.searchParams.append('env', this.cmsEnv);
69
- url.searchParams.append('userRoles', this.userRoles);
70
- url.searchParams.append('device', getDevicePlatform());
71
- return new Promise((resolve, reject) => {
72
- this.isLoading = true;
73
- fetch(url.href)
74
- .then((res) => res.json())
75
- .then((menuSliderData) => {
76
- resolve(menuSliderData.banners);
77
- })
78
- .catch((err) => {
79
- console.error(err);
80
- this.hasErrors = true;
81
- reject(err);
82
- }).finally(() => {
83
- this.isLoading = false;
84
- });
85
- });
86
- }
87
- render() {
88
- if (this.hasErrors) {
89
- return (h("div", { class: "PageError" },
90
- h("div", { class: "TitleError" }, translate('error', this.language))));
31
+ async componentWillLoad() {
32
+ if (this.translationUrl.length > 2) {
33
+ await getTranslations(this.translationUrl);
34
+ }
35
+ if (this.cmsEndpoint && this.language) {
36
+ return this.getGeneralSliderNavigation().then((GeneralSliderNavigation) => {
37
+ this.sliderData = GeneralSliderNavigation;
38
+ });
39
+ }
91
40
  }
92
- if (!this.isLoading) {
93
- return (h("div", null,
94
- h("carousel-component", { sliderData: this.sliderData, language: this.language, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, bulletNavigation: this.bulletNavigation, slideTimer: this.slideTimer, translationUrl: this.translationUrl, sliderMobileWidth: this.sliderMobileWidth, sliderDesktopWidth: this.sliderDesktopWidth })));
41
+ getGeneralSliderNavigation() {
42
+ let url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
43
+ url.searchParams.append('env', this.cmsEnv);
44
+ url.searchParams.append('userRoles', this.userRoles);
45
+ url.searchParams.append('device', getDevicePlatform());
46
+ return new Promise((resolve, reject) => {
47
+ this.isLoading = true;
48
+ fetch(url.href)
49
+ .then((res) => res.json())
50
+ .then((menuSliderData) => {
51
+ resolve(menuSliderData.banners);
52
+ })
53
+ .catch((err) => {
54
+ console.error(err);
55
+ this.hasErrors = true;
56
+ reject(err);
57
+ }).finally(() => {
58
+ this.isLoading = false;
59
+ });
60
+ });
95
61
  }
96
- }
97
- static get is() { return "general-slider-navigation"; }
98
- static get encapsulation() { return "shadow"; }
99
- static get originalStyleUrls() { return {
100
- "$": ["general-slider-navigation.scss"]
101
- }; }
102
- static get styleUrls() { return {
103
- "$": ["general-slider-navigation.css"]
104
- }; }
105
- static get properties() { return {
106
- "clientStyling": {
107
- "type": "string",
108
- "mutable": false,
109
- "complexType": {
110
- "original": "string",
111
- "resolved": "string",
112
- "references": {}
113
- },
114
- "required": false,
115
- "optional": false,
116
- "docs": {
117
- "tags": [],
118
- "text": "Client custom styling via inline style"
119
- },
120
- "attribute": "client-styling",
121
- "reflect": true,
122
- "defaultValue": "''"
123
- },
124
- "clientStylingUrl": {
125
- "type": "string",
126
- "mutable": false,
127
- "complexType": {
128
- "original": "string",
129
- "resolved": "string",
130
- "references": {}
131
- },
132
- "required": false,
133
- "optional": false,
134
- "docs": {
135
- "tags": [],
136
- "text": "Client custom styling via url"
137
- },
138
- "attribute": "client-styling-url",
139
- "reflect": true,
140
- "defaultValue": "''"
141
- },
142
- "cmsEndpoint": {
143
- "type": "string",
144
- "mutable": false,
145
- "complexType": {
146
- "original": "string",
147
- "resolved": "string",
148
- "references": {}
149
- },
150
- "required": true,
151
- "optional": false,
152
- "docs": {
153
- "tags": [],
154
- "text": "Endpoint URL for the source of data"
155
- },
156
- "attribute": "cms-endpoint",
157
- "reflect": true
158
- },
159
- "cmsEnv": {
160
- "type": "string",
161
- "mutable": false,
162
- "complexType": {
163
- "original": "string",
164
- "resolved": "string",
165
- "references": {}
166
- },
167
- "required": false,
168
- "optional": false,
169
- "docs": {
170
- "tags": [],
171
- "text": "CMS Endpoint stage"
172
- },
173
- "attribute": "cms-env",
174
- "reflect": true,
175
- "defaultValue": "'stage'"
176
- },
177
- "language": {
178
- "type": "string",
179
- "mutable": false,
180
- "complexType": {
181
- "original": "string",
182
- "resolved": "string",
183
- "references": {}
184
- },
185
- "required": false,
186
- "optional": false,
187
- "docs": {
188
- "tags": [],
189
- "text": "Language of the widget"
190
- },
191
- "attribute": "language",
192
- "reflect": true,
193
- "defaultValue": "'en'"
194
- },
195
- "userRoles": {
196
- "type": "string",
197
- "mutable": false,
198
- "complexType": {
199
- "original": "string",
200
- "resolved": "string",
201
- "references": {}
202
- },
203
- "required": false,
204
- "optional": false,
205
- "docs": {
206
- "tags": [],
207
- "text": "User roles"
208
- },
209
- "attribute": "user-roles",
210
- "reflect": true,
211
- "defaultValue": "'everyone'"
212
- },
213
- "bulletNavigation": {
214
- "type": "boolean",
215
- "mutable": false,
216
- "complexType": {
217
- "original": "boolean",
218
- "resolved": "boolean",
219
- "references": {}
220
- },
221
- "required": false,
222
- "optional": false,
223
- "docs": {
224
- "tags": [],
225
- "text": "Show bullet navigation under slides"
226
- },
227
- "attribute": "bullet-navigation",
228
- "reflect": true,
229
- "defaultValue": "true"
230
- },
231
- "slideTimer": {
232
- "type": "number",
233
- "mutable": false,
234
- "complexType": {
235
- "original": "number",
236
- "resolved": "number",
237
- "references": {}
238
- },
239
- "required": false,
240
- "optional": false,
241
- "docs": {
242
- "tags": [],
243
- "text": "Timer for auto sliding"
244
- },
245
- "attribute": "slide-timer",
246
- "reflect": true
247
- },
248
- "sliderMobileWidth": {
249
- "type": "number",
250
- "mutable": false,
251
- "complexType": {
252
- "original": "number",
253
- "resolved": "number",
254
- "references": {}
255
- },
256
- "required": false,
257
- "optional": false,
258
- "docs": {
259
- "tags": [],
260
- "text": "Mobile width for sliders"
261
- },
262
- "attribute": "slider-mobile-width",
263
- "reflect": true,
264
- "defaultValue": "200"
265
- },
266
- "sliderDesktopWidth": {
267
- "type": "number",
268
- "mutable": false,
269
- "complexType": {
270
- "original": "number",
271
- "resolved": "number",
272
- "references": {}
273
- },
274
- "required": false,
275
- "optional": false,
276
- "docs": {
277
- "tags": [],
278
- "text": "Desktop width for sliders"
279
- },
280
- "attribute": "slider-desktop-width",
281
- "reflect": true,
282
- "defaultValue": "300"
283
- },
284
- "translationUrl": {
285
- "type": "string",
286
- "mutable": false,
287
- "complexType": {
288
- "original": "string",
289
- "resolved": "string",
290
- "references": {}
291
- },
292
- "required": false,
293
- "optional": false,
294
- "docs": {
295
- "tags": [],
296
- "text": "Translation via url"
297
- },
298
- "attribute": "translation-url",
299
- "reflect": true,
300
- "defaultValue": "''"
62
+ render() {
63
+ if (this.hasErrors) {
64
+ return (h("div", { class: "PageError" }, h("div", { class: "TitleError" }, translate('error', this.language))));
65
+ }
66
+ if (!this.isLoading) {
67
+ return (h("div", null, h("carousel-component", { "slider-data": this.sliderData, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "bullet-navigation": this.bulletNavigation, "slide-timer": this.slideTimer, "translation-url": this.translationUrl, "slider-mobile-width": this.sliderMobileWidth, "slider-desktop-width": this.sliderDesktopWidth })));
68
+ }
69
+ }
70
+ static get is() { return "general-slider-navigation"; }
71
+ static get encapsulation() { return "shadow"; }
72
+ static get originalStyleUrls() {
73
+ return {
74
+ "$": ["general-slider-navigation.scss"]
75
+ };
76
+ }
77
+ static get styleUrls() {
78
+ return {
79
+ "$": ["general-slider-navigation.css"]
80
+ };
81
+ }
82
+ static get properties() {
83
+ return {
84
+ "clientStyling": {
85
+ "type": "string",
86
+ "mutable": false,
87
+ "complexType": {
88
+ "original": "string",
89
+ "resolved": "string",
90
+ "references": {}
91
+ },
92
+ "required": false,
93
+ "optional": false,
94
+ "docs": {
95
+ "tags": [],
96
+ "text": "Client custom styling via inline style"
97
+ },
98
+ "attribute": "client-styling",
99
+ "reflect": true,
100
+ "defaultValue": "''"
101
+ },
102
+ "clientStylingUrl": {
103
+ "type": "string",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "string",
107
+ "resolved": "string",
108
+ "references": {}
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": "Client custom styling via url"
115
+ },
116
+ "attribute": "client-styling-url",
117
+ "reflect": true,
118
+ "defaultValue": "''"
119
+ },
120
+ "cmsEndpoint": {
121
+ "type": "string",
122
+ "mutable": false,
123
+ "complexType": {
124
+ "original": "string",
125
+ "resolved": "string",
126
+ "references": {}
127
+ },
128
+ "required": true,
129
+ "optional": false,
130
+ "docs": {
131
+ "tags": [],
132
+ "text": "Endpoint URL for the source of data"
133
+ },
134
+ "attribute": "cms-endpoint",
135
+ "reflect": true
136
+ },
137
+ "cmsEnv": {
138
+ "type": "string",
139
+ "mutable": false,
140
+ "complexType": {
141
+ "original": "string",
142
+ "resolved": "string",
143
+ "references": {}
144
+ },
145
+ "required": false,
146
+ "optional": false,
147
+ "docs": {
148
+ "tags": [],
149
+ "text": "CMS Endpoint stage"
150
+ },
151
+ "attribute": "cms-env",
152
+ "reflect": true,
153
+ "defaultValue": "'stage'"
154
+ },
155
+ "language": {
156
+ "type": "string",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "string",
160
+ "resolved": "string",
161
+ "references": {}
162
+ },
163
+ "required": false,
164
+ "optional": false,
165
+ "docs": {
166
+ "tags": [],
167
+ "text": "Language of the widget"
168
+ },
169
+ "attribute": "language",
170
+ "reflect": true,
171
+ "defaultValue": "'en'"
172
+ },
173
+ "userRoles": {
174
+ "type": "string",
175
+ "mutable": false,
176
+ "complexType": {
177
+ "original": "string",
178
+ "resolved": "string",
179
+ "references": {}
180
+ },
181
+ "required": false,
182
+ "optional": false,
183
+ "docs": {
184
+ "tags": [],
185
+ "text": "User roles"
186
+ },
187
+ "attribute": "user-roles",
188
+ "reflect": true,
189
+ "defaultValue": "'everyone'"
190
+ },
191
+ "bulletNavigation": {
192
+ "type": "boolean",
193
+ "mutable": false,
194
+ "complexType": {
195
+ "original": "boolean",
196
+ "resolved": "boolean",
197
+ "references": {}
198
+ },
199
+ "required": false,
200
+ "optional": false,
201
+ "docs": {
202
+ "tags": [],
203
+ "text": "Show bullet navigation under slides"
204
+ },
205
+ "attribute": "bullet-navigation",
206
+ "reflect": true,
207
+ "defaultValue": "true"
208
+ },
209
+ "slideTimer": {
210
+ "type": "number",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "number",
214
+ "resolved": "number",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": "Timer for auto sliding"
222
+ },
223
+ "attribute": "slide-timer",
224
+ "reflect": true
225
+ },
226
+ "sliderMobileWidth": {
227
+ "type": "number",
228
+ "mutable": false,
229
+ "complexType": {
230
+ "original": "number",
231
+ "resolved": "number",
232
+ "references": {}
233
+ },
234
+ "required": false,
235
+ "optional": false,
236
+ "docs": {
237
+ "tags": [],
238
+ "text": "Mobile width for sliders"
239
+ },
240
+ "attribute": "slider-mobile-width",
241
+ "reflect": true,
242
+ "defaultValue": "200"
243
+ },
244
+ "sliderDesktopWidth": {
245
+ "type": "number",
246
+ "mutable": false,
247
+ "complexType": {
248
+ "original": "number",
249
+ "resolved": "number",
250
+ "references": {}
251
+ },
252
+ "required": false,
253
+ "optional": false,
254
+ "docs": {
255
+ "tags": [],
256
+ "text": "Desktop width for sliders"
257
+ },
258
+ "attribute": "slider-desktop-width",
259
+ "reflect": true,
260
+ "defaultValue": "300"
261
+ },
262
+ "translationUrl": {
263
+ "type": "string",
264
+ "mutable": false,
265
+ "complexType": {
266
+ "original": "string",
267
+ "resolved": "string",
268
+ "references": {}
269
+ },
270
+ "required": false,
271
+ "optional": false,
272
+ "docs": {
273
+ "tags": [],
274
+ "text": "Translation via url"
275
+ },
276
+ "attribute": "translation-url",
277
+ "reflect": true,
278
+ "defaultValue": "''"
279
+ }
280
+ };
281
+ }
282
+ static get states() {
283
+ return {
284
+ "isLoading": {},
285
+ "hasErrors": {},
286
+ "device": {}
287
+ };
288
+ }
289
+ static get watchers() {
290
+ return [{
291
+ "propName": "translationUrl",
292
+ "methodName": "handleNewTranslations"
293
+ }, {
294
+ "propName": "cmsEndpoint",
295
+ "methodName": "watchEndpoint"
296
+ }, {
297
+ "propName": "language",
298
+ "methodName": "watchEndpoint"
299
+ }];
301
300
  }
302
- }; }
303
- static get states() { return {
304
- "isLoading": {},
305
- "hasErrors": {},
306
- "device": {}
307
- }; }
308
- static get watchers() { return [{
309
- "propName": "translationUrl",
310
- "methodName": "handleNewTranslations"
311
- }, {
312
- "propName": "cmsEndpoint",
313
- "methodName": "watchEndpoint"
314
- }, {
315
- "propName": "language",
316
- "methodName": "watchEndpoint"
317
- }]; }
318
301
  }
@@ -0,0 +1 @@
1
+ export { GeneralSliderNavigation } from './general-slider-navigation';