@colijnit/corecomponents_v12 259.1.3 → 259.1.5
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 +51 -179
- 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 +16 -19
- package/fesm2015/colijnit-corecomponents_v12.js +24 -144
- 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 +7 -9
- package/package.json +1 -1
- package/colijnit-corecomponents_v12-259.1.2.tgz +0 -0
|
@@ -17,7 +17,6 @@ import { CoDocument } from '@colijnit/mainapi/build/model/co-document.bo';
|
|
|
17
17
|
import * as i1 from '@angular/cdk/overlay';
|
|
18
18
|
import { OverlayConfig, Overlay } from '@angular/cdk/overlay';
|
|
19
19
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
20
|
-
import * as XLSX from 'xlsx';
|
|
21
20
|
import { UserRightType } from '@colijnit/ioneconnector/build/enum/user-right-type.enum';
|
|
22
21
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
23
22
|
import { ArrayUtils as ArrayUtils$1 } from '@colijnit/ioneconnector/build/utils/array-utils';
|
|
@@ -9237,6 +9236,7 @@ class BaseSimpleGridComponent {
|
|
|
9237
9236
|
this.headerColumns = [];
|
|
9238
9237
|
this.headerColumnsCopy = [];
|
|
9239
9238
|
this._data = [];
|
|
9239
|
+
this._exportData = [];
|
|
9240
9240
|
this.disabledRows = [];
|
|
9241
9241
|
this._prepared = false;
|
|
9242
9242
|
}
|
|
@@ -9252,6 +9252,12 @@ class BaseSimpleGridComponent {
|
|
|
9252
9252
|
get data() {
|
|
9253
9253
|
return this._data;
|
|
9254
9254
|
}
|
|
9255
|
+
set exportData(value) {
|
|
9256
|
+
this._exportData = value;
|
|
9257
|
+
}
|
|
9258
|
+
get exportData() {
|
|
9259
|
+
return this._exportData;
|
|
9260
|
+
}
|
|
9255
9261
|
set extraColumns(value) {
|
|
9256
9262
|
this._setColumns(value);
|
|
9257
9263
|
}
|
|
@@ -9354,6 +9360,7 @@ BaseSimpleGridComponent.decorators = [
|
|
|
9354
9360
|
BaseSimpleGridComponent.propDecorators = {
|
|
9355
9361
|
content: [{ type: ContentChildren, args: [SimpleGridColumnDirective,] }],
|
|
9356
9362
|
data: [{ type: Input }],
|
|
9363
|
+
exportData: [{ type: Input }],
|
|
9357
9364
|
dragDropEnabled: [{ type: Input }],
|
|
9358
9365
|
resizable: [{ type: Input }],
|
|
9359
9366
|
inlineEdit: [{ type: Input }],
|
|
@@ -9373,138 +9380,12 @@ BaseSimpleGridComponent.propDecorators = {
|
|
|
9373
9380
|
handleMouseUp: [{ type: HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
9374
9381
|
};
|
|
9375
9382
|
|
|
9376
|
-
class ExcelExportService {
|
|
9377
|
-
/**
|
|
9378
|
-
* Export data to Excel file
|
|
9379
|
-
* @param data - Array of objects to export
|
|
9380
|
-
* @param columns - Column configuration (optional)
|
|
9381
|
-
* @param fileName - Name of the exported file
|
|
9382
|
-
* @param sheetName - Name of the Excel sheet
|
|
9383
|
-
*/
|
|
9384
|
-
exportToExcel(data, columns, fileName = 'export', sheetName = 'Sheet1') {
|
|
9385
|
-
// If columns are specified, transform data to match column structure
|
|
9386
|
-
let exportData = data;
|
|
9387
|
-
if (columns && columns.length > 0) {
|
|
9388
|
-
exportData = data.map(item => {
|
|
9389
|
-
const newItem = {};
|
|
9390
|
-
columns.forEach(col => {
|
|
9391
|
-
newItem[col.header] = this.getFlatValue(item, col.key);
|
|
9392
|
-
});
|
|
9393
|
-
return newItem;
|
|
9394
|
-
});
|
|
9395
|
-
}
|
|
9396
|
-
// Create workbook and worksheet
|
|
9397
|
-
const wb = XLSX.utils.book_new();
|
|
9398
|
-
const ws = XLSX.utils.json_to_sheet(exportData);
|
|
9399
|
-
// Set column widths if specified
|
|
9400
|
-
if (columns && columns.some(col => col.width)) {
|
|
9401
|
-
const colWidths = columns.map(col => ({ wch: col.width || 20 }));
|
|
9402
|
-
ws['!cols'] = colWidths;
|
|
9403
|
-
}
|
|
9404
|
-
// Add worksheet to workbook
|
|
9405
|
-
XLSX.utils.book_append_sheet(wb, ws, sheetName);
|
|
9406
|
-
// Save file
|
|
9407
|
-
XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
9408
|
-
}
|
|
9409
|
-
/**
|
|
9410
|
-
* Export multiple sheets to one Excel file
|
|
9411
|
-
* @param sheets - Array of sheet data
|
|
9412
|
-
* @param fileName - Name of the exported file
|
|
9413
|
-
*/
|
|
9414
|
-
exportMultipleSheets(sheets, fileName = 'multi-sheet-export') {
|
|
9415
|
-
const wb = XLSX.utils.book_new();
|
|
9416
|
-
sheets.forEach(sheet => {
|
|
9417
|
-
let exportData = sheet.data;
|
|
9418
|
-
if (sheet.columns && sheet.columns.length > 0) {
|
|
9419
|
-
exportData = sheet.data.map(item => {
|
|
9420
|
-
const newItem = {};
|
|
9421
|
-
sheet.columns.forEach(col => {
|
|
9422
|
-
newItem[col.header] = this.getNestedValue(item, col.key);
|
|
9423
|
-
});
|
|
9424
|
-
return newItem;
|
|
9425
|
-
});
|
|
9426
|
-
}
|
|
9427
|
-
const ws = XLSX.utils.json_to_sheet(exportData);
|
|
9428
|
-
if (sheet.columns && sheet.columns.some(col => col.width)) {
|
|
9429
|
-
const colWidths = sheet.columns.map(col => ({ wch: col.width || 20 }));
|
|
9430
|
-
ws['!cols'] = colWidths;
|
|
9431
|
-
}
|
|
9432
|
-
XLSX.utils.book_append_sheet(wb, ws, sheet.sheetName);
|
|
9433
|
-
});
|
|
9434
|
-
XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
9435
|
-
}
|
|
9436
|
-
/**
|
|
9437
|
-
* Export HTML table to Excel
|
|
9438
|
-
* @param tableId - ID of the HTML table element
|
|
9439
|
-
* @param fileName - Name of the exported file
|
|
9440
|
-
* @param sheetName - Name of the Excel sheet
|
|
9441
|
-
*/
|
|
9442
|
-
exportTableToExcel(tableId, fileName = 'table-export', sheetName = 'Sheet1') {
|
|
9443
|
-
const table = document.getElementById(tableId);
|
|
9444
|
-
if (!table) {
|
|
9445
|
-
console.error(`Table with ID '${tableId}' not found`);
|
|
9446
|
-
return;
|
|
9447
|
-
}
|
|
9448
|
-
const wb = XLSX.utils.book_new();
|
|
9449
|
-
const ws = XLSX.utils.table_to_sheet(table);
|
|
9450
|
-
XLSX.utils.book_append_sheet(wb, ws, sheetName);
|
|
9451
|
-
XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
9452
|
-
}
|
|
9453
|
-
/**
|
|
9454
|
-
* Get nested object value using dot notation
|
|
9455
|
-
* @param obj - Object to search in
|
|
9456
|
-
* @param path - Dot notation path (e.g., 'user.address.city')
|
|
9457
|
-
*/
|
|
9458
|
-
getNestedValue(obj, path) {
|
|
9459
|
-
return path.split('.').reduce((current, key) => {
|
|
9460
|
-
return current && current[key] !== undefined ? current[key] : '';
|
|
9461
|
-
}, obj);
|
|
9462
|
-
}
|
|
9463
|
-
getFlatValue(obj, key) {
|
|
9464
|
-
return obj && obj[key] !== undefined ? obj[key] : '';
|
|
9465
|
-
}
|
|
9466
|
-
/**
|
|
9467
|
-
* Format date for Excel export
|
|
9468
|
-
* @param date - Date to format
|
|
9469
|
-
* @param format - Format string (default: 'MM/DD/YYYY')
|
|
9470
|
-
*/
|
|
9471
|
-
formatDateForExport(date, format = 'MM/DD/YYYY') {
|
|
9472
|
-
if (!date) {
|
|
9473
|
-
return '';
|
|
9474
|
-
}
|
|
9475
|
-
const d = new Date(date);
|
|
9476
|
-
if (isNaN(d.getTime())) {
|
|
9477
|
-
return '';
|
|
9478
|
-
}
|
|
9479
|
-
const month = (d.getMonth() + 1).toString().padStart(2, '0');
|
|
9480
|
-
const day = d.getDate().toString().padStart(2, '0');
|
|
9481
|
-
const year = d.getFullYear();
|
|
9482
|
-
switch (format) {
|
|
9483
|
-
case 'MM/DD/YYYY':
|
|
9484
|
-
return `${month}/${day}/${year}`;
|
|
9485
|
-
case 'DD/MM/YYYY':
|
|
9486
|
-
return `${day}/${month}/${year}`;
|
|
9487
|
-
case 'YYYY-MM-DD':
|
|
9488
|
-
return `${year}-${month}-${day}`;
|
|
9489
|
-
default:
|
|
9490
|
-
return d.toLocaleDateString();
|
|
9491
|
-
}
|
|
9492
|
-
}
|
|
9493
|
-
}
|
|
9494
|
-
ExcelExportService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ExcelExportService_Factory() { return new ExcelExportService(); }, token: ExcelExportService, providedIn: "root" });
|
|
9495
|
-
ExcelExportService.decorators = [
|
|
9496
|
-
{ type: Injectable, args: [{
|
|
9497
|
-
providedIn: 'root'
|
|
9498
|
-
},] }
|
|
9499
|
-
];
|
|
9500
|
-
|
|
9501
9383
|
class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
9502
|
-
constructor(icons, _changeDetection, _formMaster
|
|
9384
|
+
constructor(icons, _changeDetection, _formMaster) {
|
|
9503
9385
|
super();
|
|
9504
9386
|
this.icons = icons;
|
|
9505
9387
|
this._changeDetection = _changeDetection;
|
|
9506
9388
|
this._formMaster = _formMaster;
|
|
9507
|
-
this.excelExportService = excelExportService;
|
|
9508
9389
|
this.defaultTextAlign = ColumnAlign.Left;
|
|
9509
9390
|
this.showAdd = false;
|
|
9510
9391
|
this.showDelete = false;
|
|
@@ -9816,7 +9697,7 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
|
9816
9697
|
}
|
|
9817
9698
|
exportToExcel() {
|
|
9818
9699
|
this.isSettingsMenuOpen = false;
|
|
9819
|
-
const exportData = this._filterSelectedOrReturnAll(this.data);
|
|
9700
|
+
const exportData = this.exportData.length > 0 ? this._filterSelectedOrReturnAll(this.exportData) : this._filterSelectedOrReturnAll(this.data);
|
|
9820
9701
|
const columns = this.headerColumnsCopy.map(column => {
|
|
9821
9702
|
return ({
|
|
9822
9703
|
key: column.field,
|
|
@@ -9873,6 +9754,18 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
|
9873
9754
|
// 'Sheet1'
|
|
9874
9755
|
// );
|
|
9875
9756
|
}
|
|
9757
|
+
goToPreviousPage() {
|
|
9758
|
+
this.currentPage -= 1;
|
|
9759
|
+
}
|
|
9760
|
+
goToNextPage() {
|
|
9761
|
+
this.currentPage += 1;
|
|
9762
|
+
}
|
|
9763
|
+
setCurrentPage(page) {
|
|
9764
|
+
this.currentPage = page;
|
|
9765
|
+
}
|
|
9766
|
+
get isNewRow() {
|
|
9767
|
+
return this._newRow;
|
|
9768
|
+
}
|
|
9876
9769
|
_filterSelectedOrReturnAll(items) {
|
|
9877
9770
|
const hasSelectedTrue = items.some(item => item.selected === true);
|
|
9878
9771
|
return hasSelectedTrue ? items.filter(item => item.selected === true) : items;
|
|
@@ -10014,15 +9907,6 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
|
10014
9907
|
}
|
|
10015
9908
|
this._detectChanges();
|
|
10016
9909
|
}
|
|
10017
|
-
goToPreviousPage() {
|
|
10018
|
-
this.currentPage -= 1;
|
|
10019
|
-
}
|
|
10020
|
-
goToNextPage() {
|
|
10021
|
-
this.currentPage += 1;
|
|
10022
|
-
}
|
|
10023
|
-
setCurrentPage(page) {
|
|
10024
|
-
this.currentPage = page;
|
|
10025
|
-
}
|
|
10026
9910
|
_detectChanges() {
|
|
10027
9911
|
this._changeDetection.detectChanges();
|
|
10028
9912
|
}
|
|
@@ -10034,9 +9918,6 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
|
10034
9918
|
this.editing = false;
|
|
10035
9919
|
this.rowToEdit = undefined;
|
|
10036
9920
|
}
|
|
10037
|
-
get isNewRow() {
|
|
10038
|
-
return this._newRow;
|
|
10039
|
-
}
|
|
10040
9921
|
}
|
|
10041
9922
|
SimpleGridComponent.decorators = [
|
|
10042
9923
|
{ type: Component, args: [{
|
|
@@ -10221,8 +10102,7 @@ SimpleGridComponent.decorators = [
|
|
|
10221
10102
|
SimpleGridComponent.ctorParameters = () => [
|
|
10222
10103
|
{ type: IconCacheService },
|
|
10223
10104
|
{ type: ChangeDetectorRef },
|
|
10224
|
-
{ type: FormMasterService }
|
|
10225
|
-
{ type: ExcelExportService }
|
|
10105
|
+
{ type: FormMasterService }
|
|
10226
10106
|
];
|
|
10227
10107
|
SimpleGridComponent.propDecorators = {
|
|
10228
10108
|
headerCells: [{ type: ViewChildren, args: ['headerCell',] }],
|
|
@@ -15046,5 +14926,5 @@ HourSchedulingExpandableComponentModule.decorators = [
|
|
|
15046
14926
|
* Generated bundle index. Do not edit.
|
|
15047
14927
|
*/
|
|
15048
14928
|
|
|
15049
|
-
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,
|
|
14929
|
+
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 };
|
|
15050
14930
|
//# sourceMappingURL=colijnit-corecomponents_v12.js.map
|