we-report-angular 0.4.0 → 0.5.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 +358 -19
- package/esm2022/lib/designer/designer-state.mjs +99 -5
- package/esm2022/lib/designer/property-panel.component.mjs +15 -3
- package/esm2022/lib/designer/we-report-designer.component.mjs +347 -22
- package/esm2022/lib/locales/de.mjs +45 -1
- package/esm2022/lib/locales/es.mjs +45 -1
- package/esm2022/lib/locales/fr.mjs +45 -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 +20 -1
- package/esm2022/lib/we-report-locale.mjs +89 -1
- package/fesm2022/we-report-angular.mjs +1569 -310
- package/fesm2022/we-report-angular.mjs.map +1 -1
- package/lib/designer/design-surface.component.d.ts +61 -2
- package/lib/designer/designer-state.d.ts +33 -3
- package/lib/designer/property-panel.component.d.ts +3 -0
- package/lib/designer/we-report-designer.component.d.ts +89 -3
- 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 +19 -0
- package/lib/we-report-locale.d.ts +44 -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, resolvePageGeometry, isExpression, resolveStyle, 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,50 @@ 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
|
+
previousMatch: 'Previous match',
|
|
301
|
+
nextMatch: 'Next match',
|
|
302
|
+
zoomLevel: 'Zoom',
|
|
303
|
+
sortRows: 'Sort rows by',
|
|
304
|
+
dataOrder: 'Data order',
|
|
305
|
+
addTextHere: 'Add text here',
|
|
306
|
+
fitBandToContent: 'Fit section to its content',
|
|
307
|
+
thumbnails: 'Page thumbnails',
|
|
308
|
+
snapGrid: 'Snap to grid (hold Alt to move freely)',
|
|
309
|
+
gridOff: 'No grid',
|
|
310
|
+
formatPainter: 'Copy formatting: click it, then click another item (Esc cancels)',
|
|
311
|
+
addByClick: 'Click an item (or double-click a field) to add it to the selected section.',
|
|
312
|
+
resizePanel: 'Drag to resize, double-click to hide',
|
|
313
|
+
alignJustify: 'Justify',
|
|
314
|
+
noSelection: 'Nothing selected',
|
|
315
|
+
formatBar: 'Format',
|
|
316
|
+
allBorders: 'Border all round',
|
|
317
|
+
noBorder: 'No border',
|
|
274
318
|
innerList: 'Inner list',
|
|
275
319
|
innerListOf: 'List inside each row',
|
|
276
320
|
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.',
|
|
@@ -624,6 +668,50 @@ const weReportLocaleTr = {
|
|
|
624
668
|
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
669
|
conditionalFormatting: 'Koşullu biçim',
|
|
626
670
|
watermark: 'Filigran',
|
|
671
|
+
firstPage: 'İlk sayfa',
|
|
672
|
+
previousPage: 'Önceki sayfa',
|
|
673
|
+
nextPage: 'Sonraki sayfa',
|
|
674
|
+
lastPage: 'Son sayfa',
|
|
675
|
+
pageOf: '/ {0}',
|
|
676
|
+
search: 'Raporda ara',
|
|
677
|
+
matches: '{0} / {1}',
|
|
678
|
+
noMatches: 'Bulunamadı',
|
|
679
|
+
fitPage: 'Tüm sayfa',
|
|
680
|
+
keyboardShortcuts: 'Klavye kısayolları',
|
|
681
|
+
editText: 'Metni düzenle',
|
|
682
|
+
editFormula: 'Formülü düzenle…',
|
|
683
|
+
moveItem: 'Taşı',
|
|
684
|
+
moveFine: '0,1 mm taşı',
|
|
685
|
+
resizeItem: 'Genişlet / daralt, uzat / kısalt',
|
|
686
|
+
nextItem: 'Sonraki / önceki öğe',
|
|
687
|
+
rubberBand: 'Birden çok seç: boş yerde sürükle',
|
|
688
|
+
noSnap: 'Sürüklerken basılı tut: yapışma yok',
|
|
689
|
+
dragCopy: 'Ctrl basılı sürükleyince kopyalar',
|
|
690
|
+
wizardTitle: 'Rapor sihirbazı',
|
|
691
|
+
wizardReportTitle: 'Rapor başlığı',
|
|
692
|
+
wizardColumns: 'Gösterilecek sütunlar',
|
|
693
|
+
noGrouping: 'Gruplama yok',
|
|
694
|
+
wizardTotals: 'Sayı sütunlarının toplamı',
|
|
695
|
+
automatic: 'Otomatik',
|
|
696
|
+
createReport: 'Raporu oluştur',
|
|
697
|
+
previousMatch: 'Önceki eşleşme',
|
|
698
|
+
nextMatch: 'Sonraki eşleşme',
|
|
699
|
+
zoomLevel: 'Yakınlaştırma',
|
|
700
|
+
sortRows: 'Satırları sırala',
|
|
701
|
+
dataOrder: 'Veri sırası',
|
|
702
|
+
addTextHere: 'Buraya metin ekle',
|
|
703
|
+
fitBandToContent: 'Bölümü içeriğine sığdır',
|
|
704
|
+
thumbnails: 'Sayfa küçük resimleri',
|
|
705
|
+
snapGrid: 'Izgaraya yapıştır (serbest taşımak için Alt basılı tutun)',
|
|
706
|
+
gridOff: 'Izgara yok',
|
|
707
|
+
formatPainter: 'Biçimi kopyala: tıklayın, sonra başka bir öğeye tıklayın (Esc vazgeçer)',
|
|
708
|
+
addByClick: 'Bir öğeye tıklayın (veya bir alana çift tıklayın): seçili bölüme eklenir.',
|
|
709
|
+
resizePanel: 'Boyutlandırmak için sürükleyin, gizlemek için çift tıklayın',
|
|
710
|
+
alignJustify: 'İki yana yasla',
|
|
711
|
+
noSelection: 'Seçili öğe yok',
|
|
712
|
+
formatBar: 'Biçim',
|
|
713
|
+
allBorders: 'Dört kenara çerçeve',
|
|
714
|
+
noBorder: 'Çerçeve yok',
|
|
627
715
|
innerList: 'İç liste',
|
|
628
716
|
innerListOf: 'Her satırın içindeki liste',
|
|
629
717
|
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.',
|
|
@@ -983,6 +1071,50 @@ const weReportLocaleDe = {
|
|
|
983
1071
|
chartHint: 'Ein Diagramm zeigt die Zeilen seines Abschnitts: alle Zeilen im Berichtskopf oder -fuß, die Zeilen der Gruppe im Gruppenfuß.',
|
|
984
1072
|
conditionalFormatting: 'Bedingte Formatierung',
|
|
985
1073
|
watermark: 'Wasserzeichen',
|
|
1074
|
+
firstPage: 'Erste Seite',
|
|
1075
|
+
previousPage: 'Vorherige Seite',
|
|
1076
|
+
nextPage: 'Nächste Seite',
|
|
1077
|
+
lastPage: 'Letzte Seite',
|
|
1078
|
+
pageOf: 'von {0}',
|
|
1079
|
+
search: 'Im Bericht suchen',
|
|
1080
|
+
matches: '{0} von {1}',
|
|
1081
|
+
noMatches: 'Keine Treffer',
|
|
1082
|
+
fitPage: 'Ganze Seite',
|
|
1083
|
+
keyboardShortcuts: 'Tastenkürzel',
|
|
1084
|
+
editText: 'Text bearbeiten',
|
|
1085
|
+
editFormula: 'Formel bearbeiten…',
|
|
1086
|
+
moveItem: 'Verschieben',
|
|
1087
|
+
moveFine: 'Um 0,1 mm verschieben',
|
|
1088
|
+
resizeItem: 'Breiter / schmaler, höher / niedriger',
|
|
1089
|
+
nextItem: 'Nächstes / vorheriges Element',
|
|
1090
|
+
rubberBand: 'Mehrere auswählen: auf freier Fläche ziehen',
|
|
1091
|
+
noSnap: 'Beim Ziehen halten: kein Einrasten',
|
|
1092
|
+
dragCopy: 'Mit gedrückter Strg-Taste ziehen, um zu kopieren',
|
|
1093
|
+
wizardTitle: 'Berichtsassistent',
|
|
1094
|
+
wizardReportTitle: 'Berichtstitel',
|
|
1095
|
+
wizardColumns: 'Angezeigte Spalten',
|
|
1096
|
+
noGrouping: 'Keine Gruppierung',
|
|
1097
|
+
wizardTotals: 'Summen der Zahlenspalten',
|
|
1098
|
+
automatic: 'Automatisch',
|
|
1099
|
+
createReport: 'Bericht erstellen',
|
|
1100
|
+
previousMatch: 'Vorheriger Treffer',
|
|
1101
|
+
nextMatch: 'Nächster Treffer',
|
|
1102
|
+
zoomLevel: 'Zoom',
|
|
1103
|
+
sortRows: 'Zeilen sortieren nach',
|
|
1104
|
+
dataOrder: 'Reihenfolge der Daten',
|
|
1105
|
+
addTextHere: 'Hier Text einfügen',
|
|
1106
|
+
fitBandToContent: 'Bereich an Inhalt anpassen',
|
|
1107
|
+
thumbnails: 'Seitenminiaturen',
|
|
1108
|
+
snapGrid: 'Am Raster ausrichten (Alt halten für freies Verschieben)',
|
|
1109
|
+
gridOff: 'Kein Raster',
|
|
1110
|
+
formatPainter: 'Format übertragen: anklicken, dann ein anderes Element anklicken (Esc bricht ab)',
|
|
1111
|
+
addByClick: 'Element anklicken (oder Feld doppelklicken), um es zum gewählten Abschnitt hinzuzufügen.',
|
|
1112
|
+
resizePanel: 'Ziehen zum Ändern, Doppelklick zum Ausblenden',
|
|
1113
|
+
alignJustify: 'Blocksatz',
|
|
1114
|
+
noSelection: 'Nichts ausgewählt',
|
|
1115
|
+
formatBar: 'Format',
|
|
1116
|
+
allBorders: 'Rahmen ringsum',
|
|
1117
|
+
noBorder: 'Kein Rahmen',
|
|
986
1118
|
innerList: 'Innere Liste',
|
|
987
1119
|
innerListOf: 'Liste in jeder Zeile',
|
|
988
1120
|
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.',
|
|
@@ -1338,6 +1470,50 @@ const weReportLocaleFr = {
|
|
|
1338
1470
|
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
1471
|
conditionalFormatting: 'Mise en forme conditionnelle',
|
|
1340
1472
|
watermark: 'Filigrane',
|
|
1473
|
+
firstPage: 'Première page',
|
|
1474
|
+
previousPage: 'Page précédente',
|
|
1475
|
+
nextPage: 'Page suivante',
|
|
1476
|
+
lastPage: 'Dernière page',
|
|
1477
|
+
pageOf: 'sur {0}',
|
|
1478
|
+
search: 'Rechercher dans le rapport',
|
|
1479
|
+
matches: '{0} sur {1}',
|
|
1480
|
+
noMatches: 'Aucun résultat',
|
|
1481
|
+
fitPage: 'Page entière',
|
|
1482
|
+
keyboardShortcuts: 'Raccourcis clavier',
|
|
1483
|
+
editText: 'Modifier le texte',
|
|
1484
|
+
editFormula: 'Modifier la formule…',
|
|
1485
|
+
moveItem: 'Déplacer',
|
|
1486
|
+
moveFine: 'Déplacer de 0,1 mm',
|
|
1487
|
+
resizeItem: 'Élargir / rétrécir, agrandir / réduire',
|
|
1488
|
+
nextItem: 'Élément suivant / précédent',
|
|
1489
|
+
rubberBand: 'Sélection multiple : glisser sur un espace vide',
|
|
1490
|
+
noSnap: 'Maintenir en glissant : sans magnétisme',
|
|
1491
|
+
dragCopy: 'Glisser avec Ctrl enfoncée pour copier',
|
|
1492
|
+
wizardTitle: 'Assistant de rapport',
|
|
1493
|
+
wizardReportTitle: 'Titre du rapport',
|
|
1494
|
+
wizardColumns: 'Colonnes à afficher',
|
|
1495
|
+
noGrouping: 'Aucun regroupement',
|
|
1496
|
+
wizardTotals: 'Totaux des colonnes numériques',
|
|
1497
|
+
automatic: 'Automatique',
|
|
1498
|
+
createReport: 'Créer le rapport',
|
|
1499
|
+
previousMatch: 'Résultat précédent',
|
|
1500
|
+
nextMatch: 'Résultat suivant',
|
|
1501
|
+
zoomLevel: 'Zoom',
|
|
1502
|
+
sortRows: 'Trier les lignes par',
|
|
1503
|
+
dataOrder: 'Ordre des données',
|
|
1504
|
+
addTextHere: 'Ajouter un texte ici',
|
|
1505
|
+
fitBandToContent: 'Ajuster la section à son contenu',
|
|
1506
|
+
thumbnails: 'Miniatures des pages',
|
|
1507
|
+
snapGrid: 'Aligner sur la grille (maintenez Alt pour déplacer librement)',
|
|
1508
|
+
gridOff: 'Sans grille',
|
|
1509
|
+
formatPainter: 'Reproduire la mise en forme : cliquez, puis cliquez sur un autre élément (Échap annule)',
|
|
1510
|
+
addByClick: 'Cliquez sur un élément (ou double-cliquez sur un champ) pour l’ajouter à la section choisie.',
|
|
1511
|
+
resizePanel: 'Glisser pour redimensionner, double-cliquer pour masquer',
|
|
1512
|
+
alignJustify: 'Justifier',
|
|
1513
|
+
noSelection: 'Aucune sélection',
|
|
1514
|
+
formatBar: 'Mise en forme',
|
|
1515
|
+
allBorders: 'Bordure tout autour',
|
|
1516
|
+
noBorder: 'Sans bordure',
|
|
1341
1517
|
innerList: 'Liste interne',
|
|
1342
1518
|
innerListOf: 'Liste dans chaque ligne',
|
|
1343
1519
|
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.',
|
|
@@ -1693,6 +1869,50 @@ const weReportLocaleEs = {
|
|
|
1693
1869
|
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
1870
|
conditionalFormatting: 'Formato condicional',
|
|
1695
1871
|
watermark: 'Marca de agua',
|
|
1872
|
+
firstPage: 'Primera página',
|
|
1873
|
+
previousPage: 'Página anterior',
|
|
1874
|
+
nextPage: 'Página siguiente',
|
|
1875
|
+
lastPage: 'Última página',
|
|
1876
|
+
pageOf: 'de {0}',
|
|
1877
|
+
search: 'Buscar en el informe',
|
|
1878
|
+
matches: '{0} de {1}',
|
|
1879
|
+
noMatches: 'Sin resultados',
|
|
1880
|
+
fitPage: 'Página completa',
|
|
1881
|
+
keyboardShortcuts: 'Atajos de teclado',
|
|
1882
|
+
editText: 'Editar el texto',
|
|
1883
|
+
editFormula: 'Editar la fórmula…',
|
|
1884
|
+
moveItem: 'Mover',
|
|
1885
|
+
moveFine: 'Mover 0,1 mm',
|
|
1886
|
+
resizeItem: 'Más ancho / estrecho, más alto / bajo',
|
|
1887
|
+
nextItem: 'Elemento siguiente / anterior',
|
|
1888
|
+
rubberBand: 'Seleccionar varios: arrastrar en un hueco',
|
|
1889
|
+
noSnap: 'Mantener al arrastrar: sin ajuste',
|
|
1890
|
+
dragCopy: 'Arrastrar con Ctrl pulsado para copiar',
|
|
1891
|
+
wizardTitle: 'Asistente de informes',
|
|
1892
|
+
wizardReportTitle: 'Título del informe',
|
|
1893
|
+
wizardColumns: 'Columnas que se muestran',
|
|
1894
|
+
noGrouping: 'Sin agrupar',
|
|
1895
|
+
wizardTotals: 'Totales de las columnas numéricas',
|
|
1896
|
+
automatic: 'Automático',
|
|
1897
|
+
createReport: 'Crear informe',
|
|
1898
|
+
previousMatch: 'Coincidencia anterior',
|
|
1899
|
+
nextMatch: 'Coincidencia siguiente',
|
|
1900
|
+
zoomLevel: 'Zoom',
|
|
1901
|
+
sortRows: 'Ordenar filas por',
|
|
1902
|
+
dataOrder: 'Orden de los datos',
|
|
1903
|
+
addTextHere: 'Añadir texto aquí',
|
|
1904
|
+
fitBandToContent: 'Ajustar la sección a su contenido',
|
|
1905
|
+
thumbnails: 'Miniaturas de página',
|
|
1906
|
+
snapGrid: 'Ajustar a la cuadrícula (mantenga Alt para mover libremente)',
|
|
1907
|
+
gridOff: 'Sin cuadrícula',
|
|
1908
|
+
formatPainter: 'Copiar formato: haga clic y luego en otro elemento (Esc cancela)',
|
|
1909
|
+
addByClick: 'Pulse un elemento (o doble clic en un campo) para añadirlo a la sección elegida.',
|
|
1910
|
+
resizePanel: 'Arrastrar para cambiar el tamaño, doble clic para ocultar',
|
|
1911
|
+
alignJustify: 'Justificar',
|
|
1912
|
+
noSelection: 'Nada seleccionado',
|
|
1913
|
+
formatBar: 'Formato',
|
|
1914
|
+
allBorders: 'Borde completo',
|
|
1915
|
+
noBorder: 'Sin borde',
|
|
1696
1916
|
innerList: 'Lista interna',
|
|
1697
1917
|
innerListOf: 'Lista dentro de cada fila',
|
|
1698
1918
|
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.',
|
|
@@ -1841,6 +2061,25 @@ const WE_REPORT_DEFAULT_ICONS = {
|
|
|
1841
2061
|
checkbox: svg('<rect x="4" y="4" width="16" height="16" rx="2"/><path d="M8 12l3 3 5-6"/>'),
|
|
1842
2062
|
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
2063
|
design: svg('<path d="M12 20h9M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4z"/>'),
|
|
2064
|
+
textLeft: svg('<path d="M4 6h16M4 10h10M4 14h16M4 18h10"/>'),
|
|
2065
|
+
textCenter: svg('<path d="M4 6h16M7 10h10M4 14h16M7 18h10"/>'),
|
|
2066
|
+
textRight: svg('<path d="M4 6h16M10 10h10M4 14h16M10 18h10"/>'),
|
|
2067
|
+
textJustify: svg('<path d="M4 6h16M4 10h16M4 14h16M4 18h16"/>'),
|
|
2068
|
+
borderAll: svg('<rect x="4" y="4" width="16" height="16" rx="1"/>'),
|
|
2069
|
+
borderNone: svg('<rect x="4" y="4" width="16" height="16" rx="1" stroke-dasharray="2 3"/>'),
|
|
2070
|
+
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"/>'),
|
|
2071
|
+
firstPage: svg('<path d="M6 5v14M18 6l-7 6 7 6"/>'),
|
|
2072
|
+
previousPage: svg('<path d="M15 6l-6 6 6 6"/>'),
|
|
2073
|
+
nextPage: svg('<path d="M9 6l6 6-6 6"/>'),
|
|
2074
|
+
lastPage: svg('<path d="M18 5v14M6 6l7 6-7 6"/>'),
|
|
2075
|
+
chevronUp: svg('<path d="M6 15l6-6 6 6"/>'),
|
|
2076
|
+
chevronDown: svg('<path d="M6 9l6 6 6-6"/>'),
|
|
2077
|
+
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"/>'),
|
|
2078
|
+
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"/>'),
|
|
2079
|
+
edit: svg('<path d="M4 20h4L19 9l-4-4L4 16v4z"/><path d="M13.5 6.5l4 4"/>'),
|
|
2080
|
+
fitHeight: svg('<path d="M12 3v18M8 7l4-4 4 4M8 17l4 4 4-4"/>'),
|
|
2081
|
+
noColor: svg('<circle cx="12" cy="12" r="8"/><path d="M6.5 17.5l11-11"/>'),
|
|
2082
|
+
wand: svg('<path d="M4 20L15 9"/><path d="M14 4v3M18 6l-2 2M20 10h-3M17 14l-2-2"/>'),
|
|
1844
2083
|
table: svg('<rect x="3" y="5" width="18" height="14" rx="1.5"/><path d="M3 10h18M3 14.5h18M9 5v14M15 5v14"/>'),
|
|
1845
2084
|
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
2085
|
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 +2213,16 @@ const PT_TO_MM = 25.4 / 72;
|
|
|
1974
2213
|
class WeReportPageComponent {
|
|
1975
2214
|
page = input.required();
|
|
1976
2215
|
zoom = input(1);
|
|
2216
|
+
/** Lines containing this text are highlighted (case-insensitive). */
|
|
2217
|
+
highlight = input('');
|
|
2218
|
+
/** The match the viewer is showing now, drawn stronger. */
|
|
2219
|
+
current = input(null);
|
|
2220
|
+
locale = input(undefined);
|
|
1977
2221
|
ptToMm = PT_TO_MM;
|
|
2222
|
+
isHit(text) {
|
|
2223
|
+
const q = this.highlight().trim();
|
|
2224
|
+
return !!q && text.toLocaleLowerCase(this.locale()).includes(q.toLocaleLowerCase(this.locale()));
|
|
2225
|
+
}
|
|
1978
2226
|
text(item) {
|
|
1979
2227
|
return item;
|
|
1980
2228
|
}
|
|
@@ -1995,7 +2243,7 @@ class WeReportPageComponent {
|
|
|
1995
2243
|
return `'${WeReportFontsService.cssFamily(item.fontFamily)}'`;
|
|
1996
2244
|
}
|
|
1997
2245
|
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: `
|
|
2246
|
+
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
2247
|
<svg
|
|
2000
2248
|
class="we-report-page"
|
|
2001
2249
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -2003,7 +2251,7 @@ class WeReportPageComponent {
|
|
|
2003
2251
|
[style.width.mm]="page().width * zoom()"
|
|
2004
2252
|
[style.height.mm]="page().height * zoom()"
|
|
2005
2253
|
>
|
|
2006
|
-
@for (item of page().items; track $index) {
|
|
2254
|
+
@for (item of page().items; track $index; let i = $index) {
|
|
2007
2255
|
@switch (item.kind) {
|
|
2008
2256
|
@case ('rect') {
|
|
2009
2257
|
<rect
|
|
@@ -2041,7 +2289,19 @@ class WeReportPageComponent {
|
|
|
2041
2289
|
}
|
|
2042
2290
|
@case ('text') {
|
|
2043
2291
|
<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) {
|
|
2292
|
+
@for (line of text(item).lines; track $index; let l = $index) {
|
|
2293
|
+
@if (isHit(line.text)) {
|
|
2294
|
+
<rect
|
|
2295
|
+
class="we-report-page__hit"
|
|
2296
|
+
[class.we-report-page__hit--current]="current()?.item === i && current()?.line === l"
|
|
2297
|
+
[attr.data-hit]="i + '-' + l"
|
|
2298
|
+
[attr.x]="line.x - item.x - 0.4"
|
|
2299
|
+
[attr.y]="line.baseline - item.y - text(item).size * ptToMm * 0.85"
|
|
2300
|
+
[attr.width]="line.width + 0.8"
|
|
2301
|
+
[attr.height]="text(item).size * ptToMm * 1.15"
|
|
2302
|
+
rx="0.4"
|
|
2303
|
+
/>
|
|
2304
|
+
}
|
|
2045
2305
|
<text
|
|
2046
2306
|
class="we-report-page__text"
|
|
2047
2307
|
[attr.x]="line.x - item.x"
|
|
@@ -2078,7 +2338,7 @@ class WeReportPageComponent {
|
|
|
2078
2338
|
}
|
|
2079
2339
|
}
|
|
2080
2340
|
</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 });
|
|
2341
|
+
`, 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
2342
|
}
|
|
2083
2343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportPageComponent, decorators: [{
|
|
2084
2344
|
type: Component,
|
|
@@ -2090,7 +2350,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2090
2350
|
[style.width.mm]="page().width * zoom()"
|
|
2091
2351
|
[style.height.mm]="page().height * zoom()"
|
|
2092
2352
|
>
|
|
2093
|
-
@for (item of page().items; track $index) {
|
|
2353
|
+
@for (item of page().items; track $index; let i = $index) {
|
|
2094
2354
|
@switch (item.kind) {
|
|
2095
2355
|
@case ('rect') {
|
|
2096
2356
|
<rect
|
|
@@ -2128,7 +2388,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2128
2388
|
}
|
|
2129
2389
|
@case ('text') {
|
|
2130
2390
|
<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) {
|
|
2391
|
+
@for (line of text(item).lines; track $index; let l = $index) {
|
|
2392
|
+
@if (isHit(line.text)) {
|
|
2393
|
+
<rect
|
|
2394
|
+
class="we-report-page__hit"
|
|
2395
|
+
[class.we-report-page__hit--current]="current()?.item === i && current()?.line === l"
|
|
2396
|
+
[attr.data-hit]="i + '-' + l"
|
|
2397
|
+
[attr.x]="line.x - item.x - 0.4"
|
|
2398
|
+
[attr.y]="line.baseline - item.y - text(item).size * ptToMm * 0.85"
|
|
2399
|
+
[attr.width]="line.width + 0.8"
|
|
2400
|
+
[attr.height]="text(item).size * ptToMm * 1.15"
|
|
2401
|
+
rx="0.4"
|
|
2402
|
+
/>
|
|
2403
|
+
}
|
|
2132
2404
|
<text
|
|
2133
2405
|
class="we-report-page__text"
|
|
2134
2406
|
[attr.x]="line.x - item.x"
|
|
@@ -2165,7 +2437,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2165
2437
|
}
|
|
2166
2438
|
}
|
|
2167
2439
|
</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"] }]
|
|
2440
|
+
`, 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
2441
|
}] });
|
|
2170
2442
|
|
|
2171
2443
|
/** Paged preview of a report with zoom, PDF download and print. No server involved. */
|
|
@@ -2223,6 +2495,123 @@ class WeReportViewerComponent {
|
|
|
2223
2495
|
untracked(() => this.layout(report, data, now, params));
|
|
2224
2496
|
}, { allowSignalWrites: true });
|
|
2225
2497
|
}
|
|
2498
|
+
zoomSteps = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
2499
|
+
showThumbs = signal(false);
|
|
2500
|
+
thumbZoom = 0.18;
|
|
2501
|
+
currentPage = signal(1);
|
|
2502
|
+
pageTotal = computed(() => this.document()?.pages.length ?? 0);
|
|
2503
|
+
query = signal('');
|
|
2504
|
+
matchIndex = signal(0);
|
|
2505
|
+
scroller = viewChild('scroller');
|
|
2506
|
+
thumbs = viewChild('thumbs');
|
|
2507
|
+
searchBox = viewChild('searchBox');
|
|
2508
|
+
/** Every line containing the search text: page, item and line index, in reading order. */
|
|
2509
|
+
matches = computed(() => {
|
|
2510
|
+
const q = this.query().trim().toLocaleLowerCase(this.config.locale);
|
|
2511
|
+
const doc = this.document();
|
|
2512
|
+
if (!q || !doc)
|
|
2513
|
+
return [];
|
|
2514
|
+
const out = [];
|
|
2515
|
+
doc.pages.forEach((page, p) => page.items.forEach((item, i) => {
|
|
2516
|
+
if (item.kind !== 'text')
|
|
2517
|
+
return;
|
|
2518
|
+
item.lines.forEach((line, l) => {
|
|
2519
|
+
if (line.text.toLocaleLowerCase(this.config.locale).includes(q))
|
|
2520
|
+
out.push({ page: p, item: i, line: l });
|
|
2521
|
+
});
|
|
2522
|
+
}));
|
|
2523
|
+
return out;
|
|
2524
|
+
});
|
|
2525
|
+
currentHit = computed(() => this.matches()[this.matchIndex()] ?? null);
|
|
2526
|
+
setQuery(value) {
|
|
2527
|
+
this.query.set(value);
|
|
2528
|
+
this.matchIndex.set(0);
|
|
2529
|
+
queueMicrotask(() => this.revealHit());
|
|
2530
|
+
}
|
|
2531
|
+
nextMatch(step) {
|
|
2532
|
+
const n = this.matches().length;
|
|
2533
|
+
if (!n)
|
|
2534
|
+
return;
|
|
2535
|
+
this.matchIndex.set((this.matchIndex() + step + n) % n);
|
|
2536
|
+
queueMicrotask(() => this.revealHit());
|
|
2537
|
+
}
|
|
2538
|
+
revealHit() {
|
|
2539
|
+
const hit = this.currentHit();
|
|
2540
|
+
if (!hit)
|
|
2541
|
+
return;
|
|
2542
|
+
// Rendered after this change: wait a frame, then bring the line into view.
|
|
2543
|
+
requestAnimationFrame(() => {
|
|
2544
|
+
const page = this.scroller()?.nativeElement.querySelector(`[data-page="${hit.page + 1}"]`);
|
|
2545
|
+
const rect = page?.querySelector(`[data-hit="${hit.item}-${hit.line}"]`) ?? page;
|
|
2546
|
+
rect?.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
2547
|
+
});
|
|
2548
|
+
}
|
|
2549
|
+
goToPage(n) {
|
|
2550
|
+
const target = Math.min(Math.max(1, Math.round(n) || 1), this.pageTotal());
|
|
2551
|
+
this.scroller()?.nativeElement.querySelector(`[data-page="${target}"]`)?.scrollIntoView({ block: 'start' });
|
|
2552
|
+
this.setCurrent(target);
|
|
2553
|
+
}
|
|
2554
|
+
/** The page whose top is nearest the top of the view is the current page. */
|
|
2555
|
+
onScroll() {
|
|
2556
|
+
const box = this.scroller()?.nativeElement;
|
|
2557
|
+
if (!box)
|
|
2558
|
+
return;
|
|
2559
|
+
const top = box.getBoundingClientRect().top;
|
|
2560
|
+
let best = 1;
|
|
2561
|
+
box.querySelectorAll('[data-page]').forEach((el) => {
|
|
2562
|
+
if (el.getBoundingClientRect().top - top <= box.clientHeight / 3)
|
|
2563
|
+
best = Number(el.dataset['page']);
|
|
2564
|
+
});
|
|
2565
|
+
if (best !== this.currentPage())
|
|
2566
|
+
this.setCurrent(best);
|
|
2567
|
+
}
|
|
2568
|
+
setCurrent(page) {
|
|
2569
|
+
this.currentPage.set(page);
|
|
2570
|
+
// Keep the current page's thumbnail in sight.
|
|
2571
|
+
this.thumbs()?.nativeElement.children[page - 1]?.scrollIntoView({ block: 'nearest' });
|
|
2572
|
+
}
|
|
2573
|
+
pickZoom(value) {
|
|
2574
|
+
const box = this.scroller()?.nativeElement;
|
|
2575
|
+
const page = this.document()?.pages[0];
|
|
2576
|
+
if ((value === 'width' || value === 'page') && box && page) {
|
|
2577
|
+
const pxPerMm = 96 / 25.4;
|
|
2578
|
+
const byWidth = (box.clientWidth - 64) / (page.width * pxPerMm);
|
|
2579
|
+
const byHeight = (box.clientHeight - 64) / (page.height * pxPerMm);
|
|
2580
|
+
this.setZoom(value === 'width' ? byWidth : Math.min(byWidth, byHeight));
|
|
2581
|
+
}
|
|
2582
|
+
else if (value) {
|
|
2583
|
+
this.setZoom(Number(value));
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
onKeydown(e) {
|
|
2587
|
+
const mod = e.ctrlKey || e.metaKey;
|
|
2588
|
+
const typing = e.target.closest('input, textarea, select');
|
|
2589
|
+
if (mod && e.key.toLowerCase() === 'f') {
|
|
2590
|
+
e.preventDefault();
|
|
2591
|
+
this.searchBox()?.nativeElement.focus();
|
|
2592
|
+
this.searchBox()?.nativeElement.select();
|
|
2593
|
+
}
|
|
2594
|
+
else if (mod && e.key.toLowerCase() === 'p') {
|
|
2595
|
+
e.preventDefault();
|
|
2596
|
+
void this.print();
|
|
2597
|
+
}
|
|
2598
|
+
else if (mod && (e.key === '=' || e.key === '+')) {
|
|
2599
|
+
e.preventDefault();
|
|
2600
|
+
this.setZoom(this.zoomLevel() + 0.1);
|
|
2601
|
+
}
|
|
2602
|
+
else if (mod && e.key === '-') {
|
|
2603
|
+
e.preventDefault();
|
|
2604
|
+
this.setZoom(this.zoomLevel() - 0.1);
|
|
2605
|
+
}
|
|
2606
|
+
else if (!typing && (e.key === 'PageDown' || e.key === 'PageUp')) {
|
|
2607
|
+
e.preventDefault();
|
|
2608
|
+
this.goToPage(this.currentPage() + (e.key === 'PageDown' ? 1 : -1));
|
|
2609
|
+
}
|
|
2610
|
+
else if (!typing && (e.key === 'Home' || e.key === 'End')) {
|
|
2611
|
+
e.preventDefault();
|
|
2612
|
+
this.goToPage(e.key === 'Home' ? 1 : this.pageTotal());
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2226
2615
|
setZoom(value) {
|
|
2227
2616
|
this.zoomLevel.set(Math.min(4, Math.max(0.25, Math.round(value * 100) / 100)));
|
|
2228
2617
|
}
|
|
@@ -2314,12 +2703,37 @@ class WeReportViewerComponent {
|
|
|
2314
2703
|
this.dom.body.appendChild(frame);
|
|
2315
2704
|
}
|
|
2316
2705
|
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: `
|
|
2706
|
+
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
2707
|
<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
|
-
|
|
2708
|
+
<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>
|
|
2709
|
+
<select class="we-report-viewer__zoomsel" (change)="pickZoom($any($event.target).value); $any($event.target).value = ''" [attr.aria-label]="strings().zoomLevel">
|
|
2710
|
+
<option value="" selected>{{ (zoomLevel() * 100).toFixed(0) }}%</option>
|
|
2711
|
+
@for (z of zoomSteps; track z) {
|
|
2712
|
+
<option [value]="z">{{ z * 100 }}%</option>
|
|
2713
|
+
}
|
|
2714
|
+
<option value="width">{{ strings().fitWidth }}</option>
|
|
2715
|
+
<option value="page">{{ strings().fitPage }}</option>
|
|
2716
|
+
</select>
|
|
2717
|
+
<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>
|
|
2718
|
+
@if (pageTotal() > 1) {
|
|
2719
|
+
<span class="we-report-viewer__sep"></span>
|
|
2720
|
+
<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>
|
|
2721
|
+
<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>
|
|
2722
|
+
<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>
|
|
2723
|
+
<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" />
|
|
2724
|
+
<span class="we-report-viewer__pages">{{ strings().pageOf.replace('{0}', '' + pageTotal()) }}</span>
|
|
2725
|
+
<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>
|
|
2726
|
+
<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>
|
|
2727
|
+
} @else {
|
|
2728
|
+
<span class="we-report-viewer__pages">{{ pageLabel() }}</span>
|
|
2729
|
+
}
|
|
2730
|
+
<span class="we-report-viewer__sep"></span>
|
|
2731
|
+
<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" />
|
|
2732
|
+
@if (query().trim()) {
|
|
2733
|
+
<span class="we-report-viewer__pages">{{ matches().length ? strings().matches.replace('{0}', '' + (matchIndex() + 1)).replace('{1}', '' + matches().length) : strings().noMatches }}</span>
|
|
2734
|
+
<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>
|
|
2735
|
+
<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>
|
|
2736
|
+
}
|
|
2323
2737
|
<span class="we-report-viewer__spacer"></span>
|
|
2324
2738
|
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="print()" [disabled]="!document()">
|
|
2325
2739
|
<span [innerHTML]="'print' | weReportIcon"></span>{{ strings().print }}
|
|
@@ -2374,25 +2788,74 @@ class WeReportViewerComponent {
|
|
|
2374
2788
|
</ul>
|
|
2375
2789
|
</details>
|
|
2376
2790
|
}
|
|
2377
|
-
<div class="we-report-
|
|
2791
|
+
<div class="we-report-viewer__main">
|
|
2792
|
+
@if (showThumbs() && pageTotal() > 1) {
|
|
2793
|
+
<nav #thumbs class="we-report-viewer__thumbs" [attr.aria-label]="strings().thumbnails">
|
|
2794
|
+
@for (page of document()!.pages; track $index; let p = $index) {
|
|
2795
|
+
<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)">
|
|
2796
|
+
@defer (on viewport) {
|
|
2797
|
+
<we-report-page [page]="page" [zoom]="thumbZoom" />
|
|
2798
|
+
} @placeholder {
|
|
2799
|
+
<div class="we-report-viewer__thumb-blank" [style.width.mm]="page.width * thumbZoom" [style.height.mm]="page.height * thumbZoom"></div>
|
|
2800
|
+
}
|
|
2801
|
+
<span>{{ p + 1 }}</span>
|
|
2802
|
+
</button>
|
|
2803
|
+
}
|
|
2804
|
+
</nav>
|
|
2805
|
+
}
|
|
2806
|
+
<div #scroller class="we-report-viewer__scroll" tabindex="0" (scroll)="onScroll()">
|
|
2378
2807
|
@if (document(); as doc) {
|
|
2379
|
-
@for (page of doc.pages; track $index) {
|
|
2380
|
-
<we-report-page
|
|
2808
|
+
@for (page of doc.pages; track $index; let p = $index) {
|
|
2809
|
+
<we-report-page
|
|
2810
|
+
class="we-report-viewer__page"
|
|
2811
|
+
[attr.data-page]="p + 1"
|
|
2812
|
+
[page]="page"
|
|
2813
|
+
[zoom]="zoomLevel()"
|
|
2814
|
+
[highlight]="query()"
|
|
2815
|
+
[locale]="config.locale"
|
|
2816
|
+
[current]="currentHit()?.page === p ? currentHit() : null"
|
|
2817
|
+
/>
|
|
2381
2818
|
}
|
|
2382
2819
|
} @else if (!error()) {
|
|
2383
2820
|
<div class="we-report-viewer__loading">{{ strings().loading }}</div>
|
|
2384
2821
|
}
|
|
2385
2822
|
</div>
|
|
2386
|
-
|
|
2823
|
+
</div>
|
|
2824
|
+
`, 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
2825
|
}
|
|
2388
2826
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportViewerComponent, decorators: [{
|
|
2389
2827
|
type: Component,
|
|
2390
2828
|
args: [{ selector: 'we-report-viewer', standalone: true, imports: [WeReportPageComponent, WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2391
2829
|
<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
|
-
|
|
2830
|
+
<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>
|
|
2831
|
+
<select class="we-report-viewer__zoomsel" (change)="pickZoom($any($event.target).value); $any($event.target).value = ''" [attr.aria-label]="strings().zoomLevel">
|
|
2832
|
+
<option value="" selected>{{ (zoomLevel() * 100).toFixed(0) }}%</option>
|
|
2833
|
+
@for (z of zoomSteps; track z) {
|
|
2834
|
+
<option [value]="z">{{ z * 100 }}%</option>
|
|
2835
|
+
}
|
|
2836
|
+
<option value="width">{{ strings().fitWidth }}</option>
|
|
2837
|
+
<option value="page">{{ strings().fitPage }}</option>
|
|
2838
|
+
</select>
|
|
2839
|
+
<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>
|
|
2840
|
+
@if (pageTotal() > 1) {
|
|
2841
|
+
<span class="we-report-viewer__sep"></span>
|
|
2842
|
+
<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>
|
|
2843
|
+
<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>
|
|
2844
|
+
<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>
|
|
2845
|
+
<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" />
|
|
2846
|
+
<span class="we-report-viewer__pages">{{ strings().pageOf.replace('{0}', '' + pageTotal()) }}</span>
|
|
2847
|
+
<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>
|
|
2848
|
+
<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>
|
|
2849
|
+
} @else {
|
|
2850
|
+
<span class="we-report-viewer__pages">{{ pageLabel() }}</span>
|
|
2851
|
+
}
|
|
2852
|
+
<span class="we-report-viewer__sep"></span>
|
|
2853
|
+
<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" />
|
|
2854
|
+
@if (query().trim()) {
|
|
2855
|
+
<span class="we-report-viewer__pages">{{ matches().length ? strings().matches.replace('{0}', '' + (matchIndex() + 1)).replace('{1}', '' + matches().length) : strings().noMatches }}</span>
|
|
2856
|
+
<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>
|
|
2857
|
+
<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>
|
|
2858
|
+
}
|
|
2396
2859
|
<span class="we-report-viewer__spacer"></span>
|
|
2397
2860
|
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="print()" [disabled]="!document()">
|
|
2398
2861
|
<span [innerHTML]="'print' | weReportIcon"></span>{{ strings().print }}
|
|
@@ -2447,17 +2910,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2447
2910
|
</ul>
|
|
2448
2911
|
</details>
|
|
2449
2912
|
}
|
|
2450
|
-
<div class="we-report-
|
|
2913
|
+
<div class="we-report-viewer__main">
|
|
2914
|
+
@if (showThumbs() && pageTotal() > 1) {
|
|
2915
|
+
<nav #thumbs class="we-report-viewer__thumbs" [attr.aria-label]="strings().thumbnails">
|
|
2916
|
+
@for (page of document()!.pages; track $index; let p = $index) {
|
|
2917
|
+
<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)">
|
|
2918
|
+
@defer (on viewport) {
|
|
2919
|
+
<we-report-page [page]="page" [zoom]="thumbZoom" />
|
|
2920
|
+
} @placeholder {
|
|
2921
|
+
<div class="we-report-viewer__thumb-blank" [style.width.mm]="page.width * thumbZoom" [style.height.mm]="page.height * thumbZoom"></div>
|
|
2922
|
+
}
|
|
2923
|
+
<span>{{ p + 1 }}</span>
|
|
2924
|
+
</button>
|
|
2925
|
+
}
|
|
2926
|
+
</nav>
|
|
2927
|
+
}
|
|
2928
|
+
<div #scroller class="we-report-viewer__scroll" tabindex="0" (scroll)="onScroll()">
|
|
2451
2929
|
@if (document(); as doc) {
|
|
2452
|
-
@for (page of doc.pages; track $index) {
|
|
2453
|
-
<we-report-page
|
|
2930
|
+
@for (page of doc.pages; track $index; let p = $index) {
|
|
2931
|
+
<we-report-page
|
|
2932
|
+
class="we-report-viewer__page"
|
|
2933
|
+
[attr.data-page]="p + 1"
|
|
2934
|
+
[page]="page"
|
|
2935
|
+
[zoom]="zoomLevel()"
|
|
2936
|
+
[highlight]="query()"
|
|
2937
|
+
[locale]="config.locale"
|
|
2938
|
+
[current]="currentHit()?.page === p ? currentHit() : null"
|
|
2939
|
+
/>
|
|
2454
2940
|
}
|
|
2455
2941
|
} @else if (!error()) {
|
|
2456
2942
|
<div class="we-report-viewer__loading">{{ strings().loading }}</div>
|
|
2457
2943
|
}
|
|
2458
2944
|
</div>
|
|
2459
|
-
|
|
2460
|
-
|
|
2945
|
+
</div>
|
|
2946
|
+
`, 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"] }]
|
|
2947
|
+
}], ctorParameters: () => [], propDecorators: { onKeydown: [{
|
|
2948
|
+
type: HostListener,
|
|
2949
|
+
args: ['keydown', ['$event']]
|
|
2950
|
+
}] } });
|
|
2461
2951
|
|
|
2462
2952
|
/** Toolbox entries in display order. */
|
|
2463
2953
|
const TOOLBOX_ITEMS = [
|
|
@@ -2524,6 +3014,22 @@ function fieldExpression(path, parent) {
|
|
|
2524
3014
|
/** Module-wide, so copy in one designer and paste in another on the same page works. */
|
|
2525
3015
|
let clipboard = [];
|
|
2526
3016
|
const round$1 = (v) => Math.round(v * 100) / 100;
|
|
3017
|
+
/** Marks designer items on the system clipboard, so they paste into another tab or window. */
|
|
3018
|
+
const CLIPBOARD_MARKER = 'we-report/controls+json:';
|
|
3019
|
+
const CONTROL_TYPES = {
|
|
3020
|
+
text: true, line: true, shape: true, image: true, barcode: true, pageInfo: true, checkbox: true, chart: true, table: true,
|
|
3021
|
+
};
|
|
3022
|
+
function isPastedControl(c) {
|
|
3023
|
+
if (!c || typeof c !== 'object')
|
|
3024
|
+
return false;
|
|
3025
|
+
const x = c;
|
|
3026
|
+
const finite = (v) => typeof v === 'number' && Number.isFinite(v);
|
|
3027
|
+
return (typeof x['id'] === 'string' &&
|
|
3028
|
+
typeof x['type'] === 'string' &&
|
|
3029
|
+
Object.hasOwn(CONTROL_TYPES, x['type']) &&
|
|
3030
|
+
['x', 'y', 'width', 'height'].every((k) => finite(x[k])) &&
|
|
3031
|
+
(x['type'] !== 'table' || (Array.isArray(x['columns']) && Array.isArray(x['rows']) && x['rows'].every((r) => Array.isArray(r?.cells)))));
|
|
3032
|
+
}
|
|
2527
3033
|
const HISTORY_LIMIT = 200;
|
|
2528
3034
|
const COALESCE_MS = 800;
|
|
2529
3035
|
/** Copies the editable parts; data source payloads (possibly large) are shared, never mutated. */
|
|
@@ -2548,6 +3054,12 @@ class DesignerState {
|
|
|
2548
3054
|
canRedo = signal(false);
|
|
2549
3055
|
/** The table cell last clicked; the inspector edits it while its table is selected. */
|
|
2550
3056
|
tableCell = signal(null);
|
|
3057
|
+
/** Format painter: the look picked up from one item, applied to the next item clicked. */
|
|
3058
|
+
painter = signal(null);
|
|
3059
|
+
/** Text being typed on the page (double-click / F2): a text control, or a cell of a table. */
|
|
3060
|
+
editing = signal(null);
|
|
3061
|
+
/** Where the pointer is on the page, for the status bar: band and mm inside it. */
|
|
3062
|
+
pointer = signal(null);
|
|
2551
3063
|
/** The first data row and its scope, for live values in the design and the formula editor. */
|
|
2552
3064
|
sample = signal(null);
|
|
2553
3065
|
selectedControls = computed(() => {
|
|
@@ -2614,12 +3126,13 @@ class DesignerState {
|
|
|
2614
3126
|
this.pruneSelection();
|
|
2615
3127
|
this.syncFlags();
|
|
2616
3128
|
}
|
|
2617
|
-
/** A new id not used by any band or control. */
|
|
2618
|
-
newId(prefix) {
|
|
3129
|
+
/** A new id not used by any band or control; pass the same `taken` set when making several ids before the report changes. */
|
|
3130
|
+
newId(prefix, taken = new Set()) {
|
|
2619
3131
|
const used = new Set(this.report().bands.flatMap((b) => [b.id, ...b.controls.map((c) => c.id)]));
|
|
2620
3132
|
let n = 1;
|
|
2621
|
-
while (used.has(`${prefix}${n}`))
|
|
3133
|
+
while (used.has(`${prefix}${n}`) || taken.has(`${prefix}${n}`))
|
|
2622
3134
|
n++;
|
|
3135
|
+
taken.add(`${prefix}${n}`);
|
|
2623
3136
|
return `${prefix}${n}`;
|
|
2624
3137
|
}
|
|
2625
3138
|
findBandOf(controlId, def = this.report()) {
|
|
@@ -2667,10 +3180,11 @@ class DesignerState {
|
|
|
2667
3180
|
const controls = this.selectedControls();
|
|
2668
3181
|
if (!controls.length)
|
|
2669
3182
|
return;
|
|
3183
|
+
const taken = new Set();
|
|
2670
3184
|
const copies = [];
|
|
2671
3185
|
for (const c of controls) {
|
|
2672
3186
|
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 } });
|
|
3187
|
+
copies.push({ bandId: band.id, control: { ...structuredClone(c), id: this.newId(c.type, taken), x: c.x + 3, y: c.y + 3 } });
|
|
2674
3188
|
}
|
|
2675
3189
|
this.update((d) => copies.forEach(({ bandId, control }) => d.bands.find((b) => b.id === bandId).controls.push(control)));
|
|
2676
3190
|
this.selection.set({ kind: 'controls', ids: copies.map((c) => c.control.id) });
|
|
@@ -2718,6 +3232,26 @@ class DesignerState {
|
|
|
2718
3232
|
}));
|
|
2719
3233
|
this.selection.set({ kind: 'controls', ids: placed.map((p) => p.control.id) });
|
|
2720
3234
|
}
|
|
3235
|
+
/** The copied items as text for the system clipboard. */
|
|
3236
|
+
clipboardText() {
|
|
3237
|
+
return CLIPBOARD_MARKER + JSON.stringify(clipboard);
|
|
3238
|
+
}
|
|
3239
|
+
/** Takes items copied in another designer (another tab or window); false when it is not ours. */
|
|
3240
|
+
loadClipboard(text) {
|
|
3241
|
+
if (!text.startsWith(CLIPBOARD_MARKER))
|
|
3242
|
+
return false;
|
|
3243
|
+
try {
|
|
3244
|
+
const items = JSON.parse(text.slice(CLIPBOARD_MARKER.length));
|
|
3245
|
+
// Any program can write this text: take only items the designer can draw.
|
|
3246
|
+
if (!Array.isArray(items) || !items.length || !items.every((i) => isPastedControl(i?.control)))
|
|
3247
|
+
return false;
|
|
3248
|
+
clipboard = items;
|
|
3249
|
+
return true;
|
|
3250
|
+
}
|
|
3251
|
+
catch {
|
|
3252
|
+
return false;
|
|
3253
|
+
}
|
|
3254
|
+
}
|
|
2721
3255
|
hasClipboard() {
|
|
2722
3256
|
return clipboard.length > 0;
|
|
2723
3257
|
}
|
|
@@ -2788,6 +3322,56 @@ class DesignerState {
|
|
|
2788
3322
|
band.height = Math.max(band.height, c.y + c.height);
|
|
2789
3323
|
});
|
|
2790
3324
|
}
|
|
3325
|
+
/**
|
|
3326
|
+
* Sets one style property on the selection, the way a format bar does: on the clicked table
|
|
3327
|
+
* cell when a single table is selected and a cell of it is chosen, else on every selected item.
|
|
3328
|
+
* `undefined` removes the override (back to the style sheet).
|
|
3329
|
+
*/
|
|
3330
|
+
applyStyle(key, value) {
|
|
3331
|
+
const sel = this.selection();
|
|
3332
|
+
if (sel.kind !== 'controls')
|
|
3333
|
+
return;
|
|
3334
|
+
const set = (target) => {
|
|
3335
|
+
const style = { ...target.styleOverrides };
|
|
3336
|
+
if (value === undefined)
|
|
3337
|
+
delete style[key];
|
|
3338
|
+
else
|
|
3339
|
+
style[key] = value;
|
|
3340
|
+
target.styleOverrides = Object.keys(style).length ? style : undefined;
|
|
3341
|
+
};
|
|
3342
|
+
const cell = this.tableCell();
|
|
3343
|
+
const single = sel.ids.length === 1 ? this.selectedControls()[0] : undefined;
|
|
3344
|
+
if (single?.type === 'table' && cell?.controlId === single.id) {
|
|
3345
|
+
this.updateControls([single.id], (c) => {
|
|
3346
|
+
const target = c.type === 'table' ? c.rows[cell.row]?.cells[cell.cell] : undefined;
|
|
3347
|
+
if (target)
|
|
3348
|
+
set(target);
|
|
3349
|
+
}, `format-${key}`);
|
|
3350
|
+
return;
|
|
3351
|
+
}
|
|
3352
|
+
this.updateControls(sel.ids, (c) => set(c), `format-${key}`);
|
|
3353
|
+
}
|
|
3354
|
+
/** Grows or shrinks the selection by (dw, dh) mm, never below 1 mm. */
|
|
3355
|
+
resizeSelection(dw, dh) {
|
|
3356
|
+
const sel = this.selection();
|
|
3357
|
+
if (sel.kind !== 'controls')
|
|
3358
|
+
return;
|
|
3359
|
+
this.updateControls(sel.ids, (c, band) => {
|
|
3360
|
+
c.width = round$1(Math.max(1, c.width + dw));
|
|
3361
|
+
c.height = round$1(Math.max(1, c.height + dh));
|
|
3362
|
+
band.height = Math.max(band.height, round$1(c.y + c.height));
|
|
3363
|
+
}, 'resize-keys');
|
|
3364
|
+
}
|
|
3365
|
+
/** Tab order of a band: top to bottom, then left to right. */
|
|
3366
|
+
selectNext(step) {
|
|
3367
|
+
const all = this.report().bands.flatMap((b) => [...b.controls].sort((p, q) => p.y - q.y || p.x - q.x));
|
|
3368
|
+
if (!all.length)
|
|
3369
|
+
return;
|
|
3370
|
+
const sel = this.selection();
|
|
3371
|
+
const current = sel.kind === 'controls' ? all.findIndex((c) => c.id === sel.ids[sel.ids.length - 1]) : -1;
|
|
3372
|
+
const next = current < 0 ? (step > 0 ? 0 : all.length - 1) : (current + step + all.length) % all.length;
|
|
3373
|
+
this.selection.set({ kind: 'controls', ids: [all[next].id] });
|
|
3374
|
+
}
|
|
2791
3375
|
/** Draw order inside a band: later controls paint on top. */
|
|
2792
3376
|
arrange(to) {
|
|
2793
3377
|
const sel = this.selection();
|
|
@@ -2835,10 +3419,197 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2835
3419
|
type: Injectable
|
|
2836
3420
|
}] });
|
|
2837
3421
|
|
|
3422
|
+
const CATEGORIES = [
|
|
3423
|
+
{ id: 'logic', label: 'fnLogic' },
|
|
3424
|
+
{ id: 'text', label: 'fnText' },
|
|
3425
|
+
{ id: 'number', label: 'fnNumber' },
|
|
3426
|
+
{ id: 'date', label: 'fnDate' },
|
|
3427
|
+
{ id: 'aggregate', label: 'fnAggregate' },
|
|
3428
|
+
];
|
|
3429
|
+
/**
|
|
3430
|
+
* A sheet for writing a formula: fields, parameters and every function with a one-line
|
|
3431
|
+
* explanation, inserted at the cursor, and the result for the first data row as you type.
|
|
3432
|
+
*/
|
|
3433
|
+
class ExpressionEditorComponent {
|
|
3434
|
+
expression = input('');
|
|
3435
|
+
fields = input([]);
|
|
3436
|
+
strings = input.required();
|
|
3437
|
+
applied = output();
|
|
3438
|
+
closed = output();
|
|
3439
|
+
state = inject(DesignerState);
|
|
3440
|
+
config = inject(WE_REPORT_CONFIG);
|
|
3441
|
+
area = viewChild.required('area');
|
|
3442
|
+
categories = CATEGORIES;
|
|
3443
|
+
draft = signal('');
|
|
3444
|
+
category = signal('logic');
|
|
3445
|
+
parameters = computed(() => this.state.report().parameters ?? []);
|
|
3446
|
+
visibleFunctions = computed(() => EXPRESSION_FUNCTIONS.filter((f) => f.category === this.category()));
|
|
3447
|
+
/** What the formula gives for the first row, or why it cannot be evaluated. */
|
|
3448
|
+
result = computed(() => {
|
|
3449
|
+
const formula = this.draft().trim();
|
|
3450
|
+
if (!formula)
|
|
3451
|
+
return { text: this.strings().formulaEmpty, error: false };
|
|
3452
|
+
const report = this.state.report();
|
|
3453
|
+
const options = { locale: report.locale || this.config.locale || 'en-US', currency: report.currency || this.config.currency || 'USD' };
|
|
3454
|
+
const sample = this.state.sample();
|
|
3455
|
+
try {
|
|
3456
|
+
const value = evaluate(formula, { ...sample, params: resolveParameters(this.parameters()), ...options, now: new Date() });
|
|
3457
|
+
const text = typeof value === 'string' ? value : formatValue(value, undefined, options);
|
|
3458
|
+
return { text: text === '' ? this.strings().formulaEmpty : text, error: false };
|
|
3459
|
+
}
|
|
3460
|
+
catch (e) {
|
|
3461
|
+
return { text: e.message, error: true };
|
|
3462
|
+
}
|
|
3463
|
+
});
|
|
3464
|
+
ngAfterViewInit() {
|
|
3465
|
+
// The textarea owns its text (no [value] binding), so inserting never moves the caret.
|
|
3466
|
+
const el = this.area().nativeElement;
|
|
3467
|
+
el.value = this.expression();
|
|
3468
|
+
this.draft.set(el.value);
|
|
3469
|
+
queueMicrotask(() => el.focus());
|
|
3470
|
+
}
|
|
3471
|
+
/** Inserts at the caret (replacing a selection); `caretBack` moves the caret left afterwards. */
|
|
3472
|
+
insert(text, caretBack = 0) {
|
|
3473
|
+
const el = this.area().nativeElement;
|
|
3474
|
+
el.focus();
|
|
3475
|
+
el.setRangeText(text, el.selectionStart, el.selectionEnd, 'end');
|
|
3476
|
+
el.selectionStart = el.selectionEnd = el.selectionEnd - caretBack;
|
|
3477
|
+
this.draft.set(el.value);
|
|
3478
|
+
}
|
|
3479
|
+
/** Inserts `Name()` and puts the cursor between the brackets. */
|
|
3480
|
+
insertFunction(f) {
|
|
3481
|
+
this.insert(`${f.name}()`, 1);
|
|
3482
|
+
}
|
|
3483
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExpressionEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3484
|
+
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: `
|
|
3485
|
+
@let s = strings();
|
|
3486
|
+
<div class="xe__backdrop" (click)="closed.emit()"></div>
|
|
3487
|
+
<div class="xe" role="dialog" aria-modal="true" [attr.aria-label]="s.formulaEditor" (keydown.escape)="closed.emit()">
|
|
3488
|
+
<h2>{{ s.formulaEditor }}</h2>
|
|
3489
|
+
<p class="xe__hint">{{ s.formulaEditorHint }}</p>
|
|
3490
|
+
<textarea #area class="xe__formula" (input)="draft.set($any($event.target).value)" spellcheck="false" rows="3" [attr.aria-label]="s.expression"></textarea>
|
|
3491
|
+
<div class="xe__result" [class.xe__result--error]="result().error" aria-live="polite">
|
|
3492
|
+
<span>{{ s.formulaResult }}</span>
|
|
3493
|
+
<output>{{ result().text }}</output>
|
|
3494
|
+
</div>
|
|
3495
|
+
<div class="xe__lists">
|
|
3496
|
+
<section>
|
|
3497
|
+
<h3>{{ s.fields }}</h3>
|
|
3498
|
+
<ul>
|
|
3499
|
+
@for (f of fields(); track f.expression) {
|
|
3500
|
+
<li><button type="button" (click)="insert(f.expression)" [style.padding-left.px]="8 + f.depth * 12">{{ f.label }}</button></li>
|
|
3501
|
+
}
|
|
3502
|
+
@for (p of parameters(); track p.name) {
|
|
3503
|
+
<li><button type="button" (click)="insert('[?' + p.name + ']')">? {{ p.label || p.name }}</button></li>
|
|
3504
|
+
}
|
|
3505
|
+
</ul>
|
|
3506
|
+
</section>
|
|
3507
|
+
<section>
|
|
3508
|
+
<h3>{{ s.functions }}</h3>
|
|
3509
|
+
<div class="xe__cats" role="tablist">
|
|
3510
|
+
@for (c of categories; track c.id) {
|
|
3511
|
+
<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>
|
|
3512
|
+
}
|
|
3513
|
+
</div>
|
|
3514
|
+
<ul>
|
|
3515
|
+
@for (f of visibleFunctions(); track f.name) {
|
|
3516
|
+
<li>
|
|
3517
|
+
<button type="button" class="xe__fn" (click)="insertFunction(f)">
|
|
3518
|
+
<code>{{ f.signature }}</code>
|
|
3519
|
+
<small>{{ s.functionHelp[f.name] }}</small>
|
|
3520
|
+
</button>
|
|
3521
|
+
</li>
|
|
3522
|
+
}
|
|
3523
|
+
</ul>
|
|
3524
|
+
</section>
|
|
3525
|
+
</div>
|
|
3526
|
+
<div class="xe__actions">
|
|
3527
|
+
<button type="button" (click)="closed.emit()">{{ s.cancel }}</button>
|
|
3528
|
+
<button type="button" class="xe__primary" (click)="applied.emit(draft())">{{ s.apply }}</button>
|
|
3529
|
+
</div>
|
|
3530
|
+
</div>
|
|
3531
|
+
`, 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 });
|
|
3532
|
+
}
|
|
3533
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExpressionEditorComponent, decorators: [{
|
|
3534
|
+
type: Component,
|
|
3535
|
+
args: [{ selector: 'we-report-expression-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3536
|
+
@let s = strings();
|
|
3537
|
+
<div class="xe__backdrop" (click)="closed.emit()"></div>
|
|
3538
|
+
<div class="xe" role="dialog" aria-modal="true" [attr.aria-label]="s.formulaEditor" (keydown.escape)="closed.emit()">
|
|
3539
|
+
<h2>{{ s.formulaEditor }}</h2>
|
|
3540
|
+
<p class="xe__hint">{{ s.formulaEditorHint }}</p>
|
|
3541
|
+
<textarea #area class="xe__formula" (input)="draft.set($any($event.target).value)" spellcheck="false" rows="3" [attr.aria-label]="s.expression"></textarea>
|
|
3542
|
+
<div class="xe__result" [class.xe__result--error]="result().error" aria-live="polite">
|
|
3543
|
+
<span>{{ s.formulaResult }}</span>
|
|
3544
|
+
<output>{{ result().text }}</output>
|
|
3545
|
+
</div>
|
|
3546
|
+
<div class="xe__lists">
|
|
3547
|
+
<section>
|
|
3548
|
+
<h3>{{ s.fields }}</h3>
|
|
3549
|
+
<ul>
|
|
3550
|
+
@for (f of fields(); track f.expression) {
|
|
3551
|
+
<li><button type="button" (click)="insert(f.expression)" [style.padding-left.px]="8 + f.depth * 12">{{ f.label }}</button></li>
|
|
3552
|
+
}
|
|
3553
|
+
@for (p of parameters(); track p.name) {
|
|
3554
|
+
<li><button type="button" (click)="insert('[?' + p.name + ']')">? {{ p.label || p.name }}</button></li>
|
|
3555
|
+
}
|
|
3556
|
+
</ul>
|
|
3557
|
+
</section>
|
|
3558
|
+
<section>
|
|
3559
|
+
<h3>{{ s.functions }}</h3>
|
|
3560
|
+
<div class="xe__cats" role="tablist">
|
|
3561
|
+
@for (c of categories; track c.id) {
|
|
3562
|
+
<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>
|
|
3563
|
+
}
|
|
3564
|
+
</div>
|
|
3565
|
+
<ul>
|
|
3566
|
+
@for (f of visibleFunctions(); track f.name) {
|
|
3567
|
+
<li>
|
|
3568
|
+
<button type="button" class="xe__fn" (click)="insertFunction(f)">
|
|
3569
|
+
<code>{{ f.signature }}</code>
|
|
3570
|
+
<small>{{ s.functionHelp[f.name] }}</small>
|
|
3571
|
+
</button>
|
|
3572
|
+
</li>
|
|
3573
|
+
}
|
|
3574
|
+
</ul>
|
|
3575
|
+
</section>
|
|
3576
|
+
</div>
|
|
3577
|
+
<div class="xe__actions">
|
|
3578
|
+
<button type="button" (click)="closed.emit()">{{ s.cancel }}</button>
|
|
3579
|
+
<button type="button" class="xe__primary" (click)="applied.emit(draft())">{{ s.apply }}</button>
|
|
3580
|
+
</div>
|
|
3581
|
+
</div>
|
|
3582
|
+
`, 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"] }]
|
|
3583
|
+
}] });
|
|
3584
|
+
|
|
2838
3585
|
const DRAG_MIME = 'application/x-we-report';
|
|
2839
3586
|
const PX_PER_MM = 96 / 25.4;
|
|
2840
3587
|
const SNAP_DISTANCE_MM = 1.5;
|
|
2841
3588
|
const MIN_SIZE_MM = 1;
|
|
3589
|
+
/** Gaps from `p` to the nearest rect on each side that faces it (overlaps on the other axis). */
|
|
3590
|
+
function gapsAround(p, others, bandId, max = 60) {
|
|
3591
|
+
const gaps = [];
|
|
3592
|
+
const overlapY = (r) => Math.min(r.y + r.height, p.y + p.height) - Math.max(r.y, p.y);
|
|
3593
|
+
const overlapX = (r) => Math.min(r.x + r.width, p.x + p.width) - Math.max(r.x, p.x);
|
|
3594
|
+
const midY = (r) => (Math.max(r.y, p.y) + Math.min(r.y + r.height, p.y + p.height)) / 2;
|
|
3595
|
+
const midX = (r) => (Math.max(r.x, p.x) + Math.min(r.x + r.width, p.x + p.width)) / 2;
|
|
3596
|
+
const nearest = (items, dist) => items.reduce((best, r) => (dist(r) >= 0 && dist(r) <= max && (!best || dist(r) < dist(best)) ? r : best), null);
|
|
3597
|
+
const facingH = others.filter((r) => overlapY(r) > 0);
|
|
3598
|
+
const facingV = others.filter((r) => overlapX(r) > 0);
|
|
3599
|
+
const left = nearest(facingH, (r) => p.x - (r.x + r.width));
|
|
3600
|
+
const right = nearest(facingH, (r) => r.x - (p.x + p.width));
|
|
3601
|
+
const up = nearest(facingV, (r) => p.y - (r.y + r.height));
|
|
3602
|
+
const down = nearest(facingV, (r) => r.y - (p.y + p.height));
|
|
3603
|
+
if (left)
|
|
3604
|
+
gaps.push({ bandId, orientation: 'h', x: left.x + left.width, y: midY(left), length: p.x - left.x - left.width });
|
|
3605
|
+
if (right)
|
|
3606
|
+
gaps.push({ bandId, orientation: 'h', x: p.x + p.width, y: midY(right), length: right.x - p.x - p.width });
|
|
3607
|
+
if (up)
|
|
3608
|
+
gaps.push({ bandId, orientation: 'v', x: midX(up), y: up.y + up.height, length: p.y - up.y - up.height });
|
|
3609
|
+
if (down)
|
|
3610
|
+
gaps.push({ bandId, orientation: 'v', x: midX(down), y: p.y + p.height, length: down.y - p.y - p.height });
|
|
3611
|
+
return gaps.filter((g) => g.length > 0.05);
|
|
3612
|
+
}
|
|
2842
3613
|
/** The page, its bands and controls, with selection, drag, resize, snapping and drop targets. */
|
|
2843
3614
|
class DesignSurfaceComponent {
|
|
2844
3615
|
strings = input.required();
|
|
@@ -2847,12 +3618,33 @@ class DesignSurfaceComponent {
|
|
|
2847
3618
|
gridSize = input(1);
|
|
2848
3619
|
/** When set, bound text shows this data instead of its formula. */
|
|
2849
3620
|
sample = input(null);
|
|
3621
|
+
/** Fields for the formula editor opened by double-clicking a bound item. */
|
|
3622
|
+
fields = input([]);
|
|
2850
3623
|
state = inject(DesignerState);
|
|
2851
3624
|
config = inject(WE_REPORT_CONFIG);
|
|
2852
3625
|
dom = inject(DOCUMENT);
|
|
2853
3626
|
host = inject(ElementRef);
|
|
2854
3627
|
handles = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'];
|
|
2855
3628
|
guides = signal([]);
|
|
3629
|
+
gaps = signal([]);
|
|
3630
|
+
/** The rubber band while dragging on an empty part of a section (mm in that section). */
|
|
3631
|
+
marquee = signal(null);
|
|
3632
|
+
/** A bound item whose formula is open in the editor. */
|
|
3633
|
+
formulaEdit = signal(null);
|
|
3634
|
+
/** A key typed on a selected text: editing starts with it instead of the old text. */
|
|
3635
|
+
editSeed = signal(null);
|
|
3636
|
+
/** The text an in-place editor starts with. */
|
|
3637
|
+
editText = computed(() => {
|
|
3638
|
+
const e = this.state.editing();
|
|
3639
|
+
if (!e)
|
|
3640
|
+
return '';
|
|
3641
|
+
const seed = this.editSeed();
|
|
3642
|
+
if (seed !== null)
|
|
3643
|
+
return seed;
|
|
3644
|
+
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);
|
|
3645
|
+
const value = c?.type === 'text' ? c.text : c?.type === 'table' && e.row !== undefined && e.cell !== undefined ? c.rows[e.row]?.cells[e.cell]?.text : '';
|
|
3646
|
+
return typeof value === 'string' ? value : '';
|
|
3647
|
+
});
|
|
2856
3648
|
geometry = computed(() => resolvePageGeometry(this.state.report().page));
|
|
2857
3649
|
/** Top ruler in screen pixels: 0 at the left margin, a tick per millimetre, a label per centimetre. */
|
|
2858
3650
|
ruler = computed(() => {
|
|
@@ -3090,11 +3882,123 @@ class DesignSurfaceComponent {
|
|
|
3090
3882
|
selectBand(id) {
|
|
3091
3883
|
this.state.selection.set({ kind: 'band', id });
|
|
3092
3884
|
}
|
|
3093
|
-
|
|
3885
|
+
/** On an empty part of a section: starts a rubber-band selection (Shift/Ctrl add to the selection). */
|
|
3886
|
+
onBodyPointerDown(e, band) {
|
|
3094
3887
|
if (e.button !== 0)
|
|
3095
3888
|
return;
|
|
3096
3889
|
this.host.nativeElement.focus({ preventScroll: true });
|
|
3097
|
-
|
|
3890
|
+
const additive = e.shiftKey || e.ctrlKey || e.metaKey;
|
|
3891
|
+
const sel = this.state.selection();
|
|
3892
|
+
const base = additive && sel.kind === 'controls' ? sel.ids : [];
|
|
3893
|
+
if (!additive)
|
|
3894
|
+
this.state.selection.set({ kind: 'none' });
|
|
3895
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
3896
|
+
this.begin(e, { kind: 'marquee', bandId: band.id, originals: new Map(), baseIds: base, origin: { left: rect.left, top: rect.top } });
|
|
3897
|
+
}
|
|
3898
|
+
// ── Editing on the page ─────────────────────────────────────────────────────
|
|
3899
|
+
isEditing(controlId, row, cell) {
|
|
3900
|
+
const e = this.state.editing();
|
|
3901
|
+
return !!e && e.controlId === controlId && e.row === row && e.cell === cell;
|
|
3902
|
+
}
|
|
3903
|
+
/** Double-click / F2: fixed text is typed on the page, a formula opens the formula editor. */
|
|
3904
|
+
startEditing(c, row, cell, seed) {
|
|
3905
|
+
let value;
|
|
3906
|
+
if (c.type === 'text')
|
|
3907
|
+
value = c.text;
|
|
3908
|
+
else if (c.type === 'table') {
|
|
3909
|
+
const at = row ?? this.state.tableCell()?.row;
|
|
3910
|
+
const index = cell ?? this.state.tableCell()?.cell;
|
|
3911
|
+
if (at === undefined || index === undefined)
|
|
3912
|
+
return;
|
|
3913
|
+
row = at;
|
|
3914
|
+
cell = index;
|
|
3915
|
+
value = c.rows[row]?.cells[cell]?.text;
|
|
3916
|
+
}
|
|
3917
|
+
if (value === undefined)
|
|
3918
|
+
return;
|
|
3919
|
+
this.state.selection.set({ kind: 'controls', ids: [c.id] });
|
|
3920
|
+
if (isExpression(value)) {
|
|
3921
|
+
this.formulaEdit.set({ controlId: c.id, row, cell, expression: value.expression });
|
|
3922
|
+
return;
|
|
3923
|
+
}
|
|
3924
|
+
this.editSeed.set(seed ?? null);
|
|
3925
|
+
this.state.editing.set({ controlId: c.id, row, cell });
|
|
3926
|
+
// The editor exists after this change is rendered.
|
|
3927
|
+
setTimeout(() => {
|
|
3928
|
+
const editor = this.host.nativeElement.querySelector('.ds__editor');
|
|
3929
|
+
editor?.focus({ preventScroll: true });
|
|
3930
|
+
if (seed === undefined)
|
|
3931
|
+
editor?.select();
|
|
3932
|
+
else
|
|
3933
|
+
editor?.setSelectionRange(editor.value.length, editor.value.length);
|
|
3934
|
+
});
|
|
3935
|
+
}
|
|
3936
|
+
/** Enter or Escape pressed before the editor had focus: keep or drop what was typed. */
|
|
3937
|
+
finishEditing(keep) {
|
|
3938
|
+
const editing = this.state.editing();
|
|
3939
|
+
if (!editing)
|
|
3940
|
+
return;
|
|
3941
|
+
const editor = this.host.nativeElement.querySelector('.ds__editor');
|
|
3942
|
+
const text = editor?.value ?? this.editSeed() ?? '';
|
|
3943
|
+
this.state.editing.set(null);
|
|
3944
|
+
if (keep)
|
|
3945
|
+
this.setText(editing.controlId, editing.row, editing.cell, text);
|
|
3946
|
+
this.host.nativeElement.focus({ preventScroll: true });
|
|
3947
|
+
}
|
|
3948
|
+
/** Keys typed before the editor has focus (fast typists) are not lost. */
|
|
3949
|
+
appendToEdit(key) {
|
|
3950
|
+
if (this.editSeed() !== null)
|
|
3951
|
+
this.editSeed.update((s) => s + key);
|
|
3952
|
+
}
|
|
3953
|
+
/** Enter keeps the text, Shift+Enter starts a new line, Escape leaves it as it was. */
|
|
3954
|
+
onEditorKey(e) {
|
|
3955
|
+
e.stopPropagation();
|
|
3956
|
+
if (e.key === 'Escape') {
|
|
3957
|
+
e.preventDefault();
|
|
3958
|
+
this.state.editing.set(null);
|
|
3959
|
+
this.host.nativeElement.focus({ preventScroll: true });
|
|
3960
|
+
}
|
|
3961
|
+
else if (e.key === 'Enter' && !e.shiftKey) {
|
|
3962
|
+
e.preventDefault();
|
|
3963
|
+
e.target.blur();
|
|
3964
|
+
}
|
|
3965
|
+
}
|
|
3966
|
+
commitEditing(e) {
|
|
3967
|
+
const editing = this.state.editing();
|
|
3968
|
+
if (!editing)
|
|
3969
|
+
return;
|
|
3970
|
+
const text = e.target.value;
|
|
3971
|
+
this.state.editing.set(null);
|
|
3972
|
+
this.setText(editing.controlId, editing.row, editing.cell, text);
|
|
3973
|
+
this.host.nativeElement.focus({ preventScroll: true });
|
|
3974
|
+
}
|
|
3975
|
+
applyFormula(expression) {
|
|
3976
|
+
const f = this.formulaEdit();
|
|
3977
|
+
this.formulaEdit.set(null);
|
|
3978
|
+
if (f)
|
|
3979
|
+
this.setText(f.controlId, f.row, f.cell, { expression });
|
|
3980
|
+
}
|
|
3981
|
+
setText(controlId, row, cell, text) {
|
|
3982
|
+
const c = this.state.report().bands.flatMap((b) => b.controls).find((x) => x.id === controlId);
|
|
3983
|
+
const current = c?.type === 'text' ? c.text : c?.type === 'table' && row !== undefined && cell !== undefined ? c.rows[row]?.cells[cell]?.text : undefined;
|
|
3984
|
+
// Leaving the editor without a change adds no undo step.
|
|
3985
|
+
if (JSON.stringify(current) === JSON.stringify(text))
|
|
3986
|
+
return;
|
|
3987
|
+
this.state.updateControls([controlId], (c) => {
|
|
3988
|
+
if (c.type === 'text')
|
|
3989
|
+
c.text = text;
|
|
3990
|
+
else if (c.type === 'table' && row !== undefined && cell !== undefined && c.rows[row]?.cells[cell])
|
|
3991
|
+
c.rows[row].cells[cell].text = text;
|
|
3992
|
+
});
|
|
3993
|
+
}
|
|
3994
|
+
/** Pointer position in mm inside the section under it, for the status bar. */
|
|
3995
|
+
trackPointer(e) {
|
|
3996
|
+
const body = e.target.closest('[data-band-id]');
|
|
3997
|
+
if (!body)
|
|
3998
|
+
return this.state.pointer.set(null);
|
|
3999
|
+
const r = body.getBoundingClientRect();
|
|
4000
|
+
const scale = PX_PER_MM * this.zoom();
|
|
4001
|
+
this.state.pointer.set({ bandId: body.dataset['bandId'], x: round((e.clientX - r.left) / scale), y: round((e.clientY - r.top) / scale) });
|
|
3098
4002
|
}
|
|
3099
4003
|
// ── Drag: move / resize / band height ───────────────────────────────────────
|
|
3100
4004
|
onControlPointerDown(e, c, band) {
|
|
@@ -3102,12 +4006,25 @@ class DesignSurfaceComponent {
|
|
|
3102
4006
|
return;
|
|
3103
4007
|
e.stopPropagation();
|
|
3104
4008
|
e.preventDefault();
|
|
4009
|
+
const look = this.state.painter();
|
|
4010
|
+
if (look) {
|
|
4011
|
+
this.state.painter.set(null);
|
|
4012
|
+
this.state.updateControls([c.id], (x) => {
|
|
4013
|
+
x.style = look.style;
|
|
4014
|
+
x.styleOverrides = structuredClone(look.styleOverrides);
|
|
4015
|
+
});
|
|
4016
|
+
this.state.selection.set({ kind: 'controls', ids: [c.id] });
|
|
4017
|
+
return;
|
|
4018
|
+
}
|
|
3105
4019
|
const additive = e.shiftKey || e.ctrlKey || e.metaKey;
|
|
3106
|
-
this.state.
|
|
4020
|
+
const sel = this.state.selection();
|
|
4021
|
+
const toggleOnClick = (e.ctrlKey || e.metaKey) && sel.kind === 'controls' && sel.ids.includes(c.id);
|
|
4022
|
+
if (!toggleOnClick)
|
|
4023
|
+
this.state.select(c.id, additive);
|
|
3107
4024
|
const ids = this.state.selection().kind === 'controls' ? this.state.selection().ids : [];
|
|
3108
4025
|
if (!ids.includes(c.id))
|
|
3109
4026
|
return;
|
|
3110
|
-
this.begin(e, { kind: 'move', bandId: band.id, primaryId: c.id, originals: this.rectsOf(ids), additive });
|
|
4027
|
+
this.begin(e, { kind: 'move', bandId: band.id, primaryId: c.id, originals: this.rectsOf(ids), additive, toggleOnClick });
|
|
3111
4028
|
}
|
|
3112
4029
|
onHandlePointerDown(e, c, band, handle) {
|
|
3113
4030
|
if (e.button !== 0)
|
|
@@ -3156,6 +4073,23 @@ class DesignSurfaceComponent {
|
|
|
3156
4073
|
return;
|
|
3157
4074
|
op.moved = true;
|
|
3158
4075
|
const snap = !e.altKey;
|
|
4076
|
+
if (op.kind === 'marquee') {
|
|
4077
|
+
const o = op.origin;
|
|
4078
|
+
const x1 = (op.startX - o.left) / scale;
|
|
4079
|
+
const y1 = (op.startY - o.top) / scale;
|
|
4080
|
+
const x2 = (e.clientX - o.left) / scale;
|
|
4081
|
+
const y2 = (e.clientY - o.top) / scale;
|
|
4082
|
+
const box = { x: Math.min(x1, x2), y: Math.min(y1, y2), width: Math.abs(x2 - x1), height: Math.abs(y2 - y1) };
|
|
4083
|
+
this.marquee.set({ bandId: op.bandId, ...box });
|
|
4084
|
+
// Everything the band touches is selected, as in desktop designers.
|
|
4085
|
+
const band = this.state.report().bands.find((b) => b.id === op.bandId);
|
|
4086
|
+
const hit = (band?.controls ?? [])
|
|
4087
|
+
.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)
|
|
4088
|
+
.map((c) => c.id);
|
|
4089
|
+
const ids = [...new Set([...(op.baseIds ?? []), ...hit])];
|
|
4090
|
+
this.state.selection.set(ids.length ? { kind: 'controls', ids } : op.baseIds?.length ? { kind: 'controls', ids: op.baseIds } : { kind: 'none' });
|
|
4091
|
+
return;
|
|
4092
|
+
}
|
|
3159
4093
|
if (op.kind === 'band') {
|
|
3160
4094
|
const band = this.state.report().bands.find((b) => b.id === op.bandId);
|
|
3161
4095
|
const minHeight = Math.max(2, ...(band?.controls.map((c) => c.y + c.height) ?? [0]));
|
|
@@ -3183,6 +4117,8 @@ class DesignSurfaceComponent {
|
|
|
3183
4117
|
c.x = round(Math.max(0, o.x + mx));
|
|
3184
4118
|
c.y = round(Math.max(0, o.y + my));
|
|
3185
4119
|
}, op.key);
|
|
4120
|
+
const moved = { ...primary, x: Math.max(0, primary.x + mx), y: Math.max(0, primary.y + my) };
|
|
4121
|
+
this.gaps.set(op.originals.size === 1 ? gapsAround(moved, others, op.bandId) : []);
|
|
3186
4122
|
}
|
|
3187
4123
|
else {
|
|
3188
4124
|
const h = op.handle;
|
|
@@ -3215,6 +4151,31 @@ class DesignSurfaceComponent {
|
|
|
3215
4151
|
this.op = null;
|
|
3216
4152
|
this.stopListening();
|
|
3217
4153
|
this.guides.set([]);
|
|
4154
|
+
this.gaps.set([]);
|
|
4155
|
+
if (op?.kind === 'marquee') {
|
|
4156
|
+
// A plain click on an empty part selects the section.
|
|
4157
|
+
if (!op.moved && !op.baseIds?.length)
|
|
4158
|
+
this.state.selection.set({ kind: 'band', id: op.bandId });
|
|
4159
|
+
this.marquee.set(null);
|
|
4160
|
+
return;
|
|
4161
|
+
}
|
|
4162
|
+
if (op?.kind === 'move' && !op.moved && op.toggleOnClick) {
|
|
4163
|
+
this.state.select(op.primaryId, true);
|
|
4164
|
+
return;
|
|
4165
|
+
}
|
|
4166
|
+
// Ctrl+drag copies: the originals stay where they were, the dragged items are the copies.
|
|
4167
|
+
if (op?.kind === 'move' && op.moved && (e.ctrlKey || e.metaKey)) {
|
|
4168
|
+
this.state.update((d) => {
|
|
4169
|
+
const taken = new Set();
|
|
4170
|
+
// The selection can span sections: each section keeps copies of its own items.
|
|
4171
|
+
for (const band of d.bands) {
|
|
4172
|
+
const copies = band.controls
|
|
4173
|
+
.filter((c) => op.originals.has(c.id))
|
|
4174
|
+
.map((c) => ({ ...structuredClone(c), id: this.state.newId(c.type, taken), ...op.originals.get(c.id) }));
|
|
4175
|
+
band.controls.unshift(...copies);
|
|
4176
|
+
}
|
|
4177
|
+
}, op.key);
|
|
4178
|
+
}
|
|
3218
4179
|
// A click (no drag) inside a multi-selection narrows it to the clicked control.
|
|
3219
4180
|
if (op?.kind === 'move' && !op.moved && !op.additive && op.originals.size > 1) {
|
|
3220
4181
|
this.state.selection.set({ kind: 'controls', ids: [op.primaryId] });
|
|
@@ -3293,13 +4254,22 @@ class DesignSurfaceComponent {
|
|
|
3293
4254
|
}
|
|
3294
4255
|
// ── Drop from toolbox / field list ──────────────────────────────────────────
|
|
3295
4256
|
onDragOver(e) {
|
|
3296
|
-
if (e.dataTransfer?.types.includes(DRAG_MIME)) {
|
|
4257
|
+
if (e.dataTransfer?.types.includes(DRAG_MIME) || e.dataTransfer?.types.includes('Files')) {
|
|
3297
4258
|
e.preventDefault();
|
|
3298
4259
|
e.dataTransfer.dropEffect = 'copy';
|
|
3299
4260
|
}
|
|
3300
4261
|
}
|
|
3301
4262
|
onDrop(e, band) {
|
|
3302
4263
|
const raw = e.dataTransfer?.getData(DRAG_MIME);
|
|
4264
|
+
const file = e.dataTransfer?.files?.[0];
|
|
4265
|
+
if (!raw && file && /^image\/(png|jpeg)$/.test(file.type)) {
|
|
4266
|
+
// A picture dragged in from the desktop becomes an image item where it is dropped.
|
|
4267
|
+
e.preventDefault();
|
|
4268
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
4269
|
+
const scale = PX_PER_MM * this.zoom();
|
|
4270
|
+
void this.readFile(file).then((src) => this.addImage(band, (e.clientX - rect.left) / scale, (e.clientY - rect.top) / scale, src));
|
|
4271
|
+
return;
|
|
4272
|
+
}
|
|
3303
4273
|
if (!raw)
|
|
3304
4274
|
return;
|
|
3305
4275
|
e.preventDefault();
|
|
@@ -3337,6 +4307,39 @@ class DesignSurfaceComponent {
|
|
|
3337
4307
|
const type = { column: s.chartColumn, bar: s.chartBar, line: s.chartLine, pie: s.chartPie, doughnut: s.chartDoughnut }[c.chartType];
|
|
3338
4308
|
return c.category.expression ? `${type}: ${c.value.expression} / ${c.category.expression}` : type;
|
|
3339
4309
|
}
|
|
4310
|
+
readFile(file) {
|
|
4311
|
+
return new Promise((resolve, reject) => {
|
|
4312
|
+
const reader = new FileReader();
|
|
4313
|
+
reader.onload = () => resolve(reader.result);
|
|
4314
|
+
reader.onerror = () => reject(reader.error);
|
|
4315
|
+
reader.readAsDataURL(file);
|
|
4316
|
+
});
|
|
4317
|
+
}
|
|
4318
|
+
/** A picture at (x, y) mm, at its natural size up to 80 mm wide (PNG/JPEG data URI). */
|
|
4319
|
+
addImage(band, x, y, src) {
|
|
4320
|
+
const info = readImage(src);
|
|
4321
|
+
if (!info)
|
|
4322
|
+
return;
|
|
4323
|
+
const pxToMm = 25.4 / 96;
|
|
4324
|
+
const scale = Math.min(1, 80 / (info.width * pxToMm));
|
|
4325
|
+
const width = round(Math.max(5, info.width * pxToMm * scale));
|
|
4326
|
+
const height = round(Math.max(5, info.height * pxToMm * scale));
|
|
4327
|
+
const pageWidth = this.geometry().contentWidth;
|
|
4328
|
+
const control = {
|
|
4329
|
+
id: this.state.newId('image'), type: 'image', fit: 'contain', source: src, width, height,
|
|
4330
|
+
x: round(Math.max(0, Math.min(x, pageWidth - width))), y: round(Math.max(0, y)),
|
|
4331
|
+
};
|
|
4332
|
+
this.growBand(band, [control]);
|
|
4333
|
+
}
|
|
4334
|
+
/** Text pasted from elsewhere becomes a text item, tall enough for its lines. */
|
|
4335
|
+
addText(band, x, y, text) {
|
|
4336
|
+
const lines = text.split(/\r?\n/).length;
|
|
4337
|
+
const control = {
|
|
4338
|
+
id: this.state.newId('text'), type: 'text', text, x: round(Math.max(0, x)), y: round(Math.max(0, y)),
|
|
4339
|
+
width: Math.min(120, this.geometry().contentWidth), height: round(Math.min(60, 5 * lines + 1)), canGrow: lines > 1 || undefined,
|
|
4340
|
+
};
|
|
4341
|
+
this.growBand(band, [control]);
|
|
4342
|
+
}
|
|
3340
4343
|
/** Creates controls for a drop at (x, y) mm inside `band`. */
|
|
3341
4344
|
dropAt(data, band, x, y) {
|
|
3342
4345
|
const width = this.geometry().contentWidth;
|
|
@@ -3359,6 +4362,18 @@ class DesignSurfaceComponent {
|
|
|
3359
4362
|
this.growBand(band, [control]);
|
|
3360
4363
|
return;
|
|
3361
4364
|
}
|
|
4365
|
+
// A field dropped on a text shows that field there instead (desktop designers bind on drop).
|
|
4366
|
+
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);
|
|
4367
|
+
if (text) {
|
|
4368
|
+
this.state.updateControls([text.id], (c) => {
|
|
4369
|
+
if (c.type !== 'text')
|
|
4370
|
+
return;
|
|
4371
|
+
c.text = { expression: fieldExpression(data.path, data.parent) };
|
|
4372
|
+
c.format = data.format;
|
|
4373
|
+
});
|
|
4374
|
+
this.state.selection.set({ kind: 'controls', ids: [text.id] });
|
|
4375
|
+
return;
|
|
4376
|
+
}
|
|
3362
4377
|
// A field dropped on a table cell fills that cell.
|
|
3363
4378
|
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
4379
|
if (table?.type === 'table') {
|
|
@@ -3411,7 +4426,7 @@ class DesignSurfaceComponent {
|
|
|
3411
4426
|
this.state.selection.set({ kind: 'controls', ids: controls.map((c) => c.id) });
|
|
3412
4427
|
}
|
|
3413
4428
|
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: `
|
|
4429
|
+
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
4430
|
@let r = ruler();
|
|
3416
4431
|
<svg class="ds__ruler" aria-hidden="true" [attr.width]="r.width" height="20" [attr.viewBox]="'0 0 ' + r.width + ' 20'">
|
|
3417
4432
|
<rect class="ds__ruler-margin" x="0" y="0" [attr.width]="r.left" height="20" />
|
|
@@ -3424,7 +4439,7 @@ class DesignSurfaceComponent {
|
|
|
3424
4439
|
<text [attr.x]="l.x + 2" y="9">{{ l.text }}</text>
|
|
3425
4440
|
}
|
|
3426
4441
|
</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()">
|
|
4442
|
+
<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
4443
|
@if (watermarkText(); as wm) {
|
|
3429
4444
|
<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
4445
|
}
|
|
@@ -3439,7 +4454,8 @@ class DesignSurfaceComponent {
|
|
|
3439
4454
|
[style.height.mm]="band.height * zoom()"
|
|
3440
4455
|
[style.background-color]="band.backgroundColor ?? null"
|
|
3441
4456
|
[style.background-size.mm]="gridSize() * zoom()"
|
|
3442
|
-
|
|
4457
|
+
[style.background-image]="gridSize() ? null : 'none'"
|
|
4458
|
+
(pointerdown)="onBodyPointerDown($event, band)"
|
|
3443
4459
|
(dragover)="onDragOver($event)"
|
|
3444
4460
|
(drop)="onDrop($event, band)"
|
|
3445
4461
|
>
|
|
@@ -3454,6 +4470,7 @@ class DesignSurfaceComponent {
|
|
|
3454
4470
|
[style.width.mm]="c.width * zoom()"
|
|
3455
4471
|
[style.height.mm]="c.height * zoom()"
|
|
3456
4472
|
(pointerdown)="onControlPointerDown($event, c, band)"
|
|
4473
|
+
(dblclick)="startEditing(c)"
|
|
3457
4474
|
>
|
|
3458
4475
|
@switch (c.type) {
|
|
3459
4476
|
@case ('line') {
|
|
@@ -3496,7 +4513,14 @@ class DesignSurfaceComponent {
|
|
|
3496
4513
|
[style.width.mm]="cell.width * zoom()"
|
|
3497
4514
|
[style.height.mm]="cell.height * zoom()"
|
|
3498
4515
|
(click)="selectCell(c.id, cell.row, cell.index)"
|
|
3499
|
-
|
|
4516
|
+
(dblclick)="$event.stopPropagation(); startEditing(c, cell.row, cell.index)"
|
|
4517
|
+
>
|
|
4518
|
+
@if (isEditing(c.id, cell.row, cell.index)) {
|
|
4519
|
+
<textarea class="ds__editor" [value]="editText()" [style]="cell.style" (pointerdown)="$event.stopPropagation()" (keydown)="onEditorKey($event)" (blur)="commitEditing($event)" [attr.aria-label]="strings().content"></textarea>
|
|
4520
|
+
} @else {
|
|
4521
|
+
{{ cell.text }}
|
|
4522
|
+
}
|
|
4523
|
+
</div>
|
|
3500
4524
|
}
|
|
3501
4525
|
}
|
|
3502
4526
|
@case ('chart') {
|
|
@@ -3509,7 +4533,11 @@ class DesignSurfaceComponent {
|
|
|
3509
4533
|
<div class="ds__placeholder" [innerHTML]="'checkbox' | weReportIcon"></div>
|
|
3510
4534
|
}
|
|
3511
4535
|
@default {
|
|
3512
|
-
|
|
4536
|
+
@if (isEditing(c.id)) {
|
|
4537
|
+
<textarea class="ds__editor" [value]="editText()" [style]="textStyle(c)" (pointerdown)="$event.stopPropagation()" (keydown)="onEditorKey($event)" (blur)="commitEditing($event)" [attr.aria-label]="strings().content"></textarea>
|
|
4538
|
+
} @else {
|
|
4539
|
+
<div class="ds__text" [class.ds__text--bound]="isBound(c)" [style]="textStyle(c)" [attr.title]="isBound(c) ? boundExpression(c) : null">{{ caption(c, band) }}</div>
|
|
4540
|
+
}
|
|
3513
4541
|
}
|
|
3514
4542
|
}
|
|
3515
4543
|
@if (isOnlySelected(c.id)) {
|
|
@@ -3519,6 +4547,11 @@ class DesignSurfaceComponent {
|
|
|
3519
4547
|
}
|
|
3520
4548
|
</div>
|
|
3521
4549
|
}
|
|
4550
|
+
@if (marquee(); as m) {
|
|
4551
|
+
@if (m.bandId === band.id) {
|
|
4552
|
+
<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>
|
|
4553
|
+
}
|
|
4554
|
+
}
|
|
3522
4555
|
@if (columnShade(band); as shade) {
|
|
3523
4556
|
<div class="ds__columns" [style.left.mm]="shade.left * zoom()" aria-hidden="true">
|
|
3524
4557
|
<span>{{ strings().repeatsAcross.replace('{0}', '' + shade.count) }}</span>
|
|
@@ -3527,16 +4560,33 @@ class DesignSurfaceComponent {
|
|
|
3527
4560
|
@for (g of guidesFor(band.id); track $index) {
|
|
3528
4561
|
<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
4562
|
}
|
|
4563
|
+
@for (g of gaps(); track $index) {
|
|
4564
|
+
@if (g.bandId === band.id) {
|
|
4565
|
+
<div
|
|
4566
|
+
class="ds__gap"
|
|
4567
|
+
[class.ds__gap--v]="g.orientation === 'v'"
|
|
4568
|
+
[style.left.mm]="g.x * zoom()"
|
|
4569
|
+
[style.top.mm]="g.y * zoom()"
|
|
4570
|
+
[style.width.mm]="g.orientation === 'h' ? g.length * zoom() : null"
|
|
4571
|
+
[style.height.mm]="g.orientation === 'v' ? g.length * zoom() : null"
|
|
4572
|
+
>
|
|
4573
|
+
<span>{{ g.length.toFixed(1) }}</span>
|
|
4574
|
+
</div>
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
3530
4577
|
</div>
|
|
3531
4578
|
<div class="ds__band-resize" (pointerdown)="onBandResizePointerDown($event, band)" [title]="strings().bandHeight"></div>
|
|
3532
4579
|
</div>
|
|
3533
4580
|
}
|
|
3534
4581
|
</div>
|
|
3535
|
-
|
|
4582
|
+
@if (formulaEdit(); as f) {
|
|
4583
|
+
<we-report-expression-editor [expression]="f.expression" [fields]="fields()" [strings]="strings()" (applied)="applyFormula($event)" (closed)="formulaEdit.set(null)" />
|
|
4584
|
+
}
|
|
4585
|
+
`, 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-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__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
4586
|
}
|
|
3537
4587
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignSurfaceComponent, decorators: [{
|
|
3538
4588
|
type: Component,
|
|
3539
|
-
args: [{ selector: 'we-report-design-surface', standalone: true, imports: [WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { tabindex: '0' }, template: `
|
|
4589
|
+
args: [{ selector: 'we-report-design-surface', standalone: true, imports: [WeReportIconPipe, ExpressionEditorComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: { tabindex: '0', '[class.ds--painting]': '!!state.painter()' }, template: `
|
|
3540
4590
|
@let r = ruler();
|
|
3541
4591
|
<svg class="ds__ruler" aria-hidden="true" [attr.width]="r.width" height="20" [attr.viewBox]="'0 0 ' + r.width + ' 20'">
|
|
3542
4592
|
<rect class="ds__ruler-margin" x="0" y="0" [attr.width]="r.left" height="20" />
|
|
@@ -3549,7 +4599,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3549
4599
|
<text [attr.x]="l.x + 2" y="9">{{ l.text }}</text>
|
|
3550
4600
|
}
|
|
3551
4601
|
</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()">
|
|
4602
|
+
<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
4603
|
@if (watermarkText(); as wm) {
|
|
3554
4604
|
<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
4605
|
}
|
|
@@ -3564,7 +4614,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3564
4614
|
[style.height.mm]="band.height * zoom()"
|
|
3565
4615
|
[style.background-color]="band.backgroundColor ?? null"
|
|
3566
4616
|
[style.background-size.mm]="gridSize() * zoom()"
|
|
3567
|
-
|
|
4617
|
+
[style.background-image]="gridSize() ? null : 'none'"
|
|
4618
|
+
(pointerdown)="onBodyPointerDown($event, band)"
|
|
3568
4619
|
(dragover)="onDragOver($event)"
|
|
3569
4620
|
(drop)="onDrop($event, band)"
|
|
3570
4621
|
>
|
|
@@ -3579,6 +4630,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3579
4630
|
[style.width.mm]="c.width * zoom()"
|
|
3580
4631
|
[style.height.mm]="c.height * zoom()"
|
|
3581
4632
|
(pointerdown)="onControlPointerDown($event, c, band)"
|
|
4633
|
+
(dblclick)="startEditing(c)"
|
|
3582
4634
|
>
|
|
3583
4635
|
@switch (c.type) {
|
|
3584
4636
|
@case ('line') {
|
|
@@ -3621,261 +4673,131 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3621
4673
|
[style.width.mm]="cell.width * zoom()"
|
|
3622
4674
|
[style.height.mm]="cell.height * zoom()"
|
|
3623
4675
|
(click)="selectCell(c.id, cell.row, cell.index)"
|
|
3624
|
-
|
|
4676
|
+
(dblclick)="$event.stopPropagation(); startEditing(c, cell.row, cell.index)"
|
|
4677
|
+
>
|
|
4678
|
+
@if (isEditing(c.id, cell.row, cell.index)) {
|
|
4679
|
+
<textarea class="ds__editor" [value]="editText()" [style]="cell.style" (pointerdown)="$event.stopPropagation()" (keydown)="onEditorKey($event)" (blur)="commitEditing($event)" [attr.aria-label]="strings().content"></textarea>
|
|
4680
|
+
} @else {
|
|
4681
|
+
{{ cell.text }}
|
|
4682
|
+
}
|
|
4683
|
+
</div>
|
|
3625
4684
|
}
|
|
3626
4685
|
}
|
|
3627
4686
|
@case ('chart') {
|
|
3628
4687
|
<div class="ds__placeholder ds__chart">
|
|
3629
4688
|
<span [innerHTML]="'chart' | weReportIcon"></span>
|
|
3630
|
-
<small>{{ chartLabel(c) }}</small>
|
|
3631
|
-
</div>
|
|
3632
|
-
}
|
|
3633
|
-
@case ('checkbox') {
|
|
3634
|
-
<div class="ds__placeholder" [innerHTML]="'checkbox' | weReportIcon"></div>
|
|
3635
|
-
}
|
|
3636
|
-
@default {
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
</div>
|
|
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>
|
|
4689
|
+
<small>{{ chartLabel(c) }}</small>
|
|
4690
|
+
</div>
|
|
4691
|
+
}
|
|
4692
|
+
@case ('checkbox') {
|
|
4693
|
+
<div class="ds__placeholder" [innerHTML]="'checkbox' | weReportIcon"></div>
|
|
4694
|
+
}
|
|
4695
|
+
@default {
|
|
4696
|
+
@if (isEditing(c.id)) {
|
|
4697
|
+
<textarea class="ds__editor" [value]="editText()" [style]="textStyle(c)" (pointerdown)="$event.stopPropagation()" (keydown)="onEditorKey($event)" (blur)="commitEditing($event)" [attr.aria-label]="strings().content"></textarea>
|
|
4698
|
+
} @else {
|
|
4699
|
+
<div class="ds__text" [class.ds__text--bound]="isBound(c)" [style]="textStyle(c)" [attr.title]="isBound(c) ? boundExpression(c) : null">{{ caption(c, band) }}</div>
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4703
|
+
@if (isOnlySelected(c.id)) {
|
|
4704
|
+
@for (h of handles; track h) {
|
|
4705
|
+
<span class="ds__handle" [attr.data-handle]="h" (pointerdown)="onHandlePointerDown($event, c, band, h)"></span>
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4708
|
+
</div>
|
|
3807
4709
|
}
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
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>
|
|
4710
|
+
@if (marquee(); as m) {
|
|
4711
|
+
@if (m.bandId === band.id) {
|
|
4712
|
+
<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>
|
|
4713
|
+
}
|
|
3817
4714
|
}
|
|
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>
|
|
4715
|
+
@if (columnShade(band); as shade) {
|
|
4716
|
+
<div class="ds__columns" [style.left.mm]="shade.left * zoom()" aria-hidden="true">
|
|
4717
|
+
<span>{{ strings().repeatsAcross.replace('{0}', '' + shade.count) }}</span>
|
|
4718
|
+
</div>
|
|
3847
4719
|
}
|
|
3848
|
-
@for (
|
|
3849
|
-
<
|
|
4720
|
+
@for (g of guidesFor(band.id); track $index) {
|
|
4721
|
+
<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
4722
|
}
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
4723
|
+
@for (g of gaps(); track $index) {
|
|
4724
|
+
@if (g.bandId === band.id) {
|
|
4725
|
+
<div
|
|
4726
|
+
class="ds__gap"
|
|
4727
|
+
[class.ds__gap--v]="g.orientation === 'v'"
|
|
4728
|
+
[style.left.mm]="g.x * zoom()"
|
|
4729
|
+
[style.top.mm]="g.y * zoom()"
|
|
4730
|
+
[style.width.mm]="g.orientation === 'h' ? g.length * zoom() : null"
|
|
4731
|
+
[style.height.mm]="g.orientation === 'v' ? g.length * zoom() : null"
|
|
4732
|
+
>
|
|
4733
|
+
<span>{{ g.length.toFixed(1) }}</span>
|
|
4734
|
+
</div>
|
|
4735
|
+
}
|
|
3858
4736
|
}
|
|
3859
4737
|
</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>
|
|
4738
|
+
<div class="ds__band-resize" (pointerdown)="onBandResizePointerDown($event, band)" [title]="strings().bandHeight"></div>
|
|
4739
|
+
</div>
|
|
4740
|
+
}
|
|
3876
4741
|
</div>
|
|
3877
|
-
|
|
4742
|
+
@if (formulaEdit(); as f) {
|
|
4743
|
+
<we-report-expression-editor [expression]="f.expression" [fields]="fields()" [strings]="strings()" (applied)="applyFormula($event)" (closed)="formulaEdit.set(null)" />
|
|
4744
|
+
}
|
|
4745
|
+
`, 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}:host(.ds--painting) .ds__control{cursor:copy}.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
4746
|
}] });
|
|
4747
|
+
function round(v) {
|
|
4748
|
+
return Math.round(v * 100) / 100;
|
|
4749
|
+
}
|
|
4750
|
+
|
|
4751
|
+
function flatten(fields, parent, prefix = '', depth = 0, skip) {
|
|
4752
|
+
const out = [];
|
|
4753
|
+
for (const f of fields) {
|
|
4754
|
+
const path = prefix ? `${prefix}.${f.name}` : f.name;
|
|
4755
|
+
// The row list itself is not a field of the parent; its columns are the row fields.
|
|
4756
|
+
if (skip && path === skip)
|
|
4757
|
+
continue;
|
|
4758
|
+
if (f.type === 'object' && f.fields) {
|
|
4759
|
+
out.push({ path, label: f.name, type: f.type, parent, expression: fieldExpression(path, parent), depth });
|
|
4760
|
+
out.push(...flatten(f.fields, parent, path, depth + 1, skip));
|
|
4761
|
+
}
|
|
4762
|
+
else if (f.type !== 'array') {
|
|
4763
|
+
out.push({ path, label: f.name, type: f.type, parent, expression: fieldExpression(path, parent), depth });
|
|
4764
|
+
}
|
|
4765
|
+
}
|
|
4766
|
+
return out;
|
|
4767
|
+
}
|
|
4768
|
+
/** Paths of the lists of objects inside a row, e.g. `orders` or `customer.addresses`. */
|
|
4769
|
+
function listPaths(fields, prefix = '') {
|
|
4770
|
+
return fields.flatMap((f) => {
|
|
4771
|
+
const path = prefix ? `${prefix}.${f.name}` : f.name;
|
|
4772
|
+
if (f.type === 'array' && f.fields?.length)
|
|
4773
|
+
return [{ path, fields: f.fields }];
|
|
4774
|
+
return f.type === 'object' && f.fields ? listPaths(f.fields, path) : [];
|
|
4775
|
+
});
|
|
4776
|
+
}
|
|
4777
|
+
/**
|
|
4778
|
+
* Row fields, fields of the object holding the rows (when the rows are a nested list), the lists
|
|
4779
|
+
* inside a row (for an inner list) and the fields of the inner list's items.
|
|
4780
|
+
*/
|
|
4781
|
+
function designerFields(report, data) {
|
|
4782
|
+
let resolved;
|
|
4783
|
+
try {
|
|
4784
|
+
resolved = resolveReportData(report, data);
|
|
4785
|
+
}
|
|
4786
|
+
catch {
|
|
4787
|
+
return { rows: [], parent: [], lists: [], inner: [] };
|
|
4788
|
+
}
|
|
4789
|
+
const schema = inferSchema(resolved.rows ?? []);
|
|
4790
|
+
const rows = flatten(schema, false);
|
|
4791
|
+
const lists = listPaths(schema);
|
|
4792
|
+
const innerPath = report.bands.find((b) => b.kind === 'subDetail')?.rowsPath;
|
|
4793
|
+
const inner = flatten(lists.find((l) => l.path === innerPath)?.fields ?? [], false);
|
|
4794
|
+
const parentValue = resolved.parent;
|
|
4795
|
+
const listName = report.dataMember?.path?.split('.').pop();
|
|
4796
|
+
const parent = parentValue && typeof parentValue === 'object' && !Array.isArray(parentValue)
|
|
4797
|
+
? flatten(inferSchema([parentValue]), true, '', 0, listName)
|
|
4798
|
+
: [];
|
|
4799
|
+
return { rows, parent, lists: lists.map((l) => l.path), inner };
|
|
4800
|
+
}
|
|
3879
4801
|
|
|
3880
4802
|
/**
|
|
3881
4803
|
* Edits a value that is either fixed or comes from data: "Fixed text" with a text box, or
|
|
@@ -4280,6 +5202,18 @@ class PropertyPanelComponent {
|
|
|
4280
5202
|
this.state.update((d) => applyLabelSheet(d, sheet));
|
|
4281
5203
|
this.state.selection.set({ kind: 'band', id: this.state.report().bands[0].id });
|
|
4282
5204
|
}
|
|
5205
|
+
fieldExpressions = computed(() => new Set(this.fields().map((f) => f.expression)));
|
|
5206
|
+
/** The detail's first sort key; further keys (set in the file) are kept. */
|
|
5207
|
+
setSort(expression, descending) {
|
|
5208
|
+
const band = this.band();
|
|
5209
|
+
if (!band)
|
|
5210
|
+
return;
|
|
5211
|
+
this.state.updateBand(band.id, (b) => {
|
|
5212
|
+
const rest = b.sortBy?.slice(1) ?? [];
|
|
5213
|
+
const keys = expression ? [{ expression, descending: descending || undefined }, ...rest] : rest;
|
|
5214
|
+
b.sortBy = keys.length ? keys : undefined;
|
|
5215
|
+
});
|
|
5216
|
+
}
|
|
4283
5217
|
/** Detail columns; one column removes the setting. */
|
|
4284
5218
|
setColumns(key, value) {
|
|
4285
5219
|
const band = this.band();
|
|
@@ -4504,11 +5438,11 @@ class PropertyPanelComponent {
|
|
|
4504
5438
|
return positive(value, fallback);
|
|
4505
5439
|
}
|
|
4506
5440
|
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 });
|
|
5441
|
+
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 </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
5442
|
}
|
|
4509
5443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PropertyPanelComponent, decorators: [{
|
|
4510
5444
|
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"] }]
|
|
5445
|
+
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 </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
5446
|
}] });
|
|
4513
5447
|
function positive(value, min) {
|
|
4514
5448
|
const n = Number(String(value).replace(',', '.'));
|
|
@@ -5187,6 +6121,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
5187
6121
|
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
6122
|
}] });
|
|
5189
6123
|
|
|
6124
|
+
const WIDTH_KEY = 'we-report-designer.panels';
|
|
6125
|
+
/** Panel widths are a per-browser convenience; storage may be unavailable. */
|
|
6126
|
+
function readWidth(side, fallback) {
|
|
6127
|
+
try {
|
|
6128
|
+
const saved = JSON.parse(localStorage.getItem(WIDTH_KEY) ?? '{}')[side];
|
|
6129
|
+
return typeof saved === 'number' && (saved === 0 || (saved >= 160 && saved <= 480)) ? saved : fallback;
|
|
6130
|
+
}
|
|
6131
|
+
catch {
|
|
6132
|
+
return fallback;
|
|
6133
|
+
}
|
|
6134
|
+
}
|
|
6135
|
+
function writeWidth(side, width) {
|
|
6136
|
+
try {
|
|
6137
|
+
const all = JSON.parse(localStorage.getItem(WIDTH_KEY) ?? '{}');
|
|
6138
|
+
localStorage.setItem(WIDTH_KEY, JSON.stringify({ ...all, [side]: width }));
|
|
6139
|
+
}
|
|
6140
|
+
catch {
|
|
6141
|
+
/* not remembered */
|
|
6142
|
+
}
|
|
6143
|
+
}
|
|
5190
6144
|
const BAND_ORDER = {
|
|
5191
6145
|
pageHeader: 0,
|
|
5192
6146
|
reportHeader: 1,
|
|
@@ -5233,6 +6187,128 @@ class WeReportDesignerComponent {
|
|
|
5233
6187
|
/** Right-click menu: screen position and the band it was opened on. */
|
|
5234
6188
|
contextMenu = signal(null);
|
|
5235
6189
|
canvas = viewChild('canvas');
|
|
6190
|
+
surface = viewChild(DesignSurfaceComponent);
|
|
6191
|
+
shortcutsOpen = signal(false);
|
|
6192
|
+
/** Side panel widths in px; 0 hides a panel. Remembered in this browser. */
|
|
6193
|
+
leftWidth = signal(readWidth('left', 232));
|
|
6194
|
+
rightWidth = signal(readWidth('right', 288));
|
|
6195
|
+
fontSizes = [6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 72];
|
|
6196
|
+
textAligns = [
|
|
6197
|
+
{ value: 'left', icon: 'textLeft', label: 'alignLeft' },
|
|
6198
|
+
{ value: 'center', icon: 'textCenter', label: 'alignCenter' },
|
|
6199
|
+
{ value: 'right', icon: 'textRight', label: 'alignRight' },
|
|
6200
|
+
{ value: 'justify', icon: 'textJustify', label: 'alignJustify' },
|
|
6201
|
+
];
|
|
6202
|
+
/** The look of the first selected item (or the clicked table cell), shown in the format bar. */
|
|
6203
|
+
formatStyle = computed(() => {
|
|
6204
|
+
const c = this.state.selectedControls()[0];
|
|
6205
|
+
if (!c)
|
|
6206
|
+
return null;
|
|
6207
|
+
const cell = this.state.tableCell();
|
|
6208
|
+
const cellOverrides = c.type === 'table' && cell?.controlId === c.id ? c.rows[cell.row]?.cells[cell.cell]?.styleOverrides : undefined;
|
|
6209
|
+
return resolveStyle(this.state.report(), c.style, { ...c.styleOverrides, ...cellOverrides });
|
|
6210
|
+
});
|
|
6211
|
+
/** One line about the selection for the status bar. */
|
|
6212
|
+
selectionInfo = computed(() => {
|
|
6213
|
+
const s = this.strings();
|
|
6214
|
+
const controls = this.state.selectedControls();
|
|
6215
|
+
if (controls.length === 1) {
|
|
6216
|
+
const c = controls[0];
|
|
6217
|
+
return { title: `${s.controlNames[c.type]} · ${c.name || c.id}`, box: c };
|
|
6218
|
+
}
|
|
6219
|
+
if (controls.length > 1)
|
|
6220
|
+
return { title: s.itemsSelected.replace('{0}', String(controls.length)), box: null };
|
|
6221
|
+
const band = this.state.selectedBand();
|
|
6222
|
+
if (band)
|
|
6223
|
+
return { title: s.bandNames[band.kind], box: { x: 0, y: 0, width: resolvePageGeometry(this.state.report().page).contentWidth, height: band.height } };
|
|
6224
|
+
return { title: s.noSelection, box: null };
|
|
6225
|
+
});
|
|
6226
|
+
pointerInfo = computed(() => {
|
|
6227
|
+
const p = this.state.pointer();
|
|
6228
|
+
const band = p && this.state.report().bands.find((b) => b.id === p.bandId);
|
|
6229
|
+
return p && band ? `${this.strings().bandNames[band.kind]} · ${this.mm(p.x)} × ${this.mm(p.y)} mm` : '';
|
|
6230
|
+
});
|
|
6231
|
+
mm(v) {
|
|
6232
|
+
return String(Math.round(v * 10) / 10);
|
|
6233
|
+
}
|
|
6234
|
+
/** Where a click-added item goes: the selected section, the selected item's section, else the detail rows. */
|
|
6235
|
+
targetBand() {
|
|
6236
|
+
const bands = this.state.report().bands;
|
|
6237
|
+
const sel = this.state.selection();
|
|
6238
|
+
if (sel.kind === 'band')
|
|
6239
|
+
return bands.find((b) => b.id === sel.id);
|
|
6240
|
+
if (sel.kind === 'controls')
|
|
6241
|
+
return this.state.findBandOf(sel.ids[0]);
|
|
6242
|
+
return bands.find((b) => b.kind === 'detail') ?? bands[0];
|
|
6243
|
+
}
|
|
6244
|
+
/** Adds a toolbox item or a field without dragging: under (or, for rows, beside) what is there. */
|
|
6245
|
+
addByClick(data) {
|
|
6246
|
+
const band = this.targetBand();
|
|
6247
|
+
const surface = this.surface();
|
|
6248
|
+
if (!band || !surface)
|
|
6249
|
+
return;
|
|
6250
|
+
const width = resolvePageGeometry(this.state.report().page).contentWidth;
|
|
6251
|
+
const right = Math.max(0, ...band.controls.map((c) => c.x + c.width));
|
|
6252
|
+
const bottom = Math.max(0, ...band.controls.map((c) => c.y + c.height));
|
|
6253
|
+
// Detail rows grow sideways (a new column); other sections grow downwards.
|
|
6254
|
+
const beside = band.kind === 'detail' && data.kind === 'field' && right + 42 <= width;
|
|
6255
|
+
surface.dropAt(data, band, beside ? Math.round(right + 2) : 0, beside ? 0 : Math.round(bottom + (band.controls.length ? 1 : 0)));
|
|
6256
|
+
}
|
|
6257
|
+
onToolClick(item) {
|
|
6258
|
+
this.addByClick({ kind: 'control', type: item.type, variant: item.variant });
|
|
6259
|
+
}
|
|
6260
|
+
onFieldDblClick(field) {
|
|
6261
|
+
this.addByClick({ kind: 'field', path: field.path, parent: field.parent, format: formatFor({ name: field.path, type: field.type }) });
|
|
6262
|
+
}
|
|
6263
|
+
/** Dragging a panel edge; a double-click hides the panel or brings it back. */
|
|
6264
|
+
startResize(e, side) {
|
|
6265
|
+
e.preventDefault();
|
|
6266
|
+
const target = side === 'left' ? this.leftWidth : this.rightWidth;
|
|
6267
|
+
const start = e.clientX;
|
|
6268
|
+
const from = target();
|
|
6269
|
+
const move = (m) => {
|
|
6270
|
+
const delta = side === 'left' ? m.clientX - start : start - m.clientX;
|
|
6271
|
+
target.set(Math.round(Math.min(480, Math.max(160, from + delta))));
|
|
6272
|
+
};
|
|
6273
|
+
const up = () => {
|
|
6274
|
+
document.removeEventListener('pointermove', move);
|
|
6275
|
+
document.removeEventListener('pointerup', up);
|
|
6276
|
+
writeWidth(side, target());
|
|
6277
|
+
};
|
|
6278
|
+
document.addEventListener('pointermove', move);
|
|
6279
|
+
document.addEventListener('pointerup', up);
|
|
6280
|
+
}
|
|
6281
|
+
togglePanel(side) {
|
|
6282
|
+
const target = side === 'left' ? this.leftWidth : this.rightWidth;
|
|
6283
|
+
target.set(target() ? 0 : side === 'left' ? 232 : 288);
|
|
6284
|
+
writeWidth(side, target());
|
|
6285
|
+
}
|
|
6286
|
+
editSelected() {
|
|
6287
|
+
const c = this.state.selectedControls()[0];
|
|
6288
|
+
if (c)
|
|
6289
|
+
this.surface()?.startEditing(c);
|
|
6290
|
+
}
|
|
6291
|
+
format(key, value) {
|
|
6292
|
+
this.state.applyStyle(key, value);
|
|
6293
|
+
}
|
|
6294
|
+
typeStartsEditing() {
|
|
6295
|
+
const controls = this.state.selectedControls();
|
|
6296
|
+
const c = controls.length === 1 ? controls[0] : undefined;
|
|
6297
|
+
return c?.type === 'text' && !isExpression(c.text);
|
|
6298
|
+
}
|
|
6299
|
+
toggleFormat(key) {
|
|
6300
|
+
if (!this.formatStyle())
|
|
6301
|
+
return;
|
|
6302
|
+
this.state.applyStyle(key, !this.formatStyle()[key]);
|
|
6303
|
+
}
|
|
6304
|
+
togglePainter() {
|
|
6305
|
+
const c = this.state.selectedControls()[0];
|
|
6306
|
+
this.state.painter.set(this.state.painter() || !c ? null : { style: c.style, styleOverrides: structuredClone(c.styleOverrides) });
|
|
6307
|
+
}
|
|
6308
|
+
setBorder(on) {
|
|
6309
|
+
const st = this.formatStyle();
|
|
6310
|
+
this.state.applyStyle('border', on ? { width: 0.25, color: st?.color ?? '#000000', sides: { top: true, right: true, bottom: true, left: true } } : undefined);
|
|
6311
|
+
}
|
|
5236
6312
|
/** Design problems, checked on every edit; field names are judged only when there is data. */
|
|
5237
6313
|
issues = computed(() => {
|
|
5238
6314
|
const { rows, parent } = this.fields();
|
|
@@ -5313,6 +6389,16 @@ class WeReportDesignerComponent {
|
|
|
5313
6389
|
const sel = this.state.selection();
|
|
5314
6390
|
return sel.kind === 'controls' && sel.ids.includes(id);
|
|
5315
6391
|
}
|
|
6392
|
+
zoomSteps = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
6393
|
+
gridSteps = [0, 0.5, 1, 2, 5];
|
|
6394
|
+
/** Snap grid in mm; 0 turns the grid off. */
|
|
6395
|
+
gridSize = signal(1);
|
|
6396
|
+
pickZoom(value) {
|
|
6397
|
+
if (value === 'width')
|
|
6398
|
+
this.fitWidth();
|
|
6399
|
+
else if (value)
|
|
6400
|
+
this.setZoom(Number(value));
|
|
6401
|
+
}
|
|
5316
6402
|
fitWidth() {
|
|
5317
6403
|
const el = this.canvas()?.nativeElement;
|
|
5318
6404
|
if (!el)
|
|
@@ -5338,13 +6424,76 @@ class WeReportDesignerComponent {
|
|
|
5338
6424
|
this.state.select(controlId, false);
|
|
5339
6425
|
else
|
|
5340
6426
|
this.state.selection.set({ kind: 'band', id: bandEl.dataset['bandId'] });
|
|
5341
|
-
|
|
6427
|
+
const p = this.state.pointer();
|
|
6428
|
+
const at = p && p.bandId === bandEl.dataset['bandId'] ? { x: p.x, y: p.y } : undefined;
|
|
6429
|
+
this.contextMenu.set({ x: e.clientX, y: e.clientY, bandId: bandEl.dataset['bandId'] ?? null, onControl: !!controlId, at });
|
|
6430
|
+
}
|
|
6431
|
+
/** A new text where the section was right-clicked, ready to type in. */
|
|
6432
|
+
addTextAt(bandId, at) {
|
|
6433
|
+
const band = this.state.report().bands.find((b) => b.id === bandId);
|
|
6434
|
+
const surface = this.surface();
|
|
6435
|
+
if (!band || !surface)
|
|
6436
|
+
return;
|
|
6437
|
+
surface.dropAt({ kind: 'control', type: 'text' }, band, Math.round(at?.x ?? 0), Math.round(at?.y ?? 0));
|
|
6438
|
+
this.editSelected();
|
|
6439
|
+
}
|
|
6440
|
+
/** Shrinks (or grows) a section to just below its lowest item. */
|
|
6441
|
+
fitBand(bandId) {
|
|
6442
|
+
this.state.update((d) => {
|
|
6443
|
+
const band = d.bands.find((b) => b.id === bandId);
|
|
6444
|
+
if (band)
|
|
6445
|
+
band.height = Math.max(2, Math.round(Math.max(0, ...band.controls.map((c) => c.y + c.height)) * 100) / 100);
|
|
6446
|
+
});
|
|
5342
6447
|
}
|
|
5343
6448
|
/** Runs a context-menu command and closes the menu. */
|
|
5344
6449
|
menu(action) {
|
|
5345
6450
|
this.contextMenu.set(null);
|
|
5346
6451
|
action();
|
|
5347
6452
|
}
|
|
6453
|
+
/** Ctrl+C/X/V pressed on the page and not yet answered by a clipboard event. */
|
|
6454
|
+
pendingClipboardKey = null;
|
|
6455
|
+
/** Copy and cut also put the items on the system clipboard, so they paste in another tab. */
|
|
6456
|
+
onCopy(e) {
|
|
6457
|
+
this.pendingClipboardKey = null;
|
|
6458
|
+
if (this.tab() !== 'design' || this.isTyping(e) || !this.state.copySelection())
|
|
6459
|
+
return;
|
|
6460
|
+
e.preventDefault();
|
|
6461
|
+
e.clipboardData?.setData('text/plain', this.state.clipboardText());
|
|
6462
|
+
if (e.type === 'cut')
|
|
6463
|
+
this.state.deleteSelection();
|
|
6464
|
+
}
|
|
6465
|
+
/** Pastes our items, else a picture (screenshot) or text from any other program. */
|
|
6466
|
+
onPaste(e) {
|
|
6467
|
+
this.pendingClipboardKey = null;
|
|
6468
|
+
if (this.tab() !== 'design' || this.isTyping(e))
|
|
6469
|
+
return;
|
|
6470
|
+
const data = e.clipboardData;
|
|
6471
|
+
const text = data?.getData('text/plain') ?? '';
|
|
6472
|
+
const image = Array.from(data?.files ?? []).find((f) => /^image\/(png|jpeg)$/.test(f.type));
|
|
6473
|
+
if (this.state.loadClipboard(text) || (!text && !image && this.state.hasClipboard())) {
|
|
6474
|
+
e.preventDefault();
|
|
6475
|
+
this.state.paste();
|
|
6476
|
+
return;
|
|
6477
|
+
}
|
|
6478
|
+
const band = this.targetBand();
|
|
6479
|
+
const surface = this.surface();
|
|
6480
|
+
if (!band || !surface)
|
|
6481
|
+
return;
|
|
6482
|
+
const y = Math.max(0, ...band.controls.map((c) => c.y + c.height));
|
|
6483
|
+
if (image) {
|
|
6484
|
+
e.preventDefault();
|
|
6485
|
+
const reader = new FileReader();
|
|
6486
|
+
reader.onload = () => surface.addImage(band, 0, y, reader.result);
|
|
6487
|
+
reader.readAsDataURL(image);
|
|
6488
|
+
}
|
|
6489
|
+
else if (text.trim()) {
|
|
6490
|
+
e.preventDefault();
|
|
6491
|
+
surface.addText(band, 0, y, text.replace(/\s+$/, ''));
|
|
6492
|
+
}
|
|
6493
|
+
}
|
|
6494
|
+
isTyping(e) {
|
|
6495
|
+
return !!e.target?.closest?.('input, textarea, select, [contenteditable="true"]');
|
|
6496
|
+
}
|
|
5348
6497
|
closeMenus(e) {
|
|
5349
6498
|
if (!this.contextMenu())
|
|
5350
6499
|
return;
|
|
@@ -5391,19 +6540,59 @@ class WeReportDesignerComponent {
|
|
|
5391
6540
|
});
|
|
5392
6541
|
this.state.selection.set({ kind: 'band', id });
|
|
5393
6542
|
}
|
|
5394
|
-
/**
|
|
6543
|
+
/** The report wizard's choices while it is open. */
|
|
6544
|
+
wizard = signal(null);
|
|
6545
|
+
/** Opens the report wizard: pick columns, grouping, totals and paper, then a tidy list is built. */
|
|
5395
6546
|
autoDesign() {
|
|
5396
6547
|
const { rows } = resolveReportData(this.state.report(), this.data());
|
|
5397
|
-
const fields = inferSchema(rows ?? []);
|
|
6548
|
+
const fields = inferSchema(rows ?? []).filter((f) => f.type !== 'object' && f.type !== 'array' && f.type !== 'image');
|
|
6549
|
+
if (!fields.length)
|
|
6550
|
+
return;
|
|
6551
|
+
const name = this.state.report().name;
|
|
6552
|
+
// A blank report is still called "Report": show the localized word instead.
|
|
6553
|
+
this.wizard.set({
|
|
6554
|
+
title: name && name !== 'Report' ? name : this.strings().newReportTitle,
|
|
6555
|
+
fields: fields.map((f, i) => ({ name: f.name, on: i < 12 })),
|
|
6556
|
+
groupBy: '',
|
|
6557
|
+
sortBy: '',
|
|
6558
|
+
sortDescending: false,
|
|
6559
|
+
totals: true,
|
|
6560
|
+
orientation: '',
|
|
6561
|
+
});
|
|
6562
|
+
}
|
|
6563
|
+
updateWizard(change) {
|
|
6564
|
+
const w = this.wizard();
|
|
6565
|
+
if (w)
|
|
6566
|
+
this.wizard.set({ ...w, ...change });
|
|
6567
|
+
}
|
|
6568
|
+
toggleWizardField(name) {
|
|
6569
|
+
const w = this.wizard();
|
|
6570
|
+
if (w)
|
|
6571
|
+
this.wizard.set({ ...w, fields: w.fields.map((f) => (f.name === name ? { ...f, on: !f.on } : f)) });
|
|
6572
|
+
}
|
|
6573
|
+
/** Replaces the layout with the wizard's list report (undoable). */
|
|
6574
|
+
runWizard() {
|
|
6575
|
+
const w = this.wizard();
|
|
6576
|
+
if (!w)
|
|
6577
|
+
return;
|
|
6578
|
+
const { rows } = resolveReportData(this.state.report(), this.data());
|
|
6579
|
+
const schema = inferSchema(rows ?? []);
|
|
6580
|
+
const chosen = new Set(w.fields.filter((f) => f.on || f.name === w.groupBy).map((f) => f.name));
|
|
6581
|
+
const fields = schema.filter((f) => chosen.has(f.name));
|
|
5398
6582
|
if (!fields.length)
|
|
5399
6583
|
return;
|
|
5400
6584
|
const s = this.strings();
|
|
5401
6585
|
this.state.update((d) => {
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
6586
|
+
const generated = generateListReport(d, fields, { title: w.title, total: s.totalLabel, pageOf: s.pageOfFormat }, '', rows ?? [], {
|
|
6587
|
+
groupBy: w.groupBy || undefined,
|
|
6588
|
+
sortBy: w.sortBy || undefined,
|
|
6589
|
+
sortDescending: w.sortDescending,
|
|
6590
|
+
totals: w.totals,
|
|
6591
|
+
orientation: w.orientation || undefined,
|
|
6592
|
+
});
|
|
5405
6593
|
Object.assign(d, generated);
|
|
5406
6594
|
});
|
|
6595
|
+
this.wizard.set(null);
|
|
5407
6596
|
this.state.selection.set({ kind: 'none' });
|
|
5408
6597
|
}
|
|
5409
6598
|
issueText(issue) {
|
|
@@ -5430,11 +6619,26 @@ class WeReportDesignerComponent {
|
|
|
5430
6619
|
});
|
|
5431
6620
|
}
|
|
5432
6621
|
onKeydown(e) {
|
|
6622
|
+
if (e.key === 'F5') {
|
|
6623
|
+
// Desktop designers preview with F5; here it switches between design and preview.
|
|
6624
|
+
e.preventDefault();
|
|
6625
|
+
this.tab.set(this.tab() === 'design' ? 'preview' : 'design');
|
|
6626
|
+
return;
|
|
6627
|
+
}
|
|
5433
6628
|
if (this.tab() !== 'design')
|
|
5434
6629
|
return;
|
|
5435
6630
|
const target = e.target;
|
|
5436
6631
|
const typing = target.closest('input, textarea, select, [contenteditable="true"]');
|
|
5437
6632
|
const mod = e.ctrlKey || e.metaKey;
|
|
6633
|
+
// Text is being typed on the page and its editor is about to take focus.
|
|
6634
|
+
if (this.state.editing() && !typing) {
|
|
6635
|
+
e.preventDefault();
|
|
6636
|
+
if (e.key === 'Enter' || e.key === 'Escape')
|
|
6637
|
+
this.surface()?.finishEditing(e.key === 'Enter');
|
|
6638
|
+
else if (e.key.length === 1 && !mod)
|
|
6639
|
+
this.surface()?.appendToEdit(e.key);
|
|
6640
|
+
return;
|
|
6641
|
+
}
|
|
5438
6642
|
if (mod && e.key.toLowerCase() === 'z' && !typing) {
|
|
5439
6643
|
e.preventDefault();
|
|
5440
6644
|
if (e.shiftKey)
|
|
@@ -5446,6 +6650,45 @@ class WeReportDesignerComponent {
|
|
|
5446
6650
|
e.preventDefault();
|
|
5447
6651
|
this.state.redo();
|
|
5448
6652
|
}
|
|
6653
|
+
else if (mod && ['b', 'i', 'u'].includes(e.key.toLowerCase()) && !typing && this.state.selection().kind === 'controls') {
|
|
6654
|
+
e.preventDefault();
|
|
6655
|
+
this.toggleFormat({ b: 'bold', i: 'italic', u: 'underline' }[e.key.toLowerCase()]);
|
|
6656
|
+
}
|
|
6657
|
+
else if (mod && e.key === '0' && !typing) {
|
|
6658
|
+
e.preventDefault();
|
|
6659
|
+
this.fitWidth();
|
|
6660
|
+
}
|
|
6661
|
+
else if (mod && (e.key === '=' || e.key === '+') && !typing) {
|
|
6662
|
+
e.preventDefault();
|
|
6663
|
+
this.setZoom(this.zoomLevel() + 0.1);
|
|
6664
|
+
}
|
|
6665
|
+
else if (mod && e.key === '-' && !typing) {
|
|
6666
|
+
e.preventDefault();
|
|
6667
|
+
this.setZoom(this.zoomLevel() - 0.1);
|
|
6668
|
+
}
|
|
6669
|
+
else if (e.key === 'F1') {
|
|
6670
|
+
e.preventDefault();
|
|
6671
|
+
this.shortcutsOpen.set(!this.shortcutsOpen());
|
|
6672
|
+
}
|
|
6673
|
+
else if (!typing && !mod && !e.altKey && e.key.length === 1 && e.key !== ' ' && this.typeStartsEditing()) {
|
|
6674
|
+
// Typing on a selected text replaces it, as in a spreadsheet.
|
|
6675
|
+
e.preventDefault();
|
|
6676
|
+
this.surface()?.startEditing(this.state.selectedControls()[0], undefined, undefined, e.key);
|
|
6677
|
+
}
|
|
6678
|
+
else if (e.key === 'Tab' && !typing && !mod) {
|
|
6679
|
+
e.preventDefault();
|
|
6680
|
+
this.state.selectNext(e.shiftKey ? -1 : 1);
|
|
6681
|
+
}
|
|
6682
|
+
else if ((e.key === 'F2' || e.key === 'Enter') && !typing && this.state.selectedControls().length === 1) {
|
|
6683
|
+
e.preventDefault();
|
|
6684
|
+
this.surface()?.startEditing(this.state.selectedControls()[0]);
|
|
6685
|
+
}
|
|
6686
|
+
else if (mod && e.key.startsWith('Arrow') && !typing && this.state.selection().kind === 'controls') {
|
|
6687
|
+
// Ctrl+arrow resizes (Shift: 5 mm), plain arrows move.
|
|
6688
|
+
e.preventDefault();
|
|
6689
|
+
const step = e.shiftKey ? 5 : 1;
|
|
6690
|
+
this.state.resizeSelection(e.key === 'ArrowLeft' ? -step : e.key === 'ArrowRight' ? step : 0, e.key === 'ArrowUp' ? -step : e.key === 'ArrowDown' ? step : 0);
|
|
6691
|
+
}
|
|
5449
6692
|
else if (mod && e.key.toLowerCase() === 'd' && !typing) {
|
|
5450
6693
|
e.preventDefault();
|
|
5451
6694
|
this.state.duplicateSelection();
|
|
@@ -5456,17 +6699,22 @@ class WeReportDesignerComponent {
|
|
|
5456
6699
|
this.state.deleteSelection();
|
|
5457
6700
|
}
|
|
5458
6701
|
}
|
|
5459
|
-
else if (mod && e.key.toLowerCase()
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
6702
|
+
else if (mod && ['c', 'x', 'v'].includes(e.key.toLowerCase()) && !typing && !e.shiftKey && !e.altKey) {
|
|
6703
|
+
// Copy, cut and paste go through the clipboard events below (system clipboard). Browsers
|
|
6704
|
+
// that fire no clipboard event on a non-editable element (Safari) get the in-memory clipboard.
|
|
6705
|
+
const key = e.key.toLowerCase();
|
|
6706
|
+
this.pendingClipboardKey = key;
|
|
6707
|
+
setTimeout(() => {
|
|
6708
|
+
if (this.pendingClipboardKey !== key)
|
|
6709
|
+
return;
|
|
6710
|
+
this.pendingClipboardKey = null;
|
|
6711
|
+
if (key === 'c')
|
|
6712
|
+
this.state.copySelection();
|
|
6713
|
+
else if (key === 'x')
|
|
6714
|
+
this.state.cutSelection();
|
|
6715
|
+
else if (this.state.hasClipboard())
|
|
6716
|
+
this.state.paste();
|
|
6717
|
+
});
|
|
5470
6718
|
}
|
|
5471
6719
|
else if (mod && e.key.toLowerCase() === 'a' && !typing) {
|
|
5472
6720
|
e.preventDefault();
|
|
@@ -5475,6 +6723,8 @@ class WeReportDesignerComponent {
|
|
|
5475
6723
|
else if (e.key === 'Escape' && !typing) {
|
|
5476
6724
|
if (this.contextMenu())
|
|
5477
6725
|
this.contextMenu.set(null);
|
|
6726
|
+
else if (this.state.painter())
|
|
6727
|
+
this.state.painter.set(null);
|
|
5478
6728
|
else
|
|
5479
6729
|
this.state.selection.set({ kind: 'none' });
|
|
5480
6730
|
}
|
|
@@ -5492,12 +6742,21 @@ class WeReportDesignerComponent {
|
|
|
5492
6742
|
}
|
|
5493
6743
|
}
|
|
5494
6744
|
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 });
|
|
6745
|
+
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 (fields().rows.length) {\n <button type=\"button\" class=\"wd__text-btn wd__magic\" (click)=\"autoDesign()\" [title]=\"s.autoDesignHint\"><span [innerHTML]=\"'wand' | weReportIcon\"></span> {{ 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 <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') {\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 <ul class=\"wd__fields\">\n @for (f of fields().rows; track f.path) {\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" (dblclick)=\"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 (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)\" (dblclick)=\"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 (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)\" (dblclick)=\"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\" list=\"wd-font-sizes\" [disabled]=\"!st\" [value]=\"st?.fontSize ?? ''\" (change)=\"format('fontSize', +$any($event.target).value || undefined)\" [attr.aria-label]=\"s.fontSize\" [title]=\"s.fontSize\" />\n <datalist id=\"wd-font-sizes\">\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 <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 <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\" (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{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.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
6746
|
}
|
|
5497
6747
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportDesignerComponent, decorators: [{
|
|
5498
6748
|
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: {
|
|
6749
|
+
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 (fields().rows.length) {\n <button type=\"button\" class=\"wd__text-btn wd__magic\" (click)=\"autoDesign()\" [title]=\"s.autoDesignHint\"><span [innerHTML]=\"'wand' | weReportIcon\"></span> {{ 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 <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') {\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 <ul class=\"wd__fields\">\n @for (f of fields().rows; track f.path) {\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" (dblclick)=\"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 (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)\" (dblclick)=\"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 (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)\" (dblclick)=\"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\" list=\"wd-font-sizes\" [disabled]=\"!st\" [value]=\"st?.fontSize ?? ''\" (change)=\"format('fontSize', +$any($event.target).value || undefined)\" [attr.aria-label]=\"s.fontSize\" [title]=\"s.fontSize\" />\n <datalist id=\"wd-font-sizes\">\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 <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 <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\" (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{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.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"] }]
|
|
6750
|
+
}], ctorParameters: () => [], propDecorators: { onCopy: [{
|
|
6751
|
+
type: HostListener,
|
|
6752
|
+
args: ['copy', ['$event']]
|
|
6753
|
+
}, {
|
|
6754
|
+
type: HostListener,
|
|
6755
|
+
args: ['cut', ['$event']]
|
|
6756
|
+
}], onPaste: [{
|
|
6757
|
+
type: HostListener,
|
|
6758
|
+
args: ['paste', ['$event']]
|
|
6759
|
+
}], closeMenus: [{
|
|
5501
6760
|
type: HostListener,
|
|
5502
6761
|
args: ['document:pointerdown', ['$event']]
|
|
5503
6762
|
}], onKeydown: [{
|
|
@@ -5513,5 +6772,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
5513
6772
|
* Generated bundle index. Do not edit.
|
|
5514
6773
|
*/
|
|
5515
6774
|
|
|
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 };
|
|
6775
|
+
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
6776
|
//# sourceMappingURL=we-report-angular.mjs.map
|