@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
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
import type { Item } from '@fibrae/semi-foundation/scroll-list/item-foundation';
|
|
4
|
-
/** An entry of a column: `text` (or `value`) is shown, `transform` formats the selected one */
|
|
5
4
|
export type ScrollListItem = Item;
|
|
6
5
|
export interface ScrollListProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
6
|
bodyHeight?: number | string;
|
|
@@ -23,7 +22,6 @@ export interface ScrollItemProps<T extends ScrollListItem = ScrollListItem> exte
|
|
|
23
22
|
type?: string | number;
|
|
24
23
|
onSelect?: (data: ScrollItemSelectData<T>) => void;
|
|
25
24
|
}
|
|
26
|
-
/** The selected item with the column's `type` and the item's index in `list` */
|
|
27
25
|
export type ScrollItemSelectData<T extends ScrollListItem = ScrollListItem> = T & {
|
|
28
26
|
type?: string | number;
|
|
29
27
|
index: number;
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
const current = $derived(selectedIndex ?? defaults('selectedIndex', 0));
|
|
31
31
|
const isWheel = $derived(mode === 'wheel');
|
|
32
32
|
|
|
33
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
34
33
|
const foundationProps: ScrollItemBaseProps<T> = {
|
|
35
34
|
get cycled() {
|
|
36
35
|
return cycled;
|
|
@@ -101,7 +100,6 @@
|
|
|
101
100
|
return [...copies(states().prependCount, 'pre').toReversed().flat(), ...items(''), ...copies(states().appendCount, 'app').flat()];
|
|
102
101
|
});
|
|
103
102
|
|
|
104
|
-
// Focus stays on the listbox and the selected option is its active descendant
|
|
105
103
|
const optionId = (index: number) => {
|
|
106
104
|
return `${uid}-option-${index}`;
|
|
107
105
|
};
|
|
@@ -6,11 +6,9 @@ import type { PopoverProps } from '../popover/index.js';
|
|
|
6
6
|
import type { TagCloseEvent } from '../tag/index.js';
|
|
7
7
|
import type { Position } from '../tooltip/index.js';
|
|
8
8
|
export type BasicSelectValue = string | number | Record<string, any>;
|
|
9
|
-
/** A single value, an array of them in multiple mode, or option records with `onChangeWithObject` */
|
|
10
9
|
export type SelectValue = BasicSelectValue | BasicSelectValue[] | undefined;
|
|
11
10
|
export type SelectSize = Size;
|
|
12
11
|
export interface SelectVirtualize {
|
|
13
|
-
/** The height of every option row in pixels */
|
|
14
12
|
itemSize: number;
|
|
15
13
|
height?: number;
|
|
16
14
|
width?: string | number;
|
|
@@ -20,7 +18,6 @@ export interface SelectOptionGroup {
|
|
|
20
18
|
key: string | number;
|
|
21
19
|
label?: string | number;
|
|
22
20
|
}
|
|
23
|
-
/** An `optionList` entry, and the option record the callbacks report; any other field rides along */
|
|
24
21
|
export interface SelectOptionProps {
|
|
25
22
|
value?: string | number;
|
|
26
23
|
label?: string | number;
|
|
@@ -34,7 +31,6 @@ export interface SelectOptionProps {
|
|
|
34
31
|
style?: string;
|
|
35
32
|
[key: string]: any;
|
|
36
33
|
}
|
|
37
|
-
/** The search input's extra props; `class` and `style` land on the Input wrapper */
|
|
38
34
|
export type SelectInputProps = Omit<InputProps, 'value'>;
|
|
39
35
|
export interface SelectOptionItemSnippetProps {
|
|
40
36
|
/** Put it on the role="option" element: the combobox's aria-activedescendant points at it */
|
|
@@ -60,7 +56,6 @@ export interface SelectGroupLabelSnippetProps {
|
|
|
60
56
|
export interface SelectCreateItemSnippetProps {
|
|
61
57
|
inputValue: string;
|
|
62
58
|
focus: boolean;
|
|
63
|
-
/** The virtual list's row position */
|
|
64
59
|
style?: string;
|
|
65
60
|
}
|
|
66
61
|
export interface SelectSelectedItemSnippetProps {
|
|
@@ -75,7 +70,6 @@ export interface SelectTriggerSnippetProps {
|
|
|
75
70
|
inputValue: string;
|
|
76
71
|
placeholder?: string;
|
|
77
72
|
disabled: boolean;
|
|
78
|
-
/** Updates the search keyword */
|
|
79
73
|
onSearch: (inputValue: string) => void;
|
|
80
74
|
/** Pass the click event when bound to a control inside the trigger, so the click does not open the list */
|
|
81
75
|
onClear: (event?: MouseEvent) => void;
|
|
@@ -96,7 +90,6 @@ export interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, Native
|
|
|
96
90
|
defaultOpen?: boolean;
|
|
97
91
|
clickToHide?: boolean;
|
|
98
92
|
defaultActiveFirstOption?: boolean;
|
|
99
|
-
/** `onChange` and `value` carry option records instead of values */
|
|
100
93
|
onChangeWithObject?: boolean;
|
|
101
94
|
max?: number;
|
|
102
95
|
maxTagCount?: number;
|
|
@@ -141,7 +134,6 @@ export interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, Native
|
|
|
141
134
|
onExceed?: (option: SelectOptionProps) => void;
|
|
142
135
|
onCreate?: (option: SelectOptionProps) => void;
|
|
143
136
|
onClear?: () => void;
|
|
144
|
-
/** Once when the focus enters the Select */
|
|
145
137
|
onFocus?: (event: FocusEvent) => void;
|
|
146
138
|
/** Once when the focus leaves the Select; a press outside the open dropdown passes its mousedown event */
|
|
147
139
|
onBlur?: (event: FocusEvent | MouseEvent) => void;
|
|
@@ -157,19 +149,13 @@ export interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, Native
|
|
|
157
149
|
innerTopSlot?: Snippet;
|
|
158
150
|
outerBottomSlot?: Snippet;
|
|
159
151
|
innerBottomSlot?: Snippet;
|
|
160
|
-
/** Replaces a whole option row */
|
|
161
152
|
optionItem?: Snippet<[SelectOptionItemSnippetProps]>;
|
|
162
153
|
/** Replaces the text of each option row; the row, its tick and its keyboard behavior stay. Search keywords are not highlighted */
|
|
163
154
|
optionLabel?: Snippet<[SelectOptionLabelSnippetProps]>;
|
|
164
|
-
/** Replaces the title of each group; the title text defaults to `group.label` */
|
|
165
155
|
groupLabel?: Snippet<[SelectGroupLabelSnippetProps]>;
|
|
166
|
-
/** Content of the row that creates an option from the keyword */
|
|
167
156
|
createItem?: Snippet<[SelectCreateItemSnippetProps]>;
|
|
168
|
-
/** The selected content in single mode, the content of each tag in multiple mode */
|
|
169
157
|
selectedItem?: Snippet<[SelectSelectedItemSnippetProps]>;
|
|
170
|
-
/** Replaces each tag in multiple mode */
|
|
171
158
|
tag?: Snippet<[SelectSelectedItemSnippetProps]>;
|
|
172
|
-
/** Replaces the trigger content */
|
|
173
159
|
trigger?: Snippet<[SelectTriggerSnippetProps]>;
|
|
174
160
|
}
|
|
175
161
|
export {};
|
|
@@ -14,21 +14,16 @@
|
|
|
14
14
|
label?: string | number;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
showTick?: boolean;
|
|
17
|
-
/** The row stands for the empty state; children hold its content */
|
|
18
17
|
empty?: boolean;
|
|
19
18
|
selected?: boolean;
|
|
20
|
-
/** Highlighted by the keyboard or the pointer */
|
|
21
19
|
focused?: boolean;
|
|
22
20
|
/** The row aria-activedescendant points at; AutoComplete marks it aria-selected */
|
|
23
21
|
current?: boolean;
|
|
24
|
-
/** Highlighted in a plain-text label */
|
|
25
22
|
inputValue?: string;
|
|
26
23
|
prefixCls?: string;
|
|
27
24
|
class?: ClassValue;
|
|
28
25
|
style?: string;
|
|
29
|
-
/** The option's data-* fields */
|
|
30
26
|
dataAttrs?: Record<string, unknown>;
|
|
31
|
-
/** Replaces the label text */
|
|
32
27
|
children?: Snippet;
|
|
33
28
|
onSelect?: (event: MouseEvent) => void;
|
|
34
29
|
onMouseEnter?: (event: MouseEvent) => void;
|
|
@@ -9,21 +9,16 @@ interface OptionRowProps {
|
|
|
9
9
|
label?: string | number;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
showTick?: boolean;
|
|
12
|
-
/** The row stands for the empty state; children hold its content */
|
|
13
12
|
empty?: boolean;
|
|
14
13
|
selected?: boolean;
|
|
15
|
-
/** Highlighted by the keyboard or the pointer */
|
|
16
14
|
focused?: boolean;
|
|
17
15
|
/** The row aria-activedescendant points at; AutoComplete marks it aria-selected */
|
|
18
16
|
current?: boolean;
|
|
19
|
-
/** Highlighted in a plain-text label */
|
|
20
17
|
inputValue?: string;
|
|
21
18
|
prefixCls?: string;
|
|
22
19
|
class?: ClassValue;
|
|
23
20
|
style?: string;
|
|
24
|
-
/** The option's data-* fields */
|
|
25
21
|
dataAttrs?: Record<string, unknown>;
|
|
26
|
-
/** Replaces the label text */
|
|
27
22
|
children?: Snippet;
|
|
28
23
|
onSelect?: (event: MouseEvent) => void;
|
|
29
24
|
onMouseEnter?: (event: MouseEvent) => void;
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
stopPropagation = defaults('stopPropagation', true),
|
|
90
90
|
virtualize = defaults('virtualize'),
|
|
91
91
|
preventScroll = defaults('preventScroll'),
|
|
92
|
-
// a global id would repeat on every instance, and aria-controls and aria-activedescendant would point elsewhere
|
|
93
92
|
id,
|
|
94
93
|
onChange,
|
|
95
94
|
onDropdownVisibleChange,
|
|
@@ -145,11 +144,8 @@
|
|
|
145
144
|
const disabled = $derived(disabledProp ?? group?.disabled ?? defaults('disabled') ?? false);
|
|
146
145
|
const size = $derived(sizeProp ?? group?.size ?? defaults('size', 'default'));
|
|
147
146
|
const cls = cssClasses.PREFIX;
|
|
148
|
-
|
|
149
|
-
// the foundation filters by the group label and the list renders runs of one group through the record's group
|
|
150
147
|
const collectedOptions: OptionRecord[] = $derived((optionList ?? []).map((item, index) => toOptionRecord(item, index, item.group)));
|
|
151
148
|
|
|
152
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
153
149
|
const foundationProps: FoundationProps = {
|
|
154
150
|
get allowCreate() {
|
|
155
151
|
return allowCreate;
|
|
@@ -232,7 +228,6 @@
|
|
|
232
228
|
updateSelection: (selections) => base.setState({ selections }),
|
|
233
229
|
getSelections: () => new Map(base.getState('selections')),
|
|
234
230
|
notifyChange: (next) => {
|
|
235
|
-
// the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
236
231
|
value = next as SelectValue;
|
|
237
232
|
onChange?.(next as SelectValue);
|
|
238
233
|
},
|
|
@@ -240,7 +235,6 @@
|
|
|
240
235
|
notifyDropdownVisibleChange: (visible) => onDropdownVisibleChange?.(visible),
|
|
241
236
|
notifySearch: (inputValue, event) => onSearch?.(inputValue, event),
|
|
242
237
|
notifyCreate: (option) => onCreate?.(option as SelectOptionProps),
|
|
243
|
-
// mouseenter and mouseleave reach the root as native listeners through the rest props
|
|
244
238
|
notifyMouseEnter: () => undefined,
|
|
245
239
|
notifyMouseLeave: () => undefined,
|
|
246
240
|
notifyFocus: (event) => onFocus?.(event),
|
|
@@ -280,7 +274,6 @@
|
|
|
280
274
|
const selectedItems = $derived([...states().selections.values()] as SelectOptionProps[]);
|
|
281
275
|
const optionRuns = $derived(getOptionRuns(visibleOptions));
|
|
282
276
|
|
|
283
|
-
// while loading the list shows a spinner instead of the options
|
|
284
277
|
const activeDescendant = $derived.by(() => {
|
|
285
278
|
const { isOpen, focusIndex } = states();
|
|
286
279
|
return isOpen && !loading && focusIndex !== -1 && focusIndex < visibleOptions.length ? optionId(focusIndex) : undefined;
|
|
@@ -345,12 +338,10 @@
|
|
|
345
338
|
return `${selectId}-option-${index}`;
|
|
346
339
|
};
|
|
347
340
|
|
|
348
|
-
// the record's index, not the visible index: a row that filtering moves up keeps its node
|
|
349
341
|
const rowKey = ({ data, childKey, index }: OptionRecord) => {
|
|
350
342
|
return String(data.key ?? childKey ?? `${data.label}${data.value}${index}`);
|
|
351
343
|
};
|
|
352
344
|
|
|
353
|
-
// a group needs a title for its accessible name, so a group without a label renders its options bare
|
|
354
345
|
const hasTitle = (group?: SelectOptionGroup): group is SelectOptionGroup => {
|
|
355
346
|
return Boolean(group && (group.label || group.label === 0));
|
|
356
347
|
};
|
|
@@ -372,7 +363,6 @@
|
|
|
372
363
|
foundation.handleClearClick(event);
|
|
373
364
|
};
|
|
374
365
|
|
|
375
|
-
// the option as kept in state, the same object Enter selects
|
|
376
366
|
const handleSelect = (option: OptionRecord, index: number, event: MouseEvent) => {
|
|
377
367
|
foundation.onSelect(option as BaseOptionRecord, index, event);
|
|
378
368
|
};
|
|
@@ -487,7 +477,6 @@
|
|
|
487
477
|
const removeTag = (option: SelectOptionProps, event?: TagCloseEvent) => {
|
|
488
478
|
// keeps the Tag from hiding itself in controlled mode
|
|
489
479
|
event?.preventDefault();
|
|
490
|
-
// as with the clear button, a tag going while it has the focus hands the focus to the combobox
|
|
491
480
|
const target = event?.currentTarget instanceof Element ? event.currentTarget.closest(`.${tagCssClasses.PREFIX}`) : null;
|
|
492
481
|
if (target && target === FocusTrapHandle.getActiveElement(target)) {
|
|
493
482
|
foundation.focus(undefined, false);
|
|
@@ -546,7 +535,6 @@
|
|
|
546
535
|
foundation.clearInput();
|
|
547
536
|
}
|
|
548
537
|
|
|
549
|
-
/** Selects every shown, enabled option (multiple only) */
|
|
550
538
|
export function selectAll() {
|
|
551
539
|
foundation.selectAll();
|
|
552
540
|
}
|
|
@@ -555,7 +543,6 @@
|
|
|
555
543
|
foundation.clearSelected();
|
|
556
544
|
}
|
|
557
545
|
|
|
558
|
-
/** Searches as if `keyword` were typed into the search input */
|
|
559
546
|
export function search(keyword: string, event?: Event) {
|
|
560
547
|
foundation.handleInputChange(keyword, event);
|
|
561
548
|
}
|
|
@@ -860,7 +847,6 @@
|
|
|
860
847
|
class={[`${cls}-dropdown-input`, multiple ? `${cls}-dropdown-input-multiple` : `${cls}-dropdown-input-single`, inputProps?.class]}
|
|
861
848
|
onKeyDown={(event) => {
|
|
862
849
|
inputProps?.onKeyDown?.(event);
|
|
863
|
-
// the popup is not a DOM descendant of the trigger, so the key does not bubble to it
|
|
864
850
|
foundation.handleKeyDown(event);
|
|
865
851
|
}}
|
|
866
852
|
/>
|
|
@@ -62,11 +62,7 @@
|
|
|
62
62
|
const uid = $props.id();
|
|
63
63
|
let rootEl = $state.raw<HTMLDivElement | null>(null);
|
|
64
64
|
let dialogEl = $state.raw<HTMLDivElement | null>(null);
|
|
65
|
-
|
|
66
|
-
// True until the first show, and again once a leave animation has ended; the sheet stays mounted while it is false
|
|
67
65
|
let displayNone = $state(true);
|
|
68
|
-
|
|
69
|
-
// The animation the mask and the dialog play; each run ends with the dialog's animationend
|
|
70
66
|
let animating = $state<'show' | 'hide'>();
|
|
71
67
|
let started = false;
|
|
72
68
|
let shown = false;
|
|
@@ -84,7 +80,6 @@
|
|
|
84
80
|
const maskAnimation = $derived(animating ? `${prefix}-animation-mask_${animating}` : undefined);
|
|
85
81
|
const dialogAnimation = $derived(animating ? `${prefix}-animation-content_${animating}_${placement}` : undefined);
|
|
86
82
|
|
|
87
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
88
83
|
const foundationProps: SideSheetBaseProps = {
|
|
89
84
|
get closeOnEsc() {
|
|
90
85
|
return closeOnEsc;
|
|
@@ -109,7 +104,6 @@
|
|
|
109
104
|
disabledBodyScroll: () => (isModal() ? scroll.hold(lockBodyScroll) : scroll.release()),
|
|
110
105
|
enabledBodyScroll: () => scroll.release(),
|
|
111
106
|
notifyCancel: (event) => {
|
|
112
|
-
// the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
113
107
|
visible = false;
|
|
114
108
|
onCancel?.(event);
|
|
115
109
|
},
|
|
@@ -203,7 +197,6 @@
|
|
|
203
197
|
});
|
|
204
198
|
});
|
|
205
199
|
|
|
206
|
-
// The sheet takes the layer, scroll lock and focus once its content is in the document
|
|
207
200
|
$effect(() => {
|
|
208
201
|
const element = dialogEl;
|
|
209
202
|
if (!visible || !element || !rootEl) {
|
|
@@ -226,7 +219,6 @@
|
|
|
226
219
|
|
|
227
220
|
onMount(() => {
|
|
228
221
|
shown = !hidden;
|
|
229
|
-
// Unmounting while shown or leaving counts as hiding
|
|
230
222
|
return () => {
|
|
231
223
|
if (shown) {
|
|
232
224
|
foundation.onVisibleChange(false);
|
|
@@ -234,7 +226,6 @@
|
|
|
234
226
|
};
|
|
235
227
|
});
|
|
236
228
|
|
|
237
|
-
/** The outer `.semi-sidesheet` element inside the portal; null while nothing is rendered */
|
|
238
229
|
export function getRoot() {
|
|
239
230
|
return rootEl;
|
|
240
231
|
}
|
package/dist/skeleton/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import ImagePart from './image.svelte';
|
|
|
4
4
|
import ParagraphPart from './paragraph.svelte';
|
|
5
5
|
import SkeletonBase from './skeleton.svelte';
|
|
6
6
|
import TitlePart from './title.svelte';
|
|
7
|
-
// Svelte components are functions, so the parts attach to the component itself
|
|
8
7
|
export const Skeleton = Object.assign(SkeletonBase, { Avatar: AvatarPart, Title: TitlePart, Button: ButtonPart, Paragraph: ParagraphPart, Image: ImagePart });
|
|
9
8
|
export { default as SkeletonAvatar } from './avatar.svelte';
|
|
10
9
|
export { default as SkeletonButton } from './button.svelte';
|
|
@@ -3,9 +3,7 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
3
3
|
export interface SkeletonProps extends Omit<HTMLAttributes<HTMLDivElement>, 'placeholder'> {
|
|
4
4
|
active?: boolean;
|
|
5
5
|
loading?: boolean;
|
|
6
|
-
/** Shown while `loading` is true */
|
|
7
6
|
placeholder?: Snippet;
|
|
8
|
-
/** Shown once `loading` is false */
|
|
9
7
|
children?: Snippet;
|
|
10
8
|
}
|
|
11
9
|
export interface SkeletonBasicProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import '@fibrae/semi-foundation/skeleton/skeleton.css';
|
|
4
4
|
import type { SkeletonAvatarProps } from './interface.js';
|
|
5
5
|
|
|
6
|
-
// The shared block behind Avatar, Image, Title and Button, which differ only in their default type
|
|
7
6
|
let { prefixCls = cssClasses.PREFIX, type, size = 'medium', shape = 'circle', ...rest }: SkeletonAvatarProps & { type: string } = $props();
|
|
8
7
|
|
|
9
8
|
const base = $derived(`${prefixCls}-${type}`);
|
|
@@ -7,7 +7,6 @@ export interface SliderMarkSnippetProps {
|
|
|
7
7
|
label: string | number;
|
|
8
8
|
}
|
|
9
9
|
export interface SliderTipSnippetProps {
|
|
10
|
-
/** The handle's value after `tipFormatter` */
|
|
11
10
|
value: string | number;
|
|
12
11
|
handle: 'min' | 'max';
|
|
13
12
|
}
|
|
@@ -17,7 +16,6 @@ export interface SliderProps extends Omit<HTMLAttributes<HTMLDivElement>, Native
|
|
|
17
16
|
value?: number | number[];
|
|
18
17
|
disabled?: boolean;
|
|
19
18
|
included?: boolean;
|
|
20
|
-
/** Mark labels by value; node labels go through the `mark` snippet */
|
|
21
19
|
marks?: Record<number, string | number>;
|
|
22
20
|
max?: number;
|
|
23
21
|
min?: number;
|
|
@@ -33,7 +31,6 @@ export interface SliderProps extends Omit<HTMLAttributes<HTMLDivElement>, Native
|
|
|
33
31
|
vertical?: boolean;
|
|
34
32
|
verticalReverse?: boolean;
|
|
35
33
|
railStyle?: string;
|
|
36
|
-
/** One dot for a single handle, one per handle for a range */
|
|
37
34
|
handleDot?: HandleDot | HandleDot[];
|
|
38
35
|
/** Names the first handle's input, so a `<label for>` focuses the slider */
|
|
39
36
|
id?: string;
|
|
@@ -47,8 +44,6 @@ export interface SliderProps extends Omit<HTMLAttributes<HTMLDivElement>, Native
|
|
|
47
44
|
onBlur?: (event: FocusEvent) => void;
|
|
48
45
|
/** On the handle inputs, before the slider's own handling, so `preventDefault()` keeps a value key from moving the handle */
|
|
49
46
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
50
|
-
/** A mark's label next to the mark and, with `tooltipOnMark`, in its tooltip */
|
|
51
47
|
mark?: Snippet<[SliderMarkSnippetProps]>;
|
|
52
|
-
/** A handle's tooltip content */
|
|
53
48
|
tip?: Snippet<[SliderTipSnippetProps]>;
|
|
54
49
|
}
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
let seen = untrack(() => value);
|
|
77
77
|
let written: number | number[] | undefined;
|
|
78
78
|
|
|
79
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
80
79
|
const foundationProps: BasicSliderProps = {
|
|
81
80
|
get disabled() {
|
|
82
81
|
return disabled;
|
|
@@ -117,7 +116,6 @@
|
|
|
117
116
|
() => ({
|
|
118
117
|
getSliderNode: () => slider,
|
|
119
118
|
notifyChange: (next) => {
|
|
120
|
-
// the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
121
119
|
written = next;
|
|
122
120
|
value = next;
|
|
123
121
|
onChange?.(next);
|
|
@@ -153,8 +151,6 @@
|
|
|
153
151
|
);
|
|
154
152
|
|
|
155
153
|
const shownMarks = $derived(markList.filter((item) => item.active !== false));
|
|
156
|
-
|
|
157
|
-
// aria-*, name and autofocus name and focus the inputs; the wrapper takes the rest
|
|
158
154
|
const attrs = $derived(splitControlAttrs(rest, (key) => key.startsWith('aria-') || key === 'name' || key === 'autofocus' || key === 'tabindex'));
|
|
159
155
|
|
|
160
156
|
// The inputs are the Tab stops, and the slider role supports no aria-required (a native range has no required either);
|
|
@@ -227,18 +223,15 @@
|
|
|
227
223
|
}
|
|
228
224
|
seen = next;
|
|
229
225
|
if (next === undefined) {
|
|
230
|
-
// a form reset: back to the default position, nothing to report
|
|
231
226
|
controlled = false;
|
|
232
227
|
foundation.resetValue();
|
|
233
228
|
return;
|
|
234
229
|
}
|
|
235
|
-
// the echo of a change the foundation already applied
|
|
236
230
|
if (!controlled && isEqual(next, written)) {
|
|
237
231
|
return;
|
|
238
232
|
}
|
|
239
233
|
controlled = true;
|
|
240
234
|
foundation.handleValueChange(next);
|
|
241
|
-
// a controlled value change ends a change too
|
|
242
235
|
onAfterChange?.(next);
|
|
243
236
|
}
|
|
244
237
|
);
|
package/dist/space/space.svelte
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
const prefixCls = cssClasses.PREFIX;
|
|
11
11
|
const presets: string[] = [strings.SPACING_TIGHT, strings.SPACING_MEDIUM, strings.SPACING_LOOSE];
|
|
12
12
|
|
|
13
|
-
// A preset becomes a class; a number becomes a gap in px
|
|
14
13
|
const axes = $derived.by(() => {
|
|
15
14
|
const [columns, rows]: Spacing[] = Array.isArray(spacing) ? spacing : [spacing, spacing];
|
|
16
15
|
return {
|
package/dist/steps/context.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export interface StepsContextValue {
|
|
|
11
11
|
clickable: boolean;
|
|
12
12
|
title?: Snippet<[StepSnippetProps]>;
|
|
13
13
|
description?: Snippet<[StepSnippetProps]>;
|
|
14
|
-
/** Reports a click on step `stepNumber`; the current step is ignored */
|
|
15
14
|
change: (stepNumber: number) => void;
|
|
16
15
|
}
|
|
17
16
|
export declare const getStepsContext: (caller?: string) => StepsContextValue, setStepsContext: (value: StepsContextValue) => StepsContextValue;
|
|
@@ -7,7 +7,6 @@ export type StepsDirection = 'horizontal' | 'vertical';
|
|
|
7
7
|
export type StepsType = 'fill' | 'basic' | 'nav';
|
|
8
8
|
/** One step of `dataSource`; nodes for its title and description come from the Steps snippets. Other attributes land on the step's root. */
|
|
9
9
|
export interface StepData extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onclick'> {
|
|
10
|
-
/** Own status; when omitted it follows the Steps' current and status */
|
|
11
10
|
status?: StepStatus;
|
|
12
11
|
title?: string | number;
|
|
13
12
|
/** Not rendered by the nav type */
|
|
@@ -37,7 +36,6 @@ export interface StepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
|
|
|
37
36
|
dataSource?: StepData[];
|
|
38
37
|
/** Not bindable: whether it is set decides if the steps are buttons, and Svelte cannot tell a `bind:` from a plain prop */
|
|
39
38
|
onChange?: (current: number) => void;
|
|
40
|
-
/** Title of each step; defaults to `item.title` */
|
|
41
39
|
title?: Snippet<[StepSnippetProps]>;
|
|
42
40
|
/** Description of each step; defaults to `item.description`. Not rendered by the nav type */
|
|
43
41
|
description?: Snippet<[StepSnippetProps]>;
|
package/dist/steps/step.svelte
CHANGED
|
@@ -30,8 +30,6 @@
|
|
|
30
30
|
const plainDescription = $derived(String(item.description ?? ''));
|
|
31
31
|
const hasTitle = $derived(Boolean(steps.title) || plainTitle !== '');
|
|
32
32
|
const hasDescription = $derived(Boolean(steps.description) || plainDescription !== '');
|
|
33
|
-
|
|
34
|
-
// a plain title is also the hover tooltip of a clipped one; a snippet has no text to offer
|
|
35
33
|
const titleText = $derived(steps.title ? undefined : plainTitle || undefined);
|
|
36
34
|
const descriptionText = $derived(steps.description ? undefined : plainDescription || undefined);
|
|
37
35
|
|
|
@@ -48,7 +46,6 @@
|
|
|
48
46
|
// keys typed in a focusable child (an input in the title) must not switch the step
|
|
49
47
|
if (event.target === event.currentTarget && (event.key === 'Enter' || event.key === ' ')) {
|
|
50
48
|
event.preventDefault(); // Space would otherwise scroll the page
|
|
51
|
-
// a real click runs the click listeners and the change exactly as a pointer does
|
|
52
49
|
event.currentTarget.click();
|
|
53
50
|
}
|
|
54
51
|
};
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
|
|
22
22
|
let root = $state<HTMLDivElement>();
|
|
23
23
|
|
|
24
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
25
24
|
const foundationProps: SwitchBaseProps = {
|
|
26
25
|
get checked() {
|
|
27
26
|
return checked;
|
|
@@ -38,7 +37,6 @@
|
|
|
38
37
|
(base) => ({
|
|
39
38
|
setChecked: (next) => base.setState({ checked: next }),
|
|
40
39
|
notifyChange: (next, event) => {
|
|
41
|
-
// the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
42
40
|
checked = next;
|
|
43
41
|
onChange?.(next, event);
|
|
44
42
|
},
|
|
@@ -11,20 +11,16 @@
|
|
|
11
11
|
|
|
12
12
|
interface BaseRowProps {
|
|
13
13
|
record: AnyRecord;
|
|
14
|
-
/** The index among its siblings, or of the row in a virtualized body */
|
|
15
14
|
index: number;
|
|
16
15
|
rowKey: BaseRowKeyType;
|
|
17
16
|
/** The tree level, given when the row or its table has expand buttons */
|
|
18
17
|
level?: number;
|
|
19
18
|
expanded?: boolean;
|
|
20
|
-
/** The row has an expand button */
|
|
21
19
|
expandableRow?: boolean;
|
|
22
|
-
/** A click on the row toggles its expansion */
|
|
23
20
|
clickToExpand?: boolean;
|
|
24
21
|
selected?: boolean;
|
|
25
22
|
disabled?: boolean;
|
|
26
23
|
hovered?: boolean;
|
|
27
|
-
/** Highlighted with a hovered row its rowSpan cell covers */
|
|
28
24
|
highlighted?: boolean;
|
|
29
25
|
displayNone?: boolean;
|
|
30
26
|
cellWidths: number[];
|
|
@@ -2,20 +2,16 @@ import type { BaseRowKeyType } from '@fibrae/semi-foundation/table/foundation';
|
|
|
2
2
|
type AnyRecord = Record<string, any>;
|
|
3
3
|
interface BaseRowProps {
|
|
4
4
|
record: AnyRecord;
|
|
5
|
-
/** The index among its siblings, or of the row in a virtualized body */
|
|
6
5
|
index: number;
|
|
7
6
|
rowKey: BaseRowKeyType;
|
|
8
7
|
/** The tree level, given when the row or its table has expand buttons */
|
|
9
8
|
level?: number;
|
|
10
9
|
expanded?: boolean;
|
|
11
|
-
/** The row has an expand button */
|
|
12
10
|
expandableRow?: boolean;
|
|
13
|
-
/** A click on the row toggles its expansion */
|
|
14
11
|
clickToExpand?: boolean;
|
|
15
12
|
selected?: boolean;
|
|
16
13
|
disabled?: boolean;
|
|
17
14
|
hovered?: boolean;
|
|
18
|
-
/** Highlighted with a hovered row its rowSpan cell covers */
|
|
19
15
|
highlighted?: boolean;
|
|
20
16
|
displayNone?: boolean;
|
|
21
17
|
cellWidths: number[];
|
|
@@ -16,18 +16,13 @@
|
|
|
16
16
|
type AnyRecord = Record<string, any>;
|
|
17
17
|
|
|
18
18
|
interface BodyProps {
|
|
19
|
-
/** The column tree */
|
|
20
19
|
columns: ColumnProps[];
|
|
21
|
-
/** The records of the current page */
|
|
22
20
|
dataSource: AnyRecord[];
|
|
23
21
|
groups?: Map<BaseRowKeyType, Set<BaseRowKeyType>> | null;
|
|
24
22
|
expandedRowKeys: BaseRowKeyType[];
|
|
25
23
|
pageDisabledRowKeysSet: Set<BaseRowKeyType>;
|
|
26
|
-
/** The rows of a virtualized body */
|
|
27
24
|
virtualizedData: (FlattenData | GroupFlattenData)[];
|
|
28
|
-
/** The header renders inside the body table, since it is not fixed */
|
|
29
25
|
includeHeader: boolean;
|
|
30
|
-
/** The accessible name of the body table, when it is the table */
|
|
31
26
|
tableAttrs?: Record<string, unknown>;
|
|
32
27
|
emptyContent: Snippet;
|
|
33
28
|
onScroll?: (args: TableVirtualizedScrollArgs) => void;
|
|
@@ -92,7 +87,6 @@
|
|
|
92
87
|
|
|
93
88
|
const groupRecords = (group: Set<BaseRowKeyType>) => [...group].flatMap((key) => recordsByKey.get(key) ?? []);
|
|
94
89
|
|
|
95
|
-
/** The props of a record row that depend on the table state */
|
|
96
90
|
const baseRowState = (record: AnyRecord, rowKey: BaseRowKeyType, level: number) => {
|
|
97
91
|
const expandable = table.rowExpandable(record);
|
|
98
92
|
const inRow = expandable || expandBtnInRow;
|
|
@@ -175,7 +169,6 @@
|
|
|
175
169
|
};
|
|
176
170
|
});
|
|
177
171
|
|
|
178
|
-
/** The scrolling body element, whose horizontal offset the separate header follows */
|
|
179
172
|
export function element() {
|
|
180
173
|
return scrollElement();
|
|
181
174
|
}
|
|
@@ -5,18 +5,13 @@ import { type VirtualListAlign } from '../../_base/virtual-list.svelte';
|
|
|
5
5
|
import type { ColumnProps, TableVirtualizedScrollArgs } from '../interface.js';
|
|
6
6
|
type AnyRecord = Record<string, any>;
|
|
7
7
|
interface BodyProps {
|
|
8
|
-
/** The column tree */
|
|
9
8
|
columns: ColumnProps[];
|
|
10
|
-
/** The records of the current page */
|
|
11
9
|
dataSource: AnyRecord[];
|
|
12
10
|
groups?: Map<BaseRowKeyType, Set<BaseRowKeyType>> | null;
|
|
13
11
|
expandedRowKeys: BaseRowKeyType[];
|
|
14
12
|
pageDisabledRowKeysSet: Set<BaseRowKeyType>;
|
|
15
|
-
/** The rows of a virtualized body */
|
|
16
13
|
virtualizedData: (FlattenData | GroupFlattenData)[];
|
|
17
|
-
/** The header renders inside the body table, since it is not fixed */
|
|
18
14
|
includeHeader: boolean;
|
|
19
|
-
/** The accessible name of the body table, when it is the table */
|
|
20
15
|
tableAttrs?: Record<string, unknown>;
|
|
21
16
|
emptyContent: Snippet;
|
|
22
17
|
onScroll?: (args: TableVirtualizedScrollArgs) => void;
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
interface SectionRowProps {
|
|
12
12
|
groupKey: BaseRowKeyType;
|
|
13
13
|
group: Set<BaseRowKeyType>;
|
|
14
|
-
/** The records of the group in the current page */
|
|
15
14
|
records: AnyRecord[];
|
|
16
|
-
/** The index among the groups, or of the row in a virtualized body */
|
|
17
15
|
index: number;
|
|
18
16
|
expanded: boolean;
|
|
19
17
|
style?: string;
|
|
@@ -3,9 +3,7 @@ type AnyRecord = Record<string, any>;
|
|
|
3
3
|
interface SectionRowProps {
|
|
4
4
|
groupKey: BaseRowKeyType;
|
|
5
5
|
group: Set<BaseRowKeyType>;
|
|
6
|
-
/** The records of the group in the current page */
|
|
7
6
|
records: AnyRecord[];
|
|
8
|
-
/** The index among the groups, or of the row in a virtualized body */
|
|
9
7
|
index: number;
|
|
10
8
|
expanded: boolean;
|
|
11
9
|
style?: string;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { ColumnProps } from './interface.js';
|
|
3
3
|
|
|
4
|
-
/** What every level of one column's filter menu shares */
|
|
5
4
|
export interface FilterMenuState {
|
|
6
5
|
column: ColumnProps;
|
|
7
6
|
filterMultiple: boolean;
|
|
8
7
|
confirmMode: boolean;
|
|
9
8
|
filteredValue: any[];
|
|
10
|
-
/** The value picked and not applied yet, in confirm mode */
|
|
11
9
|
tempFilteredValue?: any[];
|
|
12
10
|
filterDropdownProps: ColumnProps['filterDropdownProps'];
|
|
13
11
|
setTemp: (value: any[]) => void;
|
|
@@ -35,7 +33,6 @@
|
|
|
35
33
|
|
|
36
34
|
interface ColumnFilterMenuProps {
|
|
37
35
|
filters: TableFilter[];
|
|
38
|
-
/** The depth of the menu, 0 for the top menu */
|
|
39
36
|
level: number;
|
|
40
37
|
state: FilterMenuState;
|
|
41
38
|
}
|