@eui/mobile-core 18.0.0-next.7 → 18.0.0-next.8
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/docs/components/EuimSidebarContentComponent.html +220 -3
- package/docs/index.html +1 -1
- package/docs/interfaces/MenuItem.html +585 -0
- package/docs/js/menu-wc.js +3 -0
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/miscellaneous/typealiases.html +22 -1
- package/esm2022/lib/components/layout/euim-sidebar/euim-sidebar-content/euim-sidebar-content.component.mjs +47 -7
- package/fesm2022/eui-mobile-core.mjs +46 -7
- package/fesm2022/eui-mobile-core.mjs.map +1 -1
- package/lib/components/layout/euim-sidebar/euim-sidebar-content/euim-sidebar-content.component.d.ts +28 -5
- package/lib/components/layout/euim-sidebar/euim-sidebar-content/euim-sidebar-content.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -110,6 +110,9 @@
|
|
|
110
110
|
<tr>
|
|
111
111
|
<td class="col-md-4">
|
|
112
112
|
<ul class="index-list">
|
|
113
|
+
<li>
|
|
114
|
+
<a href="#IconColor" title="packages/eui-mobile/packages/core/src/lib/components/layout/euim-sidebar/euim-sidebar-content/euim-sidebar-content.component.ts" ><b>IconColor</b> (packages/.../euim-sidebar-content.component.ts)</a>
|
|
115
|
+
</li>
|
|
113
116
|
<li>
|
|
114
117
|
<a href="#SkeletonItemInputs" title="packages/eui-mobile/packages/core/src/lib/components/euim-skeleton-list/euim-skeleton-list.component.ts" ><b>SkeletonItemInputs</b> (packages/.../euim-skeleton-list.component.ts)</a>
|
|
115
118
|
</li>
|
|
@@ -123,7 +126,25 @@
|
|
|
123
126
|
</table>
|
|
124
127
|
</section>
|
|
125
128
|
|
|
126
|
-
<h3>packages/eui-mobile/packages/core/src/lib/components/euim-
|
|
129
|
+
<h3>packages/eui-mobile/packages/core/src/lib/components/layout/euim-sidebar/euim-sidebar-content/euim-sidebar-content.component.ts</h3>
|
|
130
|
+
<section data-compodoc="block-typealias">
|
|
131
|
+
<table class="table table-sm table-bordered">
|
|
132
|
+
<tbody>
|
|
133
|
+
<tr>
|
|
134
|
+
<td class="col-md-4">
|
|
135
|
+
<a name="IconColor"></a>
|
|
136
|
+
<span class="name "><b>IconColor</b><a href="#IconColor"><span class="icon ion-ios-link"></span></a></span>
|
|
137
|
+
</td>
|
|
138
|
+
</tr>
|
|
139
|
+
<tr>
|
|
140
|
+
<td class="col-md-4">
|
|
141
|
+
<code> <code>"primary" | "default" | "info" | "success" | "warning" | "danger" | "dark" | "white" | "accent" | "secondary"</code>
|
|
142
|
+
</code>
|
|
143
|
+
</td>
|
|
144
|
+
</tr>
|
|
145
|
+
</tbody>
|
|
146
|
+
</table>
|
|
147
|
+
</section> <h3>packages/eui-mobile/packages/core/src/lib/components/euim-skeleton-list/euim-skeleton-list.component.ts</h3>
|
|
127
148
|
<section data-compodoc="block-typealias">
|
|
128
149
|
<table class="table table-sm table-bordered">
|
|
129
150
|
<tbody>
|
|
@@ -1,18 +1,45 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, ViewChild, Output, EventEmitter, Component, HostBinding, Input, booleanAttribute } from '@angular/core';
|
|
2
|
+
import { IonSearchbar } from '@ionic/angular';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
import * as i1 from "@eui/core";
|
|
4
5
|
import * as i2 from "@ionic/angular";
|
|
5
6
|
export class EuimSidebarContentComponent {
|
|
6
|
-
constructor(i18nService, asService, navCtrl) {
|
|
7
|
+
constructor(i18nService, asService, menuCtrl, navCtrl) {
|
|
7
8
|
this.i18nService = i18nService;
|
|
8
9
|
this.asService = asService;
|
|
10
|
+
this.menuCtrl = menuCtrl;
|
|
9
11
|
this.navCtrl = navCtrl;
|
|
10
12
|
this.className = 'euim-sidebar-content';
|
|
11
13
|
this.sidebarItems = [];
|
|
14
|
+
this.hasSearchbar = false;
|
|
15
|
+
this.sidebarItemsFilter = new EventEmitter();
|
|
16
|
+
this.filteredItems = [];
|
|
17
|
+
this.query = '';
|
|
12
18
|
i18nService.init().subscribe();
|
|
13
19
|
}
|
|
14
20
|
ngOnInit() {
|
|
15
21
|
this.sortSidebarItems();
|
|
22
|
+
if (this.hasSearchbar) {
|
|
23
|
+
this.filteredItems = [...this.sidebarItems];
|
|
24
|
+
this.sidebarItemsFilter.emit(this.filteredItems);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
handleInput(event) {
|
|
28
|
+
this.query = event.detail.value.toLowerCase();
|
|
29
|
+
this.filteredItems = this.filterMenuItems(this.sidebarItems, this.query);
|
|
30
|
+
this.sidebarItemsFilter.emit(this.filteredItems);
|
|
31
|
+
if (this.query === '') {
|
|
32
|
+
this.sidebarItemsFilter.emit(this.sidebarItems);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
closeMenu() {
|
|
36
|
+
if (!this.hasSearchbar)
|
|
37
|
+
return;
|
|
38
|
+
this.menuCtrl.close().then(() => {
|
|
39
|
+
this.sidebarItemsFilter.emit(this.sidebarItems);
|
|
40
|
+
this.query = '';
|
|
41
|
+
this.searchbar.value = '';
|
|
42
|
+
});
|
|
16
43
|
}
|
|
17
44
|
sortSidebarItems() {
|
|
18
45
|
this.sidebarItems.sort((a, b) => {
|
|
@@ -22,15 +49,28 @@ export class EuimSidebarContentComponent {
|
|
|
22
49
|
return a.group - b.group;
|
|
23
50
|
});
|
|
24
51
|
}
|
|
25
|
-
|
|
26
|
-
|
|
52
|
+
filterMenuItems(items, searchPhrase) {
|
|
53
|
+
return items.filter(item => {
|
|
54
|
+
return !item.isSection && item.label.toLowerCase().includes(searchPhrase.toLowerCase());
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: EuimSidebarContentComponent, deps: [{ token: i1.I18nService }, { token: i1.EuiAppShellService }, { token: i2.MenuController }, { token: i2.NavController }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
58
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: EuimSidebarContentComponent, selector: "euim-sidebar-content", inputs: { sidebarItems: "sidebarItems", hasSearchbar: ["hasSearchbar", "hasSearchbar", booleanAttribute] }, outputs: { sidebarItemsFilter: "sidebarItemsFilter" }, host: { properties: { "className": "this.className" } }, viewQueries: [{ propertyName: "searchbar", first: true, predicate: IonSearchbar, descendants: true }], ngImport: i0, template: "<ion-list class=\"euim-sidebar-content__list\">\n @if (hasSearchbar) {\n <ion-searchbar (ionInput)=\"handleInput($event)\"></ion-searchbar>\n }\n <ion-menu-toggle auto-hide=\"true\" (click)=\"closeMenu()\">\n <ng-content></ng-content>\n </ion-menu-toggle>\n</ion-list>\n\n", dependencies: [{ kind: "component", type: i2.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: i2.IonMenuToggle, selector: "ion-menu-toggle", inputs: ["autoHide", "menu"] }, { kind: "component", type: i2.IonSearchbar, selector: "ion-searchbar", inputs: ["animated", "autocapitalize", "autocomplete", "autocorrect", "cancelButtonIcon", "cancelButtonText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "maxlength", "minlength", "mode", "name", "placeholder", "searchIcon", "showCancelButton", "showClearButton", "spellcheck", "type", "value"] }, { kind: "directive", type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
27
59
|
}
|
|
28
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: EuimSidebarContentComponent, decorators: [{
|
|
29
61
|
type: Component,
|
|
30
|
-
args: [{ selector: 'euim-sidebar-content', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-list class=\"euim-sidebar-content__list\">\n <ion-menu-toggle auto-hide=\"true\">\n <ng-content></ng-content>\n </ion-menu-toggle>\n</ion-list>\n" }]
|
|
31
|
-
}], ctorParameters: () => [{ type: i1.I18nService }, { type: i1.EuiAppShellService }, { type: i2.NavController }], propDecorators: { className: [{
|
|
62
|
+
args: [{ selector: 'euim-sidebar-content', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-list class=\"euim-sidebar-content__list\">\n @if (hasSearchbar) {\n <ion-searchbar (ionInput)=\"handleInput($event)\"></ion-searchbar>\n }\n <ion-menu-toggle auto-hide=\"true\" (click)=\"closeMenu()\">\n <ng-content></ng-content>\n </ion-menu-toggle>\n</ion-list>\n\n" }]
|
|
63
|
+
}], ctorParameters: () => [{ type: i1.I18nService }, { type: i1.EuiAppShellService }, { type: i2.MenuController }, { type: i2.NavController }], propDecorators: { className: [{
|
|
32
64
|
type: HostBinding
|
|
33
65
|
}], sidebarItems: [{
|
|
34
66
|
type: Input
|
|
67
|
+
}], hasSearchbar: [{
|
|
68
|
+
type: Input,
|
|
69
|
+
args: [{ transform: booleanAttribute }]
|
|
70
|
+
}], sidebarItemsFilter: [{
|
|
71
|
+
type: Output
|
|
72
|
+
}], searchbar: [{
|
|
73
|
+
type: ViewChild,
|
|
74
|
+
args: [IonSearchbar, { static: false }]
|
|
35
75
|
}] } });
|
|
36
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
76
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXVpbS1zaWRlYmFyLWNvbnRlbnQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9jb21wb25lbnRzL2xheW91dC9ldWltLXNpZGViYXIvZXVpbS1zaWRlYmFyLWNvbnRlbnQvZXVpbS1zaWRlYmFyLWNvbnRlbnQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi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tbWVudS10b2dnbGU+XG48L2lvbi1saXN0PlxuXG4iXX0=
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getI18nServiceConfig } from '@eui/base';
|
|
2
2
|
export * from '@eui/base';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, booleanAttribute, Directive, Input, numberAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, NgModule, Inject, EventEmitter, Output, ContentChildren, ContentChild,
|
|
4
|
+
import { Injectable, booleanAttribute, Directive, Input, numberAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, NgModule, Inject, EventEmitter, Output, ViewChild, ContentChildren, ContentChild, HostListener } from '@angular/core';
|
|
5
5
|
import { BehaviorSubject, Subject, throwError } from 'rxjs';
|
|
6
6
|
import * as i2$1 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
import * as i3 from '@ionic/angular';
|
|
9
|
-
import { IonicModule } from '@ionic/angular';
|
|
9
|
+
import { IonicModule, IonSearchbar } from '@ionic/angular';
|
|
10
10
|
import * as i1 from '@eui/core';
|
|
11
11
|
import { EuiEuLanguages, GLOBAL_CONFIG_TOKEN } from '@eui/core';
|
|
12
12
|
import { takeUntil, startWith, switchMap, map, catchError } from 'rxjs/operators';
|
|
@@ -1128,16 +1128,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImpor
|
|
|
1128
1128
|
}] } });
|
|
1129
1129
|
|
|
1130
1130
|
class EuimSidebarContentComponent {
|
|
1131
|
-
constructor(i18nService, asService, navCtrl) {
|
|
1131
|
+
constructor(i18nService, asService, menuCtrl, navCtrl) {
|
|
1132
1132
|
this.i18nService = i18nService;
|
|
1133
1133
|
this.asService = asService;
|
|
1134
|
+
this.menuCtrl = menuCtrl;
|
|
1134
1135
|
this.navCtrl = navCtrl;
|
|
1135
1136
|
this.className = 'euim-sidebar-content';
|
|
1136
1137
|
this.sidebarItems = [];
|
|
1138
|
+
this.hasSearchbar = false;
|
|
1139
|
+
this.sidebarItemsFilter = new EventEmitter();
|
|
1140
|
+
this.filteredItems = [];
|
|
1141
|
+
this.query = '';
|
|
1137
1142
|
i18nService.init().subscribe();
|
|
1138
1143
|
}
|
|
1139
1144
|
ngOnInit() {
|
|
1140
1145
|
this.sortSidebarItems();
|
|
1146
|
+
if (this.hasSearchbar) {
|
|
1147
|
+
this.filteredItems = [...this.sidebarItems];
|
|
1148
|
+
this.sidebarItemsFilter.emit(this.filteredItems);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
handleInput(event) {
|
|
1152
|
+
this.query = event.detail.value.toLowerCase();
|
|
1153
|
+
this.filteredItems = this.filterMenuItems(this.sidebarItems, this.query);
|
|
1154
|
+
this.sidebarItemsFilter.emit(this.filteredItems);
|
|
1155
|
+
if (this.query === '') {
|
|
1156
|
+
this.sidebarItemsFilter.emit(this.sidebarItems);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
closeMenu() {
|
|
1160
|
+
if (!this.hasSearchbar)
|
|
1161
|
+
return;
|
|
1162
|
+
this.menuCtrl.close().then(() => {
|
|
1163
|
+
this.sidebarItemsFilter.emit(this.sidebarItems);
|
|
1164
|
+
this.query = '';
|
|
1165
|
+
this.searchbar.value = '';
|
|
1166
|
+
});
|
|
1141
1167
|
}
|
|
1142
1168
|
sortSidebarItems() {
|
|
1143
1169
|
this.sidebarItems.sort((a, b) => {
|
|
@@ -1147,16 +1173,29 @@ class EuimSidebarContentComponent {
|
|
|
1147
1173
|
return a.group - b.group;
|
|
1148
1174
|
});
|
|
1149
1175
|
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1176
|
+
filterMenuItems(items, searchPhrase) {
|
|
1177
|
+
return items.filter(item => {
|
|
1178
|
+
return !item.isSection && item.label.toLowerCase().includes(searchPhrase.toLowerCase());
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: EuimSidebarContentComponent, deps: [{ token: i1.I18nService }, { token: i1.EuiAppShellService }, { token: i3.MenuController }, { token: i3.NavController }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1182
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: EuimSidebarContentComponent, selector: "euim-sidebar-content", inputs: { sidebarItems: "sidebarItems", hasSearchbar: ["hasSearchbar", "hasSearchbar", booleanAttribute] }, outputs: { sidebarItemsFilter: "sidebarItemsFilter" }, host: { properties: { "className": "this.className" } }, viewQueries: [{ propertyName: "searchbar", first: true, predicate: IonSearchbar, descendants: true }], ngImport: i0, template: "<ion-list class=\"euim-sidebar-content__list\">\n @if (hasSearchbar) {\n <ion-searchbar (ionInput)=\"handleInput($event)\"></ion-searchbar>\n }\n <ion-menu-toggle auto-hide=\"true\" (click)=\"closeMenu()\">\n <ng-content></ng-content>\n </ion-menu-toggle>\n</ion-list>\n\n", dependencies: [{ kind: "component", type: i3.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: i3.IonMenuToggle, selector: "ion-menu-toggle", inputs: ["autoHide", "menu"] }, { kind: "component", type: i3.IonSearchbar, selector: "ion-searchbar", inputs: ["animated", "autocapitalize", "autocomplete", "autocorrect", "cancelButtonIcon", "cancelButtonText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "maxlength", "minlength", "mode", "name", "placeholder", "searchIcon", "showCancelButton", "showClearButton", "spellcheck", "type", "value"] }, { kind: "directive", type: i3.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1152
1183
|
}
|
|
1153
1184
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: EuimSidebarContentComponent, decorators: [{
|
|
1154
1185
|
type: Component,
|
|
1155
|
-
args: [{ selector: 'euim-sidebar-content', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-list class=\"euim-sidebar-content__list\">\n <ion-menu-toggle auto-hide=\"true\">\n <ng-content></ng-content>\n </ion-menu-toggle>\n</ion-list>\n" }]
|
|
1156
|
-
}], ctorParameters: () => [{ type: i1.I18nService }, { type: i1.EuiAppShellService }, { type: i3.NavController }], propDecorators: { className: [{
|
|
1186
|
+
args: [{ selector: 'euim-sidebar-content', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-list class=\"euim-sidebar-content__list\">\n @if (hasSearchbar) {\n <ion-searchbar (ionInput)=\"handleInput($event)\"></ion-searchbar>\n }\n <ion-menu-toggle auto-hide=\"true\" (click)=\"closeMenu()\">\n <ng-content></ng-content>\n </ion-menu-toggle>\n</ion-list>\n\n" }]
|
|
1187
|
+
}], ctorParameters: () => [{ type: i1.I18nService }, { type: i1.EuiAppShellService }, { type: i3.MenuController }, { type: i3.NavController }], propDecorators: { className: [{
|
|
1157
1188
|
type: HostBinding
|
|
1158
1189
|
}], sidebarItems: [{
|
|
1159
1190
|
type: Input
|
|
1191
|
+
}], hasSearchbar: [{
|
|
1192
|
+
type: Input,
|
|
1193
|
+
args: [{ transform: booleanAttribute }]
|
|
1194
|
+
}], sidebarItemsFilter: [{
|
|
1195
|
+
type: Output
|
|
1196
|
+
}], searchbar: [{
|
|
1197
|
+
type: ViewChild,
|
|
1198
|
+
args: [IonSearchbar, { static: false }]
|
|
1160
1199
|
}] } });
|
|
1161
1200
|
|
|
1162
1201
|
class EuimSidebarModule {
|