@fibrae/semi-ui-svelte 0.2.0 → 0.3.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/dist/_base/create-context.js +0 -1
- package/dist/_base/css-animation.js +0 -1
- package/dist/_base/group-role.d.ts +0 -1
- package/dist/_base/group-role.js +0 -1
- package/dist/_base/slot-kind.d.ts +0 -1
- package/dist/_base/slot-kind.js +0 -1
- package/dist/_base/teleport.d.ts +0 -2
- package/dist/_base/teleport.js +0 -2
- package/dist/_base/use-click-outside.svelte.d.ts +2 -2
- package/dist/_base/use-click-outside.svelte.js +2 -2
- package/dist/_base/use-foundation.svelte.js +2 -5
- package/dist/_base/virtual-list.svelte +2 -3
- package/dist/_base/virtual-list.svelte.d.ts +0 -1
- package/dist/_sortable/interface.d.ts +0 -1
- package/dist/anchor/interface.d.ts +0 -3
- package/dist/anchor/link-item.svelte +0 -1
- package/dist/anchor/links.d.ts +0 -1
- package/dist/anchor/links.js +0 -1
- package/dist/audio-player/audio-player.svelte +0 -2
- package/dist/audio-player/audio-slider.svelte +0 -3
- package/dist/auto-complete/auto-complete.svelte +0 -5
- package/dist/auto-complete/interface.d.ts +0 -9
- package/dist/avatar/avatar-group-more.svelte +0 -1
- package/dist/avatar/avatar.svelte +0 -4
- package/dist/avatar/context.d.ts +0 -1
- package/dist/avatar/interface.d.ts +0 -4
- package/dist/backtop/backtop.svelte +0 -2
- package/dist/backtop/interface.d.ts +0 -1
- package/dist/badge/interface.d.ts +0 -1
- package/dist/banner/banner.svelte +1 -1
- package/dist/banner/interface.d.ts +1 -3
- package/dist/breadcrumb/breadcrumb-item.svelte +0 -1
- package/dist/breadcrumb/breadcrumb.svelte +0 -1
- package/dist/breadcrumb/interface.d.ts +0 -7
- package/dist/calendar/calendar.svelte +0 -1
- package/dist/calendar/day-calendar.svelte +0 -3
- package/dist/calendar/interface.d.ts +0 -8
- package/dist/calendar/month-calendar.svelte +0 -4
- package/dist/calendar/time-grid.svelte +0 -2
- package/dist/calendar/time-grid.svelte.d.ts +0 -1
- package/dist/calendar/use-today.svelte.d.ts +0 -1
- package/dist/calendar/use-today.svelte.js +0 -1
- package/dist/card/index.js +0 -1
- package/dist/card/interface.d.ts +0 -3
- package/dist/carousel/carousel.svelte +0 -4
- package/dist/carousel/interface.d.ts +0 -3
- package/dist/cascader/cascader.svelte +0 -6
- package/dist/cascader/interface.d.ts +0 -19
- package/dist/cascader/item.svelte +0 -4
- package/dist/cascader/item.svelte.d.ts +0 -4
- package/dist/checkbox/checkbox-group.svelte +0 -3
- package/dist/checkbox/checkbox.svelte +0 -4
- package/dist/checkbox/index.js +0 -1
- package/dist/checkbox/interface.d.ts +0 -1
- package/dist/code-highlight/interface.d.ts +0 -1
- package/dist/collapse/collapse.svelte +0 -2
- package/dist/collapse/index.js +0 -1
- package/dist/collapse/interface.d.ts +0 -2
- package/dist/collapse/panel.svelte +0 -1
- package/dist/collapsible/collapsible.svelte +0 -2
- package/dist/color-picker/alpha-slider.svelte +0 -1
- package/dist/color-picker/color-choose-area.svelte +0 -1
- package/dist/color-picker/color-slider.svelte +0 -1
- package/dist/color-picker/data-part.svelte +0 -1
- package/dist/cropper/cropper.svelte +0 -1
- package/dist/cropper/interface.d.ts +0 -6
- package/dist/date-picker/date-input.svelte +0 -4
- package/dist/date-picker/date-picker.svelte +0 -7
- package/dist/date-picker/inset-input.svelte +0 -1
- package/dist/date-picker/interface.d.ts +0 -7
- package/dist/date-picker/internal.d.ts +0 -7
- package/dist/date-picker/month.svelte +0 -1
- package/dist/date-picker/months-grid.svelte +0 -6
- package/dist/date-picker/navigation.svelte +0 -1
- package/dist/descriptions/interface.d.ts +0 -1
- package/dist/divider/divider.svelte +0 -1
- package/dist/divider/interface.d.ts +0 -4
- package/dist/drag-move/drag-move.js +0 -1
- package/dist/drag-move/interface.d.ts +0 -3
- package/dist/dropdown/context.d.ts +0 -6
- package/dist/dropdown/context.js +0 -1
- package/dist/dropdown/dropdown-item.svelte +0 -1
- package/dist/dropdown/dropdown.svelte +0 -7
- package/dist/dropdown/interface.d.ts +0 -4
- package/dist/empty/empty.svelte +0 -1
- package/dist/empty/interface.d.ts +0 -3
- package/dist/feedback/feedback.svelte +0 -1
- package/dist/feedback/interface.d.ts +0 -8
- package/dist/float-button/float-button-action.svelte +0 -2
- package/dist/float-button/interface.d.ts +0 -2
- package/dist/form/array-field.svelte +0 -2
- package/dist/form/context.d.ts +0 -2
- package/dist/form/error-message.svelte +0 -1
- package/dist/form/field-grid.svelte +0 -2
- package/dist/form/field-grid.svelte.d.ts +0 -2
- package/dist/form/field-inner.svelte +0 -2
- package/dist/form/field.svelte +0 -1
- package/dist/form/form.svelte +0 -1
- package/dist/form/hooks.d.ts +1 -2
- package/dist/form/hooks.js +1 -2
- package/dist/form/interface.d.ts +0 -7
- package/dist/form/utils.d.ts +0 -1
- package/dist/form/utils.js +0 -2
- package/dist/highlight/interface.d.ts +0 -1
- package/dist/hot-keys/interface.d.ts +0 -1
- package/dist/image/context.d.ts +0 -1
- package/dist/image/footer.d.ts +0 -1
- package/dist/image/interface.d.ts +0 -8
- package/dist/image/preview-image.svelte +0 -3
- package/dist/image/preview-image.svelte.d.ts +0 -1
- package/dist/image/preview-inner.svelte +0 -3
- package/dist/image/preview-inner.svelte.d.ts +0 -1
- package/dist/input/context.d.ts +0 -1
- package/dist/input/interface.d.ts +0 -3
- package/dist/input/textarea.svelte +0 -3
- package/dist/input-number/input-number.svelte +0 -2
- package/dist/input-number/interface.d.ts +0 -1
- package/dist/json-viewer/interface.d.ts +0 -4
- package/dist/json-viewer/json-viewer.svelte +0 -3
- package/dist/layout/interface.d.ts +0 -2
- package/dist/list/interface.d.ts +0 -2
- package/dist/lottie/interface.d.ts +1 -1
- package/dist/markdown-render/code-text.js +0 -1
- package/dist/markdown-render/components/code.svelte +0 -1
- package/dist/markdown-render/components/heading.svelte +0 -1
- package/dist/markdown-render/components/p.svelte +0 -1
- package/dist/markdown-render/components/table.svelte +0 -1
- package/dist/markdown-render/components/tree.d.ts +0 -4
- package/dist/markdown-render/components/tree.js +0 -2
- package/dist/markdown-render/interface.d.ts +0 -1
- package/dist/markdown-render/markdown-children.svelte +0 -2
- package/dist/markdown-render/markdown-render.svelte +0 -1
- package/dist/markdown-render/runtime.js +0 -1
- package/dist/modal/confirm-modal.svelte +0 -1
- package/dist/modal/confirm.svelte.d.ts +0 -1
- package/dist/modal/confirm.svelte.js +0 -1
- package/dist/modal/index.js +0 -1
- package/dist/modal/interface.d.ts +0 -6
- package/dist/modal/modal-content.svelte +0 -4
- package/dist/modal/modal.svelte +0 -1
- package/dist/modal/use-show-hide.svelte.d.ts +0 -2
- package/dist/modal/use-show-hide.svelte.js +0 -4
- package/dist/navigation/context.d.ts +0 -2
- package/dist/navigation/index.js +0 -1
- package/dist/navigation/interface.d.ts +1 -17
- package/dist/navigation/item-shell.svelte +0 -4
- package/dist/navigation/item-shell.svelte.d.ts +0 -3
- package/dist/navigation/nav-footer.svelte +0 -2
- package/dist/navigation/nav-items.svelte +0 -1
- package/dist/navigation/nav.svelte +0 -1
- package/dist/navigation/sub-nav.svelte +0 -5
- package/dist/navigation/wrapper-outlet.svelte +0 -1
- package/dist/notification/context.d.ts +0 -3
- package/dist/notification/interface.d.ts +0 -5
- package/dist/notification/notice-list.svelte +0 -2
- package/dist/notification/notice-list.svelte.d.ts +0 -1
- package/dist/notification/notice.svelte +0 -2
- package/dist/notification/notification-list.svelte +0 -1
- package/dist/notification/static-api.js +0 -1
- package/dist/overflow-list/interface.d.ts +0 -2
- package/dist/overflow-list/overflow-list.svelte +0 -2
- package/dist/pagination/interface.d.ts +0 -1
- package/dist/pagination/pagination.svelte +0 -2
- package/dist/pagination/step-button.svelte +0 -3
- package/dist/pagination/step-button.svelte.d.ts +0 -1
- package/dist/pincode/interface.d.ts +0 -1
- package/dist/pincode/pincode.svelte +0 -3
- package/dist/popconfirm/interface.d.ts +0 -1
- package/dist/popconfirm/popconfirm.svelte +0 -2
- package/dist/popover/interface.d.ts +0 -1
- package/dist/popover/popover.svelte +0 -1
- package/dist/radio/index.js +0 -1
- package/dist/radio/radio-group.svelte +0 -1
- package/dist/radio/radio.svelte +0 -1
- package/dist/rating/interface.d.ts +0 -2
- package/dist/rating/item.svelte +0 -1
- package/dist/rating/rating.svelte +0 -7
- package/dist/resizable/interface.d.ts +0 -2
- package/dist/resizable/resizable.svelte +0 -1
- package/dist/resizable/resize-group.svelte +0 -1
- package/dist/resizable/resize-handler.svelte +0 -1
- package/dist/resize-observer/observe-resize.d.ts +1 -5
- package/dist/resize-observer/observe-resize.js +1 -5
- package/dist/scroll-list/index.js +0 -1
- package/dist/scroll-list/interface.d.ts +0 -2
- package/dist/scroll-list/scroll-item.svelte +0 -2
- package/dist/select/interface.d.ts +0 -14
- package/dist/select/option.svelte +0 -5
- package/dist/select/option.svelte.d.ts +0 -5
- package/dist/select/select.svelte +0 -14
- package/dist/side-sheet/interface.d.ts +0 -1
- package/dist/side-sheet/side-sheet.svelte +0 -9
- package/dist/skeleton/index.js +0 -1
- package/dist/skeleton/interface.d.ts +0 -2
- package/dist/skeleton/skeleton-item.svelte +0 -1
- package/dist/slider/interface.d.ts +0 -5
- package/dist/slider/slider.svelte +0 -7
- package/dist/space/interface.d.ts +0 -1
- package/dist/space/space.svelte +0 -1
- package/dist/steps/context.d.ts +0 -1
- package/dist/steps/interface.d.ts +0 -2
- package/dist/steps/step.svelte +0 -3
- package/dist/switch/switch.svelte +0 -2
- package/dist/table/body/base-row.svelte +0 -4
- package/dist/table/body/base-row.svelte.d.ts +0 -4
- package/dist/table/body/body.svelte +0 -7
- package/dist/table/body/body.svelte.d.ts +0 -5
- package/dist/table/body/expanded-row.svelte +0 -1
- package/dist/table/body/expanded-row.svelte.d.ts +0 -1
- package/dist/table/body/section-row.svelte +0 -2
- package/dist/table/body/section-row.svelte.d.ts +0 -2
- package/dist/table/column-filter-menu.svelte +0 -3
- package/dist/table/column-filter-menu.svelte.d.ts +0 -3
- package/dist/table/column-filter.svelte +0 -2
- package/dist/table/column-filter.svelte.d.ts +0 -2
- package/dist/table/column-selection.svelte +1 -2
- package/dist/table/column-selection.svelte.d.ts +0 -1
- package/dist/table/column-sorter.svelte +1 -6
- package/dist/table/column-sorter.svelte.d.ts +1 -6
- package/dist/table/context.d.ts +0 -10
- package/dist/table/context.js +0 -1
- package/dist/table/custom-expand-icon.svelte +0 -2
- package/dist/table/custom-expand-icon.svelte.d.ts +0 -2
- package/dist/table/head-table.svelte +0 -1
- package/dist/table/head-table.svelte.d.ts +0 -1
- package/dist/table/interface.d.ts +2 -21
- package/dist/table/table-cell.svelte +0 -7
- package/dist/table/table-cell.svelte.d.ts +0 -7
- package/dist/table/table-header-row.svelte +0 -2
- package/dist/table/table-header-row.svelte.d.ts +0 -2
- package/dist/table/table-pagination.svelte +0 -2
- package/dist/table/table-pagination.svelte.d.ts +0 -2
- package/dist/table/table.svelte +0 -5
- package/dist/table/utils.d.ts +1 -13
- package/dist/table/utils.js +1 -11
- package/dist/tabs/index.js +0 -1
- package/dist/tabs/interface.d.ts +0 -13
- package/dist/tabs/tab-bar.svelte +0 -3
- package/dist/tabs/tab-bar.svelte.d.ts +0 -1
- package/dist/tabs/tab-pane.svelte +0 -2
- package/dist/tabs/tabs.svelte +0 -1
- package/dist/tag-input/interface.d.ts +0 -5
- package/dist/tag-input/tag-input.svelte +0 -3
- package/dist/tag-input/tag-item.svelte +0 -1
- package/dist/tag-input/tag-item.svelte.d.ts +0 -1
- package/dist/time-picker/combobox.svelte +0 -1
- package/dist/time-picker/interface.d.ts +0 -9
- package/dist/time-picker/time-picker.svelte +0 -2
- package/dist/timeline/interface.d.ts +0 -4
- package/dist/timeline/timeline.svelte +0 -1
- package/dist/toast/context.d.ts +0 -2
- package/dist/toast/interface.d.ts +0 -2
- package/dist/toast/static-api.js +0 -1
- package/dist/toast/toast.svelte +0 -1
- package/dist/toast/use-toast.js +0 -1
- package/dist/tooltip/context.d.ts +0 -2
- package/dist/tooltip/interface.d.ts +0 -2
- package/dist/tooltip/tooltip.svelte +0 -5
- package/dist/transfer/interface.d.ts +1 -8
- package/dist/transfer/transfer-selected-item.svelte +0 -1
- package/dist/transfer/transfer-selected-item.svelte.d.ts +0 -1
- package/dist/transfer/transfer.svelte +0 -1
- package/dist/tree/auto-sizer.svelte +0 -1
- package/dist/tree/context.d.ts +0 -1
- package/dist/tree/interface.d.ts +0 -9
- package/dist/tree/node-collapsible.svelte +0 -1
- package/dist/tree/node-list.svelte +0 -4
- package/dist/tree/tree-node.svelte +0 -1
- package/dist/tree/tree.svelte +0 -3
- package/dist/tree/use-tree-keyboard.svelte.d.ts +1 -8
- package/dist/tree/use-tree-keyboard.svelte.js +1 -6
- package/dist/tree-select/interface.d.ts +0 -11
- package/dist/tree-select/tree-select.svelte +0 -2
- package/dist/typography/base.svelte +0 -2
- package/dist/typography/index.js +0 -1
- package/dist/typography/interface.d.ts +0 -1
- package/dist/typography/internal.d.ts +0 -2
- package/dist/upload/file-card.svelte +0 -1
- package/dist/upload/index.js +0 -1
- package/dist/upload/interface.d.ts +0 -4
- package/dist/upload/upload.svelte +0 -1
- package/dist/user-guide/interface.d.ts +0 -1
- package/dist/user-guide/user-guide.svelte +0 -1
- package/dist/video-player/video-progress.svelte +0 -2
- package/package.json +3 -3
package/dist/tabs/interface.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { DropdownProps } from '../dropdown/index.js';
|
|
|
4
4
|
export type TabType = 'line' | 'card' | 'button' | 'slash';
|
|
5
5
|
export type TabSize = 'small' | 'medium' | 'large';
|
|
6
6
|
export type TabPosition = 'top' | 'left';
|
|
7
|
-
/** A `tabList` entry holds data only; markup for its tab and icon goes to the Tabs `tab` and `icon` snippets */
|
|
8
7
|
export interface PlainTab {
|
|
9
8
|
itemKey: string;
|
|
10
9
|
tab?: string | number;
|
|
@@ -16,12 +15,10 @@ export interface TabsDropdownProps {
|
|
|
16
15
|
start?: TabsDropdownItemProps;
|
|
17
16
|
end?: TabsDropdownItemProps;
|
|
18
17
|
}
|
|
19
|
-
/** The menu content is the `moreContent` snippet and the trigger the `moreTrigger` snippet */
|
|
20
18
|
export interface TabsMore {
|
|
21
19
|
count: number;
|
|
22
20
|
dropdownProps?: TabsDropdownItemProps;
|
|
23
21
|
}
|
|
24
|
-
/** A tab of the collapsed bar as OverflowList keeps it */
|
|
25
22
|
export interface OverflowItem extends PlainTab {
|
|
26
23
|
/** `${itemKey}-bar` */
|
|
27
24
|
key: string;
|
|
@@ -34,7 +31,6 @@ export interface TabsTabSnippetProps {
|
|
|
34
31
|
export interface TabsPanelSnippetProps extends TabsTabSnippetProps {
|
|
35
32
|
itemKey: string;
|
|
36
33
|
}
|
|
37
|
-
/** The data of the default tab bar; its behavior reaches the TabItems inside the Tabs on its own */
|
|
38
34
|
export interface TabBarProps {
|
|
39
35
|
activeKey: string | null;
|
|
40
36
|
list: PlainTab[];
|
|
@@ -52,20 +48,15 @@ export interface TabBarProps {
|
|
|
52
48
|
}
|
|
53
49
|
export interface TabsTabBarSnippetProps {
|
|
54
50
|
tabBarProps: TabBarProps;
|
|
55
|
-
/** The default tab bar, ready for `{@render tabBar()}` */
|
|
56
51
|
tabBar: Snippet;
|
|
57
52
|
}
|
|
58
53
|
export interface TabsArrowSnippetProps {
|
|
59
|
-
/** The tabs scrolled out on this side */
|
|
60
54
|
items: OverflowItem[];
|
|
61
55
|
position: 'start' | 'end';
|
|
62
|
-
/** Scrolls the next hidden tab of this side into view */
|
|
63
56
|
onClick: () => void;
|
|
64
|
-
/** The default arrow, ready for `{@render defaultNode()}` */
|
|
65
57
|
defaultNode: Snippet;
|
|
66
58
|
}
|
|
67
59
|
export interface TabsMoreContentSnippetProps {
|
|
68
|
-
/** The tabs moved into the more menu */
|
|
69
60
|
items: PlainTab[];
|
|
70
61
|
}
|
|
71
62
|
export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onchange'> {
|
|
@@ -101,13 +92,9 @@ export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'childre
|
|
|
101
92
|
/** The icon of each `tabList` entry; the icon container renders even when the snippet outputs nothing */
|
|
102
93
|
icon?: Snippet<[TabsTabSnippetProps]>;
|
|
103
94
|
tabBarExtraContent?: Snippet;
|
|
104
|
-
/** Replaces the tab bar */
|
|
105
95
|
tabBar?: Snippet<[TabsTabBarSnippetProps]>;
|
|
106
|
-
/** Replaces each arrow of the collapsed bar */
|
|
107
96
|
arrow?: Snippet<[TabsArrowSnippetProps]>;
|
|
108
|
-
/** Replaces the trigger of the more menu */
|
|
109
97
|
moreTrigger?: Snippet;
|
|
110
|
-
/** Replaces the content of the more menu */
|
|
111
98
|
moreContent?: Snippet<[TabsMoreContentSnippetProps]>;
|
|
112
99
|
}
|
|
113
100
|
/** Internal: Tabs renders one pane per `panel` entry; the pane reads everything else from the Tabs context */
|
package/dist/tabs/tab-bar.svelte
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
import TabItem from './tab-item.svelte';
|
|
15
15
|
|
|
16
16
|
interface Props extends TabBarProps {
|
|
17
|
-
/** The Tabs' aria-label and aria-labelledby, which name the tablist */
|
|
18
17
|
tablistAttrs: Record<string, unknown>;
|
|
19
18
|
tab?: Snippet<[TabsTabSnippetProps]>;
|
|
20
19
|
icon?: Snippet<[TabsTabSnippetProps]>;
|
|
@@ -111,7 +110,6 @@
|
|
|
111
110
|
onVisibleTabsChange?.(visibleState);
|
|
112
111
|
};
|
|
113
112
|
|
|
114
|
-
// the remembered width no longer applies once tabs are added, removed or retitled
|
|
115
113
|
watch(
|
|
116
114
|
() => labelsSignature,
|
|
117
115
|
() => {
|
|
@@ -134,7 +132,6 @@
|
|
|
134
132
|
untrack(checkOverflow);
|
|
135
133
|
});
|
|
136
134
|
|
|
137
|
-
// fallback for when ResizeObserver does not report after mount
|
|
138
135
|
onMount(() => {
|
|
139
136
|
const frame = requestAnimationFrame(checkOverflow);
|
|
140
137
|
return () => cancelAnimationFrame(frame);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
2
|
import type { TabBarProps, TabsArrowSnippetProps, TabsMoreContentSnippetProps, TabsTabSnippetProps } from './interface.js';
|
|
3
3
|
interface Props extends TabBarProps {
|
|
4
|
-
/** The Tabs' aria-label and aria-labelledby, which name the tablist */
|
|
5
4
|
tablistAttrs: Record<string, unknown>;
|
|
6
5
|
tab?: Snippet<[TabsTabSnippetProps]>;
|
|
7
6
|
icon?: Snippet<[TabsTabSnippetProps]>;
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
const shouldRender = $derived(!view.lazyRender || active || activated);
|
|
18
18
|
const paneMotion = $derived(TabsFoundation.getPaneMotion({ ...view, itemKey }));
|
|
19
|
-
|
|
20
|
-
// split so the effect below runs only when one of the two values changes
|
|
21
19
|
const startClassName = $derived(paneMotion.startClassName);
|
|
22
20
|
const hasMotion = $derived(paneMotion.hasMotion);
|
|
23
21
|
|
package/dist/tabs/tabs.svelte
CHANGED
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
|
|
58
58
|
const config = getConfigContext();
|
|
59
59
|
|
|
60
|
-
// itemKeys repeat across Tabs on a page, so ids are scoped per instance
|
|
61
60
|
const uid = $props.id();
|
|
62
61
|
|
|
63
62
|
// The key this component last wrote to `activeKey` itself. A prop equal to it is the component's own state (what an
|
|
@@ -20,9 +20,7 @@ export interface TagInputProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
20
20
|
/** The input text, bindable; leave it out for an uncontrolled text. `bind:inputValue={get, set}` makes it fully controlled */
|
|
21
21
|
inputValue?: string;
|
|
22
22
|
disabled?: boolean;
|
|
23
|
-
/** Maximum length of one tag */
|
|
24
23
|
maxLength?: number;
|
|
25
|
-
/** Maximum number of tags */
|
|
26
24
|
max?: number;
|
|
27
25
|
maxTagCount?: number;
|
|
28
26
|
showRestTagsPopover?: boolean;
|
|
@@ -39,7 +37,6 @@ export interface TagInputProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
39
37
|
size?: TagInputSize;
|
|
40
38
|
split?: (originString: string, separators: string | string[] | null) => string[];
|
|
41
39
|
validateStatus?: TagInputValidateStatus;
|
|
42
|
-
/** Focuses the input on mount, with `preventScroll` */
|
|
43
40
|
autofocus?: boolean;
|
|
44
41
|
preventScroll?: boolean;
|
|
45
42
|
onChange?: (value: string[]) => void;
|
|
@@ -62,9 +59,7 @@ export interface TagInputProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
62
59
|
prefix?: Snippet;
|
|
63
60
|
suffix?: Snippet;
|
|
64
61
|
insetLabel?: Snippet;
|
|
65
|
-
/** Replaces the clear icon */
|
|
66
62
|
clearIcon?: Snippet;
|
|
67
|
-
/** Replaces each tag as a whole */
|
|
68
63
|
tag?: Snippet<[TagInputTagSnippetProps]>;
|
|
69
64
|
}
|
|
70
65
|
export {};
|
|
@@ -81,8 +81,6 @@
|
|
|
81
81
|
let clearButton = $state<HTMLButtonElement>();
|
|
82
82
|
let prefixKind = $state<SlotKind>();
|
|
83
83
|
let suffixKind = $state<SlotKind>();
|
|
84
|
-
|
|
85
|
-
// loaded on first use, so an app that never drags does not pay for dnd-kit
|
|
86
84
|
let Sortable = $state.raw<typeof SortableComponent>();
|
|
87
85
|
|
|
88
86
|
// not reactive: only the focus handlers read it, to ignore the blur dnd-kit causes when it moves the picked-up handle
|
|
@@ -283,7 +281,6 @@
|
|
|
283
281
|
}
|
|
284
282
|
);
|
|
285
283
|
|
|
286
|
-
// the placeholder shows only while there are no tags
|
|
287
284
|
watch(() => [inputText, tags.length === 0, placeholder, size], foundation.fitInputWidth);
|
|
288
285
|
|
|
289
286
|
// the sort ids are settled before the DOM patch, or one frame would show tags under the wrong ids
|
|
@@ -7,7 +7,6 @@ type $$ComponentProps = {
|
|
|
7
7
|
size: TagInputSize;
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
showContentTooltip: boolean | ShowTooltip;
|
|
10
|
-
/** the drag handles are on: the tag makes room for one */
|
|
11
10
|
draggableActive: boolean;
|
|
12
11
|
withHandle: boolean;
|
|
13
12
|
tag?: Snippet<[TagInputTagSnippetProps]>;
|
|
@@ -6,7 +6,6 @@ import type { DisabledTimeFns } from '@fibrae/semi-foundation/time-picker/founda
|
|
|
6
6
|
import type { InputProps, InputSize, ValidateStatus } from '../input/index.js';
|
|
7
7
|
import type { ScrollItemProps } from '../scroll-list/index.js';
|
|
8
8
|
import type { Position } from '../tooltip/index.js';
|
|
9
|
-
/** A time as `value` accepts it: a Date, a timestamp, a string in `format`, or an unpicked range side */
|
|
10
9
|
export type TimePickerBaseValueType = string | number | Date | undefined;
|
|
11
10
|
export type TimePickerType = 'time' | 'timeRange';
|
|
12
11
|
/** The column options a caller may set; the panel owns `list`, `selectedIndex` and the selection */
|
|
@@ -50,9 +49,7 @@ export interface TimePickerProps extends Omit<HTMLInputAttributes, NativeInputKe
|
|
|
50
49
|
inputReadOnly?: boolean;
|
|
51
50
|
validateStatus?: ValidateStatus;
|
|
52
51
|
insetLabelId?: string;
|
|
53
|
-
/** Style of the Input's root element */
|
|
54
52
|
inputStyle?: string;
|
|
55
|
-
/** Focuses the input on mount, which opens the panel */
|
|
56
53
|
autofocus?: boolean;
|
|
57
54
|
/** Focuses and selects the input once mounted */
|
|
58
55
|
focusOnOpen?: boolean;
|
|
@@ -83,14 +80,12 @@ export interface TimePickerProps extends Omit<HTMLInputAttributes, NativeInputKe
|
|
|
83
80
|
insetLabel?: Snippet;
|
|
84
81
|
clearIcon?: Snippet;
|
|
85
82
|
}
|
|
86
|
-
/** What `trigger` receives; `onChange` sets the input text, as typing would */
|
|
87
83
|
export interface TimePickerTriggerRenderProps {
|
|
88
84
|
/** The unpicked side of a range is undefined */
|
|
89
85
|
value: (Date | undefined)[];
|
|
90
86
|
inputValue: string;
|
|
91
87
|
placeholder: string;
|
|
92
88
|
disabled: boolean;
|
|
93
|
-
/** The declared props, without snippets and undeclared attributes */
|
|
94
89
|
componentProps: Omit<TimePickerProps, 'trigger' | 'panelHeader' | 'panelFooter' | 'panel' | 'prefix' | 'insetLabel' | 'clearIcon'>;
|
|
95
90
|
onChange: (inputValue: string) => void;
|
|
96
91
|
}
|
|
@@ -100,9 +95,7 @@ export interface TimePickerState {
|
|
|
100
95
|
inputValue: string;
|
|
101
96
|
invalid: boolean;
|
|
102
97
|
}
|
|
103
|
-
/** TimePicker's input; the other Input props reach the Input as they are */
|
|
104
98
|
export interface TimeInputProps extends Omit<InputProps, 'value' | 'onChange' | 'onFocus' | 'onBlur'> {
|
|
105
|
-
/** The input text */
|
|
106
99
|
value?: string;
|
|
107
100
|
inputReadOnly?: boolean;
|
|
108
101
|
invalid?: boolean;
|
|
@@ -111,14 +104,12 @@ export interface TimeInputProps extends Omit<InputProps, 'value' | 'onChange' |
|
|
|
111
104
|
onFocus?: (event: FocusEvent) => void;
|
|
112
105
|
onBlur?: (event: FocusEvent) => void;
|
|
113
106
|
}
|
|
114
|
-
/** One time panel, which DatePicker renders as well */
|
|
115
107
|
export interface ComboboxProps {
|
|
116
108
|
timeStampValue?: TimeStamp;
|
|
117
109
|
format?: string;
|
|
118
110
|
/** Prefix of the column class names (`${prefixCls}-list-hour` and so on); without it the columns get none */
|
|
119
111
|
prefixCls?: string;
|
|
120
112
|
use12Hours?: boolean;
|
|
121
|
-
/** The half day the AM/PM and hour columns show while there is no value */
|
|
122
113
|
defaultIsAM?: boolean;
|
|
123
114
|
hideDisabledOptions?: boolean;
|
|
124
115
|
hourStep?: number;
|
|
@@ -155,7 +155,6 @@
|
|
|
155
155
|
setPanelOpen: (next) => base.setState({ open: next }),
|
|
156
156
|
setInputValue: (inputValue) => base.setState({ inputValue }),
|
|
157
157
|
notifyOpenChange: (next) => {
|
|
158
|
-
// the bindable props are the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
159
158
|
open = next;
|
|
160
159
|
onOpenChange?.(next);
|
|
161
160
|
},
|
|
@@ -252,7 +251,6 @@
|
|
|
252
251
|
return a instanceof Date && b instanceof Date ? a.getTime() === b.getTime() : Object.is(a, b);
|
|
253
252
|
};
|
|
254
253
|
|
|
255
|
-
// Compared by time, so a new Date of the same time does not overwrite the text being typed
|
|
256
254
|
const sameValue = (a: Value, b: Value) => {
|
|
257
255
|
return Array.isArray(a) && Array.isArray(b) ? a.length === b.length && a.every((item, index) => sameTime(item, b[index])) : sameTime(a, b);
|
|
258
256
|
};
|
|
@@ -3,7 +3,6 @@ import type { HTMLAttributes, HTMLLiAttributes } from 'svelte/elements';
|
|
|
3
3
|
import type { TimelineItemPosition, TimelineMode } from '@fibrae/semi-foundation/timeline/utils';
|
|
4
4
|
export type { TimelineItemPosition, TimelineMode };
|
|
5
5
|
export type TimelineItemType = 'default' | 'ongoing' | 'success' | 'warning' | 'error';
|
|
6
|
-
/** An item of `dataSource`; nodes for its content, time and extra come from the Timeline snippets. Other attributes land on the li. */
|
|
7
6
|
export interface TimelineData extends Omit<HTMLLiAttributes, 'color' | 'content' | 'onclick'> {
|
|
8
7
|
content?: string | number;
|
|
9
8
|
time?: string | number;
|
|
@@ -22,10 +21,7 @@ export interface TimelineSnippetProps {
|
|
|
22
21
|
export interface TimelineProps extends HTMLAttributes<HTMLUListElement> {
|
|
23
22
|
mode?: TimelineMode;
|
|
24
23
|
dataSource?: TimelineData[];
|
|
25
|
-
/** Content of each item; defaults to `item.content` */
|
|
26
24
|
content?: Snippet<[TimelineSnippetProps]>;
|
|
27
|
-
/** Time of each item; defaults to `item.time` */
|
|
28
25
|
time?: Snippet<[TimelineSnippetProps]>;
|
|
29
|
-
/** Extra of each item; defaults to `item.extra` */
|
|
30
26
|
extra?: Snippet<[TimelineSnippetProps]>;
|
|
31
27
|
}
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
onClick(event);
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
// only a clickable item is a keyboard target; extra and time stay outside
|
|
27
26
|
const handleKeydown = (event: KeyboardEvent & { currentTarget: HTMLElement }) => {
|
|
28
27
|
if (event.target !== event.currentTarget || (event.key !== 'Enter' && event.key !== ' ')) return;
|
|
29
28
|
event.preventDefault();
|
package/dist/toast/context.d.ts
CHANGED
|
@@ -2,9 +2,7 @@ import type { ToastInstance } from '@fibrae/semi-foundation/toast/toast-foundati
|
|
|
2
2
|
export interface ToastListContext {
|
|
3
3
|
/** The pointer or focus is inside the list: every toast's countdown waits */
|
|
4
4
|
readonly paused: boolean;
|
|
5
|
-
/** The toasts the latest store change updated in place */
|
|
6
5
|
readonly updatedItems: readonly ToastInstance[];
|
|
7
|
-
/** The toasts the store removed that are still leaving */
|
|
8
6
|
readonly removedItems: readonly ToastInstance[];
|
|
9
7
|
/** Queues text for the list's live region; `read` runs when it is written */
|
|
10
8
|
announce: (key: string, read: () => string) => void;
|
|
@@ -13,7 +13,6 @@ export interface ToastProps extends Omit<FoundationToastProps, 'content' | 'icon
|
|
|
13
13
|
icon?: ToastNode;
|
|
14
14
|
motion?: boolean;
|
|
15
15
|
}
|
|
16
|
-
/** Options of one toast opened through the static methods */
|
|
17
16
|
export type ToastOptions = Omit<ToastProps, 'type'>;
|
|
18
17
|
/** Props of the single toast the list renders; list-level options are stripped before they reach it */
|
|
19
18
|
export interface ToastItemProps extends Omit<ToastProps, 'content' | 'stack' | 'top' | 'bottom' | 'left' | 'right' | 'zIndex' | 'getPopupContainer'> {
|
|
@@ -27,7 +26,6 @@ export interface ToastItemProps extends Omit<ToastProps, 'content' | 'stack' | '
|
|
|
27
26
|
/** The store removed the toast: it plays its leave animation, then calls `onLeaveEnd` */
|
|
28
27
|
leaving?: boolean;
|
|
29
28
|
onLeaveEnd?: () => void;
|
|
30
|
-
/** Asks the list to remove the toast, with its id */
|
|
31
29
|
close?: (id: string) => void;
|
|
32
30
|
}
|
|
33
31
|
/** Positioning and layer options belong to the static wrapper; a hook mounts its own wrapper */
|
package/dist/toast/static-api.js
CHANGED
|
@@ -23,7 +23,6 @@ function createBaseToast(initialConfig) {
|
|
|
23
23
|
create(opts) {
|
|
24
24
|
assertClient('Toast', 'Toast.useToast');
|
|
25
25
|
const id = opts.id ?? createId('toast');
|
|
26
|
-
// an explicit undefined must not replace the defaults
|
|
27
26
|
const mergedOpts = { ...store.defaults, ...omitInstanceIds(semiGlobal.config.overrideDefaultProps?.Toast), ...omitBy(opts, (value) => value === undefined) };
|
|
28
27
|
if (!wrapper) {
|
|
29
28
|
wrapper = document.createElement('div');
|
package/dist/toast/toast.svelte
CHANGED
package/dist/toast/use-toast.js
CHANGED
|
@@ -42,7 +42,6 @@ export function createToastHookApi(store, beforeAdd) {
|
|
|
42
42
|
beforeAdd?.();
|
|
43
43
|
const id = createId('toast');
|
|
44
44
|
store.setStack(config.stack);
|
|
45
|
-
// the store holds the options as given (ToastProps), typed as the foundation's ToastInstance
|
|
46
45
|
store.add({ ...config, type, id });
|
|
47
46
|
return id;
|
|
48
47
|
};
|
|
@@ -4,7 +4,6 @@ export interface PopupRegistry {
|
|
|
4
4
|
relayFocus: (event: FocusEvent, from: Element | null) => void;
|
|
5
5
|
}
|
|
6
6
|
export declare const getTooltipPopupsContext: (caller?: string) => PopupRegistry | undefined, setTooltipPopupsContext: (value: PopupRegistry | undefined) => PopupRegistry | undefined;
|
|
7
|
-
/** What a trigger component (Button, Switch, Checkbox) tells the Tooltip around it about itself */
|
|
8
7
|
export interface TriggerState {
|
|
9
8
|
disabled: boolean;
|
|
10
9
|
loading: boolean;
|
|
@@ -12,7 +11,6 @@ export interface TriggerState {
|
|
|
12
11
|
/** The component puts the popup's description on its own control: the wrapper span would not reach it */
|
|
13
12
|
describes?: boolean;
|
|
14
13
|
}
|
|
15
|
-
/** What the Tooltip hands back to a registered trigger to apply to its own elements */
|
|
16
14
|
export interface TriggerBinding {
|
|
17
15
|
/** The Tooltip's span takes the pointer events: a loading Button ignores the pointer and a disabled one gets no click (F4) */
|
|
18
16
|
pointerEventsNone: boolean;
|
|
@@ -32,9 +32,7 @@ export interface TooltipProps extends TooltipBaseProps {
|
|
|
32
32
|
props: TooltipTriggerProps;
|
|
33
33
|
}]>;
|
|
34
34
|
content?: Snippet<[RenderContentProps]>;
|
|
35
|
-
/** Replaces the default arrow while showArrow is true */
|
|
36
35
|
arrow?: Snippet;
|
|
37
|
-
/** On the popup */
|
|
38
36
|
class?: string;
|
|
39
37
|
/** On the popup, before the positioning declarations; its `background-color` also colors the arrow */
|
|
40
38
|
style?: string;
|
|
@@ -89,8 +89,6 @@
|
|
|
89
89
|
const parentPopups = getTooltipPopupsContext();
|
|
90
90
|
|
|
91
91
|
const uid = $props.id();
|
|
92
|
-
|
|
93
|
-
// the trigger element: Tooltip's own span, or the element the `child` snippet spread the trigger props on
|
|
94
92
|
let triggerElement = $state.raw<HTMLElement | null>(null);
|
|
95
93
|
let container = $state.raw<HTMLDivElement | null>(null);
|
|
96
94
|
|
|
@@ -114,8 +112,6 @@
|
|
|
114
112
|
// showing again in one task (focus moving between trigger and popup with a zero delay) stays synchronous
|
|
115
113
|
let selfWritten = false;
|
|
116
114
|
const descendants = new SvelteSet<() => HTMLElement | null>();
|
|
117
|
-
|
|
118
|
-
// trigger components (Button, Switch, Checkbox) by their root element, filled in as they mount
|
|
119
115
|
const triggers = new SvelteMap<Element, () => TriggerState>();
|
|
120
116
|
|
|
121
117
|
const attachmentKey = createAttachmentKey();
|
|
@@ -470,7 +466,6 @@
|
|
|
470
466
|
}
|
|
471
467
|
return untrack(() => {
|
|
472
468
|
if (current === 'enter') {
|
|
473
|
-
// reopened during its exit animation, it is still shown
|
|
474
469
|
if (!element.matches(':popover-open')) {
|
|
475
470
|
element.showPopover();
|
|
476
471
|
}
|
|
@@ -29,7 +29,6 @@ export interface TransferVirtualize {
|
|
|
29
29
|
itemSize: number;
|
|
30
30
|
}
|
|
31
31
|
export interface TransferPagination {
|
|
32
|
-
/** Controlled page of the left list */
|
|
33
32
|
currentPage?: number;
|
|
34
33
|
defaultCurrentPage?: number;
|
|
35
34
|
pageSize?: number;
|
|
@@ -63,7 +62,6 @@ export interface TransferProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
63
62
|
inputProps?: TransferInputProps;
|
|
64
63
|
/** treeList only; of the Tree's snippets only `label` is forwarded */
|
|
65
64
|
treeProps?: TransferTreeProps;
|
|
66
|
-
/** Pages the left list */
|
|
67
65
|
pagination?: TransferPagination;
|
|
68
66
|
/** Renders the selected list virtually; ignored while `draggable` */
|
|
69
67
|
virtualize?: TransferVirtualize;
|
|
@@ -82,11 +80,9 @@ export interface TransferProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
82
80
|
selectedHeader?: Snippet<[TransferSelectedHeaderSnippetProps]>;
|
|
83
81
|
sourcePanel?: Snippet<[TransferSourcePanelSnippetProps]>;
|
|
84
82
|
selectedPanel?: Snippet<[TransferSelectedPanelSnippetProps]>;
|
|
85
|
-
/**
|
|
83
|
+
/** `false` hides the empty state */
|
|
86
84
|
emptyLeft?: Snippet | false;
|
|
87
|
-
/** Nothing selected; `false` hides the empty state */
|
|
88
85
|
emptyRight?: Snippet | false;
|
|
89
|
-
/** The search matches nothing; `false` hides the empty state */
|
|
90
86
|
emptySearch?: Snippet | false;
|
|
91
87
|
}
|
|
92
88
|
/** The methods on a Transfer instance from `bind:this` */
|
|
@@ -126,12 +122,10 @@ export interface TransferSelectedHeaderSnippetProps {
|
|
|
126
122
|
onClear: () => void;
|
|
127
123
|
}
|
|
128
124
|
export interface TransferSourcePanelSnippetProps {
|
|
129
|
-
/** The values of the selected items */
|
|
130
125
|
value: TransferValue;
|
|
131
126
|
loading?: boolean;
|
|
132
127
|
/** Whether a search is on and matches nothing */
|
|
133
128
|
noMatch: boolean;
|
|
134
|
-
/** The items that match the search */
|
|
135
129
|
filterData: TransferDataItem[];
|
|
136
130
|
sourceData: TransferDataItem[];
|
|
137
131
|
propsDataSource: TransferDataSource;
|
|
@@ -143,7 +137,6 @@ export interface TransferSourcePanelSnippetProps {
|
|
|
143
137
|
/** Selects every shown item, or clears them when all are selected */
|
|
144
138
|
onAllClick: () => void;
|
|
145
139
|
onSelectOrRemove: (item: TransferDataItem) => void;
|
|
146
|
-
/** Replaces the selection with the items of these values */
|
|
147
140
|
onSelect: (values: TransferValue) => void;
|
|
148
141
|
}
|
|
149
142
|
export interface TransferSelectedPanelSnippetProps {
|
|
@@ -3,7 +3,6 @@ import type { TransferDataItem, TransferLabelSnippetProps, TransferSelectedItemS
|
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
item: TransferDataItem;
|
|
5
5
|
index: number;
|
|
6
|
-
/** treeList with showPath: the text shown instead of the label */
|
|
7
6
|
pathLabel?: string;
|
|
8
7
|
disabled?: boolean;
|
|
9
8
|
draggable: boolean;
|
|
@@ -122,7 +122,6 @@
|
|
|
122
122
|
notifyBlur: (event) => onBlur?.(event),
|
|
123
123
|
updateSelected: (selectedValues) => base.setState({ selectedValues }),
|
|
124
124
|
notifyChange: (values, items) => {
|
|
125
|
-
// the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
126
125
|
value = values;
|
|
127
126
|
onChange?.(values, items as TransferDataItem[]);
|
|
128
127
|
},
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
children: Snippet<[{ height: number; width: number | string }]>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/** Passes a pixel height to its snippet: `defaultHeight` when it is a number, else the parent's content height */
|
|
13
12
|
let { defaultHeight, defaultWidth = '100%', children }: AutoSizerProps = $props();
|
|
14
13
|
|
|
15
14
|
let wrapper = $state<HTMLDivElement>();
|
package/dist/tree/context.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export interface TreeContextValue {
|
|
|
17
17
|
onNodeCheck: (event: MouseEvent | KeyboardEvent, row: TreeRowProps) => void;
|
|
18
18
|
onNodeRightClick?: (event: MouseEvent, row: TreeRowProps) => void;
|
|
19
19
|
onNodeDoubleClick?: (event: MouseEvent, row: TreeRowProps) => void;
|
|
20
|
-
/** The drag handlers get the row element as `nodeInstance` */
|
|
21
20
|
onNodeDragStart?: (event: DragEvent, row: TreeRowProps) => void;
|
|
22
21
|
onNodeDragEnter?: (event: DragEvent, row: TreeRowProps) => void;
|
|
23
22
|
onNodeDragOver?: (event: DragEvent, row: TreeRowProps) => void;
|
package/dist/tree/interface.d.ts
CHANGED
|
@@ -41,7 +41,6 @@ export interface TreeScrollData {
|
|
|
41
41
|
export interface TreeLabelSnippetProps {
|
|
42
42
|
item: TreeNodeData;
|
|
43
43
|
label?: string | number;
|
|
44
|
-
/** The search keyword, empty while not searching */
|
|
45
44
|
searchWord: string;
|
|
46
45
|
}
|
|
47
46
|
export interface TreeIconSnippetProps {
|
|
@@ -77,7 +76,6 @@ export interface TreeFullLabelSnippetProps {
|
|
|
77
76
|
};
|
|
78
77
|
filtered: boolean;
|
|
79
78
|
searchWord: string;
|
|
80
|
-
/** Selects the row, or checks it in a multiple tree */
|
|
81
79
|
onClick: (event: MouseEvent) => void;
|
|
82
80
|
onCheck: (event: MouseEvent) => void;
|
|
83
81
|
onExpand: (event: MouseEvent) => void;
|
|
@@ -92,7 +90,6 @@ export interface TreeSearchSnippetProps {
|
|
|
92
90
|
onChange: (value: string) => void;
|
|
93
91
|
}
|
|
94
92
|
export interface TreeDraggingNodeSnippetProps {
|
|
95
|
-
/** The dragged row element */
|
|
96
93
|
nodeInstance: HTMLElement;
|
|
97
94
|
node: TreeNodeData;
|
|
98
95
|
}
|
|
@@ -124,7 +121,6 @@ export interface TreeProps extends Omit<HTMLAttributes<HTMLDivElement>, NativeKe
|
|
|
124
121
|
loadedKeys?: string[];
|
|
125
122
|
motion?: boolean;
|
|
126
123
|
multiple?: boolean;
|
|
127
|
-
/** `onChange` reports the nodes instead of their values */
|
|
128
124
|
onChangeWithObject?: boolean;
|
|
129
125
|
showClear?: boolean;
|
|
130
126
|
showFilteredOnly?: boolean;
|
|
@@ -152,7 +148,6 @@ export interface TreeProps extends Omit<HTMLAttributes<HTMLDivElement>, NativeKe
|
|
|
152
148
|
onDragLeave?: (info: TreeDragProps) => void;
|
|
153
149
|
onDragEnd?: (info: TreeDragProps) => void;
|
|
154
150
|
onDrop?: (info: TreeOnDragProps) => void;
|
|
155
|
-
/** Content of a row's label */
|
|
156
151
|
label?: Snippet<[TreeLabelSnippetProps]>;
|
|
157
152
|
/** A row's icon, in place of the directory icon */
|
|
158
153
|
icon?: Snippet<[TreeIconSnippetProps]>;
|
|
@@ -162,14 +157,12 @@ export interface TreeProps extends Omit<HTMLAttributes<HTMLDivElement>, NativeKe
|
|
|
162
157
|
/** Replaces the search box; `false` hides it while `filterTreeNode` still filters */
|
|
163
158
|
search?: Snippet<[TreeSearchSnippetProps]> | false;
|
|
164
159
|
emptyContent?: Snippet;
|
|
165
|
-
/** The image the browser shows while a node is dragged */
|
|
166
160
|
renderDraggingNode?: Snippet<[TreeDraggingNodeSnippetProps]>;
|
|
167
161
|
}
|
|
168
162
|
/** The methods on a Tree instance from `bind:this` */
|
|
169
163
|
export interface TreeHandle {
|
|
170
164
|
/** Searches as if typed into the search box; needs `filterTreeNode` */
|
|
171
165
|
search: (value: string) => void;
|
|
172
|
-
/** Scrolls a virtualized tree to an expanded node */
|
|
173
166
|
scrollTo: (scrollData: TreeScrollData) => void;
|
|
174
167
|
}
|
|
175
168
|
export interface FlattenNode extends BasicFlattenNode {
|
|
@@ -198,10 +191,8 @@ export interface TreeNodeProps {
|
|
|
198
191
|
row: TreeRowProps;
|
|
199
192
|
/** The row's id, which the tree's aria-activedescendant points at */
|
|
200
193
|
id: string;
|
|
201
|
-
/** The row the keyboard is on */
|
|
202
194
|
focused?: boolean;
|
|
203
195
|
showLine?: boolean;
|
|
204
|
-
/** The position of a virtual row */
|
|
205
196
|
rowStyle?: string;
|
|
206
197
|
label?: Snippet<[TreeLabelSnippetProps]>;
|
|
207
198
|
icon?: Snippet<[TreeIconSnippetProps]>;
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
import type { FlattenNode, NodeListProps } from './interface.js';
|
|
10
10
|
import NodeCollapsible from './node-collapsible.svelte';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* The rows of Tree and TreeSelect. A virtualized list renders the rows in view; otherwise every row renders, with the
|
|
14
|
-
* ones that appear or disappear (motionKeys) grouped into one animated NodeCollapsible.
|
|
15
|
-
*/
|
|
16
12
|
let { flattenNodes, flattenList, motionKeys, motionType = null, motion, virtualize, itemKey, searchTargetIsDeep = false, children: renderRow }: NodeListProps = $props();
|
|
17
13
|
|
|
18
14
|
const config = useConfig();
|
|
@@ -80,7 +80,6 @@
|
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
// the foundation reads the row element from nodeInstance, to place the drop and to build the drag image
|
|
84
83
|
const withInstance = (event: DragEvent): TreeRowProps => ({ ...row, nodeInstance: event.currentTarget });
|
|
85
84
|
|
|
86
85
|
const onDragstart = (event: DragEvent) => {
|
package/dist/tree/tree.svelte
CHANGED
|
@@ -79,7 +79,6 @@
|
|
|
79
79
|
icon,
|
|
80
80
|
expandIcon,
|
|
81
81
|
fullLabel,
|
|
82
|
-
// renamed: the instance method `search` takes the name
|
|
83
82
|
search: searchBox,
|
|
84
83
|
emptyContent,
|
|
85
84
|
renderDraggingNode,
|
|
@@ -191,7 +190,6 @@
|
|
|
191
190
|
},
|
|
192
191
|
};
|
|
193
192
|
|
|
194
|
-
/** Remembers whether the tree owned the prop when writing it back */
|
|
195
193
|
const echo = (name: Bindable, next: unknown) => {
|
|
196
194
|
echoes[name] = foundationProps[name] === undefined ? { value: next } : undefined;
|
|
197
195
|
};
|
|
@@ -399,7 +397,6 @@
|
|
|
399
397
|
foundation.handleInputChange(input);
|
|
400
398
|
}
|
|
401
399
|
|
|
402
|
-
/** Scrolls a virtualized tree to an expanded node */
|
|
403
400
|
export function scrollTo(scrollData: TreeScrollData) {
|
|
404
401
|
foundation.scrollTo(scrollData);
|
|
405
402
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { FlattenNode, TreeRowProps } from './interface.js';
|
|
2
2
|
export interface TreeKeyboardOptions {
|
|
3
|
-
/** The visible rows the keys act on; none while there is no tree to act on */
|
|
4
3
|
rows: () => FlattenNode[];
|
|
5
4
|
/** The row the keys act on before any is chosen, -1 for none */
|
|
6
5
|
defaultIndex: () => number;
|
|
@@ -14,23 +13,17 @@ export interface TreeKeyboardOptions {
|
|
|
14
13
|
editing?: (event: KeyboardEvent) => boolean;
|
|
15
14
|
/** Enter, and Space outside a text field: selects, or checks in a multiple tree */
|
|
16
15
|
select: (event: KeyboardEvent, row: TreeRowProps) => void;
|
|
17
|
-
/** Expands or collapses the row */
|
|
18
16
|
expand: (event: KeyboardEvent, row: TreeRowProps) => void;
|
|
19
|
-
/** Scrolls the row the keys moved to into view */
|
|
20
17
|
reveal: (index: number, key: string) => void;
|
|
21
18
|
}
|
|
22
19
|
/**
|
|
23
20
|
* The keys of an APG tree view: focus stays on the tree (or the combobox) and the keys act on the active row, which
|
|
24
|
-
* aria-activedescendant points at.
|
|
25
|
-
* and Left open, enter, close or leave a branch (swapped in RTL), typed characters move to the next row starting
|
|
26
|
-
* with them.
|
|
21
|
+
* aria-activedescendant points at. Right and Left swap in RTL.
|
|
27
22
|
*/
|
|
28
23
|
export default function useTreeKeyboard(options: TreeKeyboardOptions): {
|
|
29
24
|
readonly activeIndex: number;
|
|
30
25
|
readonly activeKey: string | undefined;
|
|
31
|
-
/** Makes the row the pointer acted on the keyboard's row */
|
|
32
26
|
activate: (key: string) => void;
|
|
33
|
-
/** Drops the keyboard's row, so the default row takes over */
|
|
34
27
|
reset: () => void;
|
|
35
28
|
handleKeyDown: (event: KeyboardEvent) => boolean;
|
|
36
29
|
};
|