@acorex/components 1.3.83 → 1.3.87
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/acorex-components.metadata.json +1 -1
- package/bundles/acorex-components.umd.js +95 -44
- package/bundles/acorex-components.umd.js.map +1 -1
- package/bundles/acorex-components.umd.min.js +2 -2
- package/bundles/acorex-components.umd.min.js.map +1 -1
- package/esm2015/lib/selectbox/selectbox.component.js +75 -24
- package/esm5/lib/selectbox/selectbox.component.js +93 -41
- package/fesm2015/acorex-components.js +74 -23
- package/fesm2015/acorex-components.js.map +1 -1
- package/fesm5/acorex-components.js +92 -40
- package/fesm5/acorex-components.js.map +1 -1
- package/lib/selectbox/selectbox.component.d.ts +2 -0
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ import { trigger, state, style, transition, animate } from '@angular/animations'
|
|
|
14
14
|
import { TextMaskModule } from 'angular2-text-mask';
|
|
15
15
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
16
16
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
17
|
+
import { differenceBy } from 'lodash';
|
|
17
18
|
import { RouterModule } from '@angular/router';
|
|
18
19
|
|
|
19
20
|
// @dynamic
|
|
@@ -7753,6 +7754,7 @@ let AXSelectBoxComponent = AXSelectBoxComponent_1 = class AXSelectBoxComponent e
|
|
|
7753
7754
|
this.onBlur = new EventEmitter();
|
|
7754
7755
|
this.onFocus = new EventEmitter();
|
|
7755
7756
|
this._items = [];
|
|
7757
|
+
this.hasSelectedValue = false;
|
|
7756
7758
|
this.itemsFiltered = [];
|
|
7757
7759
|
// #endregion
|
|
7758
7760
|
this.dropDownDisabled = false;
|
|
@@ -7791,6 +7793,25 @@ let AXSelectBoxComponent = AXSelectBoxComponent_1 = class AXSelectBoxComponent e
|
|
|
7791
7793
|
return this._selectedItems || [];
|
|
7792
7794
|
}
|
|
7793
7795
|
set selectedItems(v) {
|
|
7796
|
+
this.setSelectedItemsChange(v);
|
|
7797
|
+
// if (!v) {
|
|
7798
|
+
// v = [];
|
|
7799
|
+
// }
|
|
7800
|
+
// const old = this.selectedItems;
|
|
7801
|
+
// if (JSON.stringify(old) !== JSON.stringify(v)) {
|
|
7802
|
+
// this._selectedItems = this.mode == 'single' ? v.slice(0, 1) : [...new Set(v)]; //[...new Set(v[0])] : [...new Set(v)];
|
|
7803
|
+
// this._selectedItems.forEach((c) => (c.selected = true));
|
|
7804
|
+
// this.selectedItemsChange.emit(this._selectedItems);
|
|
7805
|
+
// this.selectedValuesChange.emit(this.selectedValues);
|
|
7806
|
+
// this.clearValidationStyle(this.ref.nativeElement);
|
|
7807
|
+
// this.waitForData(() => {
|
|
7808
|
+
// if (this._selectedItems) {
|
|
7809
|
+
// this.items.forEach((c) => (c.selected = this._selectedItems.some((i) => i[this.valueField] == c[this.valueField])));
|
|
7810
|
+
// }
|
|
7811
|
+
// });
|
|
7812
|
+
// }
|
|
7813
|
+
}
|
|
7814
|
+
setSelectedItemsChange(v) {
|
|
7794
7815
|
if (!v) {
|
|
7795
7816
|
v = [];
|
|
7796
7817
|
}
|
|
@@ -7849,27 +7870,29 @@ let AXSelectBoxComponent = AXSelectBoxComponent_1 = class AXSelectBoxComponent e
|
|
|
7849
7870
|
}
|
|
7850
7871
|
}
|
|
7851
7872
|
textChanged(e) {
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
this.
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7873
|
+
if ((e.value === null || e.value === undefined || e.value === '') && (e.oldValue === null || e.oldValue === undefined || e.oldValue === '')) {
|
|
7874
|
+
}
|
|
7875
|
+
else {
|
|
7876
|
+
this.currentfocusedIndex = -1;
|
|
7877
|
+
if (this.remoteOperation) {
|
|
7878
|
+
this.searchText = this.text;
|
|
7879
|
+
// this.searchText = e.value;
|
|
7880
|
+
// this.text = e.value;
|
|
7881
|
+
// this.items = [];
|
|
7882
|
+
let t = this.items.length;
|
|
7883
|
+
for (let i = 0; i < t; i++) {
|
|
7884
|
+
this.items.pop();
|
|
7885
|
+
}
|
|
7886
|
+
// this.items.forEach((element) => {
|
|
7887
|
+
// this.items.pop();
|
|
7888
|
+
// });
|
|
7889
|
+
const params = {};
|
|
7890
|
+
params.searchText = this.text;
|
|
7891
|
+
// params.searchText = e.value;
|
|
7892
|
+
params.skip = 0;
|
|
7893
|
+
params.take = this.bufferSize;
|
|
7894
|
+
this.fetch(params);
|
|
7863
7895
|
}
|
|
7864
|
-
// this.items.forEach((element) => {
|
|
7865
|
-
// this.items.pop();
|
|
7866
|
-
// });
|
|
7867
|
-
const params = {};
|
|
7868
|
-
params.searchText = this.text;
|
|
7869
|
-
// params.searchText = e.value;
|
|
7870
|
-
params.skip = 0;
|
|
7871
|
-
params.take = this.bufferSize;
|
|
7872
|
-
this.fetch(params);
|
|
7873
7896
|
}
|
|
7874
7897
|
}
|
|
7875
7898
|
onButtonClick(e) {
|
|
@@ -7931,6 +7954,9 @@ let AXSelectBoxComponent = AXSelectBoxComponent_1 = class AXSelectBoxComponent e
|
|
|
7931
7954
|
}
|
|
7932
7955
|
else {
|
|
7933
7956
|
if (v !== undefined) {
|
|
7957
|
+
if (v != [] && v != '' && v != null) {
|
|
7958
|
+
this.hasSelectedValue = true;
|
|
7959
|
+
}
|
|
7934
7960
|
this.waitForData(() => {
|
|
7935
7961
|
if (this.mode === 'single') {
|
|
7936
7962
|
if (this.items.filter((c) => v == c[this.valueField])) {
|
|
@@ -7942,7 +7968,31 @@ let AXSelectBoxComponent = AXSelectBoxComponent_1 = class AXSelectBoxComponent e
|
|
|
7942
7968
|
}
|
|
7943
7969
|
else {
|
|
7944
7970
|
if (Array.isArray(v)) {
|
|
7945
|
-
|
|
7971
|
+
debugger;
|
|
7972
|
+
if (this.selectedItems.length > v.length) {
|
|
7973
|
+
this.selectedItems = this.selectedItems.filter((c) => v.includes(c[this.valueField]));
|
|
7974
|
+
}
|
|
7975
|
+
else {
|
|
7976
|
+
let addId = [];
|
|
7977
|
+
v.forEach((vId) => {
|
|
7978
|
+
addId.push({
|
|
7979
|
+
[this.valueField]: vId
|
|
7980
|
+
});
|
|
7981
|
+
});
|
|
7982
|
+
let newId = differenceBy(addId, this.selectedItems, this.valueField);
|
|
7983
|
+
let vv = [];
|
|
7984
|
+
newId.forEach((rc) => {
|
|
7985
|
+
vv.push(rc[this.valueField]);
|
|
7986
|
+
});
|
|
7987
|
+
this.items
|
|
7988
|
+
.filter((c) => vv.includes(c[this.valueField]))
|
|
7989
|
+
.forEach((res) => {
|
|
7990
|
+
this.selectedItems.push(res);
|
|
7991
|
+
});
|
|
7992
|
+
// this.selectedItems.push(this.items.filter((c) => vv.includes(c[this.valueField])));
|
|
7993
|
+
this.setSelectedItemsChange(this.selectedItems);
|
|
7994
|
+
}
|
|
7995
|
+
// this.selectedItems = this.items.filter((c) => v.includes(c[this.valueField]));
|
|
7946
7996
|
}
|
|
7947
7997
|
else if (v) {
|
|
7948
7998
|
this.selectedItems = this.items.filter((c) => v === c[this.valueField]);
|
|
@@ -7979,7 +8029,8 @@ let AXSelectBoxComponent = AXSelectBoxComponent_1 = class AXSelectBoxComponent e
|
|
|
7979
8029
|
if (this.mode == 'single') {
|
|
7980
8030
|
this.showCheckBox = false;
|
|
7981
8031
|
}
|
|
7982
|
-
|
|
8032
|
+
debugger;
|
|
8033
|
+
if (!this.remoteOperation || (this.remoteOperation && this.hasSelectedValue)) {
|
|
7983
8034
|
this.refresh();
|
|
7984
8035
|
}
|
|
7985
8036
|
}
|
|
@@ -8122,7 +8173,7 @@ let AXSelectBoxComponent = AXSelectBoxComponent_1 = class AXSelectBoxComponent e
|
|
|
8122
8173
|
// this.selectedItemsChange.emit(this._selectedItems);
|
|
8123
8174
|
// this.clearValidationStyle(this.ref.nativeElement);
|
|
8124
8175
|
}
|
|
8125
|
-
this.text = '';
|
|
8176
|
+
// this.text = '';
|
|
8126
8177
|
this.cdr.markForCheck();
|
|
8127
8178
|
}
|
|
8128
8179
|
onFocusTextBox(e) { }
|