@knime/kds-components 11.1.0 → 11.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @knime/kds-components
2
2
 
3
+ ## 11.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c9ddc6e: `KdsListContainer`:
8
+
9
+ - emit `activeItemChange` with the id of the highlighted option whenever it changes (mouse, keyboard, focus/blur or list updates), or `undefined` when no option is active
10
+ - invoke an option's optional `handler` with the option and the triggering mouse or keyboard event when it is activated, before `itemClick` is emitted
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - @knime/kds-styles@11.2.0
16
+
17
+ ## 11.1.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 7dbad9a: `KdsDescription`: keep empty paragraphs and headings (e.g. produced by `KdsRichTextEditor`) visible as blank lines.
22
+ - 2c0897f: useKdsDarkMode: improve type of lightDark
23
+ - Updated dependencies
24
+ - @knime/kds-styles@11.1.1
25
+
3
26
  ## 11.1.0
4
27
 
5
28
  ### Patch Changes
package/dist/index.css CHANGED
@@ -1507,7 +1507,7 @@ body:has(dialog.modal[open]) {
1507
1507
  }
1508
1508
 
1509
1509
  .kds-list-container {
1510
- &[data-v-182cc69b] {
1510
+ &[data-v-23465b31] {
1511
1511
  position: relative;
1512
1512
  display: flex;
1513
1513
  flex-direction: column;
@@ -1516,23 +1516,23 @@ body:has(dialog.modal[open]) {
1516
1516
  padding: var(--kds-spacing-container-0-25x);
1517
1517
  overflow-y: auto;
1518
1518
  }
1519
- &.with-border[data-v-182cc69b] {
1519
+ &.with-border[data-v-23465b31] {
1520
1520
  border: var(--kds-border-base-subtle);
1521
1521
  border-radius: var(--kds-border-radius-container-0-31x);
1522
1522
  }
1523
- &[data-v-182cc69b]:focus-visible {
1523
+ &[data-v-23465b31]:focus-visible {
1524
1524
  outline: var(--kds-border-action-focused);
1525
1525
  outline-offset: var(--kds-spacing-offset-focus);
1526
1526
  border-radius: var(--kds-border-radius-container-0-31x);
1527
1527
  }
1528
1528
  }
1529
- .kds-list-container-empty[data-v-182cc69b] {
1529
+ .kds-list-container-empty[data-v-23465b31] {
1530
1530
  display: flex;
1531
1531
  flex: 1;
1532
1532
  align-items: center;
1533
1533
  justify-content: center;
1534
1534
  }
1535
- .kds-list-item-divider[data-v-182cc69b] {
1535
+ .kds-list-item-divider[data-v-23465b31] {
1536
1536
  flex-shrink: 0;
1537
1537
  width: 100%;
1538
1538
  padding: 0;
@@ -3815,17 +3815,26 @@ textarea[data-v-ec173ba8]::-webkit-scrollbar {
3815
3815
  }
3816
3816
 
3817
3817
  .description {
3818
- &[data-v-6d2e8d69] {
3818
+ &[data-v-69089f62] {
3819
3819
  font: var(--kds-font-base-body-small);
3820
3820
  color: var(--kds-color-text-and-icon-neutral);
3821
3821
  overflow-wrap: anywhere;
3822
3822
 
3823
3823
  /* stylelint-disable knime/no-deep-nesting */
3824
3824
  }
3825
- &.plain[data-v-6d2e8d69] {
3825
+ &.plain[data-v-69089f62] {
3826
3826
  white-space: pre-line;
3827
3827
  }
3828
- &[data-v-6d2e8d69] {
3828
+ &[data-v-69089f62] {
3829
+ h1,
3830
+ h2,
3831
+ h3,
3832
+ h4,
3833
+ h5,
3834
+ h6,
3835
+ p {
3836
+ min-height: 1lh;
3837
+ }
3829
3838
  p {
3830
3839
  & {
3831
3840
  padding: 0;
@@ -3964,7 +3973,7 @@ a {
3964
3973
  margin-left: var(--kds-spacing-container-0-12x);
3965
3974
  content: "";
3966
3975
  background-color: var(--link-color);
3967
- mask-image: var(--v43d54fac);
3976
+ mask-image: var(--a9aab1a4);
3968
3977
  mask-repeat: no-repeat;
3969
3978
  mask-size: contain;
3970
3979
  }
package/dist/index.js CHANGED
@@ -12360,7 +12360,7 @@ var KdsListContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
12360
12360
  default: false
12361
12361
  }
12362
12362
  },
12363
- emits: ["itemClick"],
12363
+ emits: ["itemClick", "activeItemChange"],
12364
12364
  setup(__props, { expose: __expose, emit: __emit }) {
12365
12365
  const props = createPropsRestProxy(__props, [
12366
12366
  "emptyText",
@@ -12375,12 +12375,28 @@ var KdsListContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
12375
12375
  if (elementId === emptyOptionId) return;
12376
12376
  return toUnprefixedId(elementId);
12377
12377
  }
12378
+ const handleItemInteraction = (elementId, event) => {
12379
+ const id = toOptionId(elementId);
12380
+ const originalItem = id === void 0 ? void 0 : props.possibleValues.find((item) => item.id === id);
12381
+ try {
12382
+ originalItem?.handler?.(originalItem, event);
12383
+ } catch (error) {
12384
+ console.error("Failed while calling item handler", {
12385
+ item: originalItem,
12386
+ error
12387
+ });
12388
+ }
12389
+ emit("itemClick", id);
12390
+ };
12378
12391
  /** Only selectable (non-section-headline) items */
12379
12392
  const selectableValues = computed(() => itemsWithPrefix.value.filter((item) => !item.sectionHeadline));
12380
12393
  const containerEl = useTemplateRef("containerEl");
12381
12394
  const enabledValues = computed(() => selectableValues.value.filter((o) => !o.disabled));
12382
12395
  const activeId = ref(void 0);
12383
12396
  const isFocused = ref(false);
12397
+ watch(computed(() => toOptionId(activeId.value)), (id) => {
12398
+ emit("activeItemChange", id);
12399
+ });
12384
12400
  function scrollToView() {
12385
12401
  if (!activeId.value || !containerEl.value) return;
12386
12402
  containerEl.value?.querySelector(`#${CSS.escape(activeId.value)}`)?.scrollIntoView({ block: "nearest" });
@@ -12419,12 +12435,12 @@ var KdsListContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
12419
12435
  event.preventDefault();
12420
12436
  break;
12421
12437
  case "Enter":
12422
- emit("itemClick", toOptionId(activeId.value));
12438
+ handleItemInteraction(activeId.value, event);
12423
12439
  event.preventDefault();
12424
12440
  break;
12425
12441
  case " ":
12426
12442
  if (isTextInput(event.target)) break;
12427
- emit("itemClick", toOptionId(activeId.value));
12443
+ handleItemInteraction(activeId.value, event);
12428
12444
  event.preventDefault();
12429
12445
  break;
12430
12446
  case "Home":
@@ -12519,7 +12535,7 @@ var KdsListContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
12519
12535
  "trailing-icon": item.missing && !item.disabled ? "trash" : item.selected ? "checkmark" : void 0,
12520
12536
  role: "option",
12521
12537
  onMousedown: _cache[0] || (_cache[0] = ($event) => props.controlledExternally && $event.preventDefault()),
12522
- onClick: ($event) => !item.disabled && emit("itemClick", toOptionId(item.id)),
12538
+ onClick: ($event) => !item.disabled && handleItemInteraction(item.id, $event),
12523
12539
  onMouseenter: ($event) => !item.disabled && (activeId.value = item.id)
12524
12540
  }, null, 8, [
12525
12541
  "id",
@@ -12559,7 +12575,7 @@ var KdsListContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
12559
12575
  //#endregion
12560
12576
  //#region src/components/lists/ListContainer/KdsListContainer.vue
12561
12577
  var KdsListContainer_exports = /* @__PURE__ */ __exportAll$1({ default: () => KdsListContainer_default });
12562
- var KdsListContainer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(KdsListContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-182cc69b"]]);
12578
+ var KdsListContainer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(KdsListContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-23465b31"]]);
12563
12579
  //#endregion
12564
12580
  //#region src/components/lists/ListContainer/ListItem/ListItemButton/KdsListItemButton.vue?vue&type=script&setup=true&lang.ts
12565
12581
  var _hoisted_1$64 = ["disabled"];
@@ -27015,7 +27031,7 @@ var KdsDescription_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
27015
27031
  }
27016
27032
  },
27017
27033
  setup(__props) {
27018
- useCssVars((_ctx) => ({ "v43d54fac": externalIcon }));
27034
+ useCssVars((_ctx) => ({ "a9aab1a4": externalIcon }));
27019
27035
  const externalIcon = `url("${external_link_default}")`;
27020
27036
  return (_ctx, _cache) => {
27021
27037
  return __props.renderAsHtml ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, { ..._ctx.$attrs }, {
@@ -27028,7 +27044,7 @@ var KdsDescription_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
27028
27044
  }, null, 8, _hoisted_2$15));
27029
27045
  };
27030
27046
  }
27031
- }), [["__scopeId", "data-v-6d2e8d69"]]);
27047
+ }), [["__scopeId", "data-v-69089f62"]]);
27032
27048
  //#endregion
27033
27049
  //#region src/components/visualizations/DonutChart/KdsDonutChart.vue?vue&type=script&setup=true&lang.ts
27034
27050
  var _hoisted_1$21 = { class: "donut-container" };