@everymatrix/lottery-tipping-dialog 1.87.31 → 1.87.33
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/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{lottery-tipping-dialog-66ecf364.js → lottery-tipping-dialog-be118514.js} +101 -49
- package/dist/cjs/lottery-tipping-dialog.cjs.entry.js +1 -1
- package/dist/cjs/lottery-tipping-dialog.cjs.js +1 -1
- package/dist/collection/components/lottery-tipping-dialog/lottery-tipping-dialog.css +1 -0
- package/dist/collection/components/lottery-tipping-dialog/lottery-tipping-dialog.js +28 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{lottery-tipping-dialog-cf6b2617.js → lottery-tipping-dialog-3f3d610b.js} +101 -49
- package/dist/esm/lottery-tipping-dialog.entry.js +1 -1
- package/dist/esm/lottery-tipping-dialog.js +1 -1
- package/dist/lottery-tipping-dialog/index.esm.js +1 -1
- package/dist/lottery-tipping-dialog/lottery-tipping-dialog-3f3d610b.js +1 -0
- package/dist/lottery-tipping-dialog/lottery-tipping-dialog.entry.js +1 -1
- package/dist/lottery-tipping-dialog/lottery-tipping-dialog.esm.js +1 -1
- package/dist/types/components/lottery-tipping-dialog/lottery-tipping-dialog.d.ts +5 -0
- package/dist/types/components.d.ts +10 -0
- package/package.json +1 -1
- package/dist/lottery-tipping-dialog/lottery-tipping-dialog-cf6b2617.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["lottery-tipping-dialog.cjs",[[1,"lottery-tipping-dialog",{"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"visible":[516],"dialogTitle":[1,"dialog-title"],"width":[1],"closable":[4],"mask":[4],"maskClosable":[4,"mask-closable"],"animationDuration":[2,"animation-duration"],"fullscreen":[4],"showFooter":[4,"show-footer"],"showCancelBtn":[4,"show-cancel-btn"],"language":[513],"translationUrl":[520,"translation-url"],"dialogClass":[1,"dialog-class"],"dialogStyle":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
11
|
+
return index.bootstrapLazy([["lottery-tipping-dialog.cjs",[[1,"lottery-tipping-dialog",{"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"visible":[516],"dialogTitle":[1,"dialog-title"],"width":[1],"closable":[4],"mask":[4],"maskClosable":[4,"mask-closable"],"animationDuration":[2,"animation-duration"],"fullscreen":[4],"showFooter":[4,"show-footer"],"showCancelBtn":[4,"show-cancel-btn"],"language":[513],"translationUrl":[520,"translation-url"],"dialogClass":[1,"dialog-class"],"dialogStyle":[16],"confirmLoading":[4,"confirm-loading"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -2,56 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index-8fa36c42.js');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
fr: {
|
|
17
|
-
cancel: 'Annuler',
|
|
18
|
-
confirm: 'Confirmer'
|
|
19
|
-
},
|
|
20
|
-
ar: {
|
|
21
|
-
cancel: 'إلغاء',
|
|
22
|
-
confirm: 'تأكيد'
|
|
23
|
-
},
|
|
24
|
-
hr: {
|
|
25
|
-
cancel: 'Odustani',
|
|
26
|
-
confirm: 'Potvrdi'
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const translate = (key, customLang) => {
|
|
30
|
-
const lang = customLang;
|
|
31
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
32
|
-
};
|
|
33
|
-
const getTranslations = (data) => {
|
|
34
|
-
Object.keys(data).forEach((item) => {
|
|
35
|
-
for (let key in data[item]) {
|
|
36
|
-
TRANSLATIONS[item][key] = data[item][key];
|
|
5
|
+
// This icon file is generated automatically.
|
|
6
|
+
var LoadingOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
|
|
7
|
+
const LoadingOutlined$1 = LoadingOutlined;
|
|
8
|
+
|
|
9
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
10
|
+
__assign = Object.assign || function(t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14
|
+
t[p] = s[p];
|
|
37
15
|
}
|
|
38
|
-
|
|
16
|
+
return t;
|
|
17
|
+
};
|
|
18
|
+
return __assign.apply(this, arguments);
|
|
39
19
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const response = await fetch(translationUrl);
|
|
44
|
-
if (!response.ok) {
|
|
45
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
46
|
-
}
|
|
47
|
-
const translations = await response.json();
|
|
48
|
-
getTranslations(translations);
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
console.error('Failed to fetch or parse translations from URL:', error);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
20
|
+
var defaultColors = {
|
|
21
|
+
primaryColor: '#333',
|
|
22
|
+
secondaryColor: '#E6E6E6'
|
|
54
23
|
};
|
|
24
|
+
function renderIconDefinitionToSVGElement(icond, options) {
|
|
25
|
+
if (options === void 0) { options = {}; }
|
|
26
|
+
if (typeof icond.icon === 'function') {
|
|
27
|
+
// two-tone
|
|
28
|
+
var placeholders = options.placeholders || defaultColors;
|
|
29
|
+
return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
|
|
30
|
+
}
|
|
31
|
+
// fill, outline
|
|
32
|
+
return renderAbstractNodeToSVGElement(icond.icon, options);
|
|
33
|
+
}
|
|
34
|
+
function renderAbstractNodeToSVGElement(node, options) {
|
|
35
|
+
var targetAttrs = node.tag === 'svg'
|
|
36
|
+
? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
|
|
37
|
+
var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
|
|
38
|
+
var key = nextKey;
|
|
39
|
+
var value = targetAttrs[key];
|
|
40
|
+
var token = "".concat(key, "=\"").concat(value, "\"");
|
|
41
|
+
acc.push(token);
|
|
42
|
+
return acc;
|
|
43
|
+
}, []);
|
|
44
|
+
var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
|
|
45
|
+
var children = (node.children || [])
|
|
46
|
+
.map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
|
|
47
|
+
.join('');
|
|
48
|
+
if (children && children.length) {
|
|
49
|
+
return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
|
|
50
|
+
}
|
|
51
|
+
return "<".concat(node.tag).concat(attrsToken, " />");
|
|
52
|
+
}
|
|
55
53
|
|
|
56
54
|
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
57
55
|
|
|
@@ -171,7 +169,58 @@ function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
|
171
169
|
});
|
|
172
170
|
}
|
|
173
171
|
|
|
174
|
-
const
|
|
172
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
173
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
174
|
+
const TRANSLATIONS = {
|
|
175
|
+
en: {
|
|
176
|
+
cancel: 'Cancel',
|
|
177
|
+
confirm: 'Confirm'
|
|
178
|
+
},
|
|
179
|
+
ro: {
|
|
180
|
+
cancel: 'Anulează',
|
|
181
|
+
confirm: 'Confirmă'
|
|
182
|
+
},
|
|
183
|
+
fr: {
|
|
184
|
+
cancel: 'Annuler',
|
|
185
|
+
confirm: 'Confirmer'
|
|
186
|
+
},
|
|
187
|
+
ar: {
|
|
188
|
+
cancel: 'إلغاء',
|
|
189
|
+
confirm: 'تأكيد'
|
|
190
|
+
},
|
|
191
|
+
hr: {
|
|
192
|
+
cancel: 'Odustani',
|
|
193
|
+
confirm: 'Potvrdi'
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const translate = (key, customLang) => {
|
|
197
|
+
const lang = customLang;
|
|
198
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
199
|
+
};
|
|
200
|
+
const getTranslations = (data) => {
|
|
201
|
+
Object.keys(data).forEach((item) => {
|
|
202
|
+
for (let key in data[item]) {
|
|
203
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
const resolveTranslationUrl = async (translationUrl) => {
|
|
208
|
+
if (translationUrl) {
|
|
209
|
+
try {
|
|
210
|
+
const response = await fetch(translationUrl);
|
|
211
|
+
if (!response.ok) {
|
|
212
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
213
|
+
}
|
|
214
|
+
const translations = await response.json();
|
|
215
|
+
getTranslations(translations);
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const lotteryTippingDialogCss = ".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;min-width:60px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";
|
|
175
224
|
const LotteryTippingDialogStyle0 = lotteryTippingDialogCss;
|
|
176
225
|
|
|
177
226
|
const LotteryTippingDialog = class {
|
|
@@ -199,6 +248,7 @@ const LotteryTippingDialog = class {
|
|
|
199
248
|
this.translationUrl = undefined;
|
|
200
249
|
this.dialogClass = undefined;
|
|
201
250
|
this.dialogStyle = undefined;
|
|
251
|
+
this.confirmLoading = false;
|
|
202
252
|
}
|
|
203
253
|
handleClientStylingChange(newValue, oldValue) {
|
|
204
254
|
if (newValue != oldValue) {
|
|
@@ -266,7 +316,9 @@ const LotteryTippingDialog = class {
|
|
|
266
316
|
maxHeight: 'calc(100vh - 62px)',
|
|
267
317
|
overflowY: 'auto'
|
|
268
318
|
};
|
|
269
|
-
return (index.h("div", { key: '
|
|
319
|
+
return (index.h("div", { key: '05dd671f10bdebda6f138e8f8039f4bc0533fe98', class: dialogWrapperClass.join(' '), ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '6e814e02770149de5495617039750461fc0a42d1', class: maskClass.join(' '), onClick: this.handleMaskClick.bind(this) }), index.h("div", { key: '4cbc5db20317ef1b0808fc4a91a53fa8b86c5f4f', part: "dialog", class: computedDialogClass, style: computedDialogStyle, role: "dialog", "aria-modal": "true", "aria-labelledby": "dialog-title" }, (this.dialogTitle || this.closable) && (index.h("div", { key: '85dc705676a37e6ea2828a7b683fc54b0eb77d17', class: "dialog-header" }, index.h("h2", { key: '85b7472d2b72801dfae19a24fc2018f3c1f1529a', id: "dialog-title", class: "dialog-title" }, this.dialogTitle), this.closable && (index.h("button", { key: '8089aaecfe511558055ee9f64214ff97030eb2a9', class: "close-btn", onClick: this.handleClose.bind(this) }, "x")))), index.h("div", { key: '776255540f30d757caa3fcaee747c79ac638ae76', class: "dialog-content", style: contentStyle }, index.h("slot", { key: '5ef964615b6ab70a9e561f8efac8fe952fe47b4e' })), this.showFooter && (index.h("div", { key: '8927a0991d916caf7852d58db996b9818687da30', class: "dialog-footer" }, index.h("slot", { key: '84de0306994ec62220ae30fa2881dadbae5544ea', name: "footer" }, this.showCancelBtn && (index.h("button", { key: 'ee87b8c3918c1f4d007923a2498142b3af2740a0', class: "cancel-btn", onClick: this.handleClose.bind(this) }, translate('cancel', this.language))), index.h("button", { key: '935cff86381b21fff07c2d4156b29779c50e5ce3', class: "confirm-btn", onClick: this.handleConfirm.bind(this), disabled: this.confirmLoading }, this.confirmLoading ? (index.h("div", { class: "Loading", innerHTML: renderIconDefinitionToSVGElement(LoadingOutlined$1, {
|
|
320
|
+
extraSVGAttrs: { width: '20px', height: '20px', fill: 'currentColor' }
|
|
321
|
+
}) })) : (translate('confirm', this.language)))))))));
|
|
270
322
|
}
|
|
271
323
|
get el() { return index.getElement(this); }
|
|
272
324
|
static get watchers() { return {
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["lottery-tipping-dialog.cjs",[[1,"lottery-tipping-dialog",{"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"visible":[516],"dialogTitle":[1,"dialog-title"],"width":[1],"closable":[4],"mask":[4],"maskClosable":[4,"mask-closable"],"animationDuration":[2,"animation-duration"],"fullscreen":[4],"showFooter":[4,"show-footer"],"showCancelBtn":[4,"show-cancel-btn"],"language":[513],"translationUrl":[520,"translation-url"],"dialogClass":[1,"dialog-class"],"dialogStyle":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["lottery-tipping-dialog.cjs",[[1,"lottery-tipping-dialog",{"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"visible":[516],"dialogTitle":[1,"dialog-title"],"width":[1],"closable":[4],"mask":[4],"maskClosable":[4,"mask-closable"],"animationDuration":[2,"animation-duration"],"fullscreen":[4],"showFooter":[4,"show-footer"],"showCancelBtn":[4,"show-cancel-btn"],"language":[513],"translationUrl":[520,"translation-url"],"dialogClass":[1,"dialog-class"],"dialogStyle":[16],"confirmLoading":[4,"confirm-loading"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { LoadingOutlined } from "@ant-design/icons-svg";
|
|
2
|
+
import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";
|
|
1
3
|
import { h } from "@stencil/core";
|
|
2
|
-
import { translate, resolveTranslationUrl } from "../../utils/locale.utils";
|
|
3
4
|
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
5
|
+
import { resolveTranslationUrl, translate } from "../../utils/locale.utils";
|
|
4
6
|
export class LotteryTippingDialog {
|
|
5
7
|
constructor() {
|
|
6
8
|
this.wasVisible = false;
|
|
@@ -21,6 +23,7 @@ export class LotteryTippingDialog {
|
|
|
21
23
|
this.translationUrl = undefined;
|
|
22
24
|
this.dialogClass = undefined;
|
|
23
25
|
this.dialogStyle = undefined;
|
|
26
|
+
this.confirmLoading = false;
|
|
24
27
|
}
|
|
25
28
|
handleClientStylingChange(newValue, oldValue) {
|
|
26
29
|
if (newValue != oldValue) {
|
|
@@ -88,7 +91,9 @@ export class LotteryTippingDialog {
|
|
|
88
91
|
maxHeight: 'calc(100vh - 62px)',
|
|
89
92
|
overflowY: 'auto'
|
|
90
93
|
};
|
|
91
|
-
return (h("div", { key: '
|
|
94
|
+
return (h("div", { key: '05dd671f10bdebda6f138e8f8039f4bc0533fe98', class: dialogWrapperClass.join(' '), ref: (el) => (this.stylingContainer = el) }, h("div", { key: '6e814e02770149de5495617039750461fc0a42d1', class: maskClass.join(' '), onClick: this.handleMaskClick.bind(this) }), h("div", { key: '4cbc5db20317ef1b0808fc4a91a53fa8b86c5f4f', part: "dialog", class: computedDialogClass, style: computedDialogStyle, role: "dialog", "aria-modal": "true", "aria-labelledby": "dialog-title" }, (this.dialogTitle || this.closable) && (h("div", { key: '85dc705676a37e6ea2828a7b683fc54b0eb77d17', class: "dialog-header" }, h("h2", { key: '85b7472d2b72801dfae19a24fc2018f3c1f1529a', id: "dialog-title", class: "dialog-title" }, this.dialogTitle), this.closable && (h("button", { key: '8089aaecfe511558055ee9f64214ff97030eb2a9', class: "close-btn", onClick: this.handleClose.bind(this) }, "x")))), h("div", { key: '776255540f30d757caa3fcaee747c79ac638ae76', class: "dialog-content", style: contentStyle }, h("slot", { key: '5ef964615b6ab70a9e561f8efac8fe952fe47b4e' })), this.showFooter && (h("div", { key: '8927a0991d916caf7852d58db996b9818687da30', class: "dialog-footer" }, h("slot", { key: '84de0306994ec62220ae30fa2881dadbae5544ea', name: "footer" }, this.showCancelBtn && (h("button", { key: 'ee87b8c3918c1f4d007923a2498142b3af2740a0', class: "cancel-btn", onClick: this.handleClose.bind(this) }, translate('cancel', this.language))), h("button", { key: '935cff86381b21fff07c2d4156b29779c50e5ce3', class: "confirm-btn", onClick: this.handleConfirm.bind(this), disabled: this.confirmLoading }, this.confirmLoading ? (h("div", { class: "Loading", innerHTML: renderIconDefinitionToSVGElement(LoadingOutlined, {
|
|
95
|
+
extraSVGAttrs: { width: '20px', height: '20px', fill: 'currentColor' }
|
|
96
|
+
}) })) : (translate('confirm', this.language)))))))));
|
|
92
97
|
}
|
|
93
98
|
static get is() { return "lottery-tipping-dialog"; }
|
|
94
99
|
static get encapsulation() { return "shadow"; }
|
|
@@ -429,6 +434,27 @@ export class LotteryTippingDialog {
|
|
|
429
434
|
"tags": [],
|
|
430
435
|
"text": "Custom styles for the dialog container"
|
|
431
436
|
}
|
|
437
|
+
},
|
|
438
|
+
"confirmLoading": {
|
|
439
|
+
"type": "boolean",
|
|
440
|
+
"mutable": false,
|
|
441
|
+
"complexType": {
|
|
442
|
+
"original": "boolean",
|
|
443
|
+
"resolved": "boolean",
|
|
444
|
+
"references": {}
|
|
445
|
+
},
|
|
446
|
+
"required": false,
|
|
447
|
+
"optional": false,
|
|
448
|
+
"docs": {
|
|
449
|
+
"tags": [{
|
|
450
|
+
"name": "default",
|
|
451
|
+
"text": "false"
|
|
452
|
+
}],
|
|
453
|
+
"text": "Whether the confirm button is in loading state"
|
|
454
|
+
},
|
|
455
|
+
"attribute": "confirm-loading",
|
|
456
|
+
"reflect": false,
|
|
457
|
+
"defaultValue": "false"
|
|
432
458
|
}
|
|
433
459
|
};
|
|
434
460
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as LotteryTippingDialog } from './lottery-tipping-dialog-
|
|
1
|
+
export { L as LotteryTippingDialog } from './lottery-tipping-dialog-3f3d610b.js';
|
|
2
2
|
import './index-9dba6e0e.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["lottery-tipping-dialog",[[1,"lottery-tipping-dialog",{"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"visible":[516],"dialogTitle":[1,"dialog-title"],"width":[1],"closable":[4],"mask":[4],"maskClosable":[4,"mask-closable"],"animationDuration":[2,"animation-duration"],"fullscreen":[4],"showFooter":[4,"show-footer"],"showCancelBtn":[4,"show-cancel-btn"],"language":[513],"translationUrl":[520,"translation-url"],"dialogClass":[1,"dialog-class"],"dialogStyle":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["lottery-tipping-dialog",[[1,"lottery-tipping-dialog",{"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"visible":[516],"dialogTitle":[1,"dialog-title"],"width":[1],"closable":[4],"mask":[4],"maskClosable":[4,"mask-closable"],"animationDuration":[2,"animation-duration"],"fullscreen":[4],"showFooter":[4,"show-footer"],"showCancelBtn":[4,"show-cancel-btn"],"language":[513],"translationUrl":[520,"translation-url"],"dialogClass":[1,"dialog-class"],"dialogStyle":[16],"confirmLoading":[4,"confirm-loading"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,55 +1,53 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-9dba6e0e.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
fr: {
|
|
15
|
-
cancel: 'Annuler',
|
|
16
|
-
confirm: 'Confirmer'
|
|
17
|
-
},
|
|
18
|
-
ar: {
|
|
19
|
-
cancel: 'إلغاء',
|
|
20
|
-
confirm: 'تأكيد'
|
|
21
|
-
},
|
|
22
|
-
hr: {
|
|
23
|
-
cancel: 'Odustani',
|
|
24
|
-
confirm: 'Potvrdi'
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const translate = (key, customLang) => {
|
|
28
|
-
const lang = customLang;
|
|
29
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
30
|
-
};
|
|
31
|
-
const getTranslations = (data) => {
|
|
32
|
-
Object.keys(data).forEach((item) => {
|
|
33
|
-
for (let key in data[item]) {
|
|
34
|
-
TRANSLATIONS[item][key] = data[item][key];
|
|
3
|
+
// This icon file is generated automatically.
|
|
4
|
+
var LoadingOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
|
|
5
|
+
const LoadingOutlined$1 = LoadingOutlined;
|
|
6
|
+
|
|
7
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
8
|
+
__assign = Object.assign || function(t) {
|
|
9
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10
|
+
s = arguments[i];
|
|
11
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
12
|
+
t[p] = s[p];
|
|
35
13
|
}
|
|
36
|
-
|
|
14
|
+
return t;
|
|
15
|
+
};
|
|
16
|
+
return __assign.apply(this, arguments);
|
|
37
17
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const response = await fetch(translationUrl);
|
|
42
|
-
if (!response.ok) {
|
|
43
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
44
|
-
}
|
|
45
|
-
const translations = await response.json();
|
|
46
|
-
getTranslations(translations);
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
console.error('Failed to fetch or parse translations from URL:', error);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
18
|
+
var defaultColors = {
|
|
19
|
+
primaryColor: '#333',
|
|
20
|
+
secondaryColor: '#E6E6E6'
|
|
52
21
|
};
|
|
22
|
+
function renderIconDefinitionToSVGElement(icond, options) {
|
|
23
|
+
if (options === void 0) { options = {}; }
|
|
24
|
+
if (typeof icond.icon === 'function') {
|
|
25
|
+
// two-tone
|
|
26
|
+
var placeholders = options.placeholders || defaultColors;
|
|
27
|
+
return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
|
|
28
|
+
}
|
|
29
|
+
// fill, outline
|
|
30
|
+
return renderAbstractNodeToSVGElement(icond.icon, options);
|
|
31
|
+
}
|
|
32
|
+
function renderAbstractNodeToSVGElement(node, options) {
|
|
33
|
+
var targetAttrs = node.tag === 'svg'
|
|
34
|
+
? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
|
|
35
|
+
var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
|
|
36
|
+
var key = nextKey;
|
|
37
|
+
var value = targetAttrs[key];
|
|
38
|
+
var token = "".concat(key, "=\"").concat(value, "\"");
|
|
39
|
+
acc.push(token);
|
|
40
|
+
return acc;
|
|
41
|
+
}, []);
|
|
42
|
+
var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
|
|
43
|
+
var children = (node.children || [])
|
|
44
|
+
.map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
|
|
45
|
+
.join('');
|
|
46
|
+
if (children && children.length) {
|
|
47
|
+
return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
|
|
48
|
+
}
|
|
49
|
+
return "<".concat(node.tag).concat(attrsToken, " />");
|
|
50
|
+
}
|
|
53
51
|
|
|
54
52
|
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
55
53
|
|
|
@@ -169,7 +167,58 @@ function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
|
169
167
|
});
|
|
170
168
|
}
|
|
171
169
|
|
|
172
|
-
const
|
|
170
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
171
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
172
|
+
const TRANSLATIONS = {
|
|
173
|
+
en: {
|
|
174
|
+
cancel: 'Cancel',
|
|
175
|
+
confirm: 'Confirm'
|
|
176
|
+
},
|
|
177
|
+
ro: {
|
|
178
|
+
cancel: 'Anulează',
|
|
179
|
+
confirm: 'Confirmă'
|
|
180
|
+
},
|
|
181
|
+
fr: {
|
|
182
|
+
cancel: 'Annuler',
|
|
183
|
+
confirm: 'Confirmer'
|
|
184
|
+
},
|
|
185
|
+
ar: {
|
|
186
|
+
cancel: 'إلغاء',
|
|
187
|
+
confirm: 'تأكيد'
|
|
188
|
+
},
|
|
189
|
+
hr: {
|
|
190
|
+
cancel: 'Odustani',
|
|
191
|
+
confirm: 'Potvrdi'
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const translate = (key, customLang) => {
|
|
195
|
+
const lang = customLang;
|
|
196
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
197
|
+
};
|
|
198
|
+
const getTranslations = (data) => {
|
|
199
|
+
Object.keys(data).forEach((item) => {
|
|
200
|
+
for (let key in data[item]) {
|
|
201
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
const resolveTranslationUrl = async (translationUrl) => {
|
|
206
|
+
if (translationUrl) {
|
|
207
|
+
try {
|
|
208
|
+
const response = await fetch(translationUrl);
|
|
209
|
+
if (!response.ok) {
|
|
210
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
211
|
+
}
|
|
212
|
+
const translations = await response.json();
|
|
213
|
+
getTranslations(translations);
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const lotteryTippingDialogCss = ".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;min-width:60px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";
|
|
173
222
|
const LotteryTippingDialogStyle0 = lotteryTippingDialogCss;
|
|
174
223
|
|
|
175
224
|
const LotteryTippingDialog = class {
|
|
@@ -197,6 +246,7 @@ const LotteryTippingDialog = class {
|
|
|
197
246
|
this.translationUrl = undefined;
|
|
198
247
|
this.dialogClass = undefined;
|
|
199
248
|
this.dialogStyle = undefined;
|
|
249
|
+
this.confirmLoading = false;
|
|
200
250
|
}
|
|
201
251
|
handleClientStylingChange(newValue, oldValue) {
|
|
202
252
|
if (newValue != oldValue) {
|
|
@@ -264,7 +314,9 @@ const LotteryTippingDialog = class {
|
|
|
264
314
|
maxHeight: 'calc(100vh - 62px)',
|
|
265
315
|
overflowY: 'auto'
|
|
266
316
|
};
|
|
267
|
-
return (h("div", { key: '
|
|
317
|
+
return (h("div", { key: '05dd671f10bdebda6f138e8f8039f4bc0533fe98', class: dialogWrapperClass.join(' '), ref: (el) => (this.stylingContainer = el) }, h("div", { key: '6e814e02770149de5495617039750461fc0a42d1', class: maskClass.join(' '), onClick: this.handleMaskClick.bind(this) }), h("div", { key: '4cbc5db20317ef1b0808fc4a91a53fa8b86c5f4f', part: "dialog", class: computedDialogClass, style: computedDialogStyle, role: "dialog", "aria-modal": "true", "aria-labelledby": "dialog-title" }, (this.dialogTitle || this.closable) && (h("div", { key: '85dc705676a37e6ea2828a7b683fc54b0eb77d17', class: "dialog-header" }, h("h2", { key: '85b7472d2b72801dfae19a24fc2018f3c1f1529a', id: "dialog-title", class: "dialog-title" }, this.dialogTitle), this.closable && (h("button", { key: '8089aaecfe511558055ee9f64214ff97030eb2a9', class: "close-btn", onClick: this.handleClose.bind(this) }, "x")))), h("div", { key: '776255540f30d757caa3fcaee747c79ac638ae76', class: "dialog-content", style: contentStyle }, h("slot", { key: '5ef964615b6ab70a9e561f8efac8fe952fe47b4e' })), this.showFooter && (h("div", { key: '8927a0991d916caf7852d58db996b9818687da30', class: "dialog-footer" }, h("slot", { key: '84de0306994ec62220ae30fa2881dadbae5544ea', name: "footer" }, this.showCancelBtn && (h("button", { key: 'ee87b8c3918c1f4d007923a2498142b3af2740a0', class: "cancel-btn", onClick: this.handleClose.bind(this) }, translate('cancel', this.language))), h("button", { key: '935cff86381b21fff07c2d4156b29779c50e5ce3', class: "confirm-btn", onClick: this.handleConfirm.bind(this), disabled: this.confirmLoading }, this.confirmLoading ? (h("div", { class: "Loading", innerHTML: renderIconDefinitionToSVGElement(LoadingOutlined$1, {
|
|
318
|
+
extraSVGAttrs: { width: '20px', height: '20px', fill: 'currentColor' }
|
|
319
|
+
}) })) : (translate('confirm', this.language)))))))));
|
|
268
320
|
}
|
|
269
321
|
get el() { return getElement(this); }
|
|
270
322
|
static get watchers() { return {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as lottery_tipping_dialog } from './lottery-tipping-dialog-
|
|
1
|
+
export { L as lottery_tipping_dialog } from './lottery-tipping-dialog-3f3d610b.js';
|
|
2
2
|
import './index-9dba6e0e.js';
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["lottery-tipping-dialog",[[1,"lottery-tipping-dialog",{"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"visible":[516],"dialogTitle":[1,"dialog-title"],"width":[1],"closable":[4],"mask":[4],"maskClosable":[4,"mask-closable"],"animationDuration":[2,"animation-duration"],"fullscreen":[4],"showFooter":[4,"show-footer"],"showCancelBtn":[4,"show-cancel-btn"],"language":[513],"translationUrl":[520,"translation-url"],"dialogClass":[1,"dialog-class"],"dialogStyle":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
19
|
+
return bootstrapLazy([["lottery-tipping-dialog",[[1,"lottery-tipping-dialog",{"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"visible":[516],"dialogTitle":[1,"dialog-title"],"width":[1],"closable":[4],"mask":[4],"maskClosable":[4,"mask-closable"],"animationDuration":[2,"animation-duration"],"fullscreen":[4],"showFooter":[4,"show-footer"],"showCancelBtn":[4,"show-cancel-btn"],"language":[513],"translationUrl":[520,"translation-url"],"dialogClass":[1,"dialog-class"],"dialogStyle":[16],"confirmLoading":[4,"confirm-loading"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{L as LotteryTippingDialog}from"./lottery-tipping-dialog-
|
|
1
|
+
export{L as LotteryTippingDialog}from"./lottery-tipping-dialog-3f3d610b.js";import"./index-9dba6e0e.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as i,g as o}from"./index-9dba6e0e.js";const a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};var n=function(){return n=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var a in t=arguments[i])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},r={primaryColor:"#333",secondaryColor:"#E6E6E6"};function s(e,t){if(void 0===t&&(t={}),"function"==typeof e.icon){var i=t.placeholders||r;return c(e.icon(i.primaryColor,i.secondaryColor),t)}return c(e.icon,t)}function c(e,t){var i="svg"===e.tag?n(n({},e.attrs),t.extraSVGAttrs||{}):e.attrs,o=Object.keys(i).reduce((function(e,t){var o=i[t],a="".concat(t,'="').concat(o,'"');return e.push(a),e}),[]),a=o.length?" "+o.join(" "):"",r=(e.children||[]).map((function(e){return c(e,t)})).join("");return r&&r.length?"<".concat(e.tag).concat(a,">").concat(r,"</").concat(e.tag,">"):"<".concat(e.tag).concat(a," />")}const l="__WIDGET_GLOBAL_STYLE_CACHE__";const d=["ro","en","fr","ar","hr"],h={en:{cancel:"Cancel",confirm:"Confirm"},ro:{cancel:"Anulează",confirm:"Confirmă"},fr:{cancel:"Annuler",confirm:"Confirmer"},ar:{cancel:"إلغاء",confirm:"تأكيد"},hr:{cancel:"Odustani",confirm:"Potvrdi"}},f=(e,t)=>{const i=t;return h[void 0!==i&&d.includes(i)?i:"en"][e]},g=class{constructor(i){e(this,i),this.open=t(this,"open",7),this.close=t(this,"close",7),this.confirm=t(this,"confirm",7),this.cancel=t(this,"cancel",7),this.wasVisible=!1,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.visible=void 0,this.dialogTitle="",this.width="520px",this.closable=!0,this.mask=!0,this.maskClosable=!0,this.animationDuration=300,this.fullscreen=!1,this.showFooter=!0,this.showCancelBtn=!0,this.language="en",this.translationUrl=void 0,this.dialogClass=void 0,this.dialogStyle=void 0,this.confirmLoading=!1}handleClientStylingChange(e,t){e!=t&&function(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&function(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&function(e,t,i,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t);window[l]||(window[l]={});const a=(i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const o=e.getRootNode(),a=window[l];let n=a[t]?.sheet;n?a[t].refCount=a[t].refCount+1:(n=new CSSStyleSheet,n.replaceSync(i),a[t]={sheet:n,refCount:1});const r=o.adoptedStyleSheets||[];r.includes(n)||(o.adoptedStyleSheets=[...r,n])}))}(e,t)).unsubscribe.bind(i);i.unsubscribe=()=>{if(window[l][t]){const e=window[l][t];e.refCount>1?e.refCount=e.refCount-1:delete window[l][t]}a()}}(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.translationUrl&&(async e=>{if(e)try{const i=await fetch(e);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();t=o,Object.keys(t).forEach((e=>{for(let i in t[e])h[e][i]=t[e][i]}))}catch(e){console.error("Failed to fetch or parse translations from URL:",e)}var t})(this.translationUrl)}componentWillUpdate(){this.visible&&!this.wasVisible?this.disableBodyScroll():!this.visible&&this.wasVisible&&this.enableBodyScroll(),this.wasVisible=this.visible}disconnectedCallback(){this.enableBodyScroll(),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}disableBodyScroll(){document.body.style.overflow="hidden"}enableBodyScroll(){document.body.style.overflow=""}handleClose(){this.cancel.emit()}handleMaskClick(){this.maskClosable&&this.cancel.emit()}handleConfirm(){this.confirm.emit()}render(){const e=Object.assign({width:"number"==typeof this.width?`${this.width}px`:this.width,"--duration":`${this.animationDuration}ms`},this.dialogStyle||{}),t=["dialog-wrapper",this.visible?"dialog-wrapper-visible":""],o=["mask",this.visible?"mask-enter":"mask-leave"],n=["dialog",this.visible?"dialog-enter":"dialog-leave",this.fullscreen?"fullscreen":"",this.dialogClass].filter(Boolean).join(" ");return i("div",{key:"05dd671f10bdebda6f138e8f8039f4bc0533fe98",class:t.join(" "),ref:e=>this.stylingContainer=e},i("div",{key:"6e814e02770149de5495617039750461fc0a42d1",class:o.join(" "),onClick:this.handleMaskClick.bind(this)}),i("div",{key:"4cbc5db20317ef1b0808fc4a91a53fa8b86c5f4f",part:"dialog",class:n,style:e,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},(this.dialogTitle||this.closable)&&i("div",{key:"85dc705676a37e6ea2828a7b683fc54b0eb77d17",class:"dialog-header"},i("h2",{key:"85b7472d2b72801dfae19a24fc2018f3c1f1529a",id:"dialog-title",class:"dialog-title"},this.dialogTitle),this.closable&&i("button",{key:"8089aaecfe511558055ee9f64214ff97030eb2a9",class:"close-btn",onClick:this.handleClose.bind(this)},"x")),i("div",{key:"776255540f30d757caa3fcaee747c79ac638ae76",class:"dialog-content",style:{maxHeight:"calc(100vh - 62px)",overflowY:"auto"}},i("slot",{key:"5ef964615b6ab70a9e561f8efac8fe952fe47b4e"})),this.showFooter&&i("div",{key:"8927a0991d916caf7852d58db996b9818687da30",class:"dialog-footer"},i("slot",{key:"84de0306994ec62220ae30fa2881dadbae5544ea",name:"footer"},this.showCancelBtn&&i("button",{key:"ee87b8c3918c1f4d007923a2498142b3af2740a0",class:"cancel-btn",onClick:this.handleClose.bind(this)},f("cancel",this.language)),i("button",{key:"935cff86381b21fff07c2d4156b29779c50e5ce3",class:"confirm-btn",onClick:this.handleConfirm.bind(this),disabled:this.confirmLoading},this.confirmLoading?i("div",{class:"Loading",innerHTML:s(a,{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}})}):f("confirm",this.language))))))}get el(){return o(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};g.style=".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;min-width:60px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";export{g as L}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{L as lottery_tipping_dialog}from"./lottery-tipping-dialog-
|
|
1
|
+
export{L as lottery_tipping_dialog}from"./lottery-tipping-dialog-3f3d610b.js";import"./index-9dba6e0e.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as l,b as n}from"./index-9dba6e0e.js";export{s as setNonce}from"./index-9dba6e0e.js";import{g as
|
|
1
|
+
import{p as l,b as n}from"./index-9dba6e0e.js";export{s as setNonce}from"./index-9dba6e0e.js";import{g as i}from"./app-globals-0f993ce5.js";(()=>{const n=import.meta.url,i={};return""!==n&&(i.resourcesUrl=new URL(".",n).href),l(i)})().then((async l=>(await i(),n([["lottery-tipping-dialog",[[1,"lottery-tipping-dialog",{mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],visible:[516],dialogTitle:[1,"dialog-title"],width:[1],closable:[4],mask:[4],maskClosable:[4,"mask-closable"],animationDuration:[2,"animation-duration"],fullscreen:[4],showFooter:[4,"show-footer"],showCancelBtn:[4,"show-cancel-btn"],language:[513],translationUrl:[520,"translation-url"],dialogClass:[1,"dialog-class"],dialogStyle:[16],confirmLoading:[4,"confirm-loading"]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],l))));
|
|
@@ -80,6 +80,11 @@ export declare class LotteryTippingDialog {
|
|
|
80
80
|
dialogStyle: {
|
|
81
81
|
[key: string]: string;
|
|
82
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Whether the confirm button is in loading state
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
confirmLoading: boolean;
|
|
83
88
|
private wasVisible;
|
|
84
89
|
private stylingContainer;
|
|
85
90
|
private stylingSubscription;
|
|
@@ -25,6 +25,11 @@ export namespace Components {
|
|
|
25
25
|
* @default true
|
|
26
26
|
*/
|
|
27
27
|
"closable": boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the confirm button is in loading state
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
"confirmLoading": boolean;
|
|
28
33
|
/**
|
|
29
34
|
* Custom class for the dialog container
|
|
30
35
|
*/
|
|
@@ -135,6 +140,11 @@ declare namespace LocalJSX {
|
|
|
135
140
|
* @default true
|
|
136
141
|
*/
|
|
137
142
|
"closable"?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Whether the confirm button is in loading state
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
147
|
+
"confirmLoading"?: boolean;
|
|
138
148
|
/**
|
|
139
149
|
* Custom class for the dialog container
|
|
140
150
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as i,h as t,g as o}from"./index-9dba6e0e.js";const a=["ro","en","fr","ar","hr"],n={en:{cancel:"Cancel",confirm:"Confirm"},ro:{cancel:"Anulează",confirm:"Confirmă"},fr:{cancel:"Annuler",confirm:"Confirmer"},ar:{cancel:"إلغاء",confirm:"تأكيد"},hr:{cancel:"Odustani",confirm:"Potvrdi"}},r=(e,i)=>{const t=i;return n[void 0!==t&&a.includes(t)?t:"en"][e]},c="__WIDGET_GLOBAL_STYLE_CACHE__";const s=class{constructor(t){e(this,t),this.open=i(this,"open",7),this.close=i(this,"close",7),this.confirm=i(this,"confirm",7),this.cancel=i(this,"cancel",7),this.wasVisible=!1,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.visible=void 0,this.dialogTitle="",this.width="520px",this.closable=!0,this.mask=!0,this.maskClosable=!0,this.animationDuration=300,this.fullscreen=!1,this.showFooter=!0,this.showCancelBtn=!0,this.language="en",this.translationUrl=void 0,this.dialogClass=void 0,this.dialogStyle=void 0}handleClientStylingChange(e,i){e!=i&&function(e,i){if(e){const t=document.createElement("style");t.innerHTML=i,e.appendChild(t)}}(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,i){e!=i&&function(e,i){if(!e||!i)return;const t=new URL(i);fetch(t.href).then((e=>e.text())).then((i=>{const t=document.createElement("style");t.innerHTML=i,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,i){e!=i&&function(e,i,t,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return function(e,i){const t=document.createElement("style");return window.emMessageBus.subscribe(i,(i=>{e&&(t.innerHTML=i,e.appendChild(t))}))}(e,i);window[c]||(window[c]={});const a=(t=function(e,i){return window.emMessageBus.subscribe(i,(t=>{if(!e)return;const o=e.getRootNode(),a=window[c];let n=a[i]?.sheet;n?a[i].refCount=a[i].refCount+1:(n=new CSSStyleSheet,n.replaceSync(t),a[i]={sheet:n,refCount:1});const r=o.adoptedStyleSheets||[];r.includes(n)||(o.adoptedStyleSheets=[...r,n])}))}(e,i)).unsubscribe.bind(t);t.unsubscribe=()=>{if(window[c][i]){const e=window[c][i];e.refCount>1?e.refCount=e.refCount-1:delete window[c][i]}a()}}(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.translationUrl&&(async e=>{if(e)try{const t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const o=await t.json();i=o,Object.keys(i).forEach((e=>{for(let t in i[e])n[e][t]=i[e][t]}))}catch(e){console.error("Failed to fetch or parse translations from URL:",e)}var i})(this.translationUrl)}componentWillUpdate(){this.visible&&!this.wasVisible?this.disableBodyScroll():!this.visible&&this.wasVisible&&this.enableBodyScroll(),this.wasVisible=this.visible}disconnectedCallback(){this.enableBodyScroll(),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}disableBodyScroll(){document.body.style.overflow="hidden"}enableBodyScroll(){document.body.style.overflow=""}handleClose(){this.cancel.emit()}handleMaskClick(){this.maskClosable&&this.cancel.emit()}handleConfirm(){this.confirm.emit()}render(){const e=Object.assign({width:"number"==typeof this.width?`${this.width}px`:this.width,"--duration":`${this.animationDuration}ms`},this.dialogStyle||{}),i=["dialog-wrapper",this.visible?"dialog-wrapper-visible":""],o=["mask",this.visible?"mask-enter":"mask-leave"],a=["dialog",this.visible?"dialog-enter":"dialog-leave",this.fullscreen?"fullscreen":"",this.dialogClass].filter(Boolean).join(" ");return t("div",{key:"306683c5190fa6dca57dcf75e52eca575c0215e7",class:i.join(" "),ref:e=>this.stylingContainer=e},t("div",{key:"8be097f3a86fcd9ad4e18c6ac56cafdcf249049b",class:o.join(" "),onClick:this.handleMaskClick.bind(this)}),t("div",{key:"87d2206d3e3d75fe0e0ef8a6afd8de5c20892ae6",part:"dialog",class:a,style:e,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},(this.dialogTitle||this.closable)&&t("div",{key:"04d54878aa24e0d9eb98bc921ea3edfacd6de3af",class:"dialog-header"},t("h2",{key:"f6f6c279de47e49cde86d0c907b9b40a115926b3",id:"dialog-title",class:"dialog-title"},this.dialogTitle),this.closable&&t("button",{key:"e1625473e5460cd667961923bf678c9a91b69c82",class:"close-btn",onClick:this.handleClose.bind(this)},"x")),t("div",{key:"fb0db8dd765832cf1d8e8b682131e4c97a93ac22",class:"dialog-content",style:{maxHeight:"calc(100vh - 62px)",overflowY:"auto"}},t("slot",{key:"75336f59c2a8fe6775fc12ed4e2e26ff6bb6b508"})),this.showFooter&&t("div",{key:"a305086a2830265317abb0fd6f59b4a053fd54a9",class:"dialog-footer"},t("slot",{key:"cb330ea63908002f4f8b4b8139d5843c2570302e",name:"footer"},this.showCancelBtn&&t("button",{key:"c3d2c15195e56efd6d388265e9ccb87030627b7b",class:"cancel-btn",onClick:this.handleClose.bind(this)},r("cancel",this.language)),t("button",{key:"af9c96b4e1ce82f9ecb73e2b9f4e93cba0382d76",class:"confirm-btn",onClick:this.handleConfirm.bind(this)},r("confirm",this.language))))))}get el(){return o(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};s.style=".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";export{s as L}
|