@nettyapps/ntybase 21.0.35-beta.19 → 21.0.35-beta.20
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Injectable, inject, NgModule,
|
|
2
|
+
import { Component, Injectable, inject, NgModule, input, computed, signal, output, linkedSignal, effect, ViewChild, model, Input, InjectionToken, Optional, Inject } from '@angular/core';
|
|
3
3
|
import * as i1$3 from '@angular/common/http';
|
|
4
4
|
import { HttpErrorResponse, HttpResponse, HTTP_INTERCEPTORS, HttpClient, HttpHeaders } from '@angular/common/http';
|
|
5
5
|
import { of, throwError, Subject, lastValueFrom, map, catchError as catchError$1, finalize, take as take$1, takeUntil } from 'rxjs';
|
|
@@ -422,6 +422,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
422
422
|
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: i1.MatDialog }, { type: i1$1.TranslateService }] });
|
|
423
423
|
|
|
424
424
|
class NettyAppsBase {
|
|
425
|
+
// ********************************************
|
|
426
|
+
// *** INPUTS ***
|
|
427
|
+
// ********************************************
|
|
428
|
+
embedded = input(false, ...(ngDevMode ? [{ debugName: "embedded" }] : [])); // Is the form embedded to an other component
|
|
429
|
+
_isEmbedded = computed(() => this.embedded() ?? false, ...(ngDevMode ? [{ debugName: "_isEmbedded" }] : []));
|
|
425
430
|
// ---------------------------------
|
|
426
431
|
// --- SERVICES ---
|
|
427
432
|
// ---------------------------------
|
|
@@ -537,12 +542,12 @@ class NettyAppsBase {
|
|
|
537
542
|
this.onDestroy$.complete();
|
|
538
543
|
}
|
|
539
544
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
540
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
545
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAppsBase, isStandalone: true, selector: "ntybase-netty-apps-base", inputs: { embedded: { classPropertyName: "embedded", publicName: "embedded", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: ``, isInline: true });
|
|
541
546
|
}
|
|
542
547
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsBase, decorators: [{
|
|
543
548
|
type: Component,
|
|
544
549
|
args: [{ selector: 'ntybase-netty-apps-base', imports: [], template: `` }]
|
|
545
|
-
}] });
|
|
550
|
+
}], propDecorators: { embedded: [{ type: i0.Input, args: [{ isSignal: true, alias: "embedded", required: false }] }] } });
|
|
546
551
|
|
|
547
552
|
class NettyHelper {
|
|
548
553
|
/**
|
|
@@ -1253,14 +1258,17 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1253
1258
|
// ********************************************
|
|
1254
1259
|
// *** INPUTS ***
|
|
1255
1260
|
// ********************************************
|
|
1256
|
-
readOnly = signal(true, ...(ngDevMode ? [{ debugName: "readOnly" }] : [])); // Is the form in readonly mode
|
|
1257
1261
|
popupFilterValid = input(false, ...(ngDevMode ? [{ debugName: "popupFilterValid" }] : [])); // Is the popup filter valid
|
|
1258
1262
|
popupValid = input(false, ...(ngDevMode ? [{ debugName: "popupValid" }] : [])); // Is the form in popup mode
|
|
1259
|
-
isEmbedded = input(false, ...(ngDevMode ? [{ debugName: "isEmbedded" }] : [])); // Is the form embedded to an other component
|
|
1260
1263
|
// Parameters passed when the component is embeded into an other
|
|
1261
1264
|
componantParameterGUID = input('', ...(ngDevMode ? [{ debugName: "componantParameterGUID" }] : [])); // GUID of the parameter
|
|
1262
1265
|
componantParameterType = input('', ...(ngDevMode ? [{ debugName: "componantParameterType" }] : [])); // Type of the parameter (Field Name)
|
|
1263
1266
|
// ********************************************
|
|
1267
|
+
// *** Computed ***
|
|
1268
|
+
// ********************************************
|
|
1269
|
+
_isPopupFilterValid = computed(() => this.popupFilterValid() ?? false, ...(ngDevMode ? [{ debugName: "_isPopupFilterValid" }] : []));
|
|
1270
|
+
_isPopupValid = computed(() => this.popupValid() ?? false, ...(ngDevMode ? [{ debugName: "_isPopupValid" }] : []));
|
|
1271
|
+
// ********************************************
|
|
1264
1272
|
// *** EVENTS ***
|
|
1265
1273
|
// ********************************************
|
|
1266
1274
|
/*
|
|
@@ -1288,6 +1296,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1288
1296
|
// Authentication
|
|
1289
1297
|
authenticationList = [];
|
|
1290
1298
|
// User access writes
|
|
1299
|
+
readOnly = signal(true, ...(ngDevMode ? [{ debugName: "readOnly" }] : [])); // Is the form in readonly mode
|
|
1291
1300
|
accessRightsProcessed = signal(false, ...(ngDevMode ? [{ debugName: "accessRightsProcessed" }] : []));
|
|
1292
1301
|
allowAdd = signal(false, ...(ngDevMode ? [{ debugName: "allowAdd" }] : []));
|
|
1293
1302
|
allowEdit = signal(false, ...(ngDevMode ? [{ debugName: "allowEdit" }] : []));
|
|
@@ -1335,7 +1344,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1335
1344
|
if (this.searchValue() && this.gridApi) {
|
|
1336
1345
|
this.gridApi.setGridOption('quickFilterText', this.searchValue());
|
|
1337
1346
|
if (this.recordList == undefined || this.recordList.length == 0) {
|
|
1338
|
-
if (this.
|
|
1347
|
+
if (this._isEmbedded()) {
|
|
1339
1348
|
this.alertService.showWarning('@recordNotFoundSearch');
|
|
1340
1349
|
}
|
|
1341
1350
|
}
|
|
@@ -1506,7 +1515,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1506
1515
|
this.nettyAgGridService.setAgGridTranslations(this.gridApi);
|
|
1507
1516
|
}
|
|
1508
1517
|
initAgGrid_extension() {
|
|
1509
|
-
if (this.allowEdit() == false &&
|
|
1518
|
+
if (this.allowEdit() == false && this._isPopupValid() == false) {
|
|
1510
1519
|
this.columnDefs().pop();
|
|
1511
1520
|
this.columnDefs().shift();
|
|
1512
1521
|
this.columnDefs().unshift({
|
|
@@ -1517,10 +1526,10 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1517
1526
|
});
|
|
1518
1527
|
this.gridApi.setGridOption('rowSelection', { mode: 'multiRow', checkboxes: true });
|
|
1519
1528
|
}
|
|
1520
|
-
if (this.
|
|
1529
|
+
if (this._isPopupValid() == true) {
|
|
1521
1530
|
this.columnDefs().pop();
|
|
1522
1531
|
this.columnDefs().shift();
|
|
1523
|
-
if (this.
|
|
1532
|
+
if (this._isPopupFilterValid() == true) {
|
|
1524
1533
|
if (this.allowEdit()) {
|
|
1525
1534
|
this.columnDefs().unshift({
|
|
1526
1535
|
headerName: '', sortable: false, resizable: false, filter: false,
|
|
@@ -1596,15 +1605,15 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1596
1605
|
var fields = this.columnDefs()
|
|
1597
1606
|
.filter((columnDef) => columnDef.ntyEmbeddedHide == 'x')
|
|
1598
1607
|
.map((columnDef) => columnDef.field);
|
|
1599
|
-
this.gridApi?.setColumnsVisible(fields, !this.
|
|
1608
|
+
this.gridApi?.setColumnsVisible(fields, !this._isEmbedded());
|
|
1600
1609
|
}
|
|
1601
1610
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridBase, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1602
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridBase, isStandalone: true, selector: "ntybase-ag-grid-base", inputs: { popupFilterValid: { classPropertyName: "popupFilterValid", publicName: "popupFilterValid", isSignal: true, isRequired: false, transformFunction: null }, popupValid: { classPropertyName: "popupValid", publicName: "popupValid", isSignal: true, isRequired: false, transformFunction: null },
|
|
1611
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridBase, isStandalone: true, selector: "ntybase-ag-grid-base", inputs: { popupFilterValid: { classPropertyName: "popupFilterValid", publicName: "popupFilterValid", isSignal: true, isRequired: false, transformFunction: null }, popupValid: { classPropertyName: "popupValid", publicName: "popupValid", isSignal: true, isRequired: false, transformFunction: null }, componantParameterGUID: { classPropertyName: "componantParameterGUID", publicName: "componantParameterGUID", isSignal: true, isRequired: false, transformFunction: null }, componantParameterType: { classPropertyName: "componantParameterType", publicName: "componantParameterType", isSignal: true, isRequired: false, transformFunction: null }, agGridSelectionMode: { classPropertyName: "agGridSelectionMode", publicName: "agGridSelectionMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onElementSelect: "onElementSelect", selectedElement: "selectedElement" }, host: { attributes: { "ntybase-id": "NettyAgGridBase" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
1603
1612
|
}
|
|
1604
1613
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridBase, decorators: [{
|
|
1605
1614
|
type: Component,
|
|
1606
1615
|
args: [{ selector: 'ntybase-ag-grid-base', imports: [], template: ``, host: { 'ntybase-id': 'NettyAgGridBase' } }]
|
|
1607
|
-
}], propDecorators: { popupFilterValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupFilterValid", required: false }] }], popupValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupValid", required: false }] }],
|
|
1616
|
+
}], propDecorators: { popupFilterValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupFilterValid", required: false }] }], popupValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupValid", required: false }] }], componantParameterGUID: [{ type: i0.Input, args: [{ isSignal: true, alias: "componantParameterGUID", required: false }] }], componantParameterType: [{ type: i0.Input, args: [{ isSignal: true, alias: "componantParameterType", required: false }] }], onElementSelect: [{ type: i0.Output, args: ["onElementSelect"] }], selectedElement: [{ type: i0.Output, args: ["selectedElement"] }], agGridSelectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "agGridSelectionMode", required: false }] }] } });
|
|
1608
1617
|
|
|
1609
1618
|
class ButtonRenderer {
|
|
1610
1619
|
params = null;
|
|
@@ -1761,10 +1770,11 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1761
1770
|
// ********************************************
|
|
1762
1771
|
// Filter section
|
|
1763
1772
|
hasFilter = input(true, ...(ngDevMode ? [{ debugName: "hasFilter" }] : [])); // Does the component have a filter
|
|
1773
|
+
_hasFilter = computed(() => this.hasFilter() ?? false, ...(ngDevMode ? [{ debugName: "_hasFilter" }] : []));
|
|
1764
1774
|
isFilterValid = signal(true, ...(ngDevMode ? [{ debugName: "isFilterValid" }] : [])); // Can the filter be used
|
|
1765
1775
|
isFilterExpanded = linkedSignal({ ...(ngDevMode ? { debugName: "isFilterExpanded" } : {}), source: () => ({
|
|
1766
|
-
embedded: this.
|
|
1767
|
-
hasFilter: this.
|
|
1776
|
+
embedded: this._isEmbedded(),
|
|
1777
|
+
hasFilter: this._hasFilter(),
|
|
1768
1778
|
valid: this.isFilterValid(),
|
|
1769
1779
|
}),
|
|
1770
1780
|
computation: (s) => {
|
|
@@ -1810,7 +1820,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1810
1820
|
if (savedSearchValue) {
|
|
1811
1821
|
this.searchValue.set(savedSearchValue);
|
|
1812
1822
|
}
|
|
1813
|
-
if (!this.
|
|
1823
|
+
if (!this._hasFilter()) {
|
|
1814
1824
|
this.loadData();
|
|
1815
1825
|
}
|
|
1816
1826
|
// Load user grid preferences
|
|
@@ -1828,7 +1838,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1828
1838
|
}
|
|
1829
1839
|
return null;
|
|
1830
1840
|
}
|
|
1831
|
-
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this.
|
|
1841
|
+
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this._isEmbedded()) {
|
|
1832
1842
|
const baseHref = this.environment.getBaseHref().endsWith('/')
|
|
1833
1843
|
? this.environment.getBaseHref().slice(0, -1) // Sondaki / işaretini kaldır
|
|
1834
1844
|
: this.environment.getBaseHref();
|
|
@@ -1966,7 +1976,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1966
1976
|
effect(() => { this.onElementSelect.emit(this.selectedRows()); });
|
|
1967
1977
|
// Manage filter expanded state
|
|
1968
1978
|
effect(() => {
|
|
1969
|
-
this.
|
|
1979
|
+
this._isEmbedded();
|
|
1970
1980
|
this.showHideEmbeddedColumnsAsync();
|
|
1971
1981
|
});
|
|
1972
1982
|
}
|
|
@@ -1991,7 +2001,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1991
2001
|
// *** Data Management Functions ***
|
|
1992
2002
|
// *********************************************************
|
|
1993
2003
|
loadData() {
|
|
1994
|
-
if (this.
|
|
2004
|
+
if (this._hasFilter()) {
|
|
1995
2005
|
this.setData([]);
|
|
1996
2006
|
return;
|
|
1997
2007
|
}
|
|
@@ -2079,8 +2089,6 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2079
2089
|
viewMode = signal('sidenav', ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
|
|
2080
2090
|
// Input signals
|
|
2081
2091
|
parameters = input('', ...(ngDevMode ? [{ debugName: "parameters" }] : []));
|
|
2082
|
-
embedded = input(false, ...(ngDevMode ? [{ debugName: "embedded" }] : []));
|
|
2083
|
-
isEmbedded = input(false, ...(ngDevMode ? [{ debugName: "isEmbedded" }] : []));
|
|
2084
2092
|
// ---------------------------------------------------
|
|
2085
2093
|
// --- RECORD LIST ---
|
|
2086
2094
|
// ---------------------------------------------------
|
|
@@ -2341,7 +2349,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2341
2349
|
// ***************************************************
|
|
2342
2350
|
// *** gotoURL Methods ***
|
|
2343
2351
|
// ***************************************************
|
|
2344
|
-
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this.
|
|
2352
|
+
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this._isEmbedded()) {
|
|
2345
2353
|
const baseHref = this.environment.getBaseHref().endsWith('/')
|
|
2346
2354
|
? this.environment.getBaseHref().slice(0, -1) // Sondaki / işaretini kaldır
|
|
2347
2355
|
: this.environment.getBaseHref();
|
|
@@ -2414,12 +2422,12 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2414
2422
|
]);
|
|
2415
2423
|
}
|
|
2416
2424
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridSaveBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2417
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridSaveBase, isStandalone: true, selector: "ntybase-ag-grid-save-base", inputs: { parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }
|
|
2425
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridSaveBase, isStandalone: true, selector: "ntybase-ag-grid-save-base", inputs: { parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "saveForm", first: true, predicate: ["saveForm"], descendants: true }], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
2418
2426
|
}
|
|
2419
2427
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridSaveBase, decorators: [{
|
|
2420
2428
|
type: Component,
|
|
2421
2429
|
args: [{ selector: 'ntybase-ag-grid-save-base', imports: [], template: `` }]
|
|
2422
|
-
}], ctorParameters: () => [], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }],
|
|
2430
|
+
}], ctorParameters: () => [], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], saveForm: [{
|
|
2423
2431
|
type: ViewChild,
|
|
2424
2432
|
args: ['saveForm']
|
|
2425
2433
|
}] } });
|