Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Добавить возможность маркировать элемент в компоненте tree как активный #708

Closed
1 of 9 tasks
ZyfraKonstantinKulik opened this issue Sep 11, 2023 · 2 comments · Fixed by #919
Assignees
Labels
estimate:sp3 Story Point - 3 priority:high level of urgency - high source:requested The tag indicates that the information or action being discussed was initiate state:ready ready for release (pass tested) type:feature
Milestone

Comments

@ZyfraKonstantinKulik
Copy link

Библиотека

  • @prizm-ui/core
  • @prizm-ui/components
  • @prizm-ui/install
  • @prizm-ui/icons
  • @prizm-ui/flag-icons
  • @prizm-ui/theme
  • @prizm-ui/charts
  • @prizm-ui/ast
  • @prizm-ui/nx-plugin

Компонент

Tree
https://prizm-v1.web.app/components/tree/Live_demo?tuiMode=null&prizmTreeController=true&PrizmTreeItemComponent.testId=

Предложение

Работаю над задачи по созданию интерфейса со списком отчетов в приложении Энергоконтроль, в рамках которой необходимо подсвечивать, выбранные пользователем, элементы в компоненте tree
image

Предлагаю расширить возможности компонента tree таким образом, чтобы появилась возможность манипулировать подсветкой элементов дерева, к примеру, меняя значения атрибута active у компонента

@ZurabDev ZurabDev added this to the 3.3.0 milestone Oct 9, 2023
@ZurabDev ZurabDev self-assigned this Oct 9, 2023
@ZurabDev ZurabDev added type:feature priority:high level of urgency - high source:requested The tag indicates that the information or action being discussed was initiate estimate:sp3 Story Point - 3 labels Oct 9, 2023
@ZurabDev ZurabDev added the state:in_progress We work on this issue label Oct 18, 2023
@ZurabDev ZurabDev modified the milestones: 3.3.0, 3.4.0 Oct 27, 2023
@ZurabDev ZurabDev added state:ready ready for release (pass tested) and removed state:in_progress We work on this issue labels Oct 30, 2023
@ZurabDev
Copy link
Contributor

CleanShot 2023-10-30 at 10 59 35@2x
Готово

ZurabDev added a commit that referenced this issue Nov 1, 2023
fix(components/tree): active item style and update doc #708 #654
@ZyfraOlgaPalkina
Copy link

В текущей реализации можно промаркировать активным только конкретный элемент. Хочу попросить добавить поддержку этой фичи и для динамического дерева.
Как вариант решения, предлагаю в prizm-tree передавать условие, при котором элемент активен, а в каждом prizm-tree-item непосредственно выполнять проверку. Упрощенно:

<prizm-tree *ngFor="let child of data" [value]="child" [isActiveFn]="customIsActiveCondition">
        <prizm-tree-item [active]=isActiveFn(value)"></prizm-tree-item>
</prizm-tree>

isActiveFn<T>(child: T): boolean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimate:sp3 Story Point - 3 priority:high level of urgency - high source:requested The tag indicates that the information or action being discussed was initiate state:ready ready for release (pass tested) type:feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants