@everymatrix/player-account-gaming-limits-wrapper-2 0.1.7 → 1.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/index.html CHANGED
@@ -14,32 +14,6 @@
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>
43
17
  </head>
44
18
 
45
19
  <body>
@@ -50,94 +24,22 @@
50
24
  .header__name { color: #fff; }
51
25
  .header__name span { margin-right: 10px; font-weight: bold; }
52
26
  .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
-
103
27
  </style>
104
28
 
105
29
  <div class="webcomponent">
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>
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"></player-account-gaming-limits-wrapper-2>
141
43
 
142
44
  </div>
143
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-account-gaming-limits-wrapper-2",
3
- "version": "0.1.7",
3
+ "version": "1.0.1",
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": "^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",
32
+ "@everymatrix/player-account-gaming-limits-history-2": "^1.0.0",
33
+ "@everymatrix/player-account-gaming-limits-page-2-gm16": "^1.0.1",
34
+ "@everymatrix/player-account-gaming-limits-page-2-gmcore": "^1.0.0",
35
35
  "cross-env": "^7.0.3",
36
36
  "sirv-cli": "^1.0.0",
37
37
  "svelte": "^3.0.0"
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "a90b005fe3a45c7d5ba83769886d60c006b3968f"
42
+ "gitHead": "6d69f62bef936eff5cd54efb298cc87bbcefed46"
43
43
  }
@@ -15,6 +15,8 @@
15
15
  export let apiversion:string = '';
16
16
 
17
17
  export let includedlimits:string = '';
18
+ export let products:string = '';
19
+ export let periods:string = '';
18
20
  export let tablabels:string = '';
19
21
  export let historyenabled:string = "true";
20
22
 
@@ -35,6 +37,21 @@
35
37
  let eachLimit;
36
38
  let limits = includedlimits.split(' | ')
37
39
 
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
+
38
55
  limits.forEach(element => {
39
56
  if( element.indexOf(', ') >= 0 ){
40
57
  let multiEachLimit = '';
@@ -64,9 +81,15 @@
64
81
  if(limitMinMax){
65
82
  window.postMessage({ type: 'SetLimitsMinMax', limitMinMax}, window.location.href);
66
83
  }
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
+ }
67
90
  }
68
91
 
69
- const selectTab = (index:number = 0):void => {
92
+ const selectTab = (index:number):void => {
70
93
  if (mainContainer.children.length > 0) {
71
94
  for (let i:number = 0; i < mainContainer.children.length; i++) {
72
95
  if (index === i) {
@@ -133,7 +156,7 @@
133
156
  <div class="player-account-gaming-limits-wrapper-2" bind:this={mainContainer}>
134
157
  {#each limitTabs as limits}
135
158
  {#if apiversion == 'gmcore'}
136
- <player-account-gaming-limits-page-2-gm16
159
+ <player-account-gaming-limits-page-2-gm16 class="hidden selected"
137
160
  {lang}
138
161
  {currency}
139
162
  {limits}
@@ -145,7 +168,7 @@
145
168
  {clientstylingurl}
146
169
  ></player-account-gaming-limits-page-2-gm16>
147
170
  {:else}
148
- <player-account-gaming-limits-page-2-gm16
171
+ <player-account-gaming-limits-page-2-gm16 class="hidden selected"
149
172
  {lang}
150
173
  {currency}
151
174
  {limits}