@steedos/filters 2.2.52 → 2.2.53-beta.4

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/lib/filter.js CHANGED
@@ -186,7 +186,9 @@ var SteedosFilter = /*#__PURE__*/function () {
186
186
  "contains": this.createStringFuncFormatter("contains"),
187
187
  "notcontains": this.createStringFuncFormatter("not contains"),
188
188
  "notstartswith": this.createStringFuncFormatter("not startswith"),
189
- "notendswith": this.createStringFuncFormatter("not endswith")
189
+ "notendswith": this.createStringFuncFormatter("not endswith"),
190
+ "in": this.createBinaryOperationFormatter("in"),
191
+ "notin": this.createBinaryOperationFormatter("notin")
190
192
  });
191
193
  }
192
194
 
@@ -270,7 +272,7 @@ var SteedosFilter = /*#__PURE__*/function () {
270
272
 
271
273
  var fieldName = criteria[0],
272
274
  value = criteria[2];
273
- return formatter(DevExpressOData.serializePropName(fieldName), DevExpressOData.serializeValue(value, this.protocolVersion));
275
+ return formatter(DevExpressOData.serializePropName(fieldName), op === 'in' || op === 'notin' ? value : DevExpressOData.serializeValue(value, this.protocolVersion));
274
276
  }
275
277
  }, {
276
278
  key: "compileCore",
package/lib/format.js CHANGED
@@ -208,17 +208,17 @@ var formatFiltersToDev = function formatFiltersToDev(filters) {
208
208
 
209
209
  if (["=", "in"].indexOf(option) > -1) {
210
210
  if (value.length) {
211
- _.each(value, function (v) {
212
- return sub_selector.push([field, "=", v], "or");
213
- });
211
+ sub_selector.push([field, "in", "(".concat(JSON.stringify(value).replace(/\"/g, "'").slice(1).slice(0, -1), ")")], "and"); // _.each(value, function (v) {
212
+ // return sub_selector.push([field, "=", v], "or");
213
+ // });
214
214
  } else {
215
215
  // 空数组返回空值
216
216
  sub_selector.push([field, "=", "__badQueryForEmptyArray"], "and");
217
217
  }
218
218
  } else if (["<>", "notin"].indexOf(option) > -1) {
219
- _.each(value, function (v) {
220
- return sub_selector.push([field, "<>", v], "and");
221
- });
219
+ sub_selector.push([field, "notin", "(".concat(JSON.stringify(value).replace(/\"/g, "'").slice(1).slice(0, -1), ")")], "and"); // _.each(value, function (v) {
220
+ // return sub_selector.push([field, "<>", v], "and");
221
+ // });
222
222
  } else if (["notcontains", "notstartswith", "notendswith"].indexOf(option) > -1) {
223
223
  _.each(value, function (v) {
224
224
  return sub_selector.push([field, option, v], "and");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@steedos/filters",
3
3
  "private": false,
4
- "version": "2.2.52",
4
+ "version": "2.2.53-beta.4",
5
5
  "description": "filters lib for steedos",
6
6
  "main": "lib/index.js",
7
7
  "files": [
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "1447c9ca4fb57a49233704f50a7d757aff0c5027"
34
+ "gitHead": "4e43f69e542667e1b83485832a65bfa12371786a"
35
35
  }