cmat 0.0.55 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-breadcrumb.mjs +10 -10
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +3 -3
- package/fesm2022/cmat-components-carousel.mjs +12 -12
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +10 -10
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +3 -3
- 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-drawer.mjs +6 -6
- package/fesm2022/cmat-components-fullscreen.mjs +3 -3
- package/fesm2022/cmat-components-highlight.mjs +6 -6
- package/fesm2022/cmat-components-image-viewer.mjs +16 -3
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +3 -3
- package/fesm2022/cmat-components-knob-input.mjs +3 -3
- package/fesm2022/cmat-components-masonry.mjs +3 -3
- package/fesm2022/cmat-components-material-color-picker.mjs +4 -4
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +44 -43
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +39 -39
- package/fesm2022/cmat-components-opt-input.mjs +4 -4
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +9 -9
- package/fesm2022/cmat-components-pagination.mjs +13 -12
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +9 -9
- package/fesm2022/cmat-components-popover.mjs +10 -10
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +3 -3
- package/fesm2022/cmat-components-qrcode.mjs +3 -3
- package/fesm2022/cmat-components-rating.mjs +3 -3
- package/fesm2022/cmat-components-select-search.mjs +10 -10
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +3 -3
- package/fesm2022/cmat-components-select-tree.mjs +5 -5
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +9 -9
- package/fesm2022/cmat-components-timeline.mjs +12 -12
- package/fesm2022/cmat-components-toast.mjs +9 -9
- package/fesm2022/cmat-components-transfer-picker.mjs +19 -19
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +6 -6
- package/fesm2022/cmat-components-upload.mjs +10 -10
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs +3 -7
- package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -6
- package/fesm2022/cmat-directives-arrow-cursor.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-data-exporter.mjs +21 -21
- package/fesm2022/cmat-directives-debounce.mjs +9 -9
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- 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 +4 -6
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- 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 +4 -4
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/package.json +90 -90
- package/{components/image-viewer/index.d.ts → types/cmat-components-image-viewer.d.ts} +7 -4
- package/{components/x6-angular-shape/index.d.ts → types/cmat-components-x6-angular-shape.d.ts} +4 -4
- package/{services/alert/index.d.ts → types/cmat-services-alert.d.ts} +3 -3
- /package/{components/adapter/index.d.ts → types/cmat-components-adapter.d.ts} +0 -0
- /package/{components/breadcrumb/index.d.ts → types/cmat-components-breadcrumb.d.ts} +0 -0
- /package/{components/card/index.d.ts → types/cmat-components-card.d.ts} +0 -0
- /package/{components/carousel/index.d.ts → types/cmat-components-carousel.d.ts} +0 -0
- /package/{components/cascade/index.d.ts → types/cmat-components-cascade.d.ts} +0 -0
- /package/{components/chip-input/index.d.ts → types/cmat-components-chip-input.d.ts} +0 -0
- /package/{components/custom-formly/index.d.ts → types/cmat-components-custom-formly.d.ts} +0 -0
- /package/{components/date-range/index.d.ts → types/cmat-components-date-range.d.ts} +0 -0
- /package/{components/drawer/index.d.ts → types/cmat-components-drawer.d.ts} +0 -0
- /package/{components/fullscreen/index.d.ts → types/cmat-components-fullscreen.d.ts} +0 -0
- /package/{components/highlight/index.d.ts → types/cmat-components-highlight.d.ts} +0 -0
- /package/{components/json-editor/index.d.ts → types/cmat-components-json-editor.d.ts} +0 -0
- /package/{components/knob-input/index.d.ts → types/cmat-components-knob-input.d.ts} +0 -0
- /package/{components/masonry/index.d.ts → types/cmat-components-masonry.d.ts} +0 -0
- /package/{components/material-color-picker/index.d.ts → types/cmat-components-material-color-picker.d.ts} +0 -0
- /package/{components/material-datetimepicker/index.d.ts → types/cmat-components-material-datetimepicker.d.ts} +0 -0
- /package/{components/navigation/index.d.ts → types/cmat-components-navigation.d.ts} +0 -0
- /package/{components/opt-input/index.d.ts → types/cmat-components-opt-input.d.ts} +0 -0
- /package/{components/org-chart/index.d.ts → types/cmat-components-org-chart.d.ts} +0 -0
- /package/{components/pagination/index.d.ts → types/cmat-components-pagination.d.ts} +0 -0
- /package/{components/password-strength/index.d.ts → types/cmat-components-password-strength.d.ts} +0 -0
- /package/{components/popover/index.d.ts → types/cmat-components-popover.d.ts} +0 -0
- /package/{components/progress-bar/index.d.ts → types/cmat-components-progress-bar.d.ts} +0 -0
- /package/{components/qrcode/index.d.ts → types/cmat-components-qrcode.d.ts} +0 -0
- /package/{components/rating/index.d.ts → types/cmat-components-rating.d.ts} +0 -0
- /package/{components/select-search/index.d.ts → types/cmat-components-select-search.d.ts} +0 -0
- /package/{components/select-table/index.d.ts → types/cmat-components-select-table.d.ts} +0 -0
- /package/{components/select-tree/index.d.ts → types/cmat-components-select-tree.d.ts} +0 -0
- /package/{components/speed-dial/index.d.ts → types/cmat-components-speed-dial.d.ts} +0 -0
- /package/{components/timeline/index.d.ts → types/cmat-components-timeline.d.ts} +0 -0
- /package/{components/toast/index.d.ts → types/cmat-components-toast.d.ts} +0 -0
- /package/{components/transfer-picker/index.d.ts → types/cmat-components-transfer-picker.d.ts} +0 -0
- /package/{components/treetable/index.d.ts → types/cmat-components-treetable.d.ts} +0 -0
- /package/{components/upload/index.d.ts → types/cmat-components-upload.d.ts} +0 -0
- /package/{directives/animate-on-scroll/index.d.ts → types/cmat-directives-animate-on-scroll.d.ts} +0 -0
- /package/{directives/arrow-cursor/index.d.ts → types/cmat-directives-arrow-cursor.d.ts} +0 -0
- /package/{directives/autofocus/index.d.ts → types/cmat-directives-autofocus.d.ts} +0 -0
- /package/{directives/data-exporter/index.d.ts → types/cmat-directives-data-exporter.d.ts} +0 -0
- /package/{directives/debounce/index.d.ts → types/cmat-directives-debounce.d.ts} +0 -0
- /package/{directives/digit-only/index.d.ts → types/cmat-directives-digit-only.d.ts} +0 -0
- /package/{directives/equal-validator/index.d.ts → types/cmat-directives-equal-validator.d.ts} +0 -0
- /package/{lib/mock-api/index.d.ts → types/cmat-lib-mock-api.d.ts} +0 -0
- /package/{pipes/bytes/index.d.ts → types/cmat-pipes-bytes.d.ts} +0 -0
- /package/{pipes/date-format/index.d.ts → types/cmat-pipes-date-format.d.ts} +0 -0
- /package/{pipes/find-by-key/index.d.ts → types/cmat-pipes-find-by-key.d.ts} +0 -0
- /package/{pipes/group-by/index.d.ts → types/cmat-pipes-group-by.d.ts} +0 -0
- /package/{pipes/keys/index.d.ts → types/cmat-pipes-keys.d.ts} +0 -0
- /package/{pipes/secure/index.d.ts → types/cmat-pipes-secure.d.ts} +0 -0
- /package/{pipes/uppercase/index.d.ts → types/cmat-pipes-uppercase.d.ts} +0 -0
- /package/{services/config/index.d.ts → types/cmat-services-config.d.ts} +0 -0
- /package/{services/confirmation/index.d.ts → types/cmat-services-confirmation.d.ts} +0 -0
- /package/{services/data/index.d.ts → types/cmat-services-data.d.ts} +0 -0
- /package/{services/export-as/index.d.ts → types/cmat-services-export-as.d.ts} +0 -0
- /package/{services/loading/index.d.ts → types/cmat-services-loading.d.ts} +0 -0
- /package/{services/local-storage/index.d.ts → types/cmat-services-local-storage.d.ts} +0 -0
- /package/{services/media-watcher/index.d.ts → types/cmat-services-media-watcher.d.ts} +0 -0
- /package/{services/platform/index.d.ts → types/cmat-services-platform.d.ts} +0 -0
- /package/{services/splash-screen/index.d.ts → types/cmat-services-splash-screen.d.ts} +0 -0
- /package/{services/title/index.d.ts → types/cmat-services-title.d.ts} +0 -0
- /package/{services/translation/index.d.ts → types/cmat-services-translation.d.ts} +0 -0
- /package/{services/utils/index.d.ts → types/cmat-services-utils.d.ts} +0 -0
- /package/{validators/index.d.ts → types/cmat-validators.d.ts} +0 -0
- /package/{version/index.d.ts → types/cmat-version.d.ts} +0 -0
- /package/{index.d.ts → types/cmat.d.ts} +0 -0
|
@@ -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: "
|
|
515
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
514
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
515
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", 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: "
|
|
523
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", 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
|
{
|
|
@@ -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: "
|
|
36
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatDrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
36
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatDrawerService, providedIn: 'root' }); }
|
|
37
37
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", 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: "
|
|
289
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
288
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
289
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", 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: "
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", 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: [{
|
|
@@ -28,10 +28,10 @@ class CmatFullscreenComponent {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatFullscreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
32
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", 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: "
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", 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: [{
|
|
@@ -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: "
|
|
42
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatHighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
42
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatHighlightService, providedIn: 'root' }); }
|
|
43
43
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", 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: "
|
|
112
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", 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: "
|
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", 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: [{
|
|
@@ -30,6 +30,7 @@ class CmatImageComponent {
|
|
|
30
30
|
this._closePreviewByEscape = false;
|
|
31
31
|
this._document = inject(DOCUMENT);
|
|
32
32
|
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
33
|
+
this._originalOverflow = null;
|
|
33
34
|
this._zoomSettings = {
|
|
34
35
|
default: 1,
|
|
35
36
|
step: 0.1,
|
|
@@ -74,11 +75,13 @@ class CmatImageComponent {
|
|
|
74
75
|
;
|
|
75
76
|
onKeydownHandler() {
|
|
76
77
|
if (this.previewVisible) {
|
|
78
|
+
this._enableBackgroundScroll();
|
|
77
79
|
this.closePreview();
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
onImageClick() {
|
|
81
83
|
if (this.preview) {
|
|
84
|
+
this._disableBackgroundScroll();
|
|
82
85
|
this.maskVisible = true;
|
|
83
86
|
this.previewVisible = true;
|
|
84
87
|
this._loadingPreview = true;
|
|
@@ -131,6 +134,7 @@ class CmatImageComponent {
|
|
|
131
134
|
return { transform: 'rotate(' + this.rotate + 'deg) scale(' + this.scale + ')' };
|
|
132
135
|
}
|
|
133
136
|
closePreview() {
|
|
137
|
+
this._enableBackgroundScroll();
|
|
134
138
|
this.previewVisible = false;
|
|
135
139
|
this.rotate = 0;
|
|
136
140
|
this.scale = this._zoomSettings.default;
|
|
@@ -143,10 +147,19 @@ class CmatImageComponent {
|
|
|
143
147
|
imageError(event) {
|
|
144
148
|
this.imageErrorEvent.emit(event);
|
|
145
149
|
}
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
_disableBackgroundScroll() {
|
|
151
|
+
const body = this._document.body;
|
|
152
|
+
this._originalOverflow = body.style.overflow;
|
|
153
|
+
body.style.overflow = 'hidden';
|
|
154
|
+
}
|
|
155
|
+
_enableBackgroundScroll() {
|
|
156
|
+
const body = this._document.body;
|
|
157
|
+
body.style.overflow = this._originalOverflow ?? '';
|
|
158
|
+
}
|
|
159
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
160
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CmatImageComponent, isStandalone: true, selector: "cmat-image", inputs: { imageClass: "imageClass", imageStyle: "imageStyle", src: "src", srcSet: "srcSet", previewImageSrc: "previewImageSrc", previewImageSrcSet: "previewImageSrcSet", alt: "alt", width: "width", height: "height", loading: "loading", appendTo: "appendTo", preview: ["preview", "preview", booleanAttribute] }, outputs: { previewShowChange: "previewShowChange", imageErrorEvent: "imageErrorEvent" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)" } }, viewQueries: [{ propertyName: "mask", first: true, predicate: ["mask"], descendants: true }, { propertyName: "previewButton", first: true, predicate: ["previewButton"], descendants: true }, { propertyName: "closeButton", first: true, predicate: ["closeButton"], descendants: true }], ngImport: i0, template: "<span [ngClass]=\"{ 'cmat-image-preview-container ': preview }\">\r\n <img [attr.src]=\"src\" [attr.srcset]=\"srcSet\" [attr.alt]=\"alt\" [attr.width]=\"width\" [attr.height]=\"height\"\r\n [attr.loading]=\"loading\" [ngStyle]=\"imageStyle\" [class]=\"imageClass\" (error)=\"imageError($event)\" />\r\n @if(preview){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomOutDisabled\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" [attr.src]=\"previewImageSrc ? previewImageSrc : src\"\r\n [attr.srcset]=\"previewImageSrcSet\" [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>", styles: [".cmat-image-mask{display:flex;align-items:center;justify-content:center}.cmat-image-preview-container{position:relative;display:inline-block;line-height:0}.cmat-image-preview-indicator{position:absolute;left:0;top:0;width:100%;height:100%;outline:none;border:none;padding:0;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .3s}.cmat-image-preview-container:hover>.cmat-image-preview-indicator{opacity:1;cursor:pointer;background-color:#00000080}.cmat-image-preview-container>img{cursor:pointer}.cmat-image-toolbar{position:absolute;top:0;right:0;display:flex;z-index:1;padding:.5rem}.cmat-image-preview{transition:transform .15s;max-width:100vw;max-height:100vh}.cmat-image-preview-enter{animation:preview-enter-animation .15s cubic-bezier(0,0,.2,1)}.cmat-image-preview-leave{animation:preview-leave-animation .15s cubic-bezier(0,0,.2,1)}.cmat-image-overlay{background-color:#0006;transition-duration:.2s;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:99}.cmat-image-overlay-enter{animation:image-overlay-enter-animation .15s}.cmat-image-overlay-leave{z-index:0;animation:image-overlay-leave-animation .15s}@keyframes preview-enter-animation{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}@keyframes preview-leave-animation{0%{transform:scale(1);opacity:1}to{transform:scale(.7);opacity:0}}@keyframes image-overlay-enter-animation{0%{background-color:transparent}to{background-color:#000000e6}}@keyframes image-overlay-leave-animation{0%{background-color:#000000e6}to{background-color:transparent}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
148
161
|
}
|
|
149
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatImageComponent, decorators: [{
|
|
150
163
|
type: Component,
|
|
151
164
|
args: [{ selector: 'cmat-image', imports: [CommonModule, MatButtonModule, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span [ngClass]=\"{ 'cmat-image-preview-container ': preview }\">\r\n <img [attr.src]=\"src\" [attr.srcset]=\"srcSet\" [attr.alt]=\"alt\" [attr.width]=\"width\" [attr.height]=\"height\"\r\n [attr.loading]=\"loading\" [ngStyle]=\"imageStyle\" [class]=\"imageClass\" (error)=\"imageError($event)\" />\r\n @if(preview){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomOutDisabled\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" [attr.src]=\"previewImageSrc ? previewImageSrc : src\"\r\n [attr.srcset]=\"previewImageSrcSet\" [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>", styles: [".cmat-image-mask{display:flex;align-items:center;justify-content:center}.cmat-image-preview-container{position:relative;display:inline-block;line-height:0}.cmat-image-preview-indicator{position:absolute;left:0;top:0;width:100%;height:100%;outline:none;border:none;padding:0;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .3s}.cmat-image-preview-container:hover>.cmat-image-preview-indicator{opacity:1;cursor:pointer;background-color:#00000080}.cmat-image-preview-container>img{cursor:pointer}.cmat-image-toolbar{position:absolute;top:0;right:0;display:flex;z-index:1;padding:.5rem}.cmat-image-preview{transition:transform .15s;max-width:100vw;max-height:100vh}.cmat-image-preview-enter{animation:preview-enter-animation .15s cubic-bezier(0,0,.2,1)}.cmat-image-preview-leave{animation:preview-leave-animation .15s cubic-bezier(0,0,.2,1)}.cmat-image-overlay{background-color:#0006;transition-duration:.2s;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:99}.cmat-image-overlay-enter{animation:image-overlay-enter-animation .15s}.cmat-image-overlay-leave{z-index:0;animation:image-overlay-leave-animation .15s}@keyframes preview-enter-animation{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}@keyframes preview-leave-animation{0%{transform:scale(1);opacity:1}to{transform:scale(.7);opacity:0}}@keyframes image-overlay-enter-animation{0%{background-color:transparent}to{background-color:#000000e6}}@keyframes image-overlay-leave-animation{0%{background-color:#000000e6}to{background-color:transparent}}\n"] }]
|
|
152
165
|
}], propDecorators: { imageClass: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-image-viewer.mjs","sources":["../../../projects/cmat/components/image-viewer/image-viewer.component.ts","../../../projects/cmat/components/image-viewer/image-viewer.component.html","../../../projects/cmat/components/image-viewer/cmat-components-image-viewer.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n TemplateRef,\r\n ViewChild,\r\n ViewEncapsulation,\r\n booleanAttribute,\r\n DOCUMENT,\r\n inject,\r\n HostListener,\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { SafeUrl } from '@angular/platform-browser';\r\n\r\n@Component({\r\n selector: 'cmat-image',\r\n templateUrl: './image-viewer.component.html',\r\n styleUrls: ['./image-viewer.component.scss'],\r\n imports: [CommonModule, MatButtonModule, MatIconModule],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class CmatImageComponent {\r\n\r\n @Input() imageClass: string | undefined;\r\n\r\n @Input() imageStyle: Record<string, any> | null | undefined;\r\n\r\n @Input() src: string | SafeUrl | undefined;\r\n\r\n @Input() srcSet: string | SafeUrl | undefined;\r\n\r\n @Input() previewImageSrc: string | SafeUrl | undefined;\r\n\r\n @Input() previewImageSrcSet: string | SafeUrl | undefined;\r\n\r\n @Input() alt: string | undefined;\r\n\r\n @Input() width: number | undefined;\r\n\r\n @Input() height: number | undefined;\r\n\r\n @Input() loading: 'lazy' | 'eager' | undefined;\r\n /**\r\n * 要附加对话框的目标元素,有效值是“body”或另一个元素的本地ng模板变量(注意:使用带括号的绑定来绑定模板变量,例如[appedTo]=“mydiv”用于变量名为#mydiv的div元素)。\r\n */\r\n @Input() appendTo: HTMLElement | ElementRef | TemplateRef<any> | string | null | undefined;\r\n /**\r\n * 启动预览功能。\r\n */\r\n @Input({ transform: booleanAttribute }) preview: boolean = false;\r\n /**\r\n * 监听预览显示/隐藏.\r\n */\r\n @Output() previewShowChange: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n /**\r\n * 如果加载图像文件时发生错误,则会触发此事件.\r\n */\r\n @Output() imageErrorEvent: EventEmitter<Event> = new EventEmitter<Event>();\r\n\r\n el = inject(ElementRef);\r\n\r\n maskVisible: boolean = false;\r\n\r\n previewVisible: boolean = false;\r\n\r\n rotate: number = 0;\r\n\r\n scale: number = 1;\r\n\r\n private _loadingPreview: boolean = false;\r\n private _closePreviewByEscape: boolean = false;\r\n private _document = inject<Document>(DOCUMENT);\r\n private _changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n private _zoomSettings = {\r\n default: 1,\r\n step: 0.1,\r\n max: 1.5,\r\n min: 0.5\r\n };\r\n\r\n get isZoomOutDisabled(): boolean {\r\n return this.scale - this._zoomSettings.step <= this._zoomSettings.min;\r\n }\r\n\r\n get isZoomInDisabled(): boolean {\r\n return this.scale + this._zoomSettings.step >= this._zoomSettings.max;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n private _mask?: HTMLDivElement | undefined;\r\n @ViewChild('mask', { static: false })\r\n set mask(value: ElementRef<HTMLDivElement> | undefined) {\r\n if (value) {\r\n this._mask = value.nativeElement;\r\n\r\n if (this._mask && this._loadingPreview) {\r\n this.appendContainer();\r\n }\r\n }\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n private _previewButton?: HTMLButtonElement | undefined;\r\n @ViewChild('previewButton', { static: false })\r\n set previewButton(value: ElementRef<HTMLButtonElement> | undefined) {\r\n if (value) {\r\n this._previewButton = value.nativeElement;\r\n\r\n if (this._previewButton && this._closePreviewByEscape) {\r\n this._previewButton.focus();\r\n this._closePreviewByEscape = false;\r\n }\r\n }\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n private _closeButton?: HTMLButtonElement | undefined;\r\n @ViewChild('closeButton', { static: false })\r\n set closeButton(value: ElementRef<HTMLButtonElement> | undefined) {\r\n if (value) {\r\n this._closeButton = value.nativeElement;\r\n\r\n if (this._closeButton && this._loadingPreview) {\r\n this._closeButton.focus();\r\n this._loadingPreview = false;\r\n }\r\n }\r\n };\r\n\r\n @HostListener('document:keydown.escape', ['$event'])\r\n onKeydownHandler(): void {\r\n if (this.previewVisible) {\r\n this.closePreview();\r\n }\r\n }\r\n\r\n onImageClick(): void {\r\n if (this.preview) {\r\n this.maskVisible = true;\r\n this.previewVisible = true;\r\n\r\n this._loadingPreview = true;\r\n this._changeDetectorRef.markForCheck();\r\n\r\n this.previewShowChange.emit(true);\r\n }\r\n }\r\n\r\n onMaskKeydown(event: KeyboardEvent): void {\r\n switch (event.code) {\r\n case 'Escape':\r\n this.closePreview();\r\n this._closePreviewByEscape = true;\r\n event.preventDefault();\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n onPreviewImageClick(event: MouseEvent): void {\r\n event.stopPropagation();\r\n }\r\n\r\n rotateRight(): void {\r\n this.rotate += 90;\r\n }\r\n\r\n rotateLeft(): void {\r\n this.rotate -= 90;\r\n }\r\n\r\n zoomIn(): void {\r\n this.scale = this.scale + this._zoomSettings.step;\r\n }\r\n\r\n zoomOut(): void {\r\n this.scale = this.scale - this._zoomSettings.step;\r\n }\r\n\r\n handleToolbarClick(event: MouseEvent): void {\r\n event.stopPropagation();\r\n }\r\n\r\n appendContainer(): void {\r\n if (this.appendTo) {\r\n if (this.appendTo === 'body') this._document.body.appendChild(this._mask as HTMLElement);\r\n else {\r\n if (typeof HTMLElement === 'object' ? this.appendTo instanceof HTMLElement : this.appendTo && typeof this.appendTo === 'object' && this.appendTo !== null)\r\n (this.appendTo as any).appendChild(this._mask);\r\n else if ((this.appendTo as any)?.el?.nativeElement)\r\n (this.appendTo as any).el.nativeElement.appendChild(this.mask?.nativeElement);\r\n }\r\n \r\n }\r\n }\r\n\r\n imagePreviewStyle(): { transform: string; } {\r\n return { transform: 'rotate(' + this.rotate + 'deg) scale(' + this.scale + ')' };\r\n }\r\n\r\n closePreview(): void {\r\n this.previewVisible = false;\r\n this.rotate = 0;\r\n this.scale = this._zoomSettings.default;\r\n\r\n setTimeout(() => {\r\n this.maskVisible = false;\r\n\r\n this._changeDetectorRef.markForCheck();\r\n this.previewShowChange.emit(false);\r\n }, 25);\r\n }\r\n\r\n imageError(event: Event): void {\r\n this.imageErrorEvent.emit(event);\r\n }\r\n}\r\n","<span [ngClass]=\"{ 'cmat-image-preview-container ': preview }\">\r\n <img [attr.src]=\"src\" [attr.srcset]=\"srcSet\" [attr.alt]=\"alt\" [attr.width]=\"width\" [attr.height]=\"height\"\r\n [attr.loading]=\"loading\" [ngStyle]=\"imageStyle\" [class]=\"imageClass\" (error)=\"imageError($event)\" />\r\n @if(preview){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomOutDisabled\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" [attr.src]=\"previewImageSrc ? previewImageSrc : src\"\r\n [attr.srcset]=\"previewImageSrcSet\" [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,kBAAkB,CAAA;AAR/B,IAAA,WAAA,GAAA;AAiCI;;AAEG;QACqC,IAAA,CAAA,OAAO,GAAY,KAAK;AAChE;;AAEG;AACO,QAAA,IAAA,CAAA,iBAAiB,GAA0B,IAAI,YAAY,EAAW;AAChF;;AAEG;AACO,QAAA,IAAA,CAAA,eAAe,GAAwB,IAAI,YAAY,EAAS;AAE1E,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;QAEvB,IAAA,CAAA,WAAW,GAAY,KAAK;QAE5B,IAAA,CAAA,cAAc,GAAY,KAAK;QAE/B,IAAA,CAAA,MAAM,GAAW,CAAC;QAElB,IAAA,CAAA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EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,m9EAAA,EAAA,MAAA,EAAA,CAAA,kiDAAA,CAAA,EAAA;;sBAIpC;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAIA;;sBAIA,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAIrC;;sBAIA;;sBAkCA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;sBAanC,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;sBAc5C,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,aAAa,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;sBAY1C,YAAY;uBAAC,yBAAyB,EAAE,CAAC,QAAQ,CAAC;;;AE1IvD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cmat-components-image-viewer.mjs","sources":["../../../projects/cmat/components/image-viewer/image-viewer.component.ts","../../../projects/cmat/components/image-viewer/image-viewer.component.html","../../../projects/cmat/components/image-viewer/cmat-components-image-viewer.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n TemplateRef,\r\n ViewChild,\r\n ViewEncapsulation,\r\n booleanAttribute,\r\n DOCUMENT,\r\n inject,\r\n HostListener,\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { SafeUrl } from '@angular/platform-browser';\r\n\r\n@Component({\r\n selector: 'cmat-image',\r\n templateUrl: './image-viewer.component.html',\r\n styleUrls: ['./image-viewer.component.scss'],\r\n imports: [CommonModule, MatButtonModule, MatIconModule],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class CmatImageComponent {\r\n\r\n @Input() imageClass: string | undefined;\r\n\r\n @Input() imageStyle: Record<string, any> | null | undefined;\r\n\r\n @Input() src: SafeUrl | undefined;\r\n\r\n @Input() srcSet: SafeUrl | undefined;\r\n\r\n @Input() previewImageSrc: SafeUrl | undefined;\r\n\r\n @Input() previewImageSrcSet: SafeUrl | undefined;\r\n\r\n @Input() alt: string | undefined;\r\n\r\n @Input() width: number | undefined;\r\n\r\n @Input() height: number | undefined;\r\n\r\n @Input() loading: 'lazy' | 'eager' | undefined;\r\n /**\r\n * 要附加对话框的目标元素,有效值是“body”或另一个元素的本地ng模板变量(注意:使用带括号的绑定来绑定模板变量,例如[appedTo]=“mydiv”用于变量名为#mydiv的div元素)。\r\n */\r\n @Input() appendTo: HTMLElement | ElementRef | TemplateRef<any> | string | null | undefined;\r\n /**\r\n * 启动预览功能。\r\n */\r\n @Input({ transform: booleanAttribute }) preview: boolean = false;\r\n /**\r\n * 监听预览显示/隐藏.\r\n */\r\n @Output() previewShowChange: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n /**\r\n * 如果加载图像文件时发生错误,则会触发此事件.\r\n */\r\n @Output() imageErrorEvent: EventEmitter<Event> = new EventEmitter<Event>();\r\n\r\n el = inject(ElementRef);\r\n\r\n maskVisible: boolean = false;\r\n\r\n previewVisible: boolean = false;\r\n\r\n rotate: number = 0;\r\n\r\n scale: number = 1;\r\n\r\n private _loadingPreview: boolean = false;\r\n private _closePreviewByEscape: boolean = false;\r\n private _document = inject<Document>(DOCUMENT);\r\n private _changeDetectorRef = inject(ChangeDetectorRef);\r\n private _originalOverflow: string | null = null;\r\n\r\n private _zoomSettings = {\r\n default: 1,\r\n step: 0.1,\r\n max: 1.5,\r\n min: 0.5\r\n };\r\n\r\n get isZoomOutDisabled(): boolean {\r\n return this.scale - this._zoomSettings.step <= this._zoomSettings.min;\r\n }\r\n\r\n get isZoomInDisabled(): boolean {\r\n return this.scale + this._zoomSettings.step >= this._zoomSettings.max;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n private _mask?: HTMLDivElement | undefined;\r\n @ViewChild('mask', { static: false })\r\n set mask(value: ElementRef<HTMLDivElement> | undefined) {\r\n if (value) {\r\n this._mask = value.nativeElement;\r\n\r\n if (this._mask && this._loadingPreview) {\r\n this.appendContainer();\r\n }\r\n }\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n private _previewButton?: HTMLButtonElement | undefined;\r\n @ViewChild('previewButton', { static: false })\r\n set previewButton(value: ElementRef<HTMLButtonElement> | undefined) {\r\n if (value) {\r\n this._previewButton = value.nativeElement;\r\n\r\n if (this._previewButton && this._closePreviewByEscape) {\r\n this._previewButton.focus();\r\n this._closePreviewByEscape = false;\r\n }\r\n }\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n private _closeButton?: HTMLButtonElement | undefined;\r\n @ViewChild('closeButton', { static: false })\r\n set closeButton(value: ElementRef<HTMLButtonElement> | undefined) {\r\n if (value) {\r\n this._closeButton = value.nativeElement;\r\n\r\n if (this._closeButton && this._loadingPreview) {\r\n this._closeButton.focus();\r\n this._loadingPreview = false;\r\n }\r\n }\r\n };\r\n\r\n @HostListener('document:keydown.escape', ['$event'])\r\n onKeydownHandler(): void {\r\n if (this.previewVisible) {\r\n this._enableBackgroundScroll();\r\n this.closePreview();\r\n }\r\n }\r\n\r\n onImageClick(): void {\r\n if (this.preview) {\r\n this._disableBackgroundScroll();\r\n this.maskVisible = true;\r\n this.previewVisible = true;\r\n\r\n this._loadingPreview = true;\r\n this._changeDetectorRef.markForCheck();\r\n\r\n this.previewShowChange.emit(true);\r\n }\r\n }\r\n\r\n onMaskKeydown(event: KeyboardEvent): void {\r\n switch (event.code) {\r\n case 'Escape':\r\n this.closePreview();\r\n this._closePreviewByEscape = true;\r\n event.preventDefault();\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n onPreviewImageClick(event: MouseEvent): void {\r\n event.stopPropagation();\r\n }\r\n\r\n rotateRight(): void {\r\n this.rotate += 90;\r\n }\r\n\r\n rotateLeft(): void {\r\n this.rotate -= 90;\r\n }\r\n\r\n zoomIn(): void {\r\n this.scale = this.scale + this._zoomSettings.step;\r\n }\r\n\r\n zoomOut(): void {\r\n this.scale = this.scale - this._zoomSettings.step;\r\n }\r\n\r\n handleToolbarClick(event: MouseEvent): void {\r\n event.stopPropagation();\r\n }\r\n\r\n appendContainer(): void {\r\n if (this.appendTo) {\r\n if (this.appendTo === 'body') this._document.body.appendChild(this._mask as HTMLElement);\r\n else {\r\n if (typeof HTMLElement === 'object' ? this.appendTo instanceof HTMLElement : this.appendTo && typeof this.appendTo === 'object' && this.appendTo !== null)\r\n (this.appendTo as any).appendChild(this._mask);\r\n else if ((this.appendTo as any)?.el?.nativeElement)\r\n (this.appendTo as any).el.nativeElement.appendChild(this.mask?.nativeElement);\r\n }\r\n\r\n }\r\n }\r\n\r\n imagePreviewStyle(): { transform: string; } {\r\n return { transform: 'rotate(' + this.rotate + 'deg) scale(' + this.scale + ')' };\r\n }\r\n\r\n closePreview(): void {\r\n this._enableBackgroundScroll();\r\n this.previewVisible = false;\r\n this.rotate = 0;\r\n this.scale = this._zoomSettings.default;\r\n\r\n setTimeout(() => {\r\n this.maskVisible = false;\r\n\r\n this._changeDetectorRef.markForCheck();\r\n this.previewShowChange.emit(false);\r\n }, 25);\r\n }\r\n\r\n imageError(event: Event): void {\r\n this.imageErrorEvent.emit(event);\r\n }\r\n\r\n private _disableBackgroundScroll(): void {\r\n const body = this._document.body;\r\n this._originalOverflow = body.style.overflow;\r\n body.style.overflow = 'hidden';\r\n }\r\n\r\n private _enableBackgroundScroll(): void {\r\n const body = this._document.body;\r\n body.style.overflow = this._originalOverflow ?? '';\r\n }\r\n}\r\n","<span [ngClass]=\"{ 'cmat-image-preview-container ': preview }\">\r\n <img [attr.src]=\"src\" [attr.srcset]=\"srcSet\" [attr.alt]=\"alt\" [attr.width]=\"width\" [attr.height]=\"height\"\r\n [attr.loading]=\"loading\" [ngStyle]=\"imageStyle\" [class]=\"imageClass\" (error)=\"imageError($event)\" />\r\n @if(preview){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomOutDisabled\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" [attr.src]=\"previewImageSrc ? previewImageSrc : src\"\r\n [attr.srcset]=\"previewImageSrcSet\" [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,kBAAkB,CAAA;AAR/B,IAAA,WAAA,GAAA;AAiCI;;AAEG;QACqC,IAAA,CAAA,OAAO,GAAY,KAAK;AAChE;;AAEG;AACO,QAAA,IAAA,CAAA,iBAAiB,GAA0B,IAAI,YAAY,EAAW;AAChF;;AAEG;AACO,QAAA,IAAA,CAAA,eAAe,GAAwB,IAAI,YAAY,EAAS;AAE1E,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;QAEvB,IAAA,CAAA,WAAW,GAAY,KAAK;QAE5B,IAAA,CAAA,cAAc,GAAY,KAAK;QAE/B,IAAA,CAAA,MAAM,GAAW,CAAC;QAElB,IAAA,CAAA,KAAK,GAAW,CAAC;QAET,IAAA,CAAA,eAAe,GAAY,KAAK;QAChC,IAAA,CAAA,qBAAqB,GAAY,KAAK;AACtC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAW,QAAQ,CAAC;AACtC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAC9C,IAAA,CAAA,iBAAiB,GAAkB,IAAI;AAEvC,QAAA,IAAA,CAAA,aAAa,GAAG;AACpB,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,IAAI,EAAE,GAAG;AACT,YAAA,GAAG,EAAE,GAAG;AACR,YAAA,GAAG,EAAE;SACR;AA0JJ,IAAA;AAxJG,IAAA,IAAI,iBAAiB,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG;IACzE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m9EAAA,EAAA,MAAA,EAAA,CAAA,kiDAAA,CAAA,EAAA;;sBAIpC;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAIA;;sBAIA,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAIrC;;sBAIA;;sBAmCA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;sBAanC,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;sBAc5C,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,aAAa,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;sBAY1C,YAAY;uBAAC,yBAAyB,EAAE,CAAC,QAAQ,CAAC;;;AE3IvD;;AAEG;;;;"}
|
|
@@ -156,10 +156,10 @@ class CmatJsonEditorComponent {
|
|
|
156
156
|
this.pathChanged.emit(st);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
160
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
159
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatJsonEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
160
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: CmatJsonEditorComponent, isStandalone: true, selector: "cmat-json-editor", inputs: { options: "options", data: "data" }, outputs: { contentChanged: "contentChanged", pathChanged: "pathChanged" }, viewQueries: [{ propertyName: "jsonEditorContainer", first: true, predicate: ["jsonEditorContainer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div class="cmat-jsoneditor" [id]="id" #jsonEditorContainer></div>', isInline: true, styles: [".cmat-jsoneditor .jse-main.svelte-sxaskb{min-height:24rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
161
161
|
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatJsonEditorComponent, decorators: [{
|
|
163
163
|
type: Component,
|
|
164
164
|
args: [{ selector: 'cmat-json-editor', template: '<div class="cmat-jsoneditor" [id]="id" #jsonEditorContainer></div>', preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [], styles: [".cmat-jsoneditor .jse-main.svelte-sxaskb{min-height:24rem}\n"] }]
|
|
165
165
|
}], propDecorators: { jsonEditorContainer: [{
|
|
@@ -322,12 +322,12 @@ class CmatKnobInputComponent {
|
|
|
322
322
|
valueToDisplay() {
|
|
323
323
|
return this.valueTemplate.replace('{value}', this.value.toString());
|
|
324
324
|
}
|
|
325
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
326
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
325
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatKnobInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
326
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CmatKnobInputComponent, isStandalone: true, selector: "cmat-knob-input", inputs: { id: "id", valueColor: "valueColor", rangeColor: "rangeColor", textColor: "textColor", valueTemplate: "valueTemplate", name: "name", size: "size", step: "step", min: "min", max: "max", strokeWidth: "strokeWidth", showValue: "showValue", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "keydown": "onKeyDown($event)", "mousedown": "onMouseDown($event)", "mouseup": "onMouseUp($event)", "touchstart": "onTouchStart($event)", "touchend": "onTouchEnd($event)" }, properties: { "attr.id": "this.id" } }, providers: [
|
|
327
327
|
{ provide: MatFormFieldControl, useExisting: CmatKnobInputComponent }
|
|
328
328
|
], viewQueries: [{ propertyName: "_knobElementRef", first: true, predicate: ["knob"], descendants: true }], exportAs: ["cmatKnobInput"], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\r\n<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div #knob [class.cmat-knob-disabled]=\"disabled\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut($event)\">\r\n <svg viewBox=\"0 0 100 100\" role=\"slider\" [style.width]=\"size + 'px'\" [style.height]=\"size + 'px'\"\r\n [attr.aria-valuemin]=\"min\" [attr.aria-valuemax]=\"max\" [attr.aria-valuenow]=\"value\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\" (click)=\"onClick($event)\">\r\n <path class=\"knob-range\" [attr.d]=\"rangePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"rangeColor\">\r\n </path>\r\n <path class=\"knob-value\" [attr.d]=\"valuePath()\" [attr.stroke-width]=\"strokeWidth\" [attr.stroke]=\"valueColor\">\r\n </path>\r\n @if(showValue){\r\n <text text-anchor=\"middle\" class=\"knob-text\" [attr.x]=\"50\" [attr.y]=\"57\" [attr.fill]=\"textColor\"\r\n [attr.name]=\"name\">{{ valueToDisplay() }}</text>\r\n }\r\n </svg>\r\n</div>", styles: ["cmat-knob-input .knob-range{fill:none;transition:stroke .1s ease-in}cmat-knob-input .knob-value{animation-name:dash-frame;animation-fill-mode:forwards;fill:none}cmat-knob-input .knob-text{font-size:1.3rem;text-align:center}cmat-knob-input .cmat-knob-disabled{opacity:.6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
329
329
|
}
|
|
330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatKnobInputComponent, decorators: [{
|
|
331
331
|
type: Component,
|
|
332
332
|
args: [{ selector: 'cmat-knob-input', providers: [
|
|
333
333
|
{ provide: MatFormFieldControl, useExisting: CmatKnobInputComponent }
|
|
@@ -41,10 +41,10 @@ class CmatMasonryComponent {
|
|
|
41
41
|
this.distributedColumns = newDistributedColumns;
|
|
42
42
|
this._changeDetectorRef.markForCheck();
|
|
43
43
|
}
|
|
44
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
45
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatMasonryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
45
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: CmatMasonryComponent, isStandalone: true, selector: "cmat-masonry", inputs: { columnsTemplate: "columnsTemplate", columns: "columns", items: "items" }, exportAs: ["cmatMasonry"], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex p-2\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate; context: { $implicit: distributedColumns }\"></ng-container>\r\n</div>", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
46
46
|
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatMasonryComponent, decorators: [{
|
|
48
48
|
type: Component,
|
|
49
49
|
args: [{ selector: 'cmat-masonry', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatMasonry', imports: [NgTemplateOutlet], template: "<div class=\"flex p-2\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate; context: { $implicit: distributedColumns }\"></ng-container>\r\n</div>" }]
|
|
50
50
|
}], propDecorators: { columnsTemplate: [{
|
|
@@ -128,7 +128,7 @@ class CmatMaterialColorPickerComponent {
|
|
|
128
128
|
this.updateSelectedColor();
|
|
129
129
|
}
|
|
130
130
|
updateSelectedColor() {
|
|
131
|
-
if (this.selectedColor
|
|
131
|
+
if (this.selectedColor?.palette === this.selectedPalette && this.selectedColor?.hue === this.selectedHue) {
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
// Set the selected color object
|
|
@@ -153,10 +153,10 @@ class CmatMaterialColorPickerComponent {
|
|
|
153
153
|
this.view = 'hues';
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
157
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
156
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatMaterialColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
157
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CmatMaterialColorPickerComponent, isStandalone: true, selector: "cmat-material-color-picker", inputs: { color: "color", title: "title", readonly: "readonly" }, outputs: { colorChanged: "colorChanged" }, providers: [CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR], exportAs: ["cmatMaterialColorPicker"], ngImport: i0, template: "<div class=\"rounded\" [ngClass]=\"selectedColor.color\">\r\n <mat-select value=\"init\" panelClass=\"min-w-64 overflow-hidden\" [disableOptionCentering]=\"true\" [hideSingleSelectionIndicator]=\"true\"\r\n [disabled]=\"readonly\" (openedChange)=\"onMenuOpen($event)\">\r\n <mat-select-trigger class=\"flex p-1\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:paint-brush'\"></mat-icon>\r\n </mat-select-trigger>\r\n\r\n <header class=\"border-b-2 flex flex-row content-between justify-between p-2\">\r\n <button type=\"button\" matIconButton class=\"secondary-text\" aria-label=\"\u8C03\u8272\u677F\"\r\n [class.invisible]=\"view === 'palettes'\" (click)=\"goToPalettesView()\">\r\n <mat-icon svgIcon=\"mat_outline:arrow_back\"></mat-icon>\r\n </button>\r\n <span class=\"align-middle leading-loose text-xl font-bold\">{{title}}</span>\r\n <button type=\"button\" matIconButton class=\"remove-color-button secondary-text\" aria-label=\"\u79FB\u9664\u989C\u8272\"\r\n matTooltip=\"\u79FB\u9664\u989C\u8272\" (click)=\"removeColor()\">\r\n <mat-icon color=\"warn\" [svgIcon]=\"'mat_outline:cleaning_services'\"></mat-icon>\r\n </button>\r\n </header>\r\n\r\n <div class=\"flex flex-wrap w-60 m-2\">\r\n <mat-option value=\"init\" class=\"hidden\">\u521D\u59CB\u5316</mat-option>\r\n <div>\r\n @switch (view) {\r\n @case ('palettes') {\r\n <div>\r\n <div class=\"flex flex-row flex-wrap justify-start content-start colors\">\r\n @for (palette of palettes; track $index) {\r\n <div role=\"presentation\" class=\"cursor-pointer hover:opacity-50\" (click)=\"selectPalette(palette)\">\r\n <mat-option class=\"relative flex w-12 h-12 p-0 pointer-events-none rounded-full bg-transparent \"\r\n [value]=\"selectedPalette\">\r\n @if (selectedColor.color===palette + '-' + selectedHue) {\r\n <mat-icon class=\"absolute m-3 text-white\" [svgIcon]=\"'heroicons_outline:check'\"></mat-icon>\r\n }\r\n <span class=\"flex w-10 h-10 m-1 rounded-full\" [ngClass]=\"palette + '-' + selectedHue\"></span>\r\n </mat-option>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n @case ('hues') {\r\n <div>\r\n <div class=\"flex flex-row flex-wrap justify-start content-start colors\">\r\n @for (hue of hues; track $index) {\r\n <div role=\"presentation\" class=\"cursor-pointer hover:opacity-50\" (click)=\"selectHue(hue)\">\r\n <mat-option class=\"relative flex w-12 h-12 p-0 pointer-events-none rounded-full bg-transparent \"\r\n [value]=\"selectedHue\">\r\n @if (selectedColor.color===selectedPalette + '-' + hue) {\r\n <mat-icon class=\"absolute m-3 text-white\" [svgIcon]=\"'heroicons_outline:check'\"></mat-icon>\r\n }\r\n <span class=\"flex w-10 h-10 m-1 rounded-full\" [ngClass]=\"selectedPalette + '-' + hue\"></span>\r\n </mat-option>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </mat-select>\r\n</div>", styles: ["cmat-material-color-picker .mat-mdc-select-arrow-wrapper{display:none!important}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
158
158
|
}
|
|
159
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CmatMaterialColorPickerComponent, decorators: [{
|
|
160
160
|
type: Component,
|
|
161
161
|
args: [{ selector: 'cmat-material-color-picker', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatMaterialColorPicker', providers: [CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR], imports: [NgClass, MatSelectModule, MatIconModule, MatButtonModule, MatTooltipModule], template: "<div class=\"rounded\" [ngClass]=\"selectedColor.color\">\r\n <mat-select value=\"init\" panelClass=\"min-w-64 overflow-hidden\" [disableOptionCentering]=\"true\" [hideSingleSelectionIndicator]=\"true\"\r\n [disabled]=\"readonly\" (openedChange)=\"onMenuOpen($event)\">\r\n <mat-select-trigger class=\"flex p-1\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:paint-brush'\"></mat-icon>\r\n </mat-select-trigger>\r\n\r\n <header class=\"border-b-2 flex flex-row content-between justify-between p-2\">\r\n <button type=\"button\" matIconButton class=\"secondary-text\" aria-label=\"\u8C03\u8272\u677F\"\r\n [class.invisible]=\"view === 'palettes'\" (click)=\"goToPalettesView()\">\r\n <mat-icon svgIcon=\"mat_outline:arrow_back\"></mat-icon>\r\n </button>\r\n <span class=\"align-middle leading-loose text-xl font-bold\">{{title}}</span>\r\n <button type=\"button\" matIconButton class=\"remove-color-button secondary-text\" aria-label=\"\u79FB\u9664\u989C\u8272\"\r\n matTooltip=\"\u79FB\u9664\u989C\u8272\" (click)=\"removeColor()\">\r\n <mat-icon color=\"warn\" [svgIcon]=\"'mat_outline:cleaning_services'\"></mat-icon>\r\n </button>\r\n </header>\r\n\r\n <div class=\"flex flex-wrap w-60 m-2\">\r\n <mat-option value=\"init\" class=\"hidden\">\u521D\u59CB\u5316</mat-option>\r\n <div>\r\n @switch (view) {\r\n @case ('palettes') {\r\n <div>\r\n <div class=\"flex flex-row flex-wrap justify-start content-start colors\">\r\n @for (palette of palettes; track $index) {\r\n <div role=\"presentation\" class=\"cursor-pointer hover:opacity-50\" (click)=\"selectPalette(palette)\">\r\n <mat-option class=\"relative flex w-12 h-12 p-0 pointer-events-none rounded-full bg-transparent \"\r\n [value]=\"selectedPalette\">\r\n @if (selectedColor.color===palette + '-' + selectedHue) {\r\n <mat-icon class=\"absolute m-3 text-white\" [svgIcon]=\"'heroicons_outline:check'\"></mat-icon>\r\n }\r\n <span class=\"flex w-10 h-10 m-1 rounded-full\" [ngClass]=\"palette + '-' + selectedHue\"></span>\r\n </mat-option>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n @case ('hues') {\r\n <div>\r\n <div class=\"flex flex-row flex-wrap justify-start content-start colors\">\r\n @for (hue of hues; track $index) {\r\n <div role=\"presentation\" class=\"cursor-pointer hover:opacity-50\" (click)=\"selectHue(hue)\">\r\n <mat-option class=\"relative flex w-12 h-12 p-0 pointer-events-none rounded-full bg-transparent \"\r\n [value]=\"selectedHue\">\r\n @if (selectedColor.color===selectedPalette + '-' + hue) {\r\n <mat-icon class=\"absolute m-3 text-white\" [svgIcon]=\"'heroicons_outline:check'\"></mat-icon>\r\n }\r\n <span class=\"flex w-10 h-10 m-1 rounded-full\" [ngClass]=\"selectedPalette + '-' + hue\"></span>\r\n </mat-option>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </mat-select>\r\n</div>", styles: ["cmat-material-color-picker .mat-mdc-select-arrow-wrapper{display:none!important}\n"] }]
|
|
162
162
|
}], ctorParameters: () => [], propDecorators: { colorChanged: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-material-color-picker.mjs","sources":["../../../projects/cmat/components/material-color-picker/base-color.ts","../../../projects/cmat/components/material-color-picker/material-color-picker.component.ts","../../../projects/cmat/components/material-color-picker/material-color-picker.component.html","../../../projects/cmat/components/material-color-picker/selected-color.ts","../../../projects/cmat/components/material-color-picker/cmat-components-material-color-picker.ts"],"sourcesContent":["export const baseColors = [\r\n 'bg-slate',\r\n 'bg-red',\r\n 'bg-amber',\r\n 'bg-orange',\r\n 'bg-emerald',\r\n 'bg-teal',\r\n 'bg-blue',\r\n 'bg-indigo',\r\n 'bg-violet',\r\n 'bg-pink'\r\n];\r\n\r\n\r\nexport const safteListBaseColors = [\r\n 'bg-slate-50', 'bg-slate-100', 'bg-slate-200', 'bg-slate-300', 'bg-slate-400', 'bg-slate-500', 'bg-slate-600', 'bg-slate-700', 'bg-slate-800', 'bg-slate-900',\r\n 'bg-red-50', 'bg-red-100', 'bg-red-200', 'bg-red-300', 'bg-red-400', 'bg-red-500', 'bg-red-600', 'bg-red-700', 'bg-red-800', 'bg-red-900',\r\n 'bg-amber-50', 'bg-amber-100', 'bg-amber-200', 'bg-amber-300', 'bg-amber-400', 'bg-amber-500', 'bg-amber-600', 'bg-amber-700', 'bg-amber-800', 'bg-amber-900',\r\n 'bg-orange-50', 'bg-orange-100', 'bg-orange-200', 'bg-orange-300', 'bg-orange-400', 'bg-orange-500', 'bg-orange-600', 'bg-orange-700', 'bg-orange-800', 'bg-orange-900',\r\n 'bg-emerald-50', 'bg-emerald-100', 'bg-emerald-200', 'bg-emerald-300', 'bg-emerald-400', 'bg-emerald-500', 'bg-emerald-600', 'bg-emerald-700', 'bg-emerald-800', 'bg-emerald-900',\r\n 'bg-teal-50', 'bg-teal-100', 'bg-teal-200', 'bg-teal-300', 'bg-teal-400', 'bg-teal-500', 'bg-teal-600', 'bg-teal-700', 'bg-teal-800', 'bg-teal-900',\r\n 'bg-blue-50', 'bg-blue-100', 'bg-blue-200', 'bg-blue-300', 'bg-blue-400', 'bg-blue-500', 'bg-blue-600', 'bg-blue-700', 'bg-blue-800', 'bg-blue-900',\r\n 'bg-indigo-50', 'bg-indigo-100', 'bg-indigo-200', 'bg-indigo-300', 'bg-indigo-400', 'bg-indigo-500', 'bg-indigo-600', 'bg-indigo-700', 'bg-indigo-800', 'bg-indigo-900',\r\n 'bg-violet-50', 'bg-violet-100', 'bg-violet-200', 'bg-violet-300', 'bg-violet-400', 'bg-violet-500', 'bg-violet-600', 'bg-violet-700', 'bg-violet-800', 'bg-violet-900',\r\n 'bg-pink-50', 'bg-pink-100', 'bg-pink-200', 'bg-pink-300', 'bg-pink-400', 'bg-pink-500', 'bg-pink-600', 'bg-pink-700', 'bg-pink-800', 'bg-pink-900'\r\n];\r\n","import { NgClass } from '@angular/common';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, forwardRef, Input, Output, ViewEncapsulation, inject } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { baseColors } from './base-color';\r\nimport { CmatSelectedColor } from './selected-color';\r\n\r\nexport const CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR: any = {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => CmatMaterialColorPickerComponent),\r\n multi: true\r\n};\r\n\r\n\r\n@Component({\r\n selector: 'cmat-material-color-picker',\r\n templateUrl: './material-color-picker.component.html',\r\n styleUrls: ['./material-color-picker.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatMaterialColorPicker',\r\n providers: [CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR],\r\n imports: [NgClass, MatSelectModule, MatIconModule, MatButtonModule, MatTooltipModule]\r\n})\r\nexport class CmatMaterialColorPickerComponent implements ControlValueAccessor {\r\n // Color changed\r\n @Output()\r\n colorChanged: EventEmitter<any>;\r\n\r\n palettes: string[];\r\n hues: string[];\r\n view: string;\r\n selectedColor: CmatSelectedColor;\r\n selectedPalette: string;\r\n selectedHue: string;\r\n\r\n // Private\r\n private _changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n private _color: string;\r\n private _title: string;\r\n private _readonly: boolean;\r\n private _modelChange: (value: any) => void;\r\n private _modelTouched: (value: any) => void;\r\n\r\n constructor() {\r\n // Set the defaults\r\n this.colorChanged = new EventEmitter();\r\n this.palettes = baseColors;\r\n this.hues = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'];\r\n this.selectedHue = '500';\r\n this.selectedPalette = 'bg-indigo';\r\n this.view = 'palettes';\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this._modelChange = (): any => { };\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this._modelTouched = (): any => { };\r\n\r\n this.updateSelectedColor();\r\n }\r\n\r\n get color(): string {\r\n return this._color;\r\n }\r\n\r\n @Input()\r\n set color(value) {\r\n if (!value || value === '' || this._color === value) {\r\n return;\r\n }\r\n\r\n // Split the color value (bg-red-400, bg-blue-500 etc.)\r\n const colorParts = value.split('-');\r\n\r\n // Take the very last part as the selected hue value\r\n this.selectedHue = colorParts[colorParts.length - 1];\r\n\r\n // Remove the last part\r\n colorParts.pop();\r\n\r\n // Rejoin the remaining parts as the selected palette name\r\n this.selectedPalette = colorParts.join('-');\r\n\r\n // Update the selected color\r\n this.updateSelectedColor();\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get title(): string {\r\n return this._title;\r\n }\r\n\r\n @Input()\r\n set title(value) {\r\n this._title = value;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\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\r\n registerOnChange(fn: any): void {\r\n this._modelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any): void {\r\n this._modelTouched = fn;\r\n }\r\n\r\n writeValue(color: any): void {\r\n // Return if null\r\n if (!color) {\r\n return;\r\n }\r\n\r\n // Set the color\r\n this.color = color;\r\n }\r\n\r\n selectPalette(palette: string): void {\r\n // Go to 'hues' view\r\n this.view = 'hues';\r\n\r\n // Update the selected palette\r\n this.selectedPalette = palette;\r\n\r\n // Update the selected color\r\n this.updateSelectedColor();\r\n }\r\n\r\n selectHue(hue: string): void {\r\n // Update the selected hue\r\n this.selectedHue = hue;\r\n\r\n // Update the selected color\r\n this.updateSelectedColor();\r\n }\r\n\r\n removeColor(): void {\r\n // Return to the 'palettes' view\r\n this.view = 'palettes';\r\n\r\n // Clear the selected palette and hue\r\n this.selectedPalette = 'bg-indigo';\r\n this.selectedHue = '500';\r\n\r\n // Update the selected color\r\n this.updateSelectedColor();\r\n }\r\n\r\n updateSelectedColor(): void {\r\n if (this.selectedColor && this.selectedColor.palette === this.selectedPalette && this.selectedColor.hue === this.selectedHue) {\r\n return;\r\n }\r\n\r\n // Set the selected color object\r\n this.selectedColor = {\r\n palette: this.selectedPalette,\r\n hue: this.selectedHue,\r\n color: this.selectedPalette + '-' + this.selectedHue\r\n };\r\n\r\n this._color = this.selectedColor.color;\r\n\r\n this.colorChanged.emit(this.selectedColor);\r\n\r\n // Mark the model as touched\r\n this._modelTouched(this.selectedColor.color);\r\n\r\n // Update the model\r\n this._modelChange(this.selectedColor.color);\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n\r\n goToPalettesView(): void {\r\n this.view = 'palettes';\r\n }\r\n\r\n onMenuOpen(opened: boolean): void {\r\n if (opened) {\r\n this.view = 'hues';\r\n }\r\n }\r\n}\r\n","<div class=\"rounded\" [ngClass]=\"selectedColor.color\">\r\n <mat-select value=\"init\" panelClass=\"min-w-64 overflow-hidden\" [disableOptionCentering]=\"true\" [hideSingleSelectionIndicator]=\"true\"\r\n [disabled]=\"readonly\" (openedChange)=\"onMenuOpen($event)\">\r\n <mat-select-trigger class=\"flex p-1\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:paint-brush'\"></mat-icon>\r\n </mat-select-trigger>\r\n\r\n <header class=\"border-b-2 flex flex-row content-between justify-between p-2\">\r\n <button type=\"button\" matIconButton class=\"secondary-text\" aria-label=\"调色板\"\r\n [class.invisible]=\"view === 'palettes'\" (click)=\"goToPalettesView()\">\r\n <mat-icon svgIcon=\"mat_outline:arrow_back\"></mat-icon>\r\n </button>\r\n <span class=\"align-middle leading-loose text-xl font-bold\">{{title}}</span>\r\n <button type=\"button\" matIconButton class=\"remove-color-button secondary-text\" aria-label=\"移除颜色\"\r\n matTooltip=\"移除颜色\" (click)=\"removeColor()\">\r\n <mat-icon color=\"warn\" [svgIcon]=\"'mat_outline:cleaning_services'\"></mat-icon>\r\n </button>\r\n </header>\r\n\r\n <div class=\"flex flex-wrap w-60 m-2\">\r\n <mat-option value=\"init\" class=\"hidden\">初始化</mat-option>\r\n <div>\r\n @switch (view) {\r\n @case ('palettes') {\r\n <div>\r\n <div class=\"flex flex-row flex-wrap justify-start content-start colors\">\r\n @for (palette of palettes; track $index) {\r\n <div role=\"presentation\" class=\"cursor-pointer hover:opacity-50\" (click)=\"selectPalette(palette)\">\r\n <mat-option class=\"relative flex w-12 h-12 p-0 pointer-events-none rounded-full bg-transparent \"\r\n [value]=\"selectedPalette\">\r\n @if (selectedColor.color===palette + '-' + selectedHue) {\r\n <mat-icon class=\"absolute m-3 text-white\" [svgIcon]=\"'heroicons_outline:check'\"></mat-icon>\r\n }\r\n <span class=\"flex w-10 h-10 m-1 rounded-full\" [ngClass]=\"palette + '-' + selectedHue\"></span>\r\n </mat-option>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n @case ('hues') {\r\n <div>\r\n <div class=\"flex flex-row flex-wrap justify-start content-start colors\">\r\n @for (hue of hues; track $index) {\r\n <div role=\"presentation\" class=\"cursor-pointer hover:opacity-50\" (click)=\"selectHue(hue)\">\r\n <mat-option class=\"relative flex w-12 h-12 p-0 pointer-events-none rounded-full bg-transparent \"\r\n [value]=\"selectedHue\">\r\n @if (selectedColor.color===selectedPalette + '-' + hue) {\r\n <mat-icon class=\"absolute m-3 text-white\" [svgIcon]=\"'heroicons_outline:check'\"></mat-icon>\r\n }\r\n <span class=\"flex w-10 h-10 m-1 rounded-full\" [ngClass]=\"selectedPalette + '-' + hue\"></span>\r\n </mat-option>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </mat-select>\r\n</div>","export class CmatSelectedColor {\r\n palette: string;\r\n hue: string;\r\n color: string;\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAO,MAAM,UAAU,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,UAAU;IACV,WAAW;IACX,YAAY;IACZ,SAAS;IACT,SAAS;IACT,WAAW;IACX,WAAW;IACX;CACH;AAGM,MAAM,mBAAmB,GAAG;AAC/B,IAAA,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc;AAC7J,IAAA,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,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UAAA,EAAA,IAAA,EAAE,eAAe,qNAAE,gBAAgB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,4BAAA,EAAA,oBAAA,EAAA,qBAAA,EAAA,qBAAA,EAAA,yBAAA,EAAA,YAAA,EAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAE3E,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAV5C,SAAS;+BACI,4BAA4B,EAAA,aAAA,EAGvB,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,yBAAyB,EAAA,SAAA,EACxB,CAAC,yCAAyC,CAAC,EAAA,OAAA,EAC7C,CAAC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,ivGAAA,EAAA,MAAA,EAAA,CAAA,oFAAA,CAAA,EAAA;;sBAIpF;;sBAwCA;;sBA2BA;;sBAUA;;;ME1GQ,iBAAiB,CAAA;AAI7B;;ACJD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cmat-components-material-color-picker.mjs","sources":["../../../projects/cmat/components/material-color-picker/base-color.ts","../../../projects/cmat/components/material-color-picker/material-color-picker.component.ts","../../../projects/cmat/components/material-color-picker/material-color-picker.component.html","../../../projects/cmat/components/material-color-picker/selected-color.ts","../../../projects/cmat/components/material-color-picker/cmat-components-material-color-picker.ts"],"sourcesContent":["export const baseColors = [\r\n 'bg-slate',\r\n 'bg-red',\r\n 'bg-amber',\r\n 'bg-orange',\r\n 'bg-emerald',\r\n 'bg-teal',\r\n 'bg-blue',\r\n 'bg-indigo',\r\n 'bg-violet',\r\n 'bg-pink'\r\n];\r\n\r\n\r\nexport const safteListBaseColors = [\r\n 'bg-slate-50', 'bg-slate-100', 'bg-slate-200', 'bg-slate-300', 'bg-slate-400', 'bg-slate-500', 'bg-slate-600', 'bg-slate-700', 'bg-slate-800', 'bg-slate-900',\r\n 'bg-red-50', 'bg-red-100', 'bg-red-200', 'bg-red-300', 'bg-red-400', 'bg-red-500', 'bg-red-600', 'bg-red-700', 'bg-red-800', 'bg-red-900',\r\n 'bg-amber-50', 'bg-amber-100', 'bg-amber-200', 'bg-amber-300', 'bg-amber-400', 'bg-amber-500', 'bg-amber-600', 'bg-amber-700', 'bg-amber-800', 'bg-amber-900',\r\n 'bg-orange-50', 'bg-orange-100', 'bg-orange-200', 'bg-orange-300', 'bg-orange-400', 'bg-orange-500', 'bg-orange-600', 'bg-orange-700', 'bg-orange-800', 'bg-orange-900',\r\n 'bg-emerald-50', 'bg-emerald-100', 'bg-emerald-200', 'bg-emerald-300', 'bg-emerald-400', 'bg-emerald-500', 'bg-emerald-600', 'bg-emerald-700', 'bg-emerald-800', 'bg-emerald-900',\r\n 'bg-teal-50', 'bg-teal-100', 'bg-teal-200', 'bg-teal-300', 'bg-teal-400', 'bg-teal-500', 'bg-teal-600', 'bg-teal-700', 'bg-teal-800', 'bg-teal-900',\r\n 'bg-blue-50', 'bg-blue-100', 'bg-blue-200', 'bg-blue-300', 'bg-blue-400', 'bg-blue-500', 'bg-blue-600', 'bg-blue-700', 'bg-blue-800', 'bg-blue-900',\r\n 'bg-indigo-50', 'bg-indigo-100', 'bg-indigo-200', 'bg-indigo-300', 'bg-indigo-400', 'bg-indigo-500', 'bg-indigo-600', 'bg-indigo-700', 'bg-indigo-800', 'bg-indigo-900',\r\n 'bg-violet-50', 'bg-violet-100', 'bg-violet-200', 'bg-violet-300', 'bg-violet-400', 'bg-violet-500', 'bg-violet-600', 'bg-violet-700', 'bg-violet-800', 'bg-violet-900',\r\n 'bg-pink-50', 'bg-pink-100', 'bg-pink-200', 'bg-pink-300', 'bg-pink-400', 'bg-pink-500', 'bg-pink-600', 'bg-pink-700', 'bg-pink-800', 'bg-pink-900'\r\n];\r\n","import { NgClass } from '@angular/common';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, forwardRef, Input, Output, ViewEncapsulation, inject } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { baseColors } from './base-color';\r\nimport { CmatSelectedColor } from './selected-color';\r\n\r\nexport const CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR: any = {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => CmatMaterialColorPickerComponent),\r\n multi: true\r\n};\r\n\r\n\r\n@Component({\r\n selector: 'cmat-material-color-picker',\r\n templateUrl: './material-color-picker.component.html',\r\n styleUrls: ['./material-color-picker.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatMaterialColorPicker',\r\n providers: [CMAT_MATERIAL_COLOR_PICKER_VALUE_ACCESSOR],\r\n imports: [NgClass, MatSelectModule, MatIconModule, MatButtonModule, MatTooltipModule]\r\n})\r\nexport class CmatMaterialColorPickerComponent implements ControlValueAccessor {\r\n // Color changed\r\n @Output()\r\n colorChanged: EventEmitter<any>;\r\n\r\n palettes: string[];\r\n hues: string[];\r\n view: string;\r\n selectedColor: CmatSelectedColor;\r\n selectedPalette: string;\r\n selectedHue: string;\r\n\r\n // Private\r\n private _changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n private _color: string;\r\n private _title: string;\r\n private _readonly: boolean;\r\n private _modelChange: (value: any) => void;\r\n private _modelTouched: (value: any) => void;\r\n\r\n constructor() {\r\n // Set the defaults\r\n this.colorChanged = new EventEmitter();\r\n this.palettes = baseColors;\r\n this.hues = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'];\r\n this.selectedHue = '500';\r\n this.selectedPalette = 'bg-indigo';\r\n this.view = 'palettes';\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this._modelChange = (): any => { };\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n this._modelTouched = (): any => { };\r\n\r\n this.updateSelectedColor();\r\n }\r\n\r\n get color(): string {\r\n return this._color;\r\n }\r\n\r\n @Input()\r\n set color(value) {\r\n if (!value || value === '' || this._color === value) {\r\n return;\r\n }\r\n\r\n // Split the color value (bg-red-400, bg-blue-500 etc.)\r\n const colorParts = value.split('-');\r\n\r\n // Take the very last part as the selected hue value\r\n this.selectedHue = colorParts[colorParts.length - 1];\r\n\r\n // Remove the last part\r\n colorParts.pop();\r\n\r\n // Rejoin the remaining parts as the selected palette name\r\n this.selectedPalette = colorParts.join('-');\r\n\r\n // Update the selected color\r\n this.updateSelectedColor();\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get title(): string {\r\n return this._title;\r\n }\r\n\r\n @Input()\r\n set title(value) {\r\n this._title = value;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\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\r\n registerOnChange(fn: any): void {\r\n this._modelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any): void {\r\n this._modelTouched = fn;\r\n }\r\n\r\n writeValue(color: any): void {\r\n // Return if null\r\n if (!color) {\r\n return;\r\n }\r\n\r\n // Set the color\r\n this.color = color;\r\n }\r\n\r\n selectPalette(palette: string): void {\r\n // Go to 'hues' view\r\n this.view = 'hues';\r\n\r\n // Update the selected palette\r\n this.selectedPalette = palette;\r\n\r\n // Update the selected color\r\n this.updateSelectedColor();\r\n }\r\n\r\n selectHue(hue: string): void {\r\n // Update the selected hue\r\n this.selectedHue = hue;\r\n\r\n // Update the selected color\r\n this.updateSelectedColor();\r\n }\r\n\r\n removeColor(): void {\r\n // Return to the 'palettes' view\r\n this.view = 'palettes';\r\n\r\n // Clear the selected palette and hue\r\n this.selectedPalette = 'bg-indigo';\r\n this.selectedHue = '500';\r\n\r\n // Update the selected color\r\n this.updateSelectedColor();\r\n }\r\n\r\n updateSelectedColor(): void {\r\n if (this.selectedColor?.palette === this.selectedPalette && this.selectedColor?.hue === this.selectedHue) {\r\n return;\r\n }\r\n\r\n // Set the selected color object\r\n this.selectedColor = {\r\n palette: this.selectedPalette,\r\n hue: this.selectedHue,\r\n color: this.selectedPalette + '-' + this.selectedHue\r\n };\r\n\r\n this._color = this.selectedColor.color;\r\n\r\n this.colorChanged.emit(this.selectedColor);\r\n\r\n // Mark the model as touched\r\n this._modelTouched(this.selectedColor.color);\r\n\r\n // Update the model\r\n this._modelChange(this.selectedColor.color);\r\n\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n\r\n goToPalettesView(): void {\r\n this.view = 'palettes';\r\n }\r\n\r\n onMenuOpen(opened: boolean): void {\r\n if (opened) {\r\n this.view = 'hues';\r\n }\r\n }\r\n}\r\n","<div class=\"rounded\" [ngClass]=\"selectedColor.color\">\r\n <mat-select value=\"init\" panelClass=\"min-w-64 overflow-hidden\" [disableOptionCentering]=\"true\" [hideSingleSelectionIndicator]=\"true\"\r\n [disabled]=\"readonly\" (openedChange)=\"onMenuOpen($event)\">\r\n <mat-select-trigger class=\"flex p-1\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:paint-brush'\"></mat-icon>\r\n </mat-select-trigger>\r\n\r\n <header class=\"border-b-2 flex flex-row content-between justify-between p-2\">\r\n <button type=\"button\" matIconButton class=\"secondary-text\" aria-label=\"调色板\"\r\n [class.invisible]=\"view === 'palettes'\" (click)=\"goToPalettesView()\">\r\n <mat-icon svgIcon=\"mat_outline:arrow_back\"></mat-icon>\r\n </button>\r\n <span class=\"align-middle leading-loose text-xl font-bold\">{{title}}</span>\r\n <button type=\"button\" matIconButton class=\"remove-color-button secondary-text\" aria-label=\"移除颜色\"\r\n matTooltip=\"移除颜色\" (click)=\"removeColor()\">\r\n <mat-icon color=\"warn\" [svgIcon]=\"'mat_outline:cleaning_services'\"></mat-icon>\r\n </button>\r\n </header>\r\n\r\n <div class=\"flex flex-wrap w-60 m-2\">\r\n <mat-option value=\"init\" class=\"hidden\">初始化</mat-option>\r\n <div>\r\n @switch (view) {\r\n @case ('palettes') {\r\n <div>\r\n <div class=\"flex flex-row flex-wrap justify-start content-start colors\">\r\n @for (palette of palettes; track $index) {\r\n <div role=\"presentation\" class=\"cursor-pointer hover:opacity-50\" (click)=\"selectPalette(palette)\">\r\n <mat-option class=\"relative flex w-12 h-12 p-0 pointer-events-none rounded-full bg-transparent \"\r\n [value]=\"selectedPalette\">\r\n @if (selectedColor.color===palette + '-' + selectedHue) {\r\n <mat-icon class=\"absolute m-3 text-white\" [svgIcon]=\"'heroicons_outline:check'\"></mat-icon>\r\n }\r\n <span class=\"flex w-10 h-10 m-1 rounded-full\" [ngClass]=\"palette + '-' + selectedHue\"></span>\r\n </mat-option>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n @case ('hues') {\r\n <div>\r\n <div class=\"flex flex-row flex-wrap justify-start content-start colors\">\r\n @for (hue of hues; track $index) {\r\n <div role=\"presentation\" class=\"cursor-pointer hover:opacity-50\" (click)=\"selectHue(hue)\">\r\n <mat-option class=\"relative flex w-12 h-12 p-0 pointer-events-none rounded-full bg-transparent \"\r\n [value]=\"selectedHue\">\r\n @if (selectedColor.color===selectedPalette + '-' + hue) {\r\n <mat-icon class=\"absolute m-3 text-white\" [svgIcon]=\"'heroicons_outline:check'\"></mat-icon>\r\n }\r\n <span class=\"flex w-10 h-10 m-1 rounded-full\" [ngClass]=\"selectedPalette + '-' + hue\"></span>\r\n </mat-option>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </mat-select>\r\n</div>","export class CmatSelectedColor {\r\n palette: string;\r\n hue: string;\r\n color: string;\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAO,MAAM,UAAU,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,UAAU;IACV,WAAW;IACX,YAAY;IACZ,SAAS;IACT,SAAS;IACT,WAAW;IACX,WAAW;IACX;CACH;AAGM,MAAM,mBAAmB,GAAG;AAC/B,IAAA,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc;AAC7J,IAAA,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY;AACzI,IAAA,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc;AAC7J,IAAA,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe;AACvK,IAAA,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB;AACjL,IAAA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa;AACnJ,IAAA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAA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