@dolusoft/vue3-datatable 1.8.16 → 1.8.18

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,25 +3124,25 @@ 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
- const isEmpty = newValue === "" || newValue === null || newValue === void 0;
3135
- if (isEmpty) {
3136
- column.condition = "";
3137
- columnConditions.value[col.field] = "";
3138
- } else if (currentCondition) {
3139
- column.condition = currentCondition;
3140
- } else {
3141
- column.condition = "Equal";
3142
- columnConditions.value[col.field] = column.condition;
3143
- }
3144
- 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;
3145
3133
  }
3134
+ if (isEmpty) {
3135
+ column.condition = "";
3136
+ columnConditions.value[col.field] = "";
3137
+ console.log("🔴 [COLUMN-HEADER] CLEARED:", col.field, { value: column.value, condition: column.condition });
3138
+ } else if (!columnConditions.value[col.field]) {
3139
+ column.condition = "Equal";
3140
+ columnConditions.value[col.field] = "Equal";
3141
+ console.log("🟢 [COLUMN-HEADER] SET DEFAULT:", col.field, { value: column.value, condition: column.condition });
3142
+ } else {
3143
+ console.log("🟡 [COLUMN-HEADER] KEEP EXISTING:", col.field, { value: column.value, condition: column.condition });
3144
+ }
3145
+ emit("filterChange");
3146
3146
  },
3147
3147
  { debounce: 300 }
3148
3148
  );
@@ -4355,6 +4355,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4355
4355
  const changeForServer = (changeType, isResetPage = false) => {
4356
4356
  if (props.isServerMode) {
4357
4357
  setDefaultCondition();
4358
+ const activeFilters = props.columns.filter((c) => c.value || c.condition);
4359
+ console.log("🔵 [CUSTOM-TABLE] changeForServer:", changeType, {
4360
+ activeFilters: activeFilters.map((c) => ({ field: c.field, value: c.value, condition: c.condition })),
4361
+ allColumns: props.columns.map((c) => ({ field: c.field, value: c.value, condition: c.condition }))
4362
+ });
4358
4363
  const res = {
4359
4364
  current_page: isResetPage ? 1 : currentPage.value,
4360
4365
  pagesize: currentPageSize.value,
@@ -3123,25 +3123,25 @@ 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
- const isEmpty = newValue === "" || newValue === null || newValue === void 0;
3134
- if (isEmpty) {
3135
- column.condition = "";
3136
- columnConditions.value[col.field] = "";
3137
- } else if (currentCondition) {
3138
- column.condition = currentCondition;
3139
- } else {
3140
- column.condition = "Equal";
3141
- columnConditions.value[col.field] = column.condition;
3142
- }
3143
- 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;
3144
3132
  }
3133
+ if (isEmpty) {
3134
+ column.condition = "";
3135
+ columnConditions.value[col.field] = "";
3136
+ console.log("🔴 [COLUMN-HEADER] CLEARED:", col.field, { value: column.value, condition: column.condition });
3137
+ } else if (!columnConditions.value[col.field]) {
3138
+ column.condition = "Equal";
3139
+ columnConditions.value[col.field] = "Equal";
3140
+ console.log("🟢 [COLUMN-HEADER] SET DEFAULT:", col.field, { value: column.value, condition: column.condition });
3141
+ } else {
3142
+ console.log("🟡 [COLUMN-HEADER] KEEP EXISTING:", col.field, { value: column.value, condition: column.condition });
3143
+ }
3144
+ emit("filterChange");
3145
3145
  },
3146
3146
  { debounce: 300 }
3147
3147
  );
@@ -4354,6 +4354,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4354
4354
  const changeForServer = (changeType, isResetPage = false) => {
4355
4355
  if (props.isServerMode) {
4356
4356
  setDefaultCondition();
4357
+ const activeFilters = props.columns.filter((c) => c.value || c.condition);
4358
+ console.log("🔵 [CUSTOM-TABLE] changeForServer:", changeType, {
4359
+ activeFilters: activeFilters.map((c) => ({ field: c.field, value: c.value, condition: c.condition })),
4360
+ allColumns: props.columns.map((c) => ({ field: c.field, value: c.value, condition: c.condition }))
4361
+ });
4357
4362
  const res = {
4358
4363
  current_page: isResetPage ? 1 : currentPage.value,
4359
4364
  pagesize: currentPageSize.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolusoft/vue3-datatable",
3
- "version": "1.8.16",
3
+ "version": "1.8.18",
4
4
  "description": "Vue3 Datatable - fully customizable & easy to use datatable library",
5
5
  "private": false,
6
6
  "type": "module",