@colijnit/corecomponents_v12 12.1.6 → 12.1.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/bundles/colijnit-corecomponents_v12.umd.js +421 -24
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/filter-item/filter-item.component.js +378 -20
- package/esm2015/lib/components/filter-item/filter-item.module.js +8 -2
- package/esm2015/lib/core/enum/filterItem-mode.enum.js +40 -0
- package/esm2015/lib/directives/overlay/overlay.directive.js +26 -7
- package/esm2015/public-api.js +2 -1
- package/fesm2015/colijnit-corecomponents_v12.js +445 -26
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/filter-item/filter-item.component.d.ts +40 -6
- package/lib/components/filter-item/style/_layout.scss +9 -0
- package/lib/core/enum/filterItem-mode.enum.d.ts +14 -0
- package/lib/directives/overlay/overlay.directive.d.ts +5 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -5656,6 +5656,46 @@
|
|
|
5656
5656
|
},] }
|
|
5657
5657
|
];
|
|
5658
5658
|
|
|
5659
|
+
exports.FilterItemMode = void 0;
|
|
5660
|
+
(function (FilterItemMode) {
|
|
5661
|
+
//This mode makes the Filter display a multi select list
|
|
5662
|
+
// Input will be passed along directly as a string with the following syntax: "?>='choice 1', ?<='choice2'"
|
|
5663
|
+
FilterItemMode["Filterlist"] = "filterlist";
|
|
5664
|
+
//This mode makes the Filter display a single select list
|
|
5665
|
+
// Input will be passed along directly as a simple string.
|
|
5666
|
+
FilterItemMode["SingleSelectList"] = "singleSelectList";
|
|
5667
|
+
//This mode makes the Filter display a multi select list
|
|
5668
|
+
// Input will be passed along directly as a simple string.
|
|
5669
|
+
FilterItemMode["SelectListWithStringCollectionOutput"] = "selectListWithStringCollectionOutput";
|
|
5670
|
+
//This mode makes the Filter display a multi select list
|
|
5671
|
+
// Available choices will need to have their identifying value be a number. The summation of all these numbers will be passed along.
|
|
5672
|
+
FilterItemMode["SelectListWithNumberOutput"] = "selectListWithNumberOutput";
|
|
5673
|
+
//This mode makes the Filter display a min and max field. This should eventually be a slider.
|
|
5674
|
+
// input is passed along as "min - max"
|
|
5675
|
+
FilterItemMode["Slider"] = "slider";
|
|
5676
|
+
//This mode makes the Filter display a simple textfield.
|
|
5677
|
+
// The value typed into the field will be passed along directly as a string.
|
|
5678
|
+
FilterItemMode["TextField"] = "textField";
|
|
5679
|
+
//This mode makes the Filter display a simple dateField.
|
|
5680
|
+
// Field input will be passed along directly as a date object.
|
|
5681
|
+
FilterItemMode["DateField"] = "dateField";
|
|
5682
|
+
//This mode makes the Filter display a dateRange field.
|
|
5683
|
+
// Field input will be passed along directly as a string with the following syntax: "?>='01-08-2022'& ?<='31-08-2022'"
|
|
5684
|
+
FilterItemMode["DateRangeField"] = "dateRangeField";
|
|
5685
|
+
//This mode makes the Filter display a simple checkBox.
|
|
5686
|
+
// It's value will be passed along directly as a boolean.
|
|
5687
|
+
FilterItemMode["Checkbox"] = "checkbox";
|
|
5688
|
+
//This mode makes the Filter display a simple checkBox.
|
|
5689
|
+
// It's value will be passed along as either a 'T' or and 'F'.
|
|
5690
|
+
FilterItemMode["CheckboxToSimpleText"] = "checkboxToSimpleText";
|
|
5691
|
+
//This mode makes the Filter display a simple checkBox.
|
|
5692
|
+
// It's value will be passed along as either a "?='T'" or and "?='F'".
|
|
5693
|
+
FilterItemMode["CheckboxToText"] = "checkboxToText";
|
|
5694
|
+
//This mode makes the Filter display a simple checkBox.
|
|
5695
|
+
// It's value will be passed along as either a 1 or and 0.
|
|
5696
|
+
FilterItemMode["CheckboxToBinary"] = "checkboxToBinary";
|
|
5697
|
+
})(exports.FilterItemMode || (exports.FilterItemMode = {}));
|
|
5698
|
+
|
|
5659
5699
|
var BaseModule = /** @class */ (function () {
|
|
5660
5700
|
function BaseModule() {
|
|
5661
5701
|
}
|
|
@@ -5895,6 +5935,11 @@
|
|
|
5895
5935
|
var OverlayDirective = /** @class */ (function () {
|
|
5896
5936
|
function OverlayDirective(elementRef) {
|
|
5897
5937
|
var _this = this;
|
|
5938
|
+
/**
|
|
5939
|
+
* true; Element is added to the parent template
|
|
5940
|
+
* false; Element is added to the bottom of the DOM
|
|
5941
|
+
*/
|
|
5942
|
+
this.inline = false;
|
|
5898
5943
|
this.keepInView = false;
|
|
5899
5944
|
this.inheritWidth = false;
|
|
5900
5945
|
this.rightAlign = false;
|
|
@@ -5960,12 +6005,25 @@
|
|
|
5960
6005
|
if (this._elementRef && this._elementRef.nativeElement && this._parent && this._parent.nativeElement) {
|
|
5961
6006
|
var elementRect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
5962
6007
|
var parentBoundingRect = this._parent.nativeElement.getBoundingClientRect();
|
|
5963
|
-
var parentRect = {
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
6008
|
+
var parentRect = {};
|
|
6009
|
+
if (!this.inline) {
|
|
6010
|
+
parentRect = {
|
|
6011
|
+
bottom: parentBoundingRect.bottom,
|
|
6012
|
+
right: parentBoundingRect.right,
|
|
6013
|
+
left: parentBoundingRect.left,
|
|
6014
|
+
top: parentBoundingRect.top,
|
|
6015
|
+
width: parentBoundingRect.width
|
|
6016
|
+
};
|
|
6017
|
+
}
|
|
6018
|
+
else {
|
|
6019
|
+
parentRect = {
|
|
6020
|
+
bottom: this._parent.nativeElement.offsetTop + parentBoundingRect.height,
|
|
6021
|
+
right: this._parent.nativeElement.offsetLeft + parentBoundingRect.width,
|
|
6022
|
+
left: this._parent.nativeElement.offsetLeft,
|
|
6023
|
+
top: this._parent.nativeElement.offsetTop,
|
|
6024
|
+
width: parentBoundingRect.width
|
|
6025
|
+
};
|
|
6026
|
+
}
|
|
5969
6027
|
this._placeElement(window.innerHeight, window.innerWidth, parentRect, elementRect);
|
|
5970
6028
|
}
|
|
5971
6029
|
};
|
|
@@ -6019,6 +6077,7 @@
|
|
|
6019
6077
|
OverlayDirective.propDecorators = {
|
|
6020
6078
|
parent: [{ type: i0.Input, args: ["overlay",] }],
|
|
6021
6079
|
view: [{ type: i0.Input }],
|
|
6080
|
+
inline: [{ type: i0.Input }],
|
|
6022
6081
|
keepInView: [{ type: i0.Input }],
|
|
6023
6082
|
inheritWidth: [{ type: i0.Input }],
|
|
6024
6083
|
rightAlign: [{ type: i0.Input }],
|
|
@@ -11493,21 +11552,26 @@
|
|
|
11493
11552
|
}
|
|
11494
11553
|
|
|
11495
11554
|
var FilterItemComponent = /** @class */ (function () {
|
|
11496
|
-
function FilterItemComponent(iconService) {
|
|
11555
|
+
function FilterItemComponent(iconService, _changeDetector) {
|
|
11497
11556
|
this.iconService = iconService;
|
|
11557
|
+
this._changeDetector = _changeDetector;
|
|
11498
11558
|
this.icons = exports.CoreComponentsIcon;
|
|
11559
|
+
this.modes = exports.FilterItemMode;
|
|
11560
|
+
this.mode = this.modes.Filterlist;
|
|
11499
11561
|
this.initialLimit = 10;
|
|
11500
11562
|
this.expanded = false;
|
|
11501
11563
|
// Set to false to use filter item with a multi selectable collection. Set to true to specify custom content
|
|
11502
11564
|
this.customContent = false;
|
|
11503
11565
|
// Set to true to show all results. Set to false to get 'show more' and 'show less' buttons to expand and contract.
|
|
11504
11566
|
this.showAllResults = false;
|
|
11505
|
-
this.singleSelect = false;
|
|
11506
11567
|
this.filterButtonLabel = "Search";
|
|
11507
11568
|
this.searchPlaceholder = 'Search...';
|
|
11508
11569
|
this.showMoreLabel = 'Show more';
|
|
11509
11570
|
this.showLessLabel = 'Show less';
|
|
11510
11571
|
this.noResultsLabel = "No results";
|
|
11572
|
+
this.sliderDefaultMin = 0;
|
|
11573
|
+
this.sliderDefaultMax = 100000;
|
|
11574
|
+
this.modelChange = new i0.EventEmitter();
|
|
11511
11575
|
this.collectionChange = new i0.EventEmitter();
|
|
11512
11576
|
this.filterButtonClicked = new i0.EventEmitter();
|
|
11513
11577
|
this.filteredCollection = [];
|
|
@@ -11524,16 +11588,55 @@
|
|
|
11524
11588
|
var _a;
|
|
11525
11589
|
this._collection = value;
|
|
11526
11590
|
this.filteredCollection = (_a = this._collection) === null || _a === void 0 ? void 0 : _a.slice();
|
|
11591
|
+
//reset the model in case there was no collection to set its values on when it was set.
|
|
11592
|
+
this.model = this._model;
|
|
11593
|
+
},
|
|
11594
|
+
enumerable: false,
|
|
11595
|
+
configurable: true
|
|
11596
|
+
});
|
|
11597
|
+
Object.defineProperty(FilterItemComponent.prototype, "model", {
|
|
11598
|
+
get: function () {
|
|
11599
|
+
return this._model;
|
|
11600
|
+
},
|
|
11601
|
+
set: function (filterString) {
|
|
11602
|
+
switch (this.mode) {
|
|
11603
|
+
case this.modes.Filterlist:
|
|
11604
|
+
this._readModelForFilterList(filterString);
|
|
11605
|
+
break;
|
|
11606
|
+
case this.modes.SingleSelectList:
|
|
11607
|
+
this._readModelForSingleSelectList(filterString);
|
|
11608
|
+
break;
|
|
11609
|
+
case this.modes.SelectListWithStringCollectionOutput:
|
|
11610
|
+
this._readModelForStringCollectionList(filterString);
|
|
11611
|
+
break;
|
|
11612
|
+
case this.modes.SelectListWithNumberOutput:
|
|
11613
|
+
this._readModelForSelectListWithNumberOutput(filterString);
|
|
11614
|
+
break;
|
|
11615
|
+
case this.modes.Slider:
|
|
11616
|
+
this._readModelForSliderMode(filterString);
|
|
11617
|
+
break;
|
|
11618
|
+
case this.modes.CheckboxToText:
|
|
11619
|
+
case this.modes.CheckboxToSimpleText:
|
|
11620
|
+
this._readModelForCheckboxToText(filterString);
|
|
11621
|
+
break;
|
|
11622
|
+
case this.modes.CheckboxToBinary:
|
|
11623
|
+
this._readModelForCheckboxToBinary(filterString);
|
|
11624
|
+
break;
|
|
11625
|
+
case this.modes.DateField:
|
|
11626
|
+
this._readModelForDateField(filterString);
|
|
11627
|
+
break;
|
|
11628
|
+
case this.modes.DateRangeField:
|
|
11629
|
+
this._readModelForDateRangeField(filterString);
|
|
11630
|
+
break;
|
|
11631
|
+
}
|
|
11527
11632
|
},
|
|
11528
11633
|
enumerable: false,
|
|
11529
11634
|
configurable: true
|
|
11530
11635
|
});
|
|
11531
|
-
FilterItemComponent.prototype.showClass = function () {
|
|
11532
|
-
return true;
|
|
11533
|
-
};
|
|
11534
11636
|
FilterItemComponent.prototype.ngOnInit = function () {
|
|
11535
11637
|
this.setToInitialLimit();
|
|
11536
11638
|
this.showButton = this.valueSelected();
|
|
11639
|
+
this.checkBoxToTextModel = false;
|
|
11537
11640
|
};
|
|
11538
11641
|
FilterItemComponent.prototype.setToInitialLimit = function () {
|
|
11539
11642
|
this.limitTo = this.initialLimit;
|
|
@@ -11556,17 +11659,57 @@
|
|
|
11556
11659
|
return ((_a = this.filteredCollection) === null || _a === void 0 ? void 0 : _a.length) <= this.limitTo && ((_b = this.filteredCollection) === null || _b === void 0 ? void 0 : _b.length) > this.initialLimit;
|
|
11557
11660
|
};
|
|
11558
11661
|
FilterItemComponent.prototype.handleModelChange = function (model) {
|
|
11559
|
-
this.
|
|
11560
|
-
|
|
11561
|
-
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
|
|
11565
|
-
|
|
11662
|
+
switch (this.mode) {
|
|
11663
|
+
case this.modes.Filterlist:
|
|
11664
|
+
this.showButton = true;
|
|
11665
|
+
model.checked = !model.checked;
|
|
11666
|
+
this._createModelForFilterList();
|
|
11667
|
+
break;
|
|
11668
|
+
case this.modes.SelectListWithStringCollectionOutput:
|
|
11669
|
+
this.showButton = true;
|
|
11670
|
+
model.checked = !model.checked;
|
|
11671
|
+
this._createModelForStringCollectionList();
|
|
11672
|
+
break;
|
|
11673
|
+
case this.modes.SingleSelectList:
|
|
11674
|
+
this.showButton = true;
|
|
11675
|
+
this.uncheckForSingleSelect(model);
|
|
11676
|
+
model.checked = !model.checked;
|
|
11677
|
+
this._createModelForSingleSelectList();
|
|
11678
|
+
break;
|
|
11679
|
+
case this.modes.SelectListWithNumberOutput:
|
|
11680
|
+
this.showButton = true;
|
|
11681
|
+
model.checked = !model.checked;
|
|
11682
|
+
this._createModelForSelectListWithNumberOutput();
|
|
11683
|
+
break;
|
|
11684
|
+
case this.modes.Slider:
|
|
11685
|
+
this._createModelForSliderMode();
|
|
11686
|
+
break;
|
|
11687
|
+
case this.modes.CheckboxToText:
|
|
11688
|
+
this._createModelForCheckboxToText();
|
|
11689
|
+
break;
|
|
11690
|
+
case this.modes.CheckboxToSimpleText:
|
|
11691
|
+
this._createModelForCheckboxToSimpleText();
|
|
11692
|
+
break;
|
|
11693
|
+
case this.modes.CheckboxToBinary:
|
|
11694
|
+
this._createModelForCheckboxToBinary();
|
|
11695
|
+
break;
|
|
11696
|
+
case this.modes.DateRangeField:
|
|
11697
|
+
this._createModelForDateRange(model);
|
|
11698
|
+
break;
|
|
11699
|
+
case this.modes.TextField:
|
|
11700
|
+
this._model = (typeof this._model === 'string' && this._model.length === 0) ? undefined : this._model;
|
|
11701
|
+
break;
|
|
11566
11702
|
}
|
|
11567
|
-
|
|
11703
|
+
this.modelChange.emit(this._model);
|
|
11568
11704
|
this.collectionChange.emit(this.collection);
|
|
11569
11705
|
};
|
|
11706
|
+
FilterItemComponent.prototype.uncheckForSingleSelect = function (model) {
|
|
11707
|
+
this.collection.forEach(function (m) {
|
|
11708
|
+
if (m.code !== model.code && m.description !== model.description) {
|
|
11709
|
+
m.checked = false;
|
|
11710
|
+
}
|
|
11711
|
+
});
|
|
11712
|
+
};
|
|
11570
11713
|
FilterItemComponent.prototype.valueSelected = function () {
|
|
11571
11714
|
if (this.collection) {
|
|
11572
11715
|
return !!this.collection.find(function (c) { return c.checked; });
|
|
@@ -11620,20 +11763,268 @@
|
|
|
11620
11763
|
FilterItemComponent.prototype.onButtonClicked = function () {
|
|
11621
11764
|
this.filterButtonClicked.emit();
|
|
11622
11765
|
};
|
|
11766
|
+
/////////////////////////////////////////////////////////////
|
|
11767
|
+
//Model creation for all of the different options available//
|
|
11768
|
+
/////////////////////////////////////////////////////////////
|
|
11769
|
+
FilterItemComponent.prototype._createModelForFilterList = function () {
|
|
11770
|
+
var filterRange = [];
|
|
11771
|
+
if (this.collection !== null && this.collection !== undefined) {
|
|
11772
|
+
this.collection.forEach(function (viewModel) {
|
|
11773
|
+
if (viewModel.checked) {
|
|
11774
|
+
filterRange.push("?='" + viewModel.code + "'");
|
|
11775
|
+
}
|
|
11776
|
+
});
|
|
11777
|
+
if (filterRange.length > 0) {
|
|
11778
|
+
this._model = filterRange.join(',');
|
|
11779
|
+
}
|
|
11780
|
+
else {
|
|
11781
|
+
this._model = undefined;
|
|
11782
|
+
}
|
|
11783
|
+
}
|
|
11784
|
+
};
|
|
11785
|
+
FilterItemComponent.prototype._createModelForStringCollectionList = function () {
|
|
11786
|
+
var filterRange = [];
|
|
11787
|
+
this.collection.forEach(function (viewModel) {
|
|
11788
|
+
if (viewModel.checked) {
|
|
11789
|
+
filterRange.push(viewModel.code.toString());
|
|
11790
|
+
}
|
|
11791
|
+
});
|
|
11792
|
+
if (filterRange.length > 0) {
|
|
11793
|
+
this._model = filterRange;
|
|
11794
|
+
}
|
|
11795
|
+
else {
|
|
11796
|
+
this._model = undefined;
|
|
11797
|
+
}
|
|
11798
|
+
};
|
|
11799
|
+
FilterItemComponent.prototype._createModelForSingleSelectList = function () {
|
|
11800
|
+
var filterString = "";
|
|
11801
|
+
this.collection.forEach(function (viewModel) {
|
|
11802
|
+
if (viewModel.checked) {
|
|
11803
|
+
filterString = viewModel.code.toString();
|
|
11804
|
+
}
|
|
11805
|
+
});
|
|
11806
|
+
if (filterString.length > 0) {
|
|
11807
|
+
this._model = filterString;
|
|
11808
|
+
}
|
|
11809
|
+
else {
|
|
11810
|
+
this._model = undefined;
|
|
11811
|
+
}
|
|
11812
|
+
};
|
|
11813
|
+
FilterItemComponent.prototype._createModelForSelectListWithNumberOutput = function () {
|
|
11814
|
+
var filterNumber = null;
|
|
11815
|
+
this.collection.forEach(function (viewModel) {
|
|
11816
|
+
if (viewModel.checked) {
|
|
11817
|
+
if (filterNumber == null) {
|
|
11818
|
+
filterNumber = 0;
|
|
11819
|
+
}
|
|
11820
|
+
filterNumber += Number(viewModel.code);
|
|
11821
|
+
}
|
|
11822
|
+
});
|
|
11823
|
+
this._model = filterNumber;
|
|
11824
|
+
};
|
|
11825
|
+
FilterItemComponent.prototype._createModelForSliderMode = function () {
|
|
11826
|
+
this.sliderMin = !!this.sliderMin ? this.sliderMin : this.sliderDefaultMin;
|
|
11827
|
+
this.sliderMax = !!this.sliderMax ? this.sliderMax : this.sliderDefaultMax;
|
|
11828
|
+
var trueLowerBound = Math.min(this.sliderMin, this.sliderMax);
|
|
11829
|
+
var trueUpperBound = Math.max(this.sliderMin, this.sliderMax);
|
|
11830
|
+
this._model = trueLowerBound + " - " + trueUpperBound;
|
|
11831
|
+
};
|
|
11832
|
+
FilterItemComponent.prototype._createModelForCheckboxToText = function () {
|
|
11833
|
+
if (this.checkBoxToTextModel) {
|
|
11834
|
+
this._model = "?='J'";
|
|
11835
|
+
}
|
|
11836
|
+
else {
|
|
11837
|
+
this._model = "?='N'";
|
|
11838
|
+
}
|
|
11839
|
+
};
|
|
11840
|
+
FilterItemComponent.prototype._createModelForCheckboxToSimpleText = function () {
|
|
11841
|
+
if (this.checkBoxToTextModel) {
|
|
11842
|
+
this._model = "J";
|
|
11843
|
+
}
|
|
11844
|
+
else {
|
|
11845
|
+
this._model = "N";
|
|
11846
|
+
}
|
|
11847
|
+
};
|
|
11848
|
+
FilterItemComponent.prototype._createModelForCheckboxToBinary = function () {
|
|
11849
|
+
if (this.checkBoxToTextModel) {
|
|
11850
|
+
this._model = 1;
|
|
11851
|
+
}
|
|
11852
|
+
else {
|
|
11853
|
+
this._model = 0;
|
|
11854
|
+
}
|
|
11855
|
+
};
|
|
11856
|
+
FilterItemComponent.prototype._createModelForDateRange = function (dates) {
|
|
11857
|
+
if (dates) {
|
|
11858
|
+
var startDate = dates[0];
|
|
11859
|
+
var endDate = dates[1];
|
|
11860
|
+
var startDateRequest = startDate ? this._formatDateToString(startDate) : '';
|
|
11861
|
+
var endDateRequest = endDate ? this._formatDateToString(endDate) : '';
|
|
11862
|
+
this._model = "?>='" + startDateRequest + "'& ?<='" + endDateRequest + "'";
|
|
11863
|
+
}
|
|
11864
|
+
};
|
|
11865
|
+
FilterItemComponent.prototype._formatDateToString = function (date) {
|
|
11866
|
+
var day = date.getDate().toString().padStart(2, '0');
|
|
11867
|
+
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
11868
|
+
var year = date.getFullYear();
|
|
11869
|
+
return day + "-" + month + "-" + year;
|
|
11870
|
+
};
|
|
11871
|
+
////////////////////////////////////////////////////////////
|
|
11872
|
+
//Model reading for all of the different options available//
|
|
11873
|
+
////////////////////////////////////////////////////////////
|
|
11874
|
+
FilterItemComponent.prototype._readModelForFilterList = function (filterModel) {
|
|
11875
|
+
var e_1, _c;
|
|
11876
|
+
var filterList = [];
|
|
11877
|
+
var itemsToCheck = [];
|
|
11878
|
+
this._uncheckAll();
|
|
11879
|
+
this._model = filterModel;
|
|
11880
|
+
if (filterModel !== null && filterModel !== undefined && typeof filterModel === 'string' && filterModel.length != 0 && this.collection !== null && this.collection !== undefined) {
|
|
11881
|
+
filterList = filterModel.split(",");
|
|
11882
|
+
filterList.forEach(function (filter) {
|
|
11883
|
+
itemsToCheck.push(filter.substr(3, filter.length - 4));
|
|
11884
|
+
});
|
|
11885
|
+
var _loop_1 = function (item) {
|
|
11886
|
+
var filter = this_1.collection.find(function (element) { return element.code.toString() === item; });
|
|
11887
|
+
if (filter !== null && filter !== undefined) {
|
|
11888
|
+
filter.checked = true;
|
|
11889
|
+
}
|
|
11890
|
+
else {
|
|
11891
|
+
filter.checked = false;
|
|
11892
|
+
}
|
|
11893
|
+
};
|
|
11894
|
+
var this_1 = this;
|
|
11895
|
+
try {
|
|
11896
|
+
for (var itemsToCheck_1 = __values(itemsToCheck), itemsToCheck_1_1 = itemsToCheck_1.next(); !itemsToCheck_1_1.done; itemsToCheck_1_1 = itemsToCheck_1.next()) {
|
|
11897
|
+
var item = itemsToCheck_1_1.value;
|
|
11898
|
+
_loop_1(item);
|
|
11899
|
+
}
|
|
11900
|
+
}
|
|
11901
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
11902
|
+
finally {
|
|
11903
|
+
try {
|
|
11904
|
+
if (itemsToCheck_1_1 && !itemsToCheck_1_1.done && (_c = itemsToCheck_1.return)) _c.call(itemsToCheck_1);
|
|
11905
|
+
}
|
|
11906
|
+
finally { if (e_1) throw e_1.error; }
|
|
11907
|
+
}
|
|
11908
|
+
this._model = filterModel;
|
|
11909
|
+
}
|
|
11910
|
+
};
|
|
11911
|
+
FilterItemComponent.prototype._readModelForSingleSelectList = function (singleSelectModel) {
|
|
11912
|
+
this._uncheckAll();
|
|
11913
|
+
this._model = singleSelectModel;
|
|
11914
|
+
if (singleSelectModel !== null && singleSelectModel !== undefined && this.collection !== null && this.collection !== undefined) {
|
|
11915
|
+
var filter = this.collection.find(function (element) { return element.code.toString() === singleSelectModel; });
|
|
11916
|
+
if (filter) {
|
|
11917
|
+
filter.checked = true;
|
|
11918
|
+
}
|
|
11919
|
+
}
|
|
11920
|
+
};
|
|
11921
|
+
FilterItemComponent.prototype._readModelForStringCollectionList = function (collectionModel) {
|
|
11922
|
+
this._uncheckAll();
|
|
11923
|
+
this._model = collectionModel;
|
|
11924
|
+
if (collectionModel !== null && collectionModel !== undefined && this.collection !== null && this.collection !== undefined) {
|
|
11925
|
+
this.collection.forEach(function (viewModel) {
|
|
11926
|
+
if (collectionModel.indexOf(viewModel.code.toString()) > -1) {
|
|
11927
|
+
viewModel.checked = true;
|
|
11928
|
+
}
|
|
11929
|
+
else {
|
|
11930
|
+
viewModel.checked = false;
|
|
11931
|
+
}
|
|
11932
|
+
});
|
|
11933
|
+
}
|
|
11934
|
+
};
|
|
11935
|
+
FilterItemComponent.prototype._readModelForSelectListWithNumberOutput = function (numberModel) {
|
|
11936
|
+
var e_2, _c;
|
|
11937
|
+
this._uncheckAll();
|
|
11938
|
+
this._model = numberModel;
|
|
11939
|
+
if (numberModel !== null && numberModel !== undefined && this.collection !== null && this.collection !== undefined) {
|
|
11940
|
+
try {
|
|
11941
|
+
for (var _d = __values(this.collection), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
11942
|
+
var item = _e.value;
|
|
11943
|
+
var itemCode = item.code;
|
|
11944
|
+
var modValue = (numberModel % (2 * itemCode));
|
|
11945
|
+
item.checked = (modValue >= itemCode);
|
|
11946
|
+
}
|
|
11947
|
+
}
|
|
11948
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
11949
|
+
finally {
|
|
11950
|
+
try {
|
|
11951
|
+
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
11952
|
+
}
|
|
11953
|
+
finally { if (e_2) throw e_2.error; }
|
|
11954
|
+
}
|
|
11955
|
+
}
|
|
11956
|
+
};
|
|
11957
|
+
FilterItemComponent.prototype._uncheckAll = function () {
|
|
11958
|
+
if (this.collection !== null && this.collection !== undefined) {
|
|
11959
|
+
this.collection.forEach(function (m) {
|
|
11960
|
+
m.checked = false;
|
|
11961
|
+
});
|
|
11962
|
+
}
|
|
11963
|
+
};
|
|
11964
|
+
FilterItemComponent.prototype._readModelForSliderMode = function (sliderModel) {
|
|
11965
|
+
this._model = sliderModel;
|
|
11966
|
+
if (sliderModel !== undefined && sliderModel !== null) {
|
|
11967
|
+
var sliderInputCollection = sliderModel.split(' - ');
|
|
11968
|
+
this.sliderMin = parseInt(sliderInputCollection[0]);
|
|
11969
|
+
this.sliderMax = parseInt(sliderInputCollection[1]);
|
|
11970
|
+
}
|
|
11971
|
+
else {
|
|
11972
|
+
this.sliderMin = this.sliderDefaultMin;
|
|
11973
|
+
this.sliderMax = this.sliderDefaultMax;
|
|
11974
|
+
}
|
|
11975
|
+
};
|
|
11976
|
+
FilterItemComponent.prototype._readModelForCheckboxToText = function (checkboxToTextModel) {
|
|
11977
|
+
this._model = checkboxToTextModel;
|
|
11978
|
+
if (checkboxToTextModel !== undefined && checkboxToTextModel !== null) {
|
|
11979
|
+
this.checkBoxToTextModel = (checkboxToTextModel.indexOf('J') > -1);
|
|
11980
|
+
}
|
|
11981
|
+
else {
|
|
11982
|
+
this.checkBoxToTextModel = false;
|
|
11983
|
+
}
|
|
11984
|
+
};
|
|
11985
|
+
FilterItemComponent.prototype._readModelForCheckboxToBinary = function (checkboxToBinary) {
|
|
11986
|
+
this._model = checkboxToBinary;
|
|
11987
|
+
if (checkboxToBinary !== undefined && checkboxToBinary !== null) {
|
|
11988
|
+
this.checkBoxToTextModel = (checkboxToBinary >= 1);
|
|
11989
|
+
}
|
|
11990
|
+
else {
|
|
11991
|
+
this.checkBoxToTextModel = false;
|
|
11992
|
+
}
|
|
11993
|
+
};
|
|
11994
|
+
FilterItemComponent.prototype._readModelForDateField = function (dateFieldModel) {
|
|
11995
|
+
this._model = dateFieldModel;
|
|
11996
|
+
if (dateFieldModel !== undefined && dateFieldModel !== null) {
|
|
11997
|
+
this._model = new Date(dateFieldModel);
|
|
11998
|
+
}
|
|
11999
|
+
};
|
|
12000
|
+
FilterItemComponent.prototype._readModelForDateRangeField = function (dateRangeFieldModel) {
|
|
12001
|
+
this._model = dateRangeFieldModel;
|
|
12002
|
+
if (dateRangeFieldModel !== undefined && dateRangeFieldModel !== null) {
|
|
12003
|
+
var dateCollection = dateRangeFieldModel.split('&');
|
|
12004
|
+
var startString = dateCollection[0].trim().substr(4, dateCollection[0].length - 5);
|
|
12005
|
+
var endString = dateCollection[1].trim().substr(4, dateCollection[1].length - 5);
|
|
12006
|
+
var startDateComponents = startString.split('-');
|
|
12007
|
+
var endDateComponents = endString.split('-');
|
|
12008
|
+
this.dateRangeStart = new Date(parseInt(startDateComponents[2]), parseInt(startDateComponents[1]) - 1, parseInt(startDateComponents[0]));
|
|
12009
|
+
this.dateRangeEnd = new Date(parseInt(endDateComponents[2]), parseInt(endDateComponents[1]) - 1, parseInt(endDateComponents[0]));
|
|
12010
|
+
}
|
|
12011
|
+
};
|
|
11623
12012
|
return FilterItemComponent;
|
|
11624
12013
|
}());
|
|
11625
12014
|
FilterItemComponent.decorators = [
|
|
11626
12015
|
{ type: i0.Component, args: [{
|
|
11627
12016
|
selector: "co-filter-item",
|
|
11628
|
-
template: "\n <div class=\"co-filter-item-header\">\n <co-collapsible\n [headerTitle]=\"placeholder\"\n [expandButtonLast]=\"true\"\n [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"\n [expanded]=\"expanded\"\n [showButton]=\"showButton\"\n [buttonText]=\"filterButtonLabel\"\n (buttonClicked)=\"onButtonClicked()\"\n >\n <div class=\"co-filter-item-collapsable-content\">\n <div class=\"co-filter-item-custom-content\" *ngIf=\"customContent; else collectionContent\"\n (keydown)=\"showButton=true\" (mousedown)=\"showButton=true\">\n <ng-content></ng-content>\n </div>\n <ng-template #collectionContent>\n <div class=\"co-filter-item-collection-content\">\n <co-input-text\n *ngIf=\"collection?.length > 10 || minSearchCharsToLoadCollection\"\n [placeholder]=\"searchPlaceholder\"\n [model]=\"filterText\"\n (modelChange)=\"applyFilter($event)\"\n >\n </co-input-text>\n <div class=\"no-results\" *ngIf=\"filteredCollection?.length === 0\">\n <span [textContent]=\"noResultsLabel\"></span>\n </div>\n <div class=\"co-filter-item-collection-results\">\n <ng-container\n *ngFor=\"let option of filteredCollection; let index = index\">\n <div class=\"co-filter-item-collection-result-item\" *ngIf=\"index < limitTo || showAllResults\">\n <co-input-checkbox *ngIf=\"
|
|
12017
|
+
template: "\n <div class=\"co-filter-item-header\">\n <co-collapsible\n [headerTitle]=\"placeholder\"\n [expandButtonLast]=\"true\"\n [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"\n [expanded]=\"expanded\"\n [showButton]=\"showButton\"\n [buttonText]=\"filterButtonLabel\"\n (buttonClicked)=\"onButtonClicked()\"\n >\n <div class=\"co-filter-item-collapsable-content\">\n <div class=\"co-filter-item-custom-content\" *ngIf=\"customContent; else collectionContent\"\n (keydown)=\"showButton=true\" (mousedown)=\"showButton=true\">\n <ng-content></ng-content>\n </div>\n <ng-template #collectionContent>\n <div class=\"co-filter-item-collection-content\" *ngIf=\"mode === modes.Filterlist || mode === modes.SingleSelectList\n || mode === modes.SelectListWithNumberOutput || mode === modes.SelectListWithStringCollectionOutput\">\n <co-input-text\n *ngIf=\"collection?.length > 10 || minSearchCharsToLoadCollection\"\n [placeholder]=\"searchPlaceholder\"\n [model]=\"filterText\"\n (modelChange)=\"applyFilter($event)\"\n >\n </co-input-text>\n <div class=\"no-results\" *ngIf=\"filteredCollection?.length === 0\">\n <span [textContent]=\"noResultsLabel\"></span>\n </div>\n <div class=\"co-filter-item-collection-results\">\n <ng-container\n *ngFor=\"let option of filteredCollection; let index = index\">\n <div class=\"co-filter-item-collection-result-item\" *ngIf=\"index < limitTo || showAllResults\">\n <co-input-checkbox *ngIf=\"mode !== modes.SingleSelectList\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n [clickableLabel]=\"false\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-checkbox>\n <co-input-radio-button *ngIf=\"mode === modes.SingleSelectList\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-radio-button>\n <div class=\"co-filter-item-amount\" *ngIf=\"option.count\"\n [textContent]=\"option.count.toString() | append: ')' | prepend: ' ('\"\n ></div>\n </div>\n\n </ng-container>\n </div>\n <div class=\"co-filter-show-more-or-less\" *ngIf=\"!showAllResults\">\n <div class=\"co-filter-show-more clickable\"\n *ngIf=\"moreToShow()\">\n <a (click)=\"increaseLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"></co-icon>\n <span [textContent]=\"showMoreLabel\"></span>\n </a>\n </div>\n <div class=\"co-filter-show-less clickable\"\n *ngIf=\"lessToShow()\">\n <a (click)=\"setToInitialLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointUp)\"></co-icon>\n <span [textContent]=\"showLessLabel\"></span>\n </a>\n </div>\n </div>\n </div>\n <div class=\"co-filter-item-slider-content\" *ngIf=\"mode === modes.Slider\">\n <co-input-text\n class=\"slider-from\"\n [type]=\"'number'\"\n [digitsOnly]=\"true\"\n [hideArrowButtons]=\"true\"\n [excludePlusMinus]=\"true\"\n [label]=\"'FROM' | localize\"\n [(model)]=\"sliderMin\"\n (modelChange)=\"handleModelChange($event)\"\n ></co-input-text>\n <co-input-text\n class=\"slider-to\"\n [type]=\"'number'\"\n [digitsOnly]=\"true\"\n [hideArrowButtons]=\"true\"\n [excludePlusMinus]=\"true\"\n [label]=\"'TO' | localize\"\n [(model)]=\"sliderMax\"\n (modelChange)=\"handleModelChange($event)\"\n ></co-input-text>\n </div>\n <div class=\"co-filter-item-checkbox-content\" *ngIf=\"mode === modes.Checkbox \">\n <co-input-checkbox\n [(model)]=\"model\"\n (modelChange)=\"handleModelChange($event)\"></co-input-checkbox>\n </div>\n <div class=\"co-filter-item-checkbox-content\"\n *ngIf=\"mode === modes.CheckboxToText || mode === modes.CheckboxToSimpleText || mode === modes.CheckboxToBinary\">\n <co-input-checkbox\n [(model)]=\"checkBoxToTextModel\"\n (modelChange)=\"handleModelChange($event)\"></co-input-checkbox>\n </div>\n <div class=\"co-filter-item-textfield-content\" *ngIf=\"mode === modes.TextField\">\n <co-input-text\n [(model)]=\"model\"\n (modelChange)=\"handleModelChange($event)\"></co-input-text>\n </div>\n <div class=\"co-filter-item-dateField-content\" *ngIf=\"mode === modes.DateField\">\n <co-input-date\n [(model)]=\"model\"\n (modelChange)=\"handleModelChange($event)\"\n ></co-input-date>\n </div>\n <div class=\"co-filter-item-dateField-content\" *ngIf=\"mode === modes.DateRangeField\">\n <co-input-date-range\n [model]=\"[dateRangeStart, dateRangeEnd]\"\n (modelChange)=\"handleModelChange($event)\"\n [placeholder]=\"'SELECT_DATE' | localize\">\n </co-input-date-range>\n </div>\n </ng-template>\n </div>\n </co-collapsible>\n </div>\n\n ",
|
|
11629
12018
|
encapsulation: i0.ViewEncapsulation.None,
|
|
11630
12019
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
11631
12020
|
},] }
|
|
11632
12021
|
];
|
|
11633
12022
|
FilterItemComponent.ctorParameters = function () { return [
|
|
11634
|
-
{ type: IconCacheService }
|
|
12023
|
+
{ type: IconCacheService },
|
|
12024
|
+
{ type: i0.ChangeDetectorRef }
|
|
11635
12025
|
]; };
|
|
11636
12026
|
FilterItemComponent.propDecorators = {
|
|
12027
|
+
mode: [{ type: i0.Input }],
|
|
11637
12028
|
collection: [{ type: i0.Input }],
|
|
11638
12029
|
placeholder: [{ type: i0.Input }],
|
|
11639
12030
|
initialLimit: [{ type: i0.Input }],
|
|
@@ -11642,15 +12033,18 @@
|
|
|
11642
12033
|
collectionLoadFn: [{ type: i0.Input }],
|
|
11643
12034
|
customContent: [{ type: i0.Input }],
|
|
11644
12035
|
showAllResults: [{ type: i0.Input }],
|
|
11645
|
-
singleSelect: [{ type: i0.Input }],
|
|
11646
12036
|
filterButtonLabel: [{ type: i0.Input }],
|
|
11647
12037
|
searchPlaceholder: [{ type: i0.Input }],
|
|
11648
12038
|
showMoreLabel: [{ type: i0.Input }],
|
|
11649
12039
|
showLessLabel: [{ type: i0.Input }],
|
|
11650
12040
|
noResultsLabel: [{ type: i0.Input }],
|
|
12041
|
+
sliderDefaultMin: [{ type: i0.Input }],
|
|
12042
|
+
sliderDefaultMax: [{ type: i0.Input }],
|
|
12043
|
+
model: [{ type: i0.Input }],
|
|
12044
|
+
modelChange: [{ type: i0.Output }],
|
|
11651
12045
|
collectionChange: [{ type: i0.Output }],
|
|
11652
12046
|
filterButtonClicked: [{ type: i0.Output }],
|
|
11653
|
-
|
|
12047
|
+
filteredCollection: [{ type: i0.HostBinding, args: ["class.co-filter-item",] }]
|
|
11654
12048
|
};
|
|
11655
12049
|
|
|
11656
12050
|
// A pipe for prepending strings to other strings in view templates.
|
|
@@ -11706,7 +12100,10 @@
|
|
|
11706
12100
|
PrependPipeModule,
|
|
11707
12101
|
InputTextModule,
|
|
11708
12102
|
InputRadioButtonModule,
|
|
11709
|
-
InputTextModule
|
|
12103
|
+
InputTextModule,
|
|
12104
|
+
CoreComponentsTranslationModule,
|
|
12105
|
+
InputDatePickerModule,
|
|
12106
|
+
InputDateRangePickerModule
|
|
11710
12107
|
],
|
|
11711
12108
|
declarations: [
|
|
11712
12109
|
FilterItemComponent
|