@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@acorex/core'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('rxjs'), require('@angular/cdk/bidi'), require('@angular/common'), require('@angular/cdk/platform'), require('rxjs/operators'), require('@angular/cdk/drag-drop'), require('@angular/forms'), require('@angular/animations'), require('angular2-text-mask'), require('@angular/platform-browser/animations'), require('@angular/cdk/a11y'), require('@angular/router')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@acorex/components', ['exports', '@angular/core', '@acorex/core', '@angular/cdk/overlay', '@angular/cdk/portal', 'rxjs', '@angular/cdk/bidi', '@angular/common', '@angular/cdk/platform', 'rxjs/operators', '@angular/cdk/drag-drop', '@angular/forms', '@angular/animations', 'angular2-text-mask', '@angular/platform-browser/animations', '@angular/cdk/a11y', '@angular/router'], factory) :
|
|
4
|
-
(global = global || self, factory((global.acorex = global.acorex || {}, global.acorex.components = {}), global.ng.core, global['@acorex/core'], global.ng.cdk.overlay, global.ng.cdk.portal, global.rxjs, global.ng.cdk.bidi, global.ng.common, global.ng.cdk.platform, global.rxjs.operators, global.ng.cdk.dragDrop, global.ng.forms, global.ng.animations, global.angular2TextMask, global.ng.platformBrowser.animations, global.ng.cdk.a11y, global.ng.router));
|
|
5
|
-
}(this, (function (exports, core, core$1, overlay, portal, rxjs, bidi, common, platform, operators, dragDrop, forms, animations, angular2TextMask, animations$1, a11y, router) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@acorex/core'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('rxjs'), require('@angular/cdk/bidi'), require('@angular/common'), require('@angular/cdk/platform'), require('rxjs/operators'), require('@angular/cdk/drag-drop'), require('@angular/forms'), require('@angular/animations'), require('angular2-text-mask'), require('@angular/platform-browser/animations'), require('@angular/cdk/a11y'), require('lodash'), require('@angular/router')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@acorex/components', ['exports', '@angular/core', '@acorex/core', '@angular/cdk/overlay', '@angular/cdk/portal', 'rxjs', '@angular/cdk/bidi', '@angular/common', '@angular/cdk/platform', 'rxjs/operators', '@angular/cdk/drag-drop', '@angular/forms', '@angular/animations', 'angular2-text-mask', '@angular/platform-browser/animations', '@angular/cdk/a11y', 'lodash', '@angular/router'], factory) :
|
|
4
|
+
(global = global || self, factory((global.acorex = global.acorex || {}, global.acorex.components = {}), global.ng.core, global['@acorex/core'], global.ng.cdk.overlay, global.ng.cdk.portal, global.rxjs, global.ng.cdk.bidi, global.ng.common, global.ng.cdk.platform, global.rxjs.operators, global.ng.cdk.dragDrop, global.ng.forms, global.ng.animations, global.angular2TextMask, global.ng.platformBrowser.animations, global.ng.cdk.a11y, global.lodash, global.ng.router));
|
|
5
|
+
}(this, (function (exports, core, core$1, overlay, portal, rxjs, bidi, common, platform, operators, dragDrop, forms, animations, angular2TextMask, animations$1, a11y, lodash, router) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -8451,6 +8451,7 @@
|
|
|
8451
8451
|
_this.onBlur = new core.EventEmitter();
|
|
8452
8452
|
_this.onFocus = new core.EventEmitter();
|
|
8453
8453
|
_this._items = [];
|
|
8454
|
+
_this.hasSelectedValue = false;
|
|
8454
8455
|
_this.itemsFiltered = [];
|
|
8455
8456
|
// #endregion
|
|
8456
8457
|
_this.dropDownDisabled = false;
|
|
@@ -8504,27 +8505,46 @@
|
|
|
8504
8505
|
return this._selectedItems || [];
|
|
8505
8506
|
},
|
|
8506
8507
|
set: function (v) {
|
|
8507
|
-
|
|
8508
|
-
if (!v) {
|
|
8509
|
-
|
|
8510
|
-
}
|
|
8511
|
-
|
|
8512
|
-
if (JSON.stringify(old) !== JSON.stringify(v)) {
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
}
|
|
8508
|
+
this.setSelectedItemsChange(v);
|
|
8509
|
+
// if (!v) {
|
|
8510
|
+
// v = [];
|
|
8511
|
+
// }
|
|
8512
|
+
// const old = this.selectedItems;
|
|
8513
|
+
// if (JSON.stringify(old) !== JSON.stringify(v)) {
|
|
8514
|
+
// this._selectedItems = this.mode == 'single' ? v.slice(0, 1) : [...new Set(v)]; //[...new Set(v[0])] : [...new Set(v)];
|
|
8515
|
+
// this._selectedItems.forEach((c) => (c.selected = true));
|
|
8516
|
+
// this.selectedItemsChange.emit(this._selectedItems);
|
|
8517
|
+
// this.selectedValuesChange.emit(this.selectedValues);
|
|
8518
|
+
// this.clearValidationStyle(this.ref.nativeElement);
|
|
8519
|
+
// this.waitForData(() => {
|
|
8520
|
+
// if (this._selectedItems) {
|
|
8521
|
+
// this.items.forEach((c) => (c.selected = this._selectedItems.some((i) => i[this.valueField] == c[this.valueField])));
|
|
8522
|
+
// }
|
|
8523
|
+
// });
|
|
8524
|
+
// }
|
|
8524
8525
|
},
|
|
8525
8526
|
enumerable: true,
|
|
8526
8527
|
configurable: true
|
|
8527
8528
|
});
|
|
8529
|
+
AXSelectBoxComponent.prototype.setSelectedItemsChange = function (v) {
|
|
8530
|
+
var _this = this;
|
|
8531
|
+
if (!v) {
|
|
8532
|
+
v = [];
|
|
8533
|
+
}
|
|
8534
|
+
var old = this.selectedItems;
|
|
8535
|
+
if (JSON.stringify(old) !== JSON.stringify(v)) {
|
|
8536
|
+
this._selectedItems = this.mode == 'single' ? v.slice(0, 1) : __spread(new Set(v)); //[...new Set(v[0])] : [...new Set(v)];
|
|
8537
|
+
this._selectedItems.forEach(function (c) { return (c.selected = true); });
|
|
8538
|
+
this.selectedItemsChange.emit(this._selectedItems);
|
|
8539
|
+
this.selectedValuesChange.emit(this.selectedValues);
|
|
8540
|
+
this.clearValidationStyle(this.ref.nativeElement);
|
|
8541
|
+
this.waitForData(function () {
|
|
8542
|
+
if (_this._selectedItems) {
|
|
8543
|
+
_this.items.forEach(function (c) { return (c.selected = _this._selectedItems.some(function (i) { return i[_this.valueField] == c[_this.valueField]; })); });
|
|
8544
|
+
}
|
|
8545
|
+
});
|
|
8546
|
+
}
|
|
8547
|
+
};
|
|
8528
8548
|
AXSelectBoxComponent.prototype.ngOnInit = function () {
|
|
8529
8549
|
if (this.rowTemplate === undefined && this.rowInputTemplate != undefined) {
|
|
8530
8550
|
this.rowTemplate = this.rowInputTemplate;
|
|
@@ -8566,27 +8586,29 @@
|
|
|
8566
8586
|
}
|
|
8567
8587
|
};
|
|
8568
8588
|
AXSelectBoxComponent.prototype.textChanged = function (e) {
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
this.
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8589
|
+
if ((e.value === null || e.value === undefined || e.value === '') && (e.oldValue === null || e.oldValue === undefined || e.oldValue === '')) {
|
|
8590
|
+
}
|
|
8591
|
+
else {
|
|
8592
|
+
this.currentfocusedIndex = -1;
|
|
8593
|
+
if (this.remoteOperation) {
|
|
8594
|
+
this.searchText = this.text;
|
|
8595
|
+
// this.searchText = e.value;
|
|
8596
|
+
// this.text = e.value;
|
|
8597
|
+
// this.items = [];
|
|
8598
|
+
var t = this.items.length;
|
|
8599
|
+
for (var i = 0; i < t; i++) {
|
|
8600
|
+
this.items.pop();
|
|
8601
|
+
}
|
|
8602
|
+
// this.items.forEach((element) => {
|
|
8603
|
+
// this.items.pop();
|
|
8604
|
+
// });
|
|
8605
|
+
var params = {};
|
|
8606
|
+
params.searchText = this.text;
|
|
8607
|
+
// params.searchText = e.value;
|
|
8608
|
+
params.skip = 0;
|
|
8609
|
+
params.take = this.bufferSize;
|
|
8610
|
+
this.fetch(params);
|
|
8580
8611
|
}
|
|
8581
|
-
// this.items.forEach((element) => {
|
|
8582
|
-
// this.items.pop();
|
|
8583
|
-
// });
|
|
8584
|
-
var params = {};
|
|
8585
|
-
params.searchText = this.text;
|
|
8586
|
-
// params.searchText = e.value;
|
|
8587
|
-
params.skip = 0;
|
|
8588
|
-
params.take = this.bufferSize;
|
|
8589
|
-
this.fetch(params);
|
|
8590
8612
|
}
|
|
8591
8613
|
};
|
|
8592
8614
|
AXSelectBoxComponent.prototype.onButtonClick = function (e) {
|
|
@@ -8653,6 +8675,9 @@
|
|
|
8653
8675
|
}
|
|
8654
8676
|
else {
|
|
8655
8677
|
if (v !== undefined) {
|
|
8678
|
+
if (v != [] && v != '' && v != null) {
|
|
8679
|
+
this.hasSelectedValue = true;
|
|
8680
|
+
}
|
|
8656
8681
|
this.waitForData(function () {
|
|
8657
8682
|
if (_this.mode === 'single') {
|
|
8658
8683
|
if (_this.items.filter(function (c) { return v == c[_this.valueField]; })) {
|
|
@@ -8664,7 +8689,32 @@
|
|
|
8664
8689
|
}
|
|
8665
8690
|
else {
|
|
8666
8691
|
if (Array.isArray(v)) {
|
|
8667
|
-
|
|
8692
|
+
debugger;
|
|
8693
|
+
if (_this.selectedItems.length > v.length) {
|
|
8694
|
+
_this.selectedItems = _this.selectedItems.filter(function (c) { return v.includes(c[_this.valueField]); });
|
|
8695
|
+
}
|
|
8696
|
+
else {
|
|
8697
|
+
var addId_1 = [];
|
|
8698
|
+
v.forEach(function (vId) {
|
|
8699
|
+
var _a;
|
|
8700
|
+
addId_1.push((_a = {},
|
|
8701
|
+
_a[_this.valueField] = vId,
|
|
8702
|
+
_a));
|
|
8703
|
+
});
|
|
8704
|
+
var newId = lodash.differenceBy(addId_1, _this.selectedItems, _this.valueField);
|
|
8705
|
+
var vv_1 = [];
|
|
8706
|
+
newId.forEach(function (rc) {
|
|
8707
|
+
vv_1.push(rc[_this.valueField]);
|
|
8708
|
+
});
|
|
8709
|
+
_this.items
|
|
8710
|
+
.filter(function (c) { return vv_1.includes(c[_this.valueField]); })
|
|
8711
|
+
.forEach(function (res) {
|
|
8712
|
+
_this.selectedItems.push(res);
|
|
8713
|
+
});
|
|
8714
|
+
// this.selectedItems.push(this.items.filter((c) => vv.includes(c[this.valueField])));
|
|
8715
|
+
_this.setSelectedItemsChange(_this.selectedItems);
|
|
8716
|
+
}
|
|
8717
|
+
// this.selectedItems = this.items.filter((c) => v.includes(c[this.valueField]));
|
|
8668
8718
|
}
|
|
8669
8719
|
else if (v) {
|
|
8670
8720
|
_this.selectedItems = _this.items.filter(function (c) { return v === c[_this.valueField]; });
|
|
@@ -8704,7 +8754,8 @@
|
|
|
8704
8754
|
if (this.mode == 'single') {
|
|
8705
8755
|
this.showCheckBox = false;
|
|
8706
8756
|
}
|
|
8707
|
-
|
|
8757
|
+
debugger;
|
|
8758
|
+
if (!this.remoteOperation || (this.remoteOperation && this.hasSelectedValue)) {
|
|
8708
8759
|
this.refresh();
|
|
8709
8760
|
}
|
|
8710
8761
|
};
|
|
@@ -8852,7 +8903,7 @@
|
|
|
8852
8903
|
// this.selectedItemsChange.emit(this._selectedItems);
|
|
8853
8904
|
// this.clearValidationStyle(this.ref.nativeElement);
|
|
8854
8905
|
}
|
|
8855
|
-
this.text = '';
|
|
8906
|
+
// this.text = '';
|
|
8856
8907
|
this.cdr.markForCheck();
|
|
8857
8908
|
};
|
|
8858
8909
|
AXSelectBoxComponent.prototype.onFocusTextBox = function (e) { };
|