-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from xpert-ai/develop
Version 3.0.9
- Loading branch information
Showing
130 changed files
with
2,178 additions
and
1,559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/cloud/src/app/features/chat/chat-input/chat-input.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
apps/cloud/src/app/features/chat/component-message/indicators/indicators.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@for (indicator of showIndicators(); track indicator.indicator; let last = $last) { | ||
<ngm-indicator class="indicator min-h-[75px] border-t border-solid dark:border-neutral-800 border-transparent bg-components-card-bg p-4 cursor-pointer hover:bg-components-panel-bg first:rounded-t-xl" | ||
[class.active]="indicatorExplorer() === indicator.indicator" | ||
[class.last]="last" | ||
[class.has-more]="hasMore()" | ||
[dataSettings]="indicator" | ||
[indicatorCode]="indicator.indicator" | ||
[lookBack]="12" | ||
[timeGranularity]="eTimeGranularity.Month" | ||
[tagType]="indicatorTagType()" | ||
(click)="toggleIndicator(indicator.indicator)" | ||
(toggleTag)="toggleIndicatorTagType()" | ||
/> | ||
@if (indicatorExplorer() === indicator.indicator) { | ||
<ngm-indicator-explorer class="ngm-indicator-explorer last:rounded-b-xl" | ||
[dataSettings]="indicator" | ||
[indicatorCode]="indicator.indicator" | ||
[lookBack]="12" | ||
periodName="6M" | ||
[primaryTheme]="'dark'" | ||
/> | ||
} | ||
} | ||
|
||
@if (indicators()?.length > pageSize()) { | ||
<div class="flex justify-center gap-1"> | ||
@if (hasMore()) { | ||
<button type="button" class="btn pressable justify-center" [matTooltip]="'PAC.Chat.ShowMoreIndicators' | translate: {Default: 'Show more indicators'}" | ||
(click)="showMore()"> | ||
<i class="ri-arrow-down-wide-line"></i> | ||
</button> | ||
} | ||
@if (showIndicators()?.length > pageSize()) { | ||
<button type="button" class="btn pressable justify-center" [matTooltip]="'PAC.Chat.ShowLessIndicators' | translate: {Default: 'Show less indicators'}" | ||
(click)="showLess()"> | ||
<i class="ri-arrow-up-wide-line"></i> | ||
</button> | ||
} | ||
</div> | ||
} |
7 changes: 7 additions & 0 deletions
7
apps/cloud/src/app/features/chat/component-message/indicators/indicators.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
:host { | ||
@apply flex flex-col items-stretch; | ||
} | ||
|
||
.indicator.last:not(.has-more):not(.active) { | ||
@apply rounded-b-xl; | ||
} |
72 changes: 72 additions & 0 deletions
72
apps/cloud/src/app/features/chat/component-message/indicators/indicators.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { DragDropModule } from '@angular/cdk/drag-drop' | ||
import { CdkMenuModule } from '@angular/cdk/menu' | ||
import { CommonModule } from '@angular/common' | ||
import { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core' | ||
import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||
import { MatTooltipModule } from '@angular/material/tooltip' | ||
import { RouterModule } from '@angular/router' | ||
import { NgmIndicatorComponent, NgmIndicatorExplorerComponent } from '@metad/ocap-angular/indicator' | ||
import { DataSettings, IndicatorTagEnum, TimeGranularity } from '@metad/ocap-core' | ||
import { TranslateModule } from '@ngx-translate/core' | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
ReactiveFormsModule, | ||
DragDropModule, | ||
CdkMenuModule, | ||
RouterModule, | ||
TranslateModule, | ||
MatTooltipModule, | ||
|
||
NgmIndicatorComponent, | ||
NgmIndicatorExplorerComponent | ||
], | ||
selector: 'pac-chat-component-indicators', | ||
templateUrl: './indicators.component.html', | ||
styleUrl: 'indicators.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class ChatComponentIndicatorsComponent { | ||
eTimeGranularity = TimeGranularity | ||
|
||
// Inputs | ||
readonly indicators = input<Array<DataSettings & { indicator: string }>>() | ||
|
||
// States | ||
readonly pageSize = signal(5) | ||
readonly pageNo = signal(0) | ||
|
||
readonly showIndicators = computed(() => { | ||
return this.indicators()?.slice(0, (this.pageNo() + 1) * this.pageSize()) | ||
}) | ||
|
||
readonly hasMore = computed(() => this.indicators().length > (this.pageNo() + 1) * this.pageSize()) | ||
|
||
readonly indicatorExplorer = signal<string>(null) | ||
readonly indicatorTagType = signal<IndicatorTagEnum>(IndicatorTagEnum.MOM) | ||
|
||
toggleIndicatorTagType() { | ||
this.indicatorTagType.update((tagType) => { | ||
if (IndicatorTagEnum[tagType + 1]) { | ||
return tagType + 1 | ||
} else { | ||
return IndicatorTagEnum[IndicatorTagEnum[0]] // Ensure to start from 0 | ||
} | ||
}) | ||
} | ||
|
||
toggleIndicator(indicator: string) { | ||
this.indicatorExplorer.update((state) => (state === indicator ? null : indicator)) | ||
} | ||
|
||
showMore() { | ||
this.pageNo.update((currentPage) => currentPage + 1) | ||
} | ||
|
||
showLess() { | ||
this.pageNo.update((currentPage) => currentPage - 1) | ||
} | ||
} |
Oops, something went wrong.