@likable-hair/svelte 4.0.30 → 4.0.32
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.
|
@@ -46,6 +46,8 @@ declare class __sveltets_Render<Data> {
|
|
|
46
46
|
mobileDrawer?: boolean;
|
|
47
47
|
menuWidth?: string | null;
|
|
48
48
|
menuAnchor?: ComponentProps<typeof Menu>["anchor"];
|
|
49
|
+
menuStayInViewport?: ComponentProps<typeof Menu>["stayInViewport"];
|
|
50
|
+
menuFlipOnOverflow?: ComponentProps<typeof Menu>["flipOnOverflow"];
|
|
49
51
|
class?: {
|
|
50
52
|
activator?: string;
|
|
51
53
|
menu?: string;
|
|
@@ -84,8 +84,8 @@ function calculateMenuPosition(params) {
|
|
|
84
84
|
_left = 0;
|
|
85
85
|
if (!_top)
|
|
86
86
|
_top = 0;
|
|
87
|
-
_left = _left - (positionedAncestorLeft + window.scrollX);
|
|
88
|
-
_top = _top - (positionedAncestorTop + window.scrollY);
|
|
87
|
+
_left = _left - (positionedAncestorLeft + window.scrollX - positionedAncestor.scrollLeft);
|
|
88
|
+
_top = _top - (positionedAncestorTop + window.scrollY - positionedAncestor.scrollTop);
|
|
89
89
|
if (!!activator) {
|
|
90
90
|
let { validStickyParent, fixedParent } = getParentInstanceFromViewport(activator?.parentElement);
|
|
91
91
|
if (!!validStickyParent || !!fixedParent) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<script lang="ts" generics="Data">import "../../../css/main.css";
|
|
5
5
|
import "./Autocomplete.css";
|
|
6
6
|
import { scrollInMenu } from "../common/scroller";
|
|
7
|
-
let { values = $bindable(), items = [], searchFunction = undefined, multiple = false, disabled = false, mandatory = false, placeholder = "", width = "auto", height = "auto", maxWidth = undefined, minWidth = "200px", openingId = $bindable("autocomplete-menu"), searchText = $bindable(), maxVisibleChips = undefined, menuOpened = $bindable(false), closeOnSelect = !multiple, emptySearchTextOnMenuClose = true, menuBoxShadow = "rgb(var(--global-color-background-300), .5) 0px 2px 4px", menuBorderRadius = "5px", mobileDrawer = false, menuWidth = undefined, menuAnchor = 'bottom-center', class: clazz = {}, selectionContainerSnippet, selectionSnippet, chipLabelSnippet, exceedCounterSnippet, menuSnippet, itemLabelSnippet, itemSnippet, onchange, onfocus, onblur, onkeydown, onclose, } = $props();
|
|
7
|
+
let { values = $bindable(), items = [], searchFunction = undefined, multiple = false, disabled = false, mandatory = false, placeholder = "", width = "auto", height = "auto", maxWidth = undefined, minWidth = "200px", openingId = $bindable("autocomplete-menu"), searchText = $bindable(), maxVisibleChips = undefined, menuOpened = $bindable(false), closeOnSelect = !multiple, emptySearchTextOnMenuClose = true, menuBoxShadow = "rgb(var(--global-color-background-300), .5) 0px 2px 4px", menuBorderRadius = "5px", mobileDrawer = false, menuWidth = undefined, menuAnchor = 'bottom-center', class: clazz = {}, menuStayInViewport, menuFlipOnOverflow = true, selectionContainerSnippet, selectionSnippet, chipLabelSnippet, exceedCounterSnippet, menuSnippet, itemLabelSnippet, itemSnippet, onchange, onfocus, onblur, onkeydown, onclose, } = $props();
|
|
8
8
|
let notVisibleChipNumber = $derived(Math.max(((values || []).length || 0) - (maxVisibleChips || 0), 0));
|
|
9
9
|
function select(item) {
|
|
10
10
|
if (disabled)
|
|
@@ -288,10 +288,11 @@ import MenuOrDrawer from "../../composed/common/MenuOrDrawer.svelte";
|
|
|
288
288
|
bind:open={menuOpened}
|
|
289
289
|
anchor={menuAnchor}
|
|
290
290
|
closeOnClickOutside
|
|
291
|
+
stayInViewport={menuStayInViewport}
|
|
292
|
+
flipOnOverflow={menuFlipOnOverflow}
|
|
291
293
|
bind:refreshPosition
|
|
292
294
|
bind:menuElement
|
|
293
295
|
bind:openingId
|
|
294
|
-
flipOnOverflow
|
|
295
296
|
>
|
|
296
297
|
<ul
|
|
297
298
|
class={clazz.menu || ""}
|
|
@@ -33,6 +33,8 @@ declare class __sveltets_Render<Data> {
|
|
|
33
33
|
mobileDrawer?: boolean;
|
|
34
34
|
menuWidth?: string | null;
|
|
35
35
|
menuAnchor?: ComponentProps<typeof Menu>["anchor"];
|
|
36
|
+
menuStayInViewport?: ComponentProps<typeof Menu>["stayInViewport"];
|
|
37
|
+
menuFlipOnOverflow?: ComponentProps<typeof Menu>["flipOnOverflow"];
|
|
36
38
|
class?: {
|
|
37
39
|
activator?: string;
|
|
38
40
|
menu?: string;
|