cmat 0.0.87 → 0.0.88
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-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +98 -80
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +26 -34
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +467 -556
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +270 -259
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +200 -116
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +85 -38
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-color-picker.mjs +841 -0
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-custom-formly.mjs +1395 -838
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +996 -0
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-date-range.mjs +310 -264
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +16 -20
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +120 -137
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +17 -24
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +18 -24
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +30 -39
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +12 -12
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +10 -10
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +48 -41
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +104 -107
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +12 -15
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +118 -75
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +196 -178
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +26 -41
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +81 -80
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +1212 -1287
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +467 -450
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +143 -132
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +68 -83
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +18 -24
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +220 -136
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +262 -215
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +227 -195
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +15 -34
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +95 -88
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +70 -67
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +23 -26
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +190 -159
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +276 -213
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +178 -128
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +44 -28
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +107 -163
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +29 -36
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +14 -18
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +111 -118
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +65 -66
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +130 -160
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +32 -39
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +186 -176
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +25 -28
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +85 -92
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +49 -50
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +16 -19
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +60 -69
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +31 -30
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +7 -13
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +26 -27
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +14 -23
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +8 -8
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +6 -10
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +30 -47
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
- package/fesm2022/cmat-services-media-watcher.mjs +43 -34
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +11 -11
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat.mjs +9228 -7507
- package/fesm2022/cmat.mjs.map +1 -1
- package/icons/material-icons/heroicons-outline.svg +3 -0
- package/icons/material-icons/heroicons-solid.svg +3 -0
- package/package.json +10 -1
- package/styles/components/bundle.scss +21 -0
- package/styles/overrides/angular-material.scss +22 -1
- package/tailwind/plugins/theming.js +183 -183
- package/types/cmat-components-breadcrumb.d.ts +40 -37
- package/types/cmat-components-card.d.ts +11 -13
- package/types/cmat-components-carousel.d.ts +87 -113
- package/types/cmat-components-cascade.d.ts +84 -65
- package/types/cmat-components-chip-input.d.ts +29 -24
- package/types/cmat-components-code-editor.d.ts +28 -12
- package/types/cmat-components-color-picker.d.ts +236 -0
- package/types/cmat-components-custom-formly.d.ts +316 -184
- package/types/cmat-components-data-picker.d.ts +372 -0
- package/types/cmat-components-date-range.d.ts +31 -36
- package/types/cmat-components-date-time-display.d.ts +8 -8
- package/types/cmat-components-drawer.d.ts +30 -32
- package/types/cmat-components-empty-state.d.ts +9 -10
- package/types/cmat-components-file-preview.d.ts +9 -9
- package/types/cmat-components-filter-toolbar.d.ts +15 -15
- package/types/cmat-components-form-actions.d.ts +5 -5
- package/types/cmat-components-fullscreen.d.ts +5 -5
- package/types/cmat-components-highlight.d.ts +13 -14
- package/types/cmat-components-image-viewer.d.ts +29 -33
- package/types/cmat-components-inline-loading.d.ts +6 -6
- package/types/cmat-components-json-editor.d.ts +15 -17
- package/types/cmat-components-knob-input.d.ts +58 -55
- package/types/cmat-components-masonry.d.ts +9 -12
- package/types/cmat-components-material-color-picker.d.ts +16 -21
- package/types/cmat-components-material-datetimepicker.d.ts +174 -216
- package/types/cmat-components-navigation.d.ts +34 -39
- package/types/cmat-components-opt-input.d.ts +35 -33
- package/types/cmat-components-org-chart.d.ts +8 -9
- package/types/cmat-components-page-header.d.ts +9 -9
- package/types/cmat-components-pagination.d.ts +36 -40
- package/types/cmat-components-password-strength.d.ts +58 -64
- package/types/cmat-components-popover.d.ts +22 -32
- package/types/cmat-components-progress-bar.d.ts +7 -10
- package/types/cmat-components-qrcode.d.ts +22 -22
- package/types/cmat-components-rating.d.ts +17 -19
- package/types/cmat-components-rich-text-editor.d.ts +11 -12
- package/types/cmat-components-select-search.d.ts +48 -36
- package/types/cmat-components-select-table.d.ts +38 -34
- package/types/cmat-components-select-tree.d.ts +17 -15
- package/types/cmat-components-skeleton.d.ts +27 -10
- package/types/cmat-components-speed-dial.d.ts +24 -33
- package/types/cmat-components-status-tag.d.ts +19 -9
- package/types/cmat-components-table-toolbar.d.ts +7 -7
- package/types/cmat-components-timeline.d.ts +33 -34
- package/types/cmat-components-toast.d.ts +26 -30
- package/types/cmat-components-transfer-picker.d.ts +51 -56
- package/types/cmat-components-treetable.d.ts +12 -13
- package/types/cmat-components-upload.d.ts +33 -38
- package/types/cmat-components-x6-angular-shape.d.ts +1 -1
- package/types/cmat-directives-animate-on-scroll.d.ts +7 -7
- package/types/cmat-directives-arrow-cursor.d.ts +18 -20
- package/types/cmat-directives-data-exporter.d.ts +10 -10
- package/types/cmat-directives-debounce.d.ts +5 -5
- package/types/cmat-directives-digit-only.d.ts +13 -13
- package/types/cmat-directives-seamless-auto-scroll.d.ts +7 -7
- package/types/cmat-pipes-secure.d.ts +1 -3
- package/types/cmat-services-alert.d.ts +11 -12
- package/types/cmat-services-config.d.ts +2 -7
- package/types/cmat-services-confirmation.d.ts +2 -2
- package/types/cmat-services-data.d.ts +0 -1
- package/types/cmat-services-loading.d.ts +14 -22
- package/types/cmat-services-media-watcher.d.ts +5 -5
- package/types/cmat-services-translation.d.ts +4 -5
- package/types/cmat.d.ts +2167 -1746
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, output, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, HostBinding, forwardRef } from '@angular/core';
|
|
3
3
|
import { NgClass } from '@angular/common';
|
|
4
4
|
import * as i2 from '@angular/material/button';
|
|
5
5
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -8,111 +8,96 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
8
8
|
|
|
9
9
|
class CmatChartNodeComponent {
|
|
10
10
|
constructor() {
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
this.node = input.required(/* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
|
|
13
|
+
this.hasParent = input(/* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [undefined, { debugName: "hasParent" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.enableControlHeight = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "enableControlHeight" }] : /* istanbul ignore next */ []));
|
|
17
|
+
this.direction = input('vertical', /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
19
|
+
this.detailsBtnTitle = input(/* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [undefined, { debugName: "detailsBtnTitle" }] : /* istanbul ignore next */ []));
|
|
21
|
+
this.detailsBtnClick = output();
|
|
22
|
+
this.containerClass = computed(() => `cmat-org-connector-${this.direction()} `, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "containerClass" }] : /* istanbul ignore next */ []));
|
|
24
|
+
this.connectorToParentHeight = computed(() => {
|
|
25
|
+
const heightFactor = this.node().heightFactor;
|
|
26
|
+
if (this.enableControlHeight() && heightFactor !== undefined && heightFactor > 0) {
|
|
27
|
+
const maxHeightEm = 19.2;
|
|
28
|
+
let newHeight = heightFactor * maxHeightEm;
|
|
29
|
+
if (heightFactor >= 2) {
|
|
30
|
+
newHeight -= heightFactor - 1;
|
|
31
|
+
}
|
|
32
|
+
return `${newHeight}em`;
|
|
23
33
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
34
|
+
return '1em';
|
|
35
|
+
}, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "connectorToParentHeight" }] : /* istanbul ignore next */ []));
|
|
28
37
|
}
|
|
29
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
30
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatChartNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatChartNodeComponent, isStandalone: true, selector: "cmat-org-chart-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, hasParent: { classPropertyName: "hasParent", publicName: "hasParent", isSignal: true, isRequired: false, transformFunction: null }, enableControlHeight: { classPropertyName: "enableControlHeight", publicName: "enableControlHeight", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, detailsBtnTitle: { classPropertyName: "detailsBtnTitle", publicName: "detailsBtnTitle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { detailsBtnClick: "detailsBtnClick" }, exportAs: ["cmatOrgChartNode"], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@if(hasParent()){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass()\" [style.height]=\"connectorToParentHeight()\"></div>\r\n}\r\n<div class=\"cmat-org-box cmat-org-border cmat-org-background\" [ngClass]=\"node().cssClass\">\r\n @if(node().image!==''){\r\n <div class=\"cmat-org-image\" [style]=\"{ 'background-image': 'url(\\'' + node().image + '\\')' }\"\r\n [style.border-color]=\"node().color\"></div>\r\n }@else {\r\n <div class=\"text-center\">\r\n <mat-icon class=\"icon-size-16\" [svgIcon]=\"'heroicons_outline:user-circle'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <div class=\"cmat-org-container\">\r\n <div class=\"cmat-org-title\" [innerHTML]=\"node().title\" [style.color]=\"node().color\"></div>\r\n <div class=\"cmat-org-name\" [innerHTML]=\"node().name\"></div>\r\n \r\n @if(node().showDetail){\r\n <div class=\"button-container\">\r\n <button matButton=\"filled\" class=\"cmat-org-btn cmat-org-btn-details\" color=\"primary\"\r\n (click)=\"detailsBtnClick.emit(node())\">\r\n {{ detailsBtnTitle() }}\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>\r\n@if(node().children.length){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass()\"></div>\r\n}", styles: ["cmat-org-chart-node{display:flex;align-items:center}.cmat-org-box{width:16em;height:16em;box-sizing:border-box;overflow:overlay;position:relative}.cmat-org-container{display:flex;flex-direction:column;align-items:center}.cmat-org-title,.cmat-org-name,.button-container{flex:1}.cmat-org-title{margin-top:.5em}.cmat-org-name{margin:.3em 0}.button-container{display:flex;flex-direction:row;justify-content:center;align-items:center;position:absolute;bottom:1em;width:100%}.cmat-org-image{background-repeat:round;width:4em;height:4em;background-color:transparent!important;border-radius:50%;padding:.25em;border:3px solid var(--cmat-text-hint);margin:4px auto auto}.cmat-org-title{font-size:1.1rem;font-weight:700;text-align:center}.cmat-org-name{text-align:center;margin-bottom:8px!important}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
31
40
|
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatChartNodeComponent, decorators: [{
|
|
33
42
|
type: Component,
|
|
34
|
-
args: [{ selector: 'cmat-org-chart-node', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatOrgChartNode', imports: [NgClass, MatIconModule, MatButtonModule], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@if(hasParent){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass\" [style.height]=\"connectorToParentHeight\"></div>\r\n}\r\n<div class=\"cmat-org-box cmat-org-border cmat-org-background\" [ngClass]=\"node.cssClass\">\r\n @if(node.image!==''){\r\n <div class=\"cmat-org-image\" [style]=\"{ 'background-image': 'url(\\'' + node.image + '\\')' }\"\r\n [style.border-color]=\"node.color\"></div>\r\n }@else {\r\n <div class=\"text-center\">\r\n <mat-icon class=\"icon-size-16\" [svgIcon]=\"'heroicons_outline:user-circle'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <div class=\"cmat-org-container\">\r\n <div class=\"cmat-org-title\" [innerHTML]=\"node.title\" [style.color]=\"node.color\"></div>\r\n <div class=\"cmat-org-name\" [innerHTML]=\"node.name\"></div>\r\n \r\n @if(node.showDetail){\r\n <div class=\"button-container\">\r\n <button matButton=\"filled\" class=\"cmat-org-btn cmat-org-btn-details\" color=\"primary\"\r\n (click)=\"detailsBtnClick.emit(node)\">\r\n {{ detailsBtnTitle }}\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>\r\n@if(node.children.length){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass\"></div>\r\n}
|
|
35
|
-
}], propDecorators: { node: [{
|
|
36
|
-
type: Input
|
|
37
|
-
}], hasParent: [{
|
|
38
|
-
type: Input
|
|
39
|
-
}], enableControlHeight: [{
|
|
40
|
-
type: Input
|
|
41
|
-
}], direction: [{
|
|
42
|
-
type: Input
|
|
43
|
-
}], detailsBtnTitle: [{
|
|
44
|
-
type: Input
|
|
45
|
-
}], detailsBtnClick: [{
|
|
46
|
-
type: Output
|
|
47
|
-
}] } });
|
|
43
|
+
args: [{ selector: 'cmat-org-chart-node', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatOrgChartNode', imports: [NgClass, MatIconModule, MatButtonModule], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@if(hasParent()){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass()\" [style.height]=\"connectorToParentHeight()\"></div>\r\n}\r\n<div class=\"cmat-org-box cmat-org-border cmat-org-background\" [ngClass]=\"node().cssClass\">\r\n @if(node().image!==''){\r\n <div class=\"cmat-org-image\" [style]=\"{ 'background-image': 'url(\\'' + node().image + '\\')' }\"\r\n [style.border-color]=\"node().color\"></div>\r\n }@else {\r\n <div class=\"text-center\">\r\n <mat-icon class=\"icon-size-16\" [svgIcon]=\"'heroicons_outline:user-circle'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <div class=\"cmat-org-container\">\r\n <div class=\"cmat-org-title\" [innerHTML]=\"node().title\" [style.color]=\"node().color\"></div>\r\n <div class=\"cmat-org-name\" [innerHTML]=\"node().name\"></div>\r\n \r\n @if(node().showDetail){\r\n <div class=\"button-container\">\r\n <button matButton=\"filled\" class=\"cmat-org-btn cmat-org-btn-details\" color=\"primary\"\r\n (click)=\"detailsBtnClick.emit(node())\">\r\n {{ detailsBtnTitle() }}\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>\r\n@if(node().children.length){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass()\"></div>\r\n}", styles: ["cmat-org-chart-node{display:flex;align-items:center}.cmat-org-box{width:16em;height:16em;box-sizing:border-box;overflow:overlay;position:relative}.cmat-org-container{display:flex;flex-direction:column;align-items:center}.cmat-org-title,.cmat-org-name,.button-container{flex:1}.cmat-org-title{margin-top:.5em}.cmat-org-name{margin:.3em 0}.button-container{display:flex;flex-direction:row;justify-content:center;align-items:center;position:absolute;bottom:1em;width:100%}.cmat-org-image{background-repeat:round;width:4em;height:4em;background-color:transparent!important;border-radius:50%;padding:.25em;border:3px solid var(--cmat-text-hint);margin:4px auto auto}.cmat-org-title{font-size:1.1rem;font-weight:700;text-align:center}.cmat-org-name{text-align:center;margin-bottom:8px!important}\n"] }]
|
|
44
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: true }] }], hasParent: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasParent", required: false }] }], enableControlHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableControlHeight", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], detailsBtnTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailsBtnTitle", required: false }] }], detailsBtnClick: [{ type: i0.Output, args: ["detailsBtnClick"] }] } });
|
|
48
45
|
|
|
49
46
|
class CmatChartDesignerComponent {
|
|
50
47
|
constructor() {
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
this.
|
|
48
|
+
this.node = input.required(/* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
|
|
50
|
+
this.hasParent = input(false, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "hasParent" }] : /* istanbul ignore next */ []));
|
|
52
|
+
this.enableControlHeight = input(/* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [undefined, { debugName: "enableControlHeight" }] : /* istanbul ignore next */ []));
|
|
54
|
+
this.direction = input('vertical', /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
56
|
+
this.detailsBtnTitle = input(/* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [undefined, { debugName: "detailsBtnTitle" }] : /* istanbul ignore next */ []));
|
|
58
|
+
this.detailsBtnClick = output();
|
|
59
|
+
this.chartNodeClass = computed(() => `cmat-org-${this.direction()}`, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "chartNodeClass" }] : /* istanbul ignore next */ []));
|
|
54
61
|
}
|
|
55
|
-
get
|
|
56
|
-
return this.direction === 'vertical' ? 'column' : '';
|
|
62
|
+
get hostFlexDirection() {
|
|
63
|
+
return this.direction() === 'vertical' ? 'column' : '';
|
|
57
64
|
}
|
|
58
|
-
get
|
|
59
|
-
return this.direction === 'vertical' ? 'fit-content' : '';
|
|
65
|
+
get hostWidth() {
|
|
66
|
+
return this.direction() === 'vertical' ? 'fit-content' : '';
|
|
60
67
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.chartNodeClass = `cmat-org-${this.direction}`;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CmatChartDesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
67
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: CmatChartDesignerComponent, isStandalone: true, selector: "cmat-org-chart-designer", inputs: { node: "node", hasParent: "hasParent", enableControlHeight: "enableControlHeight", direction: "direction", detailsBtnTitle: "detailsBtnTitle" }, outputs: { detailsBtnClick: "detailsBtnClick" }, host: { properties: { "style.flex-direction": "this.hostClass", "style.width": "this.hostWidthClass" } }, exportAs: ["cmatOrgChartDesigner"], usesOnChanges: true, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<cmat-org-chart-node [class]=\"chartNodeClass\" [node]=\"node\" [hasParent]=\"hasParent\"\r\n [enableControlHeight]=\"enableControlHeight\" [direction]=\"direction\" [detailsBtnTitle]=\"detailsBtnTitle\"\r\n (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n</cmat-org-chart-node>\r\n\r\n<div class=\"cmat-org-reports-{{ direction }} cmat-org-reports\">\r\n @for (childNode of node.children; track $index) {\r\n <div class=\"cmat-org-org-container cmat-org-org-container-{{ direction }}\">\r\n <div class=\"cmat-org-connector-container cmat-org-connector-container-{{ direction }}\">\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$first ? 'transparent' : ''\"></div>\r\n <div class=\"cmat-org-border\"></div>\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$last ? 'transparent' : ''\"></div>\r\n </div>\r\n <cmat-org-chart-designer [node]=\"childNode\" [hasParent]=\"true\" [enableControlHeight]=\"enableControlHeight\"\r\n [direction]=\"direction\" [detailsBtnTitle]=\"detailsBtnTitle\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n </cmat-org-chart-designer>\r\n </div>\r\n }\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>\r\n", styles: ["cmat-org-chart-designer{display:flex;align-items:center;flex:1}.cmat-org-vertical{flex-direction:column}.cmat-org-org-container{display:flex}.cmat-org-org-container-vertical{flex-direction:column}.cmat-org-connector{flex:1}.cmat-org-connector-container{display:flex}.cmat-org-connector-container-horizontal{flex-direction:column}.cmat-org-reports{display:flex;flex:1}.cmat-org-reports-horizontal{flex-direction:column}.cmat-org-reports-vertical{width:100%}\n"], dependencies: [{ kind: "component", type: i0.forwardRef(() => CmatChartDesignerComponent), selector: "cmat-org-chart-designer", inputs: ["node", "hasParent", "enableControlHeight", "direction", "detailsBtnTitle"], outputs: ["detailsBtnClick"], exportAs: ["cmatOrgChartDesigner"] }, { kind: "component", type: i0.forwardRef(() => CmatChartNodeComponent), selector: "cmat-org-chart-node", inputs: ["node", "hasParent", "enableControlHeight", "direction", "detailsBtnTitle"], outputs: ["detailsBtnClick"], exportAs: ["cmatOrgChartNode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
68
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatChartDesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
69
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatChartDesignerComponent, isStandalone: true, selector: "cmat-org-chart-designer", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, hasParent: { classPropertyName: "hasParent", publicName: "hasParent", isSignal: true, isRequired: false, transformFunction: null }, enableControlHeight: { classPropertyName: "enableControlHeight", publicName: "enableControlHeight", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, detailsBtnTitle: { classPropertyName: "detailsBtnTitle", publicName: "detailsBtnTitle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { detailsBtnClick: "detailsBtnClick" }, host: { properties: { "style.flex-direction": "this.hostFlexDirection", "style.width": "this.hostWidth" } }, exportAs: ["cmatOrgChartDesigner"], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<cmat-org-chart-node [class]=\"chartNodeClass()\" [node]=\"node()\" [hasParent]=\"hasParent()\"\r\n [enableControlHeight]=\"enableControlHeight()\" [direction]=\"direction()\" [detailsBtnTitle]=\"detailsBtnTitle()\"\r\n (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n</cmat-org-chart-node>\r\n\r\n<div class=\"cmat-org-reports-{{ direction() }} cmat-org-reports\">\r\n @for (childNode of node().children; track $index) {\r\n <div class=\"cmat-org-org-container cmat-org-org-container-{{ direction() }}\">\r\n <div class=\"cmat-org-connector-container cmat-org-connector-container-{{ direction() }}\">\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$first ? 'transparent' : ''\"></div>\r\n <div class=\"cmat-org-border\"></div>\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$last ? 'transparent' : ''\"></div>\r\n </div>\r\n <cmat-org-chart-designer [node]=\"childNode\" [hasParent]=\"true\" [enableControlHeight]=\"enableControlHeight()\"\r\n [direction]=\"direction()\" [detailsBtnTitle]=\"detailsBtnTitle()\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n </cmat-org-chart-designer>\r\n </div>\r\n }\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>", styles: ["cmat-org-chart-designer{display:flex;align-items:center;flex:1}.cmat-org-vertical{flex-direction:column}.cmat-org-org-container{display:flex}.cmat-org-org-container-vertical{flex-direction:column}.cmat-org-connector{flex:1}.cmat-org-connector-container{display:flex}.cmat-org-connector-container-horizontal{flex-direction:column}.cmat-org-reports{display:flex;flex:1}.cmat-org-reports-horizontal{flex-direction:column}.cmat-org-reports-vertical{width:100%}\n"], dependencies: [{ kind: "component", type: i0.forwardRef(() => CmatChartDesignerComponent), selector: "cmat-org-chart-designer", inputs: ["node", "hasParent", "enableControlHeight", "direction", "detailsBtnTitle"], outputs: ["detailsBtnClick"], exportAs: ["cmatOrgChartDesigner"] }, { kind: "component", type: i0.forwardRef(() => CmatChartNodeComponent), selector: "cmat-org-chart-node", inputs: ["node", "hasParent", "enableControlHeight", "direction", "detailsBtnTitle"], outputs: ["detailsBtnClick"], exportAs: ["cmatOrgChartNode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
68
70
|
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatChartDesignerComponent, decorators: [{
|
|
70
72
|
type: Component,
|
|
71
|
-
args: [{ selector: 'cmat-org-chart-designer', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatOrgChartDesigner', imports: [CmatChartNodeComponent, forwardRef(() => CmatChartDesignerComponent)], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<cmat-org-chart-node [class]=\"chartNodeClass\" [node]=\"node\" [hasParent]=\"hasParent\"\r\n [enableControlHeight]=\"enableControlHeight\" [direction]=\"direction\" [detailsBtnTitle]=\"detailsBtnTitle\"\r\n (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n</cmat-org-chart-node>\r\n\r\n<div class=\"cmat-org-reports-{{ direction }} cmat-org-reports\">\r\n @for (childNode of node.children; track $index) {\r\n <div class=\"cmat-org-org-container cmat-org-org-container-{{ direction }}\">\r\n <div class=\"cmat-org-connector-container cmat-org-connector-container-{{ direction }}\">\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$first ? 'transparent' : ''\"></div>\r\n <div class=\"cmat-org-border\"></div>\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$last ? 'transparent' : ''\"></div>\r\n </div>\r\n <cmat-org-chart-designer [node]=\"childNode\" [hasParent]=\"true\" [enableControlHeight]=\"enableControlHeight\"\r\n [direction]=\"direction\" [detailsBtnTitle]=\"detailsBtnTitle\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n </cmat-org-chart-designer>\r\n </div>\r\n }\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div
|
|
72
|
-
}], propDecorators: { node: [{
|
|
73
|
-
type: Input
|
|
74
|
-
}], hasParent: [{
|
|
75
|
-
type: Input
|
|
76
|
-
}], enableControlHeight: [{
|
|
77
|
-
type: Input
|
|
78
|
-
}], direction: [{
|
|
79
|
-
type: Input
|
|
80
|
-
}], detailsBtnTitle: [{
|
|
81
|
-
type: Input
|
|
82
|
-
}], detailsBtnClick: [{
|
|
83
|
-
type: Output
|
|
84
|
-
}], hostClass: [{
|
|
73
|
+
args: [{ selector: 'cmat-org-chart-designer', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatOrgChartDesigner', imports: [CmatChartNodeComponent, forwardRef(() => CmatChartDesignerComponent)], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<cmat-org-chart-node [class]=\"chartNodeClass()\" [node]=\"node()\" [hasParent]=\"hasParent()\"\r\n [enableControlHeight]=\"enableControlHeight()\" [direction]=\"direction()\" [detailsBtnTitle]=\"detailsBtnTitle()\"\r\n (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n</cmat-org-chart-node>\r\n\r\n<div class=\"cmat-org-reports-{{ direction() }} cmat-org-reports\">\r\n @for (childNode of node().children; track $index) {\r\n <div class=\"cmat-org-org-container cmat-org-org-container-{{ direction() }}\">\r\n <div class=\"cmat-org-connector-container cmat-org-connector-container-{{ direction() }}\">\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$first ? 'transparent' : ''\"></div>\r\n <div class=\"cmat-org-border\"></div>\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$last ? 'transparent' : ''\"></div>\r\n </div>\r\n <cmat-org-chart-designer [node]=\"childNode\" [hasParent]=\"true\" [enableControlHeight]=\"enableControlHeight()\"\r\n [direction]=\"direction()\" [detailsBtnTitle]=\"detailsBtnTitle()\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n </cmat-org-chart-designer>\r\n </div>\r\n }\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>", styles: ["cmat-org-chart-designer{display:flex;align-items:center;flex:1}.cmat-org-vertical{flex-direction:column}.cmat-org-org-container{display:flex}.cmat-org-org-container-vertical{flex-direction:column}.cmat-org-connector{flex:1}.cmat-org-connector-container{display:flex}.cmat-org-connector-container-horizontal{flex-direction:column}.cmat-org-reports{display:flex;flex:1}.cmat-org-reports-horizontal{flex-direction:column}.cmat-org-reports-vertical{width:100%}\n"] }]
|
|
74
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: true }] }], hasParent: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasParent", required: false }] }], enableControlHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableControlHeight", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], detailsBtnTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailsBtnTitle", required: false }] }], detailsBtnClick: [{ type: i0.Output, args: ["detailsBtnClick"] }], hostFlexDirection: [{
|
|
85
75
|
type: HostBinding,
|
|
86
76
|
args: ['style.flex-direction']
|
|
87
|
-
}],
|
|
77
|
+
}], hostWidth: [{
|
|
88
78
|
type: HostBinding,
|
|
89
79
|
args: ['style.width']
|
|
90
80
|
}] } });
|
|
91
81
|
|
|
92
82
|
class CmatOrgChartComponent {
|
|
93
83
|
constructor() {
|
|
94
|
-
this.
|
|
95
|
-
|
|
96
|
-
this.
|
|
97
|
-
|
|
84
|
+
this.nodes = input.required(/* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
|
|
86
|
+
this.enableControlHeight = input(false, /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "enableControlHeight" }] : /* istanbul ignore next */ []));
|
|
88
|
+
this.direction = input('vertical', /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
90
|
+
this.detailsBtnTitle = input('查看详细', /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "detailsBtnTitle" }] : /* istanbul ignore next */ []));
|
|
92
|
+
this.detailsBtnClick = output();
|
|
98
93
|
}
|
|
99
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
100
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
94
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatOrgChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
95
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatOrgChartComponent, isStandalone: true, selector: "cmat-org-chart", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: true, transformFunction: null }, enableControlHeight: { classPropertyName: "enableControlHeight", publicName: "enableControlHeight", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, detailsBtnTitle: { classPropertyName: "detailsBtnTitle", publicName: "detailsBtnTitle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { detailsBtnClick: "detailsBtnClick" }, exportAs: ["cmatOrgChart"], ngImport: i0, template: "<div class=\"cmat-org\">\r\n @for (node of nodes(); track $index) {\r\n <div class=\"cmat-org-self-{{ direction() }}\">\r\n <cmat-org-chart-designer [node]=\"node\" [direction]=\"direction()\" [enableControlHeight]=\"enableControlHeight()\"\r\n [detailsBtnTitle]=\"detailsBtnTitle()\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\"></cmat-org-chart-designer>\r\n </div>\r\n }\r\n</div>", styles: [".cmat-org-horizontal{padding:1em 0}.cmat-org-vertical{padding:0 1em}.cmat-org-border{border:.1em solid var(--cmat-divider);box-sizing:border-box}.cmat-org-box{padding:.5em 1em;border-radius:.2em;box-shadow:0 2px 8px #00000059}.cmat-org-connector-horizontal{width:1em!important;height:0!important}.cmat-org-connector-vertical{width:0!important;height:1em!important}.cmat-org .cmat-org-self-vertical{margin-bottom:2%}\n"], dependencies: [{ kind: "component", type: CmatChartDesignerComponent, selector: "cmat-org-chart-designer", inputs: ["node", "hasParent", "enableControlHeight", "direction", "detailsBtnTitle"], outputs: ["detailsBtnClick"], exportAs: ["cmatOrgChartDesigner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
101
96
|
}
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatOrgChartComponent, decorators: [{
|
|
103
98
|
type: Component,
|
|
104
|
-
args: [{ selector: 'cmat-org-chart', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatOrgChart', imports: [CmatChartDesignerComponent], template: "<div class=\"cmat-org\">\r\n @for (node of nodes; track $index) {\r\n <div class=\"cmat-org-self-{{ direction }}\">\r\n <cmat-org-chart-designer [node]=\"node\" [direction]=\"direction\" [enableControlHeight]=\"enableControlHeight\"\r\n [detailsBtnTitle]=\"detailsBtnTitle\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\"></cmat-org-chart-designer>\r\n </div>\r\n }\r\n</div>", styles: [".cmat-org-horizontal{padding:1em 0}.cmat-org-vertical{padding:0 1em}.cmat-org-border{border:.1em solid var(--cmat-divider);box-sizing:border-box}.cmat-org-box{padding:.5em 1em;border-radius:.2em;box-shadow:0 2px 8px #00000059}.cmat-org-connector-horizontal{width:1em!important;height:0!important}.cmat-org-connector-vertical{width:0!important;height:1em!important}.cmat-org .cmat-org-self-vertical{margin-bottom:2%}\n"] }]
|
|
105
|
-
}], propDecorators: { nodes: [{
|
|
106
|
-
type: Input
|
|
107
|
-
}], enableControlHeight: [{
|
|
108
|
-
type: Input
|
|
109
|
-
}], direction: [{
|
|
110
|
-
type: Input
|
|
111
|
-
}], detailsBtnTitle: [{
|
|
112
|
-
type: Input
|
|
113
|
-
}], detailsBtnClick: [{
|
|
114
|
-
type: Output
|
|
115
|
-
}] } });
|
|
99
|
+
args: [{ selector: 'cmat-org-chart', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatOrgChart', imports: [CmatChartDesignerComponent], template: "<div class=\"cmat-org\">\r\n @for (node of nodes(); track $index) {\r\n <div class=\"cmat-org-self-{{ direction() }}\">\r\n <cmat-org-chart-designer [node]=\"node\" [direction]=\"direction()\" [enableControlHeight]=\"enableControlHeight()\"\r\n [detailsBtnTitle]=\"detailsBtnTitle()\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\"></cmat-org-chart-designer>\r\n </div>\r\n }\r\n</div>", styles: [".cmat-org-horizontal{padding:1em 0}.cmat-org-vertical{padding:0 1em}.cmat-org-border{border:.1em solid var(--cmat-divider);box-sizing:border-box}.cmat-org-box{padding:.5em 1em;border-radius:.2em;box-shadow:0 2px 8px #00000059}.cmat-org-connector-horizontal{width:1em!important;height:0!important}.cmat-org-connector-vertical{width:0!important;height:1em!important}.cmat-org .cmat-org-self-vertical{margin-bottom:2%}\n"] }]
|
|
100
|
+
}], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: true }] }], enableControlHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableControlHeight", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], detailsBtnTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailsBtnTitle", required: false }] }], detailsBtnClick: [{ type: i0.Output, args: ["detailsBtnClick"] }] } });
|
|
116
101
|
|
|
117
102
|
class ChartNode {
|
|
118
103
|
constructor(structure, parent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-org-chart.mjs","sources":["../../../projects/cmat/components/org-chart/node/chart-node.component.ts","../../../projects/cmat/components/org-chart/node/chart-node.component.html","../../../projects/cmat/components/org-chart/designer/chart-designer.component.ts","../../../projects/cmat/components/org-chart/designer/chart-designer.component.html","../../../projects/cmat/components/org-chart/org-chart.component.ts","../../../projects/cmat/components/org-chart/org-chart.component.html","../../../projects/cmat/components/org-chart/node/node.type.ts","../../../projects/cmat/components/org-chart/cmat-components-org-chart.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { INode } from './node.type';\r\n\r\n@Component({\r\n selector: 'cmat-org-chart-node',\r\n templateUrl: './chart-node.component.html',\r\n styleUrls: ['./chart-node.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatOrgChartNode',\r\n imports: [NgClass, MatIconModule, MatButtonModule]\r\n})\r\nexport class CmatChartNodeComponent implements OnChanges {\r\n @Input() node: INode;\r\n @Input() hasParent: boolean;\r\n @Input() enableControlHeight: boolean;\r\n @Input() direction: 'vertical' | 'horizontal' = 'vertical';\r\n @Input() detailsBtnTitle: string;\r\n\r\n @Output() detailsBtnClick = new EventEmitter<INode>();\r\n\r\n containerClass: string;\r\n connectorToParentHeight = '1em';\r\n maxHeightEm = 19.2;\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes.enableControlHeight) {\r\n if (this.enableControlHeight && this.node.heightFactor) {\r\n let newHeight = this.node.heightFactor * this.maxHeightEm;\r\n if (this.node.heightFactor >= 2) newHeight -= this.node.heightFactor - 1;\r\n this.connectorToParentHeight = `${newHeight}em`;\r\n }\r\n }\r\n\r\n if (changes.direction) {\r\n this.containerClass = `cmat-org-connector-${this.direction} `;\r\n }\r\n }\r\n}\r\n","<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@if(hasParent){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass\" [style.height]=\"connectorToParentHeight\"></div>\r\n}\r\n<div class=\"cmat-org-box cmat-org-border cmat-org-background\" [ngClass]=\"node.cssClass\">\r\n @if(node.image!==''){\r\n <div class=\"cmat-org-image\" [style]=\"{ 'background-image': 'url(\\'' + node.image + '\\')' }\"\r\n [style.border-color]=\"node.color\"></div>\r\n }@else {\r\n <div class=\"text-center\">\r\n <mat-icon class=\"icon-size-16\" [svgIcon]=\"'heroicons_outline:user-circle'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <div class=\"cmat-org-container\">\r\n <div class=\"cmat-org-title\" [innerHTML]=\"node.title\" [style.color]=\"node.color\"></div>\r\n <div class=\"cmat-org-name\" [innerHTML]=\"node.name\"></div>\r\n \r\n @if(node.showDetail){\r\n <div class=\"button-container\">\r\n <button matButton=\"filled\" class=\"cmat-org-btn cmat-org-btn-details\" color=\"primary\"\r\n (click)=\"detailsBtnClick.emit(node)\">\r\n {{ detailsBtnTitle }}\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>\r\n@if(node.children.length){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass\"></div>\r\n}\r\n","import { ChangeDetectionStrategy, Component, EventEmitter, forwardRef, HostBinding, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';\r\nimport { CmatChartNodeComponent } from '../node/chart-node.component';\r\nimport { INode } from '../node/node.type';\r\n\r\n@Component({\r\n selector: 'cmat-org-chart-designer',\r\n templateUrl: './chart-designer.component.html',\r\n styleUrls: ['./chart-designer.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatOrgChartDesigner',\r\n imports: [CmatChartNodeComponent, forwardRef(() => CmatChartDesignerComponent)]\r\n})\r\nexport class CmatChartDesignerComponent implements OnChanges {\r\n @Input() node: INode;\r\n @Input() hasParent:boolean = false;\r\n @Input() enableControlHeight: boolean;\r\n @Input() direction: 'vertical' | 'horizontal' = 'vertical';\r\n @Input() detailsBtnTitle: string;\r\n\r\n @Output() detailsBtnClick = new EventEmitter<INode>();\r\n\r\n chartNodeClass: string;\r\n\r\n\r\n @HostBinding('style.flex-direction')\r\n get hostClass(): string {\r\n return this.direction === 'vertical' ? 'column' : '';\r\n }\r\n\r\n @HostBinding('style.width')\r\n get hostWidthClass(): string {\r\n return this.direction === 'vertical' ? 'fit-content' : '';\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes.direction) {\r\n this.chartNodeClass = `cmat-org-${this.direction}`;\r\n }\r\n }\r\n\r\n}\r\n","<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<cmat-org-chart-node [class]=\"chartNodeClass\" [node]=\"node\" [hasParent]=\"hasParent\"\r\n [enableControlHeight]=\"enableControlHeight\" [direction]=\"direction\" [detailsBtnTitle]=\"detailsBtnTitle\"\r\n (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n</cmat-org-chart-node>\r\n\r\n<div class=\"cmat-org-reports-{{ direction }} cmat-org-reports\">\r\n @for (childNode of node.children; track $index) {\r\n <div class=\"cmat-org-org-container cmat-org-org-container-{{ direction }}\">\r\n <div class=\"cmat-org-connector-container cmat-org-connector-container-{{ direction }}\">\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$first ? 'transparent' : ''\"></div>\r\n <div class=\"cmat-org-border\"></div>\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$last ? 'transparent' : ''\"></div>\r\n </div>\r\n <cmat-org-chart-designer [node]=\"childNode\" [hasParent]=\"true\" [enableControlHeight]=\"enableControlHeight\"\r\n [direction]=\"direction\" [detailsBtnTitle]=\"detailsBtnTitle\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n </cmat-org-chart-designer>\r\n </div>\r\n }\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>\r\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';\r\nimport { CmatChartDesignerComponent } from './designer/chart-designer.component';\r\nimport { INode } from './node/node.type';\r\n\r\n\r\n@Component({\r\n selector: 'cmat-org-chart',\r\n templateUrl: './org-chart.component.html',\r\n styleUrls: ['./org-chart.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatOrgChart',\r\n imports: [CmatChartDesignerComponent]\r\n})\r\nexport class CmatOrgChartComponent {\r\n @Input() nodes: INode[];\r\n @Input() enableControlHeight:boolean = false;\r\n @Input() direction: 'vertical' | 'horizontal' = 'vertical';\r\n @Input() detailsBtnTitle:string = '查看详细';\r\n\r\n @Output() detailsBtnClick = new EventEmitter<INode>();\r\n}\r\n","<div class=\"cmat-org\">\r\n @for (node of nodes; track $index) {\r\n <div class=\"cmat-org-self-{{ direction }}\">\r\n <cmat-org-chart-designer [node]=\"node\" [direction]=\"direction\" [enableControlHeight]=\"enableControlHeight\"\r\n [detailsBtnTitle]=\"detailsBtnTitle\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\"></cmat-org-chart-designer>\r\n </div>\r\n }\r\n</div>","export interface INode {\r\n name: string;\r\n cssClass: string;\r\n image: string;\r\n title?: string;\r\n color?: string;\r\n showDetail: boolean;\r\n children: INode[];\r\n heightFactor?: number;\r\n}\r\n\r\nexport class ChartNode implements INode {\r\n name: string;\r\n cssClass: string;\r\n image: string;\r\n title?: string;\r\n color?: string;\r\n showDetail: boolean;\r\n children: ChartNode[];\r\n heightFactor?: number;\r\n parent?: ChartNode;\r\n\r\n constructor(structure: string[], parent?: ChartNode) {\r\n this.parent = parent;\r\n const [name, ...reports] = structure;\r\n this.name = name.split('(')[0].trim();\r\n const titleMatch = /\\(([^)]+)\\)/.exec(name);\r\n this.title = titleMatch?.[1].trim();\r\n\r\n this.children = reports.map(r => r.substring(1))\r\n .reduce((previous, current) => {\r\n if (!current.startsWith(' ')) {\r\n previous.push([]);\r\n }\r\n\r\n previous[previous.length - 1].push(current);\r\n return previous;\r\n }, [] as string[][])\r\n .map(r => new ChartNode(r, this)) ?? [];\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAea,sBAAsB,CAAA;AATnC,IAAA,WAAA,GAAA;QAaa,IAAA,CAAA,SAAS,GAA8B,UAAU;AAGhD,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAS;QAGrD,I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A,YAAA,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;AAC3C,YAAA,OAAO,QAAQ;QACnB,CAAC,EAAE,EAAgB;AAClB,aAAA,GAAG,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE;IAC/C;AACH;;ACxCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cmat-components-org-chart.mjs","sources":["../../../projects/cmat/components/org-chart/node/chart-node.component.ts","../../../projects/cmat/components/org-chart/node/chart-node.component.html","../../../projects/cmat/components/org-chart/designer/chart-designer.component.ts","../../../projects/cmat/components/org-chart/designer/chart-designer.component.html","../../../projects/cmat/components/org-chart/org-chart.component.ts","../../../projects/cmat/components/org-chart/org-chart.component.html","../../../projects/cmat/components/org-chart/node/node.type.ts","../../../projects/cmat/components/org-chart/cmat-components-org-chart.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, input, output, computed, ViewEncapsulation } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { INode } from './node.type';\r\n\r\n@Component({\r\n selector: 'cmat-org-chart-node',\r\n templateUrl: './chart-node.component.html',\r\n styleUrls: ['./chart-node.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatOrgChartNode',\r\n imports: [NgClass, MatIconModule, MatButtonModule]\r\n})\r\nexport class CmatChartNodeComponent {\r\n readonly node = input.required<INode>();\r\n readonly hasParent = input<boolean>();\r\n readonly enableControlHeight = input<boolean>();\r\n readonly direction = input<'vertical' | 'horizontal'>('vertical');\r\n readonly detailsBtnTitle = input<string>();\r\n\r\n readonly detailsBtnClick = output<INode>();\r\n\r\n readonly containerClass = computed(() => `cmat-org-connector-${this.direction()} `);\r\n\r\n readonly connectorToParentHeight = computed(() => {\r\n const heightFactor = this.node().heightFactor;\r\n if (this.enableControlHeight() && heightFactor !== undefined && heightFactor > 0) {\r\n const maxHeightEm = 19.2;\r\n let newHeight = heightFactor * maxHeightEm;\r\n if (heightFactor >= 2) {\r\n newHeight -= heightFactor - 1;\r\n }\r\n return `${newHeight}em`;\r\n }\r\n return '1em';\r\n });\r\n}\r\n","<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@if(hasParent()){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass()\" [style.height]=\"connectorToParentHeight()\"></div>\r\n}\r\n<div class=\"cmat-org-box cmat-org-border cmat-org-background\" [ngClass]=\"node().cssClass\">\r\n @if(node().image!==''){\r\n <div class=\"cmat-org-image\" [style]=\"{ 'background-image': 'url(\\'' + node().image + '\\')' }\"\r\n [style.border-color]=\"node().color\"></div>\r\n }@else {\r\n <div class=\"text-center\">\r\n <mat-icon class=\"icon-size-16\" [svgIcon]=\"'heroicons_outline:user-circle'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <div class=\"cmat-org-container\">\r\n <div class=\"cmat-org-title\" [innerHTML]=\"node().title\" [style.color]=\"node().color\"></div>\r\n <div class=\"cmat-org-name\" [innerHTML]=\"node().name\"></div>\r\n \r\n @if(node().showDetail){\r\n <div class=\"button-container\">\r\n <button matButton=\"filled\" class=\"cmat-org-btn cmat-org-btn-details\" color=\"primary\"\r\n (click)=\"detailsBtnClick.emit(node())\">\r\n {{ detailsBtnTitle() }}\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>\r\n@if(node().children.length){\r\n<div class=\"cmat-org-border\" [ngClass]=\"containerClass()\"></div>\r\n}","import { ChangeDetectionStrategy, Component, forwardRef, HostBinding, input, output, computed, ViewEncapsulation } from '@angular/core';\r\nimport { CmatChartNodeComponent } from '../node/chart-node.component';\r\nimport { INode } from '../node/node.type';\r\n\r\n@Component({\r\n selector: 'cmat-org-chart-designer',\r\n templateUrl: './chart-designer.component.html',\r\n styleUrls: ['./chart-designer.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatOrgChartDesigner',\r\n imports: [CmatChartNodeComponent, forwardRef(() => CmatChartDesignerComponent)]\r\n})\r\nexport class CmatChartDesignerComponent {\r\n readonly node = input.required<INode>();\r\n readonly hasParent = input<boolean>(false);\r\n readonly enableControlHeight = input<boolean>();\r\n readonly direction = input<'vertical' | 'horizontal'>('vertical');\r\n readonly detailsBtnTitle = input<string>();\r\n\r\n readonly detailsBtnClick = output<INode>();\r\n\r\n readonly chartNodeClass = computed(() => `cmat-org-${this.direction()}`);\r\n\r\n\r\n @HostBinding('style.flex-direction')\r\n get hostFlexDirection(): string {\r\n return this.direction() === 'vertical' ? 'column' : '';\r\n }\r\n\r\n @HostBinding('style.width')\r\n get hostWidth(): string {\r\n return this.direction() === 'vertical' ? 'fit-content' : '';\r\n }\r\n\r\n}\r\n","<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<cmat-org-chart-node [class]=\"chartNodeClass()\" [node]=\"node()\" [hasParent]=\"hasParent()\"\r\n [enableControlHeight]=\"enableControlHeight()\" [direction]=\"direction()\" [detailsBtnTitle]=\"detailsBtnTitle()\"\r\n (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n</cmat-org-chart-node>\r\n\r\n<div class=\"cmat-org-reports-{{ direction() }} cmat-org-reports\">\r\n @for (childNode of node().children; track $index) {\r\n <div class=\"cmat-org-org-container cmat-org-org-container-{{ direction() }}\">\r\n <div class=\"cmat-org-connector-container cmat-org-connector-container-{{ direction() }}\">\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$first ? 'transparent' : ''\"></div>\r\n <div class=\"cmat-org-border\"></div>\r\n <div class=\"cmat-org-connector cmat-org-border\" [style.border-color]=\"$last ? 'transparent' : ''\"></div>\r\n </div>\r\n <cmat-org-chart-designer [node]=\"childNode\" [hasParent]=\"true\" [enableControlHeight]=\"enableControlHeight()\"\r\n [direction]=\"direction()\" [detailsBtnTitle]=\"detailsBtnTitle()\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\">\r\n </cmat-org-chart-designer>\r\n </div>\r\n }\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</div>","import { ChangeDetectionStrategy, Component, input, output, ViewEncapsulation } from '@angular/core';\r\nimport { CmatChartDesignerComponent } from './designer/chart-designer.component';\r\nimport { INode } from './node/node.type';\r\n\r\n\r\n@Component({\r\n selector: 'cmat-org-chart',\r\n templateUrl: './org-chart.component.html',\r\n styleUrls: ['./org-chart.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatOrgChart',\r\n imports: [CmatChartDesignerComponent]\r\n})\r\nexport class CmatOrgChartComponent {\r\n readonly nodes = input.required<INode[]>();\r\n readonly enableControlHeight = input<boolean>(false);\r\n readonly direction = input<'vertical' | 'horizontal'>('vertical');\r\n readonly detailsBtnTitle = input<string>('查看详细');\r\n\r\n readonly detailsBtnClick = output<INode>();\r\n}","<div class=\"cmat-org\">\r\n @for (node of nodes(); track $index) {\r\n <div class=\"cmat-org-self-{{ direction() }}\">\r\n <cmat-org-chart-designer [node]=\"node\" [direction]=\"direction()\" [enableControlHeight]=\"enableControlHeight()\"\r\n [detailsBtnTitle]=\"detailsBtnTitle()\" (detailsBtnClick)=\"detailsBtnClick.emit($event)\"></cmat-org-chart-designer>\r\n </div>\r\n }\r\n</div>","export interface INode {\r\n name: string;\r\n cssClass: string;\r\n image: string;\r\n title?: string;\r\n color?: string;\r\n showDetail: boolean;\r\n children: INode[];\r\n heightFactor?: number;\r\n}\r\n\r\nexport class ChartNode implements INode {\r\n name: string;\r\n cssClass: string;\r\n image: string;\r\n title?: string;\r\n color?: string;\r\n showDetail: boolean;\r\n children: ChartNode[];\r\n heightFactor?: number;\r\n parent?: ChartNode;\r\n\r\n constructor(structure: string[], parent?: ChartNode) {\r\n this.parent = parent;\r\n const [name, ...reports] = structure;\r\n this.name = name.split('(')[0].trim();\r\n const titleMatch = /\\(([^)]+)\\)/.exec(name);\r\n this.title = titleMatch?.[1].trim();\r\n\r\n this.children = reports.map(r => r.substring(1))\r\n .reduce((previous, current) => {\r\n if (!current.startsWith(' ')) {\r\n previous.push([]);\r\n }\r\n\r\n previous[previous.length - 1].push(current);\r\n return previous;\r\n }, [] as string[][])\r\n .map(r => new ChartNode(r, this)) ?? [];\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAea,sBAAsB,CAAA;AATnC,IAAA,WAAA,GAAA;QAUa,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ;iFAAS;AAC9B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAW;AAC5B,QAAA,IAAA,CAAA,mBAAmB,GAAG,KAAK;2GAAW;QACtC,IAAA,CAAA,SAAS,GAAG,KAAK,CAA4B,UAAU;sFAAC;AACxD,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK;uGAAU;QAEjC,IAAA,CAAA,eAAe,GAAG,MAAM,EAAS;QAEjC,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAA,mBAAA,EAAsB,IAAI,CAAC,SAAS,EAAE,CAAA,CAAA,CAAG;2FAAC;AAE1E,QAAA,IAAA,CAAA,uBAAuB,GAAG,QAAQ,CAAC,MAAK;YAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,YAAY;AAC7C,YAAA,IAAI,IAAI,CAAC,mBAAmB,EAAE,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,GAAG,CAAC,EAAE;gBAC9E,MAAM,WAAW,GAAG,IAAI;AACxB,gBAAA,IAAI,SAAS,GAAG,YAAY,GAAG,WAAW;AAC1C,gBAAA,IAAI,YAAY,IAA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EAAA,CAAA,maAAA,CAAA,EAAA;;;MED5B,SAAS,CAAA;IAWlB,WAAA,CAAY,SAAmB,EAAE,MAAkB,EAAA;AAC/C,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,MAAM,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,SAAS;AACpC,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;QACrC,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE;AAEnC,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1C,aAAA,MAAM,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAI;YAC1B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAC1B,gBAAA,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB;AAEA,YAAA,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;AAC3C,YAAA,OAAO,QAAQ;QACnB,CAAC,EAAE,EAAgB;AAClB,aAAA,GAAG,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE;IAC/C;AACH;;ACxCD;;AAEG;;;;"}
|
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
import { NgClass } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { input, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
4
4
|
|
|
5
5
|
class CmatPageHeaderComponent {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.title = '页面标题'
|
|
8
|
-
|
|
9
|
-
this.
|
|
10
|
-
|
|
11
|
-
this.
|
|
7
|
+
this.title = input('页面标题', /* @ts-ignore */
|
|
8
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
9
|
+
this.description = input('', /* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
11
|
+
this.eyebrow = input('', /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "eyebrow" }] : /* istanbul ignore next */ []));
|
|
13
|
+
this.divider = input(true, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "divider" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.align = input('start', /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
17
|
+
this.isCentered = computed(() => this.align() === 'center', /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "isCentered" }] : /* istanbul ignore next */ []));
|
|
12
19
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CmatPageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
17
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: CmatPageHeaderComponent, isStandalone: true, selector: "cmat-page-header", inputs: { title: "title", description: "description", eyebrow: "eyebrow", divider: "divider", align: "align" }, ngImport: i0, template: "<section\r\n class=\"border-b border-default pb-4\"\r\n [ngClass]=\"isCentered ? 'flex flex-col items-center gap-4 text-center' : 'flex flex-col gap-4 md:flex-row md:items-end md:justify-between'\"\r\n>\r\n <div class=\"min-w-0\">\r\n @if (eyebrow) {\r\n <p class=\"text-xs font-semibold uppercase tracking-[0.2em] text-primary\">{{ eyebrow }}</p>\r\n }\r\n\r\n <h1 class=\"mt-1 text-2xl font-semibold text-default\">{{ title }}</h1>\r\n\r\n @if (description) {\r\n <p class=\"mt-2 max-w-3xl text-sm leading-6 text-secondary\">{{ description }}</p>\r\n }\r\n </div>\r\n\r\n <div [ngClass]=\"isCentered ? 'flex items-center justify-center gap-2' : 'flex items-center gap-2 md:ml-auto'\">\r\n <ng-content select=\"[cmatPageHeaderActions]\"></ng-content>\r\n </div>\r\n</section>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
20
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatPageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatPageHeaderComponent, isStandalone: true, selector: "cmat-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, eyebrow: { classPropertyName: "eyebrow", publicName: "eyebrow", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<section\r\n class=\"border-b border-default pb-4\"\r\n [ngClass]=\"isCentered() ? 'flex flex-col items-center gap-4 text-center' : 'flex flex-col gap-4 md:flex-row md:items-end md:justify-between'\"\r\n>\r\n <div class=\"min-w-0\">\r\n @if (eyebrow()) {\r\n <p class=\"text-xs font-semibold uppercase tracking-[0.2em] text-primary\">{{ eyebrow() }}</p>\r\n }\r\n\r\n <h1 class=\"mt-1 text-2xl font-semibold text-default\">{{ title() }}</h1>\r\n\r\n @if (description()) {\r\n <p class=\"mt-2 max-w-3xl text-sm leading-6 text-secondary\">{{ description() }}</p>\r\n }\r\n </div>\r\n\r\n <div [ngClass]=\"isCentered() ? 'flex items-center justify-center gap-2' : 'flex items-center gap-2 md:ml-auto'\">\r\n <ng-content select=\"[cmatPageHeaderActions]\"></ng-content>\r\n </div>\r\n</section>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
18
22
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatPageHeaderComponent, decorators: [{
|
|
20
24
|
type: Component,
|
|
21
|
-
args: [{ selector: 'cmat-page-header', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass], template: "<section\r\n class=\"border-b border-default pb-4\"\r\n [ngClass]=\"isCentered ? 'flex flex-col items-center gap-4 text-center' : 'flex flex-col gap-4 md:flex-row md:items-end md:justify-between'\"\r\n>\r\n <div class=\"min-w-0\">\r\n @if (eyebrow) {\r\n <p class=\"text-xs font-semibold uppercase tracking-[0.2em] text-primary\">{{ eyebrow }}</p>\r\n }\r\n\r\n <h1 class=\"mt-1 text-2xl font-semibold text-default\">{{ title }}</h1>\r\n\r\n @if (description) {\r\n <p class=\"mt-2 max-w-3xl text-sm leading-6 text-secondary\">{{ description }}</p>\r\n }\r\n </div>\r\n\r\n <div [ngClass]=\"isCentered ? 'flex items-center justify-center gap-2' : 'flex items-center gap-2 md:ml-auto'\">\r\n <ng-content select=\"[cmatPageHeaderActions]\"></ng-content>\r\n </div>\r\n</section>\r\n", styles: [":host{display:block}\n"] }]
|
|
22
|
-
}], propDecorators: { title: [{
|
|
23
|
-
type: Input
|
|
24
|
-
}], description: [{
|
|
25
|
-
type: Input
|
|
26
|
-
}], eyebrow: [{
|
|
27
|
-
type: Input
|
|
28
|
-
}], divider: [{
|
|
29
|
-
type: Input
|
|
30
|
-
}], align: [{
|
|
31
|
-
type: Input
|
|
32
|
-
}] } });
|
|
25
|
+
args: [{ selector: 'cmat-page-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass], template: "<section\r\n class=\"border-b border-default pb-4\"\r\n [ngClass]=\"isCentered() ? 'flex flex-col items-center gap-4 text-center' : 'flex flex-col gap-4 md:flex-row md:items-end md:justify-between'\"\r\n>\r\n <div class=\"min-w-0\">\r\n @if (eyebrow()) {\r\n <p class=\"text-xs font-semibold uppercase tracking-[0.2em] text-primary\">{{ eyebrow() }}</p>\r\n }\r\n\r\n <h1 class=\"mt-1 text-2xl font-semibold text-default\">{{ title() }}</h1>\r\n\r\n @if (description()) {\r\n <p class=\"mt-2 max-w-3xl text-sm leading-6 text-secondary\">{{ description() }}</p>\r\n }\r\n </div>\r\n\r\n <div [ngClass]=\"isCentered() ? 'flex items-center justify-center gap-2' : 'flex items-center gap-2 md:ml-auto'\">\r\n <ng-content select=\"[cmatPageHeaderActions]\"></ng-content>\r\n </div>\r\n</section>\r\n", styles: [":host{display:block}\n"] }]
|
|
26
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], eyebrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "eyebrow", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }] } });
|
|
33
27
|
|
|
34
28
|
/**
|
|
35
29
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-page-header.mjs","sources":["../../../projects/cmat/components/page-header/page-header.component.ts","../../../projects/cmat/components/page-header/page-header.component.html","../../../projects/cmat/components/page-header/cmat-components-page-header.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"cmat-components-page-header.mjs","sources":["../../../projects/cmat/components/page-header/page-header.component.ts","../../../projects/cmat/components/page-header/page-header.component.html","../../../projects/cmat/components/page-header/cmat-components-page-header.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, input, computed, ViewEncapsulation } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'cmat-page-header',\r\n templateUrl: './page-header.component.html',\r\n styleUrls: ['./page-header.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [NgClass]\r\n})\r\nexport class CmatPageHeaderComponent {\r\n readonly title = input<string>('页面标题');\r\n readonly description = input<string>('');\r\n readonly eyebrow = input<string>('');\r\n readonly divider = input<boolean>(true);\r\n readonly align = input<'start' | 'center'>('start');\r\n\r\n readonly isCentered = computed(() => this.align() === 'center');\r\n}\r\n","<section\r\n class=\"border-b border-default pb-4\"\r\n [ngClass]=\"isCentered() ? 'flex flex-col items-center gap-4 text-center' : 'flex flex-col gap-4 md:flex-row md:items-end md:justify-between'\"\r\n>\r\n <div class=\"min-w-0\">\r\n @if (eyebrow()) {\r\n <p class=\"text-xs font-semibold uppercase tracking-[0.2em] text-primary\">{{ eyebrow() }}</p>\r\n }\r\n\r\n <h1 class=\"mt-1 text-2xl font-semibold text-default\">{{ title() }}</h1>\r\n\r\n @if (description()) {\r\n <p class=\"mt-2 max-w-3xl text-sm leading-6 text-secondary\">{{ description() }}</p>\r\n }\r\n </div>\r\n\r\n <div [ngClass]=\"isCentered() ? 'flex items-center justify-center gap-2' : 'flex items-center gap-2 md:ml-auto'\">\r\n <ng-content select=\"[cmatPageHeaderActions]\"></ng-content>\r\n </div>\r\n</section>\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