@eui/mobile-core 16.7.0-snapshot-1709649502644 → 16.7.0-snapshot-1709721306777
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/EuimMultiselectComponent.html +24 -0
- package/docs/js/search/search_index.js +2 -2
- package/esm2022/lib/components/base-states.directive.mjs +14 -14
- package/esm2022/lib/components/euim-chip-selector/euim-chip-selector.component.mjs +5 -3
- package/esm2022/lib/components/euim-multiselect/euim-multiselect-all/euim-multiselect-all.directive.mjs +7 -1
- package/esm2022/lib/components/euim-multiselect/euim-multiselect-filter/euim-multiselect-filter.component.mjs +14 -6
- package/esm2022/lib/components/euim-multiselect/euim-multiselect-select-field/euim-multiselect-select-field.directive.mjs +7 -1
- package/esm2022/lib/components/euim-multiselect/euim-multiselect.component.mjs +27 -3
- package/fesm2022/eui-mobile-core.mjs +66 -22
- package/fesm2022/eui-mobile-core.mjs.map +1 -1
- package/lib/components/base-states.directive.d.ts +13 -13
- package/lib/components/euim-chip-selector/euim-chip-selector.component.d.ts +1 -1
- package/lib/components/euim-chip-selector/euim-chip-selector.component.d.ts.map +1 -1
- package/lib/components/euim-multiselect/euim-multiselect-all/euim-multiselect-all.directive.d.ts.map +1 -1
- package/lib/components/euim-multiselect/euim-multiselect-filter/euim-multiselect-filter.component.d.ts.map +1 -1
- package/lib/components/euim-multiselect/euim-multiselect-select-field/euim-multiselect-select-field.directive.d.ts.map +1 -1
- package/lib/components/euim-multiselect/euim-multiselect.component.d.ts +3 -1
- package/lib/components/euim-multiselect/euim-multiselect.component.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -52,62 +52,62 @@ class BaseStatesDirective {
|
|
|
52
52
|
constructor() {
|
|
53
53
|
// COLORS
|
|
54
54
|
/**
|
|
55
|
-
* @deprecated Will be removed in
|
|
55
|
+
* @deprecated Will be removed in v17.
|
|
56
56
|
* Please use {@link color} property instead
|
|
57
57
|
*/
|
|
58
58
|
this.euimPrimary = false;
|
|
59
59
|
/**
|
|
60
|
-
* @deprecated Will be removed in
|
|
60
|
+
* @deprecated Will be removed in v17.
|
|
61
61
|
* Please use {@link color} property instead
|
|
62
62
|
*/
|
|
63
63
|
this.euimSecondary = false;
|
|
64
64
|
/**
|
|
65
|
-
* @deprecated Will be removed in
|
|
65
|
+
* @deprecated Will be removed in v17.
|
|
66
66
|
* Please use {@link color} property instead
|
|
67
67
|
*/
|
|
68
68
|
this.euimInfo = false;
|
|
69
69
|
/**
|
|
70
|
-
* @deprecated Will be removed in
|
|
70
|
+
* @deprecated Will be removed in v17.
|
|
71
71
|
* Please use {@link color} property instead
|
|
72
72
|
*/
|
|
73
73
|
this.euimSuccess = false;
|
|
74
74
|
/**
|
|
75
|
-
* @deprecated Will be removed in
|
|
75
|
+
* @deprecated Will be removed in v17.
|
|
76
76
|
* Please use {@link color} property instead
|
|
77
77
|
*/
|
|
78
78
|
this.euimWarning = false;
|
|
79
79
|
/**
|
|
80
|
-
* @deprecated Will be removed in
|
|
80
|
+
* @deprecated Will be removed in v17.
|
|
81
81
|
* Please use {@link color} property instead
|
|
82
82
|
*/
|
|
83
83
|
this.euimDanger = false;
|
|
84
84
|
/**
|
|
85
|
-
* @deprecated Will be removed in
|
|
85
|
+
* @deprecated Will be removed in v17.
|
|
86
86
|
* Please use {@link color} property instead
|
|
87
87
|
*/
|
|
88
88
|
this.euimAccent = false;
|
|
89
89
|
/**
|
|
90
|
-
* @deprecated Will be removed in
|
|
90
|
+
* @deprecated Will be removed in v17.
|
|
91
91
|
* Please use {@link color} property instead
|
|
92
92
|
*/
|
|
93
93
|
this.euimDefault = false;
|
|
94
94
|
/**
|
|
95
|
-
* @deprecated Will be removed in
|
|
95
|
+
* @deprecated Will be removed in v17.
|
|
96
96
|
* Please use {@link color} property instead
|
|
97
97
|
*/
|
|
98
98
|
this.euimDark = false;
|
|
99
99
|
/**
|
|
100
|
-
* @deprecated Will be removed in
|
|
100
|
+
* @deprecated Will be removed in v17.
|
|
101
101
|
* Please use {@link color} property instead
|
|
102
102
|
*/
|
|
103
103
|
this.euimWhite = false;
|
|
104
104
|
/**
|
|
105
|
-
* @deprecated Will be removed in
|
|
105
|
+
* @deprecated Will be removed in v17.
|
|
106
106
|
* Please use {@link color} property instead
|
|
107
107
|
*/
|
|
108
108
|
this.euimLight = false;
|
|
109
109
|
/**
|
|
110
|
-
* @deprecated Will be removed in
|
|
110
|
+
* @deprecated Will be removed in v17.
|
|
111
111
|
* Please use {@link color} property instead
|
|
112
112
|
*/
|
|
113
113
|
this.euimClear = false;
|
|
@@ -138,7 +138,7 @@ class BaseStatesDirective {
|
|
|
138
138
|
this._color = '';
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
|
-
* @deprecated Will be removed in
|
|
141
|
+
* @deprecated Will be removed in v17.
|
|
142
142
|
* Please use {@link color} property instead
|
|
143
143
|
*/
|
|
144
144
|
get euimVariant() {
|
|
@@ -3405,7 +3405,7 @@ class EuimChipSelectorComponent {
|
|
|
3405
3405
|
constructor() {
|
|
3406
3406
|
this.backgroundColor = 'primary';
|
|
3407
3407
|
/**
|
|
3408
|
-
* @deprecated Will be removed in
|
|
3408
|
+
* @deprecated Will be removed in v17.
|
|
3409
3409
|
* Please use {@link color} property instead
|
|
3410
3410
|
*/
|
|
3411
3411
|
this.chipColor = 'white';
|
|
@@ -3431,7 +3431,9 @@ class EuimChipSelectorComponent {
|
|
|
3431
3431
|
this.updateChipsAndFilters();
|
|
3432
3432
|
}
|
|
3433
3433
|
ngOnChanges(changes) {
|
|
3434
|
-
if (this.euimChipSelectorItemComponent && this.euimChipSelectorItemComponent.length > 0
|
|
3434
|
+
if (this.euimChipSelectorItemComponent && this.euimChipSelectorItemComponent.length > 0 &&
|
|
3435
|
+
changes.selectedChips.currentValue && changes.selectedChips.currentValue.length === 1 &&
|
|
3436
|
+
changes.selectedChips.currentValue.every((value, index) => value === '0')) {
|
|
3435
3437
|
this.clearFiltersAndSelectAll();
|
|
3436
3438
|
}
|
|
3437
3439
|
}
|
|
@@ -3819,9 +3821,14 @@ class EuimMultiselectComponent {
|
|
|
3819
3821
|
constructor(ref) {
|
|
3820
3822
|
this.ref = ref;
|
|
3821
3823
|
this.className = 'euim-multiselect';
|
|
3824
|
+
this.euimKeepSelection = false;
|
|
3822
3825
|
this.numberOfSelected = 0;
|
|
3823
3826
|
}
|
|
3824
3827
|
ngOnInit() {
|
|
3828
|
+
if (this.euimKeepSelection) {
|
|
3829
|
+
this.currentDataProvider =
|
|
3830
|
+
[...this.currentDataProvider]?.map((obj, index) => ({ ...obj, _id: index + 1 }));
|
|
3831
|
+
}
|
|
3825
3832
|
this.initialDataProvider = this.currentDataProvider;
|
|
3826
3833
|
}
|
|
3827
3834
|
selectAllItems() {
|
|
@@ -3839,7 +3846,15 @@ class EuimMultiselectComponent {
|
|
|
3839
3846
|
}
|
|
3840
3847
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3841
3848
|
selectedItems() {
|
|
3842
|
-
|
|
3849
|
+
if (this.euimKeepSelection) {
|
|
3850
|
+
const filteredItemsWithoutId = this.currentDataProvider
|
|
3851
|
+
?.filter(item => item.selected)
|
|
3852
|
+
.map(({ _id, ...rest }) => rest);
|
|
3853
|
+
return filteredItemsWithoutId;
|
|
3854
|
+
}
|
|
3855
|
+
else {
|
|
3856
|
+
return this.currentDataProvider?.filter(item => item.selected);
|
|
3857
|
+
}
|
|
3843
3858
|
}
|
|
3844
3859
|
selectByIndex(index, state = true) {
|
|
3845
3860
|
if (index < this.currentDataProvider?.length) {
|
|
@@ -3853,12 +3868,19 @@ class EuimMultiselectComponent {
|
|
|
3853
3868
|
if (changes.currentDataProvider &&
|
|
3854
3869
|
changes.currentDataProvider.currentValue
|
|
3855
3870
|
&& changes.currentDataProvider.previousValue === null) {
|
|
3871
|
+
if (this.euimKeepSelection) {
|
|
3872
|
+
this.currentDataProvider =
|
|
3873
|
+
[...this.currentDataProvider]?.map((obj, index) => ({ ...obj, _id: index + 1 }));
|
|
3874
|
+
}
|
|
3856
3875
|
this.initialDataProvider = changes.currentDataProvider.currentValue;
|
|
3857
3876
|
}
|
|
3858
3877
|
}
|
|
3859
3878
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EuimMultiselectComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3860
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EuimMultiselectComponent, selector: "euim-multiselect", inputs: { currentDataProvider: "currentDataProvider", toolbarTitle: "toolbarTitle" }, host: { properties: { "class": "this.className" } }, usesOnChanges: true, ngImport: i0, template: "<ion-header>\n <ion-toolbar color=\"light\" class=\"euim-multiselect__toolbar\">\n <ng-content select=\"euim-multiselect-toolbar\"></ng-content>\n <ion-toolbar color=\"light\">\n <ng-content select=\"euim-multiselect-filter\"></ng-content>\n </ion-toolbar>\n </ion-toolbar>\n</ion-header>\n\n<ng-container *ngIf=\"currentDataProvider?.length > 0\">\n <ng-content select=\"euim-multiselect-list\">\n\n </ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"currentDataProvider?.length === 0\">\n <ng-content select=\"euim-empty-list-placeholder\">\n </ng-content>\n</ng-container>\n\n\n\n", styles: [".euim-multiselect__toolbar{color:var(--eui-base-color-grey-100)}.euim-multiselect__toolbar--title{font:normal normal 400 1.25rem/1.5rem var(--eui-base-font-family);font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
3879
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EuimMultiselectComponent, selector: "euim-multiselect", inputs: { currentDataProvider: "currentDataProvider", toolbarTitle: "toolbarTitle", euimKeepSelection: "euimKeepSelection" }, host: { properties: { "class": "this.className" } }, usesOnChanges: true, ngImport: i0, template: "<ion-header>\n <ion-toolbar color=\"light\" class=\"euim-multiselect__toolbar\">\n <ng-content select=\"euim-multiselect-toolbar\"></ng-content>\n <ion-toolbar color=\"light\">\n <ng-content select=\"euim-multiselect-filter\"></ng-content>\n </ion-toolbar>\n </ion-toolbar>\n</ion-header>\n\n<ng-container *ngIf=\"currentDataProvider?.length > 0\">\n <ng-content select=\"euim-multiselect-list\">\n\n </ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"currentDataProvider?.length === 0\">\n <ng-content select=\"euim-empty-list-placeholder\">\n </ng-content>\n</ng-container>\n\n\n\n", styles: [".euim-multiselect__toolbar{color:var(--eui-base-color-grey-100)}.euim-multiselect__toolbar--title{font:normal normal 400 1.25rem/1.5rem var(--eui-base-font-family);font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
3861
3880
|
}
|
|
3881
|
+
__decorate([
|
|
3882
|
+
coerceBoolean
|
|
3883
|
+
], EuimMultiselectComponent.prototype, "euimKeepSelection", void 0);
|
|
3862
3884
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EuimMultiselectComponent, decorators: [{
|
|
3863
3885
|
type: Component,
|
|
3864
3886
|
args: [{ selector: 'euim-multiselect', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ion-header>\n <ion-toolbar color=\"light\" class=\"euim-multiselect__toolbar\">\n <ng-content select=\"euim-multiselect-toolbar\"></ng-content>\n <ion-toolbar color=\"light\">\n <ng-content select=\"euim-multiselect-filter\"></ng-content>\n </ion-toolbar>\n </ion-toolbar>\n</ion-header>\n\n<ng-container *ngIf=\"currentDataProvider?.length > 0\">\n <ng-content select=\"euim-multiselect-list\">\n\n </ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"currentDataProvider?.length === 0\">\n <ng-content select=\"euim-empty-list-placeholder\">\n </ng-content>\n</ng-container>\n\n\n\n", styles: [".euim-multiselect__toolbar{color:var(--eui-base-color-grey-100)}.euim-multiselect__toolbar--title{font:normal normal 400 1.25rem/1.5rem var(--eui-base-font-family);font-weight:700}\n"] }]
|
|
@@ -3869,6 +3891,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3869
3891
|
type: Input
|
|
3870
3892
|
}], toolbarTitle: [{
|
|
3871
3893
|
type: Input
|
|
3894
|
+
}], euimKeepSelection: [{
|
|
3895
|
+
type: Input
|
|
3872
3896
|
}] } });
|
|
3873
3897
|
|
|
3874
3898
|
class EuimMultiselectFilterComponent {
|
|
@@ -3879,12 +3903,20 @@ class EuimMultiselectFilterComponent {
|
|
|
3879
3903
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3880
3904
|
handleChange(event) {
|
|
3881
3905
|
const query = event.detail.value.toLowerCase();
|
|
3882
|
-
this.multiselect.
|
|
3883
|
-
|
|
3884
|
-
|
|
3906
|
+
if (!this.multiselect.euimKeepSelection) {
|
|
3907
|
+
this.multiselect.selectAll = false;
|
|
3908
|
+
this.multiselect.indeterminate = false;
|
|
3909
|
+
this.multiselect.currentDataProvider?.forEach((item) => (item.selected = false));
|
|
3910
|
+
}
|
|
3885
3911
|
if (query === '') {
|
|
3886
|
-
this.multiselect.
|
|
3887
|
-
this.multiselect.
|
|
3912
|
+
if (!this.multiselect.euimKeepSelection) {
|
|
3913
|
+
this.multiselect.currentDataProvider =
|
|
3914
|
+
this.multiselect.initialDataProvider;
|
|
3915
|
+
}
|
|
3916
|
+
else {
|
|
3917
|
+
this.multiselect.currentDataProvider =
|
|
3918
|
+
this.multiselect.initialDataProvider;
|
|
3919
|
+
}
|
|
3888
3920
|
}
|
|
3889
3921
|
else {
|
|
3890
3922
|
this.multiselect.currentDataProvider =
|
|
@@ -3914,9 +3946,15 @@ class EuimMultiselectAllDirective {
|
|
|
3914
3946
|
this.euimMulti.indeterminate = false;
|
|
3915
3947
|
if (event.detail.checked) {
|
|
3916
3948
|
this.euimMulti.numberOfSelected = this.euimMulti.currentDataProvider?.length;
|
|
3949
|
+
if (this.euimMulti.euimKeepSelection) {
|
|
3950
|
+
this.euimMulti.initialDataProvider?.forEach((item) => (item.selected = true));
|
|
3951
|
+
}
|
|
3917
3952
|
}
|
|
3918
3953
|
else {
|
|
3919
3954
|
this.euimMulti.numberOfSelected = 0;
|
|
3955
|
+
if (this.euimMulti.euimKeepSelection) {
|
|
3956
|
+
this.euimMulti.initialDataProvider?.forEach((item) => (item.selected = false));
|
|
3957
|
+
}
|
|
3920
3958
|
}
|
|
3921
3959
|
}
|
|
3922
3960
|
get indeterminate() {
|
|
@@ -3970,6 +4008,12 @@ class EuimMultiselectSelectFieldDirective {
|
|
|
3970
4008
|
}
|
|
3971
4009
|
onIonChange(event) {
|
|
3972
4010
|
this.item.selected = event.detail.checked;
|
|
4011
|
+
if (this.euimMulti.euimKeepSelection) {
|
|
4012
|
+
const foundItem = this.euimMulti.initialDataProvider.find(item => item._id === this.item);
|
|
4013
|
+
if (foundItem) {
|
|
4014
|
+
foundItem._id = event.detail.checked;
|
|
4015
|
+
}
|
|
4016
|
+
}
|
|
3973
4017
|
const isSelectAll = this.euimMulti.currentDataProvider?.every((item) => item.selected);
|
|
3974
4018
|
this.euimMulti.indeterminate = !isSelectAll && this.euimMulti.currentDataProvider?.some((item) => item.selected);
|
|
3975
4019
|
if (!this.euimMulti.indeterminate) {
|