ln-20-lib-components 0.0.43 → 0.0.45

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,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { computed, ViewChild, Component } from '@angular/core';
3
- import { B as BaseDialogComponent, T as TableNgComponent, a as ButtonNgComponent } from './ln-20-lib-components-ln-20-lib-components-BDpTINBO.mjs';
3
+ import { B as BaseDialogComponent, T as TableNgComponent, a as ButtonNgComponent } from './ln-20-lib-components-ln-20-lib-components-TZnqAEjI.mjs';
4
4
 
5
5
  class SelectedItemsManagementComponent extends BaseDialogComponent {
6
6
  tableNg;
@@ -52,4 +52,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
52
52
  }] } });
53
53
 
54
54
  export { SelectedItemsManagementComponent };
55
- //# sourceMappingURL=ln-20-lib-components-selected-items-management.component-NSj11IZ9.mjs.map
55
+ //# sourceMappingURL=ln-20-lib-components-selected-items-management.component-C_cWQ9d3.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ln-20-lib-components-selected-items-management.component-NSj11IZ9.mjs","sources":["../../../projects/lib-components/src/lib/components/prime-ng/table-ng/components/selected-items-management/selected-items-management.component.ts","../../../projects/lib-components/src/lib/components/prime-ng/table-ng/components/selected-items-management/selected-items-management.component.html"],"sourcesContent":["import type { OnInit, Signal } from '@angular/core'\r\nimport { Component, computed, ViewChild } from '@angular/core'\r\nimport { ButtonNgComponent } from '../../../button-ng/button-ng.component'\r\nimport type { IButtonConfig } from '../../../button-ng/interfaces'\r\nimport { BaseDialogComponent } from '../../../dynamic-dialog/components/base-dialog.component'\r\nimport type { ITableNgConfig, ITableNgData } from '../../interfaces'\r\nimport { TableNgComponent } from '../../table-ng.component'\r\n\r\n@Component({\r\n selector: 'lib-selected-items-management',\r\n imports: [TableNgComponent, ButtonNgComponent],\r\n templateUrl: './selected-items-management.component.html',\r\n styleUrl: './selected-items-management.component.scss'\r\n})\r\nexport class SelectedItemsManagementComponent extends BaseDialogComponent implements OnInit {\r\n @ViewChild('tableNg') tableNg!: TableNgComponent\r\n\r\n constructor(\r\n ) {\r\n super()\r\n }\r\n protected selectedItems: ITableNgData[] = []\r\n protected configTable?: ITableNgConfig | undefined\r\n ngOnInit(): void {\r\n if (this.data) {\r\n const selectedItems: ITableNgData[] = this.data?.selectedItems as ITableNgData[] ?? []\r\n const config: ITableNgConfig | undefined = this.data?.config as ITableNgConfig | undefined\r\n this.selectedItems = selectedItems\r\n this.configTable = config\r\n }\r\n }\r\n\r\n buttonsSubmit: Signal<IButtonConfig[]> = computed(() => {\r\n const buttons: IButtonConfig[] = [\r\n {\r\n label: 'Aceptar',\r\n severity: 'success',\r\n onClick: () => {\r\n this.submitSelection('accept')\r\n }\r\n },\r\n {\r\n label: 'Cerrar',\r\n severity: 'info',\r\n onClick: () => {\r\n this.submitSelection('reject')\r\n }\r\n }\r\n ]\r\n return buttons\r\n })\r\n\r\n submitSelection(flag: 'accept' | 'reject') {\r\n const selectedItems: ITableNgData[] = this.tableNg.dt.selection as ITableNgData[]\r\n this.ref.close(flag === 'accept' ? selectedItems : undefined)\r\n }\r\n\r\n}\r\n","<div class=\"flex flex-col gap-4 relative\">\r\n <lib-table-ng\r\n #tableNg\r\n [data]=\"selectedItems\"\r\n [config]=\"configTable\"\r\n [selectedItems]=\"selectedItems\"\r\n ></lib-table-ng>\r\n <div class=\"flex gap-2 mr-5 justify-end items-end sticky bottom-5 z-50\">\r\n @for (btn of buttonsSubmit(); track $index) {\r\n <lib-button-ng [buttonConfig]=\"btn\"></lib-button-ng>\r\n }\r\n </div>\r\n</div>\r\n<div class=\"mb-10\"></div>\r\n"],"names":[],"mappings":";;;;AAcM,MAAO,gCAAiC,SAAQ,mBAAmB,CAAA;AACjD,IAAA,OAAO;AAE7B,IAAA,WAAA,GAAA;AAEE,QAAA,KAAK,EAAE;IACT;IACU,aAAa,GAAmB,EAAE;A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AA,QAAA,EAAA,+BAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,SAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECd7C,qdAcA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDJY,gBAAgB,0pBAAE,iBAAiB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,CAAA,EAAA,OAAA,EAAA,CAAA,oBAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAIlC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAN5C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,EAAA,OAAA,EAChC,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,EAAA,QAAA,EAAA,qdAAA,EAAA;wDAKxB,OAAO,EAAA,CAAA;sBAA5B,SAAS;uBAAC,SAAS;;;;;"}
1
+ {"version":3,"file":"ln-20-lib-components-selected-items-management.component-C_cWQ9d3.mjs","sources":["../../../projects/lib-components/src/lib/components/prime-ng/table-ng/components/selected-items-management/selected-items-management.component.ts","../../../projects/lib-components/src/lib/components/prime-ng/table-ng/components/selected-items-management/selected-items-management.component.html"],"sourcesContent":["import type { OnInit, Signal } from '@angular/core'\r\nimport { Component, computed, ViewChild } from '@angular/core'\r\nimport { ButtonNgComponent } from '../../../button-ng/button-ng.component'\r\nimport type { IButtonConfig } from '../../../button-ng/interfaces'\r\nimport { BaseDialogComponent } from '../../../dynamic-dialog/components/base-dialog.component'\r\nimport type { ITableNgConfig, ITableNgData } from '../../interfaces'\r\nimport { TableNgComponent } from '../../table-ng.component'\r\n\r\n@Component({\r\n selector: 'lib-selected-items-management',\r\n imports: [TableNgComponent, ButtonNgComponent],\r\n templateUrl: './selected-items-management.component.html',\r\n styleUrl: './selected-items-management.component.scss'\r\n})\r\nexport class SelectedItemsManagementComponent extends BaseDialogComponent implements OnInit {\r\n @ViewChild('tableNg') tableNg!: TableNgComponent\r\n\r\n constructor(\r\n ) {\r\n super()\r\n }\r\n protected selectedItems: ITableNgData[] = []\r\n protected configTable?: ITableNgConfig | undefined\r\n ngOnInit(): void {\r\n if (this.data) {\r\n const selectedItems: ITableNgData[] = this.data?.selectedItems as ITableNgData[] ?? []\r\n const config: ITableNgConfig | undefined = this.data?.config as ITableNgConfig | undefined\r\n this.selectedItems = selectedItems\r\n this.configTable = config\r\n }\r\n }\r\n\r\n buttonsSubmit: Signal<IButtonConfig[]> = computed(() => {\r\n const buttons: IButtonConfig[] = [\r\n {\r\n label: 'Aceptar',\r\n severity: 'success',\r\n onClick: () => {\r\n this.submitSelection('accept')\r\n }\r\n },\r\n {\r\n label: 'Cerrar',\r\n severity: 'info',\r\n onClick: () => {\r\n this.submitSelection('reject')\r\n }\r\n }\r\n ]\r\n return buttons\r\n })\r\n\r\n submitSelection(flag: 'accept' | 'reject') {\r\n const selectedItems: ITableNgData[] = this.tableNg.dt.selection as ITableNgData[]\r\n this.ref.close(flag === 'accept' ? selectedItems : undefined)\r\n }\r\n\r\n}\r\n","<div class=\"flex flex-col gap-4 relative\">\r\n <lib-table-ng\r\n #tableNg\r\n [data]=\"selectedItems\"\r\n [config]=\"configTable\"\r\n [selectedItems]=\"selectedItems\"\r\n ></lib-table-ng>\r\n <div class=\"flex gap-2 mr-5 justify-end items-end sticky bottom-5 z-50\">\r\n @for (btn of buttonsSubmit(); track $index) {\r\n <lib-button-ng [buttonConfig]=\"btn\"></lib-button-ng>\r\n }\r\n </div>\r\n</div>\r\n<div class=\"mb-10\"></div>\r\n"],"names":[],"mappings":";;;;AAcM,MAAO,gCAAiC,SAAQ,mBAAmB,CAAA;AACjD,IAAA,OAAO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AA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gCAAgC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,+BAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,SAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECd7C,qdAcA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDJY,gBAAgB,0pBAAE,iBAAiB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,CAAA,EAAA,OAAA,EAAA,CAAA,oBAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAIlC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAN5C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,EAAA,OAAA,EAChC,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,EAAA,QAAA,EAAA,qdAAA,EAAA;wDAKxB,OAAO,EAAA,CAAA;sBAA5B,SAAS;uBAAC,SAAS;;;;;"}
@@ -1,2 +1,2 @@
1
- export { A as AminatedContainerComponent, a as ButtonNgComponent, D as DisabledContainerComponent, E as ETypeInput, F as FormComponent, H as HttpMessageComponent, I as InlineInputComponent, b as LibComponentsComponent, L as LibComponentsService, S as SpeedDialComponent, d as SpeedDialNgComponent, c as SpeedDialService, T as TableNgComponent } from './ln-20-lib-components-ln-20-lib-components-BDpTINBO.mjs';
1
+ export { A as AminatedContainerComponent, a as ButtonNgComponent, D as DisabledContainerComponent, E as ETypeInput, F as FormComponent, H as HttpMessageComponent, I as InlineInputComponent, b as LibComponentsComponent, L as LibComponentsService, S as SpeedDialComponent, d as SpeedDialNgComponent, c as SpeedDialService, T as TableNgComponent } from './ln-20-lib-components-ln-20-lib-components-TZnqAEjI.mjs';
2
2
  //# sourceMappingURL=ln-20-lib-components.mjs.map
@@ -33,5 +33,6 @@ export declare enum ETypeInput {
33
33
  BADGE = "badge",
34
34
  DECIMAL = "decimal",
35
35
  IMAGE = "image",
36
- COMPONENT = "component"
36
+ COMPONENT = "component",
37
+ INPUT = "input"
37
38
  }
@@ -12,6 +12,7 @@ export interface ITableNgData<T = IRowData, R = unknown> {
12
12
  rowDataComponents?: Record<string, TemplateRef<{
13
13
  $implicit: T;
14
14
  }>>;
15
+ rowDataInput?: Record<string, InlineControlConfig>;
15
16
  typeCell?: Record<string, ETypeInput>;
16
17
  currencyTypeCellConfig?: Record<string, ICurrencyConfig>;
17
18
  componentTypeCellConfig?: Record<string, TemplateRef<unknown>>;
@@ -92,6 +93,12 @@ export interface ITableNgConfig {
92
93
  pdfConfig?: IPdfConfig;
93
94
  labelsConfig?: ITableNgLabelsTitleConfig;
94
95
  refreshConfig?: IRefreshConfig;
96
+ inputConfig?: Record<string, IInputConfig>;
97
+ hasCheckRows?: boolean;
98
+ }
99
+ export interface IInputConfig {
100
+ isEnabled: boolean;
101
+ type: ETypeInput;
95
102
  }
96
103
  export interface IRefreshConfig {
97
104
  isEnabled: boolean;
@@ -7,9 +7,10 @@ import type { IControlConfig } from '../../origin/form/interfaces';
7
7
  import type { IHttpMessage } from '../../origin/http-message/interfaces';
8
8
  import type { IPickListElement } from '../../origin/pick-list/interfaces';
9
9
  import type { IButtonConfig } from '../button-ng/interfaces';
10
+ import { InlineControlConfig } from "../../origin";
11
+ import { ISpeedDialConfig } from '../../origin/speed-dial/interfaces';
10
12
  import { IPrimeNgSelection } from '../interfaces';
11
13
  import type { IEditTableNgConfig, IErrorConfig, IFooterConfig, IGlobalSearchForm, ILazyLoadResponse, IPipeConfig, ITableNgConfig, ITableNgData } from './interfaces';
12
- import { ISpeedDialConfig } from '../../origin/speed-dial/interfaces';
13
14
  import * as i0 from "@angular/core";
14
15
  export declare class TableNgComponent<T extends Record<string, any> = Record<string, any>> implements OnInit, OnDestroy {
15
16
  private readonly tableNgService;
@@ -42,6 +43,21 @@ export declare class TableNgComponent<T extends Record<string, any> = Record<str
42
43
  advancedFiltersValues: WritableSignal<Record<string, Record<string, any>>>;
43
44
  dt: Table;
44
45
  private readonly fb;
46
+ protected inlineConfigCheckHeader(typeInput: ETypeInput): InlineControlConfig;
47
+ protected inlineConfigCheckHeaderCheckAll: InlineControlConfig;
48
+ /**
49
+ * Celda editable como `INPUT` cuyo control es CHECKBOX o SWITCH (según `rowDataInput`).
50
+ */
51
+ private isInputCheckboxOrSwitchCell;
52
+ /**
53
+ * Estado del check "todos" del toolbar: true solo si hay al menos una celda
54
+ * INPUT + (CHECKBOX | SWITCH) y todas esas celdas (todas las columnas y filas) son truthy.
55
+ */
56
+ protected checkAllHeaderReflectValue(): boolean;
57
+ /**
58
+ * Toolbar: pone `value` en todas las celdas que cumplan INPUT + (CHECKBOX | SWITCH), en todas las columnas de `config.keys`.
59
+ */
60
+ protected checkAll(value: boolean): void;
45
61
  /** Get pagination report template with default English value */
46
62
  protected getCustomPageReport(): string;
47
63
  /** Get selected items label with default English value */
@@ -73,6 +89,15 @@ export declare class TableNgComponent<T extends Record<string, any> = Record<str
73
89
  onFilter(event: TableFilterEvent): void;
74
90
  resetRowDatas(): void;
75
91
  get ETypeInput(): typeof ETypeInput;
92
+ /**
93
+ * Refleja en el header si todas las filas tienen `true` en esa columna (solo lectura visual).
94
+ * Si hay mezcla o todo es false, devuelve false.
95
+ */
96
+ protected booleanColumnHeaderReflectValue(columnKey: string): boolean;
97
+ /**
98
+ * Asigna el mismo booleano solo a filas cuya celda en esa columna sea INPUT + (CHECKBOX | SWITCH).
99
+ */
100
+ applyBulkBooleanToColumn(value: boolean, columnKey: string): void;
76
101
  handleAdvancedFiltersPerformed(filters: TableFilterEvent['filters']): void;
77
102
  numberOfRecords: Signal<number>;
78
103
  hasRecords: Signal<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ln-20-lib-components",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0",