@everymatrix/lottery-tipping-ticket-bet 0.0.1
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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/general-tooltip_4.cjs.entry.js +321 -0
- package/dist/cjs/index-1e2543a3.js +1376 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/lottery-tipping-ticket-bet-67323e6b.js +8977 -0
- package/dist/cjs/lottery-tipping-ticket-bet.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +21 -0
- package/dist/collection/components/general-tooltip/general-tooltip.css +102 -0
- package/dist/collection/components/general-tooltip/general-tooltip.js +235 -0
- package/dist/collection/components/general-tooltip/index.js +1 -0
- package/dist/collection/components/lottery-tipping-ticket-bet/index.js +1 -0
- package/dist/collection/components/lottery-tipping-ticket-bet/lottery-tipping-ticket-bet.css +445 -0
- package/dist/collection/components/lottery-tipping-ticket-bet/lottery-tipping-ticket-bet.js +710 -0
- package/dist/collection/components/static/add.svg +8 -0
- package/dist/collection/components/static/delete.svg +37 -0
- package/dist/collection/components/static/info.svg +6 -0
- package/dist/collection/components/static/left-arrow.svg +15 -0
- package/dist/collection/components/static/loading.svg +10 -0
- package/dist/collection/components/static/right-arrow.svg +15 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +82 -0
- package/dist/collection/utils/utils.js +52 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/general-tooltip_4.entry.js +314 -0
- package/dist/esm/index-220905ab.js +1347 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/lottery-tipping-ticket-bet-2d143dac.js +8975 -0
- package/dist/esm/lottery-tipping-ticket-bet.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-tipping-ticket-bet/app-globals-0f993ce5.js +1 -0
- package/dist/lottery-tipping-ticket-bet/general-tooltip_4.entry.js +1 -0
- package/dist/lottery-tipping-ticket-bet/index-220905ab.js +2 -0
- package/dist/lottery-tipping-ticket-bet/index.esm.js +1 -0
- package/dist/lottery-tipping-ticket-bet/lottery-tipping-ticket-bet-2d143dac.js +6046 -0
- package/dist/lottery-tipping-ticket-bet/lottery-tipping-ticket-bet.esm.js +1 -0
- package/dist/static/add.svg +8 -0
- package/dist/static/delete.svg +37 -0
- package/dist/static/info.svg +6 -0
- package/dist/static/left-arrow.svg +15 -0
- package/dist/static/loading.svg +10 -0
- package/dist/static/right-arrow.svg +15 -0
- package/dist/stencil.config.dev.js +19 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/packages/stencil/lottery-tipping-ticket-bet/stencil.config.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/packages/stencil/lottery-tipping-ticket-bet/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/packages/stencil/lottery-tipping-ticket-bet/storybook/main.d.ts +3 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/packages/stencil/lottery-tipping-ticket-bet/storybook/preview.d.ts +70 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/tools/plugins/index.d.ts +3 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-tipping-ticket-bet/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/general-tooltip/general-tooltip.d.ts +41 -0
- package/dist/types/components/general-tooltip/index.d.ts +1 -0
- package/dist/types/components/lottery-tipping-ticket-bet/index.d.ts +1 -0
- package/dist/types/components/lottery-tipping-ticket-bet/lottery-tipping-ticket-bet.d.ts +125 -0
- package/dist/types/components.d.ts +232 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/index.d.ts +16 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +16 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +27 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-1e2543a3.js');
|
|
6
|
+
const lotteryTippingTicketBet = require('./lottery-tipping-ticket-bet-67323e6b.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @name setClientStyling
|
|
10
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
11
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
12
|
+
* @param {string} clientStyling The style content
|
|
13
|
+
*/
|
|
14
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
15
|
+
if (stylingContainer) {
|
|
16
|
+
const sheet = document.createElement('style');
|
|
17
|
+
sheet.innerHTML = clientStyling;
|
|
18
|
+
stylingContainer.appendChild(sheet);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @name setClientStylingURL
|
|
24
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
25
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
26
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
27
|
+
*/
|
|
28
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
29
|
+
const url = new URL(clientStylingUrl);
|
|
30
|
+
|
|
31
|
+
fetch(url.href)
|
|
32
|
+
.then((res) => res.text())
|
|
33
|
+
.then((data) => {
|
|
34
|
+
const cssFile = document.createElement('style');
|
|
35
|
+
cssFile.innerHTML = data;
|
|
36
|
+
if (stylingContainer) {
|
|
37
|
+
stylingContainer.appendChild(cssFile);
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
.catch((err) => {
|
|
41
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @name setStreamLibrary
|
|
47
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
48
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
49
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
50
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
51
|
+
*/
|
|
52
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
53
|
+
if (window.emMessageBus) {
|
|
54
|
+
const sheet = document.createElement('style');
|
|
55
|
+
|
|
56
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
57
|
+
sheet.innerHTML = data;
|
|
58
|
+
if (stylingContainer) {
|
|
59
|
+
stylingContainer.appendChild(sheet);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const generalTooltipCss = ".general-tooltip-wrapper{display:inline-block;position:relative;line-height:0}.general-tooltip-container{display:contents;}.general-tooltip-popup{position:absolute;background-color:var(--emw--color-gray-300, #333);color:var(--emw--color-background, #fff);padding:8px 12px;border-radius:4px;font-size:0.875em;line-height:1.4;z-index:1000;opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;white-space:nowrap;pointer-events:none;}.general-tooltip-popup.visible{opacity:1;visibility:visible}.general-tooltip-arrow{position:absolute;width:0;height:0;border-style:solid}.general-tooltip-top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:8px;}.general-tooltip-top .general-tooltip-arrow{top:100%;left:50%;transform:translateX(-50%);border-width:6px 6px 0 6px;border-color:var(--emw--color-gray-300, #333) transparent transparent transparent}.general-tooltip-bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:8px;}.general-tooltip-bottom .general-tooltip-arrow{bottom:100%;left:50%;transform:translateX(-50%);border-width:0 6px 6px 6px;border-color:transparent transparent var(--emw--color-gray-300, #333) transparent}.general-tooltip-left{right:100%;top:50%;transform:translateY(-50%);margin-right:8px;}.general-tooltip-left .general-tooltip-arrow{left:100%;top:50%;transform:translateY(-50%);border-width:6px 0 6px 6px;border-color:transparent transparent transparent var(--emw--color-gray-300, #333)}.general-tooltip-right{left:100%;top:50%;transform:translateY(-50%);margin-left:8px;}.general-tooltip-right .general-tooltip-arrow{right:100%;top:50%;transform:translateY(-50%);border-width:6px 6px 6px 0;border-color:transparent var(--emw--color-gray-300, #333) transparent transparent}";
|
|
66
|
+
const GeneralTooltipStyle0 = generalTooltipCss;
|
|
67
|
+
|
|
68
|
+
const GeneralTooltip = class {
|
|
69
|
+
constructor(hostRef) {
|
|
70
|
+
index.registerInstance(this, hostRef);
|
|
71
|
+
this.mbSource = undefined;
|
|
72
|
+
this.clientStyling = undefined;
|
|
73
|
+
this.clientStylingUrl = undefined;
|
|
74
|
+
this.position = 'top';
|
|
75
|
+
this.delay = 200;
|
|
76
|
+
this.isVisible = false;
|
|
77
|
+
this._tooltipId = undefined;
|
|
78
|
+
}
|
|
79
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
80
|
+
if (newValue != oldValue) {
|
|
81
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
85
|
+
if (newValue != oldValue) {
|
|
86
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
90
|
+
if (newValue != oldValue) {
|
|
91
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
componentWillLoad() {
|
|
95
|
+
this._tooltipId = `general-tooltip-${Math.random().toString(36).substring(2, 9)}`;
|
|
96
|
+
}
|
|
97
|
+
componentDidLoad() {
|
|
98
|
+
if (this.stylingContainer) {
|
|
99
|
+
if (this.mbSource)
|
|
100
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
101
|
+
if (this.clientStyling)
|
|
102
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
103
|
+
if (this.clientStylingUrl)
|
|
104
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
handleMouseEnterOrFocus() {
|
|
108
|
+
clearTimeout(this.hideTimeout); // Clear any pending hide
|
|
109
|
+
if (this.showTimeout)
|
|
110
|
+
clearTimeout(this.showTimeout);
|
|
111
|
+
this.showTimeout = setTimeout(() => {
|
|
112
|
+
this.isVisible = true;
|
|
113
|
+
}, this.delay);
|
|
114
|
+
}
|
|
115
|
+
handleMouseLeaveOrBlur() {
|
|
116
|
+
if (this.showTimeout)
|
|
117
|
+
clearTimeout(this.showTimeout);
|
|
118
|
+
this.hideTimeout = setTimeout(() => {
|
|
119
|
+
this.isVisible = false;
|
|
120
|
+
}, 100);
|
|
121
|
+
}
|
|
122
|
+
handleKeyDown(event) {
|
|
123
|
+
if (event.key === 'Escape' && this.isVisible) {
|
|
124
|
+
this.isVisible = false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
disconnectedCallback() {
|
|
128
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
129
|
+
clearTimeout(this.showTimeout);
|
|
130
|
+
clearTimeout(this.hideTimeout);
|
|
131
|
+
}
|
|
132
|
+
render() {
|
|
133
|
+
const tooltipClasses = {
|
|
134
|
+
'general-tooltip-popup': true,
|
|
135
|
+
visible: this.isVisible,
|
|
136
|
+
[`general-tooltip-${this.position}`]: true
|
|
137
|
+
};
|
|
138
|
+
return (index.h("div", { key: 'c0d52518e1e196e0d022789f7c6b7e64173b2c7d', class: "general-tooltip-wrapper" }, index.h("slot", { key: 'a935e103e16b0b619a024706e8224f4a937de6b9', name: "trigger" }), index.h("div", { key: '35c60e35ce3f8d5c2c42cd333fe64a3b289d34d4', class: "general-tooltip-container", role: "tooltip", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '9d3fd9f142c1e3bd263dee289a2c1a9e4eebfddc', id: this._tooltipId, class: tooltipClasses, role: "tooltip" }, index.h("slot", { key: '31344f0d4d4139f913d1819cc4f42a39f5113d8a', name: "content" }), index.h("div", { key: 'f5cdd93060baec37b2a2879056efe2d66c5a553a', class: "general-tooltip-arrow" })))));
|
|
139
|
+
}
|
|
140
|
+
get hostElement() { return index.getElement(this); }
|
|
141
|
+
static get watchers() { return {
|
|
142
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
143
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
144
|
+
"mbSource": ["handleMbSourceChange"]
|
|
145
|
+
}; }
|
|
146
|
+
};
|
|
147
|
+
GeneralTooltip.style = GeneralTooltipStyle0;
|
|
148
|
+
|
|
149
|
+
const lotteryTippingBulletCss = ".LotteryTippingBullet__segment{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:16px;line-height:1;font-weight:500;color:var(--emw--color-gray-300, #333);background-color:var(--emw--color-gray-50, #f5f5f5);border:1px solid var(--emw--color-gray-100, #e6e6e6);border-radius:6px;cursor:pointer;transition:all 0.2s ease;user-select:none}.LotteryTippingBullet__segment:not(.LotteryTippingBullet__segment--disabled):hover{cursor:pointer;animation:jelly 0.3s ease-in-out;transform:scale(1.02)}.LotteryTippingBullet__segment--text{border:none;background-color:transparent;font-weight:400}.LotteryTippingBullet__segment--text:hover{cursor:default !important}.LotteryTippingBullet__segment--active{font-weight:600;background-color:var(--emw--color-gray-400, #000);color:var(--emw--color-primary, #fed275)}.LotteryTippingBullet__segment--disabled:not(.LotteryTippingBullet__segment--active){background-color:var(--emw--button-background-color, #d4d4d4);color:var(--emw--color-gray-150, #6f6f6f);border-color:var(--emw--color-gray-100, #e6e6e6)}.LotteryTippingBullet__segment--disabled:hover{cursor:not-allowed}@keyframes jelly{0%{transform:translate(0, 0)}20%{transform:translate(-0.5px, -0.5px)}40%{transform:translate(0.5px, 0.5px)}60%{transform:translate(-0.25px, -0.25px)}80%{transform:translate(0.25px, 0.25px)}100%{transform:translate(0, 0)}}";
|
|
150
|
+
const LotteryTippingBulletStyle0 = lotteryTippingBulletCss;
|
|
151
|
+
|
|
152
|
+
const LotteryTippingBullet = class {
|
|
153
|
+
constructor(hostRef) {
|
|
154
|
+
index.registerInstance(this, hostRef);
|
|
155
|
+
this.lotteryTippingBulletToggleEvent = index.createEvent(this, "lotteryTippingBulletToggle", 7);
|
|
156
|
+
this.mbSource = undefined;
|
|
157
|
+
this.clientStyling = undefined;
|
|
158
|
+
this.clientStylingUrl = undefined;
|
|
159
|
+
this.positionIdx = undefined;
|
|
160
|
+
this.theme = 'default';
|
|
161
|
+
this.value = '';
|
|
162
|
+
this.disabled = false;
|
|
163
|
+
this.isSelected = false;
|
|
164
|
+
}
|
|
165
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
166
|
+
if (newValue != oldValue) {
|
|
167
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
171
|
+
if (newValue != oldValue) {
|
|
172
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
176
|
+
if (newValue != oldValue) {
|
|
177
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
componentDidLoad() {
|
|
181
|
+
if (this.stylingContainer) {
|
|
182
|
+
if (this.mbSource)
|
|
183
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
184
|
+
if (this.clientStyling)
|
|
185
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
186
|
+
if (this.clientStylingUrl)
|
|
187
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
handleClick() {
|
|
191
|
+
if (!this.disabled) {
|
|
192
|
+
this.lotteryTippingBulletToggleEvent.emit({ positionIdx: this.positionIdx });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
disconnectedCallback() {
|
|
196
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
197
|
+
}
|
|
198
|
+
render() {
|
|
199
|
+
return (index.h("div", { key: 'ef0fee38ed62adb7809b5a60668af6a499ebe5a6', ref: (el) => (this.stylingContainer = el) }, this.theme === 'text' ? (index.h("div", { class: {
|
|
200
|
+
LotteryTippingBullet__segment: true,
|
|
201
|
+
'LotteryTippingBullet__segment--text': true
|
|
202
|
+
} }, this.value)) : (index.h("button", { class: {
|
|
203
|
+
LotteryTippingBullet__segment: true,
|
|
204
|
+
'LotteryTippingBullet__segment--disabled': this.disabled,
|
|
205
|
+
'LotteryTippingBullet__segment--active': this.isSelected
|
|
206
|
+
}, onClick: () => this.handleClick() }, this.isSelected ? 'X' : this.value))));
|
|
207
|
+
}
|
|
208
|
+
static get watchers() { return {
|
|
209
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
210
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
211
|
+
"mbSource": ["handleMbSourceChange"]
|
|
212
|
+
}; }
|
|
213
|
+
};
|
|
214
|
+
LotteryTippingBullet.style = LotteryTippingBulletStyle0;
|
|
215
|
+
|
|
216
|
+
const lotteryTippingBulletGroupCss = "";
|
|
217
|
+
const LotteryTippingBulletGroupStyle0 = lotteryTippingBulletGroupCss;
|
|
218
|
+
|
|
219
|
+
const LotteryTippingBulletGroup = class {
|
|
220
|
+
constructor(hostRef) {
|
|
221
|
+
index.registerInstance(this, hostRef);
|
|
222
|
+
this.lotteryTippingBulletGroupToggleEvent = index.createEvent(this, "lotteryTippingBulletGroupToggle", 7);
|
|
223
|
+
this.mbSource = undefined;
|
|
224
|
+
this.clientStyling = undefined;
|
|
225
|
+
this.clientStylingUrl = undefined;
|
|
226
|
+
this.positionIdx = undefined;
|
|
227
|
+
this.theme = 'default';
|
|
228
|
+
this.mode = 'single';
|
|
229
|
+
this.bulletConfigContent = '';
|
|
230
|
+
}
|
|
231
|
+
get bulletConfigArr() {
|
|
232
|
+
const defaultConfig = [
|
|
233
|
+
{
|
|
234
|
+
value: '1'
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
value: 'X'
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
value: '2'
|
|
241
|
+
}
|
|
242
|
+
];
|
|
243
|
+
if (typeof this.bulletConfigContent === 'string' && this.bulletConfigContent) {
|
|
244
|
+
try {
|
|
245
|
+
const _temp = JSON.parse(this.bulletConfigContent);
|
|
246
|
+
return _temp;
|
|
247
|
+
}
|
|
248
|
+
catch (e) {
|
|
249
|
+
console.error('Error parsing bulletConfigContent:', e);
|
|
250
|
+
return defaultConfig;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
return defaultConfig;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
258
|
+
if (newValue != oldValue) {
|
|
259
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
263
|
+
if (newValue != oldValue) {
|
|
264
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
268
|
+
if (newValue != oldValue) {
|
|
269
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
componentDidLoad() {
|
|
273
|
+
if (this.stylingContainer) {
|
|
274
|
+
if (this.mbSource)
|
|
275
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
276
|
+
if (this.clientStyling)
|
|
277
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
278
|
+
if (this.clientStylingUrl)
|
|
279
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
disconnectedCallback() {
|
|
283
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
284
|
+
}
|
|
285
|
+
lotteryTippingBulletSelectionHandler(event) {
|
|
286
|
+
const { positionIdx } = event.detail;
|
|
287
|
+
this.handleToggle(positionIdx);
|
|
288
|
+
}
|
|
289
|
+
handleToggle(index) {
|
|
290
|
+
let newConfigArr = [...this.bulletConfigArr];
|
|
291
|
+
if (this.mode === 'single') {
|
|
292
|
+
// single mode: only one button can be selected
|
|
293
|
+
newConfigArr = newConfigArr.map((item) => (Object.assign(Object.assign({}, item), { isSelected: false })));
|
|
294
|
+
newConfigArr[index].isSelected = true;
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
// multi mode: multiple buttons can be selected
|
|
298
|
+
newConfigArr = newConfigArr.map((item) => (Object.assign({}, item)));
|
|
299
|
+
newConfigArr[index].isSelected = !newConfigArr[index].isSelected;
|
|
300
|
+
}
|
|
301
|
+
this.lotteryTippingBulletGroupToggleEvent.emit({
|
|
302
|
+
bulletConfigArr: newConfigArr,
|
|
303
|
+
positionIdx: this.positionIdx + '-' + index
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
render() {
|
|
307
|
+
var _a;
|
|
308
|
+
return (index.h("div", { ref: (el) => (this.stylingContainer = el), key: this.positionIdx }, index.h("div", { key: '68223022eed831932c571378164be913206d98e9', style: { display: 'flex', flexDirection: 'row', gap: '10px' } }, (_a = this.bulletConfigArr) === null || _a === void 0 ? void 0 : _a.map((item, index$1) => (index.h("div", { key: index$1 }, index.h("lottery-tipping-bullet", { value: item.value, isSelected: item.isSelected, "position-idx": index$1, disabled: item.disabled, theme: this.theme, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, mbSource: this.mbSource })))))));
|
|
309
|
+
}
|
|
310
|
+
static get watchers() { return {
|
|
311
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
312
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
313
|
+
"mbSource": ["handleMbSourceChange"]
|
|
314
|
+
}; }
|
|
315
|
+
};
|
|
316
|
+
LotteryTippingBulletGroup.style = LotteryTippingBulletGroupStyle0;
|
|
317
|
+
|
|
318
|
+
exports.lottery_tipping_ticket_bet = lotteryTippingTicketBet.LotteryTippingTicketBet;
|
|
319
|
+
exports.general_tooltip = GeneralTooltip;
|
|
320
|
+
exports.lottery_tipping_bullet = LotteryTippingBullet;
|
|
321
|
+
exports.lottery_tipping_bullet_group = LotteryTippingBulletGroup;
|