@fibrae/semi-ui-svelte 0.9.1 → 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/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/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/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/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
|
@@ -25,16 +25,25 @@ export interface StepSnippetProps {
|
|
|
25
25
|
* `direction` to fill and basic; the others ignore them.
|
|
26
26
|
*/
|
|
27
27
|
export interface StepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
28
|
+
/** Steps type: fill, basic or nav. */
|
|
28
29
|
type?: StepsType;
|
|
30
|
+
/** Current step, counting from 0; a `dataSource` item can override the state with status. Not bindable: update it yourself in `onChange`. */
|
|
29
31
|
current?: number;
|
|
32
|
+
/** Starting index, counting from 0. */
|
|
30
33
|
initial?: number;
|
|
34
|
+
/** Direction: horizontal or vertical. */
|
|
31
35
|
direction?: StepsDirection;
|
|
36
|
+
/** State of the current step: wait, process, finish, error or warning. */
|
|
32
37
|
status?: StepStatus;
|
|
38
|
+
/** Size of the basic and nav types: default or small. */
|
|
33
39
|
size?: StepsSize;
|
|
40
|
+
/** Whether the basic type shows connecting lines. */
|
|
34
41
|
hasLine?: boolean;
|
|
42
|
+
/** Step data. Each item is a `StepData`: `status` (own status of the step; when omitted it follows current and status), `title`, `description` (not rendered by the nav type), `icon` (snippet for a custom icon of that step; `false` shows no icon; the status icon is used when omitted; not rendered by the nav type) and `onClick` (setting it makes that step clickable). Other attributes land on the step's root element. */
|
|
35
43
|
dataSource?: StepData[];
|
|
36
44
|
/** Not bindable: whether it is set decides if the steps are buttons, and Svelte cannot tell a `bind:` from a plain prop */
|
|
37
45
|
onChange?: (current: number) => void;
|
|
46
|
+
/** Snippet for the title of each step, with `{ item, index }`; defaults to `item.title`. */
|
|
38
47
|
title?: Snippet<[StepSnippetProps]>;
|
|
39
48
|
/** Description of each step; defaults to `item.description`. Not rendered by the nav type */
|
|
40
49
|
description?: Snippet<[StepSnippetProps]>;
|
|
@@ -2,11 +2,18 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes, HTMLInputAttributes } from 'svelte/elements';
|
|
3
3
|
import type { Size } from '@fibrae/semi-foundation/utils';
|
|
4
4
|
export interface SwitchProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onchange'>, Pick<HTMLInputAttributes, 'name'> {
|
|
5
|
+
/** Checked state; bind it with `bind:checked`. `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. */
|
|
5
6
|
checked?: boolean;
|
|
7
|
+
/** Whether the switch is disabled. */
|
|
6
8
|
disabled?: boolean;
|
|
9
|
+
/** Whether the switch is loading. While loading, the input stays focusable with `aria-disabled`; toggles are ignored and onChange is not called. */
|
|
7
10
|
loading?: boolean;
|
|
11
|
+
/** Switch size: large, default or small. */
|
|
8
12
|
size?: Size;
|
|
13
|
+
/** Called when the user toggles the switch, with the new checked state and the native change event. Not called while loading. */
|
|
9
14
|
onChange?: (checked: boolean, event: Event) => void;
|
|
15
|
+
/** Snippet shown when checked. Not shown when size is small. */
|
|
10
16
|
checkedText?: Snippet;
|
|
17
|
+
/** Snippet shown when unchecked. Not shown when size is small. */
|
|
11
18
|
uncheckedText?: Snippet;
|
|
12
19
|
}
|
|
@@ -260,11 +260,17 @@ export interface TableVirtualizedScrollArgs {
|
|
|
260
260
|
scrollOffset: number;
|
|
261
261
|
}
|
|
262
262
|
export interface TableProps<R extends AnyRecord = AnyRecord> extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onchange' | 'onscroll' | 'children'> {
|
|
263
|
+
/** Whether to show the outer border and the column borders. */
|
|
263
264
|
bordered?: boolean;
|
|
265
|
+
/** The field of a record that holds its child records in a tree table. */
|
|
264
266
|
childrenRecordName?: string;
|
|
267
|
+
/** Class names of the inner parts, keyed by header (every header cell th, fixed headers included); merged with the built-in classes. */
|
|
265
268
|
classNames?: Partial<Record<TablePart, ClassValue>>;
|
|
269
|
+
/** Clicking a group row expands or collapses the group. */
|
|
266
270
|
clickGroupedRowToExpand?: boolean;
|
|
271
|
+
/** The column configuration, see Column. A column holds data only; markup goes to the cell, headerCell, sortIcon, filterIcon, filterDropdown and other snippets of Table. */
|
|
267
272
|
columns?: ColumnProps<R>[];
|
|
273
|
+
/** Replaces the elements Table renders, such as the outer, wrapper, row and cell of the header and the body, with a tag name that replaces the default tag of that part. */
|
|
268
274
|
components?: TableComponents;
|
|
269
275
|
/** Bindable; wins over `pagination.currentPage` because `bind:` cannot reach a field inside an object. Paging writes it back */
|
|
270
276
|
currentPage?: number;
|
|
@@ -273,55 +279,91 @@ export interface TableProps<R extends AnyRecord = AnyRecord> extends Omit<HTMLAt
|
|
|
273
279
|
* changed in place shows in its cell but does not sort or filter again
|
|
274
280
|
*/
|
|
275
281
|
dataSource?: R[];
|
|
282
|
+
/** Whether all group rows start expanded. Has no effect on data loaded later. */
|
|
276
283
|
defaultExpandAllGroupRows?: boolean;
|
|
284
|
+
/** Whether all rows start expanded. Has no effect on data loaded later. */
|
|
277
285
|
defaultExpandAllRows?: boolean;
|
|
286
|
+
/** The text direction. Defaults to the direction of ConfigProvider and can be set here per table. */
|
|
278
287
|
direction?: 'ltr' | 'rtl';
|
|
288
|
+
/** Whether all group rows are expanded. */
|
|
279
289
|
expandAllGroupRows?: boolean;
|
|
290
|
+
/** Whether all rows are expanded. */
|
|
280
291
|
expandAllRows?: boolean;
|
|
292
|
+
/** Whether the column of the expand button is fixed, with the same values as the fixed field of a column. */
|
|
281
293
|
expandCellFixed?: ColumnFixed;
|
|
282
294
|
/** `false` hides the expand buttons; the `expandIcon` snippet replaces the icon */
|
|
283
295
|
expandIcon?: boolean | Snippet<[TableExpandIconSnippetProps]>;
|
|
284
296
|
/** Bindable; leave it out for uncontrolled expansion */
|
|
285
297
|
expandedRowKeys?: (string | number)[];
|
|
298
|
+
/** Whether clicking a row expands an expandable row. */
|
|
286
299
|
expandRowByClick?: boolean;
|
|
300
|
+
/** The table footer: plain text, or a snippet with the records of the current page as pageData. */
|
|
287
301
|
footer?: string | Snippet<[TableTitleSnippetProps<R>]>;
|
|
302
|
+
/** The grouping rule: a record field name, or a function that returns a string or a number. */
|
|
288
303
|
groupBy?: TableGroupBy<R>;
|
|
304
|
+
/** The column configuration of the single cell of a group row. The returned object has no title, children or dataIndex. */
|
|
289
305
|
groupSectionColumn?: (groupKey: string | number, group: (string | number)[]) => Omit<ColumnProps<R>, 'title' | 'children' | 'dataIndex'>;
|
|
306
|
+
/** In an expandable table the expand button shares the first cell by default; set false to render it as its own column. */
|
|
290
307
|
hideExpandedColumn?: boolean;
|
|
308
|
+
/** The indent of each tree level, in pixels. */
|
|
291
309
|
indentSize?: number;
|
|
310
|
+
/** Whether collapsing a row keeps its DOM. */
|
|
292
311
|
keepDOM?: boolean;
|
|
312
|
+
/** Whether the table shows its loading state. */
|
|
293
313
|
loading?: boolean;
|
|
314
|
+
/** The pagination configuration. Pass false to turn pagination off. */
|
|
294
315
|
pagination?: boolean | TablePaginationProps;
|
|
316
|
+
/** Whether columns can be resized; a resizable column needs a width. An object configures onResize, onResizeStart, onResizeStop and handlerClassName. */
|
|
295
317
|
resizable?: boolean | ResizableProps<R>;
|
|
318
|
+
/** Tells whether a row can be expanded. A row that returns false has no expand button. */
|
|
296
319
|
rowExpandable?: TableRowExpandable<R>;
|
|
320
|
+
/** The row key: a record field name, or a function that returns a string or a number. */
|
|
297
321
|
rowKey?: TableRowKey<R>;
|
|
322
|
+
/** The row selection configuration. Pass true for the defaults, see rowSelection. */
|
|
298
323
|
rowSelection?: boolean | RowSelectionProps<R>;
|
|
324
|
+
/** Hovering a cell with rowspan highlights every row the cell spans. */
|
|
299
325
|
rowSpanHover?: boolean;
|
|
326
|
+
/** The scroll area: x is the width and y the maximum height, header included, see scroll. */
|
|
300
327
|
scroll?: TableScroll;
|
|
301
328
|
/** Bindable; wins over `rowSelection.selectedRowKeys` because `bind:` cannot reach a field inside an object. Needs `rowSelection` to show the checkboxes */
|
|
302
329
|
selectedRowKeys?: (string | number)[];
|
|
330
|
+
/** Whether to show the header. */
|
|
303
331
|
showHeader?: boolean;
|
|
332
|
+
/** The table size, which sets the padding of the cells. */
|
|
304
333
|
size?: TableSize;
|
|
334
|
+
/** Sticks the header to the top of the page. With an object, top is the distance from the scroll container. */
|
|
305
335
|
sticky?: TableSticky;
|
|
336
|
+
/** Inline style strings of the inner parts, keyed like classNames; the style returned by a column's onHeaderCell takes precedence. */
|
|
306
337
|
styles?: Partial<Record<TablePart, string>>;
|
|
338
|
+
/** The table title: plain text, or a snippet with the records of the current page as pageData. */
|
|
307
339
|
title?: string | Snippet<[TableTitleSnippetProps<R>]>;
|
|
340
|
+
/** Turns on virtualization, which needs scroll.y as a number. An object sets the row height itemSize and the extra rows overscanCount. */
|
|
308
341
|
virtualized?: TableVirtualized;
|
|
342
|
+
/** Called when the page, the sorting or the filters change. The argument holds pagination, filters, sorter and extra.changeType. */
|
|
309
343
|
onChange?: (changeInfo: TableChangeInfo<R>) => void;
|
|
344
|
+
/** Called when an expand button is clicked, with the expanded state, the record (an object with groupKey for a group row) and the mouse event. */
|
|
310
345
|
onExpand?: (expanded: boolean, record: TableIncludeGroupRecord<R>, event: MouseEvent) => void;
|
|
346
|
+
/** Called when the expanded rows change, with the array of expanded records. */
|
|
311
347
|
onExpandedRowsChange?: (expandedRows: TableIncludeGroupRecord<R>[]) => void;
|
|
348
|
+
/** Like onRow, for group rows. The returned object holds the attributes and lowercase listeners of the tr. index is the group's ordinal, or its position among the virtual list's rows when virtualized is on. */
|
|
312
349
|
onGroupedRow?: (record: {
|
|
313
350
|
groupKey: string | number;
|
|
314
351
|
records: R[];
|
|
315
352
|
}, index: number) => TableRowAttrs;
|
|
353
|
+
/** Sets the attributes and lowercase listeners of a header row. The returned object (without style) is merged into the row. */
|
|
316
354
|
onHeaderRow?: (columns: ColumnProps<R>[], index: number) => Omit<TableRowAttrs, 'style'>;
|
|
355
|
+
/** Sets the attributes and lowercase listeners (such as onclick and onmouseenter) of a data row; the third argument is the row state. The returned listeners run after the row's own handling and the onRowXxx callbacks. */
|
|
317
356
|
onRow?: (record: R, index: number, rowState: {
|
|
318
357
|
disabled: boolean;
|
|
319
358
|
selected: boolean;
|
|
320
359
|
}) => TableRowAttrs;
|
|
321
360
|
/** Called before the `onmouseenter` returned by `onRow` */
|
|
322
361
|
onRowMouseEnter?: (record: R, event: MouseEvent) => void;
|
|
362
|
+
/** Called when the pointer leaves a data row, before the onmouseleave returned by onRow. */
|
|
323
363
|
onRowMouseLeave?: (record: R, event: MouseEvent) => void;
|
|
364
|
+
/** Called when a data row is double-clicked, before the ondblclick returned by onRow. */
|
|
324
365
|
onRowDoubleClick?: (record: R, event: MouseEvent) => void;
|
|
366
|
+
/** Called when a data row opens the context menu, before the oncontextmenu returned by onRow. */
|
|
325
367
|
onRowContextMenu?: (record: R, event: MouseEvent) => void;
|
|
326
368
|
/** A virtualized body changed its vertical offset */
|
|
327
369
|
onScroll?: (args: TableVirtualizedScrollArgs) => void;
|
|
@@ -329,15 +371,21 @@ export interface TableProps<R extends AnyRecord = AnyRecord> extends Omit<HTMLAt
|
|
|
329
371
|
cell?: Snippet<[TableCellSnippetProps<R>]>;
|
|
330
372
|
/** The title of a column header; render `title` for the columns it leaves alone */
|
|
331
373
|
headerCell?: Snippet<[TableHeaderCellSnippetProps<R>]>;
|
|
374
|
+
/** The content shown without data. Without the snippet the locale's empty text shows; an empty snippet shows nothing. */
|
|
332
375
|
empty?: Snippet;
|
|
333
376
|
/** The content of an expanded row; given, every expandable row gets an expand button */
|
|
334
377
|
expandedRow?: Snippet<[TableExpandedRowSnippetProps<R>]>;
|
|
378
|
+
/** The content of a group row, with groupKey and group (the row keys of the group). */
|
|
335
379
|
groupSection?: Snippet<[TableGroupSectionSnippetProps]>;
|
|
380
|
+
/** The sort icon, with sortOrder and column. */
|
|
336
381
|
sortIcon?: Snippet<[TableSortIconSnippetProps<R>]>;
|
|
382
|
+
/** The content of the filter button, with filtered and column. */
|
|
337
383
|
filterIcon?: Snippet<[TableFilterIconSnippetProps<R>]>;
|
|
384
|
+
/** The filter panel of a column with filterDropdown set to true, with column, the temporary value tempFilteredValue and onTempFilteredValueChange, onConfirm, onClear, onClose and onReset; tell the columns apart with column. */
|
|
338
385
|
filterDropdown?: Snippet<[TableFilterDropdownSnippetProps<R>]>;
|
|
339
386
|
/** An item of a filter menu; given, it replaces every item */
|
|
340
387
|
filterDropdownItem?: Snippet<[TableFilterDropdownItemSnippetProps<R>]>;
|
|
388
|
+
/** A cell of the selection column, called for the header and the rows, with selected, inHeader, originNode (the default checkbox) and more. Render originNode to keep the default checkbox. */
|
|
341
389
|
selectionCell?: Snippet<[TableSelectionCellSnippetProps<R>]>;
|
|
342
390
|
/** Replaces the pagination info and Pagination; named apart from the `pagination` prop, which shares the namespace */
|
|
343
391
|
paginationContent?: Snippet<[TablePaginationSnippetProps]>;
|
|
@@ -65,24 +65,43 @@ export interface TabsMoreContentSnippetProps {
|
|
|
65
65
|
export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onchange'> {
|
|
66
66
|
/** null selects no tab and still counts as controlled */
|
|
67
67
|
activeKey?: string | null;
|
|
68
|
+
/** Position of the scroll arrows in collapsible mode. */
|
|
68
69
|
arrowPosition?: 'both' | 'start' | 'end';
|
|
70
|
+
/** Whether to collapse overflowing tabs into a scrollable bar (horizontal mode only). `'auto'` collapses when the tabs overflow or wrap and leaves the collapse once they fit. */
|
|
69
71
|
collapsible?: boolean | 'auto';
|
|
72
|
+
/** Class names of the inner parts, keyed by `tabBar`, `content` (the outer content area) and `visibleTabs` (the whole scrolling area in collapsible mode); merged with the built-in classes. */
|
|
70
73
|
classNames?: Partial<Record<TabsPart, ClassValue>>;
|
|
74
|
+
/** In collapsible mode, the Dropdown props passed to the start-side and end-side arrow menus. */
|
|
71
75
|
dropdownProps?: TabsDropdownProps;
|
|
76
|
+
/** With `panel`, whether to render the DOM of inactive panels. When false only the active panel is rendered, without motion. */
|
|
72
77
|
keepDOM?: boolean;
|
|
78
|
+
/** Lazy rendering: a panel is rendered into the DOM only after it has been active. */
|
|
73
79
|
lazyRender?: boolean;
|
|
80
|
+
/** Moves the last tabs into a More dropdown. A number is the count of tabs moved; in an object, `count` is that number and `dropdownProps` is passed to the dropdown. The trigger and the menu content are customized with the `moreTrigger` and `moreContent` snippets. */
|
|
74
81
|
more?: number | TabsMore;
|
|
82
|
+
/** Whether focus calls inside the component stop the browser from scrolling the document to the newly focused element. */
|
|
75
83
|
preventScroll?: boolean;
|
|
84
|
+
/** In collapsible mode, whether the collapsed tabs are listed in a dropdown menu. */
|
|
76
85
|
showRestInDropdown?: boolean;
|
|
86
|
+
/** Size of the tab bar; currently only the line type supports it. */
|
|
77
87
|
size?: TabSize;
|
|
88
|
+
/** Inline style strings of the inner parts, keyed like `classNames`. */
|
|
78
89
|
styles?: Partial<Record<TabsPart, string>>;
|
|
90
|
+
/** An array of tab data, each with itemKey, tab, disabled and closable, data only. Tab markup goes in the `tab` and `icon` snippets, and the content in the `panel` snippet or `children`. */
|
|
79
91
|
tabList?: PlainTab[];
|
|
92
|
+
/** Whether switching panels is animated. */
|
|
80
93
|
tabPaneMotion?: boolean;
|
|
94
|
+
/** Position of the tab bar: top is horizontal, left is vertical. */
|
|
81
95
|
tabPosition?: TabPosition;
|
|
96
|
+
/** Style of the tab bar: line, card, button or slash. slash supports horizontal mode only. */
|
|
82
97
|
type?: TabType;
|
|
98
|
+
/** Called when the tab changes, with the itemKey of the new active tab. */
|
|
83
99
|
onChange?: (activeKey: string) => void;
|
|
100
|
+
/** Called when a tab is clicked or activated with Enter or Space; the event is a KeyboardEvent for keyboard activation. */
|
|
84
101
|
onTabClick?: (activeKey: string, event: MouseEvent | KeyboardEvent) => void;
|
|
102
|
+
/** Called when a tab is closed, with the itemKey of the closed tab. The caller removes the tab. */
|
|
85
103
|
onTabClose?: (tabKey: string) => void;
|
|
104
|
+
/** In collapsible mode, called when the visibility of the tabs changes, with a Map from itemKey to whether it is visible. */
|
|
86
105
|
onVisibleTabsChange?: (visibleState: Map<string, boolean>) => void;
|
|
87
106
|
/** The content area when there is no `panel`: one tabpanel labelled by the selected tab */
|
|
88
107
|
children?: Snippet;
|
|
@@ -92,10 +111,15 @@ export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'childre
|
|
|
92
111
|
tab?: Snippet<[TabsTabSnippetProps]>;
|
|
93
112
|
/** The icon of each `tabList` entry; the icon container renders even when the snippet outputs nothing */
|
|
94
113
|
icon?: Snippet<[TabsTabSnippetProps]>;
|
|
114
|
+
/** Snippet for the extra content of the tab bar, placed outside the tablist. */
|
|
95
115
|
tabBarExtraContent?: Snippet;
|
|
116
|
+
/** Snippet that replaces the whole tab bar, with `{ tabBarProps, tabBar }`: `tabBarProps` holds data only and `tabBar` is the default tab bar, rendered with `{@render tabBar()}`; a TabItem inside the custom bar controls its Tabs on its own. */
|
|
96
117
|
tabBar?: Snippet<[TabsTabBarSnippetProps]>;
|
|
118
|
+
/** Snippet that replaces each scroll arrow in collapsible mode, with `{ items, position, onClick, defaultNode }`: the scrolled-out tabs, the position, the click handler and the default arrow (render it with `{@render defaultNode()}`). */
|
|
97
119
|
arrow?: Snippet<[TabsArrowSnippetProps]>;
|
|
120
|
+
/** Snippet that replaces the trigger of the More menu. */
|
|
98
121
|
moreTrigger?: Snippet;
|
|
122
|
+
/** Snippet that replaces the content of the More menu, with the tabs moved into it as `{ items }`. */
|
|
99
123
|
moreContent?: Snippet<[TabsMoreContentSnippetProps]>;
|
|
100
124
|
}
|
|
101
125
|
/** Internal: Tabs renders one pane per `panel` entry; the pane reads everything else from the Tabs context */
|
|
@@ -104,9 +128,13 @@ export interface TabPaneProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chil
|
|
|
104
128
|
children?: Snippet;
|
|
105
129
|
}
|
|
106
130
|
export interface TabItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onclick'> {
|
|
131
|
+
/** Unique key of the tab. */
|
|
107
132
|
itemKey?: string;
|
|
133
|
+
/** Whether the tab is selected. */
|
|
108
134
|
selected?: boolean;
|
|
135
|
+
/** Whether the tab is disabled; clicks, the close button and the Enter, Space, Delete and Backspace keys have no effect, while the close button still shows. */
|
|
109
136
|
disabled?: boolean;
|
|
137
|
+
/** Whether to show the close button. */
|
|
110
138
|
closable?: boolean;
|
|
111
139
|
/** Defaults to the size of the enclosing Tabs */
|
|
112
140
|
size?: TabSize;
|
|
@@ -116,6 +144,7 @@ export interface TabItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chil
|
|
|
116
144
|
tabPosition?: TabPosition;
|
|
117
145
|
/** Not called while disabled */
|
|
118
146
|
onClick?: (itemKey: string, event: MouseEvent) => void;
|
|
147
|
+
/** Snippet for the tab content. */
|
|
119
148
|
tab?: Snippet;
|
|
120
149
|
/** The icon container renders even when the snippet outputs nothing */
|
|
121
150
|
icon?: Snippet;
|
|
@@ -9,37 +9,58 @@ export type TagSize = (typeof strings.TAG_SIZE)[number];
|
|
|
9
9
|
export type TagShape = 'circle' | 'square';
|
|
10
10
|
export type TagCloseEvent = MouseEvent | KeyboardEvent;
|
|
11
11
|
export interface TagProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'color'> {
|
|
12
|
+
/** Unique identifier of the tag, passed as the second argument of onClose. */
|
|
12
13
|
tagKey?: string | number;
|
|
14
|
+
/** Tag size: small, default or large. */
|
|
13
15
|
size?: TagSize;
|
|
16
|
+
/** Tag color: one of the 16 palette colors or white. */
|
|
14
17
|
color?: TagColor;
|
|
18
|
+
/** Style type: light, ghost or solid. */
|
|
15
19
|
type?: TagType;
|
|
20
|
+
/** Whether the tag can be closed. */
|
|
16
21
|
closable?: boolean;
|
|
17
22
|
/** Bindable; `undefined` means the tag closes itself and shows until then */
|
|
18
23
|
visible?: boolean;
|
|
24
|
+
/** Avatar image URL. Setting it makes an avatar tag. */
|
|
19
25
|
avatarSrc?: string;
|
|
26
|
+
/** Whether the tag is colorful. */
|
|
20
27
|
colorful?: boolean;
|
|
28
|
+
/** Whether a colorful tag uses a gradient. Requires colorful. */
|
|
21
29
|
gradient?: boolean;
|
|
30
|
+
/** Shape of the avatar in an avatar tag: square or circle. */
|
|
22
31
|
avatarShape?: AvatarShape;
|
|
32
|
+
/** Tag shape: square or circle. */
|
|
23
33
|
shape?: TagShape;
|
|
24
34
|
/** Runs before the tag hides; `event.preventDefault()` keeps it open */
|
|
25
35
|
onClose?: (event: TagCloseEvent, tagKey?: string | number) => void;
|
|
36
|
+
/** Snippet for the tag content. */
|
|
26
37
|
children?: Snippet;
|
|
38
|
+
/** Snippet for the icon before the content. */
|
|
27
39
|
prefixIcon?: Snippet;
|
|
40
|
+
/** Snippet for the icon after the content. */
|
|
28
41
|
suffixIcon?: Snippet;
|
|
29
42
|
}
|
|
30
43
|
export interface TagGroupItem extends Omit<TagProps, 'children' | 'prefixIcon' | 'suffixIcon'> {
|
|
31
44
|
children?: string | number;
|
|
32
45
|
}
|
|
33
46
|
export interface TagGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
47
|
+
/** Tag configurations. Each item holds the props of a Tag, with children as the string or number label. */
|
|
34
48
|
tagList: TagGroupItem[];
|
|
49
|
+
/** Maximum number of visible tags. The rest is shown as +N. */
|
|
35
50
|
maxTagCount?: number;
|
|
51
|
+
/** The number shown in +N. Defaults to the number of tags beyond maxTagCount. */
|
|
36
52
|
restCount?: number;
|
|
53
|
+
/** Size of the tags in the group. */
|
|
37
54
|
size?: TagSize;
|
|
55
|
+
/** Whether hovering +N shows the remaining tags in a Popover. */
|
|
38
56
|
showPopover?: boolean;
|
|
39
57
|
/** Spread onto the `+N` Popover; the rest tags and the trigger stay the group's own */
|
|
40
58
|
popoverProps?: PopoverProps;
|
|
59
|
+
/** Avatar shape of the avatar tags in the group. */
|
|
41
60
|
avatarShape?: AvatarShape;
|
|
61
|
+
/** Called when a tag in the group is closed, with the close event and the tagKey of the tag; the item's own onClose is called too. Update tagList in the callback. */
|
|
42
62
|
onTagClose?: (event: TagCloseEvent, tagKey?: string | number) => void;
|
|
63
|
+
/** Called when the pointer enters the +N tag. */
|
|
43
64
|
onPlusNMouseEnter?: (event: MouseEvent) => void;
|
|
44
65
|
/** Replaces the default tag; `index` counts across the visible tags and the `+N` popover */
|
|
45
66
|
tag?: Snippet<[scope: {
|
|
@@ -48,5 +69,6 @@ export interface TagGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chi
|
|
|
48
69
|
}]>;
|
|
49
70
|
}
|
|
50
71
|
export interface SplitTagGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
72
|
+
/** Snippet for the Tag components combined into one. */
|
|
51
73
|
children?: Snippet;
|
|
52
74
|
}
|
|
@@ -20,36 +20,60 @@ export interface TagInputProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
20
20
|
value?: string[] | null;
|
|
21
21
|
/** The input text, bindable; leave it out for an uncontrolled text. `bind:inputValue={get, set}` makes it fully controlled */
|
|
22
22
|
inputValue?: string;
|
|
23
|
+
/** Whether the component is disabled. */
|
|
23
24
|
disabled?: boolean;
|
|
25
|
+
/** Maximum length of one tag. */
|
|
24
26
|
maxLength?: number;
|
|
27
|
+
/** Maximum number of tags. */
|
|
25
28
|
max?: number;
|
|
29
|
+
/** Maximum number of tags shown; the rest are shown as +N. */
|
|
26
30
|
maxTagCount?: number;
|
|
31
|
+
/** Whether hovering +N shows the remaining tags in a Popover once maxTagCount is exceeded. */
|
|
27
32
|
showRestTagsPopover?: boolean;
|
|
33
|
+
/** Popover props of the +N popover, without content, child and children. */
|
|
28
34
|
restTagsPopoverProps?: RestTagsPopoverProps;
|
|
35
|
+
/** Whether hovering a truncated tag shows its full text in an overlay; an object picks the overlay type and the props passed to it. */
|
|
29
36
|
showContentTooltip?: boolean | ShowTooltip;
|
|
37
|
+
/** Whether the same tag can be added more than once. */
|
|
30
38
|
allowDuplicates?: boolean;
|
|
39
|
+
/** Whether the input text becomes a tag when the focus leaves the component. */
|
|
31
40
|
addOnBlur?: boolean;
|
|
41
|
+
/** Whether tags can be reordered by dragging. */
|
|
32
42
|
draggable?: boolean;
|
|
43
|
+
/** When not draggable, whether the collapsed tags expand once focus enters the component (click, Tab or the focus method). */
|
|
33
44
|
expandRestTagsOnClick?: boolean;
|
|
45
|
+
/** Placeholder of the input while there are no tags. */
|
|
34
46
|
placeholder?: string;
|
|
47
|
+
/** id of the inset label container, for aria-labelledby. */
|
|
35
48
|
insetLabelId?: string;
|
|
49
|
+
/** Separator(s) for adding several tags at once; null disables splitting. */
|
|
36
50
|
separator?: string | string[] | null;
|
|
51
|
+
/** Whether to show the button that clears all tags and the input text. */
|
|
37
52
|
showClear?: boolean;
|
|
53
|
+
/** Size: small, default or large. */
|
|
38
54
|
size?: TagInputSize;
|
|
55
|
+
/** Custom split function that returns the split strings. */
|
|
39
56
|
split?: (originString: string, separators: string | string[] | null) => string[];
|
|
57
|
+
/** Validation status, which only affects styling; error also sets aria-invalid on the input. */
|
|
40
58
|
validateStatus?: TagInputValidateStatus;
|
|
59
|
+
/** Whether the input is focused and the component activated on mount; ignored when disabled. */
|
|
41
60
|
autofocus?: boolean;
|
|
61
|
+
/** Whether the focus calls inside the component stop the browser from scrolling the focused element into view. */
|
|
42
62
|
preventScroll?: boolean;
|
|
63
|
+
/** Called when the tags change. */
|
|
43
64
|
onChange?: (value: string[]) => void;
|
|
44
65
|
/**
|
|
45
66
|
* The event is an input Event (typing), a KeyboardEvent (Enter adds), a FocusEvent (addOnBlur), a MouseEvent
|
|
46
67
|
* (clear) or a CompositionEvent (IME truncation); narrow it by `event.type` before reading its own fields
|
|
47
68
|
*/
|
|
48
69
|
onInputChange?: (value: string, event: Event) => void;
|
|
70
|
+
/** Called when tags are added, with the added tags. */
|
|
49
71
|
onAdd?: (addedValue: string[]) => void;
|
|
72
|
+
/** Called when a tag is removed, with the removed tag and its index. */
|
|
50
73
|
onRemove?: (removedValue: string, index: number) => void;
|
|
51
74
|
/** The whole list before it is cut to `max` */
|
|
52
75
|
onExceed?: (value: string[]) => void;
|
|
76
|
+
/** Called when the input text exceeds maxLength, with the rejected input text. */
|
|
53
77
|
onInputExceed?: (value: string) => void;
|
|
54
78
|
/** focusin on the root, once when the focus comes from outside the TagInput */
|
|
55
79
|
onFocus?: (event: FocusEvent) => void;
|
|
@@ -57,9 +81,14 @@ export interface TagInputProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
57
81
|
onBlur?: (event: FocusEvent) => void;
|
|
58
82
|
/** keydown in the input, after the TagInput handled it */
|
|
59
83
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
84
|
+
/** Snippet for the prefix of the input; text or an icon gets side spacing automatically. */
|
|
60
85
|
prefix?: Snippet;
|
|
86
|
+
/** Snippet for the suffix of the input; text or an icon gets side spacing automatically. */
|
|
61
87
|
suffix?: Snippet;
|
|
88
|
+
/** Snippet for the inset label shown before the input; when prefix is also given, only prefix is shown. When shown, it names an input that has no aria-label or aria-labelledby. */
|
|
62
89
|
insetLabel?: Snippet;
|
|
90
|
+
/** Snippet that replaces the icon in the clear button; empty content keeps the default icon. */
|
|
63
91
|
clearIcon?: Snippet;
|
|
92
|
+
/** Snippet that replaces each tag as a whole, receiving `{ value, index, onClose }`; empty content renders no tag and does not fall back to the default tag. */
|
|
64
93
|
tag?: Snippet<[TagInputTagSnippetProps]>;
|
|
65
94
|
}
|
|
@@ -23,48 +23,74 @@ export interface TimePickerProps extends Omit<HTMLInputAttributes, NativeInputKe
|
|
|
23
23
|
value?: TimePickerBaseValueType | TimePickerBaseValueType[] | null;
|
|
24
24
|
/** Bindable */
|
|
25
25
|
open?: boolean;
|
|
26
|
+
/** Selection type: time for a single time, timeRange for a range. */
|
|
26
27
|
type?: TimePickerType;
|
|
27
28
|
/** Defaults to `a h:mm:ss` with `use12Hours`, else `HH:mm:ss` */
|
|
28
29
|
format?: string;
|
|
30
|
+
/** Uses the 12-hour clock. */
|
|
29
31
|
use12Hours?: boolean;
|
|
32
|
+
/** Interval of the hour options; a positive integer. */
|
|
30
33
|
hourStep?: number;
|
|
34
|
+
/** Interval of the minute options; a positive integer. */
|
|
31
35
|
minuteStep?: number;
|
|
36
|
+
/** Interval of the second options; a positive integer. */
|
|
32
37
|
secondStep?: number;
|
|
38
|
+
/** Disables all interaction. */
|
|
33
39
|
disabled?: boolean;
|
|
40
|
+
/** Returns the hours that cannot be selected. */
|
|
34
41
|
disabledHours?: () => number[];
|
|
42
|
+
/** Returns the minutes that cannot be selected for the selected hour. */
|
|
35
43
|
disabledMinutes?: (selectedHour: number) => number[];
|
|
44
|
+
/** Returns the seconds that cannot be selected for the selected hour and minute. */
|
|
36
45
|
disabledSeconds?: (selectedHour: number, selectedMinute: number) => number[];
|
|
37
46
|
/**
|
|
38
47
|
* Range only: the disabled times of the left and right panel; a callback it leaves out falls back to the prop.
|
|
39
48
|
* `value` is the shown value, its unpicked side undefined.
|
|
40
49
|
*/
|
|
41
50
|
disabledTime?: (value: (Date | undefined)[], panelType: PanelType) => DisabledTimeFns;
|
|
51
|
+
/** Hides the options that cannot be selected. */
|
|
42
52
|
hideDisabledOptions?: boolean;
|
|
43
53
|
/** Defaults to the locale's placeholder of `type` */
|
|
44
54
|
placeholder?: string;
|
|
55
|
+
/** Separator between the two times of a range. */
|
|
45
56
|
rangeSeparator?: string;
|
|
57
|
+
/** Size of the input. */
|
|
46
58
|
size?: InputSize;
|
|
59
|
+
/** Borderless mode. */
|
|
47
60
|
borderless?: boolean;
|
|
61
|
+
/** Whether to show the clear button. */
|
|
48
62
|
showClear?: boolean;
|
|
63
|
+
/** Makes the input read-only, which avoids opening the virtual keyboard on mobile devices. */
|
|
49
64
|
inputReadOnly?: boolean;
|
|
65
|
+
/** Validation status. */
|
|
50
66
|
validateStatus?: ValidateStatus;
|
|
67
|
+
/** id of the insetLabel, referenced through aria-labelledby. */
|
|
51
68
|
insetLabelId?: string;
|
|
52
69
|
/** `dropdown` is the panel card; `input` is the Input's root element */
|
|
53
70
|
classNames?: Partial<Record<TimePickerPart, ClassValue>>;
|
|
71
|
+
/** Style strings of the inner parts, keyed like classNames. */
|
|
54
72
|
styles?: Partial<Record<TimePickerPart, string>>;
|
|
73
|
+
/** Focuses the input on mount, which opens the panel. */
|
|
55
74
|
autofocus?: boolean;
|
|
56
75
|
/** Focuses and selects the input once mounted */
|
|
57
76
|
focusOnOpen?: boolean;
|
|
77
|
+
/** Whether the browser should scroll the document to show the newly focused element; applies to the focus call inside the component. */
|
|
58
78
|
preventScroll?: boolean;
|
|
79
|
+
/** Whether the popup animates. */
|
|
59
80
|
motion?: boolean;
|
|
81
|
+
/** Whether to flip the popup automatically when it is clipped. */
|
|
60
82
|
autoAdjustOverflow?: boolean;
|
|
83
|
+
/** Popup position. Defaults to bottom when type is timeRange, and bottomLeft when it is time. */
|
|
61
84
|
position?: Position;
|
|
85
|
+
/** Whether to stop click events on the popup from bubbling. */
|
|
62
86
|
stopPropagation?: boolean;
|
|
63
87
|
/** Falls back to ConfigProvider's timeZone */
|
|
64
88
|
timeZone?: string | number;
|
|
89
|
+
/** Props passed to the columns; only cycled, mode, motion and transform, as on the ScrollItem of ScrollList. */
|
|
65
90
|
scrollItemProps?: TimePickerScrollItemProps;
|
|
66
91
|
/** `undefined` (single) or `[]` (range) when cleared; the unpicked side of a range is undefined */
|
|
67
92
|
onChange?: (value: Date | (Date | undefined)[] | undefined, str: string | string[]) => void;
|
|
93
|
+
/** Called when the panel opens or closes. */
|
|
68
94
|
onOpenChange?: (open: boolean) => void;
|
|
69
95
|
/** focusin on the Input's root, so focus moving between the input and its clear button does not fire it */
|
|
70
96
|
onFocus?: (event: FocusEvent) => void;
|
|
@@ -72,12 +98,17 @@ export interface TimePickerProps extends Omit<HTMLInputAttributes, NativeInputKe
|
|
|
72
98
|
onBlur?: (event: MouseEvent) => void;
|
|
73
99
|
/** Replaces the input; with no focusable element of its own, its wrapper is the button that opens the panel */
|
|
74
100
|
trigger?: Snippet<[TimePickerTriggerRenderProps]>;
|
|
101
|
+
/** Snippet for the content above the panel; index is the panel's position (0 for time, 0 or 1 for timeRange). Without it, a range shows the locale's start and end text. */
|
|
75
102
|
panelHeader?: Snippet<[TimePickerPanelSnippetProps]>;
|
|
103
|
+
/** Snippet for the content below the panel; index is the panel's position. */
|
|
76
104
|
panelFooter?: Snippet<[TimePickerPanelSnippetProps]>;
|
|
77
105
|
/** Range only: header and footer of both panels, over `panelHeader` and `panelFooter` */
|
|
78
106
|
panel?: Snippet<[TimePickerPanelSnippetProps]>;
|
|
107
|
+
/** Prefix content of the input. */
|
|
79
108
|
prefix?: Snippet;
|
|
109
|
+
/** Inset label of the input. */
|
|
80
110
|
insetLabel?: Snippet;
|
|
111
|
+
/** Custom clear icon; effective when showClear is true. */
|
|
81
112
|
clearIcon?: Snippet;
|
|
82
113
|
}
|
|
83
114
|
export interface TimePickerTriggerRenderProps {
|
|
@@ -19,9 +19,14 @@ export interface TimelineSnippetProps {
|
|
|
19
19
|
index: number;
|
|
20
20
|
}
|
|
21
21
|
export interface TimelineProps extends HTMLAttributes<HTMLUListElement> {
|
|
22
|
+
/** Position of the timeline relative to the content: left, right, center or alternate. */
|
|
22
23
|
mode?: TimelineMode;
|
|
24
|
+
/** Data array the items are rendered from. See the item fields below; `dot` is the snippet of a custom dot for that item, and the default circle is drawn when unset. */
|
|
23
25
|
dataSource?: TimelineData[];
|
|
26
|
+
/** Snippet for the content of each dataSource item, with the parameter `{ item, index }`. Defaults to item.content. */
|
|
24
27
|
content?: Snippet<[TimelineSnippetProps]>;
|
|
28
|
+
/** Snippet for the time of each dataSource item, with the parameter `{ item, index }`. Defaults to item.time. */
|
|
25
29
|
time?: Snippet<[TimelineSnippetProps]>;
|
|
30
|
+
/** Snippet for the extra content of each dataSource item, with the parameter `{ item, index }`. Defaults to item.extra. */
|
|
26
31
|
extra?: Snippet<[TimelineSnippetProps]>;
|
|
27
32
|
}
|
|
@@ -33,42 +33,62 @@ export interface TooltipProps extends TooltipBaseProps {
|
|
|
33
33
|
child?: Snippet<[{
|
|
34
34
|
props: TooltipTriggerProps;
|
|
35
35
|
}]>;
|
|
36
|
+
/** Snippet for the popup content, with the parameter `{ initialFocusRef }`: write `{@attach initialFocusRef}` on the element that should receive focus when the popup opens. */
|
|
36
37
|
content?: Snippet<[RenderContentProps]>;
|
|
38
|
+
/** Snippet that replaces the default arrow while showArrow is true. */
|
|
37
39
|
arrow?: Snippet;
|
|
40
|
+
/** Class name of the popup. */
|
|
38
41
|
class?: string;
|
|
39
42
|
/** On the popup, before the positioning declarations; its `background-color` also colors the arrow */
|
|
40
43
|
style?: string;
|
|
44
|
+
/** Whether the popup is animated. */
|
|
41
45
|
motion?: boolean;
|
|
46
|
+
/** Whether the popup flips automatically when it would be clipped. */
|
|
42
47
|
autoAdjustOverflow?: boolean;
|
|
48
|
+
/** Position of the popup relative to the trigger element. */
|
|
43
49
|
position?: Position;
|
|
50
|
+
/** Distance in pixels between the popup and the trigger. An object sets the horizontal and vertical distances. */
|
|
44
51
|
spacing?: number | {
|
|
45
52
|
x: number;
|
|
46
53
|
y: number;
|
|
47
54
|
};
|
|
55
|
+
/** Whether the arrow is shown. */
|
|
48
56
|
showArrow?: boolean;
|
|
57
|
+
/** ARIA role of the popup. */
|
|
49
58
|
role?: string;
|
|
50
59
|
/** Name and description of a role="dialog" popup (F12); ignored for other roles */
|
|
51
60
|
'aria-label'?: string;
|
|
61
|
+
/** aria-labelledby of the popup when its role is dialog. */
|
|
52
62
|
'aria-labelledby'?: string;
|
|
63
|
+
/** aria-describedby of the popup when its role is dialog. */
|
|
53
64
|
'aria-describedby'?: string;
|
|
65
|
+
/** Whether the arrow points at the center of the trigger. Requires showArrow. */
|
|
54
66
|
arrowPointAtCenter?: boolean;
|
|
67
|
+
/** Whether click, mousedown and focus in/out events on the popup stop propagating. */
|
|
55
68
|
stopPropagation?: boolean;
|
|
56
69
|
/** `wrapper` exists only when the trigger is wrapped: text, several nodes, or a disabled or loading trigger */
|
|
57
70
|
classNames?: Partial<Record<TooltipPart, ClassValue>>;
|
|
71
|
+
/** Inline style strings of the inner parts, keyed like `classNames`; applied after the span's built-in style. */
|
|
58
72
|
styles?: Partial<Record<TooltipPart, string>>;
|
|
73
|
+
/** id of the popup element, referenced by the trigger's ARIA attributes. Generated when omitted. */
|
|
59
74
|
wrapperId?: string;
|
|
60
75
|
/**
|
|
61
76
|
* Whether a disabled or loading Semi Button, Switch or Checkbox that fills the default span gets its pointer events
|
|
62
77
|
* through the span (F4); false leaves it as it is
|
|
63
78
|
*/
|
|
64
79
|
wrapWhenSpecial?: boolean;
|
|
80
|
+
/** Whether the popup content stays mounted while closed. */
|
|
65
81
|
keepDOM?: boolean;
|
|
82
|
+
/** Called when the visibility of the popup changes; with a controlled visible it reports only requests from user interaction, not changes the parent makes to visible. */
|
|
66
83
|
onVisibleChange?: (visible: boolean) => void;
|
|
84
|
+
/** Called when the mouse is pressed outside of the trigger and the open popup. Only for trigger click, contextMenu or custom, or with clickTriggerToHide. */
|
|
67
85
|
onClickOutSide?: (event: MouseEvent) => void;
|
|
86
|
+
/** Called when Esc is pressed while the popup is open and closeOnEsc is true. */
|
|
68
87
|
onEscKeyDown?: (event: KeyboardEvent) => void;
|
|
69
88
|
/** Once per opening when the popup is shown, as its enter transition starts */
|
|
70
89
|
onOpen?: () => void;
|
|
71
90
|
/** Once per opening after the enter transition, not for an opening closed before it finishes */
|
|
72
91
|
afterOpen?: () => void;
|
|
92
|
+
/** Called after the popup has closed and its leave animation has finished. */
|
|
73
93
|
afterClose?: () => void;
|
|
74
94
|
}
|
|
@@ -50,23 +50,33 @@ type NativeKeys = 'onchange' | 'onselect' | 'children';
|
|
|
50
50
|
export interface TransferProps extends Omit<HTMLAttributes<HTMLDivElement>, NativeKeys> {
|
|
51
51
|
/** Bindable; leave it out for an uncontrolled transfer. `bind:value={get, set}` makes it fully controlled */
|
|
52
52
|
value?: TransferValue;
|
|
53
|
+
/** Data source: an array of items for list, an array of groups for groupList, or tree data with children for treeList (a leaf writes `children: []`). The tree of a treeList only updates when a new array is passed, changes made in place are not seen. */
|
|
53
54
|
dataSource?: TransferDataSource;
|
|
55
|
+
/** Transfer type: list, groupList or treeList. */
|
|
54
56
|
type?: TransferType;
|
|
57
|
+
/** Whether the whole transfer is disabled. */
|
|
55
58
|
disabled?: boolean;
|
|
59
|
+
/** Enables drag sorting of the selected items on the right. After a sort, value and onChange carry the new order. */
|
|
56
60
|
draggable?: boolean;
|
|
61
|
+
/** Whether the options on the left are loading. */
|
|
57
62
|
loading?: boolean;
|
|
58
63
|
/** treeList only: the selected items show their path from the root */
|
|
59
64
|
showPath?: boolean;
|
|
60
65
|
/** false hides the search box; a function replaces the default case-insensitive label match */
|
|
61
66
|
filter?: boolean | ((searchValue: string, item: TransferDataItem) => boolean);
|
|
67
|
+
/** Props passed to the search Input, see Input for the options. Transfer owns its value and onChange; to search from outside, call the search method. */
|
|
62
68
|
inputProps?: TransferInputProps;
|
|
63
69
|
/** treeList only; of the Tree's snippets only `label` is forwarded */
|
|
64
70
|
treeProps?: TransferTreeProps;
|
|
71
|
+
/** Paging of the left panel, for list and groupList only. onPageChange lives inside the object. */
|
|
65
72
|
pagination?: TransferPagination;
|
|
66
73
|
/** Renders the selected list virtually; ignored while `draggable` */
|
|
67
74
|
virtualize?: TransferVirtualize;
|
|
75
|
+
/** Called when the selection changes, including after a drag sort, with the array of values and the array of their items. This is the callback of Transfer, not the native change of the root element. */
|
|
68
76
|
onChange?: (values: TransferValue, items: TransferDataItem[]) => void;
|
|
77
|
+
/** Called when an item is checked, with that item. */
|
|
69
78
|
onSelect?: (item: TransferDataItem) => void;
|
|
79
|
+
/** Called when an item is unchecked, with that item. */
|
|
70
80
|
onDeselect?: (item: TransferDataItem) => void;
|
|
71
81
|
/** Typing in the search box; the `search` method does not fire it */
|
|
72
82
|
onSearch?: (searchValue: string) => void;
|
|
@@ -74,15 +84,23 @@ export interface TransferProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
74
84
|
onBlur?: (event: FocusEvent) => void;
|
|
75
85
|
/** Content of an item in both lists; the dataSource label is the default */
|
|
76
86
|
label?: Snippet<[TransferLabelSnippetProps]>;
|
|
87
|
+
/** Replaces one item on the left. index is the position among the shown items after filtering and paging, not the position in dataSource. */
|
|
77
88
|
sourceItem?: Snippet<[TransferSourceItemSnippetProps]>;
|
|
89
|
+
/** Replaces one selected item on the right. With draggable, handle is a `Snippet<[Snippet]>`: write the drag icon as a snippet and wrap it with `{@render handle?.(grip)}`. With treeList and showPath, fullPath holds the whole path. */
|
|
78
90
|
selectedItem?: Snippet<[TransferSelectedItemSnippetProps]>;
|
|
91
|
+
/** Replaces the header of the left panel. leafOnlyNum is provided for treeList only. */
|
|
79
92
|
sourceHeader?: Snippet<[TransferSourceHeaderSnippetProps]>;
|
|
93
|
+
/** Replaces the header of the right panel. */
|
|
80
94
|
selectedHeader?: Snippet<[TransferSelectedHeaderSnippetProps]>;
|
|
95
|
+
/** Replaces the whole left panel, reusing the filtering and selection logic of Transfer. */
|
|
81
96
|
sourcePanel?: Snippet<[TransferSourcePanelSnippetProps]>;
|
|
97
|
+
/** Replaces the whole right panel. Call onSortEnd after a drag sort you implemented has finished. */
|
|
82
98
|
selectedPanel?: Snippet<[TransferSelectedPanelSnippetProps]>;
|
|
83
99
|
/** `false` hides the empty state */
|
|
84
100
|
emptyLeft?: Snippet | false;
|
|
101
|
+
/** Shown when nothing is selected. The locale text appears when it is not provided; false hides the empty state. */
|
|
85
102
|
emptyRight?: Snippet | false;
|
|
103
|
+
/** Shown when the search matches nothing. The locale text appears when it is not provided; false hides the empty state. */
|
|
86
104
|
emptySearch?: Snippet | false;
|
|
87
105
|
}
|
|
88
106
|
/** The methods on a Transfer instance from `bind:this` */
|