@invopop/popui 0.1.35 → 0.1.40
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/BaseButton.svelte +4 -0
- package/dist/BaseDropdown.svelte +42 -3
- package/dist/BaseDropdown.svelte.d.ts +1 -0
- package/dist/BaseTableHeaderOrderBy.svelte +35 -12
- package/dist/ButtonSearch.svelte +82 -0
- package/dist/ButtonSearch.svelte.d.ts +4 -0
- package/dist/ButtonUuidCopy.svelte +1 -0
- package/dist/DatePicker.svelte +96 -27
- package/dist/DatePicker.svelte.d.ts +5 -1
- package/dist/DrawerContext.svelte +443 -34
- package/dist/DrawerContextItem.svelte +36 -29
- package/dist/DropdownSelect.svelte +68 -18
- package/dist/DropdownSelect.svelte.d.ts +4 -1
- package/dist/DropdownSelectGroup.svelte +15 -0
- package/dist/DropdownSelectGroup.svelte.d.ts +7 -0
- package/dist/EmptyState.svelte +6 -2
- package/dist/InputSearch.svelte +45 -5
- package/dist/InputSelect.svelte +12 -3
- package/dist/InputText.svelte +25 -8
- package/dist/InputToggle.svelte +23 -6
- package/dist/StepIcon.svelte +35 -0
- package/dist/StepIcon.svelte.d.ts +4 -0
- package/dist/StepIconList.svelte +24 -31
- package/dist/TagStatus.svelte +1 -1
- package/dist/button/button.svelte +34 -3
- package/dist/button/button.svelte.d.ts +29 -0
- package/dist/clickOutside.d.ts +5 -2
- package/dist/clickOutside.js +9 -3
- package/dist/data-table/cells/boolean-cell.svelte +29 -0
- package/dist/data-table/cells/boolean-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/cell-skeleton.svelte +35 -0
- package/dist/data-table/cells/cell-skeleton.svelte.d.ts +4 -0
- package/dist/data-table/cells/currency-cell.svelte +10 -0
- package/dist/data-table/cells/currency-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/date-cell.svelte +10 -0
- package/dist/data-table/cells/date-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/tag-cell.svelte +12 -0
- package/dist/data-table/cells/tag-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/text-cell.svelte +10 -0
- package/dist/data-table/cells/text-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/uuid-cell.svelte +17 -0
- package/dist/data-table/cells/uuid-cell.svelte.d.ts +8 -0
- package/dist/data-table/column-definitions.d.ts +12 -0
- package/dist/data-table/column-definitions.js +42 -0
- package/dist/data-table/column-sizing-helpers.d.ts +6 -0
- package/dist/data-table/column-sizing-helpers.js +24 -0
- package/dist/data-table/create-columns.d.ts +3 -0
- package/dist/data-table/create-columns.js +67 -0
- package/dist/data-table/data-table-cell.svelte +94 -0
- package/dist/data-table/data-table-cell.svelte.d.ts +25 -0
- package/dist/data-table/data-table-header-cell.svelte +188 -0
- package/dist/data-table/data-table-header-cell.svelte.d.ts +25 -0
- package/dist/data-table/data-table-helpers.d.ts +10 -0
- package/dist/data-table/data-table-helpers.js +124 -0
- package/dist/data-table/data-table-pagination.svelte +214 -0
- package/dist/data-table/data-table-pagination.svelte.d.ts +4 -0
- package/dist/data-table/data-table-row.svelte +57 -0
- package/dist/data-table/data-table-row.svelte.d.ts +25 -0
- package/dist/data-table/data-table-svelte.svelte.d.ts +40 -0
- package/dist/data-table/data-table-svelte.svelte.js +115 -0
- package/dist/data-table/data-table-toolbar.svelte +19 -0
- package/dist/data-table/data-table-toolbar.svelte.d.ts +32 -0
- package/dist/data-table/data-table-types.d.ts +194 -0
- package/dist/data-table/data-table-types.js +1 -0
- package/dist/data-table/data-table-view-options.svelte +126 -0
- package/dist/data-table/data-table-view-options.svelte.d.ts +29 -0
- package/dist/data-table/data-table.svelte +428 -0
- package/dist/data-table/data-table.svelte.d.ts +25 -0
- package/dist/data-table/flex-render.svelte +40 -0
- package/dist/data-table/flex-render.svelte.d.ts +33 -0
- package/dist/data-table/index.d.ts +13 -0
- package/dist/data-table/index.js +13 -0
- package/dist/data-table/render-helpers.d.ts +90 -0
- package/dist/data-table/render-helpers.js +99 -0
- package/dist/data-table/table-setup.d.ts +39 -0
- package/dist/data-table/table-setup.js +151 -0
- package/dist/data-table/table-styles.d.ts +17 -0
- package/dist/data-table/table-styles.js +70 -0
- package/dist/drawer-dnd-helpers.d.ts +30 -0
- package/dist/drawer-dnd-helpers.js +72 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/helpers.js +3 -0
- package/dist/index.d.ts +15 -3
- package/dist/index.js +28 -5
- package/dist/skeleton/index.d.ts +5 -0
- package/dist/skeleton/index.js +7 -0
- package/dist/skeleton/skeleton-avatar.svelte +14 -0
- package/dist/skeleton/skeleton-avatar.svelte.d.ts +7 -0
- package/dist/skeleton/skeleton-card.svelte +22 -0
- package/dist/skeleton/skeleton-card.svelte.d.ts +9 -0
- package/dist/skeleton/skeleton-list.svelte +25 -0
- package/dist/skeleton/skeleton-list.svelte.d.ts +8 -0
- package/dist/skeleton/skeleton.svelte +17 -0
- package/dist/skeleton/skeleton.svelte.d.ts +5 -0
- package/dist/svg/IconDelivery.svelte +1 -1
- package/dist/svg/IconOrder.svelte +1 -1
- package/dist/svg/IconPayment.svelte +1 -1
- package/dist/table/table-cell.svelte +4 -2
- package/dist/table/table-head.svelte +4 -2
- package/dist/table/table-header.svelte +1 -1
- package/dist/table/table-row.svelte +4 -2
- package/dist/table/table.svelte +2 -2
- package/dist/tailwind.theme.css +30 -6
- package/dist/tooltip/index.d.ts +2 -1
- package/dist/tooltip/index.js +3 -2
- package/dist/tooltip/tooltip-auto-hide.svelte +31 -0
- package/dist/tooltip/tooltip-auto-hide.svelte.d.ts +7 -0
- package/dist/types.d.ts +51 -73
- package/package.json +14 -8
- package/dist/BaseTable.svelte +0 -391
- package/dist/BaseTable.svelte.d.ts +0 -4
- package/dist/BaseTableCellContent.svelte +0 -58
- package/dist/BaseTableCellContent.svelte.d.ts +0 -4
- package/dist/BaseTableCheckbox.svelte +0 -33
- package/dist/BaseTableCheckbox.svelte.d.ts +0 -4
- package/dist/BaseTableHeaderContent.svelte +0 -67
- package/dist/BaseTableHeaderContent.svelte.d.ts +0 -4
- package/dist/BaseTableRow.svelte +0 -127
- package/dist/BaseTableRow.svelte.d.ts +0 -4
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A helper class to make it easy to identify Svelte components in
|
|
3
|
+
* `columnDef.cell` and `columnDef.header` properties.
|
|
4
|
+
*
|
|
5
|
+
* > NOTE: This class should only be used internally by the adapter. If you're
|
|
6
|
+
* reading this and you don't know what this is for, you probably don't need it.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```svelte
|
|
10
|
+
* {@const result = content(context as any)}
|
|
11
|
+
* {#if result instanceof RenderComponentConfig}
|
|
12
|
+
* {@const { component: Component, props } = result}
|
|
13
|
+
* <Component {...props} />
|
|
14
|
+
* {/if}
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export class RenderComponentConfig {
|
|
18
|
+
component;
|
|
19
|
+
props;
|
|
20
|
+
constructor(component, props = {}) {
|
|
21
|
+
this.component = component;
|
|
22
|
+
this.props = props;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A helper class to make it easy to identify Svelte Snippets in `columnDef.cell` and `columnDef.header` properties.
|
|
27
|
+
*
|
|
28
|
+
* > NOTE: This class should only be used internally by the adapter. If you're
|
|
29
|
+
* reading this and you don't know what this is for, you probably don't need it.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```svelte
|
|
33
|
+
* {@const result = content(context as any)}
|
|
34
|
+
* {#if result instanceof RenderSnippetConfig}
|
|
35
|
+
* {@const { snippet, params } = result}
|
|
36
|
+
* {@render snippet(params)}
|
|
37
|
+
* {/if}
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export class RenderSnippetConfig {
|
|
41
|
+
snippet;
|
|
42
|
+
params;
|
|
43
|
+
constructor(snippet, params) {
|
|
44
|
+
this.snippet = snippet;
|
|
45
|
+
this.params = params;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A helper function to help create cells from Svelte components through ColumnDef's `cell` and `header` properties.
|
|
50
|
+
*
|
|
51
|
+
* This is only to be used with Svelte Components - use `renderSnippet` for Svelte Snippets.
|
|
52
|
+
*
|
|
53
|
+
* @param component A Svelte component
|
|
54
|
+
* @param props The props to pass to `component`
|
|
55
|
+
* @returns A `RenderComponentConfig` object that helps svelte-table know how to render the header/cell component.
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* // +page.svelte
|
|
59
|
+
* const defaultColumns = [
|
|
60
|
+
* columnHelper.accessor('name', {
|
|
61
|
+
* header: header => renderComponent(SortHeader, { label: 'Name', header }),
|
|
62
|
+
* }),
|
|
63
|
+
* columnHelper.accessor('state', {
|
|
64
|
+
* header: header => renderComponent(SortHeader, { label: 'State', header }),
|
|
65
|
+
* }),
|
|
66
|
+
* ]
|
|
67
|
+
* ```
|
|
68
|
+
* @see {@link https://tanstack.com/table/latest/docs/guide/column-defs}
|
|
69
|
+
*/
|
|
70
|
+
export function renderComponent(component, props = {}) {
|
|
71
|
+
return new RenderComponentConfig(component, props);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A helper function to help create cells from Svelte Snippets through ColumnDef's `cell` and `header` properties.
|
|
75
|
+
*
|
|
76
|
+
* The snippet must only take one parameter.
|
|
77
|
+
*
|
|
78
|
+
* This is only to be used with Snippets - use `renderComponent` for Svelte Components.
|
|
79
|
+
*
|
|
80
|
+
* @param snippet
|
|
81
|
+
* @param params
|
|
82
|
+
* @returns - A `RenderSnippetConfig` object that helps svelte-table know how to render the header/cell snippet.
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* // +page.svelte
|
|
86
|
+
* const defaultColumns = [
|
|
87
|
+
* columnHelper.accessor('name', {
|
|
88
|
+
* cell: cell => renderSnippet(nameSnippet, { name: cell.row.name }),
|
|
89
|
+
* }),
|
|
90
|
+
* columnHelper.accessor('state', {
|
|
91
|
+
* cell: cell => renderSnippet(stateSnippet, { state: cell.row.state }),
|
|
92
|
+
* }),
|
|
93
|
+
* ]
|
|
94
|
+
* ```
|
|
95
|
+
* @see {@link https://tanstack.com/table/latest/docs/guide/column-defs}
|
|
96
|
+
*/
|
|
97
|
+
export function renderSnippet(snippet, params = {}) {
|
|
98
|
+
return new RenderSnippetConfig(snippet, params);
|
|
99
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ColumnSizingState, ColumnSizingInfoState, ColumnOrderState, PaginationState, RowSelectionState, SortingState, VisibilityState } from '@tanstack/table-core';
|
|
2
|
+
import type { DataTableColumn } from './data-table-types.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import type { Row } from '@tanstack/table-core';
|
|
5
|
+
/**
|
|
6
|
+
* Build TanStack columns from configuration
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildColumns<TData>(columnConfig: DataTableColumn<TData>[], enableSelection: boolean, rowActionsSnippet: Snippet<[{
|
|
9
|
+
row: Row<TData>;
|
|
10
|
+
}]> | null, hasRowActions: boolean): any[];
|
|
11
|
+
interface TableSetupOptions<TData> {
|
|
12
|
+
enableSelection: boolean;
|
|
13
|
+
enablePagination: boolean;
|
|
14
|
+
manualPagination?: boolean;
|
|
15
|
+
manualSorting?: boolean;
|
|
16
|
+
pageCount?: number;
|
|
17
|
+
getRowCount?: () => number | undefined;
|
|
18
|
+
getData?: () => TData[];
|
|
19
|
+
getColumns?: () => any[];
|
|
20
|
+
getRowSelection: () => RowSelectionState;
|
|
21
|
+
getColumnVisibility: () => VisibilityState;
|
|
22
|
+
getSorting: () => SortingState;
|
|
23
|
+
getPagination: () => PaginationState;
|
|
24
|
+
getColumnSizing: () => ColumnSizingState;
|
|
25
|
+
getColumnSizingInfo: () => ColumnSizingInfoState;
|
|
26
|
+
getColumnOrder: () => ColumnOrderState;
|
|
27
|
+
setRowSelection: (value: RowSelectionState) => void;
|
|
28
|
+
setColumnVisibility: (value: VisibilityState) => void;
|
|
29
|
+
setSorting: (value: SortingState) => void;
|
|
30
|
+
setPagination: (value: PaginationState) => void;
|
|
31
|
+
setColumnSizing: (value: ColumnSizingState) => void;
|
|
32
|
+
setColumnSizingInfo: (value: ColumnSizingInfoState) => void;
|
|
33
|
+
setColumnOrder: (value: ColumnOrderState) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create the TanStack table instance with all configuration
|
|
37
|
+
*/
|
|
38
|
+
export declare function setupTable<TData>(options: TableSetupOptions<TData>): import("@tanstack/table-core").Table<TData>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { getCoreRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/table-core';
|
|
2
|
+
import { createSvelteTable } from './data-table-svelte.svelte.js';
|
|
3
|
+
import { createColumns } from './create-columns.js';
|
|
4
|
+
import { createSelectionColumn, createActionsColumn } from './column-definitions.js';
|
|
5
|
+
/**
|
|
6
|
+
* Build TanStack columns from configuration
|
|
7
|
+
*/
|
|
8
|
+
export function buildColumns(columnConfig, enableSelection, rowActionsSnippet, hasRowActions) {
|
|
9
|
+
const cols = [];
|
|
10
|
+
// Add selection column if enabled
|
|
11
|
+
if (enableSelection) {
|
|
12
|
+
cols.push(createSelectionColumn());
|
|
13
|
+
}
|
|
14
|
+
// Add user-defined columns
|
|
15
|
+
cols.push(...createColumns(columnConfig));
|
|
16
|
+
// Add actions column if row actions are defined
|
|
17
|
+
if (hasRowActions && rowActionsSnippet) {
|
|
18
|
+
cols.push(createActionsColumn(rowActionsSnippet));
|
|
19
|
+
}
|
|
20
|
+
return cols;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create state updater function
|
|
24
|
+
*/
|
|
25
|
+
function createStateUpdater(setState) {
|
|
26
|
+
return (updater) => {
|
|
27
|
+
setState(typeof updater === 'function' ? updater(undefined) : updater);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create the TanStack table instance with all configuration
|
|
32
|
+
*/
|
|
33
|
+
export function setupTable(options) {
|
|
34
|
+
const tableOptions = {
|
|
35
|
+
state: {
|
|
36
|
+
get sorting() {
|
|
37
|
+
return options.getSorting();
|
|
38
|
+
},
|
|
39
|
+
get columnVisibility() {
|
|
40
|
+
return options.getColumnVisibility();
|
|
41
|
+
},
|
|
42
|
+
get rowSelection() {
|
|
43
|
+
return options.getRowSelection();
|
|
44
|
+
},
|
|
45
|
+
get pagination() {
|
|
46
|
+
return options.getPagination();
|
|
47
|
+
},
|
|
48
|
+
get columnSizing() {
|
|
49
|
+
return options.getColumnSizing();
|
|
50
|
+
},
|
|
51
|
+
get columnSizingInfo() {
|
|
52
|
+
return options.getColumnSizingInfo();
|
|
53
|
+
},
|
|
54
|
+
get columnOrder() {
|
|
55
|
+
return options.getColumnOrder();
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
get data() {
|
|
59
|
+
return options.getData?.() ?? [];
|
|
60
|
+
},
|
|
61
|
+
get columns() {
|
|
62
|
+
return options.getColumns?.() ?? [];
|
|
63
|
+
},
|
|
64
|
+
enableRowSelection: options.enableSelection,
|
|
65
|
+
enableColumnResizing: true,
|
|
66
|
+
columnResizeMode: 'onChange',
|
|
67
|
+
columnResizeDirection: 'ltr',
|
|
68
|
+
onRowSelectionChange: (updater) => {
|
|
69
|
+
if (typeof updater === 'function') {
|
|
70
|
+
options.setRowSelection(updater(options.getRowSelection()));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
options.setRowSelection(updater);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
onSortingChange: (updater) => {
|
|
77
|
+
if (typeof updater === 'function') {
|
|
78
|
+
options.setSorting(updater(options.getSorting()));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
options.setSorting(updater);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
onColumnVisibilityChange: (updater) => {
|
|
85
|
+
if (typeof updater === 'function') {
|
|
86
|
+
options.setColumnVisibility(updater(options.getColumnVisibility()));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
options.setColumnVisibility(updater);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
onPaginationChange: (updater) => {
|
|
93
|
+
if (typeof updater === 'function') {
|
|
94
|
+
options.setPagination(updater(options.getPagination()));
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
options.setPagination(updater);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
onColumnSizingChange: (updater) => {
|
|
101
|
+
if (typeof updater === 'function') {
|
|
102
|
+
options.setColumnSizing(updater(options.getColumnSizing()));
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
options.setColumnSizing(updater);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
onColumnSizingInfoChange: (updater) => {
|
|
109
|
+
if (typeof updater === 'function') {
|
|
110
|
+
options.setColumnSizingInfo(updater(options.getColumnSizingInfo()));
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
options.setColumnSizingInfo(updater);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
onColumnOrderChange: (updater) => {
|
|
117
|
+
if (typeof updater === 'function') {
|
|
118
|
+
options.setColumnOrder(updater(options.getColumnOrder()));
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
options.setColumnOrder(updater);
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
getCoreRowModel: getCoreRowModel(),
|
|
125
|
+
getPaginationRowModel: options.enablePagination && !options.manualPagination ? getPaginationRowModel() : undefined,
|
|
126
|
+
getSortedRowModel: !options.manualSorting ? getSortedRowModel() : undefined,
|
|
127
|
+
// Manual pagination configuration
|
|
128
|
+
manualPagination: options.manualPagination,
|
|
129
|
+
// Manual sorting configuration
|
|
130
|
+
manualSorting: options.manualSorting
|
|
131
|
+
};
|
|
132
|
+
// Only provide pageCount/rowCount for manual pagination
|
|
133
|
+
// When manualPagination is false, TanStack Table calculates it automatically
|
|
134
|
+
if (options.manualPagination) {
|
|
135
|
+
Object.assign(tableOptions, {
|
|
136
|
+
get pageCount() {
|
|
137
|
+
// Calculate pageCount from rowCount and current pageSize
|
|
138
|
+
const rowCount = options.getRowCount?.();
|
|
139
|
+
if (rowCount !== undefined) {
|
|
140
|
+
const pageSize = options.getPagination().pageSize;
|
|
141
|
+
return Math.ceil(rowCount / pageSize);
|
|
142
|
+
}
|
|
143
|
+
return options.pageCount ?? -1;
|
|
144
|
+
},
|
|
145
|
+
get rowCount() {
|
|
146
|
+
return options.getRowCount?.();
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return createSvelteTable(tableOptions);
|
|
151
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Header, Cell } from '@tanstack/table-core';
|
|
2
|
+
/**
|
|
3
|
+
* Calculate inline styles for table headers
|
|
4
|
+
*/
|
|
5
|
+
export declare function getHeaderStyle<TData>(header: Header<TData, unknown>, isLastScrollable: boolean, isFrozen?: boolean, leftOffset?: number): string;
|
|
6
|
+
/**
|
|
7
|
+
* Calculate CSS classes for table headers
|
|
8
|
+
*/
|
|
9
|
+
export declare function getHeaderClasses<TData>(header: Header<TData, unknown>, isLastScrollable: boolean, isFirstHeader?: boolean, isLastHeader?: boolean, isFrozen?: boolean, isLastFrozen?: boolean): string;
|
|
10
|
+
/**
|
|
11
|
+
* Calculate inline styles for table cells
|
|
12
|
+
*/
|
|
13
|
+
export declare function getCellStyle<TData>(cell: Cell<TData, unknown>, isLastScrollable: boolean, isFrozen?: boolean, leftOffset?: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Calculate CSS classes for table cells
|
|
16
|
+
*/
|
|
17
|
+
export declare function getCellClasses<TData>(cell: Cell<TData, unknown>, isLastScrollable: boolean, isFirstDataColumn?: boolean, isFirstCell?: boolean, isLastCell?: boolean, isFrozen?: boolean): string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
/**
|
|
3
|
+
* Calculate inline styles for table headers
|
|
4
|
+
*/
|
|
5
|
+
export function getHeaderStyle(header, isLastScrollable, isFrozen = false, leftOffset = 0) {
|
|
6
|
+
const size = header.getSize();
|
|
7
|
+
if (header.id === 'actions' || header.id === 'select') {
|
|
8
|
+
return `width: ${size}px; min-width: ${size}px; max-width: ${size}px;`;
|
|
9
|
+
}
|
|
10
|
+
if (isFrozen) {
|
|
11
|
+
return `min-width: ${size}px; max-width: ${size}px; left: ${leftOffset}px;`;
|
|
12
|
+
}
|
|
13
|
+
if (isLastScrollable) {
|
|
14
|
+
return `min-width: ${size}px;`;
|
|
15
|
+
}
|
|
16
|
+
return `min-width: ${size}px; max-width: ${size}px;`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Calculate CSS classes for table headers
|
|
20
|
+
*/
|
|
21
|
+
export function getHeaderClasses(header, isLastScrollable, isFirstHeader = false, isLastHeader = false, isFrozen = false, isLastFrozen = false) {
|
|
22
|
+
const isSticky = header.id === 'actions' || header.id === 'select' || isFrozen;
|
|
23
|
+
const isResizable = header.column.getCanResize();
|
|
24
|
+
return clsx('relative whitespace-nowrap overflow-hidden before:content-[""] before:absolute before:inset-x-0 before:top-0 before:h-px before:bg-border', {
|
|
25
|
+
'sticky right-0 text-right bg-background before:z-20': header.id === 'actions',
|
|
26
|
+
'sticky left-0 bg-background z-10 before:z-20': header.id === 'select' || isFrozen,
|
|
27
|
+
'z-0': !isSticky,
|
|
28
|
+
'after:content-[""] after:absolute after:right-0 after:top-1/2 after:-translate-y-1/2 after:h-4 after:w-px after:bg-background-default-tertiary after:z-20': isResizable && (header.id !== 'actions' && header.id !== 'select') && !isLastFrozen,
|
|
29
|
+
'w-full': isLastScrollable,
|
|
30
|
+
'!pr-4': isLastHeader && !isSticky,
|
|
31
|
+
'px-3': isSticky,
|
|
32
|
+
'pl-4': isSticky && isFirstHeader,
|
|
33
|
+
'pr-4': isSticky && isLastHeader
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Calculate inline styles for table cells
|
|
38
|
+
*/
|
|
39
|
+
export function getCellStyle(cell, isLastScrollable, isFrozen = false, leftOffset = 0) {
|
|
40
|
+
const size = cell.column.getSize();
|
|
41
|
+
if (cell.column.id === 'actions' || cell.column.id === 'select') {
|
|
42
|
+
return `width: ${size}px; min-width: ${size}px; max-width: ${size}px;`;
|
|
43
|
+
}
|
|
44
|
+
if (isFrozen) {
|
|
45
|
+
return `min-width: ${size}px; max-width: ${size}px; left: ${leftOffset}px;`;
|
|
46
|
+
}
|
|
47
|
+
if (isLastScrollable) {
|
|
48
|
+
return `min-width: ${size}px;`;
|
|
49
|
+
}
|
|
50
|
+
return `min-width: ${size}px; max-width: ${size}px;`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Calculate CSS classes for table cells
|
|
54
|
+
*/
|
|
55
|
+
export function getCellClasses(cell, isLastScrollable, isFirstDataColumn = false, isFirstCell = false, isLastCell = false, isFrozen = false) {
|
|
56
|
+
const isSticky = cell.column.id === 'actions' || cell.column.id === 'select' || isFrozen;
|
|
57
|
+
const isCurrency = cell.column.columnDef.meta?.cellType === 'currency';
|
|
58
|
+
return clsx('whitespace-nowrap overflow-hidden', {
|
|
59
|
+
'sticky right-0 text-right': cell.column.id === 'actions',
|
|
60
|
+
'sticky left-0 z-10': cell.column.id === 'select' || isFrozen,
|
|
61
|
+
'z-0': !isSticky,
|
|
62
|
+
'bg-background': isSticky,
|
|
63
|
+
'!p-0': isSticky,
|
|
64
|
+
'w-full': isLastScrollable,
|
|
65
|
+
'font-medium': isFirstDataColumn,
|
|
66
|
+
'!pl-4': isFirstCell && !isSticky,
|
|
67
|
+
'!pr-4': isLastCell && !isSticky,
|
|
68
|
+
'text-right': isCurrency
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
2
|
+
export type DndItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
locked?: boolean;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
export type DropIndicatorState = {
|
|
8
|
+
itemId: string;
|
|
9
|
+
edge: Edge;
|
|
10
|
+
} | null;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if dropping an item would result in no position change
|
|
13
|
+
* (i.e., dropping right next to its current position)
|
|
14
|
+
*/
|
|
15
|
+
export declare function shouldShowDropIndicator(sourceId: string, targetId: string, sourceGroup: string, targetGroup: string, edge: Edge, items: DndItem[]): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Calculates the new index where a dragged item should be inserted
|
|
18
|
+
*/
|
|
19
|
+
export declare function calculateInsertIndex(sourceIndex: number, targetIndex: number, edge: Edge): number;
|
|
20
|
+
/**
|
|
21
|
+
* Reorders items within the same group
|
|
22
|
+
*/
|
|
23
|
+
export declare function reorderItems<T extends DndItem>(items: T[], sourceId: string, targetId: string, edge: Edge): T[];
|
|
24
|
+
/**
|
|
25
|
+
* Moves an item from one group to another
|
|
26
|
+
*/
|
|
27
|
+
export declare function moveItemBetweenGroups<T extends DndItem>(sourceItems: T[], targetItems: T[], sourceId: string, targetId?: string, edge?: Edge): {
|
|
28
|
+
newSourceItems: T[];
|
|
29
|
+
newTargetItems: T[];
|
|
30
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if dropping an item would result in no position change
|
|
3
|
+
* (i.e., dropping right next to its current position)
|
|
4
|
+
*/
|
|
5
|
+
export function shouldShowDropIndicator(sourceId, targetId, sourceGroup, targetGroup, edge, items) {
|
|
6
|
+
// Always show for cross-group drops
|
|
7
|
+
if (sourceGroup !== targetGroup) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
// Check if dropping would result in no position change
|
|
11
|
+
const sourceIndex = items.findIndex((item) => item.id === sourceId);
|
|
12
|
+
const targetIndex = items.findIndex((item) => item.id === targetId);
|
|
13
|
+
// Don't show indicator if dropping adjacent to current position
|
|
14
|
+
const isAdjacentTop = edge === 'top' && targetIndex === sourceIndex + 1;
|
|
15
|
+
const isAdjacentBottom = edge === 'bottom' && targetIndex === sourceIndex - 1;
|
|
16
|
+
return !isAdjacentTop && !isAdjacentBottom;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Calculates the new index where a dragged item should be inserted
|
|
20
|
+
*/
|
|
21
|
+
export function calculateInsertIndex(sourceIndex, targetIndex, edge) {
|
|
22
|
+
let insertIndex = targetIndex;
|
|
23
|
+
// Adjust target index if source was before target (array shifts after removal)
|
|
24
|
+
if (sourceIndex < targetIndex) {
|
|
25
|
+
insertIndex = targetIndex - 1;
|
|
26
|
+
}
|
|
27
|
+
// If dropping on bottom edge, insert after
|
|
28
|
+
if (edge === 'bottom') {
|
|
29
|
+
insertIndex = insertIndex + 1;
|
|
30
|
+
}
|
|
31
|
+
return insertIndex;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Reorders items within the same group
|
|
35
|
+
*/
|
|
36
|
+
export function reorderItems(items, sourceId, targetId, edge) {
|
|
37
|
+
const sourceIndex = items.findIndex((item) => item.id === sourceId);
|
|
38
|
+
const targetIndex = items.findIndex((item) => item.id === targetId);
|
|
39
|
+
if (sourceIndex === -1 || targetIndex === -1) {
|
|
40
|
+
return items;
|
|
41
|
+
}
|
|
42
|
+
const newItems = [...items];
|
|
43
|
+
const [draggedItem] = newItems.splice(sourceIndex, 1);
|
|
44
|
+
const insertIndex = calculateInsertIndex(sourceIndex, targetIndex, edge);
|
|
45
|
+
newItems.splice(insertIndex, 0, draggedItem);
|
|
46
|
+
return newItems;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Moves an item from one group to another
|
|
50
|
+
*/
|
|
51
|
+
export function moveItemBetweenGroups(sourceItems, targetItems, sourceId, targetId, edge) {
|
|
52
|
+
const draggedItem = sourceItems.find((item) => item.id === sourceId);
|
|
53
|
+
if (!draggedItem) {
|
|
54
|
+
return { newSourceItems: sourceItems, newTargetItems: targetItems };
|
|
55
|
+
}
|
|
56
|
+
const newSourceItems = sourceItems.filter((item) => item.id !== sourceId);
|
|
57
|
+
// If no target specified, append to end
|
|
58
|
+
if (!targetId || !edge) {
|
|
59
|
+
const newTargetItems = [...targetItems, draggedItem];
|
|
60
|
+
return { newSourceItems, newTargetItems };
|
|
61
|
+
}
|
|
62
|
+
// Insert at specific position based on target and edge
|
|
63
|
+
const targetIndex = targetItems.findIndex((item) => item.id === targetId);
|
|
64
|
+
if (targetIndex === -1) {
|
|
65
|
+
const newTargetItems = [...targetItems, draggedItem];
|
|
66
|
+
return { newSourceItems, newTargetItems };
|
|
67
|
+
}
|
|
68
|
+
const newTargetItems = [...targetItems];
|
|
69
|
+
const insertIndex = edge === 'bottom' ? targetIndex + 1 : targetIndex;
|
|
70
|
+
newTargetItems.splice(insertIndex, 0, draggedItem);
|
|
71
|
+
return { newSourceItems, newTargetItems };
|
|
72
|
+
}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { IconSource } from '@steeze-ui/svelte-icon';
|
|
|
2
2
|
import type { DatesFromToday, FeedItemStatus } from './types.js';
|
|
3
3
|
import { type DateValue } from '@internationalized/date';
|
|
4
4
|
export declare function toPascalCase(text: string): string;
|
|
5
|
+
export declare function capitalize(text: string): string;
|
|
5
6
|
export declare function resolveIcon(icon?: IconSource | string | undefined): Promise<IconSource | undefined>;
|
|
6
7
|
export declare function getCountryName(code: string): string | undefined;
|
|
7
8
|
export declare function getStatusType(status: string): FeedItemStatus;
|
package/dist/helpers.js
CHANGED
|
@@ -3,6 +3,9 @@ import { startOfWeek, endOfWeek, subWeeks, endOfMonth, startOfMonth, subMonths,
|
|
|
3
3
|
export function toPascalCase(text) {
|
|
4
4
|
return text.replace(/(^\w|-\w)/g, (text) => text.replace(/-/, '').toUpperCase());
|
|
5
5
|
}
|
|
6
|
+
export function capitalize(text) {
|
|
7
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
8
|
+
}
|
|
6
9
|
export async function resolveIcon(icon = undefined) {
|
|
7
10
|
if (!icon)
|
|
8
11
|
return undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,10 @@ import BaseCard from './BaseCard.svelte';
|
|
|
4
4
|
import BaseCounter from './BaseCounter.svelte';
|
|
5
5
|
import BaseDropdown from './BaseDropdown.svelte';
|
|
6
6
|
import BaseFlag from './BaseFlag.svelte';
|
|
7
|
-
import BaseTable from './BaseTable.svelte';
|
|
8
7
|
import BaseTableActions from './BaseTableActions.svelte';
|
|
9
|
-
import BaseTableHeaderContent from './BaseTableHeaderContent.svelte';
|
|
10
8
|
import Breadcrumbs from './Breadcrumbs.svelte';
|
|
11
9
|
import ButtonFile from './ButtonFile.svelte';
|
|
10
|
+
import ButtonSearch from './ButtonSearch.svelte';
|
|
12
11
|
import ButtonUuidCopy from './ButtonUuidCopy.svelte';
|
|
13
12
|
import CardCheckbox from './CardCheckbox.svelte';
|
|
14
13
|
import CardRelation from './CardRelation.svelte';
|
|
@@ -20,6 +19,7 @@ import DrawerContext from './DrawerContext.svelte';
|
|
|
20
19
|
import DrawerContextItem from './DrawerContextItem.svelte';
|
|
21
20
|
import DrawerContextSeparator from './DrawerContextSeparator.svelte';
|
|
22
21
|
import DropdownSelect from './DropdownSelect.svelte';
|
|
22
|
+
import DropdownSelectGroup from './DropdownSelectGroup.svelte';
|
|
23
23
|
import EmptyState from './EmptyState.svelte';
|
|
24
24
|
import FeedEvents from './FeedEvents.svelte';
|
|
25
25
|
import FeedIconEvent from './FeedIconEvent.svelte';
|
|
@@ -45,7 +45,12 @@ import ProgressBar from './ProgressBar.svelte';
|
|
|
45
45
|
import ProgressBarCircle from './ProgressBarCircle.svelte';
|
|
46
46
|
import SeparatorHorizontal from './SeparatorHorizontal.svelte';
|
|
47
47
|
import ShortcutWrapper from './ShortcutWrapper.svelte';
|
|
48
|
+
import { Skeleton } from './skeleton';
|
|
49
|
+
import { SkeletonAvatar } from './skeleton';
|
|
50
|
+
import { SkeletonCard } from './skeleton';
|
|
51
|
+
import { SkeletonList } from './skeleton';
|
|
48
52
|
import StatusLabel from './StatusLabel.svelte';
|
|
53
|
+
import StepIcon from './StepIcon.svelte';
|
|
49
54
|
import StepIconList from './StepIconList.svelte';
|
|
50
55
|
import { Table } from './table';
|
|
51
56
|
import { TableBody } from './table';
|
|
@@ -74,4 +79,11 @@ import { resolveIcon } from './helpers.js';
|
|
|
74
79
|
import { getCountryName } from './helpers.js';
|
|
75
80
|
import { getStatusType } from './helpers.js';
|
|
76
81
|
import { buttonVariants } from './button/button.svelte';
|
|
77
|
-
|
|
82
|
+
import { DataTable } from './data-table';
|
|
83
|
+
import { DataTableToolbar } from './data-table';
|
|
84
|
+
import { DataTableViewOptions } from './data-table';
|
|
85
|
+
import { FlexRender } from './data-table';
|
|
86
|
+
import { createSvelteTable } from './data-table';
|
|
87
|
+
import { renderComponent } from './data-table';
|
|
88
|
+
import { renderSnippet } from './data-table';
|
|
89
|
+
export { AlertDialog, BaseButton, BaseCard, BaseCounter, BaseDropdown, BaseFlag, BaseTableActions, Breadcrumbs, ButtonFile, ButtonSearch, ButtonUuidCopy, CardCheckbox, CardRelation, CompanySelector, CounterWidget, DataListItem, DatePicker, DrawerContext, DrawerContextItem, DrawerContextSeparator, DropdownSelect, DropdownSelectGroup, EmptyState, FeedEvents, FeedIconEvent, FeedIconStatus, FeedItem, FeedItemDetail, FeedViewer, GlobalSearch, InputCheckbox, InputError, InputLabel, InputRadio, InputSearch, InputSelect, InputText, InputTextarea, InputToggle, MenuItem, MenuItemCollapsible, Notification, ProfileAvatar, ProgressBar, ProgressBarCircle, SeparatorHorizontal, ShortcutWrapper, Skeleton, SkeletonAvatar, SkeletonCard, SkeletonList, StatusLabel, StepIcon, StepIconList, Table, TableBody, TableCaption, TableFooter, TableHeader, TableRow, TableHead, TableCell, Tabs, TabsContent, TabsList, TabsTrigger, TagBeta, TagProgress, TagSearch, TagStatus, TitleMain, TitleSection, Toaster, Tooltip, TooltipContent, TooltipTrigger, UuidCopy, resolveIcon, getCountryName, getStatusType, buttonVariants, DataTable, DataTableToolbar, DataTableViewOptions, FlexRender, createSvelteTable, renderComponent, renderSnippet };
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,10 @@ import BaseCard from './BaseCard.svelte'
|
|
|
4
4
|
import BaseCounter from './BaseCounter.svelte'
|
|
5
5
|
import BaseDropdown from './BaseDropdown.svelte'
|
|
6
6
|
import BaseFlag from './BaseFlag.svelte'
|
|
7
|
-
import BaseTable from './BaseTable.svelte'
|
|
8
7
|
import BaseTableActions from './BaseTableActions.svelte'
|
|
9
|
-
import BaseTableHeaderContent from './BaseTableHeaderContent.svelte'
|
|
10
8
|
import Breadcrumbs from './Breadcrumbs.svelte'
|
|
11
9
|
import ButtonFile from './ButtonFile.svelte'
|
|
10
|
+
import ButtonSearch from './ButtonSearch.svelte'
|
|
12
11
|
import ButtonUuidCopy from './ButtonUuidCopy.svelte'
|
|
13
12
|
import CardCheckbox from './CardCheckbox.svelte'
|
|
14
13
|
import CardRelation from './CardRelation.svelte'
|
|
@@ -20,6 +19,7 @@ import DrawerContext from './DrawerContext.svelte'
|
|
|
20
19
|
import DrawerContextItem from './DrawerContextItem.svelte'
|
|
21
20
|
import DrawerContextSeparator from './DrawerContextSeparator.svelte'
|
|
22
21
|
import DropdownSelect from './DropdownSelect.svelte'
|
|
22
|
+
import DropdownSelectGroup from './DropdownSelectGroup.svelte'
|
|
23
23
|
import EmptyState from './EmptyState.svelte'
|
|
24
24
|
import FeedEvents from './FeedEvents.svelte'
|
|
25
25
|
import FeedIconEvent from './FeedIconEvent.svelte'
|
|
@@ -45,7 +45,9 @@ import ProgressBar from './ProgressBar.svelte'
|
|
|
45
45
|
import ProgressBarCircle from './ProgressBarCircle.svelte'
|
|
46
46
|
import SeparatorHorizontal from './SeparatorHorizontal.svelte'
|
|
47
47
|
import ShortcutWrapper from './ShortcutWrapper.svelte'
|
|
48
|
+
import { Skeleton, SkeletonAvatar, SkeletonCard, SkeletonList } from './skeleton'
|
|
48
49
|
import StatusLabel from './StatusLabel.svelte'
|
|
50
|
+
import StepIcon from './StepIcon.svelte'
|
|
49
51
|
import StepIconList from './StepIconList.svelte'
|
|
50
52
|
import {
|
|
51
53
|
Table,
|
|
@@ -69,6 +71,15 @@ import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip'
|
|
|
69
71
|
import UuidCopy from './UuidCopy.svelte'
|
|
70
72
|
import { resolveIcon, getCountryName, getStatusType } from './helpers.js'
|
|
71
73
|
import { buttonVariants } from './button/button.svelte' // Ensure button styles are included
|
|
74
|
+
import {
|
|
75
|
+
DataTable,
|
|
76
|
+
DataTableToolbar,
|
|
77
|
+
DataTableViewOptions,
|
|
78
|
+
FlexRender,
|
|
79
|
+
createSvelteTable,
|
|
80
|
+
renderComponent,
|
|
81
|
+
renderSnippet
|
|
82
|
+
} from './data-table'
|
|
72
83
|
|
|
73
84
|
export {
|
|
74
85
|
AlertDialog,
|
|
@@ -77,11 +88,10 @@ export {
|
|
|
77
88
|
BaseCounter,
|
|
78
89
|
BaseDropdown,
|
|
79
90
|
BaseFlag,
|
|
80
|
-
BaseTable,
|
|
81
91
|
BaseTableActions,
|
|
82
|
-
BaseTableHeaderContent,
|
|
83
92
|
Breadcrumbs,
|
|
84
93
|
ButtonFile,
|
|
94
|
+
ButtonSearch,
|
|
85
95
|
ButtonUuidCopy,
|
|
86
96
|
CardCheckbox,
|
|
87
97
|
CardRelation,
|
|
@@ -93,6 +103,7 @@ export {
|
|
|
93
103
|
DrawerContextItem,
|
|
94
104
|
DrawerContextSeparator,
|
|
95
105
|
DropdownSelect,
|
|
106
|
+
DropdownSelectGroup,
|
|
96
107
|
EmptyState,
|
|
97
108
|
FeedEvents,
|
|
98
109
|
FeedIconEvent,
|
|
@@ -118,7 +129,12 @@ export {
|
|
|
118
129
|
ProgressBarCircle,
|
|
119
130
|
SeparatorHorizontal,
|
|
120
131
|
ShortcutWrapper,
|
|
132
|
+
Skeleton,
|
|
133
|
+
SkeletonAvatar,
|
|
134
|
+
SkeletonCard,
|
|
135
|
+
SkeletonList,
|
|
121
136
|
StatusLabel,
|
|
137
|
+
StepIcon,
|
|
122
138
|
StepIconList,
|
|
123
139
|
Table,
|
|
124
140
|
TableBody,
|
|
@@ -146,5 +162,12 @@ export {
|
|
|
146
162
|
resolveIcon,
|
|
147
163
|
getCountryName,
|
|
148
164
|
getStatusType,
|
|
149
|
-
buttonVariants
|
|
165
|
+
buttonVariants,
|
|
166
|
+
DataTable,
|
|
167
|
+
DataTableToolbar,
|
|
168
|
+
DataTableViewOptions,
|
|
169
|
+
FlexRender,
|
|
170
|
+
createSvelteTable,
|
|
171
|
+
renderComponent,
|
|
172
|
+
renderSnippet
|
|
150
173
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Root from './skeleton.svelte';
|
|
2
|
+
import SkeletonAvatar from './skeleton-avatar.svelte';
|
|
3
|
+
import SkeletonCard from './skeleton-card.svelte';
|
|
4
|
+
import SkeletonList from './skeleton-list.svelte';
|
|
5
|
+
export { Root, Root as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonList };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Root from './skeleton.svelte';
|
|
2
|
+
import SkeletonAvatar from './skeleton-avatar.svelte';
|
|
3
|
+
import SkeletonCard from './skeleton-card.svelte';
|
|
4
|
+
import SkeletonList from './skeleton-list.svelte';
|
|
5
|
+
export { Root,
|
|
6
|
+
//
|
|
7
|
+
Root as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonList };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../utils'
|
|
3
|
+
import Skeleton from './skeleton.svelte'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
class: className = '',
|
|
7
|
+
size = 48
|
|
8
|
+
}: {
|
|
9
|
+
class?: string
|
|
10
|
+
size?: number
|
|
11
|
+
} = $props()
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Skeleton class={cn('rounded-lg flex-shrink-0', className)} style="height: {size}px; width: {size}px" />
|