@everymatrix/casino-engagement-suite-modal 1.36.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/casino-engagement-suite-modal/casino-engagement-suite-modal.esm.js +1 -0
- package/dist/casino-engagement-suite-modal/index.esm.js +0 -0
- package/dist/casino-engagement-suite-modal/p-888fb26b.entry.js +1 -0
- package/dist/casino-engagement-suite-modal/p-d68e9c79.js +1 -0
- package/dist/cjs/casino-engagement-suite-modal.cjs.entry.js +68 -0
- package/dist/cjs/casino-engagement-suite-modal.cjs.js +19 -0
- package/dist/cjs/index-f0b55429.js +1194 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/casino-engagement-suite-modal/casino-engagement-suite-modal.css +113 -0
- package/dist/collection/components/casino-engagement-suite-modal/casino-engagement-suite-modal.js +231 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/constants.js +4 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/casino-engagement-suite-modal.d.ts +11 -0
- package/dist/components/casino-engagement-suite-modal.js +92 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/casino-engagement-suite-modal.entry.js +64 -0
- package/dist/esm/casino-engagement-suite-modal.js +17 -0
- package/dist/esm/index-263f8cbc.js +1167 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-modal/.stencil/packages/casino-engagement-suite-modal/stencil.config.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-modal/casino-engagement-suite-modal.d.ts +25 -0
- package/dist/types/components.d.ts +66 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/constants.d.ts +4 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-f0b55429.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
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-engagement-suite-modal.cjs",[[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"header":[1],"icon":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"limitStylingAppends":[32]}]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
package/dist/collection/components/casino-engagement-suite-modal/casino-engagement-suite-modal.css
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
* {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
button {
|
|
12
|
+
border: none;
|
|
13
|
+
background: none;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
button:focus {
|
|
17
|
+
outline: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ModalOverlay {
|
|
21
|
+
display: none;
|
|
22
|
+
position: fixed;
|
|
23
|
+
top: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ModalOverlay.Open {
|
|
33
|
+
display: flex;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.IconCloseContainer {
|
|
37
|
+
width: 100%;
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: end;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ModalContent {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: center;
|
|
46
|
+
font-family: "Montserrat", sans-serif;
|
|
47
|
+
position: relative;
|
|
48
|
+
color: var(--emw--color-typography, #FFFFFF);
|
|
49
|
+
background-color: var(--emw--color-background, #1E1638);
|
|
50
|
+
padding: 12px;
|
|
51
|
+
border-radius: 8px;
|
|
52
|
+
width: 450px;
|
|
53
|
+
max-width: 100%;
|
|
54
|
+
text-align: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.GradientBorder::before {
|
|
58
|
+
content: "";
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: -1px;
|
|
61
|
+
left: -1px;
|
|
62
|
+
right: -1px;
|
|
63
|
+
bottom: -1px;
|
|
64
|
+
border-radius: 9px;
|
|
65
|
+
background: linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);
|
|
66
|
+
z-index: -1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ModalHeader {
|
|
70
|
+
font-weight: var(--emw--font-weight-semibold, 600);
|
|
71
|
+
font-size: 20px;
|
|
72
|
+
margin-top: 12px;
|
|
73
|
+
padding: 0 16px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ModalIcon {
|
|
77
|
+
width: 44px;
|
|
78
|
+
height: 44px;
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
background-size: cover;
|
|
81
|
+
background-position: center;
|
|
82
|
+
background-image: url("https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg");
|
|
83
|
+
margin-top: 12px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ModalBody {
|
|
87
|
+
margin-top: 20px;
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
font-family: "Inter", sans-serif;
|
|
90
|
+
font-weight: var(--emw--font-weight-normal, 400);
|
|
91
|
+
color: var(--emw--color-gray-100, #BBB9C3);
|
|
92
|
+
padding: 0 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ModalFooter {
|
|
96
|
+
margin-top: 40px;
|
|
97
|
+
margin-bottom: 28px;
|
|
98
|
+
padding: 0 16px;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ModalOverlay.Mobile .ModalBody,
|
|
103
|
+
.ModalOverlay.Mobile .ModalBody {
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
}
|
|
106
|
+
.ModalOverlay.Mobile .ModalContent,
|
|
107
|
+
.ModalOverlay.Mobile .ModalContent {
|
|
108
|
+
width: 318px;
|
|
109
|
+
}
|
|
110
|
+
.ModalOverlay.Mobile .ModalHeader h1,
|
|
111
|
+
.ModalOverlay.Mobile .ModalHeader h1 {
|
|
112
|
+
font-size: 20px;
|
|
113
|
+
}
|
package/dist/collection/components/casino-engagement-suite-modal/casino-engagement-suite-modal.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { Component, Prop, h, Event, State, Element } from '@stencil/core';
|
|
2
|
+
import { MODAL_TYPES } from '../../utils/constants';
|
|
3
|
+
export class CasinoEngagementSuiteModal {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Client custom styling via string
|
|
7
|
+
*/
|
|
8
|
+
this.clientStyling = '';
|
|
9
|
+
/**
|
|
10
|
+
* Client custom styling via url
|
|
11
|
+
*/
|
|
12
|
+
this.clientStylingUrl = '';
|
|
13
|
+
this.device = 'Mobile';
|
|
14
|
+
this.limitStylingAppends = false;
|
|
15
|
+
this.handleCloseClick = () => {
|
|
16
|
+
this.closeModal.emit(this.modalType);
|
|
17
|
+
};
|
|
18
|
+
this.setClientStyling = () => {
|
|
19
|
+
let sheet = document.createElement('style');
|
|
20
|
+
sheet.innerHTML = this.clientStyling;
|
|
21
|
+
this.host.prepend(sheet);
|
|
22
|
+
};
|
|
23
|
+
this.setClientStylingURL = () => {
|
|
24
|
+
let url = new URL(this.clientStylingUrl);
|
|
25
|
+
let cssFile = document.createElement('style');
|
|
26
|
+
fetch(url.href)
|
|
27
|
+
.then((res) => res.text())
|
|
28
|
+
.then((data) => {
|
|
29
|
+
cssFile.innerHTML = data;
|
|
30
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
31
|
+
})
|
|
32
|
+
.catch((err) => {
|
|
33
|
+
console.log('Error ', err);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
componentDidRender() {
|
|
38
|
+
if (!this.limitStylingAppends && this.host) {
|
|
39
|
+
if (this.clientStyling)
|
|
40
|
+
this.setClientStyling();
|
|
41
|
+
if (this.clientStylingUrl)
|
|
42
|
+
this.setClientStylingURL();
|
|
43
|
+
this.limitStylingAppends = true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device}` },
|
|
48
|
+
h("div", { class: "ModalContent GradientBorder" },
|
|
49
|
+
h("div", { class: 'IconCloseContainer' },
|
|
50
|
+
h("button", { class: "IconCloseButton", onClick: this.handleCloseClick },
|
|
51
|
+
h("img", { src: this.icon, alt: "\u0421lose modal" }))),
|
|
52
|
+
this.contentIcon ? (h("div", { class: "ModalIcon", style: {
|
|
53
|
+
background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
|
|
54
|
+
} })) : this.modalType === MODAL_TYPES.REWARD_MODAL ? (h("div", { class: "ModalIcon" })) : null,
|
|
55
|
+
h("div", { class: "ModalHeader" },
|
|
56
|
+
h("h1", null, this.header)),
|
|
57
|
+
h("div", { class: "ModalBody" },
|
|
58
|
+
h("slot", { name: "body" })),
|
|
59
|
+
h("div", { class: "ModalFooter" },
|
|
60
|
+
h("slot", { name: "footer" })))));
|
|
61
|
+
}
|
|
62
|
+
static get is() { return "casino-engagement-suite-modal"; }
|
|
63
|
+
static get encapsulation() { return "shadow"; }
|
|
64
|
+
static get originalStyleUrls() { return {
|
|
65
|
+
"$": ["casino-engagement-suite-modal.scss"]
|
|
66
|
+
}; }
|
|
67
|
+
static get styleUrls() { return {
|
|
68
|
+
"$": ["casino-engagement-suite-modal.css"]
|
|
69
|
+
}; }
|
|
70
|
+
static get properties() { return {
|
|
71
|
+
"clientStyling": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string",
|
|
76
|
+
"resolved": "string",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": "Client custom styling via string"
|
|
84
|
+
},
|
|
85
|
+
"attribute": "client-styling",
|
|
86
|
+
"reflect": true,
|
|
87
|
+
"defaultValue": "''"
|
|
88
|
+
},
|
|
89
|
+
"clientStylingUrl": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"mutable": false,
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "string",
|
|
94
|
+
"resolved": "string",
|
|
95
|
+
"references": {}
|
|
96
|
+
},
|
|
97
|
+
"required": false,
|
|
98
|
+
"optional": false,
|
|
99
|
+
"docs": {
|
|
100
|
+
"tags": [],
|
|
101
|
+
"text": "Client custom styling via url"
|
|
102
|
+
},
|
|
103
|
+
"attribute": "client-styling-url",
|
|
104
|
+
"reflect": true,
|
|
105
|
+
"defaultValue": "''"
|
|
106
|
+
},
|
|
107
|
+
"isOpen": {
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "boolean",
|
|
112
|
+
"resolved": "boolean",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": ""
|
|
120
|
+
},
|
|
121
|
+
"attribute": "is-open",
|
|
122
|
+
"reflect": false
|
|
123
|
+
},
|
|
124
|
+
"header": {
|
|
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": ""
|
|
137
|
+
},
|
|
138
|
+
"attribute": "header",
|
|
139
|
+
"reflect": false
|
|
140
|
+
},
|
|
141
|
+
"icon": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "string",
|
|
146
|
+
"resolved": "string",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": ""
|
|
154
|
+
},
|
|
155
|
+
"attribute": "icon",
|
|
156
|
+
"reflect": false
|
|
157
|
+
},
|
|
158
|
+
"contentIcon": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"mutable": false,
|
|
161
|
+
"complexType": {
|
|
162
|
+
"original": "string",
|
|
163
|
+
"resolved": "string",
|
|
164
|
+
"references": {}
|
|
165
|
+
},
|
|
166
|
+
"required": false,
|
|
167
|
+
"optional": false,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": ""
|
|
171
|
+
},
|
|
172
|
+
"attribute": "content-icon",
|
|
173
|
+
"reflect": false
|
|
174
|
+
},
|
|
175
|
+
"modalType": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"mutable": false,
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "string",
|
|
180
|
+
"resolved": "string",
|
|
181
|
+
"references": {}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": false,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": ""
|
|
188
|
+
},
|
|
189
|
+
"attribute": "modal-type",
|
|
190
|
+
"reflect": false
|
|
191
|
+
},
|
|
192
|
+
"device": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"mutable": false,
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "\"Mobile\" | \"Tablet\" | \"Desktop\"",
|
|
197
|
+
"resolved": "\"Desktop\" | \"Mobile\" | \"Tablet\"",
|
|
198
|
+
"references": {}
|
|
199
|
+
},
|
|
200
|
+
"required": false,
|
|
201
|
+
"optional": false,
|
|
202
|
+
"docs": {
|
|
203
|
+
"tags": [],
|
|
204
|
+
"text": ""
|
|
205
|
+
},
|
|
206
|
+
"attribute": "device",
|
|
207
|
+
"reflect": false,
|
|
208
|
+
"defaultValue": "'Mobile' as 'Mobile' | 'Tablet' | 'Desktop'"
|
|
209
|
+
}
|
|
210
|
+
}; }
|
|
211
|
+
static get states() { return {
|
|
212
|
+
"limitStylingAppends": {}
|
|
213
|
+
}; }
|
|
214
|
+
static get events() { return [{
|
|
215
|
+
"method": "closeModal",
|
|
216
|
+
"name": "closeModal",
|
|
217
|
+
"bubbles": true,
|
|
218
|
+
"cancelable": true,
|
|
219
|
+
"composed": true,
|
|
220
|
+
"docs": {
|
|
221
|
+
"tags": [],
|
|
222
|
+
"text": ""
|
|
223
|
+
},
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "any",
|
|
226
|
+
"resolved": "any",
|
|
227
|
+
"references": {}
|
|
228
|
+
}
|
|
229
|
+
}]; }
|
|
230
|
+
static get elementRef() { return "host"; }
|
|
231
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CasinoEngagementSuiteModal extends Components.CasinoEngagementSuiteModal, HTMLElement {}
|
|
4
|
+
export const CasinoEngagementSuiteModal: {
|
|
5
|
+
prototype: CasinoEngagementSuiteModal;
|
|
6
|
+
new (): CasinoEngagementSuiteModal;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const MODAL_TYPES = {
|
|
4
|
+
REWARD_MODAL: 'REWARD_MODAL',
|
|
5
|
+
TARGET_MODAL: 'TARGET_MODAL'
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const casinoEngagementSuiteModalCss = ":host{display:block}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;background-position:center;background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg\");margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}";
|
|
9
|
+
|
|
10
|
+
const CasinoEngagementSuiteModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.__registerHost();
|
|
14
|
+
this.__attachShadow();
|
|
15
|
+
this.closeModal = createEvent(this, "closeModal", 7);
|
|
16
|
+
/**
|
|
17
|
+
* Client custom styling via string
|
|
18
|
+
*/
|
|
19
|
+
this.clientStyling = '';
|
|
20
|
+
/**
|
|
21
|
+
* Client custom styling via url
|
|
22
|
+
*/
|
|
23
|
+
this.clientStylingUrl = '';
|
|
24
|
+
this.device = 'Mobile';
|
|
25
|
+
this.limitStylingAppends = false;
|
|
26
|
+
this.handleCloseClick = () => {
|
|
27
|
+
this.closeModal.emit(this.modalType);
|
|
28
|
+
};
|
|
29
|
+
this.setClientStyling = () => {
|
|
30
|
+
let sheet = document.createElement('style');
|
|
31
|
+
sheet.innerHTML = this.clientStyling;
|
|
32
|
+
this.host.prepend(sheet);
|
|
33
|
+
};
|
|
34
|
+
this.setClientStylingURL = () => {
|
|
35
|
+
let url = new URL(this.clientStylingUrl);
|
|
36
|
+
let cssFile = document.createElement('style');
|
|
37
|
+
fetch(url.href)
|
|
38
|
+
.then((res) => res.text())
|
|
39
|
+
.then((data) => {
|
|
40
|
+
cssFile.innerHTML = data;
|
|
41
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
42
|
+
})
|
|
43
|
+
.catch((err) => {
|
|
44
|
+
console.log('Error ', err);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
componentDidRender() {
|
|
49
|
+
if (!this.limitStylingAppends && this.host) {
|
|
50
|
+
if (this.clientStyling)
|
|
51
|
+
this.setClientStyling();
|
|
52
|
+
if (this.clientStylingUrl)
|
|
53
|
+
this.setClientStylingURL();
|
|
54
|
+
this.limitStylingAppends = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device}` }, h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: this.icon, alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
|
|
59
|
+
background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
|
|
60
|
+
} })) : this.modalType === MODAL_TYPES.REWARD_MODAL ? (h("div", { class: "ModalIcon" })) : null, h("div", { class: "ModalHeader" }, h("h1", null, this.header)), h("div", { class: "ModalBody" }, h("slot", { name: "body" })), h("div", { class: "ModalFooter" }, h("slot", { name: "footer" })))));
|
|
61
|
+
}
|
|
62
|
+
get host() { return this; }
|
|
63
|
+
static get style() { return casinoEngagementSuiteModalCss; }
|
|
64
|
+
}, [1, "casino-engagement-suite-modal", {
|
|
65
|
+
"clientStyling": [513, "client-styling"],
|
|
66
|
+
"clientStylingUrl": [513, "client-styling-url"],
|
|
67
|
+
"isOpen": [4, "is-open"],
|
|
68
|
+
"header": [1],
|
|
69
|
+
"icon": [1],
|
|
70
|
+
"contentIcon": [1, "content-icon"],
|
|
71
|
+
"modalType": [1, "modal-type"],
|
|
72
|
+
"device": [1],
|
|
73
|
+
"limitStylingAppends": [32]
|
|
74
|
+
}]);
|
|
75
|
+
function defineCustomElement$1() {
|
|
76
|
+
if (typeof customElements === "undefined") {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const components = ["casino-engagement-suite-modal"];
|
|
80
|
+
components.forEach(tagName => { switch (tagName) {
|
|
81
|
+
case "casino-engagement-suite-modal":
|
|
82
|
+
if (!customElements.get(tagName)) {
|
|
83
|
+
customElements.define(tagName, CasinoEngagementSuiteModal$1);
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
} });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const CasinoEngagementSuiteModal = CasinoEngagementSuiteModal$1;
|
|
90
|
+
const defineCustomElement = defineCustomElement$1;
|
|
91
|
+
|
|
92
|
+
export { CasinoEngagementSuiteModal, defineCustomElement };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* CasinoEngagementSuiteModal custom elements */
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Used to manually set the base path where assets can be found.
|
|
7
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setAssetPath: (path: string) => void;
|
|
16
|
+
|
|
17
|
+
export interface SetPlatformOptions {
|
|
18
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
26
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-263f8cbc.js';
|
|
2
|
+
|
|
3
|
+
const MODAL_TYPES = {
|
|
4
|
+
REWARD_MODAL: 'REWARD_MODAL',
|
|
5
|
+
TARGET_MODAL: 'TARGET_MODAL'
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const casinoEngagementSuiteModalCss = ":host{display:block}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;background-position:center;background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg\");margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}";
|
|
9
|
+
|
|
10
|
+
const CasinoEngagementSuiteModal = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
registerInstance(this, hostRef);
|
|
13
|
+
this.closeModal = createEvent(this, "closeModal", 7);
|
|
14
|
+
/**
|
|
15
|
+
* Client custom styling via string
|
|
16
|
+
*/
|
|
17
|
+
this.clientStyling = '';
|
|
18
|
+
/**
|
|
19
|
+
* Client custom styling via url
|
|
20
|
+
*/
|
|
21
|
+
this.clientStylingUrl = '';
|
|
22
|
+
this.device = 'Mobile';
|
|
23
|
+
this.limitStylingAppends = false;
|
|
24
|
+
this.handleCloseClick = () => {
|
|
25
|
+
this.closeModal.emit(this.modalType);
|
|
26
|
+
};
|
|
27
|
+
this.setClientStyling = () => {
|
|
28
|
+
let sheet = document.createElement('style');
|
|
29
|
+
sheet.innerHTML = this.clientStyling;
|
|
30
|
+
this.host.prepend(sheet);
|
|
31
|
+
};
|
|
32
|
+
this.setClientStylingURL = () => {
|
|
33
|
+
let url = new URL(this.clientStylingUrl);
|
|
34
|
+
let cssFile = document.createElement('style');
|
|
35
|
+
fetch(url.href)
|
|
36
|
+
.then((res) => res.text())
|
|
37
|
+
.then((data) => {
|
|
38
|
+
cssFile.innerHTML = data;
|
|
39
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
console.log('Error ', err);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
componentDidRender() {
|
|
47
|
+
if (!this.limitStylingAppends && this.host) {
|
|
48
|
+
if (this.clientStyling)
|
|
49
|
+
this.setClientStyling();
|
|
50
|
+
if (this.clientStylingUrl)
|
|
51
|
+
this.setClientStylingURL();
|
|
52
|
+
this.limitStylingAppends = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device}` }, h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: this.icon, alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
|
|
57
|
+
background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
|
|
58
|
+
} })) : this.modalType === MODAL_TYPES.REWARD_MODAL ? (h("div", { class: "ModalIcon" })) : null, h("div", { class: "ModalHeader" }, h("h1", null, this.header)), h("div", { class: "ModalBody" }, h("slot", { name: "body" })), h("div", { class: "ModalFooter" }, h("slot", { name: "footer" })))));
|
|
59
|
+
}
|
|
60
|
+
get host() { return getElement(this); }
|
|
61
|
+
};
|
|
62
|
+
CasinoEngagementSuiteModal.style = casinoEngagementSuiteModalCss;
|
|
63
|
+
|
|
64
|
+
export { CasinoEngagementSuiteModal as casino_engagement_suite_modal };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-263f8cbc.js';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
5
|
+
*/
|
|
6
|
+
const patchBrowser = () => {
|
|
7
|
+
const importMeta = import.meta.url;
|
|
8
|
+
const opts = {};
|
|
9
|
+
if (importMeta !== '') {
|
|
10
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
11
|
+
}
|
|
12
|
+
return promiseResolve(opts);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
patchBrowser().then(options => {
|
|
16
|
+
return bootstrapLazy([["casino-engagement-suite-modal",[[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"header":[1],"icon":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"limitStylingAppends":[32]}]]]], options);
|
|
17
|
+
});
|