@txstate-mws/svelte-components 1.3.6 → 1.3.8
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/actions/glue.d.ts +4 -3
- package/actions/glue.js +28 -3
- package/actions/passactions.d.ts +4 -4
- package/components/Card.svelte.d.ts +3 -3
- package/components/CardLayout.svelte.d.ts +3 -3
- package/components/CollapsingTable.svelte.d.ts +3 -3
- package/components/ConditionalWrapper.svelte.d.ts +3 -3
- package/components/FocusLock.svelte +9 -2
- package/components/FocusLock.svelte.d.ts +13 -3
- package/components/Loading.svelte.d.ts +3 -3
- package/components/Modal.svelte +13 -4
- package/components/Modal.svelte.d.ts +9 -3
- package/components/MultiSelect.svelte +3 -2
- package/components/MultiSelect.svelte.d.ts +4 -3
- package/components/PopupMenu.svelte +2 -1
- package/components/PopupMenu.svelte.d.ts +4 -3
- package/components/ScreenReaderOnly.svelte.d.ts +3 -3
- package/package.json +8 -8
- package/util/bodyoffset.d.ts +1 -1
package/actions/glue.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { SettableSubject } from '@txstate-mws/svelte-store';
|
|
2
|
-
export
|
|
2
|
+
export type GlueAlignOpts = 'auto' | 'bottomleft' | 'bottomright' | 'topleft' | 'topright';
|
|
3
3
|
export interface GlueArgs<T extends GlueAlignStore = GlueAlignStore> {
|
|
4
4
|
target: HTMLElement;
|
|
5
5
|
align?: GlueAlignOpts;
|
|
6
6
|
cover?: boolean;
|
|
7
|
+
adjustparentheight?: boolean;
|
|
7
8
|
store?: SettableSubject<T>;
|
|
8
9
|
}
|
|
9
10
|
export interface GlueAlignStore {
|
|
10
11
|
valign: 'bottom' | 'top';
|
|
11
12
|
halign: 'left' | 'right';
|
|
12
13
|
}
|
|
13
|
-
export declare function glue(el: HTMLElement, { target, align, cover, store }: GlueArgs): {
|
|
14
|
+
export declare function glue(el: HTMLElement, { target, align, cover, adjustparentheight, store }: GlueArgs): {
|
|
14
15
|
update({ target: utarget, align: ualign, cover: ucover, store: ustore }: GlueArgs): void;
|
|
15
|
-
destroy
|
|
16
|
+
destroy(): void;
|
|
16
17
|
};
|
package/actions/glue.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { sharedOffsetParent, targetOffset, watchForPositionChangeInContainer } from '../util/index.js';
|
|
2
2
|
let setBodyRelative = false;
|
|
3
|
-
export function glue(el, { target, align = 'auto', cover = false, store }) {
|
|
3
|
+
export function glue(el, { target, align = 'auto', cover = false, adjustparentheight = false, store }) {
|
|
4
4
|
if (!setBodyRelative) {
|
|
5
5
|
setBodyRelative = true;
|
|
6
6
|
document.body.style.position = 'relative';
|
|
7
7
|
}
|
|
8
8
|
let halign;
|
|
9
9
|
let valign;
|
|
10
|
+
const parent = el.offsetParent;
|
|
11
|
+
const formerMinHeight = parent.style.minHeight;
|
|
10
12
|
let sharedOffset = sharedOffsetParent(el, target);
|
|
11
13
|
function reposition(offset) {
|
|
12
14
|
if (!target || !sharedOffset || !(el.offsetParent instanceof HTMLElement))
|
|
@@ -19,6 +21,18 @@ export function glue(el, { target, align = 'auto', cover = false, store }) {
|
|
|
19
21
|
const topbottom = window.innerHeight - rect.bottom > rect.top ? 'bottom' : 'top';
|
|
20
22
|
autoalign = topbottom + leftright;
|
|
21
23
|
}
|
|
24
|
+
function adjustParentHeight() {
|
|
25
|
+
if (!adjustparentheight)
|
|
26
|
+
return;
|
|
27
|
+
if (parent.style.overflowY === 'auto')
|
|
28
|
+
return;
|
|
29
|
+
const minHeight = el.offsetTop + el.offsetHeight;
|
|
30
|
+
if (minHeight > parent.clientHeight) {
|
|
31
|
+
requestAnimationFrame(() => {
|
|
32
|
+
parent.style.minHeight = String(minHeight) + 'px';
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
22
36
|
const targetHeight = target.offsetHeight;
|
|
23
37
|
if (autoalign === 'bottomleft') {
|
|
24
38
|
requestAnimationFrame(() => {
|
|
@@ -26,6 +40,7 @@ export function glue(el, { target, align = 'auto', cover = false, store }) {
|
|
|
26
40
|
el.style.left = `${offset.left - parentoffset.left}px`;
|
|
27
41
|
el.style.bottom = '';
|
|
28
42
|
el.style.right = '';
|
|
43
|
+
adjustParentHeight();
|
|
29
44
|
});
|
|
30
45
|
valign = 'bottom';
|
|
31
46
|
halign = 'left';
|
|
@@ -36,6 +51,7 @@ export function glue(el, { target, align = 'auto', cover = false, store }) {
|
|
|
36
51
|
el.style.left = '';
|
|
37
52
|
el.style.bottom = '';
|
|
38
53
|
el.style.right = `${offset.right - parentoffset.right}px`;
|
|
54
|
+
adjustParentHeight();
|
|
39
55
|
});
|
|
40
56
|
valign = 'bottom';
|
|
41
57
|
halign = 'right';
|
|
@@ -46,6 +62,7 @@ export function glue(el, { target, align = 'auto', cover = false, store }) {
|
|
|
46
62
|
el.style.left = `${offset.left - parentoffset.left}px`;
|
|
47
63
|
el.style.bottom = `${offset.bottom + (cover ? 0 : targetHeight) - parentoffset.bottom}px`;
|
|
48
64
|
el.style.right = '';
|
|
65
|
+
adjustParentHeight();
|
|
49
66
|
});
|
|
50
67
|
valign = 'top';
|
|
51
68
|
halign = 'left';
|
|
@@ -56,13 +73,14 @@ export function glue(el, { target, align = 'auto', cover = false, store }) {
|
|
|
56
73
|
el.style.left = '';
|
|
57
74
|
el.style.bottom = `${offset.bottom + (cover ? 0 : targetHeight) - parentoffset.bottom}px`;
|
|
58
75
|
el.style.right = `${offset.right - parentoffset.right}px`;
|
|
76
|
+
adjustParentHeight();
|
|
59
77
|
});
|
|
60
78
|
valign = 'top';
|
|
61
79
|
halign = 'right';
|
|
62
80
|
}
|
|
63
81
|
store?.update(v => ({ ...v, valign, halign }));
|
|
64
82
|
}
|
|
65
|
-
const { destroy, update } = watchForPositionChangeInContainer(target, sharedOffset, reposition);
|
|
83
|
+
const { destroy: watchDestroy, update } = watchForPositionChangeInContainer(target, sharedOffset, reposition);
|
|
66
84
|
return {
|
|
67
85
|
update({ target: utarget, align: ualign = 'auto', cover: ucover = false, store: ustore }) {
|
|
68
86
|
align = ualign;
|
|
@@ -77,6 +95,13 @@ export function glue(el, { target, align = 'auto', cover = false, store }) {
|
|
|
77
95
|
update(target, sharedOffset, reposition);
|
|
78
96
|
}
|
|
79
97
|
},
|
|
80
|
-
destroy
|
|
98
|
+
destroy() {
|
|
99
|
+
watchDestroy();
|
|
100
|
+
if (adjustparentheight) {
|
|
101
|
+
if (formerMinHeight)
|
|
102
|
+
parent.style.minHeight = formerMinHeight;
|
|
103
|
+
parent.style.removeProperty('min-height');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
81
106
|
};
|
|
82
107
|
}
|
package/actions/passactions.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ export interface SvelteActionReturnType<P> {
|
|
|
2
2
|
update?: (newParams: P) => void;
|
|
3
3
|
destroy?: () => void;
|
|
4
4
|
}
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
5
|
+
export type SvelteHTMLActionType<P = any> = (node: HTMLElement, params?: P) => SvelteActionReturnType<P> | undefined;
|
|
6
|
+
export type HTMLActionEntry<P extends any = any> = SvelteHTMLActionType<P> | [SvelteHTMLActionType<P>, P];
|
|
7
|
+
export type SvelteSVGActionType<P = any> = (node: SVGElement, params?: P) => SvelteActionReturnType<P> | undefined;
|
|
8
|
+
export type SVGActionEntry<P extends any = any> = SvelteSVGActionType<P> | [SvelteSVGActionType<P>, P];
|
|
9
9
|
export declare function passActions(node: HTMLElement, actions: HTMLActionEntry[]): SvelteActionReturnType<HTMLActionEntry[]>;
|
|
10
10
|
export declare function passActions(node: SVGElement, actions: SVGActionEntry[]): SvelteActionReturnType<SVGActionEntry[]>;
|
|
@@ -12,9 +12,9 @@ declare const __propDef: {
|
|
|
12
12
|
default: {};
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
15
|
+
export type CardProps = typeof __propDef.props;
|
|
16
|
+
export type CardEvents = typeof __propDef.events;
|
|
17
|
+
export type CardSlots = typeof __propDef.slots;
|
|
18
18
|
export default class Card extends SvelteComponentTyped<CardProps, CardEvents, CardSlots> {
|
|
19
19
|
}
|
|
20
20
|
export {};
|
|
@@ -15,9 +15,9 @@ declare const __propDef: {
|
|
|
15
15
|
default: {};
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
18
|
+
export type CardLayoutProps = typeof __propDef.props;
|
|
19
|
+
export type CardLayoutEvents = typeof __propDef.events;
|
|
20
|
+
export type CardLayoutSlots = typeof __propDef.slots;
|
|
21
21
|
export default class CardLayout extends SvelteComponentTyped<CardLayoutProps, CardLayoutEvents, CardLayoutSlots> {
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
@@ -51,9 +51,9 @@ declare const __propDef: {
|
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
export
|
|
55
|
-
export
|
|
56
|
-
export
|
|
54
|
+
export type CollapsingTableProps = typeof __propDef.props;
|
|
55
|
+
export type CollapsingTableEvents = typeof __propDef.events;
|
|
56
|
+
export type CollapsingTableSlots = typeof __propDef.slots;
|
|
57
57
|
export default class CollapsingTable extends SvelteComponentTyped<CollapsingTableProps, CollapsingTableEvents, CollapsingTableSlots> {
|
|
58
58
|
}
|
|
59
59
|
export {};
|
|
@@ -15,9 +15,9 @@ declare const __propDef: {
|
|
|
15
15
|
default: {};
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
18
|
+
export type ConditionalWrapperProps = typeof __propDef.props;
|
|
19
|
+
export type ConditionalWrapperEvents = typeof __propDef.events;
|
|
20
|
+
export type ConditionalWrapperSlots = typeof __propDef.slots;
|
|
21
21
|
export default class ConditionalWrapper extends SvelteComponentTyped<ConditionalWrapperProps, ConditionalWrapperEvents, ConditionalWrapperSlots> {
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script context="module">const FocusLockStack = [];
|
|
1
|
+
<script context="module">export const FocusLockStack = [];
|
|
2
2
|
const waitAtick = typeof requestAnimationFrame !== 'undefined' ? resolve => requestAnimationFrame(resolve) : resolve => resolve(0);
|
|
3
3
|
</script>
|
|
4
4
|
|
|
@@ -7,6 +7,13 @@ export let initialfocus = undefined;
|
|
|
7
7
|
export let hidefocus = true;
|
|
8
8
|
export let hidefocuslabel = 'focus is above modal dialog, start tabbing';
|
|
9
9
|
export let escapable = true;
|
|
10
|
+
/**
|
|
11
|
+
* If you expect any popup menus to be added to the body, we need to know that they
|
|
12
|
+
* are considered to be part of the focus lock, or else the modal will be dismissed
|
|
13
|
+
* when the user clicks inside
|
|
14
|
+
* use commas to include multiple selectors
|
|
15
|
+
*/
|
|
16
|
+
export let includeselector = undefined;
|
|
10
17
|
let className = '';
|
|
11
18
|
export { className as class };
|
|
12
19
|
import { onMount, onDestroy, createEventDispatcher, tick } from 'svelte';
|
|
@@ -89,7 +96,7 @@ const focusin = (e) => {
|
|
|
89
96
|
}
|
|
90
97
|
};
|
|
91
98
|
const windowclick = (e) => {
|
|
92
|
-
if (state === 'active' && e.target instanceof HTMLElement && e.target.isConnected) {
|
|
99
|
+
if (state === 'active' && e.target instanceof HTMLElement && e.target.isConnected && (!includeselector || !e.target.closest(includeselector))) {
|
|
93
100
|
returnfocusto = undefined;
|
|
94
101
|
dispatch('escape');
|
|
95
102
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export declare const FocusLockStack: {
|
|
3
|
+
pause: () => void;
|
|
4
|
+
unpause: () => void;
|
|
5
|
+
}[];
|
|
2
6
|
declare const __propDef: {
|
|
3
7
|
props: {
|
|
4
8
|
returnfocusto?: HTMLElement | null | undefined;
|
|
@@ -6,6 +10,12 @@ declare const __propDef: {
|
|
|
6
10
|
hidefocus?: boolean;
|
|
7
11
|
hidefocuslabel?: string;
|
|
8
12
|
escapable?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If you expect any popup menus to be added to the body, we need to know that they
|
|
15
|
+
* are considered to be part of the focus lock, or else the modal will be dismissed
|
|
16
|
+
* when the user clicks inside
|
|
17
|
+
* use commas to include multiple selectors
|
|
18
|
+
*/ includeselector?: string | undefined;
|
|
9
19
|
class?: string;
|
|
10
20
|
};
|
|
11
21
|
events: {
|
|
@@ -19,9 +29,9 @@ declare const __propDef: {
|
|
|
19
29
|
default: {};
|
|
20
30
|
};
|
|
21
31
|
};
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
32
|
+
export type FocusLockProps = typeof __propDef.props;
|
|
33
|
+
export type FocusLockEvents = typeof __propDef.events;
|
|
34
|
+
export type FocusLockSlots = typeof __propDef.slots;
|
|
25
35
|
export default class FocusLock extends SvelteComponentTyped<FocusLockProps, FocusLockEvents, FocusLockSlots> {
|
|
26
36
|
}
|
|
27
37
|
export {};
|
|
@@ -11,9 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
default: {};
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type LoadingProps = typeof __propDef.props;
|
|
15
|
+
export type LoadingEvents = typeof __propDef.events;
|
|
16
|
+
export type LoadingSlots = typeof __propDef.slots;
|
|
17
17
|
export default class Loading extends SvelteComponentTyped<LoadingProps, LoadingEvents, LoadingSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
package/components/Modal.svelte
CHANGED
|
@@ -6,14 +6,23 @@ export let initialfocus = undefined;
|
|
|
6
6
|
export let containerClass = '';
|
|
7
7
|
export let opaque = false;
|
|
8
8
|
export let usePortal = undefined;
|
|
9
|
+
/**
|
|
10
|
+
* If you expect any popup menus to be added to the body, we need to know that they
|
|
11
|
+
* are considered to be part of the focus lock, or else the modal will be dismissed
|
|
12
|
+
* when the user clicks inside
|
|
13
|
+
* use commas to include multiple selectors
|
|
14
|
+
*/
|
|
15
|
+
export let includeselector = undefined;
|
|
9
16
|
import { createEventDispatcher, onMount } from 'svelte';
|
|
10
|
-
import FocusLock from './FocusLock.svelte';
|
|
17
|
+
import FocusLock, { FocusLockStack } from './FocusLock.svelte';
|
|
11
18
|
import { portal } from '../actions';
|
|
12
19
|
const dispatch = createEventDispatcher();
|
|
13
20
|
const endmodal = () => {
|
|
14
21
|
dispatch('escape');
|
|
15
22
|
};
|
|
23
|
+
let stackPosition;
|
|
16
24
|
onMount(() => {
|
|
25
|
+
stackPosition = FocusLockStack.length - 1;
|
|
17
26
|
document.body.style.marginRight = (window.innerWidth - document.body.clientWidth) + 'px';
|
|
18
27
|
document.body.style.overflow = 'hidden';
|
|
19
28
|
return () => {
|
|
@@ -24,8 +33,8 @@ onMount(() => {
|
|
|
24
33
|
</script>
|
|
25
34
|
|
|
26
35
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
27
|
-
<div use:portal={usePortal} class="modal-backdrop" class:opaque on:mousedown|stopPropagation|preventDefault={() => escapable && endmodal()}>
|
|
28
|
-
<FocusLock class="modal-container {containerClass}" {escapable} on:escape {hidefocus} {hidefocuslabel} {returnfocusto} {initialfocus}>
|
|
36
|
+
<div use:portal={usePortal} class="modal-backdrop" style:--modal-z={stackPosition * 10 + 3000} class:opaque on:mousedown|stopPropagation|preventDefault={() => escapable && endmodal()}>
|
|
37
|
+
<FocusLock class="modal-container {containerClass}" {includeselector} {escapable} on:escape {hidefocus} {hidefocuslabel} {returnfocusto} {initialfocus}>
|
|
29
38
|
<slot></slot>
|
|
30
39
|
</FocusLock>
|
|
31
40
|
</div>
|
|
@@ -38,7 +47,7 @@ onMount(() => {
|
|
|
38
47
|
width: 100vw;
|
|
39
48
|
height: 100vh;
|
|
40
49
|
background-color: var(--modal-bg, rgba(0, 0, 0, 0.7));
|
|
41
|
-
z-index: var(--modal-z
|
|
50
|
+
z-index: var(--modal-z);
|
|
42
51
|
display: flex;
|
|
43
52
|
justify-content: center;
|
|
44
53
|
align-items: center
|
|
@@ -9,6 +9,12 @@ declare const __propDef: {
|
|
|
9
9
|
containerClass?: string;
|
|
10
10
|
opaque?: boolean;
|
|
11
11
|
usePortal?: HTMLElement | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* If you expect any popup menus to be added to the body, we need to know that they
|
|
14
|
+
* are considered to be part of the focus lock, or else the modal will be dismissed
|
|
15
|
+
* when the user clicks inside
|
|
16
|
+
* use commas to include multiple selectors
|
|
17
|
+
*/ includeselector?: string | undefined;
|
|
12
18
|
};
|
|
13
19
|
events: {
|
|
14
20
|
escape: CustomEvent<any>;
|
|
@@ -19,9 +25,9 @@ declare const __propDef: {
|
|
|
19
25
|
default: {};
|
|
20
26
|
};
|
|
21
27
|
};
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
28
|
+
export type ModalProps = typeof __propDef.props;
|
|
29
|
+
export type ModalEvents = typeof __propDef.events;
|
|
30
|
+
export type ModalSlots = typeof __propDef.slots;
|
|
25
31
|
export default class Modal extends SvelteComponentTyped<ModalProps, ModalEvents, ModalSlots> {
|
|
26
32
|
}
|
|
27
33
|
export {};
|
|
@@ -14,6 +14,7 @@ export let menuItemHilitedClass = undefined;
|
|
|
14
14
|
export let selected = [];
|
|
15
15
|
export let placeholder = '';
|
|
16
16
|
export let emptyText = undefined;
|
|
17
|
+
export let usePortal = undefined;
|
|
17
18
|
export let PopupMenu = DefaultPopupMenu;
|
|
18
19
|
let menushown;
|
|
19
20
|
let loading = false;
|
|
@@ -117,7 +118,7 @@ $: reactToHilite(hilitedpill, id);
|
|
|
117
118
|
on:click|preventDefault|stopPropagation={() => !disabled && removeSelection(option, i, 1)} on:mousedown={e => disabled && e.preventDefault()}
|
|
118
119
|
aria-selected="true">
|
|
119
120
|
{option.label || option.value}
|
|
120
|
-
<ScreenReaderOnly>, click to
|
|
121
|
+
<ScreenReaderOnly>, click to deselect</ScreenReaderOnly>
|
|
121
122
|
</li>
|
|
122
123
|
{/each}
|
|
123
124
|
<li class="input">
|
|
@@ -134,7 +135,7 @@ $: reactToHilite(hilitedpill, id);
|
|
|
134
135
|
</ScreenReaderOnly>
|
|
135
136
|
<slot></slot>
|
|
136
137
|
</fieldset>
|
|
137
|
-
<svelte:component this={PopupMenu} bind:menushown bind:hilited={popuphilited} bind:value={popupvalue} align='bottomleft' {loading} {emptyText} {menuContainerClass} {menuClass} {menuItemClass} {menuItemHilitedClass} items={options} buttonelement={inputelement} on:change={addSelection}></svelte:component>
|
|
138
|
+
<svelte:component this={PopupMenu} bind:menushown bind:hilited={popuphilited} bind:value={popupvalue} align='bottomleft' {usePortal} {loading} {emptyText} {menuContainerClass} {menuClass} {menuItemClass} {menuItemHilitedClass} items={options} buttonelement={inputelement} on:change={addSelection}></svelte:component>
|
|
138
139
|
|
|
139
140
|
<style>
|
|
140
141
|
fieldset {
|
|
@@ -17,6 +17,7 @@ declare const __propDef: {
|
|
|
17
17
|
}[];
|
|
18
18
|
placeholder?: string;
|
|
19
19
|
emptyText?: string | undefined;
|
|
20
|
+
usePortal?: HTMLElement | true | undefined;
|
|
20
21
|
PopupMenu?: typeof DefaultPopupMenu;
|
|
21
22
|
};
|
|
22
23
|
events: {
|
|
@@ -29,9 +30,9 @@ declare const __propDef: {
|
|
|
29
30
|
default: {};
|
|
30
31
|
};
|
|
31
32
|
};
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
33
|
+
export type MultiSelectProps = typeof __propDef.props;
|
|
34
|
+
export type MultiSelectEvents = typeof __propDef.events;
|
|
35
|
+
export type MultiSelectSlots = typeof __propDef.slots;
|
|
35
36
|
export default class MultiSelect extends SvelteComponentTyped<MultiSelectProps, MultiSelectEvents, MultiSelectSlots> {
|
|
36
37
|
}
|
|
37
38
|
export {};
|
|
@@ -18,6 +18,7 @@ export let cover = false;
|
|
|
18
18
|
export let showSelected = true;
|
|
19
19
|
export let width = undefined;
|
|
20
20
|
export let computedalign = new Store({ valign: 'bottom', halign: 'left' });
|
|
21
|
+
export let adjustparentheight = false;
|
|
21
22
|
export let loading = false;
|
|
22
23
|
export let usePortal = undefined;
|
|
23
24
|
export let emptyText = undefined;
|
|
@@ -195,7 +196,7 @@ $: hasSelected = showSelected && items.some(itm => itm.value === value);
|
|
|
195
196
|
</script>
|
|
196
197
|
|
|
197
198
|
{#if menushown}
|
|
198
|
-
<div use:portal={usePortal === true ?
|
|
199
|
+
<div use:portal={usePortal === true ? undefined : (usePortal || null)} use:glue={{ target: buttonelement, align, cover, adjustparentheight, store: computedalign }} class={menuContainerClass}>
|
|
199
200
|
<ul bind:this={menuelement} id={menuid} role='listbox' style={width ? `width: ${width}` : ''} class={menuClass} class:hasSelected class:defaultmenu={!menuClass && !menuContainerClass} on:keydown={onkeydown}>
|
|
200
201
|
{#each items as item, i (item.value)}
|
|
201
202
|
{#if showSelected || item.value !== value}
|
|
@@ -17,6 +17,7 @@ declare const __propDef: {
|
|
|
17
17
|
showSelected?: boolean;
|
|
18
18
|
width?: string | undefined;
|
|
19
19
|
computedalign?: Store<GlueAlignStore>;
|
|
20
|
+
adjustparentheight?: boolean;
|
|
20
21
|
loading?: boolean;
|
|
21
22
|
usePortal?: HTMLElement | true | undefined;
|
|
22
23
|
emptyText?: string | undefined;
|
|
@@ -39,9 +40,9 @@ declare const __propDef: {
|
|
|
39
40
|
noresults: {};
|
|
40
41
|
};
|
|
41
42
|
};
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
43
|
+
export type PopupMenuProps = typeof __propDef.props;
|
|
44
|
+
export type PopupMenuEvents = typeof __propDef.events;
|
|
45
|
+
export type PopupMenuSlots = typeof __propDef.slots;
|
|
45
46
|
export default class PopupMenu extends SvelteComponentTyped<PopupMenuProps, PopupMenuEvents, PopupMenuSlots> {
|
|
46
47
|
}
|
|
47
48
|
export {};
|
|
@@ -12,9 +12,9 @@ declare const __propDef: {
|
|
|
12
12
|
default: {};
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
15
|
+
export type ScreenReaderOnlyProps = typeof __propDef.props;
|
|
16
|
+
export type ScreenReaderOnlyEvents = typeof __propDef.events;
|
|
17
|
+
export type ScreenReaderOnlySlots = typeof __propDef.slots;
|
|
18
18
|
export default class ScreenReaderOnly extends SvelteComponentTyped<ScreenReaderOnlyProps, ScreenReaderOnlyEvents, ScreenReaderOnlySlots> {
|
|
19
19
|
}
|
|
20
20
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@txstate-mws/svelte-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Svelte components that are generically useful.",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@txstate-mws/svelte-store": "^1.0.3",
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@playwright/test": "^1.18.1",
|
|
12
|
-
"@sveltejs/adapter-auto": "
|
|
13
|
-
"@sveltejs/kit": "
|
|
14
|
-
"@sveltejs/package": "1.0.
|
|
12
|
+
"@sveltejs/adapter-auto": "^1.0.0",
|
|
13
|
+
"@sveltejs/kit": "^1.0.1",
|
|
14
|
+
"@sveltejs/package": "^1.0.1",
|
|
15
15
|
"@types/tabbable": "^3.1.2",
|
|
16
|
-
"eslint-config-standard-with-typescript": "^
|
|
16
|
+
"eslint-config-standard-with-typescript": "^24.0.0",
|
|
17
17
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
18
18
|
"svelte": "^3.44.0",
|
|
19
|
-
"svelte-check": "^
|
|
20
|
-
"svelte-preprocess": "^
|
|
21
|
-
"svelte2tsx": "^0.
|
|
19
|
+
"svelte-check": "^3.0.1",
|
|
20
|
+
"svelte-preprocess": "^5.0.0",
|
|
21
|
+
"svelte2tsx": "^0.6.0",
|
|
22
22
|
"tslib": "^2.3.1",
|
|
23
23
|
"typescript": "^4.4.3"
|
|
24
24
|
},
|
package/util/bodyoffset.d.ts
CHANGED