@wallarm-org/design-system 0.66.2 → 0.66.3-rc-feature-AS-1146.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.
@@ -12,10 +12,19 @@ interface UseValueMenuDisplayValuesOptions {
12
12
  highlightValue?: ConditionValue;
13
13
  }
14
14
  /**
15
- * Compose the dropdown list, pinning selected entries at the top.
16
- * Remembers every option ever rendered so a narrowed `values` (e.g. dynamic
17
- * getSuggestions) can still display the selected label/badge; fabricates a
18
- * plain-text option as last resort. Unselected items still respect the filter.
15
+ * Compose the dropdown list.
16
+ *
17
+ * Single-select: pins the selected entry at the top so it is immediately
18
+ * visible even when the list is long.
19
+ *
20
+ * Multi-select: keeps the original `filteredValues` order so selecting an
21
+ * item does not cause the list to jump. Only checked items that are absent
22
+ * from `filteredValues` (e.g. after `values` narrowed via dynamic
23
+ * getSuggestions) are prepended at the top so they remain accessible.
24
+ *
25
+ * Remembers every option ever rendered so a narrowed `values` can still
26
+ * display the selected label/badge; fabricates a plain-text option as last
27
+ * resort.
19
28
  */
20
29
  export declare const useValueMenuDisplayValues: ({ values, filteredValues, multiSelect, checkedValues, highlightValue, }: UseValueMenuDisplayValuesOptions) => ValueOption[];
21
30
  export {};
@@ -11,6 +11,20 @@ const useValueMenuDisplayValues = ({ values, filteredValues, multiSelect, checke
11
11
  highlightValue
12
12
  ] : [];
13
13
  if (0 === selectedList.length) return filteredValues;
14
+ if (multiSelect) {
15
+ const filteredSet = new Set(filteredValues.map((v)=>String(v.value)));
16
+ const orphaned = selectedList.filter((v)=>!filteredSet.has(String(v))).map((v)=>{
17
+ const key = String(v);
18
+ return values.find((opt)=>String(opt.value) === key) ?? optionMemoryRef.current.get(key) ?? {
19
+ value: v,
20
+ label: key
21
+ };
22
+ });
23
+ return orphaned.length > 0 ? [
24
+ ...orphaned,
25
+ ...filteredValues
26
+ ] : filteredValues;
27
+ }
14
28
  const selectedSet = new Set(selectedList.map(String));
15
29
  const selectedItems = selectedList.map((v)=>{
16
30
  const key = String(v);
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.66.1",
3
- "generatedAt": "2026-06-23T06:08:24.695Z",
2
+ "version": "0.66.2",
3
+ "generatedAt": "2026-06-23T08:39:48.713Z",
4
4
  "components": [
5
5
  {
6
6
  "name": "Accordion",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wallarm-org/design-system",
3
- "version": "0.66.2",
3
+ "version": "0.66.3-rc-feature-AS-1146.1",
4
4
  "description": "Core design system library with React components and Storybook documentation",
5
5
  "publishConfig": {
6
6
  "access": "public",