keevo-components 1.8.347 → 1.8.349

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,15 +1,4 @@
1
1
  export default interface OrgChartConfig {
2
- /**
3
- * @type {string}
4
- * Esse item espera uma string html template
5
- * (no formato angular com interpolação de variaveis via {{data.'PROPIEDADE DESEJADA'}})
6
- * Todos os dados expostos na propiedade data de
7
- * cada item estão acessiveis pelo objeto data;
8
- * Para realizar interpolação, referencie data entre {{}} e a chave desejada;
9
- ** Exemplo: ` <h1> Nome: {{data.nome}} </h1> `
10
- *
11
- */
12
- templateItem: string;
13
2
  /**
14
3
  * @type {number}
15
4
  * Esse item espera receber a largura media do card, para calculo do icone de collapse
@@ -19,7 +8,12 @@ export default interface OrgChartConfig {
19
8
  * @type {number}
20
9
  * Esse item espera receber a altura media do card, para calculo do icone de collapse
21
10
  */
22
- cardHeight: number;
11
+ cardHeight: number | string;
12
+ /**
13
+ * @type {number}
14
+ * Esse item espera receber a altura media do card, para calculo do icone de collapse
15
+ */
16
+ cardExpandedHeight?: number | string;
23
17
  /**
24
18
  * @type {string}
25
19
  * Esse item espera receber a cor das connections
@@ -32,4 +26,10 @@ export default interface OrgChartConfig {
32
26
  * * Default { 2 }
33
27
  */
34
28
  conectionWidth?: number;
29
+ /**
30
+ * @type {string[]}
31
+ * Esse item espera receber o sletores css para emissão do evento de click
32
+ * * Default { 2 }
33
+ */
34
+ clicks?: string[];
35
35
  }
@@ -1,4 +1,4 @@
1
- export default interface OrgChartItem {
1
+ export default interface OrgChartNode {
2
2
  /**
3
3
  * @type {number}
4
4
  * Esse item espera receber o identificador do card
@@ -12,15 +12,21 @@ export default interface OrgChartItem {
12
12
  * @warning Caso tenha mais de um objeto com {{ parentId: null }} havera um erro de multiplos roots
13
13
  */
14
14
  parentId: number | null;
15
+ /**
16
+ * @type {T[]}
17
+ * Nós filhos desse nó
18
+ */
19
+ children?: any[];
15
20
  /**
16
21
  * @type {object}
17
22
  * Esse item espera receber os dados do card
18
23
  * @warning Mantenha a consistencia de dados, caso tente acessar um dado que não exista em outro objeto havera um erro
19
24
  */
20
- data: object;
25
+ data: any;
21
26
  /**
22
- * @type {object | undefined}
23
- * Esse item espera receber um template personalizado para este nó em especifico
27
+ * @type {object}
28
+ * Esse item espera receber os dados do card
29
+ * @warning Mantenha a consistencia de dados, caso tente acessar um dado que não exista em outro objeto havera um erro
24
30
  */
25
- template?: string;
31
+ expanded: any;
26
32
  }
@@ -0,0 +1,20 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import OrgChartNode from '../components/chart/orchartnode';
3
+ import * as i0 from "@angular/core";
4
+ export declare class OrgChartService {
5
+ private nodeAddSubject;
6
+ nodeAdd$: import("rxjs").Observable<OrgChartNode>;
7
+ private nodeRemoveSubject;
8
+ nodeRemove$: import("rxjs").Observable<number>;
9
+ nodeRemove: EventEmitter<number>;
10
+ nodeClick: EventEmitter<{
11
+ node: OrgChartNode;
12
+ seletorCss: string;
13
+ }>;
14
+ adicionarNode(node: OrgChartNode): void;
15
+ removerNode(id: number): void;
16
+ setNodeExpanded(orgSource: OrgChartNode[], nodeId: number, expanded: boolean): OrgChartNode[];
17
+ modificarCampDataNode<T>(orgSource: OrgChartNode[], nodeId: number, field: keyof OrgChartNode['data'], value: T): OrgChartNode[];
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<OrgChartService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<OrgChartService>;
20
+ }
@@ -1,26 +1,34 @@
1
- import { ElementRef, OnInit, Renderer2, TemplateRef } from '@angular/core';
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import OrgChartConfig from '../../api/components/chart/orchart.config';
3
- import OrgChartItem from '../../api/components/chart/orchart.item';
3
+ import OrgChartNode from '../../api/components/chart/orchartnode';
4
+ import { OrgChartService } from '../../api/services/orgchart.service';
4
5
  import * as i0 from "@angular/core";
5
- export declare class KvOrgchartComponent implements OnInit {
6
- private renderer;
7
- chartContainer: ElementRef;
6
+ export declare class KvOrgchartComponent {
7
+ private cdr;
8
+ private service;
8
9
  chart: any;
9
- dataSource: OrgChartItem[];
10
+ dataSource: import("@angular/core").ModelSignal<OrgChartNode[] | null>;
10
11
  config: OrgChartConfig;
11
- template: string;
12
+ chartContainer: ElementRef;
13
+ viewContainerRef: ViewContainerRef;
12
14
  nodeTemplate: TemplateRef<any>;
13
- generateTemplate: Function;
14
- templateFuncion: boolean;
15
- corDeFundo: string;
15
+ onNodeClick: EventEmitter<any>;
16
16
  compact: boolean;
17
17
  mostraMenu: boolean;
18
- constructor(renderer: Renderer2);
18
+ constructor(cdr: ChangeDetectorRef, service: OrgChartService);
19
19
  ngOnInit(): void;
20
20
  ngAfterViewInit(): void;
21
- ngOnChanges(): void;
22
- updateChart(): void;
23
- stringToTemplateLiteral(string: string): string;
21
+ iniciarChart(): void;
22
+ ngOnChanges(changes: SimpleChanges): void;
23
+ renderNodeTemplate(node: OrgChartNode): string;
24
+ private nodeClickSubscription;
25
+ private nodeAddSubscription;
26
+ private nodeRemoveSubscription;
27
+ iniciarHandlersDeEventos(): void;
28
+ ngOnDestroy(): void;
29
+ emitirClick(node: Node, seletorCss?: string): void;
30
+ adicionarNode(node: OrgChartNode): void;
31
+ removerNode(id: number): void;
24
32
  static ɵfac: i0.ɵɵFactoryDeclaration<KvOrgchartComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<KvOrgchartComponent, "kv-orgchart", never, { "dataSource": { "alias": "dataSource"; "required": false; }; "config": { "alias": "config"; "required": false; }; "template": { "alias": "template"; "required": false; }; "nodeTemplate": { "alias": "nodeTemplate"; "required": false; }; "generateTemplate": { "alias": "generateTemplate"; "required": false; }; "templateFuncion": { "alias": "templateFuncion"; "required": false; }; "corDeFundo": { "alias": "corDeFundo"; "required": false; }; }, {}, never, never, false, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<KvOrgchartComponent, "kv-orgchart", never, { "dataSource": { "alias": "dataSource"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; }; "nodeTemplate": { "alias": "nodeTemplate"; "required": false; }; }, { "dataSource": "dataSourceChange"; "onNodeClick": "onNodeClick"; }, never, never, false, never>;
26
34
  }
@@ -2,8 +2,10 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./kv-orgchart.component";
3
3
  import * as i2 from "@angular/common";
4
4
  import * as i3 from "../../api/modules/primeng.module";
5
+ import * as i4 from "../kv-error/kv-error.module";
6
+ import * as i5 from "primeng/organizationchart";
5
7
  export declare class KvOrgchartModule {
6
8
  static ɵfac: i0.ɵɵFactoryDeclaration<KvOrgchartModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<KvOrgchartModule, [typeof i1.KvOrgchartComponent], [typeof i2.CommonModule, typeof i3.PrimeNgModule], [typeof i1.KvOrgchartComponent]>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<KvOrgchartModule, [typeof i1.KvOrgchartComponent], [typeof i2.CommonModule, typeof i3.PrimeNgModule, typeof i4.kvErrorModule, typeof i3.PrimeNgModule, typeof i5.OrganizationChartModule], [typeof i1.KvOrgchartComponent]>;
8
10
  static ɵinj: i0.ɵɵInjectorDeclaration<KvOrgchartModule>;
9
11
  }
@@ -132,7 +132,7 @@ export declare class KvTableComponent implements OnInit, DoCheck, AfterViewInit
132
132
  onClickEvent(event: any): void;
133
133
  styleSetter(style: string, data: string): void;
134
134
  checkMenuFiltro(col: any): void;
135
- sortByPosition(): (elem1: any, elem2: any) => 0 | 1 | -1;
135
+ sortByPosition(): (elem1: any, elem2: any) => 1 | 0 | -1;
136
136
  dinamicDisableColumn(col: TableConfigColumn): boolean;
137
137
  checkHideColumns(): void;
138
138
  getCustomTemplate(templatename: string): TemplateRef<any>;
@@ -64,7 +64,7 @@ export declare class KvTableExpandableComponent implements OnInit, DoCheck {
64
64
  onGlobalFilter(table: Table, event: Event): void;
65
65
  executeCollapsed(): void;
66
66
  checkMenuFiltro(col: any): void;
67
- sortByPosition(): (elem1: any, elem2: any) => 0 | 1 | -1;
67
+ sortByPosition(): (elem1: any, elem2: any) => 1 | 0 | -1;
68
68
  dinamicDisableColumn(col: TableConfigColumn): boolean;
69
69
  dinamicColumnSet(e: any, col: any): void;
70
70
  addColumn(field: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keevo-components",
3
- "version": "1.8.347",
3
+ "version": "1.8.349",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.8",
6
6
  "@angular/core": "^17.3.8",
package/public-api.d.ts CHANGED
@@ -92,6 +92,7 @@ export * from './lib/components/kv-inputs/kv-select-buttons/kv-select-buttons.co
92
92
  */
93
93
  export * from './lib/components/kv-orgchart/kv-orgchart.component';
94
94
  export * from './lib/components/kv-orgchart/kv-orgchart.module';
95
+ export * from './lib/api/services/orgchart.service';
95
96
  /**
96
97
  * Picklist
97
98
  */
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JjaGFydC5pdGVtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMva2Vldm8tY29tcG9uZW50cy9zcmMvbGliL2FwaS9jb21wb25lbnRzL2NoYXJ0L29yY2hhcnQuaXRlbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgaW50ZXJmYWNlIE9yZ0NoYXJ0SXRlbXtcclxuXHJcbiAgLyoqXHJcbiAgICogQHR5cGUge251bWJlcn1cclxuICAgKiBFc3NlIGl0ZW0gZXNwZXJhIHJlY2ViZXIgbyBpZGVudGlmaWNhZG9yIGRvIGNhcmRcclxuICAgKi9cclxuICBpZDogbnVtYmVyO1xyXG5cclxuICAvKipc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