@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.
@@ -1418,6 +1418,8 @@
1418
1418
  CoreComponentsIcon["Cancel"] = "cancel";
1419
1419
  CoreComponentsIcon["CancelRoundFilled"] = "cancel_round_filled";
1420
1420
  CoreComponentsIcon["CancelRoundOpen"] = "cancel_round_open";
1421
+ CoreComponentsIcon["CaretDownSolid"] = "caret_down_solid";
1422
+ CoreComponentsIcon["CaretUpSolid"] = "caret_up_solid";
1421
1423
  CoreComponentsIcon["Cart"] = "cart";
1422
1424
  CoreComponentsIcon["CartOpen"] = "cart_open";
1423
1425
  CoreComponentsIcon["CaseManager"] = "case_manager";
@@ -1722,6 +1724,8 @@
1722
1724
  "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>",
1723
1725
  "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>",
1724
1726
  "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>",
1727
+ "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>",
1728
+ "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>",
1725
1729
  "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>",
1726
1730
  "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>",
1727
1731
  "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>",
@@ -5071,7 +5075,7 @@
5071
5075
  CoDialogWizardComponent.decorators = [
5072
5076
  { type: i0.Component, args: [{
5073
5077
  selector: 'co-dialog-wizard',
5074
- template: "\n <div class=\"co-dialog-wizard-wrapper\" [@showHideDialog]=\"animation\">\n <div class=\"dialog-header\">\n <ng-content select=\"[header]\"></ng-content>\n <div class=\"dialog-close-button\" *ngIf=\"showCloseIcon\" (click)=\"closeClick.emit($event)\">\n <co-icon [icon]=\"icons.Cancel\"></co-icon>\n </div>\n </div>\n\n <hr class=\"co-dialog-wizard-divider\">\n\n <div class=\"dialog-content\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
5078
+ template: "\n <div class=\"co-dialog-wizard-wrapper\" [@showHideDialog]=\"animation\">\n <div class=\"dialog-header\">\n <ng-content select=\"[header]\"></ng-content>\n <div class=\"dialog-close-button\" *ngIf=\"showCloseIcon\" (click)=\"closeClick.emit($event)\">\n <co-icon [icon]=\"icons.CrossSkinny\"></co-icon>\n </div>\n </div>\n\n <hr class=\"co-dialog-wizard-divider\">\n\n <div class=\"dialog-content\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
5075
5079
  animations: [
5076
5080
  animations.trigger('showHideDialog', [
5077
5081
  animations.state('*', animations.style({ opacity: 1 })),
@@ -9875,7 +9879,8 @@
9875
9879
  };
9876
9880
 
9877
9881
  var BaseSimpleGridComponent = /** @class */ (function () {
9878
- function BaseSimpleGridComponent() {
9882
+ function BaseSimpleGridComponent(changeDetection) {
9883
+ this.changeDetection = changeDetection;
9879
9884
  this.MIN_COLUMN_WIDTH = 50;
9880
9885
  this.dataChanged = new rxjs.Subject();
9881
9886
  this.dragDropEnabled = false;
@@ -9891,6 +9896,7 @@
9891
9896
  this.emitDragDrop = false;
9892
9897
  this.onDrop = new i0.EventEmitter();
9893
9898
  this.selectRow = new i0.EventEmitter();
9899
+ this.deselectRow = new i0.EventEmitter();
9894
9900
  this.dblClickRow = new i0.EventEmitter();
9895
9901
  this.saveRow = new i0.EventEmitter();
9896
9902
  this.deleteRow = new i0.EventEmitter();
@@ -9984,6 +9990,11 @@
9984
9990
  return row.singleColumnIndex;
9985
9991
  };
9986
9992
  BaseSimpleGridComponent.prototype.prepareDataRow = function (row, index) {
9993
+ return __awaiter(this, void 0, void 0, function () {
9994
+ return __generator(this, function (_a) {
9995
+ return [2 /*return*/];
9996
+ });
9997
+ });
9987
9998
  };
9988
9999
  BaseSimpleGridComponent.prototype._setColumns = function (columns) {
9989
10000
  var _a;
@@ -9991,34 +10002,66 @@
9991
10002
  this.columns.sort(function (a, b) { return a.order < b.order ? -1 : 1; });
9992
10003
  };
9993
10004
  BaseSimpleGridComponent.prototype._prepareData = function () {
9994
- if (this._prepared) {
9995
- return;
9996
- }
9997
- this.disabledRows.length = 0;
9998
- if (this.columns && this.columns.length > 0) {
9999
- this.headerColumns = this.columns.filter(function (c) { return !c.singleColumn; });
10000
- this.headerColumnsCopy = this.headerColumns;
10001
- var singleColumnIndex = -1;
10002
- for (var i = 0; i < this.columns.length; i++) {
10003
- if (this.columns[i].singleColumn) {
10004
- singleColumnIndex = i;
10005
- break;
10006
- }
10007
- }
10008
- // first check if there's single column data
10009
- if (singleColumnIndex > -1 && this.data && this.data.length > 0) {
10010
- var field = this.columns[singleColumnIndex].field;
10011
- for (var i = 0; i < this.data.length; i++) { // then mark row as single column row
10012
- if (this.data[i][field] !== undefined && this.data[i][field] !== null && this.data[i][field] !== "") {
10013
- // bit nasty to add prop, but cool for now
10014
- this.data[i].singleColumnIndex = singleColumnIndex;
10015
- }
10016
- this.prepareDataRow(this.data[i], i);
10005
+ return __awaiter(this, void 0, void 0, function () {
10006
+ var singleColumnIndex, i, field, i, j;
10007
+ return __generator(this, function (_a) {
10008
+ switch (_a.label) {
10009
+ case 0:
10010
+ if (this._prepared) {
10011
+ return [2 /*return*/];
10012
+ }
10013
+ this.disabledRows.length = 0;
10014
+ if (!(this.columns && this.columns.length > 0)) return [3 /*break*/, 10];
10015
+ this.headerColumns = this.columns.filter(function (c) { return !c.singleColumn; });
10016
+ this.headerColumnsCopy = this.headerColumns;
10017
+ singleColumnIndex = -1;
10018
+ for (i = 0; i < this.columns.length; i++) {
10019
+ if (this.columns[i].singleColumn) {
10020
+ singleColumnIndex = i;
10021
+ break;
10022
+ }
10023
+ }
10024
+ if (!(this.data && this.data.length > 0)) return [3 /*break*/, 9];
10025
+ if (!(singleColumnIndex > -1)) return [3 /*break*/, 5];
10026
+ field = this.columns[singleColumnIndex].field;
10027
+ i = 0;
10028
+ _a.label = 1;
10029
+ case 1:
10030
+ if (!(i < this.data.length)) return [3 /*break*/, 4];
10031
+ if (this.data[i][field] !== undefined && this.data[i][field] !== null && this.data[i][field] !== "") {
10032
+ // bit nasty to add prop, but cool for now
10033
+ this.data[i].singleColumnIndex = singleColumnIndex;
10034
+ }
10035
+ return [4 /*yield*/, this.prepareDataRow(this.data[i], i)];
10036
+ case 2:
10037
+ _a.sent();
10038
+ _a.label = 3;
10039
+ case 3:
10040
+ i++;
10041
+ return [3 /*break*/, 1];
10042
+ case 4: return [3 /*break*/, 9];
10043
+ case 5:
10044
+ j = 0;
10045
+ _a.label = 6;
10046
+ case 6:
10047
+ if (!(j < this.data.length)) return [3 /*break*/, 9];
10048
+ return [4 /*yield*/, this.prepareDataRow(this.data[j], j)];
10049
+ case 7:
10050
+ _a.sent();
10051
+ _a.label = 8;
10052
+ case 8:
10053
+ j++;
10054
+ return [3 /*break*/, 6];
10055
+ case 9:
10056
+ this._prepared = true;
10057
+ _a.label = 10;
10058
+ case 10:
10059
+ this._resizeColumnsToFit();
10060
+ this.changeDetection.detectChanges();
10061
+ return [2 /*return*/];
10017
10062
  }
10018
- }
10019
- this._prepared = true;
10020
- }
10021
- this._resizeColumnsToFit();
10063
+ });
10064
+ });
10022
10065
  };
10023
10066
  BaseSimpleGridComponent.prototype._resizeColumnsToFit = function () {
10024
10067
  var calculateColumns = this.columns.filter(function (c) { return !c.autoFit && !c.width; });
@@ -10039,6 +10082,9 @@
10039
10082
  BaseSimpleGridComponent.decorators = [
10040
10083
  { type: i0.Directive }
10041
10084
  ];
10085
+ BaseSimpleGridComponent.ctorParameters = function () { return [
10086
+ { type: i0.ChangeDetectorRef }
10087
+ ]; };
10042
10088
  BaseSimpleGridComponent.propDecorators = {
10043
10089
  content: [{ type: i0.ContentChildren, args: [SimpleGridColumnDirective,] }],
10044
10090
  data: [{ type: i0.Input }],
@@ -10053,6 +10099,7 @@
10053
10099
  extraColumns: [{ type: i0.Input }],
10054
10100
  onDrop: [{ type: i0.Output }],
10055
10101
  selectRow: [{ type: i0.Output }],
10102
+ deselectRow: [{ type: i0.Output }],
10056
10103
  dblClickRow: [{ type: i0.Output }],
10057
10104
  saveRow: [{ type: i0.Output }],
10058
10105
  deleteRow: [{ type: i0.Output }],
@@ -10064,14 +10111,15 @@
10064
10111
 
10065
10112
  var SimpleGridComponent = /** @class */ (function (_super) {
10066
10113
  __extends(SimpleGridComponent, _super);
10067
- function SimpleGridComponent(icons, _changeDetection, _formMaster) {
10068
- var _this = _super.call(this) || this;
10114
+ function SimpleGridComponent(icons, changeDetection, _formMaster) {
10115
+ var _this = _super.call(this, changeDetection) || this;
10069
10116
  _this.icons = icons;
10070
- _this._changeDetection = _changeDetection;
10117
+ _this.changeDetection = changeDetection;
10071
10118
  _this._formMaster = _formMaster;
10072
10119
  _this.defaultTextAlign = exports.ColumnAlign.Left;
10073
10120
  _this.showAdd = false;
10074
10121
  _this.showDelete = false;
10122
+ _this.deselectAllowed = false;
10075
10123
  _this.editOnCellClick = true;
10076
10124
  _this.rightToolbar = false;
10077
10125
  _this.showGridSettings = false;
@@ -10119,7 +10167,7 @@
10119
10167
  this._nextAvailableCellToEdit(!event.shiftKey, this.editCellIndex)
10120
10168
  .then(function (index) {
10121
10169
  _this.editCellIndex = index;
10122
- _this._changeDetection.markForCheck();
10170
+ _this.changeDetection.markForCheck();
10123
10171
  });
10124
10172
  this._detectChanges();
10125
10173
  }
@@ -10285,6 +10333,12 @@
10285
10333
  this.selectRow.next(this.data[absoluteIndex]);
10286
10334
  }
10287
10335
  }
10336
+ else if (this.selectedRowIndex === index && this.deselectAllowed && ((this.editing && this.validateAndSave()) || !this.editing)) {
10337
+ this.selectedRowIndex = -1;
10338
+ if (emit) {
10339
+ this.deselectRow.next();
10340
+ }
10341
+ }
10288
10342
  this._detectChanges();
10289
10343
  };
10290
10344
  SimpleGridComponent.prototype.handleDblClickRow = function (event, index, row) {
@@ -10519,7 +10573,16 @@
10519
10573
  return hasSelectedTrue ? items.filter(function (item) { return item.selected === true; }) : items;
10520
10574
  };
10521
10575
  SimpleGridComponent.prototype.prepareDataRow = function (row, index) {
10522
- this.isRowDisabled(row, index);
10576
+ return __awaiter(this, void 0, void 0, function () {
10577
+ return __generator(this, function (_c) {
10578
+ switch (_c.label) {
10579
+ case 0: return [4 /*yield*/, this.isRowDisabled(row, index)];
10580
+ case 1:
10581
+ _c.sent();
10582
+ return [2 /*return*/];
10583
+ }
10584
+ });
10585
+ });
10523
10586
  };
10524
10587
  SimpleGridComponent.prototype._resetDblClick = function () {
10525
10588
  var _this = this;
@@ -10662,7 +10725,7 @@
10662
10725
  this._detectChanges();
10663
10726
  };
10664
10727
  SimpleGridComponent.prototype._detectChanges = function () {
10665
- this._changeDetection.detectChanges();
10728
+ this.changeDetection.detectChanges();
10666
10729
  };
10667
10730
  SimpleGridComponent.prototype._resetEdit = function () {
10668
10731
  this._newRow = false;
@@ -10693,6 +10756,7 @@
10693
10756
  rowElements: [{ type: i0.ViewChildren, args: ['rowElement',] }],
10694
10757
  showAdd: [{ type: i0.Input }],
10695
10758
  showDelete: [{ type: i0.Input }],
10759
+ deselectAllowed: [{ type: i0.Input }],
10696
10760
  editOnCellClick: [{ type: i0.Input }],
10697
10761
  rightToolbar: [{ type: i0.Input }],
10698
10762
  showGridSettings: [{ type: i0.Input }],
@@ -12256,7 +12320,7 @@
12256
12320
  ListOfIconsComponent.decorators = [
12257
12321
  { type: i0.Component, args: [{
12258
12322
  selector: 'co-list-of-icons',
12259
- template: "\n <div class=\"icon-item active\" [class.menu-opened]=\"showMenu\" (click)=\"toggleMenu()\">\n <co-icon [iconData]=\"activeItem.icon\" [style.width.px]=\"iconSize\" [style.height.px]=\"iconSize\"></co-icon>\n <co-icon class=\"drop-arrow\" [iconData]=\"icons.getIcon(Icon.ArrowPointDown)\"></co-icon>\n </div>\n <div class=\"dropdown-menu\" *ngIf=\"showMenu\" (clickOutside)=\"onClickOutside()\">\n <div class=\"icon-item\" *ngFor=\"let item of collection\" (click)=\"selectItem(item)\"\n [class.active]=\"item === activeItem\">\n <co-icon [iconData]=\"item.icon\" [style.width.px]=\"iconSize\" [style.height.px]=\"iconSize\"></co-icon>\n <div class=\"label\">{{ item.label }}</div>\n </div>\n <div class=\"picking-type-wrapper\" *ngIf=\"showSubCategories\">\n <div class=\"button-wrapper\" *ngFor=\"let subCategory of subCategories\" (click)=\"handlePickingCategoryClicked(subCategory)\">\n <co-icon class=\"co-transaction-button-bar-icon\" [iconData]=\"subCategory.icon\"></co-icon>\n <span class=\"button-title\">{{subCategory.label}}</span>\n </div>\n </div>\n </div>\n ",
12323
+ template: "\n <div class=\"icon-item active\" [class.menu-opened]=\"showMenu\" (click)=\"toggleMenu()\">\n <co-icon [iconData]=\"activeItem.icon\" [style.width.px]=\"iconSize\" [style.height.px]=\"iconSize\"></co-icon>\n <co-icon *ngIf=\"!showMenu\" class=\"drop-arrow\" [iconData]=\"icons.getIcon(Icon.CaretDownSolid)\"></co-icon>\n <co-icon *ngIf=\"showMenu\" class=\"drop-arrow\" [iconData]=\"icons.getIcon(Icon.CaretUpSolid)\"></co-icon>\n </div>\n <div class=\"dropdown-menu\" *ngIf=\"showMenu\" (clickOutside)=\"onClickOutside()\">\n <div class=\"icon-item\" *ngFor=\"let item of collection\" (click)=\"selectItem(item)\"\n [class.active]=\"item === activeItem\">\n <co-icon [iconData]=\"item.icon\" [style.width.px]=\"iconSize\" [style.height.px]=\"iconSize\"></co-icon>\n <div class=\"label\">{{ item.label }}</div>\n </div>\n <div class=\"picking-type-wrapper\" *ngIf=\"showSubCategories\">\n <div class=\"button-wrapper\" *ngFor=\"let subCategory of subCategories\" (click)=\"handlePickingCategoryClicked(subCategory)\">\n <co-icon class=\"co-transaction-button-bar-icon\" [iconData]=\"subCategory.icon\"></co-icon>\n <span class=\"button-title\">{{subCategory.label}}</span>\n </div>\n </div>\n </div>\n ",
12260
12324
  encapsulation: i0.ViewEncapsulation.None
12261
12325
  },] }
12262
12326
  ];