@ngx-smz/ui-kit 21.9.0-next.4 → 21.9.0-next.6
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/fesm2022/ngx-smz-ui-kit.mjs +463 -234
- package/fesm2022/ngx-smz-ui-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngx-smz-ui-kit.d.ts +88 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, input, booleanAttribute, computed, Directive, inject, TemplateRef, HostAttributeToken, ChangeDetectionStrategy, Component, ElementRef, output, forwardRef, Injector, DestroyRef, afterNextRender, Renderer2, effect, InjectionToken, viewChild, ViewContainerRef, Injectable, model, contentChildren, contentChild
|
|
2
|
+
import { signal, input, booleanAttribute, computed, Directive, inject, TemplateRef, HostAttributeToken, ChangeDetectionStrategy, Component, ElementRef, afterEveryRender, output, forwardRef, Injector, DestroyRef, afterNextRender, Renderer2, effect, InjectionToken, viewChild, ViewContainerRef, Injectable, model, contentChildren, contentChild } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
@@ -295,6 +295,9 @@ const buttonClasses = smzVariants({
|
|
|
295
295
|
},
|
|
296
296
|
defaults: { size: 'md', variant: 'solid', severity: 'primary', rounded: 'false', loading: 'false', iconOnly: 'false' },
|
|
297
297
|
compound: [
|
|
298
|
+
{ when: { iconOnly: 'true', size: 'sm' }, class: 'w-[var(--smz-control-h-sm)]' },
|
|
299
|
+
{ when: { iconOnly: 'true', size: 'md' }, class: 'w-[var(--smz-control-h)]' },
|
|
300
|
+
{ when: { iconOnly: 'true', size: 'lg' }, class: 'w-[var(--smz-control-h-lg)]' },
|
|
298
301
|
{ when: { variant: 'solid', severity: 'primary' }, class: 'bg-ui-primary text-ui-on-primary hover:bg-ui-primary-hover active:bg-ui-primary-active' },
|
|
299
302
|
{ when: { variant: 'solid', severity: 'secondary' }, class: 'bg-ui-surface-3 text-ui-fg hover:bg-ui-line active:bg-ui-line-strong' },
|
|
300
303
|
{ when: { variant: 'solid', severity: 'danger' }, class: 'bg-ui-danger text-ui-on-danger hover:bg-ui-danger-hover active:bg-ui-danger-active' },
|
|
@@ -644,18 +647,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
644
647
|
/** Area de texto. Substitui o `pTextarea` / `pInputTextarea` do PrimeNG. */
|
|
645
648
|
class SmzTextareaDirective {
|
|
646
649
|
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : {}), transform: booleanAttribute });
|
|
650
|
+
/** Cresce com o conteudo (equivale ao `autoResize` do `pTextarea`). */
|
|
651
|
+
autoResize = input(false, { ...(ngDevMode ? { debugName: "autoResize" } : {}), transform: booleanAttribute });
|
|
652
|
+
el = inject(ElementRef);
|
|
653
|
+
constructor() {
|
|
654
|
+
afterEveryRender(() => this.resize());
|
|
655
|
+
}
|
|
656
|
+
resize() {
|
|
657
|
+
if (!this.autoResize())
|
|
658
|
+
return;
|
|
659
|
+
const textarea = this.el.nativeElement;
|
|
660
|
+
textarea.style.overflow = 'hidden';
|
|
661
|
+
textarea.style.height = 'auto';
|
|
662
|
+
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
663
|
+
}
|
|
647
664
|
staticClass = smzStaticHostClass();
|
|
648
665
|
classes = computed(() => smzMergeClasses(textareaClasses({ invalid: String(this.invalid()) }), this.staticClass), ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
649
666
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTextareaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
650
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: SmzTextareaDirective, isStandalone: true, selector: "textarea[smzTextarea]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.aria-invalid": "invalid() || null" } }, ngImport: i0 });
|
|
667
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: SmzTextareaDirective, isStandalone: true, selector: "textarea[smzTextarea]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "resize()" }, properties: { "class": "classes()", "attr.aria-invalid": "invalid() || null" } }, ngImport: i0 });
|
|
651
668
|
}
|
|
652
669
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTextareaDirective, decorators: [{
|
|
653
670
|
type: Directive,
|
|
654
671
|
args: [{
|
|
655
672
|
selector: 'textarea[smzTextarea]',
|
|
656
|
-
host: { '[class]': 'classes()', '[attr.aria-invalid]': 'invalid() || null' },
|
|
673
|
+
host: { '[class]': 'classes()', '[attr.aria-invalid]': 'invalid() || null', '(input)': 'resize()' },
|
|
657
674
|
}]
|
|
658
|
-
}], propDecorators: { invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }] } });
|
|
675
|
+
}], ctorParameters: () => [], propDecorators: { invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }] } });
|
|
659
676
|
|
|
660
677
|
/**
|
|
661
678
|
* Checkbox do ui-kit. Substitui o `p-checkbox` do PrimeNG.
|
|
@@ -665,6 +682,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
665
682
|
*/
|
|
666
683
|
class SmzCheckboxComponent extends SmzValueAccessor {
|
|
667
684
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
685
|
+
inputId = input('', ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
668
686
|
/** Valor deste item quando o modelo e um array (modo grupo). */
|
|
669
687
|
value = input(undefined, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
670
688
|
/** Forca o modo booleano mesmo com `value` informado. Mantido por compatibilidade com o Prime. */
|
|
@@ -691,7 +709,7 @@ class SmzCheckboxComponent extends SmzValueAccessor {
|
|
|
691
709
|
this.changed.emit({ checked: this.checked(), value: this.current() });
|
|
692
710
|
}
|
|
693
711
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
694
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzCheckboxComponent, isStandalone: true, selector: "ui-checkbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, binary: { classPropertyName: "binary", publicName: "binary", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "inline-flex" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzCheckboxComponent), multi: true }], usesInheritance: true, ngImport: i0, template: `
|
|
712
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzCheckboxComponent, isStandalone: true, selector: "ui-checkbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, binary: { classPropertyName: "binary", publicName: "binary", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "inline-flex" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzCheckboxComponent), multi: true }], usesInheritance: true, ngImport: i0, template: `
|
|
695
713
|
<label
|
|
696
714
|
class="inline-flex items-center gap-2 font-ui text-ui-md text-ui-fg"
|
|
697
715
|
[class]="isDisabled() ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'"
|
|
@@ -699,6 +717,7 @@ class SmzCheckboxComponent extends SmzValueAccessor {
|
|
|
699
717
|
<input
|
|
700
718
|
type="checkbox"
|
|
701
719
|
class="peer sr-only"
|
|
720
|
+
[attr.id]="inputId() || null"
|
|
702
721
|
[name]="name()"
|
|
703
722
|
[checked]="checked()"
|
|
704
723
|
[disabled]="isDisabled()"
|
|
@@ -737,6 +756,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
737
756
|
<input
|
|
738
757
|
type="checkbox"
|
|
739
758
|
class="peer sr-only"
|
|
759
|
+
[attr.id]="inputId() || null"
|
|
740
760
|
[name]="name()"
|
|
741
761
|
[checked]="checked()"
|
|
742
762
|
[disabled]="isDisabled()"
|
|
@@ -760,7 +780,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
760
780
|
</label>
|
|
761
781
|
`,
|
|
762
782
|
}]
|
|
763
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], binary: [{ type: i0.Input, args: [{ isSignal: true, alias: "binary", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
783
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], binary: [{ type: i0.Input, args: [{ isSignal: true, alias: "binary", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
764
784
|
|
|
765
785
|
/**
|
|
766
786
|
* Radio do ui-kit. Substitui o `p-radiobutton` do PrimeNG.
|
|
@@ -1857,6 +1877,15 @@ class SmzDialogComponent {
|
|
|
1857
1877
|
style = input(null, ...(ngDevMode ? [{ debugName: "style" }] : []));
|
|
1858
1878
|
styleClass = input('', ...(ngDevMode ? [{ debugName: "styleClass" }] : []));
|
|
1859
1879
|
baseZIndex = input(0, ...(ngDevMode ? [{ debugName: "baseZIndex" }] : []));
|
|
1880
|
+
/** Permite arrastar pelo cabecalho. */
|
|
1881
|
+
draggable = input(false, { ...(ngDevMode ? { debugName: "draggable" } : {}), transform: booleanAttribute });
|
|
1882
|
+
/** Mostra a alca nativa de redimensionar no canto inferior direito. */
|
|
1883
|
+
resizable = input(false, { ...(ngDevMode ? { debugName: "resizable" } : {}), transform: booleanAttribute });
|
|
1884
|
+
/** Mostra o botao de maximizar no cabecalho padrao (com `smzTemplate="header"` use `maximize()`). */
|
|
1885
|
+
maximizable = input(false, { ...(ngDevMode ? { debugName: "maximizable" } : {}), transform: booleanAttribute });
|
|
1886
|
+
maximized = model(false, ...(ngDevMode ? [{ debugName: "maximized" }] : []));
|
|
1887
|
+
/** Posicao na tela (como o `position` do `p-dialog`). */
|
|
1888
|
+
position = input('center', ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
1860
1889
|
shown = output();
|
|
1861
1890
|
hidden = output();
|
|
1862
1891
|
panel = viewChild.required('panel');
|
|
@@ -1867,6 +1896,8 @@ class SmzDialogComponent {
|
|
|
1867
1896
|
viewContainer = inject(ViewContainerRef);
|
|
1868
1897
|
host = inject(ElementRef);
|
|
1869
1898
|
overlayRef;
|
|
1899
|
+
dx = signal(0, ...(ngDevMode ? [{ debugName: "dx" }] : []));
|
|
1900
|
+
dy = signal(0, ...(ngDevMode ? [{ debugName: "dy" }] : []));
|
|
1870
1901
|
constructor() {
|
|
1871
1902
|
effect(() => {
|
|
1872
1903
|
if (this.visible())
|
|
@@ -1874,6 +1905,51 @@ class SmzDialogComponent {
|
|
|
1874
1905
|
else
|
|
1875
1906
|
this.dispose();
|
|
1876
1907
|
});
|
|
1908
|
+
effect(() => {
|
|
1909
|
+
const position = this.position();
|
|
1910
|
+
this.overlayRef?.updatePositionStrategy(this.strategyFor(position));
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1913
|
+
/** Alterna entre maximizado e normal. */
|
|
1914
|
+
maximize() {
|
|
1915
|
+
this.maximized.update((value) => !value);
|
|
1916
|
+
this.dx.set(0);
|
|
1917
|
+
this.dy.set(0);
|
|
1918
|
+
}
|
|
1919
|
+
startDrag(event) {
|
|
1920
|
+
if (!this.draggable() || this.maximized() || event.target.closest('button'))
|
|
1921
|
+
return;
|
|
1922
|
+
event.preventDefault();
|
|
1923
|
+
const startX = event.clientX - this.dx();
|
|
1924
|
+
const startY = event.clientY - this.dy();
|
|
1925
|
+
const move = (e) => {
|
|
1926
|
+
this.dx.set(e.clientX - startX);
|
|
1927
|
+
this.dy.set(e.clientY - startY);
|
|
1928
|
+
};
|
|
1929
|
+
const up = () => {
|
|
1930
|
+
document.removeEventListener('pointermove', move);
|
|
1931
|
+
document.removeEventListener('pointerup', up);
|
|
1932
|
+
};
|
|
1933
|
+
document.addEventListener('pointermove', move);
|
|
1934
|
+
document.addEventListener('pointerup', up);
|
|
1935
|
+
}
|
|
1936
|
+
strategyFor(position) {
|
|
1937
|
+
const strategy = this.overlay.position().global();
|
|
1938
|
+
const horizontal = position.includes('left') ? 'left' : position.includes('right') ? 'right' : 'center';
|
|
1939
|
+
const vertical = position.startsWith('top') ? 'top' : position.startsWith('bottom') ? 'bottom' : position === 'left' || position === 'right' || position === 'center' ? 'center' : 'center';
|
|
1940
|
+
if (horizontal === 'left')
|
|
1941
|
+
strategy.left('0');
|
|
1942
|
+
else if (horizontal === 'right')
|
|
1943
|
+
strategy.right('0');
|
|
1944
|
+
else
|
|
1945
|
+
strategy.centerHorizontally();
|
|
1946
|
+
if (vertical === 'top')
|
|
1947
|
+
strategy.top('0');
|
|
1948
|
+
else if (vertical === 'bottom')
|
|
1949
|
+
strategy.bottom('0');
|
|
1950
|
+
else
|
|
1951
|
+
strategy.centerVertically();
|
|
1952
|
+
return strategy;
|
|
1877
1953
|
}
|
|
1878
1954
|
close() {
|
|
1879
1955
|
this.visible.set(false);
|
|
@@ -1887,7 +1963,7 @@ class SmzDialogComponent {
|
|
|
1887
1963
|
const modal = this.modal();
|
|
1888
1964
|
this.overlayRef = this.overlay.create({
|
|
1889
1965
|
hasBackdrop: modal,
|
|
1890
|
-
positionStrategy: this.
|
|
1966
|
+
positionStrategy: this.strategyFor(this.position()),
|
|
1891
1967
|
scrollStrategy: this.overlay.scrollStrategies.block(),
|
|
1892
1968
|
});
|
|
1893
1969
|
SmzZIndex.set('modal', this.overlayRef.hostElement, 1100 + this.baseZIndex());
|
|
@@ -1919,24 +1995,33 @@ class SmzDialogComponent {
|
|
|
1919
1995
|
this.overlayRef?.overlayElement.querySelector('[role="dialog"]')?.setAttribute('data-testid', testId);
|
|
1920
1996
|
}
|
|
1921
1997
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1922
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzDialogComponent, isStandalone: true, selector: "ui-dialog", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, dismissableMask: { classPropertyName: "dismissableMask", publicName: "dismissableMask", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, baseZIndex: { classPropertyName: "baseZIndex", publicName: "baseZIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", shown: "shown", hidden: "hidden" }, queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1998
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzDialogComponent, isStandalone: true, selector: "ui-dialog", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, dismissableMask: { classPropertyName: "dismissableMask", publicName: "dismissableMask", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, baseZIndex: { classPropertyName: "baseZIndex", publicName: "baseZIndex", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, maximizable: { classPropertyName: "maximizable", publicName: "maximizable", isSignal: true, isRequired: false, transformFunction: null }, maximized: { classPropertyName: "maximized", publicName: "maximized", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", maximized: "maximizedChange", shown: "shown", hidden: "hidden" }, queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1923
1999
|
<ng-template #panel>
|
|
1924
2000
|
<div
|
|
1925
2001
|
role="dialog"
|
|
1926
2002
|
aria-modal="true"
|
|
1927
2003
|
[attr.aria-label]="header() || null"
|
|
1928
|
-
class="pointer-events-auto flex
|
|
1929
|
-
[class]="styleClass() ?? ''"
|
|
1930
|
-
[ngStyle]="style()"
|
|
2004
|
+
class="pointer-events-auto flex flex-col border border-ui-line bg-ui-surface-2 font-ui text-ui-fg shadow-overlay"
|
|
2005
|
+
[class]="(maximized() ? 'h-screen w-screen max-h-none max-w-none rounded-none ' : 'max-h-[90vh] max-w-[95vw] rounded-overlay ') + (resizable() && !maximized() ? 'resize overflow-auto ' : '') + (styleClass() ?? '')"
|
|
2006
|
+
[ngStyle]="maximized() ? null : style()"
|
|
2007
|
+
[style.transform]="maximized() || (dx() === 0 && dy() === 0) ? null : 'translate(' + dx() + 'px, ' + dy() + 'px)'"
|
|
1931
2008
|
>
|
|
1932
2009
|
@if (headerTemplate(); as headerTpl) {
|
|
1933
|
-
<div class="border-b border-ui-line px-4 py-3">
|
|
2010
|
+
<div class="border-b border-ui-line px-4 py-3" [class.cursor-move]="draggable() && !maximized()" (pointerdown)="startDrag($event)">
|
|
1934
2011
|
<ng-container [ngTemplateOutlet]="headerTpl" />
|
|
1935
2012
|
</div>
|
|
1936
2013
|
}
|
|
1937
2014
|
@else if (header() || closable()) {
|
|
1938
|
-
<div class="flex items-center justify-between gap-4 border-b border-ui-line px-4 py-3">
|
|
2015
|
+
<div class="flex items-center justify-between gap-4 border-b border-ui-line px-4 py-3" [class.cursor-move]="draggable() && !maximized()" (pointerdown)="startDrag($event)">
|
|
1939
2016
|
<span class="text-ui-lg font-medium">{{ header() }}</span>
|
|
2017
|
+
<div class="flex items-center gap-1">
|
|
2018
|
+
@if (maximizable()) {
|
|
2019
|
+
<button type="button" class="inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-ui-fg-muted transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [attr.aria-label]="maximized() ? 'Restaurar' : 'Maximizar'" (click)="maximize()">
|
|
2020
|
+
<svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true">
|
|
2021
|
+
@if (maximized()) { <path d="M5 3h8v8M3 5h8v8H3z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" /> } @else { <rect x="3" y="3" width="10" height="10" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" /> }
|
|
2022
|
+
</svg>
|
|
2023
|
+
</button>
|
|
2024
|
+
}
|
|
1940
2025
|
@if (closable()) {
|
|
1941
2026
|
<button
|
|
1942
2027
|
type="button"
|
|
@@ -1949,6 +2034,7 @@ class SmzDialogComponent {
|
|
|
1949
2034
|
</svg>
|
|
1950
2035
|
</button>
|
|
1951
2036
|
}
|
|
2037
|
+
</div>
|
|
1952
2038
|
</div>
|
|
1953
2039
|
}
|
|
1954
2040
|
<div class="min-h-0 flex-1 overflow-auto p-4"><ng-content /></div>
|
|
@@ -1973,18 +2059,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
1973
2059
|
role="dialog"
|
|
1974
2060
|
aria-modal="true"
|
|
1975
2061
|
[attr.aria-label]="header() || null"
|
|
1976
|
-
class="pointer-events-auto flex
|
|
1977
|
-
[class]="styleClass() ?? ''"
|
|
1978
|
-
[ngStyle]="style()"
|
|
2062
|
+
class="pointer-events-auto flex flex-col border border-ui-line bg-ui-surface-2 font-ui text-ui-fg shadow-overlay"
|
|
2063
|
+
[class]="(maximized() ? 'h-screen w-screen max-h-none max-w-none rounded-none ' : 'max-h-[90vh] max-w-[95vw] rounded-overlay ') + (resizable() && !maximized() ? 'resize overflow-auto ' : '') + (styleClass() ?? '')"
|
|
2064
|
+
[ngStyle]="maximized() ? null : style()"
|
|
2065
|
+
[style.transform]="maximized() || (dx() === 0 && dy() === 0) ? null : 'translate(' + dx() + 'px, ' + dy() + 'px)'"
|
|
1979
2066
|
>
|
|
1980
2067
|
@if (headerTemplate(); as headerTpl) {
|
|
1981
|
-
<div class="border-b border-ui-line px-4 py-3">
|
|
2068
|
+
<div class="border-b border-ui-line px-4 py-3" [class.cursor-move]="draggable() && !maximized()" (pointerdown)="startDrag($event)">
|
|
1982
2069
|
<ng-container [ngTemplateOutlet]="headerTpl" />
|
|
1983
2070
|
</div>
|
|
1984
2071
|
}
|
|
1985
2072
|
@else if (header() || closable()) {
|
|
1986
|
-
<div class="flex items-center justify-between gap-4 border-b border-ui-line px-4 py-3">
|
|
2073
|
+
<div class="flex items-center justify-between gap-4 border-b border-ui-line px-4 py-3" [class.cursor-move]="draggable() && !maximized()" (pointerdown)="startDrag($event)">
|
|
1987
2074
|
<span class="text-ui-lg font-medium">{{ header() }}</span>
|
|
2075
|
+
<div class="flex items-center gap-1">
|
|
2076
|
+
@if (maximizable()) {
|
|
2077
|
+
<button type="button" class="inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-ui-fg-muted transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [attr.aria-label]="maximized() ? 'Restaurar' : 'Maximizar'" (click)="maximize()">
|
|
2078
|
+
<svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true">
|
|
2079
|
+
@if (maximized()) { <path d="M5 3h8v8M3 5h8v8H3z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" /> } @else { <rect x="3" y="3" width="10" height="10" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" /> }
|
|
2080
|
+
</svg>
|
|
2081
|
+
</button>
|
|
2082
|
+
}
|
|
1988
2083
|
@if (closable()) {
|
|
1989
2084
|
<button
|
|
1990
2085
|
type="button"
|
|
@@ -1997,6 +2092,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
1997
2092
|
</svg>
|
|
1998
2093
|
</button>
|
|
1999
2094
|
}
|
|
2095
|
+
</div>
|
|
2000
2096
|
</div>
|
|
2001
2097
|
}
|
|
2002
2098
|
<div class="min-h-0 flex-1 overflow-auto p-4"><ng-content /></div>
|
|
@@ -2009,7 +2105,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
2009
2105
|
</ng-template>
|
|
2010
2106
|
`,
|
|
2011
2107
|
}]
|
|
2012
|
-
}], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], dismissableMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissableMask", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], baseZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseZIndex", required: false }] }], shown: [{ type: i0.Output, args: ["shown"] }], hidden: [{ type: i0.Output, args: ["hidden"] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzTemplateDirective), { isSignal: true }] }] } });
|
|
2108
|
+
}], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], dismissableMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissableMask", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], baseZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseZIndex", required: false }] }], draggable: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggable", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], maximizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximizable", required: false }] }], maximized: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximized", required: false }] }, { type: i0.Output, args: ["maximizedChange"] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], shown: [{ type: i0.Output, args: ["shown"] }], hidden: [{ type: i0.Output, args: ["hidden"] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzTemplateDirective), { isSignal: true }] }] } });
|
|
2013
2109
|
|
|
2014
2110
|
const POSITIONS$2 = [
|
|
2015
2111
|
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 8 },
|
|
@@ -2973,12 +3069,28 @@ class SmzAnchoredPanel {
|
|
|
2973
3069
|
}
|
|
2974
3070
|
|
|
2975
3071
|
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return, @typescript-eslint/explicit-module-boundary-types */
|
|
3072
|
+
/**
|
|
3073
|
+
* Texto da opcao. Sem `optionLabel`, opcoes-objeto com `label` usam esse campo (como o `p-select` do PrimeNG);
|
|
3074
|
+
* primitivos sao usados como estao.
|
|
3075
|
+
*/
|
|
2976
3076
|
function optionLabel(option, config) {
|
|
2977
|
-
|
|
3077
|
+
let value = option;
|
|
3078
|
+
if (config.optionLabel)
|
|
3079
|
+
value = SmzObjectUtils.resolveFieldData(option, config.optionLabel);
|
|
3080
|
+
else if (option !== null && typeof option === 'object' && option.label !== undefined)
|
|
3081
|
+
value = option.label;
|
|
2978
3082
|
return value === null || value === undefined ? '' : String(value);
|
|
2979
3083
|
}
|
|
3084
|
+
/**
|
|
3085
|
+
* Valor da opcao. Sem `optionValue` (e sem `optionLabel`), opcoes-objeto com `value` usam esse campo
|
|
3086
|
+
* (como o `p-select` do PrimeNG); caso contrario o proprio objeto e o valor.
|
|
3087
|
+
*/
|
|
2980
3088
|
function optionValue(option, config) {
|
|
2981
|
-
|
|
3089
|
+
if (config.optionValue)
|
|
3090
|
+
return SmzObjectUtils.resolveFieldData(option, config.optionValue);
|
|
3091
|
+
if (!config.optionLabel && option !== null && typeof option === 'object' && option.value !== undefined)
|
|
3092
|
+
return option.value;
|
|
3093
|
+
return option;
|
|
2982
3094
|
}
|
|
2983
3095
|
function optionDisabled(option, config) {
|
|
2984
3096
|
return config.optionDisabled ? !!SmzObjectUtils.resolveFieldData(option, config.optionDisabled) : false;
|
|
@@ -3811,9 +3923,11 @@ class SmzSelectButtonComponent extends SmzValueAccessor {
|
|
|
3811
3923
|
/** Aceito por compatibilidade com o `p-selectbutton`; sem efeito. */
|
|
3812
3924
|
appendTo = input(undefined, ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
3813
3925
|
changed = output();
|
|
3926
|
+
/** Sem `optionLabel`/`optionValue`, opcoes-objeto com `label`/`value` sao lidas automaticamente (como no PrimeNG). */
|
|
3927
|
+
sample = computed(() => (this.options() ?? [])[0], ...(ngDevMode ? [{ debugName: "sample" }] : []));
|
|
3814
3928
|
config = computed(() => ({
|
|
3815
|
-
optionLabel: this.optionLabel(),
|
|
3816
|
-
optionValue: this.optionValue(),
|
|
3929
|
+
optionLabel: this.optionLabel() ?? (typeof this.sample() === 'object' && this.sample() !== null && 'label' in this.sample() ? 'label' : null),
|
|
3930
|
+
optionValue: this.optionValue() ?? (typeof this.sample() === 'object' && this.sample() !== null && 'value' in this.sample() ? 'value' : null),
|
|
3817
3931
|
optionDisabled: this.optionDisabled(),
|
|
3818
3932
|
dataKey: this.dataKey(),
|
|
3819
3933
|
}), ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
@@ -3834,8 +3948,8 @@ class SmzSelectButtonComponent extends SmzValueAccessor {
|
|
|
3834
3948
|
: sameValue(value, current, this.dataKey());
|
|
3835
3949
|
}
|
|
3836
3950
|
buttonClasses(option) {
|
|
3837
|
-
const size = this.size() === 'small' ? 'h-control-sm text-ui-sm' : this.size() === 'large' ? 'h-control-lg text-ui-lg' : 'h-control';
|
|
3838
|
-
const tone = this.isSelected(option) ? 'bg-ui-
|
|
3951
|
+
const size = this.size() === 'small' ? 'h-[calc(var(--smz-control-h-sm)-0.5rem)] text-ui-sm' : this.size() === 'large' ? 'h-[calc(var(--smz-control-h-lg)-0.5rem)] text-ui-lg' : 'h-[calc(var(--smz-control-h)-0.5rem)]';
|
|
3952
|
+
const tone = this.isSelected(option) ? 'bg-ui-surface-1 text-ui-fg shadow-card' : 'text-ui-fg-muted hover:text-ui-fg';
|
|
3839
3953
|
return `${size} ${tone}`;
|
|
3840
3954
|
}
|
|
3841
3955
|
toggle(option, event) {
|
|
@@ -3858,11 +3972,11 @@ class SmzSelectButtonComponent extends SmzValueAccessor {
|
|
|
3858
3972
|
}
|
|
3859
3973
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzSelectButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3860
3974
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzSelectButtonComponent, isStandalone: true, selector: "ui-select-button", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, allowEmpty: { classPropertyName: "allowEmpty", publicName: "allowEmpty", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "inline-flex" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzSelectButtonComponent), multi: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3861
|
-
<div role="group" class="inline-flex
|
|
3975
|
+
<div role="group" class="inline-flex gap-1 rounded-control bg-ui-surface-3 p-1" [ngClass]="styleClass()">
|
|
3862
3976
|
@for (option of options(); track $index) {
|
|
3863
3977
|
<button
|
|
3864
3978
|
type="button"
|
|
3865
|
-
class="inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap
|
|
3979
|
+
class="inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-control px-control-x font-ui text-ui-md font-medium transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
3866
3980
|
[class]="buttonClasses(option)"
|
|
3867
3981
|
[attr.aria-pressed]="isSelected(option)"
|
|
3868
3982
|
[disabled]="isDisabled() || isOptionDisabled(option)"
|
|
@@ -3887,11 +4001,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3887
4001
|
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzSelectButtonComponent), multi: true }],
|
|
3888
4002
|
host: { class: 'inline-flex' },
|
|
3889
4003
|
template: `
|
|
3890
|
-
<div role="group" class="inline-flex
|
|
4004
|
+
<div role="group" class="inline-flex gap-1 rounded-control bg-ui-surface-3 p-1" [ngClass]="styleClass()">
|
|
3891
4005
|
@for (option of options(); track $index) {
|
|
3892
4006
|
<button
|
|
3893
4007
|
type="button"
|
|
3894
|
-
class="inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap
|
|
4008
|
+
class="inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-control px-control-x font-ui text-ui-md font-medium transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
3895
4009
|
[class]="buttonClasses(option)"
|
|
3896
4010
|
[attr.aria-pressed]="isSelected(option)"
|
|
3897
4011
|
[disabled]="isDisabled() || isOptionDisabled(option)"
|
|
@@ -4810,10 +4924,15 @@ class SmzDatePickerComponent extends SmzValueAccessor {
|
|
|
4810
4924
|
fieldRef = viewChild.required('field');
|
|
4811
4925
|
panel = viewChild.required('panel');
|
|
4812
4926
|
anchored = new SmzAnchoredPanel(this.overlay, this.viewContainer);
|
|
4927
|
+
/**
|
|
4928
|
+
* Aceita `Date`, string (ISO ou parseavel) e numero (timestamp), como o `p-datepicker`.
|
|
4929
|
+
* Valores invalidos viram `null` em vez de lancar. O modelo do formulario so muda quando o usuario escolhe uma data.
|
|
4930
|
+
*/
|
|
4813
4931
|
writeValue(value) {
|
|
4814
|
-
|
|
4932
|
+
const coerced = coerceDateValue(value);
|
|
4933
|
+
super.writeValue(coerced);
|
|
4815
4934
|
this.typed.set(null);
|
|
4816
|
-
this.syncViewTo(
|
|
4935
|
+
this.syncViewTo(coerced);
|
|
4817
4936
|
}
|
|
4818
4937
|
ngOnDestroy() {
|
|
4819
4938
|
this.anchored.close();
|
|
@@ -5355,6 +5474,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5355
5474
|
`,
|
|
5356
5475
|
}]
|
|
5357
5476
|
}], propDecorators: { selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFormat", required: false }] }], showTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTime", required: false }] }], timeOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeOnly", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], showButtonBar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtonBar", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], showOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOnFocus", required: false }] }], keepInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepInvalid", required: false }] }], readonlyInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonlyInput", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], touchUI: [{ type: i0.Input, args: [{ isSignal: true, alias: "touchUI", required: false }] }], focusTrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusTrap", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], cleared: [{ type: i0.Output, args: ["cleared"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], blurred: [{ type: i0.Output, args: ["blurred"] }], anchorRef: [{ type: i0.ViewChild, args: ['anchor', { isSignal: true }] }], fieldRef: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
5477
|
+
function toDate(value) {
|
|
5478
|
+
if (value instanceof Date)
|
|
5479
|
+
return Number.isNaN(value.getTime()) ? null : value;
|
|
5480
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
5481
|
+
if (value === '')
|
|
5482
|
+
return null;
|
|
5483
|
+
const date = new Date(value);
|
|
5484
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
5485
|
+
}
|
|
5486
|
+
return null;
|
|
5487
|
+
}
|
|
5488
|
+
function coerceDateValue(value) {
|
|
5489
|
+
if (Array.isArray(value)) {
|
|
5490
|
+
const dates = value.map(toDate).filter((date) => date !== null);
|
|
5491
|
+
return dates.length > 0 ? dates : null;
|
|
5492
|
+
}
|
|
5493
|
+
return toDate(value);
|
|
5494
|
+
}
|
|
5358
5495
|
|
|
5359
5496
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-unsafe-return, max-len */
|
|
5360
5497
|
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
@@ -5677,6 +5814,8 @@ class SmzInputMaskComponent extends SmzValueAccessor {
|
|
|
5677
5814
|
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
5678
5815
|
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : {}), transform: booleanAttribute });
|
|
5679
5816
|
inputId = input('', ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
5817
|
+
/** Tipo do `<input>` nativo (`text`, `tel`, `password`...). */
|
|
5818
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
5680
5819
|
inputed = output();
|
|
5681
5820
|
blurred = output();
|
|
5682
5821
|
completed = output();
|
|
@@ -5825,10 +5964,10 @@ class SmzInputMaskComponent extends SmzValueAccessor {
|
|
|
5825
5964
|
this.field().nativeElement.setSelectionRange(position, position);
|
|
5826
5965
|
}
|
|
5827
5966
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzInputMaskComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5828
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.1", type: SmzInputMaskComponent, isStandalone: true, selector: "ui-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, slotChar: { classPropertyName: "slotChar", publicName: "slotChar", isSignal: true, isRequired: false, transformFunction: null }, characterPattern: { classPropertyName: "characterPattern", publicName: "characterPattern", isSignal: true, isRequired: false, transformFunction: null }, unmask: { classPropertyName: "unmask", publicName: "unmask", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputed: "inputed", blurred: "blurred", completed: "completed" }, host: { classAttribute: "flex min-w-0" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzInputMaskComponent), multi: true }], viewQueries: [{ propertyName: "field", first: true, predicate: ["field"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
5967
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.1", type: SmzInputMaskComponent, isStandalone: true, selector: "ui-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, slotChar: { classPropertyName: "slotChar", publicName: "slotChar", isSignal: true, isRequired: false, transformFunction: null }, characterPattern: { classPropertyName: "characterPattern", publicName: "characterPattern", isSignal: true, isRequired: false, transformFunction: null }, unmask: { classPropertyName: "unmask", publicName: "unmask", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputed: "inputed", blurred: "blurred", completed: "completed" }, host: { classAttribute: "flex min-w-0" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzInputMaskComponent), multi: true }], viewQueries: [{ propertyName: "field", first: true, predicate: ["field"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
5829
5968
|
<input
|
|
5830
5969
|
#field
|
|
5831
|
-
type="
|
|
5970
|
+
[attr.type]="type()"
|
|
5832
5971
|
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-control-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:ring-2 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5833
5972
|
[attr.id]="inputId() || null"
|
|
5834
5973
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -5853,7 +5992,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5853
5992
|
template: `
|
|
5854
5993
|
<input
|
|
5855
5994
|
#field
|
|
5856
|
-
type="
|
|
5995
|
+
[attr.type]="type()"
|
|
5857
5996
|
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-control-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:ring-2 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5858
5997
|
[attr.id]="inputId() || null"
|
|
5859
5998
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -5868,7 +6007,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5868
6007
|
/>
|
|
5869
6008
|
`,
|
|
5870
6009
|
}]
|
|
5871
|
-
}], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], slotChar: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotChar", required: false }] }], characterPattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "characterPattern", required: false }] }], unmask: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmask", required: false }] }], autoClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClear", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], inputed: [{ type: i0.Output, args: ["inputed"] }], blurred: [{ type: i0.Output, args: ["blurred"] }], completed: [{ type: i0.Output, args: ["completed"] }], field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }] } });
|
|
6010
|
+
}], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], slotChar: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotChar", required: false }] }], characterPattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "characterPattern", required: false }] }], unmask: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmask", required: false }] }], autoClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClear", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], inputed: [{ type: i0.Output, args: ["inputed"] }], blurred: [{ type: i0.Output, args: ["blurred"] }], completed: [{ type: i0.Output, args: ["completed"] }], field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }] } });
|
|
5872
6011
|
|
|
5873
6012
|
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
5874
6013
|
const DEFAULT_MEDIUM = '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})';
|
|
@@ -6028,15 +6167,19 @@ class SmzColorPickerComponent extends SmzValueAccessor {
|
|
|
6028
6167
|
inputId = input('', ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
6029
6168
|
/** Aceito por compatibilidade com o `p-colorpicker`; sem efeito. */
|
|
6030
6169
|
appendTo = input(undefined, ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
6170
|
+
/** Emitido quando o usuario escolhe uma cor (equivale ao `onChange` do `p-colorpicker`). */
|
|
6171
|
+
changed = output();
|
|
6031
6172
|
hex = computed(() => {
|
|
6032
6173
|
const raw = (this.current() ?? '').replace('#', '');
|
|
6033
6174
|
return /^[0-9a-fA-F]{6}$/.test(raw) ? `#${raw.toLowerCase()}` : '#000000';
|
|
6034
6175
|
}, ...(ngDevMode ? [{ debugName: "hex" }] : []));
|
|
6035
6176
|
onInput(event) {
|
|
6036
|
-
|
|
6177
|
+
const value = event.target.value.replace('#', '');
|
|
6178
|
+
this.commit(value);
|
|
6179
|
+
this.changed.emit({ originalEvent: event, value });
|
|
6037
6180
|
}
|
|
6038
6181
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzColorPickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
6039
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzColorPickerComponent, isStandalone: true, selector: "ui-color-picker", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-flex" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzColorPickerComponent), multi: true }], usesInheritance: true, ngImport: i0, template: `
|
|
6182
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzColorPickerComponent, isStandalone: true, selector: "ui-color-picker", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "inline-flex" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzColorPickerComponent), multi: true }], usesInheritance: true, ngImport: i0, template: `
|
|
6040
6183
|
<input
|
|
6041
6184
|
type="color"
|
|
6042
6185
|
class="h-control w-12 cursor-pointer rounded-control border border-ui-line-strong bg-ui-surface-1 p-1 focus:outline-none focus:ring-2 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
@@ -6067,7 +6210,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6067
6210
|
/>
|
|
6068
6211
|
`,
|
|
6069
6212
|
}]
|
|
6070
|
-
}], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }] } });
|
|
6213
|
+
}], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
6071
6214
|
|
|
6072
6215
|
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
6073
6216
|
/**
|
|
@@ -6218,12 +6361,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6218
6361
|
class SmzAccordionComponent {
|
|
6219
6362
|
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
6220
6363
|
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
6364
|
+
/** Um painel foi aberto (equivale ao `onOpen` do `p-accordion`). */
|
|
6365
|
+
opened = output();
|
|
6366
|
+
/** Um painel foi fechado (equivale ao `onClose`). */
|
|
6367
|
+
closed = output();
|
|
6368
|
+
/** Aceito por compatibilidade com o `p-accordion`; sem efeito. */
|
|
6369
|
+
transitionOptions = input(null, ...(ngDevMode ? [{ debugName: "transitionOptions" }] : []));
|
|
6221
6370
|
isOpen(value) {
|
|
6222
6371
|
const current = this.value();
|
|
6223
6372
|
return Array.isArray(current) ? current.includes(value) : current === value;
|
|
6224
6373
|
}
|
|
6225
6374
|
toggle(value) {
|
|
6226
6375
|
const open = this.isOpen(value);
|
|
6376
|
+
(open ? this.closed : this.opened).emit({ value });
|
|
6227
6377
|
if (this.multiple()) {
|
|
6228
6378
|
const current = Array.isArray(this.value()) ? this.value() : this.value() === null ? [] : [this.value()];
|
|
6229
6379
|
this.value.set(open ? current.filter((entry) => entry !== value) : [...current, value]);
|
|
@@ -6233,7 +6383,7 @@ class SmzAccordionComponent {
|
|
|
6233
6383
|
}
|
|
6234
6384
|
}
|
|
6235
6385
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6236
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzAccordionComponent, isStandalone: true, selector: "ui-accordion", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { classAttribute: "block overflow-hidden rounded-control border border-ui-line font-ui text-ui-fg" }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6386
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzAccordionComponent, isStandalone: true, selector: "ui-accordion", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, transitionOptions: { classPropertyName: "transitionOptions", publicName: "transitionOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", opened: "opened", closed: "closed" }, host: { classAttribute: "block overflow-hidden rounded-control border border-ui-line font-ui text-ui-fg" }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6237
6387
|
}
|
|
6238
6388
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzAccordionComponent, decorators: [{
|
|
6239
6389
|
type: Component,
|
|
@@ -6243,7 +6393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6243
6393
|
host: { class: 'block overflow-hidden rounded-control border border-ui-line font-ui text-ui-fg' },
|
|
6244
6394
|
template: '<ng-content />',
|
|
6245
6395
|
}]
|
|
6246
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }] } });
|
|
6396
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], transitionOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "transitionOptions", required: false }] }] } });
|
|
6247
6397
|
class SmzAccordionPanelComponent {
|
|
6248
6398
|
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
6249
6399
|
accordion = inject(SmzAccordionComponent);
|
|
@@ -6597,7 +6747,7 @@ class SmzPaginatorComponent {
|
|
|
6597
6747
|
<button type="button" class="inline-flex h-8 min-w-8 cursor-pointer items-center justify-center rounded-control px-2 font-ui text-ui-sm text-ui-fg transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent" aria-label="Pagina anterior" [disabled]="isFirst()" (click)="goTo(page() - 1)">
|
|
6598
6748
|
<svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true"><path d="M10 4L6 8l4 4" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
6599
6749
|
</button>
|
|
6600
|
-
@if (showPageLinks()) {
|
|
6750
|
+
@if (showPageLinks() && totalRecords() > 0) {
|
|
6601
6751
|
@for (link of links(); track link) {
|
|
6602
6752
|
<button
|
|
6603
6753
|
type="button"
|
|
@@ -6642,7 +6792,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6642
6792
|
<button type="button" class="inline-flex h-8 min-w-8 cursor-pointer items-center justify-center rounded-control px-2 font-ui text-ui-sm text-ui-fg transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent" aria-label="Pagina anterior" [disabled]="isFirst()" (click)="goTo(page() - 1)">
|
|
6643
6793
|
<svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true"><path d="M10 4L6 8l4 4" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
6644
6794
|
</button>
|
|
6645
|
-
@if (showPageLinks()) {
|
|
6795
|
+
@if (showPageLinks() && totalRecords() > 0) {
|
|
6646
6796
|
@for (link of links(); track link) {
|
|
6647
6797
|
<button
|
|
6648
6798
|
type="button"
|
|
@@ -8009,24 +8159,24 @@ class SmzCardComponent {
|
|
|
8009
8159
|
subtitleTemplate = computed(() => smzFindTemplate(this.templates(), 'subtitle'), ...(ngDevMode ? [{ debugName: "subtitleTemplate" }] : []));
|
|
8010
8160
|
footerTemplate = computed(() => smzFindTemplate(this.templates(), 'footer'), ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
|
|
8011
8161
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8012
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzCardComponent, isStandalone: true, selector: "ui-card", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, subheader: { classPropertyName: "subheader", publicName: "subheader", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex flex-col overflow-hidden rounded-card
|
|
8162
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzCardComponent, isStandalone: true, selector: "ui-card", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, subheader: { classPropertyName: "subheader", publicName: "subheader", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "p-card flex flex-col overflow-hidden rounded-card bg-ui-surface-1 font-ui text-ui-md text-ui-fg shadow-card" }, queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], ngImport: i0, template: `
|
|
8013
8163
|
@if (headerTemplate(); as tpl) {
|
|
8014
|
-
<div><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8164
|
+
<div class="p-card-header"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8015
8165
|
}
|
|
8016
|
-
<div class="flex flex-1 flex-col gap-2 p-5">
|
|
8166
|
+
<div class="p-card-body flex flex-1 flex-col gap-2 p-5">
|
|
8017
8167
|
@if (titleTemplate() || header()) {
|
|
8018
|
-
<div class="text-ui-xl font-semibold">
|
|
8168
|
+
<div class="p-card-title text-ui-xl font-semibold">
|
|
8019
8169
|
@if (titleTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ header() }} }
|
|
8020
8170
|
</div>
|
|
8021
8171
|
}
|
|
8022
8172
|
@if (subtitleTemplate() || subheader()) {
|
|
8023
|
-
<div class="text-ui-fg-muted">
|
|
8173
|
+
<div class="p-card-subtitle text-ui-fg-muted">
|
|
8024
8174
|
@if (subtitleTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ subheader() }} }
|
|
8025
8175
|
</div>
|
|
8026
8176
|
}
|
|
8027
|
-
<div class="flex-1"><ng-content /></div>
|
|
8177
|
+
<div class="p-card-content flex-1"><ng-content /></div>
|
|
8028
8178
|
@if (footerTemplate(); as tpl) {
|
|
8029
|
-
<div><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8179
|
+
<div class="p-card-footer"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8030
8180
|
}
|
|
8031
8181
|
</div>
|
|
8032
8182
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -8037,25 +8187,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8037
8187
|
selector: 'ui-card',
|
|
8038
8188
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8039
8189
|
imports: [NgTemplateOutlet],
|
|
8040
|
-
host: { class: 'flex flex-col overflow-hidden rounded-card
|
|
8190
|
+
host: { class: 'p-card flex flex-col overflow-hidden rounded-card bg-ui-surface-1 font-ui text-ui-md text-ui-fg shadow-card' },
|
|
8041
8191
|
template: `
|
|
8042
8192
|
@if (headerTemplate(); as tpl) {
|
|
8043
|
-
<div><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8193
|
+
<div class="p-card-header"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8044
8194
|
}
|
|
8045
|
-
<div class="flex flex-1 flex-col gap-2 p-5">
|
|
8195
|
+
<div class="p-card-body flex flex-1 flex-col gap-2 p-5">
|
|
8046
8196
|
@if (titleTemplate() || header()) {
|
|
8047
|
-
<div class="text-ui-xl font-semibold">
|
|
8197
|
+
<div class="p-card-title text-ui-xl font-semibold">
|
|
8048
8198
|
@if (titleTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ header() }} }
|
|
8049
8199
|
</div>
|
|
8050
8200
|
}
|
|
8051
8201
|
@if (subtitleTemplate() || subheader()) {
|
|
8052
|
-
<div class="text-ui-fg-muted">
|
|
8202
|
+
<div class="p-card-subtitle text-ui-fg-muted">
|
|
8053
8203
|
@if (subtitleTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ subheader() }} }
|
|
8054
8204
|
</div>
|
|
8055
8205
|
}
|
|
8056
|
-
<div class="flex-1"><ng-content /></div>
|
|
8206
|
+
<div class="p-card-content flex-1"><ng-content /></div>
|
|
8057
8207
|
@if (footerTemplate(); as tpl) {
|
|
8058
|
-
<div><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8208
|
+
<div class="p-card-footer"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8059
8209
|
}
|
|
8060
8210
|
</div>
|
|
8061
8211
|
`,
|
|
@@ -8087,9 +8237,9 @@ class SmzPanelComponent {
|
|
|
8087
8237
|
this.afterToggle.emit({ originalEvent: event, collapsed: next });
|
|
8088
8238
|
}
|
|
8089
8239
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8090
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzPanelComponent, isStandalone: true, selector: "ui-panel", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsedChange", beforeToggle: "beforeToggle", afterToggle: "afterToggle" }, host: { classAttribute: "block overflow-hidden rounded-card border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg" }, queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], ngImport: i0, template: `
|
|
8240
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzPanelComponent, isStandalone: true, selector: "ui-panel", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsedChange", beforeToggle: "beforeToggle", afterToggle: "afterToggle" }, host: { classAttribute: "p-panel block overflow-hidden rounded-card border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg" }, queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], ngImport: i0, template: `
|
|
8091
8241
|
@if (hasHeader()) {
|
|
8092
|
-
<div class="flex items-center justify-between gap-2 border-b border-ui-line bg-ui-surface-1 px-4 py-3">
|
|
8242
|
+
<div class="p-panel-header flex items-center justify-between gap-2 border-b border-ui-line bg-ui-surface-1 px-4 py-3">
|
|
8093
8243
|
<div class="min-w-0 flex-1 font-semibold">
|
|
8094
8244
|
@if (headerTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ header() }} }
|
|
8095
8245
|
</div>
|
|
@@ -8104,9 +8254,9 @@ class SmzPanelComponent {
|
|
|
8104
8254
|
</div>
|
|
8105
8255
|
}
|
|
8106
8256
|
@if (!collapsed()) {
|
|
8107
|
-
<div class="p-4"><ng-content /></div>
|
|
8257
|
+
<div class="p-panel-content p-4"><ng-content /></div>
|
|
8108
8258
|
@if (footerTemplate(); as tpl) {
|
|
8109
|
-
<div class="border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8259
|
+
<div class="p-panel-footer border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8110
8260
|
}
|
|
8111
8261
|
}
|
|
8112
8262
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -8117,10 +8267,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8117
8267
|
selector: 'ui-panel',
|
|
8118
8268
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8119
8269
|
imports: [NgTemplateOutlet],
|
|
8120
|
-
host: { class: 'block overflow-hidden rounded-card border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg' },
|
|
8270
|
+
host: { class: 'p-panel block overflow-hidden rounded-card border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg' },
|
|
8121
8271
|
template: `
|
|
8122
8272
|
@if (hasHeader()) {
|
|
8123
|
-
<div class="flex items-center justify-between gap-2 border-b border-ui-line bg-ui-surface-1 px-4 py-3">
|
|
8273
|
+
<div class="p-panel-header flex items-center justify-between gap-2 border-b border-ui-line bg-ui-surface-1 px-4 py-3">
|
|
8124
8274
|
<div class="min-w-0 flex-1 font-semibold">
|
|
8125
8275
|
@if (headerTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ header() }} }
|
|
8126
8276
|
</div>
|
|
@@ -8135,9 +8285,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8135
8285
|
</div>
|
|
8136
8286
|
}
|
|
8137
8287
|
@if (!collapsed()) {
|
|
8138
|
-
<div class="p-4"><ng-content /></div>
|
|
8288
|
+
<div class="p-panel-content p-4"><ng-content /></div>
|
|
8139
8289
|
@if (footerTemplate(); as tpl) {
|
|
8140
|
-
<div class="border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8290
|
+
<div class="p-panel-footer border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8141
8291
|
}
|
|
8142
8292
|
}
|
|
8143
8293
|
`,
|
|
@@ -8405,6 +8555,14 @@ class SmzTreeTableComponent {
|
|
|
8405
8555
|
rowsPerPageOptions = input(null, ...(ngDevMode ? [{ debugName: "rowsPerPageOptions" }] : []));
|
|
8406
8556
|
sortField = model(null, ...(ngDevMode ? [{ debugName: "sortField" }] : []));
|
|
8407
8557
|
sortOrder = model(1, ...(ngDevMode ? [{ debugName: "sortOrder" }] : []));
|
|
8558
|
+
/** Destaca a linha sob o cursor (padrao: ligado). */
|
|
8559
|
+
rowHover = input(true, { ...(ngDevMode ? { debugName: "rowHover" } : {}), transform: booleanAttribute });
|
|
8560
|
+
showCurrentPageReport = input(false, { ...(ngDevMode ? { debugName: "showCurrentPageReport" } : {}), transform: booleanAttribute });
|
|
8561
|
+
currentPageReportTemplate = input('Mostrando {first} a {last} de {totalRecords}', ...(ngDevMode ? [{ debugName: "currentPageReportTemplate" }] : []));
|
|
8562
|
+
/** Campos (de `node.data`) consultados pelo filtro global. */
|
|
8563
|
+
globalFilterFields = input(null, ...(ngDevMode ? [{ debugName: "globalFilterFields" }] : []));
|
|
8564
|
+
/** `lenient`: um no que casa mantem toda a sua subarvore; `strict`: so os nos que casam (e seus ancestrais). */
|
|
8565
|
+
filterMode = input('lenient', ...(ngDevMode ? [{ debugName: "filterMode" }] : []));
|
|
8408
8566
|
nodeSelect = output();
|
|
8409
8567
|
nodeUnselect = output();
|
|
8410
8568
|
nodeExpand = output();
|
|
@@ -8420,17 +8578,69 @@ class SmzTreeTableComponent {
|
|
|
8420
8578
|
summaryTemplate = computed(() => smzFindTemplate(this.templates(), 'summary'), ...(ngDevMode ? [{ debugName: "summaryTemplate" }] : []));
|
|
8421
8579
|
/** Os nos sao mutaveis (`expanded`, `partialSelected`); este contador forca o recalculo das linhas. */
|
|
8422
8580
|
version = signal(0, ...(ngDevMode ? [{ debugName: "version" }] : []));
|
|
8423
|
-
|
|
8581
|
+
filterService = inject(SmzFilterService);
|
|
8582
|
+
globalFilter = signal(null, ...(ngDevMode ? [{ debugName: "globalFilter" }] : []));
|
|
8583
|
+
columnFilters = signal({}, ...(ngDevMode ? [{ debugName: "columnFilters" }] : []));
|
|
8584
|
+
/** Nos raiz que passam nos filtros (global e por coluna), ou `null` quando nao ha filtro ativo. */
|
|
8585
|
+
get filteredNodes() {
|
|
8586
|
+
return this.visibility()?.roots ?? null;
|
|
8587
|
+
}
|
|
8588
|
+
/** Visibilidade calculada dos filtros: quais nos aparecem e quais ancestrais expandir. */
|
|
8589
|
+
visibility = computed(() => {
|
|
8590
|
+
this.version();
|
|
8591
|
+
const global = this.globalFilter();
|
|
8592
|
+
const columns = this.columnFilters();
|
|
8593
|
+
const active = Object.entries(columns).filter(([, filter]) => filter.value !== null && filter.value !== undefined && filter.value !== '');
|
|
8594
|
+
if (!global?.value && active.length === 0)
|
|
8595
|
+
return null;
|
|
8596
|
+
const matches = (node) => {
|
|
8597
|
+
for (const [field, filter] of active) {
|
|
8598
|
+
const test = this.filterService.filters[filter.matchMode] ?? this.filterService.filters['contains'];
|
|
8599
|
+
if (!test(SmzObjectUtils.resolveFieldData(node.data, field), filter.value))
|
|
8600
|
+
return false;
|
|
8601
|
+
}
|
|
8602
|
+
if (global?.value) {
|
|
8603
|
+
const test = this.filterService.filters[global.matchMode] ?? this.filterService.filters['contains'];
|
|
8604
|
+
const fields = this.globalFilterFields() ?? Object.keys(node.data ?? {});
|
|
8605
|
+
if (!fields.some((field) => test(SmzObjectUtils.resolveFieldData(node.data, field), global.value)))
|
|
8606
|
+
return false;
|
|
8607
|
+
}
|
|
8608
|
+
return true;
|
|
8609
|
+
};
|
|
8610
|
+
const visible = new Set();
|
|
8611
|
+
const expand = new Set();
|
|
8612
|
+
const lenient = this.filterMode() === 'lenient';
|
|
8613
|
+
const mark = (node, forced) => {
|
|
8614
|
+
const self = matches(node);
|
|
8615
|
+
let anyChild = false;
|
|
8616
|
+
for (const child of node.children ?? []) {
|
|
8617
|
+
if (mark(child, forced || (lenient && self)))
|
|
8618
|
+
anyChild = true;
|
|
8619
|
+
}
|
|
8620
|
+
const show = self || anyChild || forced;
|
|
8621
|
+
if (show)
|
|
8622
|
+
visible.add(node);
|
|
8623
|
+
if (anyChild && !self)
|
|
8624
|
+
expand.add(node);
|
|
8625
|
+
return self || anyChild;
|
|
8626
|
+
};
|
|
8627
|
+
const roots = (this.value() ?? []).filter((node) => mark(node, false));
|
|
8628
|
+
return { roots, visible, expand };
|
|
8629
|
+
}, ...(ngDevMode ? [{ debugName: "visibility" }] : []));
|
|
8630
|
+
rootCount = computed(() => this.visibility()?.roots.length ?? (this.value() ?? []).length, ...(ngDevMode ? [{ debugName: "rootCount" }] : []));
|
|
8424
8631
|
flatRows = computed(() => {
|
|
8425
8632
|
this.version();
|
|
8426
8633
|
const field = this.sortField();
|
|
8427
8634
|
const order = this.sortOrder();
|
|
8635
|
+
const filter = this.visibility();
|
|
8428
8636
|
const out = [];
|
|
8429
8637
|
const sort = (nodes) => field ? [...nodes].sort((a, b) => order * compareValues(SmzObjectUtils.resolveFieldData(a.data, field), SmzObjectUtils.resolveFieldData(b.data, field))) : nodes;
|
|
8430
8638
|
const walk = (nodes, parent, level) => {
|
|
8431
8639
|
for (const node of sort(nodes)) {
|
|
8640
|
+
if (filter && !filter.visible.has(node))
|
|
8641
|
+
continue;
|
|
8432
8642
|
out.push({ node, parent, level });
|
|
8433
|
-
if (node.expanded && node.children?.length)
|
|
8643
|
+
if ((node.expanded || filter?.expand.has(node)) && node.children?.length)
|
|
8434
8644
|
walk(node.children, node, level + 1);
|
|
8435
8645
|
}
|
|
8436
8646
|
};
|
|
@@ -8451,6 +8661,24 @@ class SmzTreeTableComponent {
|
|
|
8451
8661
|
return include;
|
|
8452
8662
|
});
|
|
8453
8663
|
}, ...(ngDevMode ? [{ debugName: "pageRows" }] : []));
|
|
8664
|
+
/** Filtro global (equivale a `filterGlobal` do `p-treeTable`). */
|
|
8665
|
+
filterGlobal(value, matchMode = 'contains') {
|
|
8666
|
+
this.globalFilter.set(value ? { value, matchMode } : null);
|
|
8667
|
+
this.first.set(0);
|
|
8668
|
+
}
|
|
8669
|
+
/** Filtro de uma coluna (campo de `node.data`). Valor vazio remove o filtro. */
|
|
8670
|
+
filter(value, field, matchMode = 'contains') {
|
|
8671
|
+
this.columnFilters.update((current) => ({ ...current, [field]: { value, matchMode } }));
|
|
8672
|
+
this.first.set(0);
|
|
8673
|
+
}
|
|
8674
|
+
/** Limpa filtros, ordenacao e volta para a primeira pagina (equivale a `clear()` do `p-treeTable`). */
|
|
8675
|
+
clear() {
|
|
8676
|
+
this.globalFilter.set(null);
|
|
8677
|
+
this.columnFilters.set({});
|
|
8678
|
+
this.sortField.set(null);
|
|
8679
|
+
this.sortOrder.set(1);
|
|
8680
|
+
this.first.set(0);
|
|
8681
|
+
}
|
|
8454
8682
|
refresh() {
|
|
8455
8683
|
this.version.update((v) => v + 1);
|
|
8456
8684
|
}
|
|
@@ -8559,46 +8787,46 @@ class SmzTreeTableComponent {
|
|
|
8559
8787
|
return search(this.value() ?? [], null) ?? null;
|
|
8560
8788
|
}
|
|
8561
8789
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8562
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzTreeTableComponent, isStandalone: true, selector: "ui-tree-table", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, propagateSelectionUp: { classPropertyName: "propagateSelectionUp", publicName: "propagateSelectionUp", isSignal: true, isRequired: false, transformFunction: null }, propagateSelectionDown: { classPropertyName: "propagateSelectionDown", publicName: "propagateSelectionDown", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, tableStyleClass: { classPropertyName: "tableStyleClass", publicName: "tableStyleClass", isSignal: true, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, sortField: { classPropertyName: "sortField", publicName: "sortField", isSignal: true, isRequired: false, transformFunction: null }, sortOrder: { classPropertyName: "sortOrder", publicName: "sortOrder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", rows: "rowsChange", first: "firstChange", sortField: "sortFieldChange", sortOrder: "sortOrderChange", nodeSelect: "nodeSelect", nodeUnselect: "nodeUnselect", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", sorted: "sorted", page: "page" }, host: { classAttribute: "block overflow-hidden rounded-control border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg" }, queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], ngImport: i0, template: `
|
|
8563
|
-
@if (captionTemplate(); as tpl) {
|
|
8564
|
-
<div class="border-b border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8565
|
-
}
|
|
8566
|
-
<div class="relative overflow-auto" [style.max-height]="scrollable() ? scrollHeight() : null">
|
|
8567
|
-
<table class="w-full border-separate border-spacing-0 text-left [&_td]:border-b [&_td]:border-ui-line [&_td]:px-4 [&_td]:py-3 [&_th]:sticky [&_th]:top-0 [&_th]:border-b [&_th]:border-ui-line [&_th]:bg-ui-surface-1 [&_th]:px-4 [&_th]:py-3 [&_th]:font-semibold" [class]="tableStyleClass() ?? ''">
|
|
8568
|
-
<thead>
|
|
8569
|
-
@if (headerTemplate(); as tpl) {
|
|
8570
|
-
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" />
|
|
8571
|
-
}
|
|
8572
|
-
</thead>
|
|
8573
|
-
<tbody>
|
|
8574
|
-
@for (row of pageRows(); track row.node.key ?? row.node) {
|
|
8575
|
-
<ng-container [ngTemplateOutlet]="bodyTemplate() ?? null" [ngTemplateOutletContext]="{ $implicit: row, rowNode: row, node: row.node, rowData: row.node.data, columns: columns() }" />
|
|
8576
|
-
} @empty {
|
|
8577
|
-
@if (!loading()) {
|
|
8578
|
-
<tr>
|
|
8579
|
-
<td [attr.colspan]="columns().length || 1" class="px-4 py-6 text-center text-ui-fg-muted">
|
|
8580
|
-
@if (emptyTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /> } @else { {{ emptyMessage() }} }
|
|
8581
|
-
</td>
|
|
8582
|
-
</tr>
|
|
8583
|
-
}
|
|
8584
|
-
}
|
|
8585
|
-
</tbody>
|
|
8586
|
-
@if (footerTemplate(); as tpl) {
|
|
8587
|
-
<tfoot><ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /></tfoot>
|
|
8588
|
-
}
|
|
8589
|
-
</table>
|
|
8590
|
-
@if (loading()) {
|
|
8591
|
-
<div class="absolute inset-0 flex items-center justify-center bg-ui-surface-1/60 text-ui-primary" role="status">
|
|
8592
|
-
<svg viewBox="0 0 50 50" class="h-8 w-8 animate-spin" fill="none" aria-hidden="true"><circle cx="25" cy="25" r="20" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-dasharray="90 150" /></svg>
|
|
8593
|
-
</div>
|
|
8594
|
-
}
|
|
8595
|
-
</div>
|
|
8596
|
-
@if (paginator()) {
|
|
8597
|
-
<ui-paginator class="border-t border-ui-line" [first]="first()" [rows]="rows()" [totalRecords]="rootCount()" [rowsPerPageOptions]="rowsPerPageOptions()" (firstChange)="first.set($event)" (rowsChange)="rows.set($event)" (pageChanged)="page.emit($event)" />
|
|
8598
|
-
}
|
|
8599
|
-
@if (summaryTemplate(); as tpl) {
|
|
8600
|
-
<div class="border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8601
|
-
}
|
|
8790
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzTreeTableComponent, isStandalone: true, selector: "ui-tree-table", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, propagateSelectionUp: { classPropertyName: "propagateSelectionUp", publicName: "propagateSelectionUp", isSignal: true, isRequired: false, transformFunction: null }, propagateSelectionDown: { classPropertyName: "propagateSelectionDown", publicName: "propagateSelectionDown", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, tableStyleClass: { classPropertyName: "tableStyleClass", publicName: "tableStyleClass", isSignal: true, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, sortField: { classPropertyName: "sortField", publicName: "sortField", isSignal: true, isRequired: false, transformFunction: null }, sortOrder: { classPropertyName: "sortOrder", publicName: "sortOrder", isSignal: true, isRequired: false, transformFunction: null }, rowHover: { classPropertyName: "rowHover", publicName: "rowHover", isSignal: true, isRequired: false, transformFunction: null }, showCurrentPageReport: { classPropertyName: "showCurrentPageReport", publicName: "showCurrentPageReport", isSignal: true, isRequired: false, transformFunction: null }, currentPageReportTemplate: { classPropertyName: "currentPageReportTemplate", publicName: "currentPageReportTemplate", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFields: { classPropertyName: "globalFilterFields", publicName: "globalFilterFields", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", rows: "rowsChange", first: "firstChange", sortField: "sortFieldChange", sortOrder: "sortOrderChange", nodeSelect: "nodeSelect", nodeUnselect: "nodeUnselect", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", sorted: "sorted", page: "page" }, host: { classAttribute: "block overflow-hidden rounded-control border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg" }, queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], ngImport: i0, template: `
|
|
8791
|
+
@if (captionTemplate(); as tpl) {
|
|
8792
|
+
<div class="border-b border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8793
|
+
}
|
|
8794
|
+
<div class="relative overflow-auto" [style.max-height]="scrollable() ? scrollHeight() : null">
|
|
8795
|
+
<table class="w-full border-separate border-spacing-0 text-left [&_td]:border-b [&_td]:border-ui-line [&_td]:px-4 [&_td]:py-3 [&_th]:sticky [&_th]:top-0 [&_th]:border-b [&_th]:border-ui-line [&_th]:bg-ui-surface-1 [&_th]:px-4 [&_th]:py-3 [&_th]:font-semibold" [class]="tableStyleClass() ?? ''">
|
|
8796
|
+
<thead>
|
|
8797
|
+
@if (headerTemplate(); as tpl) {
|
|
8798
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" />
|
|
8799
|
+
}
|
|
8800
|
+
</thead>
|
|
8801
|
+
<tbody>
|
|
8802
|
+
@for (row of pageRows(); track row.node.key ?? row.node) {
|
|
8803
|
+
<ng-container [ngTemplateOutlet]="bodyTemplate() ?? null" [ngTemplateOutletContext]="{ $implicit: row, rowNode: row, node: row.node, rowData: row.node.data, columns: columns() }" />
|
|
8804
|
+
} @empty {
|
|
8805
|
+
@if (!loading()) {
|
|
8806
|
+
<tr>
|
|
8807
|
+
<td [attr.colspan]="columns().length || 1" class="px-4 py-6 text-center text-ui-fg-muted">
|
|
8808
|
+
@if (emptyTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /> } @else { {{ emptyMessage() }} }
|
|
8809
|
+
</td>
|
|
8810
|
+
</tr>
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
</tbody>
|
|
8814
|
+
@if (footerTemplate(); as tpl) {
|
|
8815
|
+
<tfoot><ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /></tfoot>
|
|
8816
|
+
}
|
|
8817
|
+
</table>
|
|
8818
|
+
@if (loading()) {
|
|
8819
|
+
<div class="absolute inset-0 flex items-center justify-center bg-ui-surface-1/60 text-ui-primary" role="status">
|
|
8820
|
+
<svg viewBox="0 0 50 50" class="h-8 w-8 animate-spin" fill="none" aria-hidden="true"><circle cx="25" cy="25" r="20" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-dasharray="90 150" /></svg>
|
|
8821
|
+
</div>
|
|
8822
|
+
}
|
|
8823
|
+
</div>
|
|
8824
|
+
@if (paginator()) {
|
|
8825
|
+
<ui-paginator class="border-t border-ui-line" [first]="first()" [rows]="rows()" [totalRecords]="rootCount()" [rowsPerPageOptions]="rowsPerPageOptions()" [showCurrentPageReport]="showCurrentPageReport()" [currentPageReportTemplate]="currentPageReportTemplate()" (firstChange)="first.set($event)" (rowsChange)="rows.set($event)" (pageChanged)="page.emit($event)" />
|
|
8826
|
+
}
|
|
8827
|
+
@if (summaryTemplate(); as tpl) {
|
|
8828
|
+
<div class="border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8829
|
+
}
|
|
8602
8830
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SmzPaginatorComponent, selector: "ui-paginator", inputs: ["first", "rows", "totalRecords", "pageLinkSize", "rowsPerPageOptions", "showCurrentPageReport", "currentPageReportTemplate", "alwaysShow", "showPageLinks", "styleClass", "dropdownAppendTo", "showFirstLastIcon"], outputs: ["firstChange", "rowsChange", "pageChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8603
8831
|
}
|
|
8604
8832
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableComponent, decorators: [{
|
|
@@ -8608,49 +8836,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8608
8836
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8609
8837
|
imports: [NgTemplateOutlet, SmzPaginatorComponent],
|
|
8610
8838
|
host: { class: 'block overflow-hidden rounded-control border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg' },
|
|
8611
|
-
template: `
|
|
8612
|
-
@if (captionTemplate(); as tpl) {
|
|
8613
|
-
<div class="border-b border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8614
|
-
}
|
|
8615
|
-
<div class="relative overflow-auto" [style.max-height]="scrollable() ? scrollHeight() : null">
|
|
8616
|
-
<table class="w-full border-separate border-spacing-0 text-left [&_td]:border-b [&_td]:border-ui-line [&_td]:px-4 [&_td]:py-3 [&_th]:sticky [&_th]:top-0 [&_th]:border-b [&_th]:border-ui-line [&_th]:bg-ui-surface-1 [&_th]:px-4 [&_th]:py-3 [&_th]:font-semibold" [class]="tableStyleClass() ?? ''">
|
|
8617
|
-
<thead>
|
|
8618
|
-
@if (headerTemplate(); as tpl) {
|
|
8619
|
-
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" />
|
|
8620
|
-
}
|
|
8621
|
-
</thead>
|
|
8622
|
-
<tbody>
|
|
8623
|
-
@for (row of pageRows(); track row.node.key ?? row.node) {
|
|
8624
|
-
<ng-container [ngTemplateOutlet]="bodyTemplate() ?? null" [ngTemplateOutletContext]="{ $implicit: row, rowNode: row, node: row.node, rowData: row.node.data, columns: columns() }" />
|
|
8625
|
-
} @empty {
|
|
8626
|
-
@if (!loading()) {
|
|
8627
|
-
<tr>
|
|
8628
|
-
<td [attr.colspan]="columns().length || 1" class="px-4 py-6 text-center text-ui-fg-muted">
|
|
8629
|
-
@if (emptyTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /> } @else { {{ emptyMessage() }} }
|
|
8630
|
-
</td>
|
|
8631
|
-
</tr>
|
|
8632
|
-
}
|
|
8633
|
-
}
|
|
8634
|
-
</tbody>
|
|
8635
|
-
@if (footerTemplate(); as tpl) {
|
|
8636
|
-
<tfoot><ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /></tfoot>
|
|
8637
|
-
}
|
|
8638
|
-
</table>
|
|
8639
|
-
@if (loading()) {
|
|
8640
|
-
<div class="absolute inset-0 flex items-center justify-center bg-ui-surface-1/60 text-ui-primary" role="status">
|
|
8641
|
-
<svg viewBox="0 0 50 50" class="h-8 w-8 animate-spin" fill="none" aria-hidden="true"><circle cx="25" cy="25" r="20" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-dasharray="90 150" /></svg>
|
|
8642
|
-
</div>
|
|
8643
|
-
}
|
|
8644
|
-
</div>
|
|
8645
|
-
@if (paginator()) {
|
|
8646
|
-
<ui-paginator class="border-t border-ui-line" [first]="first()" [rows]="rows()" [totalRecords]="rootCount()" [rowsPerPageOptions]="rowsPerPageOptions()" (firstChange)="first.set($event)" (rowsChange)="rows.set($event)" (pageChanged)="page.emit($event)" />
|
|
8647
|
-
}
|
|
8648
|
-
@if (summaryTemplate(); as tpl) {
|
|
8649
|
-
<div class="border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8650
|
-
}
|
|
8839
|
+
template: `
|
|
8840
|
+
@if (captionTemplate(); as tpl) {
|
|
8841
|
+
<div class="border-b border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8842
|
+
}
|
|
8843
|
+
<div class="relative overflow-auto" [style.max-height]="scrollable() ? scrollHeight() : null">
|
|
8844
|
+
<table class="w-full border-separate border-spacing-0 text-left [&_td]:border-b [&_td]:border-ui-line [&_td]:px-4 [&_td]:py-3 [&_th]:sticky [&_th]:top-0 [&_th]:border-b [&_th]:border-ui-line [&_th]:bg-ui-surface-1 [&_th]:px-4 [&_th]:py-3 [&_th]:font-semibold" [class]="tableStyleClass() ?? ''">
|
|
8845
|
+
<thead>
|
|
8846
|
+
@if (headerTemplate(); as tpl) {
|
|
8847
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" />
|
|
8848
|
+
}
|
|
8849
|
+
</thead>
|
|
8850
|
+
<tbody>
|
|
8851
|
+
@for (row of pageRows(); track row.node.key ?? row.node) {
|
|
8852
|
+
<ng-container [ngTemplateOutlet]="bodyTemplate() ?? null" [ngTemplateOutletContext]="{ $implicit: row, rowNode: row, node: row.node, rowData: row.node.data, columns: columns() }" />
|
|
8853
|
+
} @empty {
|
|
8854
|
+
@if (!loading()) {
|
|
8855
|
+
<tr>
|
|
8856
|
+
<td [attr.colspan]="columns().length || 1" class="px-4 py-6 text-center text-ui-fg-muted">
|
|
8857
|
+
@if (emptyTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /> } @else { {{ emptyMessage() }} }
|
|
8858
|
+
</td>
|
|
8859
|
+
</tr>
|
|
8860
|
+
}
|
|
8861
|
+
}
|
|
8862
|
+
</tbody>
|
|
8863
|
+
@if (footerTemplate(); as tpl) {
|
|
8864
|
+
<tfoot><ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /></tfoot>
|
|
8865
|
+
}
|
|
8866
|
+
</table>
|
|
8867
|
+
@if (loading()) {
|
|
8868
|
+
<div class="absolute inset-0 flex items-center justify-center bg-ui-surface-1/60 text-ui-primary" role="status">
|
|
8869
|
+
<svg viewBox="0 0 50 50" class="h-8 w-8 animate-spin" fill="none" aria-hidden="true"><circle cx="25" cy="25" r="20" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-dasharray="90 150" /></svg>
|
|
8870
|
+
</div>
|
|
8871
|
+
}
|
|
8872
|
+
</div>
|
|
8873
|
+
@if (paginator()) {
|
|
8874
|
+
<ui-paginator class="border-t border-ui-line" [first]="first()" [rows]="rows()" [totalRecords]="rootCount()" [rowsPerPageOptions]="rowsPerPageOptions()" [showCurrentPageReport]="showCurrentPageReport()" [currentPageReportTemplate]="currentPageReportTemplate()" (firstChange)="first.set($event)" (rowsChange)="rows.set($event)" (pageChanged)="page.emit($event)" />
|
|
8875
|
+
}
|
|
8876
|
+
@if (summaryTemplate(); as tpl) {
|
|
8877
|
+
<div class="border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8878
|
+
}
|
|
8651
8879
|
`,
|
|
8652
8880
|
}]
|
|
8653
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], propagateSelectionUp: [{ type: i0.Input, args: [{ isSignal: true, alias: "propagateSelectionUp", required: false }] }], propagateSelectionDown: [{ type: i0.Input, args: [{ isSignal: true, alias: "propagateSelectionDown", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], tableStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableStyleClass", required: false }] }], paginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginator", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }, { type: i0.Output, args: ["rowsChange"] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], sortField: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortField", required: false }] }, { type: i0.Output, args: ["sortFieldChange"] }], sortOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortOrder", required: false }] }, { type: i0.Output, args: ["sortOrderChange"] }], nodeSelect: [{ type: i0.Output, args: ["nodeSelect"] }], nodeUnselect: [{ type: i0.Output, args: ["nodeUnselect"] }], nodeExpand: [{ type: i0.Output, args: ["nodeExpand"] }], nodeCollapse: [{ type: i0.Output, args: ["nodeCollapse"] }], sorted: [{ type: i0.Output, args: ["sorted"] }], page: [{ type: i0.Output, args: ["page"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzTemplateDirective), { isSignal: true }] }] } });
|
|
8881
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], propagateSelectionUp: [{ type: i0.Input, args: [{ isSignal: true, alias: "propagateSelectionUp", required: false }] }], propagateSelectionDown: [{ type: i0.Input, args: [{ isSignal: true, alias: "propagateSelectionDown", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], tableStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableStyleClass", required: false }] }], paginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginator", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }, { type: i0.Output, args: ["rowsChange"] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], sortField: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortField", required: false }] }, { type: i0.Output, args: ["sortFieldChange"] }], sortOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortOrder", required: false }] }, { type: i0.Output, args: ["sortOrderChange"] }], rowHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHover", required: false }] }], showCurrentPageReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCurrentPageReport", required: false }] }], currentPageReportTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPageReportTemplate", required: false }] }], globalFilterFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "globalFilterFields", required: false }] }], filterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMode", required: false }] }], nodeSelect: [{ type: i0.Output, args: ["nodeSelect"] }], nodeUnselect: [{ type: i0.Output, args: ["nodeUnselect"] }], nodeExpand: [{ type: i0.Output, args: ["nodeExpand"] }], nodeCollapse: [{ type: i0.Output, args: ["nodeCollapse"] }], sorted: [{ type: i0.Output, args: ["sorted"] }], page: [{ type: i0.Output, args: ["page"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzTemplateDirective), { isSignal: true }] }] } });
|
|
8654
8882
|
function compareValues(a, b) {
|
|
8655
8883
|
if (a == null && b == null)
|
|
8656
8884
|
return 0;
|
|
@@ -8669,7 +8897,8 @@ class SmzTreeTableRowDirective {
|
|
|
8669
8897
|
classes = computed(() => {
|
|
8670
8898
|
const mode = this.table.selectionMode();
|
|
8671
8899
|
const selected = this.table.isSelected(this.rowNode().node);
|
|
8672
|
-
const
|
|
8900
|
+
const hover = this.table.rowHover() ? 'hover:bg-ui-surface-3' : '';
|
|
8901
|
+
const interactive = mode && mode !== 'checkbox' ? `cursor-pointer ${hover}` : hover;
|
|
8673
8902
|
return `${ROW_BASE} ${interactive} ${selected && mode !== 'checkbox' ? 'bg-ui-primary/10' : ''}`;
|
|
8674
8903
|
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
8675
8904
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableRowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -8697,10 +8926,10 @@ class SmzTreeTableTogglerComponent {
|
|
|
8697
8926
|
return !node.leaf && (node.children?.length ?? 0) > 0;
|
|
8698
8927
|
}
|
|
8699
8928
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableTogglerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8700
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzTreeTableTogglerComponent, isStandalone: true, selector: "ui-tree-table-toggler", inputs: { rowNode: { classPropertyName: "rowNode", publicName: "rowNode", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.padding-left.rem": "rowNode().level * 1.5" }, classAttribute: "inline-flex items-center align-middle" }, ngImport: i0, template: `
|
|
8701
|
-
<button type="button" class="inline-flex h-6 w-6 items-center justify-center rounded-full text-ui-fg-muted transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class.invisible]="!hasChildren()" [attr.aria-label]="rowNode().node.expanded ? 'Recolher' : 'Expandir'" (click)="$event.stopPropagation(); table.toggleNode(rowNode(), $event)">
|
|
8702
|
-
<svg viewBox="0 0 16 16" class="h-4 w-4 transition-transform duration-ui" [class.rotate-90]="rowNode().node.expanded" fill="none" aria-hidden="true"><path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
8703
|
-
</button>
|
|
8929
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzTreeTableTogglerComponent, isStandalone: true, selector: "ui-tree-table-toggler", inputs: { rowNode: { classPropertyName: "rowNode", publicName: "rowNode", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.padding-left.rem": "rowNode().level * 1.5" }, classAttribute: "inline-flex items-center align-middle" }, ngImport: i0, template: `
|
|
8930
|
+
<button type="button" class="inline-flex h-6 w-6 items-center justify-center rounded-full text-ui-fg-muted transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class.invisible]="!hasChildren()" [attr.aria-label]="rowNode().node.expanded ? 'Recolher' : 'Expandir'" (click)="$event.stopPropagation(); table.toggleNode(rowNode(), $event)">
|
|
8931
|
+
<svg viewBox="0 0 16 16" class="h-4 w-4 transition-transform duration-ui" [class.rotate-90]="rowNode().node.expanded" fill="none" aria-hidden="true"><path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
8932
|
+
</button>
|
|
8704
8933
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8705
8934
|
}
|
|
8706
8935
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableTogglerComponent, decorators: [{
|
|
@@ -8709,10 +8938,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8709
8938
|
selector: 'ui-tree-table-toggler',
|
|
8710
8939
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8711
8940
|
host: { class: 'inline-flex items-center align-middle', '[style.padding-left.rem]': 'rowNode().level * 1.5' },
|
|
8712
|
-
template: `
|
|
8713
|
-
<button type="button" class="inline-flex h-6 w-6 items-center justify-center rounded-full text-ui-fg-muted transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class.invisible]="!hasChildren()" [attr.aria-label]="rowNode().node.expanded ? 'Recolher' : 'Expandir'" (click)="$event.stopPropagation(); table.toggleNode(rowNode(), $event)">
|
|
8714
|
-
<svg viewBox="0 0 16 16" class="h-4 w-4 transition-transform duration-ui" [class.rotate-90]="rowNode().node.expanded" fill="none" aria-hidden="true"><path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
8715
|
-
</button>
|
|
8941
|
+
template: `
|
|
8942
|
+
<button type="button" class="inline-flex h-6 w-6 items-center justify-center rounded-full text-ui-fg-muted transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class.invisible]="!hasChildren()" [attr.aria-label]="rowNode().node.expanded ? 'Recolher' : 'Expandir'" (click)="$event.stopPropagation(); table.toggleNode(rowNode(), $event)">
|
|
8943
|
+
<svg viewBox="0 0 16 16" class="h-4 w-4 transition-transform duration-ui" [class.rotate-90]="rowNode().node.expanded" fill="none" aria-hidden="true"><path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
8944
|
+
</button>
|
|
8716
8945
|
`,
|
|
8717
8946
|
}]
|
|
8718
8947
|
}], propDecorators: { rowNode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowNode", required: true }] }] } });
|
|
@@ -8724,11 +8953,11 @@ class SmzTreeTableCheckboxComponent {
|
|
|
8724
8953
|
return this.table.selectionState(this.value().node);
|
|
8725
8954
|
}
|
|
8726
8955
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8727
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzTreeTableCheckboxComponent, isStandalone: true, selector: "ui-tree-table-checkbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "inline-flex align-middle" }, ngImport: i0, template: `
|
|
8728
|
-
<button type="button" role="checkbox" [attr.aria-checked]="state() === 'partial' ? 'mixed' : state() === 'checked'" class="inline-flex h-5 w-5 items-center justify-center rounded border transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class]="state() === 'unchecked' ? 'border-ui-line-strong bg-ui-surface-1' : 'border-ui-primary bg-ui-primary text-ui-on-primary'" (click)="$event.stopPropagation(); table.toggleCheckbox(value(), $event)">
|
|
8729
|
-
@if (state() === 'checked') { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M3.5 8.5l3 3 6-6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg> }
|
|
8730
|
-
@else if (state() === 'partial') { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M4 8h8" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg> }
|
|
8731
|
-
</button>
|
|
8956
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzTreeTableCheckboxComponent, isStandalone: true, selector: "ui-tree-table-checkbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "inline-flex align-middle" }, ngImport: i0, template: `
|
|
8957
|
+
<button type="button" role="checkbox" [attr.aria-checked]="state() === 'partial' ? 'mixed' : state() === 'checked'" class="inline-flex h-5 w-5 items-center justify-center rounded border transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class]="state() === 'unchecked' ? 'border-ui-line-strong bg-ui-surface-1' : 'border-ui-primary bg-ui-primary text-ui-on-primary'" (click)="$event.stopPropagation(); table.toggleCheckbox(value(), $event)">
|
|
8958
|
+
@if (state() === 'checked') { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M3.5 8.5l3 3 6-6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg> }
|
|
8959
|
+
@else if (state() === 'partial') { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M4 8h8" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg> }
|
|
8960
|
+
</button>
|
|
8732
8961
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8733
8962
|
}
|
|
8734
8963
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableCheckboxComponent, decorators: [{
|
|
@@ -8737,11 +8966,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8737
8966
|
selector: 'ui-tree-table-checkbox',
|
|
8738
8967
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8739
8968
|
host: { class: 'inline-flex align-middle' },
|
|
8740
|
-
template: `
|
|
8741
|
-
<button type="button" role="checkbox" [attr.aria-checked]="state() === 'partial' ? 'mixed' : state() === 'checked'" class="inline-flex h-5 w-5 items-center justify-center rounded border transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class]="state() === 'unchecked' ? 'border-ui-line-strong bg-ui-surface-1' : 'border-ui-primary bg-ui-primary text-ui-on-primary'" (click)="$event.stopPropagation(); table.toggleCheckbox(value(), $event)">
|
|
8742
|
-
@if (state() === 'checked') { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M3.5 8.5l3 3 6-6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg> }
|
|
8743
|
-
@else if (state() === 'partial') { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M4 8h8" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg> }
|
|
8744
|
-
</button>
|
|
8969
|
+
template: `
|
|
8970
|
+
<button type="button" role="checkbox" [attr.aria-checked]="state() === 'partial' ? 'mixed' : state() === 'checked'" class="inline-flex h-5 w-5 items-center justify-center rounded border transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class]="state() === 'unchecked' ? 'border-ui-line-strong bg-ui-surface-1' : 'border-ui-primary bg-ui-primary text-ui-on-primary'" (click)="$event.stopPropagation(); table.toggleCheckbox(value(), $event)">
|
|
8971
|
+
@if (state() === 'checked') { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M3.5 8.5l3 3 6-6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg> }
|
|
8972
|
+
@else if (state() === 'partial') { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M4 8h8" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg> }
|
|
8973
|
+
</button>
|
|
8745
8974
|
`,
|
|
8746
8975
|
}]
|
|
8747
8976
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
@@ -8749,10 +8978,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8749
8978
|
class SmzTreeTableHeaderCheckboxComponent {
|
|
8750
8979
|
table = inject(SmzTreeTableComponent);
|
|
8751
8980
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableHeaderCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8752
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzTreeTableHeaderCheckboxComponent, isStandalone: true, selector: "ui-tree-table-header-checkbox", host: { classAttribute: "inline-flex align-middle" }, ngImport: i0, template: `
|
|
8753
|
-
<button type="button" role="checkbox" [attr.aria-checked]="table.allSelected()" class="inline-flex h-5 w-5 items-center justify-center rounded border transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class]="table.allSelected() ? 'border-ui-primary bg-ui-primary text-ui-on-primary' : 'border-ui-line-strong bg-ui-surface-1'" (click)="table.toggleAll(!table.allSelected())">
|
|
8754
|
-
@if (table.allSelected()) { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M3.5 8.5l3 3 6-6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg> }
|
|
8755
|
-
</button>
|
|
8981
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzTreeTableHeaderCheckboxComponent, isStandalone: true, selector: "ui-tree-table-header-checkbox", host: { classAttribute: "inline-flex align-middle" }, ngImport: i0, template: `
|
|
8982
|
+
<button type="button" role="checkbox" [attr.aria-checked]="table.allSelected()" class="inline-flex h-5 w-5 items-center justify-center rounded border transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class]="table.allSelected() ? 'border-ui-primary bg-ui-primary text-ui-on-primary' : 'border-ui-line-strong bg-ui-surface-1'" (click)="table.toggleAll(!table.allSelected())">
|
|
8983
|
+
@if (table.allSelected()) { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M3.5 8.5l3 3 6-6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg> }
|
|
8984
|
+
</button>
|
|
8756
8985
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8757
8986
|
}
|
|
8758
8987
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableHeaderCheckboxComponent, decorators: [{
|
|
@@ -8761,10 +8990,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8761
8990
|
selector: 'ui-tree-table-header-checkbox',
|
|
8762
8991
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8763
8992
|
host: { class: 'inline-flex align-middle' },
|
|
8764
|
-
template: `
|
|
8765
|
-
<button type="button" role="checkbox" [attr.aria-checked]="table.allSelected()" class="inline-flex h-5 w-5 items-center justify-center rounded border transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class]="table.allSelected() ? 'border-ui-primary bg-ui-primary text-ui-on-primary' : 'border-ui-line-strong bg-ui-surface-1'" (click)="table.toggleAll(!table.allSelected())">
|
|
8766
|
-
@if (table.allSelected()) { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M3.5 8.5l3 3 6-6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg> }
|
|
8767
|
-
</button>
|
|
8993
|
+
template: `
|
|
8994
|
+
<button type="button" role="checkbox" [attr.aria-checked]="table.allSelected()" class="inline-flex h-5 w-5 items-center justify-center rounded border transition-colors duration-ui focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [class]="table.allSelected() ? 'border-ui-primary bg-ui-primary text-ui-on-primary' : 'border-ui-line-strong bg-ui-surface-1'" (click)="table.toggleAll(!table.allSelected())">
|
|
8995
|
+
@if (table.allSelected()) { <svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M3.5 8.5l3 3 6-6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg> }
|
|
8996
|
+
</button>
|
|
8768
8997
|
`,
|
|
8769
8998
|
}]
|
|
8770
8999
|
}] });
|
|
@@ -8792,11 +9021,11 @@ class SmzTreeTableSortIconComponent {
|
|
|
8792
9021
|
return this.table.sortField() === this.field() ? this.table.sortOrder() : 0;
|
|
8793
9022
|
}
|
|
8794
9023
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableSortIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8795
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzTreeTableSortIconComponent, isStandalone: true, selector: "ui-tree-table-sort-icon", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "ml-1 inline-flex align-middle text-ui-fg-muted" }, ngImport: i0, template: `
|
|
8796
|
-
<svg viewBox="0 0 16 16" class="h-3.5 w-3.5" fill="none" aria-hidden="true">
|
|
8797
|
-
<path d="M5 6l3-3 3 3" [attr.stroke]="dir() === 1 ? 'rgb(var(--smz-color-primary))' : 'currentColor'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
8798
|
-
<path d="M5 10l3 3 3-3" [attr.stroke]="dir() === -1 ? 'rgb(var(--smz-color-primary))' : 'currentColor'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
8799
|
-
</svg>
|
|
9024
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzTreeTableSortIconComponent, isStandalone: true, selector: "ui-tree-table-sort-icon", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "ml-1 inline-flex align-middle text-ui-fg-muted" }, ngImport: i0, template: `
|
|
9025
|
+
<svg viewBox="0 0 16 16" class="h-3.5 w-3.5" fill="none" aria-hidden="true">
|
|
9026
|
+
<path d="M5 6l3-3 3 3" [attr.stroke]="dir() === 1 ? 'rgb(var(--smz-color-primary))' : 'currentColor'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
9027
|
+
<path d="M5 10l3 3 3-3" [attr.stroke]="dir() === -1 ? 'rgb(var(--smz-color-primary))' : 'currentColor'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
9028
|
+
</svg>
|
|
8800
9029
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8801
9030
|
}
|
|
8802
9031
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableSortIconComponent, decorators: [{
|
|
@@ -8805,11 +9034,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8805
9034
|
selector: 'ui-tree-table-sort-icon',
|
|
8806
9035
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8807
9036
|
host: { class: 'ml-1 inline-flex align-middle text-ui-fg-muted' },
|
|
8808
|
-
template: `
|
|
8809
|
-
<svg viewBox="0 0 16 16" class="h-3.5 w-3.5" fill="none" aria-hidden="true">
|
|
8810
|
-
<path d="M5 6l3-3 3 3" [attr.stroke]="dir() === 1 ? 'rgb(var(--smz-color-primary))' : 'currentColor'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
8811
|
-
<path d="M5 10l3 3 3-3" [attr.stroke]="dir() === -1 ? 'rgb(var(--smz-color-primary))' : 'currentColor'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
8812
|
-
</svg>
|
|
9037
|
+
template: `
|
|
9038
|
+
<svg viewBox="0 0 16 16" class="h-3.5 w-3.5" fill="none" aria-hidden="true">
|
|
9039
|
+
<path d="M5 6l3-3 3 3" [attr.stroke]="dir() === 1 ? 'rgb(var(--smz-color-primary))' : 'currentColor'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
9040
|
+
<path d="M5 10l3 3 3-3" [attr.stroke]="dir() === -1 ? 'rgb(var(--smz-color-primary))' : 'currentColor'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
9041
|
+
</svg>
|
|
8813
9042
|
`,
|
|
8814
9043
|
}]
|
|
8815
9044
|
}], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }] } });
|
|
@@ -8985,31 +9214,31 @@ class SmzFileUploadComponent {
|
|
|
8985
9214
|
});
|
|
8986
9215
|
}
|
|
8987
9216
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8988
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzFileUploadComponent, isStandalone: true, selector: "ui-file-upload", inputs: { accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, chooseLabel: { classPropertyName: "chooseLabel", publicName: "chooseLabel", isSignal: true, isRequired: false, transformFunction: null }, dropLabel: { classPropertyName: "dropLabel", publicName: "dropLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected", removed: "removed", rejected: "rejected" }, host: { classAttribute: "block font-ui text-ui-md text-ui-fg" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["picker"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
8989
|
-
<input #picker type="file" class="sr-only" [accept]="accept() ?? ''" [multiple]="multiple()" [disabled]="disabled()" (change)="onPick($event)" />
|
|
8990
|
-
<div
|
|
8991
|
-
class="flex flex-col items-center justify-center gap-2 rounded-card border-2 border-dashed p-6 text-center transition-colors duration-ui"
|
|
8992
|
-
[class]="dragging() ? 'border-ui-primary bg-ui-primary/10' : 'border-ui-line-strong bg-ui-surface-1'"
|
|
8993
|
-
[class.opacity-50]="disabled()"
|
|
8994
|
-
(dragover)="onDragOver($event)"
|
|
8995
|
-
(dragleave)="dragging.set(false)"
|
|
8996
|
-
(drop)="onDrop($event)"
|
|
8997
|
-
>
|
|
8998
|
-
<button type="button" class="rounded-control border border-ui-line-strong px-control-x py-2 font-medium transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus disabled:pointer-events-none" [disabled]="disabled()" (click)="picker.click()">{{ chooseLabel() }}</button>
|
|
8999
|
-
<span class="text-ui-sm text-ui-fg-muted">{{ dropLabel() }}</span>
|
|
9000
|
-
</div>
|
|
9001
|
-
@if (files().length > 0) {
|
|
9002
|
-
<ul class="m-0 mt-3 flex list-none flex-col gap-2 p-0">
|
|
9003
|
-
@for (file of files(); track file) {
|
|
9004
|
-
<li class="flex items-center justify-between gap-2 rounded-control border border-ui-line px-3 py-2">
|
|
9005
|
-
<span class="min-w-0 flex-1 truncate">{{ file.name }} <span class="text-ui-sm text-ui-fg-muted">({{ size(file) }})</span></span>
|
|
9006
|
-
<button type="button" class="inline-flex h-6 w-6 items-center justify-center rounded-full text-ui-fg-muted hover:bg-ui-surface-3" aria-label="Remover" (click)="remove(file)">
|
|
9007
|
-
<svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" /></svg>
|
|
9008
|
-
</button>
|
|
9009
|
-
</li>
|
|
9010
|
-
}
|
|
9011
|
-
</ul>
|
|
9012
|
-
}
|
|
9217
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzFileUploadComponent, isStandalone: true, selector: "ui-file-upload", inputs: { accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, chooseLabel: { classPropertyName: "chooseLabel", publicName: "chooseLabel", isSignal: true, isRequired: false, transformFunction: null }, dropLabel: { classPropertyName: "dropLabel", publicName: "dropLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected", removed: "removed", rejected: "rejected" }, host: { classAttribute: "block font-ui text-ui-md text-ui-fg" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["picker"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
9218
|
+
<input #picker type="file" class="sr-only" [accept]="accept() ?? ''" [multiple]="multiple()" [disabled]="disabled()" (change)="onPick($event)" />
|
|
9219
|
+
<div
|
|
9220
|
+
class="flex flex-col items-center justify-center gap-2 rounded-card border-2 border-dashed p-6 text-center transition-colors duration-ui"
|
|
9221
|
+
[class]="dragging() ? 'border-ui-primary bg-ui-primary/10' : 'border-ui-line-strong bg-ui-surface-1'"
|
|
9222
|
+
[class.opacity-50]="disabled()"
|
|
9223
|
+
(dragover)="onDragOver($event)"
|
|
9224
|
+
(dragleave)="dragging.set(false)"
|
|
9225
|
+
(drop)="onDrop($event)"
|
|
9226
|
+
>
|
|
9227
|
+
<button type="button" class="rounded-control border border-ui-line-strong px-control-x py-2 font-medium transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus disabled:pointer-events-none" [disabled]="disabled()" (click)="picker.click()">{{ chooseLabel() }}</button>
|
|
9228
|
+
<span class="text-ui-sm text-ui-fg-muted">{{ dropLabel() }}</span>
|
|
9229
|
+
</div>
|
|
9230
|
+
@if (files().length > 0) {
|
|
9231
|
+
<ul class="m-0 mt-3 flex list-none flex-col gap-2 p-0">
|
|
9232
|
+
@for (file of files(); track file) {
|
|
9233
|
+
<li class="flex items-center justify-between gap-2 rounded-control border border-ui-line px-3 py-2">
|
|
9234
|
+
<span class="min-w-0 flex-1 truncate">{{ file.name }} <span class="text-ui-sm text-ui-fg-muted">({{ size(file) }})</span></span>
|
|
9235
|
+
<button type="button" class="inline-flex h-6 w-6 items-center justify-center rounded-full text-ui-fg-muted hover:bg-ui-surface-3" aria-label="Remover" (click)="remove(file)">
|
|
9236
|
+
<svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" /></svg>
|
|
9237
|
+
</button>
|
|
9238
|
+
</li>
|
|
9239
|
+
}
|
|
9240
|
+
</ul>
|
|
9241
|
+
}
|
|
9013
9242
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9014
9243
|
}
|
|
9015
9244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFileUploadComponent, decorators: [{
|
|
@@ -9018,31 +9247,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
9018
9247
|
selector: 'ui-file-upload',
|
|
9019
9248
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9020
9249
|
host: { class: 'block font-ui text-ui-md text-ui-fg' },
|
|
9021
|
-
template: `
|
|
9022
|
-
<input #picker type="file" class="sr-only" [accept]="accept() ?? ''" [multiple]="multiple()" [disabled]="disabled()" (change)="onPick($event)" />
|
|
9023
|
-
<div
|
|
9024
|
-
class="flex flex-col items-center justify-center gap-2 rounded-card border-2 border-dashed p-6 text-center transition-colors duration-ui"
|
|
9025
|
-
[class]="dragging() ? 'border-ui-primary bg-ui-primary/10' : 'border-ui-line-strong bg-ui-surface-1'"
|
|
9026
|
-
[class.opacity-50]="disabled()"
|
|
9027
|
-
(dragover)="onDragOver($event)"
|
|
9028
|
-
(dragleave)="dragging.set(false)"
|
|
9029
|
-
(drop)="onDrop($event)"
|
|
9030
|
-
>
|
|
9031
|
-
<button type="button" class="rounded-control border border-ui-line-strong px-control-x py-2 font-medium transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus disabled:pointer-events-none" [disabled]="disabled()" (click)="picker.click()">{{ chooseLabel() }}</button>
|
|
9032
|
-
<span class="text-ui-sm text-ui-fg-muted">{{ dropLabel() }}</span>
|
|
9033
|
-
</div>
|
|
9034
|
-
@if (files().length > 0) {
|
|
9035
|
-
<ul class="m-0 mt-3 flex list-none flex-col gap-2 p-0">
|
|
9036
|
-
@for (file of files(); track file) {
|
|
9037
|
-
<li class="flex items-center justify-between gap-2 rounded-control border border-ui-line px-3 py-2">
|
|
9038
|
-
<span class="min-w-0 flex-1 truncate">{{ file.name }} <span class="text-ui-sm text-ui-fg-muted">({{ size(file) }})</span></span>
|
|
9039
|
-
<button type="button" class="inline-flex h-6 w-6 items-center justify-center rounded-full text-ui-fg-muted hover:bg-ui-surface-3" aria-label="Remover" (click)="remove(file)">
|
|
9040
|
-
<svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" /></svg>
|
|
9041
|
-
</button>
|
|
9042
|
-
</li>
|
|
9043
|
-
}
|
|
9044
|
-
</ul>
|
|
9045
|
-
}
|
|
9250
|
+
template: `
|
|
9251
|
+
<input #picker type="file" class="sr-only" [accept]="accept() ?? ''" [multiple]="multiple()" [disabled]="disabled()" (change)="onPick($event)" />
|
|
9252
|
+
<div
|
|
9253
|
+
class="flex flex-col items-center justify-center gap-2 rounded-card border-2 border-dashed p-6 text-center transition-colors duration-ui"
|
|
9254
|
+
[class]="dragging() ? 'border-ui-primary bg-ui-primary/10' : 'border-ui-line-strong bg-ui-surface-1'"
|
|
9255
|
+
[class.opacity-50]="disabled()"
|
|
9256
|
+
(dragover)="onDragOver($event)"
|
|
9257
|
+
(dragleave)="dragging.set(false)"
|
|
9258
|
+
(drop)="onDrop($event)"
|
|
9259
|
+
>
|
|
9260
|
+
<button type="button" class="rounded-control border border-ui-line-strong px-control-x py-2 font-medium transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus disabled:pointer-events-none" [disabled]="disabled()" (click)="picker.click()">{{ chooseLabel() }}</button>
|
|
9261
|
+
<span class="text-ui-sm text-ui-fg-muted">{{ dropLabel() }}</span>
|
|
9262
|
+
</div>
|
|
9263
|
+
@if (files().length > 0) {
|
|
9264
|
+
<ul class="m-0 mt-3 flex list-none flex-col gap-2 p-0">
|
|
9265
|
+
@for (file of files(); track file) {
|
|
9266
|
+
<li class="flex items-center justify-between gap-2 rounded-control border border-ui-line px-3 py-2">
|
|
9267
|
+
<span class="min-w-0 flex-1 truncate">{{ file.name }} <span class="text-ui-sm text-ui-fg-muted">({{ size(file) }})</span></span>
|
|
9268
|
+
<button type="button" class="inline-flex h-6 w-6 items-center justify-center rounded-full text-ui-fg-muted hover:bg-ui-surface-3" aria-label="Remover" (click)="remove(file)">
|
|
9269
|
+
<svg viewBox="0 0 16 16" class="h-3 w-3" fill="none" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" /></svg>
|
|
9270
|
+
</button>
|
|
9271
|
+
</li>
|
|
9272
|
+
}
|
|
9273
|
+
</ul>
|
|
9274
|
+
}
|
|
9046
9275
|
`,
|
|
9047
9276
|
}]
|
|
9048
9277
|
}], propDecorators: { accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], chooseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "chooseLabel", required: false }] }], dropLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropLabel", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], removed: [{ type: i0.Output, args: ["removed"] }], rejected: [{ type: i0.Output, args: ["rejected"] }], fileInput: [{ type: i0.ViewChild, args: ['picker', { isSignal: true }] }] } });
|