@colijnit/corecomponents_v12 260.1.3 → 260.1.5

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.
@@ -5969,6 +5969,7 @@
5969
5969
  _this.ngZoneWrapper = ngZoneWrapper;
5970
5970
  _this.elementRef = elementRef;
5971
5971
  _this.firstDayOfWeek = '';
5972
+ _this.showClearButton = true;
5972
5973
  _super.prototype._markAsOnPush.call(_this);
5973
5974
  return _this;
5974
5975
  }
@@ -6048,7 +6049,7 @@
6048
6049
  InputDatePickerComponent.decorators = [
6049
6050
  { type: i0.Component, args: [{
6050
6051
  selector: 'co-input-date',
6051
- template: "\n <co-input-text (clickOutside)=\"toggleCalendar(false)\" overlayParent #parentForOverlay=\"overlayParent\"\n [hidden]=\"hidden\"\n [readonly]=\"readonly\"\n [(model)]=\"modelAsString\"\n [rightIcon]=\"rightIcon\"\n [leftIcon]=\"leftIcon\"\n [leftIconData]=\"leftIconData\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [placeholder]=\"placeholder\"\n (leftIconClick)=\"leftIconClick.emit($event)\"\n (rightIconClick)=\"toggleCalendar(true)\"\n (modelChange)=\"modelAsString = $event\"\n (clearIconClick)=\"handleClearIconClicked()\"\n [emptyPlace]=\"true\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n (keydown.enter)=\"finalizeDate()\"\n (keydown.tab)=\"finalizeDate()\"\n (blur)=\"finalizeDate()\"\n ></co-input-text>\n ",
6052
+ template: "\n <co-input-text (clickOutside)=\"toggleCalendar(false)\" overlayParent #parentForOverlay=\"overlayParent\"\n [hidden]=\"hidden\"\n [readonly]=\"readonly\"\n [(model)]=\"modelAsString\"\n [rightIcon]=\"rightIcon\"\n [leftIcon]=\"leftIcon\"\n [leftIconData]=\"leftIconData\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [placeholder]=\"placeholder\"\n [showClearButton]=\"showClearButton\"\n (leftIconClick)=\"leftIconClick.emit($event)\"\n (rightIconClick)=\"toggleCalendar(true)\"\n (modelChange)=\"modelAsString = $event\"\n (clearIconClick)=\"handleClearIconClicked()\"\n [emptyPlace]=\"true\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n (keydown.enter)=\"finalizeDate()\"\n (keydown.tab)=\"finalizeDate()\"\n (blur)=\"finalizeDate()\"\n ></co-input-text>\n ",
6052
6053
  providers: [
6053
6054
  OverlayService, {
6054
6055
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, useExisting: i0.forwardRef(function () { return InputDatePickerComponent; })
@@ -6071,6 +6072,7 @@
6071
6072
  ]; };
6072
6073
  InputDatePickerComponent.propDecorators = {
6073
6074
  firstDayOfWeek: [{ type: i0.Input }],
6075
+ showClearButton: [{ type: i0.Input }],
6074
6076
  showClass: [{ type: i0.HostBinding, args: ['class.co-input-date',] }]
6075
6077
  };
6076
6078
 
@@ -11697,6 +11699,7 @@
11697
11699
  this.iconCacheService = iconCacheService;
11698
11700
  this._elementRef = _elementRef;
11699
11701
  this.multiselect = false;
11702
+ this.showToggleAll = false;
11700
11703
  this.displayField = 'description';
11701
11704
  this.searchDisabled = false;
11702
11705
  this.modelChange = new i0.EventEmitter();
@@ -11704,6 +11707,7 @@
11704
11707
  this.keyDown = new i0.EventEmitter();
11705
11708
  this.viewModels = [];
11706
11709
  this.viewModelsMain = [];
11710
+ this.allSelected = false;
11707
11711
  this._collection = [];
11708
11712
  this._searchTerm = '';
11709
11713
  this._lovItems = [];
@@ -11875,6 +11879,27 @@
11875
11879
  this._scrollIntoView();
11876
11880
  }
11877
11881
  };
11882
+ ListOfValuesPopupComponent.prototype.selectAll = function () {
11883
+ if (this.viewModels.length > 0) {
11884
+ this.viewModels.forEach(function (vm) { return vm.checked = true; });
11885
+ this.selectOptions();
11886
+ }
11887
+ };
11888
+ ListOfValuesPopupComponent.prototype.toggleAll = function () {
11889
+ if (!this.allSelected) {
11890
+ if (this.viewModels.length > 0) {
11891
+ this.viewModels.forEach(function (vm) { return vm.checked = true; });
11892
+ this.selectOptions();
11893
+ }
11894
+ }
11895
+ else {
11896
+ if (this.viewModels.length > 0) {
11897
+ this.viewModels.forEach(function (vm) { return vm.checked = false; });
11898
+ this.selectOptions();
11899
+ }
11900
+ }
11901
+ this.allSelected = !this.allSelected;
11902
+ };
11878
11903
  ListOfValuesPopupComponent.prototype._prepareViewModelsMain = function () {
11879
11904
  var _this = this;
11880
11905
  this.viewModelsMain.length = 0;
@@ -11918,7 +11943,7 @@
11918
11943
  ListOfValuesPopupComponent.decorators = [
11919
11944
  { type: i0.Component, args: [{
11920
11945
  selector: 'co-list-of-values-popup',
11921
- template: "\n <div class=\"lov-options\" [overlay]=\"parentForOverlay\" [inheritWidth]=\"true\" [ngClass]=\"customCssClass\"\n id=\"lov-popup\"\n role=\"listbox\" [tabindex]=\"-1\"\n (clickOutside)=\"closePopup.emit($event)\">\n <co-input-search *ngIf=\"multiselect\"\n tabindex=\"-1\"\n [(model)]=\"searchTerm\"\n [placeholder]=\"searchPlaceholder\"\n (keydown)=\"handleInputKeyDown($event)\"\n (modelChange)=\"filterViewModels()\"></co-input-search>\n <ul class=\"dropdown-list\" #dropDownList>\n <li\n #lovItem\n *ngFor=\"let viewModel of viewModels; let index = index\"\n [class.selected]=\"viewModel === highLightModel || viewModels.length === 1\"\n (click)=\"selectViewModel(viewModel, !multiselect)\"\n role=\"option\">\n <ng-container *ngIf=\"!multiselect\">\n <co-icon *ngIf=\"viewModel.model[optionIcon]\" class=\"input-text-left-icon\" [iconData]=\"iconCacheService.getIcon(viewModel.model[optionIcon])\">\n </co-icon>\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n <ng-container *ngIf=\"multiselect\">\n <co-input-checkbox [model]=\"viewModel.checked\"\n (modelChange)=\"selectViewModel(viewModel, false)\"></co-input-checkbox>\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n </li>\n </ul>\n </div>\n ",
11946
+ template: "\n <div class=\"lov-options\" [overlay]=\"parentForOverlay\" [inheritWidth]=\"true\" [ngClass]=\"customCssClass\"\n id=\"lov-popup\"\n role=\"listbox\" [tabindex]=\"-1\"\n (clickOutside)=\"closePopup.emit($event)\">\n <co-input-search *ngIf=\"multiselect\"\n tabindex=\"-1\"\n [(model)]=\"searchTerm\"\n [placeholder]=\"searchPlaceholder\"\n (keydown)=\"handleInputKeyDown($event)\"\n (modelChange)=\"filterViewModels()\"></co-input-search>\n <div class=\"row gap\" *ngIf=\"showToggleAll && multiselect\">\n <co-input-checkbox [model]=\"allSelected\" (modelChange)=\"toggleAll()\"></co-input-checkbox>\n <span [textContent]=\"'DESELECT_ALL' | coreLocalize\" (click)=\"toggleAll()\"></span>\n </div>\n <ul class=\"dropdown-list\" #dropDownList>\n <li\n #lovItem\n *ngFor=\"let viewModel of viewModels; let index = index\"\n [class.selected]=\"viewModel === highLightModel || viewModels.length === 1\"\n (click)=\"selectViewModel(viewModel, !multiselect)\"\n role=\"option\">\n <ng-container *ngIf=\"!multiselect\">\n <co-icon *ngIf=\"viewModel.model[optionIcon]\" class=\"input-text-left-icon\" [iconData]=\"iconCacheService.getIcon(viewModel.model[optionIcon])\">\n </co-icon>\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n <ng-container *ngIf=\"multiselect\">\n <co-input-checkbox [model]=\"viewModel.checked\"\n (modelChange)=\"selectViewModel(viewModel, false)\"></co-input-checkbox>\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n </li>\n </ul>\n </div>\n ",
11922
11947
  encapsulation: i0.ViewEncapsulation.None
11923
11948
  },] }
11924
11949
  ];
@@ -11932,6 +11957,7 @@
11932
11957
  inputSearch: [{ type: i0.ViewChild, args: [InputSearchComponent,] }],
11933
11958
  model: [{ type: i0.Input }],
11934
11959
  multiselect: [{ type: i0.Input }],
11960
+ showToggleAll: [{ type: i0.Input }],
11935
11961
  displayField: [{ type: i0.Input }],
11936
11962
  searchPlaceholder: [{ type: i0.Input }],
11937
11963
  customCssClass: [{ type: i0.Input }],
@@ -11959,6 +11985,7 @@
11959
11985
  _this.elementRef = elementRef;
11960
11986
  _this.icons = exports.CoreComponentsIcon;
11961
11987
  _this.multiselect = false;
11988
+ _this.showToggleAll = false;
11962
11989
  _this.largeCollection = false;
11963
11990
  _this.displayField = 'description';
11964
11991
  _this.searchDisabled = false;
@@ -12112,6 +12139,7 @@
12112
12139
  searchPlaceholder: this.searchPlaceholder,
12113
12140
  displayField: this.displayField,
12114
12141
  multiselect: this.multiselect,
12142
+ showToggleAll: this.showToggleAll,
12115
12143
  model: this.model,
12116
12144
  collection: this.collection,
12117
12145
  optionIcon: this.optionIcon,
@@ -12221,6 +12249,7 @@
12221
12249
  model: [{ type: i0.Input }],
12222
12250
  parentForOverlay: [{ type: i0.ViewChild, args: ['parentForOverlay', { read: i0.ElementRef },] }],
12223
12251
  multiselect: [{ type: i0.HostBinding, args: ['class.custom-height',] }, { type: i0.HostBinding, args: ['class.multi-select',] }, { type: i0.Input }],
12252
+ showToggleAll: [{ type: i0.Input }],
12224
12253
  largeCollection: [{ type: i0.Input }],
12225
12254
  displayField: [{ type: i0.Input }],
12226
12255
  optionIcon: [{ type: i0.Input }],
@@ -12348,7 +12377,8 @@
12348
12377
  OverlayModule,
12349
12378
  ClickoutsideModule,
12350
12379
  IconModule,
12351
- InputSearchModule
12380
+ InputSearchModule,
12381
+ CoreComponentsTranslationModule
12352
12382
  ],
12353
12383
  declarations: [
12354
12384
  ListOfValuesComponent,
@@ -15363,6 +15393,11 @@
15363
15393
  };
15364
15394
  HourSchedulingExpandableComponent.prototype.handleDrop = function (dragEvent, hour) {
15365
15395
  var _this = this;
15396
+ dragEvent.preventDefault();
15397
+ dragEvent.stopPropagation();
15398
+ if (!this.schedule[this.objectsProp] || !this.schedule[this.objectsProp].find(function (object) { return object[_this.idProp] === _this.currentDraggingObject.id; }) && this.currentDraggingObject) {
15399
+ this.currentDraggingObject = undefined;
15400
+ }
15366
15401
  if (this.currentDraggingObject) {
15367
15402
  //The order was scheduled and needs to be moved
15368
15403
  var start = this.currentDraggingObject.start;
@@ -15380,17 +15415,17 @@
15380
15415
  scheduledObject.top = this.timeDifference(this.schedule[this.childProp][this.startTimeProp], scheduledObject.start);
15381
15416
  scheduledObject.height = this.timeDifference(scheduledObject.start, scheduledObject.end);
15382
15417
  this.timeChangeEvent.emit(originalObject);
15383
- this.currentDraggingObject = undefined;
15384
15418
  }
15419
+ this.currentDraggingObject = undefined;
15385
15420
  }
15386
15421
  else {
15387
15422
  var parsed = this.tryParseJSONObject(dragEvent.dataTransfer.getData("text"));
15388
15423
  if (!parsed) {
15389
15424
  this.newObjectPlanEvent.emit({ currentHour: hour, data: parsed.toString() });
15390
- return;
15391
15425
  }
15392
- //Move between calendars is still too buggy
15393
- this.moveBetweenCalendarsEvent.emit({ hour: hour, data: parsed });
15426
+ else {
15427
+ this.moveBetweenCalendarsEvent.emit({ hour: hour, data: parsed });
15428
+ }
15394
15429
  }
15395
15430
  };
15396
15431
  HourSchedulingExpandableComponent.prototype.allowDrop = function (event, hour) {
@@ -15577,8 +15612,10 @@
15577
15612
  return true;
15578
15613
  };
15579
15614
  HourSchedulingExpandableTemplateComponent.prototype.onExpandableDragStart = function (event, obj, onDragStartCustom) {
15580
- onDragStartCustom === null || onDragStartCustom === void 0 ? void 0 : onDragStartCustom.call(obj);
15581
- event.dataTransfer.setData("text", JSON.stringify({ obj: obj }));
15615
+ event.dataTransfer.setData('text', JSON.stringify({ obj: obj }));
15616
+ if (onDragStartCustom) {
15617
+ onDragStartCustom === null || onDragStartCustom === void 0 ? void 0 : onDragStartCustom.call(obj);
15618
+ }
15582
15619
  };
15583
15620
  HourSchedulingExpandableTemplateComponent.prototype.calculateLeftAndWidthOfObjects = function () {
15584
15621
  var layoutData = new Array(this._objects.length);
@@ -15590,8 +15627,9 @@
15590
15627
  var overlapGroups = [];
15591
15628
  var processed = new Set();
15592
15629
  for (var i = 0; i < this._objects.length; i++) {
15593
- if (processed.has(i))
15630
+ if (processed.has(i)) {
15594
15631
  continue;
15632
+ }
15595
15633
  var group = [i];
15596
15634
  var objA = this._objects[i];
15597
15635
  var startA = new Date(objA.start);
@@ -15625,8 +15663,8 @@
15625
15663
  }());
15626
15664
  HourSchedulingExpandableTemplateComponent.decorators = [
15627
15665
  { type: i0.Component, args: [{
15628
- selector: "co-hour-scheduling-expandable-template",
15629
- template: "\n \n <div\n *ngFor=\"let obj of objects\"\n [class]=\"'custom-scheduled-object'\"\n [class.selected]=\"obj.selected\"\n [draggable]=\"!obj.selected\"\n [style.--height]=\"obj.height + 'px'\"\n [style.--top]=\"obj.top + 'px'\"\n [style.--left]=\"layouts[objects.indexOf(obj)].leftPercent + '%'\"\n [style.--width]=\"layouts[objects.indexOf(obj)].widthPercent + '%'\"\n (click)=\"onSelectBlock(obj)\"\n (dragstart)=\"onExpandableDragStart($event, obj, onDragStartCustom(obj) )\">\n\n <div\n *ngIf=\"obj.selected\"\n class=\"top-resizer\"\n (mousedown)=\"onResizeStart($event, obj, 'top')\"></div>\n <ng-template\n [ngTemplateOutlet]=\"objectTemplate\"\n [ngTemplateOutletContext]=\"{\n object: obj\n }\"\n >\n </ng-template>\n <div *ngIf=\"obj.selected\"\n class=\"bottom-resizer\"\n (mousedown)=\"onResizeStart($event, obj, 'bottom')\"></div>\n </div>\n ",
15666
+ selector: 'co-hour-scheduling-expandable-template',
15667
+ template: "\n\n <div\n *ngFor=\"let obj of objects\"\n [class]=\"'custom-scheduled-object'\"\n [class.selected]=\"obj.selected\"\n [draggable]=\"!obj.selected\"\n [style.--height]=\"obj.height + 'px'\"\n [style.--top]=\"obj.top + 'px'\"\n [style.--left]=\"layouts[objects.indexOf(obj)].leftPercent + '%'\"\n [style.--width]=\"layouts[objects.indexOf(obj)].widthPercent + '%'\"\n (click)=\"onSelectBlock(obj)\"\n (dragstart)=\"onExpandableDragStart($event, obj, onDragStartCustom(obj) )\">\n\n <div\n *ngIf=\"obj.selected\"\n class=\"top-resizer\"\n (mousedown)=\"onResizeStart($event, obj, 'top')\"></div>\n <ng-template\n [ngTemplateOutlet]=\"objectTemplate\"\n [ngTemplateOutletContext]=\"{\n object: obj\n }\"\n >\n </ng-template>\n <div *ngIf=\"obj.selected\"\n class=\"bottom-resizer\"\n (mousedown)=\"onResizeStart($event, obj, 'bottom')\"></div>\n </div>\n ",
15630
15668
  encapsulation: i0.ViewEncapsulation.None
15631
15669
  },] }
15632
15670
  ];
@@ -15638,7 +15676,7 @@
15638
15676
  onSelectBlock: [{ type: i0.Input }],
15639
15677
  startTimeProp: [{ type: i0.Input }],
15640
15678
  endTimeProp: [{ type: i0.Input }],
15641
- showClass: [{ type: i0.HostBinding, args: ["class.co-hour-scheduling-expandable-template",] }]
15679
+ showClass: [{ type: i0.HostBinding, args: ['class.co-hour-scheduling-expandable-template',] }]
15642
15680
  };
15643
15681
 
15644
15682
  var HourSchedulingExpandableTemplateModule = /** @class */ (function () {