@react-fabric/searchbar 1.0.0-beta.45 → 1.0.0-beta.46

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.
@@ -128,6 +128,7 @@ var FilterForm = function FilterForm(_ref) {
128
128
  });
129
129
  }
130
130
  if ((field === null || field === void 0 ? void 0 : field.type) === index.FIELD_TYPE.STRING || (field === null || field === void 0 ? void 0 : field.type) === index.FIELD_TYPE.ID) {
131
+ var _field$values2;
131
132
  if ((values === null || values === void 0 ? void 0 : values.operator) === index.OPERATOR.IN) {
132
133
  var _field$values;
133
134
  return /*#__PURE__*/jsxRuntime.jsx(form.Controller, {
@@ -142,6 +143,19 @@ var FilterForm = function FilterForm(_ref) {
142
143
  onQuery: field.onSearch
143
144
  })
144
145
  });
146
+ } else if (!!field.onSearch || (_field$values2 = field.values) !== null && _field$values2 !== void 0 && _field$values2.length) {
147
+ var _field$values3;
148
+ return /*#__PURE__*/jsxRuntime.jsx(form.Controller, {
149
+ name: "value",
150
+ children: /*#__PURE__*/jsxRuntime.jsx(form.Select, {
151
+ searchable: true,
152
+ allowCreate: true,
153
+ allowClear: true,
154
+ options: (_field$values3 = field.values) !== null && _field$values3 !== void 0 ? _field$values3 : [],
155
+ label: t("label.value"),
156
+ onQuery: field.onSearch
157
+ })
158
+ });
145
159
  } else {
146
160
  return /*#__PURE__*/jsxRuntime.jsx(form.Controller, {
147
161
  name: "value",
@@ -128,6 +128,7 @@ var FilterForm = function FilterForm(_ref) {
128
128
  });
129
129
  }
130
130
  if ((field === null || field === void 0 ? void 0 : field.type) === FIELD_TYPE.STRING || (field === null || field === void 0 ? void 0 : field.type) === FIELD_TYPE.ID) {
131
+ var _field$values2;
131
132
  if ((values === null || values === void 0 ? void 0 : values.operator) === OPERATOR.IN) {
132
133
  var _field$values;
133
134
  return /*#__PURE__*/jsx(Controller, {
@@ -142,6 +143,19 @@ var FilterForm = function FilterForm(_ref) {
142
143
  onQuery: field.onSearch
143
144
  })
144
145
  });
146
+ } else if (!!field.onSearch || (_field$values2 = field.values) !== null && _field$values2 !== void 0 && _field$values2.length) {
147
+ var _field$values3;
148
+ return /*#__PURE__*/jsx(Controller, {
149
+ name: "value",
150
+ children: /*#__PURE__*/jsx(Select, {
151
+ searchable: true,
152
+ allowCreate: true,
153
+ allowClear: true,
154
+ options: (_field$values3 = field.values) !== null && _field$values3 !== void 0 ? _field$values3 : [],
155
+ label: t("label.value"),
156
+ onQuery: field.onSearch
157
+ })
158
+ });
145
159
  } else {
146
160
  return /*#__PURE__*/jsx(Controller, {
147
161
  name: "value",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/searchbar",
3
- "version": "1.0.0-beta.45",
3
+ "version": "1.0.0-beta.46",
4
4
  "description": "RUF: Searchbar with filters package",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -34,10 +34,10 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@floating-ui/react": "^0.26.24",
37
- "@react-fabric/core": "^1.0.0-beta.45",
38
- "@react-fabric/form": "^1.0.0-beta.45",
39
- "@react-fabric/monaco": "^1.0.0-beta.45",
40
- "@react-fabric/utilities": "^1.0.0-beta.45",
37
+ "@react-fabric/core": "^1.0.0-beta.46",
38
+ "@react-fabric/form": "^1.0.0-beta.46",
39
+ "@react-fabric/monaco": "^1.0.0-beta.46",
40
+ "@react-fabric/utilities": "^1.0.0-beta.46",
41
41
  "classnames": "^2.5.1",
42
42
  "react-hook-form": "^7.52.1"
43
43
  },
@@ -48,11 +48,11 @@
48
48
  "react-i18next": "^15.0.2"
49
49
  },
50
50
  "devDependencies": {
51
- "@react-fabric/superdate": "^1.0.0-beta.45"
51
+ "@react-fabric/superdate": "^1.0.0-beta.46"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=18.12.0",
55
55
  "npm": ">=8.19.0"
56
56
  },
57
- "gitHead": "37d7cbcd99da40553f4ac775c3332d5281565936"
57
+ "gitHead": "0dfc20b9c84712bb1cb5205c22464e8a1eb2341c"
58
58
  }
@@ -172,6 +172,19 @@ export const FilterForm = ({
172
172
  />
173
173
  </Controller>
174
174
  );
175
+ } else if (!!field.onSearch || field.values?.length) {
176
+ return (
177
+ <Controller name="value">
178
+ <Select
179
+ searchable
180
+ allowCreate
181
+ allowClear
182
+ options={field.values ?? []}
183
+ label={t("label.value")}
184
+ onQuery={field.onSearch}
185
+ />
186
+ </Controller>
187
+ );
175
188
  } else {
176
189
  return (
177
190
  <Controller name="value">