@likable-hair/svelte 4.0.40 → 4.0.42
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/common/MenuOrDrawer.svelte +19 -17
- package/dist/components/composed/common/MenuOrDrawer.svelte.d.ts +3 -16
- package/dist/components/composed/common/MenuOrDrawerOptions.svelte +21 -13
- package/dist/components/composed/common/QuickActions.svelte +9 -5
- package/dist/components/composed/forms/AsyncAutocomplete.svelte.d.ts +1 -1
- package/dist/components/composed/list/DynamicTable.svelte +357 -330
- package/dist/components/composed/list/DynamicTable.svelte.d.ts +9 -0
- package/dist/components/composed/list/PaginatedTable.svelte +5 -1
- package/dist/components/composed/list/PaginatedTable.svelte.d.ts +2 -0
- package/dist/components/composed/progress/HorizontalStackedProgress.css +4 -0
- package/dist/components/composed/progress/HorizontalStackedProgress.svelte +18 -6
- package/dist/components/composed/progress/HorizontalStackedProgress.svelte.d.ts +1 -0
- package/dist/components/composed/search/DynamicFilters.svelte +2 -3
- package/dist/components/composed/search/FilterEditor.svelte +4 -0
- package/dist/components/composed/search/Filters.svelte +3 -1
- package/dist/components/simple/common/Menu.svelte +119 -0
- package/dist/components/simple/common/Menu.svelte.d.ts +1 -1
- package/dist/components/simple/common/VerticalDraggableList.svelte +1 -1
- package/dist/components/simple/common/VerticalDraggableList.svelte.d.ts +37 -20
- package/dist/components/simple/forms/Autocomplete.svelte +12 -7
- package/dist/components/simple/forms/Autocomplete.svelte.d.ts +2 -2
- package/dist/components/simple/forms/Checkbox.svelte +2 -1
- package/dist/components/simple/forms/Checkbox.svelte.d.ts +2 -1
- package/dist/components/simple/notifiers/AlertBanner.css +1 -0
- package/dist/components/simple/notifiers/AlertBanner.svelte +7 -7
- package/package.json +1 -1
- package/dist/components/composed/common/MenuOrDrawerOptions.svelte.d.ts +0 -26
|
@@ -50,6 +50,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
50
50
|
} | undefined;
|
|
51
51
|
info?: string;
|
|
52
52
|
maxWidth?: string;
|
|
53
|
+
icon?: string;
|
|
53
54
|
})[] | undefined;
|
|
54
55
|
headersToShowInTable?: (import("../../simple/lists/SimpleTable.svelte").Header<unknown> & {
|
|
55
56
|
cellEditorInfo?: {
|
|
@@ -83,6 +84,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
83
84
|
} | undefined;
|
|
84
85
|
info?: string;
|
|
85
86
|
maxWidth?: string;
|
|
87
|
+
icon?: string;
|
|
86
88
|
})[] | undefined;
|
|
87
89
|
subHeaders?: (import("../../simple/lists/SimpleTable.svelte").Header<unknown> & {
|
|
88
90
|
cellEditorInfo?: {
|
|
@@ -116,6 +118,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
116
118
|
} | undefined;
|
|
117
119
|
info?: string;
|
|
118
120
|
maxWidth?: string;
|
|
121
|
+
icon?: string;
|
|
119
122
|
})[] | undefined;
|
|
120
123
|
customizeHeaders?: boolean;
|
|
121
124
|
rows?: {
|
|
@@ -297,6 +300,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
297
300
|
} | undefined;
|
|
298
301
|
info?: string;
|
|
299
302
|
maxWidth?: string;
|
|
303
|
+
icon?: string;
|
|
300
304
|
};
|
|
301
305
|
}]> | undefined;
|
|
302
306
|
headerLabelSnippet?: Snippet<[{
|
|
@@ -332,6 +336,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
332
336
|
} | undefined;
|
|
333
337
|
info?: string;
|
|
334
338
|
maxWidth?: string;
|
|
339
|
+
icon?: string;
|
|
335
340
|
};
|
|
336
341
|
}]> | undefined;
|
|
337
342
|
rowAppendSnippet?: Snippet<[{
|
|
@@ -382,6 +387,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
382
387
|
} | undefined;
|
|
383
388
|
info?: string;
|
|
384
389
|
maxWidth?: string;
|
|
390
|
+
icon?: string;
|
|
385
391
|
};
|
|
386
392
|
row: {
|
|
387
393
|
item: Item & {
|
|
@@ -427,6 +433,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
427
433
|
} | undefined;
|
|
428
434
|
info?: string;
|
|
429
435
|
maxWidth?: string;
|
|
436
|
+
icon?: string;
|
|
430
437
|
};
|
|
431
438
|
}]> | undefined;
|
|
432
439
|
subHeaderLabelSnippet?: Snippet<[{
|
|
@@ -462,6 +469,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
462
469
|
} | undefined;
|
|
463
470
|
info?: string;
|
|
464
471
|
maxWidth?: string;
|
|
472
|
+
icon?: string;
|
|
465
473
|
};
|
|
466
474
|
}]> | undefined;
|
|
467
475
|
subRowAppendSnippet?: Snippet<[{
|
|
@@ -513,6 +521,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
513
521
|
} | undefined;
|
|
514
522
|
info?: string;
|
|
515
523
|
maxWidth?: string;
|
|
524
|
+
icon?: string;
|
|
516
525
|
};
|
|
517
526
|
row: SubItem & {
|
|
518
527
|
disableEdit?: boolean;
|
|
@@ -11,7 +11,7 @@ let { headers = [], items = [], sortedBy = $bindable(undefined), sortDirection =
|
|
|
11
11
|
{ label: "20", value: 20 },
|
|
12
12
|
{ label: "50", value: 50 },
|
|
13
13
|
{ label: "100", value: 100 },
|
|
14
|
-
], hideRowsPerPage = false, totalElements = undefined, rowsPerPage = $bindable(20), filters = $bindable([]), quickFilters = $bindable(), searchBarColumns = undefined, searchBarVisible = true, quickFiltersVisible = false, lang = "en", searchBarPlaceholder = lang == 'en' ? "Type to search..." : "Scrivi per cercare...", editFilterMode = "one-edit", showActiveFilters = true, resizableColumns = false, resizedColumnSizeWithPadding = {}, pointerOnRowHover = undefined, doubleClickActive = false, doubleClickDelay = 250, calculateRowStyles = undefined, calculateRowClasses = undefined, class: clazz = {}, onfiltersChange, onpaginationChange, onremoveFilter, onremoveAllFilters, customFilterChipSnippet, customFilterSnippet, filterAppendSnippet, onrowClick, onrowDoubleClick, appendSnippet, customSnippet, headerLabelSnippet, headerSnippet, rowActionsSnippet, onsort, footerSnippet, rangeDescriptorSnippet, searchBarSnippet, noDataSnippet, oncolumnResize, } = $props();
|
|
14
|
+
], hideRowsPerPage = false, totalElements = undefined, rowsPerPage = $bindable(20), filters = $bindable([]), quickFilters = $bindable(), searchBarColumns = undefined, searchBarVisible = true, quickFiltersVisible = false, lang = "en", dateLocale, searchBarPlaceholder = lang == 'en' ? "Type to search..." : "Scrivi per cercare...", editFilterMode = "one-edit", showActiveFilters = true, resizableColumns = false, resizedColumnSizeWithPadding = {}, pointerOnRowHover = undefined, doubleClickActive = false, doubleClickDelay = 250, calculateRowStyles = undefined, calculateRowClasses = undefined, class: clazz = {}, onfiltersChange, onpaginationChange, onremoveFilter, onremoveAllFilters, customFilterChipSnippet, customFilterSnippet, filterAppendSnippet, onrowClick, onrowDoubleClick, appendSnippet, customSnippet, headerLabelSnippet, headerSnippet, rowActionsSnippet, onsort, footerSnippet, rangeDescriptorSnippet, searchBarSnippet, noDataSnippet, totalsSnippet, oncolumnResize, } = $props();
|
|
15
15
|
let searchBarInput = $state(), searchText = $state(), sortModify;
|
|
16
16
|
let rowsPerPageSelection = $state([]);
|
|
17
17
|
$effect(() => {
|
|
@@ -143,6 +143,7 @@ function buildFilters(params) {
|
|
|
143
143
|
onremoveAllFilters={handleRemoveAllFilters}
|
|
144
144
|
--filters-default-wrapper-width={!!searchBarVisible ? undefined : "100%"}
|
|
145
145
|
{lang}
|
|
146
|
+
{dateLocale}
|
|
146
147
|
{editFilterMode}
|
|
147
148
|
{showActiveFilters}
|
|
148
149
|
appendSnippet={filterAppendSnippet}
|
|
@@ -162,6 +163,9 @@ function buildFilters(params) {
|
|
|
162
163
|
</div>
|
|
163
164
|
{/snippet}
|
|
164
165
|
</MediaQuery>
|
|
166
|
+
|
|
167
|
+
{@render totalsSnippet?.()}
|
|
168
|
+
|
|
165
169
|
<SimpleTable
|
|
166
170
|
{headers}
|
|
167
171
|
class={clazz.simpleTable}
|
|
@@ -88,6 +88,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
88
88
|
quickFilters?: ComponentProps<typeof QuickFilters>["filters"];
|
|
89
89
|
editFilterMode?: "one-edit" | "multi-edit";
|
|
90
90
|
showActiveFilters?: boolean;
|
|
91
|
+
dateLocale?: "it" | "en";
|
|
91
92
|
class?: {
|
|
92
93
|
simpleTable?: {
|
|
93
94
|
container?: string;
|
|
@@ -132,6 +133,7 @@ declare class __sveltets_Render<Item extends {
|
|
|
132
133
|
maxPage: number | undefined;
|
|
133
134
|
rowsPerPage: number;
|
|
134
135
|
}]> | undefined;
|
|
136
|
+
totalsSnippet?: Snippet<[]>;
|
|
135
137
|
};
|
|
136
138
|
events(): {};
|
|
137
139
|
slots(): {};
|
|
@@ -6,4 +6,8 @@
|
|
|
6
6
|
--horizontal-stacked-progress-label-gap: 12px;
|
|
7
7
|
--horizontal-stacked-progress-legend-margin-top: 8px;
|
|
8
8
|
--progress-bar-default-tooltip-padding: 8px;
|
|
9
|
+
--horizontal-stacked-progress-default-label-font-size: .8rem;
|
|
10
|
+
--horizontal-stacked-progress-default-label-font-weight: 300;
|
|
11
|
+
--horizontal-stacked-progress-default-value-font-size: 1.1rem;
|
|
12
|
+
--horizontal-stacked-progress-default-value-font-weight: 700;
|
|
9
13
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<script lang="ts">import './HorizontalStackedProgress.css';
|
|
9
9
|
import ProgressBar from "../../simple/progress/ProgressBar.svelte";
|
|
10
|
-
let { progresses = [], labelVisible = true, labelValueVisible = true, labelTextVisible = true, legendVisible = false, legendValueVisible = true, legendTextVisible = true, hideLabelUnderPercentage } = $props();
|
|
10
|
+
let { progresses = [], labelVisible = true, labelValueVisible = true, labelTextVisible = true, legendVisible = false, legendValueVisible = true, legendTextVisible = true, hideLabelUnderPercentage, tooltipVisible = true, } = $props();
|
|
11
11
|
let colors = [
|
|
12
12
|
'rgb(var(--global-color-primary-500))',
|
|
13
13
|
'rgb(var(--global-color-primary-300))',
|
|
@@ -53,7 +53,7 @@ let progressesItems = $derived(progresses.map((p, i) => {
|
|
|
53
53
|
total={progress.value}
|
|
54
54
|
value={progress.value}
|
|
55
55
|
--progress-bar-highlight-color={progress.color}
|
|
56
|
-
valueTooltip
|
|
56
|
+
valueTooltip={tooltipVisible}
|
|
57
57
|
valueTooltipLabel={progress.valueLabel || progress.value}
|
|
58
58
|
></ProgressBar>
|
|
59
59
|
{#if progress.label && labelVisible && (hideLabelUnderPercentage === undefined || progress.percentage > hideLabelUnderPercentage)}
|
|
@@ -128,8 +128,14 @@ let progressesItems = $derived(progresses.map((p, i) => {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
.label-text {
|
|
131
|
-
font-size:
|
|
132
|
-
|
|
131
|
+
font-size: var(
|
|
132
|
+
--horizontal-stacked-progress-label-font-size,
|
|
133
|
+
var(--horizontal-stacked-progress-default-label-font-size)
|
|
134
|
+
);
|
|
135
|
+
font-weight: var(
|
|
136
|
+
--horizontal-stacked-progress-label-font-weight,
|
|
137
|
+
var(--horizontal-stacked-progress-default-label-font-weight)
|
|
138
|
+
);
|
|
133
139
|
}
|
|
134
140
|
|
|
135
141
|
.label {
|
|
@@ -146,8 +152,14 @@ let progressesItems = $derived(progresses.map((p, i) => {
|
|
|
146
152
|
}
|
|
147
153
|
|
|
148
154
|
.value-text {
|
|
149
|
-
font-size:
|
|
150
|
-
|
|
155
|
+
font-size: var(
|
|
156
|
+
--horizontal-stacked-progress-value-font-size,
|
|
157
|
+
var(--horizontal-stacked-progress-default-value-font-size)
|
|
158
|
+
);
|
|
159
|
+
font-weight: var(
|
|
160
|
+
--horizontal-stacked-progress-value-font-weight,
|
|
161
|
+
var(--horizontal-stacked-progress-default-value-font-weight)
|
|
162
|
+
);
|
|
151
163
|
}
|
|
152
164
|
|
|
153
165
|
.dot {
|
|
@@ -15,6 +15,7 @@ interface Props {
|
|
|
15
15
|
legendValueVisible?: boolean;
|
|
16
16
|
legendTextVisible?: boolean;
|
|
17
17
|
hideLabelUnderPercentage?: number;
|
|
18
|
+
tooltipVisible?: boolean;
|
|
18
19
|
}
|
|
19
20
|
declare const HorizontalStackedProgress: import("svelte").Component<Props, {}, "">;
|
|
20
21
|
type HorizontalStackedProgress = ReturnType<typeof HorizontalStackedProgress>;
|
|
@@ -134,7 +134,6 @@ function updateCustomFilterValues(filterName, newValue, newValid, mode) {
|
|
|
134
134
|
--simple-textfield-background-color= transparent
|
|
135
135
|
--simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
|
|
136
136
|
--simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
|
|
137
|
-
--chip-default-color="rgb(var(--global-color-primary-foreground))"
|
|
138
137
|
--autocomplete-border-radius= 0.5rem
|
|
139
138
|
--autocomplete-border="1px solid rgb(var(--global-color-background-500))"
|
|
140
139
|
--autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
|
|
@@ -159,11 +158,11 @@ function updateCustomFilterValues(filterName, newValue, newValid, mode) {
|
|
|
159
158
|
<style>
|
|
160
159
|
.custom-filters-container {
|
|
161
160
|
display: flex;
|
|
162
|
-
height:
|
|
161
|
+
height: 68vh;
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
.custom-filters-container.mobile {
|
|
166
|
-
max-height:
|
|
165
|
+
max-height: 27rem;
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
.yscroll {
|
|
@@ -194,6 +194,9 @@ function onclick(event) {
|
|
|
194
194
|
maxVisibleChips={2}
|
|
195
195
|
--simple-textfield-width="0px"
|
|
196
196
|
--simple-text-field-margin-left="0px"
|
|
197
|
+
--autocomplete-default-border-radius='4px'
|
|
198
|
+
--autocomplete-min-height="0px"
|
|
199
|
+
--chip-min-height="12px"
|
|
197
200
|
mobileDrawer={mobile}
|
|
198
201
|
onchange={handleChangeValue}
|
|
199
202
|
placeholder={editFilterMode == 'one-edit' ? tmpFilter?.label : undefined}
|
|
@@ -208,6 +211,7 @@ function onclick(event) {
|
|
|
208
211
|
bind:values={tmpFilter.values}
|
|
209
212
|
items={tmpFilter.items}
|
|
210
213
|
multiple
|
|
214
|
+
onchange={handleChangeValue}
|
|
211
215
|
></ToggleList>
|
|
212
216
|
</div>
|
|
213
217
|
{:else if tmpFilter.type === "date" && tmpFilter.mode === 'between'}
|
|
@@ -101,7 +101,9 @@ function handleRemoveFilter(filter) {
|
|
|
101
101
|
let filterIndex = filters.findIndex((f) => f.name === filter.name);
|
|
102
102
|
let filterName = filter.name;
|
|
103
103
|
filters[filterIndex].active = false;
|
|
104
|
-
tmpFilters[filterName]
|
|
104
|
+
if (tmpFilters[filterName]) {
|
|
105
|
+
tmpFilters[filterName].active = false;
|
|
106
|
+
}
|
|
105
107
|
if (Object.keys(filters[filterIndex]).includes('value')) {
|
|
106
108
|
//@ts-ignore
|
|
107
109
|
filters[filterIndex].value = undefined;
|
|
@@ -59,6 +59,91 @@ function calculateMenuPosition(params) {
|
|
|
59
59
|
_top = activatorTop + window.scrollY + (activatorHeight / 2) - (menuHeight / 2) - fixedParentTop;
|
|
60
60
|
_left = activatorLeft + window.scrollX + activatorWidth + _activatorGap - fixedParentLeft;
|
|
61
61
|
}
|
|
62
|
+
else if (anchor == 'left-center') {
|
|
63
|
+
let { left: activatorLeft, top: activatorTop } = params.activator.getBoundingClientRect();
|
|
64
|
+
let activatorHeight = params.activator.offsetHeight;
|
|
65
|
+
let menuHeight = params.menuElement.offsetHeight;
|
|
66
|
+
let menuWidth = params.menuElement.offsetWidth;
|
|
67
|
+
let { top: fixedParentTop, left: fixedParentLeft, fixedParent, validStickyParent } = getParentInstanceFromViewport(activator?.parentElement);
|
|
68
|
+
_top = activatorTop + (activatorHeight / 2) - (menuHeight / 2);
|
|
69
|
+
_left = activatorLeft - menuWidth - _activatorGap;
|
|
70
|
+
if (!!fixedParent) {
|
|
71
|
+
_top = _top - fixedParentTop;
|
|
72
|
+
_left = _left - fixedParentLeft;
|
|
73
|
+
}
|
|
74
|
+
else if (!validStickyParent && !fixedParent) {
|
|
75
|
+
_top = _top + window.scrollY;
|
|
76
|
+
_left = _left + window.scrollX;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else if (anchor == 'up') {
|
|
80
|
+
let { left: activatorLeft, top: activatorTop } = params.activator.getBoundingClientRect();
|
|
81
|
+
let menuHeight = params.menuElement.offsetHeight;
|
|
82
|
+
_top = activatorTop - menuHeight - _activatorGap;
|
|
83
|
+
_left = activatorLeft;
|
|
84
|
+
let { top: fixedParentTop, left: fixedParentLeft, fixedParent, validStickyParent } = getParentInstanceFromViewport(activator?.parentElement);
|
|
85
|
+
if (!!fixedParent) {
|
|
86
|
+
_top = _top - fixedParentTop;
|
|
87
|
+
_left = _left - fixedParentLeft;
|
|
88
|
+
}
|
|
89
|
+
else if (!validStickyParent && !fixedParent) {
|
|
90
|
+
_top = _top + window.scrollY;
|
|
91
|
+
_left = _left + window.scrollX;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (anchor == 'left') {
|
|
95
|
+
let { left: activatorLeft, top: activatorTop } = params.activator.getBoundingClientRect();
|
|
96
|
+
let menuWidth = params.menuElement.offsetWidth;
|
|
97
|
+
_top = activatorTop;
|
|
98
|
+
_left = activatorLeft - menuWidth - _activatorGap;
|
|
99
|
+
let { top: fixedParentTop, left: fixedParentLeft, fixedParent, validStickyParent } = getParentInstanceFromViewport(activator?.parentElement);
|
|
100
|
+
if (!!fixedParent) {
|
|
101
|
+
_top = _top - fixedParentTop;
|
|
102
|
+
_left = _left - fixedParentLeft;
|
|
103
|
+
}
|
|
104
|
+
else if (!validStickyParent && !fixedParent) {
|
|
105
|
+
_top = _top + window.scrollY;
|
|
106
|
+
_left = _left + window.scrollX;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else if (anchor == 'right') {
|
|
110
|
+
let { left: activatorLeft, top: activatorTop } = params.activator.getBoundingClientRect();
|
|
111
|
+
let activatorWidth = params.activator.offsetWidth;
|
|
112
|
+
_top = activatorTop;
|
|
113
|
+
_left = activatorLeft + activatorWidth + _activatorGap;
|
|
114
|
+
let { top: fixedParentTop, left: fixedParentLeft, fixedParent, validStickyParent } = getParentInstanceFromViewport(activator?.parentElement);
|
|
115
|
+
if (!!fixedParent) {
|
|
116
|
+
_top = _top - fixedParentTop;
|
|
117
|
+
_left = _left - fixedParentLeft;
|
|
118
|
+
}
|
|
119
|
+
else if (!validStickyParent && !fixedParent) {
|
|
120
|
+
_top = _top + window.scrollY;
|
|
121
|
+
_left = _left + window.scrollX;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else if (anchor == 'up-center') {
|
|
125
|
+
let { left: activatorLeft, top: activatorTop } = params.activator.getBoundingClientRect();
|
|
126
|
+
let activatorWidth = params.activator.offsetWidth;
|
|
127
|
+
let menuHeight = params.menuElement.offsetHeight;
|
|
128
|
+
let menuWidth = params.menuElement.offsetWidth;
|
|
129
|
+
_top = activatorTop - menuHeight - _activatorGap;
|
|
130
|
+
_left = activatorLeft;
|
|
131
|
+
let { top: fixedParentTop, left: fixedParentLeft, fixedParent, validStickyParent } = getParentInstanceFromViewport(activator?.parentElement);
|
|
132
|
+
if (!!fixedParent) {
|
|
133
|
+
_top = _top - fixedParentTop;
|
|
134
|
+
_left = _left - fixedParentLeft;
|
|
135
|
+
}
|
|
136
|
+
else if (!validStickyParent && !fixedParent) {
|
|
137
|
+
_top = _top + window.scrollY;
|
|
138
|
+
_left = _left + window.scrollX;
|
|
139
|
+
}
|
|
140
|
+
if (menuWidth > activatorWidth) {
|
|
141
|
+
_left = _left - (menuWidth - activatorWidth) / 2;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
_left = _left + (activatorWidth - menuWidth) / 2;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
62
147
|
}
|
|
63
148
|
if (flipOnOverflow && !!params.activator) {
|
|
64
149
|
let { top: activatorTopDistance } = params.activator.getBoundingClientRect();
|
|
@@ -71,12 +156,46 @@ function calculateMenuPosition(params) {
|
|
|
71
156
|
let { left: activatorLeft } = params.activator.getBoundingClientRect();
|
|
72
157
|
_left = activatorLeft + window.scrollX - _activatorGap - (menuElement?.offsetWidth || 0);
|
|
73
158
|
}
|
|
159
|
+
if (anchor == 'left-center' &&
|
|
160
|
+
(_left || 0) < 0) {
|
|
161
|
+
let { left: activatorLeft } = params.activator.getBoundingClientRect();
|
|
162
|
+
let activatorWidth = params.activator.offsetWidth;
|
|
163
|
+
_left = activatorLeft + window.scrollX + activatorWidth + _activatorGap;
|
|
164
|
+
}
|
|
165
|
+
if (anchor == 'left' &&
|
|
166
|
+
(_left || 0) < 0) {
|
|
167
|
+
let { left: activatorLeft } = params.activator.getBoundingClientRect();
|
|
168
|
+
let activatorWidth = params.activator.offsetWidth;
|
|
169
|
+
_left = activatorLeft + window.scrollX + activatorWidth + _activatorGap;
|
|
170
|
+
}
|
|
171
|
+
if (anchor == 'right' &&
|
|
172
|
+
window.innerWidth + window.scrollX <
|
|
173
|
+
(_left || 0) + (menuElement?.offsetWidth || 0)) {
|
|
174
|
+
let { left: activatorLeft } = params.activator.getBoundingClientRect();
|
|
175
|
+
let menuWidth = params.menuElement.offsetWidth;
|
|
176
|
+
_left = activatorLeft + window.scrollX - menuWidth - _activatorGap;
|
|
177
|
+
}
|
|
178
|
+
if (anchor == 'up' &&
|
|
179
|
+
(_top || 0) < window.scrollY) {
|
|
180
|
+
let { top: activatorTop } = params.activator.getBoundingClientRect();
|
|
181
|
+
let activatorHeight = params.activator.offsetHeight;
|
|
182
|
+
_top = activatorTop + window.scrollY + activatorHeight + _activatorGap;
|
|
183
|
+
}
|
|
184
|
+
if (anchor == 'up-center' &&
|
|
185
|
+
(_top || 0) < window.scrollY) {
|
|
186
|
+
let { top: activatorTop } = params.activator.getBoundingClientRect();
|
|
187
|
+
let activatorHeight = params.activator.offsetHeight;
|
|
188
|
+
_top = activatorTop + window.scrollY + activatorHeight + _activatorGap;
|
|
189
|
+
}
|
|
74
190
|
}
|
|
75
191
|
if (stayInViewport) {
|
|
76
192
|
if (window.innerWidth + window.scrollX <
|
|
77
193
|
(_left || 0) + (menuElement?.offsetWidth || 0)) {
|
|
78
194
|
_left = Math.max(window.innerWidth + window.scrollX - (menuElement?.offsetWidth || 0), 0);
|
|
79
195
|
}
|
|
196
|
+
if ((_left || 0) < window.scrollX) {
|
|
197
|
+
_left = window.scrollX;
|
|
198
|
+
}
|
|
80
199
|
}
|
|
81
200
|
if (!!positionedAncestor) {
|
|
82
201
|
let { left: positionedAncestorLeft, top: positionedAncestorTop } = positionedAncestor.getBoundingClientRect();
|
|
@@ -14,7 +14,7 @@ interface Props {
|
|
|
14
14
|
open?: boolean;
|
|
15
15
|
refreshPosition?: boolean;
|
|
16
16
|
activator?: HTMLElement;
|
|
17
|
-
anchor?: "bottom" | "bottom-center" | "right-center";
|
|
17
|
+
anchor?: "bottom" | "bottom-center" | "right-center" | "left-center" | "up" | "left" | "right" | "up-center";
|
|
18
18
|
closeOnClickOutside?: boolean;
|
|
19
19
|
inAnimation?: (node: Element, params?: SlideParams | FlyParams | FadeParams) => TransitionConfig;
|
|
20
20
|
inAnimationConfig?: SlideParams | FlyParams | FadeParams;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts">import '../../../css/main.css';
|
|
1
|
+
<script lang="ts" generics="Item extends { id: string, name: string }">import '../../../css/main.css';
|
|
2
2
|
import './VerticalDraggableList.css';
|
|
3
3
|
import { flip } from "svelte/animate";
|
|
4
4
|
import { dndzone } from "svelte-dnd-action";
|
|
@@ -1,26 +1,43 @@
|
|
|
1
1
|
import '../../../css/main.css';
|
|
2
2
|
import './VerticalDraggableList.css';
|
|
3
3
|
import { type Snippet } from "svelte";
|
|
4
|
-
declare
|
|
5
|
-
|
|
4
|
+
declare class __sveltets_Render<Item extends {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}> {
|
|
8
|
+
props(): {
|
|
9
|
+
items?: Item[] | undefined;
|
|
10
|
+
class?: string;
|
|
11
|
+
itemSnippet?: Snippet<[{
|
|
12
|
+
item: Item;
|
|
13
|
+
}]> | undefined;
|
|
14
|
+
onchangeOrder?: ((event: {
|
|
15
|
+
detail: {
|
|
16
|
+
items: Item[];
|
|
17
|
+
};
|
|
18
|
+
}) => void) | undefined;
|
|
19
|
+
};
|
|
20
|
+
events(): {};
|
|
21
|
+
slots(): {};
|
|
22
|
+
bindings(): "";
|
|
23
|
+
exports(): {};
|
|
24
|
+
}
|
|
25
|
+
interface $$IsomorphicComponent {
|
|
26
|
+
new <Item extends {
|
|
6
27
|
id: string;
|
|
7
28
|
name: string;
|
|
8
|
-
}[]
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
}) => void;
|
|
24
|
-
}, {}, "">;
|
|
25
|
-
type VerticalDraggableList = ReturnType<typeof VerticalDraggableList>;
|
|
29
|
+
}>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Item>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Item>['props']>, ReturnType<__sveltets_Render<Item>['events']>, ReturnType<__sveltets_Render<Item>['slots']>> & {
|
|
30
|
+
$$bindings?: ReturnType<__sveltets_Render<Item>['bindings']>;
|
|
31
|
+
} & ReturnType<__sveltets_Render<Item>['exports']>;
|
|
32
|
+
<Item extends {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {}): ReturnType<__sveltets_Render<Item>['exports']>;
|
|
36
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
37
|
+
}
|
|
38
|
+
declare const VerticalDraggableList: $$IsomorphicComponent;
|
|
39
|
+
type VerticalDraggableList<Item extends {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
}> = InstanceType<typeof VerticalDraggableList<Item>>;
|
|
26
43
|
export default VerticalDraggableList;
|
|
@@ -197,6 +197,7 @@ import Menu from "../common/Menu.svelte";
|
|
|
197
197
|
import {} from "svelte";
|
|
198
198
|
import SimpleTextField from "./SimpleTextField.svelte";
|
|
199
199
|
import MenuOrDrawer from "../../composed/common/MenuOrDrawer.svelte";
|
|
200
|
+
import Drawer from "../navigation/Drawer.svelte";
|
|
200
201
|
</script>
|
|
201
202
|
|
|
202
203
|
<svelte:window />
|
|
@@ -335,14 +336,18 @@ import MenuOrDrawer from "../../composed/common/MenuOrDrawer.svelte";
|
|
|
335
336
|
</Menu>
|
|
336
337
|
{:else}
|
|
337
338
|
<MenuOrDrawer
|
|
338
|
-
{
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
339
|
+
menuProps={{
|
|
340
|
+
activator,
|
|
341
|
+
_width: localMenuWidth || "",
|
|
342
|
+
_height: menuHeight,
|
|
343
|
+
_maxHeight: "300px",
|
|
344
|
+
_boxShadow: menuBoxShadow,
|
|
345
|
+
_borderRadius: menuBorderRadius,
|
|
346
|
+
}}
|
|
347
|
+
drawerProps={{
|
|
348
|
+
onclose
|
|
349
|
+
}}
|
|
344
350
|
bind:open={menuOpened}
|
|
345
|
-
{onclose}
|
|
346
351
|
>
|
|
347
352
|
<ul
|
|
348
353
|
class={clazz.menu || ""}
|
|
@@ -8,7 +8,7 @@ import "./Autocomplete.css";
|
|
|
8
8
|
import Menu from "../common/Menu.svelte";
|
|
9
9
|
import { type ComponentProps, type Snippet } from "svelte";
|
|
10
10
|
import SimpleTextField from "./SimpleTextField.svelte";
|
|
11
|
-
import
|
|
11
|
+
import Drawer from "../navigation/Drawer.svelte";
|
|
12
12
|
declare class __sveltets_Render<Data> {
|
|
13
13
|
props(): {
|
|
14
14
|
values?: Item<Data>[] | undefined;
|
|
@@ -83,7 +83,7 @@ declare class __sveltets_Render<Data> {
|
|
|
83
83
|
onfocus?: (() => void) | undefined;
|
|
84
84
|
onblur?: (() => void) | undefined;
|
|
85
85
|
onkeydown?: ((e: KeyboardEvent) => void) | undefined;
|
|
86
|
-
onclose?: ComponentProps<typeof
|
|
86
|
+
onclose?: ComponentProps<typeof Drawer>["onclose"];
|
|
87
87
|
};
|
|
88
88
|
events(): {};
|
|
89
89
|
slots(): {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import './Checkbox.css';
|
|
2
2
|
import '../../../css/main.css';
|
|
3
3
|
import { onMount } from 'svelte';
|
|
4
|
-
let { value = $bindable(), id = undefined, disabled = false, onchange, } = $props();
|
|
4
|
+
let { value = $bindable(), id = undefined, disabled = false, onchange, ...rest } = $props();
|
|
5
5
|
onMount(() => {
|
|
6
6
|
window.addEventListener('keydown', handleKeyDown);
|
|
7
7
|
window.addEventListener('keyup', handleKeyUp);
|
|
@@ -39,6 +39,7 @@ function handleChange(e) {
|
|
|
39
39
|
bind:checked={value}
|
|
40
40
|
onchange={handleChange}
|
|
41
41
|
{disabled}
|
|
42
|
+
{...rest}
|
|
42
43
|
/>
|
|
43
44
|
|
|
44
45
|
<style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './Checkbox.css';
|
|
2
2
|
import '../../../css/main.css';
|
|
3
|
-
|
|
3
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
4
|
+
interface Props extends Omit<HTMLInputAttributes, 'onchange' | 'disabled' | 'id' | 'type' | 'checked'> {
|
|
4
5
|
value?: boolean;
|
|
5
6
|
id?: string;
|
|
6
7
|
disabled?: boolean;
|
|
@@ -21,10 +21,10 @@ function onkeypress(e) {
|
|
|
21
21
|
class="border-colored {clazz.border || ''}"
|
|
22
22
|
></div>
|
|
23
23
|
<div class="body {clazz.body || ''}">
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
{#if !!contentSnippet}
|
|
25
|
+
{@render contentSnippet({ title, description })}
|
|
26
|
+
{:else}
|
|
27
|
+
<div class="content">
|
|
28
28
|
{#if !!title}
|
|
29
29
|
{#if !!titleSnippet}
|
|
30
30
|
{@render titleSnippet({ title })}
|
|
@@ -39,8 +39,8 @@ function onkeypress(e) {
|
|
|
39
39
|
<div class="description">{description}</div>
|
|
40
40
|
{/if}
|
|
41
41
|
{/if}
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
</div>
|
|
43
|
+
{/if}
|
|
44
44
|
{#if !!appendSnippet}
|
|
45
45
|
<div class="append">
|
|
46
46
|
{@render appendSnippet({ disabled })}
|
|
@@ -52,7 +52,7 @@ function onkeypress(e) {
|
|
|
52
52
|
<style>
|
|
53
53
|
.alert-banner-container {
|
|
54
54
|
position: relative;
|
|
55
|
-
box-shadow:
|
|
55
|
+
box-shadow: var(--alert-banner-box-shadow, var(--alert-banner-default-box-shadow))!important;
|
|
56
56
|
border-radius: var(--alert-banner-border-radius, var(--alert-banner-default-border-radius));
|
|
57
57
|
cursor: var(--alert-banner-cursor, var(--alert-banner-default-cursor));
|
|
58
58
|
width: var(--alert-banner-width, var(--alert-banner-default-width));
|
package/package.json
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
2
|
-
import '../../../css/main.css';
|
|
3
|
-
import type { ComponentProps } from 'svelte';
|
|
4
|
-
import MenuOrDrawer from "./MenuOrDrawer.svelte";
|
|
5
|
-
import type Drawer from '../../simple/navigation/Drawer.svelte';
|
|
6
|
-
import type Menu from '../../simple/common/Menu.svelte';
|
|
7
|
-
import SelectableVerticalList from '../../simple/lists/SelectableVerticalList.svelte';
|
|
8
|
-
interface Props {
|
|
9
|
-
open?: boolean;
|
|
10
|
-
activator: HTMLElement;
|
|
11
|
-
drawerPosition?: ComponentProps<typeof Drawer>['position'];
|
|
12
|
-
menuAnchor?: ComponentProps<typeof Menu>['anchor'];
|
|
13
|
-
elements?: ComponentProps<typeof SelectableVerticalList>['elements'];
|
|
14
|
-
stayInViewport?: ComponentProps<typeof MenuOrDrawer>['stayInViewport'];
|
|
15
|
-
flipOnOverflow?: ComponentProps<typeof MenuOrDrawer>['flipOnOverflow'];
|
|
16
|
-
_boxShadow?: string;
|
|
17
|
-
_height?: string;
|
|
18
|
-
_maxHeight?: string;
|
|
19
|
-
_minWidth?: string;
|
|
20
|
-
_borderRadius?: string;
|
|
21
|
-
openingId?: ComponentProps<typeof MenuOrDrawer>['openingId'];
|
|
22
|
-
onselect?: ComponentProps<typeof SelectableVerticalList>['onselect'];
|
|
23
|
-
}
|
|
24
|
-
declare const MenuOrDrawerOptions: import("svelte").Component<Props, {}, "open" | "activator">;
|
|
25
|
-
type MenuOrDrawerOptions = ReturnType<typeof MenuOrDrawerOptions>;
|
|
26
|
-
export default MenuOrDrawerOptions;
|