@fibrae/semi-ui-svelte 0.2.0 → 0.3.1
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/LICENSE +0 -62
- package/README.md +40 -38
- package/README.zh-CN.md +91 -0
- package/dist/_base/create-context.js +0 -1
- package/dist/_base/css-animation.js +0 -1
- package/dist/_base/group-role.d.ts +0 -1
- package/dist/_base/group-role.js +0 -1
- package/dist/_base/slot-kind.d.ts +0 -1
- package/dist/_base/slot-kind.js +0 -1
- package/dist/_base/teleport.d.ts +0 -2
- package/dist/_base/teleport.js +0 -2
- package/dist/_base/use-click-outside.svelte.d.ts +2 -2
- package/dist/_base/use-click-outside.svelte.js +2 -2
- package/dist/_base/use-foundation.svelte.js +2 -5
- package/dist/_base/virtual-list.svelte +2 -3
- package/dist/_base/virtual-list.svelte.d.ts +0 -1
- package/dist/_sortable/interface.d.ts +0 -1
- package/dist/anchor/interface.d.ts +0 -3
- package/dist/anchor/link-item.svelte +0 -1
- package/dist/anchor/links.d.ts +0 -1
- package/dist/anchor/links.js +0 -1
- package/dist/audio-player/audio-player.svelte +0 -2
- package/dist/audio-player/audio-slider.svelte +0 -3
- package/dist/auto-complete/auto-complete.svelte +0 -5
- package/dist/auto-complete/interface.d.ts +0 -9
- package/dist/avatar/avatar-group-more.svelte +0 -1
- package/dist/avatar/avatar.svelte +0 -4
- package/dist/avatar/context.d.ts +0 -1
- package/dist/avatar/interface.d.ts +0 -4
- package/dist/backtop/backtop.svelte +0 -2
- package/dist/backtop/interface.d.ts +0 -1
- package/dist/badge/interface.d.ts +0 -1
- package/dist/banner/banner.svelte +1 -1
- package/dist/banner/interface.d.ts +1 -3
- package/dist/breadcrumb/breadcrumb-item.svelte +0 -1
- package/dist/breadcrumb/breadcrumb.svelte +0 -1
- package/dist/breadcrumb/interface.d.ts +0 -7
- package/dist/calendar/calendar.svelte +0 -1
- package/dist/calendar/day-calendar.svelte +0 -3
- package/dist/calendar/interface.d.ts +0 -8
- package/dist/calendar/month-calendar.svelte +0 -4
- package/dist/calendar/time-grid.svelte +0 -2
- package/dist/calendar/time-grid.svelte.d.ts +0 -1
- package/dist/calendar/use-today.svelte.d.ts +0 -1
- package/dist/calendar/use-today.svelte.js +0 -1
- package/dist/card/index.js +0 -1
- package/dist/card/interface.d.ts +0 -3
- package/dist/carousel/carousel.svelte +0 -4
- package/dist/carousel/interface.d.ts +0 -3
- package/dist/cascader/cascader.svelte +0 -6
- package/dist/cascader/interface.d.ts +0 -19
- package/dist/cascader/item.svelte +0 -4
- package/dist/cascader/item.svelte.d.ts +0 -4
- package/dist/checkbox/checkbox-group.svelte +0 -3
- package/dist/checkbox/checkbox.svelte +0 -4
- package/dist/checkbox/index.js +0 -1
- package/dist/checkbox/interface.d.ts +0 -1
- package/dist/code-highlight/interface.d.ts +0 -1
- package/dist/collapse/collapse.svelte +0 -2
- package/dist/collapse/index.js +0 -1
- package/dist/collapse/interface.d.ts +0 -2
- package/dist/collapse/panel.svelte +0 -1
- package/dist/collapsible/collapsible.svelte +0 -2
- package/dist/color-picker/alpha-slider.svelte +0 -1
- package/dist/color-picker/color-choose-area.svelte +0 -1
- package/dist/color-picker/color-slider.svelte +0 -1
- package/dist/color-picker/data-part.svelte +0 -1
- package/dist/cropper/cropper.svelte +0 -1
- package/dist/cropper/interface.d.ts +0 -6
- package/dist/date-picker/date-input.svelte +0 -4
- package/dist/date-picker/date-picker.svelte +0 -7
- package/dist/date-picker/inset-input.svelte +0 -1
- package/dist/date-picker/interface.d.ts +0 -7
- package/dist/date-picker/internal.d.ts +0 -7
- package/dist/date-picker/month.svelte +0 -1
- package/dist/date-picker/months-grid.svelte +0 -6
- package/dist/date-picker/navigation.svelte +0 -1
- package/dist/descriptions/interface.d.ts +0 -1
- package/dist/divider/divider.svelte +0 -1
- package/dist/divider/interface.d.ts +0 -4
- package/dist/drag-move/drag-move.js +0 -1
- package/dist/drag-move/interface.d.ts +0 -3
- package/dist/dropdown/context.d.ts +0 -6
- package/dist/dropdown/context.js +0 -1
- package/dist/dropdown/dropdown-item.svelte +0 -1
- package/dist/dropdown/dropdown.svelte +0 -7
- package/dist/dropdown/interface.d.ts +0 -4
- package/dist/empty/empty.svelte +0 -1
- package/dist/empty/interface.d.ts +0 -3
- package/dist/feedback/feedback.svelte +0 -1
- package/dist/feedback/interface.d.ts +0 -8
- package/dist/float-button/float-button-action.svelte +0 -2
- package/dist/float-button/interface.d.ts +0 -2
- package/dist/form/array-field.svelte +0 -2
- package/dist/form/context.d.ts +0 -2
- package/dist/form/error-message.svelte +0 -1
- package/dist/form/field-grid.svelte +0 -2
- package/dist/form/field-grid.svelte.d.ts +0 -2
- package/dist/form/field-inner.svelte +0 -2
- package/dist/form/field.svelte +0 -1
- package/dist/form/form.svelte +0 -1
- package/dist/form/hooks.d.ts +1 -2
- package/dist/form/hooks.js +1 -2
- package/dist/form/interface.d.ts +0 -7
- package/dist/form/utils.d.ts +0 -1
- package/dist/form/utils.js +0 -2
- package/dist/highlight/interface.d.ts +0 -1
- package/dist/hot-keys/interface.d.ts +0 -1
- package/dist/image/context.d.ts +0 -1
- package/dist/image/footer.d.ts +0 -1
- package/dist/image/interface.d.ts +0 -8
- package/dist/image/preview-image.svelte +0 -3
- package/dist/image/preview-image.svelte.d.ts +0 -1
- package/dist/image/preview-inner.svelte +0 -3
- package/dist/image/preview-inner.svelte.d.ts +0 -1
- package/dist/input/context.d.ts +0 -1
- package/dist/input/interface.d.ts +0 -3
- package/dist/input/textarea.svelte +0 -3
- package/dist/input-number/input-number.svelte +0 -2
- package/dist/input-number/interface.d.ts +0 -1
- package/dist/json-viewer/interface.d.ts +0 -4
- package/dist/json-viewer/json-viewer.svelte +0 -3
- package/dist/layout/interface.d.ts +0 -2
- package/dist/list/interface.d.ts +0 -2
- package/dist/lottie/interface.d.ts +1 -1
- package/dist/markdown-render/code-text.js +0 -1
- package/dist/markdown-render/components/code.svelte +0 -1
- package/dist/markdown-render/components/heading.svelte +0 -1
- package/dist/markdown-render/components/p.svelte +0 -1
- package/dist/markdown-render/components/table.svelte +0 -1
- package/dist/markdown-render/components/tree.d.ts +0 -4
- package/dist/markdown-render/components/tree.js +0 -2
- package/dist/markdown-render/interface.d.ts +0 -1
- package/dist/markdown-render/markdown-children.svelte +0 -2
- package/dist/markdown-render/markdown-render.svelte +0 -1
- package/dist/markdown-render/runtime.js +0 -1
- package/dist/modal/confirm-modal.svelte +0 -1
- package/dist/modal/confirm.svelte.d.ts +0 -1
- package/dist/modal/confirm.svelte.js +0 -1
- package/dist/modal/index.js +0 -1
- package/dist/modal/interface.d.ts +0 -6
- package/dist/modal/modal-content.svelte +0 -4
- package/dist/modal/modal.svelte +0 -1
- package/dist/modal/use-show-hide.svelte.d.ts +0 -2
- package/dist/modal/use-show-hide.svelte.js +0 -4
- package/dist/navigation/context.d.ts +0 -2
- package/dist/navigation/index.js +0 -1
- package/dist/navigation/interface.d.ts +1 -17
- package/dist/navigation/item-shell.svelte +0 -4
- package/dist/navigation/item-shell.svelte.d.ts +0 -3
- package/dist/navigation/nav-footer.svelte +0 -2
- package/dist/navigation/nav-items.svelte +0 -1
- package/dist/navigation/nav.svelte +0 -1
- package/dist/navigation/sub-nav.svelte +0 -5
- package/dist/navigation/wrapper-outlet.svelte +0 -1
- package/dist/notification/context.d.ts +0 -3
- package/dist/notification/interface.d.ts +0 -5
- package/dist/notification/notice-list.svelte +0 -2
- package/dist/notification/notice-list.svelte.d.ts +0 -1
- package/dist/notification/notice.svelte +0 -2
- package/dist/notification/notification-list.svelte +0 -1
- package/dist/notification/static-api.js +0 -1
- package/dist/overflow-list/interface.d.ts +0 -2
- package/dist/overflow-list/overflow-list.svelte +0 -2
- package/dist/pagination/interface.d.ts +0 -1
- package/dist/pagination/pagination.svelte +0 -2
- package/dist/pagination/step-button.svelte +0 -3
- package/dist/pagination/step-button.svelte.d.ts +0 -1
- package/dist/pincode/interface.d.ts +0 -1
- package/dist/pincode/pincode.svelte +0 -3
- package/dist/popconfirm/interface.d.ts +0 -1
- package/dist/popconfirm/popconfirm.svelte +0 -2
- package/dist/popover/interface.d.ts +0 -1
- package/dist/popover/popover.svelte +0 -1
- package/dist/radio/index.js +0 -1
- package/dist/radio/radio-group.svelte +0 -1
- package/dist/radio/radio.svelte +0 -1
- package/dist/rating/interface.d.ts +0 -2
- package/dist/rating/item.svelte +0 -1
- package/dist/rating/rating.svelte +0 -7
- package/dist/resizable/interface.d.ts +0 -2
- package/dist/resizable/resizable.svelte +0 -1
- package/dist/resizable/resize-group.svelte +0 -1
- package/dist/resizable/resize-handler.svelte +0 -1
- package/dist/resize-observer/observe-resize.d.ts +1 -5
- package/dist/resize-observer/observe-resize.js +1 -5
- package/dist/scroll-list/index.js +0 -1
- package/dist/scroll-list/interface.d.ts +0 -2
- package/dist/scroll-list/scroll-item.svelte +0 -2
- package/dist/select/interface.d.ts +0 -14
- package/dist/select/option.svelte +0 -5
- package/dist/select/option.svelte.d.ts +0 -5
- package/dist/select/select.svelte +0 -14
- package/dist/side-sheet/interface.d.ts +0 -1
- package/dist/side-sheet/side-sheet.svelte +0 -9
- package/dist/skeleton/index.js +0 -1
- package/dist/skeleton/interface.d.ts +0 -2
- package/dist/skeleton/skeleton-item.svelte +0 -1
- package/dist/slider/interface.d.ts +0 -5
- package/dist/slider/slider.svelte +0 -7
- package/dist/space/interface.d.ts +0 -1
- package/dist/space/space.svelte +0 -1
- package/dist/steps/context.d.ts +0 -1
- package/dist/steps/interface.d.ts +0 -2
- package/dist/steps/step.svelte +0 -3
- package/dist/switch/switch.svelte +0 -2
- package/dist/table/body/base-row.svelte +0 -4
- package/dist/table/body/base-row.svelte.d.ts +0 -4
- package/dist/table/body/body.svelte +0 -7
- package/dist/table/body/body.svelte.d.ts +0 -5
- package/dist/table/body/expanded-row.svelte +0 -1
- package/dist/table/body/expanded-row.svelte.d.ts +0 -1
- package/dist/table/body/section-row.svelte +0 -2
- package/dist/table/body/section-row.svelte.d.ts +0 -2
- package/dist/table/column-filter-menu.svelte +0 -3
- package/dist/table/column-filter-menu.svelte.d.ts +0 -3
- package/dist/table/column-filter.svelte +0 -2
- package/dist/table/column-filter.svelte.d.ts +0 -2
- package/dist/table/column-selection.svelte +1 -2
- package/dist/table/column-selection.svelte.d.ts +0 -1
- package/dist/table/column-sorter.svelte +1 -6
- package/dist/table/column-sorter.svelte.d.ts +1 -6
- package/dist/table/context.d.ts +0 -10
- package/dist/table/context.js +0 -1
- package/dist/table/custom-expand-icon.svelte +0 -2
- package/dist/table/custom-expand-icon.svelte.d.ts +0 -2
- package/dist/table/head-table.svelte +0 -1
- package/dist/table/head-table.svelte.d.ts +0 -1
- package/dist/table/interface.d.ts +2 -21
- package/dist/table/table-cell.svelte +0 -7
- package/dist/table/table-cell.svelte.d.ts +0 -7
- package/dist/table/table-header-row.svelte +0 -2
- package/dist/table/table-header-row.svelte.d.ts +0 -2
- package/dist/table/table-pagination.svelte +0 -2
- package/dist/table/table-pagination.svelte.d.ts +0 -2
- package/dist/table/table.svelte +0 -5
- package/dist/table/utils.d.ts +1 -13
- package/dist/table/utils.js +1 -11
- package/dist/tabs/index.js +0 -1
- package/dist/tabs/interface.d.ts +0 -13
- package/dist/tabs/tab-bar.svelte +0 -3
- package/dist/tabs/tab-bar.svelte.d.ts +0 -1
- package/dist/tabs/tab-pane.svelte +0 -2
- package/dist/tabs/tabs.svelte +0 -1
- package/dist/tag-input/interface.d.ts +0 -5
- package/dist/tag-input/tag-input.svelte +0 -3
- package/dist/tag-input/tag-item.svelte +0 -1
- package/dist/tag-input/tag-item.svelte.d.ts +0 -1
- package/dist/time-picker/combobox.svelte +0 -1
- package/dist/time-picker/interface.d.ts +0 -9
- package/dist/time-picker/time-picker.svelte +0 -2
- package/dist/timeline/interface.d.ts +0 -4
- package/dist/timeline/timeline.svelte +0 -1
- package/dist/toast/context.d.ts +0 -2
- package/dist/toast/interface.d.ts +0 -2
- package/dist/toast/static-api.js +0 -1
- package/dist/toast/toast.svelte +0 -1
- package/dist/toast/use-toast.js +0 -1
- package/dist/tooltip/context.d.ts +0 -2
- package/dist/tooltip/interface.d.ts +0 -2
- package/dist/tooltip/tooltip.svelte +0 -5
- package/dist/transfer/interface.d.ts +1 -8
- package/dist/transfer/transfer-selected-item.svelte +0 -1
- package/dist/transfer/transfer-selected-item.svelte.d.ts +0 -1
- package/dist/transfer/transfer.svelte +0 -1
- package/dist/tree/auto-sizer.svelte +0 -1
- package/dist/tree/context.d.ts +0 -1
- package/dist/tree/interface.d.ts +0 -9
- package/dist/tree/node-collapsible.svelte +0 -1
- package/dist/tree/node-list.svelte +0 -4
- package/dist/tree/tree-node.svelte +0 -1
- package/dist/tree/tree.svelte +0 -3
- package/dist/tree/use-tree-keyboard.svelte.d.ts +1 -8
- package/dist/tree/use-tree-keyboard.svelte.js +1 -6
- package/dist/tree-select/interface.d.ts +0 -11
- package/dist/tree-select/tree-select.svelte +0 -2
- package/dist/typography/base.svelte +0 -2
- package/dist/typography/index.js +0 -1
- package/dist/typography/interface.d.ts +0 -1
- package/dist/typography/internal.d.ts +0 -2
- package/dist/upload/file-card.svelte +0 -1
- package/dist/upload/index.js +0 -1
- package/dist/upload/interface.d.ts +0 -4
- package/dist/upload/upload.svelte +0 -1
- package/dist/user-guide/interface.d.ts +0 -1
- package/dist/user-guide/user-guide.svelte +0 -1
- package/dist/video-player/video-progress.svelte +0 -2
- package/package.json +4 -4
|
@@ -15,28 +15,21 @@
|
|
|
15
15
|
interface TableCellProps {
|
|
16
16
|
column: ColumnProps;
|
|
17
17
|
record?: AnyRecord;
|
|
18
|
-
/** The index of the record among its siblings, or of the row in a virtualized body */
|
|
19
18
|
index?: number;
|
|
20
|
-
/** The sticky offset of a left fixed column */
|
|
21
19
|
fixedLeft?: number | false;
|
|
22
20
|
fixedRight?: number | false;
|
|
23
21
|
lastFixedLeft?: boolean;
|
|
24
22
|
firstFixedRight?: boolean;
|
|
25
23
|
/** The columns from this one to the table's end, itself included */
|
|
26
24
|
columnsToEnd?: number;
|
|
27
|
-
/** The tree level the cell content is indented by */
|
|
28
25
|
indent?: number;
|
|
29
|
-
/** The cell shows the expand button of its row before the content */
|
|
30
26
|
showExpandIcon?: boolean;
|
|
31
|
-
/** The expand button of the row, for the first data cell of an expandable row */
|
|
32
27
|
expandIconArgs?: { isNested: boolean; groupKey?: string | number };
|
|
33
28
|
hovered?: boolean;
|
|
34
29
|
isSection?: boolean;
|
|
35
30
|
width?: number;
|
|
36
31
|
tag?: string;
|
|
37
|
-
/** Extra cell attributes of an expanded or section row */
|
|
38
32
|
cellAttrs?: TableCellAttrs;
|
|
39
|
-
/** The content of an expanded or section row's cell */
|
|
40
33
|
children?: Snippet;
|
|
41
34
|
}
|
|
42
35
|
|
|
@@ -4,20 +4,15 @@ type AnyRecord = Record<string, any>;
|
|
|
4
4
|
interface TableCellProps {
|
|
5
5
|
column: ColumnProps;
|
|
6
6
|
record?: AnyRecord;
|
|
7
|
-
/** The index of the record among its siblings, or of the row in a virtualized body */
|
|
8
7
|
index?: number;
|
|
9
|
-
/** The sticky offset of a left fixed column */
|
|
10
8
|
fixedLeft?: number | false;
|
|
11
9
|
fixedRight?: number | false;
|
|
12
10
|
lastFixedLeft?: boolean;
|
|
13
11
|
firstFixedRight?: boolean;
|
|
14
12
|
/** The columns from this one to the table's end, itself included */
|
|
15
13
|
columnsToEnd?: number;
|
|
16
|
-
/** The tree level the cell content is indented by */
|
|
17
14
|
indent?: number;
|
|
18
|
-
/** The cell shows the expand button of its row before the content */
|
|
19
15
|
showExpandIcon?: boolean;
|
|
20
|
-
/** The expand button of the row, for the first data cell of an expandable row */
|
|
21
16
|
expandIconArgs?: {
|
|
22
17
|
isNested: boolean;
|
|
23
18
|
groupKey?: string | number;
|
|
@@ -26,9 +21,7 @@ interface TableCellProps {
|
|
|
26
21
|
isSection?: boolean;
|
|
27
22
|
width?: number;
|
|
28
23
|
tag?: string;
|
|
29
|
-
/** Extra cell attributes of an expanded or section row */
|
|
30
24
|
cellAttrs?: TableCellAttrs;
|
|
31
|
-
/** The content of an expanded or section row's cell */
|
|
32
25
|
children?: Snippet;
|
|
33
26
|
}
|
|
34
27
|
declare const TableCell: import("svelte").Component<TableCellProps, {}, "">;
|
|
@@ -2,9 +2,7 @@ import { type TableHeaderCell } from '@fibrae/semi-foundation/table/utils';
|
|
|
2
2
|
import type { ColumnProps } from './interface.js';
|
|
3
3
|
interface TableHeaderRowProps {
|
|
4
4
|
row: TableHeaderCell<ColumnProps>[];
|
|
5
|
-
/** The header row index, the level of its columns */
|
|
6
5
|
index: number;
|
|
7
|
-
/** The column tree */
|
|
8
6
|
columns: ColumnProps[];
|
|
9
7
|
}
|
|
10
8
|
declare const TableHeaderRow: import("svelte").Component<TableHeaderRowProps, {}, "">;
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
type FoundationPageText = Parameters<typeof TableFoundation.formatPaginationInfo>[2];
|
|
10
10
|
|
|
11
|
-
/** Pagination info and Pagination, or the `paginationContent` snippet */
|
|
12
11
|
interface TablePaginationPartProps {
|
|
13
|
-
/** The pagination state with the page change handler */
|
|
14
12
|
pagination: TablePaginationProps;
|
|
15
13
|
formatPageText?: FormatPageText;
|
|
16
14
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { FormatPageText, TablePaginationProps } from './interface.js';
|
|
2
|
-
/** Pagination info and Pagination, or the `paginationContent` snippet */
|
|
3
2
|
interface TablePaginationPartProps {
|
|
4
|
-
/** The pagination state with the page change handler */
|
|
5
3
|
pagination: TablePaginationProps;
|
|
6
4
|
formatPageText?: FormatPageText;
|
|
7
5
|
}
|
package/dist/table/table.svelte
CHANGED
|
@@ -121,8 +121,6 @@
|
|
|
121
121
|
* Only these outlive a change of the columns prop; a column never dragged follows the prop.
|
|
122
122
|
*/
|
|
123
123
|
const overrides = new SvelteMap<string | number, Partial<ColumnProps>>();
|
|
124
|
-
|
|
125
|
-
// the columns being dragged get the handler class, which is not kept once the drag ends
|
|
126
124
|
const resizing = new SvelteSet<string | number>();
|
|
127
125
|
|
|
128
126
|
/*
|
|
@@ -263,7 +261,6 @@
|
|
|
263
261
|
},
|
|
264
262
|
};
|
|
265
263
|
|
|
266
|
-
// the Svelte columns carry snippets and wider callbacks than the foundation's column type declares
|
|
267
264
|
const toFoundationColumns = (list: ColumnProps[]) => {
|
|
268
265
|
return list as BaseColumnProps<AnyRecord>[];
|
|
269
266
|
};
|
|
@@ -326,7 +323,6 @@
|
|
|
326
323
|
},
|
|
327
324
|
notifyExpand: (expanded, record, mouseEvent) => onExpand?.(expanded, record, mouseEvent),
|
|
328
325
|
notifyExpandedRowsChange: (expandedRows, nextKeys) => {
|
|
329
|
-
// bound, the write reaches the parent; unbound, it overrides locally
|
|
330
326
|
expandedRowKeys = nextKeys;
|
|
331
327
|
onExpandedRowsChange?.(expandedRows);
|
|
332
328
|
},
|
|
@@ -645,7 +641,6 @@
|
|
|
645
641
|
root?.style.setProperty('--semi-table-section-width', `${amendTableWidth(root.getBoundingClientRect().width)}px`);
|
|
646
642
|
};
|
|
647
643
|
|
|
648
|
-
/** The data of the current page, deep cloned */
|
|
649
644
|
const readCurrentPageData = () => {
|
|
650
645
|
const current = foundation.getCurrentPageData();
|
|
651
646
|
const result: ReturnType<TableHandle['getCurrentPageData']> = {};
|
package/dist/table/utils.d.ts
CHANGED
|
@@ -3,38 +3,26 @@ import type { ColumnProps, SortOrder, TableComponents, TablePaginationProps, Tab
|
|
|
3
3
|
export interface ColumnFlags {
|
|
4
4
|
hasSorter: boolean;
|
|
5
5
|
hasFilter: boolean;
|
|
6
|
-
/** The header cell composes the title with the sort and filter buttons instead of the plain title */
|
|
7
6
|
needsTitle: boolean;
|
|
8
|
-
/** A click on the header cell sorts */
|
|
9
7
|
clickToSort: boolean;
|
|
10
8
|
showSortTip: boolean;
|
|
11
9
|
sortOrder: SortOrder;
|
|
12
10
|
filteredValue?: unknown[];
|
|
13
|
-
/** The sort and filter state of the column, when it has a dataIndex */
|
|
14
11
|
query?: ColumnProps;
|
|
15
12
|
}
|
|
16
|
-
/** How the header cell of a column sorts and filters, decided as React Table does */
|
|
17
13
|
export declare function columnFlags(column: ColumnProps, queries?: ColumnProps[]): ColumnFlags;
|
|
18
14
|
export declare function mergeComponents(components: TableComponents | undefined, virtualized: boolean): MergedTableComponents;
|
|
19
|
-
/** The column of expand buttons, shown when hideExpandedColumn is false */
|
|
20
15
|
export declare function expandColumn(hideExpandedColumn: boolean, expandCellFixed: TableProps['expandCellFixed'], prefixCls: string): ColumnProps | null;
|
|
21
|
-
/** The column of selection checkboxes */
|
|
22
16
|
export declare function selectionColumn(rowSelection: TableProps['rowSelection'], prefixCls: string): ColumnProps | null;
|
|
23
|
-
/** Copies the column tree, so that keys and overrides can be written without touching the prop */
|
|
24
17
|
export declare const copyColumns: (list: ColumnProps[]) => ColumnProps[];
|
|
25
|
-
/**
|
|
26
|
-
* Places the expand and selection columns with a default width, so that a resizable table can resize them too. The
|
|
27
|
-
* placeholders are the table's own columns, so the drag class lands next to their class rather than replacing it.
|
|
28
|
-
*/
|
|
18
|
+
/** The placeholders are the table's own columns, so the drag class lands next to their class rather than replacing it */
|
|
29
19
|
export declare function addWidthPlaceholders(columns: ColumnProps[], expand: ColumnProps | null, selection: ColumnProps | null): ColumnProps<{
|
|
30
20
|
[x: string]: any;
|
|
31
21
|
}>[];
|
|
32
|
-
/** Copies the columns, so the keys and merged inner columns stay off the user's objects, and adds the inner columns */
|
|
33
22
|
export declare function buildColumns(columns: ColumnProps[], innerColumns: (ColumnProps | null)[]): ColumnProps[];
|
|
34
23
|
/**
|
|
35
24
|
* The user's onChange replaces the table's own paging, which resets the scroll itself; with scrollToFirstRowOnChange
|
|
36
25
|
* the replacement still resets it
|
|
37
26
|
*/
|
|
38
27
|
export declare function mergePagination(pagination: TablePaginationProps | undefined, scrollToFirstRowOnChange: boolean, setPage: (currentPage: number, pageSize: number) => void, resetScrollY: () => void, onPage: (currentPage: number) => void): TablePaginationProps | null;
|
|
39
|
-
/** Joins style declarations, skipping empty ones */
|
|
40
28
|
export declare const joinStyles: (...styles: (string | false | null | undefined)[]) => string | undefined;
|
package/dist/table/utils.js
CHANGED
|
@@ -11,7 +11,6 @@ const PLAIN_FLAGS = {
|
|
|
11
11
|
filteredValue: undefined,
|
|
12
12
|
query: undefined,
|
|
13
13
|
};
|
|
14
|
-
/** How the header cell of a column sorts and filters, decided as React Table does */
|
|
15
14
|
export function columnFlags(column, queries) {
|
|
16
15
|
// filterDropdown counts, unlike React where a lone element renders nothing: here the flag only opens a panel
|
|
17
16
|
if (!(column.sorter || column.filters || column.onFilter || column.useFullRender || column.filterDropdown)) {
|
|
@@ -31,7 +30,6 @@ export function columnFlags(column, queries) {
|
|
|
31
30
|
query: query.query,
|
|
32
31
|
};
|
|
33
32
|
}
|
|
34
|
-
// Not a deep merge: only the tags are replaced
|
|
35
33
|
export function mergeComponents(components, virtualized) {
|
|
36
34
|
const defaults = virtualized ? { outer: 'div', wrapper: 'div', row: 'div', cell: 'div', colgroup: { wrapper: 'div', col: 'div' } } : { outer: 'table', wrapper: 'tbody', row: 'tr', cell: 'td', colgroup: { wrapper: 'colgroup', col: 'col' } };
|
|
37
35
|
return {
|
|
@@ -39,11 +37,9 @@ export function mergeComponents(components, virtualized) {
|
|
|
39
37
|
body: { ...defaults, ...components?.body, colgroup: { ...defaults.colgroup, ...components?.body?.colgroup } },
|
|
40
38
|
};
|
|
41
39
|
}
|
|
42
|
-
/** The column of expand buttons, shown when hideExpandedColumn is false */
|
|
43
40
|
export function expandColumn(hideExpandedColumn, expandCellFixed, prefixCls) {
|
|
44
41
|
return hideExpandedColumn ? null : { fixed: expandCellFixed, key: strings.DEFAULT_KEY_COLUMN_EXPAND, class: `${prefixCls}-column-expand` };
|
|
45
42
|
}
|
|
46
|
-
/** The column of selection checkboxes */
|
|
47
43
|
export function selectionColumn(rowSelection, prefixCls) {
|
|
48
44
|
if (!rowSelection || (typeof rowSelection === 'object' && rowSelection.hidden)) {
|
|
49
45
|
return null;
|
|
@@ -58,17 +54,12 @@ export function selectionColumn(rowSelection, prefixCls) {
|
|
|
58
54
|
class: [options.class, `${prefixCls}-column-selection`].filter(Boolean).join(' '),
|
|
59
55
|
};
|
|
60
56
|
}
|
|
61
|
-
/** Copies the column tree, so that keys and overrides can be written without touching the prop */
|
|
62
57
|
export const copyColumns = (list) => list.map((column) => (Array.isArray(column.children) && column.children.length ? { ...column, children: copyColumns(column.children) } : { ...column }));
|
|
63
|
-
/**
|
|
64
|
-
* Places the expand and selection columns with a default width, so that a resizable table can resize them too. The
|
|
65
|
-
* placeholders are the table's own columns, so the drag class lands next to their class rather than replacing it.
|
|
66
|
-
*/
|
|
58
|
+
/** The placeholders are the table's own columns, so the drag class lands next to their class rather than replacing it */
|
|
67
59
|
export function addWidthPlaceholders(columns, expand, selection) {
|
|
68
60
|
const withWidth = (column, width) => column && { ...column, width: column.width ?? width };
|
|
69
61
|
return placeInnerColumns(columns, [withWidth(expand, numbers.DEFAULT_WIDTH_COLUMN_EXPAND), withWidth(selection, numbers.DEFAULT_WIDTH_COLUMN_SELECTION)]);
|
|
70
62
|
}
|
|
71
|
-
/** Copies the columns, so the keys and merged inner columns stay off the user's objects, and adds the inner columns */
|
|
72
63
|
export function buildColumns(columns, innerColumns) {
|
|
73
64
|
return assignColumnKeys(placeInnerColumns(copyColumns(columns), innerColumns));
|
|
74
65
|
}
|
|
@@ -93,5 +84,4 @@ export function mergePagination(pagination, scrollToFirstRowOnChange, setPage, r
|
|
|
93
84
|
},
|
|
94
85
|
};
|
|
95
86
|
}
|
|
96
|
-
/** Joins style declarations, skipping empty ones */
|
|
97
87
|
export const joinStyles = (...styles) => styles.filter(Boolean).join(';') || undefined;
|
package/dist/tabs/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import TabItemPart from './tab-item.svelte';
|
|
2
2
|
import TabsBase from './tabs.svelte';
|
|
3
|
-
// Svelte components are functions, so the part attaches to the component itself
|
|
4
3
|
export const Tabs = Object.assign(TabsBase, { TabItem: TabItemPart });
|
|
5
4
|
export { default as TabItem } from './tab-item.svelte';
|
package/dist/tabs/interface.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { DropdownProps } from '../dropdown/index.js';
|
|
|
4
4
|
export type TabType = 'line' | 'card' | 'button' | 'slash';
|
|
5
5
|
export type TabSize = 'small' | 'medium' | 'large';
|
|
6
6
|
export type TabPosition = 'top' | 'left';
|
|
7
|
-
/** A `tabList` entry holds data only; markup for its tab and icon goes to the Tabs `tab` and `icon` snippets */
|
|
8
7
|
export interface PlainTab {
|
|
9
8
|
itemKey: string;
|
|
10
9
|
tab?: string | number;
|
|
@@ -16,12 +15,10 @@ export interface TabsDropdownProps {
|
|
|
16
15
|
start?: TabsDropdownItemProps;
|
|
17
16
|
end?: TabsDropdownItemProps;
|
|
18
17
|
}
|
|
19
|
-
/** The menu content is the `moreContent` snippet and the trigger the `moreTrigger` snippet */
|
|
20
18
|
export interface TabsMore {
|
|
21
19
|
count: number;
|
|
22
20
|
dropdownProps?: TabsDropdownItemProps;
|
|
23
21
|
}
|
|
24
|
-
/** A tab of the collapsed bar as OverflowList keeps it */
|
|
25
22
|
export interface OverflowItem extends PlainTab {
|
|
26
23
|
/** `${itemKey}-bar` */
|
|
27
24
|
key: string;
|
|
@@ -34,7 +31,6 @@ export interface TabsTabSnippetProps {
|
|
|
34
31
|
export interface TabsPanelSnippetProps extends TabsTabSnippetProps {
|
|
35
32
|
itemKey: string;
|
|
36
33
|
}
|
|
37
|
-
/** The data of the default tab bar; its behavior reaches the TabItems inside the Tabs on its own */
|
|
38
34
|
export interface TabBarProps {
|
|
39
35
|
activeKey: string | null;
|
|
40
36
|
list: PlainTab[];
|
|
@@ -52,20 +48,15 @@ export interface TabBarProps {
|
|
|
52
48
|
}
|
|
53
49
|
export interface TabsTabBarSnippetProps {
|
|
54
50
|
tabBarProps: TabBarProps;
|
|
55
|
-
/** The default tab bar, ready for `{@render tabBar()}` */
|
|
56
51
|
tabBar: Snippet;
|
|
57
52
|
}
|
|
58
53
|
export interface TabsArrowSnippetProps {
|
|
59
|
-
/** The tabs scrolled out on this side */
|
|
60
54
|
items: OverflowItem[];
|
|
61
55
|
position: 'start' | 'end';
|
|
62
|
-
/** Scrolls the next hidden tab of this side into view */
|
|
63
56
|
onClick: () => void;
|
|
64
|
-
/** The default arrow, ready for `{@render defaultNode()}` */
|
|
65
57
|
defaultNode: Snippet;
|
|
66
58
|
}
|
|
67
59
|
export interface TabsMoreContentSnippetProps {
|
|
68
|
-
/** The tabs moved into the more menu */
|
|
69
60
|
items: PlainTab[];
|
|
70
61
|
}
|
|
71
62
|
export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onchange'> {
|
|
@@ -101,13 +92,9 @@ export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'childre
|
|
|
101
92
|
/** The icon of each `tabList` entry; the icon container renders even when the snippet outputs nothing */
|
|
102
93
|
icon?: Snippet<[TabsTabSnippetProps]>;
|
|
103
94
|
tabBarExtraContent?: Snippet;
|
|
104
|
-
/** Replaces the tab bar */
|
|
105
95
|
tabBar?: Snippet<[TabsTabBarSnippetProps]>;
|
|
106
|
-
/** Replaces each arrow of the collapsed bar */
|
|
107
96
|
arrow?: Snippet<[TabsArrowSnippetProps]>;
|
|
108
|
-
/** Replaces the trigger of the more menu */
|
|
109
97
|
moreTrigger?: Snippet;
|
|
110
|
-
/** Replaces the content of the more menu */
|
|
111
98
|
moreContent?: Snippet<[TabsMoreContentSnippetProps]>;
|
|
112
99
|
}
|
|
113
100
|
/** Internal: Tabs renders one pane per `panel` entry; the pane reads everything else from the Tabs context */
|
package/dist/tabs/tab-bar.svelte
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
import TabItem from './tab-item.svelte';
|
|
15
15
|
|
|
16
16
|
interface Props extends TabBarProps {
|
|
17
|
-
/** The Tabs' aria-label and aria-labelledby, which name the tablist */
|
|
18
17
|
tablistAttrs: Record<string, unknown>;
|
|
19
18
|
tab?: Snippet<[TabsTabSnippetProps]>;
|
|
20
19
|
icon?: Snippet<[TabsTabSnippetProps]>;
|
|
@@ -111,7 +110,6 @@
|
|
|
111
110
|
onVisibleTabsChange?.(visibleState);
|
|
112
111
|
};
|
|
113
112
|
|
|
114
|
-
// the remembered width no longer applies once tabs are added, removed or retitled
|
|
115
113
|
watch(
|
|
116
114
|
() => labelsSignature,
|
|
117
115
|
() => {
|
|
@@ -134,7 +132,6 @@
|
|
|
134
132
|
untrack(checkOverflow);
|
|
135
133
|
});
|
|
136
134
|
|
|
137
|
-
// fallback for when ResizeObserver does not report after mount
|
|
138
135
|
onMount(() => {
|
|
139
136
|
const frame = requestAnimationFrame(checkOverflow);
|
|
140
137
|
return () => cancelAnimationFrame(frame);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
2
|
import type { TabBarProps, TabsArrowSnippetProps, TabsMoreContentSnippetProps, TabsTabSnippetProps } from './interface.js';
|
|
3
3
|
interface Props extends TabBarProps {
|
|
4
|
-
/** The Tabs' aria-label and aria-labelledby, which name the tablist */
|
|
5
4
|
tablistAttrs: Record<string, unknown>;
|
|
6
5
|
tab?: Snippet<[TabsTabSnippetProps]>;
|
|
7
6
|
icon?: Snippet<[TabsTabSnippetProps]>;
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
const shouldRender = $derived(!view.lazyRender || active || activated);
|
|
18
18
|
const paneMotion = $derived(TabsFoundation.getPaneMotion({ ...view, itemKey }));
|
|
19
|
-
|
|
20
|
-
// split so the effect below runs only when one of the two values changes
|
|
21
19
|
const startClassName = $derived(paneMotion.startClassName);
|
|
22
20
|
const hasMotion = $derived(paneMotion.hasMotion);
|
|
23
21
|
|
package/dist/tabs/tabs.svelte
CHANGED
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
|
|
58
58
|
const config = getConfigContext();
|
|
59
59
|
|
|
60
|
-
// itemKeys repeat across Tabs on a page, so ids are scoped per instance
|
|
61
60
|
const uid = $props.id();
|
|
62
61
|
|
|
63
62
|
// The key this component last wrote to `activeKey` itself. A prop equal to it is the component's own state (what an
|
|
@@ -20,9 +20,7 @@ export interface TagInputProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
20
20
|
/** The input text, bindable; leave it out for an uncontrolled text. `bind:inputValue={get, set}` makes it fully controlled */
|
|
21
21
|
inputValue?: string;
|
|
22
22
|
disabled?: boolean;
|
|
23
|
-
/** Maximum length of one tag */
|
|
24
23
|
maxLength?: number;
|
|
25
|
-
/** Maximum number of tags */
|
|
26
24
|
max?: number;
|
|
27
25
|
maxTagCount?: number;
|
|
28
26
|
showRestTagsPopover?: boolean;
|
|
@@ -39,7 +37,6 @@ export interface TagInputProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
39
37
|
size?: TagInputSize;
|
|
40
38
|
split?: (originString: string, separators: string | string[] | null) => string[];
|
|
41
39
|
validateStatus?: TagInputValidateStatus;
|
|
42
|
-
/** Focuses the input on mount, with `preventScroll` */
|
|
43
40
|
autofocus?: boolean;
|
|
44
41
|
preventScroll?: boolean;
|
|
45
42
|
onChange?: (value: string[]) => void;
|
|
@@ -62,9 +59,7 @@ export interface TagInputProps extends Omit<HTMLAttributes<HTMLDivElement>, Nati
|
|
|
62
59
|
prefix?: Snippet;
|
|
63
60
|
suffix?: Snippet;
|
|
64
61
|
insetLabel?: Snippet;
|
|
65
|
-
/** Replaces the clear icon */
|
|
66
62
|
clearIcon?: Snippet;
|
|
67
|
-
/** Replaces each tag as a whole */
|
|
68
63
|
tag?: Snippet<[TagInputTagSnippetProps]>;
|
|
69
64
|
}
|
|
70
65
|
export {};
|
|
@@ -81,8 +81,6 @@
|
|
|
81
81
|
let clearButton = $state<HTMLButtonElement>();
|
|
82
82
|
let prefixKind = $state<SlotKind>();
|
|
83
83
|
let suffixKind = $state<SlotKind>();
|
|
84
|
-
|
|
85
|
-
// loaded on first use, so an app that never drags does not pay for dnd-kit
|
|
86
84
|
let Sortable = $state.raw<typeof SortableComponent>();
|
|
87
85
|
|
|
88
86
|
// not reactive: only the focus handlers read it, to ignore the blur dnd-kit causes when it moves the picked-up handle
|
|
@@ -283,7 +281,6 @@
|
|
|
283
281
|
}
|
|
284
282
|
);
|
|
285
283
|
|
|
286
|
-
// the placeholder shows only while there are no tags
|
|
287
284
|
watch(() => [inputText, tags.length === 0, placeholder, size], foundation.fitInputWidth);
|
|
288
285
|
|
|
289
286
|
// the sort ids are settled before the DOM patch, or one frame would show tags under the wrong ids
|
|
@@ -7,7 +7,6 @@ type $$ComponentProps = {
|
|
|
7
7
|
size: TagInputSize;
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
showContentTooltip: boolean | ShowTooltip;
|
|
10
|
-
/** the drag handles are on: the tag makes room for one */
|
|
11
10
|
draggableActive: boolean;
|
|
12
11
|
withHandle: boolean;
|
|
13
12
|
tag?: Snippet<[TagInputTagSnippetProps]>;
|
|
@@ -6,7 +6,6 @@ import type { DisabledTimeFns } from '@fibrae/semi-foundation/time-picker/founda
|
|
|
6
6
|
import type { InputProps, InputSize, ValidateStatus } from '../input/index.js';
|
|
7
7
|
import type { ScrollItemProps } from '../scroll-list/index.js';
|
|
8
8
|
import type { Position } from '../tooltip/index.js';
|
|
9
|
-
/** A time as `value` accepts it: a Date, a timestamp, a string in `format`, or an unpicked range side */
|
|
10
9
|
export type TimePickerBaseValueType = string | number | Date | undefined;
|
|
11
10
|
export type TimePickerType = 'time' | 'timeRange';
|
|
12
11
|
/** The column options a caller may set; the panel owns `list`, `selectedIndex` and the selection */
|
|
@@ -50,9 +49,7 @@ export interface TimePickerProps extends Omit<HTMLInputAttributes, NativeInputKe
|
|
|
50
49
|
inputReadOnly?: boolean;
|
|
51
50
|
validateStatus?: ValidateStatus;
|
|
52
51
|
insetLabelId?: string;
|
|
53
|
-
/** Style of the Input's root element */
|
|
54
52
|
inputStyle?: string;
|
|
55
|
-
/** Focuses the input on mount, which opens the panel */
|
|
56
53
|
autofocus?: boolean;
|
|
57
54
|
/** Focuses and selects the input once mounted */
|
|
58
55
|
focusOnOpen?: boolean;
|
|
@@ -83,14 +80,12 @@ export interface TimePickerProps extends Omit<HTMLInputAttributes, NativeInputKe
|
|
|
83
80
|
insetLabel?: Snippet;
|
|
84
81
|
clearIcon?: Snippet;
|
|
85
82
|
}
|
|
86
|
-
/** What `trigger` receives; `onChange` sets the input text, as typing would */
|
|
87
83
|
export interface TimePickerTriggerRenderProps {
|
|
88
84
|
/** The unpicked side of a range is undefined */
|
|
89
85
|
value: (Date | undefined)[];
|
|
90
86
|
inputValue: string;
|
|
91
87
|
placeholder: string;
|
|
92
88
|
disabled: boolean;
|
|
93
|
-
/** The declared props, without snippets and undeclared attributes */
|
|
94
89
|
componentProps: Omit<TimePickerProps, 'trigger' | 'panelHeader' | 'panelFooter' | 'panel' | 'prefix' | 'insetLabel' | 'clearIcon'>;
|
|
95
90
|
onChange: (inputValue: string) => void;
|
|
96
91
|
}
|
|
@@ -100,9 +95,7 @@ export interface TimePickerState {
|
|
|
100
95
|
inputValue: string;
|
|
101
96
|
invalid: boolean;
|
|
102
97
|
}
|
|
103
|
-
/** TimePicker's input; the other Input props reach the Input as they are */
|
|
104
98
|
export interface TimeInputProps extends Omit<InputProps, 'value' | 'onChange' | 'onFocus' | 'onBlur'> {
|
|
105
|
-
/** The input text */
|
|
106
99
|
value?: string;
|
|
107
100
|
inputReadOnly?: boolean;
|
|
108
101
|
invalid?: boolean;
|
|
@@ -111,14 +104,12 @@ export interface TimeInputProps extends Omit<InputProps, 'value' | 'onChange' |
|
|
|
111
104
|
onFocus?: (event: FocusEvent) => void;
|
|
112
105
|
onBlur?: (event: FocusEvent) => void;
|
|
113
106
|
}
|
|
114
|
-
/** One time panel, which DatePicker renders as well */
|
|
115
107
|
export interface ComboboxProps {
|
|
116
108
|
timeStampValue?: TimeStamp;
|
|
117
109
|
format?: string;
|
|
118
110
|
/** Prefix of the column class names (`${prefixCls}-list-hour` and so on); without it the columns get none */
|
|
119
111
|
prefixCls?: string;
|
|
120
112
|
use12Hours?: boolean;
|
|
121
|
-
/** The half day the AM/PM and hour columns show while there is no value */
|
|
122
113
|
defaultIsAM?: boolean;
|
|
123
114
|
hideDisabledOptions?: boolean;
|
|
124
115
|
hourStep?: number;
|
|
@@ -155,7 +155,6 @@
|
|
|
155
155
|
setPanelOpen: (next) => base.setState({ open: next }),
|
|
156
156
|
setInputValue: (inputValue) => base.setState({ inputValue }),
|
|
157
157
|
notifyOpenChange: (next) => {
|
|
158
|
-
// the bindable props are the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
159
158
|
open = next;
|
|
160
159
|
onOpenChange?.(next);
|
|
161
160
|
},
|
|
@@ -252,7 +251,6 @@
|
|
|
252
251
|
return a instanceof Date && b instanceof Date ? a.getTime() === b.getTime() : Object.is(a, b);
|
|
253
252
|
};
|
|
254
253
|
|
|
255
|
-
// Compared by time, so a new Date of the same time does not overwrite the text being typed
|
|
256
254
|
const sameValue = (a: Value, b: Value) => {
|
|
257
255
|
return Array.isArray(a) && Array.isArray(b) ? a.length === b.length && a.every((item, index) => sameTime(item, b[index])) : sameTime(a, b);
|
|
258
256
|
};
|
|
@@ -3,7 +3,6 @@ import type { HTMLAttributes, HTMLLiAttributes } from 'svelte/elements';
|
|
|
3
3
|
import type { TimelineItemPosition, TimelineMode } from '@fibrae/semi-foundation/timeline/utils';
|
|
4
4
|
export type { TimelineItemPosition, TimelineMode };
|
|
5
5
|
export type TimelineItemType = 'default' | 'ongoing' | 'success' | 'warning' | 'error';
|
|
6
|
-
/** An item of `dataSource`; nodes for its content, time and extra come from the Timeline snippets. Other attributes land on the li. */
|
|
7
6
|
export interface TimelineData extends Omit<HTMLLiAttributes, 'color' | 'content' | 'onclick'> {
|
|
8
7
|
content?: string | number;
|
|
9
8
|
time?: string | number;
|
|
@@ -22,10 +21,7 @@ export interface TimelineSnippetProps {
|
|
|
22
21
|
export interface TimelineProps extends HTMLAttributes<HTMLUListElement> {
|
|
23
22
|
mode?: TimelineMode;
|
|
24
23
|
dataSource?: TimelineData[];
|
|
25
|
-
/** Content of each item; defaults to `item.content` */
|
|
26
24
|
content?: Snippet<[TimelineSnippetProps]>;
|
|
27
|
-
/** Time of each item; defaults to `item.time` */
|
|
28
25
|
time?: Snippet<[TimelineSnippetProps]>;
|
|
29
|
-
/** Extra of each item; defaults to `item.extra` */
|
|
30
26
|
extra?: Snippet<[TimelineSnippetProps]>;
|
|
31
27
|
}
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
onClick(event);
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
// only a clickable item is a keyboard target; extra and time stay outside
|
|
27
26
|
const handleKeydown = (event: KeyboardEvent & { currentTarget: HTMLElement }) => {
|
|
28
27
|
if (event.target !== event.currentTarget || (event.key !== 'Enter' && event.key !== ' ')) return;
|
|
29
28
|
event.preventDefault();
|
package/dist/toast/context.d.ts
CHANGED
|
@@ -2,9 +2,7 @@ import type { ToastInstance } from '@fibrae/semi-foundation/toast/toast-foundati
|
|
|
2
2
|
export interface ToastListContext {
|
|
3
3
|
/** The pointer or focus is inside the list: every toast's countdown waits */
|
|
4
4
|
readonly paused: boolean;
|
|
5
|
-
/** The toasts the latest store change updated in place */
|
|
6
5
|
readonly updatedItems: readonly ToastInstance[];
|
|
7
|
-
/** The toasts the store removed that are still leaving */
|
|
8
6
|
readonly removedItems: readonly ToastInstance[];
|
|
9
7
|
/** Queues text for the list's live region; `read` runs when it is written */
|
|
10
8
|
announce: (key: string, read: () => string) => void;
|
|
@@ -13,7 +13,6 @@ export interface ToastProps extends Omit<FoundationToastProps, 'content' | 'icon
|
|
|
13
13
|
icon?: ToastNode;
|
|
14
14
|
motion?: boolean;
|
|
15
15
|
}
|
|
16
|
-
/** Options of one toast opened through the static methods */
|
|
17
16
|
export type ToastOptions = Omit<ToastProps, 'type'>;
|
|
18
17
|
/** Props of the single toast the list renders; list-level options are stripped before they reach it */
|
|
19
18
|
export interface ToastItemProps extends Omit<ToastProps, 'content' | 'stack' | 'top' | 'bottom' | 'left' | 'right' | 'zIndex' | 'getPopupContainer'> {
|
|
@@ -27,7 +26,6 @@ export interface ToastItemProps extends Omit<ToastProps, 'content' | 'stack' | '
|
|
|
27
26
|
/** The store removed the toast: it plays its leave animation, then calls `onLeaveEnd` */
|
|
28
27
|
leaving?: boolean;
|
|
29
28
|
onLeaveEnd?: () => void;
|
|
30
|
-
/** Asks the list to remove the toast, with its id */
|
|
31
29
|
close?: (id: string) => void;
|
|
32
30
|
}
|
|
33
31
|
/** Positioning and layer options belong to the static wrapper; a hook mounts its own wrapper */
|
package/dist/toast/static-api.js
CHANGED
|
@@ -23,7 +23,6 @@ function createBaseToast(initialConfig) {
|
|
|
23
23
|
create(opts) {
|
|
24
24
|
assertClient('Toast', 'Toast.useToast');
|
|
25
25
|
const id = opts.id ?? createId('toast');
|
|
26
|
-
// an explicit undefined must not replace the defaults
|
|
27
26
|
const mergedOpts = { ...store.defaults, ...omitInstanceIds(semiGlobal.config.overrideDefaultProps?.Toast), ...omitBy(opts, (value) => value === undefined) };
|
|
28
27
|
if (!wrapper) {
|
|
29
28
|
wrapper = document.createElement('div');
|
package/dist/toast/toast.svelte
CHANGED
package/dist/toast/use-toast.js
CHANGED
|
@@ -42,7 +42,6 @@ export function createToastHookApi(store, beforeAdd) {
|
|
|
42
42
|
beforeAdd?.();
|
|
43
43
|
const id = createId('toast');
|
|
44
44
|
store.setStack(config.stack);
|
|
45
|
-
// the store holds the options as given (ToastProps), typed as the foundation's ToastInstance
|
|
46
45
|
store.add({ ...config, type, id });
|
|
47
46
|
return id;
|
|
48
47
|
};
|
|
@@ -4,7 +4,6 @@ export interface PopupRegistry {
|
|
|
4
4
|
relayFocus: (event: FocusEvent, from: Element | null) => void;
|
|
5
5
|
}
|
|
6
6
|
export declare const getTooltipPopupsContext: (caller?: string) => PopupRegistry | undefined, setTooltipPopupsContext: (value: PopupRegistry | undefined) => PopupRegistry | undefined;
|
|
7
|
-
/** What a trigger component (Button, Switch, Checkbox) tells the Tooltip around it about itself */
|
|
8
7
|
export interface TriggerState {
|
|
9
8
|
disabled: boolean;
|
|
10
9
|
loading: boolean;
|
|
@@ -12,7 +11,6 @@ export interface TriggerState {
|
|
|
12
11
|
/** The component puts the popup's description on its own control: the wrapper span would not reach it */
|
|
13
12
|
describes?: boolean;
|
|
14
13
|
}
|
|
15
|
-
/** What the Tooltip hands back to a registered trigger to apply to its own elements */
|
|
16
14
|
export interface TriggerBinding {
|
|
17
15
|
/** The Tooltip's span takes the pointer events: a loading Button ignores the pointer and a disabled one gets no click (F4) */
|
|
18
16
|
pointerEventsNone: boolean;
|
|
@@ -32,9 +32,7 @@ export interface TooltipProps extends TooltipBaseProps {
|
|
|
32
32
|
props: TooltipTriggerProps;
|
|
33
33
|
}]>;
|
|
34
34
|
content?: Snippet<[RenderContentProps]>;
|
|
35
|
-
/** Replaces the default arrow while showArrow is true */
|
|
36
35
|
arrow?: Snippet;
|
|
37
|
-
/** On the popup */
|
|
38
36
|
class?: string;
|
|
39
37
|
/** On the popup, before the positioning declarations; its `background-color` also colors the arrow */
|
|
40
38
|
style?: string;
|
|
@@ -89,8 +89,6 @@
|
|
|
89
89
|
const parentPopups = getTooltipPopupsContext();
|
|
90
90
|
|
|
91
91
|
const uid = $props.id();
|
|
92
|
-
|
|
93
|
-
// the trigger element: Tooltip's own span, or the element the `child` snippet spread the trigger props on
|
|
94
92
|
let triggerElement = $state.raw<HTMLElement | null>(null);
|
|
95
93
|
let container = $state.raw<HTMLDivElement | null>(null);
|
|
96
94
|
|
|
@@ -114,8 +112,6 @@
|
|
|
114
112
|
// showing again in one task (focus moving between trigger and popup with a zero delay) stays synchronous
|
|
115
113
|
let selfWritten = false;
|
|
116
114
|
const descendants = new SvelteSet<() => HTMLElement | null>();
|
|
117
|
-
|
|
118
|
-
// trigger components (Button, Switch, Checkbox) by their root element, filled in as they mount
|
|
119
115
|
const triggers = new SvelteMap<Element, () => TriggerState>();
|
|
120
116
|
|
|
121
117
|
const attachmentKey = createAttachmentKey();
|
|
@@ -470,7 +466,6 @@
|
|
|
470
466
|
}
|
|
471
467
|
return untrack(() => {
|
|
472
468
|
if (current === 'enter') {
|
|
473
|
-
// reopened during its exit animation, it is still shown
|
|
474
469
|
if (!element.matches(':popover-open')) {
|
|
475
470
|
element.showPopover();
|
|
476
471
|
}
|