we-report-angular 0.1.0 → 0.2.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/LICENSE +21 -21
- package/README.md +6 -0
- package/esm2022/lib/designer/bindable-input.component.mjs +66 -52
- package/esm2022/lib/designer/control-factory.mjs +4 -1
- package/esm2022/lib/designer/data-sources-dialog.component.mjs +3 -3
- package/esm2022/lib/designer/database-source-editor.component.mjs +251 -251
- package/esm2022/lib/designer/design-surface.component.mjs +258 -163
- package/esm2022/lib/designer/designer-state.mjs +134 -1
- package/esm2022/lib/designer/expression-editor.component.mjs +168 -0
- package/esm2022/lib/designer/formatting-rule.mjs +41 -0
- package/esm2022/lib/designer/property-panel.component.mjs +98 -3
- package/esm2022/lib/designer/we-report-designer.component.mjs +109 -20
- package/esm2022/lib/locales/de.mjs +326 -0
- package/esm2022/lib/locales/es.mjs +326 -0
- package/esm2022/lib/locales/fr.mjs +326 -0
- package/esm2022/lib/viewer/we-report-page.component.mjs +167 -167
- package/esm2022/lib/viewer/we-report-viewer.component.mjs +139 -139
- package/esm2022/lib/we-report-config.mjs +1 -1
- package/esm2022/lib/we-report-fonts.service.mjs +1 -1
- package/esm2022/lib/we-report-icons.mjs +19 -1
- package/esm2022/lib/we-report-locale.mjs +215 -1
- package/esm2022/lib/we-report-locales.mjs +21 -0
- package/esm2022/public-api.mjs +5 -1
- package/fesm2022/we-report-angular.mjs +2646 -789
- package/fesm2022/we-report-angular.mjs.map +1 -1
- package/lib/designer/bindable-input.component.d.ts +1 -0
- package/lib/designer/design-surface.component.d.ts +19 -0
- package/lib/designer/designer-state.d.ts +23 -0
- package/lib/designer/expression-editor.component.d.ts +39 -0
- package/lib/designer/formatting-rule.d.ts +14 -0
- package/lib/designer/property-panel.component.d.ts +38 -2
- package/lib/designer/we-report-designer.component.d.ts +21 -1
- package/lib/locales/de.d.ts +3 -0
- package/lib/locales/es.d.ts +3 -0
- package/lib/locales/fr.d.ts +3 -0
- package/lib/we-report-icons.d.ts +18 -0
- package/lib/we-report-locale.d.ts +75 -0
- package/lib/we-report-locales.d.ts +8 -0
- package/package.json +2 -2
- package/public-api.d.ts +4 -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, ElementRef, model, HostListener } from '@angular/core';
|
|
3
|
-
import { DEFAULT_FONT_FAMILY, FontRegistry, parseHexColor, loadReportData, layoutReport, renderPdf, reportTable, writeXlsx, createBlankReport, resolvePageGeometry, isExpression, evaluate, formatValue, resolveStyle, captionFor, resolveReportData, inferSchema, PAPER_SIZES, BARCODE_SYMBOLOGIES, backendClient,
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, inject, Pipe, Injectable, signal, input, Component, ChangeDetectionStrategy, output, computed, effect, untracked, ElementRef, viewChild, model, HostListener } from '@angular/core';
|
|
3
|
+
import { DEFAULT_FONT_FAMILY, FontRegistry, parseHexColor, loadReportData, layoutReport, renderPdf, reportTable, writeXlsx, createBlankReport, resolvePageGeometry, isExpression, evaluate, formatValue, resolveStyle, DEFAULT_WATERMARK_COLOR, captionFor, resolveReportData, inferSchema, EXPRESSION_FUNCTIONS, resolveParameters, PAPER_SIZES, BARCODE_SYMBOLOGIES, 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
|
|
|
@@ -23,6 +23,7 @@ const weReportLocaleEn = {
|
|
|
23
23
|
barcode: 'Barcode',
|
|
24
24
|
pageInfo: 'Page number / date',
|
|
25
25
|
checkbox: 'Checkbox',
|
|
26
|
+
chart: 'Chart',
|
|
26
27
|
},
|
|
27
28
|
zoomIn: 'Zoom in',
|
|
28
29
|
zoomOut: 'Zoom out',
|
|
@@ -41,6 +42,31 @@ const weReportLocaleEn = {
|
|
|
41
42
|
redo: 'Redo',
|
|
42
43
|
delete: 'Delete',
|
|
43
44
|
duplicate: 'Duplicate',
|
|
45
|
+
cut: 'Cut',
|
|
46
|
+
copy: 'Copy',
|
|
47
|
+
paste: 'Paste',
|
|
48
|
+
selectAll: 'Select all',
|
|
49
|
+
arrange: 'Arrange',
|
|
50
|
+
arrangeLeft: 'Align left edges',
|
|
51
|
+
arrangeCenter: 'Align centres',
|
|
52
|
+
arrangeRight: 'Align right edges',
|
|
53
|
+
arrangeTop: 'Align top edges',
|
|
54
|
+
arrangeMiddle: 'Align middles',
|
|
55
|
+
arrangeBottom: 'Align bottom edges',
|
|
56
|
+
distributeH: 'Space evenly across',
|
|
57
|
+
distributeV: 'Space evenly down',
|
|
58
|
+
sameWidth: 'Same width',
|
|
59
|
+
sameHeight: 'Same height',
|
|
60
|
+
bringToFront: 'Bring to front',
|
|
61
|
+
sendToBack: 'Send to back',
|
|
62
|
+
arrangeHint: 'Select two or more items to align them; the first one you clicked stays put.',
|
|
63
|
+
explorer: 'Outline',
|
|
64
|
+
itemsSelected: '{0} items selected',
|
|
65
|
+
explorerHint: 'Everything on the report, section by section. Click to select.',
|
|
66
|
+
emptyBand: '(empty)',
|
|
67
|
+
add: 'Add',
|
|
68
|
+
data: 'Data',
|
|
69
|
+
fitWidth: 'Fit to width',
|
|
44
70
|
basicMode: 'Basic',
|
|
45
71
|
advancedMode: 'Advanced',
|
|
46
72
|
toolbox: 'Add to report',
|
|
@@ -220,6 +246,87 @@ const weReportLocaleEn = {
|
|
|
220
246
|
issueOverlap: 'overlaps {0}',
|
|
221
247
|
fixIt: 'Fix',
|
|
222
248
|
noProblems: 'No problems found.',
|
|
249
|
+
chartType: 'Chart type',
|
|
250
|
+
chartColumn: 'Columns',
|
|
251
|
+
chartBar: 'Bars',
|
|
252
|
+
chartLine: 'Line',
|
|
253
|
+
chartPie: 'Pie',
|
|
254
|
+
chartDoughnut: 'Doughnut',
|
|
255
|
+
chartCategory: 'Group by',
|
|
256
|
+
chartValue: 'Value',
|
|
257
|
+
chartAggregate: 'Calculation',
|
|
258
|
+
aggSum: 'Total',
|
|
259
|
+
aggCount: 'Count',
|
|
260
|
+
aggAvg: 'Average',
|
|
261
|
+
aggMin: 'Smallest',
|
|
262
|
+
aggMax: 'Largest',
|
|
263
|
+
chartTitle: 'Title',
|
|
264
|
+
showValues: 'Show values',
|
|
265
|
+
showLegend: 'Show legend',
|
|
266
|
+
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.',
|
|
267
|
+
conditionalFormatting: 'Conditional formatting',
|
|
268
|
+
watermark: 'Watermark',
|
|
269
|
+
reportLocale: 'Language and region',
|
|
270
|
+
reportLocaleRegion: 'Numbers and dates',
|
|
271
|
+
reportCurrency: 'Currency',
|
|
272
|
+
reportLocaleDefault: 'App default',
|
|
273
|
+
reportLocaleHint: 'How this report writes numbers, dates, money and amounts in words, wherever it is printed.',
|
|
274
|
+
formulaEditor: 'Formula editor',
|
|
275
|
+
formulaEditorHint: 'Click a field or function to insert it at the cursor.',
|
|
276
|
+
formulaResult: 'Result for the first row',
|
|
277
|
+
formulaEmpty: '(empty)',
|
|
278
|
+
apply: 'Apply',
|
|
279
|
+
cancel: 'Cancel',
|
|
280
|
+
fnLogic: 'Logic',
|
|
281
|
+
fnText: 'Text',
|
|
282
|
+
fnNumber: 'Number',
|
|
283
|
+
fnDate: 'Date',
|
|
284
|
+
fnAggregate: 'Totals',
|
|
285
|
+
functions: 'Functions',
|
|
286
|
+
openFormulaEditor: 'Open the formula editor',
|
|
287
|
+
functionHelp: {
|
|
288
|
+
Iif: 'Chooses between two values: the first when the condition is true, otherwise the second.',
|
|
289
|
+
IsNull: 'The value, or the fallback when it is empty.',
|
|
290
|
+
Concat: 'Joins texts together.',
|
|
291
|
+
Len: 'Number of characters.',
|
|
292
|
+
Upper: 'CAPITAL LETTERS (Turkish İ/ı handled).',
|
|
293
|
+
Lower: 'small letters (Turkish İ/ı handled).',
|
|
294
|
+
Trim: 'Removes spaces at both ends.',
|
|
295
|
+
Substring: 'Part of a text, from a position (0 = first character).',
|
|
296
|
+
Replace: 'Replaces every occurrence of a text.',
|
|
297
|
+
Contains: 'True when the text contains the part.',
|
|
298
|
+
StartsWith: 'True when the text starts with the part.',
|
|
299
|
+
EndsWith: 'True when the text ends with the part.',
|
|
300
|
+
ToString: 'The value as text.',
|
|
301
|
+
Format: 'Shows a value with a pattern, e.g. \'n2\' or \'dd.MM.yyyy\'.',
|
|
302
|
+
AmountInWords: 'An amount written in words with its currency, for invoices and cheques.',
|
|
303
|
+
NumberToWords: 'A whole number written in words.',
|
|
304
|
+
Round: 'Rounds to the given decimals (half away from zero).',
|
|
305
|
+
Abs: 'The number without its sign.',
|
|
306
|
+
Floor: 'Rounds down to a whole number.',
|
|
307
|
+
Ceiling: 'Rounds up to a whole number.',
|
|
308
|
+
ToNumber: 'Reads a number from text.',
|
|
309
|
+
Today: 'The print date (no time).',
|
|
310
|
+
Now: 'The print date and time.',
|
|
311
|
+
Year: 'Year of a date.',
|
|
312
|
+
Month: 'Month of a date (1–12).',
|
|
313
|
+
Day: 'Day of the month.',
|
|
314
|
+
AddDays: 'A date moved by a number of days, e.g. a due date.',
|
|
315
|
+
Sum: 'Total over the rows in scope (group, page or report).',
|
|
316
|
+
Count: 'Number of rows in scope.',
|
|
317
|
+
Avg: 'Average over the rows in scope.',
|
|
318
|
+
Min: 'Smallest value over the rows in scope (or of two values).',
|
|
319
|
+
Max: 'Largest value over the rows in scope (or of two values).',
|
|
320
|
+
},
|
|
321
|
+
watermarkHint: 'Large faint text behind every page, e.g. DRAFT or PAID. Can come from data.',
|
|
322
|
+
watermarkAngle: 'Direction',
|
|
323
|
+
conditionalHint: 'Change the look when a condition is true, e.g. negative amounts in red.',
|
|
324
|
+
addRule: 'Add rule',
|
|
325
|
+
ruleWhen: 'When',
|
|
326
|
+
ruleThen: 'Then',
|
|
327
|
+
removeRule: 'Remove rule',
|
|
328
|
+
opContains: 'contains',
|
|
329
|
+
ruleValue: 'Value',
|
|
223
330
|
};
|
|
224
331
|
const weReportLocaleTr = {
|
|
225
332
|
designerLabel: 'Rapor tasarım alanı',
|
|
@@ -240,6 +347,7 @@ const weReportLocaleTr = {
|
|
|
240
347
|
barcode: 'Barkod',
|
|
241
348
|
pageInfo: 'Sayfa no / tarih',
|
|
242
349
|
checkbox: 'Onay kutusu',
|
|
350
|
+
chart: 'Grafik',
|
|
243
351
|
},
|
|
244
352
|
zoomIn: 'Yakınlaştır',
|
|
245
353
|
zoomOut: 'Uzaklaştır',
|
|
@@ -258,6 +366,31 @@ const weReportLocaleTr = {
|
|
|
258
366
|
redo: 'Yinele',
|
|
259
367
|
delete: 'Sil',
|
|
260
368
|
duplicate: 'Çoğalt',
|
|
369
|
+
cut: 'Kes',
|
|
370
|
+
copy: 'Kopyala',
|
|
371
|
+
paste: 'Yapıştır',
|
|
372
|
+
selectAll: 'Tümünü seç',
|
|
373
|
+
arrange: 'Düzenle',
|
|
374
|
+
arrangeLeft: 'Sol kenarları hizala',
|
|
375
|
+
arrangeCenter: 'Ortaları hizala',
|
|
376
|
+
arrangeRight: 'Sağ kenarları hizala',
|
|
377
|
+
arrangeTop: 'Üst kenarları hizala',
|
|
378
|
+
arrangeMiddle: 'Dikey ortaları hizala',
|
|
379
|
+
arrangeBottom: 'Alt kenarları hizala',
|
|
380
|
+
distributeH: 'Yatayda eşit aralıkla dağıt',
|
|
381
|
+
distributeV: 'Dikeyde eşit aralıkla dağıt',
|
|
382
|
+
sameWidth: 'Aynı genişlik',
|
|
383
|
+
sameHeight: 'Aynı yükseklik',
|
|
384
|
+
bringToFront: 'Öne getir',
|
|
385
|
+
sendToBack: 'Arkaya gönder',
|
|
386
|
+
arrangeHint: 'Hizalamak için iki veya daha fazla öğe seçin; ilk tıkladığınız yerinde kalır.',
|
|
387
|
+
explorer: 'Gezgin',
|
|
388
|
+
itemsSelected: '{0} öğe seçili',
|
|
389
|
+
explorerHint: 'Rapordaki her şey, bölüm bölüm. Seçmek için tıklayın.',
|
|
390
|
+
emptyBand: '(boş)',
|
|
391
|
+
add: 'Ekle',
|
|
392
|
+
data: 'Veri',
|
|
393
|
+
fitWidth: 'Genişliğe sığdır',
|
|
261
394
|
basicMode: 'Basit',
|
|
262
395
|
advancedMode: 'Gelişmiş',
|
|
263
396
|
toolbox: 'Rapora ekle',
|
|
@@ -437,12 +570,1088 @@ const weReportLocaleTr = {
|
|
|
437
570
|
issueOverlap: '{0} ile üst üste biniyor',
|
|
438
571
|
fixIt: 'Düzelt',
|
|
439
572
|
noProblems: 'Sorun bulunamadı.',
|
|
573
|
+
chartType: 'Grafik türü',
|
|
574
|
+
chartColumn: 'Sütun',
|
|
575
|
+
chartBar: 'Çubuk',
|
|
576
|
+
chartLine: 'Çizgi',
|
|
577
|
+
chartPie: 'Pasta',
|
|
578
|
+
chartDoughnut: 'Halka',
|
|
579
|
+
chartCategory: 'Gruplama alanı',
|
|
580
|
+
chartValue: 'Değer',
|
|
581
|
+
chartAggregate: 'Hesaplama',
|
|
582
|
+
aggSum: 'Toplam',
|
|
583
|
+
aggCount: 'Adet',
|
|
584
|
+
aggAvg: 'Ortalama',
|
|
585
|
+
aggMin: 'En küçük',
|
|
586
|
+
aggMax: 'En büyük',
|
|
587
|
+
chartTitle: 'Başlık',
|
|
588
|
+
showValues: 'Değerleri göster',
|
|
589
|
+
showLegend: 'Açıklamayı göster',
|
|
590
|
+
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ı.',
|
|
591
|
+
conditionalFormatting: 'Koşullu biçim',
|
|
592
|
+
watermark: 'Filigran',
|
|
593
|
+
reportLocale: 'Dil ve bölge',
|
|
594
|
+
reportLocaleRegion: 'Sayı ve tarihler',
|
|
595
|
+
reportCurrency: 'Para birimi',
|
|
596
|
+
reportLocaleDefault: 'Uygulama ayarı',
|
|
597
|
+
reportLocaleHint: 'Bu rapor nerede yazdırılırsa yazdırılsın sayıları, tarihleri, parayı ve yazıyla tutarı nasıl yazacağı.',
|
|
598
|
+
formulaEditor: 'Formül düzenleyici',
|
|
599
|
+
formulaEditorHint: 'Bir alana veya fonksiyona tıklayınca imlecin olduğu yere eklenir.',
|
|
600
|
+
formulaResult: 'İlk satır için sonuç',
|
|
601
|
+
formulaEmpty: '(boş)',
|
|
602
|
+
apply: 'Uygula',
|
|
603
|
+
cancel: 'Vazgeç',
|
|
604
|
+
fnLogic: 'Mantık',
|
|
605
|
+
fnText: 'Metin',
|
|
606
|
+
fnNumber: 'Sayı',
|
|
607
|
+
fnDate: 'Tarih',
|
|
608
|
+
fnAggregate: 'Toplamlar',
|
|
609
|
+
functions: 'Fonksiyonlar',
|
|
610
|
+
openFormulaEditor: 'Formül düzenleyiciyi aç',
|
|
611
|
+
functionHelp: {
|
|
612
|
+
Iif: 'İki değer arasında seçer: koşul doğruysa ilki, değilse ikincisi.',
|
|
613
|
+
IsNull: 'Değer boşsa yerine konacak değeri verir.',
|
|
614
|
+
Concat: 'Metinleri birleştirir.',
|
|
615
|
+
Len: 'Karakter sayısı.',
|
|
616
|
+
Upper: 'BÜYÜK HARF (Türkçe İ/ı doğru).',
|
|
617
|
+
Lower: 'küçük harf (Türkçe İ/ı doğru).',
|
|
618
|
+
Trim: 'Baştaki ve sondaki boşlukları siler.',
|
|
619
|
+
Substring: 'Metnin bir parçası; konum 0 ilk karakterdir.',
|
|
620
|
+
Replace: 'Bir metnin geçtiği her yeri değiştirir.',
|
|
621
|
+
Contains: 'Metin parçayı içeriyorsa doğru.',
|
|
622
|
+
StartsWith: 'Metin parçayla başlıyorsa doğru.',
|
|
623
|
+
EndsWith: 'Metin parçayla bitiyorsa doğru.',
|
|
624
|
+
ToString: 'Değeri metne çevirir.',
|
|
625
|
+
Format: 'Değeri bir kalıpla gösterir; örn. \'n2\' veya \'dd.MM.yyyy\'.',
|
|
626
|
+
AmountInWords: 'Tutarı para birimiyle yazıyla yazar; fatura ve çekler için.',
|
|
627
|
+
NumberToWords: 'Tam sayıyı yazıyla yazar.',
|
|
628
|
+
Round: 'Verilen ondalık basamağa yuvarlar.',
|
|
629
|
+
Abs: 'Sayının işaretsiz hâli.',
|
|
630
|
+
Floor: 'Aşağı yuvarlar.',
|
|
631
|
+
Ceiling: 'Yukarı yuvarlar.',
|
|
632
|
+
ToNumber: 'Metinden sayı okur.',
|
|
633
|
+
Today: 'Yazdırma tarihi (saatsiz).',
|
|
634
|
+
Now: 'Yazdırma tarihi ve saati.',
|
|
635
|
+
Year: 'Tarihin yılı.',
|
|
636
|
+
Month: 'Tarihin ayı (1–12).',
|
|
637
|
+
Day: 'Ayın günü.',
|
|
638
|
+
AddDays: 'Tarihe gün ekler; örn. vade tarihi.',
|
|
639
|
+
Sum: 'Kapsamdaki satırların toplamı (grup, sayfa veya rapor).',
|
|
640
|
+
Count: 'Kapsamdaki satır sayısı.',
|
|
641
|
+
Avg: 'Kapsamdaki satırların ortalaması.',
|
|
642
|
+
Min: 'Kapsamdaki en küçük değer (veya iki değerden küçüğü).',
|
|
643
|
+
Max: 'Kapsamdaki en büyük değer (veya iki değerden büyüğü).',
|
|
644
|
+
},
|
|
645
|
+
watermarkHint: 'Her sayfanın arkasında büyük, soluk yazı; örneğin TASLAK veya ÖDENDİ. Veriden de gelebilir.',
|
|
646
|
+
watermarkAngle: 'Yön',
|
|
647
|
+
conditionalHint: 'Bir koşul doğru olduğunda görünümü değiştirin; örneğin eksi tutarlar kırmızı olsun.',
|
|
648
|
+
addRule: 'Kural ekle',
|
|
649
|
+
ruleWhen: 'Şu durumda',
|
|
650
|
+
ruleThen: 'O zaman',
|
|
651
|
+
removeRule: 'Kuralı kaldır',
|
|
652
|
+
opContains: 'içeriyorsa',
|
|
653
|
+
ruleValue: 'Değer',
|
|
440
654
|
};
|
|
441
655
|
const WE_REPORT_LOCALE = new InjectionToken('WE_REPORT_LOCALE', {
|
|
442
656
|
providedIn: 'root',
|
|
443
657
|
factory: () => weReportLocaleEn,
|
|
444
658
|
});
|
|
445
659
|
|
|
660
|
+
/** Deutsch. */
|
|
661
|
+
const weReportLocaleDe = {
|
|
662
|
+
designerLabel: 'Berichtsentwurfsfläche',
|
|
663
|
+
bandNames: {
|
|
664
|
+
reportHeader: 'Berichtskopf',
|
|
665
|
+
pageHeader: 'Seitenkopf',
|
|
666
|
+
groupHeader: 'Gruppenkopf',
|
|
667
|
+
detail: 'Detail (wiederholt sich für jede Zeile)',
|
|
668
|
+
groupFooter: 'Gruppenfuß',
|
|
669
|
+
pageFooter: 'Seitenfuß',
|
|
670
|
+
reportFooter: 'Berichtsfuß',
|
|
671
|
+
},
|
|
672
|
+
controlNames: {
|
|
673
|
+
text: 'Text',
|
|
674
|
+
line: 'Linie',
|
|
675
|
+
shape: 'Form',
|
|
676
|
+
image: 'Bild',
|
|
677
|
+
barcode: 'Barcode',
|
|
678
|
+
pageInfo: 'Seitenzahl / Datum',
|
|
679
|
+
checkbox: 'Kontrollkästchen',
|
|
680
|
+
chart: 'Diagramm',
|
|
681
|
+
},
|
|
682
|
+
zoomIn: 'Vergrößern',
|
|
683
|
+
zoomOut: 'Verkleinern',
|
|
684
|
+
print: 'Drucken',
|
|
685
|
+
downloadPdf: 'PDF herunterladen',
|
|
686
|
+
downloadExcel: 'Excel',
|
|
687
|
+
pageCount: '{0} Seite(n)',
|
|
688
|
+
problems: 'Probleme',
|
|
689
|
+
loading: 'Vorschau wird erstellt…',
|
|
690
|
+
layoutError: 'Der Bericht konnte nicht erstellt werden',
|
|
691
|
+
runReport: 'Bericht ausführen',
|
|
692
|
+
dataLoadError: 'Die Daten konnten nicht geladen werden',
|
|
693
|
+
design: 'Entwurf',
|
|
694
|
+
preview: 'Vorschau',
|
|
695
|
+
undo: 'Rückgängig',
|
|
696
|
+
redo: 'Wiederholen',
|
|
697
|
+
delete: 'Löschen',
|
|
698
|
+
duplicate: 'Duplizieren',
|
|
699
|
+
cut: 'Ausschneiden',
|
|
700
|
+
copy: 'Kopieren',
|
|
701
|
+
paste: 'Einfügen',
|
|
702
|
+
selectAll: 'Alles auswählen',
|
|
703
|
+
arrange: 'Anordnen',
|
|
704
|
+
arrangeLeft: 'Linke Kanten ausrichten',
|
|
705
|
+
arrangeCenter: 'Mitten ausrichten',
|
|
706
|
+
arrangeRight: 'Rechte Kanten ausrichten',
|
|
707
|
+
arrangeTop: 'Obere Kanten ausrichten',
|
|
708
|
+
arrangeMiddle: 'Vertikale Mitten ausrichten',
|
|
709
|
+
arrangeBottom: 'Untere Kanten ausrichten',
|
|
710
|
+
distributeH: 'Horizontal gleichmäßig verteilen',
|
|
711
|
+
distributeV: 'Vertikal gleichmäßig verteilen',
|
|
712
|
+
sameWidth: 'Gleiche Breite',
|
|
713
|
+
sameHeight: 'Gleiche Höhe',
|
|
714
|
+
bringToFront: 'In den Vordergrund',
|
|
715
|
+
sendToBack: 'In den Hintergrund',
|
|
716
|
+
arrangeHint: 'Wählen Sie zwei oder mehr Elemente zum Ausrichten; das zuerst angeklickte bleibt stehen.',
|
|
717
|
+
explorer: 'Gliederung',
|
|
718
|
+
itemsSelected: '{0} Elemente ausgewählt',
|
|
719
|
+
explorerHint: 'Alles im Bericht, Abschnitt für Abschnitt. Zum Auswählen anklicken.',
|
|
720
|
+
emptyBand: '(leer)',
|
|
721
|
+
add: 'Hinzufügen',
|
|
722
|
+
data: 'Daten',
|
|
723
|
+
fitWidth: 'An Breite anpassen',
|
|
724
|
+
basicMode: 'Einfach',
|
|
725
|
+
advancedMode: 'Erweitert',
|
|
726
|
+
toolbox: 'Zum Bericht hinzufügen',
|
|
727
|
+
toolboxHint: 'Ziehen Sie ein Element auf die Seite.',
|
|
728
|
+
fields: 'Datenfelder',
|
|
729
|
+
fieldsHint: 'Ziehen Sie ein Feld auf die Seite, um seinen Wert anzuzeigen.',
|
|
730
|
+
parentFields: 'Dokumentfelder',
|
|
731
|
+
noFields: 'Noch keine Daten. Verbinden Sie Daten, um ihre Felder hier zu sehen.',
|
|
732
|
+
properties: 'Eigenschaften',
|
|
733
|
+
addBand: 'Abschnitt hinzufügen',
|
|
734
|
+
removeBand: 'Abschnitt entfernen',
|
|
735
|
+
groupBy: 'Gruppieren nach',
|
|
736
|
+
newText: 'Text',
|
|
737
|
+
showData: 'Daten anzeigen',
|
|
738
|
+
groupLayout: 'Position und Größe',
|
|
739
|
+
groupContent: 'Inhalt',
|
|
740
|
+
groupAppearance: 'Aussehen',
|
|
741
|
+
groupBehaviour: 'Verhalten',
|
|
742
|
+
groupPage: 'Seite',
|
|
743
|
+
groupData: 'Daten',
|
|
744
|
+
reportName: 'Berichtsname',
|
|
745
|
+
paper: 'Papier',
|
|
746
|
+
orientation: 'Ausrichtung',
|
|
747
|
+
portrait: 'Hochformat',
|
|
748
|
+
landscape: 'Querformat',
|
|
749
|
+
customSize: 'Eigene Größe',
|
|
750
|
+
width: 'Breite',
|
|
751
|
+
height: 'Höhe',
|
|
752
|
+
margins: 'Ränder',
|
|
753
|
+
marginTop: 'Oben',
|
|
754
|
+
marginRight: 'Rechts',
|
|
755
|
+
marginBottom: 'Unten',
|
|
756
|
+
marginLeft: 'Links',
|
|
757
|
+
left: 'Von links',
|
|
758
|
+
top: 'Von oben',
|
|
759
|
+
content: 'Inhalt',
|
|
760
|
+
staticText: 'Fester Text',
|
|
761
|
+
fromData: 'Aus Daten',
|
|
762
|
+
expression: 'Formel',
|
|
763
|
+
expressionHint: 'Felder in Klammern, z. B. [Preis] * [Menge]',
|
|
764
|
+
format: 'Anzeigen als',
|
|
765
|
+
formatNone: 'Wie es ist',
|
|
766
|
+
formatNumber0: 'Zahl (1.235)',
|
|
767
|
+
formatNumber2: 'Zahl (1.234,50)',
|
|
768
|
+
formatCurrency: 'Geld',
|
|
769
|
+
formatPercent: 'Prozent',
|
|
770
|
+
formatDate: 'Datum',
|
|
771
|
+
formatDateTime: 'Datum und Uhrzeit',
|
|
772
|
+
font: 'Schrift',
|
|
773
|
+
fontSize: 'Größe',
|
|
774
|
+
bold: 'Fett',
|
|
775
|
+
italic: 'Kursiv',
|
|
776
|
+
underline: 'Unterstrichen',
|
|
777
|
+
alignment: 'Ausrichtung',
|
|
778
|
+
alignLeft: 'Links',
|
|
779
|
+
alignCenter: 'Mitte',
|
|
780
|
+
alignRight: 'Rechts',
|
|
781
|
+
verticalAlignment: 'Vertikale Ausrichtung',
|
|
782
|
+
alignTop: 'Oben',
|
|
783
|
+
alignMiddle: 'Mitte',
|
|
784
|
+
alignBottom: 'Unten',
|
|
785
|
+
textColor: 'Textfarbe',
|
|
786
|
+
backgroundColor: 'Hintergrund',
|
|
787
|
+
noColor: 'Keine',
|
|
788
|
+
border: 'Rahmen',
|
|
789
|
+
borderWidth: 'Rahmenstärke',
|
|
790
|
+
borderColor: 'Rahmenfarbe',
|
|
791
|
+
padding: 'Innenabstand',
|
|
792
|
+
canGrow: 'An Text anpassen',
|
|
793
|
+
canGrowHint: 'Langer Text macht die Zeile höher, statt abgeschnitten zu werden.',
|
|
794
|
+
visibleWhen: 'Nur anzeigen, wenn',
|
|
795
|
+
visibleWhenHint: 'Eine Formel; das Element wird ausgeblendet, wenn sie falsch ist, z. B. [Summe] > 0',
|
|
796
|
+
symbology: 'Barcode-Typ',
|
|
797
|
+
barcodeValue: 'Wert',
|
|
798
|
+
showText: 'Ziffern unter dem Code anzeigen',
|
|
799
|
+
imageSource: 'Bild',
|
|
800
|
+
chooseImage: 'Bild auswählen…',
|
|
801
|
+
fit: 'Einpassen',
|
|
802
|
+
fitContain: 'Hineinpassen',
|
|
803
|
+
fitCover: 'Ausfüllen (zuschneiden)',
|
|
804
|
+
fitStretch: 'Strecken',
|
|
805
|
+
fitNone: 'Originalgröße',
|
|
806
|
+
lineDirection: 'Richtung',
|
|
807
|
+
horizontal: 'Horizontal',
|
|
808
|
+
vertical: 'Vertikal',
|
|
809
|
+
diagonalDown: 'Diagonal ↘',
|
|
810
|
+
diagonalUp: 'Diagonal ↗',
|
|
811
|
+
lineWidth: 'Stärke',
|
|
812
|
+
color: 'Farbe',
|
|
813
|
+
shape: 'Form',
|
|
814
|
+
rectangle: 'Rechteck',
|
|
815
|
+
roundedRectangle: 'Abgerundetes Rechteck',
|
|
816
|
+
ellipse: 'Ellipse',
|
|
817
|
+
cornerRadius: 'Eckenrundung',
|
|
818
|
+
pageInfo: 'Zeigt',
|
|
819
|
+
pageNumber: 'Seitenzahl',
|
|
820
|
+
pageTotal: 'Seitenanzahl',
|
|
821
|
+
pageNofM: 'Seite X von Y',
|
|
822
|
+
printDate: 'Druckdatum',
|
|
823
|
+
checked: 'Angehakt, wenn',
|
|
824
|
+
bandHeight: 'Abschnittshöhe',
|
|
825
|
+
sortGroups: 'Reihenfolge der Gruppen',
|
|
826
|
+
sortAsc: 'A → Z',
|
|
827
|
+
sortDesc: 'Z → A',
|
|
828
|
+
sortNone: 'Wie in den Daten',
|
|
829
|
+
keepTogether: 'Gruppe auf einer Seite halten',
|
|
830
|
+
keepTogetherHint: 'Verschiebt die ganze Gruppe auf die nächste Seite, statt sie zu teilen.',
|
|
831
|
+
repeatOnEveryPage: 'Auf jeder Seite wiederholen',
|
|
832
|
+
pageBreakBefore: 'Auf neuer Seite beginnen',
|
|
833
|
+
pageBreakAfter: 'Danach neue Seite',
|
|
834
|
+
dataRows: 'Zeilen kommen aus',
|
|
835
|
+
dataRowsHint: 'Pfad zur Liste in den Daten, z. B. lines',
|
|
836
|
+
dataSources: 'Datenquellen',
|
|
837
|
+
close: 'Schließen',
|
|
838
|
+
rowsSource: 'Zeilen',
|
|
839
|
+
noSources: 'Noch keine Datenquelle. Fügen Sie links eine hinzu.',
|
|
840
|
+
webService: 'Webdienst',
|
|
841
|
+
parameters: 'Parameter',
|
|
842
|
+
parametersHint: 'Werden vor dem Ausführen abgefragt. [?name] in Formeln und {{name}} in Webdienst-Adressen verwenden.',
|
|
843
|
+
parameterName: 'Parametername',
|
|
844
|
+
parameterType: 'Typ',
|
|
845
|
+
parameterLabel: 'Angezeigte Beschriftung',
|
|
846
|
+
defaultValue: 'Standardwert',
|
|
847
|
+
addParameter: 'Parameter hinzufügen',
|
|
848
|
+
sourceName: 'Name',
|
|
849
|
+
wholeData: '(die gesamten Daten)',
|
|
850
|
+
rowCount: '{0} Zeile(n)',
|
|
851
|
+
useForRows: 'Diese Quelle für die Berichtszeilen verwenden',
|
|
852
|
+
jsonData: 'JSON-Daten',
|
|
853
|
+
invalidJson: 'Das ist kein gültiges JSON',
|
|
854
|
+
csvData: 'Fügen Sie eine CSV- oder Excel-Tabelle mit Kopfzeile ein',
|
|
855
|
+
method: 'Methode',
|
|
856
|
+
url: 'Adresse (URL)',
|
|
857
|
+
test: 'Testen',
|
|
858
|
+
testing: 'Wird getestet…',
|
|
859
|
+
testOk: 'Funktioniert: {0} Zeile(n) gefunden. Die Antwort wird für den Entwurf gespeichert.',
|
|
860
|
+
headers: 'Header',
|
|
861
|
+
headerName: 'Header-Name',
|
|
862
|
+
headerValue: 'Header-Wert',
|
|
863
|
+
addHeader: 'Header hinzufügen',
|
|
864
|
+
requestBody: 'Anfragetext',
|
|
865
|
+
secretWarning: 'Alles hier ist im Browser sichtbar und wird in der Berichtsdatei gespeichert. Für geheime Schlüssel den Dienst über Ihr Backend aufrufen.',
|
|
866
|
+
removeSource: 'Diese Datenquelle entfernen',
|
|
867
|
+
typeText: 'Text',
|
|
868
|
+
typeNumber: 'Zahl',
|
|
869
|
+
typeDate: 'Datum',
|
|
870
|
+
typeYesNo: 'Ja / Nein',
|
|
871
|
+
database: 'Datenbank',
|
|
872
|
+
backendAddress: 'Adresse des Daten-Backends',
|
|
873
|
+
connect: 'Verbinden',
|
|
874
|
+
connected: 'Verbunden – {0} Verbindung(en) verfügbar.',
|
|
875
|
+
connection: 'Verbindung',
|
|
876
|
+
writeSql: 'SQL selbst schreiben',
|
|
877
|
+
sqlHint: 'Eine SELECT-Anweisung. :name für Berichtsparameter verwenden.',
|
|
878
|
+
table: 'Tabelle',
|
|
879
|
+
columns: 'Spalten',
|
|
880
|
+
filters: 'Nur Zeilen, bei denen',
|
|
881
|
+
fixedValue: 'Wert…',
|
|
882
|
+
addFilter: 'Bedingung hinzufügen',
|
|
883
|
+
sortBy: 'Sortieren nach',
|
|
884
|
+
maxRows: 'Max. Zeilen',
|
|
885
|
+
opLike: 'enthält (like)',
|
|
886
|
+
opIsEmpty: 'ist leer',
|
|
887
|
+
opIsNotEmpty: 'ist nicht leer',
|
|
888
|
+
rowLimitReached: '(Zeilenlimit erreicht – es gibt weitere Zeilen)',
|
|
889
|
+
viaBackend: 'Über das Daten-Backend aufrufen',
|
|
890
|
+
viaBackendHint: 'Verwenden, wenn der Dienst Browser-Aufrufe blockiert (CORS) oder einen geheimen Schlüssel braucht.',
|
|
891
|
+
autoDesign: 'Aus Daten entwerfen',
|
|
892
|
+
autoDesignHint: 'Erstellt eine übersichtliche Liste Ihrer Daten mit Überschriften, Summen und Seitenzahlen. Rückgängig stellt Ihren Entwurf wieder her.',
|
|
893
|
+
newReportTitle: 'Bericht',
|
|
894
|
+
totalLabel: 'Summe',
|
|
895
|
+
pageOfFormat: 'Seite {0} von {1}',
|
|
896
|
+
issueOutsidePage: 'ragt über den Papierrand hinaus',
|
|
897
|
+
issueFormulaError: 'hat einen Formelfehler: {0}',
|
|
898
|
+
issueUnknownField: 'verwendet „{0}“, das nicht in den Daten ist',
|
|
899
|
+
issueEmptyFormula: 'hat eine leere Formel',
|
|
900
|
+
issueOverlap: 'überlappt {0}',
|
|
901
|
+
fixIt: 'Beheben',
|
|
902
|
+
noProblems: 'Keine Probleme gefunden.',
|
|
903
|
+
chartType: 'Diagrammtyp',
|
|
904
|
+
chartColumn: 'Säulen',
|
|
905
|
+
chartBar: 'Balken',
|
|
906
|
+
chartLine: 'Linie',
|
|
907
|
+
chartPie: 'Kreis',
|
|
908
|
+
chartDoughnut: 'Ring',
|
|
909
|
+
chartCategory: 'Gruppieren nach',
|
|
910
|
+
chartValue: 'Wert',
|
|
911
|
+
chartAggregate: 'Berechnung',
|
|
912
|
+
aggSum: 'Summe',
|
|
913
|
+
aggCount: 'Anzahl',
|
|
914
|
+
aggAvg: 'Durchschnitt',
|
|
915
|
+
aggMin: 'Kleinster',
|
|
916
|
+
aggMax: 'Größter',
|
|
917
|
+
chartTitle: 'Titel',
|
|
918
|
+
showValues: 'Werte anzeigen',
|
|
919
|
+
showLegend: 'Legende anzeigen',
|
|
920
|
+
chartHint: 'Ein Diagramm zeigt die Zeilen seines Abschnitts: alle Zeilen im Berichtskopf oder -fuß, die Zeilen der Gruppe im Gruppenfuß.',
|
|
921
|
+
conditionalFormatting: 'Bedingte Formatierung',
|
|
922
|
+
watermark: 'Wasserzeichen',
|
|
923
|
+
reportLocale: 'Sprache und Region',
|
|
924
|
+
reportLocaleRegion: 'Zahlen und Datumsangaben',
|
|
925
|
+
reportCurrency: 'Währung',
|
|
926
|
+
reportLocaleDefault: 'App-Standard',
|
|
927
|
+
reportLocaleHint: 'Wie dieser Bericht Zahlen, Datumsangaben, Geld und Beträge in Worten schreibt, egal wo er gedruckt wird.',
|
|
928
|
+
formulaEditor: 'Formeleditor',
|
|
929
|
+
formulaEditorHint: 'Klicken Sie auf ein Feld oder eine Funktion, um es an der Cursorposition einzufügen.',
|
|
930
|
+
formulaResult: 'Ergebnis für die erste Zeile',
|
|
931
|
+
formulaEmpty: '(leer)',
|
|
932
|
+
apply: 'Übernehmen',
|
|
933
|
+
cancel: 'Abbrechen',
|
|
934
|
+
fnLogic: 'Logik',
|
|
935
|
+
fnText: 'Text',
|
|
936
|
+
fnNumber: 'Zahl',
|
|
937
|
+
fnDate: 'Datum',
|
|
938
|
+
fnAggregate: 'Summen',
|
|
939
|
+
functions: 'Funktionen',
|
|
940
|
+
openFormulaEditor: 'Formeleditor öffnen',
|
|
941
|
+
functionHelp: {
|
|
942
|
+
Iif: 'Wählt zwischen zwei Werten: den ersten, wenn die Bedingung wahr ist, sonst den zweiten.',
|
|
943
|
+
IsNull: 'Der Wert oder der Ersatzwert, wenn er leer ist.',
|
|
944
|
+
Concat: 'Verbindet Texte.',
|
|
945
|
+
Len: 'Anzahl der Zeichen.',
|
|
946
|
+
Upper: 'GROSSBUCHSTABEN (türkisches İ/ı berücksichtigt).',
|
|
947
|
+
Lower: 'Kleinbuchstaben (türkisches İ/ı berücksichtigt).',
|
|
948
|
+
Trim: 'Entfernt Leerzeichen an beiden Enden.',
|
|
949
|
+
Substring: 'Teil eines Textes ab einer Position (0 = erstes Zeichen).',
|
|
950
|
+
Replace: 'Ersetzt jedes Vorkommen eines Textes.',
|
|
951
|
+
Contains: 'Wahr, wenn der Text den Teil enthält.',
|
|
952
|
+
StartsWith: 'Wahr, wenn der Text mit dem Teil beginnt.',
|
|
953
|
+
EndsWith: 'Wahr, wenn der Text mit dem Teil endet.',
|
|
954
|
+
ToString: 'Der Wert als Text.',
|
|
955
|
+
Format: "Zeigt einen Wert mit einem Muster, z. B. 'n2' oder 'dd.MM.yyyy'.",
|
|
956
|
+
AmountInWords: 'Ein Betrag in Worten mit Währung, für Rechnungen und Schecks.',
|
|
957
|
+
NumberToWords: 'Eine ganze Zahl in Worten.',
|
|
958
|
+
Round: 'Rundet auf die angegebenen Nachkommastellen.',
|
|
959
|
+
Abs: 'Die Zahl ohne Vorzeichen.',
|
|
960
|
+
Floor: 'Rundet auf eine ganze Zahl ab.',
|
|
961
|
+
Ceiling: 'Rundet auf eine ganze Zahl auf.',
|
|
962
|
+
ToNumber: 'Liest eine Zahl aus Text.',
|
|
963
|
+
Today: 'Das Druckdatum (ohne Uhrzeit).',
|
|
964
|
+
Now: 'Druckdatum und -uhrzeit.',
|
|
965
|
+
Year: 'Jahr eines Datums.',
|
|
966
|
+
Month: 'Monat eines Datums (1–12).',
|
|
967
|
+
Day: 'Tag des Monats.',
|
|
968
|
+
AddDays: 'Ein um Tage verschobenes Datum, z. B. ein Fälligkeitsdatum.',
|
|
969
|
+
Sum: 'Summe über die Zeilen im Bereich (Gruppe, Seite oder Bericht).',
|
|
970
|
+
Count: 'Anzahl der Zeilen im Bereich.',
|
|
971
|
+
Avg: 'Durchschnitt über die Zeilen im Bereich.',
|
|
972
|
+
Min: 'Kleinster Wert im Bereich (oder von zwei Werten).',
|
|
973
|
+
Max: 'Größter Wert im Bereich (oder von zwei Werten).',
|
|
974
|
+
},
|
|
975
|
+
watermarkHint: 'Großer, blasser Text hinter jeder Seite, z. B. ENTWURF oder BEZAHLT. Kann aus den Daten kommen.',
|
|
976
|
+
watermarkAngle: 'Richtung',
|
|
977
|
+
conditionalHint: 'Ändert das Aussehen, wenn eine Bedingung zutrifft, z. B. negative Beträge in Rot.',
|
|
978
|
+
addRule: 'Regel hinzufügen',
|
|
979
|
+
ruleWhen: 'Wenn',
|
|
980
|
+
ruleThen: 'Dann',
|
|
981
|
+
removeRule: 'Regel entfernen',
|
|
982
|
+
opContains: 'enthält',
|
|
983
|
+
ruleValue: 'Wert',
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
/** Français. */
|
|
987
|
+
const weReportLocaleFr = {
|
|
988
|
+
designerLabel: 'Surface de conception du rapport',
|
|
989
|
+
bandNames: {
|
|
990
|
+
reportHeader: 'En-tête de rapport',
|
|
991
|
+
pageHeader: 'En-tête de page',
|
|
992
|
+
groupHeader: 'En-tête de groupe',
|
|
993
|
+
detail: 'Détail (répété pour chaque ligne)',
|
|
994
|
+
groupFooter: 'Pied de groupe',
|
|
995
|
+
pageFooter: 'Pied de page',
|
|
996
|
+
reportFooter: 'Pied de rapport',
|
|
997
|
+
},
|
|
998
|
+
controlNames: {
|
|
999
|
+
text: 'Texte',
|
|
1000
|
+
line: 'Ligne',
|
|
1001
|
+
shape: 'Forme',
|
|
1002
|
+
image: 'Image',
|
|
1003
|
+
barcode: 'Code-barres',
|
|
1004
|
+
pageInfo: 'Numéro de page / date',
|
|
1005
|
+
checkbox: 'Case à cocher',
|
|
1006
|
+
chart: 'Graphique',
|
|
1007
|
+
},
|
|
1008
|
+
zoomIn: 'Zoom avant',
|
|
1009
|
+
zoomOut: 'Zoom arrière',
|
|
1010
|
+
print: 'Imprimer',
|
|
1011
|
+
downloadPdf: 'Télécharger le PDF',
|
|
1012
|
+
downloadExcel: 'Excel',
|
|
1013
|
+
pageCount: '{0} page(s)',
|
|
1014
|
+
problems: 'Problèmes',
|
|
1015
|
+
loading: 'Préparation de l’aperçu…',
|
|
1016
|
+
layoutError: 'Le rapport n’a pas pu être préparé',
|
|
1017
|
+
runReport: 'Exécuter le rapport',
|
|
1018
|
+
dataLoadError: 'Les données n’ont pas pu être chargées',
|
|
1019
|
+
design: 'Conception',
|
|
1020
|
+
preview: 'Aperçu',
|
|
1021
|
+
undo: 'Annuler',
|
|
1022
|
+
redo: 'Rétablir',
|
|
1023
|
+
delete: 'Supprimer',
|
|
1024
|
+
duplicate: 'Dupliquer',
|
|
1025
|
+
cut: 'Couper',
|
|
1026
|
+
copy: 'Copier',
|
|
1027
|
+
paste: 'Coller',
|
|
1028
|
+
selectAll: 'Tout sélectionner',
|
|
1029
|
+
arrange: 'Disposer',
|
|
1030
|
+
arrangeLeft: 'Aligner les bords gauches',
|
|
1031
|
+
arrangeCenter: 'Aligner les centres',
|
|
1032
|
+
arrangeRight: 'Aligner les bords droits',
|
|
1033
|
+
arrangeTop: 'Aligner les bords supérieurs',
|
|
1034
|
+
arrangeMiddle: 'Aligner les milieux',
|
|
1035
|
+
arrangeBottom: 'Aligner les bords inférieurs',
|
|
1036
|
+
distributeH: 'Répartir horizontalement',
|
|
1037
|
+
distributeV: 'Répartir verticalement',
|
|
1038
|
+
sameWidth: 'Même largeur',
|
|
1039
|
+
sameHeight: 'Même hauteur',
|
|
1040
|
+
bringToFront: 'Mettre au premier plan',
|
|
1041
|
+
sendToBack: 'Mettre à l’arrière-plan',
|
|
1042
|
+
arrangeHint: 'Sélectionnez au moins deux éléments pour les aligner ; le premier cliqué reste en place.',
|
|
1043
|
+
explorer: 'Plan',
|
|
1044
|
+
itemsSelected: '{0} éléments sélectionnés',
|
|
1045
|
+
explorerHint: 'Tout le contenu du rapport, section par section. Cliquez pour sélectionner.',
|
|
1046
|
+
emptyBand: '(vide)',
|
|
1047
|
+
add: 'Ajouter',
|
|
1048
|
+
data: 'Données',
|
|
1049
|
+
fitWidth: 'Ajuster à la largeur',
|
|
1050
|
+
basicMode: 'Simple',
|
|
1051
|
+
advancedMode: 'Avancé',
|
|
1052
|
+
toolbox: 'Ajouter au rapport',
|
|
1053
|
+
toolboxHint: 'Faites glisser un élément sur la page.',
|
|
1054
|
+
fields: 'Champs de données',
|
|
1055
|
+
fieldsHint: 'Faites glisser un champ sur la page pour afficher sa valeur.',
|
|
1056
|
+
parentFields: 'Champs du document',
|
|
1057
|
+
noFields: 'Pas encore de données. Connectez des données pour voir leurs champs ici.',
|
|
1058
|
+
properties: 'Propriétés',
|
|
1059
|
+
addBand: 'Ajouter une section',
|
|
1060
|
+
removeBand: 'Supprimer la section',
|
|
1061
|
+
groupBy: 'Grouper par',
|
|
1062
|
+
newText: 'Texte',
|
|
1063
|
+
showData: 'Afficher les données',
|
|
1064
|
+
groupLayout: 'Position et taille',
|
|
1065
|
+
groupContent: 'Contenu',
|
|
1066
|
+
groupAppearance: 'Apparence',
|
|
1067
|
+
groupBehaviour: 'Comportement',
|
|
1068
|
+
groupPage: 'Page',
|
|
1069
|
+
groupData: 'Données',
|
|
1070
|
+
reportName: 'Nom du rapport',
|
|
1071
|
+
paper: 'Papier',
|
|
1072
|
+
orientation: 'Orientation',
|
|
1073
|
+
portrait: 'Portrait',
|
|
1074
|
+
landscape: 'Paysage',
|
|
1075
|
+
customSize: 'Taille personnalisée',
|
|
1076
|
+
width: 'Largeur',
|
|
1077
|
+
height: 'Hauteur',
|
|
1078
|
+
margins: 'Marges',
|
|
1079
|
+
marginTop: 'Haut',
|
|
1080
|
+
marginRight: 'Droite',
|
|
1081
|
+
marginBottom: 'Bas',
|
|
1082
|
+
marginLeft: 'Gauche',
|
|
1083
|
+
left: 'Depuis la gauche',
|
|
1084
|
+
top: 'Depuis le haut',
|
|
1085
|
+
content: 'Contenu',
|
|
1086
|
+
staticText: 'Texte fixe',
|
|
1087
|
+
fromData: 'Depuis les données',
|
|
1088
|
+
expression: 'Formule',
|
|
1089
|
+
expressionHint: 'Champs entre crochets, ex. [Prix] * [Quantité]',
|
|
1090
|
+
format: 'Afficher comme',
|
|
1091
|
+
formatNone: 'Tel quel',
|
|
1092
|
+
formatNumber0: 'Nombre (1 235)',
|
|
1093
|
+
formatNumber2: 'Nombre (1 234,50)',
|
|
1094
|
+
formatCurrency: 'Monnaie',
|
|
1095
|
+
formatPercent: 'Pourcentage',
|
|
1096
|
+
formatDate: 'Date',
|
|
1097
|
+
formatDateTime: 'Date et heure',
|
|
1098
|
+
font: 'Police',
|
|
1099
|
+
fontSize: 'Taille',
|
|
1100
|
+
bold: 'Gras',
|
|
1101
|
+
italic: 'Italique',
|
|
1102
|
+
underline: 'Souligné',
|
|
1103
|
+
alignment: 'Alignement',
|
|
1104
|
+
alignLeft: 'Gauche',
|
|
1105
|
+
alignCenter: 'Centre',
|
|
1106
|
+
alignRight: 'Droite',
|
|
1107
|
+
verticalAlignment: 'Alignement vertical',
|
|
1108
|
+
alignTop: 'Haut',
|
|
1109
|
+
alignMiddle: 'Milieu',
|
|
1110
|
+
alignBottom: 'Bas',
|
|
1111
|
+
textColor: 'Couleur du texte',
|
|
1112
|
+
backgroundColor: 'Arrière-plan',
|
|
1113
|
+
noColor: 'Aucune',
|
|
1114
|
+
border: 'Bordure',
|
|
1115
|
+
borderWidth: 'Épaisseur de bordure',
|
|
1116
|
+
borderColor: 'Couleur de bordure',
|
|
1117
|
+
padding: 'Marge intérieure',
|
|
1118
|
+
canGrow: 'Agrandir selon le texte',
|
|
1119
|
+
canGrowHint: 'Un texte long agrandit la ligne au lieu d’être coupé.',
|
|
1120
|
+
visibleWhen: 'Afficher seulement si',
|
|
1121
|
+
visibleWhenHint: 'Une formule ; l’élément est masqué quand elle est fausse, ex. [Total] > 0',
|
|
1122
|
+
symbology: 'Type de code-barres',
|
|
1123
|
+
barcodeValue: 'Valeur',
|
|
1124
|
+
showText: 'Afficher les chiffres sous le code',
|
|
1125
|
+
imageSource: 'Image',
|
|
1126
|
+
chooseImage: 'Choisir une image…',
|
|
1127
|
+
fit: 'Ajustement',
|
|
1128
|
+
fitContain: 'Contenir',
|
|
1129
|
+
fitCover: 'Remplir (rogner)',
|
|
1130
|
+
fitStretch: 'Étirer',
|
|
1131
|
+
fitNone: 'Taille d’origine',
|
|
1132
|
+
lineDirection: 'Direction',
|
|
1133
|
+
horizontal: 'Horizontale',
|
|
1134
|
+
vertical: 'Verticale',
|
|
1135
|
+
diagonalDown: 'Diagonale ↘',
|
|
1136
|
+
diagonalUp: 'Diagonale ↗',
|
|
1137
|
+
lineWidth: 'Épaisseur',
|
|
1138
|
+
color: 'Couleur',
|
|
1139
|
+
shape: 'Forme',
|
|
1140
|
+
rectangle: 'Rectangle',
|
|
1141
|
+
roundedRectangle: 'Rectangle arrondi',
|
|
1142
|
+
ellipse: 'Ellipse',
|
|
1143
|
+
cornerRadius: 'Arrondi des coins',
|
|
1144
|
+
pageInfo: 'Affiche',
|
|
1145
|
+
pageNumber: 'Numéro de page',
|
|
1146
|
+
pageTotal: 'Nombre de pages',
|
|
1147
|
+
pageNofM: 'Page X sur Y',
|
|
1148
|
+
printDate: 'Date d’impression',
|
|
1149
|
+
checked: 'Cochée quand',
|
|
1150
|
+
bandHeight: 'Hauteur de section',
|
|
1151
|
+
sortGroups: 'Ordre des groupes',
|
|
1152
|
+
sortAsc: 'A → Z',
|
|
1153
|
+
sortDesc: 'Z → A',
|
|
1154
|
+
sortNone: 'Comme dans les données',
|
|
1155
|
+
keepTogether: 'Garder le groupe sur une page',
|
|
1156
|
+
keepTogetherHint: 'Déplace tout le groupe sur la page suivante au lieu de le couper.',
|
|
1157
|
+
repeatOnEveryPage: 'Répéter sur chaque page',
|
|
1158
|
+
pageBreakBefore: 'Commencer sur une nouvelle page',
|
|
1159
|
+
pageBreakAfter: 'Nouvelle page après',
|
|
1160
|
+
dataRows: 'Les lignes viennent de',
|
|
1161
|
+
dataRowsHint: 'Chemin de la liste dans les données, ex. lines',
|
|
1162
|
+
dataSources: 'Sources de données',
|
|
1163
|
+
close: 'Fermer',
|
|
1164
|
+
rowsSource: 'lignes',
|
|
1165
|
+
noSources: 'Pas encore de source de données. Ajoutez-en une à gauche.',
|
|
1166
|
+
webService: 'Service web',
|
|
1167
|
+
parameters: 'Paramètres',
|
|
1168
|
+
parametersHint: 'Demandés avant l’exécution. Utilisez [?nom] dans les formules et {{nom}} dans les adresses de service web.',
|
|
1169
|
+
parameterName: 'Nom du paramètre',
|
|
1170
|
+
parameterType: 'Type',
|
|
1171
|
+
parameterLabel: 'Libellé affiché',
|
|
1172
|
+
defaultValue: 'Valeur par défaut',
|
|
1173
|
+
addParameter: 'Ajouter un paramètre',
|
|
1174
|
+
sourceName: 'Nom',
|
|
1175
|
+
wholeData: '(toutes les données)',
|
|
1176
|
+
rowCount: '{0} ligne(s)',
|
|
1177
|
+
useForRows: 'Utiliser cette source pour les lignes du rapport',
|
|
1178
|
+
jsonData: 'Données JSON',
|
|
1179
|
+
invalidJson: 'Ce n’est pas du JSON valide',
|
|
1180
|
+
csvData: 'Collez un tableau CSV ou Excel avec sa ligne d’en-tête',
|
|
1181
|
+
method: 'Méthode',
|
|
1182
|
+
url: 'Adresse (URL)',
|
|
1183
|
+
test: 'Tester',
|
|
1184
|
+
testing: 'Test en cours…',
|
|
1185
|
+
testOk: 'Ça marche : {0} ligne(s) trouvée(s). La réponse est enregistrée pour la conception.',
|
|
1186
|
+
headers: 'En-têtes',
|
|
1187
|
+
headerName: 'Nom de l’en-tête',
|
|
1188
|
+
headerValue: 'Valeur de l’en-tête',
|
|
1189
|
+
addHeader: 'Ajouter un en-tête',
|
|
1190
|
+
requestBody: 'Corps de la requête',
|
|
1191
|
+
secretWarning: 'Tout ce qui est écrit ici est visible dans le navigateur et enregistré dans le fichier du rapport. Pour des clés secrètes, appelez le service via votre backend.',
|
|
1192
|
+
removeSource: 'Supprimer cette source de données',
|
|
1193
|
+
typeText: 'Texte',
|
|
1194
|
+
typeNumber: 'Nombre',
|
|
1195
|
+
typeDate: 'Date',
|
|
1196
|
+
typeYesNo: 'Oui / non',
|
|
1197
|
+
database: 'Base de données',
|
|
1198
|
+
backendAddress: 'Adresse du backend de données',
|
|
1199
|
+
connect: 'Connecter',
|
|
1200
|
+
connected: 'Connecté – {0} connexion(s) disponible(s).',
|
|
1201
|
+
connection: 'Connexion',
|
|
1202
|
+
writeSql: 'Écrire le SQL moi-même',
|
|
1203
|
+
sqlHint: 'Une seule instruction SELECT. Utilisez :nom pour les paramètres du rapport.',
|
|
1204
|
+
table: 'Table',
|
|
1205
|
+
columns: 'Colonnes',
|
|
1206
|
+
filters: 'Seulement les lignes où',
|
|
1207
|
+
fixedValue: 'Valeur…',
|
|
1208
|
+
addFilter: 'Ajouter une condition',
|
|
1209
|
+
sortBy: 'Trier par',
|
|
1210
|
+
maxRows: 'Lignes max.',
|
|
1211
|
+
opLike: 'contient (like)',
|
|
1212
|
+
opIsEmpty: 'est vide',
|
|
1213
|
+
opIsNotEmpty: 'n’est pas vide',
|
|
1214
|
+
rowLimitReached: '(limite de lignes atteinte – il en existe d’autres)',
|
|
1215
|
+
viaBackend: 'Appeler via le backend de données',
|
|
1216
|
+
viaBackendHint: 'À utiliser quand le service bloque les appels du navigateur (CORS) ou exige une clé secrète.',
|
|
1217
|
+
autoDesign: 'Concevoir à partir des données',
|
|
1218
|
+
autoDesignHint: 'Crée une liste claire de vos données avec en-têtes, totaux et numéros de page. Annuler rétablit votre conception.',
|
|
1219
|
+
newReportTitle: 'Rapport',
|
|
1220
|
+
totalLabel: 'Total',
|
|
1221
|
+
pageOfFormat: 'Page {0} sur {1}',
|
|
1222
|
+
issueOutsidePage: 'dépasse le bord du papier',
|
|
1223
|
+
issueFormulaError: 'a une erreur de formule : {0}',
|
|
1224
|
+
issueUnknownField: 'utilise « {0} », absent des données',
|
|
1225
|
+
issueEmptyFormula: 'a une formule vide',
|
|
1226
|
+
issueOverlap: 'chevauche {0}',
|
|
1227
|
+
fixIt: 'Corriger',
|
|
1228
|
+
noProblems: 'Aucun problème trouvé.',
|
|
1229
|
+
chartType: 'Type de graphique',
|
|
1230
|
+
chartColumn: 'Colonnes',
|
|
1231
|
+
chartBar: 'Barres',
|
|
1232
|
+
chartLine: 'Ligne',
|
|
1233
|
+
chartPie: 'Secteurs',
|
|
1234
|
+
chartDoughnut: 'Anneau',
|
|
1235
|
+
chartCategory: 'Grouper par',
|
|
1236
|
+
chartValue: 'Valeur',
|
|
1237
|
+
chartAggregate: 'Calcul',
|
|
1238
|
+
aggSum: 'Total',
|
|
1239
|
+
aggCount: 'Nombre',
|
|
1240
|
+
aggAvg: 'Moyenne',
|
|
1241
|
+
aggMin: 'Plus petit',
|
|
1242
|
+
aggMax: 'Plus grand',
|
|
1243
|
+
chartTitle: 'Titre',
|
|
1244
|
+
showValues: 'Afficher les valeurs',
|
|
1245
|
+
showLegend: 'Afficher la légende',
|
|
1246
|
+
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.',
|
|
1247
|
+
conditionalFormatting: 'Mise en forme conditionnelle',
|
|
1248
|
+
watermark: 'Filigrane',
|
|
1249
|
+
reportLocale: 'Langue et région',
|
|
1250
|
+
reportLocaleRegion: 'Nombres et dates',
|
|
1251
|
+
reportCurrency: 'Devise',
|
|
1252
|
+
reportLocaleDefault: 'Réglage de l’application',
|
|
1253
|
+
reportLocaleHint: 'Comment ce rapport écrit les nombres, les dates, la monnaie et les montants en lettres, où qu’il soit imprimé.',
|
|
1254
|
+
formulaEditor: 'Éditeur de formules',
|
|
1255
|
+
formulaEditorHint: 'Cliquez sur un champ ou une fonction pour l’insérer à la position du curseur.',
|
|
1256
|
+
formulaResult: 'Résultat pour la première ligne',
|
|
1257
|
+
formulaEmpty: '(vide)',
|
|
1258
|
+
apply: 'Appliquer',
|
|
1259
|
+
cancel: 'Annuler',
|
|
1260
|
+
fnLogic: 'Logique',
|
|
1261
|
+
fnText: 'Texte',
|
|
1262
|
+
fnNumber: 'Nombre',
|
|
1263
|
+
fnDate: 'Date',
|
|
1264
|
+
fnAggregate: 'Totaux',
|
|
1265
|
+
functions: 'Fonctions',
|
|
1266
|
+
openFormulaEditor: 'Ouvrir l’éditeur de formules',
|
|
1267
|
+
functionHelp: {
|
|
1268
|
+
Iif: 'Choisit entre deux valeurs : la première si la condition est vraie, sinon la seconde.',
|
|
1269
|
+
IsNull: 'La valeur, ou la valeur de repli si elle est vide.',
|
|
1270
|
+
Concat: 'Assemble des textes.',
|
|
1271
|
+
Len: 'Nombre de caractères.',
|
|
1272
|
+
Upper: 'MAJUSCULES (İ/ı turcs gérés).',
|
|
1273
|
+
Lower: 'minuscules (İ/ı turcs gérés).',
|
|
1274
|
+
Trim: 'Supprime les espaces aux deux extrémités.',
|
|
1275
|
+
Substring: 'Partie d’un texte à partir d’une position (0 = premier caractère).',
|
|
1276
|
+
Replace: 'Remplace chaque occurrence d’un texte.',
|
|
1277
|
+
Contains: 'Vrai si le texte contient la partie.',
|
|
1278
|
+
StartsWith: 'Vrai si le texte commence par la partie.',
|
|
1279
|
+
EndsWith: 'Vrai si le texte se termine par la partie.',
|
|
1280
|
+
ToString: 'La valeur en texte.',
|
|
1281
|
+
Format: "Affiche une valeur selon un modèle, ex. 'n2' ou 'dd.MM.yyyy'.",
|
|
1282
|
+
AmountInWords: 'Un montant en lettres avec sa devise, pour factures et chèques.',
|
|
1283
|
+
NumberToWords: 'Un nombre entier en lettres.',
|
|
1284
|
+
Round: 'Arrondit au nombre de décimales indiqué.',
|
|
1285
|
+
Abs: 'Le nombre sans son signe.',
|
|
1286
|
+
Floor: 'Arrondit à l’entier inférieur.',
|
|
1287
|
+
Ceiling: 'Arrondit à l’entier supérieur.',
|
|
1288
|
+
ToNumber: 'Lit un nombre dans un texte.',
|
|
1289
|
+
Today: 'La date d’impression (sans l’heure).',
|
|
1290
|
+
Now: 'La date et l’heure d’impression.',
|
|
1291
|
+
Year: 'Année d’une date.',
|
|
1292
|
+
Month: 'Mois d’une date (1–12).',
|
|
1293
|
+
Day: 'Jour du mois.',
|
|
1294
|
+
AddDays: 'Une date décalée d’un nombre de jours, ex. une échéance.',
|
|
1295
|
+
Sum: 'Total des lignes concernées (groupe, page ou rapport).',
|
|
1296
|
+
Count: 'Nombre de lignes concernées.',
|
|
1297
|
+
Avg: 'Moyenne des lignes concernées.',
|
|
1298
|
+
Min: 'Plus petite valeur des lignes concernées (ou de deux valeurs).',
|
|
1299
|
+
Max: 'Plus grande valeur des lignes concernées (ou de deux valeurs).',
|
|
1300
|
+
},
|
|
1301
|
+
watermarkHint: 'Grand texte pâle derrière chaque page, ex. BROUILLON ou PAYÉ. Peut venir des données.',
|
|
1302
|
+
watermarkAngle: 'Direction',
|
|
1303
|
+
conditionalHint: 'Change l’apparence quand une condition est vraie, ex. montants négatifs en rouge.',
|
|
1304
|
+
addRule: 'Ajouter une règle',
|
|
1305
|
+
ruleWhen: 'Quand',
|
|
1306
|
+
ruleThen: 'Alors',
|
|
1307
|
+
removeRule: 'Supprimer la règle',
|
|
1308
|
+
opContains: 'contient',
|
|
1309
|
+
ruleValue: 'Valeur',
|
|
1310
|
+
};
|
|
1311
|
+
|
|
1312
|
+
/** Español. */
|
|
1313
|
+
const weReportLocaleEs = {
|
|
1314
|
+
designerLabel: 'Superficie de diseño del informe',
|
|
1315
|
+
bandNames: {
|
|
1316
|
+
reportHeader: 'Encabezado del informe',
|
|
1317
|
+
pageHeader: 'Encabezado de página',
|
|
1318
|
+
groupHeader: 'Encabezado de grupo',
|
|
1319
|
+
detail: 'Detalle (se repite en cada fila)',
|
|
1320
|
+
groupFooter: 'Pie de grupo',
|
|
1321
|
+
pageFooter: 'Pie de página',
|
|
1322
|
+
reportFooter: 'Pie del informe',
|
|
1323
|
+
},
|
|
1324
|
+
controlNames: {
|
|
1325
|
+
text: 'Texto',
|
|
1326
|
+
line: 'Línea',
|
|
1327
|
+
shape: 'Forma',
|
|
1328
|
+
image: 'Imagen',
|
|
1329
|
+
barcode: 'Código de barras',
|
|
1330
|
+
pageInfo: 'Número de página / fecha',
|
|
1331
|
+
checkbox: 'Casilla',
|
|
1332
|
+
chart: 'Gráfico',
|
|
1333
|
+
},
|
|
1334
|
+
zoomIn: 'Acercar',
|
|
1335
|
+
zoomOut: 'Alejar',
|
|
1336
|
+
print: 'Imprimir',
|
|
1337
|
+
downloadPdf: 'Descargar PDF',
|
|
1338
|
+
downloadExcel: 'Excel',
|
|
1339
|
+
pageCount: '{0} página(s)',
|
|
1340
|
+
problems: 'Problemas',
|
|
1341
|
+
loading: 'Preparando la vista previa…',
|
|
1342
|
+
layoutError: 'No se pudo preparar el informe',
|
|
1343
|
+
runReport: 'Ejecutar informe',
|
|
1344
|
+
dataLoadError: 'No se pudieron cargar los datos',
|
|
1345
|
+
design: 'Diseño',
|
|
1346
|
+
preview: 'Vista previa',
|
|
1347
|
+
undo: 'Deshacer',
|
|
1348
|
+
redo: 'Rehacer',
|
|
1349
|
+
delete: 'Eliminar',
|
|
1350
|
+
duplicate: 'Duplicar',
|
|
1351
|
+
cut: 'Cortar',
|
|
1352
|
+
copy: 'Copiar',
|
|
1353
|
+
paste: 'Pegar',
|
|
1354
|
+
selectAll: 'Seleccionar todo',
|
|
1355
|
+
arrange: 'Organizar',
|
|
1356
|
+
arrangeLeft: 'Alinear bordes izquierdos',
|
|
1357
|
+
arrangeCenter: 'Alinear centros',
|
|
1358
|
+
arrangeRight: 'Alinear bordes derechos',
|
|
1359
|
+
arrangeTop: 'Alinear bordes superiores',
|
|
1360
|
+
arrangeMiddle: 'Alinear medios',
|
|
1361
|
+
arrangeBottom: 'Alinear bordes inferiores',
|
|
1362
|
+
distributeH: 'Distribuir horizontalmente',
|
|
1363
|
+
distributeV: 'Distribuir verticalmente',
|
|
1364
|
+
sameWidth: 'Mismo ancho',
|
|
1365
|
+
sameHeight: 'Misma altura',
|
|
1366
|
+
bringToFront: 'Traer al frente',
|
|
1367
|
+
sendToBack: 'Enviar al fondo',
|
|
1368
|
+
arrangeHint: 'Seleccione dos o más elementos para alinearlos; el primero que pulsó se queda en su sitio.',
|
|
1369
|
+
explorer: 'Esquema',
|
|
1370
|
+
itemsSelected: '{0} elementos seleccionados',
|
|
1371
|
+
explorerHint: 'Todo el contenido del informe, sección por sección. Pulse para seleccionar.',
|
|
1372
|
+
emptyBand: '(vacío)',
|
|
1373
|
+
add: 'Añadir',
|
|
1374
|
+
data: 'Datos',
|
|
1375
|
+
fitWidth: 'Ajustar al ancho',
|
|
1376
|
+
basicMode: 'Básico',
|
|
1377
|
+
advancedMode: 'Avanzado',
|
|
1378
|
+
toolbox: 'Añadir al informe',
|
|
1379
|
+
toolboxHint: 'Arrastre un elemento a la página.',
|
|
1380
|
+
fields: 'Campos de datos',
|
|
1381
|
+
fieldsHint: 'Arrastre un campo a la página para mostrar su valor.',
|
|
1382
|
+
parentFields: 'Campos del documento',
|
|
1383
|
+
noFields: 'Aún no hay datos. Conecte datos para ver sus campos aquí.',
|
|
1384
|
+
properties: 'Propiedades',
|
|
1385
|
+
addBand: 'Añadir sección',
|
|
1386
|
+
removeBand: 'Quitar sección',
|
|
1387
|
+
groupBy: 'Agrupar por',
|
|
1388
|
+
newText: 'Texto',
|
|
1389
|
+
showData: 'Mostrar datos',
|
|
1390
|
+
groupLayout: 'Posición y tamaño',
|
|
1391
|
+
groupContent: 'Contenido',
|
|
1392
|
+
groupAppearance: 'Apariencia',
|
|
1393
|
+
groupBehaviour: 'Comportamiento',
|
|
1394
|
+
groupPage: 'Página',
|
|
1395
|
+
groupData: 'Datos',
|
|
1396
|
+
reportName: 'Nombre del informe',
|
|
1397
|
+
paper: 'Papel',
|
|
1398
|
+
orientation: 'Orientación',
|
|
1399
|
+
portrait: 'Vertical',
|
|
1400
|
+
landscape: 'Horizontal',
|
|
1401
|
+
customSize: 'Tamaño personalizado',
|
|
1402
|
+
width: 'Ancho',
|
|
1403
|
+
height: 'Alto',
|
|
1404
|
+
margins: 'Márgenes',
|
|
1405
|
+
marginTop: 'Superior',
|
|
1406
|
+
marginRight: 'Derecho',
|
|
1407
|
+
marginBottom: 'Inferior',
|
|
1408
|
+
marginLeft: 'Izquierdo',
|
|
1409
|
+
left: 'Desde la izquierda',
|
|
1410
|
+
top: 'Desde arriba',
|
|
1411
|
+
content: 'Contenido',
|
|
1412
|
+
staticText: 'Texto fijo',
|
|
1413
|
+
fromData: 'Desde los datos',
|
|
1414
|
+
expression: 'Fórmula',
|
|
1415
|
+
expressionHint: 'Campos entre corchetes, p. ej. [Precio] * [Cantidad]',
|
|
1416
|
+
format: 'Mostrar como',
|
|
1417
|
+
formatNone: 'Tal cual',
|
|
1418
|
+
formatNumber0: 'Número (1.235)',
|
|
1419
|
+
formatNumber2: 'Número (1.234,50)',
|
|
1420
|
+
formatCurrency: 'Moneda',
|
|
1421
|
+
formatPercent: 'Porcentaje',
|
|
1422
|
+
formatDate: 'Fecha',
|
|
1423
|
+
formatDateTime: 'Fecha y hora',
|
|
1424
|
+
font: 'Fuente',
|
|
1425
|
+
fontSize: 'Tamaño',
|
|
1426
|
+
bold: 'Negrita',
|
|
1427
|
+
italic: 'Cursiva',
|
|
1428
|
+
underline: 'Subrayado',
|
|
1429
|
+
alignment: 'Alineación',
|
|
1430
|
+
alignLeft: 'Izquierda',
|
|
1431
|
+
alignCenter: 'Centro',
|
|
1432
|
+
alignRight: 'Derecha',
|
|
1433
|
+
verticalAlignment: 'Alineación vertical',
|
|
1434
|
+
alignTop: 'Arriba',
|
|
1435
|
+
alignMiddle: 'Medio',
|
|
1436
|
+
alignBottom: 'Abajo',
|
|
1437
|
+
textColor: 'Color del texto',
|
|
1438
|
+
backgroundColor: 'Fondo',
|
|
1439
|
+
noColor: 'Ninguno',
|
|
1440
|
+
border: 'Borde',
|
|
1441
|
+
borderWidth: 'Grosor del borde',
|
|
1442
|
+
borderColor: 'Color del borde',
|
|
1443
|
+
padding: 'Espaciado interior',
|
|
1444
|
+
canGrow: 'Crecer según el texto',
|
|
1445
|
+
canGrowHint: 'Un texto largo hace la fila más alta en lugar de cortarse.',
|
|
1446
|
+
visibleWhen: 'Mostrar solo si',
|
|
1447
|
+
visibleWhenHint: 'Una fórmula; el elemento se oculta cuando es falsa, p. ej. [Total] > 0',
|
|
1448
|
+
symbology: 'Tipo de código de barras',
|
|
1449
|
+
barcodeValue: 'Valor',
|
|
1450
|
+
showText: 'Mostrar los dígitos bajo el código',
|
|
1451
|
+
imageSource: 'Imagen',
|
|
1452
|
+
chooseImage: 'Elegir imagen…',
|
|
1453
|
+
fit: 'Ajuste',
|
|
1454
|
+
fitContain: 'Encajar',
|
|
1455
|
+
fitCover: 'Rellenar (recortar)',
|
|
1456
|
+
fitStretch: 'Estirar',
|
|
1457
|
+
fitNone: 'Tamaño original',
|
|
1458
|
+
lineDirection: 'Dirección',
|
|
1459
|
+
horizontal: 'Horizontal',
|
|
1460
|
+
vertical: 'Vertical',
|
|
1461
|
+
diagonalDown: 'Diagonal ↘',
|
|
1462
|
+
diagonalUp: 'Diagonal ↗',
|
|
1463
|
+
lineWidth: 'Grosor',
|
|
1464
|
+
color: 'Color',
|
|
1465
|
+
shape: 'Forma',
|
|
1466
|
+
rectangle: 'Rectángulo',
|
|
1467
|
+
roundedRectangle: 'Rectángulo redondeado',
|
|
1468
|
+
ellipse: 'Elipse',
|
|
1469
|
+
cornerRadius: 'Redondeo de esquinas',
|
|
1470
|
+
pageInfo: 'Muestra',
|
|
1471
|
+
pageNumber: 'Número de página',
|
|
1472
|
+
pageTotal: 'Total de páginas',
|
|
1473
|
+
pageNofM: 'Página X de Y',
|
|
1474
|
+
printDate: 'Fecha de impresión',
|
|
1475
|
+
checked: 'Marcada cuando',
|
|
1476
|
+
bandHeight: 'Altura de la sección',
|
|
1477
|
+
sortGroups: 'Orden de los grupos',
|
|
1478
|
+
sortAsc: 'A → Z',
|
|
1479
|
+
sortDesc: 'Z → A',
|
|
1480
|
+
sortNone: 'Como en los datos',
|
|
1481
|
+
keepTogether: 'Mantener el grupo en una página',
|
|
1482
|
+
keepTogetherHint: 'Mueve todo el grupo a la página siguiente en lugar de dividirlo.',
|
|
1483
|
+
repeatOnEveryPage: 'Repetir en cada página',
|
|
1484
|
+
pageBreakBefore: 'Empezar en una página nueva',
|
|
1485
|
+
pageBreakAfter: 'Página nueva después',
|
|
1486
|
+
dataRows: 'Las filas vienen de',
|
|
1487
|
+
dataRowsHint: 'Ruta de la lista dentro de los datos, p. ej. lines',
|
|
1488
|
+
dataSources: 'Orígenes de datos',
|
|
1489
|
+
close: 'Cerrar',
|
|
1490
|
+
rowsSource: 'filas',
|
|
1491
|
+
noSources: 'Aún no hay origen de datos. Añada uno a la izquierda.',
|
|
1492
|
+
webService: 'Servicio web',
|
|
1493
|
+
parameters: 'Parámetros',
|
|
1494
|
+
parametersHint: 'Se piden antes de ejecutar el informe. Use [?nombre] en fórmulas y {{nombre}} en direcciones de servicios web.',
|
|
1495
|
+
parameterName: 'Nombre del parámetro',
|
|
1496
|
+
parameterType: 'Tipo',
|
|
1497
|
+
parameterLabel: 'Etiqueta mostrada',
|
|
1498
|
+
defaultValue: 'Valor predeterminado',
|
|
1499
|
+
addParameter: 'Añadir parámetro',
|
|
1500
|
+
sourceName: 'Nombre',
|
|
1501
|
+
wholeData: '(todos los datos)',
|
|
1502
|
+
rowCount: '{0} fila(s)',
|
|
1503
|
+
useForRows: 'Usar este origen para las filas del informe',
|
|
1504
|
+
jsonData: 'Datos JSON',
|
|
1505
|
+
invalidJson: 'Esto no es JSON válido',
|
|
1506
|
+
csvData: 'Pegue una tabla CSV o de Excel con su fila de encabezado',
|
|
1507
|
+
method: 'Método',
|
|
1508
|
+
url: 'Dirección (URL)',
|
|
1509
|
+
test: 'Probar',
|
|
1510
|
+
testing: 'Probando…',
|
|
1511
|
+
testOk: 'Funciona: {0} fila(s) encontrada(s). La respuesta se guarda para diseñar.',
|
|
1512
|
+
headers: 'Encabezados',
|
|
1513
|
+
headerName: 'Nombre del encabezado',
|
|
1514
|
+
headerValue: 'Valor del encabezado',
|
|
1515
|
+
addHeader: 'Añadir encabezado',
|
|
1516
|
+
requestBody: 'Cuerpo de la solicitud',
|
|
1517
|
+
secretWarning: 'Todo lo escrito aquí es visible en el navegador y se guarda en el archivo del informe. Para claves secretas, llame al servicio desde su backend.',
|
|
1518
|
+
removeSource: 'Quitar este origen de datos',
|
|
1519
|
+
typeText: 'Texto',
|
|
1520
|
+
typeNumber: 'Número',
|
|
1521
|
+
typeDate: 'Fecha',
|
|
1522
|
+
typeYesNo: 'Sí / no',
|
|
1523
|
+
database: 'Base de datos',
|
|
1524
|
+
backendAddress: 'Dirección del backend de datos',
|
|
1525
|
+
connect: 'Conectar',
|
|
1526
|
+
connected: 'Conectado: {0} conexión(es) disponible(s).',
|
|
1527
|
+
connection: 'Conexión',
|
|
1528
|
+
writeSql: 'Escribir el SQL yo mismo',
|
|
1529
|
+
sqlHint: 'Una sola sentencia SELECT. Use :nombre para los parámetros del informe.',
|
|
1530
|
+
table: 'Tabla',
|
|
1531
|
+
columns: 'Columnas',
|
|
1532
|
+
filters: 'Solo filas donde',
|
|
1533
|
+
fixedValue: 'Valor…',
|
|
1534
|
+
addFilter: 'Añadir condición',
|
|
1535
|
+
sortBy: 'Ordenar por',
|
|
1536
|
+
maxRows: 'Máx. filas',
|
|
1537
|
+
opLike: 'contiene (like)',
|
|
1538
|
+
opIsEmpty: 'está vacío',
|
|
1539
|
+
opIsNotEmpty: 'no está vacío',
|
|
1540
|
+
rowLimitReached: '(se alcanzó el límite de filas; hay más)',
|
|
1541
|
+
viaBackend: 'Llamar a través del backend de datos',
|
|
1542
|
+
viaBackendHint: 'Úselo cuando el servicio bloquea las llamadas del navegador (CORS) o necesita una clave secreta.',
|
|
1543
|
+
autoDesign: 'Diseñar desde los datos',
|
|
1544
|
+
autoDesignHint: 'Crea una lista ordenada de sus datos con encabezados, totales y números de página. Deshacer recupera su diseño.',
|
|
1545
|
+
newReportTitle: 'Informe',
|
|
1546
|
+
totalLabel: 'Total',
|
|
1547
|
+
pageOfFormat: 'Página {0} de {1}',
|
|
1548
|
+
issueOutsidePage: 'sobrepasa el borde del papel',
|
|
1549
|
+
issueFormulaError: 'tiene un error de fórmula: {0}',
|
|
1550
|
+
issueUnknownField: 'usa «{0}», que no está en los datos',
|
|
1551
|
+
issueEmptyFormula: 'tiene una fórmula vacía',
|
|
1552
|
+
issueOverlap: 'se superpone con {0}',
|
|
1553
|
+
fixIt: 'Corregir',
|
|
1554
|
+
noProblems: 'No se encontraron problemas.',
|
|
1555
|
+
chartType: 'Tipo de gráfico',
|
|
1556
|
+
chartColumn: 'Columnas',
|
|
1557
|
+
chartBar: 'Barras',
|
|
1558
|
+
chartLine: 'Línea',
|
|
1559
|
+
chartPie: 'Circular',
|
|
1560
|
+
chartDoughnut: 'Anillo',
|
|
1561
|
+
chartCategory: 'Agrupar por',
|
|
1562
|
+
chartValue: 'Valor',
|
|
1563
|
+
chartAggregate: 'Cálculo',
|
|
1564
|
+
aggSum: 'Total',
|
|
1565
|
+
aggCount: 'Cantidad',
|
|
1566
|
+
aggAvg: 'Promedio',
|
|
1567
|
+
aggMin: 'Menor',
|
|
1568
|
+
aggMax: 'Mayor',
|
|
1569
|
+
chartTitle: 'Título',
|
|
1570
|
+
showValues: 'Mostrar valores',
|
|
1571
|
+
showLegend: 'Mostrar leyenda',
|
|
1572
|
+
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.',
|
|
1573
|
+
conditionalFormatting: 'Formato condicional',
|
|
1574
|
+
watermark: 'Marca de agua',
|
|
1575
|
+
reportLocale: 'Idioma y región',
|
|
1576
|
+
reportLocaleRegion: 'Números y fechas',
|
|
1577
|
+
reportCurrency: 'Moneda',
|
|
1578
|
+
reportLocaleDefault: 'Ajuste de la aplicación',
|
|
1579
|
+
reportLocaleHint: 'Cómo escribe este informe los números, las fechas, el dinero y los importes en letras, se imprima donde se imprima.',
|
|
1580
|
+
formulaEditor: 'Editor de fórmulas',
|
|
1581
|
+
formulaEditorHint: 'Pulse un campo o una función para insertarlo en la posición del cursor.',
|
|
1582
|
+
formulaResult: 'Resultado para la primera fila',
|
|
1583
|
+
formulaEmpty: '(vacío)',
|
|
1584
|
+
apply: 'Aplicar',
|
|
1585
|
+
cancel: 'Cancelar',
|
|
1586
|
+
fnLogic: 'Lógica',
|
|
1587
|
+
fnText: 'Texto',
|
|
1588
|
+
fnNumber: 'Número',
|
|
1589
|
+
fnDate: 'Fecha',
|
|
1590
|
+
fnAggregate: 'Totales',
|
|
1591
|
+
functions: 'Funciones',
|
|
1592
|
+
openFormulaEditor: 'Abrir el editor de fórmulas',
|
|
1593
|
+
functionHelp: {
|
|
1594
|
+
Iif: 'Elige entre dos valores: el primero si la condición es verdadera, si no el segundo.',
|
|
1595
|
+
IsNull: 'El valor, o el valor alternativo si está vacío.',
|
|
1596
|
+
Concat: 'Une textos.',
|
|
1597
|
+
Len: 'Número de caracteres.',
|
|
1598
|
+
Upper: 'MAYÚSCULAS (İ/ı del turco correctas).',
|
|
1599
|
+
Lower: 'minúsculas (İ/ı del turco correctas).',
|
|
1600
|
+
Trim: 'Quita los espacios de ambos extremos.',
|
|
1601
|
+
Substring: 'Parte de un texto desde una posición (0 = primer carácter).',
|
|
1602
|
+
Replace: 'Reemplaza cada aparición de un texto.',
|
|
1603
|
+
Contains: 'Verdadero si el texto contiene la parte.',
|
|
1604
|
+
StartsWith: 'Verdadero si el texto empieza por la parte.',
|
|
1605
|
+
EndsWith: 'Verdadero si el texto termina en la parte.',
|
|
1606
|
+
ToString: 'El valor como texto.',
|
|
1607
|
+
Format: "Muestra un valor con un patrón, p. ej. 'n2' o 'dd.MM.yyyy'.",
|
|
1608
|
+
AmountInWords: 'Un importe en letras con su moneda, para facturas y cheques.',
|
|
1609
|
+
NumberToWords: 'Un número entero en letras.',
|
|
1610
|
+
Round: 'Redondea a los decimales indicados.',
|
|
1611
|
+
Abs: 'El número sin signo.',
|
|
1612
|
+
Floor: 'Redondea hacia abajo a un entero.',
|
|
1613
|
+
Ceiling: 'Redondea hacia arriba a un entero.',
|
|
1614
|
+
ToNumber: 'Lee un número de un texto.',
|
|
1615
|
+
Today: 'La fecha de impresión (sin hora).',
|
|
1616
|
+
Now: 'La fecha y hora de impresión.',
|
|
1617
|
+
Year: 'Año de una fecha.',
|
|
1618
|
+
Month: 'Mes de una fecha (1–12).',
|
|
1619
|
+
Day: 'Día del mes.',
|
|
1620
|
+
AddDays: 'Una fecha desplazada unos días, p. ej. un vencimiento.',
|
|
1621
|
+
Sum: 'Total de las filas del ámbito (grupo, página o informe).',
|
|
1622
|
+
Count: 'Número de filas del ámbito.',
|
|
1623
|
+
Avg: 'Promedio de las filas del ámbito.',
|
|
1624
|
+
Min: 'Valor más pequeño del ámbito (o de dos valores).',
|
|
1625
|
+
Max: 'Valor más grande del ámbito (o de dos valores).',
|
|
1626
|
+
},
|
|
1627
|
+
watermarkHint: 'Texto grande y tenue detrás de cada página, p. ej. BORRADOR o PAGADO. Puede venir de los datos.',
|
|
1628
|
+
watermarkAngle: 'Dirección',
|
|
1629
|
+
conditionalHint: 'Cambia el aspecto cuando se cumple una condición, p. ej. importes negativos en rojo.',
|
|
1630
|
+
addRule: 'Añadir regla',
|
|
1631
|
+
ruleWhen: 'Cuando',
|
|
1632
|
+
ruleThen: 'Entonces',
|
|
1633
|
+
removeRule: 'Quitar regla',
|
|
1634
|
+
opContains: 'contiene',
|
|
1635
|
+
ruleValue: 'Valor',
|
|
1636
|
+
};
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* Every bundled UI language by its ISO 639-1 code. Importing this pulls in all of them; import a
|
|
1640
|
+
* single `weReportLocaleXx` instead to ship only one.
|
|
1641
|
+
*/
|
|
1642
|
+
const WE_REPORT_LOCALES = {
|
|
1643
|
+
en: weReportLocaleEn,
|
|
1644
|
+
tr: weReportLocaleTr,
|
|
1645
|
+
de: weReportLocaleDe,
|
|
1646
|
+
fr: weReportLocaleFr,
|
|
1647
|
+
es: weReportLocaleEs,
|
|
1648
|
+
};
|
|
1649
|
+
/** The UI strings for a BCP 47 tag (`de-AT` → German); English when there is no translation. */
|
|
1650
|
+
function weReportLocaleFor(tag) {
|
|
1651
|
+
const language = (tag ?? '').toLowerCase().split(/[-_]/)[0];
|
|
1652
|
+
return WE_REPORT_LOCALES[language] ?? weReportLocaleEn;
|
|
1653
|
+
}
|
|
1654
|
+
|
|
446
1655
|
const WE_REPORT_CONFIG = new InjectionToken('WE_REPORT_CONFIG', {
|
|
447
1656
|
providedIn: 'root',
|
|
448
1657
|
factory: () => ({}),
|
|
@@ -487,7 +1696,25 @@ const WE_REPORT_DEFAULT_ICONS = {
|
|
|
487
1696
|
checkbox: svg('<rect x="4" y="4" width="16" height="16" rx="2"/><path d="M8 12l3 3 5-6"/>'),
|
|
488
1697
|
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"/>'),
|
|
489
1698
|
design: svg('<path d="M12 20h9M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4z"/>'),
|
|
1699
|
+
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"/>'),
|
|
490
1700
|
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"/>'),
|
|
1701
|
+
arrangeLeft: svg('<path d="M4 3v18"/><rect x="7" y="6" width="12" height="4" rx="1"/><rect x="7" y="14" width="7" height="4" rx="1"/>'),
|
|
1702
|
+
arrangeCenter: svg('<path d="M12 3v18"/><rect x="5" y="6" width="14" height="4" rx="1"/><rect x="8" y="14" width="8" height="4" rx="1"/>'),
|
|
1703
|
+
arrangeRight: svg('<path d="M20 3v18"/><rect x="5" y="6" width="12" height="4" rx="1"/><rect x="10" y="14" width="7" height="4" rx="1"/>'),
|
|
1704
|
+
arrangeTop: svg('<path d="M3 4h18"/><rect x="6" y="7" width="4" height="12" rx="1"/><rect x="14" y="7" width="4" height="7" rx="1"/>'),
|
|
1705
|
+
arrangeMiddle: svg('<path d="M3 12h18"/><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="8" width="4" height="8" rx="1"/>'),
|
|
1706
|
+
arrangeBottom: svg('<path d="M3 20h18"/><rect x="6" y="5" width="4" height="12" rx="1"/><rect x="14" y="10" width="4" height="7" rx="1"/>'),
|
|
1707
|
+
distributeH: svg('<path d="M3 4v16M21 4v16"/><rect x="9" y="7" width="6" height="10" rx="1"/>'),
|
|
1708
|
+
distributeV: svg('<path d="M4 3h16M4 21h16"/><rect x="7" y="9" width="10" height="6" rx="1"/>'),
|
|
1709
|
+
sameWidth: svg('<path d="M4 8h16M4 5v6M20 5v6"/><rect x="4" y="14" width="16" height="5" rx="1"/>'),
|
|
1710
|
+
sameHeight: svg('<path d="M8 4v16M5 4h6M5 20h6"/><rect x="14" y="4" width="5" height="16" rx="1"/>'),
|
|
1711
|
+
bringToFront: svg('<rect x="3" y="3" width="11" height="11" rx="1" stroke-dasharray="2 2"/><rect x="10" y="10" width="11" height="11" rx="1" fill="currentColor" fill-opacity=".25"/>'),
|
|
1712
|
+
sendToBack: svg('<rect x="3" y="3" width="11" height="11" rx="1" fill="currentColor" fill-opacity=".25"/><rect x="10" y="10" width="11" height="11" rx="1" stroke-dasharray="2 2"/>'),
|
|
1713
|
+
cut: svg('<circle cx="6" cy="18" r="3"/><circle cx="18" cy="18" r="3"/><path d="M8 16L19 4M16 16L5 4"/>'),
|
|
1714
|
+
copy: svg('<rect x="8" y="8" width="13" height="13" rx="2"/><path d="M16 8V5a2 2 0 00-2-2H5a2 2 0 00-2 2v9a2 2 0 002 2h3"/>'),
|
|
1715
|
+
paste: svg('<path d="M9 4h6v3H9z"/><path d="M15 5h2a2 2 0 012 2v12a2 2 0 01-2 2H7a2 2 0 01-2-2V7a2 2 0 012-2h2"/>'),
|
|
1716
|
+
outline: svg('<path d="M4 6h16M8 12h12M8 18h12M4 12h.01M4 18h.01"/>'),
|
|
1717
|
+
fitWidth: svg('<path d="M3 12h18M7 8l-4 4 4 4M17 8l4 4-4 4M3 4v16M21 4v16"/>'),
|
|
491
1718
|
};
|
|
492
1719
|
const WE_REPORT_ICONS = new InjectionToken('WE_REPORT_ICONS', {
|
|
493
1720
|
providedIn: 'root',
|
|
@@ -622,176 +1849,176 @@ class WeReportPageComponent {
|
|
|
622
1849
|
return `'${WeReportFontsService.cssFamily(item.fontFamily)}'`;
|
|
623
1850
|
}
|
|
624
1851
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
625
|
-
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: `
|
|
626
|
-
<svg
|
|
627
|
-
class="we-report-page"
|
|
628
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
629
|
-
[attr.viewBox]="'0 0 ' + page().width + ' ' + page().height"
|
|
630
|
-
[style.width.mm]="page().width * zoom()"
|
|
631
|
-
[style.height.mm]="page().height * zoom()"
|
|
632
|
-
>
|
|
633
|
-
@for (item of page().items; track $index) {
|
|
634
|
-
@switch (item.kind) {
|
|
635
|
-
@case ('rect') {
|
|
636
|
-
<rect
|
|
637
|
-
[attr.x]="item.x"
|
|
638
|
-
[attr.y]="item.y"
|
|
639
|
-
[attr.width]="item.width"
|
|
640
|
-
[attr.height]="item.height"
|
|
641
|
-
[attr.rx]="item.radius ?? null"
|
|
642
|
-
[attr.fill]="paint(item.fill)"
|
|
643
|
-
[attr.stroke]="stroke(item.stroke)"
|
|
644
|
-
[attr.stroke-width]="item.stroke ? (item.strokeWidth ?? 0.25) : null"
|
|
645
|
-
/>
|
|
646
|
-
}
|
|
647
|
-
@case ('ellipse') {
|
|
648
|
-
<ellipse
|
|
649
|
-
[attr.cx]="item.x + item.width / 2"
|
|
650
|
-
[attr.cy]="item.y + item.height / 2"
|
|
651
|
-
[attr.rx]="item.width / 2"
|
|
652
|
-
[attr.ry]="item.height / 2"
|
|
653
|
-
[attr.fill]="paint(item.fill)"
|
|
654
|
-
[attr.stroke]="stroke(item.stroke)"
|
|
655
|
-
[attr.stroke-width]="item.stroke ? (item.strokeWidth ?? 0.25) : null"
|
|
656
|
-
/>
|
|
657
|
-
}
|
|
658
|
-
@case ('line') {
|
|
659
|
-
<line
|
|
660
|
-
[attr.x1]="item.x1"
|
|
661
|
-
[attr.y1]="item.y1"
|
|
662
|
-
[attr.x2]="item.x2"
|
|
663
|
-
[attr.y2]="item.y2"
|
|
664
|
-
[attr.stroke]="stroke(item.color)"
|
|
665
|
-
[attr.stroke-width]="item.width"
|
|
666
|
-
stroke-linecap="square"
|
|
667
|
-
/>
|
|
668
|
-
}
|
|
669
|
-
@case ('text') {
|
|
670
|
-
<svg [attr.x]="item.x" [attr.y]="item.y" [attr.width]="item.width" [attr.height]="item.height" overflow="hidden">
|
|
671
|
-
@for (line of text(item).lines; track $index) {
|
|
672
|
-
<text
|
|
673
|
-
class="we-report-page__text"
|
|
674
|
-
[attr.x]="line.x - item.x"
|
|
675
|
-
[attr.y]="line.baseline - item.y"
|
|
676
|
-
[attr.font-family]="family(text(item))"
|
|
677
|
-
[attr.font-size]="text(item).size * ptToMm"
|
|
678
|
-
[attr.font-weight]="text(item).bold ? 700 : 400"
|
|
679
|
-
[attr.font-style]="text(item).italic ? 'italic' : 'normal'"
|
|
680
|
-
[attr.fill]="textColor(text(item).color)"
|
|
681
|
-
[attr.text-decoration]="text(item).underline ? 'underline' : null"
|
|
682
|
-
>{{ line.text }}</text>
|
|
683
|
-
}
|
|
684
|
-
</svg>
|
|
685
|
-
}
|
|
686
|
-
@case ('image') {
|
|
687
|
-
<svg [attr.x]="item.clip.x" [attr.y]="item.clip.y" [attr.width]="item.clip.width" [attr.height]="item.clip.height" overflow="hidden">
|
|
688
|
-
<image
|
|
689
|
-
[attr.x]="item.x - item.clip.x"
|
|
690
|
-
[attr.y]="item.y - item.clip.y"
|
|
691
|
-
[attr.width]="item.width"
|
|
692
|
-
[attr.height]="item.height"
|
|
693
|
-
preserveAspectRatio="none"
|
|
694
|
-
[attr.href]="item.src"
|
|
695
|
-
/>
|
|
696
|
-
</svg>
|
|
697
|
-
}
|
|
698
|
-
@case ('path') {
|
|
699
|
-
<g [attr.transform]="'translate(' + item.x + ' ' + item.y + ')'">
|
|
700
|
-
@for (p of path(item).paths; track $index) {
|
|
701
|
-
<path [attr.d]="p.d" [attr.fill]="paint(p.fill)" [attr.stroke]="stroke(p.stroke)" [attr.stroke-width]="p.strokeWidth ?? null" />
|
|
702
|
-
}
|
|
703
|
-
</g>
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
</svg>
|
|
1852
|
+
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: `
|
|
1853
|
+
<svg
|
|
1854
|
+
class="we-report-page"
|
|
1855
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1856
|
+
[attr.viewBox]="'0 0 ' + page().width + ' ' + page().height"
|
|
1857
|
+
[style.width.mm]="page().width * zoom()"
|
|
1858
|
+
[style.height.mm]="page().height * zoom()"
|
|
1859
|
+
>
|
|
1860
|
+
@for (item of page().items; track $index) {
|
|
1861
|
+
@switch (item.kind) {
|
|
1862
|
+
@case ('rect') {
|
|
1863
|
+
<rect
|
|
1864
|
+
[attr.x]="item.x"
|
|
1865
|
+
[attr.y]="item.y"
|
|
1866
|
+
[attr.width]="item.width"
|
|
1867
|
+
[attr.height]="item.height"
|
|
1868
|
+
[attr.rx]="item.radius ?? null"
|
|
1869
|
+
[attr.fill]="paint(item.fill)"
|
|
1870
|
+
[attr.stroke]="stroke(item.stroke)"
|
|
1871
|
+
[attr.stroke-width]="item.stroke ? (item.strokeWidth ?? 0.25) : null"
|
|
1872
|
+
/>
|
|
1873
|
+
}
|
|
1874
|
+
@case ('ellipse') {
|
|
1875
|
+
<ellipse
|
|
1876
|
+
[attr.cx]="item.x + item.width / 2"
|
|
1877
|
+
[attr.cy]="item.y + item.height / 2"
|
|
1878
|
+
[attr.rx]="item.width / 2"
|
|
1879
|
+
[attr.ry]="item.height / 2"
|
|
1880
|
+
[attr.fill]="paint(item.fill)"
|
|
1881
|
+
[attr.stroke]="stroke(item.stroke)"
|
|
1882
|
+
[attr.stroke-width]="item.stroke ? (item.strokeWidth ?? 0.25) : null"
|
|
1883
|
+
/>
|
|
1884
|
+
}
|
|
1885
|
+
@case ('line') {
|
|
1886
|
+
<line
|
|
1887
|
+
[attr.x1]="item.x1"
|
|
1888
|
+
[attr.y1]="item.y1"
|
|
1889
|
+
[attr.x2]="item.x2"
|
|
1890
|
+
[attr.y2]="item.y2"
|
|
1891
|
+
[attr.stroke]="stroke(item.color)"
|
|
1892
|
+
[attr.stroke-width]="item.width"
|
|
1893
|
+
stroke-linecap="square"
|
|
1894
|
+
/>
|
|
1895
|
+
}
|
|
1896
|
+
@case ('text') {
|
|
1897
|
+
<svg [attr.x]="item.x" [attr.y]="item.y" [attr.width]="item.width" [attr.height]="item.height" overflow="hidden">
|
|
1898
|
+
@for (line of text(item).lines; track $index) {
|
|
1899
|
+
<text
|
|
1900
|
+
class="we-report-page__text"
|
|
1901
|
+
[attr.x]="line.x - item.x"
|
|
1902
|
+
[attr.y]="line.baseline - item.y"
|
|
1903
|
+
[attr.font-family]="family(text(item))"
|
|
1904
|
+
[attr.font-size]="text(item).size * ptToMm"
|
|
1905
|
+
[attr.font-weight]="text(item).bold ? 700 : 400"
|
|
1906
|
+
[attr.font-style]="text(item).italic ? 'italic' : 'normal'"
|
|
1907
|
+
[attr.fill]="textColor(text(item).color)"
|
|
1908
|
+
[attr.text-decoration]="text(item).underline ? 'underline' : null"
|
|
1909
|
+
>{{ line.text }}</text>
|
|
1910
|
+
}
|
|
1911
|
+
</svg>
|
|
1912
|
+
}
|
|
1913
|
+
@case ('image') {
|
|
1914
|
+
<svg [attr.x]="item.clip.x" [attr.y]="item.clip.y" [attr.width]="item.clip.width" [attr.height]="item.clip.height" overflow="hidden">
|
|
1915
|
+
<image
|
|
1916
|
+
[attr.x]="item.x - item.clip.x"
|
|
1917
|
+
[attr.y]="item.y - item.clip.y"
|
|
1918
|
+
[attr.width]="item.width"
|
|
1919
|
+
[attr.height]="item.height"
|
|
1920
|
+
preserveAspectRatio="none"
|
|
1921
|
+
[attr.href]="item.src"
|
|
1922
|
+
/>
|
|
1923
|
+
</svg>
|
|
1924
|
+
}
|
|
1925
|
+
@case ('path') {
|
|
1926
|
+
<g [attr.transform]="'translate(' + item.x + ' ' + item.y + ')'">
|
|
1927
|
+
@for (p of path(item).paths; track $index) {
|
|
1928
|
+
<path [attr.d]="p.d" [attr.fill]="paint(p.fill)" [attr.stroke]="stroke(p.stroke)" [attr.stroke-width]="p.strokeWidth ?? null" />
|
|
1929
|
+
}
|
|
1930
|
+
</g>
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
</svg>
|
|
708
1935
|
`, 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 });
|
|
709
1936
|
}
|
|
710
1937
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportPageComponent, decorators: [{
|
|
711
1938
|
type: Component,
|
|
712
|
-
args: [{ selector: 'we-report-page', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
713
|
-
<svg
|
|
714
|
-
class="we-report-page"
|
|
715
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
716
|
-
[attr.viewBox]="'0 0 ' + page().width + ' ' + page().height"
|
|
717
|
-
[style.width.mm]="page().width * zoom()"
|
|
718
|
-
[style.height.mm]="page().height * zoom()"
|
|
719
|
-
>
|
|
720
|
-
@for (item of page().items; track $index) {
|
|
721
|
-
@switch (item.kind) {
|
|
722
|
-
@case ('rect') {
|
|
723
|
-
<rect
|
|
724
|
-
[attr.x]="item.x"
|
|
725
|
-
[attr.y]="item.y"
|
|
726
|
-
[attr.width]="item.width"
|
|
727
|
-
[attr.height]="item.height"
|
|
728
|
-
[attr.rx]="item.radius ?? null"
|
|
729
|
-
[attr.fill]="paint(item.fill)"
|
|
730
|
-
[attr.stroke]="stroke(item.stroke)"
|
|
731
|
-
[attr.stroke-width]="item.stroke ? (item.strokeWidth ?? 0.25) : null"
|
|
732
|
-
/>
|
|
733
|
-
}
|
|
734
|
-
@case ('ellipse') {
|
|
735
|
-
<ellipse
|
|
736
|
-
[attr.cx]="item.x + item.width / 2"
|
|
737
|
-
[attr.cy]="item.y + item.height / 2"
|
|
738
|
-
[attr.rx]="item.width / 2"
|
|
739
|
-
[attr.ry]="item.height / 2"
|
|
740
|
-
[attr.fill]="paint(item.fill)"
|
|
741
|
-
[attr.stroke]="stroke(item.stroke)"
|
|
742
|
-
[attr.stroke-width]="item.stroke ? (item.strokeWidth ?? 0.25) : null"
|
|
743
|
-
/>
|
|
744
|
-
}
|
|
745
|
-
@case ('line') {
|
|
746
|
-
<line
|
|
747
|
-
[attr.x1]="item.x1"
|
|
748
|
-
[attr.y1]="item.y1"
|
|
749
|
-
[attr.x2]="item.x2"
|
|
750
|
-
[attr.y2]="item.y2"
|
|
751
|
-
[attr.stroke]="stroke(item.color)"
|
|
752
|
-
[attr.stroke-width]="item.width"
|
|
753
|
-
stroke-linecap="square"
|
|
754
|
-
/>
|
|
755
|
-
}
|
|
756
|
-
@case ('text') {
|
|
757
|
-
<svg [attr.x]="item.x" [attr.y]="item.y" [attr.width]="item.width" [attr.height]="item.height" overflow="hidden">
|
|
758
|
-
@for (line of text(item).lines; track $index) {
|
|
759
|
-
<text
|
|
760
|
-
class="we-report-page__text"
|
|
761
|
-
[attr.x]="line.x - item.x"
|
|
762
|
-
[attr.y]="line.baseline - item.y"
|
|
763
|
-
[attr.font-family]="family(text(item))"
|
|
764
|
-
[attr.font-size]="text(item).size * ptToMm"
|
|
765
|
-
[attr.font-weight]="text(item).bold ? 700 : 400"
|
|
766
|
-
[attr.font-style]="text(item).italic ? 'italic' : 'normal'"
|
|
767
|
-
[attr.fill]="textColor(text(item).color)"
|
|
768
|
-
[attr.text-decoration]="text(item).underline ? 'underline' : null"
|
|
769
|
-
>{{ line.text }}</text>
|
|
770
|
-
}
|
|
771
|
-
</svg>
|
|
772
|
-
}
|
|
773
|
-
@case ('image') {
|
|
774
|
-
<svg [attr.x]="item.clip.x" [attr.y]="item.clip.y" [attr.width]="item.clip.width" [attr.height]="item.clip.height" overflow="hidden">
|
|
775
|
-
<image
|
|
776
|
-
[attr.x]="item.x - item.clip.x"
|
|
777
|
-
[attr.y]="item.y - item.clip.y"
|
|
778
|
-
[attr.width]="item.width"
|
|
779
|
-
[attr.height]="item.height"
|
|
780
|
-
preserveAspectRatio="none"
|
|
781
|
-
[attr.href]="item.src"
|
|
782
|
-
/>
|
|
783
|
-
</svg>
|
|
784
|
-
}
|
|
785
|
-
@case ('path') {
|
|
786
|
-
<g [attr.transform]="'translate(' + item.x + ' ' + item.y + ')'">
|
|
787
|
-
@for (p of path(item).paths; track $index) {
|
|
788
|
-
<path [attr.d]="p.d" [attr.fill]="paint(p.fill)" [attr.stroke]="stroke(p.stroke)" [attr.stroke-width]="p.strokeWidth ?? null" />
|
|
789
|
-
}
|
|
790
|
-
</g>
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
</svg>
|
|
1939
|
+
args: [{ selector: 'we-report-page', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1940
|
+
<svg
|
|
1941
|
+
class="we-report-page"
|
|
1942
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1943
|
+
[attr.viewBox]="'0 0 ' + page().width + ' ' + page().height"
|
|
1944
|
+
[style.width.mm]="page().width * zoom()"
|
|
1945
|
+
[style.height.mm]="page().height * zoom()"
|
|
1946
|
+
>
|
|
1947
|
+
@for (item of page().items; track $index) {
|
|
1948
|
+
@switch (item.kind) {
|
|
1949
|
+
@case ('rect') {
|
|
1950
|
+
<rect
|
|
1951
|
+
[attr.x]="item.x"
|
|
1952
|
+
[attr.y]="item.y"
|
|
1953
|
+
[attr.width]="item.width"
|
|
1954
|
+
[attr.height]="item.height"
|
|
1955
|
+
[attr.rx]="item.radius ?? null"
|
|
1956
|
+
[attr.fill]="paint(item.fill)"
|
|
1957
|
+
[attr.stroke]="stroke(item.stroke)"
|
|
1958
|
+
[attr.stroke-width]="item.stroke ? (item.strokeWidth ?? 0.25) : null"
|
|
1959
|
+
/>
|
|
1960
|
+
}
|
|
1961
|
+
@case ('ellipse') {
|
|
1962
|
+
<ellipse
|
|
1963
|
+
[attr.cx]="item.x + item.width / 2"
|
|
1964
|
+
[attr.cy]="item.y + item.height / 2"
|
|
1965
|
+
[attr.rx]="item.width / 2"
|
|
1966
|
+
[attr.ry]="item.height / 2"
|
|
1967
|
+
[attr.fill]="paint(item.fill)"
|
|
1968
|
+
[attr.stroke]="stroke(item.stroke)"
|
|
1969
|
+
[attr.stroke-width]="item.stroke ? (item.strokeWidth ?? 0.25) : null"
|
|
1970
|
+
/>
|
|
1971
|
+
}
|
|
1972
|
+
@case ('line') {
|
|
1973
|
+
<line
|
|
1974
|
+
[attr.x1]="item.x1"
|
|
1975
|
+
[attr.y1]="item.y1"
|
|
1976
|
+
[attr.x2]="item.x2"
|
|
1977
|
+
[attr.y2]="item.y2"
|
|
1978
|
+
[attr.stroke]="stroke(item.color)"
|
|
1979
|
+
[attr.stroke-width]="item.width"
|
|
1980
|
+
stroke-linecap="square"
|
|
1981
|
+
/>
|
|
1982
|
+
}
|
|
1983
|
+
@case ('text') {
|
|
1984
|
+
<svg [attr.x]="item.x" [attr.y]="item.y" [attr.width]="item.width" [attr.height]="item.height" overflow="hidden">
|
|
1985
|
+
@for (line of text(item).lines; track $index) {
|
|
1986
|
+
<text
|
|
1987
|
+
class="we-report-page__text"
|
|
1988
|
+
[attr.x]="line.x - item.x"
|
|
1989
|
+
[attr.y]="line.baseline - item.y"
|
|
1990
|
+
[attr.font-family]="family(text(item))"
|
|
1991
|
+
[attr.font-size]="text(item).size * ptToMm"
|
|
1992
|
+
[attr.font-weight]="text(item).bold ? 700 : 400"
|
|
1993
|
+
[attr.font-style]="text(item).italic ? 'italic' : 'normal'"
|
|
1994
|
+
[attr.fill]="textColor(text(item).color)"
|
|
1995
|
+
[attr.text-decoration]="text(item).underline ? 'underline' : null"
|
|
1996
|
+
>{{ line.text }}</text>
|
|
1997
|
+
}
|
|
1998
|
+
</svg>
|
|
1999
|
+
}
|
|
2000
|
+
@case ('image') {
|
|
2001
|
+
<svg [attr.x]="item.clip.x" [attr.y]="item.clip.y" [attr.width]="item.clip.width" [attr.height]="item.clip.height" overflow="hidden">
|
|
2002
|
+
<image
|
|
2003
|
+
[attr.x]="item.x - item.clip.x"
|
|
2004
|
+
[attr.y]="item.y - item.clip.y"
|
|
2005
|
+
[attr.width]="item.width"
|
|
2006
|
+
[attr.height]="item.height"
|
|
2007
|
+
preserveAspectRatio="none"
|
|
2008
|
+
[attr.href]="item.src"
|
|
2009
|
+
/>
|
|
2010
|
+
</svg>
|
|
2011
|
+
}
|
|
2012
|
+
@case ('path') {
|
|
2013
|
+
<g [attr.transform]="'translate(' + item.x + ' ' + item.y + ')'">
|
|
2014
|
+
@for (p of path(item).paths; track $index) {
|
|
2015
|
+
<path [attr.d]="p.d" [attr.fill]="paint(p.fill)" [attr.stroke]="stroke(p.stroke)" [attr.stroke-width]="p.strokeWidth ?? null" />
|
|
2016
|
+
}
|
|
2017
|
+
</g>
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
</svg>
|
|
795
2022
|
`, 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"] }]
|
|
796
2023
|
}] });
|
|
797
2024
|
|
|
@@ -941,148 +2168,148 @@ class WeReportViewerComponent {
|
|
|
941
2168
|
this.dom.body.appendChild(frame);
|
|
942
2169
|
}
|
|
943
2170
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
944
|
-
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: `
|
|
945
|
-
<div class="we-report-viewer__toolbar" role="toolbar">
|
|
946
|
-
<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>
|
|
947
|
-
<span class="we-report-viewer__zoom">{{ (zoomLevel() * 100).toFixed(0) }}%</span>
|
|
948
|
-
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() + 0.1)" [attr.aria-label]="strings().zoomIn" [title]="strings().zoomIn" [innerHTML]="'zoomIn' | weReportIcon"></button>
|
|
949
|
-
<span class="we-report-viewer__pages">{{ pageLabel() }}</span>
|
|
950
|
-
<span class="we-report-viewer__spacer"></span>
|
|
951
|
-
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="print()" [disabled]="!document()">
|
|
952
|
-
<span [innerHTML]="'print' | weReportIcon"></span>{{ strings().print }}
|
|
953
|
-
</button>
|
|
954
|
-
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="downloadExcel()" [disabled]="!document()">
|
|
955
|
-
<span [innerHTML]="'download' | weReportIcon"></span>{{ strings().downloadExcel }}
|
|
956
|
-
</button>
|
|
957
|
-
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="downloadPdf()" [disabled]="!document()">
|
|
958
|
-
<span [innerHTML]="'download' | weReportIcon"></span>{{ strings().downloadPdf }}
|
|
959
|
-
</button>
|
|
960
|
-
</div>
|
|
961
|
-
@if (report().parameters?.length) {
|
|
962
|
-
<form class="we-report-viewer__params" (submit)="$event.preventDefault(); applyParams()">
|
|
963
|
-
@for (p of report().parameters!; track p.name) {
|
|
964
|
-
<label>
|
|
965
|
-
<span>{{ p.label || p.name }}</span>
|
|
966
|
-
@switch (p.type) {
|
|
967
|
-
@case ('boolean') {
|
|
968
|
-
<input type="checkbox" [checked]="paramValue(p) === true" (change)="setParam(p, $any($event.target).checked)" />
|
|
969
|
-
}
|
|
970
|
-
@case ('date') {
|
|
971
|
-
<input type="date" [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
972
|
-
}
|
|
973
|
-
@case ('number') {
|
|
974
|
-
<input type="number" [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
975
|
-
}
|
|
976
|
-
@default {
|
|
977
|
-
<input [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
</label>
|
|
981
|
-
}
|
|
982
|
-
<button type="submit" class="we-report-viewer__btn we-report-viewer__btn--text">{{ strings().runReport }}</button>
|
|
983
|
-
</form>
|
|
984
|
-
}
|
|
985
|
-
@for (e of loadErrors(); track $index) {
|
|
986
|
-
<div class="we-report-viewer__error" role="alert">{{ strings().dataLoadError }}: {{ e }}</div>
|
|
987
|
-
}
|
|
988
|
-
@for (w of loadWarnings(); track $index) {
|
|
989
|
-
<div class="we-report-viewer__error">{{ w }}</div>
|
|
990
|
-
}
|
|
991
|
-
@if (error(); as message) {
|
|
992
|
-
<div class="we-report-viewer__error" role="alert">{{ strings().layoutError }}: {{ message }}</div>
|
|
993
|
-
}
|
|
994
|
-
@if (document()?.problems?.length) {
|
|
995
|
-
<details class="we-report-viewer__problems">
|
|
996
|
-
<summary>{{ strings().problems }} ({{ document()!.problems.length }})</summary>
|
|
997
|
-
<ul>
|
|
998
|
-
@for (p of document()!.problems; track $index) {
|
|
999
|
-
<li>{{ p.controlId ? p.controlId + ': ' : '' }}{{ p.message }}</li>
|
|
1000
|
-
}
|
|
1001
|
-
</ul>
|
|
1002
|
-
</details>
|
|
1003
|
-
}
|
|
1004
|
-
<div class="we-report-viewer__scroll">
|
|
1005
|
-
@if (document(); as doc) {
|
|
1006
|
-
@for (page of doc.pages; track $index) {
|
|
1007
|
-
<we-report-page class="we-report-viewer__page" [page]="page" [zoom]="zoomLevel()" />
|
|
1008
|
-
}
|
|
1009
|
-
} @else if (!error()) {
|
|
1010
|
-
<div class="we-report-viewer__loading">{{ strings().loading }}</div>
|
|
1011
|
-
}
|
|
1012
|
-
</div>
|
|
2171
|
+
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: `
|
|
2172
|
+
<div class="we-report-viewer__toolbar" role="toolbar">
|
|
2173
|
+
<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>
|
|
2174
|
+
<span class="we-report-viewer__zoom">{{ (zoomLevel() * 100).toFixed(0) }}%</span>
|
|
2175
|
+
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() + 0.1)" [attr.aria-label]="strings().zoomIn" [title]="strings().zoomIn" [innerHTML]="'zoomIn' | weReportIcon"></button>
|
|
2176
|
+
<span class="we-report-viewer__pages">{{ pageLabel() }}</span>
|
|
2177
|
+
<span class="we-report-viewer__spacer"></span>
|
|
2178
|
+
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="print()" [disabled]="!document()">
|
|
2179
|
+
<span [innerHTML]="'print' | weReportIcon"></span>{{ strings().print }}
|
|
2180
|
+
</button>
|
|
2181
|
+
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="downloadExcel()" [disabled]="!document()">
|
|
2182
|
+
<span [innerHTML]="'download' | weReportIcon"></span>{{ strings().downloadExcel }}
|
|
2183
|
+
</button>
|
|
2184
|
+
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="downloadPdf()" [disabled]="!document()">
|
|
2185
|
+
<span [innerHTML]="'download' | weReportIcon"></span>{{ strings().downloadPdf }}
|
|
2186
|
+
</button>
|
|
2187
|
+
</div>
|
|
2188
|
+
@if (report().parameters?.length) {
|
|
2189
|
+
<form class="we-report-viewer__params" (submit)="$event.preventDefault(); applyParams()">
|
|
2190
|
+
@for (p of report().parameters!; track p.name) {
|
|
2191
|
+
<label>
|
|
2192
|
+
<span>{{ p.label || p.name }}</span>
|
|
2193
|
+
@switch (p.type) {
|
|
2194
|
+
@case ('boolean') {
|
|
2195
|
+
<input type="checkbox" [checked]="paramValue(p) === true" (change)="setParam(p, $any($event.target).checked)" />
|
|
2196
|
+
}
|
|
2197
|
+
@case ('date') {
|
|
2198
|
+
<input type="date" [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
2199
|
+
}
|
|
2200
|
+
@case ('number') {
|
|
2201
|
+
<input type="number" [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
2202
|
+
}
|
|
2203
|
+
@default {
|
|
2204
|
+
<input [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
</label>
|
|
2208
|
+
}
|
|
2209
|
+
<button type="submit" class="we-report-viewer__btn we-report-viewer__btn--text">{{ strings().runReport }}</button>
|
|
2210
|
+
</form>
|
|
2211
|
+
}
|
|
2212
|
+
@for (e of loadErrors(); track $index) {
|
|
2213
|
+
<div class="we-report-viewer__error" role="alert">{{ strings().dataLoadError }}: {{ e }}</div>
|
|
2214
|
+
}
|
|
2215
|
+
@for (w of loadWarnings(); track $index) {
|
|
2216
|
+
<div class="we-report-viewer__error">{{ w }}</div>
|
|
2217
|
+
}
|
|
2218
|
+
@if (error(); as message) {
|
|
2219
|
+
<div class="we-report-viewer__error" role="alert">{{ strings().layoutError }}: {{ message }}</div>
|
|
2220
|
+
}
|
|
2221
|
+
@if (document()?.problems?.length) {
|
|
2222
|
+
<details class="we-report-viewer__problems">
|
|
2223
|
+
<summary>{{ strings().problems }} ({{ document()!.problems.length }})</summary>
|
|
2224
|
+
<ul>
|
|
2225
|
+
@for (p of document()!.problems; track $index) {
|
|
2226
|
+
<li>{{ p.controlId ? p.controlId + ': ' : '' }}{{ p.message }}</li>
|
|
2227
|
+
}
|
|
2228
|
+
</ul>
|
|
2229
|
+
</details>
|
|
2230
|
+
}
|
|
2231
|
+
<div class="we-report-viewer__scroll">
|
|
2232
|
+
@if (document(); as doc) {
|
|
2233
|
+
@for (page of doc.pages; track $index) {
|
|
2234
|
+
<we-report-page class="we-report-viewer__page" [page]="page" [zoom]="zoomLevel()" />
|
|
2235
|
+
}
|
|
2236
|
+
} @else if (!error()) {
|
|
2237
|
+
<div class="we-report-viewer__loading">{{ strings().loading }}</div>
|
|
2238
|
+
}
|
|
2239
|
+
</div>
|
|
1013
2240
|
`, 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__spacer{flex:1}.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"] }, { kind: "pipe", type: WeReportIconPipe, name: "weReportIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1014
2241
|
}
|
|
1015
2242
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportViewerComponent, decorators: [{
|
|
1016
2243
|
type: Component,
|
|
1017
|
-
args: [{ selector: 'we-report-viewer', standalone: true, imports: [WeReportPageComponent, WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1018
|
-
<div class="we-report-viewer__toolbar" role="toolbar">
|
|
1019
|
-
<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>
|
|
1020
|
-
<span class="we-report-viewer__zoom">{{ (zoomLevel() * 100).toFixed(0) }}%</span>
|
|
1021
|
-
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() + 0.1)" [attr.aria-label]="strings().zoomIn" [title]="strings().zoomIn" [innerHTML]="'zoomIn' | weReportIcon"></button>
|
|
1022
|
-
<span class="we-report-viewer__pages">{{ pageLabel() }}</span>
|
|
1023
|
-
<span class="we-report-viewer__spacer"></span>
|
|
1024
|
-
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="print()" [disabled]="!document()">
|
|
1025
|
-
<span [innerHTML]="'print' | weReportIcon"></span>{{ strings().print }}
|
|
1026
|
-
</button>
|
|
1027
|
-
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="downloadExcel()" [disabled]="!document()">
|
|
1028
|
-
<span [innerHTML]="'download' | weReportIcon"></span>{{ strings().downloadExcel }}
|
|
1029
|
-
</button>
|
|
1030
|
-
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="downloadPdf()" [disabled]="!document()">
|
|
1031
|
-
<span [innerHTML]="'download' | weReportIcon"></span>{{ strings().downloadPdf }}
|
|
1032
|
-
</button>
|
|
1033
|
-
</div>
|
|
1034
|
-
@if (report().parameters?.length) {
|
|
1035
|
-
<form class="we-report-viewer__params" (submit)="$event.preventDefault(); applyParams()">
|
|
1036
|
-
@for (p of report().parameters!; track p.name) {
|
|
1037
|
-
<label>
|
|
1038
|
-
<span>{{ p.label || p.name }}</span>
|
|
1039
|
-
@switch (p.type) {
|
|
1040
|
-
@case ('boolean') {
|
|
1041
|
-
<input type="checkbox" [checked]="paramValue(p) === true" (change)="setParam(p, $any($event.target).checked)" />
|
|
1042
|
-
}
|
|
1043
|
-
@case ('date') {
|
|
1044
|
-
<input type="date" [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
1045
|
-
}
|
|
1046
|
-
@case ('number') {
|
|
1047
|
-
<input type="number" [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
1048
|
-
}
|
|
1049
|
-
@default {
|
|
1050
|
-
<input [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
</label>
|
|
1054
|
-
}
|
|
1055
|
-
<button type="submit" class="we-report-viewer__btn we-report-viewer__btn--text">{{ strings().runReport }}</button>
|
|
1056
|
-
</form>
|
|
1057
|
-
}
|
|
1058
|
-
@for (e of loadErrors(); track $index) {
|
|
1059
|
-
<div class="we-report-viewer__error" role="alert">{{ strings().dataLoadError }}: {{ e }}</div>
|
|
1060
|
-
}
|
|
1061
|
-
@for (w of loadWarnings(); track $index) {
|
|
1062
|
-
<div class="we-report-viewer__error">{{ w }}</div>
|
|
1063
|
-
}
|
|
1064
|
-
@if (error(); as message) {
|
|
1065
|
-
<div class="we-report-viewer__error" role="alert">{{ strings().layoutError }}: {{ message }}</div>
|
|
1066
|
-
}
|
|
1067
|
-
@if (document()?.problems?.length) {
|
|
1068
|
-
<details class="we-report-viewer__problems">
|
|
1069
|
-
<summary>{{ strings().problems }} ({{ document()!.problems.length }})</summary>
|
|
1070
|
-
<ul>
|
|
1071
|
-
@for (p of document()!.problems; track $index) {
|
|
1072
|
-
<li>{{ p.controlId ? p.controlId + ': ' : '' }}{{ p.message }}</li>
|
|
1073
|
-
}
|
|
1074
|
-
</ul>
|
|
1075
|
-
</details>
|
|
1076
|
-
}
|
|
1077
|
-
<div class="we-report-viewer__scroll">
|
|
1078
|
-
@if (document(); as doc) {
|
|
1079
|
-
@for (page of doc.pages; track $index) {
|
|
1080
|
-
<we-report-page class="we-report-viewer__page" [page]="page" [zoom]="zoomLevel()" />
|
|
1081
|
-
}
|
|
1082
|
-
} @else if (!error()) {
|
|
1083
|
-
<div class="we-report-viewer__loading">{{ strings().loading }}</div>
|
|
1084
|
-
}
|
|
1085
|
-
</div>
|
|
2244
|
+
args: [{ selector: 'we-report-viewer', standalone: true, imports: [WeReportPageComponent, WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2245
|
+
<div class="we-report-viewer__toolbar" role="toolbar">
|
|
2246
|
+
<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>
|
|
2247
|
+
<span class="we-report-viewer__zoom">{{ (zoomLevel() * 100).toFixed(0) }}%</span>
|
|
2248
|
+
<button type="button" class="we-report-viewer__btn" (click)="setZoom(zoomLevel() + 0.1)" [attr.aria-label]="strings().zoomIn" [title]="strings().zoomIn" [innerHTML]="'zoomIn' | weReportIcon"></button>
|
|
2249
|
+
<span class="we-report-viewer__pages">{{ pageLabel() }}</span>
|
|
2250
|
+
<span class="we-report-viewer__spacer"></span>
|
|
2251
|
+
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="print()" [disabled]="!document()">
|
|
2252
|
+
<span [innerHTML]="'print' | weReportIcon"></span>{{ strings().print }}
|
|
2253
|
+
</button>
|
|
2254
|
+
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="downloadExcel()" [disabled]="!document()">
|
|
2255
|
+
<span [innerHTML]="'download' | weReportIcon"></span>{{ strings().downloadExcel }}
|
|
2256
|
+
</button>
|
|
2257
|
+
<button type="button" class="we-report-viewer__btn we-report-viewer__btn--text" (click)="downloadPdf()" [disabled]="!document()">
|
|
2258
|
+
<span [innerHTML]="'download' | weReportIcon"></span>{{ strings().downloadPdf }}
|
|
2259
|
+
</button>
|
|
2260
|
+
</div>
|
|
2261
|
+
@if (report().parameters?.length) {
|
|
2262
|
+
<form class="we-report-viewer__params" (submit)="$event.preventDefault(); applyParams()">
|
|
2263
|
+
@for (p of report().parameters!; track p.name) {
|
|
2264
|
+
<label>
|
|
2265
|
+
<span>{{ p.label || p.name }}</span>
|
|
2266
|
+
@switch (p.type) {
|
|
2267
|
+
@case ('boolean') {
|
|
2268
|
+
<input type="checkbox" [checked]="paramValue(p) === true" (change)="setParam(p, $any($event.target).checked)" />
|
|
2269
|
+
}
|
|
2270
|
+
@case ('date') {
|
|
2271
|
+
<input type="date" [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
2272
|
+
}
|
|
2273
|
+
@case ('number') {
|
|
2274
|
+
<input type="number" [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
2275
|
+
}
|
|
2276
|
+
@default {
|
|
2277
|
+
<input [value]="paramValue(p) ?? ''" (input)="setParam(p, $any($event.target).value)" />
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
</label>
|
|
2281
|
+
}
|
|
2282
|
+
<button type="submit" class="we-report-viewer__btn we-report-viewer__btn--text">{{ strings().runReport }}</button>
|
|
2283
|
+
</form>
|
|
2284
|
+
}
|
|
2285
|
+
@for (e of loadErrors(); track $index) {
|
|
2286
|
+
<div class="we-report-viewer__error" role="alert">{{ strings().dataLoadError }}: {{ e }}</div>
|
|
2287
|
+
}
|
|
2288
|
+
@for (w of loadWarnings(); track $index) {
|
|
2289
|
+
<div class="we-report-viewer__error">{{ w }}</div>
|
|
2290
|
+
}
|
|
2291
|
+
@if (error(); as message) {
|
|
2292
|
+
<div class="we-report-viewer__error" role="alert">{{ strings().layoutError }}: {{ message }}</div>
|
|
2293
|
+
}
|
|
2294
|
+
@if (document()?.problems?.length) {
|
|
2295
|
+
<details class="we-report-viewer__problems">
|
|
2296
|
+
<summary>{{ strings().problems }} ({{ document()!.problems.length }})</summary>
|
|
2297
|
+
<ul>
|
|
2298
|
+
@for (p of document()!.problems; track $index) {
|
|
2299
|
+
<li>{{ p.controlId ? p.controlId + ': ' : '' }}{{ p.message }}</li>
|
|
2300
|
+
}
|
|
2301
|
+
</ul>
|
|
2302
|
+
</details>
|
|
2303
|
+
}
|
|
2304
|
+
<div class="we-report-viewer__scroll">
|
|
2305
|
+
@if (document(); as doc) {
|
|
2306
|
+
@for (page of doc.pages; track $index) {
|
|
2307
|
+
<we-report-page class="we-report-viewer__page" [page]="page" [zoom]="zoomLevel()" />
|
|
2308
|
+
}
|
|
2309
|
+
} @else if (!error()) {
|
|
2310
|
+
<div class="we-report-viewer__loading">{{ strings().loading }}</div>
|
|
2311
|
+
}
|
|
2312
|
+
</div>
|
|
1086
2313
|
`, 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__spacer{flex:1}.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"] }]
|
|
1087
2314
|
}], ctorParameters: () => [] });
|
|
1088
2315
|
|
|
@@ -1096,6 +2323,7 @@ const TOOLBOX_ITEMS = [
|
|
|
1096
2323
|
{ type: 'barcode', icon: 'qrcode', variant: 'qrcode' },
|
|
1097
2324
|
{ type: 'pageInfo', icon: 'pageInfo' },
|
|
1098
2325
|
{ type: 'checkbox', icon: 'checkbox' },
|
|
2326
|
+
{ type: 'chart', icon: 'chart' },
|
|
1099
2327
|
];
|
|
1100
2328
|
/** A new control with sensible defaults, top-left corner at (x, y) mm. */
|
|
1101
2329
|
function createControl(type, id, x, y, text, variant) {
|
|
@@ -1117,6 +2345,8 @@ function createControl(type, id, x, y, text, variant) {
|
|
|
1117
2345
|
return { ...base, type, width: 40, height: 6, info: 'pageNofM' };
|
|
1118
2346
|
case 'checkbox':
|
|
1119
2347
|
return { ...base, type, width: 5, height: 5, checked: true };
|
|
2348
|
+
case 'chart':
|
|
2349
|
+
return { ...base, type, width: 120, height: 60, chartType: 'column', category: { expression: '' }, value: { expression: '' }, showValues: true };
|
|
1120
2350
|
}
|
|
1121
2351
|
}
|
|
1122
2352
|
/** Default display format for a data field type. */
|
|
@@ -1130,6 +2360,9 @@ function fieldExpression(path, parent) {
|
|
|
1130
2360
|
return `[${parent ? '^.' : ''}${path}]`;
|
|
1131
2361
|
}
|
|
1132
2362
|
|
|
2363
|
+
/** Module-wide, so copy in one designer and paste in another on the same page works. */
|
|
2364
|
+
let clipboard = [];
|
|
2365
|
+
const round$1 = (v) => Math.round(v * 100) / 100;
|
|
1133
2366
|
const HISTORY_LIMIT = 200;
|
|
1134
2367
|
const COALESCE_MS = 800;
|
|
1135
2368
|
/** Copies the editable parts; data source payloads (possibly large) are shared, never mutated. */
|
|
@@ -1152,6 +2385,8 @@ class DesignerState {
|
|
|
1152
2385
|
selection = signal({ kind: 'none' });
|
|
1153
2386
|
canUndo = signal(false);
|
|
1154
2387
|
canRedo = signal(false);
|
|
2388
|
+
/** The first data row and its scope, for live values in the design and the formula editor. */
|
|
2389
|
+
sample = signal(null);
|
|
1155
2390
|
selectedControls = computed(() => {
|
|
1156
2391
|
const sel = this.selection();
|
|
1157
2392
|
if (sel.kind !== 'controls')
|
|
@@ -1277,6 +2512,134 @@ class DesignerState {
|
|
|
1277
2512
|
this.update((d) => copies.forEach(({ bandId, control }) => d.bands.find((b) => b.id === bandId).controls.push(control)));
|
|
1278
2513
|
this.selection.set({ kind: 'controls', ids: copies.map((c) => c.control.id) });
|
|
1279
2514
|
}
|
|
2515
|
+
/** Copies the selected controls to the designer clipboard (shared by every designer on the page). */
|
|
2516
|
+
copySelection() {
|
|
2517
|
+
const controls = this.selectedControls();
|
|
2518
|
+
if (!controls.length)
|
|
2519
|
+
return false;
|
|
2520
|
+
clipboard = controls.map((c) => ({ bandKind: this.findBandOf(c.id).kind, control: structuredClone(c) }));
|
|
2521
|
+
return true;
|
|
2522
|
+
}
|
|
2523
|
+
cutSelection() {
|
|
2524
|
+
if (this.copySelection())
|
|
2525
|
+
this.deleteSelection();
|
|
2526
|
+
}
|
|
2527
|
+
/** Pastes into `bandId`, else the selected band, else each control's original kind of band. */
|
|
2528
|
+
paste(bandId) {
|
|
2529
|
+
if (!clipboard.length)
|
|
2530
|
+
return;
|
|
2531
|
+
const def = this.report();
|
|
2532
|
+
const sel = this.selection();
|
|
2533
|
+
const target = bandId ?? (sel.kind === 'band' ? sel.id : sel.kind === 'controls' ? this.findBandOf(sel.ids[0])?.id : undefined);
|
|
2534
|
+
const used = new Set(def.bands.flatMap((b) => [b.id, ...b.controls.map((c) => c.id)]));
|
|
2535
|
+
const placed = [];
|
|
2536
|
+
for (const item of clipboard) {
|
|
2537
|
+
const band = def.bands.find((b) => b.id === target) ?? def.bands.find((b) => b.kind === item.bandKind) ?? def.bands.find((b) => b.kind === 'detail');
|
|
2538
|
+
if (!band)
|
|
2539
|
+
continue;
|
|
2540
|
+
let n = 1;
|
|
2541
|
+
while (used.has(`${item.control.type}${n}`))
|
|
2542
|
+
n++;
|
|
2543
|
+
const id = `${item.control.type}${n}`;
|
|
2544
|
+
used.add(id);
|
|
2545
|
+
// Offset only when pasting over the original, so a paste into another band keeps its position.
|
|
2546
|
+
const shift = band.controls.some((c) => c.x === item.control.x && c.y === item.control.y) ? 3 : 0;
|
|
2547
|
+
placed.push({ bandId: band.id, control: { ...structuredClone(item.control), id, x: item.control.x + shift, y: item.control.y + shift } });
|
|
2548
|
+
}
|
|
2549
|
+
if (!placed.length)
|
|
2550
|
+
return;
|
|
2551
|
+
this.update((d) => placed.forEach(({ bandId: b, control }) => {
|
|
2552
|
+
const band = d.bands.find((x) => x.id === b);
|
|
2553
|
+
band.controls.push(control);
|
|
2554
|
+
band.height = Math.max(band.height, control.y + control.height);
|
|
2555
|
+
}));
|
|
2556
|
+
this.selection.set({ kind: 'controls', ids: placed.map((p) => p.control.id) });
|
|
2557
|
+
}
|
|
2558
|
+
hasClipboard() {
|
|
2559
|
+
return clipboard.length > 0;
|
|
2560
|
+
}
|
|
2561
|
+
/** Selects every control of the selected band, or of the whole report. */
|
|
2562
|
+
selectAll() {
|
|
2563
|
+
const sel = this.selection();
|
|
2564
|
+
const bandId = sel.kind === 'band' ? sel.id : sel.kind === 'controls' ? this.findBandOf(sel.ids[0])?.id : undefined;
|
|
2565
|
+
const bands = this.report().bands.filter((b) => !bandId || b.id === bandId);
|
|
2566
|
+
const ids = bands.flatMap((b) => b.controls.map((c) => c.id));
|
|
2567
|
+
this.selection.set(ids.length ? { kind: 'controls', ids } : { kind: 'none' });
|
|
2568
|
+
}
|
|
2569
|
+
/** Aligns the selection to the first selected control (the one clicked first). */
|
|
2570
|
+
align(edge) {
|
|
2571
|
+
const controls = this.selectedControls();
|
|
2572
|
+
const sel = this.selection();
|
|
2573
|
+
if (controls.length < 2 || sel.kind !== 'controls')
|
|
2574
|
+
return;
|
|
2575
|
+
const ref = controls.find((c) => c.id === sel.ids[0]);
|
|
2576
|
+
this.updateControls(sel.ids, (c) => {
|
|
2577
|
+
if (edge === 'left')
|
|
2578
|
+
c.x = ref.x;
|
|
2579
|
+
else if (edge === 'right')
|
|
2580
|
+
c.x = round$1(ref.x + ref.width - c.width);
|
|
2581
|
+
else if (edge === 'center')
|
|
2582
|
+
c.x = round$1(ref.x + (ref.width - c.width) / 2);
|
|
2583
|
+
else if (edge === 'top')
|
|
2584
|
+
c.y = ref.y;
|
|
2585
|
+
else if (edge === 'bottom')
|
|
2586
|
+
c.y = round$1(ref.y + ref.height - c.height);
|
|
2587
|
+
else
|
|
2588
|
+
c.y = round$1(ref.y + (ref.height - c.height) / 2);
|
|
2589
|
+
c.x = Math.max(0, c.x);
|
|
2590
|
+
c.y = Math.max(0, c.y);
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
/** Equal gaps between three or more controls, keeping the outermost two in place. */
|
|
2594
|
+
distribute(axis) {
|
|
2595
|
+
const controls = this.selectedControls();
|
|
2596
|
+
if (controls.length < 3)
|
|
2597
|
+
return;
|
|
2598
|
+
const pos = axis === 'h' ? 'x' : 'y';
|
|
2599
|
+
const size = axis === 'h' ? 'width' : 'height';
|
|
2600
|
+
const sorted = [...controls].sort((a, b) => a[pos] - b[pos]);
|
|
2601
|
+
const first = sorted[0];
|
|
2602
|
+
const last = sorted[sorted.length - 1];
|
|
2603
|
+
const total = sorted.reduce((sum, c) => sum + c[size], 0);
|
|
2604
|
+
const gap = (last[pos] + last[size] - first[pos] - total) / (sorted.length - 1);
|
|
2605
|
+
const target = new Map();
|
|
2606
|
+
let at = first[pos];
|
|
2607
|
+
for (const c of sorted) {
|
|
2608
|
+
target.set(c.id, round$1(at));
|
|
2609
|
+
at += c[size] + gap;
|
|
2610
|
+
}
|
|
2611
|
+
this.updateControls(sorted.map((c) => c.id), (c) => (c[pos] = target.get(c.id)));
|
|
2612
|
+
}
|
|
2613
|
+
/** Gives the selection the width and/or height of the first selected control. */
|
|
2614
|
+
sameSize(dimension) {
|
|
2615
|
+
const sel = this.selection();
|
|
2616
|
+
const controls = this.selectedControls();
|
|
2617
|
+
if (controls.length < 2 || sel.kind !== 'controls')
|
|
2618
|
+
return;
|
|
2619
|
+
const ref = controls.find((c) => c.id === sel.ids[0]);
|
|
2620
|
+
this.updateControls(sel.ids, (c, band) => {
|
|
2621
|
+
if (dimension !== 'height')
|
|
2622
|
+
c.width = ref.width;
|
|
2623
|
+
if (dimension !== 'width')
|
|
2624
|
+
c.height = ref.height;
|
|
2625
|
+
band.height = Math.max(band.height, c.y + c.height);
|
|
2626
|
+
});
|
|
2627
|
+
}
|
|
2628
|
+
/** Draw order inside a band: later controls paint on top. */
|
|
2629
|
+
arrange(to) {
|
|
2630
|
+
const sel = this.selection();
|
|
2631
|
+
if (sel.kind !== 'controls')
|
|
2632
|
+
return;
|
|
2633
|
+
this.update((d) => {
|
|
2634
|
+
for (const band of d.bands) {
|
|
2635
|
+
const moving = band.controls.filter((c) => sel.ids.includes(c.id));
|
|
2636
|
+
if (!moving.length)
|
|
2637
|
+
continue;
|
|
2638
|
+
const rest = band.controls.filter((c) => !sel.ids.includes(c.id));
|
|
2639
|
+
band.controls = to === 'front' ? [...rest, ...moving] : [...moving, ...rest];
|
|
2640
|
+
}
|
|
2641
|
+
});
|
|
2642
|
+
}
|
|
1280
2643
|
select(id, additive) {
|
|
1281
2644
|
const sel = this.selection();
|
|
1282
2645
|
if (additive && sel.kind === 'controls') {
|
|
@@ -1328,6 +2691,32 @@ class DesignSurfaceComponent {
|
|
|
1328
2691
|
handles = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'];
|
|
1329
2692
|
guides = signal([]);
|
|
1330
2693
|
geometry = computed(() => resolvePageGeometry(this.state.report().page));
|
|
2694
|
+
/** Top ruler in screen pixels: 0 at the left margin, a tick per millimetre, a label per centimetre. */
|
|
2695
|
+
ruler = computed(() => {
|
|
2696
|
+
const page = this.state.report().page;
|
|
2697
|
+
const geometry = this.geometry();
|
|
2698
|
+
const px = PX_PER_MM * this.zoom();
|
|
2699
|
+
const left = page.margins.left * px;
|
|
2700
|
+
const step = this.zoom() < 0.6 ? 5 : 1;
|
|
2701
|
+
let ticks = '';
|
|
2702
|
+
const labels = [];
|
|
2703
|
+
for (let mm = -Math.floor(page.margins.left / step) * step; mm <= geometry.width - page.margins.left; mm += step) {
|
|
2704
|
+
const x = Math.round((left + mm * px) * 10) / 10;
|
|
2705
|
+
const h = mm % 10 === 0 ? 8 : mm % 5 === 0 ? 5 : 3;
|
|
2706
|
+
ticks += `M${x} 20v-${h}`;
|
|
2707
|
+
if (mm % 10 === 0 && mm >= 0)
|
|
2708
|
+
labels.push({ x, text: String(mm / 10) });
|
|
2709
|
+
}
|
|
2710
|
+
const selected = this.state.selectedControls();
|
|
2711
|
+
const selection = selected.length
|
|
2712
|
+
? (() => {
|
|
2713
|
+
const x1 = Math.min(...selected.map((c) => c.x));
|
|
2714
|
+
const x2 = Math.max(...selected.map((c) => c.x + c.width));
|
|
2715
|
+
return { x: left + x1 * px, width: (x2 - x1) * px };
|
|
2716
|
+
})()
|
|
2717
|
+
: null;
|
|
2718
|
+
return { width: geometry.width * px, left, right: page.margins.right * px, ticks, labels, selection };
|
|
2719
|
+
});
|
|
1331
2720
|
padding = computed(() => {
|
|
1332
2721
|
const { top, right, bottom, left } = this.state.report().page.margins;
|
|
1333
2722
|
const z = this.zoom();
|
|
@@ -1374,7 +2763,8 @@ class DesignSurfaceComponent {
|
|
|
1374
2763
|
if (!sample)
|
|
1375
2764
|
return c.text.expression;
|
|
1376
2765
|
try {
|
|
1377
|
-
const
|
|
2766
|
+
const report = this.state.report();
|
|
2767
|
+
const options = { locale: report.locale || this.config.locale || 'en-US', currency: report.currency || this.config.currency || 'USD' };
|
|
1378
2768
|
const value = evaluate(c.text.expression, { ...sample, ...options, now: new Date() });
|
|
1379
2769
|
return typeof value === 'string' && !c.format ? value : formatValue(value, c.format, options);
|
|
1380
2770
|
}
|
|
@@ -1687,11 +3077,35 @@ class DesignSurfaceComponent {
|
|
|
1687
3077
|
const y = this.snapToGrid((e.clientY - rect.top) / scale, true);
|
|
1688
3078
|
this.dropAt(data, band, x, y);
|
|
1689
3079
|
}
|
|
3080
|
+
defaultWatermarkColor = DEFAULT_WATERMARK_COLOR;
|
|
3081
|
+
/** Fixed watermark text, or its formula, shown faintly on the design page. */
|
|
3082
|
+
watermarkText() {
|
|
3083
|
+
const text = this.state.report().watermark?.text;
|
|
3084
|
+
return text === undefined ? '' : isExpression(text) ? text.expression : text;
|
|
3085
|
+
}
|
|
3086
|
+
chartLabel(c) {
|
|
3087
|
+
if (c.type !== 'chart')
|
|
3088
|
+
return '';
|
|
3089
|
+
const s = this.strings();
|
|
3090
|
+
const type = { column: s.chartColumn, bar: s.chartBar, line: s.chartLine, pie: s.chartPie, doughnut: s.chartDoughnut }[c.chartType];
|
|
3091
|
+
return c.category.expression ? `${type}: ${c.value.expression} / ${c.category.expression}` : type;
|
|
3092
|
+
}
|
|
1690
3093
|
/** Creates controls for a drop at (x, y) mm inside `band`. */
|
|
1691
3094
|
dropAt(data, band, x, y) {
|
|
1692
3095
|
const width = this.geometry().contentWidth;
|
|
1693
3096
|
if (data.kind === 'control') {
|
|
1694
3097
|
const control = createControl(data.type, this.state.newId(data.type), x, y, this.strings().newText, data.variant);
|
|
3098
|
+
if (control.type === 'chart') {
|
|
3099
|
+
// Start bound to the data: the first text field per the first number field.
|
|
3100
|
+
const row = this.sample()?.row;
|
|
3101
|
+
const entries = row && typeof row === 'object' ? Object.entries(row) : [];
|
|
3102
|
+
const text = entries.find(([, v]) => typeof v === 'string')?.[0];
|
|
3103
|
+
const number = entries.find(([, v]) => typeof v === 'number')?.[0];
|
|
3104
|
+
if (text && number) {
|
|
3105
|
+
control.category = { expression: `[${text}]` };
|
|
3106
|
+
control.value = { expression: `[${number}]` };
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
1695
3109
|
control.x = round(Math.max(0, Math.min(x, width - control.width)));
|
|
1696
3110
|
control.y = round(Math.max(0, y));
|
|
1697
3111
|
this.growBand(band, [control]);
|
|
@@ -1732,169 +3146,213 @@ class DesignSurfaceComponent {
|
|
|
1732
3146
|
this.state.selection.set({ kind: 'controls', ids: controls.map((c) => c.id) });
|
|
1733
3147
|
}
|
|
1734
3148
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignSurfaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1735
|
-
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: `
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
</
|
|
1791
|
-
}
|
|
1792
|
-
@case ('
|
|
1793
|
-
<div class="
|
|
1794
|
-
}
|
|
1795
|
-
@
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
3149
|
+
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: `
|
|
3150
|
+
@let r = ruler();
|
|
3151
|
+
<svg class="ds__ruler" aria-hidden="true" [attr.width]="r.width" height="20" [attr.viewBox]="'0 0 ' + r.width + ' 20'">
|
|
3152
|
+
<rect class="ds__ruler-margin" x="0" y="0" [attr.width]="r.left" height="20" />
|
|
3153
|
+
<rect class="ds__ruler-margin" [attr.x]="r.width - r.right" y="0" [attr.width]="r.right" height="20" />
|
|
3154
|
+
@if (r.selection; as sel) {
|
|
3155
|
+
<rect class="ds__ruler-selection" [attr.x]="sel.x" y="0" [attr.width]="sel.width" height="20" />
|
|
3156
|
+
}
|
|
3157
|
+
<path class="ds__ruler-ticks" [attr.d]="r.ticks" />
|
|
3158
|
+
@for (l of r.labels; track l.x) {
|
|
3159
|
+
<text [attr.x]="l.x + 2" y="9">{{ l.text }}</text>
|
|
3160
|
+
}
|
|
3161
|
+
</svg>
|
|
3162
|
+
<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()">
|
|
3163
|
+
@if (watermarkText(); as wm) {
|
|
3164
|
+
<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>
|
|
3165
|
+
}
|
|
3166
|
+
@for (band of state.report().bands; track band.id) {
|
|
3167
|
+
<div class="ds__band" [class.ds__band--selected]="isBandSelected(band.id)">
|
|
3168
|
+
<button type="button" class="ds__band-label" [title]="bandLabel(band)" (click)="selectBand(band.id)">
|
|
3169
|
+
{{ bandLabel(band) }}
|
|
3170
|
+
</button>
|
|
3171
|
+
<div
|
|
3172
|
+
class="ds__band-body"
|
|
3173
|
+
[attr.data-band-id]="band.id"
|
|
3174
|
+
[style.height.mm]="band.height * zoom()"
|
|
3175
|
+
[style.background-color]="band.backgroundColor ?? null"
|
|
3176
|
+
[style.background-size.mm]="gridSize() * zoom()"
|
|
3177
|
+
(pointerdown)="onBodyPointerDown($event)"
|
|
3178
|
+
(dragover)="onDragOver($event)"
|
|
3179
|
+
(drop)="onDrop($event, band)"
|
|
3180
|
+
>
|
|
3181
|
+
@for (c of band.controls; track c.id) {
|
|
3182
|
+
<div
|
|
3183
|
+
class="ds__control"
|
|
3184
|
+
[attr.data-control-id]="c.id"
|
|
3185
|
+
[class.ds__control--selected]="isSelected(c.id)"
|
|
3186
|
+
[attr.data-type]="c.type"
|
|
3187
|
+
[style.left.mm]="c.x * zoom()"
|
|
3188
|
+
[style.top.mm]="c.y * zoom()"
|
|
3189
|
+
[style.width.mm]="c.width * zoom()"
|
|
3190
|
+
[style.height.mm]="c.height * zoom()"
|
|
3191
|
+
(pointerdown)="onControlPointerDown($event, c, band)"
|
|
3192
|
+
>
|
|
3193
|
+
@switch (c.type) {
|
|
3194
|
+
@case ('line') {
|
|
3195
|
+
<svg class="ds__fill" preserveAspectRatio="none" [attr.viewBox]="'0 0 ' + c.width + ' ' + c.height">
|
|
3196
|
+
<line
|
|
3197
|
+
[attr.x1]="lineCoords(c)[0]"
|
|
3198
|
+
[attr.y1]="lineCoords(c)[1]"
|
|
3199
|
+
[attr.x2]="lineCoords(c)[2]"
|
|
3200
|
+
[attr.y2]="lineCoords(c)[3]"
|
|
3201
|
+
[attr.stroke]="lineColor(c)"
|
|
3202
|
+
[attr.stroke-width]="lineWidth(c)"
|
|
3203
|
+
/>
|
|
3204
|
+
</svg>
|
|
3205
|
+
}
|
|
3206
|
+
@case ('shape') {
|
|
3207
|
+
<div class="ds__fill" [style]="shapeStyle(c)"></div>
|
|
3208
|
+
}
|
|
3209
|
+
@case ('image') {
|
|
3210
|
+
@if (staticImage(c); as src) {
|
|
3211
|
+
<img class="ds__fill ds__image" [src]="src" [style.object-fit]="objectFit(c)" alt="" />
|
|
3212
|
+
} @else {
|
|
3213
|
+
<div class="ds__placeholder" [innerHTML]="'image' | weReportIcon"></div>
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
@case ('barcode') {
|
|
3217
|
+
<div class="ds__placeholder">
|
|
3218
|
+
<span [innerHTML]="(isQr(c) ? 'qrcode' : 'barcode') | weReportIcon"></span>
|
|
3219
|
+
<small>{{ barcodeLabel(c) }}</small>
|
|
3220
|
+
</div>
|
|
3221
|
+
}
|
|
3222
|
+
@case ('chart') {
|
|
3223
|
+
<div class="ds__placeholder ds__chart">
|
|
3224
|
+
<span [innerHTML]="'chart' | weReportIcon"></span>
|
|
3225
|
+
<small>{{ chartLabel(c) }}</small>
|
|
3226
|
+
</div>
|
|
3227
|
+
}
|
|
3228
|
+
@case ('checkbox') {
|
|
3229
|
+
<div class="ds__placeholder" [innerHTML]="'checkbox' | weReportIcon"></div>
|
|
3230
|
+
}
|
|
3231
|
+
@default {
|
|
3232
|
+
<div class="ds__text" [class.ds__text--bound]="isBound(c)" [style]="textStyle(c)" [attr.title]="isBound(c) ? boundExpression(c) : null">{{ caption(c) }}</div>
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
@if (isOnlySelected(c.id)) {
|
|
3236
|
+
@for (h of handles; track h) {
|
|
3237
|
+
<span class="ds__handle" [attr.data-handle]="h" (pointerdown)="onHandlePointerDown($event, c, band, h)"></span>
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
</div>
|
|
3241
|
+
}
|
|
3242
|
+
@for (g of guidesFor(band.id); track $index) {
|
|
3243
|
+
<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>
|
|
3244
|
+
}
|
|
3245
|
+
</div>
|
|
3246
|
+
<div class="ds__band-resize" (pointerdown)="onBandResizePointerDown($event, band)" [title]="strings().bandHeight"></div>
|
|
3247
|
+
</div>
|
|
3248
|
+
}
|
|
3249
|
+
</div>
|
|
3250
|
+
`, 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__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__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"], dependencies: [{ kind: "pipe", type: WeReportIconPipe, name: "weReportIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1815
3251
|
}
|
|
1816
3252
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignSurfaceComponent, decorators: [{
|
|
1817
3253
|
type: Component,
|
|
1818
|
-
args: [{ selector: 'we-report-design-surface', standalone: true, imports: [WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { tabindex: '0' }, template: `
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
</
|
|
1874
|
-
}
|
|
1875
|
-
@case ('
|
|
1876
|
-
<div class="
|
|
1877
|
-
}
|
|
1878
|
-
@
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
3254
|
+
args: [{ selector: 'we-report-design-surface', standalone: true, imports: [WeReportIconPipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { tabindex: '0' }, template: `
|
|
3255
|
+
@let r = ruler();
|
|
3256
|
+
<svg class="ds__ruler" aria-hidden="true" [attr.width]="r.width" height="20" [attr.viewBox]="'0 0 ' + r.width + ' 20'">
|
|
3257
|
+
<rect class="ds__ruler-margin" x="0" y="0" [attr.width]="r.left" height="20" />
|
|
3258
|
+
<rect class="ds__ruler-margin" [attr.x]="r.width - r.right" y="0" [attr.width]="r.right" height="20" />
|
|
3259
|
+
@if (r.selection; as sel) {
|
|
3260
|
+
<rect class="ds__ruler-selection" [attr.x]="sel.x" y="0" [attr.width]="sel.width" height="20" />
|
|
3261
|
+
}
|
|
3262
|
+
<path class="ds__ruler-ticks" [attr.d]="r.ticks" />
|
|
3263
|
+
@for (l of r.labels; track l.x) {
|
|
3264
|
+
<text [attr.x]="l.x + 2" y="9">{{ l.text }}</text>
|
|
3265
|
+
}
|
|
3266
|
+
</svg>
|
|
3267
|
+
<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()">
|
|
3268
|
+
@if (watermarkText(); as wm) {
|
|
3269
|
+
<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>
|
|
3270
|
+
}
|
|
3271
|
+
@for (band of state.report().bands; track band.id) {
|
|
3272
|
+
<div class="ds__band" [class.ds__band--selected]="isBandSelected(band.id)">
|
|
3273
|
+
<button type="button" class="ds__band-label" [title]="bandLabel(band)" (click)="selectBand(band.id)">
|
|
3274
|
+
{{ bandLabel(band) }}
|
|
3275
|
+
</button>
|
|
3276
|
+
<div
|
|
3277
|
+
class="ds__band-body"
|
|
3278
|
+
[attr.data-band-id]="band.id"
|
|
3279
|
+
[style.height.mm]="band.height * zoom()"
|
|
3280
|
+
[style.background-color]="band.backgroundColor ?? null"
|
|
3281
|
+
[style.background-size.mm]="gridSize() * zoom()"
|
|
3282
|
+
(pointerdown)="onBodyPointerDown($event)"
|
|
3283
|
+
(dragover)="onDragOver($event)"
|
|
3284
|
+
(drop)="onDrop($event, band)"
|
|
3285
|
+
>
|
|
3286
|
+
@for (c of band.controls; track c.id) {
|
|
3287
|
+
<div
|
|
3288
|
+
class="ds__control"
|
|
3289
|
+
[attr.data-control-id]="c.id"
|
|
3290
|
+
[class.ds__control--selected]="isSelected(c.id)"
|
|
3291
|
+
[attr.data-type]="c.type"
|
|
3292
|
+
[style.left.mm]="c.x * zoom()"
|
|
3293
|
+
[style.top.mm]="c.y * zoom()"
|
|
3294
|
+
[style.width.mm]="c.width * zoom()"
|
|
3295
|
+
[style.height.mm]="c.height * zoom()"
|
|
3296
|
+
(pointerdown)="onControlPointerDown($event, c, band)"
|
|
3297
|
+
>
|
|
3298
|
+
@switch (c.type) {
|
|
3299
|
+
@case ('line') {
|
|
3300
|
+
<svg class="ds__fill" preserveAspectRatio="none" [attr.viewBox]="'0 0 ' + c.width + ' ' + c.height">
|
|
3301
|
+
<line
|
|
3302
|
+
[attr.x1]="lineCoords(c)[0]"
|
|
3303
|
+
[attr.y1]="lineCoords(c)[1]"
|
|
3304
|
+
[attr.x2]="lineCoords(c)[2]"
|
|
3305
|
+
[attr.y2]="lineCoords(c)[3]"
|
|
3306
|
+
[attr.stroke]="lineColor(c)"
|
|
3307
|
+
[attr.stroke-width]="lineWidth(c)"
|
|
3308
|
+
/>
|
|
3309
|
+
</svg>
|
|
3310
|
+
}
|
|
3311
|
+
@case ('shape') {
|
|
3312
|
+
<div class="ds__fill" [style]="shapeStyle(c)"></div>
|
|
3313
|
+
}
|
|
3314
|
+
@case ('image') {
|
|
3315
|
+
@if (staticImage(c); as src) {
|
|
3316
|
+
<img class="ds__fill ds__image" [src]="src" [style.object-fit]="objectFit(c)" alt="" />
|
|
3317
|
+
} @else {
|
|
3318
|
+
<div class="ds__placeholder" [innerHTML]="'image' | weReportIcon"></div>
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
@case ('barcode') {
|
|
3322
|
+
<div class="ds__placeholder">
|
|
3323
|
+
<span [innerHTML]="(isQr(c) ? 'qrcode' : 'barcode') | weReportIcon"></span>
|
|
3324
|
+
<small>{{ barcodeLabel(c) }}</small>
|
|
3325
|
+
</div>
|
|
3326
|
+
}
|
|
3327
|
+
@case ('chart') {
|
|
3328
|
+
<div class="ds__placeholder ds__chart">
|
|
3329
|
+
<span [innerHTML]="'chart' | weReportIcon"></span>
|
|
3330
|
+
<small>{{ chartLabel(c) }}</small>
|
|
3331
|
+
</div>
|
|
3332
|
+
}
|
|
3333
|
+
@case ('checkbox') {
|
|
3334
|
+
<div class="ds__placeholder" [innerHTML]="'checkbox' | weReportIcon"></div>
|
|
3335
|
+
}
|
|
3336
|
+
@default {
|
|
3337
|
+
<div class="ds__text" [class.ds__text--bound]="isBound(c)" [style]="textStyle(c)" [attr.title]="isBound(c) ? boundExpression(c) : null">{{ caption(c) }}</div>
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
@if (isOnlySelected(c.id)) {
|
|
3341
|
+
@for (h of handles; track h) {
|
|
3342
|
+
<span class="ds__handle" [attr.data-handle]="h" (pointerdown)="onHandlePointerDown($event, c, band, h)"></span>
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
</div>
|
|
3346
|
+
}
|
|
3347
|
+
@for (g of guidesFor(band.id); track $index) {
|
|
3348
|
+
<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>
|
|
3349
|
+
}
|
|
3350
|
+
</div>
|
|
3351
|
+
<div class="ds__band-resize" (pointerdown)="onBandResizePointerDown($event, band)" [title]="strings().bandHeight"></div>
|
|
3352
|
+
</div>
|
|
3353
|
+
}
|
|
3354
|
+
</div>
|
|
3355
|
+
`, 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__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__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"] }]
|
|
1898
3356
|
}] });
|
|
1899
3357
|
function round(v) {
|
|
1900
3358
|
return Math.round(v * 100) / 100;
|
|
@@ -1935,6 +3393,169 @@ function designerFields(report, data) {
|
|
|
1935
3393
|
return { rows, parent };
|
|
1936
3394
|
}
|
|
1937
3395
|
|
|
3396
|
+
const CATEGORIES = [
|
|
3397
|
+
{ id: 'logic', label: 'fnLogic' },
|
|
3398
|
+
{ id: 'text', label: 'fnText' },
|
|
3399
|
+
{ id: 'number', label: 'fnNumber' },
|
|
3400
|
+
{ id: 'date', label: 'fnDate' },
|
|
3401
|
+
{ id: 'aggregate', label: 'fnAggregate' },
|
|
3402
|
+
];
|
|
3403
|
+
/**
|
|
3404
|
+
* A sheet for writing a formula: fields, parameters and every function with a one-line
|
|
3405
|
+
* explanation, inserted at the cursor, and the result for the first data row as you type.
|
|
3406
|
+
*/
|
|
3407
|
+
class ExpressionEditorComponent {
|
|
3408
|
+
expression = input('');
|
|
3409
|
+
fields = input([]);
|
|
3410
|
+
strings = input.required();
|
|
3411
|
+
applied = output();
|
|
3412
|
+
closed = output();
|
|
3413
|
+
state = inject(DesignerState);
|
|
3414
|
+
config = inject(WE_REPORT_CONFIG);
|
|
3415
|
+
area = viewChild.required('area');
|
|
3416
|
+
categories = CATEGORIES;
|
|
3417
|
+
draft = signal('');
|
|
3418
|
+
category = signal('logic');
|
|
3419
|
+
parameters = computed(() => this.state.report().parameters ?? []);
|
|
3420
|
+
visibleFunctions = computed(() => EXPRESSION_FUNCTIONS.filter((f) => f.category === this.category()));
|
|
3421
|
+
/** What the formula gives for the first row, or why it cannot be evaluated. */
|
|
3422
|
+
result = computed(() => {
|
|
3423
|
+
const formula = this.draft().trim();
|
|
3424
|
+
if (!formula)
|
|
3425
|
+
return { text: this.strings().formulaEmpty, error: false };
|
|
3426
|
+
const report = this.state.report();
|
|
3427
|
+
const options = { locale: report.locale || this.config.locale || 'en-US', currency: report.currency || this.config.currency || 'USD' };
|
|
3428
|
+
const sample = this.state.sample();
|
|
3429
|
+
try {
|
|
3430
|
+
const value = evaluate(formula, { ...sample, params: resolveParameters(this.parameters()), ...options, now: new Date() });
|
|
3431
|
+
const text = typeof value === 'string' ? value : formatValue(value, undefined, options);
|
|
3432
|
+
return { text: text === '' ? this.strings().formulaEmpty : text, error: false };
|
|
3433
|
+
}
|
|
3434
|
+
catch (e) {
|
|
3435
|
+
return { text: e.message, error: true };
|
|
3436
|
+
}
|
|
3437
|
+
});
|
|
3438
|
+
ngAfterViewInit() {
|
|
3439
|
+
// The textarea owns its text (no [value] binding), so inserting never moves the caret.
|
|
3440
|
+
const el = this.area().nativeElement;
|
|
3441
|
+
el.value = this.expression();
|
|
3442
|
+
this.draft.set(el.value);
|
|
3443
|
+
queueMicrotask(() => el.focus());
|
|
3444
|
+
}
|
|
3445
|
+
/** Inserts at the caret (replacing a selection); `caretBack` moves the caret left afterwards. */
|
|
3446
|
+
insert(text, caretBack = 0) {
|
|
3447
|
+
const el = this.area().nativeElement;
|
|
3448
|
+
el.focus();
|
|
3449
|
+
el.setRangeText(text, el.selectionStart, el.selectionEnd, 'end');
|
|
3450
|
+
el.selectionStart = el.selectionEnd = el.selectionEnd - caretBack;
|
|
3451
|
+
this.draft.set(el.value);
|
|
3452
|
+
}
|
|
3453
|
+
/** Inserts `Name()` and puts the cursor between the brackets. */
|
|
3454
|
+
insertFunction(f) {
|
|
3455
|
+
this.insert(`${f.name}()`, 1);
|
|
3456
|
+
}
|
|
3457
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExpressionEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3458
|
+
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: `
|
|
3459
|
+
@let s = strings();
|
|
3460
|
+
<div class="xe__backdrop" (click)="closed.emit()"></div>
|
|
3461
|
+
<div class="xe" role="dialog" aria-modal="true" [attr.aria-label]="s.formulaEditor" (keydown.escape)="closed.emit()">
|
|
3462
|
+
<h2>{{ s.formulaEditor }}</h2>
|
|
3463
|
+
<p class="xe__hint">{{ s.formulaEditorHint }}</p>
|
|
3464
|
+
<textarea #area class="xe__formula" (input)="draft.set($any($event.target).value)" spellcheck="false" rows="3" [attr.aria-label]="s.expression"></textarea>
|
|
3465
|
+
<div class="xe__result" [class.xe__result--error]="result().error" aria-live="polite">
|
|
3466
|
+
<span>{{ s.formulaResult }}</span>
|
|
3467
|
+
<output>{{ result().text }}</output>
|
|
3468
|
+
</div>
|
|
3469
|
+
<div class="xe__lists">
|
|
3470
|
+
<section>
|
|
3471
|
+
<h3>{{ s.fields }}</h3>
|
|
3472
|
+
<ul>
|
|
3473
|
+
@for (f of fields(); track f.expression) {
|
|
3474
|
+
<li><button type="button" (click)="insert(f.expression)" [style.padding-left.px]="8 + f.depth * 12">{{ f.label }}</button></li>
|
|
3475
|
+
}
|
|
3476
|
+
@for (p of parameters(); track p.name) {
|
|
3477
|
+
<li><button type="button" (click)="insert('[?' + p.name + ']')">? {{ p.label || p.name }}</button></li>
|
|
3478
|
+
}
|
|
3479
|
+
</ul>
|
|
3480
|
+
</section>
|
|
3481
|
+
<section>
|
|
3482
|
+
<h3>{{ s.functions }}</h3>
|
|
3483
|
+
<div class="xe__cats" role="tablist">
|
|
3484
|
+
@for (c of categories; track c.id) {
|
|
3485
|
+
<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>
|
|
3486
|
+
}
|
|
3487
|
+
</div>
|
|
3488
|
+
<ul>
|
|
3489
|
+
@for (f of visibleFunctions(); track f.name) {
|
|
3490
|
+
<li>
|
|
3491
|
+
<button type="button" class="xe__fn" (click)="insertFunction(f)">
|
|
3492
|
+
<code>{{ f.signature }}</code>
|
|
3493
|
+
<small>{{ s.functionHelp[f.name] }}</small>
|
|
3494
|
+
</button>
|
|
3495
|
+
</li>
|
|
3496
|
+
}
|
|
3497
|
+
</ul>
|
|
3498
|
+
</section>
|
|
3499
|
+
</div>
|
|
3500
|
+
<div class="xe__actions">
|
|
3501
|
+
<button type="button" (click)="closed.emit()">{{ s.cancel }}</button>
|
|
3502
|
+
<button type="button" class="xe__primary" (click)="applied.emit(draft())">{{ s.apply }}</button>
|
|
3503
|
+
</div>
|
|
3504
|
+
</div>
|
|
3505
|
+
`, 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 });
|
|
3506
|
+
}
|
|
3507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExpressionEditorComponent, decorators: [{
|
|
3508
|
+
type: Component,
|
|
3509
|
+
args: [{ selector: 'we-report-expression-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3510
|
+
@let s = strings();
|
|
3511
|
+
<div class="xe__backdrop" (click)="closed.emit()"></div>
|
|
3512
|
+
<div class="xe" role="dialog" aria-modal="true" [attr.aria-label]="s.formulaEditor" (keydown.escape)="closed.emit()">
|
|
3513
|
+
<h2>{{ s.formulaEditor }}</h2>
|
|
3514
|
+
<p class="xe__hint">{{ s.formulaEditorHint }}</p>
|
|
3515
|
+
<textarea #area class="xe__formula" (input)="draft.set($any($event.target).value)" spellcheck="false" rows="3" [attr.aria-label]="s.expression"></textarea>
|
|
3516
|
+
<div class="xe__result" [class.xe__result--error]="result().error" aria-live="polite">
|
|
3517
|
+
<span>{{ s.formulaResult }}</span>
|
|
3518
|
+
<output>{{ result().text }}</output>
|
|
3519
|
+
</div>
|
|
3520
|
+
<div class="xe__lists">
|
|
3521
|
+
<section>
|
|
3522
|
+
<h3>{{ s.fields }}</h3>
|
|
3523
|
+
<ul>
|
|
3524
|
+
@for (f of fields(); track f.expression) {
|
|
3525
|
+
<li><button type="button" (click)="insert(f.expression)" [style.padding-left.px]="8 + f.depth * 12">{{ f.label }}</button></li>
|
|
3526
|
+
}
|
|
3527
|
+
@for (p of parameters(); track p.name) {
|
|
3528
|
+
<li><button type="button" (click)="insert('[?' + p.name + ']')">? {{ p.label || p.name }}</button></li>
|
|
3529
|
+
}
|
|
3530
|
+
</ul>
|
|
3531
|
+
</section>
|
|
3532
|
+
<section>
|
|
3533
|
+
<h3>{{ s.functions }}</h3>
|
|
3534
|
+
<div class="xe__cats" role="tablist">
|
|
3535
|
+
@for (c of categories; track c.id) {
|
|
3536
|
+
<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>
|
|
3537
|
+
}
|
|
3538
|
+
</div>
|
|
3539
|
+
<ul>
|
|
3540
|
+
@for (f of visibleFunctions(); track f.name) {
|
|
3541
|
+
<li>
|
|
3542
|
+
<button type="button" class="xe__fn" (click)="insertFunction(f)">
|
|
3543
|
+
<code>{{ f.signature }}</code>
|
|
3544
|
+
<small>{{ s.functionHelp[f.name] }}</small>
|
|
3545
|
+
</button>
|
|
3546
|
+
</li>
|
|
3547
|
+
}
|
|
3548
|
+
</ul>
|
|
3549
|
+
</section>
|
|
3550
|
+
</div>
|
|
3551
|
+
<div class="xe__actions">
|
|
3552
|
+
<button type="button" (click)="closed.emit()">{{ s.cancel }}</button>
|
|
3553
|
+
<button type="button" class="xe__primary" (click)="applied.emit(draft())">{{ s.apply }}</button>
|
|
3554
|
+
</div>
|
|
3555
|
+
</div>
|
|
3556
|
+
`, 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"] }]
|
|
3557
|
+
}] });
|
|
3558
|
+
|
|
1938
3559
|
/**
|
|
1939
3560
|
* Edits a value that is either fixed or comes from data: "Fixed text" with a text box, or
|
|
1940
3561
|
* "From data" with a field picker and the formula it produces.
|
|
@@ -1945,6 +3566,7 @@ class BindableInputComponent {
|
|
|
1945
3566
|
strings = input.required();
|
|
1946
3567
|
multiline = input(false);
|
|
1947
3568
|
valueChange = output();
|
|
3569
|
+
editorOpen = signal(false);
|
|
1948
3570
|
bound = computed(() => isExpression(this.value()));
|
|
1949
3571
|
expression = computed(() => {
|
|
1950
3572
|
const v = this.value();
|
|
@@ -1974,61 +3596,114 @@ class BindableInputComponent {
|
|
|
1974
3596
|
this.valueChange.emit(text);
|
|
1975
3597
|
}
|
|
1976
3598
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BindableInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1977
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BindableInputComponent, isStandalone: true, selector: "we-report-bindable-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, multiline: { classPropertyName: "multiline", publicName: "multiline", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
1978
|
-
<div class="bi__mode" role="radiogroup">
|
|
1979
|
-
<button type="button" role="radio" [attr.aria-checked]="!bound()" [class.bi__on]="!bound()" (click)="toFixed()">{{ strings().staticText }}</button>
|
|
1980
|
-
<button type="button" role="radio" [attr.aria-checked]="bound()" [class.bi__on]="bound()" (click)="toBound()">{{ strings().fromData }}</button>
|
|
1981
|
-
</div>
|
|
1982
|
-
@if (bound()) {
|
|
1983
|
-
@if (fields().length) {
|
|
1984
|
-
<select class="bi__input" (change)="pickField($any($event.target).value)">
|
|
1985
|
-
<option value="" [selected]="!fieldMatch()">—</option>
|
|
1986
|
-
@for (f of fields(); track f.expression) {
|
|
1987
|
-
<option [value]="f.expression" [selected]="f.expression === expression()">{{ f.label }}</option>
|
|
1988
|
-
}
|
|
1989
|
-
</select>
|
|
1990
|
-
}
|
|
1991
|
-
<label class="bi__formula">
|
|
1992
|
-
<span>{{ strings().expression }}</span>
|
|
1993
|
-
<
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
3599
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BindableInputComponent, isStandalone: true, selector: "we-report-bindable-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, multiline: { classPropertyName: "multiline", publicName: "multiline", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
3600
|
+
<div class="bi__mode" role="radiogroup">
|
|
3601
|
+
<button type="button" role="radio" [attr.aria-checked]="!bound()" [class.bi__on]="!bound()" (click)="toFixed()">{{ strings().staticText }}</button>
|
|
3602
|
+
<button type="button" role="radio" [attr.aria-checked]="bound()" [class.bi__on]="bound()" (click)="toBound()">{{ strings().fromData }}</button>
|
|
3603
|
+
</div>
|
|
3604
|
+
@if (bound()) {
|
|
3605
|
+
@if (fields().length) {
|
|
3606
|
+
<select class="bi__input" (change)="pickField($any($event.target).value)">
|
|
3607
|
+
<option value="" [selected]="!fieldMatch()">—</option>
|
|
3608
|
+
@for (f of fields(); track f.expression) {
|
|
3609
|
+
<option [value]="f.expression" [selected]="f.expression === expression()">{{ f.label }}</option>
|
|
3610
|
+
}
|
|
3611
|
+
</select>
|
|
3612
|
+
}
|
|
3613
|
+
<label class="bi__formula">
|
|
3614
|
+
<span>{{ strings().expression }}</span>
|
|
3615
|
+
<span class="bi__row">
|
|
3616
|
+
<input class="bi__input bi__mono" [value]="expression()" (input)="setExpression($any($event.target).value)" spellcheck="false" />
|
|
3617
|
+
<button type="button" class="bi__fx" (click)="editorOpen.set(true)" [title]="strings().openFormulaEditor" [attr.aria-label]="strings().openFormulaEditor">ƒx</button>
|
|
3618
|
+
</span>
|
|
3619
|
+
</label>
|
|
3620
|
+
@if (editorOpen()) {
|
|
3621
|
+
<we-report-expression-editor [expression]="expression()" [fields]="fields()" [strings]="strings()" (applied)="setExpression($event); editorOpen.set(false)" (closed)="editorOpen.set(false)" />
|
|
3622
|
+
}
|
|
3623
|
+
<small class="bi__hint">{{ strings().expressionHint }}</small>
|
|
3624
|
+
} @else if (multiline()) {
|
|
3625
|
+
<textarea class="bi__input" rows="3" [value]="fixedText()" (input)="setFixed($any($event.target).value)"></textarea>
|
|
3626
|
+
} @else {
|
|
3627
|
+
<input class="bi__input" [value]="fixedText()" (input)="setFixed($any($event.target).value)" />
|
|
3628
|
+
}
|
|
3629
|
+
`, isInline: true, styles: [":host{display:flex;flex-direction:column;gap:6px}.bi__mode{display:flex;padding:2px;gap:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.bi__mode button{flex:1;border:0;border-radius:6px;padding:4px 6px;font:inherit;font-size:12px;background:transparent;color:inherit;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease}.bi__mode button.bi__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.bi__mode button:focus-visible,.bi__input:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.bi__input{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}@media (prefers-reduced-motion: reduce){.bi__mode button{transition:none}}.bi__row{display:flex;gap:4px}.bi__fx{flex:none;width:30px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff);font:italic 600 13px Georgia,Times New Roman,serif;cursor:pointer}.bi__fx:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.bi__mono{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}.bi__formula{display:flex;flex-direction:column;gap:2px;font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.bi__hint{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));font-size:11px}\n"], dependencies: [{ kind: "component", type: ExpressionEditorComponent, selector: "we-report-expression-editor", inputs: ["expression", "fields", "strings"], outputs: ["applied", "closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2002
3630
|
}
|
|
2003
3631
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BindableInputComponent, decorators: [{
|
|
2004
3632
|
type: Component,
|
|
2005
|
-
args: [{ selector: 'we-report-bindable-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2006
|
-
<div class="bi__mode" role="radiogroup">
|
|
2007
|
-
<button type="button" role="radio" [attr.aria-checked]="!bound()" [class.bi__on]="!bound()" (click)="toFixed()">{{ strings().staticText }}</button>
|
|
2008
|
-
<button type="button" role="radio" [attr.aria-checked]="bound()" [class.bi__on]="bound()" (click)="toBound()">{{ strings().fromData }}</button>
|
|
2009
|
-
</div>
|
|
2010
|
-
@if (bound()) {
|
|
2011
|
-
@if (fields().length) {
|
|
2012
|
-
<select class="bi__input" (change)="pickField($any($event.target).value)">
|
|
2013
|
-
<option value="" [selected]="!fieldMatch()">—</option>
|
|
2014
|
-
@for (f of fields(); track f.expression) {
|
|
2015
|
-
<option [value]="f.expression" [selected]="f.expression === expression()">{{ f.label }}</option>
|
|
2016
|
-
}
|
|
2017
|
-
</select>
|
|
2018
|
-
}
|
|
2019
|
-
<label class="bi__formula">
|
|
2020
|
-
<span>{{ strings().expression }}</span>
|
|
2021
|
-
<
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
3633
|
+
args: [{ selector: 'we-report-bindable-input', standalone: true, imports: [ExpressionEditorComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3634
|
+
<div class="bi__mode" role="radiogroup">
|
|
3635
|
+
<button type="button" role="radio" [attr.aria-checked]="!bound()" [class.bi__on]="!bound()" (click)="toFixed()">{{ strings().staticText }}</button>
|
|
3636
|
+
<button type="button" role="radio" [attr.aria-checked]="bound()" [class.bi__on]="bound()" (click)="toBound()">{{ strings().fromData }}</button>
|
|
3637
|
+
</div>
|
|
3638
|
+
@if (bound()) {
|
|
3639
|
+
@if (fields().length) {
|
|
3640
|
+
<select class="bi__input" (change)="pickField($any($event.target).value)">
|
|
3641
|
+
<option value="" [selected]="!fieldMatch()">—</option>
|
|
3642
|
+
@for (f of fields(); track f.expression) {
|
|
3643
|
+
<option [value]="f.expression" [selected]="f.expression === expression()">{{ f.label }}</option>
|
|
3644
|
+
}
|
|
3645
|
+
</select>
|
|
3646
|
+
}
|
|
3647
|
+
<label class="bi__formula">
|
|
3648
|
+
<span>{{ strings().expression }}</span>
|
|
3649
|
+
<span class="bi__row">
|
|
3650
|
+
<input class="bi__input bi__mono" [value]="expression()" (input)="setExpression($any($event.target).value)" spellcheck="false" />
|
|
3651
|
+
<button type="button" class="bi__fx" (click)="editorOpen.set(true)" [title]="strings().openFormulaEditor" [attr.aria-label]="strings().openFormulaEditor">ƒx</button>
|
|
3652
|
+
</span>
|
|
3653
|
+
</label>
|
|
3654
|
+
@if (editorOpen()) {
|
|
3655
|
+
<we-report-expression-editor [expression]="expression()" [fields]="fields()" [strings]="strings()" (applied)="setExpression($event); editorOpen.set(false)" (closed)="editorOpen.set(false)" />
|
|
3656
|
+
}
|
|
3657
|
+
<small class="bi__hint">{{ strings().expressionHint }}</small>
|
|
3658
|
+
} @else if (multiline()) {
|
|
3659
|
+
<textarea class="bi__input" rows="3" [value]="fixedText()" (input)="setFixed($any($event.target).value)"></textarea>
|
|
3660
|
+
} @else {
|
|
3661
|
+
<input class="bi__input" [value]="fixedText()" (input)="setFixed($any($event.target).value)" />
|
|
3662
|
+
}
|
|
3663
|
+
`, styles: [":host{display:flex;flex-direction:column;gap:6px}.bi__mode{display:flex;padding:2px;gap:2px;border-radius:8px;background:var(--we-report-segment-bg, rgba(118, 118, 128, .12))}.bi__mode button{flex:1;border:0;border-radius:6px;padding:4px 6px;font:inherit;font-size:12px;background:transparent;color:inherit;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease}.bi__mode button.bi__on{background:var(--we-report-segment-on-bg, #fff);box-shadow:0 0 0 .5px #0000000a,0 1px 3px #0000001f}.bi__mode button:focus-visible,.bi__input:focus{outline:none;box-shadow:var(--we-report-focus-ring, 0 0 0 3px rgba(0, 122, 255, .35))}.bi__input{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}@media (prefers-reduced-motion: reduce){.bi__mode button{transition:none}}.bi__row{display:flex;gap:4px}.bi__fx{flex:none;width:30px;border:0;border-radius:var(--we-report-control-radius, 7px);background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff);font:italic 600 13px Georgia,Times New Roman,serif;cursor:pointer}.bi__fx:hover{background:var(--we-report-hover-bg, rgba(118, 118, 128, .12))}.bi__mono{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}.bi__formula{display:flex;flex-direction:column;gap:2px;font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.bi__hint{color:var(--we-report-muted-fg, rgba(60, 60, 67, .62));font-size:11px}\n"] }]
|
|
2030
3664
|
}] });
|
|
2031
3665
|
|
|
3666
|
+
const CONDITION_OPS = [
|
|
3667
|
+
{ op: '=', label: '=' },
|
|
3668
|
+
{ op: '!=', label: '≠' },
|
|
3669
|
+
{ op: '<', label: '<' },
|
|
3670
|
+
{ op: '<=', label: '≤' },
|
|
3671
|
+
{ op: '>', label: '>' },
|
|
3672
|
+
{ op: '>=', label: '≥' },
|
|
3673
|
+
{ op: 'contains', label: '…' },
|
|
3674
|
+
];
|
|
3675
|
+
/** Numbers stay numbers, everything else becomes a quoted string. */
|
|
3676
|
+
function literal(value) {
|
|
3677
|
+
const v = value.trim();
|
|
3678
|
+
if (v !== '' && !isNaN(Number(v)))
|
|
3679
|
+
return v;
|
|
3680
|
+
return `'${value.replace(/'/g, "''")}'`;
|
|
3681
|
+
}
|
|
3682
|
+
function unliteral(text) {
|
|
3683
|
+
const t = text.trim();
|
|
3684
|
+
const m = /^'((?:[^']|'')*)'$/.exec(t) ?? /^"((?:[^"]|"")*)"$/.exec(t);
|
|
3685
|
+
return m ? m[1].replace(/''/g, "'").replace(/""/g, '"') : t;
|
|
3686
|
+
}
|
|
3687
|
+
const LITERAL = String.raw `(-?\d+(?:\.\d+)?|'(?:[^']|'')*'|"(?:[^"]|"")*")`;
|
|
3688
|
+
const CONTAINS = new RegExp(String.raw `^Contains\((\[[^\]]+\]),\s*${LITERAL}\)$`, 'i');
|
|
3689
|
+
const COMPARISON = new RegExp(String.raw `^(\[[^\]]+\])\s*(<=|>=|!=|<>|==|=|<|>)\s*${LITERAL}$`);
|
|
3690
|
+
function buildCondition(c) {
|
|
3691
|
+
if (!c.field)
|
|
3692
|
+
return '';
|
|
3693
|
+
return c.op === 'contains' ? `Contains(${c.field}, ${literal(c.value)})` : `${c.field} ${c.op} ${literal(c.value)}`;
|
|
3694
|
+
}
|
|
3695
|
+
/** Reads a formula back into the simple form, or `null` when it is something else. */
|
|
3696
|
+
function parseCondition(expression) {
|
|
3697
|
+
const contains = CONTAINS.exec(expression.trim());
|
|
3698
|
+
if (contains)
|
|
3699
|
+
return { field: contains[1], op: 'contains', value: unliteral(contains[2]) };
|
|
3700
|
+
const m = COMPARISON.exec(expression.trim());
|
|
3701
|
+
if (!m)
|
|
3702
|
+
return expression.trim() ? null : { field: '', op: '<', value: '0' };
|
|
3703
|
+
const op = (m[2] === '<>' ? '!=' : m[2] === '==' ? '=' : m[2]);
|
|
3704
|
+
return { field: m[1], op, value: unliteral(m[3]) };
|
|
3705
|
+
}
|
|
3706
|
+
|
|
2032
3707
|
const FORMATS = [
|
|
2033
3708
|
{ value: '', key: 'formatNone' },
|
|
2034
3709
|
{ value: 'n0', key: 'formatNumber0' },
|
|
@@ -2038,6 +3713,44 @@ const FORMATS = [
|
|
|
2038
3713
|
{ value: 'dd.MM.yyyy', key: 'formatDate' },
|
|
2039
3714
|
{ value: 'dd.MM.yyyy HH:mm', key: 'formatDateTime' },
|
|
2040
3715
|
];
|
|
3716
|
+
const CHART_TYPES = [
|
|
3717
|
+
{ type: 'column', label: 'chartColumn' },
|
|
3718
|
+
{ type: 'bar', label: 'chartBar' },
|
|
3719
|
+
{ type: 'line', label: 'chartLine' },
|
|
3720
|
+
{ type: 'pie', label: 'chartPie' },
|
|
3721
|
+
{ type: 'doughnut', label: 'chartDoughnut' },
|
|
3722
|
+
];
|
|
3723
|
+
const AGGREGATES = [
|
|
3724
|
+
{ value: 'sum', label: 'aggSum' },
|
|
3725
|
+
{ value: 'count', label: 'aggCount' },
|
|
3726
|
+
{ value: 'avg', label: 'aggAvg' },
|
|
3727
|
+
{ value: 'min', label: 'aggMin' },
|
|
3728
|
+
{ value: 'max', label: 'aggMax' },
|
|
3729
|
+
];
|
|
3730
|
+
/** Regions offered for a report's number, date and word formats (any BCP 47 tag works in the file). */
|
|
3731
|
+
const CULTURES = [
|
|
3732
|
+
{ id: 'tr-TR', name: 'Türkçe (Türkiye)' },
|
|
3733
|
+
{ id: 'en-US', name: 'English (United States)' },
|
|
3734
|
+
{ id: 'en-GB', name: 'English (United Kingdom)' },
|
|
3735
|
+
{ id: 'de-DE', name: 'Deutsch (Deutschland)' },
|
|
3736
|
+
{ id: 'fr-FR', name: 'Français (France)' },
|
|
3737
|
+
{ id: 'es-ES', name: 'Español (España)' },
|
|
3738
|
+
{ id: 'it-IT', name: 'Italiano (Italia)' },
|
|
3739
|
+
{ id: 'nl-NL', name: 'Nederlands (Nederland)' },
|
|
3740
|
+
{ id: 'pt-BR', name: 'Português (Brasil)' },
|
|
3741
|
+
{ id: 'ru-RU', name: 'Русский (Россия)' },
|
|
3742
|
+
{ id: 'ar-SA', name: 'العربية (السعودية)' },
|
|
3743
|
+
{ id: 'ja-JP', name: '日本語 (日本)' },
|
|
3744
|
+
];
|
|
3745
|
+
const CURRENCIES = ['TRY', 'USD', 'EUR', 'GBP', 'CHF', 'JPY', 'RUB', 'SAR', 'AED', 'BRL'];
|
|
3746
|
+
const ALIGN_ACTIONS = [
|
|
3747
|
+
{ edge: 'left', icon: 'arrangeLeft', label: 'arrangeLeft' },
|
|
3748
|
+
{ edge: 'center', icon: 'arrangeCenter', label: 'arrangeCenter' },
|
|
3749
|
+
{ edge: 'right', icon: 'arrangeRight', label: 'arrangeRight' },
|
|
3750
|
+
{ edge: 'top', icon: 'arrangeTop', label: 'arrangeTop' },
|
|
3751
|
+
{ edge: 'middle', icon: 'arrangeMiddle', label: 'arrangeMiddle' },
|
|
3752
|
+
{ edge: 'bottom', icon: 'arrangeBottom', label: 'arrangeBottom' },
|
|
3753
|
+
];
|
|
2041
3754
|
/** Plain-language properties of the selection: a control, a band, or the report itself. */
|
|
2042
3755
|
class PropertyPanelComponent {
|
|
2043
3756
|
strings = input.required();
|
|
@@ -2048,6 +3761,12 @@ class PropertyPanelComponent {
|
|
|
2048
3761
|
papers = PAPER_SIZES;
|
|
2049
3762
|
symbologies = BARCODE_SYMBOLOGIES;
|
|
2050
3763
|
formats = FORMATS;
|
|
3764
|
+
alignActions = ALIGN_ACTIONS;
|
|
3765
|
+
chartTypes = CHART_TYPES;
|
|
3766
|
+
cultures = CULTURES;
|
|
3767
|
+
currencies = CURRENCIES;
|
|
3768
|
+
aggregates = AGGREGATES;
|
|
3769
|
+
conditionOps = CONDITION_OPS;
|
|
2051
3770
|
controls = computed(() => this.state.selectedControls());
|
|
2052
3771
|
control = computed(() => (this.controls().length === 1 ? this.controls()[0] : null));
|
|
2053
3772
|
band = computed(() => this.state.selectedBand());
|
|
@@ -2066,6 +3785,18 @@ class PropertyPanelComponent {
|
|
|
2066
3785
|
setReport(key, value) {
|
|
2067
3786
|
this.state.update((d) => (d[key] = value), `report-${key}`);
|
|
2068
3787
|
}
|
|
3788
|
+
/** Empty means "use the app's setting". */
|
|
3789
|
+
setCulture(key, value) {
|
|
3790
|
+
this.state.update((d) => (d[key] = value || undefined));
|
|
3791
|
+
}
|
|
3792
|
+
/** Empty text removes the watermark. */
|
|
3793
|
+
setWatermark(patch) {
|
|
3794
|
+
this.state.update((d) => {
|
|
3795
|
+
const next = { text: '', ...d.watermark, ...patch };
|
|
3796
|
+
const empty = isExpression(next.text) ? !next.text.expression.trim() : !next.text.trim();
|
|
3797
|
+
d.watermark = empty ? undefined : next;
|
|
3798
|
+
}, 'watermark');
|
|
3799
|
+
}
|
|
2069
3800
|
setPaper(paper) {
|
|
2070
3801
|
this.state.update((d) => {
|
|
2071
3802
|
if (paper === 'custom' && d.page.paper !== 'custom') {
|
|
@@ -2151,6 +3882,43 @@ class PropertyPanelComponent {
|
|
|
2151
3882
|
c.visible = isExpression(value) && value.expression.trim() ? value : undefined;
|
|
2152
3883
|
}, 'bind-visible');
|
|
2153
3884
|
}
|
|
3885
|
+
setExpression(key, expression) {
|
|
3886
|
+
this.set(key, { expression }, `chart-${key}`);
|
|
3887
|
+
}
|
|
3888
|
+
// ── Conditional formatting ──────────────────────────────────────────────────
|
|
3889
|
+
condition(when) {
|
|
3890
|
+
return parseCondition(when);
|
|
3891
|
+
}
|
|
3892
|
+
updateRules(mutate, coalesce) {
|
|
3893
|
+
this.state.updateControls(this.ids(), (c) => {
|
|
3894
|
+
const rules = structuredClone(c.formatting ?? []);
|
|
3895
|
+
mutate(rules);
|
|
3896
|
+
c.formatting = rules.length ? rules : undefined;
|
|
3897
|
+
}, coalesce);
|
|
3898
|
+
}
|
|
3899
|
+
addRule() {
|
|
3900
|
+
this.updateRules((rules) => rules.push({ when: '', style: { bold: true } }));
|
|
3901
|
+
}
|
|
3902
|
+
removeRule(index) {
|
|
3903
|
+
this.updateRules((rules) => rules.splice(index, 1));
|
|
3904
|
+
}
|
|
3905
|
+
setRule(index, patch) {
|
|
3906
|
+
this.updateRules((rules) => rules[index] && Object.assign(rules[index], patch), `rule-${index}`);
|
|
3907
|
+
}
|
|
3908
|
+
setCondition(index, current, key, value) {
|
|
3909
|
+
this.setRule(index, { when: buildCondition({ ...current, [key]: value }) });
|
|
3910
|
+
}
|
|
3911
|
+
setRuleStyle(index, key, value) {
|
|
3912
|
+
this.updateRules((rules) => {
|
|
3913
|
+
const style = rules[index]?.style;
|
|
3914
|
+
if (!style)
|
|
3915
|
+
return;
|
|
3916
|
+
if (value === undefined)
|
|
3917
|
+
delete style[key];
|
|
3918
|
+
else
|
|
3919
|
+
style[key] = value;
|
|
3920
|
+
}, `rule-style-${index}-${key}`);
|
|
3921
|
+
}
|
|
2154
3922
|
checkedValue(c) {
|
|
2155
3923
|
if (c.type !== 'checkbox')
|
|
2156
3924
|
return '';
|
|
@@ -2209,11 +3977,11 @@ class PropertyPanelComponent {
|
|
|
2209
3977
|
return positive(value, fallback);
|
|
2210
3978
|
}
|
|
2211
3979
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PropertyPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2212
|
-
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 } }, ngImport: i0, template: "@let s = strings();\r\n<h2 class=\"pp__title\">{{ s.properties }}</h2>\r\n\r\n@let selectedControl = control();\r\n@let selectedBand = band();\r\n@if (selectedControl) {\r\n <div class=\"pp__subtitle\">{{ s.controlNames[selectedControl.type] }} \u00B7 <code>{{ selectedControl.id }}</code></div>\r\n} @else if (controls().length > 1) {\r\n <div class=\"pp__subtitle\">{{ controls().length }} \u00D7 </div>\r\n} @else if (selectedBand) {\r\n <div class=\"pp__subtitle\">{{ s.bandNames[selectedBand.kind] }}</div>\r\n}\r\n\r\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 -->\r\n@if (!controls().length && !band()) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupPage }}</h3>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.reportName }}</span>\r\n <input [value]=\"report().name\" (input)=\"setReport('name', $any($event.target).value)\" />\r\n </label>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.paper }}</span>\r\n <select (change)=\"setPaper($any($event.target).value)\">\r\n @for (p of papers; track p.id) {\r\n <option [value]=\"p.id\" [selected]=\"p.id === report().page.paper\">{{ p.id }} ({{ p.width }} \u00D7 {{ p.height ?? '\u221E' }} mm)</option>\r\n }\r\n <option value=\"custom\" [selected]=\"report().page.paper === 'custom'\">{{ s.customSize }}</option>\r\n </select>\r\n </label>\r\n @if (report().page.paper === 'custom') {\r\n <div class=\"pp__grid\">\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.width }} (mm)</span>\r\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.width)\" (input)=\"setPage('width', $any($event.target).value)\" />\r\n </label>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.height }} (mm)</span>\r\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.height)\" (input)=\"setPage('height', $any($event.target).value)\" />\r\n </label>\r\n </div>\r\n }\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.orientation }}</span>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'portrait'\" (click)=\"setPage('orientation', 'portrait')\">{{ s.portrait }}</button>\r\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'landscape'\" (click)=\"setPage('orientation', 'landscape')\">{{ s.landscape }}</button>\r\n </div>\r\n </div>\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.margins }} (mm)</span>\r\n <div class=\"pp__grid pp__grid--4\">\r\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>\r\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>\r\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>\r\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>\r\n </div>\r\n </div>\r\n </section>\r\n @if (advanced() && report().dataMember) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupData }}</h3>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.dataRows }}</span>\r\n <input [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" />\r\n <small class=\"pp__hint\">{{ s.dataRowsHint }}</small>\r\n </label>\r\n </section>\r\n }\r\n}\r\n\r\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 -->\r\n@if (band(); as b) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupLayout }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.bandHeight }} (mm)</span>\r\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(b.height)\" (input)=\"setBand('height', $any($event.target).value)\" />\r\n </label>\r\n <label class=\"pp__row\">\r\n <span>{{ s.backgroundColor }}</span>\r\n <span class=\"pp__color\">\r\n <input type=\"color\" [value]=\"b.backgroundColor ?? '#ffffff'\" (input)=\"setBand('backgroundColor', $any($event.target).value)\" />\r\n <button type=\"button\" class=\"pp__link\" (click)=\"setBand('backgroundColor', '')\">{{ s.noColor }}</button>\r\n </span>\r\n </label>\r\n </section>\r\n @if (b.kind === 'groupHeader') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupBy }}</h3>\r\n @if (fields().length) {\r\n <select (change)=\"setBand('groupBy', $any($event.target).value)\">\r\n @for (f of fields(); track f.expression) {\r\n <option [value]=\"f.expression\" [selected]=\"f.expression === b.groupBy?.expression\">{{ f.label }}</option>\r\n }\r\n </select>\r\n }\r\n <input class=\"pp__mono\" [value]=\"b.groupBy?.expression ?? ''\" (input)=\"setBand('groupBy', $any($event.target).value)\" spellcheck=\"false\" />\r\n <label class=\"pp__row\">\r\n <span>{{ s.sortGroups }}</span>\r\n <select (change)=\"setBand('sort', $any($event.target).value)\">\r\n <option value=\"asc\" [selected]=\"!b.sort || b.sort === 'asc'\">{{ s.sortAsc }}</option>\r\n <option value=\"desc\" [selected]=\"b.sort === 'desc'\">{{ s.sortDesc }}</option>\r\n <option value=\"none\" [selected]=\"b.sort === 'none'\">{{ s.sortNone }}</option>\r\n </select>\r\n </label>\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!b.keepTogether\" (change)=\"toggleBand('keepTogether', $any($event.target).checked)\" />\r\n <span>{{ s.keepTogether }}<small class=\"pp__hint\">{{ s.keepTogetherHint }}</small></span>\r\n </label>\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!b.repeatOnEveryPage\" (change)=\"toggleBand('repeatOnEveryPage', $any($event.target).checked)\" />\r\n <span>{{ s.repeatOnEveryPage }}</span>\r\n </label>\r\n </section>\r\n }\r\n @if (advanced() && b.kind !== 'pageHeader' && b.kind !== 'pageFooter') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupBehaviour }}</h3>\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakBefore\" (change)=\"toggleBand('pageBreakBefore', $any($event.target).checked)\" />\r\n <span>{{ s.pageBreakBefore }}</span>\r\n </label>\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakAfter\" (change)=\"toggleBand('pageBreakAfter', $any($event.target).checked)\" />\r\n <span>{{ s.pageBreakAfter }}</span>\r\n </label>\r\n </section>\r\n }\r\n @if (b.kind !== 'detail') {\r\n <button type=\"button\" class=\"pp__danger\" (click)=\"removeBand()\">{{ s.removeBand }}</button>\r\n }\r\n}\r\n\r\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 -->\r\n@if (controls().length) {\r\n @if (control(); as c) {\r\n <!-- Content first: it is what people change most. -->\r\n @switch (c.type) {\r\n @case ('text') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" [multiline]=\"true\" (valueChange)=\"setBindable('text', $event)\" />\r\n <label class=\"pp__row\">\r\n <span>{{ s.format }}</span>\r\n <select (change)=\"set('format', $any($event.target).value)\">\r\n @for (f of formats; track f.value) {\r\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ $any(s)[f.key] }}</option>\r\n }\r\n @if (formatIsCustom()) {\r\n <option [value]=\"c.format\" selected>{{ c.format }}</option>\r\n }\r\n </select>\r\n </label>\r\n @if (advanced()) {\r\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\" />\r\n }\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\r\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\r\n </label>\r\n </section>\r\n }\r\n @case ('barcode') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.symbology }}</span>\r\n <select (change)=\"set('symbology', $any($event.target).value)\">\r\n @for (sym of symbologies; track sym) {\r\n <option [value]=\"sym\" [selected]=\"sym === c.symbology\">{{ sym }}</option>\r\n }\r\n @if (!symbologies.includes(c.symbology)) {\r\n <option [value]=\"c.symbology\" selected>{{ c.symbology }}</option>\r\n }\r\n </select>\r\n </label>\r\n <span class=\"pp__label\">{{ s.barcodeValue }}</span>\r\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('value', $event)\" />\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"c.showText\" (change)=\"set('showText', $any($event.target).checked)\" />\r\n <span>{{ s.showText }}</span>\r\n </label>\r\n </section>\r\n }\r\n @case ('image') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <label class=\"pp__file\">\r\n <input type=\"file\" accept=\"image/png,image/jpeg\" (change)=\"chooseImage($event)\" />\r\n <span>{{ s.chooseImage }}</span>\r\n </label>\r\n <span class=\"pp__label\">{{ s.fromData }}</span>\r\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('source', $event)\" />\r\n <label class=\"pp__row\">\r\n <span>{{ s.fit }}</span>\r\n <select (change)=\"set('fit', $any($event.target).value)\">\r\n <option value=\"contain\" [selected]=\"c.fit === 'contain'\">{{ s.fitContain }}</option>\r\n <option value=\"cover\" [selected]=\"c.fit === 'cover'\">{{ s.fitCover }}</option>\r\n <option value=\"stretch\" [selected]=\"c.fit === 'stretch'\">{{ s.fitStretch }}</option>\r\n <option value=\"none\" [selected]=\"c.fit === 'none'\">{{ s.fitNone }}</option>\r\n </select>\r\n </label>\r\n </section>\r\n }\r\n @case ('line') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupAppearance }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.lineDirection }}</span>\r\n <select (change)=\"set('direction', $any($event.target).value)\">\r\n <option value=\"horizontal\" [selected]=\"c.direction === 'horizontal'\">{{ s.horizontal }}</option>\r\n <option value=\"vertical\" [selected]=\"c.direction === 'vertical'\">{{ s.vertical }}</option>\r\n <option value=\"diagonalDown\" [selected]=\"c.direction === 'diagonalDown'\">{{ s.diagonalDown }}</option>\r\n <option value=\"diagonalUp\" [selected]=\"c.direction === 'diagonalUp'\">{{ s.diagonalUp }}</option>\r\n </select>\r\n </label>\r\n <label class=\"pp__row\">\r\n <span>{{ s.lineWidth }} (mm)</span>\r\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(c.lineWidth)\" (input)=\"set('lineWidth', asNumber($any($event.target).value, 0.05))\" />\r\n </label>\r\n <label class=\"pp__row\">\r\n <span>{{ s.color }}</span>\r\n <input type=\"color\" [value]=\"c.color ?? style()?.color ?? '#000000'\" (input)=\"set('color', $any($event.target).value)\" />\r\n </label>\r\n </section>\r\n }\r\n @case ('shape') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.shape }}</span>\r\n <select (change)=\"set('shape', $any($event.target).value)\">\r\n <option value=\"rectangle\" [selected]=\"c.shape === 'rectangle'\">{{ s.rectangle }}</option>\r\n <option value=\"roundedRectangle\" [selected]=\"c.shape === 'roundedRectangle'\">{{ s.roundedRectangle }}</option>\r\n <option value=\"ellipse\" [selected]=\"c.shape === 'ellipse'\">{{ s.ellipse }}</option>\r\n </select>\r\n </label>\r\n @if (c.shape === 'roundedRectangle') {\r\n <label class=\"pp__row\">\r\n <span>{{ s.cornerRadius }} (mm)</span>\r\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.cornerRadius ?? 2)\" (input)=\"set('cornerRadius', asNumber($any($event.target).value, 0))\" />\r\n </label>\r\n }\r\n </section>\r\n }\r\n @case ('pageInfo') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.pageInfo }}</span>\r\n <select (change)=\"set('info', $any($event.target).value)\">\r\n <option value=\"pageNumber\" [selected]=\"c.info === 'pageNumber'\">{{ s.pageNumber }}</option>\r\n <option value=\"pageCount\" [selected]=\"c.info === 'pageCount'\">{{ s.pageTotal }}</option>\r\n <option value=\"pageNofM\" [selected]=\"c.info === 'pageNofM'\">{{ s.pageNofM }}</option>\r\n <option value=\"printDate\" [selected]=\"c.info === 'printDate'\">{{ s.printDate }}</option>\r\n </select>\r\n </label>\r\n @if (c.info === 'pageNofM' || c.info === 'printDate') {\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.format }}</span>\r\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\" />\r\n </label>\r\n }\r\n </section>\r\n }\r\n @case ('checkbox') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <span class=\"pp__label\">{{ s.checked }}</span>\r\n <we-report-bindable-input [value]=\"checkedValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('checked', $event)\" />\r\n </section>\r\n }\r\n }\r\n\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupLayout }}</h3>\r\n <div class=\"pp__grid\">\r\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>\r\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>\r\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>\r\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>\r\n </div>\r\n </section>\r\n }\r\n\r\n <!-- Appearance applies to every selected control at once. -->\r\n @if (style(); as st) {\r\n @if (hasText()) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupAppearance }}</h3>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.font }}</span>\r\n <select (change)=\"setStyle('fontFamily', $any($event.target).value)\">\r\n @for (f of fontFamilies(); track f) {\r\n <option [value]=\"f\" [selected]=\"f === st.fontFamily\">{{ f }}</option>\r\n }\r\n @if (!fontFamilies().includes(st.fontFamily)) {\r\n <option [value]=\"st.fontFamily\" selected>{{ st.fontFamily }}</option>\r\n }\r\n </select>\r\n </label>\r\n <div class=\"pp__row\">\r\n <span>{{ s.fontSize }} (pt)</span>\r\n <input type=\"number\" min=\"4\" max=\"200\" step=\"0.5\" [value]=\"num(st.fontSize)\" (input)=\"setStyle('fontSize', asNumber($any($event.target).value, 4))\" />\r\n </div>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"st.bold\" (click)=\"setStyle('bold', !st.bold)\" [attr.aria-pressed]=\"st.bold\"><b>{{ s.bold }}</b></button>\r\n <button type=\"button\" [class.pp__on]=\"st.italic\" (click)=\"setStyle('italic', !st.italic)\" [attr.aria-pressed]=\"st.italic\"><i>{{ s.italic }}</i></button>\r\n <button type=\"button\" [class.pp__on]=\"st.underline\" (click)=\"setStyle('underline', !st.underline)\" [attr.aria-pressed]=\"st.underline\"><u>{{ s.underline }}</u></button>\r\n </div>\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.alignment }}</span>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'left'\" (click)=\"setStyle('textAlign', 'left')\">{{ s.alignLeft }}</button>\r\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'center'\" (click)=\"setStyle('textAlign', 'center')\">{{ s.alignCenter }}</button>\r\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'right'\" (click)=\"setStyle('textAlign', 'right')\">{{ s.alignRight }}</button>\r\n </div>\r\n </div>\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.verticalAlignment }}</span>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'top'\" (click)=\"setStyle('verticalAlign', 'top')\">{{ s.alignTop }}</button>\r\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'middle'\" (click)=\"setStyle('verticalAlign', 'middle')\">{{ s.alignMiddle }}</button>\r\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'bottom'\" (click)=\"setStyle('verticalAlign', 'bottom')\">{{ s.alignBottom }}</button>\r\n </div>\r\n </div>\r\n <label class=\"pp__row\">\r\n <span>{{ s.textColor }}</span>\r\n <input type=\"color\" [value]=\"st.color\" (input)=\"setStyle('color', $any($event.target).value)\" />\r\n </label>\r\n </section>\r\n }\r\n @if (control()?.type !== 'line') {\r\n <section class=\"pp__section\">\r\n @if (!hasText()) {\r\n <h3>{{ s.groupAppearance }}</h3>\r\n }\r\n <label class=\"pp__row\">\r\n <span>{{ s.backgroundColor }}</span>\r\n <span class=\"pp__color\">\r\n <input type=\"color\" [value]=\"st.backgroundColor ?? '#ffffff'\" (input)=\"setStyle('backgroundColor', $any($event.target).value)\" />\r\n <button type=\"button\" class=\"pp__link\" (click)=\"setStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\r\n </span>\r\n </label>\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.border }}</span>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.top\" (click)=\"toggleBorderSide('top', !st.border?.sides?.top)\">{{ s.marginTop }}</button>\r\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.right\" (click)=\"toggleBorderSide('right', !st.border?.sides?.right)\">{{ s.marginRight }}</button>\r\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.bottom\" (click)=\"toggleBorderSide('bottom', !st.border?.sides?.bottom)\">{{ s.marginBottom }}</button>\r\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.left\" (click)=\"toggleBorderSide('left', !st.border?.sides?.left)\">{{ s.marginLeft }}</button>\r\n </div>\r\n </div>\r\n @if (st.border) {\r\n <div class=\"pp__grid\">\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.borderWidth }}</span>\r\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) })\" />\r\n </label>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.borderColor }}</span>\r\n <input type=\"color\" [value]=\"st.border.color\" (input)=\"setBorder({ color: $any($event.target).value })\" />\r\n </label>\r\n </div>\r\n }\r\n @if (advanced() && hasText()) {\r\n <label class=\"pp__row\">\r\n <span>{{ s.padding }} (mm)</span>\r\n <input type=\"number\" min=\"0\" step=\"0.1\" [value]=\"num(st.padding)\" (input)=\"setStyle('padding', asNumber($any($event.target).value, 0))\" />\r\n </label>\r\n }\r\n </section>\r\n }\r\n }\r\n\r\n @if (advanced() && control(); as c) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupBehaviour }}</h3>\r\n <span class=\"pp__label\">{{ s.visibleWhen }}</span>\r\n <input class=\"pp__mono\" [value]=\"$any(visibleValue(c)).expression ?? ''\" (input)=\"setVisible({ expression: $any($event.target).value })\" spellcheck=\"false\" placeholder=\"[Total] > 0\" />\r\n <small class=\"pp__hint\">{{ s.visibleWhenHint }}</small>\r\n </section>\r\n }\r\n}\r\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__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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3980
|
+
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 } }, 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 === '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 ('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__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 });
|
|
2213
3981
|
}
|
|
2214
3982
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PropertyPanelComponent, decorators: [{
|
|
2215
3983
|
type: Component,
|
|
2216
|
-
args: [{ selector: 'we-report-property-panel', standalone: true, imports: [BindableInputComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let s = strings();\r\n<h2 class=\"pp__title\">{{ s.properties }}</h2>\r\n\r\n@let selectedControl = control();\r\n@let selectedBand = band();\r\n@if (selectedControl) {\r\n <div class=\"pp__subtitle\">{{ s.controlNames[selectedControl.type] }} \u00B7 <code>{{ selectedControl.id }}</code></div>\r\n} @else if (controls().length > 1) {\r\n <div class=\"pp__subtitle\">{{ controls().length }} \u00D7 </div>\r\n} @else if (selectedBand) {\r\n <div class=\"pp__subtitle\">{{ s.bandNames[selectedBand.kind] }}</div>\r\n}\r\n\r\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 -->\r\n@if (!controls().length && !band()) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupPage }}</h3>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.reportName }}</span>\r\n <input [value]=\"report().name\" (input)=\"setReport('name', $any($event.target).value)\" />\r\n </label>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.paper }}</span>\r\n <select (change)=\"setPaper($any($event.target).value)\">\r\n @for (p of papers; track p.id) {\r\n <option [value]=\"p.id\" [selected]=\"p.id === report().page.paper\">{{ p.id }} ({{ p.width }} \u00D7 {{ p.height ?? '\u221E' }} mm)</option>\r\n }\r\n <option value=\"custom\" [selected]=\"report().page.paper === 'custom'\">{{ s.customSize }}</option>\r\n </select>\r\n </label>\r\n @if (report().page.paper === 'custom') {\r\n <div class=\"pp__grid\">\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.width }} (mm)</span>\r\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.width)\" (input)=\"setPage('width', $any($event.target).value)\" />\r\n </label>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.height }} (mm)</span>\r\n <input type=\"number\" min=\"10\" step=\"1\" [value]=\"num(report().page.height)\" (input)=\"setPage('height', $any($event.target).value)\" />\r\n </label>\r\n </div>\r\n }\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.orientation }}</span>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'portrait'\" (click)=\"setPage('orientation', 'portrait')\">{{ s.portrait }}</button>\r\n <button type=\"button\" [class.pp__on]=\"report().page.orientation === 'landscape'\" (click)=\"setPage('orientation', 'landscape')\">{{ s.landscape }}</button>\r\n </div>\r\n </div>\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.margins }} (mm)</span>\r\n <div class=\"pp__grid pp__grid--4\">\r\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>\r\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>\r\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>\r\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>\r\n </div>\r\n </div>\r\n </section>\r\n @if (advanced() && report().dataMember) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupData }}</h3>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.dataRows }}</span>\r\n <input [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" />\r\n <small class=\"pp__hint\">{{ s.dataRowsHint }}</small>\r\n </label>\r\n </section>\r\n }\r\n}\r\n\r\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 -->\r\n@if (band(); as b) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupLayout }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.bandHeight }} (mm)</span>\r\n <input type=\"number\" min=\"2\" step=\"1\" [value]=\"num(b.height)\" (input)=\"setBand('height', $any($event.target).value)\" />\r\n </label>\r\n <label class=\"pp__row\">\r\n <span>{{ s.backgroundColor }}</span>\r\n <span class=\"pp__color\">\r\n <input type=\"color\" [value]=\"b.backgroundColor ?? '#ffffff'\" (input)=\"setBand('backgroundColor', $any($event.target).value)\" />\r\n <button type=\"button\" class=\"pp__link\" (click)=\"setBand('backgroundColor', '')\">{{ s.noColor }}</button>\r\n </span>\r\n </label>\r\n </section>\r\n @if (b.kind === 'groupHeader') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupBy }}</h3>\r\n @if (fields().length) {\r\n <select (change)=\"setBand('groupBy', $any($event.target).value)\">\r\n @for (f of fields(); track f.expression) {\r\n <option [value]=\"f.expression\" [selected]=\"f.expression === b.groupBy?.expression\">{{ f.label }}</option>\r\n }\r\n </select>\r\n }\r\n <input class=\"pp__mono\" [value]=\"b.groupBy?.expression ?? ''\" (input)=\"setBand('groupBy', $any($event.target).value)\" spellcheck=\"false\" />\r\n <label class=\"pp__row\">\r\n <span>{{ s.sortGroups }}</span>\r\n <select (change)=\"setBand('sort', $any($event.target).value)\">\r\n <option value=\"asc\" [selected]=\"!b.sort || b.sort === 'asc'\">{{ s.sortAsc }}</option>\r\n <option value=\"desc\" [selected]=\"b.sort === 'desc'\">{{ s.sortDesc }}</option>\r\n <option value=\"none\" [selected]=\"b.sort === 'none'\">{{ s.sortNone }}</option>\r\n </select>\r\n </label>\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!b.keepTogether\" (change)=\"toggleBand('keepTogether', $any($event.target).checked)\" />\r\n <span>{{ s.keepTogether }}<small class=\"pp__hint\">{{ s.keepTogetherHint }}</small></span>\r\n </label>\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!b.repeatOnEveryPage\" (change)=\"toggleBand('repeatOnEveryPage', $any($event.target).checked)\" />\r\n <span>{{ s.repeatOnEveryPage }}</span>\r\n </label>\r\n </section>\r\n }\r\n @if (advanced() && b.kind !== 'pageHeader' && b.kind !== 'pageFooter') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupBehaviour }}</h3>\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakBefore\" (change)=\"toggleBand('pageBreakBefore', $any($event.target).checked)\" />\r\n <span>{{ s.pageBreakBefore }}</span>\r\n </label>\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!b.pageBreakAfter\" (change)=\"toggleBand('pageBreakAfter', $any($event.target).checked)\" />\r\n <span>{{ s.pageBreakAfter }}</span>\r\n </label>\r\n </section>\r\n }\r\n @if (b.kind !== 'detail') {\r\n <button type=\"button\" class=\"pp__danger\" (click)=\"removeBand()\">{{ s.removeBand }}</button>\r\n }\r\n}\r\n\r\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 -->\r\n@if (controls().length) {\r\n @if (control(); as c) {\r\n <!-- Content first: it is what people change most. -->\r\n @switch (c.type) {\r\n @case ('text') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" [multiline]=\"true\" (valueChange)=\"setBindable('text', $event)\" />\r\n <label class=\"pp__row\">\r\n <span>{{ s.format }}</span>\r\n <select (change)=\"set('format', $any($event.target).value)\">\r\n @for (f of formats; track f.value) {\r\n <option [value]=\"f.value\" [selected]=\"(c.format ?? '') === f.value\">{{ $any(s)[f.key] }}</option>\r\n }\r\n @if (formatIsCustom()) {\r\n <option [value]=\"c.format\" selected>{{ c.format }}</option>\r\n }\r\n </select>\r\n </label>\r\n @if (advanced()) {\r\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\" />\r\n }\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"!!c.canGrow\" (change)=\"set('canGrow', $any($event.target).checked || undefined)\" />\r\n <span>{{ s.canGrow }}<small class=\"pp__hint\">{{ s.canGrowHint }}</small></span>\r\n </label>\r\n </section>\r\n }\r\n @case ('barcode') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.symbology }}</span>\r\n <select (change)=\"set('symbology', $any($event.target).value)\">\r\n @for (sym of symbologies; track sym) {\r\n <option [value]=\"sym\" [selected]=\"sym === c.symbology\">{{ sym }}</option>\r\n }\r\n @if (!symbologies.includes(c.symbology)) {\r\n <option [value]=\"c.symbology\" selected>{{ c.symbology }}</option>\r\n }\r\n </select>\r\n </label>\r\n <span class=\"pp__label\">{{ s.barcodeValue }}</span>\r\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('value', $event)\" />\r\n <label class=\"pp__check\">\r\n <input type=\"checkbox\" [checked]=\"c.showText\" (change)=\"set('showText', $any($event.target).checked)\" />\r\n <span>{{ s.showText }}</span>\r\n </label>\r\n </section>\r\n }\r\n @case ('image') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <label class=\"pp__file\">\r\n <input type=\"file\" accept=\"image/png,image/jpeg\" (change)=\"chooseImage($event)\" />\r\n <span>{{ s.chooseImage }}</span>\r\n </label>\r\n <span class=\"pp__label\">{{ s.fromData }}</span>\r\n <we-report-bindable-input [value]=\"textValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('source', $event)\" />\r\n <label class=\"pp__row\">\r\n <span>{{ s.fit }}</span>\r\n <select (change)=\"set('fit', $any($event.target).value)\">\r\n <option value=\"contain\" [selected]=\"c.fit === 'contain'\">{{ s.fitContain }}</option>\r\n <option value=\"cover\" [selected]=\"c.fit === 'cover'\">{{ s.fitCover }}</option>\r\n <option value=\"stretch\" [selected]=\"c.fit === 'stretch'\">{{ s.fitStretch }}</option>\r\n <option value=\"none\" [selected]=\"c.fit === 'none'\">{{ s.fitNone }}</option>\r\n </select>\r\n </label>\r\n </section>\r\n }\r\n @case ('line') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupAppearance }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.lineDirection }}</span>\r\n <select (change)=\"set('direction', $any($event.target).value)\">\r\n <option value=\"horizontal\" [selected]=\"c.direction === 'horizontal'\">{{ s.horizontal }}</option>\r\n <option value=\"vertical\" [selected]=\"c.direction === 'vertical'\">{{ s.vertical }}</option>\r\n <option value=\"diagonalDown\" [selected]=\"c.direction === 'diagonalDown'\">{{ s.diagonalDown }}</option>\r\n <option value=\"diagonalUp\" [selected]=\"c.direction === 'diagonalUp'\">{{ s.diagonalUp }}</option>\r\n </select>\r\n </label>\r\n <label class=\"pp__row\">\r\n <span>{{ s.lineWidth }} (mm)</span>\r\n <input type=\"number\" min=\"0.05\" step=\"0.05\" [value]=\"num(c.lineWidth)\" (input)=\"set('lineWidth', asNumber($any($event.target).value, 0.05))\" />\r\n </label>\r\n <label class=\"pp__row\">\r\n <span>{{ s.color }}</span>\r\n <input type=\"color\" [value]=\"c.color ?? style()?.color ?? '#000000'\" (input)=\"set('color', $any($event.target).value)\" />\r\n </label>\r\n </section>\r\n }\r\n @case ('shape') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.shape }}</span>\r\n <select (change)=\"set('shape', $any($event.target).value)\">\r\n <option value=\"rectangle\" [selected]=\"c.shape === 'rectangle'\">{{ s.rectangle }}</option>\r\n <option value=\"roundedRectangle\" [selected]=\"c.shape === 'roundedRectangle'\">{{ s.roundedRectangle }}</option>\r\n <option value=\"ellipse\" [selected]=\"c.shape === 'ellipse'\">{{ s.ellipse }}</option>\r\n </select>\r\n </label>\r\n @if (c.shape === 'roundedRectangle') {\r\n <label class=\"pp__row\">\r\n <span>{{ s.cornerRadius }} (mm)</span>\r\n <input type=\"number\" min=\"0\" step=\"0.5\" [value]=\"num(c.cornerRadius ?? 2)\" (input)=\"set('cornerRadius', asNumber($any($event.target).value, 0))\" />\r\n </label>\r\n }\r\n </section>\r\n }\r\n @case ('pageInfo') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <label class=\"pp__row\">\r\n <span>{{ s.pageInfo }}</span>\r\n <select (change)=\"set('info', $any($event.target).value)\">\r\n <option value=\"pageNumber\" [selected]=\"c.info === 'pageNumber'\">{{ s.pageNumber }}</option>\r\n <option value=\"pageCount\" [selected]=\"c.info === 'pageCount'\">{{ s.pageTotal }}</option>\r\n <option value=\"pageNofM\" [selected]=\"c.info === 'pageNofM'\">{{ s.pageNofM }}</option>\r\n <option value=\"printDate\" [selected]=\"c.info === 'printDate'\">{{ s.printDate }}</option>\r\n </select>\r\n </label>\r\n @if (c.info === 'pageNofM' || c.info === 'printDate') {\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.format }}</span>\r\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\" />\r\n </label>\r\n }\r\n </section>\r\n }\r\n @case ('checkbox') {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupContent }}</h3>\r\n <span class=\"pp__label\">{{ s.checked }}</span>\r\n <we-report-bindable-input [value]=\"checkedValue(c)\" [fields]=\"fields()\" [strings]=\"s\" (valueChange)=\"setBindable('checked', $event)\" />\r\n </section>\r\n }\r\n }\r\n\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupLayout }}</h3>\r\n <div class=\"pp__grid\">\r\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>\r\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>\r\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>\r\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>\r\n </div>\r\n </section>\r\n }\r\n\r\n <!-- Appearance applies to every selected control at once. -->\r\n @if (style(); as st) {\r\n @if (hasText()) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupAppearance }}</h3>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.font }}</span>\r\n <select (change)=\"setStyle('fontFamily', $any($event.target).value)\">\r\n @for (f of fontFamilies(); track f) {\r\n <option [value]=\"f\" [selected]=\"f === st.fontFamily\">{{ f }}</option>\r\n }\r\n @if (!fontFamilies().includes(st.fontFamily)) {\r\n <option [value]=\"st.fontFamily\" selected>{{ st.fontFamily }}</option>\r\n }\r\n </select>\r\n </label>\r\n <div class=\"pp__row\">\r\n <span>{{ s.fontSize }} (pt)</span>\r\n <input type=\"number\" min=\"4\" max=\"200\" step=\"0.5\" [value]=\"num(st.fontSize)\" (input)=\"setStyle('fontSize', asNumber($any($event.target).value, 4))\" />\r\n </div>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"st.bold\" (click)=\"setStyle('bold', !st.bold)\" [attr.aria-pressed]=\"st.bold\"><b>{{ s.bold }}</b></button>\r\n <button type=\"button\" [class.pp__on]=\"st.italic\" (click)=\"setStyle('italic', !st.italic)\" [attr.aria-pressed]=\"st.italic\"><i>{{ s.italic }}</i></button>\r\n <button type=\"button\" [class.pp__on]=\"st.underline\" (click)=\"setStyle('underline', !st.underline)\" [attr.aria-pressed]=\"st.underline\"><u>{{ s.underline }}</u></button>\r\n </div>\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.alignment }}</span>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'left'\" (click)=\"setStyle('textAlign', 'left')\">{{ s.alignLeft }}</button>\r\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'center'\" (click)=\"setStyle('textAlign', 'center')\">{{ s.alignCenter }}</button>\r\n <button type=\"button\" [class.pp__on]=\"st.textAlign === 'right'\" (click)=\"setStyle('textAlign', 'right')\">{{ s.alignRight }}</button>\r\n </div>\r\n </div>\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.verticalAlignment }}</span>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'top'\" (click)=\"setStyle('verticalAlign', 'top')\">{{ s.alignTop }}</button>\r\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'middle'\" (click)=\"setStyle('verticalAlign', 'middle')\">{{ s.alignMiddle }}</button>\r\n <button type=\"button\" [class.pp__on]=\"st.verticalAlign === 'bottom'\" (click)=\"setStyle('verticalAlign', 'bottom')\">{{ s.alignBottom }}</button>\r\n </div>\r\n </div>\r\n <label class=\"pp__row\">\r\n <span>{{ s.textColor }}</span>\r\n <input type=\"color\" [value]=\"st.color\" (input)=\"setStyle('color', $any($event.target).value)\" />\r\n </label>\r\n </section>\r\n }\r\n @if (control()?.type !== 'line') {\r\n <section class=\"pp__section\">\r\n @if (!hasText()) {\r\n <h3>{{ s.groupAppearance }}</h3>\r\n }\r\n <label class=\"pp__row\">\r\n <span>{{ s.backgroundColor }}</span>\r\n <span class=\"pp__color\">\r\n <input type=\"color\" [value]=\"st.backgroundColor ?? '#ffffff'\" (input)=\"setStyle('backgroundColor', $any($event.target).value)\" />\r\n <button type=\"button\" class=\"pp__link\" (click)=\"setStyle('backgroundColor', undefined)\">{{ s.noColor }}</button>\r\n </span>\r\n </label>\r\n <div class=\"pp__row pp__row--stack\">\r\n <span>{{ s.border }}</span>\r\n <div class=\"pp__segmented\">\r\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.top\" (click)=\"toggleBorderSide('top', !st.border?.sides?.top)\">{{ s.marginTop }}</button>\r\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.right\" (click)=\"toggleBorderSide('right', !st.border?.sides?.right)\">{{ s.marginRight }}</button>\r\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.bottom\" (click)=\"toggleBorderSide('bottom', !st.border?.sides?.bottom)\">{{ s.marginBottom }}</button>\r\n <button type=\"button\" [class.pp__on]=\"!!st.border?.sides?.left\" (click)=\"toggleBorderSide('left', !st.border?.sides?.left)\">{{ s.marginLeft }}</button>\r\n </div>\r\n </div>\r\n @if (st.border) {\r\n <div class=\"pp__grid\">\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.borderWidth }}</span>\r\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) })\" />\r\n </label>\r\n <label class=\"pp__row pp__row--stack\">\r\n <span>{{ s.borderColor }}</span>\r\n <input type=\"color\" [value]=\"st.border.color\" (input)=\"setBorder({ color: $any($event.target).value })\" />\r\n </label>\r\n </div>\r\n }\r\n @if (advanced() && hasText()) {\r\n <label class=\"pp__row\">\r\n <span>{{ s.padding }} (mm)</span>\r\n <input type=\"number\" min=\"0\" step=\"0.1\" [value]=\"num(st.padding)\" (input)=\"setStyle('padding', asNumber($any($event.target).value, 0))\" />\r\n </label>\r\n }\r\n </section>\r\n }\r\n }\r\n\r\n @if (advanced() && control(); as c) {\r\n <section class=\"pp__section\">\r\n <h3>{{ s.groupBehaviour }}</h3>\r\n <span class=\"pp__label\">{{ s.visibleWhen }}</span>\r\n <input class=\"pp__mono\" [value]=\"$any(visibleValue(c)).expression ?? ''\" (input)=\"setVisible({ expression: $any($event.target).value })\" spellcheck=\"false\" placeholder=\"[Total] > 0\" />\r\n <small class=\"pp__hint\">{{ s.visibleWhenHint }}</small>\r\n </section>\r\n }\r\n}\r\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__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"] }]
|
|
3984
|
+
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 === '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 ('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__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"] }]
|
|
2217
3985
|
}] });
|
|
2218
3986
|
function positive(value, min) {
|
|
2219
3987
|
const n = Number(String(value).replace(',', '.'));
|
|
@@ -2375,260 +4143,260 @@ class DatabaseSourceEditorComponent {
|
|
|
2375
4143
|
}
|
|
2376
4144
|
}
|
|
2377
4145
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DatabaseSourceEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2378
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DatabaseSourceEditorComponent, isStandalone: true, selector: "we-report-database-source-editor", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, fetchFn: { classPropertyName: "fetchFn", publicName: "fetchFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { edit: "edit" }, ngImport: i0, template: `
|
|
2379
|
-
@let s = strings();
|
|
2380
|
-
@let src = source();
|
|
2381
|
-
<div class="dbe__row">
|
|
2382
|
-
<label class="dbe__grow">
|
|
2383
|
-
<span>{{ s.backendAddress }}</span>
|
|
2384
|
-
<input [value]="backend.url()" (change)="backend.url.set($any($event.target).value.trim())" placeholder="http://127.0.0.1:5480" spellcheck="false" />
|
|
2385
|
-
</label>
|
|
2386
|
-
<button type="button" (click)="connect()">{{ s.connect }}</button>
|
|
2387
|
-
</div>
|
|
2388
|
-
@if (status(); as st) {
|
|
2389
|
-
<p [class.dbe__error]="!st.ok" [class.dbe__ok]="st.ok">{{ st.message }}</p>
|
|
2390
|
-
}
|
|
2391
|
-
|
|
2392
|
-
@if (connections().length) {
|
|
2393
|
-
<label>
|
|
2394
|
-
<span>{{ s.connection }}</span>
|
|
2395
|
-
<select (change)="setConnection($any($event.target).value)">
|
|
2396
|
-
<option value="" [selected]="!src.connectionId">—</option>
|
|
2397
|
-
@for (c of connections(); track c.id) {
|
|
2398
|
-
<option [value]="c.id" [selected]="c.id === src.connectionId">{{ c.name }} ({{ c.dialect }})</option>
|
|
2399
|
-
}
|
|
2400
|
-
</select>
|
|
2401
|
-
</label>
|
|
2402
|
-
}
|
|
2403
|
-
|
|
2404
|
-
@if (connection()?.freeSql) {
|
|
2405
|
-
<label class="dbe__check">
|
|
2406
|
-
<input type="checkbox" [checked]="src.sql !== undefined" (change)="toggleSql($any($event.target).checked)" />
|
|
2407
|
-
{{ s.writeSql }}
|
|
2408
|
-
</label>
|
|
2409
|
-
}
|
|
2410
|
-
|
|
2411
|
-
@if (src.sql !== undefined) {
|
|
2412
|
-
<label>
|
|
2413
|
-
<span>SQL</span>
|
|
2414
|
-
<textarea rows="6" spellcheck="false" [value]="src.sql" (input)="setSql($any($event.target).value)" placeholder="SELECT * FROM orders WHERE order_date >= :from"></textarea>
|
|
2415
|
-
<small class="dbe__hint">{{ s.sqlHint }}</small>
|
|
2416
|
-
</label>
|
|
2417
|
-
} @else if (schema()) {
|
|
2418
|
-
@let sc = schema()!;
|
|
2419
|
-
<label>
|
|
2420
|
-
<span>{{ s.table }}</span>
|
|
2421
|
-
<select (change)="setTable($any($event.target).value)">
|
|
2422
|
-
<option value="" [selected]="!query().table">—</option>
|
|
2423
|
-
@for (t of sc.tables; track t.name) {
|
|
2424
|
-
<option [value]="t.name" [selected]="t.name === query().table">{{ t.name }}</option>
|
|
2425
|
-
}
|
|
2426
|
-
</select>
|
|
2427
|
-
</label>
|
|
2428
|
-
@if (tableColumns().length) {
|
|
2429
|
-
<div>
|
|
2430
|
-
<span class="dbe__label">{{ s.columns }}</span>
|
|
2431
|
-
<div class="dbe__columns">
|
|
2432
|
-
@for (col of tableColumns(); track col.name) {
|
|
2433
|
-
<label class="dbe__check">
|
|
2434
|
-
<input type="checkbox" [checked]="isColumnOn(col.name)" (change)="toggleColumn(col.name, $any($event.target).checked)" />
|
|
2435
|
-
{{ col.name }}
|
|
2436
|
-
</label>
|
|
2437
|
-
}
|
|
2438
|
-
</div>
|
|
2439
|
-
</div>
|
|
2440
|
-
<div>
|
|
2441
|
-
<span class="dbe__label">{{ s.filters }}</span>
|
|
2442
|
-
@for (w of query().where ?? []; track $index; let i = $index) {
|
|
2443
|
-
<div class="dbe__row">
|
|
2444
|
-
<select (change)="setWhere(i, 'column', $any($event.target).value)" [attr.aria-label]="s.columns">
|
|
2445
|
-
@for (col of tableColumns(); track col.name) {
|
|
2446
|
-
<option [value]="col.name" [selected]="col.name === w.column">{{ col.name }}</option>
|
|
2447
|
-
}
|
|
2448
|
-
</select>
|
|
2449
|
-
<select (change)="setWhere(i, 'op', $any($event.target).value)" class="dbe__op">
|
|
2450
|
-
@for (op of operators; track op) {
|
|
2451
|
-
<option [value]="op" [selected]="op === w.op">{{ opLabel(op) }}</option>
|
|
2452
|
-
}
|
|
2453
|
-
</select>
|
|
2454
|
-
@if (w.op !== 'isNull' && w.op !== 'notNull') {
|
|
2455
|
-
<select (change)="setWhere(i, 'param', $any($event.target).value)" class="dbe__source">
|
|
2456
|
-
<option value="" [selected]="!w.param">{{ s.fixedValue }}</option>
|
|
2457
|
-
@for (p of parameters(); track p.name) {
|
|
2458
|
-
<option [value]="p.name" [selected]="p.name === w.param">[?{{ p.name }}]</option>
|
|
2459
|
-
}
|
|
2460
|
-
</select>
|
|
2461
|
-
@if (!w.param) {
|
|
2462
|
-
<input class="dbe__grow" [value]="w.value ?? ''" (input)="setWhere(i, 'value', $any($event.target).value)" />
|
|
2463
|
-
}
|
|
2464
|
-
}
|
|
2465
|
-
<button type="button" (click)="removeWhere(i)" [attr.aria-label]="s.delete">×</button>
|
|
2466
|
-
</div>
|
|
2467
|
-
}
|
|
2468
|
-
<button type="button" class="dbe__link" (click)="addWhere()">+ {{ s.addFilter }}</button>
|
|
2469
|
-
</div>
|
|
2470
|
-
<div class="dbe__row">
|
|
2471
|
-
<label class="dbe__grow">
|
|
2472
|
-
<span>{{ s.sortBy }}</span>
|
|
2473
|
-
<select (change)="setOrder($any($event.target).value, query().orderBy?.[0]?.dir ?? 'asc')">
|
|
2474
|
-
<option value="" [selected]="!query().orderBy?.length">—</option>
|
|
2475
|
-
@for (col of tableColumns(); track col.name) {
|
|
2476
|
-
<option [value]="col.name" [selected]="col.name === query().orderBy?.[0]?.column">{{ col.name }}</option>
|
|
2477
|
-
}
|
|
2478
|
-
</select>
|
|
2479
|
-
</label>
|
|
2480
|
-
<label>
|
|
2481
|
-
<span> </span>
|
|
2482
|
-
<select (change)="setOrder(query().orderBy?.[0]?.column ?? '', $any($event.target).value)">
|
|
2483
|
-
<option value="asc" [selected]="query().orderBy?.[0]?.dir !== 'desc'">{{ s.sortAsc }}</option>
|
|
2484
|
-
<option value="desc" [selected]="query().orderBy?.[0]?.dir === 'desc'">{{ s.sortDesc }}</option>
|
|
2485
|
-
</select>
|
|
2486
|
-
</label>
|
|
2487
|
-
<label>
|
|
2488
|
-
<span>{{ s.maxRows }}</span>
|
|
2489
|
-
<input type="number" min="1" [value]="query().limit ?? ''" (input)="setLimit($any($event.target).value)" />
|
|
2490
|
-
</label>
|
|
2491
|
-
</div>
|
|
2492
|
-
}
|
|
2493
|
-
}
|
|
2494
|
-
|
|
2495
|
-
@if (src.connectionId && (src.sql !== undefined || query().table)) {
|
|
2496
|
-
<div class="dbe__row">
|
|
2497
|
-
<button type="button" class="dbe__primary" (click)="test()" [disabled]="testing()">{{ testing() ? s.testing : s.test }}</button>
|
|
2498
|
-
</div>
|
|
2499
|
-
@if (testResult(); as r) {
|
|
2500
|
-
<p [class.dbe__ok]="r.ok" [class.dbe__error]="!r.ok">{{ r.message }}</p>
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
4146
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DatabaseSourceEditorComponent, isStandalone: true, selector: "we-report-database-source-editor", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, fetchFn: { classPropertyName: "fetchFn", publicName: "fetchFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { edit: "edit" }, ngImport: i0, template: `
|
|
4147
|
+
@let s = strings();
|
|
4148
|
+
@let src = source();
|
|
4149
|
+
<div class="dbe__row">
|
|
4150
|
+
<label class="dbe__grow">
|
|
4151
|
+
<span>{{ s.backendAddress }}</span>
|
|
4152
|
+
<input [value]="backend.url()" (change)="backend.url.set($any($event.target).value.trim())" placeholder="http://127.0.0.1:5480" spellcheck="false" />
|
|
4153
|
+
</label>
|
|
4154
|
+
<button type="button" (click)="connect()">{{ s.connect }}</button>
|
|
4155
|
+
</div>
|
|
4156
|
+
@if (status(); as st) {
|
|
4157
|
+
<p [class.dbe__error]="!st.ok" [class.dbe__ok]="st.ok">{{ st.message }}</p>
|
|
4158
|
+
}
|
|
4159
|
+
|
|
4160
|
+
@if (connections().length) {
|
|
4161
|
+
<label>
|
|
4162
|
+
<span>{{ s.connection }}</span>
|
|
4163
|
+
<select (change)="setConnection($any($event.target).value)">
|
|
4164
|
+
<option value="" [selected]="!src.connectionId">—</option>
|
|
4165
|
+
@for (c of connections(); track c.id) {
|
|
4166
|
+
<option [value]="c.id" [selected]="c.id === src.connectionId">{{ c.name }} ({{ c.dialect }})</option>
|
|
4167
|
+
}
|
|
4168
|
+
</select>
|
|
4169
|
+
</label>
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4172
|
+
@if (connection()?.freeSql) {
|
|
4173
|
+
<label class="dbe__check">
|
|
4174
|
+
<input type="checkbox" [checked]="src.sql !== undefined" (change)="toggleSql($any($event.target).checked)" />
|
|
4175
|
+
{{ s.writeSql }}
|
|
4176
|
+
</label>
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4179
|
+
@if (src.sql !== undefined) {
|
|
4180
|
+
<label>
|
|
4181
|
+
<span>SQL</span>
|
|
4182
|
+
<textarea rows="6" spellcheck="false" [value]="src.sql" (input)="setSql($any($event.target).value)" placeholder="SELECT * FROM orders WHERE order_date >= :from"></textarea>
|
|
4183
|
+
<small class="dbe__hint">{{ s.sqlHint }}</small>
|
|
4184
|
+
</label>
|
|
4185
|
+
} @else if (schema()) {
|
|
4186
|
+
@let sc = schema()!;
|
|
4187
|
+
<label>
|
|
4188
|
+
<span>{{ s.table }}</span>
|
|
4189
|
+
<select (change)="setTable($any($event.target).value)">
|
|
4190
|
+
<option value="" [selected]="!query().table">—</option>
|
|
4191
|
+
@for (t of sc.tables; track t.name) {
|
|
4192
|
+
<option [value]="t.name" [selected]="t.name === query().table">{{ t.name }}</option>
|
|
4193
|
+
}
|
|
4194
|
+
</select>
|
|
4195
|
+
</label>
|
|
4196
|
+
@if (tableColumns().length) {
|
|
4197
|
+
<div>
|
|
4198
|
+
<span class="dbe__label">{{ s.columns }}</span>
|
|
4199
|
+
<div class="dbe__columns">
|
|
4200
|
+
@for (col of tableColumns(); track col.name) {
|
|
4201
|
+
<label class="dbe__check">
|
|
4202
|
+
<input type="checkbox" [checked]="isColumnOn(col.name)" (change)="toggleColumn(col.name, $any($event.target).checked)" />
|
|
4203
|
+
{{ col.name }}
|
|
4204
|
+
</label>
|
|
4205
|
+
}
|
|
4206
|
+
</div>
|
|
4207
|
+
</div>
|
|
4208
|
+
<div>
|
|
4209
|
+
<span class="dbe__label">{{ s.filters }}</span>
|
|
4210
|
+
@for (w of query().where ?? []; track $index; let i = $index) {
|
|
4211
|
+
<div class="dbe__row">
|
|
4212
|
+
<select (change)="setWhere(i, 'column', $any($event.target).value)" [attr.aria-label]="s.columns">
|
|
4213
|
+
@for (col of tableColumns(); track col.name) {
|
|
4214
|
+
<option [value]="col.name" [selected]="col.name === w.column">{{ col.name }}</option>
|
|
4215
|
+
}
|
|
4216
|
+
</select>
|
|
4217
|
+
<select (change)="setWhere(i, 'op', $any($event.target).value)" class="dbe__op">
|
|
4218
|
+
@for (op of operators; track op) {
|
|
4219
|
+
<option [value]="op" [selected]="op === w.op">{{ opLabel(op) }}</option>
|
|
4220
|
+
}
|
|
4221
|
+
</select>
|
|
4222
|
+
@if (w.op !== 'isNull' && w.op !== 'notNull') {
|
|
4223
|
+
<select (change)="setWhere(i, 'param', $any($event.target).value)" class="dbe__source">
|
|
4224
|
+
<option value="" [selected]="!w.param">{{ s.fixedValue }}</option>
|
|
4225
|
+
@for (p of parameters(); track p.name) {
|
|
4226
|
+
<option [value]="p.name" [selected]="p.name === w.param">[?{{ p.name }}]</option>
|
|
4227
|
+
}
|
|
4228
|
+
</select>
|
|
4229
|
+
@if (!w.param) {
|
|
4230
|
+
<input class="dbe__grow" [value]="w.value ?? ''" (input)="setWhere(i, 'value', $any($event.target).value)" />
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4233
|
+
<button type="button" (click)="removeWhere(i)" [attr.aria-label]="s.delete">×</button>
|
|
4234
|
+
</div>
|
|
4235
|
+
}
|
|
4236
|
+
<button type="button" class="dbe__link" (click)="addWhere()">+ {{ s.addFilter }}</button>
|
|
4237
|
+
</div>
|
|
4238
|
+
<div class="dbe__row">
|
|
4239
|
+
<label class="dbe__grow">
|
|
4240
|
+
<span>{{ s.sortBy }}</span>
|
|
4241
|
+
<select (change)="setOrder($any($event.target).value, query().orderBy?.[0]?.dir ?? 'asc')">
|
|
4242
|
+
<option value="" [selected]="!query().orderBy?.length">—</option>
|
|
4243
|
+
@for (col of tableColumns(); track col.name) {
|
|
4244
|
+
<option [value]="col.name" [selected]="col.name === query().orderBy?.[0]?.column">{{ col.name }}</option>
|
|
4245
|
+
}
|
|
4246
|
+
</select>
|
|
4247
|
+
</label>
|
|
4248
|
+
<label>
|
|
4249
|
+
<span> </span>
|
|
4250
|
+
<select (change)="setOrder(query().orderBy?.[0]?.column ?? '', $any($event.target).value)">
|
|
4251
|
+
<option value="asc" [selected]="query().orderBy?.[0]?.dir !== 'desc'">{{ s.sortAsc }}</option>
|
|
4252
|
+
<option value="desc" [selected]="query().orderBy?.[0]?.dir === 'desc'">{{ s.sortDesc }}</option>
|
|
4253
|
+
</select>
|
|
4254
|
+
</label>
|
|
4255
|
+
<label>
|
|
4256
|
+
<span>{{ s.maxRows }}</span>
|
|
4257
|
+
<input type="number" min="1" [value]="query().limit ?? ''" (input)="setLimit($any($event.target).value)" />
|
|
4258
|
+
</label>
|
|
4259
|
+
</div>
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
|
|
4263
|
+
@if (src.connectionId && (src.sql !== undefined || query().table)) {
|
|
4264
|
+
<div class="dbe__row">
|
|
4265
|
+
<button type="button" class="dbe__primary" (click)="test()" [disabled]="testing()">{{ testing() ? s.testing : s.test }}</button>
|
|
4266
|
+
</div>
|
|
4267
|
+
@if (testResult(); as r) {
|
|
4268
|
+
<p [class.dbe__ok]="r.ok" [class.dbe__error]="!r.ok">{{ r.message }}</p>
|
|
4269
|
+
}
|
|
4270
|
+
}
|
|
2503
4271
|
`, isInline: true, styles: [":host{display:flex;flex-direction:column;gap:10px}label{display:flex;flex-direction:column;gap:4px}label>span,.dbe__label{font-weight:500}.dbe__row{display:flex;gap:6px;align-items:flex-end;margin-bottom:4px}.dbe__grow{flex:1}.dbe__op{width:110px}.dbe__source{width:140px}.dbe__columns{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:4px}.dbe__check{flex-direction:row;align-items:center;gap:6px;font-weight:400}input:not([type=checkbox]),select,textarea,button{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;min-width:0}input:focus,select:focus,textarea:focus,button:focus-visible{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}button{cursor:pointer;font-weight:500}button:disabled{opacity:.4;cursor:default}.dbe__primary{padding:6px 14px;background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.dbe__link{padding:0;background:none;color:var(--we-report-accent, #007aff)}.dbe__hint{font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.dbe__ok,.dbe__error{margin:0;padding:8px 12px;border-radius:10px;font-size:12px}.dbe__ok{background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff)}.dbe__error{background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2504
4272
|
}
|
|
2505
4273
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DatabaseSourceEditorComponent, decorators: [{
|
|
2506
4274
|
type: Component,
|
|
2507
|
-
args: [{ selector: 'we-report-database-source-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2508
|
-
@let s = strings();
|
|
2509
|
-
@let src = source();
|
|
2510
|
-
<div class="dbe__row">
|
|
2511
|
-
<label class="dbe__grow">
|
|
2512
|
-
<span>{{ s.backendAddress }}</span>
|
|
2513
|
-
<input [value]="backend.url()" (change)="backend.url.set($any($event.target).value.trim())" placeholder="http://127.0.0.1:5480" spellcheck="false" />
|
|
2514
|
-
</label>
|
|
2515
|
-
<button type="button" (click)="connect()">{{ s.connect }}</button>
|
|
2516
|
-
</div>
|
|
2517
|
-
@if (status(); as st) {
|
|
2518
|
-
<p [class.dbe__error]="!st.ok" [class.dbe__ok]="st.ok">{{ st.message }}</p>
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
|
-
@if (connections().length) {
|
|
2522
|
-
<label>
|
|
2523
|
-
<span>{{ s.connection }}</span>
|
|
2524
|
-
<select (change)="setConnection($any($event.target).value)">
|
|
2525
|
-
<option value="" [selected]="!src.connectionId">—</option>
|
|
2526
|
-
@for (c of connections(); track c.id) {
|
|
2527
|
-
<option [value]="c.id" [selected]="c.id === src.connectionId">{{ c.name }} ({{ c.dialect }})</option>
|
|
2528
|
-
}
|
|
2529
|
-
</select>
|
|
2530
|
-
</label>
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
@if (connection()?.freeSql) {
|
|
2534
|
-
<label class="dbe__check">
|
|
2535
|
-
<input type="checkbox" [checked]="src.sql !== undefined" (change)="toggleSql($any($event.target).checked)" />
|
|
2536
|
-
{{ s.writeSql }}
|
|
2537
|
-
</label>
|
|
2538
|
-
}
|
|
2539
|
-
|
|
2540
|
-
@if (src.sql !== undefined) {
|
|
2541
|
-
<label>
|
|
2542
|
-
<span>SQL</span>
|
|
2543
|
-
<textarea rows="6" spellcheck="false" [value]="src.sql" (input)="setSql($any($event.target).value)" placeholder="SELECT * FROM orders WHERE order_date >= :from"></textarea>
|
|
2544
|
-
<small class="dbe__hint">{{ s.sqlHint }}</small>
|
|
2545
|
-
</label>
|
|
2546
|
-
} @else if (schema()) {
|
|
2547
|
-
@let sc = schema()!;
|
|
2548
|
-
<label>
|
|
2549
|
-
<span>{{ s.table }}</span>
|
|
2550
|
-
<select (change)="setTable($any($event.target).value)">
|
|
2551
|
-
<option value="" [selected]="!query().table">—</option>
|
|
2552
|
-
@for (t of sc.tables; track t.name) {
|
|
2553
|
-
<option [value]="t.name" [selected]="t.name === query().table">{{ t.name }}</option>
|
|
2554
|
-
}
|
|
2555
|
-
</select>
|
|
2556
|
-
</label>
|
|
2557
|
-
@if (tableColumns().length) {
|
|
2558
|
-
<div>
|
|
2559
|
-
<span class="dbe__label">{{ s.columns }}</span>
|
|
2560
|
-
<div class="dbe__columns">
|
|
2561
|
-
@for (col of tableColumns(); track col.name) {
|
|
2562
|
-
<label class="dbe__check">
|
|
2563
|
-
<input type="checkbox" [checked]="isColumnOn(col.name)" (change)="toggleColumn(col.name, $any($event.target).checked)" />
|
|
2564
|
-
{{ col.name }}
|
|
2565
|
-
</label>
|
|
2566
|
-
}
|
|
2567
|
-
</div>
|
|
2568
|
-
</div>
|
|
2569
|
-
<div>
|
|
2570
|
-
<span class="dbe__label">{{ s.filters }}</span>
|
|
2571
|
-
@for (w of query().where ?? []; track $index; let i = $index) {
|
|
2572
|
-
<div class="dbe__row">
|
|
2573
|
-
<select (change)="setWhere(i, 'column', $any($event.target).value)" [attr.aria-label]="s.columns">
|
|
2574
|
-
@for (col of tableColumns(); track col.name) {
|
|
2575
|
-
<option [value]="col.name" [selected]="col.name === w.column">{{ col.name }}</option>
|
|
2576
|
-
}
|
|
2577
|
-
</select>
|
|
2578
|
-
<select (change)="setWhere(i, 'op', $any($event.target).value)" class="dbe__op">
|
|
2579
|
-
@for (op of operators; track op) {
|
|
2580
|
-
<option [value]="op" [selected]="op === w.op">{{ opLabel(op) }}</option>
|
|
2581
|
-
}
|
|
2582
|
-
</select>
|
|
2583
|
-
@if (w.op !== 'isNull' && w.op !== 'notNull') {
|
|
2584
|
-
<select (change)="setWhere(i, 'param', $any($event.target).value)" class="dbe__source">
|
|
2585
|
-
<option value="" [selected]="!w.param">{{ s.fixedValue }}</option>
|
|
2586
|
-
@for (p of parameters(); track p.name) {
|
|
2587
|
-
<option [value]="p.name" [selected]="p.name === w.param">[?{{ p.name }}]</option>
|
|
2588
|
-
}
|
|
2589
|
-
</select>
|
|
2590
|
-
@if (!w.param) {
|
|
2591
|
-
<input class="dbe__grow" [value]="w.value ?? ''" (input)="setWhere(i, 'value', $any($event.target).value)" />
|
|
2592
|
-
}
|
|
2593
|
-
}
|
|
2594
|
-
<button type="button" (click)="removeWhere(i)" [attr.aria-label]="s.delete">×</button>
|
|
2595
|
-
</div>
|
|
2596
|
-
}
|
|
2597
|
-
<button type="button" class="dbe__link" (click)="addWhere()">+ {{ s.addFilter }}</button>
|
|
2598
|
-
</div>
|
|
2599
|
-
<div class="dbe__row">
|
|
2600
|
-
<label class="dbe__grow">
|
|
2601
|
-
<span>{{ s.sortBy }}</span>
|
|
2602
|
-
<select (change)="setOrder($any($event.target).value, query().orderBy?.[0]?.dir ?? 'asc')">
|
|
2603
|
-
<option value="" [selected]="!query().orderBy?.length">—</option>
|
|
2604
|
-
@for (col of tableColumns(); track col.name) {
|
|
2605
|
-
<option [value]="col.name" [selected]="col.name === query().orderBy?.[0]?.column">{{ col.name }}</option>
|
|
2606
|
-
}
|
|
2607
|
-
</select>
|
|
2608
|
-
</label>
|
|
2609
|
-
<label>
|
|
2610
|
-
<span> </span>
|
|
2611
|
-
<select (change)="setOrder(query().orderBy?.[0]?.column ?? '', $any($event.target).value)">
|
|
2612
|
-
<option value="asc" [selected]="query().orderBy?.[0]?.dir !== 'desc'">{{ s.sortAsc }}</option>
|
|
2613
|
-
<option value="desc" [selected]="query().orderBy?.[0]?.dir === 'desc'">{{ s.sortDesc }}</option>
|
|
2614
|
-
</select>
|
|
2615
|
-
</label>
|
|
2616
|
-
<label>
|
|
2617
|
-
<span>{{ s.maxRows }}</span>
|
|
2618
|
-
<input type="number" min="1" [value]="query().limit ?? ''" (input)="setLimit($any($event.target).value)" />
|
|
2619
|
-
</label>
|
|
2620
|
-
</div>
|
|
2621
|
-
}
|
|
2622
|
-
}
|
|
2623
|
-
|
|
2624
|
-
@if (src.connectionId && (src.sql !== undefined || query().table)) {
|
|
2625
|
-
<div class="dbe__row">
|
|
2626
|
-
<button type="button" class="dbe__primary" (click)="test()" [disabled]="testing()">{{ testing() ? s.testing : s.test }}</button>
|
|
2627
|
-
</div>
|
|
2628
|
-
@if (testResult(); as r) {
|
|
2629
|
-
<p [class.dbe__ok]="r.ok" [class.dbe__error]="!r.ok">{{ r.message }}</p>
|
|
2630
|
-
}
|
|
2631
|
-
}
|
|
4275
|
+
args: [{ selector: 'we-report-database-source-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4276
|
+
@let s = strings();
|
|
4277
|
+
@let src = source();
|
|
4278
|
+
<div class="dbe__row">
|
|
4279
|
+
<label class="dbe__grow">
|
|
4280
|
+
<span>{{ s.backendAddress }}</span>
|
|
4281
|
+
<input [value]="backend.url()" (change)="backend.url.set($any($event.target).value.trim())" placeholder="http://127.0.0.1:5480" spellcheck="false" />
|
|
4282
|
+
</label>
|
|
4283
|
+
<button type="button" (click)="connect()">{{ s.connect }}</button>
|
|
4284
|
+
</div>
|
|
4285
|
+
@if (status(); as st) {
|
|
4286
|
+
<p [class.dbe__error]="!st.ok" [class.dbe__ok]="st.ok">{{ st.message }}</p>
|
|
4287
|
+
}
|
|
4288
|
+
|
|
4289
|
+
@if (connections().length) {
|
|
4290
|
+
<label>
|
|
4291
|
+
<span>{{ s.connection }}</span>
|
|
4292
|
+
<select (change)="setConnection($any($event.target).value)">
|
|
4293
|
+
<option value="" [selected]="!src.connectionId">—</option>
|
|
4294
|
+
@for (c of connections(); track c.id) {
|
|
4295
|
+
<option [value]="c.id" [selected]="c.id === src.connectionId">{{ c.name }} ({{ c.dialect }})</option>
|
|
4296
|
+
}
|
|
4297
|
+
</select>
|
|
4298
|
+
</label>
|
|
4299
|
+
}
|
|
4300
|
+
|
|
4301
|
+
@if (connection()?.freeSql) {
|
|
4302
|
+
<label class="dbe__check">
|
|
4303
|
+
<input type="checkbox" [checked]="src.sql !== undefined" (change)="toggleSql($any($event.target).checked)" />
|
|
4304
|
+
{{ s.writeSql }}
|
|
4305
|
+
</label>
|
|
4306
|
+
}
|
|
4307
|
+
|
|
4308
|
+
@if (src.sql !== undefined) {
|
|
4309
|
+
<label>
|
|
4310
|
+
<span>SQL</span>
|
|
4311
|
+
<textarea rows="6" spellcheck="false" [value]="src.sql" (input)="setSql($any($event.target).value)" placeholder="SELECT * FROM orders WHERE order_date >= :from"></textarea>
|
|
4312
|
+
<small class="dbe__hint">{{ s.sqlHint }}</small>
|
|
4313
|
+
</label>
|
|
4314
|
+
} @else if (schema()) {
|
|
4315
|
+
@let sc = schema()!;
|
|
4316
|
+
<label>
|
|
4317
|
+
<span>{{ s.table }}</span>
|
|
4318
|
+
<select (change)="setTable($any($event.target).value)">
|
|
4319
|
+
<option value="" [selected]="!query().table">—</option>
|
|
4320
|
+
@for (t of sc.tables; track t.name) {
|
|
4321
|
+
<option [value]="t.name" [selected]="t.name === query().table">{{ t.name }}</option>
|
|
4322
|
+
}
|
|
4323
|
+
</select>
|
|
4324
|
+
</label>
|
|
4325
|
+
@if (tableColumns().length) {
|
|
4326
|
+
<div>
|
|
4327
|
+
<span class="dbe__label">{{ s.columns }}</span>
|
|
4328
|
+
<div class="dbe__columns">
|
|
4329
|
+
@for (col of tableColumns(); track col.name) {
|
|
4330
|
+
<label class="dbe__check">
|
|
4331
|
+
<input type="checkbox" [checked]="isColumnOn(col.name)" (change)="toggleColumn(col.name, $any($event.target).checked)" />
|
|
4332
|
+
{{ col.name }}
|
|
4333
|
+
</label>
|
|
4334
|
+
}
|
|
4335
|
+
</div>
|
|
4336
|
+
</div>
|
|
4337
|
+
<div>
|
|
4338
|
+
<span class="dbe__label">{{ s.filters }}</span>
|
|
4339
|
+
@for (w of query().where ?? []; track $index; let i = $index) {
|
|
4340
|
+
<div class="dbe__row">
|
|
4341
|
+
<select (change)="setWhere(i, 'column', $any($event.target).value)" [attr.aria-label]="s.columns">
|
|
4342
|
+
@for (col of tableColumns(); track col.name) {
|
|
4343
|
+
<option [value]="col.name" [selected]="col.name === w.column">{{ col.name }}</option>
|
|
4344
|
+
}
|
|
4345
|
+
</select>
|
|
4346
|
+
<select (change)="setWhere(i, 'op', $any($event.target).value)" class="dbe__op">
|
|
4347
|
+
@for (op of operators; track op) {
|
|
4348
|
+
<option [value]="op" [selected]="op === w.op">{{ opLabel(op) }}</option>
|
|
4349
|
+
}
|
|
4350
|
+
</select>
|
|
4351
|
+
@if (w.op !== 'isNull' && w.op !== 'notNull') {
|
|
4352
|
+
<select (change)="setWhere(i, 'param', $any($event.target).value)" class="dbe__source">
|
|
4353
|
+
<option value="" [selected]="!w.param">{{ s.fixedValue }}</option>
|
|
4354
|
+
@for (p of parameters(); track p.name) {
|
|
4355
|
+
<option [value]="p.name" [selected]="p.name === w.param">[?{{ p.name }}]</option>
|
|
4356
|
+
}
|
|
4357
|
+
</select>
|
|
4358
|
+
@if (!w.param) {
|
|
4359
|
+
<input class="dbe__grow" [value]="w.value ?? ''" (input)="setWhere(i, 'value', $any($event.target).value)" />
|
|
4360
|
+
}
|
|
4361
|
+
}
|
|
4362
|
+
<button type="button" (click)="removeWhere(i)" [attr.aria-label]="s.delete">×</button>
|
|
4363
|
+
</div>
|
|
4364
|
+
}
|
|
4365
|
+
<button type="button" class="dbe__link" (click)="addWhere()">+ {{ s.addFilter }}</button>
|
|
4366
|
+
</div>
|
|
4367
|
+
<div class="dbe__row">
|
|
4368
|
+
<label class="dbe__grow">
|
|
4369
|
+
<span>{{ s.sortBy }}</span>
|
|
4370
|
+
<select (change)="setOrder($any($event.target).value, query().orderBy?.[0]?.dir ?? 'asc')">
|
|
4371
|
+
<option value="" [selected]="!query().orderBy?.length">—</option>
|
|
4372
|
+
@for (col of tableColumns(); track col.name) {
|
|
4373
|
+
<option [value]="col.name" [selected]="col.name === query().orderBy?.[0]?.column">{{ col.name }}</option>
|
|
4374
|
+
}
|
|
4375
|
+
</select>
|
|
4376
|
+
</label>
|
|
4377
|
+
<label>
|
|
4378
|
+
<span> </span>
|
|
4379
|
+
<select (change)="setOrder(query().orderBy?.[0]?.column ?? '', $any($event.target).value)">
|
|
4380
|
+
<option value="asc" [selected]="query().orderBy?.[0]?.dir !== 'desc'">{{ s.sortAsc }}</option>
|
|
4381
|
+
<option value="desc" [selected]="query().orderBy?.[0]?.dir === 'desc'">{{ s.sortDesc }}</option>
|
|
4382
|
+
</select>
|
|
4383
|
+
</label>
|
|
4384
|
+
<label>
|
|
4385
|
+
<span>{{ s.maxRows }}</span>
|
|
4386
|
+
<input type="number" min="1" [value]="query().limit ?? ''" (input)="setLimit($any($event.target).value)" />
|
|
4387
|
+
</label>
|
|
4388
|
+
</div>
|
|
4389
|
+
}
|
|
4390
|
+
}
|
|
4391
|
+
|
|
4392
|
+
@if (src.connectionId && (src.sql !== undefined || query().table)) {
|
|
4393
|
+
<div class="dbe__row">
|
|
4394
|
+
<button type="button" class="dbe__primary" (click)="test()" [disabled]="testing()">{{ testing() ? s.testing : s.test }}</button>
|
|
4395
|
+
</div>
|
|
4396
|
+
@if (testResult(); as r) {
|
|
4397
|
+
<p [class.dbe__ok]="r.ok" [class.dbe__error]="!r.ok">{{ r.message }}</p>
|
|
4398
|
+
}
|
|
4399
|
+
}
|
|
2632
4400
|
`, styles: [":host{display:flex;flex-direction:column;gap:10px}label{display:flex;flex-direction:column;gap:4px}label>span,.dbe__label{font-weight:500}.dbe__row{display:flex;gap:6px;align-items:flex-end;margin-bottom:4px}.dbe__grow{flex:1}.dbe__op{width:110px}.dbe__source{width:140px}.dbe__columns{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:4px}.dbe__check{flex-direction:row;align-items:center;gap:6px;font-weight:400}input:not([type=checkbox]),select,textarea,button{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;min-width:0}input:focus,select:focus,textarea:focus,button:focus-visible{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}button{cursor:pointer;font-weight:500}button:disabled{opacity:.4;cursor:default}.dbe__primary{padding:6px 14px;background:var(--we-report-accent, #007aff);color:var(--we-report-accent-fg, #fff)}.dbe__link{padding:0;background:none;color:var(--we-report-accent, #007aff)}.dbe__hint{font-size:11px;color:var(--we-report-muted-fg, rgba(60, 60, 67, .62))}.dbe__ok,.dbe__error{margin:0;padding:8px 12px;border-radius:10px;font-size:12px}.dbe__ok{background:var(--we-report-selection-fill, rgba(0, 122, 255, .07));color:var(--we-report-accent, #007aff)}.dbe__error{background:var(--we-report-warning-bg, rgba(255, 149, 0, .12));color:var(--we-report-warning-fg, #b25000)}\n"] }]
|
|
2633
4401
|
}], ctorParameters: () => [] });
|
|
2634
4402
|
|
|
@@ -2885,11 +4653,11 @@ class DataSourcesDialogComponent {
|
|
|
2885
4653
|
return `source${n}`;
|
|
2886
4654
|
}
|
|
2887
4655
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataSourcesDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2888
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DataSourcesDialogComponent, isStandalone: true, selector: "we-report-data-sources-dialog", inputs: { strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, fetchFn: { classPropertyName: "fetchFn", publicName: "fetchFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: "@let s = strings();\r\n<div class=\"dsd__backdrop\" (click)=\"closed.emit()\"></div>\r\n<div class=\"dsd\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"s.dataSources\">\r\n <header class=\"dsd__head\">\r\n <h2>{{ s.dataSources }}</h2>\r\n <button type=\"button\" class=\"dsd__close\" (click)=\"closed.emit()\" [attr.aria-label]=\"s.close\">\u00D7</button>\r\n </header>\r\n\r\n <div class=\"dsd__body\">\r\n <nav class=\"dsd__list\">\r\n @for (src of report().dataSources; track src.id) {\r\n <button type=\"button\" class=\"dsd__item\" [class.dsd__item--on]=\"src.id === source()?.id\" (click)=\"select(src.id)\">\r\n <span>{{ src.name }}</span>\r\n <small>{{ kindLabel(src) }}@if (report().dataMember?.dataSourceId === src.id) { \u00B7 {{ s.rowsSource }} }</small>\r\n </button>\r\n } @empty {\r\n <p class=\"dsd__hint\">{{ s.noSources }}</p>\r\n }\r\n <div class=\"dsd__add\">\r\n <button type=\"button\" (click)=\"add('json')\">+ JSON</button>\r\n <button type=\"button\" (click)=\"add('csv')\">+ CSV / Excel</button>\r\n <button type=\"button\" (click)=\"add('webService')\">+ {{ s.webService }}</button>\r\n <button type=\"button\" (click)=\"add('database')\">+ {{ s.database }}</button>\r\n </div>\r\n\r\n <h3>{{ s.parameters }}</h3>\r\n <p class=\"dsd__hint\">{{ s.parametersHint }}</p>\r\n @for (p of report().parameters ?? []; track $index; let i = $index) {\r\n <div class=\"dsd__param\">\r\n <input [value]=\"p.name\" (input)=\"setParameter(i, 'name', $any($event.target).value)\" [attr.aria-label]=\"s.parameterName\" spellcheck=\"false\" />\r\n <select (change)=\"setParameter(i, 'type', $any($event.target).value)\" [attr.aria-label]=\"s.parameterType\">\r\n @for (t of types; track t) {\r\n <option [value]=\"t\" [selected]=\"t === p.type\">{{ typeLabel(t) }}</option>\r\n }\r\n </select>\r\n <input [value]=\"p.label ?? ''\" (input)=\"setParameter(i, 'label', $any($event.target).value)\" [placeholder]=\"s.parameterLabel\" />\r\n <input [value]=\"p.defaultValue ?? ''\" (input)=\"setParameter(i, 'defaultValue', $any($event.target).value)\" [placeholder]=\"s.defaultValue\" />\r\n <button type=\"button\" class=\"dsd__icon\" (click)=\"removeParameter(i)\" [attr.aria-label]=\"s.delete\">\u00D7</button>\r\n <code class=\"dsd__use\">[?{{ p.name }}] \u00B7 {{ '{{' }}{{ p.name }}{{ '}}' }}</code>\r\n </div>\r\n }\r\n <button type=\"button\" class=\"dsd__link\" (click)=\"addParameter()\">+ {{ s.addParameter }}</button>\r\n </nav>\r\n\r\n <section class=\"dsd__editor\">\r\n @if (source(); as src) {\r\n <label class=\"dsd__field\">\r\n <span>{{ s.sourceName }}</span>\r\n <input [value]=\"src.name\" (input)=\"setName($any($event.target).value)\" />\r\n </label>\r\n\r\n <div class=\"dsd__rows\">\r\n @if (isMain()) {\r\n <label class=\"dsd__field\">\r\n <span>{{ s.dataRows }}</span>\r\n <input list=\"dsd-paths\" [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" [placeholder]=\"s.wholeData\" />\r\n <datalist id=\"dsd-paths\">\r\n @for (p of listPaths(); track p) {\r\n <option [value]=\"p\"></option>\r\n }\r\n </datalist>\r\n <small class=\"dsd__hint\">{{ s.dataRowsHint }} \u00B7 {{ s.rowCount.replace('{0}', '' + rowCount()) }}</small>\r\n </label>\r\n } @else {\r\n <button type=\"button\" class=\"dsd__link\" (click)=\"useForRows()\">{{ s.useForRows }}</button>\r\n }\r\n </div>\r\n\r\n @switch (src.kind) {\r\n @case ('json') {\r\n <label class=\"dsd__field dsd__grow\">\r\n <span>{{ s.jsonData }}</span>\r\n <textarea spellcheck=\"false\" [value]=\"jsonText(src)\" (change)=\"setJson($any($event.target).value)\"></textarea>\r\n </label>\r\n @if (jsonError(); as err) {\r\n <p class=\"dsd__error\">{{ err }}</p>\r\n }\r\n }\r\n @case ('csv') {\r\n <label class=\"dsd__field dsd__grow\">\r\n <span>{{ s.csvData }}</span>\r\n <textarea spellcheck=\"false\" [value]=\"src.text\" (input)=\"setCsv($any($event.target).value)\"></textarea>\r\n <small class=\"dsd__hint\">{{ s.rowCount.replace('{0}', '' + csvRows(src)) }}</small>\r\n </label>\r\n }\r\n @case ('webService') {\r\n @let w = web(src)!;\r\n <div class=\"dsd__inline\">\r\n <select (change)=\"setWeb('method', $any($event.target).value)\" [attr.aria-label]=\"s.method\">\r\n <option value=\"GET\" [selected]=\"(w.method ?? 'GET') === 'GET'\">GET</option>\r\n <option value=\"POST\" [selected]=\"w.method === 'POST'\">POST</option>\r\n </select>\r\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{{ '}}' }}\" />\r\n <button type=\"button\" class=\"dsd__primary\" (click)=\"test()\" [disabled]=\"testing()\">{{ testing() ? s.testing : s.test }}</button>\r\n </div>\r\n @if (testResult(); as r) {\r\n <p [class.dsd__ok]=\"r.ok\" [class.dsd__error]=\"!r.ok\">{{ r.message }}</p>\r\n }\r\n <div class=\"dsd__field\">\r\n <span>{{ s.headers }}</span>\r\n @for (h of w.headers ?? []; track $index; let i = $index) {\r\n <div class=\"dsd__inline\">\r\n <input [value]=\"h.name\" (input)=\"setHeader(i, 'name', $any($event.target).value)\" placeholder=\"Authorization\" [attr.aria-label]=\"s.headerName\" />\r\n <input [value]=\"h.value\" (input)=\"setHeader(i, 'value', $any($event.target).value)\" placeholder=\"Bearer {{ '{{' }}token{{ '}}' }}\" [attr.aria-label]=\"s.headerValue\" />\r\n <button type=\"button\" class=\"dsd__icon\" (click)=\"removeHeader(i)\" [attr.aria-label]=\"s.delete\">\u00D7</button>\r\n </div>\r\n }\r\n <button type=\"button\" class=\"dsd__link\" (click)=\"addHeader()\">+ {{ s.addHeader }}</button>\r\n </div>\r\n @if (w.method === 'POST') {\r\n <label class=\"dsd__field\">\r\n <span>{{ s.requestBody }}</span>\r\n <textarea spellcheck=\"false\" rows=\"4\" [value]=\"w.body ?? ''\" (input)=\"setWeb('body', $any($event.target).value)\"></textarea>\r\n </label>\r\n }\r\n <label class=\"dsd__check\">\r\n <input type=\"checkbox\" [checked]=\"w.via === 'backend'\" (change)=\"setWeb('via', $any($event.target).checked ? 'backend' : '')\" />\r\n <span>{{ s.viaBackend }}<small class=\"dsd__hint\">{{ s.viaBackendHint }}</small></span>\r\n </label>\r\n <p class=\"dsd__warning\">{{ s.secretWarning }}</p>\r\n }\r\n @case ('database') {\r\n <we-report-database-source-editor\r\n [source]=\"db(src)!\"\r\n [parameters]=\"report().parameters ?? []\"\r\n [strings]=\"s\"\r\n [fetchFn]=\"fetchFn()\"\r\n (edit)=\"applyDbEdit($event)\"\r\n />\r\n }\r\n }\r\n <button type=\"button\" class=\"dsd__danger\" (click)=\"remove()\">{{ s.removeSource }}</button>\r\n } @else {\r\n <p class=\"dsd__hint\">{{ s.noSources }}</p>\r\n }\r\n </section>\r\n </div>\r\n</div>\r\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"], dependencies: [{ kind: "component", type: DatabaseSourceEditorComponent, selector: "we-report-database-source-editor", inputs: ["source", "parameters", "strings", "fetchFn"], outputs: ["edit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4656
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DataSourcesDialogComponent, isStandalone: true, selector: "we-report-data-sources-dialog", inputs: { strings: { classPropertyName: "strings", publicName: "strings", isSignal: true, isRequired: true, transformFunction: null }, fetchFn: { classPropertyName: "fetchFn", publicName: "fetchFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, 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"], dependencies: [{ kind: "component", type: DatabaseSourceEditorComponent, selector: "we-report-database-source-editor", inputs: ["source", "parameters", "strings", "fetchFn"], outputs: ["edit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2889
4657
|
}
|
|
2890
4658
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataSourcesDialogComponent, decorators: [{
|
|
2891
4659
|
type: Component,
|
|
2892
|
-
args: [{ selector: 'we-report-data-sources-dialog', standalone: true, imports: [DatabaseSourceEditorComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let s = strings();\r\n<div class=\"dsd__backdrop\" (click)=\"closed.emit()\"></div>\r\n<div class=\"dsd\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"s.dataSources\">\r\n <header class=\"dsd__head\">\r\n <h2>{{ s.dataSources }}</h2>\r\n <button type=\"button\" class=\"dsd__close\" (click)=\"closed.emit()\" [attr.aria-label]=\"s.close\">\u00D7</button>\r\n </header>\r\n\r\n <div class=\"dsd__body\">\r\n <nav class=\"dsd__list\">\r\n @for (src of report().dataSources; track src.id) {\r\n <button type=\"button\" class=\"dsd__item\" [class.dsd__item--on]=\"src.id === source()?.id\" (click)=\"select(src.id)\">\r\n <span>{{ src.name }}</span>\r\n <small>{{ kindLabel(src) }}@if (report().dataMember?.dataSourceId === src.id) { \u00B7 {{ s.rowsSource }} }</small>\r\n </button>\r\n } @empty {\r\n <p class=\"dsd__hint\">{{ s.noSources }}</p>\r\n }\r\n <div class=\"dsd__add\">\r\n <button type=\"button\" (click)=\"add('json')\">+ JSON</button>\r\n <button type=\"button\" (click)=\"add('csv')\">+ CSV / Excel</button>\r\n <button type=\"button\" (click)=\"add('webService')\">+ {{ s.webService }}</button>\r\n <button type=\"button\" (click)=\"add('database')\">+ {{ s.database }}</button>\r\n </div>\r\n\r\n <h3>{{ s.parameters }}</h3>\r\n <p class=\"dsd__hint\">{{ s.parametersHint }}</p>\r\n @for (p of report().parameters ?? []; track $index; let i = $index) {\r\n <div class=\"dsd__param\">\r\n <input [value]=\"p.name\" (input)=\"setParameter(i, 'name', $any($event.target).value)\" [attr.aria-label]=\"s.parameterName\" spellcheck=\"false\" />\r\n <select (change)=\"setParameter(i, 'type', $any($event.target).value)\" [attr.aria-label]=\"s.parameterType\">\r\n @for (t of types; track t) {\r\n <option [value]=\"t\" [selected]=\"t === p.type\">{{ typeLabel(t) }}</option>\r\n }\r\n </select>\r\n <input [value]=\"p.label ?? ''\" (input)=\"setParameter(i, 'label', $any($event.target).value)\" [placeholder]=\"s.parameterLabel\" />\r\n <input [value]=\"p.defaultValue ?? ''\" (input)=\"setParameter(i, 'defaultValue', $any($event.target).value)\" [placeholder]=\"s.defaultValue\" />\r\n <button type=\"button\" class=\"dsd__icon\" (click)=\"removeParameter(i)\" [attr.aria-label]=\"s.delete\">\u00D7</button>\r\n <code class=\"dsd__use\">[?{{ p.name }}] \u00B7 {{ '{{' }}{{ p.name }}{{ '}}' }}</code>\r\n </div>\r\n }\r\n <button type=\"button\" class=\"dsd__link\" (click)=\"addParameter()\">+ {{ s.addParameter }}</button>\r\n </nav>\r\n\r\n <section class=\"dsd__editor\">\r\n @if (source(); as src) {\r\n <label class=\"dsd__field\">\r\n <span>{{ s.sourceName }}</span>\r\n <input [value]=\"src.name\" (input)=\"setName($any($event.target).value)\" />\r\n </label>\r\n\r\n <div class=\"dsd__rows\">\r\n @if (isMain()) {\r\n <label class=\"dsd__field\">\r\n <span>{{ s.dataRows }}</span>\r\n <input list=\"dsd-paths\" [value]=\"report().dataMember?.path ?? ''\" (input)=\"setRowsPath($any($event.target).value)\" spellcheck=\"false\" [placeholder]=\"s.wholeData\" />\r\n <datalist id=\"dsd-paths\">\r\n @for (p of listPaths(); track p) {\r\n <option [value]=\"p\"></option>\r\n }\r\n </datalist>\r\n <small class=\"dsd__hint\">{{ s.dataRowsHint }} \u00B7 {{ s.rowCount.replace('{0}', '' + rowCount()) }}</small>\r\n </label>\r\n } @else {\r\n <button type=\"button\" class=\"dsd__link\" (click)=\"useForRows()\">{{ s.useForRows }}</button>\r\n }\r\n </div>\r\n\r\n @switch (src.kind) {\r\n @case ('json') {\r\n <label class=\"dsd__field dsd__grow\">\r\n <span>{{ s.jsonData }}</span>\r\n <textarea spellcheck=\"false\" [value]=\"jsonText(src)\" (change)=\"setJson($any($event.target).value)\"></textarea>\r\n </label>\r\n @if (jsonError(); as err) {\r\n <p class=\"dsd__error\">{{ err }}</p>\r\n }\r\n }\r\n @case ('csv') {\r\n <label class=\"dsd__field dsd__grow\">\r\n <span>{{ s.csvData }}</span>\r\n <textarea spellcheck=\"false\" [value]=\"src.text\" (input)=\"setCsv($any($event.target).value)\"></textarea>\r\n <small class=\"dsd__hint\">{{ s.rowCount.replace('{0}', '' + csvRows(src)) }}</small>\r\n </label>\r\n }\r\n @case ('webService') {\r\n @let w = web(src)!;\r\n <div class=\"dsd__inline\">\r\n <select (change)=\"setWeb('method', $any($event.target).value)\" [attr.aria-label]=\"s.method\">\r\n <option value=\"GET\" [selected]=\"(w.method ?? 'GET') === 'GET'\">GET</option>\r\n <option value=\"POST\" [selected]=\"w.method === 'POST'\">POST</option>\r\n </select>\r\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{{ '}}' }}\" />\r\n <button type=\"button\" class=\"dsd__primary\" (click)=\"test()\" [disabled]=\"testing()\">{{ testing() ? s.testing : s.test }}</button>\r\n </div>\r\n @if (testResult(); as r) {\r\n <p [class.dsd__ok]=\"r.ok\" [class.dsd__error]=\"!r.ok\">{{ r.message }}</p>\r\n }\r\n <div class=\"dsd__field\">\r\n <span>{{ s.headers }}</span>\r\n @for (h of w.headers ?? []; track $index; let i = $index) {\r\n <div class=\"dsd__inline\">\r\n <input [value]=\"h.name\" (input)=\"setHeader(i, 'name', $any($event.target).value)\" placeholder=\"Authorization\" [attr.aria-label]=\"s.headerName\" />\r\n <input [value]=\"h.value\" (input)=\"setHeader(i, 'value', $any($event.target).value)\" placeholder=\"Bearer {{ '{{' }}token{{ '}}' }}\" [attr.aria-label]=\"s.headerValue\" />\r\n <button type=\"button\" class=\"dsd__icon\" (click)=\"removeHeader(i)\" [attr.aria-label]=\"s.delete\">\u00D7</button>\r\n </div>\r\n }\r\n <button type=\"button\" class=\"dsd__link\" (click)=\"addHeader()\">+ {{ s.addHeader }}</button>\r\n </div>\r\n @if (w.method === 'POST') {\r\n <label class=\"dsd__field\">\r\n <span>{{ s.requestBody }}</span>\r\n <textarea spellcheck=\"false\" rows=\"4\" [value]=\"w.body ?? ''\" (input)=\"setWeb('body', $any($event.target).value)\"></textarea>\r\n </label>\r\n }\r\n <label class=\"dsd__check\">\r\n <input type=\"checkbox\" [checked]=\"w.via === 'backend'\" (change)=\"setWeb('via', $any($event.target).checked ? 'backend' : '')\" />\r\n <span>{{ s.viaBackend }}<small class=\"dsd__hint\">{{ s.viaBackendHint }}</small></span>\r\n </label>\r\n <p class=\"dsd__warning\">{{ s.secretWarning }}</p>\r\n }\r\n @case ('database') {\r\n <we-report-database-source-editor\r\n [source]=\"db(src)!\"\r\n [parameters]=\"report().parameters ?? []\"\r\n [strings]=\"s\"\r\n [fetchFn]=\"fetchFn()\"\r\n (edit)=\"applyDbEdit($event)\"\r\n />\r\n }\r\n }\r\n <button type=\"button\" class=\"dsd__danger\" (click)=\"remove()\">{{ s.removeSource }}</button>\r\n } @else {\r\n <p class=\"dsd__hint\">{{ s.noSources }}</p>\r\n }\r\n </section>\r\n </div>\r\n</div>\r\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"] }]
|
|
4660
|
+
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"] }]
|
|
2893
4661
|
}] });
|
|
2894
4662
|
|
|
2895
4663
|
const BAND_ORDER = {
|
|
@@ -2931,6 +4699,10 @@ class WeReportDesignerComponent {
|
|
|
2931
4699
|
bandMenuOpen = signal(false);
|
|
2932
4700
|
dataDialogOpen = signal(false);
|
|
2933
4701
|
problemsOpen = signal(false);
|
|
4702
|
+
leftTab = signal('add');
|
|
4703
|
+
/** Right-click menu: screen position and the band it was opened on. */
|
|
4704
|
+
contextMenu = signal(null);
|
|
4705
|
+
canvas = viewChild('canvas');
|
|
2934
4706
|
/** Design problems, checked on every edit; field names are judged only when there is data. */
|
|
2935
4707
|
issues = computed(() => {
|
|
2936
4708
|
const { rows, parent } = this.fields();
|
|
@@ -2939,19 +4711,7 @@ class WeReportDesignerComponent {
|
|
|
2939
4711
|
});
|
|
2940
4712
|
/** Show the first data row inside bound controls instead of their formulas. */
|
|
2941
4713
|
showData = signal(true);
|
|
2942
|
-
sample = computed(() =>
|
|
2943
|
-
if (!this.showData())
|
|
2944
|
-
return null;
|
|
2945
|
-
try {
|
|
2946
|
-
const { rows, parent } = resolveReportData(this.state.report(), this.data());
|
|
2947
|
-
if (!rows?.length && parent === undefined)
|
|
2948
|
-
return null;
|
|
2949
|
-
return { row: rows?.[0], rows: rows ?? [], parent };
|
|
2950
|
-
}
|
|
2951
|
-
catch {
|
|
2952
|
-
return null;
|
|
2953
|
-
}
|
|
2954
|
-
});
|
|
4714
|
+
sample = computed(() => (this.showData() ? this.state.sample() : null));
|
|
2955
4715
|
fields = computed(() => designerFields(this.state.report(), this.data()));
|
|
2956
4716
|
allFields = computed(() => [...this.fields().rows, ...this.fields().parent]);
|
|
2957
4717
|
addableBands = computed(() => {
|
|
@@ -2975,11 +4735,86 @@ class WeReportDesignerComponent {
|
|
|
2975
4735
|
});
|
|
2976
4736
|
}, { allowSignalWrites: true });
|
|
2977
4737
|
effect(() => this.zoomLevel.set(this.zoom()), { allowSignalWrites: true });
|
|
4738
|
+
// The formula editor reads the sample even when "Show data" is off.
|
|
4739
|
+
effect(() => {
|
|
4740
|
+
let sample = null;
|
|
4741
|
+
try {
|
|
4742
|
+
const { rows, parent } = resolveReportData(this.state.report(), this.data());
|
|
4743
|
+
if (rows?.length || parent !== undefined)
|
|
4744
|
+
sample = { row: rows?.[0], rows: rows ?? [], parent };
|
|
4745
|
+
}
|
|
4746
|
+
catch {
|
|
4747
|
+
sample = null;
|
|
4748
|
+
}
|
|
4749
|
+
this.state.sample.set(sample);
|
|
4750
|
+
}, { allowSignalWrites: true });
|
|
2978
4751
|
this.fontsService
|
|
2979
4752
|
.ready()
|
|
2980
4753
|
.then((r) => this.fontFamilies.set(r.familyNames()))
|
|
2981
4754
|
.catch(() => undefined);
|
|
2982
4755
|
}
|
|
4756
|
+
/** Short label of a control for the outline: its name, its text or formula, else its type. */
|
|
4757
|
+
outlineLabel(c) {
|
|
4758
|
+
if (c.name)
|
|
4759
|
+
return c.name;
|
|
4760
|
+
if (c.type === 'text')
|
|
4761
|
+
return isExpression(c.text) ? c.text.expression : c.text || this.strings().controlNames.text;
|
|
4762
|
+
if (c.type === 'barcode')
|
|
4763
|
+
return `${c.symbology}: ${isExpression(c.value) ? c.value.expression : c.value}`;
|
|
4764
|
+
return this.strings().controlNames[c.type];
|
|
4765
|
+
}
|
|
4766
|
+
outlineIcon(c) {
|
|
4767
|
+
if (c.type === 'shape')
|
|
4768
|
+
return c.shape === 'ellipse' ? 'ellipse' : 'rectangle';
|
|
4769
|
+
if (c.type === 'barcode')
|
|
4770
|
+
return c.symbology === 'qrcode' ? 'qrcode' : 'barcode';
|
|
4771
|
+
return c.type;
|
|
4772
|
+
}
|
|
4773
|
+
selectFromOutline(e, id) {
|
|
4774
|
+
this.state.select(id, e.shiftKey || e.ctrlKey || e.metaKey);
|
|
4775
|
+
}
|
|
4776
|
+
isSelected(id) {
|
|
4777
|
+
const sel = this.state.selection();
|
|
4778
|
+
return sel.kind === 'controls' && sel.ids.includes(id);
|
|
4779
|
+
}
|
|
4780
|
+
fitWidth() {
|
|
4781
|
+
const el = this.canvas()?.nativeElement;
|
|
4782
|
+
if (!el)
|
|
4783
|
+
return;
|
|
4784
|
+
const pagePx = (resolvePageGeometry(this.state.report().page).width * 96) / 25.4;
|
|
4785
|
+
// The surface keeps 24px on the left and 136px on the right for the section labels.
|
|
4786
|
+
this.setZoom(Math.floor(((el.clientWidth - 24 - 136 - 16) / pagePx) * 20) / 20);
|
|
4787
|
+
}
|
|
4788
|
+
onCanvasWheel(e) {
|
|
4789
|
+
if (!(e.ctrlKey || e.metaKey))
|
|
4790
|
+
return;
|
|
4791
|
+
e.preventDefault();
|
|
4792
|
+
this.setZoom(this.zoomLevel() + (e.deltaY < 0 ? 0.1 : -0.1));
|
|
4793
|
+
}
|
|
4794
|
+
openContextMenu(e) {
|
|
4795
|
+
const target = e.target;
|
|
4796
|
+
const bandEl = target.closest('[data-band-id]');
|
|
4797
|
+
if (!bandEl)
|
|
4798
|
+
return;
|
|
4799
|
+
e.preventDefault();
|
|
4800
|
+
const controlId = target.closest('[data-control-id]')?.dataset['controlId'];
|
|
4801
|
+
if (controlId)
|
|
4802
|
+
this.state.select(controlId, false);
|
|
4803
|
+
else
|
|
4804
|
+
this.state.selection.set({ kind: 'band', id: bandEl.dataset['bandId'] });
|
|
4805
|
+
this.contextMenu.set({ x: e.clientX, y: e.clientY, bandId: bandEl.dataset['bandId'] ?? null, onControl: !!controlId });
|
|
4806
|
+
}
|
|
4807
|
+
/** Runs a context-menu command and closes the menu. */
|
|
4808
|
+
menu(action) {
|
|
4809
|
+
this.contextMenu.set(null);
|
|
4810
|
+
action();
|
|
4811
|
+
}
|
|
4812
|
+
closeMenus(e) {
|
|
4813
|
+
if (!this.contextMenu())
|
|
4814
|
+
return;
|
|
4815
|
+
if (!e.target.closest('.wd__context'))
|
|
4816
|
+
this.contextMenu.set(null);
|
|
4817
|
+
}
|
|
2983
4818
|
iconName(name) {
|
|
2984
4819
|
return name;
|
|
2985
4820
|
}
|
|
@@ -3081,8 +4916,27 @@ class WeReportDesignerComponent {
|
|
|
3081
4916
|
this.state.deleteSelection();
|
|
3082
4917
|
}
|
|
3083
4918
|
}
|
|
4919
|
+
else if (mod && e.key.toLowerCase() === 'c' && !typing) {
|
|
4920
|
+
if (this.state.copySelection())
|
|
4921
|
+
e.preventDefault();
|
|
4922
|
+
}
|
|
4923
|
+
else if (mod && e.key.toLowerCase() === 'x' && !typing) {
|
|
4924
|
+
e.preventDefault();
|
|
4925
|
+
this.state.cutSelection();
|
|
4926
|
+
}
|
|
4927
|
+
else if (mod && e.key.toLowerCase() === 'v' && !typing && this.state.hasClipboard()) {
|
|
4928
|
+
e.preventDefault();
|
|
4929
|
+
this.state.paste();
|
|
4930
|
+
}
|
|
4931
|
+
else if (mod && e.key.toLowerCase() === 'a' && !typing) {
|
|
4932
|
+
e.preventDefault();
|
|
4933
|
+
this.state.selectAll();
|
|
4934
|
+
}
|
|
3084
4935
|
else if (e.key === 'Escape' && !typing) {
|
|
3085
|
-
this.
|
|
4936
|
+
if (this.contextMenu())
|
|
4937
|
+
this.contextMenu.set(null);
|
|
4938
|
+
else
|
|
4939
|
+
this.state.selection.set({ kind: 'none' });
|
|
3086
4940
|
}
|
|
3087
4941
|
else if (e.key.startsWith('Arrow') && !typing && this.state.selection().kind === 'controls') {
|
|
3088
4942
|
e.preventDefault();
|
|
@@ -3098,12 +4952,15 @@ class WeReportDesignerComponent {
|
|
|
3098
4952
|
}
|
|
3099
4953
|
}
|
|
3100
4954
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportDesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3101
|
-
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: { "keydown": "onKeydown($event)" } }, providers: [DesignerState], ngImport: i0, template: "@let s = strings();\r\n<div class=\"wd__toolbar\" role=\"toolbar\">\r\n <div class=\"wd__tabs\" role=\"tablist\">\r\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'design'\" [class.wd__tab--on]=\"tab() === 'design'\" (click)=\"tab.set('design')\">\r\n <span [innerHTML]=\"'design' | weReportIcon\"></span>{{ s.design }}\r\n </button>\r\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'preview'\" [class.wd__tab--on]=\"tab() === 'preview'\" (click)=\"tab.set('preview')\">\r\n <span [innerHTML]=\"'preview' | weReportIcon\"></span>{{ s.preview }}\r\n </button>\r\n </div>\r\n @if (tab() === 'design') {\r\n <span class=\"wd__sep\"></span>\r\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>\r\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>\r\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>\r\n <span class=\"wd__sep\"></span>\r\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() - 0.1)\" [title]=\"s.zoomOut\" [attr.aria-label]=\"s.zoomOut\" [innerHTML]=\"'zoomOut' | weReportIcon\"></button>\r\n <span class=\"wd__zoom\">{{ (zoomLevel() * 100).toFixed(0) }}%</span>\r\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() + 0.1)\" [title]=\"s.zoomIn\" [attr.aria-label]=\"s.zoomIn\" [innerHTML]=\"'zoomIn' | weReportIcon\"></button>\r\n <span class=\"wd__sep\"></span>\r\n <div class=\"wd__menu\">\r\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"bandMenuOpen.set(!bandMenuOpen())\" [attr.aria-expanded]=\"bandMenuOpen()\">+ {{ s.addBand }}</button>\r\n @if (bandMenuOpen()) {\r\n <div class=\"wd__menu-list\" role=\"menu\">\r\n @for (k of addableBands(); track k) {\r\n <button type=\"button\" role=\"menuitem\" (click)=\"addBand(k)\">{{ k === 'groupHeader' ? s.groupBy + '\u2026' : s.bandNames[k] }}</button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n @if (fields().rows.length) {\r\n <button type=\"button\" class=\"wd__text-btn wd__magic\" (click)=\"autoDesign()\" [title]=\"s.autoDesignHint\">\u2728 {{ s.autoDesign }}</button>\r\n }\r\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"dataDialogOpen.set(true)\">\r\n <span [innerHTML]=\"'database' | weReportIcon\"></span> {{ s.dataSources }}\r\n </button>\r\n <label class=\"wd__toggle\">\r\n <input type=\"checkbox\" [checked]=\"showData()\" (change)=\"showData.set($any($event.target).checked)\" />\r\n {{ s.showData }}\r\n </label>\r\n <span class=\"wd__spacer\"></span>\r\n <div class=\"wd__menu\">\r\n <button type=\"button\" class=\"wd__text-btn\" [class.wd__issues]=\"issues().length\" (click)=\"problemsOpen.set(!problemsOpen())\" [attr.aria-expanded]=\"problemsOpen()\">\r\n {{ issues().length ? '\u26A0 ' + issues().length : '\u2713' }} {{ s.problems }}\r\n </button>\r\n @if (problemsOpen()) {\r\n <div class=\"wd__menu-list wd__problems\" role=\"list\">\r\n @for (issue of issues(); track $index) {\r\n <div class=\"wd__problem\" role=\"listitem\">\r\n <button type=\"button\" class=\"wd__problem-text\" (click)=\"showIssue(issue)\">\r\n <code>{{ issue.controlId }}</code> {{ issueText(issue) }}\r\n </button>\r\n @if (issue.code === 'outsidePage') {\r\n <button type=\"button\" class=\"wd__fix\" (click)=\"fixIssue(issue)\">{{ s.fixIt }}</button>\r\n }\r\n </div>\r\n } @empty {\r\n <p class=\"wd__hint\">{{ s.noProblems }}</p>\r\n }\r\n </div>\r\n }\r\n </div>\r\n <div class=\"wd__mode\" role=\"radiogroup\">\r\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"!advanced()\" [class.wd__mode--on]=\"!advanced()\" (click)=\"advanced.set(false)\">{{ s.basicMode }}</button>\r\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"advanced()\" [class.wd__mode--on]=\"advanced()\" (click)=\"advanced.set(true)\">{{ s.advancedMode }}</button>\r\n </div>\r\n }\r\n</div>\r\n\r\n@if (tab() === 'design') {\r\n <div class=\"wd__body\">\r\n <aside class=\"wd__left\">\r\n <h2>{{ s.toolbox }}</h2>\r\n <p class=\"wd__hint\">{{ s.toolboxHint }}</p>\r\n <div class=\"wd__tools\">\r\n @for (item of toolbox; track $index) {\r\n <div class=\"wd__tool\" draggable=\"true\" (dragstart)=\"onToolDragStart($event, item)\" [title]=\"s.controlNames[item.type]\">\r\n <span [innerHTML]=\"iconName(item.icon) | weReportIcon\"></span>\r\n <span>{{ item.variant === 'qrcode' ? 'QR' : s.controlNames[item.type] }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <h2>{{ s.fields }}</h2>\r\n @if (fields().rows.length || fields().parent.length) {\r\n <p class=\"wd__hint\">{{ s.fieldsHint }}</p>\r\n <ul class=\"wd__fields\">\r\n @for (f of fields().rows; track f.path) {\r\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\r\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\r\n </li>\r\n }\r\n </ul>\r\n @if (fields().parent.length) {\r\n <h3>{{ s.parentFields }}</h3>\r\n <ul class=\"wd__fields\">\r\n @for (f of fields().parent; track f.path) {\r\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\r\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\r\n </li>\r\n }\r\n </ul>\r\n }\r\n } @else {\r\n <p class=\"wd__hint\">{{ s.noFields }}</p>\r\n }\r\n </aside>\r\n\r\n <main class=\"wd__canvas\" tabindex=\"-1\">\r\n <we-report-design-surface [strings]=\"s\" [zoom]=\"zoomLevel()\" [sample]=\"sample()\" />\r\n </main>\r\n\r\n <aside class=\"wd__right\">\r\n <we-report-property-panel [strings]=\"s\" [fields]=\"allFields()\" [fontFamilies]=\"fontFamilies()\" [advanced]=\"advanced()\" />\r\n </aside>\r\n </div>\r\n} @else {\r\n <we-report-viewer class=\"wd__preview\" [report]=\"state.report()\" [data]=\"data()\" [locale]=\"s\" [fetchFn]=\"fetchFn()\" />\r\n}\r\n\r\n@if (dataDialogOpen()) {\r\n <we-report-data-sources-dialog [strings]=\"s\" [fetchFn]=\"fetchFn()\" (closed)=\"dataDialogOpen.set(false)\" />\r\n}\r\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}\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"] }, { 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 });
|
|
4955
|
+
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().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()\" [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"] }, { 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 });
|
|
3102
4956
|
}
|
|
3103
4957
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WeReportDesignerComponent, decorators: [{
|
|
3104
4958
|
type: Component,
|
|
3105
|
-
args: [{ selector: 'we-report-designer', standalone: true, imports: [DesignSurfaceComponent, PropertyPanelComponent, WeReportViewerComponent, WeReportIconPipe, DataSourcesDialogComponent], providers: [DesignerState], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let s = strings();\r\n<div class=\"wd__toolbar\" role=\"toolbar\">\r\n <div class=\"wd__tabs\" role=\"tablist\">\r\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'design'\" [class.wd__tab--on]=\"tab() === 'design'\" (click)=\"tab.set('design')\">\r\n <span [innerHTML]=\"'design' | weReportIcon\"></span>{{ s.design }}\r\n </button>\r\n <button type=\"button\" role=\"tab\" [attr.aria-selected]=\"tab() === 'preview'\" [class.wd__tab--on]=\"tab() === 'preview'\" (click)=\"tab.set('preview')\">\r\n <span [innerHTML]=\"'preview' | weReportIcon\"></span>{{ s.preview }}\r\n </button>\r\n </div>\r\n @if (tab() === 'design') {\r\n <span class=\"wd__sep\"></span>\r\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>\r\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>\r\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>\r\n <span class=\"wd__sep\"></span>\r\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() - 0.1)\" [title]=\"s.zoomOut\" [attr.aria-label]=\"s.zoomOut\" [innerHTML]=\"'zoomOut' | weReportIcon\"></button>\r\n <span class=\"wd__zoom\">{{ (zoomLevel() * 100).toFixed(0) }}%</span>\r\n <button type=\"button\" class=\"wd__icon\" (click)=\"setZoom(zoomLevel() + 0.1)\" [title]=\"s.zoomIn\" [attr.aria-label]=\"s.zoomIn\" [innerHTML]=\"'zoomIn' | weReportIcon\"></button>\r\n <span class=\"wd__sep\"></span>\r\n <div class=\"wd__menu\">\r\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"bandMenuOpen.set(!bandMenuOpen())\" [attr.aria-expanded]=\"bandMenuOpen()\">+ {{ s.addBand }}</button>\r\n @if (bandMenuOpen()) {\r\n <div class=\"wd__menu-list\" role=\"menu\">\r\n @for (k of addableBands(); track k) {\r\n <button type=\"button\" role=\"menuitem\" (click)=\"addBand(k)\">{{ k === 'groupHeader' ? s.groupBy + '\u2026' : s.bandNames[k] }}</button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n @if (fields().rows.length) {\r\n <button type=\"button\" class=\"wd__text-btn wd__magic\" (click)=\"autoDesign()\" [title]=\"s.autoDesignHint\">\u2728 {{ s.autoDesign }}</button>\r\n }\r\n <button type=\"button\" class=\"wd__text-btn\" (click)=\"dataDialogOpen.set(true)\">\r\n <span [innerHTML]=\"'database' | weReportIcon\"></span> {{ s.dataSources }}\r\n </button>\r\n <label class=\"wd__toggle\">\r\n <input type=\"checkbox\" [checked]=\"showData()\" (change)=\"showData.set($any($event.target).checked)\" />\r\n {{ s.showData }}\r\n </label>\r\n <span class=\"wd__spacer\"></span>\r\n <div class=\"wd__menu\">\r\n <button type=\"button\" class=\"wd__text-btn\" [class.wd__issues]=\"issues().length\" (click)=\"problemsOpen.set(!problemsOpen())\" [attr.aria-expanded]=\"problemsOpen()\">\r\n {{ issues().length ? '\u26A0 ' + issues().length : '\u2713' }} {{ s.problems }}\r\n </button>\r\n @if (problemsOpen()) {\r\n <div class=\"wd__menu-list wd__problems\" role=\"list\">\r\n @for (issue of issues(); track $index) {\r\n <div class=\"wd__problem\" role=\"listitem\">\r\n <button type=\"button\" class=\"wd__problem-text\" (click)=\"showIssue(issue)\">\r\n <code>{{ issue.controlId }}</code> {{ issueText(issue) }}\r\n </button>\r\n @if (issue.code === 'outsidePage') {\r\n <button type=\"button\" class=\"wd__fix\" (click)=\"fixIssue(issue)\">{{ s.fixIt }}</button>\r\n }\r\n </div>\r\n } @empty {\r\n <p class=\"wd__hint\">{{ s.noProblems }}</p>\r\n }\r\n </div>\r\n }\r\n </div>\r\n <div class=\"wd__mode\" role=\"radiogroup\">\r\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"!advanced()\" [class.wd__mode--on]=\"!advanced()\" (click)=\"advanced.set(false)\">{{ s.basicMode }}</button>\r\n <button type=\"button\" role=\"radio\" [attr.aria-checked]=\"advanced()\" [class.wd__mode--on]=\"advanced()\" (click)=\"advanced.set(true)\">{{ s.advancedMode }}</button>\r\n </div>\r\n }\r\n</div>\r\n\r\n@if (tab() === 'design') {\r\n <div class=\"wd__body\">\r\n <aside class=\"wd__left\">\r\n <h2>{{ s.toolbox }}</h2>\r\n <p class=\"wd__hint\">{{ s.toolboxHint }}</p>\r\n <div class=\"wd__tools\">\r\n @for (item of toolbox; track $index) {\r\n <div class=\"wd__tool\" draggable=\"true\" (dragstart)=\"onToolDragStart($event, item)\" [title]=\"s.controlNames[item.type]\">\r\n <span [innerHTML]=\"iconName(item.icon) | weReportIcon\"></span>\r\n <span>{{ item.variant === 'qrcode' ? 'QR' : s.controlNames[item.type] }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <h2>{{ s.fields }}</h2>\r\n @if (fields().rows.length || fields().parent.length) {\r\n <p class=\"wd__hint\">{{ s.fieldsHint }}</p>\r\n <ul class=\"wd__fields\">\r\n @for (f of fields().rows; track f.path) {\r\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\r\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\r\n </li>\r\n }\r\n </ul>\r\n @if (fields().parent.length) {\r\n <h3>{{ s.parentFields }}</h3>\r\n <ul class=\"wd__fields\">\r\n @for (f of fields().parent; track f.path) {\r\n <li draggable=\"true\" (dragstart)=\"onFieldDragStart($event, f)\" [style.padding-left.px]=\"8 + f.depth * 12\" [attr.data-type]=\"f.type\">\r\n <span class=\"wd__field-type\">{{ f.type[0] }}</span>{{ f.label }}\r\n </li>\r\n }\r\n </ul>\r\n }\r\n } @else {\r\n <p class=\"wd__hint\">{{ s.noFields }}</p>\r\n }\r\n </aside>\r\n\r\n <main class=\"wd__canvas\" tabindex=\"-1\">\r\n <we-report-design-surface [strings]=\"s\" [zoom]=\"zoomLevel()\" [sample]=\"sample()\" />\r\n </main>\r\n\r\n <aside class=\"wd__right\">\r\n <we-report-property-panel [strings]=\"s\" [fields]=\"allFields()\" [fontFamilies]=\"fontFamilies()\" [advanced]=\"advanced()\" />\r\n </aside>\r\n </div>\r\n} @else {\r\n <we-report-viewer class=\"wd__preview\" [report]=\"state.report()\" [data]=\"data()\" [locale]=\"s\" [fetchFn]=\"fetchFn()\" />\r\n}\r\n\r\n@if (dataDialogOpen()) {\r\n <we-report-data-sources-dialog [strings]=\"s\" [fetchFn]=\"fetchFn()\" (closed)=\"dataDialogOpen.set(false)\" />\r\n}\r\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}\n"] }]
|
|
3106
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
4959
|
+
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().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()\" [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"] }]
|
|
4960
|
+
}], ctorParameters: () => [], propDecorators: { closeMenus: [{
|
|
4961
|
+
type: HostListener,
|
|
4962
|
+
args: ['document:pointerdown', ['$event']]
|
|
4963
|
+
}], onKeydown: [{
|
|
3107
4964
|
type: HostListener,
|
|
3108
4965
|
args: ['keydown', ['$event']]
|
|
3109
4966
|
}] } });
|
|
@@ -3116,5 +4973,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3116
4973
|
* Generated bundle index. Do not edit.
|
|
3117
4974
|
*/
|
|
3118
4975
|
|
|
3119
|
-
export { DEFAULT_FONTS_URL, DesignerState, WE_REPORT_CONFIG, WE_REPORT_DEFAULT_ICONS, WE_REPORT_ICONS, WE_REPORT_LOCALE, WeReportBackendService, WeReportDesignerComponent, WeReportFontsService, WeReportIconPipe, WeReportPageComponent, WeReportViewerComponent, defaultFontFamily, orderBands, provideWeReport, weReportLocaleEn, weReportLocaleTr };
|
|
4976
|
+
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 };
|
|
3120
4977
|
//# sourceMappingURL=we-report-angular.mjs.map
|