-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstub-view.svelte
90 lines (69 loc) · 2.65 KB
/
stub-view.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<script>
const mod = {
// VALUE
TestItems: [],
TestItemSelected: null,
OLSKResultsEnableLooping: false,
// MESSAGE
OLSKResultsDispatchArrow (inputData) {
mod.TestItemSelected = inputData;
window.TestOLSKResultsDispatchArrow.innerHTML = parseInt(window.TestOLSKResultsDispatchArrow.innerHTML) + 1;
window.TestOLSKResultsDispatchArrowData.innerHTML = inputData;
},
OLSKResultsDispatchClick (inputData) {
mod.TestItemSelected = inputData;
window.TestOLSKResultsDispatchClick.innerHTML = parseInt(window.TestOLSKResultsDispatchClick.innerHTML) + 1;
},
};
import Module from './main.svelte';
</script>
<Module
OLSKResultsListItems={ mod.TestItems }
OLSKResultsListItemSelected={ mod.TestItemSelected }
OLSKResultsDispatchArrow={ mod.OLSKResultsDispatchArrow }
OLSKResultsDispatchClick={ mod.OLSKResultsDispatchClick }
OLSKResultsEnableLooping={ mod.OLSKResultsEnableLooping }
let:OLSKResultsListItem={ item }
{ ...Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()).map(function (e, index, coll) {
if (['OLSKResultsIgnoreKeyboard'].includes(e[0])) {
e[1] = JSON.parse(e[1]);
}
return e;
})) }
>
<div>{ item }</div>
<em slot="OLSKResultsEmpty" class="TestOLSKResultsEmptySlot">TestItemsZero</em>
</Module>
<hr role="presentation" />
<p>
<strong>OLSKResultsListItemSelected</strong>
<button id="TestSetOLSKResultsListItemSelectedNull" on:click={ () => mod.TestItemSelected = null }>null</button>
<button id="TestSetOLSKResultsListItemSelectedBravo" on:click={ () => mod.TestItemSelected = 'bravo' }>'bravo'</button>
<span id="TestItemSelected">{ mod.TestItemSelected }</span>
</p>
<p>
<strong>OLSKResultsListItems</strong>
<button id="TestSetOLSKResultsListItemsZero" on:click={ () => mod.TestItems = [] }>Zero</button>
<button id="TestSetOLSKResultsListItemsSingle" on:click={ () => mod.TestItems = ['alfa'] }>Single</button>
<button id="TestSetOLSKResultsListItemsMultiple" on:click={ () => mod.TestItems = ['alfa','bravo','charlie'] }>Multiple</button>
</p>
<p>
<strong>OLSKResultsEnableLooping</strong>
<button on:click={ () => mod.OLSKResultsEnableLooping = !mod.OLSKResultsEnableLooping } id="TestSetOLSKResultsEnableLooping">Toggle</button>
<span id="TestOLSKResultsEnableLooping">{ mod.OLSKResultsEnableLooping }</span>
</p>
<hr role="presentation" />
<p>
<strong>OLSKResultsDispatchArrow</strong>
<span id="TestOLSKResultsDispatchArrow">0</span>
<span id="TestOLSKResultsDispatchArrowData">undefined</span>
</p>
<p>
<strong>OLSKResultsDispatchClick</strong>
<span id="TestOLSKResultsDispatchClick">0</span>
</p>
<style>
:global(.OLSKResultsListItemSelected) {
background: #eee;
}
</style>