@fuentis/phoenix-ui 0.0.9-alpha.370 → 0.0.9-alpha.372
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.
|
@@ -138,8 +138,11 @@ class SidebarItemComponent {
|
|
|
138
138
|
constructor(router) {
|
|
139
139
|
this.router = router;
|
|
140
140
|
}
|
|
141
|
+
ngOnChanges(changes) {
|
|
142
|
+
console.log(this.item);
|
|
143
|
+
}
|
|
141
144
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SidebarItemComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
142
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SidebarItemComponent, isStandalone: true, selector: "pho-sidebar-item", inputs: { item: "item", classname: "classname" }, outputs: { sliderClick: "sliderClick" }, ngImport: i0, template: `
|
|
145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SidebarItemComponent, isStandalone: true, selector: "pho-sidebar-item", inputs: { item: "item", classname: "classname" }, outputs: { sliderClick: "sliderClick" }, usesOnChanges: true, ngImport: i0, template: `
|
|
143
146
|
@if(item.path === '/dashboard'){
|
|
144
147
|
<li class="list-none flex align-items-center border-bottom-1 border-200">
|
|
145
148
|
<a
|
|
@@ -166,6 +169,7 @@ class SidebarItemComponent {
|
|
|
166
169
|
[rounded]="true"
|
|
167
170
|
[text]="true"
|
|
168
171
|
(onClick)="onSliderClick($event, menu)"
|
|
172
|
+
[disabled]="item.disabledConfig"
|
|
169
173
|
/>
|
|
170
174
|
</a>
|
|
171
175
|
<p-menu
|
|
@@ -176,7 +180,9 @@ class SidebarItemComponent {
|
|
|
176
180
|
[popup]="true"
|
|
177
181
|
>
|
|
178
182
|
<ng-template #submenuheader let-item>
|
|
179
|
-
<span class="text-400 text-sm font-semibold">{{
|
|
183
|
+
<span class="text-400 text-sm font-semibold">{{
|
|
184
|
+
item.label | translate
|
|
185
|
+
}}</span>
|
|
180
186
|
</ng-template>
|
|
181
187
|
<ng-template pTemplate="item" let-item>
|
|
182
188
|
<a
|
|
@@ -190,7 +196,7 @@ class SidebarItemComponent {
|
|
|
190
196
|
@if(item.icon){
|
|
191
197
|
<i [class]="item.icon"> </i>
|
|
192
198
|
}
|
|
193
|
-
<span class="ml-2">{{ item.title }}</span>
|
|
199
|
+
<span class="ml-2">{{ item.title | translate }}</span>
|
|
194
200
|
</div>
|
|
195
201
|
@if(item.activated){
|
|
196
202
|
<i class=" pi pi-check"></i>
|
|
@@ -295,6 +301,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
295
301
|
[rounded]="true"
|
|
296
302
|
[text]="true"
|
|
297
303
|
(onClick)="onSliderClick($event, menu)"
|
|
304
|
+
[disabled]="item.disabledConfig"
|
|
298
305
|
/>
|
|
299
306
|
</a>
|
|
300
307
|
<p-menu
|
|
@@ -305,7 +312,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
305
312
|
[popup]="true"
|
|
306
313
|
>
|
|
307
314
|
<ng-template #submenuheader let-item>
|
|
308
|
-
<span class="text-400 text-sm font-semibold">{{
|
|
315
|
+
<span class="text-400 text-sm font-semibold">{{
|
|
316
|
+
item.label | translate
|
|
317
|
+
}}</span>
|
|
309
318
|
</ng-template>
|
|
310
319
|
<ng-template pTemplate="item" let-item>
|
|
311
320
|
<a
|
|
@@ -319,7 +328,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
319
328
|
@if(item.icon){
|
|
320
329
|
<i [class]="item.icon"> </i>
|
|
321
330
|
}
|
|
322
|
-
<span class="ml-2">{{ item.title }}</span>
|
|
331
|
+
<span class="ml-2">{{ item.title | translate }}</span>
|
|
323
332
|
</div>
|
|
324
333
|
@if(item.activated){
|
|
325
334
|
<i class=" pi pi-check"></i>
|
|
@@ -2710,6 +2719,11 @@ function trimExcelLineBreaks(s) {
|
|
|
2710
2719
|
.replace(/[\r\n]+$/, '') // remove trailing line breaks
|
|
2711
2720
|
.replace(/(\r?\n){2,}/g, '\n'); // collapse multiple to a single
|
|
2712
2721
|
}
|
|
2722
|
+
function collapseInlineSpaces(s) {
|
|
2723
|
+
if (!s)
|
|
2724
|
+
return '';
|
|
2725
|
+
return s.replace(/\u00A0/g, ' ').replace(/[^\S\r\n]+/g, ' ').trim();
|
|
2726
|
+
}
|
|
2713
2727
|
/**
|
|
2714
2728
|
* Exports table rows to a PDF file.
|
|
2715
2729
|
* - Uses jsPDF + autoTable
|
|
@@ -2721,13 +2735,36 @@ function exportRowsToPdf(columns, rows, columnTypeMap, columnTypeEnum, t, fileNa
|
|
|
2721
2735
|
return;
|
|
2722
2736
|
const locale = options.locale || 'en-US';
|
|
2723
2737
|
const head = [columns.map(c => sanitizeText(t(c.header)))];
|
|
2724
|
-
const body = (rows ?? []).map(row => columns.map(
|
|
2725
|
-
|
|
2738
|
+
const body = (rows ?? []).map(row => columns.map((col, idx) => {
|
|
2739
|
+
const type = columnTypeMap[col.field] || col.columnType;
|
|
2740
|
+
if (type === columnTypeEnum.LIST || type === columnTypeEnum.LIST_TAG) {
|
|
2741
|
+
// make each item its own line; keep items intact (no bullets)
|
|
2742
|
+
const rawVal = getNestedValue(row, col.field);
|
|
2743
|
+
const items = Array.isArray(rawVal)
|
|
2744
|
+
? rawVal.map((x) => x?.name ?? x)
|
|
2745
|
+
: String(getDisplayValue(row, col, columnTypeMap, columnTypeEnum, t, locale)).split(/,\s*/);
|
|
2746
|
+
const cleaned = items
|
|
2747
|
+
.map(it => collapseInlineSpaces(String(it)))
|
|
2748
|
+
.filter(Boolean);
|
|
2749
|
+
return sanitizeText(cleaned.join(',\n')); // hard break after commas
|
|
2750
|
+
}
|
|
2751
|
+
const raw = String(getDisplayValue(row, col, columnTypeMap, columnTypeEnum, t, locale));
|
|
2752
|
+
return sanitizeText(collapseInlineSpaces(raw));
|
|
2753
|
+
}));
|
|
2726
2754
|
const doc = new jsPDF({ orientation: 'landscape', unit: 'pt', format: 'A4' });
|
|
2755
|
+
// Build columnStyles dynamically: all LIST/LIST_TAG columns get min width
|
|
2756
|
+
const columnStyles = {};
|
|
2757
|
+
columns.forEach((col, idx) => {
|
|
2758
|
+
const type = columnTypeMap[col.field] || col.columnType;
|
|
2759
|
+
if (type === columnTypeEnum.LIST || type === columnTypeEnum.LIST_TAG) {
|
|
2760
|
+
columnStyles[idx] = { cellWidth: 150 }; // set your min width
|
|
2761
|
+
}
|
|
2762
|
+
});
|
|
2727
2763
|
autoTable(doc, {
|
|
2728
2764
|
head,
|
|
2729
2765
|
body,
|
|
2730
|
-
styles: { fontSize: 9, cellPadding: 5, overflow: 'linebreak' },
|
|
2766
|
+
styles: { fontSize: 9, cellPadding: 5, overflow: 'linebreak', valign: 'top' },
|
|
2767
|
+
columnStyles: Object.keys(columnStyles).length > 0 ? columnStyles : undefined,
|
|
2731
2768
|
margin: { top: 36, right: 24, bottom: 36, left: 24 },
|
|
2732
2769
|
});
|
|
2733
2770
|
doc.save(fileName);
|