fluency-v8-components 1.4.9 → 1.5.0
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/fluency-v8-components.es.js +1 -1
- package/dist/fluency-v8-components.umd.js +33 -33
- package/dist/{index-RvcduEmd.mjs → index-CDvgNv2k.mjs} +169 -166
- package/dist/{index.es-le_XjTgU.mjs → index.es-BhZdsVoB.mjs} +1 -1
- package/package.json +1 -1
- package/src/components/common/DatePickerInput.vue +19 -7
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ const props = defineProps({
|
|
|
13
13
|
from: Number,
|
|
14
14
|
to: Number,
|
|
15
15
|
});
|
|
16
|
-
const emits = defineEmits(["selectTime"]);
|
|
16
|
+
const emits = defineEmits(["selectTime", "error"]);
|
|
17
17
|
const dateValue = ref(defaultRange());
|
|
18
18
|
|
|
19
19
|
watch(
|
|
@@ -44,12 +44,24 @@ watch(
|
|
|
44
44
|
|
|
45
45
|
watch(
|
|
46
46
|
dateValue,
|
|
47
|
-
(
|
|
48
|
-
if (Array.isArray(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
])
|
|
47
|
+
(newVal, oldVal) => {
|
|
48
|
+
if (Array.isArray(newVal) && newVal.length === 2 && newVal[0] && newVal[1]) {
|
|
49
|
+
if (newVal[0] > newVal[1]) {
|
|
50
|
+
// triggers component to break as component do not handle this case
|
|
51
|
+
emits('error', 'Time from is greater than time to')
|
|
52
|
+
} else if (Array.isArray(oldVal) && oldVal.length === 2 && oldVal[0] && oldVal[1]) {
|
|
53
|
+
if (oldVal[0] !== newVal[0] || oldVal[1] !== newVal[1]) {
|
|
54
|
+
emits("selectTime", [
|
|
55
|
+
moment(newVal[0]).valueOf(),
|
|
56
|
+
moment(newVal[1]).valueOf(),
|
|
57
|
+
]);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
emits("selectTime", [
|
|
61
|
+
moment(newVal[0]).valueOf(),
|
|
62
|
+
moment(newVal[1]).valueOf(),
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
53
65
|
}
|
|
54
66
|
},
|
|
55
67
|
{ deep: true }
|