@sewadah/selaras 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/README.md +36 -7
- package/dist/module.json +1 -1
- package/dist/module.mjs +31 -15
- package/dist/runtime/components/Autocomplete.vue +3 -1
- package/dist/runtime/components/Badge.d.vue.ts +1 -1
- package/dist/runtime/components/Badge.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.d.vue.ts +69 -0
- package/dist/runtime/components/Calendar.vue +163 -0
- package/dist/runtime/components/Calendar.vue.d.ts +69 -0
- package/dist/runtime/components/Callout.vue +12 -1
- package/dist/runtime/components/CodeGroup.vue +13 -3
- package/dist/runtime/components/CodeTree.d.vue.ts +2 -0
- package/dist/runtime/components/CodeTree.vue +52 -1
- package/dist/runtime/components/CodeTree.vue.d.ts +2 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +8 -0
- package/dist/runtime/components/ColorPicker.vue +66 -45
- package/dist/runtime/components/ColorPicker.vue.d.ts +8 -0
- package/dist/runtime/components/Column.js +1 -1
- package/dist/runtime/components/CommandPalette.d.vue.ts +3 -1
- package/dist/runtime/components/CommandPalette.vue +5 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +3 -1
- package/dist/runtime/components/ContentNavigation.d.vue.ts +8 -1
- package/dist/runtime/components/ContentNavigation.vue +9 -2
- package/dist/runtime/components/ContentNavigation.vue.d.ts +8 -1
- package/dist/runtime/components/ContentToc.vue +14 -7
- package/dist/runtime/components/ContextMenu.d.vue.ts +8 -1
- package/dist/runtime/components/ContextMenu.vue +16 -4
- package/dist/runtime/components/ContextMenu.vue.d.ts +8 -1
- package/dist/runtime/components/DatePicker.d.vue.ts +10 -3
- package/dist/runtime/components/DatePicker.vue +24 -16
- package/dist/runtime/components/DatePicker.vue.d.ts +10 -3
- package/dist/runtime/components/Dropdown.d.vue.ts +33 -6
- package/dist/runtime/components/Dropdown.vue +143 -11
- package/dist/runtime/components/Dropdown.vue.d.ts +33 -6
- package/dist/runtime/components/FileTree.d.vue.ts +2 -0
- package/dist/runtime/components/FileTree.vue +8 -4
- package/dist/runtime/components/FileTree.vue.d.ts +2 -0
- package/dist/runtime/components/FileUpload.vue +1 -1
- package/dist/runtime/components/FormField.d.vue.ts +4 -0
- package/dist/runtime/components/FormField.vue +19 -4
- package/dist/runtime/components/FormField.vue.d.ts +4 -0
- package/dist/runtime/components/Input.vue +3 -2
- package/dist/runtime/components/Kbd.vue +12 -2
- package/dist/runtime/components/NavigationMenu.d.vue.ts +10 -10
- package/dist/runtime/components/NavigationMenu.vue +13 -7
- package/dist/runtime/components/NavigationMenu.vue.d.ts +10 -10
- package/dist/runtime/components/NavigationMenuAccordionItem.vue +5 -1
- package/dist/runtime/components/NavigationMenuFlyoutList.vue +7 -4
- package/dist/runtime/components/PinInput.vue +1 -1
- package/dist/runtime/components/Popover.d.vue.ts +8 -2
- package/dist/runtime/components/Popover.vue +9 -4
- package/dist/runtime/components/Popover.vue.d.ts +8 -2
- package/dist/runtime/components/ProsePre.d.vue.ts +6 -2
- package/dist/runtime/components/ProsePre.vue +11 -4
- package/dist/runtime/components/ProsePre.vue.d.ts +6 -2
- package/dist/runtime/components/Select.vue +3 -1
- package/dist/runtime/components/SplitterPanel.d.vue.ts +2 -2
- package/dist/runtime/components/SplitterPanel.vue.d.ts +2 -2
- package/dist/runtime/components/Table.vue +95 -26
- package/dist/runtime/components/Tabs.d.vue.ts +44 -4
- package/dist/runtime/components/Tabs.vue +171 -18
- package/dist/runtime/components/Tabs.vue.d.ts +44 -4
- package/dist/runtime/components/Textarea.vue +3 -2
- package/dist/runtime/components/Timeline.d.vue.ts +19 -0
- package/dist/runtime/components/Timeline.vue +99 -0
- package/dist/runtime/components/Timeline.vue.d.ts +19 -0
- package/dist/runtime/components/Toast.d.vue.ts +10 -1
- package/dist/runtime/components/Toast.vue +94 -8
- package/dist/runtime/components/Toast.vue.d.ts +10 -1
- package/dist/runtime/components/Tooltip.d.vue.ts +8 -2
- package/dist/runtime/components/Tooltip.vue +9 -4
- package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
- package/dist/runtime/composables/use-form-field.d.ts +1 -0
- package/dist/runtime/composables/use-table.d.ts +3 -0
- package/dist/runtime/composables/use-table.js +10 -4
- package/dist/runtime/composables/use-toast.js +5 -1
- package/dist/runtime/default-colors.css +1 -1
- package/dist/runtime/directives/hotkey.d.ts +13 -0
- package/dist/runtime/directives/hotkey.js +107 -0
- package/dist/runtime/directives/index.d.ts +2 -0
- package/dist/runtime/directives/index.js +2 -0
- package/dist/runtime/directives/mask.d.ts +30 -0
- package/dist/runtime/directives/mask.js +165 -0
- package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +29 -25
- package/dist/runtime/internal/ComboboxSelectBase.vue +104 -20
- package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +29 -25
- package/dist/runtime/internal/ComboboxSelectBody.d.vue.ts +16 -11
- package/dist/runtime/internal/ComboboxSelectBody.vue +49 -10
- package/dist/runtime/internal/ComboboxSelectBody.vue.d.ts +16 -11
- package/dist/runtime/internal/DatePickerCalendarBody.vue +1 -1
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue +1 -1
- package/dist/runtime/internal/ShortcutHint.d.vue.ts +6 -0
- package/dist/runtime/internal/ShortcutHint.vue +13 -0
- package/dist/runtime/internal/ShortcutHint.vue.d.ts +6 -0
- package/dist/runtime/internal/ToastItemRenderer.d.vue.ts +9 -1
- package/dist/runtime/internal/ToastItemRenderer.vue +55 -8
- package/dist/runtime/internal/ToastItemRenderer.vue.d.ts +9 -1
- package/dist/runtime/internal/combobox-select.js +2 -1
- package/dist/runtime/internal/programmatic-services.d.ts +2 -0
- package/dist/runtime/internal/programmatic-services.js +8 -0
- package/dist/runtime/internal/toast-stack.d.ts +36 -0
- package/dist/runtime/internal/toast-stack.js +36 -0
- package/dist/runtime/structural.css +1 -1
- package/dist/runtime/table.d.ts +1 -1
- package/dist/runtime/theme/alert-dialog.js +1 -1
- package/dist/runtime/theme/avatar.js +7 -7
- package/dist/runtime/theme/badge.js +2 -2
- package/dist/runtime/theme/calendar.d.ts +86 -0
- package/dist/runtime/theme/calendar.js +19 -0
- package/dist/runtime/theme/callout.d.ts +0 -12
- package/dist/runtime/theme/callout.js +8 -8
- package/dist/runtime/theme/checkbox.js +1 -1
- package/dist/runtime/theme/code-tree.js +1 -1
- package/dist/runtime/theme/command-palette.js +1 -1
- package/dist/runtime/theme/content-navigation.d.ts +3 -0
- package/dist/runtime/theme/content-navigation.js +1 -0
- package/dist/runtime/theme/date-picker.js +1 -1
- package/dist/runtime/theme/drawer.js +1 -1
- package/dist/runtime/theme/dropdown.d.ts +21 -0
- package/dist/runtime/theme/dropdown.js +15 -2
- package/dist/runtime/theme/file-tree.js +1 -1
- package/dist/runtime/theme/file-upload.js +2 -2
- package/dist/runtime/theme/form-field.d.ts +18 -0
- package/dist/runtime/theme/form-field.js +6 -1
- package/dist/runtime/theme/icon.js +1 -1
- package/dist/runtime/theme/input-number.js +1 -1
- package/dist/runtime/theme/input.js +1 -1
- package/dist/runtime/theme/modal.js +1 -1
- package/dist/runtime/theme/pin-input.js +1 -1
- package/dist/runtime/theme/progress.js +2 -2
- package/dist/runtime/theme/prose.d.ts +6 -0
- package/dist/runtime/theme/prose.js +2 -0
- package/dist/runtime/theme/radio-group.js +4 -4
- package/dist/runtime/theme/rating.js +1 -1
- package/dist/runtime/theme/select.js +2 -2
- package/dist/runtime/theme/separator.js +1 -1
- package/dist/runtime/theme/slideover.js +1 -1
- package/dist/runtime/theme/slider.js +2 -2
- package/dist/runtime/theme/splitter-resize-handle.js +1 -1
- package/dist/runtime/theme/switch.js +1 -1
- package/dist/runtime/theme/table.d.ts +27 -0
- package/dist/runtime/theme/table.js +11 -2
- package/dist/runtime/theme/tabs.d.ts +87 -3
- package/dist/runtime/theme/tabs.js +46 -22
- package/dist/runtime/theme/textarea.js +1 -1
- package/dist/runtime/theme/timeline.d.ts +251 -0
- package/dist/runtime/theme/timeline.js +84 -0
- package/dist/runtime/theme/toast.d.ts +92 -0
- package/dist/runtime/theme/toast.js +29 -7
- package/dist/runtime/theme-config.d.ts +12 -1
- package/dist/runtime/types/index.d.ts +6 -1
- package/dist/runtime/utils/arrow.d.ts +21 -0
- package/dist/runtime/utils/arrow.js +10 -0
- package/dist/runtime/utils/color-registry.d.ts +3 -1
- package/dist/runtime/utils/color-registry.js +4 -0
- package/dist/runtime/utils/file-icons.d.ts +8 -0
- package/dist/runtime/utils/file-icons.js +133 -0
- package/dist/runtime/utils/functional-tokens.d.ts +1 -1
- package/dist/runtime/utils/functional-tokens.js +1 -1
- package/dist/runtime/utils/icons.d.ts +2 -0
- package/dist/runtime/utils/icons.js +2 -0
- package/dist/runtime/utils/messages.d.ts +6 -0
- package/dist/runtime/utils/messages.js +6 -0
- package/dist/runtime/utils/navigation-menu.d.ts +10 -0
- package/dist/runtime/utils/navigation-menu.js +3 -0
- package/dist/runtime/utils/overlay.d.ts +17 -0
- package/dist/runtime/utils/overlay.js +7 -0
- package/dist/runtime/utils/seed-colors.d.ts +2 -1
- package/dist/runtime/utils/seed-colors.js +24 -16
- package/dist/runtime/utils/select-contracts.d.ts +7 -1
- package/dist/runtime/utils/table-columns.js +1 -1
- package/dist/runtime/utils/table-contracts.d.ts +9 -1
- package/dist/runtime/utils/timeline-contracts.d.ts +42 -0
- package/dist/runtime/utils/timeline-contracts.js +0 -0
- package/dist/tokens/default-colors.tokens.json +100 -100
- package/package.json +21 -9
|
@@ -11,11 +11,14 @@ export const defaultMessages = {
|
|
|
11
11
|
searchDescription: "Type to filter, then use arrow keys and enter to select",
|
|
12
12
|
columns: "Columns",
|
|
13
13
|
filterPlaceholder: "Filter...",
|
|
14
|
+
filterColumn: (column) => `Filter ${column}`,
|
|
14
15
|
previous: "Previous",
|
|
15
16
|
next: "Next",
|
|
16
17
|
first: "First",
|
|
17
18
|
last: "Last",
|
|
18
19
|
pagination: "Pagination",
|
|
20
|
+
scrollTabsLeft: "Scroll tabs left",
|
|
21
|
+
scrollTabsRight: "Scroll tabs right",
|
|
19
22
|
datePicker: "Date picker",
|
|
20
23
|
datePickerDescription: "Use arrow keys to navigate days, enter to select",
|
|
21
24
|
dateRangePicker: "Date range picker",
|
|
@@ -39,6 +42,7 @@ export const defaultMessages = {
|
|
|
39
42
|
decrement: "Decrement",
|
|
40
43
|
noOptions: "No options",
|
|
41
44
|
noResultsFound: "No results found",
|
|
45
|
+
createOption: (value) => `Create "${value}"`,
|
|
42
46
|
noData: "No data",
|
|
43
47
|
expandRow: "Expand row",
|
|
44
48
|
collapseRow: "Collapse row",
|
|
@@ -61,6 +65,8 @@ export const defaultMessages = {
|
|
|
61
65
|
showHiddenBreadcrumbItems: "Show hidden breadcrumb items",
|
|
62
66
|
commandPalette: "Command palette",
|
|
63
67
|
commandPaletteDescription: "Search for a command and press enter",
|
|
68
|
+
dropdownMenu: "Actions",
|
|
69
|
+
dropdownMenuDescription: "Choose an action",
|
|
64
70
|
navigate: "Navigate",
|
|
65
71
|
select: "Select",
|
|
66
72
|
onThisPage: "On this page",
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import type { HotkeyOptions } from '../directives/hotkey.js';
|
|
1
2
|
export interface NavigationMenuItem {
|
|
2
3
|
label: string;
|
|
3
4
|
icon?: string;
|
|
4
5
|
to?: string;
|
|
6
|
+
target?: string;
|
|
7
|
+
rel?: string;
|
|
8
|
+
ariaLabel?: string;
|
|
5
9
|
disabled?: boolean;
|
|
6
10
|
/** Force active state - otherwise auto-detected against the current route when `to` is set. */
|
|
7
11
|
active?: boolean;
|
|
8
12
|
/** One level for horizontal (Reka's own real limit for its shared-viewport flyout); arbitrary depth for vertical, which falls back to a recursive accordion instead. */
|
|
9
13
|
children?: NavigationMenuItem[];
|
|
10
14
|
onSelect?: (event: Event) => void;
|
|
15
|
+
/** Display a keyboard shortcut hint beside this item's label. */
|
|
16
|
+
shortcut?: string;
|
|
17
|
+
/** Bind `shortcut` page-wide, so the key activates this item from anywhere except while typing in a field. */
|
|
18
|
+
hotkey?: boolean;
|
|
11
19
|
/** Targets this item's own named slots (`#{slot}`, `#{slot}-leading`, `#{slot}-label`, `#{slot}-trailing`, `#{slot}-content`) ahead of the generic `#item`/`#item-leading`/etc, when the named one is actually provided. */
|
|
12
20
|
slot?: string;
|
|
13
21
|
/**
|
|
@@ -30,3 +38,5 @@ export interface NavigationMenuItem {
|
|
|
30
38
|
description?: string;
|
|
31
39
|
}
|
|
32
40
|
export declare function isNavigationMenuItemActive(item: NavigationMenuItem, currentPath: string): boolean;
|
|
41
|
+
/** The v-hotkey binding for an item that opts in with `hotkey: true`. */
|
|
42
|
+
export declare function navigationMenuHotkey(item: NavigationMenuItem): HotkeyOptions | undefined;
|
|
@@ -3,3 +3,6 @@ export function isNavigationMenuItemActive(item, currentPath) {
|
|
|
3
3
|
return item.active;
|
|
4
4
|
return item.to !== void 0 && item.to === currentPath;
|
|
5
5
|
}
|
|
6
|
+
export function navigationMenuHotkey(item) {
|
|
7
|
+
return item.hotkey && item.shortcut && !item.disabled ? { keys: item.shortcut } : void 0;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ContextMenuContentProps, PopoverContentProps } from 'reka-ui';
|
|
2
|
+
/** Positioning options shared by Selaras's anchored panels. Visual styling stays in `ui.content`. */
|
|
3
|
+
export type OverlayPositioning = Pick<PopoverContentProps, 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'avoidCollisions' | 'collisionBoundary' | 'collisionPadding' | 'arrowPadding' | 'sticky' | 'hideWhenDetached' | 'positionStrategy'>;
|
|
4
|
+
/** A context menu is anchored to the pointer, so it does not accept side or alignment. */
|
|
5
|
+
export type ContextMenuPositioning = Pick<ContextMenuContentProps, 'alignOffset' | 'avoidCollisions' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'hideWhenDetached' | 'positionStrategy'>;
|
|
6
|
+
/** `false` renders inline; a selector or element chooses a teleport target. */
|
|
7
|
+
export type OverlayPortal = boolean | string | HTMLElement;
|
|
8
|
+
export declare function overlayPortalProps(portal: OverlayPortal | undefined): {
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
to?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
to: string | HTMLElement;
|
|
13
|
+
disabled?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
disabled?: undefined;
|
|
16
|
+
to?: undefined;
|
|
17
|
+
};
|
|
@@ -8,7 +8,8 @@ export interface SeedColorOptions {
|
|
|
8
8
|
surfaces?: SeedColorSurfaces;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Preserves one opaque sRGB seed as the resting fill and derives a complete,
|
|
12
|
+
* opaque two-mode web ColorRecipe around it.
|
|
12
13
|
* Custom or unresolved surfaces require explicit recipes instead.
|
|
13
14
|
*/
|
|
14
15
|
export declare function defineColorFromSeed(seed: string, options?: SeedColorOptions): ColorModePair<ColorRecipe>;
|
|
@@ -150,30 +150,38 @@ function requireSeries(mode, family, create) {
|
|
|
150
150
|
invalid(`cannot derive the ${mode} ${family} family while preserving its contrast targets; provide an explicit defineColor() recipe.`);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
+
function deriveFillStates(seed, foreground, mode) {
|
|
154
|
+
const preferredTarget = mode === "light" ? black : white;
|
|
155
|
+
const alternateTarget = preferredTarget === black ? white : black;
|
|
156
|
+
for (const target of [preferredTarget, alternateTarget]) {
|
|
157
|
+
for (const scale of [1, 0.75, 0.5, 0.25, 0.125, 0.0625, 0.03125]) {
|
|
158
|
+
const hover = quantize(mixLab(seed, target, 0.06 * scale));
|
|
159
|
+
const pressed = quantize(mixLab(seed, target, 0.12 * scale));
|
|
160
|
+
const colors = [seed, hover, pressed];
|
|
161
|
+
if (new Set(colors.map(toHex)).size === colors.length && colors.every((color) => contrast(color, foreground) >= textMinimum))
|
|
162
|
+
return [hover, pressed];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
invalid(`cannot derive distinct ${mode} fill states while preserving readable content; provide an explicit defineColor() recipe.`);
|
|
166
|
+
}
|
|
153
167
|
function deriveMode(seed, surface, mode) {
|
|
154
168
|
const direction = contrast(white, surface) > contrast(black, surface) ? 1 : -1;
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return [];
|
|
161
|
-
}
|
|
162
|
-
}).sort((left, right) => left.cost + Number(left.collapsed) * 0.02 - (right.cost + Number(right.collapsed) * 0.02));
|
|
163
|
-
const fill = fillCandidates[0];
|
|
164
|
-
if (!fill)
|
|
165
|
-
invalid(`cannot derive the ${mode} fill family while preserving its contrast targets; provide an explicit defineColor() recipe.`);
|
|
166
|
-
const fillColor = fill.colors[0];
|
|
169
|
+
const foreground = contrast(seed, black) >= contrast(seed, white) ? black : white;
|
|
170
|
+
if (contrast(seed, foreground) < textMinimum)
|
|
171
|
+
invalid(`cannot preserve the ${mode} fill while deriving readable content; provide an explicit defineColor() recipe.`);
|
|
172
|
+
const [fillHover, fillPressed] = deriveFillStates(seed, foreground, mode);
|
|
173
|
+
const fillColor = seed;
|
|
167
174
|
const subtle = quantize(mixLab(surface, fillColor, 0.1));
|
|
168
175
|
const subtleHover = quantize(mixLab(surface, fillColor, 0.14));
|
|
169
176
|
const subtlePressed = quantize(mixLab(surface, fillColor, 0.18));
|
|
170
177
|
const text = requireSeries(mode, "text/subtle", () => findStateSeries(seed, direction, 0.03, 3, (color) => [surface, subtle, subtleHover, subtlePressed].every((background) => contrast(color, background) >= textGuard))).colors;
|
|
171
178
|
const border = requireSeries(mode, "border", () => findStateSeries(seed, direction, 0.02, 1, (color) => contrast(color, surface) >= nonTextGuard)).colors[0];
|
|
172
179
|
return {
|
|
173
|
-
fill: toHex(
|
|
174
|
-
fillHover: toHex(
|
|
175
|
-
fillPressed: toHex(
|
|
176
|
-
onFill: toHex(
|
|
180
|
+
fill: toHex(fillColor),
|
|
181
|
+
fillHover: toHex(fillHover),
|
|
182
|
+
fillPressed: toHex(fillPressed),
|
|
183
|
+
onFill: toHex(foreground),
|
|
184
|
+
indicator: toHex(border),
|
|
177
185
|
subtle: toHex(subtle),
|
|
178
186
|
subtleHover: toHex(subtleHover),
|
|
179
187
|
subtlePressed: toHex(subtlePressed),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { selectTheme, SelectThemeSlots } from '../theme/select.js';
|
|
3
|
+
import type { RoundedArrowConfig } from './arrow.js';
|
|
3
4
|
import type { ColorRole } from './color-registry.js';
|
|
5
|
+
import type { OverlayPortal, OverlayPositioning } from './overlay.js';
|
|
4
6
|
import type { UiProp } from './ui.js';
|
|
5
7
|
export type SelectValue = string | number;
|
|
6
8
|
export interface SelectGroup<Item extends object> {
|
|
@@ -62,7 +64,11 @@ export interface SelectProps<Entry extends object = {
|
|
|
62
64
|
searchTerm?: string;
|
|
63
65
|
resetSearchTermOnBlur?: boolean;
|
|
64
66
|
resetSearchTermOnSelect?: boolean;
|
|
65
|
-
arrow?: boolean;
|
|
67
|
+
arrow?: boolean | RoundedArrowConfig;
|
|
68
|
+
/** Positioning of the anchored list (the adaptive Select modal uses its own layout). */
|
|
69
|
+
positioning?: OverlayPositioning;
|
|
70
|
+
/** Teleport target for the anchored list, or `false` to render it inline. */
|
|
71
|
+
portal?: OverlayPortal;
|
|
66
72
|
/**
|
|
67
73
|
* Opts into the control's accessible small-screen presentation. Select uses
|
|
68
74
|
* a centered modal; Autocomplete keeps its editable combobox in a wider
|
|
@@ -54,7 +54,7 @@ export function convertChildrenToColumns(vnodes) {
|
|
|
54
54
|
accessorKey: props.field,
|
|
55
55
|
header: buildHeaderOrFooter(slots.header, props.header ?? props.field),
|
|
56
56
|
footer: buildHeaderOrFooter(slots.footer, props.footer),
|
|
57
|
-
enableSorting: toBooleanProp(props.sortable,
|
|
57
|
+
enableSorting: toBooleanProp(props.sortable, false),
|
|
58
58
|
sortFn: "alphanumeric",
|
|
59
59
|
enableColumnFilter: toBooleanProp(props.filterable, false),
|
|
60
60
|
filterFn: "includesString",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RowData } from '@tanstack/vue-table';
|
|
2
|
-
import type { TableColumnDef, TableColumnVisibilityState, TableExpandedState, TableGetRowId, TableRowSelectionState, TableSortingState } from '../composables/use-table.js';
|
|
2
|
+
import type { TableColumnDef, TableColumnVisibilityState, TableExpandedState, TableGetRowId, TableGetSubRows, TableRowSelectionState, TableSortingState } from '../composables/use-table.js';
|
|
3
3
|
import type { TableThemeSlots } from '../theme/table.js';
|
|
4
4
|
import type { ColorRole } from './color-registry.js';
|
|
5
5
|
import type { UiProp } from './ui.js';
|
|
@@ -7,6 +7,10 @@ export interface TableProps<TData extends RowData = RowData> {
|
|
|
7
7
|
data: TData[];
|
|
8
8
|
columns?: TableColumnDef<TData>[];
|
|
9
9
|
selectable?: boolean;
|
|
10
|
+
/** Highlights body rows on hover. @default false */
|
|
11
|
+
rowHover?: boolean;
|
|
12
|
+
/** Toggles selection when a selectable body row is clicked. Interactive controls inside cells are ignored. @default false */
|
|
13
|
+
selectOnRowClick?: boolean;
|
|
10
14
|
pageSize?: number;
|
|
11
15
|
loading?: boolean;
|
|
12
16
|
sorting?: TableSortingState;
|
|
@@ -20,6 +24,10 @@ export interface TableProps<TData extends RowData = RowData> {
|
|
|
20
24
|
gridlines?: boolean;
|
|
21
25
|
striped?: boolean;
|
|
22
26
|
expandable?: boolean;
|
|
27
|
+
/** Displays hierarchical rows from `subRows` by default. Set `getSubRows` to read children from another field. @default false */
|
|
28
|
+
tree?: boolean;
|
|
29
|
+
/** Returns a row's child rows when `tree` is enabled. Defaults to `row.subRows`. */
|
|
30
|
+
getSubRows?: TableGetSubRows<TData>;
|
|
23
31
|
expanded?: TableExpandedState;
|
|
24
32
|
columnVisibility?: TableColumnVisibilityState;
|
|
25
33
|
columnToggle?: boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { TimelineThemeSlots } from '../theme/timeline.js';
|
|
2
|
+
import type { ColorRole } from './color-registry.js';
|
|
3
|
+
import type { UiProp } from './ui.js';
|
|
4
|
+
export interface TimelineItem {
|
|
5
|
+
id?: string | number;
|
|
6
|
+
class?: string;
|
|
7
|
+
date?: string;
|
|
8
|
+
/** ISO-8601 value for the semantic `<time datetime>` attribute. */
|
|
9
|
+
datetime?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
color?: ColorRole;
|
|
14
|
+
/** Selects a named slot for this item, replacing its default content. */
|
|
15
|
+
slot?: string;
|
|
16
|
+
/** Per-item styling overrides, resolved against the component's theme. */
|
|
17
|
+
ui?: UiProp<TimelineThemeSlots>;
|
|
18
|
+
/** Additional application data is passed unchanged to scoped slots. */
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface TimelineProps<TItem extends TimelineItem = TimelineItem> {
|
|
22
|
+
items: TItem[];
|
|
23
|
+
orientation?: 'vertical' | 'horizontal';
|
|
24
|
+
align?: 'start' | 'end' | 'alternate';
|
|
25
|
+
size?: 'sm' | 'md' | 'lg';
|
|
26
|
+
color?: ColorRole;
|
|
27
|
+
ui?: UiProp<TimelineThemeSlots>;
|
|
28
|
+
}
|
|
29
|
+
export interface TimelineSlotProps<TItem extends TimelineItem = TimelineItem> {
|
|
30
|
+
item: TItem;
|
|
31
|
+
index: number;
|
|
32
|
+
}
|
|
33
|
+
export interface TimelineSlots<TItem extends TimelineItem = TimelineItem> {
|
|
34
|
+
marker?: (props: TimelineSlotProps<TItem>) => any;
|
|
35
|
+
connector?: (props: TimelineSlotProps<TItem>) => any;
|
|
36
|
+
date?: (props: TimelineSlotProps<TItem>) => any;
|
|
37
|
+
title?: (props: TimelineSlotProps<TItem>) => any;
|
|
38
|
+
description?: (props: TimelineSlotProps<TItem>) => any;
|
|
39
|
+
content?: (props: TimelineSlotProps<TItem>) => any;
|
|
40
|
+
item?: (props: TimelineSlotProps<TItem>) => any;
|
|
41
|
+
[name: string]: ((props: TimelineSlotProps<TItem>) => any) | undefined;
|
|
42
|
+
}
|
|
File without changes
|