@theseam/ui-common 1.0.0-beta.6 → 1.0.0-beta.7
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/breadcrumbs/index.d.ts +1 -2
- package/buttons/index.d.ts +20 -13
- package/datatable/index.d.ts +8 -8
- package/dynamic/index.d.ts +5 -5
- package/fesm2022/theseam-ui-common-asset-reader.mjs +28 -29
- package/fesm2022/theseam-ui-common-asset-reader.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-breadcrumbs.mjs +25 -31
- package/fesm2022/theseam-ui-common-breadcrumbs.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-buttons.mjs +108 -66
- package/fesm2022/theseam-ui-common-buttons.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-card.mjs +21 -21
- package/fesm2022/theseam-ui-common-card.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-carousel.mjs +28 -30
- package/fesm2022/theseam-ui-common-carousel.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-checkbox.mjs +27 -27
- package/fesm2022/theseam-ui-common-checkbox.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-confirm-dialog.mjs +23 -27
- package/fesm2022/theseam-ui-common-confirm-dialog.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-core.mjs +31 -11
- package/fesm2022/theseam-ui-common-core.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-data-exporter.mjs +18 -19
- package/fesm2022/theseam-ui-common-data-exporter.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-data-filters.mjs +80 -64
- package/fesm2022/theseam-ui-common-data-filters.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs +51 -49
- package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-datatable-dynamic.mjs +145 -112
- package/fesm2022/theseam-ui-common-datatable-dynamic.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-datatable.mjs +581 -385
- package/fesm2022/theseam-ui-common-datatable.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-dynamic-component-loader.mjs +12 -14
- package/fesm2022/theseam-ui-common-dynamic-component-loader.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-dynamic.mjs +60 -48
- package/fesm2022/theseam-ui-common-dynamic.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-footer-bar.mjs +9 -15
- package/fesm2022/theseam-ui-common-footer-bar.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-form-field-error.mjs +60 -43
- package/fesm2022/theseam-ui-common-form-field-error.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-form-field.mjs +120 -74
- package/fesm2022/theseam-ui-common-form-field.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-framework.mjs +669 -543
- package/fesm2022/theseam-ui-common-framework.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-google-maps.mjs +206 -149
- package/fesm2022/theseam-ui-common-google-maps.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-graphql.mjs +252 -195
- package/fesm2022/theseam-ui-common-graphql.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-icon.mjs +125 -89
- package/fesm2022/theseam-ui-common-icon.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-layout.mjs +18 -26
- package/fesm2022/theseam-ui-common-layout.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-loading.mjs +19 -28
- package/fesm2022/theseam-ui-common-loading.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-menu.mjs +124 -95
- package/fesm2022/theseam-ui-common-menu.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-modal.mjs +177 -129
- package/fesm2022/theseam-ui-common-modal.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-models.mjs +3 -3
- package/fesm2022/theseam-ui-common-models.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-navigation-reload.mjs +13 -11
- package/fesm2022/theseam-ui-common-navigation-reload.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-popover.mjs +81 -88
- package/fesm2022/theseam-ui-common-popover.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-progress.mjs +15 -19
- package/fesm2022/theseam-ui-common-progress.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-rich-text.mjs +65 -52
- package/fesm2022/theseam-ui-common-rich-text.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-scrollbar.mjs +12 -9
- package/fesm2022/theseam-ui-common-scrollbar.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-services.mjs +41 -26
- package/fesm2022/theseam-ui-common-services.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-shared.mjs +123 -67
- package/fesm2022/theseam-ui-common-shared.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-storage.mjs +9 -6
- package/fesm2022/theseam-ui-common-storage.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-story-helpers.mjs +148 -86
- package/fesm2022/theseam-ui-common-story-helpers.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tabbed.mjs +43 -39
- package/fesm2022/theseam-ui-common-tabbed.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-table-cell-type.mjs +34 -38
- package/fesm2022/theseam-ui-common-table-cell-type.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-table-cell-types.mjs +182 -144
- package/fesm2022/theseam-ui-common-table-cell-types.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-table.mjs +50 -39
- package/fesm2022/theseam-ui-common-table.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tel-input.mjs +98 -63
- package/fesm2022/theseam-ui-common-tel-input.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-testing.mjs +13 -10
- package/fesm2022/theseam-ui-common-testing.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tiled-select.mjs +54 -50
- package/fesm2022/theseam-ui-common-tiled-select.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-toggle-edit.mjs +41 -37
- package/fesm2022/theseam-ui-common-toggle-edit.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-toggle-group.mjs +30 -31
- package/fesm2022/theseam-ui-common-toggle-group.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tooltip.mjs +225 -66
- package/fesm2022/theseam-ui-common-tooltip.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-unsaved-changes-dialog.mjs +14 -12
- package/fesm2022/theseam-ui-common-unsaved-changes-dialog.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-utils.mjs +113 -77
- package/fesm2022/theseam-ui-common-utils.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-validators.mjs +10 -9
- package/fesm2022/theseam-ui-common-validators.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-vertical-list-filter.mjs +39 -17
- package/fesm2022/theseam-ui-common-vertical-list-filter.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-viewers.mjs +79 -56
- package/fesm2022/theseam-ui-common-viewers.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-widget.mjs +288 -314
- package/fesm2022/theseam-ui-common-widget.mjs.map +1 -1
- package/framework/base-layout/base-layout.component.scss +9 -4
- package/framework/base-layout/styles/_variables.scss +4 -9
- package/framework/dashboard/dashboard-widgets/dashboard-widgets.component.scss +6 -4
- package/framework/index.d.ts +6 -6
- package/framework/nav/nav-item/nav-item.component.scss +7 -6
- package/framework/nav/styles/_themes/light/_variables.scss +21 -5
- package/framework/nav/styles/_themes/primary/_variables.scss +21 -5
- package/framework/side-nav/side-nav-item/side-nav-item.component.scss +5 -2
- package/framework/side-nav/styles/_themes/light/_variables.scss +5 -1
- package/framework/side-nav/styles/_themes/primary/_variables.scss +25 -5
- package/graphql/index.d.ts +5 -5
- package/modal/README.md +5 -5
- package/modal/index.d.ts +1 -1
- package/models/index.d.ts +1 -1
- package/package.json +59 -59
- package/popover/index.d.ts +0 -2
- package/progress/progress-circle/styles/_variables.scss +15 -3
- package/story-helpers/index.d.ts +11 -1
- package/styles/bootstrap/_bootstrap.scss +34 -34
- package/styles/bootstrap/_bs-styles.scss +4 -8
- package/styles/bootstrap/_bs-utilities.scss +4 -4
- package/styles/bootstrap/_bs-variables.scss +65 -70
- package/styles/common/_forms.scss +9 -10
- package/styles/common/_global.scss +0 -1
- package/styles/common/_hacks.scss +1 -1
- package/styles/common/_table.scss +0 -1
- package/styles/common/_text.scss +3 -1
- package/styles/theme.scss +1 -1
- package/styles/vendor/ng-select/_ng-select-bs4.scss +292 -294
- package/styles/vendor/ngx-datatable/_ngx-datatable.scss +63 -32
- package/styles/vendor/ngx-datatable/_themes/bootstrap/_variables.scss +37 -10
- package/styles/vendor/ngx-datatable/_themes/material/_variables.scss +3 -1
- package/styles/vendor/quill/_quill.scss +15 -9
- package/tel-input/README.md +27 -27
- package/utils/index.d.ts +3 -3
- package/viewers/index.d.ts +9 -2
- package/widget/_widget-theme.scss +1 -1
- package/widget/styles/_variables.scss +2 -2
- package/widget/widget/widget.component.scss +0 -2
- package/widget/widget-content-components/widget-tile/widget-tile.component.scss +1 -3
- package/widget/widget-footer/widget-footer.component.scss +0 -1
|
@@ -12,14 +12,14 @@ import { isNullOrUndefined } from '@theseam/ui-common/utils';
|
|
|
12
12
|
|
|
13
13
|
class TheSeamTabbedTabContentDirective {
|
|
14
14
|
isActive = false;
|
|
15
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
16
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedTabContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
16
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.6", type: TheSeamTabbedTabContentDirective, isStandalone: true, selector: "[seamTabbedTabContent]", exportAs: ["seamTabbedTabContent"], ngImport: i0 });
|
|
17
17
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedTabContentDirective, decorators: [{
|
|
19
19
|
type: Directive,
|
|
20
20
|
args: [{
|
|
21
21
|
selector: '[seamTabbedTabContent]',
|
|
22
|
-
exportAs: 'seamTabbedTabContent'
|
|
22
|
+
exportAs: 'seamTabbedTabContent',
|
|
23
23
|
}]
|
|
24
24
|
}] });
|
|
25
25
|
|
|
@@ -36,16 +36,16 @@ class TheSeamTabbedService {
|
|
|
36
36
|
}
|
|
37
37
|
unregisterTab(tab, groupName) {
|
|
38
38
|
if (this._tabGroups[groupName]) {
|
|
39
|
-
this._tabGroups[groupName] = this._tabGroups[groupName].filter(t => t !== tab);
|
|
39
|
+
this._tabGroups[groupName] = this._tabGroups[groupName].filter((t) => t !== tab);
|
|
40
40
|
if (this._tabGroups[groupName].length > 0) {
|
|
41
41
|
this._tabGroups[groupName][this._tabGroups[groupName].length - 1].hideTabs = false;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
46
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
45
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
46
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedService });
|
|
47
47
|
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedService, decorators: [{
|
|
49
49
|
type: Injectable
|
|
50
50
|
}] });
|
|
51
51
|
|
|
@@ -61,7 +61,6 @@ class TheSeamTabbedTabDirective {
|
|
|
61
61
|
this.elementRef = elementRef;
|
|
62
62
|
this.tabbedService = tabbedService;
|
|
63
63
|
}
|
|
64
|
-
// eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
|
|
65
64
|
ngOnInit() {
|
|
66
65
|
// this.tabbedService.selectedTab.subscribe(tab => {
|
|
67
66
|
// console.log('tab: ', tab)
|
|
@@ -74,30 +73,25 @@ class TheSeamTabbedTabDirective {
|
|
|
74
73
|
// }
|
|
75
74
|
// })
|
|
76
75
|
}
|
|
77
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
78
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedTabDirective, deps: [{ token: i0.ElementRef }, { token: TheSeamTabbedService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
77
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.6", type: TheSeamTabbedTabDirective, isStandalone: true, selector: "[seamTabbedTab]", exportAs: ["seamTabbedTab"], ngImport: i0 });
|
|
79
78
|
}
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedTabDirective, decorators: [{
|
|
81
80
|
type: Directive,
|
|
82
81
|
args: [{
|
|
83
82
|
selector: '[seamTabbedTab]',
|
|
84
|
-
exportAs: 'seamTabbedTab'
|
|
83
|
+
exportAs: 'seamTabbedTab',
|
|
85
84
|
}]
|
|
86
85
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: TheSeamTabbedService }] });
|
|
87
86
|
|
|
88
87
|
class TheSeamTabbedContentComponent {
|
|
89
88
|
tabbedItem;
|
|
90
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
91
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
89
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
90
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: TheSeamTabbedContentComponent, isStandalone: true, selector: "seam-tabbed-content", inputs: { tabbedItem: "tabbedItem" }, ngImport: i0, template: "<div fxFlexFill>\n <ng-container *ngIf=\"tabbedItem\">\n <ng-template\n *ngIf=\"tabbedItem.tabbedContentTpl\"\n [ngTemplateOutlet]=\"tabbedItem.tabbedContentTpl\"\n ></ng-template>\n <ng-container *ngIf=\"tabbedItem.contentFromRoute\"\n ><router-outlet></router-outlet\n ></ng-container>\n </ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: i3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }] });
|
|
92
91
|
}
|
|
93
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedContentComponent, decorators: [{
|
|
94
93
|
type: Component,
|
|
95
|
-
args: [{ selector: 'seam-tabbed-content', imports: [
|
|
96
|
-
NgIf,
|
|
97
|
-
NgTemplateOutlet,
|
|
98
|
-
RouterModule,
|
|
99
|
-
FlexLayoutModule,
|
|
100
|
-
], template: "<div fxFlexFill>\n <ng-container *ngIf=\"tabbedItem\">\n <ng-template *ngIf=\"tabbedItem.tabbedContentTpl\" [ngTemplateOutlet]=\"tabbedItem.tabbedContentTpl\"></ng-template>\n <ng-container *ngIf=\"tabbedItem.contentFromRoute\"><router-outlet></router-outlet></ng-container>\n </ng-container>\n</div>\n" }]
|
|
94
|
+
args: [{ selector: 'seam-tabbed-content', imports: [NgIf, NgTemplateOutlet, RouterModule, FlexLayoutModule], template: "<div fxFlexFill>\n <ng-container *ngIf=\"tabbedItem\">\n <ng-template\n *ngIf=\"tabbedItem.tabbedContentTpl\"\n [ngTemplateOutlet]=\"tabbedItem.tabbedContentTpl\"\n ></ng-template>\n <ng-container *ngIf=\"tabbedItem.contentFromRoute\"\n ><router-outlet></router-outlet\n ></ng-container>\n </ng-container>\n</div>\n" }]
|
|
101
95
|
}], propDecorators: { tabbedItem: [{
|
|
102
96
|
type: Input
|
|
103
97
|
}] } });
|
|
@@ -109,13 +103,13 @@ class TheSeamTabbedItemComponent {
|
|
|
109
103
|
name;
|
|
110
104
|
label;
|
|
111
105
|
contentFromRoute = false;
|
|
112
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
113
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
107
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: TheSeamTabbedItemComponent, isStandalone: true, selector: "seam-tabbed-item", inputs: { name: "name", label: "label", contentFromRoute: "contentFromRoute" }, queries: [{ propertyName: "tabbedTabTpl", first: true, predicate: TheSeamTabbedTabDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "tabbedContentTpl", first: true, predicate: TheSeamTabbedTabContentDirective, descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "", styles: [""] });
|
|
114
108
|
}
|
|
115
109
|
__decorate([
|
|
116
110
|
InputBoolean()
|
|
117
111
|
], TheSeamTabbedItemComponent.prototype, "contentFromRoute", void 0);
|
|
118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedItemComponent, decorators: [{
|
|
119
113
|
type: Component,
|
|
120
114
|
args: [{ selector: 'seam-tabbed-item', template: "" }]
|
|
121
115
|
}], propDecorators: { tabbedTabTpl: [{
|
|
@@ -123,7 +117,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
123
117
|
args: [TheSeamTabbedTabDirective, { read: TemplateRef, static: true }]
|
|
124
118
|
}], tabbedContentTpl: [{
|
|
125
119
|
type: ContentChild,
|
|
126
|
-
args: [TheSeamTabbedTabContentDirective, {
|
|
120
|
+
args: [TheSeamTabbedTabContentDirective, {
|
|
121
|
+
read: TemplateRef,
|
|
122
|
+
static: true,
|
|
123
|
+
}]
|
|
127
124
|
}], name: [{
|
|
128
125
|
type: Input
|
|
129
126
|
}], label: [{
|
|
@@ -167,16 +164,20 @@ class TheSeamTabbedComponent {
|
|
|
167
164
|
if (this._route.snapshot.children.length > 0) {
|
|
168
165
|
const config = this._route.snapshot.children[0].routeConfig;
|
|
169
166
|
const childPath = config && config.path;
|
|
170
|
-
return this.tabbedItems?.find(t => t.name === childPath);
|
|
167
|
+
return this.tabbedItems?.find((t) => t.name === childPath);
|
|
171
168
|
}
|
|
172
169
|
}
|
|
173
170
|
else {
|
|
174
171
|
return this._selectedTab.value;
|
|
175
172
|
}
|
|
176
173
|
}
|
|
177
|
-
set selectedTab(tab) {
|
|
174
|
+
set selectedTab(tab) {
|
|
175
|
+
this._selectedTab.next(tab);
|
|
176
|
+
}
|
|
178
177
|
_selectedTab = new BehaviorSubject(undefined);
|
|
179
|
-
selectedTab$ = this._selectedTab
|
|
178
|
+
selectedTab$ = this._selectedTab
|
|
179
|
+
.asObservable()
|
|
180
|
+
.pipe(shareReplay({ bufferSize: 1, refCount: true }));
|
|
180
181
|
set activeTabName(val) {
|
|
181
182
|
this._activeTabName.next(val);
|
|
182
183
|
}
|
|
@@ -194,7 +195,9 @@ class TheSeamTabbedComponent {
|
|
|
194
195
|
this._tabbedService.unregisterTab(this, 'main');
|
|
195
196
|
}
|
|
196
197
|
ngAfterContentInit() {
|
|
197
|
-
combineLatest([this.tabbedItems$, this.activeTabName$])
|
|
198
|
+
combineLatest([this.tabbedItems$, this.activeTabName$])
|
|
199
|
+
.pipe(tap(([_, activeTabName]) => this.selectTab(activeTabName)))
|
|
200
|
+
.subscribe();
|
|
198
201
|
}
|
|
199
202
|
/**
|
|
200
203
|
*
|
|
@@ -214,18 +217,19 @@ class TheSeamTabbedComponent {
|
|
|
214
217
|
if (isNullOrUndefined(name) || name === this.selectedTab?.name) {
|
|
215
218
|
return;
|
|
216
219
|
}
|
|
217
|
-
const tab = this.tabbedItems?.find(t => t.name === name);
|
|
220
|
+
const tab = this.tabbedItems?.find((t) => t.name === name);
|
|
218
221
|
if (tab) {
|
|
219
222
|
this.selectedTab = tab;
|
|
220
223
|
}
|
|
221
224
|
else {
|
|
225
|
+
// eslint-disable-next-line no-console
|
|
222
226
|
console.warn(`Tab with name '${name}' not found`);
|
|
223
227
|
}
|
|
224
228
|
}
|
|
225
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
226
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
229
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedComponent, deps: [{ token: TheSeamTabbedService }, { token: i2.Router }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
230
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: TheSeamTabbedComponent, isStandalone: true, selector: "seam-tabbed", inputs: { direction: "direction", hideTabs: "hideTabs", onlyRouteContent: "onlyRouteContent", activeTabName: "activeTabName" }, outputs: { tabChanged: "tabChanged" }, providers: [TheSeamTabbedService], queries: [{ propertyName: "tabbedItems", predicate: TheSeamTabbedItemComponent }], ngImport: i0, template: "<div [fxLayout]=\"direction === 'horizontal' ? 'column' : 'row'\" fxFlexFill>\n <!-- Tabs -->\n <div\n *ngIf=\"!hideTabs\"\n [fxLayout]=\"direction === 'horizontal' ? 'row' : 'column'\"\n style=\"position: relative\"\n >\n <ng-container *ngFor=\"let tabbedItem of tabbedItems$ | async\">\n <div\n class=\"tabbed-tab pt-2 pb-2 pl-4 pr-4 bg-light text-nowrap\"\n [class.tab-dir-horizontal]=\"direction === 'horizontal'\"\n [class.tab-dir-vertical]=\"direction === 'vertical'\"\n (click)=\"onClickTab($event, tabbedItem)\"\n [class.active]=\"tabbedItem === (selectedTab$ | async)\"\n >\n <ng-template\n *ngIf=\"tabbedItem.tabbedTabTpl; else tabLabelTpl\"\n [ngTemplateOutlet]=\"tabbedItem.tabbedTabTpl\"\n ></ng-template>\n <ng-template #tabLabelTpl>{{ tabbedItem?.label }}</ng-template>\n </div>\n </ng-container>\n </div>\n\n <!-- Tabs Content -->\n <div class=\"tabbed-tabs-content bg-light\">\n <ng-container *ngIf=\"onlyRouteContent; else notOnlyRouteContent\">\n <router-outlet></router-outlet>\n </ng-container>\n <ng-template #notOnlyRouteContent>\n <ng-container *ngIf=\"selectedTab$ | async as selectedTab\">\n <seam-tabbed-content\n fxFlexFill\n [tabbedItem]=\"selectedTab\"\n ></seam-tabbed-content>\n </ng-container>\n </ng-template>\n </div>\n</div>\n", styles: [":host{display:block}.tabbed-tab{box-sizing:border-box;font-weight:400;font-size:10pt;min-width:130px;transform:translateZ(0);overflow:hidden;border:1px solid #dee2e6}.tabbed-tab:not(.active){background-color:#fff!important}.tabbed-tab.active{font-weight:700;color:#357ebd}.tabbed-tab:hover{cursor:pointer}.tabbed-tab.tab-dir-horizontal{border-bottom:0}.tabbed-tab.tab-dir-horizontal:first-child{border-top-left-radius:.25rem}.tabbed-tab.tab-dir-horizontal:last-child{border-top-right-radius:.25rem}.tabbed-tab.tab-dir-horizontal:not(:last-child){border-right:0}.tabbed-tab.tab-dir-horizontal.active{margin-bottom:-2px}.tabbed-tab.tab-dir-vertical{border-right:0}.tabbed-tab.tab-dir-vertical:first-child{border-top-left-radius:.25rem}.tabbed-tab.tab-dir-vertical:last-child{border-bottom-left-radius:.25rem}.tabbed-tab.tab-dir-vertical:not(:last-child){border-bottom:0}.tabbed-tab.tab-dir-vertical.active{margin-right:-2px}.tabbed-tabs-content{display:block;flex:1 1 auto;overflow:hidden;border:1px solid #dee2e6;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: i3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "component", type: TheSeamTabbedContentComponent, selector: "seam-tabbed-content", inputs: ["tabbedItem"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
|
|
227
231
|
}
|
|
228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedComponent, decorators: [{
|
|
229
233
|
type: Component,
|
|
230
234
|
args: [{ selector: 'seam-tabbed', providers: [TheSeamTabbedService], imports: [
|
|
231
235
|
NgIf,
|
|
@@ -234,7 +238,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
234
238
|
RouterModule,
|
|
235
239
|
FlexLayoutModule,
|
|
236
240
|
TheSeamTabbedContentComponent,
|
|
237
|
-
], template: "<div [fxLayout]=\"
|
|
241
|
+
], template: "<div [fxLayout]=\"direction === 'horizontal' ? 'column' : 'row'\" fxFlexFill>\n <!-- Tabs -->\n <div\n *ngIf=\"!hideTabs\"\n [fxLayout]=\"direction === 'horizontal' ? 'row' : 'column'\"\n style=\"position: relative\"\n >\n <ng-container *ngFor=\"let tabbedItem of tabbedItems$ | async\">\n <div\n class=\"tabbed-tab pt-2 pb-2 pl-4 pr-4 bg-light text-nowrap\"\n [class.tab-dir-horizontal]=\"direction === 'horizontal'\"\n [class.tab-dir-vertical]=\"direction === 'vertical'\"\n (click)=\"onClickTab($event, tabbedItem)\"\n [class.active]=\"tabbedItem === (selectedTab$ | async)\"\n >\n <ng-template\n *ngIf=\"tabbedItem.tabbedTabTpl; else tabLabelTpl\"\n [ngTemplateOutlet]=\"tabbedItem.tabbedTabTpl\"\n ></ng-template>\n <ng-template #tabLabelTpl>{{ tabbedItem?.label }}</ng-template>\n </div>\n </ng-container>\n </div>\n\n <!-- Tabs Content -->\n <div class=\"tabbed-tabs-content bg-light\">\n <ng-container *ngIf=\"onlyRouteContent; else notOnlyRouteContent\">\n <router-outlet></router-outlet>\n </ng-container>\n <ng-template #notOnlyRouteContent>\n <ng-container *ngIf=\"selectedTab$ | async as selectedTab\">\n <seam-tabbed-content\n fxFlexFill\n [tabbedItem]=\"selectedTab\"\n ></seam-tabbed-content>\n </ng-container>\n </ng-template>\n </div>\n</div>\n", styles: [":host{display:block}.tabbed-tab{box-sizing:border-box;font-weight:400;font-size:10pt;min-width:130px;transform:translateZ(0);overflow:hidden;border:1px solid #dee2e6}.tabbed-tab:not(.active){background-color:#fff!important}.tabbed-tab.active{font-weight:700;color:#357ebd}.tabbed-tab:hover{cursor:pointer}.tabbed-tab.tab-dir-horizontal{border-bottom:0}.tabbed-tab.tab-dir-horizontal:first-child{border-top-left-radius:.25rem}.tabbed-tab.tab-dir-horizontal:last-child{border-top-right-radius:.25rem}.tabbed-tab.tab-dir-horizontal:not(:last-child){border-right:0}.tabbed-tab.tab-dir-horizontal.active{margin-bottom:-2px}.tabbed-tab.tab-dir-vertical{border-right:0}.tabbed-tab.tab-dir-vertical:first-child{border-top-left-radius:.25rem}.tabbed-tab.tab-dir-vertical:last-child{border-bottom-left-radius:.25rem}.tabbed-tab.tab-dir-vertical:not(:last-child){border-bottom:0}.tabbed-tab.tab-dir-vertical.active{margin-right:-2px}.tabbed-tabs-content{display:block;flex:1 1 auto;overflow:hidden;border:1px solid #dee2e6;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}\n"] }]
|
|
238
242
|
}], ctorParameters: () => [{ type: TheSeamTabbedService }, { type: i2.Router }, { type: i2.ActivatedRoute }], propDecorators: { tabbedItems: [{
|
|
239
243
|
type: ContentChildren,
|
|
240
244
|
args: [TheSeamTabbedItemComponent]
|
|
@@ -251,8 +255,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
251
255
|
}] } });
|
|
252
256
|
|
|
253
257
|
class TheSeamTabbedModule {
|
|
254
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
255
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
258
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
259
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedModule, imports: [TheSeamTabbedComponent,
|
|
256
260
|
TheSeamTabbedTabContentDirective,
|
|
257
261
|
TheSeamTabbedTabDirective,
|
|
258
262
|
TheSeamTabbedItemComponent,
|
|
@@ -261,10 +265,10 @@ class TheSeamTabbedModule {
|
|
|
261
265
|
TheSeamTabbedTabDirective,
|
|
262
266
|
TheSeamTabbedItemComponent,
|
|
263
267
|
TheSeamTabbedContentComponent] });
|
|
264
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
268
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedModule, imports: [TheSeamTabbedComponent,
|
|
265
269
|
TheSeamTabbedContentComponent] });
|
|
266
270
|
}
|
|
267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTabbedModule, decorators: [{
|
|
268
272
|
type: NgModule,
|
|
269
273
|
args: [{
|
|
270
274
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theseam-ui-common-tabbed.mjs","sources":["../../../projects/ui-common/tabbed/directives/tabbed-tab-content.directive.ts","../../../projects/ui-common/tabbed/tabbed.service.ts","../../../projects/ui-common/tabbed/directives/tabbed-tab.directive.ts","../../../projects/ui-common/tabbed/tabbed-content/tabbed-content.component.ts","../../../projects/ui-common/tabbed/tabbed-content/tabbed-content.component.html","../../../projects/ui-common/tabbed/tabbed-item/tabbed-item.component.ts","../../../projects/ui-common/tabbed/tabbed-item/tabbed-item.component.html","../../../projects/ui-common/tabbed/tabbed.component.ts","../../../projects/ui-common/tabbed/tabbed.component.html","../../../projects/ui-common/tabbed/tabbed.module.ts","../../../projects/ui-common/tabbed/theseam-ui-common-tabbed.ts"],"sourcesContent":["import { Directive } from '@angular/core'\n\nimport { TheSeamTabbedTabContentAccessor } from '../tabbed-models'\n\n@Directive({\n selector: '[seamTabbedTabContent]',\n exportAs: 'seamTabbedTabContent'\n})\nexport class TheSeamTabbedTabContentDirective implements TheSeamTabbedTabContentAccessor {\n\n public isActive = false\n\n}\n","import { Injectable } from '@angular/core'\n\nimport { TheSeamTabbedComponent } from './tabbed.component'\n\nexport declare type TheSeamTabsDirection = 'horizontal' | 'vertical'\n\n@Injectable()\nexport class TheSeamTabbedService {\n\n private _tabGroups: { [groupName: string]: TheSeamTabbedComponent[] } = {}\n\n public registerTab(tab: TheSeamTabbedComponent, groupName: string) {\n if (!this._tabGroups[groupName]) {\n this._tabGroups[groupName] = []\n }\n\n for (const t of this._tabGroups[groupName]) {\n t.hideTabs = true\n }\n\n this._tabGroups[groupName].push(tab)\n }\n\n public unregisterTab(tab: TheSeamTabbedComponent, groupName: string) {\n if (this._tabGroups[groupName]) {\n this._tabGroups[groupName] = this._tabGroups[groupName].filter(\n t => t !== tab\n )\n\n if (this._tabGroups[groupName].length > 0) {\n this._tabGroups[groupName][this._tabGroups[groupName].length - 1].hideTabs = false\n }\n }\n }\n\n}\n","import { Directive, ElementRef, HostBinding, OnInit } from '@angular/core'\n\nimport { TheSeamTabbedTabAccessor } from '../tabbed-models'\nimport { TheSeamTabbedComponent } from '../tabbed.component'\nimport { TheSeamTabbedService } from '../tabbed.service'\n\n@Directive({\n selector: '[seamTabbedTab]',\n exportAs: 'seamTabbedTab'\n})\nexport class TheSeamTabbedTabDirective implements OnInit, TheSeamTabbedTabAccessor {\n\n // @HostBinding('class.custom-invalid')\n // get customInvalid() { return this.control.invalid }\n\n public isActive = false\n\n constructor(\n public elementRef: ElementRef,\n // public host: TheSeamTabbedComponent,\n public tabbedService: TheSeamTabbedService\n ) { }\n\n // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method\n ngOnInit() {\n // this.tabbedService.selectedTab.subscribe(tab => {\n // console.log('tab: ', tab)\n // console.log('tab.tabbedTabTpl.elementRef: ', tab.tabbedTabTpl.elementRef)\n // console.log('this.elementRef: ', this.elementRef)\n // if (tab.tabbedTabTpl.elementRef.na === this.elementRef) {\n // this.isActive = true\n // } else {\n // this.isActive = false\n // }\n // })\n }\n\n}\n","import { Component, Input } from '@angular/core'\nimport { NgIf, NgTemplateOutlet } from '@angular/common'\nimport { RouterModule } from '@angular/router'\nimport { FlexLayoutModule } from '@angular/flex-layout'\n\nimport { TheSeamTabbedItemAccessor } from '../tabbed-models'\n\n@Component({\n selector: 'seam-tabbed-content',\n templateUrl: './tabbed-content.component.html',\n styleUrls: ['./tabbed-content.component.scss'],\n imports: [\n NgIf,\n NgTemplateOutlet,\n RouterModule,\n FlexLayoutModule,\n ],\n})\nexport class TheSeamTabbedContentComponent {\n\n @Input() tabbedItem?: TheSeamTabbedItemAccessor\n\n}\n","<div fxFlexFill>\n <ng-container *ngIf=\"tabbedItem\">\n <ng-template *ngIf=\"tabbedItem.tabbedContentTpl\" [ngTemplateOutlet]=\"tabbedItem.tabbedContentTpl\"></ng-template>\n <ng-container *ngIf=\"tabbedItem.contentFromRoute\"><router-outlet></router-outlet></ng-container>\n </ng-container>\n</div>\n","import { BooleanInput } from '@angular/cdk/coercion'\nimport { Component, ContentChild, Input, TemplateRef } from '@angular/core'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\n\nimport { TheSeamTabbedTabContentDirective } from '../directives/tabbed-tab-content.directive'\nimport { TheSeamTabbedTabDirective } from '../directives/tabbed-tab.directive'\nimport { TheSeamTabbedItemAccessor } from '../tabbed-models'\n\n@Component({\n selector: 'seam-tabbed-item',\n templateUrl: './tabbed-item.component.html',\n styleUrls: ['./tabbed-item.component.scss']\n})\nexport class TheSeamTabbedItemComponent implements TheSeamTabbedItemAccessor {\n static ngAcceptInputType_contentFromRoute: BooleanInput\n\n @ContentChild(TheSeamTabbedTabDirective, { read: TemplateRef, static: true })\n public tabbedTabTpl?: TemplateRef<TheSeamTabbedTabDirective>\n\n @ContentChild(TheSeamTabbedTabContentDirective, { read: TemplateRef, static: true })\n public tabbedContentTpl?: TemplateRef<TheSeamTabbedTabContentDirective>\n\n @Input() name: string | undefined | null\n @Input() label: string | undefined | null\n @Input() @InputBoolean() contentFromRoute = false\n}\n","","import {\n AfterContentInit, Component, ContentChildren, EventEmitter, Input, OnDestroy, OnInit, Output, QueryList\n} from '@angular/core'\nimport { AsyncPipe, NgFor, NgIf } from '@angular/common'\nimport { ActivatedRoute, Router, RouterModule } from '@angular/router'\nimport { FlexLayoutModule } from '@angular/flex-layout'\nimport { BehaviorSubject, combineLatest, shareReplay, tap } from 'rxjs'\n\nimport { isNullOrUndefined } from '@theseam/ui-common/utils'\n\nimport { TheSeamTabbedItemComponent } from './tabbed-item/tabbed-item.component'\nimport { TheSeamTabbedContentComponent } from './tabbed-content/tabbed-content.component'\nimport { TheSeamTabbedService, TheSeamTabsDirection } from './tabbed.service'\n\n@Component({\n selector: 'seam-tabbed',\n templateUrl: './tabbed.component.html',\n styleUrls: ['./tabbed.component.scss'],\n providers: [ TheSeamTabbedService ],\n imports: [\n NgIf,\n NgFor,\n AsyncPipe,\n RouterModule,\n FlexLayoutModule,\n TheSeamTabbedContentComponent,\n ],\n})\nexport class TheSeamTabbedComponent implements OnInit, AfterContentInit, OnDestroy {\n\n private _direction: TheSeamTabsDirection = 'vertical'\n private _hideTabs = false\n\n @ContentChildren(TheSeamTabbedItemComponent)\n set tabbedItems(val: QueryList<TheSeamTabbedItemComponent> | undefined) {\n this._tabbedItems.next(val)\n }\n get tabbedItems(): QueryList<TheSeamTabbedItemComponent> | undefined {\n return this._tabbedItems.value\n }\n private readonly _tabbedItems = new BehaviorSubject<QueryList<TheSeamTabbedItemComponent> | undefined>(undefined)\n public readonly tabbedItems$ = this._tabbedItems.asObservable()\n\n @Output() tabChanged = new EventEmitter<TheSeamTabbedItemComponent>()\n\n @Input()\n set direction(val: TheSeamTabsDirection) {\n this._direction = val\n }\n get direction() {\n return this._direction\n }\n\n @Input()\n set hideTabs(val: boolean) {\n setTimeout(() => {\n this._hideTabs = val\n })\n }\n get hideTabs(): boolean {\n return this._hideTabs\n }\n\n @Input()\n public onlyRouteContent = false\n\n get selectedTab(): TheSeamTabbedItemComponent | undefined {\n if (this.onlyRouteContent) {\n if (this._route.snapshot.children.length > 0) {\n const config = this._route.snapshot.children[0].routeConfig\n const childPath = config && config.path\n return this.tabbedItems?.find(t => t.name === childPath)\n }\n } else {\n return this._selectedTab.value\n }\n }\n set selectedTab(tab: TheSeamTabbedItemComponent | undefined) { this._selectedTab.next(tab) }\n private readonly _selectedTab = new BehaviorSubject<TheSeamTabbedItemComponent | undefined>(undefined)\n public readonly selectedTab$ = this._selectedTab.asObservable().pipe(\n shareReplay({ bufferSize: 1, refCount: true })\n )\n\n @Input()\n set activeTabName(val: string) {\n this._activeTabName.next(val)\n }\n private readonly _activeTabName = new BehaviorSubject<string | undefined>(undefined)\n private readonly activeTabName$ = this._activeTabName.asObservable()\n\n constructor(\n private readonly _tabbedService: TheSeamTabbedService,\n private readonly _router: Router,\n private readonly _route: ActivatedRoute\n ) { }\n\n ngOnInit() {\n this._tabbedService.registerTab(this, 'main')\n }\n\n ngOnDestroy() {\n this._tabbedService.unregisterTab(this, 'main')\n }\n\n ngAfterContentInit() {\n combineLatest([ this.tabbedItems$, this.activeTabName$ ]).pipe(\n tap(([ _, activeTabName ]) => this.selectTab(activeTabName))\n ).subscribe()\n }\n\n /**\n *\n */\n public onClickTab(event: any, tab: TheSeamTabbedItemComponent) {\n this.selectedTab = tab\n if (this.onlyRouteContent) {\n this._router.navigate([ tab.name ], { relativeTo: this._route })\n }\n this.tabChanged.emit(tab)\n }\n\n /**\n * TODO: Make more generic, so that the name isn't the only way\n * to select a tab\n */\n public selectTab(name?: string) {\n if (isNullOrUndefined(name) || name === this.selectedTab?.name) {\n return\n }\n\n const tab = this.tabbedItems?.find(t => t.name === name)\n if (tab) {\n this.selectedTab = tab\n } else {\n console.warn(`Tab with name '${name}' not found`)\n }\n }\n\n}\n","<div [fxLayout]=\"(direction === 'horizontal') ? 'column' : 'row'\" fxFlexFill>\n\n <!-- Tabs -->\n <div *ngIf=\"!hideTabs\"\n [fxLayout]=\"(direction === 'horizontal') ? 'row' : 'column'\"\n style=\"position: relative;\">\n <ng-container *ngFor=\"let tabbedItem of tabbedItems$ | async\">\n <div class=\"tabbed-tab pt-2 pb-2 pl-4 pr-4 bg-light text-nowrap\"\n [class.tab-dir-horizontal]=\"direction === 'horizontal'\"\n [class.tab-dir-vertical]=\"direction === 'vertical'\"\n (click)=\"onClickTab($event, tabbedItem)\"\n [class.active]=\"tabbedItem === (selectedTab$ | async)\">\n <ng-template *ngIf=\"tabbedItem.tabbedTabTpl; else tabLabelTpl\" [ngTemplateOutlet]=\"tabbedItem.tabbedTabTpl\"></ng-template>\n <ng-template #tabLabelTpl>{{ tabbedItem?.label }}</ng-template>\n </div>\n </ng-container>\n </div>\n\n <!-- Tabs Content -->\n <div class=\"tabbed-tabs-content bg-light\">\n <ng-container *ngIf=\"onlyRouteContent; else notOnlyRouteContent\">\n <router-outlet></router-outlet>\n </ng-container>\n <ng-template #notOnlyRouteContent>\n <ng-container *ngIf=\"selectedTab$ | async as selectedTab\">\n <seam-tabbed-content fxFlexFill [tabbedItem]=\"selectedTab\"></seam-tabbed-content>\n </ng-container>\n </ng-template>\n </div>\n\n</div>\n","import { NgModule } from '@angular/core'\n\nimport { TheSeamTabbedTabContentDirective } from './directives/tabbed-tab-content.directive'\nimport { TheSeamTabbedTabDirective } from './directives/tabbed-tab.directive'\nimport { TheSeamTabbedContentComponent } from './tabbed-content/tabbed-content.component'\nimport { TheSeamTabbedItemComponent } from './tabbed-item/tabbed-item.component'\nimport { TheSeamTabbedComponent } from './tabbed.component'\n\n@NgModule({\n imports: [\n TheSeamTabbedComponent,\n TheSeamTabbedTabContentDirective,\n TheSeamTabbedTabDirective,\n TheSeamTabbedItemComponent,\n TheSeamTabbedContentComponent,\n ],\n exports: [\n TheSeamTabbedComponent,\n TheSeamTabbedTabContentDirective,\n TheSeamTabbedTabDirective,\n TheSeamTabbedItemComponent,\n TheSeamTabbedContentComponent,\n ],\n})\nexport class TheSeamTabbedModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.TheSeamTabbedService","i1","i2"],"mappings":";;;;;;;;;;;;MAQa,gCAAgC,CAAA;IAEpC,QAAQ,GAAG,KAAK;uGAFZ,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhC,gCAAgC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAhC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAJ5C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AA,CAAA;sBADZ;gBASG,QAAQ,EAAA,CAAA;sBADX;gBAWM,gBAAgB,EAAA,CAAA;sBADtB;gBAqBG,aAAa,EAAA,CAAA;sBADhB;;;ME3DU,mBAAmB,CAAA;uGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAd5B,sBAAsB;YACtB,gCAAgC;YAChC,yBAAyB;YACzB,0BAA0B;AAC1B,YAAA,6BAA6B,aAG7B,sBAAsB;YACtB,gCAAgC;YAChC,yBAAyB;YACzB,0BAA0B;YAC1B,6BAA6B,CAAA,EAAA,CAAA;AAGpB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAd5B,sBAAsB;YAItB,6BAA6B,CAAA,EAAA,CAAA;;2FAUpB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAhB/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,sBAAsB;wBACtB,gCAAgC;wBAChC,yBAAyB;wBACzB,0BAA0B;wBAC1B,6BAA6B;AAC9B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,sBAAsB;wBACtB,gCAAgC;wBAChC,yBAAyB;wBACzB,0BAA0B;wBAC1B,6BAA6B;AAC9B,qBAAA;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-tabbed.mjs","sources":["../../../projects/ui-common/tabbed/directives/tabbed-tab-content.directive.ts","../../../projects/ui-common/tabbed/tabbed.service.ts","../../../projects/ui-common/tabbed/directives/tabbed-tab.directive.ts","../../../projects/ui-common/tabbed/tabbed-content/tabbed-content.component.ts","../../../projects/ui-common/tabbed/tabbed-content/tabbed-content.component.html","../../../projects/ui-common/tabbed/tabbed-item/tabbed-item.component.ts","../../../projects/ui-common/tabbed/tabbed-item/tabbed-item.component.html","../../../projects/ui-common/tabbed/tabbed.component.ts","../../../projects/ui-common/tabbed/tabbed.component.html","../../../projects/ui-common/tabbed/tabbed.module.ts","../../../projects/ui-common/tabbed/theseam-ui-common-tabbed.ts"],"sourcesContent":["import { Directive } from '@angular/core'\n\nimport { TheSeamTabbedTabContentAccessor } from '../tabbed-models'\n\n@Directive({\n selector: '[seamTabbedTabContent]',\n exportAs: 'seamTabbedTabContent',\n})\nexport class TheSeamTabbedTabContentDirective\n implements TheSeamTabbedTabContentAccessor\n{\n public isActive = false\n}\n","import { Injectable } from '@angular/core'\n\nimport { TheSeamTabbedComponent } from './tabbed.component'\n\nexport declare type TheSeamTabsDirection = 'horizontal' | 'vertical'\n\n@Injectable()\nexport class TheSeamTabbedService {\n private _tabGroups: { [groupName: string]: TheSeamTabbedComponent[] } = {}\n\n public registerTab(tab: TheSeamTabbedComponent, groupName: string) {\n if (!this._tabGroups[groupName]) {\n this._tabGroups[groupName] = []\n }\n\n for (const t of this._tabGroups[groupName]) {\n t.hideTabs = true\n }\n\n this._tabGroups[groupName].push(tab)\n }\n\n public unregisterTab(tab: TheSeamTabbedComponent, groupName: string) {\n if (this._tabGroups[groupName]) {\n this._tabGroups[groupName] = this._tabGroups[groupName].filter(\n (t) => t !== tab,\n )\n\n if (this._tabGroups[groupName].length > 0) {\n this._tabGroups[groupName][\n this._tabGroups[groupName].length - 1\n ].hideTabs = false\n }\n }\n }\n}\n","import { Directive, ElementRef, HostBinding, OnInit } from '@angular/core'\n\nimport { TheSeamTabbedTabAccessor } from '../tabbed-models'\nimport { TheSeamTabbedComponent } from '../tabbed.component'\nimport { TheSeamTabbedService } from '../tabbed.service'\n\n@Directive({\n selector: '[seamTabbedTab]',\n exportAs: 'seamTabbedTab',\n})\nexport class TheSeamTabbedTabDirective\n implements OnInit, TheSeamTabbedTabAccessor\n{\n // @HostBinding('class.custom-invalid')\n // get customInvalid() { return this.control.invalid }\n\n public isActive = false\n\n constructor(\n public elementRef: ElementRef,\n // public host: TheSeamTabbedComponent,\n public tabbedService: TheSeamTabbedService,\n ) {}\n\n ngOnInit() {\n // this.tabbedService.selectedTab.subscribe(tab => {\n // console.log('tab: ', tab)\n // console.log('tab.tabbedTabTpl.elementRef: ', tab.tabbedTabTpl.elementRef)\n // console.log('this.elementRef: ', this.elementRef)\n // if (tab.tabbedTabTpl.elementRef.na === this.elementRef) {\n // this.isActive = true\n // } else {\n // this.isActive = false\n // }\n // })\n }\n}\n","import { Component, Input } from '@angular/core'\nimport { NgIf, NgTemplateOutlet } from '@angular/common'\nimport { RouterModule } from '@angular/router'\nimport { FlexLayoutModule } from '@angular/flex-layout'\n\nimport { TheSeamTabbedItemAccessor } from '../tabbed-models'\n\n@Component({\n selector: 'seam-tabbed-content',\n templateUrl: './tabbed-content.component.html',\n styleUrls: ['./tabbed-content.component.scss'],\n imports: [NgIf, NgTemplateOutlet, RouterModule, FlexLayoutModule],\n})\nexport class TheSeamTabbedContentComponent {\n @Input() tabbedItem?: TheSeamTabbedItemAccessor\n}\n","<div fxFlexFill>\n <ng-container *ngIf=\"tabbedItem\">\n <ng-template\n *ngIf=\"tabbedItem.tabbedContentTpl\"\n [ngTemplateOutlet]=\"tabbedItem.tabbedContentTpl\"\n ></ng-template>\n <ng-container *ngIf=\"tabbedItem.contentFromRoute\"\n ><router-outlet></router-outlet\n ></ng-container>\n </ng-container>\n</div>\n","import { BooleanInput } from '@angular/cdk/coercion'\nimport { Component, ContentChild, Input, TemplateRef } from '@angular/core'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\n\nimport { TheSeamTabbedTabContentDirective } from '../directives/tabbed-tab-content.directive'\nimport { TheSeamTabbedTabDirective } from '../directives/tabbed-tab.directive'\nimport { TheSeamTabbedItemAccessor } from '../tabbed-models'\n\n@Component({\n selector: 'seam-tabbed-item',\n templateUrl: './tabbed-item.component.html',\n styleUrls: ['./tabbed-item.component.scss'],\n})\nexport class TheSeamTabbedItemComponent implements TheSeamTabbedItemAccessor {\n static ngAcceptInputType_contentFromRoute: BooleanInput\n\n @ContentChild(TheSeamTabbedTabDirective, { read: TemplateRef, static: true })\n public tabbedTabTpl?: TemplateRef<TheSeamTabbedTabDirective>\n\n @ContentChild(TheSeamTabbedTabContentDirective, {\n read: TemplateRef,\n static: true,\n })\n public tabbedContentTpl?: TemplateRef<TheSeamTabbedTabContentDirective>\n\n @Input() name: string | undefined | null\n @Input() label: string | undefined | null\n @Input() @InputBoolean() contentFromRoute = false\n}\n","","import {\n AfterContentInit,\n Component,\n ContentChildren,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n} from '@angular/core'\nimport { AsyncPipe, NgFor, NgIf } from '@angular/common'\nimport { ActivatedRoute, Router, RouterModule } from '@angular/router'\nimport { FlexLayoutModule } from '@angular/flex-layout'\nimport { BehaviorSubject, combineLatest, shareReplay, tap } from 'rxjs'\n\nimport { isNullOrUndefined } from '@theseam/ui-common/utils'\n\nimport { TheSeamTabbedItemComponent } from './tabbed-item/tabbed-item.component'\nimport { TheSeamTabbedContentComponent } from './tabbed-content/tabbed-content.component'\nimport { TheSeamTabbedService, TheSeamTabsDirection } from './tabbed.service'\n\n@Component({\n selector: 'seam-tabbed',\n templateUrl: './tabbed.component.html',\n styleUrls: ['./tabbed.component.scss'],\n providers: [TheSeamTabbedService],\n imports: [\n NgIf,\n NgFor,\n AsyncPipe,\n RouterModule,\n FlexLayoutModule,\n TheSeamTabbedContentComponent,\n ],\n})\nexport class TheSeamTabbedComponent\n implements OnInit, AfterContentInit, OnDestroy\n{\n private _direction: TheSeamTabsDirection = 'vertical'\n private _hideTabs = false\n\n @ContentChildren(TheSeamTabbedItemComponent)\n set tabbedItems(val: QueryList<TheSeamTabbedItemComponent> | undefined) {\n this._tabbedItems.next(val)\n }\n get tabbedItems(): QueryList<TheSeamTabbedItemComponent> | undefined {\n return this._tabbedItems.value\n }\n private readonly _tabbedItems = new BehaviorSubject<\n QueryList<TheSeamTabbedItemComponent> | undefined\n >(undefined)\n public readonly tabbedItems$ = this._tabbedItems.asObservable()\n\n @Output() tabChanged = new EventEmitter<TheSeamTabbedItemComponent>()\n\n @Input()\n set direction(val: TheSeamTabsDirection) {\n this._direction = val\n }\n get direction() {\n return this._direction\n }\n\n @Input()\n set hideTabs(val: boolean) {\n setTimeout(() => {\n this._hideTabs = val\n })\n }\n get hideTabs(): boolean {\n return this._hideTabs\n }\n\n @Input()\n public onlyRouteContent = false\n\n get selectedTab(): TheSeamTabbedItemComponent | undefined {\n if (this.onlyRouteContent) {\n if (this._route.snapshot.children.length > 0) {\n const config = this._route.snapshot.children[0].routeConfig\n const childPath = config && config.path\n return this.tabbedItems?.find((t) => t.name === childPath)\n }\n } else {\n return this._selectedTab.value\n }\n }\n set selectedTab(tab: TheSeamTabbedItemComponent | undefined) {\n this._selectedTab.next(tab)\n }\n private readonly _selectedTab = new BehaviorSubject<\n TheSeamTabbedItemComponent | undefined\n >(undefined)\n public readonly selectedTab$ = this._selectedTab\n .asObservable()\n .pipe(shareReplay({ bufferSize: 1, refCount: true }))\n\n @Input()\n set activeTabName(val: string) {\n this._activeTabName.next(val)\n }\n private readonly _activeTabName = new BehaviorSubject<string | undefined>(\n undefined,\n )\n private readonly activeTabName$ = this._activeTabName.asObservable()\n\n constructor(\n private readonly _tabbedService: TheSeamTabbedService,\n private readonly _router: Router,\n private readonly _route: ActivatedRoute,\n ) {}\n\n ngOnInit() {\n this._tabbedService.registerTab(this, 'main')\n }\n\n ngOnDestroy() {\n this._tabbedService.unregisterTab(this, 'main')\n }\n\n ngAfterContentInit() {\n combineLatest([this.tabbedItems$, this.activeTabName$])\n .pipe(tap(([_, activeTabName]) => this.selectTab(activeTabName)))\n .subscribe()\n }\n\n /**\n *\n */\n public onClickTab(event: any, tab: TheSeamTabbedItemComponent) {\n this.selectedTab = tab\n if (this.onlyRouteContent) {\n this._router.navigate([tab.name], { relativeTo: this._route })\n }\n this.tabChanged.emit(tab)\n }\n\n /**\n * TODO: Make more generic, so that the name isn't the only way\n * to select a tab\n */\n public selectTab(name?: string) {\n if (isNullOrUndefined(name) || name === this.selectedTab?.name) {\n return\n }\n\n const tab = this.tabbedItems?.find((t) => t.name === name)\n if (tab) {\n this.selectedTab = tab\n } else {\n // eslint-disable-next-line no-console\n console.warn(`Tab with name '${name}' not found`)\n }\n }\n}\n","<div [fxLayout]=\"direction === 'horizontal' ? 'column' : 'row'\" fxFlexFill>\n <!-- Tabs -->\n <div\n *ngIf=\"!hideTabs\"\n [fxLayout]=\"direction === 'horizontal' ? 'row' : 'column'\"\n style=\"position: relative\"\n >\n <ng-container *ngFor=\"let tabbedItem of tabbedItems$ | async\">\n <div\n class=\"tabbed-tab pt-2 pb-2 pl-4 pr-4 bg-light text-nowrap\"\n [class.tab-dir-horizontal]=\"direction === 'horizontal'\"\n [class.tab-dir-vertical]=\"direction === 'vertical'\"\n (click)=\"onClickTab($event, tabbedItem)\"\n [class.active]=\"tabbedItem === (selectedTab$ | async)\"\n >\n <ng-template\n *ngIf=\"tabbedItem.tabbedTabTpl; else tabLabelTpl\"\n [ngTemplateOutlet]=\"tabbedItem.tabbedTabTpl\"\n ></ng-template>\n <ng-template #tabLabelTpl>{{ tabbedItem?.label }}</ng-template>\n </div>\n </ng-container>\n </div>\n\n <!-- Tabs Content -->\n <div class=\"tabbed-tabs-content bg-light\">\n <ng-container *ngIf=\"onlyRouteContent; else notOnlyRouteContent\">\n <router-outlet></router-outlet>\n </ng-container>\n <ng-template #notOnlyRouteContent>\n <ng-container *ngIf=\"selectedTab$ | async as selectedTab\">\n <seam-tabbed-content\n fxFlexFill\n [tabbedItem]=\"selectedTab\"\n ></seam-tabbed-content>\n </ng-container>\n </ng-template>\n </div>\n</div>\n","import { NgModule } from '@angular/core'\n\nimport { TheSeamTabbedTabContentDirective } from './directives/tabbed-tab-content.directive'\nimport { TheSeamTabbedTabDirective } from './directives/tabbed-tab.directive'\nimport { TheSeamTabbedContentComponent } from './tabbed-content/tabbed-content.component'\nimport { TheSeamTabbedItemComponent } from './tabbed-item/tabbed-item.component'\nimport { TheSeamTabbedComponent } from './tabbed.component'\n\n@NgModule({\n imports: [\n TheSeamTabbedComponent,\n TheSeamTabbedTabContentDirective,\n TheSeamTabbedTabDirective,\n TheSeamTabbedItemComponent,\n TheSeamTabbedContentComponent,\n ],\n exports: [\n TheSeamTabbedComponent,\n TheSeamTabbedTabContentDirective,\n TheSeamTabbedTabDirective,\n TheSeamTabbedItemComponent,\n TheSeamTabbedContentComponent,\n ],\n})\nexport class TheSeamTabbedModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.TheSeamTabbedService","i1","i2"],"mappings":";;;;;;;;;;;;MAQa,gCAAgC,CAAA;IAGpC,QAAQ,GAAG,KAAK;uGAHZ,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhC,gCAAgC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAhC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAJ5C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA;;;MCAY,oBAAoB,CAAA;IACvB,UAAU,GAAsD,EAAE;IAEnE,WAAW,CAAC,GAA2B,EAAE,SAAiB,EAAA;QAC/D,IAAI,CAAC,IAAI,CAAC,UAAU,CA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BAA6B,CAAA,EAAA,CAAA;AAGpB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAd5B,sBAAsB;YAItB,6BAA6B,CAAA,EAAA,CAAA;;2FAUpB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAhB/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,sBAAsB;wBACtB,gCAAgC;wBAChC,yBAAyB;wBACzB,0BAA0B;wBAC1B,6BAA6B;AAC9B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,sBAAsB;wBACtB,gCAAgC;wBAChC,yBAAyB;wBACzB,0BAA0B;wBAC1B,6BAA6B;AAC9B,qBAAA;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -40,7 +40,7 @@ class TableCellTypeSelectorComponent {
|
|
|
40
40
|
rowIndex: this.rowIndex ?? -1,
|
|
41
41
|
colData: this.colData ?? {},
|
|
42
42
|
value: this.value,
|
|
43
|
-
changed: this._dataChangeSubject.asObservable()
|
|
43
|
+
changed: this._dataChangeSubject.asObservable(),
|
|
44
44
|
};
|
|
45
45
|
this.componentPortal = new ComponentPortal(comp, null, this._createInjector(this._data));
|
|
46
46
|
this._ref.detectChanges();
|
|
@@ -55,13 +55,14 @@ class TableCellTypeSelectorComponent {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
_getComponent(name) {
|
|
58
|
-
const manifest = this._manifests.find(m => m.name === name);
|
|
58
|
+
const manifest = this._manifests.find((m) => m.name === name);
|
|
59
59
|
return manifest ? manifest.component : undefined;
|
|
60
60
|
}
|
|
61
61
|
_createInjector(cellData) {
|
|
62
|
-
return Injector.create({
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
return Injector.create({
|
|
63
|
+
parent: this._injector,
|
|
64
|
+
providers: [{ provide: TABLE_CELL_DATA, useValue: cellData }],
|
|
65
|
+
});
|
|
65
66
|
}
|
|
66
67
|
ngOnChanges(changes) {
|
|
67
68
|
if (this._data) {
|
|
@@ -69,12 +70,12 @@ class TableCellTypeSelectorComponent {
|
|
|
69
70
|
this._tryUpdateDataProp(changes, 'row'),
|
|
70
71
|
this._tryUpdateDataProp(changes, 'rowIndex'),
|
|
71
72
|
this._tryUpdateDataProp(changes, 'colData'),
|
|
72
|
-
this._tryUpdateDataProp(changes, 'value')
|
|
73
|
-
].findIndex(b => b === true) !== -1;
|
|
73
|
+
this._tryUpdateDataProp(changes, 'value'),
|
|
74
|
+
].findIndex((b) => b === true) !== -1;
|
|
74
75
|
if (dataChanged && this._dataChangeSubject) {
|
|
75
76
|
this._dataChangeSubject.next({
|
|
76
77
|
data: this._data,
|
|
77
|
-
changes
|
|
78
|
+
changes,
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -86,16 +87,22 @@ class TableCellTypeSelectorComponent {
|
|
|
86
87
|
}
|
|
87
88
|
return false;
|
|
88
89
|
}
|
|
89
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
90
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
91
|
-
<ng-template
|
|
90
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TableCellTypeSelectorComponent, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }, { token: TABLE_CELL_TYPE_MANIFEST, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
91
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: TableCellTypeSelectorComponent, isStandalone: false, selector: "seam-table-cell-type-selector", inputs: { type: "type", value: "value", rowIndex: "rowIndex", row: "row", colData: "colData" }, usesOnChanges: true, ngImport: i0, template: `
|
|
92
|
+
<ng-template
|
|
93
|
+
*ngIf="componentPortal; else noPortal"
|
|
94
|
+
[cdkPortalOutlet]="componentPortal"
|
|
95
|
+
></ng-template>
|
|
92
96
|
<ng-template #noPortal>{{ value }}</ng-template>
|
|
93
97
|
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
94
98
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TableCellTypeSelectorComponent, decorators: [{
|
|
96
100
|
type: Component,
|
|
97
101
|
args: [{ selector: 'seam-table-cell-type-selector', template: `
|
|
98
|
-
<ng-template
|
|
102
|
+
<ng-template
|
|
103
|
+
*ngIf="componentPortal; else noPortal"
|
|
104
|
+
[cdkPortalOutlet]="componentPortal"
|
|
105
|
+
></ng-template>
|
|
99
106
|
<ng-template #noPortal>{{ value }}</ng-template>
|
|
100
107
|
`, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false }]
|
|
101
108
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
@@ -131,7 +138,7 @@ class TableCellTypesHelpersService {
|
|
|
131
138
|
row: data && data.row,
|
|
132
139
|
rowIndex: data && data.rowIndex,
|
|
133
140
|
colData: data && data.colData,
|
|
134
|
-
value
|
|
141
|
+
value,
|
|
135
142
|
};
|
|
136
143
|
}
|
|
137
144
|
_resolveValueContext(contextOrContextFn) {
|
|
@@ -151,13 +158,11 @@ class TableCellTypesHelpersService {
|
|
|
151
158
|
// Used to stop observing.
|
|
152
159
|
const stopSubject = new Subject();
|
|
153
160
|
// Observe results to emit to subscriber.
|
|
154
|
-
resultSubject
|
|
155
|
-
.pipe(takeUntil(stopSubject))
|
|
156
|
-
.subscribe(result => subscriber.next(result), err => subscriber.error(err), () => stopSubject.complete());
|
|
161
|
+
resultSubject.pipe(takeUntil(stopSubject)).subscribe((result) => subscriber.next(result), (err) => subscriber.error(err), () => stopSubject.complete());
|
|
157
162
|
// Handle the potentially deep chain of actions.
|
|
158
163
|
this._handleModalAction(action, contextOrContextFn, resultSubject)
|
|
159
164
|
.pipe(takeUntil(stopSubject))
|
|
160
|
-
.subscribe(() => { }, err => subscriber.error(err), () => subscriber.complete());
|
|
165
|
+
.subscribe(() => { }, (err) => subscriber.error(err), () => subscriber.complete());
|
|
161
166
|
// Clean up on unsubscribe.
|
|
162
167
|
return () => {
|
|
163
168
|
stopSubject.next(undefined);
|
|
@@ -169,37 +174,28 @@ class TableCellTypesHelpersService {
|
|
|
169
174
|
const context = this._resolveValueContext(contextOrContextFn);
|
|
170
175
|
return from(this._dynamicActionHelper.exec(action, context));
|
|
171
176
|
}
|
|
172
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
173
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TableCellTypesHelpersService, deps: [{ token: i1$1.DynamicActionHelperService }, { token: i1$1.DynamicValueHelperService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
178
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TableCellTypesHelpersService, providedIn: 'root' });
|
|
174
179
|
}
|
|
175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TableCellTypesHelpersService, decorators: [{
|
|
176
181
|
type: Injectable,
|
|
177
182
|
args: [{
|
|
178
|
-
providedIn: 'root'
|
|
183
|
+
providedIn: 'root',
|
|
179
184
|
}]
|
|
180
185
|
}], ctorParameters: () => [{ type: i1$1.DynamicActionHelperService }, { type: i1$1.DynamicValueHelperService }] });
|
|
181
186
|
|
|
182
187
|
class TheSeamTableCellTypeModule {
|
|
183
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
184
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
185
|
-
|
|
186
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: TheSeamTableCellTypeModule, imports: [CommonModule,
|
|
187
|
-
PortalModule] });
|
|
188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTableCellTypeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
189
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTableCellTypeModule, declarations: [TableCellTypeSelectorComponent], imports: [CommonModule, PortalModule], exports: [TableCellTypeSelectorComponent] });
|
|
190
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTableCellTypeModule, imports: [CommonModule, PortalModule] });
|
|
188
191
|
}
|
|
189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamTableCellTypeModule, decorators: [{
|
|
190
193
|
type: NgModule,
|
|
191
194
|
args: [{
|
|
192
|
-
declarations: [
|
|
193
|
-
|
|
194
|
-
],
|
|
195
|
-
imports: [
|
|
196
|
-
CommonModule,
|
|
197
|
-
PortalModule
|
|
198
|
-
],
|
|
195
|
+
declarations: [TableCellTypeSelectorComponent],
|
|
196
|
+
imports: [CommonModule, PortalModule],
|
|
199
197
|
providers: [],
|
|
200
|
-
exports: [
|
|
201
|
-
TableCellTypeSelectorComponent
|
|
202
|
-
]
|
|
198
|
+
exports: [TableCellTypeSelectorComponent],
|
|
203
199
|
}]
|
|
204
200
|
}] });
|
|
205
201
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theseam-ui-common-table-cell-type.mjs","sources":["../../../projects/ui-common/table-cell-type/table-cell-type-tokens.ts","../../../projects/ui-common/table-cell-type/table-cell-type-selector.component.ts","../../../projects/ui-common/table-cell-type/services/table-cell-types-helpers.service.ts","../../../projects/ui-common/table-cell-type/table-cell-type.module.ts","../../../projects/ui-common/table-cell-type/theseam-ui-common-table-cell-type.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\n\nimport { ITableCellTypeManifest, TableCellData } from './table-cell-type-models'\n\nexport const TABLE_CELL_TYPE_MANIFEST = new InjectionToken<ITableCellTypeManifest>('TABLE_CELL_TYPE_MANIFEST')\n\nexport const TABLE_CELL_DATA = new InjectionToken<TableCellData<any, any>>('TABLE_CELL_DATA')\n","import { ComponentPortal } from '@angular/cdk/portal'\nimport { ComponentType } from '@angular/cdk/portal'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Inject,\n Injector,\n Input,\n isDevMode,\n OnChanges,\n Optional,\n SimpleChanges\n} from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { TableCellTypeConfig } from './table-cell-type-config'\nimport type { TheSeamTableColumn } from './table-cell-type-models'\nimport { ITableCellTypeManifest, TableCellData, TableCellDataChange } from './table-cell-type-models'\nimport { TABLE_CELL_DATA, TABLE_CELL_TYPE_MANIFEST } from './table-cell-type-tokens'\n\n@Component({\n selector: 'seam-table-cell-type-selector',\n template: `\n <ng-template *ngIf=\"componentPortal; else noPortal\" [cdkPortalOutlet]=\"componentPortal\"></ng-template>\n <ng-template #noPortal>{{ value }}</ng-template>\n `,\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class TableCellTypeSelectorComponent<T extends string = any, D = any, V = any> implements AfterViewInit, OnChanges {\n\n @Input() type: T | undefined | null\n @Input() value: V | undefined | null\n @Input() rowIndex: number | undefined | null\n @Input() row: D | undefined | null\n @Input() colData: TheSeamTableColumn<T, TableCellTypeConfig<T>> | undefined | null\n\n public componentPortal?: ComponentPortal<unknown>\n\n private _data: TableCellData<T, TableCellTypeConfig<T>> | undefined\n private _dataChangeSubject?: Subject<TableCellDataChange<T, TableCellTypeConfig<T>>>\n private _manifests: ITableCellTypeManifest[]\n\n constructor(\n private _injector: Injector,\n private _ref: ChangeDetectorRef,\n @Optional() @Inject(TABLE_CELL_TYPE_MANIFEST) manifests?: ITableCellTypeManifest[]\n ) { this._manifests = manifests || [] }\n\n ngAfterViewInit() {\n if (!this.type) {\n return\n }\n\n const comp = this._getComponent(this.type)\n if (comp) {\n this._dataChangeSubject = new Subject<TableCellDataChange<T, TableCellTypeConfig<T>>>()\n\n this._data = {\n row: this.row,\n rowIndex: this.rowIndex ?? -1,\n colData: this.colData ?? {},\n value: this.value,\n changed: this._dataChangeSubject.asObservable()\n }\n\n this.componentPortal = new ComponentPortal(comp, null, this._createInjector(this._data))\n this._ref.detectChanges()\n } else {\n if (isDevMode()) {\n throw new Error(`CellType '${this.type}' not found.`)\n } else {\n // TODO: Implement fallback\n }\n }\n }\n\n private _getComponent(name: string): ComponentType<unknown> | undefined {\n const manifest = this._manifests.find(m => m.name === name)\n return manifest ? manifest.component : undefined\n }\n\n private _createInjector(cellData: TableCellData<T, TableCellTypeConfig<T>>): Injector {\n return Injector.create({ parent: this._injector, providers: [\n { provide: TABLE_CELL_DATA, useValue: cellData },\n ] })\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this._data) {\n const dataChanged = [\n this._tryUpdateDataProp(changes, 'row'),\n this._tryUpdateDataProp(changes, 'rowIndex'),\n this._tryUpdateDataProp(changes, 'colData'),\n this._tryUpdateDataProp(changes, 'value')\n ].findIndex(b => b === true) !== -1\n\n if (dataChanged && this._dataChangeSubject) {\n this._dataChangeSubject.next({\n data: this._data,\n changes\n })\n }\n }\n }\n\n private _tryUpdateDataProp(changes: SimpleChanges, prop: keyof Omit<TableCellData<T, TableCellTypeConfig<T>>, 'changed'>): boolean {\n if (this._data && Object.prototype.hasOwnProperty.call(changes, prop)) {\n this._data[prop] = changes[prop].currentValue\n return true\n }\n return false\n }\n\n}\n","import { Injectable } from '@angular/core'\nimport { from, Observable, Subject, Subscriber } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\n\nimport { DynamicActionHelperService, DynamicActionModalDef, DynamicValueHelperService } from '@theseam/ui-common/dynamic'\n\nimport { TableCellTypeConfig } from '../table-cell-type-config'\nimport { CaluclatedValueContextType, ICalucatedValueContext, TableCellData } from '../table-cell-type-models'\nimport { TableCellTypeName } from '../table-cell-type-name'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TableCellTypesHelpersService {\n\n constructor(\n private _dynamicActionHelper: DynamicActionHelperService,\n private _valueHelper: DynamicValueHelperService\n ) { }\n\n public parseValueProp(value: any, contextOrContextFn: CaluclatedValueContextType) {\n const context = this._resolveValueContext(contextOrContextFn)\n return this._valueHelper.evalSync(value, context)\n }\n\n public getValueContext<T extends TableCellTypeName>(value: any, data?: TableCellData<T, TableCellTypeConfig<T>>): ICalucatedValueContext {\n return {\n row: data && data.row,\n rowIndex: data && data.rowIndex,\n colData: data && data.colData,\n value\n }\n }\n\n private _resolveValueContext(contextOrContextFn: CaluclatedValueContextType) {\n let context = contextOrContextFn\n if (typeof context === 'function') {\n context = context()\n }\n return context\n }\n\n public handleModalAction<R = any>(\n action: DynamicActionModalDef,\n contextOrContextFn: CaluclatedValueContextType\n ) {\n // TODO: Try to simplify this observable. It seems fairly easy to read like\n // this, but seems like it is doing more than it needs to with the multiple\n // subjects.\n return new Observable((subscriber: Subscriber<R>) => {\n // Passed to helper function to emit results to subscriber.\n const resultSubject = new Subject<any>()\n // Used to stop observing.\n const stopSubject = new Subject<any>()\n\n // Observe results to emit to subscriber.\n resultSubject\n .pipe(takeUntil(stopSubject))\n .subscribe(\n result => subscriber.next(result),\n err => subscriber.error(err),\n () => stopSubject.complete()\n )\n\n // Handle the potentially deep chain of actions.\n this._handleModalAction(action, contextOrContextFn, resultSubject)\n .pipe(takeUntil(stopSubject))\n .subscribe(\n () => {},\n err => subscriber.error(err),\n () => subscriber.complete()\n )\n\n // Clean up on unsubscribe.\n return () => {\n stopSubject.next(undefined)\n stopSubject.complete()\n }\n })\n }\n\n private _handleModalAction(\n action: DynamicActionModalDef,\n contextOrContextFn: CaluclatedValueContextType,\n resultSubject: Subject<any>\n ) {\n const context = this._resolveValueContext(contextOrContextFn)\n return from(this._dynamicActionHelper.exec(action, context))\n }\n}\n","import { PortalModule } from '@angular/cdk/portal'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { TableCellTypeSelectorComponent } from './table-cell-type-selector.component'\n\n@NgModule({\n declarations: [\n TableCellTypeSelectorComponent\n ],\n imports: [\n CommonModule,\n PortalModule\n ],\n providers: [],\n exports: [\n TableCellTypeSelectorComponent\n ]\n})\nexport class TheSeamTableCellTypeModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;MAIa,wBAAwB,GAAG,IAAI,cAAc,CAAyB,0BAA0B;MAEhG,eAAe,GAAG,IAAI,cAAc,CAA0B,iBAAiB;;MC0B/E,8BAA8B,CAAA;AAe/B,IAAA,SAAA;AACA,IAAA,IAAA;AAdD,IAAA,IAAI;AACJ,IAAA,KAAK;AACL,IAAA,QAAQ;AACR,IAAA,GAAG;AACH,IAAA,OAAO;AAET,IAAA,eAAe;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AA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAA5B,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cAF3B,MAAM,EAAA,CAAA;;2FAEP,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAHxC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;MCOY,0BAA0B,CAAA;uGAA1B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAA1B,0BAA0B,EAAA,YAAA,EAAA,CAX/B,8BAA8B,CAAA,EAAA,OAAA,EAAA,CAG9B,YAAY;AACZ,YAAA,YAAY,aAIZ,8BAA8B,CAAA,EAAA,CAAA;AAGzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,YAR/B,YAAY;YACZ,YAAY,CAAA,EAAA,CAAA;;2FAOP,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAbtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE;wBACV;AACH,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ;AACH,qBAAA;AACD,oBAAA,SAAS,EAAE,EAAE;AACb,oBAAA,OAAO,EAAE;wBACL;AACH;AACJ,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-table-cell-type.mjs","sources":["../../../projects/ui-common/table-cell-type/table-cell-type-tokens.ts","../../../projects/ui-common/table-cell-type/table-cell-type-selector.component.ts","../../../projects/ui-common/table-cell-type/services/table-cell-types-helpers.service.ts","../../../projects/ui-common/table-cell-type/table-cell-type.module.ts","../../../projects/ui-common/table-cell-type/theseam-ui-common-table-cell-type.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\n\nimport { ITableCellTypeManifest, TableCellData } from './table-cell-type-models'\n\nexport const TABLE_CELL_TYPE_MANIFEST =\n new InjectionToken<ITableCellTypeManifest>('TABLE_CELL_TYPE_MANIFEST')\n\nexport const TABLE_CELL_DATA = new InjectionToken<TableCellData<any, any>>(\n 'TABLE_CELL_DATA',\n)\n","import { ComponentPortal } from '@angular/cdk/portal'\nimport { ComponentType } from '@angular/cdk/portal'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Inject,\n Injector,\n Input,\n isDevMode,\n OnChanges,\n Optional,\n SimpleChanges,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { TableCellTypeConfig } from './table-cell-type-config'\nimport type { TheSeamTableColumn } from './table-cell-type-models'\nimport {\n ITableCellTypeManifest,\n TableCellData,\n TableCellDataChange,\n} from './table-cell-type-models'\nimport {\n TABLE_CELL_DATA,\n TABLE_CELL_TYPE_MANIFEST,\n} from './table-cell-type-tokens'\n\n@Component({\n selector: 'seam-table-cell-type-selector',\n template: `\n <ng-template\n *ngIf=\"componentPortal; else noPortal\"\n [cdkPortalOutlet]=\"componentPortal\"\n ></ng-template>\n <ng-template #noPortal>{{ value }}</ng-template>\n `,\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class TableCellTypeSelectorComponent<\n T extends string = any,\n D = any,\n V = any,\n >\n implements AfterViewInit, OnChanges\n{\n @Input() type: T | undefined | null\n @Input() value: V | undefined | null\n @Input() rowIndex: number | undefined | null\n @Input() row: D | undefined | null\n @Input() colData:\n | TheSeamTableColumn<T, TableCellTypeConfig<T>>\n | undefined\n | null\n\n public componentPortal?: ComponentPortal<unknown>\n\n private _data: TableCellData<T, TableCellTypeConfig<T>> | undefined\n private _dataChangeSubject?: Subject<\n TableCellDataChange<T, TableCellTypeConfig<T>>\n >\n private _manifests: ITableCellTypeManifest[]\n\n constructor(\n private _injector: Injector,\n private _ref: ChangeDetectorRef,\n @Optional()\n @Inject(TABLE_CELL_TYPE_MANIFEST)\n manifests?: ITableCellTypeManifest[],\n ) {\n this._manifests = manifests || []\n }\n\n ngAfterViewInit() {\n if (!this.type) {\n return\n }\n\n const comp = this._getComponent(this.type)\n if (comp) {\n this._dataChangeSubject = new Subject<\n TableCellDataChange<T, TableCellTypeConfig<T>>\n >()\n\n this._data = {\n row: this.row,\n rowIndex: this.rowIndex ?? -1,\n colData: this.colData ?? {},\n value: this.value,\n changed: this._dataChangeSubject.asObservable(),\n }\n\n this.componentPortal = new ComponentPortal(\n comp,\n null,\n this._createInjector(this._data),\n )\n this._ref.detectChanges()\n } else {\n if (isDevMode()) {\n throw new Error(`CellType '${this.type}' not found.`)\n } else {\n // TODO: Implement fallback\n }\n }\n }\n\n private _getComponent(name: string): ComponentType<unknown> | undefined {\n const manifest = this._manifests.find((m) => m.name === name)\n return manifest ? manifest.component : undefined\n }\n\n private _createInjector(\n cellData: TableCellData<T, TableCellTypeConfig<T>>,\n ): Injector {\n return Injector.create({\n parent: this._injector,\n providers: [{ provide: TABLE_CELL_DATA, useValue: cellData }],\n })\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this._data) {\n const dataChanged =\n [\n this._tryUpdateDataProp(changes, 'row'),\n this._tryUpdateDataProp(changes, 'rowIndex'),\n this._tryUpdateDataProp(changes, 'colData'),\n this._tryUpdateDataProp(changes, 'value'),\n ].findIndex((b) => b === true) !== -1\n\n if (dataChanged && this._dataChangeSubject) {\n this._dataChangeSubject.next({\n data: this._data,\n changes,\n })\n }\n }\n }\n\n private _tryUpdateDataProp(\n changes: SimpleChanges,\n prop: keyof Omit<TableCellData<T, TableCellTypeConfig<T>>, 'changed'>,\n ): boolean {\n if (this._data && Object.prototype.hasOwnProperty.call(changes, prop)) {\n this._data[prop] = changes[prop].currentValue\n return true\n }\n return false\n }\n}\n","import { Injectable } from '@angular/core'\nimport { from, Observable, Subject, Subscriber } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\n\nimport {\n DynamicActionHelperService,\n DynamicActionModalDef,\n DynamicValueHelperService,\n} from '@theseam/ui-common/dynamic'\n\nimport { TableCellTypeConfig } from '../table-cell-type-config'\nimport {\n CaluclatedValueContextType,\n ICalucatedValueContext,\n TableCellData,\n} from '../table-cell-type-models'\nimport { TableCellTypeName } from '../table-cell-type-name'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TableCellTypesHelpersService {\n constructor(\n private _dynamicActionHelper: DynamicActionHelperService,\n private _valueHelper: DynamicValueHelperService,\n ) {}\n\n public parseValueProp(\n value: any,\n contextOrContextFn: CaluclatedValueContextType,\n ) {\n const context = this._resolveValueContext(contextOrContextFn)\n return this._valueHelper.evalSync(value, context)\n }\n\n public getValueContext<T extends TableCellTypeName>(\n value: any,\n data?: TableCellData<T, TableCellTypeConfig<T>>,\n ): ICalucatedValueContext {\n return {\n row: data && data.row,\n rowIndex: data && data.rowIndex,\n colData: data && data.colData,\n value,\n }\n }\n\n private _resolveValueContext(contextOrContextFn: CaluclatedValueContextType) {\n let context = contextOrContextFn\n if (typeof context === 'function') {\n context = context()\n }\n return context\n }\n\n public handleModalAction<R = any>(\n action: DynamicActionModalDef,\n contextOrContextFn: CaluclatedValueContextType,\n ) {\n // TODO: Try to simplify this observable. It seems fairly easy to read like\n // this, but seems like it is doing more than it needs to with the multiple\n // subjects.\n return new Observable((subscriber: Subscriber<R>) => {\n // Passed to helper function to emit results to subscriber.\n const resultSubject = new Subject<any>()\n // Used to stop observing.\n const stopSubject = new Subject<any>()\n\n // Observe results to emit to subscriber.\n resultSubject.pipe(takeUntil(stopSubject)).subscribe(\n (result) => subscriber.next(result),\n (err) => subscriber.error(err),\n () => stopSubject.complete(),\n )\n\n // Handle the potentially deep chain of actions.\n this._handleModalAction(action, contextOrContextFn, resultSubject)\n .pipe(takeUntil(stopSubject))\n .subscribe(\n () => {},\n (err) => subscriber.error(err),\n () => subscriber.complete(),\n )\n\n // Clean up on unsubscribe.\n return () => {\n stopSubject.next(undefined)\n stopSubject.complete()\n }\n })\n }\n\n private _handleModalAction(\n action: DynamicActionModalDef,\n contextOrContextFn: CaluclatedValueContextType,\n resultSubject: Subject<any>,\n ) {\n const context = this._resolveValueContext(contextOrContextFn)\n return from(this._dynamicActionHelper.exec(action, context))\n }\n}\n","import { PortalModule } from '@angular/cdk/portal'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { TableCellTypeSelectorComponent } from './table-cell-type-selector.component'\n\n@NgModule({\n declarations: [TableCellTypeSelectorComponent],\n imports: [CommonModule, PortalModule],\n providers: [],\n exports: [TableCellTypeSelectorComponent],\n})\nexport class TheSeamTableCellTypeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;MAIa,wBAAwB,GACnC,IAAI,cAAc,CAAyB,0BAA0B;MAE1D,eAAe,GAAG,IAAI,cAAc,CAC/C,iBAAiB;;MCkCN,8BAA8B,CAAA;AAyB/B,IAAA,SAAA;AACA,IAAA,IAAA;AAnBD,IAAA,IAAI;AACJ,IAAA,KAAK;AACL,IAAA,QAAQ;AACR,IAAA,GAAG;AACH,IAAA,OAAO;AAKT,IAAA,eAAe;AAEd,IAAA,KAAK;AACL,IAAA,kBAAkB;AAGlB,IAAA,UAAU;AAElB,IAAA,WAAA,CACU,SAAmB,EACnB,IAAuB,EAG/B,SAAoC,EAAA;QAJ5B,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,IAAI,GAAJ,IAAI;AAKZ,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS,IAAI,EAAE;IACnC;IAEA,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd;QACF;QAEA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