@react-fabric/searchbar 1.0.0-beta.24 → 1.0.0-beta.26
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/cjs/filterbar/FilterForm.js +13 -9
- package/dist/cjs/filterbar/QueryForm.js +1 -1
- package/dist/esm/filterbar/FilterForm.js +13 -9
- package/dist/esm/filterbar/QueryForm.js +1 -1
- package/package.json +9 -9
- package/src/filterbar/FilterForm.tsx +11 -9
- package/src/filterbar/QueryForm.tsx +1 -1
|
@@ -58,14 +58,18 @@ var FilterForm = function FilterForm(_ref) {
|
|
|
58
58
|
values = _useState2[0],
|
|
59
59
|
setValues = _useState2[1];
|
|
60
60
|
react$1.useEffect(function () {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
if (filter && "field" in filter && filter.field) {
|
|
62
|
+
var _formRef$current;
|
|
63
|
+
(_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.setValues(filter);
|
|
64
|
+
} else {
|
|
65
|
+
var _formRef$current2;
|
|
66
|
+
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setValues({
|
|
67
|
+
id: utilities.shortHash(),
|
|
68
|
+
field: "",
|
|
69
|
+
type: index.FIELD_TYPE.NONE,
|
|
70
|
+
operator: index.OPERATOR.EXISTS
|
|
71
|
+
});
|
|
72
|
+
}
|
|
69
73
|
}, [filter]);
|
|
70
74
|
react$1.useEffect(function () {
|
|
71
75
|
setTimeout(function () {
|
|
@@ -261,7 +265,7 @@ var FilterForm = function FilterForm(_ref) {
|
|
|
261
265
|
})
|
|
262
266
|
})
|
|
263
267
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
264
|
-
className: "flex
|
|
268
|
+
className: "flex mt-4 justify-end gap-1 sticky bottom-1 bg-base",
|
|
265
269
|
children: [onRemove && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
266
270
|
className: "flex-1",
|
|
267
271
|
children: /*#__PURE__*/jsxRuntime.jsx(core.Button, {
|
|
@@ -110,7 +110,7 @@ var QueryForm = function QueryForm(_ref) {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
113
|
-
className: "flex justify-end gap-1",
|
|
113
|
+
className: "flex mt-4 justify-end gap-1 sticky bottom-1 bg-base",
|
|
114
114
|
children: [onRemove && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
115
115
|
className: "flex-1",
|
|
116
116
|
children: /*#__PURE__*/jsxRuntime.jsx(core.Button, {
|
|
@@ -58,14 +58,18 @@ var FilterForm = function FilterForm(_ref) {
|
|
|
58
58
|
values = _useState2[0],
|
|
59
59
|
setValues = _useState2[1];
|
|
60
60
|
useEffect(function () {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
if (filter && "field" in filter && filter.field) {
|
|
62
|
+
var _formRef$current;
|
|
63
|
+
(_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.setValues(filter);
|
|
64
|
+
} else {
|
|
65
|
+
var _formRef$current2;
|
|
66
|
+
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setValues({
|
|
67
|
+
id: shortHash(),
|
|
68
|
+
field: "",
|
|
69
|
+
type: FIELD_TYPE.NONE,
|
|
70
|
+
operator: OPERATOR.EXISTS
|
|
71
|
+
});
|
|
72
|
+
}
|
|
69
73
|
}, [filter]);
|
|
70
74
|
useEffect(function () {
|
|
71
75
|
setTimeout(function () {
|
|
@@ -261,7 +265,7 @@ var FilterForm = function FilterForm(_ref) {
|
|
|
261
265
|
})
|
|
262
266
|
})
|
|
263
267
|
}), /*#__PURE__*/jsxs("div", {
|
|
264
|
-
className: "flex
|
|
268
|
+
className: "flex mt-4 justify-end gap-1 sticky bottom-1 bg-base",
|
|
265
269
|
children: [onRemove && /*#__PURE__*/jsx("div", {
|
|
266
270
|
className: "flex-1",
|
|
267
271
|
children: /*#__PURE__*/jsx(Button, {
|
|
@@ -110,7 +110,7 @@ var QueryForm = function QueryForm(_ref) {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
}), /*#__PURE__*/jsxs("div", {
|
|
113
|
-
className: "flex justify-end gap-1",
|
|
113
|
+
className: "flex mt-4 justify-end gap-1 sticky bottom-1 bg-base",
|
|
114
114
|
children: [onRemove && /*#__PURE__*/jsx("div", {
|
|
115
115
|
className: "flex-1",
|
|
116
116
|
children: /*#__PURE__*/jsx(Button, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/searchbar",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.26",
|
|
4
4
|
"description": "RUF: Searchbar with filters package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@floating-ui/react": "^0.26.24",
|
|
37
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
38
|
-
"@react-fabric/date": "^1.0.0-beta.
|
|
39
|
-
"@react-fabric/form": "^1.0.0-beta.
|
|
40
|
-
"@react-fabric/monaco": "^1.0.0-beta.
|
|
41
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
37
|
+
"@react-fabric/core": "^1.0.0-beta.26",
|
|
38
|
+
"@react-fabric/date": "^1.0.0-beta.26",
|
|
39
|
+
"@react-fabric/form": "^1.0.0-beta.26",
|
|
40
|
+
"@react-fabric/monaco": "^1.0.0-beta.26",
|
|
41
|
+
"@react-fabric/utilities": "^1.0.0-beta.26",
|
|
42
42
|
"classnames": "^2.5.1",
|
|
43
43
|
"react-hook-form": "^7.52.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"i18next": "^23.15.1",
|
|
47
|
-
"react": "
|
|
48
|
-
"react-dom": "
|
|
47
|
+
"react": "^19.0.0",
|
|
48
|
+
"react-dom": "^19.0.0",
|
|
49
49
|
"react-i18next": "^15.0.2"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=18.12.0",
|
|
53
53
|
"npm": ">=8.19.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "452f821dc8b22c5765b3858cc53ad9d7e2f9bcf1"
|
|
56
56
|
}
|
|
@@ -89,14 +89,16 @@ export const FilterForm = ({
|
|
|
89
89
|
const [values, setValues] = useState<FilterSchemaType>(filter as AnyObject);
|
|
90
90
|
|
|
91
91
|
useEffect(() => {
|
|
92
|
-
if (filter && "field" in filter && filter.field)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
if (filter && "field" in filter && filter.field) {
|
|
93
|
+
formRef.current?.setValues(filter);
|
|
94
|
+
} else {
|
|
95
|
+
formRef.current?.setValues({
|
|
96
|
+
id: shortHash(),
|
|
97
|
+
field: "",
|
|
98
|
+
type: FIELD_TYPE.NONE,
|
|
99
|
+
operator: OPERATOR.EXISTS,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
100
102
|
}, [filter]);
|
|
101
103
|
|
|
102
104
|
useEffect(() => {
|
|
@@ -280,7 +282,7 @@ export const FilterForm = ({
|
|
|
280
282
|
}
|
|
281
283
|
/>
|
|
282
284
|
</Controller>
|
|
283
|
-
<div className="flex
|
|
285
|
+
<div className="flex mt-4 justify-end gap-1 sticky bottom-1 bg-base">
|
|
284
286
|
{onRemove && (
|
|
285
287
|
<div className="flex-1">
|
|
286
288
|
<Button
|