@fibrae/semi-ui-svelte 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_base/create-context.js +0 -1
- package/dist/_base/css-animation.js +0 -1
- package/dist/_base/group-role.d.ts +0 -1
- package/dist/_base/group-role.js +0 -1
- package/dist/_base/slot-kind.d.ts +0 -1
- package/dist/_base/slot-kind.js +0 -1
- package/dist/_base/teleport.d.ts +0 -2
- package/dist/_base/teleport.js +0 -2
- package/dist/_base/use-click-outside.svelte.d.ts +2 -2
- package/dist/_base/use-click-outside.svelte.js +2 -2
- package/dist/_base/use-foundation.svelte.js +2 -5
- package/dist/_base/virtual-list.svelte +2 -3
- package/dist/_base/virtual-list.svelte.d.ts +0 -1
- package/dist/_sortable/interface.d.ts +0 -1
- package/dist/anchor/interface.d.ts +0 -3
- package/dist/anchor/link-item.svelte +0 -1
- package/dist/anchor/links.d.ts +0 -1
- package/dist/anchor/links.js +0 -1
- package/dist/audio-player/audio-player.svelte +0 -2
- package/dist/audio-player/audio-slider.svelte +0 -3
- package/dist/auto-complete/auto-complete.svelte +0 -5
- package/dist/auto-complete/interface.d.ts +0 -9
- package/dist/avatar/avatar-group-more.svelte +0 -1
- package/dist/avatar/avatar.svelte +0 -4
- package/dist/avatar/context.d.ts +0 -1
- package/dist/avatar/interface.d.ts +0 -4
- package/dist/backtop/backtop.svelte +0 -2
- package/dist/backtop/interface.d.ts +0 -1
- package/dist/badge/interface.d.ts +0 -1
- package/dist/banner/banner.svelte +1 -1
- package/dist/banner/interface.d.ts +1 -3
- package/dist/breadcrumb/breadcrumb-item.svelte +0 -1
- package/dist/breadcrumb/breadcrumb.svelte +0 -1
- package/dist/breadcrumb/interface.d.ts +0 -7
- package/dist/calendar/calendar.svelte +0 -1
- package/dist/calendar/day-calendar.svelte +0 -3
- package/dist/calendar/interface.d.ts +0 -8
- package/dist/calendar/month-calendar.svelte +0 -4
- package/dist/calendar/time-grid.svelte +0 -2
- package/dist/calendar/time-grid.svelte.d.ts +0 -1
- package/dist/calendar/use-today.svelte.d.ts +0 -1
- package/dist/calendar/use-today.svelte.js +0 -1
- package/dist/card/index.js +0 -1
- package/dist/card/interface.d.ts +0 -3
- package/dist/carousel/carousel.svelte +0 -4
- package/dist/carousel/interface.d.ts +0 -3
- package/dist/cascader/cascader.svelte +0 -6
- package/dist/cascader/interface.d.ts +0 -19
- package/dist/cascader/item.svelte +0 -4
- package/dist/cascader/item.svelte.d.ts +0 -4
- package/dist/checkbox/checkbox-group.svelte +0 -3
- package/dist/checkbox/checkbox.svelte +0 -4
- package/dist/checkbox/index.js +0 -1
- package/dist/checkbox/interface.d.ts +0 -1
- package/dist/code-highlight/interface.d.ts +0 -1
- package/dist/collapse/collapse.svelte +0 -2
- package/dist/collapse/index.js +0 -1
- package/dist/collapse/interface.d.ts +0 -2
- package/dist/collapse/panel.svelte +0 -1
- package/dist/collapsible/collapsible.svelte +0 -2
- package/dist/color-picker/alpha-slider.svelte +0 -1
- package/dist/color-picker/color-choose-area.svelte +0 -1
- package/dist/color-picker/color-slider.svelte +0 -1
- package/dist/color-picker/data-part.svelte +0 -1
- package/dist/cropper/cropper.svelte +0 -1
- package/dist/cropper/interface.d.ts +0 -6
- package/dist/date-picker/date-input.svelte +0 -4
- package/dist/date-picker/date-picker.svelte +0 -7
- package/dist/date-picker/inset-input.svelte +0 -1
- package/dist/date-picker/interface.d.ts +0 -7
- package/dist/date-picker/internal.d.ts +0 -7
- package/dist/date-picker/month.svelte +0 -1
- package/dist/date-picker/months-grid.svelte +0 -6
- package/dist/date-picker/navigation.svelte +0 -1
- package/dist/descriptions/interface.d.ts +0 -1
- package/dist/divider/divider.svelte +0 -1
- package/dist/divider/interface.d.ts +0 -4
- package/dist/drag-move/drag-move.js +0 -1
- package/dist/drag-move/interface.d.ts +0 -3
- package/dist/dropdown/context.d.ts +0 -6
- package/dist/dropdown/context.js +0 -1
- package/dist/dropdown/dropdown-item.svelte +0 -1
- package/dist/dropdown/dropdown.svelte +0 -7
- package/dist/dropdown/interface.d.ts +0 -4
- package/dist/empty/empty.svelte +0 -1
- package/dist/empty/interface.d.ts +0 -3
- package/dist/feedback/feedback.svelte +0 -1
- package/dist/feedback/interface.d.ts +0 -8
- package/dist/float-button/float-button-action.svelte +0 -2
- package/dist/float-button/interface.d.ts +0 -2
- package/dist/form/array-field.svelte +0 -2
- package/dist/form/context.d.ts +0 -2
- package/dist/form/error-message.svelte +0 -1
- package/dist/form/field-grid.svelte +0 -2
- package/dist/form/field-grid.svelte.d.ts +0 -2
- package/dist/form/field-inner.svelte +0 -2
- package/dist/form/field.svelte +0 -1
- package/dist/form/form.svelte +0 -1
- package/dist/form/hooks.d.ts +1 -2
- package/dist/form/hooks.js +1 -2
- package/dist/form/interface.d.ts +0 -7
- package/dist/form/utils.d.ts +0 -1
- package/dist/form/utils.js +0 -2
- package/dist/highlight/interface.d.ts +0 -1
- package/dist/hot-keys/interface.d.ts +0 -1
- package/dist/image/context.d.ts +0 -1
- package/dist/image/footer.d.ts +0 -1
- package/dist/image/interface.d.ts +0 -8
- package/dist/image/preview-image.svelte +0 -3
- package/dist/image/preview-image.svelte.d.ts +0 -1
- package/dist/image/preview-inner.svelte +0 -3
- package/dist/image/preview-inner.svelte.d.ts +0 -1
- package/dist/input/context.d.ts +0 -1
- package/dist/input/interface.d.ts +0 -3
- package/dist/input/textarea.svelte +0 -3
- package/dist/input-number/input-number.svelte +0 -2
- package/dist/input-number/interface.d.ts +0 -1
- package/dist/json-viewer/interface.d.ts +0 -4
- package/dist/json-viewer/json-viewer.svelte +0 -3
- package/dist/layout/interface.d.ts +0 -2
- package/dist/list/interface.d.ts +0 -2
- package/dist/lottie/interface.d.ts +1 -1
- package/dist/markdown-render/code-text.js +0 -1
- package/dist/markdown-render/components/code.svelte +0 -1
- package/dist/markdown-render/components/heading.svelte +0 -1
- package/dist/markdown-render/components/p.svelte +0 -1
- package/dist/markdown-render/components/table.svelte +0 -1
- package/dist/markdown-render/components/tree.d.ts +0 -4
- package/dist/markdown-render/components/tree.js +0 -2
- package/dist/markdown-render/interface.d.ts +0 -1
- package/dist/markdown-render/markdown-children.svelte +0 -2
- package/dist/markdown-render/markdown-render.svelte +0 -1
- package/dist/markdown-render/runtime.js +0 -1
- package/dist/modal/confirm-modal.svelte +0 -1
- package/dist/modal/confirm.svelte.d.ts +0 -1
- package/dist/modal/confirm.svelte.js +0 -1
- package/dist/modal/index.js +0 -1
- package/dist/modal/interface.d.ts +0 -6
- package/dist/modal/modal-content.svelte +0 -4
- package/dist/modal/modal.svelte +0 -1
- package/dist/modal/use-show-hide.svelte.d.ts +0 -2
- package/dist/modal/use-show-hide.svelte.js +0 -4
- package/dist/navigation/context.d.ts +0 -2
- package/dist/navigation/index.js +0 -1
- package/dist/navigation/interface.d.ts +1 -17
- package/dist/navigation/item-shell.svelte +0 -4
- package/dist/navigation/item-shell.svelte.d.ts +0 -3
- package/dist/navigation/nav-footer.svelte +0 -2
- package/dist/navigation/nav-items.svelte +0 -1
- package/dist/navigation/nav.svelte +0 -1
- package/dist/navigation/sub-nav.svelte +0 -5
- package/dist/navigation/wrapper-outlet.svelte +0 -1
- package/dist/notification/context.d.ts +0 -3
- package/dist/notification/interface.d.ts +0 -5
- package/dist/notification/notice-list.svelte +0 -2
- package/dist/notification/notice-list.svelte.d.ts +0 -1
- package/dist/notification/notice.svelte +0 -2
- package/dist/notification/notification-list.svelte +0 -1
- package/dist/notification/static-api.js +0 -1
- package/dist/overflow-list/interface.d.ts +0 -2
- package/dist/overflow-list/overflow-list.svelte +0 -2
- package/dist/pagination/interface.d.ts +0 -1
- package/dist/pagination/pagination.svelte +0 -2
- package/dist/pagination/step-button.svelte +0 -3
- package/dist/pagination/step-button.svelte.d.ts +0 -1
- package/dist/pincode/interface.d.ts +0 -1
- package/dist/pincode/pincode.svelte +0 -3
- package/dist/popconfirm/interface.d.ts +0 -1
- package/dist/popconfirm/popconfirm.svelte +0 -2
- package/dist/popover/interface.d.ts +0 -1
- package/dist/popover/popover.svelte +0 -1
- package/dist/radio/index.js +0 -1
- package/dist/radio/radio-group.svelte +0 -1
- package/dist/radio/radio.svelte +0 -1
- package/dist/rating/interface.d.ts +0 -2
- package/dist/rating/item.svelte +0 -1
- package/dist/rating/rating.svelte +0 -7
- package/dist/resizable/interface.d.ts +0 -2
- package/dist/resizable/resizable.svelte +0 -1
- package/dist/resizable/resize-group.svelte +0 -1
- package/dist/resizable/resize-handler.svelte +0 -1
- package/dist/resize-observer/observe-resize.d.ts +1 -5
- package/dist/resize-observer/observe-resize.js +1 -5
- package/dist/scroll-list/index.js +0 -1
- package/dist/scroll-list/interface.d.ts +0 -2
- package/dist/scroll-list/scroll-item.svelte +0 -2
- package/dist/select/interface.d.ts +0 -14
- package/dist/select/option.svelte +0 -5
- package/dist/select/option.svelte.d.ts +0 -5
- package/dist/select/select.svelte +0 -14
- package/dist/side-sheet/interface.d.ts +0 -1
- package/dist/side-sheet/side-sheet.svelte +0 -9
- package/dist/skeleton/index.js +0 -1
- package/dist/skeleton/interface.d.ts +0 -2
- package/dist/skeleton/skeleton-item.svelte +0 -1
- package/dist/slider/interface.d.ts +0 -5
- package/dist/slider/slider.svelte +0 -7
- package/dist/space/interface.d.ts +0 -1
- package/dist/space/space.svelte +0 -1
- package/dist/steps/context.d.ts +0 -1
- package/dist/steps/interface.d.ts +0 -2
- package/dist/steps/step.svelte +0 -3
- package/dist/switch/switch.svelte +0 -2
- package/dist/table/body/base-row.svelte +0 -4
- package/dist/table/body/base-row.svelte.d.ts +0 -4
- package/dist/table/body/body.svelte +0 -7
- package/dist/table/body/body.svelte.d.ts +0 -5
- package/dist/table/body/expanded-row.svelte +0 -1
- package/dist/table/body/expanded-row.svelte.d.ts +0 -1
- package/dist/table/body/section-row.svelte +0 -2
- package/dist/table/body/section-row.svelte.d.ts +0 -2
- package/dist/table/column-filter-menu.svelte +0 -3
- package/dist/table/column-filter-menu.svelte.d.ts +0 -3
- package/dist/table/column-filter.svelte +0 -2
- package/dist/table/column-filter.svelte.d.ts +0 -2
- package/dist/table/column-selection.svelte +1 -2
- package/dist/table/column-selection.svelte.d.ts +0 -1
- package/dist/table/column-sorter.svelte +1 -6
- package/dist/table/column-sorter.svelte.d.ts +1 -6
- package/dist/table/context.d.ts +0 -10
- package/dist/table/context.js +0 -1
- package/dist/table/custom-expand-icon.svelte +0 -2
- package/dist/table/custom-expand-icon.svelte.d.ts +0 -2
- package/dist/table/head-table.svelte +0 -1
- package/dist/table/head-table.svelte.d.ts +0 -1
- package/dist/table/interface.d.ts +2 -21
- package/dist/table/table-cell.svelte +0 -7
- package/dist/table/table-cell.svelte.d.ts +0 -7
- package/dist/table/table-header-row.svelte +0 -2
- package/dist/table/table-header-row.svelte.d.ts +0 -2
- package/dist/table/table-pagination.svelte +0 -2
- package/dist/table/table-pagination.svelte.d.ts +0 -2
- package/dist/table/table.svelte +0 -5
- package/dist/table/utils.d.ts +1 -13
- package/dist/table/utils.js +1 -11
- package/dist/tabs/index.js +0 -1
- package/dist/tabs/interface.d.ts +0 -13
- package/dist/tabs/tab-bar.svelte +0 -3
- package/dist/tabs/tab-bar.svelte.d.ts +0 -1
- package/dist/tabs/tab-pane.svelte +0 -2
- package/dist/tabs/tabs.svelte +0 -1
- package/dist/tag-input/interface.d.ts +0 -5
- package/dist/tag-input/tag-input.svelte +0 -3
- package/dist/tag-input/tag-item.svelte +0 -1
- package/dist/tag-input/tag-item.svelte.d.ts +0 -1
- package/dist/time-picker/combobox.svelte +0 -1
- package/dist/time-picker/interface.d.ts +0 -9
- package/dist/time-picker/time-picker.svelte +0 -2
- package/dist/timeline/interface.d.ts +0 -4
- package/dist/timeline/timeline.svelte +0 -1
- package/dist/toast/context.d.ts +0 -2
- package/dist/toast/interface.d.ts +0 -2
- package/dist/toast/static-api.js +0 -1
- package/dist/toast/toast.svelte +0 -1
- package/dist/toast/use-toast.js +0 -1
- package/dist/tooltip/context.d.ts +0 -2
- package/dist/tooltip/interface.d.ts +0 -2
- package/dist/tooltip/tooltip.svelte +0 -5
- package/dist/transfer/interface.d.ts +1 -8
- package/dist/transfer/transfer-selected-item.svelte +0 -1
- package/dist/transfer/transfer-selected-item.svelte.d.ts +0 -1
- package/dist/transfer/transfer.svelte +0 -1
- package/dist/tree/auto-sizer.svelte +0 -1
- package/dist/tree/context.d.ts +0 -1
- package/dist/tree/interface.d.ts +0 -9
- package/dist/tree/node-collapsible.svelte +0 -1
- package/dist/tree/node-list.svelte +0 -4
- package/dist/tree/tree-node.svelte +0 -1
- package/dist/tree/tree.svelte +0 -3
- package/dist/tree/use-tree-keyboard.svelte.d.ts +1 -8
- package/dist/tree/use-tree-keyboard.svelte.js +1 -6
- package/dist/tree-select/interface.d.ts +0 -11
- package/dist/tree-select/tree-select.svelte +0 -2
- package/dist/typography/base.svelte +0 -2
- package/dist/typography/index.js +0 -1
- package/dist/typography/interface.d.ts +0 -1
- package/dist/typography/internal.d.ts +0 -2
- package/dist/upload/file-card.svelte +0 -1
- package/dist/upload/index.js +0 -1
- package/dist/upload/interface.d.ts +0 -4
- package/dist/upload/upload.svelte +0 -1
- package/dist/user-guide/interface.d.ts +0 -1
- package/dist/user-guide/user-guide.svelte +0 -1
- package/dist/video-player/video-progress.svelte +0 -2
- package/package.json +3 -3
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { ColumnProps } from './interface.js';
|
|
2
|
-
/** What every level of one column's filter menu shares */
|
|
3
2
|
export interface FilterMenuState {
|
|
4
3
|
column: ColumnProps;
|
|
5
4
|
filterMultiple: boolean;
|
|
6
5
|
confirmMode: boolean;
|
|
7
6
|
filteredValue: any[];
|
|
8
|
-
/** The value picked and not applied yet, in confirm mode */
|
|
9
7
|
tempFilteredValue?: any[];
|
|
10
8
|
filterDropdownProps: ColumnProps['filterDropdownProps'];
|
|
11
9
|
setTemp: (value: any[]) => void;
|
|
@@ -16,7 +14,6 @@ export interface FilterMenuState {
|
|
|
16
14
|
import type { TableFilter } from './interface.js';
|
|
17
15
|
interface ColumnFilterMenuProps {
|
|
18
16
|
filters: TableFilter[];
|
|
19
|
-
/** The depth of the menu, 0 for the top menu */
|
|
20
17
|
level: number;
|
|
21
18
|
state: FilterMenuState;
|
|
22
19
|
}
|
|
@@ -8,12 +8,10 @@
|
|
|
8
8
|
import { getTableContext } from './context.js';
|
|
9
9
|
import type { ColumnProps } from './interface.js';
|
|
10
10
|
|
|
11
|
-
/** The filter button of a column header and its Dropdown: the filter menu or the `filterDropdown` panel */
|
|
12
11
|
interface ColumnFilterProps {
|
|
13
12
|
column: ColumnProps;
|
|
14
13
|
/** The filter options: the column's query, or the column itself when it has no dataIndex */
|
|
15
14
|
query: ColumnProps;
|
|
16
|
-
/** The applied value */
|
|
17
15
|
filteredValue?: any[];
|
|
18
16
|
}
|
|
19
17
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { ColumnProps } from './interface.js';
|
|
2
|
-
/** The filter button of a column header and its Dropdown: the filter menu or the `filterDropdown` panel */
|
|
3
2
|
interface ColumnFilterProps {
|
|
4
3
|
column: ColumnProps;
|
|
5
4
|
/** The filter options: the column's query, or the column itself when it has no dataIndex */
|
|
6
5
|
query: ColumnProps;
|
|
7
|
-
/** The applied value */
|
|
8
6
|
filteredValue?: any[];
|
|
9
7
|
}
|
|
10
8
|
declare const ColumnFilter: import("svelte").Component<ColumnFilterProps, {}, "">;
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
type AnyRecord = Record<string, any>;
|
|
10
10
|
|
|
11
|
-
/** The checkbox of a selection cell: select all in the header, select the row in the body */
|
|
12
11
|
interface ColumnSelectionProps {
|
|
13
12
|
record?: AnyRecord;
|
|
14
13
|
index?: number;
|
|
@@ -45,7 +44,7 @@
|
|
|
45
44
|
<!-- The checkbox is fully controlled: the table state decides, so a rejected change shows the old value -->
|
|
46
45
|
{#snippet originNode()}
|
|
47
46
|
<span class={[`${table.prefixCls}-selection-wrap`, { [`${table.prefixCls}-selection-disabled`]: disabled }]}>
|
|
48
|
-
<Checkbox aria-label={inHeader ? locale().locale.selectAllRows : locale().locale.selectRow} {disabled} {...checkboxProps} bind:checked={() => selected, () => {}} {indeterminate} onChange={handleChange} />
|
|
47
|
+
<Checkbox aria-label={inHeader ? locale().locale.selectAllRows : locale().locale.selectRow} {disabled} {...checkboxProps} bind:checked={() => selected, () => {}} {indeterminate} onChange={handleChange} onkeyup={table.foundation.handleSelectionKeyUp} />
|
|
49
48
|
</span>
|
|
50
49
|
{/snippet}
|
|
51
50
|
|
|
@@ -9,17 +9,12 @@
|
|
|
9
9
|
import { getTableContext } from './context.js';
|
|
10
10
|
import type { ColumnProps, SortOrder } from './interface.js';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* The sort button of a column header: named by the column title, with the sort state as aria-sort on the header cell.
|
|
14
|
-
* When the whole header cell sorts, the click handler sits on the cell and the button's click reaches it by bubbling.
|
|
15
|
-
*/
|
|
12
|
+
/** When the whole header cell sorts, the click handler sits on the cell and the button's click reaches it by bubbling */
|
|
16
13
|
interface ColumnSorterProps {
|
|
17
14
|
column: ColumnProps;
|
|
18
15
|
sortOrder: SortOrder;
|
|
19
16
|
showTooltip: boolean;
|
|
20
|
-
/** The button sorts on click itself, since the header cell does not */
|
|
21
17
|
sortsOnClick: boolean;
|
|
22
|
-
/** The title the button wraps */
|
|
23
18
|
children?: Snippet;
|
|
24
19
|
}
|
|
25
20
|
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { ColumnProps, SortOrder } from './interface.js';
|
|
3
|
-
/**
|
|
4
|
-
* The sort button of a column header: named by the column title, with the sort state as aria-sort on the header cell.
|
|
5
|
-
* When the whole header cell sorts, the click handler sits on the cell and the button's click reaches it by bubbling.
|
|
6
|
-
*/
|
|
3
|
+
/** When the whole header cell sorts, the click handler sits on the cell and the button's click reaches it by bubbling */
|
|
7
4
|
interface ColumnSorterProps {
|
|
8
5
|
column: ColumnProps;
|
|
9
6
|
sortOrder: SortOrder;
|
|
10
7
|
showTooltip: boolean;
|
|
11
|
-
/** The button sorts on click itself, since the header cell does not */
|
|
12
8
|
sortsOnClick: boolean;
|
|
13
|
-
/** The title the button wraps */
|
|
14
9
|
children?: Snippet;
|
|
15
10
|
}
|
|
16
11
|
declare const ColumnSorter: import("svelte").Component<ColumnSorterProps, {}, "">;
|
package/dist/table/context.d.ts
CHANGED
|
@@ -4,9 +4,7 @@ import type { BaseHeadWidth, BaseRowKeyType, TableBaseProps, TableBaseState, Tab
|
|
|
4
4
|
import type { ColumnProps, TableExpandIconSnippetProps, TableProps, TableRowKey, TableScroll, TableSize, TableSticky, TableVirtualizedProps } from './interface.js';
|
|
5
5
|
type AnyRecord = Record<string, any>;
|
|
6
6
|
export type TableState = TableBaseState<AnyRecord>;
|
|
7
|
-
/** The props the foundation reads: the Table props with the function props resolved */
|
|
8
7
|
export type TableFoundationProps = TableBaseProps<AnyRecord> & Omit<TableProps, keyof TableBaseProps<AnyRecord>>;
|
|
9
|
-
/** `components` merged over the default tags */
|
|
10
8
|
export interface MergedTableComponents {
|
|
11
9
|
header: {
|
|
12
10
|
outer: string;
|
|
@@ -29,13 +27,11 @@ export type TableParts = Readonly<Pick<TableProps, 'cell' | 'headerCell' | 'expa
|
|
|
29
27
|
expandIcon: Snippet<[TableExpandIconSnippetProps]> | undefined;
|
|
30
28
|
}>;
|
|
31
29
|
export type RowEventName = 'onRowMouseEnter' | 'onRowMouseLeave' | 'onRowDoubleClick' | 'onRowContextMenu';
|
|
32
|
-
/** What every part of the table renders from; the fields are getters, so readers stay reactive */
|
|
33
30
|
export interface TableContextValue {
|
|
34
31
|
readonly prefixCls: string;
|
|
35
32
|
readonly direction: 'ltr' | 'rtl';
|
|
36
33
|
readonly size: TableSize;
|
|
37
34
|
readonly anyColumnFixed: boolean;
|
|
38
|
-
/** The leaf columns, the selection and expand columns included */
|
|
39
35
|
readonly flattenedColumns: ColumnProps[];
|
|
40
36
|
readonly headWidths: BaseHeadWidth[][];
|
|
41
37
|
readonly headerStyle?: string;
|
|
@@ -47,7 +43,6 @@ export interface TableContextValue {
|
|
|
47
43
|
readonly components: MergedTableComponents;
|
|
48
44
|
readonly tableLayout: 'fixed' | 'auto';
|
|
49
45
|
readonly bodyHasScrollbar: boolean;
|
|
50
|
-
/** The sort and filter state of the columns */
|
|
51
46
|
readonly queries: ColumnProps[];
|
|
52
47
|
readonly scroll?: TableScroll;
|
|
53
48
|
readonly sticky?: TableSticky;
|
|
@@ -56,13 +51,11 @@ export interface TableContextValue {
|
|
|
56
51
|
readonly childrenRecordName: string;
|
|
57
52
|
readonly indentSize: number;
|
|
58
53
|
readonly hideExpandedColumn: boolean;
|
|
59
|
-
/** `false` hides the expand buttons */
|
|
60
54
|
readonly showExpandIcon: boolean;
|
|
61
55
|
readonly expandRowByClick: boolean;
|
|
62
56
|
readonly keepDOM: boolean;
|
|
63
57
|
readonly clickGroupedRowToExpand: boolean;
|
|
64
58
|
readonly hasExpandedRow: boolean;
|
|
65
|
-
/** Numeric-width headers get a resize handle */
|
|
66
59
|
readonly resizable: boolean;
|
|
67
60
|
readonly rowSelection?: TableBaseStateRowSelection<AnyRecord>;
|
|
68
61
|
readonly filteredDisabledRowKeysSet: Set<BaseRowKeyType>;
|
|
@@ -71,7 +64,6 @@ export interface TableContextValue {
|
|
|
71
64
|
readonly filteredSortedRowKeysSet: Set<BaseRowKeyType>;
|
|
72
65
|
readonly expandedRowKeys: BaseRowKeyType[];
|
|
73
66
|
readonly rowKey: TableRowKey;
|
|
74
|
-
/** The Table's snippets and row callbacks, as getters */
|
|
75
67
|
readonly parts: TableParts;
|
|
76
68
|
foundation: TableFoundation<AnyRecord, TableFoundationProps>;
|
|
77
69
|
setHeadWidths: (widths: BaseHeadWidth[], index: number) => void;
|
|
@@ -79,12 +71,10 @@ export interface TableContextValue {
|
|
|
79
71
|
getCellWidths: (columns: ColumnProps[]) => number[];
|
|
80
72
|
setBodyHasScrollbar: (hasScrollbar: boolean) => void;
|
|
81
73
|
handleBodyScroll: (event: Event) => void;
|
|
82
|
-
/** Whether the row gets an expand button */
|
|
83
74
|
rowExpandable: (record: AnyRecord) => boolean;
|
|
84
75
|
emitRowEvent: (name: RowEventName, record: AnyRecord, event: MouseEvent) => void;
|
|
85
76
|
/** Drags a resizable column header to a new width; `phase` marks the start and the end of a drag */
|
|
86
77
|
resizeColumn: (column: ColumnProps, phase: 'start' | 'move' | 'stop', width?: number) => void;
|
|
87
78
|
}
|
|
88
|
-
/** The context the parts of a table read; they render only inside Table */
|
|
89
79
|
export declare const getTableContext: (caller?: string) => TableContextValue, setTableContext: (value: TableContextValue) => TableContextValue;
|
|
90
80
|
export {};
|
package/dist/table/context.js
CHANGED
|
@@ -7,10 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
type AnyRecord = Record<string, any>;
|
|
9
9
|
|
|
10
|
-
/** The expand button of a record row, a tree row or a group section */
|
|
11
10
|
interface CustomExpandIconProps {
|
|
12
11
|
record?: AnyRecord;
|
|
13
|
-
/** A tree row: the tree icon */
|
|
14
12
|
isNested?: boolean;
|
|
15
13
|
groupKey?: string | number;
|
|
16
14
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ColumnProps } from './interface.js';
|
|
2
2
|
interface HeadTableProps {
|
|
3
3
|
columns: ColumnProps[];
|
|
4
|
-
/** The scrolling header element, which the body's horizontal scroll moves */
|
|
5
4
|
element?: HTMLDivElement;
|
|
6
5
|
}
|
|
7
6
|
declare const HeadTable: import("svelte").Component<HeadTableProps, {}, "element">;
|
|
@@ -36,7 +36,6 @@ export type TableRowAttrs = HTMLAttributes<HTMLElement>;
|
|
|
36
36
|
/** `colspan` or `rowspan` 0 leaves the cell out, for the cell another cell spans over */
|
|
37
37
|
export type TableCellAttrs = Omit<HTMLTdAttributes, 'colspan' | 'rowspan'> & CellSpans;
|
|
38
38
|
export type TableHeaderCellAttrs = Omit<HTMLThAttributes, 'colspan' | 'rowspan'> & CellSpans;
|
|
39
|
-
/** A column holds data only: markup goes to the Table's `cell`, `headerCell`, `sortIcon` and other snippets */
|
|
40
39
|
export interface ColumnProps<R extends AnyRecord = AnyRecord> {
|
|
41
40
|
align?: ColumnAlign;
|
|
42
41
|
children?: ColumnProps<R>[];
|
|
@@ -48,7 +47,6 @@ export interface ColumnProps<R extends AnyRecord = AnyRecord> {
|
|
|
48
47
|
defaultSortOrder?: SortOrder;
|
|
49
48
|
ellipsis?: BaseEllipsis;
|
|
50
49
|
filterChildrenRecord?: boolean;
|
|
51
|
-
/** Shows the filter button for a panel given by the Table's `filterDropdown` snippet */
|
|
52
50
|
filterDropdown?: boolean;
|
|
53
51
|
/** Props of the filter Dropdown; the trigger is always a click */
|
|
54
52
|
filterDropdownProps?: Omit<DropdownProps, 'visible' | 'trigger' | 'children' | 'child' | 'content' | 'onVisibleChange'>;
|
|
@@ -91,7 +89,6 @@ export interface RowSelectionProps<R extends AnyRecord = AnyRecord> {
|
|
|
91
89
|
/** The initial selection of an uncontrolled table: `selectedRowKeys` lives in an object, which `bind:` cannot reach */
|
|
92
90
|
defaultSelectedRowKeys?: (string | number)[];
|
|
93
91
|
width?: number | string;
|
|
94
|
-
/** Clicking a row toggles its selection */
|
|
95
92
|
clickRow?: boolean;
|
|
96
93
|
checkRelation?: CheckRelation;
|
|
97
94
|
onChange?: RowSelectionOnChange<R>;
|
|
@@ -114,7 +111,6 @@ export interface ResizableProps<R extends AnyRecord = AnyRecord> {
|
|
|
114
111
|
onResize?: TableResizeFn<R>;
|
|
115
112
|
onResizeStart?: TableResizeFn<R>;
|
|
116
113
|
onResizeStop?: TableResizeFn<R>;
|
|
117
|
-
/** Added to the column's class while it is resized */
|
|
118
114
|
handlerClassName?: string;
|
|
119
115
|
}
|
|
120
116
|
/** The returned fields are merged into the column */
|
|
@@ -137,11 +133,9 @@ export type TableVirtualizedItemSize = number | TableVirtualizedItemSizeFn;
|
|
|
137
133
|
export interface TableVirtualizedProps {
|
|
138
134
|
/** Row height in pixels; 53, 45 or 37 by size when absent */
|
|
139
135
|
itemSize?: TableVirtualizedItemSize;
|
|
140
|
-
/** Rows rendered above and below the visible area */
|
|
141
136
|
overscanCount?: number;
|
|
142
137
|
}
|
|
143
138
|
export type TableVirtualized = boolean | TableVirtualizedProps;
|
|
144
|
-
/** A tag name; the element replaces the default tag of that part */
|
|
145
139
|
export type TableComponent = string;
|
|
146
140
|
export interface TableComponents {
|
|
147
141
|
header?: {
|
|
@@ -177,7 +171,6 @@ export interface TableCellSnippetProps<R extends AnyRecord = AnyRecord> {
|
|
|
177
171
|
record: R;
|
|
178
172
|
index: number;
|
|
179
173
|
column: ColumnProps<R>;
|
|
180
|
-
/** The row's expand button, on the first data cell of an expandable row */
|
|
181
174
|
expandIcon?: Snippet;
|
|
182
175
|
isHovering: boolean;
|
|
183
176
|
/** With `useFullRender` only */
|
|
@@ -194,7 +187,6 @@ export interface TableHeaderCellSnippetProps<R extends AnyRecord = AnyRecord> {
|
|
|
194
187
|
selection?: Snippet;
|
|
195
188
|
}
|
|
196
189
|
export interface TableTitleSnippetProps<R extends AnyRecord = AnyRecord> {
|
|
197
|
-
/** The records of the current page */
|
|
198
190
|
pageData: R[];
|
|
199
191
|
}
|
|
200
192
|
export interface TableExpandedRowSnippetProps<R extends AnyRecord = AnyRecord> {
|
|
@@ -211,7 +203,6 @@ export interface TableSortIconSnippetProps<R extends AnyRecord = AnyRecord> {
|
|
|
211
203
|
column: ColumnProps<R>;
|
|
212
204
|
}
|
|
213
205
|
export interface TableFilterIconSnippetProps<R extends AnyRecord = AnyRecord> {
|
|
214
|
-
/** The column has a filtered value applied */
|
|
215
206
|
filtered: boolean;
|
|
216
207
|
column: ColumnProps<R>;
|
|
217
208
|
}
|
|
@@ -231,7 +222,6 @@ export interface TableFilterDropdownSnippetProps<R extends AnyRecord = AnyRecord
|
|
|
231
222
|
closeDropdown?: boolean;
|
|
232
223
|
}) => void;
|
|
233
224
|
onClose: () => void;
|
|
234
|
-
/** Drops the temporary value, back to the applied one */
|
|
235
225
|
onReset: () => void;
|
|
236
226
|
}
|
|
237
227
|
export interface TableFilterDropdownItemSnippetProps<R extends AnyRecord = AnyRecord> {
|
|
@@ -242,9 +232,7 @@ export interface TableFilterDropdownItemSnippetProps<R extends AnyRecord = AnyRe
|
|
|
242
232
|
/** The value the menu shows: the temporary one in confirm mode */
|
|
243
233
|
filteredValue: any[];
|
|
244
234
|
filterMultiple: boolean;
|
|
245
|
-
/** The depth of the menu the item sits in, 0 for the top menu */
|
|
246
235
|
level: number;
|
|
247
|
-
/** Toggles the item; bind it to the item's click */
|
|
248
236
|
onChange: (event: MouseEvent) => void;
|
|
249
237
|
}
|
|
250
238
|
export interface TableSelectionCellSnippetProps<R extends AnyRecord = AnyRecord> {
|
|
@@ -255,7 +243,6 @@ export interface TableSelectionCellSnippetProps<R extends AnyRecord = AnyRecord>
|
|
|
255
243
|
inHeader: boolean;
|
|
256
244
|
disabled?: boolean;
|
|
257
245
|
indeterminate: boolean;
|
|
258
|
-
/** The default checkbox */
|
|
259
246
|
originNode: Snippet;
|
|
260
247
|
/** Row cells only */
|
|
261
248
|
onSelectRow?: (selected: boolean, event: Event) => void;
|
|
@@ -278,12 +265,12 @@ export interface TableProps<R extends AnyRecord = AnyRecord> extends Omit<HTMLAt
|
|
|
278
265
|
clickGroupedRowToExpand?: boolean;
|
|
279
266
|
columns?: ColumnProps<R>[];
|
|
280
267
|
components?: TableComponents;
|
|
268
|
+
/** Bindable; wins over `pagination.currentPage` because `bind:` cannot reach a field inside an object. Paging writes it back */
|
|
269
|
+
currentPage?: number;
|
|
281
270
|
/**
|
|
282
271
|
* Rows added or removed in place (push, splice on a `$state` array) are sorted and filtered again; a record field
|
|
283
272
|
* changed in place shows in its cell but does not sort or filter again
|
|
284
273
|
*/
|
|
285
|
-
/** Bindable; wins over `pagination.currentPage` because `bind:` cannot reach a field inside an object. Paging writes it back */
|
|
286
|
-
currentPage?: number;
|
|
287
274
|
dataSource?: R[];
|
|
288
275
|
defaultExpandAllGroupRows?: boolean;
|
|
289
276
|
defaultExpandAllRows?: boolean;
|
|
@@ -298,7 +285,6 @@ export interface TableProps<R extends AnyRecord = AnyRecord> extends Omit<HTMLAt
|
|
|
298
285
|
expandRowByClick?: boolean;
|
|
299
286
|
footer?: string | Snippet<[TableTitleSnippetProps<R>]>;
|
|
300
287
|
groupBy?: TableGroupBy<R>;
|
|
301
|
-
/** The column config of a group section's single cell */
|
|
302
288
|
groupSectionColumn?: (groupKey: string | number, group: (string | number)[]) => Omit<ColumnProps<R>, 'title' | 'children' | 'dataIndex'>;
|
|
303
289
|
headerStyle?: string;
|
|
304
290
|
hideExpandedColumn?: boolean;
|
|
@@ -311,7 +297,6 @@ export interface TableProps<R extends AnyRecord = AnyRecord> extends Omit<HTMLAt
|
|
|
311
297
|
rowExpandable?: TableRowExpandable<R>;
|
|
312
298
|
rowKey?: TableRowKey<R>;
|
|
313
299
|
rowSelection?: boolean | RowSelectionProps<R>;
|
|
314
|
-
/** Hovering a cell with rowSpan highlights every row it spans */
|
|
315
300
|
rowSpanHover?: boolean;
|
|
316
301
|
scroll?: TableScroll;
|
|
317
302
|
/** Bindable; wins over `rowSelection.selectedRowKeys` because `bind:` cannot reach a field inside an object. Needs `rowSelection` to show the checkboxes */
|
|
@@ -344,19 +329,15 @@ export interface TableProps<R extends AnyRecord = AnyRecord> extends Omit<HTMLAt
|
|
|
344
329
|
cell?: Snippet<[TableCellSnippetProps<R>]>;
|
|
345
330
|
/** The title of a column header; render `title` for the columns it leaves alone */
|
|
346
331
|
headerCell?: Snippet<[TableHeaderCellSnippetProps<R>]>;
|
|
347
|
-
/** Replaces the empty text */
|
|
348
332
|
empty?: Snippet;
|
|
349
333
|
/** The content of an expanded row; given, every expandable row gets an expand button */
|
|
350
334
|
expandedRow?: Snippet<[TableExpandedRowSnippetProps<R>]>;
|
|
351
335
|
groupSection?: Snippet<[TableGroupSectionSnippetProps]>;
|
|
352
336
|
sortIcon?: Snippet<[TableSortIconSnippetProps<R>]>;
|
|
353
|
-
/** The content of a column's filter button */
|
|
354
337
|
filterIcon?: Snippet<[TableFilterIconSnippetProps<R>]>;
|
|
355
|
-
/** The filter panel of a column with `filterDropdown: true` */
|
|
356
338
|
filterDropdown?: Snippet<[TableFilterDropdownSnippetProps<R>]>;
|
|
357
339
|
/** An item of a filter menu; given, it replaces every item */
|
|
358
340
|
filterDropdownItem?: Snippet<[TableFilterDropdownItemSnippetProps<R>]>;
|
|
359
|
-
/** A selection cell, header and rows */
|
|
360
341
|
selectionCell?: Snippet<[TableSelectionCellSnippetProps<R>]>;
|
|
361
342
|
/** Replaces the pagination info and Pagination; named apart from the `pagination` prop, which shares the namespace */
|
|
362
343
|
paginationContent?: Snippet<[TablePaginationSnippetProps]>;
|
|
@@ -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';
|