@knime/kds-components 6.10.0 → 6.12.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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as kdsPopoverRole, c as kdsPopoverTypes, i as kdsPopoverPlacements, l as _plugin_vue_export_helper_default, o as kdsPopoverRoles, r as kdsPopoverPlacement, s as kdsPopoverType, t as KdsPopover_default, u as __exportAll$1 } from "./KdsPopover-DBU9xVEK.js";
2
2
  import { a as useKdsIsTruncated, i as elementOverflowsHorizontally, n as useIcon, r as vKdsTooltip, t as KdsIcon_default } from "./KdsIcon-B-82z79O.js";
3
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createPropsRestProxy, createSlots, createTextVNode, createVNode, defineAsyncComponent, defineComponent, effectScope, getCurrentInstance, guardReactiveProps, h, inject, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onUnmounted, openBlock, provide, readonly, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, toRef, toRefs, unref, useAttrs, useCssVars, useId, useModel, useSlots, useTemplateRef, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
4
- import { onClickOutside, useElementSize, useLocalStorage, useMousePressed, usePreferredDark, useResizeObserver, useTemplateRefsList, useVirtualList } from "@vueuse/core";
3
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createPropsRestProxy, createSlots, createTextVNode, createVNode, defineAsyncComponent, defineComponent, effectScope, getCurrentInstance, guardReactiveProps, h, inject, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onScopeDispose, onUnmounted, openBlock, provide, readonly, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, toRef, toRefs, unref, useAttrs, useCssVars, useId, useModel, useSlots, useTemplateRef, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
4
+ import { onClickOutside, useElementSize, useEventListener, useLocalStorage, useMousePressed, usePreferredDark, useRafFn, useResizeObserver, useTemplateRefsList, useVirtualList } from "@vueuse/core";
5
5
  import './index.css';//#region src/components/accessories/Avatar/enums.ts
6
6
  var kdsAvatarSize = {
7
7
  SMALL: "small",
@@ -10254,7 +10254,7 @@ var _hoisted_3$33 = {
10254
10254
  class: "content"
10255
10255
  };
10256
10256
  var _hoisted_4$29 = { class: "label" };
10257
- var _hoisted_5$15 = ["id"];
10257
+ var _hoisted_5$16 = ["id"];
10258
10258
  var _hoisted_6$11 = {
10259
10259
  key: 0,
10260
10260
  class: "subtext-wrapper"
@@ -10334,7 +10334,7 @@ var BaseCheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
10334
10334
  key: 0,
10335
10335
  id: unref(helperId),
10336
10336
  class: "helper-text"
10337
- }, toDisplayString(props.helperText), 9, _hoisted_5$15)) : createCommentVNode("", true)])) : createCommentVNode("", true)], 10, _hoisted_1$71)), [[unref(vKdsTooltip), props.tooltip]]), props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", _hoisted_6$11, [createVNode(KdsSubText_default, {
10337
+ }, toDisplayString(props.helperText), 9, _hoisted_5$16)) : createCommentVNode("", true)])) : createCommentVNode("", true)], 10, _hoisted_1$71)), [[unref(vKdsTooltip), props.tooltip]]), props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", _hoisted_6$11, [createVNode(KdsSubText_default, {
10338
10338
  id: unref(descriptionId),
10339
10339
  "sub-text": props.subText,
10340
10340
  "preserve-sub-text-space": props.preserveSubTextSpace,
@@ -11014,7 +11014,7 @@ var _hoisted_2$42 = {
11014
11014
  };
11015
11015
  var _hoisted_3$31 = { class: "content" };
11016
11016
  var _hoisted_4$28 = { class: "label" };
11017
- var _hoisted_5$14 = {
11017
+ var _hoisted_5$15 = {
11018
11018
  key: 0,
11019
11019
  class: "prefix"
11020
11020
  };
@@ -11023,7 +11023,8 @@ var _hoisted_6$10 = {
11023
11023
  class: "subtext"
11024
11024
  };
11025
11025
  var _hoisted_7$3 = { class: "trailing-item" };
11026
- var _hoisted_8$3 = {
11026
+ var _hoisted_8$3 = { class: "trailing-default" };
11027
+ var _hoisted_9$2 = {
11027
11028
  key: 3,
11028
11029
  class: "trailing-item-reserve-space"
11029
11030
  };
@@ -11060,9 +11061,21 @@ var KdsListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
11060
11061
  type: Boolean,
11061
11062
  default: false
11062
11063
  },
11064
+ dragHandle: {
11065
+ type: Boolean,
11066
+ default: false
11067
+ },
11068
+ dragging: {
11069
+ type: Boolean,
11070
+ default: false
11071
+ },
11072
+ showHandle: {
11073
+ type: Boolean,
11074
+ default: false
11075
+ },
11063
11076
  role: { default: "option" }
11064
11077
  },
11065
- emits: ["click"],
11078
+ emits: ["click", "dragHandlePointerDown"],
11066
11079
  setup(__props, { emit: __emit }) {
11067
11080
  const props = createPropsRestProxy(__props, [
11068
11081
  "variant",
@@ -11071,6 +11084,9 @@ var KdsListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
11071
11084
  "active",
11072
11085
  "missing",
11073
11086
  "disabled",
11087
+ "dragHandle",
11088
+ "dragging",
11089
+ "showHandle",
11074
11090
  "role"
11075
11091
  ]);
11076
11092
  const emit = __emit;
@@ -11097,7 +11113,9 @@ var KdsListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
11097
11113
  selected: __props.selected,
11098
11114
  active: __props.active,
11099
11115
  missing: __props.missing,
11100
- disabled: __props.disabled
11116
+ disabled: __props.disabled,
11117
+ dragging: __props.dragging,
11118
+ "show-handle": __props.showHandle
11101
11119
  }
11102
11120
  ]),
11103
11121
  onClick
@@ -11111,7 +11129,7 @@ var KdsListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
11111
11129
  "size",
11112
11130
  "disabled"
11113
11131
  ])])) : createCommentVNode("", true),
11114
- createElementVNode("span", _hoisted_3$31, [withDirectives((openBlock(), createElementBlock("span", _hoisted_4$28, [__props.missing ? (openBlock(), createElementBlock("span", _hoisted_5$14, "(Missing)\xA0")) : createCommentVNode("", true), createElementVNode("span", { class: normalizeClass({ special: __props.special }) }, toDisplayString(props.text), 3)])), [[
11132
+ createElementVNode("span", _hoisted_3$31, [withDirectives((openBlock(), createElementBlock("span", _hoisted_4$28, [__props.missing ? (openBlock(), createElementBlock("span", _hoisted_5$15, "(Missing)\xA0")) : createCommentVNode("", true), createElementVNode("span", { class: normalizeClass({ special: __props.special }) }, toDisplayString(props.text), 3)])), [[
11115
11133
  unref(vKdsTooltip),
11116
11134
  props.text,
11117
11135
  "truncated"
@@ -11120,7 +11138,7 @@ var KdsListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
11120
11138
  props.subText,
11121
11139
  "truncated"
11122
11140
  ]]) : createCommentVNode("", true)]),
11123
- createElementVNode("span", _hoisted_7$3, [
11141
+ createElementVNode("span", _hoisted_7$3, [createElementVNode("span", _hoisted_8$3, [
11124
11142
  props.shortcut && props.shortcut.length > 0 ? (openBlock(), createBlock(unref(KdsKeyboardShortcut_default), {
11125
11143
  key: 0,
11126
11144
  shortcut: props.shortcut
@@ -11139,12 +11157,23 @@ var KdsListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
11139
11157
  size: "small",
11140
11158
  name: props.trailingIcon
11141
11159
  }, null, 8, ["name"])) : createCommentVNode("", true),
11142
- !props.shortcut && !props.trailingIcon && !props.badge ? (openBlock(), createElementBlock("span", _hoisted_8$3)) : createCommentVNode("", true)
11143
- ])
11160
+ !props.shortcut && !props.trailingIcon && !props.badge ? (openBlock(), createElementBlock("span", _hoisted_9$2)) : createCommentVNode("", true)
11161
+ ]), __props.dragHandle && !__props.disabled ? (openBlock(), createElementBlock("span", {
11162
+ key: 0,
11163
+ class: "drag-handle",
11164
+ "aria-hidden": "true",
11165
+ onPointerdown: _cache[0] || (_cache[0] = withModifiers(($event) => emit("dragHandlePointerDown", $event), ["stop"])),
11166
+ onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop", "prevent"])),
11167
+ onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"])),
11168
+ onDblclick: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"]))
11169
+ }, [createVNode(KdsIcon_default, {
11170
+ name: "drag-handle",
11171
+ size: "small"
11172
+ })], 32)) : createCommentVNode("", true)])
11144
11173
  ], 10, _hoisted_1$66);
11145
11174
  };
11146
11175
  }
11147
- }), [["__scopeId", "data-v-f03ff793"]]);
11176
+ }), [["__scopeId", "data-v-8aa0bee9"]]);
11148
11177
  //#endregion
11149
11178
  //#region src/components/lists/ListContainer/ListItem/ListItemSectionTitle/ListItemSectionTitle.vue?vue&type=script&setup=true&lang.ts
11150
11179
  var _hoisted_1$65 = { class: "kds-list-item-section-title" };
@@ -12785,7 +12814,7 @@ var _hoisted_3$28 = [
12785
12814
  "aria-autocomplete"
12786
12815
  ];
12787
12816
  var _hoisted_4$26 = ["aria-disabled"];
12788
- var _hoisted_5$13 = {
12817
+ var _hoisted_5$14 = {
12789
12818
  key: 4,
12790
12819
  class: "trailing-slot"
12791
12820
  };
@@ -13013,7 +13042,7 @@ focus: focusInput });
13013
13042
  tooltip: "Clear",
13014
13043
  onClick: withModifiers(clearAndFocusInput, ["stop"])
13015
13044
  })) : createCommentVNode("", true),
13016
- _ctx.$slots.trailing ? (openBlock(), createElementBlock("div", _hoisted_5$13, [renderSlot(_ctx.$slots, "trailing", {}, void 0, true)])) : createCommentVNode("", true),
13045
+ _ctx.$slots.trailing ? (openBlock(), createElementBlock("div", _hoisted_5$14, [renderSlot(_ctx.$slots, "trailing", {}, void 0, true)])) : createCommentVNode("", true),
13017
13046
  props.trailingIcon ? (openBlock(), createElementBlock("div", _hoisted_6$9, [createVNode(KdsIcon_default, { name: props.trailingIcon }, null, 8, ["name"])])) : createCommentVNode("", true)
13018
13047
  ], 2);
13019
13048
  };
@@ -13901,7 +13930,7 @@ var _hoisted_3$26 = {
13901
13930
  class: "breadcrumb-label"
13902
13931
  };
13903
13932
  var _hoisted_4$25 = ["aria-label", "aria-current"];
13904
- var _hoisted_5$12 = {
13933
+ var _hoisted_5$13 = {
13905
13934
  key: 1,
13906
13935
  class: "breadcrumb-label"
13907
13936
  };
@@ -13968,7 +13997,7 @@ var BreadcrumbItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
13968
13997
  key: 0,
13969
13998
  name: __props.item.leadingIcon,
13970
13999
  class: "breadcrumb-icon"
13971
- }, null, 8, ["name"])) : createCommentVNode("", true), __props.item.text ? withDirectives((openBlock(), createElementBlock("span", _hoisted_5$12, [createTextVNode(toDisplayString(__props.item.text), 1)])), [[
14000
+ }, null, 8, ["name"])) : createCommentVNode("", true), __props.item.text ? withDirectives((openBlock(), createElementBlock("span", _hoisted_5$13, [createTextVNode(toDisplayString(__props.item.text), 1)])), [[
13972
14001
  unref(vKdsTooltip),
13973
14002
  __props.item.title,
13974
14003
  "truncated"
@@ -14823,7 +14852,7 @@ var _hoisted_4$19 = {
14823
14852
  key: 0,
14824
14853
  class: "content"
14825
14854
  };
14826
- var _hoisted_5$11 = { class: "label" };
14855
+ var _hoisted_5$12 = { class: "label" };
14827
14856
  //#endregion
14828
14857
  //#region src/components/forms/ToggleSwitch/KdsToggleSwitch.vue
14829
14858
  var KdsToggleSwitch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -14876,7 +14905,7 @@ var KdsToggleSwitch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
14876
14905
  }, [createElementVNode("div", _hoisted_2$27, [createElementVNode("div", _hoisted_3$20, [createVNode(KdsIcon_default, {
14877
14906
  name: isChecked.value ? "checkmark" : "x-close",
14878
14907
  size: __props.size === "small" ? "xsmall" : "small"
14879
- }, null, 8, ["name", "size"])])]), props.label ? (openBlock(), createElementBlock("div", _hoisted_4$19, [createElementVNode("span", _hoisted_5$11, toDisplayString(props.label), 1)])) : createCommentVNode("", true)], 10, _hoisted_1$46);
14908
+ }, null, 8, ["name", "size"])])]), props.label ? (openBlock(), createElementBlock("div", _hoisted_4$19, [createElementVNode("span", _hoisted_5$12, toDisplayString(props.label), 1)])) : createCommentVNode("", true)], 10, _hoisted_1$46);
14880
14909
  };
14881
14910
  }
14882
14911
  }), [["__scopeId", "data-v-3f7f0351"]]);
@@ -14897,7 +14926,7 @@ var _hoisted_3$19 = {
14897
14926
  focusable: "false"
14898
14927
  };
14899
14928
  var _hoisted_4$18 = { class: "content" };
14900
- var _hoisted_5$10 = { class: "label" };
14929
+ var _hoisted_5$11 = { class: "label" };
14901
14930
  var _hoisted_6$8 = ["id"];
14902
14931
  //#endregion
14903
14932
  //#region src/components/forms/RadioButton/KdsRadioButton.vue
@@ -14950,7 +14979,7 @@ var KdsRadioButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
14950
14979
  cx: "1",
14951
14980
  cy: "1",
14952
14981
  r: "1"
14953
- }, null, -1)])])) : createCommentVNode("", true)]), createElementVNode("div", _hoisted_4$18, [createElementVNode("div", _hoisted_5$10, toDisplayString(props.text), 1), props.helperText ? (openBlock(), createElementBlock("div", {
14982
+ }, null, -1)])])) : createCommentVNode("", true)]), createElementVNode("div", _hoisted_4$18, [createElementVNode("div", _hoisted_5$11, toDisplayString(props.text), 1), props.helperText ? (openBlock(), createElementBlock("div", {
14954
14983
  key: 0,
14955
14984
  id: `${unref(id)}-helper`,
14956
14985
  class: "helper-text"
@@ -21008,7 +21037,7 @@ var _hoisted_4$16 = {
21008
21037
  class: "kds-date-picker-header-static-label",
21009
21038
  "aria-live": "polite"
21010
21039
  };
21011
- var _hoisted_5$9 = { class: "kds-date-picker-nav-block" };
21040
+ var _hoisted_5$10 = { class: "kds-date-picker-nav-block" };
21012
21041
  var _hoisted_6$7 = { class: "kds-date-picker-body" };
21013
21042
  var MONTHS_PER_YEAR = 12;
21014
21043
  var YEAR_PAGE_SIZE = 15;
@@ -21188,7 +21217,7 @@ var KdsDatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
21188
21217
  label: headerLabel.value,
21189
21218
  onClick: onHeaderLabelClick
21190
21219
  }, null, 8, ["label"])) : (openBlock(), createElementBlock("div", _hoisted_4$16, toDisplayString(headerLabel.value), 1)),
21191
- createElementVNode("div", _hoisted_5$9, [createVNode(KdsButton_default, {
21220
+ createElementVNode("div", _hoisted_5$10, [createVNode(KdsButton_default, {
21192
21221
  variant: "transparent",
21193
21222
  size: "small",
21194
21223
  "leading-icon": "chevron-right",
@@ -22315,7 +22344,7 @@ var _hoisted_4$15 = {
22315
22344
  key: 0,
22316
22345
  class: "kds-time-picker-fields"
22317
22346
  };
22318
- var _hoisted_5$8 = {
22347
+ var _hoisted_5$9 = {
22319
22348
  key: 1,
22320
22349
  class: "kds-time-picker-actions"
22321
22350
  };
@@ -22453,7 +22482,7 @@ var TimePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
22453
22482
  ariaLabel: "Remove milliseconds",
22454
22483
  tooltip: "Remove milliseconds",
22455
22484
  onClick: removeMilliseconds
22456
- })])) : __props.maxGranularity === "millisecond" ? (openBlock(), createElementBlock("div", _hoisted_5$8, [createVNode(KdsButton_default, {
22485
+ })])) : __props.maxGranularity === "millisecond" ? (openBlock(), createElementBlock("div", _hoisted_5$9, [createVNode(KdsButton_default, {
22457
22486
  variant: "outlined",
22458
22487
  size: "small",
22459
22488
  "leading-icon": "plus",
@@ -24480,6 +24509,156 @@ var KdsResizeContainer_default = /*#__PURE__*/ _plugin_vue_export_helper_default
24480
24509
  }
24481
24510
  }), [["__scopeId", "data-v-47708378"]]);
24482
24511
  //#endregion
24512
+ //#region src/components/forms/selects/MultiSelectListBox/useMultiSelectListBoxReorder.ts
24513
+ /** Distance from the top/bottom edge (px) where auto-scroll kicks in. */
24514
+ var AUTO_SCROLL_EDGE = spacing.container["1.5x"].value;
24515
+ /** Auto-scroll speed in px/s. */
24516
+ var AUTO_SCROLL_SPEED = 480;
24517
+ /**
24518
+ * Pointer-events based drag-to-reorder, owned by the list that renders the
24519
+ * rows. It resolves the drop target from the mounted row rects
24520
+ * (`data-option-index`) so it works with the virtualized list, and reports the
24521
+ * drop indicator in the container's coordinate space so the list can render it
24522
+ * inline (no body-level teleport, no viewport math).
24523
+ *
24524
+ * The dragged row's highlight is not handled here — the caller derives each
24525
+ * row's `dragging` prop from the returned `draggingIds`.
24526
+ */
24527
+ var useMultiSelectListBoxReorder = ({ orderedIds, selectedIds, disabled, getContainer, onReorder }) => {
24528
+ const draggingIds = ref([]);
24529
+ const indicator = ref(null);
24530
+ /** Latest pointer Y (viewport). Drives target resolution and auto-scroll. */
24531
+ let pointerY = 0;
24532
+ /** Index in `orderedIds` where the dragged item(s) should be inserted. */
24533
+ let insertIndex = null;
24534
+ /** Owns the window listeners bound for the active drag. */
24535
+ let dragScope = null;
24536
+ /** The scroll container, muted (`pointer-events: none`) during a drag. */
24537
+ let scrollContainer = null;
24538
+ /**
24539
+ * Set on the first pointer move. Rows are as tall as `AUTO_SCROLL_EDGE`, so
24540
+ * the handle of an edge row sits inside the auto-scroll band from the moment
24541
+ * it is pressed; without this, a plain click would scroll the list and commit
24542
+ * a reorder the user never dragged.
24543
+ */
24544
+ let hasMoved = false;
24545
+ const updateTarget = () => {
24546
+ const container = scrollContainer ?? getContainer();
24547
+ if (!container) return;
24548
+ const rows = Array.from(container.querySelectorAll("[data-option-index]")).filter((row) => Number(row.dataset.optionIndex) < orderedIds.value.length);
24549
+ if (rows.length === 0) return;
24550
+ const containerRect = container.getBoundingClientRect();
24551
+ let match = null;
24552
+ for (const row of rows) {
24553
+ const rect = row.getBoundingClientRect();
24554
+ const index = Number(row.dataset.optionIndex);
24555
+ if (pointerY < rect.top + rect.height / 2) {
24556
+ match = {
24557
+ rect,
24558
+ index,
24559
+ after: false
24560
+ };
24561
+ break;
24562
+ }
24563
+ match = {
24564
+ rect,
24565
+ index,
24566
+ after: true
24567
+ };
24568
+ }
24569
+ if (!match) return;
24570
+ insertIndex = match.index + (match.after ? 1 : 0);
24571
+ const edge = match.after ? match.rect.bottom : match.rect.top;
24572
+ indicator.value = {
24573
+ left: match.rect.left - containerRect.left + container.scrollLeft,
24574
+ width: match.rect.width,
24575
+ top: edge - containerRect.top + container.scrollTop
24576
+ };
24577
+ };
24578
+ /** -1 to scroll up, 1 to scroll down, 0 when the pointer is off both edges. */
24579
+ const autoScrollDirection = () => {
24580
+ const container = scrollContainer ?? getContainer();
24581
+ if (!container) return 0;
24582
+ const { top, bottom } = container.getBoundingClientRect();
24583
+ if (pointerY < top + AUTO_SCROLL_EDGE) return -1;
24584
+ if (pointerY > bottom - AUTO_SCROLL_EDGE) return 1;
24585
+ return 0;
24586
+ };
24587
+ const { pause: pauseAutoScroll, resume: resumeAutoScroll } = useRafFn(({ delta }) => {
24588
+ const container = scrollContainer ?? getContainer();
24589
+ const direction = autoScrollDirection();
24590
+ if (!container || direction === 0) return;
24591
+ container.scrollTop += direction * AUTO_SCROLL_SPEED * delta / 1e3;
24592
+ updateTarget();
24593
+ }, { immediate: false });
24594
+ /** Keep the loop running only while a moved pointer sits in one of the edges. */
24595
+ const syncAutoScroll = () => {
24596
+ if (!hasMoved || autoScrollDirection() === 0) pauseAutoScroll();
24597
+ else resumeAutoScroll();
24598
+ };
24599
+ const onPointerMove = (event) => {
24600
+ hasMoved = true;
24601
+ pointerY = event.clientY;
24602
+ updateTarget();
24603
+ syncAutoScroll();
24604
+ };
24605
+ const cleanup = () => {
24606
+ draggingIds.value = [];
24607
+ indicator.value = null;
24608
+ insertIndex = null;
24609
+ hasMoved = false;
24610
+ pauseAutoScroll();
24611
+ dragScope?.stop();
24612
+ dragScope = null;
24613
+ if (scrollContainer) {
24614
+ scrollContainer.style.pointerEvents = "";
24615
+ scrollContainer = null;
24616
+ }
24617
+ document.body.style.cursor = "";
24618
+ document.body.style.userSelect = "";
24619
+ };
24620
+ const finish = () => {
24621
+ const moving = draggingIds.value;
24622
+ const ids = [...orderedIds.value];
24623
+ const contextIntact = moving.every((id) => ids.includes(id));
24624
+ if (moving.length > 0 && insertIndex !== null && contextIntact) {
24625
+ const movingSet = new Set(moving);
24626
+ const removedBefore = ids.slice(0, insertIndex).filter((id) => movingSet.has(id)).length;
24627
+ const remaining = ids.filter((id) => !movingSet.has(id));
24628
+ const target = Math.min(insertIndex - removedBefore, remaining.length);
24629
+ remaining.splice(target, 0, ...moving);
24630
+ if (remaining.some((id, index) => id !== ids[index])) onReorder(remaining);
24631
+ }
24632
+ cleanup();
24633
+ };
24634
+ const startDrag = (event, id) => {
24635
+ if (disabled.value || event.button !== 0) return;
24636
+ event.preventDefault();
24637
+ const selection = new Set(selectedIds.value);
24638
+ draggingIds.value = selection.has(id) && selection.size > 1 ? orderedIds.value.filter((optionId) => selection.has(optionId)) : [id];
24639
+ pointerY = event.clientY;
24640
+ insertIndex = null;
24641
+ hasMoved = false;
24642
+ scrollContainer = getContainer();
24643
+ if (scrollContainer) scrollContainer.style.pointerEvents = "none";
24644
+ updateTarget();
24645
+ document.body.style.cursor = "grabbing";
24646
+ document.body.style.userSelect = "none";
24647
+ dragScope = effectScope();
24648
+ dragScope.run(() => {
24649
+ useEventListener(window, "pointermove", onPointerMove);
24650
+ useEventListener(window, "pointerup", finish);
24651
+ useEventListener(window, "pointercancel", cleanup);
24652
+ });
24653
+ };
24654
+ onScopeDispose(cleanup);
24655
+ return {
24656
+ draggingIds,
24657
+ indicator,
24658
+ startDrag
24659
+ };
24660
+ };
24661
+ //#endregion
24483
24662
  //#region src/components/forms/selects/MultiSelectListBox/useMultiSelectListBoxSelection.ts
24484
24663
  var CLICK_META_KEY_TIMEOUT = 250;
24485
24664
  var useMultiSelectListBoxSelection = ({ modelValue, allValues, disabled, generateOptionId, scrollToIndex }) => {
@@ -24714,6 +24893,10 @@ var _hoisted_3$11 = {
24714
24893
  class: "kds-multiselect-sticky-bottom"
24715
24894
  };
24716
24895
  var _hoisted_4$11 = {
24896
+ key: 0,
24897
+ class: "kds-multiselect-drop-indicator"
24898
+ };
24899
+ var _hoisted_5$8 = {
24717
24900
  key: 0,
24718
24901
  class: "kds-multiselect-empty"
24719
24902
  };
@@ -24748,6 +24931,10 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24748
24931
  type: Boolean,
24749
24932
  default: false
24750
24933
  },
24934
+ reorderable: {
24935
+ type: Boolean,
24936
+ default: false
24937
+ },
24751
24938
  bottomValue: {},
24752
24939
  emptyStateLabel: { default: "No entries in this list" },
24753
24940
  loading: {
@@ -24763,9 +24950,15 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24763
24950
  "doubleClickShift",
24764
24951
  "keyArrowLeft",
24765
24952
  "keyArrowRight",
24766
- "keyEnter"
24953
+ "keyEnter",
24954
+ "reorder"
24767
24955
  ], ["update:modelValue"]),
24768
24956
  setup(__props, { expose: __expose, emit: __emit }) {
24957
+ useCssVars((_ctx) => ({
24958
+ "v21e36790": dropIndicatorTop.value,
24959
+ "v1a85c12c": dropIndicatorLeft.value,
24960
+ "v36cf3141": dropIndicatorWidth.value
24961
+ }));
24769
24962
  const OPTION_LINE_HEIGHT = dimension.component.height["1.5x"].value + spacing.container["0.10x"].value;
24770
24963
  const DEFAULT_HEIGHT = dimension.component.height["20x"].value;
24771
24964
  const MIN_HEIGHT = dimension.component.height["12.5x"].value;
@@ -24781,6 +24974,7 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24781
24974
  "validating",
24782
24975
  "preserveSubTextSpace",
24783
24976
  "useResizeHandle",
24977
+ "reorderable",
24784
24978
  "emptyStateLabel",
24785
24979
  "loading"
24786
24980
  ]);
@@ -24826,6 +25020,31 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24826
25020
  generateOptionId,
24827
25021
  scrollToIndex
24828
25022
  });
25023
+ const { draggingIds, indicator: dropIndicator, startDrag } = useMultiSelectListBoxReorder({
25024
+ orderedIds: computed(() => visiblePossibleValues.value.map((option) => option.id)),
25025
+ selectedIds: modelValue,
25026
+ disabled: toRef(() => effectiveDisabled.value),
25027
+ getContainer: () => containerProps.ref.value,
25028
+ onReorder: (newOrder) => emit("reorder", newOrder)
25029
+ });
25030
+ /** The row currently under the pointer (for the group handle reveal). */
25031
+ const hoveredOptionId = ref(null);
25032
+ const hoveredSelectionActive = computed(() => draggingIds.value.length === 0 && hoveredOptionId.value !== null && isCurrentValue(hoveredOptionId.value));
25033
+ /**
25034
+ * Tracked only when `reorderable`, so a plain list box does not invalidate
25035
+ * `hoveredSelectionActive` — and re-render its rows — on every row hover.
25036
+ */
25037
+ const setHoveredOption = (id) => {
25038
+ if (__props.reorderable) hoveredOptionId.value = id;
25039
+ };
25040
+ const onDragHandlePointerDown = (event, id) => {
25041
+ hoveredOptionId.value = null;
25042
+ startDrag(event, id);
25043
+ };
25044
+ /** Drop indicator geometry as CSS lengths, consumed by `v-bind()` below. */
25045
+ const dropIndicatorTop = computed(() => `${dropIndicator.value?.top ?? 0}px`);
25046
+ const dropIndicatorLeft = computed(() => `${dropIndicator.value?.left ?? 0}px`);
25047
+ const dropIndicatorWidth = computed(() => `${dropIndicator.value?.width ?? 0}px`);
24829
25048
  const handleDblClick = (id, index) => {
24830
25049
  if (!effectiveDisabled.value) emit("doubleClickOnItem", id, index);
24831
25050
  };
@@ -24879,24 +25098,24 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24879
25098
  "aria-disabled": effectiveDisabled.value,
24880
25099
  class: "kds-multiselect-list-box-list",
24881
25100
  onKeydown: [
24882
- _cache[4] || (_cache[4] = withKeys(withModifiers((...args) => unref(onCtrlA) && unref(onCtrlA)(...args), [
25101
+ _cache[5] || (_cache[5] = withKeys(withModifiers((...args) => unref(onCtrlA) && unref(onCtrlA)(...args), [
24883
25102
  "ctrl",
24884
25103
  "prevent",
24885
25104
  "exact"
24886
25105
  ]), ["a"])),
24887
- _cache[5] || (_cache[5] = withKeys(withModifiers((...args) => unref(onCtrlA) && unref(onCtrlA)(...args), [
25106
+ _cache[6] || (_cache[6] = withKeys(withModifiers((...args) => unref(onCtrlA) && unref(onCtrlA)(...args), [
24888
25107
  "meta",
24889
25108
  "prevent",
24890
25109
  "exact"
24891
25110
  ]), ["a"])),
24892
- _cache[6] || (_cache[6] = withKeys(withModifiers((...args) => unref(onArrowUp) && unref(onArrowUp)(...args), ["prevent", "exact"]), ["up"])),
24893
- _cache[7] || (_cache[7] = withKeys(withModifiers((...args) => unref(onArrowDown) && unref(onArrowDown)(...args), ["prevent", "exact"]), ["down"])),
24894
- _cache[8] || (_cache[8] = withKeys(withModifiers((...args) => unref(onArrowUpShift) && unref(onArrowUpShift)(...args), [
25111
+ _cache[7] || (_cache[7] = withKeys(withModifiers((...args) => unref(onArrowUp) && unref(onArrowUp)(...args), ["prevent", "exact"]), ["up"])),
25112
+ _cache[8] || (_cache[8] = withKeys(withModifiers((...args) => unref(onArrowDown) && unref(onArrowDown)(...args), ["prevent", "exact"]), ["down"])),
25113
+ _cache[9] || (_cache[9] = withKeys(withModifiers((...args) => unref(onArrowUpShift) && unref(onArrowUpShift)(...args), [
24895
25114
  "shift",
24896
25115
  "prevent",
24897
25116
  "exact"
24898
25117
  ]), ["up"])),
24899
- _cache[9] || (_cache[9] = withKeys(withModifiers((...args) => unref(onArrowDownShift) && unref(onArrowDownShift)(...args), [
25118
+ _cache[10] || (_cache[10] = withKeys(withModifiers((...args) => unref(onArrowDownShift) && unref(onArrowDownShift)(...args), [
24900
25119
  "shift",
24901
25120
  "prevent",
24902
25121
  "exact"
@@ -24904,23 +25123,23 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24904
25123
  withKeys(withModifiers(onArrowLeft, ["prevent", "exact"]), ["left"]),
24905
25124
  withKeys(withModifiers(onArrowRight, ["prevent", "exact"]), ["right"]),
24906
25125
  withKeys(withModifiers(onEnter, ["prevent", "exact"]), ["enter"]),
24907
- _cache[10] || (_cache[10] = withKeys(withModifiers((...args) => unref(onHomeKey) && unref(onHomeKey)(...args), ["prevent", "exact"]), ["home"])),
24908
- _cache[11] || (_cache[11] = withKeys(withModifiers((...args) => unref(onEndKey) && unref(onEndKey)(...args), ["prevent", "exact"]), ["end"])),
24909
- _cache[12] || (_cache[12] = withKeys(withModifiers((...args) => unref(onHomeKeyShift) && unref(onHomeKeyShift)(...args), [
25126
+ _cache[11] || (_cache[11] = withKeys(withModifiers((...args) => unref(onHomeKey) && unref(onHomeKey)(...args), ["prevent", "exact"]), ["home"])),
25127
+ _cache[12] || (_cache[12] = withKeys(withModifiers((...args) => unref(onEndKey) && unref(onEndKey)(...args), ["prevent", "exact"]), ["end"])),
25128
+ _cache[13] || (_cache[13] = withKeys(withModifiers((...args) => unref(onHomeKeyShift) && unref(onHomeKeyShift)(...args), [
24910
25129
  "shift",
24911
25130
  "prevent",
24912
25131
  "exact"
24913
25132
  ]), ["home"])),
24914
- _cache[13] || (_cache[13] = withKeys(withModifiers((...args) => unref(onEndKeyShift) && unref(onEndKeyShift)(...args), [
25133
+ _cache[14] || (_cache[14] = withKeys(withModifiers((...args) => unref(onEndKeyShift) && unref(onEndKeyShift)(...args), [
24915
25134
  "shift",
24916
25135
  "prevent",
24917
25136
  "exact"
24918
25137
  ]), ["end"]))
24919
25138
  ],
24920
- onMousedown: _cache[14] || (_cache[14] = (...args) => unref(onStartDrag) && unref(onStartDrag)(...args)),
24921
- onMousemove: _cache[15] || (_cache[15] = (...args) => unref(onDrag) && unref(onDrag)(...args)),
24922
- onFocus: _cache[16] || (_cache[16] = (...args) => unref(onFocus) && unref(onFocus)(...args)),
24923
- onBlur: _cache[17] || (_cache[17] = (...args) => unref(onBlur) && unref(onBlur)(...args))
25139
+ onMousedown: _cache[15] || (_cache[15] = (...args) => unref(onStartDrag) && unref(onStartDrag)(...args)),
25140
+ onMousemove: _cache[16] || (_cache[16] = (...args) => unref(onDrag) && unref(onDrag)(...args)),
25141
+ onFocus: _cache[17] || (_cache[17] = (...args) => unref(onFocus) && unref(onFocus)(...args)),
25142
+ onBlur: _cache[18] || (_cache[18] = (...args) => unref(onBlur) && unref(onBlur)(...args))
24924
25143
  }), [createElementVNode("div", _hoisted_2$15, [createElementVNode("div", mergeProps({ class: "kds-multiselect-list-box-content" }, unref(wrapperProps)), [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(virtualList), ({ data: item, index }) => {
24925
25144
  return openBlock(), createBlock(unref(KdsListItem_default), {
24926
25145
  id: generateOptionId(item.id),
@@ -24935,8 +25154,14 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24935
25154
  disabled: effectiveDisabled.value,
24936
25155
  active: unref(isKeyboardNavigating) && unref(currentKeyNavIndex) === index,
24937
25156
  "trailing-icon": unref(isCurrentValue)(item.id) ? "checkmark" : void 0,
25157
+ "drag-handle": __props.reorderable,
25158
+ dragging: unref(draggingIds).includes(item.id),
25159
+ "show-handle": __props.reorderable && hoveredSelectionActive.value && unref(isCurrentValue)(item.id),
24938
25160
  onDblclick: [withModifiers(($event) => handleDblClick(item.id, index), ["exact"]), _cache[0] || (_cache[0] = withModifiers(($event) => handleShiftDblClick(), ["shift"]))],
24939
- onClick: ($event) => unref(handleClick)($event, item.id, index)
25161
+ onClick: ($event) => unref(handleClick)($event, item.id, index),
25162
+ onPointerenter: ($event) => setHoveredOption(item.id),
25163
+ onPointerleave: _cache[1] || (_cache[1] = ($event) => setHoveredOption(null)),
25164
+ onDragHandlePointerDown: ($event) => onDragHandlePointerDown($event, item.id)
24940
25165
  }, null, 8, [
24941
25166
  "id",
24942
25167
  "class",
@@ -24949,8 +25174,13 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24949
25174
  "disabled",
24950
25175
  "active",
24951
25176
  "trailing-icon",
25177
+ "drag-handle",
25178
+ "dragging",
25179
+ "show-handle",
24952
25180
  "onDblclick",
24953
- "onClick"
25181
+ "onClick",
25182
+ "onPointerenter",
25183
+ "onDragHandlePointerDown"
24954
25184
  ]);
24955
25185
  }), 128))], 16), visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$11, [createVNode(unref(KdsListItem_default), {
24956
25186
  id: generateOptionId(visibleBottomValue.value.id),
@@ -24963,8 +25193,8 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24963
25193
  active: unref(isKeyboardNavigating) && unref(currentKeyNavIndex) === bottomIndex.value,
24964
25194
  special: "",
24965
25195
  "trailing-icon": unref(isCurrentValue)(visibleBottomValue.value.id) ? "checkmark" : void 0,
24966
- onClick: _cache[1] || (_cache[1] = ($event) => unref(handleClick)($event, visibleBottomValue.value.id, bottomIndex.value)),
24967
- onDblclick: [_cache[2] || (_cache[2] = withModifiers(($event) => handleShiftDblClick(), ["shift"])), _cache[3] || (_cache[3] = withModifiers(($event) => handleDblClick(visibleBottomValue.value.id, bottomIndex.value), ["exact"]))]
25196
+ onClick: _cache[2] || (_cache[2] = ($event) => unref(handleClick)($event, visibleBottomValue.value.id, bottomIndex.value)),
25197
+ onDblclick: [_cache[3] || (_cache[3] = withModifiers(($event) => handleShiftDblClick(), ["shift"])), _cache[4] || (_cache[4] = withModifiers(($event) => handleDblClick(visibleBottomValue.value.id, bottomIndex.value), ["exact"]))]
24968
25198
  }, null, 8, [
24969
25199
  "id",
24970
25200
  "text",
@@ -24975,7 +25205,7 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24975
25205
  "disabled",
24976
25206
  "active",
24977
25207
  "trailing-icon"
24978
- ])])) : createCommentVNode("", true)])], 16, _hoisted_1$27), visiblePossibleValues.value.length === 0 && !visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$11, [createVNode(KdsEmptyState_default, {
25208
+ ])])) : createCommentVNode("", true)]), __props.reorderable && unref(dropIndicator) ? (openBlock(), createElementBlock("div", _hoisted_4$11)) : createCommentVNode("", true)], 16, _hoisted_1$27), visiblePossibleValues.value.length === 0 && !visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_5$8, [createVNode(KdsEmptyState_default, {
24979
25209
  headline: __props.loading ? "Loading data…" : __props.emptyStateLabel,
24980
25210
  "loading-spinner": __props.loading,
24981
25211
  disabled: __props.disabled
@@ -24999,7 +25229,7 @@ var KdsMultiSelectListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
24999
25229
  ]);
25000
25230
  };
25001
25231
  }
25002
- }), [["__scopeId", "data-v-47ef0dda"]]);
25232
+ }), [["__scopeId", "data-v-ff301db7"]]);
25003
25233
  //#endregion
25004
25234
  //#region src/components/forms/selects/TwinList/TwinListBody.vue?vue&type=script&setup=true&lang.ts
25005
25235
  var _hoisted_1$26 = { class: "kds-list-column" };
@@ -25804,7 +26034,9 @@ var KdsSortableListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_default
25804
26034
  disabled: __props.disabled,
25805
26035
  error: __props.error,
25806
26036
  "use-resize-handle": true,
25807
- ariaLabel: formFieldProps.label ?? formFieldProps.ariaLabel ?? ""
26037
+ reorderable: "",
26038
+ ariaLabel: formFieldProps.label ?? formFieldProps.ariaLabel ?? "",
26039
+ onReorder: applyReorder
25808
26040
  }, null, 8, [
25809
26041
  "modelValue",
25810
26042
  "possible-values",
@@ -25859,7 +26091,7 @@ var KdsSortableListBox_default = /*#__PURE__*/ _plugin_vue_export_helper_default
25859
26091
  ]);
25860
26092
  };
25861
26093
  }
25862
- }), [["__scopeId", "data-v-67724f60"]]);
26094
+ }), [["__scopeId", "data-v-5f1fae57"]]);
25863
26095
  //#endregion
25864
26096
  //#region src/components/forms/_helper/InfoPopover/InfoPopover.vue?vue&type=script&setup=true&lang.ts
25865
26097
  var _hoisted_1$23 = { class: "kds-info-popover-content" };