Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
portal-apps-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
portal-apps-manage
Commits
5cca44a4
Commit
5cca44a4
authored
Sep 16, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perspective
parent
de6dece3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1667 additions
and
572 deletions
+1667
-572
syncfusion-datagrid-config.component.ts
...n-datagrid-config/syncfusion-datagrid-config.component.ts
+841
-377
syncfusion-pivot-config.component.ts
...cfusion-pivot-config/syncfusion-pivot-config.component.ts
+695
-175
syncfusion-datagrid-widget.component.ts
...n-datagrid-widget/syncfusion-datagrid-widget.component.ts
+86
-6
syncfusion-pivot-widget.component.ts
...cfusion-pivot-widget/syncfusion-pivot-widget.component.ts
+45
-14
No files found.
src/app/portal-manage/dashboard-management/widgets/configs/syncfusion-datagrid-config/syncfusion-datagrid-config.component.ts
View file @
5cca44a4
...
@@ -26,426 +26,820 @@ import { BaseConfigComponent } from '../../../widget-config/base-config/base-con
...
@@ -26,426 +26,820 @@ import { BaseConfigComponent } from '../../../widget-config/base-config/base-con
BaseConfigComponent
BaseConfigComponent
],
],
template
:
`
template
:
`
<app-base-config>
<div class="config-container">
<!-- Basic Configuration Tab -->
<mat-tab-group class="config-tabs" dynamicHeight>
<div class="config-section">
<!-- Basic Configuration Tab -->
<h3 class="text-blue-600">Basic Configuration</h3>
<mat-tab label="Basic">
<div class="config-section">
<mat-form-field appearance="fill" class="w-full">
<h3 class="section-title text-blue-600">Basic Configuration</h3>
<mat-label>Title</mat-label>
<input matInput [(ngModel)]="currentConfig.title" name="title" aria-label="Widget title">
<mat-form-field appearance="fill" class="w-full">
<mat-hint>Widget title displayed in header</mat-hint>
<mat-label>Title</mat-label>
</mat-form-field>
<input matInput [(ngModel)]="currentConfig.title" name="title" aria-label="Widget title">
<mat-hint>Widget title displayed in header</mat-hint>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Page Size</mat-label>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<input matInput type="number" [(ngModel)]="currentConfig.pageSize" name="pageSize" min="5" max="100">
<mat-form-field appearance="fill">
<mat-hint>Number of rows per page</mat-hint>
<mat-label>Page Size</mat-label>
</mat-form-field>
<input matInput type="number" [(ngModel)]="currentConfig.pageSize" name="pageSize" min="5" max="100">
<mat-hint>Number of rows per page</mat-hint>
<mat-form-field appearance="fill">
</mat-form-field>
<mat-label>Font Size (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.fontSize" name="fontSize" min="10" max="20">
<mat-form-field appearance="fill">
<mat-hint>Font size for grid content</mat-hint>
<mat-label>Font Size (px)</mat-label>
</mat-form-field>
<input matInput type="number" [(ngModel)]="currentConfig.fontSize" name="fontSize" min="10" max="20">
</div>
<mat-hint>Font size for grid content</mat-hint>
</mat-form-field>
<!-- Size Configuration -->
<div class="config-section">
<h3 class="text-blue-600">Size Configuration</h3>
<div class="size-config">
<div
*ngFor="let option of sizeOptions"
class="size-option"
[class.selected]="currentConfig.sizeOption === option.id"
(click)="setSizeOption(option.id)">
<h4>{{ option.label }}</h4>
<p>{{ option.description }}</p>
</div>
</div>
</div>
<div *ngIf="currentConfig.sizeOption === 'custom'" class="grid grid-cols-2 gap-4 mt-4">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-form-field appearance="fill">
<mat-label>Width</mat-label>
<mat-label>Data Source</mat-label>
<input matInput [(ngModel)]="currentConfig.width" name="width" placeholder="e.g., 100%, 800px">
<mat-select [(ngModel)]="currentConfig.dataSource" name="dataSource">
<mat-hint>Grid width</mat-hint>
<mat-option value="static">Static Data</mat-option>
</mat-form-field>
<mat-option value="api">API Endpoint</mat-option>
<mat-form-field appearance="fill">
<mat-option value="dataset">Dataset</mat-option>
<mat-label>Height</mat-label>
</mat-select>
<input matInput [(ngModel)]="currentConfig.height" name="height" placeholder="e.g., 100%, 400px">
<mat-hint>Source of the data</mat-hint>
<mat-hint>Grid height</mat-hint>
</mat-form-field>
</mat-form-field>
</div>
</div>
</div>
<!-- Columns Tab -->
<div class="config-section">
<h3 class="text-blue-600">Column Configuration</h3>
<div class="flex items-center justify-between mb-4">
<h4>Available Columns</h4>
<button mat-raised-button color="primary" (click)="addColumn()">
<mat-icon>add</mat-icon>
Add Column
</button>
</div>
<div *ngFor="let column of currentConfig.columns; let i = index" class="column-config-item p-4 mb-4">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<mat-form-field appearance="fill">
<mat-label>Field Name</mat-label>
<mat-select [(ngModel)]="column.field" name="columnField{{i}}">
<mat-option *ngFor="let col of availableColumns" [value]="col">{{ col }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-form-field appearance="fill">
<mat-label>Header Text</mat-label>
<mat-label>API Endpoint</mat-label>
<input matInput [(ngModel)]="column.headerText" name="columnHeader{{i}}" placeholder="Column header">
<input matInput [(ngModel)]="currentConfig.apiEndpoint" name="apiEndpoint" placeholder="https://api.example.com/data">
</mat-form-field>
<mat-hint>API endpoint URL</mat-hint>
</mat-form-field>
</div>
<mat-form-field appearance="fill">
<!-- Size Configuration -->
<mat-label>Width</mat-label>
<div class="config-section">
<input matInput [(ngModel)]="column.width" name="columnWidth{{i}}" placeholder="e.g., 100px, 20%">
<h3 class="section-title text-blue-600">Size Configuration</h3>
</mat-form-field>
<div class="size-config">
<div
*ngFor="let option of sizeOptions"
class="size-option"
[class.selected]="currentConfig.sizeOption === option.id"
(click)="setSizeOption(option.id)">
<h4>{{ option.label }}</h4>
<p>{{ option.description }}</p>
</div>
</div>
<div *ngIf="currentConfig.sizeOption === 'custom'" class="grid grid-cols-2 gap-4 mt-4">
<mat-form-field appearance="fill">
<mat-label>Width</mat-label>
<input matInput [(ngModel)]="currentConfig.width" name="width" placeholder="e.g., 100%, 800px">
<mat-hint>Grid width</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Height</mat-label>
<input matInput [(ngModel)]="currentConfig.height" name="height" placeholder="e.g., 100%, 400px">
<mat-hint>Grid height</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</div>
</mat-tab>
<!-- Columns Tab -->
<mat-tab label="Columns">
<div class="config-section">
<h3 class="section-title text-green-600">Column Configuration</h3>
<div class="flex items-center justify-between mb-4">
<h4>Available Columns</h4>
<button mat-raised-button color="primary" (click)="addColumn()">
<mat-icon>add</mat-icon>
Add Column
</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div *ngFor="let column of currentConfig.columns; let i = index" class="column-config-item p-4 mb-4">
<mat-form-field appearance="fill">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<mat-label>Text Align</mat-label>
<mat-form-field appearance="fill">
<mat-select [(ngModel)]="column.textAlign" name="columnAlign{{i}}">
<mat-label>Field Name</mat-label>
<mat-option value="left">Left</mat-option>
<mat-select [(ngModel)]="column.field" name="columnField{{i}}">
<mat-option value="center">Center</mat-option>
<mat-option *ngFor="let col of availableColumns" [value]="col">{{ col }}</mat-option>
<mat-option value="right">Right</mat-option>
</mat-select>
</mat-select>
</mat-form-field>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Header Text</mat-label>
<input matInput [(ngModel)]="column.headerText" name="columnHeader{{i}}" placeholder="Column header">
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Width</mat-label>
<input matInput [(ngModel)]="column.width" name="columnWidth{{i}}" placeholder="e.g., 100px, 20%">
</mat-form-field>
</div>
<mat-form-field appearance="fill">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-label>Format</mat-label>
<mat-form-field appearance="fill">
<mat-select [(ngModel)]="column.format" name="columnFormat{{i}}">
<mat-label>Text Align</mat-label>
<mat-option value="none">None</mat-option>
<mat-select [(ngModel)]="column.textAlign" name="columnAlign{{i}}">
<mat-option value="number">Number</mat-option>
<mat-option value="left">Left</mat-option>
<mat-option value="currency">Currency</mat-option>
<mat-option value="center">Center</mat-option>
<mat-option value="percentage">Percentage</mat-option>
<mat-option value="right">Right</mat-option>
<mat-option value="date">Date</mat-option>
</mat-select>
<mat-option value="datetime">Date Time</mat-option>
</mat-form-field>
</mat-select>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Format</mat-label>
<mat-select [(ngModel)]="column.format" name="columnFormat{{i}}">
<mat-option value="none">None</mat-option>
<mat-option value="number">Number</mat-option>
<mat-option value="currency">Currency</mat-option>
<mat-option value="percentage">Percentage</mat-option>
<mat-option value="date">Date</mat-option>
<mat-option value="datetime">Date Time</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="flex items-center justify-between mt-4">
<div class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="column.visible" name="columnVisible{{i}}">
Visible
</mat-checkbox>
<mat-checkbox [(ngModel)]="column.sortable" name="columnSortable{{i}}">
Sortable
</mat-checkbox>
<mat-checkbox [(ngModel)]="column.filterable" name="columnFilterable{{i}}">
Filterable
</mat-checkbox>
</div>
<button mat-icon-button color="warn" (click)="removeColumn(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
</div>
</mat-tab>
<!-- Rows Tab -->
<mat-tab label="Rows">
<div class="config-section">
<h3 class="section-title text-purple-600">Row Configuration</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Row Height (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.rowHeight" name="rowHeight" min="20" max="100">
<mat-hint>Height of each row</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Alternate Row Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.alternateRowColor" name="alternateRowColor">
<mat-hint>Color for alternate rows</mat-hint>
</mat-form-field>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Header Row Height (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.headerRowHeight" name="headerRowHeight" min="20" max="100">
<mat-hint>Height of header row</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Header Background Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.headerBackgroundColor" name="headerBackgroundColor">
<mat-hint>Background color for header</mat-hint>
</mat-form-field>
</div>
<div class="flex items-center justify-between mt-4">
<div class="flex items-center space-x-4">
<div class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="c
olumn.visible" name="columnVisible{{i}}
">
<mat-checkbox [(ngModel)]="c
urrentConfig.showAlternateRows" name="showAlternateRows
">
Visible
Show Alternate Row Colors
</mat-checkbox>
</mat-checkbox>
<mat-checkbox [(ngModel)]="c
olumn.sortable" name="columnSortable{{i}}
">
<mat-checkbox [(ngModel)]="c
urrentConfig.allowRowSelection" name="allowRowSelection
">
Sortable
Allow Row Selection
</mat-checkbox>
</mat-checkbox>
<mat-checkbox [(ngModel)]="column.filterable" name="columnFilterable{{i}}">
</div>
Filterable
</div>
</mat-tab>
<!-- Style Tab -->
<mat-tab label="Style">
<div class="config-section">
<h3 class="section-title text-orange-600">Style Configuration</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Background Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.backgroundColor" name="backgroundColor">
<mat-hint>Grid background color</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Text Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.textColor" name="textColor">
<mat-hint>Text color</mat-hint>
</mat-form-field>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Border Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.borderColor" name="borderColor">
<mat-hint>Grid border color</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Border Width (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.borderWidth" name="borderWidth" min="0" max="5">
<mat-hint>Border thickness</mat-hint>
</mat-form-field>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Border Radius (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.borderRadius" name="borderRadius" min="0" max="20">
<mat-hint>Corner roundness</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Shadow</mat-label>
<mat-select [(ngModel)]="currentConfig.shadow" name="shadow">
<mat-option value="none">None</mat-option>
<mat-option value="small">Small</mat-option>
<mat-option value="medium">Medium</mat-option>
<mat-option value="large">Large</mat-option>
</mat-select>
<mat-hint>Drop shadow effect</mat-hint>
</mat-form-field>
</div>
</div>
</mat-tab>
<!-- Filter Tab -->
<mat-tab label="Filter">
<div class="config-section">
<h3 class="section-title text-teal-600">Filter Configuration</h3>
<div class="flex items-center space-x-4 mb-4">
<mat-checkbox [(ngModel)]="currentConfig.allowFiltering" name="allowFiltering">
Enable Filtering
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.showFilterBar" name="showFilterBar">
Show Filter Bar
</mat-checkbox>
</mat-checkbox>
</div>
</div>
<button mat-icon-button color="warn" (click)="removeColumn(i)">
<mat-icon>delete</mat-icon>
<div *ngIf="currentConfig.allowFiltering" class="grid grid-cols-1 md:grid-cols-2 gap-4">
</button>
<mat-form-field appearance="fill">
<mat-label>Filter Type</mat-label>
<mat-select [(ngModel)]="currentConfig.filterType" name="filterType">
<mat-option value="menu">Menu</mat-option>
<mat-option value="checkbox">Checkbox</mat-option>
<mat-option value="excel">Excel</mat-option>
</mat-select>
<mat-hint>Type of filter interface</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Filter Bar Height (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.filterBarHeight" name="filterBarHeight" min="30" max="100">
<mat-hint>Height of filter bar</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</div>
</mat-tab>
</div>
<!-- Aggregate Tab -->
<!-- Rows Tab -->
<mat-tab label="Aggregate">
<div class="config-section">
<div class="config-section">
<h3 class="text-blue-600">Row Configuration</h3>
<h3 class="section-title text-red-600">Aggregate Configuration</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="flex items-center mb-4">
<mat-form-field appearance="fill">
<mat-checkbox [(ngModel)]="currentConfig.showAggregate" name="showAggregate">
<mat-label>Row Height (px)</mat-label>
Show Aggregate Row
<input matInput type="number" [(ngModel)]="currentConfig.rowHeight" name="rowHeight" min="20" max="100">
</mat-checkbox>
<mat-hint>Height of each row</mat-hint>
</div>
</mat-form-field>
<div *ngIf="currentConfig.showAggregate">
<mat-form-field appearance="fill">
<div class="flex items-center justify-between mb-4">
<mat-label>Alternate Row Color</mat-label>
<h4>Aggregate Columns</h4>
<input matInput type="color" [(ngModel)]="currentConfig.alternateRowColor" name="alternateRowColor">
<button mat-raised-button color="primary" (click)="addAggregateColumn()">
<mat-hint>Color for alternate rows</mat-hint>
<mat-icon>add</mat-icon>
</mat-form-field>
Add Aggregate
</div>
</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<div *ngFor="let agg of currentConfig.aggregateColumns; let i = index" class="column-config-item p-4 mb-4">
<mat-label>Header Row Height (px)</mat-label>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<input matInput type="number" [(ngModel)]="currentConfig.headerRowHeight" name="headerRowHeight" min="20" max="100">
<mat-form-field appearance="fill">
<mat-hint>Height of header row</mat-hint>
<mat-label>Field Name</mat-label>
</mat-form-field>
<mat-select [(ngModel)]="agg.field" name="aggField{{i}}">
<mat-option *ngFor="let col of availableColumns" [value]="col">{{ col }}</mat-option>
<mat-form-field appearance="fill">
</mat-select>
<mat-label>Header Background Color</mat-label>
</mat-form-field>
<input matInput type="color" [(ngModel)]="currentConfig.headerBackgroundColor" name="headerBackgroundColor">
<mat-hint>Background color for header</mat-hint>
<mat-form-field appearance="fill">
</mat-form-field>
<mat-label>Aggregate Type</mat-label>
</div>
<mat-select [(ngModel)]="agg.type" name="aggType{{i}}">
<mat-option value="sum">Sum</mat-option>
<div class="flex items-center space-x-4">
<mat-option value="count">Count</mat-option>
<mat-checkbox [(ngModel)]="currentConfig.showAlternateRows" name="showAlternateRows">
<mat-option value="average">Average</mat-option>
Show Alternate Row Colors
<mat-option value="min">Min</mat-option>
</mat-checkbox>
<mat-option value="max">Max</mat-option>
<mat-checkbox [(ngModel)]="currentConfig.allowRowSelection" name="allowRowSelection">
</mat-select>
Allow Row Selection
</mat-form-field>
</mat-checkbox>
</div>
<mat-form-field appearance="fill">
</div>
<mat-label>Format</mat-label>
<mat-select [(ngModel)]="agg.format" name="aggFormat{{i}}">
<!-- Style Tab -->
<mat-option value="none">None</mat-option>
<div class="config-section">
<mat-option value="number">Number</mat-option>
<h3 class="text-blue-600">Style Configuration</h3>
<mat-option value="currency">Currency</mat-option>
<mat-option value="percentage">Percentage</mat-option>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
</mat-select>
<mat-form-field appearance="fill">
</mat-form-field>
<mat-label>Background Color</mat-label>
</div>
<input matInput type="color" [(ngModel)]="currentConfig.backgroundColor" name="backgroundColor">
<mat-hint>Grid background color</mat-hint>
<div class="flex items-center justify-between mt-4">
</mat-form-field>
<div class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="agg.visible" name="aggVisible{{i}}">
<mat-form-field appearance="fill">
Visible
<mat-label>Text Color</mat-label>
</mat-checkbox>
<input matInput type="color" [(ngModel)]="currentConfig.textColor" name="textColor">
</div>
<mat-hint>Text color</mat-hint>
<button mat-icon-button color="warn" (click)="removeAggregateColumn(i)">
</mat-form-field>
<mat-icon>delete</mat-icon>
</div>
</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
</div>
<mat-form-field appearance="fill">
</div>
<mat-label>Border Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.borderColor" name="borderColor">
<mat-hint>Grid border color</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Border Width (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.borderWidth" name="borderWidth" min="0" max="5">
<mat-hint>Border thickness</mat-hint>
</mat-form-field>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Border Radius (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.borderRadius" name="borderRadius" min="0" max="20">
<mat-hint>Corner roundness</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Shadow</mat-label>
<mat-select [(ngModel)]="currentConfig.shadow" name="shadow">
<mat-option value="none">None</mat-option>
<mat-option value="small">Small</mat-option>
<mat-option value="medium">Medium</mat-option>
<mat-option value="large">Large</mat-option>
</mat-select>
<mat-hint>Drop shadow effect</mat-hint>
</mat-form-field>
</div>
</div>
<!-- Filter Tab -->
<div class="config-section">
<h3 class="text-blue-600">Filter Configuration</h3>
<div class="flex items-center space-x-4 mb-4">
<mat-checkbox [(ngModel)]="currentConfig.allowFiltering" name="allowFiltering">
Enable Filtering
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.showFilterBar" name="showFilterBar">
Show Filter Bar
</mat-checkbox>
</div>
<div *ngIf="currentConfig.allowFiltering" class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Filter Type</mat-label>
<mat-select [(ngModel)]="currentConfig.filterType" name="filterType">
<mat-option value="menu">Menu</mat-option>
<mat-option value="checkbox">Checkbox</mat-option>
<mat-option value="excel">Excel</mat-option>
</mat-select>
<mat-hint>Type of filter interface</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Filter Bar Height (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.filterBarHeight" name="filterBarHeight" min="30" max="100">
<mat-hint>Height of filter bar</mat-hint>
</mat-form-field>
</div>
</div>
<!-- Aggregate Tab -->
<div class="config-section">
<h3 class="text-blue-600">Aggregate Configuration</h3>
<div class="flex items-center mb-4">
<mat-checkbox [(ngModel)]="currentConfig.showAggregate" name="showAggregate">
Show Aggregate Row
</mat-checkbox>
</div>
<div *ngIf="currentConfig.showAggregate">
<div class="flex items-center justify-between mb-4">
<h4>Aggregate Columns</h4>
<button mat-raised-button color="primary" (click)="addAggregateColumn()">
<mat-icon>add</mat-icon>
Add Aggregate
</button>
</div>
</div>
</mat-tab>
<!-- Export Tab -->
<mat-tab label="Export">
<div class="config-section">
<h3 class="section-title text-indigo-600">Export Configuration</h3>
<div class="flex items-center mb-4">
<mat-checkbox [(ngModel)]="currentConfig.enableExport" name="enableExport">
Enable Export
</mat-checkbox>
</div>
<div *ngFor="let agg of currentConfig.aggregateColumns; let i = index" class="column-config-item p-4 mb-4">
<div *ngIf="currentConfig.enableExport" class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<mat-form-field appearance="fill">
<mat-form-field appearance="fill">
<mat-label>Field Name</mat-label>
<mat-label>Export Formats</mat-label>
<mat-select [(ngModel)]="agg.field" name="aggField{{i}}">
<mat-select [(ngModel)]="currentConfig.exportFormats" name="exportFormats" multiple>
<mat-option *ngFor="let col of availableColumns" [value]="col">{{ col }}</mat-option>
<mat-option value="excel">Excel (.xlsx)</mat-option>
<mat-option value="csv">CSV (.csv)</mat-option>
<mat-option value="pdf">PDF (.pdf)</mat-option>
<mat-option value="json">JSON (.json)</mat-option>
</mat-select>
</mat-select>
<mat-hint>Available export formats</mat-hint>
</mat-form-field>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-form-field appearance="fill">
<mat-label>Aggregate Type</mat-label>
<mat-label>Export Filename</mat-label>
<mat-select [(ngModel)]="agg.type" name="aggType{{i}}">
<input matInput [(ngModel)]="currentConfig.exportFilename" name="exportFilename" placeholder="data-export">
<mat-option value="sum">Sum</mat-option>
<mat-hint>Default filename for exports</mat-hint>
<mat-option value="count">Count</mat-option>
</mat-form-field>
<mat-option value="average">Average</mat-option>
</div>
<mat-option value="min">Min</mat-option>
<mat-option value="max">Max</mat-option>
<div *ngIf="currentConfig.enableExport" class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="currentConfig.includeHeaders" name="includeHeaders">
Include Headers in Export
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.includeFilters" name="includeFilters">
Include Applied Filters
</mat-checkbox>
</div>
</div>
</mat-tab>
<!-- Features Tab -->
<mat-tab label="Features">
<div class="config-section">
<h3 class="section-title text-cyan-600">Grid Features</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="feature-group">
<h4 class="text-sm font-semibold text-gray-700 mb-3">Paging & Navigation</h4>
<div class="space-y-2">
<mat-checkbox [(ngModel)]="currentConfig.allowPaging" name="allowPaging">
Enable Paging
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowPageSize" name="allowPageSize">
Allow Page Size Selection
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.showPageInfo" name="showPageInfo">
Show Page Info
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowPageNavigation" name="allowPageNavigation">
Allow Page Navigation
</mat-checkbox>
</div>
</div>
<div class="feature-group">
<h4 class="text-sm font-semibold text-gray-700 mb-3">Sorting & Filtering</h4>
<div class="space-y-2">
<mat-checkbox [(ngModel)]="currentConfig.allowSorting" name="allowSorting">
Enable Sorting
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowMultiSorting" name="allowMultiSorting">
Allow Multi-Sorting
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowFiltering" name="allowFiltering">
Enable Filtering
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowAdvancedFiltering" name="allowAdvancedFiltering">
Enable Advanced Filtering
</mat-checkbox>
</div>
</div>
<div class="feature-group">
<h4 class="text-sm font-semibold text-gray-700 mb-3">Grouping & Searching</h4>
<div class="space-y-2">
<mat-checkbox [(ngModel)]="currentConfig.allowGrouping" name="allowGrouping">
Enable Grouping
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowReordering" name="allowReordering">
Allow Column Reordering
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowResizing" name="allowResizing">
Allow Column Resizing
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowSearching" name="allowSearching">
Enable Global Search
</mat-checkbox>
</div>
</div>
<div class="feature-group">
<h4 class="text-sm font-semibold text-gray-700 mb-3">Selection & Editing</h4>
<div class="space-y-2">
<mat-checkbox [(ngModel)]="currentConfig.allowSelection" name="allowSelection">
Enable Row Selection
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowMultiSelection" name="allowMultiSelection">
Allow Multi-Selection
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowEditing" name="allowEditing">
Enable Inline Editing
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowAdding" name="allowAdding">
Allow Adding Rows
</mat-checkbox>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-6">
<mat-form-field appearance="fill">
<mat-label>Selection Mode</mat-label>
<mat-select [(ngModel)]="currentConfig.selectionMode" name="selectionMode">
<mat-option value="none">None</mat-option>
<mat-option value="single">Single</mat-option>
<mat-option value="multiple">Multiple</mat-option>
</mat-select>
</mat-select>
<mat-hint>Row selection mode</mat-hint>
</mat-form-field>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-form-field appearance="fill">
<mat-label>
Format
</mat-label>
<mat-label>
Edit Mode
</mat-label>
<mat-select [(ngModel)]="
agg.format" name="aggFormat{{i}}
">
<mat-select [(ngModel)]="
currentConfig.editMode" name="editMode
">
<mat-option value="none">None</mat-option>
<mat-option value="none">None</mat-option>
<mat-option value="
number">Number
</mat-option>
<mat-option value="
inline">Inline
</mat-option>
<mat-option value="
currency">Currency
</mat-option>
<mat-option value="
dialog">Dialog
</mat-option>
<mat-option value="
percentage">Percentage
</mat-option>
<mat-option value="
batch">Batch
</mat-option>
</mat-select>
</mat-select>
<mat-hint>Row editing mode</mat-hint>
</mat-form-field>
</mat-form-field>
</div>
</div>
</div>
</mat-tab>
<div class="flex items-center justify-between mt-4">
<!-- Data Management Tab -->
<div class="flex items-center space-x-4">
<mat-tab label="Data">
<mat-checkbox [(ngModel)]="agg.visible" name="aggVisible{{i}}">
<div class="config-section">
Visible
<h3 class="section-title text-emerald-600">Data Management</h3>
</mat-checkbox>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<button mat-icon-button color="warn" (click)="removeAggregateColumn(i)">
<mat-form-field appearance="fill">
<mat-icon>delete</mat-icon>
<mat-label>Data Source Type</mat-label>
</button>
<mat-select [(ngModel)]="currentConfig.dataSourceType" name="dataSourceType">
<mat-option value="local">Local Data</mat-option>
<mat-option value="remote">Remote Data</mat-option>
<mat-option value="odata">OData Service</mat-option>
<mat-option value="webapi">Web API</mat-option>
</mat-select>
<mat-hint>Type of data source</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>API Endpoint</mat-label>
<input matInput [(ngModel)]="currentConfig.apiEndpoint" name="apiEndpoint" placeholder="https://api.example.com/data">
<mat-hint>API endpoint URL</mat-hint>
</mat-form-field>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Refresh Interval (ms)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.refreshInterval" name="refreshInterval" min="0" step="1000">
<mat-hint>0 = No auto-refresh</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Cache Duration (seconds)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.cacheDuration" name="cacheDuration" min="0" max="3600">
<mat-hint>Data cache duration</mat-hint>
</mat-form-field>
</div>
<div class="flex items-center space-x-4 mb-4">
<mat-checkbox [(ngModel)]="currentConfig.enableVirtualization" name="enableVirtualization">
Enable Virtual Scrolling
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.enableInfiniteScroll" name="enableInfiniteScroll">
Enable Infinite Scroll
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.enableLazyLoad" name="enableLazyLoad">
Enable Lazy Loading
</mat-checkbox>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Data Transform Function</mat-label>
<textarea matInput [(ngModel)]="currentConfig.dataTransform" name="dataTransform" rows="3"
placeholder="data => data.map(item => ({ ...item, formattedValue: formatCurrency(item.value) }))"></textarea>
<mat-hint>JavaScript function to transform data</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Error Message</mat-label>
<input matInput [(ngModel)]="currentConfig.errorMessage" name="errorMessage" placeholder="Failed to load data">
<mat-hint>Error message to display</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
</mat-tab>
</div>
<!-- Security Tab -->
<!-- Export Tab -->
<mat-tab label="Security">
<div class="config-section">
<div class="config-section">
<h3 class="text-blue-600">Export Configuration</h3>
<h3 class="section-title text-gray-600">Security Configuration</h3>
<div class="flex items-center mb-4">
<div class="flex items-center mb-4">
<mat-checkbox [(ngModel)]="currentConfig.enableExport" name="enableExport">
<mat-checkbox [(ngModel)]="currentConfig.requireAuth" name="requireAuth">
Enable Export
Require Authentication
</mat-checkbox>
</mat-checkbox>
</div>
</div>
<div *ngIf="currentConfig.enableExport" class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div *ngIf="currentConfig.requireAuth" class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-form-field appearance="fill">
<mat-label>Export Formats</mat-label>
<mat-label>Allowed Roles</mat-label>
<mat-select [(ngModel)]="currentConfig.exportFormats" name="exportFormats" multiple>
<input matInput [(ngModel)]="currentConfig.allowedRoles" name="allowedRoles" placeholder="admin,user,manager">
<mat-option value="excel">Excel (.xlsx)</mat-option>
<mat-hint>Comma-separated list of allowed roles</mat-hint>
<mat-option value="csv">CSV (.csv)</mat-option>
</mat-form-field>
<mat-option value="pdf">PDF (.pdf)</mat-option>
<mat-option value="json">JSON (.json)</mat-option>
<mat-form-field appearance="fill">
</mat-select>
<mat-label>Permission Level</mat-label>
<mat-hint>Available export formats</mat-hint>
<mat-select [(ngModel)]="currentConfig.permissionLevel" name="permissionLevel">
</mat-form-field>
<mat-option value="read">Read Only</mat-option>
<mat-option value="write">Read/Write</mat-option>
<mat-form-field appearance="fill">
<mat-option value="admin">Full Access</mat-option>
<mat-label>Export Filename</mat-label>
</mat-select>
<input matInput [(ngModel)]="currentConfig.exportFilename" name="exportFilename" placeholder="data-export">
<mat-hint>Required permission level</mat-hint>
<mat-hint>Default filename for exports</mat-hint>
</mat-form-field>
</mat-form-field>
</div>
</div>
<div class="flex items-center space-x-4">
<div *ngIf="currentConfig.enableExport" class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="currentConfig.dataEncryption" name="dataEncryption">
<mat-checkbox [(ngModel)]="currentConfig.includeHeaders" name="includeHeaders">
Enable Data Encryption
Include Headers in Export
</mat-checkbox>
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.auditLog" name="auditLog">
<mat-checkbox [(ngModel)]="currentConfig.includeFilters" name="includeFilters">
Enable Audit Logging
Include Applied Filters
</mat-checkbox>
</mat-checkbox>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<!-- Security Tab -->
<mat-label>Rate Limit (requests/hour)</mat-label>
<div class="config-section">
<input matInput type="number" [(ngModel)]="currentConfig.rateLimit" name="rateLimit" min="0" max="10000">
<h3 class="text-blue-600">Security Configuration</h3>
<mat-hint>Maximum requests per hour per user</mat-hint>
</mat-form-field>
<div class="flex items-center mb-4">
<mat-checkbox [(ngModel)]="currentConfig.requireAuth" name="requireAuth">
<mat-form-field appearance="fill">
Require Authentication
<mat-label>Session Timeout (minutes)</mat-label>
</mat-checkbox>
<input matInput type="number" [(ngModel)]="currentConfig.sessionTimeout" name="sessionTimeout" min="5" max="480">
</div>
<mat-hint>Session timeout in minutes</mat-hint>
</mat-form-field>
<div *ngIf="currentConfig.requireAuth" class="grid grid-cols-1 md:grid-cols-2 gap-4">
</div>
<mat-form-field appearance="fill">
</div>
<mat-label>Allowed Roles</mat-label>
</mat-tab>
<input matInput [(ngModel)]="currentConfig.allowedRoles" name="allowedRoles" placeholder="admin,user,manager">
</mat-tab-group>
<mat-hint>Comma-separated list of allowed roles</mat-hint>
</div>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Permission Level</mat-label>
<mat-select [(ngModel)]="currentConfig.permissionLevel" name="permissionLevel">
<mat-option value="read">Read Only</mat-option>
<mat-option value="write">Read/Write</mat-option>
<mat-option value="admin">Full Access</mat-option>
</mat-select>
<mat-hint>Required permission level</mat-hint>
</mat-form-field>
</div>
<div class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="currentConfig.dataEncryption" name="dataEncryption">
Enable Data Encryption
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.auditLog" name="auditLog">
Enable Audit Logging
</mat-checkbox>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Rate Limit (requests/hour)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.rateLimit" name="rateLimit" min="0" max="10000">
<mat-hint>Maximum requests per hour per user</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Session Timeout (minutes)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.sessionTimeout" name="sessionTimeout" min="5" max="480">
<mat-hint>Session timeout in minutes</mat-hint>
</mat-form-field>
</div>
</div>
</app-base-config>
`
,
`
,
styles
:
[
`
styles
:
[
`
.config-container {
padding: 20px;
background: #f8fafc;
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.config-section {
.config-section {
margin-bottom: 24px;
margin-bottom: 32px;
padding: 24px;
background: white;
border-radius: 8px;
border: 1px solid #e2e8f0;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
.section-title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 20px;
padding-bottom: 8px;
border-bottom: 2px solid #e2e8f0;
}
.config-tabs {
margin-top: 0;
}
.config-tabs .mat-tab-body-content {
padding: 20px 0;
}
.config-tabs .mat-tab-header {
background: white;
border-radius: 8px 8px 0 0;
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}
.config-tabs .mat-tab-label {
min-width: 120px;
font-weight: 500;
}
.config-tabs .mat-tab-label-active {
color: #3b82f6;
}
.mat-form-field {
margin-bottom: 8px;
}
.grid {
display: grid;
gap: 16px;
}
.grid-cols-1 {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (min-width: 768px) {
.md\\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.md\\:grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
.w-full {
width: 100%;
}
.flex {
display: flex;
}
.items-center {
align-items: center;
}
.justify-between {
justify-content: space-between;
}
.space-x-4 > * + * {
margin-left: 16px;
}
.mb-4 {
margin-bottom: 16px;
}
.mt-4 {
margin-top: 16px;
}
.p-4 {
padding: 16px;
}
}
.column-config-item {
.column-config-item {
background: #f9fafb;
background: #f9fafb;
border: 1px solid #e5e7eb;
border: 1px solid #e5e7eb;
border-radius: 8px;
border-radius: 8px;
margin-bottom: 16px;
}
}
.size-config {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
margin-bottom: 20px;
}
.size-option {
padding: 16px;
border: 2px solid #e5e7eb;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
background: white;
}
.size-option:hover {
border-color: #3b82f6;
background: #f0f9ff;
}
.size-option.selected {
border-color: #3b82f6;
background: #dbeafe;
}
.size-option h4 {
margin: 0 0 8px 0;
font-size: 1rem;
font-weight: 600;
color: #374151;
}
.size-option p {
margin: 0;
font-size: 0.875rem;
color: #6b7280;
}
.feature-group {
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 8px;
padding: 16px;
}
.space-y-2 > * + * {
margin-top: 8px;
}
.text-sm {
font-size: 0.875rem;
}
.font-semibold {
font-weight: 600;
}
.text-gray-700 {
color: #374151;
}
.mb-3 {
margin-bottom: 12px;
}
.mt-6 {
margin-top: 24px;
}
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #16a34a; }
.text-purple-600 { color: #9333ea; }
.text-orange-600 { color: #ea580c; }
.text-teal-600 { color: #0d9488; }
.text-red-600 { color: #dc2626; }
.text-indigo-600 { color: #4f46e5; }
.text-gray-600 { color: #4b5563; }
.text-cyan-600 { color: #0891b2; }
.text-emerald-600 { color: #059669; }
`
]
`
]
})
})
export
class
SyncfusionDatagridConfigComponent
extends
BaseConfigComponent
implements
OnInit
{
export
class
SyncfusionDatagridConfigComponent
extends
BaseConfigComponent
implements
OnInit
{
...
@@ -455,6 +849,76 @@ export class SyncfusionDatagridConfigComponent extends BaseConfigComponent imple
...
@@ -455,6 +849,76 @@ export class SyncfusionDatagridConfigComponent extends BaseConfigComponent imple
this
.
initializeColorDefaults
();
this
.
initializeColorDefaults
();
}
}
override
initializeDefaultConfig
()
{
// Basic Configuration
if
(
!
this
.
currentConfig
.
title
)
this
.
currentConfig
.
title
=
'Data Grid Widget'
;
if
(
!
this
.
currentConfig
.
pageSize
)
this
.
currentConfig
.
pageSize
=
10
;
if
(
!
this
.
currentConfig
.
fontSize
)
this
.
currentConfig
.
fontSize
=
14
;
if
(
!
this
.
currentConfig
.
dataSource
)
this
.
currentConfig
.
dataSource
=
'static'
;
if
(
!
this
.
currentConfig
.
apiEndpoint
)
this
.
currentConfig
.
apiEndpoint
=
''
;
// Row Configuration
if
(
!
this
.
currentConfig
.
rowHeight
)
this
.
currentConfig
.
rowHeight
=
40
;
if
(
!
this
.
currentConfig
.
headerRowHeight
)
this
.
currentConfig
.
headerRowHeight
=
40
;
if
(
!
this
.
currentConfig
.
showAlternateRows
)
this
.
currentConfig
.
showAlternateRows
=
false
;
if
(
!
this
.
currentConfig
.
allowRowSelection
)
this
.
currentConfig
.
allowRowSelection
=
false
;
// Filter Configuration
if
(
!
this
.
currentConfig
.
allowFiltering
)
this
.
currentConfig
.
allowFiltering
=
true
;
if
(
!
this
.
currentConfig
.
showFilterBar
)
this
.
currentConfig
.
showFilterBar
=
false
;
if
(
!
this
.
currentConfig
.
filterType
)
this
.
currentConfig
.
filterType
=
'menu'
;
if
(
!
this
.
currentConfig
.
filterBarHeight
)
this
.
currentConfig
.
filterBarHeight
=
40
;
// Aggregate Configuration
if
(
!
this
.
currentConfig
.
showAggregate
)
this
.
currentConfig
.
showAggregate
=
false
;
if
(
!
this
.
currentConfig
.
aggregateColumns
)
this
.
currentConfig
.
aggregateColumns
=
[];
// Export Configuration
if
(
!
this
.
currentConfig
.
enableExport
)
this
.
currentConfig
.
enableExport
=
false
;
if
(
!
this
.
currentConfig
.
exportFormats
)
this
.
currentConfig
.
exportFormats
=
[
'excel'
];
if
(
!
this
.
currentConfig
.
exportFilename
)
this
.
currentConfig
.
exportFilename
=
'data-export'
;
if
(
!
this
.
currentConfig
.
includeHeaders
)
this
.
currentConfig
.
includeHeaders
=
true
;
if
(
!
this
.
currentConfig
.
includeFilters
)
this
.
currentConfig
.
includeFilters
=
false
;
// Features Configuration
if
(
!
this
.
currentConfig
.
allowPaging
)
this
.
currentConfig
.
allowPaging
=
true
;
if
(
!
this
.
currentConfig
.
allowPageSize
)
this
.
currentConfig
.
allowPageSize
=
true
;
if
(
!
this
.
currentConfig
.
showPageInfo
)
this
.
currentConfig
.
showPageInfo
=
true
;
if
(
!
this
.
currentConfig
.
allowPageNavigation
)
this
.
currentConfig
.
allowPageNavigation
=
true
;
if
(
!
this
.
currentConfig
.
allowSorting
)
this
.
currentConfig
.
allowSorting
=
true
;
if
(
!
this
.
currentConfig
.
allowMultiSorting
)
this
.
currentConfig
.
allowMultiSorting
=
false
;
if
(
!
this
.
currentConfig
.
allowAdvancedFiltering
)
this
.
currentConfig
.
allowAdvancedFiltering
=
false
;
if
(
!
this
.
currentConfig
.
allowGrouping
)
this
.
currentConfig
.
allowGrouping
=
false
;
if
(
!
this
.
currentConfig
.
allowReordering
)
this
.
currentConfig
.
allowReordering
=
true
;
if
(
!
this
.
currentConfig
.
allowResizing
)
this
.
currentConfig
.
allowResizing
=
true
;
if
(
!
this
.
currentConfig
.
allowSearching
)
this
.
currentConfig
.
allowSearching
=
false
;
if
(
!
this
.
currentConfig
.
allowSelection
)
this
.
currentConfig
.
allowSelection
=
false
;
if
(
!
this
.
currentConfig
.
allowMultiSelection
)
this
.
currentConfig
.
allowMultiSelection
=
false
;
if
(
!
this
.
currentConfig
.
allowEditing
)
this
.
currentConfig
.
allowEditing
=
false
;
if
(
!
this
.
currentConfig
.
allowAdding
)
this
.
currentConfig
.
allowAdding
=
false
;
if
(
!
this
.
currentConfig
.
selectionMode
)
this
.
currentConfig
.
selectionMode
=
'none'
;
if
(
!
this
.
currentConfig
.
editMode
)
this
.
currentConfig
.
editMode
=
'none'
;
// Data Management Configuration
if
(
!
this
.
currentConfig
.
dataSourceType
)
this
.
currentConfig
.
dataSourceType
=
'local'
;
if
(
!
this
.
currentConfig
.
refreshInterval
)
this
.
currentConfig
.
refreshInterval
=
0
;
if
(
!
this
.
currentConfig
.
cacheDuration
)
this
.
currentConfig
.
cacheDuration
=
300
;
if
(
!
this
.
currentConfig
.
enableVirtualization
)
this
.
currentConfig
.
enableVirtualization
=
false
;
if
(
!
this
.
currentConfig
.
enableInfiniteScroll
)
this
.
currentConfig
.
enableInfiniteScroll
=
false
;
if
(
!
this
.
currentConfig
.
enableLazyLoad
)
this
.
currentConfig
.
enableLazyLoad
=
false
;
if
(
!
this
.
currentConfig
.
dataTransform
)
this
.
currentConfig
.
dataTransform
=
''
;
if
(
!
this
.
currentConfig
.
errorMessage
)
this
.
currentConfig
.
errorMessage
=
'Failed to load data'
;
// Security Configuration
if
(
!
this
.
currentConfig
.
requireAuth
)
this
.
currentConfig
.
requireAuth
=
false
;
if
(
!
this
.
currentConfig
.
allowedRoles
)
this
.
currentConfig
.
allowedRoles
=
''
;
if
(
!
this
.
currentConfig
.
permissionLevel
)
this
.
currentConfig
.
permissionLevel
=
'read'
;
if
(
!
this
.
currentConfig
.
dataEncryption
)
this
.
currentConfig
.
dataEncryption
=
false
;
if
(
!
this
.
currentConfig
.
auditLog
)
this
.
currentConfig
.
auditLog
=
false
;
if
(
!
this
.
currentConfig
.
rateLimit
)
this
.
currentConfig
.
rateLimit
=
0
;
if
(
!
this
.
currentConfig
.
sessionTimeout
)
this
.
currentConfig
.
sessionTimeout
=
30
;
}
private
initializeColorDefaults
()
{
private
initializeColorDefaults
()
{
if
(
!
this
.
currentConfig
.
backgroundColor
)
this
.
currentConfig
.
backgroundColor
=
'#FFFFFF'
;
if
(
!
this
.
currentConfig
.
backgroundColor
)
this
.
currentConfig
.
backgroundColor
=
'#FFFFFF'
;
if
(
!
this
.
currentConfig
.
textColor
)
this
.
currentConfig
.
textColor
=
'#374151'
;
if
(
!
this
.
currentConfig
.
textColor
)
this
.
currentConfig
.
textColor
=
'#374151'
;
...
...
src/app/portal-manage/dashboard-management/widgets/configs/syncfusion-pivot-config/syncfusion-pivot-config.component.ts
View file @
5cca44a4
...
@@ -7,6 +7,7 @@ import { MatSelectModule } from '@angular/material/select';
...
@@ -7,6 +7,7 @@ import { MatSelectModule } from '@angular/material/select';
import
{
MatCheckboxModule
}
from
'@angular/material/checkbox'
;
import
{
MatCheckboxModule
}
from
'@angular/material/checkbox'
;
import
{
MatButtonModule
}
from
'@angular/material/button'
;
import
{
MatButtonModule
}
from
'@angular/material/button'
;
import
{
MatIconModule
}
from
'@angular/material/icon'
;
import
{
MatIconModule
}
from
'@angular/material/icon'
;
import
{
MatTabsModule
}
from
'@angular/material/tabs'
;
import
{
BaseConfigComponent
}
from
'../../../widget-config/base-config/base-config.component'
;
import
{
BaseConfigComponent
}
from
'../../../widget-config/base-config/base-config.component'
;
@
Component
({
@
Component
({
...
@@ -21,228 +22,747 @@ import { BaseConfigComponent } from '../../../widget-config/base-config/base-con
...
@@ -21,228 +22,747 @@ import { BaseConfigComponent } from '../../../widget-config/base-config/base-con
MatCheckboxModule
,
MatCheckboxModule
,
MatButtonModule
,
MatButtonModule
,
MatIconModule
,
MatIconModule
,
MatTabsModule
,
BaseConfigComponent
BaseConfigComponent
],
],
template
:
`
template
:
`
<app-base-config>
<div class="config-container">
<!-- Basic Configuration -->
<mat-tab-group class="config-tabs" dynamicHeight>
<div class="config-section border p-4 rounded-lg mb-4">
<!-- Basic Configuration Tab -->
<h3 class="text-lg font-semibold mb-3 text-blue-600">Basic Configuration</h3>
<mat-tab label="Basic">
<div class="config-section">
<mat-form-field appearance="fill" class="w-full">
<h3 class="section-title text-blue-600">Basic Configuration</h3>
<mat-label>Title</mat-label>
<input matInput [(ngModel)]="currentConfig.title" name="title" aria-label="Widget title">
<mat-hint>Widget title displayed in header</mat-hint>
</mat-form-field>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Display As</mat-label>
<mat-select [(ngModel)]="currentConfig.displayOptionView" name="displayOptionView">
<mat-option value="Both">Both (Grid & Chart)</mat-option>
<mat-option value="Grid">Grid Only</mat-option>
<mat-option value="Chart">Chart Only</mat-option>
</mat-select>
<mat-hint>What to display</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Chart Type</mat-label>
<mat-select [(ngModel)]="currentConfig.chartType" name="chartType">
<mat-option value="Column">Column</mat-option>
<mat-option value="Bar">Bar</mat-option>
<mat-option value="Line">Line</mat-option>
<mat-option value="Area">Area</mat-option>
<mat-option value="Pie">Pie</mat-option>
<mat-option value="Doughnut">Doughnut</mat-option>
</mat-select>
<mat-hint>Chart type when displaying chart</mat-hint>
</mat-form-field>
</div>
</div>
<!-- Pivot Functionality -->
<div class="config-section border p-4 rounded-lg mb-4">
<h3 class="text-lg font-semibold mb-3 text-green-600">Pivot Functionality</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="flex items-center">
<mat-checkbox [(ngModel)]="currentConfig.showFieldList" name="showFieldList" class="mr-2">
Show Field List
</mat-checkbox>
</div>
<div class="flex items-center
">
<mat-form-field appearance="fill" class="w-full
">
<mat-checkbox [(ngModel)]="currentConfig.showToolbar" name="showToolbar" class="mr-2"
>
<mat-label>Title</mat-label
>
Show Toolbar
<input matInput [(ngModel)]="currentConfig.title" name="title" aria-label="Widget title">
</mat-checkbox
>
<mat-hint>Widget title displayed in header</mat-hint
>
</div
>
</mat-form-field
>
<div class="flex items-center">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-checkbox [(ngModel)]="currentConfig.showGroupingBar" name="showGroupingBar" class="mr-2">
<mat-form-field appearance="fill">
Show Grouping Bar
<mat-label>Display As</mat-label>
</mat-checkbox>
<mat-select [(ngModel)]="currentConfig.displayOptionView" name="displayOptionView">
</div>
<mat-option value="Both">Both (Grid & Chart)</mat-option>
<mat-option value="Grid">Grid Only</mat-option>
<mat-option value="Chart">Chart Only</mat-option>
</mat-select>
<mat-hint>What to display</mat-hint>
</mat-form-field>
<div class="flex items-center">
<mat-form-field appearance="fill">
<mat-checkbox [(ngModel)]="currentConfig.allowCalculatedField" name="allowCalculatedField" class="mr-2">
<mat-label>Chart Type</mat-label>
Allow Calculated Fields
<mat-select [(ngModel)]="currentConfig.chartType" name="chartType">
</mat-checkbox>
<mat-option value="Column">Column</mat-option>
</div>
<mat-option value="Bar">Bar</mat-option>
<mat-option value="Line">Line</mat-option>
<mat-option value="Area">Area</mat-option>
<mat-option value="Pie">Pie</mat-option>
<mat-option value="Doughnut">Doughnut</mat-option>
</mat-select>
<mat-hint>Chart type when displaying chart</mat-hint>
</mat-form-field>
</div>
<div class="flex items-center">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-checkbox [(ngModel)]="currentConfig.allowConditionalFormatting" name="allowConditionalFormatting" class="mr-2">
<mat-form-field appearance="fill">
Allow Conditional Formatting
<mat-label>Data Source</mat-label>
</mat-checkbox>
<mat-select [(ngModel)]="currentConfig.dataSource" name="dataSource">
</div>
<mat-option value="static">Static Data</mat-option>
<mat-option value="api">API Endpoint</mat-option>
<mat-option value="dataset">Dataset</mat-option>
</mat-select>
<mat-hint>Source of the data</mat-hint>
</mat-form-field>
<div class="flex items-center">
<mat-form-field appearance="fill">
<mat-checkbox [(ngModel)]="currentConfig.allowNumberFormatting" name="allowNumberFormatting" class="mr-2">
<mat-label>API Endpoint</mat-label>
Allow Number Formatting
<input matInput [(ngModel)]="currentConfig.apiEndpoint" name="apiEndpoint" placeholder="https://api.example.com/data">
</mat-checkbox>
<mat-hint>API endpoint URL</mat-hint>
</mat-form-field>
</div>
<!-- Size Configuration -->
<div class="config-section">
<h3 class="section-title text-blue-600">Size Configuration</h3>
<div class="size-config">
<div
*ngFor="let option of sizeOptions"
class="size-option"
[class.selected]="currentConfig.sizeOption === option.id"
(click)="setSizeOption(option.id)">
<h4>{{ option.label }}</h4>
<p>{{ option.description }}</p>
</div>
</div>
<div *ngIf="currentConfig.sizeOption === 'custom'" class="grid grid-cols-2 gap-4 mt-4">
<mat-form-field appearance="fill">
<mat-label>Width</mat-label>
<input matInput [(ngModel)]="currentConfig.width" name="width" placeholder="e.g., 100%, 800px">
<mat-hint>Pivot width</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Height</mat-label>
<input matInput [(ngModel)]="currentConfig.height" name="height" placeholder="e.g., 100%, 400px">
<mat-hint>Pivot height</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</div>
</mat-tab>
<!-- Pivot Functionality Tab -->
<mat-tab label="Features">
<div class="config-section">
<h3 class="section-title text-green-600">Pivot Functionality</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="feature-group">
<h4 class="text-sm font-semibold text-gray-700 mb-3">Display Options</h4>
<div class="space-y-2">
<mat-checkbox [(ngModel)]="currentConfig.showFieldList" name="showFieldList">
Show Field List
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.showToolbar" name="showToolbar">
Show Toolbar
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.showGroupingBar" name="showGroupingBar">
Show Grouping Bar
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.showPager" name="showPager">
Show Pager
</mat-checkbox>
</div>
</div>
<div class="feature-group">
<h4 class="text-sm font-semibold text-gray-700 mb-3">Field Management</h4>
<div class="space-y-2">
<mat-checkbox [(ngModel)]="currentConfig.allowCalculatedField" name="allowCalculatedField">
Allow Calculated Fields
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowConditionalFormatting" name="allowConditionalFormatting">
Allow Conditional Formatting
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowNumberFormatting" name="allowNumberFormatting">
Allow Number Formatting
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowFieldDragDrop" name="allowFieldDragDrop">
Allow Field Drag & Drop
</mat-checkbox>
</div>
</div>
<div class="flex items-center">
<div class="feature-group">
<mat-checkbox [(ngModel)]="currentConfig.allowSubTotal" name="allowSubTotal" class="mr-2">
<h4 class="text-sm font-semibold text-gray-700 mb-3">Totals & Aggregation</h4>
Allow Sub Total
<div class="space-y-2">
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowSubTotal" name="allowSubTotal">
Allow Sub Total
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowGrandTotal" name="allowGrandTotal">
Allow Grand Total
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowDrillThrough" name="allowDrillThrough">
Allow Drill Through
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowSorting" name="allowSorting">
Allow Sorting
</mat-checkbox>
</div>
</div>
<div class="feature-group">
<h4 class="text-sm font-semibold text-gray-700 mb-3">Export & Interaction</h4>
<div class="space-y-2">
<mat-checkbox [(ngModel)]="currentConfig.allowExcelExport" name="allowExcelExport">
Allow Excel Export
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowPdfExport" name="allowPdfExport">
Allow PDF Export
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowCsvExport" name="allowCsvExport">
Allow CSV Export
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.allowPrint" name="allowPrint">
Allow Print
</mat-checkbox>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-6">
<mat-form-field appearance="fill">
<mat-label>Aggregation Type</mat-label>
<mat-select [(ngModel)]="currentConfig.aggregationType" name="aggregationType">
<mat-option value="sum">Sum</mat-option>
<mat-option value="count">Count</mat-option>
<mat-option value="average">Average</mat-option>
<mat-option value="min">Min</mat-option>
<mat-option value="max">Max</mat-option>
</mat-select>
<mat-hint>Default aggregation type</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Number Format</mat-label>
<mat-select [(ngModel)]="currentConfig.numberFormat" name="numberFormat">
<mat-option value="N">Number</mat-option>
<mat-option value="C">Currency</mat-option>
<mat-option value="P">Percentage</mat-option>
<mat-option value="D">Date</mat-option>
</mat-select>
<mat-hint>Number formatting</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</mat-tab>
<!-- Pivot Fields Tab -->
<mat-tab label="Fields">
<div class="config-section">
<h3 class="section-title text-purple-600">Pivot Fields Configuration</h3>
<!-- Pivot Rows -->
<div class="field-section">
<div class="flex items-center justify-between mb-4">
<h4 class="text-lg font-semibold">Rows</h4>
<button mat-raised-button color="primary" (click)="addPivotRow()">
<mat-icon>add</mat-icon> Add Row
</button>
</div>
<div *ngFor="let row of currentConfig.rows; let i = index" class="field-config-item">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Row Field</mat-label>
<mat-select [(ngModel)]="row.name" [name]="'row_name_' + i">
<mat-option *ngFor="let col of availableColumns" [value]="col">{{ col }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Caption</mat-label>
<input matInput [(ngModel)]="row.caption" [name]="'row_caption_' + i" placeholder="Row caption">
</mat-form-field>
</div>
<div class="flex items-center justify-between mt-4">
<div class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="row.visible" [name]="'row_visible_' + i">
Visible
</mat-checkbox>
<mat-checkbox [(ngModel)]="row.expanded" [name]="'row_expanded_' + i">
Expanded
</mat-checkbox>
</div>
<button mat-icon-button color="warn" (click)="removePivotRow(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
<div class="flex items-center">
<!-- Pivot Columns -->
<mat-checkbox [(ngModel)]="currentConfig.allowGrandTotal" name="allowGrandTotal" class="mr-2">
<div class="field-section">
Allow Grand Total
<div class="flex items-center justify-between mb-4">
</mat-checkbox>
<h4 class="text-lg font-semibold">Columns</h4>
<button mat-raised-button color="primary" (click)="addPivotColumn()">
<mat-icon>add</mat-icon> Add Column
</button>
</div>
<div *ngFor="let col of currentConfig.columns; let i = index" class="field-config-item">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Column Field</mat-label>
<mat-select [(ngModel)]="col.name" [name]="'col_name_' + i">
<mat-option *ngFor="let c of availableColumns" [value]="c">{{ c }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Caption</mat-label>
<input matInput [(ngModel)]="col.caption" [name]="'col_caption_' + i" placeholder="Column caption">
</mat-form-field>
</div>
<div class="flex items-center justify-between mt-4">
<div class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="col.visible" [name]="'col_visible_' + i">
Visible
</mat-checkbox>
<mat-checkbox [(ngModel)]="col.expanded" [name]="'col_expanded_' + i">
Expanded
</mat-checkbox>
</div>
<button mat-icon-button color="warn" (click)="removePivotColumn(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
<!-- Pivot Values -->
<div class="field-section">
<div class="flex items-center justify-between mb-4">
<h4 class="text-lg font-semibold">Values</h4>
<button mat-raised-button color="primary" (click)="addPivotValue()">
<mat-icon>add</mat-icon> Add Value
</button>
</div>
<div *ngFor="let val of currentConfig.values; let i = index" class="field-config-item">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<mat-form-field appearance="fill">
<mat-label>Value Field</mat-label>
<mat-select [(ngModel)]="val.name" [name]="'val_name_' + i">
<mat-option *ngFor="let c of availableColumns" [value]="c">{{ c }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Caption</mat-label>
<input matInput [(ngModel)]="val.caption" [name]="'val_caption_' + i" placeholder="Value caption">
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Aggregation</mat-label>
<mat-select [(ngModel)]="val.aggregation" [name]="'val_aggregation_' + i">
<mat-option value="sum">Sum</mat-option>
<mat-option value="count">Count</mat-option>
<mat-option value="average">Average</mat-option>
<mat-option value="min">Min</mat-option>
<mat-option value="max">Max</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="flex items-center justify-between mt-4">
<div class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="val.visible" [name]="'val_visible_' + i">
Visible
</mat-checkbox>
<mat-checkbox [(ngModel)]="val.showSubTotals" [name]="'val_showSubTotals_' + i">
Show Sub Totals
</mat-checkbox>
</div>
<button mat-icon-button color="warn" (click)="removePivotValue(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
<!-- Pivot Filters -->
<div class="field-section">
<div class="flex items-center justify-between mb-4">
<h4 class="text-lg font-semibold">Filters</h4>
<button mat-raised-button color="primary" (click)="addPivotFilter()">
<mat-icon>add</mat-icon> Add Filter
</button>
</div>
<div *ngFor="let fil of currentConfig.filters; let i = index" class="field-config-item">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Filter Field</mat-label>
<mat-select [(ngModel)]="fil.name" [name]="'fil_name_' + i">
<mat-option *ngFor="let c of availableColumns" [value]="c">{{ c }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Filter Type</mat-label>
<mat-select [(ngModel)]="fil.type" [name]="'fil_type_' + i">
<mat-option value="exclude">Exclude</mat-option>
<mat-option value="include">Include</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="flex items-center justify-between mt-4">
<div class="flex items-center space-x-4">
<mat-checkbox [(ngModel)]="fil.visible" [name]="'fil_visible_' + i">
Visible
</mat-checkbox>
</div>
<button mat-icon-button color="warn" (click)="removePivotFilter(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
</div>
</div>
</mat-tab>
<!-- Style Tab -->
<mat-tab label="Style">
<div class="config-section">
<h3 class="section-title text-orange-600">Style Configuration</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Background Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.backgroundColor" name="backgroundColor">
<mat-hint>Pivot background color</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Text Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.textColor" name="textColor">
<mat-hint>Text color</mat-hint>
</mat-form-field>
</div>
<div class="flex items-center">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-checkbox [(ngModel)]="currentConfig.allowExcelExport" name="allowExcelExport" class="mr-2">
<mat-form-field appearance="fill">
Allow Excel Export
<mat-label>Header Background Color</mat-label>
</mat-checkbox>
<input matInput type="color" [(ngModel)]="currentConfig.headerBackgroundColor" name="headerBackgroundColor">
<mat-hint>Header background color</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Header Text Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.headerTextColor" name="headerTextColor">
<mat-hint>Header text color</mat-hint>
</mat-form-field>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Border Color</mat-label>
<input matInput type="color" [(ngModel)]="currentConfig.borderColor" name="borderColor">
<mat-hint>Border color</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Border Radius (px)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.borderRadius" name="borderRadius" min="0" max="20">
<mat-hint>Corner roundness</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</mat-tab>
<!-- Data Tab -->
<mat-tab label="Data">
<div class="config-section">
<h3 class="section-title text-emerald-600">Data Management</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<mat-form-field appearance="fill">
<mat-label>Refresh Interval (ms)</mat-label>
<input matInput type="number" [(ngModel)]="currentConfig.refreshInterval" name="refreshInterval" min="0" step="1000">
<mat-hint>0 = No auto-refresh</mat-hint>
</mat-form-field>
<div class="flex items-center">
<mat-form-field appearance="fill">
<mat-checkbox [(ngModel)]="currentConfig.allowPdfExport" name="allowPdfExport" class="mr-2">
<mat-label>Cache Duration (seconds)</mat-label>
Allow PDF Export
<input matInput type="number" [(ngModel)]="currentConfig.cacheDuration" name="cacheDuration" min="0" max="3600">
</mat-checkbox>
<mat-hint>Data cache duration</mat-hint>
</mat-form-field>
</div>
<div class="flex items-center space-x-4 mb-4">
<mat-checkbox [(ngModel)]="currentConfig.enableVirtualization" name="enableVirtualization">
Enable Virtual Scrolling
</mat-checkbox>
<mat-checkbox [(ngModel)]="currentConfig.enableLazyLoad" name="enableLazyLoad">
Enable Lazy Loading
</mat-checkbox>
</div>
<div class="grid grid-cols-1 gap-4">
<mat-form-field appearance="fill">
<mat-label>Data Transform Function</mat-label>
<textarea matInput [(ngModel)]="currentConfig.dataTransform" name="dataTransform" rows="3"
placeholder="data => data.map(item => ({ ...item, formattedValue: formatCurrency(item.value) }))"></textarea>
<mat-hint>JavaScript function to transform data</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</div>
</mat-tab>
</div>
</mat-tab-group>
</div>
<!-- Pivot Rows -->
`
,
<div class="config-section border p-3 rounded-lg mb-4">
styles
:
[
`
<h3 class="text-lg font-semibold mb-2">Rows</h3>
.config-container {
<div *ngFor="let row of currentConfig.rows; let i = index" class="flex items-center gap-2 mb-2">
padding: 20px;
<mat-form-field appearance="fill" class="flex-grow">
background: #f8fafc;
<mat-label>Row Field</mat-label>
border-radius: 12px;
<mat-select [(ngModel)]="row.name" [name]="'row_name_' + i">
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
<mat-option *ngFor="let col of availableColumns" [value]="col">{{ col }}</mat-option>
}
</mat-select>
</mat-form-field>
.config-section {
<button mat-icon-button color="warn" (click)="removePivotRow(i)" type="button"><mat-icon>delete</mat-icon></button>
margin-bottom: 32px;
</div>
padding: 24px;
<button mat-stroked-button color="primary" (click)="addPivotRow()" type="button"><mat-icon>add</mat-icon> Add Row</button>
background: white;
</div>
border-radius: 8px;
border: 1px solid #e2e8f0;
<!-- Pivot Columns -->
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
<div class="config-section border p-3 rounded-lg mb-4">
}
<h3 class="text-lg font-semibold mb-2">Columns</h3>
<div *ngFor="let col of currentConfig.columns; let i = index" class="flex items-center gap-2 mb-2">
.section-title {
<mat-form-field appearance="fill" class="flex-grow">
font-size: 1.25rem;
<mat-label>Column Field</mat-label>
font-weight: 600;
<mat-select [(ngModel)]="col.name" [name]="'col_name_' + i">
margin-bottom: 20px;
<mat-option *ngFor="let c of availableColumns" [value]="c">{{ c }}</mat-option>
padding-bottom: 8px;
</mat-select>
border-bottom: 2px solid #e2e8f0;
</mat-form-field>
}
<button mat-icon-button color="warn" (click)="removePivotColumn(i)" type="button"><mat-icon>delete</mat-icon></button>
</div>
.config-tabs {
<button mat-stroked-button color="primary" (click)="addPivotColumn()" type="button"><mat-icon>add</mat-icon> Add Column</button>
margin-top: 0;
</div>
}
<!-- Pivot Values -->
.config-tabs .mat-tab-body-content {
<div class="config-section border p-3 rounded-lg mb-4">
padding: 20px 0;
<h3 class="text-lg font-semibold mb-2">Values</h3>
}
<div *ngFor="let val of currentConfig.values; let i = index" class="flex items-center gap-2 mb-2">
<mat-form-field appearance="fill" class="flex-grow">
.config-tabs .mat-tab-header {
<mat-label>Value Field</mat-label>
background: white;
<mat-select [(ngModel)]="val.name" [name]="'val_name_' + i">
border-radius: 8px 8px 0 0;
<mat-option *ngFor="let c of availableColumns" [value]="c">{{ c }}</mat-option>
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
</mat-select>
}
</mat-form-field>
<mat-form-field appearance="fill" class="flex-grow">
.config-tabs .mat-tab-label {
<mat-label>Caption</mat-label>
min-width: 120px;
<input matInput [(ngModel)]="val.caption" [name]="'val_caption_' + i">
font-weight: 500;
</mat-form-field>
}
<button mat-icon-button color="warn" (click)="removePivotValue(i)" type="button"><mat-icon>delete</mat-icon></button>
</div>
.config-tabs .mat-tab-label-active {
<button mat-stroked-button color="primary" (click)="addPivotValue()" type="button"><mat-icon>add</mat-icon> Add Value</button>
color: #3b82f6;
</div>
}
<!-- Pivot Filters -->
.mat-form-field {
<div class="config-section border p-3 rounded-lg">
margin-bottom: 8px;
<h3 class="text-lg font-semibold mb-2">Filters</h3>
}
<div *ngFor="let fil of currentConfig.filters; let i = index" class="flex items-center gap-2 mb-2">
<mat-form-field appearance="fill" class="flex-grow">
.grid {
<mat-label>Filter Field</mat-label>
display: grid;
<mat-select [(ngModel)]="fil.name" [name]="'fil_name_' + i">
gap: 16px;
<mat-option *ngFor="let c of availableColumns" [value]="c">{{ c }}</mat-option>
}
</mat-select>
</mat-form-field>
.grid-cols-1 {
<button mat-icon-button color="warn" (click)="removePivotFilter(i)" type="button"><mat-icon>delete</mat-icon></button>
grid-template-columns: repeat(1, minmax(0, 1fr));
</div>
}
<button mat-stroked-button color="primary" (click)="addPivotFilter()" type="button"><mat-icon>add</mat-icon> Add Filter</button>
</div>
.grid-cols-2 {
</app-base-config>
grid-template-columns: repeat(2, minmax(0, 1fr));
`
}
.grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (min-width: 768px) {
.md\\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.md\\:grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
.w-full {
width: 100%;
}
.flex {
display: flex;
}
.items-center {
align-items: center;
}
.justify-between {
justify-content: space-between;
}
.space-x-4 > * + * {
margin-left: 16px;
}
.mb-4 {
margin-bottom: 16px;
}
.mt-4 {
margin-top: 16px;
}
.field-section {
margin-bottom: 24px;
}
.field-config-item {
background: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 8px;
margin-bottom: 16px;
padding: 16px;
}
.feature-group {
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 8px;
padding: 16px;
}
.space-y-2 > * + * {
margin-top: 8px;
}
.text-sm {
font-size: 0.875rem;
}
.font-semibold {
font-weight: 600;
}
.text-gray-700 {
color: #374151;
}
.mb-3 {
margin-bottom: 12px;
}
.mt-6 {
margin-top: 24px;
}
.size-config {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
margin-bottom: 20px;
}
.size-option {
padding: 16px;
border: 2px solid #e5e7eb;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
background: white;
}
.size-option:hover {
border-color: #3b82f6;
background: #f0f9ff;
}
.size-option.selected {
border-color: #3b82f6;
background: #dbeafe;
}
.size-option h4 {
margin: 0 0 8px 0;
font-size: 1rem;
font-weight: 600;
color: #374151;
}
.size-option p {
margin: 0;
font-size: 0.875rem;
color: #6b7280;
}
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #16a34a; }
.text-purple-600 { color: #9333ea; }
.text-orange-600 { color: #ea580c; }
.text-emerald-600 { color: #059669; }
`
]
})
})
export
class
SyncfusionPivotConfigComponent
extends
BaseConfigComponent
implements
OnInit
{
export
class
SyncfusionPivotConfigComponent
extends
BaseConfigComponent
implements
OnInit
{
override
ngOnInit
():
void
{
override
ngOnInit
():
void
{
// Initialize default values for pivot widget
this
.
initializeDefaultConfig
();
this
.
initializeColorDefaults
();
}
override
initializeDefaultConfig
():
void
{
// Basic Configuration
if
(
!
this
.
currentConfig
.
title
)
this
.
currentConfig
.
title
=
'Pivot Grid Widget'
;
if
(
!
this
.
currentConfig
.
displayOptionView
)
this
.
currentConfig
.
displayOptionView
=
'Both'
;
if
(
!
this
.
currentConfig
.
chartType
)
this
.
currentConfig
.
chartType
=
'Column'
;
if
(
!
this
.
currentConfig
.
dataSource
)
this
.
currentConfig
.
dataSource
=
'static'
;
if
(
!
this
.
currentConfig
.
apiEndpoint
)
this
.
currentConfig
.
apiEndpoint
=
''
;
// Features Configuration
if
(
this
.
currentConfig
.
showFieldList
===
undefined
)
this
.
currentConfig
.
showFieldList
=
true
;
if
(
this
.
currentConfig
.
showToolbar
===
undefined
)
this
.
currentConfig
.
showToolbar
=
true
;
if
(
this
.
currentConfig
.
showGroupingBar
===
undefined
)
this
.
currentConfig
.
showGroupingBar
=
true
;
if
(
this
.
currentConfig
.
showPager
===
undefined
)
this
.
currentConfig
.
showPager
=
true
;
if
(
this
.
currentConfig
.
allowCalculatedField
===
undefined
)
this
.
currentConfig
.
allowCalculatedField
=
false
;
if
(
this
.
currentConfig
.
allowConditionalFormatting
===
undefined
)
this
.
currentConfig
.
allowConditionalFormatting
=
false
;
if
(
this
.
currentConfig
.
allowNumberFormatting
===
undefined
)
this
.
currentConfig
.
allowNumberFormatting
=
true
;
if
(
this
.
currentConfig
.
allowFieldDragDrop
===
undefined
)
this
.
currentConfig
.
allowFieldDragDrop
=
true
;
if
(
this
.
currentConfig
.
allowSubTotal
===
undefined
)
this
.
currentConfig
.
allowSubTotal
=
true
;
if
(
this
.
currentConfig
.
allowGrandTotal
===
undefined
)
this
.
currentConfig
.
allowGrandTotal
=
true
;
if
(
this
.
currentConfig
.
allowDrillThrough
===
undefined
)
this
.
currentConfig
.
allowDrillThrough
=
false
;
if
(
this
.
currentConfig
.
allowSorting
===
undefined
)
this
.
currentConfig
.
allowSorting
=
true
;
if
(
this
.
currentConfig
.
allowExcelExport
===
undefined
)
this
.
currentConfig
.
allowExcelExport
=
true
;
if
(
this
.
currentConfig
.
allowPdfExport
===
undefined
)
this
.
currentConfig
.
allowPdfExport
=
true
;
if
(
this
.
currentConfig
.
allowCsvExport
===
undefined
)
this
.
currentConfig
.
allowCsvExport
=
true
;
if
(
this
.
currentConfig
.
allowPrint
===
undefined
)
this
.
currentConfig
.
allowPrint
=
true
;
// Aggregation and Formatting
if
(
!
this
.
currentConfig
.
aggregationType
)
this
.
currentConfig
.
aggregationType
=
'sum'
;
if
(
!
this
.
currentConfig
.
numberFormat
)
this
.
currentConfig
.
numberFormat
=
'N'
;
// Style Configuration
if
(
!
this
.
currentConfig
.
backgroundColor
)
this
.
currentConfig
.
backgroundColor
=
'#FFFFFF'
;
if
(
!
this
.
currentConfig
.
textColor
)
this
.
currentConfig
.
textColor
=
'#374151'
;
if
(
!
this
.
currentConfig
.
headerBackgroundColor
)
this
.
currentConfig
.
headerBackgroundColor
=
'#F9FAFB'
;
if
(
!
this
.
currentConfig
.
headerTextColor
)
this
.
currentConfig
.
headerTextColor
=
'#374151'
;
if
(
!
this
.
currentConfig
.
borderColor
)
this
.
currentConfig
.
borderColor
=
'#E5E7EB'
;
if
(
!
this
.
currentConfig
.
borderRadius
)
this
.
currentConfig
.
borderRadius
=
8
;
// Data Configuration
if
(
!
this
.
currentConfig
.
refreshInterval
)
this
.
currentConfig
.
refreshInterval
=
0
;
if
(
!
this
.
currentConfig
.
cacheDuration
)
this
.
currentConfig
.
cacheDuration
=
300
;
if
(
this
.
currentConfig
.
enableVirtualization
===
undefined
)
this
.
currentConfig
.
enableVirtualization
=
false
;
if
(
this
.
currentConfig
.
enableLazyLoad
===
undefined
)
this
.
currentConfig
.
enableLazyLoad
=
false
;
if
(
!
this
.
currentConfig
.
dataTransform
)
this
.
currentConfig
.
dataTransform
=
''
;
// Initialize arrays
if
(
!
this
.
currentConfig
.
rows
)
this
.
currentConfig
.
rows
=
[];
if
(
!
this
.
currentConfig
.
rows
)
this
.
currentConfig
.
rows
=
[];
if
(
!
this
.
currentConfig
.
columns
)
this
.
currentConfig
.
columns
=
[];
if
(
!
this
.
currentConfig
.
columns
)
this
.
currentConfig
.
columns
=
[];
if
(
!
this
.
currentConfig
.
values
)
this
.
currentConfig
.
values
=
[];
if
(
!
this
.
currentConfig
.
values
)
this
.
currentConfig
.
values
=
[];
if
(
!
this
.
currentConfig
.
filters
)
this
.
currentConfig
.
filters
=
[];
if
(
!
this
.
currentConfig
.
filters
)
this
.
currentConfig
.
filters
=
[];
if
(
!
this
.
currentConfig
.
displayOptionView
)
this
.
currentConfig
.
displayOptionView
=
'Both'
;
}
if
(
this
.
currentConfig
.
showToolbar
===
undefined
)
this
.
currentConfig
.
showToolbar
=
true
;
if
(
!
this
.
currentConfig
.
chartType
)
this
.
currentConfig
.
chartType
=
'Column'
;
private
initializeColorDefaults
()
{
if
(
!
this
.
currentConfig
.
backgroundColor
)
this
.
currentConfig
.
backgroundColor
=
'#FFFFFF'
;
if
(
!
this
.
currentConfig
.
textColor
)
this
.
currentConfig
.
textColor
=
'#374151'
;
if
(
!
this
.
currentConfig
.
headerBackgroundColor
)
this
.
currentConfig
.
headerBackgroundColor
=
'#F9FAFB'
;
if
(
!
this
.
currentConfig
.
headerTextColor
)
this
.
currentConfig
.
headerTextColor
=
'#374151'
;
if
(
!
this
.
currentConfig
.
borderColor
)
this
.
currentConfig
.
borderColor
=
'#E5E7EB'
;
}
}
addPivotRow
()
{
addPivotRow
()
{
this
.
currentConfig
.
rows
.
push
({
name
:
''
});
this
.
addArrayItem
(
'rows'
,
{
name
:
''
,
caption
:
''
,
visible
:
true
,
expanded
:
false
});
this
.
configChange
.
emit
(
this
.
currentConfig
);
}
}
removePivotRow
(
index
:
number
)
{
removePivotRow
(
index
:
number
)
{
this
.
currentConfig
.
rows
.
splice
(
index
,
1
);
this
.
removeArrayItem
(
'rows'
,
index
);
this
.
configChange
.
emit
(
this
.
currentConfig
);
}
}
addPivotColumn
()
{
addPivotColumn
()
{
this
.
currentConfig
.
columns
.
push
({
name
:
''
});
this
.
addArrayItem
(
'columns'
,
{
name
:
''
,
caption
:
''
,
visible
:
true
,
expanded
:
false
});
this
.
configChange
.
emit
(
this
.
currentConfig
);
}
}
removePivotColumn
(
index
:
number
)
{
removePivotColumn
(
index
:
number
)
{
this
.
currentConfig
.
columns
.
splice
(
index
,
1
);
this
.
removeArrayItem
(
'columns'
,
index
);
this
.
configChange
.
emit
(
this
.
currentConfig
);
}
}
addPivotValue
()
{
addPivotValue
()
{
this
.
currentConfig
.
values
.
push
({
name
:
''
,
caption
:
''
});
this
.
addArrayItem
(
'values'
,
{
name
:
''
,
caption
:
''
,
aggregation
:
'sum'
,
visible
:
true
,
showSubTotals
:
true
});
this
.
configChange
.
emit
(
this
.
currentConfig
);
}
}
removePivotValue
(
index
:
number
)
{
removePivotValue
(
index
:
number
)
{
this
.
currentConfig
.
values
.
splice
(
index
,
1
);
this
.
removeArrayItem
(
'values'
,
index
);
this
.
configChange
.
emit
(
this
.
currentConfig
);
}
}
addPivotFilter
()
{
addPivotFilter
()
{
this
.
currentConfig
.
filters
.
push
({
name
:
''
});
this
.
addArrayItem
(
'filters'
,
{
name
:
''
,
type
:
'exclude'
,
visible
:
true
});
this
.
configChange
.
emit
(
this
.
currentConfig
);
}
}
removePivotFilter
(
index
:
number
)
{
removePivotFilter
(
index
:
number
)
{
this
.
currentConfig
.
filters
.
splice
(
index
,
1
);
this
.
removeArrayItem
(
'filters'
,
index
);
this
.
configChange
.
emit
(
this
.
currentConfig
);
}
}
}
}
src/app/portal-manage/dashboard-management/widgets/syncfusion-datagrid-widget/syncfusion-datagrid-widget.component.ts
View file @
5cca44a4
...
@@ -135,12 +135,7 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
...
@@ -135,12 +135,7 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
public
cacheDuration
:
number
=
300
;
public
cacheDuration
:
number
=
300
;
public
dataTransform
:
string
=
''
;
public
dataTransform
:
string
=
''
;
// Security properties
// Security properties (moved to new configuration section)
public
requireAuth
:
boolean
=
false
;
public
allowedRoles
:
string
=
''
;
public
dataEncryption
:
boolean
=
false
;
public
auditLog
:
boolean
=
false
;
public
rateLimit
:
number
=
0
;
// Grid-specific properties
// Grid-specific properties
public
enablePaging
:
boolean
=
true
;
public
enablePaging
:
boolean
=
true
;
...
@@ -164,6 +159,47 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
...
@@ -164,6 +159,47 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
public
selectedRowColor
:
string
=
'#DBEAFE'
;
public
selectedRowColor
:
string
=
'#DBEAFE'
;
public
hoverRowColor
:
string
=
'#F3F4F6'
;
public
hoverRowColor
:
string
=
'#F3F4F6'
;
// New configuration properties from SyncfusionDatagridConfigComponent
public
allowPaging
:
boolean
=
true
;
public
allowPageSize
:
boolean
=
true
;
public
showPageInfo
:
boolean
=
true
;
public
allowPageNavigation
:
boolean
=
true
;
public
allowSorting
:
boolean
=
true
;
public
allowAdvancedFiltering
:
boolean
=
false
;
public
allowGrouping
:
boolean
=
false
;
public
allowResizing
:
boolean
=
true
;
public
allowSearching
:
boolean
=
false
;
public
allowSelection
:
boolean
=
false
;
public
allowMultiSelection
:
boolean
=
false
;
public
allowEditing
:
boolean
=
false
;
public
allowAdding
:
boolean
=
false
;
public
selectionMode
:
string
=
'none'
;
public
editMode
:
string
=
'none'
;
public
dataSourceType
:
string
=
'local'
;
public
enableVirtualization
:
boolean
=
false
;
public
enableInfiniteScroll
:
boolean
=
false
;
public
enableLazyLoad
:
boolean
=
false
;
public
rowHeight
:
number
=
40
;
public
headerRowHeight
:
number
=
40
;
public
showAlternateRows
:
boolean
=
false
;
public
allowRowSelection
:
boolean
=
false
;
public
showFilterBar
:
boolean
=
false
;
public
filterType
:
string
=
'menu'
;
public
filterBarHeight
:
number
=
40
;
public
showAggregate
:
boolean
=
false
;
public
aggregateColumns
:
any
[]
=
[];
public
exportFormats
:
string
[]
=
[
'excel'
];
public
exportFilename
:
string
=
'data-export'
;
public
includeHeaders
:
boolean
=
true
;
public
includeFilters
:
boolean
=
false
;
public
requireAuth
:
boolean
=
false
;
public
allowedRoles
:
string
=
''
;
public
permissionLevel
:
string
=
'read'
;
public
dataEncryption
:
boolean
=
false
;
public
auditLog
:
boolean
=
false
;
public
rateLimit
:
number
=
0
;
public
sessionTimeout
:
number
=
30
;
constructor
(
constructor
(
protected
override
dashboardStateService
:
DashboardStateService
,
protected
override
dashboardStateService
:
DashboardStateService
,
private
widgetStateService
:
WidgetStateService
// Inject WidgetStateService
private
widgetStateService
:
WidgetStateService
// Inject WidgetStateService
...
@@ -306,6 +342,50 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
...
@@ -306,6 +342,50 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
this
.
selectedRowColor
=
this
.
configObj
.
selectedRowColor
||
'#DBEAFE'
;
this
.
selectedRowColor
=
this
.
configObj
.
selectedRowColor
||
'#DBEAFE'
;
this
.
hoverRowColor
=
this
.
configObj
.
hoverRowColor
||
'#F3F4F6'
;
this
.
hoverRowColor
=
this
.
configObj
.
hoverRowColor
||
'#F3F4F6'
;
// New configuration properties
this
.
allowPaging
=
this
.
configObj
.
allowPaging
!==
undefined
?
this
.
configObj
.
allowPaging
:
true
;
this
.
allowPageSize
=
this
.
configObj
.
allowPageSize
!==
undefined
?
this
.
configObj
.
allowPageSize
:
true
;
this
.
showPageInfo
=
this
.
configObj
.
showPageInfo
!==
undefined
?
this
.
configObj
.
showPageInfo
:
true
;
this
.
allowPageNavigation
=
this
.
configObj
.
allowPageNavigation
!==
undefined
?
this
.
configObj
.
allowPageNavigation
:
true
;
this
.
allowSorting
=
this
.
configObj
.
allowSorting
!==
undefined
?
this
.
configObj
.
allowSorting
:
true
;
this
.
allowMultiSorting
=
this
.
configObj
.
allowMultiSorting
!==
undefined
?
this
.
configObj
.
allowMultiSorting
:
false
;
this
.
allowAdvancedFiltering
=
this
.
configObj
.
allowAdvancedFiltering
!==
undefined
?
this
.
configObj
.
allowAdvancedFiltering
:
false
;
this
.
allowGrouping
=
this
.
configObj
.
allowGrouping
!==
undefined
?
this
.
configObj
.
allowGrouping
:
false
;
this
.
allowReordering
=
this
.
configObj
.
allowReordering
!==
undefined
?
this
.
configObj
.
allowReordering
:
true
;
this
.
allowResizing
=
this
.
configObj
.
allowResizing
!==
undefined
?
this
.
configObj
.
allowResizing
:
true
;
this
.
allowSearching
=
this
.
configObj
.
allowSearching
!==
undefined
?
this
.
configObj
.
allowSearching
:
false
;
this
.
allowSelection
=
this
.
configObj
.
allowSelection
!==
undefined
?
this
.
configObj
.
allowSelection
:
false
;
this
.
allowMultiSelection
=
this
.
configObj
.
allowMultiSelection
!==
undefined
?
this
.
configObj
.
allowMultiSelection
:
false
;
this
.
allowEditing
=
this
.
configObj
.
allowEditing
!==
undefined
?
this
.
configObj
.
allowEditing
:
false
;
this
.
allowAdding
=
this
.
configObj
.
allowAdding
!==
undefined
?
this
.
configObj
.
allowAdding
:
false
;
this
.
selectionMode
=
this
.
configObj
.
selectionMode
||
'none'
;
this
.
editMode
=
this
.
configObj
.
editMode
||
'none'
;
this
.
dataSourceType
=
this
.
configObj
.
dataSourceType
||
'local'
;
this
.
enableVirtualization
=
this
.
configObj
.
enableVirtualization
!==
undefined
?
this
.
configObj
.
enableVirtualization
:
false
;
this
.
enableInfiniteScroll
=
this
.
configObj
.
enableInfiniteScroll
!==
undefined
?
this
.
configObj
.
enableInfiniteScroll
:
false
;
this
.
enableLazyLoad
=
this
.
configObj
.
enableLazyLoad
!==
undefined
?
this
.
configObj
.
enableLazyLoad
:
false
;
this
.
errorMessage
=
this
.
configObj
.
errorMessage
||
'Failed to load data'
;
this
.
rowHeight
=
this
.
configObj
.
rowHeight
||
40
;
this
.
headerRowHeight
=
this
.
configObj
.
headerRowHeight
||
40
;
this
.
showAlternateRows
=
this
.
configObj
.
showAlternateRows
!==
undefined
?
this
.
configObj
.
showAlternateRows
:
false
;
this
.
allowRowSelection
=
this
.
configObj
.
allowRowSelection
!==
undefined
?
this
.
configObj
.
allowRowSelection
:
false
;
this
.
showFilterBar
=
this
.
configObj
.
showFilterBar
!==
undefined
?
this
.
configObj
.
showFilterBar
:
false
;
this
.
filterType
=
this
.
configObj
.
filterType
||
'menu'
;
this
.
filterBarHeight
=
this
.
configObj
.
filterBarHeight
||
40
;
this
.
showAggregate
=
this
.
configObj
.
showAggregate
!==
undefined
?
this
.
configObj
.
showAggregate
:
false
;
this
.
aggregateColumns
=
this
.
configObj
.
aggregateColumns
||
[];
this
.
exportFormats
=
this
.
configObj
.
exportFormats
||
[
'excel'
];
this
.
exportFilename
=
this
.
configObj
.
exportFilename
||
'data-export'
;
this
.
includeHeaders
=
this
.
configObj
.
includeHeaders
!==
undefined
?
this
.
configObj
.
includeHeaders
:
true
;
this
.
includeFilters
=
this
.
configObj
.
includeFilters
!==
undefined
?
this
.
configObj
.
includeFilters
:
false
;
this
.
requireAuth
=
this
.
configObj
.
requireAuth
!==
undefined
?
this
.
configObj
.
requireAuth
:
false
;
this
.
allowedRoles
=
this
.
configObj
.
allowedRoles
||
''
;
this
.
permissionLevel
=
this
.
configObj
.
permissionLevel
||
'read'
;
this
.
dataEncryption
=
this
.
configObj
.
dataEncryption
!==
undefined
?
this
.
configObj
.
dataEncryption
:
false
;
this
.
auditLog
=
this
.
configObj
.
auditLog
!==
undefined
?
this
.
configObj
.
auditLog
:
false
;
this
.
rateLimit
=
this
.
configObj
.
rateLimit
||
0
;
this
.
sessionTimeout
=
this
.
configObj
.
sessionTimeout
||
30
;
// Update page settings with configured page size
// Update page settings with configured page size
this
.
pageSettings
=
{
pageSize
:
this
.
pageSize
,
pageSizes
:
this
.
pageSizes
};
this
.
pageSettings
=
{
pageSize
:
this
.
pageSize
,
pageSizes
:
this
.
pageSizes
};
}
}
...
...
src/app/portal-manage/dashboard-management/widgets/syncfusion-pivot-widget/syncfusion-pivot-widget.component.ts
View file @
5cca44a4
...
@@ -99,26 +99,35 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -99,26 +99,35 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
public
auditLog
:
boolean
=
false
;
public
auditLog
:
boolean
=
false
;
public
rateLimit
:
number
=
0
;
public
rateLimit
:
number
=
0
;
// Pivot-specific properties
// Pivot-specific properties from SyncfusionPivotConfigComponent
public
displayOptionView
:
string
=
'Both'
;
public
chartType
:
string
=
'Column'
;
public
showFieldList
:
boolean
=
true
;
public
showFieldList
:
boolean
=
true
;
public
showToolbar
:
boolean
=
true
;
public
showToolbar
:
boolean
=
true
;
public
showGroupingBar
:
boolean
=
true
;
public
showGroupingBar
:
boolean
=
true
;
public
allowCalculatedField
:
boolean
=
true
;
public
showPager
:
boolean
=
true
;
public
allowConditionalFormatting
:
boolean
=
true
;
public
allowCalculatedField
:
boolean
=
false
;
public
allowConditionalFormatting
:
boolean
=
false
;
public
allowNumberFormatting
:
boolean
=
true
;
public
allowNumberFormatting
:
boolean
=
true
;
public
allowFieldDragDrop
:
boolean
=
true
;
public
allowSubTotal
:
boolean
=
true
;
public
allowSubTotal
:
boolean
=
true
;
public
allowGrandTotal
:
boolean
=
true
;
public
allowGrandTotal
:
boolean
=
true
;
public
allowDrillThrough
:
boolean
=
false
;
public
allowSorting
:
boolean
=
true
;
public
allowExcelExport
:
boolean
=
true
;
public
allowExcelExport
:
boolean
=
true
;
public
allowPdfExport
:
boolean
=
true
;
public
allowPdfExport
:
boolean
=
true
;
public
allowCsvExport
:
boolean
=
true
;
public
allowCsvExport
:
boolean
=
true
;
public
allowPrint
:
boolean
=
true
;
public
aggregationType
:
string
=
'sum'
;
public
numberFormat
:
string
=
'N'
;
public
enableVirtualization
:
boolean
=
false
;
public
enableLazyLoad
:
boolean
=
false
;
// Pivot-specific properties (moved to above section)
public
showChart
:
boolean
=
true
;
public
showChart
:
boolean
=
true
;
public
showGrid
:
boolean
=
true
;
public
showGrid
:
boolean
=
true
;
public
displayOptionView
:
string
=
'Both'
;
public
chartType
:
string
=
'Column'
;
public
enableDrillThrough
:
boolean
=
true
;
public
enableSorting
:
boolean
=
true
;
public
enableFiltering
:
boolean
=
true
;
public
enableGrouping
:
boolean
=
true
;
public
enableGrouping
:
boolean
=
true
;
public
allowFiltering
:
boolean
=
true
;
constructor
(
constructor
(
protected
override
dashboardStateService
:
DashboardStateService
,
protected
override
dashboardStateService
:
DashboardStateService
,
...
@@ -151,6 +160,8 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -151,6 +160,8 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
applyInitialConfig
():
void
{
applyInitialConfig
():
void
{
// Basic configuration
// Basic configuration
this
.
title
=
this
.
configObj
.
title
||
'Pivot Table'
;
this
.
title
=
this
.
configObj
.
title
||
'Pivot Table'
;
this
.
displayOptionView
=
this
.
configObj
.
displayOptionView
||
'Both'
;
this
.
chartType
=
this
.
configObj
.
chartType
||
'Column'
;
this
.
chartSettings
=
this
.
configObj
.
chartSettings
||
{
this
.
chartSettings
=
this
.
configObj
.
chartSettings
||
{
chartSeries
:
{
type
:
this
.
chartType
}
chartSeries
:
{
type
:
this
.
chartType
}
};
};
...
@@ -164,6 +175,26 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -164,6 +175,26 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
chartSettings
:
this
.
chartSettings
,
chartSettings
:
this
.
chartSettings
,
};
};
// Pivot features configuration
this
.
showFieldList
=
this
.
configObj
.
showFieldList
!==
undefined
?
this
.
configObj
.
showFieldList
:
true
;
this
.
showToolbar
=
this
.
configObj
.
showToolbar
!==
undefined
?
this
.
configObj
.
showToolbar
:
true
;
this
.
showGroupingBar
=
this
.
configObj
.
showGroupingBar
!==
undefined
?
this
.
configObj
.
showGroupingBar
:
true
;
this
.
showPager
=
this
.
configObj
.
showPager
!==
undefined
?
this
.
configObj
.
showPager
:
true
;
this
.
allowCalculatedField
=
this
.
configObj
.
allowCalculatedField
!==
undefined
?
this
.
configObj
.
allowCalculatedField
:
false
;
this
.
allowConditionalFormatting
=
this
.
configObj
.
allowConditionalFormatting
!==
undefined
?
this
.
configObj
.
allowConditionalFormatting
:
false
;
this
.
allowNumberFormatting
=
this
.
configObj
.
allowNumberFormatting
!==
undefined
?
this
.
configObj
.
allowNumberFormatting
:
true
;
this
.
allowFieldDragDrop
=
this
.
configObj
.
allowFieldDragDrop
!==
undefined
?
this
.
configObj
.
allowFieldDragDrop
:
true
;
this
.
allowSubTotal
=
this
.
configObj
.
allowSubTotal
!==
undefined
?
this
.
configObj
.
allowSubTotal
:
true
;
this
.
allowGrandTotal
=
this
.
configObj
.
allowGrandTotal
!==
undefined
?
this
.
configObj
.
allowGrandTotal
:
true
;
this
.
allowDrillThrough
=
this
.
configObj
.
allowDrillThrough
!==
undefined
?
this
.
configObj
.
allowDrillThrough
:
false
;
this
.
allowSorting
=
this
.
configObj
.
allowSorting
!==
undefined
?
this
.
configObj
.
allowSorting
:
true
;
this
.
allowExcelExport
=
this
.
configObj
.
allowExcelExport
!==
undefined
?
this
.
configObj
.
allowExcelExport
:
true
;
this
.
allowPdfExport
=
this
.
configObj
.
allowPdfExport
!==
undefined
?
this
.
configObj
.
allowPdfExport
:
true
;
this
.
allowCsvExport
=
this
.
configObj
.
allowCsvExport
!==
undefined
?
this
.
configObj
.
allowCsvExport
:
true
;
this
.
allowPrint
=
this
.
configObj
.
allowPrint
!==
undefined
?
this
.
configObj
.
allowPrint
:
true
;
this
.
aggregationType
=
this
.
configObj
.
aggregationType
||
'sum'
;
this
.
numberFormat
=
this
.
configObj
.
numberFormat
||
'N'
;
// Style configuration
// Style configuration
this
.
backgroundColor
=
this
.
configObj
.
backgroundColor
||
'#FFFFFF'
;
this
.
backgroundColor
=
this
.
configObj
.
backgroundColor
||
'#FFFFFF'
;
this
.
borderColor
=
this
.
configObj
.
borderColor
||
'#E5E7EB'
;
this
.
borderColor
=
this
.
configObj
.
borderColor
||
'#E5E7EB'
;
...
@@ -238,9 +269,9 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -238,9 +269,9 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
this
.
showGrid
=
this
.
configObj
.
showGrid
!==
undefined
?
this
.
configObj
.
showGrid
:
true
;
this
.
showGrid
=
this
.
configObj
.
showGrid
!==
undefined
?
this
.
configObj
.
showGrid
:
true
;
this
.
displayOptionView
=
this
.
configObj
.
displayOptionView
||
'Both'
;
this
.
displayOptionView
=
this
.
configObj
.
displayOptionView
||
'Both'
;
this
.
chartType
=
this
.
configObj
.
chartType
||
'Column'
;
this
.
chartType
=
this
.
configObj
.
chartType
||
'Column'
;
this
.
enableDrillThrough
=
this
.
configObj
.
enableDrillThrough
!==
undefined
?
this
.
configObj
.
enable
DrillThrough
:
true
;
this
.
allowDrillThrough
=
this
.
configObj
.
allowDrillThrough
!==
undefined
?
this
.
configObj
.
allow
DrillThrough
:
true
;
this
.
enableSorting
=
this
.
configObj
.
enableSorting
!==
undefined
?
this
.
configObj
.
enable
Sorting
:
true
;
this
.
allowSorting
=
this
.
configObj
.
allowSorting
!==
undefined
?
this
.
configObj
.
allow
Sorting
:
true
;
this
.
enableFiltering
=
this
.
configObj
.
enableFiltering
!==
undefined
?
this
.
configObj
.
enable
Filtering
:
true
;
this
.
allowFiltering
=
this
.
configObj
.
allowFiltering
!==
undefined
?
this
.
configObj
.
allow
Filtering
:
true
;
this
.
enableGrouping
=
this
.
configObj
.
enableGrouping
!==
undefined
?
this
.
configObj
.
enableGrouping
:
true
;
this
.
enableGrouping
=
this
.
configObj
.
enableGrouping
!==
undefined
?
this
.
configObj
.
enableGrouping
:
true
;
// Update toolbar and display options based on configuration
// Update toolbar and display options based on configuration
...
@@ -400,9 +431,9 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -400,9 +431,9 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
this
.
showGrid
=
true
;
this
.
showGrid
=
true
;
this
.
displayOptionView
=
'Both'
;
this
.
displayOptionView
=
'Both'
;
this
.
chartType
=
'Column'
;
this
.
chartType
=
'Column'
;
this
.
enable
DrillThrough
=
true
;
this
.
allow
DrillThrough
=
true
;
this
.
enable
Sorting
=
true
;
this
.
allow
Sorting
=
true
;
this
.
enable
Filtering
=
true
;
this
.
allow
Filtering
=
true
;
this
.
enableGrouping
=
true
;
this
.
enableGrouping
=
true
;
// Update toolbar and display options
// Update toolbar and display options
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment