@colijnit/corecomponents_v12 258.1.18 → 258.1.19
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 +35 -163
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.d.ts +16 -17
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/colijnit-corecomponents_v12.js +17 -18
- package/esm2015/lib/components/simple-grid/base-simple-grid.component.js +9 -1
- package/esm2015/lib/components/simple-grid/simple-grid.component.js +4 -7
- package/fesm2015/colijnit-corecomponents_v12.js +12 -132
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/simple-grid/base-simple-grid.component.d.ts +3 -0
- package/lib/components/simple-grid/simple-grid.component.d.ts +1 -3
- package/package.json +1 -1
|
@@ -16,7 +16,6 @@ import { DragDropModule, moveItemInArray } from '@angular/cdk/drag-drop';
|
|
|
16
16
|
import * as i1 from '@angular/cdk/overlay';
|
|
17
17
|
import { OverlayConfig, Overlay } from '@angular/cdk/overlay';
|
|
18
18
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
19
|
-
import * as XLSX from 'xlsx';
|
|
20
19
|
import { UserRightType } from '@colijnit/ioneconnector/build/enum/user-right-type.enum';
|
|
21
20
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
22
21
|
import { ArrayUtils as ArrayUtils$1 } from '@colijnit/ioneconnector/build/utils/array-utils';
|
|
@@ -9365,6 +9364,7 @@ class BaseSimpleGridComponent {
|
|
|
9365
9364
|
this.headerColumns = [];
|
|
9366
9365
|
this.headerColumnsCopy = [];
|
|
9367
9366
|
this._data = [];
|
|
9367
|
+
this._exportData = [];
|
|
9368
9368
|
this.disabledRows = [];
|
|
9369
9369
|
this._prepared = false;
|
|
9370
9370
|
}
|
|
@@ -9380,6 +9380,12 @@ class BaseSimpleGridComponent {
|
|
|
9380
9380
|
get data() {
|
|
9381
9381
|
return this._data;
|
|
9382
9382
|
}
|
|
9383
|
+
set exportData(value) {
|
|
9384
|
+
this._exportData = value;
|
|
9385
|
+
}
|
|
9386
|
+
get exportData() {
|
|
9387
|
+
return this._exportData;
|
|
9388
|
+
}
|
|
9383
9389
|
set extraColumns(value) {
|
|
9384
9390
|
this._setColumns(value);
|
|
9385
9391
|
}
|
|
@@ -9482,6 +9488,7 @@ BaseSimpleGridComponent.decorators = [
|
|
|
9482
9488
|
BaseSimpleGridComponent.propDecorators = {
|
|
9483
9489
|
content: [{ type: ContentChildren, args: [SimpleGridColumnDirective,] }],
|
|
9484
9490
|
data: [{ type: Input }],
|
|
9491
|
+
exportData: [{ type: Input }],
|
|
9485
9492
|
dragDropEnabled: [{ type: Input }],
|
|
9486
9493
|
resizable: [{ type: Input }],
|
|
9487
9494
|
inlineEdit: [{ type: Input }],
|
|
@@ -9501,138 +9508,12 @@ BaseSimpleGridComponent.propDecorators = {
|
|
|
9501
9508
|
handleMouseUp: [{ type: HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
9502
9509
|
};
|
|
9503
9510
|
|
|
9504
|
-
class ExcelExportService {
|
|
9505
|
-
/**
|
|
9506
|
-
* Export data to Excel file
|
|
9507
|
-
* @param data - Array of objects to export
|
|
9508
|
-
* @param columns - Column configuration (optional)
|
|
9509
|
-
* @param fileName - Name of the exported file
|
|
9510
|
-
* @param sheetName - Name of the Excel sheet
|
|
9511
|
-
*/
|
|
9512
|
-
exportToExcel(data, columns, fileName = 'export', sheetName = 'Sheet1') {
|
|
9513
|
-
// If columns are specified, transform data to match column structure
|
|
9514
|
-
let exportData = data;
|
|
9515
|
-
if (columns && columns.length > 0) {
|
|
9516
|
-
exportData = data.map(item => {
|
|
9517
|
-
const newItem = {};
|
|
9518
|
-
columns.forEach(col => {
|
|
9519
|
-
newItem[col.header] = this.getFlatValue(item, col.key);
|
|
9520
|
-
});
|
|
9521
|
-
return newItem;
|
|
9522
|
-
});
|
|
9523
|
-
}
|
|
9524
|
-
// Create workbook and worksheet
|
|
9525
|
-
const wb = XLSX.utils.book_new();
|
|
9526
|
-
const ws = XLSX.utils.json_to_sheet(exportData);
|
|
9527
|
-
// Set column widths if specified
|
|
9528
|
-
if (columns && columns.some(col => col.width)) {
|
|
9529
|
-
const colWidths = columns.map(col => ({ wch: col.width || 20 }));
|
|
9530
|
-
ws['!cols'] = colWidths;
|
|
9531
|
-
}
|
|
9532
|
-
// Add worksheet to workbook
|
|
9533
|
-
XLSX.utils.book_append_sheet(wb, ws, sheetName);
|
|
9534
|
-
// Save file
|
|
9535
|
-
XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
9536
|
-
}
|
|
9537
|
-
/**
|
|
9538
|
-
* Export multiple sheets to one Excel file
|
|
9539
|
-
* @param sheets - Array of sheet data
|
|
9540
|
-
* @param fileName - Name of the exported file
|
|
9541
|
-
*/
|
|
9542
|
-
exportMultipleSheets(sheets, fileName = 'multi-sheet-export') {
|
|
9543
|
-
const wb = XLSX.utils.book_new();
|
|
9544
|
-
sheets.forEach(sheet => {
|
|
9545
|
-
let exportData = sheet.data;
|
|
9546
|
-
if (sheet.columns && sheet.columns.length > 0) {
|
|
9547
|
-
exportData = sheet.data.map(item => {
|
|
9548
|
-
const newItem = {};
|
|
9549
|
-
sheet.columns.forEach(col => {
|
|
9550
|
-
newItem[col.header] = this.getNestedValue(item, col.key);
|
|
9551
|
-
});
|
|
9552
|
-
return newItem;
|
|
9553
|
-
});
|
|
9554
|
-
}
|
|
9555
|
-
const ws = XLSX.utils.json_to_sheet(exportData);
|
|
9556
|
-
if (sheet.columns && sheet.columns.some(col => col.width)) {
|
|
9557
|
-
const colWidths = sheet.columns.map(col => ({ wch: col.width || 20 }));
|
|
9558
|
-
ws['!cols'] = colWidths;
|
|
9559
|
-
}
|
|
9560
|
-
XLSX.utils.book_append_sheet(wb, ws, sheet.sheetName);
|
|
9561
|
-
});
|
|
9562
|
-
XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
9563
|
-
}
|
|
9564
|
-
/**
|
|
9565
|
-
* Export HTML table to Excel
|
|
9566
|
-
* @param tableId - ID of the HTML table element
|
|
9567
|
-
* @param fileName - Name of the exported file
|
|
9568
|
-
* @param sheetName - Name of the Excel sheet
|
|
9569
|
-
*/
|
|
9570
|
-
exportTableToExcel(tableId, fileName = 'table-export', sheetName = 'Sheet1') {
|
|
9571
|
-
const table = document.getElementById(tableId);
|
|
9572
|
-
if (!table) {
|
|
9573
|
-
console.error(`Table with ID '${tableId}' not found`);
|
|
9574
|
-
return;
|
|
9575
|
-
}
|
|
9576
|
-
const wb = XLSX.utils.book_new();
|
|
9577
|
-
const ws = XLSX.utils.table_to_sheet(table);
|
|
9578
|
-
XLSX.utils.book_append_sheet(wb, ws, sheetName);
|
|
9579
|
-
XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
9580
|
-
}
|
|
9581
|
-
/**
|
|
9582
|
-
* Get nested object value using dot notation
|
|
9583
|
-
* @param obj - Object to search in
|
|
9584
|
-
* @param path - Dot notation path (e.g., 'user.address.city')
|
|
9585
|
-
*/
|
|
9586
|
-
getNestedValue(obj, path) {
|
|
9587
|
-
return path.split('.').reduce((current, key) => {
|
|
9588
|
-
return current && current[key] !== undefined ? current[key] : '';
|
|
9589
|
-
}, obj);
|
|
9590
|
-
}
|
|
9591
|
-
getFlatValue(obj, key) {
|
|
9592
|
-
return obj && obj[key] !== undefined ? obj[key] : '';
|
|
9593
|
-
}
|
|
9594
|
-
/**
|
|
9595
|
-
* Format date for Excel export
|
|
9596
|
-
* @param date - Date to format
|
|
9597
|
-
* @param format - Format string (default: 'MM/DD/YYYY')
|
|
9598
|
-
*/
|
|
9599
|
-
formatDateForExport(date, format = 'MM/DD/YYYY') {
|
|
9600
|
-
if (!date) {
|
|
9601
|
-
return '';
|
|
9602
|
-
}
|
|
9603
|
-
const d = new Date(date);
|
|
9604
|
-
if (isNaN(d.getTime())) {
|
|
9605
|
-
return '';
|
|
9606
|
-
}
|
|
9607
|
-
const month = (d.getMonth() + 1).toString().padStart(2, '0');
|
|
9608
|
-
const day = d.getDate().toString().padStart(2, '0');
|
|
9609
|
-
const year = d.getFullYear();
|
|
9610
|
-
switch (format) {
|
|
9611
|
-
case 'MM/DD/YYYY':
|
|
9612
|
-
return `${month}/${day}/${year}`;
|
|
9613
|
-
case 'DD/MM/YYYY':
|
|
9614
|
-
return `${day}/${month}/${year}`;
|
|
9615
|
-
case 'YYYY-MM-DD':
|
|
9616
|
-
return `${year}-${month}-${day}`;
|
|
9617
|
-
default:
|
|
9618
|
-
return d.toLocaleDateString();
|
|
9619
|
-
}
|
|
9620
|
-
}
|
|
9621
|
-
}
|
|
9622
|
-
ExcelExportService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ExcelExportService_Factory() { return new ExcelExportService(); }, token: ExcelExportService, providedIn: "root" });
|
|
9623
|
-
ExcelExportService.decorators = [
|
|
9624
|
-
{ type: Injectable, args: [{
|
|
9625
|
-
providedIn: 'root'
|
|
9626
|
-
},] }
|
|
9627
|
-
];
|
|
9628
|
-
|
|
9629
9511
|
class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
9630
|
-
constructor(icons, _changeDetection, _formMaster
|
|
9512
|
+
constructor(icons, _changeDetection, _formMaster) {
|
|
9631
9513
|
super();
|
|
9632
9514
|
this.icons = icons;
|
|
9633
9515
|
this._changeDetection = _changeDetection;
|
|
9634
9516
|
this._formMaster = _formMaster;
|
|
9635
|
-
this.excelExportService = excelExportService;
|
|
9636
9517
|
this.defaultTextAlign = ColumnAlign.Left;
|
|
9637
9518
|
this.showAdd = false;
|
|
9638
9519
|
this.showDelete = false;
|
|
@@ -9944,7 +9825,7 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
|
9944
9825
|
}
|
|
9945
9826
|
exportToExcel() {
|
|
9946
9827
|
this.isSettingsMenuOpen = false;
|
|
9947
|
-
const exportData = this._filterSelectedOrReturnAll(this.data);
|
|
9828
|
+
const exportData = this.exportData.length > 0 ? this._filterSelectedOrReturnAll(this.exportData) : this._filterSelectedOrReturnAll(this.data);
|
|
9948
9829
|
const columns = this.headerColumnsCopy.map(column => {
|
|
9949
9830
|
return ({
|
|
9950
9831
|
key: column.field,
|
|
@@ -10349,8 +10230,7 @@ SimpleGridComponent.decorators = [
|
|
|
10349
10230
|
SimpleGridComponent.ctorParameters = () => [
|
|
10350
10231
|
{ type: IconCacheService },
|
|
10351
10232
|
{ type: ChangeDetectorRef },
|
|
10352
|
-
{ type: FormMasterService }
|
|
10353
|
-
{ type: ExcelExportService }
|
|
10233
|
+
{ type: FormMasterService }
|
|
10354
10234
|
];
|
|
10355
10235
|
SimpleGridComponent.propDecorators = {
|
|
10356
10236
|
headerCells: [{ type: ViewChildren, args: ['headerCell',] }],
|
|
@@ -15174,5 +15054,5 @@ HourSchedulingExpandableComponentModule.decorators = [
|
|
|
15174
15054
|
* Generated bundle index. Do not edit.
|
|
15175
15055
|
*/
|
|
15176
15056
|
|
|
15177
|
-
export { ArticleTileComponent, ArticleTileModule, BaseInputComponent, BaseInputDatePickerDirective, BaseModuleScreenConfigService, BaseModuleService, ButtonComponent, ButtonModule, CalendarComponent, CalendarModule, CardComponent, CardModule, Carousel3dComponent, Carousel3dModule, CarouselComponent, CarouselHammerConfig, CarouselModule, CheckmarkOverlayModule, ClickoutsideModule, CoDialogComponent, CoDialogModule, CoDialogWizardComponent, CoDialogWizardModule, CoDirection, CoOrientation, CollapsibleComponent, CollapsibleModule, ColorPickerComponent, ColorPickerModule, ColorSequenceService, ColumnAlign, ContentViewMode, CoreComponentsIcon, CoreComponentsTranslationModule, CoreComponentsTranslationService, CoreDialogModule, CoreDialogService, DoubleCalendarComponent, DoubleCalendarModule, FilterItemComponent, FilterItemMode, FilterItemModule, FilterItemViewmodel, FilterPipe, FilterPipeModule, FilterViewmodel, FormComponent, FormInputUserModelChangeListenerService, FormMasterService, FormModule, GridToolbarButtonComponent, GridToolbarButtonModule, GridToolbarComponent, GridToolbarModule, HourSchedulingComponent, HourSchedulingComponentModule, HourSchedulingExpandableComponent, HourSchedulingExpandableComponentModule, HourSchedulingExpandableTemplateComponent, IconCacheService, IconCollapseHandleComponent, IconCollapseHandleModule, IconComponent, IconModule, ImageComponent, ImageModule, InputCheckboxComponent, InputCheckboxModule, InputDatePickerComponent, InputDatePickerModule, InputDateRangePickerComponent, InputDateRangePickerModule, InputNumberPickerComponent, InputNumberPickerModule, InputRadioButtonComponent, InputRadioButtonModule, InputScannerComponent, InputScannerModule, InputSearchComponent, InputSearchModule, InputTextComponent, InputTextModule, InputTextareaComponent, InputTextareaModule, LevelIndicatorComponent, LevelIndicatorModule, ListOfIconsComponent, ListOfIconsModule, ListOfValuesComponent, ListOfValuesModule, ListOfValuesPopupComponent, LoaderComponent, LoaderModule, NgZoneWrapperService, ObserveVisibilityModule, OrientationOfDirection, OverlayModule, OverlayService, PaginationBarComponent, PaginationBarModule, PaginationComponent, PaginationModule, PopupButtonsComponent, PopupMessageDisplayComponent, PopupModule, PopupWindowShellComponent, PriceDisplayPipe, PriceDisplayPipeModule, PromptService, ResponsiveTextComponent, ResponsiveTextModule, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, ScreenConfigurationDirective, ScreenConfigurationModule, SimpleGridColumnDirective, SimpleGridComponent, SimpleGridModule, TemplateWrapperDirective, TemplateWrapperModule, TextInputPopupComponent, TileComponent, TileModule, TileSelectComponent, TileSelectModule, TooltipDirectiveModule, ViewModeButtonsComponent, ViewModeButtonsModule, emailValidator, equalValidator, getValidatePasswordErrorString, maxStringLengthValidator, passwordValidator, precisionScaleValidator, requiredValidator, showHideDialog, InputBoolean as ɵa, RippleModule as ɵb,
|
|
15057
|
+
export { ArticleTileComponent, ArticleTileModule, BaseInputComponent, BaseInputDatePickerDirective, BaseModuleScreenConfigService, BaseModuleService, ButtonComponent, ButtonModule, CalendarComponent, CalendarModule, CardComponent, CardModule, Carousel3dComponent, Carousel3dModule, CarouselComponent, CarouselHammerConfig, CarouselModule, CheckmarkOverlayModule, ClickoutsideModule, CoDialogComponent, CoDialogModule, CoDialogWizardComponent, CoDialogWizardModule, CoDirection, CoOrientation, CollapsibleComponent, CollapsibleModule, ColorPickerComponent, ColorPickerModule, ColorSequenceService, ColumnAlign, ContentViewMode, CoreComponentsIcon, CoreComponentsTranslationModule, CoreComponentsTranslationService, CoreDialogModule, CoreDialogService, DoubleCalendarComponent, DoubleCalendarModule, FilterItemComponent, FilterItemMode, FilterItemModule, FilterItemViewmodel, FilterPipe, FilterPipeModule, FilterViewmodel, FormComponent, FormInputUserModelChangeListenerService, FormMasterService, FormModule, GridToolbarButtonComponent, GridToolbarButtonModule, GridToolbarComponent, GridToolbarModule, HourSchedulingComponent, HourSchedulingComponentModule, HourSchedulingExpandableComponent, HourSchedulingExpandableComponentModule, HourSchedulingExpandableTemplateComponent, IconCacheService, IconCollapseHandleComponent, IconCollapseHandleModule, IconComponent, IconModule, ImageComponent, ImageModule, InputCheckboxComponent, InputCheckboxModule, InputDatePickerComponent, InputDatePickerModule, InputDateRangePickerComponent, InputDateRangePickerModule, InputNumberPickerComponent, InputNumberPickerModule, InputRadioButtonComponent, InputRadioButtonModule, InputScannerComponent, InputScannerModule, InputSearchComponent, InputSearchModule, InputTextComponent, InputTextModule, InputTextareaComponent, InputTextareaModule, LevelIndicatorComponent, LevelIndicatorModule, ListOfIconsComponent, ListOfIconsModule, ListOfValuesComponent, ListOfValuesModule, ListOfValuesPopupComponent, LoaderComponent, LoaderModule, NgZoneWrapperService, ObserveVisibilityModule, OrientationOfDirection, OverlayModule, OverlayService, PaginationBarComponent, PaginationBarModule, PaginationComponent, PaginationModule, PopupButtonsComponent, PopupMessageDisplayComponent, PopupModule, PopupWindowShellComponent, PriceDisplayPipe, PriceDisplayPipeModule, PromptService, ResponsiveTextComponent, ResponsiveTextModule, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, ScreenConfigurationDirective, ScreenConfigurationModule, SimpleGridColumnDirective, SimpleGridComponent, SimpleGridModule, TemplateWrapperDirective, TemplateWrapperModule, TextInputPopupComponent, TileComponent, TileModule, TileSelectComponent, TileSelectModule, TooltipDirectiveModule, ViewModeButtonsComponent, ViewModeButtonsModule, emailValidator, equalValidator, getValidatePasswordErrorString, maxStringLengthValidator, passwordValidator, precisionScaleValidator, requiredValidator, showHideDialog, InputBoolean as ɵa, RippleModule as ɵb, PaginationService as ɵba, PaginatePipe as ɵbb, SimpleGridCellComponent as ɵbc, ListOfValuesMultiselectPopupComponent as ɵbd, ConfirmationDialogComponent as ɵbe, DialogBaseComponent as ɵbf, CoreDynamicComponentService as ɵbg, PrependPipeModule as ɵbh, PrependPipe as ɵbi, CheckmarkOverlayComponent as ɵbj, ScannerService as ɵbk, TooltipModule as ɵbl, TooltipComponent as ɵbm, TooltipDirective as ɵbn, HourSchedulingTestObjectComponent as ɵbo, MD_RIPPLE_GLOBAL_OPTIONS as ɵc, CoRippleDirective as ɵd, CoViewportRulerService as ɵe, CoScrollDispatcherService as ɵf, CoScrollableDirective as ɵg, StopClickModule as ɵh, StopClickDirective as ɵi, BaseModule as ɵj, AppendPipeModule as ɵk, AppendPipe as ɵl, ValidationErrorModule as ɵm, OverlayDirective as ɵn, OverlayParentDirective as ɵo, CoreLocalizePipe as ɵp, CoreDictionaryService as ɵq, ValidationErrorComponent as ɵr, CommitButtonsModule as ɵs, CommitButtonsComponent as ɵt, ClickOutsideDirective as ɵu, ClickOutsideMasterService as ɵv, CalendarTemplateComponent as ɵw, PopupShowerService as ɵx, BaseSimpleGridComponent as ɵy, ObserveVisibilityDirective as ɵz };
|
|
15178
15058
|
//# sourceMappingURL=colijnit-corecomponents_v12.js.map
|