ng-prime-tools 1.0.77 → 1.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ng-prime-tools.mjs +315 -136
- package/fesm2022/ng-prime-tools.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ng-prime-tools.d.ts +148 -96
- package/types/ng-prime-tools.d.ts.map +1 -1
|
@@ -190,6 +190,7 @@ class PTAdvancedPrimeTableComponent {
|
|
|
190
190
|
this.selectionDataKey = 'id';
|
|
191
191
|
this.selectionMode = null;
|
|
192
192
|
this.selection = null;
|
|
193
|
+
this.cellHeight = null;
|
|
193
194
|
this.selectionChange = new EventEmitter();
|
|
194
195
|
this.rowSelect = new EventEmitter();
|
|
195
196
|
this.rowUnselect = new EventEmitter();
|
|
@@ -998,16 +999,6 @@ class PTAdvancedPrimeTableComponent {
|
|
|
998
999
|
return false;
|
|
999
1000
|
return typeof d === 'function' ? !!d(row) : !!d;
|
|
1000
1001
|
}
|
|
1001
|
-
getCellStyle(col, row) {
|
|
1002
|
-
const extendedCol = col;
|
|
1003
|
-
const styleConfig = extendedCol?.cellStyle;
|
|
1004
|
-
if (!styleConfig) {
|
|
1005
|
-
return {};
|
|
1006
|
-
}
|
|
1007
|
-
return typeof styleConfig === 'function'
|
|
1008
|
-
? (styleConfig(row) ?? {})
|
|
1009
|
-
: styleConfig;
|
|
1010
|
-
}
|
|
1011
1002
|
getComposedCellStyle(col, composedName, row) {
|
|
1012
1003
|
const extendedCol = col;
|
|
1013
1004
|
const styleConfig = extendedCol?.composedCellStyles?.[composedName];
|
|
@@ -1126,12 +1117,72 @@ class PTAdvancedPrimeTableComponent {
|
|
|
1126
1117
|
}
|
|
1127
1118
|
return [value];
|
|
1128
1119
|
}
|
|
1120
|
+
getCellHeight() {
|
|
1121
|
+
return this.cellHeight?.trim() || null;
|
|
1122
|
+
}
|
|
1123
|
+
getColumnCellPadding(col) {
|
|
1124
|
+
return col.cellPadding?.trim() || '0px';
|
|
1125
|
+
}
|
|
1126
|
+
getColumnCellMargin(col) {
|
|
1127
|
+
return col.cellMargin?.trim() || '0px';
|
|
1128
|
+
}
|
|
1129
|
+
getCellInnerStyle(col, defaultMargin = '0px') {
|
|
1130
|
+
return {
|
|
1131
|
+
margin: col.cellMargin?.trim() || defaultMargin,
|
|
1132
|
+
minHeight: '0',
|
|
1133
|
+
boxSizing: 'border-box',
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
getCellStyle(col, row) {
|
|
1137
|
+
const styles = {};
|
|
1138
|
+
if (col.cellStyle) {
|
|
1139
|
+
const customStyle = typeof col.cellStyle === 'function'
|
|
1140
|
+
? col.cellStyle(row)
|
|
1141
|
+
: col.cellStyle;
|
|
1142
|
+
Object.assign(styles, customStyle);
|
|
1143
|
+
}
|
|
1144
|
+
const height = this.getCellHeight();
|
|
1145
|
+
if (height) {
|
|
1146
|
+
styles['height'] = height;
|
|
1147
|
+
styles['max-height'] = height;
|
|
1148
|
+
styles['line-height'] = height;
|
|
1149
|
+
}
|
|
1150
|
+
styles['padding'] = this.getColumnCellPadding(col);
|
|
1151
|
+
styles['box-sizing'] = 'border-box';
|
|
1152
|
+
return styles;
|
|
1153
|
+
}
|
|
1154
|
+
getHeaderCellStyle(col) {
|
|
1155
|
+
const styles = {
|
|
1156
|
+
padding: this.getColumnCellPadding(col),
|
|
1157
|
+
boxSizing: 'border-box',
|
|
1158
|
+
};
|
|
1159
|
+
const height = this.getCellHeight();
|
|
1160
|
+
if (height) {
|
|
1161
|
+
styles['height'] = height;
|
|
1162
|
+
styles['max-height'] = height;
|
|
1163
|
+
styles['line-height'] = height;
|
|
1164
|
+
}
|
|
1165
|
+
return styles;
|
|
1166
|
+
}
|
|
1167
|
+
getStaticCellStyle() {
|
|
1168
|
+
const styles = {
|
|
1169
|
+
padding: '0px',
|
|
1170
|
+
boxSizing: 'border-box',
|
|
1171
|
+
};
|
|
1172
|
+
const height = this.getCellHeight();
|
|
1173
|
+
if (height) {
|
|
1174
|
+
styles['height'] = height;
|
|
1175
|
+
styles['max-height'] = height;
|
|
1176
|
+
styles['line-height'] = height;
|
|
1177
|
+
}
|
|
1178
|
+
return styles;
|
|
1179
|
+
}
|
|
1129
1180
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTAdvancedPrimeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1130
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTAdvancedPrimeTableComponent, isStandalone: false, selector: "pt-advanced-prime-table", inputs: { data: "data", columns: "columns", totalRecords: "totalRecords", rowsPerPage: "rowsPerPage", hasSearchFilter: "hasSearchFilter", hasExportExcel: "hasExportExcel", hasExportPDF: "hasExportPDF", hasColumnFilter: "hasColumnFilter", isPaginated: "isPaginated", isLazy: "isLazy", actions: "actions", isSortable: "isSortable", loading: "loading", maxHeight: "maxHeight", isRowReorderable: "isRowReorderable", rowReorderIdField: "rowReorderIdField", rowOrderStartAt: "rowOrderStartAt", selectionDataKey: "selectionDataKey", selectionMode: "selectionMode", selection: "selection" }, outputs: { selectionChange: "selectionChange", rowSelect: "rowSelect", rowUnselect: "rowUnselect", lazyLoad: "lazyLoad", search: "search", exportExcelEvent: "exportExcelEvent", exportPdfEvent: "exportPdfEvent", onPageChange: "onPageChange", onSortColumn: "onSortColumn", onFilterColumn: "onFilterColumn", rowReorderChange: "rowReorderChange" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"pt-advanced-prime-table table-container\">\n <p-table\n #dt\n [value]=\"data\"\n [loading]=\"loading\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n [totalRecords]=\"totalRecords\"\n [lazy]=\"isLazy\"\n [filterDelay]=\"0\"\n [dataKey]=\"selectionDataKey || rowReorderIdField || 'id'\"\n styleClass=\"p-datatable-gridlines p-datatable-striped\"\n [scrollable]=\"true\"\n [scrollHeight]=\"maxHeight !== null ? maxHeight : undefined\"\n (onRowReorder)=\"onRowReorder($event)\"\n (onPage)=\"changePage($event)\"\n (onSort)=\"sortColumn($event)\"\n (onFilter)=\"filterColumn($event)\"\n [selectionMode]=\"selectionMode\"\n [(selection)]=\"selection\"\n (selectionChange)=\"selectionChange.emit($event)\"\n (onRowSelect)=\"rowSelect.emit($event.data)\"\n (onRowUnselect)=\"rowUnselect.emit($event.data)\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n @if (canUseRowReorder()) {\n <col style=\"width: 3rem\" />\n }\n @for (col of columns; track col) {\n <col\n [style.width]=\"col.width || getHeaderWidth(col)\"\n />\n }\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n @if (hasSearchFilter) {\n <button\n pButton\n icon=\"pi pi-filter-slash\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"clear(dt)\"\n title=\"Clear filters\"\n ></button>\n }\n\n @if (hasExportExcel) {\n <button\n pButton\n icon=\"pi pi-file-excel\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportExcel()\"\n title=\"Export to Excel\"\n ></button>\n }\n\n @if (hasExportPDF) {\n <button\n pButton\n icon=\"pi pi-file-pdf\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportPdf()\"\n title=\"Export to PDF\"\n ></button>\n }\n </div>\n\n @if (hasSearchFilter) {\n <div class=\"ml-auto\">\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n }\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr class=\"sticky-header\">\n @if (canUseRowReorder()) {\n <th style=\"width: 3rem\"></th>\n }\n\n @for (col of columns; track col) {\n @if (!col.children) {\n <th\n [pSortableColumn]=\"col.code\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [style.padding]=\"'0px'\"\n [ngClass]=\"[\n getHeaderAlignClass(col),\n col.type === TableTypeEnum.ACTION ? 'action-column' : '',\n ]\"\n colspan=\"1\"\n >\n @if (isSortable && col.isSortable !== false) {\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [style.padding]=\"'0px'\"\n [style.margin]=\"'10px'\"\n >\n <span [ngClass]=\"getHeaderTitleClass(col)\">\n {{ col.title }}\n </span>\n <div\n class=\"icons d-flex align-items-center\"\n [style.width]=\"'77px'\"\n >\n <p-sortIcon [field]=\"col.code\" />\n @if (hasColumnFilter && col.isFilter !== false) {\n @if (col.type === TableTypeEnum.COMPOSED) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n type=\"text\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"false\"\n [showOperator]=\"false\"\n (onClear)=\"onComposedColumnClear(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n >\n @for (composedName of col.composedNames; track composedName) {\n <div>\n @if (\n getComposedFieldType(col, composedName) ===\n TableTypeEnum.STRING\n ) {\n <p-multiSelect\n [options]=\"filters[composedName]?.options\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"filters[composedName]?.value ?? []\"\n (ngModelChange)=\"\n onComposedFilterValueChange(\n col,\n composedName,\n $event\n );\n filter($event ?? [])\n \"\n [placeholder]=\"filters[composedName]?.placeholder\"\n display=\"chip\"\n >\n <ng-template let-item pTemplate=\"item\">\n <div class=\"custom-multiselect-item\">\n @if (item.image) {\n <img\n [src]=\"item.image\"\n alt=\"icon\"\n class=\"filter-image\"\n />\n }\n <span>{{ item.label }}</span>\n </div>\n </ng-template>\n </p-multiSelect>\n }\n </div>\n }\n </ng-template>\n </p-columnFilter>\n }\n @if (col.type !== TableTypeEnum.COMPOSED) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"col.type !== TableTypeEnum.MULTISELECT\"\n [showOperator]=\"col.type !== TableTypeEnum.MULTISELECT\"\n [matchMode]=\"\n col.type === TableTypeEnum.MULTISELECT\n ? 'in'\n : undefined\n \"\n (onClear)=\"onFilterClear(col.code!)\"\n >\n @if (\n col.type === TableTypeEnum.NUMBER ||\n col.type === TableTypeEnum.AMOUNT\n ; as value) {\n <ng-template\n pTemplate=\"filter\"\n let-value\n >\n <input\n pInputText\n type=\"text\"\n inputmode=\"decimal\"\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onNumberFilterChange(col.code!, $event)\n \"\n placeholder=\"Enter a number\"\n />\n </ng-template>\n }\n <ng-template\n pTemplate=\"filter\"\n *ngIf=\"col.type === TableTypeEnum.DATE\"\n let-filter=\"filterCallback\"\n let-value\n >\n <p-datepicker\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event)\n \"\n dateFormat=\"dd/mm/yy\"\n placeholder=\"Choose a date\"\n ></p-datepicker>\n </ng-template>\n <ng-template\n pTemplate=\"filter\"\n *ngIf=\"\n col.type === TableTypeEnum.MULTISELECT &&\n col.filterOptions &&\n col.filterOptions.length > 0\n \"\n let-filter=\"filterCallback\"\n let-value\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"\n latestFilterValues[col.code!] ?? value ?? []\n \"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event ?? [])\n \"\n display=\"chip\"\n placeholder=\"Choose option\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n }\n }\n </div>\n </div>\n } @else {\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [style.padding]=\"'0px'\"\n [style.margin]=\"'10px'\"\n >\n <span [ngClass]=\"getHeaderTitleClass(col)\">\n {{ col.title }}\n </span>\n @if (hasColumnFilter && col.isFilter !== false) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"\n getColumnFilterType(col) !== 'multiSelect'\n \"\n [showOperator]=\"getColumnFilterType(col) !== 'multiSelect'\"\n [matchMode]=\"\n getColumnFilterType(col) === 'multiSelect'\n ? 'in'\n : undefined\n \"\n (onClear)=\"onFilterClear(col.code!)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n let-value\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-datepicker\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event)\n \"\n dateFormat=\"dd/mm/yy\"\n ></p-datepicker>\n </ng-template>\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n let-value\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"latestFilterValues[col.code!] ?? value ?? []\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event ?? [])\n \"\n display=\"chip\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n }\n </div>\n }\n </th>\n } @else {\n <th\n [attr.colspan]=\"col.children?.length\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"getHeaderAlignClass(col)\"\n >\n <span>{{ col.title }}</span>\n </th>\n }\n }\n </tr>\n\n @if (hasGroupedColumns) {\n <tr>\n @if (canUseRowReorder()) {\n <th style=\"width: 3rem\"></th>\n }\n @for (col of columns; track col) {\n @if (col.children) {\n @for (child of col.children; track child) {\n <th\n [style.width]=\"child.width || getHeaderWidth(child)\"\n [style.padding]=\"'0px'\"\n ></th>\n }\n }\n }\n </tr>\n }\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr class=\"p-datatable-emptymessage\">\n <td\n class=\"empty-message-cell\"\n [attr.colspan]=\"columns.length + (canUseRowReorder() ? 1 : 0)\"\n >\n <div class=\"empty-message-wrapper\">\n <div class=\"empty-message\">\n <i class=\"pi pi-info-circle\"></i>\n <p>No records available to display.</p>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n @if (!loading) {\n <tr\n [pEditableRow]=\"isEdit ? data : null\"\n [pReorderableRow]=\"canUseRowReorder() ? ri : null\"\n [pSelectableRow]=\"selectionMode ? data : null\"\n >\n @if (canUseRowReorder()) {\n <td style=\"width: 3rem; text-align: center\">\n <span\n pReorderableRowHandle\n style=\"cursor: move; display: inline-flex; align-items: center\"\n title=\"D\u00E9placer la ligne\"\n >\n <i class=\"pi pi-bars\"></i>\n </span>\n </td>\n }\n @for (col of columns; track col) {\n @if (!col.children) {\n @if (\n isEditable(col.code!) && col.type !== TableTypeEnum.ACTION) {\n <td\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"getDataAlignClass(col)\"\n [ngStyle]=\"getCellStyle(col, data)\"\n >\n <div [ngClass]=\"getCellInnerAlignClass(col)\">\n @if (isMultiSelect(col.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code!]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n @for (\n rec of getMultiSelectValues(data[col.code!])\n ; track\n rec) {\n <p-tag [value]=\"rec\"></p-tag>\n }\n </div>\n </ng-template>\n </p-cellEditor>\n } @else {\n @if (isDatePicker(col.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-datepicker\n [inputId]=\"data[col.code!]\"\n [ngModel]=\"data[col.code!]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-datepicker>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ data[col.code!] | customDate }}\n </ng-template>\n </p-cellEditor>\n } @else {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code!]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n @if (\n col.type === TableTypeEnum.AMOUNT) {\n {{\n data[col.code!]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n } @else {\n {{ data[col.code!] }}\n }\n </ng-template>\n </p-cellEditor>\n }\n }\n </div>\n </td>\n } @else {\n <td\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"[\n getDataAlignClass(col),\n col.type === TableTypeEnum.ACTION ? 'action-column' : '',\n ]\"\n [ngStyle]=\"getCellStyle(col, data)\"\n >\n @if (col.type === TableTypeEnum.ACTION) {\n <div class=\"action-buttons-container\">\n @if (isDelete) {\n <button\n pButton\n pRipple\n pTooltip=\"Supprimer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n @if (isEdit) {\n <div>\n @if (!editing) {\n <button\n pInitEditableRow\n pButton\n pRipple\n pTooltip=\"Modifier\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n @if (editing) {\n <button\n pSaveEditableRow\n pButton\n pRipple\n pTooltip=\"Enregistrer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n @if (editing) {\n <button\n pCancelEditableRow\n pButton\n pRipple\n pTooltip=\"Annuler\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n </div>\n }\n @for (act of customActions; track act) {\n @if (isActionVisible(act, data)) {\n <button\n pButton\n pRipple\n [pTooltip]=\"act.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n class=\"p-button-rounded p-button-text\"\n [icon]=\"act.icon || 'pi pi-ellipsis-h'\"\n [ngClass]=\"act.styleClass\"\n [disabled]=\"isActionDisabled(act, data)\"\n (click)=\"onCustomActionClick(act, data)\"\n ></button>\n }\n }\n </div>\n } @else {\n <div [ngClass]=\"getCellInnerAlignClass(col)\">\n @if (\n col.type === TableTypeEnum.COMPOSED) {\n <div class=\"composed-cell\">\n @for (\n composedName of col.composedNames; track\n composedName; let i = $index) {\n @if (\n col.composedTypes &&\n col.composedTypes[i] === TableTypeEnum.IMAGE\n ) {\n <img\n [src]=\"data[col.code!]?.[composedName]\"\n alt=\"composed-img\"\n class=\"composed-image\"\n [ngStyle]=\"\n getMergedComposedImageStyle(\n col,\n composedName,\n data\n )\n \"\n />\n }\n @if (\n col.composedTypes &&\n col.composedTypes[i] === TableTypeEnum.STRING\n ) {\n <span\n class=\"composed-text\"\n [ngStyle]=\"\n getMergedComposedTextStyle(\n col,\n composedName,\n data\n )\n \"\n >\n {{ data[col.code!]?.[composedName] }}\n </span>\n }\n }\n </div>\n } @else {\n @if (\n col.type === TableTypeEnum.PROGRESS) {\n <div class=\"progress-cell\">\n <p-progressBar\n [value]=\"getProgressValue(col, data)\"\n [showValue]=\"false\"\n [ngClass]=\"\n 'pt-progress-' + getProgressSeverity(col, data)\n \"\n ></p-progressBar>\n @if (isProgressShowValue(col)) {\n <span\n class=\"progress-cell-value\"\n >\n {{ getProgressValue(col, data)\n }}{{ getProgressUnit(col) }}\n </span>\n }\n </div>\n } @else {\n @if (col.type === TableTypeEnum.TAG) {\n <p-tag\n [value]=\"getTagValue(col, data)\"\n [severity]=\"$any(getTagSeverity(col, data))\"\n [icon]=\"getTagIcon(col, data)\"\n [rounded]=\"isTagRounded(col)\"\n ></p-tag>\n } @else {\n @if (\n col.type === TableTypeEnum.AMOUNT) {\n {{\n data[col.code!]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n } @else {\n @if (\n col.type === TableTypeEnum.NUMBER) {\n {{\n formatNumber(\n data[col.code!],\n col.decimalPlaces,\n col.thousandSeparator,\n col.decimalSeparator\n )\n }}\n } @else {\n @if (\n col.type === TableTypeEnum.DATE ||\n col.type === TableTypeEnum.DATETIME) {\n @if (col.type === TableTypeEnum.DATE) {\n {{\n formatDateWithColumn(\n parseAnyDate(data[col.code!]),\n col\n )\n }}\n }\n @if (col.type === TableTypeEnum.DATETIME) {\n {{\n formatDateTimeWithColumn(\n parseAnyDate(data[col.code!]),\n col\n )\n }}\n }\n } @else {\n @if (\n [\n TableTypeEnum.STRING,\n TableTypeEnum.MULTISELECT,\n ].includes(col.type!)\n ) {\n {{ data[col.code!] }}\n }\n }\n }\n }\n }\n }\n }\n </div>\n }\n </td>\n }\n } @else {\n @for (child of col.children; track child) {\n <td\n [style.width]=\"child.width || getHeaderWidth(child)\"\n [ngClass]=\"getDataAlignClass(child)\"\n [ngStyle]=\"getCellStyle(child, data)\"\n >\n <div [ngClass]=\"getCellInnerAlignClass(child)\">\n @if (isEditable(child.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"child.code ? data[child.code] : null\"\n (change)=\"onChange($event, data.id, child.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ child.code ? data[child.code] : \"\" }}\n </ng-template>\n </p-cellEditor>\n } @else {\n @if (\n child.type === TableTypeEnum.TAG) {\n <p-tag\n [value]=\"getTagValue(child, data)\"\n [severity]=\"$any(getTagSeverity(child, data))\"\n [icon]=\"getTagIcon(child, data)\"\n [rounded]=\"isTagRounded(child)\"\n ></p-tag>\n } @else {\n {{ child.code ? data[child.code] : \"\" }}\n }\n }\n </div>\n </td>\n }\n }\n }\n </tr>\n }\n </ng-template>\n</p-table>\n</div>\n", styles: [".pt-advanced-prime-table .bread-crumb{margin-bottom:15px}.pt-advanced-prime-table .date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.pt-advanced-prime-table .filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.pt-advanced-prime-table .settings{display:flex;gap:1rem}.pt-advanced-prime-table .multi-select-container{display:flex;align-items:center;gap:.3rem}.pt-advanced-prime-table ::ng-deep p-table{min-width:50rem}.pt-advanced-prime-table ::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}.pt-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}.pt-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}.pt-advanced-prime-table ::ng-deep .header-container{display:flex;justify-content:space-between;align-items:center;width:100%}.pt-advanced-prime-table ::ng-deep .header-title-left,.pt-advanced-prime-table ::ng-deep .header-title-center,.pt-advanced-prime-table ::ng-deep .header-title-right{flex:1}.pt-advanced-prime-table ::ng-deep .header-title-left{text-align:left}.pt-advanced-prime-table ::ng-deep .header-title-center{text-align:center}.pt-advanced-prime-table ::ng-deep .header-title-right{text-align:right}.pt-advanced-prime-table ::ng-deep .header-align-left{text-align:left}.pt-advanced-prime-table ::ng-deep .header-align-center{text-align:center}.pt-advanced-prime-table ::ng-deep .header-align-right{text-align:right}.pt-advanced-prime-table ::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.pt-advanced-prime-table .flex{display:flex;justify-content:space-between;align-items:center}.pt-advanced-prime-table .ml-auto{margin-left:auto}.pt-advanced-prime-table ::ng-deep p-inputicon{margin-right:-.8rem;z-index:2;position:relative}.pt-advanced-prime-table ::ng-deep .p-inputtext{padding-left:1.7rem}.pt-advanced-prime-table ::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}.pt-advanced-prime-table ::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.pt-advanced-prime-table .table-row{text-align:center;display:flex;gap:1rem;justify-content:center}.pt-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-excel{font-size:1.25em;color:green}.pt-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-pdf{font-size:1.25em;color:red}.pt-advanced-prime-table .table-container{display:block;width:100%}.pt-advanced-prime-table ::ng-deep .p-datatable-emptymessage>td.empty-message-cell{padding:0!important}.pt-advanced-prime-table .empty-message-wrapper{width:100%;height:100%;min-height:180px;display:flex;align-items:center;justify-content:center}.pt-advanced-prime-table .empty-message{text-align:center;color:#888;font-size:1.2rem}.pt-advanced-prime-table .empty-message i{display:block;font-size:2rem;margin-bottom:.5rem}.pt-advanced-prime-table th{white-space:normal;word-wrap:break-word}.filter-image{width:22px;height:14px;margin-right:5px}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-left{text-align:left!important}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-center{text-align:center!important}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-right{text-align:right!important}.pt-advanced-prime-table .cell-inner-left,.pt-advanced-prime-table .cell-inner-center,.pt-advanced-prime-table .cell-inner-right{width:100%;display:flex;align-items:center}.pt-advanced-prime-table .cell-inner-left{justify-content:flex-start;text-align:left}.pt-advanced-prime-table .cell-inner-center{justify-content:center;text-align:center}.pt-advanced-prime-table .cell-inner-right{justify-content:flex-end;text-align:right}.pt-advanced-prime-table ::ng-deep .p-tag{font-size:.72rem;font-weight:800;padding:.2rem .55rem;line-height:1.2;white-space:nowrap}.pt-advanced-prime-table ::ng-deep .p-tag .p-tag-icon{margin-right:.25rem}.pt-advanced-prime-table .progress-cell{width:100%;min-width:160px;display:flex;align-items:center;gap:.5rem}.pt-advanced-prime-table ::ng-deep .progress-cell .p-progressbar{flex:1;width:100%;min-width:120px;height:.75rem!important;background:#e5e7eb!important;border-radius:999px;overflow:hidden}.pt-advanced-prime-table ::ng-deep .progress-cell .p-progressbar-value{display:block!important;height:100%!important;border-radius:999px}.pt-advanced-prime-table .progress-cell-value{min-width:38px;font-size:.72rem;font-weight:800;color:#334155;text-align:right}.pt-advanced-prime-table ::ng-deep th.action-column,.pt-advanced-prime-table ::ng-deep td.action-column{text-align:center!important;justify-content:center;align-items:center;overflow:hidden;white-space:nowrap;padding:0}.pt-advanced-prime-table ::ng-deep .action-buttons-container{width:100%;display:flex;justify-content:center!important;align-items:center!important;gap:.35rem}.pt-advanced-prime-table ::ng-deep .action-buttons-container .p-button.p-button-rounded.p-button-text{padding:.25rem!important;min-width:22px!important;height:22px!important}.pt-advanced-prime-table ::ng-deep .pt-progress-success .p-progressbar-value{background:#22c55e!important}.pt-advanced-prime-table ::ng-deep .pt-progress-warning .p-progressbar-value{background:#f59e0b!important}.pt-advanced-prime-table ::ng-deep .pt-progress-danger .p-progressbar-value{background:#ef4444!important}.pt-advanced-prime-table ::ng-deep .pt-progress-info .p-progressbar-value{background:#3b82f6!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i1$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i3.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i3.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "component", type: i3.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i3.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "directive", type: i3.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i3.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "directive", type: i3.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i3.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i3.SaveEditableRow, selector: "[pSaveEditableRow]" }, { kind: "directive", type: i3.CancelEditableRow, selector: "[pCancelEditableRow]" }, { kind: "component", type: i3.ColumnFilter, selector: "p-columnFilter, p-column-filter, p-columnfilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "filterOn", "useGrouping", "showButtons", "ariaLabel", "filterButtonProps", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: i7.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i9.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i10.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i11.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "directive", type: i12.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i13.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "pipe", type: CustomCurrencyPipe, name: "customCurrency" }, { kind: "pipe", type: CustomDatePipe, name: "customDate" }] }); }
|
|
1181
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTAdvancedPrimeTableComponent, isStandalone: false, selector: "pt-advanced-prime-table", inputs: { data: "data", columns: "columns", totalRecords: "totalRecords", rowsPerPage: "rowsPerPage", hasSearchFilter: "hasSearchFilter", hasExportExcel: "hasExportExcel", hasExportPDF: "hasExportPDF", hasColumnFilter: "hasColumnFilter", isPaginated: "isPaginated", isLazy: "isLazy", actions: "actions", isSortable: "isSortable", loading: "loading", maxHeight: "maxHeight", isRowReorderable: "isRowReorderable", rowReorderIdField: "rowReorderIdField", rowOrderStartAt: "rowOrderStartAt", selectionDataKey: "selectionDataKey", selectionMode: "selectionMode", selection: "selection", cellHeight: "cellHeight" }, outputs: { selectionChange: "selectionChange", rowSelect: "rowSelect", rowUnselect: "rowUnselect", lazyLoad: "lazyLoad", search: "search", exportExcelEvent: "exportExcelEvent", exportPdfEvent: "exportPdfEvent", onPageChange: "onPageChange", onSortColumn: "onSortColumn", onFilterColumn: "onFilterColumn", rowReorderChange: "rowReorderChange" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"pt-advanced-prime-table table-container\">\n <p-table\n #dt\n [value]=\"data\"\n [loading]=\"loading\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n [totalRecords]=\"totalRecords\"\n [lazy]=\"isLazy\"\n [filterDelay]=\"0\"\n [dataKey]=\"selectionDataKey || rowReorderIdField || 'id'\"\n styleClass=\"p-datatable-gridlines p-datatable-striped\"\n [scrollable]=\"true\"\n [scrollHeight]=\"maxHeight !== null ? maxHeight : undefined\"\n (onRowReorder)=\"onRowReorder($event)\"\n (onPage)=\"changePage($event)\"\n (onSort)=\"sortColumn($event)\"\n (onFilter)=\"filterColumn($event)\"\n [selectionMode]=\"selectionMode\"\n [(selection)]=\"selection\"\n (selectionChange)=\"selectionChange.emit($event)\"\n (onRowSelect)=\"rowSelect.emit($event.data)\"\n (onRowUnselect)=\"rowUnselect.emit($event.data)\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n @if (canUseRowReorder()) {\n <col style=\"width: 3rem\" />\n }\n\n @for (col of columns; track col) {\n <col [style.width]=\"col.width || getHeaderWidth(col)\" />\n }\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n @if (hasSearchFilter) {\n <button\n pButton\n icon=\"pi pi-filter-slash\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"clear(dt)\"\n title=\"Clear filters\"\n ></button>\n }\n\n @if (hasExportExcel) {\n <button\n pButton\n icon=\"pi pi-file-excel\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportExcel()\"\n title=\"Export to Excel\"\n ></button>\n }\n\n @if (hasExportPDF) {\n <button\n pButton\n icon=\"pi pi-file-pdf\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportPdf()\"\n title=\"Export to PDF\"\n ></button>\n }\n </div>\n\n @if (hasSearchFilter) {\n <div class=\"ml-auto\">\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n }\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr class=\"sticky-header\">\n @if (canUseRowReorder()) {\n <th [style.width]=\"'3rem'\" [ngStyle]=\"getStaticCellStyle()\"></th>\n }\n\n @for (col of columns; track col) {\n @if (!col.children) {\n <th\n [pSortableColumn]=\"col.code\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngStyle]=\"getHeaderCellStyle(col)\"\n [ngClass]=\"[\n getHeaderAlignClass(col),\n col.type === TableTypeEnum.ACTION ? 'action-column' : '',\n ]\"\n colspan=\"1\"\n >\n @if (isSortable && col.isSortable !== false) {\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngStyle]=\"getCellInnerStyle(col, '10px')\"\n >\n <span [ngClass]=\"getHeaderTitleClass(col)\">\n {{ col.title }}\n </span>\n\n <div\n class=\"icons d-flex align-items-center\"\n [style.width]=\"'77px'\"\n >\n <p-sortIcon [field]=\"col.code\" />\n\n @if (hasColumnFilter && col.isFilter !== false) {\n @if (col.type === TableTypeEnum.COMPOSED) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n type=\"text\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"false\"\n [showOperator]=\"false\"\n (onClear)=\"onComposedColumnClear(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n >\n @for (\n composedName of col.composedNames;\n track composedName\n ) {\n <div>\n @if (\n getComposedFieldType(col, composedName) ===\n TableTypeEnum.STRING\n ) {\n <p-multiSelect\n [options]=\"filters[composedName]?.options\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"\n filters[composedName]?.value ?? []\n \"\n (ngModelChange)=\"\n onComposedFilterValueChange(\n col,\n composedName,\n $event\n );\n filter($event ?? [])\n \"\n [placeholder]=\"\n filters[composedName]?.placeholder\n \"\n display=\"chip\"\n >\n <ng-template let-item pTemplate=\"item\">\n <div class=\"custom-multiselect-item\">\n @if (item.image) {\n <img\n [src]=\"item.image\"\n alt=\"icon\"\n class=\"filter-image\"\n />\n }\n\n <span>{{ item.label }}</span>\n </div>\n </ng-template>\n </p-multiSelect>\n }\n </div>\n }\n </ng-template>\n </p-columnFilter>\n }\n\n @if (col.type !== TableTypeEnum.COMPOSED) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"\n col.type !== TableTypeEnum.MULTISELECT\n \"\n [showOperator]=\"\n col.type !== TableTypeEnum.MULTISELECT\n \"\n [matchMode]=\"\n col.type === TableTypeEnum.MULTISELECT\n ? 'in'\n : undefined\n \"\n (onClear)=\"onFilterClear(col.code!)\"\n >\n @if (\n col.type === TableTypeEnum.NUMBER ||\n col.type === TableTypeEnum.AMOUNT;\n as value\n ) {\n <ng-template pTemplate=\"filter\" let-value>\n <input\n pInputText\n type=\"text\"\n inputmode=\"decimal\"\n [ngModel]=\"\n latestFilterValues[col.code!] ?? value\n \"\n (ngModelChange)=\"\n onNumberFilterChange(col.code!, $event)\n \"\n placeholder=\"Enter a number\"\n />\n </ng-template>\n }\n\n <ng-template\n pTemplate=\"filter\"\n *ngIf=\"col.type === TableTypeEnum.DATE\"\n let-filter=\"filterCallback\"\n let-value\n >\n <p-datepicker\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event)\n \"\n dateFormat=\"dd/mm/yy\"\n placeholder=\"Choose a date\"\n ></p-datepicker>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n *ngIf=\"\n col.type === TableTypeEnum.MULTISELECT &&\n col.filterOptions &&\n col.filterOptions.length > 0\n \"\n let-filter=\"filterCallback\"\n let-value\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"\n latestFilterValues[col.code!] ?? value ?? []\n \"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event ?? [])\n \"\n display=\"chip\"\n placeholder=\"Choose option\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n }\n }\n </div>\n </div>\n } @else {\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngStyle]=\"getCellInnerStyle(col, '10px')\"\n >\n <span [ngClass]=\"getHeaderTitleClass(col)\">\n {{ col.title }}\n </span>\n\n @if (hasColumnFilter && col.isFilter !== false) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"\n getColumnFilterType(col) !== 'multiSelect'\n \"\n [showOperator]=\"\n getColumnFilterType(col) !== 'multiSelect'\n \"\n [matchMode]=\"\n getColumnFilterType(col) === 'multiSelect'\n ? 'in'\n : undefined\n \"\n (onClear)=\"onFilterClear(col.code!)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n let-value\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-datepicker\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event)\n \"\n dateFormat=\"dd/mm/yy\"\n ></p-datepicker>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n let-value\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"\n latestFilterValues[col.code!] ?? value ?? []\n \"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event ?? [])\n \"\n display=\"chip\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n }\n </div>\n }\n </th>\n } @else {\n <th\n [attr.colspan]=\"col?.children?.length\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngStyle]=\"getHeaderCellStyle(col)\"\n [ngClass]=\"getHeaderAlignClass(col)\"\n >\n <span>{{ col.title }}</span>\n </th>\n }\n }\n </tr>\n\n @if (hasGroupedColumns) {\n <tr>\n @if (canUseRowReorder()) {\n <th [style.width]=\"'3rem'\" [ngStyle]=\"getStaticCellStyle()\"></th>\n }\n\n @for (col of columns; track col) {\n @if (col.children) {\n @for (child of col.children; track child) {\n <th\n [style.width]=\"child.width || getHeaderWidth(child)\"\n [ngStyle]=\"getHeaderCellStyle(child)\"\n ></th>\n }\n }\n }\n </tr>\n }\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr class=\"p-datatable-emptymessage\">\n <td\n class=\"empty-message-cell\"\n [attr.colspan]=\"columns.length + (canUseRowReorder() ? 1 : 0)\"\n >\n <div class=\"empty-message-wrapper\">\n <div class=\"empty-message\">\n <i class=\"pi pi-info-circle\"></i>\n <p>No records available to display.</p>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n @if (!loading) {\n <tr\n [pEditableRow]=\"isEdit ? data : null\"\n [pReorderableRow]=\"canUseRowReorder() ? ri : null\"\n [pSelectableRow]=\"selectionMode ? data : null\"\n >\n @if (canUseRowReorder()) {\n <td\n [style.width]=\"'3rem'\"\n [style.text-align]=\"'center'\"\n [ngStyle]=\"getStaticCellStyle()\"\n >\n <span\n pReorderableRowHandle\n style=\"cursor: move; display: inline-flex; align-items: center\"\n title=\"D\u00E9placer la ligne\"\n >\n <i class=\"pi pi-bars\"></i>\n </span>\n </td>\n }\n\n @for (col of columns; track col) {\n @if (!col.children) {\n @if (isEditable(col.code!) && col.type !== TableTypeEnum.ACTION) {\n <td\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"getDataAlignClass(col)\"\n [ngStyle]=\"getCellStyle(col, data)\"\n >\n <div\n [ngClass]=\"getCellInnerAlignClass(col)\"\n [ngStyle]=\"getCellInnerStyle(col)\"\n >\n @if (isMultiSelect(col.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code!]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n @for (\n rec of getMultiSelectValues(data[col.code!]);\n track rec\n ) {\n <p-tag [value]=\"rec\"></p-tag>\n }\n </div>\n </ng-template>\n </p-cellEditor>\n } @else {\n @if (isDatePicker(col.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-datepicker\n [inputId]=\"data[col.code!]\"\n [ngModel]=\"data[col.code!]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-datepicker>\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n {{ data[col.code!] | customDate }}\n </ng-template>\n </p-cellEditor>\n } @else {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code!]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n @if (col.type === TableTypeEnum.AMOUNT) {\n {{\n data[col.code!]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n } @else {\n {{ data[col.code!] }}\n }\n </ng-template>\n </p-cellEditor>\n }\n }\n </div>\n </td>\n } @else {\n <td\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"[\n getDataAlignClass(col),\n col.type === TableTypeEnum.ACTION ? 'action-column' : '',\n ]\"\n [ngStyle]=\"getCellStyle(col, data)\"\n >\n @if (col.type === TableTypeEnum.ACTION) {\n <div\n class=\"action-buttons-container\"\n [ngStyle]=\"getCellInnerStyle(col)\"\n >\n @if (isDelete) {\n <button\n pButton\n pRipple\n pTooltip=\"Supprimer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n\n @if (isEdit) {\n <div>\n @if (!editing) {\n <button\n pInitEditableRow\n pButton\n pRipple\n pTooltip=\"Modifier\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n\n @if (editing) {\n <button\n pSaveEditableRow\n pButton\n pRipple\n pTooltip=\"Enregistrer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n\n @if (editing) {\n <button\n pCancelEditableRow\n pButton\n pRipple\n pTooltip=\"Annuler\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n </div>\n }\n\n @for (act of customActions; track act) {\n @if (isActionVisible(act, data)) {\n <button\n pButton\n pRipple\n [pTooltip]=\"act.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n class=\"p-button-rounded p-button-text\"\n [icon]=\"act.icon || 'pi pi-ellipsis-h'\"\n [ngClass]=\"act.styleClass\"\n [disabled]=\"isActionDisabled(act, data)\"\n (click)=\"onCustomActionClick(act, data)\"\n ></button>\n }\n }\n </div>\n } @else {\n <div\n [ngClass]=\"getCellInnerAlignClass(col)\"\n [ngStyle]=\"getCellInnerStyle(col)\"\n >\n @if (col.type === TableTypeEnum.COMPOSED) {\n <div class=\"composed-cell\">\n @for (\n composedName of col.composedNames;\n track composedName;\n let i = $index\n ) {\n @if (\n col.composedTypes &&\n col.composedTypes[i] === TableTypeEnum.IMAGE\n ) {\n <img\n [src]=\"data[col.code!]?.[composedName]\"\n alt=\"composed-img\"\n class=\"composed-image\"\n [ngStyle]=\"\n getMergedComposedImageStyle(\n col,\n composedName,\n data\n )\n \"\n />\n }\n\n @if (\n col.composedTypes &&\n col.composedTypes[i] === TableTypeEnum.STRING\n ) {\n <span\n class=\"composed-text\"\n [ngStyle]=\"\n getMergedComposedTextStyle(\n col,\n composedName,\n data\n )\n \"\n >\n {{ data[col.code!]?.[composedName] }}\n </span>\n }\n }\n </div>\n } @else {\n @if (col.type === TableTypeEnum.PROGRESS) {\n <div class=\"progress-cell\">\n <p-progressBar\n [value]=\"getProgressValue(col, data)\"\n [showValue]=\"false\"\n [ngClass]=\"\n 'pt-progress-' + getProgressSeverity(col, data)\n \"\n ></p-progressBar>\n\n @if (isProgressShowValue(col)) {\n <span class=\"progress-cell-value\">\n {{ getProgressValue(col, data)\n }}{{ getProgressUnit(col) }}\n </span>\n }\n </div>\n } @else {\n @if (col.type === TableTypeEnum.TAG) {\n <p-tag\n [value]=\"getTagValue(col, data)\"\n [severity]=\"$any(getTagSeverity(col, data))\"\n [icon]=\"getTagIcon(col, data)\"\n [rounded]=\"isTagRounded(col)\"\n ></p-tag>\n } @else {\n @if (col.type === TableTypeEnum.AMOUNT) {\n {{\n data[col.code!]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n } @else {\n @if (col.type === TableTypeEnum.NUMBER) {\n {{\n formatNumber(\n data[col.code!],\n col.decimalPlaces,\n col.thousandSeparator,\n col.decimalSeparator\n )\n }}\n } @else {\n @if (\n col.type === TableTypeEnum.DATE ||\n col.type === TableTypeEnum.DATETIME\n ) {\n @if (col.type === TableTypeEnum.DATE) {\n {{\n formatDateWithColumn(\n parseAnyDate(data[col.code!]),\n col\n )\n }}\n }\n\n @if (col.type === TableTypeEnum.DATETIME) {\n {{\n formatDateTimeWithColumn(\n parseAnyDate(data[col.code!]),\n col\n )\n }}\n }\n } @else {\n @if (\n [\n TableTypeEnum.STRING,\n TableTypeEnum.MULTISELECT,\n ].includes(col.type!)\n ) {\n {{ data[col.code!] }}\n }\n }\n }\n }\n }\n }\n }\n </div>\n }\n </td>\n }\n } @else {\n @for (child of col.children; track child) {\n <td\n [style.width]=\"child.width || getHeaderWidth(child)\"\n [ngClass]=\"getDataAlignClass(child)\"\n [ngStyle]=\"getCellStyle(child, data)\"\n >\n <div\n [ngClass]=\"getCellInnerAlignClass(child)\"\n [ngStyle]=\"getCellInnerStyle(child)\"\n >\n @if (isEditable(child.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"child.code ? data[child.code] : null\"\n (change)=\"onChange($event, data.id, child.code)\"\n />\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n {{ child.code ? data[child.code] : \"\" }}\n </ng-template>\n </p-cellEditor>\n } @else {\n @if (child.type === TableTypeEnum.TAG) {\n <p-tag\n [value]=\"getTagValue(child, data)\"\n [severity]=\"$any(getTagSeverity(child, data))\"\n [icon]=\"getTagIcon(child, data)\"\n [rounded]=\"isTagRounded(child)\"\n ></p-tag>\n } @else {\n {{ child.code ? data[child.code] : \"\" }}\n }\n }\n </div>\n </td>\n }\n }\n }\n </tr>\n }\n </ng-template>\n </p-table>\n</div>\n", styles: [".pt-advanced-prime-table .bread-crumb{margin-bottom:15px}.pt-advanced-prime-table .date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.pt-advanced-prime-table .filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.pt-advanced-prime-table .settings{display:flex;gap:1rem}.pt-advanced-prime-table .multi-select-container{display:flex;align-items:center;gap:.3rem}.pt-advanced-prime-table ::ng-deep p-table{min-width:50rem}.pt-advanced-prime-table ::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}.pt-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}.pt-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}.pt-advanced-prime-table ::ng-deep .header-container{display:flex;justify-content:space-between;align-items:center;width:100%}.pt-advanced-prime-table ::ng-deep .header-title-left,.pt-advanced-prime-table ::ng-deep .header-title-center,.pt-advanced-prime-table ::ng-deep .header-title-right{flex:1}.pt-advanced-prime-table ::ng-deep .header-title-left{text-align:left}.pt-advanced-prime-table ::ng-deep .header-title-center{text-align:center}.pt-advanced-prime-table ::ng-deep .header-title-right{text-align:right}.pt-advanced-prime-table ::ng-deep .header-align-left{text-align:left}.pt-advanced-prime-table ::ng-deep .header-align-center{text-align:center}.pt-advanced-prime-table ::ng-deep .header-align-right{text-align:right}.pt-advanced-prime-table ::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.pt-advanced-prime-table .flex{display:flex;justify-content:space-between;align-items:center}.pt-advanced-prime-table .ml-auto{margin-left:auto}.pt-advanced-prime-table ::ng-deep p-inputicon{margin-right:-.8rem;z-index:2;position:relative}.pt-advanced-prime-table ::ng-deep .p-inputtext{padding-left:1.7rem}.pt-advanced-prime-table ::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}.pt-advanced-prime-table ::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.pt-advanced-prime-table .table-row{text-align:center;display:flex;gap:1rem;justify-content:center}.pt-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-excel{font-size:1.25em;color:green}.pt-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-pdf{font-size:1.25em;color:red}.pt-advanced-prime-table .table-container{display:block;width:100%}.pt-advanced-prime-table ::ng-deep .p-datatable-emptymessage>td.empty-message-cell{padding:0!important}.pt-advanced-prime-table .empty-message-wrapper{width:100%;height:100%;min-height:180px;display:flex;align-items:center;justify-content:center}.pt-advanced-prime-table .empty-message{text-align:center;color:#888;font-size:1.2rem}.pt-advanced-prime-table .empty-message i{display:block;font-size:2rem;margin-bottom:.5rem}.pt-advanced-prime-table th{white-space:normal;word-wrap:break-word}.filter-image{width:22px;height:14px;margin-right:5px}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-left{text-align:left!important}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-center{text-align:center!important}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-right{text-align:right!important}.pt-advanced-prime-table .cell-inner-left,.pt-advanced-prime-table .cell-inner-center,.pt-advanced-prime-table .cell-inner-right{width:100%;display:flex;align-items:center}.pt-advanced-prime-table .cell-inner-left{justify-content:flex-start;text-align:left}.pt-advanced-prime-table .cell-inner-center{justify-content:center;text-align:center}.pt-advanced-prime-table .cell-inner-right{justify-content:flex-end;text-align:right}.pt-advanced-prime-table ::ng-deep .p-tag{font-size:.72rem;font-weight:800;padding:.2rem .55rem;line-height:1.2;white-space:nowrap}.pt-advanced-prime-table ::ng-deep .p-tag .p-tag-icon{margin-right:.25rem}.pt-advanced-prime-table .progress-cell{width:100%;min-width:160px;display:flex;align-items:center;gap:.5rem}.pt-advanced-prime-table ::ng-deep .progress-cell .p-progressbar{flex:1;width:100%;min-width:120px;height:.75rem!important;background:#e5e7eb!important;border-radius:999px;overflow:hidden}.pt-advanced-prime-table ::ng-deep .progress-cell .p-progressbar-value{display:block!important;height:100%!important;border-radius:999px}.pt-advanced-prime-table .progress-cell-value{min-width:38px;font-size:.72rem;font-weight:800;color:#334155;text-align:right}.pt-advanced-prime-table ::ng-deep th.action-column,.pt-advanced-prime-table ::ng-deep td.action-column{text-align:center!important;justify-content:center;align-items:center;overflow:hidden;white-space:nowrap;padding:0}.pt-advanced-prime-table ::ng-deep .action-buttons-container{width:100%;display:flex;justify-content:center!important;align-items:center!important;gap:.35rem}.pt-advanced-prime-table ::ng-deep .action-buttons-container .p-button.p-button-rounded.p-button-text{padding:.25rem!important;min-width:22px!important;height:22px!important}.pt-advanced-prime-table ::ng-deep .pt-progress-success .p-progressbar-value{background:#22c55e!important}.pt-advanced-prime-table ::ng-deep .pt-progress-warning .p-progressbar-value{background:#f59e0b!important}.pt-advanced-prime-table ::ng-deep .pt-progress-danger .p-progressbar-value{background:#ef4444!important}.pt-advanced-prime-table ::ng-deep .pt-progress-info .p-progressbar-value{background:#3b82f6!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i1$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i3.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i3.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "component", type: i3.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i3.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "directive", type: i3.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i3.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "directive", type: i3.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i3.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i3.SaveEditableRow, selector: "[pSaveEditableRow]" }, { kind: "directive", type: i3.CancelEditableRow, selector: "[pCancelEditableRow]" }, { kind: "component", type: i3.ColumnFilter, selector: "p-columnFilter, p-column-filter, p-columnfilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "filterOn", "useGrouping", "showButtons", "ariaLabel", "filterButtonProps", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: i7.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i9.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i10.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i11.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "directive", type: i12.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i13.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "pipe", type: CustomCurrencyPipe, name: "customCurrency" }, { kind: "pipe", type: CustomDatePipe, name: "customDate" }] }); }
|
|
1131
1182
|
}
|
|
1132
1183
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTAdvancedPrimeTableComponent, decorators: [{
|
|
1133
1184
|
type: Component,
|
|
1134
|
-
args: [{ selector: 'pt-advanced-prime-table', standalone: false, template: "<div class=\"pt-advanced-prime-table table-container\">\n <p-table\n #dt\n [value]=\"data\"\n [loading]=\"loading\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n [totalRecords]=\"totalRecords\"\n [lazy]=\"isLazy\"\n [filterDelay]=\"0\"\n [dataKey]=\"selectionDataKey || rowReorderIdField || 'id'\"\n styleClass=\"p-datatable-gridlines p-datatable-striped\"\n [scrollable]=\"true\"\n [scrollHeight]=\"maxHeight !== null ? maxHeight : undefined\"\n (onRowReorder)=\"onRowReorder($event)\"\n (onPage)=\"changePage($event)\"\n (onSort)=\"sortColumn($event)\"\n (onFilter)=\"filterColumn($event)\"\n [selectionMode]=\"selectionMode\"\n [(selection)]=\"selection\"\n (selectionChange)=\"selectionChange.emit($event)\"\n (onRowSelect)=\"rowSelect.emit($event.data)\"\n (onRowUnselect)=\"rowUnselect.emit($event.data)\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n @if (canUseRowReorder()) {\n <col style=\"width: 3rem\" />\n }\n @for (col of columns; track col) {\n <col\n [style.width]=\"col.width || getHeaderWidth(col)\"\n />\n }\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n @if (hasSearchFilter) {\n <button\n pButton\n icon=\"pi pi-filter-slash\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"clear(dt)\"\n title=\"Clear filters\"\n ></button>\n }\n\n @if (hasExportExcel) {\n <button\n pButton\n icon=\"pi pi-file-excel\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportExcel()\"\n title=\"Export to Excel\"\n ></button>\n }\n\n @if (hasExportPDF) {\n <button\n pButton\n icon=\"pi pi-file-pdf\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportPdf()\"\n title=\"Export to PDF\"\n ></button>\n }\n </div>\n\n @if (hasSearchFilter) {\n <div class=\"ml-auto\">\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n }\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr class=\"sticky-header\">\n @if (canUseRowReorder()) {\n <th style=\"width: 3rem\"></th>\n }\n\n @for (col of columns; track col) {\n @if (!col.children) {\n <th\n [pSortableColumn]=\"col.code\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [style.padding]=\"'0px'\"\n [ngClass]=\"[\n getHeaderAlignClass(col),\n col.type === TableTypeEnum.ACTION ? 'action-column' : '',\n ]\"\n colspan=\"1\"\n >\n @if (isSortable && col.isSortable !== false) {\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [style.padding]=\"'0px'\"\n [style.margin]=\"'10px'\"\n >\n <span [ngClass]=\"getHeaderTitleClass(col)\">\n {{ col.title }}\n </span>\n <div\n class=\"icons d-flex align-items-center\"\n [style.width]=\"'77px'\"\n >\n <p-sortIcon [field]=\"col.code\" />\n @if (hasColumnFilter && col.isFilter !== false) {\n @if (col.type === TableTypeEnum.COMPOSED) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n type=\"text\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"false\"\n [showOperator]=\"false\"\n (onClear)=\"onComposedColumnClear(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n >\n @for (composedName of col.composedNames; track composedName) {\n <div>\n @if (\n getComposedFieldType(col, composedName) ===\n TableTypeEnum.STRING\n ) {\n <p-multiSelect\n [options]=\"filters[composedName]?.options\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"filters[composedName]?.value ?? []\"\n (ngModelChange)=\"\n onComposedFilterValueChange(\n col,\n composedName,\n $event\n );\n filter($event ?? [])\n \"\n [placeholder]=\"filters[composedName]?.placeholder\"\n display=\"chip\"\n >\n <ng-template let-item pTemplate=\"item\">\n <div class=\"custom-multiselect-item\">\n @if (item.image) {\n <img\n [src]=\"item.image\"\n alt=\"icon\"\n class=\"filter-image\"\n />\n }\n <span>{{ item.label }}</span>\n </div>\n </ng-template>\n </p-multiSelect>\n }\n </div>\n }\n </ng-template>\n </p-columnFilter>\n }\n @if (col.type !== TableTypeEnum.COMPOSED) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"col.type !== TableTypeEnum.MULTISELECT\"\n [showOperator]=\"col.type !== TableTypeEnum.MULTISELECT\"\n [matchMode]=\"\n col.type === TableTypeEnum.MULTISELECT\n ? 'in'\n : undefined\n \"\n (onClear)=\"onFilterClear(col.code!)\"\n >\n @if (\n col.type === TableTypeEnum.NUMBER ||\n col.type === TableTypeEnum.AMOUNT\n ; as value) {\n <ng-template\n pTemplate=\"filter\"\n let-value\n >\n <input\n pInputText\n type=\"text\"\n inputmode=\"decimal\"\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onNumberFilterChange(col.code!, $event)\n \"\n placeholder=\"Enter a number\"\n />\n </ng-template>\n }\n <ng-template\n pTemplate=\"filter\"\n *ngIf=\"col.type === TableTypeEnum.DATE\"\n let-filter=\"filterCallback\"\n let-value\n >\n <p-datepicker\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event)\n \"\n dateFormat=\"dd/mm/yy\"\n placeholder=\"Choose a date\"\n ></p-datepicker>\n </ng-template>\n <ng-template\n pTemplate=\"filter\"\n *ngIf=\"\n col.type === TableTypeEnum.MULTISELECT &&\n col.filterOptions &&\n col.filterOptions.length > 0\n \"\n let-filter=\"filterCallback\"\n let-value\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"\n latestFilterValues[col.code!] ?? value ?? []\n \"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event ?? [])\n \"\n display=\"chip\"\n placeholder=\"Choose option\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n }\n }\n </div>\n </div>\n } @else {\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [style.padding]=\"'0px'\"\n [style.margin]=\"'10px'\"\n >\n <span [ngClass]=\"getHeaderTitleClass(col)\">\n {{ col.title }}\n </span>\n @if (hasColumnFilter && col.isFilter !== false) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"\n getColumnFilterType(col) !== 'multiSelect'\n \"\n [showOperator]=\"getColumnFilterType(col) !== 'multiSelect'\"\n [matchMode]=\"\n getColumnFilterType(col) === 'multiSelect'\n ? 'in'\n : undefined\n \"\n (onClear)=\"onFilterClear(col.code!)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n let-value\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-datepicker\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event)\n \"\n dateFormat=\"dd/mm/yy\"\n ></p-datepicker>\n </ng-template>\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n let-value\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"latestFilterValues[col.code!] ?? value ?? []\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event ?? [])\n \"\n display=\"chip\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n }\n </div>\n }\n </th>\n } @else {\n <th\n [attr.colspan]=\"col.children?.length\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"getHeaderAlignClass(col)\"\n >\n <span>{{ col.title }}</span>\n </th>\n }\n }\n </tr>\n\n @if (hasGroupedColumns) {\n <tr>\n @if (canUseRowReorder()) {\n <th style=\"width: 3rem\"></th>\n }\n @for (col of columns; track col) {\n @if (col.children) {\n @for (child of col.children; track child) {\n <th\n [style.width]=\"child.width || getHeaderWidth(child)\"\n [style.padding]=\"'0px'\"\n ></th>\n }\n }\n }\n </tr>\n }\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr class=\"p-datatable-emptymessage\">\n <td\n class=\"empty-message-cell\"\n [attr.colspan]=\"columns.length + (canUseRowReorder() ? 1 : 0)\"\n >\n <div class=\"empty-message-wrapper\">\n <div class=\"empty-message\">\n <i class=\"pi pi-info-circle\"></i>\n <p>No records available to display.</p>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n @if (!loading) {\n <tr\n [pEditableRow]=\"isEdit ? data : null\"\n [pReorderableRow]=\"canUseRowReorder() ? ri : null\"\n [pSelectableRow]=\"selectionMode ? data : null\"\n >\n @if (canUseRowReorder()) {\n <td style=\"width: 3rem; text-align: center\">\n <span\n pReorderableRowHandle\n style=\"cursor: move; display: inline-flex; align-items: center\"\n title=\"D\u00E9placer la ligne\"\n >\n <i class=\"pi pi-bars\"></i>\n </span>\n </td>\n }\n @for (col of columns; track col) {\n @if (!col.children) {\n @if (\n isEditable(col.code!) && col.type !== TableTypeEnum.ACTION) {\n <td\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"getDataAlignClass(col)\"\n [ngStyle]=\"getCellStyle(col, data)\"\n >\n <div [ngClass]=\"getCellInnerAlignClass(col)\">\n @if (isMultiSelect(col.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code!]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n @for (\n rec of getMultiSelectValues(data[col.code!])\n ; track\n rec) {\n <p-tag [value]=\"rec\"></p-tag>\n }\n </div>\n </ng-template>\n </p-cellEditor>\n } @else {\n @if (isDatePicker(col.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-datepicker\n [inputId]=\"data[col.code!]\"\n [ngModel]=\"data[col.code!]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-datepicker>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ data[col.code!] | customDate }}\n </ng-template>\n </p-cellEditor>\n } @else {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code!]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n @if (\n col.type === TableTypeEnum.AMOUNT) {\n {{\n data[col.code!]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n } @else {\n {{ data[col.code!] }}\n }\n </ng-template>\n </p-cellEditor>\n }\n }\n </div>\n </td>\n } @else {\n <td\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"[\n getDataAlignClass(col),\n col.type === TableTypeEnum.ACTION ? 'action-column' : '',\n ]\"\n [ngStyle]=\"getCellStyle(col, data)\"\n >\n @if (col.type === TableTypeEnum.ACTION) {\n <div class=\"action-buttons-container\">\n @if (isDelete) {\n <button\n pButton\n pRipple\n pTooltip=\"Supprimer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n @if (isEdit) {\n <div>\n @if (!editing) {\n <button\n pInitEditableRow\n pButton\n pRipple\n pTooltip=\"Modifier\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n @if (editing) {\n <button\n pSaveEditableRow\n pButton\n pRipple\n pTooltip=\"Enregistrer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n @if (editing) {\n <button\n pCancelEditableRow\n pButton\n pRipple\n pTooltip=\"Annuler\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n </div>\n }\n @for (act of customActions; track act) {\n @if (isActionVisible(act, data)) {\n <button\n pButton\n pRipple\n [pTooltip]=\"act.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n class=\"p-button-rounded p-button-text\"\n [icon]=\"act.icon || 'pi pi-ellipsis-h'\"\n [ngClass]=\"act.styleClass\"\n [disabled]=\"isActionDisabled(act, data)\"\n (click)=\"onCustomActionClick(act, data)\"\n ></button>\n }\n }\n </div>\n } @else {\n <div [ngClass]=\"getCellInnerAlignClass(col)\">\n @if (\n col.type === TableTypeEnum.COMPOSED) {\n <div class=\"composed-cell\">\n @for (\n composedName of col.composedNames; track\n composedName; let i = $index) {\n @if (\n col.composedTypes &&\n col.composedTypes[i] === TableTypeEnum.IMAGE\n ) {\n <img\n [src]=\"data[col.code!]?.[composedName]\"\n alt=\"composed-img\"\n class=\"composed-image\"\n [ngStyle]=\"\n getMergedComposedImageStyle(\n col,\n composedName,\n data\n )\n \"\n />\n }\n @if (\n col.composedTypes &&\n col.composedTypes[i] === TableTypeEnum.STRING\n ) {\n <span\n class=\"composed-text\"\n [ngStyle]=\"\n getMergedComposedTextStyle(\n col,\n composedName,\n data\n )\n \"\n >\n {{ data[col.code!]?.[composedName] }}\n </span>\n }\n }\n </div>\n } @else {\n @if (\n col.type === TableTypeEnum.PROGRESS) {\n <div class=\"progress-cell\">\n <p-progressBar\n [value]=\"getProgressValue(col, data)\"\n [showValue]=\"false\"\n [ngClass]=\"\n 'pt-progress-' + getProgressSeverity(col, data)\n \"\n ></p-progressBar>\n @if (isProgressShowValue(col)) {\n <span\n class=\"progress-cell-value\"\n >\n {{ getProgressValue(col, data)\n }}{{ getProgressUnit(col) }}\n </span>\n }\n </div>\n } @else {\n @if (col.type === TableTypeEnum.TAG) {\n <p-tag\n [value]=\"getTagValue(col, data)\"\n [severity]=\"$any(getTagSeverity(col, data))\"\n [icon]=\"getTagIcon(col, data)\"\n [rounded]=\"isTagRounded(col)\"\n ></p-tag>\n } @else {\n @if (\n col.type === TableTypeEnum.AMOUNT) {\n {{\n data[col.code!]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n } @else {\n @if (\n col.type === TableTypeEnum.NUMBER) {\n {{\n formatNumber(\n data[col.code!],\n col.decimalPlaces,\n col.thousandSeparator,\n col.decimalSeparator\n )\n }}\n } @else {\n @if (\n col.type === TableTypeEnum.DATE ||\n col.type === TableTypeEnum.DATETIME) {\n @if (col.type === TableTypeEnum.DATE) {\n {{\n formatDateWithColumn(\n parseAnyDate(data[col.code!]),\n col\n )\n }}\n }\n @if (col.type === TableTypeEnum.DATETIME) {\n {{\n formatDateTimeWithColumn(\n parseAnyDate(data[col.code!]),\n col\n )\n }}\n }\n } @else {\n @if (\n [\n TableTypeEnum.STRING,\n TableTypeEnum.MULTISELECT,\n ].includes(col.type!)\n ) {\n {{ data[col.code!] }}\n }\n }\n }\n }\n }\n }\n }\n </div>\n }\n </td>\n }\n } @else {\n @for (child of col.children; track child) {\n <td\n [style.width]=\"child.width || getHeaderWidth(child)\"\n [ngClass]=\"getDataAlignClass(child)\"\n [ngStyle]=\"getCellStyle(child, data)\"\n >\n <div [ngClass]=\"getCellInnerAlignClass(child)\">\n @if (isEditable(child.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"child.code ? data[child.code] : null\"\n (change)=\"onChange($event, data.id, child.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ child.code ? data[child.code] : \"\" }}\n </ng-template>\n </p-cellEditor>\n } @else {\n @if (\n child.type === TableTypeEnum.TAG) {\n <p-tag\n [value]=\"getTagValue(child, data)\"\n [severity]=\"$any(getTagSeverity(child, data))\"\n [icon]=\"getTagIcon(child, data)\"\n [rounded]=\"isTagRounded(child)\"\n ></p-tag>\n } @else {\n {{ child.code ? data[child.code] : \"\" }}\n }\n }\n </div>\n </td>\n }\n }\n }\n </tr>\n }\n </ng-template>\n</p-table>\n</div>\n", styles: [".pt-advanced-prime-table .bread-crumb{margin-bottom:15px}.pt-advanced-prime-table .date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.pt-advanced-prime-table .filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.pt-advanced-prime-table .settings{display:flex;gap:1rem}.pt-advanced-prime-table .multi-select-container{display:flex;align-items:center;gap:.3rem}.pt-advanced-prime-table ::ng-deep p-table{min-width:50rem}.pt-advanced-prime-table ::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}.pt-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}.pt-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}.pt-advanced-prime-table ::ng-deep .header-container{display:flex;justify-content:space-between;align-items:center;width:100%}.pt-advanced-prime-table ::ng-deep .header-title-left,.pt-advanced-prime-table ::ng-deep .header-title-center,.pt-advanced-prime-table ::ng-deep .header-title-right{flex:1}.pt-advanced-prime-table ::ng-deep .header-title-left{text-align:left}.pt-advanced-prime-table ::ng-deep .header-title-center{text-align:center}.pt-advanced-prime-table ::ng-deep .header-title-right{text-align:right}.pt-advanced-prime-table ::ng-deep .header-align-left{text-align:left}.pt-advanced-prime-table ::ng-deep .header-align-center{text-align:center}.pt-advanced-prime-table ::ng-deep .header-align-right{text-align:right}.pt-advanced-prime-table ::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.pt-advanced-prime-table .flex{display:flex;justify-content:space-between;align-items:center}.pt-advanced-prime-table .ml-auto{margin-left:auto}.pt-advanced-prime-table ::ng-deep p-inputicon{margin-right:-.8rem;z-index:2;position:relative}.pt-advanced-prime-table ::ng-deep .p-inputtext{padding-left:1.7rem}.pt-advanced-prime-table ::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}.pt-advanced-prime-table ::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.pt-advanced-prime-table .table-row{text-align:center;display:flex;gap:1rem;justify-content:center}.pt-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-excel{font-size:1.25em;color:green}.pt-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-pdf{font-size:1.25em;color:red}.pt-advanced-prime-table .table-container{display:block;width:100%}.pt-advanced-prime-table ::ng-deep .p-datatable-emptymessage>td.empty-message-cell{padding:0!important}.pt-advanced-prime-table .empty-message-wrapper{width:100%;height:100%;min-height:180px;display:flex;align-items:center;justify-content:center}.pt-advanced-prime-table .empty-message{text-align:center;color:#888;font-size:1.2rem}.pt-advanced-prime-table .empty-message i{display:block;font-size:2rem;margin-bottom:.5rem}.pt-advanced-prime-table th{white-space:normal;word-wrap:break-word}.filter-image{width:22px;height:14px;margin-right:5px}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-left{text-align:left!important}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-center{text-align:center!important}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-right{text-align:right!important}.pt-advanced-prime-table .cell-inner-left,.pt-advanced-prime-table .cell-inner-center,.pt-advanced-prime-table .cell-inner-right{width:100%;display:flex;align-items:center}.pt-advanced-prime-table .cell-inner-left{justify-content:flex-start;text-align:left}.pt-advanced-prime-table .cell-inner-center{justify-content:center;text-align:center}.pt-advanced-prime-table .cell-inner-right{justify-content:flex-end;text-align:right}.pt-advanced-prime-table ::ng-deep .p-tag{font-size:.72rem;font-weight:800;padding:.2rem .55rem;line-height:1.2;white-space:nowrap}.pt-advanced-prime-table ::ng-deep .p-tag .p-tag-icon{margin-right:.25rem}.pt-advanced-prime-table .progress-cell{width:100%;min-width:160px;display:flex;align-items:center;gap:.5rem}.pt-advanced-prime-table ::ng-deep .progress-cell .p-progressbar{flex:1;width:100%;min-width:120px;height:.75rem!important;background:#e5e7eb!important;border-radius:999px;overflow:hidden}.pt-advanced-prime-table ::ng-deep .progress-cell .p-progressbar-value{display:block!important;height:100%!important;border-radius:999px}.pt-advanced-prime-table .progress-cell-value{min-width:38px;font-size:.72rem;font-weight:800;color:#334155;text-align:right}.pt-advanced-prime-table ::ng-deep th.action-column,.pt-advanced-prime-table ::ng-deep td.action-column{text-align:center!important;justify-content:center;align-items:center;overflow:hidden;white-space:nowrap;padding:0}.pt-advanced-prime-table ::ng-deep .action-buttons-container{width:100%;display:flex;justify-content:center!important;align-items:center!important;gap:.35rem}.pt-advanced-prime-table ::ng-deep .action-buttons-container .p-button.p-button-rounded.p-button-text{padding:.25rem!important;min-width:22px!important;height:22px!important}.pt-advanced-prime-table ::ng-deep .pt-progress-success .p-progressbar-value{background:#22c55e!important}.pt-advanced-prime-table ::ng-deep .pt-progress-warning .p-progressbar-value{background:#f59e0b!important}.pt-advanced-prime-table ::ng-deep .pt-progress-danger .p-progressbar-value{background:#ef4444!important}.pt-advanced-prime-table ::ng-deep .pt-progress-info .p-progressbar-value{background:#3b82f6!important}\n"] }]
|
|
1185
|
+
args: [{ selector: 'pt-advanced-prime-table', standalone: false, template: "<div class=\"pt-advanced-prime-table table-container\">\n <p-table\n #dt\n [value]=\"data\"\n [loading]=\"loading\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n [totalRecords]=\"totalRecords\"\n [lazy]=\"isLazy\"\n [filterDelay]=\"0\"\n [dataKey]=\"selectionDataKey || rowReorderIdField || 'id'\"\n styleClass=\"p-datatable-gridlines p-datatable-striped\"\n [scrollable]=\"true\"\n [scrollHeight]=\"maxHeight !== null ? maxHeight : undefined\"\n (onRowReorder)=\"onRowReorder($event)\"\n (onPage)=\"changePage($event)\"\n (onSort)=\"sortColumn($event)\"\n (onFilter)=\"filterColumn($event)\"\n [selectionMode]=\"selectionMode\"\n [(selection)]=\"selection\"\n (selectionChange)=\"selectionChange.emit($event)\"\n (onRowSelect)=\"rowSelect.emit($event.data)\"\n (onRowUnselect)=\"rowUnselect.emit($event.data)\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n @if (canUseRowReorder()) {\n <col style=\"width: 3rem\" />\n }\n\n @for (col of columns; track col) {\n <col [style.width]=\"col.width || getHeaderWidth(col)\" />\n }\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n @if (hasSearchFilter) {\n <button\n pButton\n icon=\"pi pi-filter-slash\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"clear(dt)\"\n title=\"Clear filters\"\n ></button>\n }\n\n @if (hasExportExcel) {\n <button\n pButton\n icon=\"pi pi-file-excel\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportExcel()\"\n title=\"Export to Excel\"\n ></button>\n }\n\n @if (hasExportPDF) {\n <button\n pButton\n icon=\"pi pi-file-pdf\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportPdf()\"\n title=\"Export to PDF\"\n ></button>\n }\n </div>\n\n @if (hasSearchFilter) {\n <div class=\"ml-auto\">\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n }\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr class=\"sticky-header\">\n @if (canUseRowReorder()) {\n <th [style.width]=\"'3rem'\" [ngStyle]=\"getStaticCellStyle()\"></th>\n }\n\n @for (col of columns; track col) {\n @if (!col.children) {\n <th\n [pSortableColumn]=\"col.code\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngStyle]=\"getHeaderCellStyle(col)\"\n [ngClass]=\"[\n getHeaderAlignClass(col),\n col.type === TableTypeEnum.ACTION ? 'action-column' : '',\n ]\"\n colspan=\"1\"\n >\n @if (isSortable && col.isSortable !== false) {\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngStyle]=\"getCellInnerStyle(col, '10px')\"\n >\n <span [ngClass]=\"getHeaderTitleClass(col)\">\n {{ col.title }}\n </span>\n\n <div\n class=\"icons d-flex align-items-center\"\n [style.width]=\"'77px'\"\n >\n <p-sortIcon [field]=\"col.code\" />\n\n @if (hasColumnFilter && col.isFilter !== false) {\n @if (col.type === TableTypeEnum.COMPOSED) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n type=\"text\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"false\"\n [showOperator]=\"false\"\n (onClear)=\"onComposedColumnClear(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n >\n @for (\n composedName of col.composedNames;\n track composedName\n ) {\n <div>\n @if (\n getComposedFieldType(col, composedName) ===\n TableTypeEnum.STRING\n ) {\n <p-multiSelect\n [options]=\"filters[composedName]?.options\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"\n filters[composedName]?.value ?? []\n \"\n (ngModelChange)=\"\n onComposedFilterValueChange(\n col,\n composedName,\n $event\n );\n filter($event ?? [])\n \"\n [placeholder]=\"\n filters[composedName]?.placeholder\n \"\n display=\"chip\"\n >\n <ng-template let-item pTemplate=\"item\">\n <div class=\"custom-multiselect-item\">\n @if (item.image) {\n <img\n [src]=\"item.image\"\n alt=\"icon\"\n class=\"filter-image\"\n />\n }\n\n <span>{{ item.label }}</span>\n </div>\n </ng-template>\n </p-multiSelect>\n }\n </div>\n }\n </ng-template>\n </p-columnFilter>\n }\n\n @if (col.type !== TableTypeEnum.COMPOSED) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"\n col.type !== TableTypeEnum.MULTISELECT\n \"\n [showOperator]=\"\n col.type !== TableTypeEnum.MULTISELECT\n \"\n [matchMode]=\"\n col.type === TableTypeEnum.MULTISELECT\n ? 'in'\n : undefined\n \"\n (onClear)=\"onFilterClear(col.code!)\"\n >\n @if (\n col.type === TableTypeEnum.NUMBER ||\n col.type === TableTypeEnum.AMOUNT;\n as value\n ) {\n <ng-template pTemplate=\"filter\" let-value>\n <input\n pInputText\n type=\"text\"\n inputmode=\"decimal\"\n [ngModel]=\"\n latestFilterValues[col.code!] ?? value\n \"\n (ngModelChange)=\"\n onNumberFilterChange(col.code!, $event)\n \"\n placeholder=\"Enter a number\"\n />\n </ng-template>\n }\n\n <ng-template\n pTemplate=\"filter\"\n *ngIf=\"col.type === TableTypeEnum.DATE\"\n let-filter=\"filterCallback\"\n let-value\n >\n <p-datepicker\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event)\n \"\n dateFormat=\"dd/mm/yy\"\n placeholder=\"Choose a date\"\n ></p-datepicker>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n *ngIf=\"\n col.type === TableTypeEnum.MULTISELECT &&\n col.filterOptions &&\n col.filterOptions.length > 0\n \"\n let-filter=\"filterCallback\"\n let-value\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"\n latestFilterValues[col.code!] ?? value ?? []\n \"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event ?? [])\n \"\n display=\"chip\"\n placeholder=\"Choose option\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n }\n }\n </div>\n </div>\n } @else {\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngStyle]=\"getCellInnerStyle(col, '10px')\"\n >\n <span [ngClass]=\"getHeaderTitleClass(col)\">\n {{ col.title }}\n </span>\n\n @if (hasColumnFilter && col.isFilter !== false) {\n <p-columnFilter\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n [showApplyButton]=\"true\"\n [showClearButton]=\"true\"\n [showMatchModes]=\"\n getColumnFilterType(col) !== 'multiSelect'\n \"\n [showOperator]=\"\n getColumnFilterType(col) !== 'multiSelect'\n \"\n [matchMode]=\"\n getColumnFilterType(col) === 'multiSelect'\n ? 'in'\n : undefined\n \"\n (onClear)=\"onFilterClear(col.code!)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n let-value\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-datepicker\n [ngModel]=\"latestFilterValues[col.code!] ?? value\"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event)\n \"\n dateFormat=\"dd/mm/yy\"\n ></p-datepicker>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-filter=\"filterCallback\"\n let-value\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"\n latestFilterValues[col.code!] ?? value ?? []\n \"\n (ngModelChange)=\"\n onFilterValueChange(col.code!, null, $event);\n filter($event ?? [])\n \"\n display=\"chip\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n }\n </div>\n }\n </th>\n } @else {\n <th\n [attr.colspan]=\"col?.children?.length\"\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngStyle]=\"getHeaderCellStyle(col)\"\n [ngClass]=\"getHeaderAlignClass(col)\"\n >\n <span>{{ col.title }}</span>\n </th>\n }\n }\n </tr>\n\n @if (hasGroupedColumns) {\n <tr>\n @if (canUseRowReorder()) {\n <th [style.width]=\"'3rem'\" [ngStyle]=\"getStaticCellStyle()\"></th>\n }\n\n @for (col of columns; track col) {\n @if (col.children) {\n @for (child of col.children; track child) {\n <th\n [style.width]=\"child.width || getHeaderWidth(child)\"\n [ngStyle]=\"getHeaderCellStyle(child)\"\n ></th>\n }\n }\n }\n </tr>\n }\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr class=\"p-datatable-emptymessage\">\n <td\n class=\"empty-message-cell\"\n [attr.colspan]=\"columns.length + (canUseRowReorder() ? 1 : 0)\"\n >\n <div class=\"empty-message-wrapper\">\n <div class=\"empty-message\">\n <i class=\"pi pi-info-circle\"></i>\n <p>No records available to display.</p>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n @if (!loading) {\n <tr\n [pEditableRow]=\"isEdit ? data : null\"\n [pReorderableRow]=\"canUseRowReorder() ? ri : null\"\n [pSelectableRow]=\"selectionMode ? data : null\"\n >\n @if (canUseRowReorder()) {\n <td\n [style.width]=\"'3rem'\"\n [style.text-align]=\"'center'\"\n [ngStyle]=\"getStaticCellStyle()\"\n >\n <span\n pReorderableRowHandle\n style=\"cursor: move; display: inline-flex; align-items: center\"\n title=\"D\u00E9placer la ligne\"\n >\n <i class=\"pi pi-bars\"></i>\n </span>\n </td>\n }\n\n @for (col of columns; track col) {\n @if (!col.children) {\n @if (isEditable(col.code!) && col.type !== TableTypeEnum.ACTION) {\n <td\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"getDataAlignClass(col)\"\n [ngStyle]=\"getCellStyle(col, data)\"\n >\n <div\n [ngClass]=\"getCellInnerAlignClass(col)\"\n [ngStyle]=\"getCellInnerStyle(col)\"\n >\n @if (isMultiSelect(col.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code!]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n @for (\n rec of getMultiSelectValues(data[col.code!]);\n track rec\n ) {\n <p-tag [value]=\"rec\"></p-tag>\n }\n </div>\n </ng-template>\n </p-cellEditor>\n } @else {\n @if (isDatePicker(col.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-datepicker\n [inputId]=\"data[col.code!]\"\n [ngModel]=\"data[col.code!]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-datepicker>\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n {{ data[col.code!] | customDate }}\n </ng-template>\n </p-cellEditor>\n } @else {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code!]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n @if (col.type === TableTypeEnum.AMOUNT) {\n {{\n data[col.code!]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n } @else {\n {{ data[col.code!] }}\n }\n </ng-template>\n </p-cellEditor>\n }\n }\n </div>\n </td>\n } @else {\n <td\n [style.width]=\"col.width || getHeaderWidth(col)\"\n [ngClass]=\"[\n getDataAlignClass(col),\n col.type === TableTypeEnum.ACTION ? 'action-column' : '',\n ]\"\n [ngStyle]=\"getCellStyle(col, data)\"\n >\n @if (col.type === TableTypeEnum.ACTION) {\n <div\n class=\"action-buttons-container\"\n [ngStyle]=\"getCellInnerStyle(col)\"\n >\n @if (isDelete) {\n <button\n pButton\n pRipple\n pTooltip=\"Supprimer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n\n @if (isEdit) {\n <div>\n @if (!editing) {\n <button\n pInitEditableRow\n pButton\n pRipple\n pTooltip=\"Modifier\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n\n @if (editing) {\n <button\n pSaveEditableRow\n pButton\n pRipple\n pTooltip=\"Enregistrer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n\n @if (editing) {\n <button\n pCancelEditableRow\n pButton\n pRipple\n pTooltip=\"Annuler\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n }\n </div>\n }\n\n @for (act of customActions; track act) {\n @if (isActionVisible(act, data)) {\n <button\n pButton\n pRipple\n [pTooltip]=\"act.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n type=\"button\"\n class=\"p-button-rounded p-button-text\"\n [icon]=\"act.icon || 'pi pi-ellipsis-h'\"\n [ngClass]=\"act.styleClass\"\n [disabled]=\"isActionDisabled(act, data)\"\n (click)=\"onCustomActionClick(act, data)\"\n ></button>\n }\n }\n </div>\n } @else {\n <div\n [ngClass]=\"getCellInnerAlignClass(col)\"\n [ngStyle]=\"getCellInnerStyle(col)\"\n >\n @if (col.type === TableTypeEnum.COMPOSED) {\n <div class=\"composed-cell\">\n @for (\n composedName of col.composedNames;\n track composedName;\n let i = $index\n ) {\n @if (\n col.composedTypes &&\n col.composedTypes[i] === TableTypeEnum.IMAGE\n ) {\n <img\n [src]=\"data[col.code!]?.[composedName]\"\n alt=\"composed-img\"\n class=\"composed-image\"\n [ngStyle]=\"\n getMergedComposedImageStyle(\n col,\n composedName,\n data\n )\n \"\n />\n }\n\n @if (\n col.composedTypes &&\n col.composedTypes[i] === TableTypeEnum.STRING\n ) {\n <span\n class=\"composed-text\"\n [ngStyle]=\"\n getMergedComposedTextStyle(\n col,\n composedName,\n data\n )\n \"\n >\n {{ data[col.code!]?.[composedName] }}\n </span>\n }\n }\n </div>\n } @else {\n @if (col.type === TableTypeEnum.PROGRESS) {\n <div class=\"progress-cell\">\n <p-progressBar\n [value]=\"getProgressValue(col, data)\"\n [showValue]=\"false\"\n [ngClass]=\"\n 'pt-progress-' + getProgressSeverity(col, data)\n \"\n ></p-progressBar>\n\n @if (isProgressShowValue(col)) {\n <span class=\"progress-cell-value\">\n {{ getProgressValue(col, data)\n }}{{ getProgressUnit(col) }}\n </span>\n }\n </div>\n } @else {\n @if (col.type === TableTypeEnum.TAG) {\n <p-tag\n [value]=\"getTagValue(col, data)\"\n [severity]=\"$any(getTagSeverity(col, data))\"\n [icon]=\"getTagIcon(col, data)\"\n [rounded]=\"isTagRounded(col)\"\n ></p-tag>\n } @else {\n @if (col.type === TableTypeEnum.AMOUNT) {\n {{\n data[col.code!]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n } @else {\n @if (col.type === TableTypeEnum.NUMBER) {\n {{\n formatNumber(\n data[col.code!],\n col.decimalPlaces,\n col.thousandSeparator,\n col.decimalSeparator\n )\n }}\n } @else {\n @if (\n col.type === TableTypeEnum.DATE ||\n col.type === TableTypeEnum.DATETIME\n ) {\n @if (col.type === TableTypeEnum.DATE) {\n {{\n formatDateWithColumn(\n parseAnyDate(data[col.code!]),\n col\n )\n }}\n }\n\n @if (col.type === TableTypeEnum.DATETIME) {\n {{\n formatDateTimeWithColumn(\n parseAnyDate(data[col.code!]),\n col\n )\n }}\n }\n } @else {\n @if (\n [\n TableTypeEnum.STRING,\n TableTypeEnum.MULTISELECT,\n ].includes(col.type!)\n ) {\n {{ data[col.code!] }}\n }\n }\n }\n }\n }\n }\n }\n </div>\n }\n </td>\n }\n } @else {\n @for (child of col.children; track child) {\n <td\n [style.width]=\"child.width || getHeaderWidth(child)\"\n [ngClass]=\"getDataAlignClass(child)\"\n [ngStyle]=\"getCellStyle(child, data)\"\n >\n <div\n [ngClass]=\"getCellInnerAlignClass(child)\"\n [ngStyle]=\"getCellInnerStyle(child)\"\n >\n @if (isEditable(child.code)) {\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"child.code ? data[child.code] : null\"\n (change)=\"onChange($event, data.id, child.code)\"\n />\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n {{ child.code ? data[child.code] : \"\" }}\n </ng-template>\n </p-cellEditor>\n } @else {\n @if (child.type === TableTypeEnum.TAG) {\n <p-tag\n [value]=\"getTagValue(child, data)\"\n [severity]=\"$any(getTagSeverity(child, data))\"\n [icon]=\"getTagIcon(child, data)\"\n [rounded]=\"isTagRounded(child)\"\n ></p-tag>\n } @else {\n {{ child.code ? data[child.code] : \"\" }}\n }\n }\n </div>\n </td>\n }\n }\n }\n </tr>\n }\n </ng-template>\n </p-table>\n</div>\n", styles: [".pt-advanced-prime-table .bread-crumb{margin-bottom:15px}.pt-advanced-prime-table .date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.pt-advanced-prime-table .filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.pt-advanced-prime-table .settings{display:flex;gap:1rem}.pt-advanced-prime-table .multi-select-container{display:flex;align-items:center;gap:.3rem}.pt-advanced-prime-table ::ng-deep p-table{min-width:50rem}.pt-advanced-prime-table ::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}.pt-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}.pt-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}.pt-advanced-prime-table ::ng-deep .header-container{display:flex;justify-content:space-between;align-items:center;width:100%}.pt-advanced-prime-table ::ng-deep .header-title-left,.pt-advanced-prime-table ::ng-deep .header-title-center,.pt-advanced-prime-table ::ng-deep .header-title-right{flex:1}.pt-advanced-prime-table ::ng-deep .header-title-left{text-align:left}.pt-advanced-prime-table ::ng-deep .header-title-center{text-align:center}.pt-advanced-prime-table ::ng-deep .header-title-right{text-align:right}.pt-advanced-prime-table ::ng-deep .header-align-left{text-align:left}.pt-advanced-prime-table ::ng-deep .header-align-center{text-align:center}.pt-advanced-prime-table ::ng-deep .header-align-right{text-align:right}.pt-advanced-prime-table ::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.pt-advanced-prime-table .flex{display:flex;justify-content:space-between;align-items:center}.pt-advanced-prime-table .ml-auto{margin-left:auto}.pt-advanced-prime-table ::ng-deep p-inputicon{margin-right:-.8rem;z-index:2;position:relative}.pt-advanced-prime-table ::ng-deep .p-inputtext{padding-left:1.7rem}.pt-advanced-prime-table ::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}.pt-advanced-prime-table ::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.pt-advanced-prime-table .table-row{text-align:center;display:flex;gap:1rem;justify-content:center}.pt-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-excel{font-size:1.25em;color:green}.pt-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-pdf{font-size:1.25em;color:red}.pt-advanced-prime-table .table-container{display:block;width:100%}.pt-advanced-prime-table ::ng-deep .p-datatable-emptymessage>td.empty-message-cell{padding:0!important}.pt-advanced-prime-table .empty-message-wrapper{width:100%;height:100%;min-height:180px;display:flex;align-items:center;justify-content:center}.pt-advanced-prime-table .empty-message{text-align:center;color:#888;font-size:1.2rem}.pt-advanced-prime-table .empty-message i{display:block;font-size:2rem;margin-bottom:.5rem}.pt-advanced-prime-table th{white-space:normal;word-wrap:break-word}.filter-image{width:22px;height:14px;margin-right:5px}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-left{text-align:left!important}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-center{text-align:center!important}.pt-advanced-prime-table ::ng-deep .p-datatable-tbody>tr>td.cell-align-right{text-align:right!important}.pt-advanced-prime-table .cell-inner-left,.pt-advanced-prime-table .cell-inner-center,.pt-advanced-prime-table .cell-inner-right{width:100%;display:flex;align-items:center}.pt-advanced-prime-table .cell-inner-left{justify-content:flex-start;text-align:left}.pt-advanced-prime-table .cell-inner-center{justify-content:center;text-align:center}.pt-advanced-prime-table .cell-inner-right{justify-content:flex-end;text-align:right}.pt-advanced-prime-table ::ng-deep .p-tag{font-size:.72rem;font-weight:800;padding:.2rem .55rem;line-height:1.2;white-space:nowrap}.pt-advanced-prime-table ::ng-deep .p-tag .p-tag-icon{margin-right:.25rem}.pt-advanced-prime-table .progress-cell{width:100%;min-width:160px;display:flex;align-items:center;gap:.5rem}.pt-advanced-prime-table ::ng-deep .progress-cell .p-progressbar{flex:1;width:100%;min-width:120px;height:.75rem!important;background:#e5e7eb!important;border-radius:999px;overflow:hidden}.pt-advanced-prime-table ::ng-deep .progress-cell .p-progressbar-value{display:block!important;height:100%!important;border-radius:999px}.pt-advanced-prime-table .progress-cell-value{min-width:38px;font-size:.72rem;font-weight:800;color:#334155;text-align:right}.pt-advanced-prime-table ::ng-deep th.action-column,.pt-advanced-prime-table ::ng-deep td.action-column{text-align:center!important;justify-content:center;align-items:center;overflow:hidden;white-space:nowrap;padding:0}.pt-advanced-prime-table ::ng-deep .action-buttons-container{width:100%;display:flex;justify-content:center!important;align-items:center!important;gap:.35rem}.pt-advanced-prime-table ::ng-deep .action-buttons-container .p-button.p-button-rounded.p-button-text{padding:.25rem!important;min-width:22px!important;height:22px!important}.pt-advanced-prime-table ::ng-deep .pt-progress-success .p-progressbar-value{background:#22c55e!important}.pt-advanced-prime-table ::ng-deep .pt-progress-warning .p-progressbar-value{background:#f59e0b!important}.pt-advanced-prime-table ::ng-deep .pt-progress-danger .p-progressbar-value{background:#ef4444!important}.pt-advanced-prime-table ::ng-deep .pt-progress-info .p-progressbar-value{background:#3b82f6!important}\n"] }]
|
|
1135
1186
|
}], propDecorators: { data: [{
|
|
1136
1187
|
type: Input
|
|
1137
1188
|
}], columns: [{
|
|
@@ -1172,6 +1223,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
1172
1223
|
type: Input
|
|
1173
1224
|
}], selection: [{
|
|
1174
1225
|
type: Input
|
|
1226
|
+
}], cellHeight: [{
|
|
1227
|
+
type: Input
|
|
1175
1228
|
}], selectionChange: [{
|
|
1176
1229
|
type: Output
|
|
1177
1230
|
}], rowSelect: [{
|
|
@@ -3827,22 +3880,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
3827
3880
|
}] } });
|
|
3828
3881
|
|
|
3829
3882
|
class PTCardComponent {
|
|
3830
|
-
// Default values as readonly variables
|
|
3831
3883
|
static { this.DEFAULT_TITLE_COLOR = '#333'; }
|
|
3832
3884
|
static { this.DEFAULT_TITLE_FONT_SIZE = '1.5em'; }
|
|
3833
3885
|
static { this.DEFAULT_ICON_COLOR = '#333'; }
|
|
3834
3886
|
static { this.DEFAULT_ICON_FONT_SIZE = '1em'; }
|
|
3835
3887
|
static { this.DEFAULT_ICON_POSITION = 'left'; }
|
|
3836
|
-
static { this.DEFAULT_BACKGROUND_COLOR = '#fff'; }
|
|
3837
|
-
static { this.DEFAULT_WIDTH = '100%'; }
|
|
3838
|
-
static { this.DEFAULT_HEIGHT = 'auto'; }
|
|
3839
3888
|
static { this.DEFAULT_TITLE_POSITION = 'left'; }
|
|
3840
3889
|
static { this.DEFAULT_MENU_POSITION = 'right'; }
|
|
3841
3890
|
static { this.DEFAULT_BORDER_COLOR = '#ddd'; }
|
|
3842
3891
|
static { this.DEFAULT_BORDER_WIDTH = '1px'; }
|
|
3843
|
-
static { this.
|
|
3892
|
+
static { this.DEFAULT_WIDTH = '100%'; }
|
|
3893
|
+
static { this.DEFAULT_HEIGHT = 'auto'; }
|
|
3894
|
+
/**
|
|
3895
|
+
* Padding for the outer card container.
|
|
3896
|
+
*/
|
|
3844
3897
|
static { this.DEFAULT_PADDING = '16px'; }
|
|
3898
|
+
/**
|
|
3899
|
+
* Padding for the projected content area.
|
|
3900
|
+
* Keep it 0 by default to avoid double spacing:
|
|
3901
|
+
* card padding + body padding.
|
|
3902
|
+
*/
|
|
3903
|
+
static { this.DEFAULT_BODY_PADDING = '0'; }
|
|
3845
3904
|
static { this.DEFAULT_MARGIN = '16px 0'; }
|
|
3905
|
+
static { this.DEFAULT_BORDER_RADIUS = '8px'; }
|
|
3906
|
+
static { this.DEFAULT_BOX_SHADOW = '0 2px 4px rgba(0, 0, 0, 0.1)'; }
|
|
3907
|
+
constructor(cd) {
|
|
3908
|
+
this.cd = cd;
|
|
3909
|
+
this.config = {};
|
|
3910
|
+
}
|
|
3846
3911
|
ngAfterViewInit() {
|
|
3847
3912
|
this.logPatternUrl();
|
|
3848
3913
|
}
|
|
@@ -3851,6 +3916,10 @@ class PTCardComponent {
|
|
|
3851
3916
|
console.log(`[PTCardComponent] Identifier: ${this.config.identifier}, Pattern URL: ${this.config.pattern.imageUrl}`);
|
|
3852
3917
|
}
|
|
3853
3918
|
}
|
|
3919
|
+
updateStyles() {
|
|
3920
|
+
this.getCardStyles();
|
|
3921
|
+
this.cd.detectChanges();
|
|
3922
|
+
}
|
|
3854
3923
|
isTitleObject() {
|
|
3855
3924
|
return typeof this.config.title === 'object';
|
|
3856
3925
|
}
|
|
@@ -3875,15 +3944,6 @@ class PTCardComponent {
|
|
|
3875
3944
|
'--text-align': alignMap[title?.position || PTCardComponent.DEFAULT_TITLE_POSITION],
|
|
3876
3945
|
};
|
|
3877
3946
|
}
|
|
3878
|
-
constructor(cd) {
|
|
3879
|
-
this.cd = cd;
|
|
3880
|
-
this.config = {};
|
|
3881
|
-
}
|
|
3882
|
-
updateStyles() {
|
|
3883
|
-
// After data is fetched or updated
|
|
3884
|
-
this.getCardStyles();
|
|
3885
|
-
this.cd.detectChanges(); // Force Angular to detect the changes
|
|
3886
|
-
}
|
|
3887
3947
|
getIconClass() {
|
|
3888
3948
|
const icon = this.config.title?.icon;
|
|
3889
3949
|
return typeof icon === 'string' ? icon : icon?.code || null;
|
|
@@ -3912,45 +3972,35 @@ class PTCardComponent {
|
|
|
3912
3972
|
return this.config.menuPosition || PTCardComponent.DEFAULT_MENU_POSITION;
|
|
3913
3973
|
}
|
|
3914
3974
|
getCardStyles() {
|
|
3915
|
-
// Transparency for the background color
|
|
3916
3975
|
const backgroundTransparency = this.config.transparencyPercentage
|
|
3917
3976
|
? parseFloat(this.config.transparencyPercentage) / 100
|
|
3918
3977
|
: 1;
|
|
3919
|
-
// Transparency for the pattern image
|
|
3920
3978
|
const patternTransparency = this.config.pattern?.transparencyPercentage
|
|
3921
3979
|
? parseFloat(this.config.pattern.transparencyPercentage) / 100
|
|
3922
3980
|
: 1;
|
|
3923
|
-
// Background color with transparency
|
|
3924
3981
|
const backgroundColor = this.config.backgroundColor && this.config.transparencyPercentage !== '0'
|
|
3925
3982
|
? this.hexToRgba(this.config.backgroundColor, backgroundTransparency)
|
|
3926
3983
|
: 'transparent';
|
|
3927
|
-
// Pattern image with transparency applied via linear-gradient
|
|
3928
3984
|
const backgroundImage = this.config.pattern?.imageUrl &&
|
|
3929
3985
|
this.config.pattern.transparencyPercentage !== '0'
|
|
3930
3986
|
? `linear-gradient(rgba(255, 255, 255, ${1 - patternTransparency}), rgba(255, 255, 255, ${1 - patternTransparency})), url('${this.config.pattern.imageUrl}')`
|
|
3931
3987
|
: '';
|
|
3932
3988
|
const patternWidth = this.config.pattern?.width || '100%';
|
|
3933
3989
|
const patternHeight = this.config.pattern?.height || 'auto';
|
|
3934
|
-
// Determine background-repeat value
|
|
3935
3990
|
const repeatX = this.config.pattern?.repeatX ? 'repeat' : 'no-repeat';
|
|
3936
3991
|
const repeatY = this.config.pattern?.repeatY ? 'repeat' : 'no-repeat';
|
|
3937
3992
|
const backgroundRepeat = `${repeatX} ${repeatY}`;
|
|
3938
|
-
|
|
3939
|
-
const repeatCount = this.config.pattern?.repeatCount || 1;
|
|
3940
|
-
const backgroundSize = repeatCount > 1
|
|
3941
|
-
? `${patternWidth} ${patternHeight}`
|
|
3942
|
-
: `${patternWidth} ${patternHeight}`;
|
|
3943
|
-
// Determine background-position based on the position parameter
|
|
3993
|
+
const backgroundSize = `${patternWidth} ${patternHeight}`;
|
|
3944
3994
|
const backgroundPosition = this.config.pattern?.position || 'center';
|
|
3945
3995
|
const justifyContent = this.config.alignContent === 'center' ? 'center' : 'flex-start';
|
|
3946
3996
|
const alignItems = this.config.alignContent === 'center' ? 'center' : 'stretch';
|
|
3947
3997
|
return {
|
|
3948
3998
|
display: 'flex',
|
|
3949
3999
|
flexDirection: 'column',
|
|
3950
|
-
justifyContent,
|
|
3951
|
-
alignItems,
|
|
3952
|
-
backgroundColor,
|
|
3953
|
-
backgroundImage,
|
|
4000
|
+
justifyContent,
|
|
4001
|
+
alignItems,
|
|
4002
|
+
backgroundColor,
|
|
4003
|
+
backgroundImage,
|
|
3954
4004
|
backgroundSize,
|
|
3955
4005
|
backgroundPosition,
|
|
3956
4006
|
backgroundRepeat,
|
|
@@ -3959,23 +4009,14 @@ class PTCardComponent {
|
|
|
3959
4009
|
border: this.config.noBorder
|
|
3960
4010
|
? 'none'
|
|
3961
4011
|
: `solid ${this.config.borderWidth || PTCardComponent.DEFAULT_BORDER_WIDTH} ${this.config.borderColor || PTCardComponent.DEFAULT_BORDER_COLOR}`,
|
|
3962
|
-
padding: this.config.padding
|
|
4012
|
+
padding: this.config.padding ?? PTCardComponent.DEFAULT_PADDING,
|
|
3963
4013
|
margin: this.config.margin || PTCardComponent.DEFAULT_MARGIN,
|
|
3964
|
-
borderRadius: this.config.borderRadius ||
|
|
3965
|
-
boxShadow: this.config.boxShadow ||
|
|
4014
|
+
borderRadius: this.config.borderRadius || PTCardComponent.DEFAULT_BORDER_RADIUS,
|
|
4015
|
+
boxShadow: this.config.boxShadow || PTCardComponent.DEFAULT_BOX_SHADOW,
|
|
3966
4016
|
position: 'relative',
|
|
3967
4017
|
zIndex: this.config.zIndex !== undefined ? this.config.zIndex : 'auto',
|
|
3968
4018
|
};
|
|
3969
4019
|
}
|
|
3970
|
-
// Utility function to convert hex color to rgba
|
|
3971
|
-
hexToRgba(hex, alpha) {
|
|
3972
|
-
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
3973
|
-
hex = hex.replace(shorthandRegex, (_, r, g, b) => r + r + g + g + b + b);
|
|
3974
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
3975
|
-
return result
|
|
3976
|
-
? `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${alpha})`
|
|
3977
|
-
: hex;
|
|
3978
|
-
}
|
|
3979
4020
|
getBodyStyles() {
|
|
3980
4021
|
const justifyContent = this.config.alignBodyContent === 'center' ? 'center' : 'flex-start';
|
|
3981
4022
|
const alignItems = this.config.alignBodyContent === 'center' ? 'center' : 'stretch';
|
|
@@ -3986,7 +4027,7 @@ class PTCardComponent {
|
|
|
3986
4027
|
alignItems,
|
|
3987
4028
|
flexGrow: 1,
|
|
3988
4029
|
maxWidth: '100%',
|
|
3989
|
-
padding:
|
|
4030
|
+
padding: this.config.bodyPadding ?? PTCardComponent.DEFAULT_BODY_PADDING,
|
|
3990
4031
|
boxSizing: 'border-box',
|
|
3991
4032
|
overflowX: this.isScrollableHorizontal() ? 'auto' : 'hidden',
|
|
3992
4033
|
overflowY: this.isScrollableVertical() ? 'auto' : 'hidden',
|
|
@@ -3999,7 +4040,7 @@ class PTCardComponent {
|
|
|
3999
4040
|
display: 'flex',
|
|
4000
4041
|
justifyContent,
|
|
4001
4042
|
alignItems,
|
|
4002
|
-
marginBottom: '16px',
|
|
4043
|
+
marginBottom: '16px',
|
|
4003
4044
|
position: 'relative',
|
|
4004
4045
|
};
|
|
4005
4046
|
}
|
|
@@ -4018,12 +4059,20 @@ class PTCardComponent {
|
|
|
4018
4059
|
getHeaderClass() {
|
|
4019
4060
|
return this.config.alignHeaderContent === 'center' ? 'center-align' : '';
|
|
4020
4061
|
}
|
|
4062
|
+
hexToRgba(hex, alpha) {
|
|
4063
|
+
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
4064
|
+
hex = hex.replace(shorthandRegex, (_, r, g, b) => r + r + g + g + b + b);
|
|
4065
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
4066
|
+
return result
|
|
4067
|
+
? `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${alpha})`
|
|
4068
|
+
: hex;
|
|
4069
|
+
}
|
|
4021
4070
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTCardComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4022
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTCardComponent, isStandalone: false, selector: "pt-card", inputs: { config: "config" }, ngImport: i0, template: "<div\n class=\"pt-card card\"\n [ngClass]=\"getCardClass()\"\n [attr.id]=\"config.identifier\"\n [ngStyle]=\"getCardStyles()\"\n
|
|
4071
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTCardComponent, isStandalone: false, selector: "pt-card", inputs: { config: "config" }, ngImport: i0, template: "<div\n class=\"pt-card card\"\n [ngClass]=\"getCardClass()\"\n [attr.id]=\"config.identifier\"\n [ngStyle]=\"getCardStyles()\"\n>\n <!-- Card Header -->\n @if (hasTitle()) {\n <div\n class=\"card-header\"\n [ngClass]=\"getHeaderClass()\"\n [ngStyle]=\"getHeaderStyles()\"\n >\n @if (getIconClass() && getIconPosition() === \"left\") {\n <i\n class=\"card-header-icon-left\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n }\n\n <span class=\"card-title\">\n {{ getTitleText() }}\n </span>\n\n @if (getIconClass() && getIconPosition() === \"right\") {\n <i\n class=\"card-header-icon-right\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n }\n\n @if (config.menu) {\n <pt-menu\n class=\"card-menu\"\n [config]=\"config.menu\"\n [ngClass]=\"{\n 'menu-left': getMenuPosition() === 'left',\n 'menu-right': getMenuPosition() === 'right',\n }\"\n ></pt-menu>\n }\n </div>\n }\n\n <!-- Card Body -->\n <div class=\"card-body\" [ngClass]=\"getBodyClass()\" [ngStyle]=\"getBodyStyles()\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".pt-card .card{display:flex;flex-direction:column;padding:16px;margin:0 auto;max-height:100vh;max-width:100%;overflow:hidden;position:relative;box-sizing:border-box;justify-content:flex-start;align-items:stretch;background-color:transparent}.pt-card .card.center-align{justify-content:center;align-items:center}.pt-card .card:after{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-size:cover;background-position:center;pointer-events:none;background-color:var( --background-color, rgba(255, 255, 255, 0) );background-image:var( --background-image-url, none );opacity:var(--image-opacity, 1);z-index:-1}.pt-card .card-body{display:flex;flex-direction:column;flex-grow:1;max-width:100%;z-index:1;padding:0;box-sizing:border-box;justify-content:flex-start;align-items:stretch}.pt-card .card-body.center-align{justify-content:center;align-items:center}.pt-card .card-header{margin-bottom:16px;display:flex;position:relative;justify-content:flex-start;align-items:stretch}.pt-card .card-header.center-align{justify-content:center;align-items:center}.pt-card .card-header-icon-left{margin-right:6px}.pt-card .card-header-icon-right{margin-left:6px}.pt-card .menu-left{position:absolute;left:0;top:0}.pt-card .menu-right{position:absolute;right:0;top:-2px}.pt-card .card-menu{margin-left:auto;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PTMenuComponent, selector: "pt-menu", inputs: ["config"] }] }); }
|
|
4023
4072
|
}
|
|
4024
4073
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTCardComponent, decorators: [{
|
|
4025
4074
|
type: Component,
|
|
4026
|
-
args: [{ selector: 'pt-card', standalone: false, template: "<div\n class=\"pt-card card\"\n [ngClass]=\"getCardClass()\"\n [attr.id]=\"config.identifier\"\n [ngStyle]=\"getCardStyles()\"\n
|
|
4075
|
+
args: [{ selector: 'pt-card', standalone: false, template: "<div\n class=\"pt-card card\"\n [ngClass]=\"getCardClass()\"\n [attr.id]=\"config.identifier\"\n [ngStyle]=\"getCardStyles()\"\n>\n <!-- Card Header -->\n @if (hasTitle()) {\n <div\n class=\"card-header\"\n [ngClass]=\"getHeaderClass()\"\n [ngStyle]=\"getHeaderStyles()\"\n >\n @if (getIconClass() && getIconPosition() === \"left\") {\n <i\n class=\"card-header-icon-left\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n }\n\n <span class=\"card-title\">\n {{ getTitleText() }}\n </span>\n\n @if (getIconClass() && getIconPosition() === \"right\") {\n <i\n class=\"card-header-icon-right\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n }\n\n @if (config.menu) {\n <pt-menu\n class=\"card-menu\"\n [config]=\"config.menu\"\n [ngClass]=\"{\n 'menu-left': getMenuPosition() === 'left',\n 'menu-right': getMenuPosition() === 'right',\n }\"\n ></pt-menu>\n }\n </div>\n }\n\n <!-- Card Body -->\n <div class=\"card-body\" [ngClass]=\"getBodyClass()\" [ngStyle]=\"getBodyStyles()\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".pt-card .card{display:flex;flex-direction:column;padding:16px;margin:0 auto;max-height:100vh;max-width:100%;overflow:hidden;position:relative;box-sizing:border-box;justify-content:flex-start;align-items:stretch;background-color:transparent}.pt-card .card.center-align{justify-content:center;align-items:center}.pt-card .card:after{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-size:cover;background-position:center;pointer-events:none;background-color:var( --background-color, rgba(255, 255, 255, 0) );background-image:var( --background-image-url, none );opacity:var(--image-opacity, 1);z-index:-1}.pt-card .card-body{display:flex;flex-direction:column;flex-grow:1;max-width:100%;z-index:1;padding:0;box-sizing:border-box;justify-content:flex-start;align-items:stretch}.pt-card .card-body.center-align{justify-content:center;align-items:center}.pt-card .card-header{margin-bottom:16px;display:flex;position:relative;justify-content:flex-start;align-items:stretch}.pt-card .card-header.center-align{justify-content:center;align-items:center}.pt-card .card-header-icon-left{margin-right:6px}.pt-card .card-header-icon-right{margin-left:6px}.pt-card .menu-left{position:absolute;left:0;top:0}.pt-card .menu-right{position:absolute;right:0;top:-2px}.pt-card .card-menu{margin-left:auto;cursor:pointer}\n"] }]
|
|
4027
4076
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { config: [{
|
|
4028
4077
|
type: Input
|
|
4029
4078
|
}] } });
|
|
@@ -4161,20 +4210,23 @@ class PTNavbarMenuComponent {
|
|
|
4161
4210
|
constructor() {
|
|
4162
4211
|
this.navBarMenuConfig = {};
|
|
4163
4212
|
this.toggleSidebar = new EventEmitter();
|
|
4213
|
+
/**
|
|
4214
|
+
* Emitted when the user clicks the Profile item from the user menu.
|
|
4215
|
+
*/
|
|
4216
|
+
this.userClick = new EventEmitter();
|
|
4217
|
+
/**
|
|
4218
|
+
* Emitted when the user clicks the Logout item from the user menu.
|
|
4219
|
+
*/
|
|
4220
|
+
this.logoutClick = new EventEmitter();
|
|
4164
4221
|
this.destroy$ = new Subject();
|
|
4165
4222
|
this.dateTimeText = '';
|
|
4166
|
-
|
|
4223
|
+
this.isUserMenuOpen = false;
|
|
4167
4224
|
this.dateFormat = 'dd/MM/YYYY';
|
|
4168
4225
|
this.timeFormat = 'HH:mm:ss';
|
|
4169
|
-
/** FIXED mode base */
|
|
4170
4226
|
this.fixedStart = new Date();
|
|
4171
4227
|
this.fixedSetAt = new Date();
|
|
4172
|
-
/** used only in FIXED mode */
|
|
4173
4228
|
this.manualDateTimeLocal = this.toDateTimeLocalValue(new Date());
|
|
4174
4229
|
}
|
|
4175
|
-
// =========================
|
|
4176
|
-
// Defaults (existing)
|
|
4177
|
-
// =========================
|
|
4178
4230
|
static { this.DEFAULT_LOGO_URL = ''; }
|
|
4179
4231
|
static { this.DEFAULT_LOGO_ALT_TEXT = 'Logo'; }
|
|
4180
4232
|
static { this.DEFAULT_LOGO_WIDTH = '40px'; }
|
|
@@ -4186,9 +4238,6 @@ class PTNavbarMenuComponent {
|
|
|
4186
4238
|
static { this.DEFAULT_ICON_COLOR = '#333'; }
|
|
4187
4239
|
static { this.DEFAULT_TOGGLE_BUTTON_ICON = 'pi pi-bars'; }
|
|
4188
4240
|
static { this.DEFAULT_TOGGLE_BUTTON_COLOR = '#333'; }
|
|
4189
|
-
// =========================
|
|
4190
|
-
// Lifecycle
|
|
4191
|
-
// =========================
|
|
4192
4241
|
ngOnInit() {
|
|
4193
4242
|
this.applyConfigFormatsAndFixedBase();
|
|
4194
4243
|
interval(1000)
|
|
@@ -4197,11 +4246,9 @@ class PTNavbarMenuComponent {
|
|
|
4197
4246
|
this.refreshDateTime();
|
|
4198
4247
|
}
|
|
4199
4248
|
ngOnChanges(changes) {
|
|
4200
|
-
// If config changes: update formats and fixed base if needed.
|
|
4201
4249
|
if (changes['navBarMenuConfig']) {
|
|
4202
4250
|
this.applyConfigFormatsAndFixedBase();
|
|
4203
4251
|
}
|
|
4204
|
-
// If serverDateTime changes: just refresh display
|
|
4205
4252
|
if (changes['serverDateTime'] || changes['navBarMenuConfig']) {
|
|
4206
4253
|
this.refreshDateTime();
|
|
4207
4254
|
}
|
|
@@ -4210,17 +4257,21 @@ class PTNavbarMenuComponent {
|
|
|
4210
4257
|
this.destroy$.next();
|
|
4211
4258
|
this.destroy$.complete();
|
|
4212
4259
|
}
|
|
4260
|
+
closeUserMenu() {
|
|
4261
|
+
this.isUserMenuOpen = false;
|
|
4262
|
+
}
|
|
4213
4263
|
applyConfigFormatsAndFixedBase() {
|
|
4214
|
-
if (!this.hasDateTime())
|
|
4264
|
+
if (!this.hasDateTime()) {
|
|
4215
4265
|
return;
|
|
4266
|
+
}
|
|
4216
4267
|
const dtCfg = this.navBarMenuConfig.dateTime;
|
|
4217
4268
|
this.dateFormat = (dtCfg?.dateFormat ?? 'dd/MM/YYYY');
|
|
4218
4269
|
this.timeFormat = (dtCfg?.timeFormat ?? 'HH:mm:ss');
|
|
4219
|
-
// If fixed mode: re-init base from config (only once per config change)
|
|
4220
4270
|
if (this.isFixedMode()) {
|
|
4221
4271
|
const base = this.buildFixedBaseDateFromConfig();
|
|
4222
|
-
if (base)
|
|
4272
|
+
if (base) {
|
|
4223
4273
|
this.setFixedDateTime(base);
|
|
4274
|
+
}
|
|
4224
4275
|
}
|
|
4225
4276
|
}
|
|
4226
4277
|
// =========================
|
|
@@ -4239,8 +4290,9 @@ class PTNavbarMenuComponent {
|
|
|
4239
4290
|
onManualDateTimeChange(value) {
|
|
4240
4291
|
this.manualDateTimeLocal = value;
|
|
4241
4292
|
const dt = this.fromDateTimeLocalValue(value);
|
|
4242
|
-
if (dt)
|
|
4293
|
+
if (dt) {
|
|
4243
4294
|
this.setFixedDateTime(dt);
|
|
4295
|
+
}
|
|
4244
4296
|
this.refreshDateTime();
|
|
4245
4297
|
}
|
|
4246
4298
|
getDateTimePositionClass() {
|
|
@@ -4249,38 +4301,34 @@ class PTNavbarMenuComponent {
|
|
|
4249
4301
|
}
|
|
4250
4302
|
refreshDateTime() {
|
|
4251
4303
|
const now = new Date();
|
|
4252
|
-
// 1) FIXED mode (client computed)
|
|
4253
4304
|
if (this.isFixedMode()) {
|
|
4254
4305
|
const displayDate = new Date(this.fixedStart.getTime() + (now.getTime() - this.fixedSetAt.getTime()));
|
|
4255
4306
|
this.dateTimeText = this.formatDateTime(displayDate, this.dateFormat, this.timeFormat);
|
|
4256
4307
|
return;
|
|
4257
4308
|
}
|
|
4258
|
-
// 2) SERVER mode (strict): if not provided => placeholders (no client fallback)
|
|
4259
4309
|
if (this.isServerMode()) {
|
|
4260
4310
|
const formatted = this.normalizeServerDateTime(this.serverDateTime);
|
|
4261
4311
|
this.dateTimeText = formatted ?? this.getServerPlaceholder();
|
|
4262
4312
|
return;
|
|
4263
4313
|
}
|
|
4264
|
-
// 3) CLIENT mode
|
|
4265
4314
|
this.dateTimeText = this.formatDateTime(now, this.dateFormat, this.timeFormat);
|
|
4266
4315
|
}
|
|
4267
4316
|
normalizeServerDateTime(v) {
|
|
4268
|
-
if (!v)
|
|
4317
|
+
if (!v) {
|
|
4269
4318
|
return null;
|
|
4319
|
+
}
|
|
4270
4320
|
if (typeof v === 'string') {
|
|
4271
4321
|
const s = v.trim();
|
|
4272
4322
|
return s ? s : null;
|
|
4273
4323
|
}
|
|
4274
4324
|
const date = (v.date ?? '').trim();
|
|
4275
4325
|
const time = (v.time ?? '').trim();
|
|
4276
|
-
if (!date || !time)
|
|
4326
|
+
if (!date || !time) {
|
|
4277
4327
|
return null;
|
|
4328
|
+
}
|
|
4278
4329
|
return `${date} ${time}`.trim();
|
|
4279
4330
|
}
|
|
4280
|
-
/** ✅ NEW: placeholder that respects selected timeFormat */
|
|
4281
4331
|
getServerPlaceholder() {
|
|
4282
|
-
// You asked explicitly: "--/--/-- --:--:--"
|
|
4283
|
-
// We'll keep date placeholder fixed as --/--/-- and adapt time to HH:mm vs HH:mm:ss
|
|
4284
4332
|
const datePh = '--/--/--';
|
|
4285
4333
|
const timePh = this.timeFormat === 'HH:mm' ? '--:--' : '--:--:--';
|
|
4286
4334
|
return `${datePh} ${timePh}`.trim();
|
|
@@ -4292,12 +4340,14 @@ class PTNavbarMenuComponent {
|
|
|
4292
4340
|
}
|
|
4293
4341
|
buildFixedBaseDateFromConfig() {
|
|
4294
4342
|
const dateValue = this.navBarMenuConfig.dateTime?.dateValue;
|
|
4295
|
-
if (!dateValue)
|
|
4343
|
+
if (!dateValue) {
|
|
4296
4344
|
return null;
|
|
4345
|
+
}
|
|
4297
4346
|
const timeSource = this.fromDateTimeLocalValue(this.manualDateTimeLocal) ?? new Date();
|
|
4298
4347
|
const parsedDate = this.parseDateByFormat(dateValue, this.dateFormat);
|
|
4299
|
-
if (!parsedDate)
|
|
4348
|
+
if (!parsedDate) {
|
|
4300
4349
|
return null;
|
|
4350
|
+
}
|
|
4301
4351
|
parsedDate.setHours(timeSource.getHours(), timeSource.getMinutes(), timeSource.getSeconds(), 0);
|
|
4302
4352
|
return parsedDate;
|
|
4303
4353
|
}
|
|
@@ -4305,20 +4355,23 @@ class PTNavbarMenuComponent {
|
|
|
4305
4355
|
try {
|
|
4306
4356
|
if (fmt === 'dd/MM/YYYY') {
|
|
4307
4357
|
const [dd, MM, YYYY] = value.split('/').map(Number);
|
|
4308
|
-
if (!dd || !MM || !YYYY)
|
|
4358
|
+
if (!dd || !MM || !YYYY) {
|
|
4309
4359
|
return null;
|
|
4360
|
+
}
|
|
4310
4361
|
return new Date(YYYY, MM - 1, dd);
|
|
4311
4362
|
}
|
|
4312
4363
|
if (fmt === 'MM/dd/YYYY') {
|
|
4313
4364
|
const [MM, dd, YYYY] = value.split('/').map(Number);
|
|
4314
|
-
if (!dd || !MM || !YYYY)
|
|
4365
|
+
if (!dd || !MM || !YYYY) {
|
|
4315
4366
|
return null;
|
|
4367
|
+
}
|
|
4316
4368
|
return new Date(YYYY, MM - 1, dd);
|
|
4317
4369
|
}
|
|
4318
4370
|
if (fmt === 'YYYY-MM-dd') {
|
|
4319
4371
|
const [YYYY, MM, dd] = value.split('-').map(Number);
|
|
4320
|
-
if (!dd || !MM || !YYYY)
|
|
4372
|
+
if (!dd || !MM || !YYYY) {
|
|
4321
4373
|
return null;
|
|
4374
|
+
}
|
|
4322
4375
|
return new Date(YYYY, MM - 1, dd);
|
|
4323
4376
|
}
|
|
4324
4377
|
return null;
|
|
@@ -4328,7 +4381,83 @@ class PTNavbarMenuComponent {
|
|
|
4328
4381
|
}
|
|
4329
4382
|
}
|
|
4330
4383
|
// =========================
|
|
4331
|
-
//
|
|
4384
|
+
// User profile helpers
|
|
4385
|
+
// =========================
|
|
4386
|
+
hasUser() {
|
|
4387
|
+
return !!this.navBarMenuConfig.user;
|
|
4388
|
+
}
|
|
4389
|
+
toggleUserMenu() {
|
|
4390
|
+
this.isUserMenuOpen = !this.isUserMenuOpen;
|
|
4391
|
+
}
|
|
4392
|
+
isInitialsAvatar() {
|
|
4393
|
+
return this.navBarMenuConfig.user?.avatarMode === 'INITIALS';
|
|
4394
|
+
}
|
|
4395
|
+
showProfileInMenu() {
|
|
4396
|
+
return this.navBarMenuConfig.user?.showProfileInMenu !== false;
|
|
4397
|
+
}
|
|
4398
|
+
showProfileLeftOfAvatar() {
|
|
4399
|
+
return this.navBarMenuConfig.user?.profilePosition === 'LEFT_OF_AVATAR';
|
|
4400
|
+
}
|
|
4401
|
+
getUsername() {
|
|
4402
|
+
return this.navBarMenuConfig.user?.username?.trim() || '-';
|
|
4403
|
+
}
|
|
4404
|
+
getUserFullName() {
|
|
4405
|
+
const configuredFullName = this.navBarMenuConfig.user?.fullName?.trim();
|
|
4406
|
+
if (configuredFullName) {
|
|
4407
|
+
return configuredFullName;
|
|
4408
|
+
}
|
|
4409
|
+
const firstName = this.navBarMenuConfig.user?.firstName?.trim() || '';
|
|
4410
|
+
const lastName = this.navBarMenuConfig.user?.lastName?.trim() || '';
|
|
4411
|
+
const fullName = `${firstName} ${lastName}`.trim();
|
|
4412
|
+
return fullName || this.getUsername();
|
|
4413
|
+
}
|
|
4414
|
+
getUserInitials() {
|
|
4415
|
+
const firstName = this.navBarMenuConfig.user?.firstName?.trim() || '';
|
|
4416
|
+
const lastName = this.navBarMenuConfig.user?.lastName?.trim() || '';
|
|
4417
|
+
const firstInitial = firstName.charAt(0);
|
|
4418
|
+
const lastInitial = lastName.charAt(0);
|
|
4419
|
+
const initials = `${firstInitial}${lastInitial}`.toUpperCase();
|
|
4420
|
+
if (initials) {
|
|
4421
|
+
return initials;
|
|
4422
|
+
}
|
|
4423
|
+
const fullNameParts = this.getUserFullName()
|
|
4424
|
+
.split(' ')
|
|
4425
|
+
.map((item) => item.trim())
|
|
4426
|
+
.filter(Boolean);
|
|
4427
|
+
if (fullNameParts.length >= 2) {
|
|
4428
|
+
return `${fullNameParts[0].charAt(0)}${fullNameParts[1].charAt(0)}`.toUpperCase();
|
|
4429
|
+
}
|
|
4430
|
+
const usernameInitial = this.getUsername().charAt(0).toUpperCase();
|
|
4431
|
+
return usernameInitial || '?';
|
|
4432
|
+
}
|
|
4433
|
+
getUserProfile() {
|
|
4434
|
+
return this.navBarMenuConfig.user?.profile?.trim() || '-';
|
|
4435
|
+
}
|
|
4436
|
+
getUserAvatarStyles() {
|
|
4437
|
+
return {
|
|
4438
|
+
backgroundColor: this.navBarMenuConfig.user?.avatarBackgroundColor ?? '#eff6ff',
|
|
4439
|
+
color: this.navBarMenuConfig.user?.avatarTextColor ?? '#2563eb',
|
|
4440
|
+
borderColor: this.navBarMenuConfig.user?.avatarBorderColor ?? '#bfdbfe',
|
|
4441
|
+
};
|
|
4442
|
+
}
|
|
4443
|
+
getUserProfileTextStyles() {
|
|
4444
|
+
const style = this.navBarMenuConfig.user?.profileTextStyle;
|
|
4445
|
+
return {
|
|
4446
|
+
color: style?.color ?? '#2563eb',
|
|
4447
|
+
fontSize: style?.fontSize ?? '0.8rem',
|
|
4448
|
+
fontWeight: style?.fontWeight ?? '700',
|
|
4449
|
+
};
|
|
4450
|
+
}
|
|
4451
|
+
onUserProfileClick() {
|
|
4452
|
+
this.isUserMenuOpen = false;
|
|
4453
|
+
this.userClick.emit();
|
|
4454
|
+
}
|
|
4455
|
+
onUserLogoutClick() {
|
|
4456
|
+
this.isUserMenuOpen = false;
|
|
4457
|
+
this.logoutClick.emit();
|
|
4458
|
+
}
|
|
4459
|
+
// =========================
|
|
4460
|
+
// Formatting utils
|
|
4332
4461
|
// =========================
|
|
4333
4462
|
pad2(n) {
|
|
4334
4463
|
return String(n).padStart(2, '0');
|
|
@@ -4363,13 +4492,14 @@ class PTNavbarMenuComponent {
|
|
|
4363
4492
|
return `${yyyy}-${MM}-${dd}T${HH}:${mm}:${ss}`;
|
|
4364
4493
|
}
|
|
4365
4494
|
fromDateTimeLocalValue(value) {
|
|
4366
|
-
if (!value)
|
|
4495
|
+
if (!value) {
|
|
4367
4496
|
return null;
|
|
4497
|
+
}
|
|
4368
4498
|
const dt = new Date(value);
|
|
4369
4499
|
return isNaN(dt.getTime()) ? null : dt;
|
|
4370
4500
|
}
|
|
4371
4501
|
// =========================
|
|
4372
|
-
// Existing
|
|
4502
|
+
// Existing navbar helpers
|
|
4373
4503
|
// =========================
|
|
4374
4504
|
isImageStyle(object) {
|
|
4375
4505
|
return typeof object === 'object' && 'imageUrl' in object;
|
|
@@ -4468,17 +4598,24 @@ class PTNavbarMenuComponent {
|
|
|
4468
4598
|
};
|
|
4469
4599
|
}
|
|
4470
4600
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTNavbarMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4471
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTNavbarMenuComponent, isStandalone: false, selector: "pt-nav-bar-menu", inputs: { navBarMenuConfig: "navBarMenuConfig", serverDateTime: "serverDateTime" }, outputs: { toggleSidebar: "toggleSidebar" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"pt-nav-bar-menu\" [ngStyle]=\"getNavbarStyles()\">\n <!-- LEFT -->\n <div class=\"navbar-left\">\n <a\n [routerLink]=\"\n isImageStyle(navBarMenuConfig.logo)\n ? navBarMenuConfig.logo.routerLink\n : '/'\n \"\n class=\"logo-link\"\n >\n <img\n [src]=\"getLogoUrl()\"\n [alt]=\"getLogoAltText()\"\n [ngStyle]=\"getLogoStyles()\"\n class=\"navbar-logo\"\n />\n <span class=\"navbar-title\" [ngStyle]=\"getAppNameStyles()\">\n {{ getAppName() }}\n </span>\n </a>\n\n <a (click)=\"toggleMenu()\" class=\"toggle-btn\">\n <i\n [class]=\"getToggleButtonIcon()\"\n [ngStyle]=\"getToggleButtonStyles()\"\n ></i>\n </a>\n </div>\n\n <!-- \u2705 MIDDLE (DateTime) -->\n <!-- Always visible when enabled, even if server value missing (will show placeholders). -->\n @if (hasDateTime()) {\n <div\n class=\"navbar-middle\"\n [ngClass]=\"getDateTimePositionClass()\"\n >\n <div class=\"navbar-datetime\">\n <span class=\"dt-value\" [ngStyle]=\"getDateTimeTextStyles()\">\n {{ dateTimeText }}\n </span>\n <!-- Manual fixed datetime (only if config has dateValue => FIXED mode) -->\n @if (isFixedMode()) {\n <input\n class=\"dt-input\"\n type=\"datetime-local\"\n step=\"1\"\n [value]=\"manualDateTimeLocal\"\n (input)=\"onManualDateTimeChange($any($event.target).value)\"\n />\n }\n </div>\n </div>\n }\n\n <!-- RIGHT -->\n <div class=\"navbar-actions\">\n <div class=\"navbar-right\">\n @for (menuConfig of navBarMenuConfig.menus; track menuConfig) {\n <pt-menu-fancy\n [config]=\"menuConfig\"\n ></pt-menu-fancy>\n }\n </div>\n </div>\n</div>\n", styles: [".pt-nav-bar-menu{display:flex;align-items:center;justify-content:space-between;padding:10px;border-bottom:1px solid #ddd;background-color:#fff;background-size:cover;background-position:center;gap:12px;min-width:0}.pt-nav-bar-menu .navbar-left{display:flex;align-items:center;gap:12px;min-width:0;flex:0 0 auto}.pt-nav-bar-menu .logo-link{display:flex;align-items:center;text-decoration:none;color:inherit;min-width:0}.pt-nav-bar-menu .navbar-logo{margin-left:10px;margin-right:20px}.pt-nav-bar-menu .navbar-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-middle{flex:1 1 auto;display:flex;align-items:center;min-width:0;padding:0 12px}.pt-nav-bar-menu .navbar-middle.dt-pos-left{justify-content:flex-start}.pt-nav-bar-menu .navbar-middle.dt-pos-center{justify-content:center}.pt-nav-bar-menu .navbar-middle.dt-pos-right{justify-content:flex-end}.pt-nav-bar-menu .navbar-datetime{display:inline-flex;align-items:center;gap:10px;flex:0 0 auto;white-space:nowrap;max-width:100%}.pt-nav-bar-menu .navbar-datetime .dt-value{white-space:nowrap}.pt-nav-bar-menu .navbar-datetime .dt-input{height:32px;padding:0 8px;border:1px solid rgba(0,0,0,.18);border-radius:6px;background:#fff;font-size:12px;color:#333;outline:none}.pt-nav-bar-menu .navbar-datetime .dt-input:focus{border-color:#034c83b3;box-shadow:0 0 0 3px #034c831f}.pt-nav-bar-menu .navbar-actions{display:flex;align-items:center;gap:12px;flex:0 0 auto;min-width:0}.pt-nav-bar-menu .navbar-right{display:flex;align-items:center;gap:10px;flex:0 0 auto}.pt-nav-bar-menu .navbar-right a{margin-left:20px;color:#333;text-decoration:none;font-size:20px;cursor:pointer}.pt-nav-bar-menu .navbar-right a:hover{color:#000}.pt-nav-bar-menu .toggle-btn{margin-left:2rem;cursor:pointer;padding:7px;border-radius:6px}.pt-nav-bar-menu .toggle-btn>.pi.pi-bars{font-size:1.5rem;color:#333}.pt-nav-bar-menu .toggle-btn:hover{background-color:#f1f1f1}@media(max-width:900px){.pt-nav-bar-menu{flex-wrap:wrap;row-gap:8px}.pt-nav-bar-menu .navbar-left{width:100%;justify-content:space-between}.pt-nav-bar-menu .navbar-middle{width:100%;padding:0;justify-content:flex-start}.pt-nav-bar-menu .navbar-middle.dt-pos-right .navbar-datetime,.pt-nav-bar-menu .navbar-middle.dt-pos-center .navbar-datetime{padding-left:0;border-left:none}.pt-nav-bar-menu .navbar-actions{width:100%;justify-content:flex-end}}@media(max-width:520px){.pt-nav-bar-menu .navbar-datetime .dt-value{display:none}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: PTMenuFancyComponent, selector: "pt-menu-fancy", inputs: ["config"] }] }); }
|
|
4601
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTNavbarMenuComponent, isStandalone: false, selector: "pt-nav-bar-menu", inputs: { navBarMenuConfig: "navBarMenuConfig", serverDateTime: "serverDateTime" }, outputs: { toggleSidebar: "toggleSidebar", userClick: "userClick", logoutClick: "logoutClick" }, host: { listeners: { "document:click": "closeUserMenu()" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"pt-nav-bar-menu\" [ngStyle]=\"getNavbarStyles()\">\n <!-- LEFT -->\n <div class=\"navbar-left\">\n <a\n [routerLink]=\"\n isImageStyle(navBarMenuConfig.logo)\n ? navBarMenuConfig.logo.routerLink\n : '/'\n \"\n class=\"logo-link\"\n >\n <img\n [src]=\"getLogoUrl()\"\n [alt]=\"getLogoAltText()\"\n [ngStyle]=\"getLogoStyles()\"\n class=\"navbar-logo\"\n />\n\n <span class=\"navbar-title\" [ngStyle]=\"getAppNameStyles()\">\n {{ getAppName() }}\n </span>\n </a>\n\n <a (click)=\"toggleMenu()\" class=\"toggle-btn\">\n <i\n [class]=\"getToggleButtonIcon()\"\n [ngStyle]=\"getToggleButtonStyles()\"\n ></i>\n </a>\n </div>\n\n <!-- MIDDLE DateTime -->\n @if (hasDateTime()) {\n <div class=\"navbar-middle\" [ngClass]=\"getDateTimePositionClass()\">\n <div class=\"navbar-datetime\">\n <span class=\"dt-value\" [ngStyle]=\"getDateTimeTextStyles()\">\n {{ dateTimeText }}\n </span>\n\n @if (isFixedMode()) {\n <input\n class=\"dt-input\"\n type=\"datetime-local\"\n step=\"1\"\n [value]=\"manualDateTimeLocal\"\n (input)=\"onManualDateTimeChange($any($event.target).value)\"\n />\n }\n </div>\n </div>\n }\n\n <!-- RIGHT -->\n <div class=\"navbar-actions\">\n <div class=\"navbar-right\">\n @for (menuConfig of navBarMenuConfig.menus; track menuConfig) {\n <pt-menu-fancy [config]=\"menuConfig\"></pt-menu-fancy>\n }\n </div>\n\n @if (hasUser()) {\n <div class=\"navbar-user\" (click)=\"$event.stopPropagation()\">\n @if (showProfileLeftOfAvatar()) {\n <div\n class=\"navbar-user-profile-left\"\n [ngStyle]=\"getUserProfileTextStyles()\"\n >\n {{ getUserProfile() }}\n </div>\n }\n\n <button\n type=\"button\"\n class=\"navbar-user-trigger\"\n (click)=\"toggleUserMenu()\"\n >\n <div class=\"navbar-user-avatar\" [ngStyle]=\"getUserAvatarStyles()\">\n @if (isInitialsAvatar()) {\n <span>{{ getUserInitials() }}</span>\n } @else {\n <i class=\"fa fa-user\"></i>\n }\n </div>\n </button>\n\n @if (isUserMenuOpen) {\n <div class=\"navbar-user-menu\">\n <div class=\"navbar-user-menu-header\">\n <div\n class=\"navbar-user-menu-avatar\"\n [ngStyle]=\"getUserAvatarStyles()\"\n >\n @if (isInitialsAvatar()) {\n <span>{{ getUserInitials() }}</span>\n } @else {\n <i class=\"fa fa-user\"></i>\n }\n </div>\n\n <div class=\"navbar-user-menu-identity\">\n <div class=\"navbar-user-menu-name\">\n {{ getUserFullName() }}\n </div>\n\n @if (showProfileInMenu()) {\n <div\n class=\"navbar-user-menu-profile\"\n [ngStyle]=\"getUserProfileTextStyles()\"\n >\n {{ getUserProfile() }}\n </div>\n }\n\n <div class=\"navbar-user-menu-username\">\n {{ getUsername() }}\n </div>\n </div>\n </div>\n\n <div class=\"navbar-user-menu-separator\"></div>\n\n <button\n type=\"button\"\n class=\"navbar-user-menu-item\"\n (click)=\"onUserProfileClick()\"\n >\n <i class=\"fa fa-user\"></i>\n <span>Profil</span>\n </button>\n\n <button\n type=\"button\"\n class=\"navbar-user-menu-item danger\"\n (click)=\"onUserLogoutClick()\"\n >\n <i class=\"fa fa-sign-out-alt\"></i>\n <span>D\u00E9connexion</span>\n </button>\n </div>\n }\n </div>\n }\n </div>\n</div>\n", styles: [".pt-nav-bar-menu{display:flex;align-items:center;justify-content:space-between;padding-right:10px;padding-left:10px;border-bottom:1px solid #ddd;background-color:#fff;background-size:cover;background-position:center;gap:12px;min-width:0;width:100%;box-sizing:border-box}.pt-nav-bar-menu .navbar-left{display:flex;align-items:center;gap:12px;min-width:0;flex:0 0 auto}.pt-nav-bar-menu .logo-link{display:flex;align-items:center;text-decoration:none;color:inherit;min-width:0}.pt-nav-bar-menu .navbar-logo{margin-left:10px;margin-right:20px}.pt-nav-bar-menu .navbar-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-middle{flex:1 1 auto;display:flex;align-items:center;min-width:0;padding:0 12px}.pt-nav-bar-menu .navbar-middle.dt-pos-left{justify-content:flex-start}.pt-nav-bar-menu .navbar-middle.dt-pos-center{justify-content:center}.pt-nav-bar-menu .navbar-middle.dt-pos-right{justify-content:flex-end}.pt-nav-bar-menu .navbar-datetime{display:inline-flex;align-items:center;gap:10px;flex:0 0 auto;white-space:nowrap;max-width:100%}.pt-nav-bar-menu .navbar-datetime .dt-value{white-space:nowrap}.pt-nav-bar-menu .navbar-datetime .dt-input{height:32px;padding:0 8px;border:1px solid rgba(0,0,0,.18);border-radius:6px;background:#fff;font-size:12px;color:#333;outline:none}.pt-nav-bar-menu .navbar-datetime .dt-input:focus{border-color:#034c83b3;box-shadow:0 0 0 3px #034c831f}.pt-nav-bar-menu .navbar-actions{display:flex;align-items:center;gap:12px;flex:0 0 auto;min-width:0}.pt-nav-bar-menu .navbar-right{display:flex;align-items:center;gap:10px;flex:0 0 auto}.pt-nav-bar-menu .navbar-right a{margin-left:20px;color:#333;text-decoration:none;font-size:20px;cursor:pointer}.pt-nav-bar-menu .navbar-right a:hover{color:#000}.pt-nav-bar-menu .toggle-btn{margin-left:2rem;cursor:pointer;padding:7px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center}.pt-nav-bar-menu .toggle-btn>.pi.pi-bars{font-size:1.5rem;color:#333}.pt-nav-bar-menu .toggle-btn:hover{background-color:#f1f1f1}.pt-nav-bar-menu .navbar-user{position:relative;display:flex;align-items:center;gap:.65rem;flex:0 0 auto}.pt-nav-bar-menu .navbar-user-profile-left{max-width:170px;color:#334155;font-size:.82rem;font-weight:700;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:.28rem .65rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-user-trigger{border:none;background:transparent;padding:0;cursor:pointer;display:flex;align-items:center}.pt-nav-bar-menu .navbar-user-avatar,.pt-nav-bar-menu .navbar-user-menu-avatar{width:38px;height:38px;min-width:38px;border-radius:999px;background:#eff6ff;color:#2563eb;border:1px solid #bfdbfe;display:flex;align-items:center;justify-content:center;font-size:.92rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;line-height:1;box-sizing:border-box}.pt-nav-bar-menu .navbar-user-avatar i,.pt-nav-bar-menu .navbar-user-menu-avatar i{font-size:1rem}.pt-nav-bar-menu .navbar-user-menu{position:absolute;top:calc(100% + 10px);right:0;width:260px;background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 18px 45px #0f172a29;z-index:9999;padding:.75rem;box-sizing:border-box}.pt-nav-bar-menu .navbar-user-menu-header{display:flex;align-items:center;gap:.75rem;padding:.35rem .25rem .65rem}.pt-nav-bar-menu .navbar-user-menu-avatar{width:46px;height:46px;min-width:46px;font-size:1.05rem}.pt-nav-bar-menu .navbar-user-menu-identity{min-width:0}.pt-nav-bar-menu .navbar-user-menu-name{color:#0f172a;font-size:.95rem;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-user-menu-profile{margin-top:.15rem;color:#2563eb;font-size:.8rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-user-menu-username{margin-top:.15rem;color:#64748b;font-size:.78rem;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-user-menu-separator{height:1px;background:#e5e7eb;margin:.4rem 0}.pt-nav-bar-menu .navbar-user-menu-item{width:100%;min-height:36px;border:none;background:transparent;border-radius:9px;color:#334155;display:flex;align-items:center;gap:.55rem;padding:.5rem .55rem;font-size:.86rem;font-weight:600;cursor:pointer;text-align:left;box-sizing:border-box}.pt-nav-bar-menu .navbar-user-menu-item:hover{background:#f1f5f9;color:#0f172a}.pt-nav-bar-menu .navbar-user-menu-item.danger{color:#dc2626}.pt-nav-bar-menu .navbar-user-menu-item.danger:hover{background:#fef2f2;color:#b91c1c}@media(max-width:900px){.pt-nav-bar-menu{flex-wrap:wrap;row-gap:8px}.pt-nav-bar-menu .navbar-left{width:100%;justify-content:space-between}.pt-nav-bar-menu .navbar-middle{width:100%;padding:0;justify-content:flex-start}.pt-nav-bar-menu .navbar-middle.dt-pos-right .navbar-datetime,.pt-nav-bar-menu .navbar-middle.dt-pos-center .navbar-datetime{padding-left:0;border-left:none}.pt-nav-bar-menu .navbar-actions{width:100%;justify-content:flex-end}.pt-nav-bar-menu .navbar-user-menu{right:0}.pt-nav-bar-menu .navbar-user-profile-left{max-width:130px}}@media(max-width:520px){.pt-nav-bar-menu .navbar-datetime .dt-value,.pt-nav-bar-menu .navbar-user-profile-left{display:none}.pt-nav-bar-menu .navbar-user-menu{width:240px}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: PTMenuFancyComponent, selector: "pt-menu-fancy", inputs: ["config"] }] }); }
|
|
4472
4602
|
}
|
|
4473
4603
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTNavbarMenuComponent, decorators: [{
|
|
4474
4604
|
type: Component,
|
|
4475
|
-
args: [{ selector: 'pt-nav-bar-menu', standalone: false, template: "<div class=\"pt-nav-bar-menu\" [ngStyle]=\"getNavbarStyles()\">\n <!-- LEFT -->\n <div class=\"navbar-left\">\n <a\n [routerLink]=\"\n isImageStyle(navBarMenuConfig.logo)\n ? navBarMenuConfig.logo.routerLink\n : '/'\n \"\n class=\"logo-link\"\n
|
|
4605
|
+
args: [{ selector: 'pt-nav-bar-menu', standalone: false, template: "<div class=\"pt-nav-bar-menu\" [ngStyle]=\"getNavbarStyles()\">\n <!-- LEFT -->\n <div class=\"navbar-left\">\n <a\n [routerLink]=\"\n isImageStyle(navBarMenuConfig.logo)\n ? navBarMenuConfig.logo.routerLink\n : '/'\n \"\n class=\"logo-link\"\n >\n <img\n [src]=\"getLogoUrl()\"\n [alt]=\"getLogoAltText()\"\n [ngStyle]=\"getLogoStyles()\"\n class=\"navbar-logo\"\n />\n\n <span class=\"navbar-title\" [ngStyle]=\"getAppNameStyles()\">\n {{ getAppName() }}\n </span>\n </a>\n\n <a (click)=\"toggleMenu()\" class=\"toggle-btn\">\n <i\n [class]=\"getToggleButtonIcon()\"\n [ngStyle]=\"getToggleButtonStyles()\"\n ></i>\n </a>\n </div>\n\n <!-- MIDDLE DateTime -->\n @if (hasDateTime()) {\n <div class=\"navbar-middle\" [ngClass]=\"getDateTimePositionClass()\">\n <div class=\"navbar-datetime\">\n <span class=\"dt-value\" [ngStyle]=\"getDateTimeTextStyles()\">\n {{ dateTimeText }}\n </span>\n\n @if (isFixedMode()) {\n <input\n class=\"dt-input\"\n type=\"datetime-local\"\n step=\"1\"\n [value]=\"manualDateTimeLocal\"\n (input)=\"onManualDateTimeChange($any($event.target).value)\"\n />\n }\n </div>\n </div>\n }\n\n <!-- RIGHT -->\n <div class=\"navbar-actions\">\n <div class=\"navbar-right\">\n @for (menuConfig of navBarMenuConfig.menus; track menuConfig) {\n <pt-menu-fancy [config]=\"menuConfig\"></pt-menu-fancy>\n }\n </div>\n\n @if (hasUser()) {\n <div class=\"navbar-user\" (click)=\"$event.stopPropagation()\">\n @if (showProfileLeftOfAvatar()) {\n <div\n class=\"navbar-user-profile-left\"\n [ngStyle]=\"getUserProfileTextStyles()\"\n >\n {{ getUserProfile() }}\n </div>\n }\n\n <button\n type=\"button\"\n class=\"navbar-user-trigger\"\n (click)=\"toggleUserMenu()\"\n >\n <div class=\"navbar-user-avatar\" [ngStyle]=\"getUserAvatarStyles()\">\n @if (isInitialsAvatar()) {\n <span>{{ getUserInitials() }}</span>\n } @else {\n <i class=\"fa fa-user\"></i>\n }\n </div>\n </button>\n\n @if (isUserMenuOpen) {\n <div class=\"navbar-user-menu\">\n <div class=\"navbar-user-menu-header\">\n <div\n class=\"navbar-user-menu-avatar\"\n [ngStyle]=\"getUserAvatarStyles()\"\n >\n @if (isInitialsAvatar()) {\n <span>{{ getUserInitials() }}</span>\n } @else {\n <i class=\"fa fa-user\"></i>\n }\n </div>\n\n <div class=\"navbar-user-menu-identity\">\n <div class=\"navbar-user-menu-name\">\n {{ getUserFullName() }}\n </div>\n\n @if (showProfileInMenu()) {\n <div\n class=\"navbar-user-menu-profile\"\n [ngStyle]=\"getUserProfileTextStyles()\"\n >\n {{ getUserProfile() }}\n </div>\n }\n\n <div class=\"navbar-user-menu-username\">\n {{ getUsername() }}\n </div>\n </div>\n </div>\n\n <div class=\"navbar-user-menu-separator\"></div>\n\n <button\n type=\"button\"\n class=\"navbar-user-menu-item\"\n (click)=\"onUserProfileClick()\"\n >\n <i class=\"fa fa-user\"></i>\n <span>Profil</span>\n </button>\n\n <button\n type=\"button\"\n class=\"navbar-user-menu-item danger\"\n (click)=\"onUserLogoutClick()\"\n >\n <i class=\"fa fa-sign-out-alt\"></i>\n <span>D\u00E9connexion</span>\n </button>\n </div>\n }\n </div>\n }\n </div>\n</div>\n", styles: [".pt-nav-bar-menu{display:flex;align-items:center;justify-content:space-between;padding-right:10px;padding-left:10px;border-bottom:1px solid #ddd;background-color:#fff;background-size:cover;background-position:center;gap:12px;min-width:0;width:100%;box-sizing:border-box}.pt-nav-bar-menu .navbar-left{display:flex;align-items:center;gap:12px;min-width:0;flex:0 0 auto}.pt-nav-bar-menu .logo-link{display:flex;align-items:center;text-decoration:none;color:inherit;min-width:0}.pt-nav-bar-menu .navbar-logo{margin-left:10px;margin-right:20px}.pt-nav-bar-menu .navbar-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-middle{flex:1 1 auto;display:flex;align-items:center;min-width:0;padding:0 12px}.pt-nav-bar-menu .navbar-middle.dt-pos-left{justify-content:flex-start}.pt-nav-bar-menu .navbar-middle.dt-pos-center{justify-content:center}.pt-nav-bar-menu .navbar-middle.dt-pos-right{justify-content:flex-end}.pt-nav-bar-menu .navbar-datetime{display:inline-flex;align-items:center;gap:10px;flex:0 0 auto;white-space:nowrap;max-width:100%}.pt-nav-bar-menu .navbar-datetime .dt-value{white-space:nowrap}.pt-nav-bar-menu .navbar-datetime .dt-input{height:32px;padding:0 8px;border:1px solid rgba(0,0,0,.18);border-radius:6px;background:#fff;font-size:12px;color:#333;outline:none}.pt-nav-bar-menu .navbar-datetime .dt-input:focus{border-color:#034c83b3;box-shadow:0 0 0 3px #034c831f}.pt-nav-bar-menu .navbar-actions{display:flex;align-items:center;gap:12px;flex:0 0 auto;min-width:0}.pt-nav-bar-menu .navbar-right{display:flex;align-items:center;gap:10px;flex:0 0 auto}.pt-nav-bar-menu .navbar-right a{margin-left:20px;color:#333;text-decoration:none;font-size:20px;cursor:pointer}.pt-nav-bar-menu .navbar-right a:hover{color:#000}.pt-nav-bar-menu .toggle-btn{margin-left:2rem;cursor:pointer;padding:7px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center}.pt-nav-bar-menu .toggle-btn>.pi.pi-bars{font-size:1.5rem;color:#333}.pt-nav-bar-menu .toggle-btn:hover{background-color:#f1f1f1}.pt-nav-bar-menu .navbar-user{position:relative;display:flex;align-items:center;gap:.65rem;flex:0 0 auto}.pt-nav-bar-menu .navbar-user-profile-left{max-width:170px;color:#334155;font-size:.82rem;font-weight:700;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:.28rem .65rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-user-trigger{border:none;background:transparent;padding:0;cursor:pointer;display:flex;align-items:center}.pt-nav-bar-menu .navbar-user-avatar,.pt-nav-bar-menu .navbar-user-menu-avatar{width:38px;height:38px;min-width:38px;border-radius:999px;background:#eff6ff;color:#2563eb;border:1px solid #bfdbfe;display:flex;align-items:center;justify-content:center;font-size:.92rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;line-height:1;box-sizing:border-box}.pt-nav-bar-menu .navbar-user-avatar i,.pt-nav-bar-menu .navbar-user-menu-avatar i{font-size:1rem}.pt-nav-bar-menu .navbar-user-menu{position:absolute;top:calc(100% + 10px);right:0;width:260px;background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 18px 45px #0f172a29;z-index:9999;padding:.75rem;box-sizing:border-box}.pt-nav-bar-menu .navbar-user-menu-header{display:flex;align-items:center;gap:.75rem;padding:.35rem .25rem .65rem}.pt-nav-bar-menu .navbar-user-menu-avatar{width:46px;height:46px;min-width:46px;font-size:1.05rem}.pt-nav-bar-menu .navbar-user-menu-identity{min-width:0}.pt-nav-bar-menu .navbar-user-menu-name{color:#0f172a;font-size:.95rem;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-user-menu-profile{margin-top:.15rem;color:#2563eb;font-size:.8rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-user-menu-username{margin-top:.15rem;color:#64748b;font-size:.78rem;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-nav-bar-menu .navbar-user-menu-separator{height:1px;background:#e5e7eb;margin:.4rem 0}.pt-nav-bar-menu .navbar-user-menu-item{width:100%;min-height:36px;border:none;background:transparent;border-radius:9px;color:#334155;display:flex;align-items:center;gap:.55rem;padding:.5rem .55rem;font-size:.86rem;font-weight:600;cursor:pointer;text-align:left;box-sizing:border-box}.pt-nav-bar-menu .navbar-user-menu-item:hover{background:#f1f5f9;color:#0f172a}.pt-nav-bar-menu .navbar-user-menu-item.danger{color:#dc2626}.pt-nav-bar-menu .navbar-user-menu-item.danger:hover{background:#fef2f2;color:#b91c1c}@media(max-width:900px){.pt-nav-bar-menu{flex-wrap:wrap;row-gap:8px}.pt-nav-bar-menu .navbar-left{width:100%;justify-content:space-between}.pt-nav-bar-menu .navbar-middle{width:100%;padding:0;justify-content:flex-start}.pt-nav-bar-menu .navbar-middle.dt-pos-right .navbar-datetime,.pt-nav-bar-menu .navbar-middle.dt-pos-center .navbar-datetime{padding-left:0;border-left:none}.pt-nav-bar-menu .navbar-actions{width:100%;justify-content:flex-end}.pt-nav-bar-menu .navbar-user-menu{right:0}.pt-nav-bar-menu .navbar-user-profile-left{max-width:130px}}@media(max-width:520px){.pt-nav-bar-menu .navbar-datetime .dt-value,.pt-nav-bar-menu .navbar-user-profile-left{display:none}.pt-nav-bar-menu .navbar-user-menu{width:240px}}\n"] }]
|
|
4476
4606
|
}], propDecorators: { navBarMenuConfig: [{
|
|
4477
4607
|
type: Input
|
|
4478
|
-
}], toggleSidebar: [{
|
|
4479
|
-
type: Output
|
|
4480
4608
|
}], serverDateTime: [{
|
|
4481
4609
|
type: Input
|
|
4610
|
+
}], toggleSidebar: [{
|
|
4611
|
+
type: Output
|
|
4612
|
+
}], userClick: [{
|
|
4613
|
+
type: Output
|
|
4614
|
+
}], logoutClick: [{
|
|
4615
|
+
type: Output
|
|
4616
|
+
}], closeUserMenu: [{
|
|
4617
|
+
type: HostListener,
|
|
4618
|
+
args: ['document:click']
|
|
4482
4619
|
}] } });
|
|
4483
4620
|
|
|
4484
4621
|
class PTMenuFancyModule {
|
|
@@ -4531,15 +4668,22 @@ class PTSideBarMenuComponent {
|
|
|
4531
4668
|
alignBodyContent: 'center',
|
|
4532
4669
|
identifier: 'pt-side-bar-menu/search',
|
|
4533
4670
|
backgroundColor: 'white',
|
|
4671
|
+
width: '250px',
|
|
4534
4672
|
height: '72px',
|
|
4535
4673
|
padding: '0',
|
|
4674
|
+
bodyPadding: '0',
|
|
4675
|
+
margin: '6px 0px',
|
|
4676
|
+
scrollableVertical: false,
|
|
4536
4677
|
};
|
|
4537
4678
|
this.cardConfig = {
|
|
4538
4679
|
identifier: 'pt-side-bar-menu',
|
|
4539
|
-
backgroundColor: '',
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4680
|
+
backgroundColor: 'white',
|
|
4681
|
+
padding: '10px 6px',
|
|
4682
|
+
bodyPadding: '0',
|
|
4683
|
+
margin: '6px 0px',
|
|
4684
|
+
width: '250px',
|
|
4685
|
+
height: '100vh',
|
|
4686
|
+
scrollableVertical: true,
|
|
4543
4687
|
};
|
|
4544
4688
|
this.formGroup = new FormGroup({
|
|
4545
4689
|
search: new FormControl(''),
|
|
@@ -4550,28 +4694,15 @@ class PTSideBarMenuComponent {
|
|
|
4550
4694
|
type: FormInputTypeEnum.TEXT,
|
|
4551
4695
|
iconClass: 'pi pi-search',
|
|
4552
4696
|
iconPosition: 'left',
|
|
4553
|
-
width: '
|
|
4697
|
+
width: '250px',
|
|
4554
4698
|
height: '42px',
|
|
4555
4699
|
};
|
|
4556
4700
|
this.filteredMenus = [];
|
|
4557
4701
|
}
|
|
4558
4702
|
ngOnInit() {
|
|
4559
|
-
this.
|
|
4560
|
-
identifier: 'pt-side-bar-menu',
|
|
4561
|
-
backgroundColor: this.menuConfig.backgroundColor,
|
|
4562
|
-
width: this.menuConfig.width,
|
|
4563
|
-
height: this.menuConfig.height,
|
|
4564
|
-
scrollableVertical: this.menuConfig.scrollable,
|
|
4565
|
-
pattern: this.menuConfig.pattern,
|
|
4566
|
-
};
|
|
4703
|
+
this.initializeConfigs();
|
|
4567
4704
|
this.filteredMenus = this.cloneMenus(this.menuConfig.menus);
|
|
4568
|
-
|
|
4569
|
-
? parseInt(this.menuConfig.width, 10)
|
|
4570
|
-
: 250;
|
|
4571
|
-
this.searchField.width = `${cardWidth - 60}px`;
|
|
4572
|
-
this.searchCardConfig.width = this.menuConfig.width;
|
|
4573
|
-
this.searchCardConfig.pattern = this.menuConfig.pattern;
|
|
4574
|
-
if (this.menuConfig.searchable) {
|
|
4705
|
+
if (this.isSearchEnabled()) {
|
|
4575
4706
|
this.formGroup
|
|
4576
4707
|
.get('search')
|
|
4577
4708
|
?.valueChanges.subscribe((searchTerm) => {
|
|
@@ -4582,6 +4713,42 @@ class PTSideBarMenuComponent {
|
|
|
4582
4713
|
ngAfterViewInit() {
|
|
4583
4714
|
this.applyHoverEffects();
|
|
4584
4715
|
}
|
|
4716
|
+
initializeConfigs() {
|
|
4717
|
+
const sidebarWidth = this.menuConfig.width || '250px';
|
|
4718
|
+
this.cardConfig = {
|
|
4719
|
+
identifier: 'pt-side-bar-menu',
|
|
4720
|
+
backgroundColor: this.menuConfig.backgroundColor || 'white',
|
|
4721
|
+
width: sidebarWidth,
|
|
4722
|
+
height: this.menuConfig.height || '100vh',
|
|
4723
|
+
scrollableVertical: this.menuConfig.scrollable ?? true,
|
|
4724
|
+
pattern: this.menuConfig.pattern,
|
|
4725
|
+
padding: '10px 6px',
|
|
4726
|
+
bodyPadding: '0',
|
|
4727
|
+
margin: '0',
|
|
4728
|
+
};
|
|
4729
|
+
this.searchCardConfig = {
|
|
4730
|
+
alignContent: 'default',
|
|
4731
|
+
alignBodyContent: 'default',
|
|
4732
|
+
identifier: 'pt-side-bar-menu/search',
|
|
4733
|
+
backgroundColor: this.menuConfig.backgroundColor || 'white',
|
|
4734
|
+
width: sidebarWidth,
|
|
4735
|
+
height: 'auto',
|
|
4736
|
+
padding: '10px 14px',
|
|
4737
|
+
bodyPadding: '0',
|
|
4738
|
+
margin: '16px 0 8px 0',
|
|
4739
|
+
pattern: this.menuConfig.pattern,
|
|
4740
|
+
scrollableVertical: false,
|
|
4741
|
+
scrollableHorizontal: false,
|
|
4742
|
+
};
|
|
4743
|
+
this.searchField = {
|
|
4744
|
+
...this.searchField,
|
|
4745
|
+
width: '100%',
|
|
4746
|
+
height: '42px',
|
|
4747
|
+
};
|
|
4748
|
+
}
|
|
4749
|
+
isSearchEnabled() {
|
|
4750
|
+
return this.menuConfig.searchable !== false;
|
|
4751
|
+
}
|
|
4585
4752
|
toggleMenu(item, event) {
|
|
4586
4753
|
item.isExpanded = !item.isExpanded;
|
|
4587
4754
|
event.preventDefault();
|
|
@@ -4645,6 +4812,12 @@ class PTSideBarMenuComponent {
|
|
|
4645
4812
|
}
|
|
4646
4813
|
});
|
|
4647
4814
|
}
|
|
4815
|
+
cloneMenus(menus) {
|
|
4816
|
+
return (menus || []).map((menu) => ({
|
|
4817
|
+
...menu,
|
|
4818
|
+
children: menu.children ? this.cloneMenus(menu.children) : undefined,
|
|
4819
|
+
}));
|
|
4820
|
+
}
|
|
4648
4821
|
getMenuItemStyles() {
|
|
4649
4822
|
return {
|
|
4650
4823
|
color: this.menuConfig.fontColor || '#333',
|
|
@@ -4670,6 +4843,8 @@ class PTSideBarMenuComponent {
|
|
|
4670
4843
|
padding: level === 1 ? '5px 10px' : '4px 10px',
|
|
4671
4844
|
transition: 'background-color 0.2s, color 0.2s',
|
|
4672
4845
|
fontSize: level === 1 ? '14px' : '13px',
|
|
4846
|
+
display: 'flex',
|
|
4847
|
+
alignItems: 'center',
|
|
4673
4848
|
};
|
|
4674
4849
|
}
|
|
4675
4850
|
applyHoverEffects() {
|
|
@@ -4678,10 +4853,10 @@ class PTSideBarMenuComponent {
|
|
|
4678
4853
|
menuLinks.forEach((link) => {
|
|
4679
4854
|
this.renderer.listen(link, 'mouseenter', () => {
|
|
4680
4855
|
this.renderer.setStyle(link, 'background-color', this.menuConfig.hoverColor || '#f1f1f1');
|
|
4681
|
-
this.renderer.setStyle(link, 'color', this.menuConfig.hoverFontColor || '
|
|
4856
|
+
this.renderer.setStyle(link, 'color', this.menuConfig.hoverFontColor || '#111');
|
|
4682
4857
|
});
|
|
4683
4858
|
this.renderer.listen(link, 'mouseleave', () => {
|
|
4684
|
-
this.renderer.
|
|
4859
|
+
this.renderer.setStyle(link, 'background-color', 'transparent');
|
|
4685
4860
|
this.renderer.setStyle(link, 'color', this.menuConfig.fontColor || '#333');
|
|
4686
4861
|
});
|
|
4687
4862
|
});
|
|
@@ -4692,29 +4867,22 @@ class PTSideBarMenuComponent {
|
|
|
4692
4867
|
'#f1f1f1');
|
|
4693
4868
|
this.renderer.setStyle(link, 'color', this.menuConfig.hoverFontColorSubMenu ||
|
|
4694
4869
|
this.menuConfig.hoverFontColor ||
|
|
4695
|
-
'#
|
|
4870
|
+
'#000');
|
|
4696
4871
|
});
|
|
4697
4872
|
this.renderer.listen(link, 'mouseleave', () => {
|
|
4698
|
-
this.renderer.
|
|
4873
|
+
this.renderer.setStyle(link, 'background-color', 'transparent');
|
|
4699
4874
|
this.renderer.setStyle(link, 'color', this.menuConfig.fontColorSubMenu ||
|
|
4700
4875
|
this.menuConfig.fontColor ||
|
|
4701
4876
|
'#666');
|
|
4702
4877
|
});
|
|
4703
4878
|
});
|
|
4704
4879
|
}
|
|
4705
|
-
cloneMenus(menus = []) {
|
|
4706
|
-
return menus.map((menu) => ({
|
|
4707
|
-
...menu,
|
|
4708
|
-
children: this.cloneMenus(menu.children || []),
|
|
4709
|
-
isExpanded: menu.isExpanded ?? false,
|
|
4710
|
-
}));
|
|
4711
|
-
}
|
|
4712
4880
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTSideBarMenuComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4713
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTSideBarMenuComponent, isStandalone: false, selector: "pt-side-bar-menu", inputs: { menuConfig: "menuConfig" }, ngImport: i0, template: "<div class=\"pt-side-bar-menu\">\n @if (
|
|
4881
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTSideBarMenuComponent, isStandalone: false, selector: "pt-side-bar-menu", inputs: { menuConfig: "menuConfig" }, ngImport: i0, template: "<div class=\"pt-side-bar-menu\">\n @if (isSearchEnabled()) {\n <pt-card\n [config]=\"searchCardConfig\"\n [ngClass]=\"{ 'sidebar-hidden': menuConfig.isVisible === false }\"\n >\n <div class=\"search-input\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"searchField\"\n ></pt-text-input>\n </div>\n </pt-card>\n }\n\n <pt-card\n [config]=\"cardConfig\"\n [ngClass]=\"{ 'sidebar-hidden': menuConfig.isVisible === false }\"\n >\n <ul class=\"menu-list\">\n <ng-container\n *ngTemplateOutlet=\"\n recursiveMenu;\n context: { $implicit: filteredMenus, level: 0 }\n \"\n ></ng-container>\n </ul>\n </pt-card>\n</div>\n\n<ng-template #recursiveMenu let-menus let-level=\"level\">\n @for (item of menus; track item) {\n <li\n class=\"menu-item\"\n [ngClass]=\"{\n 'menu-item-expanded': item.isExpanded,\n 'submenu-level-item': level > 0,\n }\"\n [attr.data-level]=\"level\"\n [ngStyle]=\"getMenuItemStyles()\"\n >\n @if (!hasChildren(item)) {\n <a\n [routerLink]=\"item.url\"\n [class.menu-link]=\"level === 0\"\n [class.submenu-link]=\"level > 0\"\n [ngStyle]=\"\n level === 0 ? getMenuLinkStyles() : getSubMenuLinkStyles(level)\n \"\n >\n <i [ngClass]=\"item.icon\"></i>\n\n <span [class.submenu-title]=\"level > 0\">\n {{ item.label }}\n </span>\n\n @if (item.badge) {\n <span [ngStyle]=\"getBadgeStyles(item.badge)\" class=\"badge\">\n {{ item.badge.count }}\n </span>\n }\n </a>\n }\n\n @if (hasChildren(item)) {\n <a\n href=\"#\"\n [class.menu-link]=\"level === 0\"\n [class.submenu-link]=\"level > 0\"\n (click)=\"toggleMenu(item, $event)\"\n [ngStyle]=\"\n level === 0 ? getMenuLinkStyles() : getSubMenuLinkStyles(level)\n \"\n >\n <i [ngClass]=\"item.icon\"></i>\n\n <span [class.submenu-title]=\"level > 0\">\n {{ item.label }}\n </span>\n\n @if (item.badge) {\n <span [ngStyle]=\"getBadgeStyles(item.badge)\" class=\"badge\">\n {{ item.badge.count }}\n </span>\n }\n\n <i [ngClass]=\"getChevronClass(item)\" class=\"chevron\"></i>\n </a>\n }\n\n @if (hasChildren(item)) {\n <div class=\"submenu-wrapper\" [class.expanded]=\"item.isExpanded\">\n <ul\n class=\"submenu-list\"\n [ngClass]=\"{\n 'submenu-list-root': level === 0,\n 'submenu-list-nested': level > 0,\n }\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n recursiveMenu;\n context: { $implicit: item.children, level: level + 1 }\n \"\n ></ng-container>\n </ul>\n </div>\n }\n </li>\n }\n</ng-template>\n", styles: [".pt-side-bar-menu{display:block;box-sizing:border-box}.pt-side-bar-menu *{box-sizing:border-box}.pt-side-bar-menu .badge{background-color:#38bdf8;border-radius:5px;color:#fff;font-size:12px;margin-left:auto;padding:2px 8px}.pt-side-bar-menu .chevron{color:#8c8c8c;cursor:pointer;margin-left:auto}.pt-side-bar-menu .menu-item{position:relative}.pt-side-bar-menu .menu-link{align-items:center;border-radius:8px;color:#333;cursor:pointer;display:flex;font-size:16px;margin-bottom:6px;padding:10px 15px;text-decoration:none;transition:background-color .2s,color .2s}.pt-side-bar-menu .menu-link:hover{background-color:#f1f1f1;color:#111}.pt-side-bar-menu .menu-link i{margin-right:10px}.pt-side-bar-menu .menu-list{list-style-type:none;padding:0;margin:0}.pt-side-bar-menu pt-card{transition:transform .3s ease-in-out,opacity .3s ease-in-out;display:block;width:100%;box-sizing:border-box}.pt-side-bar-menu .sidebar-hidden{transform:translate(-100%);opacity:0}.pt-side-bar-menu .sidebar-menu{margin:0;padding:0;transition:transform .3s ease-in-out}.pt-side-bar-menu .submenu-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s ease;min-height:0}.pt-side-bar-menu .submenu-wrapper.expanded{grid-template-rows:1fr}.pt-side-bar-menu .submenu-wrapper:not(.expanded){margin:0!important;padding:0!important}.pt-side-bar-menu .submenu-list{overflow:hidden;min-height:0;list-style-type:none;margin-top:5px;margin-bottom:0;position:relative}.pt-side-bar-menu .submenu-wrapper:not(.expanded) .submenu-list{margin:0!important;padding-top:0!important;padding-bottom:0!important;border-left:none!important}.pt-side-bar-menu .submenu-list-root{border-left:1px solid #e5e7eb;margin-left:23px;padding-left:25px;padding-top:5px;padding-bottom:5px}.pt-side-bar-menu .submenu-list-root:after{background-color:#e5e7eb;bottom:0;content:\"\";left:-1px;position:absolute;top:0;width:1px}.pt-side-bar-menu .submenu-list-nested{border-left:1px solid #2f3b46;margin-left:18px;padding-left:20px;padding-top:4px;padding-bottom:4px}.pt-side-bar-menu .submenu-item,.pt-side-bar-menu .submenu-level-item{padding:5px 0;position:relative}.pt-side-bar-menu .submenu-level-item:before{background-color:#e5e7eb;content:\"\";height:1px;left:-25px;position:absolute;top:22px;transform:translateY(-50%);width:25px}.pt-side-bar-menu .submenu-link{align-items:center;border-radius:5px;color:#666;display:flex;font-size:14px;padding:5px 10px;text-decoration:none;transition:background-color .2s,color .2s}.pt-side-bar-menu .submenu-link:hover{background-color:#f1f1f1;color:#000}.pt-side-bar-menu .submenu-title{margin-left:5px}.pt-side-bar-menu .search-input{width:100%;max-width:100%;display:block;box-sizing:border-box;overflow:visible}.pt-side-bar-menu .search-input pt-text-input{display:block;width:100%;max-width:100%;box-sizing:border-box;overflow:visible}.pt-side-bar-menu .search-input ::ng-deep .p-iconfield,.pt-side-bar-menu .search-input ::ng-deep .p-input-icon-left,.pt-side-bar-menu .search-input ::ng-deep .p-input-icon-right,.pt-side-bar-menu .search-input ::ng-deep .p-inputgroup{width:100%;max-width:100%;box-sizing:border-box;overflow:visible}.pt-side-bar-menu .search-input ::ng-deep input,.pt-side-bar-menu .search-input ::ng-deep .p-inputtext{width:100%!important;max-width:100%;height:42px;box-sizing:border-box}.pt-side-bar-menu .search-input ::ng-deep input:focus,.pt-side-bar-menu .search-input ::ng-deep .p-inputtext:focus{outline-offset:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }, { kind: "component", type: PTTextInputComponent, selector: "pt-text-input", inputs: ["formGroup", "formField"] }] }); }
|
|
4714
4882
|
}
|
|
4715
4883
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTSideBarMenuComponent, decorators: [{
|
|
4716
4884
|
type: Component,
|
|
4717
|
-
args: [{ selector: 'pt-side-bar-menu', standalone: false, template: "<div class=\"pt-side-bar-menu\">\n @if (
|
|
4885
|
+
args: [{ selector: 'pt-side-bar-menu', standalone: false, template: "<div class=\"pt-side-bar-menu\">\n @if (isSearchEnabled()) {\n <pt-card\n [config]=\"searchCardConfig\"\n [ngClass]=\"{ 'sidebar-hidden': menuConfig.isVisible === false }\"\n >\n <div class=\"search-input\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"searchField\"\n ></pt-text-input>\n </div>\n </pt-card>\n }\n\n <pt-card\n [config]=\"cardConfig\"\n [ngClass]=\"{ 'sidebar-hidden': menuConfig.isVisible === false }\"\n >\n <ul class=\"menu-list\">\n <ng-container\n *ngTemplateOutlet=\"\n recursiveMenu;\n context: { $implicit: filteredMenus, level: 0 }\n \"\n ></ng-container>\n </ul>\n </pt-card>\n</div>\n\n<ng-template #recursiveMenu let-menus let-level=\"level\">\n @for (item of menus; track item) {\n <li\n class=\"menu-item\"\n [ngClass]=\"{\n 'menu-item-expanded': item.isExpanded,\n 'submenu-level-item': level > 0,\n }\"\n [attr.data-level]=\"level\"\n [ngStyle]=\"getMenuItemStyles()\"\n >\n @if (!hasChildren(item)) {\n <a\n [routerLink]=\"item.url\"\n [class.menu-link]=\"level === 0\"\n [class.submenu-link]=\"level > 0\"\n [ngStyle]=\"\n level === 0 ? getMenuLinkStyles() : getSubMenuLinkStyles(level)\n \"\n >\n <i [ngClass]=\"item.icon\"></i>\n\n <span [class.submenu-title]=\"level > 0\">\n {{ item.label }}\n </span>\n\n @if (item.badge) {\n <span [ngStyle]=\"getBadgeStyles(item.badge)\" class=\"badge\">\n {{ item.badge.count }}\n </span>\n }\n </a>\n }\n\n @if (hasChildren(item)) {\n <a\n href=\"#\"\n [class.menu-link]=\"level === 0\"\n [class.submenu-link]=\"level > 0\"\n (click)=\"toggleMenu(item, $event)\"\n [ngStyle]=\"\n level === 0 ? getMenuLinkStyles() : getSubMenuLinkStyles(level)\n \"\n >\n <i [ngClass]=\"item.icon\"></i>\n\n <span [class.submenu-title]=\"level > 0\">\n {{ item.label }}\n </span>\n\n @if (item.badge) {\n <span [ngStyle]=\"getBadgeStyles(item.badge)\" class=\"badge\">\n {{ item.badge.count }}\n </span>\n }\n\n <i [ngClass]=\"getChevronClass(item)\" class=\"chevron\"></i>\n </a>\n }\n\n @if (hasChildren(item)) {\n <div class=\"submenu-wrapper\" [class.expanded]=\"item.isExpanded\">\n <ul\n class=\"submenu-list\"\n [ngClass]=\"{\n 'submenu-list-root': level === 0,\n 'submenu-list-nested': level > 0,\n }\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n recursiveMenu;\n context: { $implicit: item.children, level: level + 1 }\n \"\n ></ng-container>\n </ul>\n </div>\n }\n </li>\n }\n</ng-template>\n", styles: [".pt-side-bar-menu{display:block;box-sizing:border-box}.pt-side-bar-menu *{box-sizing:border-box}.pt-side-bar-menu .badge{background-color:#38bdf8;border-radius:5px;color:#fff;font-size:12px;margin-left:auto;padding:2px 8px}.pt-side-bar-menu .chevron{color:#8c8c8c;cursor:pointer;margin-left:auto}.pt-side-bar-menu .menu-item{position:relative}.pt-side-bar-menu .menu-link{align-items:center;border-radius:8px;color:#333;cursor:pointer;display:flex;font-size:16px;margin-bottom:6px;padding:10px 15px;text-decoration:none;transition:background-color .2s,color .2s}.pt-side-bar-menu .menu-link:hover{background-color:#f1f1f1;color:#111}.pt-side-bar-menu .menu-link i{margin-right:10px}.pt-side-bar-menu .menu-list{list-style-type:none;padding:0;margin:0}.pt-side-bar-menu pt-card{transition:transform .3s ease-in-out,opacity .3s ease-in-out;display:block;width:100%;box-sizing:border-box}.pt-side-bar-menu .sidebar-hidden{transform:translate(-100%);opacity:0}.pt-side-bar-menu .sidebar-menu{margin:0;padding:0;transition:transform .3s ease-in-out}.pt-side-bar-menu .submenu-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s ease;min-height:0}.pt-side-bar-menu .submenu-wrapper.expanded{grid-template-rows:1fr}.pt-side-bar-menu .submenu-wrapper:not(.expanded){margin:0!important;padding:0!important}.pt-side-bar-menu .submenu-list{overflow:hidden;min-height:0;list-style-type:none;margin-top:5px;margin-bottom:0;position:relative}.pt-side-bar-menu .submenu-wrapper:not(.expanded) .submenu-list{margin:0!important;padding-top:0!important;padding-bottom:0!important;border-left:none!important}.pt-side-bar-menu .submenu-list-root{border-left:1px solid #e5e7eb;margin-left:23px;padding-left:25px;padding-top:5px;padding-bottom:5px}.pt-side-bar-menu .submenu-list-root:after{background-color:#e5e7eb;bottom:0;content:\"\";left:-1px;position:absolute;top:0;width:1px}.pt-side-bar-menu .submenu-list-nested{border-left:1px solid #2f3b46;margin-left:18px;padding-left:20px;padding-top:4px;padding-bottom:4px}.pt-side-bar-menu .submenu-item,.pt-side-bar-menu .submenu-level-item{padding:5px 0;position:relative}.pt-side-bar-menu .submenu-level-item:before{background-color:#e5e7eb;content:\"\";height:1px;left:-25px;position:absolute;top:22px;transform:translateY(-50%);width:25px}.pt-side-bar-menu .submenu-link{align-items:center;border-radius:5px;color:#666;display:flex;font-size:14px;padding:5px 10px;text-decoration:none;transition:background-color .2s,color .2s}.pt-side-bar-menu .submenu-link:hover{background-color:#f1f1f1;color:#000}.pt-side-bar-menu .submenu-title{margin-left:5px}.pt-side-bar-menu .search-input{width:100%;max-width:100%;display:block;box-sizing:border-box;overflow:visible}.pt-side-bar-menu .search-input pt-text-input{display:block;width:100%;max-width:100%;box-sizing:border-box;overflow:visible}.pt-side-bar-menu .search-input ::ng-deep .p-iconfield,.pt-side-bar-menu .search-input ::ng-deep .p-input-icon-left,.pt-side-bar-menu .search-input ::ng-deep .p-input-icon-right,.pt-side-bar-menu .search-input ::ng-deep .p-inputgroup{width:100%;max-width:100%;box-sizing:border-box;overflow:visible}.pt-side-bar-menu .search-input ::ng-deep input,.pt-side-bar-menu .search-input ::ng-deep .p-inputtext{width:100%!important;max-width:100%;height:42px;box-sizing:border-box}.pt-side-bar-menu .search-input ::ng-deep input:focus,.pt-side-bar-menu .search-input ::ng-deep .p-inputtext:focus{outline-offset:0}\n"] }]
|
|
4718
4886
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { menuConfig: [{
|
|
4719
4887
|
type: Input
|
|
4720
4888
|
}] } });
|
|
@@ -4740,19 +4908,28 @@ class PTFooterComponent {
|
|
|
4740
4908
|
version: '1.0.0',
|
|
4741
4909
|
productionYear: new Date().getFullYear(),
|
|
4742
4910
|
};
|
|
4743
|
-
|
|
4744
|
-
getCurrentYear() {
|
|
4745
|
-
return new Date().getFullYear();
|
|
4746
|
-
}
|
|
4747
|
-
getCardConfig() {
|
|
4748
|
-
return (this.footerConfig.cardConfig ?? {
|
|
4911
|
+
this.defaultFooterCardConfig = {
|
|
4749
4912
|
backgroundColor: '#f8f8f8',
|
|
4750
4913
|
width: '100%',
|
|
4751
4914
|
height: 'auto',
|
|
4752
4915
|
scrollableVertical: false,
|
|
4916
|
+
scrollableHorizontal: false,
|
|
4753
4917
|
padding: '0',
|
|
4754
4918
|
margin: '0',
|
|
4755
|
-
|
|
4919
|
+
bodyPadding: '0',
|
|
4920
|
+
};
|
|
4921
|
+
}
|
|
4922
|
+
getCurrentYear() {
|
|
4923
|
+
return new Date().getFullYear();
|
|
4924
|
+
}
|
|
4925
|
+
getCardConfig() {
|
|
4926
|
+
return {
|
|
4927
|
+
...this.defaultFooterCardConfig,
|
|
4928
|
+
...(this.footerConfig.cardConfig ?? {}),
|
|
4929
|
+
padding: this.footerConfig.cardConfig?.padding ?? '0',
|
|
4930
|
+
margin: this.footerConfig.cardConfig?.margin ?? '0',
|
|
4931
|
+
bodyPadding: this.footerConfig.cardConfig?.bodyPadding ?? '0',
|
|
4932
|
+
};
|
|
4756
4933
|
}
|
|
4757
4934
|
displayYears() {
|
|
4758
4935
|
const currentYear = this.getCurrentYear();
|
|
@@ -4762,11 +4939,11 @@ class PTFooterComponent {
|
|
|
4762
4939
|
: `${productionYear} - ${currentYear}`;
|
|
4763
4940
|
}
|
|
4764
4941
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4765
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: PTFooterComponent, isStandalone: false, selector: "pt-footer", inputs: { footerConfig: "footerConfig" }, ngImport: i0, template: "<pt-card [config]=\"getCardConfig()\" class=\"footer-card\">\n <footer class=\"footer\">\n <p>\n {{ footerConfig.appName }} V {{ footerConfig.version }}\n <br />\n © {{ displayYears() }} All rights reserved.\n </p>\n </footer>\n</pt-card>\n", styles: [".footer{text-align:center;padding:
|
|
4942
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: PTFooterComponent, isStandalone: false, selector: "pt-footer", inputs: { footerConfig: "footerConfig" }, ngImport: i0, template: "<pt-card [config]=\"getCardConfig()\" class=\"footer-card\">\n <footer class=\"footer\">\n <p>\n {{ footerConfig.appName }} V {{ footerConfig.version }}\n <br />\n © {{ displayYears() }} All rights reserved.\n </p>\n </footer>\n</pt-card>\n", styles: [".footer{text-align:center;padding:0;font-size:14px;line-height:1.2;margin-top:0}.footer-card{width:100%;background-color:transparent;margin-top:0}\n"], dependencies: [{ kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }] }); }
|
|
4766
4943
|
}
|
|
4767
4944
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTFooterComponent, decorators: [{
|
|
4768
4945
|
type: Component,
|
|
4769
|
-
args: [{ selector: 'pt-footer', standalone: false, template: "<pt-card [config]=\"getCardConfig()\" class=\"footer-card\">\n <footer class=\"footer\">\n <p>\n {{ footerConfig.appName }} V {{ footerConfig.version }}\n <br />\n © {{ displayYears() }} All rights reserved.\n </p>\n </footer>\n</pt-card>\n", styles: [".footer{text-align:center;padding:
|
|
4946
|
+
args: [{ selector: 'pt-footer', standalone: false, template: "<pt-card [config]=\"getCardConfig()\" class=\"footer-card\">\n <footer class=\"footer\">\n <p>\n {{ footerConfig.appName }} V {{ footerConfig.version }}\n <br />\n © {{ displayYears() }} All rights reserved.\n </p>\n </footer>\n</pt-card>\n", styles: [".footer{text-align:center;padding:0;font-size:14px;line-height:1.2;margin-top:0}.footer-card{width:100%;background-color:transparent;margin-top:0}\n"] }]
|
|
4770
4947
|
}], propDecorators: { footerConfig: [{
|
|
4771
4948
|
type: Input
|
|
4772
4949
|
}] } });
|
|
@@ -4939,11 +5116,11 @@ class PTPageSkeletonComponent {
|
|
|
4939
5116
|
};
|
|
4940
5117
|
}
|
|
4941
5118
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTPageSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4942
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTPageSkeletonComponent, isStandalone: false, selector: "pt-page-skeleton", inputs: { pageSkeletonConfig: "pageSkeletonConfig", serverDateTime: "serverDateTime" }, outputs: { toggleSidebar: "toggleSidebar" }, ngImport: i0, template: "<pt-card [config]=\"pageSkeletonConfig.backgroundCardConfig!\">\n <!-- Navbar -->\n <pt-nav-bar-menu\n [navBarMenuConfig]=\"pageSkeletonConfig.navBarMenuConfig\"\n [serverDateTime]=\"serverDateTime\"\n (toggleSidebar)=\"onToggleSidebar()\"\n ></pt-nav-bar-menu>\n\n <div class=\"main-content\">\n <!-- Sidebar (use *ngIf to toggle visibility) -->\n @if (isSidebarVisible) {\n <pt-side-bar-menu\n [menuConfig]=\"pageSkeletonConfig.sideMenuBarConfig\"\n class=\"sidebar\"\n ></pt-side-bar-menu>\n }\n\n <!-- Main View Area -->\n <div class=\"content-area\" [ngClass]=\"{ 'full-width': !isSidebarVisible }\">\n <!-- Content Card Wrapper -->\n <pt-card [config]=\"pageSkeletonConfig.contentCardConfig\">\n <!-- Breadcrumb -->\n @if (pageSkeletonConfig.breadCrumbConfig) {\n <pt-bread-crumb\n [breadCrumbConfig]=\"pageSkeletonConfig.breadCrumbConfig\"\n class=\"bread-crumb\"\n ></pt-bread-crumb>\n }\n\n <!-- Background Card -->\n\n <router-outlet></router-outlet>\n </pt-card>\n </div>\n </div>\n\n <!-- Footer -->\n @if (pageSkeletonConfig.footerConfig) {\n <pt-footer\n [footerConfig]=\"pageSkeletonConfig.footerConfig\"\n class=\"pt-footer\"\n ></pt-footer>\n }\n</pt-card>\n", styles: [".bread-crumb{margin-bottom:15px}.app-container{display:flex;flex-direction:column;height:100vh}.main-content{display:flex;flex-grow:1;transition:all .3s ease-in-out}.content-area{flex-grow:1;display:flex;justify-content:center;align-items:flex-start;transition:all .3s ease-in-out;margin-left:14px;width:100%;overflow-x:hidden}.sidebar{
|
|
5119
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTPageSkeletonComponent, isStandalone: false, selector: "pt-page-skeleton", inputs: { pageSkeletonConfig: "pageSkeletonConfig", serverDateTime: "serverDateTime" }, outputs: { toggleSidebar: "toggleSidebar" }, ngImport: i0, template: "<pt-card [config]=\"pageSkeletonConfig.backgroundCardConfig!\">\n <!-- Navbar -->\n <pt-nav-bar-menu\n [navBarMenuConfig]=\"pageSkeletonConfig.navBarMenuConfig\"\n [serverDateTime]=\"serverDateTime\"\n (toggleSidebar)=\"onToggleSidebar()\"\n ></pt-nav-bar-menu>\n\n <div class=\"main-content\">\n <!-- Sidebar (use *ngIf to toggle visibility) -->\n @if (isSidebarVisible) {\n <pt-side-bar-menu\n [menuConfig]=\"pageSkeletonConfig.sideMenuBarConfig\"\n class=\"sidebar\"\n ></pt-side-bar-menu>\n }\n\n <!-- Main View Area -->\n <div class=\"content-area\" [ngClass]=\"{ 'full-width': !isSidebarVisible }\">\n <!-- Content Card Wrapper -->\n <pt-card [config]=\"pageSkeletonConfig.contentCardConfig\">\n <!-- Breadcrumb -->\n @if (pageSkeletonConfig.breadCrumbConfig) {\n <pt-bread-crumb\n [breadCrumbConfig]=\"pageSkeletonConfig.breadCrumbConfig\"\n class=\"bread-crumb\"\n ></pt-bread-crumb>\n }\n\n <!-- Background Card -->\n\n <router-outlet></router-outlet>\n </pt-card>\n </div>\n </div>\n\n <!-- Footer -->\n @if (pageSkeletonConfig.footerConfig) {\n <pt-footer\n [footerConfig]=\"pageSkeletonConfig.footerConfig\"\n class=\"pt-footer\"\n ></pt-footer>\n }\n</pt-card>\n", styles: [".bread-crumb{margin-bottom:15px}.app-container{display:flex;flex-direction:column;height:100vh}.main-content{display:flex;flex-grow:1;transition:all .3s ease-in-out}.content-area{flex-grow:1;display:flex;justify-content:center;align-items:flex-start;transition:all .3s ease-in-out;margin-left:14px;width:100%;overflow-x:hidden}.sidebar{transition:all .3s ease-in-out}.content-area.full-width{margin-left:0;width:100%}:host>pt-card{width:100%;min-height:100vh;max-width:100%;overflow:hidden}.content-area>pt-card{width:100%;height:100%;max-width:100%;overflow:hidden}pt-card .card-body-scrollable{overflow-x:auto}.pt-footer{display:block;width:100%;position:relative;z-index:0;margin-top:0}:host ::ng-deep .pt-footer .footer-card,:host ::ng-deep .pt-footer pt-card{height:auto!important;overflow:visible!important}.footer-card{width:100%;background-color:transparent}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: PTNavbarMenuComponent, selector: "pt-nav-bar-menu", inputs: ["navBarMenuConfig", "serverDateTime"], outputs: ["toggleSidebar", "userClick", "logoutClick"] }, { kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }, { kind: "component", type: PTSideBarMenuComponent, selector: "pt-side-bar-menu", inputs: ["menuConfig"] }, { kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: PTFooterComponent, selector: "pt-footer", inputs: ["footerConfig"] }, { kind: "component", type: PTBreadCrumbComponent, selector: "pt-bread-crumb", inputs: ["breadCrumbConfig"] }] }); }
|
|
4943
5120
|
}
|
|
4944
5121
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTPageSkeletonComponent, decorators: [{
|
|
4945
5122
|
type: Component,
|
|
4946
|
-
args: [{ selector: 'pt-page-skeleton', standalone: false, template: "<pt-card [config]=\"pageSkeletonConfig.backgroundCardConfig!\">\n <!-- Navbar -->\n <pt-nav-bar-menu\n [navBarMenuConfig]=\"pageSkeletonConfig.navBarMenuConfig\"\n [serverDateTime]=\"serverDateTime\"\n (toggleSidebar)=\"onToggleSidebar()\"\n ></pt-nav-bar-menu>\n\n <div class=\"main-content\">\n <!-- Sidebar (use *ngIf to toggle visibility) -->\n @if (isSidebarVisible) {\n <pt-side-bar-menu\n [menuConfig]=\"pageSkeletonConfig.sideMenuBarConfig\"\n class=\"sidebar\"\n ></pt-side-bar-menu>\n }\n\n <!-- Main View Area -->\n <div class=\"content-area\" [ngClass]=\"{ 'full-width': !isSidebarVisible }\">\n <!-- Content Card Wrapper -->\n <pt-card [config]=\"pageSkeletonConfig.contentCardConfig\">\n <!-- Breadcrumb -->\n @if (pageSkeletonConfig.breadCrumbConfig) {\n <pt-bread-crumb\n [breadCrumbConfig]=\"pageSkeletonConfig.breadCrumbConfig\"\n class=\"bread-crumb\"\n ></pt-bread-crumb>\n }\n\n <!-- Background Card -->\n\n <router-outlet></router-outlet>\n </pt-card>\n </div>\n </div>\n\n <!-- Footer -->\n @if (pageSkeletonConfig.footerConfig) {\n <pt-footer\n [footerConfig]=\"pageSkeletonConfig.footerConfig\"\n class=\"pt-footer\"\n ></pt-footer>\n }\n</pt-card>\n", styles: [".bread-crumb{margin-bottom:15px}.app-container{display:flex;flex-direction:column;height:100vh}.main-content{display:flex;flex-grow:1;transition:all .3s ease-in-out}.content-area{flex-grow:1;display:flex;justify-content:center;align-items:flex-start;transition:all .3s ease-in-out;margin-left:14px;width:100%;overflow-x:hidden}.sidebar{
|
|
5123
|
+
args: [{ selector: 'pt-page-skeleton', standalone: false, template: "<pt-card [config]=\"pageSkeletonConfig.backgroundCardConfig!\">\n <!-- Navbar -->\n <pt-nav-bar-menu\n [navBarMenuConfig]=\"pageSkeletonConfig.navBarMenuConfig\"\n [serverDateTime]=\"serverDateTime\"\n (toggleSidebar)=\"onToggleSidebar()\"\n ></pt-nav-bar-menu>\n\n <div class=\"main-content\">\n <!-- Sidebar (use *ngIf to toggle visibility) -->\n @if (isSidebarVisible) {\n <pt-side-bar-menu\n [menuConfig]=\"pageSkeletonConfig.sideMenuBarConfig\"\n class=\"sidebar\"\n ></pt-side-bar-menu>\n }\n\n <!-- Main View Area -->\n <div class=\"content-area\" [ngClass]=\"{ 'full-width': !isSidebarVisible }\">\n <!-- Content Card Wrapper -->\n <pt-card [config]=\"pageSkeletonConfig.contentCardConfig\">\n <!-- Breadcrumb -->\n @if (pageSkeletonConfig.breadCrumbConfig) {\n <pt-bread-crumb\n [breadCrumbConfig]=\"pageSkeletonConfig.breadCrumbConfig\"\n class=\"bread-crumb\"\n ></pt-bread-crumb>\n }\n\n <!-- Background Card -->\n\n <router-outlet></router-outlet>\n </pt-card>\n </div>\n </div>\n\n <!-- Footer -->\n @if (pageSkeletonConfig.footerConfig) {\n <pt-footer\n [footerConfig]=\"pageSkeletonConfig.footerConfig\"\n class=\"pt-footer\"\n ></pt-footer>\n }\n</pt-card>\n", styles: [".bread-crumb{margin-bottom:15px}.app-container{display:flex;flex-direction:column;height:100vh}.main-content{display:flex;flex-grow:1;transition:all .3s ease-in-out}.content-area{flex-grow:1;display:flex;justify-content:center;align-items:flex-start;transition:all .3s ease-in-out;margin-left:14px;width:100%;overflow-x:hidden}.sidebar{transition:all .3s ease-in-out}.content-area.full-width{margin-left:0;width:100%}:host>pt-card{width:100%;min-height:100vh;max-width:100%;overflow:hidden}.content-area>pt-card{width:100%;height:100%;max-width:100%;overflow:hidden}pt-card .card-body-scrollable{overflow-x:auto}.pt-footer{display:block;width:100%;position:relative;z-index:0;margin-top:0}:host ::ng-deep .pt-footer .footer-card,:host ::ng-deep .pt-footer pt-card{height:auto!important;overflow:visible!important}.footer-card{width:100%;background-color:transparent}\n"] }]
|
|
4947
5124
|
}], propDecorators: { pageSkeletonConfig: [{
|
|
4948
5125
|
type: Input
|
|
4949
5126
|
}], serverDateTime: [{
|
|
@@ -6456,6 +6633,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
6456
6633
|
}]
|
|
6457
6634
|
}] });
|
|
6458
6635
|
|
|
6636
|
+
// nav-bar-menu-config.model.ts
|
|
6637
|
+
|
|
6459
6638
|
// src/lib/models/pt-dialog-config.model.ts
|
|
6460
6639
|
|
|
6461
6640
|
// Advanced table
|