edvoyui-component-library-test-flight 0.0.29 → 0.0.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "edvoyui-component-library-test-flight",
3
3
  "private": false,
4
- "version": "0.0.29",
4
+ "version": "0.0.31",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist/",
@@ -138,7 +138,20 @@ const { modelValue, isUtc, clearIcon } = toRefs(props);
138
138
 
139
139
  // const datepicker = ref( props.modelValue ? props.modelValue : props.timePicker ? time.value : props.range ? [startDate.value, endDate.value] : startDate.value);
140
140
 
141
- const datepicker = ref(props.modelValue)
141
+ const datepicker = ref(props.modelValue || (props.range ? [] : null))
142
+
143
+ //Date clear
144
+ watch(
145
+ () => props.modelValue,
146
+ (newValue) => {
147
+ if (newValue === null || newValue === undefined || (Array.isArray(newValue) && newValue.length === 0)) {
148
+ datepicker.value = props.range ? [] : null;;
149
+ } else {
150
+ datepicker.value = newValue;
151
+ }
152
+ },
153
+ { immediate: true }
154
+ );
142
155
 
143
156
  watch(
144
157
  datepicker,
@@ -33,6 +33,7 @@
33
33
  :icon="CalendarIcon"
34
34
  iconType="startIcon"
35
35
  />
36
+ <EUIButton @click="resetFilter">Reset</EUIButton>
36
37
  </div>
37
38
 
38
39
  <div>
@@ -165,7 +166,8 @@ import EUITable from "./table/EUITable.vue";
165
166
  import EUITooltip from "./tooltip/EUITooltip.vue";
166
167
  import EUISearch from "./searchInput/EUISearch.vue";
167
168
  import EUIDatepicker from "./datepicker/EUIDatepicker.vue";
168
- import { CalculatorIcon, CalendarIcon } from "@heroicons/vue/24/solid";
169
+ import { CalendarIcon } from "@heroicons/vue/24/solid";
170
+ import EUIButton from "./button/EUIButton.vue";
169
171
 
170
172
  // TODO: Datepicker
171
173
  const datepickerRange = ref([
@@ -215,6 +217,10 @@ const onSort = (field: string, order: string) => {
215
217
  return 0;
216
218
  });
217
219
  };
220
+
221
+ const resetFilter = () => {
222
+ datepickerRange.value = []
223
+ }
218
224
  </script>
219
225
 
220
226
  <style scoped></style> -->