@indigina/ui-kit 1.1.279 → 1.1.281
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/fesm2022/indigina-ui-kit.mjs +57 -46
- package/fesm2022/indigina-ui-kit.mjs.map +1 -1
- package/index.d.ts +4 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1$5 from '@angular/common';
|
|
2
2
|
import { NgClass, NgTemplateOutlet, CommonModule, AsyncPipe, DatePipe, TitleCasePipe, DecimalPipe } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Input, ChangeDetectionStrategy, Component, input, EventEmitter, Output, ViewEncapsulation, effect, inject, ElementRef, NgZone, Renderer2, Directive, ChangeDetectorRef, viewChild, forwardRef, ViewChild, HostListener, signal, TemplateRef, ContentChild, Injectable, output, computed, NgModule, RendererFactory2, DOCUMENT, ViewContainerRef, DestroyRef, model, contentChildren, ContentChildren, viewChildren, Pipe, InjectionToken, contentChild } from '@angular/core';
|
|
4
|
+
import { Input, ChangeDetectionStrategy, Component, input, EventEmitter, Output, ViewEncapsulation, effect, inject, ElementRef, NgZone, Renderer2, Directive, ChangeDetectorRef, viewChild, forwardRef, ViewChild, HostListener, signal, TemplateRef, ContentChild, Injectable, output, computed, NgModule, RendererFactory2, DOCUMENT, ViewContainerRef, DestroyRef, model, contentChildren, ContentChildren, viewChildren, Pipe, InjectionToken, contentChild, Injector, runInInjectionContext } from '@angular/core';
|
|
5
5
|
import * as i1 from '@progress/kendo-angular-buttons';
|
|
6
6
|
import { ButtonModule, ButtonGroupModule } from '@progress/kendo-angular-buttons';
|
|
7
7
|
import * as i1$1 from '@progress/kendo-angular-label';
|
|
@@ -52,8 +52,8 @@ import { signalSetFn, SIGNAL } from '@angular/core/primitives/signals';
|
|
|
52
52
|
import { StateReset } from 'ngxs-reset-plugin';
|
|
53
53
|
import { pdf } from '@progress/kendo-drawing';
|
|
54
54
|
import { saveAs, encodeBase64 } from '@progress/kendo-file-saver';
|
|
55
|
-
import { Workbook } from '@progress/kendo-ooxml';
|
|
56
55
|
import { json2csv } from 'json-2-csv';
|
|
56
|
+
import { Workbook } from '@progress/kendo-ooxml';
|
|
57
57
|
import * as i1$d from '@progress/kendo-angular-scheduler';
|
|
58
58
|
import { ToolbarService, KENDO_SCHEDULER } from '@progress/kendo-angular-scheduler';
|
|
59
59
|
import { catchError as catchError$1, map as map$1 } from 'rxjs/operators';
|
|
@@ -990,6 +990,7 @@ class KitDropdownComponent {
|
|
|
990
990
|
}
|
|
991
991
|
setDisabledState(disabled) {
|
|
992
992
|
this.disabled = disabled;
|
|
993
|
+
this.changeDetectorRef.markForCheck();
|
|
993
994
|
}
|
|
994
995
|
reset(value) {
|
|
995
996
|
this.writeValue(value);
|
|
@@ -8186,6 +8187,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
8186
8187
|
type: Injectable
|
|
8187
8188
|
}], ctorParameters: () => [] });
|
|
8188
8189
|
|
|
8190
|
+
const kitExportExcel = async (data, exportedColumns, exportedFileName, translationMap) => {
|
|
8191
|
+
const translateService = inject(TranslateService);
|
|
8192
|
+
const workbook = { sheets: [{ rows: [], columns: [] }] };
|
|
8193
|
+
const columns = exportedColumns
|
|
8194
|
+
.map(({ title, field }) => ({
|
|
8195
|
+
value: translateService.instant(title || field),
|
|
8196
|
+
background: '#7a7a7a',
|
|
8197
|
+
color: '#fff',
|
|
8198
|
+
width: 170,
|
|
8199
|
+
}));
|
|
8200
|
+
workbook.sheets[0].rows = getExportedExcelRows(columns, data, exportedColumns, translationMap);
|
|
8201
|
+
workbook.sheets[0].columns = columns;
|
|
8202
|
+
const dataUrl = await new Workbook(workbook).toDataURL();
|
|
8203
|
+
return saveAs(dataUrl, `${exportedFileName}.xlsx`);
|
|
8204
|
+
};
|
|
8205
|
+
const getExportedExcelRows = (columns, data, gridColumns, translationMap) => {
|
|
8206
|
+
const gridCellService = inject(KitGridCellService);
|
|
8207
|
+
const rows = [{ cells: columns, type: 'header' }];
|
|
8208
|
+
for (const row of data) {
|
|
8209
|
+
const rowCells = gridColumns.map((column) => {
|
|
8210
|
+
const value = row[column.field];
|
|
8211
|
+
if (column.excelFormat) {
|
|
8212
|
+
switch (column.type) {
|
|
8213
|
+
case 'time':
|
|
8214
|
+
return { format: column.excelFormat, value: timeStringToExcelFraction(value) };
|
|
8215
|
+
case 'dateTime':
|
|
8216
|
+
case 'dateTimeLocal':
|
|
8217
|
+
return { format: column.excelFormat, value: value ? new Date(value) : '' };
|
|
8218
|
+
}
|
|
8219
|
+
}
|
|
8220
|
+
return { value: gridCellService.createCellValue(column.type, column.field, row, translationMap) };
|
|
8221
|
+
});
|
|
8222
|
+
rows.push({ cells: rowCells, type: 'data' });
|
|
8223
|
+
}
|
|
8224
|
+
return rows;
|
|
8225
|
+
};
|
|
8226
|
+
const timeStringToExcelFraction = (time) => {
|
|
8227
|
+
if (!time) {
|
|
8228
|
+
return '';
|
|
8229
|
+
}
|
|
8230
|
+
;
|
|
8231
|
+
const [hoursStr, minutesStr,] = time.split(':');
|
|
8232
|
+
const hours = Number.parseInt(hoursStr, 10);
|
|
8233
|
+
const minutes = Number.parseInt(minutesStr, 10);
|
|
8234
|
+
return (hours * 60 + minutes) / (24 * 60);
|
|
8235
|
+
};
|
|
8236
|
+
|
|
8189
8237
|
var GridExportOptions;
|
|
8190
8238
|
(function (GridExportOptions) {
|
|
8191
8239
|
GridExportOptions["PDF"] = "pdf";
|
|
@@ -8226,6 +8274,7 @@ class KitGridExportComponent {
|
|
|
8226
8274
|
this.notificationService = inject(KitNotificationService);
|
|
8227
8275
|
this.gridCellService = inject(KitGridCellService);
|
|
8228
8276
|
this.store = inject(Store);
|
|
8277
|
+
this.injector = inject(Injector);
|
|
8229
8278
|
this.getExportedData = input.required(...(ngDevMode ? [{ debugName: "getExportedData" }] : []));
|
|
8230
8279
|
this.translationMap = input.required(...(ngDevMode ? [{ debugName: "translationMap" }] : []));
|
|
8231
8280
|
this.exportedFileName = input.required(...(ngDevMode ? [{ debugName: "exportedFileName" }] : []));
|
|
@@ -8290,55 +8339,17 @@ class KitGridExportComponent {
|
|
|
8290
8339
|
onExportExcel() {
|
|
8291
8340
|
return new Promise((resolve, reject) => this.getExportedData()().subscribe({
|
|
8292
8341
|
next: ({ data }) => {
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
color: '#fff',
|
|
8299
|
-
width: 170,
|
|
8300
|
-
}));
|
|
8301
|
-
workbook.sheets[0].rows = this.getExportedExcelRows(columns, data, this.exportedColumns);
|
|
8302
|
-
workbook.sheets[0].columns = columns;
|
|
8303
|
-
new Workbook(workbook).toDataURL()
|
|
8304
|
-
.then((dataUrl) => saveAs(dataUrl, `${this.exportedFileName()}.xlsx`))
|
|
8305
|
-
.finally(resolve);
|
|
8342
|
+
runInInjectionContext(this.injector, () => {
|
|
8343
|
+
kitExportExcel(data, this.exportedColumns, this.exportedFileName(), this.translationMap())
|
|
8344
|
+
.then(resolve)
|
|
8345
|
+
.catch(reject);
|
|
8346
|
+
});
|
|
8306
8347
|
},
|
|
8307
8348
|
error: (err) => {
|
|
8308
8349
|
reject(new Error(err));
|
|
8309
8350
|
},
|
|
8310
8351
|
}));
|
|
8311
8352
|
}
|
|
8312
|
-
getExportedExcelRows(columns, data, gridColumns) {
|
|
8313
|
-
const rows = [{ cells: columns, type: 'header' }];
|
|
8314
|
-
data.forEach(row => {
|
|
8315
|
-
const rowCells = gridColumns.map((column) => {
|
|
8316
|
-
const value = row[column.field];
|
|
8317
|
-
if (column.excelFormat) {
|
|
8318
|
-
switch (column.type) {
|
|
8319
|
-
case 'time':
|
|
8320
|
-
return { format: column.excelFormat, value: this.timeStringToExcelFraction(value) };
|
|
8321
|
-
case 'dateTime':
|
|
8322
|
-
case 'dateTimeLocal':
|
|
8323
|
-
return { format: column.excelFormat, value: value ? new Date(value) : '' };
|
|
8324
|
-
}
|
|
8325
|
-
}
|
|
8326
|
-
return { value: this.gridCellService.createCellValue(column.type, column.field, row, this.translationMap()) };
|
|
8327
|
-
});
|
|
8328
|
-
rows.push({ cells: rowCells, type: 'data' });
|
|
8329
|
-
});
|
|
8330
|
-
return rows;
|
|
8331
|
-
}
|
|
8332
|
-
timeStringToExcelFraction(time) {
|
|
8333
|
-
if (!time) {
|
|
8334
|
-
return '';
|
|
8335
|
-
}
|
|
8336
|
-
;
|
|
8337
|
-
const [hoursStr, minutesStr,] = time.split(':');
|
|
8338
|
-
const hours = parseInt(hoursStr, 10);
|
|
8339
|
-
const minutes = parseInt(minutesStr, 10);
|
|
8340
|
-
return (hours * 60 + minutes) / (24 * 60);
|
|
8341
|
-
}
|
|
8342
8353
|
onExportCSV() {
|
|
8343
8354
|
return new Promise((resolve, reject) => this.getExportedData()().subscribe({
|
|
8344
8355
|
next: ({ data }) => {
|
|
@@ -9615,5 +9626,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
9615
9626
|
* Generated bundle index. Do not edit.
|
|
9616
9627
|
*/
|
|
9617
9628
|
|
|
9618
|
-
export { AbstractKitCtaPanelConfirmationComponent, AddGridFilter, FetchUser, FetchUserIdentities, FetchUserPermissions, FetchUserSettings, HighlightPipe, KIT_BASE_PATH, KIT_DATETIME_FORMAT_LONG, KIT_DATE_FORMAT, KIT_GRID_CELL_DATE_FORMAT_CONFIG, KIT_GRID_STATE_TOKEN, KIT_USER_APPLICATIONS_PATH, KIT_USER_IDENTITIES_STATE_TOKEN, KIT_USER_PATH, KIT_USER_PERMISSIONS_PATH, KIT_USER_PERMISSIONS_STATE_TOKEN, KIT_USER_STATE_TOKEN, KitAccountService, KitAutocompleteComponent, KitAutocompleteDirective, KitAvatarComponent, KitAvatarSize, KitBadgeDirective, KitBadgeTheme, KitBreadcrumbsComponent, KitBreadcrumbsService, KitButtonComponent, KitButtonIconPosition, KitButtonKind, KitButtonState, KitButtonType, KitCardComponent, KitCardDetailsComponent, KitCardTheme, KitCheckboxComponent, KitCheckboxState, KitCollapsedListComponent, KitCollapsedListDropdownAlign, KitCopyTextComponent, KitCtaPanelAbstractConfirmationComponent, KitCtaPanelActionComponent, KitCtaPanelConfirmationComponent, KitCtaPanelItemComponent, KitCtaPanelItemType, KitDataFieldComponent, KitDataFieldState, KitDatepickerComponent, KitDatepickerSize, KitDaterangeComponent, KitDaterangeType, KitDatetimepickerComponent, KitDialogActionsComponent, KitDialogComponent, KitDialogService, KitDialogTitlebarComponent, KitDialogType, KitDropdownComponent, KitDropdownItemTemplateDirective, KitDropdownSize, KitEmptySectionComponent, KitEntityGridComponent, KitEntitySectionComponent, KitEntitySectionContainerComponent, KitEntityTitleComponent, KitFileCardComponent, KitFileCardMessagesComponent, KitFileUploadComponent, KitFilterCheckboxComponent, KitFilterLogic, KitFilterOperator, KitFilterType, KitForbiddenComponent, KitGlobalSearchComponent, KitGridCellComponent, KitGridCellService, KitGridCellTemplateDirective, KitGridColumnComponent, KitGridColumnManagerComponent, KitGridComponent, KitGridDetailTemplateDirective, KitGridDetailsButtonComponent, KitGridExportComponent, KitGridFiltersComponent, KitGridSearchComponent, KitGridSortSettingsMode, KitGridState, KitGridUrlStateService, KitGridViewType, KitGridViewsComponent, KitGridViewsState, KitInputLabelComponent, KitInputMessageComponent, KitListComponent, KitLoaderComponent, KitLocationStepperComponent, KitMobileHeaderComponent, KitMobileMenuComponent, KitMobileMenuState, KitMultiselectComponent, KitNavigationMenuComponent, KitNavigationMenuService, KitNavigationMenuSubmenuComponent, KitNavigationTabsComponent, KitNavigationTabsType, KitNotFoundComponent, KitNoteComponent, KitNotificationComponent, KitNotificationService, KitNotificationType, KitNumericTextboxComponent, KitNumericTextboxSize, KitNumericTextboxState, KitOptionToggleComponent, KitPageLayoutComponent, KitPermissionDirective, KitPillComponent, KitPillTheme, KitPillType, KitPopupAlignHorizontal, KitPopupAlignVertical, KitPopupComponent, KitPopupPositionMode, KitProfileMenuComponent, KitQueryParamsName, KitQueryParamsService, KitRadioButtonComponent, KitRadioButtonType, KitRoutePathComponent, KitSchedulerComponent, KitSchedulerMonthEventTemplateDirective, KitSchedulerWeekEventTemplateDirective, KitScrollNavigationComponent, KitScrollNavigationSectionComponent, KitSearchBarComponent, KitSidebarComponent, KitSkeletonAnimation, KitSkeletonComponent, KitSkeletonShape, KitSortDirection, KitSortableComponent, KitSplitContainerComponent, KitStatusLabelColor, KitStatusLabelComponent, KitStatusLabelSize, KitSvgIcon, KitSvgIconComponent, KitSvgIconType, KitSvgSpriteComponent, KitSwitchComponent, KitSwitchMode, KitSwitchState, KitTabComponent, KitTabContentDirective, KitTabsComponent, KitTabsSize, KitTabsType, KitTextLabelComponent, KitTextLabelState, KitTextareaAutoresizeDirective, KitTextareaComponent, KitTextareaState, KitTextboxComponent, KitTextboxSize, KitTextboxState, KitThemeService, KitThemes, KitTileLayoutComponent, KitTileLayoutItemComponent, KitTimelineCardComponent, KitTimelineComponent, KitTimelineTheme, KitTimelineType, KitTimepickerComponent, KitTitleTemplateDirective, KitToastrModule, KitToastrPosition, KitToastrService, KitToastrType, KitToggleComponent, KitToggleSize, KitTooltipDirective, KitTooltipPosition, KitTopBarComponent, KitTrackingCardComponent, KitTrackingTimelineComponent, KitTranslateLoader, KitTranslateService, KitTruncateTextComponent, KitUnitsTextboxComponent, KitUnitsTextboxDropdownPosition, KitUnitsTextboxType, KitUserApplicationsState, KitUserIdentitiesInterceptor, KitUserIdentitiesSelector, KitUserIdentitiesState, KitUserPermissionsState, KitUserSettingsComponent, KitUserSettingsKeys, KitUserSettingsState, KitUserState, KitUserType, RemoveGridFilter, SetGridColumns, SetGridFilters, SetGridSearch, SetGridSkip, SetGridSort, SetGridTake, SetUserIdentity, UpdateGridFilter, buildRandomUUID, changeFilterField, createDataFetcherFactory, findMatches, kitBuildFilterBooleanOptions, kitBuildFilterListOptions, kitBuildFilters, kitBuildGridColumn, kitBuildGridDataResults, kitBuildOdataFilter, kitBuildSortString, kitDataStateToODataString, kitEncodeViewNameToUrl, kitGetPermissionTypesByCategory, kitHasPermission, kitUserPermissionsGuard, mapGlobalSearchResult, trimTrailingSlash };
|
|
9629
|
+
export { AbstractKitCtaPanelConfirmationComponent, AddGridFilter, FetchUser, FetchUserIdentities, FetchUserPermissions, FetchUserSettings, HighlightPipe, KIT_BASE_PATH, KIT_DATETIME_FORMAT_LONG, KIT_DATE_FORMAT, KIT_GRID_CELL_DATE_FORMAT_CONFIG, KIT_GRID_STATE_TOKEN, KIT_USER_APPLICATIONS_PATH, KIT_USER_IDENTITIES_STATE_TOKEN, KIT_USER_PATH, KIT_USER_PERMISSIONS_PATH, KIT_USER_PERMISSIONS_STATE_TOKEN, KIT_USER_STATE_TOKEN, KitAccountService, KitAutocompleteComponent, KitAutocompleteDirective, KitAvatarComponent, KitAvatarSize, KitBadgeDirective, KitBadgeTheme, KitBreadcrumbsComponent, KitBreadcrumbsService, KitButtonComponent, KitButtonIconPosition, KitButtonKind, KitButtonState, KitButtonType, KitCardComponent, KitCardDetailsComponent, KitCardTheme, KitCheckboxComponent, KitCheckboxState, KitCollapsedListComponent, KitCollapsedListDropdownAlign, KitCopyTextComponent, KitCtaPanelAbstractConfirmationComponent, KitCtaPanelActionComponent, KitCtaPanelConfirmationComponent, KitCtaPanelItemComponent, KitCtaPanelItemType, KitDataFieldComponent, KitDataFieldState, KitDatepickerComponent, KitDatepickerSize, KitDaterangeComponent, KitDaterangeType, KitDatetimepickerComponent, KitDialogActionsComponent, KitDialogComponent, KitDialogService, KitDialogTitlebarComponent, KitDialogType, KitDropdownComponent, KitDropdownItemTemplateDirective, KitDropdownSize, KitEmptySectionComponent, KitEntityGridComponent, KitEntitySectionComponent, KitEntitySectionContainerComponent, KitEntityTitleComponent, KitFileCardComponent, KitFileCardMessagesComponent, KitFileUploadComponent, KitFilterCheckboxComponent, KitFilterLogic, KitFilterOperator, KitFilterType, KitForbiddenComponent, KitGlobalSearchComponent, KitGridCellComponent, KitGridCellService, KitGridCellTemplateDirective, KitGridColumnComponent, KitGridColumnManagerComponent, KitGridComponent, KitGridDetailTemplateDirective, KitGridDetailsButtonComponent, KitGridExportComponent, KitGridFiltersComponent, KitGridSearchComponent, KitGridSortSettingsMode, KitGridState, KitGridUrlStateService, KitGridViewType, KitGridViewsComponent, KitGridViewsState, KitInputLabelComponent, KitInputMessageComponent, KitListComponent, KitLoaderComponent, KitLocationStepperComponent, KitMobileHeaderComponent, KitMobileMenuComponent, KitMobileMenuState, KitMultiselectComponent, KitNavigationMenuComponent, KitNavigationMenuService, KitNavigationMenuSubmenuComponent, KitNavigationTabsComponent, KitNavigationTabsType, KitNotFoundComponent, KitNoteComponent, KitNotificationComponent, KitNotificationService, KitNotificationType, KitNumericTextboxComponent, KitNumericTextboxSize, KitNumericTextboxState, KitOptionToggleComponent, KitPageLayoutComponent, KitPermissionDirective, KitPillComponent, KitPillTheme, KitPillType, KitPopupAlignHorizontal, KitPopupAlignVertical, KitPopupComponent, KitPopupPositionMode, KitProfileMenuComponent, KitQueryParamsName, KitQueryParamsService, KitRadioButtonComponent, KitRadioButtonType, KitRoutePathComponent, KitSchedulerComponent, KitSchedulerMonthEventTemplateDirective, KitSchedulerWeekEventTemplateDirective, KitScrollNavigationComponent, KitScrollNavigationSectionComponent, KitSearchBarComponent, KitSidebarComponent, KitSkeletonAnimation, KitSkeletonComponent, KitSkeletonShape, KitSortDirection, KitSortableComponent, KitSplitContainerComponent, KitStatusLabelColor, KitStatusLabelComponent, KitStatusLabelSize, KitSvgIcon, KitSvgIconComponent, KitSvgIconType, KitSvgSpriteComponent, KitSwitchComponent, KitSwitchMode, KitSwitchState, KitTabComponent, KitTabContentDirective, KitTabsComponent, KitTabsSize, KitTabsType, KitTextLabelComponent, KitTextLabelState, KitTextareaAutoresizeDirective, KitTextareaComponent, KitTextareaState, KitTextboxComponent, KitTextboxSize, KitTextboxState, KitThemeService, KitThemes, KitTileLayoutComponent, KitTileLayoutItemComponent, KitTimelineCardComponent, KitTimelineComponent, KitTimelineTheme, KitTimelineType, KitTimepickerComponent, KitTitleTemplateDirective, KitToastrModule, KitToastrPosition, KitToastrService, KitToastrType, KitToggleComponent, KitToggleSize, KitTooltipDirective, KitTooltipPosition, KitTopBarComponent, KitTrackingCardComponent, KitTrackingTimelineComponent, KitTranslateLoader, KitTranslateService, KitTruncateTextComponent, KitUnitsTextboxComponent, KitUnitsTextboxDropdownPosition, KitUnitsTextboxType, KitUserApplicationsState, KitUserIdentitiesInterceptor, KitUserIdentitiesSelector, KitUserIdentitiesState, KitUserPermissionsState, KitUserSettingsComponent, KitUserSettingsKeys, KitUserSettingsState, KitUserState, KitUserType, RemoveGridFilter, SetGridColumns, SetGridFilters, SetGridSearch, SetGridSkip, SetGridSort, SetGridTake, SetUserIdentity, UpdateGridFilter, buildRandomUUID, changeFilterField, createDataFetcherFactory, findMatches, kitBuildFilterBooleanOptions, kitBuildFilterListOptions, kitBuildFilters, kitBuildGridColumn, kitBuildGridDataResults, kitBuildOdataFilter, kitBuildSortString, kitDataStateToODataString, kitEncodeViewNameToUrl, kitExportExcel, kitGetPermissionTypesByCategory, kitHasPermission, kitUserPermissionsGuard, mapGlobalSearchResult, trimTrailingSlash };
|
|
9619
9630
|
//# sourceMappingURL=indigina-ui-kit.mjs.map
|