@energycap/components 0.30.1 → 0.30.2

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.
@@ -7329,6 +7329,14 @@
7329
7329
  * without replacing the actual FormArray that the hosting component may be subscribed to for changes
7330
7330
  */
7331
7331
  this.rowAddedOrRemoved = new rxjs.Subject();
7332
+ /**
7333
+ * Set to true to disable Shift-Click/Ctrl-Click functionality
7334
+ */
7335
+ this.disableAdvancedRowClickBehavior = false;
7336
+ /**
7337
+ * Set to list of indices of controls that should not toggle when master/header checkbox toggles
7338
+ */
7339
+ this.nonDependentCheckboxes = [];
7332
7340
  }
7333
7341
  return TableSelectableRowContext;
7334
7342
  }());
@@ -7336,7 +7344,7 @@
7336
7344
  function TableSelectableRowComponent() {
7337
7345
  /**The ID root to use for the checkbox and table cell */
7338
7346
  this.id = '';
7339
- this._enabled = true;
7347
+ this._selectionEnabled = true;
7340
7348
  /*Required for all rows. The row index this component represents, to allow it to know how to handle shift+clicks.
7341
7349
  Defaults to -1 which will cause the directive to behave as a header row*/
7342
7350
  this.rowIndex = -1;
@@ -7344,10 +7352,17 @@
7344
7352
  * if the checkbox is not the first column in the table
7345
7353
  */
7346
7354
  this.lockedColOptions = { border: false, left: 0 };
7347
- /**Automatically set to true based on checkbox state, used to highlight the row to match our table selected row styles */
7355
+ /** Automatically set to true based on checkbox state, used to highlight the row to match our table selected row styles */
7348
7356
  this.isSelected = false;
7349
- /**automatically set to true if no rowIndex is provided or the row index is less than zero */
7357
+ /** Automatically set to true if no rowIndex is provided or the row index is less than zero */
7350
7358
  this.isHeader = false;
7359
+ /**
7360
+ * Set to true if you want the checkbox to be disabled.
7361
+ *
7362
+ * When you use this property, make sure you set `disableAdvancedRowClickBehavior: true`
7363
+ * in the `TableSelectableRowContext`, or undesired side-effects will occur.
7364
+ */
7365
+ this.isCheckboxDisabled = false;
7351
7366
  /* A reference that we can change when a control is replaced to force the master checkbox reference to update
7352
7367
  without also replacing the form array that the host component may be watching for selected row changes */
7353
7368
  this.dependentCheckboxesReference = { controls: [] };
@@ -7355,18 +7370,18 @@
7355
7370
  /**Sends an event when the component is destroyed so that it can unsubscribe from any observables */
7356
7371
  this.destroyed = new rxjs.Subject();
7357
7372
  }
7358
- Object.defineProperty(TableSelectableRowComponent.prototype, "enabled", {
7359
- get: function () { return this._enabled; },
7373
+ Object.defineProperty(TableSelectableRowComponent.prototype, "isSelectionEnabled", {
7374
+ get: function () { return this._selectionEnabled; },
7360
7375
  /** Disables the selection functionality when false */
7361
- set: function (value) { this._enabled = value !== false; },
7376
+ set: function (value) { this._selectionEnabled = value !== false; },
7362
7377
  enumerable: false,
7363
7378
  configurable: true
7364
7379
  });
7365
7380
  /**Validate and populate the context as the table is dynamically built. Because the context is shared between the
7366
- * header and each of the rows, changes to it can be used to determine what is happening and hook up the correct
7367
- * subscriptions for selectAll. The user can provide an existing formArray for the rows and form control for the header,
7368
- * or it can just be the default empty ones created by the context class.
7369
- */
7381
+ * header and each of the rows, changes to it can be used to determine what is happening and hook up the correct
7382
+ * subscriptions for selectAll. The user can provide an existing formArray for the rows and form control for the header,
7383
+ * or it can just be the default empty ones created by the context class.
7384
+ */
7370
7385
  TableSelectableRowComponent.prototype.ngOnInit = function () {
7371
7386
  var _a, _b, _c;
7372
7387
  this.isHeader = this.rowIndex < 0;
@@ -7392,7 +7407,7 @@
7392
7407
  this.formControl = this.context.rowCheckboxes.at(this.rowIndex);
7393
7408
  this.checkboxAttributeID = this.id + "_row" + this.rowIndex + "_ecCheckbox";
7394
7409
  }
7395
- if (changes.enabled && !this.enabled && ((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value) === true) {
7410
+ if (changes.isSelectionEnabled && !this.isSelectionEnabled && ((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value) === true) {
7396
7411
  this.formControl.setValue(false);
7397
7412
  }
7398
7413
  if (changes.isSelected && this.formControl) {
@@ -7416,19 +7431,13 @@
7416
7431
  * Handle shift and control select as well as checkbox click like windows explorer or the original bill lists do.
7417
7432
  */
7418
7433
  TableSelectableRowComponent.prototype.rowClicked = function (event) {
7419
- var _a, _b, _c;
7420
- if (!this.isHeader && this.enabled) {
7434
+ if (!this.isHeader && this.isSelectionEnabled && !this.isCheckboxDisabled) {
7421
7435
  var targetEl = event === null || event === void 0 ? void 0 : event.target;
7422
- var isCheckboxClick = (_c = (_b = (_a = targetEl === null || targetEl === void 0 ? void 0 : targetEl.classList) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === null || _c === void 0 ? void 0 : _c.includes('row-checkbox');
7423
- //normally clicking on a row checks only that row and unchecks everything else.
7424
- //If the user wants to instead add that row to the current selection, they can either hold the control key or
7425
- //use the row checkbox.
7426
- if (!event.ctrlKey && !isCheckboxClick) {
7427
- this.clearAllRows();
7428
- }
7429
7436
  //clicking on a row always toggles that row. Sometimes the shift-select will toggle it back
7430
7437
  this.formControl.setValue(!this.formControl.value);
7431
- this.handleShiftSelect(event);
7438
+ if (!this.context.disableAdvancedRowClickBehavior) {
7439
+ this.handleShiftSelect(event);
7440
+ }
7432
7441
  }
7433
7442
  };
7434
7443
  TableSelectableRowComponent.prototype.watchForChanges = function () {
@@ -7439,13 +7448,20 @@
7439
7448
  if (this.isHeader) {
7440
7449
  this.context.rowAddedOrRemoved.pipe(operators.debounceTime(10), operators.takeUntil(this.destroyed)).subscribe(function () {
7441
7450
  _this.context.lastClickedIndex = -1;
7442
- _this.dependentCheckboxesReference = { controls: _this.context.rowCheckboxes.controls };
7451
+ // exclude nonDependentCheckboxes (some may not be allowed to be deselected)
7452
+ var dependentCheckboxes = [];
7453
+ _this.context.rowCheckboxes.controls.forEach(function (control, index) {
7454
+ if (!_this.context.nonDependentCheckboxes.includes(index)) {
7455
+ dependentCheckboxes.push(control);
7456
+ }
7457
+ });
7458
+ _this.dependentCheckboxesReference = { controls: dependentCheckboxes };
7443
7459
  });
7444
7460
  }
7445
7461
  else {
7446
7462
  this.context.rowAddedOrRemoved.next();
7447
7463
  //watch for the checkbox state to change on a child row and set the row isSelected class / highlight to match
7448
- //this way the rows match even if external code updates the form model
7464
+ //this way the rows match even if external code updates the form model
7449
7465
  (_a = this.formControl) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(operators.takeUntil(this.destroyed)).subscribe(function (value) {
7450
7466
  _this.isSelected = value;
7451
7467
  });
@@ -7493,18 +7509,19 @@
7493
7509
  TableSelectableRowComponent.decorators = [
7494
7510
  { type: i0.Component, args: [{
7495
7511
  selector: '[ecTableSelectableRow]',
7496
- template: "<!-- any elements of the existing table row that must go before the row selection checkbox can be marked with a class of before-checkbox -->\r\n<ng-content select=\".before-checkbox\"></ng-content>\r\n<ng-container *ngIf=\"enabled\">\r\n <th *ngIf=\"isHeader\"\r\n class=\"checkbox\"\r\n [ecTableLockedColumn]=\"lockedColOptions\">\r\n <ec-checkbox id=\"{{id}}_selectAll\"\r\n class=\"m-0\"\r\n *ngIf=\"context?.selectAllCheckbox\"\r\n [formModel]=\"context?.selectAllCheckbox\"\r\n [dependentCheckboxesGroup]=\"dependentCheckboxesReference\">\r\n </ec-checkbox>\r\n </th>\r\n <td *ngIf=\"!isHeader && formControl\"\r\n class=\"checkbox\"\r\n [ecTableLockedColumn]=\"lockedColOptions\">\r\n <ec-checkbox id=\"{{id}}_row{{rowIndex}}_checkbox\"\r\n [attr.id]=\"checkboxAttributeID\"\r\n class=\"m-0 row-checkbox\"\r\n [formModel]=\"formControl\">\r\n </ec-checkbox>\r\n </td>\r\n</ng-container>\r\n<!-- The rest of the table row -->\r\n<ng-content></ng-content>",
7512
+ template: "<!-- any elements of the existing table row that must go before the row selection checkbox can be marked with a class of before-checkbox -->\r\n<ng-content select=\".before-checkbox\"></ng-content>\r\n<ng-container *ngIf=\"isSelectionEnabled\">\r\n <th *ngIf=\"isHeader\"\r\n class=\"checkbox\"\r\n [ecTableLockedColumn]=\"lockedColOptions\">\r\n <ec-checkbox id=\"{{id}}_selectAll\"\r\n class=\"m-0\"\r\n *ngIf=\"context?.selectAllCheckbox\"\r\n [formModel]=\"context?.selectAllCheckbox\"\r\n [dependentCheckboxesGroup]=\"dependentCheckboxesReference\"\r\n [ignoreDisabledDependents]=\"false\">\r\n </ec-checkbox>\r\n </th>\r\n <td *ngIf=\"!isHeader && formControl\"\r\n class=\"checkbox\"\r\n [ecTableLockedColumn]=\"lockedColOptions\">\r\n <!-- Use [readonly] and not [disabled] for isCheckboxDisabled to prevent user interaction\r\n and allow the value to be visible to other components (for example, when they subscribe\r\n to valueChanges on the FormArray that contains all the checkbox FormControls). -->\r\n <ec-checkbox id=\"{{id}}_row{{rowIndex}}_checkbox\"\r\n [readonly]=\"isCheckboxDisabled\"\r\n [attr.id]=\"checkboxAttributeID\"\r\n class=\"m-0 row-checkbox\"\r\n [formModel]=\"formControl\">\r\n </ec-checkbox>\r\n </td>\r\n</ng-container>\r\n<!-- The rest of the table row -->\r\n<ng-content></ng-content>",
7497
7513
  styles: [":host.is-enabled:not(.is-header){cursor:pointer}:host .checkbox{padding-left:1px;padding-right:1px;width:1.125rem}:host .checkbox:first-child{padding-left:.5rem;width:1.5625rem}:host.border-bottom-0 .checkbox{border-bottom:0}td.checkbox ec-checkbox ::ng-deep *{pointer-events:none}th.checkbox{vertical-align:var(--ec-table-selectable-row-vertical-align-checkbox-th,middle)}td.checkbox{vertical-align:var(--ec-table-selectable-row-vertical-align-checkbox-td,top)}"]
7498
7514
  },] }
7499
7515
  ];
7500
7516
  TableSelectableRowComponent.propDecorators = {
7501
7517
  id: [{ type: i0.HostBinding, args: ['attr.id',] }, { type: i0.Input }],
7502
- enabled: [{ type: i0.HostBinding, args: ['class.is-enabled',] }, { type: i0.Input, args: ['ecTableSelectableRow',] }],
7518
+ isSelectionEnabled: [{ type: i0.HostBinding, args: ['class.is-enabled',] }, { type: i0.Input, args: ['ecTableSelectableRow',] }],
7503
7519
  context: [{ type: i0.Input, args: ['selectionContext',] }],
7504
7520
  rowIndex: [{ type: i0.Input }],
7505
7521
  lockedColOptions: [{ type: i0.Input }],
7506
7522
  isSelected: [{ type: i0.HostBinding, args: ['class.is-selected',] }, { type: i0.Input }],
7507
7523
  isHeader: [{ type: i0.HostBinding, args: ['class.is-header',] }],
7524
+ isCheckboxDisabled: [{ type: i0.Input }],
7508
7525
  rowClicked: [{ type: i0.HostListener, args: ['click', ['$event'],] }]
7509
7526
  };
7510
7527
 
@@ -8842,6 +8859,10 @@
8842
8859
  * the available/selected lists
8843
8860
  */
8844
8861
  _this.selectedItemsMapChanged = new rxjs.Subject();
8862
+ /**
8863
+ * AdvancedRowClickBehavior is disabled for ItemPicker.
8864
+ */
8865
+ _this.disableAdvancedRowClickBehavior = true;
8845
8866
  return _this;
8846
8867
  }
8847
8868
  return ItemPickerSelectableContext;
@@ -8868,6 +8889,8 @@
8868
8889
  * update this gets set to the values
8869
8890
  */
8870
8891
  this.selectedItems = [];
8892
+ /** True if there are selected items and at least one can be removed */
8893
+ this.selectedItemsClearable = false;
8871
8894
  /** Track by used for the searchable table rows */
8872
8895
  this.trackByIndex = function (index) { return index; };
8873
8896
  this.tableStatus = new Overlay('pending');
@@ -8889,27 +8912,57 @@
8889
8912
  this.destroyed.unsubscribe();
8890
8913
  };
8891
8914
  /**
8892
- * Called by the searchable table when a new set of items are returned from the getItems call
8893
- * @param results
8915
+ * Called by the searchable table when a new set of items are returned from the getItems call.
8916
+ * If any of the items have `preventRemove` set, their indices are added to the context.
8894
8917
  */
8895
8918
  ItemPickerComponent.prototype.onItemsChange = function (results) {
8896
8919
  var _this = this;
8897
- // Check to see if any of the items are marked to be selected by default and if so
8898
- // add them to the map.
8899
- results.items.forEach(function (item) {
8920
+ var newNonDependentCheckboxes = [];
8921
+ results.items.forEach(function (item, index) {
8900
8922
  var _a, _b;
8923
+ // Check to see if any of the items are marked to be selected by default and if so
8924
+ // add them to the map.
8901
8925
  if (item.defaultSelected && !((_a = _this.selectionContext) === null || _a === void 0 ? void 0 : _a.selectedItemsMap.has(item.id))) {
8902
8926
  (_b = _this.selectionContext) === null || _b === void 0 ? void 0 : _b.selectedItemsMap.set(item.id, item);
8903
8927
  }
8928
+ // Check to see if any of the items are marked to prevent Removal, and if so
8929
+ // add them to the non-dependent checkboxes array. This will prevent the master
8930
+ // checkbox from toggling them.
8931
+ if (item.preventRemove) {
8932
+ newNonDependentCheckboxes.push(index);
8933
+ }
8904
8934
  });
8935
+ this.selectionContext.nonDependentCheckboxes = newNonDependentCheckboxes;
8905
8936
  this.availableItems = results.items;
8906
8937
  };
8907
8938
  /**
8908
8939
  * Called when the clear selection link button is clicked
8909
8940
  */
8910
8941
  ItemPickerComponent.prototype.onClearSelectionClick = function () {
8911
- this.selectionContext.selectedItemsMap = new Map();
8912
- this.selectionContext.rowCheckboxes.controls.forEach(function (control) { return control.setValue(false); });
8942
+ var e_1, _e;
8943
+ var _this = this;
8944
+ try {
8945
+ // Remove removable items from map
8946
+ // This is safe. See https://stackoverflow.com/questions/35940216/es6-is-it-dangerous-to-delete-elements-from-set-map-during-set-map-iteration
8947
+ for (var _f = __values(this.selectionContext.selectedItemsMap), _g = _f.next(); !_g.done; _g = _f.next()) {
8948
+ var _h = __read(_g.value, 2), key = _h[0], val = _h[1];
8949
+ if (!val.preventRemove) {
8950
+ this.selectionContext.selectedItemsMap.delete(key);
8951
+ }
8952
+ }
8953
+ }
8954
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
8955
+ finally {
8956
+ try {
8957
+ if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
8958
+ }
8959
+ finally { if (e_1) throw e_1.error; }
8960
+ }
8961
+ this.selectionContext.rowCheckboxes.controls.forEach(function (control, index) {
8962
+ if (!_this.availableItems[index].preventRemove) {
8963
+ control.setValue(false);
8964
+ }
8965
+ });
8913
8966
  this.selectedItems = Array.from(this.selectionContext.selectedItemsMap.values());
8914
8967
  };
8915
8968
  /**
@@ -8953,6 +9006,7 @@
8953
9006
  }
8954
9007
  });
8955
9008
  _this.selectedItems = Array.from((_a = _this.selectionContext) === null || _a === void 0 ? void 0 : _a.selectedItemsMap.values());
9009
+ _this.selectedItemsClearable = _this.selectedItems.length > 0 && _this.selectedItems.some(function (i) { return !i.preventRemove; });
8956
9010
  });
8957
9011
  };
8958
9012
  /**
@@ -8998,7 +9052,7 @@
8998
9052
  ItemPickerComponent.decorators = [
8999
9053
  { type: i0.Component, args: [{
9000
9054
  selector: 'ec-item-picker',
9001
- template: "<div ecOverlay\r\n class=\"d-flex flex-grow card\"\r\n [status]=\"tableStatus?.status\"\r\n [message]=\"tableStatus?.message\"\r\n [displayAsMask]=\"true\">\r\n <ec-searchable-table id=\"{{id}}_searchableTable\"\r\n class=\"flex-grow\"\r\n [fillParentHeight]=\"true\"\r\n [hideHeader]=\"true\"\r\n [hideSearchControl]=\"true\"\r\n [removeCard]=\"true\"\r\n [pageable]=\"true\"\r\n [pageSize]=\"50\"\r\n [objectType]=\"itemName\"\r\n [formModel]=\"formModel\"\r\n [ready]=\"ready\"\r\n [getItems]=\"getItems\"\r\n [selectable]=\"true\"\r\n [noDataMessage]=\"noDataMessage\"\r\n [selectionContext]=\"selectionContext\"\r\n [status]=\"tableStatus\"\r\n (itemsChange)=\"onItemsChange($event)\"\r\n [style.--ec-searchable-table-flex-properties]=\"(availableItems.length || tableStatus.status === 'pending' || tableStatus.status === 'error' ) ? '1 1 auto' : '0 1 auto'\"\r\n [style.--ec-searchable-table-height-caption-footer]=\"'calc(2.5rem + 1px)'\"\r\n [tableLayoutFixed]=\"true\">\r\n <header *ngIf=\"customAvailableHeaderTemplate\"\r\n class=\"card-header flex-shrink\"\r\n style=\"height: 3rem;\">\r\n <h3 class=\"card-title\">{{availableTitle | translate}}</h3>\r\n </header>\r\n <thead>\r\n <tr ecTableSelectableRow\r\n [selectionContext]=\"selectionContext\"\r\n class=\"border-bottom-0\">\r\n <ng-container *ngTemplateOutlet=\"internalizedAvailableHeaderTemplate;\"></ng-container>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let item of availableItems; index as rowIndex; trackBy: trackByIndex\">\r\n <tr ecTableSelectableRow\r\n [selectionContext]=\"selectionContext\"\r\n [rowIndex]=\"rowIndex\"\r\n [isSelected]=\"selectionContext?.selectedItemsMap.has(item.id)\"\r\n [style.--ec-table-selectable-row-vertical-align-checkbox-td]=\"'middle'\">\r\n <ng-container *ngTemplateOutlet=\"internalizedAvailableItemTemplate; context: {$implicit: item}\">\r\n </ng-container>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </ec-searchable-table>\r\n\r\n <section class=\"selected-items flex-grow d-flex flex-column\">\r\n <ec-table [scrollable]=\"true\"\r\n class=\"flex-grow is-fixed\">\r\n <colgroup>\r\n <col>\r\n <col style=\"width: 2rem;\">\r\n </colgroup>\r\n <thead>\r\n <tr style=\"height: 3rem;\">\r\n <th colspan=\"2\"\r\n class=\"p-2 border-bottom-0\">\r\n <div class=\"d-flex align-items-center\">\r\n <span class=\"text-heading-2 font-color-primary flex-grow text-truncate\">{{selectedTitle | translate}}</span>\r\n <a *ngIf=\"selectedItems.length\"\r\n id=\"{{id}}_clearSelection\"\r\n class=\"pl-2 ml-auto font-size-base\"\r\n href=\"javascript:void(0)\"\r\n (click)=\"onClearSelectionClick()\"\r\n translate>ClearSelection_TC</a>\r\n </div>\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <ng-container *ngIf=\"selectedItems.length\">\r\n <tr *ngFor=\"let item of selectedItems; last as isLast\"\r\n [class.border-bottom]=\"!isLast\">\r\n <td class=\"p-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"internalizedSelectedItemTemplate; context: {$implicit: item}\">\r\n </ng-container>\r\n </td>\r\n\r\n <td class=\"actions-col text-right\"\r\n style=\"vertical-align: middle;\">\r\n <ec-button id=\"{{id}}_removeSelected_{{item.id}}\"\r\n type=\"icon\"\r\n icon=\"ec-icon icon-cancel\"\r\n (clicked)=\"removeSelectedItem(item)\">\r\n </ec-button>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <tr *ngIf=\"!selectedItems.length\">\r\n <td *ngIf=\"!noSelectedItemsMessage\"\r\n colspan=\"2\"\r\n class=\"p-2 no-data-message\"\r\n translate\r\n [translateParams]=\"{itemName: itemName | translate}\">ItemPickerNoItemsSelected_SC</td>\r\n <td *ngIf=\"noSelectedItemsMessage\"\r\n colspan=\"2\"\r\n class=\"p-2 no-data-message\"\r\n translate>{{noSelectedItemsMessage}}</td>\r\n </tr>\r\n </tbody>\r\n </ec-table>\r\n\r\n <footer *ngIf=\"selectedItems.length\"\r\n class=\"d-flex flex-shrink px-2 border-top align-items-center\"\r\n style=\"height: calc(2.5rem + 1px);\">\r\n <span class=\"ml-auto text-caption-1 font-color-hint\">\r\n {{selectedItems.length}} {{itemName | translate}}\r\n </span>\r\n </footer>\r\n </section>\r\n</div>\r\n\r\n<ng-template #defaultAvailableHeaderTemplate>\r\n <th class=\"text-heading-2 font-color-primary border-bottom-0\">{{availableTitle | translate}}</th>\r\n</ng-template>\r\n\r\n<ng-template #defaultAvailableItemTemplate\r\n let-item>\r\n <td>{{item.label}}</td>\r\n</ng-template>\r\n\r\n<ng-template #defaultSelectedItemTemplate\r\n let-item>\r\n {{item.label}}\r\n</ng-template>",
9055
+ template: "<div ecOverlay\r\n class=\"d-flex flex-grow card\"\r\n [status]=\"tableStatus?.status\"\r\n [message]=\"tableStatus?.message\"\r\n [displayAsMask]=\"true\">\r\n <ec-searchable-table id=\"{{id}}_searchableTable\"\r\n class=\"flex-grow\"\r\n [fillParentHeight]=\"true\"\r\n [hideHeader]=\"true\"\r\n [hideSearchControl]=\"true\"\r\n [removeCard]=\"true\"\r\n [pageable]=\"true\"\r\n [pageSize]=\"50\"\r\n [objectType]=\"itemName\"\r\n [formModel]=\"formModel\"\r\n [ready]=\"ready\"\r\n [getItems]=\"getItems\"\r\n [selectable]=\"true\"\r\n [noDataMessage]=\"noDataMessage\"\r\n [selectionContext]=\"selectionContext\"\r\n [status]=\"tableStatus\"\r\n (itemsChange)=\"onItemsChange($event)\"\r\n [style.--ec-searchable-table-flex-properties]=\"(availableItems.length || tableStatus.status === 'pending' || tableStatus.status === 'error' ) ? '1 1 auto' : '0 1 auto'\"\r\n [style.--ec-searchable-table-height-caption-footer]=\"'calc(2.5rem + 1px)'\"\r\n [tableLayoutFixed]=\"true\">\r\n <header *ngIf=\"customAvailableHeaderTemplate\"\r\n class=\"card-header flex-shrink\"\r\n style=\"height: 3rem;\">\r\n <h3 class=\"card-title\">{{availableTitle | translate}}</h3>\r\n </header>\r\n <thead>\r\n <tr ecTableSelectableRow\r\n [selectionContext]=\"selectionContext\"\r\n class=\"border-bottom-0\">\r\n <ng-container *ngTemplateOutlet=\"internalizedAvailableHeaderTemplate;\"></ng-container>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let item of availableItems; index as rowIndex; trackBy: trackByIndex\">\r\n <tr ecTableSelectableRow\r\n [selectionContext]=\"selectionContext\"\r\n [rowIndex]=\"rowIndex\"\r\n [isCheckboxDisabled]=\"item.preventRemove\"\r\n [isSelected]=\"selectionContext?.selectedItemsMap.has(item.id)\"\r\n [style.--ec-table-selectable-row-vertical-align-checkbox-td]=\"'middle'\">\r\n <ng-container *ngTemplateOutlet=\"internalizedAvailableItemTemplate; context: {$implicit: item}\">\r\n </ng-container>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </ec-searchable-table>\r\n\r\n <section id=\"{{id}}_selectedItems\" class=\"selected-items flex-grow d-flex flex-column\">\r\n <ec-table [scrollable]=\"true\"\r\n class=\"flex-grow is-fixed\">\r\n <colgroup>\r\n <col>\r\n <col style=\"width: 2rem;\">\r\n </colgroup>\r\n <thead>\r\n <tr style=\"height: 3rem;\">\r\n <th colspan=\"2\"\r\n class=\"p-2 border-bottom-0\">\r\n <div class=\"d-flex align-items-center\">\r\n <span class=\"text-heading-2 font-color-primary flex-grow text-truncate\">{{selectedTitle | translate}}</span>\r\n <a *ngIf=\"selectedItemsClearable\"\r\n id=\"{{id}}_clearSelection\"\r\n class=\"pl-2 ml-auto font-size-base\"\r\n href=\"javascript:void(0)\"\r\n (click)=\"onClearSelectionClick()\"\r\n translate>ClearSelection_TC</a>\r\n </div>\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <ng-container *ngIf=\"selectedItems.length\">\r\n <tr *ngFor=\"let item of selectedItems; last as isLast\"\r\n id=\"selected_row_{{item.id}}\"\r\n [class.border-bottom]=\"!isLast\">\r\n <td class=\"p-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"internalizedSelectedItemTemplate; context: {$implicit: item}\">\r\n </ng-container>\r\n </td>\r\n\r\n <td class=\"actions-col text-right\"\r\n style=\"vertical-align: middle;\">\r\n <ec-button id=\"{{id}}_removeSelected_{{item.id}}\"\r\n *ngIf=\"!item.preventRemove\"\r\n type=\"icon\"\r\n icon=\"ec-icon icon-cancel\"\r\n (clicked)=\"removeSelectedItem(item)\">\r\n </ec-button>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <tr *ngIf=\"!selectedItems.length\">\r\n <td *ngIf=\"!noSelectedItemsMessage\"\r\n colspan=\"2\"\r\n class=\"p-2 no-data-message\"\r\n translate\r\n [translateParams]=\"{itemName: itemName | translate}\">ItemPickerNoItemsSelected_SC</td>\r\n <td *ngIf=\"noSelectedItemsMessage\"\r\n colspan=\"2\"\r\n class=\"p-2 no-data-message\"\r\n translate>{{noSelectedItemsMessage}}</td>\r\n </tr>\r\n </tbody>\r\n </ec-table>\r\n\r\n <footer id=\"selectedItemsFooter\"\r\n *ngIf=\"selectedItems.length\"\r\n class=\"d-flex flex-shrink px-2 border-top align-items-center\"\r\n style=\"height: calc(2.5rem + 1px);\">\r\n <span class=\"ml-auto text-caption-1 font-color-hint\">\r\n {{selectedItems.length}} {{itemName | translate}}\r\n </span>\r\n </footer>\r\n </section>\r\n</div>\r\n\r\n<ng-template #defaultAvailableHeaderTemplate>\r\n <th class=\"text-heading-2 font-color-primary border-bottom-0\">{{availableTitle | translate}}</th>\r\n</ng-template>\r\n\r\n<ng-template #defaultAvailableItemTemplate\r\n let-item>\r\n <td>{{item.label}}</td>\r\n</ng-template>\r\n\r\n<ng-template #defaultSelectedItemTemplate\r\n let-item>\r\n {{item.label}}\r\n</ng-template>",
9002
9056
  styles: ["@-webkit-keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:flex}ec-searchable-table{border-right:2px solid var(--ec-border-color)}.selected-items{max-width:var(--ec-item-picker-max-width-selected-items,50%)}.no-data-message{white-space:normal}"]
9003
9057
  },] }
9004
9058
  ];