@bexis2/bexis2-core-ui 0.2.12 → 0.2.14
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/README.md +15 -0
- package/dist/components/Table/TableFilter.svelte +117 -117
- package/dist/components/file/FileUploader.svelte.d.ts +2 -2
- package/dist/components/page/menu/Menu.svelte +52 -26
- package/dist/components/page/menu/MenuBar.svelte +9 -8
- package/dist/components/page/menu/MenuBar.svelte.d.ts +2 -2
- package/dist/components/page/menu/MenuItem.svelte +27 -10
- package/dist/components/page/menu/MenuSublist.svelte +16 -19
- package/dist/components/page/menu/MenuSublist.svelte.d.ts +0 -1
- package/dist/components/page/menu/SettingsBar.svelte +24 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/models/Enums.d.ts +18 -0
- package/dist/models/Enums.js +22 -0
- package/dist/models/Models.d.ts +17 -2
- package/dist/models/Models.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/Table/TableFilter.svelte +222 -222
- package/src/lib/components/file/FileUploader.svelte +2 -2
- package/src/lib/components/page/menu/Menu.svelte +65 -40
- package/src/lib/components/page/menu/MenuBar.svelte +20 -20
- package/src/lib/components/page/menu/MenuItem.svelte +28 -11
- package/src/lib/components/page/menu/MenuSublist.svelte +40 -43
- package/src/lib/components/page/menu/SettingsBar.svelte +42 -31
- package/src/lib/index.ts +6 -3
- package/src/lib/models/Enums.ts +22 -0
- package/src/lib/models/Models.ts +22 -2
package/dist/models/Models.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SvelteComponent } from 'svelte';
|
|
2
2
|
import type { ColumnFilterFn } from 'svelte-headless-table/lib/plugins';
|
|
3
3
|
import type { Writable } from 'svelte/store';
|
|
4
|
+
import { decimalCharacterType, orientationType, textMarkerType, textSeperatorType } from './Enums';
|
|
4
5
|
export interface linkType {
|
|
5
6
|
label: string;
|
|
6
7
|
url: string;
|
|
@@ -21,13 +22,27 @@ export interface fileInfoType {
|
|
|
21
22
|
description: string;
|
|
22
23
|
validationHash: string;
|
|
23
24
|
}
|
|
24
|
-
export interface
|
|
25
|
+
export interface fileUploaderType {
|
|
25
26
|
accept: string[];
|
|
26
27
|
existingFiles: fileInfoType[];
|
|
27
28
|
descriptionType: number;
|
|
28
29
|
multiple: boolean;
|
|
29
30
|
maxSize: number;
|
|
30
|
-
|
|
31
|
+
}
|
|
32
|
+
export interface asciiFileReaderInfoType extends fileReaderInfoType {
|
|
33
|
+
cells: boolean[];
|
|
34
|
+
seperator: textSeperatorType;
|
|
35
|
+
textMarker: textMarkerType;
|
|
36
|
+
}
|
|
37
|
+
export interface fileReaderInfoType {
|
|
38
|
+
decimal: decimalCharacterType;
|
|
39
|
+
orientation: orientationType;
|
|
40
|
+
offset: number;
|
|
41
|
+
variables: number;
|
|
42
|
+
data: number;
|
|
43
|
+
unit: number;
|
|
44
|
+
description: number;
|
|
45
|
+
dateformat: string;
|
|
31
46
|
}
|
|
32
47
|
export interface filesType {
|
|
33
48
|
accepted: Blob[];
|
package/dist/models/Models.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import { decimalCharacterType, orientationType, textMarkerType, textSeperatorType } from './Enums';
|
package/package.json
CHANGED
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Fa from 'svelte-fa/src/fa.svelte';
|
|
3
|
-
import { faFilter } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
-
import { popup } from '@skeletonlabs/skeleton';
|
|
5
|
-
import type { PopupSettings } from '@skeletonlabs/skeleton';
|
|
6
|
-
|
|
7
|
-
export let filterValue;
|
|
8
|
-
export let values;
|
|
9
|
-
export let id;
|
|
10
|
-
export let tableId;
|
|
11
|
-
export let toFilterableValueFn: undefined | ((value: any) => any) = undefined;
|
|
12
|
-
|
|
13
|
-
let firstOption;
|
|
14
|
-
let firstValue;
|
|
15
|
-
let secondOption;
|
|
16
|
-
let secondValue;
|
|
17
|
-
let active = false;
|
|
18
|
-
|
|
19
|
-
const options = {
|
|
20
|
-
number: [
|
|
21
|
-
{
|
|
22
|
-
value: 'isequal',
|
|
23
|
-
label: 'Is equal to'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
value: 'isgreaterorequal',
|
|
27
|
-
label: 'Is greater than or equal to'
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
value: 'isgreater',
|
|
31
|
-
label: 'Is greater than'
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
value: 'islessorequal',
|
|
35
|
-
label: 'Is less than or equal to'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
value: 'isless',
|
|
39
|
-
label: 'Is less than'
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
value: 'isnotequal',
|
|
43
|
-
label: 'Is not equal to'
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
string: [
|
|
47
|
-
{
|
|
48
|
-
value: '
|
|
49
|
-
label: '
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
value: '
|
|
53
|
-
label: '
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
value: '
|
|
57
|
-
label: '
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
value: '
|
|
61
|
-
label: '
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
value: '
|
|
65
|
-
label: '
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
value: 'ends',
|
|
69
|
-
label: 'Ends with'
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
date: [
|
|
73
|
-
{
|
|
74
|
-
value: 'ison',
|
|
75
|
-
label: 'Is on'
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
value: 'isstartingfrom',
|
|
79
|
-
label: 'Is starting from'
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
value: 'isafter',
|
|
83
|
-
label: 'Is after'
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
value: 'isuntil',
|
|
87
|
-
label: 'Is until'
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
value: 'isbefore',
|
|
91
|
-
label: 'Is before'
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
value: 'isnoton',
|
|
95
|
-
label: 'Is not on'
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const popupId = `${tableId}-${id}`;
|
|
101
|
-
|
|
102
|
-
const popupFeatured: PopupSettings = {
|
|
103
|
-
event: 'click',
|
|
104
|
-
target: popupId,
|
|
105
|
-
placement: 'bottom-start'
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
let type: string = typeof (toFilterableValueFn ? toFilterableValueFn($values[0]) : $values[0]);
|
|
109
|
-
if (type === 'object') {
|
|
110
|
-
if ($values[0] instanceof Date) {
|
|
111
|
-
type = 'date';
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
</script>
|
|
115
|
-
|
|
116
|
-
<form class="">
|
|
117
|
-
<button
|
|
118
|
-
class:variant-filled-primary={active}
|
|
119
|
-
class="btn w-max p-2"
|
|
120
|
-
type="button"
|
|
121
|
-
use:popup={popupFeatured}
|
|
122
|
-
>
|
|
123
|
-
<Fa icon={faFilter} size="12" />
|
|
124
|
-
</button>
|
|
125
|
-
|
|
126
|
-
<div data-popup={`${popupId}`}>
|
|
127
|
-
<div class="card p-3 absolute grid gap-2 shadow-lg z-10 w-min bg-base-100">
|
|
128
|
-
<button
|
|
129
|
-
class="btn variant-filled-primary btn-sm"
|
|
130
|
-
type="button"
|
|
131
|
-
on:click|preventDefault={() => {
|
|
132
|
-
firstOption = 'isequal';
|
|
133
|
-
firstValue = undefined;
|
|
134
|
-
secondOption = 'isequal';
|
|
135
|
-
secondValue = undefined;
|
|
136
|
-
|
|
137
|
-
$filterValue = [firstOption, firstValue, secondOption, secondValue];
|
|
138
|
-
active = false;
|
|
139
|
-
}}>Clear Filter</button
|
|
140
|
-
>
|
|
141
|
-
|
|
142
|
-
<label for="" class="label normal-case text-sm">Show rows with value that</label>
|
|
143
|
-
<div class="grid gap-2 w-full">
|
|
144
|
-
<select
|
|
145
|
-
class="select border border-primary-500 text-sm p-1"
|
|
146
|
-
aria-label="Show rows with value that"
|
|
147
|
-
bind:value={firstOption}
|
|
148
|
-
on:click|stopPropagation
|
|
149
|
-
>
|
|
150
|
-
{#each options[type] as option (option)}
|
|
151
|
-
<option value={option.value}>{option.label}</option>
|
|
152
|
-
{/each}
|
|
153
|
-
</select>
|
|
154
|
-
{#if type === 'number'}
|
|
155
|
-
<input
|
|
156
|
-
type="number"
|
|
157
|
-
class="input p-1 border border-primary-500"
|
|
158
|
-
bind:value={firstValue}
|
|
159
|
-
on:click|stopPropagation
|
|
160
|
-
/>
|
|
161
|
-
{:else if type === 'string'}
|
|
162
|
-
<input
|
|
163
|
-
type="text"
|
|
164
|
-
class="input p-1 border border-primary-500"
|
|
165
|
-
bind:value={firstValue}
|
|
166
|
-
on:click|stopPropagation
|
|
167
|
-
/>
|
|
168
|
-
{:else}
|
|
169
|
-
<input
|
|
170
|
-
type="date"
|
|
171
|
-
class="input p-1 border border-primary-500"
|
|
172
|
-
bind:value={firstValue}
|
|
173
|
-
on:click|stopPropagation
|
|
174
|
-
/>
|
|
175
|
-
{/if}
|
|
176
|
-
</div>
|
|
177
|
-
<label for="" class="label normal-case">And</label>
|
|
178
|
-
<div class="grid gap-2 w-max">
|
|
179
|
-
<select
|
|
180
|
-
class="select border border-primary-500 text-sm p-1"
|
|
181
|
-
aria-label="Show rows with value that"
|
|
182
|
-
bind:value={secondOption}
|
|
183
|
-
on:click|stopPropagation
|
|
184
|
-
>
|
|
185
|
-
{#each options[type] as option (option)}
|
|
186
|
-
<option value={option.value}>{option.label}</option>
|
|
187
|
-
{/each}
|
|
188
|
-
</select>
|
|
189
|
-
{#if type === 'number'}
|
|
190
|
-
<input
|
|
191
|
-
type="number"
|
|
192
|
-
class="input p-1 border border-primary-500"
|
|
193
|
-
bind:value={secondValue}
|
|
194
|
-
on:click|stopPropagation
|
|
195
|
-
/>
|
|
196
|
-
{:else if type === 'string'}
|
|
197
|
-
<input
|
|
198
|
-
type="text"
|
|
199
|
-
class="input p-1 border border-primary-500"
|
|
200
|
-
bind:value={secondValue}
|
|
201
|
-
on:click|stopPropagation
|
|
202
|
-
/>
|
|
203
|
-
{:else}
|
|
204
|
-
<input
|
|
205
|
-
type="date"
|
|
206
|
-
class="input p-1 border border-primary-500"
|
|
207
|
-
bind:value={secondValue}
|
|
208
|
-
on:click|stopPropagation
|
|
209
|
-
/>
|
|
210
|
-
{/if}
|
|
211
|
-
</div>
|
|
212
|
-
<button
|
|
213
|
-
class="btn variant-filled-primary btn-sm"
|
|
214
|
-
type="button"
|
|
215
|
-
on:click|preventDefault={() => {
|
|
216
|
-
active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
|
|
217
|
-
$filterValue = [firstOption, firstValue, secondOption, secondValue];
|
|
218
|
-
}}>Apply</button
|
|
219
|
-
>
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
</form>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Fa from 'svelte-fa/src/fa.svelte';
|
|
3
|
+
import { faFilter } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { popup } from '@skeletonlabs/skeleton';
|
|
5
|
+
import type { PopupSettings } from '@skeletonlabs/skeleton';
|
|
6
|
+
|
|
7
|
+
export let filterValue;
|
|
8
|
+
export let values;
|
|
9
|
+
export let id;
|
|
10
|
+
export let tableId;
|
|
11
|
+
export let toFilterableValueFn: undefined | ((value: any) => any) = undefined;
|
|
12
|
+
|
|
13
|
+
let firstOption;
|
|
14
|
+
let firstValue;
|
|
15
|
+
let secondOption;
|
|
16
|
+
let secondValue;
|
|
17
|
+
let active = false;
|
|
18
|
+
|
|
19
|
+
const options = {
|
|
20
|
+
number: [
|
|
21
|
+
{
|
|
22
|
+
value: 'isequal',
|
|
23
|
+
label: 'Is equal to'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: 'isgreaterorequal',
|
|
27
|
+
label: 'Is greater than or equal to'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 'isgreater',
|
|
31
|
+
label: 'Is greater than'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: 'islessorequal',
|
|
35
|
+
label: 'Is less than or equal to'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: 'isless',
|
|
39
|
+
label: 'Is less than'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: 'isnotequal',
|
|
43
|
+
label: 'Is not equal to'
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
string: [
|
|
47
|
+
{
|
|
48
|
+
value: 'contains',
|
|
49
|
+
label: 'Contains'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: 'notcontains',
|
|
53
|
+
label: 'Does not contain'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: 'isequal',
|
|
57
|
+
label: 'Is equal to'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
value: 'isnotequal',
|
|
61
|
+
label: 'Is not equal to'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
value: 'starts',
|
|
65
|
+
label: 'Starts with'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
value: 'ends',
|
|
69
|
+
label: 'Ends with'
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
date: [
|
|
73
|
+
{
|
|
74
|
+
value: 'ison',
|
|
75
|
+
label: 'Is on'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
value: 'isstartingfrom',
|
|
79
|
+
label: 'Is starting from'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
value: 'isafter',
|
|
83
|
+
label: 'Is after'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: 'isuntil',
|
|
87
|
+
label: 'Is until'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
value: 'isbefore',
|
|
91
|
+
label: 'Is before'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
value: 'isnoton',
|
|
95
|
+
label: 'Is not on'
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const popupId = `${tableId}-${id}`;
|
|
101
|
+
|
|
102
|
+
const popupFeatured: PopupSettings = {
|
|
103
|
+
event: 'click',
|
|
104
|
+
target: popupId,
|
|
105
|
+
placement: 'bottom-start'
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
let type: string = typeof (toFilterableValueFn ? toFilterableValueFn($values[0]) : $values[0]);
|
|
109
|
+
if (type === 'object') {
|
|
110
|
+
if ($values[0] instanceof Date) {
|
|
111
|
+
type = 'date';
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<form class="">
|
|
117
|
+
<button
|
|
118
|
+
class:variant-filled-primary={active}
|
|
119
|
+
class="btn w-max p-2"
|
|
120
|
+
type="button"
|
|
121
|
+
use:popup={popupFeatured}
|
|
122
|
+
>
|
|
123
|
+
<Fa icon={faFilter} size="12" />
|
|
124
|
+
</button>
|
|
125
|
+
|
|
126
|
+
<div data-popup={`${popupId}`}>
|
|
127
|
+
<div class="card p-3 absolute grid gap-2 shadow-lg z-10 w-min bg-base-100">
|
|
128
|
+
<button
|
|
129
|
+
class="btn variant-filled-primary btn-sm"
|
|
130
|
+
type="button"
|
|
131
|
+
on:click|preventDefault={() => {
|
|
132
|
+
firstOption = 'isequal';
|
|
133
|
+
firstValue = undefined;
|
|
134
|
+
secondOption = 'isequal';
|
|
135
|
+
secondValue = undefined;
|
|
136
|
+
|
|
137
|
+
$filterValue = [firstOption, firstValue, secondOption, secondValue];
|
|
138
|
+
active = false;
|
|
139
|
+
}}>Clear Filter</button
|
|
140
|
+
>
|
|
141
|
+
|
|
142
|
+
<label for="" class="label normal-case text-sm">Show rows with value that</label>
|
|
143
|
+
<div class="grid gap-2 w-full">
|
|
144
|
+
<select
|
|
145
|
+
class="select border border-primary-500 text-sm p-1"
|
|
146
|
+
aria-label="Show rows with value that"
|
|
147
|
+
bind:value={firstOption}
|
|
148
|
+
on:click|stopPropagation
|
|
149
|
+
>
|
|
150
|
+
{#each options[type] as option (option)}
|
|
151
|
+
<option value={option.value}>{option.label}</option>
|
|
152
|
+
{/each}
|
|
153
|
+
</select>
|
|
154
|
+
{#if type === 'number'}
|
|
155
|
+
<input
|
|
156
|
+
type="number"
|
|
157
|
+
class="input p-1 border border-primary-500"
|
|
158
|
+
bind:value={firstValue}
|
|
159
|
+
on:click|stopPropagation
|
|
160
|
+
/>
|
|
161
|
+
{:else if type === 'string'}
|
|
162
|
+
<input
|
|
163
|
+
type="text"
|
|
164
|
+
class="input p-1 border border-primary-500"
|
|
165
|
+
bind:value={firstValue}
|
|
166
|
+
on:click|stopPropagation
|
|
167
|
+
/>
|
|
168
|
+
{:else}
|
|
169
|
+
<input
|
|
170
|
+
type="date"
|
|
171
|
+
class="input p-1 border border-primary-500"
|
|
172
|
+
bind:value={firstValue}
|
|
173
|
+
on:click|stopPropagation
|
|
174
|
+
/>
|
|
175
|
+
{/if}
|
|
176
|
+
</div>
|
|
177
|
+
<label for="" class="label normal-case">And</label>
|
|
178
|
+
<div class="grid gap-2 w-max">
|
|
179
|
+
<select
|
|
180
|
+
class="select border border-primary-500 text-sm p-1"
|
|
181
|
+
aria-label="Show rows with value that"
|
|
182
|
+
bind:value={secondOption}
|
|
183
|
+
on:click|stopPropagation
|
|
184
|
+
>
|
|
185
|
+
{#each options[type] as option (option)}
|
|
186
|
+
<option value={option.value}>{option.label}</option>
|
|
187
|
+
{/each}
|
|
188
|
+
</select>
|
|
189
|
+
{#if type === 'number'}
|
|
190
|
+
<input
|
|
191
|
+
type="number"
|
|
192
|
+
class="input p-1 border border-primary-500"
|
|
193
|
+
bind:value={secondValue}
|
|
194
|
+
on:click|stopPropagation
|
|
195
|
+
/>
|
|
196
|
+
{:else if type === 'string'}
|
|
197
|
+
<input
|
|
198
|
+
type="text"
|
|
199
|
+
class="input p-1 border border-primary-500"
|
|
200
|
+
bind:value={secondValue}
|
|
201
|
+
on:click|stopPropagation
|
|
202
|
+
/>
|
|
203
|
+
{:else}
|
|
204
|
+
<input
|
|
205
|
+
type="date"
|
|
206
|
+
class="input p-1 border border-primary-500"
|
|
207
|
+
bind:value={secondValue}
|
|
208
|
+
on:click|stopPropagation
|
|
209
|
+
/>
|
|
210
|
+
{/if}
|
|
211
|
+
</div>
|
|
212
|
+
<button
|
|
213
|
+
class="btn variant-filled-primary btn-sm"
|
|
214
|
+
type="button"
|
|
215
|
+
on:click|preventDefault={() => {
|
|
216
|
+
active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
|
|
217
|
+
$filterValue = [firstOption, firstValue, secondOption, secondValue];
|
|
218
|
+
}}>Apply</button
|
|
219
|
+
>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</form>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { fileUploaderModel, fileInfoType, filesType } from '../../models/Models.js';
|
|
2
|
+
import type { fileUploaderModel, fileInfoType, filesType, fileUploaderType } from '../../models/Models.js';
|
|
3
3
|
|
|
4
4
|
import DropZone from 'svelte-file-dropzone/Dropzone.svelte';
|
|
5
5
|
import Fa from 'svelte-fa/src/fa.svelte';
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
export let context = '';
|
|
29
29
|
|
|
30
|
-
export let data:
|
|
30
|
+
export let data: fileUploaderType | undefined;
|
|
31
31
|
|
|
32
32
|
$: model = data;
|
|
33
33
|
$: submitBt = 'submit';
|
|
@@ -1,40 +1,65 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount } from 'svelte';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
onMount(async () => {
|
|
13
|
-
let m = await getMenuItems();
|
|
14
|
-
menuStore.set(m);
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import { getMenuItems } from './MenuDataCaller';
|
|
4
|
+
import { menuStore } from '$store/pageStores';
|
|
5
|
+
|
|
6
|
+
import MenuBar from './MenuBar.svelte';
|
|
7
|
+
import SettingsBar from './SettingsBar.svelte';
|
|
8
|
+
import Fa from 'svelte-fa/src/fa.svelte';
|
|
9
|
+
import { faBars } from '@fortawesome/free-solid-svg-icons';
|
|
10
|
+
import { Accordion } from '@skeletonlabs/skeleton';
|
|
11
|
+
|
|
12
|
+
onMount(async () => {
|
|
13
|
+
let m = await getMenuItems();
|
|
14
|
+
menuStore.set(m);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
let hamburger = true;
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
{#if $menuStore !== undefined}
|
|
22
|
+
<div
|
|
23
|
+
class="sm:flex h-min flex-row w-full justify-between items-center md:flex px-3 py-2 bg-tertiary-50 text-surface-800 z-50 shadow-md"
|
|
24
|
+
>
|
|
25
|
+
<div class="flex justify-between gap-5">
|
|
26
|
+
<div class="basis-8">
|
|
27
|
+
{#if $menuStore.Logo}
|
|
28
|
+
<img
|
|
29
|
+
src="data:{$menuStore.Logo.Mime};charset=utf-8;base64, {$menuStore.Logo.Data}"
|
|
30
|
+
alt={$menuStore.Logo.Name}
|
|
31
|
+
style="height:40px;"
|
|
32
|
+
/>
|
|
33
|
+
{/if}
|
|
34
|
+
</div>
|
|
35
|
+
<button
|
|
36
|
+
class="w-min h-min variant-ghost-surface aspect-square p-3 rounded-lg sm:hidden justify-end btn"
|
|
37
|
+
on:click|preventDefault={() => (hamburger = !hamburger)}
|
|
38
|
+
>
|
|
39
|
+
<Fa icon={faBars} />
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="sm:flex w-full h-full sm:h-10" class:hidden={hamburger}>
|
|
44
|
+
<div class="sm:flex justify-between w-full">
|
|
45
|
+
<Accordion>
|
|
46
|
+
<div class="sm:flex w-full justify-between">
|
|
47
|
+
<!-- <div class="sm:flex items-center sm:gap-5 px-1 text-lg justify-start gap-2 py-0"> -->
|
|
48
|
+
<MenuBar menuBar={$menuStore.MenuBar} />
|
|
49
|
+
<MenuBar menuBar={$menuStore.Extended} />
|
|
50
|
+
<!-- </div> -->
|
|
51
|
+
<!-- <div class="sm:flex items-center sm:gap-5 px-1 text-lg justify-end gap-2"> -->
|
|
52
|
+
<div class="grid w-full sm:flex gap-2 justify-auto sm:justify-end">
|
|
53
|
+
<MenuBar menuBar={$menuStore.AccountBar} />
|
|
54
|
+
<MenuBar menuBar={$menuStore.LaunchBar} />
|
|
55
|
+
<SettingsBar menuBar={$menuStore.Settings} />
|
|
56
|
+
<!-- </div> -->
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</Accordion>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
{:else}
|
|
64
|
+
<div class="placeholder h-14 bg-tertiary-50 shadow-md" />
|
|
65
|
+
{/if}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
|
|
3
|
-
import { storePopup } from '@skeletonlabs/skeleton';
|
|
4
|
-
storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
import Item from './MenuItem.svelte';
|
|
8
|
-
|
|
9
|
-
export let menuBar:
|
|
10
|
-
|
|
11
|
-
let comboboxValue: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{#
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
|
|
3
|
+
import { storePopup } from '@skeletonlabs/skeleton';
|
|
4
|
+
storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
|
|
5
|
+
|
|
6
|
+
import type { MenuItem } from './menu';
|
|
7
|
+
import Item from './MenuItem.svelte';
|
|
8
|
+
|
|
9
|
+
export let menuBar: MenuItem[];
|
|
10
|
+
|
|
11
|
+
let comboboxValue: string;
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
{#if menuBar}
|
|
15
|
+
<div class="h-full place-self-center sm:flex gap-2 w-full sm:w-auto">
|
|
16
|
+
{#each menuBar as menubarItem}
|
|
17
|
+
<Item {menubarItem} {comboboxValue} />
|
|
18
|
+
{/each}
|
|
19
|
+
</div>
|
|
20
|
+
{/if}
|