@react-fabric/searchbar 1.0.0-beta.23 → 1.0.0-beta.25

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.
@@ -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
- var _formRef$current, _formRef$current2;
62
- if (filter && "field" in filter && filter.field) return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setValues(filter);
63
- (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setValues({
64
- id: utilities.shortHash(),
65
- field: "",
66
- type: index.FIELD_TYPE.NONE,
67
- operator: index.OPERATOR.EXISTS
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 pt-4 justify-end gap-1",
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
- var _formRef$current, _formRef$current2;
62
- if (filter && "field" in filter && filter.field) return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setValues(filter);
63
- (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setValues({
64
- id: shortHash(),
65
- field: "",
66
- type: FIELD_TYPE.NONE,
67
- operator: OPERATOR.EXISTS
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 pt-4 justify-end gap-1",
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.23",
3
+ "version": "1.0.0-beta.25",
4
4
  "description": "RUF: Searchbar with filters package",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -34,11 +34,11 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@floating-ui/react": "^0.26.24",
37
- "@react-fabric/core": "^1.0.0-beta.23",
38
- "@react-fabric/date": "^1.0.0-beta.23",
39
- "@react-fabric/form": "^1.0.0-beta.23",
40
- "@react-fabric/monaco": "^1.0.0-beta.23",
41
- "@react-fabric/utilities": "^1.0.0-beta.23",
37
+ "@react-fabric/core": "^1.0.0-beta.25",
38
+ "@react-fabric/date": "^1.0.0-beta.25",
39
+ "@react-fabric/form": "^1.0.0-beta.25",
40
+ "@react-fabric/monaco": "^1.0.0-beta.25",
41
+ "@react-fabric/utilities": "^1.0.0-beta.25",
42
42
  "classnames": "^2.5.1",
43
43
  "react-hook-form": "^7.52.1"
44
44
  },
@@ -52,5 +52,5 @@
52
52
  "node": ">=18.12.0",
53
53
  "npm": ">=8.19.0"
54
54
  },
55
- "gitHead": "96cac942a837ec03886660d398de74b8bcb2dbac"
55
+ "gitHead": "34640e2473c7823254e82aa7aed920c9c6f8f503"
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
- return formRef.current?.setValues(filter);
94
- formRef.current?.setValues({
95
- id: shortHash(),
96
- field: "",
97
- type: FIELD_TYPE.NONE,
98
- operator: OPERATOR.EXISTS,
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 pt-4 justify-end gap-1">
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
@@ -136,7 +136,7 @@ export const QueryForm = ({
136
136
  </div>
137
137
  )}
138
138
  </Controller>
139
- <div className="flex justify-end gap-1">
139
+ <div className="flex mt-4 justify-end gap-1 sticky bottom-1 bg-base">
140
140
  {onRemove && (
141
141
  <div className="flex-1">
142
142
  <Button