@knime/kds-components 0.25.0 → 0.25.1
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.js
CHANGED
|
@@ -11247,7 +11247,16 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
11247
11247
|
const popoverIsVisible = ref(false);
|
|
11248
11248
|
const popoverRef = useTemplateRef("popoverRef");
|
|
11249
11249
|
const datePickerRef = useTemplateRef("datePickerRef");
|
|
11250
|
-
const { displayValue, isEmpty, isComplete, isValidDate, segments } = useDateInputMask(modelValue);
|
|
11250
|
+
const { displayValue, isEmpty, isComplete, isValidDate, parsedDate, segments } = useDateInputMask(modelValue);
|
|
11251
|
+
const clampToRange = (date) => {
|
|
11252
|
+
if (__props.minDate && Un.PlainDate.compare(date, __props.minDate) < 0) {
|
|
11253
|
+
return __props.minDate;
|
|
11254
|
+
}
|
|
11255
|
+
if (__props.maxDate && Un.PlainDate.compare(date, __props.maxDate) > 0) {
|
|
11256
|
+
return __props.maxDate;
|
|
11257
|
+
}
|
|
11258
|
+
return date;
|
|
11259
|
+
};
|
|
11251
11260
|
const inputError = ref(false);
|
|
11252
11261
|
const monthFormatter = new Intl.DateTimeFormat("en-US", {
|
|
11253
11262
|
month: "long",
|
|
@@ -11301,7 +11310,14 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
11301
11310
|
inputError.value = false;
|
|
11302
11311
|
return;
|
|
11303
11312
|
}
|
|
11304
|
-
|
|
11313
|
+
const valid = isComplete.value && isValidDate.value;
|
|
11314
|
+
inputError.value = !valid;
|
|
11315
|
+
if (valid && parsedDate.value) {
|
|
11316
|
+
const clamped = clampToRange(parsedDate.value);
|
|
11317
|
+
if (!parsedDate.value.equals(clamped)) {
|
|
11318
|
+
displayValue.value = clamped.toString({ calendarName: "never" });
|
|
11319
|
+
}
|
|
11320
|
+
}
|
|
11305
11321
|
};
|
|
11306
11322
|
watch([isEmpty, isComplete, isValidDate], () => {
|
|
11307
11323
|
if (inputError.value && (isEmpty.value || isComplete.value && isValidDate.value)) {
|