@fibrae/semi-ui-svelte 0.9.0 → 0.10.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/README.md +8 -4
- package/README.zh-CN.md +8 -4
- package/dist/components/anchor/interface.d.ts +14 -0
- package/dist/components/audio-player/interface.d.ts +5 -0
- package/dist/components/auto-complete/interface.d.ts +29 -0
- package/dist/components/avatar/interface.d.ts +24 -0
- package/dist/components/backtop/interface.d.ts +2 -0
- package/dist/components/badge/interface.d.ts +7 -0
- package/dist/components/banner/interface.d.ts +7 -0
- package/dist/components/breadcrumb/interface.d.ts +10 -0
- package/dist/components/button/interface.d.ts +18 -0
- package/dist/components/calendar/interface.d.ts +16 -0
- package/dist/components/card/interface.d.ts +18 -0
- package/dist/components/carousel/interface.d.ts +16 -0
- package/dist/components/cascader/cascader.svelte +1 -0
- package/dist/components/cascader/interface.d.ts +57 -0
- package/dist/components/checkbox/interface.d.ts +19 -0
- package/dist/components/code-highlight/interface.d.ts +3 -0
- package/dist/components/collapse/interface.d.ts +16 -0
- package/dist/components/collapsible/interface.d.ts +10 -0
- package/dist/components/color-picker/interface.d.ts +10 -0
- package/dist/components/config-provider/interface.d.ts +7 -0
- package/dist/components/cropper/interface.d.ts +11 -0
- package/dist/components/date-picker/interface.d.ts +47 -0
- package/dist/components/descriptions/interface.d.ts +6 -0
- package/dist/components/divider/interface.d.ts +4 -0
- package/dist/components/dropdown/interface.d.ts +8 -0
- package/dist/components/empty/interface.d.ts +7 -0
- package/dist/components/feedback/interface.d.ts +16 -0
- package/dist/components/float-button/interface.d.ts +14 -0
- package/dist/components/form/interface.d.ts +47 -0
- package/dist/components/form/label.svelte +2 -2
- package/dist/components/grid/interface.d.ts +13 -0
- package/dist/components/highlight/interface.d.ts +7 -0
- package/dist/components/hot-keys/interface.d.ts +3 -0
- package/dist/components/image/interface.d.ts +59 -0
- package/dist/components/input/interface.d.ts +67 -0
- package/dist/components/input-number/interface.d.ts +24 -0
- package/dist/components/json-viewer/interface.d.ts +7 -0
- package/dist/components/layout/interface.d.ts +3 -0
- package/dist/components/list/interface.d.ts +18 -0
- package/dist/components/locale/interface.d.ts +4 -0
- package/dist/components/lottie/interface.d.ts +2 -0
- package/dist/components/markdown-render/interface.d.ts +5 -0
- package/dist/components/modal/interface.d.ts +29 -0
- package/dist/components/navigation/interface.d.ts +47 -0
- package/dist/components/overflow-list/interface.d.ts +11 -0
- package/dist/components/pagination/interface.d.ts +12 -0
- package/dist/components/pincode/interface.d.ts +8 -0
- package/dist/components/popconfirm/interface.d.ts +12 -0
- package/dist/components/popover/interface.d.ts +30 -0
- package/dist/components/progress/interface.d.ts +13 -0
- package/dist/components/radio/interface.d.ts +22 -0
- package/dist/components/rating/interface.d.ts +12 -0
- package/dist/components/resizable/interface.d.ts +30 -0
- package/dist/components/scroll-list/interface.d.ts +6 -0
- package/dist/components/select/interface.d.ts +63 -0
- package/dist/components/side-sheet/interface.d.ts +19 -0
- package/dist/components/skeleton/interface.d.ts +7 -0
- package/dist/components/slider/interface.d.ts +23 -0
- package/dist/components/space/interface.d.ts +4 -0
- package/dist/components/spin/interface.d.ts +7 -0
- package/dist/components/steps/interface.d.ts +9 -0
- package/dist/components/switch/interface.d.ts +7 -0
- package/dist/components/table/interface.d.ts +48 -0
- package/dist/components/tabs/interface.d.ts +29 -0
- package/dist/components/tag/interface.d.ts +22 -0
- package/dist/components/tag-input/interface.d.ts +29 -0
- package/dist/components/time-picker/interface.d.ts +31 -0
- package/dist/components/timeline/interface.d.ts +5 -0
- package/dist/components/tooltip/interface.d.ts +20 -0
- package/dist/components/tooltip/tooltip.svelte +3 -0
- package/dist/components/transfer/interface.d.ts +18 -0
- package/dist/components/tree/interface.d.ts +45 -0
- package/dist/components/tree-select/interface.d.ts +55 -0
- package/dist/components/typography/interface.d.ts +33 -0
- package/dist/components/upload/interface.d.ts +64 -0
- package/dist/components/user-guide/interface.d.ts +15 -0
- package/dist/components/video-player/interface.d.ts +22 -0
- package/dist/styles.css +1 -1
- package/docs/advanced/dark-mode.md +288 -0
- package/docs/basic/button.md +605 -0
- package/docs/basic/divider.md +103 -0
- package/docs/basic/float-button.md +246 -0
- package/docs/basic/grid.md +427 -0
- package/docs/basic/layout.md +459 -0
- package/docs/basic/resizable.md +584 -0
- package/docs/basic/space.md +163 -0
- package/docs/basic/tokens.md +425 -0
- package/docs/basic/typography.md +615 -0
- package/docs/changes-from-semi.md +105 -0
- package/docs/ecosystem/tailwind.md +210 -0
- package/docs/experience/accessibility.md +82 -0
- package/docs/experience/content-guidelines.md +819 -0
- package/docs/experience/internationalization.md +7 -0
- package/docs/feedback/banner.md +198 -0
- package/docs/feedback/feedback.md +294 -0
- package/docs/feedback/notification.md +401 -0
- package/docs/feedback/popconfirm.md +243 -0
- package/docs/feedback/progress.md +389 -0
- package/docs/feedback/skeleton.md +388 -0
- package/docs/feedback/spin.md +172 -0
- package/docs/feedback/toast.md +393 -0
- package/docs/input/auto-complete.md +399 -0
- package/docs/input/cascader.md +1558 -0
- package/docs/input/checkbox.md +408 -0
- package/docs/input/color-picker.md +175 -0
- package/docs/input/date-picker.md +942 -0
- package/docs/input/form.md +2550 -0
- package/docs/input/input-number.md +451 -0
- package/docs/input/input.md +640 -0
- package/docs/input/pincode.md +191 -0
- package/docs/input/radio.md +337 -0
- package/docs/input/rating.md +214 -0
- package/docs/input/select.md +1230 -0
- package/docs/input/slider.md +347 -0
- package/docs/input/switch.md +206 -0
- package/docs/input/tag-input.md +465 -0
- package/docs/input/time-picker.md +358 -0
- package/docs/input/transfer.md +1061 -0
- package/docs/input/tree-select.md +1300 -0
- package/docs/input/upload.md +1811 -0
- package/docs/llms.txt +147 -0
- package/docs/navigation/anchor.md +377 -0
- package/docs/navigation/backtop.md +100 -0
- package/docs/navigation/breadcrumb.md +284 -0
- package/docs/navigation/navigation.md +851 -0
- package/docs/navigation/pagination.md +217 -0
- package/docs/navigation/steps.md +315 -0
- package/docs/navigation/tabs.md +754 -0
- package/docs/navigation/tree.md +1956 -0
- package/docs/other/config-provider.md +599 -0
- package/docs/other/locale.md +353 -0
- package/docs/plus/audio-player.md +155 -0
- package/docs/plus/code-highlight.md +150 -0
- package/docs/plus/drag-move.md +214 -0
- package/docs/plus/hot-keys.md +174 -0
- package/docs/plus/json-viewer.md +392 -0
- package/docs/plus/lottie.md +176 -0
- package/docs/plus/markdown-render.md +240 -0
- package/docs/plus/video-player.md +325 -0
- package/docs/show/avatar.md +475 -0
- package/docs/show/badge.md +276 -0
- package/docs/show/calendar.md +352 -0
- package/docs/show/card.md +485 -0
- package/docs/show/carousel.md +592 -0
- package/docs/show/collapse.md +289 -0
- package/docs/show/collapsible.md +216 -0
- package/docs/show/cropper.md +285 -0
- package/docs/show/descriptions.md +325 -0
- package/docs/show/dropdown.md +466 -0
- package/docs/show/empty.md +225 -0
- package/docs/show/highlight.md +144 -0
- package/docs/show/image.md +433 -0
- package/docs/show/list.md +927 -0
- package/docs/show/modal.md +517 -0
- package/docs/show/overflow-list.md +272 -0
- package/docs/show/popover.md +534 -0
- package/docs/show/scroll-list.md +156 -0
- package/docs/show/side-sheet.md +274 -0
- package/docs/show/table.md +5437 -0
- package/docs/show/tag.md +428 -0
- package/docs/show/timeline.md +277 -0
- package/docs/show/tooltip.md +442 -0
- package/docs/show/user-guide.md +419 -0
- package/docs/start/getting-started.md +234 -0
- package/docs/start/introduction.md +57 -0
- package/docs/start/overview.md +21 -0
- package/package.json +5 -4
|
@@ -2,28 +2,40 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
import type { Position } from '../tooltip/index.js';
|
|
4
4
|
export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
5
|
+
/** Total number of items. */
|
|
5
6
|
total?: number;
|
|
7
|
+
/** Whether to show the total number of pages; not shown when size is small. */
|
|
6
8
|
showTotal?: boolean;
|
|
7
9
|
/** Bindable; the size changer writes the chosen size back. Leave it out for an uncontrolled size */
|
|
8
10
|
pageSize?: number;
|
|
11
|
+
/** Options of the size changer; the current page size is inserted in order when it is not among them. */
|
|
9
12
|
pageSizeOpts?: number[];
|
|
13
|
+
/** Size: default or small. */
|
|
10
14
|
size?: 'small' | 'default';
|
|
11
15
|
/** Bindable; leave it out for an uncontrolled page. `bind:currentPage={get, set}` makes it fully controlled */
|
|
12
16
|
currentPage?: number;
|
|
17
|
+
/** Whether to show the size changer; not rendered when size is small. */
|
|
13
18
|
showSizeChanger?: boolean;
|
|
19
|
+
/** Whether to show the quick jump input; disabled when there are fewer than 2 pages. */
|
|
14
20
|
showQuickJumper?: boolean;
|
|
15
21
|
/** Position of the omitted pages popover and the size changer dropdown; not used by the `small` size */
|
|
16
22
|
popoverPosition?: Position;
|
|
23
|
+
/** Whether to hide the pagination when there are fewer than 2 pages; has no effect while the size changer is shown. */
|
|
17
24
|
hideOnSinglePage?: boolean;
|
|
18
25
|
/** Only for `size="small"`: the page select opens on hover or focus */
|
|
19
26
|
hoverShowPageSelect?: boolean;
|
|
27
|
+
/** Whether disabled. */
|
|
20
28
|
disabled?: boolean;
|
|
21
29
|
/** Keeps the current page when the page size changes; the consumer picks the page from `onPageSizeChange` */
|
|
22
30
|
preventPageChangeOnPageSizeChange?: boolean;
|
|
31
|
+
/** Called when the page changes. */
|
|
23
32
|
onPageChange?: (currentPage: number) => void;
|
|
33
|
+
/** Called when the page size changes. */
|
|
24
34
|
onPageSizeChange?: (pageSize: number) => void;
|
|
35
|
+
/** Called when the page or the page size changes, with the page and the page size. */
|
|
25
36
|
onChange?: (currentPage: number, pageSize: number) => void;
|
|
26
37
|
/** Replaces the previous icon; a string or a lone text snippet names the button, any other content leaves the locale name */
|
|
27
38
|
prevText?: string | Snippet;
|
|
39
|
+
/** String or snippet that replaces the next page icon, named the same way as prevText. */
|
|
28
40
|
nextText?: string | Snippet;
|
|
29
41
|
}
|
|
@@ -5,13 +5,21 @@ export type PinCodeFormat = 'number' | 'mixed' | RegExp | ((value: string) => bo
|
|
|
5
5
|
export interface PinCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onfocus' | 'onblur' | 'onchange'> {
|
|
6
6
|
/** Bindable; leave it out for an uncontrolled code. `bind:value={get, set}` makes it fully controlled */
|
|
7
7
|
value?: string;
|
|
8
|
+
/** Number of digits. */
|
|
8
9
|
count?: number;
|
|
10
|
+
/** Format limit for a single character: number allows digits only, mixed allows digits and letters, and a regular expression or function judges each character. */
|
|
9
11
|
format?: PinCodeFormat;
|
|
12
|
+
/** Whether to focus the first input on mount. Turn it on only when the user has just entered the code step: focus moving at page load makes screen readers skip the content before it. */
|
|
10
13
|
autofocus?: boolean;
|
|
14
|
+
/** Whether the input is disabled. */
|
|
11
15
|
disabled?: boolean;
|
|
16
|
+
/** Input size: large, default or small. */
|
|
12
17
|
size?: InputSize;
|
|
18
|
+
/** Validation status, passed to every input; error shows the error style. */
|
|
13
19
|
validateStatus?: ValidateStatus;
|
|
20
|
+
/** Called when the content changes, with the current content. */
|
|
14
21
|
onChange?: (value: string) => void;
|
|
22
|
+
/** Called once all digits are entered, with the current content. */
|
|
15
23
|
onComplete?: (value: string) => void;
|
|
16
24
|
/** Focus entering the code from outside; moving between the digits does not fire it */
|
|
17
25
|
onFocus?: (event: FocusEvent) => void;
|
|
@@ -10,20 +10,32 @@ export interface PopconfirmButtonProps extends ButtonProps {
|
|
|
10
10
|
autoFocus?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface PopconfirmProps extends Omit<PopoverProps, 'content'> {
|
|
13
|
+
/** Props of the cancel button. autoFocus focuses it on open; onclick runs before the built-in cancel handling. */
|
|
13
14
|
cancelButtonProps?: PopconfirmButtonProps;
|
|
15
|
+
/** Cancel button text. Defaults to the locale entry Popconfirm.cancel. */
|
|
14
16
|
cancelText?: string;
|
|
17
|
+
/** Type of the cancel button. */
|
|
15
18
|
cancelType?: ButtonType;
|
|
19
|
+
/** Class names of the inner parts, keyed by `content` (the content container `.semi-popover` inside the popup) and `arrow`; merged with the built-in classes. The class of the confirmation card `.semi-popconfirm` is set with `class`. */
|
|
16
20
|
classNames?: Partial<Record<PopconfirmPart, ClassValue>>;
|
|
21
|
+
/** Whether it is disabled. A disabled Popconfirm renders only the trigger and never opens. */
|
|
17
22
|
disabled?: boolean;
|
|
23
|
+
/** Props of the confirm button. autoFocus focuses it on open; onclick runs before the built-in confirm handling. */
|
|
18
24
|
okButtonProps?: PopconfirmButtonProps;
|
|
25
|
+
/** Confirm button text. Defaults to the locale entry Popconfirm.confirm. */
|
|
19
26
|
okText?: string;
|
|
27
|
+
/** Type of the confirm button. */
|
|
20
28
|
okType?: ButtonType;
|
|
29
|
+
/** Whether the close button in the corner is shown. */
|
|
21
30
|
showCloseIcon?: boolean;
|
|
31
|
+
/** Title, a string or a snippet, which also names the dialog. */
|
|
22
32
|
title?: string | Snippet;
|
|
33
|
+
/** Snippet for the content of the card. Its argument `{ initialFocusRef }` is a callback; write `{@attach initialFocusRef}` to bind it to the element that receives focus on open. Omitted, no content area is rendered. */
|
|
23
34
|
content?: Snippet<[RenderContentProps]>;
|
|
24
35
|
/** Replaces the warning icon; `null` shows no icon */
|
|
25
36
|
icon?: Snippet | null;
|
|
26
37
|
/** Receives the button's native click event; a returned Promise keeps the button loading until it settles */
|
|
27
38
|
onCancel?: (event: MouseEvent) => Promise<unknown> | void;
|
|
39
|
+
/** Called when the confirm button is clicked, with the button's native click event. A returned Promise keeps the button loading and closes the card once it resolves; a rejection keeps it open. */
|
|
28
40
|
onConfirm?: (event: MouseEvent) => Promise<unknown> | void;
|
|
29
41
|
}
|
|
@@ -16,56 +16,86 @@ export interface ArrowProps {
|
|
|
16
16
|
export interface PopoverProps {
|
|
17
17
|
/** Names the popup when it is a dialog (click, contextMenu or custom trigger) */
|
|
18
18
|
'aria-label'?: string;
|
|
19
|
+
/** aria-labelledby of the popup when its role is dialog. */
|
|
19
20
|
'aria-labelledby'?: string;
|
|
21
|
+
/** aria-describedby of the popup when its role is dialog. */
|
|
20
22
|
'aria-describedby'?: string;
|
|
21
23
|
/**
|
|
22
24
|
* Role of the popup; dialog with a click, contextMenu or custom trigger, tooltip otherwise.
|
|
23
25
|
* A combobox passes presentation because it points at the inner listbox itself
|
|
24
26
|
*/
|
|
25
27
|
role?: string;
|
|
28
|
+
/** Class name of the popup. */
|
|
26
29
|
class?: string;
|
|
27
30
|
/** On the popup; its `background-color` and `border-color` also color the arrow */
|
|
28
31
|
style?: string;
|
|
32
|
+
/** Whether the popup flips automatically when it would be clipped. */
|
|
29
33
|
autoAdjustOverflow?: boolean;
|
|
30
34
|
/** Wrapped in Tooltip's span, which takes the trigger attributes */
|
|
31
35
|
children?: TooltipProps['children'];
|
|
32
36
|
/** Renders the trigger element itself, which takes `props`; wins over children */
|
|
33
37
|
child?: TooltipProps['child'];
|
|
38
|
+
/** Snippet for the card content. Its argument `{ initialFocusRef }` is a callback; write `{@attach initialFocusRef}` to bind it to the element that receives focus when the popup opens. */
|
|
34
39
|
content?: TooltipProps['content'];
|
|
40
|
+
/** Whether the popup is shown, used with trigger custom; bind it with `bind:visible`. When given, this value decides. */
|
|
35
41
|
visible?: boolean;
|
|
42
|
+
/** Position of the popup relative to the trigger element, in twelve directions. */
|
|
36
43
|
position?: TooltipProps['position'];
|
|
44
|
+
/** Whether the popup is animated. */
|
|
37
45
|
motion?: boolean;
|
|
46
|
+
/** Milliseconds before the popup shows after the pointer enters. Applies to the hover and focus triggers. */
|
|
38
47
|
mouseEnterDelay?: number;
|
|
48
|
+
/** Milliseconds before the popup hides after the pointer leaves. Applies to the hover and focus triggers; not less than mouseEnterDelay. */
|
|
39
49
|
mouseLeaveDelay?: number;
|
|
50
|
+
/** When the popup shows. With custom, visible alone decides. */
|
|
40
51
|
trigger?: TooltipProps['trigger'];
|
|
52
|
+
/** Class names of the inner parts, keyed by `content` (the content card) and `arrow`; merged with the built-in classes. */
|
|
41
53
|
classNames?: Partial<Record<PopoverPart, ClassValue>>;
|
|
54
|
+
/** Whether the arrow is shown. */
|
|
42
55
|
showArrow?: boolean;
|
|
56
|
+
/** Distance in pixels between the popup and the trigger. An object sets the horizontal and vertical distances. Omitted, it is 4 without an arrow and 10 with one. */
|
|
43
57
|
spacing?: number | {
|
|
44
58
|
x: number;
|
|
45
59
|
y: number;
|
|
46
60
|
};
|
|
61
|
+
/** Whether click, mousedown and focus in/out events on the popup stop propagating. */
|
|
47
62
|
stopPropagation?: boolean | string;
|
|
63
|
+
/** Inline styles of the inner parts, keyed like `classNames`. `content` is the style string of the content card; `arrow` holds the arrow's borderColor, backgroundColor and borderOpacity, and colors that are not set follow background-color and border-color of the popup style. */
|
|
48
64
|
styles?: {
|
|
49
65
|
content?: string;
|
|
50
66
|
arrow?: ArrowStyle;
|
|
51
67
|
};
|
|
68
|
+
/** Whether the arrow points at the center of the trigger. Requires showArrow. */
|
|
52
69
|
arrowPointAtCenter?: boolean;
|
|
70
|
+
/** Whether Esc closes the open popup. With trigger custom it only calls onEscKeyDown and the caller decides whether to close. */
|
|
53
71
|
closeOnEsc?: boolean;
|
|
72
|
+
/** Whether Tab cycles inside the popup while focus is in it. */
|
|
54
73
|
guardFocus?: boolean;
|
|
74
|
+
/** Whether focus returns to the trigger after Esc closes the popup. */
|
|
55
75
|
returnFocusOnClose?: boolean;
|
|
76
|
+
/** Whether a click on the popup or anything inside it closes the popup. */
|
|
56
77
|
clickToHide?: boolean;
|
|
78
|
+
/** Whether the arrow keys on the trigger are prevented from moving focus into the popup. */
|
|
57
79
|
disableArrowKeyDown?: boolean;
|
|
80
|
+
/** Whether keyboard focus is ignored when trigger is hover. */
|
|
58
81
|
disableFocusListener?: boolean;
|
|
82
|
+
/** Whether the popup content stays mounted while closed. */
|
|
59
83
|
keepDOM?: boolean;
|
|
60
84
|
/**
|
|
61
85
|
* Whether the popover may show; false blocks it
|
|
62
86
|
* @default true
|
|
63
87
|
*/
|
|
64
88
|
condition?: boolean;
|
|
89
|
+
/** Called when the visibility of the popup changes; with a controlled visible it reports only requests from user interaction, not changes the caller makes to visible. */
|
|
65
90
|
onVisibleChange?: TooltipProps['onVisibleChange'];
|
|
91
|
+
/** Called when the mouse is pressed outside of the trigger and the open popup. Only for trigger click, contextMenu or custom. */
|
|
66
92
|
onClickOutSide?: TooltipProps['onClickOutSide'];
|
|
93
|
+
/** Called when Esc is pressed while the popup is open and closeOnEsc is true. */
|
|
67
94
|
onEscKeyDown?: TooltipProps['onEscKeyDown'];
|
|
95
|
+
/** Called once per opening when the popup is shown, as its enter animation starts, before afterOpen, controlled or not; not called for a hover open withdrawn because the pointer already left. */
|
|
68
96
|
onOpen?: TooltipProps['onOpen'];
|
|
97
|
+
/** Called after the popup has opened and its enter animation has finished, or right after opening when there is no enter animation, controlled or not; not called for an open that is closed before the enter animation ends. */
|
|
69
98
|
afterOpen?: TooltipProps['afterOpen'];
|
|
99
|
+
/** Called after the popup has closed and its leave animation has finished. */
|
|
70
100
|
afterClose?: TooltipProps['afterClose'];
|
|
71
101
|
}
|
|
@@ -7,18 +7,31 @@ export type ProgressSize = Size;
|
|
|
7
7
|
export type ProgressType = 'line' | 'circle';
|
|
8
8
|
export type ProgressDirection = 'horizontal' | 'vertical';
|
|
9
9
|
export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
/** Direction of the line progress bar: horizontal or vertical. */
|
|
10
11
|
direction?: ProgressDirection;
|
|
12
|
+
/** Whether the progress is indeterminate. When on, percent no longer controls the length, the text is hidden and aria-valuenow is omitted. */
|
|
11
13
|
indeterminate?: boolean;
|
|
14
|
+
/** Whether the shown number animates to the new percent. When off it jumps to the target. */
|
|
12
15
|
motion?: boolean;
|
|
16
|
+
/** Fill color of the track. */
|
|
13
17
|
orbitStroke?: string;
|
|
18
|
+
/** Progress percentage. Passing NaN throws an error. */
|
|
14
19
|
percent?: number;
|
|
20
|
+
/** Whether to show the text: in the center of a circle, or on the right of a bar. */
|
|
15
21
|
showInfo?: boolean;
|
|
22
|
+
/** Size: default, small (circle only) or large (line only). */
|
|
16
23
|
size?: ProgressSize;
|
|
24
|
+
/** Fill color. An array is a list of `{ percent, color }` intervals, where color is any CSS color or a Semi palette name. */
|
|
17
25
|
stroke?: string | StrokeArr;
|
|
26
|
+
/** Whether to generate gradient colors between intervals. Requires at least one interval in stroke. */
|
|
18
27
|
strokeGradient?: boolean;
|
|
28
|
+
/** Line cap of the circle progress bar: round or square. */
|
|
19
29
|
strokeLinecap?: 'round' | 'square';
|
|
30
|
+
/** Stroke width of the circle progress bar. */
|
|
20
31
|
strokeWidth?: number;
|
|
32
|
+
/** Type: line or circle. */
|
|
21
33
|
type?: ProgressType;
|
|
34
|
+
/** Diameter of the circle progress bar. Defaults to 24 when size is small and 72 otherwise. */
|
|
22
35
|
width?: number;
|
|
23
36
|
/** Replaces the text; `percent` is the shown number clamped to 0-100 */
|
|
24
37
|
format?: Snippet<[{
|
|
@@ -19,18 +19,29 @@ export interface RadioChangeEvent {
|
|
|
19
19
|
preventDefault: () => void;
|
|
20
20
|
}
|
|
21
21
|
export interface RadioProps extends Omit<HTMLAttributes<HTMLLabelElement>, 'onchange'>, Pick<HTMLInputAttributes, 'name' | 'autofocus'> {
|
|
22
|
+
/** Whether the radio is checked; bind it with `bind:checked`. Ignored inside a RadioGroup. `bind:checked={get, set}` makes it fully controlled; a plain `checked` is the initial value, a click overrides it inside the component, and a new value from the parent wins again. */
|
|
22
23
|
checked?: boolean;
|
|
23
24
|
/** Identifies the radio inside a RadioGroup, and is the native input's value in a form submission. */
|
|
24
25
|
value?: RadioValue;
|
|
26
|
+
/** Whether the radio is disabled. */
|
|
25
27
|
disabled?: boolean;
|
|
28
|
+
/** When set to vertical, the radio is displayed as a block and takes a line of its own. */
|
|
26
29
|
displayMode?: RadioDisplayMode;
|
|
30
|
+
/** When set to advanced, a checked radio can be unchecked by clicking it or pressing Space. Inside a RadioGroup the group's mode applies. */
|
|
27
31
|
mode?: RadioMode;
|
|
32
|
+
/** Style type: default, button, card or pureCard. Inside a RadioGroup the group's type applies. */
|
|
28
33
|
type?: RadioType;
|
|
34
|
+
/** Class names of the inner parts, keyed by addon (the container wrapping the content); values take anything class takes (string, array or object) and merge with the built-in classes. */
|
|
29
35
|
classNames?: Partial<Record<RadioPart, ClassValue>>;
|
|
36
|
+
/** Style strings of the inner parts, keyed like classNames. */
|
|
30
37
|
styles?: Partial<Record<RadioPart, string>>;
|
|
38
|
+
/** Id of the addon node, which aria-labelledby points to. Generated when omitted. */
|
|
31
39
|
addonId?: string;
|
|
40
|
+
/** Id of the extra node, which aria-describedby points to. Generated when omitted. */
|
|
32
41
|
extraId?: string;
|
|
42
|
+
/** Whether focusing prevents the browser from scrolling the element into view; applies to the focus method. */
|
|
33
43
|
preventScroll?: boolean;
|
|
44
|
+
/** Called when the checked state changes. The event's `target` is `{ checked, value, name, disabled }`. */
|
|
34
45
|
onChange?: (event: RadioChangeEvent) => void;
|
|
35
46
|
/** Not rendered for type="button". */
|
|
36
47
|
extra?: Snippet;
|
|
@@ -52,17 +63,28 @@ export interface RadioGroupOptionSnippetParams {
|
|
|
52
63
|
index: number;
|
|
53
64
|
}
|
|
54
65
|
export interface RadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onchange' | 'onblur'> {
|
|
66
|
+
/** The selected value, matched against each Radio's value; bind it with `bind:value`. `bind:value={get, set}` makes it fully controlled; a plain `value` is the initial value. */
|
|
55
67
|
value?: RadioValue;
|
|
68
|
+
/** Whether the whole group is disabled. */
|
|
56
69
|
disabled?: boolean;
|
|
70
|
+
/** The name of every native input in the group. A unique value is generated per group when omitted. */
|
|
57
71
|
name?: string;
|
|
72
|
+
/** Declares the options as data. Each item is a string or `{ label, value, disabled, extra, class, style, classNames, styles, addonId, extraId }`, where `style` is a string; `classNames` and `styles` are keyed by addon and written like the Radio props of the same name. */
|
|
58
73
|
options?: Array<string | RadioOptionItem>;
|
|
74
|
+
/** Layout direction of the radios: horizontal or vertical. Not supported when type is button. */
|
|
59
75
|
direction?: RadioDirection;
|
|
76
|
+
/** When set to advanced, a checked radio can be unchecked by clicking it or pressing Space, and the selected value becomes undefined. */
|
|
60
77
|
mode?: RadioMode;
|
|
78
|
+
/** Style type of every Radio in the group: default, button, card or pureCard. */
|
|
61
79
|
type?: RadioType;
|
|
80
|
+
/** Button size when type is button: small, middle or large. */
|
|
62
81
|
buttonSize?: RadioGroupButtonSize;
|
|
63
82
|
/** `target.value` is `undefined` when mode="advanced" unchecks the selected radio. */
|
|
64
83
|
onChange?: (event: RadioChangeEvent) => void;
|
|
84
|
+
/** Called when focus leaves the whole group; moving focus between its radios does not call it. */
|
|
65
85
|
onBlur?: (event: FocusEvent) => void;
|
|
86
|
+
/** Snippet for the label of each item in options, with the parameter `{ option, index }`. */
|
|
66
87
|
label?: Snippet<[RadioGroupOptionSnippetParams]>;
|
|
88
|
+
/** Snippet for the extra text of each item in options, with the parameter `{ option, index }`. */
|
|
67
89
|
extra?: Snippet<[RadioGroupOptionSnippetParams]>;
|
|
68
90
|
}
|
|
@@ -3,21 +3,33 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
3
3
|
import type { TooltipTriggerProps } from '../tooltip/interface.js';
|
|
4
4
|
export type { RatingState } from '@fibrae/semi-foundation/components/rating/foundation';
|
|
5
5
|
export interface RatingProps extends Omit<HTMLAttributes<HTMLUListElement>, 'onblur' | 'onchange' | 'onclick' | 'onfocus' | 'onkeydown'> {
|
|
6
|
+
/** Current value; bind it with `bind:value`. `bind:value={get, set}` makes it fully controlled; a plain `value` is the initial value and user interaction changes it afterwards. */
|
|
6
7
|
value?: number;
|
|
8
|
+
/** Total number of stars. */
|
|
7
9
|
count?: number;
|
|
10
|
+
/** Whether half stars can be selected. */
|
|
8
11
|
allowHalf?: boolean;
|
|
12
|
+
/** Whether clicking the selected star again clears the value. */
|
|
9
13
|
allowClear?: boolean;
|
|
14
|
+
/** Read-only: no interaction and no focus. */
|
|
10
15
|
disabled?: boolean;
|
|
16
|
+
/** Size: default or small, or a number for a custom size. */
|
|
11
17
|
size?: 'small' | 'default' | number;
|
|
18
|
+
/** Prompt text for each item. */
|
|
12
19
|
tooltips?: string[];
|
|
20
|
+
/** Whether the browser should avoid scrolling the document to show the newly focused element, for focus inside the component. */
|
|
13
21
|
preventScroll?: boolean;
|
|
14
22
|
/** Drawn in every star; a string is also the unit that names the star values, a snippet is named by the locale */
|
|
15
23
|
character?: string | Snippet;
|
|
24
|
+
/** Called when the selection changes, with the new value. */
|
|
16
25
|
onChange?: (value: number) => void;
|
|
17
26
|
/** `undefined` when the pointer leaves the stars or a click clears the value */
|
|
18
27
|
onHoverChange?: (value?: number) => void;
|
|
28
|
+
/** Called when a star is clicked or selected with Enter or Space, with the event and the star index. It shadows a native click listener on the root element. */
|
|
19
29
|
onClick?: (event: MouseEvent | KeyboardEvent, index: number) => void;
|
|
30
|
+
/** Called when focus enters the rating; moving between stars does not call it. */
|
|
20
31
|
onFocus?: (event: FocusEvent) => void;
|
|
32
|
+
/** Called when focus leaves the rating. */
|
|
21
33
|
onBlur?: (event: FocusEvent) => void;
|
|
22
34
|
/** An arrow key that moved the value */
|
|
23
35
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
@@ -13,49 +13,79 @@ export interface ResizableProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
|
|
|
13
13
|
defaultSize?: Size;
|
|
14
14
|
/** `false` renders no handles; a direction missing from the object is enabled */
|
|
15
15
|
enable?: Enable | false;
|
|
16
|
+
/** Increment that resizing snaps to. */
|
|
16
17
|
grid?: [number, number];
|
|
18
|
+
/** Absolute pixel values that resizing snaps to. Both x and y are optional. */
|
|
17
19
|
snap?: {
|
|
18
20
|
x?: number[];
|
|
19
21
|
y?: number[];
|
|
20
22
|
};
|
|
23
|
+
/** Minimum gap required to move to the next snap target. */
|
|
21
24
|
snapGap?: number;
|
|
25
|
+
/** Element that bounds the size: 'parent', 'window' or an HTMLElement. */
|
|
22
26
|
boundElement?: 'parent' | 'window' | HTMLElement;
|
|
27
|
+
/** Whether bounds are computed by drag direction. When true, dragging from a left or top handle limits the size by the distance from the side that stays put to the opposite edge of the bound element. */
|
|
23
28
|
boundsByDirection?: boolean;
|
|
29
|
+
/** Minimum width. */
|
|
24
30
|
minWidth?: string | number;
|
|
31
|
+
/** Minimum height. */
|
|
25
32
|
minHeight?: string | number;
|
|
33
|
+
/** Maximum width. */
|
|
26
34
|
maxWidth?: string | number;
|
|
35
|
+
/** Maximum height. */
|
|
27
36
|
maxHeight?: string | number;
|
|
37
|
+
/** Locks the aspect ratio: true keeps the initial one, a number is the width to height ratio. */
|
|
28
38
|
lockAspectRatio?: boolean | number;
|
|
39
|
+
/** Extra width in pixels (such as padding) left out of the ratio when the aspect ratio is locked. */
|
|
29
40
|
lockAspectRatioExtraWidth?: number;
|
|
41
|
+
/** Extra height in pixels (such as padding) left out of the ratio when the aspect ratio is locked. */
|
|
30
42
|
lockAspectRatioExtraHeight?: number;
|
|
43
|
+
/** Scale applied to the element from outside, used to correct the pointer movement. */
|
|
31
44
|
scale?: number;
|
|
45
|
+
/** Ratio of pointer movement to size change; pass [width, height] for per-axis ratios. Arrow keys always change the size by 10px, regardless of ratio and scale. */
|
|
32
46
|
ratio?: number | [number, number];
|
|
47
|
+
/** Styles of the handle in each direction, as style strings. */
|
|
33
48
|
handleStyle?: HandleStyle;
|
|
49
|
+
/** Class names of the handle in each direction. */
|
|
34
50
|
handleClass?: HandleClassName;
|
|
51
|
+
/** Style string of the element that wraps all handles. */
|
|
35
52
|
handleWrapperStyle?: string;
|
|
53
|
+
/** Class name of the element that wraps all handles. */
|
|
36
54
|
handleWrapperClass?: string;
|
|
37
55
|
/** Returning `false` cancels the resize */
|
|
38
56
|
onResizeStart?: ResizeStartCallback;
|
|
57
|
+
/** Called when a drag or arrow key changes the size, with the new size, the event and the direction. */
|
|
39
58
|
onChange?: ResizeCallback;
|
|
59
|
+
/** Called when resizing ends, with the final size, the event and the direction. */
|
|
40
60
|
onResizeEnd?: ResizeCallback;
|
|
61
|
+
/** Content of the resizable box. */
|
|
41
62
|
children?: Snippet;
|
|
63
|
+
/** Snippet for the content of the handle in each enabled direction. It renders once per enabled direction, with `{ direction }` set to that handle's direction. */
|
|
42
64
|
handle?: Snippet<[ResizableHandleSnippetProps]>;
|
|
43
65
|
}
|
|
44
66
|
export interface ResizeGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
67
|
+
/** Resize direction within the group: horizontal lays items side by side, vertical stacks them. */
|
|
45
68
|
direction?: 'horizontal' | 'vertical';
|
|
69
|
+
/** ResizeItem and ResizeHandler children, which register themselves with the group once mounted. */
|
|
46
70
|
children?: Snippet;
|
|
47
71
|
}
|
|
48
72
|
export interface ResizeItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onchange'> {
|
|
73
|
+
/** Minimum size (%, px, vw or vh). */
|
|
49
74
|
min?: string;
|
|
75
|
+
/** Maximum size (%, px, vw or vh). */
|
|
50
76
|
max?: string;
|
|
51
77
|
/** A percentage, px, vw or vh string, or a number (or numeric string) for a share of the remaining space */
|
|
52
78
|
defaultSize?: string | number;
|
|
53
79
|
/** Returning `false` from either item beside the handler cancels the resize */
|
|
54
80
|
onResizeStart?: ResizeStartCallback;
|
|
81
|
+
/** Called when a drag or arrow key changes the size, with the new size, the event and the direction. */
|
|
55
82
|
onChange?: ResizeCallback;
|
|
83
|
+
/** Called when resizing ends, with the final size, the event and the direction. */
|
|
56
84
|
onResizeEnd?: ResizeCallback;
|
|
85
|
+
/** Content of the item. */
|
|
57
86
|
children?: Snippet;
|
|
58
87
|
}
|
|
59
88
|
export interface ResizeHandlerProps extends HTMLAttributes<HTMLDivElement> {
|
|
89
|
+
/** Replaces the default grip icon. */
|
|
60
90
|
children?: Snippet;
|
|
61
91
|
}
|
|
@@ -3,21 +3,27 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
3
3
|
import type { Item } from '@fibrae/semi-foundation/components/scroll-list/item-foundation';
|
|
4
4
|
export type ScrollListItem = Item;
|
|
5
5
|
export interface ScrollListProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** Height of the list body. */
|
|
6
7
|
bodyHeight?: number | string;
|
|
7
8
|
/** A string or a snippet; nothing is rendered for an empty string */
|
|
8
9
|
footer?: Snippet | string;
|
|
10
|
+
/** Header content, a string or a snippet; rendered whenever given. */
|
|
9
11
|
header?: Snippet | string;
|
|
10
12
|
}
|
|
11
13
|
export interface ScrollItemProps<T extends ScrollListItem = ScrollListItem> extends HTMLAttributes<HTMLDivElement> {
|
|
12
14
|
/** Wheel mode scrolls without end; the arrow keys wrap around in either mode */
|
|
13
15
|
cycled?: boolean;
|
|
16
|
+
/** Items of the column. */
|
|
14
17
|
list?: T[];
|
|
18
|
+
/** Mode: normal or wheel. */
|
|
15
19
|
mode?: 'normal' | 'wheel';
|
|
20
|
+
/** Whether to animate scrolling. */
|
|
16
21
|
motion?: boolean;
|
|
17
22
|
/** Bindable: a selection writes the new index back */
|
|
18
23
|
selectedIndex?: number;
|
|
19
24
|
/** Formats the selected item's text, which is undefined for an item without one; an item's own `transform` wins */
|
|
20
25
|
transform?: (value: T['value'], text?: string) => string;
|
|
26
|
+
/** Called when an item is selected, with the item's data plus the item's index in list. */
|
|
21
27
|
onSelect?: (data: ScrollItemSelectData<T>) => void;
|
|
22
28
|
}
|
|
23
29
|
export type ScrollItemSelectData<T extends ScrollListItem = ScrollListItem> = T & {
|
|
@@ -80,83 +80,146 @@ type NativeKeys = 'children' | 'prefix' | 'placeholder' | 'onchange' | 'onselect
|
|
|
80
80
|
export interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, NativeKeys> {
|
|
81
81
|
/** Bindable; leave it out for an uncontrolled Select. `bind:value={get, set}` makes it fully controlled */
|
|
82
82
|
value?: SelectValue;
|
|
83
|
+
/** Whether multiple options can be selected. */
|
|
83
84
|
multiple?: boolean;
|
|
85
|
+
/** The option data. An entry has `value`, `label`, `disabled`, `showTick`, `class`, `style` and an optional `group: { key, label }`; other fields travel with the option record. Entries of one group must be adjacent. */
|
|
84
86
|
optionList?: SelectOptionProps[];
|
|
87
|
+
/** Whether to enable search. true compares the input case-insensitively with the option label or the group title; a function customizes the match. */
|
|
85
88
|
filter?: boolean | ((inputValue: string, option: SelectOptionProps) => boolean);
|
|
89
|
+
/** Whether the search is remote. When on, the options are not filtered locally and the caller updates `optionList`. */
|
|
86
90
|
remote?: boolean;
|
|
91
|
+
/** Whether options that are not in the list can be created; use it with `filter`. */
|
|
87
92
|
allowCreate?: boolean;
|
|
93
|
+
/** Whether the search keyword is cleared after an option is selected in multiple mode. */
|
|
88
94
|
autoClearSearchValue?: boolean;
|
|
95
|
+
/** Whether to focus on mount. */
|
|
89
96
|
autofocus?: boolean;
|
|
90
97
|
/** Opens the list on mount; Select has no controlled open state */
|
|
91
98
|
defaultOpen?: boolean;
|
|
99
|
+
/** Whether the dropdown list closes after an option is clicked in multiple mode. */
|
|
92
100
|
clickToHide?: boolean;
|
|
101
|
+
/** Whether the first enabled option is highlighted by default. */
|
|
93
102
|
defaultActiveFirstOption?: boolean;
|
|
103
|
+
/** Whether `onChange` and `value` carry option objects instead of option values. */
|
|
94
104
|
onChangeWithObject?: boolean;
|
|
105
|
+
/** Maximum number of selected options in multiple mode; `onExceed` fires beyond it. */
|
|
95
106
|
max?: number;
|
|
107
|
+
/** Maximum number of tags shown in multiple mode; the rest are shown as +N. */
|
|
96
108
|
maxTagCount?: number;
|
|
109
|
+
/** Maximum height of the dropdown list. */
|
|
97
110
|
maxHeight?: string | number;
|
|
111
|
+
/** Whether hovering +N shows the remaining tags in a Popover once `maxTagCount` is exceeded. */
|
|
98
112
|
showRestTagsPopover?: boolean;
|
|
113
|
+
/** Popover props of the +N popover. */
|
|
99
114
|
restTagsPopoverProps?: PopoverProps;
|
|
115
|
+
/** With `maxTagCount`, whether the collapsed tags expand while the dropdown list is open. */
|
|
100
116
|
expandRestTagsOnClick?: boolean;
|
|
117
|
+
/** Whether overflowing tags adapt: when the width is short the last tag is truncated. It has a performance cost and is not recommended in large forms. */
|
|
101
118
|
ellipsisTrigger?: boolean;
|
|
119
|
+
/** Size: `small`, `default` or `large`. */
|
|
102
120
|
size?: SelectSize;
|
|
121
|
+
/** Whether the component is disabled. */
|
|
103
122
|
disabled?: boolean;
|
|
123
|
+
/** Whether the trigger has no border. */
|
|
104
124
|
borderless?: boolean;
|
|
125
|
+
/** Validation status: `default`, `warning` or `error`; it only affects styles such as the background color. */
|
|
105
126
|
validateStatus?: ValidateStatus;
|
|
127
|
+
/** Placeholder while nothing is selected. */
|
|
106
128
|
placeholder?: string;
|
|
129
|
+
/** Placeholder of the search input when it is in the dropdown list (`searchPosition="dropdown"`). */
|
|
107
130
|
searchPlaceholder?: string;
|
|
131
|
+
/** Where the search input sits: `trigger` or `dropdown`. */
|
|
108
132
|
searchPosition?: 'trigger' | 'dropdown';
|
|
133
|
+
/** Whether the options are loading; the dropdown list shows a spinner instead of the options. */
|
|
109
134
|
loading?: boolean;
|
|
135
|
+
/** Whether to show the dropdown arrow. */
|
|
110
136
|
showArrow?: boolean;
|
|
137
|
+
/** Whether to show the clear button. */
|
|
111
138
|
showClear?: boolean;
|
|
139
|
+
/** id of the inset label container, for aria-labelledby; when left out and `insetLabel` is rendered, one is generated. */
|
|
112
140
|
insetLabelId?: string;
|
|
141
|
+
/** Extra props of the search Input; `class` and `style` land on the Input wrapper. */
|
|
113
142
|
inputProps?: SelectInputProps;
|
|
143
|
+
/** Class names of the inner parts, keyed by dropdown (the dropdown layer); values take anything class takes (string, array or object) and merge with the built-in classes. */
|
|
114
144
|
classNames?: Partial<Record<SelectPart, ClassValue>>;
|
|
145
|
+
/** Style strings of the inner parts, keyed like classNames. */
|
|
115
146
|
styles?: Partial<Record<SelectPart, string>>;
|
|
147
|
+
/** Whether the minimum width of the dropdown layer follows the trigger width. */
|
|
116
148
|
dropdownMatchSelectWidth?: boolean;
|
|
149
|
+
/** Placement of the dropdown layer relative to the trigger. */
|
|
117
150
|
position?: Position;
|
|
151
|
+
/** Gap between the dropdown layer and the trigger. */
|
|
118
152
|
spacing?: number | {
|
|
119
153
|
x: number;
|
|
120
154
|
y: number;
|
|
121
155
|
};
|
|
156
|
+
/** Whether the dropdown layer animates. */
|
|
122
157
|
motion?: boolean;
|
|
158
|
+
/** Whether the dropdown layer flips automatically when it overflows the viewport. */
|
|
123
159
|
autoAdjustOverflow?: boolean;
|
|
160
|
+
/** Whether clicks inside the dropdown layer are stopped from bubbling out. */
|
|
124
161
|
stopPropagation?: boolean;
|
|
162
|
+
/** Turns on list virtualization; `itemSize` is required. Group titles and `role="group"` are not rendered with it, and the options are laid out flat in order. */
|
|
125
163
|
virtualize?: SelectVirtualize;
|
|
164
|
+
/** Whether focusing stops the browser from scrolling the element into view. */
|
|
126
165
|
preventScroll?: boolean;
|
|
127
166
|
/** Id of the trigger; the option ids derive from it */
|
|
128
167
|
id?: string;
|
|
168
|
+
/** Called when the selection changes, with the new value (option objects with `onChangeWithObject`). */
|
|
129
169
|
onChange?: (value: SelectValue) => void;
|
|
170
|
+
/** Called when the dropdown list opens or closes. */
|
|
130
171
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
131
172
|
/** No event when called through `search()` or the trigger snippet's `onSearch` */
|
|
132
173
|
onSearch?: (value: string, event?: Event) => void;
|
|
174
|
+
/** Called when an option is selected. */
|
|
133
175
|
onSelect?: (value: string | number | boolean, option: SelectOptionProps) => void;
|
|
176
|
+
/** Called when an option is deselected in multiple mode. */
|
|
134
177
|
onDeselect?: (value: string | number | boolean, option: SelectOptionProps) => void;
|
|
178
|
+
/** Called when the selection would exceed `max`. */
|
|
135
179
|
onExceed?: (option: SelectOptionProps) => void;
|
|
180
|
+
/** Called when an option is created. */
|
|
136
181
|
onCreate?: (option: SelectOptionProps) => void;
|
|
182
|
+
/** Called when the clear button is clicked. */
|
|
137
183
|
onClear?: () => void;
|
|
184
|
+
/** Called once when the focus enters the Select. */
|
|
138
185
|
onFocus?: (event: FocusEvent) => void;
|
|
139
186
|
/** Once when the focus leaves the Select; a press outside the open dropdown passes its mousedown event */
|
|
140
187
|
onBlur?: (event: FocusEvent | MouseEvent) => void;
|
|
188
|
+
/** Called when the dropdown list scrolls. */
|
|
141
189
|
onListScroll?: (event: Event) => void;
|
|
190
|
+
/** Prefix of the selection box, a snippet. The side padding is added when the content is text or an Icon. */
|
|
142
191
|
prefix?: Snippet;
|
|
192
|
+
/** Suffix of the selection box, a snippet. The side padding is added when the content is text or an Icon. */
|
|
143
193
|
suffix?: Snippet;
|
|
194
|
+
/** Inset label, a snippet. Rendered without a `prefix`, and the name source of the combobox. */
|
|
144
195
|
insetLabel?: Snippet;
|
|
196
|
+
/** Custom dropdown arrow, a snippet. */
|
|
145
197
|
arrowIcon?: Snippet;
|
|
198
|
+
/** Custom clear button icon, a snippet. */
|
|
146
199
|
clearIcon?: Snippet;
|
|
147
200
|
/** `null` hides the empty state */
|
|
148
201
|
emptyContent?: Snippet | null;
|
|
202
|
+
/** Content at the top of the dropdown layer, level with the option list, a snippet; always visible while the list scrolls. */
|
|
149
203
|
outerTopSlot?: Snippet;
|
|
204
|
+
/** Content inside the top of the option list, a snippet; visible when the list is scrolled to the top. */
|
|
150
205
|
innerTopSlot?: Snippet;
|
|
206
|
+
/** Content at the bottom of the dropdown layer, level with the option list, a snippet; always visible while the list scrolls. */
|
|
151
207
|
outerBottomSlot?: Snippet;
|
|
208
|
+
/** Content inside the bottom of the option list, a snippet; visible when the list is scrolled to the bottom. */
|
|
152
209
|
innerBottomSlot?: Snippet;
|
|
210
|
+
/** Replaces a whole option row, a snippet. Its parameter has `id`, `value`, `label`, `selected`, `focused`, `disabled`, `inputValue`, `class`, `style`, `onclick`, `onmouseenter` and the other fields of the entry. Put `id` on the element with `role="option"`. */
|
|
153
211
|
optionItem?: Snippet<[SelectOptionItemSnippetProps]>;
|
|
154
212
|
/** Replaces the text of each option row; the row, its tick and its keyboard behavior stay. Search keywords are not highlighted */
|
|
155
213
|
optionLabel?: Snippet<[SelectOptionLabelSnippetProps]>;
|
|
214
|
+
/** Replaces the content of a group title, a snippet with `{ group }` (`key` and `label`); without it `group.label` is shown. */
|
|
156
215
|
groupLabel?: Snippet<[SelectGroupLabelSnippetProps]>;
|
|
216
|
+
/** Content of the row that creates an option, a snippet with `{ inputValue, focus, style }`; with virtualization apply `style` to the custom element. */
|
|
157
217
|
createItem?: Snippet<[SelectCreateItemSnippetProps]>;
|
|
218
|
+
/** The selected content, a snippet with `{ option, index, disabled, onClose }`. In single mode it replaces the selection box content, in multiple mode the content of each tag. */
|
|
158
219
|
selectedItem?: Snippet<[SelectSelectedItemSnippetProps]>;
|
|
220
|
+
/** Replaces each tag in multiple mode, a snippet with the parameters of `selectedItem`; it takes precedence over `selectedItem`. */
|
|
159
221
|
tag?: Snippet<[SelectSelectedItemSnippetProps]>;
|
|
222
|
+
/** Replaces the trigger content, a snippet with `{ value, inputValue, placeholder, disabled, onSearch, onClear, onRemove }`. */
|
|
160
223
|
trigger?: Snippet<[SelectTriggerSnippetProps]>;
|
|
161
224
|
}
|
|
162
225
|
export {};
|
|
@@ -13,27 +13,46 @@ export interface SideSheetProps extends Omit<HTMLAttributes<HTMLDivElement>, 'ch
|
|
|
13
13
|
canVerticalSetWidth?: boolean;
|
|
14
14
|
/** `content` is the role="dialog" element. Merged after the built-in class names of the part's element. */
|
|
15
15
|
classNames?: Partial<Record<SideSheetPart, ClassValue>>;
|
|
16
|
+
/** Whether the close button in the corner is shown. */
|
|
16
17
|
closable?: boolean;
|
|
18
|
+
/** Whether Esc closes the sheet. */
|
|
17
19
|
closeOnEsc?: boolean;
|
|
20
|
+
/** Whether body scrolling is locked (overflow: hidden on body) while a masked sheet is rendered in document.body. */
|
|
18
21
|
disableScroll?: boolean;
|
|
22
|
+
/** Parent element the sheet is rendered into. A custom container needs position: relative; this changes where the sheet sits in the DOM, not where it is shown. */
|
|
19
23
|
getPopupContainer?: () => HTMLElement;
|
|
24
|
+
/** Height, used when placement is top or bottom. A number is in pixels; a string is any valid CSS length. 448 when omitted. */
|
|
20
25
|
height?: number | string;
|
|
26
|
+
/** Whether the sheet content stays mounted while closed. */
|
|
21
27
|
keepDOM?: boolean;
|
|
28
|
+
/** Whether the mask is shown. When false the content outside stays operable. */
|
|
22
29
|
mask?: boolean;
|
|
30
|
+
/** Whether clicking the mask closes the sheet. */
|
|
23
31
|
maskClosable?: boolean;
|
|
32
|
+
/** Whether animation is enabled. */
|
|
24
33
|
motion?: boolean;
|
|
25
34
|
/** Close button, mask click and Escape (native KeyboardEvent); `visible` is written back to false first. */
|
|
26
35
|
onCancel?: (event: MouseEvent | KeyboardEvent) => void;
|
|
36
|
+
/** Edge the sheet slides in from. */
|
|
27
37
|
placement?: Placement;
|
|
38
|
+
/** Size: small is 448px, medium 684px, large 920px. Used only when placement is left or right. */
|
|
28
39
|
size?: 'small' | 'medium' | 'large';
|
|
40
|
+
/** Style that lands on the role=dialog element, as a string. */
|
|
29
41
|
style?: string;
|
|
42
|
+
/** Inline styles of the inner parts, keyed like classNames; every value is a style string. Like style, content is merged with the computed width and height, which take precedence. */
|
|
30
43
|
styles?: Partial<Record<SideSheetPart, string>>;
|
|
31
44
|
/** A string is the plain-text title, so `title="x"` does not become a native tooltip on the outer element. */
|
|
32
45
|
title?: Snippet | string;
|
|
46
|
+
/** Whether the sheet is visible, used with bind:visible. */
|
|
33
47
|
visible?: boolean;
|
|
48
|
+
/** Width, used when placement is left or right. A number is in pixels; a string is any valid CSS length. Decided by size when omitted. */
|
|
34
49
|
width?: number | string;
|
|
50
|
+
/** z-index of the layer. */
|
|
35
51
|
zIndex?: number;
|
|
52
|
+
/** Body of the sheet, written inside the tag. */
|
|
36
53
|
children?: Snippet;
|
|
54
|
+
/** Snippet for the footer of the sheet. Nothing is rendered when it is empty. */
|
|
37
55
|
footer?: Snippet;
|
|
56
|
+
/** Snippet for the icon inside the close button; hide the button with closable set to false. */
|
|
38
57
|
closeIcon?: Snippet;
|
|
39
58
|
}
|