sprintify-ui 0.0.144 → 0.0.145

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,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.0.144",
3
+ "version": "0.0.145",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -21,7 +21,7 @@ export default {
21
21
  const Template = (args) => ({
22
22
  components: { BaseDatePicker, ShowValue },
23
23
  setup() {
24
- const value = ref('2023-01-10T10:00:00Z');
24
+ const value = ref('2022-01-01');
25
25
  return { value, args };
26
26
  },
27
27
  template: `
@@ -190,15 +190,11 @@ const flatpickrConfig = computed(() => {
190
190
  });
191
191
 
192
192
  // Make sure the model value is always formatted on the parent component
193
- watch(
194
- () => modelValueFormatted.value,
195
- () => {
196
- if (props.modelValue !== modelValueFormatted.value) {
197
- emitUpdate(modelValueFormatted.value);
198
- }
199
- },
200
- { immediate: true }
201
- );
193
+ onMounted(() => {
194
+ if (props.modelValue !== modelValueFormatted.value) {
195
+ emitUpdate(modelValueFormatted.value);
196
+ }
197
+ });
202
198
 
203
199
  /*
204
200
  | Flatpickr does not seem to observe changes in the value attribute of the input.
@@ -206,20 +202,25 @@ watch(
206
202
  | and manually react and apply the changes on the picker
207
203
  */
208
204
  watch(
209
- () => props.modelValue,
210
- (newValue) => {
211
- if (!picker) {
212
- return;
213
- }
205
+ () => modelValueFormatted.value,
206
+ () => {
207
+ setPickerDate();
208
+ },
209
+ { immediate: true }
210
+ );
214
211
 
215
- if (!newValue) {
216
- picker.clear();
217
- return;
218
- }
212
+ function setPickerDate() {
213
+ if (!picker) {
214
+ return;
215
+ }
219
216
 
220
- picker.setDate(newValue, false);
217
+ if (!modelValueFormatted.value) {
218
+ picker.clear();
219
+ return;
221
220
  }
222
- );
221
+
222
+ picker.setDate(modelValueFormatted.value, false);
223
+ }
223
224
 
224
225
  /*
225
226
  | If the props in flatpickrConfig are changed
@@ -283,6 +284,8 @@ function init() {
283
284
  emitUpdate(listDate[0]);
284
285
  },
285
286
  });
287
+
288
+ setPickerDate();
286
289
  }
287
290
 
288
291
  function clear() {