ontimize-web-ngx
Version:
Ontimize Web framework using Angular 15
895 lines • 129 kB
JavaScript
import { __decorate, __metadata } from "tslib";
import { SelectionModel } from '@angular/cdk/collections';
import { Directive, ElementRef, EventEmitter, forwardRef, Injector, NgZone, ViewChild } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { BehaviorSubject } from 'rxjs';
import { OSearchInputComponent } from '../components/input/search-input/o-search-input.component';
import { BooleanConverter, BooleanInputConverter } from '../decorators/input-converter';
import { OFormLayoutDialogComponent } from '../layouts/form-layout/dialog/o-form-layout-dialog.component';
import { OFormLayoutManagerComponent } from '../layouts/form-layout/o-form-layout-manager.component';
import { NavigationService } from '../services/navigation.service';
import { PermissionsService } from '../services/permissions/permissions.service';
import { OTranslateService } from '../services/translate/o-translate.service';
import { O_GLOBAL_CONFIG } from '../types/o-global-config.type';
import { ObservableWrapper } from '../util/async';
import { Codes } from '../util/codes';
import { FilterExpressionUtils } from '../util/filter-expression.utils';
import { PermissionsUtils } from '../util/permissions';
import { Util } from '../util/util';
import { OFormComponent } from './form/o-form.component';
import { AbstractOServiceBaseComponent, DEFAULT_INPUTS_O_SERVICE_BASE_COMPONENT } from './o-service-base-component.class';
import { OFormLayoutManagerService } from '../services/o-form-layout-manager.service';
import * as i0 from "@angular/core";
import * as i1 from "./form/o-form.component";
export const DEFAULT_INPUTS_O_SERVICE_COMPONENT = [
...DEFAULT_INPUTS_O_SERVICE_BASE_COMPONENT,
'_title: title',
'ovisible: visible',
'oenabled: enabled',
'controls',
'detailMode: detail-mode',
'detailFormRoute: detail-form-route',
'recursiveDetail: recursive-detail',
'detailButtonInRow: detail-button-in-row',
'detailButtonInRowIcon: detail-button-in-row-icon',
'editFormRoute: edit-form-route',
'recursiveEdit: recursive-edit',
'editButtonInRow: edit-button-in-row',
'editButtonInRowIcon: edit-button-in-row-icon',
'insertButton: insert-button',
'rowHeight : row-height',
'insertFormRoute: insert-form-route',
'recursiveInsert: recursive-insert',
'filterCaseSensitive: filter-case-sensitive',
'quickFilter: quick-filter',
'quickFilterPlaceholder: quick-filter-placeholder',
'paginationControls: pagination-controls',
'pageSizeOptions: page-size-options',
'quickFilterAppearance:quick-filter-appearance',
'disablePageSizeCalculation: disable-page-size-calculation',
'initialFilterFunction: initial-filter-function',
'filterBuilderFunction: filter-builder-function'
];
export const DEFAULT_OUTPUTS_O_SERVICE_COMPONENT = [
'onClick',
'onDoubleClick',
'onDataLoaded',
'onPaginatedDataLoaded',
'onSearch'
];
export class AbstractOServiceComponent extends AbstractOServiceBaseComponent {
set title(val) {
this._title = val;
}
get title() {
if (Util.isDefined(this._title)) {
return this.translateService.get(this._title);
}
return this._title;
}
get pageSizeOptions() {
return this._pageSizeOptions;
}
set pageSizeOptions(val) {
if (!(val instanceof Array)) {
val = Util.parseArray(String(val)).map(a => parseInt(a, 10));
}
this._pageSizeOptions = val;
}
set rowHeight(value) {
this._rowHeight = value ? value.toLowerCase() : value;
if (!Codes.isValidRowHeight(this._rowHeight)) {
this._rowHeight = Codes.DEFAULT_ROW_HEIGHT;
}
this.rowHeightSubject.next(this._rowHeight);
}
get rowHeight() {
return this._rowHeight;
}
set filterCaseSensitive(value) {
this._filterCaseSensitive = BooleanConverter(value);
}
get filterCaseSensitive() {
return this._filterCaseSensitive;
}
get quickFilter() {
return this._quickFilter;
}
set quickFilter(val) {
val = Util.parseBoolean(String(val));
this._quickFilter = val;
if (val) {
setTimeout(() => this.registerQuickFilter(this.searchInputComponent), 0);
}
}
get selection() {
if (!Util.isDefined(this._selection)) {
this._selection = new SelectionModel(true, [], true, this.compareRow());
}
return this._selection;
}
constructor(injector, elRef, form) {
super(injector);
this.elRef = elRef;
this.form = form;
this.ovisible = true;
this.oenabled = true;
this.controls = true;
this.detailMode = Codes.DETAIL_MODE_CLICK;
this.recursiveDetail = false;
this.detailButtonInRow = false;
this.detailButtonInRowIcon = Codes.DETAIL_ICON;
this.recursiveEdit = false;
this.editButtonInRow = false;
this.editButtonInRowIcon = Codes.EDIT_ICON;
this.paginationControls = true;
this.disablePageSizeCalculation = false;
this._rowHeight = Codes.DEFAULT_ROW_HEIGHT;
this.rowHeightSubject = new BehaviorSubject(this._rowHeight);
this.rowHeightObservable = this.rowHeightSubject.asObservable();
this.checkViewPortSubject = new BehaviorSubject(false);
this.checkViewPortObservable = this.checkViewPortSubject.asObservable();
this.recursiveInsert = false;
this._filterCaseSensitive = false;
this._quickFilter = true;
this.quickFilterPlaceholder = '';
this.onClick = new EventEmitter();
this.onDoubleClick = new EventEmitter();
this.onDataLoaded = new EventEmitter();
this.onPaginatedDataLoaded = new EventEmitter();
this.onSearch = new EventEmitter();
this.dataResponseArray = [];
this._pageSizeOptions = Codes.PAGE_SIZE_OPTIONS;
this.clickDelay = 200;
this.clickPrevent = false;
this._quickFilterAppearance = 'outline';
this.mutationObservers = [];
this.enabledInsertButton = true;
this.enabledRefreshButton = true;
this._currentPage = 0;
this.permissionsService = this.injector.get(PermissionsService);
this.translateService = this.injector.get(OTranslateService);
this.navigationService = this.injector.get(NavigationService);
try {
this.formLayoutManager = this.injector.get(OFormLayoutManagerComponent);
}
catch (e) {
}
try {
this.oFormLayoutDialog = this.injector.get(OFormLayoutDialogComponent);
this.formLayoutManager = this.oFormLayoutDialog.formLayoutManager;
}
catch (e) {
}
this.getGlobalInjectionTokenConfig();
}
getGlobalInjectionTokenConfig() {
try {
const oGlobalConfig = this.injector.get(O_GLOBAL_CONFIG);
if (Util.isDefined(oGlobalConfig.storeState)) {
this.storeState = oGlobalConfig.storeState;
}
;
}
catch (error) {
}
}
initialize() {
super.initialize();
if (this.detailButtonInRow || this.editButtonInRow) {
this.detailMode = Codes.DETAIL_MODE_NONE;
}
}
afterViewInit() {
this.registerFormLayoutManagerState();
super.afterViewInit();
if (this.elRef) {
this.elRef.nativeElement.removeAttribute('title');
}
if (this.formLayoutManager && this.formLayoutManager.isMainComponent(this)) {
this.onTriggerUpdateSubscription = this.formLayoutManager.onTriggerUpdate.subscribe(() => {
this.reloadData();
});
}
}
destroy() {
super.destroy();
if (this.onTriggerUpdateSubscription) {
this.onTriggerUpdateSubscription.unsubscribe();
}
if (this.tabsSubscriptions) {
this.tabsSubscriptions.unsubscribe();
}
if (this.quickFilterSubscription) {
this.quickFilterSubscription.unsubscribe();
}
}
isVisible() {
return this.ovisible;
}
hasControls() {
return this.controls;
}
hasTitle() {
return this.title !== undefined;
}
getSelectedItems() {
return this.selection.selected;
}
clearSelection() {
this.selection.clear();
}
setSelected(item) {
if (Util.isDefined(item)) {
this.selection.toggle(item);
}
}
async navigateToDetail(route, qParams, relativeTo) {
const extras = {
relativeTo: relativeTo
};
let isFormLayoutActive = false;
if (this.formLayoutManager && this.formLayoutManager.isMainComponent(this)) {
qParams[Codes.IGNORE_CAN_DEACTIVATE] = this.formLayoutManager.ignoreCanDeactivate;
isFormLayoutActive = true;
this.formLayoutManager.setAsActiveFormLayoutManager();
}
extras[Codes.QUERY_PARAMS] = qParams;
this.router.navigate(route, extras).
then(() => {
if (!isFormLayoutActive) {
this.navigationService.isNavigating = false;
}
})
.catch((e) => {
console.error('Cannot match any routes. URL Segment: ', route, e);
this.navigationService.isNavigating = false;
});
}
insertDetail() {
if (this.oFormLayoutDialog) {
console.warn('Navigation is not available yet in a form layout manager with mode="dialog"');
return;
}
const route = this.getInsertRoute();
this.addFormLayoutManagerRoute(route);
if (route.length > 0) {
const relativeTo = this.recursiveInsert ? this.actRoute.parent : this.actRoute;
const qParams = {};
if (this.formLayoutManager && this.formLayoutManager.isTabMode()) {
qParams[Codes.INSERTION_MODE] = 'true';
}
this.navigateToDetail(route, qParams, relativeTo);
}
}
viewDetail(item, context) {
const formLayoutManagerService = this.injector.get(OFormLayoutManagerService);
formLayoutManagerService.context = void 0;
if (this.oFormLayoutDialog) {
console.warn('Navigation is not available yet in a form layout manager with mode="dialog"');
if (this.formLayoutManager.navigationService) {
this.formLayoutManager.navigationService.isNavigating = false;
}
return;
}
const zone = this.injector.get(NgZone);
zone.run(async () => {
const route = this.getItemModeRoute(item, 'detailFormRoute');
this.addFormLayoutManagerRoute(route);
if (route.length > 0) {
const qParams = Codes.getIsDetailObject();
const relativeTo = this.recursiveDetail ? this.actRoute.parent : this.actRoute;
if (!this.formLayoutManager?.isSplitPaneMode()) {
formLayoutManagerService.context = context;
}
await this.navigateToDetail(route, qParams, relativeTo);
}
});
}
editDetail(item) {
if (this.oFormLayoutDialog) {
console.warn('Navigation is not available yet in a form layout manager with mode="dialog"');
return;
}
const zone = this.injector.get(NgZone);
zone.run(async () => {
const route = this.getItemModeRoute(item, 'editFormRoute');
this.addFormLayoutManagerRoute(route);
if (route.length > 0) {
const qParams = Codes.getIsDetailObject();
const relativeTo = this.recursiveEdit ? this.actRoute.parent : this.actRoute;
await this.navigateToDetail(route, qParams, relativeTo);
}
});
}
addFormLayoutManagerRoute(routeArr) {
if (this.formLayoutManager && routeArr.length > 0) {
const compRoute = this.formLayoutManager.getRouteForComponent(this);
if (compRoute && compRoute.length > 0) {
routeArr.unshift(...compRoute);
}
}
return routeArr;
}
setButtonPermissions(actionsPermissions) {
if (Util.isDefined(actionsPermissions)) {
this.setPermission('insert', 'insertButton', 'enabledInsertButton', actionsPermissions);
this.setPermission('refresh', 'refreshButton', 'enabledRefreshButton', actionsPermissions);
this.setPermission('delete', 'deleteButton', 'enabledDeleteButton', actionsPermissions);
}
}
setPermission(attr, visibleProp, enabledProp, actionsPermissions) {
const perm = this.getPermissionByAttr(attr, actionsPermissions);
if (Util.isDefined(perm)) {
this[visibleProp] = perm.visible;
this[enabledProp] = perm.enabled;
}
}
manageCustomPermissions(actionsPermissions, selector) {
const customPermissions = actionsPermissions.filter(perm => !['insert', 'refresh', 'delete'].includes(perm.attr));
customPermissions.forEach(permission => {
this.managePermission(this.elRef, permission, this.mutationObservers, selector);
});
}
getActionsPermissions(permissions) {
return Util.isDefined(permissions) ? (permissions.actions || []) : [];
}
getPermissionByAttr(attr, actionsPermissions) {
return actionsPermissions.find((perm) => perm.attr === attr);
}
managePermission(elementRef, permission, mutationObservers, selector, attr) {
let elementByAction;
const attrAction = Util.isDefined(attr) ? attr : permission.attr;
const allElements = elementRef.nativeElement.querySelectorAll(selector);
allElements.forEach(element => {
if (element.getAttribute('attr') === attrAction) {
elementByAction = element;
}
});
if (Util.isDefined(elementByAction)) {
if (!permission.visible) {
elementByAction.remove();
}
else if (!permission.enabled) {
elementByAction.disabled = true;
const mutationObserver = PermissionsUtils.registerDisabledChangesInDom(elementByAction);
mutationObservers.push(mutationObserver);
}
}
}
getEncodedParentKeys() {
let encoded;
if (Object.keys(this._pKeysEquiv).length > 0) {
const pKeys = this.getParentKeysValues();
if (Object.keys(pKeys).length > 0) {
encoded = Util.encodeParentKeys(pKeys);
}
}
return encoded;
}
getInsertRoute() {
const route = [];
if (Util.isDefined(this.detailFormRoute)) {
route.push(this.detailFormRoute);
}
const insertRoute = Util.isDefined(this.insertFormRoute) ? this.insertFormRoute : Codes.DEFAULT_INSERT_ROUTE;
route.push(insertRoute);
const encodedParentKeys = this.getEncodedParentKeys();
if (Util.isDefined(encodedParentKeys)) {
const routeObj = {};
routeObj[Codes.PARENT_KEYS_KEY] = encodedParentKeys;
route.push(routeObj);
}
if (route.length > 0) {
this.storeNavigationFormRoutes('insertFormRoute');
}
return route;
}
getItemModeRoute(item, modeRoute) {
const result = this.getRouteOfSelectedRow(item);
if (result.length > 0) {
if (Util.isDefined(this.detailFormRoute)) {
result.unshift(this.detailFormRoute);
}
if (modeRoute === 'editFormRoute') {
result.push(this.editFormRoute || Codes.DEFAULT_EDIT_ROUTE);
}
}
if (result.length > 0 && !this.oFormLayoutDialog) {
this.storeNavigationFormRoutes(modeRoute, this.getQueryConfiguration());
}
return result;
}
getQueryConfiguration() {
let result = {
keysValues: this.getKeysValues()
};
if (this.pageable) {
result = Object.assign({
serviceType: this.serviceType,
queryArguments: this.queryArguments,
entity: this.entity,
service: this.service,
queryMethod: this.pageable ? this.paginatedQueryMethod : this.queryMethod,
totalRecordsNumber: this.getTotalRecordsNumber(),
queryRows: this.queryRows,
queryRecordOffset: Math.max(this.currentPage * this.queryRows, this.state.queryRecordOffset - this.queryRows)
}, result);
}
return result;
}
getRouteOfSelectedRow(item) {
const route = [];
if (Util.isObject(item)) {
this.keysArray.forEach(key => {
if (Util.isDefined(item[key])) {
route.push(item[key]);
}
});
}
return route;
}
deleteLocalItems() {
const selectedItems = this.getSelectedItems();
for (let i = 0; i < selectedItems.length; ++i) {
const selectedItem = selectedItems[i];
const selectedItemKv = {};
for (let k = 0; k < this.keysArray.length; ++k) {
const key = this.keysArray[k];
selectedItemKv[key] = selectedItem[key];
}
for (let j = this.dataArray.length - 1; j >= 0; --j) {
const item = this.dataArray[j];
const itemKv = {};
for (let k = 0; k < this.keysArray.length; ++k) {
const key = this.keysArray[k];
itemKv[key] = item[key];
}
let found = false;
for (const k in selectedItemKv) {
if (selectedItemKv.hasOwnProperty(k)) {
found = itemKv.hasOwnProperty(k) && (selectedItemKv[k] === itemKv[k]);
}
}
if (found) {
this.dataArray.splice(j, 1);
break;
}
}
}
this.clearSelection();
}
reinitialize(options) {
if (options && Object.keys(options).length) {
const clonedOpts = Object.assign({}, options);
if (clonedOpts.hasOwnProperty('entity')) {
this.entity = clonedOpts.entity;
if (this.oattrFromEntity) {
this.oattr = undefined;
}
delete clonedOpts.entity;
}
for (const prop in clonedOpts) {
if (clonedOpts.hasOwnProperty(prop)) {
this[prop] = clonedOpts[prop];
}
}
this.destroy();
this.initialize();
}
}
setFilterBuilder(filterBuilder) {
this.filterBuilder = filterBuilder;
}
getComponentFilter(existingFilter = {}) {
let filter = super.getComponentFilter(existingFilter);
const quickFilterExpr = this.getQuickFilterExpression();
const filterBuilderExpr = this.getFilterBuilderExpression();
const initialFilterExpr = this.initialFilterFunction ? this.initialFilterFunction() : undefined;
let complexExpr = quickFilterExpr || filterBuilderExpr;
if (quickFilterExpr && filterBuilderExpr) {
complexExpr = FilterExpressionUtils.buildComplexExpression(quickFilterExpr, filterBuilderExpr, FilterExpressionUtils.OP_AND);
}
if (initialFilterExpr) {
if (FilterExpressionUtils.instanceofExpression(initialFilterExpr)) {
complexExpr = complexExpr
? FilterExpressionUtils.buildComplexExpression(complexExpr, initialFilterExpr, FilterExpressionUtils.OP_AND)
: initialFilterExpr;
}
else {
filter = { ...filter, ...initialFilterExpr };
}
}
if (complexExpr && !Util.isDefined(filter[FilterExpressionUtils.BASIC_EXPRESSION_KEY])) {
filter[FilterExpressionUtils.BASIC_EXPRESSION_KEY] = complexExpr;
}
else if (complexExpr) {
filter[FilterExpressionUtils.BASIC_EXPRESSION_KEY] =
FilterExpressionUtils.buildComplexExpression(filter[FilterExpressionUtils.BASIC_EXPRESSION_KEY], complexExpr, FilterExpressionUtils.OP_AND);
}
return filter;
}
getQuickFilterExpression() {
if (this.pageable && Util.isDefined(this.quickFilterComponent)) {
return this.quickFilterComponent.filterExpression;
}
return undefined;
}
getFilterBuilderExpression() {
this.filterBuilder = this.filterBuilderFunction ? this.filterBuilderFunction() : this.filterBuilder;
if (Util.isDefined(this.filterBuilder)) {
return this.filterBuilder.getExpression();
}
return undefined;
}
storeNavigationFormRoutes(activeMode, queryConf) {
const mainFormLayoutComp = this.formLayoutManager ? Util.isDefined(this.formLayoutManager.isMainComponent(this)) : undefined;
this.navigationService.storeFormRoutes({
mainFormLayoutManagerComponent: mainFormLayoutComp,
isMainNavigationComponent: true,
detailFormRoute: this.detailFormRoute,
editFormRoute: this.editFormRoute,
insertFormRoute: Util.isDefined(this.insertFormRoute) ? this.insertFormRoute : Codes.DEFAULT_INSERT_ROUTE
}, activeMode, queryConf);
}
saveDataNavigationInLocalStorage() {
}
getKeysValues() {
const data = this.dataArray;
const self = this;
return data.map((row) => {
const obj = {};
self.keysArray.forEach((key) => {
if (row[key] !== undefined) {
obj[key] = row[key];
}
});
return obj;
});
}
getRouteKey() {
let route = '';
if (this.formLayoutManager && !this.formLayoutManager.isMainComponent(this)) {
route = this.router.url;
const params = this.formLayoutManager.getParams();
if (params) {
route += '/' + (Object.keys(params).join('/'));
}
}
else {
route = super.getRouteKey();
}
return route;
}
get elementRef() {
return this.elRef;
}
showCaseSensitiveCheckbox() {
return !this.pageable;
}
registerQuickFilter(arg) {
const quickFilter = arg;
if (Util.isDefined(this.quickFilterComponent)) {
return;
}
this.quickFilterComponent = quickFilter;
if (Util.isDefined(this.quickFilterComponent)) {
this.quickFilterSubscription = this.quickFilterComponent.onSearch.subscribe(val => {
this.onSearch.emit(val);
this.filterData(val);
});
if (Util.isDefined(this.state)) {
if ((this.state.quickFilterValue || '').length > 0) {
this.quickFilterComponent.setValue(this.state.quickFilterValue, {
emitEvent: true
});
}
}
}
}
isFilterCaseSensitive() {
const useQuickFilterValue = Util.isDefined(this.quickFilterComponent) && this.showCaseSensitiveCheckbox();
if (useQuickFilterValue) {
return this.quickFilterComponent.filterCaseSensitive;
}
return this.filterCaseSensitive;
}
configureFilterValue(value) {
let returnVal = value;
if (value && value.length > 0) {
if (!value.startsWith('*')) {
returnVal = '*' + returnVal;
}
if (!value.endsWith('*')) {
returnVal = returnVal + '*';
}
}
return returnVal;
}
getQuickFilterValue() {
const result = '';
if (Util.isDefined(this.quickFilterComponent)) {
return this.quickFilterComponent.getValue() || '';
}
return result;
}
getQuickFilterColumns() {
let result = this.quickFilterColArray;
if (Util.isDefined(this.quickFilterComponent)) {
result = this.quickFilterComponent.getActiveColumns();
}
return result;
}
filterData(value, loadMore) {
value = Util.isDefined(value) ? value : Util.isDefined(this.quickFilterComponent) ? this.quickFilterComponent.getValue() : void 0;
if (Util.isDefined(this.state) && Util.isDefined(value)) {
this.state.quickFilterValue = value;
}
if (this.pageable) {
const queryArgs = {
offset: 0,
length: this.queryRows,
replace: true
};
this.queryData(void 0, queryArgs);
return;
}
if (this.dataResponseArray && this.dataResponseArray.length > 0) {
let filteredData = this.dataResponseArray.slice(0);
filteredData = this.getQuickFilterDataFromArray(value, filteredData);
filteredData = this.getSortedDataFromArray(filteredData);
filteredData = this.getPaginationDataFromArray(filteredData);
this.setDataArray(filteredData);
}
else {
this.setDataArray(this.dataResponseArray);
}
}
getQuickFilterDataFromArray(quickfilter, dataArray) {
let result = dataArray;
if (quickfilter && quickfilter.length > 0) {
const caseSensitive = this.isFilterCaseSensitive();
const quickFilterColumns = this.getQuickFilterColumns();
const regExpStr = new RegExp(Util.escapeSpecialCharacter(Util.normalizeString(quickfilter, !caseSensitive)));
result = dataArray.filter(item => {
return quickFilterColumns.some(col => regExpStr.test(Util.normalizeString(item[col] + '', !caseSensitive)));
});
}
return result;
}
getSortedDataFromArray(dataArray) {
return dataArray;
}
setData(data, sqlTypes, replace) {
if (!Util.isArray(data)) {
this.setDataArray([]);
}
else {
this.dataResponseArray = this.parseResponseArray(data, replace);
if (this.pageable) {
this.setDataArray(this.dataResponseArray);
}
else {
this.filterData();
}
}
if (this.pageable) {
ObservableWrapper.callEmit(this.onPaginatedDataLoaded, data);
}
ObservableWrapper.callEmit(this.onDataLoaded, this.dataResponseArray);
}
parseResponseArray(data, replace) {
return data;
}
registerFormLayoutManagerState() {
if (this.storeState && this.formLayoutManager && this.formLayoutManager.isTabMode() && this.formLayoutManager.oTabGroup) {
if (!Util.isDefined(this.formLayoutManagerTabIndex)) {
this.formLayoutManagerTabIndex = this.formLayoutManager.oTabGroup.data.length;
}
const updateComponentStateSubject = this.formLayoutManager.oTabGroup.updateTabComponentsState;
this.tabsSubscriptions = this.formLayoutManager.onSelectedTabChange.subscribe((arg) => {
if (this.formLayoutManagerTabIndex === arg.previousIndex) {
this.updateStateStorage();
this.alreadyStored = false;
if (arg.index !== 0) {
updateComponentStateSubject.next(arg);
}
}
if (this.formLayoutManager.navigationService.isNavigating) {
arg.data.rendererSubject.next(true);
}
this.checkViewPortSubject.next(true);
});
this.tabsSubscriptions.add(updateComponentStateSubject.subscribe((arg) => {
if (this.formLayoutManagerTabIndex === arg.index) {
this.componentStateService.initialize(this);
this.applyDefaultConfiguration();
}
}));
this.tabsSubscriptions.add(this.formLayoutManager.onCloseTab.subscribe((arg) => {
if (this.formLayoutManagerTabIndex === arg.index) {
this.updateStateStorage();
}
}));
}
}
applyDefaultConfiguration() {
}
onChangePage(e) {
this.dataService?.setPaginationContext({ pageNumber: e.pageIndex, pageSize: e.pageSize });
if (!this.pageable) {
this.currentPage = e.pageIndex;
this.queryRows = e.pageSize;
this.filterData();
return;
}
const goingBack = e.pageIndex < this.currentPage;
this.currentPage = e.pageIndex;
const pageSize = e.pageSize;
const oldQueryRows = this.queryRows;
const changingPageSize = (oldQueryRows !== pageSize);
this.queryRows = pageSize;
let newStartRecord;
let queryLength;
if (goingBack || changingPageSize) {
newStartRecord = (this.currentPage * this.queryRows);
queryLength = this.queryRows;
}
else {
newStartRecord = Math.max(this.state.queryRecordOffset, (this.currentPage * this.queryRows));
const newEndRecord = Math.min(newStartRecord + this.queryRows, this.state.totalQueryRecordsNumber);
queryLength = this.disablePageSizeCalculation ? this.queryRows : Math.min(this.queryRows, newEndRecord - newStartRecord);
}
const queryArgs = {
offset: newStartRecord,
length: queryLength,
replace: true
};
this.queryData(void 0, queryArgs);
}
set currentPage(val) {
this._currentPage = val;
}
get currentPage() {
return this._currentPage;
}
get totalRecords() {
if (this.pageable) {
return this.getTotalRecordsNumber();
}
return this.dataResponseArray.length;
}
getPaginationDataFromArray(dataArray) {
let result = dataArray;
if (this.paginationControls) {
result = result.splice(this.currentPage * this.queryRows, this.queryRows);
}
return result;
}
handleItemClick(item) {
this.clickTimer = setTimeout(() => {
if (!this.clickPrevent) {
this.itemClickDone(item);
}
this.clickPrevent = false;
}, this.clickDelay);
}
itemClickDone(item) {
if (!this.oenabled) {
return;
}
const data = item.getItemData();
if (this.detailMode === Codes.DETAIL_MODE_CLICK) {
this.saveDataNavigationInLocalStorage();
this.viewDetail(data);
}
this.onClick.emit(data);
}
handleItemDblClick(item) {
clearTimeout(this.clickTimer);
this.clickPrevent = true;
this.itemDblClickDone(item);
}
itemDblClickDone(item) {
if (!this.oenabled) {
return;
}
const data = item.getItemData();
if (Codes.isDoubleClickMode(this.detailMode)) {
this.saveDataNavigationInLocalStorage();
this.viewDetail(data);
}
this.onDoubleClick.emit(data);
}
get quickFilterAppearance() {
return this._quickFilterAppearance;
}
set quickFilterAppearance(value) {
const values = ['fill', 'outline'];
if (values.indexOf(value) === -1) {
console.warn('The quick-filter-appearance attribute is undefined so the outline value will be used');
value = 'outline';
}
this._quickFilterAppearance = value;
}
getSqlTypesOfKeys() {
const sqlTypes = this.getSqlTypes();
const sqlTypesArg = {};
if (Util.isDefined(sqlTypes)) {
this.keysArray.forEach(key => {
sqlTypesArg[key] = sqlTypes[key];
});
}
return sqlTypesArg;
}
compareRow() {
return (o1, o2) => this.keysArray.every(key => o1[key] === o2[key]);
}
}
AbstractOServiceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AbstractOServiceComponent, deps: [{ token: i0.Injector }, { token: i0.ElementRef }, { token: i1.OFormComponent }], target: i0.ɵɵFactoryTarget.Directive });
AbstractOServiceComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: AbstractOServiceComponent, inputs: { oattr: ["attr", "oattr"], service: "service", serviceType: ["service-type", "serviceType"], entity: "entity", queryOnInit: ["query-on-init", "queryOnInit"], queryOnBind: ["query-on-bind", "queryOnBind"], queryOnEvent: ["query-on-event", "queryOnEvent"], pageable: "pageable", columns: "columns", keys: "keys", parentKeys: ["parent-keys", "parentKeys"], staticData: ["static-data", "staticData"], queryMethod: ["query-method", "queryMethod"], paginatedQueryMethod: ["paginated-query-method", "paginatedQueryMethod"], oQueryRows: ["query-rows", "oQueryRows"], insertMethod: ["insert-method", "insertMethod"], updateMethod: ["update-method", "updateMethod"], deleteMethod: ["delete-method", "deleteMethod"], storeState: ["store-state", "storeState"], queryWithNullParentKeys: ["query-with-null-parent-keys", "queryWithNullParentKeys"], queryFallbackFunction: ["query-fallback-function", "queryFallbackFunction"], configureServiceArgs: ["configure-service-args", "configureServiceArgs"], _title: ["title", "_title"], ovisible: ["visible", "ovisible"], oenabled: ["enabled", "oenabled"], controls: "controls", detailMode: ["detail-mode", "detailMode"], detailFormRoute: ["detail-form-route", "detailFormRoute"], recursiveDetail: ["recursive-detail", "recursiveDetail"], detailButtonInRow: ["detail-button-in-row", "detailButtonInRow"], detailButtonInRowIcon: ["detail-button-in-row-icon", "detailButtonInRowIcon"], editFormRoute: ["edit-form-route", "editFormRoute"], recursiveEdit: ["recursive-edit", "recursiveEdit"], editButtonInRow: ["edit-button-in-row", "editButtonInRow"], editButtonInRowIcon: ["edit-button-in-row-icon", "editButtonInRowIcon"], insertButton: ["insert-button", "insertButton"], rowHeight: ["row-height", "rowHeight"], insertFormRoute: ["insert-form-route", "insertFormRoute"], recursiveInsert: ["recursive-insert", "recursiveInsert"], filterCaseSensitive: ["filter-case-sensitive", "filterCaseSensitive"], quickFilter: ["quick-filter", "quickFilter"], quickFilterPlaceholder: ["quick-filter-placeholder", "quickFilterPlaceholder"], paginationControls: ["pagination-controls", "paginationControls"], pageSizeOptions: ["page-size-options", "pageSizeOptions"], quickFilterAppearance: ["quick-filter-appearance", "quickFilterAppearance"], disablePageSizeCalculation: ["disable-page-size-calculation", "disablePageSizeCalculation"], initialFilterFunction: ["initial-filter-function", "initialFilterFunction"], filterBuilderFunction: ["filter-builder-function", "filterBuilderFunction"] }, outputs: { onClick: "onClick", onDoubleClick: "onDoubleClick", onDataLoaded: "onDataLoaded", onPaginatedDataLoaded: "onPaginatedDataLoaded", onSearch: "onSearch" }, viewQueries: [{ propertyName: "matpaginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "searchInputComponent", first: true, predicate: i0.forwardRef(function () { return OSearchInputComponent; }), descendants: true }], usesInheritance: true, ngImport: i0 });
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "ovisible", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "oenabled", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "controls", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "recursiveDetail", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "detailButtonInRow", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "recursiveEdit", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "editButtonInRow", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "insertButton", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "paginationControls", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "disablePageSizeCalculation", void 0);
__decorate([
BooleanInputConverter(),
__metadata("design:type", Boolean)
], AbstractOServiceComponent.prototype, "recursiveInsert", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AbstractOServiceComponent, decorators: [{
type: Directive,
args: [{
inputs: DEFAULT_INPUTS_O_SERVICE_COMPONENT,
outputs: DEFAULT_OUTPUTS_O_SERVICE_COMPONENT
}]
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ElementRef }, { type: i1.OFormComponent }]; }, propDecorators: { matpaginator: [{
type: ViewChild,
args: [MatPaginator]
}], ovisible: [], oenabled: [], controls: [], recursiveDetail: [], detailButtonInRow: [], recursiveEdit: [], editButtonInRow: [], insertButton: [], paginationControls: [], disablePageSizeCalculation: [], recursiveInsert: [], searchInputComponent: [{
type: ViewChild,
args: [(forwardRef(() => OSearchInputComponent))]
}] } });
export class OServiceComponent extends AbstractOServiceComponent {
}
OServiceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OServiceComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
OServiceComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: OServiceComponent, usesInheritance: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OServiceComponent, decorators: [{
type: Directive
}] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiby1zZXJ2aWNlLWNvbXBvbmVudC5jbGFzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL29udGltaXplLXdlYi1uZ3gvc3JjL2xpYi9jb21wb25lbnRzL28tc2VydmljZS1jb21wb25lbnQuY2xhc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxZQUFZLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxNQUFNLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTdHLE9BQU8sRUFBRSxZQUFZLEVBQWEsTUFBTSw2QkFBNkIsQ0FBQztBQUV0RSxPQUFPLEVBQUUsZUFBZSxFQUE0QixNQUFNLE1BQU0sQ0FBQztBQUdqRSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSwyREFBMkQsQ0FBQztBQUNsRyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUscUJBQXFCLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUV4RixPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSw4REFBOEQsQ0FBQztBQUMxRyxPQUFPLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSx3REFBd0QsQ0FBQztBQUVyRyxPQUFPLE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