svelte-ag 0.0.2-dev.72
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/README.md +6 -0
- package/dist/app.css +209 -0
- package/dist/app.d.ts +13 -0
- package/dist/app.html +12 -0
- package/dist/icons.css +6 -0
- package/dist/lib/bits/internal/arrays.d.ts +95 -0
- package/dist/lib/bits/internal/arrays.js +250 -0
- package/dist/lib/bits/internal/arrays.test.d.ts +1 -0
- package/dist/lib/bits/internal/arrays.test.js +366 -0
- package/dist/lib/bits/internal/attrs.d.ts +22 -0
- package/dist/lib/bits/internal/attrs.js +69 -0
- package/dist/lib/bits/internal/box-auto-reset.svelte.d.ts +8 -0
- package/dist/lib/bits/internal/box-auto-reset.svelte.js +31 -0
- package/dist/lib/bits/internal/box.svelte.d.ts +21 -0
- package/dist/lib/bits/internal/box.svelte.js +26 -0
- package/dist/lib/bits/internal/clamp.d.ts +4 -0
- package/dist/lib/bits/internal/clamp.js +6 -0
- package/dist/lib/bits/internal/clamp.test.d.ts +1 -0
- package/dist/lib/bits/internal/clamp.test.js +31 -0
- package/dist/lib/bits/internal/create-event-hook.svelte.d.ts +18 -0
- package/dist/lib/bits/internal/create-event-hook.svelte.js +29 -0
- package/dist/lib/bits/internal/create-shared-hook.svelte.d.ts +2 -0
- package/dist/lib/bits/internal/create-shared-hook.svelte.js +27 -0
- package/dist/lib/bits/internal/date-time/announcer.d.ts +7 -0
- package/dist/lib/bits/internal/date-time/announcer.js +82 -0
- package/dist/lib/bits/internal/date-time/calendar-helpers.svelte.d.ts +201 -0
- package/dist/lib/bits/internal/date-time/calendar-helpers.svelte.js +510 -0
- package/dist/lib/bits/internal/date-time/field/helpers.d.ts +76 -0
- package/dist/lib/bits/internal/date-time/field/helpers.js +378 -0
- package/dist/lib/bits/internal/date-time/field/parts.d.ts +6 -0
- package/dist/lib/bits/internal/date-time/field/parts.js +9 -0
- package/dist/lib/bits/internal/date-time/field/segments.d.ts +51 -0
- package/dist/lib/bits/internal/date-time/field/segments.js +128 -0
- package/dist/lib/bits/internal/date-time/field/types.d.ts +25 -0
- package/dist/lib/bits/internal/date-time/field/types.js +1 -0
- package/dist/lib/bits/internal/date-time/formatter.d.ts +24 -0
- package/dist/lib/bits/internal/date-time/formatter.js +97 -0
- package/dist/lib/bits/internal/date-time/placeholders.d.ts +8 -0
- package/dist/lib/bits/internal/date-time/placeholders.js +129 -0
- package/dist/lib/bits/internal/date-time/utils.d.ts +69 -0
- package/dist/lib/bits/internal/date-time/utils.js +212 -0
- package/dist/lib/bits/internal/debounce.d.ts +4 -0
- package/dist/lib/bits/internal/debounce.js +19 -0
- package/dist/lib/bits/internal/debounce.test.d.ts +1 -0
- package/dist/lib/bits/internal/debounce.test.js +50 -0
- package/dist/lib/bits/internal/dom.d.ts +10 -0
- package/dist/lib/bits/internal/dom.js +38 -0
- package/dist/lib/bits/internal/elements.d.ts +2 -0
- package/dist/lib/bits/internal/elements.js +6 -0
- package/dist/lib/bits/internal/events.d.ts +21 -0
- package/dist/lib/bits/internal/events.js +49 -0
- package/dist/lib/bits/internal/floating-svelte/floating-utils.svelte.d.ts +7 -0
- package/dist/lib/bits/internal/floating-svelte/floating-utils.svelte.js +24 -0
- package/dist/lib/bits/internal/floating-svelte/types.d.ts +85 -0
- package/dist/lib/bits/internal/floating-svelte/types.js +1 -0
- package/dist/lib/bits/internal/floating-svelte/use-floating.svelte.d.ts +2 -0
- package/dist/lib/bits/internal/floating-svelte/use-floating.svelte.js +112 -0
- package/dist/lib/bits/internal/focus.d.ts +46 -0
- package/dist/lib/bits/internal/focus.js +109 -0
- package/dist/lib/bits/internal/get-directional-keys.d.ts +21 -0
- package/dist/lib/bits/internal/get-directional-keys.js +37 -0
- package/dist/lib/bits/internal/get-directional-keys.test.d.ts +1 -0
- package/dist/lib/bits/internal/get-directional-keys.test.js +46 -0
- package/dist/lib/bits/internal/is.d.ts +25 -0
- package/dist/lib/bits/internal/is.js +62 -0
- package/dist/lib/bits/internal/is.test.d.ts +1 -0
- package/dist/lib/bits/internal/is.test.js +34 -0
- package/dist/lib/bits/internal/kbd-constants.d.ts +40 -0
- package/dist/lib/bits/internal/kbd-constants.js +40 -0
- package/dist/lib/bits/internal/kbd.d.ts +1 -0
- package/dist/lib/bits/internal/kbd.js +1 -0
- package/dist/lib/bits/internal/locale.d.ts +6 -0
- package/dist/lib/bits/internal/locale.js +9 -0
- package/dist/lib/bits/internal/math.d.ts +5 -0
- package/dist/lib/bits/internal/math.js +43 -0
- package/dist/lib/bits/internal/math.test.d.ts +1 -0
- package/dist/lib/bits/internal/math.test.js +71 -0
- package/dist/lib/bits/internal/noop.d.ts +4 -0
- package/dist/lib/bits/internal/noop.js +4 -0
- package/dist/lib/bits/internal/should-trap-focus.d.ts +6 -0
- package/dist/lib/bits/internal/should-trap-focus.js +6 -0
- package/dist/lib/bits/internal/sleep.d.ts +1 -0
- package/dist/lib/bits/internal/sleep.js +3 -0
- package/dist/lib/bits/internal/tabbable.d.ts +10 -0
- package/dist/lib/bits/internal/tabbable.js +66 -0
- package/dist/lib/bits/internal/types.d.ts +92 -0
- package/dist/lib/bits/internal/types.js +1 -0
- package/dist/lib/bits/internal/use-after-animations.svelte.d.ts +5 -0
- package/dist/lib/bits/internal/use-after-animations.svelte.js +27 -0
- package/dist/lib/bits/internal/use-arrow-navigation.d.ts +62 -0
- package/dist/lib/bits/internal/use-arrow-navigation.js +76 -0
- package/dist/lib/bits/internal/use-body-scroll-lock.svelte.d.ts +6 -0
- package/dist/lib/bits/internal/use-body-scroll-lock.svelte.js +106 -0
- package/dist/lib/bits/internal/use-data-typeahead.svelte.d.ts +14 -0
- package/dist/lib/bits/internal/use-data-typeahead.svelte.js +31 -0
- package/dist/lib/bits/internal/use-dom-typeahead.svelte.d.ts +11 -0
- package/dist/lib/bits/internal/use-dom-typeahead.svelte.js +30 -0
- package/dist/lib/bits/internal/use-form-control.svelte.d.ts +4 -0
- package/dist/lib/bits/internal/use-form-control.svelte.js +16 -0
- package/dist/lib/bits/internal/use-grace-area.svelte.d.ts +12 -0
- package/dist/lib/bits/internal/use-grace-area.svelte.js +197 -0
- package/dist/lib/bits/internal/use-id.d.ts +4 -0
- package/dist/lib/bits/internal/use-id.js +8 -0
- package/dist/lib/bits/internal/use-resize-observer.svelte.d.ts +2 -0
- package/dist/lib/bits/internal/use-resize-observer.svelte.js +17 -0
- package/dist/lib/bits/internal/use-roving-focus.svelte.d.ts +38 -0
- package/dist/lib/bits/internal/use-roving-focus.svelte.js +91 -0
- package/dist/lib/bits/internal/use-size.svelte.d.ts +7 -0
- package/dist/lib/bits/internal/use-size.svelte.js +54 -0
- package/dist/lib/bits/internal/use-state-machine.svelte.d.ts +24 -0
- package/dist/lib/bits/internal/use-state-machine.svelte.js +28 -0
- package/dist/lib/bits/internal/use-timeout-fn.svelte.d.ts +25 -0
- package/dist/lib/bits/internal/use-timeout-fn.svelte.js +39 -0
- package/dist/lib/components/Typeahead.svelte.d.ts +47 -0
- package/dist/lib/components/Typeahead.svelte.js +150 -0
- package/dist/lib/components/animated/animated.svelte +244 -0
- package/dist/lib/components/animated/animated.svelte.d.ts +61 -0
- package/dist/lib/components/animated/index.d.ts +2 -0
- package/dist/lib/components/animated/index.js +2 -0
- package/dist/lib/components/combo/combo.svelte +186 -0
- package/dist/lib/components/combo/combo.svelte.d.ts +21 -0
- package/dist/lib/components/combo/index.d.ts +2 -0
- package/dist/lib/components/combo/index.js +2 -0
- package/dist/lib/components/dnd/Droppable.svelte +25 -0
- package/dist/lib/components/dnd/Droppable.svelte.d.ts +10 -0
- package/dist/lib/components/dnd/context.svelte.d.ts +22 -0
- package/dist/lib/components/dnd/context.svelte.js +25 -0
- package/dist/lib/components/dnd/dnd-context.svelte +45 -0
- package/dist/lib/components/dnd/dnd-context.svelte.d.ts +30 -0
- package/dist/lib/components/dnd/dnd-drag-overlay.svelte +44 -0
- package/dist/lib/components/dnd/dnd-drag-overlay.svelte.d.ts +27 -0
- package/dist/lib/components/dnd/dnd-drag-placeholder.svelte +24 -0
- package/dist/lib/components/dnd/dnd-drag-placeholder.svelte.d.ts +9 -0
- package/dist/lib/components/dnd/dnd-draghandle.svelte +30 -0
- package/dist/lib/components/dnd/dnd-draghandle.svelte.d.ts +6 -0
- package/dist/lib/components/dnd/dnd-overlay.svelte +0 -0
- package/dist/lib/components/dnd/dnd-overlay.svelte.d.ts +26 -0
- package/dist/lib/components/dnd/dnd-sortable-context.svelte +18 -0
- package/dist/lib/components/dnd/dnd-sortable-context.svelte.d.ts +8 -0
- package/dist/lib/components/dnd/dnd-sortable-item.svelte +68 -0
- package/dist/lib/components/dnd/dnd-sortable-item.svelte.d.ts +23 -0
- package/dist/lib/components/dnd/example.svelte +109 -0
- package/dist/lib/components/dnd/example.svelte.d.ts +3 -0
- package/dist/lib/components/dnd/exports.d.ts +9 -0
- package/dist/lib/components/dnd/exports.js +9 -0
- package/dist/lib/components/dnd/index.d.ts +1 -0
- package/dist/lib/components/dnd/index.js +1 -0
- package/dist/lib/components/dnd/sortable.svelte.d.ts +13 -0
- package/dist/lib/components/dnd/sortable.svelte.js +70 -0
- package/dist/lib/components/dnd/utils.svelte.d.ts +20 -0
- package/dist/lib/components/dnd/utils.svelte.js +20 -0
- package/dist/lib/components/search/combinations/searchPopover.svelte +68 -0
- package/dist/lib/components/search/combinations/searchPopover.svelte.d.ts +22 -0
- package/dist/lib/components/search/components/search-empty.svelte +28 -0
- package/dist/lib/components/search/components/search-empty.svelte.d.ts +4 -0
- package/dist/lib/components/search/components/search-input.svelte +53 -0
- package/dist/lib/components/search/components/search-input.svelte.d.ts +4 -0
- package/dist/lib/components/search/components/search-list.svelte +46 -0
- package/dist/lib/components/search/components/search-list.svelte.d.ts +4 -0
- package/dist/lib/components/search/components/search-pagnation.svelte +68 -0
- package/dist/lib/components/search/components/search-pagnation.svelte.d.ts +8 -0
- package/dist/lib/components/search/components/search.svelte +47 -0
- package/dist/lib/components/search/components/search.svelte.d.ts +4 -0
- package/dist/lib/components/search/exports.d.ts +6 -0
- package/dist/lib/components/search/exports.js +5 -0
- package/dist/lib/components/search/index.d.ts +2 -0
- package/dist/lib/components/search/index.js +2 -0
- package/dist/lib/components/search/search.svelte.d.ts +102 -0
- package/dist/lib/components/search/search.svelte.js +202 -0
- package/dist/lib/components/search/types.d.ts +28 -0
- package/dist/lib/components/search/types.js +1 -0
- package/dist/lib/components/utilities/arrow/arrow.svelte +23 -0
- package/dist/lib/components/utilities/arrow/arrow.svelte.d.ts +3 -0
- package/dist/lib/components/utilities/arrow/index.d.ts +2 -0
- package/dist/lib/components/utilities/arrow/index.js +1 -0
- package/dist/lib/components/utilities/arrow/types.d.ts +17 -0
- package/dist/lib/components/utilities/arrow/types.js +1 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer-anchor.svelte +15 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer-anchor.svelte.d.ts +4 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer-arrow.svelte +20 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer-arrow.svelte.d.ts +3 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer-content-static.svelte +19 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer-content-static.svelte.d.ts +13 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer-content.svelte +61 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer-content.svelte.d.ts +4 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer.svelte +10 -0
- package/dist/lib/components/utilities/floating-layer/components/floating-layer.svelte.d.ts +7 -0
- package/dist/lib/components/utilities/floating-layer/components/index.d.ts +6 -0
- package/dist/lib/components/utilities/floating-layer/components/index.js +5 -0
- package/dist/lib/components/utilities/floating-layer/index.d.ts +1 -0
- package/dist/lib/components/utilities/floating-layer/index.js +1 -0
- package/dist/lib/components/utilities/floating-layer/types.d.ts +115 -0
- package/dist/lib/components/utilities/floating-layer/types.js +1 -0
- package/dist/lib/components/utilities/floating-layer/use-floating-layer.svelte.d.ts +118 -0
- package/dist/lib/components/utilities/floating-layer/use-floating-layer.svelte.js +311 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/utils/asyncDerived.svelte.d.ts +12 -0
- package/dist/lib/utils/asyncDerived.svelte.js +26 -0
- package/dist/lib/utils/bits.d.ts +39 -0
- package/dist/lib/utils/bits.js +69 -0
- package/dist/lib/utils/index.d.ts +3 -0
- package/dist/lib/utils/index.js +3 -0
- package/dist/lib/utils/utils.d.ts +21 -0
- package/dist/lib/utils/utils.js +72 -0
- package/dist/routes/+layout.svelte +0 -0
- package/dist/routes/+layout.svelte.d.ts +26 -0
- package/package.json +79 -0
- package/src/app.css +209 -0
- package/src/app.d.ts +13 -0
- package/src/app.html +12 -0
- package/src/icons.css +6 -0
- package/src/lib/bits/internal/arrays.test.ts +460 -0
- package/src/lib/bits/internal/arrays.ts +301 -0
- package/src/lib/bits/internal/attrs.ts +97 -0
- package/src/lib/bits/internal/box-auto-reset.svelte.ts +40 -0
- package/src/lib/bits/internal/box.svelte.ts +60 -0
- package/src/lib/bits/internal/clamp.test.ts +37 -0
- package/src/lib/bits/internal/clamp.ts +6 -0
- package/src/lib/bits/internal/create-event-hook.svelte.ts +64 -0
- package/src/lib/bits/internal/create-shared-hook.svelte.ts +33 -0
- package/src/lib/bits/internal/date-time/announcer.ts +88 -0
- package/src/lib/bits/internal/date-time/calendar-helpers.svelte.ts +815 -0
- package/src/lib/bits/internal/date-time/field/helpers.ts +441 -0
- package/src/lib/bits/internal/date-time/field/parts.ts +9 -0
- package/src/lib/bits/internal/date-time/field/segments.ts +126 -0
- package/src/lib/bits/internal/date-time/field/types.ts +35 -0
- package/src/lib/bits/internal/date-time/formatter.ts +116 -0
- package/src/lib/bits/internal/date-time/placeholders.ts +143 -0
- package/src/lib/bits/internal/date-time/utils.ts +261 -0
- package/src/lib/bits/internal/debounce.test.ts +67 -0
- package/src/lib/bits/internal/debounce.ts +22 -0
- package/src/lib/bits/internal/dom.ts +47 -0
- package/src/lib/bits/internal/elements.ts +7 -0
- package/src/lib/bits/internal/events.ts +89 -0
- package/src/lib/bits/internal/floating-svelte/floating-utils.svelte.ts +28 -0
- package/src/lib/bits/internal/floating-svelte/types.ts +108 -0
- package/src/lib/bits/internal/floating-svelte/use-floating.svelte.ts +133 -0
- package/src/lib/bits/internal/focus.ts +111 -0
- package/src/lib/bits/internal/get-directional-keys.test.ts +51 -0
- package/src/lib/bits/internal/get-directional-keys.ts +43 -0
- package/src/lib/bits/internal/is.test.ts +40 -0
- package/src/lib/bits/internal/is.ts +78 -0
- package/src/lib/bits/internal/kbd-constants.ts +40 -0
- package/src/lib/bits/internal/kbd.ts +1 -0
- package/src/lib/bits/internal/locale.ts +13 -0
- package/src/lib/bits/internal/math.test.ts +88 -0
- package/src/lib/bits/internal/math.ts +50 -0
- package/src/lib/bits/internal/noop.ts +4 -0
- package/src/lib/bits/internal/should-trap-focus.ts +16 -0
- package/src/lib/bits/internal/sleep.ts +3 -0
- package/src/lib/bits/internal/tabbable.ts +76 -0
- package/src/lib/bits/internal/types.ts +91 -0
- package/src/lib/bits/internal/use-after-animations.svelte.ts +30 -0
- package/src/lib/bits/internal/use-arrow-navigation.ts +168 -0
- package/src/lib/bits/internal/use-body-scroll-lock.svelte.ts +138 -0
- package/src/lib/bits/internal/use-data-typeahead.svelte.ts +44 -0
- package/src/lib/bits/internal/use-dom-typeahead.svelte.ts +44 -0
- package/src/lib/bits/internal/use-form-control.svelte.ts +17 -0
- package/src/lib/bits/internal/use-grace-area.svelte.ts +229 -0
- package/src/lib/bits/internal/use-id.ts +9 -0
- package/src/lib/bits/internal/use-resize-observer.svelte.ts +19 -0
- package/src/lib/bits/internal/use-roving-focus.svelte.ts +141 -0
- package/src/lib/bits/internal/use-size.svelte.ts +60 -0
- package/src/lib/bits/internal/use-state-machine.svelte.ts +46 -0
- package/src/lib/bits/internal/use-timeout-fn.svelte.ts +80 -0
- package/src/lib/components/Typeahead.svelte.ts +200 -0
- package/src/lib/components/animated/animated.svelte +244 -0
- package/src/lib/components/animated/index.ts +3 -0
- package/src/lib/components/combo/combo.svelte +186 -0
- package/src/lib/components/combo/index.ts +3 -0
- package/src/lib/components/dnd/Droppable.svelte +25 -0
- package/src/lib/components/dnd/context.svelte.ts +30 -0
- package/src/lib/components/dnd/dnd-context.svelte +45 -0
- package/src/lib/components/dnd/dnd-drag-overlay.svelte +44 -0
- package/src/lib/components/dnd/dnd-drag-placeholder.svelte +24 -0
- package/src/lib/components/dnd/dnd-draghandle.svelte +30 -0
- package/src/lib/components/dnd/dnd-overlay.svelte +0 -0
- package/src/lib/components/dnd/dnd-sortable-context.svelte +18 -0
- package/src/lib/components/dnd/dnd-sortable-item.svelte +68 -0
- package/src/lib/components/dnd/example.svelte +109 -0
- package/src/lib/components/dnd/exports.ts +12 -0
- package/src/lib/components/dnd/index.ts +1 -0
- package/src/lib/components/dnd/sortable.svelte.ts +82 -0
- package/src/lib/components/dnd/utils.svelte.ts +29 -0
- package/src/lib/components/search/combinations/searchPopover.svelte +68 -0
- package/src/lib/components/search/components/search-empty.svelte +28 -0
- package/src/lib/components/search/components/search-input.svelte +53 -0
- package/src/lib/components/search/components/search-list.svelte +46 -0
- package/src/lib/components/search/components/search-pagnation.svelte +68 -0
- package/src/lib/components/search/components/search.svelte +47 -0
- package/src/lib/components/search/exports.ts +13 -0
- package/src/lib/components/search/index.ts +2 -0
- package/src/lib/components/search/search.svelte.ts +286 -0
- package/src/lib/components/search/types.ts +48 -0
- package/src/lib/components/utilities/arrow/arrow.svelte +23 -0
- package/src/lib/components/utilities/arrow/index.ts +2 -0
- package/src/lib/components/utilities/arrow/types.ts +20 -0
- package/src/lib/components/utilities/floating-layer/components/floating-layer-anchor.svelte +15 -0
- package/src/lib/components/utilities/floating-layer/components/floating-layer-arrow.svelte +20 -0
- package/src/lib/components/utilities/floating-layer/components/floating-layer-content-static.svelte +19 -0
- package/src/lib/components/utilities/floating-layer/components/floating-layer-content.svelte +61 -0
- package/src/lib/components/utilities/floating-layer/components/floating-layer.svelte +10 -0
- package/src/lib/components/utilities/floating-layer/components/index.ts +11 -0
- package/src/lib/components/utilities/floating-layer/index.ts +1 -0
- package/src/lib/components/utilities/floating-layer/types.ts +133 -0
- package/src/lib/components/utilities/floating-layer/use-floating-layer.svelte.ts +406 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/utils/asyncDerived.svelte.ts +38 -0
- package/src/lib/utils/bits.ts +93 -0
- package/src/lib/utils/index.ts +3 -0
- package/src/lib/utils/utils.ts +97 -0
- package/src/routes/+layout.svelte +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Root } from './components/search.svelte';
|
|
2
|
+
export { default as Input } from './components/search-input.svelte';
|
|
3
|
+
export { default as List } from './components/search-list.svelte';
|
|
4
|
+
export { default as Empty } from './components/search-empty.svelte';
|
|
5
|
+
export { default as Pagnation } from './components/search-pagnation.svelte';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type ReadableBoxedValues, type WithRefProps, type WritableBoxedValues } from 'svelte-toolbelt';
|
|
2
|
+
import type { Item } from './types';
|
|
3
|
+
export type SearchRootStateProps = WithRefProps<ReadableBoxedValues<{
|
|
4
|
+
items: Item[];
|
|
5
|
+
searchWith?: string;
|
|
6
|
+
search?: (term: string) => Promise<Item[]>;
|
|
7
|
+
}> & WritableBoxedValues<{
|
|
8
|
+
value: Item;
|
|
9
|
+
}>>;
|
|
10
|
+
export declare class SearchRootState {
|
|
11
|
+
readonly opts: SearchRootStateProps;
|
|
12
|
+
searchState: {
|
|
13
|
+
value: string;
|
|
14
|
+
sortedList: (Item & {
|
|
15
|
+
score?: number;
|
|
16
|
+
})[];
|
|
17
|
+
showSuggestions: boolean;
|
|
18
|
+
};
|
|
19
|
+
numPerPage: number;
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
inputRef: HTMLInputElement | null;
|
|
24
|
+
debounceTimer: number | null;
|
|
25
|
+
constructor(opts: SearchRootStateProps);
|
|
26
|
+
/**
|
|
27
|
+
* This function needs to update the sorted list of items based on the search term.
|
|
28
|
+
*/
|
|
29
|
+
search(): Promise<void>;
|
|
30
|
+
getFilteredList(): (Item & {
|
|
31
|
+
score?: number;
|
|
32
|
+
})[];
|
|
33
|
+
props: {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly "data-search-root": "";
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export type SearchInputStateProps = WithRefProps<WritableBoxedValues<{
|
|
39
|
+
value: string;
|
|
40
|
+
}>>;
|
|
41
|
+
export declare class SearchInputState {
|
|
42
|
+
readonly opts: SearchInputStateProps;
|
|
43
|
+
readonly root: SearchRootState;
|
|
44
|
+
constructor(opts: SearchInputStateProps, root: SearchRootState);
|
|
45
|
+
onFocus: () => void;
|
|
46
|
+
props: {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly onfocus: () => void;
|
|
49
|
+
readonly "data-search-input": "";
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export type SearchListStateProps = WithRefProps;
|
|
53
|
+
export declare class SearchListState {
|
|
54
|
+
readonly opts: SearchListStateProps;
|
|
55
|
+
readonly root: SearchRootState;
|
|
56
|
+
constructor(opts: SearchListStateProps, root: SearchRootState);
|
|
57
|
+
props: {
|
|
58
|
+
readonly id: string;
|
|
59
|
+
readonly "data-search-list": "";
|
|
60
|
+
};
|
|
61
|
+
get suggestions(): (Item & {
|
|
62
|
+
score?: number;
|
|
63
|
+
})[];
|
|
64
|
+
visible(item: Item & {
|
|
65
|
+
score?: number;
|
|
66
|
+
}): boolean;
|
|
67
|
+
selected(item: Item): boolean;
|
|
68
|
+
select(item: Item): void;
|
|
69
|
+
}
|
|
70
|
+
export type SearchPagnationStateProps = WithRefProps<WritableBoxedValues<{
|
|
71
|
+
page: number;
|
|
72
|
+
perPage: number;
|
|
73
|
+
}>>;
|
|
74
|
+
export declare class SearchPagnationState {
|
|
75
|
+
readonly opts: SearchPagnationStateProps;
|
|
76
|
+
readonly root: SearchRootState;
|
|
77
|
+
constructor(opts: SearchPagnationStateProps, root: SearchRootState);
|
|
78
|
+
props: {
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly "data-search-item": "";
|
|
81
|
+
};
|
|
82
|
+
get length(): number;
|
|
83
|
+
get perPage(): number;
|
|
84
|
+
get activeItems(): (Item & {
|
|
85
|
+
score?: number;
|
|
86
|
+
})[];
|
|
87
|
+
}
|
|
88
|
+
export type SearchEmptyStateProps = WithRefProps;
|
|
89
|
+
export declare class SearchEmptyState {
|
|
90
|
+
readonly opts: SearchEmptyStateProps;
|
|
91
|
+
readonly root: SearchRootState;
|
|
92
|
+
constructor(opts: SearchEmptyStateProps, root: SearchRootState);
|
|
93
|
+
props: {
|
|
94
|
+
readonly id: string;
|
|
95
|
+
readonly "data-search-empty": "";
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export declare function useSearchRoot(props: SearchRootStateProps): SearchRootState;
|
|
99
|
+
export declare function useSearchInput(props: SearchInputStateProps): SearchInputState;
|
|
100
|
+
export declare function useSearchList(props: SearchListStateProps): SearchListState;
|
|
101
|
+
export declare function useSearchPagnation(props: SearchPagnationStateProps): SearchPagnationState;
|
|
102
|
+
export declare function useSearchEmpty(props: SearchEmptyStateProps): SearchEmptyState;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { useRefById } from 'svelte-toolbelt';
|
|
2
|
+
import { Context, watch } from 'runed';
|
|
3
|
+
import { computeCommandScore } from 'bits-ui';
|
|
4
|
+
import { dequal } from 'dequal';
|
|
5
|
+
const SEARCH_ROOT_ATTR = 'data-search-root';
|
|
6
|
+
const SEARCH_INPUT_ATTR = 'data-search-input';
|
|
7
|
+
const SEARCH_LIST_ATTR = 'data-search-list';
|
|
8
|
+
const SEARCH_ITEM_ATTR = 'data-search-item';
|
|
9
|
+
const SEARCH_EMPTY_ATTR = 'data-search-empty';
|
|
10
|
+
export class SearchRootState {
|
|
11
|
+
opts;
|
|
12
|
+
// State
|
|
13
|
+
searchState = $state({
|
|
14
|
+
value: '',
|
|
15
|
+
sortedList: [],
|
|
16
|
+
showSuggestions: false
|
|
17
|
+
});
|
|
18
|
+
numPerPage = $state(0);
|
|
19
|
+
start = $state(0);
|
|
20
|
+
end = $state(0);
|
|
21
|
+
loading = $state(false);
|
|
22
|
+
inputRef = $state(null);
|
|
23
|
+
debounceTimer = $state(null);
|
|
24
|
+
constructor(opts) {
|
|
25
|
+
this.opts = opts;
|
|
26
|
+
useRefById(opts);
|
|
27
|
+
if (opts.items !== null) {
|
|
28
|
+
// Watch for changes in items and update the sorted list
|
|
29
|
+
watch(() => this.opts.items.current, (newItems, oldItems) => {
|
|
30
|
+
if (dequal(newItems, oldItems))
|
|
31
|
+
return;
|
|
32
|
+
this.search();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
watch(() => this.searchState.sortedList, () => {
|
|
36
|
+
this.start = 0;
|
|
37
|
+
});
|
|
38
|
+
watch([() => this.searchState.sortedList, () => this.numPerPage, () => this.start], () => {
|
|
39
|
+
const filteredList = this.getFilteredList();
|
|
40
|
+
this.end = this.numPerPage === 0 ? 0 : Math.min(filteredList.length, this.start + this.numPerPage);
|
|
41
|
+
});
|
|
42
|
+
this.search();
|
|
43
|
+
this.searchState.value = this.opts.value.current.value;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* This function needs to update the sorted list of items based on the search term.
|
|
47
|
+
*/
|
|
48
|
+
async search() {
|
|
49
|
+
if (this.opts.search !== undefined) {
|
|
50
|
+
const func = this.opts.search.current;
|
|
51
|
+
if (func) {
|
|
52
|
+
this.searchState.sortedList = await func(this.searchState.value);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const searchTerm = this.opts.searchWith?.current ?? this.searchState.value;
|
|
57
|
+
const scoredItems = this.opts.items.current.map((item) => ({
|
|
58
|
+
...item,
|
|
59
|
+
score: searchTerm ? computeCommandScore(item.label, searchTerm, []) : 1
|
|
60
|
+
}));
|
|
61
|
+
// Sort items by score (highest first) then alphabetically
|
|
62
|
+
const newSortedList = scoredItems.sort((a, b) => {
|
|
63
|
+
if (a.score !== b.score)
|
|
64
|
+
return b.score - a.score;
|
|
65
|
+
return a.label.localeCompare(b.label);
|
|
66
|
+
});
|
|
67
|
+
if (dequal(this.searchState.sortedList, newSortedList))
|
|
68
|
+
return;
|
|
69
|
+
this.searchState.sortedList = newSortedList;
|
|
70
|
+
}
|
|
71
|
+
getFilteredList() {
|
|
72
|
+
return this.searchState.sortedList.filter((item) => item.score === undefined || item.score > 0);
|
|
73
|
+
}
|
|
74
|
+
props = $derived.by(() => ({
|
|
75
|
+
id: this.opts.id.current,
|
|
76
|
+
[SEARCH_ROOT_ATTR]: ''
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
const SearchRootContext = new Context('Search.Root');
|
|
80
|
+
export class SearchInputState {
|
|
81
|
+
opts;
|
|
82
|
+
root;
|
|
83
|
+
constructor(opts, root) {
|
|
84
|
+
this.opts = opts;
|
|
85
|
+
this.root = root;
|
|
86
|
+
useRefById({
|
|
87
|
+
...opts,
|
|
88
|
+
onRefChange: (node) => {
|
|
89
|
+
if (node instanceof HTMLInputElement) {
|
|
90
|
+
this.root.inputRef = node;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* This is essentially our oninput handler
|
|
96
|
+
*/
|
|
97
|
+
watch(() => this.opts.value.current, () => {
|
|
98
|
+
this.root.searchState.value = this.opts.value.current;
|
|
99
|
+
this.root.search();
|
|
100
|
+
this.root.searchState.showSuggestions = true;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
onFocus = () => {
|
|
104
|
+
this.root.search();
|
|
105
|
+
};
|
|
106
|
+
props = $derived.by(() => ({
|
|
107
|
+
id: this.opts.id.current,
|
|
108
|
+
onfocus: this.onFocus,
|
|
109
|
+
[SEARCH_INPUT_ATTR]: ''
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
export class SearchListState {
|
|
113
|
+
opts;
|
|
114
|
+
root;
|
|
115
|
+
constructor(opts, root) {
|
|
116
|
+
this.opts = opts;
|
|
117
|
+
this.root = root;
|
|
118
|
+
useRefById(opts);
|
|
119
|
+
}
|
|
120
|
+
props = $derived.by(() => ({
|
|
121
|
+
id: this.opts.id.current,
|
|
122
|
+
[SEARCH_LIST_ATTR]: ''
|
|
123
|
+
}));
|
|
124
|
+
get suggestions() {
|
|
125
|
+
return this.root.searchState.sortedList;
|
|
126
|
+
}
|
|
127
|
+
visible(item) {
|
|
128
|
+
// Check if item has a score of 0
|
|
129
|
+
if (item.score === 0)
|
|
130
|
+
return false;
|
|
131
|
+
return this.root
|
|
132
|
+
.getFilteredList()
|
|
133
|
+
.slice(this.root.start, this.root.end)
|
|
134
|
+
.some((i) => dequal({ label: i.label, value: i.value }, { label: item.label, value: item.value }));
|
|
135
|
+
}
|
|
136
|
+
selected(item) {
|
|
137
|
+
return this.root.opts.value.current.value === item.value;
|
|
138
|
+
}
|
|
139
|
+
select(item) {
|
|
140
|
+
this.root.opts.value.current = item;
|
|
141
|
+
this.root.searchState.showSuggestions = false;
|
|
142
|
+
this.root.inputRef?.focus();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export class SearchPagnationState {
|
|
146
|
+
opts;
|
|
147
|
+
root;
|
|
148
|
+
constructor(opts, root) {
|
|
149
|
+
this.opts = opts;
|
|
150
|
+
this.root = root;
|
|
151
|
+
useRefById(opts);
|
|
152
|
+
this.root.numPerPage = this.opts.perPage.current;
|
|
153
|
+
watch(() => this.opts.perPage.current, (perPage) => {
|
|
154
|
+
this.root.numPerPage = perPage;
|
|
155
|
+
});
|
|
156
|
+
watch(() => this.opts.page.current, (page) => {
|
|
157
|
+
this.root.start = (page - 1) * this.root.numPerPage;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
props = $derived.by(() => ({
|
|
161
|
+
id: this.opts.id.current,
|
|
162
|
+
[SEARCH_ITEM_ATTR]: ''
|
|
163
|
+
}));
|
|
164
|
+
get length() {
|
|
165
|
+
return this.root.getFilteredList().length;
|
|
166
|
+
}
|
|
167
|
+
get perPage() {
|
|
168
|
+
return this.opts.perPage.current;
|
|
169
|
+
}
|
|
170
|
+
get activeItems() {
|
|
171
|
+
return this.root.getFilteredList().slice(this.root.start, this.root.end);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
export class SearchEmptyState {
|
|
175
|
+
opts;
|
|
176
|
+
root;
|
|
177
|
+
constructor(opts, root) {
|
|
178
|
+
this.opts = opts;
|
|
179
|
+
this.root = root;
|
|
180
|
+
useRefById(opts);
|
|
181
|
+
}
|
|
182
|
+
props = $derived.by(() => ({
|
|
183
|
+
id: this.opts.id.current,
|
|
184
|
+
[SEARCH_EMPTY_ATTR]: ''
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
// -------------------- Search Hooks --------------------
|
|
188
|
+
export function useSearchRoot(props) {
|
|
189
|
+
return SearchRootContext.set(new SearchRootState(props));
|
|
190
|
+
}
|
|
191
|
+
export function useSearchInput(props) {
|
|
192
|
+
return new SearchInputState(props, SearchRootContext.get());
|
|
193
|
+
}
|
|
194
|
+
export function useSearchList(props) {
|
|
195
|
+
return new SearchListState(props, SearchRootContext.get());
|
|
196
|
+
}
|
|
197
|
+
export function useSearchPagnation(props) {
|
|
198
|
+
return new SearchPagnationState(props, SearchRootContext.get());
|
|
199
|
+
}
|
|
200
|
+
export function useSearchEmpty(props) {
|
|
201
|
+
return new SearchEmptyState(props, SearchRootContext.get());
|
|
202
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BitsPrimitiveDivAttributes, WithChild, Without, BitsPrimitiveInputAttributes } from 'bits-ui';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export type Item = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
export type SearchRootPropsWithoutHTML = WithChild<{
|
|
8
|
+
items?: Item[];
|
|
9
|
+
searchWith?: string;
|
|
10
|
+
value: Item;
|
|
11
|
+
search?: (term: string) => Promise<Item[]>;
|
|
12
|
+
}>;
|
|
13
|
+
export type SearchProps = SearchRootPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, SearchRootPropsWithoutHTML>;
|
|
14
|
+
export type SearchInputPropsWithoutHTML = WithChild<{
|
|
15
|
+
value?: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type SearchInputProps = SearchInputPropsWithoutHTML & Without<BitsPrimitiveInputAttributes, SearchInputPropsWithoutHTML>;
|
|
18
|
+
export type SearchListPropsWithoutHTML = WithChild<{
|
|
19
|
+
item: Snippet<[Item]>;
|
|
20
|
+
}>;
|
|
21
|
+
export type SearchListProps = SearchListPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, SearchListPropsWithoutHTML>;
|
|
22
|
+
export type SearchPagnationPropsWithoutHTML = WithChild<{
|
|
23
|
+
page?: number;
|
|
24
|
+
perPage?: number;
|
|
25
|
+
}>;
|
|
26
|
+
export type SearchPagnationProps = SearchPagnationPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, SearchPagnationPropsWithoutHTML>;
|
|
27
|
+
export type SearchEmptyPropsWithoutHTML = WithChild;
|
|
28
|
+
export type SearchEmptyProps = SearchEmptyPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, SearchEmptyPropsWithoutHTML>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { mergeProps } from 'svelte-toolbelt';
|
|
3
|
+
import type { ArrowProps } from './types.js';
|
|
4
|
+
import { useId } from '../../../bits/internal/use-id.js';
|
|
5
|
+
|
|
6
|
+
let { id = useId(), children, child, width = 10, height = 5, ...restProps }: ArrowProps = $props();
|
|
7
|
+
|
|
8
|
+
const mergedProps = $derived(mergeProps(restProps, { id }));
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{#if child}
|
|
12
|
+
{@render child({ props: mergedProps })}
|
|
13
|
+
{:else}
|
|
14
|
+
<span {...mergedProps}>
|
|
15
|
+
{#if children}
|
|
16
|
+
{@render children?.()}
|
|
17
|
+
{:else}
|
|
18
|
+
<svg {width} {height} viewBox="0 0 30 10" preserveAspectRatio="none" data-arrow="">
|
|
19
|
+
<polygon points="0,0 30,0 15,10" fill="currentColor" />
|
|
20
|
+
</svg>
|
|
21
|
+
{/if}
|
|
22
|
+
</span>
|
|
23
|
+
{/if}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Arrow } from "./arrow.svelte";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { WithChild } from "../../../internal/types.js";
|
|
2
|
+
import type { BitsPrimitiveSpanAttributes } from "../../../shared/attributes.js";
|
|
3
|
+
export type ArrowPropsWithoutHTML = WithChild<{
|
|
4
|
+
/**
|
|
5
|
+
* The width of the arrow in pixels.
|
|
6
|
+
*
|
|
7
|
+
* @defaultValue 10
|
|
8
|
+
*/
|
|
9
|
+
width?: number;
|
|
10
|
+
/**
|
|
11
|
+
* The height of the arrow in pixels.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue 5
|
|
14
|
+
*/
|
|
15
|
+
height?: number;
|
|
16
|
+
}>;
|
|
17
|
+
export type ArrowProps = ArrowPropsWithoutHTML & BitsPrimitiveSpanAttributes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { box } from 'svelte-toolbelt';
|
|
3
|
+
import { useFloatingAnchorState } from '../use-floating-layer.svelte.js';
|
|
4
|
+
import type { AnchorProps } from './index.js';
|
|
5
|
+
import type { Measurable } from '../../../../bits/internal/floating-svelte/types.js';
|
|
6
|
+
|
|
7
|
+
let { id, children, virtualEl }: AnchorProps = $props();
|
|
8
|
+
|
|
9
|
+
useFloatingAnchorState({
|
|
10
|
+
id: box.with(() => id),
|
|
11
|
+
virtualEl: box.with(() => virtualEl as unknown as Measurable | null)
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{@render children?.()}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { box, mergeProps } from 'svelte-toolbelt';
|
|
3
|
+
import { useFloatingArrowState } from '../use-floating-layer.svelte.js';
|
|
4
|
+
import { Arrow, type ArrowProps } from '../../arrow/index.js';
|
|
5
|
+
import { useId } from 'bits-ui';
|
|
6
|
+
|
|
7
|
+
let { id = useId(), ref = $bindable(null), ...restProps }: ArrowProps = $props();
|
|
8
|
+
|
|
9
|
+
const arrowState = useFloatingArrowState({
|
|
10
|
+
id: box.with(() => id),
|
|
11
|
+
ref: box.with(
|
|
12
|
+
() => ref,
|
|
13
|
+
(v) => (ref = v)
|
|
14
|
+
)
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const mergedProps = $derived(mergeProps(restProps, arrowState.props));
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<Arrow {...mergedProps} />
|
package/dist/lib/components/utilities/floating-layer/components/floating-layer-content-static.svelte
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type Snippet, onMount } from "svelte";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
content,
|
|
6
|
+
onPlaced,
|
|
7
|
+
}: {
|
|
8
|
+
content?: Snippet<
|
|
9
|
+
[{ props: Record<string, unknown>; wrapperProps: Record<string, unknown> }]
|
|
10
|
+
>;
|
|
11
|
+
onPlaced?: () => void;
|
|
12
|
+
} = $props();
|
|
13
|
+
|
|
14
|
+
onMount(() => {
|
|
15
|
+
onPlaced?.();
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{@render content?.({ props: {}, wrapperProps: {} })}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
content?: Snippet<[
|
|
4
|
+
{
|
|
5
|
+
props: Record<string, unknown>;
|
|
6
|
+
wrapperProps: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
]>;
|
|
9
|
+
onPlaced?: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare const FloatingLayerContentStatic: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
12
|
+
type FloatingLayerContentStatic = ReturnType<typeof FloatingLayerContentStatic>;
|
|
13
|
+
export default FloatingLayerContentStatic;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { box, mergeProps } from 'svelte-toolbelt';
|
|
3
|
+
import { useFloatingContentState } from '../use-floating-layer.svelte.js';
|
|
4
|
+
import type { ContentImplProps } from './index.js';
|
|
5
|
+
import { useId } from 'bits-ui';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
content,
|
|
9
|
+
side = 'bottom',
|
|
10
|
+
sideOffset = 0,
|
|
11
|
+
align = 'center',
|
|
12
|
+
alignOffset = 0,
|
|
13
|
+
id,
|
|
14
|
+
arrowPadding = 0,
|
|
15
|
+
avoidCollisions = true,
|
|
16
|
+
collisionBoundary = [],
|
|
17
|
+
collisionPadding = 0,
|
|
18
|
+
hideWhenDetached = false,
|
|
19
|
+
onPlaced = () => {},
|
|
20
|
+
sticky = 'partial',
|
|
21
|
+
updatePositionStrategy = 'optimized',
|
|
22
|
+
strategy = 'fixed',
|
|
23
|
+
dir = 'ltr',
|
|
24
|
+
style = {},
|
|
25
|
+
wrapperId = useId(),
|
|
26
|
+
customAnchor = null,
|
|
27
|
+
enabled
|
|
28
|
+
}: ContentImplProps = $props();
|
|
29
|
+
|
|
30
|
+
const contentState = useFloatingContentState({
|
|
31
|
+
side: box.with(() => side),
|
|
32
|
+
sideOffset: box.with(() => sideOffset),
|
|
33
|
+
align: box.with(() => align),
|
|
34
|
+
alignOffset: box.with(() => alignOffset),
|
|
35
|
+
id: box.with(() => id),
|
|
36
|
+
arrowPadding: box.with(() => arrowPadding),
|
|
37
|
+
avoidCollisions: box.with(() => avoidCollisions),
|
|
38
|
+
collisionBoundary: box.with(() => collisionBoundary),
|
|
39
|
+
collisionPadding: box.with(() => collisionPadding),
|
|
40
|
+
hideWhenDetached: box.with(() => hideWhenDetached),
|
|
41
|
+
onPlaced: box.with(() => onPlaced),
|
|
42
|
+
sticky: box.with(() => sticky),
|
|
43
|
+
updatePositionStrategy: box.with(() => updatePositionStrategy),
|
|
44
|
+
strategy: box.with(() => strategy),
|
|
45
|
+
dir: box.with(() => dir),
|
|
46
|
+
style: box.with(() => style),
|
|
47
|
+
enabled: box.with(() => enabled),
|
|
48
|
+
wrapperId: box.with(() => wrapperId),
|
|
49
|
+
customAnchor: box.with(() => customAnchor)
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const mergedProps = $derived(
|
|
53
|
+
mergeProps(contentState.wrapperProps, {
|
|
54
|
+
style: {
|
|
55
|
+
pointerEvents: 'auto'
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
);
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
{@render content?.({ props: contentState.props, wrapperProps: mergedProps })}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Anchor } from "./floating-layer-anchor.svelte";
|
|
2
|
+
export { default as Arrow } from "./floating-layer-arrow.svelte";
|
|
3
|
+
export { default as Content } from "./floating-layer-content.svelte";
|
|
4
|
+
export { default as ContentStatic } from "./floating-layer-content-static.svelte";
|
|
5
|
+
export { default as Root } from "./floating-layer.svelte";
|
|
6
|
+
export type { FloatingLayerContentImplProps as ContentImplProps, FloatingLayerContentProps as ContentProps, FloatingLayerAnchorProps as AnchorProps, } from "../types.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Anchor } from "./floating-layer-anchor.svelte";
|
|
2
|
+
export { default as Arrow } from "./floating-layer-arrow.svelte";
|
|
3
|
+
export { default as Content } from "./floating-layer-content.svelte";
|
|
4
|
+
export { default as ContentStatic } from "./floating-layer-content-static.svelte";
|
|
5
|
+
export { default as Root } from "./floating-layer.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as FloatingLayer from "./components/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as FloatingLayer from "./components/index.js";
|