@colijnit/corecomponents_v12 12.1.6 → 12.1.7
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 +358 -15
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12-12.1.4.tgz +0 -0
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/filter-item/filter-item.component.js +350 -17
- package/esm2015/lib/components/filter-item/filter-item.module.js +8 -2
- package/esm2015/lib/core/enum/filterItem-mode.enum.js +30 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/colijnit-corecomponents_v12.js +383 -18
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/filter-item/filter-item.component.d.ts +36 -3
- package/lib/components/filter-item/style/_layout.scss +9 -0
- package/lib/core/enum/filterItem-mode.enum.d.ts +14 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -5656,6 +5656,36 @@
|
|
|
5656
5656
|
},] }
|
|
5657
5657
|
];
|
|
5658
5658
|
|
|
5659
|
+
exports.FilterItemMode = void 0;
|
|
5660
|
+
(function (FilterItemMode) {
|
|
5661
|
+
FilterItemMode["FilterList"] = "filterList";
|
|
5662
|
+
FilterItemMode["SingleSelectList"] = "singleSelectList";
|
|
5663
|
+
FilterItemMode["SelectListWithStringCollectionOutput"] = "selectListWithStringCollectionOutput";
|
|
5664
|
+
FilterItemMode["SelectListWithNumberOutput"] = "selectListWithNumberOutput";
|
|
5665
|
+
FilterItemMode["Slider"] = "slider";
|
|
5666
|
+
//This mode makes the Filter display a simple textfield.
|
|
5667
|
+
// The value typed into the field will be passed along directly as a string.
|
|
5668
|
+
FilterItemMode["TextField"] = "textField";
|
|
5669
|
+
//This mode makes the Filter display a simple dateField.
|
|
5670
|
+
// Field input will be passed along directly as a date object.
|
|
5671
|
+
FilterItemMode["DateField"] = "dateField";
|
|
5672
|
+
//This mode makes the Filter display a dateRange field.
|
|
5673
|
+
// Field input will be passed along directly as a string with the following syntax: "?>='01-08-2022'& ?<='31-08-2022'"
|
|
5674
|
+
FilterItemMode["DateRangeField"] = "dateRangeField";
|
|
5675
|
+
//This mode makes the Filter display a simple checkBox.
|
|
5676
|
+
// It's value will be passed along directly as a boolean.
|
|
5677
|
+
FilterItemMode["Checkbox"] = "checkbox";
|
|
5678
|
+
//This mode makes the Filter display a simple checkBox.
|
|
5679
|
+
// It's value will be passed along as either a 'T' or and 'F'.
|
|
5680
|
+
FilterItemMode["CheckboxToSimpleText"] = "checkboxToSimpleText";
|
|
5681
|
+
//This mode makes the Filter display a simple checkBox.
|
|
5682
|
+
// It's value will be passed along as either a "?='T'" or and "?='F'".
|
|
5683
|
+
FilterItemMode["CheckboxToText"] = "checkboxToText";
|
|
5684
|
+
//This mode makes the Filter display a simple checkBox.
|
|
5685
|
+
// It's value will be passed along as either a 'T' or and 'F'.
|
|
5686
|
+
FilterItemMode["CheckboxToBinary"] = "checkboxToBinary";
|
|
5687
|
+
})(exports.FilterItemMode || (exports.FilterItemMode = {}));
|
|
5688
|
+
|
|
5659
5689
|
var BaseModule = /** @class */ (function () {
|
|
5660
5690
|
function BaseModule() {
|
|
5661
5691
|
}
|
|
@@ -11496,18 +11526,24 @@
|
|
|
11496
11526
|
function FilterItemComponent(iconService) {
|
|
11497
11527
|
this.iconService = iconService;
|
|
11498
11528
|
this.icons = exports.CoreComponentsIcon;
|
|
11529
|
+
this.modes = exports.FilterItemMode;
|
|
11530
|
+
this.mode = this.modes.FilterList;
|
|
11499
11531
|
this.initialLimit = 10;
|
|
11500
11532
|
this.expanded = false;
|
|
11501
11533
|
// Set to false to use filter item with a multi selectable collection. Set to true to specify custom content
|
|
11502
11534
|
this.customContent = false;
|
|
11503
11535
|
// Set to true to show all results. Set to false to get 'show more' and 'show less' buttons to expand and contract.
|
|
11504
11536
|
this.showAllResults = false;
|
|
11505
|
-
|
|
11537
|
+
//@Input()
|
|
11538
|
+
//public singleSelect: boolean = false;
|
|
11506
11539
|
this.filterButtonLabel = "Search";
|
|
11507
11540
|
this.searchPlaceholder = 'Search...';
|
|
11508
11541
|
this.showMoreLabel = 'Show more';
|
|
11509
11542
|
this.showLessLabel = 'Show less';
|
|
11510
11543
|
this.noResultsLabel = "No results";
|
|
11544
|
+
this.sliderDefaultMin = 0;
|
|
11545
|
+
this.sliderDefaultMax = 100000;
|
|
11546
|
+
this.modelChange = new i0.EventEmitter();
|
|
11511
11547
|
this.collectionChange = new i0.EventEmitter();
|
|
11512
11548
|
this.filterButtonClicked = new i0.EventEmitter();
|
|
11513
11549
|
this.filteredCollection = [];
|
|
@@ -11528,12 +11564,51 @@
|
|
|
11528
11564
|
enumerable: false,
|
|
11529
11565
|
configurable: true
|
|
11530
11566
|
});
|
|
11531
|
-
FilterItemComponent.prototype
|
|
11532
|
-
|
|
11533
|
-
|
|
11567
|
+
Object.defineProperty(FilterItemComponent.prototype, "model", {
|
|
11568
|
+
get: function () {
|
|
11569
|
+
return this._model;
|
|
11570
|
+
},
|
|
11571
|
+
set: function (filterString) {
|
|
11572
|
+
if (this.mode === this.modes.FilterList) {
|
|
11573
|
+
this.readModelForFilterList(filterString);
|
|
11574
|
+
}
|
|
11575
|
+
else if (this.mode === this.modes.SingleSelectList) {
|
|
11576
|
+
this.readModelForSingleSelectList(filterString);
|
|
11577
|
+
}
|
|
11578
|
+
else if (this.mode === this.modes.SelectListWithStringCollectionOutput) {
|
|
11579
|
+
this.readModelForStringCollectionList(filterString);
|
|
11580
|
+
}
|
|
11581
|
+
else if (this.mode === this.modes.SelectListWithNumberOutput) {
|
|
11582
|
+
this.readModelForSelectListWithNumberOutput(filterString);
|
|
11583
|
+
}
|
|
11584
|
+
else if (this.mode === this.modes.Slider) {
|
|
11585
|
+
this.readModelForSliderMode(filterString);
|
|
11586
|
+
}
|
|
11587
|
+
else if (this.mode === this.modes.CheckboxToText || this.mode === this.modes.CheckboxToSimpleText) {
|
|
11588
|
+
this.readModelForCheckboxToText(filterString);
|
|
11589
|
+
}
|
|
11590
|
+
else if (this.mode === this.modes.CheckboxToBinary) {
|
|
11591
|
+
this.readModelForCheckboxToBinary(filterString);
|
|
11592
|
+
}
|
|
11593
|
+
else if (this.mode === this.modes.DateField) {
|
|
11594
|
+
this.readModelForDateField(filterString);
|
|
11595
|
+
}
|
|
11596
|
+
else if (this.mode === this.modes.DateRangeField) {
|
|
11597
|
+
this.readModelForDateRangeField(filterString);
|
|
11598
|
+
}
|
|
11599
|
+
else if (this.mode === this.modes.Checkbox || this.mode === this.modes.TextField) {
|
|
11600
|
+
this._model = filterString;
|
|
11601
|
+
}
|
|
11602
|
+
},
|
|
11603
|
+
enumerable: false,
|
|
11604
|
+
configurable: true
|
|
11605
|
+
});
|
|
11534
11606
|
FilterItemComponent.prototype.ngOnInit = function () {
|
|
11535
11607
|
this.setToInitialLimit();
|
|
11536
11608
|
this.showButton = this.valueSelected();
|
|
11609
|
+
this.sliderMin = this.sliderDefaultMin;
|
|
11610
|
+
this.sliderMax = this.sliderDefaultMax;
|
|
11611
|
+
this.checkBoxToTextModel = false;
|
|
11537
11612
|
};
|
|
11538
11613
|
FilterItemComponent.prototype.setToInitialLimit = function () {
|
|
11539
11614
|
this.limitTo = this.initialLimit;
|
|
@@ -11556,16 +11631,277 @@
|
|
|
11556
11631
|
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
11632
|
};
|
|
11558
11633
|
FilterItemComponent.prototype.handleModelChange = function (model) {
|
|
11559
|
-
this.
|
|
11560
|
-
|
|
11561
|
-
|
|
11562
|
-
|
|
11563
|
-
|
|
11634
|
+
if (this.mode === this.modes.FilterList) {
|
|
11635
|
+
this.showButton = true;
|
|
11636
|
+
model.checked = !model.checked;
|
|
11637
|
+
this.createModelForFilterList();
|
|
11638
|
+
}
|
|
11639
|
+
else if (this.mode === this.modes.SelectListWithStringCollectionOutput) {
|
|
11640
|
+
this.showButton = true;
|
|
11641
|
+
model.checked = !model.checked;
|
|
11642
|
+
this.createModelForStringCollectionList();
|
|
11643
|
+
}
|
|
11644
|
+
else if (this.mode === this.modes.SingleSelectList) {
|
|
11645
|
+
this.showButton = true;
|
|
11646
|
+
this.uncheckForSingleSelect(model);
|
|
11647
|
+
model.checked = !model.checked;
|
|
11648
|
+
this.createModelForSingleSelectList();
|
|
11649
|
+
}
|
|
11650
|
+
else if (this.mode === this.modes.SelectListWithNumberOutput) {
|
|
11651
|
+
this.showButton = true;
|
|
11652
|
+
model.checked = !model.checked;
|
|
11653
|
+
this.createModelForSelectListWithNumberOutput();
|
|
11654
|
+
}
|
|
11655
|
+
else if (this.mode === this.modes.Slider) {
|
|
11656
|
+
this.createModelForSliderMode();
|
|
11657
|
+
}
|
|
11658
|
+
else if (this.mode === this.modes.CheckboxToText) {
|
|
11659
|
+
this.createModelForCheckboxToText();
|
|
11660
|
+
}
|
|
11661
|
+
else if (this.mode === this.modes.CheckboxToSimpleText) {
|
|
11662
|
+
this.createModelForCheckboxToSimpleText();
|
|
11663
|
+
}
|
|
11664
|
+
else if (this.mode === this.modes.CheckboxToBinary) {
|
|
11665
|
+
this.createModelForCheckboxToBinary();
|
|
11666
|
+
}
|
|
11667
|
+
else if (this.mode === this.modes.DateRangeField) {
|
|
11668
|
+
this.createModelForDateRange(model);
|
|
11669
|
+
}
|
|
11670
|
+
else if (this.mode === this.modes.TextField) {
|
|
11671
|
+
this._model = (typeof this._model === 'string' && this._model.length === 0) ? undefined : this._model;
|
|
11672
|
+
}
|
|
11673
|
+
this.modelChange.emit(this._model);
|
|
11674
|
+
};
|
|
11675
|
+
FilterItemComponent.prototype.uncheckForSingleSelect = function (model) {
|
|
11676
|
+
this.collection.forEach(function (m) {
|
|
11677
|
+
if (m.code !== model.code && m.description !== model.description) {
|
|
11678
|
+
m.checked = false;
|
|
11679
|
+
}
|
|
11680
|
+
});
|
|
11681
|
+
};
|
|
11682
|
+
FilterItemComponent.prototype.createModelForFilterList = function () {
|
|
11683
|
+
var filterRange = [];
|
|
11684
|
+
if (this.collection !== null && this.collection !== undefined) {
|
|
11685
|
+
this.collection.forEach(function (viewModel) {
|
|
11686
|
+
if (viewModel.checked) {
|
|
11687
|
+
filterRange.push("?='" + viewModel.code + "'");
|
|
11564
11688
|
}
|
|
11565
11689
|
});
|
|
11690
|
+
this._model = filterRange.join(',');
|
|
11691
|
+
}
|
|
11692
|
+
};
|
|
11693
|
+
FilterItemComponent.prototype.createModelForStringCollectionList = function () {
|
|
11694
|
+
var filterRange = [];
|
|
11695
|
+
this.collection.forEach(function (viewModel) {
|
|
11696
|
+
if (viewModel.checked) {
|
|
11697
|
+
filterRange.push(viewModel.code.toString());
|
|
11698
|
+
}
|
|
11699
|
+
});
|
|
11700
|
+
this._model = filterRange;
|
|
11701
|
+
};
|
|
11702
|
+
FilterItemComponent.prototype.createModelForSingleSelectList = function () {
|
|
11703
|
+
var filterString = "";
|
|
11704
|
+
this.collection.forEach(function (viewModel) {
|
|
11705
|
+
if (viewModel.checked) {
|
|
11706
|
+
filterString = viewModel.code.toString();
|
|
11707
|
+
}
|
|
11708
|
+
});
|
|
11709
|
+
this._model = filterString;
|
|
11710
|
+
};
|
|
11711
|
+
FilterItemComponent.prototype.createModelForSelectListWithNumberOutput = function () {
|
|
11712
|
+
var filterNumber = null;
|
|
11713
|
+
this.collection.forEach(function (viewModel) {
|
|
11714
|
+
if (viewModel.checked) {
|
|
11715
|
+
if (filterNumber == null) {
|
|
11716
|
+
filterNumber = 0;
|
|
11717
|
+
}
|
|
11718
|
+
filterNumber += Number(viewModel.code);
|
|
11719
|
+
}
|
|
11720
|
+
});
|
|
11721
|
+
this._model = filterNumber;
|
|
11722
|
+
};
|
|
11723
|
+
FilterItemComponent.prototype.createModelForSliderMode = function () {
|
|
11724
|
+
this.sliderMin = !!this.sliderMin ? this.sliderMin : this.sliderDefaultMin;
|
|
11725
|
+
this.sliderMax = !!this.sliderMax ? this.sliderMax : this.sliderDefaultMax;
|
|
11726
|
+
var trueLowerBound = Math.min(this.sliderMin, this.sliderMax);
|
|
11727
|
+
var trueUpperBound = Math.max(this.sliderMin, this.sliderMax);
|
|
11728
|
+
this._model = trueLowerBound + " - " + trueUpperBound;
|
|
11729
|
+
};
|
|
11730
|
+
FilterItemComponent.prototype.createModelForCheckboxToText = function () {
|
|
11731
|
+
if (this.checkBoxToTextModel) {
|
|
11732
|
+
this._model = "?='J'";
|
|
11733
|
+
}
|
|
11734
|
+
else {
|
|
11735
|
+
this._model = "?='N'";
|
|
11736
|
+
}
|
|
11737
|
+
};
|
|
11738
|
+
FilterItemComponent.prototype.createModelForCheckboxToSimpleText = function () {
|
|
11739
|
+
if (this.checkBoxToTextModel) {
|
|
11740
|
+
this._model = "J";
|
|
11741
|
+
}
|
|
11742
|
+
else {
|
|
11743
|
+
this._model = "N";
|
|
11744
|
+
}
|
|
11745
|
+
};
|
|
11746
|
+
FilterItemComponent.prototype.createModelForCheckboxToBinary = function () {
|
|
11747
|
+
if (this.checkBoxToTextModel) {
|
|
11748
|
+
this._model = 1;
|
|
11749
|
+
}
|
|
11750
|
+
else {
|
|
11751
|
+
this._model = 0;
|
|
11752
|
+
}
|
|
11753
|
+
};
|
|
11754
|
+
FilterItemComponent.prototype.createModelForDateRange = function (dates) {
|
|
11755
|
+
if (dates) {
|
|
11756
|
+
var startDate = dates[0];
|
|
11757
|
+
var endDate = dates[1];
|
|
11758
|
+
var startDateRequest = startDate ? this._formatDateToString(startDate) : '';
|
|
11759
|
+
var endDateRequest = endDate ? this._formatDateToString(endDate) : '';
|
|
11760
|
+
var filter = "?>='" + startDateRequest + "'& ?<='" + endDateRequest + "'";
|
|
11761
|
+
this._model = filter;
|
|
11762
|
+
}
|
|
11763
|
+
};
|
|
11764
|
+
FilterItemComponent.prototype._formatDateToString = function (date) {
|
|
11765
|
+
var day = date.getDate().toString().padStart(2, '0');
|
|
11766
|
+
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
11767
|
+
var year = date.getFullYear();
|
|
11768
|
+
return day + "-" + month + "-" + year;
|
|
11769
|
+
};
|
|
11770
|
+
FilterItemComponent.prototype.readModelForFilterList = function (filterModel) {
|
|
11771
|
+
var e_1, _c;
|
|
11772
|
+
var filterList = [];
|
|
11773
|
+
var itemsToCheck = [];
|
|
11774
|
+
this.uncheckAll();
|
|
11775
|
+
if (filterModel !== null && filterModel !== undefined && typeof filterModel === 'string' && filterModel.length != 0) {
|
|
11776
|
+
filterList = filterModel.split(",");
|
|
11777
|
+
filterList.forEach(function (filter) {
|
|
11778
|
+
itemsToCheck.push(filter.substr(3, filter.length - 4));
|
|
11779
|
+
});
|
|
11780
|
+
var _loop_1 = function (item) {
|
|
11781
|
+
var filter = this_1.collection.find(function (element) { return element.code.toString() === item; });
|
|
11782
|
+
if (filter) {
|
|
11783
|
+
filter.checked = true;
|
|
11784
|
+
}
|
|
11785
|
+
else {
|
|
11786
|
+
filter.checked = false;
|
|
11787
|
+
}
|
|
11788
|
+
};
|
|
11789
|
+
var this_1 = this;
|
|
11790
|
+
try {
|
|
11791
|
+
for (var itemsToCheck_1 = __values(itemsToCheck), itemsToCheck_1_1 = itemsToCheck_1.next(); !itemsToCheck_1_1.done; itemsToCheck_1_1 = itemsToCheck_1.next()) {
|
|
11792
|
+
var item = itemsToCheck_1_1.value;
|
|
11793
|
+
_loop_1(item);
|
|
11794
|
+
}
|
|
11795
|
+
}
|
|
11796
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
11797
|
+
finally {
|
|
11798
|
+
try {
|
|
11799
|
+
if (itemsToCheck_1_1 && !itemsToCheck_1_1.done && (_c = itemsToCheck_1.return)) _c.call(itemsToCheck_1);
|
|
11800
|
+
}
|
|
11801
|
+
finally { if (e_1) throw e_1.error; }
|
|
11802
|
+
}
|
|
11803
|
+
this._model = filterModel;
|
|
11804
|
+
}
|
|
11805
|
+
else {
|
|
11806
|
+
this._model = undefined;
|
|
11807
|
+
}
|
|
11808
|
+
};
|
|
11809
|
+
FilterItemComponent.prototype.readModelForSingleSelectList = function (singleSelectModel) {
|
|
11810
|
+
this.uncheckAll();
|
|
11811
|
+
if (singleSelectModel !== null && singleSelectModel !== undefined) {
|
|
11812
|
+
var filter = this.collection.find(function (element) { return element.code === singleSelectModel; });
|
|
11813
|
+
if (filter) {
|
|
11814
|
+
filter.checked = true;
|
|
11815
|
+
}
|
|
11816
|
+
this.createModelForSingleSelectList();
|
|
11817
|
+
}
|
|
11818
|
+
};
|
|
11819
|
+
FilterItemComponent.prototype.readModelForStringCollectionList = function (collectionModel) {
|
|
11820
|
+
this.uncheckAll();
|
|
11821
|
+
if (collectionModel !== null && collectionModel !== undefined && this.collection !== null && this.collection !== undefined) {
|
|
11822
|
+
this.collection.forEach(function (viewModel) {
|
|
11823
|
+
if (collectionModel.indexOf(viewModel.code) > -1) {
|
|
11824
|
+
viewModel.checked = true;
|
|
11825
|
+
}
|
|
11826
|
+
else {
|
|
11827
|
+
viewModel.checked = false;
|
|
11828
|
+
}
|
|
11829
|
+
});
|
|
11830
|
+
}
|
|
11831
|
+
};
|
|
11832
|
+
FilterItemComponent.prototype.readModelForSelectListWithNumberOutput = function (numberModel) {
|
|
11833
|
+
var e_2, _c;
|
|
11834
|
+
this.uncheckAll();
|
|
11835
|
+
if (numberModel !== null && numberModel !== undefined) {
|
|
11836
|
+
try {
|
|
11837
|
+
for (var _d = __values(this.collection), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
11838
|
+
var item = _e.value;
|
|
11839
|
+
var itemCode = item.code;
|
|
11840
|
+
var modValue = (numberModel % (2 * itemCode));
|
|
11841
|
+
item.checked = (modValue >= itemCode);
|
|
11842
|
+
}
|
|
11843
|
+
}
|
|
11844
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
11845
|
+
finally {
|
|
11846
|
+
try {
|
|
11847
|
+
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
11848
|
+
}
|
|
11849
|
+
finally { if (e_2) throw e_2.error; }
|
|
11850
|
+
}
|
|
11851
|
+
}
|
|
11852
|
+
};
|
|
11853
|
+
FilterItemComponent.prototype.uncheckAll = function () {
|
|
11854
|
+
if (this.collection !== null && this.collection !== undefined) {
|
|
11855
|
+
this.collection.forEach(function (m) {
|
|
11856
|
+
m.checked = false;
|
|
11857
|
+
});
|
|
11858
|
+
}
|
|
11859
|
+
};
|
|
11860
|
+
FilterItemComponent.prototype.readModelForSliderMode = function (sliderModel) {
|
|
11861
|
+
if (sliderModel !== undefined && sliderModel !== null) {
|
|
11862
|
+
var sliderInputCollection = sliderModel.split(' - ');
|
|
11863
|
+
this.sliderMin = parseInt(sliderInputCollection[0]);
|
|
11864
|
+
this.sliderMax = parseInt(sliderInputCollection[1]);
|
|
11865
|
+
}
|
|
11866
|
+
else {
|
|
11867
|
+
this.sliderMin = this.sliderDefaultMin;
|
|
11868
|
+
this.sliderMax = this.sliderDefaultMax;
|
|
11869
|
+
}
|
|
11870
|
+
};
|
|
11871
|
+
FilterItemComponent.prototype.readModelForCheckboxToText = function (checkboxToTextModel) {
|
|
11872
|
+
if (checkboxToTextModel !== undefined && checkboxToTextModel !== null) {
|
|
11873
|
+
this.checkBoxToTextModel = (checkboxToTextModel.indexOf('J') > -1);
|
|
11874
|
+
}
|
|
11875
|
+
else {
|
|
11876
|
+
this.checkBoxToTextModel = false;
|
|
11877
|
+
}
|
|
11878
|
+
};
|
|
11879
|
+
FilterItemComponent.prototype.readModelForCheckboxToBinary = function (checkboxToBinary) {
|
|
11880
|
+
if (checkboxToBinary !== undefined && checkboxToBinary !== null) {
|
|
11881
|
+
this.checkBoxToTextModel = (checkboxToBinary >= 1);
|
|
11882
|
+
}
|
|
11883
|
+
else {
|
|
11884
|
+
this.checkBoxToTextModel = false;
|
|
11885
|
+
}
|
|
11886
|
+
};
|
|
11887
|
+
FilterItemComponent.prototype.readModelForDateField = function (dateFieldModel) {
|
|
11888
|
+
if (dateFieldModel !== undefined && dateFieldModel !== null) {
|
|
11889
|
+
this._model = new Date(dateFieldModel);
|
|
11890
|
+
}
|
|
11891
|
+
else {
|
|
11892
|
+
this._model = undefined;
|
|
11893
|
+
}
|
|
11894
|
+
};
|
|
11895
|
+
FilterItemComponent.prototype.readModelForDateRangeField = function (dateRangeFieldModel) {
|
|
11896
|
+
if (dateRangeFieldModel !== undefined && dateRangeFieldModel !== null) {
|
|
11897
|
+
var dateCollection = dateRangeFieldModel.split('&');
|
|
11898
|
+
var startString = dateCollection[0].trim().substr(4, dateCollection[0].length - 5);
|
|
11899
|
+
var endString = dateCollection[1].trim().substr(4, dateCollection[1].length - 5);
|
|
11900
|
+
var startDateComponents = startString.split('-');
|
|
11901
|
+
var endDateComponents = endString.split('-');
|
|
11902
|
+
this.dateRangeStart = new Date(parseInt(startDateComponents[2]), parseInt(startDateComponents[1]) - 1, parseInt(startDateComponents[0]));
|
|
11903
|
+
this.dateRangeEnd = new Date(parseInt(endDateComponents[2]), parseInt(endDateComponents[1]) - 1, parseInt(endDateComponents[0]));
|
|
11566
11904
|
}
|
|
11567
|
-
model.checked = !model.checked;
|
|
11568
|
-
this.collectionChange.emit(this.collection);
|
|
11569
11905
|
};
|
|
11570
11906
|
FilterItemComponent.prototype.valueSelected = function () {
|
|
11571
11907
|
if (this.collection) {
|
|
@@ -11625,7 +11961,7 @@
|
|
|
11625
11961
|
FilterItemComponent.decorators = [
|
|
11626
11962
|
{ type: i0.Component, args: [{
|
|
11627
11963
|
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=\"
|
|
11964
|
+
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 <!-- <co-icon [iconData]=\"iconService.getIcon(icons.Check)\" (click)=\"filterOnPrice()\"></co-icon>-->\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\" *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
11965
|
encapsulation: i0.ViewEncapsulation.None,
|
|
11630
11966
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
11631
11967
|
},] }
|
|
@@ -11634,6 +11970,7 @@
|
|
|
11634
11970
|
{ type: IconCacheService }
|
|
11635
11971
|
]; };
|
|
11636
11972
|
FilterItemComponent.propDecorators = {
|
|
11973
|
+
mode: [{ type: i0.Input }],
|
|
11637
11974
|
collection: [{ type: i0.Input }],
|
|
11638
11975
|
placeholder: [{ type: i0.Input }],
|
|
11639
11976
|
initialLimit: [{ type: i0.Input }],
|
|
@@ -11642,15 +11979,18 @@
|
|
|
11642
11979
|
collectionLoadFn: [{ type: i0.Input }],
|
|
11643
11980
|
customContent: [{ type: i0.Input }],
|
|
11644
11981
|
showAllResults: [{ type: i0.Input }],
|
|
11645
|
-
singleSelect: [{ type: i0.Input }],
|
|
11646
11982
|
filterButtonLabel: [{ type: i0.Input }],
|
|
11647
11983
|
searchPlaceholder: [{ type: i0.Input }],
|
|
11648
11984
|
showMoreLabel: [{ type: i0.Input }],
|
|
11649
11985
|
showLessLabel: [{ type: i0.Input }],
|
|
11650
11986
|
noResultsLabel: [{ type: i0.Input }],
|
|
11987
|
+
sliderDefaultMin: [{ type: i0.Input }],
|
|
11988
|
+
sliderDefaultMax: [{ type: i0.Input }],
|
|
11989
|
+
model: [{ type: i0.Input }],
|
|
11990
|
+
modelChange: [{ type: i0.Output }],
|
|
11651
11991
|
collectionChange: [{ type: i0.Output }],
|
|
11652
11992
|
filterButtonClicked: [{ type: i0.Output }],
|
|
11653
|
-
|
|
11993
|
+
filteredCollection: [{ type: i0.HostBinding, args: ["class.co-filter-item",] }]
|
|
11654
11994
|
};
|
|
11655
11995
|
|
|
11656
11996
|
// A pipe for prepending strings to other strings in view templates.
|
|
@@ -11706,7 +12046,10 @@
|
|
|
11706
12046
|
PrependPipeModule,
|
|
11707
12047
|
InputTextModule,
|
|
11708
12048
|
InputRadioButtonModule,
|
|
11709
|
-
InputTextModule
|
|
12049
|
+
InputTextModule,
|
|
12050
|
+
CoreComponentsTranslationModule,
|
|
12051
|
+
InputDatePickerModule,
|
|
12052
|
+
InputDateRangePickerModule
|
|
11710
12053
|
],
|
|
11711
12054
|
declarations: [
|
|
11712
12055
|
FilterItemComponent
|