@dolusoft/vue3-datatable 1.8.29 → 1.8.31
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/dist/vue3-datatable.cjs +20 -10
- package/dist/vue3-datatable.js +20 -10
- package/package.json +1 -1
package/dist/vue3-datatable.cjs
CHANGED
|
@@ -3174,16 +3174,24 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3174
3174
|
if (!newValues) return;
|
|
3175
3175
|
newValues.forEach((colState) => {
|
|
3176
3176
|
if (colState.field) {
|
|
3177
|
-
|
|
3178
|
-
|
|
3177
|
+
const currentInputValue = filterInputs.value[colState.field] ?? "";
|
|
3178
|
+
const newInputValue = colState.value ?? "";
|
|
3179
|
+
const hasValue = newInputValue !== "" && newInputValue !== null && newInputValue !== void 0;
|
|
3180
|
+
if (String(currentInputValue) !== String(newInputValue)) {
|
|
3181
|
+
filterInputs.value[colState.field] = newInputValue;
|
|
3179
3182
|
}
|
|
3180
|
-
if (
|
|
3181
|
-
columnConditions.value[colState.field]
|
|
3183
|
+
if (hasValue && colState.condition) {
|
|
3184
|
+
const currentCondition = columnConditions.value[colState.field] ?? "";
|
|
3185
|
+
if (currentCondition !== colState.condition) {
|
|
3186
|
+
columnConditions.value[colState.field] = colState.condition;
|
|
3187
|
+
}
|
|
3188
|
+
} else if (!hasValue) {
|
|
3189
|
+
columnConditions.value[colState.field] = "";
|
|
3182
3190
|
}
|
|
3183
3191
|
}
|
|
3184
3192
|
});
|
|
3185
3193
|
},
|
|
3186
|
-
{ deep: true }
|
|
3194
|
+
{ deep: true, immediate: true }
|
|
3187
3195
|
);
|
|
3188
3196
|
vue.onMounted(() => {
|
|
3189
3197
|
setupColumnWatches();
|
|
@@ -3795,7 +3803,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
3795
3803
|
item.search = item.search !== void 0 ? item.search : true;
|
|
3796
3804
|
item.sort = item.sort !== void 0 ? item.sort : true;
|
|
3797
3805
|
item.html = item.html !== void 0 ? item.html : false;
|
|
3798
|
-
item.
|
|
3806
|
+
if (item.value !== void 0 && item.value !== null && item.value !== "") {
|
|
3807
|
+
item.condition = item.condition || "Equal";
|
|
3808
|
+
} else {
|
|
3809
|
+
item.condition = "";
|
|
3810
|
+
}
|
|
3799
3811
|
}
|
|
3800
3812
|
const filterItems = vue.ref([]);
|
|
3801
3813
|
const currentPage = vue.ref(props.page);
|
|
@@ -4131,16 +4143,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4131
4143
|
* Set column filter value and optionally trigger filter
|
|
4132
4144
|
* @param field - Column field name
|
|
4133
4145
|
* @param value - Filter value
|
|
4134
|
-
* @param condition - Filter condition (default:
|
|
4146
|
+
* @param condition - Filter condition (default: Equal)
|
|
4135
4147
|
* @param triggerFilter - Whether to trigger filterChange event (default: false)
|
|
4136
4148
|
*/
|
|
4137
4149
|
setColumnFilter(field, value, condition, triggerFilter = false) {
|
|
4138
4150
|
const column = props.columns.find((col) => col.field === field);
|
|
4139
4151
|
if (column) {
|
|
4140
4152
|
column.value = value;
|
|
4141
|
-
|
|
4142
|
-
column.condition = condition;
|
|
4143
|
-
}
|
|
4153
|
+
column.condition = condition || "Equal";
|
|
4144
4154
|
updateHasAnyActiveFilter();
|
|
4145
4155
|
if (triggerFilter) {
|
|
4146
4156
|
filterChange();
|
package/dist/vue3-datatable.js
CHANGED
|
@@ -3173,16 +3173,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3173
3173
|
if (!newValues) return;
|
|
3174
3174
|
newValues.forEach((colState) => {
|
|
3175
3175
|
if (colState.field) {
|
|
3176
|
-
|
|
3177
|
-
|
|
3176
|
+
const currentInputValue = filterInputs.value[colState.field] ?? "";
|
|
3177
|
+
const newInputValue = colState.value ?? "";
|
|
3178
|
+
const hasValue = newInputValue !== "" && newInputValue !== null && newInputValue !== void 0;
|
|
3179
|
+
if (String(currentInputValue) !== String(newInputValue)) {
|
|
3180
|
+
filterInputs.value[colState.field] = newInputValue;
|
|
3178
3181
|
}
|
|
3179
|
-
if (
|
|
3180
|
-
columnConditions.value[colState.field]
|
|
3182
|
+
if (hasValue && colState.condition) {
|
|
3183
|
+
const currentCondition = columnConditions.value[colState.field] ?? "";
|
|
3184
|
+
if (currentCondition !== colState.condition) {
|
|
3185
|
+
columnConditions.value[colState.field] = colState.condition;
|
|
3186
|
+
}
|
|
3187
|
+
} else if (!hasValue) {
|
|
3188
|
+
columnConditions.value[colState.field] = "";
|
|
3181
3189
|
}
|
|
3182
3190
|
}
|
|
3183
3191
|
});
|
|
3184
3192
|
},
|
|
3185
|
-
{ deep: true }
|
|
3193
|
+
{ deep: true, immediate: true }
|
|
3186
3194
|
);
|
|
3187
3195
|
onMounted(() => {
|
|
3188
3196
|
setupColumnWatches();
|
|
@@ -3794,7 +3802,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3794
3802
|
item.search = item.search !== void 0 ? item.search : true;
|
|
3795
3803
|
item.sort = item.sort !== void 0 ? item.sort : true;
|
|
3796
3804
|
item.html = item.html !== void 0 ? item.html : false;
|
|
3797
|
-
item.
|
|
3805
|
+
if (item.value !== void 0 && item.value !== null && item.value !== "") {
|
|
3806
|
+
item.condition = item.condition || "Equal";
|
|
3807
|
+
} else {
|
|
3808
|
+
item.condition = "";
|
|
3809
|
+
}
|
|
3798
3810
|
}
|
|
3799
3811
|
const filterItems = ref([]);
|
|
3800
3812
|
const currentPage = ref(props.page);
|
|
@@ -4130,16 +4142,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4130
4142
|
* Set column filter value and optionally trigger filter
|
|
4131
4143
|
* @param field - Column field name
|
|
4132
4144
|
* @param value - Filter value
|
|
4133
|
-
* @param condition - Filter condition (default:
|
|
4145
|
+
* @param condition - Filter condition (default: Equal)
|
|
4134
4146
|
* @param triggerFilter - Whether to trigger filterChange event (default: false)
|
|
4135
4147
|
*/
|
|
4136
4148
|
setColumnFilter(field, value, condition, triggerFilter = false) {
|
|
4137
4149
|
const column = props.columns.find((col) => col.field === field);
|
|
4138
4150
|
if (column) {
|
|
4139
4151
|
column.value = value;
|
|
4140
|
-
|
|
4141
|
-
column.condition = condition;
|
|
4142
|
-
}
|
|
4152
|
+
column.condition = condition || "Equal";
|
|
4143
4153
|
updateHasAnyActiveFilter();
|
|
4144
4154
|
if (triggerFilter) {
|
|
4145
4155
|
filterChange();
|