@ngx-smz/core 21.6.0 → 21.6.1
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.
|
@@ -44031,6 +44031,11 @@ class SmzTreeBuilder {
|
|
|
44031
44031
|
collapseLabel: '',
|
|
44032
44032
|
expandLabel: ''
|
|
44033
44033
|
},
|
|
44034
|
+
treeSelectionButtons: {
|
|
44035
|
+
isVisible: false,
|
|
44036
|
+
selectAllLabel: '',
|
|
44037
|
+
clearSelectionLabel: '',
|
|
44038
|
+
},
|
|
44034
44039
|
},
|
|
44035
44040
|
},
|
|
44036
44041
|
footer: {
|
|
@@ -44166,6 +44171,14 @@ class SmzTreeToolbarBuilder {
|
|
|
44166
44171
|
};
|
|
44167
44172
|
return this;
|
|
44168
44173
|
}
|
|
44174
|
+
useTreeSelectionButtons(selectAllLabel = '', clearSelectionLabel = '') {
|
|
44175
|
+
this.treeBuilderRef.treeState.header.toolbar.treeSelectionButtons = {
|
|
44176
|
+
isVisible: true,
|
|
44177
|
+
selectAllLabel: selectAllLabel,
|
|
44178
|
+
clearSelectionLabel: clearSelectionLabel,
|
|
44179
|
+
};
|
|
44180
|
+
return this;
|
|
44181
|
+
}
|
|
44169
44182
|
// public useNodeExpandButtons(expandLabel: string = '', collapseLabel: string = '',
|
|
44170
44183
|
// expandTooltip: string = 'Expandir nó selecionado', collapseTooltip: string = 'Colapsar nó selecionado',
|
|
44171
44184
|
// disabledTooltip: string = 'Selecione um nó da árvore'): SmzTreeToolbarBuilder {
|
|
@@ -44545,6 +44558,12 @@ class SmzTreeComponent {
|
|
|
44545
44558
|
primeSelection = [];
|
|
44546
44559
|
selection = [];
|
|
44547
44560
|
selectionKey = 'key';
|
|
44561
|
+
get hasSelection() {
|
|
44562
|
+
if (isArray(this.primeSelection)) {
|
|
44563
|
+
return this.primeSelection.length > 0;
|
|
44564
|
+
}
|
|
44565
|
+
return this.primeSelection != null;
|
|
44566
|
+
}
|
|
44548
44567
|
// Evento emitido quando o array de nodes selecionados é atualizado
|
|
44549
44568
|
selectedNodes = new EventEmitter();
|
|
44550
44569
|
// Evento emitido quando um nó da árvore é selecionado ou é clicado com o botão direito do mouse
|
|
@@ -44793,17 +44812,13 @@ class SmzTreeComponent {
|
|
|
44793
44812
|
return newResults;
|
|
44794
44813
|
}
|
|
44795
44814
|
expandAll() {
|
|
44796
|
-
this.
|
|
44797
|
-
this.expandRecursive(node, true);
|
|
44798
|
-
});
|
|
44815
|
+
this.setAllNodesExpanded(true);
|
|
44799
44816
|
setTimeout(() => {
|
|
44800
44817
|
this.treeExpanded.emit();
|
|
44801
44818
|
}, 200);
|
|
44802
44819
|
}
|
|
44803
44820
|
collapseAll() {
|
|
44804
|
-
this.
|
|
44805
|
-
this.expandRecursive(node, false);
|
|
44806
|
-
});
|
|
44821
|
+
this.setAllNodesExpanded(false);
|
|
44807
44822
|
setTimeout(() => {
|
|
44808
44823
|
this.nodeCollapsed.emit(null);
|
|
44809
44824
|
}, 200);
|
|
@@ -44811,6 +44826,7 @@ class SmzTreeComponent {
|
|
|
44811
44826
|
expandNode() {
|
|
44812
44827
|
if (this.primeSelection != null) {
|
|
44813
44828
|
this.expandRecursive(this.primeSelection, true);
|
|
44829
|
+
this.refreshTreeView();
|
|
44814
44830
|
setTimeout(() => {
|
|
44815
44831
|
this.nodeExpanded.emit({ node: this.primeSelection });
|
|
44816
44832
|
}, 200);
|
|
@@ -44819,11 +44835,47 @@ class SmzTreeComponent {
|
|
|
44819
44835
|
collapseNode() {
|
|
44820
44836
|
if (this.primeSelection != null) {
|
|
44821
44837
|
this.expandRecursive(this.primeSelection, false);
|
|
44838
|
+
this.refreshTreeView();
|
|
44822
44839
|
setTimeout(() => {
|
|
44823
44840
|
this.nodeCollapsed.emit({ node: this.primeSelection });
|
|
44824
44841
|
}, 200);
|
|
44825
44842
|
}
|
|
44826
44843
|
}
|
|
44844
|
+
collectSelectableNodeKeys(nodes) {
|
|
44845
|
+
const keys = [];
|
|
44846
|
+
if (nodes == null) {
|
|
44847
|
+
return keys;
|
|
44848
|
+
}
|
|
44849
|
+
const traverse = (node) => {
|
|
44850
|
+
if (node.key != null && node.selectable !== false) {
|
|
44851
|
+
keys.push(String(node.key));
|
|
44852
|
+
}
|
|
44853
|
+
if (node.children != null) {
|
|
44854
|
+
node.children.forEach((childNode) => traverse(childNode));
|
|
44855
|
+
}
|
|
44856
|
+
};
|
|
44857
|
+
nodes.forEach((node) => traverse(node));
|
|
44858
|
+
return keys;
|
|
44859
|
+
}
|
|
44860
|
+
selectAll() {
|
|
44861
|
+
const selectionMode = this.state?.selection?.mode ?? 'single';
|
|
44862
|
+
if (selectionMode === 'single') {
|
|
44863
|
+
return;
|
|
44864
|
+
}
|
|
44865
|
+
const selectedKeys = this.collectSelectableNodeKeys(this.treeItems);
|
|
44866
|
+
const expandNodes = this.state?.selection?.expandNodes ?? true;
|
|
44867
|
+
this.primeSelection = resolveTreeNodeSelection(this.treeItems, selectedKeys, expandNodes);
|
|
44868
|
+
this.refreshTreeView();
|
|
44869
|
+
this.selectedNodes.emit(this.primeSelection);
|
|
44870
|
+
this.selectionChange.emit(null);
|
|
44871
|
+
}
|
|
44872
|
+
clearSelection() {
|
|
44873
|
+
const selectionMode = this.state?.selection?.mode ?? 'single';
|
|
44874
|
+
this.primeSelection = selectionMode === 'single' ? null : [];
|
|
44875
|
+
this.selectedNodes.emit(selectionMode === 'single' ? [] : this.primeSelection);
|
|
44876
|
+
this.selectionChange.emit(null);
|
|
44877
|
+
this.cdr.markForCheck();
|
|
44878
|
+
}
|
|
44827
44879
|
// Método que recebe o evento de arrastar do prime e repassa para o nosso serviço de drag and drop.
|
|
44828
44880
|
// Inicialmente ele verifica se a operação é permitida e envia o accept para o prime, entretanto
|
|
44829
44881
|
// o dados do evento só podem ser lidos depois de um tempo pre-definido porque o parent do nó
|
|
@@ -44877,6 +44929,54 @@ class SmzTreeComponent {
|
|
|
44877
44929
|
});
|
|
44878
44930
|
}
|
|
44879
44931
|
}
|
|
44932
|
+
setAllNodesExpanded(isExpand) {
|
|
44933
|
+
this.treeItems?.forEach((node) => {
|
|
44934
|
+
this.expandRecursive(node, isExpand);
|
|
44935
|
+
});
|
|
44936
|
+
this.refreshTreeView();
|
|
44937
|
+
}
|
|
44938
|
+
// PrimeNG Tree (OnPush) ignores in-place `expanded` mutations. Replacing the root
|
|
44939
|
+
// node objects forces p-treeNode to recreate and read the new expansion state.
|
|
44940
|
+
refreshTreeView() {
|
|
44941
|
+
if (this.treeItems == null) {
|
|
44942
|
+
return;
|
|
44943
|
+
}
|
|
44944
|
+
this.treeItems = this.treeItems.map((node) => this.cloneRootNode(node));
|
|
44945
|
+
this.rematchPrimeSelection();
|
|
44946
|
+
this.cdr.markForCheck();
|
|
44947
|
+
}
|
|
44948
|
+
cloneRootNode(node) {
|
|
44949
|
+
const clonedRootNode = { ...node };
|
|
44950
|
+
if (clonedRootNode.children != null) {
|
|
44951
|
+
clonedRootNode.children.forEach((childNode) => {
|
|
44952
|
+
childNode.parent = clonedRootNode;
|
|
44953
|
+
});
|
|
44954
|
+
}
|
|
44955
|
+
return clonedRootNode;
|
|
44956
|
+
}
|
|
44957
|
+
rematchPrimeSelection() {
|
|
44958
|
+
if (this.primeSelection == null || this.treeItems == null) {
|
|
44959
|
+
return;
|
|
44960
|
+
}
|
|
44961
|
+
if (isArray(this.primeSelection)) {
|
|
44962
|
+
this.primeSelection = this.primeSelection.map((selectedNode) => {
|
|
44963
|
+
if (selectedNode?.key == null) {
|
|
44964
|
+
return selectedNode;
|
|
44965
|
+
}
|
|
44966
|
+
const matchedNode = getTreeNodeFromKey(this.treeItems, selectedNode.key);
|
|
44967
|
+
return matchedNode ?? selectedNode;
|
|
44968
|
+
});
|
|
44969
|
+
return;
|
|
44970
|
+
}
|
|
44971
|
+
const selectedNode = this.primeSelection;
|
|
44972
|
+
if (selectedNode?.key == null) {
|
|
44973
|
+
return;
|
|
44974
|
+
}
|
|
44975
|
+
const matchedNode = getTreeNodeFromKey(this.treeItems, selectedNode.key);
|
|
44976
|
+
if (matchedNode != null) {
|
|
44977
|
+
this.primeSelection = matchedNode;
|
|
44978
|
+
}
|
|
44979
|
+
}
|
|
44880
44980
|
// Método que verifica se uma operação é permitida ou não, baseado nas regras da configuração
|
|
44881
44981
|
check(event) {
|
|
44882
44982
|
// console.log(`D&D: Dropped [${event.dragNode.label} (${event.dragNode.type})] into [${event.dropNode.label} (${event.dropNode.type})], index=${event.index}`);
|
|
@@ -44981,11 +45081,11 @@ class SmzTreeComponent {
|
|
|
44981
45081
|
}
|
|
44982
45082
|
}
|
|
44983
45083
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: TreeHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
44984
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzTreeComponent, isStandalone: false, selector: "smz-ui-tree", inputs: { state: "state", items: "items", loading: "loading", styleClass: "styleClass", inlineStyle: "inlineStyle", appendTo: "appendTo", selection: "selection", selectionKey: "selectionKey" }, outputs: { selectedNodes: "selectedNodes", selectionChange: "selectionChange", parentChange: "parentChange", reorder: "reorder", blockedDrop: "blockedDrop", nodeExpanded: "nodeExpanded", nodeCollapsed: "nodeCollapsed", treeExpanded: "treeExpanded", nodeDropped: "nodeDropped" }, providers: [TreeDragDropService], queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "dt", first: true, predicate: Tree, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (state) {\r\n @if ((state.emptyFeedback?.isFeatured) && (treeItems != null && treeItems.length === 0)) {\r\n <smz-data-info\r\n [image]=\"state.emptyFeedback.image\"\r\n [message]=\"state.emptyFeedback.message\"\r\n [callbackInfo]=\"state.emptyFeedback.extraInfo\"\r\n [callbackLabel]=\"state.emptyFeedback.actionButton?.label\"\r\n (clicked)=\"state.emptyFeedback.actionButton?.callback($event)\">\r\n <ng-template pTemplate=\"actions\">\r\n <ng-container *ngTemplateOutlet=\"emptyActionsTemplate; context: { $implicit: {} }\"></ng-container>\r\n </ng-template>\r\n </smz-data-info>\r\n } @else {\r\n @if (treeItems != null) {\r\n <p-contextMenu #cm [model]=\"menuItems\" [appendTo]=\"appendTo\" [styleClass]=\"menuItems == null || menuItems?.length === 0 ? 'invisible-important' : ''\"></p-contextMenu>\r\n <p-menu #rowMenu [model]=\"menuItems\" [popup]=\"true\" appendTo=\"body\" />\r\n <p-tree #dt [value]=\"treeItems\"\r\n scrollHeight=\"flex\"\r\n [contextMenu]=\"state.menu.behavior === 'context-menu' ? cm : null\"\r\n [selectionMode]=\"state.selection.mode\"\r\n [(selection)]=\"primeSelection\"\r\n layout=\"vertical\"\r\n [style]=\"inlineStyle\"\r\n [styleClass]=\"styleClass\"\r\n [propagateSelectionUp]=\"state.selection.propagateUp\"\r\n [propagateSelectionDown]=\"state.selection.propagateDown\"\r\n [loading]=\"state.loading.isLoading\"\r\n [loadingIcon]=\"state.loading.icon\"\r\n [filter]=\"false\"\r\n [filterMode]=\"state.filter.mode\"\r\n [filterPlaceholder]=\"state.filter.textPlaceholder\"\r\n [draggableNodes]=\"state.dragAndDrop.draggable\"\r\n [droppableNodes]=\"state.dragAndDrop.droppable\"\r\n [validateDrop]=\"state.dragAndDrop.validateDrop\"\r\n (onNodeContextMenuSelect)=\"onContextMenuOpen($event)\"\r\n (onNodeSelect)=\"onSelected($event)\"\r\n (onNodeUnselect)=\"onUnselected($event)\"\r\n (onNodeExpand)=\"onExpanded($event)\"\r\n (onNodeCollapse)=\"onCollapsed($event)\"\r\n (onNodeDrop)=\"onDropped($event)\"\r\n (onFilter)=\"onFiltered($event)\">\r\n @if (state.header.isVisible) {\r\n <ng-template pTemplate=\"header\">\r\n @if (state.header.toolbar; as toolbar) {\r\n @if (headerTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center w-full justify-start\">\r\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"grid grid-nogutter justify-start items-center mb-2 gap-2\">\r\n @if (state.header.title != null) {\r\n <h3 class=\"m-2 col\">{{state.header.title}}</h3>\r\n }\r\n <div class=\"grid grid-nogutter justify-start items-center gap-2\">\r\n @for (button of state.header.toolbar.items; track button; let i = $index) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': button.color === 'secondary', 'p-button-success': button.color === 'success', 'p-button-info': button.color === 'info', 'p-button-warning': button.color === 'warning', 'p-button-help': button.color === 'help', 'p-button-danger': button.color === 'danger' }\"\r\n [label]=\"button.label\"\r\n [icon]=\"button.icon\"\r\n (click)=\"onToolbarButtonClick($event, button, treeItems)\"\r\n [pTooltip]=\"button.tooltip\">\r\n </button>\r\n }\r\n @if (toolbar.nodeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.nodeExpandButtons.expandLabel\"\r\n icon=\"fa-solid fa-angle-down\"\r\n (click)=\"expandNode()\"\r\n [pTooltip]=\"selection != null ? toolbar.nodeExpandButtons.expandTooltip : toolbar.nodeExpandButtons.disabledTooltip\"\r\n [disabled]=\"selection == null\">\r\n </button>\r\n }\r\n @if (toolbar.nodeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.nodeExpandButtons.collapseLabel\"\r\n icon=\"fa-solid fa-angle-up\"\r\n (click)=\"collapseNode()\"\r\n [pTooltip]=\"selection != null ? toolbar.nodeExpandButtons.collapseTooltip : toolbar.nodeExpandButtons.disabledTooltip\"\r\n [disabled]=\"selection == null\">\r\n </button>\r\n }\r\n @if (toolbar.treeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeExpandButtons.expandLabel\"\r\n icon=\"fa-solid fa-angles-down\"\r\n (click)=\"expandAll()\"\r\n [pTooltip]=\"\">\r\n </button>\r\n }\r\n @if (toolbar.treeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeExpandButtons.collapseLabel\"\r\n icon=\"fa-solid fa-angles-up\"\r\n (click)=\"collapseAll()\"\r\n [pTooltip]=\"\">\r\n </button>\r\n }\r\n @if (actionsTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center justify-start\">\r\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (state.filter.show) {\r\n <p-iconfield class=\"col-12\" [ngClass]=\"state.filter.styleClass\">\r\n <p-inputicon styleClass=\"pi pi-search\" />\r\n <input #inputGlobal pInputText type=\"text\" (input)=\"dt._filter(inputGlobal.value)\" [placeholder]=\"state.filter.textPlaceholder\" />\r\n </p-iconfield>\r\n }\r\n </div>\r\n @if (toolbarTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center mt-2\"\r\n [ngClass]=\"'justify-' + state.header.toolbar.alignment\">\r\n <ng-container *ngTemplateOutlet=\"toolbarTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n }\r\n </ng-template>\r\n }\r\n @if (state.footer.isVisible) {\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"grid grid-nogutter justify-start items-center\">\r\n <span class=\"col mr-2\">FOOTER</span>\r\n </div>\r\n </ng-template>\r\n }\r\n @for (content of contentTemplates; track content) {\r\n <ng-template let-node [pTemplate]=\"content.type\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n @if (content.template != null) {\r\n <ng-container *ngTemplateOutlet=\"content.template; context: { $implicit: node }\"></ng-container>\r\n } @else {\r\n <div>{{ node.label }}</div>\r\n }\r\n @if (state.menu.behavior === 'row-menu') {\r\n <p-button clickStopPropagation (onClick)=\"onRowMenuOpen(node, rowMenu, $event)\" [icon]=\"state.menu.rowMenuIcon\" [rounded]=\"true\" [text]=\"true\" [severity]=\"state.menu.rowMenuIconSeverity\"/>\r\n }\r\n </div>\r\n </ng-template>\r\n }\r\n <ng-template let-node pTemplate=\"Check\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <div>{{ node.label }}</div>\r\n @if (state.menu.behavior === 'row-menu') {\r\n <p-button clickStopPropagation (onClick)=\"onRowMenuOpen(node, rowMenu, $event)\" [icon]=\"state.menu.rowMenuIcon\" [rounded]=\"true\" [text]=\"true\" [severity]=\"state.menu.rowMenuIconSeverity\"/>\r\n }\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\">\r\n @if (!state.emptyFeedback.isFeatured) {\r\n <div>{{ state.emptyFeedback.message }}</div>\r\n }\r\n </ng-template>\r\n </p-tree>\r\n }\r\n }\r\n} @else {\r\n @if (emptyStateTemplate != null) {\r\n <ng-container *ngTemplateOutlet=\"emptyStateTemplate; context: { $implicit: {} }\"></ng-container>\r\n }\r\n}\r\n\r\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$7.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: ClickStopPropagationDirective, selector: "[clickStopPropagation]" }, { kind: "component", type: SmzDataInfoComponent, selector: "smz-data-info", inputs: ["image", "message", "actions", "callbackInfo", "callbackLabel"], outputs: ["clicked"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i8$2.ContextMenu, selector: "p-contextMenu, p-contextmenu, p-context-menu", inputs: ["model", "triggerEvent", "target", "global", "style", "styleClass", "autoZIndex", "baseZIndex", "id", "breakpoint", "ariaLabel", "ariaLabelledBy", "pressDelay", "appendTo", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: i9$1.Tree, selector: "p-tree", inputs: ["value", "selectionMode", "loadingMode", "selection", "styleClass", "contextMenu", "contextMenuSelectionMode", "contextMenuSelection", "draggableScope", "droppableScope", "draggableNodes", "droppableNodes", "metaKeySelection", "propagateSelectionUp", "propagateSelectionDown", "loading", "loadingIcon", "emptyMessage", "ariaLabel", "togglerAriaLabel", "ariaLabelledBy", "validateDrop", "filter", "filterInputAutoFocus", "filterBy", "filterMode", "filterOptions", "filterPlaceholder", "filteredNodes", "filterLocale", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "indentation", "_templateMap", "trackBy", "highlightOnSelect"], outputs: ["selectionChange", "contextMenuSelectionChange", "onNodeSelect", "onNodeUnselect", "onNodeExpand", "onNodeCollapse", "onNodeContextMenuSelect", "onNodeDoubleClick", "onNodeDrop", "onLazyLoad", "onScroll", "onScrollIndexChange", "onFilter"] }, { kind: "directive", type: i2.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i11$1.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex", "appendTo", "motionOptions"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i26.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i27.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
45084
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzTreeComponent, isStandalone: false, selector: "smz-ui-tree", inputs: { state: "state", items: "items", loading: "loading", styleClass: "styleClass", inlineStyle: "inlineStyle", appendTo: "appendTo", selection: "selection", selectionKey: "selectionKey" }, outputs: { selectedNodes: "selectedNodes", selectionChange: "selectionChange", parentChange: "parentChange", reorder: "reorder", blockedDrop: "blockedDrop", nodeExpanded: "nodeExpanded", nodeCollapsed: "nodeCollapsed", treeExpanded: "treeExpanded", nodeDropped: "nodeDropped" }, providers: [TreeDragDropService], queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "dt", first: true, predicate: Tree, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (state) {\r\n @if ((state.emptyFeedback?.isFeatured) && (treeItems != null && treeItems.length === 0)) {\r\n <smz-data-info\r\n [image]=\"state.emptyFeedback.image\"\r\n [message]=\"state.emptyFeedback.message\"\r\n [callbackInfo]=\"state.emptyFeedback.extraInfo\"\r\n [callbackLabel]=\"state.emptyFeedback.actionButton?.label\"\r\n (clicked)=\"state.emptyFeedback.actionButton?.callback($event)\">\r\n <ng-template pTemplate=\"actions\">\r\n <ng-container *ngTemplateOutlet=\"emptyActionsTemplate; context: { $implicit: {} }\"></ng-container>\r\n </ng-template>\r\n </smz-data-info>\r\n } @else {\r\n @if (treeItems != null) {\r\n <p-contextMenu #cm [model]=\"menuItems\" [appendTo]=\"appendTo\" [styleClass]=\"menuItems == null || menuItems?.length === 0 ? 'invisible-important' : ''\"></p-contextMenu>\r\n <p-menu #rowMenu [model]=\"menuItems\" [popup]=\"true\" appendTo=\"body\" />\r\n <p-tree #dt [value]=\"treeItems\"\r\n scrollHeight=\"flex\"\r\n [contextMenu]=\"state.menu.behavior === 'context-menu' ? cm : null\"\r\n [selectionMode]=\"state.selection.mode\"\r\n [(selection)]=\"primeSelection\"\r\n layout=\"vertical\"\r\n [style]=\"inlineStyle\"\r\n [styleClass]=\"styleClass\"\r\n [propagateSelectionUp]=\"state.selection.propagateUp\"\r\n [propagateSelectionDown]=\"state.selection.propagateDown\"\r\n [loading]=\"state.loading.isLoading\"\r\n [loadingIcon]=\"state.loading.icon\"\r\n [filter]=\"false\"\r\n [filterMode]=\"state.filter.mode\"\r\n [filterPlaceholder]=\"state.filter.textPlaceholder\"\r\n [draggableNodes]=\"state.dragAndDrop.draggable\"\r\n [droppableNodes]=\"state.dragAndDrop.droppable\"\r\n [validateDrop]=\"state.dragAndDrop.validateDrop\"\r\n (onNodeContextMenuSelect)=\"onContextMenuOpen($event)\"\r\n (onNodeSelect)=\"onSelected($event)\"\r\n (onNodeUnselect)=\"onUnselected($event)\"\r\n (onNodeExpand)=\"onExpanded($event)\"\r\n (onNodeCollapse)=\"onCollapsed($event)\"\r\n (onNodeDrop)=\"onDropped($event)\"\r\n (onFilter)=\"onFiltered($event)\">\r\n @if (state.header.isVisible) {\r\n <ng-template pTemplate=\"header\">\r\n @if (state.header.toolbar; as toolbar) {\r\n @if (headerTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center w-full justify-start\">\r\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"grid grid-nogutter justify-start items-center mb-2 gap-2\">\r\n @if (state.header.title != null) {\r\n <h3 class=\"m-2 col\">{{state.header.title}}</h3>\r\n }\r\n <div class=\"grid grid-nogutter justify-start items-center gap-2\">\r\n @for (button of state.header.toolbar.items; track button; let i = $index) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': button.color === 'secondary', 'p-button-success': button.color === 'success', 'p-button-info': button.color === 'info', 'p-button-warning': button.color === 'warning', 'p-button-help': button.color === 'help', 'p-button-danger': button.color === 'danger' }\"\r\n [label]=\"button.label\"\r\n [icon]=\"button.icon\"\r\n (click)=\"onToolbarButtonClick($event, button, treeItems)\"\r\n [pTooltip]=\"button.tooltip\">\r\n </button>\r\n }\r\n @if (toolbar.nodeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.nodeExpandButtons.expandLabel\"\r\n icon=\"fa-solid fa-angle-down\"\r\n (click)=\"expandNode()\"\r\n [pTooltip]=\"selection != null ? toolbar.nodeExpandButtons.expandTooltip : toolbar.nodeExpandButtons.disabledTooltip\"\r\n [disabled]=\"selection == null\">\r\n </button>\r\n }\r\n @if (toolbar.nodeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.nodeExpandButtons.collapseLabel\"\r\n icon=\"fa-solid fa-angle-up\"\r\n (click)=\"collapseNode()\"\r\n [pTooltip]=\"selection != null ? toolbar.nodeExpandButtons.collapseTooltip : toolbar.nodeExpandButtons.disabledTooltip\"\r\n [disabled]=\"selection == null\">\r\n </button>\r\n }\r\n @if (toolbar.treeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeExpandButtons.expandLabel\"\r\n icon=\"fa-solid fa-angles-down\"\r\n (click)=\"expandAll()\"\r\n [pTooltip]=\"toolbar.treeExpandButtons.expandLabel != null && toolbar.treeExpandButtons.expandLabel !== '' \r\n ? toolbar.treeExpandButtons.expandLabel \r\n : 'Expandir \u00E1rvore'\">\r\n </button>\r\n }\r\n @if (toolbar.treeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeExpandButtons.collapseLabel\"\r\n icon=\"fa-solid fa-angles-up\"\r\n (click)=\"collapseAll()\"\r\n [pTooltip]=\"toolbar.treeExpandButtons.collapseLabel != null && toolbar.treeExpandButtons.collapseLabel !== '' \r\n ? toolbar.treeExpandButtons.collapseLabel \r\n : 'Colapsar \u00E1rvore'\">\r\n </button>\r\n }\r\n @if (toolbar.treeSelectionButtons?.isVisible === true) {\r\n\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeSelectionButtons.selectAllLabel\"\r\n icon=\"fa-solid fa-check-double\"\r\n (click)=\"selectAll()\"\r\n [disabled]=\"state.selection?.mode === 'single'\"\r\n [pTooltip]=\"state.selection?.mode === 'single' \r\n ? 'Dispon\u00EDvel apenas em sele\u00E7\u00E3o m\u00FAltipla' \r\n : (toolbar.treeSelectionButtons.selectAllLabel != null && toolbar.treeSelectionButtons.selectAllLabel !== '' ? toolbar.treeSelectionButtons.selectAllLabel : 'Selecionar tudo')\">\r\n </button>\r\n\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeSelectionButtons.clearSelectionLabel\"\r\n icon=\"fa-solid fa-eraser\"\r\n (click)=\"clearSelection()\"\r\n [disabled]=\"!hasSelection\"\r\n [pTooltip]=\"toolbar.treeSelectionButtons.clearSelectionLabel != null && toolbar.treeSelectionButtons.clearSelectionLabel !== '' \r\n ? toolbar.treeSelectionButtons.clearSelectionLabel \r\n : 'Limpar sele\u00E7\u00E3o'\">\r\n </button>\r\n }\r\n\r\n @if (actionsTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center justify-start\">\r\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (state.filter.show) {\r\n <p-iconfield class=\"col-12\" [ngClass]=\"state.filter.styleClass\">\r\n <p-inputicon styleClass=\"pi pi-search\" />\r\n <input #inputGlobal pInputText type=\"text\" (input)=\"dt._filter(inputGlobal.value)\" [placeholder]=\"state.filter.textPlaceholder\" />\r\n </p-iconfield>\r\n }\r\n </div>\r\n @if (toolbarTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center mt-2\"\r\n [ngClass]=\"'justify-' + state.header.toolbar.alignment\">\r\n <ng-container *ngTemplateOutlet=\"toolbarTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n }\r\n </ng-template>\r\n }\r\n @if (state.footer.isVisible) {\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"grid grid-nogutter justify-start items-center\">\r\n <span class=\"col mr-2\">FOOTER</span>\r\n </div>\r\n </ng-template>\r\n }\r\n @for (content of contentTemplates; track content) {\r\n <ng-template let-node [pTemplate]=\"content.type\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n @if (content.template != null) {\r\n <ng-container *ngTemplateOutlet=\"content.template; context: { $implicit: node }\"></ng-container>\r\n } @else {\r\n <div>{{ node.label }}</div>\r\n }\r\n @if (state.menu.behavior === 'row-menu') {\r\n <p-button clickStopPropagation (onClick)=\"onRowMenuOpen(node, rowMenu, $event)\" [icon]=\"state.menu.rowMenuIcon\" [rounded]=\"true\" [text]=\"true\" [severity]=\"state.menu.rowMenuIconSeverity\"/>\r\n }\r\n </div>\r\n </ng-template>\r\n }\r\n <ng-template let-node pTemplate=\"Check\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <div>{{ node.label }}</div>\r\n @if (state.menu.behavior === 'row-menu') {\r\n <p-button clickStopPropagation (onClick)=\"onRowMenuOpen(node, rowMenu, $event)\" [icon]=\"state.menu.rowMenuIcon\" [rounded]=\"true\" [text]=\"true\" [severity]=\"state.menu.rowMenuIconSeverity\"/>\r\n }\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\">\r\n @if (!state.emptyFeedback.isFeatured) {\r\n <div>{{ state.emptyFeedback.message }}</div>\r\n }\r\n </ng-template>\r\n </p-tree>\r\n }\r\n }\r\n} @else {\r\n @if (emptyStateTemplate != null) {\r\n <ng-container *ngTemplateOutlet=\"emptyStateTemplate; context: { $implicit: {} }\"></ng-container>\r\n }\r\n}\r\n\r\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$7.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: ClickStopPropagationDirective, selector: "[clickStopPropagation]" }, { kind: "component", type: SmzDataInfoComponent, selector: "smz-data-info", inputs: ["image", "message", "actions", "callbackInfo", "callbackLabel"], outputs: ["clicked"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i8$2.ContextMenu, selector: "p-contextMenu, p-contextmenu, p-context-menu", inputs: ["model", "triggerEvent", "target", "global", "style", "styleClass", "autoZIndex", "baseZIndex", "id", "breakpoint", "ariaLabel", "ariaLabelledBy", "pressDelay", "appendTo", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: i9$1.Tree, selector: "p-tree", inputs: ["value", "selectionMode", "loadingMode", "selection", "styleClass", "contextMenu", "contextMenuSelectionMode", "contextMenuSelection", "draggableScope", "droppableScope", "draggableNodes", "droppableNodes", "metaKeySelection", "propagateSelectionUp", "propagateSelectionDown", "loading", "loadingIcon", "emptyMessage", "ariaLabel", "togglerAriaLabel", "ariaLabelledBy", "validateDrop", "filter", "filterInputAutoFocus", "filterBy", "filterMode", "filterOptions", "filterPlaceholder", "filteredNodes", "filterLocale", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "indentation", "_templateMap", "trackBy", "highlightOnSelect"], outputs: ["selectionChange", "contextMenuSelectionChange", "onNodeSelect", "onNodeUnselect", "onNodeExpand", "onNodeCollapse", "onNodeContextMenuSelect", "onNodeDoubleClick", "onNodeDrop", "onLazyLoad", "onScroll", "onScrollIndexChange", "onFilter"] }, { kind: "directive", type: i2.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i11$1.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex", "appendTo", "motionOptions"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i26.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i27.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
44985
45085
|
}
|
|
44986
45086
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeComponent, decorators: [{
|
|
44987
45087
|
type: Component,
|
|
44988
|
-
args: [{ selector: 'smz-ui-tree', changeDetection: ChangeDetectionStrategy.Default, providers: [TreeDragDropService], standalone: false, template: "@if (state) {\r\n @if ((state.emptyFeedback?.isFeatured) && (treeItems != null && treeItems.length === 0)) {\r\n <smz-data-info\r\n [image]=\"state.emptyFeedback.image\"\r\n [message]=\"state.emptyFeedback.message\"\r\n [callbackInfo]=\"state.emptyFeedback.extraInfo\"\r\n [callbackLabel]=\"state.emptyFeedback.actionButton?.label\"\r\n (clicked)=\"state.emptyFeedback.actionButton?.callback($event)\">\r\n <ng-template pTemplate=\"actions\">\r\n <ng-container *ngTemplateOutlet=\"emptyActionsTemplate; context: { $implicit: {} }\"></ng-container>\r\n </ng-template>\r\n </smz-data-info>\r\n } @else {\r\n @if (treeItems != null) {\r\n <p-contextMenu #cm [model]=\"menuItems\" [appendTo]=\"appendTo\" [styleClass]=\"menuItems == null || menuItems?.length === 0 ? 'invisible-important' : ''\"></p-contextMenu>\r\n <p-menu #rowMenu [model]=\"menuItems\" [popup]=\"true\" appendTo=\"body\" />\r\n <p-tree #dt [value]=\"treeItems\"\r\n scrollHeight=\"flex\"\r\n [contextMenu]=\"state.menu.behavior === 'context-menu' ? cm : null\"\r\n [selectionMode]=\"state.selection.mode\"\r\n [(selection)]=\"primeSelection\"\r\n layout=\"vertical\"\r\n [style]=\"inlineStyle\"\r\n [styleClass]=\"styleClass\"\r\n [propagateSelectionUp]=\"state.selection.propagateUp\"\r\n [propagateSelectionDown]=\"state.selection.propagateDown\"\r\n [loading]=\"state.loading.isLoading\"\r\n [loadingIcon]=\"state.loading.icon\"\r\n [filter]=\"false\"\r\n [filterMode]=\"state.filter.mode\"\r\n [filterPlaceholder]=\"state.filter.textPlaceholder\"\r\n [draggableNodes]=\"state.dragAndDrop.draggable\"\r\n [droppableNodes]=\"state.dragAndDrop.droppable\"\r\n [validateDrop]=\"state.dragAndDrop.validateDrop\"\r\n (onNodeContextMenuSelect)=\"onContextMenuOpen($event)\"\r\n (onNodeSelect)=\"onSelected($event)\"\r\n (onNodeUnselect)=\"onUnselected($event)\"\r\n (onNodeExpand)=\"onExpanded($event)\"\r\n (onNodeCollapse)=\"onCollapsed($event)\"\r\n (onNodeDrop)=\"onDropped($event)\"\r\n (onFilter)=\"onFiltered($event)\">\r\n @if (state.header.isVisible) {\r\n <ng-template pTemplate=\"header\">\r\n @if (state.header.toolbar; as toolbar) {\r\n @if (headerTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center w-full justify-start\">\r\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"grid grid-nogutter justify-start items-center mb-2 gap-2\">\r\n @if (state.header.title != null) {\r\n <h3 class=\"m-2 col\">{{state.header.title}}</h3>\r\n }\r\n <div class=\"grid grid-nogutter justify-start items-center gap-2\">\r\n @for (button of state.header.toolbar.items; track button; let i = $index) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': button.color === 'secondary', 'p-button-success': button.color === 'success', 'p-button-info': button.color === 'info', 'p-button-warning': button.color === 'warning', 'p-button-help': button.color === 'help', 'p-button-danger': button.color === 'danger' }\"\r\n [label]=\"button.label\"\r\n [icon]=\"button.icon\"\r\n (click)=\"onToolbarButtonClick($event, button, treeItems)\"\r\n [pTooltip]=\"button.tooltip\">\r\n </button>\r\n }\r\n @if (toolbar.nodeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.nodeExpandButtons.expandLabel\"\r\n icon=\"fa-solid fa-angle-down\"\r\n (click)=\"expandNode()\"\r\n [pTooltip]=\"selection != null ? toolbar.nodeExpandButtons.expandTooltip : toolbar.nodeExpandButtons.disabledTooltip\"\r\n [disabled]=\"selection == null\">\r\n </button>\r\n }\r\n @if (toolbar.nodeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.nodeExpandButtons.collapseLabel\"\r\n icon=\"fa-solid fa-angle-up\"\r\n (click)=\"collapseNode()\"\r\n [pTooltip]=\"selection != null ? toolbar.nodeExpandButtons.collapseTooltip : toolbar.nodeExpandButtons.disabledTooltip\"\r\n [disabled]=\"selection == null\">\r\n </button>\r\n }\r\n @if (toolbar.treeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeExpandButtons.expandLabel\"\r\n icon=\"fa-solid fa-angles-down\"\r\n (click)=\"expandAll()\"\r\n [pTooltip]=\"\">\r\n </button>\r\n }\r\n @if (toolbar.treeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeExpandButtons.collapseLabel\"\r\n icon=\"fa-solid fa-angles-up\"\r\n (click)=\"collapseAll()\"\r\n [pTooltip]=\"\">\r\n </button>\r\n }\r\n @if (actionsTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center justify-start\">\r\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (state.filter.show) {\r\n <p-iconfield class=\"col-12\" [ngClass]=\"state.filter.styleClass\">\r\n <p-inputicon styleClass=\"pi pi-search\" />\r\n <input #inputGlobal pInputText type=\"text\" (input)=\"dt._filter(inputGlobal.value)\" [placeholder]=\"state.filter.textPlaceholder\" />\r\n </p-iconfield>\r\n }\r\n </div>\r\n @if (toolbarTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center mt-2\"\r\n [ngClass]=\"'justify-' + state.header.toolbar.alignment\">\r\n <ng-container *ngTemplateOutlet=\"toolbarTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n }\r\n </ng-template>\r\n }\r\n @if (state.footer.isVisible) {\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"grid grid-nogutter justify-start items-center\">\r\n <span class=\"col mr-2\">FOOTER</span>\r\n </div>\r\n </ng-template>\r\n }\r\n @for (content of contentTemplates; track content) {\r\n <ng-template let-node [pTemplate]=\"content.type\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n @if (content.template != null) {\r\n <ng-container *ngTemplateOutlet=\"content.template; context: { $implicit: node }\"></ng-container>\r\n } @else {\r\n <div>{{ node.label }}</div>\r\n }\r\n @if (state.menu.behavior === 'row-menu') {\r\n <p-button clickStopPropagation (onClick)=\"onRowMenuOpen(node, rowMenu, $event)\" [icon]=\"state.menu.rowMenuIcon\" [rounded]=\"true\" [text]=\"true\" [severity]=\"state.menu.rowMenuIconSeverity\"/>\r\n }\r\n </div>\r\n </ng-template>\r\n }\r\n <ng-template let-node pTemplate=\"Check\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <div>{{ node.label }}</div>\r\n @if (state.menu.behavior === 'row-menu') {\r\n <p-button clickStopPropagation (onClick)=\"onRowMenuOpen(node, rowMenu, $event)\" [icon]=\"state.menu.rowMenuIcon\" [rounded]=\"true\" [text]=\"true\" [severity]=\"state.menu.rowMenuIconSeverity\"/>\r\n }\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\">\r\n @if (!state.emptyFeedback.isFeatured) {\r\n <div>{{ state.emptyFeedback.message }}</div>\r\n }\r\n </ng-template>\r\n </p-tree>\r\n }\r\n }\r\n} @else {\r\n @if (emptyStateTemplate != null) {\r\n <ng-container *ngTemplateOutlet=\"emptyStateTemplate; context: { $implicit: {} }\"></ng-container>\r\n }\r\n}\r\n\r\n" }]
|
|
45088
|
+
args: [{ selector: 'smz-ui-tree', changeDetection: ChangeDetectionStrategy.Default, providers: [TreeDragDropService], standalone: false, template: "@if (state) {\r\n @if ((state.emptyFeedback?.isFeatured) && (treeItems != null && treeItems.length === 0)) {\r\n <smz-data-info\r\n [image]=\"state.emptyFeedback.image\"\r\n [message]=\"state.emptyFeedback.message\"\r\n [callbackInfo]=\"state.emptyFeedback.extraInfo\"\r\n [callbackLabel]=\"state.emptyFeedback.actionButton?.label\"\r\n (clicked)=\"state.emptyFeedback.actionButton?.callback($event)\">\r\n <ng-template pTemplate=\"actions\">\r\n <ng-container *ngTemplateOutlet=\"emptyActionsTemplate; context: { $implicit: {} }\"></ng-container>\r\n </ng-template>\r\n </smz-data-info>\r\n } @else {\r\n @if (treeItems != null) {\r\n <p-contextMenu #cm [model]=\"menuItems\" [appendTo]=\"appendTo\" [styleClass]=\"menuItems == null || menuItems?.length === 0 ? 'invisible-important' : ''\"></p-contextMenu>\r\n <p-menu #rowMenu [model]=\"menuItems\" [popup]=\"true\" appendTo=\"body\" />\r\n <p-tree #dt [value]=\"treeItems\"\r\n scrollHeight=\"flex\"\r\n [contextMenu]=\"state.menu.behavior === 'context-menu' ? cm : null\"\r\n [selectionMode]=\"state.selection.mode\"\r\n [(selection)]=\"primeSelection\"\r\n layout=\"vertical\"\r\n [style]=\"inlineStyle\"\r\n [styleClass]=\"styleClass\"\r\n [propagateSelectionUp]=\"state.selection.propagateUp\"\r\n [propagateSelectionDown]=\"state.selection.propagateDown\"\r\n [loading]=\"state.loading.isLoading\"\r\n [loadingIcon]=\"state.loading.icon\"\r\n [filter]=\"false\"\r\n [filterMode]=\"state.filter.mode\"\r\n [filterPlaceholder]=\"state.filter.textPlaceholder\"\r\n [draggableNodes]=\"state.dragAndDrop.draggable\"\r\n [droppableNodes]=\"state.dragAndDrop.droppable\"\r\n [validateDrop]=\"state.dragAndDrop.validateDrop\"\r\n (onNodeContextMenuSelect)=\"onContextMenuOpen($event)\"\r\n (onNodeSelect)=\"onSelected($event)\"\r\n (onNodeUnselect)=\"onUnselected($event)\"\r\n (onNodeExpand)=\"onExpanded($event)\"\r\n (onNodeCollapse)=\"onCollapsed($event)\"\r\n (onNodeDrop)=\"onDropped($event)\"\r\n (onFilter)=\"onFiltered($event)\">\r\n @if (state.header.isVisible) {\r\n <ng-template pTemplate=\"header\">\r\n @if (state.header.toolbar; as toolbar) {\r\n @if (headerTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center w-full justify-start\">\r\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"grid grid-nogutter justify-start items-center mb-2 gap-2\">\r\n @if (state.header.title != null) {\r\n <h3 class=\"m-2 col\">{{state.header.title}}</h3>\r\n }\r\n <div class=\"grid grid-nogutter justify-start items-center gap-2\">\r\n @for (button of state.header.toolbar.items; track button; let i = $index) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': button.color === 'secondary', 'p-button-success': button.color === 'success', 'p-button-info': button.color === 'info', 'p-button-warning': button.color === 'warning', 'p-button-help': button.color === 'help', 'p-button-danger': button.color === 'danger' }\"\r\n [label]=\"button.label\"\r\n [icon]=\"button.icon\"\r\n (click)=\"onToolbarButtonClick($event, button, treeItems)\"\r\n [pTooltip]=\"button.tooltip\">\r\n </button>\r\n }\r\n @if (toolbar.nodeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.nodeExpandButtons.expandLabel\"\r\n icon=\"fa-solid fa-angle-down\"\r\n (click)=\"expandNode()\"\r\n [pTooltip]=\"selection != null ? toolbar.nodeExpandButtons.expandTooltip : toolbar.nodeExpandButtons.disabledTooltip\"\r\n [disabled]=\"selection == null\">\r\n </button>\r\n }\r\n @if (toolbar.nodeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.nodeExpandButtons.collapseLabel\"\r\n icon=\"fa-solid fa-angle-up\"\r\n (click)=\"collapseNode()\"\r\n [pTooltip]=\"selection != null ? toolbar.nodeExpandButtons.collapseTooltip : toolbar.nodeExpandButtons.disabledTooltip\"\r\n [disabled]=\"selection == null\">\r\n </button>\r\n }\r\n @if (toolbar.treeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeExpandButtons.expandLabel\"\r\n icon=\"fa-solid fa-angles-down\"\r\n (click)=\"expandAll()\"\r\n [pTooltip]=\"toolbar.treeExpandButtons.expandLabel != null && toolbar.treeExpandButtons.expandLabel !== '' \r\n ? toolbar.treeExpandButtons.expandLabel \r\n : 'Expandir \u00E1rvore'\">\r\n </button>\r\n }\r\n @if (toolbar.treeExpandButtons.isVisible === true) {\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeExpandButtons.collapseLabel\"\r\n icon=\"fa-solid fa-angles-up\"\r\n (click)=\"collapseAll()\"\r\n [pTooltip]=\"toolbar.treeExpandButtons.collapseLabel != null && toolbar.treeExpandButtons.collapseLabel !== '' \r\n ? toolbar.treeExpandButtons.collapseLabel \r\n : 'Colapsar \u00E1rvore'\">\r\n </button>\r\n }\r\n @if (toolbar.treeSelectionButtons?.isVisible === true) {\r\n\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeSelectionButtons.selectAllLabel\"\r\n icon=\"fa-solid fa-check-double\"\r\n (click)=\"selectAll()\"\r\n [disabled]=\"state.selection?.mode === 'single'\"\r\n [pTooltip]=\"state.selection?.mode === 'single' \r\n ? 'Dispon\u00EDvel apenas em sele\u00E7\u00E3o m\u00FAltipla' \r\n : (toolbar.treeSelectionButtons.selectAllLabel != null && toolbar.treeSelectionButtons.selectAllLabel !== '' ? toolbar.treeSelectionButtons.selectAllLabel : 'Selecionar tudo')\">\r\n </button>\r\n\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n [ngClass]=\"{ 'p-button-text': toolbar.buttonType.endsWith('borderless'), 'p-button-outlined': toolbar.buttonType.endsWith('outlined'), 'p-button-rounded': toolbar.buttonType.startsWith('rounded'), 'p-button-secondary': true }\"\r\n [label]=\"toolbar.treeSelectionButtons.clearSelectionLabel\"\r\n icon=\"fa-solid fa-eraser\"\r\n (click)=\"clearSelection()\"\r\n [disabled]=\"!hasSelection\"\r\n [pTooltip]=\"toolbar.treeSelectionButtons.clearSelectionLabel != null && toolbar.treeSelectionButtons.clearSelectionLabel !== '' \r\n ? toolbar.treeSelectionButtons.clearSelectionLabel \r\n : 'Limpar sele\u00E7\u00E3o'\">\r\n </button>\r\n }\r\n\r\n @if (actionsTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center justify-start\">\r\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (state.filter.show) {\r\n <p-iconfield class=\"col-12\" [ngClass]=\"state.filter.styleClass\">\r\n <p-inputicon styleClass=\"pi pi-search\" />\r\n <input #inputGlobal pInputText type=\"text\" (input)=\"dt._filter(inputGlobal.value)\" [placeholder]=\"state.filter.textPlaceholder\" />\r\n </p-iconfield>\r\n }\r\n </div>\r\n @if (toolbarTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center mt-2\"\r\n [ngClass]=\"'justify-' + state.header.toolbar.alignment\">\r\n <ng-container *ngTemplateOutlet=\"toolbarTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n }\r\n </ng-template>\r\n }\r\n @if (state.footer.isVisible) {\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"grid grid-nogutter justify-start items-center\">\r\n <span class=\"col mr-2\">FOOTER</span>\r\n </div>\r\n </ng-template>\r\n }\r\n @for (content of contentTemplates; track content) {\r\n <ng-template let-node [pTemplate]=\"content.type\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n @if (content.template != null) {\r\n <ng-container *ngTemplateOutlet=\"content.template; context: { $implicit: node }\"></ng-container>\r\n } @else {\r\n <div>{{ node.label }}</div>\r\n }\r\n @if (state.menu.behavior === 'row-menu') {\r\n <p-button clickStopPropagation (onClick)=\"onRowMenuOpen(node, rowMenu, $event)\" [icon]=\"state.menu.rowMenuIcon\" [rounded]=\"true\" [text]=\"true\" [severity]=\"state.menu.rowMenuIconSeverity\"/>\r\n }\r\n </div>\r\n </ng-template>\r\n }\r\n <ng-template let-node pTemplate=\"Check\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <div>{{ node.label }}</div>\r\n @if (state.menu.behavior === 'row-menu') {\r\n <p-button clickStopPropagation (onClick)=\"onRowMenuOpen(node, rowMenu, $event)\" [icon]=\"state.menu.rowMenuIcon\" [rounded]=\"true\" [text]=\"true\" [severity]=\"state.menu.rowMenuIconSeverity\"/>\r\n }\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\">\r\n @if (!state.emptyFeedback.isFeatured) {\r\n <div>{{ state.emptyFeedback.message }}</div>\r\n }\r\n </ng-template>\r\n </p-tree>\r\n }\r\n }\r\n} @else {\r\n @if (emptyStateTemplate != null) {\r\n <ng-container *ngTemplateOutlet=\"emptyStateTemplate; context: { $implicit: {} }\"></ng-container>\r\n }\r\n}\r\n\r\n" }]
|
|
44989
45089
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: TreeHelperService }], propDecorators: { dt: [{
|
|
44990
45090
|
type: ViewChild,
|
|
44991
45091
|
args: [Tree]
|