@txstate-mws/svelte-components 1.6.11 → 1.6.13
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/actions/elementqueries.d.ts +12 -9
- package/dist/actions/elementqueries.js +12 -11
- package/dist/actions/glue.d.ts +61 -4
- package/dist/actions/glue.js +130 -16
- package/dist/actions/offset.js +2 -2
- package/dist/actions/passactions.d.ts +2 -2
- package/dist/actions/stickyfixed.js +3 -3
- package/dist/components/ButtonMenu.svelte +32 -27
- package/dist/components/ButtonMenu.svelte.d.ts +2 -3
- package/dist/components/Card.svelte +12 -8
- package/dist/components/CardLayout.svelte +151 -158
- package/dist/components/CollapsingTable.svelte +65 -63
- package/dist/components/ConditionalWrapper.svelte +7 -7
- package/dist/components/ConditionalWrapper.svelte.d.ts +1 -1
- package/dist/components/FocusLock.svelte +80 -86
- package/dist/components/FocusLock.svelte.d.ts +1 -1
- package/dist/components/Loading.svelte +16 -15
- package/dist/components/Lottie.svelte +37 -31
- package/dist/components/Modal.svelte +36 -34
- package/dist/components/MultiSelect.svelte +158 -166
- package/dist/components/PopupMenu.svelte +272 -277
- package/dist/components/PopupMenu.svelte.d.ts +14 -14
- package/dist/components/ScreenReaderOnly.svelte +5 -4
- package/dist/stores/toasts.d.ts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +0 -2
- package/dist/util/bodyoffset.js +1 -1
- package/dist/util/util.d.ts +2 -2
- package/dist/util/util.js +1 -2
- package/package.json +15 -12
|
@@ -2,12 +2,12 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import { Store } from '@txstate-mws/svelte-store';
|
|
3
3
|
import type { GlueAlignOpts, GlueAlignStore } from '../actions';
|
|
4
4
|
import type { PopupMenuItem } from '../types';
|
|
5
|
-
declare
|
|
6
|
-
props: {
|
|
5
|
+
declare class __sveltets_Render<MenuItem extends PopupMenuItem = PopupMenuItem> {
|
|
6
|
+
props(): {
|
|
7
7
|
/** The DOM element that will act as the "button" for this menu. The menu will be placed next to the
|
|
8
8
|
button and be controlled by the button. Keyboard access will be enabled when the button has focus.
|
|
9
|
-
This component adds all appropriate attributes (tabindex, roles, and aria) automatically. */ buttonelement: HTMLElement;
|
|
10
|
-
/** The list of menu items to be shown. Parent may change this at any time based on user activity. */ items?:
|
|
9
|
+
This component adds all appropriate attributes (tabindex, roles, and aria) automatically. */ buttonelement: HTMLElement | undefined;
|
|
10
|
+
/** The list of menu items to be shown. Parent may change this at any time based on user activity. */ items?: MenuItem[] | undefined;
|
|
11
11
|
menushown?: boolean;
|
|
12
12
|
value?: string | undefined;
|
|
13
13
|
/** Control where the menu will appear. Default is to use the current viewport to make a decision to
|
|
@@ -46,26 +46,26 @@ declare const __propDef: {
|
|
|
46
46
|
hideEmptyText?: boolean;
|
|
47
47
|
/** If true, the role for the popup menu will be 'menu' instead of the default 'listbox' value */ usemenurole?: boolean;
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
events(): {
|
|
50
|
+
change: CustomEvent<MenuItem>;
|
|
51
|
+
};
|
|
52
|
+
slots(): {
|
|
50
53
|
default: {
|
|
51
|
-
item:
|
|
54
|
+
item: MenuItem;
|
|
52
55
|
label: string;
|
|
53
56
|
hilited: boolean;
|
|
54
57
|
selected: boolean;
|
|
55
58
|
};
|
|
56
59
|
noresults: {};
|
|
57
60
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
export type PopupMenuProps = typeof __propDef.props;
|
|
63
|
-
export type PopupMenuEvents = typeof __propDef.events;
|
|
64
|
-
export type PopupMenuSlots = typeof __propDef.slots;
|
|
61
|
+
}
|
|
62
|
+
export type PopupMenuProps<MenuItem extends PopupMenuItem = PopupMenuItem> = ReturnType<__sveltets_Render<MenuItem>['props']>;
|
|
63
|
+
export type PopupMenuEvents<MenuItem extends PopupMenuItem = PopupMenuItem> = ReturnType<__sveltets_Render<MenuItem>['events']>;
|
|
64
|
+
export type PopupMenuSlots<MenuItem extends PopupMenuItem = PopupMenuItem> = ReturnType<__sveltets_Render<MenuItem>['slots']>;
|
|
65
65
|
/**
|
|
66
66
|
* The purpose of [`PopupMenu`](https://github.com/txstate-etc/svelte-components/blob/main/docs/PopupMenu.md) is to display a menu of options to the user, activated by clicking any element
|
|
67
67
|
* bound to `buttonelement`. It can also be controlled from the parent, by binding the `menushown` boolean.
|
|
68
68
|
*/
|
|
69
|
-
export default class PopupMenu extends SvelteComponentTyped<PopupMenuProps
|
|
69
|
+
export default class PopupMenu<MenuItem extends PopupMenuItem = PopupMenuItem> extends SvelteComponentTyped<PopupMenuProps<MenuItem>, PopupMenuEvents<MenuItem>, PopupMenuSlots<MenuItem>> {
|
|
70
70
|
}
|
|
71
71
|
export {};
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
This component is for adding text that can be read by screen readers while remaining invisible to regular users.
|
|
3
3
|
Useful for when aria-label isn't supported with the drawback that it can show up in copy/paste selections.
|
|
4
4
|
-->
|
|
5
|
-
<script lang="ts"
|
|
6
|
-
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
/** An id to bind with the `<span>` used to implement this component. */
|
|
7
|
+
export let id: string | undefined = undefined
|
|
8
|
+
export let arialive: 'off' | 'assertive' | 'polite' | undefined = undefined
|
|
9
|
+
export let ariaatomic: boolean | 'false' | 'true' | undefined = undefined
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<style>
|
package/dist/stores/toasts.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export interface ToastStorage {
|
|
|
24
24
|
suspended: boolean;
|
|
25
25
|
}
|
|
26
26
|
export declare class ToastStore extends Store<ToastStorage[]> {
|
|
27
|
-
add(toast: Toast):
|
|
28
|
-
add(msg: string, type?: Toast['type'], ttlMs?: number):
|
|
27
|
+
add(toast: Toast): void;
|
|
28
|
+
add(msg: string, type?: Toast['type'], ttlMs?: number): void;
|
|
29
29
|
close(id: string): void;
|
|
30
30
|
suspend(id: string): void;
|
|
31
31
|
resume(id: string): void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './CardLayout.js';
|
|
2
|
-
export * from './CollapsingTable.js';
|
|
3
|
-
export * from './PopupMenu.js';
|
|
2
|
+
export type * from './CollapsingTable.js';
|
|
3
|
+
export type * from './PopupMenu.js';
|
package/dist/types/index.js
CHANGED
package/dist/util/bodyoffset.js
CHANGED
|
@@ -44,7 +44,7 @@ function getTranslate(element) {
|
|
|
44
44
|
}
|
|
45
45
|
// Can either be 2d or 3d transform
|
|
46
46
|
const matrixType = matrix.includes('3d') ? '3d' : '2d';
|
|
47
|
-
const matrixValues = matrix.match(/matrix.*\((.+)\)/)[1].split(', ');
|
|
47
|
+
const matrixValues = matrix.match(/matrix.*\((.+)\)/v)[1].split(', ');
|
|
48
48
|
// 2d matrices have 6 values
|
|
49
49
|
// Last 2 values are X and Y.
|
|
50
50
|
// 2d matrices does not have Z value.
|
package/dist/util/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function classes(...classNames: (string | undefined)[]): string;
|
|
2
2
|
export declare function debounced(fn: (..._: any[]) => any, timeout: number): (...args: any[]) => void;
|
|
3
|
-
export declare function modifierKey(e:
|
|
3
|
+
export declare function modifierKey(e: KeyboardEvent): boolean;
|
|
4
4
|
export declare function selectionIsLeft(ele: HTMLInputElement | HTMLTextAreaElement): boolean;
|
|
5
|
-
export declare function getScrollParents(element: HTMLElement):
|
|
5
|
+
export declare function getScrollParents(element: HTMLElement): HTMLElement[];
|
package/dist/util/util.js
CHANGED
|
@@ -5,7 +5,6 @@ export function debounced(fn, timeout) {
|
|
|
5
5
|
let timer;
|
|
6
6
|
return (...args) => {
|
|
7
7
|
clearTimeout(timer);
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9
8
|
timer = setTimeout(() => fn(...args), timeout);
|
|
10
9
|
};
|
|
11
10
|
}
|
|
@@ -25,7 +24,7 @@ export function getScrollParents(element) {
|
|
|
25
24
|
if (excludeStaticParent && style.position === 'static') {
|
|
26
25
|
continue;
|
|
27
26
|
}
|
|
28
|
-
if (/(auto|scroll|hidden)
|
|
27
|
+
if (/(auto|scroll|hidden)/v.test(style.overflow + style.overflowY + style.overflowX))
|
|
29
28
|
return [parent, ...getScrollParents(parent)];
|
|
30
29
|
}
|
|
31
30
|
return [document.body];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@txstate-mws/svelte-components",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.13",
|
|
4
4
|
"description": "Svelte components that are generically useful.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepublishOnly": "svelte-package",
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
"preview": "vite preview",
|
|
11
11
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
12
12
|
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
13
|
-
"lint": "eslint
|
|
14
|
-
"test": "
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"//test": "--disable-warning=DEP0205 silences Playwright's own module.register() deprecation under Node 22+; remove once Playwright switches to module.registerHooks().",
|
|
15
|
+
"test": "node --disable-warning=DEP0205 ./node_modules/.bin/playwright test tests"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@txstate-mws/svelte-store": "^1.0.3",
|
|
@@ -20,18 +21,18 @@
|
|
|
20
21
|
"txstate-utils": "^1.7.12"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
24
|
+
"@eslint/compat": "^2.0.3",
|
|
23
25
|
"@playwright/test": "^1.18.1",
|
|
24
|
-
"@
|
|
26
|
+
"@stylistic/eslint-plugin": "^5.0.0",
|
|
27
|
+
"@sveltejs/adapter-auto": "^7.0.0",
|
|
25
28
|
"@sveltejs/kit": "^2.0.0",
|
|
26
29
|
"@sveltejs/package": "^2.0.2",
|
|
27
|
-
"
|
|
28
|
-
"eslint-
|
|
29
|
-
"
|
|
30
|
-
"svelte-check": "^
|
|
31
|
-
"svelte-preprocess": "^5.0.0",
|
|
32
|
-
"svelte2tsx": "^0.7.0",
|
|
30
|
+
"eslint-config-love": "^154.0.0",
|
|
31
|
+
"eslint-plugin-svelte": "^3.0.0",
|
|
32
|
+
"svelte": "^5.0.0",
|
|
33
|
+
"svelte-check": "^4.0.0",
|
|
33
34
|
"tslib": "^2.3.1",
|
|
34
|
-
"typescript": "^
|
|
35
|
+
"typescript": "^6.0.3"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"svelte": "^3.53.1 || ^4.0.0 || ^5.0.0"
|
|
@@ -46,7 +47,9 @@
|
|
|
46
47
|
},
|
|
47
48
|
"./package.json": "./package.json"
|
|
48
49
|
},
|
|
49
|
-
"files": [
|
|
50
|
+
"files": [
|
|
51
|
+
"dist"
|
|
52
|
+
],
|
|
50
53
|
"repository": {
|
|
51
54
|
"type": "git",
|
|
52
55
|
"url": "git@github.com:txstate-etc/svelte-components.git"
|