@dolusoft/vue3-datatable 1.8.29 → 1.8.30
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 +15 -6
- package/dist/vue3-datatable.js +15 -6
- package/package.json +1 -1
package/dist/vue3-datatable.cjs
CHANGED
|
@@ -3174,16 +3174,21 @@ 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
|
+
if (String(currentInputValue) !== String(newInputValue)) {
|
|
3180
|
+
filterInputs.value[colState.field] = newInputValue;
|
|
3179
3181
|
}
|
|
3180
|
-
if (colState.condition
|
|
3181
|
-
columnConditions.value[colState.field]
|
|
3182
|
+
if (colState.condition) {
|
|
3183
|
+
const currentCondition = columnConditions.value[colState.field] ?? "";
|
|
3184
|
+
if (currentCondition !== colState.condition) {
|
|
3185
|
+
columnConditions.value[colState.field] = colState.condition;
|
|
3186
|
+
}
|
|
3182
3187
|
}
|
|
3183
3188
|
}
|
|
3184
3189
|
});
|
|
3185
3190
|
},
|
|
3186
|
-
{ deep: true }
|
|
3191
|
+
{ deep: true, immediate: true }
|
|
3187
3192
|
);
|
|
3188
3193
|
vue.onMounted(() => {
|
|
3189
3194
|
setupColumnWatches();
|
|
@@ -4131,15 +4136,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4131
4136
|
* Set column filter value and optionally trigger filter
|
|
4132
4137
|
* @param field - Column field name
|
|
4133
4138
|
* @param value - Filter value
|
|
4134
|
-
* @param condition - Filter condition (default: column's default
|
|
4139
|
+
* @param condition - Filter condition (default: column type's default)
|
|
4135
4140
|
* @param triggerFilter - Whether to trigger filterChange event (default: false)
|
|
4136
4141
|
*/
|
|
4137
4142
|
setColumnFilter(field, value, condition, triggerFilter = false) {
|
|
4143
|
+
var _a2;
|
|
4138
4144
|
const column = props.columns.find((col) => col.field === field);
|
|
4139
4145
|
if (column) {
|
|
4140
4146
|
column.value = value;
|
|
4141
4147
|
if (condition) {
|
|
4142
4148
|
column.condition = condition;
|
|
4149
|
+
} else {
|
|
4150
|
+
const type = ((_a2 = column.type) == null ? void 0 : _a2.toLowerCase()) || "string";
|
|
4151
|
+
column.condition = type === "string" ? "Contains" : "Equal";
|
|
4143
4152
|
}
|
|
4144
4153
|
updateHasAnyActiveFilter();
|
|
4145
4154
|
if (triggerFilter) {
|
package/dist/vue3-datatable.js
CHANGED
|
@@ -3173,16 +3173,21 @@ 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
|
+
if (String(currentInputValue) !== String(newInputValue)) {
|
|
3179
|
+
filterInputs.value[colState.field] = newInputValue;
|
|
3178
3180
|
}
|
|
3179
|
-
if (colState.condition
|
|
3180
|
-
columnConditions.value[colState.field]
|
|
3181
|
+
if (colState.condition) {
|
|
3182
|
+
const currentCondition = columnConditions.value[colState.field] ?? "";
|
|
3183
|
+
if (currentCondition !== colState.condition) {
|
|
3184
|
+
columnConditions.value[colState.field] = colState.condition;
|
|
3185
|
+
}
|
|
3181
3186
|
}
|
|
3182
3187
|
}
|
|
3183
3188
|
});
|
|
3184
3189
|
},
|
|
3185
|
-
{ deep: true }
|
|
3190
|
+
{ deep: true, immediate: true }
|
|
3186
3191
|
);
|
|
3187
3192
|
onMounted(() => {
|
|
3188
3193
|
setupColumnWatches();
|
|
@@ -4130,15 +4135,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4130
4135
|
* Set column filter value and optionally trigger filter
|
|
4131
4136
|
* @param field - Column field name
|
|
4132
4137
|
* @param value - Filter value
|
|
4133
|
-
* @param condition - Filter condition (default: column's default
|
|
4138
|
+
* @param condition - Filter condition (default: column type's default)
|
|
4134
4139
|
* @param triggerFilter - Whether to trigger filterChange event (default: false)
|
|
4135
4140
|
*/
|
|
4136
4141
|
setColumnFilter(field, value, condition, triggerFilter = false) {
|
|
4142
|
+
var _a2;
|
|
4137
4143
|
const column = props.columns.find((col) => col.field === field);
|
|
4138
4144
|
if (column) {
|
|
4139
4145
|
column.value = value;
|
|
4140
4146
|
if (condition) {
|
|
4141
4147
|
column.condition = condition;
|
|
4148
|
+
} else {
|
|
4149
|
+
const type = ((_a2 = column.type) == null ? void 0 : _a2.toLowerCase()) || "string";
|
|
4150
|
+
column.condition = type === "string" ? "Contains" : "Equal";
|
|
4142
4151
|
}
|
|
4143
4152
|
updateHasAnyActiveFilter();
|
|
4144
4153
|
if (triggerFilter) {
|