@likable-hair/svelte 3.0.18 → 3.0.20
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/dist/components/composed/forms/Dropdown.svelte +16 -7
- package/dist/components/composed/forms/Dropdown.svelte.d.ts +4 -0
- package/dist/components/composed/list/PaginatedTable.svelte +131 -133
- package/dist/components/composed/list/PaginatedTable.svelte.d.ts +68 -2
- package/dist/components/composed/list/Paginator.svelte +12 -6
- package/dist/components/composed/search/Filters.css +0 -0
- package/dist/components/composed/search/Filters.svelte +97 -0
- package/dist/components/composed/search/Filters.svelte.d.ts +26 -0
- package/dist/components/composed/search/GlobalSearchTextField.css +3 -3
- package/dist/components/composed/search/GlobalSearchTextField.svelte +1 -1
- package/dist/components/layouts/StableDividedSideBarLayout.css +2 -2
- package/dist/components/layouts/UnstableDividedSideBarLayout.css +3 -3
- package/dist/components/layouts/UnstableDividedSideBarLayout.svelte +77 -12
- package/dist/components/layouts/UnstableDividedSideBarLayout.svelte.d.ts +16 -1
- package/dist/components/simple/buttons/Button.css +1 -0
- package/dist/components/simple/buttons/Button.svelte +4 -0
- package/dist/components/simple/charts/GanymedeLineChart.svelte +85 -0
- package/dist/components/simple/charts/GanymedeLineChart.svelte.d.ts +32 -0
- package/dist/components/simple/forms/Autocomplete.svelte +5 -1
- package/dist/components/simple/forms/Autocomplete.svelte.d.ts +1 -0
- package/dist/components/simple/forms/SimpleTextField.svelte +1 -1
- package/dist/components/simple/lists/ColorInvertedSelector.css +6 -1
- package/dist/components/simple/lists/ColorInvertedSelector.svelte +105 -26
- package/dist/components/simple/lists/ColorInvertedSelector.svelte.d.ts +8 -2
- package/dist/components/simple/lists/SimpleTable.svelte +32 -28
- package/dist/components/simple/lists/SimpleTable.svelte.d.ts +9 -1
- package/dist/components/simple/lists/columnTypes.d.ts +35 -0
- package/dist/components/simple/lists/columnTypes.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/filters/builder.d.ts +43 -0
- package/dist/utils/filters/builder.js +137 -0
- package/dist/utils/filters/filters.d.ts +26 -0
- package/dist/utils/filters/filters.js +29 -0
- package/dist/utils/filters/modifiers/join.d.ts +26 -0
- package/dist/utils/filters/modifiers/join.js +1 -0
- package/dist/utils/filters/modifiers/where.d.ts +29 -0
- package/dist/utils/filters/modifiers/where.js +1 -0
- package/package.json +3 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script>import Autocomplete from "../../../components/simple/forms/Autocomplete.svelte";
|
|
4
4
|
import Button from "../../simple/buttons/Button.svelte";
|
|
5
5
|
import Icon from "../../simple/media/Icon.svelte";
|
|
6
|
-
export let items = [], values = [], multiple = false, searchText = void 0, maxVisibleChips = void 0, placeholder = "Seleziona", icon = void 0;
|
|
6
|
+
export let items = [], values = [], multiple = false, searchText = void 0, maxVisibleChips = void 0, placeholder = "Seleziona", clearable = true, mandatory = true, icon = void 0;
|
|
7
7
|
$:
|
|
8
8
|
generatedLabel = values.length == 1 ? values[0].label : `${values.length} Selezionati`;
|
|
9
9
|
function handleCloseClick(event) {
|
|
@@ -19,11 +19,15 @@ function handleCloseClick(event) {
|
|
|
19
19
|
bind:searchText
|
|
20
20
|
bind:multiple
|
|
21
21
|
bind:maxVisibleChips
|
|
22
|
+
bind:mandatory
|
|
22
23
|
searchFunction={() => true}
|
|
24
|
+
on:change
|
|
23
25
|
>
|
|
24
26
|
<svelte:fragment slot="selection-container" let:openMenu let:handleKeyDown>
|
|
25
27
|
<Button
|
|
26
28
|
--button-default-background-color="transparent"
|
|
29
|
+
--button-default-focus-background-color="rgb(var(--global-color-primary-400), .3)"
|
|
30
|
+
--button-default-focus-color="rgb(var(--global-color-contrast-900))"
|
|
27
31
|
--button-default-border="2px solid rgb(var(--global-color-primary-400))"
|
|
28
32
|
--button-default-color="rgb(var(--global-color-contrast-800))"
|
|
29
33
|
on:click={openMenu}
|
|
@@ -48,11 +52,13 @@ function handleCloseClick(event) {
|
|
|
48
52
|
{:else}
|
|
49
53
|
<div class="space-between">
|
|
50
54
|
<div>{generatedLabel}</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
{#if clearable}
|
|
56
|
+
<Icon
|
|
57
|
+
name="mdi-close"
|
|
58
|
+
click
|
|
59
|
+
on:click={handleCloseClick}
|
|
60
|
+
></Icon>
|
|
61
|
+
{/if}
|
|
56
62
|
</div>
|
|
57
63
|
{/if}
|
|
58
64
|
</div>
|
|
@@ -67,7 +73,9 @@ function handleCloseClick(event) {
|
|
|
67
73
|
justify-content: flex-start;
|
|
68
74
|
align-items: center;
|
|
69
75
|
gap: 10px;
|
|
70
|
-
width:
|
|
76
|
+
width: 100%;
|
|
77
|
+
text-overflow: ellipsis;
|
|
78
|
+
white-space: pre;
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
.space-between {
|
|
@@ -75,5 +83,6 @@ function handleCloseClick(event) {
|
|
|
75
83
|
display: flex;
|
|
76
84
|
justify-content: space-between;
|
|
77
85
|
align-items: center;
|
|
86
|
+
gap: 10px;
|
|
78
87
|
}
|
|
79
88
|
</style>
|
|
@@ -9,9 +9,13 @@ declare const __propDef: {
|
|
|
9
9
|
searchText?: string | undefined;
|
|
10
10
|
maxVisibleChips?: number | undefined;
|
|
11
11
|
placeholder?: string | undefined;
|
|
12
|
+
clearable?: boolean | undefined;
|
|
13
|
+
mandatory?: boolean | undefined;
|
|
12
14
|
icon?: string | undefined;
|
|
13
15
|
};
|
|
14
16
|
events: {
|
|
17
|
+
change: CustomEvent<any>;
|
|
18
|
+
} & {
|
|
15
19
|
[evt: string]: CustomEvent<any>;
|
|
16
20
|
};
|
|
17
21
|
slots: {
|
|
@@ -1,152 +1,150 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
width?: string;
|
|
7
|
-
minWidth?: string;
|
|
8
|
-
data?: { [key: string]: any };
|
|
9
|
-
};
|
|
1
|
+
<script context="module">import SimpleTable from "../../simple/lists/SimpleTable.svelte";
|
|
2
|
+
import Icon from "../../simple/media/Icon.svelte";
|
|
3
|
+
import Paginator from "./Paginator.svelte";
|
|
4
|
+
import Dropdown from "../forms/Dropdown.svelte";
|
|
5
|
+
import { createEventDispatcher } from "svelte";
|
|
10
6
|
</script>
|
|
11
7
|
|
|
12
|
-
<script
|
|
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
|
-
let items: { [key: string]: any }[] = [],
|
|
39
|
-
maxPage: number | undefined = undefined
|
|
40
|
-
|
|
41
|
-
onMount(() => {
|
|
42
|
-
loadRows()
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
async function loadRows() {
|
|
46
|
-
if(!!fetcher) {
|
|
47
|
-
loading = true
|
|
48
|
-
let results = await fetcher({page, perPage, filters})
|
|
49
|
-
|
|
50
|
-
items = results.data
|
|
51
|
-
page = results.meta.currentPage
|
|
52
|
-
maxPage = results.meta.lastPage
|
|
53
|
-
loading = false
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function handlePaginationChange() {
|
|
58
|
-
loadRows()
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function handlePerPageChange() {
|
|
62
|
-
page = 1
|
|
63
|
-
loadRows()
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
$: perPageOptionsFormatted = perPageOptions.map((el) => {
|
|
67
|
-
return {
|
|
68
|
-
value: el,
|
|
69
|
-
text: el.toString()
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
$: if(reload) {
|
|
73
|
-
loadRows().then(() => {
|
|
74
|
-
reload = false
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
$: filters && loadRows()
|
|
79
|
-
|
|
8
|
+
<script>let clazz = {};
|
|
9
|
+
export { clazz as class };
|
|
10
|
+
export let headers = [], items = [], sortedBy = void 0, sortDirection = void 0, page = 1, maxPage = void 0, rowsPerPageOptions = [
|
|
11
|
+
{ label: "20", value: 20 },
|
|
12
|
+
{ label: "50", value: 50 },
|
|
13
|
+
{ label: "100", value: 100 }
|
|
14
|
+
], hideRowsPerPage = false, totalElements = void 0, rowsPerPage = 20;
|
|
15
|
+
let dispatch = createEventDispatcher();
|
|
16
|
+
let rowsPerPageSelection = [];
|
|
17
|
+
$:
|
|
18
|
+
rowsPerPageSelection = [
|
|
19
|
+
{ label: rowsPerPage.toString(), value: rowsPerPage }
|
|
20
|
+
];
|
|
21
|
+
$:
|
|
22
|
+
if (totalElements !== void 0)
|
|
23
|
+
maxPage = Math.max(Math.round(totalElements / rowsPerPage), 1);
|
|
24
|
+
function handleRowsPerPageChange(e) {
|
|
25
|
+
rowsPerPage = Number(e.detail.selection?.[0].value);
|
|
26
|
+
handlePaginationChange();
|
|
27
|
+
}
|
|
28
|
+
function handlePaginationChange() {
|
|
29
|
+
dispatch("paginationChange", {
|
|
30
|
+
rowsPerPage,
|
|
31
|
+
page
|
|
32
|
+
});
|
|
33
|
+
}
|
|
80
34
|
</script>
|
|
81
35
|
|
|
82
|
-
<div class="
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
36
|
+
<div class="paginated-table">
|
|
37
|
+
<SimpleTable
|
|
38
|
+
bind:headers
|
|
39
|
+
bind:class={clazz.simpleTable}
|
|
40
|
+
bind:items
|
|
41
|
+
bind:sortedBy
|
|
42
|
+
bind:sortDirection
|
|
43
|
+
on:sort
|
|
90
44
|
>
|
|
91
|
-
<svelte:fragment slot="
|
|
92
|
-
<slot name="
|
|
45
|
+
<svelte:fragment slot="header" let:head>
|
|
46
|
+
<slot name="header" {head} >
|
|
47
|
+
<span class="header-label">
|
|
48
|
+
<slot name="headerLabel">
|
|
49
|
+
{head.label}
|
|
50
|
+
</slot>
|
|
51
|
+
</span>
|
|
52
|
+
{#if head.sortable}
|
|
53
|
+
<span
|
|
54
|
+
class="header-sort-icon"
|
|
55
|
+
class:active={sortedBy == head.value}
|
|
56
|
+
class:asc={sortDirection == 'asc'}
|
|
57
|
+
class:desc={sortDirection == 'desc'}
|
|
58
|
+
>
|
|
59
|
+
{#if sortDirection == 'asc'}
|
|
60
|
+
<Icon name="mdi-arrow-up"></Icon>
|
|
61
|
+
{:else}
|
|
62
|
+
<Icon name="mdi-arrow-down"></Icon>
|
|
63
|
+
{/if}
|
|
64
|
+
</span>
|
|
65
|
+
{/if}
|
|
66
|
+
</slot>
|
|
93
67
|
</svelte:fragment>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
68
|
+
<svelte:fragment
|
|
69
|
+
slot="custom"
|
|
70
|
+
let:columnIndex
|
|
71
|
+
let:index
|
|
72
|
+
let:header
|
|
73
|
+
let:item
|
|
74
|
+
>
|
|
75
|
+
<slot name="custom" {index} {columnIndex} {header} {item}/>
|
|
97
76
|
</svelte:fragment>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
77
|
+
<svelte:fragment slot="rowActions" let:index let:item>
|
|
78
|
+
<slot name="rowActions" {index} {item} />
|
|
79
|
+
</svelte:fragment>
|
|
80
|
+
<svelte:fragment slot="append" let:index let:item>
|
|
81
|
+
<slot name="append" {index} {item} />
|
|
82
|
+
</svelte:fragment>
|
|
83
|
+
</SimpleTable>
|
|
84
|
+
<div class="footer">
|
|
85
|
+
<slot
|
|
86
|
+
name="footer"
|
|
87
|
+
{hideRowsPerPage}
|
|
88
|
+
{rowsPerPageOptions}
|
|
89
|
+
{rowsPerPageSelection}
|
|
90
|
+
{totalElements}
|
|
91
|
+
{page}
|
|
92
|
+
{maxPage}
|
|
93
|
+
{rowsPerPage}
|
|
94
|
+
{handlePaginationChange}
|
|
95
|
+
>
|
|
96
|
+
{#if !hideRowsPerPage}
|
|
97
|
+
<Dropdown
|
|
98
|
+
placeholder="Per pagina"
|
|
99
|
+
clearable={false}
|
|
100
|
+
mandatory={true}
|
|
101
|
+
bind:items={rowsPerPageOptions}
|
|
102
|
+
bind:values={rowsPerPageSelection}
|
|
103
|
+
--button-default-width="90px"
|
|
104
|
+
on:change={handleRowsPerPageChange}
|
|
105
|
+
></Dropdown>
|
|
106
|
+
{/if}
|
|
107
|
+
{#if totalElements !== undefined}
|
|
108
|
+
<slot name="rangeDescriptor" {page} {maxPage} {rowsPerPage} {totalElements}>
|
|
109
|
+
<div class="range-descriptor">
|
|
110
|
+
viewing {((page || 1) - 1) * rowsPerPage} - {(page || 1) * rowsPerPage} of {totalElements}
|
|
111
|
+
</div>
|
|
112
|
+
</slot>
|
|
113
|
+
{/if}
|
|
114
|
+
<Paginator
|
|
115
|
+
bind:page
|
|
116
|
+
bind:maxPage
|
|
117
|
+
on:change={handlePaginationChange}
|
|
118
|
+
></Paginator>
|
|
119
|
+
</slot>
|
|
123
120
|
</div>
|
|
124
121
|
</div>
|
|
125
122
|
|
|
126
123
|
<style>
|
|
127
|
-
.
|
|
124
|
+
.paginated-table {
|
|
125
|
+
width: 100%;
|
|
128
126
|
display: flex;
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
gap: 24px;
|
|
129
|
+
align-items: center;
|
|
131
130
|
}
|
|
132
131
|
|
|
133
|
-
.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
color: var(--global-light-contrast-color);
|
|
140
|
-
font-size: .9rem;
|
|
132
|
+
.header-sort-icon {
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.header-sort-icon.active {
|
|
137
|
+
display: inline;
|
|
141
138
|
}
|
|
142
139
|
|
|
143
|
-
.
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
.range-descriptor {
|
|
141
|
+
font-size: .7rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.footer {
|
|
146
145
|
display: flex;
|
|
147
|
-
justify-content:
|
|
146
|
+
justify-content: space-between;
|
|
148
147
|
align-items: center;
|
|
149
|
-
|
|
150
|
-
font-size: .9rem;
|
|
148
|
+
width: 100%;
|
|
151
149
|
}
|
|
152
|
-
</style>
|
|
150
|
+
</style>
|
|
@@ -1,10 +1,76 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import SimpleTable from "../../simple/lists/SimpleTable.svelte";
|
|
3
|
+
import Paginator from "./Paginator.svelte";
|
|
4
|
+
import Dropdown from "../forms/Dropdown.svelte";
|
|
5
|
+
import { type ComponentProps } from "svelte";
|
|
6
|
+
type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
7
|
+
export type Header = ArrayElement<NonNullable<ComponentProps<SimpleTable>['headers']>>;
|
|
2
8
|
declare const __propDef: {
|
|
3
|
-
props:
|
|
9
|
+
props: {
|
|
10
|
+
class?: {
|
|
11
|
+
simpleTable?: ComponentProps<SimpleTable>['class'];
|
|
12
|
+
} | undefined;
|
|
13
|
+
headers?: ComponentProps<SimpleTable>['headers'];
|
|
14
|
+
items?: ComponentProps<SimpleTable>['items'];
|
|
15
|
+
sortedBy?: ComponentProps<SimpleTable>['sortedBy'];
|
|
16
|
+
sortDirection?: ComponentProps<SimpleTable>['sortDirection'];
|
|
17
|
+
page?: number | undefined;
|
|
18
|
+
maxPage?: ComponentProps<Paginator>['maxPage'];
|
|
19
|
+
rowsPerPageOptions?: ComponentProps<Dropdown>['items'];
|
|
20
|
+
hideRowsPerPage?: boolean | undefined;
|
|
21
|
+
totalElements?: number | undefined;
|
|
22
|
+
rowsPerPage?: number | undefined;
|
|
23
|
+
};
|
|
4
24
|
events: {
|
|
25
|
+
sort: CustomEvent<{
|
|
26
|
+
sortedBy: string | undefined;
|
|
27
|
+
sortDirection: string;
|
|
28
|
+
}>;
|
|
29
|
+
} & {
|
|
5
30
|
[evt: string]: CustomEvent<any>;
|
|
6
31
|
};
|
|
7
|
-
slots: {
|
|
32
|
+
slots: {
|
|
33
|
+
header: {
|
|
34
|
+
head: import("../../simple/lists/SimpleTable.svelte").Header;
|
|
35
|
+
};
|
|
36
|
+
headerLabel: {};
|
|
37
|
+
custom: {
|
|
38
|
+
index: any;
|
|
39
|
+
columnIndex: any;
|
|
40
|
+
header: import("../../simple/lists/SimpleTable.svelte").Header;
|
|
41
|
+
item: {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
rowActions: {
|
|
46
|
+
index: any;
|
|
47
|
+
item: {
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
append: {
|
|
52
|
+
index: any;
|
|
53
|
+
item: {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
footer: {
|
|
58
|
+
hideRowsPerPage: boolean;
|
|
59
|
+
rowsPerPageOptions: import("../forms/Dropdown.svelte").Item[] | undefined;
|
|
60
|
+
rowsPerPageSelection: import("../forms/Dropdown.svelte").Item[];
|
|
61
|
+
totalElements: number | undefined;
|
|
62
|
+
page: number;
|
|
63
|
+
maxPage: number | undefined;
|
|
64
|
+
rowsPerPage: number;
|
|
65
|
+
handlePaginationChange: () => void;
|
|
66
|
+
};
|
|
67
|
+
rangeDescriptor: {
|
|
68
|
+
page: number;
|
|
69
|
+
maxPage: number | undefined;
|
|
70
|
+
rowsPerPage: number;
|
|
71
|
+
totalElements: number | undefined;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
8
74
|
};
|
|
9
75
|
export type PaginatedTableProps = typeof __propDef.props;
|
|
10
76
|
export type PaginatedTableEvents = typeof __propDef.events;
|
|
@@ -47,7 +47,8 @@ $:
|
|
|
47
47
|
icon="mdi-chevron-double-left"
|
|
48
48
|
on:click={hardPrevious}
|
|
49
49
|
--button-default-background-color="transparent"
|
|
50
|
-
--button-default-focus-background-color="
|
|
50
|
+
--button-default-focus-background-color="rgb(var(--global-color-primary-500), .3)"
|
|
51
|
+
--button-default-focus-color="rgb(var(--global-color-contrast-900))"
|
|
51
52
|
--button-default-hover-background-color="rgb(var(--global-color-primary-500))"
|
|
52
53
|
--button-default-box-shadow="none"
|
|
53
54
|
--button-default-color="rgb(var(--global-color-contrast-900))"
|
|
@@ -56,7 +57,8 @@ $:
|
|
|
56
57
|
icon="mdi-chevron-left"
|
|
57
58
|
on:click={previousPage}
|
|
58
59
|
--button-default-background-color="transparent"
|
|
59
|
-
--button-default-focus-background-color="
|
|
60
|
+
--button-default-focus-background-color="rgb(var(--global-color-primary-500), .3)"
|
|
61
|
+
--button-default-focus-color="rgb(var(--global-color-contrast-900))"
|
|
60
62
|
--button-default-hover-background-color="rgb(var(--global-color-primary-500))"
|
|
61
63
|
--button-default-box-shadow="none"
|
|
62
64
|
--button-default-color="rgb(var(--global-color-contrast-900))"
|
|
@@ -65,7 +67,8 @@ $:
|
|
|
65
67
|
<Button
|
|
66
68
|
on:click={() => goToPage(page - 1)}
|
|
67
69
|
--button-default-background-color="transparent"
|
|
68
|
-
--button-default-focus-background-color="
|
|
70
|
+
--button-default-focus-background-color="rgb(var(--global-color-primary-500), .3)"
|
|
71
|
+
--button-default-focus-color="rgb(var(--global-color-contrast-900))"
|
|
69
72
|
--button-default-hover-background-color="rgb(var(--global-color-primary-500))"
|
|
70
73
|
--button-default-box-shadow="none"
|
|
71
74
|
--button-default-color="rgb(var(--global-color-contrast-900))"
|
|
@@ -82,7 +85,8 @@ $:
|
|
|
82
85
|
<Button
|
|
83
86
|
on:click={() => goToPage(page + 1)}
|
|
84
87
|
--button-default-background-color="transparent"
|
|
85
|
-
--button-default-focus-background-color="
|
|
88
|
+
--button-default-focus-background-color="rgb(var(--global-color-primary-500), .3)"
|
|
89
|
+
--button-default-focus-color="rgb(var(--global-color-contrast-900))"
|
|
86
90
|
--button-default-hover-background-color="rgb(var(--global-color-primary-500))"
|
|
87
91
|
--button-default-box-shadow="none"
|
|
88
92
|
--button-default-color="rgb(var(--global-color-contrast-900))"
|
|
@@ -93,7 +97,8 @@ $:
|
|
|
93
97
|
on:click={nextPage}
|
|
94
98
|
icon="mdi-chevron-right"
|
|
95
99
|
--button-default-background-color="transparent"
|
|
96
|
-
--button-default-focus-background-color="
|
|
100
|
+
--button-default-focus-background-color="rgb(var(--global-color-primary-500), .3)"
|
|
101
|
+
--button-default-focus-color="rgb(var(--global-color-contrast-900))"
|
|
97
102
|
--button-default-hover-background-color="rgb(var(--global-color-primary-500))"
|
|
98
103
|
--button-default-box-shadow="none"
|
|
99
104
|
--button-default-color="rgb(var(--global-color-contrast-900))"
|
|
@@ -103,7 +108,8 @@ $:
|
|
|
103
108
|
on:click={hardNext}
|
|
104
109
|
icon="mdi-chevron-double-right"
|
|
105
110
|
--button-default-background-color="transparent"
|
|
106
|
-
--button-default-focus-background-color="
|
|
111
|
+
--button-default-focus-background-color="rgb(var(--global-color-primary-500), .3)"
|
|
112
|
+
--button-default-focus-color="rgb(var(--global-color-contrast-900))"
|
|
107
113
|
--button-default-hover-background-color="rgb(var(--global-color-primary-500))"
|
|
108
114
|
--button-default-box-shadow="none"
|
|
109
115
|
--button-default-color="rgb(var(--global-color-contrast-900))"
|
|
File without changes
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import "./Filters.css";
|
|
4
|
+
import "../../../css/main.css";
|
|
5
|
+
import Drawer from "../../simple/navigation/Drawer.svelte";
|
|
6
|
+
import Menu from "../../simple/common/Menu.svelte";
|
|
7
|
+
import MediaQuery from "../../simple/common/MediaQuery.svelte";
|
|
8
|
+
import Button from "../../simple/buttons/Button.svelte";
|
|
9
|
+
import Icon from "../../simple/media/Icon.svelte";
|
|
10
|
+
import { createEventDispatcher } from "svelte";
|
|
11
|
+
import SelectableVerticalList from "../../simple/lists/SelectableVerticalList.svelte";
|
|
12
|
+
export let addFilterLabel = "Add filter", filters = [];
|
|
13
|
+
let dispatch = createEventDispatcher();
|
|
14
|
+
let open = false, activator;
|
|
15
|
+
function handleAddFilterClick() {
|
|
16
|
+
dispatch("addFilterClick");
|
|
17
|
+
open = true;
|
|
18
|
+
}
|
|
19
|
+
$:
|
|
20
|
+
filterOptions = filters.map((f) => {
|
|
21
|
+
return {
|
|
22
|
+
title: f.label,
|
|
23
|
+
name: f.name
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
let selected;
|
|
27
|
+
let focused;
|
|
28
|
+
$:
|
|
29
|
+
if (!!selected)
|
|
30
|
+
selected = void 0;
|
|
31
|
+
$:
|
|
32
|
+
if (!!focused && !open)
|
|
33
|
+
focused = void 0;
|
|
34
|
+
function handleFilterSelection() {
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
class="add-filter-button"
|
|
41
|
+
bind:this={activator}
|
|
42
|
+
>
|
|
43
|
+
<Button
|
|
44
|
+
on:click={handleAddFilterClick}
|
|
45
|
+
>
|
|
46
|
+
<Icon name="mdi-plus"></Icon>
|
|
47
|
+
{addFilterLabel}
|
|
48
|
+
</Button>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<MediaQuery let:mAndDown>
|
|
52
|
+
{#if mAndDown}
|
|
53
|
+
<Drawer
|
|
54
|
+
bind:open={open}
|
|
55
|
+
position="bottom"
|
|
56
|
+
on:item-click
|
|
57
|
+
>
|
|
58
|
+
<SelectableVerticalList
|
|
59
|
+
bind:selected
|
|
60
|
+
bind:focused
|
|
61
|
+
bind:elements={filterOptions}
|
|
62
|
+
--selectable-vertical-list-default-width="100%"
|
|
63
|
+
--selectable-vertical-list-default-element-height="56px"
|
|
64
|
+
--selectable-vertical-list-default-title-font-size="null"
|
|
65
|
+
on:select={handleFilterSelection}
|
|
66
|
+
></SelectableVerticalList>
|
|
67
|
+
</Drawer>
|
|
68
|
+
{:else}
|
|
69
|
+
<Menu
|
|
70
|
+
bind:activator={activator}
|
|
71
|
+
bind:open={open}
|
|
72
|
+
closeOnClickOutside
|
|
73
|
+
_boxShadow="rgb(var(--global-color-grey-900), .5) 0px 2px 4px"
|
|
74
|
+
_height="fit-content"
|
|
75
|
+
_maxHeight="300px"
|
|
76
|
+
_minWidth="100px"
|
|
77
|
+
_borderRadius="5px"
|
|
78
|
+
anchor="bottom-center"
|
|
79
|
+
>
|
|
80
|
+
<SelectableVerticalList
|
|
81
|
+
bind:selected
|
|
82
|
+
bind:focused
|
|
83
|
+
bind:elements={filterOptions}
|
|
84
|
+
--selectable-vertical-list-default-width="100%"
|
|
85
|
+
--selectable-vertical-list-default-element-height="56px"
|
|
86
|
+
--selectable-vertical-list-default-title-font-size="null"
|
|
87
|
+
on:select={handleFilterSelection}
|
|
88
|
+
></SelectableVerticalList>
|
|
89
|
+
</Menu>
|
|
90
|
+
{/if}
|
|
91
|
+
</MediaQuery>
|
|
92
|
+
|
|
93
|
+
<style>
|
|
94
|
+
.add-filter-button {
|
|
95
|
+
width: fit-content;
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
3
|
+
import './Filters.css';
|
|
4
|
+
import '../../../css/main.css';
|
|
5
|
+
import type { Filter } from '../../../utils/filters/filters';
|
|
6
|
+
declare const __propDef: {
|
|
7
|
+
props: {
|
|
8
|
+
addFilterLabel?: string | undefined;
|
|
9
|
+
filters?: Filter[] | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
'item-click': CustomEvent<{
|
|
13
|
+
item: import("../../simple/navigation/Navigator.svelte").Item;
|
|
14
|
+
}>;
|
|
15
|
+
addFilterClick: CustomEvent<undefined>;
|
|
16
|
+
} & {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export type FiltersProps = typeof __propDef.props;
|
|
22
|
+
export type FiltersEvents = typeof __propDef.events;
|
|
23
|
+
export type FiltersSlots = typeof __propDef.slots;
|
|
24
|
+
export default class Filters extends SvelteComponentTyped<FiltersProps, FiltersEvents, FiltersSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--global-search-text-field-default-ring-color: rgb(var(--global-color-contrast-
|
|
3
|
-
--global-search-text-field-default-hover-ring-color: rgb(var(--global-color-contrast-300));
|
|
4
|
-
--global-search-text-field-default-color: rgb(var(--global-color-contrast-600));
|
|
2
|
+
--global-search-text-field-default-ring-color: rgb(var(--global-color-contrast-200), .5);
|
|
3
|
+
--global-search-text-field-default-hover-ring-color: rgb(var(--global-color-contrast-300));
|
|
4
|
+
--global-search-text-field-default-color: rgb(var(--global-color-contrast-600));
|
|
5
5
|
--global-search-text-field-default-width: 100%;
|
|
6
6
|
--global-search-text-field-default-max-width: 28rem;
|
|
7
7
|
--global-search-text-field-default-height: 2rem;
|
|
@@ -168,7 +168,7 @@ async function search() {
|
|
|
168
168
|
--global-search-text-field-padding,
|
|
169
169
|
var(--global-search-text-field-default-padding)
|
|
170
170
|
);
|
|
171
|
-
border: 0 solid
|
|
171
|
+
border: 0 solid white;
|
|
172
172
|
cursor: pointer;
|
|
173
173
|
transition-property: box-shadow;
|
|
174
174
|
transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1);
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
--stable-divided-side-bar-layout-default-content-padding: 1rem 2rem 1rem 2rem;
|
|
3
3
|
--stable-divided-side-bar-layout-default-side-bar-width: 18rem;
|
|
4
4
|
--stable-divided-side-bar-layout-default-side-bar-border-color:
|
|
5
|
-
rgb(var(--global-color-grey-500));
|
|
5
|
+
rgb(var(--global-color-grey-500), .3);
|
|
6
6
|
--stable-divided-side-bar-layout-default-side-bar-padding: 1rem 1.5rem 2rem 1.5rem;
|
|
7
7
|
--stable-divided-side-bar-layout-default-header-menu-height: 3.5rem;
|
|
8
8
|
--stable-divided-side-bar-layout-default-header-menu-border-color:
|
|
9
|
-
rgb(var(--global-color-grey-500));
|
|
9
|
+
rgb(var(--global-color-grey-500), .3);
|
|
10
10
|
--stable-divided-side-bar-layout-default-header-menu-padding: 0rem 2rem 0rem 2rem;
|
|
11
11
|
--stable-divided-side-bar-layout-default-inner-header-menu-background-color:
|
|
12
12
|
rgb(var(--global-color-background-100), .5);
|