@colijnit/corecomponents_v12 12.1.8 → 12.2.0

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.
@@ -7219,12 +7219,18 @@
7219
7219
  var day = this.model[0].toLocaleString("default", { day: "2-digit" });
7220
7220
  this.firstDateAsString = year + "-" + month + "-" + day;
7221
7221
  }
7222
+ else {
7223
+ this.firstDateAsString = "";
7224
+ }
7222
7225
  if (this.model[1]) {
7223
7226
  var year = this.model[1].toLocaleString("default", { year: "numeric" });
7224
7227
  var month = this.model[1].toLocaleString("default", { month: "2-digit" });
7225
7228
  var day = this.model[1].toLocaleString("default", { day: "2-digit" });
7226
7229
  this.secondDateAsString = year + "-" + month + "-" + day;
7227
7230
  }
7231
+ else {
7232
+ this.secondDateAsString = "";
7233
+ }
7228
7234
  };
7229
7235
  return InputDateRangePickerComponent;
7230
7236
  }(BaseInputDatePickerDirective));
@@ -11557,7 +11563,6 @@
11557
11563
  this._changeDetector = _changeDetector;
11558
11564
  this.icons = exports.CoreComponentsIcon;
11559
11565
  this.modes = exports.FilterItemMode;
11560
- this.mode = this.modes.Filterlist;
11561
11566
  this.initialLimit = 10;
11562
11567
  this.expanded = false;
11563
11568
  // Set to false to use filter item with a multi selectable collection. Set to true to specify custom content
@@ -11579,7 +11584,19 @@
11579
11584
  this.filterText = "";
11580
11585
  this.showButton = false;
11581
11586
  this._collection = [];
11587
+ this._mode = this.modes.Filterlist;
11582
11588
  }
11589
+ Object.defineProperty(FilterItemComponent.prototype, "mode", {
11590
+ get: function () {
11591
+ return this._mode;
11592
+ },
11593
+ set: function (value) {
11594
+ this._mode = value;
11595
+ this.readModelForMode(this._model);
11596
+ },
11597
+ enumerable: false,
11598
+ configurable: true
11599
+ });
11583
11600
  Object.defineProperty(FilterItemComponent.prototype, "collection", {
11584
11601
  get: function () {
11585
11602
  return this._collection;
@@ -11598,37 +11615,8 @@
11598
11615
  get: function () {
11599
11616
  return this._model;
11600
11617
  },
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
- }
11618
+ set: function (newModel) {
11619
+ this.readModelForMode(newModel);
11632
11620
  },
11633
11621
  enumerable: false,
11634
11622
  configurable: true
@@ -11636,7 +11624,9 @@
11636
11624
  FilterItemComponent.prototype.ngOnInit = function () {
11637
11625
  this.setToInitialLimit();
11638
11626
  this.showButton = this.valueSelected();
11639
- this.checkBoxToTextModel = false;
11627
+ if (this.checkBoxToTextModel === undefined || this.checkBoxToTextModel === null) {
11628
+ this.checkBoxToTextModel = false;
11629
+ }
11640
11630
  };
11641
11631
  FilterItemComponent.prototype.setToInitialLimit = function () {
11642
11632
  this.limitTo = this.initialLimit;
@@ -11682,34 +11672,33 @@
11682
11672
  this._createModelForSelectListWithNumberOutput();
11683
11673
  break;
11684
11674
  case this.modes.Slider:
11675
+ this.showButton = true;
11685
11676
  this._createModelForSliderMode();
11686
11677
  break;
11687
11678
  case this.modes.CheckboxToText:
11679
+ this.showButton = true;
11688
11680
  this._createModelForCheckboxToText();
11689
11681
  break;
11690
11682
  case this.modes.CheckboxToSimpleText:
11683
+ this.showButton = true;
11691
11684
  this._createModelForCheckboxToSimpleText();
11692
11685
  break;
11693
11686
  case this.modes.CheckboxToBinary:
11687
+ this.showButton = true;
11694
11688
  this._createModelForCheckboxToBinary();
11695
11689
  break;
11696
11690
  case this.modes.DateRangeField:
11691
+ this.showButton = true;
11697
11692
  this._createModelForDateRange(model);
11698
11693
  break;
11699
11694
  case this.modes.TextField:
11695
+ this.showButton = true;
11700
11696
  this._model = (typeof this._model === 'string' && this._model.length === 0) ? undefined : this._model;
11701
11697
  break;
11702
11698
  }
11703
11699
  this.modelChange.emit(this._model);
11704
11700
  this.collectionChange.emit(this.collection);
11705
11701
  };
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
- };
11713
11702
  FilterItemComponent.prototype.valueSelected = function () {
11714
11703
  if (this.collection) {
11715
11704
  return !!this.collection.find(function (c) { return c.checked; });
@@ -11763,6 +11752,47 @@
11763
11752
  FilterItemComponent.prototype.onButtonClicked = function () {
11764
11753
  this.filterButtonClicked.emit();
11765
11754
  };
11755
+ FilterItemComponent.prototype.uncheckForSingleSelect = function (model) {
11756
+ this.collection.forEach(function (m) {
11757
+ if (m.code !== model.code && m.description !== model.description) {
11758
+ m.checked = false;
11759
+ }
11760
+ });
11761
+ };
11762
+ FilterItemComponent.prototype.readModelForMode = function (newModel) {
11763
+ switch (this.mode) {
11764
+ case this.modes.Filterlist:
11765
+ this._readModelForFilterList(newModel);
11766
+ break;
11767
+ case this.modes.SingleSelectList:
11768
+ this._readModelForSingleSelectList(newModel);
11769
+ break;
11770
+ case this.modes.SelectListWithStringCollectionOutput:
11771
+ this._readModelForStringCollectionList(newModel);
11772
+ break;
11773
+ case this.modes.SelectListWithNumberOutput:
11774
+ this._readModelForSelectListWithNumberOutput(newModel);
11775
+ break;
11776
+ case this.modes.Slider:
11777
+ this._readModelForSliderMode(newModel);
11778
+ break;
11779
+ case this.modes.CheckboxToText:
11780
+ case this.modes.CheckboxToSimpleText:
11781
+ this._readModelForCheckboxToText(newModel);
11782
+ break;
11783
+ case this.modes.CheckboxToBinary:
11784
+ this._readModelForCheckboxToBinary(newModel);
11785
+ break;
11786
+ case this.modes.DateField:
11787
+ this._readModelForDateField(newModel);
11788
+ break;
11789
+ case this.modes.DateRangeField:
11790
+ this._readModelForDateRangeField(newModel);
11791
+ break;
11792
+ default:
11793
+ this._model = newModel;
11794
+ }
11795
+ };
11766
11796
  /////////////////////////////////////////////////////////////
11767
11797
  //Model creation for all of the different options available//
11768
11798
  /////////////////////////////////////////////////////////////
@@ -11887,9 +11917,6 @@
11887
11917
  if (filter !== null && filter !== undefined) {
11888
11918
  filter.checked = true;
11889
11919
  }
11890
- else {
11891
- filter.checked = false;
11892
- }
11893
11920
  };
11894
11921
  var this_1 = this;
11895
11922
  try {
@@ -11913,7 +11940,7 @@
11913
11940
  this._model = singleSelectModel;
11914
11941
  if (singleSelectModel !== null && singleSelectModel !== undefined && this.collection !== null && this.collection !== undefined) {
11915
11942
  var filter = this.collection.find(function (element) { return element.code.toString() === singleSelectModel; });
11916
- if (filter) {
11943
+ if (filter !== null && filter !== undefined) {
11917
11944
  filter.checked = true;
11918
11945
  }
11919
11946
  }
@@ -11996,6 +12023,9 @@
11996
12023
  if (dateFieldModel !== undefined && dateFieldModel !== null) {
11997
12024
  this._model = new Date(dateFieldModel);
11998
12025
  }
12026
+ else {
12027
+ this._model = undefined;
12028
+ }
11999
12029
  };
12000
12030
  FilterItemComponent.prototype._readModelForDateRangeField = function (dateRangeFieldModel) {
12001
12031
  this._model = dateRangeFieldModel;
@@ -12008,6 +12038,10 @@
12008
12038
  this.dateRangeStart = new Date(parseInt(startDateComponents[2]), parseInt(startDateComponents[1]) - 1, parseInt(startDateComponents[0]));
12009
12039
  this.dateRangeEnd = new Date(parseInt(endDateComponents[2]), parseInt(endDateComponents[1]) - 1, parseInt(endDateComponents[0]));
12010
12040
  }
12041
+ else {
12042
+ this.dateRangeStart = undefined;
12043
+ this.dateRangeEnd = undefined;
12044
+ }
12011
12045
  };
12012
12046
  return FilterItemComponent;
12013
12047
  }());