@everymatrix/player-account-gaming-limits-wrapper-2 0.1.0 → 0.1.2

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/index.html CHANGED
@@ -14,6 +14,32 @@
14
14
  }
15
15
  </style>
16
16
  <script src='dist/player-account-gaming-limits-wrapper-2.js'></script>
17
+ <script>
18
+ window.addEventListener("load", function () {
19
+ // store tabs variable
20
+ var myTabs = document.querySelectorAll("ul.nav-tabs > li");
21
+ function myTabClicks(tabClickEvent) {
22
+ for (var i = 0; i < myTabs.length; i++) {
23
+ myTabs[i].classList.remove("active");
24
+ }
25
+ var clickedTab = tabClickEvent.currentTarget;
26
+ clickedTab.classList.add("active");
27
+ tabClickEvent.preventDefault();
28
+ var myContentPanes = document.querySelectorAll(".tab-pane");
29
+ for (i = 0; i < myContentPanes.length; i++) {
30
+ myContentPanes[i].classList.remove("active");
31
+ }
32
+ var anchorReference = tabClickEvent.target;
33
+ var activePaneId = anchorReference.getAttribute("href");
34
+ var activePane = document.querySelector(activePaneId);
35
+ activePane.classList.add("active");
36
+ }
37
+ for (i = 0; i < myTabs.length; i++) {
38
+ myTabs[i].addEventListener("click", myTabClicks)
39
+ }
40
+ });
41
+
42
+ </script>
17
43
  </head>
18
44
 
19
45
  <body>
@@ -24,23 +50,95 @@
24
50
  .header__name { color: #fff; }
25
51
  .header__name span { margin-right: 10px; font-weight: bold; }
26
52
  .webcomponent { padding: 10px 20px; }
53
+ .container--tabs {
54
+ margin: 2rem;
55
+ }
56
+ .container--tabs .nav-tabs {
57
+ float: left;
58
+ width: 100%;
59
+ margin: 0;
60
+ list-style-type: none;
61
+ border-bottom: 1px solid #ddd;
62
+ }
63
+ .container--tabs .nav-tabs > li {
64
+ float: left;
65
+ margin-bottom: -1px;
66
+ }
67
+ .container--tabs .nav-tabs > li > a {
68
+ float: left;
69
+ margin-right: 2px;
70
+ line-height: 1.42857143;
71
+ padding: 10px;
72
+ border: 1px solid transparent;
73
+ border-radius: 4px 4px 0 0;
74
+ }
75
+ .container--tabs .nav-tabs > li > a:hover {
76
+ border-color: #eee #eee #ddd;
77
+ }
78
+ .container--tabs .nav-tabs > li.active > a, .container--tabs .nav-tabs > li.active > a:hover, .container--tabs .nav-tabs > li.active > a:focus {
79
+ color: #555;
80
+ cursor: default;
81
+ background-color: #fff;
82
+ border: 1px solid #ddd;
83
+ border-bottom-color: transparent;
84
+ }
85
+ .container--tabs .tab-content {
86
+ float: left;
87
+ width: 100%;
88
+ }
89
+ .container--tabs .tab-content > .tab-pane {
90
+ display: none;
91
+ }
92
+ .container--tabs .tab-content > .tab-pane.active {
93
+ display: block;
94
+ padding: 2.5% 3.5%;
95
+ background-color: #efefef;
96
+ }
97
+ .container--tabs .tab-content > .active {
98
+ display: block;
99
+ }
100
+
101
+
102
+
27
103
  </style>
28
104
 
29
105
  <div class="webcomponent">
30
- <player-account-gaming-limits-wrapper-2
31
- endpoint="https://betathome-de-stage-api.stage.norway.everymatrix.com/"
32
- session="6e810eb4-8538-4573-8b7d-3748beb7a590"
33
- userid="4516479"
34
- currency="EUR"
35
- lang="en"
36
- includedlimits="lugas:10-99999999 | wager:10-99999999 | deposit:10-99999999, stake:10-99999999, loss:10-99999999"
37
- products="wager:Casino, deposit:Casino, stake:Sports, loss:All"
38
- periods="lugas: M, deposit: D-W-M, loss: D-W-M, wager: M, stake: N"
39
- tablabels="Deposit limit, Slots limit, Other limits"
40
- historyenabled="true"
41
- apiversion="gm16"
42
- clientstylingurl="https://storage.googleapis.com/css-upload/bahLimit-2.css">
43
- </player-account-gaming-limits-wrapper-2>
106
+ <div class="container--tabs">
107
+ <section class="row">
108
+ <ul class="nav nav-tabs">
109
+ <li class="active"><a href="#tab-1">Tab 1</a></li>
110
+ <li class=""><a href="#tab-2">Tab 2</a></li>
111
+ <li class=""><a href="#tab-3">Tab 3</a></li>
112
+ </ul>
113
+ <div class="tab-content">
114
+ <div id="tab-1" class="tab-pane active">
115
+ <span class="glyphicon glyphicon-leaf glyphicon--home--feature two columns text-center"></span>
116
+ <span class="col-md-10">
117
+ <h3>Feature 1</h3>
118
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
119
+ </span>
120
+ </div>
121
+ <div id="tab-2" class="tab-pane">
122
+ <span class="glyphicon glyphicon-fire glyphicon--home--feature two columns text-center"></span>
123
+ <span class="col-md-10">
124
+ <player-account-gaming-limits-wrapper-2 endpoint="https://betathome-com-stage-api.stage.norway.everymatrix.com/"
125
+ session="23752d9b-b55b-49b9-a6c2-7f7ac29fe376" userid="4500790" currency="EUR" includedlimits="deposit:10-99999999"
126
+ tablabels="Deposit" historyenabled="false" apiversion="gmcore"
127
+ clientstylingurl="https://storage.googleapis.com/css-upload/bahLimit-2.css" lang="en">
128
+ </player-account-gaming-limits-wrapper-2>
129
+ </span>
130
+ </div>
131
+ <div id="tab-3" class="tab-pane">
132
+ <span class="glyphicon glyphicon-tint glyphicon--home--feature two columns text-center"></span>
133
+ <span class="col-md-10">
134
+ <h3>Feature 3</h3>
135
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
136
+ </span>
137
+ </div>
138
+ </div>
139
+ </section>
140
+ </div>
141
+
44
142
  </div>
45
143
 
46
144
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-account-gaming-limits-wrapper-2",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "main": "dist/player-account-gaming-limits-wrapper-2.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -29,9 +29,9 @@
29
29
  "typescript": "^3.9.3"
30
30
  },
31
31
  "dependencies": {
32
- "@everymatrix/player-account-gaming-limits-history-2": "^1.0.0",
33
- "@everymatrix/player-account-gaming-limits-page-2-gm16": "^1.0.0",
34
- "@everymatrix/player-account-gaming-limits-page-2-gmcore": "^1.0.0",
32
+ "@everymatrix/player-account-gaming-limits-history-2": "^0.0.415",
33
+ "@everymatrix/player-account-gaming-limits-page-2-gm16": "^0.0.415",
34
+ "@everymatrix/player-account-gaming-limits-page-2-gmcore": "^0.0.415",
35
35
  "cross-env": "^7.0.3",
36
36
  "sirv-cli": "^1.0.0",
37
37
  "svelte": "^3.0.0"
@@ -15,8 +15,6 @@
15
15
  export let apiversion:string = '';
16
16
 
17
17
  export let includedlimits:string = '';
18
- export let products:string = '';
19
- export let periods:string = '';
20
18
  export let tablabels:string = '';
21
19
  export let historyenabled:string = "true";
22
20
 
@@ -37,21 +35,6 @@
37
35
  let eachLimit;
38
36
  let limits = includedlimits.split(' | ')
39
37
 
40
- let productUnwrap = products.split(',').map(wordPair => wordPair.trim().split(':').map(word => word.trim()));
41
- const productObject = productUnwrap.reduce((obj, valuePair) => {
42
- obj[valuePair[0]] = valuePair[1];
43
- return obj;
44
- }, {});
45
-
46
- let periodUnwrap:Array<any> = periods.split(',').map(limitPeriodPair => limitPeriodPair.trim().split(':'));
47
- for (let limitPeriodPair of periodUnwrap) {
48
- limitPeriodPair[1] = limitPeriodPair[1].trim().replace('D', 'Daily').replace('W', 'Weekly').replace('M', 'Monthly').replace('N', 'None').split('-');
49
- }
50
- const periodObject = periodUnwrap.reduce((obj, valuePair) => {
51
- obj[valuePair[0]] = valuePair[1];
52
- return obj;
53
- }, {});
54
-
55
38
  limits.forEach(element => {
56
39
  if( element.indexOf(', ') >= 0 ){
57
40
  let multiEachLimit = '';
@@ -81,15 +64,10 @@
81
64
  if(limitMinMax){
82
65
  window.postMessage({ type: 'SetLimitsMinMax', limitMinMax}, window.location.href);
83
66
  }
84
- if(productObject){
85
- window.postMessage({ type: 'SetLimitsProducts', productObject}, window.location.href);
86
- }
87
- if(periodObject){
88
- window.postMessage({ type: 'SetLimitsPeriods', periodObject}, window.location.href);
89
- }
90
67
  }
91
68
 
92
69
  const selectTab = (index:number):void => {
70
+ console.log('mainContainer', mainContainer, mainContainer.children.length)
93
71
  if (mainContainer.children.length > 0) {
94
72
  for (let i:number = 0; i < mainContainer.children.length; i++) {
95
73
  if (index === i) {
@@ -125,8 +103,6 @@
125
103
  }
126
104
 
127
105
  onMount(() => {
128
- selectTab(0);
129
-
130
106
  return () => {
131
107
  mainContainer = null;
132
108
  tabsContainer = null;