@seniorsistemas/angular-components 14.12.0 → 14.13.2
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/seniorsistemas-angular-components.umd.js +163 -39
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/table/table-paging/table-paging.component.d.ts +27 -0
- package/esm2015/components/dynamic-form/components/fields/chips/chips-field.component.js +2 -2
- package/esm2015/components/table/table-paging/table-paging.component.js +114 -0
- package/esm2015/components/table/table.module.js +11 -4
- package/esm2015/seniorsistemas-angular-components.js +38 -36
- package/esm5/components/dynamic-form/components/fields/chips/chips-field.component.js +2 -2
- package/esm5/components/table/table-paging/table-paging.component.js +125 -0
- package/esm5/components/table/table.module.js +11 -4
- package/esm5/seniorsistemas-angular-components.js +38 -36
- package/fesm2015/seniorsistemas-angular-components.js +116 -5
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +128 -6
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.d.ts +37 -35
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __spread, __assign, __decorate, __extends, __values, __param,
|
|
1
|
+
import { __spread, __assign, __decorate, __extends, __values, __param, __awaiter, __generator, __read } from 'tslib';
|
|
2
2
|
import { Input, Component, NgModule, EventEmitter, HostBinding, Output, ViewChild, Renderer2, HostListener, Directive, Injectable, Pipe, forwardRef, ViewEncapsulation, TemplateRef, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, ElementRef, InjectionToken, Inject, ContentChild, ApplicationRef, Injector, ContentChildren } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
@@ -4183,6 +4183,124 @@ var TokenListModule = /** @class */ (function () {
|
|
|
4183
4183
|
return TokenListModule;
|
|
4184
4184
|
}());
|
|
4185
4185
|
|
|
4186
|
+
var TablePagingComponent = /** @class */ (function () {
|
|
4187
|
+
function TablePagingComponent(translate, hostProjectConfigs) {
|
|
4188
|
+
this.translate = translate;
|
|
4189
|
+
this.hostProjectConfigs = hostProjectConfigs;
|
|
4190
|
+
}
|
|
4191
|
+
TablePagingComponent.prototype.ngOnChanges = function (changes) {
|
|
4192
|
+
this.totalRecordsText = this.translate.instant(this.getTranslatePrefix() + "total_records", {
|
|
4193
|
+
value: changes.totalRecords.currentValue
|
|
4194
|
+
});
|
|
4195
|
+
};
|
|
4196
|
+
TablePagingComponent.prototype.getTranslatePrefix = function () {
|
|
4197
|
+
return this.hostProjectConfigs.domain + "." + this.hostProjectConfigs.service + ".";
|
|
4198
|
+
};
|
|
4199
|
+
TablePagingComponent.prototype.getTooltipText = function () {
|
|
4200
|
+
return this.translate.instant(this.getTranslatePrefix() + "export_to_csv");
|
|
4201
|
+
};
|
|
4202
|
+
TablePagingComponent.prototype.getActions = function () {
|
|
4203
|
+
var _this = this;
|
|
4204
|
+
var actions = [
|
|
4205
|
+
{
|
|
4206
|
+
id: "exportCurrentPage",
|
|
4207
|
+
label: this.translate.instant(this.getTranslatePrefix() + "export_current_page"),
|
|
4208
|
+
command: function () { return _this.exportCurrentPage(); }
|
|
4209
|
+
},
|
|
4210
|
+
{
|
|
4211
|
+
id: "exportSelected",
|
|
4212
|
+
label: this.translate.instant(this.getTranslatePrefix() + "export_selected_records"),
|
|
4213
|
+
command: function () { return _this.exportSelectedRecords(); }
|
|
4214
|
+
}
|
|
4215
|
+
];
|
|
4216
|
+
if (this.loadAllRecords) {
|
|
4217
|
+
actions.push({
|
|
4218
|
+
id: "exportAll",
|
|
4219
|
+
label: this.translate.instant(this.getTranslatePrefix() + "export_all_records"),
|
|
4220
|
+
command: function () { return _this.exportAllRecords(); }
|
|
4221
|
+
});
|
|
4222
|
+
}
|
|
4223
|
+
return actions;
|
|
4224
|
+
};
|
|
4225
|
+
TablePagingComponent.prototype.validateComponent = function () {
|
|
4226
|
+
if (!this.table) {
|
|
4227
|
+
throw new Error("Table component not defined");
|
|
4228
|
+
}
|
|
4229
|
+
};
|
|
4230
|
+
TablePagingComponent.prototype.getColumnsToExport = function () {
|
|
4231
|
+
return __spread(this.table.columns).map(function (column) {
|
|
4232
|
+
if (column.exportable === null || column.exportable === undefined) {
|
|
4233
|
+
column.exportable = true;
|
|
4234
|
+
}
|
|
4235
|
+
return column;
|
|
4236
|
+
});
|
|
4237
|
+
};
|
|
4238
|
+
TablePagingComponent.prototype.getRowsToExport = function () {
|
|
4239
|
+
return this.table.value;
|
|
4240
|
+
};
|
|
4241
|
+
TablePagingComponent.prototype.getSelectedRowsToExport = function () {
|
|
4242
|
+
return this.table.selection;
|
|
4243
|
+
};
|
|
4244
|
+
TablePagingComponent.prototype.getExportFileName = function () {
|
|
4245
|
+
var _a;
|
|
4246
|
+
var fileName = (_a = this.exportFileName) !== null && _a !== void 0 ? _a : "download";
|
|
4247
|
+
var currentDate = moment_(new Date()).format("DD-MM-YYYY[_]HH:mm");
|
|
4248
|
+
return fileName + "_" + currentDate;
|
|
4249
|
+
};
|
|
4250
|
+
TablePagingComponent.prototype.exportCurrentPage = function () {
|
|
4251
|
+
this.validateComponent();
|
|
4252
|
+
ExportUtils.exportCSV(this.getColumnsToExport(), this.getRowsToExport(), undefined, this.getExportFileName());
|
|
4253
|
+
};
|
|
4254
|
+
TablePagingComponent.prototype.exportSelectedRecords = function () {
|
|
4255
|
+
this.validateComponent();
|
|
4256
|
+
ExportUtils.exportCSV(this.getColumnsToExport(), this.getSelectedRowsToExport(), undefined, this.getExportFileName());
|
|
4257
|
+
};
|
|
4258
|
+
TablePagingComponent.prototype.exportAllRecords = function () {
|
|
4259
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4260
|
+
var data;
|
|
4261
|
+
return __generator(this, function (_a) {
|
|
4262
|
+
switch (_a.label) {
|
|
4263
|
+
case 0:
|
|
4264
|
+
this.validateComponent();
|
|
4265
|
+
return [4 /*yield*/, this.loadAllRecords()];
|
|
4266
|
+
case 1:
|
|
4267
|
+
data = _a.sent();
|
|
4268
|
+
ExportUtils.exportCSV(this.getColumnsToExport(), data, undefined, this.getExportFileName());
|
|
4269
|
+
return [2 /*return*/];
|
|
4270
|
+
}
|
|
4271
|
+
});
|
|
4272
|
+
});
|
|
4273
|
+
};
|
|
4274
|
+
TablePagingComponent.ctorParameters = function () { return [
|
|
4275
|
+
{ type: TranslateService },
|
|
4276
|
+
{ type: undefined, decorators: [{ type: Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
4277
|
+
]; };
|
|
4278
|
+
__decorate([
|
|
4279
|
+
Input()
|
|
4280
|
+
], TablePagingComponent.prototype, "totalRecords", void 0);
|
|
4281
|
+
__decorate([
|
|
4282
|
+
Input()
|
|
4283
|
+
], TablePagingComponent.prototype, "exportFileName", void 0);
|
|
4284
|
+
__decorate([
|
|
4285
|
+
Input()
|
|
4286
|
+
], TablePagingComponent.prototype, "table", void 0);
|
|
4287
|
+
__decorate([
|
|
4288
|
+
Input()
|
|
4289
|
+
], TablePagingComponent.prototype, "loadAllRecords", void 0);
|
|
4290
|
+
__decorate([
|
|
4291
|
+
Output()
|
|
4292
|
+
], TablePagingComponent.prototype, "totalRecordsText", void 0);
|
|
4293
|
+
TablePagingComponent = __decorate([
|
|
4294
|
+
Component({
|
|
4295
|
+
template: "<div class=\"paging-container\">\n <span class=\"total-records\">\n {{totalRecordsText}}\n </span>\n <s-button class=\"export-button\" \n priority=\"default\" \n iconClass=\"fa fa-fw fa-file-export\" \n [disabled]=\"false\" \n [auxiliary]=\"true\" \n [tooltip]=\"getTooltipText()\" \n [model]=\"getActions()\"></s-button>\n</div>\n",
|
|
4296
|
+
selector: "s-table-paging",
|
|
4297
|
+
styles: [".paging-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.export-button{margin-left:6px}"]
|
|
4298
|
+
}),
|
|
4299
|
+
__param(1, Inject(HostProjectConfigsInjectionToken))
|
|
4300
|
+
], TablePagingComponent);
|
|
4301
|
+
return TablePagingComponent;
|
|
4302
|
+
}());
|
|
4303
|
+
|
|
4186
4304
|
var TableModule = /** @class */ (function () {
|
|
4187
4305
|
function TableModule() {
|
|
4188
4306
|
}
|
|
@@ -4191,19 +4309,23 @@ var TableModule = /** @class */ (function () {
|
|
|
4191
4309
|
imports: [
|
|
4192
4310
|
CommonModule,
|
|
4193
4311
|
TooltipModule,
|
|
4194
|
-
TokenListModule
|
|
4312
|
+
TokenListModule,
|
|
4313
|
+
TranslateModule,
|
|
4314
|
+
ButtonModule
|
|
4195
4315
|
],
|
|
4196
4316
|
exports: [
|
|
4197
4317
|
RowTogllerDirective,
|
|
4198
4318
|
NavigationDirective,
|
|
4199
4319
|
TableColumnsComponent,
|
|
4200
|
-
TableFrozenPositionDirective
|
|
4320
|
+
TableFrozenPositionDirective,
|
|
4321
|
+
TablePagingComponent
|
|
4201
4322
|
],
|
|
4202
4323
|
declarations: [
|
|
4203
4324
|
RowTogllerDirective,
|
|
4204
4325
|
NavigationDirective,
|
|
4205
4326
|
TableColumnsComponent,
|
|
4206
|
-
TableFrozenPositionDirective
|
|
4327
|
+
TableFrozenPositionDirective,
|
|
4328
|
+
TablePagingComponent
|
|
4207
4329
|
],
|
|
4208
4330
|
})
|
|
4209
4331
|
], TableModule);
|
|
@@ -4281,7 +4403,7 @@ var ChipsFieldComponent = /** @class */ (function () {
|
|
|
4281
4403
|
], ChipsFieldComponent.prototype, "formControl", void 0);
|
|
4282
4404
|
ChipsFieldComponent = __decorate([
|
|
4283
4405
|
Component({
|
|
4284
|
-
template: "<p-chips\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\"\n
|
|
4406
|
+
template: "<p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n</p-chips>\n\n<p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n</p-chips>\n"
|
|
4285
4407
|
})
|
|
4286
4408
|
], ChipsFieldComponent);
|
|
4287
4409
|
return ChipsFieldComponent;
|
|
@@ -8800,5 +8922,5 @@ var CodeEditorModule = /** @class */ (function () {
|
|
|
8800
8922
|
* Generated bundle index. Do not edit.
|
|
8801
8923
|
*/
|
|
8802
8924
|
|
|
8803
|
-
export { AngularComponentsModule, AutocompleteField, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, ProductHeaderComponent, ProductHeaderModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TokenListComponent, TokenListModule, ValidateErrors, LocalizedCurrencyImpurePipe as ɵa, LocalizedBignumberPipe as ɵb,
|
|
8925
|
+
export { AngularComponentsModule, AutocompleteField, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, ProductHeaderComponent, ProductHeaderModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TokenListComponent, TokenListModule, ValidateErrors, LocalizedCurrencyImpurePipe as ɵa, LocalizedBignumberPipe as ɵb, TextAreaFieldComponent as ɵba, TextFieldComponent as ɵbb, DecimalField as ɵbd, StructureModule as ɵbe, HeaderComponent as ɵbf, FooterComponent as ɵbg, InfoSignComponent as ɵbh, NumberLocaleOptions as ɵbi, ThumbnailService as ɵbj, InfiniteScrollModule as ɵbk, InfiniteScrollDirective as ɵbl, CustomTranslationsModule as ɵbm, CodeEditorComponent as ɵbn, CoreFacade as ɵbo, CodeMirror6Core as ɵbp, LocalizedBignumberImpurePipe as ɵc, TokenListModule as ɵd, ButtonModule as ɵe, TableColumnsComponent as ɵf, TablePagingComponent as ɵg, InfoSignModule as ɵh, MouseEventsModule as ɵi, AutocompleteFieldComponent as ɵj, BooleanFieldComponent as ɵk, CalendarFieldComponent as ɵl, ChipsFieldComponent as ɵm, CurrencyFieldComponent as ɵn, BaseFieldComponent as ɵo, DynamicFieldComponent as ɵp, DynamicFormDirective as ɵq, FieldsetComponent as ɵr, FileUploadComponent$1 as ɵs, LookupFieldComponent as ɵt, NumberFieldComponent as ɵu, BignumberFieldComponent as ɵv, RadioButtonComponent as ɵw, RowComponent as ɵx, SectionComponent as ɵy, SelectFieldComponent as ɵz };
|
|
8804
8926
|
//# sourceMappingURL=seniorsistemas-angular-components.js.map
|