keevo-components 1.8.348 → 1.8.350
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.
- package/esm2022/lib/api/components/chart/orchart.config.mjs +1 -1
- package/esm2022/lib/api/components/chart/orchartnode.mjs +2 -0
- package/esm2022/lib/api/services/image.cutter.service.mjs +20 -15
- package/esm2022/lib/api/services/orgchart.service.mjs +64 -0
- package/esm2022/lib/components/kv-orgchart/kv-orgchart.component.mjs +139 -66
- package/esm2022/lib/components/kv-orgchart/kv-orgchart.module.mjs +16 -5
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/keevo-components.mjs +229 -82
- package/fesm2022/keevo-components.mjs.map +1 -1
- package/lib/api/components/chart/orchart.config.d.ts +12 -12
- package/lib/api/components/chart/{orchart.item.d.ts → orchartnode.d.ts} +13 -5
- package/lib/api/services/orgchart.service.d.ts +20 -0
- package/lib/components/kv-orgchart/kv-orgchart.component.d.ts +23 -15
- package/lib/components/kv-orgchart/kv-orgchart.module.d.ts +3 -1
- package/lib/components/kv-table/kv-table.component.d.ts +1 -1
- package/lib/components/kv-table-expandable/kv-table-expandable.component.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/esm2022/lib/api/components/chart/orchart.item.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, Input, Output, ViewChild, Injectable, Directive, Pipe, ViewChildren, ContentChildren, forwardRef, signal, model, effect, HostListener, NgModule, computed, input, viewChild, inject, contentChildren, ChangeDetectionStrategy, HostBinding, Injector } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Input, Output, ViewChild, Injectable, Directive, Pipe, ViewChildren, ContentChildren, forwardRef, signal, model, effect, HostListener, NgModule, computed, input, viewChild, inject, contentChildren, ViewContainerRef, ChangeDetectionStrategy, HostBinding, Injector } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, NgClass } from '@angular/common';
|
|
5
5
|
import * as i1$1 from 'primeng/button';
|
|
@@ -14,7 +14,7 @@ import * as i2 from 'primeng/ripple';
|
|
|
14
14
|
import { RippleModule } from 'primeng/ripple';
|
|
15
15
|
import * as i2$1 from '@angular/forms';
|
|
16
16
|
import { FormGroup, NgControl, FormControlName, FormGroupDirective, NG_VALUE_ACCESSOR, Validators, FormsModule, ReactiveFormsModule, FormBuilder } from '@angular/forms';
|
|
17
|
-
import { Subject, finalize, combineLatest, filter, debounceTime, of, BehaviorSubject, takeUntil, timer } from 'rxjs';
|
|
17
|
+
import { Subject, finalize, combineLatest, filter, debounceTime, of, BehaviorSubject, fromEvent, takeUntil, timer } from 'rxjs';
|
|
18
18
|
import * as i1$3 from 'primeng/dynamicdialog';
|
|
19
19
|
import { DynamicDialogModule, DialogService, DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';
|
|
20
20
|
import * as i1$2 from 'primeng/api';
|
|
@@ -118,6 +118,7 @@ import Quill from 'quill';
|
|
|
118
118
|
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
|
119
119
|
import { OrgChart } from 'd3-org-chart';
|
|
120
120
|
import * as d3 from 'd3';
|
|
121
|
+
import { OrganizationChartModule } from 'primeng/organizationchart';
|
|
121
122
|
import { AutoCompleteModule } from 'primeng/autocomplete';
|
|
122
123
|
import * as vkbeautify from 'vkbeautify';
|
|
123
124
|
import * as i1$7 from '@angular/platform-browser';
|
|
@@ -4115,8 +4116,9 @@ class SimpleComponent {
|
|
|
4115
4116
|
this.startY = 0;
|
|
4116
4117
|
//? Fator de escala da imagem e zoom
|
|
4117
4118
|
this.scaleFactorReadOnly = computed(() => {
|
|
4118
|
-
return Math.min(this.scaleFactor(),
|
|
4119
|
+
return Math.min(this.scaleFactor(), this.scaleFactorInicial() + 5);
|
|
4119
4120
|
});
|
|
4121
|
+
this.scaleFactorInicial = signal(null);
|
|
4120
4122
|
this.scaleFactor = signal(null);
|
|
4121
4123
|
this.scaleFactorModel = 0;
|
|
4122
4124
|
this.imageX = 0;
|
|
@@ -4184,11 +4186,14 @@ class SimpleComponent {
|
|
|
4184
4186
|
//? Proporção da imagem
|
|
4185
4187
|
this.widthTela = signal(0);
|
|
4186
4188
|
this.heigthTela = signal(0);
|
|
4189
|
+
//#endregion
|
|
4190
|
+
//#region handlers de eventos
|
|
4191
|
+
this.comparadorOnZoomChange = this.scaleFactorInicial();
|
|
4187
4192
|
this.atualizaTamanhoTela();
|
|
4188
4193
|
}
|
|
4189
4194
|
setScaleFactorModel(valor) {
|
|
4190
|
-
this.scaleFactorModel = valor;
|
|
4191
|
-
this.scaleFactor.set(
|
|
4195
|
+
this.scaleFactorModel = valor - this.scaleFactorInicial();
|
|
4196
|
+
this.scaleFactor.set(valor);
|
|
4192
4197
|
}
|
|
4193
4198
|
onWindowResize() {
|
|
4194
4199
|
this.atualizaTamanhoTela();
|
|
@@ -4228,8 +4233,8 @@ class SimpleComponent {
|
|
|
4228
4233
|
//? Ajusta possição e zoom inicial
|
|
4229
4234
|
if (this._variaviesDialog()?.indCircle) {
|
|
4230
4235
|
const scaleFactor = (this.radius() * 2) / Math.min(imageWidth, imageHeight);
|
|
4236
|
+
this.scaleFactorInicial.set(scaleFactor);
|
|
4231
4237
|
this.setScaleFactorModel(scaleFactor);
|
|
4232
|
-
this.scaleFactor.set(scaleFactor);
|
|
4233
4238
|
}
|
|
4234
4239
|
else {
|
|
4235
4240
|
const scaleFactor = this.cutHeight() === this.cutWidth()
|
|
@@ -4239,8 +4244,8 @@ class SimpleComponent {
|
|
|
4239
4244
|
: this.cutHeight() > this.cutWidth()
|
|
4240
4245
|
? this.cutHeight() / imageHeight
|
|
4241
4246
|
: this.cutWidth() / imageWidth;
|
|
4247
|
+
this.scaleFactorInicial.set(scaleFactor);
|
|
4242
4248
|
this.setScaleFactorModel(scaleFactor);
|
|
4243
|
-
this.scaleFactor.set(scaleFactor);
|
|
4244
4249
|
}
|
|
4245
4250
|
this.imageX = Math.max((this.canvas().width - imageWidth * this.scaleFactorReadOnly()) / 2, this.xMin());
|
|
4246
4251
|
this.imageY = Math.max((this.canvasHeight() - imageHeight * this.scaleFactorReadOnly()) / 2, this.yMin());
|
|
@@ -4330,13 +4335,12 @@ class SimpleComponent {
|
|
|
4330
4335
|
}
|
|
4331
4336
|
}
|
|
4332
4337
|
}
|
|
4333
|
-
//#endregion
|
|
4334
|
-
//#region handlers de eventos
|
|
4335
4338
|
onZoomChange(e) {
|
|
4336
|
-
const prevZoom = this.
|
|
4339
|
+
const prevZoom = this.comparadorOnZoomChange;
|
|
4337
4340
|
const zoomValue = e.value;
|
|
4341
|
+
this.comparadorOnZoomChange = e.value;
|
|
4338
4342
|
const direction = prevZoom < zoomValue ? 'up' : 'down';
|
|
4339
|
-
this.ajustarZoom(direction);
|
|
4343
|
+
this.ajustarZoom(direction, e.value);
|
|
4340
4344
|
}
|
|
4341
4345
|
initializeMouseWheel(canvas, ctx, img) {
|
|
4342
4346
|
canvas.onwheel = (e) => {
|
|
@@ -4346,10 +4350,12 @@ class SimpleComponent {
|
|
|
4346
4350
|
this.ajustarZoom(direction);
|
|
4347
4351
|
};
|
|
4348
4352
|
}
|
|
4349
|
-
ajustarZoom(direction) {
|
|
4353
|
+
ajustarZoom(direction, value) {
|
|
4350
4354
|
const prevScaleFactor = this.scaleFactorReadOnly();
|
|
4351
|
-
const delta = direction == 'down' ? -0.
|
|
4352
|
-
let scaleFactor =
|
|
4355
|
+
const delta = direction == 'down' ? -0.015 : 0.015;
|
|
4356
|
+
let scaleFactor = prevScaleFactor + (delta * 1.4);
|
|
4357
|
+
if (value)
|
|
4358
|
+
scaleFactor = value + this.scaleFactorInicial();
|
|
4353
4359
|
const newHeight = this._Image().height * scaleFactor;
|
|
4354
4360
|
const newWidth = this._Image().width * scaleFactor;
|
|
4355
4361
|
if (this._variaviesDialog()?.indCircle) {
|
|
@@ -4546,7 +4552,7 @@ class SimpleComponent {
|
|
|
4546
4552
|
|
|
4547
4553
|
<div class="w-full mt-2">
|
|
4548
4554
|
<kv-label label="Zoom" style="text-align: left;" />
|
|
4549
|
-
<p-slider [(ngModel)]="this.scaleFactorModel" [step]="0.
|
|
4555
|
+
<p-slider [(ngModel)]="this.scaleFactorModel" [step]="0.0001" [max]="5" (onChange)="onZoomChange($event)"></p-slider>
|
|
4550
4556
|
</div>
|
|
4551
4557
|
|
|
4552
4558
|
<div class="button-container">
|
|
@@ -4571,7 +4577,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
|
|
|
4571
4577
|
|
|
4572
4578
|
<div class="w-full mt-2">
|
|
4573
4579
|
<kv-label label="Zoom" style="text-align: left;" />
|
|
4574
|
-
<p-slider [(ngModel)]="this.scaleFactorModel" [step]="0.
|
|
4580
|
+
<p-slider [(ngModel)]="this.scaleFactorModel" [step]="0.0001" [max]="5" (onChange)="onZoomChange($event)"></p-slider>
|
|
4575
4581
|
</div>
|
|
4576
4582
|
|
|
4577
4583
|
<div class="button-container">
|
|
@@ -6092,124 +6098,265 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
|
|
|
6092
6098
|
}]
|
|
6093
6099
|
}] });
|
|
6094
6100
|
|
|
6101
|
+
class OrgChartService {
|
|
6102
|
+
constructor() {
|
|
6103
|
+
this.nodeAddSubject = new Subject();
|
|
6104
|
+
this.nodeAdd$ = this.nodeAddSubject.asObservable();
|
|
6105
|
+
this.nodeRemoveSubject = new Subject();
|
|
6106
|
+
this.nodeRemove$ = this.nodeRemoveSubject.asObservable();
|
|
6107
|
+
this.nodeRemove = new EventEmitter();
|
|
6108
|
+
this.nodeClick = new EventEmitter();
|
|
6109
|
+
}
|
|
6110
|
+
adicionarNode(node) {
|
|
6111
|
+
this.nodeAddSubject.next(node);
|
|
6112
|
+
}
|
|
6113
|
+
removerNode(id) {
|
|
6114
|
+
this.nodeRemoveSubject.next(id);
|
|
6115
|
+
}
|
|
6116
|
+
setNodeExpanded(orgSource, nodeId, expanded) {
|
|
6117
|
+
const nodeIndex = orgSource.findIndex((item) => item.id === nodeId);
|
|
6118
|
+
if (nodeIndex !== -1) {
|
|
6119
|
+
const updatedNode = {
|
|
6120
|
+
...orgSource[nodeIndex],
|
|
6121
|
+
_expanded: true,
|
|
6122
|
+
expanded
|
|
6123
|
+
};
|
|
6124
|
+
return [
|
|
6125
|
+
...orgSource.slice(0, nodeIndex),
|
|
6126
|
+
updatedNode,
|
|
6127
|
+
...orgSource.slice(nodeIndex + 1)
|
|
6128
|
+
];
|
|
6129
|
+
}
|
|
6130
|
+
else {
|
|
6131
|
+
return orgSource;
|
|
6132
|
+
}
|
|
6133
|
+
}
|
|
6134
|
+
modificarCampDataNode(orgSource, nodeId, field, value) {
|
|
6135
|
+
const nodeIndex = orgSource.findIndex((item) => item.id === nodeId);
|
|
6136
|
+
if (nodeIndex !== -1) {
|
|
6137
|
+
const updatedNode = {
|
|
6138
|
+
...orgSource[nodeIndex],
|
|
6139
|
+
data: {
|
|
6140
|
+
...orgSource[nodeIndex].data,
|
|
6141
|
+
[field]: value
|
|
6142
|
+
}
|
|
6143
|
+
};
|
|
6144
|
+
return [
|
|
6145
|
+
...orgSource.slice(0, nodeIndex),
|
|
6146
|
+
updatedNode,
|
|
6147
|
+
...orgSource.slice(nodeIndex + 1)
|
|
6148
|
+
];
|
|
6149
|
+
}
|
|
6150
|
+
return orgSource;
|
|
6151
|
+
}
|
|
6152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: OrgChartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6153
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: OrgChartService, providedIn: 'root' }); }
|
|
6154
|
+
}
|
|
6155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: OrgChartService, decorators: [{
|
|
6156
|
+
type: Injectable,
|
|
6157
|
+
args: [{
|
|
6158
|
+
providedIn: 'root'
|
|
6159
|
+
}]
|
|
6160
|
+
}] });
|
|
6161
|
+
|
|
6095
6162
|
class KvOrgchartComponent {
|
|
6096
|
-
constructor(
|
|
6097
|
-
this.
|
|
6098
|
-
this.
|
|
6099
|
-
this.
|
|
6100
|
-
|
|
6163
|
+
constructor(cdr, service) {
|
|
6164
|
+
this.cdr = cdr;
|
|
6165
|
+
this.service = service;
|
|
6166
|
+
this.dataSource = model(null);
|
|
6167
|
+
//#region Emissores de evento
|
|
6168
|
+
this.onNodeClick = new EventEmitter();
|
|
6169
|
+
// #endregion
|
|
6101
6170
|
this.compact = true;
|
|
6102
6171
|
this.mostraMenu = false;
|
|
6103
6172
|
}
|
|
6173
|
+
//#region Iniciar OrgChart e Atualização de dados
|
|
6104
6174
|
ngOnInit() {
|
|
6175
|
+
this.iniciarHandlersDeEventos();
|
|
6105
6176
|
}
|
|
6106
6177
|
ngAfterViewInit() {
|
|
6107
6178
|
if (!this.chart) {
|
|
6108
6179
|
this.chart = new OrgChart();
|
|
6109
6180
|
}
|
|
6110
|
-
this.
|
|
6181
|
+
this.iniciarChart();
|
|
6111
6182
|
}
|
|
6112
|
-
|
|
6113
|
-
this.
|
|
6114
|
-
}
|
|
6115
|
-
updateChart() {
|
|
6116
|
-
if (!this.dataSource) {
|
|
6117
|
-
return;
|
|
6118
|
-
}
|
|
6119
|
-
if (!this.chart) {
|
|
6183
|
+
iniciarChart() {
|
|
6184
|
+
if (!this.dataSource() || !this.chart) {
|
|
6120
6185
|
return;
|
|
6121
6186
|
}
|
|
6122
6187
|
const chartContainer = this.chartContainer.nativeElement;
|
|
6123
6188
|
this.chart
|
|
6189
|
+
.createZoom(() => {
|
|
6190
|
+
return d3.zoom().filter((e) => {
|
|
6191
|
+
const element = e.srcElement;
|
|
6192
|
+
if (element.classList.contains('no-zoom')) {
|
|
6193
|
+
return false;
|
|
6194
|
+
}
|
|
6195
|
+
return true;
|
|
6196
|
+
});
|
|
6197
|
+
})
|
|
6124
6198
|
.container(chartContainer)
|
|
6125
|
-
.data(this.dataSource)
|
|
6199
|
+
.data(this.dataSource())
|
|
6126
6200
|
.nodeWidth(() => this.config.cardWidht)
|
|
6127
|
-
.nodeHeight(() =>
|
|
6201
|
+
.nodeHeight((d) => {
|
|
6202
|
+
return d.data.expanded && this.config.cardExpandedHeight
|
|
6203
|
+
? this.config.cardExpandedHeight
|
|
6204
|
+
: this.config.cardHeight;
|
|
6205
|
+
})
|
|
6128
6206
|
.compact(false)
|
|
6129
6207
|
.buttonContent(({ node, state }) => {
|
|
6130
|
-
return `<div style="color:#FFFFFF; border-radius:100%;font-size:5px;margin:auto auto;background-color:#64748B;">
|
|
6131
|
-
|
|
6132
|
-
|
|
6208
|
+
return `<div style="color:#FFFFFF; border-radius:100%;font-size:5px;margin:auto auto;background-color:#64748B;">
|
|
6209
|
+
<span>
|
|
6210
|
+
${node.children && node.children.length > 0
|
|
6133
6211
|
? `<i class="material-symbols-outlined">
|
|
6134
|
-
keyboard_arrow_up
|
|
6135
|
-
</i>`
|
|
6212
|
+
keyboard_arrow_up
|
|
6213
|
+
</i>`
|
|
6136
6214
|
: `<i class="material-symbols-outlined">
|
|
6137
|
-
keyboard_arrow_down
|
|
6138
|
-
</i>`}
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
})
|
|
6142
|
-
.nodeUpdate(function (d) {
|
|
6215
|
+
keyboard_arrow_down
|
|
6216
|
+
</i>`}
|
|
6217
|
+
</span>
|
|
6218
|
+
</div>`;
|
|
6143
6219
|
})
|
|
6144
6220
|
.linkUpdate((node, index, nodes) => {
|
|
6145
6221
|
d3.select(nodes[index])
|
|
6146
6222
|
.attr('stroke-width', this.config.conectionWidth || '2px')
|
|
6147
|
-
.style('stroke', this.config.connectionColor || '#d6d6d6')
|
|
6223
|
+
.style('stroke', this.config.connectionColor || '#d6d6d6');
|
|
6148
6224
|
})
|
|
6149
6225
|
.nodeContent((d) => {
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
var x = templateConverter(d.data.data);
|
|
6160
|
-
}
|
|
6161
|
-
}
|
|
6162
|
-
else {
|
|
6163
|
-
var x = this.generateTemplate(d);
|
|
6164
|
-
}
|
|
6226
|
+
const node = {
|
|
6227
|
+
data: d.data.data,
|
|
6228
|
+
children: d.children,
|
|
6229
|
+
id: d.data.id,
|
|
6230
|
+
parentId: d.data.parentId,
|
|
6231
|
+
expanded: d.data.expanded,
|
|
6232
|
+
orgConfig: d.orgConfig,
|
|
6233
|
+
};
|
|
6234
|
+
const x = this.renderNodeTemplate(node);
|
|
6165
6235
|
return x;
|
|
6236
|
+
})
|
|
6237
|
+
.nodeUpdate(function (d) {
|
|
6238
|
+
d.data.orgConfig.clicks.forEach((click) => {
|
|
6239
|
+
d3.select(this)
|
|
6240
|
+
.select(click)
|
|
6241
|
+
.on('click', (e, d) => {
|
|
6242
|
+
const dados = d;
|
|
6243
|
+
const node = {
|
|
6244
|
+
data: dados.data.data,
|
|
6245
|
+
children: dados.children,
|
|
6246
|
+
id: dados.data.id,
|
|
6247
|
+
parentId: dados.data.parentId,
|
|
6248
|
+
expanded: dados.data.expanded,
|
|
6249
|
+
orgConfig: dados.orgConfig,
|
|
6250
|
+
};
|
|
6251
|
+
window.dispatchEvent(new CustomEvent('KvOrgChart_NodeClick', {
|
|
6252
|
+
detail: {
|
|
6253
|
+
node,
|
|
6254
|
+
seletor: click,
|
|
6255
|
+
},
|
|
6256
|
+
}));
|
|
6257
|
+
});
|
|
6258
|
+
});
|
|
6166
6259
|
})
|
|
6167
6260
|
.defaultFont('Roboto')
|
|
6168
6261
|
.render();
|
|
6169
6262
|
this.chart.expandAll();
|
|
6170
6263
|
}
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6264
|
+
ngOnChanges(changes) {
|
|
6265
|
+
if (changes['dataSource']) {
|
|
6266
|
+
this.iniciarChart();
|
|
6267
|
+
}
|
|
6174
6268
|
}
|
|
6175
|
-
|
|
6176
|
-
|
|
6269
|
+
//#endregion
|
|
6270
|
+
// #region Renderização de template
|
|
6271
|
+
renderNodeTemplate(node) {
|
|
6272
|
+
this.viewContainerRef.clear();
|
|
6273
|
+
const view = this.viewContainerRef.createEmbeddedView(this.nodeTemplate, {
|
|
6274
|
+
node: node,
|
|
6275
|
+
});
|
|
6276
|
+
this.cdr.detectChanges();
|
|
6277
|
+
return view.rootNodes[0].outerHTML;
|
|
6278
|
+
}
|
|
6279
|
+
iniciarHandlersDeEventos() {
|
|
6280
|
+
this.nodeClickSubscription = fromEvent(window, 'KvOrgChart_NodeClick').subscribe((event) => {
|
|
6281
|
+
this.emitirClick(event.detail.node, event.detail.seletor);
|
|
6282
|
+
});
|
|
6283
|
+
this.nodeAddSubscription = this.service.nodeAdd$.subscribe((node) => {
|
|
6284
|
+
this.adicionarNode(node);
|
|
6285
|
+
});
|
|
6286
|
+
this.nodeRemoveSubscription = this.service.nodeRemove$.subscribe((id) => {
|
|
6287
|
+
this.removerNode(id);
|
|
6288
|
+
});
|
|
6289
|
+
}
|
|
6290
|
+
ngOnDestroy() {
|
|
6291
|
+
this.nodeClickSubscription.unsubscribe();
|
|
6292
|
+
this.nodeAddSubscription.unsubscribe();
|
|
6293
|
+
this.nodeRemoveSubscription.unsubscribe();
|
|
6294
|
+
}
|
|
6295
|
+
emitirClick(node, seletorCss) {
|
|
6296
|
+
const event = {
|
|
6297
|
+
node: node,
|
|
6298
|
+
seletorCss: seletorCss ?? '',
|
|
6299
|
+
};
|
|
6300
|
+
this.onNodeClick.emit(event);
|
|
6301
|
+
}
|
|
6302
|
+
adicionarNode(node) {
|
|
6303
|
+
const arr = [...this.dataSource(), node];
|
|
6304
|
+
this.dataSource.set(arr);
|
|
6305
|
+
this.iniciarChart();
|
|
6306
|
+
}
|
|
6307
|
+
removerNode(id) {
|
|
6308
|
+
const indPai = this.dataSource().some((x) => x.parentId == id);
|
|
6309
|
+
if (indPai) {
|
|
6310
|
+
alert('Não é possível remover um nó que possui filhos');
|
|
6311
|
+
}
|
|
6312
|
+
else {
|
|
6313
|
+
const arr = this.dataSource().filter((x) => x.id != id);
|
|
6314
|
+
this.dataSource.set(arr);
|
|
6315
|
+
this.iniciarChart();
|
|
6316
|
+
}
|
|
6317
|
+
}
|
|
6318
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvOrgchartComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: OrgChartService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6319
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.8", type: KvOrgchartComponent, selector: "kv-orgchart", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, nodeTemplate: { classPropertyName: "nodeTemplate", publicName: "nodeTemplate", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { dataSource: "dataSourceChange", onNodeClick: "onNodeClick" }, viewQueries: [{ propertyName: "chartContainer", first: true, predicate: ["chartContainer"], descendants: true }, { propertyName: "viewContainerRef", first: true, predicate: ["nodeTemplate"], descendants: true, read: ViewContainerRef }], usesOnChanges: true, ngImport: i0, template: "<div #chartContainer id=\"chartContainer\" [ngClass]=\"{'backGround': true}\">\r\n\r\n\r\n <div class=\"div-botoes w-full flex gap-1\" >\r\n\r\n\r\n <span *ngIf=\"!mostraMenu\" class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"mostraMenu = !mostraMenu\" pTooltip=\"Expandir menu\">menu</span>\r\n\r\n\r\n\r\n <span *ngIf=\"mostraMenu\" class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"mostraMenu = !mostraMenu\" pTooltip=\"Recolher menu\">menu_open</span>\r\n\r\n <div *ngIf=\"mostraMenu\">\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.zoomIn()\" pTooltip=\"Zoom +\">zoom_in</span>\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.zoomOut()\" pTooltip=\"Zoom -\">zoom_out</span>\r\n\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.collapseAll()\" pTooltip=\"Recolher\">expand_less</span>\r\n\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.expandAll()\" pTooltip=\"Expandir\">expand_more</span>\r\n\r\n\r\n <span class=\"material-icons surface-300 shadow-4 p-1 m-2 border-circle cursor-pointer\"\r\n (click)=\"chart.fit().render()\" pTooltip=\"Centralizar\">\r\n filter_center_focus\r\n </span>\r\n\r\n <span class=\"material-icons surface-300 shadow-4 p-1 m-2 border-circle cursor-pointer\"\r\n (click)=\"chart.fullscreen('#chartContainer')\" pTooltip=\"Tela cheia\" >\r\n fullscreen\r\n </span>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n<link\r\n rel=\"stylesheet\"\r\n href=\"https://fonts.googleapis.com/icon?family=Material+Icons\"\r\n/>\r\n\r\n<link\r\n rel=\"stylesheet\"\r\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0\"\r\n/>\r\n\r\n<div style=\"display: none;\">\r\n <ng-template #nodeTemplate let-node>\r\n <div class=\"node-content\">\r\n erro\r\n </div>\r\n </ng-template>\r\n</div>\r\n", styles: ["#chartContainer{height:100%;overflow:hidden}:host ::ng-deep #chartContainer svg.svg-chart-container{height:100%!important;position:relative;width:100%;top:-56px;z-index:0;background-color:#fff}.div-botoes{z-index:1;width:100%;position:relative}:host ::ng-deep .p-organizationChart{overflow:hidden}svg{width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] }); }
|
|
6177
6320
|
}
|
|
6178
6321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvOrgchartComponent, decorators: [{
|
|
6179
6322
|
type: Component,
|
|
6180
|
-
args: [{ selector: 'kv-orgchart', template: "<div #chartContainer id=\"chartContainer\" [ngClass]=\"{'backGround': true}\">\r\n\r\n\r\n <div class=\"div-botoes w-full flex gap-1\" >\r\n\r\n\r\n <span *ngIf=\"!mostraMenu\" class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"mostraMenu = !mostraMenu\" pTooltip=\"Expandir menu\">menu</span>\r\n\r\n\r\n\r\n <span *ngIf=\"mostraMenu\" class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"mostraMenu = !mostraMenu\" pTooltip=\"Recolher menu\">menu_open</span>\r\n\r\n <div *ngIf=\"mostraMenu\">\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.zoomIn()\" pTooltip=\"Zoom +\">zoom_in</span>\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.zoomOut()\" pTooltip=\"Zoom -\">zoom_out</span>\r\n\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.collapseAll()\" pTooltip=\"Recolher\">expand_less</span>\r\n\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.expandAll()\" pTooltip=\"Expandir\">expand_more</span>\r\n\r\n\r\n
|
|
6181
|
-
}], ctorParameters: () => [{ type: i0.
|
|
6323
|
+
args: [{ selector: 'kv-orgchart', template: "<div #chartContainer id=\"chartContainer\" [ngClass]=\"{'backGround': true}\">\r\n\r\n\r\n <div class=\"div-botoes w-full flex gap-1\" >\r\n\r\n\r\n <span *ngIf=\"!mostraMenu\" class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"mostraMenu = !mostraMenu\" pTooltip=\"Expandir menu\">menu</span>\r\n\r\n\r\n\r\n <span *ngIf=\"mostraMenu\" class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"mostraMenu = !mostraMenu\" pTooltip=\"Recolher menu\">menu_open</span>\r\n\r\n <div *ngIf=\"mostraMenu\">\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.zoomIn()\" pTooltip=\"Zoom +\">zoom_in</span>\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.zoomOut()\" pTooltip=\"Zoom -\">zoom_out</span>\r\n\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.collapseAll()\" pTooltip=\"Recolher\">expand_less</span>\r\n\r\n <span class=\"surface-300 shadow-4 p-1 m-2 border-circle material-icons cursor-pointer\"\r\n (click)=\"chart.expandAll()\" pTooltip=\"Expandir\">expand_more</span>\r\n\r\n\r\n <span class=\"material-icons surface-300 shadow-4 p-1 m-2 border-circle cursor-pointer\"\r\n (click)=\"chart.fit().render()\" pTooltip=\"Centralizar\">\r\n filter_center_focus\r\n </span>\r\n\r\n <span class=\"material-icons surface-300 shadow-4 p-1 m-2 border-circle cursor-pointer\"\r\n (click)=\"chart.fullscreen('#chartContainer')\" pTooltip=\"Tela cheia\" >\r\n fullscreen\r\n </span>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n<link\r\n rel=\"stylesheet\"\r\n href=\"https://fonts.googleapis.com/icon?family=Material+Icons\"\r\n/>\r\n\r\n<link\r\n rel=\"stylesheet\"\r\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0\"\r\n/>\r\n\r\n<div style=\"display: none;\">\r\n <ng-template #nodeTemplate let-node>\r\n <div class=\"node-content\">\r\n erro\r\n </div>\r\n </ng-template>\r\n</div>\r\n", styles: ["#chartContainer{height:100%;overflow:hidden}:host ::ng-deep #chartContainer svg.svg-chart-container{height:100%!important;position:relative;width:100%;top:-56px;z-index:0;background-color:#fff}.div-botoes{z-index:1;width:100%;position:relative}:host ::ng-deep .p-organizationChart{overflow:hidden}svg{width:100%;height:100%}\n"] }]
|
|
6324
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: OrgChartService }], propDecorators: { config: [{
|
|
6325
|
+
type: Input
|
|
6326
|
+
}], chartContainer: [{
|
|
6182
6327
|
type: ViewChild,
|
|
6183
6328
|
args: ['chartContainer']
|
|
6184
|
-
}],
|
|
6185
|
-
type:
|
|
6186
|
-
|
|
6187
|
-
type: Input
|
|
6188
|
-
}], template: [{
|
|
6189
|
-
type: Input
|
|
6329
|
+
}], viewContainerRef: [{
|
|
6330
|
+
type: ViewChild,
|
|
6331
|
+
args: ['nodeTemplate', { read: ViewContainerRef }]
|
|
6190
6332
|
}], nodeTemplate: [{
|
|
6191
6333
|
type: Input
|
|
6192
|
-
}],
|
|
6193
|
-
type:
|
|
6194
|
-
}], templateFuncion: [{
|
|
6195
|
-
type: Input
|
|
6196
|
-
}], corDeFundo: [{
|
|
6197
|
-
type: Input
|
|
6334
|
+
}], onNodeClick: [{
|
|
6335
|
+
type: Output
|
|
6198
6336
|
}] } });
|
|
6199
6337
|
|
|
6200
6338
|
class KvOrgchartModule {
|
|
6201
6339
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvOrgchartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
6202
6340
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: KvOrgchartModule, declarations: [KvOrgchartComponent], imports: [CommonModule,
|
|
6203
|
-
PrimeNgModule
|
|
6341
|
+
PrimeNgModule,
|
|
6342
|
+
kvErrorModule,
|
|
6343
|
+
PrimeNgModule,
|
|
6344
|
+
OrganizationChartModule], exports: [KvOrgchartComponent] }); }
|
|
6204
6345
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvOrgchartModule, imports: [CommonModule,
|
|
6205
|
-
PrimeNgModule
|
|
6346
|
+
PrimeNgModule,
|
|
6347
|
+
kvErrorModule,
|
|
6348
|
+
PrimeNgModule,
|
|
6349
|
+
OrganizationChartModule] }); }
|
|
6206
6350
|
}
|
|
6207
6351
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvOrgchartModule, decorators: [{
|
|
6208
6352
|
type: NgModule,
|
|
6209
6353
|
args: [{
|
|
6210
6354
|
imports: [
|
|
6211
6355
|
CommonModule,
|
|
6212
|
-
PrimeNgModule
|
|
6356
|
+
PrimeNgModule,
|
|
6357
|
+
kvErrorModule,
|
|
6358
|
+
PrimeNgModule,
|
|
6359
|
+
OrganizationChartModule
|
|
6213
6360
|
],
|
|
6214
6361
|
declarations: [KvOrgchartComponent],
|
|
6215
6362
|
exports: [KvOrgchartComponent]
|
|
@@ -8991,5 +9138,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
|
|
|
8991
9138
|
* Generated bundle index. Do not edit.
|
|
8992
9139
|
*/
|
|
8993
9140
|
|
|
8994
|
-
export { BaseApiService, BaseChartComponent, BaseComponent, BaseComponentButton, BaseComponentCrud, BaseComponentCrudForm, BaseComponentCrudList, BaseComponentDropDown, BaseComponentDropDownExternal, BaseComponentInput, BaseComponentMultiSelect, BasecomponentTable, BreadcrumbsService, CapitalizePipe, ChatService, ComponentProviders, ComponentService, CpfCnpjPipe, DocsService, DragDirective, DynamicInputDirective, FormService, ImageCutterService, ImagensService, KeevoComponentsModule, KeevoValidators, KvAvatarComponent, KvAvatarModule, KvButtonComponent, KvButtonModule, KvButtonPersonalizeComponent, KvButtonPopupComponent, KvButtonSecondaryComponent, KvButtonSuccessComponent, KvButtonsModule, KvCarouselComponent, KvCarouselModule, KvChartComponent, KvChartModule, KvCheckComponent, KvDropdownComponent, KvEditorComponent, KvErrorComponent, KvFileUploadComponent, KvFileUploadModule, KvFileViewerComponent, KvFileViewerModule, KvFilterCardComponent, KvFilterCardModule, KvFilterFieldsetComponent, KvFilterFieldsetModule, KvGIconComponent, KvGIconModule, KvHomeCardComponent, KvHomeCardModule, KvImageUploadComponent, KvImageUploadModule, KvInputCalendarComponent, KvInputMaskComponent, KvInputNumberComponent, KvInputPasswordComponent, KvInputTextCheckboxComponent, KvInputTextComponent, KvInputTextareaComponent, KvInputTimeComponent, KvInputsModule, KvLayoutComponent, KvLayoutModule, KvLoaderComponent, KvLoaderModule, KvLoaderService, KvLoginComponent, KvLoginModule, KvModalComponent, KvModalModule, KvMultiSelectComponent, KvOrgchartComponent, KvOrgchartModule, KvPageFormComponent, KvPageFormModule, KvPageStepperComponent, KvPageStepperodule, KvPickListComponent, KvPickListModule, KvProgressBarModule, KvRadioGroupComponent, KvReportComponent, KvReportModule, KvSelectButtonComponent, KvSelectButtonsComponent, KvStepperComponent, KvStepperModule, KvSwitchComponent, KvTableComponent, KvTableEditComponent, KvTableEditModule, KvTableExpandableComponent, KvTableExpandableModule, KvTableModule, KvTreeViewComponent, KvTreetableComponent, KvTreetableModule, KvWorkspaceModule, KvtreeViewModule, MaskPipe, NotificationService, ObjectService, PeriodosChart, PipesModule, PrimeNgModule, ProgressBarComponent, TablePaginate, TelefonePipe, TemplateDirective, TranslatePrimeng, WorkspaceComponent, getOrExecute, kvErrorModule, loading, mapToMenuItem };
|
|
9141
|
+
export { BaseApiService, BaseChartComponent, BaseComponent, BaseComponentButton, BaseComponentCrud, BaseComponentCrudForm, BaseComponentCrudList, BaseComponentDropDown, BaseComponentDropDownExternal, BaseComponentInput, BaseComponentMultiSelect, BasecomponentTable, BreadcrumbsService, CapitalizePipe, ChatService, ComponentProviders, ComponentService, CpfCnpjPipe, DocsService, DragDirective, DynamicInputDirective, FormService, ImageCutterService, ImagensService, KeevoComponentsModule, KeevoValidators, KvAvatarComponent, KvAvatarModule, KvButtonComponent, KvButtonModule, KvButtonPersonalizeComponent, KvButtonPopupComponent, KvButtonSecondaryComponent, KvButtonSuccessComponent, KvButtonsModule, KvCarouselComponent, KvCarouselModule, KvChartComponent, KvChartModule, KvCheckComponent, KvDropdownComponent, KvEditorComponent, KvErrorComponent, KvFileUploadComponent, KvFileUploadModule, KvFileViewerComponent, KvFileViewerModule, KvFilterCardComponent, KvFilterCardModule, KvFilterFieldsetComponent, KvFilterFieldsetModule, KvGIconComponent, KvGIconModule, KvHomeCardComponent, KvHomeCardModule, KvImageUploadComponent, KvImageUploadModule, KvInputCalendarComponent, KvInputMaskComponent, KvInputNumberComponent, KvInputPasswordComponent, KvInputTextCheckboxComponent, KvInputTextComponent, KvInputTextareaComponent, KvInputTimeComponent, KvInputsModule, KvLayoutComponent, KvLayoutModule, KvLoaderComponent, KvLoaderModule, KvLoaderService, KvLoginComponent, KvLoginModule, KvModalComponent, KvModalModule, KvMultiSelectComponent, KvOrgchartComponent, KvOrgchartModule, KvPageFormComponent, KvPageFormModule, KvPageStepperComponent, KvPageStepperodule, KvPickListComponent, KvPickListModule, KvProgressBarModule, KvRadioGroupComponent, KvReportComponent, KvReportModule, KvSelectButtonComponent, KvSelectButtonsComponent, KvStepperComponent, KvStepperModule, KvSwitchComponent, KvTableComponent, KvTableEditComponent, KvTableEditModule, KvTableExpandableComponent, KvTableExpandableModule, KvTableModule, KvTreeViewComponent, KvTreetableComponent, KvTreetableModule, KvWorkspaceModule, KvtreeViewModule, MaskPipe, NotificationService, ObjectService, OrgChartService, PeriodosChart, PipesModule, PrimeNgModule, ProgressBarComponent, TablePaginate, TelefonePipe, TemplateDirective, TranslatePrimeng, WorkspaceComponent, getOrExecute, kvErrorModule, loading, mapToMenuItem };
|
|
8995
9142
|
//# sourceMappingURL=keevo-components.mjs.map
|