@knime/kds-components 0.25.0 → 0.25.2

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.css CHANGED
@@ -1070,7 +1070,7 @@ html.kds-legacy {
1070
1070
  }
1071
1071
 
1072
1072
  .kds-menu-container {
1073
- &[data-v-69149ee8] {
1073
+ &[data-v-76ab9f2c] {
1074
1074
  display: flex;
1075
1075
  flex-direction: column;
1076
1076
  gap: var(--kds-spacing-container-0-10x);
@@ -1082,7 +1082,7 @@ html.kds-legacy {
1082
1082
  border-radius: var(--kds-border-radius-container-0-50x);
1083
1083
  box-shadow: var(--kds-elevation-level-3);
1084
1084
  }
1085
- &[data-v-69149ee8]:focus-visible {
1085
+ &[data-v-76ab9f2c]:focus-visible {
1086
1086
  outline: var(--kds-border-action-focused);
1087
1087
  outline-offset: var(--kds-spacing-offset-focus);
1088
1088
  }
package/dist/index.js CHANGED
@@ -1756,19 +1756,15 @@ const useListItemKeyboardNav = (options) => {
1756
1756
  event.preventDefault();
1757
1757
  break;
1758
1758
  case "Enter":
1759
- if (activeId.value && targetItem) {
1760
- options.triggers?.onEnter?.(activeId.value, targetItem, event);
1761
- event.preventDefault();
1762
- }
1759
+ options.triggers?.onEnter?.(activeId.value, targetItem, event);
1760
+ event.preventDefault();
1763
1761
  break;
1764
1762
  case " ":
1765
1763
  if (isTextInput(event.target)) {
1766
1764
  break;
1767
1765
  }
1768
- if (activeId.value && targetItem) {
1769
- options.triggers?.onSpace?.(activeId.value, targetItem, event);
1770
- event.preventDefault();
1771
- }
1766
+ options.triggers?.onSpace?.(activeId.value, targetItem, event);
1767
+ event.preventDefault();
1772
1768
  break;
1773
1769
  case "Home":
1774
1770
  activeId.value = enabledItems.value[0].id;
@@ -2192,7 +2188,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
2192
2188
  () => selectableItems.value.filter((item) => !item.disabled)
2193
2189
  );
2194
2190
  const handleItemInteraction = (item, event) => {
2195
- const id = toUnprefixedId(item.id);
2191
+ const id = toUnprefixedId(item?.id);
2196
2192
  const originalItem = props.items.find((i) => i.id === id);
2197
2193
  try {
2198
2194
  originalItem?.handler?.(originalItem, event);
@@ -2252,7 +2248,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
2252
2248
  }
2253
2249
  });
2254
2250
 
2255
- const KdsMenuContainer = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-69149ee8"]]);
2251
+ const KdsMenuContainer = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-76ab9f2c"]]);
2256
2252
 
2257
2253
  const kdsPopoverPlacement = {
2258
2254
  CUSTOM: "custom"
@@ -11247,7 +11243,16 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
11247
11243
  const popoverIsVisible = ref(false);
11248
11244
  const popoverRef = useTemplateRef("popoverRef");
11249
11245
  const datePickerRef = useTemplateRef("datePickerRef");
11250
- const { displayValue, isEmpty, isComplete, isValidDate, segments } = useDateInputMask(modelValue);
11246
+ const { displayValue, isEmpty, isComplete, isValidDate, parsedDate, segments } = useDateInputMask(modelValue);
11247
+ const clampToRange = (date) => {
11248
+ if (__props.minDate && Un.PlainDate.compare(date, __props.minDate) < 0) {
11249
+ return __props.minDate;
11250
+ }
11251
+ if (__props.maxDate && Un.PlainDate.compare(date, __props.maxDate) > 0) {
11252
+ return __props.maxDate;
11253
+ }
11254
+ return date;
11255
+ };
11251
11256
  const inputError = ref(false);
11252
11257
  const monthFormatter = new Intl.DateTimeFormat("en-US", {
11253
11258
  month: "long",
@@ -11301,7 +11306,14 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
11301
11306
  inputError.value = false;
11302
11307
  return;
11303
11308
  }
11304
- inputError.value = !isComplete.value || !isValidDate.value;
11309
+ const valid = isComplete.value && isValidDate.value;
11310
+ inputError.value = !valid;
11311
+ if (valid && parsedDate.value) {
11312
+ const clamped = clampToRange(parsedDate.value);
11313
+ if (!parsedDate.value.equals(clamped)) {
11314
+ displayValue.value = clamped.toString({ calendarName: "never" });
11315
+ }
11316
+ }
11305
11317
  };
11306
11318
  watch([isEmpty, isComplete, isValidDate], () => {
11307
11319
  if (inputError.value && (isEmpty.value || isComplete.value && isValidDate.value)) {