@webtypen/webframez-core 0.2.45 → 0.2.47

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.
@@ -324,6 +324,29 @@ class Datatable {
324
324
  if (filterEl && filterEl.ignore) {
325
325
  continue;
326
326
  }
327
+ // Handle Boolean
328
+ if (filterEl.type === "boolean") {
329
+ if ((typeof valueClean === "boolean" && valueClean) || (valueClean && valueClean.toString() === "true")) {
330
+ out[filterEl && filterEl.mapping && filterEl.mapping.trim() !== "" ? filterEl.mapping : key] = true;
331
+ continue;
332
+ }
333
+ }
334
+ // Handle integer/float range
335
+ if ((filterEl.type === "integer-range" || filterEl.type === "float-range") && valueClean !== undefined) {
336
+ if (valueClean.indexOf("-") > 0) {
337
+ const range = valueClean.split("-");
338
+ const min = range[0].toString().replace(",", ".");
339
+ const max = range[1].toString().replace(",", ".");
340
+ value = {
341
+ $gte: filterEl.type === "float-range" ? parseFloat(min) : parseInt(min),
342
+ $lte: filterEl.type === "float-range" ? parseFloat(max) : parseInt(max),
343
+ };
344
+ }
345
+ else {
346
+ value = filterEl.type === "float-range" ? parseFloat(valueClean.toString().replace(",", ".")) : parseInt(valueClean);
347
+ }
348
+ continue;
349
+ }
327
350
  switch (operator) {
328
351
  case "empty":
329
352
  value = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -337,6 +337,32 @@ export class Datatable {
337
337
  continue;
338
338
  }
339
339
 
340
+ // Handle Boolean
341
+ if (filterEl.type === "boolean") {
342
+ if ((typeof valueClean === "boolean" && valueClean) || (valueClean && valueClean.toString() === "true")) {
343
+ out[filterEl && filterEl.mapping && filterEl.mapping.trim() !== "" ? filterEl.mapping : key] = true;
344
+ continue;
345
+ }
346
+ }
347
+
348
+ // Handle integer/float range
349
+ if ((filterEl.type === "integer-range" || filterEl.type === "float-range") && valueClean !== undefined) {
350
+ if (valueClean.indexOf("-") > 0) {
351
+ const range = valueClean.split("-");
352
+ const min = range[0].toString().replace(",", ".");
353
+ const max = range[1].toString().replace(",", ".");
354
+
355
+ value = {
356
+ $gte: filterEl.type === "float-range" ? parseFloat(min) : parseInt(min),
357
+ $lte: filterEl.type === "float-range" ? parseFloat(max) : parseInt(max),
358
+ };
359
+ } else {
360
+ value = filterEl.type === "float-range" ? parseFloat(valueClean.toString().replace(",", ".")) : parseInt(valueClean);
361
+ }
362
+
363
+ continue;
364
+ }
365
+
340
366
  switch (operator) {
341
367
  case "empty":
342
368
  value = null;