@energycap/components 0.27.4-ECAPID-402-MultiSelect-Component.20220125-1937 → 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 +50 -29
- 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.d.ts +0 -1
- package/energycap-components.metadata.json +1 -1
- package/energycap-components.min.css +1 -1
- package/esm2015/energycap-components.js +1 -2
- package/esm2015/lib/components.module.js +7 -5
- 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 +47 -26
- 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
- package/esm2015/lib/controls/multiselect/multiselect.component.js +0 -23
- package/lib/controls/multiselect/multiselect.component.d.ts +0 -9
|
@@ -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
|
*/
|
|
@@ -8558,28 +8599,6 @@
|
|
|
8558
8599
|
currentTab: [{ type: i0.Input }]
|
|
8559
8600
|
};
|
|
8560
8601
|
|
|
8561
|
-
var MultiselectComponent = /** @class */ (function (_super) {
|
|
8562
|
-
__extends(MultiselectComponent, _super);
|
|
8563
|
-
function MultiselectComponent(validationMessageService, formGroupHelper) {
|
|
8564
|
-
var _this = _super.call(this, validationMessageService, formGroupHelper) || this;
|
|
8565
|
-
_this.validationMessageService = validationMessageService;
|
|
8566
|
-
_this.formGroupHelper = formGroupHelper;
|
|
8567
|
-
return _this;
|
|
8568
|
-
}
|
|
8569
|
-
return MultiselectComponent;
|
|
8570
|
-
}(FormControlBase));
|
|
8571
|
-
MultiselectComponent.decorators = [
|
|
8572
|
-
{ type: i0.Component, args: [{
|
|
8573
|
-
selector: 'ec-multiselect',
|
|
8574
|
-
template: "<p>multiselect works!</p>\r\n",
|
|
8575
|
-
styles: [""]
|
|
8576
|
-
},] }
|
|
8577
|
-
];
|
|
8578
|
-
MultiselectComponent.ctorParameters = function () { return [
|
|
8579
|
-
{ type: ValidationMessageService },
|
|
8580
|
-
{ type: FormGroupHelper }
|
|
8581
|
-
]; };
|
|
8582
|
-
|
|
8583
8602
|
var ComponentsModule = /** @class */ (function () {
|
|
8584
8603
|
function ComponentsModule() {
|
|
8585
8604
|
}
|
|
@@ -8660,7 +8679,7 @@
|
|
|
8660
8679
|
TreeComponent,
|
|
8661
8680
|
RelativeDatePipe,
|
|
8662
8681
|
ResizableComponent,
|
|
8663
|
-
|
|
8682
|
+
HighlightTextPipe
|
|
8664
8683
|
],
|
|
8665
8684
|
imports: [
|
|
8666
8685
|
common.CommonModule,
|
|
@@ -8678,7 +8697,8 @@
|
|
|
8678
8697
|
TimeDisplayPipe,
|
|
8679
8698
|
MockDateDisplayPipe,
|
|
8680
8699
|
RowCountPipe,
|
|
8681
|
-
RelativeDatePipe
|
|
8700
|
+
RelativeDatePipe,
|
|
8701
|
+
HighlightTextPipe
|
|
8682
8702
|
],
|
|
8683
8703
|
exports: [
|
|
8684
8704
|
ButtonComponent,
|
|
@@ -8733,7 +8753,8 @@
|
|
|
8733
8753
|
HierarchyTreeComponent,
|
|
8734
8754
|
TreeComponent,
|
|
8735
8755
|
RelativeDatePipe,
|
|
8736
|
-
ResizableComponent
|
|
8756
|
+
ResizableComponent,
|
|
8757
|
+
HighlightTextPipe
|
|
8737
8758
|
]
|
|
8738
8759
|
},] }
|
|
8739
8760
|
];
|
|
@@ -9877,6 +9898,7 @@
|
|
|
9877
9898
|
exports.HierarchyBaseTestInjectorFactory = HierarchyBaseTestInjectorFactory;
|
|
9878
9899
|
exports.HierarchyItem = HierarchyItem;
|
|
9879
9900
|
exports.HierarchyTreeComponent = HierarchyTreeComponent;
|
|
9901
|
+
exports.HighlightTextPipe = HighlightTextPipe;
|
|
9880
9902
|
exports.IfViewportWidthDirective = IfViewportWidthDirective;
|
|
9881
9903
|
exports.ItemDisplayComponent = ItemDisplayComponent;
|
|
9882
9904
|
exports.JsonDisplayComponent = JsonDisplayComponent;
|
|
@@ -9968,7 +9990,6 @@
|
|
|
9968
9990
|
exports.ɵa = ResizableTableDirective;
|
|
9969
9991
|
exports.ɵb = AvatarService;
|
|
9970
9992
|
exports.ɵc = TableDetailRowComponent;
|
|
9971
|
-
exports.ɵd = MultiselectComponent;
|
|
9972
9993
|
|
|
9973
9994
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9974
9995
|
|