@dolusoft/vue3-datatable 1.8.14 → 1.8.17

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.
@@ -3124,21 +3124,21 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
3124
3124
  () => filterInputs.value[col.field],
3125
3125
  (newValue) => {
3126
3126
  const column = columnsMap.value.get(col.field);
3127
- const currentCondition = columnConditions.value[col.field] || (column == null ? void 0 : column.condition);
3128
- if (column) {
3129
- if (column.type === "string" || column.type === "String") {
3130
- column.value = typeof newValue === "string" ? newValue.trim() : newValue;
3131
- } else {
3132
- column.value = newValue;
3133
- }
3134
- if (currentCondition) {
3135
- column.condition = currentCondition;
3136
- } else if (column.value) {
3137
- column.condition = "Equal";
3138
- columnConditions.value[col.field] = column.condition;
3139
- }
3140
- emit("filterChange");
3127
+ if (!column) return;
3128
+ const isEmpty = newValue === "" || newValue === null || newValue === void 0;
3129
+ if (column.type === "string" || column.type === "String") {
3130
+ column.value = isEmpty ? "" : typeof newValue === "string" ? newValue.trim() : newValue;
3131
+ } else {
3132
+ column.value = isEmpty ? "" : newValue;
3141
3133
  }
3134
+ if (isEmpty) {
3135
+ column.condition = "";
3136
+ columnConditions.value[col.field] = "";
3137
+ } else if (!columnConditions.value[col.field]) {
3138
+ column.condition = "Equal";
3139
+ columnConditions.value[col.field] = "Equal";
3140
+ }
3141
+ emit("filterChange");
3142
3142
  },
3143
3143
  { debounce: 300 }
3144
3144
  );
@@ -3123,21 +3123,21 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3123
3123
  () => filterInputs.value[col.field],
3124
3124
  (newValue) => {
3125
3125
  const column = columnsMap.value.get(col.field);
3126
- const currentCondition = columnConditions.value[col.field] || (column == null ? void 0 : column.condition);
3127
- if (column) {
3128
- if (column.type === "string" || column.type === "String") {
3129
- column.value = typeof newValue === "string" ? newValue.trim() : newValue;
3130
- } else {
3131
- column.value = newValue;
3132
- }
3133
- if (currentCondition) {
3134
- column.condition = currentCondition;
3135
- } else if (column.value) {
3136
- column.condition = "Equal";
3137
- columnConditions.value[col.field] = column.condition;
3138
- }
3139
- emit("filterChange");
3126
+ if (!column) return;
3127
+ const isEmpty = newValue === "" || newValue === null || newValue === void 0;
3128
+ if (column.type === "string" || column.type === "String") {
3129
+ column.value = isEmpty ? "" : typeof newValue === "string" ? newValue.trim() : newValue;
3130
+ } else {
3131
+ column.value = isEmpty ? "" : newValue;
3140
3132
  }
3133
+ if (isEmpty) {
3134
+ column.condition = "";
3135
+ columnConditions.value[col.field] = "";
3136
+ } else if (!columnConditions.value[col.field]) {
3137
+ column.condition = "Equal";
3138
+ columnConditions.value[col.field] = "Equal";
3139
+ }
3140
+ emit("filterChange");
3141
3141
  },
3142
3142
  { debounce: 300 }
3143
3143
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolusoft/vue3-datatable",
3
- "version": "1.8.14",
3
+ "version": "1.8.17",
4
4
  "description": "Vue3 Datatable - fully customizable & easy to use datatable library",
5
5
  "private": false,
6
6
  "type": "module",