schummar-table 0.50.7 → 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 +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +30 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4052,28 +4052,18 @@ const TableInner = (0, react.memo)(function TableInner$1({ hidden }) {
|
|
|
4052
4052
|
});
|
|
4053
4053
|
});
|
|
4054
4054
|
|
|
4055
|
-
//#endregion
|
|
4056
|
-
//#region src/misc/textMatch.ts
|
|
4057
|
-
const textMatch = (text, query) => {
|
|
4058
|
-
text = text.toLowerCase();
|
|
4059
|
-
query = query.toLowerCase();
|
|
4060
|
-
return query.split(/\s+/).every((part) => termMatch(text, part));
|
|
4061
|
-
};
|
|
4062
|
-
const termMatch = (text, query) => {
|
|
4063
|
-
let i = 0;
|
|
4064
|
-
outer: for (const char of query) {
|
|
4065
|
-
for (; i < text.length; i++) if (text[i] === char) {
|
|
4066
|
-
i++;
|
|
4067
|
-
continue outer;
|
|
4068
|
-
}
|
|
4069
|
-
return false;
|
|
4070
|
-
}
|
|
4071
|
-
return true;
|
|
4072
|
-
};
|
|
4073
|
-
|
|
4074
4055
|
//#endregion
|
|
4075
4056
|
//#region src/components/textFilter.tsx
|
|
4076
|
-
function
|
|
4057
|
+
function substringCompare(itemValue, filterValue) {
|
|
4058
|
+
return itemValue.toLowerCase().includes(filterValue.toLowerCase());
|
|
4059
|
+
}
|
|
4060
|
+
function prefixCompare(itemValue, filterValue) {
|
|
4061
|
+
return itemValue.toLowerCase().includes(filterValue.toLowerCase());
|
|
4062
|
+
}
|
|
4063
|
+
function exactCompare(itemValue, filterValue) {
|
|
4064
|
+
return itemValue.toLowerCase() === filterValue.toLowerCase();
|
|
4065
|
+
}
|
|
4066
|
+
function TextFilter({ compare = substringCompare, filterBy = asStringOrArray, placeholder,...props }) {
|
|
4077
4067
|
const IconButton$1 = useTheme((t) => t.components.IconButton);
|
|
4078
4068
|
const Search$1 = useTheme((t) => t.icons.Search);
|
|
4079
4069
|
const Clear$1 = useTheme((t) => t.icons.Clear);
|
|
@@ -4108,6 +4098,25 @@ function TextFilter({ compare = textMatch, filterBy = asStringOrArray, placehold
|
|
|
4108
4098
|
});
|
|
4109
4099
|
}
|
|
4110
4100
|
|
|
4101
|
+
//#endregion
|
|
4102
|
+
//#region src/misc/textMatch.ts
|
|
4103
|
+
const textMatch = (text, query) => {
|
|
4104
|
+
text = text.toLowerCase();
|
|
4105
|
+
query = query.toLowerCase();
|
|
4106
|
+
return query.split(/\s+/).every((part) => termMatch(text, part));
|
|
4107
|
+
};
|
|
4108
|
+
const termMatch = (text, query) => {
|
|
4109
|
+
let i = 0;
|
|
4110
|
+
outer: for (const char of query) {
|
|
4111
|
+
for (; i < text.length; i++) if (text[i] === char) {
|
|
4112
|
+
i++;
|
|
4113
|
+
continue outer;
|
|
4114
|
+
}
|
|
4115
|
+
return false;
|
|
4116
|
+
}
|
|
4117
|
+
return true;
|
|
4118
|
+
};
|
|
4119
|
+
|
|
4111
4120
|
//#endregion
|
|
4112
4121
|
exports.AutoFocusTextField = AutoFocusTextField;
|
|
4113
4122
|
exports.ColumnContext = ColumnContext;
|
|
@@ -4128,6 +4137,7 @@ exports.configureTableTheme = require_tableSettings.configureTableTheme;
|
|
|
4128
4137
|
exports.dateClamp = dateClamp;
|
|
4129
4138
|
exports.dateIntersect = dateIntersect;
|
|
4130
4139
|
exports.endOfDay = endOfDay;
|
|
4140
|
+
exports.exactCompare = exactCompare;
|
|
4131
4141
|
exports.getCalendarWeek = getCalendarWeek;
|
|
4132
4142
|
Object.defineProperty(exports, 'helpers', {
|
|
4133
4143
|
enumerable: true,
|
|
@@ -4137,7 +4147,9 @@ Object.defineProperty(exports, 'helpers', {
|
|
|
4137
4147
|
});
|
|
4138
4148
|
exports.lastDays = lastDays;
|
|
4139
4149
|
exports.mergeThemes = require_tableSettings.mergeThemes;
|
|
4150
|
+
exports.prefixCompare = prefixCompare;
|
|
4140
4151
|
exports.startOfDay = startOfDay;
|
|
4152
|
+
exports.substringCompare = substringCompare;
|
|
4141
4153
|
exports.termMatch = termMatch;
|
|
4142
4154
|
exports.textMatch = textMatch;
|
|
4143
4155
|
exports.thisMonth = thisMonth;
|