@processpuzzle/base-entity 0.9.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable,
|
|
2
|
+
import { inject, Injectable, output, signal, forwardRef, ViewChild, Inject, Component, input, Injector, computed, effect, InjectionToken, Directive, HostBinding, EventEmitter, Output, DestroyRef, untracked, runInInjectionContext, provideAppInitializer } from '@angular/core';
|
|
3
3
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
-
import * as i1 from '@angular/common';
|
|
4
|
+
import * as i1$1 from '@angular/common';
|
|
5
5
|
import { CommonModule, NgClass, NgStyle, NgTemplateOutlet, SlicePipe } from '@angular/common';
|
|
6
6
|
import { Router, RouteConfigLoadEnd, NavigationEnd, ActivatedRoute, RouterOutlet, ROUTER_OUTLET_DATA } from '@angular/router';
|
|
7
7
|
import { MatTabNav, MatTabLink, MatTabNavPanel } from '@angular/material/tabs';
|
|
@@ -10,24 +10,31 @@ import { MatToolbarModule, MatToolbar } from '@angular/material/toolbar';
|
|
|
10
10
|
import { MatIcon } from '@angular/material/icon';
|
|
11
11
|
import { MatButton, MatIconButton } from '@angular/material/button';
|
|
12
12
|
import * as i2$1 from '@angular/material/form-field';
|
|
13
|
-
import { MatFormField,
|
|
13
|
+
import { MatFormField, MatSuffix, MatFormFieldModule, MatLabel, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
|
14
14
|
import * as i3 from '@angular/material/input';
|
|
15
15
|
import { MatInput, MatInputModule } from '@angular/material/input';
|
|
16
16
|
import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
|
17
17
|
import { signalStore, withState, withMethods, patchState, withHooks, signalStoreFeature, withProps, withComputed } from '@ngrx/signals';
|
|
18
18
|
import { withDevtools } from '@angular-architects/ngrx-toolkit';
|
|
19
19
|
import { LayoutService, RUNTIME_CONFIGURATION } from '@processpuzzle/util';
|
|
20
|
+
import * as i1 from '@angular/forms';
|
|
21
|
+
import { NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule, FormsModule, Validators, FormBuilder } from '@angular/forms';
|
|
22
|
+
import { MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatDialog } from '@angular/material/dialog';
|
|
23
|
+
import { TranslocoDirective, provideTranslocoScope, TranslocoService } from '@jsverse/transloco';
|
|
24
|
+
import { Compartment, EditorState } from '@codemirror/state';
|
|
25
|
+
import { EditorView, keymap, placeholder } from '@codemirror/view';
|
|
26
|
+
import { history, defaultKeymap, historyKeymap } from '@codemirror/commands';
|
|
27
|
+
import { closeBrackets, autocompletion } from '@codemirror/autocomplete';
|
|
28
|
+
import { StreamLanguage, HighlightStyle, syntaxHighlighting, bracketMatching } from '@codemirror/language';
|
|
29
|
+
import { tags } from '@lezer/highlight';
|
|
30
|
+
import { linter } from '@codemirror/lint';
|
|
20
31
|
import { __decorate, __param } from 'tslib';
|
|
21
32
|
import { map, filter, switchMap, Subject, from, of, firstValueFrom, pipe, tap } from 'rxjs';
|
|
22
33
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
23
34
|
import { buildUrl } from 'build-url-ts';
|
|
24
|
-
import * as i1$1 from '@angular/forms';
|
|
25
|
-
import { ReactiveFormsModule, FormsModule, FormControl, Validators, FormBuilder } from '@angular/forms';
|
|
26
35
|
import { MatCard, MatCardContent, MatCardActions } from '@angular/material/card';
|
|
27
36
|
import { NGXLogger } from 'ngx-logging-kit';
|
|
28
37
|
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
29
|
-
import { MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatDialog } from '@angular/material/dialog';
|
|
30
|
-
import { TranslocoService, provideTranslocoScope } from '@jsverse/transloco';
|
|
31
38
|
import * as i4 from '@angular/material/datepicker';
|
|
32
39
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
33
40
|
import * as i2$2 from '@angular/material/select';
|
|
@@ -158,7 +165,7 @@ const INITIAL_NAVIGATION_STATE = {
|
|
|
158
165
|
function snakeCaseName(entityName) {
|
|
159
166
|
return entityName
|
|
160
167
|
.replace(/\s+/g, '') // strip whitespace
|
|
161
|
-
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1
|
|
168
|
+
.replace(/([A-Z]+)(?=[A-Z][a-z])/g, '$1-') // "ITVariant" -> "IT-Variant"
|
|
162
169
|
.replace(/([a-z\d])([A-Z])/g, '$1-$2') // "DeviceType" -> "Device-Type"
|
|
163
170
|
.toLowerCase();
|
|
164
171
|
}
|
|
@@ -419,6 +426,889 @@ function BaseFormNavigatorStore(entityName) {
|
|
|
419
426
|
}));
|
|
420
427
|
}
|
|
421
428
|
|
|
429
|
+
const OPERATOR_RE = /^(==|!=|=gt=|=ge=|=lt=|=le=|=in=|=out=|=like=)/;
|
|
430
|
+
const SELECTOR_RE = /^[a-zA-Z_][a-zA-Z0-9_.]*/;
|
|
431
|
+
const UNQUOTED_VALUE_RE = /^[^,;()'"\s]+/;
|
|
432
|
+
const rsqlLanguage = StreamLanguage.define({
|
|
433
|
+
startState: () => ({ expect: 'selector' }),
|
|
434
|
+
token(stream, state) {
|
|
435
|
+
if (stream.eatSpace())
|
|
436
|
+
return null;
|
|
437
|
+
if (stream.match('('))
|
|
438
|
+
return 'paren';
|
|
439
|
+
if (stream.match(')'))
|
|
440
|
+
return 'paren';
|
|
441
|
+
if (stream.match(';')) {
|
|
442
|
+
state.expect = 'selector';
|
|
443
|
+
return 'operator.and';
|
|
444
|
+
}
|
|
445
|
+
if (stream.match(',')) {
|
|
446
|
+
state.expect = 'selector';
|
|
447
|
+
return 'operator.or';
|
|
448
|
+
}
|
|
449
|
+
if (stream.peek() === "'" || stream.peek() === '"') {
|
|
450
|
+
const quote = stream.next();
|
|
451
|
+
while (!stream.eol()) {
|
|
452
|
+
if (stream.next() === quote)
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
state.expect = 'connector';
|
|
456
|
+
return 'string';
|
|
457
|
+
}
|
|
458
|
+
if (state.expect === 'operator' && stream.match(OPERATOR_RE)) {
|
|
459
|
+
state.expect = 'value';
|
|
460
|
+
return 'operatorKeyword';
|
|
461
|
+
}
|
|
462
|
+
if (state.expect === 'value' && stream.match(UNQUOTED_VALUE_RE)) {
|
|
463
|
+
state.expect = 'connector';
|
|
464
|
+
return 'string';
|
|
465
|
+
}
|
|
466
|
+
if (stream.match(SELECTOR_RE)) {
|
|
467
|
+
state.expect = 'operator';
|
|
468
|
+
return 'propertyName';
|
|
469
|
+
}
|
|
470
|
+
stream.next();
|
|
471
|
+
return 'invalid';
|
|
472
|
+
},
|
|
473
|
+
});
|
|
474
|
+
/** Optional highlight style — merge into your existing theme setup if you have one. */
|
|
475
|
+
const rsqlHighlightStyle = HighlightStyle.define([
|
|
476
|
+
{ tag: tags.propertyName, color: '#0b7285', fontWeight: '600' },
|
|
477
|
+
{ tag: tags.operatorKeyword, color: '#9c36b5' },
|
|
478
|
+
{ tag: tags.string, color: '#2f9e44' },
|
|
479
|
+
{ tag: tags.paren, color: '#495057' },
|
|
480
|
+
{ tag: tags.invalid, color: '#e03131', textDecoration: 'underline wavy' },
|
|
481
|
+
]);
|
|
482
|
+
const rsqlSyntaxHighlighting = syntaxHighlighting(rsqlHighlightStyle);
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Minimal RSQL/FIQL tokenizer + recursive-descent validator.
|
|
486
|
+
*
|
|
487
|
+
* Grammar (simplified FIQL/RSQL):
|
|
488
|
+
* input := or-expr
|
|
489
|
+
* or-expr := and-expr (',' and-expr)*
|
|
490
|
+
* and-expr := constraint (';' constraint)*
|
|
491
|
+
* constraint := group | comparison
|
|
492
|
+
* group := '(' or-expr ')'
|
|
493
|
+
* comparison := selector operator value
|
|
494
|
+
* value := unquoted-value | "'" ... "'" | '"' ... '"' | '(' value (',' value)* ')'
|
|
495
|
+
*
|
|
496
|
+
* This is intentionally dependency-free so it can run both in the browser
|
|
497
|
+
* (CodeMirror linter) and, if useful, be ported/mirrored server-side.
|
|
498
|
+
*/
|
|
499
|
+
const OPERATOR_PATTERN = /^(==|!=|=gt=|=ge=|=lt=|=le=|=in=|=out=|=like=)/;
|
|
500
|
+
const SELECTOR_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_.]*/;
|
|
501
|
+
const UNQUOTED_VALUE_PATTERN = /^[^,;()'"\s]+/;
|
|
502
|
+
function tokenize(input) {
|
|
503
|
+
const tokens = [];
|
|
504
|
+
let i = 0;
|
|
505
|
+
while (i < input.length) {
|
|
506
|
+
const ch = input[i];
|
|
507
|
+
if (/\s/.test(ch)) {
|
|
508
|
+
const start = i;
|
|
509
|
+
while (i < input.length && /\s/.test(input[i]))
|
|
510
|
+
i++;
|
|
511
|
+
tokens.push({ type: 'whitespace', value: input.slice(start, i), from: start, to: i });
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
if (ch === '(') {
|
|
515
|
+
tokens.push({ type: 'lparen', value: '(', from: i, to: i + 1 });
|
|
516
|
+
i++;
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
if (ch === ')') {
|
|
520
|
+
tokens.push({ type: 'rparen', value: ')', from: i, to: i + 1 });
|
|
521
|
+
i++;
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
if (ch === ';') {
|
|
525
|
+
tokens.push({ type: 'and', value: ';', from: i, to: i + 1 });
|
|
526
|
+
i++;
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
if (ch === ',') {
|
|
530
|
+
tokens.push({ type: 'comma', value: ',', from: i, to: i + 1 });
|
|
531
|
+
i++;
|
|
532
|
+
continue;
|
|
533
|
+
}
|
|
534
|
+
if (ch === "'" || ch === '"') {
|
|
535
|
+
const quote = ch;
|
|
536
|
+
const start = i;
|
|
537
|
+
i++;
|
|
538
|
+
while (i < input.length && input[i] !== quote)
|
|
539
|
+
i++;
|
|
540
|
+
const closed = input[i] === quote;
|
|
541
|
+
i = closed ? i + 1 : i;
|
|
542
|
+
tokens.push({ type: 'value', value: input.slice(start, i), from: start, to: i });
|
|
543
|
+
if (!closed) {
|
|
544
|
+
// mark as unknown-length token so the parser can flag unterminated string
|
|
545
|
+
tokens[tokens.length - 1].type = 'unknown';
|
|
546
|
+
}
|
|
547
|
+
continue;
|
|
548
|
+
}
|
|
549
|
+
const rest = input.slice(i);
|
|
550
|
+
const opMatch = rest.match(OPERATOR_PATTERN);
|
|
551
|
+
// Only treat as operator if we're expecting one (after a selector) —
|
|
552
|
+
// handled by caller context; here we just tokenize opportunistically
|
|
553
|
+
// and let the parser decide validity by position.
|
|
554
|
+
if (opMatch && looksLikeOperatorPosition(tokens)) {
|
|
555
|
+
tokens.push({ type: 'operator', value: opMatch[0], from: i, to: i + opMatch[0].length });
|
|
556
|
+
i += opMatch[0].length;
|
|
557
|
+
continue;
|
|
558
|
+
}
|
|
559
|
+
if (looksLikeValuePosition(tokens)) {
|
|
560
|
+
const valMatch = rest.match(UNQUOTED_VALUE_PATTERN);
|
|
561
|
+
if (valMatch) {
|
|
562
|
+
tokens.push({ type: 'value', value: valMatch[0], from: i, to: i + valMatch[0].length });
|
|
563
|
+
i += valMatch[0].length;
|
|
564
|
+
continue;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
const selMatch = rest.match(SELECTOR_PATTERN);
|
|
568
|
+
if (selMatch) {
|
|
569
|
+
tokens.push({ type: 'selector', value: selMatch[0], from: i, to: i + selMatch[0].length });
|
|
570
|
+
i += selMatch[0].length;
|
|
571
|
+
continue;
|
|
572
|
+
}
|
|
573
|
+
// Unrecognized character
|
|
574
|
+
tokens.push({ type: 'unknown', value: ch, from: i, to: i + 1 });
|
|
575
|
+
i++;
|
|
576
|
+
}
|
|
577
|
+
return tokens;
|
|
578
|
+
}
|
|
579
|
+
function lastMeaningful(tokens) {
|
|
580
|
+
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
581
|
+
if (tokens[i].type !== 'whitespace')
|
|
582
|
+
return tokens[i];
|
|
583
|
+
}
|
|
584
|
+
return undefined;
|
|
585
|
+
}
|
|
586
|
+
function looksLikeOperatorPosition(tokens) {
|
|
587
|
+
const last = lastMeaningful(tokens);
|
|
588
|
+
return !!last && last.type === 'selector';
|
|
589
|
+
}
|
|
590
|
+
function looksLikeValuePosition(tokens) {
|
|
591
|
+
const last = lastMeaningful(tokens);
|
|
592
|
+
return !!last && last.type === 'operator';
|
|
593
|
+
}
|
|
594
|
+
/** Validates paren balance, clause structure and token ordering. Field/operator
|
|
595
|
+
* semantic checks (does field exist, is operator valid for its type) are layered
|
|
596
|
+
* on top by the linter using RsqlFieldMetadataProvider. */
|
|
597
|
+
function validateStructure(input) {
|
|
598
|
+
const errors = [];
|
|
599
|
+
const tokens = tokenize(input).filter((t) => t.type !== 'whitespace');
|
|
600
|
+
if (tokens.length === 0)
|
|
601
|
+
return errors;
|
|
602
|
+
let depth = 0;
|
|
603
|
+
let expect = 'selector';
|
|
604
|
+
for (let idx = 0; idx < tokens.length; idx++) {
|
|
605
|
+
const tok = tokens[idx];
|
|
606
|
+
if (tok.type === 'unknown') {
|
|
607
|
+
errors.push({ message: `Unexpected character '${tok.value}'`, from: tok.from, to: tok.to, severity: 'error' });
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
610
|
+
switch (expect) {
|
|
611
|
+
case 'selector':
|
|
612
|
+
if (tok.type === 'lparen') {
|
|
613
|
+
depth++;
|
|
614
|
+
// stay in 'selector' state for the nested expression
|
|
615
|
+
}
|
|
616
|
+
else if (tok.type === 'selector') {
|
|
617
|
+
expect = 'operator';
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
errors.push({ message: `Expected a field name here`, from: tok.from, to: tok.to, severity: 'error' });
|
|
621
|
+
}
|
|
622
|
+
break;
|
|
623
|
+
case 'operator':
|
|
624
|
+
if (tok.type === 'operator') {
|
|
625
|
+
expect = 'value';
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
errors.push({
|
|
629
|
+
message: `Expected a comparison operator (==, !=, =gt=, =lt=, =in= ...) after '${tokens[idx - 1]?.value}'`,
|
|
630
|
+
from: tok.from,
|
|
631
|
+
to: tok.to,
|
|
632
|
+
severity: 'error',
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
break;
|
|
636
|
+
case 'value':
|
|
637
|
+
if (tok.type === 'value') {
|
|
638
|
+
expect = 'connector-or-close';
|
|
639
|
+
}
|
|
640
|
+
else if (tok.type === 'lparen') {
|
|
641
|
+
// start of value list e.g. field=in=(a,b,c) — consume until rparen
|
|
642
|
+
let inner = 1;
|
|
643
|
+
idx++;
|
|
644
|
+
while (idx < tokens.length && inner > 0) {
|
|
645
|
+
if (tokens[idx].type === 'lparen')
|
|
646
|
+
inner++;
|
|
647
|
+
if (tokens[idx].type === 'rparen')
|
|
648
|
+
inner--;
|
|
649
|
+
idx++;
|
|
650
|
+
}
|
|
651
|
+
idx--;
|
|
652
|
+
expect = 'connector-or-close';
|
|
653
|
+
}
|
|
654
|
+
else {
|
|
655
|
+
errors.push({ message: `Expected a value here`, from: tok.from, to: tok.to, severity: 'error' });
|
|
656
|
+
}
|
|
657
|
+
break;
|
|
658
|
+
case 'connector-or-close':
|
|
659
|
+
if (tok.type === 'and' || tok.type === 'comma') {
|
|
660
|
+
expect = 'selector';
|
|
661
|
+
}
|
|
662
|
+
else if (tok.type === 'rparen') {
|
|
663
|
+
depth--;
|
|
664
|
+
if (depth < 0) {
|
|
665
|
+
errors.push({ message: `Unmatched ')'`, from: tok.from, to: tok.to, severity: 'error' });
|
|
666
|
+
depth = 0;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
else {
|
|
670
|
+
errors.push({
|
|
671
|
+
message: `Expected ';' (AND), ',' (OR) or ')' here`,
|
|
672
|
+
from: tok.from,
|
|
673
|
+
to: tok.to,
|
|
674
|
+
severity: 'error',
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
break;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
if (expect === 'selector' && tokens.length > 0) {
|
|
681
|
+
const last = tokens[tokens.length - 1];
|
|
682
|
+
errors.push({ message: `Query ends unexpectedly, expected a field name`, from: last.to, to: last.to, severity: 'error' });
|
|
683
|
+
}
|
|
684
|
+
if (expect === 'operator') {
|
|
685
|
+
const last = tokens[tokens.length - 1];
|
|
686
|
+
errors.push({ message: `Missing comparison operator`, from: last.to, to: last.to, severity: 'error' });
|
|
687
|
+
}
|
|
688
|
+
if (expect === 'value') {
|
|
689
|
+
const last = tokens[tokens.length - 1];
|
|
690
|
+
errors.push({ message: `Missing value`, from: last.to, to: last.to, severity: 'error' });
|
|
691
|
+
}
|
|
692
|
+
if (depth > 0) {
|
|
693
|
+
const last = tokens[tokens.length - 1];
|
|
694
|
+
errors.push({ message: `Missing ${depth} closing ')'`, from: last.to, to: last.to, severity: 'error' });
|
|
695
|
+
}
|
|
696
|
+
return errors;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Structural + semantic linter.
|
|
701
|
+
* - Structural errors (unbalanced parens, missing operator/value, etc.) come from validateStructure().
|
|
702
|
+
* - Semantic errors (unknown field, operator not valid for field type) are checked here
|
|
703
|
+
* against the injected RsqlFieldMetadataProvider — purely client-side, no round trip.
|
|
704
|
+
*
|
|
705
|
+
* If you also want server-side validation (e.g. value format checks against a live
|
|
706
|
+
* enum list), debounce a call to your /rsql/validate endpoint and merge its diagnostics
|
|
707
|
+
* in with these before returning — CodeMirror's linter() supports async source functions.
|
|
708
|
+
*/
|
|
709
|
+
function createRsqlLinter(fieldMetadata) {
|
|
710
|
+
return linter((view) => {
|
|
711
|
+
const text = view.state.doc.toString();
|
|
712
|
+
if (!text.trim())
|
|
713
|
+
return [];
|
|
714
|
+
const diagnostics = [];
|
|
715
|
+
for (const err of validateStructure(text)) {
|
|
716
|
+
diagnostics.push({
|
|
717
|
+
from: err.from,
|
|
718
|
+
to: Math.max(err.to, err.from + 1),
|
|
719
|
+
severity: err.severity,
|
|
720
|
+
message: err.message,
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
// Only run semantic checks if structure is otherwise sound, to avoid noisy
|
|
724
|
+
// double-reporting while the user is still mid-token.
|
|
725
|
+
if (diagnostics.length === 0) {
|
|
726
|
+
const tokens = tokenize(text).filter((t) => t.type !== 'whitespace');
|
|
727
|
+
diagnostics.push(...checkSemantics(tokens, fieldMetadata));
|
|
728
|
+
}
|
|
729
|
+
return diagnostics;
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
function checkSemantics(tokens, provider) {
|
|
733
|
+
const diagnostics = [];
|
|
734
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
735
|
+
const tok = tokens[i];
|
|
736
|
+
if (tok.type !== 'selector')
|
|
737
|
+
continue;
|
|
738
|
+
const field = provider.getField(tok.value);
|
|
739
|
+
if (!field) {
|
|
740
|
+
diagnostics.push({
|
|
741
|
+
from: tok.from,
|
|
742
|
+
to: tok.to,
|
|
743
|
+
severity: 'error',
|
|
744
|
+
message: `Unknown field '${tok.value}'`,
|
|
745
|
+
});
|
|
746
|
+
continue;
|
|
747
|
+
}
|
|
748
|
+
const opTok = tokens[i + 1];
|
|
749
|
+
if (opTok?.type === 'operator') {
|
|
750
|
+
const allowed = field.operators ?? [];
|
|
751
|
+
if (allowed.length > 0 && !allowed.includes(opTok.value)) {
|
|
752
|
+
diagnostics.push({
|
|
753
|
+
from: opTok.from,
|
|
754
|
+
to: opTok.to,
|
|
755
|
+
severity: 'error',
|
|
756
|
+
message: `Operator '${opTok.value}' is not valid for '${field.name}' (${field.type}). Allowed: ${allowed.join(', ')}`,
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
if (field.type === 'enum' && field.enumValues?.length) {
|
|
761
|
+
const valTok = tokens[i + 2];
|
|
762
|
+
if (valTok?.type === 'value') {
|
|
763
|
+
const raw = stripQuotes(valTok.value);
|
|
764
|
+
const candidates = raw.split(',').map((v) => v.trim());
|
|
765
|
+
for (const c of candidates) {
|
|
766
|
+
if (c && !field.enumValues.includes(c)) {
|
|
767
|
+
diagnostics.push({
|
|
768
|
+
from: valTok.from,
|
|
769
|
+
to: valTok.to,
|
|
770
|
+
severity: 'warning',
|
|
771
|
+
message: `'${c}' is not a known value for '${field.name}'. Expected one of: ${field.enumValues.join(', ')}`,
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
return diagnostics;
|
|
779
|
+
}
|
|
780
|
+
function stripQuotes(v) {
|
|
781
|
+
return v.replace(/^['"]|['"]$/g, '');
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Contract for exposing entity field metadata to the RSQL editor.
|
|
786
|
+
* Wire this up to whatever already feeds BASE_ENTITY_STORE_REGISTRY / your
|
|
787
|
+
* entity schema so field names, types and operators stay in sync with the backend.
|
|
788
|
+
*/
|
|
789
|
+
const RSQL_OPERATORS_BY_TYPE = {
|
|
790
|
+
string: ['==', '!=', '=in=', '=out=', '=like='],
|
|
791
|
+
number: ['==', '!=', '=gt=', '=ge=', '=lt=', '=le=', '=in=', '=out='],
|
|
792
|
+
boolean: ['==', '!='],
|
|
793
|
+
date: ['==', '!=', '=gt=', '=ge=', '=lt=', '=le='],
|
|
794
|
+
datetime: ['==', '!=', '=gt=', '=ge=', '=lt=', '=le='],
|
|
795
|
+
enum: ['==', '!=', '=in=', '=out='],
|
|
796
|
+
};
|
|
797
|
+
class RsqlFieldMetadataProvider {
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Determines what kind of token is expected at the cursor by looking at the
|
|
802
|
+
* last meaningful token before it, then offers the appropriate completions:
|
|
803
|
+
* field names -> operators (scoped to that field's type) -> values (enum/bool/date hint) -> connectors.
|
|
804
|
+
*/
|
|
805
|
+
function createRsqlCompletionSource(fieldMetadata) {
|
|
806
|
+
return (context) => {
|
|
807
|
+
const textBefore = context.state.doc.toString().slice(0, context.pos);
|
|
808
|
+
const tokens = tokenize(textBefore).filter((t) => t.type !== 'whitespace');
|
|
809
|
+
const last = tokens[tokens.length - 1];
|
|
810
|
+
// Start of query, start of a new clause, or right after '(' -> suggest fields
|
|
811
|
+
if (!last || last.type === 'and' || last.type === 'comma' || last.type === 'lparen') {
|
|
812
|
+
return fieldCompletions(context, fieldMetadata, context.pos);
|
|
813
|
+
}
|
|
814
|
+
// Mid-typing a field name
|
|
815
|
+
if (last.type === 'selector' && isCursorInsideToken(context.pos, last)) {
|
|
816
|
+
return fieldCompletions(context, fieldMetadata, last.from);
|
|
817
|
+
}
|
|
818
|
+
// Field name complete -> suggest operators for that field
|
|
819
|
+
if (last.type === 'selector' && !isCursorInsideToken(context.pos, last)) {
|
|
820
|
+
const field = fieldMetadata.getField(last.value);
|
|
821
|
+
const ops = field ? field.operators ?? RSQL_OPERATORS_BY_TYPE[field.type] : Object.values(RSQL_OPERATORS_BY_TYPE).flat();
|
|
822
|
+
const unique = Array.from(new Set(ops));
|
|
823
|
+
return {
|
|
824
|
+
from: context.pos,
|
|
825
|
+
options: unique.map((op) => ({ label: op, type: 'keyword' })),
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
// Operator complete -> suggest values based on field type
|
|
829
|
+
if (last.type === 'operator') {
|
|
830
|
+
const selectorTok = tokens[tokens.length - 2];
|
|
831
|
+
const field = selectorTok ? fieldMetadata.getField(selectorTok.value) : undefined;
|
|
832
|
+
return {
|
|
833
|
+
from: context.pos,
|
|
834
|
+
options: valueCompletions(field),
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
// Value complete -> suggest connectors
|
|
838
|
+
if (last.type === 'value' || last.type === 'rparen') {
|
|
839
|
+
return {
|
|
840
|
+
from: context.pos,
|
|
841
|
+
options: [
|
|
842
|
+
{ label: ';', displayLabel: '; (AND)', type: 'keyword' },
|
|
843
|
+
{ label: ',', displayLabel: ', (OR)', type: 'keyword' },
|
|
844
|
+
],
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
return null;
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
function fieldCompletions(context, fieldMetadata, from) {
|
|
851
|
+
const options = fieldMetadata.getFields().map((f) => ({
|
|
852
|
+
label: f.name,
|
|
853
|
+
displayLabel: f.label ?? f.name,
|
|
854
|
+
type: 'property',
|
|
855
|
+
detail: f.type,
|
|
856
|
+
}));
|
|
857
|
+
return { from, options, validFor: /^[a-zA-Z_][a-zA-Z0-9_.]*$/ };
|
|
858
|
+
}
|
|
859
|
+
function valueCompletions(field) {
|
|
860
|
+
if (!field)
|
|
861
|
+
return [];
|
|
862
|
+
switch (field.type) {
|
|
863
|
+
case 'boolean':
|
|
864
|
+
return [
|
|
865
|
+
{ label: 'true', type: 'constant' },
|
|
866
|
+
{ label: 'false', type: 'constant' },
|
|
867
|
+
];
|
|
868
|
+
case 'enum':
|
|
869
|
+
return (field.enumValues ?? []).map((v) => ({ label: v, type: 'enum' }));
|
|
870
|
+
case 'date':
|
|
871
|
+
return [{ label: new Date().toISOString().slice(0, 10), type: 'text', detail: 'YYYY-MM-DD' }];
|
|
872
|
+
case 'datetime':
|
|
873
|
+
return [{ label: new Date().toISOString(), type: 'text', detail: 'ISO 8601' }];
|
|
874
|
+
default:
|
|
875
|
+
return [];
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
function isCursorInsideToken(pos, tok) {
|
|
879
|
+
return pos > tok.from && pos <= tok.to;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
const FALLBACK_SAMPLE = "status==active;createdAt=gt='2026-01-01'";
|
|
883
|
+
const SAMPLE_TYPE_PRIORITY = ['string', 'date', 'datetime', 'enum', 'boolean', 'number'];
|
|
884
|
+
function buildSampleQuery(provider) {
|
|
885
|
+
const fields = provider.getFields();
|
|
886
|
+
if (fields.length === 0)
|
|
887
|
+
return FALLBACK_SAMPLE;
|
|
888
|
+
const picks = [];
|
|
889
|
+
const used = new Set();
|
|
890
|
+
for (const type of SAMPLE_TYPE_PRIORITY) {
|
|
891
|
+
if (picks.length >= 2)
|
|
892
|
+
break;
|
|
893
|
+
const field = fields.find((f) => f.type === type && !used.has(f.name));
|
|
894
|
+
if (!field)
|
|
895
|
+
continue;
|
|
896
|
+
picks.push(sampleClause(field));
|
|
897
|
+
used.add(field.name);
|
|
898
|
+
}
|
|
899
|
+
if (picks.length === 0)
|
|
900
|
+
picks.push(`${fields[0].name}=='sample'`);
|
|
901
|
+
return picks.join(';');
|
|
902
|
+
}
|
|
903
|
+
function sampleClause(field) {
|
|
904
|
+
switch (field.type) {
|
|
905
|
+
case 'string': return `${field.name}=='sample'`;
|
|
906
|
+
case 'number': return `${field.name}=gt=0`;
|
|
907
|
+
case 'boolean': return `${field.name}==true`;
|
|
908
|
+
case 'date':
|
|
909
|
+
case 'datetime': return `${field.name}=gt='2026-01-01'`;
|
|
910
|
+
case 'enum': return `${field.name}==${field.enumValues?.[0] ?? 'value'}`;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
class RsqlQueryEditorComponent {
|
|
914
|
+
fieldMetadata;
|
|
915
|
+
editorHost;
|
|
916
|
+
/** Emits the current query string on every change (in addition to the CVA path). */
|
|
917
|
+
queryChange = output();
|
|
918
|
+
/** Emits true/false as validity flips, so parent forms can react without re-parsing. */
|
|
919
|
+
validityChange = output();
|
|
920
|
+
isValid = signal(true, /* @ts-ignore */
|
|
921
|
+
...(ngDevMode ? [{ debugName: "isValid" }] : /* istanbul ignore next */ []));
|
|
922
|
+
view;
|
|
923
|
+
readOnlyCompartment = new Compartment();
|
|
924
|
+
onChange = () => {
|
|
925
|
+
/* replaced by registerOnChange */
|
|
926
|
+
};
|
|
927
|
+
onTouched = () => {
|
|
928
|
+
/* replaced by registerOnTouched */
|
|
929
|
+
};
|
|
930
|
+
pendingValue = '';
|
|
931
|
+
constructor(fieldMetadata) {
|
|
932
|
+
this.fieldMetadata = fieldMetadata;
|
|
933
|
+
}
|
|
934
|
+
ngAfterViewInit() {
|
|
935
|
+
const updateListener = EditorView.updateListener.of((update) => {
|
|
936
|
+
if (update.docChanged) {
|
|
937
|
+
const value = update.state.doc.toString();
|
|
938
|
+
this.onChange(value);
|
|
939
|
+
this.queryChange.emit(value);
|
|
940
|
+
}
|
|
941
|
+
if (update.transactions.some((tr) => tr.effects.length > 0)) {
|
|
942
|
+
// diagnostics recompute is handled internally by the linter extension;
|
|
943
|
+
// we just reflect current validity out for convenience.
|
|
944
|
+
queueMicrotask(() => this.reportValidity());
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
const sampleQuery = buildSampleQuery(this.fieldMetadata);
|
|
948
|
+
const acceptSampleOnTab = {
|
|
949
|
+
key: 'Tab',
|
|
950
|
+
run: (view) => {
|
|
951
|
+
if (view.state.doc.length !== 0)
|
|
952
|
+
return false;
|
|
953
|
+
view.dispatch({
|
|
954
|
+
changes: { from: 0, insert: sampleQuery },
|
|
955
|
+
selection: { anchor: sampleQuery.length },
|
|
956
|
+
});
|
|
957
|
+
return true;
|
|
958
|
+
},
|
|
959
|
+
};
|
|
960
|
+
const state = EditorState.create({
|
|
961
|
+
doc: this.pendingValue,
|
|
962
|
+
extensions: [
|
|
963
|
+
history(),
|
|
964
|
+
keymap.of([acceptSampleOnTab, ...defaultKeymap, ...historyKeymap]),
|
|
965
|
+
rsqlLanguage,
|
|
966
|
+
rsqlSyntaxHighlighting,
|
|
967
|
+
bracketMatching(),
|
|
968
|
+
closeBrackets(),
|
|
969
|
+
autocompletion({ override: [createRsqlCompletionSource(this.fieldMetadata)] }),
|
|
970
|
+
createRsqlLinter(this.fieldMetadata),
|
|
971
|
+
placeholder(`e.g. ${sampleQuery}`),
|
|
972
|
+
this.readOnlyCompartment.of([]),
|
|
973
|
+
updateListener,
|
|
974
|
+
EditorView.domEventHandlers({
|
|
975
|
+
blur: () => {
|
|
976
|
+
this.onTouched();
|
|
977
|
+
},
|
|
978
|
+
}),
|
|
979
|
+
],
|
|
980
|
+
});
|
|
981
|
+
this.view = new EditorView({ state, parent: this.editorHost.nativeElement });
|
|
982
|
+
this.reportValidity();
|
|
983
|
+
}
|
|
984
|
+
ngOnDestroy() {
|
|
985
|
+
this.view?.destroy();
|
|
986
|
+
}
|
|
987
|
+
// --- ControlValueAccessor ---
|
|
988
|
+
writeValue(value) {
|
|
989
|
+
const next = value ?? '';
|
|
990
|
+
this.pendingValue = next;
|
|
991
|
+
if (this.view) {
|
|
992
|
+
const current = this.view.state.doc.toString();
|
|
993
|
+
if (current !== next) {
|
|
994
|
+
this.view.dispatch({ changes: { from: 0, to: current.length, insert: next } });
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
registerOnChange(fn) {
|
|
999
|
+
this.onChange = fn;
|
|
1000
|
+
}
|
|
1001
|
+
registerOnTouched(fn) {
|
|
1002
|
+
this.onTouched = fn;
|
|
1003
|
+
}
|
|
1004
|
+
setDisabledState(isDisabled) {
|
|
1005
|
+
this.view?.dispatch({
|
|
1006
|
+
effects: this.readOnlyCompartment.reconfigure(EditorView.editable.of(!isDisabled)),
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
reportValidity() {
|
|
1010
|
+
const view = this.view;
|
|
1011
|
+
if (!view)
|
|
1012
|
+
return;
|
|
1013
|
+
// @codemirror/lint stores active diagnostics on a state field we can read via
|
|
1014
|
+
// the lintState extension's export, but the simplest robust check is to
|
|
1015
|
+
// re-run the same validators used by the linter.
|
|
1016
|
+
import('@codemirror/lint').then(({ forEachDiagnostic }) => {
|
|
1017
|
+
let hasError = false;
|
|
1018
|
+
forEachDiagnostic(view.state, (d) => {
|
|
1019
|
+
if (d.severity === 'error')
|
|
1020
|
+
hasError = true;
|
|
1021
|
+
});
|
|
1022
|
+
const valid = !hasError;
|
|
1023
|
+
if (valid !== this.isValid()) {
|
|
1024
|
+
this.isValid.set(valid);
|
|
1025
|
+
this.validityChange.emit(valid);
|
|
1026
|
+
}
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RsqlQueryEditorComponent, deps: [{ token: RsqlFieldMetadataProvider }], target: i0.ɵɵFactoryTarget.Component });
|
|
1030
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: RsqlQueryEditorComponent, isStandalone: true, selector: "pp-rsql-query-editor", outputs: { queryChange: "queryChange", validityChange: "validityChange" }, providers: [
|
|
1031
|
+
TranslocoDirective,
|
|
1032
|
+
{
|
|
1033
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1034
|
+
useExisting: forwardRef(() => RsqlQueryEditorComponent),
|
|
1035
|
+
multi: true,
|
|
1036
|
+
},
|
|
1037
|
+
], viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, static: true }], ngImport: i0, template: `<div #editorHost class="rsql-editor-host"></div>`, isInline: true, styles: [".rsql-editor-host{border:1px solid var(--pp-border-color, #ced4da);border-radius:4px;font-family:JetBrains Mono,Fira Code,monospace;font-size:13px;resize:both;overflow:hidden;min-width:320px;min-height:2.5rem;height:180px;width:100%}.rsql-editor-host :global(.cm-editor){height:100%;min-height:2.5rem}.rsql-editor-host :global(.cm-editor.cm-focused){outline:2px solid var(--pp-focus-color, #339af0);outline-offset:-1px}\n"] });
|
|
1038
|
+
}
|
|
1039
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RsqlQueryEditorComponent, decorators: [{
|
|
1040
|
+
type: Component,
|
|
1041
|
+
args: [{ selector: 'pp-rsql-query-editor', standalone: true, template: `<div #editorHost class="rsql-editor-host"></div>`, providers: [
|
|
1042
|
+
TranslocoDirective,
|
|
1043
|
+
{
|
|
1044
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1045
|
+
useExisting: forwardRef(() => RsqlQueryEditorComponent),
|
|
1046
|
+
multi: true,
|
|
1047
|
+
},
|
|
1048
|
+
], styles: [".rsql-editor-host{border:1px solid var(--pp-border-color, #ced4da);border-radius:4px;font-family:JetBrains Mono,Fira Code,monospace;font-size:13px;resize:both;overflow:hidden;min-width:320px;min-height:2.5rem;height:180px;width:100%}.rsql-editor-host :global(.cm-editor){height:100%;min-height:2.5rem}.rsql-editor-host :global(.cm-editor.cm-focused){outline:2px solid var(--pp-focus-color, #339af0);outline-offset:-1px}\n"] }]
|
|
1049
|
+
}], ctorParameters: () => [{ type: RsqlFieldMetadataProvider, decorators: [{
|
|
1050
|
+
type: Inject,
|
|
1051
|
+
args: [RsqlFieldMetadataProvider]
|
|
1052
|
+
}] }], propDecorators: { editorHost: [{
|
|
1053
|
+
type: ViewChild,
|
|
1054
|
+
args: ['editorHost', { static: true }]
|
|
1055
|
+
}], queryChange: [{ type: i0.Output, args: ["queryChange"] }], validityChange: [{ type: i0.Output, args: ["validityChange"] }] } });
|
|
1056
|
+
|
|
1057
|
+
class RsqlEditorDialog {
|
|
1058
|
+
data = inject(MAT_DIALOG_DATA);
|
|
1059
|
+
queryControl = new FormControl(this.data.initialQuery ?? '', { nonNullable: true });
|
|
1060
|
+
isValid = signal(true, /* @ts-ignore */
|
|
1061
|
+
...(ngDevMode ? [{ debugName: "isValid" }] : /* istanbul ignore next */ []));
|
|
1062
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RsqlEditorDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1063
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: RsqlEditorDialog, isStandalone: true, selector: "base-entity-rsql-editor-dialog", providers: [provideTranslocoScope({ scope: 'base_entity', alias: 'base_entity' })], ngImport: i0, template: `
|
|
1064
|
+
<ng-container *transloco="let t">
|
|
1065
|
+
<h2 mat-dialog-title>{{ t('base_entity.rsql_editor_dialog.title') }}</h2>
|
|
1066
|
+
<mat-dialog-content class="editor-content">
|
|
1067
|
+
<pp-rsql-query-editor [formControl]="queryControl" (validityChange)="isValid.set($event)"> </pp-rsql-query-editor>
|
|
1068
|
+
</mat-dialog-content>
|
|
1069
|
+
<mat-dialog-actions align="end">
|
|
1070
|
+
<button type="button" mat-button [mat-dialog-close]="null">{{ t('base_entity.rsql_editor_dialog.cancel_button') }}</button>
|
|
1071
|
+
<button type="button" mat-raised-button color="primary" [disabled]="!isValid()" [mat-dialog-close]="queryControl.value">{{ t('base_entity.rsql_editor_dialog.apply_button') }}</button>
|
|
1072
|
+
</mat-dialog-actions>
|
|
1073
|
+
</ng-container>
|
|
1074
|
+
`, isInline: true, styles: [".editor-content{min-width:520px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { 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: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: RsqlQueryEditorComponent, selector: "pp-rsql-query-editor", outputs: ["queryChange", "validityChange"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
|
|
1075
|
+
}
|
|
1076
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RsqlEditorDialog, decorators: [{
|
|
1077
|
+
type: Component,
|
|
1078
|
+
args: [{ selector: 'base-entity-rsql-editor-dialog', standalone: true, imports: [ReactiveFormsModule, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatButton, RsqlQueryEditorComponent, TranslocoDirective], providers: [provideTranslocoScope({ scope: 'base_entity', alias: 'base_entity' })], template: `
|
|
1079
|
+
<ng-container *transloco="let t">
|
|
1080
|
+
<h2 mat-dialog-title>{{ t('base_entity.rsql_editor_dialog.title') }}</h2>
|
|
1081
|
+
<mat-dialog-content class="editor-content">
|
|
1082
|
+
<pp-rsql-query-editor [formControl]="queryControl" (validityChange)="isValid.set($event)"> </pp-rsql-query-editor>
|
|
1083
|
+
</mat-dialog-content>
|
|
1084
|
+
<mat-dialog-actions align="end">
|
|
1085
|
+
<button type="button" mat-button [mat-dialog-close]="null">{{ t('base_entity.rsql_editor_dialog.cancel_button') }}</button>
|
|
1086
|
+
<button type="button" mat-raised-button color="primary" [disabled]="!isValid()" [mat-dialog-close]="queryControl.value">{{ t('base_entity.rsql_editor_dialog.apply_button') }}</button>
|
|
1087
|
+
</mat-dialog-actions>
|
|
1088
|
+
</ng-container>
|
|
1089
|
+
`, styles: [".editor-content{min-width:520px}\n"] }]
|
|
1090
|
+
}] });
|
|
1091
|
+
|
|
1092
|
+
class BaseEntityAttrDescriptor extends AbstractAttrDescriptor {
|
|
1093
|
+
description;
|
|
1094
|
+
styleClass = '';
|
|
1095
|
+
labelClass = '';
|
|
1096
|
+
format;
|
|
1097
|
+
isLinkToDetails;
|
|
1098
|
+
selectables;
|
|
1099
|
+
visible = true;
|
|
1100
|
+
hideInTable = false;
|
|
1101
|
+
isHeading;
|
|
1102
|
+
placeholder;
|
|
1103
|
+
lines;
|
|
1104
|
+
options;
|
|
1105
|
+
required = false;
|
|
1106
|
+
referenceIdField = 'id';
|
|
1107
|
+
_label;
|
|
1108
|
+
_linkedEntityType;
|
|
1109
|
+
constructor(attrName, formControlType, label, selectables, isLinkToDetails, options) {
|
|
1110
|
+
super(attrName, formControlType);
|
|
1111
|
+
this._label = label;
|
|
1112
|
+
this.selectables = selectables;
|
|
1113
|
+
this.isLinkToDetails = isLinkToDetails;
|
|
1114
|
+
this.options = { inputType: 'text', ...options };
|
|
1115
|
+
}
|
|
1116
|
+
getSelectables() {
|
|
1117
|
+
if (this.selectables === undefined)
|
|
1118
|
+
return undefined;
|
|
1119
|
+
return typeof this.selectables === 'function' ? this.selectables() : this.selectables;
|
|
1120
|
+
}
|
|
1121
|
+
// region properties
|
|
1122
|
+
get label() {
|
|
1123
|
+
return this._label ? this._label : this.attrName;
|
|
1124
|
+
}
|
|
1125
|
+
set label(label) {
|
|
1126
|
+
this._label = label;
|
|
1127
|
+
}
|
|
1128
|
+
get linkedEntityType() {
|
|
1129
|
+
return this._linkedEntityType;
|
|
1130
|
+
}
|
|
1131
|
+
set linkedEntityType(linkedEntityType) {
|
|
1132
|
+
this._linkedEntityType = linkedEntityType;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
var FlexDirection;
|
|
1137
|
+
(function (FlexDirection) {
|
|
1138
|
+
FlexDirection[FlexDirection["CONTAINER"] = 0] = "CONTAINER";
|
|
1139
|
+
FlexDirection[FlexDirection["COLUMN"] = 1] = "COLUMN";
|
|
1140
|
+
FlexDirection[FlexDirection["ROW"] = 2] = "ROW";
|
|
1141
|
+
})(FlexDirection || (FlexDirection = {}));
|
|
1142
|
+
class FlexboxDescriptor extends AbstractAttrDescriptor {
|
|
1143
|
+
attrDescriptors;
|
|
1144
|
+
direction;
|
|
1145
|
+
constructor(attrDescriptors, direction) {
|
|
1146
|
+
super('dummy', FormControlType.FLEX_BOX);
|
|
1147
|
+
this.attrDescriptors = attrDescriptors;
|
|
1148
|
+
this.direction = direction;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
function filterAttributeDescriptors(descriptors) {
|
|
1153
|
+
let attrDescriptors = [];
|
|
1154
|
+
descriptors.forEach((descriptor) => {
|
|
1155
|
+
if (descriptor instanceof BaseEntityAttrDescriptor)
|
|
1156
|
+
attrDescriptors.push(descriptor);
|
|
1157
|
+
else if (descriptor instanceof FlexboxDescriptor) {
|
|
1158
|
+
attrDescriptors = attrDescriptors.concat(filterAttributeDescriptors(descriptor.attrDescriptors));
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
return attrDescriptors;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
const SKIP_CONTROL_TYPES = new Set([
|
|
1165
|
+
FormControlType.ARTIFACT,
|
|
1166
|
+
FormControlType.COMPONENTS,
|
|
1167
|
+
FormControlType.FLEX_BOX,
|
|
1168
|
+
FormControlType.LABEL,
|
|
1169
|
+
FormControlType.TITLE,
|
|
1170
|
+
]);
|
|
1171
|
+
const CONTROL_TYPE_TO_RSQL_TYPE = {
|
|
1172
|
+
[FormControlType.CHECKBOX]: 'boolean',
|
|
1173
|
+
[FormControlType.DATE]: 'date',
|
|
1174
|
+
[FormControlType.DROPDOWN]: 'enum',
|
|
1175
|
+
[FormControlType.RADIO]: 'enum',
|
|
1176
|
+
[FormControlType.FOREIGN_KEY]: 'string',
|
|
1177
|
+
[FormControlType.LOOKUP]: 'string',
|
|
1178
|
+
[FormControlType.TAGS]: 'string',
|
|
1179
|
+
[FormControlType.TEXTAREA]: 'string',
|
|
1180
|
+
[FormControlType.TEXT_BOX]: 'string',
|
|
1181
|
+
};
|
|
1182
|
+
const INPUT_TYPE_TO_RSQL_TYPE = {
|
|
1183
|
+
number: 'number',
|
|
1184
|
+
date: 'date',
|
|
1185
|
+
datetime: 'datetime',
|
|
1186
|
+
'datetime-local': 'datetime',
|
|
1187
|
+
};
|
|
1188
|
+
class DescriptorBackedFieldMetadataProvider extends RsqlFieldMetadataProvider {
|
|
1189
|
+
fields;
|
|
1190
|
+
byName;
|
|
1191
|
+
constructor(attrDescriptors) {
|
|
1192
|
+
super();
|
|
1193
|
+
this.fields = filterAttributeDescriptors(attrDescriptors)
|
|
1194
|
+
.filter((d) => !SKIP_CONTROL_TYPES.has(d.formControlType))
|
|
1195
|
+
.map((d) => this.toRsqlField(d));
|
|
1196
|
+
this.byName = new Map(this.fields.map((f) => [f.name, f]));
|
|
1197
|
+
}
|
|
1198
|
+
getFields() {
|
|
1199
|
+
return this.fields;
|
|
1200
|
+
}
|
|
1201
|
+
getField(name) {
|
|
1202
|
+
return this.byName.get(name);
|
|
1203
|
+
}
|
|
1204
|
+
toRsqlField(descriptor) {
|
|
1205
|
+
const type = this.resolveType(descriptor);
|
|
1206
|
+
const field = {
|
|
1207
|
+
name: descriptor.attrName,
|
|
1208
|
+
type,
|
|
1209
|
+
operators: RSQL_OPERATORS_BY_TYPE[type],
|
|
1210
|
+
label: descriptor.label,
|
|
1211
|
+
};
|
|
1212
|
+
if (type === 'enum') {
|
|
1213
|
+
const selectables = descriptor.getSelectables();
|
|
1214
|
+
field.enumValues = selectables?.map((s) => s.key) ?? [];
|
|
1215
|
+
}
|
|
1216
|
+
return field;
|
|
1217
|
+
}
|
|
1218
|
+
resolveType(descriptor) {
|
|
1219
|
+
if (descriptor.formControlType === FormControlType.TEXT_BOX) {
|
|
1220
|
+
const inputType = descriptor.options?.inputType;
|
|
1221
|
+
if (inputType && INPUT_TYPE_TO_RSQL_TYPE[inputType])
|
|
1222
|
+
return INPUT_TYPE_TO_RSQL_TYPE[inputType];
|
|
1223
|
+
}
|
|
1224
|
+
return CONTROL_TYPE_TO_RSQL_TYPE[descriptor.formControlType] ?? 'string';
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
class BaseEntityQueryComponent {
|
|
1229
|
+
entityDescriptor = input.required(/* @ts-ignore */
|
|
1230
|
+
...(ngDevMode ? [{ debugName: "entityDescriptor" }] : /* istanbul ignore next */ []));
|
|
1231
|
+
queryValue = signal('', /* @ts-ignore */
|
|
1232
|
+
...(ngDevMode ? [{ debugName: "queryValue" }] : /* istanbul ignore next */ []));
|
|
1233
|
+
store;
|
|
1234
|
+
dialog = inject(MatDialog);
|
|
1235
|
+
parentInjector = inject(Injector);
|
|
1236
|
+
ngOnInit() {
|
|
1237
|
+
this.store = this.entityDescriptor().store;
|
|
1238
|
+
}
|
|
1239
|
+
onSendQuery() {
|
|
1240
|
+
const value = this.queryValue().trim();
|
|
1241
|
+
if (!value)
|
|
1242
|
+
return;
|
|
1243
|
+
this.store.load({ query: value });
|
|
1244
|
+
}
|
|
1245
|
+
onOpenEditor() {
|
|
1246
|
+
const data = { initialQuery: this.queryValue() };
|
|
1247
|
+
const fieldMetadata = new DescriptorBackedFieldMetadataProvider(this.entityDescriptor().attrDescriptors);
|
|
1248
|
+
const injector = Injector.create({
|
|
1249
|
+
providers: [{ provide: RsqlFieldMetadataProvider, useValue: fieldMetadata }],
|
|
1250
|
+
parent: this.parentInjector,
|
|
1251
|
+
});
|
|
1252
|
+
this.dialog
|
|
1253
|
+
.open(RsqlEditorDialog, { data, injector })
|
|
1254
|
+
.afterClosed()
|
|
1255
|
+
.subscribe((result) => {
|
|
1256
|
+
if (result != null)
|
|
1257
|
+
this.queryValue.set(result);
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityQueryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: BaseEntityQueryComponent, isStandalone: true, selector: "base-entity-query", inputs: { entityDescriptor: { classPropertyName: "entityDescriptor", publicName: "entityDescriptor", isSignal: true, isRequired: true, transformFunction: null } }, providers: [provideTranslocoScope({ scope: 'base_entity', alias: 'base_entity' })], ngImport: i0, template: `
|
|
1262
|
+
<ng-container *transloco="let t">
|
|
1263
|
+
<div class="query-wrapper">
|
|
1264
|
+
<label class="field-label" [attr.for]="entityDescriptor().createTestId('query-input')">{{ t('base_entity.toolbar.query_label') }}</label>
|
|
1265
|
+
<mat-form-field class="query-field" subscriptSizing="dynamic">
|
|
1266
|
+
<input
|
|
1267
|
+
[id]="entityDescriptor().createTestId('query-input')"
|
|
1268
|
+
[attr.data-testid]="entityDescriptor().createTestId('query')"
|
|
1269
|
+
matInput
|
|
1270
|
+
type="text"
|
|
1271
|
+
[(ngModel)]="queryValue"
|
|
1272
|
+
(keyup.enter)="onSendQuery()"
|
|
1273
|
+
/>
|
|
1274
|
+
<button [attr.data-testid]="entityDescriptor().createTestId('query-editor-open')" type="button" mat-icon-button matSuffix aria-label="Open advanced query editor" (click)="onOpenEditor()">
|
|
1275
|
+
<mat-icon>edit_note</mat-icon>
|
|
1276
|
+
</button>
|
|
1277
|
+
<button [attr.data-testid]="entityDescriptor().createTestId('query-send')" type="button" mat-icon-button matSuffix aria-label="Send query" [disabled]="!queryValue()" (click)="onSendQuery()">
|
|
1278
|
+
<mat-icon>play_arrow</mat-icon>
|
|
1279
|
+
</button>
|
|
1280
|
+
</mat-form-field>
|
|
1281
|
+
</div>
|
|
1282
|
+
</ng-container>
|
|
1283
|
+
`, isInline: true, styles: [".query-wrapper{display:inline-flex;align-items:center;gap:8px}.field-label{font-size:14px;white-space:nowrap}.query-field{width:320px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
|
|
1284
|
+
}
|
|
1285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityQueryComponent, decorators: [{
|
|
1286
|
+
type: Component,
|
|
1287
|
+
args: [{ selector: 'base-entity-query', standalone: true, imports: [CommonModule, FormsModule, MatFormField, MatInput, MatIcon, MatIconButton, MatSuffix, TranslocoDirective], providers: [provideTranslocoScope({ scope: 'base_entity', alias: 'base_entity' })], template: `
|
|
1288
|
+
<ng-container *transloco="let t">
|
|
1289
|
+
<div class="query-wrapper">
|
|
1290
|
+
<label class="field-label" [attr.for]="entityDescriptor().createTestId('query-input')">{{ t('base_entity.toolbar.query_label') }}</label>
|
|
1291
|
+
<mat-form-field class="query-field" subscriptSizing="dynamic">
|
|
1292
|
+
<input
|
|
1293
|
+
[id]="entityDescriptor().createTestId('query-input')"
|
|
1294
|
+
[attr.data-testid]="entityDescriptor().createTestId('query')"
|
|
1295
|
+
matInput
|
|
1296
|
+
type="text"
|
|
1297
|
+
[(ngModel)]="queryValue"
|
|
1298
|
+
(keyup.enter)="onSendQuery()"
|
|
1299
|
+
/>
|
|
1300
|
+
<button [attr.data-testid]="entityDescriptor().createTestId('query-editor-open')" type="button" mat-icon-button matSuffix aria-label="Open advanced query editor" (click)="onOpenEditor()">
|
|
1301
|
+
<mat-icon>edit_note</mat-icon>
|
|
1302
|
+
</button>
|
|
1303
|
+
<button [attr.data-testid]="entityDescriptor().createTestId('query-send')" type="button" mat-icon-button matSuffix aria-label="Send query" [disabled]="!queryValue()" (click)="onSendQuery()">
|
|
1304
|
+
<mat-icon>play_arrow</mat-icon>
|
|
1305
|
+
</button>
|
|
1306
|
+
</mat-form-field>
|
|
1307
|
+
</div>
|
|
1308
|
+
</ng-container>
|
|
1309
|
+
`, styles: [".query-wrapper{display:inline-flex;align-items:center;gap:8px}.field-label{font-size:14px;white-space:nowrap}.query-field{width:320px}\n"] }]
|
|
1310
|
+
}], propDecorators: { entityDescriptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityDescriptor", required: true }] }] } });
|
|
1311
|
+
|
|
422
1312
|
class BaseEntityToolbarComponent {
|
|
423
1313
|
entityDescriptor = input.required(/* @ts-ignore */
|
|
424
1314
|
...(ngDevMode ? [{ debugName: "entityDescriptor" }] : /* istanbul ignore next */ []));
|
|
@@ -470,11 +1360,11 @@ class BaseEntityToolbarComponent {
|
|
|
470
1360
|
// protected, private helper methods
|
|
471
1361
|
RouteSegments = RouteSegments;
|
|
472
1362
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
473
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: BaseEntityToolbarComponent, isStandalone: true, selector: "base-entity-toolbar", inputs: { entityDescriptor: { classPropertyName: "entityDescriptor", publicName: "entityDescriptor", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mat-toolbar *ngIf=\"formNavigator.activeRouteSegment() === RouteSegments.LIST_ROUTE\">\n <div class=\"dense-3\" [ngStyle]=\"{'padding-top': '12px' }\">\n
|
|
1363
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: BaseEntityToolbarComponent, isStandalone: true, selector: "base-entity-toolbar", inputs: { entityDescriptor: { classPropertyName: "entityDescriptor", publicName: "entityDescriptor", isSignal: true, isRequired: true, transformFunction: null } }, providers: [provideTranslocoScope({ scope: 'base_entity', alias: 'base_entity' })], ngImport: i0, template: "<mat-toolbar *ngIf=\"formNavigator.activeRouteSegment() === RouteSegments.LIST_ROUTE\">\n <ng-container *transloco=\"let t;\">\n <div class=\"dense-3 toolbar-inputs\" [ngStyle]=\"{'padding-top': '12px' }\">\n <base-entity-query [entityDescriptor]=\"entityDescriptor()\"></base-entity-query>\n <div class=\"filter-wrapper\">\n <label class=\"field-label\" [attr.for]=\"entityDescriptor().createTestId('filter-input')\">{{ t('base_entity.toolbar.filter_label') }}</label>\n <mat-form-field subscriptSizing=\"dynamic\">\n <input #filterInput [id]=\"entityDescriptor().createTestId('filter-input')\" [attr.data-testid]=\"entityDescriptor().createTestId('filter')\" matInput type=\"text\" (keyup)=\"onDoFilter( $event )\">\n @if (filterInput.value) {\n <button [attr.data-testid]=\"entityDescriptor().createTestId('filter-clear')\" type=\"button\" mat-icon-button matSuffix aria-label=\"Clear filter\" (click)=\"onClearFilter(filterInput)\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n <span class=\"toolbar-spacer\"></span>\n @if(isSmallDevice()) {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button test-id=\"menu-button\" mat-button [matMenuTriggerFor]=\"beforeMenu\"><mat-icon>menu</mat-icon> Choose action</button>\n <mat-menu #beforeMenu=\"matMenu\" xPosition=\"before\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-menu-item [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-menu-item [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-menu-item [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </mat-menu>\n </div>\n } @else {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-button [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-button [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-button [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </div>\n }\n</mat-toolbar>\n", styles: [".toolbar-inputs{display:flex;align-items:center;gap:40px}.filter-wrapper{display:inline-flex;align-items:center;gap:8px}.field-label{font-size:14px;white-space:nowrap}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: BaseEntityQueryComponent, selector: "base-entity-query", inputs: ["entityDescriptor"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
|
|
474
1364
|
}
|
|
475
1365
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityToolbarComponent, decorators: [{
|
|
476
1366
|
type: Component,
|
|
477
|
-
args: [{ selector: 'base-entity-toolbar', standalone: true, imports: [CommonModule, MatToolbarModule, MatIcon, MatFormField,
|
|
1367
|
+
args: [{ selector: 'base-entity-toolbar', standalone: true, imports: [CommonModule, MatToolbarModule, MatIcon, MatFormField, MatInput, MatButton, MatIconButton, MatSuffix, MatMenu, MatMenuItem, MatMenuTrigger, BaseEntityQueryComponent, TranslocoDirective], providers: [provideTranslocoScope({ scope: 'base_entity', alias: 'base_entity' })], template: "<mat-toolbar *ngIf=\"formNavigator.activeRouteSegment() === RouteSegments.LIST_ROUTE\">\n <ng-container *transloco=\"let t;\">\n <div class=\"dense-3 toolbar-inputs\" [ngStyle]=\"{'padding-top': '12px' }\">\n <base-entity-query [entityDescriptor]=\"entityDescriptor()\"></base-entity-query>\n <div class=\"filter-wrapper\">\n <label class=\"field-label\" [attr.for]=\"entityDescriptor().createTestId('filter-input')\">{{ t('base_entity.toolbar.filter_label') }}</label>\n <mat-form-field subscriptSizing=\"dynamic\">\n <input #filterInput [id]=\"entityDescriptor().createTestId('filter-input')\" [attr.data-testid]=\"entityDescriptor().createTestId('filter')\" matInput type=\"text\" (keyup)=\"onDoFilter( $event )\">\n @if (filterInput.value) {\n <button [attr.data-testid]=\"entityDescriptor().createTestId('filter-clear')\" type=\"button\" mat-icon-button matSuffix aria-label=\"Clear filter\" (click)=\"onClearFilter(filterInput)\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n <span class=\"toolbar-spacer\"></span>\n @if(isSmallDevice()) {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button test-id=\"menu-button\" mat-button [matMenuTriggerFor]=\"beforeMenu\"><mat-icon>menu</mat-icon> Choose action</button>\n <mat-menu #beforeMenu=\"matMenu\" xPosition=\"before\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-menu-item [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-menu-item [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-menu-item [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </mat-menu>\n </div>\n } @else {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-button [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-button [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-button [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </div>\n }\n</mat-toolbar>\n", styles: [".toolbar-inputs{display:flex;align-items:center;gap:40px}.filter-wrapper{display:inline-flex;align-items:center;gap:8px}.field-label{font-size:14px;white-space:nowrap}\n"] }]
|
|
478
1368
|
}], propDecorators: { entityDescriptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityDescriptor", required: true }] }] } });
|
|
479
1369
|
|
|
480
1370
|
const INITIAL_STATE = {
|
|
@@ -542,7 +1432,7 @@ class BaseEntityStatusbarComponent {
|
|
|
542
1432
|
</span>
|
|
543
1433
|
</div>
|
|
544
1434
|
</mat-toolbar>
|
|
545
|
-
`, isInline: true, styles: [".statusbar-spacer{flex:1 1 auto}.rule-summary{display:flex;align-items:center;gap:8px}.chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:12px;font-size:13px;line-height:1}.chip mat-icon{width:16px;height:16px;font-size:16px;line-height:16px}.chip.severity-error{background-color:#d32f2f26;color:#b71c1c}.chip.severity-warning{background-color:#f57c0026;color:#b26a00}.chip.severity-info{background-color:#1976d226;color:#0d47a1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1435
|
+
`, isInline: true, styles: [".statusbar-spacer{flex:1 1 auto}.rule-summary{display:flex;align-items:center;gap:8px}.chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:12px;font-size:13px;line-height:1}.chip mat-icon{width:16px;height:16px;font-size:16px;line-height:16px}.chip.severity-error{background-color:#d32f2f26;color:#b71c1c}.chip.severity-warning{background-color:#f57c0026;color:#b26a00}.chip.severity-info{background-color:#1976d226;color:#0d47a1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
546
1436
|
}
|
|
547
1437
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityStatusbarComponent, decorators: [{
|
|
548
1438
|
type: Component,
|
|
@@ -821,11 +1711,11 @@ function encodeValue(value, operator) {
|
|
|
821
1711
|
function encodeScalar(value) {
|
|
822
1712
|
if (value === null || value === undefined)
|
|
823
1713
|
return 'null';
|
|
824
|
-
if (typeof value === 'number' || typeof value === 'boolean')
|
|
1714
|
+
if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint')
|
|
825
1715
|
return String(value);
|
|
826
|
-
const asString =
|
|
1716
|
+
const asString = typeof value === 'string' ? value : JSON.stringify(value);
|
|
827
1717
|
if (/[\s,;()"'=<>!]/.test(asString)) {
|
|
828
|
-
return `"${asString.
|
|
1718
|
+
return `"${asString.replaceAll('"', String.raw `\"`)}"`;
|
|
829
1719
|
}
|
|
830
1720
|
return asString;
|
|
831
1721
|
}
|
|
@@ -869,13 +1759,27 @@ let BaseEntityRestService = class BaseEntityRestService {
|
|
|
869
1759
|
findByQuery(queryCondition) {
|
|
870
1760
|
const fullUrl = this.buildFullUrl(this.resourceUrl, queryCondition);
|
|
871
1761
|
if (fullUrl) {
|
|
872
|
-
return this.httpClient.get(fullUrl, { headers: this.headers }).pipe(map((httpResponse) => {
|
|
873
|
-
|
|
1762
|
+
return this.httpClient.get(fullUrl, { headers: this.headers, observe: 'response' }).pipe(map((httpResponse) => {
|
|
1763
|
+
if (httpResponse.status === 204 || this.isEmptyBody(httpResponse.body)) {
|
|
1764
|
+
throw new Error('The query returned no content.');
|
|
1765
|
+
}
|
|
1766
|
+
return queryCondition.page ? this.mapPagedResponse(httpResponse.body) : this.mapSimpleResponse(httpResponse.body);
|
|
874
1767
|
}));
|
|
875
1768
|
}
|
|
876
1769
|
else
|
|
877
1770
|
throw new Error('Could not determine the full url');
|
|
878
1771
|
}
|
|
1772
|
+
isEmptyBody(body) {
|
|
1773
|
+
if (body == null)
|
|
1774
|
+
return true;
|
|
1775
|
+
if (Array.isArray(body))
|
|
1776
|
+
return body.length === 0;
|
|
1777
|
+
if (typeof body === 'object')
|
|
1778
|
+
return Object.keys(body).length === 0;
|
|
1779
|
+
if (typeof body === 'string')
|
|
1780
|
+
return body.length === 0;
|
|
1781
|
+
return false;
|
|
1782
|
+
}
|
|
879
1783
|
findById(id) {
|
|
880
1784
|
const queryCondition = { pathParams: new Map([['id', id]]) };
|
|
881
1785
|
const fullUrl = this.buildFullUrl(this.resourceUrl, queryCondition);
|
|
@@ -941,6 +1845,8 @@ let BaseEntityRestService = class BaseEntityRestService {
|
|
|
941
1845
|
return buildUrl(this.baseUrl, urlOptions);
|
|
942
1846
|
}
|
|
943
1847
|
buildRsql(queryCondition) {
|
|
1848
|
+
if (queryCondition.query)
|
|
1849
|
+
return queryCondition.query;
|
|
944
1850
|
if (queryCondition.filterGroup)
|
|
945
1851
|
return toRsql(queryCondition.filterGroup);
|
|
946
1852
|
if (queryCondition.filters?.length)
|
|
@@ -980,50 +1886,6 @@ BaseEntityRestService = __decorate([
|
|
|
980
1886
|
__param(0, Inject('entityMapper'))
|
|
981
1887
|
], BaseEntityRestService);
|
|
982
1888
|
|
|
983
|
-
class BaseEntityAttrDescriptor extends AbstractAttrDescriptor {
|
|
984
|
-
description;
|
|
985
|
-
styleClass = '';
|
|
986
|
-
labelClass = '';
|
|
987
|
-
format;
|
|
988
|
-
isLinkToDetails;
|
|
989
|
-
selectables;
|
|
990
|
-
visible = true;
|
|
991
|
-
hideInTable = false;
|
|
992
|
-
isHeading;
|
|
993
|
-
placeholder;
|
|
994
|
-
lines;
|
|
995
|
-
options;
|
|
996
|
-
required = false;
|
|
997
|
-
referenceIdField = 'id';
|
|
998
|
-
_label;
|
|
999
|
-
_linkedEntityType;
|
|
1000
|
-
constructor(attrName, formControlType, label, selectables, isLinkToDetails, options) {
|
|
1001
|
-
super(attrName, formControlType);
|
|
1002
|
-
this._label = label;
|
|
1003
|
-
this.selectables = selectables;
|
|
1004
|
-
this.isLinkToDetails = isLinkToDetails;
|
|
1005
|
-
this.options = { inputType: 'text', ...options };
|
|
1006
|
-
}
|
|
1007
|
-
getSelectables() {
|
|
1008
|
-
if (this.selectables === undefined)
|
|
1009
|
-
return undefined;
|
|
1010
|
-
return typeof this.selectables === 'function' ? this.selectables() : this.selectables;
|
|
1011
|
-
}
|
|
1012
|
-
// region properties
|
|
1013
|
-
get label() {
|
|
1014
|
-
return this._label ? this._label : this.attrName;
|
|
1015
|
-
}
|
|
1016
|
-
set label(label) {
|
|
1017
|
-
this._label = label;
|
|
1018
|
-
}
|
|
1019
|
-
get linkedEntityType() {
|
|
1020
|
-
return this._linkedEntityType;
|
|
1021
|
-
}
|
|
1022
|
-
set linkedEntityType(linkedEntityType) {
|
|
1023
|
-
this._linkedEntityType = linkedEntityType;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
1889
|
class BaseFormHostDirective {
|
|
1028
1890
|
viewContainerRef;
|
|
1029
1891
|
constructor(viewContainerRef) {
|
|
@@ -1040,34 +1902,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1040
1902
|
}]
|
|
1041
1903
|
}], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
|
|
1042
1904
|
|
|
1043
|
-
var FlexDirection;
|
|
1044
|
-
(function (FlexDirection) {
|
|
1045
|
-
FlexDirection[FlexDirection["CONTAINER"] = 0] = "CONTAINER";
|
|
1046
|
-
FlexDirection[FlexDirection["COLUMN"] = 1] = "COLUMN";
|
|
1047
|
-
FlexDirection[FlexDirection["ROW"] = 2] = "ROW";
|
|
1048
|
-
})(FlexDirection || (FlexDirection = {}));
|
|
1049
|
-
class FlexboxDescriptor extends AbstractAttrDescriptor {
|
|
1050
|
-
attrDescriptors;
|
|
1051
|
-
direction;
|
|
1052
|
-
constructor(attrDescriptors, direction) {
|
|
1053
|
-
super('dummy', FormControlType.FLEX_BOX);
|
|
1054
|
-
this.attrDescriptors = attrDescriptors;
|
|
1055
|
-
this.direction = direction;
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
function filterAttributeDescriptors(descriptors) {
|
|
1060
|
-
let attrDescriptors = [];
|
|
1061
|
-
descriptors.forEach((descriptor) => {
|
|
1062
|
-
if (descriptor instanceof BaseEntityAttrDescriptor)
|
|
1063
|
-
attrDescriptors.push(descriptor);
|
|
1064
|
-
else if (descriptor instanceof FlexboxDescriptor) {
|
|
1065
|
-
attrDescriptors = attrDescriptors.concat(filterAttributeDescriptors(descriptor.attrDescriptors));
|
|
1066
|
-
}
|
|
1067
|
-
});
|
|
1068
|
-
return attrDescriptors;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
1905
|
const BASE_ENTITY_FACADE_REGISTRY = new InjectionToken('BASE_ENTITY_FACADE_REGISTRY', {
|
|
1072
1906
|
factory: () => ({}),
|
|
1073
1907
|
});
|
|
@@ -1387,7 +2221,7 @@ class ArtifactSelectorComponent {
|
|
|
1387
2221
|
<p>{{ errorMessage }}</p>
|
|
1388
2222
|
}
|
|
1389
2223
|
</div>
|
|
1390
|
-
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1
|
|
2224
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1391
2225
|
}
|
|
1392
2226
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ArtifactSelectorComponent, decorators: [{
|
|
1393
2227
|
type: Component,
|
|
@@ -1542,7 +2376,7 @@ class ArtifactComponent extends BaseFormControlComponent {
|
|
|
1542
2376
|
</div>
|
|
1543
2377
|
}
|
|
1544
2378
|
}
|
|
1545
|
-
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#
|
|
2379
|
+
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#4a0000}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#4a2b00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#051f47}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ArtifactSelectorComponent, selector: "app-artifact-selector", outputs: ["artifactUploaded"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1546
2380
|
}
|
|
1547
2381
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ArtifactComponent, decorators: [{
|
|
1548
2382
|
type: Component,
|
|
@@ -1573,7 +2407,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1573
2407
|
</div>
|
|
1574
2408
|
}
|
|
1575
2409
|
}
|
|
1576
|
-
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#
|
|
2410
|
+
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#4a0000}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#4a2b00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#051f47}\n"] }]
|
|
1577
2411
|
}] });
|
|
1578
2412
|
|
|
1579
2413
|
class LabelComponent extends BaseFormControlComponent {
|
|
@@ -1587,7 +2421,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1587
2421
|
|
|
1588
2422
|
class DatepickerComponent extends BaseFormControlComponent {
|
|
1589
2423
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1590
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DatepickerComponent, isStandalone: true, selector: "base-datepicker", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" style=\"margin-bottom: 10px\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <input matInput [id]=\"config().attrName\" [matDatepicker]=\"picker\" formControlName=\"{{ config().attrName }}\" />\n <mat-hint>MM-DD-YYYY</mat-hint>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1
|
|
2424
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DatepickerComponent, isStandalone: true, selector: "base-datepicker", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" style=\"margin-bottom: 10px\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <input matInput [id]=\"config().attrName\" [matDatepicker]=\"picker\" formControlName=\"{{ config().attrName }}\" />\n <mat-hint>MM-DD-YYYY</mat-hint>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1591
2425
|
}
|
|
1592
2426
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
1593
2427
|
type: Component,
|
|
@@ -1647,9 +2481,11 @@ class ForeignKeyComponent extends BaseFormControlComponent {
|
|
|
1647
2481
|
}
|
|
1648
2482
|
const attrName = this.linkedEntityDescriptor()?.componentIdentification() ?? '';
|
|
1649
2483
|
const componentName = attrName ? relatedEntity[attrName] : undefined;
|
|
1650
|
-
if (
|
|
1651
|
-
return
|
|
1652
|
-
|
|
2484
|
+
if (typeof componentName === 'string')
|
|
2485
|
+
return componentName;
|
|
2486
|
+
if (typeof componentName === 'number' || typeof componentName === 'boolean' || typeof componentName === 'bigint')
|
|
2487
|
+
return String(componentName);
|
|
2488
|
+
return relatedEntity.id;
|
|
1653
2489
|
}
|
|
1654
2490
|
addSelectedComponentFromNavigatorResponse() {
|
|
1655
2491
|
if (this.config().disabled) {
|
|
@@ -1724,7 +2560,7 @@ class ForeignKeyComponent extends BaseFormControlComponent {
|
|
|
1724
2560
|
<input type="hidden" [formControlName]="config().attrName" />
|
|
1725
2561
|
</div>
|
|
1726
2562
|
}
|
|
1727
|
-
`, isInline: true, styles: [".foreign-key-control{display:inline-flex;flex-direction:column;align-items:stretch}.foreign-key-field{width:100%}.foreign-key-select-row{display:flex;min-height:28px;margin-top:-18px;padding:0 12px 0 16px;justify-content:flex-start}.foreign-key-select-button{height:28px;min-width:max-content;padding:0 8px;line-height:28px;white-space:nowrap}.foreign-key-select-button mat-icon{width:18px;height:18px;margin-right:4px;font-size:18px;line-height:18px}:host .foreign-key-field .mdc-notched-outline,:host .foreign-key-field .mdc-notched-outline *{pointer-events:none}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
2563
|
+
`, isInline: true, styles: [".foreign-key-control{display:inline-flex;flex-direction:column;align-items:stretch}.foreign-key-field{width:100%}.foreign-key-select-row{display:flex;min-height:28px;margin-top:-18px;padding:0 12px 0 16px;justify-content:flex-start}.foreign-key-select-button{height:28px;min-width:max-content;padding:0 8px;line-height:28px;white-space:nowrap}.foreign-key-select-button mat-icon{width:18px;height:18px;margin-right:4px;font-size:18px;line-height:18px}:host .foreign-key-field .mdc-notched-outline,:host .foreign-key-field .mdc-notched-outline *{pointer-events:none}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1728
2564
|
}
|
|
1729
2565
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ForeignKeyComponent, decorators: [{
|
|
1730
2566
|
type: Component,
|
|
@@ -1758,7 +2594,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1758
2594
|
|
|
1759
2595
|
class TextboxComponent extends BaseFormControlComponent {
|
|
1760
2596
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1761
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: TextboxComponent, isStandalone: true, selector: "base-textbox", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <input matInput [id]=\"config().attrName\" formControlName=\"{{ config().attrName }}\" />\n </mat-form-field>\n </div>\n}\n", styles: [":host{display:block}mat-form-field{width:100%}\n"], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1
|
|
2597
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: TextboxComponent, isStandalone: true, selector: "base-textbox", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <input matInput [id]=\"config().attrName\" formControlName=\"{{ config().attrName }}\" />\n </mat-form-field>\n </div>\n}\n", styles: [":host{display:block}mat-form-field{width:100%}\n"], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1762
2598
|
}
|
|
1763
2599
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextboxComponent, decorators: [{
|
|
1764
2600
|
type: Component,
|
|
@@ -1767,7 +2603,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1767
2603
|
|
|
1768
2604
|
class DropdownComponent extends BaseFormControlComponent {
|
|
1769
2605
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1770
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DropdownComponent, isStandalone: true, selector: "base-dropdown", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <mat-select formControlName=\"{{ config().attrName }}\">\n @for (option of config().getSelectables(); track option.value) {\n <mat-option [value]=\"option.value\">{{ option.value }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
2606
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DropdownComponent, isStandalone: true, selector: "base-dropdown", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <mat-select formControlName=\"{{ config().attrName }}\">\n @for (option of config().getSelectables(); track option.value) {\n <mat-option [value]=\"option.value\">{{ option.value }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] });
|
|
1771
2607
|
}
|
|
1772
2608
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
1773
2609
|
type: Component,
|
|
@@ -1776,7 +2612,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1776
2612
|
|
|
1777
2613
|
class CheckboxComponent extends BaseFormControlComponent {
|
|
1778
2614
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1779
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CheckboxComponent, isStandalone: true, selector: "base-checkbox", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div [formGroup]=\"formGroup\" class=\"row\">\n <mat-checkbox [ngClass]=\"config().labelClass\" formControlName=\"{{ config().attrName }}\">{{ config().label }}</mat-checkbox>\n </div>\n}\n", styles: ["mat-checkbox{margin-bottom:12px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1
|
|
2615
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CheckboxComponent, isStandalone: true, selector: "base-checkbox", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div [formGroup]=\"formGroup\" class=\"row\">\n <mat-checkbox [ngClass]=\"config().labelClass\" formControlName=\"{{ config().attrName }}\">{{ config().label }}</mat-checkbox>\n </div>\n}\n", styles: ["mat-checkbox{margin-bottom:12px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1780
2616
|
}
|
|
1781
2617
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
1782
2618
|
type: Component,
|
|
@@ -1785,7 +2621,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1785
2621
|
|
|
1786
2622
|
class RadioComponent extends BaseFormControlComponent {
|
|
1787
2623
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1788
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: RadioComponent, isStandalone: true, selector: "base-radio", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n @if (config().label) {\n <label [for]=\"config().attrName\">{{ config().label }}</label>\n }\n @for (radio of config().getSelectables(); track radio.key; let i = $index) {\n <div [ngClass]=\"config().styleClass ? config().styleClass : ''\">\n <input type=\"radio\" class=\"form-check-input\" [name]=\"config().attrName\" [id]=\"config().attrName + i\" [value]=\"radio.value\" [checked]=\"radio.key === value()\" [disabled]=\"config().disabled\" />\n <label [for]=\"config().attrName\" [ngClass]=\"config().labelClass ? config().labelClass : ''\">{{ radio.value }}</label>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
2624
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: RadioComponent, isStandalone: true, selector: "base-radio", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n @if (config().label) {\n <label [for]=\"config().attrName\">{{ config().label }}</label>\n }\n @for (radio of config().getSelectables(); track radio.key; let i = $index) {\n <div [ngClass]=\"config().styleClass ? config().styleClass : ''\">\n <input type=\"radio\" class=\"form-check-input\" [name]=\"config().attrName\" [id]=\"config().attrName + i\" [value]=\"radio.value\" [checked]=\"radio.key === value()\" [disabled]=\"config().disabled\" />\n <label [for]=\"config().attrName\" [ngClass]=\"config().labelClass ? config().labelClass : ''\">{{ radio.value }}</label>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
1789
2625
|
}
|
|
1790
2626
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioComponent, decorators: [{
|
|
1791
2627
|
type: Component,
|
|
@@ -1794,7 +2630,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1794
2630
|
|
|
1795
2631
|
class TextareaComponent extends BaseFormControlComponent {
|
|
1796
2632
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1797
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: TextareaComponent, isStandalone: true, selector: "base-textarea", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field [ngClass]=\"config().styleClass\">\n <mat-label [ngClass]=\"config().labelClass\" [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <textarea matInput [id]=\"config().attrName\" formControlName=\"{{ config().attrName }}\" placeholder=\"Ex. It makes me feel...\"></textarea>\n </mat-form-field>\n </div>\n}\n", styles: [":host{display:block}.full-width{width:100%}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
2633
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: TextareaComponent, isStandalone: true, selector: "base-textarea", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field [ngClass]=\"config().styleClass\">\n <mat-label [ngClass]=\"config().labelClass\" [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <textarea matInput [id]=\"config().attrName\" formControlName=\"{{ config().attrName }}\" placeholder=\"Ex. It makes me feel...\"></textarea>\n </mat-form-field>\n </div>\n}\n", styles: [":host{display:block}.full-width{width:100%}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1798
2634
|
}
|
|
1799
2635
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1800
2636
|
type: Component,
|
|
@@ -1901,7 +2737,7 @@ class TagsComponent extends BaseFormControlComponent {
|
|
|
1901
2737
|
</mat-form-field>
|
|
1902
2738
|
</div>
|
|
1903
2739
|
}
|
|
1904
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
2740
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "component", type: MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "directive", type: MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1905
2741
|
}
|
|
1906
2742
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TagsComponent, decorators: [{
|
|
1907
2743
|
type: Component,
|
|
@@ -1950,9 +2786,11 @@ class EntityComponentRefComponent {
|
|
|
1950
2786
|
const attrName = this.componentNameAttr().attrName;
|
|
1951
2787
|
const component = this.component();
|
|
1952
2788
|
const componentName = attrName ? component[attrName] : undefined;
|
|
1953
|
-
if (
|
|
1954
|
-
return
|
|
1955
|
-
|
|
2789
|
+
if (typeof componentName === 'string')
|
|
2790
|
+
return componentName;
|
|
2791
|
+
if (typeof componentName === 'number' || typeof componentName === 'boolean' || typeof componentName === 'bigint')
|
|
2792
|
+
return String(componentName);
|
|
2793
|
+
return component.id;
|
|
1956
2794
|
}
|
|
1957
2795
|
navigateToRelated(event) {
|
|
1958
2796
|
event.preventDefault();
|
|
@@ -1983,7 +2821,7 @@ class EntityComponentRefComponent {
|
|
|
1983
2821
|
<mat-icon>cancel</mat-icon>
|
|
1984
2822
|
</button>
|
|
1985
2823
|
}
|
|
1986
|
-
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#
|
|
2824
|
+
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#4a0000}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#4a2b00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#051f47}\n"], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1987
2825
|
}
|
|
1988
2826
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityComponentRefComponent, decorators: [{
|
|
1989
2827
|
type: Component,
|
|
@@ -1994,7 +2832,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1994
2832
|
<mat-icon>cancel</mat-icon>
|
|
1995
2833
|
</button>
|
|
1996
2834
|
}
|
|
1997
|
-
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#
|
|
2835
|
+
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#4a0000}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#4a2b00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#051f47}\n"] }]
|
|
1998
2836
|
}], propDecorators: { entity: [{ type: i0.Input, args: [{ isSignal: true, alias: "entity", required: true }] }], component: [{ type: i0.Input, args: [{ isSignal: true, alias: "component", required: true }] }], componentNameAttr: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentNameAttr", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], linkedEntityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkedEntityType", required: true }] }] } });
|
|
1999
2837
|
|
|
2000
2838
|
class EntityComponentsListComponent extends BaseFormControlComponent {
|
|
@@ -2113,7 +2951,7 @@ class EntityComponentsListComponent extends BaseFormControlComponent {
|
|
|
2113
2951
|
</fieldset>
|
|
2114
2952
|
</div>
|
|
2115
2953
|
}
|
|
2116
|
-
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#
|
|
2954
|
+
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#4a0000}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#4a2b00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#051f47}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: EntityComponentRefComponent, selector: "app-entity-component-ref", inputs: ["entity", "component", "componentNameAttr", "disabled", "formGroup", "linkedEntityType"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
2117
2955
|
}
|
|
2118
2956
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityComponentsListComponent, decorators: [{
|
|
2119
2957
|
type: Component,
|
|
@@ -2145,7 +2983,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2145
2983
|
</fieldset>
|
|
2146
2984
|
</div>
|
|
2147
2985
|
}
|
|
2148
|
-
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#
|
|
2986
|
+
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#4a0000}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#4a2b00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#051f47}\n"] }]
|
|
2149
2987
|
}] });
|
|
2150
2988
|
|
|
2151
2989
|
class LookupComponent extends BaseFormControlComponent {
|
|
@@ -2194,7 +3032,13 @@ class LookupComponent extends BaseFormControlComponent {
|
|
|
2194
3032
|
});
|
|
2195
3033
|
}
|
|
2196
3034
|
selectLookupItem(selectedValue) {
|
|
2197
|
-
|
|
3035
|
+
let key = '';
|
|
3036
|
+
if (typeof selectedValue === 'string') {
|
|
3037
|
+
key = selectedValue;
|
|
3038
|
+
}
|
|
3039
|
+
else if (typeof selectedValue === 'number' || typeof selectedValue === 'boolean' || typeof selectedValue === 'bigint') {
|
|
3040
|
+
key = String(selectedValue);
|
|
3041
|
+
}
|
|
2198
3042
|
this.setLookupKey(key);
|
|
2199
3043
|
this.restoreSelectedValue();
|
|
2200
3044
|
}
|
|
@@ -2279,7 +3123,7 @@ class LookupComponent extends BaseFormControlComponent {
|
|
|
2279
3123
|
<input type="hidden" [formControlName]="config().attrName" />
|
|
2280
3124
|
</div>
|
|
2281
3125
|
}
|
|
2282
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
3126
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2$3.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$3.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }] });
|
|
2283
3127
|
}
|
|
2284
3128
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LookupComponent, decorators: [{
|
|
2285
3129
|
type: Component,
|
|
@@ -2458,10 +3302,11 @@ class BaseEntityFormComponent {
|
|
|
2458
3302
|
// endregion
|
|
2459
3303
|
// region protected, private helper methods
|
|
2460
3304
|
evaluateRules(candidate) {
|
|
2461
|
-
|
|
3305
|
+
const ruleEngine = this.ruleEngine;
|
|
3306
|
+
if (!ruleEngine || this.rules.length === 0)
|
|
2462
3307
|
return;
|
|
2463
3308
|
const target = candidate ?? { ...this.entity(), ...this.baseEntityForm.value };
|
|
2464
|
-
const results = this.rules.map((rule) =>
|
|
3309
|
+
const results = this.rules.map((rule) => ruleEngine.evaluate(target, rule));
|
|
2465
3310
|
const failing = results.filter((r) => !r.passed);
|
|
2466
3311
|
this.violations.set(failing);
|
|
2467
3312
|
this.violationsStore.setViolations(this.entityDescriptor().entityName, failing);
|
|
@@ -2494,7 +3339,7 @@ class BaseEntityFormComponent {
|
|
|
2494
3339
|
const control = this.baseEntityForm.get(field);
|
|
2495
3340
|
if (!control)
|
|
2496
3341
|
continue;
|
|
2497
|
-
const errors = { ...
|
|
3342
|
+
const errors = { ...control.errors };
|
|
2498
3343
|
delete errors['ruleViolation'];
|
|
2499
3344
|
control.setErrors(Object.keys(errors).length ? errors : null);
|
|
2500
3345
|
}
|
|
@@ -2526,11 +3371,11 @@ class BaseEntityFormComponent {
|
|
|
2526
3371
|
});
|
|
2527
3372
|
}
|
|
2528
3373
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2529
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: BaseEntityFormComponent, isStandalone: true, selector: "base-form", inputs: { entityId: { classPropertyName: "entityId", publicName: "entityId", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'outline' } }], viewQueries: [{ propertyName: "componentHost", first: true, predicate: BaseFormHostDirective, descendants: true, read: BaseFormHostDirective, static: true }], ngImport: i0, template: "<mat-card appearance=\"outlined\" class=\"dense-3\">\n <mat-card-content>\n <form [formGroup]=\"baseEntityForm\" (ngSubmit)=\"onSubmit()\" (focusout)=\"onFieldBlur()\">\n <ng-template baseFormHost></ng-template>\n </form>\n @if (violations().length > 0) {\n <ul class=\"rule-violations\" data-testid=\"rule-violations\">\n @for (violation of violations(); track violation.ruleId) {\n <li [class]=\"'rule-violation severity-' + violation.severity.toLowerCase()\">\n <mat-icon>{{ violation.severity === 'ERROR' ? 'error' : violation.severity === 'WARNING' ? 'warning' : 'info' }}</mat-icon>\n <span>{{ violation.message ?? violation.error ?? violation.ruleId }}</span>\n </li>\n }\n </ul>\n }\n </mat-card-content>\n <mat-card-actions>\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"delete\" [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-raised-button color=\"primary\" type=\"button\" [disabled]=\"isNewObject() || isAbstract()\" (click)=\"onDelete()\">Delete</button>\n @if (entityDescriptor().extraFormActionsTemplate?.(); as extraTpl) {\n <ng-container [ngTemplateOutlet]=\"extraTpl\"></ng-container>\n }\n <button id=\"submit\" [attr.data-testid]=\"entityDescriptor().createTestId('save')\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty || isAbstract() || hasErrorViolations()\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n", styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#
|
|
3374
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: BaseEntityFormComponent, isStandalone: true, selector: "base-form", inputs: { entityId: { classPropertyName: "entityId", publicName: "entityId", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'outline' } }], viewQueries: [{ propertyName: "componentHost", first: true, predicate: BaseFormHostDirective, descendants: true, read: BaseFormHostDirective, static: true }], ngImport: i0, template: "<mat-card appearance=\"outlined\" class=\"dense-3\">\n <mat-card-content>\n <form [formGroup]=\"baseEntityForm\" (ngSubmit)=\"onSubmit()\" (focusout)=\"onFieldBlur()\">\n <ng-template baseFormHost></ng-template>\n </form>\n @if (violations().length > 0) {\n <ul class=\"rule-violations\" data-testid=\"rule-violations\">\n @for (violation of violations(); track violation.ruleId) {\n <li [class]=\"'rule-violation severity-' + violation.severity.toLowerCase()\">\n <mat-icon>{{ violation.severity === 'ERROR' ? 'error' : violation.severity === 'WARNING' ? 'warning' : 'info' }}</mat-icon>\n <span>{{ violation.message ?? violation.error ?? violation.ruleId }}</span>\n </li>\n }\n </ul>\n }\n </mat-card-content>\n <mat-card-actions>\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"delete\" [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-raised-button color=\"primary\" type=\"button\" [disabled]=\"isNewObject() || isAbstract()\" (click)=\"onDelete()\">Delete</button>\n @if (entityDescriptor().extraFormActionsTemplate?.(); as extraTpl) {\n <ng-container [ngTemplateOutlet]=\"extraTpl\"></ng-container>\n }\n <button id=\"submit\" [attr.data-testid]=\"entityDescriptor().createTestId('save')\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty || isAbstract() || hasErrorViolations()\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n", styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#4a0000}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#4a2b00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#051f47}\n"], dependencies: [{ kind: "directive", type: BaseFormHostDirective, selector: "[baseFormHost]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
2530
3375
|
}
|
|
2531
3376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFormComponent, decorators: [{
|
|
2532
3377
|
type: Component,
|
|
2533
|
-
args: [{ selector: 'base-form', standalone: true, imports: [BaseFormHostDirective, NgTemplateOutlet, ReactiveFormsModule, MatCard, MatCardContent, MatCardActions, MatButton, MatIcon], providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'outline' } }], template: "<mat-card appearance=\"outlined\" class=\"dense-3\">\n <mat-card-content>\n <form [formGroup]=\"baseEntityForm\" (ngSubmit)=\"onSubmit()\" (focusout)=\"onFieldBlur()\">\n <ng-template baseFormHost></ng-template>\n </form>\n @if (violations().length > 0) {\n <ul class=\"rule-violations\" data-testid=\"rule-violations\">\n @for (violation of violations(); track violation.ruleId) {\n <li [class]=\"'rule-violation severity-' + violation.severity.toLowerCase()\">\n <mat-icon>{{ violation.severity === 'ERROR' ? 'error' : violation.severity === 'WARNING' ? 'warning' : 'info' }}</mat-icon>\n <span>{{ violation.message ?? violation.error ?? violation.ruleId }}</span>\n </li>\n }\n </ul>\n }\n </mat-card-content>\n <mat-card-actions>\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"delete\" [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-raised-button color=\"primary\" type=\"button\" [disabled]=\"isNewObject() || isAbstract()\" (click)=\"onDelete()\">Delete</button>\n @if (entityDescriptor().extraFormActionsTemplate?.(); as extraTpl) {\n <ng-container [ngTemplateOutlet]=\"extraTpl\"></ng-container>\n }\n <button id=\"submit\" [attr.data-testid]=\"entityDescriptor().createTestId('save')\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty || isAbstract() || hasErrorViolations()\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n", styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#
|
|
3378
|
+
args: [{ selector: 'base-form', standalone: true, imports: [BaseFormHostDirective, NgTemplateOutlet, ReactiveFormsModule, MatCard, MatCardContent, MatCardActions, MatButton, MatIcon], providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'outline' } }], template: "<mat-card appearance=\"outlined\" class=\"dense-3\">\n <mat-card-content>\n <form [formGroup]=\"baseEntityForm\" (ngSubmit)=\"onSubmit()\" (focusout)=\"onFieldBlur()\">\n <ng-template baseFormHost></ng-template>\n </form>\n @if (violations().length > 0) {\n <ul class=\"rule-violations\" data-testid=\"rule-violations\">\n @for (violation of violations(); track violation.ruleId) {\n <li [class]=\"'rule-violation severity-' + violation.severity.toLowerCase()\">\n <mat-icon>{{ violation.severity === 'ERROR' ? 'error' : violation.severity === 'WARNING' ? 'warning' : 'info' }}</mat-icon>\n <span>{{ violation.message ?? violation.error ?? violation.ruleId }}</span>\n </li>\n }\n </ul>\n }\n </mat-card-content>\n <mat-card-actions>\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"delete\" [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-raised-button color=\"primary\" type=\"button\" [disabled]=\"isNewObject() || isAbstract()\" (click)=\"onDelete()\">Delete</button>\n @if (entityDescriptor().extraFormActionsTemplate?.(); as extraTpl) {\n <ng-container [ngTemplateOutlet]=\"extraTpl\"></ng-container>\n }\n <button id=\"submit\" [attr.data-testid]=\"entityDescriptor().createTestId('save')\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty || isAbstract() || hasErrorViolations()\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n", styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#4a0000}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#4a2b00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#051f47}\n"] }]
|
|
2534
3379
|
}], ctorParameters: () => [], propDecorators: { entityId: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityId", required: true }] }], componentHost: [{
|
|
2535
3380
|
type: ViewChild,
|
|
2536
3381
|
args: [BaseFormHostDirective, { static: true, read: BaseFormHostDirective }]
|
|
@@ -2721,7 +3566,7 @@ class BaseEntityListComponent {
|
|
|
2721
3566
|
return this.selection.selected.length === 1;
|
|
2722
3567
|
}
|
|
2723
3568
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2724
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: BaseEntityListComponent, isStandalone: true, selector: "base-list", viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" (keydown.enter)=\"onRowClick(element)\" tabindex=\"0\" role=\"button\" *matCellDef=\"let element\">\n @if (colDescriptor.isLinkToDetails) {\n <a (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined && element[colDescriptor.attrName] !== null ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <div class=\"base-entity-list-footer\">\n @if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n }\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}.base-entity-list-actions{display:flex;gap:8px;padding-left:16px}\n"], dependencies: [{ kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "component", type: MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: SlicePipe, name: "slice" }] });
|
|
3569
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: BaseEntityListComponent, isStandalone: true, selector: "base-list", viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" (keydown.enter)=\"onRowClick(element)\" tabindex=\"0\" role=\"button\" *matCellDef=\"let element\">\n @if (colDescriptor.isLinkToDetails) {\n <a class=\"link-to-details\" (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined && element[colDescriptor.attrName] !== null ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <div class=\"base-entity-list-footer\">\n @if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n }\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:initial;flex:0 0 48px;width:48px;max-width:48px}.link-to-details{text-decoration:underline;cursor:pointer}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}.base-entity-list-actions{display:flex;gap:8px;padding-left:16px}\n"], dependencies: [{ kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "component", type: MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: SlicePipe, name: "slice" }] });
|
|
2725
3570
|
}
|
|
2726
3571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityListComponent, decorators: [{
|
|
2727
3572
|
type: Component,
|
|
@@ -2743,7 +3588,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2743
3588
|
MatCheckbox,
|
|
2744
3589
|
SlicePipe,
|
|
2745
3590
|
MatButton,
|
|
2746
|
-
], template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" (keydown.enter)=\"onRowClick(element)\" tabindex=\"0\" role=\"button\" *matCellDef=\"let element\">\n @if (colDescriptor.isLinkToDetails) {\n <a (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined && element[colDescriptor.attrName] !== null ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <div class=\"base-entity-list-footer\">\n @if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n }\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}.base-entity-list-actions{display:flex;gap:8px;padding-left:16px}\n"] }]
|
|
3591
|
+
], template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" (keydown.enter)=\"onRowClick(element)\" tabindex=\"0\" role=\"button\" *matCellDef=\"let element\">\n @if (colDescriptor.isLinkToDetails) {\n <a class=\"link-to-details\" (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined && element[colDescriptor.attrName] !== null ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <div class=\"base-entity-list-footer\">\n @if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n }\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:initial;flex:0 0 48px;width:48px;max-width:48px}.link-to-details{text-decoration:underline;cursor:pointer}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}.base-entity-list-actions{display:flex;gap:8px;padding-left:16px}\n"] }]
|
|
2747
3592
|
}], ctorParameters: () => [], propDecorators: { sort: [{
|
|
2748
3593
|
type: ViewChild,
|
|
2749
3594
|
args: [MatSort]
|
|
@@ -3047,13 +3892,8 @@ function BaseEntityTabsStore() {
|
|
|
3047
3892
|
patchState(store, { activeTabs, currentTab: undefined });
|
|
3048
3893
|
}
|
|
3049
3894
|
function tabIsActive(tabName) {
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
activeTabs = store.activeTabs().concat([tabName]);
|
|
3053
|
-
}
|
|
3054
|
-
else {
|
|
3055
|
-
activeTabs = store.activeTabs();
|
|
3056
|
-
}
|
|
3895
|
+
const current = store.activeTabs();
|
|
3896
|
+
const activeTabs = current.includes(tabName) ? current : current.concat([tabName]);
|
|
3057
3897
|
patchState(store, { activeTabs, currentTab: tabName });
|
|
3058
3898
|
}
|
|
3059
3899
|
function tabIsInactive(tabName) {
|