From 0d2a4a7db6cb42aab4d56261e7681fc45720c03e Mon Sep 17 00:00:00 2001 From: Richard Park Date: Mon, 18 Nov 2019 15:46:18 +0900 Subject: [PATCH] group tree is modified --- .../components/expansion-panel.component.html | 34 +++++++++++---- .../components/expansion-panel.component.scss | 42 +++++++++++-------- .../components/expansion-panel.component.ts | 7 +++- 3 files changed, 58 insertions(+), 25 deletions(-) diff --git a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html index 21178d2d..bb20f3da 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html +++ b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html @@ -9,7 +9,7 @@ class="group-tree" > - +
  • -
  • -
    +
  • +
    - Profile - Favorit - Buddy + 내 프로필 + 즐겨찾기 + ({{ node.countOfChildren }}명) + + {{ + node.groupDetail.name + }} + ({{ node.countOfChildren }}명) + -
    diff --git a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.scss b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.scss index b07da43e..8ae516ab 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.scss +++ b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.scss @@ -13,10 +13,19 @@ } .tree-node-frame { - border-bottom:1px solid #dddddd; - height:40px; + border-bottom: 1px solid #dddddd; + height: 40px; + + .tree-node-header { + width: 100%; + + .title-name { + display: inline-flex; + flex: 1 1 auto; + } + } .mat-tree-node { - width:100%; + width: 100%; &:hover { background-color: #f4f4f4; border: 1px solid #cccccc; @@ -26,36 +35,35 @@ } } .mat-tree-node { - &[aria-level="1"]{ + &[aria-level='1'] { position: relative; widows: 100px; - height:100%; - li{ - margin-left:0; - width:100%; - height:100%; - .mat-tree-node{ - width:100%; - height:100%; + height: 100%; + li { + margin-left: 0; + width: 100%; + height: 100%; + .mat-tree-node { + width: 100%; + height: 100%; } } } } - .path { padding: 6px 4px; - .btn-toggle{ + .btn-toggle { padding: 0; min-width: 0; width: 20px; height: 20px; flex-shrink: 0; line-height: 20px; - margin-right:10px; + margin-right: 10px; } - .group-menu{ - margin-left:auto; + .group-menu { + margin-left: auto; } + ul { li:last-chlid { diff --git a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts index 88cbaf4c..553efb6e 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts +++ b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts @@ -44,6 +44,7 @@ interface FlatNode { expandable: boolean; level: number; nodeType: NodeType; + countOfChildren?: number; userInfo?: UserInfo; groupDetail?: GroupDetailData; } @@ -77,7 +78,7 @@ export class ExpansionPanelComponent implements OnInit, AfterViewInit { @Input() set favoritBuddyList(userInfoList: UserInfo[]) { - if (!userInfoList) { + if (!userInfoList || 0 === userInfoList.length) { return; } const groupNode: GroupNode = { @@ -181,6 +182,10 @@ export class ExpansionPanelComponent implements OnInit, AfterViewInit { expandable: !!node.children && node.children.length > 0, level, nodeType: node.nodeType, + countOfChildren: + !!node.children && node.children.length > 0 + ? node.children.length + : undefined, userInfo: node.userInfo, groupDetail: node.groupDetail };