@c8y/ngx-components 1011.0.33 → 1011.0.34
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/bundles/c8y-ngx-components-upgrade.umd.js +6 -5
- package/bundles/c8y-ngx-components-upgrade.umd.js.map +1 -1
- package/bundles/c8y-ngx-components-upgrade.umd.min.js +1 -1
- package/bundles/c8y-ngx-components-upgrade.umd.min.js.map +1 -1
- package/bundles/c8y-ngx-components.umd.js +57 -19
- package/bundles/c8y-ngx-components.umd.js.map +1 -1
- package/bundles/c8y-ngx-components.umd.min.js +1 -1
- package/bundles/c8y-ngx-components.umd.min.js.map +1 -1
- package/c8y-ngx-components.metadata.json +1 -1
- package/core/action-bar/action-bar.component.d.ts +22 -6
- package/core/common/outlet.directive.d.ts +7 -0
- package/esm2015/core/action-bar/action-bar.component.js +41 -15
- package/esm2015/core/bootstrap/bootstrap.component.js +2 -2
- package/esm2015/core/common/outlet.directive.js +19 -2
- package/esm2015/upgrade/action-bar.factory.js +6 -2
- package/esm2015/upgrade/bridge.service.js +2 -5
- package/fesm2015/c8y-ngx-components-upgrade.js +5 -5
- package/fesm2015/c8y-ngx-components-upgrade.js.map +1 -1
- package/fesm2015/c8y-ngx-components.js +57 -16
- package/fesm2015/c8y-ngx-components.js.map +1 -1
- package/package.json +2 -2
- package/upgrade/action-bar.factory.d.ts +1 -0
- package/upgrade/c8y-ngx-components-upgrade.metadata.json +1 -1
|
@@ -4050,6 +4050,13 @@
|
|
|
4050
4050
|
* <div *c8yOutlet="template"></div>
|
|
4051
4051
|
* <div *c8yOutlet="DeviceStatusComponent; properties: { node }"></div>
|
|
4052
4052
|
* <div *c8yOutlet="nodes"></div>
|
|
4053
|
+
*
|
|
4054
|
+
*
|
|
4055
|
+
* note: If template is instance of HTMLElement (for example, node compiled by angularJS) then there can be
|
|
4056
|
+
* only single instance rendered, as only one instance of HTMLElement can exist in DOM.
|
|
4057
|
+
* If there is need for displaying same element multiple times, please make sure to inject into
|
|
4058
|
+
* this element createCopy function, which should return another instance of given element.
|
|
4059
|
+
*
|
|
4053
4060
|
*/
|
|
4054
4061
|
var OutletDirective = /** @class */ (function () {
|
|
4055
4062
|
function OutletDirective(viewContainer, resolver, renderer, el) {
|
|
@@ -4083,7 +4090,17 @@
|
|
|
4083
4090
|
else if (template instanceof Element) {
|
|
4084
4091
|
var parent = this.renderer.parentNode(this.el.nativeElement);
|
|
4085
4092
|
this.destroy();
|
|
4086
|
-
|
|
4093
|
+
/**
|
|
4094
|
+
* Because compiled element can be used only once, we need to create copy of it
|
|
4095
|
+
* in order to display it in multiple locations.
|
|
4096
|
+
* For example standard "More" menu, and its RWD version.
|
|
4097
|
+
*/
|
|
4098
|
+
if (template.createCopy) {
|
|
4099
|
+
this._element = template.createCopy();
|
|
4100
|
+
}
|
|
4101
|
+
else {
|
|
4102
|
+
this._element = template;
|
|
4103
|
+
}
|
|
4087
4104
|
this.renderer.insertBefore(parent, this._element, this.el.nativeElement);
|
|
4088
4105
|
// case Component -> <div *c8yOutlet="DeviceStatusComponent; properties: { node }"></div>
|
|
4089
4106
|
}
|
|
@@ -4565,24 +4582,45 @@
|
|
|
4565
4582
|
/**
|
|
4566
4583
|
* The current items to display in the ActionBar.
|
|
4567
4584
|
*/
|
|
4568
|
-
this.items = [];
|
|
4569
|
-
|
|
4570
|
-
|
|
4585
|
+
this.items$ = rxjs.of([]);
|
|
4586
|
+
/**
|
|
4587
|
+
* Provides observable for right action items.
|
|
4588
|
+
*/
|
|
4589
|
+
this.right$ = rxjs.of([]);
|
|
4590
|
+
/**
|
|
4591
|
+
* Provides observable for left action items.
|
|
4592
|
+
*/
|
|
4593
|
+
this.left$ = rxjs.of([]);
|
|
4594
|
+
/**
|
|
4595
|
+
* Provides observable for more action items.
|
|
4596
|
+
*/
|
|
4597
|
+
this.more$ = rxjs.of([]);
|
|
4571
4598
|
/**
|
|
4572
4599
|
* Returns true if no items are present and hides the action bar.
|
|
4573
4600
|
*/
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4601
|
+
this.hidden$ = rxjs.of(true);
|
|
4602
|
+
/**
|
|
4603
|
+
* Binds hidden property to this component's native element
|
|
4604
|
+
*/
|
|
4605
|
+
this.hidden = true;
|
|
4606
|
+
this.destroy$ = new rxjs.Subject();
|
|
4607
|
+
}
|
|
4608
|
+
ActionBarComponent.prototype.ngOnInit = function () {
|
|
4609
|
+
var _this = this;
|
|
4610
|
+
this.right$ = this.items$.pipe(operators.map(function (items) { return lodashEs.filter(items, { placement: 'right' }); }), operators.map(function (items) { return lodashEs.sortBy(items, _this.byPriority); }));
|
|
4611
|
+
this.left$ = this.items$.pipe(operators.map(function (items) { return lodashEs.filter(items, { placement: 'left' }); }), operators.map(function (items) { return lodashEs.sortBy(items, _this.byPriority); }));
|
|
4612
|
+
this.more$ = this.items$.pipe(operators.map(function (items) { return lodashEs.filter(items, { placement: 'more' }); }), operators.map(function (items) { return lodashEs.sortBy(items, _this.byPriority); }));
|
|
4613
|
+
this.hidden$ = this.items$.pipe(operators.map(function (items) {
|
|
4614
|
+
return !(items && items.length);
|
|
4615
|
+
}));
|
|
4616
|
+
this.hidden$
|
|
4617
|
+
.pipe(operators.takeUntil(this.destroy$)).subscribe(function (hidden) {
|
|
4618
|
+
_this.hidden = hidden;
|
|
4619
|
+
});
|
|
4620
|
+
};
|
|
4621
|
+
ActionBarComponent.prototype.ngOnDestroy = function () {
|
|
4622
|
+
this.destroy$.next();
|
|
4623
|
+
this.destroy$.complete();
|
|
4586
4624
|
};
|
|
4587
4625
|
ActionBarComponent.prototype.byPriority = function (item) {
|
|
4588
4626
|
return -item.priority;
|
|
@@ -4592,7 +4630,7 @@
|
|
|
4592
4630
|
ActionBarComponent.decorators = [
|
|
4593
4631
|
{ type: i0.Component, args: [{
|
|
4594
4632
|
selector: 'c8y-action-bar',
|
|
4595
|
-
template: "<div class=\"navbar-header\">\n <p class=\"text-label-small p-l-16 p-t-8 p-b-8 visible-xs\">\n <span class=\"text-primary\">{{'Action bar' | translate}}</span>\n </p>\n</div>\n\n<div id=\"page-toolbar\" class=\"navbar-collapse\"
|
|
4633
|
+
template: "<div class=\"navbar-header\">\n <p class=\"text-label-small p-l-16 p-t-8 p-b-8 visible-xs\">\n <span class=\"text-primary\">{{ 'Action bar' | translate }}</span>\n </p>\n</div>\n\n<div id=\"page-toolbar\" class=\"navbar-collapse\">\n <ul class=\"nav navbar-nav navbar-left\">\n <ng-container *ngFor=\"let item of left$ | async\">\n <ng-container *c8yOutlet=\"item.template\"></ng-container>\n </ng-container>\n </ul>\n <ul class=\"nav navbar-nav navbar-right\">\n <ng-container *ngFor=\"let item of right$ | async\">\n <ng-container *c8yOutlet=\"item.template\"></ng-container>\n </ng-container>\n <li class=\"no-remove more-wrapper\" *ngIf=\"(more$ | async).length > 0\">\n <div class=\"dropdown\" dropdown>\n <button\n title=\"{{ 'More' | translate }}\u2026\"\n class=\"dropdown-toggle c8y-dropdown d-flex\"\n dropdownToggle\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n >\n <span class=\"text-truncate\" translate>More\u2026</span>\n <i [c8yIcon]=\"'caret-down'\"></i>\n </button>\n <ul class=\"dropdown-menu dropdown-menu-right hidden-xs\" *dropdownMenu>\n <ng-container *ngFor=\"let item of more$ | async\">\n <ng-container *c8yOutlet=\"item.template\"></ng-container>\n </ng-container>\n </ul>\n <ul class=\"dropdown-menu visible-xs\">\n <ng-container *ngFor=\"let item of more$ | async\">\n <ng-container *c8yOutlet=\"item.template\"></ng-container>\n </ng-container>\n </ul>\n </div>\n </li>\n </ul>\n</div>\n",
|
|
4596
4634
|
host: { class: 'c8y-ui-action-bar' }
|
|
4597
4635
|
},] }
|
|
4598
4636
|
];
|
|
@@ -4601,7 +4639,7 @@
|
|
|
4601
4639
|
hasTabs: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.has-tabs',] }],
|
|
4602
4640
|
isTabsHorizontal: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.horizontal-tabs',] }],
|
|
4603
4641
|
uiActionBar: [{ type: i0.HostBinding, args: ['class.c8y-ui-action-bar',] }],
|
|
4604
|
-
items
|
|
4642
|
+
items$: [{ type: i0.Input }],
|
|
4605
4643
|
hidden: [{ type: i0.HostBinding }]
|
|
4606
4644
|
};
|
|
4607
4645
|
|
|
@@ -6171,7 +6209,7 @@
|
|
|
6171
6209
|
BootstrapComponent.decorators = [
|
|
6172
6210
|
{ type: i0.Component, args: [{
|
|
6173
6211
|
selector: 'c8y-bootstrap',
|
|
6174
|
-
template: "<c8y-login *ngIf=\"!(ui.currentUser | async)\"></c8y-login>\n\n<div *ngIf=\"ui.currentUser | async\" [class.head-open]=\"headerService.headerOpen\">\n <c8y-header-bar #header></c8y-header-bar>\n <c8y-navigator-outlet\n [nodes]=\"navigator.items$ | async\"\n [open]=\"headerService.navigatorOpen$ | async\"\n >\n <header class=\"title navigator-slot-top\">\n <div class=\"tenant-brand\"></div>\n <c8y-app-icon\n [name]=\"(ui.state$ | async).app.name\"\n [contextPath]=\"(ui.state$ | async).app.contextPath\"\n ></c8y-app-icon>\n <span>{{ (ui.state$ | async).app | humanizeAppName | async }}</span>\n </header>\n <div class=\"powered-by navigator-slot-bottom\" *ngIf=\"showPoweredBy\">\n <p translate>powered by Cumulocity</p>\n </div>\n </c8y-navigator-outlet>\n\n <div class=\"alerts\">\n <c8y-alert-outlet></c8y-alert-outlet>\n </div>\n <c8y-tabs-outlet\n #tabsComponent\n [tabs]=\"tabs.items$ | async\"\n [navigatorOpen]=\"headerService.navigatorOpen$ | async\"\n [orientation]=\"tabs.orientation$ | async\"\n >\n </c8y-tabs-outlet>\n <c8y-action-bar\n #actionBarComponent\n [navigatorOpen]=\"headerService.navigatorOpen$ | async\"\n [hasTabs]=\"tabsComponent.hasTabs\"\n [isTabsHorizontal]=\"tabsComponent.isHorizontal\"\n [items]=\"actionBar.items
|
|
6212
|
+
template: "<c8y-login *ngIf=\"!(ui.currentUser | async)\"></c8y-login>\n\n<div *ngIf=\"ui.currentUser | async\" [class.head-open]=\"headerService.headerOpen\">\n <c8y-header-bar #header></c8y-header-bar>\n <c8y-navigator-outlet\n [nodes]=\"navigator.items$ | async\"\n [open]=\"headerService.navigatorOpen$ | async\"\n >\n <header class=\"title navigator-slot-top\">\n <div class=\"tenant-brand\"></div>\n <c8y-app-icon\n [name]=\"(ui.state$ | async).app.name\"\n [contextPath]=\"(ui.state$ | async).app.contextPath\"\n ></c8y-app-icon>\n <span>{{ (ui.state$ | async).app | humanizeAppName | async }}</span>\n </header>\n <div class=\"powered-by navigator-slot-bottom\" *ngIf=\"showPoweredBy\">\n <p translate>powered by Cumulocity</p>\n </div>\n </c8y-navigator-outlet>\n\n <div class=\"alerts\">\n <c8y-alert-outlet></c8y-alert-outlet>\n </div>\n <c8y-tabs-outlet\n #tabsComponent\n [tabs]=\"tabs.items$ | async\"\n [navigatorOpen]=\"headerService.navigatorOpen$ | async\"\n [orientation]=\"tabs.orientation$ | async\"\n >\n </c8y-tabs-outlet>\n <c8y-action-bar\n #actionBarComponent\n [navigatorOpen]=\"headerService.navigatorOpen$ | async\"\n [hasTabs]=\"tabsComponent.hasTabs\"\n [isTabsHorizontal]=\"tabsComponent.isHorizontal\"\n [items$]=\"actionBar.items$\"\n >\n </c8y-action-bar>\n\n <div\n class=\"mcontainer\"\n [ngClass]=\"{\n open: headerService.navigatorOpen$ | async,\n 'no-apps-margin': noAppsMargin$ | async,\n 'horizontal-tabs': tabsComponent.isHorizontal,\n 'vertical-tabs': !tabsComponent.isHorizontal,\n 'has-tabs': tabsComponent.hasTabs,\n 'has-action-bar': !actionBarComponent.hidden\n }\"\n >\n <div class=\"container-fluid\">\n <router-outlet></router-outlet>\n <ng-content select=\"#c8y-legacy-view\"></ng-content>\n <!-- legacy ng-view, will not be migrated atm -->\n </div>\n </div>\n</div>\n<c8y-cookie-banner></c8y-cookie-banner>\n"
|
|
6175
6213
|
},] }
|
|
6176
6214
|
];
|
|
6177
6215
|
BootstrapComponent.ctorParameters = function () { return [
|