@wishbone-media/spark 0.15.2 → 0.15.3
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/index.css +1 -1
- package/dist/index.js +334 -329
- package/package.json +1 -1
- package/src/components/plugins/SparkTableDatePicker.vue +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="spark-table-date-picker">
|
|
3
3
|
<FormKit
|
|
4
|
+
:key="componentKey"
|
|
4
5
|
v-model="selectedDate"
|
|
5
6
|
type="datepicker"
|
|
6
7
|
picker-only
|
|
@@ -89,6 +90,7 @@ const props = defineProps({
|
|
|
89
90
|
const selectedDate = ref(null)
|
|
90
91
|
const label = props.config.label || null
|
|
91
92
|
const param = props.config.param || `filter[${props.config.key}]`
|
|
93
|
+
const componentKey = ref(`${param}-0`)
|
|
92
94
|
|
|
93
95
|
// Initialize from existing params
|
|
94
96
|
selectedDate.value = props.sparkTable.params[param] || null
|
|
@@ -105,12 +107,18 @@ watch(selectedDate, (newValue) => {
|
|
|
105
107
|
}
|
|
106
108
|
})
|
|
107
109
|
|
|
108
|
-
// Watch for external param changes
|
|
110
|
+
// Watch for external param changes (e.g., when reset button clears params)
|
|
109
111
|
watch(
|
|
110
112
|
() => props.sparkTable.params[param],
|
|
111
113
|
(newValue) => {
|
|
112
|
-
if (
|
|
114
|
+
if ((newValue === undefined || newValue === null || newValue === '') && selectedDate.value) {
|
|
113
115
|
selectedDate.value = null
|
|
116
|
+
// Force re-render of FormKit datepicker component to clear its internal state
|
|
117
|
+
// Increment the numeric suffix to create a new unique key
|
|
118
|
+
const currentCount = parseInt(componentKey.value.split('-').pop()) || 0
|
|
119
|
+
componentKey.value = `${param}-${currentCount + 1}`
|
|
120
|
+
} else if (newValue && newValue !== selectedDate.value) {
|
|
121
|
+
selectedDate.value = newValue
|
|
114
122
|
}
|
|
115
123
|
},
|
|
116
124
|
)
|