@nettyapps/ntybase 21.0.35-beta.2 → 21.0.35-beta.21
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,12 +1,12 @@
|
|
|
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';
|
|
6
6
|
import { catchError, map as map$1, take, finalize as finalize$1 } from 'rxjs/operators';
|
|
7
7
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
8
8
|
import * as i2$1 from '@nettyapps/ntycontract';
|
|
9
|
-
import { EnvironmentProxy, injectNettyStandardProxy, injectNettyStandardLogProxy } from '@nettyapps/ntycontract';
|
|
9
|
+
import { EnvironmentProxy, injectNettyStandardProxy, injectNettyStandardLogProxy, injectNettyStandardFilterProxy } from '@nettyapps/ntycontract';
|
|
10
10
|
import { DatePipe, CommonModule, Location, DecimalPipe } from '@angular/common';
|
|
11
11
|
import { Buffer } from 'buffer';
|
|
12
12
|
import * as i1 from '@angular/material/dialog';
|
|
@@ -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,10 +1258,25 @@ 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
|
-
|
|
1263
|
+
// Parameters passed when the component is embeded into an other
|
|
1264
|
+
componantParameterGUID = input('', ...(ngDevMode ? [{ debugName: "componantParameterGUID" }] : [])); // GUID of the parameter
|
|
1265
|
+
componantParameterType = input('', ...(ngDevMode ? [{ debugName: "componantParameterType" }] : [])); // Type of the parameter (Field Name)
|
|
1266
|
+
// ********************************************
|
|
1267
|
+
// *** Computed ***
|
|
1268
|
+
// ********************************************
|
|
1269
|
+
_isPopupFilterValid = computed(() => this.popupFilterValid() ?? false, ...(ngDevMode ? [{ debugName: "_isPopupFilterValid" }] : []));
|
|
1270
|
+
_isPopupValid = computed(() => this.popupValid() ?? false, ...(ngDevMode ? [{ debugName: "_isPopupValid" }] : []));
|
|
1271
|
+
// ********************************************
|
|
1272
|
+
// *** EVENTS ***
|
|
1273
|
+
// ********************************************
|
|
1274
|
+
/*
|
|
1275
|
+
Selected records event
|
|
1276
|
+
@param records: Array of selected records
|
|
1277
|
+
*/
|
|
1278
|
+
onElementSelect = output(); // Emit selected records when updated
|
|
1279
|
+
selectedElement = output(); // Selected element in popup mode
|
|
1260
1280
|
// Component identifiers
|
|
1261
1281
|
componentName = signal('Invalid', ...(ngDevMode ? [{ debugName: "componentName" }] : []));
|
|
1262
1282
|
searchValueName = signal('Invalid_searchValue', ...(ngDevMode ? [{ debugName: "searchValueName" }] : []));
|
|
@@ -1270,9 +1290,13 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1270
1290
|
commonService = inject(CommonService);
|
|
1271
1291
|
sysFunctionProxy = inject(SysfunctionProxy);
|
|
1272
1292
|
environment = inject(EnvironmentProxy);
|
|
1293
|
+
// Button action management variables
|
|
1294
|
+
menuValid = signal(true, ...(ngDevMode ? [{ debugName: "menuValid" }] : [])); // true: Filter editbox is not visible so the menus are visible
|
|
1295
|
+
refreshButtonValid = signal(false, ...(ngDevMode ? [{ debugName: "refreshButtonValid" }] : [])); // true: Refresh button is enabled
|
|
1273
1296
|
// Authentication
|
|
1274
1297
|
authenticationList = [];
|
|
1275
1298
|
// User access writes
|
|
1299
|
+
readOnly = signal(true, ...(ngDevMode ? [{ debugName: "readOnly" }] : [])); // Is the form in readonly mode
|
|
1276
1300
|
accessRightsProcessed = signal(false, ...(ngDevMode ? [{ debugName: "accessRightsProcessed" }] : []));
|
|
1277
1301
|
allowAdd = signal(false, ...(ngDevMode ? [{ debugName: "allowAdd" }] : []));
|
|
1278
1302
|
allowEdit = signal(false, ...(ngDevMode ? [{ debugName: "allowEdit" }] : []));
|
|
@@ -1284,10 +1308,33 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1284
1308
|
// ---------------------------------------------------
|
|
1285
1309
|
recordList = signal([], ...(ngDevMode ? [{ debugName: "recordList" }] : []));
|
|
1286
1310
|
record = null;
|
|
1311
|
+
// ***************************************************************
|
|
1312
|
+
// *** METHODS For optional overide ***
|
|
1313
|
+
// ***************************************************************
|
|
1314
|
+
async AfterOnInit() { }
|
|
1315
|
+
setFilter() { } //override this to set a filter
|
|
1316
|
+
// ***************************************************************
|
|
1317
|
+
// *** METHODS ***
|
|
1318
|
+
// ***************************************************************
|
|
1319
|
+
popupClose() { this.selectedElement.emit(null); }
|
|
1320
|
+
onFilterTextBoxVisibilityChange(isOpen) {
|
|
1321
|
+
this.menuValid.set(!isOpen);
|
|
1322
|
+
}
|
|
1287
1323
|
/**
|
|
1288
|
-
*
|
|
1324
|
+
* Handle back button click
|
|
1289
1325
|
*/
|
|
1290
|
-
|
|
1326
|
+
backClicked() {
|
|
1327
|
+
this.commonService.goBack();
|
|
1328
|
+
}
|
|
1329
|
+
async refreshData() {
|
|
1330
|
+
try {
|
|
1331
|
+
this.loadData();
|
|
1332
|
+
await this.alertService.showAlert('@dataRefreshedSuccessfully');
|
|
1333
|
+
}
|
|
1334
|
+
catch (err) {
|
|
1335
|
+
this.alertService.showError(err);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1291
1338
|
/** Set data into the grid */
|
|
1292
1339
|
setData(data) {
|
|
1293
1340
|
this.recordList.set(data);
|
|
@@ -1297,7 +1344,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1297
1344
|
if (this.searchValue() && this.gridApi) {
|
|
1298
1345
|
this.gridApi.setGridOption('quickFilterText', this.searchValue());
|
|
1299
1346
|
if (this.recordList == undefined || this.recordList.length == 0) {
|
|
1300
|
-
if (this.
|
|
1347
|
+
if (this._isEmbedded()) {
|
|
1301
1348
|
this.alertService.showWarning('@recordNotFoundSearch');
|
|
1302
1349
|
}
|
|
1303
1350
|
}
|
|
@@ -1468,7 +1515,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1468
1515
|
this.nettyAgGridService.setAgGridTranslations(this.gridApi);
|
|
1469
1516
|
}
|
|
1470
1517
|
initAgGrid_extension() {
|
|
1471
|
-
if (this.allowEdit() == false &&
|
|
1518
|
+
if (this.allowEdit() == false && this._isPopupValid() == false) {
|
|
1472
1519
|
this.columnDefs().pop();
|
|
1473
1520
|
this.columnDefs().shift();
|
|
1474
1521
|
this.columnDefs().unshift({
|
|
@@ -1479,10 +1526,10 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1479
1526
|
});
|
|
1480
1527
|
this.gridApi.setGridOption('rowSelection', { mode: 'multiRow', checkboxes: true });
|
|
1481
1528
|
}
|
|
1482
|
-
if (this.
|
|
1529
|
+
if (this._isPopupValid() == true) {
|
|
1483
1530
|
this.columnDefs().pop();
|
|
1484
1531
|
this.columnDefs().shift();
|
|
1485
|
-
if (this.
|
|
1532
|
+
if (this._isPopupFilterValid() == true) {
|
|
1486
1533
|
if (this.allowEdit()) {
|
|
1487
1534
|
this.columnDefs().unshift({
|
|
1488
1535
|
headerName: '', sortable: false, resizable: false, filter: false,
|
|
@@ -1558,15 +1605,34 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1558
1605
|
var fields = this.columnDefs()
|
|
1559
1606
|
.filter((columnDef) => columnDef.ntyEmbeddedHide == 'x')
|
|
1560
1607
|
.map((columnDef) => columnDef.field);
|
|
1561
|
-
this.gridApi?.setColumnsVisible(fields, !this.
|
|
1608
|
+
this.gridApi?.setColumnsVisible(fields, !this._isEmbedded());
|
|
1609
|
+
}
|
|
1610
|
+
// *****************************************
|
|
1611
|
+
// *** Logging Functions ***
|
|
1612
|
+
// *****************************************
|
|
1613
|
+
logInputs(message) {
|
|
1614
|
+
if (!message || message.length < 1) {
|
|
1615
|
+
message = 'agGridBase - Inputs log';
|
|
1616
|
+
}
|
|
1617
|
+
const inputs = {
|
|
1618
|
+
"popupFilterValid": this.popupFilterValid(),
|
|
1619
|
+
"_isPopupFilterValid": this._isPopupFilterValid(),
|
|
1620
|
+
"popupValid": this.popupValid(),
|
|
1621
|
+
"_isPopupValid": this._isPopupValid(),
|
|
1622
|
+
"componantParameterGUID": this.componantParameterGUID(),
|
|
1623
|
+
"componantParameterType": this.componantParameterType(),
|
|
1624
|
+
"embedded": this.embedded(),
|
|
1625
|
+
"_isEmbedded": this._isEmbedded(),
|
|
1626
|
+
};
|
|
1627
|
+
console.log(message, inputs);
|
|
1562
1628
|
}
|
|
1563
1629
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridBase, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1564
|
-
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 },
|
|
1630
|
+
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 });
|
|
1565
1631
|
}
|
|
1566
1632
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridBase, decorators: [{
|
|
1567
1633
|
type: Component,
|
|
1568
1634
|
args: [{ selector: 'ntybase-ag-grid-base', imports: [], template: ``, host: { 'ntybase-id': 'NettyAgGridBase' } }]
|
|
1569
|
-
}], propDecorators: { popupFilterValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupFilterValid", required: false }] }], popupValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupValid", required: false }] }],
|
|
1635
|
+
}], 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 }] }] } });
|
|
1570
1636
|
|
|
1571
1637
|
class ButtonRenderer {
|
|
1572
1638
|
params = null;
|
|
@@ -1721,37 +1787,32 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1721
1787
|
// ********************************************
|
|
1722
1788
|
// *** INPUTS ***
|
|
1723
1789
|
// ********************************************
|
|
1724
|
-
// Parameters passed when the component is embeded into an other
|
|
1725
|
-
componantParameterGUID = input('', ...(ngDevMode ? [{ debugName: "componantParameterGUID" }] : [])); // GUID of the parameter
|
|
1726
|
-
componantParameterType = input('', ...(ngDevMode ? [{ debugName: "componantParameterType" }] : [])); // Type of the parameter (Field Name)
|
|
1727
|
-
// ********************************************
|
|
1728
|
-
// *** EVENTS ***
|
|
1729
|
-
// ********************************************
|
|
1730
|
-
/*
|
|
1731
|
-
Selected records event
|
|
1732
|
-
@param records: Array of selected records
|
|
1733
|
-
*/
|
|
1734
|
-
onElementSelect = output(); // Emit selected records when updated
|
|
1735
|
-
// Parameters for embeded components
|
|
1736
|
-
selectedElement = output(); // Selected element in popup mode
|
|
1737
|
-
// ********************************************
|
|
1738
1790
|
// Filter section
|
|
1739
|
-
hasFilter = input(
|
|
1791
|
+
hasFilter = input(true, ...(ngDevMode ? [{ debugName: "hasFilter" }] : [])); // Does the component have a filter
|
|
1792
|
+
_hasFilter = computed(() => this.hasFilter() ?? false, ...(ngDevMode ? [{ debugName: "_hasFilter" }] : []));
|
|
1740
1793
|
isFilterValid = signal(true, ...(ngDevMode ? [{ debugName: "isFilterValid" }] : [])); // Can the filter be used
|
|
1741
|
-
isFilterExpanded =
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1794
|
+
isFilterExpanded = linkedSignal({ ...(ngDevMode ? { debugName: "isFilterExpanded" } : {}), source: () => ({
|
|
1795
|
+
embedded: this._isEmbedded(),
|
|
1796
|
+
hasFilter: this._hasFilter(),
|
|
1797
|
+
valid: this.isFilterValid(),
|
|
1798
|
+
}),
|
|
1799
|
+
computation: (s) => {
|
|
1800
|
+
if (s.embedded || !s.hasFilter)
|
|
1801
|
+
return false;
|
|
1802
|
+
return s.valid;
|
|
1803
|
+
} });
|
|
1804
|
+
filterRefreshTrigger = signal(0, ...(ngDevMode ? [{ debugName: "filterRefreshTrigger" }] : []));
|
|
1805
|
+
/**
|
|
1806
|
+
* Triggers the filter component to refresh its data
|
|
1807
|
+
*/
|
|
1808
|
+
refreshFilterData() {
|
|
1809
|
+
let value = this.filterRefreshTrigger();
|
|
1810
|
+
if (value > 10000) {
|
|
1811
|
+
value = 0;
|
|
1747
1812
|
}
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
menuValid = signal(true, ...(ngDevMode ? [{ debugName: "menuValid" }] : [])); // true: Filter editbox is not visible so the menus are visible
|
|
1752
|
-
refreshButtonValid = signal(false, ...(ngDevMode ? [{ debugName: "refreshButtonValid" }] : [])); // true: Refresh button is enabled
|
|
1753
|
-
// Open component management
|
|
1754
|
-
openEditComponentInPopup = signal(false, ...(ngDevMode ? [{ debugName: "openEditComponentInPopup" }] : []));
|
|
1813
|
+
value++;
|
|
1814
|
+
this.filterRefreshTrigger.set(value);
|
|
1815
|
+
}
|
|
1755
1816
|
// Services
|
|
1756
1817
|
router = inject(Router);
|
|
1757
1818
|
routerActive = inject(ActivatedRoute);
|
|
@@ -1763,6 +1824,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1763
1824
|
queryParameterType = toSignal(this.routerActive.queryParamMap.pipe(map((params) => params.get('type')), map((value) => this.parseOrReturnValue(value))), {
|
|
1764
1825
|
initialValue: null, // set initial value to null
|
|
1765
1826
|
});
|
|
1827
|
+
openInPopup = signal(false, ...(ngDevMode ? [{ debugName: "openInPopup" }] : [])); // true: Open add / edit component in popup
|
|
1766
1828
|
// ---------------------------------------------------
|
|
1767
1829
|
// --- RECORD LIST ---
|
|
1768
1830
|
// ---------------------------------------------------
|
|
@@ -1771,18 +1833,20 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1771
1833
|
* Component initialization lifecycle hook
|
|
1772
1834
|
*/
|
|
1773
1835
|
async ngOnInit() {
|
|
1774
|
-
this.
|
|
1836
|
+
this.logInputs('AgGridListBase - ngOnInit - enterance');
|
|
1837
|
+
this.nettyAppsProxy.setURLPath(this.componentName());
|
|
1775
1838
|
await this.setAccessRights();
|
|
1776
1839
|
const savedSearchValue = sessionStorage.getItem(this.searchValueName());
|
|
1777
1840
|
if (savedSearchValue) {
|
|
1778
1841
|
this.searchValue.set(savedSearchValue);
|
|
1779
1842
|
}
|
|
1780
|
-
if (!this.
|
|
1843
|
+
if (!this._hasFilter()) {
|
|
1781
1844
|
this.loadData();
|
|
1782
1845
|
}
|
|
1783
1846
|
// Load user grid preferences
|
|
1784
1847
|
await this.nettyAgGridService.copyGridUserPereferenceToLocal(this.preferenceType());
|
|
1785
1848
|
await this.AfterOnInit();
|
|
1849
|
+
this.logInputs('AgGridListBase - ngOnInit - exit');
|
|
1786
1850
|
}
|
|
1787
1851
|
parseOrReturnValue(value) {
|
|
1788
1852
|
if (value) {
|
|
@@ -1795,13 +1859,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1795
1859
|
}
|
|
1796
1860
|
return null;
|
|
1797
1861
|
}
|
|
1798
|
-
|
|
1799
|
-
* Handle back button click
|
|
1800
|
-
*/
|
|
1801
|
-
backClicked() {
|
|
1802
|
-
this.commonService.goBack();
|
|
1803
|
-
}
|
|
1804
|
-
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this.isEmbedded()) {
|
|
1862
|
+
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this._isEmbedded()) {
|
|
1805
1863
|
const baseHref = this.environment.getBaseHref().endsWith('/')
|
|
1806
1864
|
? this.environment.getBaseHref().slice(0, -1) // Sondaki / işaretini kaldır
|
|
1807
1865
|
: this.environment.getBaseHref();
|
|
@@ -1874,10 +1932,9 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1874
1932
|
]);
|
|
1875
1933
|
}
|
|
1876
1934
|
toggleOpenMode() {
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
const message = newMode ? '@openInPopup' : '@openInSidenav';
|
|
1935
|
+
this.openInPopup.update(a => !a);
|
|
1936
|
+
localStorage.setItem('openInPopup', JSON.stringify(this.openInPopup()));
|
|
1937
|
+
const message = this.openInPopup() ? '@openInPopup' : '@openInSidenav';
|
|
1881
1938
|
this.alertService.showSuccess(message);
|
|
1882
1939
|
}
|
|
1883
1940
|
/**
|
|
@@ -1896,7 +1953,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1896
1953
|
};
|
|
1897
1954
|
const savedMode = localStorage.getItem('openInPopup');
|
|
1898
1955
|
if (savedMode !== null) {
|
|
1899
|
-
this.
|
|
1956
|
+
this.openInPopup.set(JSON.parse(savedMode) === true);
|
|
1900
1957
|
}
|
|
1901
1958
|
this.translateService.onLangChange.subscribe(() => {
|
|
1902
1959
|
this.setAgGridTranslations();
|
|
@@ -1940,7 +1997,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1940
1997
|
effect(() => { this.onElementSelect.emit(this.selectedRows()); });
|
|
1941
1998
|
// Manage filter expanded state
|
|
1942
1999
|
effect(() => {
|
|
1943
|
-
this.
|
|
2000
|
+
this._isEmbedded();
|
|
1944
2001
|
this.showHideEmbeddedColumnsAsync();
|
|
1945
2002
|
});
|
|
1946
2003
|
}
|
|
@@ -1961,18 +2018,11 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1961
2018
|
}
|
|
1962
2019
|
return true;
|
|
1963
2020
|
}
|
|
1964
|
-
onFilterTextBoxVisibilityChange(isOpen) {
|
|
1965
|
-
this.menuValid.set(!isOpen);
|
|
1966
|
-
}
|
|
1967
|
-
setFilter() { } //override this to set a filter
|
|
1968
|
-
popupClose() {
|
|
1969
|
-
this.selectedElement.emit(null);
|
|
1970
|
-
}
|
|
1971
2021
|
// *********************************************************
|
|
1972
2022
|
// *** Data Management Functions ***
|
|
1973
2023
|
// *********************************************************
|
|
1974
2024
|
loadData() {
|
|
1975
|
-
if (this.
|
|
2025
|
+
if (this._hasFilter()) {
|
|
1976
2026
|
this.setData([]);
|
|
1977
2027
|
return;
|
|
1978
2028
|
}
|
|
@@ -1997,15 +2047,6 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1997
2047
|
this.deleteRows(selectedRows);
|
|
1998
2048
|
}
|
|
1999
2049
|
}
|
|
2000
|
-
async refreshData() {
|
|
2001
|
-
try {
|
|
2002
|
-
this.loadData();
|
|
2003
|
-
await this.alertService.showAlert('@dataRefreshedSuccessfully');
|
|
2004
|
-
}
|
|
2005
|
-
catch (err) {
|
|
2006
|
-
this.alertService.showError(err);
|
|
2007
|
-
}
|
|
2008
|
-
}
|
|
2009
2050
|
deleteRows(rows) {
|
|
2010
2051
|
this.nettyAppsProxy.deleteList(rows).subscribe({
|
|
2011
2052
|
next: () => {
|
|
@@ -2015,13 +2056,36 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
2015
2056
|
error: (err) => this.alertService.showError(err),
|
|
2016
2057
|
});
|
|
2017
2058
|
}
|
|
2059
|
+
// *****************************************
|
|
2060
|
+
// *** Logging Functions ***
|
|
2061
|
+
// *****************************************
|
|
2062
|
+
logInputs(message) {
|
|
2063
|
+
if (!message || message.length < 1) {
|
|
2064
|
+
message = 'AgGridListBase - Inputs log';
|
|
2065
|
+
}
|
|
2066
|
+
const inputs = {
|
|
2067
|
+
"popupFilterValid": this.popupFilterValid(),
|
|
2068
|
+
"_isPopupFilterValid": this._isPopupFilterValid(),
|
|
2069
|
+
"popupValid": this.popupValid(),
|
|
2070
|
+
"_isPopupValid": this._isPopupValid(),
|
|
2071
|
+
"componantParameterGUID": this.componantParameterGUID(),
|
|
2072
|
+
"componantParameterType": this.componantParameterType(),
|
|
2073
|
+
"embedded": this.embedded(),
|
|
2074
|
+
"_isEmbedded": this._isEmbedded(),
|
|
2075
|
+
"hasFilter": this.hasFilter(),
|
|
2076
|
+
"_hasFilter": this._hasFilter(),
|
|
2077
|
+
"isFilterValid": this.isFilterValid(),
|
|
2078
|
+
"isFilterExpanded": this.isFilterExpanded(),
|
|
2079
|
+
};
|
|
2080
|
+
console.log(message, inputs);
|
|
2081
|
+
}
|
|
2018
2082
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridListBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2019
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridListBase, isStandalone: true, selector: "ntybase-ag-grid-list-base", inputs: {
|
|
2083
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridListBase, isStandalone: true, selector: "ntybase-ag-grid-list-base", inputs: { hasFilter: { classPropertyName: "hasFilter", publicName: "hasFilter", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "ntybase-id": "NettyAgGridListBase" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
2020
2084
|
}
|
|
2021
2085
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridListBase, decorators: [{
|
|
2022
2086
|
type: Component,
|
|
2023
2087
|
args: [{ selector: 'ntybase-ag-grid-list-base', imports: [], template: ``, host: { 'ntybase-id': 'NettyAgGridListBase' } }]
|
|
2024
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
2088
|
+
}], ctorParameters: () => [], propDecorators: { hasFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasFilter", required: false }] }] } });
|
|
2025
2089
|
|
|
2026
2090
|
class NettyAgGridLogBase extends NettyAgGridBase {
|
|
2027
2091
|
// ---------------------------------------------------
|
|
@@ -2032,7 +2096,7 @@ class NettyAgGridLogBase extends NettyAgGridBase {
|
|
|
2032
2096
|
* Component initialization lifecycle hook
|
|
2033
2097
|
*/
|
|
2034
2098
|
async ngOnInit() {
|
|
2035
|
-
this.nettyAppsProxy
|
|
2099
|
+
this.nettyAppsProxy.setURLPath(this.componentName());
|
|
2036
2100
|
await this.setAccessRights();
|
|
2037
2101
|
const savedSearchValue = sessionStorage.getItem(this.searchValueName());
|
|
2038
2102
|
if (savedSearchValue) {
|
|
@@ -2069,8 +2133,6 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2069
2133
|
viewMode = signal('sidenav', ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
|
|
2070
2134
|
// Input signals
|
|
2071
2135
|
parameters = input('', ...(ngDevMode ? [{ debugName: "parameters" }] : []));
|
|
2072
|
-
embedded = input(false, ...(ngDevMode ? [{ debugName: "embedded" }] : []));
|
|
2073
|
-
isEmbedded = input(false, ...(ngDevMode ? [{ debugName: "isEmbedded" }] : []));
|
|
2074
2136
|
// ---------------------------------------------------
|
|
2075
2137
|
// --- RECORD LIST ---
|
|
2076
2138
|
// ---------------------------------------------------
|
|
@@ -2104,7 +2166,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2104
2166
|
* Initialize parameters. This method is called in ngOnInit or constructor
|
|
2105
2167
|
*/
|
|
2106
2168
|
initParameters(urlPath) {
|
|
2107
|
-
this.nettyAppsProxy
|
|
2169
|
+
this.nettyAppsProxy.setURLPath(urlPath);
|
|
2108
2170
|
this.recordType.set(urlPath);
|
|
2109
2171
|
}
|
|
2110
2172
|
/**
|
|
@@ -2331,7 +2393,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2331
2393
|
// ***************************************************
|
|
2332
2394
|
// *** gotoURL Methods ***
|
|
2333
2395
|
// ***************************************************
|
|
2334
|
-
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this.
|
|
2396
|
+
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this._isEmbedded()) {
|
|
2335
2397
|
const baseHref = this.environment.getBaseHref().endsWith('/')
|
|
2336
2398
|
? this.environment.getBaseHref().slice(0, -1) // Sondaki / işaretini kaldır
|
|
2337
2399
|
: this.environment.getBaseHref();
|
|
@@ -2404,12 +2466,12 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2404
2466
|
]);
|
|
2405
2467
|
}
|
|
2406
2468
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridSaveBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2407
|
-
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 }
|
|
2469
|
+
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 });
|
|
2408
2470
|
}
|
|
2409
2471
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridSaveBase, decorators: [{
|
|
2410
2472
|
type: Component,
|
|
2411
2473
|
args: [{ selector: 'ntybase-ag-grid-save-base', imports: [], template: `` }]
|
|
2412
|
-
}], ctorParameters: () => [], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }],
|
|
2474
|
+
}], ctorParameters: () => [], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], saveForm: [{
|
|
2413
2475
|
type: ViewChild,
|
|
2414
2476
|
args: ['saveForm']
|
|
2415
2477
|
}] } });
|
|
@@ -4259,6 +4321,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
4259
4321
|
}]
|
|
4260
4322
|
}], ctorParameters: () => [] });
|
|
4261
4323
|
|
|
4324
|
+
class NettyAppsFilterBase extends NettyAppsBase {
|
|
4325
|
+
// *********************************************************
|
|
4326
|
+
// *** Input / Output ***
|
|
4327
|
+
// *********************************************************
|
|
4328
|
+
isFilterExpanded = model(true, ...(ngDevMode ? [{ debugName: "isFilterExpanded" }] : []));
|
|
4329
|
+
filteredRecords = output();
|
|
4330
|
+
refresh = input(0, ...(ngDevMode ? [{ debugName: "refresh" }] : []));
|
|
4331
|
+
fileName = input('nettyapps_', ...(ngDevMode ? [{ debugName: "fileName" }] : []));
|
|
4332
|
+
// *********************************************************
|
|
4333
|
+
// *** Service ***
|
|
4334
|
+
// *********************************************************
|
|
4335
|
+
filterProxy = injectNettyStandardFilterProxy(this.componentName());
|
|
4336
|
+
// *********************************************************
|
|
4337
|
+
// *** Signals ***
|
|
4338
|
+
// *********************************************************
|
|
4339
|
+
currentItem = signal(this.createNewFilter(), ...(ngDevMode ? [{ debugName: "currentItem" }] : []));
|
|
4340
|
+
// *********************************************************
|
|
4341
|
+
// *** Constructor ***
|
|
4342
|
+
// *********************************************************
|
|
4343
|
+
constructor() {
|
|
4344
|
+
super();
|
|
4345
|
+
effect(() => {
|
|
4346
|
+
if (this.refresh() > 0) {
|
|
4347
|
+
this.onApply();
|
|
4348
|
+
}
|
|
4349
|
+
});
|
|
4350
|
+
}
|
|
4351
|
+
// *********************************************************
|
|
4352
|
+
// *** Functions ***
|
|
4353
|
+
// *********************************************************
|
|
4354
|
+
async ngOnInit() {
|
|
4355
|
+
this.afterOnInit();
|
|
4356
|
+
}
|
|
4357
|
+
onApply() {
|
|
4358
|
+
this.filterProxy.selectFilter(this.currentItem()).subscribe({
|
|
4359
|
+
next: (result) => {
|
|
4360
|
+
this.filteredRecords.emit(result);
|
|
4361
|
+
this.isFilterExpanded.set(false);
|
|
4362
|
+
},
|
|
4363
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4364
|
+
});
|
|
4365
|
+
}
|
|
4366
|
+
onReset() {
|
|
4367
|
+
this.filterProxy.initFilter().subscribe({
|
|
4368
|
+
next: (filter) => {
|
|
4369
|
+
this.currentItem.set(filter);
|
|
4370
|
+
},
|
|
4371
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4372
|
+
});
|
|
4373
|
+
}
|
|
4374
|
+
onExport() {
|
|
4375
|
+
this.filterProxy.downloadXLS(this.currentItem()).subscribe({
|
|
4376
|
+
next: (response) => {
|
|
4377
|
+
this.downloadBlobFile(response, 'application/zip', this.translateService.instant('@00000072') + '.zip');
|
|
4378
|
+
},
|
|
4379
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4380
|
+
});
|
|
4381
|
+
}
|
|
4382
|
+
async afterOnInit() { }
|
|
4383
|
+
// *****************************************
|
|
4384
|
+
// *** Logging Functions ***
|
|
4385
|
+
// *****************************************
|
|
4386
|
+
logInputs(message) {
|
|
4387
|
+
if (!message || message.length < 1) {
|
|
4388
|
+
message = 'NettyAppsFilterBase - Inputs log';
|
|
4389
|
+
}
|
|
4390
|
+
const inputs = {
|
|
4391
|
+
"isFilterExpanded": this.isFilterExpanded(),
|
|
4392
|
+
"refresh": this.refresh(),
|
|
4393
|
+
"fileName": this.fileName(),
|
|
4394
|
+
};
|
|
4395
|
+
console.log(message, inputs);
|
|
4396
|
+
}
|
|
4397
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsFilterBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4398
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAppsFilterBase, isStandalone: true, selector: "ntybase-netty-apps-base", inputs: { isFilterExpanded: { classPropertyName: "isFilterExpanded", publicName: "isFilterExpanded", isSignal: true, isRequired: false, transformFunction: null }, refresh: { classPropertyName: "refresh", publicName: "refresh", isSignal: true, isRequired: false, transformFunction: null }, fileName: { classPropertyName: "fileName", publicName: "fileName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isFilterExpanded: "isFilterExpandedChange", filteredRecords: "filteredRecords" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
4399
|
+
}
|
|
4400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsFilterBase, decorators: [{
|
|
4401
|
+
type: Component,
|
|
4402
|
+
args: [{ selector: 'ntybase-netty-apps-base', imports: [], template: `` }]
|
|
4403
|
+
}], ctorParameters: () => [], propDecorators: { isFilterExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFilterExpanded", required: false }] }, { type: i0.Output, args: ["isFilterExpandedChange"] }], filteredRecords: [{ type: i0.Output, args: ["filteredRecords"] }], refresh: [{ type: i0.Input, args: [{ isSignal: true, alias: "refresh", required: false }] }], fileName: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileName", required: false }] }] } });
|
|
4404
|
+
|
|
4262
4405
|
/*
|
|
4263
4406
|
* Public API Surface of ntybase
|
|
4264
4407
|
*/
|
|
@@ -4267,5 +4410,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
4267
4410
|
* Generated bundle index. Do not edit.
|
|
4268
4411
|
*/
|
|
4269
4412
|
|
|
4270
|
-
export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ENVIRONMENT_CONFIG, EnvironmentInfo, EnvironmentInfoService, ExcelImportBase, ForgotPassword, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridBase, NettyAgGridListBase, NettyAgGridLogBase, NettyAgGridSaveBase, NettyAgGridService, NettyAppsBase, NettyBaseApp, NettyHelper, NettyImageService, NettyMenuService, NtyLoadingComponent, NtyLoadingInterceptor, Ntybase, NtybaseModule, RangeDateTimeFilter, RangeNumberFilter, RangeStringFilter, UrlHelperService, ntyAuthenticationInterceptor };
|
|
4413
|
+
export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ENVIRONMENT_CONFIG, EnvironmentInfo, EnvironmentInfoService, ExcelImportBase, ForgotPassword, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridBase, NettyAgGridListBase, NettyAgGridLogBase, NettyAgGridSaveBase, NettyAgGridService, NettyAppsBase, NettyAppsFilterBase, NettyBaseApp, NettyHelper, NettyImageService, NettyMenuService, NtyLoadingComponent, NtyLoadingInterceptor, Ntybase, NtybaseModule, RangeDateTimeFilter, RangeNumberFilter, RangeStringFilter, UrlHelperService, ntyAuthenticationInterceptor };
|
|
4271
4414
|
//# sourceMappingURL=nettyapps-ntybase.mjs.map
|