@energycap/components 0.39.32-ECAP-26866-table-multi-sort-improvements.20241022-1702 → 0.39.32-ECAP-27075-confirm-bug-textbox-always-showing-even-when-not-requested.20241023-1555

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.
@@ -5184,6 +5184,7 @@ class ConfirmComponent {
5184
5184
  onOpen(openContext) {
5185
5185
  this.context = openContext;
5186
5186
  this.dialogId = openContext.id;
5187
+ this.showTextBox = this.context.checkConfirm ? false : true;
5187
5188
  if (this.context.alternateSaveLabel) {
5188
5189
  this.context.saveOnEnter = false;
5189
5190
  }
@@ -5193,7 +5194,7 @@ class ConfirmComponent {
5193
5194
  /** Form Group to hold any form controls needed */
5194
5195
  this.formGroup = new UntypedFormGroup({});
5195
5196
  this.status = new Overlay('hasData');
5196
- this.showTextBox = true;
5197
+ this.showTextBox = false;
5197
5198
  this.destroyed = new Subject();
5198
5199
  this.onDialogSave = new EventEmitter();
5199
5200
  this.onDialogCancel = new EventEmitter();
@@ -7082,7 +7083,7 @@ class TableComponent {
7082
7083
  if (this.sortable && changes.sort && changes.sort.currentValue && !changes.sort.firstChange) {
7083
7084
  const newValue = changes.sort.currentValue;
7084
7085
  if (!this.currentSort || !isEqual(newValue, this.currentSort)) {
7085
- this.onSort(newValue);
7086
+ this.onSort(newValue.field, newValue.direction);
7086
7087
  }
7087
7088
  }
7088
7089
  }
@@ -7131,14 +7132,7 @@ class TableComponent {
7131
7132
  if (th.classList.contains('is-resizable') && event.target && event.target.classList.contains('handle')) {
7132
7133
  return;
7133
7134
  }
7134
- let direction;
7135
- if (th.classList.contains('is-sorted-desc')) {
7136
- direction = 'asc';
7137
- }
7138
- else {
7139
- direction = 'desc';
7140
- }
7141
- this.onSort({ field, direction });
7135
+ this.onSort(field);
7142
7136
  });
7143
7137
  // Store unlisten function to remove listener when component is destroyed
7144
7138
  this.unlisteners.push(unlisten);
@@ -7150,7 +7144,7 @@ class TableComponent {
7150
7144
  });
7151
7145
  // Set the initial sort
7152
7146
  if (this.sort) {
7153
- this.onSort(this.sort);
7147
+ this.onSort(this.sort.field, this.sort.direction);
7154
7148
  }
7155
7149
  }
7156
7150
  /**
@@ -7159,29 +7153,32 @@ class TableComponent {
7159
7153
  * Emit the current field and direction of the sorted column
7160
7154
  * @param field
7161
7155
  */
7162
- onSort(sort) {
7163
- this.clearSort();
7164
- if (Array.isArray(sort)) {
7165
- sort.forEach(s => this.applySort(s));
7166
- }
7167
- else {
7168
- this.applySort(sort);
7169
- }
7170
- this.currentSort = cloneDeep(sort);
7171
- this.sortChange.emit(this.currentSort);
7172
- }
7173
- clearSort() {
7174
- Object.values(this.sortableCols).forEach(th => {
7175
- this.renderer.removeClass(th, `is-sorted-asc`);
7176
- this.renderer.removeClass(th, `is-sorted-desc`);
7177
- });
7178
- }
7179
- applySort(sort) {
7180
- const th = this.sortableCols[sort.field];
7156
+ onSort(field, direction) {
7157
+ const th = this.sortableCols[field];
7181
7158
  if (!th) {
7182
7159
  return;
7183
7160
  }
7184
- this.renderer.addClass(th, `is-sorted-${sort.direction}`);
7161
+ if (this.currentSort && this.currentSort.field !== field) {
7162
+ this.renderer.removeClass(this.sortableCols[this.currentSort.field], `is-sorted-${this.currentSort.direction}`);
7163
+ }
7164
+ if (th.classList.contains('is-sorted-desc')) {
7165
+ this.renderer.removeClass(th, 'is-sorted-desc');
7166
+ if (!direction) {
7167
+ direction = 'asc';
7168
+ }
7169
+ }
7170
+ else {
7171
+ if (th.classList.contains('is-sorted-asc')) {
7172
+ this.renderer.removeClass(th, 'is-sorted-asc');
7173
+ }
7174
+ if (!direction) {
7175
+ direction = 'desc';
7176
+ }
7177
+ }
7178
+ this.renderer.addClass(th, `is-sorted-${direction}`);
7179
+ const sortEvent = { field: field, direction: direction };
7180
+ this.currentSort = sortEvent;
7181
+ this.sortChange.emit(sortEvent);
7185
7182
  }
7186
7183
  initSelectable() {
7187
7184
  this.selectionContext.rowCheckboxes.valueChanges.pipe(takeUntil(this.destroyed)).subscribe((value) => {