@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
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
let seen = untrack(() => value);
|
|
77
77
|
let written: number | number[] | undefined;
|
|
78
78
|
|
|
79
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
80
79
|
const foundationProps: BasicSliderProps = {
|
|
81
80
|
get disabled() {
|
|
82
81
|
return disabled;
|
|
@@ -117,7 +116,6 @@
|
|
|
117
116
|
() => ({
|
|
118
117
|
getSliderNode: () => slider,
|
|
119
118
|
notifyChange: (next) => {
|
|
120
|
-
// the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
121
119
|
written = next;
|
|
122
120
|
value = next;
|
|
123
121
|
onChange?.(next);
|
|
@@ -153,8 +151,6 @@
|
|
|
153
151
|
);
|
|
154
152
|
|
|
155
153
|
const shownMarks = $derived(markList.filter((item) => item.active !== false));
|
|
156
|
-
|
|
157
|
-
// aria-*, name and autofocus name and focus the inputs; the wrapper takes the rest
|
|
158
154
|
const attrs = $derived(splitControlAttrs(rest, (key) => key.startsWith('aria-') || key === 'name' || key === 'autofocus' || key === 'tabindex'));
|
|
159
155
|
|
|
160
156
|
// The inputs are the Tab stops, and the slider role supports no aria-required (a native range has no required either);
|
|
@@ -227,18 +223,15 @@
|
|
|
227
223
|
}
|
|
228
224
|
seen = next;
|
|
229
225
|
if (next === undefined) {
|
|
230
|
-
// a form reset: back to the default position, nothing to report
|
|
231
226
|
controlled = false;
|
|
232
227
|
foundation.resetValue();
|
|
233
228
|
return;
|
|
234
229
|
}
|
|
235
|
-
// the echo of a change the foundation already applied
|
|
236
230
|
if (!controlled && isEqual(next, written)) {
|
|
237
231
|
return;
|
|
238
232
|
}
|
|
239
233
|
controlled = true;
|
|
240
234
|
foundation.handleValueChange(next);
|
|
241
|
-
// a controlled value change ends a change too
|
|
242
235
|
onAfterChange?.(next);
|
|
243
236
|
}
|
|
244
237
|
);
|
package/dist/space/space.svelte
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
const prefixCls = cssClasses.PREFIX;
|
|
11
11
|
const presets: string[] = [strings.SPACING_TIGHT, strings.SPACING_MEDIUM, strings.SPACING_LOOSE];
|
|
12
12
|
|
|
13
|
-
// A preset becomes a class; a number becomes a gap in px
|
|
14
13
|
const axes = $derived.by(() => {
|
|
15
14
|
const [columns, rows]: Spacing[] = Array.isArray(spacing) ? spacing : [spacing, spacing];
|
|
16
15
|
return {
|
package/dist/steps/context.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export interface StepsContextValue {
|
|
|
11
11
|
clickable: boolean;
|
|
12
12
|
title?: Snippet<[StepSnippetProps]>;
|
|
13
13
|
description?: Snippet<[StepSnippetProps]>;
|
|
14
|
-
/** Reports a click on step `stepNumber`; the current step is ignored */
|
|
15
14
|
change: (stepNumber: number) => void;
|
|
16
15
|
}
|
|
17
16
|
export declare const getStepsContext: (caller?: string) => StepsContextValue, setStepsContext: (value: StepsContextValue) => StepsContextValue;
|
|
@@ -7,7 +7,6 @@ export type StepsDirection = 'horizontal' | 'vertical';
|
|
|
7
7
|
export type StepsType = 'fill' | 'basic' | 'nav';
|
|
8
8
|
/** One step of `dataSource`; nodes for its title and description come from the Steps snippets. Other attributes land on the step's root. */
|
|
9
9
|
export interface StepData extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onclick'> {
|
|
10
|
-
/** Own status; when omitted it follows the Steps' current and status */
|
|
11
10
|
status?: StepStatus;
|
|
12
11
|
title?: string | number;
|
|
13
12
|
/** Not rendered by the nav type */
|
|
@@ -37,7 +36,6 @@ export interface StepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
|
|
|
37
36
|
dataSource?: StepData[];
|
|
38
37
|
/** Not bindable: whether it is set decides if the steps are buttons, and Svelte cannot tell a `bind:` from a plain prop */
|
|
39
38
|
onChange?: (current: number) => void;
|
|
40
|
-
/** Title of each step; defaults to `item.title` */
|
|
41
39
|
title?: Snippet<[StepSnippetProps]>;
|
|
42
40
|
/** Description of each step; defaults to `item.description`. Not rendered by the nav type */
|
|
43
41
|
description?: Snippet<[StepSnippetProps]>;
|
package/dist/steps/step.svelte
CHANGED
|
@@ -30,8 +30,6 @@
|
|
|
30
30
|
const plainDescription = $derived(String(item.description ?? ''));
|
|
31
31
|
const hasTitle = $derived(Boolean(steps.title) || plainTitle !== '');
|
|
32
32
|
const hasDescription = $derived(Boolean(steps.description) || plainDescription !== '');
|
|
33
|
-
|
|
34
|
-
// a plain title is also the hover tooltip of a clipped one; a snippet has no text to offer
|
|
35
33
|
const titleText = $derived(steps.title ? undefined : plainTitle || undefined);
|
|
36
34
|
const descriptionText = $derived(steps.description ? undefined : plainDescription || undefined);
|
|
37
35
|
|
|
@@ -48,7 +46,6 @@
|
|
|
48
46
|
// keys typed in a focusable child (an input in the title) must not switch the step
|
|
49
47
|
if (event.target === event.currentTarget && (event.key === 'Enter' || event.key === ' ')) {
|
|
50
48
|
event.preventDefault(); // Space would otherwise scroll the page
|
|
51
|
-
// a real click runs the click listeners and the change exactly as a pointer does
|
|
52
49
|
event.currentTarget.click();
|
|
53
50
|
}
|
|
54
51
|
};
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
|
|
22
22
|
let root = $state<HTMLDivElement>();
|
|
23
23
|
|
|
24
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
25
24
|
const foundationProps: SwitchBaseProps = {
|
|
26
25
|
get checked() {
|
|
27
26
|
return checked;
|
|
@@ -38,7 +37,6 @@
|
|
|
38
37
|
(base) => ({
|
|
39
38
|
setChecked: (next) => base.setState({ checked: next }),
|
|
40
39
|
notifyChange: (next, event) => {
|
|
41
|
-
// the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
42
40
|
checked = next;
|
|
43
41
|
onChange?.(next, event);
|
|
44
42
|
},
|
|
@@ -11,20 +11,16 @@
|
|
|
11
11
|
|
|
12
12
|
interface BaseRowProps {
|
|
13
13
|
record: AnyRecord;
|
|
14
|
-
/** The index among its siblings, or of the row in a virtualized body */
|
|
15
14
|
index: number;
|
|
16
15
|
rowKey: BaseRowKeyType;
|
|
17
16
|
/** The tree level, given when the row or its table has expand buttons */
|
|
18
17
|
level?: number;
|
|
19
18
|
expanded?: boolean;
|
|
20
|
-
/** The row has an expand button */
|
|
21
19
|
expandableRow?: boolean;
|
|
22
|
-
/** A click on the row toggles its expansion */
|
|
23
20
|
clickToExpand?: boolean;
|
|
24
21
|
selected?: boolean;
|
|
25
22
|
disabled?: boolean;
|
|
26
23
|
hovered?: boolean;
|
|
27
|
-
/** Highlighted with a hovered row its rowSpan cell covers */
|
|
28
24
|
highlighted?: boolean;
|
|
29
25
|
displayNone?: boolean;
|
|
30
26
|
cellWidths: number[];
|
|
@@ -2,20 +2,16 @@ import type { BaseRowKeyType } from '@fibrae/semi-foundation/table/foundation';
|
|
|
2
2
|
type AnyRecord = Record<string, any>;
|
|
3
3
|
interface BaseRowProps {
|
|
4
4
|
record: AnyRecord;
|
|
5
|
-
/** The index among its siblings, or of the row in a virtualized body */
|
|
6
5
|
index: number;
|
|
7
6
|
rowKey: BaseRowKeyType;
|
|
8
7
|
/** The tree level, given when the row or its table has expand buttons */
|
|
9
8
|
level?: number;
|
|
10
9
|
expanded?: boolean;
|
|
11
|
-
/** The row has an expand button */
|
|
12
10
|
expandableRow?: boolean;
|
|
13
|
-
/** A click on the row toggles its expansion */
|
|
14
11
|
clickToExpand?: boolean;
|
|
15
12
|
selected?: boolean;
|
|
16
13
|
disabled?: boolean;
|
|
17
14
|
hovered?: boolean;
|
|
18
|
-
/** Highlighted with a hovered row its rowSpan cell covers */
|
|
19
15
|
highlighted?: boolean;
|
|
20
16
|
displayNone?: boolean;
|
|
21
17
|
cellWidths: number[];
|
|
@@ -16,18 +16,13 @@
|
|
|
16
16
|
type AnyRecord = Record<string, any>;
|
|
17
17
|
|
|
18
18
|
interface BodyProps {
|
|
19
|
-
/** The column tree */
|
|
20
19
|
columns: ColumnProps[];
|
|
21
|
-
/** The records of the current page */
|
|
22
20
|
dataSource: AnyRecord[];
|
|
23
21
|
groups?: Map<BaseRowKeyType, Set<BaseRowKeyType>> | null;
|
|
24
22
|
expandedRowKeys: BaseRowKeyType[];
|
|
25
23
|
pageDisabledRowKeysSet: Set<BaseRowKeyType>;
|
|
26
|
-
/** The rows of a virtualized body */
|
|
27
24
|
virtualizedData: (FlattenData | GroupFlattenData)[];
|
|
28
|
-
/** The header renders inside the body table, since it is not fixed */
|
|
29
25
|
includeHeader: boolean;
|
|
30
|
-
/** The accessible name of the body table, when it is the table */
|
|
31
26
|
tableAttrs?: Record<string, unknown>;
|
|
32
27
|
emptyContent: Snippet;
|
|
33
28
|
onScroll?: (args: TableVirtualizedScrollArgs) => void;
|
|
@@ -92,7 +87,6 @@
|
|
|
92
87
|
|
|
93
88
|
const groupRecords = (group: Set<BaseRowKeyType>) => [...group].flatMap((key) => recordsByKey.get(key) ?? []);
|
|
94
89
|
|
|
95
|
-
/** The props of a record row that depend on the table state */
|
|
96
90
|
const baseRowState = (record: AnyRecord, rowKey: BaseRowKeyType, level: number) => {
|
|
97
91
|
const expandable = table.rowExpandable(record);
|
|
98
92
|
const inRow = expandable || expandBtnInRow;
|
|
@@ -175,7 +169,6 @@
|
|
|
175
169
|
};
|
|
176
170
|
});
|
|
177
171
|
|
|
178
|
-
/** The scrolling body element, whose horizontal offset the separate header follows */
|
|
179
172
|
export function element() {
|
|
180
173
|
return scrollElement();
|
|
181
174
|
}
|
|
@@ -5,18 +5,13 @@ import { type VirtualListAlign } from '../../_base/virtual-list.svelte';
|
|
|
5
5
|
import type { ColumnProps, TableVirtualizedScrollArgs } from '../interface.js';
|
|
6
6
|
type AnyRecord = Record<string, any>;
|
|
7
7
|
interface BodyProps {
|
|
8
|
-
/** The column tree */
|
|
9
8
|
columns: ColumnProps[];
|
|
10
|
-
/** The records of the current page */
|
|
11
9
|
dataSource: AnyRecord[];
|
|
12
10
|
groups?: Map<BaseRowKeyType, Set<BaseRowKeyType>> | null;
|
|
13
11
|
expandedRowKeys: BaseRowKeyType[];
|
|
14
12
|
pageDisabledRowKeysSet: Set<BaseRowKeyType>;
|
|
15
|
-
/** The rows of a virtualized body */
|
|
16
13
|
virtualizedData: (FlattenData | GroupFlattenData)[];
|
|
17
|
-
/** The header renders inside the body table, since it is not fixed */
|
|
18
14
|
includeHeader: boolean;
|
|
19
|
-
/** The accessible name of the body table, when it is the table */
|
|
20
15
|
tableAttrs?: Record<string, unknown>;
|
|
21
16
|
emptyContent: Snippet;
|
|
22
17
|
onScroll?: (args: TableVirtualizedScrollArgs) => void;
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
interface SectionRowProps {
|
|
12
12
|
groupKey: BaseRowKeyType;
|
|
13
13
|
group: Set<BaseRowKeyType>;
|
|
14
|
-
/** The records of the group in the current page */
|
|
15
14
|
records: AnyRecord[];
|
|
16
|
-
/** The index among the groups, or of the row in a virtualized body */
|
|
17
15
|
index: number;
|
|
18
16
|
expanded: boolean;
|
|
19
17
|
style?: string;
|
|
@@ -3,9 +3,7 @@ type AnyRecord = Record<string, any>;
|
|
|
3
3
|
interface SectionRowProps {
|
|
4
4
|
groupKey: BaseRowKeyType;
|
|
5
5
|
group: Set<BaseRowKeyType>;
|
|
6
|
-
/** The records of the group in the current page */
|
|
7
6
|
records: AnyRecord[];
|
|
8
|
-
/** The index among the groups, or of the row in a virtualized body */
|
|
9
7
|
index: number;
|
|
10
8
|
expanded: boolean;
|
|
11
9
|
style?: string;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { ColumnProps } from './interface.js';
|
|
3
3
|
|
|
4
|
-
/** What every level of one column's filter menu shares */
|
|
5
4
|
export interface FilterMenuState {
|
|
6
5
|
column: ColumnProps;
|
|
7
6
|
filterMultiple: boolean;
|
|
8
7
|
confirmMode: boolean;
|
|
9
8
|
filteredValue: any[];
|
|
10
|
-
/** The value picked and not applied yet, in confirm mode */
|
|
11
9
|
tempFilteredValue?: any[];
|
|
12
10
|
filterDropdownProps: ColumnProps['filterDropdownProps'];
|
|
13
11
|
setTemp: (value: any[]) => void;
|
|
@@ -35,7 +33,6 @@
|
|
|
35
33
|
|
|
36
34
|
interface ColumnFilterMenuProps {
|
|
37
35
|
filters: TableFilter[];
|
|
38
|
-
/** The depth of the menu, 0 for the top menu */
|
|
39
36
|
level: number;
|
|
40
37
|
state: FilterMenuState;
|
|
41
38
|
}
|
|
@@ -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]>;
|