@colijnit/corecomponents_v12 12.2.10 → 12.2.12

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.
Files changed (27) hide show
  1. package/bundles/colijnit-corecomponents_v12.umd.js +82 -37
  2. package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
  3. package/colijnit-corecomponents_v12.metadata.json +1 -1
  4. package/esm2015/lib/components/calendar/calendar-template.component.js +51 -17
  5. package/esm2015/lib/components/co-dialog/co-dialog.component.js +16 -13
  6. package/esm2015/lib/components/co-dialog/co-dialog.module.js +4 -2
  7. package/esm2015/lib/components/form/form.component.js +2 -2
  8. package/esm2015/lib/components/input-date-range-picker/input-date-range-picker.component.js +14 -4
  9. package/esm2015/lib/components/simple-grid/simple-grid.component.js +3 -3
  10. package/esm2015/lib/directives/overlay/overlay.directive.js +18 -9
  11. package/fesm2015/colijnit-corecomponents_v12.js +117 -61
  12. package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
  13. package/lib/components/button/style/_layout.scss +29 -7
  14. package/lib/components/button/style/_material-definition.scss +12 -0
  15. package/lib/components/calendar/calendar-template.component.d.ts +4 -0
  16. package/lib/components/calendar/style/_layout.scss +33 -4
  17. package/lib/components/calendar/style/_material-definition.scss +25 -12
  18. package/lib/components/co-dialog/style/_layout.scss +25 -8
  19. package/lib/components/co-dialog/style/_material-definition.scss +8 -7
  20. package/lib/components/double-calendar/style/_layout.scss +4 -3
  21. package/lib/components/input-date-range-picker/input-date-range-picker.component.d.ts +5 -0
  22. package/lib/components/simple-grid/style/_layout.scss +7 -0
  23. package/lib/components/simple-grid/style/_material-definition.scss +2 -0
  24. package/lib/directives/overlay/overlay.directive.d.ts +1 -1
  25. package/lib/style/_variables.scss +6 -1
  26. package/lib/style/corecomponents-globals.scss +61 -9
  27. package/package.json +1 -1
@@ -12,9 +12,9 @@ import { PlaneBufferGeometry, Mesh, Vector2, Vector3, PlaneGeometry, MeshPhongMa
12
12
  import { CSS3DObject, CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer';
13
13
  import * as TWEEN from '@tweenjs/tween.js';
14
14
  import 'hammerjs';
15
+ import { DragDropModule, moveItemInArray } from '@angular/cdk/drag-drop';
15
16
  import { OverlayConfig, Overlay } from '@angular/cdk/overlay';
16
17
  import { ComponentPortal } from '@angular/cdk/portal';
17
- import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
18
18
  import { ScrollingModule } from '@angular/cdk/scrolling';
19
19
  import { ArrayUtils as ArrayUtils$1 } from '@colijnit/ioneconnector/build/utils/array-utils';
20
20
  import { DEFAULT_GET_OBJECT_CONFIGURATION_PARAMS } from '@colijnit/ioneconnector/build/model/default-get-object-configurations-params';
@@ -4406,20 +4406,23 @@ CoDialogComponent.decorators = [
4406
4406
  selector: 'co-dialog',
4407
4407
  template: `
4408
4408
  <div class="co-dialog-overlay" (click)="handleOverlayClick($event)"></div>
4409
- <div class="co-dialog-wrapper" [ngClass]="customCssClass ? customCssClass : undefined" @showHideDialog>
4410
- <div class="dialog-header" *ngIf="!borderless">
4411
- <div class="dialog-header-caption" *ngIf="headerTemplate">
4412
- <ng-container [ngTemplateOutlet]="headerTemplate"></ng-container>
4409
+ <div class="co-dialog-placeholder">
4410
+ <div class="co-dialog-wrapper" [ngClass]="customCssClass ? customCssClass : undefined" @showHideDialog cdkDrag>
4411
+ <div *ngIf="!borderless" class="dialog-drag-handle" cdkDragHandle></div>
4412
+ <div class="dialog-header" *ngIf="!borderless">
4413
+ <div class="dialog-header-caption" *ngIf="headerTemplate">
4414
+ <ng-container [ngTemplateOutlet]="headerTemplate"></ng-container>
4415
+ </div>
4416
+ <div class="dialog-close-button" *ngIf="showCloseIcon" (click)="handleCloseDialog($event)">
4417
+ <co-icon [icon]="icons.CrossSkinny"></co-icon>
4418
+ </div>
4413
4419
  </div>
4414
- <div class="dialog-close-button" *ngIf="showCloseIcon" (click)="handleCloseDialog($event)">
4415
- <co-icon [icon]="icons.CrossSkinny"></co-icon>
4420
+ <div class="dialog-content co-small-scrollbar" [ngClass]="customCssClass ? customCssClass : undefined">
4421
+ <ng-content></ng-content>
4422
+ </div>
4423
+ <div class="dialog-footer" *ngIf="footerTemplate">
4424
+ <ng-container [ngTemplateOutlet]="footerTemplate"></ng-container>
4416
4425
  </div>
4417
- </div>
4418
- <div class="dialog-content co-small-scrollbar" [ngClass]="customCssClass ? customCssClass : undefined">
4419
- <ng-content></ng-content>
4420
- </div>
4421
- <div class="dialog-footer" *ngIf="footerTemplate">
4422
- <ng-container [ngTemplateOutlet]="footerTemplate"></ng-container>
4423
4426
  </div>
4424
4427
  </div>
4425
4428
  `,
@@ -4463,7 +4466,8 @@ CoDialogModule.decorators = [
4463
4466
  { type: NgModule, args: [{
4464
4467
  imports: [
4465
4468
  CommonModule,
4466
- IconModule
4469
+ IconModule,
4470
+ DragDropModule
4467
4471
  ],
4468
4472
  declarations: [CoDialogComponent],
4469
4473
  exports: [CoDialogComponent]
@@ -4898,7 +4902,7 @@ class FormComponent {
4898
4902
  }
4899
4903
  FormComponent.decorators = [
4900
4904
  { type: Component, args: [{
4901
- selector: "co-form",
4905
+ selector: "co-form-test",
4902
4906
  template: `
4903
4907
  <ng-content></ng-content>
4904
4908
  `,
@@ -5462,6 +5466,24 @@ InputDatePickerComponent.propDecorators = {
5462
5466
  showClass: [{ type: HostBinding, args: ['class.co-input-date',] }]
5463
5467
  };
5464
5468
 
5469
+ class OverlayParentDirective {
5470
+ constructor(elementRef) {
5471
+ this.elementRef = elementRef;
5472
+ }
5473
+ ngOnDestroy() {
5474
+ this.elementRef = undefined;
5475
+ }
5476
+ }
5477
+ OverlayParentDirective.decorators = [
5478
+ { type: Directive, args: [{
5479
+ selector: '[overlayParent]',
5480
+ exportAs: 'overlayParent'
5481
+ },] }
5482
+ ];
5483
+ OverlayParentDirective.ctorParameters = () => [
5484
+ { type: ElementRef }
5485
+ ];
5486
+
5465
5487
  class OverlayDirective {
5466
5488
  constructor(elementRef) {
5467
5489
  /**
@@ -5480,7 +5502,15 @@ class OverlayDirective {
5480
5502
  }
5481
5503
  set parent(value) {
5482
5504
  if (value) {
5483
- this._parent = value instanceof ElementRef ? value : value.elementRef;
5505
+ if (value instanceof ElementRef) {
5506
+ this._parent = value.nativeElement;
5507
+ }
5508
+ else if (value instanceof OverlayParentDirective) {
5509
+ this._parent = value.elementRef.nativeElement;
5510
+ }
5511
+ else {
5512
+ this._parent = value;
5513
+ }
5484
5514
  }
5485
5515
  else {
5486
5516
  if (this._parent && this._resizeObserver) {
@@ -5521,14 +5551,14 @@ class OverlayDirective {
5521
5551
  root: null
5522
5552
  });
5523
5553
  if (this._parent) {
5524
- this._intersectionObserver.observe(this._parent.nativeElement); // observe parent for visibility
5554
+ this._intersectionObserver.observe(this._parent); // observe parent for visibility
5525
5555
  }
5526
5556
  this._resizeObserver.observe(document.body);
5527
5557
  }
5528
5558
  _checkAndPlaceElement() {
5529
- if (this._elementRef && this._elementRef.nativeElement && this._parent && this._parent.nativeElement) {
5559
+ if (this._elementRef && this._elementRef.nativeElement && this._parent) {
5530
5560
  const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
5531
- const parentBoundingRect = this._parent.nativeElement.getBoundingClientRect();
5561
+ const parentBoundingRect = this._parent.getBoundingClientRect();
5532
5562
  let parentRect = {};
5533
5563
  if (!this.inline) {
5534
5564
  parentRect = {
@@ -5541,10 +5571,10 @@ class OverlayDirective {
5541
5571
  }
5542
5572
  else {
5543
5573
  parentRect = {
5544
- bottom: this._parent.nativeElement.offsetTop + parentBoundingRect.height,
5545
- right: this._parent.nativeElement.offsetLeft + parentBoundingRect.width,
5546
- left: this._parent.nativeElement.offsetLeft,
5547
- top: this._parent.nativeElement.offsetTop,
5574
+ bottom: this._parent.offsetTop + parentBoundingRect.height,
5575
+ right: this._parent.offsetLeft + parentBoundingRect.width,
5576
+ left: this._parent.offsetLeft,
5577
+ top: this._parent.offsetTop,
5548
5578
  width: parentBoundingRect.width
5549
5579
  };
5550
5580
  }
@@ -5607,24 +5637,6 @@ OverlayDirective.propDecorators = {
5607
5637
  fullSize: [{ type: Input }]
5608
5638
  };
5609
5639
 
5610
- class OverlayParentDirective {
5611
- constructor(elementRef) {
5612
- this.elementRef = elementRef;
5613
- }
5614
- ngOnDestroy() {
5615
- this.elementRef = undefined;
5616
- }
5617
- }
5618
- OverlayParentDirective.decorators = [
5619
- { type: Directive, args: [{
5620
- selector: '[overlayParent]',
5621
- exportAs: 'overlayParent'
5622
- },] }
5623
- ];
5624
- OverlayParentDirective.ctorParameters = () => [
5625
- { type: ElementRef }
5626
- ];
5627
-
5628
5640
  class OverlayModule {
5629
5641
  }
5630
5642
  OverlayModule.decorators = [
@@ -6250,6 +6262,8 @@ ClickoutsideModule.decorators = [
6250
6262
  class CalendarTemplateComponent {
6251
6263
  constructor() {
6252
6264
  this.icons = CoreComponentsIcon;
6265
+ this.showWeekNumbers = true;
6266
+ this.weekNumbers = [];
6253
6267
  this.locale = "nl-NL";
6254
6268
  this.highlightDaysBetweenDates = false;
6255
6269
  this.dateSelected = new EventEmitter();
@@ -6322,6 +6336,7 @@ class CalendarTemplateComponent {
6322
6336
  }
6323
6337
  this.generateCalendar();
6324
6338
  this._fillDatesBetweenSelected();
6339
+ this.calculateWeekNumbers();
6325
6340
  }
6326
6341
  nextMonth() {
6327
6342
  if (this.workingMonth === 11) {
@@ -6333,6 +6348,7 @@ class CalendarTemplateComponent {
6333
6348
  }
6334
6349
  this.generateCalendar();
6335
6350
  this._fillDatesBetweenSelected();
6351
+ this.calculateWeekNumbers();
6336
6352
  }
6337
6353
  prevYear() {
6338
6354
  this.workingYear--;
@@ -6351,6 +6367,7 @@ class CalendarTemplateComponent {
6351
6367
  this.monthHeader = `${month} ${year}`;
6352
6368
  this.yearHeader = `${year}`;
6353
6369
  this.generateYearSelectionYears();
6370
+ this.calculateWeekNumbers();
6354
6371
  }
6355
6372
  _setInitialValues() {
6356
6373
  this.workingDay = this.selectedDate ? this.selectedDate : new Date();
@@ -6480,6 +6497,28 @@ class CalendarTemplateComponent {
6480
6497
  _capitalizeFirstLetter(value) {
6481
6498
  return value.charAt(0).toUpperCase() + value.slice(1);
6482
6499
  }
6500
+ calculateWeekNumbers() {
6501
+ this.weekNumbers = [];
6502
+ let weekNumber = null;
6503
+ for (let i = 0; i < this.daysInMonth.length; i++) {
6504
+ const day = this.daysInMonth[i];
6505
+ if (day) {
6506
+ // Start of a new week or first day of the month, calculate and set weekNumber
6507
+ weekNumber = this.getISOWeek(day);
6508
+ // Check if the weekNumber is not already in the array
6509
+ if (!this.weekNumbers.includes(weekNumber)) {
6510
+ this.weekNumbers.push(weekNumber);
6511
+ }
6512
+ }
6513
+ }
6514
+ }
6515
+ getISOWeek(date) {
6516
+ const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
6517
+ d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
6518
+ const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
6519
+ const weekNumber = Math.ceil(((d.valueOf() - yearStart.valueOf()) / 86400000 + 1) / 7);
6520
+ return weekNumber;
6521
+ }
6483
6522
  }
6484
6523
  CalendarTemplateComponent.decorators = [
6485
6524
  { type: Component, args: [{
@@ -6518,23 +6557,29 @@ CalendarTemplateComponent.decorators = [
6518
6557
  </ng-container>
6519
6558
  </div>
6520
6559
  </div>
6521
-
6522
- <div class="calendar-body" *ngIf="showCalendarBody">
6523
- <div class="day-names">
6524
- <div class="weekday" *ngFor="let dayName of dayNames" [textContent]="dayName"></div>
6560
+ <div class="calendar-wrapper">
6561
+ <div class="week-wrapper" *ngIf="showWeekNumbers && showCalendarBody">
6562
+ <div class="week-number" [textContent]="'W'"></div>
6563
+ <div class="week-number" *ngFor="let weekNumber of weekNumbers">
6564
+ {{ weekNumber }}
6565
+ </div>
6525
6566
  </div>
6526
- <div *ngFor="let day of daysInMonth" class="calendar-day"
6527
- [class.highlighted-day]="daysToHighlight.includes(day)"
6528
- [class.selected-day]="selectedDate && (day && day.getTime() === selectedDate.getTime()) ||
6529
- secondSelectedDate && (day && day.getTime() === secondSelectedDate.getTime()) ||
6530
- temporarySelectedSecondaryDate && (day && day.getTime() === temporarySelectedSecondaryDate.getTime())"
6531
-
6532
- (click)="selectDate(day)"
6533
- (mouseover)="handleMouseOverDay(day)">
6534
- <ng-container *ngIf="day">
6535
- <div class="day-number"
6536
- [textContent]="day.getDate()"></div>
6537
- </ng-container>
6567
+ <div class="calendar-body" *ngIf="showCalendarBody">
6568
+ <div class="day-names">
6569
+ <div class="weekday" *ngFor="let dayName of dayNames" [textContent]="dayName"></div>
6570
+ </div>
6571
+ <div *ngFor="let day of daysInMonth" class="calendar-day"
6572
+ [class.highlighted-day]="daysToHighlight.includes(day)"
6573
+ [class.selected-day]="selectedDate && (day && day.getTime() === selectedDate.getTime()) ||
6574
+ secondSelectedDate && (day && day.getTime() === secondSelectedDate.getTime()) ||
6575
+ temporarySelectedSecondaryDate && (day && day.getTime() === temporarySelectedSecondaryDate.getTime())"
6576
+ (click)="selectDate(day)"
6577
+ (mouseover)="handleMouseOverDay(day)">
6578
+ <!-- Day number -->
6579
+ <ng-container *ngIf="day">
6580
+ <div class="day-number" [textContent]="day.getDate()"></div>
6581
+ </ng-container>
6582
+ </div>
6538
6583
  </div>
6539
6584
  </div>
6540
6585
  </div>
@@ -6543,6 +6588,7 @@ CalendarTemplateComponent.decorators = [
6543
6588
  },] }
6544
6589
  ];
6545
6590
  CalendarTemplateComponent.propDecorators = {
6591
+ showWeekNumbers: [{ type: Input }],
6546
6592
  locale: [{ type: Input }],
6547
6593
  highlightDaysBetweenDates: [{ type: Input }],
6548
6594
  selectedDate: [{ type: Input }],
@@ -6694,6 +6740,12 @@ class InputDateRangePickerComponent extends BaseInputDatePickerDirective {
6694
6740
  showClass() {
6695
6741
  return true;
6696
6742
  }
6743
+ handleFirstInputClick(event) {
6744
+ event.stopPropagation();
6745
+ }
6746
+ handleSecondInputClick(event) {
6747
+ event.stopPropagation();
6748
+ }
6697
6749
  handleDatesSelected(dates) {
6698
6750
  this.setModel(dates);
6699
6751
  }
@@ -6769,7 +6821,7 @@ InputDateRangePickerComponent.decorators = [
6769
6821
  selector: 'co-input-date-range',
6770
6822
  template: `
6771
6823
  <div class="inputs-wrapper" overlayParent #parentForOverlay="overlayParent">
6772
- <co-input-text class="no-focus-line custom-height"
6824
+ <co-input-text #firstInput class="no-focus-line custom-height"
6773
6825
  [(model)]="firstDateAsString"
6774
6826
  [noClickFocus]="true"
6775
6827
  [pattern]="'yyyy-MM-dd'"
@@ -6779,8 +6831,9 @@ InputDateRangePickerComponent.decorators = [
6779
6831
  [placeholder]="placeholder"
6780
6832
  (blur)="handleFirstDateChanged(firstDateAsString)"
6781
6833
  (clearIconClick)="clearDate(0)"
6834
+ (click)="handleFirstInputClick($event)"
6782
6835
  ></co-input-text>
6783
- <co-input-text class="no-focus-line custom-height"
6836
+ <co-input-text #secondInput class="no-focus-line custom-height"
6784
6837
  [(model)]= "secondDateAsString"
6785
6838
  [noClickFocus]="true"
6786
6839
  [pattern]="'yyyy-MM-dd'"
@@ -6789,6 +6842,7 @@ InputDateRangePickerComponent.decorators = [
6789
6842
  (rightIconClick)="toggleCalendar()"
6790
6843
  (blur)="handleSecondDateChanged(secondDateAsString)"
6791
6844
  (clearIconClick)="clearDate(1)"
6845
+ (click)="handleSecondInputClick($event)"
6792
6846
  ></co-input-text>
6793
6847
  </div>
6794
6848
  `,
@@ -6806,6 +6860,8 @@ InputDateRangePickerComponent.decorators = [
6806
6860
  },] }
6807
6861
  ];
6808
6862
  InputDateRangePickerComponent.propDecorators = {
6863
+ firstInput: [{ type: ViewChild, args: ['firstInput',] }],
6864
+ secondInput: [{ type: ViewChild, args: ['secondInput',] }],
6809
6865
  showClass: [{ type: HostBinding, args: ['class.co-input-date-range',] }]
6810
6866
  };
6811
6867
 
@@ -9482,7 +9538,7 @@ SimpleGridComponent.decorators = [
9482
9538
  [class.disabled]="isRowDisabled(row)"
9483
9539
  [class.editing]="rowIndex === editRowIndex" *ngFor="let row of (!!rowsPerPage ? (data | paginate: {itemsPerPage: rowsPerPage, currentPage: currentPage}) : data); last as last; let rowIndex = index" cdkDrag
9484
9540
  (click)="handleClickRow($event, rowIndex, row)" (dblclick)="handleDblClickRow($event, rowIndex, row)" (visibilityChange)="rowVisible.next(row)">
9485
- <co-form class="simple-grid-row-form">
9541
+ <co-form-test class="simple-grid-row-form">
9486
9542
  <ng-container *ngIf="isSingleColumnRow(row)">
9487
9543
  <td class="simple-grid-single-column-cell" [attr.colspan]="headerColumns.length">
9488
9544
  <co-simple-grid-cell
@@ -9506,7 +9562,7 @@ SimpleGridComponent.decorators = [
9506
9562
  </td>
9507
9563
  </ng-container>
9508
9564
  </ng-container>
9509
- </co-form>
9565
+ </co-form-test>
9510
9566
  </tr>
9511
9567
  </tbody>
9512
9568
  </table>