@theseam/ui-common 0.3.13-beta.1 → 0.3.15-beta.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.
@@ -459,7 +459,7 @@
459
459
  { type: i0.Component, args: [{
460
460
  selector: 'seam-datatable-action-menu',
461
461
  template: "<seam-menu #menu\n menuClass=\"list-group py-0 border-0 seam-datatable-action-menu\"\n animationType=\"fade\">\n\n <ng-container *ngFor=\"let item of items\">\n <ng-container *ngIf=\"(item.routerLink || item.href) && !item.confirmDialog; else noRouterLink\">\n <a *ngIf=\"item.href; else noHref\"\n seamMenuItem\n class=\"list-group-item list-group-item-action py-1\"\n [disabled]=\"item.disabled\"\n [attr.href]=\"item.href\"\n [target]=\"item.target\"\n (click)=\"activateItem($event, item)\">\n {{ item.label }}\n </a>\n <ng-template #noHref>\n <a seamMenuItem\n class=\"list-group-item list-group-item-action py-1\"\n [disabled]=\"item.disabled\"\n [queryParams]=\"item.queryParams\"\n [fragment]=\"$any(item.fragment)\"\n [queryParamsHandling]=\"item.queryParamsHandling\"\n [preserveFragment]=\"$any(item.preserveFragment)\"\n [skipLocationChange]=\"$any(item.skipLocationChange)\"\n [replaceUrl]=\"$any(item.replaceUrl)\"\n [state]=\"$any(item.state)\"\n [routerLink]=\"item.routerLink\"\n [target]=\"$any(item.target)\"\n (click)=\"activateItem($event, item)\">\n {{ item.label }}\n </a>\n </ng-template>\n </ng-container>\n <ng-template #noRouterLink>\n <button seamMenuItem\n type=\"button\"\n class=\"list-group-item list-group-item-action py-1\"\n [disabled]=\"item.disabled\"\n (click)=\"activateItem($event, item)\">\n {{ item.label }}\n </button>\n </ng-template>\n </ng-container>\n</seam-menu>\n\n<button type=\"button\" class=\"datatable-action-button btn\"\n [seamMenuToggle]=\"menu\"\n [positions]=\"_actionMenuPositions || []\"\n title=\"Row Actions\">\n <seam-icon [icon]=\"faEllipsisH\"></seam-icon>\n</button>\n",
462
- styles: [":host{display:block;position:relative}.datatable-action-button{font-size:20px;line-height:20px;width:30px;height:30px;padding:0;border-radius:15px;text-align:center}.datatable-action-button::ng-deep .svg-inline--fa{vertical-align:middle}\n"]
462
+ styles: [":host{position:relative;display:flex;align-items:center;justify-content:center;height:100%}.datatable-action-button::ng-deep .svg-inline--fa{vertical-align:middle}\n"]
463
463
  },] }
464
464
  ];
465
465
  DatatableActionMenuComponent.ctorParameters = function () { return [
@@ -853,7 +853,7 @@
853
853
  }(collections.DataSource));
854
854
 
855
855
  var ACTION_MENU_COLUMN_PROP = '$$__actionMenu__';
856
- function createActionMenuColumn(cellTemplate, headerTemplate) {
856
+ function createActionMenuColumn(cellTemplate, headerTemplate, frozenLeft, frozenRight) {
857
857
  return {
858
858
  prop: ACTION_MENU_COLUMN_PROP,
859
859
  name: '',
@@ -864,7 +864,8 @@
864
864
  sortable: false,
865
865
  draggable: false,
866
866
  // TODO: Fix column auto sizing with fixed column and cell overlay before enabling.
867
- // frozenRight: true,
867
+ frozenLeft: frozenLeft,
868
+ frozenRight: frozenRight,
868
869
  cellTemplate: cellTemplate,
869
870
  headerTemplate: headerTemplate,
870
871
  };
@@ -1003,6 +1004,13 @@
1003
1004
  this._updateColumns.next(undefined);
1004
1005
  }
1005
1006
  };
1007
+ ColumnsManagerService.prototype.setActionItemColumnPosition = function (actionItemColumnPosition) {
1008
+ var changed = this._actionItemColumnPosition !== actionItemColumnPosition;
1009
+ this._actionItemColumnPosition = actionItemColumnPosition;
1010
+ if (changed) {
1011
+ this._updateColumns.next(undefined);
1012
+ }
1013
+ };
1006
1014
  ColumnsManagerService.prototype.setActionMenuCellTpl = function (actionMenuCellTpl) {
1007
1015
  var changed = this._actionMenuCellTpl !== actionMenuCellTpl;
1008
1016
  this._actionMenuCellTpl = actionMenuCellTpl;
@@ -1087,7 +1095,13 @@
1087
1095
  finally { if (e_1) throw e_1.error; }
1088
1096
  }
1089
1097
  if (this._shouldAddRowActionColumn()) {
1090
- cols.push(createActionMenuColumn(this._actionMenuCellTpl, this._blankHeaderTpl));
1098
+ var actionMenuColumn = createActionMenuColumn(this._actionMenuCellTpl, this._blankHeaderTpl, this._rowActionColumnIsFrozenLeft(), this._rowActionColumnIsFrozenRight());
1099
+ if (this._rowActionColumnIsStaticLeft()) {
1100
+ cols.unshift(actionMenuColumn);
1101
+ }
1102
+ else {
1103
+ cols.push(actionMenuColumn);
1104
+ }
1091
1105
  }
1092
1106
  // Make sure the default for any missing props are set.
1093
1107
  // TODO: Determine if this should be done earlier, because I don't like
@@ -1184,6 +1198,18 @@
1184
1198
  ColumnsManagerService.prototype._shouldAddRowActionColumn = function () {
1185
1199
  return this._rowActionItem !== undefined;
1186
1200
  };
1201
+ ColumnsManagerService.prototype._rowActionColumnIsFrozenLeft = function () {
1202
+ return this._actionItemColumnPosition === 'frozenLeft';
1203
+ };
1204
+ ColumnsManagerService.prototype._rowActionColumnIsFrozenRight = function () {
1205
+ return this._actionItemColumnPosition === 'frozenRight';
1206
+ };
1207
+ ColumnsManagerService.prototype._rowActionColumnIsStaticLeft = function () {
1208
+ return this._actionItemColumnPosition === 'staticLeft';
1209
+ };
1210
+ ColumnsManagerService.prototype._rowActionColumnIsStaticRight = function () {
1211
+ return this._actionItemColumnPosition === 'staticRight';
1212
+ };
1187
1213
  ColumnsManagerService.prototype._shouldAddTreeToggleColumn = function (column) {
1188
1214
  return column.isTreeColumn !== undefined && column.isTreeColumn &&
1189
1215
  (!utils.hasProperty(column, 'treeToggleTemplate') || !utils.notNullOrUndefined(column.treeToggleTemplate));
@@ -1867,6 +1893,11 @@
1867
1893
  return alterations;
1868
1894
  }
1869
1895
 
1896
+ var ActionItemColumnPosition = ['frozenLeft', 'frozenRight', 'staticLeft', 'staticRight'];
1897
+ function isActionItemColumnPosition(input) {
1898
+ return ActionItemColumnPosition.indexOf(input) != -1;
1899
+ }
1900
+
1870
1901
  /**
1871
1902
  * Intended for internal classes declared by the `TheSeamDatatableModule`.
1872
1903
  */
@@ -1937,6 +1968,7 @@
1937
1968
  this.footerHeight = 40;
1938
1969
  this.scrollbarV = true;
1939
1970
  this.scrollbarH = true;
1971
+ this._actionItemColumnPosition = 'frozenRight';
1940
1972
  this.scroll = new i0.EventEmitter();
1941
1973
  this.activate = new i0.EventEmitter();
1942
1974
  this.select = new i0.EventEmitter();
@@ -2100,6 +2132,22 @@
2100
2132
  enumerable: false,
2101
2133
  configurable: true
2102
2134
  });
2135
+ Object.defineProperty(DatatableComponent.prototype, "actionItemColumnPosition", {
2136
+ /**
2137
+ * Sets position behavior for optional Action Menu Button column.
2138
+ *
2139
+ * Defaults to `frozenRight`.
2140
+ */
2141
+ get: function () { return this._actionItemColumnPosition; },
2142
+ set: function (value) {
2143
+ if (value && isActionItemColumnPosition(value)) {
2144
+ this._actionItemColumnPosition = value;
2145
+ }
2146
+ this._columnsManager.setActionItemColumnPosition(this._actionItemColumnPosition);
2147
+ },
2148
+ enumerable: false,
2149
+ configurable: true
2150
+ });
2103
2151
  Object.defineProperty(DatatableComponent.prototype, "columnComponents", {
2104
2152
  set: function (value) {
2105
2153
  var _a;
@@ -2400,6 +2448,7 @@
2400
2448
  scrollbarV: [{ type: i0.Input }],
2401
2449
  scrollbarH: [{ type: i0.Input }],
2402
2450
  dataSource: [{ type: i0.Input }],
2451
+ actionItemColumnPosition: [{ type: i0.Input }],
2403
2452
  scroll: [{ type: i0.Output }],
2404
2453
  activate: [{ type: i0.Output }],
2405
2454
  select: [{ type: i0.Output }],