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/dist/sprintify-ui.es.js +2103 -2102
- package/package.json +1 -1
- package/src/components/BaseDatePicker.stories.js +1 -1
- package/src/components/BaseDatePicker.vue +23 -20
package/package.json
CHANGED
|
@@ -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
|
-
|
|
194
|
-
(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
() =>
|
|
210
|
-
(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
205
|
+
() => modelValueFormatted.value,
|
|
206
|
+
() => {
|
|
207
|
+
setPickerDate();
|
|
208
|
+
},
|
|
209
|
+
{ immediate: true }
|
|
210
|
+
);
|
|
214
211
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
212
|
+
function setPickerDate() {
|
|
213
|
+
if (!picker) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
219
216
|
|
|
220
|
-
|
|
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() {
|