bways-report 0.2.2 → 0.2.3
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/README.md +4 -2
- package/esm2022/lib/core/services/designer-form-context.service.mjs +23 -0
- package/esm2022/lib/core/services/dynamic-form-builder.service.mjs +3 -2
- package/esm2022/lib/core/services/report-data-discovery.service.mjs +15 -6
- package/esm2022/lib/core/utils/report-form-values.util.mjs +25 -0
- package/esm2022/lib/core/utils/report-parameter.util.mjs +7 -3
- package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +20 -6
- package/esm2022/lib/features/designer/components/property-editor/parameter-binding-editor.component.mjs +43 -4
- package/esm2022/lib/features/designer/components/property-editor/property-editor-action.component.mjs +4 -2
- package/esm2022/lib/features/designer/components/property-editor/property-editor.component.mjs +8 -4
- package/esm2022/lib/features/designer/designer.component.mjs +4 -3
- package/esm2022/lib/primitives/components/date/rpt-calendar-input.component.mjs +102 -0
- package/esm2022/lib/primitives/components/date/rpt-date.component.mjs +12 -3
- package/esm2022/lib/primitives/components/dropdown/rpt-dropdown.component.mjs +21 -2
- package/esm2022/lib/primitives/components/radio/rpt-radio.component.mjs +3 -2
- package/fesm2022/bways-report.mjs +1196 -964
- package/fesm2022/bways-report.mjs.map +1 -1
- package/lib/core/services/designer-form-context.service.d.ts +14 -0
- package/lib/core/services/report-data-discovery.service.d.ts +1 -1
- package/lib/core/utils/report-form-values.util.d.ts +5 -0
- package/lib/core/utils/report-parameter.util.d.ts +1 -0
- package/lib/features/designer/components/design-canvas/design-canvas.component.d.ts +1 -0
- package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +5 -0
- package/lib/features/designer/components/property-editor/property-editor-action.component.d.ts +1 -0
- package/lib/features/designer/components/property-editor/property-editor.component.d.ts +1 -0
- package/lib/primitives/components/date/rpt-calendar-input.component.d.ts +23 -0
- package/lib/primitives/components/dropdown/rpt-dropdown.component.d.ts +2 -0
- package/package.json +1 -1
|
@@ -517,6 +517,172 @@ function getValidationMessage(definition, errorKey) {
|
|
|
517
517
|
return defaults[errorKey] ?? 'Invalid value';
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
+
/**
|
|
521
|
+
* Utility to normalize arbitrary backend HTTP responses into standard array of records.
|
|
522
|
+
*
|
|
523
|
+
* Supports:
|
|
524
|
+
* - Direct array payloads: `[ { ... }, { ... } ]`
|
|
525
|
+
* - Standard envelope wrappers: `{ data: [...] }`, `{ rows: [...] }`, `{ result: [...] }`, `{ items: [...] }`
|
|
526
|
+
* - OData envelopes: `{ value: [...] }`
|
|
527
|
+
* - Paginated wrappers: `{ total: 100, page: 1, data: [...] }`
|
|
528
|
+
*/
|
|
529
|
+
function extractRowArray(response) {
|
|
530
|
+
if (Array.isArray(response)) {
|
|
531
|
+
return response;
|
|
532
|
+
}
|
|
533
|
+
if (!response || typeof response !== 'object') {
|
|
534
|
+
return [];
|
|
535
|
+
}
|
|
536
|
+
const obj = response;
|
|
537
|
+
// Check common wrapper property names
|
|
538
|
+
const candidateKeys = ['data', 'rows', 'result', 'items', 'value', 'records', 'entities'];
|
|
539
|
+
for (const key of candidateKeys) {
|
|
540
|
+
const val = obj[key];
|
|
541
|
+
if (Array.isArray(val)) {
|
|
542
|
+
return val;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return [];
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Case-insensitive lookup in an object/record.
|
|
549
|
+
* Searches for exact match first, then lower-cased match, then normalized (ignoring underscores/dashes).
|
|
550
|
+
*/
|
|
551
|
+
function getFieldCaseInsensitive(record, targetKey) {
|
|
552
|
+
if (!record || typeof record !== 'object')
|
|
553
|
+
return undefined;
|
|
554
|
+
// 1. Exact match
|
|
555
|
+
if (targetKey in record) {
|
|
556
|
+
return record[targetKey];
|
|
557
|
+
}
|
|
558
|
+
// 2. Case-insensitive match
|
|
559
|
+
const targetLower = targetKey.toLowerCase();
|
|
560
|
+
for (const [k, v] of Object.entries(record)) {
|
|
561
|
+
if (k.toLowerCase() === targetLower) {
|
|
562
|
+
return v;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
// 3. Normalized match (strip leading '@', underscores, dashes)
|
|
566
|
+
const normalize = (s) => s.replace(/^@/, '').replace(/[_\-\s]/g, '').toLowerCase();
|
|
567
|
+
const normalizedTarget = normalize(targetKey);
|
|
568
|
+
for (const [k, v] of Object.entries(record)) {
|
|
569
|
+
if (normalize(k) === normalizedTarget) {
|
|
570
|
+
return v;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return undefined;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Normalizes an arbitrary database record into a standardized { value, label, raw } option item.
|
|
577
|
+
* Supports case-insensitive field matching and intelligent heuristics for SQL Server columns.
|
|
578
|
+
*/
|
|
579
|
+
function extractLookupOptionItem(row, valueField, displayField) {
|
|
580
|
+
if (!row || typeof row !== 'object') {
|
|
581
|
+
return {
|
|
582
|
+
value: row ?? '',
|
|
583
|
+
label: String(row ?? ''),
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
const rec = row;
|
|
587
|
+
// If row is already normalized (e.g. from backend lookup endpoint which returned { value, label })
|
|
588
|
+
// and user did not specify distinct target fields
|
|
589
|
+
if ('value' in rec &&
|
|
590
|
+
'label' in rec &&
|
|
591
|
+
(!valueField || valueField === 'value' || !getFieldCaseInsensitive(rec, valueField)) &&
|
|
592
|
+
(!displayField || displayField === 'label' || !getFieldCaseInsensitive(rec, displayField))) {
|
|
593
|
+
const v = rec['value'];
|
|
594
|
+
const result = {
|
|
595
|
+
value: typeof v === 'object' ? JSON.stringify(v) : v,
|
|
596
|
+
label: String(rec['label'] ?? rec['value'] ?? ''),
|
|
597
|
+
};
|
|
598
|
+
if ('raw' in rec && rec['raw']) {
|
|
599
|
+
result.raw = rec['raw'];
|
|
600
|
+
}
|
|
601
|
+
return result;
|
|
602
|
+
}
|
|
603
|
+
const keys = Object.keys(rec);
|
|
604
|
+
// 1. Resolve Value
|
|
605
|
+
let val = undefined;
|
|
606
|
+
if (valueField && valueField.trim()) {
|
|
607
|
+
val = getFieldCaseInsensitive(rec, valueField.trim());
|
|
608
|
+
}
|
|
609
|
+
if (val === undefined || val === null || val === '') {
|
|
610
|
+
const candidateValueKeys = ['code', 'id', 'key', 'value', 'val'];
|
|
611
|
+
for (const cand of candidateValueKeys) {
|
|
612
|
+
const v = getFieldCaseInsensitive(rec, cand);
|
|
613
|
+
if (v !== undefined && v !== null && v !== '') {
|
|
614
|
+
val = v;
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (val === undefined || val === null || val === '') {
|
|
620
|
+
const idKeys = keys.filter((k) => /(?:_code|_id|id|code)$/i.test(k));
|
|
621
|
+
const specificIdKey = idKeys.find((k) => !/^(?:user_?id|company_?id)$/i.test(k)) || idKeys[0];
|
|
622
|
+
if (specificIdKey) {
|
|
623
|
+
val = rec[specificIdKey];
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
if (val === undefined || val === null || val === '') {
|
|
627
|
+
const firstPrimitiveKey = keys.find((k) => typeof rec[k] === 'string' || typeof rec[k] === 'number');
|
|
628
|
+
val = firstPrimitiveKey ? rec[firstPrimitiveKey] : (keys[0] ? rec[keys[0]] : '');
|
|
629
|
+
}
|
|
630
|
+
// 2. Resolve Label / Display
|
|
631
|
+
let label = undefined;
|
|
632
|
+
if (displayField && displayField.trim()) {
|
|
633
|
+
label = getFieldCaseInsensitive(rec, displayField.trim());
|
|
634
|
+
}
|
|
635
|
+
if (label === undefined || label === null || label === '') {
|
|
636
|
+
const candidateDisplayKeys = ['name', 'title', 'label', 'description', 'desc', 'text', 'caption'];
|
|
637
|
+
for (const cand of candidateDisplayKeys) {
|
|
638
|
+
const l = getFieldCaseInsensitive(rec, cand);
|
|
639
|
+
if (l !== undefined && l !== null && l !== '') {
|
|
640
|
+
label = l;
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
if (label === undefined || label === null || label === '') {
|
|
646
|
+
const nameKey = keys.find((k) => /(?:_name|_title|_desc)$/i.test(k));
|
|
647
|
+
if (nameKey) {
|
|
648
|
+
label = rec[nameKey];
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
if (label === undefined || label === null || label === '') {
|
|
652
|
+
const secondPrimitiveKey = keys.find((k) => (typeof rec[k] === 'string' || typeof rec[k] === 'number') && rec[k] !== val);
|
|
653
|
+
label = secondPrimitiveKey ? rec[secondPrimitiveKey] : String(val ?? '');
|
|
654
|
+
}
|
|
655
|
+
return {
|
|
656
|
+
value: typeof val === 'object' ? JSON.stringify(val) : val,
|
|
657
|
+
label: String(label ?? val ?? ''),
|
|
658
|
+
raw: rec,
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
const selectedRows = new WeakMap();
|
|
663
|
+
const ROWS = Symbol('report selected dropdown rows');
|
|
664
|
+
function rememberSelectedOption(control, value, record) {
|
|
665
|
+
if (record)
|
|
666
|
+
selectedRows.set(control, { value, record });
|
|
667
|
+
else
|
|
668
|
+
selectedRows.delete(control);
|
|
669
|
+
}
|
|
670
|
+
/** Keep form values primitive. Selection metadata never becomes a wire argument. */
|
|
671
|
+
function extractReportFormValues(form) {
|
|
672
|
+
const values = form.getRawValue();
|
|
673
|
+
const rows = {};
|
|
674
|
+
for (const [key, control] of Object.entries(form.controls)) {
|
|
675
|
+
const selected = selectedRows.get(control);
|
|
676
|
+
if (selected && Object.is(selected.value, control.value))
|
|
677
|
+
Object.defineProperty(rows, key, { value: selected.record, enumerable: true });
|
|
678
|
+
}
|
|
679
|
+
Object.defineProperty(values, ROWS, { value: rows });
|
|
680
|
+
return values;
|
|
681
|
+
}
|
|
682
|
+
function selectedOptionRecord(values, field) {
|
|
683
|
+
return getFieldCaseInsensitive(values[ROWS], field);
|
|
684
|
+
}
|
|
685
|
+
|
|
520
686
|
/**
|
|
521
687
|
* DynamicFormBuilder converts metadata definitions into Angular Reactive Form controls.
|
|
522
688
|
*
|
|
@@ -558,7 +724,7 @@ class DynamicFormBuilder {
|
|
|
558
724
|
* @returns Key-value dictionary of all control values.
|
|
559
725
|
*/
|
|
560
726
|
extractValues(form) {
|
|
561
|
-
return form
|
|
727
|
+
return extractReportFormValues(form);
|
|
562
728
|
}
|
|
563
729
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DynamicFormBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
564
730
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DynamicFormBuilder, providedIn: 'root' });
|
|
@@ -1335,227 +1501,88 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1335
1501
|
args: [{ providedIn: 'root' }]
|
|
1336
1502
|
}] });
|
|
1337
1503
|
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1504
|
+
const TOKEN_RE = /^\{\{\s*(.+?)\s*\}\}$/;
|
|
1505
|
+
/** Supported wire formats for date-bound procedure/API parameters. */
|
|
1506
|
+
const PARAMETER_DATE_FORMATS = ['yyyy-MM-dd', 'yyyyMMdd', 'dd/MM/yyyy', 'MM/dd/yyyy', 'dd-MM-yyyy'];
|
|
1507
|
+
/** The optional date pipe is persisted in existing string mappings. */
|
|
1508
|
+
function parseParameterToken(raw) {
|
|
1509
|
+
const match = TOKEN_RE.exec(raw);
|
|
1510
|
+
if (!match)
|
|
1511
|
+
return null;
|
|
1512
|
+
const column = /^(.+?)\s*\|\s*column\s*:\s*(.+)$/.exec(match[1]);
|
|
1513
|
+
if (column)
|
|
1514
|
+
return { field: column[1].trim(), column: column[2].trim() };
|
|
1515
|
+
const parts = match[1].split(/\s*\|\s*date\s*:\s*/);
|
|
1516
|
+
if (parts.length === 1)
|
|
1517
|
+
return { field: parts[0].trim() };
|
|
1518
|
+
const format = parts[1];
|
|
1519
|
+
return { field: parts[0].trim(), dateFormat: parts.length === 2 ? format : parts.slice(1).join(' | date:') };
|
|
1520
|
+
}
|
|
1521
|
+
/** Format calendar parts directly, avoiding UTC/time-zone shifts and locale parsing. */
|
|
1522
|
+
function formatParameterDate(value, format) {
|
|
1523
|
+
if (!PARAMETER_DATE_FORMATS.includes(format))
|
|
1524
|
+
throw new Error('Unsupported parameter date format. Choose a date format in the Field binding.');
|
|
1525
|
+
if (value === '' || value === null || value === undefined)
|
|
1526
|
+
return '';
|
|
1527
|
+
const raw = value instanceof Date
|
|
1528
|
+
? value.getFullYear() + '-' + String(value.getMonth() + 1).padStart(2, '0') + '-' + String(value.getDate()).padStart(2, '0')
|
|
1529
|
+
: String(value);
|
|
1530
|
+
const match = /^(\d{4})-?(\d{2})-?(\d{2})(?:T.*)?$/.exec(raw);
|
|
1531
|
+
if (!match)
|
|
1532
|
+
throw new Error('Invalid date. Select a valid date in the linked field.');
|
|
1533
|
+
const [, year, month, day] = match;
|
|
1534
|
+
const probe = new Date(0);
|
|
1535
|
+
probe.setFullYear(+year, +month - 1, +day);
|
|
1536
|
+
probe.setHours(0, 0, 0, 0);
|
|
1537
|
+
if (probe.getFullYear() !== +year || probe.getMonth() + 1 !== +month || probe.getDate() !== +day) {
|
|
1538
|
+
throw new Error('Invalid date. Select a valid date in the linked field.');
|
|
1353
1539
|
}
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1540
|
+
return format.replace('yyyy', year).replace('MM', month).replace('dd', day);
|
|
1541
|
+
}
|
|
1542
|
+
const pad$1 = (n) => String(n).padStart(2, '0');
|
|
1543
|
+
const formatYMD$1 = (d) => `${d.getFullYear()}-${pad$1(d.getMonth() + 1)}-${pad$1(d.getDate())}`;
|
|
1544
|
+
/** Resolves `{{context.xxx}}` presets such as today / startOfMonth. */
|
|
1545
|
+
function resolveContextPreset(key) {
|
|
1546
|
+
const now = new Date();
|
|
1547
|
+
switch (key.toLowerCase()) {
|
|
1548
|
+
case 'yesterday': {
|
|
1549
|
+
const y = new Date(now);
|
|
1550
|
+
y.setDate(y.getDate() - 1);
|
|
1551
|
+
return formatYMD$1(y);
|
|
1361
1552
|
}
|
|
1553
|
+
case 'startofmonth':
|
|
1554
|
+
return `${now.getFullYear()}-${pad$1(now.getMonth() + 1)}-01`;
|
|
1555
|
+
case 'endofmonth':
|
|
1556
|
+
return formatYMD$1(new Date(now.getFullYear(), now.getMonth() + 1, 0));
|
|
1557
|
+
case 'startofyear':
|
|
1558
|
+
return `${now.getFullYear()}-01-01`;
|
|
1559
|
+
case 'today':
|
|
1560
|
+
default:
|
|
1561
|
+
return formatYMD$1(now);
|
|
1362
1562
|
}
|
|
1363
|
-
return [];
|
|
1364
1563
|
}
|
|
1365
1564
|
/**
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
1565
|
+
* Looks up a field value from formValues supporting direct names, dot paths (a.b),
|
|
1566
|
+
* and compound date ranges (e.g. dateRange.from, dateRange_from, dateRangeFrom).
|
|
1368
1567
|
*/
|
|
1369
|
-
function
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
return record[targetKey];
|
|
1568
|
+
function resolveCanvasFieldValue(formValues, inner) {
|
|
1569
|
+
// 1. Direct case-insensitive lookup
|
|
1570
|
+
const direct = getFieldCaseInsensitive(formValues, inner);
|
|
1571
|
+
if (direct !== undefined && direct !== null) {
|
|
1572
|
+
return direct;
|
|
1375
1573
|
}
|
|
1376
|
-
// 2.
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
return v;
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
return undefined;
|
|
1392
|
-
}
|
|
1393
|
-
/**
|
|
1394
|
-
* Normalizes an arbitrary database record into a standardized { value, label, raw } option item.
|
|
1395
|
-
* Supports case-insensitive field matching and intelligent heuristics for SQL Server columns.
|
|
1396
|
-
*/
|
|
1397
|
-
function extractLookupOptionItem(row, valueField, displayField) {
|
|
1398
|
-
if (!row || typeof row !== 'object') {
|
|
1399
|
-
return {
|
|
1400
|
-
value: row ?? '',
|
|
1401
|
-
label: String(row ?? ''),
|
|
1402
|
-
};
|
|
1403
|
-
}
|
|
1404
|
-
const rec = row;
|
|
1405
|
-
// If row is already normalized (e.g. from backend lookup endpoint which returned { value, label })
|
|
1406
|
-
// and user did not specify distinct target fields
|
|
1407
|
-
if ('value' in rec &&
|
|
1408
|
-
'label' in rec &&
|
|
1409
|
-
(!valueField || valueField === 'value' || !getFieldCaseInsensitive(rec, valueField)) &&
|
|
1410
|
-
(!displayField || displayField === 'label' || !getFieldCaseInsensitive(rec, displayField))) {
|
|
1411
|
-
const v = rec['value'];
|
|
1412
|
-
const result = {
|
|
1413
|
-
value: typeof v === 'object' ? JSON.stringify(v) : v,
|
|
1414
|
-
label: String(rec['label'] ?? rec['value'] ?? ''),
|
|
1415
|
-
};
|
|
1416
|
-
if ('raw' in rec && rec['raw']) {
|
|
1417
|
-
result.raw = rec['raw'];
|
|
1418
|
-
}
|
|
1419
|
-
return result;
|
|
1420
|
-
}
|
|
1421
|
-
const keys = Object.keys(rec);
|
|
1422
|
-
// 1. Resolve Value
|
|
1423
|
-
let val = undefined;
|
|
1424
|
-
if (valueField && valueField.trim()) {
|
|
1425
|
-
val = getFieldCaseInsensitive(rec, valueField.trim());
|
|
1426
|
-
}
|
|
1427
|
-
if (val === undefined || val === null || val === '') {
|
|
1428
|
-
const candidateValueKeys = ['code', 'id', 'key', 'value', 'val'];
|
|
1429
|
-
for (const cand of candidateValueKeys) {
|
|
1430
|
-
const v = getFieldCaseInsensitive(rec, cand);
|
|
1431
|
-
if (v !== undefined && v !== null && v !== '') {
|
|
1432
|
-
val = v;
|
|
1433
|
-
break;
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
if (val === undefined || val === null || val === '') {
|
|
1438
|
-
const idKeys = keys.filter((k) => /(?:_code|_id|id|code)$/i.test(k));
|
|
1439
|
-
const specificIdKey = idKeys.find((k) => !/^(?:user_?id|company_?id)$/i.test(k)) || idKeys[0];
|
|
1440
|
-
if (specificIdKey) {
|
|
1441
|
-
val = rec[specificIdKey];
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
if (val === undefined || val === null || val === '') {
|
|
1445
|
-
const firstPrimitiveKey = keys.find((k) => typeof rec[k] === 'string' || typeof rec[k] === 'number');
|
|
1446
|
-
val = firstPrimitiveKey ? rec[firstPrimitiveKey] : (keys[0] ? rec[keys[0]] : '');
|
|
1447
|
-
}
|
|
1448
|
-
// 2. Resolve Label / Display
|
|
1449
|
-
let label = undefined;
|
|
1450
|
-
if (displayField && displayField.trim()) {
|
|
1451
|
-
label = getFieldCaseInsensitive(rec, displayField.trim());
|
|
1452
|
-
}
|
|
1453
|
-
if (label === undefined || label === null || label === '') {
|
|
1454
|
-
const candidateDisplayKeys = ['name', 'title', 'label', 'description', 'desc', 'text', 'caption'];
|
|
1455
|
-
for (const cand of candidateDisplayKeys) {
|
|
1456
|
-
const l = getFieldCaseInsensitive(rec, cand);
|
|
1457
|
-
if (l !== undefined && l !== null && l !== '') {
|
|
1458
|
-
label = l;
|
|
1459
|
-
break;
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
if (label === undefined || label === null || label === '') {
|
|
1464
|
-
const nameKey = keys.find((k) => /(?:_name|_title|_desc)$/i.test(k));
|
|
1465
|
-
if (nameKey) {
|
|
1466
|
-
label = rec[nameKey];
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
if (label === undefined || label === null || label === '') {
|
|
1470
|
-
const secondPrimitiveKey = keys.find((k) => (typeof rec[k] === 'string' || typeof rec[k] === 'number') && rec[k] !== val);
|
|
1471
|
-
label = secondPrimitiveKey ? rec[secondPrimitiveKey] : String(val ?? '');
|
|
1472
|
-
}
|
|
1473
|
-
return {
|
|
1474
|
-
value: typeof val === 'object' ? JSON.stringify(val) : val,
|
|
1475
|
-
label: String(label ?? val ?? ''),
|
|
1476
|
-
raw: rec,
|
|
1477
|
-
};
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
const TOKEN_RE = /^\{\{\s*(.+?)\s*\}\}$/;
|
|
1481
|
-
/** Supported wire formats for date-bound procedure/API parameters. */
|
|
1482
|
-
const PARAMETER_DATE_FORMATS = ['yyyy-MM-dd', 'yyyyMMdd', 'dd/MM/yyyy', 'MM/dd/yyyy', 'dd-MM-yyyy'];
|
|
1483
|
-
/** The optional date pipe is persisted in existing string mappings. */
|
|
1484
|
-
function parseParameterToken(raw) {
|
|
1485
|
-
const match = TOKEN_RE.exec(raw);
|
|
1486
|
-
if (!match)
|
|
1487
|
-
return null;
|
|
1488
|
-
const parts = match[1].split(/\s*\|\s*date\s*:\s*/);
|
|
1489
|
-
if (parts.length === 1)
|
|
1490
|
-
return { field: parts[0].trim() };
|
|
1491
|
-
const format = parts[1];
|
|
1492
|
-
return { field: parts[0].trim(), dateFormat: parts.length === 2 ? format : parts.slice(1).join(' | date:') };
|
|
1493
|
-
}
|
|
1494
|
-
/** Format calendar parts directly, avoiding UTC/time-zone shifts and locale parsing. */
|
|
1495
|
-
function formatParameterDate(value, format) {
|
|
1496
|
-
if (!PARAMETER_DATE_FORMATS.includes(format))
|
|
1497
|
-
throw new Error('Unsupported parameter date format. Choose a date format in the Field binding.');
|
|
1498
|
-
if (value === '' || value === null || value === undefined)
|
|
1499
|
-
return '';
|
|
1500
|
-
const raw = value instanceof Date
|
|
1501
|
-
? value.getFullYear() + '-' + String(value.getMonth() + 1).padStart(2, '0') + '-' + String(value.getDate()).padStart(2, '0')
|
|
1502
|
-
: String(value);
|
|
1503
|
-
const match = /^(\d{4})-?(\d{2})-?(\d{2})(?:T.*)?$/.exec(raw);
|
|
1504
|
-
if (!match)
|
|
1505
|
-
throw new Error('Invalid date. Select a valid date in the linked field.');
|
|
1506
|
-
const [, year, month, day] = match;
|
|
1507
|
-
const probe = new Date(0);
|
|
1508
|
-
probe.setFullYear(+year, +month - 1, +day);
|
|
1509
|
-
probe.setHours(0, 0, 0, 0);
|
|
1510
|
-
if (probe.getFullYear() !== +year || probe.getMonth() + 1 !== +month || probe.getDate() !== +day) {
|
|
1511
|
-
throw new Error('Invalid date. Select a valid date in the linked field.');
|
|
1512
|
-
}
|
|
1513
|
-
return format.replace('yyyy', year).replace('MM', month).replace('dd', day);
|
|
1514
|
-
}
|
|
1515
|
-
const pad$1 = (n) => String(n).padStart(2, '0');
|
|
1516
|
-
const formatYMD$1 = (d) => `${d.getFullYear()}-${pad$1(d.getMonth() + 1)}-${pad$1(d.getDate())}`;
|
|
1517
|
-
/** Resolves `{{context.xxx}}` presets such as today / startOfMonth. */
|
|
1518
|
-
function resolveContextPreset(key) {
|
|
1519
|
-
const now = new Date();
|
|
1520
|
-
switch (key.toLowerCase()) {
|
|
1521
|
-
case 'yesterday': {
|
|
1522
|
-
const y = new Date(now);
|
|
1523
|
-
y.setDate(y.getDate() - 1);
|
|
1524
|
-
return formatYMD$1(y);
|
|
1525
|
-
}
|
|
1526
|
-
case 'startofmonth':
|
|
1527
|
-
return `${now.getFullYear()}-${pad$1(now.getMonth() + 1)}-01`;
|
|
1528
|
-
case 'endofmonth':
|
|
1529
|
-
return formatYMD$1(new Date(now.getFullYear(), now.getMonth() + 1, 0));
|
|
1530
|
-
case 'startofyear':
|
|
1531
|
-
return `${now.getFullYear()}-01-01`;
|
|
1532
|
-
case 'today':
|
|
1533
|
-
default:
|
|
1534
|
-
return formatYMD$1(now);
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
/**
|
|
1538
|
-
* Looks up a field value from formValues supporting direct names, dot paths (a.b),
|
|
1539
|
-
* and compound date ranges (e.g. dateRange.from, dateRange_from, dateRangeFrom).
|
|
1540
|
-
*/
|
|
1541
|
-
function resolveCanvasFieldValue(formValues, inner) {
|
|
1542
|
-
// 1. Direct case-insensitive lookup
|
|
1543
|
-
const direct = getFieldCaseInsensitive(formValues, inner);
|
|
1544
|
-
if (direct !== undefined && direct !== null) {
|
|
1545
|
-
return direct;
|
|
1546
|
-
}
|
|
1547
|
-
// 2. Dot-path lookup (e.g. dateRange.from or user.address.city)
|
|
1548
|
-
if (inner.includes('.')) {
|
|
1549
|
-
const parts = inner.split('.');
|
|
1550
|
-
let curr = formValues;
|
|
1551
|
-
for (const p of parts) {
|
|
1552
|
-
if (curr && typeof curr === 'object') {
|
|
1553
|
-
curr = getFieldCaseInsensitive(curr, p);
|
|
1554
|
-
}
|
|
1555
|
-
else {
|
|
1556
|
-
curr = undefined;
|
|
1557
|
-
break;
|
|
1558
|
-
}
|
|
1574
|
+
// 2. Dot-path lookup (e.g. dateRange.from or user.address.city)
|
|
1575
|
+
if (inner.includes('.')) {
|
|
1576
|
+
const parts = inner.split('.');
|
|
1577
|
+
let curr = formValues;
|
|
1578
|
+
for (const p of parts) {
|
|
1579
|
+
if (curr && typeof curr === 'object') {
|
|
1580
|
+
curr = getFieldCaseInsensitive(curr, p);
|
|
1581
|
+
}
|
|
1582
|
+
else {
|
|
1583
|
+
curr = undefined;
|
|
1584
|
+
break;
|
|
1585
|
+
}
|
|
1559
1586
|
}
|
|
1560
1587
|
if (curr !== undefined && curr !== null) {
|
|
1561
1588
|
return curr;
|
|
@@ -1727,7 +1754,7 @@ function resolveParameterValue(raw, session, formValues) {
|
|
|
1727
1754
|
if (inner.startsWith('context.')) {
|
|
1728
1755
|
return format(resolveContextPreset(inner.slice(8)));
|
|
1729
1756
|
}
|
|
1730
|
-
const v = resolveCanvasFieldValue(formValues, inner);
|
|
1757
|
+
const v = token.column ? getFieldCaseInsensitive(selectedOptionRecord(formValues, inner), token.column) : resolveCanvasFieldValue(formValues, inner);
|
|
1731
1758
|
return format(v !== undefined && v !== null ? v : '');
|
|
1732
1759
|
}
|
|
1733
1760
|
/** Replace a single mapping and remove all stale aliases for the same argument. */
|
|
@@ -1786,7 +1813,7 @@ function findMissingCanvasFields(mappings, formValues) {
|
|
|
1786
1813
|
const inner = token.field;
|
|
1787
1814
|
if (inner.startsWith('session.') || inner.startsWith('context.'))
|
|
1788
1815
|
continue;
|
|
1789
|
-
const v = resolveCanvasFieldValue(formValues, inner);
|
|
1816
|
+
const v = token.column ? getFieldCaseInsensitive(selectedOptionRecord(formValues, inner), token.column) : resolveCanvasFieldValue(formValues, inner);
|
|
1790
1817
|
if (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) {
|
|
1791
1818
|
missing.add(inner);
|
|
1792
1819
|
}
|
|
@@ -1883,7 +1910,7 @@ class ReportDataDiscoveryService {
|
|
|
1883
1910
|
* automatically runs dynamic sample query via ReportLookupAdapter using resolved parameters.
|
|
1884
1911
|
* 3. For REST APIs, executes a dynamic test sample and extracts columns from the result array.
|
|
1885
1912
|
*/
|
|
1886
|
-
autoDetectColumns(entityName, entityType = 'stored_procedure', mappings = {}, schema = 'dbo', apiOptions) {
|
|
1913
|
+
autoDetectColumns(entityName, entityType = 'stored_procedure', mappings = {}, schema = 'dbo', apiOptions, formValues = {}) {
|
|
1887
1914
|
if (!entityName) {
|
|
1888
1915
|
return of([]);
|
|
1889
1916
|
}
|
|
@@ -1900,7 +1927,7 @@ class ReportDataDiscoveryService {
|
|
|
1900
1927
|
throw new Error('STATIC_EMPTY');
|
|
1901
1928
|
}), catchError(() => {
|
|
1902
1929
|
// Fallback to dynamic execution
|
|
1903
|
-
return this.fallbackDynamicDetection(entityName, entityType, mappings, schema);
|
|
1930
|
+
return this.fallbackDynamicDetection(entityName, entityType, mappings, schema, formValues);
|
|
1904
1931
|
}));
|
|
1905
1932
|
}
|
|
1906
1933
|
return this.fallbackDynamicDetection(entityName, entityType, mappings, schema);
|
|
@@ -1980,12 +2007,21 @@ class ReportDataDiscoveryService {
|
|
|
1980
2007
|
align: c.dataType === 'number' ? 'right' : 'left',
|
|
1981
2008
|
}));
|
|
1982
2009
|
}
|
|
1983
|
-
fallbackDynamicDetection(entityName, sourceType, mappings, schema = 'dbo') {
|
|
2010
|
+
fallbackDynamicDetection(entityName, sourceType, mappings, schema = 'dbo', formValues = {}) {
|
|
1984
2011
|
if (!this.lookupAdapter) {
|
|
1985
2012
|
return of([]);
|
|
1986
2013
|
}
|
|
1987
2014
|
const session = this.sessionService?.getCurrentSessionContext() ?? {};
|
|
1988
|
-
const
|
|
2015
|
+
const missing = findMissingCanvasFields(mappings, formValues);
|
|
2016
|
+
if (missing.length)
|
|
2017
|
+
return throwError(() => new Error('Enter the linked filter values before detecting columns: ' + missing.join(', ')));
|
|
2018
|
+
let resolvedParams;
|
|
2019
|
+
try {
|
|
2020
|
+
resolvedParams = resolveParameterMappings(mappings, session, formValues);
|
|
2021
|
+
}
|
|
2022
|
+
catch (error) {
|
|
2023
|
+
return throwError(() => error);
|
|
2024
|
+
}
|
|
1989
2025
|
return this.lookupAdapter
|
|
1990
2026
|
.fetchOptions({
|
|
1991
2027
|
sourceType: (sourceType === 'stored_procedure' ? 'procedure' : sourceType),
|
|
@@ -3606,6 +3642,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3606
3642
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:4px;box-sizing:border-box}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-input-wrapper{position:relative;width:100%;flex:1;min-height:0;display:flex}.rpt-input{width:100%;height:100%;min-height:38px;box-sizing:border-box;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a);background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease;outline:none}.rpt-input:hover:not(:disabled){border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-input:focus{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-input:disabled{background-color:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);cursor:not-allowed}.rpt-input.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-input.rpt-invalid:focus{box-shadow:0 0 0 3px #ef444440}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"] }]
|
|
3607
3643
|
}] });
|
|
3608
3644
|
|
|
3645
|
+
/** Owned by one designer, including the property editor and its live canvas. */
|
|
3646
|
+
class DesignerFormContextService {
|
|
3647
|
+
form = signal(null);
|
|
3648
|
+
revision = signal(0);
|
|
3649
|
+
dropdownColumns = signal({});
|
|
3650
|
+
values = computed(() => { this.revision(); const form = this.form(); return form ? extractReportFormValues(form) : {}; });
|
|
3651
|
+
bind(form) { this.form.set(form); this.refresh(); }
|
|
3652
|
+
refresh() { this.revision.update(value => value + 1); }
|
|
3653
|
+
setColumns(key, columns) {
|
|
3654
|
+
const current = this.dropdownColumns()[key] ?? [];
|
|
3655
|
+
if (JSON.stringify(current) !== JSON.stringify(columns))
|
|
3656
|
+
this.dropdownColumns.update(value => ({ ...value, [key]: columns }));
|
|
3657
|
+
}
|
|
3658
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignerFormContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3659
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignerFormContextService });
|
|
3660
|
+
}
|
|
3661
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignerFormContextService, decorators: [{
|
|
3662
|
+
type: Injectable
|
|
3663
|
+
}] });
|
|
3664
|
+
|
|
3609
3665
|
/** CDK structural styles, embedded so standalone components need no host CSS import.
|
|
3610
3666
|
* Compatible with CDK's overlay-prebuilt.css; no theme or !important overrides.
|
|
3611
3667
|
* CDK structural CSS is MIT licensed; see third-party-notices/angular-cdk-LICENSE.txt.
|
|
@@ -3681,6 +3737,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3681
3737
|
}] });
|
|
3682
3738
|
|
|
3683
3739
|
class RptDropdownComponent {
|
|
3740
|
+
formContext = inject(DesignerFormContextService, { optional: true });
|
|
3684
3741
|
masterDataProvider = inject(MasterDataProvider, { optional: true });
|
|
3685
3742
|
lookupAdapter = inject(ReportLookupAdapter, { optional: true });
|
|
3686
3743
|
sessionService = inject(ReportSessionContextService, { optional: true });
|
|
@@ -3950,6 +4007,7 @@ class RptDropdownComponent {
|
|
|
3950
4007
|
this.formControl().markAsTouched();
|
|
3951
4008
|
}
|
|
3952
4009
|
selectOption(opt) {
|
|
4010
|
+
rememberSelectedOption(this.formControl(), opt.key, { value: opt.key, key: opt.key, label: opt.label, ...opt.raw });
|
|
3953
4011
|
this.currentValue.set(opt.key);
|
|
3954
4012
|
this.formControl().setValue(opt.key);
|
|
3955
4013
|
this.formControl().markAsDirty();
|
|
@@ -4051,6 +4109,21 @@ class RptDropdownComponent {
|
|
|
4051
4109
|
}
|
|
4052
4110
|
}
|
|
4053
4111
|
constructor() {
|
|
4112
|
+
effect(() => {
|
|
4113
|
+
const options = this.allOptions();
|
|
4114
|
+
const value = this.currentValue();
|
|
4115
|
+
const control = this.formControl();
|
|
4116
|
+
const config = this.config();
|
|
4117
|
+
untracked(() => {
|
|
4118
|
+
const selected = options.find(option => String(option.key) === String(value));
|
|
4119
|
+
rememberSelectedOption(control, value, selected ? { value: selected.key, key: selected.key, label: selected.label, ...selected.raw } : undefined);
|
|
4120
|
+
if (config.key) {
|
|
4121
|
+
const columns = [...new Set(options.flatMap(option => Object.keys(option.raw ?? {})))];
|
|
4122
|
+
this.formContext?.setColumns(config.key, columns);
|
|
4123
|
+
}
|
|
4124
|
+
this.formContext?.refresh();
|
|
4125
|
+
});
|
|
4126
|
+
}, { allowSignalWrites: true });
|
|
4054
4127
|
// Sync reactive form control value changes to currentValue signal
|
|
4055
4128
|
effect(() => {
|
|
4056
4129
|
const ctrl = this.formControl();
|
|
@@ -4163,7 +4236,7 @@ class RptDropdownComponent {
|
|
|
4163
4236
|
const k = String(it.value);
|
|
4164
4237
|
if (!seen.has(k)) {
|
|
4165
4238
|
seen.add(k);
|
|
4166
|
-
deduped.push({ key: it.value, label: it.label || k });
|
|
4239
|
+
deduped.push({ key: it.value, label: it.label || k, raw: it.raw });
|
|
4167
4240
|
}
|
|
4168
4241
|
}
|
|
4169
4242
|
this.dynamicOptions.set(deduped);
|
|
@@ -4218,739 +4291,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
4218
4291
|
args: ['document:keydown.escape']
|
|
4219
4292
|
}] } });
|
|
4220
4293
|
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
if (!errors)
|
|
4241
|
-
return '';
|
|
4242
|
-
const firstKey = Object.keys(errors)[0];
|
|
4243
|
-
return getValidationMessage(this.config().validation, firstKey);
|
|
4294
|
+
/**
|
|
4295
|
+
* Enterprise SVG Icon component for BWays-Report.
|
|
4296
|
+
* Provides crisp, scalable vector icons without external font dependencies.
|
|
4297
|
+
*/
|
|
4298
|
+
class RptIconComponent {
|
|
4299
|
+
/** Icon name (e.g. 'search', 'edit', 'save', 'kpi', 'chart-bar', 'trend-up') */
|
|
4300
|
+
name = input.required();
|
|
4301
|
+
/** Icon dimension in pixels. Defaults to 16. */
|
|
4302
|
+
size = input(16);
|
|
4303
|
+
/** Stroke/fill color. Defaults to 'currentColor'. */
|
|
4304
|
+
color = input('currentColor');
|
|
4305
|
+
/** Stroke width for line-based icons. Defaults to 2. */
|
|
4306
|
+
strokeWidth = input(2);
|
|
4307
|
+
viewBox = computed(() => '0 0 24 24');
|
|
4308
|
+
stroke = computed(() => 'currentColor');
|
|
4309
|
+
fill = computed(() => 'none');
|
|
4310
|
+
iconData = computed(() => {
|
|
4311
|
+
const n = this.name()?.toLowerCase().trim() || 'box';
|
|
4312
|
+
return ICON_REGISTRY[n] || ICON_REGISTRY['box'] || { paths: [] };
|
|
4244
4313
|
});
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
/>
|
|
4267
|
-
</div>
|
|
4268
|
-
|
|
4269
|
-
@if (errorMessage()) {
|
|
4270
|
-
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
4314
|
+
paths = computed(() => this.iconData().paths || []);
|
|
4315
|
+
circles = computed(() => this.iconData().circles || []);
|
|
4316
|
+
rects = computed(() => this.iconData().rects || []);
|
|
4317
|
+
lines = computed(() => this.iconData().lines || []);
|
|
4318
|
+
polylines = computed(() => this.iconData().polylines || []);
|
|
4319
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4320
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptIconComponent, isStandalone: true, selector: "rpt-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
4321
|
+
<svg
|
|
4322
|
+
class="rpt-svg-icon"
|
|
4323
|
+
[attr.width]="size()"
|
|
4324
|
+
[attr.height]="size()"
|
|
4325
|
+
[attr.viewBox]="viewBox()"
|
|
4326
|
+
[attr.stroke]="stroke()"
|
|
4327
|
+
[attr.fill]="fill()"
|
|
4328
|
+
[attr.stroke-width]="strokeWidth()"
|
|
4329
|
+
stroke-linecap="round"
|
|
4330
|
+
stroke-linejoin="round"
|
|
4331
|
+
[style.color]="color()"
|
|
4332
|
+
aria-hidden="true"
|
|
4333
|
+
>
|
|
4334
|
+
@for (d of paths(); track d) {
|
|
4335
|
+
<path [attr.d]="d" />
|
|
4271
4336
|
}
|
|
4272
|
-
|
|
4273
|
-
|
|
4337
|
+
@for (c of circles(); track c.cx + '-' + c.cy) {
|
|
4338
|
+
<circle [attr.cx]="c.cx" [attr.cy]="c.cy" [attr.r]="c.r" />
|
|
4339
|
+
}
|
|
4340
|
+
@for (r of rects(); track r.x + '-' + r.y) {
|
|
4341
|
+
<rect
|
|
4342
|
+
[attr.x]="r.x"
|
|
4343
|
+
[attr.y]="r.y"
|
|
4344
|
+
[attr.width]="r.width"
|
|
4345
|
+
[attr.height]="r.height"
|
|
4346
|
+
[attr.rx]="r.rx || 0"
|
|
4347
|
+
/>
|
|
4348
|
+
}
|
|
4349
|
+
@for (l of lines(); track l.x1 + '-' + l.y1) {
|
|
4350
|
+
<line
|
|
4351
|
+
[attr.x1]="l.x1"
|
|
4352
|
+
[attr.y1]="l.y1"
|
|
4353
|
+
[attr.x2]="l.x2"
|
|
4354
|
+
[attr.y2]="l.y2"
|
|
4355
|
+
/>
|
|
4356
|
+
}
|
|
4357
|
+
@for (p of polylines(); track p) {
|
|
4358
|
+
<polyline [attr.points]="p" />
|
|
4359
|
+
}
|
|
4360
|
+
</svg>
|
|
4361
|
+
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1}.rpt-svg-icon{display:inline-block;flex-shrink:0;color:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4274
4362
|
}
|
|
4275
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
4363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptIconComponent, decorators: [{
|
|
4276
4364
|
type: Component,
|
|
4277
|
-
args: [{ selector: 'rpt-
|
|
4278
|
-
<
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4365
|
+
args: [{ selector: 'rpt-icon', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4366
|
+
<svg
|
|
4367
|
+
class="rpt-svg-icon"
|
|
4368
|
+
[attr.width]="size()"
|
|
4369
|
+
[attr.height]="size()"
|
|
4370
|
+
[attr.viewBox]="viewBox()"
|
|
4371
|
+
[attr.stroke]="stroke()"
|
|
4372
|
+
[attr.fill]="fill()"
|
|
4373
|
+
[attr.stroke-width]="strokeWidth()"
|
|
4374
|
+
stroke-linecap="round"
|
|
4375
|
+
stroke-linejoin="round"
|
|
4376
|
+
[style.color]="color()"
|
|
4377
|
+
aria-hidden="true"
|
|
4378
|
+
>
|
|
4379
|
+
@for (d of paths(); track d) {
|
|
4380
|
+
<path [attr.d]="d" />
|
|
4286
4381
|
}
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
[
|
|
4293
|
-
[
|
|
4294
|
-
[
|
|
4295
|
-
[
|
|
4296
|
-
|
|
4382
|
+
@for (c of circles(); track c.cx + '-' + c.cy) {
|
|
4383
|
+
<circle [attr.cx]="c.cx" [attr.cy]="c.cy" [attr.r]="c.r" />
|
|
4384
|
+
}
|
|
4385
|
+
@for (r of rects(); track r.x + '-' + r.y) {
|
|
4386
|
+
<rect
|
|
4387
|
+
[attr.x]="r.x"
|
|
4388
|
+
[attr.y]="r.y"
|
|
4389
|
+
[attr.width]="r.width"
|
|
4390
|
+
[attr.height]="r.height"
|
|
4391
|
+
[attr.rx]="r.rx || 0"
|
|
4297
4392
|
/>
|
|
4298
|
-
</div>
|
|
4299
|
-
|
|
4300
|
-
@if (errorMessage()) {
|
|
4301
|
-
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
4302
4393
|
}
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
maxDate = computed(() => this.config().properties?.['maxDate'] || null);
|
|
4317
|
-
showPresets = computed(() => this.config().properties?.['showPresets'] !== false);
|
|
4318
|
-
presets = [
|
|
4319
|
-
{ id: 'today', label: 'Today' },
|
|
4320
|
-
{ id: 'yesterday', label: 'Yesterday' },
|
|
4321
|
-
{ id: 'thisWeek', label: 'This Week' },
|
|
4322
|
-
{ id: 'thisMonth', label: 'This Month' },
|
|
4323
|
-
{ id: 'lastMonth', label: 'Last Month' },
|
|
4324
|
-
{ id: 'thisQuarter', label: 'This Quarter' },
|
|
4325
|
-
{ id: 'ytd', label: 'YTD' },
|
|
4326
|
-
];
|
|
4327
|
-
fromDate = signal('');
|
|
4328
|
-
toDate = signal('');
|
|
4329
|
-
activePreset = signal('custom');
|
|
4330
|
-
hasValue = computed(() => !!(this.fromDate() || this.toDate()));
|
|
4331
|
-
rangeError = computed(() => {
|
|
4332
|
-
const f = this.fromDate();
|
|
4333
|
-
const t = this.toDate();
|
|
4334
|
-
if (f && t && f > t) {
|
|
4335
|
-
return `'From' date cannot be after 'To' date`;
|
|
4336
|
-
}
|
|
4337
|
-
return '';
|
|
4338
|
-
});
|
|
4339
|
-
isInvalid = computed(() => {
|
|
4340
|
-
const ctrl = this.formControl();
|
|
4341
|
-
return (ctrl.invalid && (ctrl.dirty || ctrl.touched)) || !!this.rangeError();
|
|
4342
|
-
});
|
|
4343
|
-
errorMessage = computed(() => {
|
|
4344
|
-
const ctrl = this.formControl();
|
|
4345
|
-
if (!ctrl.invalid || (!ctrl.dirty && !ctrl.touched)) {
|
|
4346
|
-
return '';
|
|
4347
|
-
}
|
|
4348
|
-
const errors = ctrl.errors;
|
|
4349
|
-
if (!errors)
|
|
4350
|
-
return '';
|
|
4351
|
-
const firstKey = Object.keys(errors)[0];
|
|
4352
|
-
return getValidationMessage(this.config().validation, firstKey);
|
|
4353
|
-
});
|
|
4354
|
-
controlSub;
|
|
4355
|
-
constructor() {
|
|
4356
|
-
effect(() => {
|
|
4357
|
-
const ctrl = this.formControl();
|
|
4358
|
-
untracked(() => this.syncControlValue(ctrl.value));
|
|
4359
|
-
this.controlSub?.unsubscribe();
|
|
4360
|
-
this.controlSub = ctrl.valueChanges.subscribe((v) => this.syncControlValue(v));
|
|
4361
|
-
}, { allowSignalWrites: true });
|
|
4362
|
-
}
|
|
4363
|
-
ngOnInit() {
|
|
4364
|
-
const defaultPreset = this.config().properties?.['defaultPreset'];
|
|
4365
|
-
if (defaultPreset && !this.formControl().value) {
|
|
4366
|
-
this.applyPreset(defaultPreset);
|
|
4367
|
-
}
|
|
4368
|
-
}
|
|
4369
|
-
ngOnDestroy() {
|
|
4370
|
-
this.controlSub?.unsubscribe();
|
|
4371
|
-
}
|
|
4372
|
-
syncControlValue(val) {
|
|
4373
|
-
if (val && typeof val === 'object' && 'from' in val) {
|
|
4374
|
-
const drv = val;
|
|
4375
|
-
this.fromDate.set(drv.from || '');
|
|
4376
|
-
this.toDate.set(drv.to || '');
|
|
4377
|
-
if (drv.preset) {
|
|
4378
|
-
this.activePreset.set(drv.preset);
|
|
4379
|
-
}
|
|
4380
|
-
}
|
|
4381
|
-
else if (typeof val === 'string' && val.includes(',')) {
|
|
4382
|
-
const [f, t] = val.split(',');
|
|
4383
|
-
this.fromDate.set(f?.trim() || '');
|
|
4384
|
-
this.toDate.set(t?.trim() || '');
|
|
4385
|
-
}
|
|
4386
|
-
else if (!val) {
|
|
4387
|
-
this.fromDate.set('');
|
|
4388
|
-
this.toDate.set('');
|
|
4389
|
-
this.activePreset.set('custom');
|
|
4390
|
-
}
|
|
4391
|
-
}
|
|
4392
|
-
applyPreset(presetId) {
|
|
4393
|
-
const now = new Date();
|
|
4394
|
-
let from = '';
|
|
4395
|
-
let to = '';
|
|
4396
|
-
switch (presetId) {
|
|
4397
|
-
case 'today':
|
|
4398
|
-
from = formatYMD(now);
|
|
4399
|
-
to = formatYMD(now);
|
|
4400
|
-
break;
|
|
4401
|
-
case 'yesterday': {
|
|
4402
|
-
const y = new Date(now);
|
|
4403
|
-
y.setDate(y.getDate() - 1);
|
|
4404
|
-
from = formatYMD(y);
|
|
4405
|
-
to = formatYMD(y);
|
|
4406
|
-
break;
|
|
4407
|
-
}
|
|
4408
|
-
case 'thisWeek': {
|
|
4409
|
-
const day = now.getDay();
|
|
4410
|
-
const diff = now.getDate() - day + (day === 0 ? -6 : 1); // Monday
|
|
4411
|
-
const monday = new Date(now);
|
|
4412
|
-
monday.setDate(diff);
|
|
4413
|
-
from = formatYMD(monday);
|
|
4414
|
-
to = formatYMD(now);
|
|
4415
|
-
break;
|
|
4416
|
-
}
|
|
4417
|
-
case 'thisMonth':
|
|
4418
|
-
from = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-01`;
|
|
4419
|
-
to = formatYMD(new Date(now.getFullYear(), now.getMonth() + 1, 0));
|
|
4420
|
-
break;
|
|
4421
|
-
case 'lastMonth': {
|
|
4422
|
-
const lastMonthEnd = new Date(now.getFullYear(), now.getMonth(), 0);
|
|
4423
|
-
from = `${lastMonthEnd.getFullYear()}-${pad(lastMonthEnd.getMonth() + 1)}-01`;
|
|
4424
|
-
to = formatYMD(lastMonthEnd);
|
|
4425
|
-
break;
|
|
4426
|
-
}
|
|
4427
|
-
case 'thisQuarter': {
|
|
4428
|
-
const currentQuarter = Math.floor(now.getMonth() / 3);
|
|
4429
|
-
const startMonth = currentQuarter * 3;
|
|
4430
|
-
const endMonth = startMonth + 2;
|
|
4431
|
-
from = `${now.getFullYear()}-${pad(startMonth + 1)}-01`;
|
|
4432
|
-
to = formatYMD(new Date(now.getFullYear(), endMonth + 1, 0));
|
|
4433
|
-
break;
|
|
4434
|
-
}
|
|
4435
|
-
case 'ytd':
|
|
4436
|
-
from = `${now.getFullYear()}-01-01`;
|
|
4437
|
-
to = formatYMD(now);
|
|
4438
|
-
break;
|
|
4439
|
-
default:
|
|
4440
|
-
return;
|
|
4441
|
-
}
|
|
4442
|
-
this.fromDate.set(from);
|
|
4443
|
-
this.toDate.set(to);
|
|
4444
|
-
this.activePreset.set(presetId);
|
|
4445
|
-
this.emitRangeChange({ from, to, preset: presetId });
|
|
4446
|
-
}
|
|
4447
|
-
onFromChange(event) {
|
|
4448
|
-
const from = event.target.value;
|
|
4449
|
-
this.fromDate.set(from);
|
|
4450
|
-
this.activePreset.set('custom');
|
|
4451
|
-
this.emitRangeChange({ from, to: this.toDate(), preset: 'custom' });
|
|
4452
|
-
}
|
|
4453
|
-
onToChange(event) {
|
|
4454
|
-
const to = event.target.value;
|
|
4455
|
-
this.toDate.set(to);
|
|
4456
|
-
this.activePreset.set('custom');
|
|
4457
|
-
this.emitRangeChange({ from: this.fromDate(), to, preset: 'custom' });
|
|
4458
|
-
}
|
|
4459
|
-
clearRange(event) {
|
|
4460
|
-
event.stopPropagation();
|
|
4461
|
-
this.fromDate.set('');
|
|
4462
|
-
this.toDate.set('');
|
|
4463
|
-
this.activePreset.set('custom');
|
|
4464
|
-
this.formControl().setValue(null);
|
|
4465
|
-
this.formControl().markAsDirty();
|
|
4466
|
-
this.formControl().markAsTouched();
|
|
4467
|
-
}
|
|
4468
|
-
emitRangeChange(range) {
|
|
4469
|
-
this.formControl().setValue(range);
|
|
4470
|
-
this.formControl().markAsDirty();
|
|
4471
|
-
this.formControl().markAsTouched();
|
|
4472
|
-
}
|
|
4473
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4474
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptDateRangeComponent, isStandalone: true, selector: "rpt-date-range", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
4475
|
-
<div class="rpt-field-group">
|
|
4476
|
-
<!-- Header with Label & Preset Bar -->
|
|
4477
|
-
<div class="rpt-label-row">
|
|
4478
|
-
@if (config().label) {
|
|
4479
|
-
<label [for]="elementId() + '_from'" class="rpt-label">
|
|
4480
|
-
{{ config().label }}
|
|
4481
|
-
@if (config().validation?.required) {
|
|
4482
|
-
<span class="rpt-required-marker">*</span>
|
|
4483
|
-
}
|
|
4484
|
-
</label>
|
|
4485
|
-
}
|
|
4486
|
-
|
|
4487
|
-
@if (showPresets()) {
|
|
4488
|
-
<div class="rpt-preset-pills" role="toolbar" aria-label="Date presets">
|
|
4489
|
-
@for (p of presets; track p.id) {
|
|
4490
|
-
<button
|
|
4491
|
-
type="button"
|
|
4492
|
-
class="rpt-preset-pill"
|
|
4493
|
-
[class.is-active]="activePreset() === p.id"
|
|
4494
|
-
[disabled]="formControl().disabled"
|
|
4495
|
-
(click)="applyPreset(p.id)"
|
|
4496
|
-
>
|
|
4497
|
-
{{ p.label }}
|
|
4498
|
-
</button>
|
|
4499
|
-
}
|
|
4500
|
-
</div>
|
|
4501
|
-
}
|
|
4502
|
-
</div>
|
|
4503
|
-
|
|
4504
|
-
<!-- Date Inputs Container -->
|
|
4505
|
-
<div class="rpt-date-range-container" [class.rpt-invalid]="isInvalid()">
|
|
4506
|
-
<!-- From Field -->
|
|
4507
|
-
<div class="rpt-date-subfield">
|
|
4508
|
-
<span class="rpt-date-prefix">From</span>
|
|
4509
|
-
<input
|
|
4510
|
-
[id]="elementId() + '_from'"
|
|
4511
|
-
type="date"
|
|
4512
|
-
class="rpt-date-input"
|
|
4513
|
-
[value]="fromDate()"
|
|
4514
|
-
[disabled]="formControl().disabled"
|
|
4515
|
-
[min]="minDate()"
|
|
4516
|
-
[max]="maxDate()"
|
|
4517
|
-
(input)="onFromChange($event)"
|
|
4518
|
-
/>
|
|
4519
|
-
</div>
|
|
4520
|
-
|
|
4521
|
-
<span class="rpt-range-separator" aria-hidden="true">→</span>
|
|
4522
|
-
|
|
4523
|
-
<!-- To Field -->
|
|
4524
|
-
<div class="rpt-date-subfield">
|
|
4525
|
-
<span class="rpt-date-prefix">To</span>
|
|
4526
|
-
<input
|
|
4527
|
-
[id]="elementId() + '_to'"
|
|
4528
|
-
type="date"
|
|
4529
|
-
class="rpt-date-input"
|
|
4530
|
-
[value]="toDate()"
|
|
4531
|
-
[disabled]="formControl().disabled"
|
|
4532
|
-
[min]="fromDate() || minDate()"
|
|
4533
|
-
[max]="maxDate()"
|
|
4534
|
-
(input)="onToChange($event)"
|
|
4535
|
-
/>
|
|
4536
|
-
</div>
|
|
4537
|
-
|
|
4538
|
-
<!-- Quick Clear Button -->
|
|
4539
|
-
@if (hasValue() && !formControl().disabled) {
|
|
4540
|
-
<button
|
|
4541
|
-
type="button"
|
|
4542
|
-
class="rpt-range-clear-btn"
|
|
4543
|
-
title="Clear date range"
|
|
4544
|
-
aria-label="Clear date range"
|
|
4545
|
-
(click)="clearRange($event)"
|
|
4546
|
-
>
|
|
4547
|
-
✕
|
|
4548
|
-
</button>
|
|
4549
|
-
}
|
|
4550
|
-
</div>
|
|
4551
|
-
|
|
4552
|
-
@if (rangeError()) {
|
|
4553
|
-
<span class="rpt-error-text">{{ rangeError() }}</span>
|
|
4554
|
-
} @else if (errorMessage()) {
|
|
4555
|
-
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
4556
|
-
}
|
|
4557
|
-
</div>
|
|
4558
|
-
`, isInline: true, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:5px;box-sizing:border-box}.rpt-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-preset-pills{display:inline-flex;align-items:center;gap:3px;flex-wrap:wrap}.rpt-preset-pill{border:1px solid var(--rpt-color-border, #cbd5e1);background:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);font-size:.6875rem;font-weight:500;padding:1px 7px;border-radius:12px;cursor:pointer;line-height:1.4;transition:all .12s ease}.rpt-preset-pill:hover:not(:disabled){border-color:var(--rpt-color-primary, #2563eb);color:var(--rpt-color-primary, #2563eb);background:#eff6ff}.rpt-preset-pill.is-active{background:var(--rpt-color-primary, #2563eb);border-color:var(--rpt-color-primary, #2563eb);color:#fff;font-weight:600}.rpt-preset-pill:disabled{cursor:not-allowed;opacity:.5}.rpt-date-range-container{display:flex;align-items:center;gap:8px;width:100%;flex:1;min-height:38px;box-sizing:border-box;padding:3px 8px;background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease}.rpt-date-range-container:focus-within{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-date-range-container.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-date-subfield{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.rpt-date-prefix{font-size:.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--rpt-color-text-muted, #94a3b8);-webkit-user-select:none;user-select:none}.rpt-date-input{width:100%;border:none;outline:none;background:transparent;font-size:var(--rpt-font-size-base, .84rem);font-family:inherit;color:var(--rpt-color-text, #0f172a);min-width:0;padding:4px 0}.rpt-date-input:disabled{color:var(--rpt-color-text-muted, #94a3b8);cursor:not-allowed}.rpt-range-separator{color:var(--rpt-color-text-muted, #94a3b8);font-size:.8125rem;-webkit-user-select:none;user-select:none;padding:0 2px}.rpt-range-clear-btn{border:none;background:#f1f5f9;color:var(--rpt-color-text-muted, #64748b);width:18px;height:18px;border-radius:50%;font-size:.6875rem;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;transition:background-color .15s ease,color .15s ease}.rpt-range-clear-btn:hover{background-color:#e2e8f0;color:var(--rpt-color-text, #0f172a)}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4559
|
-
}
|
|
4560
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptDateRangeComponent, decorators: [{
|
|
4561
|
-
type: Component,
|
|
4562
|
-
args: [{ selector: 'rpt-date-range', standalone: true, imports: [ReactiveFormsModule], template: `
|
|
4563
|
-
<div class="rpt-field-group">
|
|
4564
|
-
<!-- Header with Label & Preset Bar -->
|
|
4565
|
-
<div class="rpt-label-row">
|
|
4566
|
-
@if (config().label) {
|
|
4567
|
-
<label [for]="elementId() + '_from'" class="rpt-label">
|
|
4568
|
-
{{ config().label }}
|
|
4569
|
-
@if (config().validation?.required) {
|
|
4570
|
-
<span class="rpt-required-marker">*</span>
|
|
4571
|
-
}
|
|
4572
|
-
</label>
|
|
4573
|
-
}
|
|
4574
|
-
|
|
4575
|
-
@if (showPresets()) {
|
|
4576
|
-
<div class="rpt-preset-pills" role="toolbar" aria-label="Date presets">
|
|
4577
|
-
@for (p of presets; track p.id) {
|
|
4578
|
-
<button
|
|
4579
|
-
type="button"
|
|
4580
|
-
class="rpt-preset-pill"
|
|
4581
|
-
[class.is-active]="activePreset() === p.id"
|
|
4582
|
-
[disabled]="formControl().disabled"
|
|
4583
|
-
(click)="applyPreset(p.id)"
|
|
4584
|
-
>
|
|
4585
|
-
{{ p.label }}
|
|
4586
|
-
</button>
|
|
4587
|
-
}
|
|
4588
|
-
</div>
|
|
4589
|
-
}
|
|
4590
|
-
</div>
|
|
4591
|
-
|
|
4592
|
-
<!-- Date Inputs Container -->
|
|
4593
|
-
<div class="rpt-date-range-container" [class.rpt-invalid]="isInvalid()">
|
|
4594
|
-
<!-- From Field -->
|
|
4595
|
-
<div class="rpt-date-subfield">
|
|
4596
|
-
<span class="rpt-date-prefix">From</span>
|
|
4597
|
-
<input
|
|
4598
|
-
[id]="elementId() + '_from'"
|
|
4599
|
-
type="date"
|
|
4600
|
-
class="rpt-date-input"
|
|
4601
|
-
[value]="fromDate()"
|
|
4602
|
-
[disabled]="formControl().disabled"
|
|
4603
|
-
[min]="minDate()"
|
|
4604
|
-
[max]="maxDate()"
|
|
4605
|
-
(input)="onFromChange($event)"
|
|
4606
|
-
/>
|
|
4607
|
-
</div>
|
|
4608
|
-
|
|
4609
|
-
<span class="rpt-range-separator" aria-hidden="true">→</span>
|
|
4610
|
-
|
|
4611
|
-
<!-- To Field -->
|
|
4612
|
-
<div class="rpt-date-subfield">
|
|
4613
|
-
<span class="rpt-date-prefix">To</span>
|
|
4614
|
-
<input
|
|
4615
|
-
[id]="elementId() + '_to'"
|
|
4616
|
-
type="date"
|
|
4617
|
-
class="rpt-date-input"
|
|
4618
|
-
[value]="toDate()"
|
|
4619
|
-
[disabled]="formControl().disabled"
|
|
4620
|
-
[min]="fromDate() || minDate()"
|
|
4621
|
-
[max]="maxDate()"
|
|
4622
|
-
(input)="onToChange($event)"
|
|
4623
|
-
/>
|
|
4624
|
-
</div>
|
|
4625
|
-
|
|
4626
|
-
<!-- Quick Clear Button -->
|
|
4627
|
-
@if (hasValue() && !formControl().disabled) {
|
|
4628
|
-
<button
|
|
4629
|
-
type="button"
|
|
4630
|
-
class="rpt-range-clear-btn"
|
|
4631
|
-
title="Clear date range"
|
|
4632
|
-
aria-label="Clear date range"
|
|
4633
|
-
(click)="clearRange($event)"
|
|
4634
|
-
>
|
|
4635
|
-
✕
|
|
4636
|
-
</button>
|
|
4637
|
-
}
|
|
4638
|
-
</div>
|
|
4639
|
-
|
|
4640
|
-
@if (rangeError()) {
|
|
4641
|
-
<span class="rpt-error-text">{{ rangeError() }}</span>
|
|
4642
|
-
} @else if (errorMessage()) {
|
|
4643
|
-
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
4644
|
-
}
|
|
4645
|
-
</div>
|
|
4646
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:5px;box-sizing:border-box}.rpt-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-preset-pills{display:inline-flex;align-items:center;gap:3px;flex-wrap:wrap}.rpt-preset-pill{border:1px solid var(--rpt-color-border, #cbd5e1);background:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);font-size:.6875rem;font-weight:500;padding:1px 7px;border-radius:12px;cursor:pointer;line-height:1.4;transition:all .12s ease}.rpt-preset-pill:hover:not(:disabled){border-color:var(--rpt-color-primary, #2563eb);color:var(--rpt-color-primary, #2563eb);background:#eff6ff}.rpt-preset-pill.is-active{background:var(--rpt-color-primary, #2563eb);border-color:var(--rpt-color-primary, #2563eb);color:#fff;font-weight:600}.rpt-preset-pill:disabled{cursor:not-allowed;opacity:.5}.rpt-date-range-container{display:flex;align-items:center;gap:8px;width:100%;flex:1;min-height:38px;box-sizing:border-box;padding:3px 8px;background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease}.rpt-date-range-container:focus-within{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-date-range-container.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-date-subfield{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.rpt-date-prefix{font-size:.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--rpt-color-text-muted, #94a3b8);-webkit-user-select:none;user-select:none}.rpt-date-input{width:100%;border:none;outline:none;background:transparent;font-size:var(--rpt-font-size-base, .84rem);font-family:inherit;color:var(--rpt-color-text, #0f172a);min-width:0;padding:4px 0}.rpt-date-input:disabled{color:var(--rpt-color-text-muted, #94a3b8);cursor:not-allowed}.rpt-range-separator{color:var(--rpt-color-text-muted, #94a3b8);font-size:.8125rem;-webkit-user-select:none;user-select:none;padding:0 2px}.rpt-range-clear-btn{border:none;background:#f1f5f9;color:var(--rpt-color-text-muted, #64748b);width:18px;height:18px;border-radius:50%;font-size:.6875rem;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;transition:background-color .15s ease,color .15s ease}.rpt-range-clear-btn:hover{background-color:#e2e8f0;color:var(--rpt-color-text, #0f172a)}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"] }]
|
|
4647
|
-
}], ctorParameters: () => [] });
|
|
4648
|
-
|
|
4649
|
-
class RptNumberComponent {
|
|
4650
|
-
config = input.required();
|
|
4651
|
-
control = input();
|
|
4652
|
-
fallbackControl = new FormControl(null);
|
|
4653
|
-
formControl = computed(() => this.control() ?? this.fallbackControl);
|
|
4654
|
-
elementId = computed(() => this.config().key || this.config().id);
|
|
4655
|
-
placeholder = computed(() => this.config().properties?.['placeholder'] || '');
|
|
4656
|
-
prefix = computed(() => this.config().properties?.['prefix'] || '');
|
|
4657
|
-
suffix = computed(() => this.config().properties?.['suffix'] || '');
|
|
4658
|
-
minVal = computed(() => this.config().validation?.min ?? this.config().properties?.['min'] ?? null);
|
|
4659
|
-
maxVal = computed(() => this.config().validation?.max ?? this.config().properties?.['max'] ?? null);
|
|
4660
|
-
stepVal = computed(() => this.config().properties?.['step'] ?? 1);
|
|
4661
|
-
isInvalid = computed(() => {
|
|
4662
|
-
const ctrl = this.formControl();
|
|
4663
|
-
return ctrl.invalid && (ctrl.dirty || ctrl.touched);
|
|
4664
|
-
});
|
|
4665
|
-
errorMessage = computed(() => {
|
|
4666
|
-
const ctrl = this.formControl();
|
|
4667
|
-
if (!ctrl.invalid || (!ctrl.dirty && !ctrl.touched)) {
|
|
4668
|
-
return '';
|
|
4669
|
-
}
|
|
4670
|
-
const errors = ctrl.errors;
|
|
4671
|
-
if (!errors)
|
|
4672
|
-
return '';
|
|
4673
|
-
const firstKey = Object.keys(errors)[0];
|
|
4674
|
-
return getValidationMessage(this.config().validation, firstKey);
|
|
4675
|
-
});
|
|
4676
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4677
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptNumberComponent, isStandalone: true, selector: "rpt-number", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
4678
|
-
<div class="rpt-field-group">
|
|
4679
|
-
@if (config().label) {
|
|
4680
|
-
<label [for]="elementId()" class="rpt-label">
|
|
4681
|
-
{{ config().label }}
|
|
4682
|
-
@if (config().validation?.required) {
|
|
4683
|
-
<span class="rpt-required-marker">*</span>
|
|
4684
|
-
}
|
|
4685
|
-
</label>
|
|
4686
|
-
}
|
|
4687
|
-
|
|
4688
|
-
<div class="rpt-input-wrapper" [class.has-prefix]="prefix()" [class.has-suffix]="suffix()">
|
|
4689
|
-
@if (prefix()) {
|
|
4690
|
-
<span class="rpt-affix rpt-prefix">{{ prefix() }}</span>
|
|
4691
|
-
}
|
|
4692
|
-
<input
|
|
4693
|
-
[id]="elementId()"
|
|
4694
|
-
type="number"
|
|
4695
|
-
(wheel)="$any($event.target).blur()"
|
|
4696
|
-
(keydown.arrowup)="$event.preventDefault()"
|
|
4697
|
-
(keydown.arrowdown)="$event.preventDefault()"
|
|
4698
|
-
[formControl]="formControl()"
|
|
4699
|
-
[min]="minVal()"
|
|
4700
|
-
[max]="maxVal()"
|
|
4701
|
-
[step]="stepVal()"
|
|
4702
|
-
[placeholder]="placeholder()"
|
|
4703
|
-
[class.rpt-invalid]="isInvalid()"
|
|
4704
|
-
class="rpt-number-input"
|
|
4705
|
-
/>
|
|
4706
|
-
@if (suffix()) {
|
|
4707
|
-
<span class="rpt-affix rpt-suffix">{{ suffix() }}</span>
|
|
4708
|
-
}
|
|
4709
|
-
</div>
|
|
4710
|
-
|
|
4711
|
-
@if (errorMessage()) {
|
|
4712
|
-
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
4713
|
-
}
|
|
4714
|
-
</div>
|
|
4715
|
-
`, isInline: true, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:4px;box-sizing:border-box}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-input-wrapper{position:relative;display:flex;align-items:stretch;width:100%;flex:1;min-height:0}.rpt-affix{font-size:var(--rpt-font-size-sm, .75rem);color:var(--rpt-color-text-muted, #64748b);background-color:var(--rpt-color-surface, #f8fafc);padding:0 10px;height:100%;min-height:38px;display:flex;align-items:center;border:1px solid var(--rpt-color-border, #cbd5e1);-webkit-user-select:none;user-select:none;box-sizing:border-box}.rpt-prefix{border-right:none;border-top-left-radius:var(--rpt-border-radius, 6px);border-bottom-left-radius:var(--rpt-border-radius, 6px)}.rpt-suffix{border-left:none;border-top-right-radius:var(--rpt-border-radius, 6px);border-bottom-right-radius:var(--rpt-border-radius, 6px)}.rpt-number-input::-webkit-inner-spin-button,.rpt-number-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.rpt-number-input{-moz-appearance:textfield;appearance:textfield;width:100%;box-sizing:border-box;height:100%;min-height:38px;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a);background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease;outline:none}.has-prefix .rpt-number-input{border-top-left-radius:0;border-bottom-left-radius:0}.has-suffix .rpt-number-input{border-top-right-radius:0;border-bottom-right-radius:0}.rpt-number-input:hover:not(:disabled){border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-number-input:focus{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-number-input:disabled{background-color:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);cursor:not-allowed}.rpt-number-input.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-number-input.rpt-invalid:focus{box-shadow:0 0 0 3px #ef444440}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4716
|
-
}
|
|
4717
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptNumberComponent, decorators: [{
|
|
4718
|
-
type: Component,
|
|
4719
|
-
args: [{ selector: 'rpt-number', standalone: true, imports: [ReactiveFormsModule], template: `
|
|
4720
|
-
<div class="rpt-field-group">
|
|
4721
|
-
@if (config().label) {
|
|
4722
|
-
<label [for]="elementId()" class="rpt-label">
|
|
4723
|
-
{{ config().label }}
|
|
4724
|
-
@if (config().validation?.required) {
|
|
4725
|
-
<span class="rpt-required-marker">*</span>
|
|
4726
|
-
}
|
|
4727
|
-
</label>
|
|
4728
|
-
}
|
|
4729
|
-
|
|
4730
|
-
<div class="rpt-input-wrapper" [class.has-prefix]="prefix()" [class.has-suffix]="suffix()">
|
|
4731
|
-
@if (prefix()) {
|
|
4732
|
-
<span class="rpt-affix rpt-prefix">{{ prefix() }}</span>
|
|
4733
|
-
}
|
|
4734
|
-
<input
|
|
4735
|
-
[id]="elementId()"
|
|
4736
|
-
type="number"
|
|
4737
|
-
(wheel)="$any($event.target).blur()"
|
|
4738
|
-
(keydown.arrowup)="$event.preventDefault()"
|
|
4739
|
-
(keydown.arrowdown)="$event.preventDefault()"
|
|
4740
|
-
[formControl]="formControl()"
|
|
4741
|
-
[min]="minVal()"
|
|
4742
|
-
[max]="maxVal()"
|
|
4743
|
-
[step]="stepVal()"
|
|
4744
|
-
[placeholder]="placeholder()"
|
|
4745
|
-
[class.rpt-invalid]="isInvalid()"
|
|
4746
|
-
class="rpt-number-input"
|
|
4747
|
-
/>
|
|
4748
|
-
@if (suffix()) {
|
|
4749
|
-
<span class="rpt-affix rpt-suffix">{{ suffix() }}</span>
|
|
4750
|
-
}
|
|
4751
|
-
</div>
|
|
4752
|
-
|
|
4753
|
-
@if (errorMessage()) {
|
|
4754
|
-
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
4755
|
-
}
|
|
4756
|
-
</div>
|
|
4757
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:4px;box-sizing:border-box}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-input-wrapper{position:relative;display:flex;align-items:stretch;width:100%;flex:1;min-height:0}.rpt-affix{font-size:var(--rpt-font-size-sm, .75rem);color:var(--rpt-color-text-muted, #64748b);background-color:var(--rpt-color-surface, #f8fafc);padding:0 10px;height:100%;min-height:38px;display:flex;align-items:center;border:1px solid var(--rpt-color-border, #cbd5e1);-webkit-user-select:none;user-select:none;box-sizing:border-box}.rpt-prefix{border-right:none;border-top-left-radius:var(--rpt-border-radius, 6px);border-bottom-left-radius:var(--rpt-border-radius, 6px)}.rpt-suffix{border-left:none;border-top-right-radius:var(--rpt-border-radius, 6px);border-bottom-right-radius:var(--rpt-border-radius, 6px)}.rpt-number-input::-webkit-inner-spin-button,.rpt-number-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.rpt-number-input{-moz-appearance:textfield;appearance:textfield;width:100%;box-sizing:border-box;height:100%;min-height:38px;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a);background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease;outline:none}.has-prefix .rpt-number-input{border-top-left-radius:0;border-bottom-left-radius:0}.has-suffix .rpt-number-input{border-top-right-radius:0;border-bottom-right-radius:0}.rpt-number-input:hover:not(:disabled){border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-number-input:focus{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-number-input:disabled{background-color:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);cursor:not-allowed}.rpt-number-input.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-number-input.rpt-invalid:focus{box-shadow:0 0 0 3px #ef444440}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"] }]
|
|
4758
|
-
}] });
|
|
4759
|
-
|
|
4760
|
-
class RptCheckboxComponent {
|
|
4761
|
-
config = input.required();
|
|
4762
|
-
control = input();
|
|
4763
|
-
fallbackControl = new FormControl(false);
|
|
4764
|
-
formControl = computed(() => this.control() ?? this.fallbackControl);
|
|
4765
|
-
elementId = computed(() => this.config().key || this.config().id);
|
|
4766
|
-
isInvalid = computed(() => {
|
|
4767
|
-
const ctrl = this.formControl();
|
|
4768
|
-
return ctrl.invalid && (ctrl.dirty || ctrl.touched);
|
|
4769
|
-
});
|
|
4770
|
-
errorMessage = computed(() => {
|
|
4771
|
-
const ctrl = this.formControl();
|
|
4772
|
-
if (!ctrl.invalid || (!ctrl.dirty && !ctrl.touched)) {
|
|
4773
|
-
return '';
|
|
4774
|
-
}
|
|
4775
|
-
const errors = ctrl.errors;
|
|
4776
|
-
if (!errors)
|
|
4777
|
-
return '';
|
|
4778
|
-
const firstKey = Object.keys(errors)[0];
|
|
4779
|
-
return getValidationMessage(this.config().validation, firstKey);
|
|
4780
|
-
});
|
|
4781
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4782
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptCheckboxComponent, isStandalone: true, selector: "rpt-checkbox", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
4783
|
-
<div class="rpt-checkbox-field">
|
|
4784
|
-
<label [for]="elementId()" class="rpt-checkbox-label">
|
|
4785
|
-
<input
|
|
4786
|
-
[id]="elementId()"
|
|
4787
|
-
type="checkbox"
|
|
4788
|
-
[formControl]="formControl()"
|
|
4789
|
-
class="rpt-checkbox-input"
|
|
4790
|
-
/>
|
|
4791
|
-
<span class="rpt-custom-checkbox" aria-hidden="true">
|
|
4792
|
-
<svg class="rpt-check-icon" width="12" height="10" viewBox="0 0 12 10" fill="none">
|
|
4793
|
-
<path d="M1 5L4.5 8.5L11 1.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4794
|
-
</svg>
|
|
4795
|
-
</span>
|
|
4796
|
-
<span class="rpt-checkbox-text">
|
|
4797
|
-
{{ config().label }}
|
|
4798
|
-
@if (config().validation?.required) {
|
|
4799
|
-
<span class="rpt-required-marker">*</span>
|
|
4800
|
-
}
|
|
4801
|
-
</span>
|
|
4802
|
-
</label>
|
|
4803
|
-
|
|
4804
|
-
@if (errorMessage()) {
|
|
4805
|
-
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
4806
|
-
}
|
|
4807
|
-
</div>
|
|
4808
|
-
`, isInline: true, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-checkbox-field{display:flex;flex-direction:column;justify-content:flex-end;height:100%;gap:4px;padding-bottom:8px;box-sizing:border-box}.rpt-checkbox-label{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none}.rpt-checkbox-input{position:absolute;opacity:0;width:0;height:0;margin:0}.rpt-custom-checkbox{width:18px;height:18px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-sm, 4px);background-color:var(--rpt-color-bg, #ffffff);display:flex;align-items:center;justify-content:center;transition:all var(--rpt-transition-speed, .15s) ease;color:var(--rpt-color-text-inverse, #ffffff);flex-shrink:0}.rpt-checkbox-label:hover .rpt-custom-checkbox{border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-checkbox-input:focus-visible+.rpt-custom-checkbox{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-checkbox-input:checked+.rpt-custom-checkbox{background-color:var(--rpt-color-primary, #2563eb);border-color:var(--rpt-color-primary, #2563eb)}.rpt-check-icon{opacity:0;transform:scale(.6);transition:all var(--rpt-transition-speed, .15s) ease}.rpt-checkbox-input:checked+.rpt-custom-checkbox .rpt-check-icon{opacity:1;transform:scale(1)}.rpt-checkbox-input:disabled+.rpt-custom-checkbox{background-color:var(--rpt-color-surface, #f8fafc);border-color:var(--rpt-color-border, #cbd5e1);cursor:not-allowed}.rpt-checkbox-text{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a)}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4809
|
-
}
|
|
4810
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptCheckboxComponent, decorators: [{
|
|
4811
|
-
type: Component,
|
|
4812
|
-
args: [{ selector: 'rpt-checkbox', standalone: true, imports: [ReactiveFormsModule], template: `
|
|
4813
|
-
<div class="rpt-checkbox-field">
|
|
4814
|
-
<label [for]="elementId()" class="rpt-checkbox-label">
|
|
4815
|
-
<input
|
|
4816
|
-
[id]="elementId()"
|
|
4817
|
-
type="checkbox"
|
|
4818
|
-
[formControl]="formControl()"
|
|
4819
|
-
class="rpt-checkbox-input"
|
|
4820
|
-
/>
|
|
4821
|
-
<span class="rpt-custom-checkbox" aria-hidden="true">
|
|
4822
|
-
<svg class="rpt-check-icon" width="12" height="10" viewBox="0 0 12 10" fill="none">
|
|
4823
|
-
<path d="M1 5L4.5 8.5L11 1.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4824
|
-
</svg>
|
|
4825
|
-
</span>
|
|
4826
|
-
<span class="rpt-checkbox-text">
|
|
4827
|
-
{{ config().label }}
|
|
4828
|
-
@if (config().validation?.required) {
|
|
4829
|
-
<span class="rpt-required-marker">*</span>
|
|
4830
|
-
}
|
|
4831
|
-
</span>
|
|
4832
|
-
</label>
|
|
4833
|
-
|
|
4834
|
-
@if (errorMessage()) {
|
|
4835
|
-
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
4836
|
-
}
|
|
4837
|
-
</div>
|
|
4838
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-checkbox-field{display:flex;flex-direction:column;justify-content:flex-end;height:100%;gap:4px;padding-bottom:8px;box-sizing:border-box}.rpt-checkbox-label{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none}.rpt-checkbox-input{position:absolute;opacity:0;width:0;height:0;margin:0}.rpt-custom-checkbox{width:18px;height:18px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-sm, 4px);background-color:var(--rpt-color-bg, #ffffff);display:flex;align-items:center;justify-content:center;transition:all var(--rpt-transition-speed, .15s) ease;color:var(--rpt-color-text-inverse, #ffffff);flex-shrink:0}.rpt-checkbox-label:hover .rpt-custom-checkbox{border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-checkbox-input:focus-visible+.rpt-custom-checkbox{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-checkbox-input:checked+.rpt-custom-checkbox{background-color:var(--rpt-color-primary, #2563eb);border-color:var(--rpt-color-primary, #2563eb)}.rpt-check-icon{opacity:0;transform:scale(.6);transition:all var(--rpt-transition-speed, .15s) ease}.rpt-checkbox-input:checked+.rpt-custom-checkbox .rpt-check-icon{opacity:1;transform:scale(1)}.rpt-checkbox-input:disabled+.rpt-custom-checkbox{background-color:var(--rpt-color-surface, #f8fafc);border-color:var(--rpt-color-border, #cbd5e1);cursor:not-allowed}.rpt-checkbox-text{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a)}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"] }]
|
|
4839
|
-
}] });
|
|
4840
|
-
|
|
4841
|
-
/**
|
|
4842
|
-
* Enterprise SVG Icon component for BWays-Report.
|
|
4843
|
-
* Provides crisp, scalable vector icons without external font dependencies.
|
|
4844
|
-
*/
|
|
4845
|
-
class RptIconComponent {
|
|
4846
|
-
/** Icon name (e.g. 'search', 'edit', 'save', 'kpi', 'chart-bar', 'trend-up') */
|
|
4847
|
-
name = input.required();
|
|
4848
|
-
/** Icon dimension in pixels. Defaults to 16. */
|
|
4849
|
-
size = input(16);
|
|
4850
|
-
/** Stroke/fill color. Defaults to 'currentColor'. */
|
|
4851
|
-
color = input('currentColor');
|
|
4852
|
-
/** Stroke width for line-based icons. Defaults to 2. */
|
|
4853
|
-
strokeWidth = input(2);
|
|
4854
|
-
viewBox = computed(() => '0 0 24 24');
|
|
4855
|
-
stroke = computed(() => 'currentColor');
|
|
4856
|
-
fill = computed(() => 'none');
|
|
4857
|
-
iconData = computed(() => {
|
|
4858
|
-
const n = this.name()?.toLowerCase().trim() || 'box';
|
|
4859
|
-
return ICON_REGISTRY[n] || ICON_REGISTRY['box'] || { paths: [] };
|
|
4860
|
-
});
|
|
4861
|
-
paths = computed(() => this.iconData().paths || []);
|
|
4862
|
-
circles = computed(() => this.iconData().circles || []);
|
|
4863
|
-
rects = computed(() => this.iconData().rects || []);
|
|
4864
|
-
lines = computed(() => this.iconData().lines || []);
|
|
4865
|
-
polylines = computed(() => this.iconData().polylines || []);
|
|
4866
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4867
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptIconComponent, isStandalone: true, selector: "rpt-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
4868
|
-
<svg
|
|
4869
|
-
class="rpt-svg-icon"
|
|
4870
|
-
[attr.width]="size()"
|
|
4871
|
-
[attr.height]="size()"
|
|
4872
|
-
[attr.viewBox]="viewBox()"
|
|
4873
|
-
[attr.stroke]="stroke()"
|
|
4874
|
-
[attr.fill]="fill()"
|
|
4875
|
-
[attr.stroke-width]="strokeWidth()"
|
|
4876
|
-
stroke-linecap="round"
|
|
4877
|
-
stroke-linejoin="round"
|
|
4878
|
-
[style.color]="color()"
|
|
4879
|
-
aria-hidden="true"
|
|
4880
|
-
>
|
|
4881
|
-
@for (d of paths(); track d) {
|
|
4882
|
-
<path [attr.d]="d" />
|
|
4883
|
-
}
|
|
4884
|
-
@for (c of circles(); track c.cx + '-' + c.cy) {
|
|
4885
|
-
<circle [attr.cx]="c.cx" [attr.cy]="c.cy" [attr.r]="c.r" />
|
|
4886
|
-
}
|
|
4887
|
-
@for (r of rects(); track r.x + '-' + r.y) {
|
|
4888
|
-
<rect
|
|
4889
|
-
[attr.x]="r.x"
|
|
4890
|
-
[attr.y]="r.y"
|
|
4891
|
-
[attr.width]="r.width"
|
|
4892
|
-
[attr.height]="r.height"
|
|
4893
|
-
[attr.rx]="r.rx || 0"
|
|
4894
|
-
/>
|
|
4895
|
-
}
|
|
4896
|
-
@for (l of lines(); track l.x1 + '-' + l.y1) {
|
|
4897
|
-
<line
|
|
4898
|
-
[attr.x1]="l.x1"
|
|
4899
|
-
[attr.y1]="l.y1"
|
|
4900
|
-
[attr.x2]="l.x2"
|
|
4901
|
-
[attr.y2]="l.y2"
|
|
4902
|
-
/>
|
|
4903
|
-
}
|
|
4904
|
-
@for (p of polylines(); track p) {
|
|
4905
|
-
<polyline [attr.points]="p" />
|
|
4906
|
-
}
|
|
4907
|
-
</svg>
|
|
4908
|
-
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1}.rpt-svg-icon{display:inline-block;flex-shrink:0;color:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4909
|
-
}
|
|
4910
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptIconComponent, decorators: [{
|
|
4911
|
-
type: Component,
|
|
4912
|
-
args: [{ selector: 'rpt-icon', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4913
|
-
<svg
|
|
4914
|
-
class="rpt-svg-icon"
|
|
4915
|
-
[attr.width]="size()"
|
|
4916
|
-
[attr.height]="size()"
|
|
4917
|
-
[attr.viewBox]="viewBox()"
|
|
4918
|
-
[attr.stroke]="stroke()"
|
|
4919
|
-
[attr.fill]="fill()"
|
|
4920
|
-
[attr.stroke-width]="strokeWidth()"
|
|
4921
|
-
stroke-linecap="round"
|
|
4922
|
-
stroke-linejoin="round"
|
|
4923
|
-
[style.color]="color()"
|
|
4924
|
-
aria-hidden="true"
|
|
4925
|
-
>
|
|
4926
|
-
@for (d of paths(); track d) {
|
|
4927
|
-
<path [attr.d]="d" />
|
|
4928
|
-
}
|
|
4929
|
-
@for (c of circles(); track c.cx + '-' + c.cy) {
|
|
4930
|
-
<circle [attr.cx]="c.cx" [attr.cy]="c.cy" [attr.r]="c.r" />
|
|
4931
|
-
}
|
|
4932
|
-
@for (r of rects(); track r.x + '-' + r.y) {
|
|
4933
|
-
<rect
|
|
4934
|
-
[attr.x]="r.x"
|
|
4935
|
-
[attr.y]="r.y"
|
|
4936
|
-
[attr.width]="r.width"
|
|
4937
|
-
[attr.height]="r.height"
|
|
4938
|
-
[attr.rx]="r.rx || 0"
|
|
4939
|
-
/>
|
|
4940
|
-
}
|
|
4941
|
-
@for (l of lines(); track l.x1 + '-' + l.y1) {
|
|
4942
|
-
<line
|
|
4943
|
-
[attr.x1]="l.x1"
|
|
4944
|
-
[attr.y1]="l.y1"
|
|
4945
|
-
[attr.x2]="l.x2"
|
|
4946
|
-
[attr.y2]="l.y2"
|
|
4947
|
-
/>
|
|
4948
|
-
}
|
|
4949
|
-
@for (p of polylines(); track p) {
|
|
4950
|
-
<polyline [attr.points]="p" />
|
|
4951
|
-
}
|
|
4952
|
-
</svg>
|
|
4953
|
-
`, styles: [":host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1}.rpt-svg-icon{display:inline-block;flex-shrink:0;color:inherit}\n"] }]
|
|
4394
|
+
@for (l of lines(); track l.x1 + '-' + l.y1) {
|
|
4395
|
+
<line
|
|
4396
|
+
[attr.x1]="l.x1"
|
|
4397
|
+
[attr.y1]="l.y1"
|
|
4398
|
+
[attr.x2]="l.x2"
|
|
4399
|
+
[attr.y2]="l.y2"
|
|
4400
|
+
/>
|
|
4401
|
+
}
|
|
4402
|
+
@for (p of polylines(); track p) {
|
|
4403
|
+
<polyline [attr.points]="p" />
|
|
4404
|
+
}
|
|
4405
|
+
</svg>
|
|
4406
|
+
`, styles: [":host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1}.rpt-svg-icon{display:inline-block;flex-shrink:0;color:inherit}\n"] }]
|
|
4954
4407
|
}] });
|
|
4955
4408
|
const ICON_REGISTRY = {
|
|
4956
4409
|
// Input / Text
|
|
@@ -5397,7 +4850,733 @@ const ICON_REGISTRY = {
|
|
|
5397
4850
|
{ cx: 15, cy: 18, r: 1.5 }
|
|
5398
4851
|
]
|
|
5399
4852
|
}
|
|
5400
|
-
};
|
|
4853
|
+
};
|
|
4854
|
+
|
|
4855
|
+
function normalizedDate(value) {
|
|
4856
|
+
if (value instanceof Date && !isNaN(value.getTime()))
|
|
4857
|
+
return value.getFullYear() + '-' + String(value.getMonth() + 1).padStart(2, '0') + '-' + String(value.getDate()).padStart(2, '0');
|
|
4858
|
+
const match = /^(\d{4})-?(\d{2})-?(\d{2})$/.exec(String(value ?? ''));
|
|
4859
|
+
return match ? match[1] + '-' + match[2] + '-' + match[3] : '';
|
|
4860
|
+
}
|
|
4861
|
+
function displayedDate(value) {
|
|
4862
|
+
const iso = normalizedDate(value);
|
|
4863
|
+
return iso ? iso.slice(8, 10) + '-' + iso.slice(5, 7) + '-' + iso.slice(0, 4) : '';
|
|
4864
|
+
}
|
|
4865
|
+
/** Stable display format with ISO form values; browser locale only affects the calendar popup. */
|
|
4866
|
+
class RptCalendarInputComponent {
|
|
4867
|
+
control = input.required();
|
|
4868
|
+
elementId = input('');
|
|
4869
|
+
min = input(null);
|
|
4870
|
+
max = input(null);
|
|
4871
|
+
text = signal('');
|
|
4872
|
+
calendarValue = signal('');
|
|
4873
|
+
disabled = signal(false);
|
|
4874
|
+
invalid = signal(false);
|
|
4875
|
+
formatError = signal(false);
|
|
4876
|
+
editing = false;
|
|
4877
|
+
constructor() {
|
|
4878
|
+
effect(onCleanup => {
|
|
4879
|
+
const control = this.control();
|
|
4880
|
+
const sync = () => { this.disabled.set(control.disabled); this.invalid.set(control.invalid); if (!this.editing) {
|
|
4881
|
+
this.text.set(displayedDate(control.value));
|
|
4882
|
+
this.calendarValue.set(normalizedDate(control.value));
|
|
4883
|
+
this.formatError.set(false);
|
|
4884
|
+
} };
|
|
4885
|
+
untracked(sync);
|
|
4886
|
+
const subscription = merge(control.valueChanges, control.statusChanges).subscribe(sync);
|
|
4887
|
+
onCleanup(() => subscription.unsubscribe());
|
|
4888
|
+
}, { allowSignalWrites: true });
|
|
4889
|
+
}
|
|
4890
|
+
ngOnInit() {
|
|
4891
|
+
this.text.set(displayedDate(this.control().value));
|
|
4892
|
+
this.calendarValue.set(normalizedDate(this.control().value));
|
|
4893
|
+
this.disabled.set(this.control().disabled);
|
|
4894
|
+
this.invalid.set(this.control().invalid);
|
|
4895
|
+
}
|
|
4896
|
+
onText(value) {
|
|
4897
|
+
this.text.set(value);
|
|
4898
|
+
const match = /^(\d{2})-(\d{2})-(\d{4})$/.exec(value);
|
|
4899
|
+
const iso = match ? match[3] + '-' + match[2] + '-' + match[1] : '';
|
|
4900
|
+
const probe = new Date(0);
|
|
4901
|
+
if (match)
|
|
4902
|
+
probe.setUTCFullYear(+match[3], +match[2] - 1, +match[1]);
|
|
4903
|
+
const valid = !!match && +match[3] > 0 && probe.getUTCFullYear() === +match[3] && probe.getUTCMonth() + 1 === +match[2] && probe.getUTCDate() === +match[1];
|
|
4904
|
+
const inRange = valid && (!this.min() || iso >= this.min()) && (!this.max() || iso <= this.max());
|
|
4905
|
+
this.editing = true;
|
|
4906
|
+
try {
|
|
4907
|
+
this.control().setValue(inRange ? iso : '');
|
|
4908
|
+
this.control().markAsDirty();
|
|
4909
|
+
this.formatError.set(value !== '' && !inRange);
|
|
4910
|
+
this.calendarValue.set(inRange ? iso : '');
|
|
4911
|
+
if (value !== '' && !inRange)
|
|
4912
|
+
this.control().setErrors({ ...this.control().errors, dateFormat: true });
|
|
4913
|
+
this.invalid.set(this.control().invalid);
|
|
4914
|
+
}
|
|
4915
|
+
finally {
|
|
4916
|
+
this.editing = false;
|
|
4917
|
+
}
|
|
4918
|
+
}
|
|
4919
|
+
onCalendar(value) { this.onText(displayedDate(value)); this.control().markAsTouched(); }
|
|
4920
|
+
openCalendar(picker) { try {
|
|
4921
|
+
if (picker.showPicker)
|
|
4922
|
+
picker.showPicker();
|
|
4923
|
+
else
|
|
4924
|
+
picker.click();
|
|
4925
|
+
}
|
|
4926
|
+
catch {
|
|
4927
|
+
picker.click();
|
|
4928
|
+
} }
|
|
4929
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptCalendarInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4930
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptCalendarInputComponent, isStandalone: true, selector: "rpt-calendar-input", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, elementId: { classPropertyName: "elementId", publicName: "elementId", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<div class="calendar-field">
|
|
4931
|
+
<input type="text" class="date-text" [id]="elementId()" placeholder="dd-mm-yyyy" inputmode="numeric" autocomplete="off"
|
|
4932
|
+
[value]="text()" [disabled]="disabled()" [attr.aria-invalid]="invalid() || null" aria-description="Date in day-month-year format, dd-mm-yyyy"
|
|
4933
|
+
(input)="onText($any($event.target).value)" (blur)="control().markAsTouched()" />
|
|
4934
|
+
<button type="button" class="calendar-toggle" aria-label="Open date calendar" [disabled]="disabled()" (click)="openCalendar(picker)"><rpt-icon name="calendar" [size]="15" /></button>
|
|
4935
|
+
<input #picker type="date" class="native-calendar" tabindex="-1" aria-hidden="true" [disabled]="disabled()" [value]="calendarValue()"
|
|
4936
|
+
[min]="min() || ''" [max]="max() || ''" (change)="onCalendar($any($event.target).value)" />
|
|
4937
|
+
</div>
|
|
4938
|
+
@if (formatError()) { <span class="date-error" role="alert">Enter a valid date as dd-mm-yyyy.</span> }`, isInline: true, styles: [":host{display:block;width:100%;min-height:38px}.calendar-field{position:relative;display:flex;width:100%;height:38px;box-sizing:border-box;border:1px solid var(--rpt-color-border,#cbd5e1);border-radius:6px;background:var(--rpt-color-bg,#fff)}.calendar-field:focus-within{border-color:var(--rpt-color-primary,#2563eb);box-shadow:0 0 0 2px #2563eb26}.date-text{box-sizing:border-box;flex:1;min-width:0;width:100%;height:100%;padding:6px 10px;border:0;border-radius:6px;background:transparent;font-family:var(--rpt-font-family,system-ui,sans-serif);font-size:14px;line-height:1.25;color:var(--rpt-color-text,#0f172a);outline:none}.date-text[aria-invalid=true]{box-shadow:inset 0 0 0 1px #dc2626}.calendar-toggle{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 36px;width:36px;height:100%;min-height:0;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}.native-calendar{position:absolute;right:0;bottom:0;width:1px;height:1px;opacity:0;pointer-events:none}.date-error{display:block;font:12px/1.3 var(--rpt-font-family,system-ui,sans-serif);color:#b91c1c;margin-top:3px}input:disabled,button:disabled{cursor:not-allowed;opacity:.6}\n"], dependencies: [{ kind: "component", type: RptIconComponent, selector: "rpt-icon", inputs: ["name", "size", "color", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4939
|
+
}
|
|
4940
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptCalendarInputComponent, decorators: [{
|
|
4941
|
+
type: Component,
|
|
4942
|
+
args: [{ selector: 'rpt-calendar-input', standalone: true, imports: [RptIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `<div class="calendar-field">
|
|
4943
|
+
<input type="text" class="date-text" [id]="elementId()" placeholder="dd-mm-yyyy" inputmode="numeric" autocomplete="off"
|
|
4944
|
+
[value]="text()" [disabled]="disabled()" [attr.aria-invalid]="invalid() || null" aria-description="Date in day-month-year format, dd-mm-yyyy"
|
|
4945
|
+
(input)="onText($any($event.target).value)" (blur)="control().markAsTouched()" />
|
|
4946
|
+
<button type="button" class="calendar-toggle" aria-label="Open date calendar" [disabled]="disabled()" (click)="openCalendar(picker)"><rpt-icon name="calendar" [size]="15" /></button>
|
|
4947
|
+
<input #picker type="date" class="native-calendar" tabindex="-1" aria-hidden="true" [disabled]="disabled()" [value]="calendarValue()"
|
|
4948
|
+
[min]="min() || ''" [max]="max() || ''" (change)="onCalendar($any($event.target).value)" />
|
|
4949
|
+
</div>
|
|
4950
|
+
@if (formatError()) { <span class="date-error" role="alert">Enter a valid date as dd-mm-yyyy.</span> }`, styles: [":host{display:block;width:100%;min-height:38px}.calendar-field{position:relative;display:flex;width:100%;height:38px;box-sizing:border-box;border:1px solid var(--rpt-color-border,#cbd5e1);border-radius:6px;background:var(--rpt-color-bg,#fff)}.calendar-field:focus-within{border-color:var(--rpt-color-primary,#2563eb);box-shadow:0 0 0 2px #2563eb26}.date-text{box-sizing:border-box;flex:1;min-width:0;width:100%;height:100%;padding:6px 10px;border:0;border-radius:6px;background:transparent;font-family:var(--rpt-font-family,system-ui,sans-serif);font-size:14px;line-height:1.25;color:var(--rpt-color-text,#0f172a);outline:none}.date-text[aria-invalid=true]{box-shadow:inset 0 0 0 1px #dc2626}.calendar-toggle{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 36px;width:36px;height:100%;min-height:0;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}.native-calendar{position:absolute;right:0;bottom:0;width:1px;height:1px;opacity:0;pointer-events:none}.date-error{display:block;font:12px/1.3 var(--rpt-font-family,system-ui,sans-serif);color:#b91c1c;margin-top:3px}input:disabled,button:disabled{cursor:not-allowed;opacity:.6}\n"] }]
|
|
4951
|
+
}], ctorParameters: () => [] });
|
|
4952
|
+
|
|
4953
|
+
class RptDateComponent {
|
|
4954
|
+
config = input.required();
|
|
4955
|
+
control = input();
|
|
4956
|
+
fallbackControl = new FormControl('');
|
|
4957
|
+
formControl = computed(() => this.control() ?? this.fallbackControl);
|
|
4958
|
+
elementId = computed(() => this.config().key || this.config().id);
|
|
4959
|
+
dateType = computed(() => (this.config().properties?.['includeTime'] ? 'datetime-local' : 'date'));
|
|
4960
|
+
minDate = computed(() => this.config().properties?.['minDate'] || null);
|
|
4961
|
+
maxDate = computed(() => this.config().properties?.['maxDate'] || null);
|
|
4962
|
+
isInvalid = computed(() => {
|
|
4963
|
+
const ctrl = this.formControl();
|
|
4964
|
+
return ctrl.invalid && (ctrl.dirty || ctrl.touched);
|
|
4965
|
+
});
|
|
4966
|
+
errorMessage = computed(() => {
|
|
4967
|
+
const ctrl = this.formControl();
|
|
4968
|
+
if (!ctrl.invalid || (!ctrl.dirty && !ctrl.touched)) {
|
|
4969
|
+
return '';
|
|
4970
|
+
}
|
|
4971
|
+
const errors = ctrl.errors;
|
|
4972
|
+
if (!errors)
|
|
4973
|
+
return '';
|
|
4974
|
+
const firstKey = Object.keys(errors)[0];
|
|
4975
|
+
return getValidationMessage(this.config().validation, firstKey);
|
|
4976
|
+
});
|
|
4977
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4978
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptDateComponent, isStandalone: true, selector: "rpt-date", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
4979
|
+
<div class="rpt-field-group">
|
|
4980
|
+
@if (config().label) {
|
|
4981
|
+
<label [for]="elementId()" class="rpt-label">
|
|
4982
|
+
{{ config().label }}
|
|
4983
|
+
@if (config().validation?.required) {
|
|
4984
|
+
<span class="rpt-required-marker">*</span>
|
|
4985
|
+
}
|
|
4986
|
+
</label>
|
|
4987
|
+
}
|
|
4988
|
+
|
|
4989
|
+
<div class="rpt-date-wrapper">
|
|
4990
|
+
@if (dateType() === 'date') {
|
|
4991
|
+
<rpt-calendar-input [elementId]="elementId()" [control]="formControl()" [min]="minDate()" [max]="maxDate()" />
|
|
4992
|
+
} @else {
|
|
4993
|
+
<input
|
|
4994
|
+
[id]="elementId()"
|
|
4995
|
+
[type]="dateType()"
|
|
4996
|
+
[formControl]="formControl()"
|
|
4997
|
+
[min]="minDate()"
|
|
4998
|
+
[max]="maxDate()"
|
|
4999
|
+
[class.rpt-invalid]="isInvalid()"
|
|
5000
|
+
class="rpt-date-input"
|
|
5001
|
+
/>
|
|
5002
|
+
}
|
|
5003
|
+
</div>
|
|
5004
|
+
|
|
5005
|
+
@if (errorMessage()) {
|
|
5006
|
+
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
5007
|
+
}
|
|
5008
|
+
</div>
|
|
5009
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:4px;box-sizing:border-box}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-date-wrapper{position:relative;width:100%;flex:1;min-height:0;display:flex}.rpt-date-input{width:100%;height:100%;min-height:38px;box-sizing:border-box;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a);background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease;outline:none}.rpt-date-input:hover:not(:disabled){border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-date-input:focus{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-date-input:disabled{background-color:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);cursor:not-allowed}.rpt-date-input.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-date-input.rpt-invalid:focus{box-shadow:0 0 0 3px #ef444440}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: RptCalendarInputComponent, selector: "rpt-calendar-input", inputs: ["control", "elementId", "min", "max"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5010
|
+
}
|
|
5011
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptDateComponent, decorators: [{
|
|
5012
|
+
type: Component,
|
|
5013
|
+
args: [{ selector: 'rpt-date', standalone: true, imports: [ReactiveFormsModule, RptCalendarInputComponent], template: `
|
|
5014
|
+
<div class="rpt-field-group">
|
|
5015
|
+
@if (config().label) {
|
|
5016
|
+
<label [for]="elementId()" class="rpt-label">
|
|
5017
|
+
{{ config().label }}
|
|
5018
|
+
@if (config().validation?.required) {
|
|
5019
|
+
<span class="rpt-required-marker">*</span>
|
|
5020
|
+
}
|
|
5021
|
+
</label>
|
|
5022
|
+
}
|
|
5023
|
+
|
|
5024
|
+
<div class="rpt-date-wrapper">
|
|
5025
|
+
@if (dateType() === 'date') {
|
|
5026
|
+
<rpt-calendar-input [elementId]="elementId()" [control]="formControl()" [min]="minDate()" [max]="maxDate()" />
|
|
5027
|
+
} @else {
|
|
5028
|
+
<input
|
|
5029
|
+
[id]="elementId()"
|
|
5030
|
+
[type]="dateType()"
|
|
5031
|
+
[formControl]="formControl()"
|
|
5032
|
+
[min]="minDate()"
|
|
5033
|
+
[max]="maxDate()"
|
|
5034
|
+
[class.rpt-invalid]="isInvalid()"
|
|
5035
|
+
class="rpt-date-input"
|
|
5036
|
+
/>
|
|
5037
|
+
}
|
|
5038
|
+
</div>
|
|
5039
|
+
|
|
5040
|
+
@if (errorMessage()) {
|
|
5041
|
+
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
5042
|
+
}
|
|
5043
|
+
</div>
|
|
5044
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:4px;box-sizing:border-box}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-date-wrapper{position:relative;width:100%;flex:1;min-height:0;display:flex}.rpt-date-input{width:100%;height:100%;min-height:38px;box-sizing:border-box;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a);background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease;outline:none}.rpt-date-input:hover:not(:disabled){border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-date-input:focus{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-date-input:disabled{background-color:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);cursor:not-allowed}.rpt-date-input.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-date-input.rpt-invalid:focus{box-shadow:0 0 0 3px #ef444440}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"] }]
|
|
5045
|
+
}] });
|
|
5046
|
+
|
|
5047
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
5048
|
+
const formatYMD = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
5049
|
+
class RptDateRangeComponent {
|
|
5050
|
+
config = input.required();
|
|
5051
|
+
control = input();
|
|
5052
|
+
fallbackControl = new FormControl(null);
|
|
5053
|
+
formControl = computed(() => this.control() ?? this.fallbackControl);
|
|
5054
|
+
elementId = computed(() => this.config().key || this.config().id);
|
|
5055
|
+
minDate = computed(() => this.config().properties?.['minDate'] || null);
|
|
5056
|
+
maxDate = computed(() => this.config().properties?.['maxDate'] || null);
|
|
5057
|
+
showPresets = computed(() => this.config().properties?.['showPresets'] !== false);
|
|
5058
|
+
presets = [
|
|
5059
|
+
{ id: 'today', label: 'Today' },
|
|
5060
|
+
{ id: 'yesterday', label: 'Yesterday' },
|
|
5061
|
+
{ id: 'thisWeek', label: 'This Week' },
|
|
5062
|
+
{ id: 'thisMonth', label: 'This Month' },
|
|
5063
|
+
{ id: 'lastMonth', label: 'Last Month' },
|
|
5064
|
+
{ id: 'thisQuarter', label: 'This Quarter' },
|
|
5065
|
+
{ id: 'ytd', label: 'YTD' },
|
|
5066
|
+
];
|
|
5067
|
+
fromDate = signal('');
|
|
5068
|
+
toDate = signal('');
|
|
5069
|
+
activePreset = signal('custom');
|
|
5070
|
+
hasValue = computed(() => !!(this.fromDate() || this.toDate()));
|
|
5071
|
+
rangeError = computed(() => {
|
|
5072
|
+
const f = this.fromDate();
|
|
5073
|
+
const t = this.toDate();
|
|
5074
|
+
if (f && t && f > t) {
|
|
5075
|
+
return `'From' date cannot be after 'To' date`;
|
|
5076
|
+
}
|
|
5077
|
+
return '';
|
|
5078
|
+
});
|
|
5079
|
+
isInvalid = computed(() => {
|
|
5080
|
+
const ctrl = this.formControl();
|
|
5081
|
+
return (ctrl.invalid && (ctrl.dirty || ctrl.touched)) || !!this.rangeError();
|
|
5082
|
+
});
|
|
5083
|
+
errorMessage = computed(() => {
|
|
5084
|
+
const ctrl = this.formControl();
|
|
5085
|
+
if (!ctrl.invalid || (!ctrl.dirty && !ctrl.touched)) {
|
|
5086
|
+
return '';
|
|
5087
|
+
}
|
|
5088
|
+
const errors = ctrl.errors;
|
|
5089
|
+
if (!errors)
|
|
5090
|
+
return '';
|
|
5091
|
+
const firstKey = Object.keys(errors)[0];
|
|
5092
|
+
return getValidationMessage(this.config().validation, firstKey);
|
|
5093
|
+
});
|
|
5094
|
+
controlSub;
|
|
5095
|
+
constructor() {
|
|
5096
|
+
effect(() => {
|
|
5097
|
+
const ctrl = this.formControl();
|
|
5098
|
+
untracked(() => this.syncControlValue(ctrl.value));
|
|
5099
|
+
this.controlSub?.unsubscribe();
|
|
5100
|
+
this.controlSub = ctrl.valueChanges.subscribe((v) => this.syncControlValue(v));
|
|
5101
|
+
}, { allowSignalWrites: true });
|
|
5102
|
+
}
|
|
5103
|
+
ngOnInit() {
|
|
5104
|
+
const defaultPreset = this.config().properties?.['defaultPreset'];
|
|
5105
|
+
if (defaultPreset && !this.formControl().value) {
|
|
5106
|
+
this.applyPreset(defaultPreset);
|
|
5107
|
+
}
|
|
5108
|
+
}
|
|
5109
|
+
ngOnDestroy() {
|
|
5110
|
+
this.controlSub?.unsubscribe();
|
|
5111
|
+
}
|
|
5112
|
+
syncControlValue(val) {
|
|
5113
|
+
if (val && typeof val === 'object' && 'from' in val) {
|
|
5114
|
+
const drv = val;
|
|
5115
|
+
this.fromDate.set(drv.from || '');
|
|
5116
|
+
this.toDate.set(drv.to || '');
|
|
5117
|
+
if (drv.preset) {
|
|
5118
|
+
this.activePreset.set(drv.preset);
|
|
5119
|
+
}
|
|
5120
|
+
}
|
|
5121
|
+
else if (typeof val === 'string' && val.includes(',')) {
|
|
5122
|
+
const [f, t] = val.split(',');
|
|
5123
|
+
this.fromDate.set(f?.trim() || '');
|
|
5124
|
+
this.toDate.set(t?.trim() || '');
|
|
5125
|
+
}
|
|
5126
|
+
else if (!val) {
|
|
5127
|
+
this.fromDate.set('');
|
|
5128
|
+
this.toDate.set('');
|
|
5129
|
+
this.activePreset.set('custom');
|
|
5130
|
+
}
|
|
5131
|
+
}
|
|
5132
|
+
applyPreset(presetId) {
|
|
5133
|
+
const now = new Date();
|
|
5134
|
+
let from = '';
|
|
5135
|
+
let to = '';
|
|
5136
|
+
switch (presetId) {
|
|
5137
|
+
case 'today':
|
|
5138
|
+
from = formatYMD(now);
|
|
5139
|
+
to = formatYMD(now);
|
|
5140
|
+
break;
|
|
5141
|
+
case 'yesterday': {
|
|
5142
|
+
const y = new Date(now);
|
|
5143
|
+
y.setDate(y.getDate() - 1);
|
|
5144
|
+
from = formatYMD(y);
|
|
5145
|
+
to = formatYMD(y);
|
|
5146
|
+
break;
|
|
5147
|
+
}
|
|
5148
|
+
case 'thisWeek': {
|
|
5149
|
+
const day = now.getDay();
|
|
5150
|
+
const diff = now.getDate() - day + (day === 0 ? -6 : 1); // Monday
|
|
5151
|
+
const monday = new Date(now);
|
|
5152
|
+
monday.setDate(diff);
|
|
5153
|
+
from = formatYMD(monday);
|
|
5154
|
+
to = formatYMD(now);
|
|
5155
|
+
break;
|
|
5156
|
+
}
|
|
5157
|
+
case 'thisMonth':
|
|
5158
|
+
from = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-01`;
|
|
5159
|
+
to = formatYMD(new Date(now.getFullYear(), now.getMonth() + 1, 0));
|
|
5160
|
+
break;
|
|
5161
|
+
case 'lastMonth': {
|
|
5162
|
+
const lastMonthEnd = new Date(now.getFullYear(), now.getMonth(), 0);
|
|
5163
|
+
from = `${lastMonthEnd.getFullYear()}-${pad(lastMonthEnd.getMonth() + 1)}-01`;
|
|
5164
|
+
to = formatYMD(lastMonthEnd);
|
|
5165
|
+
break;
|
|
5166
|
+
}
|
|
5167
|
+
case 'thisQuarter': {
|
|
5168
|
+
const currentQuarter = Math.floor(now.getMonth() / 3);
|
|
5169
|
+
const startMonth = currentQuarter * 3;
|
|
5170
|
+
const endMonth = startMonth + 2;
|
|
5171
|
+
from = `${now.getFullYear()}-${pad(startMonth + 1)}-01`;
|
|
5172
|
+
to = formatYMD(new Date(now.getFullYear(), endMonth + 1, 0));
|
|
5173
|
+
break;
|
|
5174
|
+
}
|
|
5175
|
+
case 'ytd':
|
|
5176
|
+
from = `${now.getFullYear()}-01-01`;
|
|
5177
|
+
to = formatYMD(now);
|
|
5178
|
+
break;
|
|
5179
|
+
default:
|
|
5180
|
+
return;
|
|
5181
|
+
}
|
|
5182
|
+
this.fromDate.set(from);
|
|
5183
|
+
this.toDate.set(to);
|
|
5184
|
+
this.activePreset.set(presetId);
|
|
5185
|
+
this.emitRangeChange({ from, to, preset: presetId });
|
|
5186
|
+
}
|
|
5187
|
+
onFromChange(event) {
|
|
5188
|
+
const from = event.target.value;
|
|
5189
|
+
this.fromDate.set(from);
|
|
5190
|
+
this.activePreset.set('custom');
|
|
5191
|
+
this.emitRangeChange({ from, to: this.toDate(), preset: 'custom' });
|
|
5192
|
+
}
|
|
5193
|
+
onToChange(event) {
|
|
5194
|
+
const to = event.target.value;
|
|
5195
|
+
this.toDate.set(to);
|
|
5196
|
+
this.activePreset.set('custom');
|
|
5197
|
+
this.emitRangeChange({ from: this.fromDate(), to, preset: 'custom' });
|
|
5198
|
+
}
|
|
5199
|
+
clearRange(event) {
|
|
5200
|
+
event.stopPropagation();
|
|
5201
|
+
this.fromDate.set('');
|
|
5202
|
+
this.toDate.set('');
|
|
5203
|
+
this.activePreset.set('custom');
|
|
5204
|
+
this.formControl().setValue(null);
|
|
5205
|
+
this.formControl().markAsDirty();
|
|
5206
|
+
this.formControl().markAsTouched();
|
|
5207
|
+
}
|
|
5208
|
+
emitRangeChange(range) {
|
|
5209
|
+
this.formControl().setValue(range);
|
|
5210
|
+
this.formControl().markAsDirty();
|
|
5211
|
+
this.formControl().markAsTouched();
|
|
5212
|
+
}
|
|
5213
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5214
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptDateRangeComponent, isStandalone: true, selector: "rpt-date-range", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
5215
|
+
<div class="rpt-field-group">
|
|
5216
|
+
<!-- Header with Label & Preset Bar -->
|
|
5217
|
+
<div class="rpt-label-row">
|
|
5218
|
+
@if (config().label) {
|
|
5219
|
+
<label [for]="elementId() + '_from'" class="rpt-label">
|
|
5220
|
+
{{ config().label }}
|
|
5221
|
+
@if (config().validation?.required) {
|
|
5222
|
+
<span class="rpt-required-marker">*</span>
|
|
5223
|
+
}
|
|
5224
|
+
</label>
|
|
5225
|
+
}
|
|
5226
|
+
|
|
5227
|
+
@if (showPresets()) {
|
|
5228
|
+
<div class="rpt-preset-pills" role="toolbar" aria-label="Date presets">
|
|
5229
|
+
@for (p of presets; track p.id) {
|
|
5230
|
+
<button
|
|
5231
|
+
type="button"
|
|
5232
|
+
class="rpt-preset-pill"
|
|
5233
|
+
[class.is-active]="activePreset() === p.id"
|
|
5234
|
+
[disabled]="formControl().disabled"
|
|
5235
|
+
(click)="applyPreset(p.id)"
|
|
5236
|
+
>
|
|
5237
|
+
{{ p.label }}
|
|
5238
|
+
</button>
|
|
5239
|
+
}
|
|
5240
|
+
</div>
|
|
5241
|
+
}
|
|
5242
|
+
</div>
|
|
5243
|
+
|
|
5244
|
+
<!-- Date Inputs Container -->
|
|
5245
|
+
<div class="rpt-date-range-container" [class.rpt-invalid]="isInvalid()">
|
|
5246
|
+
<!-- From Field -->
|
|
5247
|
+
<div class="rpt-date-subfield">
|
|
5248
|
+
<span class="rpt-date-prefix">From</span>
|
|
5249
|
+
<input
|
|
5250
|
+
[id]="elementId() + '_from'"
|
|
5251
|
+
type="date"
|
|
5252
|
+
class="rpt-date-input"
|
|
5253
|
+
[value]="fromDate()"
|
|
5254
|
+
[disabled]="formControl().disabled"
|
|
5255
|
+
[min]="minDate()"
|
|
5256
|
+
[max]="maxDate()"
|
|
5257
|
+
(input)="onFromChange($event)"
|
|
5258
|
+
/>
|
|
5259
|
+
</div>
|
|
5260
|
+
|
|
5261
|
+
<span class="rpt-range-separator" aria-hidden="true">→</span>
|
|
5262
|
+
|
|
5263
|
+
<!-- To Field -->
|
|
5264
|
+
<div class="rpt-date-subfield">
|
|
5265
|
+
<span class="rpt-date-prefix">To</span>
|
|
5266
|
+
<input
|
|
5267
|
+
[id]="elementId() + '_to'"
|
|
5268
|
+
type="date"
|
|
5269
|
+
class="rpt-date-input"
|
|
5270
|
+
[value]="toDate()"
|
|
5271
|
+
[disabled]="formControl().disabled"
|
|
5272
|
+
[min]="fromDate() || minDate()"
|
|
5273
|
+
[max]="maxDate()"
|
|
5274
|
+
(input)="onToChange($event)"
|
|
5275
|
+
/>
|
|
5276
|
+
</div>
|
|
5277
|
+
|
|
5278
|
+
<!-- Quick Clear Button -->
|
|
5279
|
+
@if (hasValue() && !formControl().disabled) {
|
|
5280
|
+
<button
|
|
5281
|
+
type="button"
|
|
5282
|
+
class="rpt-range-clear-btn"
|
|
5283
|
+
title="Clear date range"
|
|
5284
|
+
aria-label="Clear date range"
|
|
5285
|
+
(click)="clearRange($event)"
|
|
5286
|
+
>
|
|
5287
|
+
✕
|
|
5288
|
+
</button>
|
|
5289
|
+
}
|
|
5290
|
+
</div>
|
|
5291
|
+
|
|
5292
|
+
@if (rangeError()) {
|
|
5293
|
+
<span class="rpt-error-text">{{ rangeError() }}</span>
|
|
5294
|
+
} @else if (errorMessage()) {
|
|
5295
|
+
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
5296
|
+
}
|
|
5297
|
+
</div>
|
|
5298
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:5px;box-sizing:border-box}.rpt-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-preset-pills{display:inline-flex;align-items:center;gap:3px;flex-wrap:wrap}.rpt-preset-pill{border:1px solid var(--rpt-color-border, #cbd5e1);background:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);font-size:.6875rem;font-weight:500;padding:1px 7px;border-radius:12px;cursor:pointer;line-height:1.4;transition:all .12s ease}.rpt-preset-pill:hover:not(:disabled){border-color:var(--rpt-color-primary, #2563eb);color:var(--rpt-color-primary, #2563eb);background:#eff6ff}.rpt-preset-pill.is-active{background:var(--rpt-color-primary, #2563eb);border-color:var(--rpt-color-primary, #2563eb);color:#fff;font-weight:600}.rpt-preset-pill:disabled{cursor:not-allowed;opacity:.5}.rpt-date-range-container{display:flex;align-items:center;gap:8px;width:100%;flex:1;min-height:38px;box-sizing:border-box;padding:3px 8px;background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease}.rpt-date-range-container:focus-within{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-date-range-container.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-date-subfield{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.rpt-date-prefix{font-size:.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--rpt-color-text-muted, #94a3b8);-webkit-user-select:none;user-select:none}.rpt-date-input{width:100%;border:none;outline:none;background:transparent;font-size:var(--rpt-font-size-base, .84rem);font-family:inherit;color:var(--rpt-color-text, #0f172a);min-width:0;padding:4px 0}.rpt-date-input:disabled{color:var(--rpt-color-text-muted, #94a3b8);cursor:not-allowed}.rpt-range-separator{color:var(--rpt-color-text-muted, #94a3b8);font-size:.8125rem;-webkit-user-select:none;user-select:none;padding:0 2px}.rpt-range-clear-btn{border:none;background:#f1f5f9;color:var(--rpt-color-text-muted, #64748b);width:18px;height:18px;border-radius:50%;font-size:.6875rem;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;transition:background-color .15s ease,color .15s ease}.rpt-range-clear-btn:hover{background-color:#e2e8f0;color:var(--rpt-color-text, #0f172a)}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5299
|
+
}
|
|
5300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptDateRangeComponent, decorators: [{
|
|
5301
|
+
type: Component,
|
|
5302
|
+
args: [{ selector: 'rpt-date-range', standalone: true, imports: [ReactiveFormsModule], template: `
|
|
5303
|
+
<div class="rpt-field-group">
|
|
5304
|
+
<!-- Header with Label & Preset Bar -->
|
|
5305
|
+
<div class="rpt-label-row">
|
|
5306
|
+
@if (config().label) {
|
|
5307
|
+
<label [for]="elementId() + '_from'" class="rpt-label">
|
|
5308
|
+
{{ config().label }}
|
|
5309
|
+
@if (config().validation?.required) {
|
|
5310
|
+
<span class="rpt-required-marker">*</span>
|
|
5311
|
+
}
|
|
5312
|
+
</label>
|
|
5313
|
+
}
|
|
5314
|
+
|
|
5315
|
+
@if (showPresets()) {
|
|
5316
|
+
<div class="rpt-preset-pills" role="toolbar" aria-label="Date presets">
|
|
5317
|
+
@for (p of presets; track p.id) {
|
|
5318
|
+
<button
|
|
5319
|
+
type="button"
|
|
5320
|
+
class="rpt-preset-pill"
|
|
5321
|
+
[class.is-active]="activePreset() === p.id"
|
|
5322
|
+
[disabled]="formControl().disabled"
|
|
5323
|
+
(click)="applyPreset(p.id)"
|
|
5324
|
+
>
|
|
5325
|
+
{{ p.label }}
|
|
5326
|
+
</button>
|
|
5327
|
+
}
|
|
5328
|
+
</div>
|
|
5329
|
+
}
|
|
5330
|
+
</div>
|
|
5331
|
+
|
|
5332
|
+
<!-- Date Inputs Container -->
|
|
5333
|
+
<div class="rpt-date-range-container" [class.rpt-invalid]="isInvalid()">
|
|
5334
|
+
<!-- From Field -->
|
|
5335
|
+
<div class="rpt-date-subfield">
|
|
5336
|
+
<span class="rpt-date-prefix">From</span>
|
|
5337
|
+
<input
|
|
5338
|
+
[id]="elementId() + '_from'"
|
|
5339
|
+
type="date"
|
|
5340
|
+
class="rpt-date-input"
|
|
5341
|
+
[value]="fromDate()"
|
|
5342
|
+
[disabled]="formControl().disabled"
|
|
5343
|
+
[min]="minDate()"
|
|
5344
|
+
[max]="maxDate()"
|
|
5345
|
+
(input)="onFromChange($event)"
|
|
5346
|
+
/>
|
|
5347
|
+
</div>
|
|
5348
|
+
|
|
5349
|
+
<span class="rpt-range-separator" aria-hidden="true">→</span>
|
|
5350
|
+
|
|
5351
|
+
<!-- To Field -->
|
|
5352
|
+
<div class="rpt-date-subfield">
|
|
5353
|
+
<span class="rpt-date-prefix">To</span>
|
|
5354
|
+
<input
|
|
5355
|
+
[id]="elementId() + '_to'"
|
|
5356
|
+
type="date"
|
|
5357
|
+
class="rpt-date-input"
|
|
5358
|
+
[value]="toDate()"
|
|
5359
|
+
[disabled]="formControl().disabled"
|
|
5360
|
+
[min]="fromDate() || minDate()"
|
|
5361
|
+
[max]="maxDate()"
|
|
5362
|
+
(input)="onToChange($event)"
|
|
5363
|
+
/>
|
|
5364
|
+
</div>
|
|
5365
|
+
|
|
5366
|
+
<!-- Quick Clear Button -->
|
|
5367
|
+
@if (hasValue() && !formControl().disabled) {
|
|
5368
|
+
<button
|
|
5369
|
+
type="button"
|
|
5370
|
+
class="rpt-range-clear-btn"
|
|
5371
|
+
title="Clear date range"
|
|
5372
|
+
aria-label="Clear date range"
|
|
5373
|
+
(click)="clearRange($event)"
|
|
5374
|
+
>
|
|
5375
|
+
✕
|
|
5376
|
+
</button>
|
|
5377
|
+
}
|
|
5378
|
+
</div>
|
|
5379
|
+
|
|
5380
|
+
@if (rangeError()) {
|
|
5381
|
+
<span class="rpt-error-text">{{ rangeError() }}</span>
|
|
5382
|
+
} @else if (errorMessage()) {
|
|
5383
|
+
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
5384
|
+
}
|
|
5385
|
+
</div>
|
|
5386
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:5px;box-sizing:border-box}.rpt-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-preset-pills{display:inline-flex;align-items:center;gap:3px;flex-wrap:wrap}.rpt-preset-pill{border:1px solid var(--rpt-color-border, #cbd5e1);background:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);font-size:.6875rem;font-weight:500;padding:1px 7px;border-radius:12px;cursor:pointer;line-height:1.4;transition:all .12s ease}.rpt-preset-pill:hover:not(:disabled){border-color:var(--rpt-color-primary, #2563eb);color:var(--rpt-color-primary, #2563eb);background:#eff6ff}.rpt-preset-pill.is-active{background:var(--rpt-color-primary, #2563eb);border-color:var(--rpt-color-primary, #2563eb);color:#fff;font-weight:600}.rpt-preset-pill:disabled{cursor:not-allowed;opacity:.5}.rpt-date-range-container{display:flex;align-items:center;gap:8px;width:100%;flex:1;min-height:38px;box-sizing:border-box;padding:3px 8px;background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease}.rpt-date-range-container:focus-within{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-date-range-container.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-date-subfield{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.rpt-date-prefix{font-size:.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--rpt-color-text-muted, #94a3b8);-webkit-user-select:none;user-select:none}.rpt-date-input{width:100%;border:none;outline:none;background:transparent;font-size:var(--rpt-font-size-base, .84rem);font-family:inherit;color:var(--rpt-color-text, #0f172a);min-width:0;padding:4px 0}.rpt-date-input:disabled{color:var(--rpt-color-text-muted, #94a3b8);cursor:not-allowed}.rpt-range-separator{color:var(--rpt-color-text-muted, #94a3b8);font-size:.8125rem;-webkit-user-select:none;user-select:none;padding:0 2px}.rpt-range-clear-btn{border:none;background:#f1f5f9;color:var(--rpt-color-text-muted, #64748b);width:18px;height:18px;border-radius:50%;font-size:.6875rem;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;transition:background-color .15s ease,color .15s ease}.rpt-range-clear-btn:hover{background-color:#e2e8f0;color:var(--rpt-color-text, #0f172a)}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"] }]
|
|
5387
|
+
}], ctorParameters: () => [] });
|
|
5388
|
+
|
|
5389
|
+
class RptNumberComponent {
|
|
5390
|
+
config = input.required();
|
|
5391
|
+
control = input();
|
|
5392
|
+
fallbackControl = new FormControl(null);
|
|
5393
|
+
formControl = computed(() => this.control() ?? this.fallbackControl);
|
|
5394
|
+
elementId = computed(() => this.config().key || this.config().id);
|
|
5395
|
+
placeholder = computed(() => this.config().properties?.['placeholder'] || '');
|
|
5396
|
+
prefix = computed(() => this.config().properties?.['prefix'] || '');
|
|
5397
|
+
suffix = computed(() => this.config().properties?.['suffix'] || '');
|
|
5398
|
+
minVal = computed(() => this.config().validation?.min ?? this.config().properties?.['min'] ?? null);
|
|
5399
|
+
maxVal = computed(() => this.config().validation?.max ?? this.config().properties?.['max'] ?? null);
|
|
5400
|
+
stepVal = computed(() => this.config().properties?.['step'] ?? 1);
|
|
5401
|
+
isInvalid = computed(() => {
|
|
5402
|
+
const ctrl = this.formControl();
|
|
5403
|
+
return ctrl.invalid && (ctrl.dirty || ctrl.touched);
|
|
5404
|
+
});
|
|
5405
|
+
errorMessage = computed(() => {
|
|
5406
|
+
const ctrl = this.formControl();
|
|
5407
|
+
if (!ctrl.invalid || (!ctrl.dirty && !ctrl.touched)) {
|
|
5408
|
+
return '';
|
|
5409
|
+
}
|
|
5410
|
+
const errors = ctrl.errors;
|
|
5411
|
+
if (!errors)
|
|
5412
|
+
return '';
|
|
5413
|
+
const firstKey = Object.keys(errors)[0];
|
|
5414
|
+
return getValidationMessage(this.config().validation, firstKey);
|
|
5415
|
+
});
|
|
5416
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5417
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptNumberComponent, isStandalone: true, selector: "rpt-number", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
5418
|
+
<div class="rpt-field-group">
|
|
5419
|
+
@if (config().label) {
|
|
5420
|
+
<label [for]="elementId()" class="rpt-label">
|
|
5421
|
+
{{ config().label }}
|
|
5422
|
+
@if (config().validation?.required) {
|
|
5423
|
+
<span class="rpt-required-marker">*</span>
|
|
5424
|
+
}
|
|
5425
|
+
</label>
|
|
5426
|
+
}
|
|
5427
|
+
|
|
5428
|
+
<div class="rpt-input-wrapper" [class.has-prefix]="prefix()" [class.has-suffix]="suffix()">
|
|
5429
|
+
@if (prefix()) {
|
|
5430
|
+
<span class="rpt-affix rpt-prefix">{{ prefix() }}</span>
|
|
5431
|
+
}
|
|
5432
|
+
<input
|
|
5433
|
+
[id]="elementId()"
|
|
5434
|
+
type="number"
|
|
5435
|
+
(wheel)="$any($event.target).blur()"
|
|
5436
|
+
(keydown.arrowup)="$event.preventDefault()"
|
|
5437
|
+
(keydown.arrowdown)="$event.preventDefault()"
|
|
5438
|
+
[formControl]="formControl()"
|
|
5439
|
+
[min]="minVal()"
|
|
5440
|
+
[max]="maxVal()"
|
|
5441
|
+
[step]="stepVal()"
|
|
5442
|
+
[placeholder]="placeholder()"
|
|
5443
|
+
[class.rpt-invalid]="isInvalid()"
|
|
5444
|
+
class="rpt-number-input"
|
|
5445
|
+
/>
|
|
5446
|
+
@if (suffix()) {
|
|
5447
|
+
<span class="rpt-affix rpt-suffix">{{ suffix() }}</span>
|
|
5448
|
+
}
|
|
5449
|
+
</div>
|
|
5450
|
+
|
|
5451
|
+
@if (errorMessage()) {
|
|
5452
|
+
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
5453
|
+
}
|
|
5454
|
+
</div>
|
|
5455
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:4px;box-sizing:border-box}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-input-wrapper{position:relative;display:flex;align-items:stretch;width:100%;flex:1;min-height:0}.rpt-affix{font-size:var(--rpt-font-size-sm, .75rem);color:var(--rpt-color-text-muted, #64748b);background-color:var(--rpt-color-surface, #f8fafc);padding:0 10px;height:100%;min-height:38px;display:flex;align-items:center;border:1px solid var(--rpt-color-border, #cbd5e1);-webkit-user-select:none;user-select:none;box-sizing:border-box}.rpt-prefix{border-right:none;border-top-left-radius:var(--rpt-border-radius, 6px);border-bottom-left-radius:var(--rpt-border-radius, 6px)}.rpt-suffix{border-left:none;border-top-right-radius:var(--rpt-border-radius, 6px);border-bottom-right-radius:var(--rpt-border-radius, 6px)}.rpt-number-input::-webkit-inner-spin-button,.rpt-number-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.rpt-number-input{-moz-appearance:textfield;appearance:textfield;width:100%;box-sizing:border-box;height:100%;min-height:38px;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a);background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease;outline:none}.has-prefix .rpt-number-input{border-top-left-radius:0;border-bottom-left-radius:0}.has-suffix .rpt-number-input{border-top-right-radius:0;border-bottom-right-radius:0}.rpt-number-input:hover:not(:disabled){border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-number-input:focus{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-number-input:disabled{background-color:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);cursor:not-allowed}.rpt-number-input.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-number-input.rpt-invalid:focus{box-shadow:0 0 0 3px #ef444440}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5456
|
+
}
|
|
5457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptNumberComponent, decorators: [{
|
|
5458
|
+
type: Component,
|
|
5459
|
+
args: [{ selector: 'rpt-number', standalone: true, imports: [ReactiveFormsModule], template: `
|
|
5460
|
+
<div class="rpt-field-group">
|
|
5461
|
+
@if (config().label) {
|
|
5462
|
+
<label [for]="elementId()" class="rpt-label">
|
|
5463
|
+
{{ config().label }}
|
|
5464
|
+
@if (config().validation?.required) {
|
|
5465
|
+
<span class="rpt-required-marker">*</span>
|
|
5466
|
+
}
|
|
5467
|
+
</label>
|
|
5468
|
+
}
|
|
5469
|
+
|
|
5470
|
+
<div class="rpt-input-wrapper" [class.has-prefix]="prefix()" [class.has-suffix]="suffix()">
|
|
5471
|
+
@if (prefix()) {
|
|
5472
|
+
<span class="rpt-affix rpt-prefix">{{ prefix() }}</span>
|
|
5473
|
+
}
|
|
5474
|
+
<input
|
|
5475
|
+
[id]="elementId()"
|
|
5476
|
+
type="number"
|
|
5477
|
+
(wheel)="$any($event.target).blur()"
|
|
5478
|
+
(keydown.arrowup)="$event.preventDefault()"
|
|
5479
|
+
(keydown.arrowdown)="$event.preventDefault()"
|
|
5480
|
+
[formControl]="formControl()"
|
|
5481
|
+
[min]="minVal()"
|
|
5482
|
+
[max]="maxVal()"
|
|
5483
|
+
[step]="stepVal()"
|
|
5484
|
+
[placeholder]="placeholder()"
|
|
5485
|
+
[class.rpt-invalid]="isInvalid()"
|
|
5486
|
+
class="rpt-number-input"
|
|
5487
|
+
/>
|
|
5488
|
+
@if (suffix()) {
|
|
5489
|
+
<span class="rpt-affix rpt-suffix">{{ suffix() }}</span>
|
|
5490
|
+
}
|
|
5491
|
+
</div>
|
|
5492
|
+
|
|
5493
|
+
@if (errorMessage()) {
|
|
5494
|
+
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
5495
|
+
}
|
|
5496
|
+
</div>
|
|
5497
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-field-group{display:flex;flex-direction:column;height:100%;gap:4px;box-sizing:border-box}.rpt-label{font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;color:var(--rpt-color-text, #0f172a);flex-shrink:0}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-input-wrapper{position:relative;display:flex;align-items:stretch;width:100%;flex:1;min-height:0}.rpt-affix{font-size:var(--rpt-font-size-sm, .75rem);color:var(--rpt-color-text-muted, #64748b);background-color:var(--rpt-color-surface, #f8fafc);padding:0 10px;height:100%;min-height:38px;display:flex;align-items:center;border:1px solid var(--rpt-color-border, #cbd5e1);-webkit-user-select:none;user-select:none;box-sizing:border-box}.rpt-prefix{border-right:none;border-top-left-radius:var(--rpt-border-radius, 6px);border-bottom-left-radius:var(--rpt-border-radius, 6px)}.rpt-suffix{border-left:none;border-top-right-radius:var(--rpt-border-radius, 6px);border-bottom-right-radius:var(--rpt-border-radius, 6px)}.rpt-number-input::-webkit-inner-spin-button,.rpt-number-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.rpt-number-input{-moz-appearance:textfield;appearance:textfield;width:100%;box-sizing:border-box;height:100%;min-height:38px;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a);background-color:var(--rpt-color-bg, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);transition:border-color var(--rpt-transition-speed, .15s) ease,box-shadow var(--rpt-transition-speed, .15s) ease;outline:none}.has-prefix .rpt-number-input{border-top-left-radius:0;border-bottom-left-radius:0}.has-suffix .rpt-number-input{border-top-right-radius:0;border-bottom-right-radius:0}.rpt-number-input:hover:not(:disabled){border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-number-input:focus{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-number-input:disabled{background-color:var(--rpt-color-surface, #f8fafc);color:var(--rpt-color-text-muted, #64748b);cursor:not-allowed}.rpt-number-input.rpt-invalid{border-color:var(--rpt-color-danger, #ef4444)}.rpt-number-input.rpt-invalid:focus{box-shadow:0 0 0 3px #ef444440}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"] }]
|
|
5498
|
+
}] });
|
|
5499
|
+
|
|
5500
|
+
class RptCheckboxComponent {
|
|
5501
|
+
config = input.required();
|
|
5502
|
+
control = input();
|
|
5503
|
+
fallbackControl = new FormControl(false);
|
|
5504
|
+
formControl = computed(() => this.control() ?? this.fallbackControl);
|
|
5505
|
+
elementId = computed(() => this.config().key || this.config().id);
|
|
5506
|
+
isInvalid = computed(() => {
|
|
5507
|
+
const ctrl = this.formControl();
|
|
5508
|
+
return ctrl.invalid && (ctrl.dirty || ctrl.touched);
|
|
5509
|
+
});
|
|
5510
|
+
errorMessage = computed(() => {
|
|
5511
|
+
const ctrl = this.formControl();
|
|
5512
|
+
if (!ctrl.invalid || (!ctrl.dirty && !ctrl.touched)) {
|
|
5513
|
+
return '';
|
|
5514
|
+
}
|
|
5515
|
+
const errors = ctrl.errors;
|
|
5516
|
+
if (!errors)
|
|
5517
|
+
return '';
|
|
5518
|
+
const firstKey = Object.keys(errors)[0];
|
|
5519
|
+
return getValidationMessage(this.config().validation, firstKey);
|
|
5520
|
+
});
|
|
5521
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5522
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RptCheckboxComponent, isStandalone: true, selector: "rpt-checkbox", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
5523
|
+
<div class="rpt-checkbox-field">
|
|
5524
|
+
<label [for]="elementId()" class="rpt-checkbox-label">
|
|
5525
|
+
<input
|
|
5526
|
+
[id]="elementId()"
|
|
5527
|
+
type="checkbox"
|
|
5528
|
+
[formControl]="formControl()"
|
|
5529
|
+
class="rpt-checkbox-input"
|
|
5530
|
+
/>
|
|
5531
|
+
<span class="rpt-custom-checkbox" aria-hidden="true">
|
|
5532
|
+
<svg class="rpt-check-icon" width="12" height="10" viewBox="0 0 12 10" fill="none">
|
|
5533
|
+
<path d="M1 5L4.5 8.5L11 1.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5534
|
+
</svg>
|
|
5535
|
+
</span>
|
|
5536
|
+
<span class="rpt-checkbox-text">
|
|
5537
|
+
{{ config().label }}
|
|
5538
|
+
@if (config().validation?.required) {
|
|
5539
|
+
<span class="rpt-required-marker">*</span>
|
|
5540
|
+
}
|
|
5541
|
+
</span>
|
|
5542
|
+
</label>
|
|
5543
|
+
|
|
5544
|
+
@if (errorMessage()) {
|
|
5545
|
+
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
5546
|
+
}
|
|
5547
|
+
</div>
|
|
5548
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-checkbox-field{display:flex;flex-direction:column;justify-content:flex-end;height:100%;gap:4px;padding-bottom:8px;box-sizing:border-box}.rpt-checkbox-label{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none}.rpt-checkbox-input{position:absolute;opacity:0;width:0;height:0;margin:0}.rpt-custom-checkbox{width:18px;height:18px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-sm, 4px);background-color:var(--rpt-color-bg, #ffffff);display:flex;align-items:center;justify-content:center;transition:all var(--rpt-transition-speed, .15s) ease;color:var(--rpt-color-text-inverse, #ffffff);flex-shrink:0}.rpt-checkbox-label:hover .rpt-custom-checkbox{border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-checkbox-input:focus-visible+.rpt-custom-checkbox{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-checkbox-input:checked+.rpt-custom-checkbox{background-color:var(--rpt-color-primary, #2563eb);border-color:var(--rpt-color-primary, #2563eb)}.rpt-check-icon{opacity:0;transform:scale(.6);transition:all var(--rpt-transition-speed, .15s) ease}.rpt-checkbox-input:checked+.rpt-custom-checkbox .rpt-check-icon{opacity:1;transform:scale(1)}.rpt-checkbox-input:disabled+.rpt-custom-checkbox{background-color:var(--rpt-color-surface, #f8fafc);border-color:var(--rpt-color-border, #cbd5e1);cursor:not-allowed}.rpt-checkbox-text{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a)}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5549
|
+
}
|
|
5550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RptCheckboxComponent, decorators: [{
|
|
5551
|
+
type: Component,
|
|
5552
|
+
args: [{ selector: 'rpt-checkbox', standalone: true, imports: [ReactiveFormsModule], template: `
|
|
5553
|
+
<div class="rpt-checkbox-field">
|
|
5554
|
+
<label [for]="elementId()" class="rpt-checkbox-label">
|
|
5555
|
+
<input
|
|
5556
|
+
[id]="elementId()"
|
|
5557
|
+
type="checkbox"
|
|
5558
|
+
[formControl]="formControl()"
|
|
5559
|
+
class="rpt-checkbox-input"
|
|
5560
|
+
/>
|
|
5561
|
+
<span class="rpt-custom-checkbox" aria-hidden="true">
|
|
5562
|
+
<svg class="rpt-check-icon" width="12" height="10" viewBox="0 0 12 10" fill="none">
|
|
5563
|
+
<path d="M1 5L4.5 8.5L11 1.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5564
|
+
</svg>
|
|
5565
|
+
</span>
|
|
5566
|
+
<span class="rpt-checkbox-text">
|
|
5567
|
+
{{ config().label }}
|
|
5568
|
+
@if (config().validation?.required) {
|
|
5569
|
+
<span class="rpt-required-marker">*</span>
|
|
5570
|
+
}
|
|
5571
|
+
</span>
|
|
5572
|
+
</label>
|
|
5573
|
+
|
|
5574
|
+
@if (errorMessage()) {
|
|
5575
|
+
<span class="rpt-error-text">{{ errorMessage() }}</span>
|
|
5576
|
+
}
|
|
5577
|
+
</div>
|
|
5578
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;font-family:var(--rpt-font-family, inherit)}.rpt-checkbox-field{display:flex;flex-direction:column;justify-content:flex-end;height:100%;gap:4px;padding-bottom:8px;box-sizing:border-box}.rpt-checkbox-label{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none}.rpt-checkbox-input{position:absolute;opacity:0;width:0;height:0;margin:0}.rpt-custom-checkbox{width:18px;height:18px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-sm, 4px);background-color:var(--rpt-color-bg, #ffffff);display:flex;align-items:center;justify-content:center;transition:all var(--rpt-transition-speed, .15s) ease;color:var(--rpt-color-text-inverse, #ffffff);flex-shrink:0}.rpt-checkbox-label:hover .rpt-custom-checkbox{border-color:var(--rpt-color-border-hover, #94a3b8)}.rpt-checkbox-input:focus-visible+.rpt-custom-checkbox{border-color:var(--rpt-color-border-focus, #2563eb);box-shadow:var(--rpt-box-shadow-focus, 0 0 0 3px rgba(37, 99, 235, .25))}.rpt-checkbox-input:checked+.rpt-custom-checkbox{background-color:var(--rpt-color-primary, #2563eb);border-color:var(--rpt-color-primary, #2563eb)}.rpt-check-icon{opacity:0;transform:scale(.6);transition:all var(--rpt-transition-speed, .15s) ease}.rpt-checkbox-input:checked+.rpt-custom-checkbox .rpt-check-icon{opacity:1;transform:scale(1)}.rpt-checkbox-input:disabled+.rpt-custom-checkbox{background-color:var(--rpt-color-surface, #f8fafc);border-color:var(--rpt-color-border, #cbd5e1);cursor:not-allowed}.rpt-checkbox-text{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text, #0f172a)}.rpt-required-marker{color:var(--rpt-color-danger, #ef4444);margin-left:2px}.rpt-error-text{font-size:.7rem;color:var(--rpt-color-danger, #ef4444);margin-top:3px;line-height:1.25;max-width:100%;overflow-wrap:anywhere;word-break:break-word;display:block}\n"] }]
|
|
5579
|
+
}] });
|
|
5401
5580
|
|
|
5402
5581
|
class RptButtonComponent {
|
|
5403
5582
|
config = input.required();
|
|
@@ -6672,7 +6851,7 @@ class RptRadioComponent {
|
|
|
6672
6851
|
const isApi = ds.sourceType === 'api' || !!ds.apiEndpoint;
|
|
6673
6852
|
const isDbLookup = !!(ds.entityName && (ds.sourceType === 'table' || ds.sourceType === 'procedure'));
|
|
6674
6853
|
if ((isApi || isDbLookup) && this.lookupAdapter) {
|
|
6675
|
-
const formValues = this.parentForm()
|
|
6854
|
+
const formValues = this.parentForm() ? extractReportFormValues(this.parentForm()) : {};
|
|
6676
6855
|
const missing = findMissingCanvasFields(ds.parameterMappings, formValues);
|
|
6677
6856
|
if (missing.length > 0) {
|
|
6678
6857
|
this.lookupSub?.unsubscribe();
|
|
@@ -13798,7 +13977,18 @@ function matchesSearchQuery(item, rawQuery) {
|
|
|
13798
13977
|
|
|
13799
13978
|
class DesignCanvasComponent {
|
|
13800
13979
|
requests = new ReportRequestScope();
|
|
13980
|
+
formContext = inject(DesignerFormContextService, { optional: true });
|
|
13801
13981
|
constructor() {
|
|
13982
|
+
effect(onCleanup => {
|
|
13983
|
+
const form = this.canvasForm();
|
|
13984
|
+
untracked(() => this.formContext?.bind(form));
|
|
13985
|
+
const subscription = form.valueChanges.subscribe(() => {
|
|
13986
|
+
this.formContext?.refresh();
|
|
13987
|
+
if (this.gridExecError()?.startsWith('Missing required filter values:') && this.executionService.getMissingFields(this.definition(), this.formBuilder.extractValues(form)).length === 0)
|
|
13988
|
+
this.gridExecError.set(null);
|
|
13989
|
+
});
|
|
13990
|
+
onCleanup(() => subscription.unsubscribe());
|
|
13991
|
+
}, { allowSignalWrites: true });
|
|
13802
13992
|
let previous = '';
|
|
13803
13993
|
effect(() => {
|
|
13804
13994
|
const key = JSON.stringify([this.requests.context(), this.definition().id]);
|
|
@@ -13827,12 +14017,12 @@ class DesignCanvasComponent {
|
|
|
13827
14017
|
currentKeys.add(comp.key);
|
|
13828
14018
|
if (!this._stableCanvasForm.contains(comp.key)) {
|
|
13829
14019
|
const defaultVal = comp.properties?.['defaultValue'] ?? (comp.type === 'checkbox' ? false : '');
|
|
13830
|
-
this._stableCanvasForm.addControl(comp.key, new FormControl(defaultVal));
|
|
14020
|
+
this._stableCanvasForm.addControl(comp.key, new FormControl(defaultVal), { emitEvent: false });
|
|
13831
14021
|
}
|
|
13832
14022
|
}
|
|
13833
14023
|
for (const existingKey of Object.keys(this._stableCanvasForm.controls)) {
|
|
13834
14024
|
if (!currentKeys.has(existingKey)) {
|
|
13835
|
-
this._stableCanvasForm.removeControl(existingKey);
|
|
14025
|
+
this._stableCanvasForm.removeControl(existingKey, { emitEvent: false });
|
|
13836
14026
|
}
|
|
13837
14027
|
}
|
|
13838
14028
|
return this._stableCanvasForm;
|
|
@@ -14091,7 +14281,7 @@ class DesignCanvasComponent {
|
|
|
14091
14281
|
if (!this.definition().grid) {
|
|
14092
14282
|
this.addResultGrid();
|
|
14093
14283
|
}
|
|
14094
|
-
const formValues = this.
|
|
14284
|
+
const formValues = this.formBuilder.extractValues(this.canvasForm());
|
|
14095
14285
|
const missing = this.executionService.getMissingFields(this.definition(), formValues);
|
|
14096
14286
|
if (missing.length > 0) {
|
|
14097
14287
|
this.gridExecError.set('Missing required filter values: ' + missing.join(', ') + '. Please enter values above to run.');
|
|
@@ -14267,7 +14457,7 @@ class DesignCanvasComponent {
|
|
|
14267
14457
|
this.designerState.addComponent(type);
|
|
14268
14458
|
}
|
|
14269
14459
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignCanvasComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14270
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DesignCanvasComponent, isStandalone: true, selector: "rpt-design-canvas", host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: " <div class=\"canvas-wrapper\" (click)=\"onCanvasBackgroundClick($event)\">\n <!-- Canvas Status / Quick Controls -->\n <div class=\"canvas-toolbar\">\n <div class=\"canvas-info\">\n <span class=\"info-label\">Grid Layout:</span>\n <span class=\"info-value\">{{ totalColumns() }} Columns</span>\n <span class=\"info-divider\">\u2022</span>\n <span class=\"info-label\">Components:</span>\n <span class=\"info-value\">{{ components().length }}</span>\n <span class=\"info-divider\">\u2022</span>\n <span class=\"live-mode-badge\" title=\"Interactive canvas: Values typed here run live queries and test dropdowns.\">\n \u26A1 Live Interactive Mode\n </span>\n </div>\n\n <div class=\"canvas-actions\">\n @if (!definition().grid) {\n <button\n type=\"button\"\n class=\"canvas-action-btn btn-grid-add\"\n (click)=\"addResultGrid($event)\"\n title=\"Add a Result Grid to this report\"\n >\n <rpt-icon name=\"table\" [size]=\"14\" />\n <span>+ Add Grid</span>\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"canvas-action-btn btn-grid-configured\"\n (click)=\"selectGridSettings($event)\"\n title=\"Configure Result Data Grid\"\n >\n <rpt-icon name=\"table\" [size]=\"14\" />\n <span>Grid ({{ definition().grid?.columns?.length ?? 0 }})</span>\n </button>\n }\n\n <button\n type=\"button\"\n class=\"canvas-action-btn\"\n (click)=\"selectReportSettings($event)\"\n title=\"Configure Page Layout & Grid Settings\"\n >\n <rpt-icon name=\"settings\" [size]=\"14\" />\n <span>Report Settings</span>\n </button>\n </div>\n </div>\n\n <!-- Canvas Drop Area -->\n <div class=\"canvas-scroll-area\" cdkScrollable>\n <div\n class=\"canvas-artboard\"\n [style.padding.px]=\"definition().layout.padding ?? 24\"\n >\n <!-- Report Header Preview -->\n <div class=\"canvas-report-header\">\n <h2 class=\"canvas-report-title\">{{ definition().name || 'Untitled Report' }}</h2>\n @if (definition().description) {\n <p class=\"canvas-report-desc\">{{ definition().description }}</p>\n }\n </div>\n\n <!-- Component Drop List Grid with 2D mixed orientation and data binding -->\n <div\n cdkDropList\n id=\"designer-canvas-drop-list\"\n class=\"canvas-grid\"\n cdkDropListOrientation=\"mixed\"\n [cdkDropListData]=\"sortedComponents()\"\n [style.grid-template-columns]=\"gridTemplateColumns()\"\n [style.gap.px]=\"definition().layout.gap ?? 16\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n @for (comp of sortedComponents(); track comp.id; let idx = $index) {\n <div\n cdkDrag\n [cdkDragData]=\"comp\"\n [cdkDragDisabled]=\"isAnyResizing()\"\n class=\"canvas-component-card\"\n [class.is-selected]=\"isSelected(comp.id)\"\n [class.is-resizing]=\"resizingCompId() === comp.id\"\n [class.is-field-highlighted]=\"isFieldHighlighted(comp)\"\n [class.is-narrow]=\"getSpan(comp) <= 4\"\n [class.is-compact]=\"getSpan(comp) <= 2\"\n [style.grid-column]=\"getGridColumn(comp)\"\n [style.grid-row]=\"getGridRow(comp)\"\n [style.width]=\"comp.layout?.width || 'auto'\"\n [style.height]=\"getComponentHeight(comp)\"\n [style.min-height]=\"getComponentMinHeight(comp)\"\n (click)=\"onSelect(comp.id, $event)\"\n >\n <!-- Card Header with Drag Handle & Actions -->\n <div class=\"card-header\">\n <div class=\"card-title-group\" cdkDragHandle title=\"Drag to reorder\">\n <span class=\"drag-handle-dots\">\u22EE\u22EE</span>\n <rpt-icon [name]=\"getComponentIconName(comp.type)\" [size]=\"14\" />\n <span class=\"comp-title\" [title]=\"comp.label || comp.key || comp.type\">\n {{ comp.label || comp.key || comp.type }}\n </span>\n </div>\n\n <div class=\"card-actions\">\n <!-- Static span pill & new row / start col pill when not hovered / not selected -->\n @if (comp.layout?.column; as col) {\n <span class=\"new-row-pill-static\" title=\"Starts at Column {{ col }}\">Col {{ col }}</span>\n } @else if (comp.layout?.newRow) {\n <span class=\"new-row-pill-static\" title=\"Starts on separate row\">\u21B3 Row</span>\n }\n <span\n class=\"span-pill-static\"\n title=\"Column span: {{ getSpan(comp) }} of {{ totalColumns() }} columns\"\n >\n {{ getSpan(comp) }}/{{ totalColumns() }}\n </span>\n\n <!-- Quick Action Stepper & Buttons (revealed on hover or selection) -->\n <div class=\"card-quick-controls\">\n <button\n type=\"button\"\n class=\"card-action-btn\"\n [class.btn-active-toggle]=\"comp.layout?.newRow\"\n (click)=\"toggleNewRow(comp, $event)\"\n title=\"{{ comp.layout?.newRow ? 'Starts on new row (Click to place inline)' : 'Start on separate row (Row Break)' }}\"\n >\n <rpt-icon name=\"corner-down-right\" [size]=\"11\" />\n </button>\n\n <div class=\"span-control-group\" title=\"Adjust Column Span\">\n <button\n type=\"button\"\n class=\"span-btn\"\n [disabled]=\"getSpan(comp) <= 1\"\n (click)=\"adjustSpan(comp, -1, $event)\"\n title=\"Shrink Column Span\"\n >\n <rpt-icon name=\"minus\" [size]=\"9\" />\n </button>\n <span class=\"span-badge\" [title]=\"'Column span: ' + getSpan(comp) + ' of ' + totalColumns()\">\n <span class=\"span-num\">{{ getSpan(comp) }}</span><span class=\"span-total\">/{{ totalColumns() }}</span>\n </span>\n <button\n type=\"button\"\n class=\"span-btn\"\n [disabled]=\"getSpan(comp) >= totalColumns()\"\n (click)=\"adjustSpan(comp, 1, $event)\"\n title=\"Expand Column Span\"\n >\n <rpt-icon name=\"plus\" [size]=\"9\" />\n </button>\n </div>\n\n <button\n type=\"button\"\n class=\"card-action-btn\"\n (click)=\"onDuplicate(comp.id, $event)\"\n title=\"Duplicate component\"\n >\n <rpt-icon name=\"copy\" [size]=\"12\" />\n </button>\n <button\n type=\"button\"\n class=\"card-action-btn btn-delete\"\n (click)=\"onDelete(comp.id, $event)\"\n title=\"Remove component\"\n >\n <rpt-icon name=\"trash\" [size]=\"12\" />\n </button>\n </div>\n </div>\n </div>\n\n <!-- Card Body Visual Preview -->\n <div class=\"card-body\">\n\n @switch (comp.type) {\n @case ('input') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Input' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"text\"\n class=\"canvas-active-input\"\n [placeholder]=\"comp.properties?.['placeholder'] || 'Enter text...'\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-input-box\">{{ comp.properties?.['placeholder'] || 'Enter text...' }}</div>\n }\n </div>\n }\n @case ('dropdown') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-dropdown\n [config]=\"comp\"\n [showStatus]=\"true\"\n [parentForm]=\"canvasForm()\"\n [control]=\"getCanvasControl(comp)\"\n (dropdownClick)=\"onControlInteract(comp)\"\n />\n </div>\n }\n @case ('date') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Date' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"date\"\n class=\"canvas-active-input\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-select-box\">\n <span>YYYY-MM-DD</span>\n <rpt-icon name=\"calendar\" [size]=\"12\" />\n </div>\n }\n </div>\n }\n @case ('date-range') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-date-range\n [config]=\"comp\"\n [control]=\"getCanvasControl(comp)\"\n />\n </div>\n }\n @case ('number') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Number' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"number\"\n class=\"canvas-active-input\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-input-box\">\n {{ comp.properties?.['prefix'] || '' }} 0.00 {{ comp.properties?.['suffix'] || '' }}\n </div>\n }\n </div>\n }\n @case ('checkbox') {\n <div class=\"mock-checkbox-field\" (click)=\"onControlInteract(comp, $event)\">\n @if (getCanvasControl(comp); as ctrl) {\n <label class=\"canvas-active-checkbox-lbl\">\n <input type=\"checkbox\" [formControl]=\"ctrl\" (focus)=\"onControlInteract(comp, $event)\" />\n <span class=\"mock-label\">{{ comp.label || 'Checkbox' }}</span>\n </label>\n } @else {\n <span class=\"mock-check-box\">\n <rpt-icon name=\"check\" [size]=\"10\" />\n </span>\n <span class=\"mock-label\">{{ comp.label || 'Checkbox' }}</span>\n }\n </div>\n }\n @case ('radio') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-radio\n [config]=\"comp\"\n [control]=\"getCanvasControl(comp)\"\n [parentForm]=\"canvasForm()\"\n />\n </div>\n }\n @case ('button') {\n <div class=\"mock-btn-wrapper\">\n <button\n type=\"button\"\n class=\"mock-btn\"\n [class]=\"'btn-' + (comp.properties?.['variant'] || 'primary')\"\n [class.mock-btn-full]=\"comp.properties?.['fullWidth'] === true || comp.layout?.width === '100%'\"\n [style.height]=\"getCustomBtnHeight(comp)\"\n [style.width]=\"getCustomBtnWidth(comp)\"\n (click)=\"onCanvasButtonClick(comp, $event)\"\n >\n @if (getCustomBtnIcon(comp); as btnIcon) {\n <rpt-icon [name]=\"btnIcon\" [size]=\"15\" />\n }\n <span>{{ comp.label || 'Button' }}</span>\n </button>\n </div>\n }\n @case ('kpi-card') {\n <div class=\"mock-kpi-field\">\n <div class=\"mock-kpi-header\">\n <span class=\"mock-label\">{{ comp.label || 'KPI Metric' }}</span>\n <rpt-icon name=\"kpi\" [size]=\"14\" />\n </div>\n <div class=\"mock-kpi-value\">{{ comp.properties?.['value'] || '$128,450' }}</div>\n <div class=\"mock-kpi-footer\">\n <span class=\"mock-kpi-trend\">+12.5%</span>\n <span class=\"mock-kpi-sub\">vs last period</span>\n </div>\n </div>\n }\n @case ('chart') {\n <div class=\"mock-chart-field\">\n <div class=\"mock-chart-header\">\n <span class=\"mock-label\">{{ comp.label || 'Quarterly Sales Revenue ($000)' }}</span>\n </div>\n <div class=\"mock-chart-bars\">\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 44%\"></div>\n <span class=\"mock-bar-lbl\">Q1 Jan-Mar</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 61%\"></div>\n <span class=\"mock-bar-lbl\">Q2 Apr-Jun</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 79%\"></div>\n <span class=\"mock-bar-lbl\">Q3 Jul-Sep</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 100%\"></div>\n <span class=\"mock-bar-lbl\">Q4 Oct-Dec</span>\n </div>\n </div>\n </div>\n }\n @default {\n <div class=\"mock-generic-box\">\n <span>{{ comp.type }}</span>\n </div>\n }\n }\n </div>\n\n <!-- Resizing Handles (East, South, South-East) -->\n <div\n class=\"resize-handle handle-e\"\n (pointerdown)=\"startResize($event, comp, 'e')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize column width \u2022 Double-click to reset\"\n ></div>\n <div\n class=\"resize-handle handle-s\"\n (pointerdown)=\"startResize($event, comp, 's')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize height \u2022 Double-click to reset\"\n ></div>\n <div\n class=\"resize-handle handle-se\"\n (pointerdown)=\"startResize($event, comp, 'se')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize width and height \u2022 Double-click to reset\"\n ></div>\n\n <!-- Resizing Dimension Ghost / Badge -->\n @if (resizingCompId() === comp.id) {\n <div class=\"resize-dimension-tooltip\">\n {{ resizingTooltip(comp) }}\n </div>\n }\n\n <!-- Drag placeholder with matched grid column span -->\n <div\n *cdkDragPlaceholder\n class=\"canvas-drag-placeholder\"\n [style.grid-column]=\"getGridColumn(comp)\"\n ></div>\n\n <!-- Drag preview -->\n <div *cdkDragPreview class=\"canvas-drag-preview\">\n <span class=\"drag-handle-dots\">\u22EE\u22EE</span>\n <rpt-icon [name]=\"getComponentIconName(comp.type)\" [size]=\"14\" />\n <span class=\"preview-title\">{{ comp.label || comp.key || comp.type }}</span>\n <span class=\"preview-span\">{{ getSpan(comp) }}/{{ totalColumns() }}</span>\n </div>\n </div>\n }\n\n @if (components().length === 0) {\n <div class=\"canvas-empty-state\" role=\"region\" aria-label=\"Empty canvas starter options\">\n <div class=\"empty-hero-badge\">\n <rpt-icon name=\"design\" [size]=\"28\" />\n </div>\n <h3 class=\"empty-hero-title\">Start Designing Your Custom Report</h3>\n <p class=\"empty-hero-desc\">\n Drag controls from the left component palette, or jumpstart your design with pre-configured enterprise blueprints.\n </p>\n\n <div class=\"empty-hero-actions\">\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-primary\"\n (click)=\"applyBlueprint('blueprint-audit-register')\"\n title=\"Load complete Audit Register blueprint with parameters and result grid\"\n >\n <rpt-icon name=\"table\" [size]=\"15\" />\n <span>Audit Register Blueprint</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-secondary\"\n (click)=\"applyBlueprint('blueprint-kpi-summary')\"\n title=\"Load Executive KPI summary blueprint\"\n >\n <rpt-icon name=\"chart-bar\" [size]=\"15\" />\n <span>KPI Summary Blueprint</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-outline\"\n (click)=\"addStarterComponent('date-range')\"\n title=\"Add a Date Range filter component\"\n >\n <rpt-icon name=\"calendar\" [size]=\"14\" />\n <span>+ Add Date Filter</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-outline\"\n (click)=\"addStarterComponent('button')\"\n title=\"Add an Execute Action button\"\n >\n <rpt-icon name=\"play\" [size]=\"14\" />\n <span>+ Add Run Button</span>\n </button>\n </div>\n </div>\n }\n </div>\n\n <!-- Live Result Grid Preview with Bways-Grid Features -->\n @if (definition().grid) {\n <div class=\"canvas-grid-box\">\n <div class=\"grid-preview-header\">\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <rpt-icon name=\"table\" [size]=\"15\" />\n <span class=\"grid-title\">Bways Grid ({{ definition().grid?.columns?.length ?? 0 }} columns)</span>\n @if (isExecutingGrid()) {\n <span class=\"grid-exec-badge is-loading\">Loading data from database...</span>\n } @else if (gridExecError()) {\n <span class=\"grid-exec-badge is-error\">{{ gridExecError() }}</span>\n } @else if (canvasGridData().length > 0) {\n <span class=\"grid-exec-badge is-success\">{{ canvasGridData().length }} rows loaded</span>\n }\n </div>\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <button\n type=\"button\"\n class=\"btn-canvas-run-grid\"\n (click)=\"executeCanvasReport($event)\"\n [disabled]=\"isExecutingGrid()\"\n title=\"Execute query and load data into Bways Grid\"\n >\n <rpt-icon name=\"play\" [size]=\"11\" />\n <span>{{ isExecutingGrid() ? 'Running...' : 'Run / Refresh Grid' }}</span>\n </button>\n <button\n type=\"button\"\n class=\"btn-canvas-edit-grid\"\n (click)=\"selectGridSettings($event)\"\n title=\"Configure columns and grid options\"\n >\n <rpt-icon name=\"settings\" [size]=\"11\" />\n <span>Configure</span>\n </button>\n <button\n type=\"button\"\n class=\"btn-remove-grid\"\n (click)=\"removeGrid($event)\"\n title=\"Remove Result Grid from this report\"\n >\n <rpt-icon name=\"trash\" [size]=\"13\" />\n </button>\n </div>\n </div>\n\n @if (getGridSummaryText(); as summary) {\n <div class=\"grid-layout-status-strip\">\n <div class=\"grid-status-info\">\n <rpt-icon name=\"table\" [size]=\"12\" />\n <span>{{ summary }}</span>\n </div>\n <div class=\"grid-status-sync\" [class.is-pulsing]=\"layoutJustUpdated()\">\n <rpt-icon name=\"check\" [size]=\"11\" />\n <span>Layout auto-persisted</span>\n </div>\n </div>\n }\n\n <!-- Live Bways Grid bridge -->\n <div class=\"canvas-live-grid-container\" (click)=\"$event.stopPropagation()\" style=\"position: relative; min-height: 250px;\">\n @if (isExecutingGrid()) {\n <div class=\"canvas-grid-loading-overlay\">\n <span class=\"status-dot dot-pulse\" style=\"width: 14px; height: 14px; color: #2563eb; background: #2563eb; border-radius: 50%;\"></span>\n <span class=\"grid-loading-title\">Executing stored procedure on SQL Server...</span>\n <span class=\"grid-loading-sub\">Calculating outstanding balances and ledger amounts. Please wait...</span>\n </div>\n }\n <rpt-grid-bridge\n [gridDefinition]=\"definition().grid!\"\n [data]=\"canvasGridData()\"\n (gridStateChange)=\"onCanvasGridStateChange($event)\"\n (columnDefsChange)=\"onCanvasColumnDefsChange($event)\"\n />\n </div>\n </div>\n } @else {\n <div class=\"canvas-add-grid-banner\" (click)=\"addResultGrid($event)\">\n <div class=\"add-grid-icon\">\n <rpt-icon name=\"table\" [size]=\"20\" />\n </div>\n <div class=\"add-grid-text\">\n <span class=\"add-grid-title\">+ Add Result Data Grid</span>\n <span class=\"add-grid-sub\">Attach an interactive data table or UltraGrid to display report execution output</span>\n </div>\n <button type=\"button\" class=\"btn-banner-add\">Add Grid</button>\n </div>\n }\n </div>\n </div>\n </div>", styles: [":host{display:block;flex:1;min-height:0;min-width:0;height:100%;background-color:#f1f5f9;font-family:var(--rpt-font-family, inherit);box-sizing:border-box}.canvas-wrapper{min-height:0;display:flex;flex-direction:column;height:100%}.canvas-toolbar{display:flex;align-items:center;justify-content:space-between;min-height:42px;height:42px;padding:0 24px;background:var(--rpt-color-surface, #ffffff);border-bottom:1px solid var(--rpt-color-border, #cbd5e1);box-sizing:border-box;gap:12px;overflow-x:auto;scrollbar-width:none;font-family:var(--rpt-font-family, inherit);flex-shrink:0}.canvas-toolbar::-webkit-scrollbar{display:none}.canvas-info{display:flex;align-items:center;gap:8px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-sm, .75rem);color:var(--rpt-color-text-muted, #64748b);white-space:nowrap;line-height:1}.info-label{color:var(--rpt-color-text-muted, #64748b);font-weight:500;font-size:var(--rpt-font-size-sm, .75rem)}.info-value{font-weight:600;color:var(--rpt-color-text, #0f172a);font-size:var(--rpt-font-size-sm, .75rem)}.info-divider{color:var(--rpt-color-border, #cbd5e1);margin:0 2px}.live-mode-badge{display:inline-flex;align-items:center;gap:4px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-xs, .7rem);font-weight:600;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;padding:2px 8px;border-radius:9999px;line-height:1}.canvas-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}.canvas-action-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;letter-spacing:-.01em;color:var(--rpt-color-text-secondary, #334155);background:var(--rpt-color-surface, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);cursor:pointer;line-height:1;white-space:nowrap;box-shadow:0 1px 2px #0000000a;transition:all var(--rpt-transition-speed, .15s) ease}.canvas-action-btn:hover{background:var(--rpt-color-surface-hover, #f8fafc);border-color:var(--rpt-color-border-hover, #94a3b8);color:var(--rpt-color-text, #0f172a);box-shadow:0 2px 4px #0000000f}.canvas-action-btn.btn-grid-configured{background:#eff6ff;border-color:#bfdbfe;color:#2563eb;font-weight:600}.canvas-action-btn.btn-grid-configured:hover{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}.canvas-action-btn.btn-grid-add{background:#f0fdf4;border-color:#bbf7d0;color:#16a34a;font-weight:600}.canvas-action-btn.btn-grid-add:hover{background:#dcfce7;color:#15803d;border-color:#86efac}.canvas-action-btn:active{transform:translateY(1px)}.canvas-scroll-area{flex:1;min-height:0;overflow-y:auto;padding:16px}.canvas-artboard{width:100%;max-width:1400px;margin:0 auto;background:#fff;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-lg, 8px);box-shadow:0 4px 6px -1px #0000000d;min-height:480px;box-sizing:border-box}@media (max-width: 900px){.canvas-toolbar{min-height:36px;height:36px;padding:0 10px;gap:6px}.live-mode-badge{display:none}.canvas-info{font-size:.75rem;gap:5px}.canvas-action-btn{padding:0 8px;font-size:.725rem;height:28px;gap:4px}.canvas-scroll-area{padding:10px}.canvas-artboard{min-height:360px}}@media (max-width: 600px){.canvas-toolbar{padding:0 8px;gap:4px}.canvas-info .info-label,.canvas-action-btn span{display:none}.canvas-action-btn{padding:0 6px;min-width:28px;justify-content:center}}.canvas-report-header{margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid var(--rpt-color-border, #e2e8f0)}.canvas-report-title{font-size:var(--rpt-font-size-xl, 1.5rem);font-weight:700;color:var(--rpt-color-text, #0f172a);margin:0 0 6px}.canvas-report-desc{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #64748b);margin:0}.canvas-grid{display:grid;width:100%;min-height:180px;align-items:start;border-radius:6px;transition:all var(--rpt-transition-speed, .15s) ease}.canvas-component-card{container-type:inline-size;background:#fff;border:1.5px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);box-shadow:var(--rpt-box-shadow, 0 1px 2px rgba(0, 0, 0, .05));box-sizing:border-box;transition:all var(--rpt-transition-speed, .15s) ease;cursor:pointer;position:relative;overflow:visible;display:flex;flex-direction:column;min-height:104px;z-index:1}.canvas-component-card:hover{border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 4px 6px -1px #2563eb1a;z-index:2}.canvas-component-card.is-selected{border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 0 0 2px #2563eb40;z-index:10}.canvas-component-card:focus-within,.canvas-component-card:has(.rpt-combobox-menu),.canvas-component-card:has(.is-open){z-index:100}.canvas-component-card.is-resizing{-webkit-user-select:none;user-select:none;border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 0 0 2px #2563eb59;z-index:30;transition:none!important}.resize-handle{position:absolute;z-index:20;touch-action:none;opacity:0;pointer-events:none;transition:opacity .15s ease}.canvas-component-card.is-selected .resize-handle{opacity:1;pointer-events:auto}.resize-handle.handle-e{top:0;right:0;width:6px;height:100%;cursor:ew-resize;display:flex;align-items:center;justify-content:center}.resize-handle.handle-e:after{content:\"\";width:3px;height:24px;background:#cbd5e1;border-radius:2px;transition:background .15s ease}.resize-handle.handle-e:hover:after,.canvas-component-card.is-selected .resize-handle.handle-e:after{background:var(--rpt-color-primary, #2563eb)}.resize-handle.handle-s{bottom:0;left:0;height:6px;width:100%;cursor:ns-resize;display:flex;align-items:center;justify-content:center}.resize-handle.handle-s:after{content:\"\";height:3px;width:24px;background:#cbd5e1;border-radius:2px;transition:background .15s ease}.resize-handle.handle-s:hover:after,.canvas-component-card.is-selected .resize-handle.handle-s:after{background:var(--rpt-color-primary, #2563eb)}.resize-handle.handle-se{bottom:0;right:0;width:12px;height:12px;cursor:nwse-resize;display:flex;align-items:flex-end;justify-content:flex-end;padding:2px}.resize-handle.handle-se:after{content:\"\";width:5px;height:5px;border-right:2px solid #cbd5e1;border-bottom:2px solid #cbd5e1;transition:border-color .15s ease}.resize-handle.handle-se:hover:after,.canvas-component-card.is-selected .resize-handle.handle-se:after{border-color:var(--rpt-color-primary, #2563eb)}.resize-dimension-tooltip{position:absolute;top:38px;right:8px;background:#0f172ae6;color:#fff;font-size:.7rem;font-weight:600;padding:3px 8px;border-radius:4px;white-space:nowrap;pointer-events:none;z-index:50;box-shadow:0 2px 4px #0003}.card-header{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:5px 8px;background:var(--rpt-color-surface, #f8fafc);border-bottom:1px solid var(--rpt-color-border, #e2e8f0);border-top-left-radius:var(--rpt-border-radius, 6px);border-top-right-radius:var(--rpt-border-radius, 6px);min-height:32px;box-sizing:border-box;overflow:hidden;position:relative}.canvas-component-card.is-selected .card-header{overflow:visible}.card-title-group{display:flex;align-items:center;gap:5px;cursor:grab;min-width:0;flex:1;overflow:hidden}.drag-handle-dots{color:var(--rpt-color-text-muted, #94a3b8);font-size:.85rem;letter-spacing:-2px;flex-shrink:0;-webkit-user-select:none;user-select:none}.comp-title{font-size:.75rem;font-weight:600;color:var(--rpt-color-text, #0f172a);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;user-select:none}.card-actions{display:flex;align-items:center;gap:4px;flex-shrink:0;margin-left:auto}.new-row-pill-static{font-size:.65rem;font-weight:600;color:#7c3aed;background:#f5f3ff;border:1px solid #ddd6fe;padding:1px 5px;border-radius:9999px;white-space:nowrap;line-height:1;flex-shrink:0}.span-pill-static{display:inline-flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:600;color:var(--rpt-color-text-muted, #64748b);background:var(--rpt-color-surface, #f1f5f9);border:1px solid var(--rpt-color-border, #e2e8f0);padding:1px 6px;border-radius:9999px;line-height:1.2;white-space:nowrap;-webkit-user-select:none;user-select:none}.card-quick-controls{display:none;align-items:center;gap:3px;flex-shrink:0}.canvas-component-card:hover .span-pill-static,.canvas-component-card.is-selected .span-pill-static,.canvas-component-card:hover .new-row-pill-static,.canvas-component-card.is-selected .new-row-pill-static{display:none}.canvas-component-card:hover .card-quick-controls,.canvas-component-card.is-selected .card-quick-controls{display:inline-flex}.canvas-component-card.is-narrow .card-header{padding:4px 6px;gap:3px}.canvas-component-card.is-narrow:hover .comp-title,.canvas-component-card.is-narrow.is-selected .comp-title,.canvas-component-card.is-narrow:hover .drag-handle-dots,.canvas-component-card.is-narrow.is-selected .drag-handle-dots{display:none}.canvas-component-card.is-narrow .card-quick-controls{gap:2px}.canvas-component-card.is-narrow .span-control-group{height:18px}.canvas-component-card.is-narrow .span-btn{width:14px;height:16px}.canvas-component-card.is-narrow .span-badge{font-size:.6rem;padding:0 2px}.canvas-component-card.is-narrow .span-total{display:none}.canvas-component-card.is-narrow .card-action-btn{width:18px;height:18px}@container (max-width: 250px){.card-header{padding:4px 6px;gap:3px}.canvas-component-card:hover .comp-title,.canvas-component-card.is-selected .comp-title,.canvas-component-card:hover .drag-handle-dots,.canvas-component-card.is-selected .drag-handle-dots,.span-total{display:none}.card-quick-controls{gap:2px}.card-action-btn{width:18px;height:18px}.span-control-group{height:18px}.span-btn{width:14px;height:16px}.span-badge{font-size:.6rem;padding:0 2px}}@container (max-width: 160px){.canvas-component-card.is-selected .card-quick-controls{position:absolute;top:-30px;right:0;background:#fff;border:1.5px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:2px 4px;gap:3px;box-shadow:0 4px 12px #2563eb2e,0 2px 4px #00000014;z-index:120;white-space:nowrap}}@media (max-width: 900px){.canvas-component-card:hover .comp-title,.canvas-component-card.is-selected .comp-title,.canvas-component-card:hover .drag-handle-dots,.canvas-component-card.is-selected .drag-handle-dots,.canvas-component-card .span-total{display:none}.canvas-component-card.is-selected .card-header{overflow:visible}.canvas-component-card.is-selected .card-quick-controls{position:absolute;top:-30px;right:0;background:#fff;border:1.5px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:2px 4px;gap:3px;box-shadow:0 4px 12px #2563eb2e,0 2px 4px #00000014;z-index:120;white-space:nowrap}}.span-control-group{display:inline-flex;align-items:center;background:#fff;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;height:20px;padding:0 1px;white-space:nowrap;flex-shrink:0}.span-btn{width:16px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0;color:var(--rpt-color-text-muted, #64748b);cursor:pointer;border-radius:2px;transition:all .12s ease}.span-btn:hover:not(:disabled){background:var(--rpt-color-surface-hover, #f1f5f9);color:var(--rpt-color-primary, #2563eb)}.span-btn:disabled{opacity:.3;cursor:not-allowed}.span-badge{font-size:.65rem;font-weight:600;color:var(--rpt-color-text, #0f172a);padding:0 3px;white-space:nowrap;-webkit-user-select:none;user-select:none;line-height:1}.span-total{font-size:.6rem;color:var(--rpt-color-text-muted, #64748b);font-weight:500}.card-action-btn{width:20px;height:20px;border:none;background:transparent;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;color:var(--rpt-color-text-muted, #64748b);transition:all .12s ease;flex-shrink:0}.card-action-btn:hover{background:#e2e8f0;color:var(--rpt-color-text, #0f172a)}.card-action-btn.btn-active-toggle{background:#7c3aed;color:#fff;border-color:#7c3aed}.card-action-btn.btn-active-toggle:hover{background:#6d28d9;color:#fff}.btn-delete:hover{background:#fee2e2;color:#ef4444}.card-body{padding:8px 10px 14px;flex:1;display:flex;flex-direction:column;min-height:0;min-width:0;max-width:100%;box-sizing:border-box;overflow:visible}.mock-input-field{display:flex;flex-direction:column;gap:4px;flex:1;height:100%;min-height:0}.mock-label{font-size:.7rem;font-weight:600;color:var(--rpt-color-text-muted, #475569);flex-shrink:0}.mock-input-box,.mock-select-box{border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:6px;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #94a3b8);background:#fff;flex:1;min-height:38px;height:100%;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box}.mock-checkbox-field{display:flex;align-items:center;gap:6px;flex:1;height:100%;min-height:0;padding-top:14px}.mock-check-box{width:18px;height:18px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:.65rem;color:var(--rpt-color-primary, #2563eb);flex-shrink:0}.mock-btn-wrapper{display:flex;flex:1;height:100%;min-height:38px;align-items:center;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box}.mock-btn{border-radius:var(--rpt-border-radius, 6px);padding:0 16px;height:36px;font-size:var(--rpt-font-size-base, .875rem);font-weight:500;border:1px solid transparent;cursor:pointer;width:auto;max-width:100%;display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:all .15s ease}.mock-btn.mock-btn-full{width:100%}.canvas-component-card.is-narrow .mock-btn{padding:0 6px;font-size:.775rem;width:100%;height:34px}.mock-kpi-field{display:flex;flex-direction:column;justify-content:space-between;flex:1;height:100%;min-height:0}.mock-kpi-header{display:flex;align-items:center;justify-content:space-between}.mock-kpi-value{font-size:1.25rem;font-weight:700;color:var(--rpt-color-text, #0f172a);margin:2px 0}.mock-kpi-footer{display:flex;align-items:center;gap:6px;font-size:.65rem}.mock-kpi-trend{color:#16a34a;font-weight:600}.mock-kpi-sub{color:#64748b}.mock-chart-field{display:flex;flex-direction:column;flex:1;height:100%;min-height:140px}.mock-chart-bars{display:flex;align-items:flex-end;justify-content:space-around;gap:16px;flex:1;min-height:100px;padding-top:12px;box-sizing:border-box}.mock-chart-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;min-width:60px;max-width:140px}.mock-chart-bar{width:38px;max-width:44px;margin:0 auto;background:var(--rpt-color-primary, #2563eb);border-radius:6px 6px 0 0;opacity:.85;min-height:10px;transition:height .2s ease}.mock-bar-lbl{font-size:.6875rem;color:#64748b;margin-top:6px;text-align:center;white-space:normal;line-height:1.2}.btn-primary{background:var(--rpt-color-primary, #2563eb);color:#fff}.btn-secondary{background:#f1f5f9;color:#0f172a;border:1px solid #cbd5e1}.btn-outline{background:transparent;color:#2563eb;border:1px solid #2563eb}.btn-danger{background:#ef4444;color:#fff}.mock-generic-box{border:1px dashed #cbd5e1;border-radius:4px;padding:8px;font-size:.75rem;text-align:center;color:#64748b}.canvas-drag-placeholder{background:#2563eb0f;border:2px dashed var(--rpt-color-primary, #2563eb);border-radius:6px;min-height:80px;box-sizing:border-box;transition:transform .15s ease}.canvas-drag-preview,::ng-deep .canvas-drag-preview{background:#fff;border:2px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:8px 14px;display:inline-flex;align-items:center;gap:8px;font-family:var(--rpt-font-family, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif)!important;font-size:.8rem;font-weight:600;color:var(--rpt-color-text, #0f172a);box-shadow:0 12px 24px -4px #00000040;z-index:10000}.preview-title,::ng-deep .preview-title{font-family:inherit!important;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview-span,::ng-deep .preview-span{font-family:inherit!important;font-size:.65rem;font-weight:600;color:var(--rpt-color-primary, #2563eb);background:#eff6ff;border:1px solid #bfdbfe;padding:1px 6px;border-radius:9999px}.canvas-empty-state{grid-column:1 / -1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:56px 28px;border:2px dashed var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-xl, 12px);background:var(--rpt-color-surface, #ffffff);text-align:center;box-shadow:var(--rpt-box-shadow-xs, 0 1px 2px 0 rgba(0, 0, 0, .04));transition:border-color var(--rpt-transition-speed, .15s) ease}.canvas-empty-state:hover{border-color:var(--rpt-color-primary, #2563eb)}.empty-hero-badge{width:56px;height:56px;border-radius:var(--rpt-border-radius-xl, 12px);background:var(--rpt-color-primary-light, #eff6ff);color:var(--rpt-color-primary, #2563eb);display:flex;align-items:center;justify-content:center;margin-bottom:16px;box-shadow:0 2px 8px #2563eb1f}.empty-hero-title{font-size:var(--rpt-font-size-lg, 1.125rem);font-weight:700;color:var(--rpt-color-text, #0f172a);margin:0 0 8px;letter-spacing:-.01em}.empty-hero-desc{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #64748b);max-width:520px;line-height:1.5;margin:0 0 24px}.empty-hero-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}.empty-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;font-size:var(--rpt-font-size-sm, .75rem);font-weight:600;border-radius:var(--rpt-border-radius, 6px);cursor:pointer;transition:all var(--rpt-transition-speed, .15s) ease;font-family:inherit}.empty-btn-primary{background:var(--rpt-color-primary, #2563eb);color:#fff;border:1px solid var(--rpt-color-primary, #2563eb);box-shadow:0 1px 3px #2563eb33}.empty-btn-primary:hover{background:var(--rpt-color-primary-hover, #1d4ed8);border-color:var(--rpt-color-primary-hover, #1d4ed8);transform:translateY(-1px)}.empty-btn-secondary{background:#f8fafc;color:#334155;border:1px solid var(--rpt-color-border, #cbd5e1)}.empty-btn-secondary:hover{background:#f1f5f9;color:#0f172a;border-color:#94a3b8;transform:translateY(-1px)}.empty-btn-outline{background:#fff;color:var(--rpt-color-primary, #2563eb);border:1px solid #bfdbfe}.empty-btn-outline:hover{background:#eff6ff;border-color:var(--rpt-color-primary, #2563eb);transform:translateY(-1px)}.canvas-active-input{width:100%;height:32px;padding:4px 8px;font-size:.8125rem;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;outline:none;box-sizing:border-box;background:#fff;color:#0f172a;transition:border-color .15s ease}.canvas-active-input:focus{border-color:var(--rpt-color-primary, #2563eb)}.canvas-active-checkbox-lbl{display:inline-flex;align-items:center;gap:6px;cursor:pointer}.canvas-live-control-wrapper{width:100%;max-width:100%;min-width:0;position:relative;z-index:1;box-sizing:border-box}.canvas-grid-box{margin-top:24px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:8px;background:#fff;box-shadow:0 1px 3px #0000000d;overflow:hidden}.grid-preview-header{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--rpt-color-surface, #f8fafc);border-bottom:1px solid var(--rpt-color-border, #cbd5e1);font-size:.8rem;font-weight:600;color:var(--rpt-color-text, #0f172a)}.grid-title{font-weight:700}.grid-exec-badge{font-size:.6875rem;font-weight:600;padding:2px 8px;border-radius:10px}.grid-exec-badge.is-loading{background:#eff6ff;color:#2563eb}.grid-exec-badge.is-error{background:#fee2e2;color:#ef4444}.grid-exec-badge.is-success{background:#ecfdf5;color:#059669}.btn-canvas-run-grid{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;font-size:.72rem;font-weight:600;color:#fff;background:var(--rpt-color-primary, #2563eb);border:none;border-radius:4px;cursor:pointer;transition:background .15s ease}.btn-canvas-run-grid:hover:not(:disabled){background:#1d4ed8}.btn-canvas-run-grid:disabled{opacity:.6;cursor:not-allowed}.btn-canvas-edit-grid{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;font-size:.72rem;font-weight:500;color:#334155;background:#fff;border:1px solid #cbd5e1;border-radius:4px;cursor:pointer;transition:all .12s ease}.btn-canvas-edit-grid:hover{background:#f1f5f9}.canvas-live-grid-container{width:100%;min-height:480px;background:#fff}.live-mode-badge{display:inline-flex;align-items:center;gap:4px;font-size:.6875rem;font-weight:700;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;padding:1px 8px;border-radius:9999px}.canvas-component-card.is-field-highlighted{border-color:#f59e0b!important;box-shadow:0 0 0 3px #f59e0b59!important;animation:rpt-pulse-border 1s ease-in-out infinite alternate}@keyframes rpt-pulse-border{0%{box-shadow:0 0 0 2px #f59e0b40}to{box-shadow:0 0 0 5px #f59e0b80}}.grid-layout-status-strip{display:flex;align-items:center;justify-content:space-between;padding:6px 16px;background:#f1f5f9;border-bottom:1px solid var(--rpt-color-border, #cbd5e1);font-size:.6875rem;color:#475569}.grid-status-info{display:inline-flex;align-items:center;gap:6px;font-weight:600}.grid-status-sync{display:inline-flex;align-items:center;gap:4px;color:#059669;font-weight:600;transition:transform .2s ease}.grid-status-sync.is-pulsing{transform:scale(1.08);color:#047857}.canvas-actions{display:flex;align-items:center;gap:8px}.btn-grid-add{background:#f0fdf4;border-color:#bbf7d0;color:#16a34a}.btn-grid-add:hover{background:#dcfce7;border-color:#86efac;color:#15803d}.btn-remove-grid{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;color:#94a3b8;border-radius:4px;cursor:pointer;transition:all .15s ease}.btn-remove-grid:hover{background:#fee2e2;color:#ef4444}.canvas-add-grid-banner{margin-top:24px;border:2px dashed #cbd5e1;border-radius:8px;background:#fff;padding:16px 20px;display:flex;align-items:center;gap:16px;cursor:pointer;transition:all .15s ease}.canvas-add-grid-banner:hover{border-color:#2563eb;background:#f8fafc;box-shadow:0 2px 8px #2563eb14}.add-grid-icon{width:40px;height:40px;border-radius:8px;background:#eff6ff;color:#2563eb;display:flex;align-items:center;justify-content:center;flex-shrink:0}.add-grid-text{display:flex;flex-direction:column;gap:2px;flex:1}.add-grid-title{font-size:.875rem;font-weight:600;color:#0f172a}.add-grid-sub{font-size:.75rem;color:#64748b}.btn-banner-add{padding:6px 14px;font-size:.75rem;font-weight:600;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:6px;cursor:pointer;white-space:nowrap;transition:all .15s ease}.canvas-add-grid-banner:hover .btn-banner-add{background:#2563eb;color:#fff;border-color:#2563eb}.canvas-grid-loading-overlay{position:absolute;inset:0;background:#ffffffe6;backdrop-filter:blur(2px);z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;font-family:inherit;border-radius:6px}.grid-loading-title{font-weight:600;font-size:.95rem;color:#1e293b}.grid-loading-sub{font-size:.8rem;color:#64748b}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button,.canvas-active-input::-webkit-inner-spin-button,.canvas-active-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number],.canvas-active-input{-moz-appearance:textfield;appearance:textfield}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: i1$2.CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: i1$2.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: RptIconComponent, selector: "rpt-icon", inputs: ["name", "size", "color", "strokeWidth"] }, { kind: "component", type: RptDropdownComponent, selector: "rpt-dropdown", inputs: ["config", "control", "parentForm", "showStatus"], outputs: ["dropdownClick"] }, { kind: "component", type: RptDateRangeComponent, selector: "rpt-date-range", inputs: ["config", "control"] }, { kind: "component", type: RptRadioComponent, selector: "rpt-radio", inputs: ["config", "control", "parentForm"] }, { kind: "component", type: ReportGridBridgeComponent, selector: "rpt-grid-bridge", inputs: ["gridDefinition", "data"], outputs: ["gridStateChange", "columnDefsChange", "rowClick", "selectionChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14460
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DesignCanvasComponent, isStandalone: true, selector: "rpt-design-canvas", host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: " <div class=\"canvas-wrapper\" (click)=\"onCanvasBackgroundClick($event)\">\n <!-- Canvas Status / Quick Controls -->\n <div class=\"canvas-toolbar\">\n <div class=\"canvas-info\">\n <span class=\"info-label\">Grid Layout:</span>\n <span class=\"info-value\">{{ totalColumns() }} Columns</span>\n <span class=\"info-divider\">\u2022</span>\n <span class=\"info-label\">Components:</span>\n <span class=\"info-value\">{{ components().length }}</span>\n <span class=\"info-divider\">\u2022</span>\n <span class=\"live-mode-badge\" title=\"Interactive canvas: Values typed here run live queries and test dropdowns.\">\n \u26A1 Live Interactive Mode\n </span>\n </div>\n\n <div class=\"canvas-actions\">\n @if (!definition().grid) {\n <button\n type=\"button\"\n class=\"canvas-action-btn btn-grid-add\"\n (click)=\"addResultGrid($event)\"\n title=\"Add a Result Grid to this report\"\n >\n <rpt-icon name=\"table\" [size]=\"14\" />\n <span>+ Add Grid</span>\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"canvas-action-btn btn-grid-configured\"\n (click)=\"selectGridSettings($event)\"\n title=\"Configure Result Data Grid\"\n >\n <rpt-icon name=\"table\" [size]=\"14\" />\n <span>Grid ({{ definition().grid?.columns?.length ?? 0 }})</span>\n </button>\n }\n\n <button\n type=\"button\"\n class=\"canvas-action-btn\"\n (click)=\"selectReportSettings($event)\"\n title=\"Configure Page Layout & Grid Settings\"\n >\n <rpt-icon name=\"settings\" [size]=\"14\" />\n <span>Report Settings</span>\n </button>\n </div>\n </div>\n\n <!-- Canvas Drop Area -->\n <div class=\"canvas-scroll-area\" cdkScrollable>\n <div\n class=\"canvas-artboard\"\n [style.padding.px]=\"definition().layout.padding ?? 24\"\n >\n <!-- Report Header Preview -->\n <div class=\"canvas-report-header\">\n <h2 class=\"canvas-report-title\">{{ definition().name || 'Untitled Report' }}</h2>\n @if (definition().description) {\n <p class=\"canvas-report-desc\">{{ definition().description }}</p>\n }\n </div>\n\n <!-- Component Drop List Grid with 2D mixed orientation and data binding -->\n <div\n cdkDropList\n id=\"designer-canvas-drop-list\"\n class=\"canvas-grid\"\n cdkDropListOrientation=\"mixed\"\n [cdkDropListData]=\"sortedComponents()\"\n [style.grid-template-columns]=\"gridTemplateColumns()\"\n [style.gap.px]=\"definition().layout.gap ?? 16\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n @for (comp of sortedComponents(); track comp.id; let idx = $index) {\n <div\n cdkDrag\n [cdkDragData]=\"comp\"\n [cdkDragDisabled]=\"isAnyResizing()\"\n class=\"canvas-component-card\"\n [class.is-selected]=\"isSelected(comp.id)\"\n [class.is-resizing]=\"resizingCompId() === comp.id\"\n [class.is-field-highlighted]=\"isFieldHighlighted(comp)\"\n [class.is-narrow]=\"getSpan(comp) <= 4\"\n [class.is-compact]=\"getSpan(comp) <= 2\"\n [style.grid-column]=\"getGridColumn(comp)\"\n [style.grid-row]=\"getGridRow(comp)\"\n [style.width]=\"comp.layout?.width || 'auto'\"\n [style.height]=\"getComponentHeight(comp)\"\n [style.min-height]=\"getComponentMinHeight(comp)\"\n (click)=\"onSelect(comp.id, $event)\"\n >\n <!-- Card Header with Drag Handle & Actions -->\n <div class=\"card-header\">\n <div class=\"card-title-group\" cdkDragHandle title=\"Drag to reorder\">\n <span class=\"drag-handle-dots\">\u22EE\u22EE</span>\n <rpt-icon [name]=\"getComponentIconName(comp.type)\" [size]=\"14\" />\n <span class=\"comp-title\" [title]=\"comp.label || comp.key || comp.type\">\n {{ comp.label || comp.key || comp.type }}\n </span>\n </div>\n\n <div class=\"card-actions\">\n <!-- Static span pill & new row / start col pill when not hovered / not selected -->\n @if (comp.layout?.column; as col) {\n <span class=\"new-row-pill-static\" title=\"Starts at Column {{ col }}\">Col {{ col }}</span>\n } @else if (comp.layout?.newRow) {\n <span class=\"new-row-pill-static\" title=\"Starts on separate row\">\u21B3 Row</span>\n }\n <span\n class=\"span-pill-static\"\n title=\"Column span: {{ getSpan(comp) }} of {{ totalColumns() }} columns\"\n >\n {{ getSpan(comp) }}/{{ totalColumns() }}\n </span>\n\n <!-- Quick Action Stepper & Buttons (revealed on hover or selection) -->\n <div class=\"card-quick-controls\">\n <button\n type=\"button\"\n class=\"card-action-btn\"\n [class.btn-active-toggle]=\"comp.layout?.newRow\"\n (click)=\"toggleNewRow(comp, $event)\"\n title=\"{{ comp.layout?.newRow ? 'Starts on new row (Click to place inline)' : 'Start on separate row (Row Break)' }}\"\n >\n <rpt-icon name=\"corner-down-right\" [size]=\"11\" />\n </button>\n\n <div class=\"span-control-group\" title=\"Adjust Column Span\">\n <button\n type=\"button\"\n class=\"span-btn\"\n [disabled]=\"getSpan(comp) <= 1\"\n (click)=\"adjustSpan(comp, -1, $event)\"\n title=\"Shrink Column Span\"\n >\n <rpt-icon name=\"minus\" [size]=\"9\" />\n </button>\n <span class=\"span-badge\" [title]=\"'Column span: ' + getSpan(comp) + ' of ' + totalColumns()\">\n <span class=\"span-num\">{{ getSpan(comp) }}</span><span class=\"span-total\">/{{ totalColumns() }}</span>\n </span>\n <button\n type=\"button\"\n class=\"span-btn\"\n [disabled]=\"getSpan(comp) >= totalColumns()\"\n (click)=\"adjustSpan(comp, 1, $event)\"\n title=\"Expand Column Span\"\n >\n <rpt-icon name=\"plus\" [size]=\"9\" />\n </button>\n </div>\n\n <button\n type=\"button\"\n class=\"card-action-btn\"\n (click)=\"onDuplicate(comp.id, $event)\"\n title=\"Duplicate component\"\n >\n <rpt-icon name=\"copy\" [size]=\"12\" />\n </button>\n <button\n type=\"button\"\n class=\"card-action-btn btn-delete\"\n (click)=\"onDelete(comp.id, $event)\"\n title=\"Remove component\"\n >\n <rpt-icon name=\"trash\" [size]=\"12\" />\n </button>\n </div>\n </div>\n </div>\n\n <!-- Card Body Visual Preview -->\n <div class=\"card-body\">\n\n @switch (comp.type) {\n @case ('input') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Input' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"text\"\n class=\"canvas-active-input\"\n [placeholder]=\"comp.properties?.['placeholder'] || 'Enter text...'\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-input-box\">{{ comp.properties?.['placeholder'] || 'Enter text...' }}</div>\n }\n </div>\n }\n @case ('dropdown') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-dropdown\n [config]=\"comp\"\n [showStatus]=\"true\"\n [parentForm]=\"canvasForm()\"\n [control]=\"getCanvasControl(comp)\"\n (dropdownClick)=\"onControlInteract(comp)\"\n />\n </div>\n }\n @case ('date') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-date [config]=\"comp\" [control]=\"getCanvasControl(comp) ?? undefined\" />\n </div>\n }\n @case ('date-range') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-date-range\n [config]=\"comp\"\n [control]=\"getCanvasControl(comp)\"\n />\n </div>\n }\n @case ('number') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Number' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"number\"\n class=\"canvas-active-input\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-input-box\">\n {{ comp.properties?.['prefix'] || '' }} 0.00 {{ comp.properties?.['suffix'] || '' }}\n </div>\n }\n </div>\n }\n @case ('checkbox') {\n <div class=\"mock-checkbox-field\" (click)=\"onControlInteract(comp, $event)\">\n @if (getCanvasControl(comp); as ctrl) {\n <label class=\"canvas-active-checkbox-lbl\">\n <input type=\"checkbox\" [formControl]=\"ctrl\" (focus)=\"onControlInteract(comp, $event)\" />\n <span class=\"mock-label\">{{ comp.label || 'Checkbox' }}</span>\n </label>\n } @else {\n <span class=\"mock-check-box\">\n <rpt-icon name=\"check\" [size]=\"10\" />\n </span>\n <span class=\"mock-label\">{{ comp.label || 'Checkbox' }}</span>\n }\n </div>\n }\n @case ('radio') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-radio\n [config]=\"comp\"\n [control]=\"getCanvasControl(comp)\"\n [parentForm]=\"canvasForm()\"\n />\n </div>\n }\n @case ('button') {\n <div class=\"mock-btn-wrapper\">\n <button\n type=\"button\"\n class=\"mock-btn\"\n [class]=\"'btn-' + (comp.properties?.['variant'] || 'primary')\"\n [class.mock-btn-full]=\"comp.properties?.['fullWidth'] === true || comp.layout?.width === '100%'\"\n [style.height]=\"getCustomBtnHeight(comp)\"\n [style.width]=\"getCustomBtnWidth(comp)\"\n (click)=\"onCanvasButtonClick(comp, $event)\"\n >\n @if (getCustomBtnIcon(comp); as btnIcon) {\n <rpt-icon [name]=\"btnIcon\" [size]=\"15\" />\n }\n <span>{{ comp.label || 'Button' }}</span>\n </button>\n </div>\n }\n @case ('kpi-card') {\n <div class=\"mock-kpi-field\">\n <div class=\"mock-kpi-header\">\n <span class=\"mock-label\">{{ comp.label || 'KPI Metric' }}</span>\n <rpt-icon name=\"kpi\" [size]=\"14\" />\n </div>\n <div class=\"mock-kpi-value\">{{ comp.properties?.['value'] || '$128,450' }}</div>\n <div class=\"mock-kpi-footer\">\n <span class=\"mock-kpi-trend\">+12.5%</span>\n <span class=\"mock-kpi-sub\">vs last period</span>\n </div>\n </div>\n }\n @case ('chart') {\n <div class=\"mock-chart-field\">\n <div class=\"mock-chart-header\">\n <span class=\"mock-label\">{{ comp.label || 'Quarterly Sales Revenue ($000)' }}</span>\n </div>\n <div class=\"mock-chart-bars\">\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 44%\"></div>\n <span class=\"mock-bar-lbl\">Q1 Jan-Mar</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 61%\"></div>\n <span class=\"mock-bar-lbl\">Q2 Apr-Jun</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 79%\"></div>\n <span class=\"mock-bar-lbl\">Q3 Jul-Sep</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 100%\"></div>\n <span class=\"mock-bar-lbl\">Q4 Oct-Dec</span>\n </div>\n </div>\n </div>\n }\n @default {\n <div class=\"mock-generic-box\">\n <span>{{ comp.type }}</span>\n </div>\n }\n }\n </div>\n\n <!-- Resizing Handles (East, South, South-East) -->\n <div\n class=\"resize-handle handle-e\"\n (pointerdown)=\"startResize($event, comp, 'e')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize column width \u2022 Double-click to reset\"\n ></div>\n <div\n class=\"resize-handle handle-s\"\n (pointerdown)=\"startResize($event, comp, 's')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize height \u2022 Double-click to reset\"\n ></div>\n <div\n class=\"resize-handle handle-se\"\n (pointerdown)=\"startResize($event, comp, 'se')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize width and height \u2022 Double-click to reset\"\n ></div>\n\n <!-- Resizing Dimension Ghost / Badge -->\n @if (resizingCompId() === comp.id) {\n <div class=\"resize-dimension-tooltip\">\n {{ resizingTooltip(comp) }}\n </div>\n }\n\n <!-- Drag placeholder with matched grid column span -->\n <div\n *cdkDragPlaceholder\n class=\"canvas-drag-placeholder\"\n [style.grid-column]=\"getGridColumn(comp)\"\n ></div>\n\n <!-- Drag preview -->\n <div *cdkDragPreview class=\"canvas-drag-preview\">\n <span class=\"drag-handle-dots\">\u22EE\u22EE</span>\n <rpt-icon [name]=\"getComponentIconName(comp.type)\" [size]=\"14\" />\n <span class=\"preview-title\">{{ comp.label || comp.key || comp.type }}</span>\n <span class=\"preview-span\">{{ getSpan(comp) }}/{{ totalColumns() }}</span>\n </div>\n </div>\n }\n\n @if (components().length === 0) {\n <div class=\"canvas-empty-state\" role=\"region\" aria-label=\"Empty canvas starter options\">\n <div class=\"empty-hero-badge\">\n <rpt-icon name=\"design\" [size]=\"28\" />\n </div>\n <h3 class=\"empty-hero-title\">Start Designing Your Custom Report</h3>\n <p class=\"empty-hero-desc\">\n Drag controls from the left component palette, or jumpstart your design with pre-configured enterprise blueprints.\n </p>\n\n <div class=\"empty-hero-actions\">\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-primary\"\n (click)=\"applyBlueprint('blueprint-audit-register')\"\n title=\"Load complete Audit Register blueprint with parameters and result grid\"\n >\n <rpt-icon name=\"table\" [size]=\"15\" />\n <span>Audit Register Blueprint</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-secondary\"\n (click)=\"applyBlueprint('blueprint-kpi-summary')\"\n title=\"Load Executive KPI summary blueprint\"\n >\n <rpt-icon name=\"chart-bar\" [size]=\"15\" />\n <span>KPI Summary Blueprint</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-outline\"\n (click)=\"addStarterComponent('date-range')\"\n title=\"Add a Date Range filter component\"\n >\n <rpt-icon name=\"calendar\" [size]=\"14\" />\n <span>+ Add Date Filter</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-outline\"\n (click)=\"addStarterComponent('button')\"\n title=\"Add an Execute Action button\"\n >\n <rpt-icon name=\"play\" [size]=\"14\" />\n <span>+ Add Run Button</span>\n </button>\n </div>\n </div>\n }\n </div>\n\n <!-- Live Result Grid Preview with Bways-Grid Features -->\n @if (definition().grid) {\n <div class=\"canvas-grid-box\">\n <div class=\"grid-preview-header\">\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <rpt-icon name=\"table\" [size]=\"15\" />\n <span class=\"grid-title\">Bways Grid ({{ definition().grid?.columns?.length ?? 0 }} columns)</span>\n @if (isExecutingGrid()) {\n <span class=\"grid-exec-badge is-loading\">Loading data from database...</span>\n } @else if (gridExecError()) {\n <span class=\"grid-exec-badge is-error\">{{ gridExecError() }}</span>\n } @else if (canvasGridData().length > 0) {\n <span class=\"grid-exec-badge is-success\">{{ canvasGridData().length }} rows loaded</span>\n }\n </div>\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <button\n type=\"button\"\n class=\"btn-canvas-run-grid\"\n (click)=\"executeCanvasReport($event)\"\n [disabled]=\"isExecutingGrid()\"\n title=\"Execute query and load data into Bways Grid\"\n >\n <rpt-icon name=\"play\" [size]=\"11\" />\n <span>{{ isExecutingGrid() ? 'Running...' : 'Run / Refresh Grid' }}</span>\n </button>\n <button\n type=\"button\"\n class=\"btn-canvas-edit-grid\"\n (click)=\"selectGridSettings($event)\"\n title=\"Configure columns and grid options\"\n >\n <rpt-icon name=\"settings\" [size]=\"11\" />\n <span>Configure</span>\n </button>\n <button\n type=\"button\"\n class=\"btn-remove-grid\"\n (click)=\"removeGrid($event)\"\n title=\"Remove Result Grid from this report\"\n >\n <rpt-icon name=\"trash\" [size]=\"13\" />\n </button>\n </div>\n </div>\n\n @if (getGridSummaryText(); as summary) {\n <div class=\"grid-layout-status-strip\">\n <div class=\"grid-status-info\">\n <rpt-icon name=\"table\" [size]=\"12\" />\n <span>{{ summary }}</span>\n </div>\n <div class=\"grid-status-sync\" [class.is-pulsing]=\"layoutJustUpdated()\">\n <rpt-icon name=\"check\" [size]=\"11\" />\n <span>Layout auto-persisted</span>\n </div>\n </div>\n }\n\n <!-- Live Bways Grid bridge -->\n <div class=\"canvas-live-grid-container\" (click)=\"$event.stopPropagation()\" style=\"position: relative; min-height: 250px;\">\n @if (isExecutingGrid()) {\n <div class=\"canvas-grid-loading-overlay\">\n <span class=\"status-dot dot-pulse\" style=\"width: 14px; height: 14px; color: #2563eb; background: #2563eb; border-radius: 50%;\"></span>\n <span class=\"grid-loading-title\">Executing stored procedure on SQL Server...</span>\n <span class=\"grid-loading-sub\">Calculating outstanding balances and ledger amounts. Please wait...</span>\n </div>\n }\n <rpt-grid-bridge\n [gridDefinition]=\"definition().grid!\"\n [data]=\"canvasGridData()\"\n (gridStateChange)=\"onCanvasGridStateChange($event)\"\n (columnDefsChange)=\"onCanvasColumnDefsChange($event)\"\n />\n </div>\n </div>\n } @else {\n <div class=\"canvas-add-grid-banner\" (click)=\"addResultGrid($event)\">\n <div class=\"add-grid-icon\">\n <rpt-icon name=\"table\" [size]=\"20\" />\n </div>\n <div class=\"add-grid-text\">\n <span class=\"add-grid-title\">+ Add Result Data Grid</span>\n <span class=\"add-grid-sub\">Attach an interactive data table or UltraGrid to display report execution output</span>\n </div>\n <button type=\"button\" class=\"btn-banner-add\">Add Grid</button>\n </div>\n }\n </div>\n </div>\n </div>", styles: [":host{display:block;flex:1;min-height:0;min-width:0;height:100%;background-color:#f1f5f9;font-family:var(--rpt-font-family, inherit);box-sizing:border-box}.canvas-wrapper{min-height:0;display:flex;flex-direction:column;height:100%}.canvas-toolbar{display:flex;align-items:center;justify-content:space-between;min-height:42px;height:42px;padding:0 24px;background:var(--rpt-color-surface, #ffffff);border-bottom:1px solid var(--rpt-color-border, #cbd5e1);box-sizing:border-box;gap:12px;overflow-x:auto;scrollbar-width:none;font-family:var(--rpt-font-family, inherit);flex-shrink:0}.canvas-toolbar::-webkit-scrollbar{display:none}.canvas-info{display:flex;align-items:center;gap:8px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-sm, .75rem);color:var(--rpt-color-text-muted, #64748b);white-space:nowrap;line-height:1}.info-label{color:var(--rpt-color-text-muted, #64748b);font-weight:500;font-size:var(--rpt-font-size-sm, .75rem)}.info-value{font-weight:600;color:var(--rpt-color-text, #0f172a);font-size:var(--rpt-font-size-sm, .75rem)}.info-divider{color:var(--rpt-color-border, #cbd5e1);margin:0 2px}.live-mode-badge{display:inline-flex;align-items:center;gap:4px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-xs, .7rem);font-weight:600;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;padding:2px 8px;border-radius:9999px;line-height:1}.canvas-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}.canvas-action-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;letter-spacing:-.01em;color:var(--rpt-color-text-secondary, #334155);background:var(--rpt-color-surface, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);cursor:pointer;line-height:1;white-space:nowrap;box-shadow:0 1px 2px #0000000a;transition:all var(--rpt-transition-speed, .15s) ease}.canvas-action-btn:hover{background:var(--rpt-color-surface-hover, #f8fafc);border-color:var(--rpt-color-border-hover, #94a3b8);color:var(--rpt-color-text, #0f172a);box-shadow:0 2px 4px #0000000f}.canvas-action-btn.btn-grid-configured{background:#eff6ff;border-color:#bfdbfe;color:#2563eb;font-weight:600}.canvas-action-btn.btn-grid-configured:hover{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}.canvas-action-btn.btn-grid-add{background:#f0fdf4;border-color:#bbf7d0;color:#16a34a;font-weight:600}.canvas-action-btn.btn-grid-add:hover{background:#dcfce7;color:#15803d;border-color:#86efac}.canvas-action-btn:active{transform:translateY(1px)}.canvas-scroll-area{flex:1;min-height:0;overflow-y:auto;padding:16px}.canvas-artboard{width:100%;max-width:1400px;margin:0 auto;background:#fff;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-lg, 8px);box-shadow:0 4px 6px -1px #0000000d;min-height:480px;box-sizing:border-box}@media (max-width: 900px){.canvas-toolbar{min-height:36px;height:36px;padding:0 10px;gap:6px}.live-mode-badge{display:none}.canvas-info{font-size:.75rem;gap:5px}.canvas-action-btn{padding:0 8px;font-size:.725rem;height:28px;gap:4px}.canvas-scroll-area{padding:10px}.canvas-artboard{min-height:360px}}@media (max-width: 600px){.canvas-toolbar{padding:0 8px;gap:4px}.canvas-info .info-label,.canvas-action-btn span{display:none}.canvas-action-btn{padding:0 6px;min-width:28px;justify-content:center}}.canvas-report-header{margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid var(--rpt-color-border, #e2e8f0)}.canvas-report-title{font-size:var(--rpt-font-size-xl, 1.5rem);font-weight:700;color:var(--rpt-color-text, #0f172a);margin:0 0 6px}.canvas-report-desc{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #64748b);margin:0}.canvas-grid{display:grid;width:100%;min-height:180px;align-items:start;border-radius:6px;transition:all var(--rpt-transition-speed, .15s) ease}.canvas-component-card{container-type:inline-size;background:#fff;border:1.5px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);box-shadow:var(--rpt-box-shadow, 0 1px 2px rgba(0, 0, 0, .05));box-sizing:border-box;transition:all var(--rpt-transition-speed, .15s) ease;cursor:pointer;position:relative;overflow:visible;display:flex;flex-direction:column;min-height:104px;z-index:1}.canvas-component-card:hover{border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 4px 6px -1px #2563eb1a;z-index:2}.canvas-component-card.is-selected{border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 0 0 2px #2563eb40;z-index:10}.canvas-component-card:focus-within,.canvas-component-card:has(.rpt-combobox-menu),.canvas-component-card:has(.is-open){z-index:100}.canvas-component-card.is-resizing{-webkit-user-select:none;user-select:none;border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 0 0 2px #2563eb59;z-index:30;transition:none!important}.resize-handle{position:absolute;z-index:20;touch-action:none;opacity:0;pointer-events:none;transition:opacity .15s ease}.canvas-component-card.is-selected .resize-handle{opacity:1;pointer-events:auto}.resize-handle.handle-e{top:0;right:0;width:6px;height:100%;cursor:ew-resize;display:flex;align-items:center;justify-content:center}.resize-handle.handle-e:after{content:\"\";width:3px;height:24px;background:#cbd5e1;border-radius:2px;transition:background .15s ease}.resize-handle.handle-e:hover:after,.canvas-component-card.is-selected .resize-handle.handle-e:after{background:var(--rpt-color-primary, #2563eb)}.resize-handle.handle-s{bottom:0;left:0;height:6px;width:100%;cursor:ns-resize;display:flex;align-items:center;justify-content:center}.resize-handle.handle-s:after{content:\"\";height:3px;width:24px;background:#cbd5e1;border-radius:2px;transition:background .15s ease}.resize-handle.handle-s:hover:after,.canvas-component-card.is-selected .resize-handle.handle-s:after{background:var(--rpt-color-primary, #2563eb)}.resize-handle.handle-se{bottom:0;right:0;width:12px;height:12px;cursor:nwse-resize;display:flex;align-items:flex-end;justify-content:flex-end;padding:2px}.resize-handle.handle-se:after{content:\"\";width:5px;height:5px;border-right:2px solid #cbd5e1;border-bottom:2px solid #cbd5e1;transition:border-color .15s ease}.resize-handle.handle-se:hover:after,.canvas-component-card.is-selected .resize-handle.handle-se:after{border-color:var(--rpt-color-primary, #2563eb)}.resize-dimension-tooltip{position:absolute;top:38px;right:8px;background:#0f172ae6;color:#fff;font-size:.7rem;font-weight:600;padding:3px 8px;border-radius:4px;white-space:nowrap;pointer-events:none;z-index:50;box-shadow:0 2px 4px #0003}.card-header{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:5px 8px;background:var(--rpt-color-surface, #f8fafc);border-bottom:1px solid var(--rpt-color-border, #e2e8f0);border-top-left-radius:var(--rpt-border-radius, 6px);border-top-right-radius:var(--rpt-border-radius, 6px);min-height:32px;box-sizing:border-box;overflow:hidden;position:relative}.canvas-component-card.is-selected .card-header{overflow:visible}.card-title-group{display:flex;align-items:center;gap:5px;cursor:grab;min-width:0;flex:1;overflow:hidden}.drag-handle-dots{color:var(--rpt-color-text-muted, #94a3b8);font-size:.85rem;letter-spacing:-2px;flex-shrink:0;-webkit-user-select:none;user-select:none}.comp-title{font-size:.75rem;font-weight:600;color:var(--rpt-color-text, #0f172a);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;user-select:none}.card-actions{display:flex;align-items:center;gap:4px;flex-shrink:0;margin-left:auto}.new-row-pill-static{font-size:.65rem;font-weight:600;color:#7c3aed;background:#f5f3ff;border:1px solid #ddd6fe;padding:1px 5px;border-radius:9999px;white-space:nowrap;line-height:1;flex-shrink:0}.span-pill-static{display:inline-flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:600;color:var(--rpt-color-text-muted, #64748b);background:var(--rpt-color-surface, #f1f5f9);border:1px solid var(--rpt-color-border, #e2e8f0);padding:1px 6px;border-radius:9999px;line-height:1.2;white-space:nowrap;-webkit-user-select:none;user-select:none}.card-quick-controls{display:none;align-items:center;gap:3px;flex-shrink:0}.canvas-component-card:hover .span-pill-static,.canvas-component-card.is-selected .span-pill-static,.canvas-component-card:hover .new-row-pill-static,.canvas-component-card.is-selected .new-row-pill-static{display:none}.canvas-component-card:hover .card-quick-controls,.canvas-component-card.is-selected .card-quick-controls{display:inline-flex}.canvas-component-card.is-narrow .card-header{padding:4px 6px;gap:3px}.canvas-component-card.is-narrow:hover .comp-title,.canvas-component-card.is-narrow.is-selected .comp-title,.canvas-component-card.is-narrow:hover .drag-handle-dots,.canvas-component-card.is-narrow.is-selected .drag-handle-dots{display:none}.canvas-component-card.is-narrow .card-quick-controls{gap:2px}.canvas-component-card.is-narrow .span-control-group{height:18px}.canvas-component-card.is-narrow .span-btn{width:14px;height:16px}.canvas-component-card.is-narrow .span-badge{font-size:.6rem;padding:0 2px}.canvas-component-card.is-narrow .span-total{display:none}.canvas-component-card.is-narrow .card-action-btn{width:18px;height:18px}@container (max-width: 250px){.card-header{padding:4px 6px;gap:3px}.canvas-component-card:hover .comp-title,.canvas-component-card.is-selected .comp-title,.canvas-component-card:hover .drag-handle-dots,.canvas-component-card.is-selected .drag-handle-dots,.span-total{display:none}.card-quick-controls{gap:2px}.card-action-btn{width:18px;height:18px}.span-control-group{height:18px}.span-btn{width:14px;height:16px}.span-badge{font-size:.6rem;padding:0 2px}}@container (max-width: 160px){.canvas-component-card.is-selected .card-quick-controls{position:absolute;top:-30px;right:0;background:#fff;border:1.5px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:2px 4px;gap:3px;box-shadow:0 4px 12px #2563eb2e,0 2px 4px #00000014;z-index:120;white-space:nowrap}}@media (max-width: 900px){.canvas-component-card:hover .comp-title,.canvas-component-card.is-selected .comp-title,.canvas-component-card:hover .drag-handle-dots,.canvas-component-card.is-selected .drag-handle-dots,.canvas-component-card .span-total{display:none}.canvas-component-card.is-selected .card-header{overflow:visible}.canvas-component-card.is-selected .card-quick-controls{position:absolute;top:-30px;right:0;background:#fff;border:1.5px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:2px 4px;gap:3px;box-shadow:0 4px 12px #2563eb2e,0 2px 4px #00000014;z-index:120;white-space:nowrap}}.span-control-group{display:inline-flex;align-items:center;background:#fff;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;height:20px;padding:0 1px;white-space:nowrap;flex-shrink:0}.span-btn{width:16px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0;color:var(--rpt-color-text-muted, #64748b);cursor:pointer;border-radius:2px;transition:all .12s ease}.span-btn:hover:not(:disabled){background:var(--rpt-color-surface-hover, #f1f5f9);color:var(--rpt-color-primary, #2563eb)}.span-btn:disabled{opacity:.3;cursor:not-allowed}.span-badge{font-size:.65rem;font-weight:600;color:var(--rpt-color-text, #0f172a);padding:0 3px;white-space:nowrap;-webkit-user-select:none;user-select:none;line-height:1}.span-total{font-size:.6rem;color:var(--rpt-color-text-muted, #64748b);font-weight:500}.card-action-btn{width:20px;height:20px;border:none;background:transparent;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;color:var(--rpt-color-text-muted, #64748b);transition:all .12s ease;flex-shrink:0}.card-action-btn:hover{background:#e2e8f0;color:var(--rpt-color-text, #0f172a)}.card-action-btn.btn-active-toggle{background:#7c3aed;color:#fff;border-color:#7c3aed}.card-action-btn.btn-active-toggle:hover{background:#6d28d9;color:#fff}.btn-delete:hover{background:#fee2e2;color:#ef4444}.card-body{padding:8px 10px 14px;flex:1;display:flex;flex-direction:column;min-height:0;min-width:0;max-width:100%;box-sizing:border-box;overflow:visible}.mock-input-field{display:flex;flex-direction:column;gap:4px;flex:1;height:100%;min-height:0}.mock-label{font-size:.7rem;font-weight:600;color:var(--rpt-color-text-muted, #475569);flex-shrink:0}.mock-input-box,.mock-select-box{border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:6px;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #94a3b8);background:#fff;flex:1;min-height:38px;height:100%;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box}.mock-checkbox-field{display:flex;align-items:center;gap:6px;flex:1;height:100%;min-height:0;padding-top:14px}.mock-check-box{width:18px;height:18px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:.65rem;color:var(--rpt-color-primary, #2563eb);flex-shrink:0}.mock-btn-wrapper{display:flex;flex:1;height:100%;min-height:38px;align-items:center;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box}.mock-btn{border-radius:var(--rpt-border-radius, 6px);padding:0 16px;height:36px;font-size:var(--rpt-font-size-base, .875rem);font-weight:500;border:1px solid transparent;cursor:pointer;width:auto;max-width:100%;display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:all .15s ease}.mock-btn.mock-btn-full{width:100%}.canvas-component-card.is-narrow .mock-btn{padding:0 6px;font-size:.775rem;width:100%;height:34px}.mock-kpi-field{display:flex;flex-direction:column;justify-content:space-between;flex:1;height:100%;min-height:0}.mock-kpi-header{display:flex;align-items:center;justify-content:space-between}.mock-kpi-value{font-size:1.25rem;font-weight:700;color:var(--rpt-color-text, #0f172a);margin:2px 0}.mock-kpi-footer{display:flex;align-items:center;gap:6px;font-size:.65rem}.mock-kpi-trend{color:#16a34a;font-weight:600}.mock-kpi-sub{color:#64748b}.mock-chart-field{display:flex;flex-direction:column;flex:1;height:100%;min-height:140px}.mock-chart-bars{display:flex;align-items:flex-end;justify-content:space-around;gap:16px;flex:1;min-height:100px;padding-top:12px;box-sizing:border-box}.mock-chart-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;min-width:60px;max-width:140px}.mock-chart-bar{width:38px;max-width:44px;margin:0 auto;background:var(--rpt-color-primary, #2563eb);border-radius:6px 6px 0 0;opacity:.85;min-height:10px;transition:height .2s ease}.mock-bar-lbl{font-size:.6875rem;color:#64748b;margin-top:6px;text-align:center;white-space:normal;line-height:1.2}.btn-primary{background:var(--rpt-color-primary, #2563eb);color:#fff}.btn-secondary{background:#f1f5f9;color:#0f172a;border:1px solid #cbd5e1}.btn-outline{background:transparent;color:#2563eb;border:1px solid #2563eb}.btn-danger{background:#ef4444;color:#fff}.mock-generic-box{border:1px dashed #cbd5e1;border-radius:4px;padding:8px;font-size:.75rem;text-align:center;color:#64748b}.canvas-drag-placeholder{background:#2563eb0f;border:2px dashed var(--rpt-color-primary, #2563eb);border-radius:6px;min-height:80px;box-sizing:border-box;transition:transform .15s ease}.canvas-drag-preview,::ng-deep .canvas-drag-preview{background:#fff;border:2px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:8px 14px;display:inline-flex;align-items:center;gap:8px;font-family:var(--rpt-font-family, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif)!important;font-size:.8rem;font-weight:600;color:var(--rpt-color-text, #0f172a);box-shadow:0 12px 24px -4px #00000040;z-index:10000}.preview-title,::ng-deep .preview-title{font-family:inherit!important;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview-span,::ng-deep .preview-span{font-family:inherit!important;font-size:.65rem;font-weight:600;color:var(--rpt-color-primary, #2563eb);background:#eff6ff;border:1px solid #bfdbfe;padding:1px 6px;border-radius:9999px}.canvas-empty-state{grid-column:1 / -1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:56px 28px;border:2px dashed var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-xl, 12px);background:var(--rpt-color-surface, #ffffff);text-align:center;box-shadow:var(--rpt-box-shadow-xs, 0 1px 2px 0 rgba(0, 0, 0, .04));transition:border-color var(--rpt-transition-speed, .15s) ease}.canvas-empty-state:hover{border-color:var(--rpt-color-primary, #2563eb)}.empty-hero-badge{width:56px;height:56px;border-radius:var(--rpt-border-radius-xl, 12px);background:var(--rpt-color-primary-light, #eff6ff);color:var(--rpt-color-primary, #2563eb);display:flex;align-items:center;justify-content:center;margin-bottom:16px;box-shadow:0 2px 8px #2563eb1f}.empty-hero-title{font-size:var(--rpt-font-size-lg, 1.125rem);font-weight:700;color:var(--rpt-color-text, #0f172a);margin:0 0 8px;letter-spacing:-.01em}.empty-hero-desc{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #64748b);max-width:520px;line-height:1.5;margin:0 0 24px}.empty-hero-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}.empty-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;font-size:var(--rpt-font-size-sm, .75rem);font-weight:600;border-radius:var(--rpt-border-radius, 6px);cursor:pointer;transition:all var(--rpt-transition-speed, .15s) ease;font-family:inherit}.empty-btn-primary{background:var(--rpt-color-primary, #2563eb);color:#fff;border:1px solid var(--rpt-color-primary, #2563eb);box-shadow:0 1px 3px #2563eb33}.empty-btn-primary:hover{background:var(--rpt-color-primary-hover, #1d4ed8);border-color:var(--rpt-color-primary-hover, #1d4ed8);transform:translateY(-1px)}.empty-btn-secondary{background:#f8fafc;color:#334155;border:1px solid var(--rpt-color-border, #cbd5e1)}.empty-btn-secondary:hover{background:#f1f5f9;color:#0f172a;border-color:#94a3b8;transform:translateY(-1px)}.empty-btn-outline{background:#fff;color:var(--rpt-color-primary, #2563eb);border:1px solid #bfdbfe}.empty-btn-outline:hover{background:#eff6ff;border-color:var(--rpt-color-primary, #2563eb);transform:translateY(-1px)}.canvas-active-input{width:100%;height:32px;padding:4px 8px;font-size:.8125rem;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;outline:none;box-sizing:border-box;background:#fff;color:#0f172a;transition:border-color .15s ease}.canvas-active-input:focus{border-color:var(--rpt-color-primary, #2563eb)}.canvas-active-checkbox-lbl{display:inline-flex;align-items:center;gap:6px;cursor:pointer}.canvas-live-control-wrapper{width:100%;max-width:100%;min-width:0;position:relative;z-index:1;box-sizing:border-box}.canvas-grid-box{margin-top:24px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:8px;background:#fff;box-shadow:0 1px 3px #0000000d;overflow:hidden}.grid-preview-header{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--rpt-color-surface, #f8fafc);border-bottom:1px solid var(--rpt-color-border, #cbd5e1);font-size:.8rem;font-weight:600;color:var(--rpt-color-text, #0f172a)}.grid-title{font-weight:700}.grid-exec-badge{font-size:.6875rem;font-weight:600;padding:2px 8px;border-radius:10px}.grid-exec-badge.is-loading{background:#eff6ff;color:#2563eb}.grid-exec-badge.is-error{background:#fee2e2;color:#ef4444}.grid-exec-badge.is-success{background:#ecfdf5;color:#059669}.btn-canvas-run-grid{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;font-size:.72rem;font-weight:600;color:#fff;background:var(--rpt-color-primary, #2563eb);border:none;border-radius:4px;cursor:pointer;transition:background .15s ease}.btn-canvas-run-grid:hover:not(:disabled){background:#1d4ed8}.btn-canvas-run-grid:disabled{opacity:.6;cursor:not-allowed}.btn-canvas-edit-grid{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;font-size:.72rem;font-weight:500;color:#334155;background:#fff;border:1px solid #cbd5e1;border-radius:4px;cursor:pointer;transition:all .12s ease}.btn-canvas-edit-grid:hover{background:#f1f5f9}.canvas-live-grid-container{width:100%;min-height:480px;background:#fff}.live-mode-badge{display:inline-flex;align-items:center;gap:4px;font-size:.6875rem;font-weight:700;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;padding:1px 8px;border-radius:9999px}.canvas-component-card.is-field-highlighted{border-color:#f59e0b!important;box-shadow:0 0 0 3px #f59e0b59!important;animation:rpt-pulse-border 1s ease-in-out infinite alternate}@keyframes rpt-pulse-border{0%{box-shadow:0 0 0 2px #f59e0b40}to{box-shadow:0 0 0 5px #f59e0b80}}.grid-layout-status-strip{display:flex;align-items:center;justify-content:space-between;padding:6px 16px;background:#f1f5f9;border-bottom:1px solid var(--rpt-color-border, #cbd5e1);font-size:.6875rem;color:#475569}.grid-status-info{display:inline-flex;align-items:center;gap:6px;font-weight:600}.grid-status-sync{display:inline-flex;align-items:center;gap:4px;color:#059669;font-weight:600;transition:transform .2s ease}.grid-status-sync.is-pulsing{transform:scale(1.08);color:#047857}.canvas-actions{display:flex;align-items:center;gap:8px}.btn-grid-add{background:#f0fdf4;border-color:#bbf7d0;color:#16a34a}.btn-grid-add:hover{background:#dcfce7;border-color:#86efac;color:#15803d}.btn-remove-grid{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;color:#94a3b8;border-radius:4px;cursor:pointer;transition:all .15s ease}.btn-remove-grid:hover{background:#fee2e2;color:#ef4444}.canvas-add-grid-banner{margin-top:24px;border:2px dashed #cbd5e1;border-radius:8px;background:#fff;padding:16px 20px;display:flex;align-items:center;gap:16px;cursor:pointer;transition:all .15s ease}.canvas-add-grid-banner:hover{border-color:#2563eb;background:#f8fafc;box-shadow:0 2px 8px #2563eb14}.add-grid-icon{width:40px;height:40px;border-radius:8px;background:#eff6ff;color:#2563eb;display:flex;align-items:center;justify-content:center;flex-shrink:0}.add-grid-text{display:flex;flex-direction:column;gap:2px;flex:1}.add-grid-title{font-size:.875rem;font-weight:600;color:#0f172a}.add-grid-sub{font-size:.75rem;color:#64748b}.btn-banner-add{padding:6px 14px;font-size:.75rem;font-weight:600;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:6px;cursor:pointer;white-space:nowrap;transition:all .15s ease}.canvas-add-grid-banner:hover .btn-banner-add{background:#2563eb;color:#fff;border-color:#2563eb}.canvas-grid-loading-overlay{position:absolute;inset:0;background:#ffffffe6;backdrop-filter:blur(2px);z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;font-family:inherit;border-radius:6px}.grid-loading-title{font-weight:600;font-size:.95rem;color:#1e293b}.grid-loading-sub{font-size:.8rem;color:#64748b}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button,.canvas-active-input::-webkit-inner-spin-button,.canvas-active-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number],.canvas-active-input{-moz-appearance:textfield;appearance:textfield}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: i1$2.CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: i1$2.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: RptIconComponent, selector: "rpt-icon", inputs: ["name", "size", "color", "strokeWidth"] }, { kind: "component", type: RptDropdownComponent, selector: "rpt-dropdown", inputs: ["config", "control", "parentForm", "showStatus"], outputs: ["dropdownClick"] }, { kind: "component", type: RptDateComponent, selector: "rpt-date", inputs: ["config", "control"] }, { kind: "component", type: RptDateRangeComponent, selector: "rpt-date-range", inputs: ["config", "control"] }, { kind: "component", type: RptRadioComponent, selector: "rpt-radio", inputs: ["config", "control", "parentForm"] }, { kind: "component", type: ReportGridBridgeComponent, selector: "rpt-grid-bridge", inputs: ["gridDefinition", "data"], outputs: ["gridStateChange", "columnDefsChange", "rowClick", "selectionChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14271
14461
|
}
|
|
14272
14462
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignCanvasComponent, decorators: [{
|
|
14273
14463
|
type: Component,
|
|
@@ -14278,10 +14468,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
14278
14468
|
ReactiveFormsModule,
|
|
14279
14469
|
RptIconComponent,
|
|
14280
14470
|
RptDropdownComponent,
|
|
14471
|
+
RptDateComponent,
|
|
14281
14472
|
RptDateRangeComponent,
|
|
14282
14473
|
RptRadioComponent,
|
|
14283
14474
|
ReportGridBridgeComponent,
|
|
14284
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: " <div class=\"canvas-wrapper\" (click)=\"onCanvasBackgroundClick($event)\">\n <!-- Canvas Status / Quick Controls -->\n <div class=\"canvas-toolbar\">\n <div class=\"canvas-info\">\n <span class=\"info-label\">Grid Layout:</span>\n <span class=\"info-value\">{{ totalColumns() }} Columns</span>\n <span class=\"info-divider\">\u2022</span>\n <span class=\"info-label\">Components:</span>\n <span class=\"info-value\">{{ components().length }}</span>\n <span class=\"info-divider\">\u2022</span>\n <span class=\"live-mode-badge\" title=\"Interactive canvas: Values typed here run live queries and test dropdowns.\">\n \u26A1 Live Interactive Mode\n </span>\n </div>\n\n <div class=\"canvas-actions\">\n @if (!definition().grid) {\n <button\n type=\"button\"\n class=\"canvas-action-btn btn-grid-add\"\n (click)=\"addResultGrid($event)\"\n title=\"Add a Result Grid to this report\"\n >\n <rpt-icon name=\"table\" [size]=\"14\" />\n <span>+ Add Grid</span>\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"canvas-action-btn btn-grid-configured\"\n (click)=\"selectGridSettings($event)\"\n title=\"Configure Result Data Grid\"\n >\n <rpt-icon name=\"table\" [size]=\"14\" />\n <span>Grid ({{ definition().grid?.columns?.length ?? 0 }})</span>\n </button>\n }\n\n <button\n type=\"button\"\n class=\"canvas-action-btn\"\n (click)=\"selectReportSettings($event)\"\n title=\"Configure Page Layout & Grid Settings\"\n >\n <rpt-icon name=\"settings\" [size]=\"14\" />\n <span>Report Settings</span>\n </button>\n </div>\n </div>\n\n <!-- Canvas Drop Area -->\n <div class=\"canvas-scroll-area\" cdkScrollable>\n <div\n class=\"canvas-artboard\"\n [style.padding.px]=\"definition().layout.padding ?? 24\"\n >\n <!-- Report Header Preview -->\n <div class=\"canvas-report-header\">\n <h2 class=\"canvas-report-title\">{{ definition().name || 'Untitled Report' }}</h2>\n @if (definition().description) {\n <p class=\"canvas-report-desc\">{{ definition().description }}</p>\n }\n </div>\n\n <!-- Component Drop List Grid with 2D mixed orientation and data binding -->\n <div\n cdkDropList\n id=\"designer-canvas-drop-list\"\n class=\"canvas-grid\"\n cdkDropListOrientation=\"mixed\"\n [cdkDropListData]=\"sortedComponents()\"\n [style.grid-template-columns]=\"gridTemplateColumns()\"\n [style.gap.px]=\"definition().layout.gap ?? 16\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n @for (comp of sortedComponents(); track comp.id; let idx = $index) {\n <div\n cdkDrag\n [cdkDragData]=\"comp\"\n [cdkDragDisabled]=\"isAnyResizing()\"\n class=\"canvas-component-card\"\n [class.is-selected]=\"isSelected(comp.id)\"\n [class.is-resizing]=\"resizingCompId() === comp.id\"\n [class.is-field-highlighted]=\"isFieldHighlighted(comp)\"\n [class.is-narrow]=\"getSpan(comp) <= 4\"\n [class.is-compact]=\"getSpan(comp) <= 2\"\n [style.grid-column]=\"getGridColumn(comp)\"\n [style.grid-row]=\"getGridRow(comp)\"\n [style.width]=\"comp.layout?.width || 'auto'\"\n [style.height]=\"getComponentHeight(comp)\"\n [style.min-height]=\"getComponentMinHeight(comp)\"\n (click)=\"onSelect(comp.id, $event)\"\n >\n <!-- Card Header with Drag Handle & Actions -->\n <div class=\"card-header\">\n <div class=\"card-title-group\" cdkDragHandle title=\"Drag to reorder\">\n <span class=\"drag-handle-dots\">\u22EE\u22EE</span>\n <rpt-icon [name]=\"getComponentIconName(comp.type)\" [size]=\"14\" />\n <span class=\"comp-title\" [title]=\"comp.label || comp.key || comp.type\">\n {{ comp.label || comp.key || comp.type }}\n </span>\n </div>\n\n <div class=\"card-actions\">\n <!-- Static span pill & new row / start col pill when not hovered / not selected -->\n @if (comp.layout?.column; as col) {\n <span class=\"new-row-pill-static\" title=\"Starts at Column {{ col }}\">Col {{ col }}</span>\n } @else if (comp.layout?.newRow) {\n <span class=\"new-row-pill-static\" title=\"Starts on separate row\">\u21B3 Row</span>\n }\n <span\n class=\"span-pill-static\"\n title=\"Column span: {{ getSpan(comp) }} of {{ totalColumns() }} columns\"\n >\n {{ getSpan(comp) }}/{{ totalColumns() }}\n </span>\n\n <!-- Quick Action Stepper & Buttons (revealed on hover or selection) -->\n <div class=\"card-quick-controls\">\n <button\n type=\"button\"\n class=\"card-action-btn\"\n [class.btn-active-toggle]=\"comp.layout?.newRow\"\n (click)=\"toggleNewRow(comp, $event)\"\n title=\"{{ comp.layout?.newRow ? 'Starts on new row (Click to place inline)' : 'Start on separate row (Row Break)' }}\"\n >\n <rpt-icon name=\"corner-down-right\" [size]=\"11\" />\n </button>\n\n <div class=\"span-control-group\" title=\"Adjust Column Span\">\n <button\n type=\"button\"\n class=\"span-btn\"\n [disabled]=\"getSpan(comp) <= 1\"\n (click)=\"adjustSpan(comp, -1, $event)\"\n title=\"Shrink Column Span\"\n >\n <rpt-icon name=\"minus\" [size]=\"9\" />\n </button>\n <span class=\"span-badge\" [title]=\"'Column span: ' + getSpan(comp) + ' of ' + totalColumns()\">\n <span class=\"span-num\">{{ getSpan(comp) }}</span><span class=\"span-total\">/{{ totalColumns() }}</span>\n </span>\n <button\n type=\"button\"\n class=\"span-btn\"\n [disabled]=\"getSpan(comp) >= totalColumns()\"\n (click)=\"adjustSpan(comp, 1, $event)\"\n title=\"Expand Column Span\"\n >\n <rpt-icon name=\"plus\" [size]=\"9\" />\n </button>\n </div>\n\n <button\n type=\"button\"\n class=\"card-action-btn\"\n (click)=\"onDuplicate(comp.id, $event)\"\n title=\"Duplicate component\"\n >\n <rpt-icon name=\"copy\" [size]=\"12\" />\n </button>\n <button\n type=\"button\"\n class=\"card-action-btn btn-delete\"\n (click)=\"onDelete(comp.id, $event)\"\n title=\"Remove component\"\n >\n <rpt-icon name=\"trash\" [size]=\"12\" />\n </button>\n </div>\n </div>\n </div>\n\n <!-- Card Body Visual Preview -->\n <div class=\"card-body\">\n\n @switch (comp.type) {\n @case ('input') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Input' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"text\"\n class=\"canvas-active-input\"\n [placeholder]=\"comp.properties?.['placeholder'] || 'Enter text...'\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-input-box\">{{ comp.properties?.['placeholder'] || 'Enter text...' }}</div>\n }\n </div>\n }\n @case ('dropdown') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-dropdown\n [config]=\"comp\"\n [showStatus]=\"true\"\n [parentForm]=\"canvasForm()\"\n [control]=\"getCanvasControl(comp)\"\n (dropdownClick)=\"onControlInteract(comp)\"\n />\n </div>\n }\n @case ('date') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Date' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"date\"\n class=\"canvas-active-input\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-select-box\">\n <span>YYYY-MM-DD</span>\n <rpt-icon name=\"calendar\" [size]=\"12\" />\n </div>\n }\n </div>\n }\n @case ('date-range') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-date-range\n [config]=\"comp\"\n [control]=\"getCanvasControl(comp)\"\n />\n </div>\n }\n @case ('number') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Number' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"number\"\n class=\"canvas-active-input\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-input-box\">\n {{ comp.properties?.['prefix'] || '' }} 0.00 {{ comp.properties?.['suffix'] || '' }}\n </div>\n }\n </div>\n }\n @case ('checkbox') {\n <div class=\"mock-checkbox-field\" (click)=\"onControlInteract(comp, $event)\">\n @if (getCanvasControl(comp); as ctrl) {\n <label class=\"canvas-active-checkbox-lbl\">\n <input type=\"checkbox\" [formControl]=\"ctrl\" (focus)=\"onControlInteract(comp, $event)\" />\n <span class=\"mock-label\">{{ comp.label || 'Checkbox' }}</span>\n </label>\n } @else {\n <span class=\"mock-check-box\">\n <rpt-icon name=\"check\" [size]=\"10\" />\n </span>\n <span class=\"mock-label\">{{ comp.label || 'Checkbox' }}</span>\n }\n </div>\n }\n @case ('radio') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-radio\n [config]=\"comp\"\n [control]=\"getCanvasControl(comp)\"\n [parentForm]=\"canvasForm()\"\n />\n </div>\n }\n @case ('button') {\n <div class=\"mock-btn-wrapper\">\n <button\n type=\"button\"\n class=\"mock-btn\"\n [class]=\"'btn-' + (comp.properties?.['variant'] || 'primary')\"\n [class.mock-btn-full]=\"comp.properties?.['fullWidth'] === true || comp.layout?.width === '100%'\"\n [style.height]=\"getCustomBtnHeight(comp)\"\n [style.width]=\"getCustomBtnWidth(comp)\"\n (click)=\"onCanvasButtonClick(comp, $event)\"\n >\n @if (getCustomBtnIcon(comp); as btnIcon) {\n <rpt-icon [name]=\"btnIcon\" [size]=\"15\" />\n }\n <span>{{ comp.label || 'Button' }}</span>\n </button>\n </div>\n }\n @case ('kpi-card') {\n <div class=\"mock-kpi-field\">\n <div class=\"mock-kpi-header\">\n <span class=\"mock-label\">{{ comp.label || 'KPI Metric' }}</span>\n <rpt-icon name=\"kpi\" [size]=\"14\" />\n </div>\n <div class=\"mock-kpi-value\">{{ comp.properties?.['value'] || '$128,450' }}</div>\n <div class=\"mock-kpi-footer\">\n <span class=\"mock-kpi-trend\">+12.5%</span>\n <span class=\"mock-kpi-sub\">vs last period</span>\n </div>\n </div>\n }\n @case ('chart') {\n <div class=\"mock-chart-field\">\n <div class=\"mock-chart-header\">\n <span class=\"mock-label\">{{ comp.label || 'Quarterly Sales Revenue ($000)' }}</span>\n </div>\n <div class=\"mock-chart-bars\">\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 44%\"></div>\n <span class=\"mock-bar-lbl\">Q1 Jan-Mar</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 61%\"></div>\n <span class=\"mock-bar-lbl\">Q2 Apr-Jun</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 79%\"></div>\n <span class=\"mock-bar-lbl\">Q3 Jul-Sep</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 100%\"></div>\n <span class=\"mock-bar-lbl\">Q4 Oct-Dec</span>\n </div>\n </div>\n </div>\n }\n @default {\n <div class=\"mock-generic-box\">\n <span>{{ comp.type }}</span>\n </div>\n }\n }\n </div>\n\n <!-- Resizing Handles (East, South, South-East) -->\n <div\n class=\"resize-handle handle-e\"\n (pointerdown)=\"startResize($event, comp, 'e')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize column width \u2022 Double-click to reset\"\n ></div>\n <div\n class=\"resize-handle handle-s\"\n (pointerdown)=\"startResize($event, comp, 's')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize height \u2022 Double-click to reset\"\n ></div>\n <div\n class=\"resize-handle handle-se\"\n (pointerdown)=\"startResize($event, comp, 'se')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize width and height \u2022 Double-click to reset\"\n ></div>\n\n <!-- Resizing Dimension Ghost / Badge -->\n @if (resizingCompId() === comp.id) {\n <div class=\"resize-dimension-tooltip\">\n {{ resizingTooltip(comp) }}\n </div>\n }\n\n <!-- Drag placeholder with matched grid column span -->\n <div\n *cdkDragPlaceholder\n class=\"canvas-drag-placeholder\"\n [style.grid-column]=\"getGridColumn(comp)\"\n ></div>\n\n <!-- Drag preview -->\n <div *cdkDragPreview class=\"canvas-drag-preview\">\n <span class=\"drag-handle-dots\">\u22EE\u22EE</span>\n <rpt-icon [name]=\"getComponentIconName(comp.type)\" [size]=\"14\" />\n <span class=\"preview-title\">{{ comp.label || comp.key || comp.type }}</span>\n <span class=\"preview-span\">{{ getSpan(comp) }}/{{ totalColumns() }}</span>\n </div>\n </div>\n }\n\n @if (components().length === 0) {\n <div class=\"canvas-empty-state\" role=\"region\" aria-label=\"Empty canvas starter options\">\n <div class=\"empty-hero-badge\">\n <rpt-icon name=\"design\" [size]=\"28\" />\n </div>\n <h3 class=\"empty-hero-title\">Start Designing Your Custom Report</h3>\n <p class=\"empty-hero-desc\">\n Drag controls from the left component palette, or jumpstart your design with pre-configured enterprise blueprints.\n </p>\n\n <div class=\"empty-hero-actions\">\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-primary\"\n (click)=\"applyBlueprint('blueprint-audit-register')\"\n title=\"Load complete Audit Register blueprint with parameters and result grid\"\n >\n <rpt-icon name=\"table\" [size]=\"15\" />\n <span>Audit Register Blueprint</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-secondary\"\n (click)=\"applyBlueprint('blueprint-kpi-summary')\"\n title=\"Load Executive KPI summary blueprint\"\n >\n <rpt-icon name=\"chart-bar\" [size]=\"15\" />\n <span>KPI Summary Blueprint</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-outline\"\n (click)=\"addStarterComponent('date-range')\"\n title=\"Add a Date Range filter component\"\n >\n <rpt-icon name=\"calendar\" [size]=\"14\" />\n <span>+ Add Date Filter</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-outline\"\n (click)=\"addStarterComponent('button')\"\n title=\"Add an Execute Action button\"\n >\n <rpt-icon name=\"play\" [size]=\"14\" />\n <span>+ Add Run Button</span>\n </button>\n </div>\n </div>\n }\n </div>\n\n <!-- Live Result Grid Preview with Bways-Grid Features -->\n @if (definition().grid) {\n <div class=\"canvas-grid-box\">\n <div class=\"grid-preview-header\">\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <rpt-icon name=\"table\" [size]=\"15\" />\n <span class=\"grid-title\">Bways Grid ({{ definition().grid?.columns?.length ?? 0 }} columns)</span>\n @if (isExecutingGrid()) {\n <span class=\"grid-exec-badge is-loading\">Loading data from database...</span>\n } @else if (gridExecError()) {\n <span class=\"grid-exec-badge is-error\">{{ gridExecError() }}</span>\n } @else if (canvasGridData().length > 0) {\n <span class=\"grid-exec-badge is-success\">{{ canvasGridData().length }} rows loaded</span>\n }\n </div>\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <button\n type=\"button\"\n class=\"btn-canvas-run-grid\"\n (click)=\"executeCanvasReport($event)\"\n [disabled]=\"isExecutingGrid()\"\n title=\"Execute query and load data into Bways Grid\"\n >\n <rpt-icon name=\"play\" [size]=\"11\" />\n <span>{{ isExecutingGrid() ? 'Running...' : 'Run / Refresh Grid' }}</span>\n </button>\n <button\n type=\"button\"\n class=\"btn-canvas-edit-grid\"\n (click)=\"selectGridSettings($event)\"\n title=\"Configure columns and grid options\"\n >\n <rpt-icon name=\"settings\" [size]=\"11\" />\n <span>Configure</span>\n </button>\n <button\n type=\"button\"\n class=\"btn-remove-grid\"\n (click)=\"removeGrid($event)\"\n title=\"Remove Result Grid from this report\"\n >\n <rpt-icon name=\"trash\" [size]=\"13\" />\n </button>\n </div>\n </div>\n\n @if (getGridSummaryText(); as summary) {\n <div class=\"grid-layout-status-strip\">\n <div class=\"grid-status-info\">\n <rpt-icon name=\"table\" [size]=\"12\" />\n <span>{{ summary }}</span>\n </div>\n <div class=\"grid-status-sync\" [class.is-pulsing]=\"layoutJustUpdated()\">\n <rpt-icon name=\"check\" [size]=\"11\" />\n <span>Layout auto-persisted</span>\n </div>\n </div>\n }\n\n <!-- Live Bways Grid bridge -->\n <div class=\"canvas-live-grid-container\" (click)=\"$event.stopPropagation()\" style=\"position: relative; min-height: 250px;\">\n @if (isExecutingGrid()) {\n <div class=\"canvas-grid-loading-overlay\">\n <span class=\"status-dot dot-pulse\" style=\"width: 14px; height: 14px; color: #2563eb; background: #2563eb; border-radius: 50%;\"></span>\n <span class=\"grid-loading-title\">Executing stored procedure on SQL Server...</span>\n <span class=\"grid-loading-sub\">Calculating outstanding balances and ledger amounts. Please wait...</span>\n </div>\n }\n <rpt-grid-bridge\n [gridDefinition]=\"definition().grid!\"\n [data]=\"canvasGridData()\"\n (gridStateChange)=\"onCanvasGridStateChange($event)\"\n (columnDefsChange)=\"onCanvasColumnDefsChange($event)\"\n />\n </div>\n </div>\n } @else {\n <div class=\"canvas-add-grid-banner\" (click)=\"addResultGrid($event)\">\n <div class=\"add-grid-icon\">\n <rpt-icon name=\"table\" [size]=\"20\" />\n </div>\n <div class=\"add-grid-text\">\n <span class=\"add-grid-title\">+ Add Result Data Grid</span>\n <span class=\"add-grid-sub\">Attach an interactive data table or UltraGrid to display report execution output</span>\n </div>\n <button type=\"button\" class=\"btn-banner-add\">Add Grid</button>\n </div>\n }\n </div>\n </div>\n </div>", styles: [":host{display:block;flex:1;min-height:0;min-width:0;height:100%;background-color:#f1f5f9;font-family:var(--rpt-font-family, inherit);box-sizing:border-box}.canvas-wrapper{min-height:0;display:flex;flex-direction:column;height:100%}.canvas-toolbar{display:flex;align-items:center;justify-content:space-between;min-height:42px;height:42px;padding:0 24px;background:var(--rpt-color-surface, #ffffff);border-bottom:1px solid var(--rpt-color-border, #cbd5e1);box-sizing:border-box;gap:12px;overflow-x:auto;scrollbar-width:none;font-family:var(--rpt-font-family, inherit);flex-shrink:0}.canvas-toolbar::-webkit-scrollbar{display:none}.canvas-info{display:flex;align-items:center;gap:8px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-sm, .75rem);color:var(--rpt-color-text-muted, #64748b);white-space:nowrap;line-height:1}.info-label{color:var(--rpt-color-text-muted, #64748b);font-weight:500;font-size:var(--rpt-font-size-sm, .75rem)}.info-value{font-weight:600;color:var(--rpt-color-text, #0f172a);font-size:var(--rpt-font-size-sm, .75rem)}.info-divider{color:var(--rpt-color-border, #cbd5e1);margin:0 2px}.live-mode-badge{display:inline-flex;align-items:center;gap:4px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-xs, .7rem);font-weight:600;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;padding:2px 8px;border-radius:9999px;line-height:1}.canvas-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}.canvas-action-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;letter-spacing:-.01em;color:var(--rpt-color-text-secondary, #334155);background:var(--rpt-color-surface, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);cursor:pointer;line-height:1;white-space:nowrap;box-shadow:0 1px 2px #0000000a;transition:all var(--rpt-transition-speed, .15s) ease}.canvas-action-btn:hover{background:var(--rpt-color-surface-hover, #f8fafc);border-color:var(--rpt-color-border-hover, #94a3b8);color:var(--rpt-color-text, #0f172a);box-shadow:0 2px 4px #0000000f}.canvas-action-btn.btn-grid-configured{background:#eff6ff;border-color:#bfdbfe;color:#2563eb;font-weight:600}.canvas-action-btn.btn-grid-configured:hover{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}.canvas-action-btn.btn-grid-add{background:#f0fdf4;border-color:#bbf7d0;color:#16a34a;font-weight:600}.canvas-action-btn.btn-grid-add:hover{background:#dcfce7;color:#15803d;border-color:#86efac}.canvas-action-btn:active{transform:translateY(1px)}.canvas-scroll-area{flex:1;min-height:0;overflow-y:auto;padding:16px}.canvas-artboard{width:100%;max-width:1400px;margin:0 auto;background:#fff;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-lg, 8px);box-shadow:0 4px 6px -1px #0000000d;min-height:480px;box-sizing:border-box}@media (max-width: 900px){.canvas-toolbar{min-height:36px;height:36px;padding:0 10px;gap:6px}.live-mode-badge{display:none}.canvas-info{font-size:.75rem;gap:5px}.canvas-action-btn{padding:0 8px;font-size:.725rem;height:28px;gap:4px}.canvas-scroll-area{padding:10px}.canvas-artboard{min-height:360px}}@media (max-width: 600px){.canvas-toolbar{padding:0 8px;gap:4px}.canvas-info .info-label,.canvas-action-btn span{display:none}.canvas-action-btn{padding:0 6px;min-width:28px;justify-content:center}}.canvas-report-header{margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid var(--rpt-color-border, #e2e8f0)}.canvas-report-title{font-size:var(--rpt-font-size-xl, 1.5rem);font-weight:700;color:var(--rpt-color-text, #0f172a);margin:0 0 6px}.canvas-report-desc{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #64748b);margin:0}.canvas-grid{display:grid;width:100%;min-height:180px;align-items:start;border-radius:6px;transition:all var(--rpt-transition-speed, .15s) ease}.canvas-component-card{container-type:inline-size;background:#fff;border:1.5px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);box-shadow:var(--rpt-box-shadow, 0 1px 2px rgba(0, 0, 0, .05));box-sizing:border-box;transition:all var(--rpt-transition-speed, .15s) ease;cursor:pointer;position:relative;overflow:visible;display:flex;flex-direction:column;min-height:104px;z-index:1}.canvas-component-card:hover{border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 4px 6px -1px #2563eb1a;z-index:2}.canvas-component-card.is-selected{border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 0 0 2px #2563eb40;z-index:10}.canvas-component-card:focus-within,.canvas-component-card:has(.rpt-combobox-menu),.canvas-component-card:has(.is-open){z-index:100}.canvas-component-card.is-resizing{-webkit-user-select:none;user-select:none;border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 0 0 2px #2563eb59;z-index:30;transition:none!important}.resize-handle{position:absolute;z-index:20;touch-action:none;opacity:0;pointer-events:none;transition:opacity .15s ease}.canvas-component-card.is-selected .resize-handle{opacity:1;pointer-events:auto}.resize-handle.handle-e{top:0;right:0;width:6px;height:100%;cursor:ew-resize;display:flex;align-items:center;justify-content:center}.resize-handle.handle-e:after{content:\"\";width:3px;height:24px;background:#cbd5e1;border-radius:2px;transition:background .15s ease}.resize-handle.handle-e:hover:after,.canvas-component-card.is-selected .resize-handle.handle-e:after{background:var(--rpt-color-primary, #2563eb)}.resize-handle.handle-s{bottom:0;left:0;height:6px;width:100%;cursor:ns-resize;display:flex;align-items:center;justify-content:center}.resize-handle.handle-s:after{content:\"\";height:3px;width:24px;background:#cbd5e1;border-radius:2px;transition:background .15s ease}.resize-handle.handle-s:hover:after,.canvas-component-card.is-selected .resize-handle.handle-s:after{background:var(--rpt-color-primary, #2563eb)}.resize-handle.handle-se{bottom:0;right:0;width:12px;height:12px;cursor:nwse-resize;display:flex;align-items:flex-end;justify-content:flex-end;padding:2px}.resize-handle.handle-se:after{content:\"\";width:5px;height:5px;border-right:2px solid #cbd5e1;border-bottom:2px solid #cbd5e1;transition:border-color .15s ease}.resize-handle.handle-se:hover:after,.canvas-component-card.is-selected .resize-handle.handle-se:after{border-color:var(--rpt-color-primary, #2563eb)}.resize-dimension-tooltip{position:absolute;top:38px;right:8px;background:#0f172ae6;color:#fff;font-size:.7rem;font-weight:600;padding:3px 8px;border-radius:4px;white-space:nowrap;pointer-events:none;z-index:50;box-shadow:0 2px 4px #0003}.card-header{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:5px 8px;background:var(--rpt-color-surface, #f8fafc);border-bottom:1px solid var(--rpt-color-border, #e2e8f0);border-top-left-radius:var(--rpt-border-radius, 6px);border-top-right-radius:var(--rpt-border-radius, 6px);min-height:32px;box-sizing:border-box;overflow:hidden;position:relative}.canvas-component-card.is-selected .card-header{overflow:visible}.card-title-group{display:flex;align-items:center;gap:5px;cursor:grab;min-width:0;flex:1;overflow:hidden}.drag-handle-dots{color:var(--rpt-color-text-muted, #94a3b8);font-size:.85rem;letter-spacing:-2px;flex-shrink:0;-webkit-user-select:none;user-select:none}.comp-title{font-size:.75rem;font-weight:600;color:var(--rpt-color-text, #0f172a);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;user-select:none}.card-actions{display:flex;align-items:center;gap:4px;flex-shrink:0;margin-left:auto}.new-row-pill-static{font-size:.65rem;font-weight:600;color:#7c3aed;background:#f5f3ff;border:1px solid #ddd6fe;padding:1px 5px;border-radius:9999px;white-space:nowrap;line-height:1;flex-shrink:0}.span-pill-static{display:inline-flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:600;color:var(--rpt-color-text-muted, #64748b);background:var(--rpt-color-surface, #f1f5f9);border:1px solid var(--rpt-color-border, #e2e8f0);padding:1px 6px;border-radius:9999px;line-height:1.2;white-space:nowrap;-webkit-user-select:none;user-select:none}.card-quick-controls{display:none;align-items:center;gap:3px;flex-shrink:0}.canvas-component-card:hover .span-pill-static,.canvas-component-card.is-selected .span-pill-static,.canvas-component-card:hover .new-row-pill-static,.canvas-component-card.is-selected .new-row-pill-static{display:none}.canvas-component-card:hover .card-quick-controls,.canvas-component-card.is-selected .card-quick-controls{display:inline-flex}.canvas-component-card.is-narrow .card-header{padding:4px 6px;gap:3px}.canvas-component-card.is-narrow:hover .comp-title,.canvas-component-card.is-narrow.is-selected .comp-title,.canvas-component-card.is-narrow:hover .drag-handle-dots,.canvas-component-card.is-narrow.is-selected .drag-handle-dots{display:none}.canvas-component-card.is-narrow .card-quick-controls{gap:2px}.canvas-component-card.is-narrow .span-control-group{height:18px}.canvas-component-card.is-narrow .span-btn{width:14px;height:16px}.canvas-component-card.is-narrow .span-badge{font-size:.6rem;padding:0 2px}.canvas-component-card.is-narrow .span-total{display:none}.canvas-component-card.is-narrow .card-action-btn{width:18px;height:18px}@container (max-width: 250px){.card-header{padding:4px 6px;gap:3px}.canvas-component-card:hover .comp-title,.canvas-component-card.is-selected .comp-title,.canvas-component-card:hover .drag-handle-dots,.canvas-component-card.is-selected .drag-handle-dots,.span-total{display:none}.card-quick-controls{gap:2px}.card-action-btn{width:18px;height:18px}.span-control-group{height:18px}.span-btn{width:14px;height:16px}.span-badge{font-size:.6rem;padding:0 2px}}@container (max-width: 160px){.canvas-component-card.is-selected .card-quick-controls{position:absolute;top:-30px;right:0;background:#fff;border:1.5px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:2px 4px;gap:3px;box-shadow:0 4px 12px #2563eb2e,0 2px 4px #00000014;z-index:120;white-space:nowrap}}@media (max-width: 900px){.canvas-component-card:hover .comp-title,.canvas-component-card.is-selected .comp-title,.canvas-component-card:hover .drag-handle-dots,.canvas-component-card.is-selected .drag-handle-dots,.canvas-component-card .span-total{display:none}.canvas-component-card.is-selected .card-header{overflow:visible}.canvas-component-card.is-selected .card-quick-controls{position:absolute;top:-30px;right:0;background:#fff;border:1.5px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:2px 4px;gap:3px;box-shadow:0 4px 12px #2563eb2e,0 2px 4px #00000014;z-index:120;white-space:nowrap}}.span-control-group{display:inline-flex;align-items:center;background:#fff;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;height:20px;padding:0 1px;white-space:nowrap;flex-shrink:0}.span-btn{width:16px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0;color:var(--rpt-color-text-muted, #64748b);cursor:pointer;border-radius:2px;transition:all .12s ease}.span-btn:hover:not(:disabled){background:var(--rpt-color-surface-hover, #f1f5f9);color:var(--rpt-color-primary, #2563eb)}.span-btn:disabled{opacity:.3;cursor:not-allowed}.span-badge{font-size:.65rem;font-weight:600;color:var(--rpt-color-text, #0f172a);padding:0 3px;white-space:nowrap;-webkit-user-select:none;user-select:none;line-height:1}.span-total{font-size:.6rem;color:var(--rpt-color-text-muted, #64748b);font-weight:500}.card-action-btn{width:20px;height:20px;border:none;background:transparent;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;color:var(--rpt-color-text-muted, #64748b);transition:all .12s ease;flex-shrink:0}.card-action-btn:hover{background:#e2e8f0;color:var(--rpt-color-text, #0f172a)}.card-action-btn.btn-active-toggle{background:#7c3aed;color:#fff;border-color:#7c3aed}.card-action-btn.btn-active-toggle:hover{background:#6d28d9;color:#fff}.btn-delete:hover{background:#fee2e2;color:#ef4444}.card-body{padding:8px 10px 14px;flex:1;display:flex;flex-direction:column;min-height:0;min-width:0;max-width:100%;box-sizing:border-box;overflow:visible}.mock-input-field{display:flex;flex-direction:column;gap:4px;flex:1;height:100%;min-height:0}.mock-label{font-size:.7rem;font-weight:600;color:var(--rpt-color-text-muted, #475569);flex-shrink:0}.mock-input-box,.mock-select-box{border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:6px;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #94a3b8);background:#fff;flex:1;min-height:38px;height:100%;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box}.mock-checkbox-field{display:flex;align-items:center;gap:6px;flex:1;height:100%;min-height:0;padding-top:14px}.mock-check-box{width:18px;height:18px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:.65rem;color:var(--rpt-color-primary, #2563eb);flex-shrink:0}.mock-btn-wrapper{display:flex;flex:1;height:100%;min-height:38px;align-items:center;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box}.mock-btn{border-radius:var(--rpt-border-radius, 6px);padding:0 16px;height:36px;font-size:var(--rpt-font-size-base, .875rem);font-weight:500;border:1px solid transparent;cursor:pointer;width:auto;max-width:100%;display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:all .15s ease}.mock-btn.mock-btn-full{width:100%}.canvas-component-card.is-narrow .mock-btn{padding:0 6px;font-size:.775rem;width:100%;height:34px}.mock-kpi-field{display:flex;flex-direction:column;justify-content:space-between;flex:1;height:100%;min-height:0}.mock-kpi-header{display:flex;align-items:center;justify-content:space-between}.mock-kpi-value{font-size:1.25rem;font-weight:700;color:var(--rpt-color-text, #0f172a);margin:2px 0}.mock-kpi-footer{display:flex;align-items:center;gap:6px;font-size:.65rem}.mock-kpi-trend{color:#16a34a;font-weight:600}.mock-kpi-sub{color:#64748b}.mock-chart-field{display:flex;flex-direction:column;flex:1;height:100%;min-height:140px}.mock-chart-bars{display:flex;align-items:flex-end;justify-content:space-around;gap:16px;flex:1;min-height:100px;padding-top:12px;box-sizing:border-box}.mock-chart-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;min-width:60px;max-width:140px}.mock-chart-bar{width:38px;max-width:44px;margin:0 auto;background:var(--rpt-color-primary, #2563eb);border-radius:6px 6px 0 0;opacity:.85;min-height:10px;transition:height .2s ease}.mock-bar-lbl{font-size:.6875rem;color:#64748b;margin-top:6px;text-align:center;white-space:normal;line-height:1.2}.btn-primary{background:var(--rpt-color-primary, #2563eb);color:#fff}.btn-secondary{background:#f1f5f9;color:#0f172a;border:1px solid #cbd5e1}.btn-outline{background:transparent;color:#2563eb;border:1px solid #2563eb}.btn-danger{background:#ef4444;color:#fff}.mock-generic-box{border:1px dashed #cbd5e1;border-radius:4px;padding:8px;font-size:.75rem;text-align:center;color:#64748b}.canvas-drag-placeholder{background:#2563eb0f;border:2px dashed var(--rpt-color-primary, #2563eb);border-radius:6px;min-height:80px;box-sizing:border-box;transition:transform .15s ease}.canvas-drag-preview,::ng-deep .canvas-drag-preview{background:#fff;border:2px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:8px 14px;display:inline-flex;align-items:center;gap:8px;font-family:var(--rpt-font-family, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif)!important;font-size:.8rem;font-weight:600;color:var(--rpt-color-text, #0f172a);box-shadow:0 12px 24px -4px #00000040;z-index:10000}.preview-title,::ng-deep .preview-title{font-family:inherit!important;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview-span,::ng-deep .preview-span{font-family:inherit!important;font-size:.65rem;font-weight:600;color:var(--rpt-color-primary, #2563eb);background:#eff6ff;border:1px solid #bfdbfe;padding:1px 6px;border-radius:9999px}.canvas-empty-state{grid-column:1 / -1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:56px 28px;border:2px dashed var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-xl, 12px);background:var(--rpt-color-surface, #ffffff);text-align:center;box-shadow:var(--rpt-box-shadow-xs, 0 1px 2px 0 rgba(0, 0, 0, .04));transition:border-color var(--rpt-transition-speed, .15s) ease}.canvas-empty-state:hover{border-color:var(--rpt-color-primary, #2563eb)}.empty-hero-badge{width:56px;height:56px;border-radius:var(--rpt-border-radius-xl, 12px);background:var(--rpt-color-primary-light, #eff6ff);color:var(--rpt-color-primary, #2563eb);display:flex;align-items:center;justify-content:center;margin-bottom:16px;box-shadow:0 2px 8px #2563eb1f}.empty-hero-title{font-size:var(--rpt-font-size-lg, 1.125rem);font-weight:700;color:var(--rpt-color-text, #0f172a);margin:0 0 8px;letter-spacing:-.01em}.empty-hero-desc{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #64748b);max-width:520px;line-height:1.5;margin:0 0 24px}.empty-hero-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}.empty-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;font-size:var(--rpt-font-size-sm, .75rem);font-weight:600;border-radius:var(--rpt-border-radius, 6px);cursor:pointer;transition:all var(--rpt-transition-speed, .15s) ease;font-family:inherit}.empty-btn-primary{background:var(--rpt-color-primary, #2563eb);color:#fff;border:1px solid var(--rpt-color-primary, #2563eb);box-shadow:0 1px 3px #2563eb33}.empty-btn-primary:hover{background:var(--rpt-color-primary-hover, #1d4ed8);border-color:var(--rpt-color-primary-hover, #1d4ed8);transform:translateY(-1px)}.empty-btn-secondary{background:#f8fafc;color:#334155;border:1px solid var(--rpt-color-border, #cbd5e1)}.empty-btn-secondary:hover{background:#f1f5f9;color:#0f172a;border-color:#94a3b8;transform:translateY(-1px)}.empty-btn-outline{background:#fff;color:var(--rpt-color-primary, #2563eb);border:1px solid #bfdbfe}.empty-btn-outline:hover{background:#eff6ff;border-color:var(--rpt-color-primary, #2563eb);transform:translateY(-1px)}.canvas-active-input{width:100%;height:32px;padding:4px 8px;font-size:.8125rem;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;outline:none;box-sizing:border-box;background:#fff;color:#0f172a;transition:border-color .15s ease}.canvas-active-input:focus{border-color:var(--rpt-color-primary, #2563eb)}.canvas-active-checkbox-lbl{display:inline-flex;align-items:center;gap:6px;cursor:pointer}.canvas-live-control-wrapper{width:100%;max-width:100%;min-width:0;position:relative;z-index:1;box-sizing:border-box}.canvas-grid-box{margin-top:24px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:8px;background:#fff;box-shadow:0 1px 3px #0000000d;overflow:hidden}.grid-preview-header{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--rpt-color-surface, #f8fafc);border-bottom:1px solid var(--rpt-color-border, #cbd5e1);font-size:.8rem;font-weight:600;color:var(--rpt-color-text, #0f172a)}.grid-title{font-weight:700}.grid-exec-badge{font-size:.6875rem;font-weight:600;padding:2px 8px;border-radius:10px}.grid-exec-badge.is-loading{background:#eff6ff;color:#2563eb}.grid-exec-badge.is-error{background:#fee2e2;color:#ef4444}.grid-exec-badge.is-success{background:#ecfdf5;color:#059669}.btn-canvas-run-grid{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;font-size:.72rem;font-weight:600;color:#fff;background:var(--rpt-color-primary, #2563eb);border:none;border-radius:4px;cursor:pointer;transition:background .15s ease}.btn-canvas-run-grid:hover:not(:disabled){background:#1d4ed8}.btn-canvas-run-grid:disabled{opacity:.6;cursor:not-allowed}.btn-canvas-edit-grid{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;font-size:.72rem;font-weight:500;color:#334155;background:#fff;border:1px solid #cbd5e1;border-radius:4px;cursor:pointer;transition:all .12s ease}.btn-canvas-edit-grid:hover{background:#f1f5f9}.canvas-live-grid-container{width:100%;min-height:480px;background:#fff}.live-mode-badge{display:inline-flex;align-items:center;gap:4px;font-size:.6875rem;font-weight:700;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;padding:1px 8px;border-radius:9999px}.canvas-component-card.is-field-highlighted{border-color:#f59e0b!important;box-shadow:0 0 0 3px #f59e0b59!important;animation:rpt-pulse-border 1s ease-in-out infinite alternate}@keyframes rpt-pulse-border{0%{box-shadow:0 0 0 2px #f59e0b40}to{box-shadow:0 0 0 5px #f59e0b80}}.grid-layout-status-strip{display:flex;align-items:center;justify-content:space-between;padding:6px 16px;background:#f1f5f9;border-bottom:1px solid var(--rpt-color-border, #cbd5e1);font-size:.6875rem;color:#475569}.grid-status-info{display:inline-flex;align-items:center;gap:6px;font-weight:600}.grid-status-sync{display:inline-flex;align-items:center;gap:4px;color:#059669;font-weight:600;transition:transform .2s ease}.grid-status-sync.is-pulsing{transform:scale(1.08);color:#047857}.canvas-actions{display:flex;align-items:center;gap:8px}.btn-grid-add{background:#f0fdf4;border-color:#bbf7d0;color:#16a34a}.btn-grid-add:hover{background:#dcfce7;border-color:#86efac;color:#15803d}.btn-remove-grid{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;color:#94a3b8;border-radius:4px;cursor:pointer;transition:all .15s ease}.btn-remove-grid:hover{background:#fee2e2;color:#ef4444}.canvas-add-grid-banner{margin-top:24px;border:2px dashed #cbd5e1;border-radius:8px;background:#fff;padding:16px 20px;display:flex;align-items:center;gap:16px;cursor:pointer;transition:all .15s ease}.canvas-add-grid-banner:hover{border-color:#2563eb;background:#f8fafc;box-shadow:0 2px 8px #2563eb14}.add-grid-icon{width:40px;height:40px;border-radius:8px;background:#eff6ff;color:#2563eb;display:flex;align-items:center;justify-content:center;flex-shrink:0}.add-grid-text{display:flex;flex-direction:column;gap:2px;flex:1}.add-grid-title{font-size:.875rem;font-weight:600;color:#0f172a}.add-grid-sub{font-size:.75rem;color:#64748b}.btn-banner-add{padding:6px 14px;font-size:.75rem;font-weight:600;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:6px;cursor:pointer;white-space:nowrap;transition:all .15s ease}.canvas-add-grid-banner:hover .btn-banner-add{background:#2563eb;color:#fff;border-color:#2563eb}.canvas-grid-loading-overlay{position:absolute;inset:0;background:#ffffffe6;backdrop-filter:blur(2px);z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;font-family:inherit;border-radius:6px}.grid-loading-title{font-weight:600;font-size:.95rem;color:#1e293b}.grid-loading-sub{font-size:.8rem;color:#64748b}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button,.canvas-active-input::-webkit-inner-spin-button,.canvas-active-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number],.canvas-active-input{-moz-appearance:textfield;appearance:textfield}\n"] }]
|
|
14475
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: " <div class=\"canvas-wrapper\" (click)=\"onCanvasBackgroundClick($event)\">\n <!-- Canvas Status / Quick Controls -->\n <div class=\"canvas-toolbar\">\n <div class=\"canvas-info\">\n <span class=\"info-label\">Grid Layout:</span>\n <span class=\"info-value\">{{ totalColumns() }} Columns</span>\n <span class=\"info-divider\">\u2022</span>\n <span class=\"info-label\">Components:</span>\n <span class=\"info-value\">{{ components().length }}</span>\n <span class=\"info-divider\">\u2022</span>\n <span class=\"live-mode-badge\" title=\"Interactive canvas: Values typed here run live queries and test dropdowns.\">\n \u26A1 Live Interactive Mode\n </span>\n </div>\n\n <div class=\"canvas-actions\">\n @if (!definition().grid) {\n <button\n type=\"button\"\n class=\"canvas-action-btn btn-grid-add\"\n (click)=\"addResultGrid($event)\"\n title=\"Add a Result Grid to this report\"\n >\n <rpt-icon name=\"table\" [size]=\"14\" />\n <span>+ Add Grid</span>\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"canvas-action-btn btn-grid-configured\"\n (click)=\"selectGridSettings($event)\"\n title=\"Configure Result Data Grid\"\n >\n <rpt-icon name=\"table\" [size]=\"14\" />\n <span>Grid ({{ definition().grid?.columns?.length ?? 0 }})</span>\n </button>\n }\n\n <button\n type=\"button\"\n class=\"canvas-action-btn\"\n (click)=\"selectReportSettings($event)\"\n title=\"Configure Page Layout & Grid Settings\"\n >\n <rpt-icon name=\"settings\" [size]=\"14\" />\n <span>Report Settings</span>\n </button>\n </div>\n </div>\n\n <!-- Canvas Drop Area -->\n <div class=\"canvas-scroll-area\" cdkScrollable>\n <div\n class=\"canvas-artboard\"\n [style.padding.px]=\"definition().layout.padding ?? 24\"\n >\n <!-- Report Header Preview -->\n <div class=\"canvas-report-header\">\n <h2 class=\"canvas-report-title\">{{ definition().name || 'Untitled Report' }}</h2>\n @if (definition().description) {\n <p class=\"canvas-report-desc\">{{ definition().description }}</p>\n }\n </div>\n\n <!-- Component Drop List Grid with 2D mixed orientation and data binding -->\n <div\n cdkDropList\n id=\"designer-canvas-drop-list\"\n class=\"canvas-grid\"\n cdkDropListOrientation=\"mixed\"\n [cdkDropListData]=\"sortedComponents()\"\n [style.grid-template-columns]=\"gridTemplateColumns()\"\n [style.gap.px]=\"definition().layout.gap ?? 16\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n @for (comp of sortedComponents(); track comp.id; let idx = $index) {\n <div\n cdkDrag\n [cdkDragData]=\"comp\"\n [cdkDragDisabled]=\"isAnyResizing()\"\n class=\"canvas-component-card\"\n [class.is-selected]=\"isSelected(comp.id)\"\n [class.is-resizing]=\"resizingCompId() === comp.id\"\n [class.is-field-highlighted]=\"isFieldHighlighted(comp)\"\n [class.is-narrow]=\"getSpan(comp) <= 4\"\n [class.is-compact]=\"getSpan(comp) <= 2\"\n [style.grid-column]=\"getGridColumn(comp)\"\n [style.grid-row]=\"getGridRow(comp)\"\n [style.width]=\"comp.layout?.width || 'auto'\"\n [style.height]=\"getComponentHeight(comp)\"\n [style.min-height]=\"getComponentMinHeight(comp)\"\n (click)=\"onSelect(comp.id, $event)\"\n >\n <!-- Card Header with Drag Handle & Actions -->\n <div class=\"card-header\">\n <div class=\"card-title-group\" cdkDragHandle title=\"Drag to reorder\">\n <span class=\"drag-handle-dots\">\u22EE\u22EE</span>\n <rpt-icon [name]=\"getComponentIconName(comp.type)\" [size]=\"14\" />\n <span class=\"comp-title\" [title]=\"comp.label || comp.key || comp.type\">\n {{ comp.label || comp.key || comp.type }}\n </span>\n </div>\n\n <div class=\"card-actions\">\n <!-- Static span pill & new row / start col pill when not hovered / not selected -->\n @if (comp.layout?.column; as col) {\n <span class=\"new-row-pill-static\" title=\"Starts at Column {{ col }}\">Col {{ col }}</span>\n } @else if (comp.layout?.newRow) {\n <span class=\"new-row-pill-static\" title=\"Starts on separate row\">\u21B3 Row</span>\n }\n <span\n class=\"span-pill-static\"\n title=\"Column span: {{ getSpan(comp) }} of {{ totalColumns() }} columns\"\n >\n {{ getSpan(comp) }}/{{ totalColumns() }}\n </span>\n\n <!-- Quick Action Stepper & Buttons (revealed on hover or selection) -->\n <div class=\"card-quick-controls\">\n <button\n type=\"button\"\n class=\"card-action-btn\"\n [class.btn-active-toggle]=\"comp.layout?.newRow\"\n (click)=\"toggleNewRow(comp, $event)\"\n title=\"{{ comp.layout?.newRow ? 'Starts on new row (Click to place inline)' : 'Start on separate row (Row Break)' }}\"\n >\n <rpt-icon name=\"corner-down-right\" [size]=\"11\" />\n </button>\n\n <div class=\"span-control-group\" title=\"Adjust Column Span\">\n <button\n type=\"button\"\n class=\"span-btn\"\n [disabled]=\"getSpan(comp) <= 1\"\n (click)=\"adjustSpan(comp, -1, $event)\"\n title=\"Shrink Column Span\"\n >\n <rpt-icon name=\"minus\" [size]=\"9\" />\n </button>\n <span class=\"span-badge\" [title]=\"'Column span: ' + getSpan(comp) + ' of ' + totalColumns()\">\n <span class=\"span-num\">{{ getSpan(comp) }}</span><span class=\"span-total\">/{{ totalColumns() }}</span>\n </span>\n <button\n type=\"button\"\n class=\"span-btn\"\n [disabled]=\"getSpan(comp) >= totalColumns()\"\n (click)=\"adjustSpan(comp, 1, $event)\"\n title=\"Expand Column Span\"\n >\n <rpt-icon name=\"plus\" [size]=\"9\" />\n </button>\n </div>\n\n <button\n type=\"button\"\n class=\"card-action-btn\"\n (click)=\"onDuplicate(comp.id, $event)\"\n title=\"Duplicate component\"\n >\n <rpt-icon name=\"copy\" [size]=\"12\" />\n </button>\n <button\n type=\"button\"\n class=\"card-action-btn btn-delete\"\n (click)=\"onDelete(comp.id, $event)\"\n title=\"Remove component\"\n >\n <rpt-icon name=\"trash\" [size]=\"12\" />\n </button>\n </div>\n </div>\n </div>\n\n <!-- Card Body Visual Preview -->\n <div class=\"card-body\">\n\n @switch (comp.type) {\n @case ('input') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Input' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"text\"\n class=\"canvas-active-input\"\n [placeholder]=\"comp.properties?.['placeholder'] || 'Enter text...'\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-input-box\">{{ comp.properties?.['placeholder'] || 'Enter text...' }}</div>\n }\n </div>\n }\n @case ('dropdown') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-dropdown\n [config]=\"comp\"\n [showStatus]=\"true\"\n [parentForm]=\"canvasForm()\"\n [control]=\"getCanvasControl(comp)\"\n (dropdownClick)=\"onControlInteract(comp)\"\n />\n </div>\n }\n @case ('date') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-date [config]=\"comp\" [control]=\"getCanvasControl(comp) ?? undefined\" />\n </div>\n }\n @case ('date-range') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-date-range\n [config]=\"comp\"\n [control]=\"getCanvasControl(comp)\"\n />\n </div>\n }\n @case ('number') {\n <div class=\"mock-input-field\" (click)=\"onControlInteract(comp, $event)\">\n <span class=\"mock-label\">{{ comp.label || 'Number' }}</span>\n @if (getCanvasControl(comp); as ctrl) {\n <input\n type=\"number\"\n class=\"canvas-active-input\"\n [formControl]=\"ctrl\"\n (focus)=\"onControlInteract(comp, $event)\"\n />\n } @else {\n <div class=\"mock-input-box\">\n {{ comp.properties?.['prefix'] || '' }} 0.00 {{ comp.properties?.['suffix'] || '' }}\n </div>\n }\n </div>\n }\n @case ('checkbox') {\n <div class=\"mock-checkbox-field\" (click)=\"onControlInteract(comp, $event)\">\n @if (getCanvasControl(comp); as ctrl) {\n <label class=\"canvas-active-checkbox-lbl\">\n <input type=\"checkbox\" [formControl]=\"ctrl\" (focus)=\"onControlInteract(comp, $event)\" />\n <span class=\"mock-label\">{{ comp.label || 'Checkbox' }}</span>\n </label>\n } @else {\n <span class=\"mock-check-box\">\n <rpt-icon name=\"check\" [size]=\"10\" />\n </span>\n <span class=\"mock-label\">{{ comp.label || 'Checkbox' }}</span>\n }\n </div>\n }\n @case ('radio') {\n <div class=\"canvas-live-control-wrapper\" (click)=\"onControlInteract(comp, $event)\">\n <rpt-radio\n [config]=\"comp\"\n [control]=\"getCanvasControl(comp)\"\n [parentForm]=\"canvasForm()\"\n />\n </div>\n }\n @case ('button') {\n <div class=\"mock-btn-wrapper\">\n <button\n type=\"button\"\n class=\"mock-btn\"\n [class]=\"'btn-' + (comp.properties?.['variant'] || 'primary')\"\n [class.mock-btn-full]=\"comp.properties?.['fullWidth'] === true || comp.layout?.width === '100%'\"\n [style.height]=\"getCustomBtnHeight(comp)\"\n [style.width]=\"getCustomBtnWidth(comp)\"\n (click)=\"onCanvasButtonClick(comp, $event)\"\n >\n @if (getCustomBtnIcon(comp); as btnIcon) {\n <rpt-icon [name]=\"btnIcon\" [size]=\"15\" />\n }\n <span>{{ comp.label || 'Button' }}</span>\n </button>\n </div>\n }\n @case ('kpi-card') {\n <div class=\"mock-kpi-field\">\n <div class=\"mock-kpi-header\">\n <span class=\"mock-label\">{{ comp.label || 'KPI Metric' }}</span>\n <rpt-icon name=\"kpi\" [size]=\"14\" />\n </div>\n <div class=\"mock-kpi-value\">{{ comp.properties?.['value'] || '$128,450' }}</div>\n <div class=\"mock-kpi-footer\">\n <span class=\"mock-kpi-trend\">+12.5%</span>\n <span class=\"mock-kpi-sub\">vs last period</span>\n </div>\n </div>\n }\n @case ('chart') {\n <div class=\"mock-chart-field\">\n <div class=\"mock-chart-header\">\n <span class=\"mock-label\">{{ comp.label || 'Quarterly Sales Revenue ($000)' }}</span>\n </div>\n <div class=\"mock-chart-bars\">\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 44%\"></div>\n <span class=\"mock-bar-lbl\">Q1 Jan-Mar</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 61%\"></div>\n <span class=\"mock-bar-lbl\">Q2 Apr-Jun</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 79%\"></div>\n <span class=\"mock-bar-lbl\">Q3 Jul-Sep</span>\n </div>\n <div class=\"mock-chart-col\">\n <div class=\"mock-chart-bar\" style=\"height: 100%\"></div>\n <span class=\"mock-bar-lbl\">Q4 Oct-Dec</span>\n </div>\n </div>\n </div>\n }\n @default {\n <div class=\"mock-generic-box\">\n <span>{{ comp.type }}</span>\n </div>\n }\n }\n </div>\n\n <!-- Resizing Handles (East, South, South-East) -->\n <div\n class=\"resize-handle handle-e\"\n (pointerdown)=\"startResize($event, comp, 'e')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize column width \u2022 Double-click to reset\"\n ></div>\n <div\n class=\"resize-handle handle-s\"\n (pointerdown)=\"startResize($event, comp, 's')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize height \u2022 Double-click to reset\"\n ></div>\n <div\n class=\"resize-handle handle-se\"\n (pointerdown)=\"startResize($event, comp, 'se')\"\n (dblclick)=\"resetDimensions(comp, $event)\"\n title=\"Drag to resize width and height \u2022 Double-click to reset\"\n ></div>\n\n <!-- Resizing Dimension Ghost / Badge -->\n @if (resizingCompId() === comp.id) {\n <div class=\"resize-dimension-tooltip\">\n {{ resizingTooltip(comp) }}\n </div>\n }\n\n <!-- Drag placeholder with matched grid column span -->\n <div\n *cdkDragPlaceholder\n class=\"canvas-drag-placeholder\"\n [style.grid-column]=\"getGridColumn(comp)\"\n ></div>\n\n <!-- Drag preview -->\n <div *cdkDragPreview class=\"canvas-drag-preview\">\n <span class=\"drag-handle-dots\">\u22EE\u22EE</span>\n <rpt-icon [name]=\"getComponentIconName(comp.type)\" [size]=\"14\" />\n <span class=\"preview-title\">{{ comp.label || comp.key || comp.type }}</span>\n <span class=\"preview-span\">{{ getSpan(comp) }}/{{ totalColumns() }}</span>\n </div>\n </div>\n }\n\n @if (components().length === 0) {\n <div class=\"canvas-empty-state\" role=\"region\" aria-label=\"Empty canvas starter options\">\n <div class=\"empty-hero-badge\">\n <rpt-icon name=\"design\" [size]=\"28\" />\n </div>\n <h3 class=\"empty-hero-title\">Start Designing Your Custom Report</h3>\n <p class=\"empty-hero-desc\">\n Drag controls from the left component palette, or jumpstart your design with pre-configured enterprise blueprints.\n </p>\n\n <div class=\"empty-hero-actions\">\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-primary\"\n (click)=\"applyBlueprint('blueprint-audit-register')\"\n title=\"Load complete Audit Register blueprint with parameters and result grid\"\n >\n <rpt-icon name=\"table\" [size]=\"15\" />\n <span>Audit Register Blueprint</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-secondary\"\n (click)=\"applyBlueprint('blueprint-kpi-summary')\"\n title=\"Load Executive KPI summary blueprint\"\n >\n <rpt-icon name=\"chart-bar\" [size]=\"15\" />\n <span>KPI Summary Blueprint</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-outline\"\n (click)=\"addStarterComponent('date-range')\"\n title=\"Add a Date Range filter component\"\n >\n <rpt-icon name=\"calendar\" [size]=\"14\" />\n <span>+ Add Date Filter</span>\n </button>\n <button\n type=\"button\"\n class=\"empty-btn empty-btn-outline\"\n (click)=\"addStarterComponent('button')\"\n title=\"Add an Execute Action button\"\n >\n <rpt-icon name=\"play\" [size]=\"14\" />\n <span>+ Add Run Button</span>\n </button>\n </div>\n </div>\n }\n </div>\n\n <!-- Live Result Grid Preview with Bways-Grid Features -->\n @if (definition().grid) {\n <div class=\"canvas-grid-box\">\n <div class=\"grid-preview-header\">\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <rpt-icon name=\"table\" [size]=\"15\" />\n <span class=\"grid-title\">Bways Grid ({{ definition().grid?.columns?.length ?? 0 }} columns)</span>\n @if (isExecutingGrid()) {\n <span class=\"grid-exec-badge is-loading\">Loading data from database...</span>\n } @else if (gridExecError()) {\n <span class=\"grid-exec-badge is-error\">{{ gridExecError() }}</span>\n } @else if (canvasGridData().length > 0) {\n <span class=\"grid-exec-badge is-success\">{{ canvasGridData().length }} rows loaded</span>\n }\n </div>\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <button\n type=\"button\"\n class=\"btn-canvas-run-grid\"\n (click)=\"executeCanvasReport($event)\"\n [disabled]=\"isExecutingGrid()\"\n title=\"Execute query and load data into Bways Grid\"\n >\n <rpt-icon name=\"play\" [size]=\"11\" />\n <span>{{ isExecutingGrid() ? 'Running...' : 'Run / Refresh Grid' }}</span>\n </button>\n <button\n type=\"button\"\n class=\"btn-canvas-edit-grid\"\n (click)=\"selectGridSettings($event)\"\n title=\"Configure columns and grid options\"\n >\n <rpt-icon name=\"settings\" [size]=\"11\" />\n <span>Configure</span>\n </button>\n <button\n type=\"button\"\n class=\"btn-remove-grid\"\n (click)=\"removeGrid($event)\"\n title=\"Remove Result Grid from this report\"\n >\n <rpt-icon name=\"trash\" [size]=\"13\" />\n </button>\n </div>\n </div>\n\n @if (getGridSummaryText(); as summary) {\n <div class=\"grid-layout-status-strip\">\n <div class=\"grid-status-info\">\n <rpt-icon name=\"table\" [size]=\"12\" />\n <span>{{ summary }}</span>\n </div>\n <div class=\"grid-status-sync\" [class.is-pulsing]=\"layoutJustUpdated()\">\n <rpt-icon name=\"check\" [size]=\"11\" />\n <span>Layout auto-persisted</span>\n </div>\n </div>\n }\n\n <!-- Live Bways Grid bridge -->\n <div class=\"canvas-live-grid-container\" (click)=\"$event.stopPropagation()\" style=\"position: relative; min-height: 250px;\">\n @if (isExecutingGrid()) {\n <div class=\"canvas-grid-loading-overlay\">\n <span class=\"status-dot dot-pulse\" style=\"width: 14px; height: 14px; color: #2563eb; background: #2563eb; border-radius: 50%;\"></span>\n <span class=\"grid-loading-title\">Executing stored procedure on SQL Server...</span>\n <span class=\"grid-loading-sub\">Calculating outstanding balances and ledger amounts. Please wait...</span>\n </div>\n }\n <rpt-grid-bridge\n [gridDefinition]=\"definition().grid!\"\n [data]=\"canvasGridData()\"\n (gridStateChange)=\"onCanvasGridStateChange($event)\"\n (columnDefsChange)=\"onCanvasColumnDefsChange($event)\"\n />\n </div>\n </div>\n } @else {\n <div class=\"canvas-add-grid-banner\" (click)=\"addResultGrid($event)\">\n <div class=\"add-grid-icon\">\n <rpt-icon name=\"table\" [size]=\"20\" />\n </div>\n <div class=\"add-grid-text\">\n <span class=\"add-grid-title\">+ Add Result Data Grid</span>\n <span class=\"add-grid-sub\">Attach an interactive data table or UltraGrid to display report execution output</span>\n </div>\n <button type=\"button\" class=\"btn-banner-add\">Add Grid</button>\n </div>\n }\n </div>\n </div>\n </div>", styles: [":host{display:block;flex:1;min-height:0;min-width:0;height:100%;background-color:#f1f5f9;font-family:var(--rpt-font-family, inherit);box-sizing:border-box}.canvas-wrapper{min-height:0;display:flex;flex-direction:column;height:100%}.canvas-toolbar{display:flex;align-items:center;justify-content:space-between;min-height:42px;height:42px;padding:0 24px;background:var(--rpt-color-surface, #ffffff);border-bottom:1px solid var(--rpt-color-border, #cbd5e1);box-sizing:border-box;gap:12px;overflow-x:auto;scrollbar-width:none;font-family:var(--rpt-font-family, inherit);flex-shrink:0}.canvas-toolbar::-webkit-scrollbar{display:none}.canvas-info{display:flex;align-items:center;gap:8px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-sm, .75rem);color:var(--rpt-color-text-muted, #64748b);white-space:nowrap;line-height:1}.info-label{color:var(--rpt-color-text-muted, #64748b);font-weight:500;font-size:var(--rpt-font-size-sm, .75rem)}.info-value{font-weight:600;color:var(--rpt-color-text, #0f172a);font-size:var(--rpt-font-size-sm, .75rem)}.info-divider{color:var(--rpt-color-border, #cbd5e1);margin:0 2px}.live-mode-badge{display:inline-flex;align-items:center;gap:4px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-xs, .7rem);font-weight:600;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;padding:2px 8px;border-radius:9999px;line-height:1}.canvas-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}.canvas-action-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;font-family:var(--rpt-font-family, inherit);font-size:var(--rpt-font-size-sm, .75rem);font-weight:500;letter-spacing:-.01em;color:var(--rpt-color-text-secondary, #334155);background:var(--rpt-color-surface, #ffffff);border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);cursor:pointer;line-height:1;white-space:nowrap;box-shadow:0 1px 2px #0000000a;transition:all var(--rpt-transition-speed, .15s) ease}.canvas-action-btn:hover{background:var(--rpt-color-surface-hover, #f8fafc);border-color:var(--rpt-color-border-hover, #94a3b8);color:var(--rpt-color-text, #0f172a);box-shadow:0 2px 4px #0000000f}.canvas-action-btn.btn-grid-configured{background:#eff6ff;border-color:#bfdbfe;color:#2563eb;font-weight:600}.canvas-action-btn.btn-grid-configured:hover{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}.canvas-action-btn.btn-grid-add{background:#f0fdf4;border-color:#bbf7d0;color:#16a34a;font-weight:600}.canvas-action-btn.btn-grid-add:hover{background:#dcfce7;color:#15803d;border-color:#86efac}.canvas-action-btn:active{transform:translateY(1px)}.canvas-scroll-area{flex:1;min-height:0;overflow-y:auto;padding:16px}.canvas-artboard{width:100%;max-width:1400px;margin:0 auto;background:#fff;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-lg, 8px);box-shadow:0 4px 6px -1px #0000000d;min-height:480px;box-sizing:border-box}@media (max-width: 900px){.canvas-toolbar{min-height:36px;height:36px;padding:0 10px;gap:6px}.live-mode-badge{display:none}.canvas-info{font-size:.75rem;gap:5px}.canvas-action-btn{padding:0 8px;font-size:.725rem;height:28px;gap:4px}.canvas-scroll-area{padding:10px}.canvas-artboard{min-height:360px}}@media (max-width: 600px){.canvas-toolbar{padding:0 8px;gap:4px}.canvas-info .info-label,.canvas-action-btn span{display:none}.canvas-action-btn{padding:0 6px;min-width:28px;justify-content:center}}.canvas-report-header{margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid var(--rpt-color-border, #e2e8f0)}.canvas-report-title{font-size:var(--rpt-font-size-xl, 1.5rem);font-weight:700;color:var(--rpt-color-text, #0f172a);margin:0 0 6px}.canvas-report-desc{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #64748b);margin:0}.canvas-grid{display:grid;width:100%;min-height:180px;align-items:start;border-radius:6px;transition:all var(--rpt-transition-speed, .15s) ease}.canvas-component-card{container-type:inline-size;background:#fff;border:1.5px solid var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius, 6px);box-shadow:var(--rpt-box-shadow, 0 1px 2px rgba(0, 0, 0, .05));box-sizing:border-box;transition:all var(--rpt-transition-speed, .15s) ease;cursor:pointer;position:relative;overflow:visible;display:flex;flex-direction:column;min-height:104px;z-index:1}.canvas-component-card:hover{border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 4px 6px -1px #2563eb1a;z-index:2}.canvas-component-card.is-selected{border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 0 0 2px #2563eb40;z-index:10}.canvas-component-card:focus-within,.canvas-component-card:has(.rpt-combobox-menu),.canvas-component-card:has(.is-open){z-index:100}.canvas-component-card.is-resizing{-webkit-user-select:none;user-select:none;border-color:var(--rpt-color-primary, #2563eb);box-shadow:0 0 0 2px #2563eb59;z-index:30;transition:none!important}.resize-handle{position:absolute;z-index:20;touch-action:none;opacity:0;pointer-events:none;transition:opacity .15s ease}.canvas-component-card.is-selected .resize-handle{opacity:1;pointer-events:auto}.resize-handle.handle-e{top:0;right:0;width:6px;height:100%;cursor:ew-resize;display:flex;align-items:center;justify-content:center}.resize-handle.handle-e:after{content:\"\";width:3px;height:24px;background:#cbd5e1;border-radius:2px;transition:background .15s ease}.resize-handle.handle-e:hover:after,.canvas-component-card.is-selected .resize-handle.handle-e:after{background:var(--rpt-color-primary, #2563eb)}.resize-handle.handle-s{bottom:0;left:0;height:6px;width:100%;cursor:ns-resize;display:flex;align-items:center;justify-content:center}.resize-handle.handle-s:after{content:\"\";height:3px;width:24px;background:#cbd5e1;border-radius:2px;transition:background .15s ease}.resize-handle.handle-s:hover:after,.canvas-component-card.is-selected .resize-handle.handle-s:after{background:var(--rpt-color-primary, #2563eb)}.resize-handle.handle-se{bottom:0;right:0;width:12px;height:12px;cursor:nwse-resize;display:flex;align-items:flex-end;justify-content:flex-end;padding:2px}.resize-handle.handle-se:after{content:\"\";width:5px;height:5px;border-right:2px solid #cbd5e1;border-bottom:2px solid #cbd5e1;transition:border-color .15s ease}.resize-handle.handle-se:hover:after,.canvas-component-card.is-selected .resize-handle.handle-se:after{border-color:var(--rpt-color-primary, #2563eb)}.resize-dimension-tooltip{position:absolute;top:38px;right:8px;background:#0f172ae6;color:#fff;font-size:.7rem;font-weight:600;padding:3px 8px;border-radius:4px;white-space:nowrap;pointer-events:none;z-index:50;box-shadow:0 2px 4px #0003}.card-header{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:5px 8px;background:var(--rpt-color-surface, #f8fafc);border-bottom:1px solid var(--rpt-color-border, #e2e8f0);border-top-left-radius:var(--rpt-border-radius, 6px);border-top-right-radius:var(--rpt-border-radius, 6px);min-height:32px;box-sizing:border-box;overflow:hidden;position:relative}.canvas-component-card.is-selected .card-header{overflow:visible}.card-title-group{display:flex;align-items:center;gap:5px;cursor:grab;min-width:0;flex:1;overflow:hidden}.drag-handle-dots{color:var(--rpt-color-text-muted, #94a3b8);font-size:.85rem;letter-spacing:-2px;flex-shrink:0;-webkit-user-select:none;user-select:none}.comp-title{font-size:.75rem;font-weight:600;color:var(--rpt-color-text, #0f172a);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;user-select:none}.card-actions{display:flex;align-items:center;gap:4px;flex-shrink:0;margin-left:auto}.new-row-pill-static{font-size:.65rem;font-weight:600;color:#7c3aed;background:#f5f3ff;border:1px solid #ddd6fe;padding:1px 5px;border-radius:9999px;white-space:nowrap;line-height:1;flex-shrink:0}.span-pill-static{display:inline-flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:600;color:var(--rpt-color-text-muted, #64748b);background:var(--rpt-color-surface, #f1f5f9);border:1px solid var(--rpt-color-border, #e2e8f0);padding:1px 6px;border-radius:9999px;line-height:1.2;white-space:nowrap;-webkit-user-select:none;user-select:none}.card-quick-controls{display:none;align-items:center;gap:3px;flex-shrink:0}.canvas-component-card:hover .span-pill-static,.canvas-component-card.is-selected .span-pill-static,.canvas-component-card:hover .new-row-pill-static,.canvas-component-card.is-selected .new-row-pill-static{display:none}.canvas-component-card:hover .card-quick-controls,.canvas-component-card.is-selected .card-quick-controls{display:inline-flex}.canvas-component-card.is-narrow .card-header{padding:4px 6px;gap:3px}.canvas-component-card.is-narrow:hover .comp-title,.canvas-component-card.is-narrow.is-selected .comp-title,.canvas-component-card.is-narrow:hover .drag-handle-dots,.canvas-component-card.is-narrow.is-selected .drag-handle-dots{display:none}.canvas-component-card.is-narrow .card-quick-controls{gap:2px}.canvas-component-card.is-narrow .span-control-group{height:18px}.canvas-component-card.is-narrow .span-btn{width:14px;height:16px}.canvas-component-card.is-narrow .span-badge{font-size:.6rem;padding:0 2px}.canvas-component-card.is-narrow .span-total{display:none}.canvas-component-card.is-narrow .card-action-btn{width:18px;height:18px}@container (max-width: 250px){.card-header{padding:4px 6px;gap:3px}.canvas-component-card:hover .comp-title,.canvas-component-card.is-selected .comp-title,.canvas-component-card:hover .drag-handle-dots,.canvas-component-card.is-selected .drag-handle-dots,.span-total{display:none}.card-quick-controls{gap:2px}.card-action-btn{width:18px;height:18px}.span-control-group{height:18px}.span-btn{width:14px;height:16px}.span-badge{font-size:.6rem;padding:0 2px}}@container (max-width: 160px){.canvas-component-card.is-selected .card-quick-controls{position:absolute;top:-30px;right:0;background:#fff;border:1.5px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:2px 4px;gap:3px;box-shadow:0 4px 12px #2563eb2e,0 2px 4px #00000014;z-index:120;white-space:nowrap}}@media (max-width: 900px){.canvas-component-card:hover .comp-title,.canvas-component-card.is-selected .comp-title,.canvas-component-card:hover .drag-handle-dots,.canvas-component-card.is-selected .drag-handle-dots,.canvas-component-card .span-total{display:none}.canvas-component-card.is-selected .card-header{overflow:visible}.canvas-component-card.is-selected .card-quick-controls{position:absolute;top:-30px;right:0;background:#fff;border:1.5px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:2px 4px;gap:3px;box-shadow:0 4px 12px #2563eb2e,0 2px 4px #00000014;z-index:120;white-space:nowrap}}.span-control-group{display:inline-flex;align-items:center;background:#fff;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;height:20px;padding:0 1px;white-space:nowrap;flex-shrink:0}.span-btn{width:16px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0;color:var(--rpt-color-text-muted, #64748b);cursor:pointer;border-radius:2px;transition:all .12s ease}.span-btn:hover:not(:disabled){background:var(--rpt-color-surface-hover, #f1f5f9);color:var(--rpt-color-primary, #2563eb)}.span-btn:disabled{opacity:.3;cursor:not-allowed}.span-badge{font-size:.65rem;font-weight:600;color:var(--rpt-color-text, #0f172a);padding:0 3px;white-space:nowrap;-webkit-user-select:none;user-select:none;line-height:1}.span-total{font-size:.6rem;color:var(--rpt-color-text-muted, #64748b);font-weight:500}.card-action-btn{width:20px;height:20px;border:none;background:transparent;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;color:var(--rpt-color-text-muted, #64748b);transition:all .12s ease;flex-shrink:0}.card-action-btn:hover{background:#e2e8f0;color:var(--rpt-color-text, #0f172a)}.card-action-btn.btn-active-toggle{background:#7c3aed;color:#fff;border-color:#7c3aed}.card-action-btn.btn-active-toggle:hover{background:#6d28d9;color:#fff}.btn-delete:hover{background:#fee2e2;color:#ef4444}.card-body{padding:8px 10px 14px;flex:1;display:flex;flex-direction:column;min-height:0;min-width:0;max-width:100%;box-sizing:border-box;overflow:visible}.mock-input-field{display:flex;flex-direction:column;gap:4px;flex:1;height:100%;min-height:0}.mock-label{font-size:.7rem;font-weight:600;color:var(--rpt-color-text-muted, #475569);flex-shrink:0}.mock-input-box,.mock-select-box{border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:6px;padding:6px 12px;font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #94a3b8);background:#fff;flex:1;min-height:38px;height:100%;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box}.mock-checkbox-field{display:flex;align-items:center;gap:6px;flex:1;height:100%;min-height:0;padding-top:14px}.mock-check-box{width:18px;height:18px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:.65rem;color:var(--rpt-color-primary, #2563eb);flex-shrink:0}.mock-btn-wrapper{display:flex;flex:1;height:100%;min-height:38px;align-items:center;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box}.mock-btn{border-radius:var(--rpt-border-radius, 6px);padding:0 16px;height:36px;font-size:var(--rpt-font-size-base, .875rem);font-weight:500;border:1px solid transparent;cursor:pointer;width:auto;max-width:100%;display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:all .15s ease}.mock-btn.mock-btn-full{width:100%}.canvas-component-card.is-narrow .mock-btn{padding:0 6px;font-size:.775rem;width:100%;height:34px}.mock-kpi-field{display:flex;flex-direction:column;justify-content:space-between;flex:1;height:100%;min-height:0}.mock-kpi-header{display:flex;align-items:center;justify-content:space-between}.mock-kpi-value{font-size:1.25rem;font-weight:700;color:var(--rpt-color-text, #0f172a);margin:2px 0}.mock-kpi-footer{display:flex;align-items:center;gap:6px;font-size:.65rem}.mock-kpi-trend{color:#16a34a;font-weight:600}.mock-kpi-sub{color:#64748b}.mock-chart-field{display:flex;flex-direction:column;flex:1;height:100%;min-height:140px}.mock-chart-bars{display:flex;align-items:flex-end;justify-content:space-around;gap:16px;flex:1;min-height:100px;padding-top:12px;box-sizing:border-box}.mock-chart-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;min-width:60px;max-width:140px}.mock-chart-bar{width:38px;max-width:44px;margin:0 auto;background:var(--rpt-color-primary, #2563eb);border-radius:6px 6px 0 0;opacity:.85;min-height:10px;transition:height .2s ease}.mock-bar-lbl{font-size:.6875rem;color:#64748b;margin-top:6px;text-align:center;white-space:normal;line-height:1.2}.btn-primary{background:var(--rpt-color-primary, #2563eb);color:#fff}.btn-secondary{background:#f1f5f9;color:#0f172a;border:1px solid #cbd5e1}.btn-outline{background:transparent;color:#2563eb;border:1px solid #2563eb}.btn-danger{background:#ef4444;color:#fff}.mock-generic-box{border:1px dashed #cbd5e1;border-radius:4px;padding:8px;font-size:.75rem;text-align:center;color:#64748b}.canvas-drag-placeholder{background:#2563eb0f;border:2px dashed var(--rpt-color-primary, #2563eb);border-radius:6px;min-height:80px;box-sizing:border-box;transition:transform .15s ease}.canvas-drag-preview,::ng-deep .canvas-drag-preview{background:#fff;border:2px solid var(--rpt-color-primary, #2563eb);border-radius:6px;padding:8px 14px;display:inline-flex;align-items:center;gap:8px;font-family:var(--rpt-font-family, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif)!important;font-size:.8rem;font-weight:600;color:var(--rpt-color-text, #0f172a);box-shadow:0 12px 24px -4px #00000040;z-index:10000}.preview-title,::ng-deep .preview-title{font-family:inherit!important;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview-span,::ng-deep .preview-span{font-family:inherit!important;font-size:.65rem;font-weight:600;color:var(--rpt-color-primary, #2563eb);background:#eff6ff;border:1px solid #bfdbfe;padding:1px 6px;border-radius:9999px}.canvas-empty-state{grid-column:1 / -1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:56px 28px;border:2px dashed var(--rpt-color-border, #cbd5e1);border-radius:var(--rpt-border-radius-xl, 12px);background:var(--rpt-color-surface, #ffffff);text-align:center;box-shadow:var(--rpt-box-shadow-xs, 0 1px 2px 0 rgba(0, 0, 0, .04));transition:border-color var(--rpt-transition-speed, .15s) ease}.canvas-empty-state:hover{border-color:var(--rpt-color-primary, #2563eb)}.empty-hero-badge{width:56px;height:56px;border-radius:var(--rpt-border-radius-xl, 12px);background:var(--rpt-color-primary-light, #eff6ff);color:var(--rpt-color-primary, #2563eb);display:flex;align-items:center;justify-content:center;margin-bottom:16px;box-shadow:0 2px 8px #2563eb1f}.empty-hero-title{font-size:var(--rpt-font-size-lg, 1.125rem);font-weight:700;color:var(--rpt-color-text, #0f172a);margin:0 0 8px;letter-spacing:-.01em}.empty-hero-desc{font-size:var(--rpt-font-size-base, .875rem);color:var(--rpt-color-text-muted, #64748b);max-width:520px;line-height:1.5;margin:0 0 24px}.empty-hero-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}.empty-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;font-size:var(--rpt-font-size-sm, .75rem);font-weight:600;border-radius:var(--rpt-border-radius, 6px);cursor:pointer;transition:all var(--rpt-transition-speed, .15s) ease;font-family:inherit}.empty-btn-primary{background:var(--rpt-color-primary, #2563eb);color:#fff;border:1px solid var(--rpt-color-primary, #2563eb);box-shadow:0 1px 3px #2563eb33}.empty-btn-primary:hover{background:var(--rpt-color-primary-hover, #1d4ed8);border-color:var(--rpt-color-primary-hover, #1d4ed8);transform:translateY(-1px)}.empty-btn-secondary{background:#f8fafc;color:#334155;border:1px solid var(--rpt-color-border, #cbd5e1)}.empty-btn-secondary:hover{background:#f1f5f9;color:#0f172a;border-color:#94a3b8;transform:translateY(-1px)}.empty-btn-outline{background:#fff;color:var(--rpt-color-primary, #2563eb);border:1px solid #bfdbfe}.empty-btn-outline:hover{background:#eff6ff;border-color:var(--rpt-color-primary, #2563eb);transform:translateY(-1px)}.canvas-active-input{width:100%;height:32px;padding:4px 8px;font-size:.8125rem;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:4px;outline:none;box-sizing:border-box;background:#fff;color:#0f172a;transition:border-color .15s ease}.canvas-active-input:focus{border-color:var(--rpt-color-primary, #2563eb)}.canvas-active-checkbox-lbl{display:inline-flex;align-items:center;gap:6px;cursor:pointer}.canvas-live-control-wrapper{width:100%;max-width:100%;min-width:0;position:relative;z-index:1;box-sizing:border-box}.canvas-grid-box{margin-top:24px;border:1px solid var(--rpt-color-border, #cbd5e1);border-radius:8px;background:#fff;box-shadow:0 1px 3px #0000000d;overflow:hidden}.grid-preview-header{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--rpt-color-surface, #f8fafc);border-bottom:1px solid var(--rpt-color-border, #cbd5e1);font-size:.8rem;font-weight:600;color:var(--rpt-color-text, #0f172a)}.grid-title{font-weight:700}.grid-exec-badge{font-size:.6875rem;font-weight:600;padding:2px 8px;border-radius:10px}.grid-exec-badge.is-loading{background:#eff6ff;color:#2563eb}.grid-exec-badge.is-error{background:#fee2e2;color:#ef4444}.grid-exec-badge.is-success{background:#ecfdf5;color:#059669}.btn-canvas-run-grid{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;font-size:.72rem;font-weight:600;color:#fff;background:var(--rpt-color-primary, #2563eb);border:none;border-radius:4px;cursor:pointer;transition:background .15s ease}.btn-canvas-run-grid:hover:not(:disabled){background:#1d4ed8}.btn-canvas-run-grid:disabled{opacity:.6;cursor:not-allowed}.btn-canvas-edit-grid{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;font-size:.72rem;font-weight:500;color:#334155;background:#fff;border:1px solid #cbd5e1;border-radius:4px;cursor:pointer;transition:all .12s ease}.btn-canvas-edit-grid:hover{background:#f1f5f9}.canvas-live-grid-container{width:100%;min-height:480px;background:#fff}.live-mode-badge{display:inline-flex;align-items:center;gap:4px;font-size:.6875rem;font-weight:700;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;padding:1px 8px;border-radius:9999px}.canvas-component-card.is-field-highlighted{border-color:#f59e0b!important;box-shadow:0 0 0 3px #f59e0b59!important;animation:rpt-pulse-border 1s ease-in-out infinite alternate}@keyframes rpt-pulse-border{0%{box-shadow:0 0 0 2px #f59e0b40}to{box-shadow:0 0 0 5px #f59e0b80}}.grid-layout-status-strip{display:flex;align-items:center;justify-content:space-between;padding:6px 16px;background:#f1f5f9;border-bottom:1px solid var(--rpt-color-border, #cbd5e1);font-size:.6875rem;color:#475569}.grid-status-info{display:inline-flex;align-items:center;gap:6px;font-weight:600}.grid-status-sync{display:inline-flex;align-items:center;gap:4px;color:#059669;font-weight:600;transition:transform .2s ease}.grid-status-sync.is-pulsing{transform:scale(1.08);color:#047857}.canvas-actions{display:flex;align-items:center;gap:8px}.btn-grid-add{background:#f0fdf4;border-color:#bbf7d0;color:#16a34a}.btn-grid-add:hover{background:#dcfce7;border-color:#86efac;color:#15803d}.btn-remove-grid{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;color:#94a3b8;border-radius:4px;cursor:pointer;transition:all .15s ease}.btn-remove-grid:hover{background:#fee2e2;color:#ef4444}.canvas-add-grid-banner{margin-top:24px;border:2px dashed #cbd5e1;border-radius:8px;background:#fff;padding:16px 20px;display:flex;align-items:center;gap:16px;cursor:pointer;transition:all .15s ease}.canvas-add-grid-banner:hover{border-color:#2563eb;background:#f8fafc;box-shadow:0 2px 8px #2563eb14}.add-grid-icon{width:40px;height:40px;border-radius:8px;background:#eff6ff;color:#2563eb;display:flex;align-items:center;justify-content:center;flex-shrink:0}.add-grid-text{display:flex;flex-direction:column;gap:2px;flex:1}.add-grid-title{font-size:.875rem;font-weight:600;color:#0f172a}.add-grid-sub{font-size:.75rem;color:#64748b}.btn-banner-add{padding:6px 14px;font-size:.75rem;font-weight:600;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:6px;cursor:pointer;white-space:nowrap;transition:all .15s ease}.canvas-add-grid-banner:hover .btn-banner-add{background:#2563eb;color:#fff;border-color:#2563eb}.canvas-grid-loading-overlay{position:absolute;inset:0;background:#ffffffe6;backdrop-filter:blur(2px);z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;font-family:inherit;border-radius:6px}.grid-loading-title{font-weight:600;font-size:.95rem;color:#1e293b}.grid-loading-sub{font-size:.8rem;color:#64748b}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button,.canvas-active-input::-webkit-inner-spin-button,.canvas-active-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number],.canvas-active-input{-moz-appearance:textfield;appearance:textfield}\n"] }]
|
|
14285
14476
|
}], ctorParameters: () => [], propDecorators: { onEscape: [{
|
|
14286
14477
|
type: HostListener,
|
|
14287
14478
|
args: ['document:keydown.escape']
|
|
@@ -14963,6 +15154,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
14963
15154
|
}] });
|
|
14964
15155
|
|
|
14965
15156
|
class ParameterBindingEditorComponent {
|
|
15157
|
+
formContext = inject(DesignerFormContextService, { optional: true });
|
|
14966
15158
|
sessionService = inject(ReportSessionContextService);
|
|
14967
15159
|
reportingConfig = inject(REPORTING_CONFIG, { optional: true });
|
|
14968
15160
|
param = input.required();
|
|
@@ -15049,12 +15241,34 @@ class ParameterBindingEditorComponent {
|
|
|
15049
15241
|
});
|
|
15050
15242
|
selectedDropdownField = computed(() => this.compatibleControls().find(c => (c.key || c.id) === this.selectedControlKey() && c.type === 'dropdown'));
|
|
15051
15243
|
dropdownExample = computed(() => {
|
|
15052
|
-
const
|
|
15244
|
+
const field = this.selectedDropdownField();
|
|
15245
|
+
if (field?.dataSource?.entityName || field?.dataSource?.apiEndpoint || field?.dataSource?.masterName)
|
|
15246
|
+
return null;
|
|
15247
|
+
const options = field?.properties?.['options'];
|
|
15053
15248
|
if (!Array.isArray(options))
|
|
15054
15249
|
return null;
|
|
15055
15250
|
const first = options.find(option => option && typeof option === 'object' && 'key' in option);
|
|
15056
15251
|
return first ? { label: String(first.label ?? first.key), value: String(first.key) } : null;
|
|
15057
15252
|
});
|
|
15253
|
+
selectedDropdownColumn = computed(() => parseParameterToken(String(this.currentValue() ?? ''))?.column ?? '');
|
|
15254
|
+
dropdownColumns = computed(() => {
|
|
15255
|
+
const field = this.selectedDropdownField();
|
|
15256
|
+
if (!field?.key)
|
|
15257
|
+
return [];
|
|
15258
|
+
const loaded = this.formContext?.dropdownColumns()[field.key] ?? [];
|
|
15259
|
+
return [...new Set([...loaded, field.dataSource?.valueField, field.dataSource?.displayField, 'value', 'label'].filter((value) => !!value))];
|
|
15260
|
+
});
|
|
15261
|
+
dropdownParameterPreview = computed(() => {
|
|
15262
|
+
if (!this.selectedDropdownField() || !this.formContext)
|
|
15263
|
+
return null;
|
|
15264
|
+
const value = resolveParameterValue(this.currentValue(), {}, this.formContext.values());
|
|
15265
|
+
return value === undefined || value === null || value === '' ? null : String(value);
|
|
15266
|
+
});
|
|
15267
|
+
onDropdownColumnSelected(column) {
|
|
15268
|
+
if (!this.selectedDropdownField() || (column && !this.dropdownColumns().includes(column)))
|
|
15269
|
+
return;
|
|
15270
|
+
this.valueChange.emit('{{' + this.selectedControlKey() + (column ? ' | column:' + column : '') + '}}');
|
|
15271
|
+
}
|
|
15058
15272
|
dateFormats = PARAMETER_DATE_FORMATS;
|
|
15059
15273
|
selectedDateField = computed(() => this.compatibleControls().find(c => (c.key || c.id) === this.selectedControlKey() && (c.type === 'date' || c.type === 'date-range')));
|
|
15060
15274
|
selectedDateFormat = computed(() => parseParameterToken(String(this.currentValue()))?.dateFormat ?? 'yyyy-MM-dd');
|
|
@@ -15349,8 +15563,15 @@ class ParameterBindingEditorComponent {
|
|
|
15349
15563
|
</select>
|
|
15350
15564
|
</div>
|
|
15351
15565
|
@if (selectedDropdownField(); as field) {
|
|
15566
|
+
<label class="param-desc" [for]="'column-' + currentComponentId() + '-' + param().name">Dropdown parameter column</label>
|
|
15567
|
+
<select class="field-select dropdown-parameter-column" [id]="'column-' + currentComponentId() + '-' + param().name"
|
|
15568
|
+
[ngModel]="selectedDropdownColumn()" (ngModelChange)="onDropdownColumnSelected($event)">
|
|
15569
|
+
<option value="">Selected value ({{ field.dataSource?.valueField || 'key' }})</option>
|
|
15570
|
+
@for (column of dropdownColumns(); track column) { <option [value]="column">{{ column }}</option> }
|
|
15571
|
+
</select>
|
|
15572
|
+
@if (dropdownParameterPreview(); as preview) { <div class="param-desc" role="status">Current parameter value: {{ preview }}</div> }
|
|
15352
15573
|
<div class="param-desc" role="note">
|
|
15353
|
-
Sends the selected option's <strong>{{ field.dataSource?.valueField || 'key' }}</strong> value.
|
|
15574
|
+
Sends the selected option's <strong>{{ selectedDropdownColumn() || field.dataSource?.valueField || 'key' }}</strong> value.
|
|
15354
15575
|
@if (field.dataSource?.displayField) {
|
|
15355
15576
|
<span>{{ field.dataSource?.displayField }} is the display label.</span>
|
|
15356
15577
|
}
|
|
@@ -15625,8 +15846,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
15625
15846
|
</select>
|
|
15626
15847
|
</div>
|
|
15627
15848
|
@if (selectedDropdownField(); as field) {
|
|
15849
|
+
<label class="param-desc" [for]="'column-' + currentComponentId() + '-' + param().name">Dropdown parameter column</label>
|
|
15850
|
+
<select class="field-select dropdown-parameter-column" [id]="'column-' + currentComponentId() + '-' + param().name"
|
|
15851
|
+
[ngModel]="selectedDropdownColumn()" (ngModelChange)="onDropdownColumnSelected($event)">
|
|
15852
|
+
<option value="">Selected value ({{ field.dataSource?.valueField || 'key' }})</option>
|
|
15853
|
+
@for (column of dropdownColumns(); track column) { <option [value]="column">{{ column }}</option> }
|
|
15854
|
+
</select>
|
|
15855
|
+
@if (dropdownParameterPreview(); as preview) { <div class="param-desc" role="status">Current parameter value: {{ preview }}</div> }
|
|
15628
15856
|
<div class="param-desc" role="note">
|
|
15629
|
-
Sends the selected option's <strong>{{ field.dataSource?.valueField || 'key' }}</strong> value.
|
|
15857
|
+
Sends the selected option's <strong>{{ selectedDropdownColumn() || field.dataSource?.valueField || 'key' }}</strong> value.
|
|
15630
15858
|
@if (field.dataSource?.displayField) {
|
|
15631
15859
|
<span>{{ field.dataSource?.displayField }} is the display label.</span>
|
|
15632
15860
|
}
|
|
@@ -16899,6 +17127,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
16899
17127
|
* Exporting to Excel/PDF, Crystal Report Printing, and Navigation.
|
|
16900
17128
|
*/
|
|
16901
17129
|
class PropertyEditorActionComponent {
|
|
17130
|
+
formContext = inject(DesignerFormContextService, { optional: true });
|
|
16902
17131
|
designerState = inject(DesignerStateService, { optional: true });
|
|
16903
17132
|
discoveryAdapter = inject(ReportSchemaDiscoveryAdapter, { optional: true });
|
|
16904
17133
|
lookupAdapter = inject(ReportLookupAdapter, { optional: true });
|
|
@@ -17015,7 +17244,7 @@ class PropertyEditorActionComponent {
|
|
|
17015
17244
|
};
|
|
17016
17245
|
if (entityName && this.dataDiscovery) {
|
|
17017
17246
|
this.dataDiscovery
|
|
17018
|
-
.autoDetectColumns(entityName, entityType, mappings || {}, targetDs?.schema || 'dbo')
|
|
17247
|
+
.autoDetectColumns(entityName, entityType, mappings || {}, targetDs?.schema || 'dbo', undefined, this.formContext?.values() ?? {})
|
|
17019
17248
|
.subscribe({
|
|
17020
17249
|
next: (cols) => {
|
|
17021
17250
|
if (cols && cols.length > 0) {
|
|
@@ -17489,6 +17718,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
17489
17718
|
* and Rule 32 (Avoid God Components).
|
|
17490
17719
|
*/
|
|
17491
17720
|
class PropertyEditorComponent {
|
|
17721
|
+
formContext = inject(DesignerFormContextService, { optional: true });
|
|
17492
17722
|
designerState = inject(DesignerStateService);
|
|
17493
17723
|
registry = inject(ComponentRegistry);
|
|
17494
17724
|
discoveryAdapter = inject(ReportSchemaDiscoveryAdapter, { optional: true });
|
|
@@ -17748,7 +17978,7 @@ class PropertyEditorComponent {
|
|
|
17748
17978
|
message: `Detecting columns for ${targetEntity}...`,
|
|
17749
17979
|
kind: 'info',
|
|
17750
17980
|
});
|
|
17751
|
-
this.dataDiscovery.autoDetectColumns(targetEntity, targetType, targetMappings, schema).subscribe({
|
|
17981
|
+
this.dataDiscovery.autoDetectColumns(targetEntity, targetType, targetMappings, schema, undefined, this.formContext?.values() ?? {}).subscribe({
|
|
17752
17982
|
next: (mappedCols) => {
|
|
17753
17983
|
if (mappedCols && mappedCols.length > 0) {
|
|
17754
17984
|
const currentOptions = currentGrid?.options ? { ...currentGrid.options } : {
|
|
@@ -17776,8 +18006,10 @@ class PropertyEditorComponent {
|
|
|
17776
18006
|
this.isDetectingColumns.set(false);
|
|
17777
18007
|
const entityTypeLabel = targetType === 'table' ? 'Table/View' : 'Stored procedure';
|
|
17778
18008
|
this.gridDetectionStatus.set({
|
|
17779
|
-
message:
|
|
17780
|
-
|
|
18009
|
+
message: currentGrid?.columns?.length
|
|
18010
|
+
? `No sample rows returned for ${targetEntity} with the current filters. Existing columns have been kept.`
|
|
18011
|
+
: `No columns detected for ${targetEntity}. ${entityTypeLabel} returned no sample rows for the current filters. Try different filters or add columns manually.`,
|
|
18012
|
+
kind: currentGrid?.columns?.length ? 'info' : 'error',
|
|
17781
18013
|
});
|
|
17782
18014
|
}
|
|
17783
18015
|
},
|
|
@@ -18202,7 +18434,7 @@ class DesignerComponent {
|
|
|
18202
18434
|
setTimeout(() => this.saveMessage.set(null), 3000);
|
|
18203
18435
|
}
|
|
18204
18436
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18205
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DesignerComponent, isStandalone: true, selector: "rpt-designer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, apiUrl: { classPropertyName: "apiUrl", publicName: "apiUrl", isSignal: false, isRequired: false, transformFunction: null }, reportId: { classPropertyName: "reportId", publicName: "reportId", isSignal: true, isRequired: false, transformFunction: null }, definition: { classPropertyName: "definition", publicName: "initialReport", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { reportSaved: "save", definitionChanged: "definitionChange" }, host: { listeners: { "window:resize": "onResize()", "window:keydown": "onKeyDown($event)" } }, providers: [DesignerStateService, ...DESIGNER_ENDPOINT_PROVIDERS], ngImport: i0, template: `
|
|
18437
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DesignerComponent, isStandalone: true, selector: "rpt-designer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, apiUrl: { classPropertyName: "apiUrl", publicName: "apiUrl", isSignal: false, isRequired: false, transformFunction: null }, reportId: { classPropertyName: "reportId", publicName: "reportId", isSignal: true, isRequired: false, transformFunction: null }, definition: { classPropertyName: "definition", publicName: "initialReport", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { reportSaved: "save", definitionChanged: "definitionChange" }, host: { listeners: { "window:resize": "onResize()", "window:keydown": "onKeyDown($event)" } }, providers: [DesignerFormContextService, DesignerStateService, ...DESIGNER_ENDPOINT_PROVIDERS], ngImport: i0, template: `
|
|
18206
18438
|
<div class="designer-shell">
|
|
18207
18439
|
@if (loadError()) { <div role="alert">{{ loadError() }} <button type="button" (click)="retryLoad()">Retry</button></div> }
|
|
18208
18440
|
<!-- Top Actions Toolbar with Sidebar Controls -->
|
|
@@ -18419,7 +18651,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
18419
18651
|
PropertyEditorComponent,
|
|
18420
18652
|
ReportRuntimeComponent,
|
|
18421
18653
|
RptIconComponent,
|
|
18422
|
-
], providers: [DesignerStateService, ...DESIGNER_ENDPOINT_PROVIDERS], template: `
|
|
18654
|
+
], providers: [DesignerFormContextService, DesignerStateService, ...DESIGNER_ENDPOINT_PROVIDERS], template: `
|
|
18423
18655
|
<div class="designer-shell">
|
|
18424
18656
|
@if (loadError()) { <div role="alert">{{ loadError() }} <button type="button" (click)="retryLoad()">Retry</button></div> }
|
|
18425
18657
|
<!-- Top Actions Toolbar with Sidebar Controls -->
|