@seniorsistemas/angular-components 17.9.0 → 17.9.2
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/bundles/seniorsistemas-angular-components.umd.js +138 -21
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/info-sign/info-sign.component.d.ts +1 -0
- package/components/info-sign/info-sign.directive.d.ts +1 -0
- package/components/kanban/components/kanban-column/kanban-column.component.d.ts +2 -0
- package/components/kanban/components/kanban-item/kanban-item.component.d.ts +7 -4
- package/components/kanban/kanban.component.d.ts +7 -5
- package/components/kanban/models/index.d.ts +1 -1
- package/components/kanban/models/kanban-data.d.ts +9 -2
- package/components/tooltip/tooltip.directive.d.ts +32 -2
- package/esm2015/components/info-sign/info-sign.component.js +2 -2
- package/esm2015/components/info-sign/info-sign.directive.js +5 -1
- package/esm2015/components/kanban/components/kanban-column/kanban-column.component.js +14 -2
- package/esm2015/components/kanban/components/kanban-item/kanban-item.component.js +20 -6
- package/esm2015/components/kanban/kanban.component.js +26 -18
- package/esm2015/components/kanban/models/index.js +1 -1
- package/esm2015/components/kanban/models/kanban-data.js +1 -1
- package/esm2015/components/tooltip/tooltip.directive.js +84 -8
- package/esm5/components/info-sign/info-sign.component.js +2 -2
- package/esm5/components/info-sign/info-sign.directive.js +5 -1
- package/esm5/components/kanban/components/kanban-column/kanban-column.component.js +16 -3
- package/esm5/components/kanban/components/kanban-item/kanban-item.component.js +22 -7
- package/esm5/components/kanban/kanban.component.js +26 -18
- package/esm5/components/kanban/models/index.js +1 -1
- package/esm5/components/kanban/models/kanban-data.js +1 -1
- package/esm5/components/tooltip/tooltip.directive.js +85 -8
- package/fesm2015/seniorsistemas-angular-components.js +136 -22
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +139 -22
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __assign, __extends, __spread, __awaiter, __generator, __param, __values, __rest, __read } from 'tslib';
|
|
2
|
-
import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, KeyValueDiffers, HostBinding,
|
|
2
|
+
import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Renderer2, Directive, KeyValueDiffers, HostBinding, TemplateRef, InjectionToken, Inject, ViewEncapsulation, ViewContainerRef, ChangeDetectorRef, Pipe, ɵɵinject, ContentChild, Optional, ViewChildren } from '@angular/core';
|
|
3
3
|
import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
|
|
4
4
|
import { Subject, of, from, ReplaySubject, throwError, forkJoin } from 'rxjs';
|
|
5
5
|
import { takeUntil, tap, map, switchMap, catchError, first, filter, take, delay, debounceTime, repeat, finalize } from 'rxjs/operators';
|
|
@@ -445,13 +445,14 @@ var TooltipEvent;
|
|
|
445
445
|
})(TooltipEvent || (TooltipEvent = {}));
|
|
446
446
|
|
|
447
447
|
var TooltipDirective = /** @class */ (function () {
|
|
448
|
-
function TooltipDirective(elementRef, appRef, componentFactoryResolver, injector, debounceUtils) {
|
|
448
|
+
function TooltipDirective(elementRef, appRef, componentFactoryResolver, injector, debounceUtils, renderer) {
|
|
449
449
|
var _this = this;
|
|
450
450
|
this.elementRef = elementRef;
|
|
451
451
|
this.appRef = appRef;
|
|
452
452
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
453
453
|
this.injector = injector;
|
|
454
454
|
this.debounceUtils = debounceUtils;
|
|
455
|
+
this.renderer = renderer;
|
|
455
456
|
this.position = TooltipPosition.Top;
|
|
456
457
|
this.showDelay = 500;
|
|
457
458
|
this.tooltipEvent = TooltipEvent.Hover;
|
|
@@ -464,6 +465,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
464
465
|
}
|
|
465
466
|
TooltipDirective.prototype.ngOnInit = function () {
|
|
466
467
|
this.validatePosition();
|
|
468
|
+
this.updateTooltipVisibilityWhenFocusOnInput();
|
|
467
469
|
};
|
|
468
470
|
TooltipDirective.prototype.ngOnDestroy = function () {
|
|
469
471
|
this.destroy();
|
|
@@ -487,6 +489,59 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
487
489
|
TooltipDirective.prototype.isMousePositionOutsideOfElement = function (mouseX, mouseY, elementArea) {
|
|
488
490
|
return mouseX < elementArea.left || mouseX >= elementArea.right || mouseY < elementArea.top || mouseY >= elementArea.bottom;
|
|
489
491
|
};
|
|
492
|
+
/**
|
|
493
|
+
* Manipula a visibilidade do tooltip quando houver uma referência de input.
|
|
494
|
+
*/
|
|
495
|
+
TooltipDirective.prototype.updateTooltipVisibilityWhenFocusOnInput = function () {
|
|
496
|
+
var _this = this;
|
|
497
|
+
if (this.focusedInputRef) {
|
|
498
|
+
var inputFocus = this.focusedInputRef;
|
|
499
|
+
var icon_1 = this.getIconFromFocusedInput(inputFocus);
|
|
500
|
+
this.renderer.listen(inputFocus, 'focus', function () {
|
|
501
|
+
if (icon_1 && _this.isMatchingTooltip(icon_1)) {
|
|
502
|
+
_this.createTootipByFocus(icon_1);
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
this.renderer.listen(inputFocus, 'blur', function () {
|
|
506
|
+
if (icon_1 && _this.isMatchingTooltip(icon_1)) {
|
|
507
|
+
_this.removeTooltip(icon_1);
|
|
508
|
+
_this.destroy();
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
/**
|
|
514
|
+
* Obtém o elemento do ícone associado ao label do input em focus.
|
|
515
|
+
* @param focusedInput O input em focus.
|
|
516
|
+
* @returns O ícone do input em focus ou null.
|
|
517
|
+
*/
|
|
518
|
+
TooltipDirective.prototype.getIconFromFocusedInput = function (focusedInput) {
|
|
519
|
+
var label = document.querySelector("label[for='" + focusedInput.id + "']");
|
|
520
|
+
if (label) {
|
|
521
|
+
var icon = label.nextElementSibling;
|
|
522
|
+
return (icon === null || icon === void 0 ? void 0 : icon.classList.contains('info-sign__icon')) ? icon : null;
|
|
523
|
+
}
|
|
524
|
+
return null;
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* Verifica se o ícone tem o tooltip correspondente ao atual.
|
|
528
|
+
* @param icon O ícone do input em focus.
|
|
529
|
+
* @returns true se o tooltip corresponde; caso contrário, false.
|
|
530
|
+
*/
|
|
531
|
+
TooltipDirective.prototype.isMatchingTooltip = function (icon) {
|
|
532
|
+
var tooltipText = icon.getAttribute('ng-reflect-tooltip');
|
|
533
|
+
return this.tooltip === tooltipText;
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* Remove o tooltip associado ao ícone do input em focus.
|
|
537
|
+
* @param icon O ícone do input em focus.
|
|
538
|
+
*/
|
|
539
|
+
TooltipDirective.prototype.removeTooltip = function (icon) {
|
|
540
|
+
var tooltip = icon.querySelector('.tooltip');
|
|
541
|
+
if (tooltip) {
|
|
542
|
+
tooltip.remove();
|
|
543
|
+
}
|
|
544
|
+
};
|
|
490
545
|
// whenever the component with the tooltip is clicked I destroy the tooltip.
|
|
491
546
|
// whenever a key is pressed on the component with the tooltip I destroy the tooltip.
|
|
492
547
|
TooltipDirective.prototype.onClick = function () {
|
|
@@ -551,10 +606,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
551
606
|
TooltipDirective.prototype.createTootip = function () {
|
|
552
607
|
var _a;
|
|
553
608
|
if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
554
|
-
var
|
|
555
|
-
this.componentRef = componentFactory.create(this.injector);
|
|
556
|
-
this.appRef.attachView(this.componentRef.hostView);
|
|
557
|
-
var domElem = this.componentRef.hostView.rootNodes[0];
|
|
609
|
+
var domElem = this.getDomElement();
|
|
558
610
|
document.body.appendChild(domElem);
|
|
559
611
|
this.setTooltipComponentProperties();
|
|
560
612
|
this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);
|
|
@@ -564,6 +616,27 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
564
616
|
}
|
|
565
617
|
}
|
|
566
618
|
};
|
|
619
|
+
TooltipDirective.prototype.getDomElement = function () {
|
|
620
|
+
var componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
|
|
621
|
+
this.componentRef = componentFactory.create(this.injector);
|
|
622
|
+
this.appRef.attachView(this.componentRef.hostView);
|
|
623
|
+
return this.componentRef.hostView.rootNodes[0];
|
|
624
|
+
};
|
|
625
|
+
/**
|
|
626
|
+
* Cria um tooltip para o icone do input em focus.
|
|
627
|
+
*
|
|
628
|
+
* @param icon O ícone do input em focus.
|
|
629
|
+
*/
|
|
630
|
+
TooltipDirective.prototype.createTootipByFocus = function (icon) {
|
|
631
|
+
var _a;
|
|
632
|
+
if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
633
|
+
var domElem = this.getDomElement();
|
|
634
|
+
var tooltip_1 = domElem.querySelector('.tooltip');
|
|
635
|
+
icon.appendChild(tooltip_1);
|
|
636
|
+
this.setTooltipComponentProperties();
|
|
637
|
+
setTimeout(function () { return tooltip_1.classList.add("tooltip--visible"); }, 0);
|
|
638
|
+
}
|
|
639
|
+
};
|
|
567
640
|
TooltipDirective.prototype.showTooltip = function () {
|
|
568
641
|
if (this.componentRef !== null) {
|
|
569
642
|
this.componentRef.instance.visible = this.visible;
|
|
@@ -681,7 +754,8 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
681
754
|
{ type: ApplicationRef },
|
|
682
755
|
{ type: ComponentFactoryResolver },
|
|
683
756
|
{ type: Injector },
|
|
684
|
-
{ type: DebounceUtils }
|
|
757
|
+
{ type: DebounceUtils },
|
|
758
|
+
{ type: Renderer2 }
|
|
685
759
|
]; };
|
|
686
760
|
__decorate([
|
|
687
761
|
Input("sTooltip")
|
|
@@ -707,6 +781,9 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
707
781
|
__decorate([
|
|
708
782
|
Input()
|
|
709
783
|
], TooltipDirective.prototype, "mobileBehavior", void 0);
|
|
784
|
+
__decorate([
|
|
785
|
+
Input()
|
|
786
|
+
], TooltipDirective.prototype, "focusedInputRef", void 0);
|
|
710
787
|
__decorate([
|
|
711
788
|
HostListener("click"),
|
|
712
789
|
HostListener("keydown")
|
|
@@ -6572,7 +6649,7 @@ var InfoSignComponent = /** @class */ (function () {
|
|
|
6572
6649
|
InfoSignComponent = __decorate([
|
|
6573
6650
|
Component({
|
|
6574
6651
|
selector: "s-info-sign-component",
|
|
6575
|
-
template: "<span class=\"info-sign\">\n <span *ngTemplateOutlet=\"templateRef\"></span>\n <i\n class=\"info-sign__icon fa fa-info-circle\"\n aria-hidden=\"true\"\n [sTooltip]=\"tooltip\"\n [escape]=\"false\"\n tooltipPosition=\"top\"\n [displayTime]=\"displayTime\"\n mobileBehavior=\"tap\"\n showDelay=\"0\">\n </i>\n</span
|
|
6652
|
+
template: "<span class=\"info-sign\">\n <span *ngTemplateOutlet=\"templateRef\"></span>\n <i\n class=\"info-sign__icon fa fa-info-circle\"\n aria-hidden=\"true\"\n [sTooltip]=\"tooltip\"\n [escape]=\"false\"\n tooltipPosition=\"top\"\n [displayTime]=\"displayTime\"\n mobileBehavior=\"tap\"\n showDelay=\"0\"\n [focusedInputRef]=\"focusedInputRef\">\n </i>\n</span>\n",
|
|
6576
6653
|
styles: [".info-sign{-ms-flex-align:baseline;align-items:baseline;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:start;justify-content:flex-start}.info-sign .info-sign__icon{padding:0 12px}"]
|
|
6577
6654
|
})
|
|
6578
6655
|
], InfoSignComponent);
|
|
@@ -6594,6 +6671,7 @@ var InfoSignDirective = /** @class */ (function () {
|
|
|
6594
6671
|
this.componentRef.instance.templateRef = this.templateRef;
|
|
6595
6672
|
this.componentRef.instance.tooltip = this.sInfoSign;
|
|
6596
6673
|
this.componentRef.instance.displayTime = this.displayTime;
|
|
6674
|
+
this.componentRef.instance.focusedInputRef = this.focusedInputRef;
|
|
6597
6675
|
}
|
|
6598
6676
|
else if (this.componentRef && this.sInfoSign) {
|
|
6599
6677
|
this.componentRef.instance.tooltip = this.sInfoSign;
|
|
@@ -6619,6 +6697,9 @@ var InfoSignDirective = /** @class */ (function () {
|
|
|
6619
6697
|
__decorate([
|
|
6620
6698
|
Input('sInfoSignDisplayTime')
|
|
6621
6699
|
], InfoSignDirective.prototype, "displayTime", void 0);
|
|
6700
|
+
__decorate([
|
|
6701
|
+
Input('sInfoSignFocusedInputRef')
|
|
6702
|
+
], InfoSignDirective.prototype, "focusedInputRef", void 0);
|
|
6622
6703
|
InfoSignDirective = __decorate([
|
|
6623
6704
|
Directive({
|
|
6624
6705
|
selector: "[sInfoSign]",
|
|
@@ -14391,6 +14472,8 @@ var KanbanTemplateTypes;
|
|
|
14391
14472
|
var KanbanComponent = /** @class */ (function () {
|
|
14392
14473
|
function KanbanComponent(kanbanEventService) {
|
|
14393
14474
|
this.kanbanEventService = kanbanEventService;
|
|
14475
|
+
this.showItemCheckboxes = true;
|
|
14476
|
+
this.showColumnCheckboxes = true;
|
|
14394
14477
|
this.itemsMoved = new EventEmitter();
|
|
14395
14478
|
this.dataUpdated = new EventEmitter();
|
|
14396
14479
|
this.itemsSelected = new EventEmitter();
|
|
@@ -14450,6 +14533,8 @@ var KanbanComponent = /** @class */ (function () {
|
|
|
14450
14533
|
this.selectedItems.clear();
|
|
14451
14534
|
};
|
|
14452
14535
|
KanbanComponent.prototype.selectItem = function (event, item, column) {
|
|
14536
|
+
if (item.disabled || item.frozen)
|
|
14537
|
+
return;
|
|
14453
14538
|
if (event.ctrlKey) {
|
|
14454
14539
|
if (this.selectedItems.delete(item)) {
|
|
14455
14540
|
this.kanbanEventService.emitUnselectItemEvent(item);
|
|
@@ -14464,6 +14549,8 @@ var KanbanComponent = /** @class */ (function () {
|
|
|
14464
14549
|
}
|
|
14465
14550
|
}
|
|
14466
14551
|
else {
|
|
14552
|
+
if (this.selectedItems.delete(item))
|
|
14553
|
+
return;
|
|
14467
14554
|
this.selectedItems.clear();
|
|
14468
14555
|
this.selectedItems.add(item);
|
|
14469
14556
|
this.selectedColumn = column;
|
|
@@ -14480,9 +14567,7 @@ var KanbanComponent = /** @class */ (function () {
|
|
|
14480
14567
|
this.draggingItems.clear();
|
|
14481
14568
|
};
|
|
14482
14569
|
KanbanComponent.prototype.getLinkedColumns = function (currentColumn) {
|
|
14483
|
-
return this.data.columns
|
|
14484
|
-
.filter(function (column) { return column != currentColumn; })
|
|
14485
|
-
.map(function (column) { return column.id; });
|
|
14570
|
+
return this.data.columns.filter(function (column) { return column != currentColumn; }).map(function (column) { return column.id; });
|
|
14486
14571
|
};
|
|
14487
14572
|
KanbanComponent.prototype.getColumnHeaderTemplate = function () {
|
|
14488
14573
|
return this._getCustomTemplate(KanbanTemplateTypes.ColumnHeader);
|
|
@@ -14509,7 +14594,7 @@ var KanbanComponent = /** @class */ (function () {
|
|
|
14509
14594
|
.pipe(takeUntil(this._unsubscribe$))
|
|
14510
14595
|
.subscribe(function (column) {
|
|
14511
14596
|
column.items
|
|
14512
|
-
.filter(function (item) { return !item.disabled; })
|
|
14597
|
+
.filter(function (item) { return !item.disabled && !item.frozen; })
|
|
14513
14598
|
.forEach(function (item) {
|
|
14514
14599
|
_this.selectedItems.add(item);
|
|
14515
14600
|
});
|
|
@@ -14539,9 +14624,7 @@ var KanbanComponent = /** @class */ (function () {
|
|
|
14539
14624
|
});
|
|
14540
14625
|
});
|
|
14541
14626
|
});
|
|
14542
|
-
this.kanbanEventService.unselectItemEvent
|
|
14543
|
-
.pipe(takeUntil(this._unsubscribe$))
|
|
14544
|
-
.subscribe(function (item) {
|
|
14627
|
+
this.kanbanEventService.unselectItemEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(function (item) {
|
|
14545
14628
|
_this.selectedItems.delete(item);
|
|
14546
14629
|
});
|
|
14547
14630
|
};
|
|
@@ -14570,6 +14653,12 @@ var KanbanComponent = /** @class */ (function () {
|
|
|
14570
14653
|
__decorate([
|
|
14571
14654
|
Input()
|
|
14572
14655
|
], KanbanComponent.prototype, "data", void 0);
|
|
14656
|
+
__decorate([
|
|
14657
|
+
Input()
|
|
14658
|
+
], KanbanComponent.prototype, "showItemCheckboxes", void 0);
|
|
14659
|
+
__decorate([
|
|
14660
|
+
Input()
|
|
14661
|
+
], KanbanComponent.prototype, "showColumnCheckboxes", void 0);
|
|
14573
14662
|
__decorate([
|
|
14574
14663
|
Output()
|
|
14575
14664
|
], KanbanComponent.prototype, "itemsMoved", void 0);
|
|
@@ -14584,9 +14673,9 @@ var KanbanComponent = /** @class */ (function () {
|
|
|
14584
14673
|
], KanbanComponent.prototype, "templates", void 0);
|
|
14585
14674
|
KanbanComponent = __decorate([
|
|
14586
14675
|
Component({
|
|
14587
|
-
selector:
|
|
14588
|
-
template: "<div class=\"kanban\">\n <s-kanban-column\n *ngFor=\"let column of data.columns\"\n [data]=\"column\"\n [headerTemplate]=\"columnHeaderTemplate\">\n <div\n [id]=\"column.id\"\n style=\"height: 100%; width: 100%;\"\n cdkDropList\n #dynamicList=\"cdkDropList\"\n [cdkDropListData]=\"column.items\"\n [cdkDropListConnectedTo]=\"getLinkedColumns(column)\"\n (cdkDropListDropped)=\"drop($event)\">\n\n <ng-container *ngIf=\"!columnEmptyMessageTemplate; then defaultEmptyMessageTemplate else customEmptyMessageTemplate\"></ng-container>\n\n <ng-template #defaultEmptyMessageTemplate>\n <div *ngIf=\"!column.items.length\" class=\"empty-message\">\n <p class=\"text\">\n <span class=\"fas fa-clock\"></span> \n <span>{{ \"platform.angular_components.count_items_in_target\" | translate:{ count: column.items.length, target: column.title } }}</span>\n </p>\n </div>\n </ng-template>\n\n <ng-template #customEmptyMessageTemplate>\n <ng-container *ngTemplateOutlet=\"columnEmptyMessageTemplate; context: { $implicit: column }\"></ng-container>\n </ng-template>\n\n <div\n *ngFor=\"let item of column.items\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"item.disabled\"\n (cdkDragStarted)=\"dragStarted()\"\n (cdkDragReleased)=\"dragReleased()\"\n (click)=\"selectItem($event, item, column)\">\n \n <ng-container *ngTemplateOutlet=\"itemTemplate\"></ng-container>\n\n <ng-container *cdkDragPreview>\n <ng-container *ngIf=\"selectedItems.size > 1; then itemDraggingTemplate else itemTemplate\"></ng-container>\n </ng-container>\n\n <ng-template #itemTemplate>\n <s-kanban-item\n [item]=\"item\"\n [selected]=\"selectedItems.has(item)\"\n [headerTemplate]=\"itemHeaderTemplate\"\n [bodyTemplate]=\"itemBodyTemplate\"\n [footerTemplate]=\"itemFooterTemplate\">\n </s-kanban-item>\n </ng-template>\n\n <ng-template #itemDraggingTemplate>\n <s-kanban-item-dragging [quantityItems]=\"selectedItems.size\"></s-kanban-item-dragging>\n </ng-template>\n\n <div *cdkDragPlaceholder>\n <div class=\"placeholder\">\n <div class=\"placeholder-line\"></div>\n </div>\n </div>\n </div>\n </div>\n </s-kanban-column>\n</div>\n\n",
|
|
14589
|
-
styles: [".kanban{display:-ms-flexbox;display:flex;gap:16px;width:100%}.kanban .empty-message{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:16px}.kanban .empty-message .text{overflow:hidden;text-align:center;text-overflow:ellipsis;width:100%;white-space:nowrap}@media screen and (max-width:600px){.kanban{-ms-flex-direction:column;flex-direction:column}}s-kanban-column{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;min-width:292px}.placeholder{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.placeholder .placeholder-line{background-color:#a5a5b2;height:1px;margin:6px 0;width:50%}"]
|
|
14676
|
+
selector: "s-kanban",
|
|
14677
|
+
template: "<div class=\"kanban\">\n <s-kanban-column\n *ngFor=\"let column of data.columns\"\n [data]=\"column\"\n [showCheckbox]=\"showColumnCheckboxes\"\n [headerTemplate]=\"columnHeaderTemplate\">\n <div\n [id]=\"column.id\"\n style=\"height: 100%; width: 100%;\"\n cdkDropList\n #dynamicList=\"cdkDropList\"\n [cdkDropListData]=\"column.items\"\n [cdkDropListConnectedTo]=\"getLinkedColumns(column)\"\n (cdkDropListDropped)=\"drop($event)\">\n\n <ng-container *ngIf=\"!columnEmptyMessageTemplate; then defaultEmptyMessageTemplate else customEmptyMessageTemplate\"></ng-container>\n\n <ng-template #defaultEmptyMessageTemplate>\n <div *ngIf=\"!column.items.length\" class=\"empty-message\">\n <p class=\"text\">\n <span class=\"fas fa-clock\"></span> \n <span>{{ \"platform.angular_components.count_items_in_target\" | translate:{ count: column.items.length, target: column.title } }}</span>\n </p>\n </div>\n </ng-template>\n\n <ng-template #customEmptyMessageTemplate>\n <ng-container *ngTemplateOutlet=\"columnEmptyMessageTemplate; context: { $implicit: column }\"></ng-container>\n </ng-template>\n\n <div\n *ngFor=\"let item of column.items\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"item.disabled || item.frozen\"\n (cdkDragStarted)=\"dragStarted()\"\n (cdkDragReleased)=\"dragReleased()\"\n (click)=\"selectItem($event, item, column)\">\n \n <ng-container *ngTemplateOutlet=\"itemTemplate\"></ng-container>\n\n <ng-container *cdkDragPreview>\n <ng-container *ngIf=\"selectedItems.size > 1; then itemDraggingTemplate else itemTemplate\"></ng-container>\n </ng-container>\n\n <ng-template #itemTemplate>\n <s-kanban-item\n [item]=\"item\"\n [selected]=\"selectedItems.has(item)\"\n [showCheckbox]=\"showItemCheckboxes\"\n [headerTemplate]=\"itemHeaderTemplate\"\n [bodyTemplate]=\"itemBodyTemplate\"\n [footerTemplate]=\"itemFooterTemplate\">\n </s-kanban-item>\n </ng-template>\n\n <ng-template #itemDraggingTemplate>\n <s-kanban-item-dragging [quantityItems]=\"selectedItems.size\"></s-kanban-item-dragging>\n </ng-template>\n\n <div *cdkDragPlaceholder>\n <div class=\"placeholder\">\n <div class=\"placeholder-line\"></div>\n </div>\n </div>\n </div>\n </div>\n </s-kanban-column>\n</div>\n\n",
|
|
14678
|
+
styles: [".kanban{display:-ms-flexbox;display:flex;gap:16px;overflow:auto;width:100%}.kanban .empty-message{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:16px}.kanban .empty-message .text{overflow:hidden;text-align:center;text-overflow:ellipsis;width:100%;white-space:nowrap}@media screen and (max-width:600px){.kanban{-ms-flex-direction:column;flex-direction:column}}s-kanban-column{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;min-width:292px}.placeholder{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.placeholder .placeholder-line{background-color:#a5a5b2;height:1px;margin:6px 0;width:50%}"]
|
|
14590
14679
|
})
|
|
14591
14680
|
], KanbanComponent);
|
|
14592
14681
|
return KanbanComponent;
|
|
@@ -14595,17 +14684,27 @@ var KanbanComponent = /** @class */ (function () {
|
|
|
14595
14684
|
var KanbanColumnComponent = /** @class */ (function () {
|
|
14596
14685
|
function KanbanColumnComponent(kanbanEventService) {
|
|
14597
14686
|
this.kanbanEventService = kanbanEventService;
|
|
14687
|
+
this.showCheckbox = true;
|
|
14598
14688
|
this.selectionControl = new FormControl(false);
|
|
14599
14689
|
this._unsubscribe$ = new Subject();
|
|
14600
14690
|
}
|
|
14601
14691
|
KanbanColumnComponent.prototype.ngOnInit = function () {
|
|
14602
14692
|
this._validateInputs();
|
|
14603
14693
|
this._subscriveEvents();
|
|
14694
|
+
this._createTieredOptions();
|
|
14604
14695
|
};
|
|
14605
14696
|
KanbanColumnComponent.prototype.ngOnDestroy = function () {
|
|
14606
14697
|
this._unsubscribe$.next();
|
|
14607
14698
|
this._unsubscribe$.complete();
|
|
14608
14699
|
};
|
|
14700
|
+
KanbanColumnComponent.prototype._createTieredOptions = function () {
|
|
14701
|
+
var _this = this;
|
|
14702
|
+
var options = [];
|
|
14703
|
+
this.data.options.forEach(function (option) {
|
|
14704
|
+
options.push(__assign(__assign({}, option), { command: function () { option.command(_this.data); } }));
|
|
14705
|
+
});
|
|
14706
|
+
this.data.options = options;
|
|
14707
|
+
};
|
|
14609
14708
|
KanbanColumnComponent.prototype._subscriveEvents = function () {
|
|
14610
14709
|
var _this = this;
|
|
14611
14710
|
this.selectionControl.valueChanges
|
|
@@ -14656,13 +14755,16 @@ var KanbanColumnComponent = /** @class */ (function () {
|
|
|
14656
14755
|
__decorate([
|
|
14657
14756
|
Input()
|
|
14658
14757
|
], KanbanColumnComponent.prototype, "data", void 0);
|
|
14758
|
+
__decorate([
|
|
14759
|
+
Input()
|
|
14760
|
+
], KanbanColumnComponent.prototype, "showCheckbox", void 0);
|
|
14659
14761
|
__decorate([
|
|
14660
14762
|
Input()
|
|
14661
14763
|
], KanbanColumnComponent.prototype, "headerTemplate", void 0);
|
|
14662
14764
|
KanbanColumnComponent = __decorate([
|
|
14663
14765
|
Component({
|
|
14664
14766
|
selector: "s-kanban-column",
|
|
14665
|
-
template: "<div class=\"kanban-column\">\n <div class=\"kanban-column__header\">\n <div class=\"content\">\n <form>\n <input\n type=\"checkbox\"\n name=\"checkbox\"\n [formControl]=\"selectionControl\">\n </form>\n\n <ng-container *ngIf=\"!headerTemplate; then defaultHeaderTemplate else customHeaderTemplate\"></ng-container>\n \n <ng-template #defaultHeaderTemplate>\n <div class=\"header\">\n <span class=\"title\">{{ data.title }} ({{ data.items.length }})</span>\n </div>\n </ng-template>\n \n <ng-template #customHeaderTemplate>\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { $implicit: data }\"></ng-container>\n </ng-template>\n </div>\n <s-button\n *ngIf=\"data.options\"\n priority=\"default\"\n [disabled]=\"false\"\n [auxiliary]=\"true\"\n size=\"small\"\n [model]=\"data.options\">\n </s-button>\n </div>\n <div class=\"kanban-column__body\">\n <ng-content></ng-content>\n </div>\n</div>",
|
|
14767
|
+
template: "<div class=\"kanban-column\">\n <div class=\"kanban-column__header\">\n <div class=\"content\">\n <form>\n <input\n *ngIf=\"showCheckbox\"\n type=\"checkbox\"\n name=\"checkbox\"\n [formControl]=\"selectionControl\">\n </form>\n\n <ng-container *ngIf=\"!headerTemplate; then defaultHeaderTemplate else customHeaderTemplate\"></ng-container>\n \n <ng-template #defaultHeaderTemplate>\n <div class=\"header\">\n <span class=\"title\">{{ data.title }} ({{ data.items.length }})</span>\n </div>\n </ng-template>\n \n <ng-template #customHeaderTemplate>\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { $implicit: data }\"></ng-container>\n </ng-template>\n </div>\n <s-button\n *ngIf=\"data.options\"\n priority=\"default\"\n [disabled]=\"false\"\n [auxiliary]=\"true\"\n size=\"small\"\n [model]=\"data.options\">\n </s-button>\n </div>\n <div class=\"kanban-column__body\">\n <ng-content></ng-content>\n </div>\n</div>",
|
|
14666
14768
|
styles: [".kanban-column{-ms-flex-align:center;align-items:center;background-color:#fbfafc;border:1px solid #dedce5;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;min-height:120px;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:100%}.kanban-column .kanban-column__header{-ms-flex-align:center;align-items:center;border-bottom:1px solid #dedce5;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:16px 16px 8px;width:100%}.kanban-column .kanban-column__header .content{display:-ms-flexbox;display:flex;gap:16px}.kanban-column .kanban-column__header .content .teste{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:\"Open Sans\" sans-serif}.kanban-column .kanban-column__header .content .teste .title{font-size:14px;font-weight:800}.kanban-column .kanban-column__header .content .teste .description{font-size:12px}.kanban-column .kanban-column__body{display:-ms-flexbox;display:flex;height:100%;-ms-flex-pack:center;justify-content:center;width:100%}"]
|
|
14667
14769
|
})
|
|
14668
14770
|
], KanbanColumnComponent);
|
|
@@ -14690,7 +14792,11 @@ var KanbanItemComponent = /** @class */ (function () {
|
|
|
14690
14792
|
function KanbanItemComponent(_kanbanEventService) {
|
|
14691
14793
|
this._kanbanEventService = _kanbanEventService;
|
|
14692
14794
|
this.selected = false;
|
|
14795
|
+
this.showCheckbox = true;
|
|
14693
14796
|
}
|
|
14797
|
+
KanbanItemComponent.prototype.ngOnInit = function () {
|
|
14798
|
+
this._createTieredOptions();
|
|
14799
|
+
};
|
|
14694
14800
|
KanbanItemComponent.prototype.onSelectedChange = function (value) {
|
|
14695
14801
|
if (value) {
|
|
14696
14802
|
this._kanbanEventService.emitSelectItemEvent(this.item);
|
|
@@ -14699,6 +14805,14 @@ var KanbanItemComponent = /** @class */ (function () {
|
|
|
14699
14805
|
this._kanbanEventService.emitUnselectItemEvent(this.item);
|
|
14700
14806
|
}
|
|
14701
14807
|
};
|
|
14808
|
+
KanbanItemComponent.prototype._createTieredOptions = function () {
|
|
14809
|
+
var _this = this;
|
|
14810
|
+
var options = [];
|
|
14811
|
+
this.item.options.forEach(function (option) {
|
|
14812
|
+
options.push(__assign(__assign({}, option), { command: function () { option.command(_this.item); } }));
|
|
14813
|
+
});
|
|
14814
|
+
this.item.options = options;
|
|
14815
|
+
};
|
|
14702
14816
|
KanbanItemComponent.ctorParameters = function () { return [
|
|
14703
14817
|
{ type: KanbanEventService }
|
|
14704
14818
|
]; };
|
|
@@ -14708,6 +14822,9 @@ var KanbanItemComponent = /** @class */ (function () {
|
|
|
14708
14822
|
__decorate([
|
|
14709
14823
|
Input()
|
|
14710
14824
|
], KanbanItemComponent.prototype, "selected", void 0);
|
|
14825
|
+
__decorate([
|
|
14826
|
+
Input()
|
|
14827
|
+
], KanbanItemComponent.prototype, "showCheckbox", void 0);
|
|
14711
14828
|
__decorate([
|
|
14712
14829
|
Input()
|
|
14713
14830
|
], KanbanItemComponent.prototype, "headerTemplate", void 0);
|
|
@@ -14719,9 +14836,9 @@ var KanbanItemComponent = /** @class */ (function () {
|
|
|
14719
14836
|
], KanbanItemComponent.prototype, "footerTemplate", void 0);
|
|
14720
14837
|
KanbanItemComponent = __decorate([
|
|
14721
14838
|
Component({
|
|
14722
|
-
selector:
|
|
14723
|
-
template: "<p-tieredMenu\n #optionsMenu\n [popup]=\"true\"\n appendTo=\"body\"\n [baseZIndex]=\"9999\"\n [model]=\"item.options\">\n</p-tieredMenu>\n\n<div\n class=\"kanban-item\"\n [ngClass]=\"{\n 'kanban-item--selected': selected && !item.disabled,\n 'kanban-item--disabled': item.disabled\n }\">\n <div class=\"kanban-item__header\">\n <div class=\"content\">\n <form>\n <input\n *ngIf=\"!item.disabled\"\n type=\"checkbox\"\n name=\"checkbox\"\n [(ngModel)]=\"selected\"\n (ngModelChange)=\"onSelectedChange($event)\"\n (click)=\"$event.stopPropagation()\">\n </form>\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { $implicit: item }\"></ng-container>\n </div>\n <button\n *ngIf=\"item.options && !item.disabled\"\n class=\"options-button\"\n (click)=\"optionsMenu.toggle($event); $event.stopPropagation();\">\n <i class=\"fas fa-ellipsis-v\"></i>\n </button>\n </div>\n <div class=\"kanban-item__body\">\n <ng-container *ngTemplateOutlet=\"bodyTemplate; context: { $implicit: item }\"></ng-container>\n </div>\n <div *ngIf=\"footerTemplate\" class=\"kanban-item__footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate; context: { $implicit: item }\"></ng-container> \n </div>\n</div>",
|
|
14724
|
-
styles: [".kanban-item{background-color:#fff;border-radius:4px;box-shadow:0 1px 5px 0 rgba(0,0,0,.25);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:16px;min-width:260px;padding:16px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.kanban-item .kanban-item__header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.kanban-item .kanban-item__header .content{display:-ms-flexbox;display:flex;gap:16px}.kanban-item .kanban-item__header .options-button{background-color:transparent;border:none;cursor:pointer;margin-right:-8px;padding:0 8px}.kanban-item .kanban-item__body{margin:16px 0}.kanban-item .kanban-item__footer{border-top:1px solid #dedce5;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.kanban-item .kanban-item__footer .date-info{-ms-flex-align:center;align-items:center;color:#6e7280;display:-ms-flexbox;display:flex;font-family:\"Open Sans\" sans-serif;font-size:12px;gap:4px;line-height:150%}.kanban-item--selected{border:1px solid #428bca}.kanban-item--disabled{opacity:50%}"]
|
|
14839
|
+
selector: "s-kanban-item",
|
|
14840
|
+
template: "<p-tieredMenu\n #optionsMenu\n [popup]=\"true\"\n appendTo=\"body\"\n [baseZIndex]=\"9999\"\n [model]=\"item.options\">\n</p-tieredMenu>\n\n<div\n class=\"kanban-item\"\n [ngClass]=\"{\n 'kanban-item--selected': selected && !item.disabled,\n 'kanban-item--disabled': item.disabled,\n 'kanban-item--frozen': !item.disabled && item.frozen\n }\">\n <div class=\"kanban-item__header\">\n <div class=\"content\">\n <form>\n <input\n *ngIf=\"showCheckbox && !item.disabled && !item.frozen\"\n type=\"checkbox\"\n name=\"checkbox\"\n [(ngModel)]=\"selected\"\n (ngModelChange)=\"onSelectedChange($event)\"\n (click)=\"$event.stopPropagation()\">\n </form>\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { $implicit: item }\"></ng-container>\n </div>\n <button\n *ngIf=\"item.options && !item.disabled\"\n class=\"options-button\"\n (click)=\"optionsMenu.toggle($event); $event.stopPropagation();\">\n <i class=\"fas fa-ellipsis-v\"></i>\n </button>\n </div>\n <div class=\"kanban-item__body\">\n <ng-container *ngTemplateOutlet=\"bodyTemplate; context: { $implicit: item }\"></ng-container>\n </div>\n <div *ngIf=\"footerTemplate\" class=\"kanban-item__footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate; context: { $implicit: item }\"></ng-container> \n </div>\n</div>",
|
|
14841
|
+
styles: [".kanban-item{background-color:#fff;border-radius:4px;box-shadow:0 1px 5px 0 rgba(0,0,0,.25);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:16px;min-width:260px;padding:16px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.kanban-item .kanban-item__header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.kanban-item .kanban-item__header .content{display:-ms-flexbox;display:flex;gap:16px}.kanban-item .kanban-item__header .options-button{background-color:transparent;border:none;cursor:pointer;margin-right:-8px;padding:0 8px}.kanban-item .kanban-item__body{margin:16px 0}.kanban-item .kanban-item__footer{border-top:1px solid #dedce5;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.kanban-item .kanban-item__footer .date-info{-ms-flex-align:center;align-items:center;color:#6e7280;display:-ms-flexbox;display:flex;font-family:\"Open Sans\" sans-serif;font-size:12px;gap:4px;line-height:150%}.kanban-item--selected{border:1px solid #428bca}.kanban-item--disabled{opacity:50%}.kanban-item--frozen{box-shadow:none}"]
|
|
14725
14842
|
})
|
|
14726
14843
|
], KanbanItemComponent);
|
|
14727
14844
|
return KanbanItemComponent;
|