@txstate-mws/svelte-components 1.0.1 → 1.1.0
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/.eslintrc.cjs +37 -0
- package/README.md +33 -14
- package/docs/stores.md +1 -1
- package/package.json +24 -74
- package/playwright.config.js +112 -0
- package/src/app.html +14 -0
- package/src/global.d.ts +1 -0
- package/src/lib/actions/buttonify.ts +27 -0
- package/src/lib/actions/glue.ts +96 -0
- package/src/lib/actions/index.ts +7 -0
- package/src/lib/actions/offset.ts +43 -0
- package/src/lib/actions/portal.ts +13 -0
- package/src/lib/actions/resize.ts +72 -0
- package/src/lib/actions/sticky.ts +105 -0
- package/src/lib/actions/stickyfixed.ts +160 -0
- package/src/lib/components/Card.svelte +25 -0
- package/src/lib/components/CardLayout.svelte +188 -0
- package/{dist/ts → src/lib}/components/CollapsingTable.svelte +6 -5
- package/{dist/ts → src/lib}/components/ConditionalWrapper.svelte +0 -0
- package/{dist/ts → src/lib}/components/FocusLock.svelte +7 -6
- package/{dist/ts → src/lib}/components/Modal.svelte +5 -4
- package/src/lib/components/MultiSelect.svelte +174 -0
- package/{dist/ts → src/lib}/components/PopupMenu.svelte +22 -16
- package/{dist/ts → src/lib}/components/ScreenReaderOnly.svelte +2 -2
- package/src/lib/components/index.ts +9 -0
- package/src/lib/index.ts +4 -0
- package/src/lib/types/CardLayout.ts +14 -0
- package/src/lib/types/CollapsingTable.ts +8 -0
- package/src/lib/types/PopupMenu.ts +5 -0
- package/src/lib/types/index.ts +3 -0
- package/src/lib/util/bodyoffset.ts +77 -0
- package/src/lib/util/index.ts +3 -0
- package/src/lib/util/repositioned.ts +91 -0
- package/src/lib/util/util.ts +36 -0
- package/src/routes/__layout.svelte +125 -0
- package/src/routes/actions/index.svelte +1 -0
- package/src/routes/actions/offset.svelte +4 -0
- package/src/routes/actions/offsetdebounce.svelte +4 -0
- package/src/routes/actions/resize.svelte +4 -0
- package/src/routes/actions/resizedebounce.svelte +4 -0
- package/src/routes/actions/sticky.svelte +4 -0
- package/src/routes/cards/index.svelte +4 -0
- package/src/routes/cards/preserve.svelte +4 -0
- package/src/routes/collapsingtable/index.svelte +4 -0
- package/src/routes/collapsingtable/stickyheader.svelte +4 -0
- package/src/routes/index.svelte +2 -0
- package/src/routes/modal.svelte +4 -0
- package/src/routes/multiselect.svelte +4 -0
- package/src/routes/popupmenu/body.svelte +4 -0
- package/src/routes/popupmenu/complex.svelte +4 -0
- package/src/routes/popupmenu/empty.svelte +5 -0
- package/src/routes/popupmenu/index.svelte +4 -0
- package/src/routes/popupmenu/parent.svelte +4 -0
- package/src/routes/popupmenu/scrollable.svelte +27 -0
- package/src/routes/popupmenu/showselected.svelte +4 -0
- package/src/test/Cards.svelte +64 -0
- package/{dist/ts/tests/CollapsingTable → src/test}/CollapsingTableTest.svelte +2 -2
- package/{dist/ts/tests/Modal → src/test}/ModalTest.svelte +3 -3
- package/src/test/MultiSelectTest.svelte +26 -0
- package/{dist/ts/tests/Actions → src/test}/Offset.svelte +2 -4
- package/{dist/ts/tests/PopupMenu → src/test}/PopupMenuBody.svelte +1 -1
- package/{dist/ts/tests/PopupMenu → src/test}/PopupMenuButtonIsParent.svelte +2 -2
- package/{dist/ts/tests/PopupMenu → src/test}/PopupMenuComplex.svelte +2 -2
- package/{dist/ts/tests/PopupMenu → src/test}/PopupMenuSimple.svelte +2 -2
- package/{dist/ts/tests/Actions → src/test}/Resize.svelte +2 -4
- package/{dist/ts/tests/Actions → src/test}/Sticky.svelte +1 -1
- package/static/layout.css +263 -0
- package/svelte.config.js +15 -0
- package/tests/.eslintrc.cjs +19 -0
- package/tests/CardLayout.test.js +41 -0
- package/tests/CollapsingTable.test.js +37 -0
- package/tests/Modal.test.js +18 -0
- package/tests/MultiSelect.test.js +58 -0
- package/tests/PopupMenu.test.js +55 -0
- package/tests/common.js +4 -0
- package/tsconfig.json +31 -0
- package/LICENSE +0 -21
- package/dist/actions/buttonify.js +0 -31
- package/dist/actions/buttonify.js.map +0 -1
- package/dist/actions/glue.js +0 -87
- package/dist/actions/glue.js.map +0 -1
- package/dist/actions/index.js +0 -20
- package/dist/actions/index.js.map +0 -1
- package/dist/actions/offset.js +0 -35
- package/dist/actions/offset.js.map +0 -1
- package/dist/actions/portal.js +0 -19
- package/dist/actions/portal.js.map +0 -1
- package/dist/actions/resize.js +0 -48
- package/dist/actions/resize.js.map +0 -1
- package/dist/actions/sticky.js +0 -93
- package/dist/actions/sticky.js.map +0 -1
- package/dist/actions/stickyfixed.js +0 -166
- package/dist/actions/stickyfixed.js.map +0 -1
- package/dist/components/CollapsingTable.svelte +0 -147
- package/dist/components/ConditionalWrapper.svelte +0 -38
- package/dist/components/FocusLock.svelte +0 -105
- package/dist/components/Modal.svelte +0 -52
- package/dist/components/PopupMenu.svelte +0 -282
- package/dist/components/ScreenReaderOnly.svelte +0 -25
- package/dist/components/index.js +0 -19
- package/dist/components/index.js.map +0 -1
- package/dist/index.js +0 -17
- package/dist/index.js.map +0 -1
- package/dist/lib/activestore.js +0 -123
- package/dist/lib/activestore.js.map +0 -1
- package/dist/lib/bodyoffset.js +0 -76
- package/dist/lib/bodyoffset.js.map +0 -1
- package/dist/lib/convertedstore.js +0 -41
- package/dist/lib/convertedstore.js.map +0 -1
- package/dist/lib/derivedstore.js +0 -65
- package/dist/lib/derivedstore.js.map +0 -1
- package/dist/lib/index.js +0 -22
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/repositioned.js +0 -92
- package/dist/lib/repositioned.js.map +0 -1
- package/dist/lib/safestore.js +0 -16
- package/dist/lib/safestore.js.map +0 -1
- package/dist/lib/store.js +0 -27
- package/dist/lib/store.js.map +0 -1
- package/dist/lib/substore.js +0 -47
- package/dist/lib/substore.js.map +0 -1
- package/dist/lib/util.js +0 -16
- package/dist/lib/util.js.map +0 -1
- package/dist/ts/actions/buttonify.d.ts +0 -8
- package/dist/ts/actions/glue.d.ts +0 -16
- package/dist/ts/actions/index.d.ts +0 -7
- package/dist/ts/actions/offset.d.ts +0 -15
- package/dist/ts/actions/portal.d.ts +0 -4
- package/dist/ts/actions/resize.d.ts +0 -16
- package/dist/ts/actions/sticky.d.ts +0 -33
- package/dist/ts/actions/stickyfixed.d.ts +0 -25
- package/dist/ts/components/index.d.ts +0 -6
- package/dist/ts/index.d.ts +0 -4
- package/dist/ts/lib/activestore.d.ts +0 -60
- package/dist/ts/lib/bodyoffset.d.ts +0 -13
- package/dist/ts/lib/convertedstore.d.ts +0 -16
- package/dist/ts/lib/derivedstore.d.ts +0 -23
- package/dist/ts/lib/index.d.ts +0 -9
- package/dist/ts/lib/repositioned.d.ts +0 -13
- package/dist/ts/lib/safestore.d.ts +0 -4
- package/dist/ts/lib/store.d.ts +0 -16
- package/dist/ts/lib/substore.d.ts +0 -24
- package/dist/ts/lib/util.d.ts +0 -2
- package/dist/ts/tests/Actions/Actions.stories.d.ts +0 -1
- package/dist/ts/tests/CollapsingTable/CollapsingTable.stories.d.ts +0 -1
- package/dist/ts/tests/CollapsingTable/CollapsingTable.test.d.ts +0 -1
- package/dist/ts/tests/Modal/Modal.stories.d.ts +0 -1
- package/dist/ts/tests/Modal/Modal.test.d.ts +0 -1
- package/dist/ts/tests/PopupMenu/PopupMenu.stories.d.ts +0 -1
- package/dist/ts/tests/PopupMenu/PopupMenu.test.d.ts +0 -1
- package/dist/ts/tests/stores/deepstore.test.d.ts +0 -1
- package/dist/ts/types/CollapsingTable.d.ts +0 -8
- package/dist/ts/types/PopupMenu.d.ts +0 -5
- package/dist/ts/types/index.d.ts +0 -2
- package/dist/types/CollapsingTable.js +0 -3
- package/dist/types/CollapsingTable.js.map +0 -1
- package/dist/types/PopupMenu.js +0 -3
- package/dist/types/PopupMenu.js.map +0 -1
- package/dist/types/index.js +0 -15
- package/dist/types/index.js.map +0 -1
- package/esm/index.js +0 -1
- package/esm/package.json +0 -3
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { WritableSubject, ElementOffsets } from '../lib';
|
|
2
|
-
interface OffsetConfig<T extends ElementOffsets = ElementOffsets> {
|
|
3
|
-
debounce?: boolean | number;
|
|
4
|
-
store?: WritableSubject<T>;
|
|
5
|
-
}
|
|
6
|
-
export declare function offset(el: HTMLElement, config?: OffsetConfig): {
|
|
7
|
-
update(newConfig?: OffsetConfig<Partial<{
|
|
8
|
-
right: number;
|
|
9
|
-
bottom: number;
|
|
10
|
-
top: number;
|
|
11
|
-
left: number;
|
|
12
|
-
}>> | undefined): void;
|
|
13
|
-
destroy: () => void;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SettableSubject } from '../lib';
|
|
2
|
-
export interface ElementSize {
|
|
3
|
-
clientWidth?: number;
|
|
4
|
-
clientHeight?: number;
|
|
5
|
-
offsetWidth?: number;
|
|
6
|
-
offsetHeight?: number;
|
|
7
|
-
}
|
|
8
|
-
interface ResizeConfig {
|
|
9
|
-
debounce?: boolean | number;
|
|
10
|
-
store?: SettableSubject<ElementSize>;
|
|
11
|
-
}
|
|
12
|
-
export declare function resize(el: HTMLElement, config?: ResizeConfig): void | {
|
|
13
|
-
update(newConfig?: ResizeConfig | undefined): void;
|
|
14
|
-
destroy(): void;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { SettableSubject } from '../lib';
|
|
2
|
-
export interface StickyArgs<T extends StickyStore = StickyStore> {
|
|
3
|
-
target?: HTMLElement;
|
|
4
|
-
store?: SettableSubject<T>;
|
|
5
|
-
}
|
|
6
|
-
export interface StickyStore {
|
|
7
|
-
floating?: boolean;
|
|
8
|
-
translateY?: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* A robust implementation of stickyness based on `transform: translateY()`. Only use when
|
|
12
|
-
* `position: sticky` won't work for you. If `position: sticky` does work for you, use it,
|
|
13
|
-
* it performs better.
|
|
14
|
-
*
|
|
15
|
-
* Reasons `position: sticky` might not work:
|
|
16
|
-
* 1) it cannot work on a thead or tr, only td and th (and non-table elements)
|
|
17
|
-
* 2) it gets confused if any parent elements have an `overflow` set, even `overflow: hidden`
|
|
18
|
-
* 3) it always stays within the boundaries of the closest parent element that has a `position`
|
|
19
|
-
* * use:sticky accepts a `target` element as a parameter, defining the bounding container
|
|
20
|
-
*
|
|
21
|
-
* Note that if the element you place this on has other transforms, this is going to overwrite them.
|
|
22
|
-
*
|
|
23
|
-
* The main drawback to this approach is that it cannot do its work before scroll on mobile, only after,
|
|
24
|
-
* so on mobile you are going to see it visually lag a little during scrolling.
|
|
25
|
-
*
|
|
26
|
-
* You may also want to try use:stickyfixed. It is based on setting `position: fixed` when appropriate,
|
|
27
|
-
* and therefore animates better than this. However, it has a lot more work to do and is more
|
|
28
|
-
* fragile if your markup/CSS situation is very complex.
|
|
29
|
-
*/
|
|
30
|
-
export declare function sticky(el: HTMLElement, config?: StickyArgs): {
|
|
31
|
-
update: (newConfig?: StickyArgs<StickyStore> | undefined) => void;
|
|
32
|
-
destroy: () => void;
|
|
33
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { StickyArgs } from './sticky';
|
|
2
|
-
/**
|
|
3
|
-
* An implementation of stickyness based on `positon: fixed`. Only use when
|
|
4
|
-
* `position: sticky` won't work for you. If `position: sticky` does work for you, use it,
|
|
5
|
-
* it performs better.
|
|
6
|
-
*
|
|
7
|
-
* Reasons `position: sticky` might not work:
|
|
8
|
-
* 1) it cannot work on a thead or tr, only td and th (and non-table elements)
|
|
9
|
-
* 2) it gets confused if any parent elements have an `overflow` set, even `overflow: hidden`
|
|
10
|
-
* 3) it always stays within the boundaries of the closest parent element that has a `position`
|
|
11
|
-
* * use:sticky accepts a `target` element as a parameter, defining the bounding container
|
|
12
|
-
*
|
|
13
|
-
* Note that this implementation gets great animation performance at the cost of extra complexity.
|
|
14
|
-
* It does a lot of work like cloning the element you place it on, placing the cloned element next
|
|
15
|
-
* to yours in the DOM, setting widths to match between them, watching for mutations to keep them
|
|
16
|
-
* in sync, etc. Some of this work may get foiled if you have a complex html/css/js situation.
|
|
17
|
-
*
|
|
18
|
-
* You may also want to try use:sticky. It is based on setting `transform: translateY()` as appropriate,
|
|
19
|
-
* and is less fragile than this. However, it cannot do its work before the scroll on mobile, only after,
|
|
20
|
-
* so it will visually lag a bit on mobile.
|
|
21
|
-
*/
|
|
22
|
-
export declare function stickyfixed(el: HTMLElement, config?: StickyArgs): {
|
|
23
|
-
update: (newConfig?: StickyArgs<import("./sticky").StickyStore> | undefined) => void;
|
|
24
|
-
destroy: () => void;
|
|
25
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as CollapsingTable } from './CollapsingTable.svelte';
|
|
2
|
-
export { default as FocusLock } from './FocusLock.svelte';
|
|
3
|
-
export { default as ConditionalWrapper } from './ConditionalWrapper.svelte';
|
|
4
|
-
export { default as Modal } from './Modal.svelte';
|
|
5
|
-
export { default as PopupMenu } from './PopupMenu.svelte';
|
|
6
|
-
export { default as ScreenReaderOnly } from './ScreenReaderOnly.svelte';
|
package/dist/ts/index.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Writable } from 'svelte/store';
|
|
2
|
-
export interface UsableSubject<T> {
|
|
3
|
-
subscribe: (observer: (value: T) => void) => () => void;
|
|
4
|
-
}
|
|
5
|
-
export interface WritableSubject<T> extends UsableSubject<T> {
|
|
6
|
-
update: (updater: (value: T) => T) => void;
|
|
7
|
-
}
|
|
8
|
-
export interface SettableSubject<T> extends WritableSubject<T> {
|
|
9
|
-
set: (value: T) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function isUsable<T>(value: T | UsableSubject<T> | undefined): value is UsableSubject<T>;
|
|
12
|
-
export declare function isWritable<T>(value: T | UsableSubject<T> | undefined): value is WritableSubject<T>;
|
|
13
|
-
export declare function isSettable<T>(value: T | UsableSubject<T> | undefined): value is SettableSubject<T>;
|
|
14
|
-
/**
|
|
15
|
-
* An alternative to svelte's "writable" that does not check equality before notifying
|
|
16
|
-
* subscribers. A writable will notify subscribers after a shallow equality check, which
|
|
17
|
-
* does not work with mutated states:
|
|
18
|
-
* store.update(v => { v.someprop = 'newvalue'; return v })
|
|
19
|
-
*
|
|
20
|
-
* With a writable, this line would NOT notify subscribers because the state will be compared
|
|
21
|
-
* against itself and always found to be equal.
|
|
22
|
-
*
|
|
23
|
-
* An alternative to this store type is SafeStore, which will do a deep equality check but
|
|
24
|
-
* clone data so that it is safe against mutations. It costs more CPU cycles but results in
|
|
25
|
-
* fewer notifications to subscribers which could be an overall win.
|
|
26
|
-
*/
|
|
27
|
-
export declare class ActiveStore<T> implements Writable<T> {
|
|
28
|
-
protected value: T;
|
|
29
|
-
protected subscribers: Map<string, (s: T) => void>;
|
|
30
|
-
private cleanups;
|
|
31
|
-
private sourceInits;
|
|
32
|
-
constructor(value: T);
|
|
33
|
-
clone(value: T): T;
|
|
34
|
-
equal(a: T, b: T): boolean;
|
|
35
|
-
set(value: T): void;
|
|
36
|
-
update(updater: (value: T) => T): void;
|
|
37
|
-
subscribe(run: (s: T) => any): () => void;
|
|
38
|
-
/**
|
|
39
|
-
* Provided as a last ditch avenue to clean up memory after rogue subscribers forget
|
|
40
|
-
* to unsubscribe themselves. For example, in an SSR environment one could clear out
|
|
41
|
-
* global stores anytime a request finishes and no other requests are being processed.
|
|
42
|
-
*/
|
|
43
|
-
clearSubscribers(): void;
|
|
44
|
-
/**
|
|
45
|
-
* Stores that subscribe to external events should set it up with a start/stop mentality
|
|
46
|
-
* so that the external events can be unsubscribed when the store itself has no listeners
|
|
47
|
-
* to notify. This helps ensure unused stores can be garbage collected.
|
|
48
|
-
*
|
|
49
|
-
* To do this, pass registerSource a function that initializes the subscription to the external
|
|
50
|
-
* event, and returns a function that can unsubscribe from the external event. This parent
|
|
51
|
-
* class will take care of running those functions at appropriate times.
|
|
52
|
-
*/
|
|
53
|
-
protected registerSource(fn: () => () => void): void;
|
|
54
|
-
/**
|
|
55
|
-
* Provided in case a child class has a need to change out the external resources
|
|
56
|
-
*/
|
|
57
|
-
protected unregisterSources(): void;
|
|
58
|
-
private subscribeToSources;
|
|
59
|
-
private unsubscribeFromSources;
|
|
60
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare function bodyOffset(ele: HTMLElement): {
|
|
2
|
-
right: number;
|
|
3
|
-
bottom: number;
|
|
4
|
-
top: number;
|
|
5
|
-
left: number;
|
|
6
|
-
};
|
|
7
|
-
export declare function targetOffset(ele: HTMLElement, target: HTMLElement): {
|
|
8
|
-
right: number;
|
|
9
|
-
bottom: number;
|
|
10
|
-
top: number;
|
|
11
|
-
left: number;
|
|
12
|
-
};
|
|
13
|
-
export declare function sharedOffsetParent(a: HTMLElement, b: HTMLElement): HTMLElement | undefined;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Store } from './store';
|
|
2
|
-
import { UsableSubject } from './activestore';
|
|
3
|
-
/**
|
|
4
|
-
* A store that allows you to pass in a traditional svelte store in the constructor.
|
|
5
|
-
*
|
|
6
|
-
* Updates to the original store will be sent to subscribers of this store, but only after a deep equality check.
|
|
7
|
-
*
|
|
8
|
-
* Updates to this store will also be sent to the original store after a deep equality check.
|
|
9
|
-
*/
|
|
10
|
-
export declare class ConvertedStore<T> extends Store<T> {
|
|
11
|
-
private valueStore;
|
|
12
|
-
private pause;
|
|
13
|
-
constructor(value: UsableSubject<T>);
|
|
14
|
-
set(value: T): void;
|
|
15
|
-
}
|
|
16
|
-
export declare function convertStore<T>(store: UsableSubject<T>): ConvertedStore<T>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Store } from './store';
|
|
2
|
-
import { UsableSubject } from './activestore';
|
|
3
|
-
export interface DerivedStoreOptions {
|
|
4
|
-
debounce?: number | boolean;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Watch one or more parent stores for changes. Each time, run a function to derive
|
|
8
|
-
* a new state from the parent state(s). Subscribers will only be notified if the
|
|
9
|
-
* derived state has changed (uses fast-deep-equal).
|
|
10
|
-
*
|
|
11
|
-
* If only one parent store, it's possible to use a dot-prop string as the getter.
|
|
12
|
-
*/
|
|
13
|
-
export declare class DerivedStore<DerivedType, ParentType = any> extends Store<DerivedType> {
|
|
14
|
-
constructor(store: UsableSubject<ParentType> | UsableSubject<any>[], getter: string | ((value: any) => DerivedType) | ((values: any[]) => DerivedType), options?: DerivedStoreOptions);
|
|
15
|
-
}
|
|
16
|
-
export declare function derivedStore<DerivedType, ParentType, A extends keyof ParentType>(store: UsableSubject<ParentType>, accessor: A, options?: DerivedStoreOptions): DerivedStore<ParentType[A], ParentType>;
|
|
17
|
-
export declare function derivedStore<DerivedType, ParentType = any>(store: UsableSubject<ParentType>, accessor: string, options?: DerivedStoreOptions): DerivedStore<DerivedType, ParentType>;
|
|
18
|
-
export declare function derivedStore<DerivedType, ParentType>(store: UsableSubject<ParentType>, getter: (value: ParentType) => DerivedType, options?: DerivedStoreOptions): DerivedStore<DerivedType, ParentType>;
|
|
19
|
-
export declare function derivedStore<DerivedType, T1, T2>(store: [UsableSubject<T1>, UsableSubject<T2>], getter: (value: [T1, T2]) => DerivedType, options?: DerivedStoreOptions): DerivedStore<DerivedType>;
|
|
20
|
-
export declare function derivedStore<DerivedType, T1, T2, T3>(store: [UsableSubject<T1>, UsableSubject<T2>, UsableSubject<T3>], getter: (value: [T1, T2, T3]) => DerivedType, options?: DerivedStoreOptions): DerivedStore<DerivedType>;
|
|
21
|
-
export declare function derivedStore<DerivedType, T1, T2, T3, T4>(store: [UsableSubject<T1>, UsableSubject<T2>, UsableSubject<T3>, UsableSubject<T4>], getter: (value: [T1, T2, T3, T4]) => DerivedType, options?: DerivedStoreOptions): DerivedStore<DerivedType>;
|
|
22
|
-
export declare function derivedStore<DerivedType, T1, T2, T3, T4, T5>(store: [UsableSubject<T1>, UsableSubject<T2>, UsableSubject<T3>, UsableSubject<T4>, UsableSubject<T5>], getter: (value: [T1, T2, T3, T4, T5]) => DerivedType, options?: DerivedStoreOptions): DerivedStore<DerivedType>;
|
|
23
|
-
export declare function derivedStore<DerivedType>(store: UsableSubject<any>[], getter: (value: any[]) => DerivedType, options?: DerivedStoreOptions): DerivedStore<DerivedType>;
|
package/dist/ts/lib/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './bodyoffset';
|
|
2
|
-
export * from './convertedstore';
|
|
3
|
-
export * from './derivedstore';
|
|
4
|
-
export * from './activestore';
|
|
5
|
-
export * from './repositioned';
|
|
6
|
-
export * from './safestore';
|
|
7
|
-
export * from './store';
|
|
8
|
-
export * from './substore';
|
|
9
|
-
export * from './util';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { bodyOffset } from './bodyoffset';
|
|
2
|
-
export declare type ElementOffsets = Partial<ReturnType<typeof bodyOffset>>;
|
|
3
|
-
export declare function watchForMutations(cb: () => void): {
|
|
4
|
-
destroy(): void;
|
|
5
|
-
};
|
|
6
|
-
export declare function watchForPositionChange(el: (HTMLElement | undefined)[] | HTMLElement | undefined, cb: ((offset: Required<ElementOffsets>) => void) | ((offsets: Required<ElementOffsets>[]) => void)): {
|
|
7
|
-
update(newEl: (HTMLElement | undefined)[] | HTMLElement | undefined, newCb: ((offset: Required<ElementOffsets>) => void) | ((offsets: Required<ElementOffsets>[]) => void)): void;
|
|
8
|
-
destroy: () => void;
|
|
9
|
-
};
|
|
10
|
-
export declare function watchForPositionChangeInContainer(el: HTMLElement | undefined, container: HTMLElement | undefined, cb: (offset: Required<ElementOffsets>) => void): {
|
|
11
|
-
update(newEl: HTMLElement | undefined, newContainer: HTMLElement | undefined, newCb: (offset: Required<ElementOffsets>) => void): void;
|
|
12
|
-
destroy: () => void;
|
|
13
|
-
};
|
package/dist/ts/lib/store.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ActiveStore } from './activestore';
|
|
2
|
-
/**
|
|
3
|
-
* An alternative to svelte's "writable" that also checks deep equality (fast-deep-equal) before
|
|
4
|
-
* notifying subscribers. A writable will notify subscribers after a shallow equality check, which
|
|
5
|
-
* only works for scalars.
|
|
6
|
-
*
|
|
7
|
-
* Note that this strategy is weak against mutable state updates:
|
|
8
|
-
* store.update(v => { v.someprop = 'newvalue'; return v })
|
|
9
|
-
*
|
|
10
|
-
* This line would NOT notify subscribers because the state will be compared against
|
|
11
|
-
* itself and always found to be equal. If you are making updates in a mutable fashion,
|
|
12
|
-
* use a SafeStore instead.
|
|
13
|
-
*/
|
|
14
|
-
export declare class Store<T> extends ActiveStore<T> {
|
|
15
|
-
equal(a: T, b: T): boolean;
|
|
16
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Store } from './store';
|
|
2
|
-
import { WritableSubject } from './activestore';
|
|
3
|
-
/**
|
|
4
|
-
* Create a store that represents a part of a larger store. Updates to the parent store will propagate
|
|
5
|
-
* down to the SubStore as appropriate, and updates to the SubStore will propagate
|
|
6
|
-
* back up to the parent store. This requires both a getter and setter function to handle each
|
|
7
|
-
* direction. The setter is given the new SubStore state and the existing parent store state and
|
|
8
|
-
* should return a new state for the parent store.
|
|
9
|
-
*
|
|
10
|
-
* Alternatively, a dot-prop string can be provided and both the getter and setter will be automatically
|
|
11
|
-
* generated. For example, a parent store containing state { deep: { value: 'here' }, hello: 'world' }
|
|
12
|
-
* could be used with the getter string "deep.value". The SubStore's initial state would be "here", and
|
|
13
|
-
* updating it to "there" would update the parent store state to { deep: { value: 'there' }, hello: 'world' }
|
|
14
|
-
*/
|
|
15
|
-
export declare class SubStore<SubType, ParentType = any> extends Store<SubType> {
|
|
16
|
-
protected parentStore: WritableSubject<ParentType>;
|
|
17
|
-
protected setter: (value: SubType, state: ParentType) => ParentType;
|
|
18
|
-
constructor(store: WritableSubject<ParentType>, getter: keyof ParentType | string | ((value: ParentType) => SubType), setter?: (value: SubType, state: ParentType) => ParentType);
|
|
19
|
-
set(value: SubType): void;
|
|
20
|
-
clone(state: SubType): any;
|
|
21
|
-
}
|
|
22
|
-
export declare function subStore<SubType, ParentType, A extends keyof ParentType>(store: WritableSubject<ParentType>, accessor: A): SubStore<ParentType[A], ParentType>;
|
|
23
|
-
export declare function subStore<SubType, ParentType = any>(store: WritableSubject<ParentType>, accessor: string): SubStore<SubType, ParentType>;
|
|
24
|
-
export declare function subStore<SubType, ParentType>(store: WritableSubject<ParentType>, getter: (value: ParentType) => SubType, setter: (value: SubType, state: ParentType) => ParentType): SubStore<SubType, ParentType>;
|
package/dist/ts/lib/util.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/ts/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsingTable.js","sourceRoot":"","sources":["../../src/types/CollapsingTable.ts"],"names":[],"mappings":""}
|
package/dist/types/PopupMenu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopupMenu.js","sourceRoot":"","sources":["../../src/types/PopupMenu.ts"],"names":[],"mappings":""}
|
package/dist/types/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./CollapsingTable"), exports);
|
|
14
|
-
__exportStar(require("./PopupMenu"), exports);
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiC;AACjC,8CAA2B"}
|
package/esm/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/index'
|
package/esm/package.json
DELETED