kui-utils 0.0.9 → 0.0.11
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/cjs/index.js +9 -5
- package/cjs/index.js.map +1 -1
- package/index.d.ts +3 -2
- package/index.js +9 -5
- package/index.js.map +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -55,9 +55,9 @@ function useForkRef() {
|
|
|
55
55
|
}, refs);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
var useToggle = function (
|
|
59
|
-
if (
|
|
60
|
-
var _a = React.useState(
|
|
58
|
+
var useToggle = function (defaultValue) {
|
|
59
|
+
if (defaultValue === void 0) { defaultValue = false; }
|
|
60
|
+
var _a = React.useState(defaultValue), isOpen = _a[0], setIsOpen = _a[1];
|
|
61
61
|
var handleClose = function () {
|
|
62
62
|
setIsOpen(false);
|
|
63
63
|
};
|
|
@@ -2135,7 +2135,7 @@ var Paginator = /** @class */ (function () {
|
|
|
2135
2135
|
}());
|
|
2136
2136
|
|
|
2137
2137
|
var SortingFilter = /** @class */ (function () {
|
|
2138
|
-
function SortingFilter(orderBy, filterQuery) {
|
|
2138
|
+
function SortingFilter(orderBy, filterQuery, order) {
|
|
2139
2139
|
var _this = this;
|
|
2140
2140
|
this.updateSearchQuery = function (newQuery) {
|
|
2141
2141
|
_this.searchQuery = newQuery;
|
|
@@ -2149,9 +2149,13 @@ var SortingFilter = /** @class */ (function () {
|
|
|
2149
2149
|
this.setOrderBy = function (orderBy) {
|
|
2150
2150
|
_this.orderBy = orderBy;
|
|
2151
2151
|
};
|
|
2152
|
+
this.clearFilter = function () {
|
|
2153
|
+
_this.searchQuery = "";
|
|
2154
|
+
_this.filterQuery = "";
|
|
2155
|
+
};
|
|
2152
2156
|
this.searchQuery = "";
|
|
2153
2157
|
this.filterQuery = filterQuery || "";
|
|
2154
|
-
this.order = "asc";
|
|
2158
|
+
this.order = order || "asc";
|
|
2155
2159
|
this.orderBy = orderBy || "";
|
|
2156
2160
|
mobx.makeAutoObservable(this);
|
|
2157
2161
|
}
|