@ngx-smz/ui-kit 21.9.0-next.1 → 21.9.0-next.10
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 +1441 -98
- package/fesm2022/ngx-smz-ui-kit.mjs.map +1 -1
- package/package.json +9 -4
- package/tailwind.preset.js +2 -0
- package/themes/default.css +3 -0
- package/types/ngx-smz-ui-kit.d.ts +424 -12
|
@@ -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 } from '@angular/core';
|
|
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' },
|
|
@@ -606,22 +609,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
606
609
|
}] });
|
|
607
610
|
|
|
608
611
|
const base = 'w-full border bg-ui-surface-1 font-ui text-ui-fg placeholder:text-ui-fg-subtle transition-colors duration-ui ' +
|
|
609
|
-
'focus:outline-none focus:ring-
|
|
612
|
+
'focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger';
|
|
610
613
|
const invalidVariant = { true: 'border-ui-danger', false: 'border-ui-line-strong' };
|
|
611
614
|
const inputClasses = smzVariants({
|
|
612
615
|
base: `${base} rounded-control`,
|
|
613
616
|
variants: {
|
|
614
617
|
size: {
|
|
615
|
-
sm: 'h-control-sm px-
|
|
616
|
-
md: 'h-control px-
|
|
617
|
-
lg: 'h-control-lg px-
|
|
618
|
+
sm: 'h-control-sm px-input-x-sm text-ui-sm',
|
|
619
|
+
md: 'h-control px-input-x text-ui-md',
|
|
620
|
+
lg: 'h-control-lg px-input-x-lg text-ui-lg',
|
|
618
621
|
},
|
|
619
622
|
invalid: invalidVariant,
|
|
620
623
|
},
|
|
621
624
|
defaults: { size: 'md', invalid: 'false' },
|
|
622
625
|
});
|
|
623
626
|
const textareaClasses = smzVariants({
|
|
624
|
-
base: `${base} min-h-control rounded-control px-
|
|
627
|
+
base: `${base} min-h-control rounded-control px-input-x py-2 text-ui-md`,
|
|
625
628
|
variants: { invalid: invalidVariant },
|
|
626
629
|
defaults: { invalid: 'false' },
|
|
627
630
|
});
|
|
@@ -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;
|
|
@@ -3064,6 +3176,10 @@ class SmzSelectComponent extends SmzValueAccessor {
|
|
|
3064
3176
|
dataKey: this.dataKey(),
|
|
3065
3177
|
}), ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
3066
3178
|
visibleOptions = computed(() => filterOptions(this.options() ?? [], this.filterText(), { ...this.config(), filterBy: this.filterBy(), mode: this.filterMatchMode() }), ...(ngDevMode ? [{ debugName: "visibleOptions" }] : []));
|
|
3179
|
+
/** Templates opcionais: `item` (linha da lista) e `selectedItem` (valor exibido no campo), como no `p-select`. */
|
|
3180
|
+
templates = contentChildren(SmzTemplateDirective, ...(ngDevMode ? [{ debugName: "templates" }] : []));
|
|
3181
|
+
itemTemplate = computed(() => smzFindTemplate(this.templates(), 'item'), ...(ngDevMode ? [{ debugName: "itemTemplate" }] : []));
|
|
3182
|
+
selectedItemTemplate = computed(() => smzFindTemplate(this.templates(), 'selectedItem'), ...(ngDevMode ? [{ debugName: "selectedItemTemplate" }] : []));
|
|
3067
3183
|
hasValue = computed(() => this.selectedOption() !== undefined, ...(ngDevMode ? [{ debugName: "hasValue" }] : []));
|
|
3068
3184
|
selectedOption = computed(() => {
|
|
3069
3185
|
const current = this.current();
|
|
@@ -3234,13 +3350,13 @@ class SmzSelectComponent extends SmzValueAccessor {
|
|
|
3234
3350
|
}
|
|
3235
3351
|
}
|
|
3236
3352
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3237
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzSelectComponent, isStandalone: true, selector: "ui-select", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, filterMatchMode: { classPropertyName: "filterMatchMode", publicName: "filterMatchMode", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterMessage: { classPropertyName: "emptyFilterMessage", publicName: "emptyFilterMessage", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed", showed: "showed", hidden: "hidden" }, host: { classAttribute: "block min-w-0" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzSelectComponent), multi: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3353
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzSelectComponent, isStandalone: true, selector: "ui-select", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, filterMatchMode: { classPropertyName: "filterMatchMode", publicName: "filterMatchMode", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterMessage: { classPropertyName: "emptyFilterMessage", publicName: "emptyFilterMessage", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed", showed: "showed", hidden: "hidden" }, host: { classAttribute: "block min-w-0" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzSelectComponent), multi: true }], queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3238
3354
|
<button
|
|
3239
3355
|
#trigger
|
|
3240
3356
|
type="button"
|
|
3241
3357
|
role="combobox"
|
|
3242
3358
|
aria-haspopup="listbox"
|
|
3243
|
-
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
3359
|
+
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x text-left font-ui text-ui-md text-ui-fg transition-colors duration-ui focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
3244
3360
|
[ngClass]="styleClass()"
|
|
3245
3361
|
[id]="inputId() || null"
|
|
3246
3362
|
[attr.aria-expanded]="open()"
|
|
@@ -3252,7 +3368,13 @@ class SmzSelectComponent extends SmzValueAccessor {
|
|
|
3252
3368
|
(keydown)="onKeydown($event)"
|
|
3253
3369
|
(blur)="onBlur()"
|
|
3254
3370
|
>
|
|
3255
|
-
<span class="min-w-0 flex-1 truncate" [class.text-ui-fg-subtle]="!hasValue()">
|
|
3371
|
+
<span class="min-w-0 flex-1 truncate" [class.text-ui-fg-subtle]="!hasValue()">
|
|
3372
|
+
@if (hasValue() && selectedItemTemplate(); as tpl) {
|
|
3373
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: selectedOption() }" />
|
|
3374
|
+
} @else {
|
|
3375
|
+
{{ displayLabel() }}
|
|
3376
|
+
}
|
|
3377
|
+
</span>
|
|
3256
3378
|
@if (showClear() && hasValue() && !isDisabled()) {
|
|
3257
3379
|
<span
|
|
3258
3380
|
role="button"
|
|
@@ -3301,7 +3423,11 @@ class SmzSelectComponent extends SmzValueAccessor {
|
|
|
3301
3423
|
(mouseenter)="activeIndex.set(index)"
|
|
3302
3424
|
(click)="select(option, $event)"
|
|
3303
3425
|
>
|
|
3304
|
-
|
|
3426
|
+
@if (itemTemplate(); as tpl) {
|
|
3427
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: option, index: index }" />
|
|
3428
|
+
} @else {
|
|
3429
|
+
{{ labelOf(option) }}
|
|
3430
|
+
}
|
|
3305
3431
|
</li>
|
|
3306
3432
|
}
|
|
3307
3433
|
@empty {
|
|
@@ -3310,14 +3436,14 @@ class SmzSelectComponent extends SmzValueAccessor {
|
|
|
3310
3436
|
</ul>
|
|
3311
3437
|
</div>
|
|
3312
3438
|
</ng-template>
|
|
3313
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: SmzInputTextDirective, selector: "input[smzInputText]", inputs: ["size", "invalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3439
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SmzInputTextDirective, selector: "input[smzInputText]", inputs: ["size", "invalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3314
3440
|
}
|
|
3315
3441
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzSelectComponent, decorators: [{
|
|
3316
3442
|
type: Component,
|
|
3317
3443
|
args: [{
|
|
3318
3444
|
selector: 'ui-select',
|
|
3319
3445
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3320
|
-
imports: [NgClass, SmzInputTextDirective],
|
|
3446
|
+
imports: [NgClass, NgTemplateOutlet, SmzInputTextDirective],
|
|
3321
3447
|
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzSelectComponent), multi: true }],
|
|
3322
3448
|
host: { class: 'block min-w-0' },
|
|
3323
3449
|
template: `
|
|
@@ -3326,7 +3452,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3326
3452
|
type="button"
|
|
3327
3453
|
role="combobox"
|
|
3328
3454
|
aria-haspopup="listbox"
|
|
3329
|
-
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
3455
|
+
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x text-left font-ui text-ui-md text-ui-fg transition-colors duration-ui focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
3330
3456
|
[ngClass]="styleClass()"
|
|
3331
3457
|
[id]="inputId() || null"
|
|
3332
3458
|
[attr.aria-expanded]="open()"
|
|
@@ -3338,7 +3464,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3338
3464
|
(keydown)="onKeydown($event)"
|
|
3339
3465
|
(blur)="onBlur()"
|
|
3340
3466
|
>
|
|
3341
|
-
<span class="min-w-0 flex-1 truncate" [class.text-ui-fg-subtle]="!hasValue()">
|
|
3467
|
+
<span class="min-w-0 flex-1 truncate" [class.text-ui-fg-subtle]="!hasValue()">
|
|
3468
|
+
@if (hasValue() && selectedItemTemplate(); as tpl) {
|
|
3469
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: selectedOption() }" />
|
|
3470
|
+
} @else {
|
|
3471
|
+
{{ displayLabel() }}
|
|
3472
|
+
}
|
|
3473
|
+
</span>
|
|
3342
3474
|
@if (showClear() && hasValue() && !isDisabled()) {
|
|
3343
3475
|
<span
|
|
3344
3476
|
role="button"
|
|
@@ -3387,7 +3519,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3387
3519
|
(mouseenter)="activeIndex.set(index)"
|
|
3388
3520
|
(click)="select(option, $event)"
|
|
3389
3521
|
>
|
|
3390
|
-
|
|
3522
|
+
@if (itemTemplate(); as tpl) {
|
|
3523
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: option, index: index }" />
|
|
3524
|
+
} @else {
|
|
3525
|
+
{{ labelOf(option) }}
|
|
3526
|
+
}
|
|
3391
3527
|
</li>
|
|
3392
3528
|
}
|
|
3393
3529
|
@empty {
|
|
@@ -3398,7 +3534,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3398
3534
|
</ng-template>
|
|
3399
3535
|
`,
|
|
3400
3536
|
}]
|
|
3401
|
-
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterBy", required: false }] }], filterMatchMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMatchMode", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], emptyFilterMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterMessage", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }], showed: [{ type: i0.Output, args: ["showed"] }], hidden: [{ type: i0.Output, args: ["hidden"] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], filterInput: [{ type: i0.ViewChild, args: ['filterInput', { isSignal: true }] }] } });
|
|
3537
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterBy", required: false }] }], filterMatchMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMatchMode", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], emptyFilterMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterMessage", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }], showed: [{ type: i0.Output, args: ["showed"] }], hidden: [{ type: i0.Output, args: ["hidden"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzTemplateDirective), { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], filterInput: [{ type: i0.ViewChild, args: ['filterInput', { isSignal: true }] }] } });
|
|
3402
3538
|
|
|
3403
3539
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-unsafe-return, max-len */
|
|
3404
3540
|
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
@@ -3447,6 +3583,10 @@ class SmzMultiSelectComponent extends SmzValueAccessor {
|
|
|
3447
3583
|
dataKey: this.dataKey(),
|
|
3448
3584
|
}), ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
3449
3585
|
visibleOptions = computed(() => filterOptions(this.options() ?? [], this.filterText(), { ...this.config(), filterBy: this.filterBy(), mode: this.filterMatchMode() }), ...(ngDevMode ? [{ debugName: "visibleOptions" }] : []));
|
|
3586
|
+
/** Templates opcionais: `item` (linha da lista) e `selectedItems` (valor exibido no campo; `$implicit` = valores selecionados), como no `p-multiselect`. */
|
|
3587
|
+
templates = contentChildren(SmzTemplateDirective, ...(ngDevMode ? [{ debugName: "templates" }] : []));
|
|
3588
|
+
itemTemplate = computed(() => smzFindTemplate(this.templates(), 'item'), ...(ngDevMode ? [{ debugName: "itemTemplate" }] : []));
|
|
3589
|
+
selectedItemsTemplate = computed(() => smzFindTemplate(this.templates(), 'selectedItems'), ...(ngDevMode ? [{ debugName: "selectedItemsTemplate" }] : []));
|
|
3450
3590
|
selectedValues = computed(() => (Array.isArray(this.current()) ? this.current() : []), ...(ngDevMode ? [{ debugName: "selectedValues" }] : []));
|
|
3451
3591
|
selectedOptions = computed(() => (this.options() ?? []).filter((option) => this.selectedValues().some((value) => sameValue(optionValue(option, this.config()), value, this.dataKey()))), ...(ngDevMode ? [{ debugName: "selectedOptions" }] : []));
|
|
3452
3592
|
allSelected = computed(() => {
|
|
@@ -3481,7 +3621,9 @@ class SmzMultiSelectComponent extends SmzValueAccessor {
|
|
|
3481
3621
|
optionRowClass(option, index) {
|
|
3482
3622
|
if (optionDisabled(option, this.config()))
|
|
3483
3623
|
return 'opacity-50 cursor-not-allowed';
|
|
3484
|
-
|
|
3624
|
+
if (this.activeIndex() === index)
|
|
3625
|
+
return 'bg-ui-surface-3';
|
|
3626
|
+
return this.selectedValues().length > 0 && this.isSelected(option) ? 'bg-ui-primary/10' : '';
|
|
3485
3627
|
}
|
|
3486
3628
|
toggle() {
|
|
3487
3629
|
if (this.open())
|
|
@@ -3587,13 +3729,13 @@ class SmzMultiSelectComponent extends SmzValueAccessor {
|
|
|
3587
3729
|
this.touch();
|
|
3588
3730
|
}
|
|
3589
3731
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzMultiSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3590
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzMultiSelectComponent, isStandalone: true, selector: "ui-multi-select", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, filterMatchMode: { classPropertyName: "filterMatchMode", publicName: "filterMatchMode", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, showToggleAll: { classPropertyName: "showToggleAll", publicName: "showToggleAll", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterMessage: { classPropertyName: "emptyFilterMessage", publicName: "emptyFilterMessage", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedLabels: { classPropertyName: "maxSelectedLabels", publicName: "maxSelectedLabels", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsLabel: { classPropertyName: "selectedItemsLabel", publicName: "selectedItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, panelStyle: { classPropertyName: "panelStyle", publicName: "panelStyle", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, autofocusFilter: { classPropertyName: "autofocusFilter", publicName: "autofocusFilter", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed", panelHide: "panelHide", panelShow: "panelShow" }, host: { classAttribute: "block min-w-0" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzMultiSelectComponent), multi: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3732
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzMultiSelectComponent, isStandalone: true, selector: "ui-multi-select", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, filterMatchMode: { classPropertyName: "filterMatchMode", publicName: "filterMatchMode", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, showToggleAll: { classPropertyName: "showToggleAll", publicName: "showToggleAll", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterMessage: { classPropertyName: "emptyFilterMessage", publicName: "emptyFilterMessage", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedLabels: { classPropertyName: "maxSelectedLabels", publicName: "maxSelectedLabels", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsLabel: { classPropertyName: "selectedItemsLabel", publicName: "selectedItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, panelStyle: { classPropertyName: "panelStyle", publicName: "panelStyle", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, autofocusFilter: { classPropertyName: "autofocusFilter", publicName: "autofocusFilter", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed", panelHide: "panelHide", panelShow: "panelShow" }, host: { classAttribute: "block min-w-0" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzMultiSelectComponent), multi: true }], queries: [{ propertyName: "templates", predicate: SmzTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3591
3733
|
<button
|
|
3592
3734
|
#trigger
|
|
3593
3735
|
type="button"
|
|
3594
3736
|
role="combobox"
|
|
3595
3737
|
aria-haspopup="listbox"
|
|
3596
|
-
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
3738
|
+
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x text-left font-ui text-ui-md text-ui-fg transition-colors duration-ui focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
3597
3739
|
[ngClass]="styleClass()"
|
|
3598
3740
|
[id]="inputId() || null"
|
|
3599
3741
|
[attr.aria-expanded]="open()"
|
|
@@ -3603,7 +3745,13 @@ class SmzMultiSelectComponent extends SmzValueAccessor {
|
|
|
3603
3745
|
(keydown)="onKeydown($event)"
|
|
3604
3746
|
(blur)="onBlur()"
|
|
3605
3747
|
>
|
|
3606
|
-
<span class="min-w-0 flex-1 truncate" [class.text-ui-fg-subtle]="selectedOptions().length === 0">
|
|
3748
|
+
<span class="min-w-0 flex-1 truncate" [class.text-ui-fg-subtle]="selectedOptions().length === 0">
|
|
3749
|
+
@if (selectedOptions().length > 0 && selectedItemsTemplate(); as tpl) {
|
|
3750
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: selectedValues(), options: selectedOptions() }" />
|
|
3751
|
+
} @else {
|
|
3752
|
+
{{ displayLabel() }}
|
|
3753
|
+
}
|
|
3754
|
+
</span>
|
|
3607
3755
|
@if (showClear() && selectedOptions().length > 0 && !isDisabled()) {
|
|
3608
3756
|
<span
|
|
3609
3757
|
role="button"
|
|
@@ -3673,7 +3821,13 @@ class SmzMultiSelectComponent extends SmzValueAccessor {
|
|
|
3673
3821
|
<path d="M3 8.5l3.2 3L13 4.5" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />
|
|
3674
3822
|
</svg>
|
|
3675
3823
|
</span>
|
|
3676
|
-
<span class="min-w-0 flex-1 truncate">
|
|
3824
|
+
<span class="min-w-0 flex-1 truncate">
|
|
3825
|
+
@if (itemTemplate(); as tpl) {
|
|
3826
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: option, index: index }" />
|
|
3827
|
+
} @else {
|
|
3828
|
+
{{ labelOf(option) }}
|
|
3829
|
+
}
|
|
3830
|
+
</span>
|
|
3677
3831
|
</li>
|
|
3678
3832
|
}
|
|
3679
3833
|
@empty {
|
|
@@ -3682,14 +3836,14 @@ class SmzMultiSelectComponent extends SmzValueAccessor {
|
|
|
3682
3836
|
</ul>
|
|
3683
3837
|
</div>
|
|
3684
3838
|
</ng-template>
|
|
3685
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: SmzInputTextDirective, selector: "input[smzInputText]", inputs: ["size", "invalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3839
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SmzInputTextDirective, selector: "input[smzInputText]", inputs: ["size", "invalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3686
3840
|
}
|
|
3687
3841
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzMultiSelectComponent, decorators: [{
|
|
3688
3842
|
type: Component,
|
|
3689
3843
|
args: [{
|
|
3690
3844
|
selector: 'ui-multi-select',
|
|
3691
3845
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3692
|
-
imports: [NgClass, NgStyle, SmzInputTextDirective],
|
|
3846
|
+
imports: [NgClass, NgStyle, NgTemplateOutlet, SmzInputTextDirective],
|
|
3693
3847
|
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzMultiSelectComponent), multi: true }],
|
|
3694
3848
|
host: { class: 'block min-w-0' },
|
|
3695
3849
|
template: `
|
|
@@ -3698,7 +3852,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3698
3852
|
type="button"
|
|
3699
3853
|
role="combobox"
|
|
3700
3854
|
aria-haspopup="listbox"
|
|
3701
|
-
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
3855
|
+
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x text-left font-ui text-ui-md text-ui-fg transition-colors duration-ui focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
3702
3856
|
[ngClass]="styleClass()"
|
|
3703
3857
|
[id]="inputId() || null"
|
|
3704
3858
|
[attr.aria-expanded]="open()"
|
|
@@ -3708,7 +3862,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3708
3862
|
(keydown)="onKeydown($event)"
|
|
3709
3863
|
(blur)="onBlur()"
|
|
3710
3864
|
>
|
|
3711
|
-
<span class="min-w-0 flex-1 truncate" [class.text-ui-fg-subtle]="selectedOptions().length === 0">
|
|
3865
|
+
<span class="min-w-0 flex-1 truncate" [class.text-ui-fg-subtle]="selectedOptions().length === 0">
|
|
3866
|
+
@if (selectedOptions().length > 0 && selectedItemsTemplate(); as tpl) {
|
|
3867
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: selectedValues(), options: selectedOptions() }" />
|
|
3868
|
+
} @else {
|
|
3869
|
+
{{ displayLabel() }}
|
|
3870
|
+
}
|
|
3871
|
+
</span>
|
|
3712
3872
|
@if (showClear() && selectedOptions().length > 0 && !isDisabled()) {
|
|
3713
3873
|
<span
|
|
3714
3874
|
role="button"
|
|
@@ -3778,7 +3938,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3778
3938
|
<path d="M3 8.5l3.2 3L13 4.5" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />
|
|
3779
3939
|
</svg>
|
|
3780
3940
|
</span>
|
|
3781
|
-
<span class="min-w-0 flex-1 truncate">
|
|
3941
|
+
<span class="min-w-0 flex-1 truncate">
|
|
3942
|
+
@if (itemTemplate(); as tpl) {
|
|
3943
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: option, index: index }" />
|
|
3944
|
+
} @else {
|
|
3945
|
+
{{ labelOf(option) }}
|
|
3946
|
+
}
|
|
3947
|
+
</span>
|
|
3782
3948
|
</li>
|
|
3783
3949
|
}
|
|
3784
3950
|
@empty {
|
|
@@ -3789,7 +3955,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3789
3955
|
</ng-template>
|
|
3790
3956
|
`,
|
|
3791
3957
|
}]
|
|
3792
|
-
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterBy", required: false }] }], filterMatchMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMatchMode", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], showToggleAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToggleAll", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], emptyFilterMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterMessage", required: false }] }], maxSelectedLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelectedLabels", required: false }] }], selectedItemsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemsLabel", required: false }] }], panelStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelStyle", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], autofocusFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocusFilter", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }], panelHide: [{ type: i0.Output, args: ["panelHide"] }], panelShow: [{ type: i0.Output, args: ["panelShow"] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], filterInput: [{ type: i0.ViewChild, args: ['filterInput', { isSignal: true }] }] } });
|
|
3958
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterBy", required: false }] }], filterMatchMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMatchMode", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], showToggleAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToggleAll", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], emptyFilterMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterMessage", required: false }] }], maxSelectedLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelectedLabels", required: false }] }], selectedItemsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemsLabel", required: false }] }], panelStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelStyle", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], autofocusFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocusFilter", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }], panelHide: [{ type: i0.Output, args: ["panelHide"] }], panelShow: [{ type: i0.Output, args: ["panelShow"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzTemplateDirective), { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], filterInput: [{ type: i0.ViewChild, args: ['filterInput', { isSignal: true }] }] } });
|
|
3793
3959
|
|
|
3794
3960
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-unsafe-return, max-len */
|
|
3795
3961
|
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument */
|
|
@@ -3811,9 +3977,11 @@ class SmzSelectButtonComponent extends SmzValueAccessor {
|
|
|
3811
3977
|
/** Aceito por compatibilidade com o `p-selectbutton`; sem efeito. */
|
|
3812
3978
|
appendTo = input(undefined, ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
3813
3979
|
changed = output();
|
|
3980
|
+
/** Sem `optionLabel`/`optionValue`, opcoes-objeto com `label`/`value` sao lidas automaticamente (como no PrimeNG). */
|
|
3981
|
+
sample = computed(() => (this.options() ?? [])[0], ...(ngDevMode ? [{ debugName: "sample" }] : []));
|
|
3814
3982
|
config = computed(() => ({
|
|
3815
|
-
optionLabel: this.optionLabel(),
|
|
3816
|
-
optionValue: this.optionValue(),
|
|
3983
|
+
optionLabel: this.optionLabel() ?? (typeof this.sample() === 'object' && this.sample() !== null && 'label' in this.sample() ? 'label' : null),
|
|
3984
|
+
optionValue: this.optionValue() ?? (typeof this.sample() === 'object' && this.sample() !== null && 'value' in this.sample() ? 'value' : null),
|
|
3817
3985
|
optionDisabled: this.optionDisabled(),
|
|
3818
3986
|
dataKey: this.dataKey(),
|
|
3819
3987
|
}), ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
@@ -3834,8 +4002,8 @@ class SmzSelectButtonComponent extends SmzValueAccessor {
|
|
|
3834
4002
|
: sameValue(value, current, this.dataKey());
|
|
3835
4003
|
}
|
|
3836
4004
|
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-
|
|
4005
|
+
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)]';
|
|
4006
|
+
const tone = this.isSelected(option) ? 'bg-ui-surface-1 text-ui-fg shadow-card' : 'text-ui-fg-muted hover:text-ui-fg';
|
|
3839
4007
|
return `${size} ${tone}`;
|
|
3840
4008
|
}
|
|
3841
4009
|
toggle(option, event) {
|
|
@@ -3858,11 +4026,11 @@ class SmzSelectButtonComponent extends SmzValueAccessor {
|
|
|
3858
4026
|
}
|
|
3859
4027
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzSelectButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3860
4028
|
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
|
|
4029
|
+
<div role="group" class="inline-flex gap-1 rounded-control bg-ui-surface-3 p-1" [ngClass]="styleClass()">
|
|
3862
4030
|
@for (option of options(); track $index) {
|
|
3863
4031
|
<button
|
|
3864
4032
|
type="button"
|
|
3865
|
-
class="inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap
|
|
4033
|
+
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
4034
|
[class]="buttonClasses(option)"
|
|
3867
4035
|
[attr.aria-pressed]="isSelected(option)"
|
|
3868
4036
|
[disabled]="isDisabled() || isOptionDisabled(option)"
|
|
@@ -3887,11 +4055,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3887
4055
|
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzSelectButtonComponent), multi: true }],
|
|
3888
4056
|
host: { class: 'inline-flex' },
|
|
3889
4057
|
template: `
|
|
3890
|
-
<div role="group" class="inline-flex
|
|
4058
|
+
<div role="group" class="inline-flex gap-1 rounded-control bg-ui-surface-3 p-1" [ngClass]="styleClass()">
|
|
3891
4059
|
@for (option of options(); track $index) {
|
|
3892
4060
|
<button
|
|
3893
4061
|
type="button"
|
|
3894
|
-
class="inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap
|
|
4062
|
+
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
4063
|
[class]="buttonClasses(option)"
|
|
3896
4064
|
[attr.aria-pressed]="isSelected(option)"
|
|
3897
4065
|
[disabled]="isDisabled() || isOptionDisabled(option)"
|
|
@@ -4167,14 +4335,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
4167
4335
|
/** Complemento de um `ui-input-group`. Substitui o `p-inputgroupaddon` do PrimeNG. */
|
|
4168
4336
|
class SmzInputGroupAddonComponent {
|
|
4169
4337
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzInputGroupAddonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4170
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: SmzInputGroupAddonComponent, isStandalone: true, selector: "ui-input-group-addon", host: { classAttribute: "inline-flex items-center rounded-control border border-ui-line-strong bg-ui-surface-3 px-
|
|
4338
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: SmzInputGroupAddonComponent, isStandalone: true, selector: "ui-input-group-addon", host: { classAttribute: "inline-flex items-center rounded-control border border-ui-line-strong bg-ui-surface-3 px-input-x-sm font-ui text-ui-md text-ui-fg-muted" }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4171
4339
|
}
|
|
4172
4340
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzInputGroupAddonComponent, decorators: [{
|
|
4173
4341
|
type: Component,
|
|
4174
4342
|
args: [{
|
|
4175
4343
|
selector: 'ui-input-group-addon',
|
|
4176
4344
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4177
|
-
host: { class: 'inline-flex items-center rounded-control border border-ui-line-strong bg-ui-surface-3 px-
|
|
4345
|
+
host: { class: 'inline-flex items-center rounded-control border border-ui-line-strong bg-ui-surface-3 px-input-x-sm font-ui text-ui-md text-ui-fg-muted' },
|
|
4178
4346
|
template: '<ng-content />',
|
|
4179
4347
|
}]
|
|
4180
4348
|
}] });
|
|
@@ -4475,7 +4643,7 @@ class SmzInputNumberComponent extends SmzValueAccessor {
|
|
|
4475
4643
|
type="text"
|
|
4476
4644
|
inputmode="decimal"
|
|
4477
4645
|
autocomplete="off"
|
|
4478
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
4646
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
4479
4647
|
[class.pr-14]="showButtons()"
|
|
4480
4648
|
[attr.id]="inputId() || null"
|
|
4481
4649
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -4532,7 +4700,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
4532
4700
|
type="text"
|
|
4533
4701
|
inputmode="decimal"
|
|
4534
4702
|
autocomplete="off"
|
|
4535
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
4703
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
4536
4704
|
[class.pr-14]="showButtons()"
|
|
4537
4705
|
[attr.id]="inputId() || null"
|
|
4538
4706
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -4810,10 +4978,15 @@ class SmzDatePickerComponent extends SmzValueAccessor {
|
|
|
4810
4978
|
fieldRef = viewChild.required('field');
|
|
4811
4979
|
panel = viewChild.required('panel');
|
|
4812
4980
|
anchored = new SmzAnchoredPanel(this.overlay, this.viewContainer);
|
|
4981
|
+
/**
|
|
4982
|
+
* Aceita `Date`, string (ISO ou parseavel) e numero (timestamp), como o `p-datepicker`.
|
|
4983
|
+
* Valores invalidos viram `null` em vez de lancar. O modelo do formulario so muda quando o usuario escolhe uma data.
|
|
4984
|
+
*/
|
|
4813
4985
|
writeValue(value) {
|
|
4814
|
-
|
|
4986
|
+
const coerced = coerceDateValue(value);
|
|
4987
|
+
super.writeValue(coerced);
|
|
4815
4988
|
this.typed.set(null);
|
|
4816
|
-
this.syncViewTo(
|
|
4989
|
+
this.syncViewTo(coerced);
|
|
4817
4990
|
}
|
|
4818
4991
|
ngOnDestroy() {
|
|
4819
4992
|
this.anchored.close();
|
|
@@ -5088,7 +5261,7 @@ class SmzDatePickerComponent extends SmzValueAccessor {
|
|
|
5088
5261
|
#field
|
|
5089
5262
|
type="text"
|
|
5090
5263
|
autocomplete="off"
|
|
5091
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
5264
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5092
5265
|
[class.pr-10]="showIcon()"
|
|
5093
5266
|
[attr.id]="inputId() || null"
|
|
5094
5267
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -5228,7 +5401,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5228
5401
|
#field
|
|
5229
5402
|
type="text"
|
|
5230
5403
|
autocomplete="off"
|
|
5231
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
5404
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5232
5405
|
[class.pr-10]="showIcon()"
|
|
5233
5406
|
[attr.id]="inputId() || null"
|
|
5234
5407
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -5355,6 +5528,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5355
5528
|
`,
|
|
5356
5529
|
}]
|
|
5357
5530
|
}], 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 }] }] } });
|
|
5531
|
+
function toDate(value) {
|
|
5532
|
+
if (value instanceof Date)
|
|
5533
|
+
return Number.isNaN(value.getTime()) ? null : value;
|
|
5534
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
5535
|
+
if (value === '')
|
|
5536
|
+
return null;
|
|
5537
|
+
const date = new Date(value);
|
|
5538
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
5539
|
+
}
|
|
5540
|
+
return null;
|
|
5541
|
+
}
|
|
5542
|
+
function coerceDateValue(value) {
|
|
5543
|
+
if (Array.isArray(value)) {
|
|
5544
|
+
const dates = value.map(toDate).filter((date) => date !== null);
|
|
5545
|
+
return dates.length > 0 ? dates : null;
|
|
5546
|
+
}
|
|
5547
|
+
return toDate(value);
|
|
5548
|
+
}
|
|
5358
5549
|
|
|
5359
5550
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-unsafe-return, max-len */
|
|
5360
5551
|
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
@@ -5532,7 +5723,7 @@ class SmzAutoCompleteComponent extends SmzValueAccessor {
|
|
|
5532
5723
|
role="combobox"
|
|
5533
5724
|
autocomplete="off"
|
|
5534
5725
|
aria-autocomplete="list"
|
|
5535
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
5726
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5536
5727
|
[class]="dropdown() ? 'pr-10' : ''"
|
|
5537
5728
|
[attr.id]="inputId() || null"
|
|
5538
5729
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -5603,7 +5794,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5603
5794
|
role="combobox"
|
|
5604
5795
|
autocomplete="off"
|
|
5605
5796
|
aria-autocomplete="list"
|
|
5606
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
5797
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5607
5798
|
[class]="dropdown() ? 'pr-10' : ''"
|
|
5608
5799
|
[attr.id]="inputId() || null"
|
|
5609
5800
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -5677,6 +5868,8 @@ class SmzInputMaskComponent extends SmzValueAccessor {
|
|
|
5677
5868
|
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
5678
5869
|
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : {}), transform: booleanAttribute });
|
|
5679
5870
|
inputId = input('', ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
5871
|
+
/** Tipo do `<input>` nativo (`text`, `tel`, `password`...). */
|
|
5872
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
5680
5873
|
inputed = output();
|
|
5681
5874
|
blurred = output();
|
|
5682
5875
|
completed = output();
|
|
@@ -5726,7 +5919,7 @@ class SmzInputMaskComponent extends SmzValueAccessor {
|
|
|
5726
5919
|
}, ...(ngDevMode ? [{ debugName: "display" }] : []));
|
|
5727
5920
|
writeValue(value) {
|
|
5728
5921
|
super.writeValue(value);
|
|
5729
|
-
this.entered.set(this.
|
|
5922
|
+
this.entered.set(this.fitToSlots(value ?? ''));
|
|
5730
5923
|
}
|
|
5731
5924
|
onFocus() {
|
|
5732
5925
|
this.focusedState.set(true);
|
|
@@ -5771,6 +5964,10 @@ class SmzInputMaskComponent extends SmzValueAccessor {
|
|
|
5771
5964
|
setTimeout(() => this.moveCaret(focusSlot));
|
|
5772
5965
|
}
|
|
5773
5966
|
}
|
|
5967
|
+
/**
|
|
5968
|
+
* Sem `maxlength` no `<input>`: numa mascara fixa o texto exibido ja tem o tamanho maximo (ex.: "5__.___.___-__"),
|
|
5969
|
+
* e o navegador bloquearia a insercao de qualquer caractere novo. `fitToSlots` descarta o que nao cabe.
|
|
5970
|
+
*/
|
|
5774
5971
|
onInput(event) {
|
|
5775
5972
|
const element = event.target;
|
|
5776
5973
|
const entered = this.fitToSlots(element.value);
|
|
@@ -5825,14 +6022,13 @@ class SmzInputMaskComponent extends SmzValueAccessor {
|
|
|
5825
6022
|
this.field().nativeElement.setSelectionRange(position, position);
|
|
5826
6023
|
}
|
|
5827
6024
|
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: `
|
|
6025
|
+
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
6026
|
<input
|
|
5830
6027
|
#field
|
|
5831
|
-
type="
|
|
5832
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
6028
|
+
[attr.type]="type()"
|
|
6029
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5833
6030
|
[attr.id]="inputId() || null"
|
|
5834
6031
|
[attr.placeholder]="placeholder() || null"
|
|
5835
|
-
[attr.maxlength]="parsed().literals.length"
|
|
5836
6032
|
[disabled]="isDisabled()"
|
|
5837
6033
|
[readOnly]="readonly()"
|
|
5838
6034
|
[value]="display()"
|
|
@@ -5853,11 +6049,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5853
6049
|
template: `
|
|
5854
6050
|
<input
|
|
5855
6051
|
#field
|
|
5856
|
-
type="
|
|
5857
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
6052
|
+
[attr.type]="type()"
|
|
6053
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5858
6054
|
[attr.id]="inputId() || null"
|
|
5859
6055
|
[attr.placeholder]="placeholder() || null"
|
|
5860
|
-
[attr.maxlength]="parsed().literals.length"
|
|
5861
6056
|
[disabled]="isDisabled()"
|
|
5862
6057
|
[readOnly]="readonly()"
|
|
5863
6058
|
[value]="display()"
|
|
@@ -5868,7 +6063,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5868
6063
|
/>
|
|
5869
6064
|
`,
|
|
5870
6065
|
}]
|
|
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 }] }] } });
|
|
6066
|
+
}], 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
6067
|
|
|
5873
6068
|
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
5874
6069
|
const DEFAULT_MEDIUM = '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})';
|
|
@@ -5922,7 +6117,7 @@ class SmzPasswordComponent extends SmzValueAccessor {
|
|
|
5922
6117
|
<input
|
|
5923
6118
|
[type]="visible() ? 'text' : 'password'"
|
|
5924
6119
|
autocomplete="off"
|
|
5925
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
6120
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5926
6121
|
[class.pr-10]="toggleMask()"
|
|
5927
6122
|
[attr.id]="inputId() || null"
|
|
5928
6123
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -5975,7 +6170,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
5975
6170
|
<input
|
|
5976
6171
|
[type]="visible() ? 'text' : 'password'"
|
|
5977
6172
|
autocomplete="off"
|
|
5978
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
6173
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
5979
6174
|
[class.pr-10]="toggleMask()"
|
|
5980
6175
|
[attr.id]="inputId() || null"
|
|
5981
6176
|
[attr.placeholder]="placeholder() || null"
|
|
@@ -6028,15 +6223,19 @@ class SmzColorPickerComponent extends SmzValueAccessor {
|
|
|
6028
6223
|
inputId = input('', ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
6029
6224
|
/** Aceito por compatibilidade com o `p-colorpicker`; sem efeito. */
|
|
6030
6225
|
appendTo = input(undefined, ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
6226
|
+
/** Emitido quando o usuario escolhe uma cor (equivale ao `onChange` do `p-colorpicker`). */
|
|
6227
|
+
changed = output();
|
|
6031
6228
|
hex = computed(() => {
|
|
6032
6229
|
const raw = (this.current() ?? '').replace('#', '');
|
|
6033
6230
|
return /^[0-9a-fA-F]{6}$/.test(raw) ? `#${raw.toLowerCase()}` : '#000000';
|
|
6034
6231
|
}, ...(ngDevMode ? [{ debugName: "hex" }] : []));
|
|
6035
6232
|
onInput(event) {
|
|
6036
|
-
|
|
6233
|
+
const value = event.target.value.replace('#', '');
|
|
6234
|
+
this.commit(value);
|
|
6235
|
+
this.changed.emit({ originalEvent: event, value });
|
|
6037
6236
|
}
|
|
6038
6237
|
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: `
|
|
6238
|
+
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
6239
|
<input
|
|
6041
6240
|
type="color"
|
|
6042
6241
|
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 +6266,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6067
6266
|
/>
|
|
6068
6267
|
`,
|
|
6069
6268
|
}]
|
|
6070
|
-
}], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }] } });
|
|
6269
|
+
}], 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
6270
|
|
|
6072
6271
|
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
6073
6272
|
/**
|
|
@@ -6218,12 +6417,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6218
6417
|
class SmzAccordionComponent {
|
|
6219
6418
|
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
6220
6419
|
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
6420
|
+
/** Um painel foi aberto (equivale ao `onOpen` do `p-accordion`). */
|
|
6421
|
+
opened = output();
|
|
6422
|
+
/** Um painel foi fechado (equivale ao `onClose`). */
|
|
6423
|
+
closed = output();
|
|
6424
|
+
/** Aceito por compatibilidade com o `p-accordion`; sem efeito. */
|
|
6425
|
+
transitionOptions = input(null, ...(ngDevMode ? [{ debugName: "transitionOptions" }] : []));
|
|
6221
6426
|
isOpen(value) {
|
|
6222
6427
|
const current = this.value();
|
|
6223
6428
|
return Array.isArray(current) ? current.includes(value) : current === value;
|
|
6224
6429
|
}
|
|
6225
6430
|
toggle(value) {
|
|
6226
6431
|
const open = this.isOpen(value);
|
|
6432
|
+
(open ? this.closed : this.opened).emit({ value });
|
|
6227
6433
|
if (this.multiple()) {
|
|
6228
6434
|
const current = Array.isArray(this.value()) ? this.value() : this.value() === null ? [] : [this.value()];
|
|
6229
6435
|
this.value.set(open ? current.filter((entry) => entry !== value) : [...current, value]);
|
|
@@ -6233,7 +6439,7 @@ class SmzAccordionComponent {
|
|
|
6233
6439
|
}
|
|
6234
6440
|
}
|
|
6235
6441
|
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 });
|
|
6442
|
+
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
6443
|
}
|
|
6238
6444
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzAccordionComponent, decorators: [{
|
|
6239
6445
|
type: Component,
|
|
@@ -6243,7 +6449,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6243
6449
|
host: { class: 'block overflow-hidden rounded-control border border-ui-line font-ui text-ui-fg' },
|
|
6244
6450
|
template: '<ng-content />',
|
|
6245
6451
|
}]
|
|
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 }] }] } });
|
|
6452
|
+
}], 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
6453
|
class SmzAccordionPanelComponent {
|
|
6248
6454
|
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
6249
6455
|
accordion = inject(SmzAccordionComponent);
|
|
@@ -6553,6 +6759,8 @@ class SmzPaginatorComponent {
|
|
|
6553
6759
|
isLast = computed(() => this.page() >= this.pageCount() - 1, ...(ngDevMode ? [{ debugName: "isLast" }] : []));
|
|
6554
6760
|
visible = computed(() => this.alwaysShow() || this.pageCount() > 1, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
6555
6761
|
links = computed(() => {
|
|
6762
|
+
if (this.totalRecords() <= 0)
|
|
6763
|
+
return [];
|
|
6556
6764
|
const size = Math.min(this.pageLinkSize(), this.pageCount());
|
|
6557
6765
|
const start = Math.max(0, Math.min(this.page() - Math.floor(size / 2), this.pageCount() - size));
|
|
6558
6766
|
return Array.from({ length: size }, (_, index) => start + index + 1);
|
|
@@ -6591,17 +6799,17 @@ class SmzPaginatorComponent {
|
|
|
6591
6799
|
@if (showCurrentPageReport()) {
|
|
6592
6800
|
<span class="mr-2 text-ui-fg-muted">{{ report() }}</span>
|
|
6593
6801
|
}
|
|
6594
|
-
<button type="button" class="inline-flex h-
|
|
6802
|
+
<button type="button" class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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="Primeira pagina" [disabled]="isFirst()" (click)="goTo(0)">
|
|
6595
6803
|
<svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true"><path d="M8 4L4 8l4 4M12 4L8 8l4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
6596
6804
|
</button>
|
|
6597
|
-
<button type="button" class="inline-flex h-
|
|
6805
|
+
<button type="button" class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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
6806
|
<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
6807
|
</button>
|
|
6600
|
-
@if (showPageLinks()) {
|
|
6808
|
+
@if (showPageLinks() && totalRecords() > 0) {
|
|
6601
6809
|
@for (link of links(); track link) {
|
|
6602
6810
|
<button
|
|
6603
6811
|
type="button"
|
|
6604
|
-
class="inline-flex h-
|
|
6812
|
+
class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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"
|
|
6605
6813
|
[class]="link === page() + 1 ? 'smz-paginator-page-selected bg-ui-primary/10 font-medium text-ui-primary' : ''"
|
|
6606
6814
|
[attr.aria-current]="link === page() + 1 ? 'page' : null"
|
|
6607
6815
|
(click)="goTo(link - 1)"
|
|
@@ -6610,10 +6818,10 @@ class SmzPaginatorComponent {
|
|
|
6610
6818
|
</button>
|
|
6611
6819
|
}
|
|
6612
6820
|
}
|
|
6613
|
-
<button type="button" class="inline-flex h-
|
|
6821
|
+
<button type="button" class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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="Proxima pagina" [disabled]="isLast()" (click)="goTo(page() + 1)">
|
|
6614
6822
|
<svg viewBox="0 0 16 16" class="h-4 w-4" 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>
|
|
6615
6823
|
</button>
|
|
6616
|
-
<button type="button" class="inline-flex h-
|
|
6824
|
+
<button type="button" class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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="Ultima pagina" [disabled]="isLast()" (click)="goTo(pageCount() - 1)">
|
|
6617
6825
|
<svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true"><path d="M4 4l4 4-4 4M8 4l4 4-4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
6618
6826
|
</button>
|
|
6619
6827
|
@if (rowsPerPageOptions() && rowsPerPageOptions()!.length > 0) {
|
|
@@ -6636,17 +6844,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6636
6844
|
@if (showCurrentPageReport()) {
|
|
6637
6845
|
<span class="mr-2 text-ui-fg-muted">{{ report() }}</span>
|
|
6638
6846
|
}
|
|
6639
|
-
<button type="button" class="inline-flex h-
|
|
6847
|
+
<button type="button" class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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="Primeira pagina" [disabled]="isFirst()" (click)="goTo(0)">
|
|
6640
6848
|
<svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true"><path d="M8 4L4 8l4 4M12 4L8 8l4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
6641
6849
|
</button>
|
|
6642
|
-
<button type="button" class="inline-flex h-
|
|
6850
|
+
<button type="button" class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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
6851
|
<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
6852
|
</button>
|
|
6645
|
-
@if (showPageLinks()) {
|
|
6853
|
+
@if (showPageLinks() && totalRecords() > 0) {
|
|
6646
6854
|
@for (link of links(); track link) {
|
|
6647
6855
|
<button
|
|
6648
6856
|
type="button"
|
|
6649
|
-
class="inline-flex h-
|
|
6857
|
+
class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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"
|
|
6650
6858
|
[class]="link === page() + 1 ? 'smz-paginator-page-selected bg-ui-primary/10 font-medium text-ui-primary' : ''"
|
|
6651
6859
|
[attr.aria-current]="link === page() + 1 ? 'page' : null"
|
|
6652
6860
|
(click)="goTo(link - 1)"
|
|
@@ -6655,10 +6863,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6655
6863
|
</button>
|
|
6656
6864
|
}
|
|
6657
6865
|
}
|
|
6658
|
-
<button type="button" class="inline-flex h-
|
|
6866
|
+
<button type="button" class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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="Proxima pagina" [disabled]="isLast()" (click)="goTo(page() + 1)">
|
|
6659
6867
|
<svg viewBox="0 0 16 16" class="h-4 w-4" 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>
|
|
6660
6868
|
</button>
|
|
6661
|
-
<button type="button" class="inline-flex h-
|
|
6869
|
+
<button type="button" class="inline-flex h-control-lg min-w-control-lg cursor-pointer items-center justify-center rounded-full 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="Ultima pagina" [disabled]="isLast()" (click)="goTo(pageCount() - 1)">
|
|
6662
6870
|
<svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true"><path d="M4 4l4 4-4 4M8 4l4 4-4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
6663
6871
|
</button>
|
|
6664
6872
|
@if (rowsPerPageOptions() && rowsPerPageOptions()!.length > 0) {
|
|
@@ -7848,7 +8056,7 @@ class SmzTreeSelectComponent extends SmzValueAccessor {
|
|
|
7848
8056
|
type="button"
|
|
7849
8057
|
role="combobox"
|
|
7850
8058
|
aria-haspopup="tree"
|
|
7851
|
-
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
8059
|
+
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x text-left font-ui text-ui-md text-ui-fg transition-colors duration-ui focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
7852
8060
|
[ngClass]="[containerStyleClass() ?? '', styleClass() ?? '']"
|
|
7853
8061
|
[attr.aria-expanded]="open()"
|
|
7854
8062
|
[disabled]="isDisabled()"
|
|
@@ -7869,7 +8077,7 @@ class SmzTreeSelectComponent extends SmzValueAccessor {
|
|
|
7869
8077
|
<div class="max-h-80 overflow-auto rounded-overlay border border-ui-line bg-ui-surface-2 p-1 font-ui text-ui-md text-ui-fg shadow-overlay">
|
|
7870
8078
|
@if (filter()) {
|
|
7871
8079
|
<div class="p-1">
|
|
7872
|
-
<input type="text" class="h-control-sm w-full rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
8080
|
+
<input type="text" class="h-control-sm w-full rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x-sm text-ui-sm focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus" [placeholder]="filterPlaceholder() ?? ''" (input)="tree._filter($any($event.target).value)" />
|
|
7873
8081
|
</div>
|
|
7874
8082
|
}
|
|
7875
8083
|
<ui-tree
|
|
@@ -7901,7 +8109,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
7901
8109
|
type="button"
|
|
7902
8110
|
role="combobox"
|
|
7903
8111
|
aria-haspopup="tree"
|
|
7904
|
-
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
8112
|
+
class="flex h-control w-full cursor-pointer items-center gap-2 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x text-left font-ui text-ui-md text-ui-fg transition-colors duration-ui focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50"
|
|
7905
8113
|
[ngClass]="[containerStyleClass() ?? '', styleClass() ?? '']"
|
|
7906
8114
|
[attr.aria-expanded]="open()"
|
|
7907
8115
|
[disabled]="isDisabled()"
|
|
@@ -7922,7 +8130,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
7922
8130
|
<div class="max-h-80 overflow-auto rounded-overlay border border-ui-line bg-ui-surface-2 p-1 font-ui text-ui-md text-ui-fg shadow-overlay">
|
|
7923
8131
|
@if (filter()) {
|
|
7924
8132
|
<div class="p-1">
|
|
7925
|
-
<input type="text" class="h-control-sm w-full rounded-control border border-ui-line-strong bg-ui-surface-1 px-
|
|
8133
|
+
<input type="text" class="h-control-sm w-full rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x-sm text-ui-sm focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus" [placeholder]="filterPlaceholder() ?? ''" (input)="tree._filter($any($event.target).value)" />
|
|
7926
8134
|
</div>
|
|
7927
8135
|
}
|
|
7928
8136
|
<ui-tree
|
|
@@ -7991,9 +8199,1144 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
7991
8199
|
args: [{ providedIn: 'root' }]
|
|
7992
8200
|
}] });
|
|
7993
8201
|
|
|
8202
|
+
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
8203
|
+
/**
|
|
8204
|
+
* Card. Substitui o `p-card` do PrimeNG.
|
|
8205
|
+
* O conteudo padrao vai no corpo; `header`, `title`, `subtitle` e `footer` podem ser strings ou templates.
|
|
8206
|
+
*
|
|
8207
|
+
* <ui-card header="Titulo" subheader="Sub">conteudo<ng-template smzTemplate="footer">...</ng-template></ui-card>
|
|
8208
|
+
*/
|
|
8209
|
+
class SmzCardComponent {
|
|
8210
|
+
/** Titulo em texto (equivale ao slot `title`). */
|
|
8211
|
+
header = input('', ...(ngDevMode ? [{ debugName: "header" }] : []));
|
|
8212
|
+
/** Subtitulo em texto (equivale ao slot `subtitle`). */
|
|
8213
|
+
subheader = input('', ...(ngDevMode ? [{ debugName: "subheader" }] : []));
|
|
8214
|
+
templates = contentChildren(SmzTemplateDirective, ...(ngDevMode ? [{ debugName: "templates" }] : []));
|
|
8215
|
+
headerTemplate = computed(() => smzFindTemplate(this.templates(), 'header'), ...(ngDevMode ? [{ debugName: "headerTemplate" }] : []));
|
|
8216
|
+
titleTemplate = computed(() => smzFindTemplate(this.templates(), 'title'), ...(ngDevMode ? [{ debugName: "titleTemplate" }] : []));
|
|
8217
|
+
subtitleTemplate = computed(() => smzFindTemplate(this.templates(), 'subtitle'), ...(ngDevMode ? [{ debugName: "subtitleTemplate" }] : []));
|
|
8218
|
+
footerTemplate = computed(() => smzFindTemplate(this.templates(), 'footer'), ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
|
|
8219
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8220
|
+
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: `
|
|
8221
|
+
@if (headerTemplate(); as tpl) {
|
|
8222
|
+
<div class="p-card-header"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8223
|
+
}
|
|
8224
|
+
<div class="p-card-body flex flex-1 flex-col gap-2 p-5">
|
|
8225
|
+
@if (titleTemplate() || header()) {
|
|
8226
|
+
<div class="p-card-title text-ui-xl font-semibold">
|
|
8227
|
+
@if (titleTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ header() }} }
|
|
8228
|
+
</div>
|
|
8229
|
+
}
|
|
8230
|
+
@if (subtitleTemplate() || subheader()) {
|
|
8231
|
+
<div class="p-card-subtitle text-ui-fg-muted">
|
|
8232
|
+
@if (subtitleTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ subheader() }} }
|
|
8233
|
+
</div>
|
|
8234
|
+
}
|
|
8235
|
+
<div class="p-card-content flex-1"><ng-content /></div>
|
|
8236
|
+
@if (footerTemplate(); as tpl) {
|
|
8237
|
+
<div class="p-card-footer"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8238
|
+
}
|
|
8239
|
+
</div>
|
|
8240
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8241
|
+
}
|
|
8242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzCardComponent, decorators: [{
|
|
8243
|
+
type: Component,
|
|
8244
|
+
args: [{
|
|
8245
|
+
selector: 'ui-card',
|
|
8246
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8247
|
+
imports: [NgTemplateOutlet],
|
|
8248
|
+
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' },
|
|
8249
|
+
template: `
|
|
8250
|
+
@if (headerTemplate(); as tpl) {
|
|
8251
|
+
<div class="p-card-header"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8252
|
+
}
|
|
8253
|
+
<div class="p-card-body flex flex-1 flex-col gap-2 p-5">
|
|
8254
|
+
@if (titleTemplate() || header()) {
|
|
8255
|
+
<div class="p-card-title text-ui-xl font-semibold">
|
|
8256
|
+
@if (titleTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ header() }} }
|
|
8257
|
+
</div>
|
|
8258
|
+
}
|
|
8259
|
+
@if (subtitleTemplate() || subheader()) {
|
|
8260
|
+
<div class="p-card-subtitle text-ui-fg-muted">
|
|
8261
|
+
@if (subtitleTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ subheader() }} }
|
|
8262
|
+
</div>
|
|
8263
|
+
}
|
|
8264
|
+
<div class="p-card-content flex-1"><ng-content /></div>
|
|
8265
|
+
@if (footerTemplate(); as tpl) {
|
|
8266
|
+
<div class="p-card-footer"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8267
|
+
}
|
|
8268
|
+
</div>
|
|
8269
|
+
`,
|
|
8270
|
+
}]
|
|
8271
|
+
}], propDecorators: { header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], subheader: [{ type: i0.Input, args: [{ isSignal: true, alias: "subheader", required: false }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzTemplateDirective), { isSignal: true }] }] } });
|
|
8272
|
+
|
|
8273
|
+
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
8274
|
+
/**
|
|
8275
|
+
* Painel com cabecalho, recolhimento opcional e rodape. Substitui o `p-panel` do PrimeNG.
|
|
8276
|
+
*
|
|
8277
|
+
* <ui-panel header="Filtros" [toggleable]="true" [(collapsed)]="fechado">conteudo</ui-panel>
|
|
8278
|
+
*/
|
|
8279
|
+
class SmzPanelComponent {
|
|
8280
|
+
header = input('', ...(ngDevMode ? [{ debugName: "header" }] : []));
|
|
8281
|
+
toggleable = input(false, { ...(ngDevMode ? { debugName: "toggleable" } : {}), transform: booleanAttribute });
|
|
8282
|
+
collapsed = model(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
8283
|
+
/** Antes de alternar (cancelavel nao: apenas notifica). */
|
|
8284
|
+
beforeToggle = output();
|
|
8285
|
+
afterToggle = output();
|
|
8286
|
+
templates = contentChildren(SmzTemplateDirective, ...(ngDevMode ? [{ debugName: "templates" }] : []));
|
|
8287
|
+
headerTemplate = computed(() => smzFindTemplate(this.templates(), 'header'), ...(ngDevMode ? [{ debugName: "headerTemplate" }] : []));
|
|
8288
|
+
iconsTemplate = computed(() => smzFindTemplate(this.templates(), 'icons'), ...(ngDevMode ? [{ debugName: "iconsTemplate" }] : []));
|
|
8289
|
+
footerTemplate = computed(() => smzFindTemplate(this.templates(), 'footer'), ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
|
|
8290
|
+
hasHeader = computed(() => !!this.header() || !!this.headerTemplate() || this.toggleable(), ...(ngDevMode ? [{ debugName: "hasHeader" }] : []));
|
|
8291
|
+
toggle(event) {
|
|
8292
|
+
const next = !this.collapsed();
|
|
8293
|
+
this.beforeToggle.emit({ originalEvent: event, collapsed: next });
|
|
8294
|
+
this.collapsed.set(next);
|
|
8295
|
+
this.afterToggle.emit({ originalEvent: event, collapsed: next });
|
|
8296
|
+
}
|
|
8297
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8298
|
+
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: `
|
|
8299
|
+
@if (hasHeader()) {
|
|
8300
|
+
<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">
|
|
8301
|
+
<div class="min-w-0 flex-1 font-semibold">
|
|
8302
|
+
@if (headerTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ header() }} }
|
|
8303
|
+
</div>
|
|
8304
|
+
<div class="flex items-center gap-1">
|
|
8305
|
+
@if (iconsTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> }
|
|
8306
|
+
@if (toggleable()) {
|
|
8307
|
+
<button type="button" class="inline-flex h-8 w-8 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-expanded]="!collapsed()" [attr.aria-label]="collapsed() ? 'Expandir' : 'Recolher'" (click)="toggle($event)">
|
|
8308
|
+
<svg viewBox="0 0 16 16" class="h-4 w-4 transition-transform duration-ui" [class.rotate-180]="!collapsed()" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
8309
|
+
</button>
|
|
8310
|
+
}
|
|
8311
|
+
</div>
|
|
8312
|
+
</div>
|
|
8313
|
+
}
|
|
8314
|
+
@if (!collapsed()) {
|
|
8315
|
+
<div class="p-panel-content p-4"><ng-content /></div>
|
|
8316
|
+
@if (footerTemplate(); as tpl) {
|
|
8317
|
+
<div class="p-panel-footer border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8318
|
+
}
|
|
8319
|
+
}
|
|
8320
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8321
|
+
}
|
|
8322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzPanelComponent, decorators: [{
|
|
8323
|
+
type: Component,
|
|
8324
|
+
args: [{
|
|
8325
|
+
selector: 'ui-panel',
|
|
8326
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8327
|
+
imports: [NgTemplateOutlet],
|
|
8328
|
+
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' },
|
|
8329
|
+
template: `
|
|
8330
|
+
@if (hasHeader()) {
|
|
8331
|
+
<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">
|
|
8332
|
+
<div class="min-w-0 flex-1 font-semibold">
|
|
8333
|
+
@if (headerTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> } @else { {{ header() }} }
|
|
8334
|
+
</div>
|
|
8335
|
+
<div class="flex items-center gap-1">
|
|
8336
|
+
@if (iconsTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" /> }
|
|
8337
|
+
@if (toggleable()) {
|
|
8338
|
+
<button type="button" class="inline-flex h-8 w-8 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-expanded]="!collapsed()" [attr.aria-label]="collapsed() ? 'Expandir' : 'Recolher'" (click)="toggle($event)">
|
|
8339
|
+
<svg viewBox="0 0 16 16" class="h-4 w-4 transition-transform duration-ui" [class.rotate-180]="!collapsed()" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
8340
|
+
</button>
|
|
8341
|
+
}
|
|
8342
|
+
</div>
|
|
8343
|
+
</div>
|
|
8344
|
+
}
|
|
8345
|
+
@if (!collapsed()) {
|
|
8346
|
+
<div class="p-panel-content p-4"><ng-content /></div>
|
|
8347
|
+
@if (footerTemplate(); as tpl) {
|
|
8348
|
+
<div class="p-panel-footer border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8349
|
+
}
|
|
8350
|
+
}
|
|
8351
|
+
`,
|
|
8352
|
+
}]
|
|
8353
|
+
}], propDecorators: { header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], toggleable: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleable", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], beforeToggle: [{ type: i0.Output, args: ["beforeToggle"] }], afterToggle: [{ type: i0.Output, args: ["afterToggle"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzTemplateDirective), { isSignal: true }] }] } });
|
|
8354
|
+
|
|
8355
|
+
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
8356
|
+
/**
|
|
8357
|
+
* Indicador de carregamento circular. Substitui o `p-progressspinner` do PrimeNG.
|
|
8358
|
+
* O tamanho vem das classes do host (ex.: `class="h-12 w-12"`); a cor, de `text-ui-primary` (herdavel).
|
|
8359
|
+
*
|
|
8360
|
+
* <ui-progress-spinner class="h-12 w-12" strokeWidth="4" />
|
|
8361
|
+
*/
|
|
8362
|
+
class SmzProgressSpinnerComponent {
|
|
8363
|
+
strokeWidth = input(4, ...(ngDevMode ? [{ debugName: "strokeWidth" }] : []));
|
|
8364
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzProgressSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8365
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzProgressSpinnerComponent, isStandalone: true, selector: "ui-progress-spinner", inputs: { strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar", "aria-busy": "true" }, classAttribute: "inline-block h-10 w-10 text-ui-primary" }, ngImport: i0, template: `
|
|
8366
|
+
<svg viewBox="0 0 50 50" class="h-full w-full animate-spin" fill="none" aria-hidden="true">
|
|
8367
|
+
<circle cx="25" cy="25" r="20" stroke="currentColor" [attr.stroke-width]="strokeWidth()" stroke-linecap="round" stroke-dasharray="90 150" />
|
|
8368
|
+
</svg>
|
|
8369
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8370
|
+
}
|
|
8371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzProgressSpinnerComponent, decorators: [{
|
|
8372
|
+
type: Component,
|
|
8373
|
+
args: [{
|
|
8374
|
+
selector: 'ui-progress-spinner',
|
|
8375
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8376
|
+
host: { class: 'inline-block h-10 w-10 text-ui-primary', role: 'progressbar', 'aria-busy': 'true' },
|
|
8377
|
+
template: `
|
|
8378
|
+
<svg viewBox="0 0 50 50" class="h-full w-full animate-spin" fill="none" aria-hidden="true">
|
|
8379
|
+
<circle cx="25" cy="25" r="20" stroke="currentColor" [attr.stroke-width]="strokeWidth()" stroke-linecap="round" stroke-dasharray="90 150" />
|
|
8380
|
+
</svg>
|
|
8381
|
+
`,
|
|
8382
|
+
}]
|
|
8383
|
+
}], propDecorators: { strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }] } });
|
|
8384
|
+
|
|
8385
|
+
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
8386
|
+
const BASE = 'relative block [&_label]:pointer-events-none [&_label]:absolute [&_label]:left-3 [&_label]:z-10 [&_label]:text-ui-fg-subtle [&_label]:transition-all [&_label]:duration-ui';
|
|
8387
|
+
const RESTING = '[&_label]:top-1/2 [&_label]:-translate-y-1/2 [&_label]:text-ui-md';
|
|
8388
|
+
const FLOATED = {
|
|
8389
|
+
over: '[&_label]:-top-5 [&_label]:left-0 [&_label]:translate-y-0 [&_label]:text-ui-xs [&_label]:text-ui-fg-muted',
|
|
8390
|
+
on: '[&_label]:top-0 [&_label]:left-2 [&_label]:-translate-y-1/2 [&_label]:bg-ui-surface-1 [&_label]:px-1 [&_label]:text-ui-xs [&_label]:text-ui-fg-muted',
|
|
8391
|
+
in: '[&_label]:top-1.5 [&_label]:translate-y-0 [&_label]:text-ui-xs [&_label]:text-ui-fg-muted',
|
|
8392
|
+
};
|
|
8393
|
+
const IN_PADDING = '[&_input]:pt-4 [&_textarea]:pt-5 [&_[role=combobox]]:pt-4';
|
|
8394
|
+
/**
|
|
8395
|
+
* Rotulo flutuante. Substitui o `p-floatlabel` do PrimeNG.
|
|
8396
|
+
* O `<label>` projetado flutua quando o controle recebe foco ou tem valor
|
|
8397
|
+
* (detectado em `input`/`textarea` e em selects do kit; use `[filled]` para forcar).
|
|
8398
|
+
*
|
|
8399
|
+
* <ui-float-label variant="on"><input smzInputText id="n" /><label for="n">Nome</label></ui-float-label>
|
|
8400
|
+
*/
|
|
8401
|
+
class SmzFloatLabelComponent {
|
|
8402
|
+
variant = input('over', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
8403
|
+
/** Forca o estado "preenchido" quando a deteccao automatica nao se aplica. */
|
|
8404
|
+
filled = input(null, ...(ngDevMode ? [{ debugName: "filled" }] : []));
|
|
8405
|
+
focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : []));
|
|
8406
|
+
detected = signal(false, ...(ngDevMode ? [{ debugName: "detected" }] : []));
|
|
8407
|
+
host = inject(ElementRef);
|
|
8408
|
+
floated = computed(() => this.focused() || (this.filled() ?? this.detected()), ...(ngDevMode ? [{ debugName: "floated" }] : []));
|
|
8409
|
+
classes = computed(() => {
|
|
8410
|
+
const variant = this.variant();
|
|
8411
|
+
return [BASE, this.floated() ? FLOATED[variant] : RESTING, variant === 'in' ? IN_PADDING : ''].join(' ');
|
|
8412
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
8413
|
+
constructor() {
|
|
8414
|
+
afterEveryRender(() => this.check());
|
|
8415
|
+
}
|
|
8416
|
+
check() {
|
|
8417
|
+
{
|
|
8418
|
+
const root = this.host.nativeElement;
|
|
8419
|
+
const field = root.querySelector('input:not([type=checkbox]):not([type=radio]), textarea');
|
|
8420
|
+
const combo = root.querySelector('[role=combobox]');
|
|
8421
|
+
let filled = false;
|
|
8422
|
+
if (field && field.value !== '')
|
|
8423
|
+
filled = true;
|
|
8424
|
+
else if (combo && !field)
|
|
8425
|
+
filled = !combo.querySelector('.text-ui-fg-subtle') && (combo.textContent ?? '').trim() !== '';
|
|
8426
|
+
if (filled !== this.detected())
|
|
8427
|
+
this.detected.set(filled);
|
|
8428
|
+
}
|
|
8429
|
+
}
|
|
8430
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFloatLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8431
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: SmzFloatLabelComponent, isStandalone: true, selector: "ui-float-label", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, filled: { classPropertyName: "filled", publicName: "filled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusin": "focused.set(true)", "focusout": "focused.set(false); check()", "input": "check()", "change": "check()" }, properties: { "class": "classes()" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8432
|
+
}
|
|
8433
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFloatLabelComponent, decorators: [{
|
|
8434
|
+
type: Component,
|
|
8435
|
+
args: [{
|
|
8436
|
+
selector: 'ui-float-label',
|
|
8437
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8438
|
+
host: {
|
|
8439
|
+
'[class]': 'classes()',
|
|
8440
|
+
'(focusin)': 'focused.set(true)',
|
|
8441
|
+
'(focusout)': 'focused.set(false); check()',
|
|
8442
|
+
'(input)': 'check()',
|
|
8443
|
+
'(change)': 'check()',
|
|
8444
|
+
},
|
|
8445
|
+
template: '<ng-content />',
|
|
8446
|
+
}]
|
|
8447
|
+
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], filled: [{ type: i0.Input, args: [{ isSignal: true, alias: "filled", required: false }] }] } });
|
|
8448
|
+
|
|
8449
|
+
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
8450
|
+
/** Painel de um `ui-splitter`. O conteudo e projetado dentro da area do painel. */
|
|
8451
|
+
class SmzSplitterPanelComponent {
|
|
8452
|
+
content = viewChild.required(TemplateRef);
|
|
8453
|
+
/** Tamanho inicial em % (sobrescreve `panelSizes` do splitter). */
|
|
8454
|
+
size = input(null, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
8455
|
+
minSize = input(null, ...(ngDevMode ? [{ debugName: "minSize" }] : []));
|
|
8456
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzSplitterPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8457
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.1", type: SmzSplitterPanelComponent, isStandalone: true, selector: "ui-splitter-panel", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, minSize: { classPropertyName: "minSize", publicName: "minSize", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: '<ng-template><ng-content /></ng-template>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8458
|
+
}
|
|
8459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzSplitterPanelComponent, decorators: [{
|
|
8460
|
+
type: Component,
|
|
8461
|
+
args: [{
|
|
8462
|
+
selector: 'ui-splitter-panel',
|
|
8463
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8464
|
+
template: '<ng-template><ng-content /></ng-template>',
|
|
8465
|
+
}]
|
|
8466
|
+
}], propDecorators: { content: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], minSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSize", required: false }] }] } });
|
|
8467
|
+
/**
|
|
8468
|
+
* Divisor redimensionavel. Substitui o `p-splitter` / `p-splitterPanel` do PrimeNG.
|
|
8469
|
+
*
|
|
8470
|
+
* <ui-splitter layout="horizontal" [panelSizes]="[30, 70]" [minSizes]="[10, 20]">
|
|
8471
|
+
* <ui-splitter-panel>A</ui-splitter-panel><ui-splitter-panel>B</ui-splitter-panel>
|
|
8472
|
+
* </ui-splitter>
|
|
8473
|
+
*/
|
|
8474
|
+
class SmzSplitterComponent {
|
|
8475
|
+
layout = input('horizontal', ...(ngDevMode ? [{ debugName: "layout" }] : []));
|
|
8476
|
+
panelSizes = input(null, ...(ngDevMode ? [{ debugName: "panelSizes" }] : []));
|
|
8477
|
+
minSizes = input(null, ...(ngDevMode ? [{ debugName: "minSizes" }] : []));
|
|
8478
|
+
resizeEnd = output();
|
|
8479
|
+
panels = contentChildren(SmzSplitterPanelComponent, ...(ngDevMode ? [{ debugName: "panels" }] : []));
|
|
8480
|
+
root = viewChild.required('root');
|
|
8481
|
+
overrides = signal(null, ...(ngDevMode ? [{ debugName: "overrides" }] : []));
|
|
8482
|
+
sizes = computed(() => {
|
|
8483
|
+
const override = this.overrides();
|
|
8484
|
+
if (override && override.length === this.panels().length)
|
|
8485
|
+
return override;
|
|
8486
|
+
const panels = this.panels();
|
|
8487
|
+
const base = this.panelSizes() ?? [];
|
|
8488
|
+
const explicit = panels.map((panel, i) => panel.size() ?? base[i] ?? null);
|
|
8489
|
+
const known = explicit.reduce((sum, size) => sum + (size ?? 0), 0);
|
|
8490
|
+
const free = explicit.filter((size) => size === null).length;
|
|
8491
|
+
const share = free > 0 ? Math.max(0, 100 - known) / free : 0;
|
|
8492
|
+
return explicit.map((size) => size ?? share);
|
|
8493
|
+
}, ...(ngDevMode ? [{ debugName: "sizes" }] : []));
|
|
8494
|
+
min(index) {
|
|
8495
|
+
return this.panels()[index]?.minSize() ?? this.minSizes()?.[index] ?? 0;
|
|
8496
|
+
}
|
|
8497
|
+
startDrag(event, index) {
|
|
8498
|
+
event.preventDefault();
|
|
8499
|
+
const rect = this.root().nativeElement.getBoundingClientRect();
|
|
8500
|
+
const total = this.layout() === 'horizontal' ? rect.width : rect.height;
|
|
8501
|
+
const start = this.layout() === 'horizontal' ? event.clientX : event.clientY;
|
|
8502
|
+
const initial = [...this.sizes()];
|
|
8503
|
+
const move = (e) => {
|
|
8504
|
+
const delta = (((this.layout() === 'horizontal' ? e.clientX : e.clientY) - start) / total) * 100;
|
|
8505
|
+
this.resize(initial, index, delta);
|
|
8506
|
+
};
|
|
8507
|
+
const up = () => {
|
|
8508
|
+
document.removeEventListener('pointermove', move);
|
|
8509
|
+
document.removeEventListener('pointerup', up);
|
|
8510
|
+
this.resizeEnd.emit({ sizes: this.sizes() });
|
|
8511
|
+
};
|
|
8512
|
+
document.addEventListener('pointermove', move);
|
|
8513
|
+
document.addEventListener('pointerup', up);
|
|
8514
|
+
}
|
|
8515
|
+
onKey(event, index) {
|
|
8516
|
+
const keys = this.layout() === 'horizontal' ? { dec: 'ArrowLeft', inc: 'ArrowRight' } : { dec: 'ArrowUp', inc: 'ArrowDown' };
|
|
8517
|
+
if (event.key !== keys.dec && event.key !== keys.inc)
|
|
8518
|
+
return;
|
|
8519
|
+
event.preventDefault();
|
|
8520
|
+
this.resize([...this.sizes()], index, event.key === keys.inc ? 2 : -2);
|
|
8521
|
+
this.resizeEnd.emit({ sizes: this.sizes() });
|
|
8522
|
+
}
|
|
8523
|
+
resize(initial, index, delta) {
|
|
8524
|
+
const pair = initial[index] + initial[index + 1];
|
|
8525
|
+
const next = Math.min(Math.max(initial[index] + delta, this.min(index)), pair - this.min(index + 1));
|
|
8526
|
+
const sizes = [...initial];
|
|
8527
|
+
sizes[index] = next;
|
|
8528
|
+
sizes[index + 1] = pair - next;
|
|
8529
|
+
this.overrides.set(sizes);
|
|
8530
|
+
}
|
|
8531
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzSplitterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8532
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzSplitterComponent, isStandalone: true, selector: "ui-splitter", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, panelSizes: { classPropertyName: "panelSizes", publicName: "panelSizes", isSignal: true, isRequired: false, transformFunction: null }, minSizes: { classPropertyName: "minSizes", publicName: "minSizes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { resizeEnd: "resizeEnd" }, host: { classAttribute: "block h-full w-full overflow-hidden rounded-control border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg" }, queries: [{ propertyName: "panels", predicate: SmzSplitterPanelComponent, isSignal: true }], viewQueries: [{ propertyName: "root", first: true, predicate: ["root"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
8533
|
+
<div #root class="flex h-full w-full" [class.flex-col]="layout() === 'vertical'">
|
|
8534
|
+
@for (panel of panels(); track $index; let i = $index) {
|
|
8535
|
+
<div class="min-h-0 min-w-0 overflow-auto" [style.flex]="'0 0 ' + sizes()[i] + '%'" [style.width]="layout() === 'horizontal' ? sizes()[i] + '%' : null" [style.height]="layout() === 'vertical' ? sizes()[i] + '%' : null">
|
|
8536
|
+
<ng-container [ngTemplateOutlet]="panel.content()" />
|
|
8537
|
+
</div>
|
|
8538
|
+
@if (i < panels().length - 1) {
|
|
8539
|
+
<div
|
|
8540
|
+
role="separator"
|
|
8541
|
+
tabindex="0"
|
|
8542
|
+
class="shrink-0 bg-ui-line transition-colors duration-ui hover:bg-ui-primary focus-visible:bg-ui-primary focus-visible:outline-none"
|
|
8543
|
+
[class]="layout() === 'horizontal' ? 'w-1 cursor-col-resize' : 'h-1 cursor-row-resize'"
|
|
8544
|
+
[attr.aria-orientation]="layout() === 'horizontal' ? 'vertical' : 'horizontal'"
|
|
8545
|
+
(pointerdown)="startDrag($event, i)"
|
|
8546
|
+
(keydown)="onKey($event, i)"
|
|
8547
|
+
></div>
|
|
8548
|
+
}
|
|
8549
|
+
}
|
|
8550
|
+
</div>
|
|
8551
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8552
|
+
}
|
|
8553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzSplitterComponent, decorators: [{
|
|
8554
|
+
type: Component,
|
|
8555
|
+
args: [{
|
|
8556
|
+
selector: 'ui-splitter',
|
|
8557
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8558
|
+
imports: [NgTemplateOutlet],
|
|
8559
|
+
host: { class: 'block h-full w-full overflow-hidden rounded-control border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg' },
|
|
8560
|
+
template: `
|
|
8561
|
+
<div #root class="flex h-full w-full" [class.flex-col]="layout() === 'vertical'">
|
|
8562
|
+
@for (panel of panels(); track $index; let i = $index) {
|
|
8563
|
+
<div class="min-h-0 min-w-0 overflow-auto" [style.flex]="'0 0 ' + sizes()[i] + '%'" [style.width]="layout() === 'horizontal' ? sizes()[i] + '%' : null" [style.height]="layout() === 'vertical' ? sizes()[i] + '%' : null">
|
|
8564
|
+
<ng-container [ngTemplateOutlet]="panel.content()" />
|
|
8565
|
+
</div>
|
|
8566
|
+
@if (i < panels().length - 1) {
|
|
8567
|
+
<div
|
|
8568
|
+
role="separator"
|
|
8569
|
+
tabindex="0"
|
|
8570
|
+
class="shrink-0 bg-ui-line transition-colors duration-ui hover:bg-ui-primary focus-visible:bg-ui-primary focus-visible:outline-none"
|
|
8571
|
+
[class]="layout() === 'horizontal' ? 'w-1 cursor-col-resize' : 'h-1 cursor-row-resize'"
|
|
8572
|
+
[attr.aria-orientation]="layout() === 'horizontal' ? 'vertical' : 'horizontal'"
|
|
8573
|
+
(pointerdown)="startDrag($event, i)"
|
|
8574
|
+
(keydown)="onKey($event, i)"
|
|
8575
|
+
></div>
|
|
8576
|
+
}
|
|
8577
|
+
}
|
|
8578
|
+
</div>
|
|
8579
|
+
`,
|
|
8580
|
+
}]
|
|
8581
|
+
}], propDecorators: { layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], panelSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelSizes", required: false }] }], minSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSizes", required: false }] }], resizeEnd: [{ type: i0.Output, args: ["resizeEnd"] }], panels: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SmzSplitterPanelComponent), { isSignal: true }] }], root: [{ type: i0.ViewChild, args: ['root', { isSignal: true }] }] } });
|
|
8582
|
+
|
|
8583
|
+
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
8584
|
+
/* 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/no-unsafe-argument, @typescript-eslint/explicit-module-boundary-types */
|
|
8585
|
+
const ROW_BASE = 'border-b border-ui-line transition-colors duration-ui';
|
|
8586
|
+
/**
|
|
8587
|
+
* Tabela em arvore. Substitui o `p-treeTable` do PrimeNG.
|
|
8588
|
+
* Os templates `header`, `body`, `caption`, `footer`, `emptymessage` e `summary` usam `smzTemplate`;
|
|
8589
|
+
* o `body` recebe `let-rowNode let-rowData="rowData" let-columns="columns"`.
|
|
8590
|
+
*
|
|
8591
|
+
* <ui-tree-table [value]="nodes" [columns]="cols" selectionMode="checkbox" [(selection)]="sel">
|
|
8592
|
+
* <ng-template smzTemplate="header" let-columns><tr><th *ngFor="let c of columns">{{ c.header }}</th></tr></ng-template>
|
|
8593
|
+
* <ng-template smzTemplate="body" let-rowNode let-rowData="rowData" let-columns="columns">
|
|
8594
|
+
* <tr [smzTtRow]="rowNode"><td><ui-tree-table-toggler [rowNode]="rowNode" />{{ rowData.name }}</td></tr>
|
|
8595
|
+
* </ng-template>
|
|
8596
|
+
* </ui-tree-table>
|
|
8597
|
+
*/
|
|
8598
|
+
class SmzTreeTableComponent {
|
|
8599
|
+
value = input([], ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
8600
|
+
columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
8601
|
+
selectionMode = input(null, ...(ngDevMode ? [{ debugName: "selectionMode" }] : []));
|
|
8602
|
+
selection = model(null, ...(ngDevMode ? [{ debugName: "selection" }] : []));
|
|
8603
|
+
propagateSelectionUp = input(true, { ...(ngDevMode ? { debugName: "propagateSelectionUp" } : {}), transform: booleanAttribute });
|
|
8604
|
+
propagateSelectionDown = input(true, { ...(ngDevMode ? { debugName: "propagateSelectionDown" } : {}), transform: booleanAttribute });
|
|
8605
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
8606
|
+
scrollable = input(false, { ...(ngDevMode ? { debugName: "scrollable" } : {}), transform: booleanAttribute });
|
|
8607
|
+
scrollHeight = input(null, ...(ngDevMode ? [{ debugName: "scrollHeight" }] : []));
|
|
8608
|
+
emptyMessage = input('', ...(ngDevMode ? [{ debugName: "emptyMessage" }] : []));
|
|
8609
|
+
tableStyleClass = input('', ...(ngDevMode ? [{ debugName: "tableStyleClass" }] : []));
|
|
8610
|
+
paginator = input(false, { ...(ngDevMode ? { debugName: "paginator" } : {}), transform: booleanAttribute });
|
|
8611
|
+
rows = model(10, ...(ngDevMode ? [{ debugName: "rows" }] : []));
|
|
8612
|
+
first = model(0, ...(ngDevMode ? [{ debugName: "first" }] : []));
|
|
8613
|
+
rowsPerPageOptions = input(null, ...(ngDevMode ? [{ debugName: "rowsPerPageOptions" }] : []));
|
|
8614
|
+
sortField = model(null, ...(ngDevMode ? [{ debugName: "sortField" }] : []));
|
|
8615
|
+
sortOrder = model(1, ...(ngDevMode ? [{ debugName: "sortOrder" }] : []));
|
|
8616
|
+
/** Destaca a linha sob o cursor (padrao: ligado). */
|
|
8617
|
+
rowHover = input(true, { ...(ngDevMode ? { debugName: "rowHover" } : {}), transform: booleanAttribute });
|
|
8618
|
+
showCurrentPageReport = input(false, { ...(ngDevMode ? { debugName: "showCurrentPageReport" } : {}), transform: booleanAttribute });
|
|
8619
|
+
currentPageReportTemplate = input('Mostrando {first} a {last} de {totalRecords}', ...(ngDevMode ? [{ debugName: "currentPageReportTemplate" }] : []));
|
|
8620
|
+
/** Campos (de `node.data`) consultados pelo filtro global. */
|
|
8621
|
+
globalFilterFields = input(null, ...(ngDevMode ? [{ debugName: "globalFilterFields" }] : []));
|
|
8622
|
+
/** `lenient`: um no que casa mantem toda a sua subarvore; `strict`: so os nos que casam (e seus ancestrais). */
|
|
8623
|
+
filterMode = input('lenient', ...(ngDevMode ? [{ debugName: "filterMode" }] : []));
|
|
8624
|
+
nodeSelect = output();
|
|
8625
|
+
nodeUnselect = output();
|
|
8626
|
+
nodeExpand = output();
|
|
8627
|
+
nodeCollapse = output();
|
|
8628
|
+
sorted = output();
|
|
8629
|
+
page = output();
|
|
8630
|
+
templates = contentChildren(SmzTemplateDirective, ...(ngDevMode ? [{ debugName: "templates" }] : []));
|
|
8631
|
+
headerTemplate = computed(() => smzFindTemplate(this.templates(), 'header'), ...(ngDevMode ? [{ debugName: "headerTemplate" }] : []));
|
|
8632
|
+
bodyTemplate = computed(() => smzFindTemplate(this.templates(), 'body'), ...(ngDevMode ? [{ debugName: "bodyTemplate" }] : []));
|
|
8633
|
+
captionTemplate = computed(() => smzFindTemplate(this.templates(), 'caption'), ...(ngDevMode ? [{ debugName: "captionTemplate" }] : []));
|
|
8634
|
+
footerTemplate = computed(() => smzFindTemplate(this.templates(), 'footer'), ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
|
|
8635
|
+
emptyTemplate = computed(() => smzFindTemplate(this.templates(), 'emptymessage'), ...(ngDevMode ? [{ debugName: "emptyTemplate" }] : []));
|
|
8636
|
+
summaryTemplate = computed(() => smzFindTemplate(this.templates(), 'summary'), ...(ngDevMode ? [{ debugName: "summaryTemplate" }] : []));
|
|
8637
|
+
/** Os nos sao mutaveis (`expanded`, `partialSelected`); este contador forca o recalculo das linhas. */
|
|
8638
|
+
version = signal(0, ...(ngDevMode ? [{ debugName: "version" }] : []));
|
|
8639
|
+
filterService = inject(SmzFilterService);
|
|
8640
|
+
globalFilter = signal(null, ...(ngDevMode ? [{ debugName: "globalFilter" }] : []));
|
|
8641
|
+
columnFilters = signal({}, ...(ngDevMode ? [{ debugName: "columnFilters" }] : []));
|
|
8642
|
+
/** Nos raiz que passam nos filtros (global e por coluna), ou `null` quando nao ha filtro ativo. */
|
|
8643
|
+
get filteredNodes() {
|
|
8644
|
+
return this.visibility()?.roots ?? null;
|
|
8645
|
+
}
|
|
8646
|
+
/** Visibilidade calculada dos filtros: quais nos aparecem e quais ancestrais expandir. */
|
|
8647
|
+
visibility = computed(() => {
|
|
8648
|
+
this.version();
|
|
8649
|
+
const global = this.globalFilter();
|
|
8650
|
+
const columns = this.columnFilters();
|
|
8651
|
+
const active = Object.entries(columns).filter(([, filter]) => filter.value !== null && filter.value !== undefined && filter.value !== '');
|
|
8652
|
+
if (!global?.value && active.length === 0)
|
|
8653
|
+
return null;
|
|
8654
|
+
const matches = (node) => {
|
|
8655
|
+
for (const [field, filter] of active) {
|
|
8656
|
+
const test = this.filterService.filters[filter.matchMode] ?? this.filterService.filters['contains'];
|
|
8657
|
+
if (!test(SmzObjectUtils.resolveFieldData(node.data, field), filter.value))
|
|
8658
|
+
return false;
|
|
8659
|
+
}
|
|
8660
|
+
if (global?.value) {
|
|
8661
|
+
const test = this.filterService.filters[global.matchMode] ?? this.filterService.filters['contains'];
|
|
8662
|
+
const fields = this.globalFilterFields() ?? Object.keys(node.data ?? {});
|
|
8663
|
+
if (!fields.some((field) => test(SmzObjectUtils.resolveFieldData(node.data, field), global.value)))
|
|
8664
|
+
return false;
|
|
8665
|
+
}
|
|
8666
|
+
return true;
|
|
8667
|
+
};
|
|
8668
|
+
const visible = new Set();
|
|
8669
|
+
const expand = new Set();
|
|
8670
|
+
const lenient = this.filterMode() === 'lenient';
|
|
8671
|
+
const mark = (node, forced) => {
|
|
8672
|
+
const self = matches(node);
|
|
8673
|
+
let anyChild = false;
|
|
8674
|
+
for (const child of node.children ?? []) {
|
|
8675
|
+
if (mark(child, forced || (lenient && self)))
|
|
8676
|
+
anyChild = true;
|
|
8677
|
+
}
|
|
8678
|
+
const show = self || anyChild || forced;
|
|
8679
|
+
if (show)
|
|
8680
|
+
visible.add(node);
|
|
8681
|
+
if (anyChild && !self)
|
|
8682
|
+
expand.add(node);
|
|
8683
|
+
return self || anyChild;
|
|
8684
|
+
};
|
|
8685
|
+
const roots = (this.value() ?? []).filter((node) => mark(node, false));
|
|
8686
|
+
return { roots, visible, expand };
|
|
8687
|
+
}, ...(ngDevMode ? [{ debugName: "visibility" }] : []));
|
|
8688
|
+
rootCount = computed(() => this.visibility()?.roots.length ?? (this.value() ?? []).length, ...(ngDevMode ? [{ debugName: "rootCount" }] : []));
|
|
8689
|
+
flatRows = computed(() => {
|
|
8690
|
+
this.version();
|
|
8691
|
+
const field = this.sortField();
|
|
8692
|
+
const order = this.sortOrder();
|
|
8693
|
+
const filter = this.visibility();
|
|
8694
|
+
const out = [];
|
|
8695
|
+
const sort = (nodes) => field ? [...nodes].sort((a, b) => order * compareValues(SmzObjectUtils.resolveFieldData(a.data, field), SmzObjectUtils.resolveFieldData(b.data, field))) : nodes;
|
|
8696
|
+
const walk = (nodes, parent, level) => {
|
|
8697
|
+
for (const node of sort(nodes)) {
|
|
8698
|
+
if (filter && !filter.visible.has(node))
|
|
8699
|
+
continue;
|
|
8700
|
+
out.push({ node, parent, level });
|
|
8701
|
+
if ((node.expanded || filter?.expand.has(node)) && node.children?.length)
|
|
8702
|
+
walk(node.children, node, level + 1);
|
|
8703
|
+
}
|
|
8704
|
+
};
|
|
8705
|
+
walk(this.value() ?? [], null, 0);
|
|
8706
|
+
return out;
|
|
8707
|
+
}, ...(ngDevMode ? [{ debugName: "flatRows" }] : []));
|
|
8708
|
+
/** Linhas visiveis; com paginador, a pagina atual e calculada sobre os nos raiz. */
|
|
8709
|
+
pageRows = computed(() => {
|
|
8710
|
+
const all = this.flatRows();
|
|
8711
|
+
if (!this.paginator())
|
|
8712
|
+
return all;
|
|
8713
|
+
const roots = all.filter((row) => row.level === 0);
|
|
8714
|
+
const pageRoots = new Set(roots.slice(this.first(), this.first() + this.rows()).map((row) => row.node));
|
|
8715
|
+
let include = false;
|
|
8716
|
+
return all.filter((row) => {
|
|
8717
|
+
if (row.level === 0)
|
|
8718
|
+
include = pageRoots.has(row.node);
|
|
8719
|
+
return include;
|
|
8720
|
+
});
|
|
8721
|
+
}, ...(ngDevMode ? [{ debugName: "pageRows" }] : []));
|
|
8722
|
+
/** Filtro global (equivale a `filterGlobal` do `p-treeTable`). */
|
|
8723
|
+
filterGlobal(value, matchMode = 'contains') {
|
|
8724
|
+
this.globalFilter.set(value ? { value, matchMode } : null);
|
|
8725
|
+
this.first.set(0);
|
|
8726
|
+
}
|
|
8727
|
+
/** Filtro de uma coluna (campo de `node.data`). Valor vazio remove o filtro. */
|
|
8728
|
+
filter(value, field, matchMode = 'contains') {
|
|
8729
|
+
this.columnFilters.update((current) => ({ ...current, [field]: { value, matchMode } }));
|
|
8730
|
+
this.first.set(0);
|
|
8731
|
+
}
|
|
8732
|
+
/** Limpa filtros, ordenacao e volta para a primeira pagina (equivale a `clear()` do `p-treeTable`). */
|
|
8733
|
+
clear() {
|
|
8734
|
+
this.globalFilter.set(null);
|
|
8735
|
+
this.columnFilters.set({});
|
|
8736
|
+
this.sortField.set(null);
|
|
8737
|
+
this.sortOrder.set(1);
|
|
8738
|
+
this.first.set(0);
|
|
8739
|
+
}
|
|
8740
|
+
refresh() {
|
|
8741
|
+
this.version.update((v) => v + 1);
|
|
8742
|
+
}
|
|
8743
|
+
toggleNode(rowNode, event) {
|
|
8744
|
+
const node = rowNode.node;
|
|
8745
|
+
node.expanded = !node.expanded;
|
|
8746
|
+
(node.expanded ? this.nodeExpand : this.nodeCollapse).emit({ node, originalEvent: event });
|
|
8747
|
+
this.refresh();
|
|
8748
|
+
}
|
|
8749
|
+
sortBy(field) {
|
|
8750
|
+
const order = this.sortField() === field && this.sortOrder() === 1 ? -1 : 1;
|
|
8751
|
+
this.sortField.set(field);
|
|
8752
|
+
this.sortOrder.set(order);
|
|
8753
|
+
this.sorted.emit({ field, order });
|
|
8754
|
+
}
|
|
8755
|
+
isSelected(node) {
|
|
8756
|
+
const selection = this.selection();
|
|
8757
|
+
return Array.isArray(selection) ? selection.includes(node) : selection === node;
|
|
8758
|
+
}
|
|
8759
|
+
selectionState(node) {
|
|
8760
|
+
if (this.isSelected(node))
|
|
8761
|
+
return 'checked';
|
|
8762
|
+
return node.partialSelected ? 'partial' : 'unchecked';
|
|
8763
|
+
}
|
|
8764
|
+
onRowClick(rowNode, event) {
|
|
8765
|
+
const mode = this.selectionMode();
|
|
8766
|
+
const node = rowNode.node;
|
|
8767
|
+
if (!mode || node.selectable === false)
|
|
8768
|
+
return;
|
|
8769
|
+
if (mode === 'checkbox')
|
|
8770
|
+
return; // selecao so pelo checkbox
|
|
8771
|
+
const selected = this.isSelected(node);
|
|
8772
|
+
if (mode === 'single') {
|
|
8773
|
+
this.selection.set(selected ? null : node);
|
|
8774
|
+
}
|
|
8775
|
+
else {
|
|
8776
|
+
const current = Array.isArray(this.selection()) ? this.selection() : [];
|
|
8777
|
+
this.selection.set(selected ? current.filter((entry) => entry !== node) : [...current, node]);
|
|
8778
|
+
}
|
|
8779
|
+
(selected ? this.nodeUnselect : this.nodeSelect).emit({ node, originalEvent: event });
|
|
8780
|
+
}
|
|
8781
|
+
toggleCheckbox(rowNode, event) {
|
|
8782
|
+
const node = rowNode.node;
|
|
8783
|
+
const selected = this.isSelected(node);
|
|
8784
|
+
const set = new Set(Array.isArray(this.selection()) ? this.selection() : []);
|
|
8785
|
+
const apply = (target, value) => {
|
|
8786
|
+
if (value)
|
|
8787
|
+
set.add(target);
|
|
8788
|
+
else
|
|
8789
|
+
set.delete(target);
|
|
8790
|
+
target.partialSelected = false;
|
|
8791
|
+
if (this.propagateSelectionDown())
|
|
8792
|
+
target.children?.forEach((child) => apply(child, value));
|
|
8793
|
+
};
|
|
8794
|
+
apply(node, !selected);
|
|
8795
|
+
if (this.propagateSelectionUp()) {
|
|
8796
|
+
for (let parent = rowNode.parent; parent; parent = this.findParent(parent)) {
|
|
8797
|
+
const children = parent.children ?? [];
|
|
8798
|
+
const all = children.every((child) => set.has(child));
|
|
8799
|
+
const some = children.some((child) => set.has(child) || child.partialSelected);
|
|
8800
|
+
if (all)
|
|
8801
|
+
set.add(parent);
|
|
8802
|
+
else
|
|
8803
|
+
set.delete(parent);
|
|
8804
|
+
parent.partialSelected = !all && some;
|
|
8805
|
+
}
|
|
8806
|
+
}
|
|
8807
|
+
this.selection.set([...set]);
|
|
8808
|
+
(selected ? this.nodeUnselect : this.nodeSelect).emit({ node, originalEvent: event });
|
|
8809
|
+
this.refresh();
|
|
8810
|
+
}
|
|
8811
|
+
/** Marca/desmarca todos os nos (checkbox do cabecalho). */
|
|
8812
|
+
toggleAll(checked) {
|
|
8813
|
+
const set = new Set();
|
|
8814
|
+
const walk = (nodes) => {
|
|
8815
|
+
for (const node of nodes) {
|
|
8816
|
+
node.partialSelected = false;
|
|
8817
|
+
if (checked && node.selectable !== false)
|
|
8818
|
+
set.add(node);
|
|
8819
|
+
walk(node.children ?? []);
|
|
8820
|
+
}
|
|
8821
|
+
};
|
|
8822
|
+
walk(this.value() ?? []);
|
|
8823
|
+
this.selection.set([...set]);
|
|
8824
|
+
this.refresh();
|
|
8825
|
+
}
|
|
8826
|
+
allSelected() {
|
|
8827
|
+
const total = this.countNodes(this.value() ?? []);
|
|
8828
|
+
const selection = this.selection();
|
|
8829
|
+
return total > 0 && Array.isArray(selection) && selection.length >= total;
|
|
8830
|
+
}
|
|
8831
|
+
countNodes(nodes) {
|
|
8832
|
+
return nodes.reduce((sum, node) => sum + 1 + this.countNodes(node.children ?? []), 0);
|
|
8833
|
+
}
|
|
8834
|
+
findParent(node) {
|
|
8835
|
+
const search = (nodes, parent) => {
|
|
8836
|
+
for (const candidate of nodes) {
|
|
8837
|
+
if (candidate === node)
|
|
8838
|
+
return parent;
|
|
8839
|
+
const found = search(candidate.children ?? [], candidate);
|
|
8840
|
+
if (found !== undefined)
|
|
8841
|
+
return found;
|
|
8842
|
+
}
|
|
8843
|
+
return undefined;
|
|
8844
|
+
};
|
|
8845
|
+
return search(this.value() ?? [], null) ?? null;
|
|
8846
|
+
}
|
|
8847
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8848
|
+
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: `
|
|
8849
|
+
@if (captionTemplate(); as tpl) {
|
|
8850
|
+
<div class="border-b border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8851
|
+
}
|
|
8852
|
+
<div class="relative overflow-auto" [style.max-height]="scrollable() ? scrollHeight() : null">
|
|
8853
|
+
<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() ?? ''">
|
|
8854
|
+
<thead>
|
|
8855
|
+
@if (headerTemplate(); as tpl) {
|
|
8856
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" />
|
|
8857
|
+
}
|
|
8858
|
+
</thead>
|
|
8859
|
+
<tbody>
|
|
8860
|
+
@for (row of pageRows(); track row.node.key ?? row.node) {
|
|
8861
|
+
<ng-container [ngTemplateOutlet]="bodyTemplate() ?? null" [ngTemplateOutletContext]="{ $implicit: row, rowNode: row, node: row.node, rowData: row.node.data, columns: columns() }" />
|
|
8862
|
+
} @empty {
|
|
8863
|
+
@if (!loading()) {
|
|
8864
|
+
<tr>
|
|
8865
|
+
<td [attr.colspan]="columns().length || 1" class="px-4 py-6 text-center text-ui-fg-muted">
|
|
8866
|
+
@if (emptyTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /> } @else { {{ emptyMessage() }} }
|
|
8867
|
+
</td>
|
|
8868
|
+
</tr>
|
|
8869
|
+
}
|
|
8870
|
+
}
|
|
8871
|
+
</tbody>
|
|
8872
|
+
@if (footerTemplate(); as tpl) {
|
|
8873
|
+
<tfoot><ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /></tfoot>
|
|
8874
|
+
}
|
|
8875
|
+
</table>
|
|
8876
|
+
@if (loading()) {
|
|
8877
|
+
<div class="absolute inset-0 flex items-center justify-center bg-ui-surface-1/60 text-ui-primary" role="status">
|
|
8878
|
+
<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>
|
|
8879
|
+
</div>
|
|
8880
|
+
}
|
|
8881
|
+
</div>
|
|
8882
|
+
@if (paginator()) {
|
|
8883
|
+
<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)" />
|
|
8884
|
+
}
|
|
8885
|
+
@if (summaryTemplate(); as tpl) {
|
|
8886
|
+
<div class="border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8887
|
+
}
|
|
8888
|
+
`, 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 });
|
|
8889
|
+
}
|
|
8890
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableComponent, decorators: [{
|
|
8891
|
+
type: Component,
|
|
8892
|
+
args: [{
|
|
8893
|
+
selector: 'ui-tree-table',
|
|
8894
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8895
|
+
imports: [NgTemplateOutlet, SmzPaginatorComponent],
|
|
8896
|
+
host: { class: 'block overflow-hidden rounded-control border border-ui-line bg-ui-surface-1 font-ui text-ui-md text-ui-fg' },
|
|
8897
|
+
template: `
|
|
8898
|
+
@if (captionTemplate(); as tpl) {
|
|
8899
|
+
<div class="border-b border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8900
|
+
}
|
|
8901
|
+
<div class="relative overflow-auto" [style.max-height]="scrollable() ? scrollHeight() : null">
|
|
8902
|
+
<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() ?? ''">
|
|
8903
|
+
<thead>
|
|
8904
|
+
@if (headerTemplate(); as tpl) {
|
|
8905
|
+
<ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" />
|
|
8906
|
+
}
|
|
8907
|
+
</thead>
|
|
8908
|
+
<tbody>
|
|
8909
|
+
@for (row of pageRows(); track row.node.key ?? row.node) {
|
|
8910
|
+
<ng-container [ngTemplateOutlet]="bodyTemplate() ?? null" [ngTemplateOutletContext]="{ $implicit: row, rowNode: row, node: row.node, rowData: row.node.data, columns: columns() }" />
|
|
8911
|
+
} @empty {
|
|
8912
|
+
@if (!loading()) {
|
|
8913
|
+
<tr>
|
|
8914
|
+
<td [attr.colspan]="columns().length || 1" class="px-4 py-6 text-center text-ui-fg-muted">
|
|
8915
|
+
@if (emptyTemplate(); as tpl) { <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /> } @else { {{ emptyMessage() }} }
|
|
8916
|
+
</td>
|
|
8917
|
+
</tr>
|
|
8918
|
+
}
|
|
8919
|
+
}
|
|
8920
|
+
</tbody>
|
|
8921
|
+
@if (footerTemplate(); as tpl) {
|
|
8922
|
+
<tfoot><ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ $implicit: columns() }" /></tfoot>
|
|
8923
|
+
}
|
|
8924
|
+
</table>
|
|
8925
|
+
@if (loading()) {
|
|
8926
|
+
<div class="absolute inset-0 flex items-center justify-center bg-ui-surface-1/60 text-ui-primary" role="status">
|
|
8927
|
+
<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>
|
|
8928
|
+
</div>
|
|
8929
|
+
}
|
|
8930
|
+
</div>
|
|
8931
|
+
@if (paginator()) {
|
|
8932
|
+
<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)" />
|
|
8933
|
+
}
|
|
8934
|
+
@if (summaryTemplate(); as tpl) {
|
|
8935
|
+
<div class="border-t border-ui-line px-4 py-3"><ng-container [ngTemplateOutlet]="tpl" /></div>
|
|
8936
|
+
}
|
|
8937
|
+
`,
|
|
8938
|
+
}]
|
|
8939
|
+
}], 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 }] }] } });
|
|
8940
|
+
function compareValues(a, b) {
|
|
8941
|
+
if (a == null && b == null)
|
|
8942
|
+
return 0;
|
|
8943
|
+
if (a == null)
|
|
8944
|
+
return -1;
|
|
8945
|
+
if (b == null)
|
|
8946
|
+
return 1;
|
|
8947
|
+
if (typeof a === 'string' && typeof b === 'string')
|
|
8948
|
+
return a.localeCompare(b);
|
|
8949
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
8950
|
+
}
|
|
8951
|
+
/** Linha do corpo: `<tr [smzTtRow]="rowNode">`. Cuida de estilo, aria e selecao por clique. */
|
|
8952
|
+
class SmzTreeTableRowDirective {
|
|
8953
|
+
table = inject(SmzTreeTableComponent);
|
|
8954
|
+
rowNode = input.required({ ...(ngDevMode ? { debugName: "rowNode" } : {}), alias: 'smzTtRow' });
|
|
8955
|
+
classes = computed(() => {
|
|
8956
|
+
const mode = this.table.selectionMode();
|
|
8957
|
+
const selected = this.table.isSelected(this.rowNode().node);
|
|
8958
|
+
const hover = this.table.rowHover() ? 'hover:bg-ui-surface-3' : '';
|
|
8959
|
+
const interactive = mode && mode !== 'checkbox' ? `cursor-pointer ${hover}` : hover;
|
|
8960
|
+
return `${ROW_BASE} ${interactive} ${selected && mode !== 'checkbox' ? 'bg-ui-primary/10' : ''}`;
|
|
8961
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
8962
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableRowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
8963
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: SmzTreeTableRowDirective, isStandalone: true, selector: "tr[smzTtRow]", inputs: { rowNode: { classPropertyName: "rowNode", publicName: "smzTtRow", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "table.onRowClick(rowNode(), $event)" }, properties: { "class": "classes()", "attr.aria-level": "rowNode().level + 1", "attr.aria-expanded": "rowNode().node.children?.length ? !!rowNode().node.expanded : null", "attr.aria-selected": "table.selectionMode() ? table.isSelected(rowNode().node) : null" } }, ngImport: i0 });
|
|
8964
|
+
}
|
|
8965
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableRowDirective, decorators: [{
|
|
8966
|
+
type: Directive,
|
|
8967
|
+
args: [{
|
|
8968
|
+
selector: 'tr[smzTtRow]',
|
|
8969
|
+
host: {
|
|
8970
|
+
'[class]': 'classes()',
|
|
8971
|
+
'[attr.aria-level]': 'rowNode().level + 1',
|
|
8972
|
+
'[attr.aria-expanded]': 'rowNode().node.children?.length ? !!rowNode().node.expanded : null',
|
|
8973
|
+
'[attr.aria-selected]': 'table.selectionMode() ? table.isSelected(rowNode().node) : null',
|
|
8974
|
+
'(click)': 'table.onRowClick(rowNode(), $event)',
|
|
8975
|
+
},
|
|
8976
|
+
}]
|
|
8977
|
+
}], propDecorators: { rowNode: [{ type: i0.Input, args: [{ isSignal: true, alias: "smzTtRow", required: true }] }] } });
|
|
8978
|
+
/** Seta de expandir/recolher com recuo por nivel: `<ui-tree-table-toggler [rowNode]="rowNode" />`. */
|
|
8979
|
+
class SmzTreeTableTogglerComponent {
|
|
8980
|
+
table = inject(SmzTreeTableComponent);
|
|
8981
|
+
rowNode = input.required(...(ngDevMode ? [{ debugName: "rowNode" }] : []));
|
|
8982
|
+
hasChildren() {
|
|
8983
|
+
const node = this.rowNode().node;
|
|
8984
|
+
return !node.leaf && (node.children?.length ?? 0) > 0;
|
|
8985
|
+
}
|
|
8986
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableTogglerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8987
|
+
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: `
|
|
8988
|
+
<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)">
|
|
8989
|
+
<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>
|
|
8990
|
+
</button>
|
|
8991
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8992
|
+
}
|
|
8993
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableTogglerComponent, decorators: [{
|
|
8994
|
+
type: Component,
|
|
8995
|
+
args: [{
|
|
8996
|
+
selector: 'ui-tree-table-toggler',
|
|
8997
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8998
|
+
host: { class: 'inline-flex items-center align-middle', '[style.padding-left.rem]': 'rowNode().level * 1.5' },
|
|
8999
|
+
template: `
|
|
9000
|
+
<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)">
|
|
9001
|
+
<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>
|
|
9002
|
+
</button>
|
|
9003
|
+
`,
|
|
9004
|
+
}]
|
|
9005
|
+
}], propDecorators: { rowNode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowNode", required: true }] }] } });
|
|
9006
|
+
/** Checkbox de selecao da linha (modo `checkbox`): `<ui-tree-table-checkbox [value]="rowNode" />`. */
|
|
9007
|
+
class SmzTreeTableCheckboxComponent {
|
|
9008
|
+
table = inject(SmzTreeTableComponent);
|
|
9009
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
9010
|
+
state() {
|
|
9011
|
+
return this.table.selectionState(this.value().node);
|
|
9012
|
+
}
|
|
9013
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9014
|
+
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: `
|
|
9015
|
+
<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)">
|
|
9016
|
+
@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> }
|
|
9017
|
+
@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> }
|
|
9018
|
+
</button>
|
|
9019
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9020
|
+
}
|
|
9021
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableCheckboxComponent, decorators: [{
|
|
9022
|
+
type: Component,
|
|
9023
|
+
args: [{
|
|
9024
|
+
selector: 'ui-tree-table-checkbox',
|
|
9025
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9026
|
+
host: { class: 'inline-flex align-middle' },
|
|
9027
|
+
template: `
|
|
9028
|
+
<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)">
|
|
9029
|
+
@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> }
|
|
9030
|
+
@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> }
|
|
9031
|
+
</button>
|
|
9032
|
+
`,
|
|
9033
|
+
}]
|
|
9034
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
9035
|
+
/** Checkbox do cabecalho: seleciona/limpa todos os nos. */
|
|
9036
|
+
class SmzTreeTableHeaderCheckboxComponent {
|
|
9037
|
+
table = inject(SmzTreeTableComponent);
|
|
9038
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableHeaderCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9039
|
+
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: `
|
|
9040
|
+
<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())">
|
|
9041
|
+
@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> }
|
|
9042
|
+
</button>
|
|
9043
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9044
|
+
}
|
|
9045
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableHeaderCheckboxComponent, decorators: [{
|
|
9046
|
+
type: Component,
|
|
9047
|
+
args: [{
|
|
9048
|
+
selector: 'ui-tree-table-header-checkbox',
|
|
9049
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9050
|
+
host: { class: 'inline-flex align-middle' },
|
|
9051
|
+
template: `
|
|
9052
|
+
<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())">
|
|
9053
|
+
@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> }
|
|
9054
|
+
</button>
|
|
9055
|
+
`,
|
|
9056
|
+
}]
|
|
9057
|
+
}] });
|
|
9058
|
+
/** Cabecalho ordenavel: `<th [smzTtSortableColumn]="'nome'">Nome <ui-tree-table-sort-icon field="nome" /></th>`. */
|
|
9059
|
+
class SmzTreeTableSortableColumnDirective {
|
|
9060
|
+
table = inject(SmzTreeTableComponent);
|
|
9061
|
+
field = input.required({ ...(ngDevMode ? { debugName: "field" } : {}), alias: 'smzTtSortableColumn' });
|
|
9062
|
+
ariaSort() {
|
|
9063
|
+
return this.table.sortField() === this.field() ? (this.table.sortOrder() === 1 ? 'ascending' : 'descending') : 'none';
|
|
9064
|
+
}
|
|
9065
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableSortableColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
9066
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: SmzTreeTableSortableColumnDirective, isStandalone: true, selector: "th[smzTtSortableColumn]", inputs: { field: { classPropertyName: "field", publicName: "smzTtSortableColumn", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "table.sortBy(field())" }, properties: { "attr.aria-sort": "ariaSort()" }, classAttribute: "cursor-pointer select-none" }, ngImport: i0 });
|
|
9067
|
+
}
|
|
9068
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableSortableColumnDirective, decorators: [{
|
|
9069
|
+
type: Directive,
|
|
9070
|
+
args: [{
|
|
9071
|
+
selector: 'th[smzTtSortableColumn]',
|
|
9072
|
+
host: { class: 'cursor-pointer select-none', '(click)': 'table.sortBy(field())', '[attr.aria-sort]': 'ariaSort()' },
|
|
9073
|
+
}]
|
|
9074
|
+
}], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "smzTtSortableColumn", required: true }] }] } });
|
|
9075
|
+
class SmzTreeTableSortIconComponent {
|
|
9076
|
+
table = inject(SmzTreeTableComponent);
|
|
9077
|
+
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : []));
|
|
9078
|
+
dir() {
|
|
9079
|
+
return this.table.sortField() === this.field() ? this.table.sortOrder() : 0;
|
|
9080
|
+
}
|
|
9081
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableSortIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9082
|
+
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: `
|
|
9083
|
+
<svg viewBox="0 0 16 16" class="h-3.5 w-3.5" fill="none" aria-hidden="true">
|
|
9084
|
+
<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" />
|
|
9085
|
+
<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" />
|
|
9086
|
+
</svg>
|
|
9087
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9088
|
+
}
|
|
9089
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzTreeTableSortIconComponent, decorators: [{
|
|
9090
|
+
type: Component,
|
|
9091
|
+
args: [{
|
|
9092
|
+
selector: 'ui-tree-table-sort-icon',
|
|
9093
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9094
|
+
host: { class: 'ml-1 inline-flex align-middle text-ui-fg-muted' },
|
|
9095
|
+
template: `
|
|
9096
|
+
<svg viewBox="0 0 16 16" class="h-3.5 w-3.5" fill="none" aria-hidden="true">
|
|
9097
|
+
<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" />
|
|
9098
|
+
<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" />
|
|
9099
|
+
</svg>
|
|
9100
|
+
`,
|
|
9101
|
+
}]
|
|
9102
|
+
}], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }] } });
|
|
9103
|
+
const SMZ_TREE_TABLE = [
|
|
9104
|
+
SmzTreeTableComponent,
|
|
9105
|
+
SmzTreeTableRowDirective,
|
|
9106
|
+
SmzTreeTableTogglerComponent,
|
|
9107
|
+
SmzTreeTableCheckboxComponent,
|
|
9108
|
+
SmzTreeTableHeaderCheckboxComponent,
|
|
9109
|
+
SmzTreeTableSortableColumnDirective,
|
|
9110
|
+
SmzTreeTableSortIconComponent,
|
|
9111
|
+
SmzTemplateDirective,
|
|
9112
|
+
];
|
|
9113
|
+
|
|
9114
|
+
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
9115
|
+
class SmzConfirmContentComponent {
|
|
9116
|
+
options = inject(SmzDialogConfig).data;
|
|
9117
|
+
ref = inject((SmzDialogRef));
|
|
9118
|
+
close(accepted) {
|
|
9119
|
+
this.ref.close(accepted);
|
|
9120
|
+
}
|
|
9121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzConfirmContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: SmzConfirmContentComponent, isStandalone: true, selector: "ui-confirm-content", ngImport: i0, template: `
|
|
9123
|
+
<div class="flex items-start gap-3 font-ui text-ui-md text-ui-fg">
|
|
9124
|
+
@if (options.icon) {
|
|
9125
|
+
<i [class]="options.icon + ' mt-0.5 text-ui-xl text-ui-warning'" aria-hidden="true"></i>
|
|
9126
|
+
}
|
|
9127
|
+
<p class="m-0 flex-1">{{ options.message }}</p>
|
|
9128
|
+
</div>
|
|
9129
|
+
<div class="mt-5 flex justify-end gap-2">
|
|
9130
|
+
@if (options.rejectVisible !== false) {
|
|
9131
|
+
<button smzButton type="button" severity="secondary" variant="outlined" [label]="options.rejectLabel ?? 'Não'" (click)="close(false)"></button>
|
|
9132
|
+
}
|
|
9133
|
+
@if (options.acceptVisible !== false) {
|
|
9134
|
+
<button smzButton type="button" [severity]="options.acceptSeverity ?? 'primary'" [label]="options.acceptLabel ?? 'Sim'" (click)="close(true)"></button>
|
|
9135
|
+
}
|
|
9136
|
+
</div>
|
|
9137
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SmzButtonComponent, selector: "button[smzButton], a[smzButton]", inputs: ["label", "icon", "iconPosition", "severity", "variant", "size", "text", "outlined", "rounded", "loading", "styleClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9138
|
+
}
|
|
9139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzConfirmContentComponent, decorators: [{
|
|
9140
|
+
type: Component,
|
|
9141
|
+
args: [{
|
|
9142
|
+
selector: 'ui-confirm-content',
|
|
9143
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9144
|
+
imports: [SmzButtonComponent],
|
|
9145
|
+
template: `
|
|
9146
|
+
<div class="flex items-start gap-3 font-ui text-ui-md text-ui-fg">
|
|
9147
|
+
@if (options.icon) {
|
|
9148
|
+
<i [class]="options.icon + ' mt-0.5 text-ui-xl text-ui-warning'" aria-hidden="true"></i>
|
|
9149
|
+
}
|
|
9150
|
+
<p class="m-0 flex-1">{{ options.message }}</p>
|
|
9151
|
+
</div>
|
|
9152
|
+
<div class="mt-5 flex justify-end gap-2">
|
|
9153
|
+
@if (options.rejectVisible !== false) {
|
|
9154
|
+
<button smzButton type="button" severity="secondary" variant="outlined" [label]="options.rejectLabel ?? 'Não'" (click)="close(false)"></button>
|
|
9155
|
+
}
|
|
9156
|
+
@if (options.acceptVisible !== false) {
|
|
9157
|
+
<button smzButton type="button" [severity]="options.acceptSeverity ?? 'primary'" [label]="options.acceptLabel ?? 'Sim'" (click)="close(true)"></button>
|
|
9158
|
+
}
|
|
9159
|
+
</div>
|
|
9160
|
+
`,
|
|
9161
|
+
}]
|
|
9162
|
+
}] });
|
|
9163
|
+
/**
|
|
9164
|
+
* Confirmacao modal. Substitui o `ConfirmationService` + `<p-confirmdialog>` do PrimeNG
|
|
9165
|
+
* (nao ha componente a declarar no template).
|
|
9166
|
+
*
|
|
9167
|
+
* confirm.confirm({ message: 'Excluir?', header: 'Confirmacao', icon: 'fa-solid fa-triangle-exclamation', accept: () => ..., reject: () => ... });
|
|
9168
|
+
*/
|
|
9169
|
+
class SmzConfirmationService {
|
|
9170
|
+
dialogs = inject(SmzDialogService);
|
|
9171
|
+
confirm(confirmation) {
|
|
9172
|
+
const ref = this.dialogs.open(SmzConfirmContentComponent, {
|
|
9173
|
+
header: confirmation.header ?? 'Confirmação',
|
|
9174
|
+
width: confirmation.width ?? '28rem',
|
|
9175
|
+
closeOnEscape: confirmation.closeOnEscape ?? true,
|
|
9176
|
+
data: confirmation,
|
|
9177
|
+
});
|
|
9178
|
+
ref.onClose.subscribe((accepted) => {
|
|
9179
|
+
if (accepted === true)
|
|
9180
|
+
confirmation.accept?.();
|
|
9181
|
+
else
|
|
9182
|
+
confirmation.reject?.();
|
|
9183
|
+
});
|
|
9184
|
+
return ref;
|
|
9185
|
+
}
|
|
9186
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzConfirmationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9187
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzConfirmationService, providedIn: 'root' });
|
|
9188
|
+
}
|
|
9189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzConfirmationService, decorators: [{
|
|
9190
|
+
type: Injectable,
|
|
9191
|
+
args: [{ providedIn: 'root' }]
|
|
9192
|
+
}] });
|
|
9193
|
+
|
|
9194
|
+
/* eslint-disable max-len -- classes Tailwind nos templates */
|
|
9195
|
+
/**
|
|
9196
|
+
* Selecao de arquivos com area de arrastar e soltar e lista de escolhidos.
|
|
9197
|
+
* Substitui o `p-fileupload` (modo `basic`/`advanced` sem envio automatico): o envio ao servidor
|
|
9198
|
+
* fica a cargo do app (ex.: `HttpClient` no handler de `(selected)`).
|
|
9199
|
+
*
|
|
9200
|
+
* <ui-file-upload accept="image/*" [multiple]="true" [maxFileSize]="1000000" (selected)="enviar($event.files)" />
|
|
9201
|
+
*/
|
|
9202
|
+
class SmzFileUploadComponent {
|
|
9203
|
+
accept = input('', ...(ngDevMode ? [{ debugName: "accept" }] : []));
|
|
9204
|
+
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
9205
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
9206
|
+
/** Tamanho maximo por arquivo, em bytes. */
|
|
9207
|
+
maxFileSize = input(null, ...(ngDevMode ? [{ debugName: "maxFileSize" }] : []));
|
|
9208
|
+
chooseLabel = input('Escolher arquivo', ...(ngDevMode ? [{ debugName: "chooseLabel" }] : []));
|
|
9209
|
+
dropLabel = input('ou arraste aqui', ...(ngDevMode ? [{ debugName: "dropLabel" }] : []));
|
|
9210
|
+
selected = output();
|
|
9211
|
+
removed = output();
|
|
9212
|
+
rejected = output();
|
|
9213
|
+
files = signal([], ...(ngDevMode ? [{ debugName: "files" }] : []));
|
|
9214
|
+
dragging = signal(false, ...(ngDevMode ? [{ debugName: "dragging" }] : []));
|
|
9215
|
+
fileInput = viewChild.required('picker');
|
|
9216
|
+
/** Limpa a lista (equivale a `clear()` do `p-fileupload`). */
|
|
9217
|
+
clear() {
|
|
9218
|
+
this.files.set([]);
|
|
9219
|
+
this.fileInput().nativeElement.value = '';
|
|
9220
|
+
}
|
|
9221
|
+
onPick(event) {
|
|
9222
|
+
const target = event.target;
|
|
9223
|
+
this.add(Array.from(target.files ?? []), event);
|
|
9224
|
+
target.value = '';
|
|
9225
|
+
}
|
|
9226
|
+
onDragOver(event) {
|
|
9227
|
+
if (this.disabled())
|
|
9228
|
+
return;
|
|
9229
|
+
event.preventDefault();
|
|
9230
|
+
this.dragging.set(true);
|
|
9231
|
+
}
|
|
9232
|
+
onDrop(event) {
|
|
9233
|
+
event.preventDefault();
|
|
9234
|
+
this.dragging.set(false);
|
|
9235
|
+
if (this.disabled())
|
|
9236
|
+
return;
|
|
9237
|
+
this.add(Array.from(event.dataTransfer?.files ?? []), event);
|
|
9238
|
+
}
|
|
9239
|
+
remove(file) {
|
|
9240
|
+
this.files.update((list) => list.filter((entry) => entry !== file));
|
|
9241
|
+
this.removed.emit({ file });
|
|
9242
|
+
}
|
|
9243
|
+
size(file) {
|
|
9244
|
+
return file.size < 1024 * 1024 ? `${Math.max(1, Math.round(file.size / 1024))} KB` : `${(file.size / 1024 / 1024).toFixed(1)} MB`;
|
|
9245
|
+
}
|
|
9246
|
+
add(incoming, event) {
|
|
9247
|
+
const accepted = [];
|
|
9248
|
+
for (const file of incoming) {
|
|
9249
|
+
if (!this.matchesAccept(file))
|
|
9250
|
+
this.rejected.emit({ file, reason: 'type' });
|
|
9251
|
+
else if (this.maxFileSize() != null && file.size > this.maxFileSize())
|
|
9252
|
+
this.rejected.emit({ file, reason: 'size' });
|
|
9253
|
+
else
|
|
9254
|
+
accepted.push(file);
|
|
9255
|
+
}
|
|
9256
|
+
if (accepted.length === 0)
|
|
9257
|
+
return;
|
|
9258
|
+
const next = this.multiple() ? [...this.files(), ...accepted] : [accepted[0]];
|
|
9259
|
+
this.files.set(next);
|
|
9260
|
+
this.selected.emit({ files: next, originalEvent: event });
|
|
9261
|
+
}
|
|
9262
|
+
matchesAccept(file) {
|
|
9263
|
+
const accept = (this.accept() ?? '').trim();
|
|
9264
|
+
if (!accept)
|
|
9265
|
+
return true;
|
|
9266
|
+
return accept.split(',').map((rule) => rule.trim().toLowerCase()).some((rule) => {
|
|
9267
|
+
if (rule.startsWith('.'))
|
|
9268
|
+
return file.name.toLowerCase().endsWith(rule);
|
|
9269
|
+
if (rule.endsWith('/*'))
|
|
9270
|
+
return file.type.toLowerCase().startsWith(rule.slice(0, -1));
|
|
9271
|
+
return file.type.toLowerCase() === rule;
|
|
9272
|
+
});
|
|
9273
|
+
}
|
|
9274
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9275
|
+
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: `
|
|
9276
|
+
<input #picker type="file" class="sr-only" [accept]="accept() ?? ''" [multiple]="multiple()" [disabled]="disabled()" (change)="onPick($event)" />
|
|
9277
|
+
<div
|
|
9278
|
+
class="flex flex-col items-center justify-center gap-2 rounded-card border-2 border-dashed p-6 text-center transition-colors duration-ui"
|
|
9279
|
+
[class]="dragging() ? 'border-ui-primary bg-ui-primary/10' : 'border-ui-line-strong bg-ui-surface-1'"
|
|
9280
|
+
[class.opacity-50]="disabled()"
|
|
9281
|
+
(dragover)="onDragOver($event)"
|
|
9282
|
+
(dragleave)="dragging.set(false)"
|
|
9283
|
+
(drop)="onDrop($event)"
|
|
9284
|
+
>
|
|
9285
|
+
<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>
|
|
9286
|
+
<span class="text-ui-sm text-ui-fg-muted">{{ dropLabel() }}</span>
|
|
9287
|
+
</div>
|
|
9288
|
+
@if (files().length > 0) {
|
|
9289
|
+
<ul class="m-0 mt-3 flex list-none flex-col gap-2 p-0">
|
|
9290
|
+
@for (file of files(); track file) {
|
|
9291
|
+
<li class="flex items-center justify-between gap-2 rounded-control border border-ui-line px-3 py-2">
|
|
9292
|
+
<span class="min-w-0 flex-1 truncate">{{ file.name }} <span class="text-ui-sm text-ui-fg-muted">({{ size(file) }})</span></span>
|
|
9293
|
+
<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)">
|
|
9294
|
+
<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>
|
|
9295
|
+
</button>
|
|
9296
|
+
</li>
|
|
9297
|
+
}
|
|
9298
|
+
</ul>
|
|
9299
|
+
}
|
|
9300
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9301
|
+
}
|
|
9302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFileUploadComponent, decorators: [{
|
|
9303
|
+
type: Component,
|
|
9304
|
+
args: [{
|
|
9305
|
+
selector: 'ui-file-upload',
|
|
9306
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9307
|
+
host: { class: 'block font-ui text-ui-md text-ui-fg' },
|
|
9308
|
+
template: `
|
|
9309
|
+
<input #picker type="file" class="sr-only" [accept]="accept() ?? ''" [multiple]="multiple()" [disabled]="disabled()" (change)="onPick($event)" />
|
|
9310
|
+
<div
|
|
9311
|
+
class="flex flex-col items-center justify-center gap-2 rounded-card border-2 border-dashed p-6 text-center transition-colors duration-ui"
|
|
9312
|
+
[class]="dragging() ? 'border-ui-primary bg-ui-primary/10' : 'border-ui-line-strong bg-ui-surface-1'"
|
|
9313
|
+
[class.opacity-50]="disabled()"
|
|
9314
|
+
(dragover)="onDragOver($event)"
|
|
9315
|
+
(dragleave)="dragging.set(false)"
|
|
9316
|
+
(drop)="onDrop($event)"
|
|
9317
|
+
>
|
|
9318
|
+
<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>
|
|
9319
|
+
<span class="text-ui-sm text-ui-fg-muted">{{ dropLabel() }}</span>
|
|
9320
|
+
</div>
|
|
9321
|
+
@if (files().length > 0) {
|
|
9322
|
+
<ul class="m-0 mt-3 flex list-none flex-col gap-2 p-0">
|
|
9323
|
+
@for (file of files(); track file) {
|
|
9324
|
+
<li class="flex items-center justify-between gap-2 rounded-control border border-ui-line px-3 py-2">
|
|
9325
|
+
<span class="min-w-0 flex-1 truncate">{{ file.name }} <span class="text-ui-sm text-ui-fg-muted">({{ size(file) }})</span></span>
|
|
9326
|
+
<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)">
|
|
9327
|
+
<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>
|
|
9328
|
+
</button>
|
|
9329
|
+
</li>
|
|
9330
|
+
}
|
|
9331
|
+
</ul>
|
|
9332
|
+
}
|
|
9333
|
+
`,
|
|
9334
|
+
}]
|
|
9335
|
+
}], 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 }] }] } });
|
|
9336
|
+
|
|
7994
9337
|
/**
|
|
7995
9338
|
* Generated bundle index. Do not edit.
|
|
7996
9339
|
*/
|
|
7997
9340
|
|
|
7998
|
-
export { SMZ_DIALOG_CONTENT, SMZ_SOFT_TONE, SMZ_SOLID_TONE, SmzAccordionComponent, SmzAccordionContentComponent, SmzAccordionHeaderComponent, SmzAccordionPanelComponent, SmzAnchoredPanel, SmzAutoCompleteComponent, SmzAutoFocusDirective, SmzBadgeComponent, SmzBadgeDirective, SmzBlockUiComponent, SmzButtonComponent, SmzCheckboxComponent, SmzColorPickerComponent, SmzConnectedOverlayScrollHandler, SmzDataViewComponent, SmzDatePickerComponent, SmzDialogComponent, SmzDialogConfig, SmzDialogFrameComponent, SmzDialogRef, SmzDialogService, SmzDividerComponent, SmzDomHandler, SmzDrawerComponent, SmzFilterMatchMode, SmzFilterOperator, SmzFilterService, SmzIconComponent, SmzIconFieldComponent, SmzInputGroupAddonComponent, SmzInputGroupComponent, SmzInputIconComponent, SmzInputMaskComponent, SmzInputNumberComponent, SmzInputTextDirective, SmzListboxComponent, SmzLocaleService, SmzMenuListComponent, SmzMessageComponent, SmzMessageService, SmzMultiSelectComponent, SmzObjectUtils, SmzPaginatorComponent, SmzPasswordComponent, SmzPickListComponent, SmzPopoverComponent, SmzProgressBarComponent, SmzRadioButtonComponent, SmzRippleDirective, SmzSelectButtonComponent, SmzSelectComponent, SmzSkeletonComponent, SmzStyleClassDirective, SmzTabComponent, SmzTabListComponent, SmzTabPanelComponent, SmzTabPanelsComponent, SmzTabsComponent, SmzTagComponent, SmzTemplateDirective, SmzTextareaDirective, SmzThemeService, SmzToastContainerComponent, SmzToggleSwitchComponent, SmzToolbarComponent, SmzTooltipComponent, SmzTooltipDirective, SmzTranslationKeys, SmzTreeSelectComponent, SmzUiTimelineComponent, SmzUiTreeComponent, SmzValueAccessor, SmzZIndex, filterOptions, optionDisabled, optionLabel, optionValue, sameValue, smzCalendarStart, smzCx, smzFindTemplate, smzFormatDate, smzMergeClasses, smzNormalizeSeverity, smzNormalizeStyleClass, smzParseButtonStyleClass, smzParseDate, smzSameDay, smzStartOfDay, smzStaticHostClass, smzTwoDigits, smzUniqueId, smzVariants };
|
|
9341
|
+
export { SMZ_DIALOG_CONTENT, SMZ_SOFT_TONE, SMZ_SOLID_TONE, SMZ_TREE_TABLE, SmzAccordionComponent, SmzAccordionContentComponent, SmzAccordionHeaderComponent, SmzAccordionPanelComponent, SmzAnchoredPanel, SmzAutoCompleteComponent, SmzAutoFocusDirective, SmzBadgeComponent, SmzBadgeDirective, SmzBlockUiComponent, SmzButtonComponent, SmzCardComponent, SmzCheckboxComponent, SmzColorPickerComponent, SmzConfirmContentComponent, SmzConfirmationService, SmzConnectedOverlayScrollHandler, SmzDataViewComponent, SmzDatePickerComponent, SmzDialogComponent, SmzDialogConfig, SmzDialogFrameComponent, SmzDialogRef, SmzDialogService, SmzDividerComponent, SmzDomHandler, SmzDrawerComponent, SmzFileUploadComponent, SmzFilterMatchMode, SmzFilterOperator, SmzFilterService, SmzFloatLabelComponent, SmzIconComponent, SmzIconFieldComponent, SmzInputGroupAddonComponent, SmzInputGroupComponent, SmzInputIconComponent, SmzInputMaskComponent, SmzInputNumberComponent, SmzInputTextDirective, SmzListboxComponent, SmzLocaleService, SmzMenuListComponent, SmzMessageComponent, SmzMessageService, SmzMultiSelectComponent, SmzObjectUtils, SmzPaginatorComponent, SmzPanelComponent, SmzPasswordComponent, SmzPickListComponent, SmzPopoverComponent, SmzProgressBarComponent, SmzProgressSpinnerComponent, SmzRadioButtonComponent, SmzRippleDirective, SmzSelectButtonComponent, SmzSelectComponent, SmzSkeletonComponent, SmzSplitterComponent, SmzSplitterPanelComponent, SmzStyleClassDirective, SmzTabComponent, SmzTabListComponent, SmzTabPanelComponent, SmzTabPanelsComponent, SmzTabsComponent, SmzTagComponent, SmzTemplateDirective, SmzTextareaDirective, SmzThemeService, SmzToastContainerComponent, SmzToggleSwitchComponent, SmzToolbarComponent, SmzTooltipComponent, SmzTooltipDirective, SmzTranslationKeys, SmzTreeSelectComponent, SmzTreeTableCheckboxComponent, SmzTreeTableComponent, SmzTreeTableHeaderCheckboxComponent, SmzTreeTableRowDirective, SmzTreeTableSortIconComponent, SmzTreeTableSortableColumnDirective, SmzTreeTableTogglerComponent, SmzUiTimelineComponent, SmzUiTreeComponent, SmzValueAccessor, SmzZIndex, filterOptions, optionDisabled, optionLabel, optionValue, sameValue, smzCalendarStart, smzCx, smzFindTemplate, smzFormatDate, smzMergeClasses, smzNormalizeSeverity, smzNormalizeStyleClass, smzParseButtonStyleClass, smzParseDate, smzSameDay, smzStartOfDay, smzStaticHostClass, smzTwoDigits, smzUniqueId, smzVariants };
|
|
7999
9342
|
//# sourceMappingURL=ngx-smz-ui-kit.mjs.map
|