@fundamental-ngx/core 0.35.1 → 0.35.2-rc.2
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/action-bar/package.json +1 -1
- package/action-sheet/package.json +1 -1
- package/alert/package.json +1 -1
- package/avatar/package.json +1 -1
- package/avatar-group/directives/avatar-group-overflow-button.directive.d.ts +4 -2
- package/avatar-group/esm2020/directives/avatar-group-overflow-button.directive.mjs +5 -1
- package/avatar-group/fesm2015/fundamental-ngx-core-avatar-group.mjs +4 -0
- package/avatar-group/fesm2015/fundamental-ngx-core-avatar-group.mjs.map +1 -1
- package/avatar-group/fesm2020/fundamental-ngx-core-avatar-group.mjs +4 -0
- package/avatar-group/fesm2020/fundamental-ngx-core-avatar-group.mjs.map +1 -1
- package/avatar-group/package.json +1 -1
- package/bar/package.json +1 -1
- package/breadcrumb/package.json +1 -1
- package/busy-indicator/package.json +1 -1
- package/button/package.json +1 -1
- package/calendar/package.json +1 -1
- package/card/package.json +1 -1
- package/carousel/package.json +1 -1
- package/checkbox/package.json +1 -1
- package/combobox/package.json +1 -1
- package/date-picker/package.json +1 -1
- package/datetime/package.json +1 -1
- package/datetime-picker/package.json +1 -1
- package/dialog/package.json +1 -1
- package/dynamic-page/package.json +1 -1
- package/dynamic-side-content/package.json +1 -1
- package/esm2020/avatar-group/directives/avatar-group-overflow-button.directive.mjs +5 -1
- package/esm2020/fixed-card-layout/fixed-card-layout.component.mjs +17 -26
- package/esm2020/fundamental-ngx.module.mjs +8 -4
- package/esm2020/input-group/input-group.component.mjs +3 -3
- package/esm2020/overflow-layout/directives/overflow-expand.directive.mjs +36 -0
- package/esm2020/overflow-layout/directives/overflow-item-container-ref.directive.mjs +46 -0
- package/esm2020/overflow-layout/directives/overflow-item-ref.directive.mjs +57 -0
- package/esm2020/overflow-layout/directives/overflow-layout-item-container.directive.mjs +26 -0
- package/esm2020/overflow-layout/directives/overflow-layout-item.directive.mjs +100 -0
- package/esm2020/overflow-layout/directives/overflow-layout-popover-content.directive.mjs +68 -0
- package/esm2020/overflow-layout/fundamental-ngx-core-overflow-layout.mjs +5 -0
- package/esm2020/overflow-layout/index.mjs +15 -0
- package/esm2020/overflow-layout/interfaces/overflow-container.interface.mjs +2 -0
- package/esm2020/overflow-layout/interfaces/overflow-expand.interface.mjs +2 -0
- package/esm2020/overflow-layout/interfaces/overflow-item-ref.interface.mjs +2 -0
- package/esm2020/overflow-layout/interfaces/overflow-item.interface.mjs +2 -0
- package/esm2020/overflow-layout/interfaces/overflow-popover-content.interface.mjs +2 -0
- package/esm2020/overflow-layout/overflow-layout.component.mjs +300 -0
- package/esm2020/overflow-layout/overflow-layout.module.mjs +52 -0
- package/esm2020/overflow-layout/tokens/overflow-container.token.mjs +3 -0
- package/esm2020/overflow-layout/tokens/overflow-expand.token.mjs +3 -0
- package/esm2020/overflow-layout/tokens/overflow-item-ref.token.mjs +3 -0
- package/esm2020/overflow-layout/tokens/overflow-item.token.mjs +3 -0
- package/esm2020/public_api.mjs +2 -1
- package/esm2020/select/select.component.mjs +1 -2
- package/facets/package.json +1 -1
- package/feed-input/package.json +1 -1
- package/feed-list-item/package.json +1 -1
- package/fesm2015/fundamental-ngx-core-avatar-group.mjs +4 -0
- package/fesm2015/fundamental-ngx-core-avatar-group.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-fixed-card-layout.mjs +16 -25
- package/fesm2015/fundamental-ngx-core-fixed-card-layout.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-input-group.mjs +2 -2
- package/fesm2015/fundamental-ngx-core-input-group.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-overflow-layout.mjs +672 -0
- package/fesm2015/fundamental-ngx-core-overflow-layout.mjs.map +1 -0
- package/fesm2015/fundamental-ngx-core-select.mjs +0 -1
- package/fesm2015/fundamental-ngx-core-select.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core.mjs +8 -3
- package/fesm2015/fundamental-ngx-core.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-avatar-group.mjs +4 -0
- package/fesm2020/fundamental-ngx-core-avatar-group.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-fixed-card-layout.mjs +16 -25
- package/fesm2020/fundamental-ngx-core-fixed-card-layout.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-input-group.mjs +2 -2
- package/fesm2020/fundamental-ngx-core-input-group.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-overflow-layout.mjs +660 -0
- package/fesm2020/fundamental-ngx-core-overflow-layout.mjs.map +1 -0
- package/fesm2020/fundamental-ngx-core-select.mjs +0 -1
- package/fesm2020/fundamental-ngx-core-select.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core.mjs +8 -3
- package/fesm2020/fundamental-ngx-core.mjs.map +1 -1
- package/file-uploader/package.json +1 -1
- package/fixed-card-layout/esm2020/fixed-card-layout.component.mjs +17 -26
- package/fixed-card-layout/fesm2015/fundamental-ngx-core-fixed-card-layout.mjs +16 -25
- package/fixed-card-layout/fesm2015/fundamental-ngx-core-fixed-card-layout.mjs.map +1 -1
- package/fixed-card-layout/fesm2020/fundamental-ngx-core-fixed-card-layout.mjs +16 -25
- package/fixed-card-layout/fesm2020/fundamental-ngx-core-fixed-card-layout.mjs.map +1 -1
- package/fixed-card-layout/fixed-card-layout.component.d.ts +4 -6
- package/fixed-card-layout/package.json +1 -1
- package/flexible-column-layout/package.json +1 -1
- package/form/package.json +1 -1
- package/formatted-text/package.json +1 -1
- package/fundamental-ngx.module.d.ts +2 -1
- package/grid-list/package.json +1 -1
- package/icon/package.json +1 -1
- package/illustrated-message/package.json +1 -1
- package/infinite-scroll/package.json +1 -1
- package/info-label/package.json +1 -1
- package/inline-help/package.json +1 -1
- package/input-group/esm2020/input-group.component.mjs +3 -3
- package/input-group/fesm2015/fundamental-ngx-core-input-group.mjs +2 -2
- package/input-group/fesm2015/fundamental-ngx-core-input-group.mjs.map +1 -1
- package/input-group/fesm2020/fundamental-ngx-core-input-group.mjs +2 -2
- package/input-group/fesm2020/fundamental-ngx-core-input-group.mjs.map +1 -1
- package/input-group/package.json +1 -1
- package/layout-grid/package.json +1 -1
- package/layout-panel/package.json +1 -1
- package/link/package.json +1 -1
- package/list/package.json +1 -1
- package/menu/package.json +1 -1
- package/message-box/package.json +1 -1
- package/message-strip/package.json +1 -1
- package/message-toast/package.json +1 -1
- package/micro-process-flow/package.json +1 -1
- package/mobile-mode/package.json +1 -1
- package/multi-input/package.json +1 -1
- package/nested-list/package.json +1 -1
- package/notification/package.json +1 -1
- package/object-identifier/package.json +1 -1
- package/object-marker/package.json +1 -1
- package/object-number/package.json +1 -1
- package/object-status/package.json +1 -1
- package/overflow-layout/README.md +7 -0
- package/overflow-layout/directives/overflow-expand.directive.d.ts +15 -0
- package/overflow-layout/directives/overflow-item-container-ref.directive.d.ts +25 -0
- package/overflow-layout/directives/overflow-item-ref.directive.d.ts +42 -0
- package/overflow-layout/directives/overflow-layout-item-container.directive.d.ts +16 -0
- package/overflow-layout/directives/overflow-layout-item.directive.d.ts +38 -0
- package/overflow-layout/directives/overflow-layout-popover-content.directive.d.ts +31 -0
- package/overflow-layout/esm2020/directives/overflow-expand.directive.mjs +36 -0
- package/overflow-layout/esm2020/directives/overflow-item-container-ref.directive.mjs +46 -0
- package/overflow-layout/esm2020/directives/overflow-item-ref.directive.mjs +57 -0
- package/overflow-layout/esm2020/directives/overflow-layout-item-container.directive.mjs +26 -0
- package/overflow-layout/esm2020/directives/overflow-layout-item.directive.mjs +100 -0
- package/overflow-layout/esm2020/directives/overflow-layout-popover-content.directive.mjs +68 -0
- package/overflow-layout/esm2020/fundamental-ngx-core-overflow-layout.mjs +5 -0
- package/overflow-layout/esm2020/index.mjs +15 -0
- package/overflow-layout/esm2020/interfaces/overflow-container.interface.mjs +2 -0
- package/overflow-layout/esm2020/interfaces/overflow-expand.interface.mjs +2 -0
- package/overflow-layout/esm2020/interfaces/overflow-item-ref.interface.mjs +2 -0
- package/overflow-layout/esm2020/interfaces/overflow-item.interface.mjs +2 -0
- package/overflow-layout/esm2020/interfaces/overflow-popover-content.interface.mjs +2 -0
- package/overflow-layout/esm2020/overflow-layout.component.mjs +300 -0
- package/overflow-layout/esm2020/overflow-layout.module.mjs +52 -0
- package/overflow-layout/esm2020/tokens/overflow-container.token.mjs +3 -0
- package/overflow-layout/esm2020/tokens/overflow-expand.token.mjs +3 -0
- package/overflow-layout/esm2020/tokens/overflow-item-ref.token.mjs +3 -0
- package/overflow-layout/esm2020/tokens/overflow-item.token.mjs +3 -0
- package/overflow-layout/fesm2015/fundamental-ngx-core-overflow-layout.mjs +672 -0
- package/overflow-layout/fesm2015/fundamental-ngx-core-overflow-layout.mjs.map +1 -0
- package/overflow-layout/fesm2020/fundamental-ngx-core-overflow-layout.mjs +660 -0
- package/overflow-layout/fesm2020/fundamental-ngx-core-overflow-layout.mjs.map +1 -0
- package/overflow-layout/fundamental-ngx-core-overflow-layout.d.ts +5 -0
- package/overflow-layout/index.d.ts +14 -0
- package/overflow-layout/interfaces/overflow-container.interface.d.ts +4 -0
- package/overflow-layout/interfaces/overflow-expand.interface.d.ts +11 -0
- package/overflow-layout/interfaces/overflow-item-ref.interface.d.ts +38 -0
- package/overflow-layout/interfaces/overflow-item.interface.d.ts +20 -0
- package/overflow-layout/interfaces/overflow-popover-content.interface.d.ts +11 -0
- package/overflow-layout/overflow-layout.component.d.ts +131 -0
- package/overflow-layout/overflow-layout.module.d.ts +16 -0
- package/overflow-layout/package.json +53 -0
- package/overflow-layout/tokens/overflow-container.token.d.ts +3 -0
- package/overflow-layout/tokens/overflow-expand.token.d.ts +3 -0
- package/overflow-layout/tokens/overflow-item-ref.token.d.ts +3 -0
- package/overflow-layout/tokens/overflow-item.token.d.ts +3 -0
- package/package.json +9 -1
- package/pagination/package.json +1 -1
- package/panel/package.json +1 -1
- package/popover/package.json +1 -1
- package/product-switch/package.json +1 -1
- package/progress-indicator/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/quick-view/package.json +1 -1
- package/radio/package.json +1 -1
- package/rating-indicator/package.json +1 -1
- package/resizable-card-layout/package.json +1 -1
- package/scroll-spy/package.json +1 -1
- package/scrollbar/package.json +1 -1
- package/segmented-button/package.json +1 -1
- package/select/esm2020/select.component.mjs +1 -2
- package/select/fesm2015/fundamental-ngx-core-select.mjs +0 -1
- package/select/fesm2015/fundamental-ngx-core-select.mjs.map +1 -1
- package/select/fesm2020/fundamental-ngx-core-select.mjs +0 -1
- package/select/fesm2020/fundamental-ngx-core-select.mjs.map +1 -1
- package/select/package.json +1 -1
- package/shared/package.json +1 -1
- package/shellbar/package.json +1 -1
- package/side-navigation/package.json +1 -1
- package/slider/package.json +1 -1
- package/split-button/package.json +1 -1
- package/splitter/package.json +1 -1
- package/status-indicator/package.json +1 -1
- package/step-input/package.json +1 -1
- package/switch/package.json +1 -1
- package/table/package.json +1 -1
- package/tabs/package.json +1 -1
- package/text/package.json +1 -1
- package/theming/package.json +1 -1
- package/tile/package.json +1 -1
- package/time/package.json +1 -1
- package/time-picker/package.json +1 -1
- package/timeline/package.json +1 -1
- package/title/package.json +1 -1
- package/token/package.json +1 -1
- package/toolbar/package.json +1 -1
- package/tree/package.json +1 -1
- package/upload-collection/package.json +1 -1
- package/utils/package.json +1 -1
- package/vertical-navigation/package.json +1 -1
- package/wizard/package.json +1 -1
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, HostBinding, ContentChild, InjectionToken, Inject, Input, HostListener, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Output, ContentChildren, ViewChildren, ViewChild, SkipSelf, NgModule } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i2 from '@fundamental-ngx/core/popover';
|
|
6
|
+
import { PopoverModule } from '@fundamental-ngx/core/popover';
|
|
7
|
+
import * as i3 from '@fundamental-ngx/core/button';
|
|
8
|
+
import { ButtonModule } from '@fundamental-ngx/core/button';
|
|
9
|
+
import { FocusKeyManager } from '@angular/cdk/a11y';
|
|
10
|
+
import { TAB, DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes';
|
|
11
|
+
import * as i1 from '@fundamental-ngx/core/utils';
|
|
12
|
+
import { KeyUtil, resizeObservable } from '@fundamental-ngx/core/utils';
|
|
13
|
+
import { Subscription, Subject, debounceTime, skip, filter, distinctUntilChanged } from 'rxjs';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Directive to hide component without actual destroying of the component instance.
|
|
17
|
+
*/
|
|
18
|
+
class OverflowItemContainerRefDirective {
|
|
19
|
+
/** @hidden */
|
|
20
|
+
constructor(_templateRef, _viewContainerRef, _elmRef) {
|
|
21
|
+
this._templateRef = _templateRef;
|
|
22
|
+
this._viewContainerRef = _viewContainerRef;
|
|
23
|
+
this._elmRef = _elmRef;
|
|
24
|
+
/** @hidden */
|
|
25
|
+
this._detached = false;
|
|
26
|
+
/** @hidden */
|
|
27
|
+
this._hidden = false;
|
|
28
|
+
// Create embedded view right away and manipulate its visibility later.
|
|
29
|
+
this._viewContainerRef.createEmbeddedView(this._templateRef);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Shows or hides element without destroying the view itself.
|
|
33
|
+
* @param value
|
|
34
|
+
*/
|
|
35
|
+
set hidden(value) {
|
|
36
|
+
if (this._hidden === value) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this._hidden = value;
|
|
40
|
+
if (value && !this._detached) {
|
|
41
|
+
this._viewRef = this._viewContainerRef.detach();
|
|
42
|
+
this._detached = true;
|
|
43
|
+
}
|
|
44
|
+
else if (!value && this._viewRef && this._detached) {
|
|
45
|
+
this._viewRef = this._viewContainerRef.insert(this._viewRef);
|
|
46
|
+
this._detached = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
OverflowItemContainerRefDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowItemContainerRefDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
51
|
+
OverflowItemContainerRefDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: OverflowItemContainerRefDirective, selector: "[fdOverflowItemContainerRef]", ngImport: i0 });
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowItemContainerRefDirective, decorators: [{
|
|
53
|
+
type: Directive,
|
|
54
|
+
args: [{
|
|
55
|
+
selector: '[fdOverflowItemContainerRef]'
|
|
56
|
+
}]
|
|
57
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }]; } });
|
|
58
|
+
|
|
59
|
+
class OverflowLayoutItemContainerDirective {
|
|
60
|
+
/** @hidden */
|
|
61
|
+
constructor(elementRef) {
|
|
62
|
+
this.elementRef = elementRef;
|
|
63
|
+
/** @hidden */
|
|
64
|
+
this._initialClass = 'fd-overflow-layout__item';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
OverflowLayoutItemContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutItemContainerDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
68
|
+
OverflowLayoutItemContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: OverflowLayoutItemContainerDirective, selector: "[fdOverflowLayoutItemContainer]", host: { properties: { "class": "this._initialClass" } }, queries: [{ propertyName: "containerRef", first: true, predicate: OverflowItemContainerRefDirective, descendants: true }], ngImport: i0 });
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutItemContainerDirective, decorators: [{
|
|
70
|
+
type: Directive,
|
|
71
|
+
args: [{
|
|
72
|
+
selector: '[fdOverflowLayoutItemContainer]'
|
|
73
|
+
}]
|
|
74
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { _initialClass: [{
|
|
75
|
+
type: HostBinding,
|
|
76
|
+
args: ['class']
|
|
77
|
+
}], containerRef: [{
|
|
78
|
+
type: ContentChild,
|
|
79
|
+
args: [OverflowItemContainerRefDirective]
|
|
80
|
+
}] } });
|
|
81
|
+
|
|
82
|
+
const FD_OVERFLOW_CONTAINER = new InjectionToken('FdOverflowContainer');
|
|
83
|
+
|
|
84
|
+
const FD_OVERFLOW_EXPAND = new InjectionToken('FdOverflowLayoutExpand');
|
|
85
|
+
|
|
86
|
+
const FD_OVERFLOW_ITEM_REF = new InjectionToken('OverflowLayoutItemRef');
|
|
87
|
+
|
|
88
|
+
const FD_OVERFLOW_ITEM = new InjectionToken('FdOverflowItem');
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Directive to wrap Overlay Layout "More" popover content.
|
|
92
|
+
* Used to apply keyboard navigation through the items.
|
|
93
|
+
*/
|
|
94
|
+
class OverflowLayoutPopoverContentDirective {
|
|
95
|
+
/** @hidden */
|
|
96
|
+
constructor(_overflowContainer) {
|
|
97
|
+
var _a;
|
|
98
|
+
this._overflowContainer = _overflowContainer;
|
|
99
|
+
/** @hidden */
|
|
100
|
+
this._initialClass = 'fd-overflow-layout__popover-container';
|
|
101
|
+
(_a = this._overflowContainer) === null || _a === void 0 ? void 0 : _a.registerPopoverContent(this);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Array of hidden items.
|
|
105
|
+
*/
|
|
106
|
+
set items(value) {
|
|
107
|
+
this._items = value;
|
|
108
|
+
this._keyboardEventsManager = new FocusKeyManager(this._items.filter((item) => item.overflowItem.focusable).map((item) => item.overflowItem))
|
|
109
|
+
.withWrap()
|
|
110
|
+
.withHorizontalOrientation('ltr');
|
|
111
|
+
}
|
|
112
|
+
/** @hidden */
|
|
113
|
+
keyUpHandler(event) {
|
|
114
|
+
if (KeyUtil.isKeyCode(event, TAB)) {
|
|
115
|
+
const index = this._items.findIndex((item) => item.elementRef.nativeElement === event.target);
|
|
116
|
+
if (index !== -1) {
|
|
117
|
+
this._keyboardEventsManager.setActiveItem(index);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (KeyUtil.isKeyCode(event, [DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW])) {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
// passing the event to key manager, so we get a change fired
|
|
123
|
+
this._keyboardEventsManager.onKeydown(event);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Focuses on the first tabbable element inside directive's element.
|
|
128
|
+
*/
|
|
129
|
+
focusFirstTabbableElement() {
|
|
130
|
+
this._keyboardEventsManager.setActiveItem(0);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
OverflowLayoutPopoverContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutPopoverContentDirective, deps: [{ token: FD_OVERFLOW_CONTAINER }], target: i0.ɵɵFactoryTarget.Directive });
|
|
134
|
+
OverflowLayoutPopoverContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: OverflowLayoutPopoverContentDirective, selector: "[fdOverflowLayoutPopoverContent]", inputs: { items: "items" }, host: { listeners: { "keyup": "keyUpHandler($event)" }, properties: { "class": "this._initialClass" } }, ngImport: i0 });
|
|
135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutPopoverContentDirective, decorators: [{
|
|
136
|
+
type: Directive,
|
|
137
|
+
args: [{
|
|
138
|
+
selector: '[fdOverflowLayoutPopoverContent]'
|
|
139
|
+
}]
|
|
140
|
+
}], ctorParameters: function () {
|
|
141
|
+
return [{ type: undefined, decorators: [{
|
|
142
|
+
type: Inject,
|
|
143
|
+
args: [FD_OVERFLOW_CONTAINER]
|
|
144
|
+
}] }];
|
|
145
|
+
}, propDecorators: { items: [{
|
|
146
|
+
type: Input
|
|
147
|
+
}], _initialClass: [{
|
|
148
|
+
type: HostBinding,
|
|
149
|
+
args: ['class']
|
|
150
|
+
}], keyUpHandler: [{
|
|
151
|
+
type: HostListener,
|
|
152
|
+
args: ['keyup', ['$event']]
|
|
153
|
+
}] } });
|
|
154
|
+
|
|
155
|
+
class OverflowLayoutComponent {
|
|
156
|
+
/** @hidden */
|
|
157
|
+
constructor(_cdr, _zone, _elRef, _rtlService) {
|
|
158
|
+
this._cdr = _cdr;
|
|
159
|
+
this._zone = _zone;
|
|
160
|
+
this._elRef = _elRef;
|
|
161
|
+
this._rtlService = _rtlService;
|
|
162
|
+
/**
|
|
163
|
+
* Event, triggered when amount of visible items has been changed.
|
|
164
|
+
*/
|
|
165
|
+
this.visibleItemsCount = new EventEmitter();
|
|
166
|
+
/**
|
|
167
|
+
* Event, triggered when amount of hidden items has been changed.
|
|
168
|
+
*/
|
|
169
|
+
this.hiddenItemsCount = new EventEmitter();
|
|
170
|
+
/** @hidden */
|
|
171
|
+
this._allItems = [];
|
|
172
|
+
/** @hidden */
|
|
173
|
+
this._hiddenItems = [];
|
|
174
|
+
/** @hidden */
|
|
175
|
+
this._showMore = false;
|
|
176
|
+
/** @hidden */
|
|
177
|
+
this._initialClass = 'fd-overflow-layout';
|
|
178
|
+
/** @hidden */
|
|
179
|
+
this._listenToItemResize = true;
|
|
180
|
+
/** @hidden */
|
|
181
|
+
this._subscription = new Subscription();
|
|
182
|
+
/** @hidden */
|
|
183
|
+
this._fillTrigger$ = new Subject();
|
|
184
|
+
/** @hidden */
|
|
185
|
+
this._dir = 'ltr';
|
|
186
|
+
/** @hidden */
|
|
187
|
+
this._maxVisibleItems = Infinity;
|
|
188
|
+
this._subscription.add(this._fillTrigger$.pipe(debounceTime(30)).subscribe(() => this._fitVisibleItems()));
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Maximum amount of visible items.
|
|
192
|
+
*/
|
|
193
|
+
set maxVisibleItems(value) {
|
|
194
|
+
if (value === this._maxVisibleItems) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
this._maxVisibleItems = value;
|
|
198
|
+
this.triggerRecalculation();
|
|
199
|
+
}
|
|
200
|
+
get maxVisibleItems() {
|
|
201
|
+
return this._maxVisibleItems;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Triggers layout recalculation of the items.
|
|
205
|
+
*/
|
|
206
|
+
triggerRecalculation() {
|
|
207
|
+
this._fillTrigger$.next();
|
|
208
|
+
}
|
|
209
|
+
/** @hidden */
|
|
210
|
+
ngOnDestroy() {
|
|
211
|
+
this._subscription.unsubscribe();
|
|
212
|
+
}
|
|
213
|
+
/** @hidden */
|
|
214
|
+
_keyUpHandler(event) {
|
|
215
|
+
if (KeyUtil.isKeyCode(event, TAB)) {
|
|
216
|
+
const index = this._allItems.findIndex((item) => { var _a; return ((_a = item.overflowItem) === null || _a === void 0 ? void 0 : _a.focusable) && item.elementRef.nativeElement === event.target; });
|
|
217
|
+
if (index !== -1) {
|
|
218
|
+
this._keyboardEventsManager.setActiveItem(index);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (KeyUtil.isKeyCode(event, [DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW])) {
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
// passing the event to key manager so, we get a change fired
|
|
224
|
+
this._keyboardEventsManager.onKeydown(event);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Sets current focused element.
|
|
229
|
+
* @param element Element that needs to be focused.
|
|
230
|
+
*/
|
|
231
|
+
setFocusedElement(element) {
|
|
232
|
+
const index = this._overflowItems.toArray().findIndex((item) => item === element);
|
|
233
|
+
if (index !== -1) {
|
|
234
|
+
this._keyboardEventsManager.setActiveItem(index);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Registers popover content directive for main component.
|
|
239
|
+
* @param content {OverflowPopoverContent} directive
|
|
240
|
+
*/
|
|
241
|
+
registerPopoverContent(content) {
|
|
242
|
+
this._overflowPopoverContent = content;
|
|
243
|
+
}
|
|
244
|
+
/** @hidden */
|
|
245
|
+
_itemsTrackFn(_, item) {
|
|
246
|
+
return item.templateRef;
|
|
247
|
+
}
|
|
248
|
+
/** @hidden */
|
|
249
|
+
_onPopoverStateChange(opened) {
|
|
250
|
+
var _a;
|
|
251
|
+
if (opened) {
|
|
252
|
+
(_a = this._overflowPopoverContent) === null || _a === void 0 ? void 0 : _a.focusFirstTabbableElement();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/** @hidden */
|
|
256
|
+
ngAfterViewInit() {
|
|
257
|
+
this._fitVisibleItems();
|
|
258
|
+
this._setFocusKeyManager();
|
|
259
|
+
this._listenToChanges();
|
|
260
|
+
this._subscribeToRtl();
|
|
261
|
+
}
|
|
262
|
+
/** @hidden */
|
|
263
|
+
_listenToChanges() {
|
|
264
|
+
this._subscription.add(this._items.changes.subscribe(() => {
|
|
265
|
+
setTimeout(() => {
|
|
266
|
+
this._fitVisibleItems();
|
|
267
|
+
});
|
|
268
|
+
}));
|
|
269
|
+
this._listenToSizeChanges(this._elRef.nativeElement, this._itemsWrapper.nativeElement);
|
|
270
|
+
}
|
|
271
|
+
/** @hidden */
|
|
272
|
+
_listenToSizeChanges(...elements) {
|
|
273
|
+
elements.forEach((element) => this._subscription.add(resizeObservable(element)
|
|
274
|
+
.pipe(skip(1), filter(() => this._listenToItemResize), distinctUntilChanged(), debounceTime(30))
|
|
275
|
+
.subscribe(() => {
|
|
276
|
+
setTimeout(() => {
|
|
277
|
+
this._fitVisibleItems();
|
|
278
|
+
});
|
|
279
|
+
})));
|
|
280
|
+
}
|
|
281
|
+
/** @hidden */
|
|
282
|
+
_fitVisibleItems() {
|
|
283
|
+
this._listenToItemResize = false;
|
|
284
|
+
this._allItems = this._items.toArray();
|
|
285
|
+
this._visibleItems.forEach((i) => (i.containerRef.hidden = false));
|
|
286
|
+
this._allItems.forEach((item, index) => {
|
|
287
|
+
item.hidden = false;
|
|
288
|
+
item.index = index;
|
|
289
|
+
});
|
|
290
|
+
this._cdr.detectChanges();
|
|
291
|
+
const containerWidth = this._elRef.nativeElement.getBoundingClientRect().width;
|
|
292
|
+
const itemsContainerWidth = this._itemsWrapper.nativeElement.getBoundingClientRect().width;
|
|
293
|
+
if (containerWidth >= itemsContainerWidth &&
|
|
294
|
+
this._visibleItems.length <= this.maxVisibleItems &&
|
|
295
|
+
this._hiddenItems.length === 0) {
|
|
296
|
+
this._showMore = false;
|
|
297
|
+
this._cdr.detectChanges();
|
|
298
|
+
this._listenToItemResize = true;
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
this._showMore = true;
|
|
302
|
+
let fittingElmCount = 0;
|
|
303
|
+
let fittingElmsWidth = 0;
|
|
304
|
+
let shouldHideItems = false;
|
|
305
|
+
this._cdr.detectChanges();
|
|
306
|
+
const showMoreContainerWidth = this._showMoreContainer.nativeElement.getBoundingClientRect().width;
|
|
307
|
+
let layoutWidth = this._layoutContainer.nativeElement.getBoundingClientRect().width;
|
|
308
|
+
// Try to find all forced visible items
|
|
309
|
+
const forcedItemsIndexes = this._getForcedItemsIndexes();
|
|
310
|
+
forcedItemsIndexes.forEach((itemIndex) => {
|
|
311
|
+
const container = this._visibleItems.get(itemIndex);
|
|
312
|
+
if (!container) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const elementSize = this._getElementWidth(container.elementRef.nativeElement);
|
|
316
|
+
layoutWidth -= elementSize;
|
|
317
|
+
});
|
|
318
|
+
if (layoutWidth < 0 && forcedItemsIndexes.length > 0) {
|
|
319
|
+
console.warn('There is no enough space to fit all forced visible items into the container. Please adjust their visibility accordingly.');
|
|
320
|
+
}
|
|
321
|
+
this._visibleItems.forEach((item, index) => {
|
|
322
|
+
const itemRef = this._allItems[index];
|
|
323
|
+
if (shouldHideItems && !itemRef.overflowItem.forceVisibility) {
|
|
324
|
+
item.containerRef.hidden = true;
|
|
325
|
+
itemRef.hidden = true;
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const elementSize = this._getElementWidth(item.elementRef.nativeElement);
|
|
329
|
+
const combinedWidth = fittingElmsWidth + elementSize;
|
|
330
|
+
if ((combinedWidth <= layoutWidth ||
|
|
331
|
+
(item === this._visibleItems.last && combinedWidth <= layoutWidth + showMoreContainerWidth)) &&
|
|
332
|
+
fittingElmCount < this.maxVisibleItems) {
|
|
333
|
+
fittingElmsWidth += elementSize;
|
|
334
|
+
fittingElmCount++;
|
|
335
|
+
}
|
|
336
|
+
else if (!itemRef.overflowItem.forceVisibility) {
|
|
337
|
+
shouldHideItems = true;
|
|
338
|
+
item.containerRef.hidden = true;
|
|
339
|
+
itemRef.hidden = true;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
this._hiddenItems = this._allItems.filter((i) => i.hidden);
|
|
343
|
+
this.visibleItemsCount.emit(this._allItems.filter((i) => !i.hidden).length);
|
|
344
|
+
this.hiddenItemsCount.emit(this._hiddenItems.length);
|
|
345
|
+
this._showMore = this._hiddenItems.length > 0;
|
|
346
|
+
this._cdr.detectChanges();
|
|
347
|
+
this._listenToItemResize = true;
|
|
348
|
+
}
|
|
349
|
+
/** @hidden */
|
|
350
|
+
_setFocusKeyManager() {
|
|
351
|
+
var _a;
|
|
352
|
+
this._dir = ((_a = this._rtlService) === null || _a === void 0 ? void 0 : _a.rtl.value) ? 'rtl' : 'ltr';
|
|
353
|
+
this._keyboardEventsManager = new FocusKeyManager(this._overflowItems)
|
|
354
|
+
.withWrap()
|
|
355
|
+
.withHorizontalOrientation(this._dir)
|
|
356
|
+
.skipPredicate((item) => !item.focusable || item.hidden);
|
|
357
|
+
}
|
|
358
|
+
/** @hidden Rtl change subscription */
|
|
359
|
+
_subscribeToRtl() {
|
|
360
|
+
if (!this._rtlService) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
const rtlSub = this._rtlService.rtl.subscribe((isRtl) => {
|
|
364
|
+
this._dir = isRtl ? 'rtl' : 'ltr';
|
|
365
|
+
this._keyboardEventsManager = this._keyboardEventsManager.withHorizontalOrientation(isRtl ? 'rtl' : 'ltr');
|
|
366
|
+
});
|
|
367
|
+
this._subscription.add(rtlSub);
|
|
368
|
+
}
|
|
369
|
+
/** @hidden */
|
|
370
|
+
_getForcedItemsIndexes() {
|
|
371
|
+
return this._allItems
|
|
372
|
+
.map((item, index) => (item.overflowItem.forceVisibility ? index : -1))
|
|
373
|
+
.filter((i) => i > -1);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* @hidden
|
|
377
|
+
* Returns combined width of the element including margins.
|
|
378
|
+
* @param element Element to calculate width of.
|
|
379
|
+
*/
|
|
380
|
+
_getElementWidth(element) {
|
|
381
|
+
const elementStyle = getComputedStyle(element);
|
|
382
|
+
const elementWidth = element.getBoundingClientRect().width;
|
|
383
|
+
const elementSize = elementWidth + parseFloat(elementStyle.marginLeft) + parseFloat(elementStyle.marginRight);
|
|
384
|
+
return elementSize;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
OverflowLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: i1.RtlService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
388
|
+
OverflowLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: OverflowLayoutComponent, selector: "fd-overflow-layout", inputs: { maxVisibleItems: "maxVisibleItems" }, outputs: { visibleItemsCount: "visibleItemsCount", hiddenItemsCount: "hiddenItemsCount" }, host: { listeners: { "keyup": "_keyUpHandler($event)" }, properties: { "class": "this._initialClass" } }, providers: [
|
|
389
|
+
{
|
|
390
|
+
provide: FD_OVERFLOW_CONTAINER,
|
|
391
|
+
useExisting: OverflowLayoutComponent
|
|
392
|
+
}
|
|
393
|
+
], queries: [{ propertyName: "_moreButton", first: true, predicate: FD_OVERFLOW_EXPAND, descendants: true }, { propertyName: "_items", predicate: FD_OVERFLOW_ITEM_REF }, { propertyName: "_overflowItems", predicate: FD_OVERFLOW_ITEM }], viewQueries: [{ propertyName: "_itemsWrapper", first: true, predicate: ["itemsWrapper"], descendants: true }, { propertyName: "_layoutContainer", first: true, predicate: ["layoutContainer"], descendants: true }, { propertyName: "_showMoreContainer", first: true, predicate: ["showMoreContainer"], descendants: true }, { propertyName: "_visibleItems", predicate: OverflowLayoutItemContainerDirective, descendants: true }], ngImport: i0, template: "<div class=\"fd-overflow-layout__items-container\" #layoutContainer>\n <div class=\"fd-overflow-layout__items\" #itemsWrapper>\n <ng-container *ngFor=\"let item of _allItems; trackBy: _itemsTrackFn\">\n <div fdOverflowLayoutItemContainer>\n <ng-container *fdOverflowItemContainerRef>\n <ng-template\n [ngTemplateOutlet]=\"item.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.hidden, index: item.index }\"\n ></ng-template>\n </ng-container>\n </div>\n </ng-container>\n </div>\n</div>\n\n<div class=\"fd-overflow-layout__more\" *ngIf=\"_showMore\" #showMoreContainer>\n <ng-template #defaultShowMore>\n <fd-popover\n (isOpenChange)=\"_onPopoverStateChange($event)\"\n placement=\"bottom\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n [maxWidth]=\"312\"\n >\n <fd-popover-control>\n <button\n fd-button\n [fdMenu]=\"true\"\n i18n=\"@overflowLayout.moreItemsButton|Overflow Layout more button text\"\n fdType=\"transparent\"\n >\n {{ _hiddenItems.length }} more\n </button>\n </fd-popover-control>\n <fd-popover-body>\n <div fdOverflowLayoutPopoverContent [items]=\"_hiddenItems\">\n <ng-container *ngFor=\"let item of _hiddenItems\">\n <ng-template\n [ngTemplateOutlet]=\"item.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.hidden, index: item.index }\"\n ></ng-template>\n </ng-container>\n </div>\n </fd-popover-body>\n </fd-popover>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"_moreButton?.templateRef || defaultShowMore\"\n [ngTemplateOutletContext]=\"{ $implicit: _hiddenItems }\"\n ></ng-template>\n</div>\n", styles: [".fd-overflow-layout{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:flex;align-items:center;width:100%}.fd-overflow-layout:before,.fd-overflow-layout:after{box-sizing:inherit;font-size:inherit}.fd-overflow-layout__items{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:flex;align-items:center}.fd-overflow-layout__items:before,.fd-overflow-layout__items:after{box-sizing:inherit;font-size:inherit}.fd-overflow-layout__more{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:flex;align-items:center}.fd-overflow-layout__more:before,.fd-overflow-layout__more:after{box-sizing:inherit;font-size:inherit}.fd-overflow-layout__items-container{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:flex;align-items:center;width:0;flex:1 auto}.fd-overflow-layout__items-container:before,.fd-overflow-layout__items-container:after{box-sizing:inherit;font-size:inherit}.fd-overflow-layout__popover-container{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:block;white-space:normal}.fd-overflow-layout__popover-container:before,.fd-overflow-layout__popover-container:after{box-sizing:inherit;font-size:inherit}\n"], components: [{ type: i2.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { type: i2.PopoverControlComponent, selector: "fd-popover-control" }, { type: i3.ButtonComponent, selector: "button[fd-button], a[fd-button]", inputs: ["class"], exportAs: ["fd-button"] }, { type: i2.PopoverBodyComponent, selector: "fd-popover-body" }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: OverflowLayoutItemContainerDirective, selector: "[fdOverflowLayoutItemContainer]" }, { type: OverflowItemContainerRefDirective, selector: "[fdOverflowItemContainerRef]" }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: OverflowLayoutPopoverContentDirective, selector: "[fdOverflowLayoutPopoverContent]", inputs: ["items"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutComponent, decorators: [{
|
|
395
|
+
type: Component,
|
|
396
|
+
args: [{ selector: 'fd-overflow-layout', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
397
|
+
{
|
|
398
|
+
provide: FD_OVERFLOW_CONTAINER,
|
|
399
|
+
useExisting: OverflowLayoutComponent
|
|
400
|
+
}
|
|
401
|
+
], template: "<div class=\"fd-overflow-layout__items-container\" #layoutContainer>\n <div class=\"fd-overflow-layout__items\" #itemsWrapper>\n <ng-container *ngFor=\"let item of _allItems; trackBy: _itemsTrackFn\">\n <div fdOverflowLayoutItemContainer>\n <ng-container *fdOverflowItemContainerRef>\n <ng-template\n [ngTemplateOutlet]=\"item.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.hidden, index: item.index }\"\n ></ng-template>\n </ng-container>\n </div>\n </ng-container>\n </div>\n</div>\n\n<div class=\"fd-overflow-layout__more\" *ngIf=\"_showMore\" #showMoreContainer>\n <ng-template #defaultShowMore>\n <fd-popover\n (isOpenChange)=\"_onPopoverStateChange($event)\"\n placement=\"bottom\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n [maxWidth]=\"312\"\n >\n <fd-popover-control>\n <button\n fd-button\n [fdMenu]=\"true\"\n i18n=\"@overflowLayout.moreItemsButton|Overflow Layout more button text\"\n fdType=\"transparent\"\n >\n {{ _hiddenItems.length }} more\n </button>\n </fd-popover-control>\n <fd-popover-body>\n <div fdOverflowLayoutPopoverContent [items]=\"_hiddenItems\">\n <ng-container *ngFor=\"let item of _hiddenItems\">\n <ng-template\n [ngTemplateOutlet]=\"item.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.hidden, index: item.index }\"\n ></ng-template>\n </ng-container>\n </div>\n </fd-popover-body>\n </fd-popover>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"_moreButton?.templateRef || defaultShowMore\"\n [ngTemplateOutletContext]=\"{ $implicit: _hiddenItems }\"\n ></ng-template>\n</div>\n", styles: [".fd-overflow-layout{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:flex;align-items:center;width:100%}.fd-overflow-layout:before,.fd-overflow-layout:after{box-sizing:inherit;font-size:inherit}.fd-overflow-layout__items{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:flex;align-items:center}.fd-overflow-layout__items:before,.fd-overflow-layout__items:after{box-sizing:inherit;font-size:inherit}.fd-overflow-layout__more{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:flex;align-items:center}.fd-overflow-layout__more:before,.fd-overflow-layout__more:after{box-sizing:inherit;font-size:inherit}.fd-overflow-layout__items-container{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:flex;align-items:center;width:0;flex:1 auto}.fd-overflow-layout__items-container:before,.fd-overflow-layout__items-container:after{box-sizing:inherit;font-size:inherit}.fd-overflow-layout__popover-container{font-size:var(--sapFontSize);line-height:var(--sapContent_LineHeight);color:var(--sapTextColor);font-family:var(--sapFontFamily);font-weight:400;box-sizing:border-box;padding:0;margin:0;border:0;display:block;white-space:normal}.fd-overflow-layout__popover-container:before,.fd-overflow-layout__popover-container:after{box-sizing:inherit;font-size:inherit}\n"] }]
|
|
402
|
+
}], ctorParameters: function () {
|
|
403
|
+
return [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i1.RtlService, decorators: [{
|
|
404
|
+
type: Optional
|
|
405
|
+
}] }];
|
|
406
|
+
}, propDecorators: { maxVisibleItems: [{
|
|
407
|
+
type: Input
|
|
408
|
+
}], visibleItemsCount: [{
|
|
409
|
+
type: Output
|
|
410
|
+
}], hiddenItemsCount: [{
|
|
411
|
+
type: Output
|
|
412
|
+
}], _items: [{
|
|
413
|
+
type: ContentChildren,
|
|
414
|
+
args: [FD_OVERFLOW_ITEM_REF]
|
|
415
|
+
}], _moreButton: [{
|
|
416
|
+
type: ContentChild,
|
|
417
|
+
args: [FD_OVERFLOW_EXPAND]
|
|
418
|
+
}], _overflowItems: [{
|
|
419
|
+
type: ContentChildren,
|
|
420
|
+
args: [FD_OVERFLOW_ITEM]
|
|
421
|
+
}], _visibleItems: [{
|
|
422
|
+
type: ViewChildren,
|
|
423
|
+
args: [OverflowLayoutItemContainerDirective]
|
|
424
|
+
}], _itemsWrapper: [{
|
|
425
|
+
type: ViewChild,
|
|
426
|
+
args: ['itemsWrapper']
|
|
427
|
+
}], _layoutContainer: [{
|
|
428
|
+
type: ViewChild,
|
|
429
|
+
args: ['layoutContainer']
|
|
430
|
+
}], _showMoreContainer: [{
|
|
431
|
+
type: ViewChild,
|
|
432
|
+
args: ['showMoreContainer']
|
|
433
|
+
}], _initialClass: [{
|
|
434
|
+
type: HostBinding,
|
|
435
|
+
args: ['class']
|
|
436
|
+
}], _keyUpHandler: [{
|
|
437
|
+
type: HostListener,
|
|
438
|
+
args: ['keyup', ['$event']]
|
|
439
|
+
}] } });
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Structural directive which is used to pass the context of the item to the template engine.
|
|
443
|
+
*/
|
|
444
|
+
class OverflowItemRefDirective {
|
|
445
|
+
/** @hidden */
|
|
446
|
+
constructor(templateRef) {
|
|
447
|
+
this.templateRef = templateRef;
|
|
448
|
+
/**
|
|
449
|
+
* Whether the item is hidden.
|
|
450
|
+
*/
|
|
451
|
+
this.hidden = false;
|
|
452
|
+
}
|
|
453
|
+
/** @hidden */
|
|
454
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Sets the element reference of the `fdOverflowLayoutItem` directive.`
|
|
459
|
+
* @param elmRef
|
|
460
|
+
*/
|
|
461
|
+
setElementRef(elmRef) {
|
|
462
|
+
if (this.elementRef) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
this.elementRef = elmRef;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Sets the `fdOverflowLayoutItem` directive.
|
|
469
|
+
* @param item
|
|
470
|
+
*/
|
|
471
|
+
setOverflowItem(item) {
|
|
472
|
+
this.overflowItem = item;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
OverflowItemRefDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowItemRefDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
476
|
+
OverflowItemRefDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: OverflowItemRefDirective, selector: "[fdOverflowItemRef]", providers: [
|
|
477
|
+
{
|
|
478
|
+
provide: FD_OVERFLOW_ITEM_REF,
|
|
479
|
+
useExisting: OverflowItemRefDirective
|
|
480
|
+
}
|
|
481
|
+
], ngImport: i0 });
|
|
482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowItemRefDirective, decorators: [{
|
|
483
|
+
type: Directive,
|
|
484
|
+
args: [{
|
|
485
|
+
selector: '[fdOverflowItemRef]',
|
|
486
|
+
providers: [
|
|
487
|
+
{
|
|
488
|
+
provide: FD_OVERFLOW_ITEM_REF,
|
|
489
|
+
useExisting: OverflowItemRefDirective
|
|
490
|
+
}
|
|
491
|
+
]
|
|
492
|
+
}]
|
|
493
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Structural directive which is responsible for rendering the "More" button and handling further logic.
|
|
497
|
+
*/
|
|
498
|
+
class OverflowExpandDirective {
|
|
499
|
+
/** @hidden */
|
|
500
|
+
constructor(templateRef) {
|
|
501
|
+
this.templateRef = templateRef;
|
|
502
|
+
}
|
|
503
|
+
/** @hidden */
|
|
504
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
505
|
+
return true;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
OverflowExpandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowExpandDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
509
|
+
OverflowExpandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: OverflowExpandDirective, selector: "[fdOverflowExpand]", providers: [
|
|
510
|
+
{
|
|
511
|
+
provide: FD_OVERFLOW_EXPAND,
|
|
512
|
+
useExisting: OverflowExpandDirective
|
|
513
|
+
}
|
|
514
|
+
], ngImport: i0 });
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowExpandDirective, decorators: [{
|
|
516
|
+
type: Directive,
|
|
517
|
+
args: [{
|
|
518
|
+
selector: '[fdOverflowExpand]',
|
|
519
|
+
providers: [
|
|
520
|
+
{
|
|
521
|
+
provide: FD_OVERFLOW_EXPAND,
|
|
522
|
+
useExisting: OverflowExpandDirective
|
|
523
|
+
}
|
|
524
|
+
]
|
|
525
|
+
}]
|
|
526
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Directive to mark element as part of for Overflow Layout Component items.
|
|
530
|
+
*/
|
|
531
|
+
class OverflowLayoutItemDirective {
|
|
532
|
+
/** @hidden */
|
|
533
|
+
constructor(_overflowContainer, elmRef, _overflowItemRef) {
|
|
534
|
+
this._overflowContainer = _overflowContainer;
|
|
535
|
+
this.elmRef = elmRef;
|
|
536
|
+
this._overflowItemRef = _overflowItemRef;
|
|
537
|
+
/** Whether the item should be focusable. */
|
|
538
|
+
this.focusable = false;
|
|
539
|
+
/** @hidden */
|
|
540
|
+
this._forceVisibility = false;
|
|
541
|
+
}
|
|
542
|
+
/** Whether to force the visibility of the item. */
|
|
543
|
+
set forceVisibility(value) {
|
|
544
|
+
if (value === this._forceVisibility) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
this._forceVisibility = value;
|
|
548
|
+
this._overflowContainer.triggerRecalculation();
|
|
549
|
+
}
|
|
550
|
+
get forceVisibility() {
|
|
551
|
+
return this._forceVisibility;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Whether the item is hidden.
|
|
555
|
+
*/
|
|
556
|
+
get hidden() {
|
|
557
|
+
var _a;
|
|
558
|
+
return ((_a = this._overflowItemRef) === null || _a === void 0 ? void 0 : _a.hidden) === true;
|
|
559
|
+
}
|
|
560
|
+
/** @hidden */
|
|
561
|
+
get _tabindex() {
|
|
562
|
+
return this.focusable ? 0 : -1;
|
|
563
|
+
}
|
|
564
|
+
/** @hidden */
|
|
565
|
+
onFocus() {
|
|
566
|
+
this._overflowContainer.setFocusedElement(this);
|
|
567
|
+
}
|
|
568
|
+
/** @hidden */
|
|
569
|
+
ngOnInit() {
|
|
570
|
+
var _a, _b;
|
|
571
|
+
(_a = this._overflowItemRef) === null || _a === void 0 ? void 0 : _a.setElementRef(this.elmRef);
|
|
572
|
+
(_b = this._overflowItemRef) === null || _b === void 0 ? void 0 : _b.setOverflowItem(this);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Focuses connected to the DOM element.
|
|
576
|
+
*/
|
|
577
|
+
focus() {
|
|
578
|
+
var _a, _b, _c;
|
|
579
|
+
// Since we use detach() method of ViewContainerRef to remove elements from the visible list,
|
|
580
|
+
// we need to check that element is connected to the DOM.
|
|
581
|
+
this.elmRef.nativeElement.isConnected
|
|
582
|
+
? this.elmRef.nativeElement.focus()
|
|
583
|
+
: ((_a = this._overflowItemRef) === null || _a === void 0 ? void 0 : _a.elementRef.nativeElement.isConnected)
|
|
584
|
+
? (_b = this._overflowItemRef) === null || _b === void 0 ? void 0 : _b.elementRef.nativeElement.focus()
|
|
585
|
+
: (_c = this._overflowItemRef) === null || _c === void 0 ? void 0 : _c.overflowItem.elmRef.nativeElement.focus();
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
OverflowLayoutItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutItemDirective, deps: [{ token: OverflowLayoutComponent }, { token: i0.ElementRef }, { token: FD_OVERFLOW_ITEM_REF, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
589
|
+
OverflowLayoutItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: OverflowLayoutItemDirective, selector: "[fdOverflowLayoutItem]", inputs: { focusable: "focusable", forceVisibility: "forceVisibility" }, host: { listeners: { "focus": "onFocus()" }, properties: { "attr.tabindex": "this._tabindex" } }, providers: [
|
|
590
|
+
{
|
|
591
|
+
provide: FD_OVERFLOW_ITEM,
|
|
592
|
+
useExisting: OverflowLayoutItemDirective
|
|
593
|
+
}
|
|
594
|
+
], ngImport: i0 });
|
|
595
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutItemDirective, decorators: [{
|
|
596
|
+
type: Directive,
|
|
597
|
+
args: [{
|
|
598
|
+
selector: '[fdOverflowLayoutItem]',
|
|
599
|
+
providers: [
|
|
600
|
+
{
|
|
601
|
+
provide: FD_OVERFLOW_ITEM,
|
|
602
|
+
useExisting: OverflowLayoutItemDirective
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
}]
|
|
606
|
+
}], ctorParameters: function () {
|
|
607
|
+
return [{ type: OverflowLayoutComponent }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
608
|
+
type: Optional
|
|
609
|
+
}, {
|
|
610
|
+
type: SkipSelf
|
|
611
|
+
}, {
|
|
612
|
+
type: Inject,
|
|
613
|
+
args: [FD_OVERFLOW_ITEM_REF]
|
|
614
|
+
}] }];
|
|
615
|
+
}, propDecorators: { focusable: [{
|
|
616
|
+
type: Input
|
|
617
|
+
}], forceVisibility: [{
|
|
618
|
+
type: Input
|
|
619
|
+
}], _tabindex: [{
|
|
620
|
+
type: HostBinding,
|
|
621
|
+
args: ['attr.tabindex']
|
|
622
|
+
}], onFocus: [{
|
|
623
|
+
type: HostListener,
|
|
624
|
+
args: ['focus']
|
|
625
|
+
}] } });
|
|
626
|
+
|
|
627
|
+
class OverflowLayoutModule {
|
|
628
|
+
}
|
|
629
|
+
OverflowLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
630
|
+
OverflowLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutModule, declarations: [OverflowLayoutComponent,
|
|
631
|
+
OverflowItemRefDirective,
|
|
632
|
+
OverflowExpandDirective,
|
|
633
|
+
OverflowLayoutItemDirective,
|
|
634
|
+
OverflowItemContainerRefDirective,
|
|
635
|
+
OverflowLayoutPopoverContentDirective,
|
|
636
|
+
OverflowLayoutItemContainerDirective], imports: [CommonModule, PopoverModule, ButtonModule], exports: [OverflowLayoutComponent,
|
|
637
|
+
OverflowItemRefDirective,
|
|
638
|
+
OverflowExpandDirective,
|
|
639
|
+
OverflowLayoutItemDirective,
|
|
640
|
+
OverflowItemContainerRefDirective,
|
|
641
|
+
OverflowLayoutPopoverContentDirective] });
|
|
642
|
+
OverflowLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutModule, imports: [[CommonModule, PopoverModule, ButtonModule]] });
|
|
643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: OverflowLayoutModule, decorators: [{
|
|
644
|
+
type: NgModule,
|
|
645
|
+
args: [{
|
|
646
|
+
imports: [CommonModule, PopoverModule, ButtonModule],
|
|
647
|
+
exports: [
|
|
648
|
+
OverflowLayoutComponent,
|
|
649
|
+
OverflowItemRefDirective,
|
|
650
|
+
OverflowExpandDirective,
|
|
651
|
+
OverflowLayoutItemDirective,
|
|
652
|
+
OverflowItemContainerRefDirective,
|
|
653
|
+
OverflowLayoutPopoverContentDirective
|
|
654
|
+
],
|
|
655
|
+
declarations: [
|
|
656
|
+
OverflowLayoutComponent,
|
|
657
|
+
OverflowItemRefDirective,
|
|
658
|
+
OverflowExpandDirective,
|
|
659
|
+
OverflowLayoutItemDirective,
|
|
660
|
+
OverflowItemContainerRefDirective,
|
|
661
|
+
OverflowLayoutPopoverContentDirective,
|
|
662
|
+
OverflowLayoutItemContainerDirective
|
|
663
|
+
]
|
|
664
|
+
}]
|
|
665
|
+
}] });
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Generated bundle index. Do not edit.
|
|
669
|
+
*/
|
|
670
|
+
|
|
671
|
+
export { FD_OVERFLOW_EXPAND, FD_OVERFLOW_ITEM, FD_OVERFLOW_ITEM_REF, OverflowExpandDirective, OverflowItemContainerRefDirective, OverflowItemRefDirective, OverflowLayoutComponent, OverflowLayoutItemDirective, OverflowLayoutModule, OverflowLayoutPopoverContentDirective };
|
|
672
|
+
//# sourceMappingURL=fundamental-ngx-core-overflow-layout.mjs.map
|