schummar-table 0.50.6 → 0.51.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/dist/index.cjs +32 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +30 -21
- package/dist/index.js.map +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-B7cBxGpR.d.ts → types-BfdXNfLi.d.ts} +2 -2
- package/dist/{types-DzMId5Jg.d.cts → types-DqoOnlp7.d.cts} +2 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as ExporterEntry } from "./exporter-ZZesPOOU.cjs";
|
|
2
|
-
import { a as
|
|
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-DqoOnlp7.cjs";
|
|
3
3
|
import * as _emotion_react_jsx_runtime1 from "@emotion/react/jsx-runtime";
|
|
4
4
|
import * as react0 from "react";
|
|
5
5
|
import { ComponentType, ForwardedRef, HTMLProps, ReactNode } from "react";
|
|
@@ -190,6 +190,9 @@ declare const Table: <T$1>(props: TableProps<T$1> & {
|
|
|
190
190
|
declare function _Table<T$1>(props: TableProps<T$1>, ref: ForwardedRef<TableRef>): JSX.Element;
|
|
191
191
|
//#endregion
|
|
192
192
|
//#region src/components/textFilter.d.ts
|
|
193
|
+
declare function substringCompare(itemValue: string, filterValue: string): boolean;
|
|
194
|
+
declare function prefixCompare(itemValue: string, filterValue: string): boolean;
|
|
195
|
+
declare function exactCompare(itemValue: string, filterValue: string): boolean;
|
|
193
196
|
declare function TextFilter<TItem, TColumnValue>({
|
|
194
197
|
compare,
|
|
195
198
|
filterBy,
|
|
@@ -268,5 +271,5 @@ declare const termMatch: (text: string, query: string) => boolean;
|
|
|
268
271
|
declare function configureTableTheme(tableTheme: PartialTableTheme): void;
|
|
269
272
|
declare function mergeThemes<T$1>(...themes: PartialTableTheme<T$1>[]): PartialTableTheme<T$1>;
|
|
270
273
|
//#endregion
|
|
271
|
-
export { AutoFocusTextField, type Column, ColumnContext, CombinedFilter, type CombinedFilterProps, type CommonFilterProps, DateFilter, DatePicker, type DatePickerChangeSource, type DatePickerProps, DatePickerProvider, type DatePickerQuickOption, type DateRange, type FilterImplementation, type FunctionWithDeps, type Id, type InternalColumn, type PartialTableTheme, RangeFilter, SelectFilter, type Sort, type SortDirection, Table, TableContext, type TableProps, type TableRef, TableResetContext, TableSettingsContext, TableSettingsProvider, type TableStateStorage, TextFilter, commonQuickOptions, configureTableTheme, dateClamp, dateIntersect, endOfDay, getCalendarWeek, helpers_d_exports as helpers, lastDays, mergeThemes, startOfDay, termMatch, textMatch, thisMonth, thisWeek, thisYear, today, useColumnContext, useFilter, useTableContext, useTheme };
|
|
274
|
+
export { AutoFocusTextField, type Column, ColumnContext, type ColumnFactory, type ColumnGenerator, CombinedFilter, type CombinedFilterProps, type CommonFilterProps, DateFilter, DatePicker, type DatePickerChangeSource, type DatePickerProps, DatePickerProvider, type DatePickerQuickOption, type DateRange, type FilterImplementation, type FunctionWithDeps, type Id, type InternalColumn, type PartialTableTheme, RangeFilter, SelectFilter, type Sort, type SortDirection, Table, TableContext, type TableProps, type TableRef, TableResetContext, TableSettingsContext, TableSettingsProvider, type TableStateStorage, TextFilter, commonQuickOptions, configureTableTheme, dateClamp, dateIntersect, endOfDay, exactCompare, getCalendarWeek, helpers_d_exports as helpers, lastDays, mergeThemes, prefixCompare, startOfDay, substringCompare, termMatch, textMatch, thisMonth, thisWeek, thisYear, today, useColumnContext, useFilter, useTableContext, useTheme };
|
|
272
275
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as ExporterEntry } from "./exporter-zK7PhTrL.js";
|
|
2
|
-
import { a as
|
|
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
5
|
import * as _emotion_react_jsx_runtime1 from "@emotion/react/jsx-runtime";
|
|
@@ -188,6 +188,9 @@ declare const Table: <T$1>(props: TableProps<T$1> & {
|
|
|
188
188
|
declare function _Table<T$1>(props: TableProps<T$1>, ref: ForwardedRef<TableRef>): JSX.Element;
|
|
189
189
|
//#endregion
|
|
190
190
|
//#region src/components/textFilter.d.ts
|
|
191
|
+
declare function substringCompare(itemValue: string, filterValue: string): boolean;
|
|
192
|
+
declare function prefixCompare(itemValue: string, filterValue: string): boolean;
|
|
193
|
+
declare function exactCompare(itemValue: string, filterValue: string): boolean;
|
|
191
194
|
declare function TextFilter<TItem, TColumnValue>({
|
|
192
195
|
compare,
|
|
193
196
|
filterBy,
|
|
@@ -266,5 +269,5 @@ declare const termMatch: (text: string, query: string) => boolean;
|
|
|
266
269
|
declare function configureTableTheme(tableTheme: PartialTableTheme): void;
|
|
267
270
|
declare function mergeThemes<T$1>(...themes: PartialTableTheme<T$1>[]): PartialTableTheme<T$1>;
|
|
268
271
|
//#endregion
|
|
269
|
-
export { AutoFocusTextField, type Column, ColumnContext, CombinedFilter, type CombinedFilterProps, type CommonFilterProps, DateFilter, DatePicker, type DatePickerChangeSource, type DatePickerProps, DatePickerProvider, type DatePickerQuickOption, type DateRange, type FilterImplementation, type FunctionWithDeps, type Id, type InternalColumn, type PartialTableTheme, RangeFilter, SelectFilter, type Sort, type SortDirection, Table, TableContext, type TableProps, type TableRef, TableResetContext, TableSettingsContext, TableSettingsProvider, type TableStateStorage, TextFilter, commonQuickOptions, configureTableTheme, dateClamp, dateIntersect, endOfDay, getCalendarWeek, helpers_d_exports as helpers, lastDays, mergeThemes, startOfDay, termMatch, textMatch, thisMonth, thisWeek, thisYear, today, useColumnContext, useFilter, useTableContext, useTheme };
|
|
272
|
+
export { AutoFocusTextField, type Column, ColumnContext, type ColumnFactory, type ColumnGenerator, CombinedFilter, type CombinedFilterProps, type CommonFilterProps, DateFilter, DatePicker, type DatePickerChangeSource, type DatePickerProps, DatePickerProvider, type DatePickerQuickOption, type DateRange, type FilterImplementation, type FunctionWithDeps, type Id, type InternalColumn, type PartialTableTheme, RangeFilter, SelectFilter, type Sort, type SortDirection, Table, TableContext, type TableProps, type TableRef, TableResetContext, TableSettingsContext, TableSettingsProvider, type TableStateStorage, TextFilter, commonQuickOptions, configureTableTheme, dateClamp, dateIntersect, endOfDay, exactCompare, getCalendarWeek, helpers_d_exports as helpers, lastDays, mergeThemes, prefixCompare, startOfDay, substringCompare, termMatch, textMatch, thisMonth, thisWeek, thisYear, today, useColumnContext, useFilter, useTableContext, useTheme };
|
|
270
273
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -4046,28 +4046,18 @@ const TableInner = memo(function TableInner$1({ hidden }) {
|
|
|
4046
4046
|
});
|
|
4047
4047
|
});
|
|
4048
4048
|
|
|
4049
|
-
//#endregion
|
|
4050
|
-
//#region src/misc/textMatch.ts
|
|
4051
|
-
const textMatch = (text, query) => {
|
|
4052
|
-
text = text.toLowerCase();
|
|
4053
|
-
query = query.toLowerCase();
|
|
4054
|
-
return query.split(/\s+/).every((part) => termMatch(text, part));
|
|
4055
|
-
};
|
|
4056
|
-
const termMatch = (text, query) => {
|
|
4057
|
-
let i = 0;
|
|
4058
|
-
outer: for (const char of query) {
|
|
4059
|
-
for (; i < text.length; i++) if (text[i] === char) {
|
|
4060
|
-
i++;
|
|
4061
|
-
continue outer;
|
|
4062
|
-
}
|
|
4063
|
-
return false;
|
|
4064
|
-
}
|
|
4065
|
-
return true;
|
|
4066
|
-
};
|
|
4067
|
-
|
|
4068
4049
|
//#endregion
|
|
4069
4050
|
//#region src/components/textFilter.tsx
|
|
4070
|
-
function
|
|
4051
|
+
function substringCompare(itemValue, filterValue) {
|
|
4052
|
+
return itemValue.toLowerCase().includes(filterValue.toLowerCase());
|
|
4053
|
+
}
|
|
4054
|
+
function prefixCompare(itemValue, filterValue) {
|
|
4055
|
+
return itemValue.toLowerCase().includes(filterValue.toLowerCase());
|
|
4056
|
+
}
|
|
4057
|
+
function exactCompare(itemValue, filterValue) {
|
|
4058
|
+
return itemValue.toLowerCase() === filterValue.toLowerCase();
|
|
4059
|
+
}
|
|
4060
|
+
function TextFilter({ compare = substringCompare, filterBy = asStringOrArray, placeholder,...props }) {
|
|
4071
4061
|
const IconButton$1 = useTheme((t) => t.components.IconButton);
|
|
4072
4062
|
const Search$1 = useTheme((t) => t.icons.Search);
|
|
4073
4063
|
const Clear$1 = useTheme((t) => t.icons.Clear);
|
|
@@ -4103,5 +4093,24 @@ function TextFilter({ compare = textMatch, filterBy = asStringOrArray, placehold
|
|
|
4103
4093
|
}
|
|
4104
4094
|
|
|
4105
4095
|
//#endregion
|
|
4106
|
-
|
|
4096
|
+
//#region src/misc/textMatch.ts
|
|
4097
|
+
const textMatch = (text, query) => {
|
|
4098
|
+
text = text.toLowerCase();
|
|
4099
|
+
query = query.toLowerCase();
|
|
4100
|
+
return query.split(/\s+/).every((part) => termMatch(text, part));
|
|
4101
|
+
};
|
|
4102
|
+
const termMatch = (text, query) => {
|
|
4103
|
+
let i = 0;
|
|
4104
|
+
outer: for (const char of query) {
|
|
4105
|
+
for (; i < text.length; i++) if (text[i] === char) {
|
|
4106
|
+
i++;
|
|
4107
|
+
continue outer;
|
|
4108
|
+
}
|
|
4109
|
+
return false;
|
|
4110
|
+
}
|
|
4111
|
+
return true;
|
|
4112
|
+
};
|
|
4113
|
+
|
|
4114
|
+
//#endregion
|
|
4115
|
+
export { AutoFocusTextField, ColumnContext, CombinedFilter, DateFilter, DatePicker, DatePickerProvider, RangeFilter, SelectFilter, Table, TableContext, TableResetContext, TableSettingsContext, TableSettingsProvider, TextFilter, commonQuickOptions, configureTableTheme, dateClamp, dateIntersect, endOfDay, exactCompare, getCalendarWeek, helpers_exports as helpers, lastDays, mergeThemes, prefixCompare, startOfDay, substringCompare, termMatch, textMatch, thisMonth, thisWeek, thisYear, today, useColumnContext, useFilter, useTableContext, useTheme };
|
|
4107
4116
|
//# sourceMappingURL=index.js.map
|