Repository: zyfra/Prizm
Pull request #2437: 5.8.1
Author: login: ZurabDev
Labels: name: availability:reviewed
description: Ready to test
name: availability:tested
Created: 2025-03-26T13:14:10Z | Merged: 2025-03-27T13:10:40Z

## [5.8.1](https://github.com/zyfra/Prizm)

### Bugfixes

- fix(components/input-tree-multi-select): InputTreeMultiSelect: Fixed an issue where cloned values could not be unselected. Now, users can properly remove selected items. (#2353, #2352)
  (Added a test example in the documentation to verify the fix.)



Исправлена ошибка, из-за которой невозможно было снять выделение с клонированного значения в InputTreeMultiSelect. Теперь можно корректно удалять выбранные элементы.

Также в документацию добавлен пример для тестирования данной баги.


Diff:
diff --git a/apps/doc/src/app/about-prizm/changelog/CHANGELOG.md b/apps/doc/src/app/about-prizm/changelog/CHANGELOG.md
index 31e77b528..241aa209e 100644
--- a/apps/doc/src/app/about-prizm/changelog/CHANGELOG.md
+++ b/apps/doc/src/app/about-prizm/changelog/CHANGELOG.md
@@ -2,6 +2,13 @@
 
 All notable changes to this project will be documented in this file.
 
+## [5.8.1](https://github.com/zyfra/Prizm)
+
+### Bugfixes
+
+- fix(components/input-tree-multi-select): InputTreeMultiSelect: Fixed an issue where cloned values could not be unselected. Now, users can properly remove selected items. (#2353, #2352)
+  (Added a test example in the documentation to verify the fix.)
+
 ## [5.8.0](https://github.com/zyfra/Prizm)
 
 ### Features
diff --git a/apps/doc/src/app/components/input/input-tree-multi-select/examples/base/tree-select-base-example.component.html b/apps/doc/src/app/components/input/input-tree-multi-select/examples/base/tree-select-base-example.component.html
new file mode 100644
index 000000000..a8e6e806d
--- /dev/null
+++ b/apps/doc/src/app/components/input/input-tree-multi-select/examples/base/tree-select-base-example.component.html
@@ -0,0 +1,32 @@
+<prizm-input-layout label="Validators">
+  <prizm-input-tree-multi-select
+    #input
+    [mode]="'only-current'"
+    [stringify]="stringify"
+    [getChildren]="getChildren"
+    [formControl]="control"
+    [searchable]="true"
+    [identityMatcher]="identityMatcher"
+    [searchMatcher]="searchMatcher"
+  >
+    <prizm-data-list-wrapper *prizmDataList>
+      <ng-container *ngFor="let arrItem of items$ | async">
+        <prizm-input-tree-multi-select-item *prizmInputTreeMultiSelectItem="arrItem; let item = item">
+          {{ item.data.value }}
+        </prizm-input-tree-multi-select-item>
+      </ng-container>
+    </prizm-data-list-wrapper>
+  </prizm-input-tree-multi-select>
+</prizm-input-layout>
+
+<br />
+<br />
+<div style="display: flex; gap: 8px">
+  <button (click)="setDefaultValue()" prizmButton>
+    Set default value: <b>{{ items[1].data.value }}</b>
+  </button>
+  <button (click)="change()" prizmButton>Update Items</button>
+</div>
+
+<br />
+<br />
diff --git a/apps/doc/src/app/components/input/input-tree-multi-select/examples/base/tree-select-base-example.component.ts b/apps/doc/src/app/components/input/input-tree-multi-select/examples/base/tree-select-base-example.component.ts
new file mode 100644
index 000000000..ad0ba1788
--- /dev/null
+++ b/apps/doc/src/app/components/input/input-tree-multi-select/examples/base/tree-select-base-example.component.ts
@@ -0,0 +1,99 @@
+import { Component } from '@angular/core';
+import { PrizmMultiSelectIdentityMatcher, PrizmMultiSelectSearchMatcher } from '@prizm-ui/components';
+import { BehaviorSubject, delay } from 'rxjs';
+import { UntypedFormControl } from '@angular/forms';
+
+type TreeSelectItem = {
+  data: { value: string; id: string };
+  children?: TreeSelectItem[];
+};
+
+@Component({
+  selector: 'prizm-tree-select-base-example',
+  templateUrl: './tree-select-base-example.component.html',
+  styles: [
+    `
+      .box {
+        display: flex;
+        gap: 1rem;
+      }
+
+      .value {
+        overflow: hidden;
+        max-width: 100%;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+    `,
+  ],
+})
+export class PrizmTreeSelectBaseExampleComponent {
+  protected items: TreeSelectItem[] = [
+    {
+      data: {
+        value: 'One',
+        id: 'One',
+      },
+    },
+    {
+      data: {
+        value: 'Two',
+        id: 'Two',
+      },
+      children: [
+        {
+          data: {
+            value: 'first in two',
+            id: 'first in two',
+          },
+          children: [
+            {
+              data: {
+                value: 'first in first in two',
+                id: 'first in first in two',
+              },
+            },
+          ],
+        },
+        {
+          data: {
+            value: 'second in two',
+            id: 'second in two',
+          },
+        },
+      ],
+    },
+  ];
+  private selectedItems$$ = new BehaviorSubject<TreeSelectItem[]>(this.items);
+  protected items$ = this.selectedItems$$.pipe(delay(100));
+  public value = this.items[0];
+  readonly control = new UntypedFormControl([{ ...this.items[0] }]);
+
+  public stringify(item: TreeSelectItem | null): string {
+    return item?.data ? item.data.value : '';
+  }
+  public getChildren(item: TreeSelectItem): TreeSelectItem[] {
+    return item.children ?? [];
+  }
+
+  public searchMatcher: PrizmMultiSelectSearchMatcher<TreeSelectItem> = (
+    search: string,
+    item: TreeSelectItem
+  ) => {
+    return item.data.value?.toLowerCase().includes(search.toLowerCase());
+  };
+
+  public readonly identityMatcher: PrizmMultiSelectIdentityMatcher<TreeSelectItem> = (
+    a: TreeSelectItem,
+    b: TreeSelectItem
+  ): boolean => {
+    return a?.data.id === b?.data.id;
+  };
+
+  public setDefaultValue(): void {
+    this.control.setValue([{ ...this.items[1] }], { emitEvent: false });
+  }
+  public change(): void {
+    this.control.setValue(null);
+  }
+}
diff --git a/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.component.html b/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.component.html
index d2b8aa71f..d5cecef4f 100644
--- a/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.component.html
+++ b/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.component.html
@@ -3,6 +3,9 @@
     Our tree-multi-select component is a wrapper around the input tree multi-select element.
   </div>
   <ng-template prizmDocPageTab>
+    <prizm-doc-example id="base" [content]="exampleBase" heading="Base">
+      <prizm-tree-select-base-example></prizm-tree-select-base-example>
+    </prizm-doc-example>
     <prizm-doc-example id="projection" [content]="exampleProjection" heading="Projection">
       <prizm-tree-select-projection-example></prizm-tree-select-projection-example>
     </prizm-doc-example>
diff --git a/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.component.ts b/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.component.ts
index 912758c47..737996373 100644
--- a/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.component.ts
+++ b/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.component.ts
@@ -118,6 +118,10 @@ export class InputTreeMultiSelectComponent {
     TypeScript: import('./examples/projection/tree-select-projection-example.component.ts?raw'),
     HTML: import('./examples/projection/tree-select-projection-example.component.html?raw'),
   };
+  readonly exampleBase: TuiDocExample = {
+    TypeScript: import('./examples/base/tree-select-base-example.component.ts?raw'),
+    HTML: import('./examples/base/tree-select-base-example.component.html?raw'),
+  };
   readonly exampleTransform: TuiDocExample = {
     TypeScript: import('./examples/transform/tree-select-transform-example.component.ts?raw'),
     HTML: import('./examples/transform/tree-select-transform-example.component.html?raw'),
diff --git a/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.module.ts b/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.module.ts
index f8dd33c1a..6ec3b1f62 100644
--- a/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.module.ts
+++ b/apps/doc/src/app/components/input/input-tree-multi-select/input-tree-multi-select.module.ts
@@ -10,14 +10,14 @@ import {
   PrizmDataListWrapperComponent,
   PrizmHintOnOverflowDirective,
   PrizmInputCommonModule,
+  PrizmInputTreeMultiSelectCheckboxDirective,
   PrizmInputTreeMultiSelectComponent,
   PrizmInputTreeSelectComponent,
   PrizmScrollbarModule,
-  PrizmInputTreeMultiSelectCheckboxDirective,
   PrizmTreeMultiSelectItemComponent,
   PrizmTreeMultiSelectItemDirective,
-  PrizmTreeSelectItemComponent,
   PrizmTreeMultiSelectModeDirective,
+  PrizmTreeSelectItemComponent,
 } from '@prizm-ui/components';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { PrizmHtmlRefDirective, PrizmLetDirective } from '@prizm-ui/helpers';
@@ -28,6 +28,7 @@ import { PrizmTreeSelectTransformExampleComponent } from './examples/transform/t
 import { PrizmTreeSelectSearchExampleComponent } from './examples/search/tree-select-search-example.component';
 import { PrizmTreeSelectI18nExampleComponent } from './examples/i18n/tree-select-i18n-example.component';
 import { PrizmTreeSelectOnlyCurrentExampleComponent } from './examples/only-current/tree-select-only-current-example.component';
+import { PrizmTreeSelectBaseExampleComponent } from './examples/base/tree-select-base-example.component';
 
 @NgModule({
   imports: [
@@ -62,6 +63,7 @@ import { PrizmTreeSelectOnlyCurrentExampleComponent } from './examples/only-curr
     PrizmTreeSelectTransformExampleComponent,
     PrizmTreeSelectSearchExampleComponent,
     PrizmTreeSelectProjectionExampleComponent,
+    PrizmTreeSelectBaseExampleComponent,
     InputTreeMultiSelectComponent,
   ],
   exports: [InputTreeMultiSelectComponent],
diff --git a/apps/doc/src/app/version-manager/current.const.ts b/apps/doc/src/app/version-manager/current.const.ts
index a94a1b04a..4cbb21376 100644
--- a/apps/doc/src/app/version-manager/current.const.ts
+++ b/apps/doc/src/app/version-manager/current.const.ts
@@ -1 +1 @@
-export const PRIZM_CURRENT_VERSION = '5.8.0';
+export const PRIZM_CURRENT_VERSION = '5.8.1';
diff --git a/apps/doc/src/app/version-manager/versions.constants.ts b/apps/doc/src/app/version-manager/versions.constants.ts
index 995008dd5..960be8da8 100644
--- a/apps/doc/src/app/version-manager/versions.constants.ts
+++ b/apps/doc/src/app/version-manager/versions.constants.ts
@@ -28,8 +28,8 @@ export const PRIZM_LANGUAGES_META: readonly PrizmLanguageMeta[] = [
 ];
 export const PRIZM_VERSIONS_META: readonly PrizmVersionMeta[] = [
   {
-    label: '5.8.0 (ng18)',
-    version: '5.8.0',
+    label: '5.8.1 (ng18)',
+    version: '5.8.1',
     stackblitz: 'https://stackblitz.com/edit/prizm-v5-demo',
     link: getDocSite.bind(null, 'https://doc.prizm.zyfra.com', 'http://prizm.site'),
 
diff --git a/libs/addons/query-builder/package.json b/libs/addons/query-builder/package.json
index 00804a2f2..de88410e7 100644
--- a/libs/addons/query-builder/package.json
+++ b/libs/addons/query-builder/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/addon-query-builder",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "peerDependencies": {
     "@angular/common": "^18.1.3",
     "@angular/core": "^18.1.3",
diff --git a/libs/ast/package.json b/libs/ast/package.json
index f9230f0f8..508cc9564 100644
--- a/libs/ast/package.json
+++ b/libs/ast/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/ast",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "private": false,
   "publishConfig": {
     "access": "public",
diff --git a/libs/charts/base/package.json b/libs/charts/base/package.json
index 11d345a64..1cd79f440 100644
--- a/libs/charts/base/package.json
+++ b/libs/charts/base/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/charts",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "license": "MIT",
   "private": false,
   "publishConfig": {
@@ -10,8 +10,8 @@
   "peerDependencies": {
     "@angular/common": "^18.1.3",
     "@angular/core": "^18.1.3",
-    "@prizm-ui/theme": "^5.8.0",
-    "@prizm-ui/helpers": "^5.8.0"
+    "@prizm-ui/theme": "^5.8.1",
+    "@prizm-ui/helpers": "^5.8.1"
   },
   "dependencies": {
     "tslib": "^2.3.0",
diff --git a/libs/components/package.json b/libs/components/package.json
index d4201bca1..5e6b210c8 100644
--- a/libs/components/package.json
+++ b/libs/components/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/components",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "description": "Prizm UI system design components library http://prizm.zyfra.com",
   "license": "MIT",
   "private": false,
@@ -12,11 +12,11 @@
     "@angular/common": "^18.1.3",
     "@angular/core": "^18.1.3",
     "@angular/cdk": "^18.1.3",
-    "@prizm-ui/helpers": "^5.8.0",
-    "@prizm-ui/core": "^5.8.0",
-    "@prizm-ui/i18n": "^5.8.0",
-    "@prizm-ui/theme": "^5.8.0",
-    "@prizm-ui/icons": "^5.8.0"
+    "@prizm-ui/helpers": "^5.8.1",
+    "@prizm-ui/core": "^5.8.1",
+    "@prizm-ui/i18n": "^5.8.1",
+    "@prizm-ui/theme": "^5.8.1",
+    "@prizm-ui/icons": "^5.8.1"
   },
   "dependencies": {
     "tslib": "^2.3.0",
diff --git a/libs/components/src/lib/components/dropdowns/tree-multi-select/tree-select-multi-selected.directive.ts b/libs/components/src/lib/components/dropdowns/tree-multi-select/tree-select-multi-selected.directive.ts
index 4842073c6..b4cabf32a 100644
--- a/libs/components/src/lib/components/dropdowns/tree-multi-select/tree-select-multi-selected.directive.ts
+++ b/libs/components/src/lib/components/dropdowns/tree-multi-select/tree-select-multi-selected.directive.ts
@@ -73,7 +73,7 @@ export class PrizmTreeMultiSelectSelectedDirective<T> {
 
   public unselect(item: T) {
     if (!this.value) return;
-    this.value = this.value.filter(i => i !== item);
+    this.value = this.value.filter(i => !this.treeSelectIdentityMatcherDirective.identityMatcher(i, item));
   }
 
   public hasSelectedChildren(item: T): boolean {
diff --git a/libs/core/package.json b/libs/core/package.json
index a4a266ef6..7b877bad1 100644
--- a/libs/core/package.json
+++ b/libs/core/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/core",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "license": "MIT",
   "description": "The main library for creating Angular components and elements using Prizm.",
   "private": false,
diff --git a/libs/helpers/package.json b/libs/helpers/package.json
index 91e23e244..a0394b9fa 100644
--- a/libs/helpers/package.json
+++ b/libs/helpers/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/helpers",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "license": "MIT",
   "description": "Library to make it easy to create Angular applications. Contains Injectables Service, RxJS utilities, directives, and standard pipes.",
   "private": false,
diff --git a/libs/i18n/package.json b/libs/i18n/package.json
index c60d35489..bc4aeec1b 100644
--- a/libs/i18n/package.json
+++ b/libs/i18n/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/i18n",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "peerDependencies": {
     "@angular/common": "^18.1.3",
     "@angular/core": "^18.1.3"
diff --git a/libs/icons/base/package.json b/libs/icons/base/package.json
index bf1328d7e..ad4e3da1b 100644
--- a/libs/icons/base/package.json
+++ b/libs/icons/base/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/icons",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "description": "Prizm UI base icon pack library http://prizm.zyfra.com",
   "private": false,
   "publishConfig": {
@@ -10,7 +10,7 @@
   "peerDependencies": {
     "@angular/common": "^18.1.3",
     "@angular/core": "^18.1.3",
-    "@prizm-ui/core": "^5.8.0"
+    "@prizm-ui/core": "^5.8.1"
   },
   "dependencies": {
     "tslib": "^2.3.0"
diff --git a/libs/icons/flags/package.json b/libs/icons/flags/package.json
index b39a5785d..e67564665 100644
--- a/libs/icons/flags/package.json
+++ b/libs/icons/flags/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/flag-icons",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "description": "Prizm UI flags icon pack library http://prizm.zyfra.com",
   "private": false,
   "publishConfig": {
@@ -10,7 +10,7 @@
   "peerDependencies": {
     "@angular/common": "^18.1.3",
     "@angular/core": "^18.1.3",
-    "@prizm-ui/core": "^5.8.0"
+    "@prizm-ui/core": "^5.8.1"
   },
   "dependencies": {
     "tslib": "^2.3.0"
diff --git a/libs/icons/loader/package.json b/libs/icons/loader/package.json
index fcb75bd35..388a33a9f 100644
--- a/libs/icons/loader/package.json
+++ b/libs/icons/loader/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/icons-loader",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "private": false,
   "publishConfig": {
     "access": "public",
@@ -9,7 +9,7 @@
   "peerDependencies": {
     "@angular/common": "^18.1.3",
     "@angular/core": "^18.1.3",
-    "@prizm-ui/icons": "^5.8.0"
+    "@prizm-ui/icons": "^5.8.1"
   },
   "dependencies": {
     "tslib": "^2.3.0"
diff --git a/libs/nxmv/package.json b/libs/nxmv/package.json
index f9a75cf2b..6cff32e91 100644
--- a/libs/nxmv/package.json
+++ b/libs/nxmv/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/nx-mv",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "main": "src/index.js",
   "private": false,
   "publishConfig": {
diff --git a/libs/plugin/package.json b/libs/plugin/package.json
index d13f710d8..24509f5f0 100644
--- a/libs/plugin/package.json
+++ b/libs/plugin/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/nx-plugin",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "main": "src/index.js",
   "private": false,
   "publishConfig": {
@@ -10,6 +10,6 @@
   "generators": "./generators.json",
   "executors": "./executors.json",
   "peerDependencies": {
-    "@prizm-ui/ast": "^5.8.0"
+    "@prizm-ui/ast": "^5.8.1"
   }
 }
diff --git a/libs/schematics/package.json b/libs/schematics/package.json
index d2c9be0fa..cb8d3705a 100644
--- a/libs/schematics/package.json
+++ b/libs/schematics/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/install",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "description": "Package installer @prizm-ui/* , Angular schematic ng-add",
   "schematics": "./src/collection.json",
   "private": false,
diff --git a/libs/schematics/src/ng-add/consts.ts b/libs/schematics/src/ng-add/consts.ts
index 73b84e3c0..2d6d82c0b 100644
--- a/libs/schematics/src/ng-add/consts.ts
+++ b/libs/schematics/src/ng-add/consts.ts
@@ -11,21 +11,21 @@ interface ImportingModule {
 export const MAIN_PACKAGES: ReadonlyArray<Package> = [
   {
     name: '@prizm-ui/core',
-    version: '5.8.0',
+    version: '5.8.1',
   },
   {
     name: '@prizm-ui/components',
-    version: '5.8.0',
+    version: '5.8.1',
   },
   {
     name: '@prizm-ui/helpers',
-    version: '5.8.0',
+    version: '5.8.1',
   },
 ];
 
 export const INSTALL_PACKAGE: Readonly<Package> = {
   name: '@prizm-ui/install',
-  version: '5.8.0',
+  version: '5.8.1',
 };
 
 export const MAIN_MODULES: ReadonlyArray<ImportingModule> = [
diff --git a/libs/theme/package.json b/libs/theme/package.json
index 183ed7320..0fa9cb6c2 100644
--- a/libs/theme/package.json
+++ b/libs/theme/package.json
@@ -1,11 +1,11 @@
 {
   "name": "@prizm-ui/theme",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "peerDependencies": {
     "@angular/common": "^18.1.3",
     "@angular/core": "^18.1.3",
-    "@prizm-ui/core": "^5.8.0",
-    "@prizm-ui/helpers": "^5.8.0"
+    "@prizm-ui/core": "^5.8.1",
+    "@prizm-ui/helpers": "^5.8.1"
   },
   "dependencies": {
     "tslib": "^2.3.0"
diff --git a/local/package.json b/local/package.json
index d01a69443..82afac681 100644
--- a/local/package.json
+++ b/local/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/local",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "dependencies": {
     "@nx/devkit": "19.5.6",
     "tslib": "^2.3.0"
diff --git a/nxmv.json b/nxmv.json
index 6f58bfc61..554176e60 100644
--- a/nxmv.json
+++ b/nxmv.json
@@ -38,7 +38,7 @@
         "nxVersion": "19.5.6"
       },
       "vars": {
-        "version": "5.8.0",
+        "version": "5.8.1",
         "v4version": "4.8.1"
       }
     }
diff --git a/package.json b/package.json
index 1729d8f93..e3d0438ec 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@prizm-ui/sdk",
-  "version": "5.8.0",
+  "version": "5.8.1",
   "license": "MIT",
   "husky": {
     "hooks": {
diff --git a/package.json.ng18 b/package.json.ng18
index 787ca39b1..ca6034b92 100644
--- a/package.json.ng18
+++ b/package.json.ng18
@@ -17,6 +17,7 @@
     "cypress:open": "cypress open",
     "start": "nx run doc:serve",
     "build": "nx affected:build --all",
+    "build:all": "nx run-many -t build --all",
     "build:next": "nx run doc:build",
     "build:doc": "nx run doc:build:development --deployUrl=/ --baseHref=/",
     "build:stats": "nx build next --stats-json",


Reviews:
user: login: ickisIckis
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T13:19:16Z
user: login: ickisIckis
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T13:21:11Z
user: login: ZurabDev
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T13:21:55Z
user: login: ZurabDev
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T13:23:08Z
user: login: ickisIckis
body: LGTM
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T13:27:36Z
user: login: alexhawkins94
state: APPROVED
author_association: NONE
submitted_at: 2025-03-27T13:00:08Z

Review comments:
diff_hunk: @@ -0,0 +1,101 @@
+import { Component } from '@angular/core';
+import { PrizmMultiSelectIdentityMatcher, PrizmMultiSelectSearchMatcher } from '@prizm-ui/components';
+import { BehaviorSubject, delay } from 'rxjs';
+import { UntypedFormControl } from '@angular/forms';
+
+type TreeSelectItem = {
+  data: { value: string; id: string };
+  children?: TreeSelectItem[];
+};
+
+@Component({
+  selector: 'prizm-tree-select-base-example',
+  templateUrl: './tree-select-base-example.component.html',
+  styles: [
+    `
+      .box {
+        display: flex;
+        gap: 1rem;
+      }
+
+      .value {
+        overflow: hidden;
+        max-width: 100%;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+    `,
+  ],
+})
+export class PrizmTreeSelectBaseExampleComponent {
+  protected items: TreeSelectItem[] = [
+    {
+      data: {
+        value: 'One',
+        id: 'One',
+      },
+    },
+    {
+      data: {
+        value: 'Two',
+        id: 'Two',
+      },
+      children: [
+        {
+          data: {
+            value: 'first in two',
+            id: 'first in two',
+          },
+          children: [
+            {
+              data: {
+                value: 'first in first in two',
+                id: 'first in first in two',
+              },
+            },
+          ],
+        },
+        {
+          data: {
+            value: 'second in two',
+            id: 'second in two',
+          },
+        },
+      ],
+    },
+  ];
+  private selectedItems$$ = new BehaviorSubject<TreeSelectItem[]>(this.items);
+  protected items$ = this.selectedItems$$.pipe(delay(100));
+  public value = this.items[0];
+  readonly control = new UntypedFormControl([{ ...this.items[0] }]);
+
+  public stringify(item: TreeSelectItem | null): string {
+    return item?.data ? item.data.value : '';
+  }
+  public getChildren(item: TreeSelectItem): TreeSelectItem[] {
+    return item.children ?? [];
+  }
+
+  public searchMatcher: PrizmMultiSelectSearchMatcher<TreeSelectItem> = (
+    search: string,
+    item: TreeSelectItem
+  ) => {
+    return item.data.value?.toLowerCase().includes(search.toLowerCase());
+  };
+
+  public readonly identityMatcher: PrizmMultiSelectIdentityMatcher<TreeSelectItem> = (
+    a: TreeSelectItem,
+    b: TreeSelectItem
+  ): boolean => {
+    console.log('#Mz identityMatcher', { a, b });
+    return a?.data.id === b?.data.id;
+  };
+
+  public setDefaultValue(): void {
+    this.control.setValue([{ ...this.items[1] }], { emitEvent: false });
+  }
+  public change(): void {
+    this.control.setValue(null);
+    // this.selectedItems$$.next(this.selectedItems$$.value === this.items ? this.items2 : this.items);
path: apps/doc/src/app/components/input/input-tree-multi-select/examples/base/tree-select-base-example.component.ts
user: login: ickisIckis
body: можно убрать коммент
created_at: 2025-03-26T13:18:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -17,7 +17,6 @@
     "cypress:open": "cypress open",
     "start": "nx run doc:serve",
     "build": "nx affected:build --all",
-    "build:all": "nx run-many -t build --all",
path: package.json
user: login: ickisIckis
body: это специально убрали?
created_at: 2025-03-26T13:21:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,101 @@
+import { Component } from '@angular/core';
+import { PrizmMultiSelectIdentityMatcher, PrizmMultiSelectSearchMatcher } from '@prizm-ui/components';
+import { BehaviorSubject, delay } from 'rxjs';
+import { UntypedFormControl } from '@angular/forms';
+
+type TreeSelectItem = {
+  data: { value: string; id: string };
+  children?: TreeSelectItem[];
+};
+
+@Component({
+  selector: 'prizm-tree-select-base-example',
+  templateUrl: './tree-select-base-example.component.html',
+  styles: [
+    `
+      .box {
+        display: flex;
+        gap: 1rem;
+      }
+
+      .value {
+        overflow: hidden;
+        max-width: 100%;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+    `,
+  ],
+})
+export class PrizmTreeSelectBaseExampleComponent {
+  protected items: TreeSelectItem[] = [
+    {
+      data: {
+        value: 'One',
+        id: 'One',
+      },
+    },
+    {
+      data: {
+        value: 'Two',
+        id: 'Two',
+      },
+      children: [
+        {
+          data: {
+            value: 'first in two',
+            id: 'first in two',
+          },
+          children: [
+            {
+              data: {
+                value: 'first in first in two',
+                id: 'first in first in two',
+              },
+            },
+          ],
+        },
+        {
+          data: {
+            value: 'second in two',
+            id: 'second in two',
+          },
+        },
+      ],
+    },
+  ];
+  private selectedItems$$ = new BehaviorSubject<TreeSelectItem[]>(this.items);
+  protected items$ = this.selectedItems$$.pipe(delay(100));
+  public value = this.items[0];
+  readonly control = new UntypedFormControl([{ ...this.items[0] }]);
+
+  public stringify(item: TreeSelectItem | null): string {
+    return item?.data ? item.data.value : '';
+  }
+  public getChildren(item: TreeSelectItem): TreeSelectItem[] {
+    return item.children ?? [];
+  }
+
+  public searchMatcher: PrizmMultiSelectSearchMatcher<TreeSelectItem> = (
+    search: string,
+    item: TreeSelectItem
+  ) => {
+    return item.data.value?.toLowerCase().includes(search.toLowerCase());
+  };
+
+  public readonly identityMatcher: PrizmMultiSelectIdentityMatcher<TreeSelectItem> = (
+    a: TreeSelectItem,
+    b: TreeSelectItem
+  ): boolean => {
+    console.log('#Mz identityMatcher', { a, b });
+    return a?.data.id === b?.data.id;
+  };
+
+  public setDefaultValue(): void {
+    this.control.setValue([{ ...this.items[1] }], { emitEvent: false });
+  }
+  public change(): void {
+    this.control.setValue(null);
+    // this.selectedItems$$.next(this.selectedItems$$.value === this.items ? this.items2 : this.items);
path: apps/doc/src/app/components/input/input-tree-multi-select/examples/base/tree-select-base-example.component.ts
user: login: ZurabDev
body: DONE
created_at: 2025-03-26T13:21:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -17,7 +17,6 @@
     "cypress:open": "cypress open",
     "start": "nx run doc:serve",
     "build": "nx affected:build --all",
-    "build:all": "nx run-many -t build --all",
path: package.json
user: login: ZurabDev
body: Нет в шаблонах видно не добавляли, добавил
created_at: 2025-03-26T13:23:08Z
author_association: CONTRIBUTOR

PR comments:
user: login: github-actions[bot]
created_at: 2025-03-26T13:21:09Z
body: Visit the preview URL for this PR (updated for commit 12de2aa):

[https://prizm-v4--pr2437-fix-input-multi-sele-2q9ptdqx.web.app](https://prizm-v4--pr2437-fix-input-multi-sele-2q9ptdqx.web.app)

<sub>(expires Tue, 01 Apr 2025 12:49:26 GMT)</sub>

<sub>🔥 via [Firebase Hosting GitHub Action](https://github.com/marketplace/actions/deploy-to-firebase-hosting) 🌎</sub>

<sub>Sign: 7c62ed8dbabf5e2d6b2084ca9e107cc206d30dbd</sub>
author_association: NONE
user: login: alexhawkins94
created_at: 2025-03-27T11:34:18Z
body: в консоли mz для дебага остались
 
![image](https://github.com/user-attachments/assets/4ce2a080-dda5-4753-86e9-63a06e455a67)

author_association: NONE
user: login: alexhawkins94
created_at: 2025-03-27T11:34:44Z
body: в новом примере ранее раскрытые вложенные ветви не сохраняют раскрытое состояние после переоткрытия дропдауна
![image](https://github.com/user-attachments/assets/c6128d2f-0b42-4f01-bf3c-4ef300f013fa)

в другом примере это работает. точно ли ок такое поведение?

author_association: NONE