@nettyapps/ntybase 0.0.3 → 0.0.4

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.
@@ -1152,6 +1152,7 @@ class AgGridBase {
1152
1152
  popupValid = input(false, ...(ngDevMode ? [{ debugName: "popupValid" }] : []));
1153
1153
  params = input('', ...(ngDevMode ? [{ debugName: "params" }] : []));
1154
1154
  parameters = input('', ...(ngDevMode ? [{ debugName: "parameters" }] : []));
1155
+ isEmbedded = signal(false, ...(ngDevMode ? [{ debugName: "isEmbedded" }] : []));
1155
1156
  // Authentication
1156
1157
  authenticationList = [];
1157
1158
  // User access writes
@@ -1168,11 +1169,6 @@ class AgGridBase {
1168
1169
  refreshButtonValid = signal(false, ...(ngDevMode ? [{ debugName: "refreshButtonValid" }] : []));
1169
1170
  // Parameters for embeded components
1170
1171
  selectedElement = output();
1171
- // Filter Parameters
1172
- filterField = input(null, ...(ngDevMode ? [{ debugName: "filterField" }] : []));
1173
- filterFieldValue = input(null, ...(ngDevMode ? [{ debugName: "filterFieldValue" }] : []));
1174
- filterFieldNumeric = input(false, ...(ngDevMode ? [{ debugName: "filterFieldNumeric" }] : []));
1175
- filterFieldEquality = input('=', ...(ngDevMode ? [{ debugName: "filterFieldEquality" }] : []));
1176
1172
  // AG-Grid theme setting (dark mode)
1177
1173
  theme = myTheme;
1178
1174
  // Grid references
@@ -1468,10 +1464,10 @@ class AgGridBase {
1468
1464
  onGridReady(params) {
1469
1465
  this.gridApi = params.api;
1470
1466
  this.gridApi.addEventListener('selectionChanged', () => {
1471
- const selectedNodes = this.gridApi.getSelectedNodes();
1467
+ // Null-safe approach
1468
+ const selectedNodes = this.gridApi?.getSelectedNodes?.() || [];
1472
1469
  this.selectedRows.set(selectedNodes.map((node) => node.data));
1473
1470
  });
1474
- // Apply the saved filter when the grid is ready
1475
1471
  if (this.searchValue()) {
1476
1472
  this.gridApi.setGridOption('quickFilterText', this.searchValue());
1477
1473
  }
@@ -1510,7 +1506,7 @@ class AgGridBase {
1510
1506
  backClicked() {
1511
1507
  this.commonService.goBack();
1512
1508
  }
1513
- gotoURL(routePrefix, rightSidenav = [], parameters, type, isNewTab = false, embedded = false, dialogComponent) {
1509
+ gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this.isEmbedded()) {
1514
1510
  const navigationExtras = {
1515
1511
  queryParams: {
1516
1512
  parameters: JSON.stringify(parameters),
@@ -1526,7 +1522,7 @@ class AgGridBase {
1526
1522
  window.open(fullUrl, '_blank');
1527
1523
  return;
1528
1524
  }
1529
- if (embedded && dialogComponent) {
1525
+ if (isPopup && dialogComponent) {
1530
1526
  this.dialog
1531
1527
  .open(dialogComponent, {
1532
1528
  data: {
@@ -1682,7 +1678,7 @@ class AgGridBase {
1682
1678
  return true;
1683
1679
  }
1684
1680
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AgGridBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
1685
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: AgGridBase, isStandalone: true, selector: "ntybase-ag-grid-base", inputs: { readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, popupFilterValid: { classPropertyName: "popupFilterValid", publicName: "popupFilterValid", isSignal: true, isRequired: false, transformFunction: null }, popupValid: { classPropertyName: "popupValid", publicName: "popupValid", isSignal: true, isRequired: false, transformFunction: null }, params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, filterField: { classPropertyName: "filterField", publicName: "filterField", isSignal: true, isRequired: false, transformFunction: null }, filterFieldValue: { classPropertyName: "filterFieldValue", publicName: "filterFieldValue", isSignal: true, isRequired: false, transformFunction: null }, filterFieldNumeric: { classPropertyName: "filterFieldNumeric", publicName: "filterFieldNumeric", isSignal: true, isRequired: false, transformFunction: null }, filterFieldEquality: { classPropertyName: "filterFieldEquality", publicName: "filterFieldEquality", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedElement: "selectedElement" }, usesOnChanges: true, ngImport: i0, template: "<p>ag-grid-base works!</p>\n", styles: [""] });
1681
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: AgGridBase, isStandalone: true, selector: "ntybase-ag-grid-base", inputs: { readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, popupFilterValid: { classPropertyName: "popupFilterValid", publicName: "popupFilterValid", isSignal: true, isRequired: false, transformFunction: null }, popupValid: { classPropertyName: "popupValid", publicName: "popupValid", isSignal: true, isRequired: false, transformFunction: null }, params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedElement: "selectedElement" }, usesOnChanges: true, ngImport: i0, template: "<p>ag-grid-base works!</p>\n", styles: [""] });
1686
1682
  }
1687
1683
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AgGridBase, decorators: [{
1688
1684
  type: Component,
@@ -3043,22 +3039,53 @@ class AutoCompleteLookup {
3043
3039
  // Output
3044
3040
  selectedElement = output();
3045
3041
  ngOnInit() {
3046
- // Initialize with dialog data first
3047
- if (this.data) {
3048
- this.loadComponent(this.data);
3042
+ this.initializeComponent();
3043
+ }
3044
+ ngOnChanges(changes) {
3045
+ if (this.isComponentConfigChanged(changes)) {
3046
+ this.initializeComponent();
3049
3047
  }
3050
3048
  }
3049
+ isComponentConfigChanged(changes) {
3050
+ return (!!changes['component'] ||
3051
+ !!changes['filterField'] ||
3052
+ !!changes['filterFieldValue'] ||
3053
+ !!changes['filterFieldNumeric'] ||
3054
+ !!changes['filterFieldEquality']);
3055
+ }
3056
+ initializeComponent() {
3057
+ // Dialog data'sı varsa onu kullan, yoksa input'ları kullan
3058
+ const config = this.data || this.getInputConfig();
3059
+ this.loadComponent(config);
3060
+ }
3061
+ getInputConfig() {
3062
+ return {
3063
+ component: this.component(),
3064
+ filterField: this.filterField(),
3065
+ filterFieldValue: this.filterFieldValue(),
3066
+ filterFieldNumeric: this.filterFieldNumeric(),
3067
+ filterFieldEquality: this.filterFieldEquality(),
3068
+ };
3069
+ }
3051
3070
  loadComponent(config) {
3052
3071
  if (!config?.component)
3053
3072
  return;
3054
3073
  this.container.clear();
3055
3074
  const componentRef = this.container.createComponent(config.component);
3056
- // Set all inputs using setInput
3075
+ // Input'ları doğru şekilde set et - fonksiyon çağrısı YOK
3057
3076
  componentRef.setInput('popupValid', true);
3058
- componentRef.setInput('filterField', config.filterField);
3059
- componentRef.setInput('filterFieldValue', config.filterFieldValue);
3060
- componentRef.setInput('filterFieldEquality', config.filterFieldEquality);
3061
- componentRef.setInput('filterFieldNumeric', config.filterFieldNumeric);
3077
+ if (config.filterField !== undefined) {
3078
+ componentRef.setInput('filterField', config.filterField);
3079
+ }
3080
+ if (config.filterFieldValue !== undefined) {
3081
+ componentRef.setInput('filterFieldValue', config.filterFieldValue);
3082
+ }
3083
+ if (config.filterFieldEquality !== undefined) {
3084
+ componentRef.setInput('filterFieldEquality', config.filterFieldEquality);
3085
+ }
3086
+ if (config.filterFieldNumeric !== undefined) {
3087
+ componentRef.setInput('filterFieldNumeric', config.filterFieldNumeric);
3088
+ }
3062
3089
  // Handle output
3063
3090
  const sub = componentRef.instance.selectedElement.subscribe((data) => {
3064
3091
  this.selectedElement.emit(data);
@@ -3067,7 +3094,7 @@ class AutoCompleteLookup {
3067
3094
  componentRef.onDestroy(() => sub.unsubscribe());
3068
3095
  }
3069
3096
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AutoCompleteLookup, deps: [], target: i0.ɵɵFactoryTarget.Component });
3070
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: AutoCompleteLookup, isStandalone: true, selector: "ntybase-auto-complete-lookup", inputs: { component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: false, transformFunction: null }, filterField: { classPropertyName: "filterField", publicName: "filterField", isSignal: true, isRequired: false, transformFunction: null }, filterFieldValue: { classPropertyName: "filterFieldValue", publicName: "filterFieldValue", isSignal: true, isRequired: false, transformFunction: null }, filterFieldNumeric: { classPropertyName: "filterFieldNumeric", publicName: "filterFieldNumeric", isSignal: true, isRequired: false, transformFunction: null }, filterFieldEquality: { classPropertyName: "filterFieldEquality", publicName: "filterFieldEquality", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedElement: "selectedElement" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: ` <ng-template #container></ng-template> `, isInline: true });
3097
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: AutoCompleteLookup, isStandalone: true, selector: "ntybase-auto-complete-lookup", inputs: { component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: false, transformFunction: null }, filterField: { classPropertyName: "filterField", publicName: "filterField", isSignal: true, isRequired: false, transformFunction: null }, filterFieldValue: { classPropertyName: "filterFieldValue", publicName: "filterFieldValue", isSignal: true, isRequired: false, transformFunction: null }, filterFieldNumeric: { classPropertyName: "filterFieldNumeric", publicName: "filterFieldNumeric", isSignal: true, isRequired: false, transformFunction: null }, filterFieldEquality: { classPropertyName: "filterFieldEquality", publicName: "filterFieldEquality", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedElement: "selectedElement" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: ` <ng-template #container></ng-template> `, isInline: true });
3071
3098
  }
3072
3099
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AutoCompleteLookup, decorators: [{
3073
3100
  type: Component,