@colijnit/corecomponents_v12 258.1.10 → 258.1.12
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/colijnit-corecomponents_v12.umd.js +22 -6
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12-258.1.11.tgz +0 -0
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/calendar/calendar.component.js +2 -2
- package/esm2015/lib/components/simple-grid/simple-grid.component.js +184 -168
- package/fesm2015/colijnit-corecomponents_v12.js +184 -168
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/simple-grid/simple-grid.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5933,7 +5933,7 @@
|
|
|
5933
5933
|
CalendarComponent.decorators = [
|
|
5934
5934
|
{ type: i0.Component, args: [{
|
|
5935
5935
|
selector: "co-calendar",
|
|
5936
|
-
template: "\n <div class=\"date-picker-container\" [overlay]=\"parentForOverlay\" (clickOutside)=\"clickedOutside.next()\">\n <calendar-template\n [locale]=\"locale\"\n [highlightDaysBetweenDates]=\"highlightDaysBetweenDates\"\n [selectedDate]=\"selectedDate\"\n [secondSelectedDate]=\"secondSelectedDate\"\n [secondHoveringDate]=\"secondHoveringDate\"\n (dateSelected)=\"dateSelected.next($event)\"\n (hoveringDate)=\"hoveringDate.next($event)\"\n (clickedOutside)=\"clickedOutside.next()\"\n ></calendar-template>\n </div>\n ",
|
|
5936
|
+
template: "\n <div class=\"date-picker-container\" [keepInView]=\"true\" [overlay]=\"parentForOverlay\" (clickOutside)=\"clickedOutside.next()\">\n <calendar-template\n [locale]=\"locale\"\n [highlightDaysBetweenDates]=\"highlightDaysBetweenDates\"\n [selectedDate]=\"selectedDate\"\n [secondSelectedDate]=\"secondSelectedDate\"\n [secondHoveringDate]=\"secondHoveringDate\"\n (dateSelected)=\"dateSelected.next($event)\"\n (hoveringDate)=\"hoveringDate.next($event)\"\n (clickedOutside)=\"clickedOutside.next()\"\n ></calendar-template>\n </div>\n ",
|
|
5937
5937
|
encapsulation: i0.ViewEncapsulation.None
|
|
5938
5938
|
},] }
|
|
5939
5939
|
];
|
|
@@ -10571,6 +10571,7 @@
|
|
|
10571
10571
|
};
|
|
10572
10572
|
SimpleGridComponent.prototype.exportToExcel = function () {
|
|
10573
10573
|
this.isSettingsMenuOpen = false;
|
|
10574
|
+
var exportData = this._filterSelectedOrReturnAll(this.data);
|
|
10574
10575
|
var columns = this.headerColumnsCopy.map(function (column) {
|
|
10575
10576
|
return ({
|
|
10576
10577
|
key: column.field,
|
|
@@ -10578,11 +10579,16 @@
|
|
|
10578
10579
|
});
|
|
10579
10580
|
});
|
|
10580
10581
|
var headers = columns.map(function (col) { return col.header; });
|
|
10581
|
-
var rows =
|
|
10582
|
+
var rows = exportData.map(function (row) { return columns.map(function (col) {
|
|
10582
10583
|
var value = row[col.key];
|
|
10583
10584
|
if (value instanceof Date) {
|
|
10584
|
-
var
|
|
10585
|
-
|
|
10585
|
+
var formattedDate = value.toISOString().split('T')[0];
|
|
10586
|
+
var _a = __read(formattedDate.split('-'), 3), year = _a[0], month = _a[1], day = _a[2];
|
|
10587
|
+
return day + "-" + month + "-" + year;
|
|
10588
|
+
}
|
|
10589
|
+
else if (typeof value === 'number') {
|
|
10590
|
+
var hasDecimal = function (num) { return !Number.isInteger(num); };
|
|
10591
|
+
return hasDecimal ? value.toFixed(2) : value.toFixed(0);
|
|
10586
10592
|
}
|
|
10587
10593
|
else if (Array.isArray(value)) {
|
|
10588
10594
|
return value.join(', ');
|
|
@@ -10591,7 +10597,13 @@
|
|
|
10591
10597
|
return JSON.stringify(value);
|
|
10592
10598
|
}
|
|
10593
10599
|
else {
|
|
10594
|
-
|
|
10600
|
+
if (!value)
|
|
10601
|
+
return '';
|
|
10602
|
+
if (value.includes('T00:00:00')) {
|
|
10603
|
+
var _b = __read(value.replace('T00:00:00', '').split('-'), 3), year = _b[0], month = _b[1], day = _b[2];
|
|
10604
|
+
return day + "-" + month + "-" + year;
|
|
10605
|
+
}
|
|
10606
|
+
return String(value);
|
|
10595
10607
|
}
|
|
10596
10608
|
}); });
|
|
10597
10609
|
var csvContent = __spreadArray([headers], __read(rows)).map(function (row) { return row.map(function (cell) { return "\"" + cell.replace(/"/g, '""') + "\""; }).join(','); }).join('\r\n');
|
|
@@ -10610,6 +10622,10 @@
|
|
|
10610
10622
|
// 'Sheet1'
|
|
10611
10623
|
// );
|
|
10612
10624
|
};
|
|
10625
|
+
SimpleGridComponent.prototype._filterSelectedOrReturnAll = function (items) {
|
|
10626
|
+
var hasSelectedTrue = items.some(function (item) { return item.selected === true; });
|
|
10627
|
+
return hasSelectedTrue ? items.filter(function (item) { return item.selected === true; }) : items;
|
|
10628
|
+
};
|
|
10613
10629
|
SimpleGridComponent.prototype.prepareDataRow = function (row, index) {
|
|
10614
10630
|
this.isRowDisabled(row, index);
|
|
10615
10631
|
};
|
|
@@ -10768,7 +10784,7 @@
|
|
|
10768
10784
|
SimpleGridComponent.decorators = [
|
|
10769
10785
|
{ type: i0.Component, args: [{
|
|
10770
10786
|
selector: 'co-simple-grid',
|
|
10771
|
-
template: "\n
|
|
10787
|
+
template: "\n <co-grid-toolbar\n *ngIf=\"showToolbar\" [class.right]=\"rightToolbar\"\n [showEdit]=\"showEdit\"\n [showAdd]=\"showAdd\"\n [showDelete]=\"showDelete\"\n [deleteEnabled]=\"selectedRowIndex > -1\"\n (addClick)=\"addNewRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n (deleteClick)=\"removeRow()\">\n </co-grid-toolbar>\n\n <table\n id=\"simple-grid-table\"\n class=\"simple-grid-table\"\n [clickOutside]=\"editing\"\n (clickOutside)=\"handleClickOutsideRow()\">\n <colgroup>\n <col\n *ngFor=\"let column of headerColumnsCopy; let index = index\"\n [class.simple-grid-column-auto-fit]=\"column.autoFit\"\n [style.width.px]=\"column.width\"\n [style.min-width.px]=\"MIN_COLUMN_WIDTH\">\n </colgroup>\n <thead>\n <tr>\n <th\n scope=\"col\"\n #headerCell\n class=\"simple-grid-column-header\"\n *ngFor=\"let column of headerColumnsCopy; let index = index\">\n <div\n class=\"simple-grid-column-header-wrapper\"\n [class.resizable]=\"resizable\"\n [class.selected]=\"column.isSelected\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.headerTemplate; else noHeaderTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #noHeaderTemplate>\n <div\n class=\"simple-grid-column-header-label\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [class.with-menu]=\"showGridSettings\"\n [class.with-sort]=\"showColumnSort\"\n [textContent]=\"column.headerText || ' '\"\n (click)=\"showColumnSort ? sortColumn(column, column.field) : toggleColumnMenu(column)\">\n </div>\n\n <div class=\"sort-column\" *ngIf=\"showColumnSort\">\n <co-button\n (click)=\"sortColumn(column, column?.field)\"\n [iconData]=\"icons.getIcon(Icons.ArrowUpArrowDown)\">\n </co-button>\n </div>\n\n <div class=\"column-menu\" *ngIf=\"column.isSelected\">\n <h3 [textContent]=\"'COLUMN_OPTIONS' | coreLocalize\"></h3>\n <ul>\n <li (click)=\"hideColumn(column)\">Hide Column</li>\n <li (click)=\"sortColumn(column, column.field)\">Sort Column</li>\n </ul>\n </div>\n </ng-template>\n <div\n *ngIf=\"resizable && column.resizable\"\n class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\">\n </div>\n </div>\n </th>\n </tr>\n\n <div *ngIf=\"showGridSettings\" class=\"grid-settings\">\n <co-button\n [class.selected]=\"isSettingsMenuOpen\"\n [iconData]=\"icons.getIcon(Icons.CogWheels)\"\n (click)=\"toggleSettingsMenu()\">\n </co-button>\n\n <div class=\"settings-menu\" *ngIf=\"isSettingsMenuOpen\">\n <h3 [textContent]=\"'GRID_OPTIONS' | coreLocalize\"></h3>\n <ul>\n <li (click)=\"exportToExcel()\">Export to Excel</li>\n <li *ngIf=\"headerColumnsCopy.length !== headerColumns.length\" (click)=\"showAllColumns()\">\n Show All Columns\n </li>\n </ul>\n </div>\n </div>\n </thead>\n <tbody\n #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled || editing\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\">\n <co-form class=\"simple-grid-row-form\">\n <tr\n class=\"simple-grid-row\"\n [class.selected]=\"rowIndex === selectedRowIndex && !editing\" observeVisibility\n [class.disabled]=\"getIsRowDisabled(rowIndex)\"\n [class.editing]=\"rowIndex === editRowIndex\"\n *ngFor=\"let row of (!!rowsPerPage ? (data | paginate: {itemsPerPage: rowsPerPage, currentPage: currentPage}) : data); last as last; let rowIndex = index\"\n cdkDrag\n (click)=\"handleClickRow($event, rowIndex, row)\" (dblclick)=\"handleDblClickRow($event, rowIndex, row)\"\n (visibilityChange)=\"rowVisible.next(row)\"\n (mouseenter)=\"hoveredRowIndex = rowIndex\"\n (mouseleave)=\"hoveredRowIndex = -1\"\n >\n <ng-container *ngIf=\"isSingleColumnRow(row)\">\n <td class=\"simple-grid-single-column-cell\" [attr.colspan]=\"headerColumnsCopy.length\">\n <co-simple-grid-cell\n [column]=\"columns[singleColumnIndex(row)]\"\n [row]=\"row\"\n [editMode]=\"false\">\n </co-simple-grid-cell>\n </td>\n </ng-container>\n <ng-container *ngIf=\"!isSingleColumnRow(row)\">\n <ng-container *ngFor=\"let column of headerColumnsCopy; let columnIndex = index\">\n <td class=\"simple-grid-column-cell\" *ngIf=\"columnIndex !== singleColumnIndex(row)\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editing && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex && rowIndex === editRowIndex\"\n (cellClick)=\"handleCellClick($event, row, rowIndex, columnIndex)\">\n </co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </td>\n </ng-container>\n <ng-container *ngIf=\"inlineEdit\">\n <div class=\"icons-container\" *ngIf=\"!editing\">\n <co-icon class=\"icon-item icon-edit\"\n [iconData]=\"icons.getIcon(Icons.PenToSquareSolid)\" *ngIf=\"hoveredRowIndex === rowIndex\"\n (click)=\"editRow($event, true, rowIndex); $event.stopPropagation()\"></co-icon>\n <co-icon class=\"icon-item icon-delete\"\n [iconData]=\"icons.getIcon(Icons.TrashBin)\" *ngIf=\"hoveredRowIndex === rowIndex\"\n (click)=\"removeRow()\"></co-icon>\n </div>\n <div class=\"icons-container\">\n <co-button class=\"save-button\"\n *ngIf=\"editing && (selectedRowIndex === rowIndex || (isNewRow && rowIndex === editRowIndex))\"\n [iconData]=\"icons.getIcon(Icons.CheckDuotone)\"\n (click)=\"validateAndSave(); $event.stopPropagation()\"></co-button>\n <co-button class=\"close-button\"\n *ngIf=\"editing && (selectedRowIndex === rowIndex || (isNewRow && rowIndex === editRowIndex))\"\n [iconData]=\"icons.getIcon(Icons.CrossSkinny)\"\n (click)=\"cancelEditRow(); $event.stopPropagation() \"></co-button>\n </div>\n </ng-container>\n </ng-container>\n </tr>\n </co-form>\n </tbody>\n </table>\n <co-pagination-bar\n *ngIf=\"data?.length > rowsPerPage\" class=\"pagination-bar\"\n [itemsPerPage]=\"rowsPerPage\"\n [currentPage]=\"currentPage\"\n [totalItems]=\"data.length\"\n [autoHide]=\"true\"\n (previousClick)=\"goToPreviousPage()\"\n (nextClick)=\"goToNextPage()\"\n (pageClick)=\"setCurrentPage($event)\">\n </co-pagination-bar>\n ",
|
|
10772
10788
|
providers: [FormMasterService],
|
|
10773
10789
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
10774
10790
|
encapsulation: i0.ViewEncapsulation.None
|