cmat 0.0.47 → 0.0.49
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/components/cascade/index.d.ts +2 -1
- package/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-breadcrumb.mjs +9 -9
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +3 -3
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +12 -12
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +15 -12
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +3 -3
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +87 -87
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +3 -3
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +6 -6
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +3 -3
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +6 -6
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +3 -3
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +3 -3
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +3 -3
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +3 -3
- 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 +43 -45
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +39 -39
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +3 -3
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +9 -9
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +12 -12
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +9 -9
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +9 -9
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +3 -3
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +3 -3
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +3 -3
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +9 -9
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +3 -3
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +3 -3
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +9 -9
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +12 -12
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +9 -9
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +18 -18
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +6 -6
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +9 -9
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -6
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +3 -3
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-data-exporter.mjs +21 -21
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +9 -9
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +3 -3
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-services-alert.mjs +3 -3
- package/fesm2022/cmat-services-config.mjs +6 -6
- package/fesm2022/cmat-services-confirmation.mjs +6 -6
- package/fesm2022/cmat-services-data.mjs +3 -3
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-loading.mjs +6 -6
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-translation.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/package.json +36 -36
- package/styles/components/input.scss +4 -4
- package/styles/overrides/angular-material.scss +62 -63
- package/styles/overrides/fullcalendar.scss +17 -17
- package/styles/overrides/quill.scss +14 -14
- package/styles/tailwind.scss +2 -2
|
@@ -511,8 +511,8 @@ class CmatDateRangeComponent {
|
|
|
511
511
|
// If meridiem doesn't exist, create a moment using 24-hours format and return in
|
|
512
512
|
return dayjs(value, 'HH:mm').second(0);
|
|
513
513
|
}
|
|
514
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
515
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
514
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
515
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.5", type: CmatDateRangeComponent, isStandalone: true, selector: "cmat-date-range", inputs: { readonly: "readonly", dateFormat: "dateFormat", timeFormat: "timeFormat", timeRange: "timeRange", range: "range" }, outputs: { rangeChanged: "rangeChanged" }, providers: [
|
|
516
516
|
{
|
|
517
517
|
provide: NG_VALUE_ACCESSOR,
|
|
518
518
|
useExisting: forwardRef(() => CmatDateRangeComponent),
|
|
@@ -520,7 +520,7 @@ class CmatDateRangeComponent {
|
|
|
520
520
|
}
|
|
521
521
|
], viewQueries: [{ propertyName: "_matMonthView1", first: true, predicate: ["matMonthView1"], descendants: true }, { propertyName: "_matMonthView2", first: true, predicate: ["matMonthView2"], descendants: true }, { propertyName: "_pickerPanelOrigin", first: true, predicate: ["pickerPanelOrigin"], descendants: true, read: ElementRef }, { propertyName: "_pickerPanel", first: true, predicate: ["pickerPanel"], descendants: true }], exportAs: ["cmatDateRange"], ngImport: i0, template: "<div #pickerPanelOrigin role=\"presentation\" class=\"range\" (click)=\"openPickerPanel()\">\r\n\r\n <div class=\"start\">\r\n <div class=\"date\">{{range.startDate}}</div>\r\n @if (range.startTime) {\r\n <div class=\"time\">{{range.startTime}}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"separator\">-</div>\r\n\r\n <div class=\"end\">\r\n <div class=\"date\">{{range.endDate}}</div>\r\n @if (range.endTime) {\r\n <div class=\"time\">{{range.endTime}}</div>\r\n }\r\n </div>\r\n\r\n</div>\r\n\r\n<ng-template #pickerPanel>\r\n\r\n <!-- Start -->\r\n <div class=\"start\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <button type=\"button\" class=\"previous-button\" matIconButton tabindex=\"1\" (click)=\"prev()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-left'\"></mat-icon>\r\n </button>\r\n <div class=\"month-label\">{{getMonthLabel(1)}}</div>\r\n </div>\r\n <mat-month-view #matMonthView1 [dateFilter]=\"dateFilter()\" [dateClass]=\"dateClass()\"\r\n [(activeDate)]=\"activeDates.month1\" (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange) {\r\n <mat-form-field class=\"time start-time\">\r\n <input matInput tabindex=\"3\" [autocomplete]=\"'off'\" [formControl]=\"startTimeFormControl\"\r\n (blur)=\"updateStartTime($event)\">\r\n <mat-label>\u5F00\u59CB\u65F6\u95F4</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n <!-- End -->\r\n <div class=\"end\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <div class=\"month-label\">{{getMonthLabel(2)}}</div>\r\n <button type=\"button\" class=\"next-button\" matIconButton tabindex=\"2\" (click)=\"next()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-right'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-month-view #matMonthView2 [dateFilter]=\"dateFilter()\" [dateClass]=\"dateClass()\"\r\n [(activeDate)]=\"activeDates.month2\" (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange) {\r\n <mat-form-field class=\"time end-time\">\r\n <input matInput tabindex=\"4\" [formControl]=\"endTimeFormControl\" (blur)=\"updateEndTime($event)\">\r\n <mat-label>\u7ED3\u675F\u65F6\u95F4</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n </ng-template>", styles: ["cmat-date-range{display:flex}cmat-date-range .range{display:flex;width:100%;align-items:center;height:48px;min-height:48px;max-height:48px;cursor:pointer}cmat-date-range .range .start,cmat-date-range .range .end{display:flex;align-items:center;height:100%;padding:0 16px;border-radius:6px;border-width:1px;line-height:1}cmat-date-range .range .date{white-space:nowrap}cmat-date-range .range .date+.time{margin-left:8px}cmat-date-range .range .time{white-space:nowrap}cmat-date-range .separator{margin:0 8px}.cmat-date-range-panel{border-radius:4px;padding:24px}.cmat-date-range-panel .start,.cmat-date-range-panel .end{display:flex;flex-direction:column}.cmat-date-range-panel .start .month,.cmat-date-range-panel .end .month{max-width:196px;min-width:196px;width:196px}.cmat-date-range-panel .start .month .month-header,.cmat-date-range-panel .end .month .month-header{position:relative;display:flex;align-items:center;justify-content:center;height:32px;margin-bottom:16px}.cmat-date-range-panel .start .month .month-header .previous-button,.cmat-date-range-panel .start .month .month-header .next-button,.cmat-date-range-panel .end .month .month-header .previous-button,.cmat-date-range-panel .end .month .month-header .next-button{position:absolute;width:24px!important;height:24px!important;min-height:24px!important;max-height:24px!important;line-height:24px!important}.cmat-date-range-panel .start .month .month-header .previous-button,.cmat-date-range-panel .end .month .month-header .previous-button{left:0}.cmat-date-range-panel .start .month .month-header .next-button,.cmat-date-range-panel .end .month .month-header .next-button{right:0}.cmat-date-range-panel .start .month .month-header .month-label,.cmat-date-range-panel .end .month .month-header .month-label{font-weight:500}.cmat-date-range-panel .start .month mat-month-view,.cmat-date-range-panel .end .month mat-month-view{display:flex;min-height:188px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table{width:100%;border-collapse:collapse}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr[aria-hidden=true],.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr[aria-hidden=true]{display:none!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr:first-child td:first-child[aria-hidden=true],.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr:first-child td:first-child[aria-hidden=true]{visibility:hidden;pointer-events:none;opacity:0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr td .mat-calendar-body-cell-content,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr td .mat-calendar-body-cell-content{background-color:transparent!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-today,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-today{border:none!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell{width:28px!important;height:28px!important;padding:2px!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range:before{content:\"\";position:absolute;inset:2px 0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start:before{border-radius:999px 0 0 999px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start.cmat-date-range-end:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start.cmat-date-range-end:before{right:2px;border-radius:999px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-end:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-end:before{border-radius:0 999px 999px 0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell .mat-calendar-body-cell-content,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell .mat-calendar-body-cell-content{position:relative;top:0;left:0;width:24px;height:24px;font-size:12px}.cmat-date-range-panel .time{width:100%;max-width:196px}.cmat-date-range-panel .start{align-items:flex-start;margin-right:20px}.cmat-date-range-panel .start .month .month-label{margin-left:8px}.cmat-date-range-panel .end{align-items:flex-end;margin-left:20px}.cmat-date-range-panel .end .month .month-label{margin-right:8px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i4.MatMonthView, selector: "mat-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName", "activeDrag"], outputs: ["selectedChange", "_userSelection", "dragStarted", "dragEnded", "activeDateChange"], exportAs: ["matMonthView"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
522
522
|
}
|
|
523
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
523
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatDateRangeComponent, decorators: [{
|
|
524
524
|
type: Component,
|
|
525
525
|
args: [{ selector: 'cmat-date-range', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDateRange', providers: [
|
|
526
526
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-date-range.mjs","sources":["../../../projects/cmat/components/date-range/date-range.component.ts","../../../projects/cmat/components/date-range/date-range.component.html","../../../projects/cmat/components/date-range/cmat-components-date-range.ts"],"sourcesContent":["import { Overlay } from '@angular/cdk/overlay';\r\nimport { TemplatePortal } from '@angular/cdk/portal';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation, inject } from '@angular/core';\r\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCalendarCellCssClasses, MatMonthView, MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport dayjs, { Dayjs } from 'dayjs';\r\nimport isBetween from 'dayjs/plugin/isBetween';\r\nimport { Subject } from 'rxjs';\r\n\r\n\r\n@Component({\r\n selector: 'cmat-date-range',\r\n templateUrl: './date-range.component.html',\r\n styleUrls: ['./date-range.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatDateRange',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => CmatDateRangeComponent),\r\n multi: true\r\n }\r\n ],\r\n imports: [FormsModule, ReactiveFormsModule, MatButtonModule, MatIconModule,\r\n MatDatepickerModule, MatFormFieldModule,\r\n MatInputModule]\r\n})\r\nexport class CmatDateRangeComponent implements ControlValueAccessor, OnInit, OnDestroy {\r\n @Output() readonly rangeChanged: EventEmitter<{ start: string; end: string }> = new EventEmitter<{ start: string; end: string }>();\r\n @ViewChild('matMonthView1') private _matMonthView1: MatMonthView<any>;\r\n @ViewChild('matMonthView2') private _matMonthView2: MatMonthView<any>;\r\n @ViewChild('pickerPanelOrigin', { read: ElementRef }) private _pickerPanelOrigin: ElementRef;\r\n @ViewChild('pickerPanel') private _pickerPanel: TemplateRef<any>;\r\n\r\n activeDates: { month1: Dayjs | null; month2: Dayjs | null } = {\r\n month1: null,\r\n month2: null\r\n };\r\n setWhichDate: 'start' | 'end' = 'start';\r\n startTimeFormControl: FormControl;\r\n endTimeFormControl: FormControl;\r\n\r\n private _overlay = inject(Overlay);\r\n private _viewContainerRef = inject(ViewContainerRef);\r\n private _changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n private _dateFormat: string;\r\n private _onChange: (value: any) => void;\r\n private _onTouched: (value: any) => void;\r\n private _programmaticChange!: boolean;\r\n private _range: { start: Dayjs | null; end: Dayjs | null } = {\r\n start: null,\r\n end: null\r\n };\r\n private _timeFormat: string;\r\n private _timeRange: boolean;\r\n private _readonly: boolean;\r\n private readonly _timeRegExp: RegExp = new RegExp('^(0[0-9]|1[0-9]|2[0-4]|[0-9]):([0-5][0-9])(A|(?:AM)|P|(?:PM))?$', 'i');\r\n private _unsubscribeAll: Subject<any> = new Subject<any>();\r\n\r\n\r\n\r\n constructor() {\r\n dayjs.extend(isBetween);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this._onChange = (): void => { };\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this._onTouched = (): void => { };\r\n this.dateFormat = 'YYYY/MM/DD';\r\n this.timeFormat = '12';\r\n }\r\n\r\n get readonly(): boolean {\r\n return this._readonly;\r\n }\r\n\r\n @Input()\r\n set readonly(value) {\r\n this._readonly = value;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get dateFormat(): string {\r\n return this._dateFormat;\r\n }\r\n @Input()\r\n set dateFormat(value: string) {\r\n // Return if the values are the same\r\n if (this._dateFormat === value) {\r\n return;\r\n }\r\n\r\n // Store the value\r\n this._dateFormat = value;\r\n }\r\n\r\n /**\r\n * Setter & getter for timeFormat input */\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get timeFormat(): string {\r\n return this._timeFormat;\r\n }\r\n @Input()\r\n set timeFormat(value: string) {\r\n // Return if the values are the same\r\n if (this._timeFormat === value) {\r\n return;\r\n }\r\n\r\n // Set format based on the time format input\r\n this._timeFormat = value === '12' ? 'hh:mmA' : 'HH:mm';\r\n }\r\n\r\n\r\n\r\n /**\r\n * Setter & getter for timeRange input */\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get timeRange(): boolean {\r\n return this._timeRange;\r\n }\r\n @Input()\r\n set timeRange(value: boolean) {\r\n // Return if the values are the same\r\n if (this._timeRange === value) {\r\n return;\r\n }\r\n\r\n // Store the value\r\n this._timeRange = value;\r\n\r\n // If the time range turned off...\r\n if (!value && this._range.start && this._range.end) {\r\n this.range = {\r\n start: this._range.start.clone().startOf('day'),\r\n end: this._range.end.clone().endOf('day')\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Setter & getter for range input */\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get range(): any {\r\n if (this._range.start && this._range.end) {\r\n // Clone the range start and end\r\n const start = this._range.start.clone();\r\n const end = this._range.end.clone();\r\n\r\n // Build and return the range object\r\n return {\r\n startDate: start.clone().format(this.dateFormat),\r\n startTime: this.timeRange ? start.clone().format(this.timeFormat) : null,\r\n endDate: end.clone().format(this.dateFormat),\r\n endTime: this.timeRange ? end.clone().format(this.timeFormat) : null\r\n };\r\n }\r\n\r\n return void 0;\r\n }\r\n\r\n @Input()\r\n set range(value) {\r\n if (!value) {\r\n return;\r\n }\r\n\r\n // Check if the value is an object and has 'start' and 'end' values\r\n if (!value.start || !value.end) {\r\n console.error('Range input must have \"start\" and \"end\" properties!');\r\n\r\n return;\r\n }\r\n\r\n // Check if we are setting an individual date or both of them\r\n const whichDate = value.whichDate ?? null;\r\n\r\n // Get the start and end dates as moment\r\n const start = dayjs(value.start);\r\n const end = dayjs(value.end);\r\n\r\n // If we are only setting the start date...\r\n if (whichDate === 'start') {\r\n // Set the start date\r\n this._range.start = start.clone();\r\n\r\n // If the selected start date is after the end date...\r\n if (this._range.end && this._range.start.isAfter(this._range.end)) {\r\n // Set the end date to the start date but keep the end date's time\r\n const endDate = start.clone().hour(this._range.end.hour()).minute(this._range.end.minute()).second(this._range.end.second());\r\n\r\n // Test this new end date to see if it's ahead of the start date\r\n if (this._range.start.isBefore(endDate)) {\r\n // If it's, set the new end date\r\n this._range.end = endDate;\r\n }\r\n else {\r\n // Otherwise, set the end date same as the start date\r\n this._range.end = start.clone();\r\n }\r\n }\r\n }\r\n\r\n // If we are only setting the end date...\r\n if (whichDate === 'end') {\r\n // Set the end date\r\n this._range.end = end.clone();\r\n\r\n // If the selected end date is before the start date...\r\n if (this._range.start?.isAfter(this._range.end)) {\r\n // Set the start date to the end date but keep the start date's time\r\n const startDate = end.clone().hour(this._range.start.hour()).minute(this._range.start.minute()).second(this._range.start.second());\r\n\r\n // Test this new end date to see if it's ahead of the start date\r\n if (this._range.end.isAfter(startDate)) {\r\n // If it's, set the new start date\r\n this._range.start = startDate;\r\n }\r\n else {\r\n // Otherwise, set the start date same as the end date\r\n this._range.start = end.clone();\r\n }\r\n }\r\n }\r\n\r\n // If we are setting both dates...\r\n if (!whichDate) {\r\n // Set the start date\r\n this._range.start = start.clone();\r\n\r\n // If the start date is before the end date, set the end date as normal.\r\n // If the start date is after the end date, set the end date same as the start date.\r\n this._range.end = start.isBefore(end) ? end.clone() : start.clone();\r\n }\r\n\r\n if (this._range.start && this._range.end) {\r\n // Prepare another range object that holds the ISO formatted range dates\r\n const range = {\r\n start: this._range.start.clone().toISOString(),\r\n end: this._range.end.clone().toISOString()\r\n };\r\n\r\n // Emit the range changed event with the range\r\n this.rangeChanged.emit(range);\r\n\r\n // Update the model with the range if the change was not a programmatic change\r\n // Because programmatic changes trigger writeValue which triggers onChange and onTouched\r\n // internally causing them to trigger twice which breaks the form's pristine and touched\r\n // statuses.\r\n if (!this._programmaticChange) {\r\n this._onTouched(range);\r\n this._onChange(range);\r\n }\r\n\r\n // Set the active dates\r\n this.activeDates = {\r\n month1: this._range.start.clone(),\r\n month2: this._range.start.clone().add(1, 'month')\r\n };\r\n\r\n // Set the time form controls\r\n this.startTimeFormControl.setValue(this._range.start.clone().format(this._timeFormat).toString());\r\n this.endTimeFormControl.setValue(this._range.end.clone().format(this._timeFormat).toString());\r\n }\r\n\r\n // Run ngAfterContentInit on month views to trigger\r\n // re-render on month views if they are available\r\n if (this._matMonthView1 && this._matMonthView2) {\r\n this._matMonthView1.ngAfterContentInit();\r\n this._matMonthView2.ngAfterContentInit();\r\n }\r\n\r\n // Reset the programmatic change status\r\n this._programmaticChange = false;\r\n }\r\n // -----------------------------------------------------------------------------------------------------\r\n // @ Control Value Accessor\r\n // -----------------------------------------------------------------------------------------------------\r\n\r\n /**\r\n * Update the form model on change\r\n *\r\n * @param fn\r\n */\r\n registerOnChange(fn: any): void {\r\n this._onChange = fn;\r\n }\r\n\r\n /**\r\n * Update the form model on blur\r\n *\r\n * @param fn\r\n */\r\n registerOnTouched(fn: any): void {\r\n this._onTouched = fn;\r\n }\r\n\r\n /**\r\n * Write to view from model when the form model changes programmatically\r\n *\r\n * @param range\r\n */\r\n writeValue(range: { start: string; end: string }): void {\r\n // Set this change as a programmatic one\r\n this._programmaticChange = true;\r\n\r\n // Set the range\r\n this.range = range;\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n\r\n ngOnInit(): void {\r\n // Initialize the component\r\n this._init();\r\n }\r\n /**\r\n * On destroy\r\n */\r\n ngOnDestroy(): void {\r\n this._unsubscribeAll.next(void 0);\r\n this._unsubscribeAll.complete();\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this.writeValue = (): void => { };\r\n }\r\n\r\n // -----------------------------------------------------------------------------------------------------\r\n // @ Public methods\r\n // -----------------------------------------------------------------------------------------------------\r\n\r\n /**\r\n * Open the picker panel\r\n */\r\n openPickerPanel(): void {\r\n if (this.readonly)\r\n return;\r\n\r\n // Create the overlay\r\n const overlayRef = this._overlay.create({\r\n panelClass: 'cmat-date-range-panel',\r\n backdropClass: '',\r\n hasBackdrop: true,\r\n scrollStrategy: this._overlay.scrollStrategies.reposition(),\r\n positionStrategy: this._overlay.position()\r\n .flexibleConnectedTo(this._pickerPanelOrigin)\r\n .withPositions([\r\n {\r\n originX: 'start',\r\n originY: 'bottom',\r\n overlayX: 'start',\r\n overlayY: 'top',\r\n offsetY: 8\r\n },\r\n {\r\n originX: 'start',\r\n originY: 'top',\r\n overlayX: 'start',\r\n overlayY: 'bottom',\r\n offsetY: -8\r\n }\r\n ])\r\n });\r\n\r\n // Create a portal from the template\r\n const templatePortal = new TemplatePortal(this._pickerPanel, this._viewContainerRef);\r\n\r\n // On backdrop click\r\n overlayRef.backdropClick().subscribe(() => {\r\n\r\n // If template portal exists and attached...\r\n if (templatePortal?.isAttached) {\r\n // Detach it\r\n templatePortal.detach();\r\n }\r\n\r\n // If overlay exists and attached...\r\n if (overlayRef?.hasAttached()) {\r\n // Detach it\r\n overlayRef.detach();\r\n overlayRef.dispose();\r\n }\r\n });\r\n\r\n // Attach the portal to the overlay\r\n overlayRef.attach(templatePortal);\r\n }\r\n\r\n /**\r\n * Get month label\r\n *\r\n * @param month\r\n */\r\n getMonthLabel(month: number): string | void {\r\n if (month === 1) {\r\n return this.activeDates.month1?.clone().format('YYYY MMMM');\r\n }\r\n\r\n return this.activeDates.month2?.clone().format('YYYY MMMM');\r\n }\r\n\r\n /**\r\n * Date class function to add/remove class names to calendar days\r\n */\r\n dateClass(): any {\r\n return (date: Dayjs): MatCalendarCellCssClasses | void => {\r\n\r\n // If the date is both start and end date...\r\n if (date.isSame(this._range.start, 'day') && date.isSame(this._range.end, 'day')) {\r\n return ['cmat-date-range', 'cmat-date-range-start', 'cmat-date-range-end'];\r\n }\r\n\r\n // If the date is the start date...\r\n if (date.isSame(this._range.start, 'day')) {\r\n return ['cmat-date-range', 'cmat-date-range-start'];\r\n }\r\n\r\n // If the date is the end date...\r\n if (date.isSame(this._range.end, 'day')) {\r\n return ['cmat-date-range', 'cmat-date-range-end'];\r\n }\r\n\r\n // If the date is in between start and end dates...\r\n if (date.isBetween(this._range.start, this._range.end, 'day')) {\r\n return ['cmat-date-range', 'cmat-date-range-mid'];\r\n }\r\n\r\n return void 0;\r\n };\r\n }\r\n\r\n /**\r\n * Date filter to enable/disable calendar days\r\n */\r\n dateFilter(): any {\r\n // If we are selecting the end date, disable all the dates that comes before the start date\r\n return (date: Dayjs): boolean => !(this.setWhichDate === 'end' && date.isBefore(this._range.start, 'day'));\r\n }\r\n\r\n /**\r\n * On selected date change\r\n *\r\n * @param date\r\n */\r\n onSelectedDateChange(date: Dayjs): void {\r\n if (this._range.start && this._range.end) {\r\n // Create a new range object\r\n const newRange = {\r\n start: this._range.start.clone().toISOString(),\r\n end: this._range.end.clone().toISOString(),\r\n whichDate: ''\r\n };\r\n\r\n // Replace either the start or the end date with the new one\r\n // depending on which date we are setting\r\n if (this.setWhichDate === 'start') {\r\n newRange.start = dayjs(newRange.start).year(date.year()).month(date.month()).date(date.date()).toISOString();\r\n }\r\n else {\r\n newRange.end = dayjs(newRange.end).year(date.year()).month(date.month()).date(date.date()).toISOString();\r\n }\r\n\r\n // Append the which date to the new range object\r\n newRange.whichDate = this.setWhichDate;\r\n\r\n // Switch which date to set on the next run\r\n this.setWhichDate = this.setWhichDate === 'start' ? 'end' : 'start';\r\n\r\n // Set the range\r\n this.range = newRange;\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n }\r\n\r\n /**\r\n * Go to previous month on both views\r\n */\r\n prev(): void {\r\n this.activeDates.month1 = dayjs(this.activeDates.month1).subtract(1, 'month');\r\n this.activeDates.month2 = dayjs(this.activeDates.month2).subtract(1, 'month');\r\n }\r\n\r\n /**\r\n * Go to next month on both views\r\n */\r\n next(): void {\r\n this.activeDates.month1 = dayjs(this.activeDates.month1).add(1, 'month');\r\n this.activeDates.month2 = dayjs(this.activeDates.month2).add(1, 'month');\r\n }\r\n\r\n /**\r\n * Update the start time\r\n *\r\n * @param event\r\n */\r\n updateStartTime(event: any): void {\r\n // Parse the time\r\n const parsedTime = this._parseTime(event.target.value);\r\n\r\n // Go back to the previous value if the form control is not valid\r\n if (this.startTimeFormControl.invalid) {\r\n if (this._range.start) {\r\n // Override the time \r\n const time = this._range.start.clone().format(this._timeFormat);\r\n\r\n // Set the time\r\n this.startTimeFormControl.setValue(time);\r\n }\r\n // Do not update the range\r\n return;\r\n }\r\n\r\n if (this._range.start && this._range.end) {\r\n // Append the new time to the start date\r\n const startDate = this._range.start.clone().hour(parsedTime.hour()).minute(parsedTime.minute());\r\n\r\n // If the new start date is after the current end date,\r\n // use the end date's time and set the start date again\r\n if (startDate.isAfter(this._range.end)) {\r\n const endDateHours = this._range.end.hour();\r\n const endDateMinutes = this._range.end.minute();\r\n\r\n // Set the start date\r\n startDate.hour(endDateHours).minute(endDateMinutes);\r\n }\r\n\r\n // If everything is okay, set the new date\r\n this.range = {\r\n start: startDate.toISOString(),\r\n end: this._range.end.clone().toISOString(),\r\n whichDate: 'start'\r\n };\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n }\r\n\r\n /**\r\n * Update the end time\r\n *\r\n * @param event\r\n */\r\n updateEndTime(event: any): void {\r\n // Parse the time\r\n const parsedTime = this._parseTime(event.target.value);\r\n\r\n // Go back to the previous value if the form control is not valid\r\n if (this.endTimeFormControl.invalid) {\r\n if (this._range.end) {\r\n // Override the time\r\n const time = this._range.end.clone().format(this._timeFormat);\r\n\r\n // Set the time\r\n this.endTimeFormControl.setValue(time);\r\n }\r\n // Do not update the range\r\n return;\r\n }\r\n\r\n if (this._range.start && this._range.end) {\r\n // Append the new time to the end date\r\n const endDate = this._range.end.clone().hour(parsedTime.hour()).minute(parsedTime.minute());\r\n\r\n // If the new end date is before the current start date,\r\n // use the start date's time and set the end date again\r\n if (endDate.isBefore(this._range.start)) {\r\n const startDateHours = this._range.start.hour();\r\n const startDateMinutes = this._range.start.minute();\r\n\r\n // Set the end date\r\n endDate.hour(startDateHours).minute(startDateMinutes);\r\n }\r\n\r\n // If everything is okay, set the new date\r\n this.range = {\r\n start: this._range.start.clone().toISOString(),\r\n end: endDate.toISOString(),\r\n whichDate: 'end'\r\n };\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n }\r\n\r\n // -----------------------------------------------------------------------------------------------------\r\n // @ Private methods\r\n // -----------------------------------------------------------------------------------------------------\r\n\r\n /**\r\n * Initialize\r\n *\r\n * @private\r\n */\r\n private _init(): void {\r\n // Start and end time form controls\r\n this.startTimeFormControl = new FormControl('', [Validators.pattern(this._timeRegExp)]);\r\n this.endTimeFormControl = new FormControl('', [Validators.pattern(this._timeRegExp)]);\r\n\r\n // Set the default range\r\n this._programmaticChange = true;\r\n this.range = {\r\n start: dayjs().startOf('day').toISOString(),\r\n end: dayjs().add(1, 'day').endOf('day').toISOString()\r\n };\r\n\r\n // Set the default time range\r\n this._programmaticChange = true;\r\n this.timeRange = true;\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n\r\n /**\r\n * Parse the time from the inputs\r\n *\r\n * @param value\r\n * @private\r\n */\r\n private _parseTime(value: string): Dayjs {\r\n // Parse the time using the time regexp\r\n const timeArr = value.split(this._timeRegExp).filter(part => part !== '');\r\n\r\n // Get the meridiem\r\n const meridiem = timeArr[2] || null;\r\n\r\n // If meridiem exists...\r\n if (meridiem) {\r\n // Create a moment using 12-hours format and return it\r\n return dayjs(value, 'hh:mmA').second(0);\r\n }\r\n\r\n // If meridiem doesn't exist, create a moment using 24-hours format and return in\r\n return dayjs(value, 'HH:mm').second(0);\r\n }\r\n}\r\n","<div #pickerPanelOrigin role=\"presentation\" class=\"range\" (click)=\"openPickerPanel()\">\r\n\r\n <div class=\"start\">\r\n <div class=\"date\">{{range.startDate}}</div>\r\n @if (range.startTime) {\r\n <div class=\"time\">{{range.startTime}}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"separator\">-</div>\r\n\r\n <div class=\"end\">\r\n <div class=\"date\">{{range.endDate}}</div>\r\n @if (range.endTime) {\r\n <div class=\"time\">{{range.endTime}}</div>\r\n }\r\n </div>\r\n\r\n</div>\r\n\r\n<ng-template #pickerPanel>\r\n\r\n <!-- Start -->\r\n <div class=\"start\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <button type=\"button\" class=\"previous-button\" matIconButton tabindex=\"1\" (click)=\"prev()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-left'\"></mat-icon>\r\n </button>\r\n <div class=\"month-label\">{{getMonthLabel(1)}}</div>\r\n </div>\r\n <mat-month-view #matMonthView1 [dateFilter]=\"dateFilter()\" [dateClass]=\"dateClass()\"\r\n [(activeDate)]=\"activeDates.month1\" (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange) {\r\n <mat-form-field class=\"time start-time\">\r\n <input matInput tabindex=\"3\" [autocomplete]=\"'off'\" [formControl]=\"startTimeFormControl\"\r\n (blur)=\"updateStartTime($event)\">\r\n <mat-label>开始时间</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n <!-- End -->\r\n <div class=\"end\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <div class=\"month-label\">{{getMonthLabel(2)}}</div>\r\n <button type=\"button\" class=\"next-button\" matIconButton tabindex=\"2\" (click)=\"next()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-right'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-month-view #matMonthView2 [dateFilter]=\"dateFilter()\" [dateClass]=\"dateClass()\"\r\n [(activeDate)]=\"activeDates.month2\" (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange) {\r\n <mat-form-field class=\"time end-time\">\r\n <input matInput tabindex=\"4\" [formControl]=\"endTimeFormControl\" (blur)=\"updateEndTime($event)\">\r\n <mat-label>结束时间</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n </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AA,QAAA,EACrC,eAAe,EAAA,SAAA,EACd;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,4BAA4B,CAAC;AACrD,4BAAA,KAAK,EAAE;AACV;AACJ,qBAAA,EAAA,OAAA,EACQ,CAAC,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa;AACtE,wBAAA,mBAAmB,EAAE,kBAAkB;AACvC,wBAAA,cAAc,CAAC,EAAA,QAAA,EAAA,6oFAAA,EAAA,MAAA,EAAA,CAAA,wtKAAA,CAAA,EAAA;wDAGA,YAAY,EAAA,CAAA;sBAA9B;gBACmC,cAAc,EAAA,CAAA;sBAAjD,SAAS;uBAAC,eAAe;gBACU,cAAc,EAAA,CAAA;sBAAjD,SAAS;uBAAC,eAAe;gBACoC,kBAAkB,EAAA,CAAA;sBAA/E,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,mBAAmB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAClB,YAAY,EAAA,CAAA;sBAA7C,SAAS;uBAAC,aAAa;gBA8CpB,QAAQ,EAAA,CAAA;sBADX;gBAUG,UAAU,EAAA,CAAA;sBADb;gBAkBG,UAAU,EAAA,CAAA;sBADb;gBAoBG,SAAS,EAAA,CAAA;sBADZ;gBAyCG,KAAK,EAAA,CAAA;sBADR;;;AEvKL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cmat-components-date-range.mjs","sources":["../../../projects/cmat/components/date-range/date-range.component.ts","../../../projects/cmat/components/date-range/date-range.component.html","../../../projects/cmat/components/date-range/cmat-components-date-range.ts"],"sourcesContent":["import { Overlay } from '@angular/cdk/overlay';\r\nimport { TemplatePortal } from '@angular/cdk/portal';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation, inject } from '@angular/core';\r\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCalendarCellCssClasses, MatMonthView, MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport dayjs, { Dayjs } from 'dayjs';\r\nimport isBetween from 'dayjs/plugin/isBetween';\r\nimport { Subject } from 'rxjs';\r\n\r\n\r\n@Component({\r\n selector: 'cmat-date-range',\r\n templateUrl: './date-range.component.html',\r\n styleUrls: ['./date-range.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatDateRange',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => CmatDateRangeComponent),\r\n multi: true\r\n }\r\n ],\r\n imports: [FormsModule, ReactiveFormsModule, MatButtonModule, MatIconModule,\r\n MatDatepickerModule, MatFormFieldModule,\r\n MatInputModule]\r\n})\r\nexport class CmatDateRangeComponent implements ControlValueAccessor, OnInit, OnDestroy {\r\n @Output() readonly rangeChanged: EventEmitter<{ start: string; end: string }> = new EventEmitter<{ start: string; end: string }>();\r\n @ViewChild('matMonthView1') private _matMonthView1: MatMonthView<any>;\r\n @ViewChild('matMonthView2') private _matMonthView2: MatMonthView<any>;\r\n @ViewChild('pickerPanelOrigin', { read: ElementRef }) private _pickerPanelOrigin: ElementRef;\r\n @ViewChild('pickerPanel') private _pickerPanel: TemplateRef<any>;\r\n\r\n activeDates: { month1: Dayjs | null; month2: Dayjs | null } = {\r\n month1: null,\r\n month2: null\r\n };\r\n setWhichDate: 'start' | 'end' = 'start';\r\n startTimeFormControl: FormControl;\r\n endTimeFormControl: FormControl;\r\n\r\n private _overlay = inject(Overlay);\r\n private _viewContainerRef = inject(ViewContainerRef);\r\n private _changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n private _dateFormat: string;\r\n private _onChange: (value: any) => void;\r\n private _onTouched: (value: any) => void;\r\n private _programmaticChange!: boolean;\r\n private _range: { start: Dayjs | null; end: Dayjs | null } = {\r\n start: null,\r\n end: null\r\n };\r\n private _timeFormat: string;\r\n private _timeRange: boolean;\r\n private _readonly: boolean;\r\n private readonly _timeRegExp: RegExp = new RegExp('^(0[0-9]|1[0-9]|2[0-4]|[0-9]):([0-5][0-9])(A|(?:AM)|P|(?:PM))?$', 'i');\r\n private _unsubscribeAll: Subject<any> = new Subject<any>();\r\n\r\n\r\n\r\n constructor() {\r\n dayjs.extend(isBetween);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this._onChange = (): void => { };\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this._onTouched = (): void => { };\r\n this.dateFormat = 'YYYY/MM/DD';\r\n this.timeFormat = '12';\r\n }\r\n\r\n get readonly(): boolean {\r\n return this._readonly;\r\n }\r\n\r\n @Input()\r\n set readonly(value) {\r\n this._readonly = value;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get dateFormat(): string {\r\n return this._dateFormat;\r\n }\r\n @Input()\r\n set dateFormat(value: string) {\r\n // Return if the values are the same\r\n if (this._dateFormat === value) {\r\n return;\r\n }\r\n\r\n // Store the value\r\n this._dateFormat = value;\r\n }\r\n\r\n /**\r\n * Setter & getter for timeFormat input */\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get timeFormat(): string {\r\n return this._timeFormat;\r\n }\r\n @Input()\r\n set timeFormat(value: string) {\r\n // Return if the values are the same\r\n if (this._timeFormat === value) {\r\n return;\r\n }\r\n\r\n // Set format based on the time format input\r\n this._timeFormat = value === '12' ? 'hh:mmA' : 'HH:mm';\r\n }\r\n\r\n\r\n\r\n /**\r\n * Setter & getter for timeRange input */\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get timeRange(): boolean {\r\n return this._timeRange;\r\n }\r\n @Input()\r\n set timeRange(value: boolean) {\r\n // Return if the values are the same\r\n if (this._timeRange === value) {\r\n return;\r\n }\r\n\r\n // Store the value\r\n this._timeRange = value;\r\n\r\n // If the time range turned off...\r\n if (!value && this._range.start && this._range.end) {\r\n this.range = {\r\n start: this._range.start.clone().startOf('day'),\r\n end: this._range.end.clone().endOf('day')\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Setter & getter for range input */\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get range(): any {\r\n if (this._range.start && this._range.end) {\r\n // Clone the range start and end\r\n const start = this._range.start.clone();\r\n const end = this._range.end.clone();\r\n\r\n // Build and return the range object\r\n return {\r\n startDate: start.clone().format(this.dateFormat),\r\n startTime: this.timeRange ? start.clone().format(this.timeFormat) : null,\r\n endDate: end.clone().format(this.dateFormat),\r\n endTime: this.timeRange ? end.clone().format(this.timeFormat) : null\r\n };\r\n }\r\n\r\n return void 0;\r\n }\r\n\r\n @Input()\r\n set range(value) {\r\n if (!value) {\r\n return;\r\n }\r\n\r\n // Check if the value is an object and has 'start' and 'end' values\r\n if (!value.start || !value.end) {\r\n console.error('Range input must have \"start\" and \"end\" properties!');\r\n\r\n return;\r\n }\r\n\r\n // Check if we are setting an individual date or both of them\r\n const whichDate = value.whichDate ?? null;\r\n\r\n // Get the start and end dates as moment\r\n const start = dayjs(value.start);\r\n const end = dayjs(value.end);\r\n\r\n // If we are only setting the start date...\r\n if (whichDate === 'start') {\r\n // Set the start date\r\n this._range.start = start.clone();\r\n\r\n // If the selected start date is after the end date...\r\n if (this._range.end && this._range.start.isAfter(this._range.end)) {\r\n // Set the end date to the start date but keep the end date's time\r\n const endDate = start.clone().hour(this._range.end.hour()).minute(this._range.end.minute()).second(this._range.end.second());\r\n\r\n // Test this new end date to see if it's ahead of the start date\r\n if (this._range.start.isBefore(endDate)) {\r\n // If it's, set the new end date\r\n this._range.end = endDate;\r\n }\r\n else {\r\n // Otherwise, set the end date same as the start date\r\n this._range.end = start.clone();\r\n }\r\n }\r\n }\r\n\r\n // If we are only setting the end date...\r\n if (whichDate === 'end') {\r\n // Set the end date\r\n this._range.end = end.clone();\r\n\r\n // If the selected end date is before the start date...\r\n if (this._range.start?.isAfter(this._range.end)) {\r\n // Set the start date to the end date but keep the start date's time\r\n const startDate = end.clone().hour(this._range.start.hour()).minute(this._range.start.minute()).second(this._range.start.second());\r\n\r\n // Test this new end date to see if it's ahead of the start date\r\n if (this._range.end.isAfter(startDate)) {\r\n // If it's, set the new start date\r\n this._range.start = startDate;\r\n }\r\n else {\r\n // Otherwise, set the start date same as the end date\r\n this._range.start = end.clone();\r\n }\r\n }\r\n }\r\n\r\n // If we are setting both dates...\r\n if (!whichDate) {\r\n // Set the start date\r\n this._range.start = start.clone();\r\n\r\n // If the start date is before the end date, set the end date as normal.\r\n // If the start date is after the end date, set the end date same as the start date.\r\n this._range.end = start.isBefore(end) ? end.clone() : start.clone();\r\n }\r\n\r\n if (this._range.start && this._range.end) {\r\n // Prepare another range object that holds the ISO formatted range dates\r\n const range = {\r\n start: this._range.start.clone().toISOString(),\r\n end: this._range.end.clone().toISOString()\r\n };\r\n\r\n // Emit the range changed event with the range\r\n this.rangeChanged.emit(range);\r\n\r\n // Update the model with the range if the change was not a programmatic change\r\n // Because programmatic changes trigger writeValue which triggers onChange and onTouched\r\n // internally causing them to trigger twice which breaks the form's pristine and touched\r\n // statuses.\r\n if (!this._programmaticChange) {\r\n this._onTouched(range);\r\n this._onChange(range);\r\n }\r\n\r\n // Set the active dates\r\n this.activeDates = {\r\n month1: this._range.start.clone(),\r\n month2: this._range.start.clone().add(1, 'month')\r\n };\r\n\r\n // Set the time form controls\r\n this.startTimeFormControl.setValue(this._range.start.clone().format(this._timeFormat).toString());\r\n this.endTimeFormControl.setValue(this._range.end.clone().format(this._timeFormat).toString());\r\n }\r\n\r\n // Run ngAfterContentInit on month views to trigger\r\n // re-render on month views if they are available\r\n if (this._matMonthView1 && this._matMonthView2) {\r\n this._matMonthView1.ngAfterContentInit();\r\n this._matMonthView2.ngAfterContentInit();\r\n }\r\n\r\n // Reset the programmatic change status\r\n this._programmaticChange = false;\r\n }\r\n // -----------------------------------------------------------------------------------------------------\r\n // @ Control Value Accessor\r\n // -----------------------------------------------------------------------------------------------------\r\n\r\n /**\r\n * Update the form model on change\r\n *\r\n * @param fn\r\n */\r\n registerOnChange(fn: any): void {\r\n this._onChange = fn;\r\n }\r\n\r\n /**\r\n * Update the form model on blur\r\n *\r\n * @param fn\r\n */\r\n registerOnTouched(fn: any): void {\r\n this._onTouched = fn;\r\n }\r\n\r\n /**\r\n * Write to view from model when the form model changes programmatically\r\n *\r\n * @param range\r\n */\r\n writeValue(range: { start: string; end: string }): void {\r\n // Set this change as a programmatic one\r\n this._programmaticChange = true;\r\n\r\n // Set the range\r\n this.range = range;\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n\r\n ngOnInit(): void {\r\n // Initialize the component\r\n this._init();\r\n }\r\n /**\r\n * On destroy\r\n */\r\n ngOnDestroy(): void {\r\n this._unsubscribeAll.next(void 0);\r\n this._unsubscribeAll.complete();\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this.writeValue = (): void => { };\r\n }\r\n\r\n // -----------------------------------------------------------------------------------------------------\r\n // @ Public methods\r\n // -----------------------------------------------------------------------------------------------------\r\n\r\n /**\r\n * Open the picker panel\r\n */\r\n openPickerPanel(): void {\r\n if (this.readonly)\r\n return;\r\n\r\n // Create the overlay\r\n const overlayRef = this._overlay.create({\r\n panelClass: 'cmat-date-range-panel',\r\n backdropClass: '',\r\n hasBackdrop: true,\r\n scrollStrategy: this._overlay.scrollStrategies.reposition(),\r\n positionStrategy: this._overlay.position()\r\n .flexibleConnectedTo(this._pickerPanelOrigin)\r\n .withPositions([\r\n {\r\n originX: 'start',\r\n originY: 'bottom',\r\n overlayX: 'start',\r\n overlayY: 'top',\r\n offsetY: 8\r\n },\r\n {\r\n originX: 'start',\r\n originY: 'top',\r\n overlayX: 'start',\r\n overlayY: 'bottom',\r\n offsetY: -8\r\n }\r\n ])\r\n });\r\n\r\n // Create a portal from the template\r\n const templatePortal = new TemplatePortal(this._pickerPanel, this._viewContainerRef);\r\n\r\n // On backdrop click\r\n overlayRef.backdropClick().subscribe(() => {\r\n\r\n // If template portal exists and attached...\r\n if (templatePortal?.isAttached) {\r\n // Detach it\r\n templatePortal.detach();\r\n }\r\n\r\n // If overlay exists and attached...\r\n if (overlayRef?.hasAttached()) {\r\n // Detach it\r\n overlayRef.detach();\r\n overlayRef.dispose();\r\n }\r\n });\r\n\r\n // Attach the portal to the overlay\r\n overlayRef.attach(templatePortal);\r\n }\r\n\r\n /**\r\n * Get month label\r\n *\r\n * @param month\r\n */\r\n getMonthLabel(month: number): string | void {\r\n if (month === 1) {\r\n return this.activeDates.month1?.clone().format('YYYY MMMM');\r\n }\r\n\r\n return this.activeDates.month2?.clone().format('YYYY MMMM');\r\n }\r\n\r\n /**\r\n * Date class function to add/remove class names to calendar days\r\n */\r\n dateClass(): any {\r\n return (date: Dayjs): MatCalendarCellCssClasses | void => {\r\n\r\n // If the date is both start and end date...\r\n if (date.isSame(this._range.start, 'day') && date.isSame(this._range.end, 'day')) {\r\n return ['cmat-date-range', 'cmat-date-range-start', 'cmat-date-range-end'];\r\n }\r\n\r\n // If the date is the start date...\r\n if (date.isSame(this._range.start, 'day')) {\r\n return ['cmat-date-range', 'cmat-date-range-start'];\r\n }\r\n\r\n // If the date is the end date...\r\n if (date.isSame(this._range.end, 'day')) {\r\n return ['cmat-date-range', 'cmat-date-range-end'];\r\n }\r\n\r\n // If the date is in between start and end dates...\r\n if (date.isBetween(this._range.start, this._range.end, 'day')) {\r\n return ['cmat-date-range', 'cmat-date-range-mid'];\r\n }\r\n\r\n return void 0;\r\n };\r\n }\r\n\r\n /**\r\n * Date filter to enable/disable calendar days\r\n */\r\n dateFilter(): any {\r\n // If we are selecting the end date, disable all the dates that comes before the start date\r\n return (date: Dayjs): boolean => !(this.setWhichDate === 'end' && date.isBefore(this._range.start, 'day'));\r\n }\r\n\r\n /**\r\n * On selected date change\r\n *\r\n * @param date\r\n */\r\n onSelectedDateChange(date: Dayjs): void {\r\n if (this._range.start && this._range.end) {\r\n // Create a new range object\r\n const newRange = {\r\n start: this._range.start.clone().toISOString(),\r\n end: this._range.end.clone().toISOString(),\r\n whichDate: ''\r\n };\r\n\r\n // Replace either the start or the end date with the new one\r\n // depending on which date we are setting\r\n if (this.setWhichDate === 'start') {\r\n newRange.start = dayjs(newRange.start).year(date.year()).month(date.month()).date(date.date()).toISOString();\r\n }\r\n else {\r\n newRange.end = dayjs(newRange.end).year(date.year()).month(date.month()).date(date.date()).toISOString();\r\n }\r\n\r\n // Append the which date to the new range object\r\n newRange.whichDate = this.setWhichDate;\r\n\r\n // Switch which date to set on the next run\r\n this.setWhichDate = this.setWhichDate === 'start' ? 'end' : 'start';\r\n\r\n // Set the range\r\n this.range = newRange;\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n }\r\n\r\n /**\r\n * Go to previous month on both views\r\n */\r\n prev(): void {\r\n this.activeDates.month1 = dayjs(this.activeDates.month1).subtract(1, 'month');\r\n this.activeDates.month2 = dayjs(this.activeDates.month2).subtract(1, 'month');\r\n }\r\n\r\n /**\r\n * Go to next month on both views\r\n */\r\n next(): void {\r\n this.activeDates.month1 = dayjs(this.activeDates.month1).add(1, 'month');\r\n this.activeDates.month2 = dayjs(this.activeDates.month2).add(1, 'month');\r\n }\r\n\r\n /**\r\n * Update the start time\r\n *\r\n * @param event\r\n */\r\n updateStartTime(event: any): void {\r\n // Parse the time\r\n const parsedTime = this._parseTime(event.target.value);\r\n\r\n // Go back to the previous value if the form control is not valid\r\n if (this.startTimeFormControl.invalid) {\r\n if (this._range.start) {\r\n // Override the time \r\n const time = this._range.start.clone().format(this._timeFormat);\r\n\r\n // Set the time\r\n this.startTimeFormControl.setValue(time);\r\n }\r\n // Do not update the range\r\n return;\r\n }\r\n\r\n if (this._range.start && this._range.end) {\r\n // Append the new time to the start date\r\n const startDate = this._range.start.clone().hour(parsedTime.hour()).minute(parsedTime.minute());\r\n\r\n // If the new start date is after the current end date,\r\n // use the end date's time and set the start date again\r\n if (startDate.isAfter(this._range.end)) {\r\n const endDateHours = this._range.end.hour();\r\n const endDateMinutes = this._range.end.minute();\r\n\r\n // Set the start date\r\n startDate.hour(endDateHours).minute(endDateMinutes);\r\n }\r\n\r\n // If everything is okay, set the new date\r\n this.range = {\r\n start: startDate.toISOString(),\r\n end: this._range.end.clone().toISOString(),\r\n whichDate: 'start'\r\n };\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n }\r\n\r\n /**\r\n * Update the end time\r\n *\r\n * @param event\r\n */\r\n updateEndTime(event: any): void {\r\n // Parse the time\r\n const parsedTime = this._parseTime(event.target.value);\r\n\r\n // Go back to the previous value if the form control is not valid\r\n if (this.endTimeFormControl.invalid) {\r\n if (this._range.end) {\r\n // Override the time\r\n const time = this._range.end.clone().format(this._timeFormat);\r\n\r\n // Set the time\r\n this.endTimeFormControl.setValue(time);\r\n }\r\n // Do not update the range\r\n return;\r\n }\r\n\r\n if (this._range.start && this._range.end) {\r\n // Append the new time to the end date\r\n const endDate = this._range.end.clone().hour(parsedTime.hour()).minute(parsedTime.minute());\r\n\r\n // If the new end date is before the current start date,\r\n // use the start date's time and set the end date again\r\n if (endDate.isBefore(this._range.start)) {\r\n const startDateHours = this._range.start.hour();\r\n const startDateMinutes = this._range.start.minute();\r\n\r\n // Set the end date\r\n endDate.hour(startDateHours).minute(startDateMinutes);\r\n }\r\n\r\n // If everything is okay, set the new date\r\n this.range = {\r\n start: this._range.start.clone().toISOString(),\r\n end: endDate.toISOString(),\r\n whichDate: 'end'\r\n };\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n }\r\n\r\n // -----------------------------------------------------------------------------------------------------\r\n // @ Private methods\r\n // -----------------------------------------------------------------------------------------------------\r\n\r\n /**\r\n * Initialize\r\n *\r\n * @private\r\n */\r\n private _init(): void {\r\n // Start and end time form controls\r\n this.startTimeFormControl = new FormControl('', [Validators.pattern(this._timeRegExp)]);\r\n this.endTimeFormControl = new FormControl('', [Validators.pattern(this._timeRegExp)]);\r\n\r\n // Set the default range\r\n this._programmaticChange = true;\r\n this.range = {\r\n start: dayjs().startOf('day').toISOString(),\r\n end: dayjs().add(1, 'day').endOf('day').toISOString()\r\n };\r\n\r\n // Set the default time range\r\n this._programmaticChange = true;\r\n this.timeRange = true;\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n\r\n /**\r\n * Parse the time from the inputs\r\n *\r\n * @param value\r\n * @private\r\n */\r\n private _parseTime(value: string): Dayjs {\r\n // Parse the time using the time regexp\r\n const timeArr = value.split(this._timeRegExp).filter(part => part !== '');\r\n\r\n // Get the meridiem\r\n const meridiem = timeArr[2] || null;\r\n\r\n // If meridiem exists...\r\n if (meridiem) {\r\n // Create a moment using 12-hours format and return it\r\n return dayjs(value, 'hh:mmA').second(0);\r\n }\r\n\r\n // If meridiem doesn't exist, create a moment using 24-hours format and return in\r\n return dayjs(value, 'HH:mm').second(0);\r\n }\r\n}\r\n","<div #pickerPanelOrigin role=\"presentation\" class=\"range\" (click)=\"openPickerPanel()\">\r\n\r\n <div class=\"start\">\r\n <div class=\"date\">{{range.startDate}}</div>\r\n @if (range.startTime) {\r\n <div class=\"time\">{{range.startTime}}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"separator\">-</div>\r\n\r\n <div class=\"end\">\r\n <div class=\"date\">{{range.endDate}}</div>\r\n @if (range.endTime) {\r\n <div class=\"time\">{{range.endTime}}</div>\r\n }\r\n </div>\r\n\r\n</div>\r\n\r\n<ng-template #pickerPanel>\r\n\r\n <!-- Start -->\r\n <div class=\"start\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <button type=\"button\" class=\"previous-button\" matIconButton tabindex=\"1\" (click)=\"prev()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-left'\"></mat-icon>\r\n </button>\r\n <div class=\"month-label\">{{getMonthLabel(1)}}</div>\r\n </div>\r\n <mat-month-view #matMonthView1 [dateFilter]=\"dateFilter()\" [dateClass]=\"dateClass()\"\r\n [(activeDate)]=\"activeDates.month1\" (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange) {\r\n <mat-form-field class=\"time start-time\">\r\n <input matInput tabindex=\"3\" [autocomplete]=\"'off'\" [formControl]=\"startTimeFormControl\"\r\n (blur)=\"updateStartTime($event)\">\r\n <mat-label>开始时间</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n <!-- End -->\r\n <div class=\"end\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <div class=\"month-label\">{{getMonthLabel(2)}}</div>\r\n <button type=\"button\" class=\"next-button\" matIconButton tabindex=\"2\" (click)=\"next()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-right'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-month-view #matMonthView2 [dateFilter]=\"dateFilter()\" [dateClass]=\"dateClass()\"\r\n [(activeDate)]=\"activeDates.month2\" (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange) {\r\n <mat-form-field class=\"time end-time\">\r\n <input matInput tabindex=\"4\" [formControl]=\"endTimeFormControl\" (blur)=\"updateEndTime($event)\">\r\n <mat-label>结束时间</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n </ng-template>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAgCa,sBAAsB,CAAA;AAmC/B,IAAA,WAAA,GAAA;AAlCmB,QAAA,IAAA,CAAA,YAAY,GAAiD,IAAI,YAAY,EAAkC;AAM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AC,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa;AACtE,wBAAA,mBAAmB,EAAE,kBAAkB;AACvC,wBAAA,cAAc,CAAC,EAAA,QAAA,EAAA,6oFAAA,EAAA,MAAA,EAAA,CAAA,wtKAAA,CAAA,EAAA;;sBAGlB;;sBACA,SAAS;uBAAC,eAAe;;sBACzB,SAAS;uBAAC,eAAe;;sBACzB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,mBAAmB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;;sBACnD,SAAS;uBAAC,aAAa;;sBA6CvB;;sBASA;;sBAiBA;;sBAmBA;;sBAwCA;;;AEvKL;;AAEG;;;;"}
|
|
@@ -32,10 +32,10 @@ class CmatDrawerService {
|
|
|
32
32
|
getComponent(name) {
|
|
33
33
|
return this._componentRegistry.get(name);
|
|
34
34
|
}
|
|
35
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
36
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatDrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
36
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatDrawerService, providedIn: 'root' }); }
|
|
37
37
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatDrawerService, decorators: [{
|
|
39
39
|
type: Injectable,
|
|
40
40
|
args: [{
|
|
41
41
|
providedIn: 'root'
|
|
@@ -285,10 +285,10 @@ class CmatDrawerComponent {
|
|
|
285
285
|
// Execute the observable
|
|
286
286
|
this.openedChanged.emit(open);
|
|
287
287
|
}
|
|
288
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
289
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
288
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
289
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.5", type: CmatDrawerComponent, isStandalone: true, selector: "cmat-drawer", inputs: { fixed: "fixed", mode: "mode", name: "name", opened: "opened", position: "position", transparentOverlay: "transparentOverlay" }, outputs: { fixedChanged: "fixedChanged", modeChanged: "modeChanged", openedChanged: "openedChanged", positionChanged: "positionChanged" }, host: { listeners: { "mouseenter": "onMouseenter()", "mouseleave": "onMouseleave()" }, properties: { "class": "this.classList", "style": "this.styleList" } }, exportAs: ["cmatDrawer"], usesOnChanges: true, ngImport: i0, template: "<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>", styles: ["cmat-drawer{position:relative;display:flex;flex-direction:column;flex:1 1 auto;width:320px;min-width:320px;max-width:320px;z-index:300;box-shadow:0 2px 8px #00000059}cmat-drawer.cmat-drawer-animations-enabled{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:visibility,margin-left,margin-right,transform,width,max-width,min-width}cmat-drawer.cmat-drawer-animations-enabled .cmat-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:width,max-width,min-width}cmat-drawer.cmat-drawer-mode-over{position:absolute;top:0;bottom:0}cmat-drawer.cmat-drawer-mode-over.cmat-drawer-fixed{position:fixed}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side{margin-left:-320px}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side.cmat-drawer-opened{margin-left:0}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over{left:0;transform:translate3d(-100%,0,0)}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-left .cmat-drawer-content{left:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side{margin-right:-320px}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side.cmat-drawer-opened{margin-right:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over{right:0;transform:translate3d(100%,0,0)}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-right .cmat-drawer-content{right:0}cmat-drawer .cmat-drawer-content{position:absolute;display:flex;flex:1 1 auto;top:0;bottom:0;width:100%;height:100%;overflow:hidden}.cmat-drawer-overlay{position:absolute;inset:0;z-index:299;opacity:1;background-color:#0009}.cmat-drawer-overlay.cmat-drawer-overlay-fixed{position:fixed}.cmat-drawer-overlay.cmat-drawer-overlay-transparent{background-color:transparent}.cmat-drawer-overlay.cmat-drawer-overlay-enter{animation:drawer-overlay-enter .3s cubic-bezier(.25,.8,.25,1)}.cmat-drawer-overlay.cmat-drawer-overlay-leave{animation:drawer-overlay-leave .3s cubic-bezier(.25,.8,.25,1)}@keyframes drawer-overlay-enter{0%{opacity:0}to{opacity:1}}@keyframes drawer-overlay-leave{0%{opacity:1}to{opacity:0}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
290
290
|
}
|
|
291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatDrawerComponent, decorators: [{
|
|
292
292
|
type: Component,
|
|
293
293
|
args: [{ selector: 'cmat-drawer', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDrawer', template: "<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>", styles: ["cmat-drawer{position:relative;display:flex;flex-direction:column;flex:1 1 auto;width:320px;min-width:320px;max-width:320px;z-index:300;box-shadow:0 2px 8px #00000059}cmat-drawer.cmat-drawer-animations-enabled{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:visibility,margin-left,margin-right,transform,width,max-width,min-width}cmat-drawer.cmat-drawer-animations-enabled .cmat-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:width,max-width,min-width}cmat-drawer.cmat-drawer-mode-over{position:absolute;top:0;bottom:0}cmat-drawer.cmat-drawer-mode-over.cmat-drawer-fixed{position:fixed}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side{margin-left:-320px}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side.cmat-drawer-opened{margin-left:0}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over{left:0;transform:translate3d(-100%,0,0)}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-left .cmat-drawer-content{left:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side{margin-right:-320px}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side.cmat-drawer-opened{margin-right:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over{right:0;transform:translate3d(100%,0,0)}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-right .cmat-drawer-content{right:0}cmat-drawer .cmat-drawer-content{position:absolute;display:flex;flex:1 1 auto;top:0;bottom:0;width:100%;height:100%;overflow:hidden}.cmat-drawer-overlay{position:absolute;inset:0;z-index:299;opacity:1;background-color:#0009}.cmat-drawer-overlay.cmat-drawer-overlay-fixed{position:fixed}.cmat-drawer-overlay.cmat-drawer-overlay-transparent{background-color:transparent}.cmat-drawer-overlay.cmat-drawer-overlay-enter{animation:drawer-overlay-enter .3s cubic-bezier(.25,.8,.25,1)}.cmat-drawer-overlay.cmat-drawer-overlay-leave{animation:drawer-overlay-leave .3s cubic-bezier(.25,.8,.25,1)}@keyframes drawer-overlay-enter{0%{opacity:0}to{opacity:1}}@keyframes drawer-overlay-leave{0%{opacity:1}to{opacity:0}}\n"] }]
|
|
294
294
|
}], propDecorators: { fixed: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-drawer.mjs","sources":["../../../projects/cmat/components/drawer/drawer.service.ts","../../../projects/cmat/components/drawer/drawer.component.ts","../../../projects/cmat/components/drawer/drawer.component.html","../../../projects/cmat/components/drawer/cmat-components-drawer.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { CmatDrawerComponent } from './drawer.component';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatDrawerService {\r\n private _componentRegistry: Map<string, CmatDrawerComponent> = new Map<string, CmatDrawerComponent>();\r\n /**\r\n * Register drawer component\r\n *\r\n * @param name\r\n * @param component\r\n */\r\n registerComponent(name: string, component: CmatDrawerComponent): void {\r\n this._componentRegistry.set(name, component);\r\n }\r\n\r\n /**\r\n * Deregister drawer component\r\n *\r\n * @param name\r\n */\r\n deregisterComponent(name: string): void {\r\n this._componentRegistry.delete(name);\r\n }\r\n\r\n /**\r\n * Get drawer component from the registry\r\n *\r\n * @param name\r\n */\r\n getComponent(name: string): CmatDrawerComponent | void {\r\n return this._componentRegistry.get(name);\r\n }\r\n}\r\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, OnChanges, OnDestroy, OnInit, Output, Renderer2, SimpleChanges, ViewEncapsulation, inject } from '@angular/core';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { CmatDrawerService } from './drawer.service';\r\nimport { CmatDrawerMode, CmatDrawerPosition } from './drawer.types';\r\n\r\n@Component({\r\n selector: 'cmat-drawer',\r\n templateUrl: './drawer.component.html',\r\n styleUrls: ['./drawer.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatDrawer'\r\n})\r\nexport class CmatDrawerComponent implements OnChanges, OnInit, OnDestroy {\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n static ngAcceptInputType_fixed: BooleanInput;\r\n static ngAcceptInputType_opened: BooleanInput;\r\n static ngAcceptInputType_transparentOverlay: BooleanInput;\r\n /* eslint-enable @typescript-eslint/naming-convention */\r\n\r\n @Input() fixed: boolean = false;\r\n @Input() mode: CmatDrawerMode = 'side';\r\n @Input() name: string = inject(CmatUtilsService).randomId();\r\n @Input() opened: boolean = false;\r\n @Input() position: CmatDrawerPosition = 'left';\r\n @Input() transparentOverlay: boolean = false;\r\n @Output() readonly fixedChanged: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n @Output() readonly modeChanged: EventEmitter<CmatDrawerMode> = new EventEmitter<CmatDrawerMode>();\r\n @Output() readonly openedChanged: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n @Output() readonly positionChanged: EventEmitter<CmatDrawerPosition> = new EventEmitter<CmatDrawerPosition>();\r\n\r\n private _elementRef = inject(ElementRef);\r\n private _renderer2 = inject(Renderer2);\r\n private _cmatDrawerService = inject(CmatDrawerService);\r\n\r\n private _animationsEnabled: boolean = false;\r\n private _hovered: boolean = false;\r\n private _overlay: HTMLElement | null;\r\n private _overlayClickDestroyFn: (() => void) | null = null;\r\n private _changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n @HostBinding('class') get classList(): any {\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n return {\r\n 'cmat-drawer-animations-enabled': this._animationsEnabled,\r\n 'cmat-drawer-fixed': this.fixed,\r\n 'cmat-drawer-hover': this._hovered,\r\n [`cmat-drawer-mode-${this.mode}`]: true,\r\n 'cmat-drawer-opened': this.opened,\r\n [`cmat-drawer-position-${this.position}`]: true\r\n };\r\n }\r\n\r\n @HostBinding('style') get styleList(): any {\r\n return {\r\n 'visibility': this.opened ? 'visible' : 'hidden'\r\n };\r\n }\r\n\r\n @HostListener('mouseenter')\r\n onMouseenter(): void {\r\n // Enable the animations\r\n this._enableAnimations();\r\n\r\n // Set the hovered\r\n this._hovered = true;\r\n }\r\n\r\n @HostListener('mouseleave')\r\n onMouseleave(): void {\r\n // Enable the animations\r\n this._enableAnimations();\r\n\r\n // Set the hovered\r\n this._hovered = false;\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // Fixed\r\n if ('fixed' in changes) {\r\n // Coerce the value to a boolean\r\n this.fixed = coerceBooleanProperty(changes['fixed'].currentValue);\r\n\r\n // Execute the observable\r\n this.fixedChanged.emit(this.fixed);\r\n }\r\n\r\n // Mode\r\n if ('mode' in changes) {\r\n // Get the previous and current values\r\n const previousMode = changes['mode'].previousValue;\r\n const currentMode = changes['mode'].currentValue;\r\n\r\n // Disable the animations\r\n this._disableAnimations();\r\n\r\n // If the mode changes: 'over -> side'\r\n if (previousMode === 'over' && currentMode === 'side') {\r\n // Hide the overlay\r\n this._hideOverlay();\r\n }\r\n\r\n // If the mode changes: 'side -> over'\r\n if (previousMode === 'side' && currentMode === 'over') {\r\n // If the drawer is opened\r\n if (this.opened) {\r\n // Show the overlay\r\n this._showOverlay();\r\n }\r\n }\r\n\r\n // Execute the observable\r\n this.modeChanged.emit(currentMode);\r\n\r\n // Enable the animations after a delay\r\n // The delay must be bigger than the current transition-duration\r\n // to make sure nothing will be animated while the mode is changing\r\n setTimeout(() => {\r\n this._enableAnimations();\r\n }, 500);\r\n }\r\n\r\n // Opened\r\n if ('opened' in changes) {\r\n // Coerce the value to a boolean\r\n const open = coerceBooleanProperty(changes['opened'].currentValue);\r\n\r\n // Open/close the drawer\r\n this._toggleOpened(open);\r\n }\r\n\r\n // Position\r\n if ('position' in changes) {\r\n // Execute the observable\r\n this.positionChanged.emit(this.position);\r\n }\r\n\r\n // Transparent overlay\r\n if ('transparentOverlay' in changes) {\r\n // Coerce the value to a boolean\r\n this.transparentOverlay = coerceBooleanProperty(changes['transparentOverlay'].currentValue);\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n // Register the drawer\r\n this._cmatDrawerService.registerComponent(this.name, this);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n // Deregister the drawer from the registry\r\n this._cmatDrawerService.deregisterComponent(this.name);\r\n }\r\n\r\n open(): void {\r\n // Return if the drawer has already opened\r\n if (this.opened) {\r\n return;\r\n }\r\n\r\n // Open the drawer\r\n this._toggleOpened(true);\r\n }\r\n\r\n close(): void {\r\n // Return if the drawer has already closed\r\n if (!this.opened) {\r\n return;\r\n }\r\n\r\n // Close the drawer\r\n this._toggleOpened(false);\r\n }\r\n\r\n toggle(): void {\r\n if (this.opened) {\r\n this.close();\r\n }\r\n else {\r\n this.open();\r\n }\r\n }\r\n\r\n /**\r\n * Enable the animations\r\n *\r\n * @private\r\n */\r\n private _enableAnimations(): void {\r\n // Return if the animations are already enabled\r\n if (this._animationsEnabled) {\r\n return;\r\n }\r\n\r\n // Enable the animations\r\n this._animationsEnabled = true;\r\n }\r\n\r\n /**\r\n * Disable the animations\r\n *\r\n * @private\r\n */\r\n private _disableAnimations(): void {\r\n // Return if the animations are already disabled\r\n if (!this._animationsEnabled) {\r\n return;\r\n }\r\n\r\n // Disable the animations\r\n this._animationsEnabled = false;\r\n }\r\n\r\n /**\r\n * Show the backdrop\r\n *\r\n * @private\r\n */\r\n private _showOverlay(): void {\r\n // Create the backdrop element\r\n this._overlay = this._renderer2.createElement('div');\r\n\r\n // Return if overlay couldn't be create for some reason\r\n if (!this._overlay) {\r\n return;\r\n }\r\n\r\n // Add a class to the backdrop element\r\n this._overlay.classList.add('cmat-drawer-overlay');\r\n\r\n // Add a class depending on the fixed option\r\n if (this.fixed) {\r\n this._overlay.classList.add('cmat-drawer-overlay-fixed');\r\n }\r\n\r\n // Add a class depending on the transparentOverlay option\r\n if (this.transparentOverlay) {\r\n this._overlay.classList.add('cmat-drawer-overlay-transparent');\r\n }\r\n\r\n // Append the backdrop to the parent of the drawer\r\n this._renderer2.appendChild(this._elementRef.nativeElement.parentElement, this._overlay);\r\n\r\n this._overlay?.classList.add('cmat-drawer-overlay-enter');\r\n\r\n this._overlayClickDestroyFn = this._renderer2.listen(this._overlay, 'click', () => {\r\n this.close();\r\n });\r\n }\r\n\r\n /**\r\n * Hide the backdrop\r\n *\r\n * @private\r\n */\r\n private _hideOverlay(): void {\r\n if (!this._overlay) {\r\n return;\r\n }\r\n\r\n this._overlay.classList.remove('cmat-drawer-overlay-enter');\r\n\r\n const handleAnimationEnd = (event: AnimationEvent): void => {\r\n if (event.animationName === 'drawer-overlay-leave') {\r\n this._overlay?.removeEventListener('animationend', handleAnimationEnd);\r\n\r\n if (this._overlayClickDestroyFn) {\r\n this._overlayClickDestroyFn();\r\n this._overlayClickDestroyFn = null;\r\n }\r\n\r\n if (this._overlay) {\r\n this._overlay.parentNode?.removeChild(this._overlay);\r\n this._overlay = null;\r\n }\r\n }\r\n };\r\n\r\n this._overlay.addEventListener('animationend', handleAnimationEnd);\r\n\r\n this._overlay.classList.add('cmat-drawer-overlay-leave');\r\n }\r\n\r\n /**\r\n * Open/close the drawer\r\n *\r\n * @param open\r\n * @private\r\n */\r\n private _toggleOpened(open: boolean): void {\r\n // Set the opened\r\n this.opened = open;\r\n\r\n // Enable the animations\r\n this._enableAnimations();\r\n\r\n // If the mode is 'over'\r\n if (this.mode === 'over') {\r\n // If the drawer opens, show the overlay\r\n if (open) {\r\n this._showOverlay();\r\n }\r\n // Otherwise, close the overlay\r\n else {\r\n this._hideOverlay();\r\n }\r\n }\r\n\r\n this._changeDetectorRef.markForCheck();\r\n\r\n // Execute the observable\r\n this.openedChanged.emit(open);\r\n }\r\n}\r\n","<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAMa,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;AAIY,QAAA,IAAA,CAAA,kBAAkB,GAAqC,IAAI,GAAG,EAA+B;AA4BxG,IAAA;AA3BG;;;;;AAKG;IACH,iBAAiB,CAAC,IAAY,EAAE,SAA8B,EAAA;QAC1D,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC;IAChD;AAEA;;;;AAIG;AACH,IAAA,mBAAmB,CAAC,IAAY,EAAA;AAC5B,QAAA,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC;IACxC;AAEA;;;;AAIG;AACH,IAAA,YAAY,CAAC,IAAY,EAAA;QACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC;IAC5C;8GA5BS,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,cAFd,MAAM,EAAA,CAAA,CAAA;;2FAET,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;MCSY,mBAAmB,CAAA;AARhC,IAAA,WAAA,GAAA;;QAea,IAAA,CAAA,KAAK,GAAY,KAAK;QACtB,IAAA,CAAA,IAAI,GAAmB,MAAM;QAC7B,IAAA,CAAA,IAAI,GAAW,MAAM,CAAC,gBA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,CAAA,IAAA,EAAA,CAAA,CAAA;;2FDYO,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAR/B,SAAS;+BACI,aAAa,EAAA,aAAA,EAGR,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,YAAY,EAAA,QAAA,EAAA,gFAAA,EAAA,MAAA,EAAA,CAAA,2vEAAA,CAAA,EAAA;8BASb,KAAK,EAAA,CAAA;sBAAb;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,MAAM,EAAA,CAAA;sBAAd;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,kBAAkB,EAAA,CAAA;sBAA1B;gBACkB,YAAY,EAAA,CAAA;sBAA9B;gBACkB,WAAW,EAAA,CAAA;sBAA7B;gBACkB,aAAa,EAAA,CAAA;sBAA/B;gBACkB,eAAe,EAAA,CAAA;sBAAjC;gBAYyB,SAAS,EAAA,CAAA;sBAAlC,WAAW;uBAAC,OAAO;gBAYM,SAAS,EAAA,CAAA;sBAAlC,WAAW;uBAAC,OAAO;gBAOpB,YAAY,EAAA,CAAA;sBADX,YAAY;uBAAC,YAAY;gBAU1B,YAAY,EAAA,CAAA;sBADX,YAAY;uBAAC,YAAY;;;AErE9B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cmat-components-drawer.mjs","sources":["../../../projects/cmat/components/drawer/drawer.service.ts","../../../projects/cmat/components/drawer/drawer.component.ts","../../../projects/cmat/components/drawer/drawer.component.html","../../../projects/cmat/components/drawer/cmat-components-drawer.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { CmatDrawerComponent } from './drawer.component';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatDrawerService {\r\n private _componentRegistry: Map<string, CmatDrawerComponent> = new Map<string, CmatDrawerComponent>();\r\n /**\r\n * Register drawer component\r\n *\r\n * @param name\r\n * @param component\r\n */\r\n registerComponent(name: string, component: CmatDrawerComponent): void {\r\n this._componentRegistry.set(name, component);\r\n }\r\n\r\n /**\r\n * Deregister drawer component\r\n *\r\n * @param name\r\n */\r\n deregisterComponent(name: string): void {\r\n this._componentRegistry.delete(name);\r\n }\r\n\r\n /**\r\n * Get drawer component from the registry\r\n *\r\n * @param name\r\n */\r\n getComponent(name: string): CmatDrawerComponent | void {\r\n return this._componentRegistry.get(name);\r\n }\r\n}\r\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, OnChanges, OnDestroy, OnInit, Output, Renderer2, SimpleChanges, ViewEncapsulation, inject } from '@angular/core';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { CmatDrawerService } from './drawer.service';\r\nimport { CmatDrawerMode, CmatDrawerPosition } from './drawer.types';\r\n\r\n@Component({\r\n selector: 'cmat-drawer',\r\n templateUrl: './drawer.component.html',\r\n styleUrls: ['./drawer.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatDrawer'\r\n})\r\nexport class CmatDrawerComponent implements OnChanges, OnInit, OnDestroy {\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n static ngAcceptInputType_fixed: BooleanInput;\r\n static ngAcceptInputType_opened: BooleanInput;\r\n static ngAcceptInputType_transparentOverlay: BooleanInput;\r\n /* eslint-enable @typescript-eslint/naming-convention */\r\n\r\n @Input() fixed: boolean = false;\r\n @Input() mode: CmatDrawerMode = 'side';\r\n @Input() name: string = inject(CmatUtilsService).randomId();\r\n @Input() opened: boolean = false;\r\n @Input() position: CmatDrawerPosition = 'left';\r\n @Input() transparentOverlay: boolean = false;\r\n @Output() readonly fixedChanged: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n @Output() readonly modeChanged: EventEmitter<CmatDrawerMode> = new EventEmitter<CmatDrawerMode>();\r\n @Output() readonly openedChanged: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n @Output() readonly positionChanged: EventEmitter<CmatDrawerPosition> = new EventEmitter<CmatDrawerPosition>();\r\n\r\n private _elementRef = inject(ElementRef);\r\n private _renderer2 = inject(Renderer2);\r\n private _cmatDrawerService = inject(CmatDrawerService);\r\n\r\n private _animationsEnabled: boolean = false;\r\n private _hovered: boolean = false;\r\n private _overlay: HTMLElement | null;\r\n private _overlayClickDestroyFn: (() => void) | null = null;\r\n private _changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n @HostBinding('class') get classList(): any {\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n return {\r\n 'cmat-drawer-animations-enabled': this._animationsEnabled,\r\n 'cmat-drawer-fixed': this.fixed,\r\n 'cmat-drawer-hover': this._hovered,\r\n [`cmat-drawer-mode-${this.mode}`]: true,\r\n 'cmat-drawer-opened': this.opened,\r\n [`cmat-drawer-position-${this.position}`]: true\r\n };\r\n }\r\n\r\n @HostBinding('style') get styleList(): any {\r\n return {\r\n 'visibility': this.opened ? 'visible' : 'hidden'\r\n };\r\n }\r\n\r\n @HostListener('mouseenter')\r\n onMouseenter(): void {\r\n // Enable the animations\r\n this._enableAnimations();\r\n\r\n // Set the hovered\r\n this._hovered = true;\r\n }\r\n\r\n @HostListener('mouseleave')\r\n onMouseleave(): void {\r\n // Enable the animations\r\n this._enableAnimations();\r\n\r\n // Set the hovered\r\n this._hovered = false;\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // Fixed\r\n if ('fixed' in changes) {\r\n // Coerce the value to a boolean\r\n this.fixed = coerceBooleanProperty(changes['fixed'].currentValue);\r\n\r\n // Execute the observable\r\n this.fixedChanged.emit(this.fixed);\r\n }\r\n\r\n // Mode\r\n if ('mode' in changes) {\r\n // Get the previous and current values\r\n const previousMode = changes['mode'].previousValue;\r\n const currentMode = changes['mode'].currentValue;\r\n\r\n // Disable the animations\r\n this._disableAnimations();\r\n\r\n // If the mode changes: 'over -> side'\r\n if (previousMode === 'over' && currentMode === 'side') {\r\n // Hide the overlay\r\n this._hideOverlay();\r\n }\r\n\r\n // If the mode changes: 'side -> over'\r\n if (previousMode === 'side' && currentMode === 'over') {\r\n // If the drawer is opened\r\n if (this.opened) {\r\n // Show the overlay\r\n this._showOverlay();\r\n }\r\n }\r\n\r\n // Execute the observable\r\n this.modeChanged.emit(currentMode);\r\n\r\n // Enable the animations after a delay\r\n // The delay must be bigger than the current transition-duration\r\n // to make sure nothing will be animated while the mode is changing\r\n setTimeout(() => {\r\n this._enableAnimations();\r\n }, 500);\r\n }\r\n\r\n // Opened\r\n if ('opened' in changes) {\r\n // Coerce the value to a boolean\r\n const open = coerceBooleanProperty(changes['opened'].currentValue);\r\n\r\n // Open/close the drawer\r\n this._toggleOpened(open);\r\n }\r\n\r\n // Position\r\n if ('position' in changes) {\r\n // Execute the observable\r\n this.positionChanged.emit(this.position);\r\n }\r\n\r\n // Transparent overlay\r\n if ('transparentOverlay' in changes) {\r\n // Coerce the value to a boolean\r\n this.transparentOverlay = coerceBooleanProperty(changes['transparentOverlay'].currentValue);\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n // Register the drawer\r\n this._cmatDrawerService.registerComponent(this.name, this);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n // Deregister the drawer from the registry\r\n this._cmatDrawerService.deregisterComponent(this.name);\r\n }\r\n\r\n open(): void {\r\n // Return if the drawer has already opened\r\n if (this.opened) {\r\n return;\r\n }\r\n\r\n // Open the drawer\r\n this._toggleOpened(true);\r\n }\r\n\r\n close(): void {\r\n // Return if the drawer has already closed\r\n if (!this.opened) {\r\n return;\r\n }\r\n\r\n // Close the drawer\r\n this._toggleOpened(false);\r\n }\r\n\r\n toggle(): void {\r\n if (this.opened) {\r\n this.close();\r\n }\r\n else {\r\n this.open();\r\n }\r\n }\r\n\r\n /**\r\n * Enable the animations\r\n *\r\n * @private\r\n */\r\n private _enableAnimations(): void {\r\n // Return if the animations are already enabled\r\n if (this._animationsEnabled) {\r\n return;\r\n }\r\n\r\n // Enable the animations\r\n this._animationsEnabled = true;\r\n }\r\n\r\n /**\r\n * Disable the animations\r\n *\r\n * @private\r\n */\r\n private _disableAnimations(): void {\r\n // Return if the animations are already disabled\r\n if (!this._animationsEnabled) {\r\n return;\r\n }\r\n\r\n // Disable the animations\r\n this._animationsEnabled = false;\r\n }\r\n\r\n /**\r\n * Show the backdrop\r\n *\r\n * @private\r\n */\r\n private _showOverlay(): void {\r\n // Create the backdrop element\r\n this._overlay = this._renderer2.createElement('div');\r\n\r\n // Return if overlay couldn't be create for some reason\r\n if (!this._overlay) {\r\n return;\r\n }\r\n\r\n // Add a class to the backdrop element\r\n this._overlay.classList.add('cmat-drawer-overlay');\r\n\r\n // Add a class depending on the fixed option\r\n if (this.fixed) {\r\n this._overlay.classList.add('cmat-drawer-overlay-fixed');\r\n }\r\n\r\n // Add a class depending on the transparentOverlay option\r\n if (this.transparentOverlay) {\r\n this._overlay.classList.add('cmat-drawer-overlay-transparent');\r\n }\r\n\r\n // Append the backdrop to the parent of the drawer\r\n this._renderer2.appendChild(this._elementRef.nativeElement.parentElement, this._overlay);\r\n\r\n this._overlay?.classList.add('cmat-drawer-overlay-enter');\r\n\r\n this._overlayClickDestroyFn = this._renderer2.listen(this._overlay, 'click', () => {\r\n this.close();\r\n });\r\n }\r\n\r\n /**\r\n * Hide the backdrop\r\n *\r\n * @private\r\n */\r\n private _hideOverlay(): void {\r\n if (!this._overlay) {\r\n return;\r\n }\r\n\r\n this._overlay.classList.remove('cmat-drawer-overlay-enter');\r\n\r\n const handleAnimationEnd = (event: AnimationEvent): void => {\r\n if (event.animationName === 'drawer-overlay-leave') {\r\n this._overlay?.removeEventListener('animationend', handleAnimationEnd);\r\n\r\n if (this._overlayClickDestroyFn) {\r\n this._overlayClickDestroyFn();\r\n this._overlayClickDestroyFn = null;\r\n }\r\n\r\n if (this._overlay) {\r\n this._overlay.parentNode?.removeChild(this._overlay);\r\n this._overlay = null;\r\n }\r\n }\r\n };\r\n\r\n this._overlay.addEventListener('animationend', handleAnimationEnd);\r\n\r\n this._overlay.classList.add('cmat-drawer-overlay-leave');\r\n }\r\n\r\n /**\r\n * Open/close the drawer\r\n *\r\n * @param open\r\n * @private\r\n */\r\n private _toggleOpened(open: boolean): void {\r\n // Set the opened\r\n this.opened = open;\r\n\r\n // Enable the animations\r\n this._enableAnimations();\r\n\r\n // If the mode is 'over'\r\n if (this.mode === 'over') {\r\n // If the drawer opens, show the overlay\r\n if (open) {\r\n this._showOverlay();\r\n }\r\n // Otherwise, close the overlay\r\n else {\r\n this._hideOverlay();\r\n }\r\n }\r\n\r\n this._changeDetectorRef.markForCheck();\r\n\r\n // Execute the observable\r\n this.openedChanged.emit(open);\r\n }\r\n}\r\n","<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAMa,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;AAIY,QAAA,IAAA,CAAA,kBAAkB,GAAqC,IAAI,GAAG,EAA+B;AA4BxG,IAAA;AA3BG;;;;;AAKG;IACH,iBAAiB,CAAC,IAAY,EAAE,SAA8B,EAAA;QAC1D,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC;IAChD;AAEA;;;;AAIG;AACH,IAAA,mBAAmB,CAAC,IAAY,EAAA;AAC5B,QAAA,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC;IACxC;AAEA;;;;AAIG;AACH,IAAA,YAAY,CAAC,IAAY,EAAA;QACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC;IAC5C;8GA5BS,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,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EAAE;;AAGtC,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;IACjC;8GA3SS,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,0iBCdhC,gFAEM,EAAA,MAAA,EAAA,CAAA,2vEAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FDYO,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAR/B,SAAS;+BACI,aAAa,EAAA,aAAA,EAGR,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,YAAY,EAAA,QAAA,EAAA,gFAAA,EAAA,MAAA,EAAA,CAAA,2vEAAA,CAAA,EAAA;;sBASrB;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAYA,WAAW;uBAAC,OAAO;;sBAYnB,WAAW;uBAAC,OAAO;;sBAMnB,YAAY;uBAAC,YAAY;;sBASzB,YAAY;uBAAC,YAAY;;;AErE9B;;AAEG;;;;"}
|
|
@@ -28,10 +28,10 @@ class CmatFullscreenComponent {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
32
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatFullscreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
32
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.5", type: CmatFullscreenComponent, isStandalone: true, selector: "cmat-fullscreen", inputs: { iconTpl: "iconTpl", tooltip: "tooltip" }, exportAs: ["cmatFullscreen"], ngImport: i0, template: "<!-- Button -->\r\n<button type=\"button\" matIconButton [matTooltip]=\"tooltip || '\u5207\u6362\u5168\u5C4F'\" (click)=\"toggleFullscreen()\">\r\n <ng-container [ngTemplateOutlet]=\"iconTpl || defaultIconTpl\"></ng-container>\r\n</button>\r\n\r\n<!-- Default icon -->\r\n<ng-template #defaultIconTpl>\r\n <mat-icon [svgIcon]=\"'heroicons_outline:arrows-pointing-out'\"></mat-icon>\r\n</ng-template>", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
33
33
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatFullscreenComponent, decorators: [{
|
|
35
35
|
type: Component,
|
|
36
36
|
args: [{ selector: 'cmat-fullscreen', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatFullscreen', imports: [MatButtonModule, MatTooltipModule, NgTemplateOutlet, MatIconModule], template: "<!-- Button -->\r\n<button type=\"button\" matIconButton [matTooltip]=\"tooltip || '\u5207\u6362\u5168\u5C4F'\" (click)=\"toggleFullscreen()\">\r\n <ng-container [ngTemplateOutlet]=\"iconTpl || defaultIconTpl\"></ng-container>\r\n</button>\r\n\r\n<!-- Default icon -->\r\n<ng-template #defaultIconTpl>\r\n <mat-icon [svgIcon]=\"'heroicons_outline:arrows-pointing-out'\"></mat-icon>\r\n</ng-template>" }]
|
|
37
37
|
}], propDecorators: { iconTpl: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-fullscreen.mjs","sources":["../../../projects/cmat/components/fullscreen/fullscreen.component.ts","../../../projects/cmat/components/fullscreen/fullscreen.component.html","../../../projects/cmat/components/fullscreen/cmat-components-fullscreen.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation, DOCUMENT, inject } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\n@Component({\r\n selector: 'cmat-fullscreen',\r\n templateUrl: './fullscreen.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatFullscreen',\r\n imports: [MatButtonModule, MatTooltipModule, NgTemplateOutlet, MatIconModule]\r\n})\r\nexport class CmatFullscreenComponent {\r\n @Input() iconTpl: TemplateRef<any>;\r\n @Input() tooltip: string;\r\n\r\n private _document = inject<Document>(DOCUMENT);\r\n\r\n\r\n toggleFullscreen(): void {\r\n if (!this._document.fullscreenEnabled) {\r\n console.log('Fullscreen is not available in this browser.');\r\n return;\r\n }\r\n\r\n const fullScreen = this._document.fullscreenElement;\r\n\r\n if (fullScreen) {\r\n void this._document.exitFullscreen();\r\n }\r\n else {\r\n this._document.documentElement.requestFullscreen()\r\n .catch(() => {\r\n console.error('Entering fullscreen mode failed.');\r\n });\r\n }\r\n }\r\n}\r\n","<!-- Button -->\r\n<button type=\"button\" matIconButton [matTooltip]=\"tooltip || '切换全屏'\" (click)=\"toggleFullscreen()\">\r\n <ng-container [ngTemplateOutlet]=\"iconTpl || defaultIconTpl\"></ng-container>\r\n</button>\r\n\r\n<!-- Default icon -->\r\n<ng-template #defaultIconTpl>\r\n <mat-icon [svgIcon]=\"'heroicons_outline:arrows-pointing-out'\"></mat-icon>\r\n</ng-template>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAca,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;AAYY,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAW,QAAQ,CAAC;AAqBjD,IAAA;IAlBG,gBAAgB,GAAA;AACZ,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;AACnC,YAAA,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC;YAC3D;QACJ;AAEA,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB;QAEnD,IAAI,UAAU,EAAE;AACZ,YAAA,KAAK,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;QACxC;aACK;AACD,YAAA,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,iBAAiB;iBAC3C,KAAK,CAAC,MAAK;AACR,gBAAA,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC;AACrD,YAAA,CAAC,CAAC;QACV;IACJ;8GAxBS,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2FAEnE,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,iBAEZ,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,gBAAgB,EAAA,OAAA,EACjB,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,wZAAA,EAAA
|
|
1
|
+
{"version":3,"file":"cmat-components-fullscreen.mjs","sources":["../../../projects/cmat/components/fullscreen/fullscreen.component.ts","../../../projects/cmat/components/fullscreen/fullscreen.component.html","../../../projects/cmat/components/fullscreen/cmat-components-fullscreen.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation, DOCUMENT, inject } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\n@Component({\r\n selector: 'cmat-fullscreen',\r\n templateUrl: './fullscreen.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatFullscreen',\r\n imports: [MatButtonModule, MatTooltipModule, NgTemplateOutlet, MatIconModule]\r\n})\r\nexport class CmatFullscreenComponent {\r\n @Input() iconTpl: TemplateRef<any>;\r\n @Input() tooltip: string;\r\n\r\n private _document = inject<Document>(DOCUMENT);\r\n\r\n\r\n toggleFullscreen(): void {\r\n if (!this._document.fullscreenEnabled) {\r\n console.log('Fullscreen is not available in this browser.');\r\n return;\r\n }\r\n\r\n const fullScreen = this._document.fullscreenElement;\r\n\r\n if (fullScreen) {\r\n void this._document.exitFullscreen();\r\n }\r\n else {\r\n this._document.documentElement.requestFullscreen()\r\n .catch(() => {\r\n console.error('Entering fullscreen mode failed.');\r\n });\r\n }\r\n }\r\n}\r\n","<!-- Button -->\r\n<button type=\"button\" matIconButton [matTooltip]=\"tooltip || '切换全屏'\" (click)=\"toggleFullscreen()\">\r\n <ng-container [ngTemplateOutlet]=\"iconTpl || defaultIconTpl\"></ng-container>\r\n</button>\r\n\r\n<!-- Default icon -->\r\n<ng-template #defaultIconTpl>\r\n <mat-icon [svgIcon]=\"'heroicons_outline:arrows-pointing-out'\"></mat-icon>\r\n</ng-template>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAca,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;AAYY,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAW,QAAQ,CAAC;AAqBjD,IAAA;IAlBG,gBAAgB,GAAA;AACZ,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;AACnC,YAAA,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC;YAC3D;QACJ;AAEA,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB;QAEnD,IAAI,UAAU,EAAE;AACZ,YAAA,KAAK,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;QACxC;aACK;AACD,YAAA,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,iBAAiB;iBAC3C,KAAK,CAAC,MAAK;AACR,gBAAA,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC;AACrD,YAAA,CAAC,CAAC;QACV;IACJ;8GAxBS,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAA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C,EAAA,QAAA,EAAA,wZAAA,EAAA;;sBAG5E;;sBACA;;;AEhBL;;AAEG;;;;"}
|
|
@@ -38,10 +38,10 @@ class CmatHighlightService {
|
|
|
38
38
|
// indentation, join them together and return it
|
|
39
39
|
return lines.map(line => line.substring(indentation)).join('\n');
|
|
40
40
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
42
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatHighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
42
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatHighlightService, providedIn: 'root' }); }
|
|
43
43
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatHighlightService, decorators: [{
|
|
45
45
|
type: Injectable,
|
|
46
46
|
args: [{
|
|
47
47
|
providedIn: 'root'
|
|
@@ -108,10 +108,10 @@ class CmatHighlightComponent {
|
|
|
108
108
|
// Detect the changes
|
|
109
109
|
this._viewRef.detectChanges();
|
|
110
110
|
}
|
|
111
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
112
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.5", type: CmatHighlightComponent, isStandalone: true, selector: "textarea[cmat-highlight]", inputs: { code: "code", lang: "lang" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], exportAs: ["cmatHighlight"], usesOnChanges: true, ngImport: i0, template: "<ng-content></ng-content>\r\n\r\n<ng-template let-highlightedCode=\"highlightedCode\" let-lang=\"lang\">\r\n <div class=\"cmat-highlight cmat-highlight-code-container\">\r\n <pre [ngClass]=\"'language-' + lang\"><code [ngClass]=\"'language-' + lang\" [innerHTML]=\"highlightedCode\"></code>\r\n </pre>\r\n </div>\r\n</ng-template>", styles: ["textarea[cmat-highlight]{display:none}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
113
113
|
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: CmatHighlightComponent, decorators: [{
|
|
115
115
|
type: Component,
|
|
116
116
|
args: [{ selector: 'textarea[cmat-highlight]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatHighlight', imports: [NgClass], template: "<ng-content></ng-content>\r\n\r\n<ng-template let-highlightedCode=\"highlightedCode\" let-lang=\"lang\">\r\n <div class=\"cmat-highlight cmat-highlight-code-container\">\r\n <pre [ngClass]=\"'language-' + lang\"><code [ngClass]=\"'language-' + lang\" [innerHTML]=\"highlightedCode\"></code>\r\n </pre>\r\n </div>\r\n</ng-template>", styles: ["textarea[cmat-highlight]{display:none}\n"] }]
|
|
117
117
|
}], propDecorators: { code: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-highlight.mjs","sources":["../../../projects/cmat/components/highlight/highlight.service.ts","../../../projects/cmat/components/highlight/highlight.component.ts","../../../projects/cmat/components/highlight/highlight.component.html","../../../projects/cmat/components/highlight/cmat-components-highlight.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport hljs from 'highlight.js';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatHighlightService {\r\n highlight(code: string, language: string): string {\r\n // Format the code\r\n code = this._format(code);\r\n\r\n // Highlight and return the code\r\n return hljs.highlight(code, { language }).value;\r\n }\r\n\r\n private _format(code: string): string {\r\n let indentation = 0;\r\n\r\n // Split the code into lines and store the lines\r\n const lines = code.split('\\n');\r\n\r\n // Trim the empty lines around the code block\r\n while (lines.length && lines[0].trim() === '') {\r\n lines.shift();\r\n }\r\n\r\n while (lines.length && lines[lines.length - 1].trim() === '') {\r\n lines.pop();\r\n }\r\n\r\n // Iterate through the lines\r\n lines.filter(line => line.length)\r\n .forEach((line, index) => {\r\n\r\n // Always get the indentation of the first line so we can\r\n // have something to compare with\r\n if (index === 0) {\r\n indentation = line.search(/\\S|$/);\r\n return;\r\n }\r\n\r\n // Look at all the remaining lines to figure out the smallest indentation.\r\n indentation = Math.min(line.search(/\\S|$/), indentation);\r\n });\r\n\r\n // Iterate through the lines one more time, remove the extra\r\n // indentation, join them together and return it\r\n return lines.map(line => line.substring(indentation)).join('\\n');\r\n }\r\n}\r\n","import { NgClass } from '@angular/common';\r\nimport { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EmbeddedViewRef, Input, OnChanges, SecurityContext, SimpleChanges, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation, inject } from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\nimport { CmatHighlightService } from './highlight.service';\r\n\r\n@Component({\r\n selector: 'textarea[cmat-highlight]',\r\n templateUrl: './highlight.component.html',\r\n styleUrls: ['./highlight.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatHighlight',\r\n imports: [NgClass]\r\n})\r\nexport class CmatHighlightComponent implements OnChanges, AfterViewInit {\r\n\r\n\r\n @Input() code: string;\r\n @Input() lang: string;\r\n @ViewChild(TemplateRef) templateRef: TemplateRef<any>;\r\n\r\n highlightedCode: string | null;\r\n private _viewRef: EmbeddedViewRef<any> | null;\r\n private _domSanitizer = inject(DomSanitizer);\r\n private _elementRef = inject(ElementRef);\r\n private _cmatHighlightService = inject(CmatHighlightService);\r\n private _viewContainerRef = inject(ViewContainerRef);\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // Code & Lang\r\n if ('code' in changes || 'lang' in changes) {\r\n // Return if the viewContainerRef is not available\r\n if (!this._viewContainerRef.length) {\r\n return;\r\n }\r\n\r\n // Highlight and insert the code\r\n this._highlightAndInsert();\r\n }\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n // Return if there is no language set\r\n if (!this.lang) {\r\n return;\r\n }\r\n\r\n // If there is no code input, get the code from\r\n // the textarea\r\n if (!this.code) {\r\n // Get the code\r\n this.code = this._elementRef.nativeElement.value;\r\n }\r\n\r\n // Highlight and insert\r\n this._highlightAndInsert();\r\n }\r\n\r\n private _highlightAndInsert(): void {\r\n // Return if the template reference is not available\r\n if (!this.templateRef) {\r\n return;\r\n }\r\n\r\n // Return if the code or language is not defined\r\n if (!this.code || !this.lang) {\r\n return;\r\n }\r\n\r\n // Destroy the component if there is already one\r\n if (this._viewRef) {\r\n this._viewRef.destroy();\r\n this._viewRef = null;\r\n }\r\n\r\n // Highlight and sanitize the code just in case\r\n this.highlightedCode = this._domSanitizer.sanitize(SecurityContext.HTML, this._cmatHighlightService.highlight(this.code, this.lang));\r\n\r\n // Return if the highlighted code is null\r\n if (this.highlightedCode === null) {\r\n return;\r\n }\r\n\r\n // Render and insert the template\r\n this._viewRef = this._viewContainerRef.createEmbeddedView(this.templateRef, {\r\n highlightedCode: this.highlightedCode,\r\n lang: this.lang\r\n });\r\n\r\n // Detect the changes\r\n this._viewRef.detectChanges();\r\n }\r\n}\r\n","<ng-content></ng-content>\r\n\r\n<ng-template let-highlightedCode=\"highlightedCode\" let-lang=\"lang\">\r\n <div class=\"cmat-highlight cmat-highlight-code-container\">\r\n <pre [ngClass]=\"'language-' + lang\"><code [ngClass]=\"'language-' + lang\" [innerHTML]=\"highlightedCode\"></code>\r\n </pre>\r\n </div>\r\n</ng-template>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAMa,oBAAoB,CAAA;IAC7B,SAAS,CAAC,IAAY,EAAE,QAAgB,EAAA;;AAEpC,QAAA,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;;AAGzB,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK;IACnD;AAEQ,IAAA,OAAO,CAAC,IAAY,EAAA;QACxB,IAAI,WAAW,GAAG,CAAC;;QAGnB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;;AAG9B,QAAA,OAAO,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC3C,KAAK,CAAC,KAAK,EAAE;QACjB;AAEA,QAAA,OAAO,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC1D,KAAK,CAAC,GAAG,EAAE;QACf;;QAGA,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM;AAC3B,aAAA,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;;;AAIrB,YAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACb,gBAAA,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;gBACjC;YACJ;;AAGA,YAAA,WAAW,GAAG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EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,aAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAKpB,WAAW,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECnB1B,gWAOc,kGDKA,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAER,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBATlC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,EAAA,aAAA,EAGrB,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,eAAe,EAAA,OAAA,EAChB,CAAC,OAAO,CAAC,EAAA,QAAA,EAAA,gWAAA,EAAA,MAAA,EAAA,CAAA,0CAAA,CAAA,EAAA
|
|
1
|
+
{"version":3,"file":"cmat-components-highlight.mjs","sources":["../../../projects/cmat/components/highlight/highlight.service.ts","../../../projects/cmat/components/highlight/highlight.component.ts","../../../projects/cmat/components/highlight/highlight.component.html","../../../projects/cmat/components/highlight/cmat-components-highlight.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport hljs from 'highlight.js';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatHighlightService {\r\n highlight(code: string, language: string): string {\r\n // Format the code\r\n code = this._format(code);\r\n\r\n // Highlight and return the code\r\n return hljs.highlight(code, { language }).value;\r\n }\r\n\r\n private _format(code: string): string {\r\n let indentation = 0;\r\n\r\n // Split the code into lines and store the lines\r\n const lines = code.split('\\n');\r\n\r\n // Trim the empty lines around the code block\r\n while (lines.length && lines[0].trim() === '') {\r\n lines.shift();\r\n }\r\n\r\n while (lines.length && lines[lines.length - 1].trim() === '') {\r\n lines.pop();\r\n }\r\n\r\n // Iterate through the lines\r\n lines.filter(line => line.length)\r\n .forEach((line, index) => {\r\n\r\n // Always get the indentation of the first line so we can\r\n // have something to compare with\r\n if (index === 0) {\r\n indentation = line.search(/\\S|$/);\r\n return;\r\n }\r\n\r\n // Look at all the remaining lines to figure out the smallest indentation.\r\n indentation = Math.min(line.search(/\\S|$/), indentation);\r\n });\r\n\r\n // Iterate through the lines one more time, remove the extra\r\n // indentation, join them together and return it\r\n return lines.map(line => line.substring(indentation)).join('\\n');\r\n }\r\n}\r\n","import { NgClass } from '@angular/common';\r\nimport { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EmbeddedViewRef, Input, OnChanges, SecurityContext, SimpleChanges, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation, inject } from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\nimport { CmatHighlightService } from './highlight.service';\r\n\r\n@Component({\r\n selector: 'textarea[cmat-highlight]',\r\n templateUrl: './highlight.component.html',\r\n styleUrls: ['./highlight.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatHighlight',\r\n imports: [NgClass]\r\n})\r\nexport class CmatHighlightComponent implements OnChanges, AfterViewInit {\r\n\r\n\r\n @Input() code: string;\r\n @Input() lang: string;\r\n @ViewChild(TemplateRef) templateRef: TemplateRef<any>;\r\n\r\n highlightedCode: string | null;\r\n private _viewRef: EmbeddedViewRef<any> | null;\r\n private _domSanitizer = inject(DomSanitizer);\r\n private _elementRef = inject(ElementRef);\r\n private _cmatHighlightService = inject(CmatHighlightService);\r\n private _viewContainerRef = inject(ViewContainerRef);\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // Code & Lang\r\n if ('code' in changes || 'lang' in changes) {\r\n // Return if the viewContainerRef is not available\r\n if (!this._viewContainerRef.length) {\r\n return;\r\n }\r\n\r\n // Highlight and insert the code\r\n this._highlightAndInsert();\r\n }\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n // Return if there is no language set\r\n if (!this.lang) {\r\n return;\r\n }\r\n\r\n // If there is no code input, get the code from\r\n // the textarea\r\n if (!this.code) {\r\n // Get the code\r\n this.code = this._elementRef.nativeElement.value;\r\n }\r\n\r\n // Highlight and insert\r\n this._highlightAndInsert();\r\n }\r\n\r\n private _highlightAndInsert(): void {\r\n // Return if the template reference is not available\r\n if (!this.templateRef) {\r\n return;\r\n }\r\n\r\n // Return if the code or language is not defined\r\n if (!this.code || !this.lang) {\r\n return;\r\n }\r\n\r\n // Destroy the component if there is already one\r\n if (this._viewRef) {\r\n this._viewRef.destroy();\r\n this._viewRef = null;\r\n }\r\n\r\n // Highlight and sanitize the code just in case\r\n this.highlightedCode = this._domSanitizer.sanitize(SecurityContext.HTML, this._cmatHighlightService.highlight(this.code, this.lang));\r\n\r\n // Return if the highlighted code is null\r\n if (this.highlightedCode === null) {\r\n return;\r\n }\r\n\r\n // Render and insert the template\r\n this._viewRef = this._viewContainerRef.createEmbeddedView(this.templateRef, {\r\n highlightedCode: this.highlightedCode,\r\n lang: this.lang\r\n });\r\n\r\n // Detect the changes\r\n this._viewRef.detectChanges();\r\n }\r\n}\r\n","<ng-content></ng-content>\r\n\r\n<ng-template let-highlightedCode=\"highlightedCode\" let-lang=\"lang\">\r\n <div class=\"cmat-highlight cmat-highlight-code-container\">\r\n <pre [ngClass]=\"'language-' + lang\"><code [ngClass]=\"'language-' + lang\" [innerHTML]=\"highlightedCode\"></code>\r\n </pre>\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