@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
|
@@ -2,7 +2,23 @@
|
|
|
2
2
|
import Drawer from '../../simple/navigation/Drawer.svelte';
|
|
3
3
|
import Menu from '../../simple/common/Menu.svelte';
|
|
4
4
|
import MediaQuery from '../../simple/common/MediaQuery.svelte';
|
|
5
|
-
|
|
5
|
+
import lodash from 'lodash';
|
|
6
|
+
let { open = $bindable(false), drawerProps, menuProps, children, } = $props();
|
|
7
|
+
const menuPropsDefaultValue = {
|
|
8
|
+
closeOnClickOutside: true,
|
|
9
|
+
_boxShadow: "rgb(var(--global-color-grey-900), .5) 0px 2px 4px",
|
|
10
|
+
_height: "fit-content",
|
|
11
|
+
_minWidth: "100px",
|
|
12
|
+
_borderRadius: "5px",
|
|
13
|
+
_width: "",
|
|
14
|
+
anchor: 'bottom-center',
|
|
15
|
+
stayInViewport: true
|
|
16
|
+
};
|
|
17
|
+
let finalMenuProps = $derived(lodash.clone(lodash.merge(menuPropsDefaultValue, menuProps)));
|
|
18
|
+
const drawerPropsDefaultValue = {
|
|
19
|
+
position: 'bottom'
|
|
20
|
+
};
|
|
21
|
+
let finalDrawerProps = $derived(lodash.clone(lodash.merge(drawerPropsDefaultValue, drawerProps)));
|
|
6
22
|
</script>
|
|
7
23
|
|
|
8
24
|
<MediaQuery>
|
|
@@ -10,28 +26,14 @@ let { open = $bindable(false), activator = $bindable(), drawerPosition = $bindab
|
|
|
10
26
|
{#if mAndDown}
|
|
11
27
|
<Drawer
|
|
12
28
|
bind:open={open}
|
|
13
|
-
|
|
14
|
-
_overflow={_drawerOverflow}
|
|
15
|
-
{onclose}
|
|
16
|
-
{onitemClick}
|
|
29
|
+
{...finalDrawerProps}
|
|
17
30
|
>
|
|
18
31
|
{@render children?.({ isDrawer: true, isMenu: false })}
|
|
19
32
|
</Drawer>
|
|
20
33
|
{:else}
|
|
21
34
|
<Menu
|
|
22
|
-
bind:activator={activator}
|
|
23
35
|
bind:open={open}
|
|
24
|
-
|
|
25
|
-
_boxShadow={_boxShadow}
|
|
26
|
-
_height={_height}
|
|
27
|
-
_maxHeight={_maxHeight}
|
|
28
|
-
_minWidth={_minWidth}
|
|
29
|
-
_borderRadius={_borderRadius}
|
|
30
|
-
_width={_width || ""}
|
|
31
|
-
anchor={menuAnchor}
|
|
32
|
-
bind:stayInViewport={stayInViewport}
|
|
33
|
-
bind:flipOnOverflow={flipOnOverflow}
|
|
34
|
-
bind:openingId
|
|
36
|
+
{...finalMenuProps}
|
|
35
37
|
>
|
|
36
38
|
{@render children?.({ isDrawer: false, isMenu: true })}
|
|
37
39
|
</Menu>
|
|
@@ -4,28 +4,15 @@ import Menu from '../../simple/common/Menu.svelte';
|
|
|
4
4
|
import type { ComponentProps, Snippet } from 'svelte';
|
|
5
5
|
interface Props {
|
|
6
6
|
open?: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
menuAnchor?: ComponentProps<typeof Menu>['anchor'];
|
|
10
|
-
stayInViewport?: ComponentProps<typeof Menu>['stayInViewport'];
|
|
11
|
-
flipOnOverflow?: ComponentProps<typeof Menu>['flipOnOverflow'];
|
|
12
|
-
_boxShadow?: string;
|
|
13
|
-
_height?: string;
|
|
14
|
-
_width?: string;
|
|
15
|
-
_maxHeight?: string;
|
|
16
|
-
_minWidth?: string;
|
|
17
|
-
_borderRadius?: string;
|
|
18
|
-
openingId?: ComponentProps<typeof Menu>['openingId'];
|
|
19
|
-
_drawerOverflow?: string;
|
|
7
|
+
drawerProps?: Omit<ComponentProps<typeof Drawer>, 'open'>;
|
|
8
|
+
menuProps?: Omit<ComponentProps<typeof Menu>, 'open'>;
|
|
20
9
|
children?: Snippet<[
|
|
21
10
|
{
|
|
22
11
|
isDrawer: boolean;
|
|
23
12
|
isMenu: boolean;
|
|
24
13
|
}
|
|
25
14
|
]>;
|
|
26
|
-
onclose?: ComponentProps<typeof Drawer>['onclose'];
|
|
27
|
-
onitemClick?: ComponentProps<typeof Drawer>['onitemClick'];
|
|
28
15
|
}
|
|
29
|
-
declare const MenuOrDrawer: import("svelte").Component<Props, {}, "
|
|
16
|
+
declare const MenuOrDrawer: import("svelte").Component<Props, {}, "open">;
|
|
30
17
|
type MenuOrDrawer = ReturnType<typeof MenuOrDrawer>;
|
|
31
18
|
export default MenuOrDrawer;
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
<script lang="ts" module>export {};
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
|
-
<script lang="ts">import '../../../css/main.css';
|
|
4
|
+
<script lang="ts" generics="Data">import '../../../css/main.css';
|
|
5
5
|
import MenuOrDrawer from "./MenuOrDrawer.svelte";
|
|
6
6
|
import SelectableVerticalList from '../../simple/lists/SelectableVerticalList.svelte';
|
|
7
|
-
|
|
7
|
+
import lodash from 'lodash';
|
|
8
|
+
let { open = $bindable(false), elements = [], onselect, menuProps, drawerProps, } = $props();
|
|
9
|
+
const menuPropsDefaultValue = {
|
|
10
|
+
anchor: 'bottom-center',
|
|
11
|
+
stayInViewport: true,
|
|
12
|
+
flipOnOverflow: false,
|
|
13
|
+
_boxShadow: "rgb(var(--global-color-grey-900), .5) 0px 2px 4px",
|
|
14
|
+
_height: 'fit-content',
|
|
15
|
+
_maxHeight: undefined,
|
|
16
|
+
_minWidth: '100px',
|
|
17
|
+
_borderRadius: '5px',
|
|
18
|
+
openingId: undefined
|
|
19
|
+
};
|
|
20
|
+
let finalMenuProps = $derived(lodash.clone(lodash.merge(menuPropsDefaultValue, menuProps)));
|
|
21
|
+
const drawerPropsDefaultValue = {
|
|
22
|
+
position: 'bottom'
|
|
23
|
+
};
|
|
24
|
+
let finalDrawerProps = $derived(lodash.clone(lodash.merge(drawerPropsDefaultValue, drawerProps)));
|
|
8
25
|
let selected = $state();
|
|
9
26
|
let focused = $state();
|
|
10
27
|
$effect(() => {
|
|
@@ -25,18 +42,9 @@ function handleOnSelect(e) {
|
|
|
25
42
|
|
|
26
43
|
<MenuOrDrawer
|
|
27
44
|
bind:open
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
bind:menuAnchor
|
|
31
|
-
bind:stayInViewport
|
|
32
|
-
bind:flipOnOverflow
|
|
33
|
-
{_boxShadow}
|
|
34
|
-
{_height}
|
|
35
|
-
{_maxHeight}
|
|
36
|
-
{_minWidth}
|
|
37
|
-
{_borderRadius}
|
|
45
|
+
drawerProps={finalDrawerProps}
|
|
46
|
+
menuProps={finalMenuProps}
|
|
38
47
|
--drawer-default-space={`${Math.min(elements?.length || 0, 5) * 56}px`}
|
|
39
|
-
bind:openingId
|
|
40
48
|
>
|
|
41
49
|
{#snippet children({ isDrawer, isMenu })}
|
|
42
50
|
<div class="selectable-list-wrapper">
|
|
@@ -151,11 +151,15 @@ $effect(() => {
|
|
|
151
151
|
<div class="menu-or-drawer">
|
|
152
152
|
<MenuOrDrawer
|
|
153
153
|
bind:open={openMoreActions}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
menuProps={{
|
|
155
|
+
activator: moreActionsActivator,
|
|
156
|
+
anchor: 'bottom-center',
|
|
157
|
+
openingId: 'more-actions',
|
|
158
|
+
}}
|
|
159
|
+
drawerProps={{
|
|
160
|
+
position: position == 'bottom' ? 'top' : 'bottom',
|
|
161
|
+
_overflow: 'hidden'
|
|
162
|
+
}}
|
|
159
163
|
>
|
|
160
164
|
{#snippet children({ isDrawer, isMenu })}
|
|
161
165
|
<div
|
|
@@ -96,7 +96,7 @@ declare class __sveltets_Render<Data> {
|
|
|
96
96
|
onfocus?: (() => void) | undefined;
|
|
97
97
|
onblur?: (() => void) | undefined;
|
|
98
98
|
onkeydown?: ((e: KeyboardEvent) => void) | undefined;
|
|
99
|
-
onclose?: ComponentProps<typeof import("
|
|
99
|
+
onclose?: ComponentProps<typeof import("../../..").Drawer>["onclose"];
|
|
100
100
|
};
|
|
101
101
|
events(): {};
|
|
102
102
|
slots(): {};
|