@dolusoft/vue3-datatable 1.8.12 → 1.8.13

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.
@@ -3820,12 +3820,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3820
3820
  const col = props.columns.find((d) => d.isUnique);
3821
3821
  return (col == null ? void 0 : col.field) || null;
3822
3822
  });
3823
- const hasAnyActiveFilter = vue.computed(() => {
3824
- if (!props.columns) return false;
3825
- return props.columns.some((col) => {
3823
+ const hasAnyActiveFilter = vue.ref(false);
3824
+ const updateHasAnyActiveFilter = () => {
3825
+ hasAnyActiveFilter.value = props.columns.some((col) => {
3826
3826
  return col.value !== void 0 && col.value !== null && col.value !== "";
3827
3827
  });
3828
- });
3828
+ };
3829
3829
  const rowKeys = vue.computed(() => {
3830
3830
  if (!uniqueKey.value) return null;
3831
3831
  return new Map(
@@ -4192,6 +4192,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4192
4192
  }
4193
4193
  selectAll(false);
4194
4194
  filterRows();
4195
+ updateHasAnyActiveFilter();
4195
4196
  };
4196
4197
  vue.watch(() => props.rows, changeRows);
4197
4198
  const setPageSize = (pagesize) => {
@@ -4257,6 +4258,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4257
4258
  };
4258
4259
  const filterChange = () => {
4259
4260
  selectAll(false);
4261
+ updateHasAnyActiveFilter();
4260
4262
  if (props.isServerMode) {
4261
4263
  if (currentPage.value === 1) {
4262
4264
  changeForServer("filter", true);
@@ -4420,13 +4422,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4420
4422
  });
4421
4423
  };
4422
4424
  const clearAllFilters = () => {
4423
- var _a2;
4424
4425
  for (const col of props.columns) {
4425
4426
  if (col.filter) {
4426
4427
  col.value = "";
4427
- col.condition = ((_a2 = col.type) == null ? void 0 : _a2.toLowerCase()) === "string" ? "Contains" : "Equal";
4428
+ col.condition = "";
4428
4429
  }
4429
4430
  }
4431
+ updateHasAnyActiveFilter();
4430
4432
  filterChange();
4431
4433
  emit("clearAllFilters");
4432
4434
  };
@@ -3819,12 +3819,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3819
3819
  const col = props.columns.find((d) => d.isUnique);
3820
3820
  return (col == null ? void 0 : col.field) || null;
3821
3821
  });
3822
- const hasAnyActiveFilter = computed(() => {
3823
- if (!props.columns) return false;
3824
- return props.columns.some((col) => {
3822
+ const hasAnyActiveFilter = ref(false);
3823
+ const updateHasAnyActiveFilter = () => {
3824
+ hasAnyActiveFilter.value = props.columns.some((col) => {
3825
3825
  return col.value !== void 0 && col.value !== null && col.value !== "";
3826
3826
  });
3827
- });
3827
+ };
3828
3828
  const rowKeys = computed(() => {
3829
3829
  if (!uniqueKey.value) return null;
3830
3830
  return new Map(
@@ -4191,6 +4191,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4191
4191
  }
4192
4192
  selectAll(false);
4193
4193
  filterRows();
4194
+ updateHasAnyActiveFilter();
4194
4195
  };
4195
4196
  watch(() => props.rows, changeRows);
4196
4197
  const setPageSize = (pagesize) => {
@@ -4256,6 +4257,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4256
4257
  };
4257
4258
  const filterChange = () => {
4258
4259
  selectAll(false);
4260
+ updateHasAnyActiveFilter();
4259
4261
  if (props.isServerMode) {
4260
4262
  if (currentPage.value === 1) {
4261
4263
  changeForServer("filter", true);
@@ -4419,13 +4421,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4419
4421
  });
4420
4422
  };
4421
4423
  const clearAllFilters = () => {
4422
- var _a2;
4423
4424
  for (const col of props.columns) {
4424
4425
  if (col.filter) {
4425
4426
  col.value = "";
4426
- col.condition = ((_a2 = col.type) == null ? void 0 : _a2.toLowerCase()) === "string" ? "Contains" : "Equal";
4427
+ col.condition = "";
4427
4428
  }
4428
4429
  }
4430
+ updateHasAnyActiveFilter();
4429
4431
  filterChange();
4430
4432
  emit("clearAllFilters");
4431
4433
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolusoft/vue3-datatable",
3
- "version": "1.8.12",
3
+ "version": "1.8.13",
4
4
  "description": "Vue3 Datatable - fully customizable & easy to use datatable library",
5
5
  "private": false,
6
6
  "type": "module",