@colijnit/corecomponents_v12 259.1.11 → 259.1.13

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.
@@ -1039,6 +1039,8 @@ var CoreComponentsIcon;
1039
1039
  CoreComponentsIcon["Cancel"] = "cancel";
1040
1040
  CoreComponentsIcon["CancelRoundFilled"] = "cancel_round_filled";
1041
1041
  CoreComponentsIcon["CancelRoundOpen"] = "cancel_round_open";
1042
+ CoreComponentsIcon["CaretDownSolid"] = "caret_down_solid";
1043
+ CoreComponentsIcon["CaretUpSolid"] = "caret_up_solid";
1042
1044
  CoreComponentsIcon["Cart"] = "cart";
1043
1045
  CoreComponentsIcon["CartOpen"] = "cart_open";
1044
1046
  CoreComponentsIcon["CaseManager"] = "case_manager";
@@ -1343,6 +1345,8 @@ const CoreComponentsIconSvg = {
1343
1345
  "cancel": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><polygon points=\"36 35.16 30.45 35.16 14 14.84 19.55 14.84 36 35.16\" fill=\"#484f60\"/><polygon points=\"14 35.16 19.55 35.16 36 14.84 30.45 14.84 14 35.16\" fill=\"#484f60\"/></svg>",
1344
1346
  "cancel_round_filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M25,10A15,15,0,1,0,40,25,15,15,0,0,0,25,10Zm9.38,23.32h-5.3L25,28.27l-4.08,5.05H15.63L22.35,25l-6.72-8.32h5.29L25,21.73l4.08-5.05h5.3L27.64,25Z\" fill=\"#484f60\"/></svg>",
1345
1347
  "cancel_round_open": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M25,40.17a15,15,0,1,1,15-15A15,15,0,0,1,25,40.17Zm0-29a14,14,0,1,0,14,14A14,14,0,0,0,25,11.13Z\" fill=\"#484f60\"/><polygon points=\"29.41 32.25 25 26.79 20.59 32.25 17.96 32.25 23.68 25.17 17.96 18.09 20.59 18.09 25 23.54 29.41 18.09 32.04 18.09 26.32 25.17 32.04 32.25 29.41 32.25\" fill=\"#484f60\"/></svg>",
1348
+ "caret_down_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><path d=\"M480 224C492.9 224 504.6 231.8 509.6 243.8C514.6 255.8 511.8 269.5 502.7 278.7L342.7 438.7C330.2 451.2 309.9 451.2 297.4 438.7L137.4 278.7C128.2 269.5 125.5 255.8 130.5 243.8C135.5 231.8 147.1 224 160 224L480 224z\"/></svg>",
1349
+ "caret_up_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><path d=\"M160 416C147.1 416 135.4 408.2 130.4 396.2C125.4 384.2 128.2 370.5 137.4 361.4L297.4 201.4C309.9 188.9 330.2 188.9 342.7 201.4L502.7 361.4C511.9 370.6 514.6 384.3 509.6 396.3C504.6 408.3 492.9 416 480 416L160 416z\"/></svg>",
1346
1350
  "cart": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M16.58,34.84a1.8,1.8,0,1,0,1.8,1.8A1.79,1.79,0,0,0,16.58,34.84Z\" fill=\"#484f60\"/><path d=\"M31.49,34.84a1.8,1.8,0,1,0,1.8,1.8A1.79,1.79,0,0,0,31.49,34.84Z\" fill=\"#484f60\"/><path d=\"M13.39,31.55A1.73,1.73,0,0,0,15,32.72H32.64a1.51,1.51,0,0,0,1.43-1.2L36.6,19a.89.89,0,0,0-1-1.09L10.92,20.83a1,1,0,0,0-.87,1.28Zm19-2.05a1.52,1.52,0,0,1-1.44,1.2H16.51a1.75,1.75,0,0,1-1.57-1.17l-2.31-5.6a1,1,0,0,1,.85-1.29l19.71-2.51a.88.88,0,0,1,1,1.08Z\" fill=\"#484f60\"/><path d=\"M39,17a1.87,1.87,0,0,0-1.36,1.46l-.42,2.89c-.1.67.31,1,.9.7a2.75,2.75,0,0,0,1.33-1.7L40,18A.73.73,0,0,0,39,17Z\" fill=\"#484f60\"/></svg>",
1347
1351
  "cart_open": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 51 51\"><circle cx=\"17.08\" cy=\"34.14\" r=\"1.8\" fill=\"#4d5050\"/><circle cx=\"31.99\" cy=\"34.14\" r=\"1.8\" fill=\"#4d5050\"/><path d=\"M672.39,388.55a1.73,1.73,0,0,0,1.56,1.17h17.69a1.51,1.51,0,0,0,1.43-1.2L695.6,376a.88.88,0,0,0-1-1.08l-24.68,2.93a1,1,0,0,0-.87,1.28Zm19-2.05a1.52,1.52,0,0,1-1.43,1.2h-14.4a1.75,1.75,0,0,1-1.57-1.16l-2.31-5.61a1,1,0,0,1,.86-1.28l19.71-2.51a.87.87,0,0,1,1,1.08Z\" transform=\"translate(-658.5 -359.5)\" fill=\"#4d5050\"/><path d=\"M698,374a1.88,1.88,0,0,0-1.37,1.46l-.42,2.9c-.1.66.31,1,.9.7a2.74,2.74,0,0,0,1.33-1.7L699,375A.74.74,0,0,0,698,374Z\" transform=\"translate(-658.5 -359.5)\" fill=\"#4d5050\"/></svg>",
1348
1352
  "case_manager": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M26.85,29H23.46a.89.89,0,0,0-.88.88v5.28L24,32.3c.08-.74.69-1.32,2.86-1.36H36v-1.1a.89.89,0,0,0-.88-.88H26.85Z\" fill=\"#484f60\" opacity=\"0.5\"/><path d=\"M35.38,38.29a.88.88,0,0,1-.88.88H23.76a.88.88,0,0,1-.88-.88l2.2-5.38A.88.88,0,0,1,26,32H36.7a.88.88,0,0,1,.88.88Z\" fill=\"#484f60\" opacity=\"0.75\"/><path d=\"M20.58,35.11V29.83A2.89,2.89,0,0,1,23.46,27h7.4l1.72-1.89a4.22,4.22,0,0,0-4-3.87h-.49c-1.11,1.57-3.41,3.44-5.56,3.44S18,22.76,16.94,21.19h-.49a4.21,4.21,0,0,0-4,3.87l2.68,3c0,1.77,1.81,8.15,4,8.15h1.44Z\" fill=\"#484f60\"/><path d=\"M28.68,16.31c0,2.71-2.77,5.77-6.18,5.77S16.31,19,16.31,16.31s2.77-5.14,6.19-5.14S28.68,13.59,28.68,16.31Z\" fill=\"#484f60\"/></svg>",
@@ -4533,7 +4537,7 @@ CoDialogWizardComponent.decorators = [
4533
4537
  <div class="dialog-header">
4534
4538
  <ng-content select="[header]"></ng-content>
4535
4539
  <div class="dialog-close-button" *ngIf="showCloseIcon" (click)="closeClick.emit($event)">
4536
- <co-icon [icon]="icons.Cancel"></co-icon>
4540
+ <co-icon [icon]="icons.CrossSkinny"></co-icon>
4537
4541
  </div>
4538
4542
  </div>
4539
4543
 
@@ -9321,7 +9325,8 @@ SimpleGridColumnDirective.propDecorators = {
9321
9325
  };
9322
9326
 
9323
9327
  class BaseSimpleGridComponent {
9324
- constructor() {
9328
+ constructor(changeDetection) {
9329
+ this.changeDetection = changeDetection;
9325
9330
  this.MIN_COLUMN_WIDTH = 50;
9326
9331
  this.dataChanged = new Subject();
9327
9332
  this.dragDropEnabled = false;
@@ -9337,6 +9342,7 @@ class BaseSimpleGridComponent {
9337
9342
  this.emitDragDrop = false;
9338
9343
  this.onDrop = new EventEmitter();
9339
9344
  this.selectRow = new EventEmitter();
9345
+ this.deselectRow = new EventEmitter();
9340
9346
  this.dblClickRow = new EventEmitter();
9341
9347
  this.saveRow = new EventEmitter();
9342
9348
  this.deleteRow = new EventEmitter();
@@ -9414,40 +9420,52 @@ class BaseSimpleGridComponent {
9414
9420
  return row.singleColumnIndex;
9415
9421
  }
9416
9422
  prepareDataRow(row, index) {
9423
+ return __awaiter(this, void 0, void 0, function* () {
9424
+ });
9417
9425
  }
9418
9426
  _setColumns(columns) {
9419
9427
  this.columns.push(...columns);
9420
9428
  this.columns.sort((a, b) => a.order < b.order ? -1 : 1);
9421
9429
  }
9422
9430
  _prepareData() {
9423
- if (this._prepared) {
9424
- return;
9425
- }
9426
- this.disabledRows.length = 0;
9427
- if (this.columns && this.columns.length > 0) {
9428
- this.headerColumns = this.columns.filter(c => !c.singleColumn);
9429
- this.headerColumnsCopy = this.headerColumns;
9430
- let singleColumnIndex = -1;
9431
- for (let i = 0; i < this.columns.length; i++) {
9432
- if (this.columns[i].singleColumn) {
9433
- singleColumnIndex = i;
9434
- break;
9435
- }
9431
+ return __awaiter(this, void 0, void 0, function* () {
9432
+ if (this._prepared) {
9433
+ return;
9436
9434
  }
9437
- // first check if there's single column data
9438
- if (singleColumnIndex > -1 && this.data && this.data.length > 0) {
9439
- const field = this.columns[singleColumnIndex].field;
9440
- for (let i = 0; i < this.data.length; i++) { // then mark row as single column row
9441
- if (this.data[i][field] !== undefined && this.data[i][field] !== null && this.data[i][field] !== "") {
9442
- // bit nasty to add prop, but cool for now
9443
- this.data[i].singleColumnIndex = singleColumnIndex;
9435
+ this.disabledRows.length = 0;
9436
+ if (this.columns && this.columns.length > 0) {
9437
+ this.headerColumns = this.columns.filter(c => !c.singleColumn);
9438
+ this.headerColumnsCopy = this.headerColumns;
9439
+ let singleColumnIndex = -1;
9440
+ for (let i = 0; i < this.columns.length; i++) {
9441
+ if (this.columns[i].singleColumn) {
9442
+ singleColumnIndex = i;
9443
+ break;
9444
+ }
9445
+ }
9446
+ // first check if there's single column data
9447
+ if (this.data && this.data.length > 0) {
9448
+ if (singleColumnIndex > -1) {
9449
+ const field = this.columns[singleColumnIndex].field;
9450
+ for (let i = 0; i < this.data.length; i++) { // then mark row as single column row
9451
+ if (this.data[i][field] !== undefined && this.data[i][field] !== null && this.data[i][field] !== "") {
9452
+ // bit nasty to add prop, but cool for now
9453
+ this.data[i].singleColumnIndex = singleColumnIndex;
9454
+ }
9455
+ yield this.prepareDataRow(this.data[i], i);
9456
+ }
9457
+ }
9458
+ else {
9459
+ for (let j = 0; j < this.data.length; j++) {
9460
+ yield this.prepareDataRow(this.data[j], j);
9461
+ }
9444
9462
  }
9445
- this.prepareDataRow(this.data[i], i);
9446
9463
  }
9464
+ this._prepared = true;
9447
9465
  }
9448
- this._prepared = true;
9449
- }
9450
- this._resizeColumnsToFit();
9466
+ this._resizeColumnsToFit();
9467
+ this.changeDetection.detectChanges();
9468
+ });
9451
9469
  }
9452
9470
  _resizeColumnsToFit() {
9453
9471
  const calculateColumns = this.columns.filter(c => !c.autoFit && !c.width);
@@ -9467,6 +9485,9 @@ class BaseSimpleGridComponent {
9467
9485
  BaseSimpleGridComponent.decorators = [
9468
9486
  { type: Directive }
9469
9487
  ];
9488
+ BaseSimpleGridComponent.ctorParameters = () => [
9489
+ { type: ChangeDetectorRef }
9490
+ ];
9470
9491
  BaseSimpleGridComponent.propDecorators = {
9471
9492
  content: [{ type: ContentChildren, args: [SimpleGridColumnDirective,] }],
9472
9493
  data: [{ type: Input }],
@@ -9481,6 +9502,7 @@ BaseSimpleGridComponent.propDecorators = {
9481
9502
  extraColumns: [{ type: Input }],
9482
9503
  onDrop: [{ type: Output }],
9483
9504
  selectRow: [{ type: Output }],
9505
+ deselectRow: [{ type: Output }],
9484
9506
  dblClickRow: [{ type: Output }],
9485
9507
  saveRow: [{ type: Output }],
9486
9508
  deleteRow: [{ type: Output }],
@@ -9491,14 +9513,15 @@ BaseSimpleGridComponent.propDecorators = {
9491
9513
  };
9492
9514
 
9493
9515
  class SimpleGridComponent extends BaseSimpleGridComponent {
9494
- constructor(icons, _changeDetection, _formMaster) {
9495
- super();
9516
+ constructor(icons, changeDetection, _formMaster) {
9517
+ super(changeDetection);
9496
9518
  this.icons = icons;
9497
- this._changeDetection = _changeDetection;
9519
+ this.changeDetection = changeDetection;
9498
9520
  this._formMaster = _formMaster;
9499
9521
  this.defaultTextAlign = ColumnAlign.Left;
9500
9522
  this.showAdd = false;
9501
9523
  this.showDelete = false;
9524
+ this.deselectAllowed = false;
9502
9525
  this.editOnCellClick = true;
9503
9526
  this.rightToolbar = false;
9504
9527
  this.showGridSettings = false;
@@ -9540,7 +9563,7 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
9540
9563
  this._nextAvailableCellToEdit(!event.shiftKey, this.editCellIndex)
9541
9564
  .then((index) => {
9542
9565
  this.editCellIndex = index;
9543
- this._changeDetection.markForCheck();
9566
+ this.changeDetection.markForCheck();
9544
9567
  });
9545
9568
  this._detectChanges();
9546
9569
  }
@@ -9683,6 +9706,12 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
9683
9706
  this.selectRow.next(this.data[absoluteIndex]);
9684
9707
  }
9685
9708
  }
9709
+ else if (this.selectedRowIndex === index && this.deselectAllowed && ((this.editing && this.validateAndSave()) || !this.editing)) {
9710
+ this.selectedRowIndex = -1;
9711
+ if (emit) {
9712
+ this.deselectRow.next();
9713
+ }
9714
+ }
9686
9715
  this._detectChanges();
9687
9716
  }
9688
9717
  handleDblClickRow(event, index, row) {
@@ -9881,7 +9910,9 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
9881
9910
  return hasSelectedTrue ? items.filter(item => item.selected === true) : items;
9882
9911
  }
9883
9912
  prepareDataRow(row, index) {
9884
- this.isRowDisabled(row, index);
9913
+ return __awaiter(this, void 0, void 0, function* () {
9914
+ yield this.isRowDisabled(row, index);
9915
+ });
9885
9916
  }
9886
9917
  _resetDblClick() {
9887
9918
  setTimeout(() => {
@@ -10018,7 +10049,7 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
10018
10049
  this._detectChanges();
10019
10050
  }
10020
10051
  _detectChanges() {
10021
- this._changeDetection.detectChanges();
10052
+ this.changeDetection.detectChanges();
10022
10053
  }
10023
10054
  _resetEdit() {
10024
10055
  this._newRow = false;
@@ -10219,6 +10250,7 @@ SimpleGridComponent.propDecorators = {
10219
10250
  rowElements: [{ type: ViewChildren, args: ['rowElement',] }],
10220
10251
  showAdd: [{ type: Input }],
10221
10252
  showDelete: [{ type: Input }],
10253
+ deselectAllowed: [{ type: Input }],
10222
10254
  editOnCellClick: [{ type: Input }],
10223
10255
  rightToolbar: [{ type: Input }],
10224
10256
  showGridSettings: [{ type: Input }],
@@ -11835,7 +11867,8 @@ ListOfIconsComponent.decorators = [
11835
11867
  template: `
11836
11868
  <div class="icon-item active" [class.menu-opened]="showMenu" (click)="toggleMenu()">
11837
11869
  <co-icon [iconData]="activeItem.icon" [style.width.px]="iconSize" [style.height.px]="iconSize"></co-icon>
11838
- <co-icon class="drop-arrow" [iconData]="icons.getIcon(Icon.ArrowPointDown)"></co-icon>
11870
+ <co-icon *ngIf="!showMenu" class="drop-arrow" [iconData]="icons.getIcon(Icon.CaretDownSolid)"></co-icon>
11871
+ <co-icon *ngIf="showMenu" class="drop-arrow" [iconData]="icons.getIcon(Icon.CaretUpSolid)"></co-icon>
11839
11872
  </div>
11840
11873
  <div class="dropdown-menu" *ngIf="showMenu" (clickOutside)="onClickOutside()">
11841
11874
  <div class="icon-item" *ngFor="let item of collection" (click)="selectItem(item)"