we-report-angular 0.4.0 → 0.6.0
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/esm2022/lib/designer/design-surface.component.mjs +399 -28
- package/esm2022/lib/designer/designer-state.mjs +107 -5
- package/esm2022/lib/designer/expression-editor.component.mjs +125 -5
- package/esm2022/lib/designer/property-panel.component.mjs +15 -3
- package/esm2022/lib/designer/we-report-designer.component.mjs +461 -30
- package/esm2022/lib/locales/de.mjs +55 -1
- package/esm2022/lib/locales/es.mjs +55 -1
- package/esm2022/lib/locales/fr.mjs +55 -1
- package/esm2022/lib/viewer/we-report-page.component.mjs +41 -8
- package/esm2022/lib/viewer/we-report-viewer.component.mjs +238 -20
- package/esm2022/lib/we-report-icons.mjs +21 -1
- package/esm2022/lib/we-report-locale.mjs +109 -1
- package/fesm2022/we-report-angular.mjs +1976 -400
- package/fesm2022/we-report-angular.mjs.map +1 -1
- package/lib/designer/design-surface.component.d.ts +66 -2
- package/lib/designer/designer-state.d.ts +36 -3
- package/lib/designer/expression-editor.component.d.ts +21 -0
- package/lib/designer/property-panel.component.d.ts +3 -0
- package/lib/designer/we-report-designer.component.d.ts +116 -5
- package/lib/viewer/we-report-page.component.d.ts +10 -1
- package/lib/viewer/we-report-viewer.component.d.ts +31 -1
- package/lib/we-report-icons.d.ts +20 -0
- package/lib/we-report-locale.d.ts +53 -0
- package/package.json +2 -2
- package/styles/we-report-theme.scss +3 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, makeEnvironmentProviders, inject, Pipe, Injectable, signal, input, Component, ChangeDetectionStrategy, output, computed, effect, untracked,
|
|
3
|
-
import { DEFAULT_FONT_FAMILY, FontRegistry, parseHexColor, loadReportData, layoutReport, renderPdf, reportTable, writeXlsx, DEFAULT_TABLE_BORDER_COLOR, createBlankReport,
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, inject, Pipe, Injectable, signal, input, Component, ChangeDetectionStrategy, output, computed, effect, untracked, viewChild, HostListener, ElementRef, model } from '@angular/core';
|
|
3
|
+
import { DEFAULT_FONT_FAMILY, FontRegistry, parseHexColor, loadReportData, layoutReport, renderPdf, reportTable, writeXlsx, DEFAULT_TABLE_BORDER_COLOR, createBlankReport, EXPRESSION_FUNCTIONS, evaluate, resolveParameters, formatValue, resolveStyle, fitLines, resolvePageGeometry, isExpression, DEFAULT_WATERMARK_COLOR, readImage, captionFor, resolveReportData, inferSchema, PAPER_SIZES, BARCODE_SYMBOLOGIES, LABEL_SHEETS, applyLabelSheet, backendClient, fetchDatabase, findListPaths, sourceValue, csvToObjects, fetchWebService, checkReport, generateListReport } from 'we-report-core';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
import { DOCUMENT } from '@angular/common';
|
|
6
6
|
|
|
@@ -271,6 +271,59 @@ const weReportLocaleEn = {
|
|
|
271
271
|
chartHint: 'A chart shows the rows of its section: every row in a report header or footer, the group’s rows in a group footer.',
|
|
272
272
|
conditionalFormatting: 'Conditional formatting',
|
|
273
273
|
watermark: 'Watermark',
|
|
274
|
+
firstPage: 'First page',
|
|
275
|
+
previousPage: 'Previous page',
|
|
276
|
+
nextPage: 'Next page',
|
|
277
|
+
lastPage: 'Last page',
|
|
278
|
+
pageOf: 'of {0}',
|
|
279
|
+
search: 'Find in report',
|
|
280
|
+
matches: '{0} of {1}',
|
|
281
|
+
noMatches: 'No matches',
|
|
282
|
+
fitPage: 'Whole page',
|
|
283
|
+
keyboardShortcuts: 'Keyboard shortcuts',
|
|
284
|
+
editText: 'Edit the text',
|
|
285
|
+
editFormula: 'Edit the formula…',
|
|
286
|
+
moveItem: 'Move',
|
|
287
|
+
moveFine: 'Move by 0.1 mm',
|
|
288
|
+
resizeItem: 'Make wider / narrower, taller / shorter',
|
|
289
|
+
nextItem: 'Next / previous item',
|
|
290
|
+
rubberBand: 'Select several: drag on an empty spot',
|
|
291
|
+
noSnap: 'Hold while dragging: no snapping',
|
|
292
|
+
dragCopy: 'Drag with Ctrl held to copy',
|
|
293
|
+
wizardTitle: 'Report wizard',
|
|
294
|
+
wizardReportTitle: 'Report title',
|
|
295
|
+
wizardColumns: 'Columns to show',
|
|
296
|
+
noGrouping: 'No grouping',
|
|
297
|
+
wizardTotals: 'Totals of number columns',
|
|
298
|
+
automatic: 'Automatic',
|
|
299
|
+
createReport: 'Create report',
|
|
300
|
+
issueTextCut: 'The text does not fit in its box and is cut off.',
|
|
301
|
+
stretch: 'Extend to the bottom when the section grows',
|
|
302
|
+
stretchHint: 'For cell borders and column lines next to a text that grows.',
|
|
303
|
+
fitToText: 'Fit size to text',
|
|
304
|
+
collapseBand: 'Collapse section',
|
|
305
|
+
expandBand: 'Expand section',
|
|
306
|
+
groupByThis: 'Group rows by this value',
|
|
307
|
+
addTotal: 'Add a total of this column',
|
|
308
|
+
filterFields: 'Find a field',
|
|
309
|
+
previousMatch: 'Previous match',
|
|
310
|
+
nextMatch: 'Next match',
|
|
311
|
+
zoomLevel: 'Zoom',
|
|
312
|
+
sortRows: 'Sort rows by',
|
|
313
|
+
dataOrder: 'Data order',
|
|
314
|
+
addTextHere: 'Add text here',
|
|
315
|
+
fitBandToContent: 'Fit section to its content',
|
|
316
|
+
thumbnails: 'Page thumbnails',
|
|
317
|
+
snapGrid: 'Snap to grid (hold Alt to move freely)',
|
|
318
|
+
gridOff: 'No grid',
|
|
319
|
+
formatPainter: 'Copy formatting: click it, then click another item (Esc cancels)',
|
|
320
|
+
addByClick: 'Click an item (or double-click a field) to add it to the selected section.',
|
|
321
|
+
resizePanel: 'Drag to resize, double-click to hide',
|
|
322
|
+
alignJustify: 'Justify',
|
|
323
|
+
noSelection: 'Nothing selected',
|
|
324
|
+
formatBar: 'Format',
|
|
325
|
+
allBorders: 'Border all round',
|
|
326
|
+
noBorder: 'No border',
|
|
274
327
|
innerList: 'Inner list',
|
|
275
328
|
innerListOf: 'List inside each row',
|
|
276
329
|
innerListHint: 'Repeats for every item of a list inside each row, e.g. a customer’s orders. [field] is the item, [^.field] the row around it.',
|
|
@@ -342,6 +395,7 @@ const weReportLocaleEn = {
|
|
|
342
395
|
Day: 'Day of the month.',
|
|
343
396
|
AddDays: 'A date moved by a number of days, e.g. a due date.',
|
|
344
397
|
Sum: 'Total over the rows in scope (group, page or report).',
|
|
398
|
+
RowNumber: 'Position of the row: 1, 2, 3 … (restarts in every group).',
|
|
345
399
|
Count: 'Number of rows in scope.',
|
|
346
400
|
Avg: 'Average over the rows in scope.',
|
|
347
401
|
Min: 'Smallest value over the rows in scope (or of two values).',
|
|
@@ -624,6 +678,59 @@ const weReportLocaleTr = {
|
|
|
624
678
|
chartHint: 'Grafik bulunduğu bölümün satırlarını gösterir: rapor başlığı veya altlığında tüm satırları, grup altlığında grubun satırlarını.',
|
|
625
679
|
conditionalFormatting: 'Koşullu biçim',
|
|
626
680
|
watermark: 'Filigran',
|
|
681
|
+
firstPage: 'İlk sayfa',
|
|
682
|
+
previousPage: 'Önceki sayfa',
|
|
683
|
+
nextPage: 'Sonraki sayfa',
|
|
684
|
+
lastPage: 'Son sayfa',
|
|
685
|
+
pageOf: '/ {0}',
|
|
686
|
+
search: 'Raporda ara',
|
|
687
|
+
matches: '{0} / {1}',
|
|
688
|
+
noMatches: 'Bulunamadı',
|
|
689
|
+
fitPage: 'Tüm sayfa',
|
|
690
|
+
keyboardShortcuts: 'Klavye kısayolları',
|
|
691
|
+
editText: 'Metni düzenle',
|
|
692
|
+
editFormula: 'Formülü düzenle…',
|
|
693
|
+
moveItem: 'Taşı',
|
|
694
|
+
moveFine: '0,1 mm taşı',
|
|
695
|
+
resizeItem: 'Genişlet / daralt, uzat / kısalt',
|
|
696
|
+
nextItem: 'Sonraki / önceki öğe',
|
|
697
|
+
rubberBand: 'Birden çok seç: boş yerde sürükle',
|
|
698
|
+
noSnap: 'Sürüklerken basılı tut: yapışma yok',
|
|
699
|
+
dragCopy: 'Ctrl basılı sürükleyince kopyalar',
|
|
700
|
+
wizardTitle: 'Rapor sihirbazı',
|
|
701
|
+
wizardReportTitle: 'Rapor başlığı',
|
|
702
|
+
wizardColumns: 'Gösterilecek sütunlar',
|
|
703
|
+
noGrouping: 'Gruplama yok',
|
|
704
|
+
wizardTotals: 'Sayı sütunlarının toplamı',
|
|
705
|
+
automatic: 'Otomatik',
|
|
706
|
+
createReport: 'Raporu oluştur',
|
|
707
|
+
issueTextCut: 'Metin kutusuna sığmıyor, kesiliyor.',
|
|
708
|
+
stretch: 'Bölüm uzayınca alta kadar uzat',
|
|
709
|
+
stretchHint: 'Uzayan bir metnin yanındaki hücre kenarlıkları ve sütun çizgileri için.',
|
|
710
|
+
fitToText: 'Boyutu metne sığdır',
|
|
711
|
+
collapseBand: 'Bölümü daralt',
|
|
712
|
+
expandBand: 'Bölümü genişlet',
|
|
713
|
+
groupByThis: 'Satırları bu değere göre grupla',
|
|
714
|
+
addTotal: 'Bu sütunun toplamını ekle',
|
|
715
|
+
filterFields: 'Alan ara',
|
|
716
|
+
previousMatch: 'Önceki eşleşme',
|
|
717
|
+
nextMatch: 'Sonraki eşleşme',
|
|
718
|
+
zoomLevel: 'Yakınlaştırma',
|
|
719
|
+
sortRows: 'Satırları sırala',
|
|
720
|
+
dataOrder: 'Veri sırası',
|
|
721
|
+
addTextHere: 'Buraya metin ekle',
|
|
722
|
+
fitBandToContent: 'Bölümü içeriğine sığdır',
|
|
723
|
+
thumbnails: 'Sayfa küçük resimleri',
|
|
724
|
+
snapGrid: 'Izgaraya yapıştır (serbest taşımak için Alt basılı tutun)',
|
|
725
|
+
gridOff: 'Izgara yok',
|
|
726
|
+
formatPainter: 'Biçimi kopyala: tıklayın, sonra başka bir öğeye tıklayın (Esc vazgeçer)',
|
|
727
|
+
addByClick: 'Bir öğeye tıklayın (veya bir alana çift tıklayın): seçili bölüme eklenir.',
|
|
728
|
+
resizePanel: 'Boyutlandırmak için sürükleyin, gizlemek için çift tıklayın',
|
|
729
|
+
alignJustify: 'İki yana yasla',
|
|
730
|
+
noSelection: 'Seçili öğe yok',
|
|
731
|
+
formatBar: 'Biçim',
|
|
732
|
+
allBorders: 'Dört kenara çerçeve',
|
|
733
|
+
noBorder: 'Çerçeve yok',
|
|
627
734
|
innerList: 'İç liste',
|
|
628
735
|
innerListOf: 'Her satırın içindeki liste',
|
|
629
736
|
innerListHint: 'Her satırın içindeki listenin her öğesi için tekrarlanır; örneğin müşterinin siparişleri. [alan] öğeyi, [^.alan] dıştaki satırı okur.',
|
|
@@ -695,6 +802,7 @@ const weReportLocaleTr = {
|
|
|
695
802
|
Day: 'Ayın günü.',
|
|
696
803
|
AddDays: 'Tarihe gün ekler; örn. vade tarihi.',
|
|
697
804
|
Sum: 'Kapsamdaki satırların toplamı (grup, sayfa veya rapor).',
|
|
805
|
+
RowNumber: 'Satırın sıra numarası: 1, 2, 3 … (her grupta yeniden başlar).',
|
|
698
806
|
Count: 'Kapsamdaki satır sayısı.',
|
|
699
807
|
Avg: 'Kapsamdaki satırların ortalaması.',
|
|
700
808
|
Min: 'Kapsamdaki en küçük değer (veya iki değerden küçüğü).',
|
|
@@ -983,6 +1091,59 @@ const weReportLocaleDe = {
|
|
|
983
1091
|
chartHint: 'Ein Diagramm zeigt die Zeilen seines Abschnitts: alle Zeilen im Berichtskopf oder -fuß, die Zeilen der Gruppe im Gruppenfuß.',
|
|
984
1092
|
conditionalFormatting: 'Bedingte Formatierung',
|
|
985
1093
|
watermark: 'Wasserzeichen',
|
|
1094
|
+
firstPage: 'Erste Seite',
|
|
1095
|
+
previousPage: 'Vorherige Seite',
|
|
1096
|
+
nextPage: 'Nächste Seite',
|
|
1097
|
+
lastPage: 'Letzte Seite',
|
|
1098
|
+
pageOf: 'von {0}',
|
|
1099
|
+
search: 'Im Bericht suchen',
|
|
1100
|
+
matches: '{0} von {1}',
|
|
1101
|
+
noMatches: 'Keine Treffer',
|
|
1102
|
+
fitPage: 'Ganze Seite',
|
|
1103
|
+
keyboardShortcuts: 'Tastenkürzel',
|
|
1104
|
+
editText: 'Text bearbeiten',
|
|
1105
|
+
editFormula: 'Formel bearbeiten…',
|
|
1106
|
+
moveItem: 'Verschieben',
|
|
1107
|
+
moveFine: 'Um 0,1 mm verschieben',
|
|
1108
|
+
resizeItem: 'Breiter / schmaler, höher / niedriger',
|
|
1109
|
+
nextItem: 'Nächstes / vorheriges Element',
|
|
1110
|
+
rubberBand: 'Mehrere auswählen: auf freier Fläche ziehen',
|
|
1111
|
+
noSnap: 'Beim Ziehen halten: kein Einrasten',
|
|
1112
|
+
dragCopy: 'Mit gedrückter Strg-Taste ziehen, um zu kopieren',
|
|
1113
|
+
wizardTitle: 'Berichtsassistent',
|
|
1114
|
+
wizardReportTitle: 'Berichtstitel',
|
|
1115
|
+
wizardColumns: 'Angezeigte Spalten',
|
|
1116
|
+
noGrouping: 'Keine Gruppierung',
|
|
1117
|
+
wizardTotals: 'Summen der Zahlenspalten',
|
|
1118
|
+
automatic: 'Automatisch',
|
|
1119
|
+
createReport: 'Bericht erstellen',
|
|
1120
|
+
issueTextCut: 'Der Text passt nicht in sein Feld und wird abgeschnitten.',
|
|
1121
|
+
stretch: 'Bis zum unteren Rand verlängern, wenn der Bereich wächst',
|
|
1122
|
+
stretchHint: 'Für Zellrahmen und Spaltenlinien neben einem wachsenden Text.',
|
|
1123
|
+
fitToText: 'Größe an Text anpassen',
|
|
1124
|
+
collapseBand: 'Bereich einklappen',
|
|
1125
|
+
expandBand: 'Bereich ausklappen',
|
|
1126
|
+
groupByThis: 'Zeilen nach diesem Wert gruppieren',
|
|
1127
|
+
addTotal: 'Summe dieser Spalte hinzufügen',
|
|
1128
|
+
filterFields: 'Feld suchen',
|
|
1129
|
+
previousMatch: 'Vorheriger Treffer',
|
|
1130
|
+
nextMatch: 'Nächster Treffer',
|
|
1131
|
+
zoomLevel: 'Zoom',
|
|
1132
|
+
sortRows: 'Zeilen sortieren nach',
|
|
1133
|
+
dataOrder: 'Reihenfolge der Daten',
|
|
1134
|
+
addTextHere: 'Hier Text einfügen',
|
|
1135
|
+
fitBandToContent: 'Bereich an Inhalt anpassen',
|
|
1136
|
+
thumbnails: 'Seitenminiaturen',
|
|
1137
|
+
snapGrid: 'Am Raster ausrichten (Alt halten für freies Verschieben)',
|
|
1138
|
+
gridOff: 'Kein Raster',
|
|
1139
|
+
formatPainter: 'Format übertragen: anklicken, dann ein anderes Element anklicken (Esc bricht ab)',
|
|
1140
|
+
addByClick: 'Element anklicken (oder Feld doppelklicken), um es zum gewählten Abschnitt hinzuzufügen.',
|
|
1141
|
+
resizePanel: 'Ziehen zum Ändern, Doppelklick zum Ausblenden',
|
|
1142
|
+
alignJustify: 'Blocksatz',
|
|
1143
|
+
noSelection: 'Nichts ausgewählt',
|
|
1144
|
+
formatBar: 'Format',
|
|
1145
|
+
allBorders: 'Rahmen ringsum',
|
|
1146
|
+
noBorder: 'Kein Rahmen',
|
|
986
1147
|
innerList: 'Innere Liste',
|
|
987
1148
|
innerListOf: 'Liste in jeder Zeile',
|
|
988
1149
|
innerListHint: 'Wiederholt sich für jedes Element einer Liste in jeder Zeile, z. B. die Bestellungen eines Kunden. [Feld] ist das Element, [^.Feld] die Zeile darum.',
|
|
@@ -1054,6 +1215,7 @@ const weReportLocaleDe = {
|
|
|
1054
1215
|
Day: 'Tag des Monats.',
|
|
1055
1216
|
AddDays: 'Ein um Tage verschobenes Datum, z. B. ein Fälligkeitsdatum.',
|
|
1056
1217
|
Sum: 'Summe über die Zeilen im Bereich (Gruppe, Seite oder Bericht).',
|
|
1218
|
+
RowNumber: 'Position der Zeile: 1, 2, 3 … (beginnt in jeder Gruppe neu).',
|
|
1057
1219
|
Count: 'Anzahl der Zeilen im Bereich.',
|
|
1058
1220
|
Avg: 'Durchschnitt über die Zeilen im Bereich.',
|
|
1059
1221
|
Min: 'Kleinster Wert im Bereich (oder von zwei Werten).',
|
|
@@ -1338,6 +1500,59 @@ const weReportLocaleFr = {
|
|
|
1338
1500
|
chartHint: 'Un graphique montre les lignes de sa section : toutes les lignes dans un en-tête ou pied de rapport, celles du groupe dans un pied de groupe.',
|
|
1339
1501
|
conditionalFormatting: 'Mise en forme conditionnelle',
|
|
1340
1502
|
watermark: 'Filigrane',
|
|
1503
|
+
firstPage: 'Première page',
|
|
1504
|
+
previousPage: 'Page précédente',
|
|
1505
|
+
nextPage: 'Page suivante',
|
|
1506
|
+
lastPage: 'Dernière page',
|
|
1507
|
+
pageOf: 'sur {0}',
|
|
1508
|
+
search: 'Rechercher dans le rapport',
|
|
1509
|
+
matches: '{0} sur {1}',
|
|
1510
|
+
noMatches: 'Aucun résultat',
|
|
1511
|
+
fitPage: 'Page entière',
|
|
1512
|
+
keyboardShortcuts: 'Raccourcis clavier',
|
|
1513
|
+
editText: 'Modifier le texte',
|
|
1514
|
+
editFormula: 'Modifier la formule…',
|
|
1515
|
+
moveItem: 'Déplacer',
|
|
1516
|
+
moveFine: 'Déplacer de 0,1 mm',
|
|
1517
|
+
resizeItem: 'Élargir / rétrécir, agrandir / réduire',
|
|
1518
|
+
nextItem: 'Élément suivant / précédent',
|
|
1519
|
+
rubberBand: 'Sélection multiple : glisser sur un espace vide',
|
|
1520
|
+
noSnap: 'Maintenir en glissant : sans magnétisme',
|
|
1521
|
+
dragCopy: 'Glisser avec Ctrl enfoncée pour copier',
|
|
1522
|
+
wizardTitle: 'Assistant de rapport',
|
|
1523
|
+
wizardReportTitle: 'Titre du rapport',
|
|
1524
|
+
wizardColumns: 'Colonnes à afficher',
|
|
1525
|
+
noGrouping: 'Aucun regroupement',
|
|
1526
|
+
wizardTotals: 'Totaux des colonnes numériques',
|
|
1527
|
+
automatic: 'Automatique',
|
|
1528
|
+
createReport: 'Créer le rapport',
|
|
1529
|
+
issueTextCut: 'Le texte ne tient pas dans sa zone et est coupé.',
|
|
1530
|
+
stretch: 'Prolonger jusqu’en bas quand la section s’agrandit',
|
|
1531
|
+
stretchHint: 'Pour les bordures de cellule et les lignes de colonne à côté d’un texte qui s’agrandit.',
|
|
1532
|
+
fitToText: 'Ajuster la taille au texte',
|
|
1533
|
+
collapseBand: 'Réduire la section',
|
|
1534
|
+
expandBand: 'Développer la section',
|
|
1535
|
+
groupByThis: 'Regrouper les lignes par cette valeur',
|
|
1536
|
+
addTotal: 'Ajouter le total de cette colonne',
|
|
1537
|
+
filterFields: 'Rechercher un champ',
|
|
1538
|
+
previousMatch: 'Résultat précédent',
|
|
1539
|
+
nextMatch: 'Résultat suivant',
|
|
1540
|
+
zoomLevel: 'Zoom',
|
|
1541
|
+
sortRows: 'Trier les lignes par',
|
|
1542
|
+
dataOrder: 'Ordre des données',
|
|
1543
|
+
addTextHere: 'Ajouter un texte ici',
|
|
1544
|
+
fitBandToContent: 'Ajuster la section à son contenu',
|
|
1545
|
+
thumbnails: 'Miniatures des pages',
|
|
1546
|
+
snapGrid: 'Aligner sur la grille (maintenez Alt pour déplacer librement)',
|
|
1547
|
+
gridOff: 'Sans grille',
|
|
1548
|
+
formatPainter: 'Reproduire la mise en forme : cliquez, puis cliquez sur un autre élément (Échap annule)',
|
|
1549
|
+
addByClick: 'Cliquez sur un élément (ou double-cliquez sur un champ) pour l’ajouter à la section choisie.',
|
|
1550
|
+
resizePanel: 'Glisser pour redimensionner, double-cliquer pour masquer',
|
|
1551
|
+
alignJustify: 'Justifier',
|
|
1552
|
+
noSelection: 'Aucune sélection',
|
|
1553
|
+
formatBar: 'Mise en forme',
|
|
1554
|
+
allBorders: 'Bordure tout autour',
|
|
1555
|
+
noBorder: 'Sans bordure',
|
|
1341
1556
|
innerList: 'Liste interne',
|
|
1342
1557
|
innerListOf: 'Liste dans chaque ligne',
|
|
1343
1558
|
innerListHint: 'Se répète pour chaque élément d’une liste dans chaque ligne, ex. les commandes d’un client. [champ] est l’élément, [^.champ] la ligne autour.',
|
|
@@ -1409,6 +1624,7 @@ const weReportLocaleFr = {
|
|
|
1409
1624
|
Day: 'Jour du mois.',
|
|
1410
1625
|
AddDays: 'Une date décalée d’un nombre de jours, ex. une échéance.',
|
|
1411
1626
|
Sum: 'Total des lignes concernées (groupe, page ou rapport).',
|
|
1627
|
+
RowNumber: 'Position de la ligne : 1, 2, 3 … (recommence dans chaque groupe).',
|
|
1412
1628
|
Count: 'Nombre de lignes concernées.',
|
|
1413
1629
|
Avg: 'Moyenne des lignes concernées.',
|
|
1414
1630
|
Min: 'Plus petite valeur des lignes concernées (ou de deux valeurs).',
|
|
@@ -1693,6 +1909,59 @@ const weReportLocaleEs = {
|
|
|
1693
1909
|
chartHint: 'Un gráfico muestra las filas de su sección: todas en un encabezado o pie de informe, las del grupo en un pie de grupo.',
|
|
1694
1910
|
conditionalFormatting: 'Formato condicional',
|
|
1695
1911
|
watermark: 'Marca de agua',
|
|
1912
|
+
firstPage: 'Primera página',
|
|
1913
|
+
previousPage: 'Página anterior',
|
|
1914
|
+
nextPage: 'Página siguiente',
|
|
1915
|
+
lastPage: 'Última página',
|
|
1916
|
+
pageOf: 'de {0}',
|
|
1917
|
+
search: 'Buscar en el informe',
|
|
1918
|
+
matches: '{0} de {1}',
|
|
1919
|
+
noMatches: 'Sin resultados',
|
|
1920
|
+
fitPage: 'Página completa',
|
|
1921
|
+
keyboardShortcuts: 'Atajos de teclado',
|
|
1922
|
+
editText: 'Editar el texto',
|
|
1923
|
+
editFormula: 'Editar la fórmula…',
|
|
1924
|
+
moveItem: 'Mover',
|
|
1925
|
+
moveFine: 'Mover 0,1 mm',
|
|
1926
|
+
resizeItem: 'Más ancho / estrecho, más alto / bajo',
|
|
1927
|
+
nextItem: 'Elemento siguiente / anterior',
|
|
1928
|
+
rubberBand: 'Seleccionar varios: arrastrar en un hueco',
|
|
1929
|
+
noSnap: 'Mantener al arrastrar: sin ajuste',
|
|
1930
|
+
dragCopy: 'Arrastrar con Ctrl pulsado para copiar',
|
|
1931
|
+
wizardTitle: 'Asistente de informes',
|
|
1932
|
+
wizardReportTitle: 'Título del informe',
|
|
1933
|
+
wizardColumns: 'Columnas que se muestran',
|
|
1934
|
+
noGrouping: 'Sin agrupar',
|
|
1935
|
+
wizardTotals: 'Totales de las columnas numéricas',
|
|
1936
|
+
automatic: 'Automático',
|
|
1937
|
+
createReport: 'Crear informe',
|
|
1938
|
+
issueTextCut: 'El texto no cabe en su cuadro y se corta.',
|
|
1939
|
+
stretch: 'Extender hasta abajo cuando la sección crece',
|
|
1940
|
+
stretchHint: 'Para bordes de celda y líneas de columna junto a un texto que crece.',
|
|
1941
|
+
fitToText: 'Ajustar el tamaño al texto',
|
|
1942
|
+
collapseBand: 'Contraer la sección',
|
|
1943
|
+
expandBand: 'Expandir la sección',
|
|
1944
|
+
groupByThis: 'Agrupar filas por este valor',
|
|
1945
|
+
addTotal: 'Añadir el total de esta columna',
|
|
1946
|
+
filterFields: 'Buscar un campo',
|
|
1947
|
+
previousMatch: 'Coincidencia anterior',
|
|
1948
|
+
nextMatch: 'Coincidencia siguiente',
|
|
1949
|
+
zoomLevel: 'Zoom',
|
|
1950
|
+
sortRows: 'Ordenar filas por',
|
|
1951
|
+
dataOrder: 'Orden de los datos',
|
|
1952
|
+
addTextHere: 'Añadir texto aquí',
|
|
1953
|
+
fitBandToContent: 'Ajustar la sección a su contenido',
|
|
1954
|
+
thumbnails: 'Miniaturas de página',
|
|
1955
|
+
snapGrid: 'Ajustar a la cuadrícula (mantenga Alt para mover libremente)',
|
|
1956
|
+
gridOff: 'Sin cuadrícula',
|
|
1957
|
+
formatPainter: 'Copiar formato: haga clic y luego en otro elemento (Esc cancela)',
|
|
1958
|
+
addByClick: 'Pulse un elemento (o doble clic en un campo) para añadirlo a la sección elegida.',
|
|
1959
|
+
resizePanel: 'Arrastrar para cambiar el tamaño, doble clic para ocultar',
|
|
1960
|
+
alignJustify: 'Justificar',
|
|
1961
|
+
noSelection: 'Nada seleccionado',
|
|
1962
|
+
formatBar: 'Formato',
|
|
1963
|
+
allBorders: 'Borde completo',
|
|
1964
|
+
noBorder: 'Sin borde',
|
|
1696
1965
|
innerList: 'Lista interna',
|
|
1697
1966
|
innerListOf: 'Lista dentro de cada fila',
|
|
1698
1967
|
innerListHint: 'Se repite para cada elemento de una lista dentro de cada fila, p. ej. los pedidos de un cliente. [campo] es el elemento, [^.campo] la fila que lo contiene.',
|
|
@@ -1764,6 +2033,7 @@ const weReportLocaleEs = {
|
|
|
1764
2033
|
Day: 'Día del mes.',
|
|
1765
2034
|
AddDays: 'Una fecha desplazada unos días, p. ej. un vencimiento.',
|
|
1766
2035
|
Sum: 'Total de las filas del ámbito (grupo, página o informe).',
|
|
2036
|
+
RowNumber: 'Posición de la fila: 1, 2, 3 … (se reinicia en cada grupo).',
|
|
1767
2037
|
Count: 'Número de filas del ámbito.',
|
|
1768
2038
|
Avg: 'Promedio de las filas del ámbito.',
|
|
1769
2039
|
Min: 'Valor más pequeño del ámbito (o de dos valores).',
|
|
@@ -1841,6 +2111,26 @@ const WE_REPORT_DEFAULT_ICONS = {
|
|
|
1841
2111
|
checkbox: svg('<rect x="4" y="4" width="16" height="16" rx="2"/><path d="M8 12l3 3 5-6"/>'),
|
|
1842
2112
|
preview: svg('<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>'),
|
|
1843
2113
|
design: svg('<path d="M12 20h9M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4z"/>'),
|
|
2114
|
+
textLeft: svg('<path d="M4 6h16M4 10h10M4 14h16M4 18h10"/>'),
|
|
2115
|
+
textCenter: svg('<path d="M4 6h16M7 10h10M4 14h16M7 18h10"/>'),
|
|
2116
|
+
textRight: svg('<path d="M4 6h16M10 10h10M4 14h16M10 18h10"/>'),
|
|
2117
|
+
textJustify: svg('<path d="M4 6h16M4 10h16M4 14h16M4 18h16"/>'),
|
|
2118
|
+
borderAll: svg('<rect x="4" y="4" width="16" height="16" rx="1"/>'),
|
|
2119
|
+
borderNone: svg('<rect x="4" y="4" width="16" height="16" rx="1" stroke-dasharray="2 3"/>'),
|
|
2120
|
+
brush: svg('<rect x="4" y="3" width="14" height="6" rx="1.5"/><path d="M18 6h2v5h-8v3"/><rect x="10.5" y="14" width="3" height="7" rx="1"/>'),
|
|
2121
|
+
firstPage: svg('<path d="M6 5v14M18 6l-7 6 7 6"/>'),
|
|
2122
|
+
previousPage: svg('<path d="M15 6l-6 6 6 6"/>'),
|
|
2123
|
+
nextPage: svg('<path d="M9 6l6 6-6 6"/>'),
|
|
2124
|
+
lastPage: svg('<path d="M18 5v14M6 6l7 6-7 6"/>'),
|
|
2125
|
+
chevronUp: svg('<path d="M6 15l6-6 6 6"/>'),
|
|
2126
|
+
chevronDown: svg('<path d="M6 9l6 6 6-6"/>'),
|
|
2127
|
+
thumbnails: svg('<rect x="3" y="3" width="7" height="8" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><path d="M14 5h7M14 9h5M14 16h7M14 20h5"/>'),
|
|
2128
|
+
keyboard: svg('<rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10"/>'),
|
|
2129
|
+
edit: svg('<path d="M4 20h4L19 9l-4-4L4 16v4z"/><path d="M13.5 6.5l4 4"/>'),
|
|
2130
|
+
fitHeight: svg('<path d="M12 3v18M8 7l4-4 4 4M8 17l4 4 4-4"/>'),
|
|
2131
|
+
noColor: svg('<circle cx="12" cy="12" r="8"/><path d="M6.5 17.5l11-11"/>'),
|
|
2132
|
+
wand: svg('<path d="M4 20L15 9"/><path d="M14 4v3M18 6l-2 2M20 10h-3M17 14l-2-2"/>'),
|
|
2133
|
+
sum: svg('<path d="M17 5H7l5 7-5 7h10"/>'),
|
|
1844
2134
|
table: svg('<rect x="3" y="5" width="18" height="14" rx="1.5"/><path d="M3 10h18M3 14.5h18M9 5v14M15 5v14"/>'),
|
|
1845
2135
|
chart: svg('<path d="M4 20h16"/><rect x="5" y="11" width="3" height="9" rx="0.5"/><rect x="10.5" y="6" width="3" height="14" rx="0.5"/><rect x="16" y="13" width="3" height="7" rx="0.5"/>'),
|
|
1846
2136
|
database: svg('<ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3"/>'),
|
|
@@ -1974,7 +2264,16 @@ const PT_TO_MM = 25.4 / 72;
|
|
|
1974
2264
|
class WeReportPageComponent {
|
|
1975
2265
|
page = input.required();
|
|
1976
2266
|
zoom = input(1);
|
|
2267
|
+
/** Lines containing this text are highlighted (case-insensitive). */
|
|
2268
|
+
highlight = input('');
|
|
2269
|
+
/** The match the viewer is showing now, drawn stronger. */
|
|
2270
|
+
current = input(null);
|
|
2271
|
+
locale = input(undefined);
|
|
1977
2272
|
ptToMm = PT_TO_MM;
|
|
2273
|
+
isHit(text) {
|
|
2274
|
+
const q = this.highlight().trim();
|
|
2275
|
+
return !!q && text.toLocaleLowerCase(this.locale()).includes(q.toLocaleLowerCase(this.locale()));
|
|
2276
|
+
}
|
|
1978
2277
|
text(item) {
|
|
1979
2278
|
return item;
|
|
1980
2279
|
}
|
|
@@ -1995,7 +2294,7 @@ class WeReportPageComponent {
|
|
|
1995
2294
|
return `'${WeReportFontsService.cssFamily(item.fontFamily)}'`;
|
|
1996
2295
|
}
|
|
1997
2296
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1998
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WeReportPageComponent, isStandalone: true, selector: "we-report-page", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: true, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2297
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WeReportPageComponent, isStandalone: true, selector: "we-report-page", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: true, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1999
2298
|
<svg
|
|
2000
2299
|
class="we-report-page"
|
|
2001
2300
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -2003,7 +2302,7 @@ class WeReportPageComponent {
|
|
|
2003
2302
|
[style.width.mm]="page().width * zoom()"
|
|
2004
2303
|
[style.height.mm]="page().height * zoom()"
|
|
2005
2304
|
>
|
|
2006
|
-
@for (item of page().items; track $index) {
|
|
2305
|
+
@for (item of page().items; track $index; let i = $index) {
|
|
2007
2306
|
@switch (item.kind) {
|
|
2008
2307
|
@case ('rect') {
|
|
2009
2308
|
<rect
|
|
@@ -2041,7 +2340,19 @@ class WeReportPageComponent {
|
|
|
2041
2340
|
}
|
|
2042
2341
|
@case ('text') {
|
|
2043
2342
|
<svg [attr.x]="item.x" [attr.y]="item.y" [attr.width]="item.width" [attr.height]="item.height" overflow="hidden">
|
|
2044
|
-
@for (line of text(item).lines; track $index) {
|
|
2343
|
+
@for (line of text(item).lines; track $index; let l = $index) {
|
|
2344
|
+
@if (isHit(line.text)) {
|
|
2345
|
+
<rect
|
|
2346
|
+
class="we-report-page__hit"
|
|
2347
|
+
[class.we-report-page__hit--current]="current()?.item === i && current()?.line === l"
|
|
2348
|
+
[attr.data-hit]="i + '-' + l"
|
|
2349
|
+
[attr.x]="line.x - item.x - 0.4"
|
|
2350
|
+
[attr.y]="line.baseline - item.y - text(item).size * ptToMm * 0.85"
|
|
2351
|
+
[attr.width]="line.width + 0.8"
|
|
2352
|
+
[attr.height]="text(item).size * ptToMm * 1.15"
|
|
2353
|
+
rx="0.4"
|
|
2354
|
+
/>
|
|
2355
|
+
}
|
|
2045
2356
|
<text
|
|
2046
2357
|
class="we-report-page__text"
|
|
2047
2358
|
[attr.x]="line.x - item.x"
|
|
@@ -2078,7 +2389,7 @@ class WeReportPageComponent {
|
|
|
2078
2389
|
}
|
|
2079
2390
|
}
|
|
2080
2391
|
</svg>
|
|
2081
|
-
`, isInline: true, styles: [":host{display:block}.we-report-page{display:block;background:var(--we-report-page-bg, #fff);box-shadow:var(--we-report-page-shadow, 0 1px 3px rgba(0, 0, 0, .2))}.we-report-page__text{white-space:pre;font-kerning:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2392
|
+
`, isInline: true, styles: [":host{display:block}.we-report-page{display:block;background:var(--we-report-page-bg, #fff);box-shadow:var(--we-report-page-shadow, 0 1px 3px rgba(0, 0, 0, .2))}.we-report-page__hit{fill:var(--we-report-search-highlight, rgba(255, 204, 0, .45))}.we-report-page__hit--current{stroke:var(--we-report-accent, #007aff);stroke-width:.4}.we-report-page__text{white-space:pre;font-kerning:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2082
2393
|
}
|
|
2083
2394
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportPageComponent, decorators: [{
|
|
2084
2395
|
type: Component,
|
|
@@ -2090,7 +2401,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2090
2401
|
[style.width.mm]="page().width * zoom()"
|
|
2091
2402
|
[style.height.mm]="page().height * zoom()"
|
|
2092
2403
|
>
|
|
2093
|
-
@for (item of page().items; track $index) {
|
|
2404
|
+
@for (item of page().items; track $index; let i = $index) {
|
|
2094
2405
|
@switch (item.kind) {
|
|
2095
2406
|
@case ('rect') {
|
|
2096
2407
|
<rect
|
|
@@ -2128,7 +2439,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2128
2439
|
}
|
|
2129
2440
|
@case ('text') {
|
|
2130
2441
|
<svg [attr.x]="item.x" [attr.y]="item.y" [attr.width]="item.width" [attr.height]="item.height" overflow="hidden">
|
|
2131
|
-
@for (line of text(item).lines; track $index) {
|
|
2442
|
+
@for (line of text(item).lines; track $index; let l = $index) {
|
|
2443
|
+
@if (isHit(line.text)) {
|
|
2444
|
+
<rect
|
|
2445
|
+
class="we-report-page__hit"
|
|
2446
|
+
[class.we-report-page__hit--current]="current()?.item === i && current()?.line === l"
|
|
2447
|
+
[attr.data-hit]="i + '-' + l"
|
|
2448
|
+
[attr.x]="line.x - item.x - 0.4"
|
|
2449
|
+
[attr.y]="line.baseline - item.y - text(item).size * ptToMm * 0.85"
|
|
2450
|
+
[attr.width]="line.width + 0.8"
|
|
2451
|
+
[attr.height]="text(item).size * ptToMm * 1.15"
|
|
2452
|
+
rx="0.4"
|
|
2453
|
+
/>
|
|
2454
|
+
}
|
|
2132
2455
|
<text
|
|
2133
2456
|
class="we-report-page__text"
|
|
2134
2457
|
[attr.x]="line.x - item.x"
|
|
@@ -2165,7 +2488,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2165
2488
|
}
|
|
2166
2489
|
}
|
|
2167
2490
|
</svg>
|
|
2168
|
-
`, styles: [":host{display:block}.we-report-page{display:block;background:var(--we-report-page-bg, #fff);box-shadow:var(--we-report-page-shadow, 0 1px 3px rgba(0, 0, 0, .2))}.we-report-page__text{white-space:pre;font-kerning:none}\n"] }]
|
|
2491
|
+
`, styles: [":host{display:block}.we-report-page{display:block;background:var(--we-report-page-bg, #fff);box-shadow:var(--we-report-page-shadow, 0 1px 3px rgba(0, 0, 0, .2))}.we-report-page__hit{fill:var(--we-report-search-highlight, rgba(255, 204, 0, .45))}.we-report-page__hit--current{stroke:var(--we-report-accent, #007aff);stroke-width:.4}.we-report-page__text{white-space:pre;font-kerning:none}\n"] }]
|
|
2169
2492
|
}] });
|
|
2170
2493
|
|
|
2171
2494
|
/** Paged preview of a report with zoom, PDF download and print. No server involved. */
|
|
@@ -2223,6 +2546,123 @@ class WeReportViewerComponent {
|
|
|
2223
2546
|
untracked(() => this.layout(report, data, now, params));
|
|
2224
2547
|
}, { allowSignalWrites: true });
|
|
2225
2548
|
}
|
|
2549
|
+
zoomSteps = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
2550
|
+
showThumbs = signal(false);
|
|
2551
|
+
thumbZoom = 0.18;
|
|
2552
|
+
currentPage = signal(1);
|
|
2553
|
+
pageTotal = computed(() => this.document()?.pages.length ?? 0);
|
|
2554
|
+
query = signal('');
|
|
2555
|
+
matchIndex = signal(0);
|
|
2556
|
+
scroller = viewChild('scroller');
|
|
2557
|
+
thumbs = viewChild('thumbs');
|
|
2558
|
+
searchBox = viewChild('searchBox');
|
|
2559
|
+
/** Every line containing the search text: page, item and line index, in reading order. */
|
|
2560
|
+
matches = computed(() => {
|
|
2561
|
+
const q = this.query().trim().toLocaleLowerCase(this.config.locale);
|
|
2562
|
+
const doc = this.document();
|
|
2563
|
+
if (!q || !doc)
|
|
2564
|
+
return [];
|
|
2565
|
+
const out = [];
|
|
2566
|
+
doc.pages.forEach((page, p) => page.items.forEach((item, i) => {
|
|
2567
|
+
if (item.kind !== 'text')
|
|
2568
|
+
return;
|
|
2569
|
+
item.lines.forEach((line, l) => {
|
|
2570
|
+
if (line.text.toLocaleLowerCase(this.config.locale).includes(q))
|
|
2571
|
+
out.push({ page: p, item: i, line: l });
|
|
2572
|
+
});
|
|
2573
|
+
}));
|
|
2574
|
+
return out;
|
|
2575
|
+
});
|
|
2576
|
+
currentHit = computed(() => this.matches()[this.matchIndex()] ?? null);
|
|
2577
|
+
setQuery(value) {
|
|
2578
|
+
this.query.set(value);
|
|
2579
|
+
this.matchIndex.set(0);
|
|
2580
|
+
queueMicrotask(() => this.revealHit());
|
|
2581
|
+
}
|
|
2582
|
+
nextMatch(step) {
|
|
2583
|
+
const n = this.matches().length;
|
|
2584
|
+
if (!n)
|
|
2585
|
+
return;
|
|
2586
|
+
this.matchIndex.set((this.matchIndex() + step + n) % n);
|
|
2587
|
+
queueMicrotask(() => this.revealHit());
|
|
2588
|
+
}
|
|
2589
|
+
revealHit() {
|
|
2590
|
+
const hit = this.currentHit();
|
|
2591
|
+
if (!hit)
|
|
2592
|
+
return;
|
|
2593
|
+
// Rendered after this change: wait a frame, then bring the line into view.
|
|
2594
|
+
requestAnimationFrame(() => {
|
|
2595
|
+
const page = this.scroller()?.nativeElement.querySelector(`[data-page="${hit.page + 1}"]`);
|
|
2596
|
+
const rect = page?.querySelector(`[data-hit="${hit.item}-${hit.line}"]`) ?? page;
|
|
2597
|
+
rect?.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
goToPage(n) {
|
|
2601
|
+
const target = Math.min(Math.max(1, Math.round(n) || 1), this.pageTotal());
|
|
2602
|
+
this.scroller()?.nativeElement.querySelector(`[data-page="${target}"]`)?.scrollIntoView({ block: 'start' });
|
|
2603
|
+
this.setCurrent(target);
|
|
2604
|
+
}
|
|
2605
|
+
/** The page whose top is nearest the top of the view is the current page. */
|
|
2606
|
+
onScroll() {
|
|
2607
|
+
const box = this.scroller()?.nativeElement;
|
|
2608
|
+
if (!box)
|
|
2609
|
+
return;
|
|
2610
|
+
const top = box.getBoundingClientRect().top;
|
|
2611
|
+
let best = 1;
|
|
2612
|
+
box.querySelectorAll('[data-page]').forEach((el) => {
|
|
2613
|
+
if (el.getBoundingClientRect().top - top <= box.clientHeight / 3)
|
|
2614
|
+
best = Number(el.dataset['page']);
|
|
2615
|
+
});
|
|
2616
|
+
if (best !== this.currentPage())
|
|
2617
|
+
this.setCurrent(best);
|
|
2618
|
+
}
|
|
2619
|
+
setCurrent(page) {
|
|
2620
|
+
this.currentPage.set(page);
|
|
2621
|
+
// Keep the current page's thumbnail in sight.
|
|
2622
|
+
this.thumbs()?.nativeElement.children[page - 1]?.scrollIntoView({ block: 'nearest' });
|
|
2623
|
+
}
|
|
2624
|
+
pickZoom(value) {
|
|
2625
|
+
const box = this.scroller()?.nativeElement;
|
|
2626
|
+
const page = this.document()?.pages[0];
|
|
2627
|
+
if ((value === 'width' || value === 'page') && box && page) {
|
|
2628
|
+
const pxPerMm = 96 / 25.4;
|
|
2629
|
+
const byWidth = (box.clientWidth - 64) / (page.width * pxPerMm);
|
|
2630
|
+
const byHeight = (box.clientHeight - 64) / (page.height * pxPerMm);
|
|
2631
|
+
this.setZoom(value === 'width' ? byWidth : Math.min(byWidth, byHeight));
|
|
2632
|
+
}
|
|
2633
|
+
else if (value) {
|
|
2634
|
+
this.setZoom(Number(value));
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
onKeydown(e) {
|
|
2638
|
+
const mod = e.ctrlKey || e.metaKey;
|
|
2639
|
+
const typing = e.target.closest('input, textarea, select');
|
|
2640
|
+
if (mod && e.key.toLowerCase() === 'f') {
|
|
2641
|
+
e.preventDefault();
|
|
2642
|
+
this.searchBox()?.nativeElement.focus();
|
|
2643
|
+
this.searchBox()?.nativeElement.select();
|
|
2644
|
+
}
|
|
2645
|
+
else if (mod && e.key.toLowerCase() === 'p') {
|
|
2646
|
+
e.preventDefault();
|
|
2647
|
+
void this.print();
|
|
2648
|
+
}
|
|
2649
|
+
else if (mod && (e.key === '=' || e.key === '+')) {
|
|
2650
|
+
e.preventDefault();
|
|
2651
|
+
this.setZoom(this.zoomLevel() + 0.1);
|
|
2652
|
+
}
|
|
2653
|
+
else if (mod && e.key === '-') {
|
|
2654
|
+
e.preventDefault();
|
|
2655
|
+
this.setZoom(this.zoomLevel() - 0.1);
|
|
2656
|
+
}
|
|
2657
|
+
else if (!typing && (e.key === 'PageDown' || e.key === 'PageUp')) {
|
|
2658
|
+
e.preventDefault();
|
|
2659
|
+
this.goToPage(this.currentPage() + (e.key === 'PageDown' ? 1 : -1));
|
|
2660
|
+
}
|
|
2661
|
+
else if (!typing && (e.key === 'Home' || e.key === 'End')) {
|
|
2662
|
+
e.preventDefault();
|
|
2663
|
+
this.goToPage(e.key === 'Home' ? 1 : this.pageTotal());
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2226
2666
|
setZoom(value) {
|
|
2227
2667
|
this.zoomLevel.set(Math.min(4, Math.max(0.25, Math.round(value * 100) / 100)));
|
|
2228
2668
|
}
|
|
@@ -2314,12 +2754,37 @@ class WeReportViewerComponent {
|
|
|
2314
2754
|
this.dom.body.appendChild(frame);
|
|
2315
2755
|
}
|
|
2316
2756
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2317
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WeReportViewerComponent, isStandalone: true, selector: "we-report-viewer", inputs: { report: { classPropertyName: "report", publicName: "report", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, printDate: { classPropertyName: "printDate", publicName: "printDate", isSignal: true, isRequired: false, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, fetchFn: { classPropertyName: "fetchFn", publicName: "fetchFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { problems: "problems", rendered: "rendered" }, ngImport: i0, template: `
|
|
2757
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WeReportViewerComponent, isStandalone: true, selector: "we-report-viewer", inputs: { report: { classPropertyName: "report", publicName: "report", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, printDate: { classPropertyName: "printDate", publicName: "printDate", isSignal: true, isRequired: false, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, fetchFn: { classPropertyName: "fetchFn", publicName: "fetchFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { problems: "problems", rendered: "rendered" }, host: { listeners: { "keydown": "onKeydown($event)" } }, viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }, { propertyName: "thumbs", first: true, predicate: ["thumbs"], descendants: true, isSignal: true }, { propertyName: "searchBox", first: true, predicate: ["searchBox"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2318
2758
|
<div class="we-report-viewer__toolbar" role="toolbar">
|
|
2319
|
-
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() - 0.1)" [attr.aria-label]="strings().zoomOut" [title]="strings().zoomOut" [innerHTML]="'zoomOut' | weReportIcon"></button>
|
|
2320
|
-
<
|
|
2321
|
-
|
|
2322
|
-
|
|
2759
|
+
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() - 0.1)" [attr.aria-label]="strings().zoomOut" [title]="strings().zoomOut + ' (Ctrl+-)'" [innerHTML]="'zoomOut' | weReportIcon"></button>
|
|
2760
|
+
<select class="we-report-viewer__zoomsel" (change)="pickZoom($any($event.target).value); $any($event.target).value = ''" [attr.aria-label]="strings().zoomLevel">
|
|
2761
|
+
<option value="" selected>{{ (zoomLevel() * 100).toFixed(0) }}%</option>
|
|
2762
|
+
@for (z of zoomSteps; track z) {
|
|
2763
|
+
<option [value]="z">{{ z * 100 }}%</option>
|
|
2764
|
+
}
|
|
2765
|
+
<option value="width">{{ strings().fitWidth }}</option>
|
|
2766
|
+
<option value="page">{{ strings().fitPage }}</option>
|
|
2767
|
+
</select>
|
|
2768
|
+
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() + 0.1)" [attr.aria-label]="strings().zoomIn" [title]="strings().zoomIn + ' (Ctrl+=)'" [innerHTML]="'zoomIn' | weReportIcon"></button>
|
|
2769
|
+
@if (pageTotal() > 1) {
|
|
2770
|
+
<span class="we-report-viewer__sep"></span>
|
|
2771
|
+
<button type="button" class="we-report-viewer__btn" [class.we-report-viewer__btn--on]="showThumbs()" (click)="showThumbs.set(!showThumbs())" [title]="strings().thumbnails" [attr.aria-label]="strings().thumbnails" [attr.aria-pressed]="showThumbs()" [innerHTML]="'thumbnails' | weReportIcon"></button>
|
|
2772
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="currentPage() <= 1" (click)="goToPage(1)" [title]="strings().firstPage + ' (Home)'" [attr.aria-label]="strings().firstPage" [innerHTML]="'firstPage' | weReportIcon"></button>
|
|
2773
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="currentPage() <= 1" (click)="goToPage(currentPage() - 1)" [title]="strings().previousPage + ' (PgUp)'" [attr.aria-label]="strings().previousPage" [innerHTML]="'previousPage' | weReportIcon"></button>
|
|
2774
|
+
<input class="we-report-viewer__pagebox" type="number" min="1" [max]="pageTotal()" [value]="currentPage()" (change)="goToPage(+$any($event.target).value)" [attr.aria-label]="strings().pageNumber" />
|
|
2775
|
+
<span class="we-report-viewer__pages">{{ strings().pageOf.replace('{0}', '' + pageTotal()) }}</span>
|
|
2776
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="currentPage() >= pageTotal()" (click)="goToPage(currentPage() + 1)" [title]="strings().nextPage + ' (PgDn)'" [attr.aria-label]="strings().nextPage" [innerHTML]="'nextPage' | weReportIcon"></button>
|
|
2777
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="currentPage() >= pageTotal()" (click)="goToPage(pageTotal())" [title]="strings().lastPage + ' (End)'" [attr.aria-label]="strings().lastPage" [innerHTML]="'lastPage' | weReportIcon"></button>
|
|
2778
|
+
} @else {
|
|
2779
|
+
<span class="we-report-viewer__pages">{{ pageLabel() }}</span>
|
|
2780
|
+
}
|
|
2781
|
+
<span class="we-report-viewer__sep"></span>
|
|
2782
|
+
<input #searchBox class="we-report-viewer__search" type="search" [placeholder]="strings().search + ' (Ctrl+F)'" [value]="query()" (input)="setQuery($any($event.target).value)" (keydown.enter)="nextMatch($any($event).shiftKey ? -1 : 1)" [attr.aria-label]="strings().search" />
|
|
2783
|
+
@if (query().trim()) {
|
|
2784
|
+
<span class="we-report-viewer__pages">{{ matches().length ? strings().matches.replace('{0}', '' + (matchIndex() + 1)).replace('{1}', '' + matches().length) : strings().noMatches }}</span>
|
|
2785
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="!matches().length" (click)="nextMatch(-1)" [attr.aria-label]="strings().previousMatch" [title]="strings().previousMatch + ' (Shift+Enter)'" [innerHTML]="'chevronUp' | weReportIcon"></button>
|
|
2786
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="!matches().length" (click)="nextMatch(1)" [attr.aria-label]="strings().nextMatch" [title]="strings().nextMatch + ' (Enter)'" [innerHTML]="'chevronDown' | weReportIcon"></button>
|
|
2787
|
+
}
|
|
2323
2788
|
<span class="we-report-viewer__spacer"></span>
|
|
2324
2789
|
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="print()" [disabled]="!document()">
|
|
2325
2790
|
<span [innerHTML]="'print' | weReportIcon"></span>{{ strings().print }}
|
|
@@ -2374,25 +2839,74 @@ class WeReportViewerComponent {
|
|
|
2374
2839
|
</ul>
|
|
2375
2840
|
</details>
|
|
2376
2841
|
}
|
|
2377
|
-
<div class="we-report-
|
|
2842
|
+
<div class="we-report-viewer__main">
|
|
2843
|
+
@if (showThumbs() && pageTotal() > 1) {
|
|
2844
|
+
<nav #thumbs class="we-report-viewer__thumbs" [attr.aria-label]="strings().thumbnails">
|
|
2845
|
+
@for (page of document()!.pages; track $index; let p = $index) {
|
|
2846
|
+
<button type="button" class="we-report-viewer__thumb" [class.we-report-viewer__thumb--current]="currentPage() === p + 1" (click)="goToPage(p + 1)" [attr.aria-label]="strings().pageNumber + ' ' + (p + 1)">
|
|
2847
|
+
@defer (on viewport) {
|
|
2848
|
+
<we-report-page [page]="page" [zoom]="thumbZoom" />
|
|
2849
|
+
} @placeholder {
|
|
2850
|
+
<div class="we-report-viewer__thumb-blank" [style.width.mm]="page.width * thumbZoom" [style.height.mm]="page.height * thumbZoom"></div>
|
|
2851
|
+
}
|
|
2852
|
+
<span>{{ p + 1 }}</span>
|
|
2853
|
+
</button>
|
|
2854
|
+
}
|
|
2855
|
+
</nav>
|
|
2856
|
+
}
|
|
2857
|
+
<div #scroller class="we-report-viewer__scroll" tabindex="0" (scroll)="onScroll()">
|
|
2378
2858
|
@if (document(); as doc) {
|
|
2379
|
-
@for (page of doc.pages; track $index) {
|
|
2380
|
-
<we-report-page
|
|
2859
|
+
@for (page of doc.pages; track $index; let p = $index) {
|
|
2860
|
+
<we-report-page
|
|
2861
|
+
class="we-report-viewer__page"
|
|
2862
|
+
[attr.data-page]="p + 1"
|
|
2863
|
+
[page]="page"
|
|
2864
|
+
[zoom]="zoomLevel()"
|
|
2865
|
+
[highlight]="query()"
|
|
2866
|
+
[locale]="config.locale"
|
|
2867
|
+
[current]="currentHit()?.page === p ? currentHit() : null"
|
|
2868
|
+
/>
|
|
2381
2869
|
}
|
|
2382
2870
|
} @else if (!error()) {
|
|
2383
2871
|
<div class="we-report-viewer__loading">{{ strings().loading }}</div>
|
|
2384
2872
|
}
|
|
2385
2873
|
</div>
|
|
2386
|
-
|
|
2874
|
+
</div>
|
|
2875
|
+
`, isInline: true, styles: [":host{display:flex;flex-direction:column;min-height:0;font-family:var(--we-report-font-family, system-ui, sans-serif);font-size:13px;letter-spacing:-.003em;color:var(--we-report-fg, #1d1d1f);background:var(--we-report-workspace-bg, #f2f2f7);-webkit-font-smoothing:antialiased}.we-report-viewer__toolbar,.we-report-viewer__params{position:relative;z-index:1;display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:8px 14px;background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.we-report-viewer__btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:30px;height:30px;border:0;border-radius:var(--we-report-control-radius, 7px);background:transparent;color:inherit;font:inherit;font-weight:500;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease}.we-report-viewer__btn--text{padding:0 10px}.we-report-viewer__btn:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.we-report-viewer__btn:focus-visible,.we-report-viewer__params input:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.we-report-viewer__btn:disabled{opacity:.3;cursor:default}.we-report-viewer__btn :is(svg){width:17px;height:17px}.we-report-viewer__zoom{min-width:44px;text-align:center;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.we-report-viewer__pages{margin-left:8px;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.we-report-viewer__sep{width:.5px;height:20px;margin:0 6px;background:var(--we-report-separator, rgba(60, 60, 67, .14))}.we-report-viewer__zoomsel,.we-report-viewer__pagebox,.we-report-viewer__search{height:28px;box-sizing:border-box;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 8px;background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:inherit;font-variant-numeric:tabular-nums}.we-report-viewer__zoomsel:focus,.we-report-viewer__pagebox:focus,.we-report-viewer__search:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.we-report-viewer__pagebox{width:56px;text-align:center}.we-report-viewer__search{width:180px}.we-report-viewer__scroll:focus{outline:none}.we-report-viewer__spacer{flex:1}.we-report-viewer__main{flex:1;display:flex;min-height:0}.we-report-viewer__thumbs{flex:none;display:flex;flex-direction:column;align-items:center;gap:12px;overflow:auto;padding:16px 12px;border-right:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14));background:var(--we-report-panel-bg, #fbfbfd)}.we-report-viewer__thumb{display:flex;flex-direction:column;align-items:center;gap:4px;border:0;padding:4px;border-radius:6px;background:none;color:inherit;font:inherit;font-size:11px;cursor:pointer}.we-report-viewer__thumb--current{background:var(--we-report-selection-fill, rgba(0, 122, 255, .12))}.we-report-viewer__thumb we-report-page,.we-report-viewer__thumb-blank{background:var(--we-report-page-bg, #fff);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14));pointer-events:none}.we-report-viewer__btn--on{background:var(--we-report-selection-fill, rgba(0, 122, 255, .12))}.we-report-viewer__scroll{flex:1;overflow:auto;padding:32px;display:flex;flex-direction:column;align-items:center;gap:32px}.we-report-viewer__page{border-radius:2px}.we-report-viewer__params{align-items:flex-end;gap:12px;font-size:12px}.we-report-viewer__params label{display:flex;flex-direction:column;gap:3px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.we-report-viewer__params input:not([type=checkbox]){font:inherit;font-size:13px;padding:5px 8px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:var(--we-report-fg, #1d1d1f)}.we-report-viewer__params input[type=checkbox]{accent-color:var(--we-report-accent, #007aff)}.we-report-viewer__params button[type=submit]{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff);padding:0 14px}.we-report-viewer__params button[type=submit]:hover{background:var(--we-report-accent, #007aff);filter:brightness(1.08)}.we-report-viewer__error,.we-report-viewer__problems{margin:10px 14px 0;padding:10px 14px;border-radius:10px;font-size:13px;background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000)}.we-report-viewer__problems summary{cursor:pointer;font-weight:500}.we-report-viewer__problems ul{margin:6px 0 0;padding-left:18px}.we-report-viewer__loading{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}@media (prefers-reduced-motion: reduce){.we-report-viewer__btn{transition:none}}@media print{.we-report-viewer__toolbar{display:none}}\n"], dependencies: [{ kind: "component", type: WeReportPageComponent, selector: "we-report-page", inputs: ["page", "zoom", "highlight", "current", "locale"] }, { kind: "pipe", type: WeReportIconPipe, name: "weReportIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [WeReportPageComponent]] });
|
|
2387
2876
|
}
|
|
2388
2877
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportViewerComponent, decorators: [{
|
|
2389
2878
|
type: Component,
|
|
2390
2879
|
args: [{ selector: 'we-report-viewer', standalone: true, imports: [WeReportPageComponent, WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2391
2880
|
<div class="we-report-viewer__toolbar" role="toolbar">
|
|
2392
|
-
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() - 0.1)" [attr.aria-label]="strings().zoomOut" [title]="strings().zoomOut" [innerHTML]="'zoomOut' | weReportIcon"></button>
|
|
2393
|
-
<
|
|
2394
|
-
|
|
2395
|
-
|
|
2881
|
+
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() - 0.1)" [attr.aria-label]="strings().zoomOut" [title]="strings().zoomOut + ' (Ctrl+-)'" [innerHTML]="'zoomOut' | weReportIcon"></button>
|
|
2882
|
+
<select class="we-report-viewer__zoomsel" (change)="pickZoom($any($event.target).value); $any($event.target).value = ''" [attr.aria-label]="strings().zoomLevel">
|
|
2883
|
+
<option value="" selected>{{ (zoomLevel() * 100).toFixed(0) }}%</option>
|
|
2884
|
+
@for (z of zoomSteps; track z) {
|
|
2885
|
+
<option [value]="z">{{ z * 100 }}%</option>
|
|
2886
|
+
}
|
|
2887
|
+
<option value="width">{{ strings().fitWidth }}</option>
|
|
2888
|
+
<option value="page">{{ strings().fitPage }}</option>
|
|
2889
|
+
</select>
|
|
2890
|
+
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() + 0.1)" [attr.aria-label]="strings().zoomIn" [title]="strings().zoomIn + ' (Ctrl+=)'" [innerHTML]="'zoomIn' | weReportIcon"></button>
|
|
2891
|
+
@if (pageTotal() > 1) {
|
|
2892
|
+
<span class="we-report-viewer__sep"></span>
|
|
2893
|
+
<button type="button" class="we-report-viewer__btn" [class.we-report-viewer__btn--on]="showThumbs()" (click)="showThumbs.set(!showThumbs())" [title]="strings().thumbnails" [attr.aria-label]="strings().thumbnails" [attr.aria-pressed]="showThumbs()" [innerHTML]="'thumbnails' | weReportIcon"></button>
|
|
2894
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="currentPage() <= 1" (click)="goToPage(1)" [title]="strings().firstPage + ' (Home)'" [attr.aria-label]="strings().firstPage" [innerHTML]="'firstPage' | weReportIcon"></button>
|
|
2895
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="currentPage() <= 1" (click)="goToPage(currentPage() - 1)" [title]="strings().previousPage + ' (PgUp)'" [attr.aria-label]="strings().previousPage" [innerHTML]="'previousPage' | weReportIcon"></button>
|
|
2896
|
+
<input class="we-report-viewer__pagebox" type="number" min="1" [max]="pageTotal()" [value]="currentPage()" (change)="goToPage(+$any($event.target).value)" [attr.aria-label]="strings().pageNumber" />
|
|
2897
|
+
<span class="we-report-viewer__pages">{{ strings().pageOf.replace('{0}', '' + pageTotal()) }}</span>
|
|
2898
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="currentPage() >= pageTotal()" (click)="goToPage(currentPage() + 1)" [title]="strings().nextPage + ' (PgDn)'" [attr.aria-label]="strings().nextPage" [innerHTML]="'nextPage' | weReportIcon"></button>
|
|
2899
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="currentPage() >= pageTotal()" (click)="goToPage(pageTotal())" [title]="strings().lastPage + ' (End)'" [attr.aria-label]="strings().lastPage" [innerHTML]="'lastPage' | weReportIcon"></button>
|
|
2900
|
+
} @else {
|
|
2901
|
+
<span class="we-report-viewer__pages">{{ pageLabel() }}</span>
|
|
2902
|
+
}
|
|
2903
|
+
<span class="we-report-viewer__sep"></span>
|
|
2904
|
+
<input #searchBox class="we-report-viewer__search" type="search" [placeholder]="strings().search + ' (Ctrl+F)'" [value]="query()" (input)="setQuery($any($event.target).value)" (keydown.enter)="nextMatch($any($event).shiftKey ? -1 : 1)" [attr.aria-label]="strings().search" />
|
|
2905
|
+
@if (query().trim()) {
|
|
2906
|
+
<span class="we-report-viewer__pages">{{ matches().length ? strings().matches.replace('{0}', '' + (matchIndex() + 1)).replace('{1}', '' + matches().length) : strings().noMatches }}</span>
|
|
2907
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="!matches().length" (click)="nextMatch(-1)" [attr.aria-label]="strings().previousMatch" [title]="strings().previousMatch + ' (Shift+Enter)'" [innerHTML]="'chevronUp' | weReportIcon"></button>
|
|
2908
|
+
<button type="button" class="we-report-viewer__btn" [disabled]="!matches().length" (click)="nextMatch(1)" [attr.aria-label]="strings().nextMatch" [title]="strings().nextMatch + ' (Enter)'" [innerHTML]="'chevronDown' | weReportIcon"></button>
|
|
2909
|
+
}
|
|
2396
2910
|
<span class="we-report-viewer__spacer"></span>
|
|
2397
2911
|
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="print()" [disabled]="!document()">
|
|
2398
2912
|
<span [innerHTML]="'print' | weReportIcon"></span>{{ strings().print }}
|
|
@@ -2447,17 +2961,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2447
2961
|
</ul>
|
|
2448
2962
|
</details>
|
|
2449
2963
|
}
|
|
2450
|
-
<div class="we-report-
|
|
2964
|
+
<div class="we-report-viewer__main">
|
|
2965
|
+
@if (showThumbs() && pageTotal() > 1) {
|
|
2966
|
+
<nav #thumbs class="we-report-viewer__thumbs" [attr.aria-label]="strings().thumbnails">
|
|
2967
|
+
@for (page of document()!.pages; track $index; let p = $index) {
|
|
2968
|
+
<button type="button" class="we-report-viewer__thumb" [class.we-report-viewer__thumb--current]="currentPage() === p + 1" (click)="goToPage(p + 1)" [attr.aria-label]="strings().pageNumber + ' ' + (p + 1)">
|
|
2969
|
+
@defer (on viewport) {
|
|
2970
|
+
<we-report-page [page]="page" [zoom]="thumbZoom" />
|
|
2971
|
+
} @placeholder {
|
|
2972
|
+
<div class="we-report-viewer__thumb-blank" [style.width.mm]="page.width * thumbZoom" [style.height.mm]="page.height * thumbZoom"></div>
|
|
2973
|
+
}
|
|
2974
|
+
<span>{{ p + 1 }}</span>
|
|
2975
|
+
</button>
|
|
2976
|
+
}
|
|
2977
|
+
</nav>
|
|
2978
|
+
}
|
|
2979
|
+
<div #scroller class="we-report-viewer__scroll" tabindex="0" (scroll)="onScroll()">
|
|
2451
2980
|
@if (document(); as doc) {
|
|
2452
|
-
@for (page of doc.pages; track $index) {
|
|
2453
|
-
<we-report-page
|
|
2981
|
+
@for (page of doc.pages; track $index; let p = $index) {
|
|
2982
|
+
<we-report-page
|
|
2983
|
+
class="we-report-viewer__page"
|
|
2984
|
+
[attr.data-page]="p + 1"
|
|
2985
|
+
[page]="page"
|
|
2986
|
+
[zoom]="zoomLevel()"
|
|
2987
|
+
[highlight]="query()"
|
|
2988
|
+
[locale]="config.locale"
|
|
2989
|
+
[current]="currentHit()?.page === p ? currentHit() : null"
|
|
2990
|
+
/>
|
|
2454
2991
|
}
|
|
2455
2992
|
} @else if (!error()) {
|
|
2456
2993
|
<div class="we-report-viewer__loading">{{ strings().loading }}</div>
|
|
2457
2994
|
}
|
|
2458
2995
|
</div>
|
|
2459
|
-
|
|
2460
|
-
|
|
2996
|
+
</div>
|
|
2997
|
+
`, styles: [":host{display:flex;flex-direction:column;min-height:0;font-family:var(--we-report-font-family, system-ui, sans-serif);font-size:13px;letter-spacing:-.003em;color:var(--we-report-fg, #1d1d1f);background:var(--we-report-workspace-bg, #f2f2f7);-webkit-font-smoothing:antialiased}.we-report-viewer__toolbar,.we-report-viewer__params{position:relative;z-index:1;display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:8px 14px;background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.we-report-viewer__btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:30px;height:30px;border:0;border-radius:var(--we-report-control-radius, 7px);background:transparent;color:inherit;font:inherit;font-weight:500;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease}.we-report-viewer__btn--text{padding:0 10px}.we-report-viewer__btn:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.we-report-viewer__btn:focus-visible,.we-report-viewer__params input:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.we-report-viewer__btn:disabled{opacity:.3;cursor:default}.we-report-viewer__btn :is(svg){width:17px;height:17px}.we-report-viewer__zoom{min-width:44px;text-align:center;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.we-report-viewer__pages{margin-left:8px;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.we-report-viewer__sep{width:.5px;height:20px;margin:0 6px;background:var(--we-report-separator, rgba(60, 60, 67, .14))}.we-report-viewer__zoomsel,.we-report-viewer__pagebox,.we-report-viewer__search{height:28px;box-sizing:border-box;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 8px;background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:inherit;font-variant-numeric:tabular-nums}.we-report-viewer__zoomsel:focus,.we-report-viewer__pagebox:focus,.we-report-viewer__search:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.we-report-viewer__pagebox{width:56px;text-align:center}.we-report-viewer__search{width:180px}.we-report-viewer__scroll:focus{outline:none}.we-report-viewer__spacer{flex:1}.we-report-viewer__main{flex:1;display:flex;min-height:0}.we-report-viewer__thumbs{flex:none;display:flex;flex-direction:column;align-items:center;gap:12px;overflow:auto;padding:16px 12px;border-right:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14));background:var(--we-report-panel-bg, #fbfbfd)}.we-report-viewer__thumb{display:flex;flex-direction:column;align-items:center;gap:4px;border:0;padding:4px;border-radius:6px;background:none;color:inherit;font:inherit;font-size:11px;cursor:pointer}.we-report-viewer__thumb--current{background:var(--we-report-selection-fill, rgba(0, 122, 255, .12))}.we-report-viewer__thumb we-report-page,.we-report-viewer__thumb-blank{background:var(--we-report-page-bg, #fff);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14));pointer-events:none}.we-report-viewer__btn--on{background:var(--we-report-selection-fill, rgba(0, 122, 255, .12))}.we-report-viewer__scroll{flex:1;overflow:auto;padding:32px;display:flex;flex-direction:column;align-items:center;gap:32px}.we-report-viewer__page{border-radius:2px}.we-report-viewer__params{align-items:flex-end;gap:12px;font-size:12px}.we-report-viewer__params label{display:flex;flex-direction:column;gap:3px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.we-report-viewer__params input:not([type=checkbox]){font:inherit;font-size:13px;padding:5px 8px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:var(--we-report-fg, #1d1d1f)}.we-report-viewer__params input[type=checkbox]{accent-color:var(--we-report-accent, #007aff)}.we-report-viewer__params button[type=submit]{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff);padding:0 14px}.we-report-viewer__params button[type=submit]:hover{background:var(--we-report-accent, #007aff);filter:brightness(1.08)}.we-report-viewer__error,.we-report-viewer__problems{margin:10px 14px 0;padding:10px 14px;border-radius:10px;font-size:13px;background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000)}.we-report-viewer__problems summary{cursor:pointer;font-weight:500}.we-report-viewer__problems ul{margin:6px 0 0;padding-left:18px}.we-report-viewer__loading{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}@media (prefers-reduced-motion: reduce){.we-report-viewer__btn{transition:none}}@media print{.we-report-viewer__toolbar{display:none}}\n"] }]
|
|
2998
|
+
}], ctorParameters: () => [], propDecorators: { onKeydown: [{
|
|
2999
|
+
type: HostListener,
|
|
3000
|
+
args: ['keydown', ['$event']]
|
|
3001
|
+
}] } });
|
|
2461
3002
|
|
|
2462
3003
|
/** Toolbox entries in display order. */
|
|
2463
3004
|
const TOOLBOX_ITEMS = [
|
|
@@ -2524,6 +3065,22 @@ function fieldExpression(path, parent) {
|
|
|
2524
3065
|
/** Module-wide, so copy in one designer and paste in another on the same page works. */
|
|
2525
3066
|
let clipboard = [];
|
|
2526
3067
|
const round$1 = (v) => Math.round(v * 100) / 100;
|
|
3068
|
+
/** Marks designer items on the system clipboard, so they paste into another tab or window. */
|
|
3069
|
+
const CLIPBOARD_MARKER = 'we-report/controls+json:';
|
|
3070
|
+
const CONTROL_TYPES = {
|
|
3071
|
+
text: true, line: true, shape: true, image: true, barcode: true, pageInfo: true, checkbox: true, chart: true, table: true,
|
|
3072
|
+
};
|
|
3073
|
+
function isPastedControl(c) {
|
|
3074
|
+
if (!c || typeof c !== 'object')
|
|
3075
|
+
return false;
|
|
3076
|
+
const x = c;
|
|
3077
|
+
const finite = (v) => typeof v === 'number' && Number.isFinite(v);
|
|
3078
|
+
return (typeof x['id'] === 'string' &&
|
|
3079
|
+
typeof x['type'] === 'string' &&
|
|
3080
|
+
Object.hasOwn(CONTROL_TYPES, x['type']) &&
|
|
3081
|
+
['x', 'y', 'width', 'height'].every((k) => finite(x[k])) &&
|
|
3082
|
+
(x['type'] !== 'table' || (Array.isArray(x['columns']) && Array.isArray(x['rows']) && x['rows'].every((r) => Array.isArray(r?.cells)))));
|
|
3083
|
+
}
|
|
2527
3084
|
const HISTORY_LIMIT = 200;
|
|
2528
3085
|
const COALESCE_MS = 800;
|
|
2529
3086
|
/** Copies the editable parts; data source payloads (possibly large) are shared, never mutated. */
|
|
@@ -2548,6 +3105,20 @@ class DesignerState {
|
|
|
2548
3105
|
canRedo = signal(false);
|
|
2549
3106
|
/** The table cell last clicked; the inspector edits it while its table is selected. */
|
|
2550
3107
|
tableCell = signal(null);
|
|
3108
|
+
/** Sections folded away in the designer to save room (not saved in the report). */
|
|
3109
|
+
collapsed = signal(new Set());
|
|
3110
|
+
toggleCollapsed(bandId) {
|
|
3111
|
+
const next = new Set(this.collapsed());
|
|
3112
|
+
if (!next.delete(bandId))
|
|
3113
|
+
next.add(bandId);
|
|
3114
|
+
this.collapsed.set(next);
|
|
3115
|
+
}
|
|
3116
|
+
/** Format painter: the look picked up from one item, applied to the next item clicked. */
|
|
3117
|
+
painter = signal(null);
|
|
3118
|
+
/** Text being typed on the page (double-click / F2): a text control, or a cell of a table. */
|
|
3119
|
+
editing = signal(null);
|
|
3120
|
+
/** Where the pointer is on the page, for the status bar: band and mm inside it. */
|
|
3121
|
+
pointer = signal(null);
|
|
2551
3122
|
/** The first data row and its scope, for live values in the design and the formula editor. */
|
|
2552
3123
|
sample = signal(null);
|
|
2553
3124
|
selectedControls = computed(() => {
|
|
@@ -2614,12 +3185,13 @@ class DesignerState {
|
|
|
2614
3185
|
this.pruneSelection();
|
|
2615
3186
|
this.syncFlags();
|
|
2616
3187
|
}
|
|
2617
|
-
/** A new id not used by any band or control. */
|
|
2618
|
-
newId(prefix) {
|
|
3188
|
+
/** A new id not used by any band or control; pass the same `taken` set when making several ids before the report changes. */
|
|
3189
|
+
newId(prefix, taken = new Set()) {
|
|
2619
3190
|
const used = new Set(this.report().bands.flatMap((b) => [b.id, ...b.controls.map((c) => c.id)]));
|
|
2620
3191
|
let n = 1;
|
|
2621
|
-
while (used.has(`${prefix}${n}`))
|
|
3192
|
+
while (used.has(`${prefix}${n}`) || taken.has(`${prefix}${n}`))
|
|
2622
3193
|
n++;
|
|
3194
|
+
taken.add(`${prefix}${n}`);
|
|
2623
3195
|
return `${prefix}${n}`;
|
|
2624
3196
|
}
|
|
2625
3197
|
findBandOf(controlId, def = this.report()) {
|
|
@@ -2667,10 +3239,11 @@ class DesignerState {
|
|
|
2667
3239
|
const controls = this.selectedControls();
|
|
2668
3240
|
if (!controls.length)
|
|
2669
3241
|
return;
|
|
3242
|
+
const taken = new Set();
|
|
2670
3243
|
const copies = [];
|
|
2671
3244
|
for (const c of controls) {
|
|
2672
3245
|
const band = this.findBandOf(c.id);
|
|
2673
|
-
copies.push({ bandId: band.id, control: { ...structuredClone(c), id: this.newId(c.type), x: c.x + 3, y: c.y + 3 } });
|
|
3246
|
+
copies.push({ bandId: band.id, control: { ...structuredClone(c), id: this.newId(c.type, taken), x: c.x + 3, y: c.y + 3 } });
|
|
2674
3247
|
}
|
|
2675
3248
|
this.update((d) => copies.forEach(({ bandId, control }) => d.bands.find((b) => b.id === bandId).controls.push(control)));
|
|
2676
3249
|
this.selection.set({ kind: 'controls', ids: copies.map((c) => c.control.id) });
|
|
@@ -2718,6 +3291,26 @@ class DesignerState {
|
|
|
2718
3291
|
}));
|
|
2719
3292
|
this.selection.set({ kind: 'controls', ids: placed.map((p) => p.control.id) });
|
|
2720
3293
|
}
|
|
3294
|
+
/** The copied items as text for the system clipboard. */
|
|
3295
|
+
clipboardText() {
|
|
3296
|
+
return CLIPBOARD_MARKER + JSON.stringify(clipboard);
|
|
3297
|
+
}
|
|
3298
|
+
/** Takes items copied in another designer (another tab or window); false when it is not ours. */
|
|
3299
|
+
loadClipboard(text) {
|
|
3300
|
+
if (!text.startsWith(CLIPBOARD_MARKER))
|
|
3301
|
+
return false;
|
|
3302
|
+
try {
|
|
3303
|
+
const items = JSON.parse(text.slice(CLIPBOARD_MARKER.length));
|
|
3304
|
+
// Any program can write this text: take only items the designer can draw.
|
|
3305
|
+
if (!Array.isArray(items) || !items.length || !items.every((i) => isPastedControl(i?.control)))
|
|
3306
|
+
return false;
|
|
3307
|
+
clipboard = items;
|
|
3308
|
+
return true;
|
|
3309
|
+
}
|
|
3310
|
+
catch {
|
|
3311
|
+
return false;
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
2721
3314
|
hasClipboard() {
|
|
2722
3315
|
return clipboard.length > 0;
|
|
2723
3316
|
}
|
|
@@ -2788,6 +3381,56 @@ class DesignerState {
|
|
|
2788
3381
|
band.height = Math.max(band.height, c.y + c.height);
|
|
2789
3382
|
});
|
|
2790
3383
|
}
|
|
3384
|
+
/**
|
|
3385
|
+
* Sets one style property on the selection, the way a format bar does: on the clicked table
|
|
3386
|
+
* cell when a single table is selected and a cell of it is chosen, else on every selected item.
|
|
3387
|
+
* `undefined` removes the override (back to the style sheet).
|
|
3388
|
+
*/
|
|
3389
|
+
applyStyle(key, value) {
|
|
3390
|
+
const sel = this.selection();
|
|
3391
|
+
if (sel.kind !== 'controls')
|
|
3392
|
+
return;
|
|
3393
|
+
const set = (target) => {
|
|
3394
|
+
const style = { ...target.styleOverrides };
|
|
3395
|
+
if (value === undefined)
|
|
3396
|
+
delete style[key];
|
|
3397
|
+
else
|
|
3398
|
+
style[key] = value;
|
|
3399
|
+
target.styleOverrides = Object.keys(style).length ? style : undefined;
|
|
3400
|
+
};
|
|
3401
|
+
const cell = this.tableCell();
|
|
3402
|
+
const single = sel.ids.length === 1 ? this.selectedControls()[0] : undefined;
|
|
3403
|
+
if (single?.type === 'table' && cell?.controlId === single.id) {
|
|
3404
|
+
this.updateControls([single.id], (c) => {
|
|
3405
|
+
const target = c.type === 'table' ? c.rows[cell.row]?.cells[cell.cell] : undefined;
|
|
3406
|
+
if (target)
|
|
3407
|
+
set(target);
|
|
3408
|
+
}, `format-${key}`);
|
|
3409
|
+
return;
|
|
3410
|
+
}
|
|
3411
|
+
this.updateControls(sel.ids, (c) => set(c), `format-${key}`);
|
|
3412
|
+
}
|
|
3413
|
+
/** Grows or shrinks the selection by (dw, dh) mm, never below 1 mm. */
|
|
3414
|
+
resizeSelection(dw, dh) {
|
|
3415
|
+
const sel = this.selection();
|
|
3416
|
+
if (sel.kind !== 'controls')
|
|
3417
|
+
return;
|
|
3418
|
+
this.updateControls(sel.ids, (c, band) => {
|
|
3419
|
+
c.width = round$1(Math.max(1, c.width + dw));
|
|
3420
|
+
c.height = round$1(Math.max(1, c.height + dh));
|
|
3421
|
+
band.height = Math.max(band.height, round$1(c.y + c.height));
|
|
3422
|
+
}, 'resize-keys');
|
|
3423
|
+
}
|
|
3424
|
+
/** Tab order of a band: top to bottom, then left to right. */
|
|
3425
|
+
selectNext(step) {
|
|
3426
|
+
const all = this.report().bands.flatMap((b) => [...b.controls].sort((p, q) => p.y - q.y || p.x - q.x));
|
|
3427
|
+
if (!all.length)
|
|
3428
|
+
return;
|
|
3429
|
+
const sel = this.selection();
|
|
3430
|
+
const current = sel.kind === 'controls' ? all.findIndex((c) => c.id === sel.ids[sel.ids.length - 1]) : -1;
|
|
3431
|
+
const next = current < 0 ? (step > 0 ? 0 : all.length - 1) : (current + step + all.length) % all.length;
|
|
3432
|
+
this.selection.set({ kind: 'controls', ids: [all[next].id] });
|
|
3433
|
+
}
|
|
2791
3434
|
/** Draw order inside a band: later controls paint on top. */
|
|
2792
3435
|
arrange(to) {
|
|
2793
3436
|
const sel = this.selection();
|
|
@@ -2835,109 +3478,460 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2835
3478
|
type: Injectable
|
|
2836
3479
|
}] });
|
|
2837
3480
|
|
|
2838
|
-
const
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
3481
|
+
const CATEGORIES = [
|
|
3482
|
+
{ id: 'logic', label: 'fnLogic' },
|
|
3483
|
+
{ id: 'text', label: 'fnText' },
|
|
3484
|
+
{ id: 'number', label: 'fnNumber' },
|
|
3485
|
+
{ id: 'date', label: 'fnDate' },
|
|
3486
|
+
{ id: 'aggregate', label: 'fnAggregate' },
|
|
3487
|
+
];
|
|
3488
|
+
/**
|
|
3489
|
+
* A sheet for writing a formula: fields, parameters and every function with a one-line
|
|
3490
|
+
* explanation, inserted at the cursor, and the result for the first data row as you type.
|
|
3491
|
+
*/
|
|
3492
|
+
class ExpressionEditorComponent {
|
|
3493
|
+
expression = input('');
|
|
3494
|
+
fields = input([]);
|
|
2844
3495
|
strings = input.required();
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
gridSize = input(1);
|
|
2848
|
-
/** When set, bound text shows this data instead of its formula. */
|
|
2849
|
-
sample = input(null);
|
|
3496
|
+
applied = output();
|
|
3497
|
+
closed = output();
|
|
2850
3498
|
state = inject(DesignerState);
|
|
2851
3499
|
config = inject(WE_REPORT_CONFIG);
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
const
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
const
|
|
2864
|
-
|
|
2865
|
-
const
|
|
2866
|
-
|
|
2867
|
-
const
|
|
2868
|
-
const
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
3500
|
+
area = viewChild.required('area');
|
|
3501
|
+
categories = CATEGORIES;
|
|
3502
|
+
draft = signal('');
|
|
3503
|
+
category = signal('logic');
|
|
3504
|
+
parameters = computed(() => this.state.report().parameters ?? []);
|
|
3505
|
+
visibleFunctions = computed(() => EXPRESSION_FUNCTIONS.filter((f) => f.category === this.category()));
|
|
3506
|
+
/** What the formula gives for the first row, or why it cannot be evaluated. */
|
|
3507
|
+
result = computed(() => {
|
|
3508
|
+
const formula = this.draft().trim();
|
|
3509
|
+
if (!formula)
|
|
3510
|
+
return { text: this.strings().formulaEmpty, error: false };
|
|
3511
|
+
const report = this.state.report();
|
|
3512
|
+
const options = { locale: report.locale || this.config.locale || 'en-US', currency: report.currency || this.config.currency || 'USD' };
|
|
3513
|
+
const sample = this.state.sample();
|
|
3514
|
+
try {
|
|
3515
|
+
const value = evaluate(formula, { ...sample, params: resolveParameters(this.parameters()), ...options, now: new Date() });
|
|
3516
|
+
const text = typeof value === 'string' ? value : formatValue(value, undefined, options);
|
|
3517
|
+
return { text: text === '' ? this.strings().formulaEmpty : text, error: false };
|
|
3518
|
+
}
|
|
3519
|
+
catch (e) {
|
|
3520
|
+
return { text: e.message, error: true };
|
|
2872
3521
|
}
|
|
2873
|
-
const selected = this.state.selectedControls();
|
|
2874
|
-
const selection = selected.length
|
|
2875
|
-
? (() => {
|
|
2876
|
-
const x1 = Math.min(...selected.map((c) => c.x));
|
|
2877
|
-
const x2 = Math.max(...selected.map((c) => c.x + c.width));
|
|
2878
|
-
return { x: left + x1 * px, width: (x2 - x1) * px };
|
|
2879
|
-
})()
|
|
2880
|
-
: null;
|
|
2881
|
-
return { width: geometry.width * px, left, right: page.margins.right * px, ticks, labels, selection };
|
|
2882
|
-
});
|
|
2883
|
-
padding = computed(() => {
|
|
2884
|
-
const { top, right, bottom, left } = this.state.report().page.margins;
|
|
2885
|
-
const z = this.zoom();
|
|
2886
|
-
return `${top * z}mm ${right * z}mm ${bottom * z}mm ${left * z}mm`;
|
|
2887
3522
|
});
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
}
|
|
2895
|
-
// ── Rendering helpers ───────────────────────────────────────────────────────
|
|
2896
|
-
bandLabel(band) {
|
|
2897
|
-
const name = this.strings().bandNames[band.kind];
|
|
2898
|
-
if (band.kind === 'subDetail' && band.rowsPath)
|
|
2899
|
-
return `${name}: ${band.rowsPath}`;
|
|
2900
|
-
return band.kind === 'groupHeader' && band.groupBy ? `${name}: ${band.groupBy.expression}` : name;
|
|
2901
|
-
}
|
|
2902
|
-
isSelected(id) {
|
|
2903
|
-
const sel = this.state.selection();
|
|
2904
|
-
return sel.kind === 'controls' && sel.ids.includes(id);
|
|
2905
|
-
}
|
|
2906
|
-
isOnlySelected(id) {
|
|
2907
|
-
const sel = this.state.selection();
|
|
2908
|
-
return sel.kind === 'controls' && sel.ids.length === 1 && sel.ids[0] === id;
|
|
3523
|
+
ngAfterViewInit() {
|
|
3524
|
+
// The textarea owns its text (no [value] binding), so inserting never moves the caret.
|
|
3525
|
+
const el = this.area().nativeElement;
|
|
3526
|
+
el.value = this.expression();
|
|
3527
|
+
this.draft.set(el.value);
|
|
3528
|
+
queueMicrotask(() => el.focus());
|
|
2909
3529
|
}
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
3530
|
+
/** Inserts at the caret (replacing a selection); `caretBack` moves the caret left afterwards. */
|
|
3531
|
+
insert(text, caretBack = 0) {
|
|
3532
|
+
const el = this.area().nativeElement;
|
|
3533
|
+
el.focus();
|
|
3534
|
+
el.setRangeText(text, el.selectionStart, el.selectionEnd, 'end');
|
|
3535
|
+
el.selectionStart = el.selectionEnd = el.selectionEnd - caretBack;
|
|
3536
|
+
this.draft.set(el.value);
|
|
2913
3537
|
}
|
|
2914
|
-
|
|
2915
|
-
|
|
3538
|
+
/** The word (or `[field` start) before the caret that suggestions complete. */
|
|
3539
|
+
token = signal(null);
|
|
3540
|
+
active = signal(0);
|
|
3541
|
+
/** Functions, fields and parameters matching the word being typed, best first. */
|
|
3542
|
+
suggestions = computed(() => {
|
|
3543
|
+
const t = this.token();
|
|
3544
|
+
if (!t)
|
|
3545
|
+
return [];
|
|
3546
|
+
const q = t.text.toLocaleLowerCase();
|
|
3547
|
+
const fields = [
|
|
3548
|
+
...this.fields().map((f) => ({ label: f.expression, insert: f.expression, back: 0, help: f.label })),
|
|
3549
|
+
...this.parameters().map((p) => ({ label: `[?${p.name}]`, insert: `[?${p.name}]`, back: 0, help: p.label ?? '' })),
|
|
3550
|
+
];
|
|
3551
|
+
const matches = (s) => s.label.toLocaleLowerCase().replace(/^\[\??/, '').includes(q.replace(/^\[\??/, ''));
|
|
3552
|
+
if (t.field)
|
|
3553
|
+
return fields.filter(matches).slice(0, 8);
|
|
3554
|
+
const help = this.strings().functionHelp;
|
|
3555
|
+
const fns = EXPRESSION_FUNCTIONS.filter((f) => f.name.toLocaleLowerCase().startsWith(q)).map((f) => ({
|
|
3556
|
+
label: f.signature,
|
|
3557
|
+
insert: `${f.name}()`,
|
|
3558
|
+
back: 1,
|
|
3559
|
+
help: help[f.name] ?? '',
|
|
3560
|
+
}));
|
|
3561
|
+
return [...fns, ...fields.filter(matches)].slice(0, 8);
|
|
3562
|
+
});
|
|
3563
|
+
/** Finds the word at the caret: letters after an operator, or an unfinished `[field`. */
|
|
3564
|
+
findToken() {
|
|
3565
|
+
const el = this.area().nativeElement;
|
|
3566
|
+
const before = el.value.slice(0, el.selectionStart);
|
|
3567
|
+
const field = /\[[^\]]*$/.exec(before);
|
|
3568
|
+
const word = /[A-Za-zÇĞİÖŞÜçğıöşü_]+$/.exec(before);
|
|
3569
|
+
// Inside quotes it is text, not a formula word.
|
|
3570
|
+
const quotes = (before.match(/'/g) ?? []).length % 2 === 1;
|
|
3571
|
+
const found = quotes ? null : field ? { start: field.index, text: field[0], field: true } : word ? { start: word.index, text: word[0], field: false } : null;
|
|
3572
|
+
this.token.set(found);
|
|
3573
|
+
this.active.set(0);
|
|
3574
|
+
}
|
|
3575
|
+
onKey(e) {
|
|
3576
|
+
const list = this.suggestions();
|
|
3577
|
+
if (!list.length)
|
|
3578
|
+
return;
|
|
3579
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
3580
|
+
e.preventDefault();
|
|
3581
|
+
this.active.set((this.active() + (e.key === 'ArrowDown' ? 1 : list.length - 1)) % list.length);
|
|
3582
|
+
}
|
|
3583
|
+
else if (e.key === 'Enter' || e.key === 'Tab') {
|
|
3584
|
+
e.preventDefault();
|
|
3585
|
+
this.accept(list[this.active()]);
|
|
3586
|
+
}
|
|
3587
|
+
else if (e.key === 'Escape') {
|
|
3588
|
+
// Closes the list only, not the editor.
|
|
3589
|
+
e.stopPropagation();
|
|
3590
|
+
this.token.set(null);
|
|
3591
|
+
}
|
|
2916
3592
|
}
|
|
2917
|
-
|
|
2918
|
-
|
|
3593
|
+
accept(s) {
|
|
3594
|
+
const t = this.token();
|
|
3595
|
+
if (!t)
|
|
3596
|
+
return;
|
|
3597
|
+
const el = this.area().nativeElement;
|
|
3598
|
+
el.focus();
|
|
3599
|
+
el.setRangeText(s.insert, t.start, el.selectionStart, 'end');
|
|
3600
|
+
el.selectionStart = el.selectionEnd = el.selectionEnd - s.back;
|
|
3601
|
+
this.draft.set(el.value);
|
|
3602
|
+
this.token.set(null);
|
|
2919
3603
|
}
|
|
2920
|
-
|
|
2921
|
-
|
|
3604
|
+
/** Inserts `Name()` and puts the cursor between the brackets. */
|
|
3605
|
+
insertFunction(f) {
|
|
3606
|
+
this.insert(`${f.name}()`, 1);
|
|
2922
3607
|
}
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
3608
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExpressionEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3609
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ExpressionEditorComponent, isStandalone: true, selector: "we-report-expression-editor", inputs: { expression: { classPropertyName: "expression", publicName: "expression", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { applied: "applied", closed: "closed" }, viewQueries: [{ propertyName: "area", first: true, predicate: ["area"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3610
|
+
@let s = strings();
|
|
3611
|
+
<div class="xe__backdrop" (click)="closed.emit()"></div>
|
|
3612
|
+
<div class="xe" role="dialog" aria-modal="true" [attr.aria-label]="s.formulaEditor" (keydown.escape)="closed.emit()">
|
|
3613
|
+
<h2>{{ s.formulaEditor }}</h2>
|
|
3614
|
+
<p class="xe__hint">{{ s.formulaEditorHint }}</p>
|
|
3615
|
+
<div class="xe__field">
|
|
3616
|
+
<textarea
|
|
3617
|
+
#area
|
|
3618
|
+
class="xe__formula"
|
|
3619
|
+
(input)="draft.set($any($event.target).value); findToken()"
|
|
3620
|
+
(click)="findToken()"
|
|
3621
|
+
(keydown)="onKey($event)"
|
|
3622
|
+
(blur)="token.set(null)"
|
|
3623
|
+
spellcheck="false"
|
|
3624
|
+
rows="3"
|
|
3625
|
+
role="combobox"
|
|
3626
|
+
aria-autocomplete="list"
|
|
3627
|
+
[attr.aria-expanded]="suggestions().length > 0"
|
|
3628
|
+
[attr.aria-label]="s.expression"
|
|
3629
|
+
></textarea>
|
|
3630
|
+
@if (suggestions().length) {
|
|
3631
|
+
<ul class="xe__suggest" role="listbox">
|
|
3632
|
+
@for (o of suggestions(); track o.label; let i = $index) {
|
|
3633
|
+
<li role="option" [attr.aria-selected]="i === active()" [class.xe__on]="i === active()" (mousedown)="$event.preventDefault(); accept(o)">
|
|
3634
|
+
<code>{{ o.label }}</code>
|
|
3635
|
+
@if (o.help) {
|
|
3636
|
+
<small>{{ o.help }}</small>
|
|
3637
|
+
}
|
|
3638
|
+
</li>
|
|
2938
3639
|
}
|
|
3640
|
+
</ul>
|
|
2939
3641
|
}
|
|
2940
|
-
|
|
3642
|
+
</div>
|
|
3643
|
+
<div class="xe__result" [class.xe__result--error]="result().error" aria-live="polite">
|
|
3644
|
+
<span>{{ s.formulaResult }}</span>
|
|
3645
|
+
<output>{{ result().text }}</output>
|
|
3646
|
+
</div>
|
|
3647
|
+
<div class="xe__lists">
|
|
3648
|
+
<section>
|
|
3649
|
+
<h3>{{ s.fields }}</h3>
|
|
3650
|
+
<ul>
|
|
3651
|
+
@for (f of fields(); track f.expression) {
|
|
3652
|
+
<li><button type="button" (click)="insert(f.expression)" [style.padding-left.px]="8 + f.depth * 12">{{ f.label }}</button></li>
|
|
3653
|
+
}
|
|
3654
|
+
@for (p of parameters(); track p.name) {
|
|
3655
|
+
<li><button type="button" (click)="insert('[?' + p.name + ']')">? {{ p.label || p.name }}</button></li>
|
|
3656
|
+
}
|
|
3657
|
+
</ul>
|
|
3658
|
+
</section>
|
|
3659
|
+
<section>
|
|
3660
|
+
<h3>{{ s.functions }}</h3>
|
|
3661
|
+
<div class="xe__cats" role="tablist">
|
|
3662
|
+
@for (c of categories; track c.id) {
|
|
3663
|
+
<button type="button" role="tab" [attr.aria-selected]="category() === c.id" [class.xe__on]="category() === c.id" (click)="category.set(c.id)">{{ s[c.label] }}</button>
|
|
3664
|
+
}
|
|
3665
|
+
</div>
|
|
3666
|
+
<ul>
|
|
3667
|
+
@for (f of visibleFunctions(); track f.name) {
|
|
3668
|
+
<li>
|
|
3669
|
+
<button type="button" class="xe__fn" (click)="insertFunction(f)">
|
|
3670
|
+
<code>{{ f.signature }}</code>
|
|
3671
|
+
<small>{{ s.functionHelp[f.name] }}</small>
|
|
3672
|
+
</button>
|
|
3673
|
+
</li>
|
|
3674
|
+
}
|
|
3675
|
+
</ul>
|
|
3676
|
+
</section>
|
|
3677
|
+
</div>
|
|
3678
|
+
<div class="xe__actions">
|
|
3679
|
+
<button type="button" (click)="closed.emit()">{{ s.cancel }}</button>
|
|
3680
|
+
<button type="button" class="xe__primary" (click)="applied.emit(draft())">{{ s.apply }}</button>
|
|
3681
|
+
</div>
|
|
3682
|
+
</div>
|
|
3683
|
+
`, isInline: true, styles: [".xe__backdrop{position:fixed;inset:0;z-index:150;background:var(--we-report-backdrop, rgba(0, 0, 0, .22))}.xe{position:fixed;top:50%;left:50%;z-index:151;transform:translate(-50%,-50%);display:flex;flex-direction:column;gap:10px;width:min(820px,calc(100vw - 32px));height:min(640px,calc(100vh - 32px));box-sizing:border-box;padding:20px;border-radius:14px;background:var(--we-report-panel-bg, #fbfbfd);color:var(--we-report-fg, #1d1d1f);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14));font:13px var(--we-report-font-family, system-ui, sans-serif)}h2{margin:0;font-size:15px;font-weight:600}h3{margin:0 0 6px;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__hint{margin:-6px 0 0;font-size:12px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__field{position:relative}.xe__suggest{position:absolute;left:0;right:0;top:100%;z-index:2;max-height:220px;overflow:auto;margin:4px 0 0;padding:4px;list-style:none;border-radius:10px;background:var(--we-report-panel-bg, #fbfbfd);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14))}.xe__suggest li{display:flex;align-items:baseline;gap:8px;padding:4px 8px;border-radius:6px;cursor:pointer}.xe__suggest li.xe__on{background:var(--we-report-selection-fill, rgba(0, 122, 255, .12))}.xe__suggest small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__formula{box-sizing:border-box;width:100%;padding:10px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:13px ui-monospace,SF Mono,Menlo,Consolas,monospace;resize:vertical}.xe__formula:focus,button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.xe__result{display:flex;gap:8px;align-items:baseline;padding:8px 12px;border-radius:10px;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));font-size:12px}.xe__result span{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__result output{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xe__result--error{background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000)}.xe__lists{flex:1;min-height:0;display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px}.xe__lists section{display:flex;flex-direction:column;min-height:0}ul{flex:1;overflow:auto;list-style:none;margin:0;padding:4px;border-radius:10px;background:var(--we-report-workspace-bg, #f2f2f7)}li button{display:block;width:100%;border:0;border-radius:6px;padding:5px 8px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}li button:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.xe__fn code{display:block;font:12px ui-monospace,SF Mono,Menlo,Consolas,monospace;color:var(--we-report-accent, #007aff)}.xe__fn small{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__cats{display:flex;gap:2px;padding:2px;margin-bottom:6px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.xe__cats button{flex:1;border:0;border-radius:6px;padding:4px;background:transparent;color:inherit;font:inherit;font-size:12px;cursor:pointer}.xe__cats .xe__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.xe__actions{display:flex;justify-content:flex-end;gap:8px}.xe__actions button{border:0;border-radius:var(--we-report-control-radius, 7px);padding:6px 16px;background:var(--we-report-hover-bg, rgba(118, 118, 128, .12));color:inherit;font:inherit;font-weight:500;cursor:pointer}.xe__actions .xe__primary{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3684
|
+
}
|
|
3685
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExpressionEditorComponent, decorators: [{
|
|
3686
|
+
type: Component,
|
|
3687
|
+
args: [{ selector: 'we-report-expression-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3688
|
+
@let s = strings();
|
|
3689
|
+
<div class="xe__backdrop" (click)="closed.emit()"></div>
|
|
3690
|
+
<div class="xe" role="dialog" aria-modal="true" [attr.aria-label]="s.formulaEditor" (keydown.escape)="closed.emit()">
|
|
3691
|
+
<h2>{{ s.formulaEditor }}</h2>
|
|
3692
|
+
<p class="xe__hint">{{ s.formulaEditorHint }}</p>
|
|
3693
|
+
<div class="xe__field">
|
|
3694
|
+
<textarea
|
|
3695
|
+
#area
|
|
3696
|
+
class="xe__formula"
|
|
3697
|
+
(input)="draft.set($any($event.target).value); findToken()"
|
|
3698
|
+
(click)="findToken()"
|
|
3699
|
+
(keydown)="onKey($event)"
|
|
3700
|
+
(blur)="token.set(null)"
|
|
3701
|
+
spellcheck="false"
|
|
3702
|
+
rows="3"
|
|
3703
|
+
role="combobox"
|
|
3704
|
+
aria-autocomplete="list"
|
|
3705
|
+
[attr.aria-expanded]="suggestions().length > 0"
|
|
3706
|
+
[attr.aria-label]="s.expression"
|
|
3707
|
+
></textarea>
|
|
3708
|
+
@if (suggestions().length) {
|
|
3709
|
+
<ul class="xe__suggest" role="listbox">
|
|
3710
|
+
@for (o of suggestions(); track o.label; let i = $index) {
|
|
3711
|
+
<li role="option" [attr.aria-selected]="i === active()" [class.xe__on]="i === active()" (mousedown)="$event.preventDefault(); accept(o)">
|
|
3712
|
+
<code>{{ o.label }}</code>
|
|
3713
|
+
@if (o.help) {
|
|
3714
|
+
<small>{{ o.help }}</small>
|
|
3715
|
+
}
|
|
3716
|
+
</li>
|
|
3717
|
+
}
|
|
3718
|
+
</ul>
|
|
3719
|
+
}
|
|
3720
|
+
</div>
|
|
3721
|
+
<div class="xe__result" [class.xe__result--error]="result().error" aria-live="polite">
|
|
3722
|
+
<span>{{ s.formulaResult }}</span>
|
|
3723
|
+
<output>{{ result().text }}</output>
|
|
3724
|
+
</div>
|
|
3725
|
+
<div class="xe__lists">
|
|
3726
|
+
<section>
|
|
3727
|
+
<h3>{{ s.fields }}</h3>
|
|
3728
|
+
<ul>
|
|
3729
|
+
@for (f of fields(); track f.expression) {
|
|
3730
|
+
<li><button type="button" (click)="insert(f.expression)" [style.padding-left.px]="8 + f.depth * 12">{{ f.label }}</button></li>
|
|
3731
|
+
}
|
|
3732
|
+
@for (p of parameters(); track p.name) {
|
|
3733
|
+
<li><button type="button" (click)="insert('[?' + p.name + ']')">? {{ p.label || p.name }}</button></li>
|
|
3734
|
+
}
|
|
3735
|
+
</ul>
|
|
3736
|
+
</section>
|
|
3737
|
+
<section>
|
|
3738
|
+
<h3>{{ s.functions }}</h3>
|
|
3739
|
+
<div class="xe__cats" role="tablist">
|
|
3740
|
+
@for (c of categories; track c.id) {
|
|
3741
|
+
<button type="button" role="tab" [attr.aria-selected]="category() === c.id" [class.xe__on]="category() === c.id" (click)="category.set(c.id)">{{ s[c.label] }}</button>
|
|
3742
|
+
}
|
|
3743
|
+
</div>
|
|
3744
|
+
<ul>
|
|
3745
|
+
@for (f of visibleFunctions(); track f.name) {
|
|
3746
|
+
<li>
|
|
3747
|
+
<button type="button" class="xe__fn" (click)="insertFunction(f)">
|
|
3748
|
+
<code>{{ f.signature }}</code>
|
|
3749
|
+
<small>{{ s.functionHelp[f.name] }}</small>
|
|
3750
|
+
</button>
|
|
3751
|
+
</li>
|
|
3752
|
+
}
|
|
3753
|
+
</ul>
|
|
3754
|
+
</section>
|
|
3755
|
+
</div>
|
|
3756
|
+
<div class="xe__actions">
|
|
3757
|
+
<button type="button" (click)="closed.emit()">{{ s.cancel }}</button>
|
|
3758
|
+
<button type="button" class="xe__primary" (click)="applied.emit(draft())">{{ s.apply }}</button>
|
|
3759
|
+
</div>
|
|
3760
|
+
</div>
|
|
3761
|
+
`, styles: [".xe__backdrop{position:fixed;inset:0;z-index:150;background:var(--we-report-backdrop, rgba(0, 0, 0, .22))}.xe{position:fixed;top:50%;left:50%;z-index:151;transform:translate(-50%,-50%);display:flex;flex-direction:column;gap:10px;width:min(820px,calc(100vw - 32px));height:min(640px,calc(100vh - 32px));box-sizing:border-box;padding:20px;border-radius:14px;background:var(--we-report-panel-bg, #fbfbfd);color:var(--we-report-fg, #1d1d1f);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14));font:13px var(--we-report-font-family, system-ui, sans-serif)}h2{margin:0;font-size:15px;font-weight:600}h3{margin:0 0 6px;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__hint{margin:-6px 0 0;font-size:12px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__field{position:relative}.xe__suggest{position:absolute;left:0;right:0;top:100%;z-index:2;max-height:220px;overflow:auto;margin:4px 0 0;padding:4px;list-style:none;border-radius:10px;background:var(--we-report-panel-bg, #fbfbfd);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14))}.xe__suggest li{display:flex;align-items:baseline;gap:8px;padding:4px 8px;border-radius:6px;cursor:pointer}.xe__suggest li.xe__on{background:var(--we-report-selection-fill, rgba(0, 122, 255, .12))}.xe__suggest small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__formula{box-sizing:border-box;width:100%;padding:10px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:13px ui-monospace,SF Mono,Menlo,Consolas,monospace;resize:vertical}.xe__formula:focus,button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.xe__result{display:flex;gap:8px;align-items:baseline;padding:8px 12px;border-radius:10px;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));font-size:12px}.xe__result span{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__result output{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xe__result--error{background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000)}.xe__lists{flex:1;min-height:0;display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px}.xe__lists section{display:flex;flex-direction:column;min-height:0}ul{flex:1;overflow:auto;list-style:none;margin:0;padding:4px;border-radius:10px;background:var(--we-report-workspace-bg, #f2f2f7)}li button{display:block;width:100%;border:0;border-radius:6px;padding:5px 8px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}li button:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.xe__fn code{display:block;font:12px ui-monospace,SF Mono,Menlo,Consolas,monospace;color:var(--we-report-accent, #007aff)}.xe__fn small{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__cats{display:flex;gap:2px;padding:2px;margin-bottom:6px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.xe__cats button{flex:1;border:0;border-radius:6px;padding:4px;background:transparent;color:inherit;font:inherit;font-size:12px;cursor:pointer}.xe__cats .xe__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.xe__actions{display:flex;justify-content:flex-end;gap:8px}.xe__actions button{border:0;border-radius:var(--we-report-control-radius, 7px);padding:6px 16px;background:var(--we-report-hover-bg, rgba(118, 118, 128, .12));color:inherit;font:inherit;font-weight:500;cursor:pointer}.xe__actions .xe__primary{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}\n"] }]
|
|
3762
|
+
}] });
|
|
3763
|
+
|
|
3764
|
+
const DRAG_MIME = 'application/x-we-report';
|
|
3765
|
+
const PX_PER_MM = 96 / 25.4;
|
|
3766
|
+
const SNAP_DISTANCE_MM = 1.5;
|
|
3767
|
+
const MIN_SIZE_MM = 1;
|
|
3768
|
+
/** Gaps from `p` to the nearest rect on each side that faces it (overlaps on the other axis). */
|
|
3769
|
+
function gapsAround(p, others, bandId, max = 60) {
|
|
3770
|
+
const gaps = [];
|
|
3771
|
+
const overlapY = (r) => Math.min(r.y + r.height, p.y + p.height) - Math.max(r.y, p.y);
|
|
3772
|
+
const overlapX = (r) => Math.min(r.x + r.width, p.x + p.width) - Math.max(r.x, p.x);
|
|
3773
|
+
const midY = (r) => (Math.max(r.y, p.y) + Math.min(r.y + r.height, p.y + p.height)) / 2;
|
|
3774
|
+
const midX = (r) => (Math.max(r.x, p.x) + Math.min(r.x + r.width, p.x + p.width)) / 2;
|
|
3775
|
+
const nearest = (items, dist) => items.reduce((best, r) => (dist(r) >= 0 && dist(r) <= max && (!best || dist(r) < dist(best)) ? r : best), null);
|
|
3776
|
+
const facingH = others.filter((r) => overlapY(r) > 0);
|
|
3777
|
+
const facingV = others.filter((r) => overlapX(r) > 0);
|
|
3778
|
+
const left = nearest(facingH, (r) => p.x - (r.x + r.width));
|
|
3779
|
+
const right = nearest(facingH, (r) => r.x - (p.x + p.width));
|
|
3780
|
+
const up = nearest(facingV, (r) => p.y - (r.y + r.height));
|
|
3781
|
+
const down = nearest(facingV, (r) => r.y - (p.y + p.height));
|
|
3782
|
+
if (left)
|
|
3783
|
+
gaps.push({ bandId, orientation: 'h', x: left.x + left.width, y: midY(left), length: p.x - left.x - left.width });
|
|
3784
|
+
if (right)
|
|
3785
|
+
gaps.push({ bandId, orientation: 'h', x: p.x + p.width, y: midY(right), length: right.x - p.x - p.width });
|
|
3786
|
+
if (up)
|
|
3787
|
+
gaps.push({ bandId, orientation: 'v', x: midX(up), y: up.y + up.height, length: p.y - up.y - up.height });
|
|
3788
|
+
if (down)
|
|
3789
|
+
gaps.push({ bandId, orientation: 'v', x: midX(down), y: p.y + p.height, length: down.y - p.y - p.height });
|
|
3790
|
+
return gaps.filter((g) => g.length > 0.05);
|
|
3791
|
+
}
|
|
3792
|
+
/** The page, its bands and controls, with selection, drag, resize, snapping and drop targets. */
|
|
3793
|
+
class DesignSurfaceComponent {
|
|
3794
|
+
strings = input.required();
|
|
3795
|
+
zoom = input(1);
|
|
3796
|
+
/** Snap grid in mm; 0 turns snapping off. */
|
|
3797
|
+
gridSize = input(1);
|
|
3798
|
+
/** When set, bound text shows this data instead of its formula. */
|
|
3799
|
+
sample = input(null);
|
|
3800
|
+
/** Fields for the formula editor opened by double-clicking a bound item. */
|
|
3801
|
+
fields = input([]);
|
|
3802
|
+
state = inject(DesignerState);
|
|
3803
|
+
config = inject(WE_REPORT_CONFIG);
|
|
3804
|
+
dom = inject(DOCUMENT);
|
|
3805
|
+
host = inject(ElementRef);
|
|
3806
|
+
handles = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'];
|
|
3807
|
+
guides = signal([]);
|
|
3808
|
+
gaps = signal([]);
|
|
3809
|
+
fontsService = inject(WeReportFontsService);
|
|
3810
|
+
/** Texts (without Grow to fit text) whose content does not fit, measured with the report's fonts like the print. */
|
|
3811
|
+
cutTexts = signal(new Set());
|
|
3812
|
+
measureRun = 0;
|
|
3813
|
+
measureTexts = effect(() => {
|
|
3814
|
+
const report = this.state.report();
|
|
3815
|
+
const texts = report.bands.flatMap((b) => b.controls.filter((c) => c.type === 'text' && !c.canGrow).map((c) => ({ c, text: this.caption(c, b) })));
|
|
3816
|
+
const run = ++this.measureRun;
|
|
3817
|
+
void this.fontsService.ready().then((fonts) => {
|
|
3818
|
+
if (run !== this.measureRun)
|
|
3819
|
+
return;
|
|
3820
|
+
const cut = new Set();
|
|
3821
|
+
for (const { c, text } of texts) {
|
|
3822
|
+
if (!text)
|
|
3823
|
+
continue;
|
|
3824
|
+
const style = resolveStyle(report, c.style, c.styleOverrides);
|
|
3825
|
+
const font = fonts.resolve(style.fontFamily, style.bold, style.italic);
|
|
3826
|
+
if (fitLines(text, font, style.fontSize, style.padding, c.width, c.height).cut)
|
|
3827
|
+
cut.add(c.id);
|
|
3828
|
+
}
|
|
3829
|
+
this.cutTexts.set(cut);
|
|
3830
|
+
});
|
|
3831
|
+
});
|
|
3832
|
+
/** The rubber band while dragging on an empty part of a section (mm in that section). */
|
|
3833
|
+
marquee = signal(null);
|
|
3834
|
+
/** A bound item whose formula is open in the editor. */
|
|
3835
|
+
formulaEdit = signal(null);
|
|
3836
|
+
/** A key typed on a selected text: editing starts with it instead of the old text. */
|
|
3837
|
+
editSeed = signal(null);
|
|
3838
|
+
/** The text an in-place editor starts with. */
|
|
3839
|
+
editText = computed(() => {
|
|
3840
|
+
const e = this.state.editing();
|
|
3841
|
+
if (!e)
|
|
3842
|
+
return '';
|
|
3843
|
+
const seed = this.editSeed();
|
|
3844
|
+
if (seed !== null)
|
|
3845
|
+
return seed;
|
|
3846
|
+
const c = this.state.selectedControls().find((x) => x.id === e.controlId) ?? this.state.report().bands.flatMap((b) => b.controls).find((x) => x.id === e.controlId);
|
|
3847
|
+
const value = c?.type === 'text' ? c.text : c?.type === 'table' && e.row !== undefined && e.cell !== undefined ? c.rows[e.row]?.cells[e.cell]?.text : '';
|
|
3848
|
+
return typeof value === 'string' ? value : '';
|
|
3849
|
+
});
|
|
3850
|
+
geometry = computed(() => resolvePageGeometry(this.state.report().page));
|
|
3851
|
+
/** Top ruler in screen pixels: 0 at the left margin, a tick per millimetre, a label per centimetre. */
|
|
3852
|
+
ruler = computed(() => {
|
|
3853
|
+
const page = this.state.report().page;
|
|
3854
|
+
const geometry = this.geometry();
|
|
3855
|
+
const px = PX_PER_MM * this.zoom();
|
|
3856
|
+
const left = page.margins.left * px;
|
|
3857
|
+
const step = this.zoom() < 0.6 ? 5 : 1;
|
|
3858
|
+
let ticks = '';
|
|
3859
|
+
const labels = [];
|
|
3860
|
+
for (let mm = -Math.floor(page.margins.left / step) * step; mm <= geometry.width - page.margins.left; mm += step) {
|
|
3861
|
+
const x = Math.round((left + mm * px) * 10) / 10;
|
|
3862
|
+
const h = mm % 10 === 0 ? 8 : mm % 5 === 0 ? 5 : 3;
|
|
3863
|
+
ticks += `M${x} 20v-${h}`;
|
|
3864
|
+
if (mm % 10 === 0 && mm >= 0)
|
|
3865
|
+
labels.push({ x, text: String(mm / 10) });
|
|
3866
|
+
}
|
|
3867
|
+
const selected = this.state.selectedControls();
|
|
3868
|
+
const selection = selected.length
|
|
3869
|
+
? (() => {
|
|
3870
|
+
const x1 = Math.min(...selected.map((c) => c.x));
|
|
3871
|
+
const x2 = Math.max(...selected.map((c) => c.x + c.width));
|
|
3872
|
+
return { x: left + x1 * px, width: (x2 - x1) * px };
|
|
3873
|
+
})()
|
|
3874
|
+
: null;
|
|
3875
|
+
return { width: geometry.width * px, left, right: page.margins.right * px, ticks, labels, selection };
|
|
3876
|
+
});
|
|
3877
|
+
padding = computed(() => {
|
|
3878
|
+
const { top, right, bottom, left } = this.state.report().page.margins;
|
|
3879
|
+
const z = this.zoom();
|
|
3880
|
+
return `${top * z}mm ${right * z}mm ${bottom * z}mm ${left * z}mm`;
|
|
3881
|
+
});
|
|
3882
|
+
op = null;
|
|
3883
|
+
onMove = (e) => this.pointerMove(e);
|
|
3884
|
+
onUp = (e) => this.pointerUp(e);
|
|
3885
|
+
opCounter = 0;
|
|
3886
|
+
ngOnDestroy() {
|
|
3887
|
+
this.stopListening();
|
|
3888
|
+
}
|
|
3889
|
+
// ── Rendering helpers ───────────────────────────────────────────────────────
|
|
3890
|
+
bandLabel(band) {
|
|
3891
|
+
const name = this.strings().bandNames[band.kind];
|
|
3892
|
+
if (band.kind === 'subDetail' && band.rowsPath)
|
|
3893
|
+
return `${name}: ${band.rowsPath}`;
|
|
3894
|
+
return band.kind === 'groupHeader' && band.groupBy ? `${name}: ${band.groupBy.expression}` : name;
|
|
3895
|
+
}
|
|
3896
|
+
isSelected(id) {
|
|
3897
|
+
const sel = this.state.selection();
|
|
3898
|
+
return sel.kind === 'controls' && sel.ids.includes(id);
|
|
3899
|
+
}
|
|
3900
|
+
isOnlySelected(id) {
|
|
3901
|
+
const sel = this.state.selection();
|
|
3902
|
+
return sel.kind === 'controls' && sel.ids.length === 1 && sel.ids[0] === id;
|
|
3903
|
+
}
|
|
3904
|
+
isBandSelected(id) {
|
|
3905
|
+
const sel = this.state.selection();
|
|
3906
|
+
return sel.kind === 'band' && sel.id === id;
|
|
3907
|
+
}
|
|
3908
|
+
guidesFor(bandId) {
|
|
3909
|
+
return this.guides().filter((g) => g.bandId === bandId);
|
|
3910
|
+
}
|
|
3911
|
+
isBound(c) {
|
|
3912
|
+
return c.type === 'text' && isExpression(c.text);
|
|
3913
|
+
}
|
|
3914
|
+
boundExpression(c) {
|
|
3915
|
+
return c.type === 'text' && isExpression(c.text) ? c.text.expression : '';
|
|
3916
|
+
}
|
|
3917
|
+
caption(c, band) {
|
|
3918
|
+
if (c.type === 'text') {
|
|
3919
|
+
if (!isExpression(c.text))
|
|
3920
|
+
return c.text;
|
|
3921
|
+
const sample = this.sampleFor(band);
|
|
3922
|
+
if (!sample)
|
|
3923
|
+
return c.text.expression;
|
|
3924
|
+
try {
|
|
3925
|
+
const report = this.state.report();
|
|
3926
|
+
const options = { locale: report.locale || this.config.locale || 'en-US', currency: report.currency || this.config.currency || 'USD' };
|
|
3927
|
+
const value = evaluate(c.text.expression, { ...sample, ...options, now: new Date() });
|
|
3928
|
+
return typeof value === 'string' && !c.format ? value : formatValue(value, c.format, options);
|
|
3929
|
+
}
|
|
3930
|
+
catch {
|
|
3931
|
+
return c.text.expression;
|
|
3932
|
+
}
|
|
3933
|
+
}
|
|
3934
|
+
if (c.type === 'pageInfo') {
|
|
2941
3935
|
const s = this.strings();
|
|
2942
3936
|
return c.info === 'pageNumber' ? '1' : c.info === 'pageCount' ? '9' : c.info === 'pageNofM' ? (c.format || '{0} / {1}').replace('{0}', '1').replace('{1}', '9') : s.printDate;
|
|
2943
3937
|
}
|
|
@@ -3090,11 +4084,128 @@ class DesignSurfaceComponent {
|
|
|
3090
4084
|
selectBand(id) {
|
|
3091
4085
|
this.state.selection.set({ kind: 'band', id });
|
|
3092
4086
|
}
|
|
3093
|
-
|
|
4087
|
+
/** On an empty part of a section: starts a rubber-band selection (Shift/Ctrl add to the selection). */
|
|
4088
|
+
onBodyPointerDown(e, band) {
|
|
3094
4089
|
if (e.button !== 0)
|
|
3095
4090
|
return;
|
|
3096
4091
|
this.host.nativeElement.focus({ preventScroll: true });
|
|
3097
|
-
|
|
4092
|
+
const additive = e.shiftKey || e.ctrlKey || e.metaKey;
|
|
4093
|
+
const sel = this.state.selection();
|
|
4094
|
+
const base = additive && sel.kind === 'controls' ? sel.ids : [];
|
|
4095
|
+
if (!additive)
|
|
4096
|
+
this.state.selection.set({ kind: 'none' });
|
|
4097
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
4098
|
+
this.begin(e, { kind: 'marquee', bandId: band.id, originals: new Map(), baseIds: base, origin: { left: rect.left, top: rect.top } });
|
|
4099
|
+
}
|
|
4100
|
+
// ── Editing on the page ─────────────────────────────────────────────────────
|
|
4101
|
+
isEditing(controlId, row, cell) {
|
|
4102
|
+
const e = this.state.editing();
|
|
4103
|
+
return !!e && e.controlId === controlId && e.row === row && e.cell === cell;
|
|
4104
|
+
}
|
|
4105
|
+
/** Double-click / F2: fixed text is typed on the page, a formula opens the formula editor. */
|
|
4106
|
+
startEditing(c, row, cell, seed) {
|
|
4107
|
+
let value;
|
|
4108
|
+
if (c.type === 'text')
|
|
4109
|
+
value = c.text;
|
|
4110
|
+
else if (c.type === 'table') {
|
|
4111
|
+
const at = row ?? this.state.tableCell()?.row;
|
|
4112
|
+
const index = cell ?? this.state.tableCell()?.cell;
|
|
4113
|
+
if (at === undefined || index === undefined)
|
|
4114
|
+
return;
|
|
4115
|
+
row = at;
|
|
4116
|
+
cell = index;
|
|
4117
|
+
value = c.rows[row]?.cells[cell]?.text;
|
|
4118
|
+
}
|
|
4119
|
+
if (value === undefined)
|
|
4120
|
+
return;
|
|
4121
|
+
this.state.selection.set({ kind: 'controls', ids: [c.id] });
|
|
4122
|
+
if (isExpression(value)) {
|
|
4123
|
+
this.formulaEdit.set({ controlId: c.id, row, cell, expression: value.expression });
|
|
4124
|
+
return;
|
|
4125
|
+
}
|
|
4126
|
+
this.editSeed.set(seed ?? null);
|
|
4127
|
+
this.state.editing.set({ controlId: c.id, row, cell });
|
|
4128
|
+
// The editor exists after this change is rendered.
|
|
4129
|
+
setTimeout(() => {
|
|
4130
|
+
const editor = this.host.nativeElement.querySelector('.ds__editor');
|
|
4131
|
+
editor?.focus({ preventScroll: true });
|
|
4132
|
+
if (seed === undefined)
|
|
4133
|
+
editor?.select();
|
|
4134
|
+
else
|
|
4135
|
+
editor?.setSelectionRange(editor.value.length, editor.value.length);
|
|
4136
|
+
});
|
|
4137
|
+
}
|
|
4138
|
+
/** Enter or Escape pressed before the editor had focus: keep or drop what was typed. */
|
|
4139
|
+
finishEditing(keep) {
|
|
4140
|
+
const editing = this.state.editing();
|
|
4141
|
+
if (!editing)
|
|
4142
|
+
return;
|
|
4143
|
+
const editor = this.host.nativeElement.querySelector('.ds__editor');
|
|
4144
|
+
const text = editor?.value ?? this.editSeed() ?? '';
|
|
4145
|
+
this.state.editing.set(null);
|
|
4146
|
+
if (keep)
|
|
4147
|
+
this.setText(editing.controlId, editing.row, editing.cell, text);
|
|
4148
|
+
this.host.nativeElement.focus({ preventScroll: true });
|
|
4149
|
+
}
|
|
4150
|
+
/** Keys typed before the editor has focus (fast typists) are not lost. */
|
|
4151
|
+
appendToEdit(key) {
|
|
4152
|
+
if (this.editSeed() !== null)
|
|
4153
|
+
this.editSeed.update((s) => s + key);
|
|
4154
|
+
}
|
|
4155
|
+
/** Enter keeps the text, Shift+Enter starts a new line, Escape leaves it as it was. */
|
|
4156
|
+
onEditorKey(e) {
|
|
4157
|
+
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 's') {
|
|
4158
|
+
// Save shortcuts of the host app keep working: keep the typed text first, then let it through.
|
|
4159
|
+
e.target.blur();
|
|
4160
|
+
return;
|
|
4161
|
+
}
|
|
4162
|
+
e.stopPropagation();
|
|
4163
|
+
if (e.key === 'Escape') {
|
|
4164
|
+
e.preventDefault();
|
|
4165
|
+
this.state.editing.set(null);
|
|
4166
|
+
this.host.nativeElement.focus({ preventScroll: true });
|
|
4167
|
+
}
|
|
4168
|
+
else if (e.key === 'Enter' && !e.shiftKey) {
|
|
4169
|
+
e.preventDefault();
|
|
4170
|
+
e.target.blur();
|
|
4171
|
+
}
|
|
4172
|
+
}
|
|
4173
|
+
commitEditing(e) {
|
|
4174
|
+
const editing = this.state.editing();
|
|
4175
|
+
if (!editing)
|
|
4176
|
+
return;
|
|
4177
|
+
const text = e.target.value;
|
|
4178
|
+
this.state.editing.set(null);
|
|
4179
|
+
this.setText(editing.controlId, editing.row, editing.cell, text);
|
|
4180
|
+
this.host.nativeElement.focus({ preventScroll: true });
|
|
4181
|
+
}
|
|
4182
|
+
applyFormula(expression) {
|
|
4183
|
+
const f = this.formulaEdit();
|
|
4184
|
+
this.formulaEdit.set(null);
|
|
4185
|
+
if (f)
|
|
4186
|
+
this.setText(f.controlId, f.row, f.cell, { expression });
|
|
4187
|
+
}
|
|
4188
|
+
setText(controlId, row, cell, text) {
|
|
4189
|
+
const c = this.state.report().bands.flatMap((b) => b.controls).find((x) => x.id === controlId);
|
|
4190
|
+
const current = c?.type === 'text' ? c.text : c?.type === 'table' && row !== undefined && cell !== undefined ? c.rows[row]?.cells[cell]?.text : undefined;
|
|
4191
|
+
// Leaving the editor without a change adds no undo step.
|
|
4192
|
+
if (JSON.stringify(current) === JSON.stringify(text))
|
|
4193
|
+
return;
|
|
4194
|
+
this.state.updateControls([controlId], (c) => {
|
|
4195
|
+
if (c.type === 'text')
|
|
4196
|
+
c.text = text;
|
|
4197
|
+
else if (c.type === 'table' && row !== undefined && cell !== undefined && c.rows[row]?.cells[cell])
|
|
4198
|
+
c.rows[row].cells[cell].text = text;
|
|
4199
|
+
});
|
|
4200
|
+
}
|
|
4201
|
+
/** Pointer position in mm inside the section under it, for the status bar. */
|
|
4202
|
+
trackPointer(e) {
|
|
4203
|
+
const body = e.target.closest('[data-band-id]');
|
|
4204
|
+
if (!body)
|
|
4205
|
+
return this.state.pointer.set(null);
|
|
4206
|
+
const r = body.getBoundingClientRect();
|
|
4207
|
+
const scale = PX_PER_MM * this.zoom();
|
|
4208
|
+
this.state.pointer.set({ bandId: body.dataset['bandId'], x: round((e.clientX - r.left) / scale), y: round((e.clientY - r.top) / scale) });
|
|
3098
4209
|
}
|
|
3099
4210
|
// ── Drag: move / resize / band height ───────────────────────────────────────
|
|
3100
4211
|
onControlPointerDown(e, c, band) {
|
|
@@ -3102,12 +4213,25 @@ class DesignSurfaceComponent {
|
|
|
3102
4213
|
return;
|
|
3103
4214
|
e.stopPropagation();
|
|
3104
4215
|
e.preventDefault();
|
|
4216
|
+
const look = this.state.painter();
|
|
4217
|
+
if (look) {
|
|
4218
|
+
this.state.painter.set(null);
|
|
4219
|
+
this.state.updateControls([c.id], (x) => {
|
|
4220
|
+
x.style = look.style;
|
|
4221
|
+
x.styleOverrides = structuredClone(look.styleOverrides);
|
|
4222
|
+
});
|
|
4223
|
+
this.state.selection.set({ kind: 'controls', ids: [c.id] });
|
|
4224
|
+
return;
|
|
4225
|
+
}
|
|
3105
4226
|
const additive = e.shiftKey || e.ctrlKey || e.metaKey;
|
|
3106
|
-
this.state.
|
|
4227
|
+
const sel = this.state.selection();
|
|
4228
|
+
const toggleOnClick = (e.ctrlKey || e.metaKey) && sel.kind === 'controls' && sel.ids.includes(c.id);
|
|
4229
|
+
if (!toggleOnClick)
|
|
4230
|
+
this.state.select(c.id, additive);
|
|
3107
4231
|
const ids = this.state.selection().kind === 'controls' ? this.state.selection().ids : [];
|
|
3108
4232
|
if (!ids.includes(c.id))
|
|
3109
4233
|
return;
|
|
3110
|
-
this.begin(e, { kind: 'move', bandId: band.id, primaryId: c.id, originals: this.rectsOf(ids), additive });
|
|
4234
|
+
this.begin(e, { kind: 'move', bandId: band.id, primaryId: c.id, originals: this.rectsOf(ids), additive, toggleOnClick });
|
|
3111
4235
|
}
|
|
3112
4236
|
onHandlePointerDown(e, c, band, handle) {
|
|
3113
4237
|
if (e.button !== 0)
|
|
@@ -3156,6 +4280,23 @@ class DesignSurfaceComponent {
|
|
|
3156
4280
|
return;
|
|
3157
4281
|
op.moved = true;
|
|
3158
4282
|
const snap = !e.altKey;
|
|
4283
|
+
if (op.kind === 'marquee') {
|
|
4284
|
+
const o = op.origin;
|
|
4285
|
+
const x1 = (op.startX - o.left) / scale;
|
|
4286
|
+
const y1 = (op.startY - o.top) / scale;
|
|
4287
|
+
const x2 = (e.clientX - o.left) / scale;
|
|
4288
|
+
const y2 = (e.clientY - o.top) / scale;
|
|
4289
|
+
const box = { x: Math.min(x1, x2), y: Math.min(y1, y2), width: Math.abs(x2 - x1), height: Math.abs(y2 - y1) };
|
|
4290
|
+
this.marquee.set({ bandId: op.bandId, ...box });
|
|
4291
|
+
// Everything the band touches is selected, as in desktop designers.
|
|
4292
|
+
const band = this.state.report().bands.find((b) => b.id === op.bandId);
|
|
4293
|
+
const hit = (band?.controls ?? [])
|
|
4294
|
+
.filter((c) => c.x < box.x + box.width && c.x + c.width > box.x && c.y < box.y + box.height && c.y + c.height > box.y)
|
|
4295
|
+
.map((c) => c.id);
|
|
4296
|
+
const ids = [...new Set([...(op.baseIds ?? []), ...hit])];
|
|
4297
|
+
this.state.selection.set(ids.length ? { kind: 'controls', ids } : op.baseIds?.length ? { kind: 'controls', ids: op.baseIds } : { kind: 'none' });
|
|
4298
|
+
return;
|
|
4299
|
+
}
|
|
3159
4300
|
if (op.kind === 'band') {
|
|
3160
4301
|
const band = this.state.report().bands.find((b) => b.id === op.bandId);
|
|
3161
4302
|
const minHeight = Math.max(2, ...(band?.controls.map((c) => c.y + c.height) ?? [0]));
|
|
@@ -3183,6 +4324,8 @@ class DesignSurfaceComponent {
|
|
|
3183
4324
|
c.x = round(Math.max(0, o.x + mx));
|
|
3184
4325
|
c.y = round(Math.max(0, o.y + my));
|
|
3185
4326
|
}, op.key);
|
|
4327
|
+
const moved = { ...primary, x: Math.max(0, primary.x + mx), y: Math.max(0, primary.y + my) };
|
|
4328
|
+
this.gaps.set(op.originals.size === 1 ? gapsAround(moved, others, op.bandId) : []);
|
|
3186
4329
|
}
|
|
3187
4330
|
else {
|
|
3188
4331
|
const h = op.handle;
|
|
@@ -3215,6 +4358,31 @@ class DesignSurfaceComponent {
|
|
|
3215
4358
|
this.op = null;
|
|
3216
4359
|
this.stopListening();
|
|
3217
4360
|
this.guides.set([]);
|
|
4361
|
+
this.gaps.set([]);
|
|
4362
|
+
if (op?.kind === 'marquee') {
|
|
4363
|
+
// A plain click on an empty part selects the section.
|
|
4364
|
+
if (!op.moved && !op.baseIds?.length)
|
|
4365
|
+
this.state.selection.set({ kind: 'band', id: op.bandId });
|
|
4366
|
+
this.marquee.set(null);
|
|
4367
|
+
return;
|
|
4368
|
+
}
|
|
4369
|
+
if (op?.kind === 'move' && !op.moved && op.toggleOnClick) {
|
|
4370
|
+
this.state.select(op.primaryId, true);
|
|
4371
|
+
return;
|
|
4372
|
+
}
|
|
4373
|
+
// Ctrl+drag copies: the originals stay where they were, the dragged items are the copies.
|
|
4374
|
+
if (op?.kind === 'move' && op.moved && (e.ctrlKey || e.metaKey)) {
|
|
4375
|
+
this.state.update((d) => {
|
|
4376
|
+
const taken = new Set();
|
|
4377
|
+
// The selection can span sections: each section keeps copies of its own items.
|
|
4378
|
+
for (const band of d.bands) {
|
|
4379
|
+
const copies = band.controls
|
|
4380
|
+
.filter((c) => op.originals.has(c.id))
|
|
4381
|
+
.map((c) => ({ ...structuredClone(c), id: this.state.newId(c.type, taken), ...op.originals.get(c.id) }));
|
|
4382
|
+
band.controls.unshift(...copies);
|
|
4383
|
+
}
|
|
4384
|
+
}, op.key);
|
|
4385
|
+
}
|
|
3218
4386
|
// A click (no drag) inside a multi-selection narrows it to the clicked control.
|
|
3219
4387
|
if (op?.kind === 'move' && !op.moved && !op.additive && op.originals.size > 1) {
|
|
3220
4388
|
this.state.selection.set({ kind: 'controls', ids: [op.primaryId] });
|
|
@@ -3293,13 +4461,22 @@ class DesignSurfaceComponent {
|
|
|
3293
4461
|
}
|
|
3294
4462
|
// ── Drop from toolbox / field list ──────────────────────────────────────────
|
|
3295
4463
|
onDragOver(e) {
|
|
3296
|
-
if (e.dataTransfer?.types.includes(DRAG_MIME)) {
|
|
4464
|
+
if (e.dataTransfer?.types.includes(DRAG_MIME) || e.dataTransfer?.types.includes('Files')) {
|
|
3297
4465
|
e.preventDefault();
|
|
3298
4466
|
e.dataTransfer.dropEffect = 'copy';
|
|
3299
4467
|
}
|
|
3300
4468
|
}
|
|
3301
4469
|
onDrop(e, band) {
|
|
3302
4470
|
const raw = e.dataTransfer?.getData(DRAG_MIME);
|
|
4471
|
+
const file = e.dataTransfer?.files?.[0];
|
|
4472
|
+
if (!raw && file && /^image\/(png|jpeg)$/.test(file.type)) {
|
|
4473
|
+
// A picture dragged in from the desktop becomes an image item where it is dropped.
|
|
4474
|
+
e.preventDefault();
|
|
4475
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
4476
|
+
const scale = PX_PER_MM * this.zoom();
|
|
4477
|
+
void this.readFile(file).then((src) => this.addImage(band, (e.clientX - rect.left) / scale, (e.clientY - rect.top) / scale, src));
|
|
4478
|
+
return;
|
|
4479
|
+
}
|
|
3303
4480
|
if (!raw)
|
|
3304
4481
|
return;
|
|
3305
4482
|
e.preventDefault();
|
|
@@ -3337,6 +4514,39 @@ class DesignSurfaceComponent {
|
|
|
3337
4514
|
const type = { column: s.chartColumn, bar: s.chartBar, line: s.chartLine, pie: s.chartPie, doughnut: s.chartDoughnut }[c.chartType];
|
|
3338
4515
|
return c.category.expression ? `${type}: ${c.value.expression} / ${c.category.expression}` : type;
|
|
3339
4516
|
}
|
|
4517
|
+
readFile(file) {
|
|
4518
|
+
return new Promise((resolve, reject) => {
|
|
4519
|
+
const reader = new FileReader();
|
|
4520
|
+
reader.onload = () => resolve(reader.result);
|
|
4521
|
+
reader.onerror = () => reject(reader.error);
|
|
4522
|
+
reader.readAsDataURL(file);
|
|
4523
|
+
});
|
|
4524
|
+
}
|
|
4525
|
+
/** A picture at (x, y) mm, at its natural size up to 80 mm wide (PNG/JPEG data URI). */
|
|
4526
|
+
addImage(band, x, y, src) {
|
|
4527
|
+
const info = readImage(src);
|
|
4528
|
+
if (!info)
|
|
4529
|
+
return;
|
|
4530
|
+
const pxToMm = 25.4 / 96;
|
|
4531
|
+
const scale = Math.min(1, 80 / (info.width * pxToMm));
|
|
4532
|
+
const width = round(Math.max(5, info.width * pxToMm * scale));
|
|
4533
|
+
const height = round(Math.max(5, info.height * pxToMm * scale));
|
|
4534
|
+
const pageWidth = this.geometry().contentWidth;
|
|
4535
|
+
const control = {
|
|
4536
|
+
id: this.state.newId('image'), type: 'image', fit: 'contain', source: src, width, height,
|
|
4537
|
+
x: round(Math.max(0, Math.min(x, pageWidth - width))), y: round(Math.max(0, y)),
|
|
4538
|
+
};
|
|
4539
|
+
this.growBand(band, [control]);
|
|
4540
|
+
}
|
|
4541
|
+
/** Text pasted from elsewhere becomes a text item, tall enough for its lines. */
|
|
4542
|
+
addText(band, x, y, text) {
|
|
4543
|
+
const lines = text.split(/\r?\n/).length;
|
|
4544
|
+
const control = {
|
|
4545
|
+
id: this.state.newId('text'), type: 'text', text, x: round(Math.max(0, x)), y: round(Math.max(0, y)),
|
|
4546
|
+
width: Math.min(120, this.geometry().contentWidth), height: round(Math.min(60, 5 * lines + 1)), canGrow: lines > 1 || undefined,
|
|
4547
|
+
};
|
|
4548
|
+
this.growBand(band, [control]);
|
|
4549
|
+
}
|
|
3340
4550
|
/** Creates controls for a drop at (x, y) mm inside `band`. */
|
|
3341
4551
|
dropAt(data, band, x, y) {
|
|
3342
4552
|
const width = this.geometry().contentWidth;
|
|
@@ -3359,6 +4569,18 @@ class DesignSurfaceComponent {
|
|
|
3359
4569
|
this.growBand(band, [control]);
|
|
3360
4570
|
return;
|
|
3361
4571
|
}
|
|
4572
|
+
// A field dropped on a text shows that field there instead (desktop designers bind on drop).
|
|
4573
|
+
const text = band.controls.find((c) => c.type === 'text' && x >= c.x && x <= c.x + c.width && y >= c.y && y <= c.y + c.height);
|
|
4574
|
+
if (text) {
|
|
4575
|
+
this.state.updateControls([text.id], (c) => {
|
|
4576
|
+
if (c.type !== 'text')
|
|
4577
|
+
return;
|
|
4578
|
+
c.text = { expression: fieldExpression(data.path, data.parent) };
|
|
4579
|
+
c.format = data.format;
|
|
4580
|
+
});
|
|
4581
|
+
this.state.selection.set({ kind: 'controls', ids: [text.id] });
|
|
4582
|
+
return;
|
|
4583
|
+
}
|
|
3362
4584
|
// A field dropped on a table cell fills that cell.
|
|
3363
4585
|
const table = band.controls.find((c) => c.type === 'table' && x >= c.x && x <= c.x + c.width && y >= c.y && y <= c.y + c.height);
|
|
3364
4586
|
if (table?.type === 'table') {
|
|
@@ -3411,7 +4633,7 @@ class DesignSurfaceComponent {
|
|
|
3411
4633
|
this.state.selection.set({ kind: 'controls', ids: controls.map((c) => c.id) });
|
|
3412
4634
|
}
|
|
3413
4635
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignSurfaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3414
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DesignSurfaceComponent, isStandalone: true, selector: "we-report-design-surface", inputs: { strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, gridSize: { classPropertyName: "gridSize", publicName: "gridSize", isSignal: true, isRequired: false, transformFunction: null }, sample: { classPropertyName: "sample", publicName: "sample", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tabindex": "0" } }, ngImport: i0, template: `
|
|
4636
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DesignSurfaceComponent, isStandalone: true, selector: "we-report-design-surface", inputs: { strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, gridSize: { classPropertyName: "gridSize", publicName: "gridSize", isSignal: true, isRequired: false, transformFunction: null }, sample: { classPropertyName: "sample", publicName: "sample", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tabindex": "0" }, properties: { "class.ds--painting": "!!state.painter()" } }, ngImport: i0, template: `
|
|
3415
4637
|
@let r = ruler();
|
|
3416
4638
|
<svg class="ds__ruler" aria-hidden="true" [attr.width]="r.width" height="20" [attr.viewBox]="'0 0 ' + r.width + ' 20'">
|
|
3417
4639
|
<rect class="ds__ruler-margin" x="0" y="0" [attr.width]="r.left" height="20" />
|
|
@@ -3424,22 +4646,24 @@ class DesignSurfaceComponent {
|
|
|
3424
4646
|
<text [attr.x]="l.x + 2" y="9">{{ l.text }}</text>
|
|
3425
4647
|
}
|
|
3426
4648
|
</svg>
|
|
3427
|
-
<div class="ds__page" role="region" [attr.aria-label]="strings().designerLabel" [style.width.mm]="geometry().width * zoom()" [style.min-height.mm]="(geometry().height ?? 0) * zoom()" [style.padding]="padding()" [style.--ds-margin-right.mm]="state.report().page.margins.right * zoom()">
|
|
4649
|
+
<div class="ds__page" (pointermove)="trackPointer($event)" (pointerleave)="state.pointer.set(null)" role="region" [attr.aria-label]="strings().designerLabel" [style.width.mm]="geometry().width * zoom()" [style.min-height.mm]="(geometry().height ?? 0) * zoom()" [style.padding]="padding()" [style.--ds-margin-right.mm]="state.report().page.margins.right * zoom()">
|
|
3428
4650
|
@if (watermarkText(); as wm) {
|
|
3429
4651
|
<div class="ds__watermark" aria-hidden="true" [style.color]="state.report().watermark?.color ?? defaultWatermarkColor" [style.font-size.mm]="geometry().width * zoom() * 0.12" [style.transform]="'translate(-50%, -50%) rotate(' + -(state.report().watermark?.angle ?? 45) + 'deg)'">{{ wm }}</div>
|
|
3430
4652
|
}
|
|
3431
4653
|
@for (band of state.report().bands; track band.id) {
|
|
3432
|
-
|
|
3433
|
-
|
|
4654
|
+
@let folded = state.collapsed().has(band.id);
|
|
4655
|
+
<div class="ds__band" [class.ds__band--selected]="isBandSelected(band.id)" [class.ds__band--collapsed]="folded">
|
|
4656
|
+
<button type="button" class="ds__band-label" [title]="bandLabel(band) + ' — ' + (folded ? strings().expandBand : strings().collapseBand) " [attr.aria-expanded]="!folded" (click)="selectBand(band.id)" (dblclick)="state.toggleCollapsed(band.id)">
|
|
3434
4657
|
{{ bandLabel(band) }}
|
|
3435
4658
|
</button>
|
|
3436
4659
|
<div
|
|
3437
4660
|
class="ds__band-body"
|
|
3438
4661
|
[attr.data-band-id]="band.id"
|
|
3439
|
-
[style.height.mm]="band.height * zoom()"
|
|
4662
|
+
[style.height.mm]="folded ? 6 : band.height * zoom()"
|
|
3440
4663
|
[style.background-color]="band.backgroundColor ?? null"
|
|
3441
4664
|
[style.background-size.mm]="gridSize() * zoom()"
|
|
3442
|
-
|
|
4665
|
+
[style.background-image]="gridSize() ? null : 'none'"
|
|
4666
|
+
(pointerdown)="onBodyPointerDown($event, band)"
|
|
3443
4667
|
(dragover)="onDragOver($event)"
|
|
3444
4668
|
(drop)="onDrop($event, band)"
|
|
3445
4669
|
>
|
|
@@ -3448,12 +4672,14 @@ class DesignSurfaceComponent {
|
|
|
3448
4672
|
class="ds__control"
|
|
3449
4673
|
[attr.data-control-id]="c.id"
|
|
3450
4674
|
[class.ds__control--selected]="isSelected(c.id)"
|
|
4675
|
+
[class.ds__control--cut]="cutTexts().has(c.id)"
|
|
3451
4676
|
[attr.data-type]="c.type"
|
|
3452
4677
|
[style.left.mm]="c.x * zoom()"
|
|
3453
4678
|
[style.top.mm]="c.y * zoom()"
|
|
3454
4679
|
[style.width.mm]="c.width * zoom()"
|
|
3455
4680
|
[style.height.mm]="c.height * zoom()"
|
|
3456
4681
|
(pointerdown)="onControlPointerDown($event, c, band)"
|
|
4682
|
+
(dblclick)="startEditing(c)"
|
|
3457
4683
|
>
|
|
3458
4684
|
@switch (c.type) {
|
|
3459
4685
|
@case ('line') {
|
|
@@ -3496,7 +4722,14 @@ class DesignSurfaceComponent {
|
|
|
3496
4722
|
[style.width.mm]="cell.width * zoom()"
|
|
3497
4723
|
[style.height.mm]="cell.height * zoom()"
|
|
3498
4724
|
(click)="selectCell(c.id, cell.row, cell.index)"
|
|
3499
|
-
|
|
4725
|
+
(dblclick)="$event.stopPropagation(); startEditing(c, cell.row, cell.index)"
|
|
4726
|
+
>
|
|
4727
|
+
@if (isEditing(c.id, cell.row, cell.index)) {
|
|
4728
|
+
<textarea class="ds__editor" [value]="editText()" [style]="cell.style" (pointerdown)="$event.stopPropagation()" (keydown)="onEditorKey($event)" (blur)="commitEditing($event)" [attr.aria-label]="strings().content"></textarea>
|
|
4729
|
+
} @else {
|
|
4730
|
+
{{ cell.text }}
|
|
4731
|
+
}
|
|
4732
|
+
</div>
|
|
3500
4733
|
}
|
|
3501
4734
|
}
|
|
3502
4735
|
@case ('chart') {
|
|
@@ -3509,7 +4742,11 @@ class DesignSurfaceComponent {
|
|
|
3509
4742
|
<div class="ds__placeholder" [innerHTML]="'checkbox' | weReportIcon"></div>
|
|
3510
4743
|
}
|
|
3511
4744
|
@default {
|
|
3512
|
-
|
|
4745
|
+
@if (isEditing(c.id)) {
|
|
4746
|
+
<textarea class="ds__editor" [value]="editText()" [style]="textStyle(c)" (pointerdown)="$event.stopPropagation()" (keydown)="onEditorKey($event)" (blur)="commitEditing($event)" [attr.aria-label]="strings().content"></textarea>
|
|
4747
|
+
} @else {
|
|
4748
|
+
<div class="ds__text" [class.ds__text--bound]="isBound(c)" [style]="textStyle(c)" [attr.title]="isBound(c) ? boundExpression(c) : null">{{ caption(c, band) }}</div>
|
|
4749
|
+
}
|
|
3513
4750
|
}
|
|
3514
4751
|
}
|
|
3515
4752
|
@if (isOnlySelected(c.id)) {
|
|
@@ -3519,6 +4756,11 @@ class DesignSurfaceComponent {
|
|
|
3519
4756
|
}
|
|
3520
4757
|
</div>
|
|
3521
4758
|
}
|
|
4759
|
+
@if (marquee(); as m) {
|
|
4760
|
+
@if (m.bandId === band.id) {
|
|
4761
|
+
<div class="ds__marquee" [style.left.mm]="m.x * zoom()" [style.top.mm]="m.y * zoom()" [style.width.mm]="m.width * zoom()" [style.height.mm]="m.height * zoom()"></div>
|
|
4762
|
+
}
|
|
4763
|
+
}
|
|
3522
4764
|
@if (columnShade(band); as shade) {
|
|
3523
4765
|
<div class="ds__columns" [style.left.mm]="shade.left * zoom()" aria-hidden="true">
|
|
3524
4766
|
<span>{{ strings().repeatsAcross.replace('{0}', '' + shade.count) }}</span>
|
|
@@ -3527,16 +4769,33 @@ class DesignSurfaceComponent {
|
|
|
3527
4769
|
@for (g of guidesFor(band.id); track $index) {
|
|
3528
4770
|
<div class="ds__guide" [class.ds__guide--v]="g.orientation === 'v'" [style.left.mm]="g.orientation === 'v' ? g.at * zoom() : null" [style.top.mm]="g.orientation === 'h' ? g.at * zoom() : null"></div>
|
|
3529
4771
|
}
|
|
4772
|
+
@for (g of gaps(); track $index) {
|
|
4773
|
+
@if (g.bandId === band.id) {
|
|
4774
|
+
<div
|
|
4775
|
+
class="ds__gap"
|
|
4776
|
+
[class.ds__gap--v]="g.orientation === 'v'"
|
|
4777
|
+
[style.left.mm]="g.x * zoom()"
|
|
4778
|
+
[style.top.mm]="g.y * zoom()"
|
|
4779
|
+
[style.width.mm]="g.orientation === 'h' ? g.length * zoom() : null"
|
|
4780
|
+
[style.height.mm]="g.orientation === 'v' ? g.length * zoom() : null"
|
|
4781
|
+
>
|
|
4782
|
+
<span>{{ g.length.toFixed(1) }}</span>
|
|
4783
|
+
</div>
|
|
4784
|
+
}
|
|
4785
|
+
}
|
|
3530
4786
|
</div>
|
|
3531
|
-
<div class="ds__band-resize" (pointerdown)="onBandResizePointerDown($event, band)" [title]="strings().bandHeight"></div>
|
|
4787
|
+
<div class="ds__band-resize" [hidden]="folded" (pointerdown)="onBandResizePointerDown($event, band)" [title]="strings().bandHeight"></div>
|
|
3532
4788
|
</div>
|
|
3533
4789
|
}
|
|
3534
4790
|
</div>
|
|
3535
|
-
|
|
4791
|
+
@if (formulaEdit(); as f) {
|
|
4792
|
+
<we-report-expression-editor [expression]="f.expression" [fields]="fields()" [strings]="strings()" (applied)="applyFormula($event)" (closed)="formulaEdit.set(null)" />
|
|
4793
|
+
}
|
|
4794
|
+
`, isInline: true, styles: [":host{display:block;padding:32px 136px 32px 24px;outline:none}.ds__ruler{position:sticky;top:0;z-index:6;display:block;margin:-28px auto 8px;padding-top:6px;box-sizing:content-box;background:var(--we-report-workspace-bg, #f2f2f7);font:9px var(--we-report-font-family, system-ui, sans-serif);overflow:visible}.ds__ruler text{fill:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.ds__ruler-ticks{stroke:var(--we-report-muted-fg, rgba(60, 60, 67, .62));stroke-width:1;shape-rendering:crispEdges}.ds__ruler-margin{fill:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.ds__ruler-selection{fill:var(--we-report-selection-fill, rgba(0, 122, 255, .07));stroke:var(--we-report-selection, #007aff);stroke-width:1}.ds__page{box-sizing:border-box;margin:0 auto;background:var(--we-report-page-bg, #fff);box-shadow:var(--we-report-page-shadow, 0 1px 3px rgba(0, 0, 0, .2));border-radius:2px}.ds__page{position:relative}.ds__watermark{position:absolute;top:50%;left:50%;font-weight:700;white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none}.ds__band{position:relative}.ds__band+.ds__band{border-top:1px dashed var(--we-report-margin-guide, rgba(0, 122, 255, .18))}.ds__band-label{position:absolute;top:0;left:calc(100% + var(--ds-margin-right, 0mm) + 10px);z-index:5;max-width:116px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:999px;padding:2px 9px;font:500 11px var(--we-report-font-family, system-ui, sans-serif);background:var(--we-report-band-label-bg, rgba(118, 118, 128, .1));color:var(--we-report-band-label-fg, rgba(60, 60, 67, .7));cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .15s ease,color .15s ease}.ds__band:hover .ds__band-label{color:var(--we-report-fg, #1d1d1f)}.ds__band--selected .ds__band-label{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.ds__band--selected .ds__band-body{box-shadow:inset 0 0 0 1.5px var(--we-report-selection, #007aff)}.ds__band-label:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.ds__band--collapsed .ds__band-body{overflow:hidden;background:repeating-linear-gradient(-45deg,var(--we-report-band-label-bg, rgba(118, 118, 128, .1)) 0 4px,transparent 4px 8px)!important}.ds__band--collapsed .ds__band-body>*{display:none}.ds__band-body{position:relative;background-image:radial-gradient(circle,var(--we-report-margin-guide, rgba(0, 122, 255, .18)) .7px,transparent .7px)}.ds__columns{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;border-left:1px dashed var(--we-report-selection, #007aff);background:repeating-linear-gradient(-45deg,var(--we-report-selection-fill, rgba(0, 122, 255, .07)) 0 6px,transparent 6px 12px);color:var(--we-report-accent, #007aff);font:500 11px var(--we-report-font-family, system-ui, sans-serif);pointer-events:none}.ds__band-resize{position:absolute;left:0;right:0;bottom:-3px;height:6px;cursor:ns-resize;z-index:2}.ds__control{position:absolute;box-sizing:border-box;outline:1px dashed var(--we-report-control-outline, rgba(60, 60, 67, .22));outline-offset:-1px;border-radius:2px;cursor:default;touch-action:none;transition:outline-color .12s ease,background-color .12s ease}.ds__control:hover{outline:1px solid var(--we-report-selection, #007aff)}.ds__control--selected{outline:1.5px solid var(--we-report-selection, #007aff);outline-offset:0;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));cursor:move;z-index:1}:host(.ds--painting) .ds__control{cursor:copy}.ds__control--cut{box-shadow:inset 0 -2px 0 var(--we-report-warning-fg, #c93400)}.ds__editor{position:absolute;inset:0;z-index:6;box-sizing:border-box;width:100%;height:100%;margin:0;border:0;outline:2px solid var(--we-report-selection, #007aff);resize:none;overflow:hidden;background:var(--we-report-page-bg, #fff);line-height:1.36}.ds__marquee{position:absolute;z-index:7;border:1px solid var(--we-report-selection, #007aff);background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));pointer-events:none}.ds__cell{position:absolute;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;white-space:pre-wrap;word-break:break-word;line-height:1.36}.ds__cell--on{outline:2px solid var(--we-report-selection, #007aff);outline-offset:-2px;z-index:1}.ds__fill{position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box;pointer-events:none}.ds__image{display:block}.ds__placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--we-report-accent, #007aff);font:10px var(--we-report-font-family, system-ui, sans-serif);opacity:.8;overflow:hidden;pointer-events:none}.ds__text{position:absolute;inset:0;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;white-space:pre-wrap;word-break:break-word;line-height:1.36;pointer-events:none}.ds__text--bound{text-decoration:underline dotted var(--we-report-accent, #007aff);text-underline-offset:2px}.ds__handle{position:absolute;width:9px;height:9px;margin:-4.5px 0 0 -4.5px;box-sizing:border-box;background:var(--we-report-page-bg, #fff);border:1.5px solid var(--we-report-selection, #007aff);border-radius:50%;box-shadow:0 1px 2px #0003;z-index:3}.ds__handle[data-handle=nw]{left:0;top:0;cursor:nwse-resize}.ds__handle[data-handle=n]{left:50%;top:0;cursor:ns-resize}.ds__handle[data-handle=ne]{left:100%;top:0;cursor:nesw-resize}.ds__handle[data-handle=e]{left:100%;top:50%;cursor:ew-resize}.ds__handle[data-handle=se]{left:100%;top:100%;cursor:nwse-resize}.ds__handle[data-handle=s]{left:50%;top:100%;cursor:ns-resize}.ds__handle[data-handle=sw]{left:0;top:100%;cursor:nesw-resize}.ds__handle[data-handle=w]{left:0;top:50%;cursor:ew-resize}.ds__gap{position:absolute;z-index:4;height:0;border-top:1px dashed var(--we-report-guide, #ff375f);pointer-events:none}.ds__gap--v{width:0;border-top:0;border-left:1px dashed var(--we-report-guide, #ff375f)}.ds__gap span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:0 4px;border-radius:4px;background:var(--we-report-guide, #ff375f);color:var(--we-report-accent-fg, #fff);font:600 10px var(--we-report-font-family, system-ui, sans-serif);white-space:nowrap}.ds__guide{position:absolute;left:0;right:0;height:0;border-top:1px solid var(--we-report-guide, #ff375f);pointer-events:none;z-index:4}.ds__guide--v{top:0;bottom:0;right:auto;width:0;height:auto;border-top:0;border-left:1px solid var(--we-report-guide, #ff375f)}@media (prefers-reduced-motion: reduce){.ds__band-label,.ds__control{transition:none}}\n"], dependencies: [{ kind: "pipe", type: WeReportIconPipe, name: "weReportIcon" }, { kind: "component", type: ExpressionEditorComponent, selector: "we-report-expression-editor", inputs: ["expression", "fields", "strings"], outputs: ["applied", "closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3536
4795
|
}
|
|
3537
4796
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignSurfaceComponent, decorators: [{
|
|
3538
4797
|
type: Component,
|
|
3539
|
-
args: [{ selector: 'we-report-design-surface', standalone: true, imports: [WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { tabindex: '0' }, template: `
|
|
4798
|
+
args: [{ selector: 'we-report-design-surface', standalone: true, imports: [WeReportIconPipe, ExpressionEditorComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: { tabindex: '0', '[class.ds--painting]': '!!state.painter()' }, template: `
|
|
3540
4799
|
@let r = ruler();
|
|
3541
4800
|
<svg class="ds__ruler" aria-hidden="true" [attr.width]="r.width" height="20" [attr.viewBox]="'0 0 ' + r.width + ' 20'">
|
|
3542
4801
|
<rect class="ds__ruler-margin" x="0" y="0" [attr.width]="r.left" height="20" />
|
|
@@ -3549,22 +4808,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3549
4808
|
<text [attr.x]="l.x + 2" y="9">{{ l.text }}</text>
|
|
3550
4809
|
}
|
|
3551
4810
|
</svg>
|
|
3552
|
-
<div class="ds__page" role="region" [attr.aria-label]="strings().designerLabel" [style.width.mm]="geometry().width * zoom()" [style.min-height.mm]="(geometry().height ?? 0) * zoom()" [style.padding]="padding()" [style.--ds-margin-right.mm]="state.report().page.margins.right * zoom()">
|
|
4811
|
+
<div class="ds__page" (pointermove)="trackPointer($event)" (pointerleave)="state.pointer.set(null)" role="region" [attr.aria-label]="strings().designerLabel" [style.width.mm]="geometry().width * zoom()" [style.min-height.mm]="(geometry().height ?? 0) * zoom()" [style.padding]="padding()" [style.--ds-margin-right.mm]="state.report().page.margins.right * zoom()">
|
|
3553
4812
|
@if (watermarkText(); as wm) {
|
|
3554
4813
|
<div class="ds__watermark" aria-hidden="true" [style.color]="state.report().watermark?.color ?? defaultWatermarkColor" [style.font-size.mm]="geometry().width * zoom() * 0.12" [style.transform]="'translate(-50%, -50%) rotate(' + -(state.report().watermark?.angle ?? 45) + 'deg)'">{{ wm }}</div>
|
|
3555
4814
|
}
|
|
3556
4815
|
@for (band of state.report().bands; track band.id) {
|
|
3557
|
-
|
|
3558
|
-
|
|
4816
|
+
@let folded = state.collapsed().has(band.id);
|
|
4817
|
+
<div class="ds__band" [class.ds__band--selected]="isBandSelected(band.id)" [class.ds__band--collapsed]="folded">
|
|
4818
|
+
<button type="button" class="ds__band-label" [title]="bandLabel(band) + ' — ' + (folded ? strings().expandBand : strings().collapseBand) " [attr.aria-expanded]="!folded" (click)="selectBand(band.id)" (dblclick)="state.toggleCollapsed(band.id)">
|
|
3559
4819
|
{{ bandLabel(band) }}
|
|
3560
4820
|
</button>
|
|
3561
4821
|
<div
|
|
3562
4822
|
class="ds__band-body"
|
|
3563
4823
|
[attr.data-band-id]="band.id"
|
|
3564
|
-
[style.height.mm]="band.height * zoom()"
|
|
4824
|
+
[style.height.mm]="folded ? 6 : band.height * zoom()"
|
|
3565
4825
|
[style.background-color]="band.backgroundColor ?? null"
|
|
3566
4826
|
[style.background-size.mm]="gridSize() * zoom()"
|
|
3567
|
-
|
|
4827
|
+
[style.background-image]="gridSize() ? null : 'none'"
|
|
4828
|
+
(pointerdown)="onBodyPointerDown($event, band)"
|
|
3568
4829
|
(dragover)="onDragOver($event)"
|
|
3569
4830
|
(drop)="onDrop($event, band)"
|
|
3570
4831
|
>
|
|
@@ -3573,12 +4834,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3573
4834
|
class="ds__control"
|
|
3574
4835
|
[attr.data-control-id]="c.id"
|
|
3575
4836
|
[class.ds__control--selected]="isSelected(c.id)"
|
|
4837
|
+
[class.ds__control--cut]="cutTexts().has(c.id)"
|
|
3576
4838
|
[attr.data-type]="c.type"
|
|
3577
4839
|
[style.left.mm]="c.x * zoom()"
|
|
3578
4840
|
[style.top.mm]="c.y * zoom()"
|
|
3579
4841
|
[style.width.mm]="c.width * zoom()"
|
|
3580
4842
|
[style.height.mm]="c.height * zoom()"
|
|
3581
4843
|
(pointerdown)="onControlPointerDown($event, c, band)"
|
|
4844
|
+
(dblclick)="startEditing(c)"
|
|
3582
4845
|
>
|
|
3583
4846
|
@switch (c.type) {
|
|
3584
4847
|
@case ('line') {
|
|
@@ -3621,7 +4884,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3621
4884
|
[style.width.mm]="cell.width * zoom()"
|
|
3622
4885
|
[style.height.mm]="cell.height * zoom()"
|
|
3623
4886
|
(click)="selectCell(c.id, cell.row, cell.index)"
|
|
3624
|
-
|
|
4887
|
+
(dblclick)="$event.stopPropagation(); startEditing(c, cell.row, cell.index)"
|
|
4888
|
+
>
|
|
4889
|
+
@if (isEditing(c.id, cell.row, cell.index)) {
|
|
4890
|
+
<textarea class="ds__editor" [value]="editText()" [style]="cell.style" (pointerdown)="$event.stopPropagation()" (keydown)="onEditorKey($event)" (blur)="commitEditing($event)" [attr.aria-label]="strings().content"></textarea>
|
|
4891
|
+
} @else {
|
|
4892
|
+
{{ cell.text }}
|
|
4893
|
+
}
|
|
4894
|
+
</div>
|
|
3625
4895
|
}
|
|
3626
4896
|
}
|
|
3627
4897
|
@case ('chart') {
|
|
@@ -3634,7 +4904,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3634
4904
|
<div class="ds__placeholder" [innerHTML]="'checkbox' | weReportIcon"></div>
|
|
3635
4905
|
}
|
|
3636
4906
|
@default {
|
|
3637
|
-
|
|
4907
|
+
@if (isEditing(c.id)) {
|
|
4908
|
+
<textarea class="ds__editor" [value]="editText()" [style]="textStyle(c)" (pointerdown)="$event.stopPropagation()" (keydown)="onEditorKey($event)" (blur)="commitEditing($event)" [attr.aria-label]="strings().content"></textarea>
|
|
4909
|
+
} @else {
|
|
4910
|
+
<div class="ds__text" [class.ds__text--bound]="isBound(c)" [style]="textStyle(c)" [attr.title]="isBound(c) ? boundExpression(c) : null">{{ caption(c, band) }}</div>
|
|
4911
|
+
}
|
|
3638
4912
|
}
|
|
3639
4913
|
}
|
|
3640
4914
|
@if (isOnlySelected(c.id)) {
|
|
@@ -3644,238 +4918,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3644
4918
|
}
|
|
3645
4919
|
</div>
|
|
3646
4920
|
}
|
|
3647
|
-
@if (
|
|
3648
|
-
|
|
3649
|
-
<
|
|
3650
|
-
|
|
3651
|
-
}
|
|
3652
|
-
@for (g of guidesFor(band.id); track $index) {
|
|
3653
|
-
<div class="ds__guide" [class.ds__guide--v]="g.orientation === 'v'" [style.left.mm]="g.orientation === 'v' ? g.at * zoom() : null" [style.top.mm]="g.orientation === 'h' ? g.at * zoom() : null"></div>
|
|
3654
|
-
}
|
|
3655
|
-
</div>
|
|
3656
|
-
<div class="ds__band-resize" (pointerdown)="onBandResizePointerDown($event, band)" [title]="strings().bandHeight"></div>
|
|
3657
|
-
</div>
|
|
3658
|
-
}
|
|
3659
|
-
</div>
|
|
3660
|
-
`, styles: [":host{display:block;padding:32px 136px 32px 24px;outline:none}.ds__ruler{position:sticky;top:0;z-index:6;display:block;margin:-28px auto 8px;padding-top:6px;box-sizing:content-box;background:var(--we-report-workspace-bg, #f2f2f7);font:9px var(--we-report-font-family, system-ui, sans-serif);overflow:visible}.ds__ruler text{fill:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.ds__ruler-ticks{stroke:var(--we-report-muted-fg, rgba(60, 60, 67, .62));stroke-width:1;shape-rendering:crispEdges}.ds__ruler-margin{fill:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.ds__ruler-selection{fill:var(--we-report-selection-fill, rgba(0, 122, 255, .07));stroke:var(--we-report-selection, #007aff);stroke-width:1}.ds__page{box-sizing:border-box;margin:0 auto;background:var(--we-report-page-bg, #fff);box-shadow:var(--we-report-page-shadow, 0 1px 3px rgba(0, 0, 0, .2));border-radius:2px}.ds__page{position:relative}.ds__watermark{position:absolute;top:50%;left:50%;font-weight:700;white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none}.ds__band{position:relative}.ds__band+.ds__band{border-top:1px dashed var(--we-report-margin-guide, rgba(0, 122, 255, .18))}.ds__band-label{position:absolute;top:0;left:calc(100% + var(--ds-margin-right, 0mm) + 10px);z-index:5;max-width:116px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:999px;padding:2px 9px;font:500 11px var(--we-report-font-family, system-ui, sans-serif);background:var(--we-report-band-label-bg, rgba(118, 118, 128, .1));color:var(--we-report-band-label-fg, rgba(60, 60, 67, .7));cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .15s ease,color .15s ease}.ds__band:hover .ds__band-label{color:var(--we-report-fg, #1d1d1f)}.ds__band--selected .ds__band-label{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.ds__band--selected .ds__band-body{box-shadow:inset 0 0 0 1.5px var(--we-report-selection, #007aff)}.ds__band-label:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.ds__band-body{position:relative;background-image:radial-gradient(circle,var(--we-report-margin-guide, rgba(0, 122, 255, .18)) .7px,transparent .7px)}.ds__columns{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;border-left:1px dashed var(--we-report-selection, #007aff);background:repeating-linear-gradient(-45deg,var(--we-report-selection-fill, rgba(0, 122, 255, .07)) 0 6px,transparent 6px 12px);color:var(--we-report-accent, #007aff);font:500 11px var(--we-report-font-family, system-ui, sans-serif);pointer-events:none}.ds__band-resize{position:absolute;left:0;right:0;bottom:-3px;height:6px;cursor:ns-resize;z-index:2}.ds__control{position:absolute;box-sizing:border-box;outline:1px dashed var(--we-report-control-outline, rgba(60, 60, 67, .22));outline-offset:-1px;border-radius:2px;cursor:default;touch-action:none;transition:outline-color .12s ease,background-color .12s ease}.ds__control:hover{outline:1px solid var(--we-report-selection, #007aff)}.ds__control--selected{outline:1.5px solid var(--we-report-selection, #007aff);outline-offset:0;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));cursor:move;z-index:1}.ds__cell{position:absolute;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;white-space:pre-wrap;word-break:break-word;line-height:1.36}.ds__cell--on{outline:2px solid var(--we-report-selection, #007aff);outline-offset:-2px;z-index:1}.ds__fill{position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box;pointer-events:none}.ds__image{display:block}.ds__placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--we-report-accent, #007aff);font:10px var(--we-report-font-family, system-ui, sans-serif);opacity:.8;overflow:hidden;pointer-events:none}.ds__text{position:absolute;inset:0;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;white-space:pre-wrap;word-break:break-word;line-height:1.36;pointer-events:none}.ds__text--bound{text-decoration:underline dotted var(--we-report-accent, #007aff);text-underline-offset:2px}.ds__handle{position:absolute;width:9px;height:9px;margin:-4.5px 0 0 -4.5px;box-sizing:border-box;background:var(--we-report-page-bg, #fff);border:1.5px solid var(--we-report-selection, #007aff);border-radius:50%;box-shadow:0 1px 2px #0003;z-index:3}.ds__handle[data-handle=nw]{left:0;top:0;cursor:nwse-resize}.ds__handle[data-handle=n]{left:50%;top:0;cursor:ns-resize}.ds__handle[data-handle=ne]{left:100%;top:0;cursor:nesw-resize}.ds__handle[data-handle=e]{left:100%;top:50%;cursor:ew-resize}.ds__handle[data-handle=se]{left:100%;top:100%;cursor:nwse-resize}.ds__handle[data-handle=s]{left:50%;top:100%;cursor:ns-resize}.ds__handle[data-handle=sw]{left:0;top:100%;cursor:nesw-resize}.ds__handle[data-handle=w]{left:0;top:50%;cursor:ew-resize}.ds__guide{position:absolute;left:0;right:0;height:0;border-top:1px solid var(--we-report-guide, #ff375f);pointer-events:none;z-index:4}.ds__guide--v{top:0;bottom:0;right:auto;width:0;height:auto;border-top:0;border-left:1px solid var(--we-report-guide, #ff375f)}@media (prefers-reduced-motion: reduce){.ds__band-label,.ds__control{transition:none}}\n"] }]
|
|
3661
|
-
}] });
|
|
3662
|
-
function round(v) {
|
|
3663
|
-
return Math.round(v * 100) / 100;
|
|
3664
|
-
}
|
|
3665
|
-
|
|
3666
|
-
function flatten(fields, parent, prefix = '', depth = 0, skip) {
|
|
3667
|
-
const out = [];
|
|
3668
|
-
for (const f of fields) {
|
|
3669
|
-
const path = prefix ? `${prefix}.${f.name}` : f.name;
|
|
3670
|
-
// The row list itself is not a field of the parent; its columns are the row fields.
|
|
3671
|
-
if (skip && path === skip)
|
|
3672
|
-
continue;
|
|
3673
|
-
if (f.type === 'object' && f.fields) {
|
|
3674
|
-
out.push({ path, label: f.name, type: f.type, parent, expression: fieldExpression(path, parent), depth });
|
|
3675
|
-
out.push(...flatten(f.fields, parent, path, depth + 1, skip));
|
|
3676
|
-
}
|
|
3677
|
-
else if (f.type !== 'array') {
|
|
3678
|
-
out.push({ path, label: f.name, type: f.type, parent, expression: fieldExpression(path, parent), depth });
|
|
3679
|
-
}
|
|
3680
|
-
}
|
|
3681
|
-
return out;
|
|
3682
|
-
}
|
|
3683
|
-
/** Paths of the lists of objects inside a row, e.g. `orders` or `customer.addresses`. */
|
|
3684
|
-
function listPaths(fields, prefix = '') {
|
|
3685
|
-
return fields.flatMap((f) => {
|
|
3686
|
-
const path = prefix ? `${prefix}.${f.name}` : f.name;
|
|
3687
|
-
if (f.type === 'array' && f.fields?.length)
|
|
3688
|
-
return [{ path, fields: f.fields }];
|
|
3689
|
-
return f.type === 'object' && f.fields ? listPaths(f.fields, path) : [];
|
|
3690
|
-
});
|
|
3691
|
-
}
|
|
3692
|
-
/**
|
|
3693
|
-
* Row fields, fields of the object holding the rows (when the rows are a nested list), the lists
|
|
3694
|
-
* inside a row (for an inner list) and the fields of the inner list's items.
|
|
3695
|
-
*/
|
|
3696
|
-
function designerFields(report, data) {
|
|
3697
|
-
let resolved;
|
|
3698
|
-
try {
|
|
3699
|
-
resolved = resolveReportData(report, data);
|
|
3700
|
-
}
|
|
3701
|
-
catch {
|
|
3702
|
-
return { rows: [], parent: [], lists: [], inner: [] };
|
|
3703
|
-
}
|
|
3704
|
-
const schema = inferSchema(resolved.rows ?? []);
|
|
3705
|
-
const rows = flatten(schema, false);
|
|
3706
|
-
const lists = listPaths(schema);
|
|
3707
|
-
const innerPath = report.bands.find((b) => b.kind === 'subDetail')?.rowsPath;
|
|
3708
|
-
const inner = flatten(lists.find((l) => l.path === innerPath)?.fields ?? [], false);
|
|
3709
|
-
const parentValue = resolved.parent;
|
|
3710
|
-
const listName = report.dataMember?.path?.split('.').pop();
|
|
3711
|
-
const parent = parentValue && typeof parentValue === 'object' && !Array.isArray(parentValue)
|
|
3712
|
-
? flatten(inferSchema([parentValue]), true, '', 0, listName)
|
|
3713
|
-
: [];
|
|
3714
|
-
return { rows, parent, lists: lists.map((l) => l.path), inner };
|
|
3715
|
-
}
|
|
3716
|
-
|
|
3717
|
-
const CATEGORIES = [
|
|
3718
|
-
{ id: 'logic', label: 'fnLogic' },
|
|
3719
|
-
{ id: 'text', label: 'fnText' },
|
|
3720
|
-
{ id: 'number', label: 'fnNumber' },
|
|
3721
|
-
{ id: 'date', label: 'fnDate' },
|
|
3722
|
-
{ id: 'aggregate', label: 'fnAggregate' },
|
|
3723
|
-
];
|
|
3724
|
-
/**
|
|
3725
|
-
* A sheet for writing a formula: fields, parameters and every function with a one-line
|
|
3726
|
-
* explanation, inserted at the cursor, and the result for the first data row as you type.
|
|
3727
|
-
*/
|
|
3728
|
-
class ExpressionEditorComponent {
|
|
3729
|
-
expression = input('');
|
|
3730
|
-
fields = input([]);
|
|
3731
|
-
strings = input.required();
|
|
3732
|
-
applied = output();
|
|
3733
|
-
closed = output();
|
|
3734
|
-
state = inject(DesignerState);
|
|
3735
|
-
config = inject(WE_REPORT_CONFIG);
|
|
3736
|
-
area = viewChild.required('area');
|
|
3737
|
-
categories = CATEGORIES;
|
|
3738
|
-
draft = signal('');
|
|
3739
|
-
category = signal('logic');
|
|
3740
|
-
parameters = computed(() => this.state.report().parameters ?? []);
|
|
3741
|
-
visibleFunctions = computed(() => EXPRESSION_FUNCTIONS.filter((f) => f.category === this.category()));
|
|
3742
|
-
/** What the formula gives for the first row, or why it cannot be evaluated. */
|
|
3743
|
-
result = computed(() => {
|
|
3744
|
-
const formula = this.draft().trim();
|
|
3745
|
-
if (!formula)
|
|
3746
|
-
return { text: this.strings().formulaEmpty, error: false };
|
|
3747
|
-
const report = this.state.report();
|
|
3748
|
-
const options = { locale: report.locale || this.config.locale || 'en-US', currency: report.currency || this.config.currency || 'USD' };
|
|
3749
|
-
const sample = this.state.sample();
|
|
3750
|
-
try {
|
|
3751
|
-
const value = evaluate(formula, { ...sample, params: resolveParameters(this.parameters()), ...options, now: new Date() });
|
|
3752
|
-
const text = typeof value === 'string' ? value : formatValue(value, undefined, options);
|
|
3753
|
-
return { text: text === '' ? this.strings().formulaEmpty : text, error: false };
|
|
3754
|
-
}
|
|
3755
|
-
catch (e) {
|
|
3756
|
-
return { text: e.message, error: true };
|
|
3757
|
-
}
|
|
3758
|
-
});
|
|
3759
|
-
ngAfterViewInit() {
|
|
3760
|
-
// The textarea owns its text (no [value] binding), so inserting never moves the caret.
|
|
3761
|
-
const el = this.area().nativeElement;
|
|
3762
|
-
el.value = this.expression();
|
|
3763
|
-
this.draft.set(el.value);
|
|
3764
|
-
queueMicrotask(() => el.focus());
|
|
3765
|
-
}
|
|
3766
|
-
/** Inserts at the caret (replacing a selection); `caretBack` moves the caret left afterwards. */
|
|
3767
|
-
insert(text, caretBack = 0) {
|
|
3768
|
-
const el = this.area().nativeElement;
|
|
3769
|
-
el.focus();
|
|
3770
|
-
el.setRangeText(text, el.selectionStart, el.selectionEnd, 'end');
|
|
3771
|
-
el.selectionStart = el.selectionEnd = el.selectionEnd - caretBack;
|
|
3772
|
-
this.draft.set(el.value);
|
|
3773
|
-
}
|
|
3774
|
-
/** Inserts `Name()` and puts the cursor between the brackets. */
|
|
3775
|
-
insertFunction(f) {
|
|
3776
|
-
this.insert(`${f.name}()`, 1);
|
|
3777
|
-
}
|
|
3778
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExpressionEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3779
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ExpressionEditorComponent, isStandalone: true, selector: "we-report-expression-editor", inputs: { expression: { classPropertyName: "expression", publicName: "expression", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { applied: "applied", closed: "closed" }, viewQueries: [{ propertyName: "area", first: true, predicate: ["area"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3780
|
-
@let s = strings();
|
|
3781
|
-
<div class="xe__backdrop" (click)="closed.emit()"></div>
|
|
3782
|
-
<div class="xe" role="dialog" aria-modal="true" [attr.aria-label]="s.formulaEditor" (keydown.escape)="closed.emit()">
|
|
3783
|
-
<h2>{{ s.formulaEditor }}</h2>
|
|
3784
|
-
<p class="xe__hint">{{ s.formulaEditorHint }}</p>
|
|
3785
|
-
<textarea #area class="xe__formula" (input)="draft.set($any($event.target).value)" spellcheck="false" rows="3" [attr.aria-label]="s.expression"></textarea>
|
|
3786
|
-
<div class="xe__result" [class.xe__result--error]="result().error" aria-live="polite">
|
|
3787
|
-
<span>{{ s.formulaResult }}</span>
|
|
3788
|
-
<output>{{ result().text }}</output>
|
|
3789
|
-
</div>
|
|
3790
|
-
<div class="xe__lists">
|
|
3791
|
-
<section>
|
|
3792
|
-
<h3>{{ s.fields }}</h3>
|
|
3793
|
-
<ul>
|
|
3794
|
-
@for (f of fields(); track f.expression) {
|
|
3795
|
-
<li><button type="button" (click)="insert(f.expression)" [style.padding-left.px]="8 + f.depth * 12">{{ f.label }}</button></li>
|
|
3796
|
-
}
|
|
3797
|
-
@for (p of parameters(); track p.name) {
|
|
3798
|
-
<li><button type="button" (click)="insert('[?' + p.name + ']')">? {{ p.label || p.name }}</button></li>
|
|
3799
|
-
}
|
|
3800
|
-
</ul>
|
|
3801
|
-
</section>
|
|
3802
|
-
<section>
|
|
3803
|
-
<h3>{{ s.functions }}</h3>
|
|
3804
|
-
<div class="xe__cats" role="tablist">
|
|
3805
|
-
@for (c of categories; track c.id) {
|
|
3806
|
-
<button type="button" role="tab" [attr.aria-selected]="category() === c.id" [class.xe__on]="category() === c.id" (click)="category.set(c.id)">{{ s[c.label] }}</button>
|
|
3807
|
-
}
|
|
3808
|
-
</div>
|
|
3809
|
-
<ul>
|
|
3810
|
-
@for (f of visibleFunctions(); track f.name) {
|
|
3811
|
-
<li>
|
|
3812
|
-
<button type="button" class="xe__fn" (click)="insertFunction(f)">
|
|
3813
|
-
<code>{{ f.signature }}</code>
|
|
3814
|
-
<small>{{ s.functionHelp[f.name] }}</small>
|
|
3815
|
-
</button>
|
|
3816
|
-
</li>
|
|
4921
|
+
@if (marquee(); as m) {
|
|
4922
|
+
@if (m.bandId === band.id) {
|
|
4923
|
+
<div class="ds__marquee" [style.left.mm]="m.x * zoom()" [style.top.mm]="m.y * zoom()" [style.width.mm]="m.width * zoom()" [style.height.mm]="m.height * zoom()"></div>
|
|
4924
|
+
}
|
|
3817
4925
|
}
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
<button type="button" (click)="closed.emit()">{{ s.cancel }}</button>
|
|
3823
|
-
<button type="button" class="xe__primary" (click)="applied.emit(draft())">{{ s.apply }}</button>
|
|
3824
|
-
</div>
|
|
3825
|
-
</div>
|
|
3826
|
-
`, isInline: true, styles: [".xe__backdrop{position:fixed;inset:0;z-index:150;background:var(--we-report-backdrop, rgba(0, 0, 0, .22))}.xe{position:fixed;top:50%;left:50%;z-index:151;transform:translate(-50%,-50%);display:flex;flex-direction:column;gap:10px;width:min(820px,calc(100vw - 32px));height:min(640px,calc(100vh - 32px));box-sizing:border-box;padding:20px;border-radius:14px;background:var(--we-report-panel-bg, #fbfbfd);color:var(--we-report-fg, #1d1d1f);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14));font:13px var(--we-report-font-family, system-ui, sans-serif)}h2{margin:0;font-size:15px;font-weight:600}h3{margin:0 0 6px;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__hint{margin:-6px 0 0;font-size:12px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__formula{box-sizing:border-box;width:100%;padding:10px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:13px ui-monospace,SF Mono,Menlo,Consolas,monospace;resize:vertical}.xe__formula:focus,button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.xe__result{display:flex;gap:8px;align-items:baseline;padding:8px 12px;border-radius:10px;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));font-size:12px}.xe__result span{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__result output{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xe__result--error{background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000)}.xe__lists{flex:1;min-height:0;display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px}.xe__lists section{display:flex;flex-direction:column;min-height:0}ul{flex:1;overflow:auto;list-style:none;margin:0;padding:4px;border-radius:10px;background:var(--we-report-workspace-bg, #f2f2f7)}li button{display:block;width:100%;border:0;border-radius:6px;padding:5px 8px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}li button:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.xe__fn code{display:block;font:12px ui-monospace,SF Mono,Menlo,Consolas,monospace;color:var(--we-report-accent, #007aff)}.xe__fn small{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.xe__cats{display:flex;gap:2px;padding:2px;margin-bottom:6px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.xe__cats button{flex:1;border:0;border-radius:6px;padding:4px;background:transparent;color:inherit;font:inherit;font-size:12px;cursor:pointer}.xe__cats .xe__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.xe__actions{display:flex;justify-content:flex-end;gap:8px}.xe__actions button{border:0;border-radius:var(--we-report-control-radius, 7px);padding:6px 16px;background:var(--we-report-hover-bg, rgba(118, 118, 128, .12));color:inherit;font:inherit;font-weight:500;cursor:pointer}.xe__actions .xe__primary{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3827
|
-
}
|
|
3828
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExpressionEditorComponent, decorators: [{
|
|
3829
|
-
type: Component,
|
|
3830
|
-
args: [{ selector: 'we-report-expression-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3831
|
-
@let s = strings();
|
|
3832
|
-
<div class="xe__backdrop" (click)="closed.emit()"></div>
|
|
3833
|
-
<div class="xe" role="dialog" aria-modal="true" [attr.aria-label]="s.formulaEditor" (keydown.escape)="closed.emit()">
|
|
3834
|
-
<h2>{{ s.formulaEditor }}</h2>
|
|
3835
|
-
<p class="xe__hint">{{ s.formulaEditorHint }}</p>
|
|
3836
|
-
<textarea #area class="xe__formula" (input)="draft.set($any($event.target).value)" spellcheck="false" rows="3" [attr.aria-label]="s.expression"></textarea>
|
|
3837
|
-
<div class="xe__result" [class.xe__result--error]="result().error" aria-live="polite">
|
|
3838
|
-
<span>{{ s.formulaResult }}</span>
|
|
3839
|
-
<output>{{ result().text }}</output>
|
|
3840
|
-
</div>
|
|
3841
|
-
<div class="xe__lists">
|
|
3842
|
-
<section>
|
|
3843
|
-
<h3>{{ s.fields }}</h3>
|
|
3844
|
-
<ul>
|
|
3845
|
-
@for (f of fields(); track f.expression) {
|
|
3846
|
-
<li><button type="button" (click)="insert(f.expression)" [style.padding-left.px]="8 + f.depth * 12">{{ f.label }}</button></li>
|
|
4926
|
+
@if (columnShade(band); as shade) {
|
|
4927
|
+
<div class="ds__columns" [style.left.mm]="shade.left * zoom()" aria-hidden="true">
|
|
4928
|
+
<span>{{ strings().repeatsAcross.replace('{0}', '' + shade.count) }}</span>
|
|
4929
|
+
</div>
|
|
3847
4930
|
}
|
|
3848
|
-
@for (
|
|
3849
|
-
<
|
|
4931
|
+
@for (g of guidesFor(band.id); track $index) {
|
|
4932
|
+
<div class="ds__guide" [class.ds__guide--v]="g.orientation === 'v'" [style.left.mm]="g.orientation === 'v' ? g.at * zoom() : null" [style.top.mm]="g.orientation === 'h' ? g.at * zoom() : null"></div>
|
|
3850
4933
|
}
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
4934
|
+
@for (g of gaps(); track $index) {
|
|
4935
|
+
@if (g.bandId === band.id) {
|
|
4936
|
+
<div
|
|
4937
|
+
class="ds__gap"
|
|
4938
|
+
[class.ds__gap--v]="g.orientation === 'v'"
|
|
4939
|
+
[style.left.mm]="g.x * zoom()"
|
|
4940
|
+
[style.top.mm]="g.y * zoom()"
|
|
4941
|
+
[style.width.mm]="g.orientation === 'h' ? g.length * zoom() : null"
|
|
4942
|
+
[style.height.mm]="g.orientation === 'v' ? g.length * zoom() : null"
|
|
4943
|
+
>
|
|
4944
|
+
<span>{{ g.length.toFixed(1) }}</span>
|
|
4945
|
+
</div>
|
|
4946
|
+
}
|
|
3858
4947
|
}
|
|
3859
4948
|
</div>
|
|
3860
|
-
<
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
<button type="button" class="xe__fn" (click)="insertFunction(f)">
|
|
3864
|
-
<code>{{ f.signature }}</code>
|
|
3865
|
-
<small>{{ s.functionHelp[f.name] }}</small>
|
|
3866
|
-
</button>
|
|
3867
|
-
</li>
|
|
3868
|
-
}
|
|
3869
|
-
</ul>
|
|
3870
|
-
</section>
|
|
3871
|
-
</div>
|
|
3872
|
-
<div class="xe__actions">
|
|
3873
|
-
<button type="button" (click)="closed.emit()">{{ s.cancel }}</button>
|
|
3874
|
-
<button type="button" class="xe__primary" (click)="applied.emit(draft())">{{ s.apply }}</button>
|
|
3875
|
-
</div>
|
|
4949
|
+
<div class="ds__band-resize" [hidden]="folded" (pointerdown)="onBandResizePointerDown($event, band)" [title]="strings().bandHeight"></div>
|
|
4950
|
+
</div>
|
|
4951
|
+
}
|
|
3876
4952
|
</div>
|
|
3877
|
-
|
|
4953
|
+
@if (formulaEdit(); as f) {
|
|
4954
|
+
<we-report-expression-editor [expression]="f.expression" [fields]="fields()" [strings]="strings()" (applied)="applyFormula($event)" (closed)="formulaEdit.set(null)" />
|
|
4955
|
+
}
|
|
4956
|
+
`, styles: [":host{display:block;padding:32px 136px 32px 24px;outline:none}.ds__ruler{position:sticky;top:0;z-index:6;display:block;margin:-28px auto 8px;padding-top:6px;box-sizing:content-box;background:var(--we-report-workspace-bg, #f2f2f7);font:9px var(--we-report-font-family, system-ui, sans-serif);overflow:visible}.ds__ruler text{fill:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.ds__ruler-ticks{stroke:var(--we-report-muted-fg, rgba(60, 60, 67, .62));stroke-width:1;shape-rendering:crispEdges}.ds__ruler-margin{fill:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.ds__ruler-selection{fill:var(--we-report-selection-fill, rgba(0, 122, 255, .07));stroke:var(--we-report-selection, #007aff);stroke-width:1}.ds__page{box-sizing:border-box;margin:0 auto;background:var(--we-report-page-bg, #fff);box-shadow:var(--we-report-page-shadow, 0 1px 3px rgba(0, 0, 0, .2));border-radius:2px}.ds__page{position:relative}.ds__watermark{position:absolute;top:50%;left:50%;font-weight:700;white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none}.ds__band{position:relative}.ds__band+.ds__band{border-top:1px dashed var(--we-report-margin-guide, rgba(0, 122, 255, .18))}.ds__band-label{position:absolute;top:0;left:calc(100% + var(--ds-margin-right, 0mm) + 10px);z-index:5;max-width:116px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:999px;padding:2px 9px;font:500 11px var(--we-report-font-family, system-ui, sans-serif);background:var(--we-report-band-label-bg, rgba(118, 118, 128, .1));color:var(--we-report-band-label-fg, rgba(60, 60, 67, .7));cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .15s ease,color .15s ease}.ds__band:hover .ds__band-label{color:var(--we-report-fg, #1d1d1f)}.ds__band--selected .ds__band-label{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.ds__band--selected .ds__band-body{box-shadow:inset 0 0 0 1.5px var(--we-report-selection, #007aff)}.ds__band-label:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.ds__band--collapsed .ds__band-body{overflow:hidden;background:repeating-linear-gradient(-45deg,var(--we-report-band-label-bg, rgba(118, 118, 128, .1)) 0 4px,transparent 4px 8px)!important}.ds__band--collapsed .ds__band-body>*{display:none}.ds__band-body{position:relative;background-image:radial-gradient(circle,var(--we-report-margin-guide, rgba(0, 122, 255, .18)) .7px,transparent .7px)}.ds__columns{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;border-left:1px dashed var(--we-report-selection, #007aff);background:repeating-linear-gradient(-45deg,var(--we-report-selection-fill, rgba(0, 122, 255, .07)) 0 6px,transparent 6px 12px);color:var(--we-report-accent, #007aff);font:500 11px var(--we-report-font-family, system-ui, sans-serif);pointer-events:none}.ds__band-resize{position:absolute;left:0;right:0;bottom:-3px;height:6px;cursor:ns-resize;z-index:2}.ds__control{position:absolute;box-sizing:border-box;outline:1px dashed var(--we-report-control-outline, rgba(60, 60, 67, .22));outline-offset:-1px;border-radius:2px;cursor:default;touch-action:none;transition:outline-color .12s ease,background-color .12s ease}.ds__control:hover{outline:1px solid var(--we-report-selection, #007aff)}.ds__control--selected{outline:1.5px solid var(--we-report-selection, #007aff);outline-offset:0;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));cursor:move;z-index:1}:host(.ds--painting) .ds__control{cursor:copy}.ds__control--cut{box-shadow:inset 0 -2px 0 var(--we-report-warning-fg, #c93400)}.ds__editor{position:absolute;inset:0;z-index:6;box-sizing:border-box;width:100%;height:100%;margin:0;border:0;outline:2px solid var(--we-report-selection, #007aff);resize:none;overflow:hidden;background:var(--we-report-page-bg, #fff);line-height:1.36}.ds__marquee{position:absolute;z-index:7;border:1px solid var(--we-report-selection, #007aff);background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));pointer-events:none}.ds__cell{position:absolute;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;white-space:pre-wrap;word-break:break-word;line-height:1.36}.ds__cell--on{outline:2px solid var(--we-report-selection, #007aff);outline-offset:-2px;z-index:1}.ds__fill{position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box;pointer-events:none}.ds__image{display:block}.ds__placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--we-report-accent, #007aff);font:10px var(--we-report-font-family, system-ui, sans-serif);opacity:.8;overflow:hidden;pointer-events:none}.ds__text{position:absolute;inset:0;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;white-space:pre-wrap;word-break:break-word;line-height:1.36;pointer-events:none}.ds__text--bound{text-decoration:underline dotted var(--we-report-accent, #007aff);text-underline-offset:2px}.ds__handle{position:absolute;width:9px;height:9px;margin:-4.5px 0 0 -4.5px;box-sizing:border-box;background:var(--we-report-page-bg, #fff);border:1.5px solid var(--we-report-selection, #007aff);border-radius:50%;box-shadow:0 1px 2px #0003;z-index:3}.ds__handle[data-handle=nw]{left:0;top:0;cursor:nwse-resize}.ds__handle[data-handle=n]{left:50%;top:0;cursor:ns-resize}.ds__handle[data-handle=ne]{left:100%;top:0;cursor:nesw-resize}.ds__handle[data-handle=e]{left:100%;top:50%;cursor:ew-resize}.ds__handle[data-handle=se]{left:100%;top:100%;cursor:nwse-resize}.ds__handle[data-handle=s]{left:50%;top:100%;cursor:ns-resize}.ds__handle[data-handle=sw]{left:0;top:100%;cursor:nesw-resize}.ds__handle[data-handle=w]{left:0;top:50%;cursor:ew-resize}.ds__gap{position:absolute;z-index:4;height:0;border-top:1px dashed var(--we-report-guide, #ff375f);pointer-events:none}.ds__gap--v{width:0;border-top:0;border-left:1px dashed var(--we-report-guide, #ff375f)}.ds__gap span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:0 4px;border-radius:4px;background:var(--we-report-guide, #ff375f);color:var(--we-report-accent-fg, #fff);font:600 10px var(--we-report-font-family, system-ui, sans-serif);white-space:nowrap}.ds__guide{position:absolute;left:0;right:0;height:0;border-top:1px solid var(--we-report-guide, #ff375f);pointer-events:none;z-index:4}.ds__guide--v{top:0;bottom:0;right:auto;width:0;height:auto;border-top:0;border-left:1px solid var(--we-report-guide, #ff375f)}@media (prefers-reduced-motion: reduce){.ds__band-label,.ds__control{transition:none}}\n"] }]
|
|
3878
4957
|
}] });
|
|
4958
|
+
function round(v) {
|
|
4959
|
+
return Math.round(v * 100) / 100;
|
|
4960
|
+
}
|
|
4961
|
+
|
|
4962
|
+
function flatten(fields, parent, prefix = '', depth = 0, skip) {
|
|
4963
|
+
const out = [];
|
|
4964
|
+
for (const f of fields) {
|
|
4965
|
+
const path = prefix ? `${prefix}.${f.name}` : f.name;
|
|
4966
|
+
// The row list itself is not a field of the parent; its columns are the row fields.
|
|
4967
|
+
if (skip && path === skip)
|
|
4968
|
+
continue;
|
|
4969
|
+
if (f.type === 'object' && f.fields) {
|
|
4970
|
+
out.push({ path, label: f.name, type: f.type, parent, expression: fieldExpression(path, parent), depth });
|
|
4971
|
+
out.push(...flatten(f.fields, parent, path, depth + 1, skip));
|
|
4972
|
+
}
|
|
4973
|
+
else if (f.type !== 'array') {
|
|
4974
|
+
out.push({ path, label: f.name, type: f.type, parent, expression: fieldExpression(path, parent), depth });
|
|
4975
|
+
}
|
|
4976
|
+
}
|
|
4977
|
+
return out;
|
|
4978
|
+
}
|
|
4979
|
+
/** Paths of the lists of objects inside a row, e.g. `orders` or `customer.addresses`. */
|
|
4980
|
+
function listPaths(fields, prefix = '') {
|
|
4981
|
+
return fields.flatMap((f) => {
|
|
4982
|
+
const path = prefix ? `${prefix}.${f.name}` : f.name;
|
|
4983
|
+
if (f.type === 'array' && f.fields?.length)
|
|
4984
|
+
return [{ path, fields: f.fields }];
|
|
4985
|
+
return f.type === 'object' && f.fields ? listPaths(f.fields, path) : [];
|
|
4986
|
+
});
|
|
4987
|
+
}
|
|
4988
|
+
/**
|
|
4989
|
+
* Row fields, fields of the object holding the rows (when the rows are a nested list), the lists
|
|
4990
|
+
* inside a row (for an inner list) and the fields of the inner list's items.
|
|
4991
|
+
*/
|
|
4992
|
+
function designerFields(report, data) {
|
|
4993
|
+
let resolved;
|
|
4994
|
+
try {
|
|
4995
|
+
resolved = resolveReportData(report, data);
|
|
4996
|
+
}
|
|
4997
|
+
catch {
|
|
4998
|
+
return { rows: [], parent: [], lists: [], inner: [] };
|
|
4999
|
+
}
|
|
5000
|
+
const schema = inferSchema(resolved.rows ?? []);
|
|
5001
|
+
const rows = flatten(schema, false);
|
|
5002
|
+
const lists = listPaths(schema);
|
|
5003
|
+
const innerPath = report.bands.find((b) => b.kind === 'subDetail')?.rowsPath;
|
|
5004
|
+
const inner = flatten(lists.find((l) => l.path === innerPath)?.fields ?? [], false);
|
|
5005
|
+
const parentValue = resolved.parent;
|
|
5006
|
+
const listName = report.dataMember?.path?.split('.').pop();
|
|
5007
|
+
const parent = parentValue && typeof parentValue === 'object' && !Array.isArray(parentValue)
|
|
5008
|
+
? flatten(inferSchema([parentValue]), true, '', 0, listName)
|
|
5009
|
+
: [];
|
|
5010
|
+
return { rows, parent, lists: lists.map((l) => l.path), inner };
|
|
5011
|
+
}
|
|
3879
5012
|
|
|
3880
5013
|
/**
|
|
3881
5014
|
* Edits a value that is either fixed or comes from data: "Fixed text" with a text box, or
|
|
@@ -4280,6 +5413,18 @@ class PropertyPanelComponent {
|
|
|
4280
5413
|
this.state.update((d) => applyLabelSheet(d, sheet));
|
|
4281
5414
|
this.state.selection.set({ kind: 'band', id: this.state.report().bands[0].id });
|
|
4282
5415
|
}
|
|
5416
|
+
fieldExpressions = computed(() => new Set(this.fields().map((f) => f.expression)));
|
|
5417
|
+
/** The detail's first sort key; further keys (set in the file) are kept. */
|
|
5418
|
+
setSort(expression, descending) {
|
|
5419
|
+
const band = this.band();
|
|
5420
|
+
if (!band)
|
|
5421
|
+
return;
|
|
5422
|
+
this.state.updateBand(band.id, (b) => {
|
|
5423
|
+
const rest = b.sortBy?.slice(1) ?? [];
|
|
5424
|
+
const keys = expression ? [{ expression, descending: descending || undefined }, ...rest] : rest;
|
|
5425
|
+
b.sortBy = keys.length ? keys : undefined;
|
|
5426
|
+
});
|
|
5427
|
+
}
|
|
4283
5428
|
/** Detail columns; one column removes the setting. */
|
|
4284
5429
|
setColumns(key, value) {
|
|
4285
5430
|
const band = this.band();
|
|
@@ -4504,11 +5649,11 @@ class PropertyPanelComponent {
|
|
|
4504
5649
|
return positive(value, fallback);
|
|
4505
5650
|
}
|
|
4506
5651
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PropertyPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4507
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: PropertyPanelComponent, isStandalone: true, selector: "we-report-property-panel", inputs: { strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, fontFamilies: { classPropertyName: "fontFamilies", publicName: "fontFamilies", isSignal: true, isRequired: false, transformFunction: null }, advanced: { classPropertyName: "advanced", publicName: "advanced", isSignal: true, isRequired: false, transformFunction: null }, lists: { classPropertyName: "lists", publicName: "lists", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let s = strings();\n<h2 class=\"pp__title\">{{ s.properties }}</h2>\n\n@let selectedControl = control();\n@let selectedBand = band();\n@if (selectedControl) {\n <div class=\"pp__subtitle\">{{ s.controlNames[selectedControl.type] }} \u00B7 <code>{{ selectedControl.id }}</code></div>\n} @else if (controls().length > 1) {\n <div class=\"pp__subtitle\">{{ s.itemsSelected.replace('{0}', '' + controls().length) }}</div>\n} @else if (selectedBand) {\n <div class=\"pp__subtitle\">{{ s.bandNames[selectedBand.kind] }}</div>\n}\n\n<!-- \u2500\u2500 Report (nothing selected) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (!controls().length && !band()) {\n <section class=\"pp__section\">\n <h3>{{ s.groupPage }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.reportName }}</span>\n <input [value]=\"report().name\" (input)=\"setReport('name', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.paper }}</span>\n <select (change)=\"setPaper($any($event.target).value)\">\n @for (p of papers; track p.id) {\n <option [value]=\"p.id\" [selected]=\"p.id === report().page.paper\">{{ p.id }} ({{ p.width }} \u00D7 {{ p.height ?? '\u221E' }} mm)</option>\n }\n <option value=\"custom\" [selected]=\"report().page.paper === 'custom'\">{{ s.customSize }}</option>\n </select>\n </label>\n @if (report().page.paper === 'custom') {\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.width }} (mm)</span>\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.width)\" (input)=\"setPage('width', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.height }} (mm)</span>\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.height)\" (input)=\"setPage('height', $any($event.target).value)\" />\n </label>\n </div>\n }\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.orientation }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'portrait'\" (click)=\"setPage('orientation', 'portrait')\">{{ s.portrait }}</button>\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'landscape'\" (click)=\"setPage('orientation', 'landscape')\">{{ s.landscape }}</button>\n </div>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.margins }} (mm)</span>\n <div class=\"pp__grid pp__grid--4\">\n <label><small>{{ s.marginTop }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.top)\" (input)=\"setMargin('top', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginRight }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.right)\" (input)=\"setMargin('right', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginBottom }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.bottom)\" (input)=\"setMargin('bottom', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginLeft }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.left)\" (input)=\"setMargin('left', $any($event.target).value)\" /></label>\n </div>\n </div>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.reportLocale }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.reportLocaleRegion }}</span>\n <select (change)=\"setCulture('locale', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!report().locale\">{{ s.reportLocaleDefault }}</option>\n @for (l of cultures; track l.id) {\n <option [value]=\"l.id\" [selected]=\"report().locale === l.id\">{{ l.name }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.reportCurrency }}</span>\n <select (change)=\"setCulture('currency', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!report().currency\">{{ s.reportLocaleDefault }}</option>\n @for (c of currencies; track c) {\n <option [value]=\"c\" [selected]=\"report().currency === c\">{{ c }}</option>\n }\n </select>\n </label>\n <small class=\"pp__hint\">{{ s.reportLocaleHint }}</small>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.watermark }}</h3>\n @let wm = report().watermark;\n <we-report-bindable-input [value]=\"wm?.text ?? ''\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setWatermark({ text: $event })\" />\n <small class=\"pp__hint\">{{ s.watermarkHint }}</small>\n @if (wm) {\n <div class=\"pp__row\">\n <span>{{ s.color }}</span>\n <input type=\"color\" [value]=\"wm.color ?? '#e3e6ea'\" (input)=\"setWatermark({ color: $any($event.target).value })\" [attr.aria-label]=\"s.color\" />\n </div>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.watermarkAngle\">\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"(wm.angle ?? 45) === 45\" [class.pp__on]=\"(wm.angle ?? 45) === 45\" (click)=\"setWatermark({ angle: undefined })\">\u2197 45\u00B0</button>\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"wm.angle === 0\" [class.pp__on]=\"wm.angle === 0\" (click)=\"setWatermark({ angle: 0 })\">\u2192 0\u00B0</button>\n </div>\n }\n </section>\n @if (advanced() && report().dataMember) {\n <section class=\"pp__section\">\n <h3>{{ s.groupData }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.dataRows }}</span>\n <input [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" />\n <small class=\"pp__hint\">{{ s.dataRowsHint }}</small>\n </label>\n </section>\n }\n}\n\n<!-- \u2500\u2500 Band \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (band(); as b) {\n <section class=\"pp__section\">\n <h3>{{ s.groupLayout }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.bandHeight }} (mm)</span>\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(b.height)\" (input)=\"setBand('height', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row\">\n <span>{{ s.backgroundColor }}</span>\n <span class=\"pp__color\">\n <input type=\"color\" [value]=\"b.backgroundColor ?? '#ffffff'\" (input)=\"setBand('backgroundColor', $any($event.target).value)\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setBand('backgroundColor', '')\">{{ s.noColor }}</button>\n </span>\n </label>\n </section>\n @if (b.kind === 'subDetail') {\n <section class=\"pp__section\">\n <h3>{{ s.innerList }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.innerListOf }}</span>\n <select (change)=\"setBand('rowsPath', $any($event.target).value)\">\n @for (l of lists(); track l) {\n <option [value]=\"l\" [selected]=\"b.rowsPath === l\">{{ l }}</option>\n }\n @if (b.rowsPath && !lists().includes(b.rowsPath)) {\n <option [value]=\"b.rowsPath\" selected>{{ b.rowsPath }}</option>\n }\n </select>\n </label>\n <small class=\"pp__hint\">{{ s.innerListHint }}</small>\n </section>\n }\n @if (b.kind === 'detail') {\n <section class=\"pp__section\">\n <h3>{{ s.labelSheet }}</h3>\n <select (change)=\"applyLabelSheet($any($event.target).value); $any($event.target).value = ''\" [attr.aria-label]=\"s.labelSheet\">\n <option value=\"\" selected>{{ s.labelSheetChoose }}</option>\n @for (l of labelSheets; track l.id) {\n <option [value]=\"l.id\">{{ labelSheetName(l) }}</option>\n }\n </select>\n <small class=\"pp__hint\">{{ s.labelSheetHint }}</small>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnsCount }}</span>\n <input type=\"number\" min=\"1\" max=\"12\" step=\"1\" [value]=\"b.columns?.count ?? 1\" (input)=\"setColumns('count', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnGap }}</span>\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(b.columns?.gap ?? 0)\" (input)=\"setColumns('gap', $any($event.target).value)\" />\n </label>\n </div>\n <small class=\"pp__hint\">{{ s.columnsHint }}</small>\n </section>\n }\n @if (b.kind === 'groupHeader') {\n <section class=\"pp__section\">\n <h3>{{ s.groupBy }}</h3>\n @if (fields().length) {\n <select (change)=\"setBand('groupBy', $any($event.target).value)\">\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === b.groupBy?.expression\">{{ f.label }}</option>\n }\n </select>\n }\n <input class=\"pp__mono\" [value]=\"b.groupBy?.expression ?? ''\" (input)=\"setBand('groupBy', $any($event.target).value)\" spellcheck=\"false\" />\n <label class=\"pp__row\">\n <span>{{ s.sortGroups }}</span>\n <select (change)=\"setBand('sort', $any($event.target).value)\">\n <option value=\"asc\" [selected]=\"!b.sort || b.sort === 'asc'\">{{ s.sortAsc }}</option>\n <option value=\"desc\" [selected]=\"b.sort === 'desc'\">{{ s.sortDesc }}</option>\n <option value=\"none\" [selected]=\"b.sort === 'none'\">{{ s.sortNone }}</option>\n </select>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.keepTogether\" (change)=\"toggleBand('keepTogether', $any($event.target).checked)\" />\n <span>{{ s.keepTogether }}<small class=\"pp__hint\">{{ s.keepTogetherHint }}</small></span>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.repeatOnEveryPage\" (change)=\"toggleBand('repeatOnEveryPage', $any($event.target).checked)\" />\n <span>{{ s.repeatOnEveryPage }}</span>\n </label>\n </section>\n }\n @if (advanced() && b.kind !== 'pageHeader' && b.kind !== 'pageFooter') {\n <section class=\"pp__section\">\n <h3>{{ s.groupBehaviour }}</h3>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakBefore\" (change)=\"toggleBand('pageBreakBefore', $any($event.target).checked)\" />\n <span>{{ s.pageBreakBefore }}</span>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakAfter\" (change)=\"toggleBand('pageBreakAfter', $any($event.target).checked)\" />\n <span>{{ s.pageBreakAfter }}</span>\n </label>\n </section>\n }\n @if (b.kind !== 'detail') {\n <button type=\"button\" class=\"pp__danger\" (click)=\"removeBand()\">{{ s.removeBand }}</button>\n }\n}\n\n<!-- \u2500\u2500 Control(s) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (controls().length) {\n @let n = controls().length;\n <section class=\"pp__section\">\n <h3>{{ s.arrange }}</h3>\n <div class=\"pp__tools\" role=\"toolbar\" [attr.aria-label]=\"s.arrange\">\n @for (a of alignActions; track a.edge) {\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.align(a.edge)\" [title]=\"s[a.label]\" [attr.aria-label]=\"s[a.label]\" [innerHTML]=\"a.icon | weReportIcon\"></button>\n }\n </div>\n <div class=\"pp__tools\" role=\"toolbar\" [attr.aria-label]=\"s.arrange\">\n <button type=\"button\" [disabled]=\"n < 3\" (click)=\"state.distribute('h')\" [title]=\"s.distributeH\" [attr.aria-label]=\"s.distributeH\" [innerHTML]=\"'distributeH' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 3\" (click)=\"state.distribute('v')\" [title]=\"s.distributeV\" [attr.aria-label]=\"s.distributeV\" [innerHTML]=\"'distributeV' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.sameSize('width')\" [title]=\"s.sameWidth\" [attr.aria-label]=\"s.sameWidth\" [innerHTML]=\"'sameWidth' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.sameSize('height')\" [title]=\"s.sameHeight\" [attr.aria-label]=\"s.sameHeight\" [innerHTML]=\"'sameHeight' | weReportIcon\"></button>\n <button type=\"button\" (click)=\"state.arrange('front')\" [title]=\"s.bringToFront\" [attr.aria-label]=\"s.bringToFront\" [innerHTML]=\"'bringToFront' | weReportIcon\"></button>\n <button type=\"button\" (click)=\"state.arrange('back')\" [title]=\"s.sendToBack\" [attr.aria-label]=\"s.sendToBack\" [innerHTML]=\"'sendToBack' | weReportIcon\"></button>\n </div>\n @if (n < 2) {\n <small class=\"pp__hint\">{{ s.arrangeHint }}</small>\n }\n </section>\n @if (control(); as c) {\n <!-- Content first: it is what people change most. -->\n @switch (c.type) {\n @case ('text') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" [multiline]=\"true\" (valueChange)=\"setBindable('text', $event)\" />\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"set('format', $any($event.target).value)\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ $any(s)[f.key] }}</option>\n }\n @if (formatIsCustom()) {\n <option [value]=\"c.format\" selected>{{ c.format }}</option>\n }\n </select>\n </label>\n @if (advanced()) {\n <input class=\"pp__mono\" [value]=\"c.format ?? ''\" (input)=\"set('format', $any($event.target).value)\" spellcheck=\"false\" placeholder=\"n2 \u00B7 c2 \u00B7 dd.MM.yyyy\" />\n }\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\n </label>\n </section>\n }\n @case ('barcode') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.symbology }}</span>\n <select (change)=\"set('symbology', $any($event.target).value)\">\n @for (sym of symbologies; track sym) {\n <option [value]=\"sym\" [selected]=\"sym === c.symbology\">{{ sym }}</option>\n }\n @if (!symbologies.includes(c.symbology)) {\n <option [value]=\"c.symbology\" selected>{{ c.symbology }}</option>\n }\n </select>\n </label>\n <span class=\"pp__label\">{{ s.barcodeValue }}</span>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('value', $event)\" />\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"c.showText\" (change)=\"set('showText', $any($event.target).checked)\" />\n <span>{{ s.showText }}</span>\n </label>\n </section>\n }\n @case ('image') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__file\">\n <input type=\"file\" accept=\"image/png,image/jpeg\" (change)=\"chooseImage($event)\" />\n <span>{{ s.chooseImage }}</span>\n </label>\n <span class=\"pp__label\">{{ s.fromData }}</span>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('source', $event)\" />\n <label class=\"pp__row\">\n <span>{{ s.fit }}</span>\n <select (change)=\"set('fit', $any($event.target).value)\">\n <option value=\"contain\" [selected]=\"c.fit === 'contain'\">{{ s.fitContain }}</option>\n <option value=\"cover\" [selected]=\"c.fit === 'cover'\">{{ s.fitCover }}</option>\n <option value=\"stretch\" [selected]=\"c.fit === 'stretch'\">{{ s.fitStretch }}</option>\n <option value=\"none\" [selected]=\"c.fit === 'none'\">{{ s.fitNone }}</option>\n </select>\n </label>\n </section>\n }\n @case ('line') {\n <section class=\"pp__section\">\n <h3>{{ s.groupAppearance }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.lineDirection }}</span>\n <select (change)=\"set('direction', $any($event.target).value)\">\n <option value=\"horizontal\" [selected]=\"c.direction === 'horizontal'\">{{ s.horizontal }}</option>\n <option value=\"vertical\" [selected]=\"c.direction === 'vertical'\">{{ s.vertical }}</option>\n <option value=\"diagonalDown\" [selected]=\"c.direction === 'diagonalDown'\">{{ s.diagonalDown }}</option>\n <option value=\"diagonalUp\" [selected]=\"c.direction === 'diagonalUp'\">{{ s.diagonalUp }}</option>\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.lineWidth }} (mm)</span>\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(c.lineWidth)\" (input)=\"set('lineWidth', asNumber($any($event.target).value, 0.05))\" />\n </label>\n <label class=\"pp__row\">\n <span>{{ s.color }}</span>\n <input type=\"color\" [value]=\"c.color ?? style()?.color ?? '#000000'\" (input)=\"set('color', $any($event.target).value)\" />\n </label>\n </section>\n }\n @case ('shape') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.shape }}</span>\n <select (change)=\"set('shape', $any($event.target).value)\">\n <option value=\"rectangle\" [selected]=\"c.shape === 'rectangle'\">{{ s.rectangle }}</option>\n <option value=\"roundedRectangle\" [selected]=\"c.shape === 'roundedRectangle'\">{{ s.roundedRectangle }}</option>\n <option value=\"ellipse\" [selected]=\"c.shape === 'ellipse'\">{{ s.ellipse }}</option>\n </select>\n </label>\n @if (c.shape === 'roundedRectangle') {\n <label class=\"pp__row\">\n <span>{{ s.cornerRadius }} (mm)</span>\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.cornerRadius ?? 2)\" (input)=\"set('cornerRadius', asNumber($any($event.target).value, 0))\" />\n </label>\n }\n </section>\n }\n @case ('pageInfo') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.pageInfo }}</span>\n <select (change)=\"set('info', $any($event.target).value)\">\n <option value=\"pageNumber\" [selected]=\"c.info === 'pageNumber'\">{{ s.pageNumber }}</option>\n <option value=\"pageCount\" [selected]=\"c.info === 'pageCount'\">{{ s.pageTotal }}</option>\n <option value=\"pageNofM\" [selected]=\"c.info === 'pageNofM'\">{{ s.pageNofM }}</option>\n <option value=\"printDate\" [selected]=\"c.info === 'printDate'\">{{ s.printDate }}</option>\n </select>\n </label>\n @if (c.info === 'pageNofM' || c.info === 'printDate') {\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.format }}</span>\n <input class=\"pp__mono\" [value]=\"c.format ?? ''\" (input)=\"set('format', $any($event.target).value)\" [placeholder]=\"c.info === 'pageNofM' ? '{0} / {1}' : 'dd.MM.yyyy'\" spellcheck=\"false\" />\n </label>\n }\n </section>\n }\n @case ('table') {\n @let cellInfo = selectedCell();\n <section class=\"pp__section\">\n <h3>{{ s.tableSection }}</h3>\n <small class=\"pp__hint\">{{ s.tableHint }}</small>\n <div class=\"pp__buttons\">\n <button type=\"button\" (click)=\"tableOp('insertRow')\">+ {{ s.addRow }}</button>\n <button type=\"button\" (click)=\"tableOp('insertColumn')\">+ {{ s.addColumn }}</button>\n <button type=\"button\" [disabled]=\"c.rows.length < 2\" (click)=\"tableOp('deleteRow')\">\u2212 {{ s.deleteRow }}</button>\n <button type=\"button\" [disabled]=\"c.columns.length < 2\" (click)=\"tableOp('deleteColumn')\">\u2212 {{ s.deleteColumn }}</button>\n <button type=\"button\" [disabled]=\"!cellInfo || cellInfo.index >= c.rows[cellInfo.row].cells.length - 1\" (click)=\"tableOp('mergeRight')\">{{ s.mergeCells }}</button>\n <button type=\"button\" [disabled]=\"!cellInfo || (cellInfo.cell.colSpan ?? 1) < 2\" (click)=\"tableOp('splitCell')\">{{ s.splitCell }}</button>\n </div>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\n </label>\n </section>\n @if (cellInfo) {\n <section class=\"pp__section\">\n <h3>{{ s.selectedCell }}</h3>\n <we-report-bindable-input [value]=\"cellInfo.cell.text\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setCell({ text: $event })\" />\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"setCell({ format: $any($event.target).value || undefined })\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(cellInfo.cell.format ?? '') === f.value\">{{ s[f.key] }}</option>\n }\n </select>\n </label>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.alignment\">\n @for (a of ['left', 'center', 'right']; track a) {\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"cellAlign(cellInfo.cell) === a\" [class.pp__on]=\"cellAlign(cellInfo.cell) === a\" (click)=\"setCellStyle('textAlign', $any(a))\">\n {{ a === 'left' ? s.alignLeft : a === 'center' ? s.alignCenter : s.alignRight }}\n </button>\n }\n </div>\n <div class=\"pp__rule-then\">\n <button type=\"button\" class=\"pp__chip\" [class.pp__on]=\"cellInfo.cell.styleOverrides?.bold\" (click)=\"setCellStyle('bold', cellInfo.cell.styleOverrides?.bold ? undefined : true)\">{{ s.bold }}</button>\n <span>{{ s.backgroundColor }}</span>\n <input type=\"color\" [value]=\"cellInfo.cell.styleOverrides?.backgroundColor ?? '#ffffff'\" (input)=\"setCellStyle('backgroundColor', $any($event.target).value)\" [attr.aria-label]=\"s.backgroundColor\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setCellStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\n </div>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnWidth }}</span>\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(c.columns[cellInfo.column])\" (input)=\"setColumnWidth(cellInfo.column, $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.rowHeight }}</span>\n <input type=\"number\" min=\"2\" step=\"0.5\" [value]=\"num(c.rows[cellInfo.row].height)\" (input)=\"setRowHeight(cellInfo.row, $any($event.target).value)\" />\n </label>\n </div>\n </section>\n }\n }\n @case ('chart') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <small class=\"pp__hint\">{{ s.chartHint }}</small>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.chartType\">\n @for (t of chartTypes; track t.type) {\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"c.chartType === t.type\" [class.pp__on]=\"c.chartType === t.type\" (click)=\"set('chartType', t.type)\">{{ s[t.label] }}</button>\n }\n </div>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartCategory }}</span>\n <select (change)=\"setExpression('category', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!c.category.expression\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === c.category.expression\">{{ f.label }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartValue }}</span>\n <select (change)=\"setExpression('value', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!c.value.expression\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === c.value.expression\">{{ f.label }}</option>\n }\n </select>\n </label>\n @if (advanced()) {\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.expression }}</span>\n <input class=\"pp__mono\" [value]=\"c.category.expression\" (input)=\"setExpression('category', $any($event.target).value)\" spellcheck=\"false\" />\n <input class=\"pp__mono\" [value]=\"c.value.expression\" (input)=\"setExpression('value', $any($event.target).value)\" spellcheck=\"false\" />\n </label>\n }\n <label class=\"pp__row\">\n <span>{{ s.chartAggregate }}</span>\n <select (change)=\"set('aggregate', $any($event.target).value)\">\n @for (a of aggregates; track a.value) {\n <option [value]=\"a.value\" [selected]=\"(c.aggregate ?? 'sum') === a.value\">{{ s[a.label] }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"set('format', $any($event.target).value)\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ s[f.key] }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartTitle }}</span>\n <input [value]=\"c.title ?? ''\" (input)=\"set('title', $any($event.target).value)\" />\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.showValues\" (change)=\"set('showValues', $any($event.target).checked || undefined)\" />\n <span>{{ s.showValues }}</span>\n </label>\n @if (c.chartType === 'pie' || c.chartType === 'doughnut') {\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"c.showLegend !== false\" (change)=\"set('showLegend', $any($event.target).checked ? undefined : false)\" />\n <span>{{ s.showLegend }}</span>\n </label>\n }\n </section>\n }\n @case ('checkbox') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <span class=\"pp__label\">{{ s.checked }}</span>\n <we-report-bindable-input [value]=\"checkedValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('checked', $event)\" />\n </section>\n }\n }\n\n <section class=\"pp__section\">\n <h3>{{ s.conditionalFormatting }}</h3>\n @for (rule of c.formatting ?? []; track $index; let i = $index) {\n @let cond = condition(rule.when);\n <div class=\"pp__rule\">\n <div class=\"pp__rule-head\">\n <span>{{ s.ruleWhen }}</span>\n <button type=\"button\" class=\"pp__link\" (click)=\"removeRule(i)\" [title]=\"s.removeRule\" [attr.aria-label]=\"s.removeRule\">\u2715</button>\n </div>\n @if (cond) {\n <div class=\"pp__rule-when\">\n <select (change)=\"setCondition(i, cond, 'field', $any($event.target).value)\" [attr.aria-label]=\"s.ruleWhen\">\n <option value=\"\" [selected]=\"!cond.field\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === cond.field\">{{ f.label }}</option>\n }\n </select>\n <select (change)=\"setCondition(i, cond, 'op', $any($event.target).value)\">\n @for (o of conditionOps; track o.op) {\n <option [value]=\"o.op\" [selected]=\"o.op === cond.op\">{{ o.op === 'contains' ? s.opContains : o.label }}</option>\n }\n </select>\n <input [value]=\"cond.value\" (input)=\"setCondition(i, cond, 'value', $any($event.target).value)\" [placeholder]=\"s.ruleValue\" [attr.aria-label]=\"s.ruleValue\" />\n </div>\n }\n @if (advanced() || !cond) {\n <input class=\"pp__mono\" [value]=\"rule.when\" (input)=\"setRule(i, { when: $any($event.target).value })\" spellcheck=\"false\" />\n }\n <div class=\"pp__rule-then\">\n <span>{{ s.ruleThen }}</span>\n <input type=\"color\" [value]=\"rule.style.color ?? '#000000'\" (input)=\"setRuleStyle(i, 'color', $any($event.target).value)\" [title]=\"s.textColor\" [attr.aria-label]=\"s.textColor\" />\n <input type=\"color\" [value]=\"rule.style.backgroundColor ?? '#ffffff'\" (input)=\"setRuleStyle(i, 'backgroundColor', $any($event.target).value)\" [title]=\"s.backgroundColor\" [attr.aria-label]=\"s.backgroundColor\" />\n <button type=\"button\" class=\"pp__chip\" [class.pp__on]=\"rule.style.bold\" (click)=\"setRuleStyle(i, 'bold', rule.style.bold ? undefined : true)\">{{ s.bold }}</button>\n </div>\n </div>\n } @empty {\n <small class=\"pp__hint\">{{ s.conditionalHint }}</small>\n }\n <button type=\"button\" class=\"pp__link\" (click)=\"addRule()\">+ {{ s.addRule }}</button>\n </section>\n\n <section class=\"pp__section\">\n <h3>{{ s.groupLayout }}</h3>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\"><span>{{ s.left }}</span><input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.x)\" (input)=\"setGeometry('x', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.top }}</span><input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.y)\" (input)=\"setGeometry('y', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.width }}</span><input type=\"number\" min=\"0.5\" step=\"0.5\" [value]=\"num(c.width)\" (input)=\"setGeometry('width', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.height }}</span><input type=\"number\" min=\"0.5\" step=\"0.5\" [value]=\"num(c.height)\" (input)=\"setGeometry('height', $any($event.target).value)\" /></label>\n </div>\n </section>\n }\n\n <!-- Appearance applies to every selected control at once. -->\n @if (style(); as st) {\n @if (hasText()) {\n <section class=\"pp__section\">\n <h3>{{ s.groupAppearance }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.font }}</span>\n <select (change)=\"setStyle('fontFamily', $any($event.target).value)\">\n @for (f of fontFamilies(); track f) {\n <option [value]=\"f\" [selected]=\"f === st.fontFamily\">{{ f }}</option>\n }\n @if (!fontFamilies().includes(st.fontFamily)) {\n <option [value]=\"st.fontFamily\" selected>{{ st.fontFamily }}</option>\n }\n </select>\n </label>\n <div class=\"pp__row\">\n <span>{{ s.fontSize }} (pt)</span>\n <input type=\"number\" min=\"4\" max=\"200\" step=\"0.5\" [value]=\"num(st.fontSize)\" (input)=\"setStyle('fontSize', asNumber($any($event.target).value, 4))\" />\n </div>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.bold\" (click)=\"setStyle('bold', !st.bold)\" [attr.aria-pressed]=\"st.bold\"><b>{{ s.bold }}</b></button>\n <button type=\"button\" [class.pp__on]=\"st.italic\" (click)=\"setStyle('italic', !st.italic)\" [attr.aria-pressed]=\"st.italic\"><i>{{ s.italic }}</i></button>\n <button type=\"button\" [class.pp__on]=\"st.underline\" (click)=\"setStyle('underline', !st.underline)\" [attr.aria-pressed]=\"st.underline\"><u>{{ s.underline }}</u></button>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.alignment }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'left'\" (click)=\"setStyle('textAlign', 'left')\">{{ s.alignLeft }}</button>\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'center'\" (click)=\"setStyle('textAlign', 'center')\">{{ s.alignCenter }}</button>\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'right'\" (click)=\"setStyle('textAlign', 'right')\">{{ s.alignRight }}</button>\n </div>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.verticalAlignment }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'top'\" (click)=\"setStyle('verticalAlign', 'top')\">{{ s.alignTop }}</button>\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'middle'\" (click)=\"setStyle('verticalAlign', 'middle')\">{{ s.alignMiddle }}</button>\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'bottom'\" (click)=\"setStyle('verticalAlign', 'bottom')\">{{ s.alignBottom }}</button>\n </div>\n </div>\n <label class=\"pp__row\">\n <span>{{ s.textColor }}</span>\n <input type=\"color\" [value]=\"st.color\" (input)=\"setStyle('color', $any($event.target).value)\" />\n </label>\n </section>\n }\n @if (control()?.type !== 'line') {\n <section class=\"pp__section\">\n @if (!hasText()) {\n <h3>{{ s.groupAppearance }}</h3>\n }\n <label class=\"pp__row\">\n <span>{{ s.backgroundColor }}</span>\n <span class=\"pp__color\">\n <input type=\"color\" [value]=\"st.backgroundColor ?? '#ffffff'\" (input)=\"setStyle('backgroundColor', $any($event.target).value)\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\n </span>\n </label>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.border }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.top\" (click)=\"toggleBorderSide('top', !st.border?.sides?.top)\">{{ s.marginTop }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.right\" (click)=\"toggleBorderSide('right', !st.border?.sides?.right)\">{{ s.marginRight }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.bottom\" (click)=\"toggleBorderSide('bottom', !st.border?.sides?.bottom)\">{{ s.marginBottom }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.left\" (click)=\"toggleBorderSide('left', !st.border?.sides?.left)\">{{ s.marginLeft }}</button>\n </div>\n </div>\n @if (st.border) {\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.borderWidth }}</span>\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(st.border.width)\" (input)=\"setBorder({ width: asNumber($any($event.target).value, 0.05) })\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.borderColor }}</span>\n <input type=\"color\" [value]=\"st.border.color\" (input)=\"setBorder({ color: $any($event.target).value })\" />\n </label>\n </div>\n }\n @if (advanced() && hasText()) {\n <label class=\"pp__row\">\n <span>{{ s.padding }} (mm)</span>\n <input type=\"number\" min=\"0\" step=\"0.1\" [value]=\"num(st.padding)\" (input)=\"setStyle('padding', asNumber($any($event.target).value, 0))\" />\n </label>\n }\n </section>\n }\n }\n\n @if (advanced() && control(); as c) {\n <section class=\"pp__section\">\n <h3>{{ s.groupBehaviour }}</h3>\n <span class=\"pp__label\">{{ s.visibleWhen }}</span>\n <input class=\"pp__mono\" [value]=\"$any(visibleValue(c)).expression ?? ''\" (input)=\"setVisible({ expression: $any($event.target).value })\" spellcheck=\"false\" placeholder=\"[Total] > 0\" />\n <small class=\"pp__hint\">{{ s.visibleWhenHint }}</small>\n </section>\n }\n}\n", styles: [":host{display:block;padding:14px 14px 32px;font-size:12.5px;color:var(--we-report-fg, #1d1d1f)}.pp__title{margin:0;font-size:15px;font-weight:600;letter-spacing:-.01em}.pp__subtitle{margin-top:2px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__subtitle code{font-size:11px}.pp__section{display:flex;flex-direction:column;gap:10px;padding:14px 0;border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.pp__section:last-of-type{border-bottom:0}.pp__section h3{margin:0;font-size:12px;font-weight:600;color:var(--we-report-fg, #1d1d1f)}.pp__row{display:flex;align-items:center;justify-content:space-between;gap:10px}.pp__row>span:first-child{flex:1;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__row input[type=number]{width:76px;text-align:right;font-variant-numeric:tabular-nums}.pp__row select{width:auto;max-width:60%}.pp__row--stack{flex-direction:column;align-items:stretch;gap:4px}.pp__row--stack>span:first-child{font-size:11.5px}.pp__row--stack input[type=number]{width:100%;text-align:left}.pp__row--stack select{max-width:none;width:100%}.pp__grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.pp__grid--4{grid-template-columns:repeat(4,1fr)}.pp__grid--4 label{display:flex;flex-direction:column;gap:3px;text-align:center}.pp__grid--4 label small{font-size:10.5px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__grid--4 label input{text-align:center!important}input:not([type=checkbox]):not([type=color]):not([type=file]),select,textarea{width:100%;box-sizing:border-box;font:inherit;padding:5px 8px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;transition:box-shadow .15s ease}input:not([type=checkbox]):not([type=color]):not([type=file]):focus,select:focus,textarea:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}input[type=checkbox]{accent-color:var(--we-report-accent, #007aff);width:14px;height:14px}input[type=color]{width:26px;height:26px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer;box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14))}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:0;border-radius:50%}input[type=color]::-moz-color-swatch{border:0;border-radius:50%}.pp__mono{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace!important;font-size:12px!important}.pp__label{font-weight:500}.pp__hint{display:block;margin-top:2px;font-size:11px;line-height:1.35;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__check{display:flex;align-items:flex-start;gap:8px;cursor:pointer}.pp__check input{margin-top:2px}.pp__segmented{display:flex;padding:2px;gap:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.pp__segmented button{flex:1;border:0;border-radius:6px;padding:4px;font:inherit;font-size:12px;background:transparent;color:inherit;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease}.pp__segmented button.pp__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.pp__segmented button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.pp__tools{display:flex;gap:2px;padding:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.pp__tools button{flex:1;display:inline-flex;align-items:center;justify-content:center;height:26px;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer}.pp__tools button :is(svg){width:16px;height:16px}.pp__tools button:hover:not(:disabled){background:var(--we-report-segment-on-bg, #fff);box-shadow:0 1px 2px #0000001a}.pp__tools button:disabled{opacity:.3;cursor:default}.pp__tools button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.pp__buttons{display:grid;grid-template-columns:1fr 1fr;gap:4px}.pp__buttons button{border:0;border-radius:var(--we-report-control-radius, 7px);padding:5px 6px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12));color:inherit;font:inherit;font-size:12px;cursor:pointer}.pp__buttons button:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .2))}.pp__buttons button:disabled{opacity:.4;cursor:default}.pp__rule{display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:10px;background:var(--we-report-workspace-bg, #f2f2f7)}.pp__rule-head,.pp__rule-then{display:flex;align-items:center;gap:8px}.pp__rule-head>span,.pp__rule-then>span{flex:1;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__rule-when{display:grid;grid-template-columns:1fr 54px 1fr;gap:4px}.pp__chip{border:0;border-radius:999px;padding:3px 10px;font:inherit;font-size:11.5px;font-weight:700;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12));color:inherit;cursor:pointer}.pp__chip.pp__on{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.pp__color{display:inline-flex;align-items:center;gap:8px}.pp__link{border:0;background:none;padding:0;font:inherit;color:var(--we-report-accent, #007aff);cursor:pointer}.pp__file{position:relative;display:block;padding:10px;border-radius:10px;border:1px dashed var(--we-report-accent, #007aff);background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff);font-weight:500;text-align:center;cursor:pointer}.pp__file input{position:absolute;inset:0;opacity:0;cursor:pointer}.pp__danger{margin-top:14px;width:100%;padding:7px;border:0;border-radius:8px;background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000);font:inherit;font-weight:500;cursor:pointer}@media (prefers-reduced-motion: reduce){input,select,textarea,.pp__segmented button{transition:none}}\n"], dependencies: [{ kind: "component", type: BindableInputComponent, selector: "we-report-bindable-input", inputs: ["value", "fields", "strings", "multiline"], outputs: ["valueChange"] }, { kind: "pipe", type: WeReportIconPipe, name: "weReportIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5652
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: PropertyPanelComponent, isStandalone: true, selector: "we-report-property-panel", inputs: { strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, fontFamilies: { classPropertyName: "fontFamilies", publicName: "fontFamilies", isSignal: true, isRequired: false, transformFunction: null }, advanced: { classPropertyName: "advanced", publicName: "advanced", isSignal: true, isRequired: false, transformFunction: null }, lists: { classPropertyName: "lists", publicName: "lists", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let s = strings();\n<h2 class=\"pp__title\">{{ s.properties }}</h2>\n\n@let selectedControl = control();\n@let selectedBand = band();\n@if (selectedControl) {\n <div class=\"pp__subtitle\">{{ s.controlNames[selectedControl.type] }} \u00B7 <code>{{ selectedControl.id }}</code></div>\n} @else if (controls().length > 1) {\n <div class=\"pp__subtitle\">{{ s.itemsSelected.replace('{0}', '' + controls().length) }}</div>\n} @else if (selectedBand) {\n <div class=\"pp__subtitle\">{{ s.bandNames[selectedBand.kind] }}</div>\n}\n\n<!-- \u2500\u2500 Report (nothing selected) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (!controls().length && !band()) {\n <section class=\"pp__section\">\n <h3>{{ s.groupPage }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.reportName }}</span>\n <input [value]=\"report().name\" (input)=\"setReport('name', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.paper }}</span>\n <select (change)=\"setPaper($any($event.target).value)\">\n @for (p of papers; track p.id) {\n <option [value]=\"p.id\" [selected]=\"p.id === report().page.paper\">{{ p.id }} ({{ p.width }} \u00D7 {{ p.height ?? '\u221E' }} mm)</option>\n }\n <option value=\"custom\" [selected]=\"report().page.paper === 'custom'\">{{ s.customSize }}</option>\n </select>\n </label>\n @if (report().page.paper === 'custom') {\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.width }} (mm)</span>\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.width)\" (input)=\"setPage('width', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.height }} (mm)</span>\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.height)\" (input)=\"setPage('height', $any($event.target).value)\" />\n </label>\n </div>\n }\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.orientation }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'portrait'\" (click)=\"setPage('orientation', 'portrait')\">{{ s.portrait }}</button>\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'landscape'\" (click)=\"setPage('orientation', 'landscape')\">{{ s.landscape }}</button>\n </div>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.margins }} (mm)</span>\n <div class=\"pp__grid pp__grid--4\">\n <label><small>{{ s.marginTop }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.top)\" (input)=\"setMargin('top', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginRight }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.right)\" (input)=\"setMargin('right', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginBottom }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.bottom)\" (input)=\"setMargin('bottom', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginLeft }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.left)\" (input)=\"setMargin('left', $any($event.target).value)\" /></label>\n </div>\n </div>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.reportLocale }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.reportLocaleRegion }}</span>\n <select (change)=\"setCulture('locale', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!report().locale\">{{ s.reportLocaleDefault }}</option>\n @for (l of cultures; track l.id) {\n <option [value]=\"l.id\" [selected]=\"report().locale === l.id\">{{ l.name }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.reportCurrency }}</span>\n <select (change)=\"setCulture('currency', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!report().currency\">{{ s.reportLocaleDefault }}</option>\n @for (c of currencies; track c) {\n <option [value]=\"c\" [selected]=\"report().currency === c\">{{ c }}</option>\n }\n </select>\n </label>\n <small class=\"pp__hint\">{{ s.reportLocaleHint }}</small>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.watermark }}</h3>\n @let wm = report().watermark;\n <we-report-bindable-input [value]=\"wm?.text ?? ''\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setWatermark({ text: $event })\" />\n <small class=\"pp__hint\">{{ s.watermarkHint }}</small>\n @if (wm) {\n <div class=\"pp__row\">\n <span>{{ s.color }}</span>\n <input type=\"color\" [value]=\"wm.color ?? '#e3e6ea'\" (input)=\"setWatermark({ color: $any($event.target).value })\" [attr.aria-label]=\"s.color\" />\n </div>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.watermarkAngle\">\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"(wm.angle ?? 45) === 45\" [class.pp__on]=\"(wm.angle ?? 45) === 45\" (click)=\"setWatermark({ angle: undefined })\">\u2197 45\u00B0</button>\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"wm.angle === 0\" [class.pp__on]=\"wm.angle === 0\" (click)=\"setWatermark({ angle: 0 })\">\u2192 0\u00B0</button>\n </div>\n }\n </section>\n @if (advanced() && report().dataMember) {\n <section class=\"pp__section\">\n <h3>{{ s.groupData }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.dataRows }}</span>\n <input [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" />\n <small class=\"pp__hint\">{{ s.dataRowsHint }}</small>\n </label>\n </section>\n }\n}\n\n<!-- \u2500\u2500 Band \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (band(); as b) {\n <section class=\"pp__section\">\n <h3>{{ s.groupLayout }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.bandHeight }} (mm)</span>\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(b.height)\" (input)=\"setBand('height', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row\">\n <span>{{ s.backgroundColor }}</span>\n <span class=\"pp__color\">\n <input type=\"color\" [value]=\"b.backgroundColor ?? '#ffffff'\" (input)=\"setBand('backgroundColor', $any($event.target).value)\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setBand('backgroundColor', '')\">{{ s.noColor }}</button>\n </span>\n </label>\n </section>\n @if (b.kind === 'subDetail') {\n <section class=\"pp__section\">\n <h3>{{ s.innerList }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.innerListOf }}</span>\n <select (change)=\"setBand('rowsPath', $any($event.target).value)\">\n @for (l of lists(); track l) {\n <option [value]=\"l\" [selected]=\"b.rowsPath === l\">{{ l }}</option>\n }\n @if (b.rowsPath && !lists().includes(b.rowsPath)) {\n <option [value]=\"b.rowsPath\" selected>{{ b.rowsPath }}</option>\n }\n </select>\n </label>\n <small class=\"pp__hint\">{{ s.innerListHint }}</small>\n </section>\n }\n @if (b.kind === 'detail') {\n <section class=\"pp__section\">\n <h3>{{ s.sortRows }}</h3>\n @let key = b.sortBy?.[0];\n <div class=\"pp__grid\">\n <select (change)=\"setSort($any($event.target).value, !!key?.descending)\" [attr.aria-label]=\"s.sortRows\">\n <option value=\"\" [selected]=\"!key\">{{ s.dataOrder }}</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === key?.expression\">{{ f.label }}</option>\n }\n @if (key && !fieldExpressions().has(key.expression)) {\n <option [value]=\"key.expression\" selected>{{ key.expression }}</option>\n }\n </select>\n <select [disabled]=\"!key\" (change)=\"setSort(key?.expression ?? '', $any($event.target).value === 'desc')\" [attr.aria-label]=\"s.sortRows\">\n <option value=\"asc\" [selected]=\"!key?.descending\">{{ s.sortAsc }}</option>\n <option value=\"desc\" [selected]=\"!!key?.descending\">{{ s.sortDesc }}</option>\n </select>\n </div>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.labelSheet }}</h3>\n <select (change)=\"applyLabelSheet($any($event.target).value); $any($event.target).value = ''\" [attr.aria-label]=\"s.labelSheet\">\n <option value=\"\" selected>{{ s.labelSheetChoose }}</option>\n @for (l of labelSheets; track l.id) {\n <option [value]=\"l.id\">{{ labelSheetName(l) }}</option>\n }\n </select>\n <small class=\"pp__hint\">{{ s.labelSheetHint }}</small>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnsCount }}</span>\n <input type=\"number\" min=\"1\" max=\"12\" step=\"1\" [value]=\"b.columns?.count ?? 1\" (input)=\"setColumns('count', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnGap }}</span>\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(b.columns?.gap ?? 0)\" (input)=\"setColumns('gap', $any($event.target).value)\" />\n </label>\n </div>\n <small class=\"pp__hint\">{{ s.columnsHint }}</small>\n </section>\n }\n @if (b.kind === 'groupHeader') {\n <section class=\"pp__section\">\n <h3>{{ s.groupBy }}</h3>\n @if (fields().length) {\n <select (change)=\"setBand('groupBy', $any($event.target).value)\">\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === b.groupBy?.expression\">{{ f.label }}</option>\n }\n </select>\n }\n <input class=\"pp__mono\" [value]=\"b.groupBy?.expression ?? ''\" (input)=\"setBand('groupBy', $any($event.target).value)\" spellcheck=\"false\" />\n <label class=\"pp__row\">\n <span>{{ s.sortGroups }}</span>\n <select (change)=\"setBand('sort', $any($event.target).value)\">\n <option value=\"asc\" [selected]=\"!b.sort || b.sort === 'asc'\">{{ s.sortAsc }}</option>\n <option value=\"desc\" [selected]=\"b.sort === 'desc'\">{{ s.sortDesc }}</option>\n <option value=\"none\" [selected]=\"b.sort === 'none'\">{{ s.sortNone }}</option>\n </select>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.keepTogether\" (change)=\"toggleBand('keepTogether', $any($event.target).checked)\" />\n <span>{{ s.keepTogether }}<small class=\"pp__hint\">{{ s.keepTogetherHint }}</small></span>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.repeatOnEveryPage\" (change)=\"toggleBand('repeatOnEveryPage', $any($event.target).checked)\" />\n <span>{{ s.repeatOnEveryPage }}</span>\n </label>\n </section>\n }\n @if (advanced() && b.kind !== 'pageHeader' && b.kind !== 'pageFooter') {\n <section class=\"pp__section\">\n <h3>{{ s.groupBehaviour }}</h3>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakBefore\" (change)=\"toggleBand('pageBreakBefore', $any($event.target).checked)\" />\n <span>{{ s.pageBreakBefore }}</span>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakAfter\" (change)=\"toggleBand('pageBreakAfter', $any($event.target).checked)\" />\n <span>{{ s.pageBreakAfter }}</span>\n </label>\n </section>\n }\n @if (b.kind !== 'detail') {\n <button type=\"button\" class=\"pp__danger\" (click)=\"removeBand()\">{{ s.removeBand }}</button>\n }\n}\n\n<!-- \u2500\u2500 Control(s) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (controls().length) {\n @let n = controls().length;\n <section class=\"pp__section\">\n <h3>{{ s.arrange }}</h3>\n <div class=\"pp__tools\" role=\"toolbar\" [attr.aria-label]=\"s.arrange\">\n @for (a of alignActions; track a.edge) {\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.align(a.edge)\" [title]=\"s[a.label]\" [attr.aria-label]=\"s[a.label]\" [innerHTML]=\"a.icon | weReportIcon\"></button>\n }\n </div>\n <div class=\"pp__tools\" role=\"toolbar\" [attr.aria-label]=\"s.arrange\">\n <button type=\"button\" [disabled]=\"n < 3\" (click)=\"state.distribute('h')\" [title]=\"s.distributeH\" [attr.aria-label]=\"s.distributeH\" [innerHTML]=\"'distributeH' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 3\" (click)=\"state.distribute('v')\" [title]=\"s.distributeV\" [attr.aria-label]=\"s.distributeV\" [innerHTML]=\"'distributeV' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.sameSize('width')\" [title]=\"s.sameWidth\" [attr.aria-label]=\"s.sameWidth\" [innerHTML]=\"'sameWidth' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.sameSize('height')\" [title]=\"s.sameHeight\" [attr.aria-label]=\"s.sameHeight\" [innerHTML]=\"'sameHeight' | weReportIcon\"></button>\n <button type=\"button\" (click)=\"state.arrange('front')\" [title]=\"s.bringToFront\" [attr.aria-label]=\"s.bringToFront\" [innerHTML]=\"'bringToFront' | weReportIcon\"></button>\n <button type=\"button\" (click)=\"state.arrange('back')\" [title]=\"s.sendToBack\" [attr.aria-label]=\"s.sendToBack\" [innerHTML]=\"'sendToBack' | weReportIcon\"></button>\n </div>\n @if (n < 2) {\n <small class=\"pp__hint\">{{ s.arrangeHint }}</small>\n }\n </section>\n @if (control(); as c) {\n <!-- Content first: it is what people change most. -->\n @switch (c.type) {\n @case ('text') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" [multiline]=\"true\" (valueChange)=\"setBindable('text', $event)\" />\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"set('format', $any($event.target).value)\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ $any(s)[f.key] }}</option>\n }\n @if (formatIsCustom()) {\n <option [value]=\"c.format\" selected>{{ c.format }}</option>\n }\n </select>\n </label>\n @if (advanced()) {\n <input class=\"pp__mono\" [value]=\"c.format ?? ''\" (input)=\"set('format', $any($event.target).value)\" spellcheck=\"false\" placeholder=\"n2 \u00B7 c2 \u00B7 dd.MM.yyyy\" />\n }\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\n </label>\n </section>\n }\n @case ('barcode') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.symbology }}</span>\n <select (change)=\"set('symbology', $any($event.target).value)\">\n @for (sym of symbologies; track sym) {\n <option [value]=\"sym\" [selected]=\"sym === c.symbology\">{{ sym }}</option>\n }\n @if (!symbologies.includes(c.symbology)) {\n <option [value]=\"c.symbology\" selected>{{ c.symbology }}</option>\n }\n </select>\n </label>\n <span class=\"pp__label\">{{ s.barcodeValue }}</span>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('value', $event)\" />\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"c.showText\" (change)=\"set('showText', $any($event.target).checked)\" />\n <span>{{ s.showText }}</span>\n </label>\n </section>\n }\n @case ('image') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__file\">\n <input type=\"file\" accept=\"image/png,image/jpeg\" (change)=\"chooseImage($event)\" />\n <span>{{ s.chooseImage }}</span>\n </label>\n <span class=\"pp__label\">{{ s.fromData }}</span>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('source', $event)\" />\n <label class=\"pp__row\">\n <span>{{ s.fit }}</span>\n <select (change)=\"set('fit', $any($event.target).value)\">\n <option value=\"contain\" [selected]=\"c.fit === 'contain'\">{{ s.fitContain }}</option>\n <option value=\"cover\" [selected]=\"c.fit === 'cover'\">{{ s.fitCover }}</option>\n <option value=\"stretch\" [selected]=\"c.fit === 'stretch'\">{{ s.fitStretch }}</option>\n <option value=\"none\" [selected]=\"c.fit === 'none'\">{{ s.fitNone }}</option>\n </select>\n </label>\n </section>\n }\n @case ('line') {\n <section class=\"pp__section\">\n <h3>{{ s.groupAppearance }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.lineDirection }}</span>\n <select (change)=\"set('direction', $any($event.target).value)\">\n <option value=\"horizontal\" [selected]=\"c.direction === 'horizontal'\">{{ s.horizontal }}</option>\n <option value=\"vertical\" [selected]=\"c.direction === 'vertical'\">{{ s.vertical }}</option>\n <option value=\"diagonalDown\" [selected]=\"c.direction === 'diagonalDown'\">{{ s.diagonalDown }}</option>\n <option value=\"diagonalUp\" [selected]=\"c.direction === 'diagonalUp'\">{{ s.diagonalUp }}</option>\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.lineWidth }} (mm)</span>\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(c.lineWidth)\" (input)=\"set('lineWidth', asNumber($any($event.target).value, 0.05))\" />\n </label>\n <label class=\"pp__row\">\n <span>{{ s.color }}</span>\n <input type=\"color\" [value]=\"c.color ?? style()?.color ?? '#000000'\" (input)=\"set('color', $any($event.target).value)\" />\n </label>\n </section>\n }\n @case ('shape') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.shape }}</span>\n <select (change)=\"set('shape', $any($event.target).value)\">\n <option value=\"rectangle\" [selected]=\"c.shape === 'rectangle'\">{{ s.rectangle }}</option>\n <option value=\"roundedRectangle\" [selected]=\"c.shape === 'roundedRectangle'\">{{ s.roundedRectangle }}</option>\n <option value=\"ellipse\" [selected]=\"c.shape === 'ellipse'\">{{ s.ellipse }}</option>\n </select>\n </label>\n @if (c.shape === 'roundedRectangle') {\n <label class=\"pp__row\">\n <span>{{ s.cornerRadius }} (mm)</span>\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.cornerRadius ?? 2)\" (input)=\"set('cornerRadius', asNumber($any($event.target).value, 0))\" />\n </label>\n }\n </section>\n }\n @case ('pageInfo') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.pageInfo }}</span>\n <select (change)=\"set('info', $any($event.target).value)\">\n <option value=\"pageNumber\" [selected]=\"c.info === 'pageNumber'\">{{ s.pageNumber }}</option>\n <option value=\"pageCount\" [selected]=\"c.info === 'pageCount'\">{{ s.pageTotal }}</option>\n <option value=\"pageNofM\" [selected]=\"c.info === 'pageNofM'\">{{ s.pageNofM }}</option>\n <option value=\"printDate\" [selected]=\"c.info === 'printDate'\">{{ s.printDate }}</option>\n </select>\n </label>\n @if (c.info === 'pageNofM' || c.info === 'printDate') {\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.format }}</span>\n <input class=\"pp__mono\" [value]=\"c.format ?? ''\" (input)=\"set('format', $any($event.target).value)\" [placeholder]=\"c.info === 'pageNofM' ? '{0} / {1}' : 'dd.MM.yyyy'\" spellcheck=\"false\" />\n </label>\n }\n </section>\n }\n @case ('table') {\n @let cellInfo = selectedCell();\n <section class=\"pp__section\">\n <h3>{{ s.tableSection }}</h3>\n <small class=\"pp__hint\">{{ s.tableHint }}</small>\n <div class=\"pp__buttons\">\n <button type=\"button\" (click)=\"tableOp('insertRow')\">+ {{ s.addRow }}</button>\n <button type=\"button\" (click)=\"tableOp('insertColumn')\">+ {{ s.addColumn }}</button>\n <button type=\"button\" [disabled]=\"c.rows.length < 2\" (click)=\"tableOp('deleteRow')\">\u2212 {{ s.deleteRow }}</button>\n <button type=\"button\" [disabled]=\"c.columns.length < 2\" (click)=\"tableOp('deleteColumn')\">\u2212 {{ s.deleteColumn }}</button>\n <button type=\"button\" [disabled]=\"!cellInfo || cellInfo.index >= c.rows[cellInfo.row].cells.length - 1\" (click)=\"tableOp('mergeRight')\">{{ s.mergeCells }}</button>\n <button type=\"button\" [disabled]=\"!cellInfo || (cellInfo.cell.colSpan ?? 1) < 2\" (click)=\"tableOp('splitCell')\">{{ s.splitCell }}</button>\n </div>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\n </label>\n </section>\n @if (cellInfo) {\n <section class=\"pp__section\">\n <h3>{{ s.selectedCell }}</h3>\n <we-report-bindable-input [value]=\"cellInfo.cell.text\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setCell({ text: $event })\" />\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"setCell({ format: $any($event.target).value || undefined })\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(cellInfo.cell.format ?? '') === f.value\">{{ s[f.key] }}</option>\n }\n </select>\n </label>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.alignment\">\n @for (a of ['left', 'center', 'right']; track a) {\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"cellAlign(cellInfo.cell) === a\" [class.pp__on]=\"cellAlign(cellInfo.cell) === a\" (click)=\"setCellStyle('textAlign', $any(a))\">\n {{ a === 'left' ? s.alignLeft : a === 'center' ? s.alignCenter : s.alignRight }}\n </button>\n }\n </div>\n <div class=\"pp__rule-then\">\n <button type=\"button\" class=\"pp__chip\" [class.pp__on]=\"cellInfo.cell.styleOverrides?.bold\" (click)=\"setCellStyle('bold', cellInfo.cell.styleOverrides?.bold ? undefined : true)\">{{ s.bold }}</button>\n <span>{{ s.backgroundColor }}</span>\n <input type=\"color\" [value]=\"cellInfo.cell.styleOverrides?.backgroundColor ?? '#ffffff'\" (input)=\"setCellStyle('backgroundColor', $any($event.target).value)\" [attr.aria-label]=\"s.backgroundColor\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setCellStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\n </div>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnWidth }}</span>\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(c.columns[cellInfo.column])\" (input)=\"setColumnWidth(cellInfo.column, $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.rowHeight }}</span>\n <input type=\"number\" min=\"2\" step=\"0.5\" [value]=\"num(c.rows[cellInfo.row].height)\" (input)=\"setRowHeight(cellInfo.row, $any($event.target).value)\" />\n </label>\n </div>\n </section>\n }\n }\n @case ('chart') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <small class=\"pp__hint\">{{ s.chartHint }}</small>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.chartType\">\n @for (t of chartTypes; track t.type) {\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"c.chartType === t.type\" [class.pp__on]=\"c.chartType === t.type\" (click)=\"set('chartType', t.type)\">{{ s[t.label] }}</button>\n }\n </div>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartCategory }}</span>\n <select (change)=\"setExpression('category', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!c.category.expression\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === c.category.expression\">{{ f.label }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartValue }}</span>\n <select (change)=\"setExpression('value', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!c.value.expression\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === c.value.expression\">{{ f.label }}</option>\n }\n </select>\n </label>\n @if (advanced()) {\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.expression }}</span>\n <input class=\"pp__mono\" [value]=\"c.category.expression\" (input)=\"setExpression('category', $any($event.target).value)\" spellcheck=\"false\" />\n <input class=\"pp__mono\" [value]=\"c.value.expression\" (input)=\"setExpression('value', $any($event.target).value)\" spellcheck=\"false\" />\n </label>\n }\n <label class=\"pp__row\">\n <span>{{ s.chartAggregate }}</span>\n <select (change)=\"set('aggregate', $any($event.target).value)\">\n @for (a of aggregates; track a.value) {\n <option [value]=\"a.value\" [selected]=\"(c.aggregate ?? 'sum') === a.value\">{{ s[a.label] }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"set('format', $any($event.target).value)\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ s[f.key] }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartTitle }}</span>\n <input [value]=\"c.title ?? ''\" (input)=\"set('title', $any($event.target).value)\" />\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.showValues\" (change)=\"set('showValues', $any($event.target).checked || undefined)\" />\n <span>{{ s.showValues }}</span>\n </label>\n @if (c.chartType === 'pie' || c.chartType === 'doughnut') {\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"c.showLegend !== false\" (change)=\"set('showLegend', $any($event.target).checked ? undefined : false)\" />\n <span>{{ s.showLegend }}</span>\n </label>\n }\n </section>\n }\n @case ('checkbox') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <span class=\"pp__label\">{{ s.checked }}</span>\n <we-report-bindable-input [value]=\"checkedValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('checked', $event)\" />\n </section>\n }\n }\n\n <section class=\"pp__section\">\n <h3>{{ s.conditionalFormatting }}</h3>\n @for (rule of c.formatting ?? []; track $index; let i = $index) {\n @let cond = condition(rule.when);\n <div class=\"pp__rule\">\n <div class=\"pp__rule-head\">\n <span>{{ s.ruleWhen }}</span>\n <button type=\"button\" class=\"pp__link\" (click)=\"removeRule(i)\" [title]=\"s.removeRule\" [attr.aria-label]=\"s.removeRule\">\u2715</button>\n </div>\n @if (cond) {\n <div class=\"pp__rule-when\">\n <select (change)=\"setCondition(i, cond, 'field', $any($event.target).value)\" [attr.aria-label]=\"s.ruleWhen\">\n <option value=\"\" [selected]=\"!cond.field\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === cond.field\">{{ f.label }}</option>\n }\n </select>\n <select (change)=\"setCondition(i, cond, 'op', $any($event.target).value)\">\n @for (o of conditionOps; track o.op) {\n <option [value]=\"o.op\" [selected]=\"o.op === cond.op\">{{ o.op === 'contains' ? s.opContains : o.label }}</option>\n }\n </select>\n <input [value]=\"cond.value\" (input)=\"setCondition(i, cond, 'value', $any($event.target).value)\" [placeholder]=\"s.ruleValue\" [attr.aria-label]=\"s.ruleValue\" />\n </div>\n }\n @if (advanced() || !cond) {\n <input class=\"pp__mono\" [value]=\"rule.when\" (input)=\"setRule(i, { when: $any($event.target).value })\" spellcheck=\"false\" />\n }\n <div class=\"pp__rule-then\">\n <span>{{ s.ruleThen }}</span>\n <input type=\"color\" [value]=\"rule.style.color ?? '#000000'\" (input)=\"setRuleStyle(i, 'color', $any($event.target).value)\" [title]=\"s.textColor\" [attr.aria-label]=\"s.textColor\" />\n <input type=\"color\" [value]=\"rule.style.backgroundColor ?? '#ffffff'\" (input)=\"setRuleStyle(i, 'backgroundColor', $any($event.target).value)\" [title]=\"s.backgroundColor\" [attr.aria-label]=\"s.backgroundColor\" />\n <button type=\"button\" class=\"pp__chip\" [class.pp__on]=\"rule.style.bold\" (click)=\"setRuleStyle(i, 'bold', rule.style.bold ? undefined : true)\">{{ s.bold }}</button>\n </div>\n </div>\n } @empty {\n <small class=\"pp__hint\">{{ s.conditionalHint }}</small>\n }\n <button type=\"button\" class=\"pp__link\" (click)=\"addRule()\">+ {{ s.addRule }}</button>\n </section>\n\n <section class=\"pp__section\">\n <h3>{{ s.groupLayout }}</h3>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\"><span>{{ s.left }}</span><input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.x)\" (input)=\"setGeometry('x', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.top }}</span><input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.y)\" (input)=\"setGeometry('y', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.width }}</span><input type=\"number\" min=\"0.5\" step=\"0.5\" [value]=\"num(c.width)\" (input)=\"setGeometry('width', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.height }}</span><input type=\"number\" min=\"0.5\" step=\"0.5\" [value]=\"num(c.height)\" (input)=\"setGeometry('height', $any($event.target).value)\" /></label>\n </div>\n </section>\n }\n\n <!-- Appearance applies to every selected control at once. -->\n @if (style(); as st) {\n @if (hasText()) {\n <section class=\"pp__section\">\n <h3>{{ s.groupAppearance }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.font }}</span>\n <select (change)=\"setStyle('fontFamily', $any($event.target).value)\">\n @for (f of fontFamilies(); track f) {\n <option [value]=\"f\" [selected]=\"f === st.fontFamily\">{{ f }}</option>\n }\n @if (!fontFamilies().includes(st.fontFamily)) {\n <option [value]=\"st.fontFamily\" selected>{{ st.fontFamily }}</option>\n }\n </select>\n </label>\n <div class=\"pp__row\">\n <span>{{ s.fontSize }} (pt)</span>\n <input type=\"number\" min=\"4\" max=\"200\" step=\"0.5\" [value]=\"num(st.fontSize)\" (input)=\"setStyle('fontSize', asNumber($any($event.target).value, 4))\" />\n </div>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.bold\" (click)=\"setStyle('bold', !st.bold)\" [attr.aria-pressed]=\"st.bold\"><b>{{ s.bold }}</b></button>\n <button type=\"button\" [class.pp__on]=\"st.italic\" (click)=\"setStyle('italic', !st.italic)\" [attr.aria-pressed]=\"st.italic\"><i>{{ s.italic }}</i></button>\n <button type=\"button\" [class.pp__on]=\"st.underline\" (click)=\"setStyle('underline', !st.underline)\" [attr.aria-pressed]=\"st.underline\"><u>{{ s.underline }}</u></button>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.alignment }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'left'\" (click)=\"setStyle('textAlign', 'left')\">{{ s.alignLeft }}</button>\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'center'\" (click)=\"setStyle('textAlign', 'center')\">{{ s.alignCenter }}</button>\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'right'\" (click)=\"setStyle('textAlign', 'right')\">{{ s.alignRight }}</button>\n </div>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.verticalAlignment }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'top'\" (click)=\"setStyle('verticalAlign', 'top')\">{{ s.alignTop }}</button>\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'middle'\" (click)=\"setStyle('verticalAlign', 'middle')\">{{ s.alignMiddle }}</button>\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'bottom'\" (click)=\"setStyle('verticalAlign', 'bottom')\">{{ s.alignBottom }}</button>\n </div>\n </div>\n <label class=\"pp__row\">\n <span>{{ s.textColor }}</span>\n <input type=\"color\" [value]=\"st.color\" (input)=\"setStyle('color', $any($event.target).value)\" />\n </label>\n </section>\n }\n @if (control()?.type !== 'line') {\n <section class=\"pp__section\">\n @if (!hasText()) {\n <h3>{{ s.groupAppearance }}</h3>\n }\n <label class=\"pp__row\">\n <span>{{ s.backgroundColor }}</span>\n <span class=\"pp__color\">\n <input type=\"color\" [value]=\"st.backgroundColor ?? '#ffffff'\" (input)=\"setStyle('backgroundColor', $any($event.target).value)\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\n </span>\n </label>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.border }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.top\" (click)=\"toggleBorderSide('top', !st.border?.sides?.top)\">{{ s.marginTop }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.right\" (click)=\"toggleBorderSide('right', !st.border?.sides?.right)\">{{ s.marginRight }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.bottom\" (click)=\"toggleBorderSide('bottom', !st.border?.sides?.bottom)\">{{ s.marginBottom }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.left\" (click)=\"toggleBorderSide('left', !st.border?.sides?.left)\">{{ s.marginLeft }}</button>\n </div>\n </div>\n @if (st.border) {\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.borderWidth }}</span>\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(st.border.width)\" (input)=\"setBorder({ width: asNumber($any($event.target).value, 0.05) })\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.borderColor }}</span>\n <input type=\"color\" [value]=\"st.border.color\" (input)=\"setBorder({ color: $any($event.target).value })\" />\n </label>\n </div>\n }\n @if (advanced() && hasText()) {\n <label class=\"pp__row\">\n <span>{{ s.padding }} (mm)</span>\n <input type=\"number\" min=\"0\" step=\"0.1\" [value]=\"num(st.padding)\" (input)=\"setStyle('padding', asNumber($any($event.target).value, 0))\" />\n </label>\n }\n </section>\n }\n }\n\n @if (advanced() && control(); as c) {\n <section class=\"pp__section\">\n <h3>{{ s.groupBehaviour }}</h3>\n <span class=\"pp__label\">{{ s.visibleWhen }}</span>\n <input class=\"pp__mono\" [value]=\"$any(visibleValue(c)).expression ?? ''\" (input)=\"setVisible({ expression: $any($event.target).value })\" spellcheck=\"false\" placeholder=\"[Total] > 0\" />\n <small class=\"pp__hint\">{{ s.visibleWhenHint }}</small>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.stretch\" (change)=\"set('stretch', $any($event.target).checked || undefined)\" />\n <span>{{ s.stretch }}<small class=\"pp__hint\">{{ s.stretchHint }}</small></span>\n </label>\n </section>\n }\n}\n", styles: [":host{display:block;padding:14px 14px 32px;font-size:12.5px;color:var(--we-report-fg, #1d1d1f)}.pp__title{margin:0;font-size:15px;font-weight:600;letter-spacing:-.01em}.pp__subtitle{margin-top:2px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__subtitle code{font-size:11px}.pp__section{display:flex;flex-direction:column;gap:10px;padding:14px 0;border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.pp__section:last-of-type{border-bottom:0}.pp__section h3{margin:0;font-size:12px;font-weight:600;color:var(--we-report-fg, #1d1d1f)}.pp__row{display:flex;align-items:center;justify-content:space-between;gap:10px}.pp__row>span:first-child{flex:1;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__row input[type=number]{width:76px;text-align:right;font-variant-numeric:tabular-nums}.pp__row select{width:auto;max-width:60%}.pp__row--stack{flex-direction:column;align-items:stretch;gap:4px}.pp__row--stack>span:first-child{font-size:11.5px}.pp__row--stack input[type=number]{width:100%;text-align:left}.pp__row--stack select{max-width:none;width:100%}.pp__grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.pp__grid--4{grid-template-columns:repeat(4,1fr)}.pp__grid--4 label{display:flex;flex-direction:column;gap:3px;text-align:center}.pp__grid--4 label small{font-size:10.5px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__grid--4 label input{text-align:center!important}input:not([type=checkbox]):not([type=color]):not([type=file]),select,textarea{width:100%;box-sizing:border-box;font:inherit;padding:5px 8px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;transition:box-shadow .15s ease}input:not([type=checkbox]):not([type=color]):not([type=file]):focus,select:focus,textarea:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}input[type=checkbox]{accent-color:var(--we-report-accent, #007aff);width:14px;height:14px}input[type=color]{width:26px;height:26px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer;box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14))}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:0;border-radius:50%}input[type=color]::-moz-color-swatch{border:0;border-radius:50%}.pp__mono{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace!important;font-size:12px!important}.pp__label{font-weight:500}.pp__hint{display:block;margin-top:2px;font-size:11px;line-height:1.35;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__check{display:flex;align-items:flex-start;gap:8px;cursor:pointer}.pp__check input{margin-top:2px}.pp__segmented{display:flex;padding:2px;gap:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.pp__segmented button{flex:1;border:0;border-radius:6px;padding:4px;font:inherit;font-size:12px;background:transparent;color:inherit;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease}.pp__segmented button.pp__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.pp__segmented button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.pp__tools{display:flex;gap:2px;padding:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.pp__tools button{flex:1;display:inline-flex;align-items:center;justify-content:center;height:26px;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer}.pp__tools button :is(svg){width:16px;height:16px}.pp__tools button:hover:not(:disabled){background:var(--we-report-segment-on-bg, #fff);box-shadow:0 1px 2px #0000001a}.pp__tools button:disabled{opacity:.3;cursor:default}.pp__tools button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.pp__buttons{display:grid;grid-template-columns:1fr 1fr;gap:4px}.pp__buttons button{border:0;border-radius:var(--we-report-control-radius, 7px);padding:5px 6px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12));color:inherit;font:inherit;font-size:12px;cursor:pointer}.pp__buttons button:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .2))}.pp__buttons button:disabled{opacity:.4;cursor:default}.pp__rule{display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:10px;background:var(--we-report-workspace-bg, #f2f2f7)}.pp__rule-head,.pp__rule-then{display:flex;align-items:center;gap:8px}.pp__rule-head>span,.pp__rule-then>span{flex:1;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__rule-when{display:grid;grid-template-columns:1fr 54px 1fr;gap:4px}.pp__chip{border:0;border-radius:999px;padding:3px 10px;font:inherit;font-size:11.5px;font-weight:700;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12));color:inherit;cursor:pointer}.pp__chip.pp__on{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.pp__color{display:inline-flex;align-items:center;gap:8px}.pp__link{border:0;background:none;padding:0;font:inherit;color:var(--we-report-accent, #007aff);cursor:pointer}.pp__file{position:relative;display:block;padding:10px;border-radius:10px;border:1px dashed var(--we-report-accent, #007aff);background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff);font-weight:500;text-align:center;cursor:pointer}.pp__file input{position:absolute;inset:0;opacity:0;cursor:pointer}.pp__danger{margin-top:14px;width:100%;padding:7px;border:0;border-radius:8px;background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000);font:inherit;font-weight:500;cursor:pointer}@media (prefers-reduced-motion: reduce){input,select,textarea,.pp__segmented button{transition:none}}\n"], dependencies: [{ kind: "component", type: BindableInputComponent, selector: "we-report-bindable-input", inputs: ["value", "fields", "strings", "multiline"], outputs: ["valueChange"] }, { kind: "pipe", type: WeReportIconPipe, name: "weReportIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4508
5653
|
}
|
|
4509
5654
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PropertyPanelComponent, decorators: [{
|
|
4510
5655
|
type: Component,
|
|
4511
|
-
args: [{ selector: 'we-report-property-panel', standalone: true, imports: [BindableInputComponent, WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let s = strings();\n<h2 class=\"pp__title\">{{ s.properties }}</h2>\n\n@let selectedControl = control();\n@let selectedBand = band();\n@if (selectedControl) {\n <div class=\"pp__subtitle\">{{ s.controlNames[selectedControl.type] }} \u00B7 <code>{{ selectedControl.id }}</code></div>\n} @else if (controls().length > 1) {\n <div class=\"pp__subtitle\">{{ s.itemsSelected.replace('{0}', '' + controls().length) }}</div>\n} @else if (selectedBand) {\n <div class=\"pp__subtitle\">{{ s.bandNames[selectedBand.kind] }}</div>\n}\n\n<!-- \u2500\u2500 Report (nothing selected) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (!controls().length && !band()) {\n <section class=\"pp__section\">\n <h3>{{ s.groupPage }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.reportName }}</span>\n <input [value]=\"report().name\" (input)=\"setReport('name', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.paper }}</span>\n <select (change)=\"setPaper($any($event.target).value)\">\n @for (p of papers; track p.id) {\n <option [value]=\"p.id\" [selected]=\"p.id === report().page.paper\">{{ p.id }} ({{ p.width }} \u00D7 {{ p.height ?? '\u221E' }} mm)</option>\n }\n <option value=\"custom\" [selected]=\"report().page.paper === 'custom'\">{{ s.customSize }}</option>\n </select>\n </label>\n @if (report().page.paper === 'custom') {\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.width }} (mm)</span>\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.width)\" (input)=\"setPage('width', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.height }} (mm)</span>\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.height)\" (input)=\"setPage('height', $any($event.target).value)\" />\n </label>\n </div>\n }\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.orientation }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'portrait'\" (click)=\"setPage('orientation', 'portrait')\">{{ s.portrait }}</button>\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'landscape'\" (click)=\"setPage('orientation', 'landscape')\">{{ s.landscape }}</button>\n </div>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.margins }} (mm)</span>\n <div class=\"pp__grid pp__grid--4\">\n <label><small>{{ s.marginTop }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.top)\" (input)=\"setMargin('top', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginRight }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.right)\" (input)=\"setMargin('right', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginBottom }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.bottom)\" (input)=\"setMargin('bottom', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginLeft }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.left)\" (input)=\"setMargin('left', $any($event.target).value)\" /></label>\n </div>\n </div>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.reportLocale }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.reportLocaleRegion }}</span>\n <select (change)=\"setCulture('locale', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!report().locale\">{{ s.reportLocaleDefault }}</option>\n @for (l of cultures; track l.id) {\n <option [value]=\"l.id\" [selected]=\"report().locale === l.id\">{{ l.name }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.reportCurrency }}</span>\n <select (change)=\"setCulture('currency', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!report().currency\">{{ s.reportLocaleDefault }}</option>\n @for (c of currencies; track c) {\n <option [value]=\"c\" [selected]=\"report().currency === c\">{{ c }}</option>\n }\n </select>\n </label>\n <small class=\"pp__hint\">{{ s.reportLocaleHint }}</small>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.watermark }}</h3>\n @let wm = report().watermark;\n <we-report-bindable-input [value]=\"wm?.text ?? ''\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setWatermark({ text: $event })\" />\n <small class=\"pp__hint\">{{ s.watermarkHint }}</small>\n @if (wm) {\n <div class=\"pp__row\">\n <span>{{ s.color }}</span>\n <input type=\"color\" [value]=\"wm.color ?? '#e3e6ea'\" (input)=\"setWatermark({ color: $any($event.target).value })\" [attr.aria-label]=\"s.color\" />\n </div>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.watermarkAngle\">\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"(wm.angle ?? 45) === 45\" [class.pp__on]=\"(wm.angle ?? 45) === 45\" (click)=\"setWatermark({ angle: undefined })\">\u2197 45\u00B0</button>\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"wm.angle === 0\" [class.pp__on]=\"wm.angle === 0\" (click)=\"setWatermark({ angle: 0 })\">\u2192 0\u00B0</button>\n </div>\n }\n </section>\n @if (advanced() && report().dataMember) {\n <section class=\"pp__section\">\n <h3>{{ s.groupData }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.dataRows }}</span>\n <input [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" />\n <small class=\"pp__hint\">{{ s.dataRowsHint }}</small>\n </label>\n </section>\n }\n}\n\n<!-- \u2500\u2500 Band \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (band(); as b) {\n <section class=\"pp__section\">\n <h3>{{ s.groupLayout }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.bandHeight }} (mm)</span>\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(b.height)\" (input)=\"setBand('height', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row\">\n <span>{{ s.backgroundColor }}</span>\n <span class=\"pp__color\">\n <input type=\"color\" [value]=\"b.backgroundColor ?? '#ffffff'\" (input)=\"setBand('backgroundColor', $any($event.target).value)\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setBand('backgroundColor', '')\">{{ s.noColor }}</button>\n </span>\n </label>\n </section>\n @if (b.kind === 'subDetail') {\n <section class=\"pp__section\">\n <h3>{{ s.innerList }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.innerListOf }}</span>\n <select (change)=\"setBand('rowsPath', $any($event.target).value)\">\n @for (l of lists(); track l) {\n <option [value]=\"l\" [selected]=\"b.rowsPath === l\">{{ l }}</option>\n }\n @if (b.rowsPath && !lists().includes(b.rowsPath)) {\n <option [value]=\"b.rowsPath\" selected>{{ b.rowsPath }}</option>\n }\n </select>\n </label>\n <small class=\"pp__hint\">{{ s.innerListHint }}</small>\n </section>\n }\n @if (b.kind === 'detail') {\n <section class=\"pp__section\">\n <h3>{{ s.labelSheet }}</h3>\n <select (change)=\"applyLabelSheet($any($event.target).value); $any($event.target).value = ''\" [attr.aria-label]=\"s.labelSheet\">\n <option value=\"\" selected>{{ s.labelSheetChoose }}</option>\n @for (l of labelSheets; track l.id) {\n <option [value]=\"l.id\">{{ labelSheetName(l) }}</option>\n }\n </select>\n <small class=\"pp__hint\">{{ s.labelSheetHint }}</small>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnsCount }}</span>\n <input type=\"number\" min=\"1\" max=\"12\" step=\"1\" [value]=\"b.columns?.count ?? 1\" (input)=\"setColumns('count', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnGap }}</span>\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(b.columns?.gap ?? 0)\" (input)=\"setColumns('gap', $any($event.target).value)\" />\n </label>\n </div>\n <small class=\"pp__hint\">{{ s.columnsHint }}</small>\n </section>\n }\n @if (b.kind === 'groupHeader') {\n <section class=\"pp__section\">\n <h3>{{ s.groupBy }}</h3>\n @if (fields().length) {\n <select (change)=\"setBand('groupBy', $any($event.target).value)\">\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === b.groupBy?.expression\">{{ f.label }}</option>\n }\n </select>\n }\n <input class=\"pp__mono\" [value]=\"b.groupBy?.expression ?? ''\" (input)=\"setBand('groupBy', $any($event.target).value)\" spellcheck=\"false\" />\n <label class=\"pp__row\">\n <span>{{ s.sortGroups }}</span>\n <select (change)=\"setBand('sort', $any($event.target).value)\">\n <option value=\"asc\" [selected]=\"!b.sort || b.sort === 'asc'\">{{ s.sortAsc }}</option>\n <option value=\"desc\" [selected]=\"b.sort === 'desc'\">{{ s.sortDesc }}</option>\n <option value=\"none\" [selected]=\"b.sort === 'none'\">{{ s.sortNone }}</option>\n </select>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.keepTogether\" (change)=\"toggleBand('keepTogether', $any($event.target).checked)\" />\n <span>{{ s.keepTogether }}<small class=\"pp__hint\">{{ s.keepTogetherHint }}</small></span>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.repeatOnEveryPage\" (change)=\"toggleBand('repeatOnEveryPage', $any($event.target).checked)\" />\n <span>{{ s.repeatOnEveryPage }}</span>\n </label>\n </section>\n }\n @if (advanced() && b.kind !== 'pageHeader' && b.kind !== 'pageFooter') {\n <section class=\"pp__section\">\n <h3>{{ s.groupBehaviour }}</h3>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakBefore\" (change)=\"toggleBand('pageBreakBefore', $any($event.target).checked)\" />\n <span>{{ s.pageBreakBefore }}</span>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakAfter\" (change)=\"toggleBand('pageBreakAfter', $any($event.target).checked)\" />\n <span>{{ s.pageBreakAfter }}</span>\n </label>\n </section>\n }\n @if (b.kind !== 'detail') {\n <button type=\"button\" class=\"pp__danger\" (click)=\"removeBand()\">{{ s.removeBand }}</button>\n }\n}\n\n<!-- \u2500\u2500 Control(s) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (controls().length) {\n @let n = controls().length;\n <section class=\"pp__section\">\n <h3>{{ s.arrange }}</h3>\n <div class=\"pp__tools\" role=\"toolbar\" [attr.aria-label]=\"s.arrange\">\n @for (a of alignActions; track a.edge) {\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.align(a.edge)\" [title]=\"s[a.label]\" [attr.aria-label]=\"s[a.label]\" [innerHTML]=\"a.icon | weReportIcon\"></button>\n }\n </div>\n <div class=\"pp__tools\" role=\"toolbar\" [attr.aria-label]=\"s.arrange\">\n <button type=\"button\" [disabled]=\"n < 3\" (click)=\"state.distribute('h')\" [title]=\"s.distributeH\" [attr.aria-label]=\"s.distributeH\" [innerHTML]=\"'distributeH' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 3\" (click)=\"state.distribute('v')\" [title]=\"s.distributeV\" [attr.aria-label]=\"s.distributeV\" [innerHTML]=\"'distributeV' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.sameSize('width')\" [title]=\"s.sameWidth\" [attr.aria-label]=\"s.sameWidth\" [innerHTML]=\"'sameWidth' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.sameSize('height')\" [title]=\"s.sameHeight\" [attr.aria-label]=\"s.sameHeight\" [innerHTML]=\"'sameHeight' | weReportIcon\"></button>\n <button type=\"button\" (click)=\"state.arrange('front')\" [title]=\"s.bringToFront\" [attr.aria-label]=\"s.bringToFront\" [innerHTML]=\"'bringToFront' | weReportIcon\"></button>\n <button type=\"button\" (click)=\"state.arrange('back')\" [title]=\"s.sendToBack\" [attr.aria-label]=\"s.sendToBack\" [innerHTML]=\"'sendToBack' | weReportIcon\"></button>\n </div>\n @if (n < 2) {\n <small class=\"pp__hint\">{{ s.arrangeHint }}</small>\n }\n </section>\n @if (control(); as c) {\n <!-- Content first: it is what people change most. -->\n @switch (c.type) {\n @case ('text') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" [multiline]=\"true\" (valueChange)=\"setBindable('text', $event)\" />\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"set('format', $any($event.target).value)\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ $any(s)[f.key] }}</option>\n }\n @if (formatIsCustom()) {\n <option [value]=\"c.format\" selected>{{ c.format }}</option>\n }\n </select>\n </label>\n @if (advanced()) {\n <input class=\"pp__mono\" [value]=\"c.format ?? ''\" (input)=\"set('format', $any($event.target).value)\" spellcheck=\"false\" placeholder=\"n2 \u00B7 c2 \u00B7 dd.MM.yyyy\" />\n }\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\n </label>\n </section>\n }\n @case ('barcode') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.symbology }}</span>\n <select (change)=\"set('symbology', $any($event.target).value)\">\n @for (sym of symbologies; track sym) {\n <option [value]=\"sym\" [selected]=\"sym === c.symbology\">{{ sym }}</option>\n }\n @if (!symbologies.includes(c.symbology)) {\n <option [value]=\"c.symbology\" selected>{{ c.symbology }}</option>\n }\n </select>\n </label>\n <span class=\"pp__label\">{{ s.barcodeValue }}</span>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('value', $event)\" />\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"c.showText\" (change)=\"set('showText', $any($event.target).checked)\" />\n <span>{{ s.showText }}</span>\n </label>\n </section>\n }\n @case ('image') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__file\">\n <input type=\"file\" accept=\"image/png,image/jpeg\" (change)=\"chooseImage($event)\" />\n <span>{{ s.chooseImage }}</span>\n </label>\n <span class=\"pp__label\">{{ s.fromData }}</span>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('source', $event)\" />\n <label class=\"pp__row\">\n <span>{{ s.fit }}</span>\n <select (change)=\"set('fit', $any($event.target).value)\">\n <option value=\"contain\" [selected]=\"c.fit === 'contain'\">{{ s.fitContain }}</option>\n <option value=\"cover\" [selected]=\"c.fit === 'cover'\">{{ s.fitCover }}</option>\n <option value=\"stretch\" [selected]=\"c.fit === 'stretch'\">{{ s.fitStretch }}</option>\n <option value=\"none\" [selected]=\"c.fit === 'none'\">{{ s.fitNone }}</option>\n </select>\n </label>\n </section>\n }\n @case ('line') {\n <section class=\"pp__section\">\n <h3>{{ s.groupAppearance }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.lineDirection }}</span>\n <select (change)=\"set('direction', $any($event.target).value)\">\n <option value=\"horizontal\" [selected]=\"c.direction === 'horizontal'\">{{ s.horizontal }}</option>\n <option value=\"vertical\" [selected]=\"c.direction === 'vertical'\">{{ s.vertical }}</option>\n <option value=\"diagonalDown\" [selected]=\"c.direction === 'diagonalDown'\">{{ s.diagonalDown }}</option>\n <option value=\"diagonalUp\" [selected]=\"c.direction === 'diagonalUp'\">{{ s.diagonalUp }}</option>\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.lineWidth }} (mm)</span>\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(c.lineWidth)\" (input)=\"set('lineWidth', asNumber($any($event.target).value, 0.05))\" />\n </label>\n <label class=\"pp__row\">\n <span>{{ s.color }}</span>\n <input type=\"color\" [value]=\"c.color ?? style()?.color ?? '#000000'\" (input)=\"set('color', $any($event.target).value)\" />\n </label>\n </section>\n }\n @case ('shape') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.shape }}</span>\n <select (change)=\"set('shape', $any($event.target).value)\">\n <option value=\"rectangle\" [selected]=\"c.shape === 'rectangle'\">{{ s.rectangle }}</option>\n <option value=\"roundedRectangle\" [selected]=\"c.shape === 'roundedRectangle'\">{{ s.roundedRectangle }}</option>\n <option value=\"ellipse\" [selected]=\"c.shape === 'ellipse'\">{{ s.ellipse }}</option>\n </select>\n </label>\n @if (c.shape === 'roundedRectangle') {\n <label class=\"pp__row\">\n <span>{{ s.cornerRadius }} (mm)</span>\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.cornerRadius ?? 2)\" (input)=\"set('cornerRadius', asNumber($any($event.target).value, 0))\" />\n </label>\n }\n </section>\n }\n @case ('pageInfo') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.pageInfo }}</span>\n <select (change)=\"set('info', $any($event.target).value)\">\n <option value=\"pageNumber\" [selected]=\"c.info === 'pageNumber'\">{{ s.pageNumber }}</option>\n <option value=\"pageCount\" [selected]=\"c.info === 'pageCount'\">{{ s.pageTotal }}</option>\n <option value=\"pageNofM\" [selected]=\"c.info === 'pageNofM'\">{{ s.pageNofM }}</option>\n <option value=\"printDate\" [selected]=\"c.info === 'printDate'\">{{ s.printDate }}</option>\n </select>\n </label>\n @if (c.info === 'pageNofM' || c.info === 'printDate') {\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.format }}</span>\n <input class=\"pp__mono\" [value]=\"c.format ?? ''\" (input)=\"set('format', $any($event.target).value)\" [placeholder]=\"c.info === 'pageNofM' ? '{0} / {1}' : 'dd.MM.yyyy'\" spellcheck=\"false\" />\n </label>\n }\n </section>\n }\n @case ('table') {\n @let cellInfo = selectedCell();\n <section class=\"pp__section\">\n <h3>{{ s.tableSection }}</h3>\n <small class=\"pp__hint\">{{ s.tableHint }}</small>\n <div class=\"pp__buttons\">\n <button type=\"button\" (click)=\"tableOp('insertRow')\">+ {{ s.addRow }}</button>\n <button type=\"button\" (click)=\"tableOp('insertColumn')\">+ {{ s.addColumn }}</button>\n <button type=\"button\" [disabled]=\"c.rows.length < 2\" (click)=\"tableOp('deleteRow')\">\u2212 {{ s.deleteRow }}</button>\n <button type=\"button\" [disabled]=\"c.columns.length < 2\" (click)=\"tableOp('deleteColumn')\">\u2212 {{ s.deleteColumn }}</button>\n <button type=\"button\" [disabled]=\"!cellInfo || cellInfo.index >= c.rows[cellInfo.row].cells.length - 1\" (click)=\"tableOp('mergeRight')\">{{ s.mergeCells }}</button>\n <button type=\"button\" [disabled]=\"!cellInfo || (cellInfo.cell.colSpan ?? 1) < 2\" (click)=\"tableOp('splitCell')\">{{ s.splitCell }}</button>\n </div>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\n </label>\n </section>\n @if (cellInfo) {\n <section class=\"pp__section\">\n <h3>{{ s.selectedCell }}</h3>\n <we-report-bindable-input [value]=\"cellInfo.cell.text\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setCell({ text: $event })\" />\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"setCell({ format: $any($event.target).value || undefined })\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(cellInfo.cell.format ?? '') === f.value\">{{ s[f.key] }}</option>\n }\n </select>\n </label>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.alignment\">\n @for (a of ['left', 'center', 'right']; track a) {\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"cellAlign(cellInfo.cell) === a\" [class.pp__on]=\"cellAlign(cellInfo.cell) === a\" (click)=\"setCellStyle('textAlign', $any(a))\">\n {{ a === 'left' ? s.alignLeft : a === 'center' ? s.alignCenter : s.alignRight }}\n </button>\n }\n </div>\n <div class=\"pp__rule-then\">\n <button type=\"button\" class=\"pp__chip\" [class.pp__on]=\"cellInfo.cell.styleOverrides?.bold\" (click)=\"setCellStyle('bold', cellInfo.cell.styleOverrides?.bold ? undefined : true)\">{{ s.bold }}</button>\n <span>{{ s.backgroundColor }}</span>\n <input type=\"color\" [value]=\"cellInfo.cell.styleOverrides?.backgroundColor ?? '#ffffff'\" (input)=\"setCellStyle('backgroundColor', $any($event.target).value)\" [attr.aria-label]=\"s.backgroundColor\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setCellStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\n </div>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnWidth }}</span>\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(c.columns[cellInfo.column])\" (input)=\"setColumnWidth(cellInfo.column, $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.rowHeight }}</span>\n <input type=\"number\" min=\"2\" step=\"0.5\" [value]=\"num(c.rows[cellInfo.row].height)\" (input)=\"setRowHeight(cellInfo.row, $any($event.target).value)\" />\n </label>\n </div>\n </section>\n }\n }\n @case ('chart') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <small class=\"pp__hint\">{{ s.chartHint }}</small>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.chartType\">\n @for (t of chartTypes; track t.type) {\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"c.chartType === t.type\" [class.pp__on]=\"c.chartType === t.type\" (click)=\"set('chartType', t.type)\">{{ s[t.label] }}</button>\n }\n </div>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartCategory }}</span>\n <select (change)=\"setExpression('category', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!c.category.expression\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === c.category.expression\">{{ f.label }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartValue }}</span>\n <select (change)=\"setExpression('value', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!c.value.expression\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === c.value.expression\">{{ f.label }}</option>\n }\n </select>\n </label>\n @if (advanced()) {\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.expression }}</span>\n <input class=\"pp__mono\" [value]=\"c.category.expression\" (input)=\"setExpression('category', $any($event.target).value)\" spellcheck=\"false\" />\n <input class=\"pp__mono\" [value]=\"c.value.expression\" (input)=\"setExpression('value', $any($event.target).value)\" spellcheck=\"false\" />\n </label>\n }\n <label class=\"pp__row\">\n <span>{{ s.chartAggregate }}</span>\n <select (change)=\"set('aggregate', $any($event.target).value)\">\n @for (a of aggregates; track a.value) {\n <option [value]=\"a.value\" [selected]=\"(c.aggregate ?? 'sum') === a.value\">{{ s[a.label] }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"set('format', $any($event.target).value)\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ s[f.key] }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartTitle }}</span>\n <input [value]=\"c.title ?? ''\" (input)=\"set('title', $any($event.target).value)\" />\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.showValues\" (change)=\"set('showValues', $any($event.target).checked || undefined)\" />\n <span>{{ s.showValues }}</span>\n </label>\n @if (c.chartType === 'pie' || c.chartType === 'doughnut') {\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"c.showLegend !== false\" (change)=\"set('showLegend', $any($event.target).checked ? undefined : false)\" />\n <span>{{ s.showLegend }}</span>\n </label>\n }\n </section>\n }\n @case ('checkbox') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <span class=\"pp__label\">{{ s.checked }}</span>\n <we-report-bindable-input [value]=\"checkedValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('checked', $event)\" />\n </section>\n }\n }\n\n <section class=\"pp__section\">\n <h3>{{ s.conditionalFormatting }}</h3>\n @for (rule of c.formatting ?? []; track $index; let i = $index) {\n @let cond = condition(rule.when);\n <div class=\"pp__rule\">\n <div class=\"pp__rule-head\">\n <span>{{ s.ruleWhen }}</span>\n <button type=\"button\" class=\"pp__link\" (click)=\"removeRule(i)\" [title]=\"s.removeRule\" [attr.aria-label]=\"s.removeRule\">\u2715</button>\n </div>\n @if (cond) {\n <div class=\"pp__rule-when\">\n <select (change)=\"setCondition(i, cond, 'field', $any($event.target).value)\" [attr.aria-label]=\"s.ruleWhen\">\n <option value=\"\" [selected]=\"!cond.field\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === cond.field\">{{ f.label }}</option>\n }\n </select>\n <select (change)=\"setCondition(i, cond, 'op', $any($event.target).value)\">\n @for (o of conditionOps; track o.op) {\n <option [value]=\"o.op\" [selected]=\"o.op === cond.op\">{{ o.op === 'contains' ? s.opContains : o.label }}</option>\n }\n </select>\n <input [value]=\"cond.value\" (input)=\"setCondition(i, cond, 'value', $any($event.target).value)\" [placeholder]=\"s.ruleValue\" [attr.aria-label]=\"s.ruleValue\" />\n </div>\n }\n @if (advanced() || !cond) {\n <input class=\"pp__mono\" [value]=\"rule.when\" (input)=\"setRule(i, { when: $any($event.target).value })\" spellcheck=\"false\" />\n }\n <div class=\"pp__rule-then\">\n <span>{{ s.ruleThen }}</span>\n <input type=\"color\" [value]=\"rule.style.color ?? '#000000'\" (input)=\"setRuleStyle(i, 'color', $any($event.target).value)\" [title]=\"s.textColor\" [attr.aria-label]=\"s.textColor\" />\n <input type=\"color\" [value]=\"rule.style.backgroundColor ?? '#ffffff'\" (input)=\"setRuleStyle(i, 'backgroundColor', $any($event.target).value)\" [title]=\"s.backgroundColor\" [attr.aria-label]=\"s.backgroundColor\" />\n <button type=\"button\" class=\"pp__chip\" [class.pp__on]=\"rule.style.bold\" (click)=\"setRuleStyle(i, 'bold', rule.style.bold ? undefined : true)\">{{ s.bold }}</button>\n </div>\n </div>\n } @empty {\n <small class=\"pp__hint\">{{ s.conditionalHint }}</small>\n }\n <button type=\"button\" class=\"pp__link\" (click)=\"addRule()\">+ {{ s.addRule }}</button>\n </section>\n\n <section class=\"pp__section\">\n <h3>{{ s.groupLayout }}</h3>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\"><span>{{ s.left }}</span><input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.x)\" (input)=\"setGeometry('x', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.top }}</span><input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.y)\" (input)=\"setGeometry('y', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.width }}</span><input type=\"number\" min=\"0.5\" step=\"0.5\" [value]=\"num(c.width)\" (input)=\"setGeometry('width', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.height }}</span><input type=\"number\" min=\"0.5\" step=\"0.5\" [value]=\"num(c.height)\" (input)=\"setGeometry('height', $any($event.target).value)\" /></label>\n </div>\n </section>\n }\n\n <!-- Appearance applies to every selected control at once. -->\n @if (style(); as st) {\n @if (hasText()) {\n <section class=\"pp__section\">\n <h3>{{ s.groupAppearance }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.font }}</span>\n <select (change)=\"setStyle('fontFamily', $any($event.target).value)\">\n @for (f of fontFamilies(); track f) {\n <option [value]=\"f\" [selected]=\"f === st.fontFamily\">{{ f }}</option>\n }\n @if (!fontFamilies().includes(st.fontFamily)) {\n <option [value]=\"st.fontFamily\" selected>{{ st.fontFamily }}</option>\n }\n </select>\n </label>\n <div class=\"pp__row\">\n <span>{{ s.fontSize }} (pt)</span>\n <input type=\"number\" min=\"4\" max=\"200\" step=\"0.5\" [value]=\"num(st.fontSize)\" (input)=\"setStyle('fontSize', asNumber($any($event.target).value, 4))\" />\n </div>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.bold\" (click)=\"setStyle('bold', !st.bold)\" [attr.aria-pressed]=\"st.bold\"><b>{{ s.bold }}</b></button>\n <button type=\"button\" [class.pp__on]=\"st.italic\" (click)=\"setStyle('italic', !st.italic)\" [attr.aria-pressed]=\"st.italic\"><i>{{ s.italic }}</i></button>\n <button type=\"button\" [class.pp__on]=\"st.underline\" (click)=\"setStyle('underline', !st.underline)\" [attr.aria-pressed]=\"st.underline\"><u>{{ s.underline }}</u></button>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.alignment }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'left'\" (click)=\"setStyle('textAlign', 'left')\">{{ s.alignLeft }}</button>\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'center'\" (click)=\"setStyle('textAlign', 'center')\">{{ s.alignCenter }}</button>\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'right'\" (click)=\"setStyle('textAlign', 'right')\">{{ s.alignRight }}</button>\n </div>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.verticalAlignment }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'top'\" (click)=\"setStyle('verticalAlign', 'top')\">{{ s.alignTop }}</button>\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'middle'\" (click)=\"setStyle('verticalAlign', 'middle')\">{{ s.alignMiddle }}</button>\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'bottom'\" (click)=\"setStyle('verticalAlign', 'bottom')\">{{ s.alignBottom }}</button>\n </div>\n </div>\n <label class=\"pp__row\">\n <span>{{ s.textColor }}</span>\n <input type=\"color\" [value]=\"st.color\" (input)=\"setStyle('color', $any($event.target).value)\" />\n </label>\n </section>\n }\n @if (control()?.type !== 'line') {\n <section class=\"pp__section\">\n @if (!hasText()) {\n <h3>{{ s.groupAppearance }}</h3>\n }\n <label class=\"pp__row\">\n <span>{{ s.backgroundColor }}</span>\n <span class=\"pp__color\">\n <input type=\"color\" [value]=\"st.backgroundColor ?? '#ffffff'\" (input)=\"setStyle('backgroundColor', $any($event.target).value)\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\n </span>\n </label>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.border }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.top\" (click)=\"toggleBorderSide('top', !st.border?.sides?.top)\">{{ s.marginTop }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.right\" (click)=\"toggleBorderSide('right', !st.border?.sides?.right)\">{{ s.marginRight }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.bottom\" (click)=\"toggleBorderSide('bottom', !st.border?.sides?.bottom)\">{{ s.marginBottom }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.left\" (click)=\"toggleBorderSide('left', !st.border?.sides?.left)\">{{ s.marginLeft }}</button>\n </div>\n </div>\n @if (st.border) {\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.borderWidth }}</span>\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(st.border.width)\" (input)=\"setBorder({ width: asNumber($any($event.target).value, 0.05) })\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.borderColor }}</span>\n <input type=\"color\" [value]=\"st.border.color\" (input)=\"setBorder({ color: $any($event.target).value })\" />\n </label>\n </div>\n }\n @if (advanced() && hasText()) {\n <label class=\"pp__row\">\n <span>{{ s.padding }} (mm)</span>\n <input type=\"number\" min=\"0\" step=\"0.1\" [value]=\"num(st.padding)\" (input)=\"setStyle('padding', asNumber($any($event.target).value, 0))\" />\n </label>\n }\n </section>\n }\n }\n\n @if (advanced() && control(); as c) {\n <section class=\"pp__section\">\n <h3>{{ s.groupBehaviour }}</h3>\n <span class=\"pp__label\">{{ s.visibleWhen }}</span>\n <input class=\"pp__mono\" [value]=\"$any(visibleValue(c)).expression ?? ''\" (input)=\"setVisible({ expression: $any($event.target).value })\" spellcheck=\"false\" placeholder=\"[Total] > 0\" />\n <small class=\"pp__hint\">{{ s.visibleWhenHint }}</small>\n </section>\n }\n}\n", styles: [":host{display:block;padding:14px 14px 32px;font-size:12.5px;color:var(--we-report-fg, #1d1d1f)}.pp__title{margin:0;font-size:15px;font-weight:600;letter-spacing:-.01em}.pp__subtitle{margin-top:2px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__subtitle code{font-size:11px}.pp__section{display:flex;flex-direction:column;gap:10px;padding:14px 0;border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.pp__section:last-of-type{border-bottom:0}.pp__section h3{margin:0;font-size:12px;font-weight:600;color:var(--we-report-fg, #1d1d1f)}.pp__row{display:flex;align-items:center;justify-content:space-between;gap:10px}.pp__row>span:first-child{flex:1;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__row input[type=number]{width:76px;text-align:right;font-variant-numeric:tabular-nums}.pp__row select{width:auto;max-width:60%}.pp__row--stack{flex-direction:column;align-items:stretch;gap:4px}.pp__row--stack>span:first-child{font-size:11.5px}.pp__row--stack input[type=number]{width:100%;text-align:left}.pp__row--stack select{max-width:none;width:100%}.pp__grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.pp__grid--4{grid-template-columns:repeat(4,1fr)}.pp__grid--4 label{display:flex;flex-direction:column;gap:3px;text-align:center}.pp__grid--4 label small{font-size:10.5px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__grid--4 label input{text-align:center!important}input:not([type=checkbox]):not([type=color]):not([type=file]),select,textarea{width:100%;box-sizing:border-box;font:inherit;padding:5px 8px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;transition:box-shadow .15s ease}input:not([type=checkbox]):not([type=color]):not([type=file]):focus,select:focus,textarea:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}input[type=checkbox]{accent-color:var(--we-report-accent, #007aff);width:14px;height:14px}input[type=color]{width:26px;height:26px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer;box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14))}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:0;border-radius:50%}input[type=color]::-moz-color-swatch{border:0;border-radius:50%}.pp__mono{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace!important;font-size:12px!important}.pp__label{font-weight:500}.pp__hint{display:block;margin-top:2px;font-size:11px;line-height:1.35;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__check{display:flex;align-items:flex-start;gap:8px;cursor:pointer}.pp__check input{margin-top:2px}.pp__segmented{display:flex;padding:2px;gap:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.pp__segmented button{flex:1;border:0;border-radius:6px;padding:4px;font:inherit;font-size:12px;background:transparent;color:inherit;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease}.pp__segmented button.pp__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.pp__segmented button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.pp__tools{display:flex;gap:2px;padding:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.pp__tools button{flex:1;display:inline-flex;align-items:center;justify-content:center;height:26px;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer}.pp__tools button :is(svg){width:16px;height:16px}.pp__tools button:hover:not(:disabled){background:var(--we-report-segment-on-bg, #fff);box-shadow:0 1px 2px #0000001a}.pp__tools button:disabled{opacity:.3;cursor:default}.pp__tools button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.pp__buttons{display:grid;grid-template-columns:1fr 1fr;gap:4px}.pp__buttons button{border:0;border-radius:var(--we-report-control-radius, 7px);padding:5px 6px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12));color:inherit;font:inherit;font-size:12px;cursor:pointer}.pp__buttons button:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .2))}.pp__buttons button:disabled{opacity:.4;cursor:default}.pp__rule{display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:10px;background:var(--we-report-workspace-bg, #f2f2f7)}.pp__rule-head,.pp__rule-then{display:flex;align-items:center;gap:8px}.pp__rule-head>span,.pp__rule-then>span{flex:1;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__rule-when{display:grid;grid-template-columns:1fr 54px 1fr;gap:4px}.pp__chip{border:0;border-radius:999px;padding:3px 10px;font:inherit;font-size:11.5px;font-weight:700;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12));color:inherit;cursor:pointer}.pp__chip.pp__on{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.pp__color{display:inline-flex;align-items:center;gap:8px}.pp__link{border:0;background:none;padding:0;font:inherit;color:var(--we-report-accent, #007aff);cursor:pointer}.pp__file{position:relative;display:block;padding:10px;border-radius:10px;border:1px dashed var(--we-report-accent, #007aff);background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff);font-weight:500;text-align:center;cursor:pointer}.pp__file input{position:absolute;inset:0;opacity:0;cursor:pointer}.pp__danger{margin-top:14px;width:100%;padding:7px;border:0;border-radius:8px;background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000);font:inherit;font-weight:500;cursor:pointer}@media (prefers-reduced-motion: reduce){input,select,textarea,.pp__segmented button{transition:none}}\n"] }]
|
|
5656
|
+
args: [{ selector: 'we-report-property-panel', standalone: true, imports: [BindableInputComponent, WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let s = strings();\n<h2 class=\"pp__title\">{{ s.properties }}</h2>\n\n@let selectedControl = control();\n@let selectedBand = band();\n@if (selectedControl) {\n <div class=\"pp__subtitle\">{{ s.controlNames[selectedControl.type] }} \u00B7 <code>{{ selectedControl.id }}</code></div>\n} @else if (controls().length > 1) {\n <div class=\"pp__subtitle\">{{ s.itemsSelected.replace('{0}', '' + controls().length) }}</div>\n} @else if (selectedBand) {\n <div class=\"pp__subtitle\">{{ s.bandNames[selectedBand.kind] }}</div>\n}\n\n<!-- \u2500\u2500 Report (nothing selected) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (!controls().length && !band()) {\n <section class=\"pp__section\">\n <h3>{{ s.groupPage }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.reportName }}</span>\n <input [value]=\"report().name\" (input)=\"setReport('name', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.paper }}</span>\n <select (change)=\"setPaper($any($event.target).value)\">\n @for (p of papers; track p.id) {\n <option [value]=\"p.id\" [selected]=\"p.id === report().page.paper\">{{ p.id }} ({{ p.width }} \u00D7 {{ p.height ?? '\u221E' }} mm)</option>\n }\n <option value=\"custom\" [selected]=\"report().page.paper === 'custom'\">{{ s.customSize }}</option>\n </select>\n </label>\n @if (report().page.paper === 'custom') {\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.width }} (mm)</span>\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.width)\" (input)=\"setPage('width', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.height }} (mm)</span>\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.height)\" (input)=\"setPage('height', $any($event.target).value)\" />\n </label>\n </div>\n }\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.orientation }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'portrait'\" (click)=\"setPage('orientation', 'portrait')\">{{ s.portrait }}</button>\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'landscape'\" (click)=\"setPage('orientation', 'landscape')\">{{ s.landscape }}</button>\n </div>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.margins }} (mm)</span>\n <div class=\"pp__grid pp__grid--4\">\n <label><small>{{ s.marginTop }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.top)\" (input)=\"setMargin('top', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginRight }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.right)\" (input)=\"setMargin('right', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginBottom }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.bottom)\" (input)=\"setMargin('bottom', $any($event.target).value)\" /></label>\n <label><small>{{ s.marginLeft }}</small><input type=\"number\" min=\"0\" step=\"1\" [value]=\"num(report().page.margins.left)\" (input)=\"setMargin('left', $any($event.target).value)\" /></label>\n </div>\n </div>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.reportLocale }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.reportLocaleRegion }}</span>\n <select (change)=\"setCulture('locale', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!report().locale\">{{ s.reportLocaleDefault }}</option>\n @for (l of cultures; track l.id) {\n <option [value]=\"l.id\" [selected]=\"report().locale === l.id\">{{ l.name }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.reportCurrency }}</span>\n <select (change)=\"setCulture('currency', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!report().currency\">{{ s.reportLocaleDefault }}</option>\n @for (c of currencies; track c) {\n <option [value]=\"c\" [selected]=\"report().currency === c\">{{ c }}</option>\n }\n </select>\n </label>\n <small class=\"pp__hint\">{{ s.reportLocaleHint }}</small>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.watermark }}</h3>\n @let wm = report().watermark;\n <we-report-bindable-input [value]=\"wm?.text ?? ''\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setWatermark({ text: $event })\" />\n <small class=\"pp__hint\">{{ s.watermarkHint }}</small>\n @if (wm) {\n <div class=\"pp__row\">\n <span>{{ s.color }}</span>\n <input type=\"color\" [value]=\"wm.color ?? '#e3e6ea'\" (input)=\"setWatermark({ color: $any($event.target).value })\" [attr.aria-label]=\"s.color\" />\n </div>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.watermarkAngle\">\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"(wm.angle ?? 45) === 45\" [class.pp__on]=\"(wm.angle ?? 45) === 45\" (click)=\"setWatermark({ angle: undefined })\">\u2197 45\u00B0</button>\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"wm.angle === 0\" [class.pp__on]=\"wm.angle === 0\" (click)=\"setWatermark({ angle: 0 })\">\u2192 0\u00B0</button>\n </div>\n }\n </section>\n @if (advanced() && report().dataMember) {\n <section class=\"pp__section\">\n <h3>{{ s.groupData }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.dataRows }}</span>\n <input [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" />\n <small class=\"pp__hint\">{{ s.dataRowsHint }}</small>\n </label>\n </section>\n }\n}\n\n<!-- \u2500\u2500 Band \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (band(); as b) {\n <section class=\"pp__section\">\n <h3>{{ s.groupLayout }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.bandHeight }} (mm)</span>\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(b.height)\" (input)=\"setBand('height', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row\">\n <span>{{ s.backgroundColor }}</span>\n <span class=\"pp__color\">\n <input type=\"color\" [value]=\"b.backgroundColor ?? '#ffffff'\" (input)=\"setBand('backgroundColor', $any($event.target).value)\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setBand('backgroundColor', '')\">{{ s.noColor }}</button>\n </span>\n </label>\n </section>\n @if (b.kind === 'subDetail') {\n <section class=\"pp__section\">\n <h3>{{ s.innerList }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.innerListOf }}</span>\n <select (change)=\"setBand('rowsPath', $any($event.target).value)\">\n @for (l of lists(); track l) {\n <option [value]=\"l\" [selected]=\"b.rowsPath === l\">{{ l }}</option>\n }\n @if (b.rowsPath && !lists().includes(b.rowsPath)) {\n <option [value]=\"b.rowsPath\" selected>{{ b.rowsPath }}</option>\n }\n </select>\n </label>\n <small class=\"pp__hint\">{{ s.innerListHint }}</small>\n </section>\n }\n @if (b.kind === 'detail') {\n <section class=\"pp__section\">\n <h3>{{ s.sortRows }}</h3>\n @let key = b.sortBy?.[0];\n <div class=\"pp__grid\">\n <select (change)=\"setSort($any($event.target).value, !!key?.descending)\" [attr.aria-label]=\"s.sortRows\">\n <option value=\"\" [selected]=\"!key\">{{ s.dataOrder }}</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === key?.expression\">{{ f.label }}</option>\n }\n @if (key && !fieldExpressions().has(key.expression)) {\n <option [value]=\"key.expression\" selected>{{ key.expression }}</option>\n }\n </select>\n <select [disabled]=\"!key\" (change)=\"setSort(key?.expression ?? '', $any($event.target).value === 'desc')\" [attr.aria-label]=\"s.sortRows\">\n <option value=\"asc\" [selected]=\"!key?.descending\">{{ s.sortAsc }}</option>\n <option value=\"desc\" [selected]=\"!!key?.descending\">{{ s.sortDesc }}</option>\n </select>\n </div>\n </section>\n <section class=\"pp__section\">\n <h3>{{ s.labelSheet }}</h3>\n <select (change)=\"applyLabelSheet($any($event.target).value); $any($event.target).value = ''\" [attr.aria-label]=\"s.labelSheet\">\n <option value=\"\" selected>{{ s.labelSheetChoose }}</option>\n @for (l of labelSheets; track l.id) {\n <option [value]=\"l.id\">{{ labelSheetName(l) }}</option>\n }\n </select>\n <small class=\"pp__hint\">{{ s.labelSheetHint }}</small>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnsCount }}</span>\n <input type=\"number\" min=\"1\" max=\"12\" step=\"1\" [value]=\"b.columns?.count ?? 1\" (input)=\"setColumns('count', $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnGap }}</span>\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(b.columns?.gap ?? 0)\" (input)=\"setColumns('gap', $any($event.target).value)\" />\n </label>\n </div>\n <small class=\"pp__hint\">{{ s.columnsHint }}</small>\n </section>\n }\n @if (b.kind === 'groupHeader') {\n <section class=\"pp__section\">\n <h3>{{ s.groupBy }}</h3>\n @if (fields().length) {\n <select (change)=\"setBand('groupBy', $any($event.target).value)\">\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === b.groupBy?.expression\">{{ f.label }}</option>\n }\n </select>\n }\n <input class=\"pp__mono\" [value]=\"b.groupBy?.expression ?? ''\" (input)=\"setBand('groupBy', $any($event.target).value)\" spellcheck=\"false\" />\n <label class=\"pp__row\">\n <span>{{ s.sortGroups }}</span>\n <select (change)=\"setBand('sort', $any($event.target).value)\">\n <option value=\"asc\" [selected]=\"!b.sort || b.sort === 'asc'\">{{ s.sortAsc }}</option>\n <option value=\"desc\" [selected]=\"b.sort === 'desc'\">{{ s.sortDesc }}</option>\n <option value=\"none\" [selected]=\"b.sort === 'none'\">{{ s.sortNone }}</option>\n </select>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.keepTogether\" (change)=\"toggleBand('keepTogether', $any($event.target).checked)\" />\n <span>{{ s.keepTogether }}<small class=\"pp__hint\">{{ s.keepTogetherHint }}</small></span>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.repeatOnEveryPage\" (change)=\"toggleBand('repeatOnEveryPage', $any($event.target).checked)\" />\n <span>{{ s.repeatOnEveryPage }}</span>\n </label>\n </section>\n }\n @if (advanced() && b.kind !== 'pageHeader' && b.kind !== 'pageFooter') {\n <section class=\"pp__section\">\n <h3>{{ s.groupBehaviour }}</h3>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakBefore\" (change)=\"toggleBand('pageBreakBefore', $any($event.target).checked)\" />\n <span>{{ s.pageBreakBefore }}</span>\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakAfter\" (change)=\"toggleBand('pageBreakAfter', $any($event.target).checked)\" />\n <span>{{ s.pageBreakAfter }}</span>\n </label>\n </section>\n }\n @if (b.kind !== 'detail') {\n <button type=\"button\" class=\"pp__danger\" (click)=\"removeBand()\">{{ s.removeBand }}</button>\n }\n}\n\n<!-- \u2500\u2500 Control(s) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n@if (controls().length) {\n @let n = controls().length;\n <section class=\"pp__section\">\n <h3>{{ s.arrange }}</h3>\n <div class=\"pp__tools\" role=\"toolbar\" [attr.aria-label]=\"s.arrange\">\n @for (a of alignActions; track a.edge) {\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.align(a.edge)\" [title]=\"s[a.label]\" [attr.aria-label]=\"s[a.label]\" [innerHTML]=\"a.icon | weReportIcon\"></button>\n }\n </div>\n <div class=\"pp__tools\" role=\"toolbar\" [attr.aria-label]=\"s.arrange\">\n <button type=\"button\" [disabled]=\"n < 3\" (click)=\"state.distribute('h')\" [title]=\"s.distributeH\" [attr.aria-label]=\"s.distributeH\" [innerHTML]=\"'distributeH' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 3\" (click)=\"state.distribute('v')\" [title]=\"s.distributeV\" [attr.aria-label]=\"s.distributeV\" [innerHTML]=\"'distributeV' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.sameSize('width')\" [title]=\"s.sameWidth\" [attr.aria-label]=\"s.sameWidth\" [innerHTML]=\"'sameWidth' | weReportIcon\"></button>\n <button type=\"button\" [disabled]=\"n < 2\" (click)=\"state.sameSize('height')\" [title]=\"s.sameHeight\" [attr.aria-label]=\"s.sameHeight\" [innerHTML]=\"'sameHeight' | weReportIcon\"></button>\n <button type=\"button\" (click)=\"state.arrange('front')\" [title]=\"s.bringToFront\" [attr.aria-label]=\"s.bringToFront\" [innerHTML]=\"'bringToFront' | weReportIcon\"></button>\n <button type=\"button\" (click)=\"state.arrange('back')\" [title]=\"s.sendToBack\" [attr.aria-label]=\"s.sendToBack\" [innerHTML]=\"'sendToBack' | weReportIcon\"></button>\n </div>\n @if (n < 2) {\n <small class=\"pp__hint\">{{ s.arrangeHint }}</small>\n }\n </section>\n @if (control(); as c) {\n <!-- Content first: it is what people change most. -->\n @switch (c.type) {\n @case ('text') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" [multiline]=\"true\" (valueChange)=\"setBindable('text', $event)\" />\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"set('format', $any($event.target).value)\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ $any(s)[f.key] }}</option>\n }\n @if (formatIsCustom()) {\n <option [value]=\"c.format\" selected>{{ c.format }}</option>\n }\n </select>\n </label>\n @if (advanced()) {\n <input class=\"pp__mono\" [value]=\"c.format ?? ''\" (input)=\"set('format', $any($event.target).value)\" spellcheck=\"false\" placeholder=\"n2 \u00B7 c2 \u00B7 dd.MM.yyyy\" />\n }\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\n </label>\n </section>\n }\n @case ('barcode') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.symbology }}</span>\n <select (change)=\"set('symbology', $any($event.target).value)\">\n @for (sym of symbologies; track sym) {\n <option [value]=\"sym\" [selected]=\"sym === c.symbology\">{{ sym }}</option>\n }\n @if (!symbologies.includes(c.symbology)) {\n <option [value]=\"c.symbology\" selected>{{ c.symbology }}</option>\n }\n </select>\n </label>\n <span class=\"pp__label\">{{ s.barcodeValue }}</span>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('value', $event)\" />\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"c.showText\" (change)=\"set('showText', $any($event.target).checked)\" />\n <span>{{ s.showText }}</span>\n </label>\n </section>\n }\n @case ('image') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__file\">\n <input type=\"file\" accept=\"image/png,image/jpeg\" (change)=\"chooseImage($event)\" />\n <span>{{ s.chooseImage }}</span>\n </label>\n <span class=\"pp__label\">{{ s.fromData }}</span>\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('source', $event)\" />\n <label class=\"pp__row\">\n <span>{{ s.fit }}</span>\n <select (change)=\"set('fit', $any($event.target).value)\">\n <option value=\"contain\" [selected]=\"c.fit === 'contain'\">{{ s.fitContain }}</option>\n <option value=\"cover\" [selected]=\"c.fit === 'cover'\">{{ s.fitCover }}</option>\n <option value=\"stretch\" [selected]=\"c.fit === 'stretch'\">{{ s.fitStretch }}</option>\n <option value=\"none\" [selected]=\"c.fit === 'none'\">{{ s.fitNone }}</option>\n </select>\n </label>\n </section>\n }\n @case ('line') {\n <section class=\"pp__section\">\n <h3>{{ s.groupAppearance }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.lineDirection }}</span>\n <select (change)=\"set('direction', $any($event.target).value)\">\n <option value=\"horizontal\" [selected]=\"c.direction === 'horizontal'\">{{ s.horizontal }}</option>\n <option value=\"vertical\" [selected]=\"c.direction === 'vertical'\">{{ s.vertical }}</option>\n <option value=\"diagonalDown\" [selected]=\"c.direction === 'diagonalDown'\">{{ s.diagonalDown }}</option>\n <option value=\"diagonalUp\" [selected]=\"c.direction === 'diagonalUp'\">{{ s.diagonalUp }}</option>\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.lineWidth }} (mm)</span>\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(c.lineWidth)\" (input)=\"set('lineWidth', asNumber($any($event.target).value, 0.05))\" />\n </label>\n <label class=\"pp__row\">\n <span>{{ s.color }}</span>\n <input type=\"color\" [value]=\"c.color ?? style()?.color ?? '#000000'\" (input)=\"set('color', $any($event.target).value)\" />\n </label>\n </section>\n }\n @case ('shape') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.shape }}</span>\n <select (change)=\"set('shape', $any($event.target).value)\">\n <option value=\"rectangle\" [selected]=\"c.shape === 'rectangle'\">{{ s.rectangle }}</option>\n <option value=\"roundedRectangle\" [selected]=\"c.shape === 'roundedRectangle'\">{{ s.roundedRectangle }}</option>\n <option value=\"ellipse\" [selected]=\"c.shape === 'ellipse'\">{{ s.ellipse }}</option>\n </select>\n </label>\n @if (c.shape === 'roundedRectangle') {\n <label class=\"pp__row\">\n <span>{{ s.cornerRadius }} (mm)</span>\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.cornerRadius ?? 2)\" (input)=\"set('cornerRadius', asNumber($any($event.target).value, 0))\" />\n </label>\n }\n </section>\n }\n @case ('pageInfo') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <label class=\"pp__row\">\n <span>{{ s.pageInfo }}</span>\n <select (change)=\"set('info', $any($event.target).value)\">\n <option value=\"pageNumber\" [selected]=\"c.info === 'pageNumber'\">{{ s.pageNumber }}</option>\n <option value=\"pageCount\" [selected]=\"c.info === 'pageCount'\">{{ s.pageTotal }}</option>\n <option value=\"pageNofM\" [selected]=\"c.info === 'pageNofM'\">{{ s.pageNofM }}</option>\n <option value=\"printDate\" [selected]=\"c.info === 'printDate'\">{{ s.printDate }}</option>\n </select>\n </label>\n @if (c.info === 'pageNofM' || c.info === 'printDate') {\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.format }}</span>\n <input class=\"pp__mono\" [value]=\"c.format ?? ''\" (input)=\"set('format', $any($event.target).value)\" [placeholder]=\"c.info === 'pageNofM' ? '{0} / {1}' : 'dd.MM.yyyy'\" spellcheck=\"false\" />\n </label>\n }\n </section>\n }\n @case ('table') {\n @let cellInfo = selectedCell();\n <section class=\"pp__section\">\n <h3>{{ s.tableSection }}</h3>\n <small class=\"pp__hint\">{{ s.tableHint }}</small>\n <div class=\"pp__buttons\">\n <button type=\"button\" (click)=\"tableOp('insertRow')\">+ {{ s.addRow }}</button>\n <button type=\"button\" (click)=\"tableOp('insertColumn')\">+ {{ s.addColumn }}</button>\n <button type=\"button\" [disabled]=\"c.rows.length < 2\" (click)=\"tableOp('deleteRow')\">\u2212 {{ s.deleteRow }}</button>\n <button type=\"button\" [disabled]=\"c.columns.length < 2\" (click)=\"tableOp('deleteColumn')\">\u2212 {{ s.deleteColumn }}</button>\n <button type=\"button\" [disabled]=\"!cellInfo || cellInfo.index >= c.rows[cellInfo.row].cells.length - 1\" (click)=\"tableOp('mergeRight')\">{{ s.mergeCells }}</button>\n <button type=\"button\" [disabled]=\"!cellInfo || (cellInfo.cell.colSpan ?? 1) < 2\" (click)=\"tableOp('splitCell')\">{{ s.splitCell }}</button>\n </div>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\n </label>\n </section>\n @if (cellInfo) {\n <section class=\"pp__section\">\n <h3>{{ s.selectedCell }}</h3>\n <we-report-bindable-input [value]=\"cellInfo.cell.text\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setCell({ text: $event })\" />\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"setCell({ format: $any($event.target).value || undefined })\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(cellInfo.cell.format ?? '') === f.value\">{{ s[f.key] }}</option>\n }\n </select>\n </label>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.alignment\">\n @for (a of ['left', 'center', 'right']; track a) {\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"cellAlign(cellInfo.cell) === a\" [class.pp__on]=\"cellAlign(cellInfo.cell) === a\" (click)=\"setCellStyle('textAlign', $any(a))\">\n {{ a === 'left' ? s.alignLeft : a === 'center' ? s.alignCenter : s.alignRight }}\n </button>\n }\n </div>\n <div class=\"pp__rule-then\">\n <button type=\"button\" class=\"pp__chip\" [class.pp__on]=\"cellInfo.cell.styleOverrides?.bold\" (click)=\"setCellStyle('bold', cellInfo.cell.styleOverrides?.bold ? undefined : true)\">{{ s.bold }}</button>\n <span>{{ s.backgroundColor }}</span>\n <input type=\"color\" [value]=\"cellInfo.cell.styleOverrides?.backgroundColor ?? '#ffffff'\" (input)=\"setCellStyle('backgroundColor', $any($event.target).value)\" [attr.aria-label]=\"s.backgroundColor\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setCellStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\n </div>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.columnWidth }}</span>\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(c.columns[cellInfo.column])\" (input)=\"setColumnWidth(cellInfo.column, $any($event.target).value)\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.rowHeight }}</span>\n <input type=\"number\" min=\"2\" step=\"0.5\" [value]=\"num(c.rows[cellInfo.row].height)\" (input)=\"setRowHeight(cellInfo.row, $any($event.target).value)\" />\n </label>\n </div>\n </section>\n }\n }\n @case ('chart') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <small class=\"pp__hint\">{{ s.chartHint }}</small>\n <div class=\"pp__segmented\" role=\"radiogroup\" [attr.aria-label]=\"s.chartType\">\n @for (t of chartTypes; track t.type) {\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"c.chartType === t.type\" [class.pp__on]=\"c.chartType === t.type\" (click)=\"set('chartType', t.type)\">{{ s[t.label] }}</button>\n }\n </div>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartCategory }}</span>\n <select (change)=\"setExpression('category', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!c.category.expression\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === c.category.expression\">{{ f.label }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartValue }}</span>\n <select (change)=\"setExpression('value', $any($event.target).value)\">\n <option value=\"\" [selected]=\"!c.value.expression\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === c.value.expression\">{{ f.label }}</option>\n }\n </select>\n </label>\n @if (advanced()) {\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.expression }}</span>\n <input class=\"pp__mono\" [value]=\"c.category.expression\" (input)=\"setExpression('category', $any($event.target).value)\" spellcheck=\"false\" />\n <input class=\"pp__mono\" [value]=\"c.value.expression\" (input)=\"setExpression('value', $any($event.target).value)\" spellcheck=\"false\" />\n </label>\n }\n <label class=\"pp__row\">\n <span>{{ s.chartAggregate }}</span>\n <select (change)=\"set('aggregate', $any($event.target).value)\">\n @for (a of aggregates; track a.value) {\n <option [value]=\"a.value\" [selected]=\"(c.aggregate ?? 'sum') === a.value\">{{ s[a.label] }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row\">\n <span>{{ s.format }}</span>\n <select (change)=\"set('format', $any($event.target).value)\">\n @for (f of formats; track f.value) {\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ s[f.key] }}</option>\n }\n </select>\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.chartTitle }}</span>\n <input [value]=\"c.title ?? ''\" (input)=\"set('title', $any($event.target).value)\" />\n </label>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.showValues\" (change)=\"set('showValues', $any($event.target).checked || undefined)\" />\n <span>{{ s.showValues }}</span>\n </label>\n @if (c.chartType === 'pie' || c.chartType === 'doughnut') {\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"c.showLegend !== false\" (change)=\"set('showLegend', $any($event.target).checked ? undefined : false)\" />\n <span>{{ s.showLegend }}</span>\n </label>\n }\n </section>\n }\n @case ('checkbox') {\n <section class=\"pp__section\">\n <h3>{{ s.groupContent }}</h3>\n <span class=\"pp__label\">{{ s.checked }}</span>\n <we-report-bindable-input [value]=\"checkedValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('checked', $event)\" />\n </section>\n }\n }\n\n <section class=\"pp__section\">\n <h3>{{ s.conditionalFormatting }}</h3>\n @for (rule of c.formatting ?? []; track $index; let i = $index) {\n @let cond = condition(rule.when);\n <div class=\"pp__rule\">\n <div class=\"pp__rule-head\">\n <span>{{ s.ruleWhen }}</span>\n <button type=\"button\" class=\"pp__link\" (click)=\"removeRule(i)\" [title]=\"s.removeRule\" [attr.aria-label]=\"s.removeRule\">\u2715</button>\n </div>\n @if (cond) {\n <div class=\"pp__rule-when\">\n <select (change)=\"setCondition(i, cond, 'field', $any($event.target).value)\" [attr.aria-label]=\"s.ruleWhen\">\n <option value=\"\" [selected]=\"!cond.field\">\u2014</option>\n @for (f of fields(); track f.expression) {\n <option [value]=\"f.expression\" [selected]=\"f.expression === cond.field\">{{ f.label }}</option>\n }\n </select>\n <select (change)=\"setCondition(i, cond, 'op', $any($event.target).value)\">\n @for (o of conditionOps; track o.op) {\n <option [value]=\"o.op\" [selected]=\"o.op === cond.op\">{{ o.op === 'contains' ? s.opContains : o.label }}</option>\n }\n </select>\n <input [value]=\"cond.value\" (input)=\"setCondition(i, cond, 'value', $any($event.target).value)\" [placeholder]=\"s.ruleValue\" [attr.aria-label]=\"s.ruleValue\" />\n </div>\n }\n @if (advanced() || !cond) {\n <input class=\"pp__mono\" [value]=\"rule.when\" (input)=\"setRule(i, { when: $any($event.target).value })\" spellcheck=\"false\" />\n }\n <div class=\"pp__rule-then\">\n <span>{{ s.ruleThen }}</span>\n <input type=\"color\" [value]=\"rule.style.color ?? '#000000'\" (input)=\"setRuleStyle(i, 'color', $any($event.target).value)\" [title]=\"s.textColor\" [attr.aria-label]=\"s.textColor\" />\n <input type=\"color\" [value]=\"rule.style.backgroundColor ?? '#ffffff'\" (input)=\"setRuleStyle(i, 'backgroundColor', $any($event.target).value)\" [title]=\"s.backgroundColor\" [attr.aria-label]=\"s.backgroundColor\" />\n <button type=\"button\" class=\"pp__chip\" [class.pp__on]=\"rule.style.bold\" (click)=\"setRuleStyle(i, 'bold', rule.style.bold ? undefined : true)\">{{ s.bold }}</button>\n </div>\n </div>\n } @empty {\n <small class=\"pp__hint\">{{ s.conditionalHint }}</small>\n }\n <button type=\"button\" class=\"pp__link\" (click)=\"addRule()\">+ {{ s.addRule }}</button>\n </section>\n\n <section class=\"pp__section\">\n <h3>{{ s.groupLayout }}</h3>\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\"><span>{{ s.left }}</span><input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.x)\" (input)=\"setGeometry('x', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.top }}</span><input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.y)\" (input)=\"setGeometry('y', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.width }}</span><input type=\"number\" min=\"0.5\" step=\"0.5\" [value]=\"num(c.width)\" (input)=\"setGeometry('width', $any($event.target).value)\" /></label>\n <label class=\"pp__row pp__row--stack\"><span>{{ s.height }}</span><input type=\"number\" min=\"0.5\" step=\"0.5\" [value]=\"num(c.height)\" (input)=\"setGeometry('height', $any($event.target).value)\" /></label>\n </div>\n </section>\n }\n\n <!-- Appearance applies to every selected control at once. -->\n @if (style(); as st) {\n @if (hasText()) {\n <section class=\"pp__section\">\n <h3>{{ s.groupAppearance }}</h3>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.font }}</span>\n <select (change)=\"setStyle('fontFamily', $any($event.target).value)\">\n @for (f of fontFamilies(); track f) {\n <option [value]=\"f\" [selected]=\"f === st.fontFamily\">{{ f }}</option>\n }\n @if (!fontFamilies().includes(st.fontFamily)) {\n <option [value]=\"st.fontFamily\" selected>{{ st.fontFamily }}</option>\n }\n </select>\n </label>\n <div class=\"pp__row\">\n <span>{{ s.fontSize }} (pt)</span>\n <input type=\"number\" min=\"4\" max=\"200\" step=\"0.5\" [value]=\"num(st.fontSize)\" (input)=\"setStyle('fontSize', asNumber($any($event.target).value, 4))\" />\n </div>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.bold\" (click)=\"setStyle('bold', !st.bold)\" [attr.aria-pressed]=\"st.bold\"><b>{{ s.bold }}</b></button>\n <button type=\"button\" [class.pp__on]=\"st.italic\" (click)=\"setStyle('italic', !st.italic)\" [attr.aria-pressed]=\"st.italic\"><i>{{ s.italic }}</i></button>\n <button type=\"button\" [class.pp__on]=\"st.underline\" (click)=\"setStyle('underline', !st.underline)\" [attr.aria-pressed]=\"st.underline\"><u>{{ s.underline }}</u></button>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.alignment }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'left'\" (click)=\"setStyle('textAlign', 'left')\">{{ s.alignLeft }}</button>\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'center'\" (click)=\"setStyle('textAlign', 'center')\">{{ s.alignCenter }}</button>\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'right'\" (click)=\"setStyle('textAlign', 'right')\">{{ s.alignRight }}</button>\n </div>\n </div>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.verticalAlignment }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'top'\" (click)=\"setStyle('verticalAlign', 'top')\">{{ s.alignTop }}</button>\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'middle'\" (click)=\"setStyle('verticalAlign', 'middle')\">{{ s.alignMiddle }}</button>\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'bottom'\" (click)=\"setStyle('verticalAlign', 'bottom')\">{{ s.alignBottom }}</button>\n </div>\n </div>\n <label class=\"pp__row\">\n <span>{{ s.textColor }}</span>\n <input type=\"color\" [value]=\"st.color\" (input)=\"setStyle('color', $any($event.target).value)\" />\n </label>\n </section>\n }\n @if (control()?.type !== 'line') {\n <section class=\"pp__section\">\n @if (!hasText()) {\n <h3>{{ s.groupAppearance }}</h3>\n }\n <label class=\"pp__row\">\n <span>{{ s.backgroundColor }}</span>\n <span class=\"pp__color\">\n <input type=\"color\" [value]=\"st.backgroundColor ?? '#ffffff'\" (input)=\"setStyle('backgroundColor', $any($event.target).value)\" />\n <button type=\"button\" class=\"pp__link\" (click)=\"setStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\n </span>\n </label>\n <div class=\"pp__row pp__row--stack\">\n <span>{{ s.border }}</span>\n <div class=\"pp__segmented\">\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.top\" (click)=\"toggleBorderSide('top', !st.border?.sides?.top)\">{{ s.marginTop }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.right\" (click)=\"toggleBorderSide('right', !st.border?.sides?.right)\">{{ s.marginRight }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.bottom\" (click)=\"toggleBorderSide('bottom', !st.border?.sides?.bottom)\">{{ s.marginBottom }}</button>\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.left\" (click)=\"toggleBorderSide('left', !st.border?.sides?.left)\">{{ s.marginLeft }}</button>\n </div>\n </div>\n @if (st.border) {\n <div class=\"pp__grid\">\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.borderWidth }}</span>\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(st.border.width)\" (input)=\"setBorder({ width: asNumber($any($event.target).value, 0.05) })\" />\n </label>\n <label class=\"pp__row pp__row--stack\">\n <span>{{ s.borderColor }}</span>\n <input type=\"color\" [value]=\"st.border.color\" (input)=\"setBorder({ color: $any($event.target).value })\" />\n </label>\n </div>\n }\n @if (advanced() && hasText()) {\n <label class=\"pp__row\">\n <span>{{ s.padding }} (mm)</span>\n <input type=\"number\" min=\"0\" step=\"0.1\" [value]=\"num(st.padding)\" (input)=\"setStyle('padding', asNumber($any($event.target).value, 0))\" />\n </label>\n }\n </section>\n }\n }\n\n @if (advanced() && control(); as c) {\n <section class=\"pp__section\">\n <h3>{{ s.groupBehaviour }}</h3>\n <span class=\"pp__label\">{{ s.visibleWhen }}</span>\n <input class=\"pp__mono\" [value]=\"$any(visibleValue(c)).expression ?? ''\" (input)=\"setVisible({ expression: $any($event.target).value })\" spellcheck=\"false\" placeholder=\"[Total] > 0\" />\n <small class=\"pp__hint\">{{ s.visibleWhenHint }}</small>\n <label class=\"pp__check\">\n <input type=\"checkbox\" [checked]=\"!!c.stretch\" (change)=\"set('stretch', $any($event.target).checked || undefined)\" />\n <span>{{ s.stretch }}<small class=\"pp__hint\">{{ s.stretchHint }}</small></span>\n </label>\n </section>\n }\n}\n", styles: [":host{display:block;padding:14px 14px 32px;font-size:12.5px;color:var(--we-report-fg, #1d1d1f)}.pp__title{margin:0;font-size:15px;font-weight:600;letter-spacing:-.01em}.pp__subtitle{margin-top:2px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__subtitle code{font-size:11px}.pp__section{display:flex;flex-direction:column;gap:10px;padding:14px 0;border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.pp__section:last-of-type{border-bottom:0}.pp__section h3{margin:0;font-size:12px;font-weight:600;color:var(--we-report-fg, #1d1d1f)}.pp__row{display:flex;align-items:center;justify-content:space-between;gap:10px}.pp__row>span:first-child{flex:1;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__row input[type=number]{width:76px;text-align:right;font-variant-numeric:tabular-nums}.pp__row select{width:auto;max-width:60%}.pp__row--stack{flex-direction:column;align-items:stretch;gap:4px}.pp__row--stack>span:first-child{font-size:11.5px}.pp__row--stack input[type=number]{width:100%;text-align:left}.pp__row--stack select{max-width:none;width:100%}.pp__grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.pp__grid--4{grid-template-columns:repeat(4,1fr)}.pp__grid--4 label{display:flex;flex-direction:column;gap:3px;text-align:center}.pp__grid--4 label small{font-size:10.5px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__grid--4 label input{text-align:center!important}input:not([type=checkbox]):not([type=color]):not([type=file]),select,textarea{width:100%;box-sizing:border-box;font:inherit;padding:5px 8px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;transition:box-shadow .15s ease}input:not([type=checkbox]):not([type=color]):not([type=file]):focus,select:focus,textarea:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}input[type=checkbox]{accent-color:var(--we-report-accent, #007aff);width:14px;height:14px}input[type=color]{width:26px;height:26px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer;box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14))}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:0;border-radius:50%}input[type=color]::-moz-color-swatch{border:0;border-radius:50%}.pp__mono{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace!important;font-size:12px!important}.pp__label{font-weight:500}.pp__hint{display:block;margin-top:2px;font-size:11px;line-height:1.35;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__check{display:flex;align-items:flex-start;gap:8px;cursor:pointer}.pp__check input{margin-top:2px}.pp__segmented{display:flex;padding:2px;gap:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.pp__segmented button{flex:1;border:0;border-radius:6px;padding:4px;font:inherit;font-size:12px;background:transparent;color:inherit;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease}.pp__segmented button.pp__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.pp__segmented button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.pp__tools{display:flex;gap:2px;padding:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.pp__tools button{flex:1;display:inline-flex;align-items:center;justify-content:center;height:26px;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer}.pp__tools button :is(svg){width:16px;height:16px}.pp__tools button:hover:not(:disabled){background:var(--we-report-segment-on-bg, #fff);box-shadow:0 1px 2px #0000001a}.pp__tools button:disabled{opacity:.3;cursor:default}.pp__tools button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.pp__buttons{display:grid;grid-template-columns:1fr 1fr;gap:4px}.pp__buttons button{border:0;border-radius:var(--we-report-control-radius, 7px);padding:5px 6px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12));color:inherit;font:inherit;font-size:12px;cursor:pointer}.pp__buttons button:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .2))}.pp__buttons button:disabled{opacity:.4;cursor:default}.pp__rule{display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:10px;background:var(--we-report-workspace-bg, #f2f2f7)}.pp__rule-head,.pp__rule-then{display:flex;align-items:center;gap:8px}.pp__rule-head>span,.pp__rule-then>span{flex:1;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.pp__rule-when{display:grid;grid-template-columns:1fr 54px 1fr;gap:4px}.pp__chip{border:0;border-radius:999px;padding:3px 10px;font:inherit;font-size:11.5px;font-weight:700;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12));color:inherit;cursor:pointer}.pp__chip.pp__on{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.pp__color{display:inline-flex;align-items:center;gap:8px}.pp__link{border:0;background:none;padding:0;font:inherit;color:var(--we-report-accent, #007aff);cursor:pointer}.pp__file{position:relative;display:block;padding:10px;border-radius:10px;border:1px dashed var(--we-report-accent, #007aff);background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff);font-weight:500;text-align:center;cursor:pointer}.pp__file input{position:absolute;inset:0;opacity:0;cursor:pointer}.pp__danger{margin-top:14px;width:100%;padding:7px;border:0;border-radius:8px;background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000);font:inherit;font-weight:500;cursor:pointer}@media (prefers-reduced-motion: reduce){input,select,textarea,.pp__segmented button{transition:none}}\n"] }]
|
|
4512
5657
|
}] });
|
|
4513
5658
|
function positive(value, min) {
|
|
4514
5659
|
const n = Number(String(value).replace(',', '.'));
|
|
@@ -5187,6 +6332,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
5187
6332
|
args: [{ selector: 'we-report-data-sources-dialog', standalone: true, imports: [DatabaseSourceEditorComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let s = strings();\n<div class=\"dsd__backdrop\" (click)=\"closed.emit()\"></div>\n<div class=\"dsd\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"s.dataSources\">\n <header class=\"dsd__head\">\n <h2>{{ s.dataSources }}</h2>\n <button type=\"button\" class=\"dsd__close\" (click)=\"closed.emit()\" [attr.aria-label]=\"s.close\">\u00D7</button>\n </header>\n\n <div class=\"dsd__body\">\n <nav class=\"dsd__list\">\n @for (src of report().dataSources; track src.id) {\n <button type=\"button\" class=\"dsd__item\" [class.dsd__item--on]=\"src.id === source()?.id\" (click)=\"select(src.id)\">\n <span>{{ src.name }}</span>\n <small>{{ kindLabel(src) }}@if (report().dataMember?.dataSourceId === src.id) { \u00B7 {{ s.rowsSource }} }</small>\n </button>\n } @empty {\n <p class=\"dsd__hint\">{{ s.noSources }}</p>\n }\n <div class=\"dsd__add\">\n <button type=\"button\" (click)=\"add('json')\">+ JSON</button>\n <button type=\"button\" (click)=\"add('csv')\">+ CSV / Excel</button>\n <button type=\"button\" (click)=\"add('webService')\">+ {{ s.webService }}</button>\n <button type=\"button\" (click)=\"add('database')\">+ {{ s.database }}</button>\n </div>\n\n <h3>{{ s.parameters }}</h3>\n <p class=\"dsd__hint\">{{ s.parametersHint }}</p>\n @for (p of report().parameters ?? []; track $index; let i = $index) {\n <div class=\"dsd__param\">\n <input [value]=\"p.name\" (input)=\"setParameter(i, 'name', $any($event.target).value)\" [attr.aria-label]=\"s.parameterName\" spellcheck=\"false\" />\n <select (change)=\"setParameter(i, 'type', $any($event.target).value)\" [attr.aria-label]=\"s.parameterType\">\n @for (t of types; track t) {\n <option [value]=\"t\" [selected]=\"t === p.type\">{{ typeLabel(t) }}</option>\n }\n </select>\n <input [value]=\"p.label ?? ''\" (input)=\"setParameter(i, 'label', $any($event.target).value)\" [placeholder]=\"s.parameterLabel\" />\n <input [value]=\"p.defaultValue ?? ''\" (input)=\"setParameter(i, 'defaultValue', $any($event.target).value)\" [placeholder]=\"s.defaultValue\" />\n <button type=\"button\" class=\"dsd__icon\" (click)=\"removeParameter(i)\" [attr.aria-label]=\"s.delete\">\u00D7</button>\n <code class=\"dsd__use\">[?{{ p.name }}] \u00B7 {{ '{{' }}{{ p.name }}{{ '}}' }}</code>\n </div>\n }\n <button type=\"button\" class=\"dsd__link\" (click)=\"addParameter()\">+ {{ s.addParameter }}</button>\n </nav>\n\n <section class=\"dsd__editor\">\n @if (source(); as src) {\n <label class=\"dsd__field\">\n <span>{{ s.sourceName }}</span>\n <input [value]=\"src.name\" (input)=\"setName($any($event.target).value)\" />\n </label>\n\n <div class=\"dsd__rows\">\n @if (isMain()) {\n <label class=\"dsd__field\">\n <span>{{ s.dataRows }}</span>\n <input list=\"dsd-paths\" [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" [placeholder]=\"s.wholeData\" />\n <datalist id=\"dsd-paths\">\n @for (p of listPaths(); track p) {\n <option [value]=\"p\"></option>\n }\n </datalist>\n <small class=\"dsd__hint\">{{ s.dataRowsHint }} \u00B7 {{ s.rowCount.replace('{0}', '' + rowCount()) }}</small>\n </label>\n } @else {\n <button type=\"button\" class=\"dsd__link\" (click)=\"useForRows()\">{{ s.useForRows }}</button>\n }\n </div>\n\n @switch (src.kind) {\n @case ('json') {\n <label class=\"dsd__field dsd__grow\">\n <span>{{ s.jsonData }}</span>\n <textarea spellcheck=\"false\" [value]=\"jsonText(src)\" (change)=\"setJson($any($event.target).value)\"></textarea>\n </label>\n @if (jsonError(); as err) {\n <p class=\"dsd__error\">{{ err }}</p>\n }\n }\n @case ('csv') {\n <label class=\"dsd__field dsd__grow\">\n <span>{{ s.csvData }}</span>\n <textarea spellcheck=\"false\" [value]=\"src.text\" (input)=\"setCsv($any($event.target).value)\"></textarea>\n <small class=\"dsd__hint\">{{ s.rowCount.replace('{0}', '' + csvRows(src)) }}</small>\n </label>\n }\n @case ('webService') {\n @let w = web(src)!;\n <div class=\"dsd__inline\">\n <select (change)=\"setWeb('method', $any($event.target).value)\" [attr.aria-label]=\"s.method\">\n <option value=\"GET\" [selected]=\"(w.method ?? 'GET') === 'GET'\">GET</option>\n <option value=\"POST\" [selected]=\"w.method === 'POST'\">POST</option>\n </select>\n <input class=\"dsd__url\" [value]=\"w.url\" (input)=\"setWeb('url', $any($event.target).value)\" [attr.aria-label]=\"s.url\" spellcheck=\"false\" placeholder=\"https://api.example.com/orders?from={{ '{{' }}from{{ '}}' }}\" />\n <button type=\"button\" class=\"dsd__primary\" (click)=\"test()\" [disabled]=\"testing()\">{{ testing() ? s.testing : s.test }}</button>\n </div>\n @if (testResult(); as r) {\n <p [class.dsd__ok]=\"r.ok\" [class.dsd__error]=\"!r.ok\">{{ r.message }}</p>\n }\n <div class=\"dsd__field\">\n <span>{{ s.headers }}</span>\n @for (h of w.headers ?? []; track $index; let i = $index) {\n <div class=\"dsd__inline\">\n <input [value]=\"h.name\" (input)=\"setHeader(i, 'name', $any($event.target).value)\" placeholder=\"Authorization\" [attr.aria-label]=\"s.headerName\" />\n <input [value]=\"h.value\" (input)=\"setHeader(i, 'value', $any($event.target).value)\" placeholder=\"Bearer {{ '{{' }}token{{ '}}' }}\" [attr.aria-label]=\"s.headerValue\" />\n <button type=\"button\" class=\"dsd__icon\" (click)=\"removeHeader(i)\" [attr.aria-label]=\"s.delete\">\u00D7</button>\n </div>\n }\n <button type=\"button\" class=\"dsd__link\" (click)=\"addHeader()\">+ {{ s.addHeader }}</button>\n </div>\n @if (w.method === 'POST') {\n <label class=\"dsd__field\">\n <span>{{ s.requestBody }}</span>\n <textarea spellcheck=\"false\" rows=\"4\" [value]=\"w.body ?? ''\" (input)=\"setWeb('body', $any($event.target).value)\"></textarea>\n </label>\n }\n <label class=\"dsd__check\">\n <input type=\"checkbox\" [checked]=\"w.via === 'backend'\" (change)=\"setWeb('via', $any($event.target).checked ? 'backend' : '')\" />\n <span>{{ s.viaBackend }}<small class=\"dsd__hint\">{{ s.viaBackendHint }}</small></span>\n </label>\n <p class=\"dsd__warning\">{{ s.secretWarning }}</p>\n }\n @case ('database') {\n <we-report-database-source-editor\n [source]=\"db(src)!\"\n [parameters]=\"report().parameters ?? []\"\n [strings]=\"s\"\n [fetchFn]=\"fetchFn()\"\n (edit)=\"applyDbEdit($event)\"\n />\n }\n }\n <button type=\"button\" class=\"dsd__danger\" (click)=\"remove()\">{{ s.removeSource }}</button>\n } @else {\n <p class=\"dsd__hint\">{{ s.noSources }}</p>\n }\n </section>\n </div>\n</div>\n", styles: [":host{font-family:var(--we-report-font-family, system-ui, sans-serif);font-size:13px;letter-spacing:-.003em}.dsd__backdrop{position:fixed;inset:0;z-index:100;background:var(--we-report-backdrop, rgba(0, 0, 0, .22));animation:dsd-fade .18s ease-out}.dsd{position:fixed;top:50%;left:50%;z-index:101;transform:translate(-50%,-50%);display:flex;flex-direction:column;width:min(960px,100vw - 32px);height:min(680px,100vh - 32px);border-radius:14px;background:var(--we-report-panel-bg, #fbfbfd);color:var(--we-report-fg, #1d1d1f);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14));overflow:hidden;animation:dsd-pop .2s ease-out}@keyframes dsd-fade{0%{opacity:0}}@keyframes dsd-pop{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}}@media (prefers-reduced-motion: reduce){.dsd__backdrop,.dsd{animation:none}input,select,textarea,button{transition:none!important}}.dsd__head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.dsd__head h2{margin:0;font-size:15px;font-weight:600}.dsd__close{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:0;border-radius:50%;background:var(--we-report-hover-bg, rgba(118, 118, 128, .12));font-size:17px;line-height:1;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));cursor:pointer}.dsd__body{flex:1;display:grid;grid-template-columns:330px minmax(0,1fr);min-height:0}.dsd__list{display:flex;flex-direction:column;gap:4px;padding:12px;overflow:auto;background:var(--we-report-workspace-bg, #f2f2f7);border-right:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.dsd__list h3{margin:16px 4px 2px;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.dsd__item{display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:7px 10px;border:0;border-radius:8px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsd__item:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.dsd__item small{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.dsd__item--on,.dsd__item--on:hover{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.dsd__item--on small,.dsd__item--on:hover small{color:inherit;opacity:.8}.dsd__add{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:6px}.dsd__add button{padding:7px 8px;border:0;border-radius:8px;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff);font:inherit;font-weight:500;cursor:pointer}.dsd__add button:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.dsd__param{display:grid;grid-template-columns:1fr 90px 26px;gap:4px;padding:8px;border-radius:10px;background:var(--we-report-panel-bg, #fbfbfd);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14))}.dsd__param input:nth-of-type(2),.dsd__param input:nth-of-type(3){grid-column:1/3}.dsd__use{grid-column:1/-1;font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.dsd__editor{display:flex;flex-direction:column;gap:12px;padding:16px 20px;overflow:auto}.dsd__field{display:flex;flex-direction:column;gap:4px}.dsd__field>span{font-weight:500}.dsd__grow{flex:1}.dsd__grow textarea{flex:1;min-height:240px}.dsd__inline{display:flex;gap:6px;align-items:center}.dsd__inline input{flex:1}.dsd__url{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}input,select,textarea{box-sizing:border-box;font:inherit;padding:6px 9px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;min-width:0;transition:box-shadow .15s ease}input:focus,select:focus,textarea:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}input[type=checkbox]{accent-color:var(--we-report-accent, #007aff)}textarea{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-size:12px}button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.dsd__hint{margin:0;font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.dsd__link{align-self:flex-start;border:0;padding:0;background:none;color:var(--we-report-accent, #007aff);font:inherit;cursor:pointer}.dsd__icon{border:0;border-radius:6px;background:transparent;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));cursor:pointer}.dsd__icon:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.dsd__primary{padding:6px 16px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff);font:inherit;font-weight:500;cursor:pointer}.dsd__primary:disabled{opacity:.4;cursor:default}.dsd__ok,.dsd__error,.dsd__warning{margin:0;padding:8px 12px;border-radius:10px;font-size:12px}.dsd__ok{background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff)}.dsd__error,.dsd__warning{background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000)}.dsd__danger{align-self:flex-start;margin-top:auto;padding:7px 14px;border:0;border-radius:8px;background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000);font:inherit;font-weight:500;cursor:pointer}.dsd__check{display:flex;align-items:flex-start;gap:6px;cursor:pointer}.dsd__check small{display:block}\n"] }]
|
|
5188
6333
|
}] });
|
|
5189
6334
|
|
|
6335
|
+
const WIDTH_KEY = 'we-report-designer.panels';
|
|
6336
|
+
/** Panel widths, zoom and grid are a per-browser convenience; storage may be unavailable. */
|
|
6337
|
+
function readSaved(key, fallback, valid) {
|
|
6338
|
+
try {
|
|
6339
|
+
const saved = JSON.parse(localStorage.getItem(WIDTH_KEY) ?? '{}')[key];
|
|
6340
|
+
return valid(saved) ? saved : fallback;
|
|
6341
|
+
}
|
|
6342
|
+
catch {
|
|
6343
|
+
return fallback;
|
|
6344
|
+
}
|
|
6345
|
+
}
|
|
6346
|
+
function writeSaved(values) {
|
|
6347
|
+
try {
|
|
6348
|
+
const all = JSON.parse(localStorage.getItem(WIDTH_KEY) ?? '{}');
|
|
6349
|
+
localStorage.setItem(WIDTH_KEY, JSON.stringify({ ...all, ...values }));
|
|
6350
|
+
}
|
|
6351
|
+
catch {
|
|
6352
|
+
/* not remembered */
|
|
6353
|
+
}
|
|
6354
|
+
}
|
|
6355
|
+
let designerCount = 0;
|
|
6356
|
+
const isWidth = (v) => typeof v === 'number' && (v === 0 || (v >= 160 && v <= 480));
|
|
5190
6357
|
const BAND_ORDER = {
|
|
5191
6358
|
pageHeader: 0,
|
|
5192
6359
|
reportHeader: 1,
|
|
@@ -5224,7 +6391,7 @@ class WeReportDesignerComponent {
|
|
|
5224
6391
|
toolbox = TOOLBOX_ITEMS;
|
|
5225
6392
|
tab = signal('design');
|
|
5226
6393
|
advanced = signal(false);
|
|
5227
|
-
zoomLevel = signal(1);
|
|
6394
|
+
zoomLevel = signal(readSaved('zoom', 1, (v) => typeof v === 'number' && v >= 0.3 && v <= 3));
|
|
5228
6395
|
fontFamilies = signal([]);
|
|
5229
6396
|
bandMenuOpen = signal(false);
|
|
5230
6397
|
dataDialogOpen = signal(false);
|
|
@@ -5233,17 +6400,155 @@ class WeReportDesignerComponent {
|
|
|
5233
6400
|
/** Right-click menu: screen position and the band it was opened on. */
|
|
5234
6401
|
contextMenu = signal(null);
|
|
5235
6402
|
canvas = viewChild('canvas');
|
|
6403
|
+
host = inject(ElementRef);
|
|
6404
|
+
surface = viewChild(DesignSurfaceComponent);
|
|
6405
|
+
shortcutsOpen = signal(false);
|
|
6406
|
+
/** Side panel widths in px; 0 hides a panel. Remembered in this browser. */
|
|
6407
|
+
leftWidth = signal(readSaved('left', 232, isWidth));
|
|
6408
|
+
rightWidth = signal(readSaved('right', 288, isWidth));
|
|
6409
|
+
fontSizes = [6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 72];
|
|
6410
|
+
textAligns = [
|
|
6411
|
+
{ value: 'left', icon: 'textLeft', label: 'alignLeft' },
|
|
6412
|
+
{ value: 'center', icon: 'textCenter', label: 'alignCenter' },
|
|
6413
|
+
{ value: 'right', icon: 'textRight', label: 'alignRight' },
|
|
6414
|
+
{ value: 'justify', icon: 'textJustify', label: 'alignJustify' },
|
|
6415
|
+
];
|
|
6416
|
+
/** The look of the first selected item (or the clicked table cell), shown in the format bar. */
|
|
6417
|
+
formatStyle = computed(() => {
|
|
6418
|
+
const c = this.state.selectedControls()[0];
|
|
6419
|
+
if (!c)
|
|
6420
|
+
return null;
|
|
6421
|
+
const cell = this.state.tableCell();
|
|
6422
|
+
const cellOverrides = c.type === 'table' && cell?.controlId === c.id ? c.rows[cell.row]?.cells[cell.cell]?.styleOverrides : undefined;
|
|
6423
|
+
return resolveStyle(this.state.report(), c.style, { ...c.styleOverrides, ...cellOverrides });
|
|
6424
|
+
});
|
|
6425
|
+
/** One line about the selection for the status bar. */
|
|
6426
|
+
selectionInfo = computed(() => {
|
|
6427
|
+
const s = this.strings();
|
|
6428
|
+
const controls = this.state.selectedControls();
|
|
6429
|
+
if (controls.length === 1) {
|
|
6430
|
+
const c = controls[0];
|
|
6431
|
+
return { title: `${s.controlNames[c.type]} · ${c.name || c.id}`, box: c };
|
|
6432
|
+
}
|
|
6433
|
+
if (controls.length > 1)
|
|
6434
|
+
return { title: s.itemsSelected.replace('{0}', String(controls.length)), box: null };
|
|
6435
|
+
const band = this.state.selectedBand();
|
|
6436
|
+
if (band)
|
|
6437
|
+
return { title: s.bandNames[band.kind], box: { x: 0, y: 0, width: resolvePageGeometry(this.state.report().page).contentWidth, height: band.height } };
|
|
6438
|
+
return { title: s.noSelection, box: null };
|
|
6439
|
+
});
|
|
6440
|
+
pointerInfo = computed(() => {
|
|
6441
|
+
const p = this.state.pointer();
|
|
6442
|
+
const band = p && this.state.report().bands.find((b) => b.id === p.bandId);
|
|
6443
|
+
return p && band ? `${this.strings().bandNames[band.kind]} · ${this.mm(p.x)} × ${this.mm(p.y)} mm` : '';
|
|
6444
|
+
});
|
|
6445
|
+
mm(v) {
|
|
6446
|
+
return String(Math.round(v * 10) / 10);
|
|
6447
|
+
}
|
|
6448
|
+
/** Where a click-added item goes: the selected section, the selected item's section, else the detail rows. */
|
|
6449
|
+
targetBand() {
|
|
6450
|
+
const bands = this.state.report().bands;
|
|
6451
|
+
const sel = this.state.selection();
|
|
6452
|
+
if (sel.kind === 'band')
|
|
6453
|
+
return bands.find((b) => b.id === sel.id);
|
|
6454
|
+
if (sel.kind === 'controls')
|
|
6455
|
+
return this.state.findBandOf(sel.ids[0]);
|
|
6456
|
+
return bands.find((b) => b.kind === 'detail') ?? bands[0];
|
|
6457
|
+
}
|
|
6458
|
+
/** Adds a toolbox item or a field without dragging: under (or, for rows, beside) what is there. */
|
|
6459
|
+
addByClick(data) {
|
|
6460
|
+
const band = this.targetBand();
|
|
6461
|
+
const surface = this.surface();
|
|
6462
|
+
if (!band || !surface)
|
|
6463
|
+
return;
|
|
6464
|
+
const width = resolvePageGeometry(this.state.report().page).contentWidth;
|
|
6465
|
+
const right = Math.max(0, ...band.controls.map((c) => c.x + c.width));
|
|
6466
|
+
const bottom = Math.max(0, ...band.controls.map((c) => c.y + c.height));
|
|
6467
|
+
// Detail rows grow sideways (a new column); other sections grow downwards.
|
|
6468
|
+
const beside = band.kind === 'detail' && data.kind === 'field' && right + 42 <= width;
|
|
6469
|
+
surface.dropAt(data, band, beside ? Math.round(right + 2) : 0, beside ? 0 : Math.round(bottom + (band.controls.length ? 1 : 0)));
|
|
6470
|
+
}
|
|
6471
|
+
onToolClick(item) {
|
|
6472
|
+
this.addByClick({ kind: 'control', type: item.type, variant: item.variant });
|
|
6473
|
+
}
|
|
6474
|
+
onFieldDblClick(field) {
|
|
6475
|
+
this.addByClick({ kind: 'field', path: field.path, parent: field.parent, format: formatFor({ name: field.path, type: field.type }) });
|
|
6476
|
+
}
|
|
6477
|
+
/** Dragging a panel edge; a double-click hides the panel or brings it back. */
|
|
6478
|
+
startResize(e, side) {
|
|
6479
|
+
e.preventDefault();
|
|
6480
|
+
const target = side === 'left' ? this.leftWidth : this.rightWidth;
|
|
6481
|
+
const start = e.clientX;
|
|
6482
|
+
const from = target();
|
|
6483
|
+
const move = (m) => {
|
|
6484
|
+
const delta = side === 'left' ? m.clientX - start : start - m.clientX;
|
|
6485
|
+
target.set(Math.round(Math.min(480, Math.max(160, from + delta))));
|
|
6486
|
+
};
|
|
6487
|
+
const up = () => {
|
|
6488
|
+
document.removeEventListener('pointermove', move);
|
|
6489
|
+
document.removeEventListener('pointerup', up);
|
|
6490
|
+
writeSaved({ [side]: target() });
|
|
6491
|
+
};
|
|
6492
|
+
document.addEventListener('pointermove', move);
|
|
6493
|
+
document.addEventListener('pointerup', up);
|
|
6494
|
+
}
|
|
6495
|
+
togglePanel(side) {
|
|
6496
|
+
const target = side === 'left' ? this.leftWidth : this.rightWidth;
|
|
6497
|
+
target.set(target() ? 0 : side === 'left' ? 232 : 288);
|
|
6498
|
+
writeSaved({ [side]: target() });
|
|
6499
|
+
}
|
|
6500
|
+
editSelected() {
|
|
6501
|
+
const c = this.state.selectedControls()[0];
|
|
6502
|
+
if (c)
|
|
6503
|
+
this.surface()?.startEditing(c);
|
|
6504
|
+
}
|
|
6505
|
+
format(key, value) {
|
|
6506
|
+
this.state.applyStyle(key, value);
|
|
6507
|
+
}
|
|
6508
|
+
typeStartsEditing() {
|
|
6509
|
+
const controls = this.state.selectedControls();
|
|
6510
|
+
const c = controls.length === 1 ? controls[0] : undefined;
|
|
6511
|
+
return c?.type === 'text' && !isExpression(c.text);
|
|
6512
|
+
}
|
|
6513
|
+
toggleFormat(key) {
|
|
6514
|
+
if (!this.formatStyle())
|
|
6515
|
+
return;
|
|
6516
|
+
this.state.applyStyle(key, !this.formatStyle()[key]);
|
|
6517
|
+
}
|
|
6518
|
+
togglePainter() {
|
|
6519
|
+
const c = this.state.selectedControls()[0];
|
|
6520
|
+
this.state.painter.set(this.state.painter() || !c ? null : { style: c.style, styleOverrides: structuredClone(c.styleOverrides) });
|
|
6521
|
+
}
|
|
6522
|
+
setBorder(on) {
|
|
6523
|
+
const st = this.formatStyle();
|
|
6524
|
+
this.state.applyStyle('border', on ? { width: 0.25, color: st?.color ?? '#000000', sides: { top: true, right: true, bottom: true, left: true } } : undefined);
|
|
6525
|
+
}
|
|
5236
6526
|
/** Design problems, checked on every edit; field names are judged only when there is data. */
|
|
5237
6527
|
issues = computed(() => {
|
|
5238
6528
|
const { rows, parent } = this.fields();
|
|
5239
6529
|
const known = rows.length || parent.length;
|
|
5240
6530
|
const inner = this.fields().inner;
|
|
5241
|
-
|
|
6531
|
+
const bandOf = (id) => this.state.report().bands.find((b) => b.controls.some((c) => c.id === id))?.id ?? '';
|
|
6532
|
+
const cut = [...(this.surface()?.cutTexts() ?? [])].map((controlId) => ({ code: 'textCut', severity: 'warning', bandId: bandOf(controlId), controlId }));
|
|
6533
|
+
return [
|
|
6534
|
+
...checkReport(this.state.report(), known ? rows.map((f) => f.path) : undefined, known ? parent.map((f) => f.path) : undefined, undefined, inner.length ? inner.map((f) => f.path) : undefined),
|
|
6535
|
+
...cut,
|
|
6536
|
+
];
|
|
5242
6537
|
});
|
|
5243
6538
|
/** Show the first data row inside bound controls instead of their formulas. */
|
|
5244
|
-
showData = signal(true);
|
|
6539
|
+
showData = signal(readSaved('showData', true, (v) => typeof v === 'boolean'));
|
|
5245
6540
|
sample = computed(() => (this.showData() ? this.state.sample() : null));
|
|
5246
6541
|
fields = computed(() => designerFields(this.state.report(), this.data()));
|
|
6542
|
+
fieldFilter = signal('');
|
|
6543
|
+
/** The field list narrowed to names containing the filter text. */
|
|
6544
|
+
shownFields = computed(() => {
|
|
6545
|
+
const f = this.fields();
|
|
6546
|
+
const q = this.fieldFilter().trim().toLocaleLowerCase();
|
|
6547
|
+
if (!q)
|
|
6548
|
+
return f;
|
|
6549
|
+
const keep = (list) => list.filter((x) => x.label.toLocaleLowerCase().includes(q) || x.path.toLocaleLowerCase().includes(q));
|
|
6550
|
+
return { ...f, rows: keep(f.rows), inner: keep(f.inner), parent: keep(f.parent) };
|
|
6551
|
+
});
|
|
5247
6552
|
allFields = computed(() => [...this.fields().rows, ...this.fields().parent, ...this.fields().inner]);
|
|
5248
6553
|
addableBands = computed(() => {
|
|
5249
6554
|
const kinds = new Set(this.state.report().bands.map((b) => b.kind));
|
|
@@ -5313,6 +6618,19 @@ class WeReportDesignerComponent {
|
|
|
5313
6618
|
const sel = this.state.selection();
|
|
5314
6619
|
return sel.kind === 'controls' && sel.ids.includes(id);
|
|
5315
6620
|
}
|
|
6621
|
+
/** Unique per designer, so two designers on one page do not share the size list. */
|
|
6622
|
+
sizeListId = `we-report-sizes-${++designerCount}`;
|
|
6623
|
+
zoomSteps = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
6624
|
+
gridSteps = [0, 0.5, 1, 2, 5];
|
|
6625
|
+
/** Snap grid in mm; 0 turns the grid off. */
|
|
6626
|
+
gridSize = signal(readSaved('grid', 1, (v) => typeof v === 'number' && v >= 0 && v <= 10));
|
|
6627
|
+
rememberView = effect(() => writeSaved({ zoom: this.zoomLevel(), grid: this.gridSize(), showData: this.showData() }));
|
|
6628
|
+
pickZoom(value) {
|
|
6629
|
+
if (value === 'width')
|
|
6630
|
+
this.fitWidth();
|
|
6631
|
+
else if (value)
|
|
6632
|
+
this.setZoom(Number(value));
|
|
6633
|
+
}
|
|
5316
6634
|
fitWidth() {
|
|
5317
6635
|
const el = this.canvas()?.nativeElement;
|
|
5318
6636
|
if (!el)
|
|
@@ -5338,13 +6656,144 @@ class WeReportDesignerComponent {
|
|
|
5338
6656
|
this.state.select(controlId, false);
|
|
5339
6657
|
else
|
|
5340
6658
|
this.state.selection.set({ kind: 'band', id: bandEl.dataset['bandId'] });
|
|
5341
|
-
|
|
6659
|
+
const p = this.state.pointer();
|
|
6660
|
+
const at = p && p.bandId === bandEl.dataset['bandId'] ? { x: p.x, y: p.y } : undefined;
|
|
6661
|
+
this.contextMenu.set({ x: e.clientX, y: e.clientY, bandId: bandEl.dataset['bandId'] ?? null, onControl: !!controlId, at });
|
|
6662
|
+
}
|
|
6663
|
+
/** A new text where the section was right-clicked, ready to type in. */
|
|
6664
|
+
addTextAt(bandId, at) {
|
|
6665
|
+
const band = this.state.report().bands.find((b) => b.id === bandId);
|
|
6666
|
+
const surface = this.surface();
|
|
6667
|
+
if (!band || !surface)
|
|
6668
|
+
return;
|
|
6669
|
+
surface.dropAt({ kind: 'control', type: 'text' }, band, Math.round(at?.x ?? 0), Math.round(at?.y ?? 0));
|
|
6670
|
+
this.editSelected();
|
|
6671
|
+
}
|
|
6672
|
+
/** A single bound text in the detail section: it can get a total ("insert summary"). */
|
|
6673
|
+
totalTarget = computed(() => {
|
|
6674
|
+
const [c, ...more] = this.state.selectedControls();
|
|
6675
|
+
if (!c || more.length || c.type !== 'text' || !isExpression(c.text) || !c.text.expression.trim())
|
|
6676
|
+
return null;
|
|
6677
|
+
return this.state.selectedBand()?.kind === 'detail' || this.state.report().bands.find((b) => b.controls.includes(c))?.kind === 'detail' ? c : null;
|
|
6678
|
+
});
|
|
6679
|
+
groupByValue() {
|
|
6680
|
+
const c = this.totalTarget();
|
|
6681
|
+
if (c?.type === 'text' && isExpression(c.text))
|
|
6682
|
+
this.addBand('groupHeader', c.text.expression);
|
|
6683
|
+
}
|
|
6684
|
+
/** Puts `Sum(...)` of the selected column under it in every group footer and the report footer. */
|
|
6685
|
+
addTotal() {
|
|
6686
|
+
const c = this.totalTarget();
|
|
6687
|
+
if (!c || c.type !== 'text' || !isExpression(c.text))
|
|
6688
|
+
return;
|
|
6689
|
+
const expression = `Sum(${c.text.expression})`;
|
|
6690
|
+
const taken = new Set();
|
|
6691
|
+
const ids = [];
|
|
6692
|
+
this.state.update((d) => {
|
|
6693
|
+
if (!d.bands.some((b) => b.kind === 'reportFooter')) {
|
|
6694
|
+
d.bands.push({ id: this.state.newId('reportFooter', taken), kind: 'reportFooter', height: 8, controls: [] });
|
|
6695
|
+
d.bands = orderBands(d.bands);
|
|
6696
|
+
}
|
|
6697
|
+
for (const band of d.bands) {
|
|
6698
|
+
if (band.kind !== 'groupFooter' && band.kind !== 'reportFooter')
|
|
6699
|
+
continue;
|
|
6700
|
+
// Under whatever already sits in this column, else at the top.
|
|
6701
|
+
const inColumn = band.controls.filter((x) => x.x < c.x + c.width && x.x + x.width > c.x);
|
|
6702
|
+
const y = inColumn.length ? Math.round(Math.max(...inColumn.map((x) => x.y + x.height)) * 100) / 100 : 1;
|
|
6703
|
+
const id = this.state.newId('total', taken);
|
|
6704
|
+
ids.push(id);
|
|
6705
|
+
band.controls.push({
|
|
6706
|
+
id, type: 'text', x: c.x, y, width: c.width, height: c.height, text: { expression }, format: c.format,
|
|
6707
|
+
style: c.style, styleOverrides: { ...c.styleOverrides, bold: true },
|
|
6708
|
+
});
|
|
6709
|
+
band.height = Math.max(band.height, y + c.height + 1);
|
|
6710
|
+
}
|
|
6711
|
+
});
|
|
6712
|
+
this.state.selection.set({ kind: 'controls', ids });
|
|
6713
|
+
}
|
|
6714
|
+
hasTextSelected = computed(() => this.state.selectedControls().some((c) => c.type === 'text'));
|
|
6715
|
+
/**
|
|
6716
|
+
* Sizes the selected texts to what they show on the page (fixed text, or the sample value),
|
|
6717
|
+
* measured with the report's fonts, so it matches the printed size.
|
|
6718
|
+
*/
|
|
6719
|
+
async fitToText() {
|
|
6720
|
+
const texts = this.state.selectedControls().filter((c) => c.type === 'text');
|
|
6721
|
+
if (!texts.length)
|
|
6722
|
+
return;
|
|
6723
|
+
const fonts = await this.fontsService.ready();
|
|
6724
|
+
const report = this.state.report();
|
|
6725
|
+
const sizes = new Map();
|
|
6726
|
+
for (const c of texts) {
|
|
6727
|
+
const shown = this.host.nativeElement.querySelector(`[data-control-id="${CSS.escape(c.id)}"] .ds__text`)?.textContent ?? '';
|
|
6728
|
+
const lines = shown.split('\n');
|
|
6729
|
+
const style = resolveStyle(report, c.style, c.styleOverrides);
|
|
6730
|
+
const font = fonts.resolve(style.fontFamily, style.bold, style.italic);
|
|
6731
|
+
const up = (v) => Math.ceil(v * 10) / 10;
|
|
6732
|
+
sizes.set(c.id, {
|
|
6733
|
+
width: up(Math.max(2, ...lines.map((l) => font.widthOf(l, style.fontSize))) + 2 * style.padding + 0.5),
|
|
6734
|
+
height: up(lines.length * font.lineHeight(style.fontSize) + 2 * style.padding),
|
|
6735
|
+
});
|
|
6736
|
+
}
|
|
6737
|
+
this.state.updateControls([...sizes.keys()], (c) => Object.assign(c, sizes.get(c.id)));
|
|
6738
|
+
}
|
|
6739
|
+
/** Shrinks (or grows) a section to just below its lowest item. */
|
|
6740
|
+
fitBand(bandId) {
|
|
6741
|
+
this.state.update((d) => {
|
|
6742
|
+
const band = d.bands.find((b) => b.id === bandId);
|
|
6743
|
+
if (band)
|
|
6744
|
+
band.height = Math.max(2, Math.round(Math.max(0, ...band.controls.map((c) => c.y + c.height)) * 100) / 100);
|
|
6745
|
+
});
|
|
5342
6746
|
}
|
|
5343
6747
|
/** Runs a context-menu command and closes the menu. */
|
|
5344
6748
|
menu(action) {
|
|
5345
6749
|
this.contextMenu.set(null);
|
|
5346
6750
|
action();
|
|
5347
6751
|
}
|
|
6752
|
+
/** Ctrl+C/X/V pressed on the page and not yet answered by a clipboard event. */
|
|
6753
|
+
pendingClipboardKey = null;
|
|
6754
|
+
/** Copy and cut also put the items on the system clipboard, so they paste in another tab. */
|
|
6755
|
+
onCopy(e) {
|
|
6756
|
+
this.pendingClipboardKey = null;
|
|
6757
|
+
// Text selected on the page (a label, a hint) is copied as text, not as report items.
|
|
6758
|
+
if (this.tab() !== 'design' || this.isTyping(e) || !document.getSelection()?.isCollapsed || !this.state.copySelection())
|
|
6759
|
+
return;
|
|
6760
|
+
e.preventDefault();
|
|
6761
|
+
e.clipboardData?.setData('text/plain', this.state.clipboardText());
|
|
6762
|
+
if (e.type === 'cut')
|
|
6763
|
+
this.state.deleteSelection();
|
|
6764
|
+
}
|
|
6765
|
+
/** Pastes our items, else a picture (screenshot) or text from any other program. */
|
|
6766
|
+
onPaste(e) {
|
|
6767
|
+
this.pendingClipboardKey = null;
|
|
6768
|
+
if (this.tab() !== 'design' || this.isTyping(e))
|
|
6769
|
+
return;
|
|
6770
|
+
const data = e.clipboardData;
|
|
6771
|
+
const text = data?.getData('text/plain') ?? '';
|
|
6772
|
+
const image = Array.from(data?.files ?? []).find((f) => /^image\/(png|jpeg)$/.test(f.type));
|
|
6773
|
+
if (this.state.loadClipboard(text) || (!text && !image && this.state.hasClipboard())) {
|
|
6774
|
+
e.preventDefault();
|
|
6775
|
+
this.state.paste();
|
|
6776
|
+
return;
|
|
6777
|
+
}
|
|
6778
|
+
const band = this.targetBand();
|
|
6779
|
+
const surface = this.surface();
|
|
6780
|
+
if (!band || !surface)
|
|
6781
|
+
return;
|
|
6782
|
+
const y = Math.max(0, ...band.controls.map((c) => c.y + c.height));
|
|
6783
|
+
if (image) {
|
|
6784
|
+
e.preventDefault();
|
|
6785
|
+
const reader = new FileReader();
|
|
6786
|
+
reader.onload = () => surface.addImage(band, 0, y, reader.result);
|
|
6787
|
+
reader.readAsDataURL(image);
|
|
6788
|
+
}
|
|
6789
|
+
else if (text.trim()) {
|
|
6790
|
+
e.preventDefault();
|
|
6791
|
+
surface.addText(band, 0, y, text.replace(/\s+$/, ''));
|
|
6792
|
+
}
|
|
6793
|
+
}
|
|
6794
|
+
isTyping(e) {
|
|
6795
|
+
return !!e.target?.closest?.('input, textarea, select, [contenteditable="true"]');
|
|
6796
|
+
}
|
|
5348
6797
|
closeMenus(e) {
|
|
5349
6798
|
if (!this.contextMenu())
|
|
5350
6799
|
return;
|
|
@@ -5369,14 +6818,19 @@ class WeReportDesignerComponent {
|
|
|
5369
6818
|
if (e.dataTransfer)
|
|
5370
6819
|
e.dataTransfer.effectAllowed = 'copy';
|
|
5371
6820
|
}
|
|
5372
|
-
addBand(kind) {
|
|
6821
|
+
addBand(kind, groupBy) {
|
|
5373
6822
|
this.bandMenuOpen.set(false);
|
|
5374
6823
|
const id = this.state.newId(kind);
|
|
5375
6824
|
this.state.update((d) => {
|
|
5376
6825
|
if (kind === 'groupHeader') {
|
|
5377
|
-
const
|
|
6826
|
+
const expression = groupBy ?? this.allFields().find((f) => !f.parent)?.expression ?? '';
|
|
6827
|
+
const width = resolvePageGeometry(d.page).contentWidth;
|
|
6828
|
+
// A group made from a value shows that value as its heading.
|
|
6829
|
+
const heading = groupBy
|
|
6830
|
+
? [{ id: `${id}Value`, type: 'text', x: 0, y: 1, width: Math.min(120, width), height: 6, text: { expression }, styleOverrides: { bold: true } }]
|
|
6831
|
+
: [];
|
|
5378
6832
|
// Pushed last, so after the stable sort it is the innermost group header…
|
|
5379
|
-
d.bands.push({ id, kind, height: 8, groupBy: { expression
|
|
6833
|
+
d.bands.push({ id, kind, height: 8, groupBy: { expression }, controls: heading });
|
|
5380
6834
|
// …and its footer, placed right after the detail band, the innermost footer.
|
|
5381
6835
|
const detailIndex = d.bands.findIndex((b) => b.kind === 'detail');
|
|
5382
6836
|
d.bands.splice(detailIndex + 1, 0, { id: `${id}Footer`, kind: 'groupFooter', groupHeaderId: id, height: 8, controls: [] });
|
|
@@ -5391,19 +6845,63 @@ class WeReportDesignerComponent {
|
|
|
5391
6845
|
});
|
|
5392
6846
|
this.state.selection.set({ kind: 'band', id });
|
|
5393
6847
|
}
|
|
5394
|
-
/**
|
|
6848
|
+
/** The report wizard's choices while it is open. */
|
|
6849
|
+
wizard = signal(null);
|
|
6850
|
+
/** Opens the report wizard: pick columns, grouping, totals and paper, then a tidy list is built. */
|
|
5395
6851
|
autoDesign() {
|
|
5396
6852
|
const { rows } = resolveReportData(this.state.report(), this.data());
|
|
5397
|
-
const fields = inferSchema(rows ?? []);
|
|
6853
|
+
const fields = inferSchema(rows ?? []).filter((f) => f.type !== 'object' && f.type !== 'array' && f.type !== 'image');
|
|
6854
|
+
if (!fields.length)
|
|
6855
|
+
return;
|
|
6856
|
+
const name = this.state.report().name;
|
|
6857
|
+
// A blank report is still called "Report": show the localized word instead.
|
|
6858
|
+
this.wizard.set({
|
|
6859
|
+
title: name && name !== 'Report' ? name : this.strings().newReportTitle,
|
|
6860
|
+
fields: fields.map((f, i) => ({ name: f.name, on: i < 12 })),
|
|
6861
|
+
groupBy: '',
|
|
6862
|
+
sortBy: '',
|
|
6863
|
+
sortDescending: false,
|
|
6864
|
+
totals: true,
|
|
6865
|
+
orientation: '',
|
|
6866
|
+
});
|
|
6867
|
+
// Focus the dialog so Escape and Enter work at once.
|
|
6868
|
+
setTimeout(() => this.host.nativeElement.querySelector('.wd__wizard input')?.select());
|
|
6869
|
+
}
|
|
6870
|
+
/** At least one column (or a grouping) to build from. */
|
|
6871
|
+
wizardReady = computed(() => !!this.wizard()?.fields.some((f) => f.on) || !!this.wizard()?.groupBy);
|
|
6872
|
+
updateWizard(change) {
|
|
6873
|
+
const w = this.wizard();
|
|
6874
|
+
if (w)
|
|
6875
|
+
this.wizard.set({ ...w, ...change });
|
|
6876
|
+
}
|
|
6877
|
+
toggleWizardField(name) {
|
|
6878
|
+
const w = this.wizard();
|
|
6879
|
+
if (w)
|
|
6880
|
+
this.wizard.set({ ...w, fields: w.fields.map((f) => (f.name === name ? { ...f, on: !f.on } : f)) });
|
|
6881
|
+
}
|
|
6882
|
+
/** Replaces the layout with the wizard's list report (undoable). */
|
|
6883
|
+
runWizard() {
|
|
6884
|
+
const w = this.wizard();
|
|
6885
|
+
if (!w)
|
|
6886
|
+
return;
|
|
6887
|
+
const { rows } = resolveReportData(this.state.report(), this.data());
|
|
6888
|
+
const schema = inferSchema(rows ?? []);
|
|
6889
|
+
const chosen = new Set(w.fields.filter((f) => f.on || f.name === w.groupBy).map((f) => f.name));
|
|
6890
|
+
const fields = schema.filter((f) => chosen.has(f.name));
|
|
5398
6891
|
if (!fields.length)
|
|
5399
6892
|
return;
|
|
5400
6893
|
const s = this.strings();
|
|
5401
6894
|
this.state.update((d) => {
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
6895
|
+
const generated = generateListReport(d, fields, { title: w.title, total: s.totalLabel, pageOf: s.pageOfFormat }, '', rows ?? [], {
|
|
6896
|
+
groupBy: w.groupBy || undefined,
|
|
6897
|
+
sortBy: w.sortBy || undefined,
|
|
6898
|
+
sortDescending: w.sortDescending,
|
|
6899
|
+
totals: w.totals,
|
|
6900
|
+
orientation: w.orientation || undefined,
|
|
6901
|
+
});
|
|
5405
6902
|
Object.assign(d, generated);
|
|
5406
6903
|
});
|
|
6904
|
+
this.wizard.set(null);
|
|
5407
6905
|
this.state.selection.set({ kind: 'none' });
|
|
5408
6906
|
}
|
|
5409
6907
|
issueText(issue) {
|
|
@@ -5415,14 +6913,22 @@ class WeReportDesignerComponent {
|
|
|
5415
6913
|
emptyFormula: s.issueEmptyFormula,
|
|
5416
6914
|
overlap: s.issueOverlap,
|
|
5417
6915
|
outsideColumn: s.issueOutsideColumn,
|
|
6916
|
+
textCut: s.issueTextCut,
|
|
5418
6917
|
}[issue.code];
|
|
5419
6918
|
return text.replace('{0}', issue.detail ?? '');
|
|
5420
6919
|
}
|
|
5421
6920
|
showIssue(issue) {
|
|
5422
6921
|
this.state.selection.set({ kind: 'controls', ids: [issue.controlId] });
|
|
5423
6922
|
}
|
|
5424
|
-
/** Moves (and if needed narrows) an item back inside the paper. */
|
|
6923
|
+
/** Moves (and if needed narrows) an item back inside the paper; a cut text grows to fit instead. */
|
|
5425
6924
|
fixIssue(issue) {
|
|
6925
|
+
if (issue.code === 'textCut') {
|
|
6926
|
+
this.state.updateControls([issue.controlId], (c) => {
|
|
6927
|
+
if (c.type === 'text')
|
|
6928
|
+
c.canGrow = true;
|
|
6929
|
+
});
|
|
6930
|
+
return;
|
|
6931
|
+
}
|
|
5426
6932
|
const width = resolvePageGeometry(this.state.report().page).contentWidth;
|
|
5427
6933
|
this.state.updateControls([issue.controlId], (c) => {
|
|
5428
6934
|
c.width = Math.min(c.width, width);
|
|
@@ -5430,11 +6936,26 @@ class WeReportDesignerComponent {
|
|
|
5430
6936
|
});
|
|
5431
6937
|
}
|
|
5432
6938
|
onKeydown(e) {
|
|
6939
|
+
if (e.key === 'F5') {
|
|
6940
|
+
// Desktop designers preview with F5; here it switches between design and preview.
|
|
6941
|
+
e.preventDefault();
|
|
6942
|
+
this.tab.set(this.tab() === 'design' ? 'preview' : 'design');
|
|
6943
|
+
return;
|
|
6944
|
+
}
|
|
5433
6945
|
if (this.tab() !== 'design')
|
|
5434
6946
|
return;
|
|
5435
6947
|
const target = e.target;
|
|
5436
6948
|
const typing = target.closest('input, textarea, select, [contenteditable="true"]');
|
|
5437
6949
|
const mod = e.ctrlKey || e.metaKey;
|
|
6950
|
+
// Text is being typed on the page and its editor is about to take focus.
|
|
6951
|
+
if (this.state.editing() && !typing) {
|
|
6952
|
+
e.preventDefault();
|
|
6953
|
+
if (e.key === 'Enter' || e.key === 'Escape')
|
|
6954
|
+
this.surface()?.finishEditing(e.key === 'Enter');
|
|
6955
|
+
else if (e.key.length === 1 && !mod)
|
|
6956
|
+
this.surface()?.appendToEdit(e.key);
|
|
6957
|
+
return;
|
|
6958
|
+
}
|
|
5438
6959
|
if (mod && e.key.toLowerCase() === 'z' && !typing) {
|
|
5439
6960
|
e.preventDefault();
|
|
5440
6961
|
if (e.shiftKey)
|
|
@@ -5446,6 +6967,45 @@ class WeReportDesignerComponent {
|
|
|
5446
6967
|
e.preventDefault();
|
|
5447
6968
|
this.state.redo();
|
|
5448
6969
|
}
|
|
6970
|
+
else if (mod && ['b', 'i', 'u'].includes(e.key.toLowerCase()) && !typing && this.state.selection().kind === 'controls') {
|
|
6971
|
+
e.preventDefault();
|
|
6972
|
+
this.toggleFormat({ b: 'bold', i: 'italic', u: 'underline' }[e.key.toLowerCase()]);
|
|
6973
|
+
}
|
|
6974
|
+
else if (mod && e.key === '0' && !typing) {
|
|
6975
|
+
e.preventDefault();
|
|
6976
|
+
this.fitWidth();
|
|
6977
|
+
}
|
|
6978
|
+
else if (mod && (e.key === '=' || e.key === '+') && !typing) {
|
|
6979
|
+
e.preventDefault();
|
|
6980
|
+
this.setZoom(this.zoomLevel() + 0.1);
|
|
6981
|
+
}
|
|
6982
|
+
else if (mod && e.key === '-' && !typing) {
|
|
6983
|
+
e.preventDefault();
|
|
6984
|
+
this.setZoom(this.zoomLevel() - 0.1);
|
|
6985
|
+
}
|
|
6986
|
+
else if (e.key === 'F1') {
|
|
6987
|
+
e.preventDefault();
|
|
6988
|
+
this.shortcutsOpen.set(!this.shortcutsOpen());
|
|
6989
|
+
}
|
|
6990
|
+
else if (!typing && !mod && !e.altKey && e.key.length === 1 && e.key !== ' ' && this.typeStartsEditing()) {
|
|
6991
|
+
// Typing on a selected text replaces it, as in a spreadsheet.
|
|
6992
|
+
e.preventDefault();
|
|
6993
|
+
this.surface()?.startEditing(this.state.selectedControls()[0], undefined, undefined, e.key);
|
|
6994
|
+
}
|
|
6995
|
+
else if (e.key === 'Tab' && !typing && !mod) {
|
|
6996
|
+
e.preventDefault();
|
|
6997
|
+
this.state.selectNext(e.shiftKey ? -1 : 1);
|
|
6998
|
+
}
|
|
6999
|
+
else if ((e.key === 'F2' || e.key === 'Enter') && !typing && this.state.selectedControls().length === 1) {
|
|
7000
|
+
e.preventDefault();
|
|
7001
|
+
this.surface()?.startEditing(this.state.selectedControls()[0]);
|
|
7002
|
+
}
|
|
7003
|
+
else if (mod && e.key.startsWith('Arrow') && !typing && this.state.selection().kind === 'controls') {
|
|
7004
|
+
// Ctrl+arrow resizes (Shift: 5 mm), plain arrows move.
|
|
7005
|
+
e.preventDefault();
|
|
7006
|
+
const step = e.shiftKey ? 5 : 1;
|
|
7007
|
+
this.state.resizeSelection(e.key === 'ArrowLeft' ? -step : e.key === 'ArrowRight' ? step : 0, e.key === 'ArrowUp' ? -step : e.key === 'ArrowDown' ? step : 0);
|
|
7008
|
+
}
|
|
5449
7009
|
else if (mod && e.key.toLowerCase() === 'd' && !typing) {
|
|
5450
7010
|
e.preventDefault();
|
|
5451
7011
|
this.state.duplicateSelection();
|
|
@@ -5456,17 +7016,22 @@ class WeReportDesignerComponent {
|
|
|
5456
7016
|
this.state.deleteSelection();
|
|
5457
7017
|
}
|
|
5458
7018
|
}
|
|
5459
|
-
else if (mod && e.key.toLowerCase()
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
7019
|
+
else if (mod && ['c', 'x', 'v'].includes(e.key.toLowerCase()) && !typing && !e.shiftKey && !e.altKey) {
|
|
7020
|
+
// Copy, cut and paste go through the clipboard events below (system clipboard). Browsers
|
|
7021
|
+
// that fire no clipboard event on a non-editable element (Safari) get the in-memory clipboard.
|
|
7022
|
+
const key = e.key.toLowerCase();
|
|
7023
|
+
this.pendingClipboardKey = key;
|
|
7024
|
+
setTimeout(() => {
|
|
7025
|
+
if (this.pendingClipboardKey !== key)
|
|
7026
|
+
return;
|
|
7027
|
+
this.pendingClipboardKey = null;
|
|
7028
|
+
if (key === 'c')
|
|
7029
|
+
this.state.copySelection();
|
|
7030
|
+
else if (key === 'x')
|
|
7031
|
+
this.state.cutSelection();
|
|
7032
|
+
else if (this.state.hasClipboard())
|
|
7033
|
+
this.state.paste();
|
|
7034
|
+
});
|
|
5470
7035
|
}
|
|
5471
7036
|
else if (mod && e.key.toLowerCase() === 'a' && !typing) {
|
|
5472
7037
|
e.preventDefault();
|
|
@@ -5475,6 +7040,8 @@ class WeReportDesignerComponent {
|
|
|
5475
7040
|
else if (e.key === 'Escape' && !typing) {
|
|
5476
7041
|
if (this.contextMenu())
|
|
5477
7042
|
this.contextMenu.set(null);
|
|
7043
|
+
else if (this.state.painter())
|
|
7044
|
+
this.state.painter.set(null);
|
|
5478
7045
|
else
|
|
5479
7046
|
this.state.selection.set({ kind: 'none' });
|
|
5480
7047
|
}
|
|
@@ -5492,12 +7059,21 @@ class WeReportDesignerComponent {
|
|
|
5492
7059
|
}
|
|
5493
7060
|
}
|
|
5494
7061
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportDesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5495
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WeReportDesignerComponent, isStandalone: true, selector: "we-report-designer", inputs: { report: { classPropertyName: "report", publicName: "report", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, fetchFn: { classPropertyName: "fetchFn", publicName: "fetchFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { report: "reportChange" }, host: { listeners: { "document:pointerdown": "closeMenus($event)", "keydown": "onKeydown($event)" } }, providers: [DesignerState], viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: "@let s = strings();\n<div class=\"wd__toolbar\" role=\"toolbar\">\n <div class=\"wd__tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'design'\" [class.wd__tab--on]=\"tab() === 'design'\" (click)=\"tab.set('design')\">\n <span [innerHTML]=\"'design' | weReportIcon\"></span>{{ s.design }}\n </button>\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'preview'\" [class.wd__tab--on]=\"tab() === 'preview'\" (click)=\"tab.set('preview')\">\n <span [innerHTML]=\"'preview' | weReportIcon\"></span>{{ s.preview }}\n </button>\n </div>\n @if (tab() === 'design') {\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"!state.canUndo()\" (click)=\"state.undo()\" [title]=\"s.undo + ' (Ctrl+Z)'\" [attr.aria-label]=\"s.undo\" [innerHTML]=\"'undo' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"!state.canRedo()\" (click)=\"state.redo()\" [title]=\"s.redo + ' (Ctrl+Y)'\" [attr.aria-label]=\"s.redo\" [innerHTML]=\"'redo' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"state.selection().kind !== 'controls'\" (click)=\"state.deleteSelection()\" [title]=\"s.delete + ' (Del)'\" [attr.aria-label]=\"s.delete\" [innerHTML]=\"'trash' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() - 0.1)\" [title]=\"s.zoomOut\" [attr.aria-label]=\"s.zoomOut\" [innerHTML]=\"'zoomOut' | weReportIcon\"></button>\n <span class=\"wd__zoom\">{{ (zoomLevel() * 100).toFixed(0) }}%</span>\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() + 0.1)\" [title]=\"s.zoomIn\" [attr.aria-label]=\"s.zoomIn\" [innerHTML]=\"'zoomIn' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" (click)=\"fitWidth()\" [title]=\"s.fitWidth\" [attr.aria-label]=\"s.fitWidth\" [innerHTML]=\"'fitWidth' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <div class=\"wd__menu\">\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"bandMenuOpen.set(!bandMenuOpen())\" [attr.aria-expanded]=\"bandMenuOpen()\">+ {{ s.addBand }}</button>\n @if (bandMenuOpen()) {\n <div class=\"wd__menu-list\" role=\"menu\">\n @for (k of addableBands(); track k) {\n <button type=\"button\" role=\"menuitem\" (click)=\"addBand(k)\">{{ k === 'groupHeader' ? s.groupBy + '\u2026' : s.bandNames[k] }}</button>\n }\n </div>\n }\n </div>\n @if (fields().rows.length) {\n <button type=\"button\" class=\"wd__text-btn wd__magic\" (click)=\"autoDesign()\" [title]=\"s.autoDesignHint\">\u2728 {{ s.autoDesign }}</button>\n }\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"dataDialogOpen.set(true)\">\n <span [innerHTML]=\"'database' | weReportIcon\"></span> {{ s.dataSources }}\n </button>\n <label class=\"wd__toggle\">\n <input type=\"checkbox\" [checked]=\"showData()\" (change)=\"showData.set($any($event.target).checked)\" />\n {{ s.showData }}\n </label>\n <span class=\"wd__spacer\"></span>\n <div class=\"wd__menu\">\n <button type=\"button\" class=\"wd__text-btn\" [class.wd__issues]=\"issues().length\" (click)=\"problemsOpen.set(!problemsOpen())\" [attr.aria-expanded]=\"problemsOpen()\">\n {{ issues().length ? '\u26A0 ' + issues().length : '\u2713' }} {{ s.problems }}\n </button>\n @if (problemsOpen()) {\n <div class=\"wd__menu-list wd__problems\" role=\"list\">\n @for (issue of issues(); track $index) {\n <div class=\"wd__problem\" role=\"listitem\">\n <button type=\"button\" class=\"wd__problem-text\" (click)=\"showIssue(issue)\">\n <code>{{ issue.controlId }}</code> {{ issueText(issue) }}\n </button>\n @if (issue.code === 'outsidePage') {\n <button type=\"button\" class=\"wd__fix\" (click)=\"fixIssue(issue)\">{{ s.fixIt }}</button>\n }\n </div>\n } @empty {\n <p class=\"wd__hint\">{{ s.noProblems }}</p>\n }\n </div>\n }\n </div>\n <div class=\"wd__mode\" role=\"radiogroup\">\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"!advanced()\" [class.wd__mode--on]=\"!advanced()\" (click)=\"advanced.set(false)\">{{ s.basicMode }}</button>\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"advanced()\" [class.wd__mode--on]=\"advanced()\" (click)=\"advanced.set(true)\">{{ s.advancedMode }}</button>\n </div>\n }\n</div>\n\n@if (tab() === 'design') {\n <div class=\"wd__body\">\n <aside class=\"wd__left\">\n <div class=\"wd__left-tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"leftTab() === 'add'\" [class.wd__left-tab--on]=\"leftTab() === 'add'\" (click)=\"leftTab.set('add')\">{{ s.add }}</button>\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"leftTab() === 'outline'\" [class.wd__left-tab--on]=\"leftTab() === 'outline'\" (click)=\"leftTab.set('outline')\">{{ s.explorer }}</button>\n </div>\n @if (leftTab() === 'add') {\n <h2>{{ s.toolbox }}</h2>\n <p class=\"wd__hint\">{{ s.toolboxHint }}</p>\n <div class=\"wd__tools\">\n @for (item of toolbox; track $index) {\n <div class=\"wd__tool\" draggable=\"true\" (dragstart)=\"onToolDragStart($event, item)\" [title]=\"s.controlNames[item.type]\">\n <span [innerHTML]=\"iconName(item.icon) | weReportIcon\"></span>\n <span>{{ item.variant === 'qrcode' ? 'QR' : s.controlNames[item.type] }}</span>\n </div>\n }\n </div>\n\n <h2>{{ s.fields }}</h2>\n @if (fields().rows.length || fields().parent.length) {\n <p class=\"wd__hint\">{{ s.fieldsHint }}</p>\n <ul class=\"wd__fields\">\n @for (f of fields().rows; track f.path) {\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n @if (fields().inner.length) {\n <h3>{{ s.innerFields }}</h3>\n <ul class=\"wd__fields\">\n @for (f of fields().inner; track f.path) {\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n }\n @if (fields().parent.length) {\n <h3>{{ s.parentFields }}</h3>\n <ul class=\"wd__fields\">\n @for (f of fields().parent; track f.path) {\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n }\n } @else {\n <p class=\"wd__hint\">{{ s.noFields }}</p>\n }\n } @else {\n <p class=\"wd__hint\">{{ s.explorerHint }}</p>\n <ul class=\"wd__outline\" role=\"tree\">\n @for (band of state.report().bands; track band.id) {\n <li role=\"treeitem\" [attr.aria-expanded]=\"true\">\n <button type=\"button\" class=\"wd__outline-band\" [class.wd__outline--on]=\"state.selection().kind === 'band' && state.selectedBand()?.id === band.id\" (click)=\"state.selection.set({ kind: 'band', id: band.id })\">\n {{ s.bandNames[band.kind] }}\n </button>\n <ul role=\"group\">\n @for (c of band.controls; track c.id) {\n <li role=\"treeitem\">\n <button type=\"button\" class=\"wd__outline-item\" [class.wd__outline--on]=\"isSelected(c.id)\" (click)=\"selectFromOutline($event, c.id)\">\n <span [innerHTML]=\"outlineIcon(c) | weReportIcon\"></span><span class=\"wd__outline-text\">{{ outlineLabel(c) }}</span>\n </button>\n </li>\n } @empty {\n <li class=\"wd__outline-empty\">{{ s.emptyBand }}</li>\n }\n </ul>\n </li>\n }\n </ul>\n }\n </aside>\n\n <main #canvas class=\"wd__canvas\" tabindex=\"-1\" (contextmenu)=\"openContextMenu($event)\" (wheel)=\"onCanvasWheel($event)\">\n <we-report-design-surface [strings]=\"s\" [zoom]=\"zoomLevel()\" [sample]=\"sample()\" />\n </main>\n\n <aside class=\"wd__right\">\n <we-report-property-panel [strings]=\"s\" [fields]=\"allFields()\" [lists]=\"fields().lists\" [fontFamilies]=\"fontFamilies()\" [advanced]=\"advanced()\" />\n </aside>\n </div>\n} @else {\n <we-report-viewer class=\"wd__preview\" [report]=\"state.report()\" [data]=\"data()\" [locale]=\"s\" [fetchFn]=\"fetchFn()\" />\n}\n\n@if (dataDialogOpen()) {\n <we-report-data-sources-dialog [strings]=\"s\" [fetchFn]=\"fetchFn()\" (closed)=\"dataDialogOpen.set(false)\" />\n}\n\n@if (contextMenu(); as m) {\n <div class=\"wd__menu-list wd__context\" role=\"menu\" [style.left.px]=\"m.x\" [style.top.px]=\"m.y\" (keydown.escape)=\"contextMenu.set(null)\">\n @if (m.onControl) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.cutSelection.bind(state))\"><span [innerHTML]=\"'cut' | weReportIcon\"></span>{{ s.cut }}<kbd>Ctrl+X</kbd></button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.copySelection.bind(state))\"><span [innerHTML]=\"'copy' | weReportIcon\"></span>{{ s.copy }}<kbd>Ctrl+C</kbd></button>\n }\n <button type=\"button\" role=\"menuitem\" [disabled]=\"!state.hasClipboard()\" (click)=\"menu(state.paste.bind(state, m.bandId ?? undefined))\"><span [innerHTML]=\"'paste' | weReportIcon\"></span>{{ s.paste }}<kbd>Ctrl+V</kbd></button>\n @if (m.onControl) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.duplicateSelection.bind(state))\"><span [innerHTML]=\"'copy' | weReportIcon\"></span>{{ s.duplicate }}<kbd>Ctrl+D</kbd></button>\n <hr />\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.arrange.bind(state, 'front'))\"><span [innerHTML]=\"'bringToFront' | weReportIcon\"></span>{{ s.bringToFront }}</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.arrange.bind(state, 'back'))\"><span [innerHTML]=\"'sendToBack' | weReportIcon\"></span>{{ s.sendToBack }}</button>\n <hr />\n <button type=\"button\" role=\"menuitem\" class=\"wd__danger\" (click)=\"menu(state.deleteSelection.bind(state))\"><span [innerHTML]=\"'trash' | weReportIcon\"></span>{{ s.delete }}<kbd>Del</kbd></button>\n } @else {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.selectAll.bind(state))\"><span [innerHTML]=\"'outline' | weReportIcon\"></span>{{ s.selectAll }}<kbd>Ctrl+A</kbd></button>\n @if (state.selectedBand()?.kind !== 'detail') {\n <hr />\n <button type=\"button\" role=\"menuitem\" class=\"wd__danger\" (click)=\"menu(state.deleteSelection.bind(state))\"><span [innerHTML]=\"'trash' | weReportIcon\"></span>{{ s.removeBand }}</button>\n }\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;min-height:0;height:100%;font-family:var(--we-report-font-family, system-ui, sans-serif);font-size:13px;line-height:1.38;letter-spacing:-.003em;color:var(--we-report-fg, #1d1d1f);background:var(--we-report-workspace-bg, #f2f2f7);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease}button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}@media (prefers-reduced-motion: reduce){button{transition:none}}.wd__toolbar{position:relative;z-index:10;display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-height:52px;padding:8px 14px;background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14));box-sizing:border-box}.wd__tabs,.wd__mode{display:inline-flex;padding:2px;gap:2px;border-radius:9px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.wd__tabs button,.wd__mode button{display:inline-flex;align-items:center;gap:6px;border:0;border-radius:7px;padding:4px 12px;background:transparent;font-weight:500;cursor:pointer}.wd__tabs button :is(svg),.wd__mode button :is(svg){width:15px;height:15px}.wd__tab--on,.wd__mode--on{background:var(--we-report-segment-on-bg, #fff)!important;box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.wd__icon,.wd__text-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:30px;height:30px;border:0;border-radius:var(--we-report-control-radius, 7px);background:transparent;cursor:pointer}.wd__icon :is(svg),.wd__text-btn :is(svg){width:17px;height:17px}.wd__icon:hover:not(:disabled),.wd__text-btn:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__icon:disabled,.wd__text-btn:disabled{opacity:.3;cursor:default}.wd__text-btn{padding:0 10px;font-weight:500}.wd__magic{color:var(--we-report-accent, #007aff)}.wd__issues{color:var(--we-report-warning-fg, #b25000);background:var(--we-report-warning-bg, rgba(255, 149, 0, .12))}.wd__sep{width:.5px;height:20px;margin:0 6px;background:var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__zoom{min-width:44px;text-align:center;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__toggle{display:inline-flex;align-items:center;gap:6px;margin:0 6px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));cursor:pointer}.wd__toggle input{accent-color:var(--we-report-accent, #007aff)}.wd__spacer{flex:1}.wd__menu{position:relative}.wd__menu-list{position:absolute;top:calc(100% + 6px);left:0;z-index:20;display:flex;flex-direction:column;min-width:220px;padding:5px;border-radius:var(--we-report-radius, 12px);background:var(--we-report-panel-bg, #fbfbfd);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14));animation:wd-pop .14s ease-out}.wd__menu-list button{text-align:left;border:0;border-radius:6px;padding:6px 10px;background:transparent;cursor:pointer}.wd__menu-list button:hover{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}@keyframes wd-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}}@media (prefers-reduced-motion: reduce){.wd__menu-list{animation:none}}.wd__problems{left:auto;right:0;width:380px;max-height:380px;overflow:auto}.wd__problem{display:flex;align-items:flex-start;gap:6px}.wd__problem .wd__problem-text{flex:1;font-size:12px}.wd__problem .wd__problem-text:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))!important;color:inherit!important}.wd__problem code{font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__fix{flex:none;font-weight:600;color:var(--we-report-accent, #007aff)!important}.wd__body{flex:1;display:grid;grid-template-columns:232px minmax(0,1fr) 288px;min-height:0}.wd__left,.wd__right{overflow:auto;background:var(--we-report-panel-bg, #fbfbfd)}.wd__left{padding:14px 12px 28px;border-right:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__left h2{margin:4px 4px 2px;font-size:13px;font-weight:600}.wd__left h3{margin:16px 4px 4px;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__right{border-left:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__hint{margin:0 4px 10px;font-size:11.5px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__tools{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:20px}.wd__tool{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 4px 10px;border-radius:10px;background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14)),0 1px 2px #0000000a;font-size:11.5px;text-align:center;cursor:grab;-webkit-user-select:none;user-select:none;transition:transform .15s ease,box-shadow .15s ease}.wd__tool :is(svg){width:20px;height:20px;color:var(--we-report-accent, #007aff)}.wd__tool:hover{transform:translateY(-1px);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14)),0 4px 12px #00000014}.wd__tool:active{cursor:grabbing;transform:scale(.97)}@media (prefers-reduced-motion: reduce){.wd__tool{transition:none}.wd__tool:hover,.wd__tool:active{transform:none}}.wd__fields{list-style:none;margin:0;padding:0}.wd__fields li{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:grab;-webkit-user-select:none;user-select:none}.wd__fields li:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__field-type{display:inline-flex;align-items:center;justify-content:center;flex:none;width:18px;height:18px;border-radius:5px;font-size:10px;font-weight:700;text-transform:uppercase;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff)}.wd__canvas{overflow:auto;outline:none}.wd__preview{flex:1;min-height:0}.wd__left-tabs{display:flex;padding:2px;gap:2px;margin-bottom:14px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.wd__left-tabs button{flex:1;border:0;border-radius:6px;padding:4px 8px;background:transparent;font-size:12px;font-weight:500;cursor:pointer}.wd__left-tab--on{background:var(--we-report-segment-on-bg, #fff)!important;box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.wd__outline{list-style:none;margin:0;padding:0}.wd__outline ul{list-style:none;margin:0 0 8px;padding:0 0 0 10px}.wd__outline button{display:flex;align-items:center;gap:6px;width:100%;border:0;border-radius:6px;padding:4px 8px;background:transparent;text-align:left;cursor:pointer}.wd__outline button:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__outline button :is(svg){flex:none;width:14px;height:14px;color:var(--we-report-accent, #007aff)}.wd__outline-band{font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__outline-item{font-size:12px}.wd__outline-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wd__outline--on,.wd__outline--on:hover{background:var(--we-report-accent, #007aff)!important;color:var(--we-report-accent-fg, #fff)!important}.wd__outline--on :is(svg),.wd__outline--on:hover :is(svg){color:inherit!important}.wd__outline-empty{padding:2px 8px;font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__context{position:fixed;z-index:200}.wd__context button{display:flex;align-items:center;gap:8px}.wd__context button :is(svg){width:14px;height:14px}.wd__context button:disabled{opacity:.4;cursor:default;background:transparent!important;color:inherit!important}.wd__context kbd{margin-left:auto;padding-left:16px;font:inherit;font-size:11px;opacity:.55}.wd__context hr{width:100%;margin:4px 0;border:0;border-top:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__danger{color:var(--we-report-warning-fg, #b25000)}\n"], dependencies: [{ kind: "component", type: DesignSurfaceComponent, selector: "we-report-design-surface", inputs: ["strings", "zoom", "gridSize", "sample"] }, { kind: "component", type: PropertyPanelComponent, selector: "we-report-property-panel", inputs: ["strings", "fields", "fontFamilies", "advanced", "lists"] }, { kind: "component", type: WeReportViewerComponent, selector: "we-report-viewer", inputs: ["report", "data", "zoom", "locale", "printDate", "parameters", "fetchFn"], outputs: ["problems", "rendered"] }, { kind: "pipe", type: WeReportIconPipe, name: "weReportIcon" }, { kind: "component", type: DataSourcesDialogComponent, selector: "we-report-data-sources-dialog", inputs: ["strings", "fetchFn"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7062
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WeReportDesignerComponent, isStandalone: true, selector: "we-report-designer", inputs: { report: { classPropertyName: "report", publicName: "report", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, fetchFn: { classPropertyName: "fetchFn", publicName: "fetchFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { report: "reportChange" }, host: { listeners: { "copy": "onCopy($event)", "cut": "onCopy($event)", "paste": "onPaste($event)", "document:pointerdown": "closeMenus($event)", "keydown": "onKeydown($event)" } }, providers: [DesignerState], viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "surface", first: true, predicate: DesignSurfaceComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@let s = strings();\n<div class=\"wd__toolbar\" role=\"toolbar\">\n <div class=\"wd__tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'design'\" [class.wd__tab--on]=\"tab() === 'design'\" (click)=\"tab.set('design')\">\n <span [innerHTML]=\"'design' | weReportIcon\"></span>{{ s.design }}\n </button>\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'preview'\" [class.wd__tab--on]=\"tab() === 'preview'\" (click)=\"tab.set('preview')\" title=\"F5\">\n <span [innerHTML]=\"'preview' | weReportIcon\"></span>{{ s.preview }}\n </button>\n </div>\n @if (tab() === 'design') {\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"!state.canUndo()\" (click)=\"state.undo()\" [title]=\"s.undo + ' (Ctrl+Z)'\" [attr.aria-label]=\"s.undo\" [innerHTML]=\"'undo' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"!state.canRedo()\" (click)=\"state.redo()\" [title]=\"s.redo + ' (Ctrl+Y)'\" [attr.aria-label]=\"s.redo\" [innerHTML]=\"'redo' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"state.selection().kind !== 'controls'\" (click)=\"state.deleteSelection()\" [title]=\"s.delete + ' (Del)'\" [attr.aria-label]=\"s.delete\" [innerHTML]=\"'trash' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() - 0.1)\" [title]=\"s.zoomOut\" [attr.aria-label]=\"s.zoomOut\" [innerHTML]=\"'zoomOut' | weReportIcon\"></button>\n <select class=\"wd__zoom\" (change)=\"pickZoom($any($event.target).value); $any($event.target).value = ''\" [attr.aria-label]=\"s.zoomLevel\">\n <option value=\"\" selected>{{ (zoomLevel() * 100).toFixed(0) }}%</option>\n @for (z of zoomSteps; track z) {\n <option [value]=\"z\">{{ z * 100 }}%</option>\n }\n <option value=\"width\">{{ s.fitWidth }}</option>\n </select>\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() + 0.1)\" [title]=\"s.zoomIn\" [attr.aria-label]=\"s.zoomIn\" [innerHTML]=\"'zoomIn' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" (click)=\"fitWidth()\" [title]=\"s.fitWidth\" [attr.aria-label]=\"s.fitWidth\" [innerHTML]=\"'fitWidth' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <div class=\"wd__menu\">\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"bandMenuOpen.set(!bandMenuOpen())\" [attr.aria-expanded]=\"bandMenuOpen()\">+ {{ s.addBand }}</button>\n @if (bandMenuOpen()) {\n <div class=\"wd__menu-list\" role=\"menu\">\n @for (k of addableBands(); track k) {\n <button type=\"button\" role=\"menuitem\" (click)=\"addBand(k)\">{{ k === 'groupHeader' ? s.groupBy + '\u2026' : s.bandNames[k] }}</button>\n }\n </div>\n }\n </div>\n @if (shownFields().rows.length) {\n <button type=\"button\" class=\"wd__text-btn wd__magic\" (click)=\"autoDesign()\" [title]=\"s.autoDesignHint\"><span [innerHTML]=\"'wand' | weReportIcon\"></span> {{ s.wizardTitle }}</button>\n }\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"dataDialogOpen.set(true)\">\n <span [innerHTML]=\"'database' | weReportIcon\"></span> {{ s.dataSources }}\n </button>\n <label class=\"wd__toggle\">\n <input type=\"checkbox\" [checked]=\"showData()\" (change)=\"showData.set($any($event.target).checked)\" />\n {{ s.showData }}\n </label>\n <select class=\"wd__zoom\" [title]=\"s.snapGrid\" [attr.aria-label]=\"s.snapGrid\" (change)=\"gridSize.set(+$any($event.target).value)\">\n @for (g of gridSteps; track g) {\n <option [value]=\"g\" [selected]=\"g === gridSize()\">{{ g ? g + ' mm' : s.gridOff }}</option>\n }\n </select>\n <span class=\"wd__spacer\"></span>\n <div class=\"wd__menu\">\n <button type=\"button\" class=\"wd__text-btn\" [class.wd__issues]=\"issues().length\" (click)=\"problemsOpen.set(!problemsOpen())\" [attr.aria-expanded]=\"problemsOpen()\">\n {{ issues().length ? '\u26A0 ' + issues().length : '\u2713' }} {{ s.problems }}\n </button>\n @if (problemsOpen()) {\n <div class=\"wd__menu-list wd__problems\" role=\"list\">\n @for (issue of issues(); track $index) {\n <div class=\"wd__problem\" role=\"listitem\">\n <button type=\"button\" class=\"wd__problem-text\" (click)=\"showIssue(issue)\">\n <code>{{ issue.controlId }}</code> {{ issueText(issue) }}\n </button>\n @if (issue.code === 'outsidePage' || issue.code === 'textCut') {\n <button type=\"button\" class=\"wd__fix\" (click)=\"fixIssue(issue)\">{{ s.fixIt }}</button>\n }\n </div>\n } @empty {\n <p class=\"wd__hint\">{{ s.noProblems }}</p>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"wd__icon\" (click)=\"shortcutsOpen.set(true)\" [title]=\"s.keyboardShortcuts + ' (F1)'\" [attr.aria-label]=\"s.keyboardShortcuts\" [innerHTML]=\"'keyboard' | weReportIcon\"></button>\n <div class=\"wd__mode\" role=\"radiogroup\">\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"!advanced()\" [class.wd__mode--on]=\"!advanced()\" (click)=\"advanced.set(false)\">{{ s.basicMode }}</button>\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"advanced()\" [class.wd__mode--on]=\"advanced()\" (click)=\"advanced.set(true)\">{{ s.advancedMode }}</button>\n </div>\n }\n</div>\n\n@if (tab() === 'design') {\n <div class=\"wd__body\" [style.grid-template-columns]=\"leftWidth() + 'px 6px minmax(0, 1fr) 6px ' + rightWidth() + 'px'\">\n <aside class=\"wd__left\" [class.wd__collapsed]=\"!leftWidth()\">\n <div class=\"wd__left-tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"leftTab() === 'add'\" [class.wd__left-tab--on]=\"leftTab() === 'add'\" (click)=\"leftTab.set('add')\">{{ s.add }}</button>\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"leftTab() === 'outline'\" [class.wd__left-tab--on]=\"leftTab() === 'outline'\" (click)=\"leftTab.set('outline')\">{{ s.explorer }}</button>\n </div>\n @if (leftTab() === 'add') {\n <h2>{{ s.toolbox }}</h2>\n <p class=\"wd__hint\">{{ s.toolboxHint }} {{ s.addByClick }}</p>\n <div class=\"wd__tools\">\n @for (item of toolbox; track $index) {\n <div class=\"wd__tool\" draggable=\"true\" role=\"button\" tabindex=\"0\" (dragstart)=\"onToolDragStart($event, item)\" (click)=\"onToolClick(item)\" (keydown.enter)=\"onToolClick(item)\" [title]=\"s.controlNames[item.type]\">\n <span [innerHTML]=\"iconName(item.icon) | weReportIcon\"></span>\n <span>{{ item.variant === 'qrcode' ? 'QR' : s.controlNames[item.type] }}</span>\n </div>\n }\n </div>\n\n <h2>{{ s.fields }}</h2>\n @if (fields().rows.length || fields().parent.length) {\n <p class=\"wd__hint\">{{ s.fieldsHint }}</p>\n @if (allFields().length > 8) {\n <input class=\"wd__field-filter\" type=\"search\" [placeholder]=\"s.filterFields\" [attr.aria-label]=\"s.filterFields\" [value]=\"fieldFilter()\" (input)=\"fieldFilter.set($any($event.target).value)\" />\n }\n <ul class=\"wd__fields\">\n @for (f of shownFields().rows; track f.path) {\n <li draggable=\"true\" tabindex=\"0\" role=\"button\" (dragstart)=\"onFieldDragStart($event, f)\" (dblclick)=\"onFieldDblClick(f)\" (keydown.enter)=\"onFieldDblClick(f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n @if (shownFields().inner.length) {\n <h3>{{ s.innerFields }}</h3>\n <ul class=\"wd__fields\">\n @for (f of shownFields().inner; track f.path) {\n <li draggable=\"true\" tabindex=\"0\" role=\"button\" (dragstart)=\"onFieldDragStart($event, f)\" (dblclick)=\"onFieldDblClick(f)\" (keydown.enter)=\"onFieldDblClick(f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n }\n @if (shownFields().parent.length) {\n <h3>{{ s.parentFields }}</h3>\n <ul class=\"wd__fields\">\n @for (f of shownFields().parent; track f.path) {\n <li draggable=\"true\" tabindex=\"0\" role=\"button\" (dragstart)=\"onFieldDragStart($event, f)\" (dblclick)=\"onFieldDblClick(f)\" (keydown.enter)=\"onFieldDblClick(f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n }\n } @else {\n <p class=\"wd__hint\">{{ s.noFields }}</p>\n }\n } @else {\n <p class=\"wd__hint\">{{ s.explorerHint }}</p>\n <ul class=\"wd__outline\" role=\"tree\">\n @for (band of state.report().bands; track band.id) {\n <li role=\"treeitem\" [attr.aria-expanded]=\"true\">\n <button type=\"button\" class=\"wd__outline-band\" [class.wd__outline--on]=\"state.selection().kind === 'band' && state.selectedBand()?.id === band.id\" (click)=\"state.selection.set({ kind: 'band', id: band.id })\">\n {{ s.bandNames[band.kind] }}\n </button>\n <ul role=\"group\">\n @for (c of band.controls; track c.id) {\n <li role=\"treeitem\">\n <button type=\"button\" class=\"wd__outline-item\" [class.wd__outline--on]=\"isSelected(c.id)\" (click)=\"selectFromOutline($event, c.id)\">\n <span [innerHTML]=\"outlineIcon(c) | weReportIcon\"></span><span class=\"wd__outline-text\">{{ outlineLabel(c) }}</span>\n </button>\n </li>\n } @empty {\n <li class=\"wd__outline-empty\">{{ s.emptyBand }}</li>\n }\n </ul>\n </li>\n }\n </ul>\n }\n </aside>\n\n <div class=\"wd__splitter\" role=\"separator\" aria-orientation=\"vertical\" [title]=\"s.resizePanel\" (pointerdown)=\"startResize($event, 'left')\" (dblclick)=\"togglePanel('left')\"></div>\n <div class=\"wd__center\">\n @let st = formatStyle();\n <div class=\"wd__formatbar\" role=\"toolbar\" [attr.aria-label]=\"s.formatBar\" [class.wd__formatbar--off]=\"!st\">\n <select class=\"wd__font\" [disabled]=\"!st\" (change)=\"format('fontFamily', $any($event.target).value)\" [attr.aria-label]=\"s.font\" [title]=\"s.font\">\n @for (f of fontFamilies(); track f) {\n <option [value]=\"f\" [selected]=\"st?.fontFamily === f\">{{ f }}</option>\n }\n @if (st && !fontFamilies().includes(st.fontFamily)) {\n <option [value]=\"st.fontFamily\" selected>{{ st.fontFamily }}</option>\n }\n </select>\n <input class=\"wd__size\" type=\"number\" min=\"4\" max=\"200\" step=\"1\" [attr.list]=\"sizeListId\" [disabled]=\"!st\" [value]=\"st?.fontSize ?? ''\" (change)=\"format('fontSize', +$any($event.target).value || undefined)\" [attr.aria-label]=\"s.fontSize\" [title]=\"s.fontSize\" />\n <datalist [id]=\"sizeListId\">\n @for (n of fontSizes; track n) {\n <option [value]=\"n\"></option>\n }\n </datalist>\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"st?.bold\" (click)=\"toggleFormat('bold')\" [title]=\"s.bold + ' (Ctrl+B)'\" [attr.aria-pressed]=\"!!st?.bold\"><b>B</b></button>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"st?.italic\" (click)=\"toggleFormat('italic')\" [title]=\"s.italic + ' (Ctrl+I)'\" [attr.aria-pressed]=\"!!st?.italic\"><i>I</i></button>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"st?.underline\" (click)=\"toggleFormat('underline')\" [title]=\"s.underline + ' (Ctrl+U)'\" [attr.aria-pressed]=\"!!st?.underline\"><u>U</u></button>\n <span class=\"wd__sep\"></span>\n @for (a of textAligns; track a.value) {\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"st?.textAlign === a.value\" (click)=\"format('textAlign', a.value)\" [title]=\"s[a.label]\" [attr.aria-label]=\"s[a.label]\" [innerHTML]=\"a.icon | weReportIcon\"></button>\n }\n <span class=\"wd__sep\"></span>\n <label class=\"wd__well\" [title]=\"s.textColor\">\n <span>A</span>\n <input type=\"color\" [disabled]=\"!st\" [value]=\"st?.color ?? '#000000'\" (input)=\"format('color', $any($event.target).value)\" [attr.aria-label]=\"s.textColor\" />\n </label>\n <label class=\"wd__well wd__well--fill\" [title]=\"s.backgroundColor\">\n <span [style.background]=\"st?.backgroundColor ?? 'transparent'\"></span>\n <input type=\"color\" [disabled]=\"!st\" [value]=\"st?.backgroundColor ?? '#ffffff'\" (input)=\"format('backgroundColor', $any($event.target).value)\" [attr.aria-label]=\"s.backgroundColor\" />\n </label>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" (click)=\"format('backgroundColor', undefined)\" [title]=\"s.backgroundColor + ': ' + s.noColor\" [attr.aria-label]=\"s.noColor\" [innerHTML]=\"'noColor' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"!!st?.border\" (click)=\"setBorder(true)\" [title]=\"s.allBorders\" [attr.aria-label]=\"s.allBorders\" [innerHTML]=\"'borderAll' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" (click)=\"setBorder(false)\" [title]=\"s.noBorder\" [attr.aria-label]=\"s.noBorder\" [innerHTML]=\"'borderNone' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"!!state.painter()\" (click)=\"togglePainter()\" [title]=\"s.formatPainter\" [attr.aria-label]=\"s.formatPainter\" [attr.aria-pressed]=\"!!state.painter()\" [innerHTML]=\"'brush' | weReportIcon\"></button>\n </div>\n <main #canvas class=\"wd__canvas\" tabindex=\"-1\" (contextmenu)=\"openContextMenu($event)\" (wheel)=\"onCanvasWheel($event)\">\n <we-report-design-surface [strings]=\"s\" [zoom]=\"zoomLevel()\" [gridSize]=\"gridSize()\" [sample]=\"sample()\" [fields]=\"allFields()\" />\n </main>\n </div>\n\n <div class=\"wd__splitter\" role=\"separator\" aria-orientation=\"vertical\" [title]=\"s.resizePanel\" (pointerdown)=\"startResize($event, 'right')\" (dblclick)=\"togglePanel('right')\"></div>\n <aside class=\"wd__right\" [class.wd__collapsed]=\"!rightWidth()\">\n <we-report-property-panel [strings]=\"s\" [fields]=\"allFields()\" [lists]=\"fields().lists\" [fontFamilies]=\"fontFamilies()\" [advanced]=\"advanced()\" />\n </aside>\n </div>\n <footer class=\"wd__status\" aria-live=\"polite\">\n @let info = selectionInfo();\n <span class=\"wd__status-sel\">{{ info.title }}</span>\n @if (info.box; as b) {\n <span>{{ s.left }} {{ mm(b.x) }}</span>\n <span>{{ s.top }} {{ mm(b.y) }}</span>\n <span>{{ s.width }} {{ mm(b.width) }}</span>\n <span>{{ s.height }} {{ mm(b.height) }} mm</span>\n }\n <span class=\"wd__spacer\"></span>\n <span class=\"wd__status-pointer\">{{ pointerInfo() }}</span>\n <span>{{ (zoomLevel() * 100).toFixed(0) }}%</span>\n </footer>\n} @else {\n <we-report-viewer class=\"wd__preview\" [report]=\"state.report()\" [data]=\"data()\" [locale]=\"s\" [fetchFn]=\"fetchFn()\" />\n}\n\n@if (dataDialogOpen()) {\n <we-report-data-sources-dialog [strings]=\"s\" [fetchFn]=\"fetchFn()\" (closed)=\"dataDialogOpen.set(false)\" />\n}\n\n@if (contextMenu(); as m) {\n <div class=\"wd__menu-list wd__context\" role=\"menu\" [style.left.px]=\"m.x\" [style.top.px]=\"m.y\" (keydown.escape)=\"contextMenu.set(null)\">\n @if (m.onControl) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.cutSelection.bind(state))\"><span [innerHTML]=\"'cut' | weReportIcon\"></span>{{ s.cut }}<kbd>Ctrl+X</kbd></button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.copySelection.bind(state))\"><span [innerHTML]=\"'copy' | weReportIcon\"></span>{{ s.copy }}<kbd>Ctrl+C</kbd></button>\n }\n <button type=\"button\" role=\"menuitem\" [disabled]=\"!state.hasClipboard()\" (click)=\"menu(state.paste.bind(state, m.bandId ?? undefined))\"><span [innerHTML]=\"'paste' | weReportIcon\"></span>{{ s.paste }}<kbd>Ctrl+V</kbd></button>\n @if (m.onControl) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(editSelected.bind(this))\"><span [innerHTML]=\"'edit' | weReportIcon\"></span>{{ s.editText }}<kbd>F2</kbd></button>\n @if (totalTarget()) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(addTotal.bind(this))\"><span [innerHTML]=\"'sum' | weReportIcon\"></span>{{ s.addTotal }}</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(groupByValue.bind(this))\"><span [innerHTML]=\"'outline' | weReportIcon\"></span>{{ s.groupByThis }}</button>\n }\n @if (hasTextSelected()) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(fitToText.bind(this))\"><span [innerHTML]=\"'sameWidth' | weReportIcon\"></span>{{ s.fitToText }}</button>\n }\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.duplicateSelection.bind(state))\"><span [innerHTML]=\"'copy' | weReportIcon\"></span>{{ s.duplicate }}<kbd>Ctrl+D</kbd></button>\n <hr />\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.arrange.bind(state, 'front'))\"><span [innerHTML]=\"'bringToFront' | weReportIcon\"></span>{{ s.bringToFront }}</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.arrange.bind(state, 'back'))\"><span [innerHTML]=\"'sendToBack' | weReportIcon\"></span>{{ s.sendToBack }}</button>\n <hr />\n <button type=\"button\" role=\"menuitem\" class=\"wd__danger\" (click)=\"menu(state.deleteSelection.bind(state))\"><span [innerHTML]=\"'trash' | weReportIcon\"></span>{{ s.delete }}<kbd>Del</kbd></button>\n } @else {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(addTextAt.bind(this, m.bandId, m.at))\"><span [innerHTML]=\"'text' | weReportIcon\"></span>{{ s.addTextHere }}</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.selectAll.bind(state))\"><span [innerHTML]=\"'outline' | weReportIcon\"></span>{{ s.selectAll }}<kbd>Ctrl+A</kbd></button>\n @if (m.bandId) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.toggleCollapsed.bind(state, m.bandId))\"><span [innerHTML]=\"'fitHeight' | weReportIcon\"></span>{{ state.collapsed().has(m.bandId) ? s.expandBand : s.collapseBand }}</button>\n }\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(fitBand.bind(this, m.bandId))\"><span [innerHTML]=\"'fitHeight' | weReportIcon\"></span>{{ s.fitBandToContent }}</button>\n @if (state.selectedBand()?.kind !== 'detail') {\n <hr />\n <button type=\"button\" role=\"menuitem\" class=\"wd__danger\" (click)=\"menu(state.deleteSelection.bind(state))\"><span [innerHTML]=\"'trash' | weReportIcon\"></span>{{ s.removeBand }}</button>\n }\n }\n </div>\n}\n\n@if (wizard(); as w) {\n <div class=\"wd__sheet-backdrop\" (click)=\"wizard.set(null)\"></div>\n <div class=\"wd__sheet wd__wizard\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"s.wizardTitle\" (keydown.escape)=\"wizard.set(null)\">\n <h2>{{ s.wizardTitle }}</h2>\n <label class=\"wd__wizard-row\">\n <span>{{ s.wizardReportTitle }}</span>\n <input type=\"text\" [value]=\"w.title\" (input)=\"updateWizard({ title: $any($event.target).value })\" />\n </label>\n <fieldset class=\"wd__wizard-fields\">\n <legend>{{ s.wizardColumns }}</legend>\n @for (f of w.fields; track f.name) {\n <label><input type=\"checkbox\" [checked]=\"f.on\" [disabled]=\"f.name === w.groupBy\" (change)=\"toggleWizardField(f.name)\" /> {{ f.name }}</label>\n }\n </fieldset>\n <label class=\"wd__wizard-row\">\n <span>{{ s.groupBy }}</span>\n <select (change)=\"updateWizard({ groupBy: $any($event.target).value })\">\n <option value=\"\" [selected]=\"!w.groupBy\">{{ s.noGrouping }}</option>\n @for (f of w.fields; track f.name) {\n <option [value]=\"f.name\" [selected]=\"f.name === w.groupBy\">{{ f.name }}</option>\n }\n </select>\n </label>\n <div class=\"wd__wizard-row\">\n <span>{{ s.sortRows }}</span>\n <span class=\"wd__wizard-pair\">\n <select (change)=\"updateWizard({ sortBy: $any($event.target).value })\" [attr.aria-label]=\"s.sortRows\">\n <option value=\"\" [selected]=\"!w.sortBy\">{{ s.dataOrder }}</option>\n @for (f of w.fields; track f.name) {\n <option [value]=\"f.name\" [selected]=\"f.name === w.sortBy\">{{ f.name }}</option>\n }\n </select>\n <select [disabled]=\"!w.sortBy\" (change)=\"updateWizard({ sortDescending: $any($event.target).value === 'desc' })\" [attr.aria-label]=\"s.sortRows\">\n <option value=\"asc\" [selected]=\"!w.sortDescending\">{{ s.sortAsc }}</option>\n <option value=\"desc\" [selected]=\"w.sortDescending\">{{ s.sortDesc }}</option>\n </select>\n </span>\n </div>\n <label class=\"wd__wizard-row\">\n <span>{{ s.orientation }}</span>\n <select (change)=\"updateWizard({ orientation: $any($event.target).value })\">\n <option value=\"\" [selected]=\"!w.orientation\">{{ s.automatic }}</option>\n <option value=\"portrait\" [selected]=\"w.orientation === 'portrait'\">{{ s.portrait }}</option>\n <option value=\"landscape\" [selected]=\"w.orientation === 'landscape'\">{{ s.landscape }}</option>\n </select>\n </label>\n <label class=\"wd__wizard-check\"><input type=\"checkbox\" [checked]=\"w.totals\" (change)=\"updateWizard({ totals: !w.totals })\" /> {{ s.wizardTotals }}</label>\n <p class=\"wd__wizard-hint\">{{ s.autoDesignHint }}</p>\n <div class=\"wd__wizard-actions\">\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"wizard.set(null)\">{{ s.cancel }}</button>\n <button type=\"button\" class=\"wd__primary\" [disabled]=\"!wizardReady()\" (click)=\"runWizard()\">{{ s.createReport }}</button>\n </div>\n </div>\n}\n\n@if (shortcutsOpen()) {\n <div class=\"wd__sheet-backdrop\" (click)=\"shortcutsOpen.set(false)\"></div>\n <div class=\"wd__sheet\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"s.keyboardShortcuts\" (keydown.escape)=\"shortcutsOpen.set(false)\">\n <h2>{{ s.keyboardShortcuts }}</h2>\n <dl class=\"wd__keys\">\n <dt>Ctrl+Z \u00B7 Ctrl+Y</dt><dd>{{ s.undo }} \u00B7 {{ s.redo }}</dd>\n <dt>Ctrl+X \u00B7 Ctrl+C \u00B7 Ctrl+V</dt><dd>{{ s.cut }} \u00B7 {{ s.copy }} \u00B7 {{ s.paste }}</dd>\n <dt>Ctrl+D</dt><dd>{{ s.duplicate }}</dd>\n <dt>Delete</dt><dd>{{ s.delete }}</dd>\n <dt>Ctrl+A</dt><dd>{{ s.selectAll }}</dd>\n <dt>F2 \u00B7 Enter \u00B7 \u29C9</dt><dd>{{ s.editText }}</dd>\n <dt>Ctrl+B \u00B7 Ctrl+I \u00B7 Ctrl+U</dt><dd>{{ s.bold }} \u00B7 {{ s.italic }} \u00B7 {{ s.underline }}</dd>\n <dt>\u2190 \u2191 \u2192 \u2193 \u00B7 Shift</dt><dd>{{ s.moveItem }} (1 / 5 mm)</dd>\n <dt>Alt + \u2190 \u2191 \u2192 \u2193</dt><dd>{{ s.moveFine }}</dd>\n <dt>Ctrl + \u2190 \u2191 \u2192 \u2193</dt><dd>{{ s.resizeItem }}</dd>\n <dt>Tab \u00B7 Shift+Tab</dt><dd>{{ s.nextItem }}</dd>\n <dt>Ctrl+= \u00B7 Ctrl+- \u00B7 Ctrl+0</dt><dd>{{ s.zoomIn }} \u00B7 {{ s.zoomOut }} \u00B7 {{ s.fitWidth }}</dd>\n <dt>Alt</dt><dd>{{ s.noSnap }}</dd>\n <dt>Ctrl + \u21F1</dt><dd>{{ s.dragCopy }}</dd>\n <dt>\u2B1A</dt><dd>{{ s.rubberBand }}</dd>\n <dt>F5</dt><dd>{{ s.preview }} \u00B7 {{ s.design }}</dd>\n <dt>F1</dt><dd>{{ s.keyboardShortcuts }}</dd>\n </dl>\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"shortcutsOpen.set(false)\">{{ s.close }}</button>\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;min-height:0;height:100%;font-family:var(--we-report-font-family, system-ui, sans-serif);font-size:13px;line-height:1.38;letter-spacing:-.003em;color:var(--we-report-fg, #1d1d1f);background:var(--we-report-workspace-bg, #f2f2f7);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease}button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}@media (prefers-reduced-motion: reduce){button{transition:none}}.wd__toolbar{position:relative;z-index:10;display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-height:52px;padding:8px 14px;background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14));box-sizing:border-box}.wd__tabs,.wd__mode{display:inline-flex;padding:2px;gap:2px;border-radius:9px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.wd__tabs button,.wd__mode button{display:inline-flex;align-items:center;gap:6px;border:0;border-radius:7px;padding:4px 12px;background:transparent;font-weight:500;cursor:pointer}.wd__tabs button :is(svg),.wd__mode button :is(svg){width:15px;height:15px}.wd__tab--on,.wd__mode--on{background:var(--we-report-segment-on-bg, #fff)!important;box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.wd__icon,.wd__text-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:30px;height:30px;border:0;border-radius:var(--we-report-control-radius, 7px);background:transparent;cursor:pointer}.wd__icon :is(svg),.wd__text-btn :is(svg){width:17px;height:17px}.wd__icon:hover:not(:disabled),.wd__text-btn:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__icon:disabled,.wd__text-btn:disabled{opacity:.3;cursor:default}.wd__text-btn{padding:0 10px;font-weight:500}.wd__magic{color:var(--we-report-accent, #007aff)}.wd__issues{color:var(--we-report-warning-fg, #b25000);background:var(--we-report-warning-bg, rgba(255, 149, 0, .12))}.wd__sep{width:.5px;height:20px;margin:0 6px;background:var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__zoom{height:26px;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 4px;background:transparent;font:inherit;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));cursor:pointer}.wd__zoom:hover{background:var(--we-report-input-bg, rgba(118, 118, 128, .1))}.wd__toggle{display:inline-flex;align-items:center;gap:6px;margin:0 6px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));cursor:pointer}.wd__toggle input{accent-color:var(--we-report-accent, #007aff)}.wd__spacer{flex:1}.wd__menu{position:relative}.wd__menu-list{position:absolute;top:calc(100% + 6px);left:0;z-index:20;display:flex;flex-direction:column;min-width:220px;padding:5px;border-radius:var(--we-report-radius, 12px);background:var(--we-report-panel-bg, #fbfbfd);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14));animation:wd-pop .14s ease-out}.wd__menu-list button{text-align:left;border:0;border-radius:6px;padding:6px 10px;background:transparent;cursor:pointer}.wd__menu-list button:hover{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}@keyframes wd-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}}@media (prefers-reduced-motion: reduce){.wd__menu-list{animation:none}}.wd__problems{left:auto;right:0;width:380px;max-height:380px;overflow:auto}.wd__problem{display:flex;align-items:flex-start;gap:6px}.wd__problem .wd__problem-text{flex:1;font-size:12px}.wd__problem .wd__problem-text:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))!important;color:inherit!important}.wd__problem code{font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__fix{flex:none;font-weight:600;color:var(--we-report-accent, #007aff)!important}.wd__body{flex:1;display:grid;grid-template-columns:232px 6px minmax(0,1fr) 6px 288px;min-height:0}.wd__left,.wd__right{overflow:auto;background:var(--we-report-panel-bg, #fbfbfd)}.wd__left{padding:14px 12px 28px}.wd__left h2{margin:4px 4px 2px;font-size:13px;font-weight:600}.wd__left h3{margin:16px 4px 4px;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__left,.wd__right{min-width:0}.wd__hint{margin:0 4px 10px;font-size:11.5px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__tools{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:20px}.wd__tool{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 4px 10px;border-radius:10px;background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14)),0 1px 2px #0000000a;font-size:11.5px;text-align:center;cursor:grab;-webkit-user-select:none;user-select:none;transition:transform .15s ease,box-shadow .15s ease}.wd__tool :is(svg){width:20px;height:20px;color:var(--we-report-accent, #007aff)}.wd__tool:hover{transform:translateY(-1px);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14)),0 4px 12px #00000014}.wd__tool:active{cursor:grabbing;transform:scale(.97)}@media (prefers-reduced-motion: reduce){.wd__tool{transition:none}.wd__tool:hover,.wd__tool:active{transform:none}}.wd__fields{list-style:none;margin:0;padding:0}.wd__fields li{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:grab;-webkit-user-select:none;user-select:none}.wd__fields li:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__field-type{display:inline-flex;align-items:center;justify-content:center;flex:none;width:18px;height:18px;border-radius:5px;font-size:10px;font-weight:700;text-transform:uppercase;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff)}.wd__center{display:flex;flex-direction:column;min-width:0;min-height:0}.wd__canvas{flex:1;min-height:0;overflow:auto;outline:none}.wd__preview{flex:1;min-height:0}.wd__left-tabs{display:flex;padding:2px;gap:2px;margin-bottom:14px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.wd__left-tabs button{flex:1;border:0;border-radius:6px;padding:4px 8px;background:transparent;font-size:12px;font-weight:500;cursor:pointer}.wd__left-tab--on{background:var(--we-report-segment-on-bg, #fff)!important;box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.wd__outline{list-style:none;margin:0;padding:0}.wd__outline ul{list-style:none;margin:0 0 8px;padding:0 0 0 10px}.wd__outline button{display:flex;align-items:center;gap:6px;width:100%;border:0;border-radius:6px;padding:4px 8px;background:transparent;text-align:left;cursor:pointer}.wd__outline button:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__outline button :is(svg){flex:none;width:14px;height:14px;color:var(--we-report-accent, #007aff)}.wd__outline-band{font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__outline-item{font-size:12px}.wd__outline-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wd__outline--on,.wd__outline--on:hover{background:var(--we-report-accent, #007aff)!important;color:var(--we-report-accent-fg, #fff)!important}.wd__outline--on :is(svg),.wd__outline--on:hover :is(svg){color:inherit!important}.wd__outline-empty{padding:2px 8px;font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__context{position:fixed;z-index:200}.wd__context button{display:flex;align-items:center;gap:8px}.wd__context button :is(svg){width:14px;height:14px}.wd__context button:disabled{opacity:.4;cursor:default;background:transparent!important;color:inherit!important}.wd__context kbd{margin-left:auto;padding-left:16px;font:inherit;font-size:11px;opacity:.55}.wd__context hr{width:100%;margin:4px 0;border:0;border-top:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__danger{color:var(--we-report-warning-fg, #b25000)}.wd__formatbar{display:flex;align-items:center;flex-wrap:wrap;gap:2px;min-height:40px;padding:4px 14px;box-sizing:border-box;background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__formatbar select,.wd__formatbar input[type=number]{height:28px;box-sizing:border-box;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 8px;background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:inherit}.wd__formatbar select:focus,.wd__formatbar input[type=number]:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.wd__formatbar select:disabled,.wd__formatbar input[type=number]:disabled{opacity:.4}.wd__font{width:150px}.wd__size{width:62px;font-variant-numeric:tabular-nums}.wd__fmt{min-width:28px;height:28px;font-size:14px}.wd__fmt--on{background:var(--we-report-selection-fill, rgba(0, 122, 255, .07))!important;color:var(--we-report-accent, #007aff);box-shadow:inset 0 0 0 1px var(--we-report-selection, #007aff)}.wd__well{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--we-report-control-radius, 7px);cursor:pointer}.wd__well:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__well span{font-weight:700;font-size:14px}.wd__well input{position:absolute;left:4px;right:4px;bottom:3px;height:4px;width:auto;padding:0;border:0;opacity:1;cursor:pointer;pointer-events:auto}.wd__well input::-webkit-color-swatch-wrapper{padding:0}.wd__well input::-webkit-color-swatch{border:0;border-radius:1px}.wd__well--fill span{width:14px;height:14px;border-radius:3px;box-shadow:inset 0 0 0 1px var(--we-report-separator, rgba(60, 60, 67, .3))}.wd__formatbar--off .wd__well{opacity:.4;pointer-events:none}.wd__status{display:flex;align-items:center;gap:14px;min-height:26px;padding:0 14px;font-size:11.5px;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));border-top:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__status-sel{color:var(--we-report-fg, #1d1d1f);font-weight:500}.wd__splitter{position:relative;cursor:col-resize;background:var(--we-report-panel-bg, #fbfbfd);touch-action:none}.wd__splitter:after{content:\"\";position:absolute;top:0;bottom:0;left:50%;width:.5px;background:var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__splitter:hover:after{width:2px;margin-left:-1px;background:var(--we-report-accent, #007aff)}.wd__tool:focus-visible,.wd__fields li:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.wd__field-filter{width:100%;height:28px;box-sizing:border-box;margin-bottom:6px;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 8px;background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:inherit}.wd__wizard{display:flex;flex-direction:column;gap:10px}.wd__wizard input[type=text],.wd__wizard select{height:28px;box-sizing:border-box;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 8px;background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:inherit}.wd__wizard-row{display:grid;grid-template-columns:140px 1fr;align-items:center;gap:8px}.wd__wizard-pair{display:grid;grid-template-columns:1fr 1fr;gap:6px}.wd__wizard-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:4px 12px;max-height:220px;overflow:auto;margin:0;padding:8px 10px;border:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14));border-radius:var(--we-report-control-radius, 7px)}.wd__wizard-fields legend{padding:0 4px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__wizard-fields label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wd__wizard-hint{margin:0;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));font-size:12px}.wd__wizard-actions{display:flex;justify-content:flex-end;gap:8px}.wd__primary{height:30px;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 14px;background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff);font:inherit;font-weight:600;cursor:pointer}.wd__sheet-backdrop{position:fixed;inset:0;z-index:150;background:var(--we-report-backdrop, rgba(0, 0, 0, .22))}.wd__sheet{position:fixed;top:50%;left:50%;z-index:151;transform:translate(-50%,-50%);width:min(560px,100vw - 32px);max-height:calc(100vh - 32px);overflow:auto;box-sizing:border-box;padding:20px 22px;border-radius:14px;background:var(--we-report-panel-bg, #fbfbfd);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14))}.wd__sheet h2{margin:0 0 12px;font-size:15px;font-weight:600}.wd__keys{display:grid;grid-template-columns:max-content 1fr;gap:6px 16px;margin:0 0 14px}.wd__keys dt{font:12px ui-monospace,SF Mono,Menlo,Consolas,monospace;color:var(--we-report-accent, #007aff)}.wd__keys dd{margin:0}.wd__collapsed{visibility:hidden;padding:0!important;overflow:hidden!important}\n"], dependencies: [{ kind: "component", type: DesignSurfaceComponent, selector: "we-report-design-surface", inputs: ["strings", "zoom", "gridSize", "sample", "fields"] }, { kind: "component", type: PropertyPanelComponent, selector: "we-report-property-panel", inputs: ["strings", "fields", "fontFamilies", "advanced", "lists"] }, { kind: "component", type: WeReportViewerComponent, selector: "we-report-viewer", inputs: ["report", "data", "zoom", "locale", "printDate", "parameters", "fetchFn"], outputs: ["problems", "rendered"] }, { kind: "pipe", type: WeReportIconPipe, name: "weReportIcon" }, { kind: "component", type: DataSourcesDialogComponent, selector: "we-report-data-sources-dialog", inputs: ["strings", "fetchFn"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5496
7063
|
}
|
|
5497
7064
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportDesignerComponent, decorators: [{
|
|
5498
7065
|
type: Component,
|
|
5499
|
-
args: [{ selector: 'we-report-designer', standalone: true, imports: [DesignSurfaceComponent, PropertyPanelComponent, WeReportViewerComponent, WeReportIconPipe, DataSourcesDialogComponent], providers: [DesignerState], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let s = strings();\n<div class=\"wd__toolbar\" role=\"toolbar\">\n <div class=\"wd__tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'design'\" [class.wd__tab--on]=\"tab() === 'design'\" (click)=\"tab.set('design')\">\n <span [innerHTML]=\"'design' | weReportIcon\"></span>{{ s.design }}\n </button>\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'preview'\" [class.wd__tab--on]=\"tab() === 'preview'\" (click)=\"tab.set('preview')\">\n <span [innerHTML]=\"'preview' | weReportIcon\"></span>{{ s.preview }}\n </button>\n </div>\n @if (tab() === 'design') {\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"!state.canUndo()\" (click)=\"state.undo()\" [title]=\"s.undo + ' (Ctrl+Z)'\" [attr.aria-label]=\"s.undo\" [innerHTML]=\"'undo' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"!state.canRedo()\" (click)=\"state.redo()\" [title]=\"s.redo + ' (Ctrl+Y)'\" [attr.aria-label]=\"s.redo\" [innerHTML]=\"'redo' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"state.selection().kind !== 'controls'\" (click)=\"state.deleteSelection()\" [title]=\"s.delete + ' (Del)'\" [attr.aria-label]=\"s.delete\" [innerHTML]=\"'trash' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() - 0.1)\" [title]=\"s.zoomOut\" [attr.aria-label]=\"s.zoomOut\" [innerHTML]=\"'zoomOut' | weReportIcon\"></button>\n <span class=\"wd__zoom\">{{ (zoomLevel() * 100).toFixed(0) }}%</span>\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() + 0.1)\" [title]=\"s.zoomIn\" [attr.aria-label]=\"s.zoomIn\" [innerHTML]=\"'zoomIn' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" (click)=\"fitWidth()\" [title]=\"s.fitWidth\" [attr.aria-label]=\"s.fitWidth\" [innerHTML]=\"'fitWidth' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <div class=\"wd__menu\">\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"bandMenuOpen.set(!bandMenuOpen())\" [attr.aria-expanded]=\"bandMenuOpen()\">+ {{ s.addBand }}</button>\n @if (bandMenuOpen()) {\n <div class=\"wd__menu-list\" role=\"menu\">\n @for (k of addableBands(); track k) {\n <button type=\"button\" role=\"menuitem\" (click)=\"addBand(k)\">{{ k === 'groupHeader' ? s.groupBy + '\u2026' : s.bandNames[k] }}</button>\n }\n </div>\n }\n </div>\n @if (fields().rows.length) {\n <button type=\"button\" class=\"wd__text-btn wd__magic\" (click)=\"autoDesign()\" [title]=\"s.autoDesignHint\">\u2728 {{ s.autoDesign }}</button>\n }\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"dataDialogOpen.set(true)\">\n <span [innerHTML]=\"'database' | weReportIcon\"></span> {{ s.dataSources }}\n </button>\n <label class=\"wd__toggle\">\n <input type=\"checkbox\" [checked]=\"showData()\" (change)=\"showData.set($any($event.target).checked)\" />\n {{ s.showData }}\n </label>\n <span class=\"wd__spacer\"></span>\n <div class=\"wd__menu\">\n <button type=\"button\" class=\"wd__text-btn\" [class.wd__issues]=\"issues().length\" (click)=\"problemsOpen.set(!problemsOpen())\" [attr.aria-expanded]=\"problemsOpen()\">\n {{ issues().length ? '\u26A0 ' + issues().length : '\u2713' }} {{ s.problems }}\n </button>\n @if (problemsOpen()) {\n <div class=\"wd__menu-list wd__problems\" role=\"list\">\n @for (issue of issues(); track $index) {\n <div class=\"wd__problem\" role=\"listitem\">\n <button type=\"button\" class=\"wd__problem-text\" (click)=\"showIssue(issue)\">\n <code>{{ issue.controlId }}</code> {{ issueText(issue) }}\n </button>\n @if (issue.code === 'outsidePage') {\n <button type=\"button\" class=\"wd__fix\" (click)=\"fixIssue(issue)\">{{ s.fixIt }}</button>\n }\n </div>\n } @empty {\n <p class=\"wd__hint\">{{ s.noProblems }}</p>\n }\n </div>\n }\n </div>\n <div class=\"wd__mode\" role=\"radiogroup\">\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"!advanced()\" [class.wd__mode--on]=\"!advanced()\" (click)=\"advanced.set(false)\">{{ s.basicMode }}</button>\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"advanced()\" [class.wd__mode--on]=\"advanced()\" (click)=\"advanced.set(true)\">{{ s.advancedMode }}</button>\n </div>\n }\n</div>\n\n@if (tab() === 'design') {\n <div class=\"wd__body\">\n <aside class=\"wd__left\">\n <div class=\"wd__left-tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"leftTab() === 'add'\" [class.wd__left-tab--on]=\"leftTab() === 'add'\" (click)=\"leftTab.set('add')\">{{ s.add }}</button>\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"leftTab() === 'outline'\" [class.wd__left-tab--on]=\"leftTab() === 'outline'\" (click)=\"leftTab.set('outline')\">{{ s.explorer }}</button>\n </div>\n @if (leftTab() === 'add') {\n <h2>{{ s.toolbox }}</h2>\n <p class=\"wd__hint\">{{ s.toolboxHint }}</p>\n <div class=\"wd__tools\">\n @for (item of toolbox; track $index) {\n <div class=\"wd__tool\" draggable=\"true\" (dragstart)=\"onToolDragStart($event, item)\" [title]=\"s.controlNames[item.type]\">\n <span [innerHTML]=\"iconName(item.icon) | weReportIcon\"></span>\n <span>{{ item.variant === 'qrcode' ? 'QR' : s.controlNames[item.type] }}</span>\n </div>\n }\n </div>\n\n <h2>{{ s.fields }}</h2>\n @if (fields().rows.length || fields().parent.length) {\n <p class=\"wd__hint\">{{ s.fieldsHint }}</p>\n <ul class=\"wd__fields\">\n @for (f of fields().rows; track f.path) {\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n @if (fields().inner.length) {\n <h3>{{ s.innerFields }}</h3>\n <ul class=\"wd__fields\">\n @for (f of fields().inner; track f.path) {\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n }\n @if (fields().parent.length) {\n <h3>{{ s.parentFields }}</h3>\n <ul class=\"wd__fields\">\n @for (f of fields().parent; track f.path) {\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n }\n } @else {\n <p class=\"wd__hint\">{{ s.noFields }}</p>\n }\n } @else {\n <p class=\"wd__hint\">{{ s.explorerHint }}</p>\n <ul class=\"wd__outline\" role=\"tree\">\n @for (band of state.report().bands; track band.id) {\n <li role=\"treeitem\" [attr.aria-expanded]=\"true\">\n <button type=\"button\" class=\"wd__outline-band\" [class.wd__outline--on]=\"state.selection().kind === 'band' && state.selectedBand()?.id === band.id\" (click)=\"state.selection.set({ kind: 'band', id: band.id })\">\n {{ s.bandNames[band.kind] }}\n </button>\n <ul role=\"group\">\n @for (c of band.controls; track c.id) {\n <li role=\"treeitem\">\n <button type=\"button\" class=\"wd__outline-item\" [class.wd__outline--on]=\"isSelected(c.id)\" (click)=\"selectFromOutline($event, c.id)\">\n <span [innerHTML]=\"outlineIcon(c) | weReportIcon\"></span><span class=\"wd__outline-text\">{{ outlineLabel(c) }}</span>\n </button>\n </li>\n } @empty {\n <li class=\"wd__outline-empty\">{{ s.emptyBand }}</li>\n }\n </ul>\n </li>\n }\n </ul>\n }\n </aside>\n\n <main #canvas class=\"wd__canvas\" tabindex=\"-1\" (contextmenu)=\"openContextMenu($event)\" (wheel)=\"onCanvasWheel($event)\">\n <we-report-design-surface [strings]=\"s\" [zoom]=\"zoomLevel()\" [sample]=\"sample()\" />\n </main>\n\n <aside class=\"wd__right\">\n <we-report-property-panel [strings]=\"s\" [fields]=\"allFields()\" [lists]=\"fields().lists\" [fontFamilies]=\"fontFamilies()\" [advanced]=\"advanced()\" />\n </aside>\n </div>\n} @else {\n <we-report-viewer class=\"wd__preview\" [report]=\"state.report()\" [data]=\"data()\" [locale]=\"s\" [fetchFn]=\"fetchFn()\" />\n}\n\n@if (dataDialogOpen()) {\n <we-report-data-sources-dialog [strings]=\"s\" [fetchFn]=\"fetchFn()\" (closed)=\"dataDialogOpen.set(false)\" />\n}\n\n@if (contextMenu(); as m) {\n <div class=\"wd__menu-list wd__context\" role=\"menu\" [style.left.px]=\"m.x\" [style.top.px]=\"m.y\" (keydown.escape)=\"contextMenu.set(null)\">\n @if (m.onControl) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.cutSelection.bind(state))\"><span [innerHTML]=\"'cut' | weReportIcon\"></span>{{ s.cut }}<kbd>Ctrl+X</kbd></button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.copySelection.bind(state))\"><span [innerHTML]=\"'copy' | weReportIcon\"></span>{{ s.copy }}<kbd>Ctrl+C</kbd></button>\n }\n <button type=\"button\" role=\"menuitem\" [disabled]=\"!state.hasClipboard()\" (click)=\"menu(state.paste.bind(state, m.bandId ?? undefined))\"><span [innerHTML]=\"'paste' | weReportIcon\"></span>{{ s.paste }}<kbd>Ctrl+V</kbd></button>\n @if (m.onControl) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.duplicateSelection.bind(state))\"><span [innerHTML]=\"'copy' | weReportIcon\"></span>{{ s.duplicate }}<kbd>Ctrl+D</kbd></button>\n <hr />\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.arrange.bind(state, 'front'))\"><span [innerHTML]=\"'bringToFront' | weReportIcon\"></span>{{ s.bringToFront }}</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.arrange.bind(state, 'back'))\"><span [innerHTML]=\"'sendToBack' | weReportIcon\"></span>{{ s.sendToBack }}</button>\n <hr />\n <button type=\"button\" role=\"menuitem\" class=\"wd__danger\" (click)=\"menu(state.deleteSelection.bind(state))\"><span [innerHTML]=\"'trash' | weReportIcon\"></span>{{ s.delete }}<kbd>Del</kbd></button>\n } @else {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.selectAll.bind(state))\"><span [innerHTML]=\"'outline' | weReportIcon\"></span>{{ s.selectAll }}<kbd>Ctrl+A</kbd></button>\n @if (state.selectedBand()?.kind !== 'detail') {\n <hr />\n <button type=\"button\" role=\"menuitem\" class=\"wd__danger\" (click)=\"menu(state.deleteSelection.bind(state))\"><span [innerHTML]=\"'trash' | weReportIcon\"></span>{{ s.removeBand }}</button>\n }\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;min-height:0;height:100%;font-family:var(--we-report-font-family, system-ui, sans-serif);font-size:13px;line-height:1.38;letter-spacing:-.003em;color:var(--we-report-fg, #1d1d1f);background:var(--we-report-workspace-bg, #f2f2f7);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease}button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}@media (prefers-reduced-motion: reduce){button{transition:none}}.wd__toolbar{position:relative;z-index:10;display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-height:52px;padding:8px 14px;background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14));box-sizing:border-box}.wd__tabs,.wd__mode{display:inline-flex;padding:2px;gap:2px;border-radius:9px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.wd__tabs button,.wd__mode button{display:inline-flex;align-items:center;gap:6px;border:0;border-radius:7px;padding:4px 12px;background:transparent;font-weight:500;cursor:pointer}.wd__tabs button :is(svg),.wd__mode button :is(svg){width:15px;height:15px}.wd__tab--on,.wd__mode--on{background:var(--we-report-segment-on-bg, #fff)!important;box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.wd__icon,.wd__text-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:30px;height:30px;border:0;border-radius:var(--we-report-control-radius, 7px);background:transparent;cursor:pointer}.wd__icon :is(svg),.wd__text-btn :is(svg){width:17px;height:17px}.wd__icon:hover:not(:disabled),.wd__text-btn:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__icon:disabled,.wd__text-btn:disabled{opacity:.3;cursor:default}.wd__text-btn{padding:0 10px;font-weight:500}.wd__magic{color:var(--we-report-accent, #007aff)}.wd__issues{color:var(--we-report-warning-fg, #b25000);background:var(--we-report-warning-bg, rgba(255, 149, 0, .12))}.wd__sep{width:.5px;height:20px;margin:0 6px;background:var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__zoom{min-width:44px;text-align:center;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__toggle{display:inline-flex;align-items:center;gap:6px;margin:0 6px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));cursor:pointer}.wd__toggle input{accent-color:var(--we-report-accent, #007aff)}.wd__spacer{flex:1}.wd__menu{position:relative}.wd__menu-list{position:absolute;top:calc(100% + 6px);left:0;z-index:20;display:flex;flex-direction:column;min-width:220px;padding:5px;border-radius:var(--we-report-radius, 12px);background:var(--we-report-panel-bg, #fbfbfd);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14));animation:wd-pop .14s ease-out}.wd__menu-list button{text-align:left;border:0;border-radius:6px;padding:6px 10px;background:transparent;cursor:pointer}.wd__menu-list button:hover{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}@keyframes wd-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}}@media (prefers-reduced-motion: reduce){.wd__menu-list{animation:none}}.wd__problems{left:auto;right:0;width:380px;max-height:380px;overflow:auto}.wd__problem{display:flex;align-items:flex-start;gap:6px}.wd__problem .wd__problem-text{flex:1;font-size:12px}.wd__problem .wd__problem-text:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))!important;color:inherit!important}.wd__problem code{font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__fix{flex:none;font-weight:600;color:var(--we-report-accent, #007aff)!important}.wd__body{flex:1;display:grid;grid-template-columns:232px minmax(0,1fr) 288px;min-height:0}.wd__left,.wd__right{overflow:auto;background:var(--we-report-panel-bg, #fbfbfd)}.wd__left{padding:14px 12px 28px;border-right:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__left h2{margin:4px 4px 2px;font-size:13px;font-weight:600}.wd__left h3{margin:16px 4px 4px;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__right{border-left:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__hint{margin:0 4px 10px;font-size:11.5px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__tools{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:20px}.wd__tool{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 4px 10px;border-radius:10px;background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14)),0 1px 2px #0000000a;font-size:11.5px;text-align:center;cursor:grab;-webkit-user-select:none;user-select:none;transition:transform .15s ease,box-shadow .15s ease}.wd__tool :is(svg){width:20px;height:20px;color:var(--we-report-accent, #007aff)}.wd__tool:hover{transform:translateY(-1px);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14)),0 4px 12px #00000014}.wd__tool:active{cursor:grabbing;transform:scale(.97)}@media (prefers-reduced-motion: reduce){.wd__tool{transition:none}.wd__tool:hover,.wd__tool:active{transform:none}}.wd__fields{list-style:none;margin:0;padding:0}.wd__fields li{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:grab;-webkit-user-select:none;user-select:none}.wd__fields li:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__field-type{display:inline-flex;align-items:center;justify-content:center;flex:none;width:18px;height:18px;border-radius:5px;font-size:10px;font-weight:700;text-transform:uppercase;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff)}.wd__canvas{overflow:auto;outline:none}.wd__preview{flex:1;min-height:0}.wd__left-tabs{display:flex;padding:2px;gap:2px;margin-bottom:14px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.wd__left-tabs button{flex:1;border:0;border-radius:6px;padding:4px 8px;background:transparent;font-size:12px;font-weight:500;cursor:pointer}.wd__left-tab--on{background:var(--we-report-segment-on-bg, #fff)!important;box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.wd__outline{list-style:none;margin:0;padding:0}.wd__outline ul{list-style:none;margin:0 0 8px;padding:0 0 0 10px}.wd__outline button{display:flex;align-items:center;gap:6px;width:100%;border:0;border-radius:6px;padding:4px 8px;background:transparent;text-align:left;cursor:pointer}.wd__outline button:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__outline button :is(svg){flex:none;width:14px;height:14px;color:var(--we-report-accent, #007aff)}.wd__outline-band{font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__outline-item{font-size:12px}.wd__outline-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wd__outline--on,.wd__outline--on:hover{background:var(--we-report-accent, #007aff)!important;color:var(--we-report-accent-fg, #fff)!important}.wd__outline--on :is(svg),.wd__outline--on:hover :is(svg){color:inherit!important}.wd__outline-empty{padding:2px 8px;font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__context{position:fixed;z-index:200}.wd__context button{display:flex;align-items:center;gap:8px}.wd__context button :is(svg){width:14px;height:14px}.wd__context button:disabled{opacity:.4;cursor:default;background:transparent!important;color:inherit!important}.wd__context kbd{margin-left:auto;padding-left:16px;font:inherit;font-size:11px;opacity:.55}.wd__context hr{width:100%;margin:4px 0;border:0;border-top:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__danger{color:var(--we-report-warning-fg, #b25000)}\n"] }]
|
|
5500
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
7066
|
+
args: [{ selector: 'we-report-designer', standalone: true, imports: [DesignSurfaceComponent, PropertyPanelComponent, WeReportViewerComponent, WeReportIconPipe, DataSourcesDialogComponent], providers: [DesignerState], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let s = strings();\n<div class=\"wd__toolbar\" role=\"toolbar\">\n <div class=\"wd__tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'design'\" [class.wd__tab--on]=\"tab() === 'design'\" (click)=\"tab.set('design')\">\n <span [innerHTML]=\"'design' | weReportIcon\"></span>{{ s.design }}\n </button>\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'preview'\" [class.wd__tab--on]=\"tab() === 'preview'\" (click)=\"tab.set('preview')\" title=\"F5\">\n <span [innerHTML]=\"'preview' | weReportIcon\"></span>{{ s.preview }}\n </button>\n </div>\n @if (tab() === 'design') {\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"!state.canUndo()\" (click)=\"state.undo()\" [title]=\"s.undo + ' (Ctrl+Z)'\" [attr.aria-label]=\"s.undo\" [innerHTML]=\"'undo' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"!state.canRedo()\" (click)=\"state.redo()\" [title]=\"s.redo + ' (Ctrl+Y)'\" [attr.aria-label]=\"s.redo\" [innerHTML]=\"'redo' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" [disabled]=\"state.selection().kind !== 'controls'\" (click)=\"state.deleteSelection()\" [title]=\"s.delete + ' (Del)'\" [attr.aria-label]=\"s.delete\" [innerHTML]=\"'trash' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() - 0.1)\" [title]=\"s.zoomOut\" [attr.aria-label]=\"s.zoomOut\" [innerHTML]=\"'zoomOut' | weReportIcon\"></button>\n <select class=\"wd__zoom\" (change)=\"pickZoom($any($event.target).value); $any($event.target).value = ''\" [attr.aria-label]=\"s.zoomLevel\">\n <option value=\"\" selected>{{ (zoomLevel() * 100).toFixed(0) }}%</option>\n @for (z of zoomSteps; track z) {\n <option [value]=\"z\">{{ z * 100 }}%</option>\n }\n <option value=\"width\">{{ s.fitWidth }}</option>\n </select>\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() + 0.1)\" [title]=\"s.zoomIn\" [attr.aria-label]=\"s.zoomIn\" [innerHTML]=\"'zoomIn' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon\" (click)=\"fitWidth()\" [title]=\"s.fitWidth\" [attr.aria-label]=\"s.fitWidth\" [innerHTML]=\"'fitWidth' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <div class=\"wd__menu\">\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"bandMenuOpen.set(!bandMenuOpen())\" [attr.aria-expanded]=\"bandMenuOpen()\">+ {{ s.addBand }}</button>\n @if (bandMenuOpen()) {\n <div class=\"wd__menu-list\" role=\"menu\">\n @for (k of addableBands(); track k) {\n <button type=\"button\" role=\"menuitem\" (click)=\"addBand(k)\">{{ k === 'groupHeader' ? s.groupBy + '\u2026' : s.bandNames[k] }}</button>\n }\n </div>\n }\n </div>\n @if (shownFields().rows.length) {\n <button type=\"button\" class=\"wd__text-btn wd__magic\" (click)=\"autoDesign()\" [title]=\"s.autoDesignHint\"><span [innerHTML]=\"'wand' | weReportIcon\"></span> {{ s.wizardTitle }}</button>\n }\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"dataDialogOpen.set(true)\">\n <span [innerHTML]=\"'database' | weReportIcon\"></span> {{ s.dataSources }}\n </button>\n <label class=\"wd__toggle\">\n <input type=\"checkbox\" [checked]=\"showData()\" (change)=\"showData.set($any($event.target).checked)\" />\n {{ s.showData }}\n </label>\n <select class=\"wd__zoom\" [title]=\"s.snapGrid\" [attr.aria-label]=\"s.snapGrid\" (change)=\"gridSize.set(+$any($event.target).value)\">\n @for (g of gridSteps; track g) {\n <option [value]=\"g\" [selected]=\"g === gridSize()\">{{ g ? g + ' mm' : s.gridOff }}</option>\n }\n </select>\n <span class=\"wd__spacer\"></span>\n <div class=\"wd__menu\">\n <button type=\"button\" class=\"wd__text-btn\" [class.wd__issues]=\"issues().length\" (click)=\"problemsOpen.set(!problemsOpen())\" [attr.aria-expanded]=\"problemsOpen()\">\n {{ issues().length ? '\u26A0 ' + issues().length : '\u2713' }} {{ s.problems }}\n </button>\n @if (problemsOpen()) {\n <div class=\"wd__menu-list wd__problems\" role=\"list\">\n @for (issue of issues(); track $index) {\n <div class=\"wd__problem\" role=\"listitem\">\n <button type=\"button\" class=\"wd__problem-text\" (click)=\"showIssue(issue)\">\n <code>{{ issue.controlId }}</code> {{ issueText(issue) }}\n </button>\n @if (issue.code === 'outsidePage' || issue.code === 'textCut') {\n <button type=\"button\" class=\"wd__fix\" (click)=\"fixIssue(issue)\">{{ s.fixIt }}</button>\n }\n </div>\n } @empty {\n <p class=\"wd__hint\">{{ s.noProblems }}</p>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"wd__icon\" (click)=\"shortcutsOpen.set(true)\" [title]=\"s.keyboardShortcuts + ' (F1)'\" [attr.aria-label]=\"s.keyboardShortcuts\" [innerHTML]=\"'keyboard' | weReportIcon\"></button>\n <div class=\"wd__mode\" role=\"radiogroup\">\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"!advanced()\" [class.wd__mode--on]=\"!advanced()\" (click)=\"advanced.set(false)\">{{ s.basicMode }}</button>\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"advanced()\" [class.wd__mode--on]=\"advanced()\" (click)=\"advanced.set(true)\">{{ s.advancedMode }}</button>\n </div>\n }\n</div>\n\n@if (tab() === 'design') {\n <div class=\"wd__body\" [style.grid-template-columns]=\"leftWidth() + 'px 6px minmax(0, 1fr) 6px ' + rightWidth() + 'px'\">\n <aside class=\"wd__left\" [class.wd__collapsed]=\"!leftWidth()\">\n <div class=\"wd__left-tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"leftTab() === 'add'\" [class.wd__left-tab--on]=\"leftTab() === 'add'\" (click)=\"leftTab.set('add')\">{{ s.add }}</button>\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"leftTab() === 'outline'\" [class.wd__left-tab--on]=\"leftTab() === 'outline'\" (click)=\"leftTab.set('outline')\">{{ s.explorer }}</button>\n </div>\n @if (leftTab() === 'add') {\n <h2>{{ s.toolbox }}</h2>\n <p class=\"wd__hint\">{{ s.toolboxHint }} {{ s.addByClick }}</p>\n <div class=\"wd__tools\">\n @for (item of toolbox; track $index) {\n <div class=\"wd__tool\" draggable=\"true\" role=\"button\" tabindex=\"0\" (dragstart)=\"onToolDragStart($event, item)\" (click)=\"onToolClick(item)\" (keydown.enter)=\"onToolClick(item)\" [title]=\"s.controlNames[item.type]\">\n <span [innerHTML]=\"iconName(item.icon) | weReportIcon\"></span>\n <span>{{ item.variant === 'qrcode' ? 'QR' : s.controlNames[item.type] }}</span>\n </div>\n }\n </div>\n\n <h2>{{ s.fields }}</h2>\n @if (fields().rows.length || fields().parent.length) {\n <p class=\"wd__hint\">{{ s.fieldsHint }}</p>\n @if (allFields().length > 8) {\n <input class=\"wd__field-filter\" type=\"search\" [placeholder]=\"s.filterFields\" [attr.aria-label]=\"s.filterFields\" [value]=\"fieldFilter()\" (input)=\"fieldFilter.set($any($event.target).value)\" />\n }\n <ul class=\"wd__fields\">\n @for (f of shownFields().rows; track f.path) {\n <li draggable=\"true\" tabindex=\"0\" role=\"button\" (dragstart)=\"onFieldDragStart($event, f)\" (dblclick)=\"onFieldDblClick(f)\" (keydown.enter)=\"onFieldDblClick(f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n @if (shownFields().inner.length) {\n <h3>{{ s.innerFields }}</h3>\n <ul class=\"wd__fields\">\n @for (f of shownFields().inner; track f.path) {\n <li draggable=\"true\" tabindex=\"0\" role=\"button\" (dragstart)=\"onFieldDragStart($event, f)\" (dblclick)=\"onFieldDblClick(f)\" (keydown.enter)=\"onFieldDblClick(f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n }\n @if (shownFields().parent.length) {\n <h3>{{ s.parentFields }}</h3>\n <ul class=\"wd__fields\">\n @for (f of shownFields().parent; track f.path) {\n <li draggable=\"true\" tabindex=\"0\" role=\"button\" (dragstart)=\"onFieldDragStart($event, f)\" (dblclick)=\"onFieldDblClick(f)\" (keydown.enter)=\"onFieldDblClick(f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\n </li>\n }\n </ul>\n }\n } @else {\n <p class=\"wd__hint\">{{ s.noFields }}</p>\n }\n } @else {\n <p class=\"wd__hint\">{{ s.explorerHint }}</p>\n <ul class=\"wd__outline\" role=\"tree\">\n @for (band of state.report().bands; track band.id) {\n <li role=\"treeitem\" [attr.aria-expanded]=\"true\">\n <button type=\"button\" class=\"wd__outline-band\" [class.wd__outline--on]=\"state.selection().kind === 'band' && state.selectedBand()?.id === band.id\" (click)=\"state.selection.set({ kind: 'band', id: band.id })\">\n {{ s.bandNames[band.kind] }}\n </button>\n <ul role=\"group\">\n @for (c of band.controls; track c.id) {\n <li role=\"treeitem\">\n <button type=\"button\" class=\"wd__outline-item\" [class.wd__outline--on]=\"isSelected(c.id)\" (click)=\"selectFromOutline($event, c.id)\">\n <span [innerHTML]=\"outlineIcon(c) | weReportIcon\"></span><span class=\"wd__outline-text\">{{ outlineLabel(c) }}</span>\n </button>\n </li>\n } @empty {\n <li class=\"wd__outline-empty\">{{ s.emptyBand }}</li>\n }\n </ul>\n </li>\n }\n </ul>\n }\n </aside>\n\n <div class=\"wd__splitter\" role=\"separator\" aria-orientation=\"vertical\" [title]=\"s.resizePanel\" (pointerdown)=\"startResize($event, 'left')\" (dblclick)=\"togglePanel('left')\"></div>\n <div class=\"wd__center\">\n @let st = formatStyle();\n <div class=\"wd__formatbar\" role=\"toolbar\" [attr.aria-label]=\"s.formatBar\" [class.wd__formatbar--off]=\"!st\">\n <select class=\"wd__font\" [disabled]=\"!st\" (change)=\"format('fontFamily', $any($event.target).value)\" [attr.aria-label]=\"s.font\" [title]=\"s.font\">\n @for (f of fontFamilies(); track f) {\n <option [value]=\"f\" [selected]=\"st?.fontFamily === f\">{{ f }}</option>\n }\n @if (st && !fontFamilies().includes(st.fontFamily)) {\n <option [value]=\"st.fontFamily\" selected>{{ st.fontFamily }}</option>\n }\n </select>\n <input class=\"wd__size\" type=\"number\" min=\"4\" max=\"200\" step=\"1\" [attr.list]=\"sizeListId\" [disabled]=\"!st\" [value]=\"st?.fontSize ?? ''\" (change)=\"format('fontSize', +$any($event.target).value || undefined)\" [attr.aria-label]=\"s.fontSize\" [title]=\"s.fontSize\" />\n <datalist [id]=\"sizeListId\">\n @for (n of fontSizes; track n) {\n <option [value]=\"n\"></option>\n }\n </datalist>\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"st?.bold\" (click)=\"toggleFormat('bold')\" [title]=\"s.bold + ' (Ctrl+B)'\" [attr.aria-pressed]=\"!!st?.bold\"><b>B</b></button>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"st?.italic\" (click)=\"toggleFormat('italic')\" [title]=\"s.italic + ' (Ctrl+I)'\" [attr.aria-pressed]=\"!!st?.italic\"><i>I</i></button>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"st?.underline\" (click)=\"toggleFormat('underline')\" [title]=\"s.underline + ' (Ctrl+U)'\" [attr.aria-pressed]=\"!!st?.underline\"><u>U</u></button>\n <span class=\"wd__sep\"></span>\n @for (a of textAligns; track a.value) {\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"st?.textAlign === a.value\" (click)=\"format('textAlign', a.value)\" [title]=\"s[a.label]\" [attr.aria-label]=\"s[a.label]\" [innerHTML]=\"a.icon | weReportIcon\"></button>\n }\n <span class=\"wd__sep\"></span>\n <label class=\"wd__well\" [title]=\"s.textColor\">\n <span>A</span>\n <input type=\"color\" [disabled]=\"!st\" [value]=\"st?.color ?? '#000000'\" (input)=\"format('color', $any($event.target).value)\" [attr.aria-label]=\"s.textColor\" />\n </label>\n <label class=\"wd__well wd__well--fill\" [title]=\"s.backgroundColor\">\n <span [style.background]=\"st?.backgroundColor ?? 'transparent'\"></span>\n <input type=\"color\" [disabled]=\"!st\" [value]=\"st?.backgroundColor ?? '#ffffff'\" (input)=\"format('backgroundColor', $any($event.target).value)\" [attr.aria-label]=\"s.backgroundColor\" />\n </label>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" (click)=\"format('backgroundColor', undefined)\" [title]=\"s.backgroundColor + ': ' + s.noColor\" [attr.aria-label]=\"s.noColor\" [innerHTML]=\"'noColor' | weReportIcon\"></button>\n <span class=\"wd__sep\"></span>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"!!st?.border\" (click)=\"setBorder(true)\" [title]=\"s.allBorders\" [attr.aria-label]=\"s.allBorders\" [innerHTML]=\"'borderAll' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" (click)=\"setBorder(false)\" [title]=\"s.noBorder\" [attr.aria-label]=\"s.noBorder\" [innerHTML]=\"'borderNone' | weReportIcon\"></button>\n <button type=\"button\" class=\"wd__icon wd__fmt\" [disabled]=\"!st\" [class.wd__fmt--on]=\"!!state.painter()\" (click)=\"togglePainter()\" [title]=\"s.formatPainter\" [attr.aria-label]=\"s.formatPainter\" [attr.aria-pressed]=\"!!state.painter()\" [innerHTML]=\"'brush' | weReportIcon\"></button>\n </div>\n <main #canvas class=\"wd__canvas\" tabindex=\"-1\" (contextmenu)=\"openContextMenu($event)\" (wheel)=\"onCanvasWheel($event)\">\n <we-report-design-surface [strings]=\"s\" [zoom]=\"zoomLevel()\" [gridSize]=\"gridSize()\" [sample]=\"sample()\" [fields]=\"allFields()\" />\n </main>\n </div>\n\n <div class=\"wd__splitter\" role=\"separator\" aria-orientation=\"vertical\" [title]=\"s.resizePanel\" (pointerdown)=\"startResize($event, 'right')\" (dblclick)=\"togglePanel('right')\"></div>\n <aside class=\"wd__right\" [class.wd__collapsed]=\"!rightWidth()\">\n <we-report-property-panel [strings]=\"s\" [fields]=\"allFields()\" [lists]=\"fields().lists\" [fontFamilies]=\"fontFamilies()\" [advanced]=\"advanced()\" />\n </aside>\n </div>\n <footer class=\"wd__status\" aria-live=\"polite\">\n @let info = selectionInfo();\n <span class=\"wd__status-sel\">{{ info.title }}</span>\n @if (info.box; as b) {\n <span>{{ s.left }} {{ mm(b.x) }}</span>\n <span>{{ s.top }} {{ mm(b.y) }}</span>\n <span>{{ s.width }} {{ mm(b.width) }}</span>\n <span>{{ s.height }} {{ mm(b.height) }} mm</span>\n }\n <span class=\"wd__spacer\"></span>\n <span class=\"wd__status-pointer\">{{ pointerInfo() }}</span>\n <span>{{ (zoomLevel() * 100).toFixed(0) }}%</span>\n </footer>\n} @else {\n <we-report-viewer class=\"wd__preview\" [report]=\"state.report()\" [data]=\"data()\" [locale]=\"s\" [fetchFn]=\"fetchFn()\" />\n}\n\n@if (dataDialogOpen()) {\n <we-report-data-sources-dialog [strings]=\"s\" [fetchFn]=\"fetchFn()\" (closed)=\"dataDialogOpen.set(false)\" />\n}\n\n@if (contextMenu(); as m) {\n <div class=\"wd__menu-list wd__context\" role=\"menu\" [style.left.px]=\"m.x\" [style.top.px]=\"m.y\" (keydown.escape)=\"contextMenu.set(null)\">\n @if (m.onControl) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.cutSelection.bind(state))\"><span [innerHTML]=\"'cut' | weReportIcon\"></span>{{ s.cut }}<kbd>Ctrl+X</kbd></button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.copySelection.bind(state))\"><span [innerHTML]=\"'copy' | weReportIcon\"></span>{{ s.copy }}<kbd>Ctrl+C</kbd></button>\n }\n <button type=\"button\" role=\"menuitem\" [disabled]=\"!state.hasClipboard()\" (click)=\"menu(state.paste.bind(state, m.bandId ?? undefined))\"><span [innerHTML]=\"'paste' | weReportIcon\"></span>{{ s.paste }}<kbd>Ctrl+V</kbd></button>\n @if (m.onControl) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(editSelected.bind(this))\"><span [innerHTML]=\"'edit' | weReportIcon\"></span>{{ s.editText }}<kbd>F2</kbd></button>\n @if (totalTarget()) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(addTotal.bind(this))\"><span [innerHTML]=\"'sum' | weReportIcon\"></span>{{ s.addTotal }}</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(groupByValue.bind(this))\"><span [innerHTML]=\"'outline' | weReportIcon\"></span>{{ s.groupByThis }}</button>\n }\n @if (hasTextSelected()) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(fitToText.bind(this))\"><span [innerHTML]=\"'sameWidth' | weReportIcon\"></span>{{ s.fitToText }}</button>\n }\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.duplicateSelection.bind(state))\"><span [innerHTML]=\"'copy' | weReportIcon\"></span>{{ s.duplicate }}<kbd>Ctrl+D</kbd></button>\n <hr />\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.arrange.bind(state, 'front'))\"><span [innerHTML]=\"'bringToFront' | weReportIcon\"></span>{{ s.bringToFront }}</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.arrange.bind(state, 'back'))\"><span [innerHTML]=\"'sendToBack' | weReportIcon\"></span>{{ s.sendToBack }}</button>\n <hr />\n <button type=\"button\" role=\"menuitem\" class=\"wd__danger\" (click)=\"menu(state.deleteSelection.bind(state))\"><span [innerHTML]=\"'trash' | weReportIcon\"></span>{{ s.delete }}<kbd>Del</kbd></button>\n } @else {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(addTextAt.bind(this, m.bandId, m.at))\"><span [innerHTML]=\"'text' | weReportIcon\"></span>{{ s.addTextHere }}</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.selectAll.bind(state))\"><span [innerHTML]=\"'outline' | weReportIcon\"></span>{{ s.selectAll }}<kbd>Ctrl+A</kbd></button>\n @if (m.bandId) {\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(state.toggleCollapsed.bind(state, m.bandId))\"><span [innerHTML]=\"'fitHeight' | weReportIcon\"></span>{{ state.collapsed().has(m.bandId) ? s.expandBand : s.collapseBand }}</button>\n }\n <button type=\"button\" role=\"menuitem\" (click)=\"menu(fitBand.bind(this, m.bandId))\"><span [innerHTML]=\"'fitHeight' | weReportIcon\"></span>{{ s.fitBandToContent }}</button>\n @if (state.selectedBand()?.kind !== 'detail') {\n <hr />\n <button type=\"button\" role=\"menuitem\" class=\"wd__danger\" (click)=\"menu(state.deleteSelection.bind(state))\"><span [innerHTML]=\"'trash' | weReportIcon\"></span>{{ s.removeBand }}</button>\n }\n }\n </div>\n}\n\n@if (wizard(); as w) {\n <div class=\"wd__sheet-backdrop\" (click)=\"wizard.set(null)\"></div>\n <div class=\"wd__sheet wd__wizard\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"s.wizardTitle\" (keydown.escape)=\"wizard.set(null)\">\n <h2>{{ s.wizardTitle }}</h2>\n <label class=\"wd__wizard-row\">\n <span>{{ s.wizardReportTitle }}</span>\n <input type=\"text\" [value]=\"w.title\" (input)=\"updateWizard({ title: $any($event.target).value })\" />\n </label>\n <fieldset class=\"wd__wizard-fields\">\n <legend>{{ s.wizardColumns }}</legend>\n @for (f of w.fields; track f.name) {\n <label><input type=\"checkbox\" [checked]=\"f.on\" [disabled]=\"f.name === w.groupBy\" (change)=\"toggleWizardField(f.name)\" /> {{ f.name }}</label>\n }\n </fieldset>\n <label class=\"wd__wizard-row\">\n <span>{{ s.groupBy }}</span>\n <select (change)=\"updateWizard({ groupBy: $any($event.target).value })\">\n <option value=\"\" [selected]=\"!w.groupBy\">{{ s.noGrouping }}</option>\n @for (f of w.fields; track f.name) {\n <option [value]=\"f.name\" [selected]=\"f.name === w.groupBy\">{{ f.name }}</option>\n }\n </select>\n </label>\n <div class=\"wd__wizard-row\">\n <span>{{ s.sortRows }}</span>\n <span class=\"wd__wizard-pair\">\n <select (change)=\"updateWizard({ sortBy: $any($event.target).value })\" [attr.aria-label]=\"s.sortRows\">\n <option value=\"\" [selected]=\"!w.sortBy\">{{ s.dataOrder }}</option>\n @for (f of w.fields; track f.name) {\n <option [value]=\"f.name\" [selected]=\"f.name === w.sortBy\">{{ f.name }}</option>\n }\n </select>\n <select [disabled]=\"!w.sortBy\" (change)=\"updateWizard({ sortDescending: $any($event.target).value === 'desc' })\" [attr.aria-label]=\"s.sortRows\">\n <option value=\"asc\" [selected]=\"!w.sortDescending\">{{ s.sortAsc }}</option>\n <option value=\"desc\" [selected]=\"w.sortDescending\">{{ s.sortDesc }}</option>\n </select>\n </span>\n </div>\n <label class=\"wd__wizard-row\">\n <span>{{ s.orientation }}</span>\n <select (change)=\"updateWizard({ orientation: $any($event.target).value })\">\n <option value=\"\" [selected]=\"!w.orientation\">{{ s.automatic }}</option>\n <option value=\"portrait\" [selected]=\"w.orientation === 'portrait'\">{{ s.portrait }}</option>\n <option value=\"landscape\" [selected]=\"w.orientation === 'landscape'\">{{ s.landscape }}</option>\n </select>\n </label>\n <label class=\"wd__wizard-check\"><input type=\"checkbox\" [checked]=\"w.totals\" (change)=\"updateWizard({ totals: !w.totals })\" /> {{ s.wizardTotals }}</label>\n <p class=\"wd__wizard-hint\">{{ s.autoDesignHint }}</p>\n <div class=\"wd__wizard-actions\">\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"wizard.set(null)\">{{ s.cancel }}</button>\n <button type=\"button\" class=\"wd__primary\" [disabled]=\"!wizardReady()\" (click)=\"runWizard()\">{{ s.createReport }}</button>\n </div>\n </div>\n}\n\n@if (shortcutsOpen()) {\n <div class=\"wd__sheet-backdrop\" (click)=\"shortcutsOpen.set(false)\"></div>\n <div class=\"wd__sheet\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"s.keyboardShortcuts\" (keydown.escape)=\"shortcutsOpen.set(false)\">\n <h2>{{ s.keyboardShortcuts }}</h2>\n <dl class=\"wd__keys\">\n <dt>Ctrl+Z \u00B7 Ctrl+Y</dt><dd>{{ s.undo }} \u00B7 {{ s.redo }}</dd>\n <dt>Ctrl+X \u00B7 Ctrl+C \u00B7 Ctrl+V</dt><dd>{{ s.cut }} \u00B7 {{ s.copy }} \u00B7 {{ s.paste }}</dd>\n <dt>Ctrl+D</dt><dd>{{ s.duplicate }}</dd>\n <dt>Delete</dt><dd>{{ s.delete }}</dd>\n <dt>Ctrl+A</dt><dd>{{ s.selectAll }}</dd>\n <dt>F2 \u00B7 Enter \u00B7 \u29C9</dt><dd>{{ s.editText }}</dd>\n <dt>Ctrl+B \u00B7 Ctrl+I \u00B7 Ctrl+U</dt><dd>{{ s.bold }} \u00B7 {{ s.italic }} \u00B7 {{ s.underline }}</dd>\n <dt>\u2190 \u2191 \u2192 \u2193 \u00B7 Shift</dt><dd>{{ s.moveItem }} (1 / 5 mm)</dd>\n <dt>Alt + \u2190 \u2191 \u2192 \u2193</dt><dd>{{ s.moveFine }}</dd>\n <dt>Ctrl + \u2190 \u2191 \u2192 \u2193</dt><dd>{{ s.resizeItem }}</dd>\n <dt>Tab \u00B7 Shift+Tab</dt><dd>{{ s.nextItem }}</dd>\n <dt>Ctrl+= \u00B7 Ctrl+- \u00B7 Ctrl+0</dt><dd>{{ s.zoomIn }} \u00B7 {{ s.zoomOut }} \u00B7 {{ s.fitWidth }}</dd>\n <dt>Alt</dt><dd>{{ s.noSnap }}</dd>\n <dt>Ctrl + \u21F1</dt><dd>{{ s.dragCopy }}</dd>\n <dt>\u2B1A</dt><dd>{{ s.rubberBand }}</dd>\n <dt>F5</dt><dd>{{ s.preview }} \u00B7 {{ s.design }}</dd>\n <dt>F1</dt><dd>{{ s.keyboardShortcuts }}</dd>\n </dl>\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"shortcutsOpen.set(false)\">{{ s.close }}</button>\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;min-height:0;height:100%;font-family:var(--we-report-font-family, system-ui, sans-serif);font-size:13px;line-height:1.38;letter-spacing:-.003em;color:var(--we-report-fg, #1d1d1f);background:var(--we-report-workspace-bg, #f2f2f7);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease}button:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}@media (prefers-reduced-motion: reduce){button{transition:none}}.wd__toolbar{position:relative;z-index:10;display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-height:52px;padding:8px 14px;background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14));box-sizing:border-box}.wd__tabs,.wd__mode{display:inline-flex;padding:2px;gap:2px;border-radius:9px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.wd__tabs button,.wd__mode button{display:inline-flex;align-items:center;gap:6px;border:0;border-radius:7px;padding:4px 12px;background:transparent;font-weight:500;cursor:pointer}.wd__tabs button :is(svg),.wd__mode button :is(svg){width:15px;height:15px}.wd__tab--on,.wd__mode--on{background:var(--we-report-segment-on-bg, #fff)!important;box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.wd__icon,.wd__text-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:30px;height:30px;border:0;border-radius:var(--we-report-control-radius, 7px);background:transparent;cursor:pointer}.wd__icon :is(svg),.wd__text-btn :is(svg){width:17px;height:17px}.wd__icon:hover:not(:disabled),.wd__text-btn:hover:not(:disabled){background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__icon:disabled,.wd__text-btn:disabled{opacity:.3;cursor:default}.wd__text-btn{padding:0 10px;font-weight:500}.wd__magic{color:var(--we-report-accent, #007aff)}.wd__issues{color:var(--we-report-warning-fg, #b25000);background:var(--we-report-warning-bg, rgba(255, 149, 0, .12))}.wd__sep{width:.5px;height:20px;margin:0 6px;background:var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__zoom{height:26px;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 4px;background:transparent;font:inherit;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));cursor:pointer}.wd__zoom:hover{background:var(--we-report-input-bg, rgba(118, 118, 128, .1))}.wd__toggle{display:inline-flex;align-items:center;gap:6px;margin:0 6px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));cursor:pointer}.wd__toggle input{accent-color:var(--we-report-accent, #007aff)}.wd__spacer{flex:1}.wd__menu{position:relative}.wd__menu-list{position:absolute;top:calc(100% + 6px);left:0;z-index:20;display:flex;flex-direction:column;min-width:220px;padding:5px;border-radius:var(--we-report-radius, 12px);background:var(--we-report-panel-bg, #fbfbfd);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14));animation:wd-pop .14s ease-out}.wd__menu-list button{text-align:left;border:0;border-radius:6px;padding:6px 10px;background:transparent;cursor:pointer}.wd__menu-list button:hover{background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}@keyframes wd-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}}@media (prefers-reduced-motion: reduce){.wd__menu-list{animation:none}}.wd__problems{left:auto;right:0;width:380px;max-height:380px;overflow:auto}.wd__problem{display:flex;align-items:flex-start;gap:6px}.wd__problem .wd__problem-text{flex:1;font-size:12px}.wd__problem .wd__problem-text:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))!important;color:inherit!important}.wd__problem code{font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__fix{flex:none;font-weight:600;color:var(--we-report-accent, #007aff)!important}.wd__body{flex:1;display:grid;grid-template-columns:232px 6px minmax(0,1fr) 6px 288px;min-height:0}.wd__left,.wd__right{overflow:auto;background:var(--we-report-panel-bg, #fbfbfd)}.wd__left{padding:14px 12px 28px}.wd__left h2{margin:4px 4px 2px;font-size:13px;font-weight:600}.wd__left h3{margin:16px 4px 4px;font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__left,.wd__right{min-width:0}.wd__hint{margin:0 4px 10px;font-size:11.5px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__tools{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:20px}.wd__tool{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 4px 10px;border-radius:10px;background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14)),0 1px 2px #0000000a;font-size:11.5px;text-align:center;cursor:grab;-webkit-user-select:none;user-select:none;transition:transform .15s ease,box-shadow .15s ease}.wd__tool :is(svg){width:20px;height:20px;color:var(--we-report-accent, #007aff)}.wd__tool:hover{transform:translateY(-1px);box-shadow:0 0 0 .5px var(--we-report-separator, rgba(60, 60, 67, .14)),0 4px 12px #00000014}.wd__tool:active{cursor:grabbing;transform:scale(.97)}@media (prefers-reduced-motion: reduce){.wd__tool{transition:none}.wd__tool:hover,.wd__tool:active{transform:none}}.wd__fields{list-style:none;margin:0;padding:0}.wd__fields li{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:grab;-webkit-user-select:none;user-select:none}.wd__fields li:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__field-type{display:inline-flex;align-items:center;justify-content:center;flex:none;width:18px;height:18px;border-radius:5px;font-size:10px;font-weight:700;text-transform:uppercase;background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff)}.wd__center{display:flex;flex-direction:column;min-width:0;min-height:0}.wd__canvas{flex:1;min-height:0;overflow:auto;outline:none}.wd__preview{flex:1;min-height:0}.wd__left-tabs{display:flex;padding:2px;gap:2px;margin-bottom:14px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.wd__left-tabs button{flex:1;border:0;border-radius:6px;padding:4px 8px;background:transparent;font-size:12px;font-weight:500;cursor:pointer}.wd__left-tab--on{background:var(--we-report-segment-on-bg, #fff)!important;box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.wd__outline{list-style:none;margin:0;padding:0}.wd__outline ul{list-style:none;margin:0 0 8px;padding:0 0 0 10px}.wd__outline button{display:flex;align-items:center;gap:6px;width:100%;border:0;border-radius:6px;padding:4px 8px;background:transparent;text-align:left;cursor:pointer}.wd__outline button:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__outline button :is(svg){flex:none;width:14px;height:14px;color:var(--we-report-accent, #007aff)}.wd__outline-band{font-size:11px;font-weight:600;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__outline-item{font-size:12px}.wd__outline-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wd__outline--on,.wd__outline--on:hover{background:var(--we-report-accent, #007aff)!important;color:var(--we-report-accent-fg, #fff)!important}.wd__outline--on :is(svg),.wd__outline--on:hover :is(svg){color:inherit!important}.wd__outline-empty{padding:2px 8px;font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__context{position:fixed;z-index:200}.wd__context button{display:flex;align-items:center;gap:8px}.wd__context button :is(svg){width:14px;height:14px}.wd__context button:disabled{opacity:.4;cursor:default;background:transparent!important;color:inherit!important}.wd__context kbd{margin-left:auto;padding-left:16px;font:inherit;font-size:11px;opacity:.55}.wd__context hr{width:100%;margin:4px 0;border:0;border-top:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__danger{color:var(--we-report-warning-fg, #b25000)}.wd__formatbar{display:flex;align-items:center;flex-wrap:wrap;gap:2px;min-height:40px;padding:4px 14px;box-sizing:border-box;background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));border-bottom:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__formatbar select,.wd__formatbar input[type=number]{height:28px;box-sizing:border-box;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 8px;background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:inherit}.wd__formatbar select:focus,.wd__formatbar input[type=number]:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.wd__formatbar select:disabled,.wd__formatbar input[type=number]:disabled{opacity:.4}.wd__font{width:150px}.wd__size{width:62px;font-variant-numeric:tabular-nums}.wd__fmt{min-width:28px;height:28px;font-size:14px}.wd__fmt--on{background:var(--we-report-selection-fill, rgba(0, 122, 255, .07))!important;color:var(--we-report-accent, #007aff);box-shadow:inset 0 0 0 1px var(--we-report-selection, #007aff)}.wd__well{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--we-report-control-radius, 7px);cursor:pointer}.wd__well:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.wd__well span{font-weight:700;font-size:14px}.wd__well input{position:absolute;left:4px;right:4px;bottom:3px;height:4px;width:auto;padding:0;border:0;opacity:1;cursor:pointer;pointer-events:auto}.wd__well input::-webkit-color-swatch-wrapper{padding:0}.wd__well input::-webkit-color-swatch{border:0;border-radius:1px}.wd__well--fill span{width:14px;height:14px;border-radius:3px;box-shadow:inset 0 0 0 1px var(--we-report-separator, rgba(60, 60, 67, .3))}.wd__formatbar--off .wd__well{opacity:.4;pointer-events:none}.wd__status{display:flex;align-items:center;gap:14px;min-height:26px;padding:0 14px;font-size:11.5px;font-variant-numeric:tabular-nums;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));background:var(--we-report-toolbar-bg, rgba(250, 250, 252, .82));border-top:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__status-sel{color:var(--we-report-fg, #1d1d1f);font-weight:500}.wd__splitter{position:relative;cursor:col-resize;background:var(--we-report-panel-bg, #fbfbfd);touch-action:none}.wd__splitter:after{content:\"\";position:absolute;top:0;bottom:0;left:50%;width:.5px;background:var(--we-report-separator, rgba(60, 60, 67, .14))}.wd__splitter:hover:after{width:2px;margin-left:-1px;background:var(--we-report-accent, #007aff)}.wd__tool:focus-visible,.wd__fields li:focus-visible{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.wd__field-filter{width:100%;height:28px;box-sizing:border-box;margin-bottom:6px;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 8px;background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:inherit}.wd__wizard{display:flex;flex-direction:column;gap:10px}.wd__wizard input[type=text],.wd__wizard select{height:28px;box-sizing:border-box;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 8px;background:var(--we-report-input-bg, rgba(118, 118, 128, .1));color:inherit;font:inherit}.wd__wizard-row{display:grid;grid-template-columns:140px 1fr;align-items:center;gap:8px}.wd__wizard-pair{display:grid;grid-template-columns:1fr 1fr;gap:6px}.wd__wizard-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:4px 12px;max-height:220px;overflow:auto;margin:0;padding:8px 10px;border:.5px solid var(--we-report-separator, rgba(60, 60, 67, .14));border-radius:var(--we-report-control-radius, 7px)}.wd__wizard-fields legend{padding:0 4px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.wd__wizard-fields label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wd__wizard-hint{margin:0;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));font-size:12px}.wd__wizard-actions{display:flex;justify-content:flex-end;gap:8px}.wd__primary{height:30px;border:0;border-radius:var(--we-report-control-radius, 7px);padding:0 14px;background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff);font:inherit;font-weight:600;cursor:pointer}.wd__sheet-backdrop{position:fixed;inset:0;z-index:150;background:var(--we-report-backdrop, rgba(0, 0, 0, .22))}.wd__sheet{position:fixed;top:50%;left:50%;z-index:151;transform:translate(-50%,-50%);width:min(560px,100vw - 32px);max-height:calc(100vh - 32px);overflow:auto;box-sizing:border-box;padding:20px 22px;border-radius:14px;background:var(--we-report-panel-bg, #fbfbfd);box-shadow:var(--we-report-popover-shadow, 0 8px 24px rgba(0, 0, 0, .14))}.wd__sheet h2{margin:0 0 12px;font-size:15px;font-weight:600}.wd__keys{display:grid;grid-template-columns:max-content 1fr;gap:6px 16px;margin:0 0 14px}.wd__keys dt{font:12px ui-monospace,SF Mono,Menlo,Consolas,monospace;color:var(--we-report-accent, #007aff)}.wd__keys dd{margin:0}.wd__collapsed{visibility:hidden;padding:0!important;overflow:hidden!important}\n"] }]
|
|
7067
|
+
}], ctorParameters: () => [], propDecorators: { onCopy: [{
|
|
7068
|
+
type: HostListener,
|
|
7069
|
+
args: ['copy', ['$event']]
|
|
7070
|
+
}, {
|
|
7071
|
+
type: HostListener,
|
|
7072
|
+
args: ['cut', ['$event']]
|
|
7073
|
+
}], onPaste: [{
|
|
7074
|
+
type: HostListener,
|
|
7075
|
+
args: ['paste', ['$event']]
|
|
7076
|
+
}], closeMenus: [{
|
|
5501
7077
|
type: HostListener,
|
|
5502
7078
|
args: ['document:pointerdown', ['$event']]
|
|
5503
7079
|
}], onKeydown: [{
|
|
@@ -5513,5 +7089,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
5513
7089
|
* Generated bundle index. Do not edit.
|
|
5514
7090
|
*/
|
|
5515
7091
|
|
|
5516
|
-
export { DEFAULT_FONTS_URL, DesignerState, WE_REPORT_CONFIG, WE_REPORT_DEFAULT_ICONS, WE_REPORT_ICONS, WE_REPORT_LOCALE, WE_REPORT_LOCALES, WeReportBackendService, WeReportDesignerComponent, WeReportFontsService, WeReportIconPipe, WeReportPageComponent, WeReportViewerComponent, defaultFontFamily, orderBands, provideWeReport, weReportLocaleDe, weReportLocaleEn, weReportLocaleEs, weReportLocaleFor, weReportLocaleFr, weReportLocaleTr };
|
|
7092
|
+
export { CLIPBOARD_MARKER, DEFAULT_FONTS_URL, DesignerState, WE_REPORT_CONFIG, WE_REPORT_DEFAULT_ICONS, WE_REPORT_ICONS, WE_REPORT_LOCALE, WE_REPORT_LOCALES, WeReportBackendService, WeReportDesignerComponent, WeReportFontsService, WeReportIconPipe, WeReportPageComponent, WeReportViewerComponent, defaultFontFamily, orderBands, provideWeReport, weReportLocaleDe, weReportLocaleEn, weReportLocaleEs, weReportLocaleFor, weReportLocaleFr, weReportLocaleTr };
|
|
5517
7093
|
//# sourceMappingURL=we-report-angular.mjs.map
|