@nettyapps/ntybase 21.0.35-beta.2 → 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,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,15 @@ 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());
|
|
1562
1609
|
}
|
|
1563
1610
|
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 },
|
|
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 });
|
|
1565
1612
|
}
|
|
1566
1613
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridBase, decorators: [{
|
|
1567
1614
|
type: Component,
|
|
1568
1615
|
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 }] }],
|
|
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 }] }] } });
|
|
1570
1617
|
|
|
1571
1618
|
class ButtonRenderer {
|
|
1572
1619
|
params = null;
|
|
@@ -1721,37 +1768,32 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1721
1768
|
// ********************************************
|
|
1722
1769
|
// *** INPUTS ***
|
|
1723
1770
|
// ********************************************
|
|
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
1771
|
// Filter section
|
|
1739
|
-
hasFilter = input(
|
|
1772
|
+
hasFilter = input(true, ...(ngDevMode ? [{ debugName: "hasFilter" }] : [])); // Does the component have a filter
|
|
1773
|
+
_hasFilter = computed(() => this.hasFilter() ?? false, ...(ngDevMode ? [{ debugName: "_hasFilter" }] : []));
|
|
1740
1774
|
isFilterValid = signal(true, ...(ngDevMode ? [{ debugName: "isFilterValid" }] : [])); // Can the filter be used
|
|
1741
|
-
isFilterExpanded =
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1775
|
+
isFilterExpanded = linkedSignal({ ...(ngDevMode ? { debugName: "isFilterExpanded" } : {}), source: () => ({
|
|
1776
|
+
embedded: this._isEmbedded(),
|
|
1777
|
+
hasFilter: this._hasFilter(),
|
|
1778
|
+
valid: this.isFilterValid(),
|
|
1779
|
+
}),
|
|
1780
|
+
computation: (s) => {
|
|
1781
|
+
if (s.embedded || !s.hasFilter)
|
|
1782
|
+
return false;
|
|
1783
|
+
return s.valid;
|
|
1784
|
+
} });
|
|
1785
|
+
filterRefreshTrigger = signal(0, ...(ngDevMode ? [{ debugName: "filterRefreshTrigger" }] : []));
|
|
1786
|
+
/**
|
|
1787
|
+
* Triggers the filter component to refresh its data
|
|
1788
|
+
*/
|
|
1789
|
+
refreshFilterData() {
|
|
1790
|
+
let value = this.filterRefreshTrigger();
|
|
1791
|
+
if (value > 10000) {
|
|
1792
|
+
value = 0;
|
|
1747
1793
|
}
|
|
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" }] : []));
|
|
1794
|
+
value++;
|
|
1795
|
+
this.filterRefreshTrigger.set(value);
|
|
1796
|
+
}
|
|
1755
1797
|
// Services
|
|
1756
1798
|
router = inject(Router);
|
|
1757
1799
|
routerActive = inject(ActivatedRoute);
|
|
@@ -1763,6 +1805,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1763
1805
|
queryParameterType = toSignal(this.routerActive.queryParamMap.pipe(map((params) => params.get('type')), map((value) => this.parseOrReturnValue(value))), {
|
|
1764
1806
|
initialValue: null, // set initial value to null
|
|
1765
1807
|
});
|
|
1808
|
+
openInPopup = signal(false, ...(ngDevMode ? [{ debugName: "openInPopup" }] : [])); // true: Open add / edit component in popup
|
|
1766
1809
|
// ---------------------------------------------------
|
|
1767
1810
|
// --- RECORD LIST ---
|
|
1768
1811
|
// ---------------------------------------------------
|
|
@@ -1771,13 +1814,13 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1771
1814
|
* Component initialization lifecycle hook
|
|
1772
1815
|
*/
|
|
1773
1816
|
async ngOnInit() {
|
|
1774
|
-
this.nettyAppsProxy
|
|
1817
|
+
this.nettyAppsProxy.setURLPath(this.componentName());
|
|
1775
1818
|
await this.setAccessRights();
|
|
1776
1819
|
const savedSearchValue = sessionStorage.getItem(this.searchValueName());
|
|
1777
1820
|
if (savedSearchValue) {
|
|
1778
1821
|
this.searchValue.set(savedSearchValue);
|
|
1779
1822
|
}
|
|
1780
|
-
if (!this.
|
|
1823
|
+
if (!this._hasFilter()) {
|
|
1781
1824
|
this.loadData();
|
|
1782
1825
|
}
|
|
1783
1826
|
// Load user grid preferences
|
|
@@ -1795,13 +1838,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1795
1838
|
}
|
|
1796
1839
|
return null;
|
|
1797
1840
|
}
|
|
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()) {
|
|
1841
|
+
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this._isEmbedded()) {
|
|
1805
1842
|
const baseHref = this.environment.getBaseHref().endsWith('/')
|
|
1806
1843
|
? this.environment.getBaseHref().slice(0, -1) // Sondaki / işaretini kaldır
|
|
1807
1844
|
: this.environment.getBaseHref();
|
|
@@ -1874,10 +1911,9 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1874
1911
|
]);
|
|
1875
1912
|
}
|
|
1876
1913
|
toggleOpenMode() {
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
const message = newMode ? '@openInPopup' : '@openInSidenav';
|
|
1914
|
+
this.openInPopup.update(a => !a);
|
|
1915
|
+
localStorage.setItem('openInPopup', JSON.stringify(this.openInPopup()));
|
|
1916
|
+
const message = this.openInPopup() ? '@openInPopup' : '@openInSidenav';
|
|
1881
1917
|
this.alertService.showSuccess(message);
|
|
1882
1918
|
}
|
|
1883
1919
|
/**
|
|
@@ -1896,7 +1932,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1896
1932
|
};
|
|
1897
1933
|
const savedMode = localStorage.getItem('openInPopup');
|
|
1898
1934
|
if (savedMode !== null) {
|
|
1899
|
-
this.
|
|
1935
|
+
this.openInPopup.set(JSON.parse(savedMode) === true);
|
|
1900
1936
|
}
|
|
1901
1937
|
this.translateService.onLangChange.subscribe(() => {
|
|
1902
1938
|
this.setAgGridTranslations();
|
|
@@ -1940,7 +1976,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1940
1976
|
effect(() => { this.onElementSelect.emit(this.selectedRows()); });
|
|
1941
1977
|
// Manage filter expanded state
|
|
1942
1978
|
effect(() => {
|
|
1943
|
-
this.
|
|
1979
|
+
this._isEmbedded();
|
|
1944
1980
|
this.showHideEmbeddedColumnsAsync();
|
|
1945
1981
|
});
|
|
1946
1982
|
}
|
|
@@ -1961,18 +1997,11 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1961
1997
|
}
|
|
1962
1998
|
return true;
|
|
1963
1999
|
}
|
|
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
2000
|
// *********************************************************
|
|
1972
2001
|
// *** Data Management Functions ***
|
|
1973
2002
|
// *********************************************************
|
|
1974
2003
|
loadData() {
|
|
1975
|
-
if (this.
|
|
2004
|
+
if (this._hasFilter()) {
|
|
1976
2005
|
this.setData([]);
|
|
1977
2006
|
return;
|
|
1978
2007
|
}
|
|
@@ -1997,15 +2026,6 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1997
2026
|
this.deleteRows(selectedRows);
|
|
1998
2027
|
}
|
|
1999
2028
|
}
|
|
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
2029
|
deleteRows(rows) {
|
|
2010
2030
|
this.nettyAppsProxy.deleteList(rows).subscribe({
|
|
2011
2031
|
next: () => {
|
|
@@ -2016,12 +2036,12 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
2016
2036
|
});
|
|
2017
2037
|
}
|
|
2018
2038
|
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: {
|
|
2039
|
+
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
2040
|
}
|
|
2021
2041
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridListBase, decorators: [{
|
|
2022
2042
|
type: Component,
|
|
2023
2043
|
args: [{ selector: 'ntybase-ag-grid-list-base', imports: [], template: ``, host: { 'ntybase-id': 'NettyAgGridListBase' } }]
|
|
2024
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
2044
|
+
}], ctorParameters: () => [], propDecorators: { hasFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasFilter", required: false }] }] } });
|
|
2025
2045
|
|
|
2026
2046
|
class NettyAgGridLogBase extends NettyAgGridBase {
|
|
2027
2047
|
// ---------------------------------------------------
|
|
@@ -2032,7 +2052,7 @@ class NettyAgGridLogBase extends NettyAgGridBase {
|
|
|
2032
2052
|
* Component initialization lifecycle hook
|
|
2033
2053
|
*/
|
|
2034
2054
|
async ngOnInit() {
|
|
2035
|
-
this.nettyAppsProxy
|
|
2055
|
+
this.nettyAppsProxy.setURLPath(this.componentName());
|
|
2036
2056
|
await this.setAccessRights();
|
|
2037
2057
|
const savedSearchValue = sessionStorage.getItem(this.searchValueName());
|
|
2038
2058
|
if (savedSearchValue) {
|
|
@@ -2069,8 +2089,6 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2069
2089
|
viewMode = signal('sidenav', ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
|
|
2070
2090
|
// Input signals
|
|
2071
2091
|
parameters = input('', ...(ngDevMode ? [{ debugName: "parameters" }] : []));
|
|
2072
|
-
embedded = input(false, ...(ngDevMode ? [{ debugName: "embedded" }] : []));
|
|
2073
|
-
isEmbedded = input(false, ...(ngDevMode ? [{ debugName: "isEmbedded" }] : []));
|
|
2074
2092
|
// ---------------------------------------------------
|
|
2075
2093
|
// --- RECORD LIST ---
|
|
2076
2094
|
// ---------------------------------------------------
|
|
@@ -2104,7 +2122,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2104
2122
|
* Initialize parameters. This method is called in ngOnInit or constructor
|
|
2105
2123
|
*/
|
|
2106
2124
|
initParameters(urlPath) {
|
|
2107
|
-
this.nettyAppsProxy
|
|
2125
|
+
this.nettyAppsProxy.setURLPath(urlPath);
|
|
2108
2126
|
this.recordType.set(urlPath);
|
|
2109
2127
|
}
|
|
2110
2128
|
/**
|
|
@@ -2331,7 +2349,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2331
2349
|
// ***************************************************
|
|
2332
2350
|
// *** gotoURL Methods ***
|
|
2333
2351
|
// ***************************************************
|
|
2334
|
-
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this.
|
|
2352
|
+
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this._isEmbedded()) {
|
|
2335
2353
|
const baseHref = this.environment.getBaseHref().endsWith('/')
|
|
2336
2354
|
? this.environment.getBaseHref().slice(0, -1) // Sondaki / işaretini kaldır
|
|
2337
2355
|
: this.environment.getBaseHref();
|
|
@@ -2404,12 +2422,12 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2404
2422
|
]);
|
|
2405
2423
|
}
|
|
2406
2424
|
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 }
|
|
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 });
|
|
2408
2426
|
}
|
|
2409
2427
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridSaveBase, decorators: [{
|
|
2410
2428
|
type: Component,
|
|
2411
2429
|
args: [{ selector: 'ntybase-ag-grid-save-base', imports: [], template: `` }]
|
|
2412
|
-
}], 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: [{
|
|
2413
2431
|
type: ViewChild,
|
|
2414
2432
|
args: ['saveForm']
|
|
2415
2433
|
}] } });
|
|
@@ -4259,6 +4277,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
4259
4277
|
}]
|
|
4260
4278
|
}], ctorParameters: () => [] });
|
|
4261
4279
|
|
|
4280
|
+
class NettyAppsFilterBase extends NettyAppsBase {
|
|
4281
|
+
// *********************************************************
|
|
4282
|
+
// *** Input / Output ***
|
|
4283
|
+
// *********************************************************
|
|
4284
|
+
isFilterExpanded = model(true, ...(ngDevMode ? [{ debugName: "isFilterExpanded" }] : []));
|
|
4285
|
+
filteredRecords = output();
|
|
4286
|
+
refresh = input(0, ...(ngDevMode ? [{ debugName: "refresh" }] : []));
|
|
4287
|
+
fileName = input('nettyapps_', ...(ngDevMode ? [{ debugName: "fileName" }] : []));
|
|
4288
|
+
// *********************************************************
|
|
4289
|
+
// *** Service ***
|
|
4290
|
+
// *********************************************************
|
|
4291
|
+
filterProxy = injectNettyStandardFilterProxy(this.componentName());
|
|
4292
|
+
// *********************************************************
|
|
4293
|
+
// *** Signals ***
|
|
4294
|
+
// *********************************************************
|
|
4295
|
+
currentItem = signal(this.createNewFilter(), ...(ngDevMode ? [{ debugName: "currentItem" }] : []));
|
|
4296
|
+
// *********************************************************
|
|
4297
|
+
// *** Constructor ***
|
|
4298
|
+
// *********************************************************
|
|
4299
|
+
constructor() {
|
|
4300
|
+
super();
|
|
4301
|
+
effect(() => {
|
|
4302
|
+
if (this.refresh() > 0) {
|
|
4303
|
+
this.onApply();
|
|
4304
|
+
}
|
|
4305
|
+
});
|
|
4306
|
+
}
|
|
4307
|
+
// *********************************************************
|
|
4308
|
+
// *** Functions ***
|
|
4309
|
+
// *********************************************************
|
|
4310
|
+
async ngOnInit() {
|
|
4311
|
+
this.afterOnInit();
|
|
4312
|
+
}
|
|
4313
|
+
onApply() {
|
|
4314
|
+
this.filterProxy.selectFilter(this.currentItem()).subscribe({
|
|
4315
|
+
next: (result) => {
|
|
4316
|
+
this.filteredRecords.emit(result);
|
|
4317
|
+
this.isFilterExpanded.set(false);
|
|
4318
|
+
},
|
|
4319
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4320
|
+
});
|
|
4321
|
+
}
|
|
4322
|
+
onReset() {
|
|
4323
|
+
this.filterProxy.initFilter().subscribe({
|
|
4324
|
+
next: (filter) => {
|
|
4325
|
+
this.currentItem.set(filter);
|
|
4326
|
+
},
|
|
4327
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4328
|
+
});
|
|
4329
|
+
}
|
|
4330
|
+
onExport() {
|
|
4331
|
+
this.filterProxy.downloadXLS(this.currentItem()).subscribe({
|
|
4332
|
+
next: (response) => {
|
|
4333
|
+
this.downloadBlobFile(response, 'application/zip', this.translateService.instant('@00000072') + '.zip');
|
|
4334
|
+
},
|
|
4335
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4336
|
+
});
|
|
4337
|
+
}
|
|
4338
|
+
async afterOnInit() { }
|
|
4339
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsFilterBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4340
|
+
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 });
|
|
4341
|
+
}
|
|
4342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsFilterBase, decorators: [{
|
|
4343
|
+
type: Component,
|
|
4344
|
+
args: [{ selector: 'ntybase-netty-apps-base', imports: [], template: `` }]
|
|
4345
|
+
}], 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 }] }] } });
|
|
4346
|
+
|
|
4262
4347
|
/*
|
|
4263
4348
|
* Public API Surface of ntybase
|
|
4264
4349
|
*/
|
|
@@ -4267,5 +4352,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
4267
4352
|
* Generated bundle index. Do not edit.
|
|
4268
4353
|
*/
|
|
4269
4354
|
|
|
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 };
|
|
4355
|
+
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
4356
|
//# sourceMappingURL=nettyapps-ntybase.mjs.map
|