@energycap/components 0.27.4 → 0.27.5-searchable-table-bugfix.20220127-0856
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.
- package/bundles/energycap-components.umd.js +51 -6
- package/bundles/energycap-components.umd.js.map +1 -1
- package/bundles/energycap-components.umd.min.js +1 -1
- package/bundles/energycap-components.umd.min.js.map +1 -1
- package/energycap-components.metadata.json +1 -1
- package/energycap-components.min.css +1 -1
- package/esm2015/lib/components.module.js +8 -4
- package/esm2015/lib/controls/menu/menu.component.js +16 -3
- package/esm2015/lib/display/hierarchy/hierarchy-base.js +1 -1
- package/esm2015/lib/display/table/searchable-table.component.js +2 -2
- package/esm2015/lib/shared/display/pipes/highlight-text.pipe.js +26 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/energycap-components.js +48 -7
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/controls/menu/menu.component.d.ts +6 -0
- package/lib/display/hierarchy/hierarchy-base.d.ts +5 -0
- package/lib/shared/display/pipes/highlight-text.pipe.d.ts +6 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/styles/utilities/_layout.scss +5 -0
|
@@ -2653,6 +2653,12 @@
|
|
|
2653
2653
|
* Item currently highlighted by keyboard navigation
|
|
2654
2654
|
*/
|
|
2655
2655
|
this.highlightedItem = null;
|
|
2656
|
+
/**
|
|
2657
|
+
* Tells the menu to maintain the selected/lastSelected item. Turning this off is useful for
|
|
2658
|
+
* action type menus that are displayed on the screen at all times and you do not
|
|
2659
|
+
* want the item to be selected when clicked.
|
|
2660
|
+
*/
|
|
2661
|
+
this.maintainSelectedItem = true;
|
|
2656
2662
|
/**
|
|
2657
2663
|
* Emitted when `selected` is changed. Emits the referenced object.
|
|
2658
2664
|
*
|
|
@@ -2755,8 +2761,14 @@
|
|
|
2755
2761
|
else {
|
|
2756
2762
|
this.onSelection(item);
|
|
2757
2763
|
}
|
|
2758
|
-
this.
|
|
2759
|
-
|
|
2764
|
+
if (this.maintainSelectedItem) {
|
|
2765
|
+
this.selected = item;
|
|
2766
|
+
this.lastSelected = item;
|
|
2767
|
+
}
|
|
2768
|
+
else {
|
|
2769
|
+
this.selected = null;
|
|
2770
|
+
this.lastSelected = null;
|
|
2771
|
+
}
|
|
2760
2772
|
}
|
|
2761
2773
|
};
|
|
2762
2774
|
/**
|
|
@@ -3000,6 +3012,7 @@
|
|
|
3000
3012
|
noDataText: [{ type: i0.Input }],
|
|
3001
3013
|
enableKeyNav: [{ type: i0.Input }],
|
|
3002
3014
|
highlightedItem: [{ type: i0.Input }],
|
|
3015
|
+
maintainSelectedItem: [{ type: i0.Input }],
|
|
3003
3016
|
selectedChanged: [{ type: i0.Output }],
|
|
3004
3017
|
menuClosed: [{ type: i0.Output }],
|
|
3005
3018
|
labelTemplate: [{ type: i0.ViewChild, args: ['label', { static: true },] }],
|
|
@@ -6957,7 +6970,7 @@
|
|
|
6957
6970
|
SearchableTableComponent.decorators = [
|
|
6958
6971
|
{ type: i0.Component, args: [{
|
|
6959
6972
|
selector: 'ec-searchable-table',
|
|
6960
|
-
template: "<header *ngIf=\"!hideHeader\"\r\n class=\"d-flex flex-shrink align-items-center mb-3\">\r\n <ec-textbox id=\"{{id}}_searchbox\"\r\n *ngIf=\"!hideSearchControl\"\r\n class=\"mb-0 flex-grow mr-2\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"searchModel\"\r\n [tabindex]=\"searchboxTabIndex\"\r\n [placeholder]=\"searchboxPlaceholder\"\r\n [readonly]=\"searchboxReadonly\"></ec-textbox>\r\n <div class=\"flex-grow\">\r\n <ng-content select=\".searchable-table-controls\"></ng-content>\r\n </div>\r\n</header>\r\n<section id=\"{{id}}_card\"\r\n class=\"d-flex flex-column flex-
|
|
6973
|
+
template: "<header *ngIf=\"!hideHeader\"\r\n class=\"d-flex flex-shrink align-items-center mb-3\">\r\n <ec-textbox id=\"{{id}}_searchbox\"\r\n *ngIf=\"!hideSearchControl\"\r\n class=\"mb-0 flex-grow mr-2\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"searchModel\"\r\n [tabindex]=\"searchboxTabIndex\"\r\n [placeholder]=\"searchboxPlaceholder\"\r\n [readonly]=\"searchboxReadonly\"></ec-textbox>\r\n <div class=\"flex-grow\">\r\n <ng-content select=\".searchable-table-controls\"></ng-content>\r\n </div>\r\n</header>\r\n<section id=\"{{id}}_card\"\r\n class=\"d-flex flex-column flex-shrink-max\"\r\n [ngClass]=\"{'is-translucent': status.status !== 'error', 'has-mask': status.status !== 'hasData', 'card m-0 bg-content': !customContentTemplate, 'bg-body': customContentTemplate}\"\r\n ecOverlay\r\n [status]=\"status.status\"\r\n [message]=\"status.message\"\r\n [displayAsMask]=\"true\">\r\n <ng-content select=\".card-header\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"customContentTemplate || defaultContentTemplate\">\r\n </ng-container>\r\n\r\n <!-- the default template is an ec-table with proxied-over searchable table inputs. \r\n If that doesn't work for you then you can specify a customContentTemplate to use instead\r\n and still retain all the event handling, header, footer pagination, etc support -->\r\n <ng-template #defaultContentTemplate>\r\n <ec-table id=\"{{id}}_table\"\r\n class=\"flex-shrink-max {{tableClasses}}\"\r\n [class.is-fixed]=\"tableLayoutFixed\"\r\n [sortable]=\"sortable\"\r\n [sort]=\"sort\"\r\n (sortChange)=\"onSortChange($event)\"\r\n [resizable]=\"resizable\"\r\n [scrollable]=\"true\"\r\n [selectable]=\"selectable\"\r\n [selectionContext]=\"selectionContext\"\r\n [selectionToolbarTemplate]=\"selectionToolbarTemplate\"\r\n [resizableColumns]=\"resizableColumns\">\r\n <ng-content></ng-content>\r\n </ec-table>\r\n </ng-template>\r\n\r\n <!-- pagination footer visible if table is page-able and there are more than one page of results -->\r\n <footer *ngIf=\"!hideFooter && pageable && searchResults.totalItemsBeforePaging! > pageSize!\"\r\n class=\"d-flex flex-shrink align-items-center\"\r\n [class.border-top]=\"!customContentTemplate\">\r\n <ec-table-pagination id=\"{{id}}_pager\"\r\n class=\"font-color-primary\"\r\n [totalItems]=\"searchResults.totalItemsBeforePaging\"\r\n [pageSize]=\"pageSize\"\r\n [maxTabs]=\"maxTabs\"\r\n [pageNumber]=\"pageInfo?.pageNumber\"\r\n (pageChanged)=\"onPageChange($event)\">\r\n </ec-table-pagination>\r\n <div id=\"resultsCount\"\r\n *ngIf=\"searchResults?.items?.length\"\r\n class=\"ml-auto mr-2 font-color-hint text-truncate\" \r\n title=\"{{resultsCount}} {{additionalCountText}}\">{{resultsCount}} {{additionalCountText}}</div>\r\n </footer>\r\n\r\n <!-- default footer: visible if hideFooter is false and table is not page-able or there are only one page of results (always shows if there is a caption to indicate no results) -->\r\n <footer *ngIf=\"(!hideFooter && (!pageable || searchResults.totalItemsBeforePaging! <= pageSize!)) || tableCaption\"\r\n class=\"p-2 d-flex\"\r\n [ngClass]=\"{'has-results': searchResults?.items?.length, 'border-top': searchResults?.items?.length && !customContentTemplate}\">\r\n <ng-content *ngIf=\"!tableCaption\"\r\n select=\".searchable-table-footer\"></ng-content>\r\n <div id=\"tableCaption\"\r\n *ngIf=\"tableCaption\"\r\n [innerHTML]=\"tableCaption\"></div>\r\n <div id=\"resultsCount\"\r\n *ngIf=\"searchResults?.items?.length\"\r\n class=\"ml-auto text-truncate\"\r\n title=\"{{resultsCount}} {{additionalCountText}}\">{{resultsCount}} {{additionalCountText}}</div>\r\n </footer>\r\n</section>",
|
|
6961
6974
|
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;flex:1 1;flex-direction:column;min-height:0}:host ::ng-deep .card-header+ec-table.is-selectable th{height:2.5rem;padding-bottom:.9375rem}:host ::ng-deep .card-header+ec-table.is-selectable th.is-resizable .handle{padding-top:.5rem}:host ::ng-deep .card-header+ec-table.is-selectable th.is-resizable .handle:before{top:.5rem}:host ::ng-deep .card-header+ec-table.is-selectable .selectable-table-toolbar{height:2.5rem;padding-bottom:.5rem}footer{font-size:.75rem;line-height:1rem}footer.has-results{color:rgba(26,26,35,.38);text-align:right}.card.has-mask{min-height:15rem}"]
|
|
6962
6975
|
},] }
|
|
6963
6976
|
];
|
|
@@ -8154,6 +8167,34 @@
|
|
|
8154
8167
|
width: [{ type: i0.Input, args: ['ecIfViewportWidth',] }]
|
|
8155
8168
|
};
|
|
8156
8169
|
|
|
8170
|
+
var HighlightTextPipe = /** @class */ (function () {
|
|
8171
|
+
function HighlightTextPipe() {
|
|
8172
|
+
}
|
|
8173
|
+
HighlightTextPipe.prototype.transform = function (value, searchText) {
|
|
8174
|
+
var transformedValue = '';
|
|
8175
|
+
if (value && searchText) {
|
|
8176
|
+
var regex = new RegExp(this.escapeRegex(searchText), 'gi');
|
|
8177
|
+
transformedValue = value.replace(regex, this.strongWrap);
|
|
8178
|
+
}
|
|
8179
|
+
else {
|
|
8180
|
+
transformedValue = value;
|
|
8181
|
+
}
|
|
8182
|
+
return transformedValue;
|
|
8183
|
+
};
|
|
8184
|
+
HighlightTextPipe.prototype.strongWrap = function (match) {
|
|
8185
|
+
return "<strong class=\"text-highlight\">" + match + "</strong>";
|
|
8186
|
+
};
|
|
8187
|
+
HighlightTextPipe.prototype.escapeRegex = function (value) {
|
|
8188
|
+
return value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
8189
|
+
};
|
|
8190
|
+
return HighlightTextPipe;
|
|
8191
|
+
}());
|
|
8192
|
+
HighlightTextPipe.decorators = [
|
|
8193
|
+
{ type: i0.Pipe, args: [{
|
|
8194
|
+
name: 'highlightText'
|
|
8195
|
+
},] }
|
|
8196
|
+
];
|
|
8197
|
+
|
|
8157
8198
|
/**
|
|
8158
8199
|
* Format a time to the user's preference for display
|
|
8159
8200
|
*/
|
|
@@ -8637,7 +8678,8 @@
|
|
|
8637
8678
|
HierarchyTreeComponent,
|
|
8638
8679
|
TreeComponent,
|
|
8639
8680
|
RelativeDatePipe,
|
|
8640
|
-
ResizableComponent
|
|
8681
|
+
ResizableComponent,
|
|
8682
|
+
HighlightTextPipe
|
|
8641
8683
|
],
|
|
8642
8684
|
imports: [
|
|
8643
8685
|
common.CommonModule,
|
|
@@ -8655,7 +8697,8 @@
|
|
|
8655
8697
|
TimeDisplayPipe,
|
|
8656
8698
|
MockDateDisplayPipe,
|
|
8657
8699
|
RowCountPipe,
|
|
8658
|
-
RelativeDatePipe
|
|
8700
|
+
RelativeDatePipe,
|
|
8701
|
+
HighlightTextPipe
|
|
8659
8702
|
],
|
|
8660
8703
|
exports: [
|
|
8661
8704
|
ButtonComponent,
|
|
@@ -8710,7 +8753,8 @@
|
|
|
8710
8753
|
HierarchyTreeComponent,
|
|
8711
8754
|
TreeComponent,
|
|
8712
8755
|
RelativeDatePipe,
|
|
8713
|
-
ResizableComponent
|
|
8756
|
+
ResizableComponent,
|
|
8757
|
+
HighlightTextPipe
|
|
8714
8758
|
]
|
|
8715
8759
|
},] }
|
|
8716
8760
|
];
|
|
@@ -9854,6 +9898,7 @@
|
|
|
9854
9898
|
exports.HierarchyBaseTestInjectorFactory = HierarchyBaseTestInjectorFactory;
|
|
9855
9899
|
exports.HierarchyItem = HierarchyItem;
|
|
9856
9900
|
exports.HierarchyTreeComponent = HierarchyTreeComponent;
|
|
9901
|
+
exports.HighlightTextPipe = HighlightTextPipe;
|
|
9857
9902
|
exports.IfViewportWidthDirective = IfViewportWidthDirective;
|
|
9858
9903
|
exports.ItemDisplayComponent = ItemDisplayComponent;
|
|
9859
9904
|
exports.JsonDisplayComponent = JsonDisplayComponent;
|