schummar-table 0.51.0 → 0.51.2
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/index.cjs +15 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +14 -19
- package/dist/index.js.map +1 -1
- package/dist/mui4Theme.cjs +1 -1
- package/dist/mui4Theme.js +1 -1
- package/dist/mui5Theme.cjs +1 -1
- package/dist/mui5Theme.js +1 -1
- package/dist/{tableSettings-ClxJL29H.js → tableSettings-CCjCl2iG.js} +2 -1
- package/dist/{tableSettings-ClxJL29H.js.map → tableSettings-CCjCl2iG.js.map} +1 -1
- package/dist/{tableSettings-D1787qFp.cjs → tableSettings-D1MSPxbQ.cjs} +2 -1
- package/dist/{tableSettings-D1787qFp.cjs.map → tableSettings-D1MSPxbQ.cjs.map} +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { r as ExporterEntry } from "./exporter-zK7PhTrL.js";
|
|
|
2
2
|
import { _ as TableTheme, a as FilterImplementation, c as InternalColumn, d as PartialTableTheme, f as Sort, g as TableRef, h as TableProps, i as CommonFilterProps, l as InternalTableState, m as TableItem, n as ColumnFactory, o as FunctionWithDeps, p as SortDirection, r as ColumnGenerator, s as Id, t as Column, u as MemoizedTableTheme, v as TableStateStorage } from "./types-BfdXNfLi.js";
|
|
3
3
|
import * as react0 from "react";
|
|
4
4
|
import { ComponentType, ForwardedRef, HTMLProps, ReactNode } from "react";
|
|
5
|
-
import * as
|
|
5
|
+
import * as _emotion_react_jsx_runtime2 from "@emotion/react/jsx-runtime";
|
|
6
6
|
import { Store } from "schummar-state/react";
|
|
7
7
|
|
|
8
8
|
//#region src/components/autoFocusTextField.d.ts
|
|
9
9
|
type Props = TableTheme['components']['TextField'] extends ComponentType<infer T> ? T : never;
|
|
10
|
-
declare function AutoFocusTextField(props: Omit<Props, 'inputRef'>):
|
|
10
|
+
declare function AutoFocusTextField(props: Omit<Props, 'inputRef'>): _emotion_react_jsx_runtime2.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/components/combinedFilter.d.ts
|
|
13
13
|
interface CombinedFilterProps extends Pick<CommonFilterProps<any, any, any, any>, 'classNames'> {
|
|
@@ -16,7 +16,7 @@ interface CombinedFilterProps extends Pick<CommonFilterProps<any, any, any, any>
|
|
|
16
16
|
declare function CombinedFilter({
|
|
17
17
|
columnIds: inputColumnIds,
|
|
18
18
|
...props
|
|
19
|
-
}: CombinedFilterProps):
|
|
19
|
+
}: CombinedFilterProps): _emotion_react_jsx_runtime2.JSX.Element;
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/components/datePicker.d.ts
|
|
22
22
|
type DateRange = {
|
|
@@ -68,7 +68,7 @@ declare function DatePickerProvider({
|
|
|
68
68
|
...props
|
|
69
69
|
}: Partial<Omit<DatePickerProps, 'value' | 'onChange'>> & {
|
|
70
70
|
children?: ReactNode;
|
|
71
|
-
}):
|
|
71
|
+
}): _emotion_react_jsx_runtime2.JSX.Element;
|
|
72
72
|
/** Rounds a date down to the start of the day. */
|
|
73
73
|
declare const startOfDay: (d: Date) => Date;
|
|
74
74
|
/** Rounds a date up to the end of the day. */
|
|
@@ -81,34 +81,34 @@ declare const thisYear: (delta?: number) => DateRange;
|
|
|
81
81
|
declare const getCalendarWeek: (date: Date) => number;
|
|
82
82
|
declare const commonQuickOptions: {
|
|
83
83
|
today: {
|
|
84
|
-
label:
|
|
84
|
+
label: _emotion_react_jsx_runtime2.JSX.Element;
|
|
85
85
|
value: () => DateRange;
|
|
86
86
|
};
|
|
87
87
|
thisWeek: {
|
|
88
|
-
label:
|
|
88
|
+
label: _emotion_react_jsx_runtime2.JSX.Element;
|
|
89
89
|
value: (props: DatePickerProps) => DateRange;
|
|
90
90
|
};
|
|
91
91
|
thisMonth: {
|
|
92
|
-
label:
|
|
92
|
+
label: _emotion_react_jsx_runtime2.JSX.Element;
|
|
93
93
|
value: () => DateRange;
|
|
94
94
|
};
|
|
95
95
|
thisYear: {
|
|
96
|
-
label:
|
|
96
|
+
label: _emotion_react_jsx_runtime2.JSX.Element;
|
|
97
97
|
value: () => DateRange;
|
|
98
98
|
};
|
|
99
99
|
lastSevenDays: {
|
|
100
|
-
label:
|
|
100
|
+
label: _emotion_react_jsx_runtime2.JSX.Element;
|
|
101
101
|
value: () => DateRange;
|
|
102
102
|
};
|
|
103
103
|
lastThirtyDays: {
|
|
104
|
-
label:
|
|
104
|
+
label: _emotion_react_jsx_runtime2.JSX.Element;
|
|
105
105
|
value: () => DateRange;
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
/** Returns whether two dates and/or date ranges intersect. Intersection is considered per day. */
|
|
109
109
|
declare function dateIntersect(a: Date | DateRange | null | undefined, b: Date | DateRange | null | undefined): boolean;
|
|
110
110
|
declare function dateClamp(date: Date, min?: Date, max?: Date): Date;
|
|
111
|
-
declare function DatePicker(props: DatePickerProps):
|
|
111
|
+
declare function DatePicker(props: DatePickerProps): _emotion_react_jsx_runtime2.JSX.Element;
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/components/dateFilter.d.ts
|
|
114
114
|
declare function DateFilter<TItem, TColumnValue>({
|
|
@@ -259,7 +259,7 @@ declare function TableSettingsProvider({
|
|
|
259
259
|
}: Partial<TableSettingsContextType> & {
|
|
260
260
|
additionalExporters?: ExporterEntry[];
|
|
261
261
|
children?: ReactNode;
|
|
262
|
-
}):
|
|
262
|
+
}): _emotion_react_jsx_runtime2.JSX.Element;
|
|
263
263
|
//#endregion
|
|
264
264
|
//#region src/misc/textMatch.d.ts
|
|
265
265
|
declare const textMatch: (text: string, query: string) => boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { t as __export } from "./chunk-Bp6m_JJh.js";
|
|
2
|
-
import { a as mergeThemes, c as throttle, i as globalTableTheme, l as Store, n as TableSettingsProvider, o as Popover, r as configureTableTheme, s as defaultClasses, t as TableSettingsContext, u as StoreScope } from "./tableSettings-
|
|
2
|
+
import { a as mergeThemes, c as throttle, i as globalTableTheme, l as Store, n as TableSettingsProvider, o as Popover, r as configureTableTheme, s as defaultClasses, t as TableSettingsContext, u as StoreScope } from "./tableSettings-CCjCl2iG.js";
|
|
3
3
|
import "./csvExporter-CqTylAk9.js";
|
|
4
4
|
import { Fragment, cloneElement, createContext, forwardRef, memo, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { castDraft } from "immer";
|
|
6
6
|
import { ClassNames, css } from "@emotion/react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
8
8
|
import { nanoid } from "nanoid";
|
|
9
|
+
import { Temporal } from "temporal-polyfill";
|
|
9
10
|
import { addDays, differenceInCalendarMonths, isBefore, isToday, startOfDay as startOfDay$1 } from "date-fns";
|
|
10
11
|
|
|
11
12
|
//#region src/misc/tableContext.ts
|
|
@@ -919,6 +920,16 @@ function CombinedFilter({ columnIds: inputColumnIds,...props }) {
|
|
|
919
920
|
}, columnId)) });
|
|
920
921
|
}
|
|
921
922
|
|
|
923
|
+
//#endregion
|
|
924
|
+
//#region src/misc/defaults.ts
|
|
925
|
+
function defaults(first, ...more) {
|
|
926
|
+
return more.reduce((acc, source) => {
|
|
927
|
+
const copy = { ...acc };
|
|
928
|
+
for (const [key, value] of Object.entries(source)) copy[key] ??= value;
|
|
929
|
+
return copy;
|
|
930
|
+
}, first);
|
|
931
|
+
}
|
|
932
|
+
|
|
922
933
|
//#endregion
|
|
923
934
|
//#region src/vendor/dayzed/utils.ts
|
|
924
935
|
/**
|
|
@@ -1343,16 +1354,6 @@ function useDayzed({ date = /* @__PURE__ */ new Date(), maxDate, minDate, months
|
|
|
1343
1354
|
};
|
|
1344
1355
|
}
|
|
1345
1356
|
|
|
1346
|
-
//#endregion
|
|
1347
|
-
//#region src/misc/defaults.ts
|
|
1348
|
-
function defaults(first, ...more) {
|
|
1349
|
-
return more.reduce((acc, source) => {
|
|
1350
|
-
const copy = { ...acc };
|
|
1351
|
-
for (const [key, value] of Object.entries(source)) copy[key] ??= value;
|
|
1352
|
-
return copy;
|
|
1353
|
-
}, first);
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
1357
|
//#endregion
|
|
1357
1358
|
//#region src/hooks/useLatestRef.ts
|
|
1358
1359
|
function useLatestRef(value) {
|
|
@@ -1624,15 +1625,9 @@ const thisYear = (delta = 0) => {
|
|
|
1624
1625
|
max: endOfDay(max)
|
|
1625
1626
|
};
|
|
1626
1627
|
};
|
|
1627
|
-
const MS_PER_DAY = 1e3 * 60 * 60 * 24;
|
|
1628
1628
|
const getCalendarWeek = (date) => {
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1631
|
-
const firstDayOfYear = new Date(year, 0, 1);
|
|
1632
|
-
const dayOfYear = Math.floor((endOfWeek.getTime() - firstDayOfYear.getTime() + (endOfWeek.getTimezoneOffset() - firstDayOfYear.getTimezoneOffset())) / MS_PER_DAY) + 1;
|
|
1633
|
-
const weekOfYear = Math.floor((3 + dayOfYear) / 7);
|
|
1634
|
-
if (weekOfYear === 0) return getCalendarWeek(new Date(endOfWeek.getFullYear(), endOfWeek.getMonth(), endOfWeek.getDate() - 7)) + 1;
|
|
1635
|
-
return weekOfYear;
|
|
1629
|
+
const tz = Temporal.Now.timeZoneId();
|
|
1630
|
+
return Temporal.Instant.fromEpochMilliseconds(date.getTime()).toZonedDateTimeISO(tz).weekOfYear ?? 0;
|
|
1636
1631
|
};
|
|
1637
1632
|
const commonQuickOptions = {
|
|
1638
1633
|
today: {
|