schummar-table 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/index.cjs +220 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +220 -14
- package/dist/index.js.map +1 -1
- package/dist/mantineTheme.cjs +1 -1
- package/dist/mantineTheme.d.cts +1 -1
- package/dist/mantineTheme.d.ts +1 -1
- package/dist/mantineTheme.js +1 -1
- package/dist/mui4Theme.d.cts +1 -1
- package/dist/mui4Theme.d.ts +1 -1
- package/dist/mui5Theme.d.cts +1 -1
- package/dist/mui5Theme.d.ts +1 -1
- package/dist/{types-Dlq59yQq.d.ts → types-13m4fK5g.d.ts} +24 -2
- package/dist/{types-CWF6E2Xg.d.cts → types-DCfeZ6qS.d.cts} +24 -2
- package/dist/{useTheme-B2ejsCOL.js → useTheme-C4YfOu-U.js} +10 -3
- package/dist/{useTheme-B2ejsCOL.js.map → useTheme-C4YfOu-U.js.map} +1 -1
- package/dist/{useTheme-BrKiZfIC.cjs → useTheme-DLbyOgz7.cjs} +10 -3
- package/dist/{useTheme-BrKiZfIC.cjs.map → useTheme-DLbyOgz7.cjs.map} +1 -1
- package/package.json +1 -1
- package/skills/schummar-table-upgrade/SKILL.md +7 -7
package/dist/mantineTheme.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_tableTheme = require("./tableTheme-CsTWp3yn.cjs");
|
|
3
|
-
const require_useTheme = require("./useTheme-
|
|
3
|
+
const require_useTheme = require("./useTheme-DLbyOgz7.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
|
|
6
6
|
let _mantine_core = require("@mantine/core");
|
package/dist/mantineTheme.d.cts
CHANGED
package/dist/mantineTheme.d.ts
CHANGED
package/dist/mantineTheme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as TableSettingsProvider, n as Popover, t as mergeThemes } from "./tableTheme-BgaqIBux.js";
|
|
2
|
-
import { C as endOfDay, M as useCssVariables, S as dateIntersect, v as DatePickerQuickOptions } from "./useTheme-
|
|
2
|
+
import { C as endOfDay, M as useCssVariables, S as dateIntersect, v as DatePickerQuickOptions } from "./useTheme-C4YfOu-U.js";
|
|
3
3
|
import { useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
5
5
|
import { ActionIcon, Button, Checkbox, Indicator, Loader, TextInput } from "@mantine/core";
|
package/dist/mui4Theme.d.cts
CHANGED
package/dist/mui4Theme.d.ts
CHANGED
package/dist/mui5Theme.d.cts
CHANGED
package/dist/mui5Theme.d.ts
CHANGED
|
@@ -98,7 +98,7 @@ declare function DatePickerQuickOptions({ onSelect, ...props }: DatePickerProps
|
|
|
98
98
|
declare function DefaultDatePicker(props: DatePickerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/state/persistence.d.ts
|
|
101
|
-
declare const PERSIST_KEYS: readonly ['sort', 'selection', 'expanded', 'hiddenColumns', 'filterValues', 'columnWidths'];
|
|
101
|
+
declare const PERSIST_KEYS: readonly ['sort', 'selection', 'expanded', 'hiddenColumns', 'columnOrder', 'filterValues', 'columnWidths'];
|
|
102
102
|
type PersistKey = (typeof PERSIST_KEYS)[number];
|
|
103
103
|
type TableStateStorage = {
|
|
104
104
|
getItem: (key: string) => string | null | Promise<string | null>;
|
|
@@ -158,6 +158,8 @@ interface TableTheme<TItem = unknown> {
|
|
|
158
158
|
rangeMax: ReactNode;
|
|
159
159
|
calendarWeek: ReactNode;
|
|
160
160
|
hiddenColumnFilters: ReactNode;
|
|
161
|
+
moveColumnLeft: string;
|
|
162
|
+
moveColumnRight: string;
|
|
161
163
|
};
|
|
162
164
|
/** Define styles. */
|
|
163
165
|
classes?: {
|
|
@@ -200,6 +202,8 @@ interface TableTheme<TItem = unknown> {
|
|
|
200
202
|
onContextMenu?: (event: React.MouseEvent<Element>) => void;
|
|
201
203
|
className?: string;
|
|
202
204
|
type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
205
|
+
disabled?: boolean;
|
|
206
|
+
'aria-label'?: string;
|
|
203
207
|
}>;
|
|
204
208
|
Button: ComponentType<{
|
|
205
209
|
children: ReactNode;
|
|
@@ -352,6 +356,13 @@ interface TableProps<TItem> extends PartialTableTheme<TItem> {
|
|
|
352
356
|
hiddenColumns?: Set<Id>;
|
|
353
357
|
/** Called when hidden columns change. */
|
|
354
358
|
onHiddenColumnsChange?: (hiddenColumns: Set<Id>) => void;
|
|
359
|
+
/** Default column order, by column id. Columns missing from it keep their place relative to the
|
|
360
|
+
* column defined before them. */
|
|
361
|
+
defaultColumnOrder?: Id[];
|
|
362
|
+
/** If given, controls the column order. */
|
|
363
|
+
columnOrder?: Id[];
|
|
364
|
+
/** Called when the column order changes, with the ids of all columns. */
|
|
365
|
+
onColumnOrderChange?: (columnOrder: Id[]) => void;
|
|
355
366
|
/** Default filter values by column id. Columns without an entry use their filter's `defaultValue`. */
|
|
356
367
|
defaultFilterValues?: Map<Id, unknown>;
|
|
357
368
|
/** If given, controls filter values. Columns without an entry use their filter's `defaultValue`;
|
|
@@ -418,6 +429,10 @@ interface TableProps<TItem> extends PartialTableTheme<TItem> {
|
|
|
418
429
|
* @default true
|
|
419
430
|
*/
|
|
420
431
|
enableColumnResize?: boolean | 'visualOnly';
|
|
432
|
+
/** Allow to reorder columns by dragging their headers and from the column selection menu.
|
|
433
|
+
* @default true
|
|
434
|
+
*/
|
|
435
|
+
enableColumnReorder?: boolean;
|
|
421
436
|
/** If enabled, automatically store table state in localStorage, localForage or another compatible storage. */
|
|
422
437
|
persist?: {
|
|
423
438
|
storage: TableStateStorage;
|
|
@@ -459,6 +474,8 @@ interface TableRef {
|
|
|
459
474
|
setExpanded: (expanded: Set<Id>) => void;
|
|
460
475
|
getHiddenColumns: () => Set<Id>;
|
|
461
476
|
setHiddenColumns: (hidden: Set<Id>) => void;
|
|
477
|
+
getColumnOrder: () => Id[];
|
|
478
|
+
setColumnOrder: (columnOrder: Id[]) => void;
|
|
462
479
|
getFilterValues: () => Map<Id, unknown>;
|
|
463
480
|
setFilterValues: (filterValues: Map<Id, unknown>) => void;
|
|
464
481
|
}
|
|
@@ -530,6 +547,8 @@ interface TableState<TItem> {
|
|
|
530
547
|
selection: Set<Id>;
|
|
531
548
|
expanded: Set<Id>;
|
|
532
549
|
hiddenColumns: Set<Id>;
|
|
550
|
+
/** Ids of all columns, in display order. */
|
|
551
|
+
columnOrder: Id[];
|
|
533
552
|
columnWidths: Map<Id, string>;
|
|
534
553
|
/** Filter values by column id, defaults included. Hidden columns keep theirs. */
|
|
535
554
|
filterValues: Map<Id, unknown>;
|
|
@@ -559,6 +578,9 @@ interface TableActions<TItem = unknown> {
|
|
|
559
578
|
setExpanded: (expanded: Set<Id>) => void;
|
|
560
579
|
toggleExpanded: (itemId: Id) => void;
|
|
561
580
|
setHiddenColumns: (hiddenColumns: Set<Id>) => void;
|
|
581
|
+
setColumnOrder: (columnOrder: Id[]) => void;
|
|
582
|
+
/** Moves a column to the position of `targetId`, shifting the columns in between. */
|
|
583
|
+
moveColumn: (columnId: Id, targetId: Id) => void;
|
|
562
584
|
setColumnWidth: (columnId: Id, width: string | undefined) => void;
|
|
563
585
|
setFilterValues: (filterValues: Map<Id, unknown>) => void;
|
|
564
586
|
setFilterValue: (columnId: Id, value: unknown) => void;
|
|
@@ -620,4 +642,4 @@ interface Filter<TInput, TState = any, TOptions = any> extends FilterOptions<TSt
|
|
|
620
642
|
}
|
|
621
643
|
//#endregion
|
|
622
644
|
export { DateRange as A, thisWeek as B, TableStateStorage as C, DatePickerProvider as D, DatePickerProps as E, endOfDay as F, today as H, getCalendarWeek as I, lastDays as L, commonQuickOptions as M, dateClamp as N, DatePickerQuickOption as O, dateIntersect as P, startOfDay as R, WrapRowProps as S, DatePickerChangeSource as T, thisYear as V, TableProps as _, FilterComponentProps as a, TableStructure as b, InternalColumn as c, SingleOrMultiple as d, Sort as f, TableItem as g, TableContextValue as h, Filter as i, DefaultDatePicker as j, DatePickerQuickOptions as k, PartialTableTheme as l, TableActions as m, ColumnFactory as n, FilterOptions as o, SortDirection as p, ColumnGenerator as r, Id as s, Column as t, SingleOf as u, TableRef as v, DatePicker as w, TableTheme as x, TableState as y, thisMonth as z };
|
|
623
|
-
//# sourceMappingURL=types-
|
|
645
|
+
//# sourceMappingURL=types-13m4fK5g.d.ts.map
|
|
@@ -98,7 +98,7 @@ declare function DatePickerQuickOptions({ onSelect, ...props }: DatePickerProps
|
|
|
98
98
|
declare function DefaultDatePicker(props: DatePickerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/state/persistence.d.ts
|
|
101
|
-
declare const PERSIST_KEYS: readonly ['sort', 'selection', 'expanded', 'hiddenColumns', 'filterValues', 'columnWidths'];
|
|
101
|
+
declare const PERSIST_KEYS: readonly ['sort', 'selection', 'expanded', 'hiddenColumns', 'columnOrder', 'filterValues', 'columnWidths'];
|
|
102
102
|
type PersistKey = (typeof PERSIST_KEYS)[number];
|
|
103
103
|
type TableStateStorage = {
|
|
104
104
|
getItem: (key: string) => string | null | Promise<string | null>;
|
|
@@ -158,6 +158,8 @@ interface TableTheme<TItem = unknown> {
|
|
|
158
158
|
rangeMax: ReactNode;
|
|
159
159
|
calendarWeek: ReactNode;
|
|
160
160
|
hiddenColumnFilters: ReactNode;
|
|
161
|
+
moveColumnLeft: string;
|
|
162
|
+
moveColumnRight: string;
|
|
161
163
|
};
|
|
162
164
|
/** Define styles. */
|
|
163
165
|
classes?: {
|
|
@@ -200,6 +202,8 @@ interface TableTheme<TItem = unknown> {
|
|
|
200
202
|
onContextMenu?: (event: React.MouseEvent<Element>) => void;
|
|
201
203
|
className?: string;
|
|
202
204
|
type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
205
|
+
disabled?: boolean;
|
|
206
|
+
'aria-label'?: string;
|
|
203
207
|
}>;
|
|
204
208
|
Button: ComponentType<{
|
|
205
209
|
children: ReactNode;
|
|
@@ -352,6 +356,13 @@ interface TableProps<TItem> extends PartialTableTheme<TItem> {
|
|
|
352
356
|
hiddenColumns?: Set<Id>;
|
|
353
357
|
/** Called when hidden columns change. */
|
|
354
358
|
onHiddenColumnsChange?: (hiddenColumns: Set<Id>) => void;
|
|
359
|
+
/** Default column order, by column id. Columns missing from it keep their place relative to the
|
|
360
|
+
* column defined before them. */
|
|
361
|
+
defaultColumnOrder?: Id[];
|
|
362
|
+
/** If given, controls the column order. */
|
|
363
|
+
columnOrder?: Id[];
|
|
364
|
+
/** Called when the column order changes, with the ids of all columns. */
|
|
365
|
+
onColumnOrderChange?: (columnOrder: Id[]) => void;
|
|
355
366
|
/** Default filter values by column id. Columns without an entry use their filter's `defaultValue`. */
|
|
356
367
|
defaultFilterValues?: Map<Id, unknown>;
|
|
357
368
|
/** If given, controls filter values. Columns without an entry use their filter's `defaultValue`;
|
|
@@ -418,6 +429,10 @@ interface TableProps<TItem> extends PartialTableTheme<TItem> {
|
|
|
418
429
|
* @default true
|
|
419
430
|
*/
|
|
420
431
|
enableColumnResize?: boolean | 'visualOnly';
|
|
432
|
+
/** Allow to reorder columns by dragging their headers and from the column selection menu.
|
|
433
|
+
* @default true
|
|
434
|
+
*/
|
|
435
|
+
enableColumnReorder?: boolean;
|
|
421
436
|
/** If enabled, automatically store table state in localStorage, localForage or another compatible storage. */
|
|
422
437
|
persist?: {
|
|
423
438
|
storage: TableStateStorage;
|
|
@@ -459,6 +474,8 @@ interface TableRef {
|
|
|
459
474
|
setExpanded: (expanded: Set<Id>) => void;
|
|
460
475
|
getHiddenColumns: () => Set<Id>;
|
|
461
476
|
setHiddenColumns: (hidden: Set<Id>) => void;
|
|
477
|
+
getColumnOrder: () => Id[];
|
|
478
|
+
setColumnOrder: (columnOrder: Id[]) => void;
|
|
462
479
|
getFilterValues: () => Map<Id, unknown>;
|
|
463
480
|
setFilterValues: (filterValues: Map<Id, unknown>) => void;
|
|
464
481
|
}
|
|
@@ -530,6 +547,8 @@ interface TableState<TItem> {
|
|
|
530
547
|
selection: Set<Id>;
|
|
531
548
|
expanded: Set<Id>;
|
|
532
549
|
hiddenColumns: Set<Id>;
|
|
550
|
+
/** Ids of all columns, in display order. */
|
|
551
|
+
columnOrder: Id[];
|
|
533
552
|
columnWidths: Map<Id, string>;
|
|
534
553
|
/** Filter values by column id, defaults included. Hidden columns keep theirs. */
|
|
535
554
|
filterValues: Map<Id, unknown>;
|
|
@@ -559,6 +578,9 @@ interface TableActions<TItem = unknown> {
|
|
|
559
578
|
setExpanded: (expanded: Set<Id>) => void;
|
|
560
579
|
toggleExpanded: (itemId: Id) => void;
|
|
561
580
|
setHiddenColumns: (hiddenColumns: Set<Id>) => void;
|
|
581
|
+
setColumnOrder: (columnOrder: Id[]) => void;
|
|
582
|
+
/** Moves a column to the position of `targetId`, shifting the columns in between. */
|
|
583
|
+
moveColumn: (columnId: Id, targetId: Id) => void;
|
|
562
584
|
setColumnWidth: (columnId: Id, width: string | undefined) => void;
|
|
563
585
|
setFilterValues: (filterValues: Map<Id, unknown>) => void;
|
|
564
586
|
setFilterValue: (columnId: Id, value: unknown) => void;
|
|
@@ -620,4 +642,4 @@ interface Filter<TInput, TState = any, TOptions = any> extends FilterOptions<TSt
|
|
|
620
642
|
}
|
|
621
643
|
//#endregion
|
|
622
644
|
export { DateRange as A, thisWeek as B, TableStateStorage as C, DatePickerProvider as D, DatePickerProps as E, endOfDay as F, today as H, getCalendarWeek as I, lastDays as L, commonQuickOptions as M, dateClamp as N, DatePickerQuickOption as O, dateIntersect as P, startOfDay as R, WrapRowProps as S, DatePickerChangeSource as T, thisYear as V, TableProps as _, FilterComponentProps as a, TableStructure as b, InternalColumn as c, SingleOrMultiple as d, Sort as f, TableItem as g, TableContextValue as h, Filter as i, DefaultDatePicker as j, DatePickerQuickOptions as k, PartialTableTheme as l, TableActions as m, ColumnFactory as n, FilterOptions as o, SortDirection as p, ColumnGenerator as r, Id as s, Column as t, SingleOf as u, TableRef as v, DatePicker as w, TableTheme as x, TableState as y, thisMonth as z };
|
|
623
|
-
//# sourceMappingURL=types-
|
|
645
|
+
//# sourceMappingURL=types-DCfeZ6qS.d.cts.map
|
|
@@ -1533,7 +1533,12 @@ const iconButtonCss = css({
|
|
|
1533
1533
|
color: "inherit",
|
|
1534
1534
|
background: "transparent",
|
|
1535
1535
|
"&:hover": { backgroundColor: "rgba(0, 0, 0, 0.04)" },
|
|
1536
|
-
"&:active": { transformColor: "scale3d(0.95, 0.95, 1)" }
|
|
1536
|
+
"&:active": { transformColor: "scale3d(0.95, 0.95, 1)" },
|
|
1537
|
+
"&:disabled": {
|
|
1538
|
+
opacity: .3,
|
|
1539
|
+
cursor: "default",
|
|
1540
|
+
backgroundColor: "transparent"
|
|
1541
|
+
}
|
|
1537
1542
|
});
|
|
1538
1543
|
const IconButton = ({ className, ...props }) => {
|
|
1539
1544
|
const libraryClass = useLibraryClassName();
|
|
@@ -1635,7 +1640,9 @@ const defaultTableTheme = {
|
|
|
1635
1640
|
rangeMin: "Min",
|
|
1636
1641
|
rangeMax: "Max",
|
|
1637
1642
|
calendarWeek: "Wk",
|
|
1638
|
-
hiddenColumnFilters: "Filters of hidden columns"
|
|
1643
|
+
hiddenColumnFilters: "Filters of hidden columns",
|
|
1644
|
+
moveColumnLeft: "Move column left",
|
|
1645
|
+
moveColumnRight: "Move column right"
|
|
1639
1646
|
},
|
|
1640
1647
|
components: defaultComponents,
|
|
1641
1648
|
icons: {
|
|
@@ -1790,4 +1797,4 @@ function columnTheme(theme, column) {
|
|
|
1790
1797
|
//#endregion
|
|
1791
1798
|
export { today as A, endOfDay as C, thisMonth as D, startOfDay$1 as E, useCssVariables as M, thisWeek as O, dateIntersect as S, lastDays as T, DatePickerProvider as _, useLibraryClassName as a, commonQuickOptions as b, castArray as c, getDescendants as d, helpers_exports as f, DatePicker as g, uniq as h, useTheme$1 as i, debounce as j, thisYear as k, cx as l, toSingles as m, columnTheme as n, useUserClassName as o, orderBy as p, useTableTheme as r, asString as s, ThemeContext as t, getAncestors as u, DatePickerQuickOptions as v, getCalendarWeek as w, dateClamp as x, DefaultDatePicker as y };
|
|
1792
1799
|
|
|
1793
|
-
//# sourceMappingURL=useTheme-
|
|
1800
|
+
//# sourceMappingURL=useTheme-C4YfOu-U.js.map
|