cmat 0.0.82 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/cmat-components-adapter.mjs +19 -13
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +20 -20
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +7 -5
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +3 -2
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +228 -108
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +20 -11
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +0 -2
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +1 -1
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +29 -11
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +16 -26
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +8 -7
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +3 -3
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +28 -16
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +1 -0
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +2 -2
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +8 -5
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +2 -2
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +9 -2
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +1 -1
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +25 -24
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +42 -15
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +3 -1
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +24 -5
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +20 -13
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +11 -6
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +4 -3
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +29 -15
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs +2 -2
- package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +12 -18
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +3 -2
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +7 -7
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +9 -5
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +9 -1
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +16 -7
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +11 -10
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +42 -4
- package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +2 -2
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +78 -57
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat-validators.mjs +4 -1
- package/fesm2022/cmat-validators.mjs.map +1 -1
- package/fesm2022/cmat.mjs +746 -426
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +1 -1
- package/types/cmat-components-adapter.d.ts +24 -24
- package/types/cmat-components-breadcrumb.d.ts +1 -1
- package/types/cmat-components-card.d.ts +1 -1
- package/types/cmat-components-carousel.d.ts +23 -23
- package/types/cmat-components-cascade.d.ts +12 -12
- package/types/cmat-components-chip-input.d.ts +8 -8
- package/types/cmat-components-code-editor.d.ts +2 -2
- package/types/cmat-components-custom-formly.d.ts +121 -44
- package/types/cmat-components-date-range.d.ts +31 -16
- package/types/cmat-components-drawer.d.ts +2 -3
- package/types/cmat-components-file-preview.d.ts +1 -1
- package/types/cmat-components-image-viewer.d.ts +5 -3
- package/types/cmat-components-json-editor.d.ts +7 -9
- package/types/cmat-components-knob-input.d.ts +3 -3
- package/types/cmat-components-masonry.d.ts +3 -3
- package/types/cmat-components-material-color-picker.d.ts +13 -9
- package/types/cmat-components-material-datetimepicker.d.ts +26 -10
- package/types/cmat-components-navigation.d.ts +1 -1
- package/types/cmat-components-opt-input.d.ts +8 -8
- package/types/cmat-components-popover.d.ts +1 -1
- package/types/cmat-components-qrcode.d.ts +2 -1
- package/types/cmat-components-rating.d.ts +13 -13
- package/types/cmat-components-select-search.d.ts +5 -5
- package/types/cmat-components-select-table.d.ts +12 -8
- package/types/cmat-components-select-tree.d.ts +1 -1
- package/types/cmat-components-speed-dial.d.ts +3 -0
- package/types/cmat-components-timeline.d.ts +2 -2
- package/types/cmat-components-toast.d.ts +2 -2
- package/types/cmat-components-transfer-picker.d.ts +5 -4
- package/types/cmat-components-treetable.d.ts +2 -2
- package/types/cmat-components-upload.d.ts +36 -29
- package/types/cmat-components-x6-angular-shape.d.ts +1 -1
- package/types/cmat-directives-autofocus.d.ts +1 -1
- package/types/cmat-directives-data-exporter.d.ts +3 -2
- package/types/cmat-directives-debounce.d.ts +5 -5
- package/types/cmat-directives-digit-only.d.ts +7 -7
- package/types/cmat-directives-seamless-auto-scroll.d.ts +2 -2
- package/types/cmat-lib-mock-api.d.ts +1 -1
- package/types/cmat-pipes-find-by-key.d.ts +2 -1
- package/types/cmat-pipes-group-by.d.ts +7 -1
- package/types/cmat-pipes-keys.d.ts +4 -1
- package/types/cmat-pipes-secure.d.ts +1 -0
- package/types/cmat-services-alert.d.ts +14 -13
- package/types/cmat-services-data.d.ts +3 -3
- package/types/cmat-services-export-as.d.ts +4 -3
- package/types/cmat-services-local-storage.d.ts +14 -2
- package/types/cmat-services-translation.d.ts +3 -3
- package/types/cmat-services-utils.d.ts +31 -15
- package/types/cmat-validators.d.ts +1 -1
- package/types/cmat.d.ts +465 -303
package/fesm2022/cmat.mjs
CHANGED
|
@@ -34,7 +34,7 @@ import { PortalModule, TemplatePortal, ComponentPortal } from '@angular/cdk/port
|
|
|
34
34
|
import { MatFormFieldControl, MatFormFieldModule, MatFormField } from '@angular/material/form-field';
|
|
35
35
|
import * as i1$3 from '@angular/material/input';
|
|
36
36
|
import { MatInputModule, MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';
|
|
37
|
-
import { Subject, startWith, debounceTime, map as map$1, ReplaySubject, of, take, Subscription, merge, combineLatest, fromEvent, forkJoin,
|
|
37
|
+
import { Subject, startWith, debounceTime, map as map$1, ReplaySubject, of, take, Subscription, Observable, merge, combineLatest, fromEvent, forkJoin, catchError, tap as tap$1, EMPTY, finalize, throwError } from 'rxjs';
|
|
38
38
|
import { ENTER, COMMA as COMMA$1, hasModifierKey } from '@angular/cdk/keycodes';
|
|
39
39
|
import * as i3 from '@angular/material/autocomplete';
|
|
40
40
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
@@ -84,7 +84,7 @@ import { CmatUploadQueueComponent as CmatUploadQueueComponent$1, CmatFilesUtilSe
|
|
|
84
84
|
import BlotFormatter from '@enzedonline/quill-blot-formatter2';
|
|
85
85
|
import { CmatUrlStateConfigService as CmatUrlStateConfigService$1, CmatConfigService as CmatConfigService$1 } from 'cmat/services/config';
|
|
86
86
|
import { CmatUtilsService as CmatUtilsService$1 } from 'cmat/services/utils';
|
|
87
|
-
import { Document, Packer, Paragraph, AlignmentType, TextRun, BorderStyle, HeadingLevel, ImageRun } from 'docx';
|
|
87
|
+
import { Document, Packer, Paragraph, AlignmentType, TextRun, BorderStyle, HeadingLevel, ImageRun, HighlightColor } from 'docx';
|
|
88
88
|
import * as FileSaver from 'file-saver-es';
|
|
89
89
|
import { saveAs } from 'file-saver-es';
|
|
90
90
|
import * as i2$5 from 'ngx-quill';
|
|
@@ -262,7 +262,7 @@ const CMAT_DATETIME_FORMATS = new InjectionToken('cmat-datetime-formats');
|
|
|
262
262
|
const DEFAULT_HOUR_NAMES = range$2(24, i => String(i));
|
|
263
263
|
const DEFAULT_MINUTE_NAMES = range$2(60, i => String(i));
|
|
264
264
|
function range$2(length, valueFunction) {
|
|
265
|
-
const valuesArray = Array(length);
|
|
265
|
+
const valuesArray = new Array(length);
|
|
266
266
|
for (let i = 0; i < length; i++) {
|
|
267
267
|
valuesArray[i] = valueFunction(i);
|
|
268
268
|
}
|
|
@@ -374,13 +374,13 @@ const CMAT_NATIVE_DATETIME_FORMATS = {
|
|
|
374
374
|
yearInput: { year: 'numeric' },
|
|
375
375
|
monthYearLabel: { year: 'numeric', month: 'short' },
|
|
376
376
|
dateA11yLabel: { year: 'numeric', month: 'long', day: 'numeric' },
|
|
377
|
-
monthYearA11yLabel:
|
|
378
|
-
popupHeaderDateLabel:
|
|
377
|
+
monthYearA11yLabel: 'MMMM yyyy',
|
|
378
|
+
popupHeaderDateLabel: 'EEE, MMM dd'
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
381
|
|
|
382
382
|
function range$1(length, valueFunction) {
|
|
383
|
-
const valuesArray = Array(length);
|
|
383
|
+
const valuesArray = new Array(length);
|
|
384
384
|
for (let i = 0; i < length; i++) {
|
|
385
385
|
valuesArray[i] = valueFunction(i);
|
|
386
386
|
}
|
|
@@ -390,8 +390,9 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
390
390
|
constructor() {
|
|
391
391
|
const matDateLocale = inject(MAT_DATE_LOCALE, { optional: true });
|
|
392
392
|
const _delegate = inject(DateAdapter);
|
|
393
|
+
const locale = typeof matDateLocale === 'string' ? matDateLocale : dayjs.locale();
|
|
393
394
|
super(_delegate);
|
|
394
|
-
this.setLocale(
|
|
395
|
+
this.setLocale(locale);
|
|
395
396
|
dayjs.extend(localeData);
|
|
396
397
|
}
|
|
397
398
|
setLocale(locale) {
|
|
@@ -498,7 +499,7 @@ function CMAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY() {
|
|
|
498
499
|
};
|
|
499
500
|
}
|
|
500
501
|
function range(length, valueFunction) {
|
|
501
|
-
const valuesArray = Array(length);
|
|
502
|
+
const valuesArray = new Array(length);
|
|
502
503
|
for (let i = 0; i < length; i++) {
|
|
503
504
|
valuesArray[i] = valueFunction(i);
|
|
504
505
|
}
|
|
@@ -509,7 +510,7 @@ class DayjsDateAdapter extends DateAdapter {
|
|
|
509
510
|
super();
|
|
510
511
|
this._options = inject(CMAT_DAYJS_DATE_ADAPTER_OPTIONS, { optional: true });
|
|
511
512
|
const dateLocale = inject(MAT_DATE_LOCALE, { optional: true });
|
|
512
|
-
this._initializeParser(dateLocale);
|
|
513
|
+
this._initializeParser(dateLocale ?? undefined);
|
|
513
514
|
}
|
|
514
515
|
get _shouldUseUtc() {
|
|
515
516
|
const { useUtc } = this._options ?? {};
|
|
@@ -578,10 +579,14 @@ class DayjsDateAdapter extends DateAdapter {
|
|
|
578
579
|
return this._dayJs();
|
|
579
580
|
}
|
|
580
581
|
parse(value, parseFormat) {
|
|
582
|
+
const locale = this.locale;
|
|
581
583
|
if (value && typeof value === 'string') {
|
|
582
|
-
return this._dayJs(value, parseFormat,
|
|
584
|
+
return this._dayJs(value, parseFormat, locale);
|
|
583
585
|
}
|
|
584
|
-
|
|
586
|
+
if (value instanceof Date || dayjs.isDayjs(value)) {
|
|
587
|
+
return this._dayJs(value).locale(locale);
|
|
588
|
+
}
|
|
589
|
+
return null;
|
|
585
590
|
}
|
|
586
591
|
format(date, displayFormat) {
|
|
587
592
|
if (!this.isValid(date)) {
|
|
@@ -613,7 +618,7 @@ class DayjsDateAdapter extends DateAdapter {
|
|
|
613
618
|
if (!value) {
|
|
614
619
|
return null;
|
|
615
620
|
}
|
|
616
|
-
date = this._dayJs(value)
|
|
621
|
+
date = this._dayJs(value);
|
|
617
622
|
}
|
|
618
623
|
if (date && this.isValid(date)) {
|
|
619
624
|
return this._dayJs(date); // NOTE: Is this necessary since Dayjs is immutable and Moment was not?
|
|
@@ -631,9 +636,10 @@ class DayjsDateAdapter extends DateAdapter {
|
|
|
631
636
|
}
|
|
632
637
|
_dayJs(input, format, locale) {
|
|
633
638
|
if (!this._shouldUseUtc) {
|
|
634
|
-
return dayjs(input,
|
|
639
|
+
return dayjs(input, format, locale);
|
|
635
640
|
}
|
|
636
|
-
|
|
641
|
+
const utcDate = format ? dayjs.utc(input, format) : dayjs.utc(input);
|
|
642
|
+
return locale ? utcDate.locale(locale) : utcDate;
|
|
637
643
|
}
|
|
638
644
|
_initializeParser(dateLocale) {
|
|
639
645
|
if (this._shouldUseUtc) {
|
|
@@ -642,7 +648,7 @@ class DayjsDateAdapter extends DateAdapter {
|
|
|
642
648
|
dayjs.extend(LocalizedFormat);
|
|
643
649
|
dayjs.extend(customParseFormat);
|
|
644
650
|
dayjs.extend(localeData);
|
|
645
|
-
this.setLocale(dateLocale);
|
|
651
|
+
this.setLocale(dateLocale ?? dayjs.locale());
|
|
646
652
|
}
|
|
647
653
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DayjsDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
648
654
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DayjsDateAdapter }); }
|
|
@@ -1103,7 +1109,7 @@ class CmatCarouselComponent {
|
|
|
1103
1109
|
this._numVisible = val;
|
|
1104
1110
|
}
|
|
1105
1111
|
get numScroll() {
|
|
1106
|
-
return this.
|
|
1112
|
+
return this._numScroll;
|
|
1107
1113
|
}
|
|
1108
1114
|
set numScroll(val) {
|
|
1109
1115
|
this._numScroll = val;
|
|
@@ -1239,7 +1245,7 @@ class CmatCarouselComponent {
|
|
|
1239
1245
|
let page = this._page;
|
|
1240
1246
|
if (this.totalDots() !== 0 && page >= this.totalDots()) {
|
|
1241
1247
|
page = this.totalDots() - 1;
|
|
1242
|
-
this._page = page;
|
|
1248
|
+
this._page = page ?? 0;
|
|
1243
1249
|
this.pageEvent.emit({
|
|
1244
1250
|
page: this.page
|
|
1245
1251
|
});
|
|
@@ -1464,7 +1470,7 @@ class CmatCarouselComponent {
|
|
|
1464
1470
|
}
|
|
1465
1471
|
}
|
|
1466
1472
|
_onRightKey() {
|
|
1467
|
-
const indicators = [...Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]'))];
|
|
1473
|
+
const indicators = [...Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? [])];
|
|
1468
1474
|
const activeIndex = this._findFocusedIndicatorIndex();
|
|
1469
1475
|
this._changedFocusedIndicator(activeIndex, activeIndex + 1 === indicators.length ? indicators.length - 1 : activeIndex + 1);
|
|
1470
1476
|
}
|
|
@@ -1477,23 +1483,23 @@ class CmatCarouselComponent {
|
|
|
1477
1483
|
this._changedFocusedIndicator(activeIndex, 0);
|
|
1478
1484
|
}
|
|
1479
1485
|
_onEndKey() {
|
|
1480
|
-
const indicators = [...Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]'))];
|
|
1486
|
+
const indicators = [...Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? [])];
|
|
1481
1487
|
const activeIndex = this._findFocusedIndicatorIndex();
|
|
1482
1488
|
this._changedFocusedIndicator(activeIndex, indicators.length - 1);
|
|
1483
1489
|
}
|
|
1484
1490
|
_onTabKey() {
|
|
1485
|
-
const indicators =
|
|
1486
|
-
const highlightedIndex = indicators.findIndex(ind => ind.getAttribute('cmat-carousel-highlight')
|
|
1491
|
+
const indicators = Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? []);
|
|
1492
|
+
const highlightedIndex = indicators.findIndex((ind) => ind.getAttribute('cmat-carousel-highlight') !== undefined);
|
|
1487
1493
|
const activeIndicator = this.indicatorContent?.nativeElement ? this.indicatorContent?.nativeElement.querySelector('[data-pc-section="indicator"] > button[tabindex="0"]') : null;
|
|
1488
|
-
const activeIndex = indicators.findIndex(ind => ind === activeIndicator
|
|
1489
|
-
indicators[activeIndex].children[0].tabIndex =
|
|
1490
|
-
indicators[highlightedIndex].children[0].tabIndex =
|
|
1494
|
+
const activeIndex = indicators.findIndex((ind) => ind === activeIndicator?.parentElement);
|
|
1495
|
+
indicators[activeIndex]?.children[0] && (indicators[activeIndex].children[0].tabIndex = -1);
|
|
1496
|
+
indicators[highlightedIndex]?.children[0] && (indicators[highlightedIndex].children[0].tabIndex = 0);
|
|
1491
1497
|
}
|
|
1492
1498
|
_changedFocusedIndicator(prevInd, nextInd) {
|
|
1493
|
-
const indicators =
|
|
1494
|
-
indicators[prevInd].children[0].tabIndex =
|
|
1495
|
-
indicators[nextInd].children[0].tabIndex =
|
|
1496
|
-
indicators[nextInd]
|
|
1499
|
+
const indicators = Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? []);
|
|
1500
|
+
indicators[prevInd]?.children[0] && (indicators[prevInd].children[0].tabIndex = -1);
|
|
1501
|
+
indicators[nextInd]?.children[0] && (indicators[nextInd].children[0].tabIndex = 0);
|
|
1502
|
+
indicators[nextInd]?.children[0]?.focus();
|
|
1497
1503
|
}
|
|
1498
1504
|
_step(dir, page) {
|
|
1499
1505
|
let totalShiftedItems = this.totalShiftedItems;
|
|
@@ -1531,7 +1537,7 @@ class CmatCarouselComponent {
|
|
|
1531
1537
|
this.itemsContainer.nativeElement.style.transition = 'transform 500ms ease 0s';
|
|
1532
1538
|
}
|
|
1533
1539
|
this.totalShiftedItems = totalShiftedItems;
|
|
1534
|
-
this._page = page;
|
|
1540
|
+
this._page = page ?? 0;
|
|
1535
1541
|
this.pageEvent.emit({
|
|
1536
1542
|
page: this.page
|
|
1537
1543
|
});
|
|
@@ -1566,9 +1572,9 @@ class CmatCarouselComponent {
|
|
|
1566
1572
|
this.refreshVersion.update(value => value + 1);
|
|
1567
1573
|
}
|
|
1568
1574
|
_findFocusedIndicatorIndex() {
|
|
1569
|
-
const indicators =
|
|
1575
|
+
const indicators = Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? []);
|
|
1570
1576
|
const activeIndicator = this.indicatorContent?.nativeElement ? this.indicatorContent?.nativeElement.querySelector('[data-pc-section="indicator"] > button[tabindex="0"]') : null;
|
|
1571
|
-
return indicators.findIndex(ind => ind === activeIndicator
|
|
1577
|
+
return indicators.findIndex((ind) => ind === activeIndicator?.parentElement);
|
|
1572
1578
|
}
|
|
1573
1579
|
_createStyle() {
|
|
1574
1580
|
if (!this.carouselStyle) {
|
|
@@ -1585,11 +1591,11 @@ class CmatCarouselComponent {
|
|
|
1585
1591
|
const value1 = data1.breakpoint;
|
|
1586
1592
|
const value2 = data2.breakpoint;
|
|
1587
1593
|
let result;
|
|
1588
|
-
if (value1
|
|
1594
|
+
if (value1 === null && value2 !== null)
|
|
1589
1595
|
result = -1;
|
|
1590
|
-
else if (value1
|
|
1596
|
+
else if (value1 !== null && value2 === null)
|
|
1591
1597
|
result = 1;
|
|
1592
|
-
else if (value1
|
|
1598
|
+
else if (value1 === null && value2 === null)
|
|
1593
1599
|
result = 0;
|
|
1594
1600
|
else if (typeof value1 === 'string' && typeof value2 === 'string')
|
|
1595
1601
|
result = value1.localeCompare(value2, undefined, { numeric: true });
|
|
@@ -1608,7 +1614,7 @@ class CmatCarouselComponent {
|
|
|
1608
1614
|
}
|
|
1609
1615
|
}
|
|
1610
1616
|
if (this.carouselStyle) {
|
|
1611
|
-
this.carouselStyle
|
|
1617
|
+
this.renderer.setProperty(this.carouselStyle, 'textContent', innerHTML);
|
|
1612
1618
|
}
|
|
1613
1619
|
}
|
|
1614
1620
|
_calculatePosition() {
|
|
@@ -1765,11 +1771,11 @@ class CmatCascadeBottomSheetComponent {
|
|
|
1765
1771
|
}
|
|
1766
1772
|
}
|
|
1767
1773
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatCascadeBottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1768
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatCascadeBottomSheetComponent, isStandalone: true, selector: "cmat-cascade-bottom-sheet", exportAs: ["cmatCascadeBottomSheet"], ngImport: i0, template: "<div role=\"presentation\" class=\"cmat-cascade-bottom-sheet\" (click)=\"clickHandle($event)\">\r\n <div class=\"sheet-header flex items-center\">\r\n <p class=\"sheet-title\">{{root.placeholder}}</p>\r\n <button type=\"button\" matIconButton (click)=\"root.bottomSheetRef.dismiss()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-tab-group [selectedIndex]=\"selected.value\" (selectedIndexChange)=\"selected.setValue($event);\">\r\n @for (menuItem of root.steps; track step; let step = $index) {\r\n <mat-tab\r\n [label]=\"labels[step] || '\u9009\u62E9'\">\r\n <mat-list class=\"menu-list overflow-y-auto scrollbar-custom\">\r\n @for (listItem of menuItem; track i; let i = $index) {\r\n <mat-list-item class=\"menu-item\"\r\n [class.active]=\"listItem.active\" [class.disabled]=\"listItem.disabled\"\r\n (click)=\"root.selectHandle($event, step, i); select(listItem.disabled,listItem.label);\">\r\n <div matLine>{{listItem.label}}</div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n</div>", styles: [".cmat-cascade-bottom-sheet{padding:0;margin:-8px -16px}.cmat-cascade-bottom-sheet .sheet-header{display:flex;flex:1 1 0%;align-items:center;font-size:1rem;border-bottom-width:1px;padding:12px 16px}.cmat-cascade-bottom-sheet .sheet-header .sheet-title{margin:0;padding:0;letter-spacing:.05rem;text-align:center;flex-grow:1}.cmat-cascade-bottom-sheet .menu-list{vertical-align:top;box-sizing:border-box;margin:0;padding:0;width:100%;overflow:hidden;position:relative;height:204px}.cmat-cascade-bottom-sheet .menu-item{padding:0 16px;text-overflow:ellipsis;box-sizing:border-box;cursor:pointer!important;font-size:14px;line-height:3em}.cmat-cascade-bottom-sheet .menu-item.disabled{cursor:not-allowed!important;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$1.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i2$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1774
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatCascadeBottomSheetComponent, isStandalone: true, selector: "cmat-cascade-bottom-sheet", exportAs: ["cmatCascadeBottomSheet"], ngImport: i0, template: "<div role=\"presentation\" class=\"cmat-cascade-bottom-sheet\" (click)=\"clickHandle($event)\">\r\n <div class=\"sheet-header flex items-center\">\r\n <p class=\"sheet-title\">{{root.placeholder}}</p>\r\n <button type=\"button\" matIconButton (click)=\"root.bottomSheetRef.dismiss()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-tab-group [selectedIndex]=\"selected.value\" (selectedIndexChange)=\"selected.setValue($event);\">\r\n @for (menuItem of root.steps; track step; let step = $index) {\r\n <mat-tab\r\n [label]=\"labels[step] || '\u9009\u62E9'\">\r\n <mat-list class=\"menu-list overflow-y-auto scrollbar-custom\">\r\n @for (listItem of menuItem; track i; let i = $index) {\r\n <mat-list-item class=\"menu-item\"\r\n [class.active]=\"listItem.active\" [class.disabled]=\"listItem.disabled\"\r\n (click)=\"root.selectHandle($event, step, i); select(listItem.disabled ?? false, listItem.label ?? '');\">\r\n <div matLine>{{listItem.label}}</div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n</div>", styles: [".cmat-cascade-bottom-sheet{padding:0;margin:-8px -16px}.cmat-cascade-bottom-sheet .sheet-header{display:flex;flex:1 1 0%;align-items:center;font-size:1rem;border-bottom-width:1px;padding:12px 16px}.cmat-cascade-bottom-sheet .sheet-header .sheet-title{margin:0;padding:0;letter-spacing:.05rem;text-align:center;flex-grow:1}.cmat-cascade-bottom-sheet .menu-list{vertical-align:top;box-sizing:border-box;margin:0;padding:0;width:100%;overflow:hidden;position:relative;height:204px}.cmat-cascade-bottom-sheet .menu-item{padding:0 16px;text-overflow:ellipsis;box-sizing:border-box;cursor:pointer!important;font-size:14px;line-height:3em}.cmat-cascade-bottom-sheet .menu-item.disabled{cursor:not-allowed!important;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$1.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i2$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1769
1775
|
}
|
|
1770
1776
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatCascadeBottomSheetComponent, decorators: [{
|
|
1771
1777
|
type: Component,
|
|
1772
|
-
args: [{ selector: 'cmat-cascade-bottom-sheet', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatCascadeBottomSheet', imports: [MatButtonModule, MatTabsModule, MatListModule, MatIconModule], template: "<div role=\"presentation\" class=\"cmat-cascade-bottom-sheet\" (click)=\"clickHandle($event)\">\r\n <div class=\"sheet-header flex items-center\">\r\n <p class=\"sheet-title\">{{root.placeholder}}</p>\r\n <button type=\"button\" matIconButton (click)=\"root.bottomSheetRef.dismiss()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-tab-group [selectedIndex]=\"selected.value\" (selectedIndexChange)=\"selected.setValue($event);\">\r\n @for (menuItem of root.steps; track step; let step = $index) {\r\n <mat-tab\r\n [label]=\"labels[step] || '\u9009\u62E9'\">\r\n <mat-list class=\"menu-list overflow-y-auto scrollbar-custom\">\r\n @for (listItem of menuItem; track i; let i = $index) {\r\n <mat-list-item class=\"menu-item\"\r\n [class.active]=\"listItem.active\" [class.disabled]=\"listItem.disabled\"\r\n (click)=\"root.selectHandle($event, step, i); select(listItem.disabled,listItem.label);\">\r\n <div matLine>{{listItem.label}}</div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n</div>", styles: [".cmat-cascade-bottom-sheet{padding:0;margin:-8px -16px}.cmat-cascade-bottom-sheet .sheet-header{display:flex;flex:1 1 0%;align-items:center;font-size:1rem;border-bottom-width:1px;padding:12px 16px}.cmat-cascade-bottom-sheet .sheet-header .sheet-title{margin:0;padding:0;letter-spacing:.05rem;text-align:center;flex-grow:1}.cmat-cascade-bottom-sheet .menu-list{vertical-align:top;box-sizing:border-box;margin:0;padding:0;width:100%;overflow:hidden;position:relative;height:204px}.cmat-cascade-bottom-sheet .menu-item{padding:0 16px;text-overflow:ellipsis;box-sizing:border-box;cursor:pointer!important;font-size:14px;line-height:3em}.cmat-cascade-bottom-sheet .menu-item.disabled{cursor:not-allowed!important;pointer-events:none}\n"] }]
|
|
1778
|
+
args: [{ selector: 'cmat-cascade-bottom-sheet', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatCascadeBottomSheet', imports: [MatButtonModule, MatTabsModule, MatListModule, MatIconModule], template: "<div role=\"presentation\" class=\"cmat-cascade-bottom-sheet\" (click)=\"clickHandle($event)\">\r\n <div class=\"sheet-header flex items-center\">\r\n <p class=\"sheet-title\">{{root.placeholder}}</p>\r\n <button type=\"button\" matIconButton (click)=\"root.bottomSheetRef.dismiss()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-tab-group [selectedIndex]=\"selected.value\" (selectedIndexChange)=\"selected.setValue($event);\">\r\n @for (menuItem of root.steps; track step; let step = $index) {\r\n <mat-tab\r\n [label]=\"labels[step] || '\u9009\u62E9'\">\r\n <mat-list class=\"menu-list overflow-y-auto scrollbar-custom\">\r\n @for (listItem of menuItem; track i; let i = $index) {\r\n <mat-list-item class=\"menu-item\"\r\n [class.active]=\"listItem.active\" [class.disabled]=\"listItem.disabled\"\r\n (click)=\"root.selectHandle($event, step, i); select(listItem.disabled ?? false, listItem.label ?? '');\">\r\n <div matLine>{{listItem.label}}</div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n</div>", styles: [".cmat-cascade-bottom-sheet{padding:0;margin:-8px -16px}.cmat-cascade-bottom-sheet .sheet-header{display:flex;flex:1 1 0%;align-items:center;font-size:1rem;border-bottom-width:1px;padding:12px 16px}.cmat-cascade-bottom-sheet .sheet-header .sheet-title{margin:0;padding:0;letter-spacing:.05rem;text-align:center;flex-grow:1}.cmat-cascade-bottom-sheet .menu-list{vertical-align:top;box-sizing:border-box;margin:0;padding:0;width:100%;overflow:hidden;position:relative;height:204px}.cmat-cascade-bottom-sheet .menu-item{padding:0 16px;text-overflow:ellipsis;box-sizing:border-box;cursor:pointer!important;font-size:14px;line-height:3em}.cmat-cascade-bottom-sheet .menu-item.disabled{cursor:not-allowed!important;pointer-events:none}\n"] }]
|
|
1773
1779
|
}], ctorParameters: () => [] });
|
|
1774
1780
|
|
|
1775
1781
|
class CmatCascadeMenuComponent {
|
|
@@ -2000,7 +2006,8 @@ class CmatCascadeListComponent {
|
|
|
2000
2006
|
...item,
|
|
2001
2007
|
active: false
|
|
2002
2008
|
}));
|
|
2003
|
-
|
|
2009
|
+
this.steps.push(nativeNext);
|
|
2010
|
+
return;
|
|
2004
2011
|
}
|
|
2005
2012
|
this._changeLabels();
|
|
2006
2013
|
if (this.overlayRef?.hasAttached()) {
|
|
@@ -2027,7 +2034,8 @@ class CmatCascadeListComponent {
|
|
|
2027
2034
|
_initSteps(index, options) {
|
|
2028
2035
|
const step = [];
|
|
2029
2036
|
options.map((item) => {
|
|
2030
|
-
if (this.value[index]
|
|
2037
|
+
if (this.value?.[index] &&
|
|
2038
|
+
(this.value[index].value === item.value || (this.allowLabelValue && this.value[index].label === item.label))) {
|
|
2031
2039
|
if (!isUndefined(item.children))
|
|
2032
2040
|
options = item.children;
|
|
2033
2041
|
step.push(({
|
|
@@ -2041,7 +2049,7 @@ class CmatCascadeListComponent {
|
|
|
2041
2049
|
});
|
|
2042
2050
|
this.steps.push(step);
|
|
2043
2051
|
index += 1;
|
|
2044
|
-
if (index < this.value.length) {
|
|
2052
|
+
if (this.value && index < this.value.length) {
|
|
2045
2053
|
this._initSteps(index, options);
|
|
2046
2054
|
}
|
|
2047
2055
|
}
|
|
@@ -2386,6 +2394,7 @@ class CmatCodeEditorComponent {
|
|
|
2386
2394
|
get editorOptions() {
|
|
2387
2395
|
return {
|
|
2388
2396
|
...this.options,
|
|
2397
|
+
readOnly: this.readOnly,
|
|
2389
2398
|
theme: this.options?.theme ?? (this._isDarkTheme ? 'vs-dark' : 'vs')
|
|
2390
2399
|
};
|
|
2391
2400
|
}
|
|
@@ -2393,11 +2402,11 @@ class CmatCodeEditorComponent {
|
|
|
2393
2402
|
return this._document.documentElement.classList.contains('dark') || this._document.body.classList.contains('dark');
|
|
2394
2403
|
}
|
|
2395
2404
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatCodeEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2396
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatCodeEditorComponent, isStandalone: true, selector: "cmat-code-editor", inputs: { value: "value", language: "language", height: "height", readOnly: "readOnly", options: "options" }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@defer (on viewport) {\r\n <div class=\"rounded-2xl border border-default bg-card p-2 shadow-sm\">\r\n <ngx-monaco-editor class=\"block\" [style.height]=\"height\" [options]=\"editorOptions\" [model]=\"model\"></ngx-monaco-editor>\r\n </div>\r\n} @placeholder {\r\n <div class=\"flex items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\" [style.minHeight]=\"height\">\r\n \u4EE3\u7801\u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n
|
|
2405
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatCodeEditorComponent, isStandalone: true, selector: "cmat-code-editor", inputs: { value: "value", language: "language", height: "height", readOnly: "readOnly", options: "options" }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@defer (on viewport) {\r\n <div class=\"rounded-2xl border border-default bg-card p-2 shadow-sm\">\r\n <ngx-monaco-editor class=\"block\" [style.height]=\"height\" [options]=\"editorOptions\" [model]=\"model\"></ngx-monaco-editor>\r\n </div>\r\n} @placeholder {\r\n <div class=\"flex items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\" [style.minHeight]=\"height\">\r\n \u4EE3\u7801\u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n\r\n", styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [EditorComponent]] }); }
|
|
2397
2406
|
}
|
|
2398
2407
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatCodeEditorComponent, decorators: [{
|
|
2399
2408
|
type: Component,
|
|
2400
|
-
args: [{ selector: 'cmat-code-editor', changeDetection: ChangeDetectionStrategy.OnPush, imports: [EditorComponent], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@defer (on viewport) {\r\n <div class=\"rounded-2xl border border-default bg-card p-2 shadow-sm\">\r\n <ngx-monaco-editor class=\"block\" [style.height]=\"height\" [options]=\"editorOptions\" [model]=\"model\"></ngx-monaco-editor>\r\n </div>\r\n} @placeholder {\r\n <div class=\"flex items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\" [style.minHeight]=\"height\">\r\n \u4EE3\u7801\u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n
|
|
2409
|
+
args: [{ selector: 'cmat-code-editor', changeDetection: ChangeDetectionStrategy.OnPush, imports: [EditorComponent], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@defer (on viewport) {\r\n <div class=\"rounded-2xl border border-default bg-card p-2 shadow-sm\">\r\n <ngx-monaco-editor class=\"block\" [style.height]=\"height\" [options]=\"editorOptions\" [model]=\"model\"></ngx-monaco-editor>\r\n </div>\r\n} @placeholder {\r\n <div class=\"flex items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\" [style.minHeight]=\"height\">\r\n \u4EE3\u7801\u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n\r\n", styles: [":host{display:block}\n"] }]
|
|
2401
2410
|
}], propDecorators: { value: [{
|
|
2402
2411
|
type: Input
|
|
2403
2412
|
}], language: [{
|
|
@@ -2411,13 +2420,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
2411
2420
|
}] } });
|
|
2412
2421
|
|
|
2413
2422
|
function addonsExtension(field) {
|
|
2414
|
-
|
|
2423
|
+
const props = field.props;
|
|
2424
|
+
if (!props || (field.wrappers?.includes('addons'))) {
|
|
2415
2425
|
return;
|
|
2416
2426
|
}
|
|
2417
|
-
if ((
|
|
2418
|
-
|| (!isNil(
|
|
2419
|
-
|| (
|
|
2420
|
-
|| (!isNil(
|
|
2427
|
+
if ((props.addonLeft && ((!isNil(props.addonLeft.icon) && props.addonLeft.icon !== '')
|
|
2428
|
+
|| (!isNil(props.addonLeft.text)) && props.addonLeft.text !== ''))
|
|
2429
|
+
|| (props.addonRight && ((!isNil(props.addonRight.icon) && props.addonRight.icon !== '')
|
|
2430
|
+
|| (!isNil(props.addonRight.text)) && props.addonRight.text !== ''))) {
|
|
2421
2431
|
field.wrappers = [...(field.wrappers ?? []), 'addons'];
|
|
2422
2432
|
}
|
|
2423
2433
|
}
|
|
@@ -2551,8 +2561,11 @@ class CmatFormFieldWrapperComponent extends FieldWrapper {
|
|
|
2551
2561
|
}
|
|
2552
2562
|
ngAfterViewInit() {
|
|
2553
2563
|
if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {
|
|
2554
|
-
const
|
|
2555
|
-
underlineElement
|
|
2564
|
+
const formFieldElement = this._elementRef.nativeElement;
|
|
2565
|
+
const underlineElement = formFieldElement.querySelector('.mat-form-field-underline');
|
|
2566
|
+
if (underlineElement?.parentNode) {
|
|
2567
|
+
this._renderer.removeChild(underlineElement.parentNode, underlineElement);
|
|
2568
|
+
}
|
|
2556
2569
|
}
|
|
2557
2570
|
}
|
|
2558
2571
|
ngOnDestroy() {
|
|
@@ -2570,9 +2583,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
2570
2583
|
args: [MatFormField, { static: true }]
|
|
2571
2584
|
}] } });
|
|
2572
2585
|
|
|
2586
|
+
const DANGEROUS_PATTERNS = [
|
|
2587
|
+
/\bdocument\s*\./i,
|
|
2588
|
+
/\bwindow\s*\./i,
|
|
2589
|
+
/\beval\s*\(/i,
|
|
2590
|
+
/\bfetch\s*\(/i,
|
|
2591
|
+
/\bXMLHttpRequest\b/i,
|
|
2592
|
+
/\bimport\s*\(/i,
|
|
2593
|
+
/\b__proto__\b/i,
|
|
2594
|
+
/\bconstructor\s*\(/i,
|
|
2595
|
+
/\bprototype\b/i
|
|
2596
|
+
];
|
|
2573
2597
|
class CmatButtonTypeComponent extends FieldType {
|
|
2574
2598
|
constructor() {
|
|
2575
|
-
super();
|
|
2599
|
+
super(...arguments);
|
|
2576
2600
|
this.defaultOptions = {
|
|
2577
2601
|
props: {
|
|
2578
2602
|
color: 'primary'
|
|
@@ -2583,14 +2607,21 @@ class CmatButtonTypeComponent extends FieldType {
|
|
|
2583
2607
|
$event.preventDefault();
|
|
2584
2608
|
if (this.props.onClick) {
|
|
2585
2609
|
if (isString(this.props.onClick)) {
|
|
2586
|
-
this._executeFunctionFromString(this.props.onClick, $event, this);
|
|
2610
|
+
this._executeFunctionFromString(this.props.onClick, $event, { props: this.props });
|
|
2587
2611
|
}
|
|
2588
2612
|
else {
|
|
2589
2613
|
this.props.onClick($event);
|
|
2590
2614
|
}
|
|
2591
2615
|
}
|
|
2592
2616
|
}
|
|
2617
|
+
_isDangerousCode(code) {
|
|
2618
|
+
return DANGEROUS_PATTERNS.some((pattern) => pattern.test(code));
|
|
2619
|
+
}
|
|
2593
2620
|
_executeFunctionFromString(funcString, event, context) {
|
|
2621
|
+
if (this._isDangerousCode(funcString)) {
|
|
2622
|
+
console.error('Button onClick contains potentially dangerous code and was blocked:', funcString);
|
|
2623
|
+
return;
|
|
2624
|
+
}
|
|
2594
2625
|
try {
|
|
2595
2626
|
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
2596
2627
|
const func = new Function('event', 'context', `with (context) { ${funcString} }`);
|
|
@@ -2600,13 +2631,13 @@ class CmatButtonTypeComponent extends FieldType {
|
|
|
2600
2631
|
console.error('Error executing function from string:', error);
|
|
2601
2632
|
}
|
|
2602
2633
|
}
|
|
2603
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatButtonTypeComponent, deps:
|
|
2634
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatButtonTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2604
2635
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: CmatButtonTypeComponent, isStandalone: true, selector: "cmat-button-type", usesInheritance: true, ngImport: i0, template: "<button class=\"print:hidden\" matButton=\"filled\" [type]=\"props.type\" [color]=\"props.color\" [disabled]=\"disabled\" (click)=\"onClick($event)\">\r\n {{ props.label }}\r\n</button>", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2605
2636
|
}
|
|
2606
2637
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatButtonTypeComponent, decorators: [{
|
|
2607
2638
|
type: Component,
|
|
2608
2639
|
args: [{ selector: 'cmat-button-type', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule], template: "<button class=\"print:hidden\" matButton=\"filled\" [type]=\"props.type\" [color]=\"props.color\" [disabled]=\"disabled\" (click)=\"onClick($event)\">\r\n {{ props.label }}\r\n</button>" }]
|
|
2609
|
-
}]
|
|
2640
|
+
}] });
|
|
2610
2641
|
|
|
2611
2642
|
class CmatCascadeTypeComponent extends FieldType {
|
|
2612
2643
|
constructor() {
|
|
@@ -2630,9 +2661,11 @@ class CmatCascadeTypeComponent extends FieldType {
|
|
|
2630
2661
|
if (url && this.props?.domain?.code && this.props?.domain?.key && this.props?.domain?.value) {
|
|
2631
2662
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
2632
2663
|
if (data) {
|
|
2664
|
+
const key = this.field.props?.domain?.key;
|
|
2665
|
+
const code = this.field.props?.domain?.code;
|
|
2633
2666
|
const datas = data.filter((i) => {
|
|
2634
|
-
if (
|
|
2635
|
-
return i[
|
|
2667
|
+
if (key)
|
|
2668
|
+
return i[key] === code;
|
|
2636
2669
|
return false;
|
|
2637
2670
|
});
|
|
2638
2671
|
if (datas && this.field.props?.domain?.value) {
|
|
@@ -2672,6 +2705,8 @@ class CmatCheckListTypeComponent extends FieldType {
|
|
|
2672
2705
|
super();
|
|
2673
2706
|
this.isIndeterminate = false;
|
|
2674
2707
|
this.isChecked = false;
|
|
2708
|
+
this.urlData = [];
|
|
2709
|
+
this.optionsData = [];
|
|
2675
2710
|
this.checklist = [];
|
|
2676
2711
|
this.filteredData = [];
|
|
2677
2712
|
this._http = inject(HttpClient);
|
|
@@ -2700,13 +2735,15 @@ class CmatCheckListTypeComponent extends FieldType {
|
|
|
2700
2735
|
if (url && this.field.props?.domain?.code && this.field.props?.domain?.key && this.field.props?.domain?.value) {
|
|
2701
2736
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
2702
2737
|
if (data) {
|
|
2738
|
+
const key = this.field.props?.domain?.key;
|
|
2739
|
+
const code = this.field.props?.domain?.code;
|
|
2703
2740
|
const datas = data.filter((i) => {
|
|
2704
|
-
if (
|
|
2705
|
-
return i[
|
|
2741
|
+
if (key)
|
|
2742
|
+
return i[key] === code;
|
|
2706
2743
|
return false;
|
|
2707
2744
|
});
|
|
2708
2745
|
if (datas && this.field.props?.domain?.value) {
|
|
2709
|
-
this.urlData = datas[0][this.field.props?.domain?.value];
|
|
2746
|
+
this.urlData = datas[0][this.field.props?.domain?.value] ?? [];
|
|
2710
2747
|
}
|
|
2711
2748
|
else {
|
|
2712
2749
|
this.urlData = [];
|
|
@@ -2725,7 +2762,7 @@ class CmatCheckListTypeComponent extends FieldType {
|
|
|
2725
2762
|
this._filteredItems.set(this.filteredData);
|
|
2726
2763
|
}
|
|
2727
2764
|
this.formControl.valueChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((value) => {
|
|
2728
|
-
this.checklist = value ?? [];
|
|
2765
|
+
this.checklist = (value ?? []);
|
|
2729
2766
|
this._getAllCheckCountState();
|
|
2730
2767
|
});
|
|
2731
2768
|
}
|
|
@@ -2733,7 +2770,9 @@ class CmatCheckListTypeComponent extends FieldType {
|
|
|
2733
2770
|
return item.id ?? index;
|
|
2734
2771
|
}
|
|
2735
2772
|
filterByQuery(event) {
|
|
2736
|
-
|
|
2773
|
+
const query = typeof event === 'string' ? event : event.target?.value ?? '';
|
|
2774
|
+
const normalizedQuery = query.toLowerCase();
|
|
2775
|
+
this.filteredData = this.datas.filter((data) => this._toSearchText(data.value).toLowerCase().includes(normalizedQuery) || this._toSearchText(data.label).toLowerCase().includes(normalizedQuery));
|
|
2737
2776
|
this._filteredItems.set(this.filteredData);
|
|
2738
2777
|
this._getAllCheckCountState();
|
|
2739
2778
|
}
|
|
@@ -2768,7 +2807,8 @@ class CmatCheckListTypeComponent extends FieldType {
|
|
|
2768
2807
|
this.formControl.setValue(this.checklist);
|
|
2769
2808
|
}
|
|
2770
2809
|
isCheck(data) {
|
|
2771
|
-
|
|
2810
|
+
const selected = (this.formControl.value ?? []);
|
|
2811
|
+
return selected.filter((i) => i.value === data.value).length > 0;
|
|
2772
2812
|
}
|
|
2773
2813
|
_getAllCheckCountState() {
|
|
2774
2814
|
if (this.props.showAllCheck && !this.props.disabled) {
|
|
@@ -2800,35 +2840,47 @@ class CmatCheckListTypeComponent extends FieldType {
|
|
|
2800
2840
|
}
|
|
2801
2841
|
}
|
|
2802
2842
|
}
|
|
2843
|
+
_toSearchText(value) {
|
|
2844
|
+
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ? String(value) : '';
|
|
2845
|
+
}
|
|
2803
2846
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatCheckListTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2804
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatCheckListTypeComponent, isStandalone: true, selector: "cmat-checklist-type", usesInheritance: true, ngImport: i0, template: "<div class=\"flex flex-col\">\r\n <div class=\"p-2\">\r\n @if(props.label){\r\n <legend class=\"text-lg\">\r\n {{ props.label }}\r\n @if(props.required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n }\r\n @if(props.description){\r\n <p>{{ props.description }}</p>\r\n }\r\n </div>\r\n\r\n <div class=\"w-full h-full rounded-sm border shadow-sm bg-card\" [tabIndex]=\"props.tabindex\">\r\n <div class=\"flex items-center m-1 mr-2 min-h-12 print:hidden\">\r\n @if (props.showAllCheck&&!props.disabled) {\r\n <div>\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10 m-1\" [color]=\"'primary'\" [checked]=\"isChecked\"\r\n [indeterminate]=\"isIndeterminate\" (change)=\"allCheckChange($event.checked)\">\r\n </mat-checkbox>\r\n </div>\r\n }\r\n <div class=\"flex items-center w-full\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:magnifying-glass'\"></mat-icon>\r\n <div class=\"ml-2\">\r\n <input #query class=\"w-full min-w-0 py-1 border-none\" type=\"text\"\r\n placeholder=\"\u8F93\u5165\u8FC7\u6EE4\u4FE1\u606F\" (input)=\"filterByQuery(query.value)\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"border-t overflow-y-auto scrollbar-custom\"\r\n [ngClass]=\"props.controlMaxHeight?'max-h-64 sm:max-h-128 lg:max-h-64':''\">\r\n @if ((filteredItems$ | async); as filteredItems) {\r\n @if(filteredItems.length>0){\r\n @for (data of filteredItems; track trackByFn($index, data)) {\r\n <div role=\"presentation\" class=\"flex items-center pl-2 pr-4 py-2 cursor-pointer hover:bg-hover\" matRipple\r\n (click)=\"toggleCheckList(data,$event)\">\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10 pointer-events-none\" disableRipple [color]=\"'primary'\"\r\n [checked]=\"isCheck(data)\" [
|
|
2847
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatCheckListTypeComponent, isStandalone: true, selector: "cmat-checklist-type", usesInheritance: true, ngImport: i0, template: "<div class=\"flex flex-col\">\r\n <div class=\"p-2\">\r\n @if(props.label){\r\n <legend class=\"text-lg\">\r\n {{ props.label }}\r\n @if(props.required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n }\r\n @if(props.description){\r\n <p>{{ props.description }}</p>\r\n }\r\n </div>\r\n\r\n <div class=\"w-full h-full rounded-sm border shadow-sm bg-card\" [tabIndex]=\"props.tabindex\">\r\n <div class=\"flex items-center m-1 mr-2 min-h-12 print:hidden\">\r\n @if (props.showAllCheck&&!props.disabled) {\r\n <div>\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10 m-1\" [color]=\"'primary'\" [checked]=\"isChecked\"\r\n [indeterminate]=\"isIndeterminate\" (change)=\"allCheckChange($event.checked)\">\r\n </mat-checkbox>\r\n </div>\r\n }\r\n <div class=\"flex items-center w-full\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:magnifying-glass'\"></mat-icon>\r\n <div class=\"ml-2\">\r\n <input #query class=\"w-full min-w-0 py-1 border-none\" type=\"text\"\r\n placeholder=\"\u8F93\u5165\u8FC7\u6EE4\u4FE1\u606F\" (input)=\"filterByQuery(query.value)\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"border-t overflow-y-auto scrollbar-custom\"\r\n [ngClass]=\"props.controlMaxHeight?'max-h-64 sm:max-h-128 lg:max-h-64':''\">\r\n @if ((filteredItems$ | async); as filteredItems) {\r\n @if(filteredItems.length>0){\r\n @for (data of filteredItems; track trackByFn($index, data)) {\r\n <div role=\"presentation\" class=\"flex items-center pl-2 pr-4 py-2 cursor-pointer hover:bg-hover\" matRipple\r\n (click)=\"toggleCheckList(data,$event)\">\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10 pointer-events-none\" disableRipple [color]=\"'primary'\"\r\n [checked]=\"isCheck(data)\" [disabled]=\"data.disabled||props.disabled\">\r\n <div class=\"flex flex-col flex-auto\">\r\n <div class=\"font-medium leading-5 truncate\">{{data.label}}</div>\r\n </div>\r\n </mat-checkbox>\r\n </div>\r\n }\r\n } @else {\r\n <div\r\n class=\"flex flex-auto flex-col items-center justify-center bg-slate-100 dark:bg-transparent h-64 sm:h-128 lg:h-64\">\r\n <mat-icon class=\"icon-size-24\" [svgIcon]=\"'heroicons_outline:document-magnifying-glass'\"></mat-icon>\r\n <div class=\"mt-4 text-2xl font-bold tracking-tight text-secondary\">\u6CA1\u6709\u6570\u636E!</div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$9.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: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i3$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2805
2848
|
}
|
|
2806
2849
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatCheckListTypeComponent, decorators: [{
|
|
2807
2850
|
type: Component,
|
|
2808
|
-
args: [{ selector: 'cmat-checklist-type', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCheckboxModule, MatIconModule, NgClass, MatRippleModule, AsyncPipe], template: "<div class=\"flex flex-col\">\r\n <div class=\"p-2\">\r\n @if(props.label){\r\n <legend class=\"text-lg\">\r\n {{ props.label }}\r\n @if(props.required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n }\r\n @if(props.description){\r\n <p>{{ props.description }}</p>\r\n }\r\n </div>\r\n\r\n <div class=\"w-full h-full rounded-sm border shadow-sm bg-card\" [tabIndex]=\"props.tabindex\">\r\n <div class=\"flex items-center m-1 mr-2 min-h-12 print:hidden\">\r\n @if (props.showAllCheck&&!props.disabled) {\r\n <div>\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10 m-1\" [color]=\"'primary'\" [checked]=\"isChecked\"\r\n [indeterminate]=\"isIndeterminate\" (change)=\"allCheckChange($event.checked)\">\r\n </mat-checkbox>\r\n </div>\r\n }\r\n <div class=\"flex items-center w-full\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:magnifying-glass'\"></mat-icon>\r\n <div class=\"ml-2\">\r\n <input #query class=\"w-full min-w-0 py-1 border-none\" type=\"text\"\r\n placeholder=\"\u8F93\u5165\u8FC7\u6EE4\u4FE1\u606F\" (input)=\"filterByQuery(query.value)\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"border-t overflow-y-auto scrollbar-custom\"\r\n [ngClass]=\"props.controlMaxHeight?'max-h-64 sm:max-h-128 lg:max-h-64':''\">\r\n @if ((filteredItems$ | async); as filteredItems) {\r\n @if(filteredItems.length>0){\r\n @for (data of filteredItems; track trackByFn($index, data)) {\r\n <div role=\"presentation\" class=\"flex items-center pl-2 pr-4 py-2 cursor-pointer hover:bg-hover\" matRipple\r\n (click)=\"toggleCheckList(data,$event)\">\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10 pointer-events-none\" disableRipple [color]=\"'primary'\"\r\n [checked]=\"isCheck(data)\" [
|
|
2851
|
+
args: [{ selector: 'cmat-checklist-type', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCheckboxModule, MatIconModule, NgClass, MatRippleModule, AsyncPipe], template: "<div class=\"flex flex-col\">\r\n <div class=\"p-2\">\r\n @if(props.label){\r\n <legend class=\"text-lg\">\r\n {{ props.label }}\r\n @if(props.required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n }\r\n @if(props.description){\r\n <p>{{ props.description }}</p>\r\n }\r\n </div>\r\n\r\n <div class=\"w-full h-full rounded-sm border shadow-sm bg-card\" [tabIndex]=\"props.tabindex\">\r\n <div class=\"flex items-center m-1 mr-2 min-h-12 print:hidden\">\r\n @if (props.showAllCheck&&!props.disabled) {\r\n <div>\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10 m-1\" [color]=\"'primary'\" [checked]=\"isChecked\"\r\n [indeterminate]=\"isIndeterminate\" (change)=\"allCheckChange($event.checked)\">\r\n </mat-checkbox>\r\n </div>\r\n }\r\n <div class=\"flex items-center w-full\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:magnifying-glass'\"></mat-icon>\r\n <div class=\"ml-2\">\r\n <input #query class=\"w-full min-w-0 py-1 border-none\" type=\"text\"\r\n placeholder=\"\u8F93\u5165\u8FC7\u6EE4\u4FE1\u606F\" (input)=\"filterByQuery(query.value)\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"border-t overflow-y-auto scrollbar-custom\"\r\n [ngClass]=\"props.controlMaxHeight?'max-h-64 sm:max-h-128 lg:max-h-64':''\">\r\n @if ((filteredItems$ | async); as filteredItems) {\r\n @if(filteredItems.length>0){\r\n @for (data of filteredItems; track trackByFn($index, data)) {\r\n <div role=\"presentation\" class=\"flex items-center pl-2 pr-4 py-2 cursor-pointer hover:bg-hover\" matRipple\r\n (click)=\"toggleCheckList(data,$event)\">\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10 pointer-events-none\" disableRipple [color]=\"'primary'\"\r\n [checked]=\"isCheck(data)\" [disabled]=\"data.disabled||props.disabled\">\r\n <div class=\"flex flex-col flex-auto\">\r\n <div class=\"font-medium leading-5 truncate\">{{data.label}}</div>\r\n </div>\r\n </mat-checkbox>\r\n </div>\r\n }\r\n } @else {\r\n <div\r\n class=\"flex flex-auto flex-col items-center justify-center bg-slate-100 dark:bg-transparent h-64 sm:h-128 lg:h-64\">\r\n <mat-icon class=\"icon-size-24\" [svgIcon]=\"'heroicons_outline:document-magnifying-glass'\"></mat-icon>\r\n <div class=\"mt-4 text-2xl font-bold tracking-tight text-secondary\">\u6CA1\u6709\u6570\u636E!</div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{width:100%}\n"] }]
|
|
2809
2852
|
}], ctorParameters: () => [] });
|
|
2810
2853
|
|
|
2811
2854
|
class CmatChipsInputTypeComponent extends FieldType {
|
|
2812
2855
|
constructor() {
|
|
2813
2856
|
super();
|
|
2857
|
+
this.autocompleteUrlData = [];
|
|
2814
2858
|
this._http = inject(HttpClient);
|
|
2815
2859
|
this._destroyRef = inject(DestroyRef);
|
|
2816
2860
|
}
|
|
2817
2861
|
get autocompleteText() {
|
|
2818
|
-
|
|
2862
|
+
if (this.autocompleteUrlData?.length > 0) {
|
|
2863
|
+
// Ensure all elements are strings, filter out non-strings
|
|
2864
|
+
return this.autocompleteUrlData.filter((item) => typeof item === 'string');
|
|
2865
|
+
}
|
|
2866
|
+
return this.props?.autocompleteText?.split(',') ?? [];
|
|
2819
2867
|
}
|
|
2820
2868
|
ngOnInit() {
|
|
2821
2869
|
const url = this.props?.domain?.url;
|
|
2822
2870
|
if (url && this.props?.domain?.code && this.props?.domain?.key && this.props?.domain?.value) {
|
|
2823
2871
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
2824
2872
|
if (data) {
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2827
|
-
|
|
2873
|
+
const key = this.field.props?.domain?.key;
|
|
2874
|
+
const code = this.field.props?.domain?.code;
|
|
2875
|
+
const datas = data
|
|
2876
|
+
.filter((i) => typeof i === 'object' && i !== null)
|
|
2877
|
+
.filter((i) => {
|
|
2878
|
+
if (key)
|
|
2879
|
+
return i[key] === code;
|
|
2828
2880
|
return false;
|
|
2829
2881
|
});
|
|
2830
2882
|
if (datas && this.field.props?.domain?.value) {
|
|
2831
|
-
this.autocompleteUrlData = datas[0][this.field.props?.domain?.value];
|
|
2883
|
+
this.autocompleteUrlData = [datas[0][this.field.props?.domain?.value]];
|
|
2832
2884
|
}
|
|
2833
2885
|
else {
|
|
2834
2886
|
this.autocompleteUrlData = [];
|
|
@@ -2933,15 +2985,17 @@ class CmatMultiCheckboxTypeComponent extends FieldType {
|
|
|
2933
2985
|
get urlData$() {
|
|
2934
2986
|
return this._urlData$;
|
|
2935
2987
|
}
|
|
2936
|
-
onChange(
|
|
2988
|
+
onChange(optionValue, checked) {
|
|
2989
|
+
const value = optionValue ?? '';
|
|
2937
2990
|
this.formControl.markAsDirty();
|
|
2938
2991
|
if (this.props.type === 'array') {
|
|
2992
|
+
const currentValue = (this.formControl.value ?? []);
|
|
2939
2993
|
this.formControl.patchValue(checked
|
|
2940
|
-
? [...
|
|
2941
|
-
:
|
|
2994
|
+
? [...currentValue, value]
|
|
2995
|
+
: currentValue.filter(o => o !== value));
|
|
2942
2996
|
}
|
|
2943
2997
|
else {
|
|
2944
|
-
this.formControl.patchValue({ ...this.formControl.value, [value]: checked });
|
|
2998
|
+
this.formControl.patchValue({ ...(this.formControl.value ?? {}), [value]: checked });
|
|
2945
2999
|
}
|
|
2946
3000
|
this.formControl.markAsTouched();
|
|
2947
3001
|
}
|
|
@@ -2950,13 +3004,15 @@ class CmatMultiCheckboxTypeComponent extends FieldType {
|
|
|
2950
3004
|
if (url && this.field.props?.domain?.code && this.field.props?.domain?.key && this.field.props?.domain?.value) {
|
|
2951
3005
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
2952
3006
|
if (data) {
|
|
3007
|
+
const key = this.field.props?.domain?.key;
|
|
3008
|
+
const code = this.field.props?.domain?.code;
|
|
2953
3009
|
const datas = data.filter((i) => {
|
|
2954
|
-
if (
|
|
2955
|
-
return i[
|
|
3010
|
+
if (key)
|
|
3011
|
+
return i[key] === code;
|
|
2956
3012
|
return false;
|
|
2957
3013
|
});
|
|
2958
3014
|
if (datas && this.field.props?.domain?.value) {
|
|
2959
|
-
this._urlData.set(datas[0][this.field.props?.domain?.value]);
|
|
3015
|
+
this._urlData.set(datas[0][this.field.props?.domain?.value] ?? []);
|
|
2960
3016
|
}
|
|
2961
3017
|
else {
|
|
2962
3018
|
this._urlData.set([]);
|
|
@@ -2972,18 +3028,19 @@ class CmatMultiCheckboxTypeComponent extends FieldType {
|
|
|
2972
3028
|
}
|
|
2973
3029
|
}
|
|
2974
3030
|
isChecked(option) {
|
|
2975
|
-
const
|
|
2976
|
-
|
|
3031
|
+
const formValue = this.formControl.value;
|
|
3032
|
+
const optionValue = option.value ?? '';
|
|
3033
|
+
return !!formValue && (this.props.type === 'array' ? formValue.includes(optionValue) : !!formValue[optionValue]);
|
|
2977
3034
|
}
|
|
2978
3035
|
trackByFn(index) {
|
|
2979
3036
|
return index;
|
|
2980
3037
|
}
|
|
2981
3038
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatMultiCheckboxTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2982
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatMultiCheckboxTypeComponent, isStandalone: true, selector: "cmat-multicheckbox-type", viewQueries: [{ propertyName: "checkboxes", predicate: MatCheckbox, descendants: true }], usesInheritance: true, ngImport: i0, template: "@if ((urlData$ | async); as urlData) {\r\n@for (option of (urlData.length > 0 ? urlData : (props.options | formlySelectOptions : field | async)); track\r\ntrackByFn($index)) {\r\n<mat-checkbox [tabIndex]=\"props.tabindex\" [color]=\"props.color\" [labelPosition]=\"props.labelPosition\"\r\n [checked]=\"isChecked(option)\" [disabled]=\"formControl.disabled || option.disabled\"\r\n (change)=\"onChange(option.value, $event.checked)\">\r\n {{ option.label }}\r\n</mat-checkbox>\r\n}\r\n}", styles: [":host{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$9.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: FormlySelectModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i2$2.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3039
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatMultiCheckboxTypeComponent, isStandalone: true, selector: "cmat-multicheckbox-type", viewQueries: [{ propertyName: "checkboxes", predicate: MatCheckbox, descendants: true }], usesInheritance: true, ngImport: i0, template: "@if ((urlData$ | async); as urlData) {\r\n@for (option of (urlData.length > 0 ? urlData : (props.options | formlySelectOptions : field | async)); track\r\ntrackByFn($index)) {\r\n<mat-checkbox [tabIndex]=\"props.tabindex\" [color]=\"props.color\" [labelPosition]=\"props.labelPosition\"\r\n [checked]=\"isChecked(option)\" [disabled]=\"formControl.disabled || option.disabled\"\r\n (change)=\"onChange(option.value?.toString(), $event.checked)\">\r\n {{ option.label }}\r\n</mat-checkbox>\r\n}\r\n}", styles: [":host{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$9.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: FormlySelectModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i2$2.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2983
3040
|
}
|
|
2984
3041
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatMultiCheckboxTypeComponent, decorators: [{
|
|
2985
3042
|
type: Component,
|
|
2986
|
-
args: [{ selector: 'cmat-multicheckbox-type', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCheckboxModule, AsyncPipe, FormlySelectModule], template: "@if ((urlData$ | async); as urlData) {\r\n@for (option of (urlData.length > 0 ? urlData : (props.options | formlySelectOptions : field | async)); track\r\ntrackByFn($index)) {\r\n<mat-checkbox [tabIndex]=\"props.tabindex\" [color]=\"props.color\" [labelPosition]=\"props.labelPosition\"\r\n [checked]=\"isChecked(option)\" [disabled]=\"formControl.disabled || option.disabled\"\r\n (change)=\"onChange(option.value, $event.checked)\">\r\n {{ option.label }}\r\n</mat-checkbox>\r\n}\r\n}", styles: [":host{width:100%}\n"] }]
|
|
3043
|
+
args: [{ selector: 'cmat-multicheckbox-type', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCheckboxModule, AsyncPipe, FormlySelectModule], template: "@if ((urlData$ | async); as urlData) {\r\n@for (option of (urlData.length > 0 ? urlData : (props.options | formlySelectOptions : field | async)); track\r\ntrackByFn($index)) {\r\n<mat-checkbox [tabIndex]=\"props.tabindex\" [color]=\"props.color\" [labelPosition]=\"props.labelPosition\"\r\n [checked]=\"isChecked(option)\" [disabled]=\"formControl.disabled || option.disabled\"\r\n (change)=\"onChange(option.value?.toString(), $event.checked)\">\r\n {{ option.label }}\r\n</mat-checkbox>\r\n}\r\n}", styles: [":host{width:100%}\n"] }]
|
|
2987
3044
|
}], ctorParameters: () => [], propDecorators: { checkboxes: [{
|
|
2988
3045
|
type: ViewChildren,
|
|
2989
3046
|
args: [MatCheckbox]
|
|
@@ -3052,13 +3109,15 @@ class CmatRadioTypeComponent extends FieldType {
|
|
|
3052
3109
|
if (url && this.field.props?.domain?.code && this.field.props?.domain?.key && this.field.props?.domain?.value) {
|
|
3053
3110
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
3054
3111
|
if (data) {
|
|
3112
|
+
const key = this.field.props?.domain?.key;
|
|
3113
|
+
const code = this.field.props?.domain?.code;
|
|
3055
3114
|
const datas = data.filter((i) => {
|
|
3056
|
-
if (
|
|
3057
|
-
return i[
|
|
3115
|
+
if (key)
|
|
3116
|
+
return i[key] === code;
|
|
3058
3117
|
return false;
|
|
3059
3118
|
});
|
|
3060
3119
|
if (datas && this.field.props?.domain?.value) {
|
|
3061
|
-
this._urlData.set(datas[0][this.field.props?.domain?.value]);
|
|
3120
|
+
this._urlData.set(datas[0][this.field.props?.domain?.value] ?? []);
|
|
3062
3121
|
}
|
|
3063
3122
|
else {
|
|
3064
3123
|
this._urlData.set([]);
|
|
@@ -3128,6 +3187,7 @@ class CmatSelectTypeComponent extends FieldType {
|
|
|
3128
3187
|
showToggleAllCheckbox: false
|
|
3129
3188
|
},
|
|
3130
3189
|
};
|
|
3190
|
+
this.optionsData = [];
|
|
3131
3191
|
this.filteredCustomDetails = new ReplaySubject(1);
|
|
3132
3192
|
this.filteredCache = [];
|
|
3133
3193
|
this.isIndeterminate = false;
|
|
@@ -3139,7 +3199,7 @@ class CmatSelectTypeComponent extends FieldType {
|
|
|
3139
3199
|
}
|
|
3140
3200
|
get datas() {
|
|
3141
3201
|
if (isArray(this.field.props?.options)) {
|
|
3142
|
-
return this._urlData?.length > 0 ? this._urlData : this.field.props?.options
|
|
3202
|
+
return this._urlData?.length > 0 ? this._urlData : this.field.props?.options ?? [];
|
|
3143
3203
|
}
|
|
3144
3204
|
else {
|
|
3145
3205
|
return this._urlData?.length > 0 ? this._urlData : this.optionsData || [];
|
|
@@ -3155,13 +3215,15 @@ class CmatSelectTypeComponent extends FieldType {
|
|
|
3155
3215
|
if (url && this.field.props?.domain?.code && this.field.props?.domain?.key && this.field.props?.domain?.value) {
|
|
3156
3216
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
3157
3217
|
if (data) {
|
|
3218
|
+
const key = this.field.props?.domain?.key;
|
|
3219
|
+
const code = this.field.props?.domain?.code;
|
|
3158
3220
|
const datas = data.filter((i) => {
|
|
3159
|
-
if (
|
|
3160
|
-
return i[
|
|
3221
|
+
if (key)
|
|
3222
|
+
return i[key] === code;
|
|
3161
3223
|
return false;
|
|
3162
3224
|
});
|
|
3163
3225
|
if (datas && this.field.props?.domain?.value) {
|
|
3164
|
-
this._urlData = datas[0][this.field.props?.domain?.value];
|
|
3226
|
+
this._urlData = datas[0][this.field.props?.domain?.value] ?? [];
|
|
3165
3227
|
}
|
|
3166
3228
|
else {
|
|
3167
3229
|
this._urlData = [];
|
|
@@ -3213,7 +3275,7 @@ class CmatSelectTypeComponent extends FieldType {
|
|
|
3213
3275
|
this.filteredCustomDetails.pipe(take(1), takeUntilDestroyed(this._destroyRef))
|
|
3214
3276
|
.subscribe((val) => {
|
|
3215
3277
|
if (selectAllValue) {
|
|
3216
|
-
this.formControl.setValue(val.filter(o => !o.disabled));
|
|
3278
|
+
this.formControl.setValue(val.filter((o) => !o.disabled));
|
|
3217
3279
|
}
|
|
3218
3280
|
else {
|
|
3219
3281
|
this.formControl.setValue([]);
|
|
@@ -3225,26 +3287,24 @@ class CmatSelectTypeComponent extends FieldType {
|
|
|
3225
3287
|
if (!this.datas) {
|
|
3226
3288
|
return;
|
|
3227
3289
|
}
|
|
3228
|
-
|
|
3290
|
+
const search = (this.multiFilterCtrl.value ?? '').toLowerCase();
|
|
3229
3291
|
if (!search) {
|
|
3230
3292
|
this.filteredCache = this.datas.slice();
|
|
3231
3293
|
this.filteredCustomDetails.next(this.filteredCache);
|
|
3232
3294
|
return;
|
|
3233
3295
|
}
|
|
3234
|
-
|
|
3235
|
-
search = search.toLowerCase();
|
|
3236
|
-
}
|
|
3237
|
-
this.filteredCache = this.datas.filter(items => isString(items) ? items.toString().toLowerCase().includes(search) : (items?.value.toString().toLowerCase().includes(search) ?? items?.label.toString().toLowerCase().includes(search)));
|
|
3296
|
+
this.filteredCache = this.datas.filter((items) => this._toSearchText(items.value).toLowerCase().includes(search) || this._toSearchText(items.label).toLowerCase().includes(search));
|
|
3238
3297
|
this.filteredCustomDetails.next(this.filteredCache);
|
|
3239
3298
|
}
|
|
3240
3299
|
setToggleAllCheckboxState() {
|
|
3241
3300
|
let filteredLength = 0;
|
|
3242
3301
|
if (this.formControl.value && this.props.search) {
|
|
3243
|
-
const cache = this.filteredCache.filter(o => !o.disabled);
|
|
3244
|
-
const
|
|
3302
|
+
const cache = this.filteredCache.filter((o) => !o.disabled);
|
|
3303
|
+
const currentValue = this.formControl.value;
|
|
3304
|
+
const v = isArray(currentValue) || isUndefined(currentValue) ? currentValue : [currentValue];
|
|
3245
3305
|
if (v)
|
|
3246
3306
|
cache.forEach((el) => {
|
|
3247
|
-
if (v.findIndex(
|
|
3307
|
+
if (v.findIndex(t => t != null && this._isSameSelectValue(t, el)) > -1) {
|
|
3248
3308
|
filteredLength++;
|
|
3249
3309
|
}
|
|
3250
3310
|
});
|
|
@@ -3257,7 +3317,16 @@ class CmatSelectTypeComponent extends FieldType {
|
|
|
3257
3317
|
}
|
|
3258
3318
|
}
|
|
3259
3319
|
compareWithFn(o1, o2) {
|
|
3260
|
-
|
|
3320
|
+
if (!o1 || !o2) {
|
|
3321
|
+
return o1 === o2;
|
|
3322
|
+
}
|
|
3323
|
+
return o1.label === o2.label && o1.value === o2.value;
|
|
3324
|
+
}
|
|
3325
|
+
_isSameSelectValue(left, right) {
|
|
3326
|
+
return left.value === right.value && left.label === right.label;
|
|
3327
|
+
}
|
|
3328
|
+
_toSearchText(value) {
|
|
3329
|
+
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ? String(value) : '';
|
|
3261
3330
|
}
|
|
3262
3331
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3263
3332
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatSelectTypeComponent, isStandalone: true, selector: "cmat-select-search-type", usesInheritance: true, ngImport: i0, template: "@if(props.multiple){\r\n<mat-select #multiSelect multiple [id]=\"id\" [formControl]=\"formControl\" [placeholder]=\"props.placeholder??''\"\r\n [required]=\"required\" [tabIndex]=\"props.tabindex\" [compareWith]=\"compareWithFn\"\r\n [errorStateMatcher]=\"errorStateMatcher\" [aria-label]=\"getAriaLabel()\" [aria-labelledby]=\"getAriaLabelledby()\"\r\n [disableOptionCentering]=\"props.disableOptionCentering\"\r\n [typeaheadDebounceInterval]=\"props.typeaheadDebounceInterval\"\r\n [panelClass]=\"'overflow-y-auto scrollbar-custom'\">\r\n @if ((filteredCustomDetails | async); as customDetails) {\r\n @if (props.search) {\r\n <mat-option>\r\n <cmat-select-search [formControl]=\"multiFilterCtrl\" [showToggleAllCheckbox]=\"props.showToggleAllCheckbox\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @if (customDetails?.length!==0&&props.canNull&&!props.multiple) {\r\n <mat-option>\u7A7A</mat-option>\r\n }\r\n @for (i of customDetails; track $index) {\r\n @if(i.label){\r\n @if(i.group){\r\n <mat-optgroup [label]=\"i.label\">\r\n @for (child of i.group; track $index) {\r\n <mat-option [value]=\"child\" [disabled]=\"child.disabled\">\r\n {{ child.label }}\r\n </mat-option>\r\n }\r\n </mat-optgroup>\r\n }@else {\r\n <mat-option [value]=\"i\" [disabled]=\"i.disabled\">{{i.label}}</mat-option>\r\n }\r\n }@else {\r\n <mat-option [value]=\"i\">{{i}}</mat-option>\r\n }\r\n }\r\n }\r\n</mat-select>\r\n}@else {\r\n<mat-select #multiSelect [id]=\"id\" [formControl]=\"formControl\" [placeholder]=\"props.placeholder??''\"\r\n [required]=\"required\" [tabIndex]=\"props.tabindex\" [compareWith]=\"compareWithFn\"\r\n [errorStateMatcher]=\"errorStateMatcher\" [aria-label]=\"getAriaLabel()\" [aria-labelledby]=\"getAriaLabelledby()\"\r\n [disableOptionCentering]=\"props.disableOptionCentering\"\r\n [typeaheadDebounceInterval]=\"props.typeaheadDebounceInterval\"\r\n [panelClass]=\"'overflow-y-auto scrollbar-custom'\">\r\n @if ((filteredCustomDetails | async); as customDetails) {\r\n @if (props.search) {\r\n <mat-option>\r\n <cmat-select-search [formControl]=\"multiFilterCtrl\" [showToggleAllCheckbox]=\"props.showToggleAllCheckbox\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @if (customDetails?.length!==0&&props.canNull&&!props.multiple) {\r\n <mat-option>\u7A7A</mat-option>\r\n }\r\n @for (i of customDetails; track $index) {\r\n @if(i.label){\r\n @if(i.group){\r\n <mat-optgroup [label]=\"i.label\">\r\n @for (child of i.group; track $index) {\r\n <mat-option [value]=\"child\" [disabled]=\"child.disabled\">\r\n {{ child.label }}\r\n </mat-option>\r\n }\r\n </mat-optgroup>\r\n }@else {\r\n <mat-option [value]=\"i\" [disabled]=\"i.disabled\">{{i.label}}</mat-option>\r\n }\r\n }@else {\r\n <mat-option [value]=\"i\">{{i}}</mat-option>\r\n }\r\n }\r\n }\r\n</mat-select>\r\n}", styles: [":host{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$3.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: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i3.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "component", type: CmatSelectSearchComponent$1, selector: "cmat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "showNoFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"], exportAs: ["cmatSelectSearch"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -3290,9 +3359,11 @@ class CmatSelectTreeTypeComponent extends FieldType$1 {
|
|
|
3290
3359
|
if (url && this.field.props?.domain?.code && this.field.props?.domain?.key && this.field.props?.domain?.value) {
|
|
3291
3360
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
3292
3361
|
if (data) {
|
|
3362
|
+
const key = this.field.props?.domain?.key;
|
|
3363
|
+
const code = this.field.props?.domain?.code;
|
|
3293
3364
|
const datas = data.filter((i) => {
|
|
3294
|
-
if (
|
|
3295
|
-
return i[
|
|
3365
|
+
if (key)
|
|
3366
|
+
return i[key] === code;
|
|
3296
3367
|
return false;
|
|
3297
3368
|
});
|
|
3298
3369
|
if (datas && this.field.props?.domain?.value) {
|
|
@@ -3342,9 +3413,11 @@ class CmatSelectTableTypeComponent extends FieldType$1 {
|
|
|
3342
3413
|
if (url && this.field.props?.domain?.code && this.field.props?.domain?.key && this.field.props?.domain?.value) {
|
|
3343
3414
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
3344
3415
|
if (data) {
|
|
3416
|
+
const key = this.field.props?.domain?.key;
|
|
3417
|
+
const code = this.field.props?.domain?.code;
|
|
3345
3418
|
const datas = data.filter((i) => {
|
|
3346
|
-
if (
|
|
3347
|
-
return i[
|
|
3419
|
+
if (key)
|
|
3420
|
+
return i[key] === code;
|
|
3348
3421
|
return false;
|
|
3349
3422
|
});
|
|
3350
3423
|
if (datas && this.field.props?.domain?.value) {
|
|
@@ -3424,18 +3497,24 @@ class CmatTableTypeComponent extends FieldArrayType {
|
|
|
3424
3497
|
this._viewContainerRef = inject(ViewContainerRef);
|
|
3425
3498
|
}
|
|
3426
3499
|
get fieldArray() {
|
|
3427
|
-
return this.
|
|
3500
|
+
return this._fieldModel.fieldArray?.fieldGroup ?? [];
|
|
3428
3501
|
}
|
|
3429
3502
|
get key() {
|
|
3430
|
-
return this.
|
|
3503
|
+
return this._fieldModel.fieldArray?.fieldGroup?.[0]?.id ?? '';
|
|
3504
|
+
}
|
|
3505
|
+
get _tableProps() {
|
|
3506
|
+
return this.props;
|
|
3507
|
+
}
|
|
3508
|
+
get _fieldModel() {
|
|
3509
|
+
return this.field;
|
|
3431
3510
|
}
|
|
3432
3511
|
ngOnInit() {
|
|
3433
|
-
this.columns = this.
|
|
3434
|
-
filter(field => field.props?.showColumn).map(field => ({
|
|
3435
|
-
key: field.key,
|
|
3512
|
+
this.columns = (this._fieldModel.fieldArray?.fieldGroup?.[0]?.fieldGroup ?? [])
|
|
3513
|
+
.filter(field => field.props?.showColumn).map(field => ({
|
|
3514
|
+
key: String(field.key ?? ''),
|
|
3436
3515
|
label: field.props?.label ?? '',
|
|
3437
3516
|
}));
|
|
3438
|
-
if (this.
|
|
3517
|
+
if (this._tableProps.disabled) {
|
|
3439
3518
|
this.displayedColumns = [...this.columns.map(column => column.key)];
|
|
3440
3519
|
}
|
|
3441
3520
|
else {
|
|
@@ -3477,11 +3556,13 @@ class CmatTableTypeComponent extends FieldArrayType {
|
|
|
3477
3556
|
this.inlineform.markAllAsTouched();
|
|
3478
3557
|
return;
|
|
3479
3558
|
}
|
|
3480
|
-
|
|
3481
|
-
|
|
3559
|
+
const model = this.model;
|
|
3560
|
+
const currentValue = this.currentMode[this.key];
|
|
3561
|
+
if (this.dialogType === 'add' && currentValue) {
|
|
3562
|
+
this.add(model?.length ?? 0, currentValue);
|
|
3482
3563
|
}
|
|
3483
|
-
else if (this.dialogType
|
|
3484
|
-
|
|
3564
|
+
else if (this.dialogType === 'edit' && currentValue && model) {
|
|
3565
|
+
model[this.currentIndex] = currentValue;
|
|
3485
3566
|
}
|
|
3486
3567
|
this.table.renderRows();
|
|
3487
3568
|
this.refreshVersion.update(value => value + 1);
|
|
@@ -3514,6 +3595,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
3514
3595
|
class CmatTagsTypeComponent extends FieldType {
|
|
3515
3596
|
constructor() {
|
|
3516
3597
|
super();
|
|
3598
|
+
this.urlData = [];
|
|
3599
|
+
this.optionsData = [];
|
|
3517
3600
|
this.refreshVersion = signal(0, ...(ngDevMode ? [{ debugName: "refreshVersion" }] : /* istanbul ignore next */ []));
|
|
3518
3601
|
this._http = inject(HttpClient);
|
|
3519
3602
|
this._overlay = inject(Overlay);
|
|
@@ -3543,13 +3626,15 @@ class CmatTagsTypeComponent extends FieldType {
|
|
|
3543
3626
|
if (url && this.field.props?.domain?.code && this.field.props?.domain?.key && this.field.props?.domain?.value) {
|
|
3544
3627
|
this._http.get(url).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((data) => {
|
|
3545
3628
|
if (data) {
|
|
3629
|
+
const key = this.field.props?.domain?.key;
|
|
3630
|
+
const code = this.field.props?.domain?.code;
|
|
3546
3631
|
const datas = data.filter((i) => {
|
|
3547
|
-
if (
|
|
3548
|
-
return i[
|
|
3632
|
+
if (key)
|
|
3633
|
+
return i[key] === code;
|
|
3549
3634
|
return false;
|
|
3550
3635
|
});
|
|
3551
3636
|
if (datas && this.field.props?.domain?.value) {
|
|
3552
|
-
this.urlData = datas[0][this.field.props?.domain?.value];
|
|
3637
|
+
this.urlData = datas[0][this.field.props?.domain?.value] ?? [];
|
|
3553
3638
|
}
|
|
3554
3639
|
else {
|
|
3555
3640
|
this.urlData = [];
|
|
@@ -3604,8 +3689,8 @@ class CmatTagsTypeComponent extends FieldType {
|
|
|
3604
3689
|
});
|
|
3605
3690
|
}
|
|
3606
3691
|
filterTags(event) {
|
|
3607
|
-
const value = event.target
|
|
3608
|
-
this._filteredItems.set(this.tags.filter(tag => tag.label
|
|
3692
|
+
const value = (event.target?.value ?? '').toLowerCase();
|
|
3693
|
+
this._filteredItems.set(this.tags.filter((tag) => this._toSearchText(tag.label).toLowerCase().includes(value) || this._toSearchText(tag.value).toLowerCase().includes(value)));
|
|
3609
3694
|
}
|
|
3610
3695
|
toggleTag(tag) {
|
|
3611
3696
|
if (tag.disabled)
|
|
@@ -3622,7 +3707,10 @@ class CmatTagsTypeComponent extends FieldType {
|
|
|
3622
3707
|
this.refreshVersion.update(value => value + 1);
|
|
3623
3708
|
}
|
|
3624
3709
|
isCheck(tag) {
|
|
3625
|
-
return this.formControl.value?.filter((i) => i.value === tag.value).length > 0;
|
|
3710
|
+
return (this.formControl.value?.filter((i) => i.value === tag.value).length ?? 0) > 0;
|
|
3711
|
+
}
|
|
3712
|
+
_toSearchText(value) {
|
|
3713
|
+
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ? String(value) : '';
|
|
3626
3714
|
}
|
|
3627
3715
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTagsTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3628
3716
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatTagsTypeComponent, isStandalone: true, selector: "cmat-tags-type", viewQueries: [{ propertyName: "_tagsPanelOrigin", first: true, predicate: ["tagsPanelOrigin"], descendants: true }, { propertyName: "_tagsPanel", first: true, predicate: ["tagsPanel"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"text-lg mb-2\">\r\n {{ props.label }}\r\n @if(props.required){\r\n <span>*</span>\r\n }\r\n</div>\r\n<div class=\"flex flex-wrap items-center -m-2\" [attr.data-refresh]=\"refreshVersion()\" [tabIndex]=\"props.tabindex\">\r\n <ng-container>\r\n @for (selectedItem of formControl.value; track $index) {\r\n <div\r\n class=\"flex items-center justify-center px-4 m-1.5 rounded-full leading-9 text-gray-500 bg-slate-100 dark:text-gray-300 dark:bg-slate-700\">\r\n <span class=\"text-md font-medium whitespace-nowrap\">{{selectedItem.label}}</span>\r\n </div>\r\n }\r\n\r\n <div #tagsPanelOrigin\r\n class=\"flex items-center justify-center px-4 m-1.5 rounded-full leading-9 cursor-pointer text-gray-500 bg-slate-100 dark:text-gray-300 dark:bg-slate-700 print:hidden\" role=\"presentation\" (click)=\"openTagsPanel()\">\r\n\r\n @if(formControl.value?.length&&!disabled){\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:pencil-square'\"></mat-icon>\r\n <span class=\"ml-1.5 text-md font-medium whitespace-nowrap\">\u7F16\u8F91</span>\r\n }\r\n\r\n @if(!formControl.value?.length&&!disabled){\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:plus-circle'\"></mat-icon>\r\n <span class=\"ml-1.5 text-md font-medium whitespace-nowrap\">\u65B0\u589E</span>\r\n }\r\n\r\n <ng-template #tagsPanel>\r\n <div class=\"w-60 rounded-sm border shadow-md bg-card\">\r\n <div class=\"flex items-center m-3 mr-2\">\r\n <div class=\"flex items-center\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:magnifying-glass'\">\r\n </mat-icon>\r\n <div class=\"ml-2\">\r\n <input class=\"w-full min-w-0 py-1 border-none\" type=\"text\" placeholder=\"\u8F93\u5165\u6807\u7B7E\u540D\"\r\n [maxLength]=\"30\" (input)=\"filterTags($event)\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"flex flex-col max-h-64 py-2 border-t overflow-y-auto scrollbar-custom\">\r\n @if ((filteredItems$ | async); as filteredItems) {\r\n @if(filteredItems.length>0){\r\n @for (tag of filteredItems; track $index) {\r\n <div role=\"presentation\"\r\n class=\"flex items-center h-10 min-h-10 pl-1 pr-4 cursor-pointer hover:bg-hover\"\r\n matRipple (click)=\"toggleTag(tag)\">\r\n <mat-checkbox class=\"flex items-center h-10 min-h-10\" [color]=\"'primary'\"\r\n [disabled]=\"tag.disabled\" [checked]=\"isCheck(tag)\">\r\n {{tag.label}}\r\n </mat-checkbox>\r\n </div>\r\n }\r\n }@else {\r\n <div class=\"flex flex-auto flex-col justify-center px-4 h-10 min-h-10\">\r\n \u65E0\u7ED3\u679C\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$9.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: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -3680,13 +3768,13 @@ class CmatUploadTypeComponent extends FieldType {
|
|
|
3680
3768
|
}
|
|
3681
3769
|
}
|
|
3682
3770
|
upload(id) {
|
|
3683
|
-
|
|
3771
|
+
const rootValue = this.baseGroup.get('uploadId')?.value;
|
|
3684
3772
|
if (rootValue && !isNil(id)) {
|
|
3685
3773
|
this.baseGroup.get('uploadId')?.setValue([id, ...rootValue]);
|
|
3686
3774
|
}
|
|
3687
3775
|
}
|
|
3688
3776
|
remove(id) {
|
|
3689
|
-
|
|
3777
|
+
const rootValue = this.baseGroup.get('removeId')?.value;
|
|
3690
3778
|
if (rootValue && !isNil(id)) {
|
|
3691
3779
|
this.baseGroup.get('removeId')?.setValue([id, ...rootValue]);
|
|
3692
3780
|
}
|
|
@@ -3694,12 +3782,12 @@ class CmatUploadTypeComponent extends FieldType {
|
|
|
3694
3782
|
updateData(i) {
|
|
3695
3783
|
const data = Array.isArray(i) ? i : [i];
|
|
3696
3784
|
this.formControl.setValue(data.map((j) => {
|
|
3697
|
-
if (j.id)
|
|
3785
|
+
if (typeof j === 'object' && j !== null && 'id' in j && typeof j.id === 'string')
|
|
3698
3786
|
return {
|
|
3699
|
-
id: j.id,
|
|
3700
|
-
name: j.name,
|
|
3701
|
-
type: j.type,
|
|
3702
|
-
size: j.size
|
|
3787
|
+
id: String((j).id),
|
|
3788
|
+
name: typeof j.name === 'string' ? j.name : '',
|
|
3789
|
+
type: typeof j.type === 'string' ? j.type : '',
|
|
3790
|
+
size: Number(j.size ?? 0)
|
|
3703
3791
|
};
|
|
3704
3792
|
else
|
|
3705
3793
|
return j;
|
|
@@ -3739,7 +3827,7 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
3739
3827
|
image: this._imgFileHandler.bind(this),
|
|
3740
3828
|
video: this._videoFileHandler.bind(this),
|
|
3741
3829
|
word: () => {
|
|
3742
|
-
this._wordFileHandler().catch(err => console.error('Word 导出失败:', err));
|
|
3830
|
+
this._wordFileHandler().catch((err) => console.error('Word 导出失败:', err));
|
|
3743
3831
|
},
|
|
3744
3832
|
},
|
|
3745
3833
|
},
|
|
@@ -3781,6 +3869,9 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
3781
3869
|
}
|
|
3782
3870
|
}
|
|
3783
3871
|
fileChangeEvent(file) {
|
|
3872
|
+
if (!file) {
|
|
3873
|
+
return;
|
|
3874
|
+
}
|
|
3784
3875
|
const fileModel = {
|
|
3785
3876
|
id: null,
|
|
3786
3877
|
fileName: file.name,
|
|
@@ -3797,12 +3888,16 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
3797
3888
|
formData.append('fileInfo', JSON.stringify(fileModel));
|
|
3798
3889
|
this._fileService.uploadFile(formData).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
|
|
3799
3890
|
if (event.type === HttpEventType.Response) {
|
|
3800
|
-
|
|
3891
|
+
const fileId = typeof event.body?.id === 'string' ? event.body.id : undefined;
|
|
3892
|
+
if (typeof fileId !== 'string') {
|
|
3893
|
+
return;
|
|
3894
|
+
}
|
|
3895
|
+
this._editorInstance.insertEmbed(this._editorInstance.getSelection(true).index, this._getMediaType(file.type), `${this._config.fileUrl}/download/quill/${fileId}`);
|
|
3801
3896
|
this._editorInstance.setSelection(this._editorInstance.getSelection(true).index + 1);
|
|
3802
3897
|
this.formControl.setValue(this._editorInstance.container.innerHTML);
|
|
3803
|
-
this._upload(
|
|
3898
|
+
this._upload(fileId);
|
|
3804
3899
|
}
|
|
3805
|
-
this.refreshVersion.update(value => value + 1);
|
|
3900
|
+
this.refreshVersion.update((value) => value + 1);
|
|
3806
3901
|
});
|
|
3807
3902
|
}
|
|
3808
3903
|
editorCreated(editorInstance) {
|
|
@@ -3816,20 +3911,20 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
3816
3911
|
}
|
|
3817
3912
|
});
|
|
3818
3913
|
}
|
|
3819
|
-
contentChanged(
|
|
3914
|
+
contentChanged(contentChange) {
|
|
3820
3915
|
const dom = document.createElement('DIV');
|
|
3821
|
-
dom.innerHTML =
|
|
3916
|
+
dom.innerHTML = contentChange.editor.container.innerHTML;
|
|
3822
3917
|
const fileDom = dom.querySelectorAll('img, video');
|
|
3823
3918
|
const arr = [];
|
|
3824
3919
|
fileDom.forEach((i) => {
|
|
3825
3920
|
if (i.src.includes(this._config.fileUrl)) {
|
|
3826
3921
|
const id = i.src.substring(`${this._config.fileUrl}/download/quill/`.length, i.src.length);
|
|
3827
|
-
this._imgIds.splice(this._imgIds.findIndex(k => k === id), 1);
|
|
3922
|
+
this._imgIds.splice(this._imgIds.findIndex((k) => k === id), 1);
|
|
3828
3923
|
arr.push(id);
|
|
3829
3924
|
}
|
|
3830
3925
|
});
|
|
3831
3926
|
this._imgIds.forEach((i) => {
|
|
3832
|
-
|
|
3927
|
+
const rootValue = this.baseGroup.get('removeId')?.value;
|
|
3833
3928
|
if (rootValue && !isNil(i)) {
|
|
3834
3929
|
this.baseGroup.get('removeId')?.setValue([i, ...rootValue]);
|
|
3835
3930
|
}
|
|
@@ -3865,7 +3960,7 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
3865
3960
|
let currentListLevel = 0;
|
|
3866
3961
|
let isList = false;
|
|
3867
3962
|
for (const op of delta.ops) {
|
|
3868
|
-
if (op.insert?.image) {
|
|
3963
|
+
if (typeof op.insert !== 'string' && op.insert?.image) {
|
|
3869
3964
|
if (currentRun.length > 0) {
|
|
3870
3965
|
children.push(new Paragraph({ children: currentRun }));
|
|
3871
3966
|
currentRun = [];
|
|
@@ -3903,7 +3998,7 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
3903
3998
|
}
|
|
3904
3999
|
}
|
|
3905
4000
|
if (currentRun.length > 0) {
|
|
3906
|
-
children.push(this._createParagraph(currentRun,
|
|
4001
|
+
children.push(this._createParagraph(currentRun, undefined, isList, currentListLevel));
|
|
3907
4002
|
}
|
|
3908
4003
|
return children;
|
|
3909
4004
|
}
|
|
@@ -3916,25 +4011,23 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
3916
4011
|
size: this._mapFontSize(attributes?.size),
|
|
3917
4012
|
font: attributes?.font ?? undefined,
|
|
3918
4013
|
color: attributes?.color ? this._parseColor(attributes.color) : undefined,
|
|
3919
|
-
highlight: attributes?.background ? this.
|
|
4014
|
+
highlight: attributes?.background ? this._mapHighlightColor(attributes.background) : undefined
|
|
3920
4015
|
});
|
|
3921
4016
|
}
|
|
3922
4017
|
_createParagraph(runs, attributes, isList, listLevel) {
|
|
4018
|
+
const headerLevel = attributes?.header ? (typeof attributes.header === 'number' ? attributes.header : parseInt(attributes.header)) : undefined;
|
|
3923
4019
|
const paragraphOptions = {
|
|
3924
4020
|
children: runs,
|
|
3925
4021
|
alignment: this._mapAlignment(attributes?.align),
|
|
4022
|
+
...(headerLevel && headerLevel >= 1 && headerLevel <= 6 ? {
|
|
4023
|
+
heading: HeadingLevel[`HEADING_${headerLevel}`]
|
|
4024
|
+
} : {}),
|
|
4025
|
+
...(isList && attributes?.list ? {
|
|
4026
|
+
bullet: {
|
|
4027
|
+
level: listLevel ?? 0
|
|
4028
|
+
}
|
|
4029
|
+
} : {})
|
|
3926
4030
|
};
|
|
3927
|
-
if (attributes?.header) {
|
|
3928
|
-
const headerLevel = parseInt(attributes.header);
|
|
3929
|
-
if (headerLevel >= 1 && headerLevel <= 6) {
|
|
3930
|
-
paragraphOptions.heading = HeadingLevel[`HEADING_${headerLevel}`];
|
|
3931
|
-
}
|
|
3932
|
-
}
|
|
3933
|
-
if (isList && attributes?.list) {
|
|
3934
|
-
paragraphOptions.bullet = {
|
|
3935
|
-
level: listLevel ?? 0
|
|
3936
|
-
};
|
|
3937
|
-
}
|
|
3938
4031
|
return new Paragraph(paragraphOptions);
|
|
3939
4032
|
}
|
|
3940
4033
|
async _createImageRun(imageUrl) {
|
|
@@ -4046,11 +4139,47 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
4046
4139
|
}
|
|
4047
4140
|
return undefined;
|
|
4048
4141
|
}
|
|
4049
|
-
|
|
4142
|
+
_mapHighlightColor(color) {
|
|
4143
|
+
const hex = this._parseColor(color);
|
|
4144
|
+
if (!hex)
|
|
4145
|
+
return HighlightColor.NONE;
|
|
4146
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
4147
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
4148
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
4149
|
+
const colorMap = {
|
|
4150
|
+
[HighlightColor.YELLOW]: [255, 255, 0],
|
|
4151
|
+
[HighlightColor.GREEN]: [0, 128, 0],
|
|
4152
|
+
[HighlightColor.CYAN]: [0, 255, 255],
|
|
4153
|
+
[HighlightColor.RED]: [255, 0, 0],
|
|
4154
|
+
[HighlightColor.BLUE]: [0, 0, 255],
|
|
4155
|
+
[HighlightColor.MAGENTA]: [255, 0, 255],
|
|
4156
|
+
[HighlightColor.DARK_BLUE]: [0, 0, 139],
|
|
4157
|
+
[HighlightColor.DARK_CYAN]: [0, 139, 139],
|
|
4158
|
+
[HighlightColor.DARK_GREEN]: [0, 100, 0],
|
|
4159
|
+
[HighlightColor.DARK_MAGENTA]: [139, 0, 139],
|
|
4160
|
+
[HighlightColor.DARK_RED]: [139, 0, 0],
|
|
4161
|
+
[HighlightColor.DARK_YELLOW]: [128, 128, 0],
|
|
4162
|
+
[HighlightColor.DARK_GRAY]: [169, 169, 169],
|
|
4163
|
+
[HighlightColor.LIGHT_GRAY]: [211, 211, 211],
|
|
4164
|
+
[HighlightColor.BLACK]: [0, 0, 0],
|
|
4165
|
+
[HighlightColor.WHITE]: [255, 255, 255],
|
|
4166
|
+
};
|
|
4167
|
+
let closestColor = HighlightColor.NONE;
|
|
4168
|
+
let minDistance = Infinity;
|
|
4169
|
+
for (const [name, [cr, cg, cb]] of Object.entries(colorMap)) {
|
|
4170
|
+
const distance = (r - cr) ** 2 + (g - cg) ** 2 + (b - cb) ** 2;
|
|
4171
|
+
if (distance < minDistance) {
|
|
4172
|
+
minDistance = distance;
|
|
4173
|
+
closestColor = name;
|
|
4174
|
+
}
|
|
4175
|
+
}
|
|
4176
|
+
return closestColor;
|
|
4177
|
+
}
|
|
4178
|
+
_dropFileHandler(_dataUrl, _type, fileData) {
|
|
4050
4179
|
this.fileChangeEvent(fileData.toFile());
|
|
4051
4180
|
}
|
|
4052
4181
|
_upload(id) {
|
|
4053
|
-
|
|
4182
|
+
const rootValue = this.baseGroup.get('uploadId')?.value;
|
|
4054
4183
|
if (rootValue && !isNil(id)) {
|
|
4055
4184
|
this.baseGroup.get('uploadId')?.setValue([id, ...rootValue]);
|
|
4056
4185
|
}
|
|
@@ -4079,11 +4208,11 @@ class CmatQuillTypeComponent extends FieldType {
|
|
|
4079
4208
|
return baseControl;
|
|
4080
4209
|
}
|
|
4081
4210
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatQuillTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4082
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: CmatQuillTypeComponent, isStandalone: true, selector: "cmat-quill-type", viewQueries: [{ propertyName: "imgInput", first: true, predicate: ["imgInput"], descendants: true }, { propertyName: "videoInput", first: true, predicate: ["videoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<quill-editor class=\"w-full\" defaultEmptyValue=\"\" [formControl]=\"formControl\" [required]=\"required\" [placeholder]=\"placeholder\" [tabindex]=\"props.tabindex\"\r\n [readOnly]=\"disabled\" [modules]=\"quillModules\" (onEditorCreated)=\"editorCreated($event)\"\r\n (onContentChanged)=\"contentChanged($event)\">\r\n \r\n <input #imgInput type=\"file\" accept=\"image/png,image/jpeg,image/jpg,image/gif\" class=\"hidden\" (change)=\"fileChangeEvent(imgInput.files?.[0])\" />\r\n <input #videoInput type=\"file\" accept=\"video/mpeg,video/mp4,audio/mp4\" class=\"hidden\" (change)=\"fileChangeEvent(videoInput.files?.[0])\" />\r\n</quill-editor>\r\n<div class=\"cmat-quill-type\" [attr.data-refresh]=\"refreshVersion()\">\r\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: QuillModule }, { kind: "component", type: i2$5.QuillEditorComponent, selector: "quill-editor" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4211
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: CmatQuillTypeComponent, isStandalone: true, selector: "cmat-quill-type", viewQueries: [{ propertyName: "imgInput", first: true, predicate: ["imgInput"], descendants: true }, { propertyName: "videoInput", first: true, predicate: ["videoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<quill-editor class=\"w-full\" defaultEmptyValue=\"\" [formControl]=\"formControl\" [required]=\"required\" [placeholder]=\"placeholder\" [tabindex]=\"props.tabindex\"\r\n [readOnly]=\"disabled\" [modules]=\"quillModules\" (onEditorCreated)=\"editorCreated($event)\"\r\n (onContentChanged)=\"contentChanged($event)\">\r\n \r\n <input #imgInput type=\"file\" accept=\"image/png,image/jpeg,image/jpg,image/gif\" class=\"hidden\" (change)=\"fileChangeEvent(imgInput.files?.[0] ?? undefined)\" />\r\n <input #videoInput type=\"file\" accept=\"video/mpeg,video/mp4,audio/mp4\" class=\"hidden\" (change)=\"fileChangeEvent(videoInput.files?.[0] ?? undefined)\" />\r\n</quill-editor>\r\n<div class=\"cmat-quill-type\" [attr.data-refresh]=\"refreshVersion()\">\r\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: QuillModule }, { kind: "component", type: i2$5.QuillEditorComponent, selector: "quill-editor" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4083
4212
|
}
|
|
4084
4213
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatQuillTypeComponent, decorators: [{
|
|
4085
4214
|
type: Component,
|
|
4086
|
-
args: [{ selector: 'cmat-quill-type', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ReactiveFormsModule, QuillModule], template: "<quill-editor class=\"w-full\" defaultEmptyValue=\"\" [formControl]=\"formControl\" [required]=\"required\" [placeholder]=\"placeholder\" [tabindex]=\"props.tabindex\"\r\n [readOnly]=\"disabled\" [modules]=\"quillModules\" (onEditorCreated)=\"editorCreated($event)\"\r\n (onContentChanged)=\"contentChanged($event)\">\r\n \r\n <input #imgInput type=\"file\" accept=\"image/png,image/jpeg,image/jpg,image/gif\" class=\"hidden\" (change)=\"fileChangeEvent(imgInput.files?.[0])\" />\r\n <input #videoInput type=\"file\" accept=\"video/mpeg,video/mp4,audio/mp4\" class=\"hidden\" (change)=\"fileChangeEvent(videoInput.files?.[0])\" />\r\n</quill-editor>\r\n<div class=\"cmat-quill-type\" [attr.data-refresh]=\"refreshVersion()\">\r\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
4215
|
+
args: [{ selector: 'cmat-quill-type', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ReactiveFormsModule, QuillModule], template: "<quill-editor class=\"w-full\" defaultEmptyValue=\"\" [formControl]=\"formControl\" [required]=\"required\" [placeholder]=\"placeholder\" [tabindex]=\"props.tabindex\"\r\n [readOnly]=\"disabled\" [modules]=\"quillModules\" (onEditorCreated)=\"editorCreated($event)\"\r\n (onContentChanged)=\"contentChanged($event)\">\r\n \r\n <input #imgInput type=\"file\" accept=\"image/png,image/jpeg,image/jpg,image/gif\" class=\"hidden\" (change)=\"fileChangeEvent(imgInput.files?.[0] ?? undefined)\" />\r\n <input #videoInput type=\"file\" accept=\"video/mpeg,video/mp4,audio/mp4\" class=\"hidden\" (change)=\"fileChangeEvent(videoInput.files?.[0] ?? undefined)\" />\r\n</quill-editor>\r\n<div class=\"cmat-quill-type\" [attr.data-refresh]=\"refreshVersion()\">\r\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
4087
4216
|
}], ctorParameters: () => [], propDecorators: { imgInput: [{
|
|
4088
4217
|
type: ViewChild,
|
|
4089
4218
|
args: ['imgInput']
|
|
@@ -4143,13 +4272,14 @@ class CmatDateRangeComponent {
|
|
|
4143
4272
|
this.initData = true;
|
|
4144
4273
|
this.rangeChanged = new EventEmitter();
|
|
4145
4274
|
this.activeDates = {
|
|
4146
|
-
month1:
|
|
4147
|
-
month2:
|
|
4275
|
+
month1: dayjs(),
|
|
4276
|
+
month2: dayjs().add(1, 'month')
|
|
4148
4277
|
};
|
|
4149
4278
|
this.refreshVersion = signal(0, ...(ngDevMode ? [{ debugName: "refreshVersion" }] : /* istanbul ignore next */ []));
|
|
4150
4279
|
this.setWhichDate = 'start';
|
|
4151
4280
|
this._overlay = inject(Overlay);
|
|
4152
4281
|
this._viewContainerRef = inject(ViewContainerRef);
|
|
4282
|
+
this._overlayRef = null;
|
|
4153
4283
|
this._range = {
|
|
4154
4284
|
start: null,
|
|
4155
4285
|
end: null
|
|
@@ -4200,8 +4330,8 @@ class CmatDateRangeComponent {
|
|
|
4200
4330
|
this._timeRange = value;
|
|
4201
4331
|
if (!value && this._range?.start && this._range?.end) {
|
|
4202
4332
|
this.range = {
|
|
4203
|
-
start: this._range.start.clone().startOf('day'),
|
|
4204
|
-
end: this._range.end.clone().endOf('day')
|
|
4333
|
+
start: this._range.start.clone().startOf('day').toISOString(),
|
|
4334
|
+
end: this._range.end.clone().endOf('day').toISOString()
|
|
4205
4335
|
};
|
|
4206
4336
|
}
|
|
4207
4337
|
}
|
|
@@ -4265,7 +4395,7 @@ class CmatDateRangeComponent {
|
|
|
4265
4395
|
};
|
|
4266
4396
|
this.rangeChanged.emit(range);
|
|
4267
4397
|
if (!this._programmaticChange) {
|
|
4268
|
-
this._onTouched(
|
|
4398
|
+
this._onTouched();
|
|
4269
4399
|
this._onChange(range);
|
|
4270
4400
|
}
|
|
4271
4401
|
this.activeDates = {
|
|
@@ -4296,6 +4426,10 @@ class CmatDateRangeComponent {
|
|
|
4296
4426
|
this._init();
|
|
4297
4427
|
}
|
|
4298
4428
|
ngOnDestroy() {
|
|
4429
|
+
if (this._overlayRef) {
|
|
4430
|
+
this._overlayRef.dispose();
|
|
4431
|
+
this._overlayRef = null;
|
|
4432
|
+
}
|
|
4299
4433
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4300
4434
|
this.writeValue = () => { };
|
|
4301
4435
|
}
|
|
@@ -4326,6 +4460,7 @@ class CmatDateRangeComponent {
|
|
|
4326
4460
|
}
|
|
4327
4461
|
])
|
|
4328
4462
|
});
|
|
4463
|
+
this._overlayRef = overlayRef;
|
|
4329
4464
|
const templatePortal = new TemplatePortal(this._pickerPanel, this._viewContainerRef);
|
|
4330
4465
|
overlayRef.backdropClick().subscribe(() => {
|
|
4331
4466
|
if (templatePortal?.isAttached) {
|
|
@@ -4335,14 +4470,15 @@ class CmatDateRangeComponent {
|
|
|
4335
4470
|
overlayRef.detach();
|
|
4336
4471
|
overlayRef.dispose();
|
|
4337
4472
|
}
|
|
4473
|
+
this._overlayRef = null;
|
|
4338
4474
|
});
|
|
4339
4475
|
overlayRef.attach(templatePortal);
|
|
4340
4476
|
}
|
|
4341
4477
|
getMonthLabel(month) {
|
|
4342
4478
|
if (month === 1) {
|
|
4343
|
-
return this.activeDates.month1?.clone().format('YYYY MMMM');
|
|
4479
|
+
return this.activeDates.month1?.clone().format('YYYY MMMM') ?? '';
|
|
4344
4480
|
}
|
|
4345
|
-
return this.activeDates.month2?.clone().format('YYYY MMMM');
|
|
4481
|
+
return this.activeDates.month2?.clone().format('YYYY MMMM') ?? '';
|
|
4346
4482
|
}
|
|
4347
4483
|
dateClass() {
|
|
4348
4484
|
return (date) => {
|
|
@@ -4360,13 +4496,15 @@ class CmatDateRangeComponent {
|
|
|
4360
4496
|
if (date.isBetween(start, end, 'day')) {
|
|
4361
4497
|
return ['cmat-date-range', 'cmat-date-range-mid'];
|
|
4362
4498
|
}
|
|
4363
|
-
return
|
|
4499
|
+
return [];
|
|
4364
4500
|
};
|
|
4365
4501
|
}
|
|
4366
4502
|
dateFilter() {
|
|
4367
4503
|
return (date) => !(this.setWhichDate === 'end' && date.isBefore(this._range.start, 'day'));
|
|
4368
4504
|
}
|
|
4369
4505
|
onSelectedDateChange(date) {
|
|
4506
|
+
if (!date)
|
|
4507
|
+
return;
|
|
4370
4508
|
const newRange = {
|
|
4371
4509
|
start: dayjs().toISOString(),
|
|
4372
4510
|
end: dayjs().toISOString(),
|
|
@@ -4392,7 +4530,7 @@ class CmatDateRangeComponent {
|
|
|
4392
4530
|
this.activeDates.month2 = dayjs(this.activeDates.month2).add(1, 'month');
|
|
4393
4531
|
}
|
|
4394
4532
|
updateStartTime(event) {
|
|
4395
|
-
const parsedTime = this._parseTime(event.target
|
|
4533
|
+
const parsedTime = this._parseTime(event.target?.value ?? '');
|
|
4396
4534
|
if (this.startTimeFormControl.invalid) {
|
|
4397
4535
|
if (this._range.start) {
|
|
4398
4536
|
const time = this._range.start.clone().format(this._timeFormat);
|
|
@@ -4416,7 +4554,7 @@ class CmatDateRangeComponent {
|
|
|
4416
4554
|
}
|
|
4417
4555
|
}
|
|
4418
4556
|
updateEndTime(event) {
|
|
4419
|
-
const parsedTime = this._parseTime(event.target
|
|
4557
|
+
const parsedTime = this._parseTime(event.target?.value ?? '');
|
|
4420
4558
|
if (this.endTimeFormControl.invalid) {
|
|
4421
4559
|
if (this._range.end) {
|
|
4422
4560
|
const time = this._range.end.clone().format(this._timeFormat);
|
|
@@ -4450,7 +4588,7 @@ class CmatDateRangeComponent {
|
|
|
4450
4588
|
};
|
|
4451
4589
|
}
|
|
4452
4590
|
else {
|
|
4453
|
-
this.range =
|
|
4591
|
+
this.range = null;
|
|
4454
4592
|
}
|
|
4455
4593
|
this._programmaticChange = true;
|
|
4456
4594
|
this.timeRange = this.timeRange ?? true;
|
|
@@ -4585,7 +4723,6 @@ class CmatDrawerComponent {
|
|
|
4585
4723
|
this._overlayClickDestroyFn = null;
|
|
4586
4724
|
this._overlayLeaveTimeoutId = null;
|
|
4587
4725
|
this._modeChangeTimeoutId = null;
|
|
4588
|
-
this._destroyed = false;
|
|
4589
4726
|
}
|
|
4590
4727
|
get classList() {
|
|
4591
4728
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
@@ -4649,7 +4786,6 @@ class CmatDrawerComponent {
|
|
|
4649
4786
|
this._cmatDrawerService.registerComponent(this.name, this);
|
|
4650
4787
|
}
|
|
4651
4788
|
ngOnDestroy() {
|
|
4652
|
-
this._destroyed = true;
|
|
4653
4789
|
this._cmatDrawerService.deregisterComponent(this.name);
|
|
4654
4790
|
this._cleanupOverlay();
|
|
4655
4791
|
if (this._modeChangeTimeoutId !== null) {
|
|
@@ -4951,7 +5087,7 @@ class CmatFullscreenComponent {
|
|
|
4951
5087
|
}
|
|
4952
5088
|
toggleFullscreen() {
|
|
4953
5089
|
if (!this._document.fullscreenEnabled) {
|
|
4954
|
-
console.
|
|
5090
|
+
console.warn('Fullscreen is not available in this browser.');
|
|
4955
5091
|
return;
|
|
4956
5092
|
}
|
|
4957
5093
|
const fullScreen = this._document.fullscreenElement;
|
|
@@ -5031,7 +5167,7 @@ class CmatHighlightComponent {
|
|
|
5031
5167
|
return;
|
|
5032
5168
|
}
|
|
5033
5169
|
if (!this.code) {
|
|
5034
|
-
this.code = this._elementRef.nativeElement.value;
|
|
5170
|
+
this.code = this._elementRef.nativeElement.value ?? '';
|
|
5035
5171
|
}
|
|
5036
5172
|
this._highlightAndInsert();
|
|
5037
5173
|
}
|
|
@@ -5080,8 +5216,10 @@ class CmatImageComponent {
|
|
|
5080
5216
|
this.previewVisible = signal(false, ...(ngDevMode ? [{ debugName: "previewVisible" }] : /* istanbul ignore next */ []));
|
|
5081
5217
|
this.rotate = 0;
|
|
5082
5218
|
this.scale = 1;
|
|
5219
|
+
this._animationDuration = 150;
|
|
5083
5220
|
this._loadingPreview = false;
|
|
5084
5221
|
this._closePreviewByEscape = false;
|
|
5222
|
+
this._closePreviewTimeoutId = null;
|
|
5085
5223
|
this._document = inject(DOCUMENT);
|
|
5086
5224
|
this._originalOverflow = null;
|
|
5087
5225
|
this._zoomSettings = {
|
|
@@ -5136,9 +5274,11 @@ class CmatImageComponent {
|
|
|
5136
5274
|
if (this.preview) {
|
|
5137
5275
|
this._disableBackgroundScroll();
|
|
5138
5276
|
this.maskVisible.set(true);
|
|
5139
|
-
this.previewVisible.set(true);
|
|
5140
5277
|
this._loadingPreview = true;
|
|
5141
|
-
|
|
5278
|
+
requestAnimationFrame(() => {
|
|
5279
|
+
this.previewVisible.set(true);
|
|
5280
|
+
this.previewShowChange.emit(true);
|
|
5281
|
+
});
|
|
5142
5282
|
}
|
|
5143
5283
|
}
|
|
5144
5284
|
onMaskKeydown(event) {
|
|
@@ -5175,10 +5315,19 @@ class CmatImageComponent {
|
|
|
5175
5315
|
if (this.appendTo === 'body')
|
|
5176
5316
|
this._document.body.appendChild(this._mask);
|
|
5177
5317
|
else {
|
|
5178
|
-
if (
|
|
5318
|
+
if (this.appendTo instanceof HTMLElement) {
|
|
5179
5319
|
this.appendTo.appendChild(this._mask);
|
|
5180
|
-
|
|
5181
|
-
|
|
5320
|
+
}
|
|
5321
|
+
else if (this.appendTo instanceof ElementRef) {
|
|
5322
|
+
this.appendTo.nativeElement.appendChild(this._mask);
|
|
5323
|
+
}
|
|
5324
|
+
else if (typeof this.appendTo === 'object' && this.appendTo !== null && 'el' in this.appendTo) {
|
|
5325
|
+
const target = this.appendTo;
|
|
5326
|
+
const nativeElement = target.el?.nativeElement;
|
|
5327
|
+
if (nativeElement) {
|
|
5328
|
+
nativeElement.appendChild(this._mask);
|
|
5329
|
+
}
|
|
5330
|
+
}
|
|
5182
5331
|
}
|
|
5183
5332
|
}
|
|
5184
5333
|
}
|
|
@@ -5186,14 +5335,19 @@ class CmatImageComponent {
|
|
|
5186
5335
|
return { transform: 'rotate(' + this.rotate + 'deg) scale(' + this.scale + ')' };
|
|
5187
5336
|
}
|
|
5188
5337
|
closePreview() {
|
|
5338
|
+
if (this._closePreviewTimeoutId !== null) {
|
|
5339
|
+
clearTimeout(this._closePreviewTimeoutId);
|
|
5340
|
+
this._closePreviewTimeoutId = null;
|
|
5341
|
+
}
|
|
5189
5342
|
this._enableBackgroundScroll();
|
|
5190
5343
|
this.previewVisible.set(false);
|
|
5191
|
-
this.
|
|
5192
|
-
this.scale = this._zoomSettings.default;
|
|
5193
|
-
setTimeout(() => {
|
|
5344
|
+
this._closePreviewTimeoutId = window.setTimeout(() => {
|
|
5194
5345
|
this.maskVisible.set(false);
|
|
5346
|
+
this.rotate = 0;
|
|
5347
|
+
this.scale = this._zoomSettings.default;
|
|
5195
5348
|
this.previewShowChange.emit(false);
|
|
5196
|
-
|
|
5349
|
+
this._closePreviewTimeoutId = null;
|
|
5350
|
+
}, this._animationDuration);
|
|
5197
5351
|
}
|
|
5198
5352
|
imageError(event) {
|
|
5199
5353
|
this.imageErrorEvent.emit(event);
|
|
@@ -5208,11 +5362,11 @@ class CmatImageComponent {
|
|
|
5208
5362
|
body.style.overflow = this._originalOverflow ?? '';
|
|
5209
5363
|
}
|
|
5210
5364
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5211
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatImageComponent, isStandalone: true, selector: "cmat-image", inputs: { imageClass: "imageClass", imageStyle: "imageStyle", src: "src", srcSet: "srcSet", previewImageSrc: "previewImageSrc", previewImageSrcSet: "previewImageSrcSet", alt: "alt", width: "width", height: "height", loading: "loading", appendTo: "appendTo", preview: ["preview", "preview", booleanAttribute] }, outputs: { previewShowChange: "previewShowChange", imageErrorEvent: "imageErrorEvent" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)" } }, viewQueries: [{ propertyName: "mask", first: true, predicate: ["mask"], descendants: true }, { propertyName: "previewButton", first: true, predicate: ["previewButton"], descendants: true }, { propertyName: "closeButton", first: true, predicate: ["closeButton"], descendants: true }], ngImport: i0, template: "<span [ngClass]=\"{ 'cmat-image-preview-container ': preview }\">\r\n <img [attr.src]=\"src\" [attr.srcset]=\"srcSet\" [attr.alt]=\"alt\" [attr.width]=\"width\" [attr.height]=\"height\"\r\n [attr.loading]=\"loading\" [ngStyle]=\"imageStyle\" [class]=\"imageClass\" (error)=\"imageError($event)\" />\r\n @if(preview){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible()){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible()\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomOutDisabled\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible()){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" [attr.src]=\"previewImageSrc ? previewImageSrc : src\"\r\n [attr.srcset]=\"previewImageSrcSet\" [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>\r\n", styles: [".cmat-image-mask{display:flex;align-items:center;justify-content:center}.cmat-image-preview-container{position:relative;display:inline-block;line-height:0}.cmat-image-preview-indicator{position:absolute;left:0;top:0;width:100%;height:100%;outline:none;border:none;padding:0;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .3s}.cmat-image-preview-container:hover>.cmat-image-preview-indicator{opacity:1;cursor:pointer;background-color:#00000080}.cmat-image-preview-container>img{cursor:pointer}.cmat-image-toolbar{position:absolute;top:0;right:0;display:flex;z-index:1;padding:.5rem}.cmat-image-preview{transition:transform .
|
|
5365
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatImageComponent, isStandalone: true, selector: "cmat-image", inputs: { imageClass: "imageClass", imageStyle: "imageStyle", src: "src", srcSet: "srcSet", previewImageSrc: "previewImageSrc", previewImageSrcSet: "previewImageSrcSet", alt: "alt", width: "width", height: "height", loading: "loading", appendTo: "appendTo", preview: ["preview", "preview", booleanAttribute] }, outputs: { previewShowChange: "previewShowChange", imageErrorEvent: "imageErrorEvent" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)" } }, viewQueries: [{ propertyName: "mask", first: true, predicate: ["mask"], descendants: true }, { propertyName: "previewButton", first: true, predicate: ["previewButton"], descendants: true }, { propertyName: "closeButton", first: true, predicate: ["closeButton"], descendants: true }], ngImport: i0, template: "<span [ngClass]=\"{ 'cmat-image-preview-container ': preview }\">\r\n <img [attr.src]=\"src\" [attr.srcset]=\"srcSet\" [attr.alt]=\"alt\" [attr.width]=\"width\" [attr.height]=\"height\"\r\n [attr.loading]=\"loading\" [ngStyle]=\"imageStyle\" [class]=\"imageClass\" (error)=\"imageError($event)\" />\r\n @if(preview){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible()){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible()\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomOutDisabled\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible()){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" [attr.src]=\"previewImageSrc ? previewImageSrc : src\"\r\n [attr.srcset]=\"previewImageSrcSet\" [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>\r\n", styles: [".cmat-image-mask{display:flex;align-items:center;justify-content:center}.cmat-image-preview-container{position:relative;display:inline-block;line-height:0}.cmat-image-preview-indicator{position:absolute;left:0;top:0;width:100%;height:100%;outline:none;border:none;padding:0;display:flex;align-items:center;justify-content:center;opacity:0;will-change:opacity,background-color;pointer-events:none;transition:opacity .3s ease}.cmat-image-preview-container:hover>.cmat-image-preview-indicator{opacity:1;cursor:pointer;background-color:#00000080;pointer-events:auto}.cmat-image-preview-container>img{cursor:pointer}.cmat-image-toolbar{position:absolute;top:0;right:0;display:flex;z-index:1;padding:.5rem}.cmat-image-preview{transition:transform .18s cubic-bezier(.2,0,0,1),opacity .18s cubic-bezier(.2,0,0,1);max-width:100vw;max-height:100vh;will-change:transform,opacity;transform-origin:center center;backface-visibility:hidden;transform:translateZ(0)}.cmat-image-preview-enter{animation:preview-enter-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-preview-leave{animation:preview-leave-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-overlay{background-color:#0006;transition:background-color .18s cubic-bezier(.2,0,0,1),opacity .18s cubic-bezier(.2,0,0,1);will-change:background-color,opacity;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:99}.cmat-image-overlay-enter{animation:image-overlay-enter-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-overlay-leave{z-index:0;animation:image-overlay-leave-animation .18s cubic-bezier(.2,0,0,1)}@keyframes preview-enter-animation{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}@keyframes preview-leave-animation{0%{transform:scale(1);opacity:1}to{transform:scale(.7);opacity:0}}@keyframes image-overlay-enter-animation{0%{background-color:transparent}to{background-color:#000000e6}}@keyframes image-overlay-leave-animation{0%{background-color:#000000e6}to{background-color:transparent}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5212
5366
|
}
|
|
5213
5367
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatImageComponent, decorators: [{
|
|
5214
5368
|
type: Component,
|
|
5215
|
-
args: [{ selector: 'cmat-image', imports: [CommonModule, MatButtonModule, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span [ngClass]=\"{ 'cmat-image-preview-container ': preview }\">\r\n <img [attr.src]=\"src\" [attr.srcset]=\"srcSet\" [attr.alt]=\"alt\" [attr.width]=\"width\" [attr.height]=\"height\"\r\n [attr.loading]=\"loading\" [ngStyle]=\"imageStyle\" [class]=\"imageClass\" (error)=\"imageError($event)\" />\r\n @if(preview){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible()){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible()\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomOutDisabled\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible()){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" [attr.src]=\"previewImageSrc ? previewImageSrc : src\"\r\n [attr.srcset]=\"previewImageSrcSet\" [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>\r\n", styles: [".cmat-image-mask{display:flex;align-items:center;justify-content:center}.cmat-image-preview-container{position:relative;display:inline-block;line-height:0}.cmat-image-preview-indicator{position:absolute;left:0;top:0;width:100%;height:100%;outline:none;border:none;padding:0;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .3s}.cmat-image-preview-container:hover>.cmat-image-preview-indicator{opacity:1;cursor:pointer;background-color:#00000080}.cmat-image-preview-container>img{cursor:pointer}.cmat-image-toolbar{position:absolute;top:0;right:0;display:flex;z-index:1;padding:.5rem}.cmat-image-preview{transition:transform .
|
|
5369
|
+
args: [{ selector: 'cmat-image', imports: [CommonModule, MatButtonModule, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span [ngClass]=\"{ 'cmat-image-preview-container ': preview }\">\r\n <img [attr.src]=\"src\" [attr.srcset]=\"srcSet\" [attr.alt]=\"alt\" [attr.width]=\"width\" [attr.height]=\"height\"\r\n [attr.loading]=\"loading\" [ngStyle]=\"imageStyle\" [class]=\"imageClass\" (error)=\"imageError($event)\" />\r\n @if(preview){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible()){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible()\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomOutDisabled\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible()){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" [attr.src]=\"previewImageSrc ? previewImageSrc : src\"\r\n [attr.srcset]=\"previewImageSrcSet\" [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>\r\n", styles: [".cmat-image-mask{display:flex;align-items:center;justify-content:center}.cmat-image-preview-container{position:relative;display:inline-block;line-height:0}.cmat-image-preview-indicator{position:absolute;left:0;top:0;width:100%;height:100%;outline:none;border:none;padding:0;display:flex;align-items:center;justify-content:center;opacity:0;will-change:opacity,background-color;pointer-events:none;transition:opacity .3s ease}.cmat-image-preview-container:hover>.cmat-image-preview-indicator{opacity:1;cursor:pointer;background-color:#00000080;pointer-events:auto}.cmat-image-preview-container>img{cursor:pointer}.cmat-image-toolbar{position:absolute;top:0;right:0;display:flex;z-index:1;padding:.5rem}.cmat-image-preview{transition:transform .18s cubic-bezier(.2,0,0,1),opacity .18s cubic-bezier(.2,0,0,1);max-width:100vw;max-height:100vh;will-change:transform,opacity;transform-origin:center center;backface-visibility:hidden;transform:translateZ(0)}.cmat-image-preview-enter{animation:preview-enter-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-preview-leave{animation:preview-leave-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-overlay{background-color:#0006;transition:background-color .18s cubic-bezier(.2,0,0,1),opacity .18s cubic-bezier(.2,0,0,1);will-change:background-color,opacity;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:99}.cmat-image-overlay-enter{animation:image-overlay-enter-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-overlay-leave{z-index:0;animation:image-overlay-leave-animation .18s cubic-bezier(.2,0,0,1)}@keyframes preview-enter-animation{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}@keyframes preview-leave-animation{0%{transform:scale(1);opacity:1}to{transform:scale(.7);opacity:0}}@keyframes image-overlay-enter-animation{0%{background-color:transparent}to{background-color:#000000e6}}@keyframes image-overlay-leave-animation{0%{background-color:#000000e6}to{background-color:transparent}}\n"] }]
|
|
5216
5370
|
}], propDecorators: { imageClass: [{
|
|
5217
5371
|
type: Input
|
|
5218
5372
|
}], imageStyle: [{
|
|
@@ -5278,9 +5432,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
5278
5432
|
|
|
5279
5433
|
class CmatJsonEditorComponent {
|
|
5280
5434
|
constructor() {
|
|
5435
|
+
this.options = {};
|
|
5281
5436
|
this.contentChanged = new EventEmitter();
|
|
5282
5437
|
this.pathChanged = new EventEmitter();
|
|
5283
|
-
this.id = 'cmatjsoneditor' +
|
|
5438
|
+
this.id = 'cmatjsoneditor-' + crypto.randomUUID().slice(0, 8);
|
|
5284
5439
|
this.content = {
|
|
5285
5440
|
text: undefined,
|
|
5286
5441
|
json: {}
|
|
@@ -5288,12 +5443,6 @@ class CmatJsonEditorComponent {
|
|
|
5288
5443
|
this._destroyed = false;
|
|
5289
5444
|
this._document = inject(DOCUMENT$1);
|
|
5290
5445
|
}
|
|
5291
|
-
get darkTheme() {
|
|
5292
|
-
return this._isDarkTheme;
|
|
5293
|
-
}
|
|
5294
|
-
get _isDarkTheme() {
|
|
5295
|
-
return this._document.documentElement.classList.contains('dark') || this._document.body.classList.contains('dark');
|
|
5296
|
-
}
|
|
5297
5446
|
set jsonEditorContainer(value) {
|
|
5298
5447
|
this._jsonEditorContainer = value;
|
|
5299
5448
|
this._initializeEditor();
|
|
@@ -5322,7 +5471,7 @@ class CmatJsonEditorComponent {
|
|
|
5322
5471
|
void this._editor?.destroy();
|
|
5323
5472
|
}
|
|
5324
5473
|
setSchema(schema) {
|
|
5325
|
-
const validator = createAjvValidator({ schema });
|
|
5474
|
+
const validator = createAjvValidator({ schema: schema });
|
|
5326
5475
|
void this._editor?.updateProps({ validator: validator });
|
|
5327
5476
|
}
|
|
5328
5477
|
setSelectionToPath(pathString) {
|
|
@@ -5340,11 +5489,12 @@ class CmatJsonEditorComponent {
|
|
|
5340
5489
|
if (this._editor) {
|
|
5341
5490
|
const content = this._editor.get();
|
|
5342
5491
|
if (isJSONContent(content)) {
|
|
5343
|
-
const j =
|
|
5492
|
+
const j = content.json;
|
|
5344
5493
|
return j;
|
|
5345
5494
|
}
|
|
5346
5495
|
else {
|
|
5347
|
-
const
|
|
5496
|
+
const textContent = content;
|
|
5497
|
+
const t = String(textContent.text ?? '');
|
|
5348
5498
|
const j = JSON.parse(t);
|
|
5349
5499
|
return j;
|
|
5350
5500
|
}
|
|
@@ -5374,13 +5524,10 @@ class CmatJsonEditorComponent {
|
|
|
5374
5524
|
props: {
|
|
5375
5525
|
...this.options,
|
|
5376
5526
|
content: this.content,
|
|
5377
|
-
onChange: (updatedContent,
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
contentErrors,
|
|
5382
|
-
patchResult,
|
|
5383
|
-
});
|
|
5527
|
+
onChange: (updatedContent, _previousContent, { contentErrors }) => {
|
|
5528
|
+
if (contentErrors) {
|
|
5529
|
+
console.error('JSON Editor content errors:', contentErrors);
|
|
5530
|
+
}
|
|
5384
5531
|
this.content = updatedContent;
|
|
5385
5532
|
this.contentChanged.emit(updatedContent);
|
|
5386
5533
|
},
|
|
@@ -5388,9 +5535,9 @@ class CmatJsonEditorComponent {
|
|
|
5388
5535
|
onRenderMenu(items,
|
|
5389
5536
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5390
5537
|
context) {
|
|
5391
|
-
items.splice(items.findIndex(i => i['text'] === 'table'), 1);
|
|
5392
|
-
items.splice(items.findIndex(i => i['className'] === 'jse-sort'), 1);
|
|
5393
|
-
items.splice(items.findIndex(i => i['className'] === 'jse-transform'), 1);
|
|
5538
|
+
items.splice(items.findIndex((i) => i['text'] === 'table'), 1);
|
|
5539
|
+
items.splice(items.findIndex((i) => i['className'] === 'jse-sort'), 1);
|
|
5540
|
+
items.splice(items.findIndex((i) => i['className'] === 'jse-transform'), 1);
|
|
5394
5541
|
items.forEach((item) => {
|
|
5395
5542
|
const button = item;
|
|
5396
5543
|
switch (button['title']) {
|
|
@@ -5442,11 +5589,11 @@ class CmatJsonEditorComponent {
|
|
|
5442
5589
|
});
|
|
5443
5590
|
}
|
|
5444
5591
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatJsonEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5445
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatJsonEditorComponent, isStandalone: true, selector: "cmat-json-editor", inputs: { options: "options", data: "data" }, outputs: { contentChanged: "contentChanged", pathChanged: "pathChanged" },
|
|
5592
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatJsonEditorComponent, isStandalone: true, selector: "cmat-json-editor", inputs: { options: "options", data: "data" }, outputs: { contentChanged: "contentChanged", pathChanged: "pathChanged" }, viewQueries: [{ propertyName: "jsonEditorContainer", first: true, predicate: ["jsonEditorContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@defer (on viewport) {\r\n <div #jsonEditorContainer class=\"cmat-jsoneditor\" [id]=\"id\"></div>\r\n} @placeholder {\r\n <div class=\"flex min-h-64 items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\">\r\n JSON \u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n", styles: [".cmat-jsoneditor .jse-main.svelte-sxaskb{min-height:24rem}.cmat-jsoneditor{--jse-background-color: rgba(var(--cmat-bg-card-rgb), 1);--jse-text-color: var(--cmat-text-default);--jse-key-color: var(--cmat-text-default);--jse-delimiter-color: var(--cmat-text-hint);--jse-hover-background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5446
5593
|
}
|
|
5447
5594
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatJsonEditorComponent, decorators: [{
|
|
5448
5595
|
type: Component,
|
|
5449
|
-
args: [{ selector: 'cmat-json-editor', preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [], template: "@defer (on viewport) {\r\n <div #jsonEditorContainer class=\"cmat-jsoneditor\" [id]=\"id\"></div>\r\n} @placeholder {\r\n <div class=\"flex min-h-64 items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\">\r\n JSON \u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n", styles: [".cmat-jsoneditor .jse-main.svelte-sxaskb{min-height:24rem}\n"] }]
|
|
5596
|
+
args: [{ selector: 'cmat-json-editor', preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [], template: "@defer (on viewport) {\r\n <div #jsonEditorContainer class=\"cmat-jsoneditor\" [id]=\"id\"></div>\r\n} @placeholder {\r\n <div class=\"flex min-h-64 items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\">\r\n JSON \u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n", styles: [".cmat-jsoneditor .jse-main.svelte-sxaskb{min-height:24rem}.cmat-jsoneditor{--jse-background-color: rgba(var(--cmat-bg-card-rgb), 1);--jse-text-color: var(--cmat-text-default);--jse-key-color: var(--cmat-text-default);--jse-delimiter-color: var(--cmat-text-hint);--jse-hover-background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}\n"] }]
|
|
5450
5597
|
}], propDecorators: { options: [{
|
|
5451
5598
|
type: Input
|
|
5452
5599
|
}], data: [{
|
|
@@ -5455,9 +5602,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
5455
5602
|
type: Output
|
|
5456
5603
|
}], pathChanged: [{
|
|
5457
5604
|
type: Output
|
|
5458
|
-
}], darkTheme: [{
|
|
5459
|
-
type: HostBinding,
|
|
5460
|
-
args: ['class.jse-theme-dark']
|
|
5461
5605
|
}], jsonEditorContainer: [{
|
|
5462
5606
|
type: ViewChild,
|
|
5463
5607
|
args: ['jsonEditorContainer']
|
|
@@ -5495,8 +5639,9 @@ class CmatKnobInputComponent {
|
|
|
5495
5639
|
this._placeholder = '';
|
|
5496
5640
|
this._required = false;
|
|
5497
5641
|
this._disabled = false;
|
|
5498
|
-
|
|
5499
|
-
|
|
5642
|
+
this._onModelChange = () => {
|
|
5643
|
+
// Intentionally left blank
|
|
5644
|
+
};
|
|
5500
5645
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5501
5646
|
this._onTouchedChange = () => { };
|
|
5502
5647
|
if (this.ngControl != null) {
|
|
@@ -5702,9 +5847,9 @@ class CmatKnobInputComponent {
|
|
|
5702
5847
|
}
|
|
5703
5848
|
onTouchMove(event) {
|
|
5704
5849
|
if (!this.disabled && event instanceof TouchEvent && event.touches.length === 1) {
|
|
5705
|
-
const rect = this._el.nativeElement.
|
|
5850
|
+
const rect = this._el.nativeElement.firstElementChild?.getBoundingClientRect();
|
|
5706
5851
|
const touch = event.targetTouches.item(0);
|
|
5707
|
-
if (touch) {
|
|
5852
|
+
if (touch && rect) {
|
|
5708
5853
|
const offsetX = touch.clientX - rect.left;
|
|
5709
5854
|
const offsetY = touch.clientY - rect.top;
|
|
5710
5855
|
this.updateValue(offsetX, offsetY);
|
|
@@ -5723,7 +5868,7 @@ class CmatKnobInputComponent {
|
|
|
5723
5868
|
this.valueChange.emit(this.value);
|
|
5724
5869
|
}
|
|
5725
5870
|
writeValue(value) {
|
|
5726
|
-
this.value = value;
|
|
5871
|
+
this.value = value ?? this.min;
|
|
5727
5872
|
this.refreshVersion.update(value => value + 1);
|
|
5728
5873
|
}
|
|
5729
5874
|
registerOnChange(fn) {
|
|
@@ -5787,13 +5932,13 @@ class CmatKnobInputComponent {
|
|
|
5787
5932
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatKnobInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5788
5933
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatKnobInputComponent, isStandalone: true, selector: "cmat-knob-input", inputs: { id: "id", valueColor: "valueColor", rangeColor: "rangeColor", textColor: "textColor", valueTemplate: "valueTemplate", name: "name", size: "size", step: "step", min: "min", max: "max", strokeWidth: "strokeWidth", showValue: "showValue", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "keydown": "onKeyDown($event)", "mousedown": "onMouseDown($event)", "mouseup": "onMouseUp($event)", "touchstart": "onTouchStart($event)", "touchend": "onTouchEnd($event)" }, properties: { "attr.id": "this.id" } }, providers: [
|
|
5789
5934
|
{ provide: MatFormFieldControl, useExisting: CmatKnobInputComponent }
|
|
5790
|
-
], viewQueries: [{ propertyName: "_knobElementRef", first: true, predicate: ["knob"], descendants: true }], exportAs: ["cmatKnobInput"], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div #knob [attr.data-refresh]=\"refreshVersion()\" [class.cmat-knob-disabled]=\"disabled\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut($event)\">\r\n <svg viewBox=\"0 0 100 100\" role=\"slider\" [style.width]=\"size + 'px'\" [style.height]=\"size + 'px'\"\r\n [attr.aria-valuemin]=\"min\" [attr.aria-valuemax]=\"max\" [attr.aria-valuenow]=\"value\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\" (click)=\"onClick($event)\" (keydown.enter)=\"onKeyDown($event)\" (keydown.space)=\"onKeyDown($event)\">\r\n <path class=\"knob-range\" [attr.d]=\"rangePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"rangeColor\">\r\n </path>\r\n <path class=\"knob-value\" [attr.d]=\"valuePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"valueColor\">\r\n </path>\r\n @if(showValue){\r\n <text text-anchor=\"middle\" class=\"knob-text\" [attr.x]=\"50\" [attr.y]=\"57\" [attr.fill]=\"textColor\"\r\n [attr.name]=\"name\">{{ valueToDisplay() }}</text>\r\n }\r\n </svg>\r\n</div>\r\n
|
|
5935
|
+
], viewQueries: [{ propertyName: "_knobElementRef", first: true, predicate: ["knob"], descendants: true }], exportAs: ["cmatKnobInput"], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div #knob [attr.data-refresh]=\"refreshVersion()\" [class.cmat-knob-disabled]=\"disabled\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut($event)\">\r\n <svg viewBox=\"0 0 100 100\" role=\"slider\" [style.width]=\"size + 'px'\" [style.height]=\"size + 'px'\"\r\n [attr.aria-valuemin]=\"min\" [attr.aria-valuemax]=\"max\" [attr.aria-valuenow]=\"value\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\" (click)=\"onClick($event)\" (keydown.enter)=\"onKeyDown($event)\" (keydown.space)=\"onKeyDown($event)\">\r\n <path class=\"knob-range\" [attr.d]=\"rangePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"rangeColor\">\r\n </path>\r\n <path class=\"knob-value\" [attr.d]=\"valuePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"valueColor\">\r\n </path>\r\n @if(showValue){\r\n <text text-anchor=\"middle\" class=\"knob-text\" [attr.x]=\"50\" [attr.y]=\"57\" [attr.fill]=\"textColor\"\r\n [attr.name]=\"name\">{{ valueToDisplay() }}</text>\r\n }\r\n </svg>\r\n</div>\r\n\r\n", styles: ["cmat-knob-input .knob-range{fill:none;transition:stroke .1s ease-in}cmat-knob-input .knob-value{animation-name:dash-frame;animation-fill-mode:forwards;fill:none}cmat-knob-input .knob-text{font-size:1.3rem;text-align:center}cmat-knob-input .cmat-knob-disabled{opacity:.6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5791
5936
|
}
|
|
5792
5937
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatKnobInputComponent, decorators: [{
|
|
5793
5938
|
type: Component,
|
|
5794
5939
|
args: [{ selector: 'cmat-knob-input', providers: [
|
|
5795
5940
|
{ provide: MatFormFieldControl, useExisting: CmatKnobInputComponent }
|
|
5796
|
-
], exportAs: 'cmatKnobInput', imports: [NgStyle], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div #knob [attr.data-refresh]=\"refreshVersion()\" [class.cmat-knob-disabled]=\"disabled\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut($event)\">\r\n <svg viewBox=\"0 0 100 100\" role=\"slider\" [style.width]=\"size + 'px'\" [style.height]=\"size + 'px'\"\r\n [attr.aria-valuemin]=\"min\" [attr.aria-valuemax]=\"max\" [attr.aria-valuenow]=\"value\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\" (click)=\"onClick($event)\" (keydown.enter)=\"onKeyDown($event)\" (keydown.space)=\"onKeyDown($event)\">\r\n <path class=\"knob-range\" [attr.d]=\"rangePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"rangeColor\">\r\n </path>\r\n <path class=\"knob-value\" [attr.d]=\"valuePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"valueColor\">\r\n </path>\r\n @if(showValue){\r\n <text text-anchor=\"middle\" class=\"knob-text\" [attr.x]=\"50\" [attr.y]=\"57\" [attr.fill]=\"textColor\"\r\n [attr.name]=\"name\">{{ valueToDisplay() }}</text>\r\n }\r\n </svg>\r\n</div>\r\n
|
|
5941
|
+
], exportAs: 'cmatKnobInput', imports: [NgStyle], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div #knob [attr.data-refresh]=\"refreshVersion()\" [class.cmat-knob-disabled]=\"disabled\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut($event)\">\r\n <svg viewBox=\"0 0 100 100\" role=\"slider\" [style.width]=\"size + 'px'\" [style.height]=\"size + 'px'\"\r\n [attr.aria-valuemin]=\"min\" [attr.aria-valuemax]=\"max\" [attr.aria-valuenow]=\"value\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\" (click)=\"onClick($event)\" (keydown.enter)=\"onKeyDown($event)\" (keydown.space)=\"onKeyDown($event)\">\r\n <path class=\"knob-range\" [attr.d]=\"rangePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"rangeColor\">\r\n </path>\r\n <path class=\"knob-value\" [attr.d]=\"valuePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"valueColor\">\r\n </path>\r\n @if(showValue){\r\n <text text-anchor=\"middle\" class=\"knob-text\" [attr.x]=\"50\" [attr.y]=\"57\" [attr.fill]=\"textColor\"\r\n [attr.name]=\"name\">{{ valueToDisplay() }}</text>\r\n }\r\n </svg>\r\n</div>\r\n\r\n", styles: ["cmat-knob-input .knob-range{fill:none;transition:stroke .1s ease-in}cmat-knob-input .knob-value{animation-name:dash-frame;animation-fill-mode:forwards;fill:none}cmat-knob-input .knob-text{font-size:1.3rem;text-align:center}cmat-knob-input .cmat-knob-disabled{opacity:.6}\n"] }]
|
|
5797
5942
|
}], ctorParameters: () => [], propDecorators: { _knobElementRef: [{
|
|
5798
5943
|
type: ViewChild,
|
|
5799
5944
|
args: ['knob', { static: false }]
|
|
@@ -5929,8 +6074,8 @@ const CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR = {
|
|
|
5929
6074
|
};
|
|
5930
6075
|
class CmatMaterialColorPickerComponent {
|
|
5931
6076
|
constructor() {
|
|
5932
|
-
this.selectedColor = signal({ palette: 'bg-indigo', hue: '500', color: 'bg-indigo-500' }, ...(ngDevMode ? [{ debugName: "selectedColor" }] : /* istanbul ignore next */ []));
|
|
5933
6077
|
this.colorChanged = new EventEmitter();
|
|
6078
|
+
this.selectedColor = signal({ palette: 'bg-indigo', hue: '500', color: 'bg-indigo-500' }, ...(ngDevMode ? [{ debugName: "selectedColor" }] : /* istanbul ignore next */ []));
|
|
5934
6079
|
this.palettes = baseColors;
|
|
5935
6080
|
this.hues = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'];
|
|
5936
6081
|
this.selectedHue = '500';
|
|
@@ -6006,7 +6151,7 @@ class CmatMaterialColorPickerComponent {
|
|
|
6006
6151
|
color: this.selectedPalette + '-' + this.selectedHue
|
|
6007
6152
|
});
|
|
6008
6153
|
this._color = this.selectedColor().color;
|
|
6009
|
-
this.colorChanged.emit(this.selectedColor());
|
|
6154
|
+
this.colorChanged.emit(this.selectedColor().color);
|
|
6010
6155
|
this._modelTouched(this.selectedColor().color);
|
|
6011
6156
|
this._modelChange(this.selectedColor().color);
|
|
6012
6157
|
}
|
|
@@ -6736,7 +6881,7 @@ class CmatDatetimepickerTimeInputDirective {
|
|
|
6736
6881
|
});
|
|
6737
6882
|
}
|
|
6738
6883
|
get hasFocus() {
|
|
6739
|
-
return this._element.nativeElement && this._element?.nativeElement === document?.activeElement;
|
|
6884
|
+
return !!this._element.nativeElement && this._element?.nativeElement === document?.activeElement;
|
|
6740
6885
|
}
|
|
6741
6886
|
get inputElement() {
|
|
6742
6887
|
return this._element.nativeElement;
|
|
@@ -8058,10 +8203,11 @@ class CmatDatetimepickerComponent {
|
|
|
8058
8203
|
this._closeAnimationTimeoutId = null;
|
|
8059
8204
|
}
|
|
8060
8205
|
const activeElement = this._document.activeElement;
|
|
8206
|
+
const overlayElement = location.nativeElement;
|
|
8061
8207
|
if (canRestoreFocus &&
|
|
8062
8208
|
(!activeElement ||
|
|
8063
8209
|
activeElement === this._document.activeElement ||
|
|
8064
|
-
|
|
8210
|
+
overlayElement.contains(activeElement))) {
|
|
8065
8211
|
this._focusedElementBeforeOpen?.focus();
|
|
8066
8212
|
}
|
|
8067
8213
|
this._focusedElementBeforeOpen = null;
|
|
@@ -8114,12 +8260,7 @@ class CmatDatetimepickerComponent {
|
|
|
8114
8260
|
if (isDialog) {
|
|
8115
8261
|
overlayElement.setAttribute('aria-modal', 'true');
|
|
8116
8262
|
}
|
|
8117
|
-
this._getCloseStream(overlayRef).subscribe((
|
|
8118
|
-
if (event) {
|
|
8119
|
-
event.preventDefault();
|
|
8120
|
-
}
|
|
8121
|
-
this.close();
|
|
8122
|
-
});
|
|
8263
|
+
this._getCloseStream(overlayRef).subscribe(() => this.close());
|
|
8123
8264
|
this._componentRef = overlayRef.attach(portal);
|
|
8124
8265
|
this._forwardContentValues(this._componentRef.instance);
|
|
8125
8266
|
if (!isDialog) {
|
|
@@ -8180,10 +8321,27 @@ class CmatDatetimepickerComponent {
|
|
|
8180
8321
|
]);
|
|
8181
8322
|
}
|
|
8182
8323
|
_getCloseStream(overlayRef) {
|
|
8183
|
-
return
|
|
8184
|
-
(
|
|
8185
|
-
|
|
8186
|
-
|
|
8324
|
+
return new Observable((subscriber) => {
|
|
8325
|
+
const subscriptions = new Subscription();
|
|
8326
|
+
subscriptions.add(overlayRef.backdropClick().subscribe(() => {
|
|
8327
|
+
subscriber.next();
|
|
8328
|
+
subscriber.complete();
|
|
8329
|
+
}));
|
|
8330
|
+
subscriptions.add(overlayRef.detachments().subscribe(() => {
|
|
8331
|
+
subscriber.next();
|
|
8332
|
+
subscriber.complete();
|
|
8333
|
+
}));
|
|
8334
|
+
subscriptions.add(overlayRef.keydownEvents().pipe(filter(event => ((event.code === 'Escape' && !hasModifierKey(event)) ||
|
|
8335
|
+
(this.datetimepickerInput &&
|
|
8336
|
+
hasModifierKey(event, 'altKey') &&
|
|
8337
|
+
event.code === 'ArrowUp')))).subscribe(() => {
|
|
8338
|
+
subscriber.next();
|
|
8339
|
+
subscriber.complete();
|
|
8340
|
+
}));
|
|
8341
|
+
return () => {
|
|
8342
|
+
subscriptions.unsubscribe();
|
|
8343
|
+
};
|
|
8344
|
+
});
|
|
8187
8345
|
}
|
|
8188
8346
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatDatetimepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8189
8347
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: CmatDatetimepickerComponent, isStandalone: true, selector: "cmat-datetimepicker", inputs: { startView: "startView", mode: "mode", timeInterval: "timeInterval", preventSameDateTimeSelection: "preventSameDateTimeSelection", xPosition: "xPosition", yPosition: "yPosition", multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", panelClass: "panelClass", opened: "opened", color: "color", startAt: "startAt", type: "type", timeInput: "timeInput", touchUi: "touchUi", disabled: "disabled", restoreFocus: "restoreFocus" }, outputs: { selectedChanged: "selectedChanged", openedStream: "openedStream", closedStream: "closedStream", viewChanged: "viewChanged" }, exportAs: ["cmatDatetimepicker"], ngImport: i0, template: '', isInline: true, styles: [".cmat-datetimepicker-calendar-header,.cmat-datetimepicker-calendar-body-cell-content.cmat-datetimepicker-calendar-body-selected{color:#fff!important}.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected).cmat-datetimepicker-calendar-body-today{border-color:var(--cmat-text-hint)}.cmat-datetimepicker-calendar-body-cell:not(.cmat-datetimepicker-calendar-body-disabled):hover>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected),.cmat-datetimepicker-calendar-body-active>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected){background-color:rgba(var(--cmat-primary-rgb),.3)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected){color:var(--cmat-text-disabled)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-today:not(.cmat-datetimepicker-calendar-body-selected){border-color:rgba(var(--cmat-text-disabled),.8)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-selected{background-color:rgba(var(--cmat-primary-rgb),.4)}.cmat-datetimepicker-calendar-previous-button.disabled,.cmat-datetimepicker-calendar-next-button.disabled{color:var(--cmat-text-disabled)}.cmat-datetimepicker-clock-wrapper{background-color:var(--cmat-divider)}.cmat-datetimepicker-clock-cell.cmat-datetimepicker-clock-cell-selected{color:#fff!important}.cmat-datetimepicker-clock-cell.cmat-datetimepicker-clock-cell-disabled{color:var(--cmat-text-disabled)}.cmat-datetimepicker-time-input{background-color:var(--cmat-text-disabled)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active{background-color:rgba(var(--cmat-primary-rgb),.2)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active:focus{border-color:var(--cmat-primary);background-color:var(--cmat-divider)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active:focus::placeholder{color:rgba(var(--cmat-primary-rgb),.6)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-warning{border-color:var(--cmat-warn)}.cmat-datetimepicker-time-am.mat-mdc-button,.cmat-datetimepicker-time-pm.mat-mdc-button{color:var(--cmat-text-hint);border-color:var(--cmat-text-hint)}.cmat-datetimepicker-time-am.mat-mdc-button.cmat-datetimepicker-time-ampm-active,.cmat-datetimepicker-time-pm.mat-mdc-button.cmat-datetimepicker-time-ampm-active{background-color:rgba(var(--cmat-accent-rgb),.2)}.cmat-datetimepicker-content{display:block;border-radius:4px;overflow:hidden}.cmat-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.cmat-datetimepicker-content .cmat-calendar{width:296px;height:424px}.cmat-datetimepicker-content .cmat-calendar.cmat-datetimepicker-calendar-with-time-input{height:490px}.cmat-datetimepicker-content-touch{display:block;position:relative;overflow:visible}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.cmat-datetimepicker-content-touch .cmat-datetimepicker-calendar{width:100%;height:auto}@media all and (orientation:landscape){.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape]{width:120vh;height:100%;min-height:80vh}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto] .cmat-datetimepicker-calendar,.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape] .cmat-datetimepicker-calendar{width:auto;height:100%}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait] .cmat-datetimepicker-calendar{width:100%;height:auto}}@media all and (orientation:portrait){.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto] .cmat-datetimepicker-calendar,.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait] .cmat-datetimepicker-calendar{width:100%;height:auto}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape] .cmat-datetimepicker-calendar{width:auto;height:100%}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container-with-actions{height:135vw}}.cmat-datetimepicker-transform-panel.enter-dropdown{animation:panel-dropdown-enter .12s cubic-bezier(0,0,.2,1)}.cmat-datetimepicker-transform-panel.enter-dialog{animation:panel-dialog-enter .15s cubic-bezier(0,0,.2,1)}.cmat-datetimepicker-transform-panel.leave{animation:panel-leave .1s linear}@keyframes panel-dropdown-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scale(1)}}@keyframes panel-dialog-enter{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:none}}@keyframes panel-leave{0%{opacity:1}to{opacity:0}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
@@ -8390,7 +8548,7 @@ class CmatDatetimepickerInputDirective {
|
|
|
8390
8548
|
}
|
|
8391
8549
|
getOverlayLabelId() {
|
|
8392
8550
|
if (this._formField) {
|
|
8393
|
-
return this._formField.getLabelId();
|
|
8551
|
+
return this._formField.getLabelId() ?? null;
|
|
8394
8552
|
}
|
|
8395
8553
|
return this._elementRef.nativeElement.getAttribute('aria-labelledby');
|
|
8396
8554
|
}
|
|
@@ -8454,7 +8612,7 @@ class CmatDatetimepickerInputDirective {
|
|
|
8454
8612
|
}
|
|
8455
8613
|
}
|
|
8456
8614
|
_getParseFormat() {
|
|
8457
|
-
let parseFormat;
|
|
8615
|
+
let parseFormat = this._dateFormats.parse.dateInput;
|
|
8458
8616
|
switch (this.datetimepicker.type) {
|
|
8459
8617
|
case 'date':
|
|
8460
8618
|
parseFormat = this._dateFormats.parse.dateInput;
|
|
@@ -8472,7 +8630,6 @@ class CmatDatetimepickerInputDirective {
|
|
|
8472
8630
|
parseFormat = this._dateFormats.parse.yearInput;
|
|
8473
8631
|
break;
|
|
8474
8632
|
}
|
|
8475
|
-
parseFormat ??= this._dateFormats.parse.dateInput;
|
|
8476
8633
|
return parseFormat;
|
|
8477
8634
|
}
|
|
8478
8635
|
_formatValue(value) {
|
|
@@ -9244,6 +9401,7 @@ class CmatVerticalNavigationComponent {
|
|
|
9244
9401
|
this.inner = false;
|
|
9245
9402
|
this.mode = 'side';
|
|
9246
9403
|
this.name = '';
|
|
9404
|
+
this.navigation = [];
|
|
9247
9405
|
this.opened = true;
|
|
9248
9406
|
this.position = 'left';
|
|
9249
9407
|
this.transparentOverlay = false;
|
|
@@ -9762,7 +9920,7 @@ class CmatOtpInputComponent {
|
|
|
9762
9920
|
this._valueChangesSub = this.otpForm.valueChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
|
|
9763
9921
|
Object.keys(this.otpForm.controls).forEach((k) => {
|
|
9764
9922
|
const val = this.otpForm.controls[k].value;
|
|
9765
|
-
if (val && val.length > 1) {
|
|
9923
|
+
if (typeof val === 'string' && val.length > 1) {
|
|
9766
9924
|
if (val.length >= this.config.length) {
|
|
9767
9925
|
this.setValue(val);
|
|
9768
9926
|
}
|
|
@@ -10071,7 +10229,7 @@ class CmatOtpInputComponent {
|
|
|
10071
10229
|
let val = null;
|
|
10072
10230
|
Object.keys(this.otpForm.controls).forEach((k) => {
|
|
10073
10231
|
let ctrlVal = this.otpForm.controls[k].value;
|
|
10074
|
-
if (ctrlVal) {
|
|
10232
|
+
if (typeof ctrlVal === 'string' && ctrlVal) {
|
|
10075
10233
|
const isLengthExceed = ctrlVal.length > 1;
|
|
10076
10234
|
ctrlVal = ctrlVal[0];
|
|
10077
10235
|
const letterCase = this.config.letterCase?.toLocaleLowerCase();
|
|
@@ -10741,17 +10899,19 @@ var Criteria;
|
|
|
10741
10899
|
|
|
10742
10900
|
class CmatPasswordStrengthValidator {
|
|
10743
10901
|
isUndefinedOrEmpty(control) {
|
|
10744
|
-
|
|
10902
|
+
const value = typeof control.value === 'string' ? control.value : '';
|
|
10903
|
+
if (!value || value.length === 0) {
|
|
10745
10904
|
return void 0;
|
|
10746
10905
|
}
|
|
10747
10906
|
}
|
|
10748
10907
|
validate(criteria, regex) {
|
|
10749
10908
|
return (control) => {
|
|
10750
10909
|
this.isUndefinedOrEmpty(control);
|
|
10751
|
-
|
|
10910
|
+
const value = typeof control.value === 'string' ? control.value : '';
|
|
10911
|
+
if (!regex.test(value)) {
|
|
10752
10912
|
const failed = {};
|
|
10753
10913
|
failed[criteria] = {
|
|
10754
|
-
actualValue:
|
|
10914
|
+
actualValue: value,
|
|
10755
10915
|
requiredPattern: regex
|
|
10756
10916
|
};
|
|
10757
10917
|
return failed;
|
|
@@ -10762,11 +10922,12 @@ class CmatPasswordStrengthValidator {
|
|
|
10762
10922
|
confirm(password) {
|
|
10763
10923
|
return (control) => {
|
|
10764
10924
|
this.isUndefinedOrEmpty(control);
|
|
10765
|
-
|
|
10925
|
+
const value = typeof control.value === 'string' ? control.value : '';
|
|
10926
|
+
if (value !== password) {
|
|
10766
10927
|
return {
|
|
10767
10928
|
notConfirmed: {
|
|
10768
10929
|
password: password,
|
|
10769
|
-
passwordConfirmation:
|
|
10930
|
+
passwordConfirmation: value
|
|
10770
10931
|
}
|
|
10771
10932
|
};
|
|
10772
10933
|
}
|
|
@@ -11102,8 +11263,8 @@ class CmatPopoverComponent {
|
|
|
11102
11263
|
this.closeDisabled = false;
|
|
11103
11264
|
this.classList = {};
|
|
11104
11265
|
this._onAnimationStateChange = new EventEmitter();
|
|
11266
|
+
this._hostElementRef = inject(ElementRef);
|
|
11105
11267
|
this._dir = inject(Directionality, { optional: true });
|
|
11106
|
-
this._elementRef = inject(ElementRef);
|
|
11107
11268
|
this._position = ['below', 'after'];
|
|
11108
11269
|
this._triggerEvent = 'hover';
|
|
11109
11270
|
this._scrollStrategy = 'reposition';
|
|
@@ -11246,7 +11407,7 @@ class CmatPopoverComponent {
|
|
|
11246
11407
|
obj[className] = true;
|
|
11247
11408
|
return obj;
|
|
11248
11409
|
}, {});
|
|
11249
|
-
this.
|
|
11410
|
+
this._hostElementRef.nativeElement.setAttribute('class', '');
|
|
11250
11411
|
this.setPositionClasses();
|
|
11251
11412
|
}
|
|
11252
11413
|
}
|
|
@@ -11821,6 +11982,7 @@ class CmatQRCodeComponent {
|
|
|
11821
11982
|
this._renderer = inject(Renderer2);
|
|
11822
11983
|
this._sanitizer = inject(DomSanitizer);
|
|
11823
11984
|
this._currentOperationId = 0;
|
|
11985
|
+
this._previousObjectUrl = null;
|
|
11824
11986
|
}
|
|
11825
11987
|
ngOnChanges() {
|
|
11826
11988
|
this._createQRCode();
|
|
@@ -11836,11 +11998,16 @@ class CmatQRCodeComponent {
|
|
|
11836
11998
|
return new Blob([uInt8Array], { type: imageType });
|
|
11837
11999
|
}
|
|
11838
12000
|
emitQRCodeURL(element) {
|
|
12001
|
+
if (this._previousObjectUrl) {
|
|
12002
|
+
URL.revokeObjectURL(this._previousObjectUrl);
|
|
12003
|
+
this._previousObjectUrl = null;
|
|
12004
|
+
}
|
|
11839
12005
|
const className = element.constructor.name;
|
|
11840
12006
|
if (className === SVGSVGElement.name) {
|
|
11841
12007
|
const svgHTML = element.outerHTML;
|
|
11842
12008
|
const blob = new Blob([svgHTML], { type: 'image/svg+xml' });
|
|
11843
12009
|
const urlSvg = URL.createObjectURL(blob);
|
|
12010
|
+
this._previousObjectUrl = urlSvg;
|
|
11844
12011
|
const urlSanitized = this._sanitizer.bypassSecurityTrustUrl(urlSvg);
|
|
11845
12012
|
this.qrCodeURL.emit(urlSanitized);
|
|
11846
12013
|
return;
|
|
@@ -11854,6 +12021,7 @@ class CmatQRCodeComponent {
|
|
|
11854
12021
|
}
|
|
11855
12022
|
const blobData = this.convertBase64ImageUrlToBlob(urlImage);
|
|
11856
12023
|
const urlBlob = URL.createObjectURL(blobData);
|
|
12024
|
+
this._previousObjectUrl = urlBlob;
|
|
11857
12025
|
const urlSanitized = this._sanitizer.bypassSecurityTrustUrl(urlBlob);
|
|
11858
12026
|
this.qrCodeURL.emit(urlSanitized);
|
|
11859
12027
|
}
|
|
@@ -11903,7 +12071,7 @@ class CmatQRCodeComponent {
|
|
|
11903
12071
|
});
|
|
11904
12072
|
}
|
|
11905
12073
|
_renderElement(element) {
|
|
11906
|
-
for (const node of this.qrcElement.nativeElement.childNodes) {
|
|
12074
|
+
for (const node of Array.from(this.qrcElement.nativeElement.childNodes)) {
|
|
11907
12075
|
this._renderer.removeChild(this.qrcElement.nativeElement, node);
|
|
11908
12076
|
}
|
|
11909
12077
|
this._renderer.appendChild(this.qrcElement.nativeElement, element);
|
|
@@ -12018,7 +12186,7 @@ class CmatQRCodeComponent {
|
|
|
12018
12186
|
}
|
|
12019
12187
|
}
|
|
12020
12188
|
catch (e) {
|
|
12021
|
-
console.error('
|
|
12189
|
+
console.error('生成QRCode错误:', e instanceof Error ? e.message : String(e));
|
|
12022
12190
|
}
|
|
12023
12191
|
}
|
|
12024
12192
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatQRCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -12155,7 +12323,7 @@ class CmatRatingComponent {
|
|
|
12155
12323
|
}
|
|
12156
12324
|
}
|
|
12157
12325
|
writeValue(value) {
|
|
12158
|
-
if (value) {
|
|
12326
|
+
if (value !== null && value !== undefined) {
|
|
12159
12327
|
this.value = value;
|
|
12160
12328
|
this.currentValue.set(value);
|
|
12161
12329
|
}
|
|
@@ -12353,15 +12521,16 @@ class CmatSelectSearchComponent {
|
|
|
12353
12521
|
this._options$ = signal(null, ...(ngDevMode ? [{ debugName: "_options$" }] : /* istanbul ignore next */ []));
|
|
12354
12522
|
this._optionsList$ = toObservable(this._options$).pipe(switchMap((_options) => _options ?
|
|
12355
12523
|
_options.changes.pipe(map((options) => options.toArray()), startWith$1(_options.toArray())) : of(null)));
|
|
12356
|
-
this._optionsLength$ = this._optionsList$.pipe(map(options => options ? options.length : 0));
|
|
12524
|
+
this._optionsLength$ = this._optionsList$.pipe(map((options) => options ? options.length : 0));
|
|
12525
|
+
this._previousSelectedValues = [];
|
|
12357
12526
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
12358
12527
|
this.showNoEntriesFound = signal(false, ...(ngDevMode ? [{ debugName: "showNoEntriesFound" }] : /* istanbul ignore next */ []));
|
|
12359
12528
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
12360
12529
|
this.showNoEntriesFound$ = combineLatest([
|
|
12361
12530
|
this.formControl.valueChanges,
|
|
12362
12531
|
this._optionsLength$
|
|
12363
|
-
]).pipe(map(([value, optionsLength]) => this.noEntriesFoundLabel && value
|
|
12364
|
-
&& optionsLength === this._getOptionsLengthOffset()), tap(showNoEntriesFound => this.showNoEntriesFound.set(!!showNoEntriesFound)));
|
|
12532
|
+
]).pipe(map(([value, optionsLength]) => !!this.noEntriesFoundLabel && !!value
|
|
12533
|
+
&& optionsLength === this._getOptionsLengthOffset()), tap((showNoEntriesFound) => this.showNoEntriesFound.set(!!showNoEntriesFound)));
|
|
12365
12534
|
this.onTouched = () => { };
|
|
12366
12535
|
this._applyDefaultOptions(this._defaultOptions);
|
|
12367
12536
|
}
|
|
@@ -12369,7 +12538,7 @@ class CmatSelectSearchComponent {
|
|
|
12369
12538
|
return !!this._matOption;
|
|
12370
12539
|
}
|
|
12371
12540
|
get value() {
|
|
12372
|
-
return this.formControl.value;
|
|
12541
|
+
return this.formControl.value ?? '';
|
|
12373
12542
|
}
|
|
12374
12543
|
get _options() {
|
|
12375
12544
|
return this._options$();
|
|
@@ -12387,7 +12556,7 @@ class CmatSelectSearchComponent {
|
|
|
12387
12556
|
this.matSelect.panelClass = [this.matSelect.panelClass, panelClass];
|
|
12388
12557
|
}
|
|
12389
12558
|
else if (typeof this.matSelect.panelClass === 'object') {
|
|
12390
|
-
this.matSelect.panelClass
|
|
12559
|
+
this.matSelect.panelClass[panelClass] = true;
|
|
12391
12560
|
}
|
|
12392
12561
|
}
|
|
12393
12562
|
else {
|
|
@@ -12425,7 +12594,7 @@ class CmatSelectSearchComponent {
|
|
|
12425
12594
|
.subscribe(() => this._adjustScrollTopToFitActiveOptionIntoView());
|
|
12426
12595
|
}
|
|
12427
12596
|
else {
|
|
12428
|
-
console.
|
|
12597
|
+
console.warn('_keyManager was not initialized.');
|
|
12429
12598
|
}
|
|
12430
12599
|
this._options = this.matSelect.options;
|
|
12431
12600
|
let previousFirstOption = this._options.toArray()[this._getOptionsLengthOffset()];
|
|
@@ -12441,7 +12610,7 @@ class CmatSelectSearchComponent {
|
|
|
12441
12610
|
const firstOptionIsChanged = !this.matSelect.compareWith(previousFirstOption, currentFirstOption);
|
|
12442
12611
|
if (firstOptionIsChanged
|
|
12443
12612
|
|| !keyManager.activeItem
|
|
12444
|
-
|| !options.find(option => this.matSelect.compareWith(option, keyManager.activeItem))) {
|
|
12613
|
+
|| !options.find((option) => this.matSelect.compareWith(option, keyManager.activeItem))) {
|
|
12445
12614
|
keyManager.setFirstItemActive();
|
|
12446
12615
|
}
|
|
12447
12616
|
setTimeout(() => {
|
|
@@ -12500,12 +12669,17 @@ class CmatSelectSearchComponent {
|
|
|
12500
12669
|
// 方向键切换时同步当前高亮项
|
|
12501
12670
|
if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
|
|
12502
12671
|
const ariaActiveDescendantId = this.matSelect._getAriaActiveDescendant();
|
|
12503
|
-
const index = this._options?.toArray().findIndex(item => item.id === ariaActiveDescendantId) ?? -1;
|
|
12672
|
+
const index = this._options?.toArray().findIndex((item) => item.id === ariaActiveDescendantId) ?? -1;
|
|
12504
12673
|
if (index >= 0) {
|
|
12505
12674
|
this._unselectActiveDescendant();
|
|
12506
12675
|
this._activeDescendant = this._options?.toArray()[index]._getHostElement();
|
|
12507
12676
|
this._activeDescendant?.setAttribute('aria-selected', 'true');
|
|
12508
|
-
|
|
12677
|
+
if (ariaActiveDescendantId) {
|
|
12678
|
+
this.searchSelectInput.nativeElement.setAttribute('aria-activedescendant', ariaActiveDescendantId);
|
|
12679
|
+
}
|
|
12680
|
+
else {
|
|
12681
|
+
this.searchSelectInput.nativeElement.removeAttribute('aria-activedescendant');
|
|
12682
|
+
}
|
|
12509
12683
|
}
|
|
12510
12684
|
}
|
|
12511
12685
|
}
|
|
@@ -12520,7 +12694,7 @@ class CmatSelectSearchComponent {
|
|
|
12520
12694
|
this.onTouched();
|
|
12521
12695
|
}
|
|
12522
12696
|
registerOnChange(fn) {
|
|
12523
|
-
this.formControl.valueChanges.pipe(filter(value => value !== this._lastExternalInputValue), tap(() => this._lastExternalInputValue = undefined), takeUntilDestroyed(this._destroyRef)).subscribe(fn);
|
|
12697
|
+
this.formControl.valueChanges.pipe(filter((value) => value !== this._lastExternalInputValue), tap(() => this._lastExternalInputValue = undefined), takeUntilDestroyed(this._destroyRef)).subscribe(fn);
|
|
12524
12698
|
}
|
|
12525
12699
|
registerOnTouched(fn) {
|
|
12526
12700
|
this.onTouched = fn;
|
|
@@ -12586,11 +12760,8 @@ class CmatSelectSearchComponent {
|
|
|
12586
12760
|
if (!defaultOptions) {
|
|
12587
12761
|
return;
|
|
12588
12762
|
}
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
this[key] = defaultOptions[key];
|
|
12592
|
-
}
|
|
12593
|
-
}
|
|
12763
|
+
const options = defaultOptions;
|
|
12764
|
+
Object.assign(this, options);
|
|
12594
12765
|
}
|
|
12595
12766
|
_initMultipleHandling() {
|
|
12596
12767
|
// 初始化多选场景下的已选值保留逻辑
|
|
@@ -12605,25 +12776,23 @@ class CmatSelectSearchComponent {
|
|
|
12605
12776
|
this.matSelect.ngControl.valueChanges?.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12606
12777
|
.subscribe((values) => {
|
|
12607
12778
|
let restoreSelectedValues = false;
|
|
12779
|
+
let currentValues = Array.isArray(values) ? values : [];
|
|
12608
12780
|
if (this.matSelect.multiple) {
|
|
12609
12781
|
if ((this.alwaysRestoreSelectedOptionsMulti || (this.formControl.value?.length))
|
|
12610
12782
|
&& this._previousSelectedValues && Array.isArray(this._previousSelectedValues)) {
|
|
12611
|
-
|
|
12612
|
-
values = [];
|
|
12613
|
-
}
|
|
12614
|
-
const optionValues = this.matSelect.options.map(option => option.value);
|
|
12783
|
+
const optionValues = this.matSelect.options.map((option) => option.value);
|
|
12615
12784
|
this._previousSelectedValues.forEach((previousValue) => {
|
|
12616
|
-
if (!
|
|
12617
|
-
&& !optionValues.some(v => this.matSelect.compareWith(v, previousValue))) {
|
|
12618
|
-
|
|
12785
|
+
if (!currentValues.some((v) => this.matSelect.compareWith(v, previousValue))
|
|
12786
|
+
&& !optionValues.some((v) => this.matSelect.compareWith(v, previousValue))) {
|
|
12787
|
+
currentValues.push(previousValue);
|
|
12619
12788
|
restoreSelectedValues = true;
|
|
12620
12789
|
}
|
|
12621
12790
|
});
|
|
12622
12791
|
}
|
|
12623
12792
|
}
|
|
12624
|
-
this._previousSelectedValues =
|
|
12793
|
+
this._previousSelectedValues = currentValues;
|
|
12625
12794
|
if (restoreSelectedValues) {
|
|
12626
|
-
this.matSelect._onChange(
|
|
12795
|
+
this.matSelect._onChange(currentValues);
|
|
12627
12796
|
}
|
|
12628
12797
|
});
|
|
12629
12798
|
}
|
|
@@ -12753,6 +12922,7 @@ class CmatSelectTableComponent {
|
|
|
12753
12922
|
this._nullRow = { id: null };
|
|
12754
12923
|
this._completeValueList = [];
|
|
12755
12924
|
this._placeholder = '';
|
|
12925
|
+
this._value = null;
|
|
12756
12926
|
this._required = false;
|
|
12757
12927
|
this._disabled = false;
|
|
12758
12928
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -12789,8 +12959,9 @@ class CmatSelectTableComponent {
|
|
|
12789
12959
|
this._matSelect.panelClass = [this._matSelect.panelClass, ...panelClass];
|
|
12790
12960
|
}
|
|
12791
12961
|
else if (typeof this._matSelect.panelClass === 'object') {
|
|
12962
|
+
const panelClassObject = this._matSelect.panelClass;
|
|
12792
12963
|
panelClass.forEach((i) => {
|
|
12793
|
-
|
|
12964
|
+
panelClassObject[i] = true;
|
|
12794
12965
|
});
|
|
12795
12966
|
}
|
|
12796
12967
|
}
|
|
@@ -12826,7 +12997,10 @@ class CmatSelectTableComponent {
|
|
|
12826
12997
|
this._matOptions
|
|
12827
12998
|
.toArray()
|
|
12828
12999
|
.filter(option => !isNil(option) && !isNil(option.value) && !option._getHostElement().classList.contains('contains-cmat-select-search'))
|
|
12829
|
-
.forEach(option =>
|
|
13000
|
+
.forEach((option) => {
|
|
13001
|
+
const row = option.value;
|
|
13002
|
+
options[`${row.id}`] = option;
|
|
13003
|
+
});
|
|
12830
13004
|
const tableOptions = this._buildTableOptions(options);
|
|
12831
13005
|
this._matSelect?.options.reset(this._matSelectSearch ? [this._matOptions.first, ...tableOptions] : tableOptions);
|
|
12832
13006
|
try {
|
|
@@ -12930,11 +13104,13 @@ class CmatSelectTableComponent {
|
|
|
12930
13104
|
if (!isNil(changes.resetFiltersOnOpen) && changes.resetFiltersOnOpen.currentValue !== false) {
|
|
12931
13105
|
this._resetFilters();
|
|
12932
13106
|
}
|
|
12933
|
-
if (!isNil(changes.dataSource)
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
13107
|
+
if (!isNil(changes.dataSource) && !isNil(changes.dataSource.currentValue)) {
|
|
13108
|
+
const currentDataSource = changes.dataSource.currentValue;
|
|
13109
|
+
if (!isArray(currentDataSource.data)) {
|
|
13110
|
+
return;
|
|
13111
|
+
}
|
|
13112
|
+
const columns = currentDataSource.columns;
|
|
13113
|
+
const data = currentDataSource.data;
|
|
12938
13114
|
this._rowById.clear();
|
|
12939
13115
|
this._columnKeys = columns.map((column) => column.key);
|
|
12940
13116
|
this.tableDataSource.set([...data]);
|
|
@@ -12983,8 +13159,9 @@ class CmatSelectTableComponent {
|
|
|
12983
13159
|
this.completeRowList.splice(0);
|
|
12984
13160
|
this._completeValueList.splice(0);
|
|
12985
13161
|
if (option.value) {
|
|
12986
|
-
|
|
12987
|
-
this.
|
|
13162
|
+
const row = option.value;
|
|
13163
|
+
this.completeRowList.push(row);
|
|
13164
|
+
this._completeValueList.push(row.id);
|
|
12988
13165
|
}
|
|
12989
13166
|
}
|
|
12990
13167
|
}
|
|
@@ -13007,7 +13184,8 @@ class CmatSelectTableComponent {
|
|
|
13007
13184
|
this.closed.emit(!opened);
|
|
13008
13185
|
return;
|
|
13009
13186
|
}
|
|
13010
|
-
this._table
|
|
13187
|
+
const table = this._table;
|
|
13188
|
+
table._headerRowDefChanged = true;
|
|
13011
13189
|
setTimeout(() => this._expandPanelForTableRows(), 1);
|
|
13012
13190
|
}
|
|
13013
13191
|
filterFormControl(key) {
|
|
@@ -13128,7 +13306,7 @@ class CmatSelectTableComponent {
|
|
|
13128
13306
|
if (isNil(this.overallFilterControl.value)) {
|
|
13129
13307
|
return;
|
|
13130
13308
|
}
|
|
13131
|
-
const filterValueLC = this.overallFilterControl.value.toLowerCase();
|
|
13309
|
+
const filterValueLC = (this.overallFilterControl.value ?? '').toLowerCase();
|
|
13132
13310
|
if (filterValueLC.trim().length === 0) {
|
|
13133
13311
|
return;
|
|
13134
13312
|
}
|
|
@@ -13226,7 +13404,19 @@ class CmatSelectTableComponent {
|
|
|
13226
13404
|
const columnFilter = filter.filter;
|
|
13227
13405
|
const comparator = columnFilter?.comparator;
|
|
13228
13406
|
const filterValue = filter.value;
|
|
13229
|
-
|
|
13407
|
+
let normalizedFilterValue;
|
|
13408
|
+
if (columnFilter?.type === 'number') {
|
|
13409
|
+
normalizedFilterValue = Number(filterValue);
|
|
13410
|
+
}
|
|
13411
|
+
else if (filterValue === null || filterValue === undefined) {
|
|
13412
|
+
normalizedFilterValue = '';
|
|
13413
|
+
}
|
|
13414
|
+
else if (typeof filterValue === 'object') {
|
|
13415
|
+
normalizedFilterValue = '';
|
|
13416
|
+
}
|
|
13417
|
+
else {
|
|
13418
|
+
normalizedFilterValue = filterValue;
|
|
13419
|
+
}
|
|
13230
13420
|
if (typeof columnFilter?.comparatorFn === 'function') {
|
|
13231
13421
|
return columnFilter.comparatorFn.call(null, cellValue, normalizedFilterValue, row);
|
|
13232
13422
|
}
|
|
@@ -13268,6 +13458,12 @@ class CmatSelectTableComponent {
|
|
|
13268
13458
|
_getMatOptionById(id) {
|
|
13269
13459
|
return this._matOptions.find(option => option.id === id);
|
|
13270
13460
|
}
|
|
13461
|
+
getFilterContext(column) {
|
|
13462
|
+
return { column };
|
|
13463
|
+
}
|
|
13464
|
+
getCellValue(row, key) {
|
|
13465
|
+
return row[key];
|
|
13466
|
+
}
|
|
13271
13467
|
_expandPanelForTableRows() {
|
|
13272
13468
|
let tableAdditionalHeight = 0;
|
|
13273
13469
|
this._table._getRenderedRows(this._table._headerRowOutlet).forEach(row => tableAdditionalHeight += row.getBoundingClientRect().height);
|
|
@@ -13302,7 +13498,7 @@ class CmatSelectTableComponent {
|
|
|
13302
13498
|
const rowRecord = row;
|
|
13303
13499
|
let hasMatch = false;
|
|
13304
13500
|
const substitution = template.replace(/[$]{1}[{]{1}([^}]+)[}]{1}?/g, (_, key) => {
|
|
13305
|
-
const value = rowRecord[key];
|
|
13501
|
+
const value = rowRecord[String(key)];
|
|
13306
13502
|
if (isNil(value)) {
|
|
13307
13503
|
return '';
|
|
13308
13504
|
}
|
|
@@ -13321,13 +13517,13 @@ class CmatSelectTableComponent {
|
|
|
13321
13517
|
return this._sortData([...value], this.triggerLabelSort.active, this.triggerLabelSort.direction);
|
|
13322
13518
|
}
|
|
13323
13519
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13324
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatSelectTableComponent, isStandalone: true, selector: "cmat-select-table", inputs: { id: "id", dataSource: "dataSource", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", isPhone: "isPhone", multiple: "multiple", overallSearchEnabled: "overallSearchEnabled", overallSearchVisible: "overallSearchVisible", resetSortOnOpen: "resetSortOnOpen", resetFiltersOnOpen: "resetFiltersOnOpen", customTriggerLabelFn: "customTriggerLabelFn", triggerLabelSort: "triggerLabelSort", customTriggerLabelTemplate: "customTriggerLabelTemplate", canNull: "canNull", defaultSort: "defaultSort", resetOptionAction: "resetOptionAction", keyParam: "keyParam", compareWith: "compareWith", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, outputs: { closed: "closed" }, host: { listeners: { "document:click": "clickedOut()" }, properties: { "attr.id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTableComponent }], viewQueries: [{ propertyName: "_matSelectSearch", first: true, predicate: CmatSelectSearchComponent$1, descendants: true }, { propertyName: "_sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "_table", first: true, predicate: MatTable, descendants: true }, { propertyName: "matSelect", first: true, predicate: ["componentSelect"], descendants: true }, { propertyName: "_matOptions", predicate: MatOption$1, descendants: true }], exportAs: ["cmatSelectTable"], usesOnChanges: true, ngImport: i0, template: "@if(multiple){\r\n<mat-select #componentSelect multiple disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @let triggerLabel = getTriggerLabel();\r\n {{ triggerLabel }}\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState()}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState() === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState() ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{selection: true, hidden: !multiple}\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{selection: true, hidden: !multiple}\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{row[columnKey]}}\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns();\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}@else {\r\n<mat-select #componentSelect disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState()}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState() === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState() ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if(row.id===null){\r\n <mat-option></mat-option>\r\n }@else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell\r\n [colSpan]=\"hasNullRow && row.id === null && $index === 1 ? tableColumns.length : 1\"\r\n [ngStyle]=\"{display: hasNullRow && row.id === null && $index !== 1 ? 'none' : ''}\">\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{hasNullRow && row.id === null && $index === 1 ? '\u7A7A' : row[columnKey]}}\r\n </div> \r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns();\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\"\r\n [placeholder]=\"column.name\" (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"], dependencies: [{ kind: "component", type: CmatSelectSearchComponent$1, selector: "cmat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "showNoFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"], exportAs: ["cmatSelectSearch"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$3.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: "directive", type: i2$3.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3$2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3$2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3$2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3$2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3$2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3$2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3$2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3$2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3$2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3$2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$3.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: MatSortModule }, { kind: "directive", type: i8.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i8.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: CmatDigitOnlyDirective$1, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
13520
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatSelectTableComponent, isStandalone: true, selector: "cmat-select-table", inputs: { id: "id", dataSource: "dataSource", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", isPhone: "isPhone", multiple: "multiple", overallSearchEnabled: "overallSearchEnabled", overallSearchVisible: "overallSearchVisible", resetSortOnOpen: "resetSortOnOpen", resetFiltersOnOpen: "resetFiltersOnOpen", customTriggerLabelFn: "customTriggerLabelFn", triggerLabelSort: "triggerLabelSort", customTriggerLabelTemplate: "customTriggerLabelTemplate", canNull: "canNull", defaultSort: "defaultSort", resetOptionAction: "resetOptionAction", keyParam: "keyParam", compareWith: "compareWith", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, outputs: { closed: "closed" }, host: { listeners: { "document:click": "clickedOut()" }, properties: { "attr.id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTableComponent }], viewQueries: [{ propertyName: "_matSelectSearch", first: true, predicate: CmatSelectSearchComponent$1, descendants: true }, { propertyName: "_sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "_table", first: true, predicate: MatTable, descendants: true }, { propertyName: "matSelect", first: true, predicate: ["componentSelect"], descendants: true }, { propertyName: "_matOptions", predicate: MatOption$1, descendants: true }], exportAs: ["cmatSelectTable"], usesOnChanges: true, ngImport: i0, template: "@if(multiple){\r\n<mat-select #componentSelect multiple disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @let triggerLabel = getTriggerLabel();\r\n {{ triggerLabel }}\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState()}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState() === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState() ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{selection: true, hidden: !multiple}\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{selection: true, hidden: !multiple}\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{getCellValue(row, columnKey)}}\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns();\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}@else {\r\n<mat-select #componentSelect disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState()}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState() === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState() ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if(row.id===null){\r\n <mat-option></mat-option>\r\n }@else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell\r\n [colSpan]=\"hasNullRow && row.id === null && $index === 1 ? tableColumns.length : 1\"\r\n [ngStyle]=\"{display: hasNullRow && row.id === null && $index !== 1 ? 'none' : ''}\">\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{hasNullRow && row.id === null && $index === 1 ? '\u7A7A' : getCellValue(row, columnKey)}}\r\n </div> \r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns();\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\"\r\n [placeholder]=\"column.name\" (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"], dependencies: [{ kind: "component", type: CmatSelectSearchComponent$1, selector: "cmat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "showNoFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"], exportAs: ["cmatSelectSearch"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$3.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: "directive", type: i2$3.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3$2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3$2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3$2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3$2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3$2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3$2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3$2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3$2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3$2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3$2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$3.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: MatSortModule }, { kind: "directive", type: i8.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i8.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: CmatDigitOnlyDirective$1, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
13325
13521
|
}
|
|
13326
13522
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectTableComponent, decorators: [{
|
|
13327
13523
|
type: Component,
|
|
13328
13524
|
args: [{ selector: 'cmat-select-table', exportAs: 'cmatSelectTable', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTableComponent }], imports: [CmatSelectSearchComponent$1, MatFormFieldModule, MatSelectModule, ReactiveFormsModule, CommonModule,
|
|
13329
13525
|
MatIconModule, MatTableModule, MatInputModule, MatSortModule, CmatDigitOnlyDirective$1
|
|
13330
|
-
], template: "@if(multiple){\r\n<mat-select #componentSelect multiple disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @let triggerLabel = getTriggerLabel();\r\n {{ triggerLabel }}\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState()}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState() === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState() ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{selection: true, hidden: !multiple}\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{selection: true, hidden: !multiple}\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{row[columnKey]}}\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns();\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}@else {\r\n<mat-select #componentSelect disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState()}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState() === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState() ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if(row.id===null){\r\n <mat-option></mat-option>\r\n }@else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell\r\n [colSpan]=\"hasNullRow && row.id === null && $index === 1 ? tableColumns.length : 1\"\r\n [ngStyle]=\"{display: hasNullRow && row.id === null && $index !== 1 ? 'none' : ''}\">\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{hasNullRow && row.id === null && $index === 1 ? '\u7A7A' : row[columnKey]}}\r\n </div> \r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns();\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\"\r\n [placeholder]=\"column.name\" (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"] }]
|
|
13526
|
+
], template: "@if(multiple){\r\n<mat-select #componentSelect multiple disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @let triggerLabel = getTriggerLabel();\r\n {{ triggerLabel }}\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState()}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState() === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState() ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{selection: true, hidden: !multiple}\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{selection: true, hidden: !multiple}\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{getCellValue(row, columnKey)}}\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns();\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}@else {\r\n<mat-select #componentSelect disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState()}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState() === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState() ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState() ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if(row.id===null){\r\n <mat-option></mat-option>\r\n }@else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell\r\n [colSpan]=\"hasNullRow && row.id === null && $index === 1 ? tableColumns.length : 1\"\r\n [ngStyle]=\"{display: hasNullRow && row.id === null && $index !== 1 ? 'none' : ''}\">\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{hasNullRow && row.id === null && $index === 1 ? '\u7A7A' : getCellValue(row, columnKey)}}\r\n </div> \r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns();\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\"\r\n [placeholder]=\"column.name\" (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"] }]
|
|
13331
13527
|
}], ctorParameters: () => [], propDecorators: { id: [{
|
|
13332
13528
|
type: HostBinding,
|
|
13333
13529
|
args: ['attr.id']
|
|
@@ -13606,7 +13802,9 @@ class CmatSelectTreeComponent {
|
|
|
13606
13802
|
}
|
|
13607
13803
|
}
|
|
13608
13804
|
onFocusOut(event) {
|
|
13609
|
-
|
|
13805
|
+
const relatedTarget = event.relatedTarget;
|
|
13806
|
+
const panelElement = this._matSelect.panel.nativeElement;
|
|
13807
|
+
if (!(relatedTarget instanceof Element) || !panelElement.contains(relatedTarget)) {
|
|
13610
13808
|
this.touched = true;
|
|
13611
13809
|
this.focused = false;
|
|
13612
13810
|
this._onTouchedChange();
|
|
@@ -14158,6 +14356,8 @@ class CmatSpeedDialComponent {
|
|
|
14158
14356
|
this._animationMode = 'fling';
|
|
14159
14357
|
this._fixed = false;
|
|
14160
14358
|
this._documentClickUnlistener = null;
|
|
14359
|
+
this._openChangeTimeoutId = null;
|
|
14360
|
+
this._dialOpened = signal(false, ...(ngDevMode ? [{ debugName: "_dialOpened" }] : /* istanbul ignore next */ []));
|
|
14161
14361
|
}
|
|
14162
14362
|
get fixed() {
|
|
14163
14363
|
return this._fixed;
|
|
@@ -14167,14 +14367,25 @@ class CmatSpeedDialComponent {
|
|
|
14167
14367
|
this._processOutsideClickState();
|
|
14168
14368
|
}
|
|
14169
14369
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
14370
|
+
get dialOpened() {
|
|
14371
|
+
return this._dialOpened();
|
|
14372
|
+
}
|
|
14373
|
+
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
14170
14374
|
get open() {
|
|
14171
14375
|
return this._open;
|
|
14172
14376
|
}
|
|
14173
14377
|
set open(open) {
|
|
14174
14378
|
const previousOpen = this._open;
|
|
14175
14379
|
this._open = open;
|
|
14380
|
+
this._dialOpened.set(this._open);
|
|
14176
14381
|
if (previousOpen !== this._open) {
|
|
14177
|
-
|
|
14382
|
+
if (this._openChangeTimeoutId !== null) {
|
|
14383
|
+
clearTimeout(this._openChangeTimeoutId);
|
|
14384
|
+
}
|
|
14385
|
+
this._openChangeTimeoutId = window.setTimeout(() => {
|
|
14386
|
+
this._openChangeTimeoutId = null;
|
|
14387
|
+
this.openChange.emit(this._open);
|
|
14388
|
+
});
|
|
14178
14389
|
if (this._isInitialized) {
|
|
14179
14390
|
this.setActionsVisibility();
|
|
14180
14391
|
}
|
|
@@ -14206,7 +14417,9 @@ class CmatSpeedDialComponent {
|
|
|
14206
14417
|
this._setElementClass(previousAnimationMode, false);
|
|
14207
14418
|
this._setElementClass(this.animationMode, true);
|
|
14208
14419
|
if (this._isInitialized) {
|
|
14209
|
-
|
|
14420
|
+
window.setTimeout(() => {
|
|
14421
|
+
this.open = false;
|
|
14422
|
+
});
|
|
14210
14423
|
}
|
|
14211
14424
|
}
|
|
14212
14425
|
}
|
|
@@ -14218,6 +14431,10 @@ class CmatSpeedDialComponent {
|
|
|
14218
14431
|
}
|
|
14219
14432
|
ngOnDestroy() {
|
|
14220
14433
|
this._unsetDocumentClickListener();
|
|
14434
|
+
if (this._openChangeTimeoutId !== null) {
|
|
14435
|
+
clearTimeout(this._openChangeTimeoutId);
|
|
14436
|
+
this._openChangeTimeoutId = null;
|
|
14437
|
+
}
|
|
14221
14438
|
}
|
|
14222
14439
|
toggle() {
|
|
14223
14440
|
this.open = !this.open;
|
|
@@ -14269,7 +14486,7 @@ class CmatSpeedDialComponent {
|
|
|
14269
14486
|
}
|
|
14270
14487
|
}
|
|
14271
14488
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSpeedDialComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14272
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: CmatSpeedDialComponent, isStandalone: true, selector: "cmat-speed-dial", inputs: { fixed: "fixed", open: "open", direction: "direction", animationMode: "animationMode" }, outputs: { openChange: "openChange" }, host: { listeners: { "click": "onClick()" }, properties: { "class.dial-opened": "this.
|
|
14489
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: CmatSpeedDialComponent, isStandalone: true, selector: "cmat-speed-dial", inputs: { fixed: "fixed", open: "open", direction: "direction", animationMode: "animationMode" }, outputs: { openChange: "openChange" }, host: { listeners: { "click": "onClick()" }, properties: { "class.dial-opened": "this.dialOpened" } }, queries: [{ propertyName: "_childActions", first: true, predicate: CmatSpeedDialActionsComponent, descendants: true }], ngImport: i0, template: `
|
|
14273
14490
|
<div class="cmat-speed-dial-container">
|
|
14274
14491
|
<ng-content select="cmat-speed-dial-trigger" />
|
|
14275
14492
|
<ng-content select="cmat-speed-dial-actions" />
|
|
@@ -14291,10 +14508,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
14291
14508
|
args: [CmatSpeedDialActionsComponent]
|
|
14292
14509
|
}], fixed: [{
|
|
14293
14510
|
type: Input
|
|
14294
|
-
}],
|
|
14511
|
+
}], dialOpened: [{
|
|
14295
14512
|
type: HostBinding,
|
|
14296
14513
|
args: ['class.dial-opened']
|
|
14297
|
-
}, {
|
|
14514
|
+
}], open: [{
|
|
14298
14515
|
type: Input
|
|
14299
14516
|
}], direction: [{
|
|
14300
14517
|
type: Input
|
|
@@ -14615,7 +14832,7 @@ class CmatToastModalComponent {
|
|
|
14615
14832
|
if (this.leaving())
|
|
14616
14833
|
return;
|
|
14617
14834
|
this.leaving.set(true);
|
|
14618
|
-
const el = this._elementRef.nativeElement
|
|
14835
|
+
const el = this._elementRef.nativeElement.querySelector('.toast');
|
|
14619
14836
|
if (el) {
|
|
14620
14837
|
const onEnd = () => {
|
|
14621
14838
|
cleanup();
|
|
@@ -14738,22 +14955,29 @@ class CmatToastService {
|
|
|
14738
14955
|
}
|
|
14739
14956
|
_setGlobalValues(toast) {
|
|
14740
14957
|
if (this._globalConfigs) {
|
|
14741
|
-
|
|
14742
|
-
|
|
14743
|
-
|
|
14744
|
-
|
|
14745
|
-
|
|
14958
|
+
const globalConfigs = this._globalConfigs;
|
|
14959
|
+
if (globalConfigs.title) {
|
|
14960
|
+
toast.title = globalConfigs.title;
|
|
14961
|
+
}
|
|
14962
|
+
if (globalConfigs.timeout !== undefined) {
|
|
14963
|
+
toast.timeout = globalConfigs.timeout;
|
|
14964
|
+
}
|
|
14965
|
+
if (globalConfigs.limit !== undefined) {
|
|
14966
|
+
toast.limit = globalConfigs.limit;
|
|
14746
14967
|
}
|
|
14747
|
-
if (
|
|
14748
|
-
toast.
|
|
14968
|
+
if (globalConfigs.isCountdown !== undefined) {
|
|
14969
|
+
toast.isCountdown = globalConfigs.isCountdown;
|
|
14749
14970
|
}
|
|
14750
|
-
if (
|
|
14751
|
-
toast.
|
|
14971
|
+
if (globalConfigs.theme) {
|
|
14972
|
+
toast.theme = `toasta-theme-${globalConfigs.theme}`;
|
|
14752
14973
|
}
|
|
14753
|
-
if (
|
|
14974
|
+
if (globalConfigs.position) {
|
|
14975
|
+
toast.position = `toasta-position-${globalConfigs.position}`;
|
|
14976
|
+
}
|
|
14977
|
+
if (globalConfigs.showClose === false) {
|
|
14754
14978
|
toast.showClose = false;
|
|
14755
14979
|
}
|
|
14756
|
-
if (
|
|
14980
|
+
if (globalConfigs.showDuration === false) {
|
|
14757
14981
|
toast.showDuration = false;
|
|
14758
14982
|
}
|
|
14759
14983
|
}
|
|
@@ -14768,7 +14992,7 @@ class CmatToastService {
|
|
|
14768
14992
|
...toast,
|
|
14769
14993
|
id: this._counter++,
|
|
14770
14994
|
};
|
|
14771
|
-
if (this.toasts.length >= toast.limit) {
|
|
14995
|
+
if (this.toasts.length >= (toast.limit ?? 0)) {
|
|
14772
14996
|
this.toasts.shift();
|
|
14773
14997
|
}
|
|
14774
14998
|
this.toasts.push(latestToast);
|
|
@@ -14828,7 +15052,7 @@ class CmatTransferPickerService {
|
|
|
14828
15052
|
['2', (a, b) => a > b],
|
|
14829
15053
|
['3', (a, b) => a < b],
|
|
14830
15054
|
['0,2', (a, b) => a >= b],
|
|
14831
|
-
['0,
|
|
15055
|
+
['0,3', (a, b) => a <= b]
|
|
14832
15056
|
]);
|
|
14833
15057
|
this._conditionMap = new Map([
|
|
14834
15058
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -14932,7 +15156,7 @@ class CmatTransferPickerService {
|
|
|
14932
15156
|
this._filteredDataSource.push(data);
|
|
14933
15157
|
}
|
|
14934
15158
|
else {
|
|
14935
|
-
compareResultArr.push(compare);
|
|
15159
|
+
compareResultArr.push(compare ?? false);
|
|
14936
15160
|
}
|
|
14937
15161
|
}
|
|
14938
15162
|
});
|
|
@@ -15008,12 +15232,12 @@ class CmatTransferPickerFilterComponent {
|
|
|
15008
15232
|
}
|
|
15009
15233
|
onFilterClick(filter) {
|
|
15010
15234
|
filter.selected = !filter.selected;
|
|
15011
|
-
const existFilter = this.filterData.filters.find(item => item.value === filter.value);
|
|
15235
|
+
const existFilter = this.filterData.filters.find((item) => item.value === filter.value);
|
|
15012
15236
|
if (!existFilter) {
|
|
15013
15237
|
this.filterData.filters.push(filter);
|
|
15014
15238
|
}
|
|
15015
15239
|
else if (!filter.selected) {
|
|
15016
|
-
this.filterData.filters.splice(this.filterData.filters.findIndex(j => j === filter), 1);
|
|
15240
|
+
this.filterData.filters.splice(this.filterData.filters.findIndex((j) => j === filter), 1);
|
|
15017
15241
|
}
|
|
15018
15242
|
this.changeFilterData();
|
|
15019
15243
|
}
|
|
@@ -15024,6 +15248,11 @@ class CmatTransferPickerFilterComponent {
|
|
|
15024
15248
|
changeFilterData() {
|
|
15025
15249
|
this._service.filterDataSource({ filterData: this.filterData });
|
|
15026
15250
|
}
|
|
15251
|
+
ngOnDestroy() {
|
|
15252
|
+
if (this.overlayRef) {
|
|
15253
|
+
this.overlayRef.dispose();
|
|
15254
|
+
}
|
|
15255
|
+
}
|
|
15027
15256
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15028
15257
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatTransferPickerFilterComponent, isStandalone: true, selector: "cmat-transfer-picker-filter", inputs: { filters: "filters" }, viewQueries: [{ propertyName: "overlayOrigin", first: true, predicate: CdkOverlayOrigin, descendants: true, static: true }, { propertyName: "filterTemplate", first: true, predicate: ["filterTemplate"], descendants: true, static: true }], exportAs: ["cmatTransferPickerFilter"], ngImport: i0, template: "<button type=\"button\" class=\"mr-2 mt-1\" matIconButton cdk-overlay-origin (click)=\"toggleFilter()\">\r\n <mat-icon svgIcon=\"mat_outline:filter_list\"></mat-icon>\r\n</button>\r\n<ng-template #filterTemplate=\"cdkPortal\" cdkPortal>\r\n <div\r\n class=\"transfer-picker-filter-panel bg-card flex flex-col flex-nowrap place-content-start box-border items-start w-full shadow\">\r\n <mat-button-toggle-group name=\"condition\" [hideSingleSelectionIndicator]=\"true\" (change)=\"onConditionChange($event.value)\">\r\n <mat-button-toggle value=\"or\" [checked]=\"filterData.condition === 'or'\">\u6216</mat-button-toggle>\r\n <mat-button-toggle value=\"and\" [checked]=\"filterData.condition === 'and'\">\u4E14</mat-button-toggle>\r\n </mat-button-toggle-group>\r\n\r\n <div class=\"chip-list\">\r\n @for (item of filters; track $index) {\r\n <div class=\"chip-wrapper\" role=\"presentation\"\r\n (click)=\"onFilterClick(item)\">\r\n <span class=\"chip\" [ngClass]=\"{selected: item?.selected}\">{{item.label}}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".transfer-picker-filter-panel{min-width:276px;padding:10px 0;border-width:1px}.transfer-picker-filter-panel .mat-button-toggle-group{font-size:12px;margin-right:15px;margin-bottom:20px;align-self:flex-end}.transfer-picker-filter-panel .mat-button-toggle-group .mat-button-toggle-label-content{line-height:1.8}.transfer-picker-filter-panel .chip-list{width:276px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;box-sizing:border-box}.transfer-picker-filter-panel .chip-list:after{content:\"\";flex:1 1 0%;max-width:33.333333%}.transfer-picker-filter-panel .chip-list .chip-wrapper{flex:1 1 0%;box-sizing:border-box;max-width:33.333333%;text-align:center;margin-bottom:20px}.transfer-picker-filter-panel .chip-list .chip-wrapper .chip{display:inline-block;min-width:50%;cursor:pointer;padding:5px 10px;font-size:12px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i1$h.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i1$h.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i4.CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i6.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
15029
15258
|
}
|
|
@@ -15049,7 +15278,7 @@ class CmatTransferPickerSearchComponent {
|
|
|
15049
15278
|
this.keyword
|
|
15050
15279
|
.valueChanges
|
|
15051
15280
|
.pipe(debounceTime$1(200), distinctUntilChanged())
|
|
15052
|
-
.subscribe((keyword) => this._service.filterDataSource({ keyword }));
|
|
15281
|
+
.subscribe((keyword) => this._service.filterDataSource({ keyword: keyword ?? '' }));
|
|
15053
15282
|
}
|
|
15054
15283
|
reset() {
|
|
15055
15284
|
this.keyword.setValue('');
|
|
@@ -15106,7 +15335,7 @@ class CmatTransferPickerSourceComponent {
|
|
|
15106
15335
|
: new CmatTransferItemFlatNode();
|
|
15107
15336
|
flatNode.label = node.label;
|
|
15108
15337
|
flatNode.value = node.value;
|
|
15109
|
-
flatNode.disabled = node.disabled;
|
|
15338
|
+
flatNode.disabled = !!node.disabled;
|
|
15110
15339
|
flatNode.level = level;
|
|
15111
15340
|
flatNode.expandable = !!node.children;
|
|
15112
15341
|
this.nestedNodeMap.set(node, flatNode);
|
|
@@ -15414,7 +15643,8 @@ class CmatTreeTableComponent {
|
|
|
15414
15643
|
if (this.data) {
|
|
15415
15644
|
this._treeTable = this._getFlattenNodes(this.data);
|
|
15416
15645
|
this.dataSource.set(this._generateDataSource());
|
|
15417
|
-
|
|
15646
|
+
const first = this.data[0];
|
|
15647
|
+
this.displayedColumns.set([...Object.keys(first).filter(x => typeof first[x] !== 'object' && first.showHeader?.includes(x)), 'operate']);
|
|
15418
15648
|
}
|
|
15419
15649
|
else {
|
|
15420
15650
|
this._treeTable = [];
|
|
@@ -15441,10 +15671,10 @@ class CmatTreeTableComponent {
|
|
|
15441
15671
|
_switchNodeVisible(node, visible) {
|
|
15442
15672
|
if (node.children) {
|
|
15443
15673
|
node.children.forEach((el) => {
|
|
15444
|
-
|
|
15674
|
+
el.isVisible = visible ?? !el.isVisible;
|
|
15445
15675
|
if (visible !== false)
|
|
15446
15676
|
el.isExpanded = true;
|
|
15447
|
-
this._switchNodeVisible(el, el.isVisible);
|
|
15677
|
+
this._switchNodeVisible(el, el.isVisible === undefined ? null : !!el.isVisible);
|
|
15448
15678
|
});
|
|
15449
15679
|
}
|
|
15450
15680
|
}
|
|
@@ -15526,7 +15756,7 @@ class CmatFilesUtilService {
|
|
|
15526
15756
|
observe: 'events',
|
|
15527
15757
|
reportProgress: true,
|
|
15528
15758
|
responseType: 'json'
|
|
15529
|
-
}).pipe(
|
|
15759
|
+
}).pipe(catchError(CmatUtilsService$1.handleError));
|
|
15530
15760
|
}
|
|
15531
15761
|
uploadFileToProcessed(file) {
|
|
15532
15762
|
return this._http.post(`${this._config.fileUrl}/upload/finish`, file, {
|
|
@@ -15534,7 +15764,7 @@ class CmatFilesUtilService {
|
|
|
15534
15764
|
observe: 'events',
|
|
15535
15765
|
reportProgress: true,
|
|
15536
15766
|
responseType: 'json'
|
|
15537
|
-
}).pipe(
|
|
15767
|
+
}).pipe(catchError(CmatUtilsService$1.handleError));
|
|
15538
15768
|
}
|
|
15539
15769
|
switchPublic(fileId, isPublic) {
|
|
15540
15770
|
return this._http.patch(`${this._config.fileUrl}/switch-public/${fileId}`, {
|
|
@@ -15542,12 +15772,12 @@ class CmatFilesUtilService {
|
|
|
15542
15772
|
isPublic
|
|
15543
15773
|
}, {
|
|
15544
15774
|
headers: CmatUtilsService$1.getRequestCryptoHeaders('files-switch-public')
|
|
15545
|
-
}).pipe(catchError(err => CmatUtilsService$1.handleError(err)));
|
|
15775
|
+
}).pipe(catchError((err) => CmatUtilsService$1.handleError(err)));
|
|
15546
15776
|
}
|
|
15547
15777
|
deleteFile(fileId) {
|
|
15548
15778
|
return this._http.delete(`${this._config.fileUrl}/${fileId}`, {
|
|
15549
15779
|
headers: CmatUtilsService$1.getRequestCryptoHeaders(fileId)
|
|
15550
|
-
}).pipe(catchError(err => CmatUtilsService$1.handleError(err)));
|
|
15780
|
+
}).pipe(catchError((err) => CmatUtilsService$1.handleError(err)));
|
|
15551
15781
|
}
|
|
15552
15782
|
getFileList(queryData, pageIndex = -1, pageSize = -1) {
|
|
15553
15783
|
if (this._config.enableDataProtect) {
|
|
@@ -15583,6 +15813,7 @@ class CmatUploadComponent {
|
|
|
15583
15813
|
this.isPublic = false;
|
|
15584
15814
|
this.editMode = false;
|
|
15585
15815
|
this.autoUpload = true;
|
|
15816
|
+
this.id = null;
|
|
15586
15817
|
this.removeEvent = new EventEmitter();
|
|
15587
15818
|
this.uploadEvent = new EventEmitter();
|
|
15588
15819
|
this.progressPercentage = signal(0, ...(ngDevMode ? [{ debugName: "progressPercentage" }] : /* istanbul ignore next */ []));
|
|
@@ -15625,22 +15856,29 @@ class CmatUploadComponent {
|
|
|
15625
15856
|
formData.set('fileData', this._file, this._file.name);
|
|
15626
15857
|
formData.append('fileInfo', JSON.stringify(fileModel));
|
|
15627
15858
|
this._fileService.uploadFile(formData).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
|
|
15628
|
-
if (event.type === HttpEventType.UploadProgress) {
|
|
15859
|
+
if (event.type === HttpEventType.UploadProgress && typeof event.total === 'number') {
|
|
15629
15860
|
this.progressPercentage.set(Math.floor(event.loaded * 100 / event.total));
|
|
15630
15861
|
this.loaded.set(event.loaded);
|
|
15631
15862
|
this.total.set(event.total);
|
|
15632
15863
|
}
|
|
15633
15864
|
if (event.type === HttpEventType.Response) {
|
|
15634
|
-
|
|
15635
|
-
|
|
15865
|
+
const fileId = typeof event.body?.id === 'string' ? event.body.id : undefined;
|
|
15866
|
+
if (!fileId) {
|
|
15867
|
+
this.isUploading.set(false);
|
|
15868
|
+
return;
|
|
15869
|
+
}
|
|
15870
|
+
this.id = fileId;
|
|
15871
|
+
this.file.id = fileId;
|
|
15636
15872
|
this.isUploading.set(false);
|
|
15637
15873
|
this.uploadEvent.emit(this.file);
|
|
15638
15874
|
}
|
|
15639
15875
|
});
|
|
15640
15876
|
}
|
|
15641
15877
|
download() {
|
|
15878
|
+
if (!this.id)
|
|
15879
|
+
return;
|
|
15642
15880
|
this._fileService.downloadFile(this.id).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((file) => {
|
|
15643
|
-
saveAs(new Blob([file.body], { type: 'text/plain;charset=utf-8' }), this.file.name);
|
|
15881
|
+
saveAs(new Blob([file.body ?? new Blob()], { type: 'text/plain;charset=utf-8' }), this.file.name);
|
|
15644
15882
|
});
|
|
15645
15883
|
}
|
|
15646
15884
|
remove() {
|
|
@@ -15689,7 +15927,7 @@ class CmatUploadQueueComponent {
|
|
|
15689
15927
|
this.outputRemoveIdEvent = new EventEmitter();
|
|
15690
15928
|
this.outputUploadIdEvent = new EventEmitter();
|
|
15691
15929
|
this.outputFilesDataEvent = new EventEmitter();
|
|
15692
|
-
this.id = 'cmatupload-' +
|
|
15930
|
+
this.id = 'cmatupload-' + crypto.randomUUID().slice(0, 8);
|
|
15693
15931
|
this.isHandSet = signal(false, ...(ngDevMode ? [{ debugName: "isHandSet" }] : /* istanbul ignore next */ []));
|
|
15694
15932
|
this._cmatMediaWatcherService = inject(CmatMediaWatcherService$1);
|
|
15695
15933
|
this._elementRef = inject(ElementRef);
|
|
@@ -15701,7 +15939,9 @@ class CmatUploadQueueComponent {
|
|
|
15701
15939
|
});
|
|
15702
15940
|
}
|
|
15703
15941
|
onDrop(event) {
|
|
15704
|
-
const files = event.dataTransfer
|
|
15942
|
+
const files = event.dataTransfer?.files;
|
|
15943
|
+
if (!files)
|
|
15944
|
+
return;
|
|
15705
15945
|
for (const file of files) {
|
|
15706
15946
|
if (this.accept?.includes(file.type))
|
|
15707
15947
|
this.add(file);
|
|
@@ -15713,7 +15953,10 @@ class CmatUploadQueueComponent {
|
|
|
15713
15953
|
event.preventDefault();
|
|
15714
15954
|
}
|
|
15715
15955
|
ngAfterViewInit() {
|
|
15716
|
-
const fileUpload = this._elementRef.nativeElement.querySelector(
|
|
15956
|
+
const fileUpload = this._elementRef.nativeElement.querySelector(`#${this.id}`);
|
|
15957
|
+
if (!(fileUpload instanceof HTMLInputElement)) {
|
|
15958
|
+
return;
|
|
15959
|
+
}
|
|
15717
15960
|
fileUpload.onchange = () => {
|
|
15718
15961
|
for (let index = 0; index < (fileUpload.files?.length ?? 0); index++) {
|
|
15719
15962
|
const file = fileUpload.files[index];
|
|
@@ -15737,12 +15980,13 @@ class CmatUploadQueueComponent {
|
|
|
15737
15980
|
}
|
|
15738
15981
|
}
|
|
15739
15982
|
upload(event) {
|
|
15740
|
-
|
|
15983
|
+
const uploadId = event instanceof CmatUploadComponent ? event.id : event.id;
|
|
15984
|
+
this.outputUploadIdEvent.emit(uploadId ?? '');
|
|
15741
15985
|
this.outputFilesDataEvent.emit(this.filesData);
|
|
15742
15986
|
}
|
|
15743
15987
|
remove(event) {
|
|
15744
15988
|
if (this.filesData) {
|
|
15745
|
-
const index = this.filesData.findIndex(j => j === event.file);
|
|
15989
|
+
const index = this.filesData.findIndex((j) => j === event.file);
|
|
15746
15990
|
if (index > -1) {
|
|
15747
15991
|
this.filesData.splice(index, 1);
|
|
15748
15992
|
if (event.file.id) {
|
|
@@ -15763,7 +16007,7 @@ class CmatUploadQueueComponent {
|
|
|
15763
16007
|
this.fileUploads.forEach((fileUpload) => { fileUpload.remove(); });
|
|
15764
16008
|
}
|
|
15765
16009
|
choose() {
|
|
15766
|
-
this._elementRef.nativeElement.querySelector(
|
|
16010
|
+
this._elementRef.nativeElement.querySelector(`#${this.id}`)?.dispatchEvent(new MouseEvent('click'));
|
|
15767
16011
|
}
|
|
15768
16012
|
isFileTypeAccepted(fileType) {
|
|
15769
16013
|
if (!this.accept || this.accept === '') {
|
|
@@ -15963,8 +16207,8 @@ class AngularShapeView extends NodeView {
|
|
|
15963
16207
|
return container;
|
|
15964
16208
|
}
|
|
15965
16209
|
getNgArguments() {
|
|
15966
|
-
const
|
|
15967
|
-
return
|
|
16210
|
+
const cell = this.cell;
|
|
16211
|
+
return cell.data?.ngArguments ?? {};
|
|
15968
16212
|
}
|
|
15969
16213
|
setInstanceInput(content, ref) {
|
|
15970
16214
|
const ngArguments = this.getNgArguments();
|
|
@@ -16414,7 +16658,7 @@ class WorksheetExporter extends FileExporter {
|
|
|
16414
16658
|
}
|
|
16415
16659
|
async createContent(rows, options) {
|
|
16416
16660
|
const workSheet = (await import('xlsx')).utils.json_to_sheet(rows, {
|
|
16417
|
-
skipHeader: true
|
|
16661
|
+
skipHeader: true
|
|
16418
16662
|
});
|
|
16419
16663
|
return await this.workSheetToContent(workSheet, options);
|
|
16420
16664
|
}
|
|
@@ -16774,7 +17018,7 @@ class CmatDigitOnlyDirective {
|
|
|
16774
17018
|
}
|
|
16775
17019
|
onInputChange(event) {
|
|
16776
17020
|
const reg = /^-?(0|[1-9][0-9]*)(\.[0-9]*)?$/;
|
|
16777
|
-
const value = event.target
|
|
17021
|
+
const value = event.target?.value ?? '';
|
|
16778
17022
|
if ((!isNaN(+value) && reg.test(value)) || value === '' || value === '-') {
|
|
16779
17023
|
this.value = value;
|
|
16780
17024
|
}
|
|
@@ -16840,8 +17084,9 @@ class CmatDigitOnlyDirective {
|
|
|
16840
17084
|
onPaste(event) {
|
|
16841
17085
|
if (this.allowPaste === true) {
|
|
16842
17086
|
let pastedInput = '';
|
|
16843
|
-
|
|
16844
|
-
|
|
17087
|
+
const legacyWindow = window;
|
|
17088
|
+
if (legacyWindow.clipboardData) {
|
|
17089
|
+
pastedInput = legacyWindow.clipboardData.getData('text');
|
|
16845
17090
|
}
|
|
16846
17091
|
else if (event.clipboardData?.getData) {
|
|
16847
17092
|
pastedInput = event.clipboardData.getData('text/plain');
|
|
@@ -16880,20 +17125,13 @@ class CmatDigitOnlyDirective {
|
|
|
16880
17125
|
!this._getSelection().includes(this.negativeSign)) {
|
|
16881
17126
|
return;
|
|
16882
17127
|
}
|
|
16883
|
-
|
|
16884
|
-
|
|
16885
|
-
|
|
16886
|
-
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
'undefined') {
|
|
16891
|
-
this.inputElement.dispatchEvent(new Event('input', { cancelable: true }));
|
|
16892
|
-
}
|
|
16893
|
-
}
|
|
16894
|
-
else {
|
|
16895
|
-
this._insertAtCursor(this.inputElement, sanitizedContent);
|
|
16896
|
-
}
|
|
17128
|
+
if (this.inputElement.setRangeText) {
|
|
17129
|
+
const { selectionStart: start, selectionEnd: end } = this.inputElement;
|
|
17130
|
+
this.inputElement.setRangeText(sanitizedContent, start ?? 0, end ?? 0, 'end');
|
|
17131
|
+
this.inputElement.dispatchEvent(new Event('input', { cancelable: true }));
|
|
17132
|
+
}
|
|
17133
|
+
else {
|
|
17134
|
+
this._insertAtCursor(this.inputElement, sanitizedContent);
|
|
16897
17135
|
}
|
|
16898
17136
|
if (this.decimal) {
|
|
16899
17137
|
this._hasDecimalPoint =
|
|
@@ -17036,7 +17274,7 @@ class CmatMaskDirective {
|
|
|
17036
17274
|
this.inputElement = el.nativeElement;
|
|
17037
17275
|
}
|
|
17038
17276
|
onInputChange(event) {
|
|
17039
|
-
const value = event.target
|
|
17277
|
+
const value = event.target?.value ?? '';
|
|
17040
17278
|
if (this.regex.test(value)) {
|
|
17041
17279
|
this.value = value;
|
|
17042
17280
|
}
|
|
@@ -17171,8 +17409,9 @@ class CmatSeamlessAutoScrollDirective {
|
|
|
17171
17409
|
}
|
|
17172
17410
|
}
|
|
17173
17411
|
_checkScrollCondition() {
|
|
17174
|
-
|
|
17175
|
-
this.
|
|
17412
|
+
const hostElement = this._viewContainer.element.nativeElement;
|
|
17413
|
+
this._containerElement = hostElement.parentElement?.parentElement ?? null;
|
|
17414
|
+
this._contentElement = hostElement.parentElement ?? null;
|
|
17176
17415
|
if (!this._containerElement || !this._contentElement)
|
|
17177
17416
|
return;
|
|
17178
17417
|
const containerSize = this.direction === 'up' || this.direction === 'down'
|
|
@@ -17300,7 +17539,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
17300
17539
|
class CmatFindByKeyPipe {
|
|
17301
17540
|
transform(value, key, source) {
|
|
17302
17541
|
if (Array.isArray(value)) {
|
|
17303
|
-
return value.map(item => source.find(sourceItem => sourceItem[key] === item));
|
|
17542
|
+
return value.map(item => source.find(sourceItem => sourceItem[key] === item)).filter((item) => !!item);
|
|
17304
17543
|
}
|
|
17305
17544
|
return source.find(sourceItem => sourceItem[key] === value);
|
|
17306
17545
|
}
|
|
@@ -17318,18 +17557,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
17318
17557
|
class CmatGroupByPipe {
|
|
17319
17558
|
transform(value, field) {
|
|
17320
17559
|
if (!value) {
|
|
17321
|
-
return
|
|
17560
|
+
return [];
|
|
17322
17561
|
}
|
|
17323
17562
|
const groupedObj = value.reduce((prev, cur) => {
|
|
17324
|
-
|
|
17325
|
-
|
|
17563
|
+
const rawValue = cur[field];
|
|
17564
|
+
const groupKey = typeof rawValue === 'string' || typeof rawValue === 'number' || typeof rawValue === 'boolean' || typeof rawValue === 'bigint'
|
|
17565
|
+
? String(rawValue)
|
|
17566
|
+
: '';
|
|
17567
|
+
if (!prev[groupKey]) {
|
|
17568
|
+
prev[groupKey] = [cur];
|
|
17326
17569
|
}
|
|
17327
17570
|
else {
|
|
17328
|
-
prev[
|
|
17571
|
+
prev[groupKey].push(cur);
|
|
17329
17572
|
}
|
|
17330
17573
|
return prev;
|
|
17331
17574
|
}, {});
|
|
17332
|
-
return Object.keys(groupedObj).map(key => ({ key, value: groupedObj[key] }));
|
|
17575
|
+
return Object.keys(groupedObj).map((key) => ({ key, value: groupedObj[key] }));
|
|
17333
17576
|
}
|
|
17334
17577
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatGroupByPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
17335
17578
|
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: CmatGroupByPipe, isStandalone: true, name: "cmatGroupBy" }); }
|
|
@@ -17370,6 +17613,7 @@ class CmatSecurePipe {
|
|
|
17370
17613
|
this._sanitizer = inject(DomSanitizer);
|
|
17371
17614
|
this._urlStateConfigService = inject(CmatUrlStateConfigService$1);
|
|
17372
17615
|
this._destroyRef = inject(DestroyRef);
|
|
17616
|
+
this._previousObjectUrl = null;
|
|
17373
17617
|
this._urlStateConfigService.config$
|
|
17374
17618
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17375
17619
|
.subscribe((config) => {
|
|
@@ -17385,7 +17629,14 @@ class CmatSecurePipe {
|
|
|
17385
17629
|
isStream: false
|
|
17386
17630
|
}
|
|
17387
17631
|
})
|
|
17388
|
-
.pipe(map((val) =>
|
|
17632
|
+
.pipe(map((val) => {
|
|
17633
|
+
if (this._previousObjectUrl) {
|
|
17634
|
+
URL.revokeObjectURL(this._previousObjectUrl);
|
|
17635
|
+
}
|
|
17636
|
+
const objectUrl = URL.createObjectURL(val);
|
|
17637
|
+
this._previousObjectUrl = objectUrl;
|
|
17638
|
+
return this._sanitizer.bypassSecurityTrustUrl(objectUrl);
|
|
17639
|
+
}));
|
|
17389
17640
|
}
|
|
17390
17641
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSecurePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
17391
17642
|
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: CmatSecurePipe, isStandalone: true, name: "cmatSecure" }); }
|
|
@@ -17453,6 +17704,7 @@ class CmatAlertService {
|
|
|
17453
17704
|
this._stickyMessages = new Subject();
|
|
17454
17705
|
this._dialogs = new Subject();
|
|
17455
17706
|
this._isLoading = new Subject();
|
|
17707
|
+
this._loadingMessageId = null;
|
|
17456
17708
|
}
|
|
17457
17709
|
get dialogEvent$() {
|
|
17458
17710
|
return this._dialogs.asObservable();
|
|
@@ -17527,8 +17779,9 @@ class CmatAlertService {
|
|
|
17527
17779
|
if (this.isApiResult(error)) {
|
|
17528
17780
|
separatorOrDetail += error.msg;
|
|
17529
17781
|
}
|
|
17782
|
+
const serializedError = CmatUtilsService$1.safeStringify(error);
|
|
17530
17783
|
const msg = `Message.Severity: "${CmatMessageSeverity[severity]}", Message.Summary: "${data}",
|
|
17531
|
-
Message.Detail: "${separatorOrDetail}", Message.Error: "${
|
|
17784
|
+
Message.Detail: "${separatorOrDetail}", Message.Error: "${serializedError}"`;
|
|
17532
17785
|
switch (severity) {
|
|
17533
17786
|
case CmatMessageSeverity.info:
|
|
17534
17787
|
this.logInfo(msg);
|
|
@@ -17552,14 +17805,14 @@ class CmatAlertService {
|
|
|
17552
17805
|
}
|
|
17553
17806
|
startLoadingMessage(message = '载入中...', caption = '') {
|
|
17554
17807
|
this._isLoading.next(true);
|
|
17555
|
-
|
|
17808
|
+
this._clearLoadingMessageTimer();
|
|
17556
17809
|
this._loadingMessageId = setTimeout(() => {
|
|
17557
17810
|
this.showStickyMessage(caption, message, CmatMessageSeverity.wait);
|
|
17558
17811
|
}, 1000);
|
|
17559
17812
|
}
|
|
17560
17813
|
stopLoadingMessage() {
|
|
17561
17814
|
this._isLoading.next(false);
|
|
17562
|
-
|
|
17815
|
+
this._clearLoadingMessageTimer();
|
|
17563
17816
|
this.resetStickyMessage();
|
|
17564
17817
|
}
|
|
17565
17818
|
logDebug(msg) {
|
|
@@ -17592,10 +17845,17 @@ class CmatAlertService {
|
|
|
17592
17845
|
}
|
|
17593
17846
|
}
|
|
17594
17847
|
isApiResult(obj) {
|
|
17595
|
-
|
|
17596
|
-
|
|
17597
|
-
typeof
|
|
17598
|
-
typeof
|
|
17848
|
+
const result = obj;
|
|
17849
|
+
return typeof result === 'object' && result !== null
|
|
17850
|
+
&& typeof result.success === 'boolean'
|
|
17851
|
+
&& typeof result.msg === 'string'
|
|
17852
|
+
&& typeof result.type === 'number';
|
|
17853
|
+
}
|
|
17854
|
+
_clearLoadingMessageTimer() {
|
|
17855
|
+
if (this._loadingMessageId !== null) {
|
|
17856
|
+
clearTimeout(this._loadingMessageId);
|
|
17857
|
+
this._loadingMessageId = null;
|
|
17858
|
+
}
|
|
17599
17859
|
}
|
|
17600
17860
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
17601
17861
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatAlertService, providedIn: 'root' }); }
|
|
@@ -17916,13 +18176,13 @@ class CmatExportAsService {
|
|
|
17916
18176
|
_getCSV(config) {
|
|
17917
18177
|
return new Observable((observer) => {
|
|
17918
18178
|
const element = document.getElementById(config.elementIdOrContent);
|
|
17919
|
-
|
|
18179
|
+
const csv = [];
|
|
17920
18180
|
const rows = element?.querySelectorAll('table tr');
|
|
17921
|
-
rows
|
|
17922
|
-
|
|
18181
|
+
rows?.forEach((rowElement) => {
|
|
18182
|
+
const row = [];
|
|
17923
18183
|
const cols = rowElement.querySelectorAll('td, th');
|
|
17924
|
-
cols.
|
|
17925
|
-
row.push('"' + col.innerText + '"');
|
|
18184
|
+
Array.from(cols).forEach((col) => {
|
|
18185
|
+
row.push('"' + (col.textContent ?? col.innerText) + '"');
|
|
17926
18186
|
});
|
|
17927
18187
|
csv.push(row.join(','));
|
|
17928
18188
|
});
|
|
@@ -17965,17 +18225,17 @@ class CmatExportAsService {
|
|
|
17965
18225
|
}
|
|
17966
18226
|
_getJSON(config) {
|
|
17967
18227
|
return new Observable((observer) => {
|
|
17968
|
-
const data = [];
|
|
18228
|
+
const data = [];
|
|
17969
18229
|
const headers = [];
|
|
17970
18230
|
const table = document.getElementById(config.elementIdOrContent);
|
|
17971
18231
|
for (let index = 0; index < table.rows[0].cells.length; index++) {
|
|
17972
|
-
headers[index] = table.rows[0].cells[index].
|
|
18232
|
+
headers[index] = (table.rows[0].cells[index].textContent ?? '').toLowerCase().replace(/ /gi, '');
|
|
17973
18233
|
}
|
|
17974
18234
|
for (let i = 1; i < table.rows.length; i++) {
|
|
17975
18235
|
const tableRow = table.rows[i];
|
|
17976
|
-
|
|
18236
|
+
const rowData = {};
|
|
17977
18237
|
for (let j = 0; j < tableRow.cells.length; j++) {
|
|
17978
|
-
rowData[headers[j]] = tableRow.cells[j].
|
|
18238
|
+
rowData[headers[j]] = tableRow.cells[j].textContent ?? '';
|
|
17979
18239
|
}
|
|
17980
18240
|
data.push(rowData);
|
|
17981
18241
|
}
|
|
@@ -18020,7 +18280,8 @@ class CmatExportAsService {
|
|
|
18020
18280
|
});
|
|
18021
18281
|
}
|
|
18022
18282
|
_btoa(content) {
|
|
18023
|
-
|
|
18283
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
18284
|
+
return btoa(unescape(encodeURIComponent(content)));
|
|
18024
18285
|
}
|
|
18025
18286
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatExportAsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
18026
18287
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatExportAsService, providedIn: 'root' }); }
|
|
@@ -18135,14 +18396,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
18135
18396
|
}] });
|
|
18136
18397
|
|
|
18137
18398
|
class CmatLocalStorageService {
|
|
18138
|
-
|
|
18139
|
-
|
|
18399
|
+
constructor() {
|
|
18400
|
+
this._encryptionPrefix = '__enc__';
|
|
18140
18401
|
}
|
|
18141
|
-
|
|
18142
|
-
localStorage.
|
|
18402
|
+
getItem(key, options) {
|
|
18403
|
+
const raw = localStorage.getItem(key);
|
|
18404
|
+
if (raw === null) {
|
|
18405
|
+
return null;
|
|
18406
|
+
}
|
|
18407
|
+
let entry;
|
|
18408
|
+
try {
|
|
18409
|
+
entry = JSON.parse(raw);
|
|
18410
|
+
}
|
|
18411
|
+
catch {
|
|
18412
|
+
return raw;
|
|
18413
|
+
}
|
|
18414
|
+
if (entry.expiry && Date.now() > entry.expiry) {
|
|
18415
|
+
this.removeItem(key);
|
|
18416
|
+
return null;
|
|
18417
|
+
}
|
|
18418
|
+
let data = entry.data ?? raw;
|
|
18419
|
+
if (options?.encrypt || key.startsWith(this._encryptionPrefix)) {
|
|
18420
|
+
data = this._decrypt(data);
|
|
18421
|
+
}
|
|
18422
|
+
return data;
|
|
18423
|
+
}
|
|
18424
|
+
setItem(key, item, options) {
|
|
18425
|
+
let data = item;
|
|
18426
|
+
const storageKey = options?.encrypt ? this._encryptionPrefix + key : key;
|
|
18427
|
+
if (options?.encrypt) {
|
|
18428
|
+
data = this._encrypt(item);
|
|
18429
|
+
}
|
|
18430
|
+
const entry = {
|
|
18431
|
+
data,
|
|
18432
|
+
...(options?.ttl ? { expiry: Date.now() + options.ttl } : {})
|
|
18433
|
+
};
|
|
18434
|
+
localStorage.setItem(storageKey, JSON.stringify(entry));
|
|
18143
18435
|
}
|
|
18144
18436
|
removeItem(key) {
|
|
18145
18437
|
localStorage.removeItem(key);
|
|
18438
|
+
localStorage.removeItem(this._encryptionPrefix + key);
|
|
18439
|
+
}
|
|
18440
|
+
_encrypt(value) {
|
|
18441
|
+
return btoa(encodeURIComponent(value));
|
|
18442
|
+
}
|
|
18443
|
+
_decrypt(value) {
|
|
18444
|
+
return decodeURIComponent(atob(value));
|
|
18146
18445
|
}
|
|
18147
18446
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatLocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
18148
18447
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatLocalStorageService, providedIn: 'root' }); }
|
|
@@ -18273,11 +18572,11 @@ class CmatTitleService {
|
|
|
18273
18572
|
return route;
|
|
18274
18573
|
}), mergeMap(route => route.data))
|
|
18275
18574
|
.subscribe((data) => {
|
|
18276
|
-
let title = data['title'];
|
|
18575
|
+
let title = typeof data['title'] === 'string' ? data['title'] : '';
|
|
18277
18576
|
if (title) {
|
|
18278
18577
|
const fragment = this._router.url.split('#')[1];
|
|
18279
18578
|
if (fragment) {
|
|
18280
|
-
title +=
|
|
18579
|
+
title += ` | ${CmatUtilsService$1.toTitleCase(fragment)}`;
|
|
18281
18580
|
}
|
|
18282
18581
|
}
|
|
18283
18582
|
if (title) {
|
|
@@ -18353,14 +18652,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
18353
18652
|
}]
|
|
18354
18653
|
}], ctorParameters: () => [] });
|
|
18355
18654
|
|
|
18655
|
+
const CMAT_CRYPTO_CONFIG = new InjectionToken('CMAT_CRYPTO_CONFIG', {
|
|
18656
|
+
factory: () => ({
|
|
18657
|
+
key: '14789632236987411478963223698741',
|
|
18658
|
+
iv: '1478963223698741',
|
|
18659
|
+
specialParam: 'partymanageApi'
|
|
18660
|
+
})
|
|
18661
|
+
});
|
|
18662
|
+
function initializeCmatUtilsConfig(config) {
|
|
18663
|
+
CmatUtilsService.setCryptoConfig(config);
|
|
18664
|
+
}
|
|
18356
18665
|
class CmatUtilsService {
|
|
18357
18666
|
static { this.captionAndMessageSeparator = ':'; }
|
|
18358
18667
|
static { this.noNetworkMessageCaption = '无网络'; }
|
|
18359
18668
|
static { this.noNetworkMessageDetail = '无法连接服务器'; }
|
|
18360
18669
|
static { this.accessDeniedMessageCaption = '拒绝访问!'; }
|
|
18361
18670
|
static { this.accessDeniedMessageDetail = ''; }
|
|
18362
|
-
static { this.
|
|
18363
|
-
static { this.
|
|
18671
|
+
static { this._key = null; }
|
|
18672
|
+
static { this._iv = null; }
|
|
18673
|
+
static { this._specialParam = null; }
|
|
18674
|
+
static get key() {
|
|
18675
|
+
return this._key;
|
|
18676
|
+
}
|
|
18677
|
+
static get iv() {
|
|
18678
|
+
return this._iv;
|
|
18679
|
+
}
|
|
18680
|
+
static get specialParam() {
|
|
18681
|
+
return this._specialParam;
|
|
18682
|
+
}
|
|
18364
18683
|
get exactMatchOptions() {
|
|
18365
18684
|
return {
|
|
18366
18685
|
paths: 'exact',
|
|
@@ -18377,16 +18696,19 @@ class CmatUtilsService {
|
|
|
18377
18696
|
queryParams: 'subset'
|
|
18378
18697
|
};
|
|
18379
18698
|
}
|
|
18699
|
+
static setCryptoConfig(config) {
|
|
18700
|
+
this._key = UTF8.parse(config.key);
|
|
18701
|
+
this._iv = UTF8.parse(config.iv);
|
|
18702
|
+
this._specialParam = UTF8.parse(config.specialParam);
|
|
18703
|
+
}
|
|
18380
18704
|
static getRequestHeaders() {
|
|
18381
18705
|
return new HttpHeaders()
|
|
18382
|
-
.append('Access-Control-Allow-Origin', '*')
|
|
18383
18706
|
.append('Content-Type', 'application/json')
|
|
18384
18707
|
.append('Accept', `application/vnd.iman.v${CMAT_VERSION}+json, application/json, text/plain, */*`)
|
|
18385
18708
|
.append('App-Version', CMAT_VERSION);
|
|
18386
18709
|
}
|
|
18387
18710
|
static getRequestIdempotentHeaders() {
|
|
18388
18711
|
return new HttpHeaders()
|
|
18389
|
-
.append('Access-Control-Allow-Origin', '*')
|
|
18390
18712
|
.append('Content-Type', 'application/json')
|
|
18391
18713
|
.append('X-Request-ID', CmatUtilsService.newGuid())
|
|
18392
18714
|
.append('Accept', `application/vnd.iman.v${CMAT_VERSION}+json, application/json, text/plain, */*`)
|
|
@@ -18394,7 +18716,6 @@ class CmatUtilsService {
|
|
|
18394
18716
|
}
|
|
18395
18717
|
static getRequestBypassHeaders() {
|
|
18396
18718
|
return new HttpHeaders()
|
|
18397
|
-
.append('Access-Control-Allow-Origin', '*')
|
|
18398
18719
|
.append('Content-Type', 'application/json')
|
|
18399
18720
|
.append('bypass', 'true')
|
|
18400
18721
|
.append('Accept', `application/vnd.iman.v${CMAT_VERSION}+json, application/json, text/plain, */*`)
|
|
@@ -18402,7 +18723,6 @@ class CmatUtilsService {
|
|
|
18402
18723
|
}
|
|
18403
18724
|
static getRequestIdempotentBypassHeaders() {
|
|
18404
18725
|
return new HttpHeaders()
|
|
18405
|
-
.append('Access-Control-Allow-Origin', '*')
|
|
18406
18726
|
.append('Content-Type', 'application/json')
|
|
18407
18727
|
.append('X-Request-ID', CmatUtilsService.newGuid())
|
|
18408
18728
|
.append('bypass', 'true')
|
|
@@ -18411,34 +18731,30 @@ class CmatUtilsService {
|
|
|
18411
18731
|
}
|
|
18412
18732
|
static getRequestCryptoHeaders(params) {
|
|
18413
18733
|
return new HttpHeaders()
|
|
18414
|
-
.append('Access-Control-Allow-Origin', '*')
|
|
18415
18734
|
.append('Accept', `application/vnd.iman.v${CMAT_VERSION}+json, application/json, text/plain, */*`)
|
|
18416
|
-
.append('App-Version', this.getEncryptData(
|
|
18735
|
+
.append('App-Version', this.getEncryptData(params).toString());
|
|
18417
18736
|
}
|
|
18418
18737
|
static getRequestCryptoBypassHeaders(params) {
|
|
18419
18738
|
return new HttpHeaders()
|
|
18420
|
-
.append('Access-Control-Allow-Origin', '*')
|
|
18421
18739
|
.append('Accept', `application/vnd.iman.v${CMAT_VERSION}+json, application/json, text/plain, */*`)
|
|
18422
18740
|
.append('bypass', 'true')
|
|
18423
|
-
.append('App-Version', this.getEncryptData(
|
|
18741
|
+
.append('App-Version', this.getEncryptData(params).toString());
|
|
18424
18742
|
}
|
|
18425
18743
|
static getRequestCryptoIdempotentHeaders(params) {
|
|
18426
18744
|
return new HttpHeaders()
|
|
18427
|
-
.append('Access-Control-Allow-Origin', '*')
|
|
18428
18745
|
.append('X-Request-ID', CmatUtilsService.newGuid())
|
|
18429
18746
|
.append('Accept', `application/vnd.iman.v${CMAT_VERSION}+json, application/json, text/plain, */*`)
|
|
18430
|
-
.append('App-Version', this.getEncryptData(
|
|
18747
|
+
.append('App-Version', this.getEncryptData(params).toString());
|
|
18431
18748
|
}
|
|
18432
18749
|
static getRequestCryptoIdempotentBypassHeaders(params) {
|
|
18433
18750
|
return new HttpHeaders()
|
|
18434
|
-
.append('Access-Control-Allow-Origin', '*')
|
|
18435
18751
|
.append('X-Request-ID', CmatUtilsService.newGuid())
|
|
18436
18752
|
.append('Accept', `application/vnd.iman.v${CMAT_VERSION}+json, application/json, text/plain, */*`)
|
|
18437
18753
|
.append('bypass', 'true')
|
|
18438
|
-
.append('App-Version', this.getEncryptData(
|
|
18754
|
+
.append('App-Version', this.getEncryptData(params).toString());
|
|
18439
18755
|
}
|
|
18440
18756
|
static getEncryptData(data) {
|
|
18441
|
-
const src = UTF8.parse(data);
|
|
18757
|
+
const src = UTF8.parse(this.specialParam.toString() + data);
|
|
18442
18758
|
return AES.encrypt(src, this.key, {
|
|
18443
18759
|
iv: this.iv,
|
|
18444
18760
|
mode: CryptoJSCore.mode.CBC,
|
|
@@ -18454,14 +18770,17 @@ class CmatUtilsService {
|
|
|
18454
18770
|
}).toString(UTF8).toString();
|
|
18455
18771
|
}
|
|
18456
18772
|
static handleError(error) {
|
|
18457
|
-
if (error
|
|
18773
|
+
if (error instanceof ErrorEvent) {
|
|
18458
18774
|
console.error('Client side network error occurred:', error.message);
|
|
18459
18775
|
}
|
|
18460
|
-
else {
|
|
18776
|
+
else if (typeof error === 'object' && error !== null && 'status' in error) {
|
|
18777
|
+
const httpError = error;
|
|
18461
18778
|
console.error('Backend - ' +
|
|
18462
|
-
`status: ${
|
|
18463
|
-
`
|
|
18464
|
-
|
|
18779
|
+
`status: ${String(httpError.status)}, ` +
|
|
18780
|
+
`message: ${String(httpError.error)}`);
|
|
18781
|
+
}
|
|
18782
|
+
else {
|
|
18783
|
+
console.error('Unknown error occurred:', String(error));
|
|
18465
18784
|
}
|
|
18466
18785
|
return throwError(() => error ?? 'server error');
|
|
18467
18786
|
}
|
|
@@ -18473,27 +18792,35 @@ class CmatUtilsService {
|
|
|
18473
18792
|
}
|
|
18474
18793
|
else {
|
|
18475
18794
|
const responseObject = this.getResponseBody(data);
|
|
18476
|
-
if (responseObject &&
|
|
18795
|
+
if (responseObject && typeof responseObject === 'object') {
|
|
18477
18796
|
for (const key in responseObject) {
|
|
18478
18797
|
if (Object.prototype.hasOwnProperty.call(responseObject, key)) {
|
|
18798
|
+
const value = responseObject[key];
|
|
18799
|
+
const stringValue = typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);
|
|
18479
18800
|
if (key) {
|
|
18480
|
-
responses.push(`${key}${this.captionAndMessageSeparator} ${
|
|
18801
|
+
responses.push(`${key}${this.captionAndMessageSeparator} ${stringValue}`);
|
|
18481
18802
|
}
|
|
18482
|
-
else if (
|
|
18483
|
-
responses.push(
|
|
18803
|
+
else if (value) {
|
|
18804
|
+
responses.push(stringValue);
|
|
18484
18805
|
}
|
|
18485
18806
|
}
|
|
18486
18807
|
}
|
|
18487
18808
|
}
|
|
18488
18809
|
}
|
|
18489
|
-
|
|
18490
|
-
|
|
18810
|
+
const responseBody = this.getResponseBody(data);
|
|
18811
|
+
if (!responses.length && responseBody != null) {
|
|
18812
|
+
if (typeof responseBody === 'object') {
|
|
18813
|
+
responses.push(JSON.stringify(responseBody));
|
|
18814
|
+
}
|
|
18815
|
+
else {
|
|
18816
|
+
responses.push(String(responseBody));
|
|
18817
|
+
}
|
|
18491
18818
|
}
|
|
18492
18819
|
}
|
|
18493
18820
|
if (!responses.length) {
|
|
18494
|
-
responses.push(data.
|
|
18821
|
+
responses.push(typeof data === 'object' ? JSON.stringify(data) : String(data));
|
|
18495
18822
|
}
|
|
18496
|
-
if (this.checkAccessDenied(data)) {
|
|
18823
|
+
if (data instanceof HttpResponseBase && this.checkAccessDenied(data)) {
|
|
18497
18824
|
responses.splice(0, 0, `${this.accessDeniedMessageCaption}${this.captionAndMessageSeparator} ${this.accessDeniedMessageDetail}`);
|
|
18498
18825
|
}
|
|
18499
18826
|
return responses;
|
|
@@ -18529,7 +18856,7 @@ class CmatUtilsService {
|
|
|
18529
18856
|
if (response instanceof HttpErrorResponse) {
|
|
18530
18857
|
return response.error ?? response.message;
|
|
18531
18858
|
}
|
|
18532
|
-
return
|
|
18859
|
+
return null;
|
|
18533
18860
|
}
|
|
18534
18861
|
static checkNoNetwork(response) {
|
|
18535
18862
|
if (response instanceof HttpResponseBase) {
|
|
@@ -18568,7 +18895,7 @@ class CmatUtilsService {
|
|
|
18568
18895
|
return params;
|
|
18569
18896
|
}
|
|
18570
18897
|
static splitInTwo(text, separator) {
|
|
18571
|
-
const separatorIndex = separator ? text.indexOf(separator) : -1;
|
|
18898
|
+
const separatorIndex = separator && text.includes(separator) ? text.indexOf(separator) : -1;
|
|
18572
18899
|
if (separatorIndex === -1) {
|
|
18573
18900
|
return { firstPart: text, secondPart: null };
|
|
18574
18901
|
}
|
|
@@ -18588,13 +18915,14 @@ class CmatUtilsService {
|
|
|
18588
18915
|
if (!Object.prototype.hasOwnProperty.call(object, prop)) {
|
|
18589
18916
|
continue;
|
|
18590
18917
|
}
|
|
18591
|
-
|
|
18918
|
+
const value = object[prop];
|
|
18919
|
+
if (typeof value === 'object') {
|
|
18592
18920
|
continue;
|
|
18593
18921
|
}
|
|
18594
|
-
if (typeof
|
|
18922
|
+
if (typeof value === 'function') {
|
|
18595
18923
|
continue;
|
|
18596
18924
|
}
|
|
18597
|
-
simpleObject[prop] =
|
|
18925
|
+
simpleObject[prop] = value;
|
|
18598
18926
|
}
|
|
18599
18927
|
result = '[***Sanitized Object***]: ' + JSON.stringify(simpleObject);
|
|
18600
18928
|
return result;
|
|
@@ -18619,17 +18947,14 @@ class CmatUtilsService {
|
|
|
18619
18947
|
}
|
|
18620
18948
|
}
|
|
18621
18949
|
static toTitleCase(text) {
|
|
18622
|
-
return text.replace(/\w\S*/g, subString => subString.charAt(0).toUpperCase() + subString.substring(1).toLowerCase());
|
|
18950
|
+
return text.replace(/\w\S*/g, (subString) => subString.charAt(0).toUpperCase() + subString.substring(1).toLowerCase());
|
|
18623
18951
|
}
|
|
18624
18952
|
static toLowerCase(items) {
|
|
18625
18953
|
if (items instanceof Array) {
|
|
18626
|
-
const loweredRoles =
|
|
18627
|
-
for (let i = 0; i < items.length; i++) {
|
|
18628
|
-
loweredRoles[i] = items[i].toLowerCase();
|
|
18629
|
-
}
|
|
18954
|
+
const loweredRoles = items.map((item) => item.toLowerCase());
|
|
18630
18955
|
return loweredRoles;
|
|
18631
18956
|
}
|
|
18632
|
-
else if (typeof items === 'string'
|
|
18957
|
+
else if (typeof items === 'string') {
|
|
18633
18958
|
return items.toLowerCase();
|
|
18634
18959
|
}
|
|
18635
18960
|
return void 0;
|
|
@@ -18651,11 +18976,7 @@ class CmatUtilsService {
|
|
|
18651
18976
|
return base.replace(/\/$/, '');
|
|
18652
18977
|
}
|
|
18653
18978
|
static newGuid() {
|
|
18654
|
-
return
|
|
18655
|
-
const r = (Math.random() * 16) | 0;
|
|
18656
|
-
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
18657
|
-
return v.toString(16);
|
|
18658
|
-
});
|
|
18979
|
+
return crypto.randomUUID();
|
|
18659
18980
|
}
|
|
18660
18981
|
static testIsAbsoluteUrl(url) {
|
|
18661
18982
|
const r = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
@@ -18697,8 +19018,8 @@ class CmatUtilsService {
|
|
|
18697
19018
|
if (!Object.prototype.hasOwnProperty.call(decoded, 'exp')) {
|
|
18698
19019
|
return null;
|
|
18699
19020
|
}
|
|
18700
|
-
const date = new Date(0);
|
|
18701
|
-
date.setUTCSeconds(decoded.exp);
|
|
19021
|
+
const date = new Date(0);
|
|
19022
|
+
date.setUTCSeconds(Number(decoded.exp));
|
|
18702
19023
|
return date;
|
|
18703
19024
|
}
|
|
18704
19025
|
static isTokenExpired(token, offsetSeconds) {
|
|
@@ -18715,9 +19036,8 @@ class CmatUtilsService {
|
|
|
18715
19036
|
reader.onload = () => {
|
|
18716
19037
|
resolve(reader.result);
|
|
18717
19038
|
};
|
|
18718
|
-
reader.onerror = (
|
|
18719
|
-
|
|
18720
|
-
reject(e);
|
|
19039
|
+
reader.onerror = () => {
|
|
19040
|
+
reject(new Error('Failed to read file as Data URL'));
|
|
18721
19041
|
};
|
|
18722
19042
|
reader.readAsDataURL(file);
|
|
18723
19043
|
});
|
|
@@ -18727,8 +19047,8 @@ class CmatUtilsService {
|
|
|
18727
19047
|
const byteString = splitDataURI[0].includes('base64') ? atob(splitDataURI[1]) : decodeURI(splitDataURI[1]);
|
|
18728
19048
|
const mimeString = splitDataURI[0].split(':')[1].split(';')[0];
|
|
18729
19049
|
const ia = new Uint8Array(byteString.length);
|
|
18730
|
-
for (
|
|
18731
|
-
ia[i] =
|
|
19050
|
+
for (const [i, char] of [...byteString].entries()) {
|
|
19051
|
+
ia[i] = char.charCodeAt(0);
|
|
18732
19052
|
}
|
|
18733
19053
|
return new Blob([ia], { type: mimeString });
|
|
18734
19054
|
}
|
|
@@ -18754,7 +19074,7 @@ class CmatUtilsService {
|
|
|
18754
19074
|
break;
|
|
18755
19075
|
case 'application/vnd.ms-excel':
|
|
18756
19076
|
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
|
|
18757
|
-
fileType = '
|
|
19077
|
+
fileType = 'excel';
|
|
18758
19078
|
break;
|
|
18759
19079
|
case 'application/pdf':
|
|
18760
19080
|
fileType = 'pdf';
|
|
@@ -18771,7 +19091,7 @@ class CmatUtilsService {
|
|
|
18771
19091
|
case 'audio/mp4':
|
|
18772
19092
|
fileType = 'video';
|
|
18773
19093
|
break;
|
|
18774
|
-
case '
|
|
19094
|
+
case 'application/zip':
|
|
18775
19095
|
fileType = 'zip';
|
|
18776
19096
|
break;
|
|
18777
19097
|
}
|
|
@@ -18799,14 +19119,14 @@ class CmatUtilsService {
|
|
|
18799
19119
|
const lastPart = parts.pop();
|
|
18800
19120
|
let currentValue = jsonObject;
|
|
18801
19121
|
parts.forEach((part) => {
|
|
18802
|
-
if (Object.prototype.hasOwnProperty.call(currentValue, part)) {
|
|
19122
|
+
if (typeof currentValue === 'object' && currentValue !== null && Object.prototype.hasOwnProperty.call(currentValue, part)) {
|
|
18803
19123
|
currentValue = currentValue[part];
|
|
18804
19124
|
}
|
|
18805
19125
|
else {
|
|
18806
19126
|
currentValue = undefined;
|
|
18807
19127
|
}
|
|
18808
19128
|
});
|
|
18809
|
-
result[info.code] = currentValue
|
|
19129
|
+
result[info.code] = currentValue && typeof currentValue === 'object' && Object.prototype.hasOwnProperty.call(currentValue, lastPart) ? currentValue[lastPart] : '';
|
|
18810
19130
|
});
|
|
18811
19131
|
return result;
|
|
18812
19132
|
});
|
|
@@ -18836,5 +19156,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
18836
19156
|
* Generated bundle index. Do not edit.
|
|
18837
19157
|
*/
|
|
18838
19158
|
|
|
18839
|
-
export { AngularShape, AngularShapeView, CLOCK_INNER_RADIUS, CLOCK_OUTER_RADIUS, CLOCK_RADIUS, CLOCK_TICK_RADIUS, CMAT_APP_CONFIG, CMAT_DATETIMEPICKER_SCROLL_STRATEGY, CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY, CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, CMAT_DATETIMEPICKER_VALIDATORS, CMAT_DATETIMEPICKER_VALUE_ACCESSOR, CMAT_DATETIME_FORMATS, CMAT_DAYJS_DATETIME_FORMATS, CMAT_DAYJS_DATE_ADAPTER_OPTIONS, CMAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY, CMAT_DAYJS_DATE_FORMATS, CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR, CMAT_NATIVE_DATETIME_FORMATS, CNativeDatetimeAdapter, ChartNode, CmatAddonsWrapperComponent, CmatAlertDialog, CmatAlertMessage, CmatAlertService, CmatAnimationOnScrollDirective, CmatArrowCursorDirective, CmatAutofocusDirective, CmatBreadcrumbComponent, CmatBreadcrumbItemDirective, CmatBreadcrumbService, CmatButtonTypeComponent, CmatBytesPipe, CmatCardComponent, CmatCardWrapperComponent, CmatCarouselComponent, CmatCarouselFooterComponent, CmatCarouselHeaderComponent, CmatCarouselTemplateDirective, CmatCascadeBottomSheetComponent, CmatCascadeListComponent, CmatCascadeTypeComponent, CmatCheckListTypeComponent, CmatChipInputComponent, CmatChipsInputTypeComponent, CmatCodeEditorComponent, CmatColorPickerTypeComponent, CmatConfigService, CmatConfirmationService, CmatDataExporterDirective, CmatDataService, CmatDateFormatPipe, CmatDateRangeComponent, CmatDateRangeTypeComponent, CmatDateTimeDisplayComponent, CmatDatepickerTypeComponent, CmatDatetimepickerCalendarBodyComponent, CmatDatetimepickerCalendarCellComponent, CmatDatetimepickerCalendarComponent, CmatDatetimepickerClockComponent, CmatDatetimepickerComponent, CmatDatetimepickerContentComponent, CmatDatetimepickerFilterType, CmatDatetimepickerInputDirective, CmatDatetimepickerInputEvent, CmatDatetimepickerMonthViewComponent, CmatDatetimepickerToggleComponent, CmatDatetimepickerToggleIconDirective, CmatDatetimepickerYearViewComponent, CmatDebounceClickDirective, CmatDebounceKeyupDirective, CmatDialogType, CmatDigitOnlyDirective, CmatDrawerComponent, CmatDrawerService, CmatEmptyStateComponent, CmatEqualValidatorDirective, CmatExpansionWrapperComponent, CmatExportAsService, CmatFilePreviewComponent, CmatFilesUtilService, CmatFilterToolbarComponent, CmatFindByKeyPipe, CmatFormActionsComponent, CmatFormFieldWrapperComponent, CmatFullscreenComponent, CmatGroupByPipe, CmatHighlightComponent, CmatHighlightService, CmatHorizontalNavigationComponent, CmatImageComponent, CmatInlineLoadingComponent, CmatJsonEditorComponent, CmatKeysPipe, CmatKnobInputComponent, CmatKnobTypeComponent, CmatLoadingInterceptor, CmatLoadingService, CmatLocalStorageService, CmatMaskDirective, CmatMasonryComponent, CmatMaterialColorPickerComponent, CmatMediaWatcherService, CmatMessageSeverity, CmatMultiCheckboxTypeComponent, CmatNavigationItem, CmatNavigationService, CmatNumberTypeComponent, CmatOrgChartComponent, CmatOtpInputComponent, CmatPageHeaderComponent, CmatPaginatePipe, CmatPaginationComponent, CmatPaginationDirective, CmatPaginationService, CmatPanelWrapperComponent, CmatPassToggleVisibilityComponent, CmatPasswordStrengthComponent, CmatPasswordStrengthInfoComponent, CmatPlatformService, CmatPopoverComponent, CmatPopoverTargetDirective, CmatPopoverTriggerDirective, CmatProgressBarComponent, CmatQRCodeComponent, CmatQuillTypeComponent, CmatRadioTypeComponent, CmatRatingComponent, CmatRatingTypeComponent, CmatRepeatTypeComponent, CmatRichTextEditorComponent, CmatSeamlessAutoScrollDirective, CmatSecurePipe, CmatSelectSearchComponent, CmatSelectTableComponent, CmatSelectTableTypeComponent, CmatSelectTreeComponent, CmatSelectTreeFlatNode, CmatSelectTreeNode, CmatSelectTreeTypeComponent, CmatSelectTypeComponent, CmatSelectedColor, CmatSliderTypeComponent, CmatSpeedDialActionsComponent, CmatSpeedDialComponent, CmatSpeedDialTriggerComponent, CmatSplashScreenService, CmatStatusTagComponent, CmatStepperHorizontalTypeComponent, CmatStepperVerticalTypeComponent, CmatTabTypeComponent, CmatTableToolbarComponent, CmatTableTypeComponent, CmatTagsTypeComponent, CmatTextareaTypeComponent, CmatTimelineComponent, CmatTimelineItemComponent, CmatTimelineItemIconDirective, CmatTimelineItemLabelDirective, CmatTitleService, CmatToastComponent, CmatToastModalComponent, CmatToastService, CmatTransferFilterCondition, CmatTransferItemFlatNode, CmatTransferItemNode, CmatTransferPickerComponent, CmatTransferPickerFilterComponent, CmatTransferPickerSearchComponent, CmatTransferPickerService, CmatTransferPickerSourceComponent, CmatTransferPickerTargetComponent, CmatTranslationService, CmatTreeTableColumnDirective, CmatTreeTableComponent, CmatTreeTableNode, CmatUploadComponent, CmatUploadQueueComponent, CmatUploadTypeComponent, CmatUppercasePipe, CmatUrlStateConfigService, CmatUtilsService, CmatVerticalNavigationComponent, DatetimeAdapter, DayjsDateAdapter, DayjsDatetimeAdapter, ExportType, MAT_SELECTSEARCH_DEFAULT_OPTIONS, addonsExtension, configurableDefaultOptions, register, registerInfo };
|
|
19159
|
+
export { AngularShape, AngularShapeView, CLOCK_INNER_RADIUS, CLOCK_OUTER_RADIUS, CLOCK_RADIUS, CLOCK_TICK_RADIUS, CMAT_APP_CONFIG, CMAT_CRYPTO_CONFIG, CMAT_DATETIMEPICKER_SCROLL_STRATEGY, CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY, CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, CMAT_DATETIMEPICKER_VALIDATORS, CMAT_DATETIMEPICKER_VALUE_ACCESSOR, CMAT_DATETIME_FORMATS, CMAT_DAYJS_DATETIME_FORMATS, CMAT_DAYJS_DATE_ADAPTER_OPTIONS, CMAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY, CMAT_DAYJS_DATE_FORMATS, CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR, CMAT_NATIVE_DATETIME_FORMATS, CNativeDatetimeAdapter, ChartNode, CmatAddonsWrapperComponent, CmatAlertDialog, CmatAlertMessage, CmatAlertService, CmatAnimationOnScrollDirective, CmatArrowCursorDirective, CmatAutofocusDirective, CmatBreadcrumbComponent, CmatBreadcrumbItemDirective, CmatBreadcrumbService, CmatButtonTypeComponent, CmatBytesPipe, CmatCardComponent, CmatCardWrapperComponent, CmatCarouselComponent, CmatCarouselFooterComponent, CmatCarouselHeaderComponent, CmatCarouselTemplateDirective, CmatCascadeBottomSheetComponent, CmatCascadeListComponent, CmatCascadeTypeComponent, CmatCheckListTypeComponent, CmatChipInputComponent, CmatChipsInputTypeComponent, CmatCodeEditorComponent, CmatColorPickerTypeComponent, CmatConfigService, CmatConfirmationService, CmatDataExporterDirective, CmatDataService, CmatDateFormatPipe, CmatDateRangeComponent, CmatDateRangeTypeComponent, CmatDateTimeDisplayComponent, CmatDatepickerTypeComponent, CmatDatetimepickerCalendarBodyComponent, CmatDatetimepickerCalendarCellComponent, CmatDatetimepickerCalendarComponent, CmatDatetimepickerClockComponent, CmatDatetimepickerComponent, CmatDatetimepickerContentComponent, CmatDatetimepickerFilterType, CmatDatetimepickerInputDirective, CmatDatetimepickerInputEvent, CmatDatetimepickerMonthViewComponent, CmatDatetimepickerToggleComponent, CmatDatetimepickerToggleIconDirective, CmatDatetimepickerYearViewComponent, CmatDebounceClickDirective, CmatDebounceKeyupDirective, CmatDialogType, CmatDigitOnlyDirective, CmatDrawerComponent, CmatDrawerService, CmatEmptyStateComponent, CmatEqualValidatorDirective, CmatExpansionWrapperComponent, CmatExportAsService, CmatFilePreviewComponent, CmatFilesUtilService, CmatFilterToolbarComponent, CmatFindByKeyPipe, CmatFormActionsComponent, CmatFormFieldWrapperComponent, CmatFullscreenComponent, CmatGroupByPipe, CmatHighlightComponent, CmatHighlightService, CmatHorizontalNavigationComponent, CmatImageComponent, CmatInlineLoadingComponent, CmatJsonEditorComponent, CmatKeysPipe, CmatKnobInputComponent, CmatKnobTypeComponent, CmatLoadingInterceptor, CmatLoadingService, CmatLocalStorageService, CmatMaskDirective, CmatMasonryComponent, CmatMaterialColorPickerComponent, CmatMediaWatcherService, CmatMessageSeverity, CmatMultiCheckboxTypeComponent, CmatNavigationItem, CmatNavigationService, CmatNumberTypeComponent, CmatOrgChartComponent, CmatOtpInputComponent, CmatPageHeaderComponent, CmatPaginatePipe, CmatPaginationComponent, CmatPaginationDirective, CmatPaginationService, CmatPanelWrapperComponent, CmatPassToggleVisibilityComponent, CmatPasswordStrengthComponent, CmatPasswordStrengthInfoComponent, CmatPlatformService, CmatPopoverComponent, CmatPopoverTargetDirective, CmatPopoverTriggerDirective, CmatProgressBarComponent, CmatQRCodeComponent, CmatQuillTypeComponent, CmatRadioTypeComponent, CmatRatingComponent, CmatRatingTypeComponent, CmatRepeatTypeComponent, CmatRichTextEditorComponent, CmatSeamlessAutoScrollDirective, CmatSecurePipe, CmatSelectSearchComponent, CmatSelectTableComponent, CmatSelectTableTypeComponent, CmatSelectTreeComponent, CmatSelectTreeFlatNode, CmatSelectTreeNode, CmatSelectTreeTypeComponent, CmatSelectTypeComponent, CmatSelectedColor, CmatSliderTypeComponent, CmatSpeedDialActionsComponent, CmatSpeedDialComponent, CmatSpeedDialTriggerComponent, CmatSplashScreenService, CmatStatusTagComponent, CmatStepperHorizontalTypeComponent, CmatStepperVerticalTypeComponent, CmatTabTypeComponent, CmatTableToolbarComponent, CmatTableTypeComponent, CmatTagsTypeComponent, CmatTextareaTypeComponent, CmatTimelineComponent, CmatTimelineItemComponent, CmatTimelineItemIconDirective, CmatTimelineItemLabelDirective, CmatTitleService, CmatToastComponent, CmatToastModalComponent, CmatToastService, CmatTransferFilterCondition, CmatTransferItemFlatNode, CmatTransferItemNode, CmatTransferPickerComponent, CmatTransferPickerFilterComponent, CmatTransferPickerSearchComponent, CmatTransferPickerService, CmatTransferPickerSourceComponent, CmatTransferPickerTargetComponent, CmatTranslationService, CmatTreeTableColumnDirective, CmatTreeTableComponent, CmatTreeTableNode, CmatUploadComponent, CmatUploadQueueComponent, CmatUploadTypeComponent, CmatUppercasePipe, CmatUrlStateConfigService, CmatUtilsService, CmatVerticalNavigationComponent, DatetimeAdapter, DayjsDateAdapter, DayjsDatetimeAdapter, ExportType, MAT_SELECTSEARCH_DEFAULT_OPTIONS, addonsExtension, configurableDefaultOptions, initializeCmatUtilsConfig, register, registerInfo };
|
|
18840
19160
|
//# sourceMappingURL=cmat.mjs.map
|