@everymatrix/casino-betslip-indicator 0.0.311 → 0.0.314
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-betslip-indicator",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.314",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "839c003350d02728295b8ca41579dc78da9011a2"
|
|
40
40
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
<svelte:options tag={null} />
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
onMount,
|
|
6
|
+
get_current_component
|
|
7
|
+
} from "svelte/internal";
|
|
5
8
|
import { isMobile } from 'rvhelper';
|
|
6
9
|
|
|
7
10
|
let userAgent:String = window.navigator.userAgent;
|
|
8
11
|
let betNumber: number = null;
|
|
9
12
|
let mobileView:Boolean = false;
|
|
10
13
|
let isLoading = true;
|
|
14
|
+
const thisComponent = get_current_component(); // dispatching events
|
|
11
15
|
|
|
12
16
|
const getInitialBetSlipContent = () => {
|
|
13
17
|
window.postMessage({
|
|
@@ -15,8 +19,14 @@
|
|
|
15
19
|
}, '*');
|
|
16
20
|
};
|
|
17
21
|
|
|
18
|
-
const
|
|
19
|
-
|
|
22
|
+
const dispatchWcEvent = (name, detail) => {
|
|
23
|
+
thisComponent.dispatchEvent(
|
|
24
|
+
new CustomEvent(name, {
|
|
25
|
+
detail,
|
|
26
|
+
composed: true,
|
|
27
|
+
bubbles: true // propagate across the shadow DOM
|
|
28
|
+
})
|
|
29
|
+
);
|
|
20
30
|
};
|
|
21
31
|
|
|
22
32
|
const messageHandler = (e:any) => {
|
|
@@ -49,7 +59,7 @@
|
|
|
49
59
|
|
|
50
60
|
|
|
51
61
|
{#if mobileView && betNumber > 0}
|
|
52
|
-
<
|
|
62
|
+
<button on:click={(e) => dispatchWcEvent("betslipClick", {})} class="betslipIndicator">
|
|
53
63
|
<small class="betslipIndicator__number">
|
|
54
64
|
{#if isLoading}
|
|
55
65
|
<div class="loader">Loading...</div>
|
|
@@ -70,7 +80,7 @@
|
|
|
70
80
|
<path d="M50.9,66.5H13.1c-0.8,0-1.5,0.9-1.5,2s0.7,2,1.5,2h37.8c0.8,0,1.5-0.9,1.5-2S51.7,66.5,50.9,66.5z"/>
|
|
71
81
|
</g>
|
|
72
82
|
</svg>
|
|
73
|
-
</
|
|
83
|
+
</button>
|
|
74
84
|
{/if}
|
|
75
85
|
|
|
76
86
|
|