@aaamb/ngx-design-system 1.5.7 → 1.7.0
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.
|
@@ -2737,6 +2737,10 @@ class SideNavComponent {
|
|
|
2737
2737
|
footerButton = input(null, ...(ngDevMode ? [{ debugName: "footerButton" }] : /* istanbul ignore next */ []));
|
|
2738
2738
|
footerButtons = input([], ...(ngDevMode ? [{ debugName: "footerButtons" }] : /* istanbul ignore next */ []));
|
|
2739
2739
|
logoAlt = input('Side navigation logo', ...(ngDevMode ? [{ debugName: "logoAlt" }] : /* istanbul ignore next */ []));
|
|
2740
|
+
/** Grouped options with optional titles. When set, takes precedence over `options`. */
|
|
2741
|
+
sections = input([], ...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
|
|
2742
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2743
|
+
copyrightText = input('Copyrights by AAAMB', ...(ngDevMode ? [{ debugName: "copyrightText" }] : /* istanbul ignore next */ []));
|
|
2740
2744
|
optionSelected = output();
|
|
2741
2745
|
childSelected = output();
|
|
2742
2746
|
activePathChange = output();
|
|
@@ -2745,6 +2749,39 @@ class SideNavComponent {
|
|
|
2745
2749
|
currentLogoSrc = computed(() => this.isCollapsed()
|
|
2746
2750
|
? this.collapsedLogoSrc() || this.logoSrc()
|
|
2747
2751
|
: this.logoSrc(), ...(ngDevMode ? [{ debugName: "currentLogoSrc" }] : /* istanbul ignore next */ []));
|
|
2752
|
+
isCompact = computed(() => this.variant() === 'compact', ...(ngDevMode ? [{ debugName: "isCompact" }] : /* istanbul ignore next */ []));
|
|
2753
|
+
// `offset` keeps data-testid indexes flat across sections.
|
|
2754
|
+
resolvedSections = computed(() => {
|
|
2755
|
+
const sections = this.sections().length
|
|
2756
|
+
? this.sections()
|
|
2757
|
+
: [{ options: this.options() }];
|
|
2758
|
+
let offset = 0;
|
|
2759
|
+
return sections.map((section) => {
|
|
2760
|
+
const resolved = { ...section, offset };
|
|
2761
|
+
offset += section.options.length;
|
|
2762
|
+
return resolved;
|
|
2763
|
+
});
|
|
2764
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedSections" }] : /* istanbul ignore next */ []));
|
|
2765
|
+
navClasses = computed(() => {
|
|
2766
|
+
if (this.isCompact()) {
|
|
2767
|
+
const padding = this.isCollapsed() ? 'px-0' : 'px-3';
|
|
2768
|
+
return `min-h-0 overflow-y-auto overflow-x-hidden gap-1 ${padding} py-4`;
|
|
2769
|
+
}
|
|
2770
|
+
return this.isCollapsed()
|
|
2771
|
+
? 'overflow-hidden gap-5 px-0 py-8'
|
|
2772
|
+
: 'overflow-hidden gap-5 px-5 py-8';
|
|
2773
|
+
}, ...(ngDevMode ? [{ debugName: "navClasses" }] : /* istanbul ignore next */ []));
|
|
2774
|
+
footerContainerClasses = computed(() => this.isCompact() ? 'h-10 px-3' : 'h-12 px-5', ...(ngDevMode ? [{ debugName: "footerContainerClasses" }] : /* istanbul ignore next */ []));
|
|
2775
|
+
footerButtonClasses = computed(() => {
|
|
2776
|
+
if (this.isCompact()) {
|
|
2777
|
+
return this.isCollapsed()
|
|
2778
|
+
? 'h-9 w-9 mx-auto rounded-lg text-sm hover:bg-white/10 px-0 justify-center'
|
|
2779
|
+
: 'h-9 rounded-lg text-sm hover:bg-white/10 px-3 justify-start';
|
|
2780
|
+
}
|
|
2781
|
+
return this.isCollapsed()
|
|
2782
|
+
? 'h-10 rounded-[3rem] hover:bg-[#005f58] px-2 justify-center'
|
|
2783
|
+
: 'h-10 rounded-[3rem] hover:bg-[#005f58] px-5 justify-start';
|
|
2784
|
+
}, ...(ngDevMode ? [{ debugName: "footerButtonClasses" }] : /* istanbul ignore next */ []));
|
|
2748
2785
|
onOptionClick(option) {
|
|
2749
2786
|
if (option.children?.length) {
|
|
2750
2787
|
this.toggleMenu(option.name);
|
|
@@ -2774,28 +2811,56 @@ class SideNavComponent {
|
|
|
2774
2811
|
? this.isRouteActive(option.url)
|
|
2775
2812
|
: false;
|
|
2776
2813
|
const isChildActive = option.children?.some((child) => this.isRouteActive(child.url)) ?? false;
|
|
2814
|
+
// Compact highlights only the active child while it is visible, so the
|
|
2815
|
+
// parent does not compete with it.
|
|
2816
|
+
if (this.isCompact() && this.expandedMenus()[option.name]) {
|
|
2817
|
+
return isCurrentUrlActive;
|
|
2818
|
+
}
|
|
2777
2819
|
return isCurrentUrlActive || isChildActive;
|
|
2778
2820
|
}
|
|
2821
|
+
childListClasses() {
|
|
2822
|
+
if (this.isCompact()) {
|
|
2823
|
+
return this.isCollapsed() ? 'items-center gap-1 mt-1' : 'pl-6 gap-1 mt-1';
|
|
2824
|
+
}
|
|
2825
|
+
return this.isCollapsed() ? 'items-center gap-2 mt-2' : 'pl-8 gap-4 mt-2';
|
|
2826
|
+
}
|
|
2779
2827
|
isPathActive(path) {
|
|
2780
2828
|
return this.isRouteActive(path);
|
|
2781
2829
|
}
|
|
2830
|
+
hasBadge(option) {
|
|
2831
|
+
return option.badge !== undefined && option.badge !== null && option.badge !== '';
|
|
2832
|
+
}
|
|
2782
2833
|
optionButtonClasses(option) {
|
|
2834
|
+
const badge = this.hasBadge(option) ? ' relative' : '';
|
|
2835
|
+
if (this.isCompact()) {
|
|
2836
|
+
const base = this.isCollapsed()
|
|
2837
|
+
? 'justify-center w-9 h-9 rounded-lg mx-auto'
|
|
2838
|
+
: 'w-full h-9 px-3 rounded-lg';
|
|
2839
|
+
return this.isOptionActive(option)
|
|
2840
|
+
? `${base}${badge} bg-green-6 text-green-base`
|
|
2841
|
+
: `${base}${badge} bg-transparent hover:bg-white/10`;
|
|
2842
|
+
}
|
|
2783
2843
|
const base = this.isCollapsed()
|
|
2784
2844
|
? 'justify-center w-12 h-12 rounded-full mx-auto px-2 bg-transparent'
|
|
2785
2845
|
: 'w-full px-5 py-2 rounded-[3rem] bg-transparent';
|
|
2786
2846
|
if (this.isOptionActive(option)) {
|
|
2787
|
-
return `${base} bg-white text-green-base`;
|
|
2847
|
+
return `${base}${badge} bg-white text-green-base`;
|
|
2788
2848
|
}
|
|
2789
|
-
return `${base} hover:bg-[#006761]`;
|
|
2849
|
+
return `${base}${badge} hover:bg-[#006761]`;
|
|
2790
2850
|
}
|
|
2791
2851
|
childButtonClasses(path, collapsed) {
|
|
2852
|
+
// Compact children read like the other options: same size, weight and shape.
|
|
2853
|
+
if (this.isCompact() && !collapsed) {
|
|
2854
|
+
const compact = 'w-full px-3 rounded-lg text-sm font-medium whitespace-nowrap';
|
|
2855
|
+
return this.isPathActive(path)
|
|
2856
|
+
? `${compact} bg-green-6 text-green-base`
|
|
2857
|
+
: `${compact} bg-transparent text-neutral-light-text hover:bg-white/10`;
|
|
2858
|
+
}
|
|
2792
2859
|
const base = collapsed
|
|
2793
|
-
? 'justify-center bg-transparent p-0 w-5 h-5'
|
|
2794
|
-
: 'text-base font-normal px-4';
|
|
2860
|
+
? 'justify-center bg-transparent p-0 w-5 h-5 rounded-[44px]'
|
|
2861
|
+
: 'text-base font-normal px-4 rounded-[44px]';
|
|
2795
2862
|
if (this.isPathActive(path)) {
|
|
2796
|
-
return collapsed
|
|
2797
|
-
? 'justify-center bg-transparent p-0 w-5 h-5'
|
|
2798
|
-
: `${base} bg-white text-green-base`;
|
|
2863
|
+
return collapsed ? base : `${base} bg-white text-green-base`;
|
|
2799
2864
|
}
|
|
2800
2865
|
return collapsed
|
|
2801
2866
|
? base
|
|
@@ -2823,7 +2888,7 @@ class SideNavComponent {
|
|
|
2823
2888
|
return this.activePath() || this.internalActivePath();
|
|
2824
2889
|
}
|
|
2825
2890
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SideNavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2826
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: SideNavComponent, isStandalone: true, selector: "ads-side-nav", inputs: { isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, activePath: { classPropertyName: "activePath", publicName: "activePath", isSignal: true, isRequired: false, transformFunction: null }, logoSrc: { classPropertyName: "logoSrc", publicName: "logoSrc", isSignal: true, isRequired: false, transformFunction: null }, footerLogoSrc: { classPropertyName: "footerLogoSrc", publicName: "footerLogoSrc", isSignal: true, isRequired: false, transformFunction: null }, collapsedLogoSrc: { classPropertyName: "collapsedLogoSrc", publicName: "collapsedLogoSrc", isSignal: true, isRequired: false, transformFunction: null }, footerButton: { classPropertyName: "footerButton", publicName: "footerButton", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", isSignal: true, isRequired: false, transformFunction: null }, logoAlt: { classPropertyName: "logoAlt", publicName: "logoAlt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionSelected: "optionSelected", childSelected: "childSelected", activePathChange: "activePathChange" }, ngImport: i0, template: `
|
|
2891
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: SideNavComponent, isStandalone: true, selector: "ads-side-nav", inputs: { isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, activePath: { classPropertyName: "activePath", publicName: "activePath", isSignal: true, isRequired: false, transformFunction: null }, logoSrc: { classPropertyName: "logoSrc", publicName: "logoSrc", isSignal: true, isRequired: false, transformFunction: null }, footerLogoSrc: { classPropertyName: "footerLogoSrc", publicName: "footerLogoSrc", isSignal: true, isRequired: false, transformFunction: null }, collapsedLogoSrc: { classPropertyName: "collapsedLogoSrc", publicName: "collapsedLogoSrc", isSignal: true, isRequired: false, transformFunction: null }, footerButton: { classPropertyName: "footerButton", publicName: "footerButton", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", isSignal: true, isRequired: false, transformFunction: null }, logoAlt: { classPropertyName: "logoAlt", publicName: "logoAlt", isSignal: true, isRequired: false, transformFunction: null }, sections: { classPropertyName: "sections", publicName: "sections", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, copyrightText: { classPropertyName: "copyrightText", publicName: "copyrightText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionSelected: "optionSelected", childSelected: "childSelected", activePathChange: "activePathChange" }, ngImport: i0, template: `
|
|
2827
2892
|
<aside
|
|
2828
2893
|
class="w-full h-full bg-green-base flex flex-col items-center select-none"
|
|
2829
2894
|
>
|
|
@@ -2839,118 +2904,179 @@ class SideNavComponent {
|
|
|
2839
2904
|
}
|
|
2840
2905
|
</div>
|
|
2841
2906
|
<nav
|
|
2842
|
-
class="relative w-full flex-1 flex flex-col
|
|
2843
|
-
[ngClass]="
|
|
2907
|
+
class="relative w-full flex-1 flex flex-col"
|
|
2908
|
+
[ngClass]="navClasses()"
|
|
2844
2909
|
>
|
|
2845
|
-
@for (
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2910
|
+
@for (
|
|
2911
|
+
section of resolvedSections();
|
|
2912
|
+
track $index;
|
|
2913
|
+
let sectionIdx = $index
|
|
2914
|
+
) {
|
|
2915
|
+
@if (isCollapsed()) {
|
|
2916
|
+
@if (sectionIdx > 0) {
|
|
2917
|
+
<div
|
|
2918
|
+
class="mx-auto my-2 w-6 border-t border-white/20"
|
|
2919
|
+
[attr.data-testid]="'side-nav-section-divider-' + sectionIdx"
|
|
2920
|
+
></div>
|
|
2921
|
+
}
|
|
2922
|
+
} @else if (section.title) {
|
|
2923
|
+
<span
|
|
2924
|
+
class="px-3 pt-3 pb-1 text-xs font-medium text-[#7FD1AE] whitespace-nowrap"
|
|
2925
|
+
animate.enter="fade-in"
|
|
2926
|
+
[attr.data-testid]="'side-nav-section-title-' + sectionIdx"
|
|
2927
|
+
>{{ section.title }}</span
|
|
2857
2928
|
>
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
<span
|
|
2869
|
-
class="text-base font-medium whitespace-nowrap flex items-center justify-between w-full"
|
|
2870
|
-
animate.enter="fade-in"
|
|
2871
|
-
animate.leave="fade-out"
|
|
2872
|
-
[ngClass]="
|
|
2873
|
-
isOptionActive(option)
|
|
2874
|
-
? 'text-green-base'
|
|
2875
|
-
: 'text-neutral-light-text'
|
|
2876
|
-
"
|
|
2877
|
-
>
|
|
2929
|
+
}
|
|
2930
|
+
@for (
|
|
2931
|
+
option of section.options;
|
|
2932
|
+
track option.name;
|
|
2933
|
+
let optionIdx = $index
|
|
2934
|
+
) {
|
|
2935
|
+
@let idx = section.offset + optionIdx;
|
|
2936
|
+
<div>
|
|
2937
|
+
<ng-template #badgeTooltip>
|
|
2938
|
+
<span class="flex items-center gap-2">
|
|
2878
2939
|
{{ option.name }}
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
[color]="isOptionActive(option) ? '#014744' : '#ffffff'"
|
|
2884
|
-
class="ml-2 transition-transform duration-200"
|
|
2885
|
-
[ngClass]="
|
|
2886
|
-
expandedMenus()[option.name]
|
|
2887
|
-
? 'rotate-90'
|
|
2888
|
-
: '-rotate-90'
|
|
2889
|
-
"
|
|
2890
|
-
></ads-icon>
|
|
2891
|
-
}
|
|
2940
|
+
<span
|
|
2941
|
+
class="min-w-5 h-5 px-1.5 rounded-full text-xs flex items-center justify-center bg-white/15 text-[#7FD1AE]"
|
|
2942
|
+
>{{ option.badge }}</span
|
|
2943
|
+
>
|
|
2892
2944
|
</span>
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
[
|
|
2900
|
-
|
|
2945
|
+
</ng-template>
|
|
2946
|
+
<button
|
|
2947
|
+
type="button"
|
|
2948
|
+
nz-tooltip
|
|
2949
|
+
class="cursor-pointer flex items-center max-h-12 transition-colors duration-300 border-none outline-none"
|
|
2950
|
+
[ngClass]="optionButtonClasses(option)"
|
|
2951
|
+
[attr.data-testid]="'side-nav-option-' + idx"
|
|
2952
|
+
(click)="onOptionClick(option)"
|
|
2953
|
+
[nzTooltipTitle]="
|
|
2954
|
+
isCollapsed()
|
|
2955
|
+
? hasBadge(option)
|
|
2956
|
+
? badgeTooltip
|
|
2957
|
+
: option.name
|
|
2958
|
+
: null
|
|
2959
|
+
"
|
|
2960
|
+
nzTooltipPlacement="right"
|
|
2961
|
+
[nzTooltipMouseEnterDelay]="0.3"
|
|
2901
2962
|
>
|
|
2902
|
-
@
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2963
|
+
@if (option.icon) {
|
|
2964
|
+
<ads-icon
|
|
2965
|
+
[iconName]="option.icon"
|
|
2966
|
+
[size]="16"
|
|
2967
|
+
[color]="isOptionActive(option) ? '#014744' : '#ffffff'"
|
|
2968
|
+
[ngClass]="!isCollapsed() ? 'mr-2' : ''"
|
|
2969
|
+
></ads-icon>
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
@if (isCollapsed() && hasBadge(option)) {
|
|
2973
|
+
<span
|
|
2974
|
+
class="absolute top-1.5 right-1.5 w-1.5 h-1.5 rounded-full bg-[#7FD1AE]"
|
|
2975
|
+
[attr.data-testid]="'side-nav-option-badge-dot-' + idx"
|
|
2976
|
+
></span>
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2979
|
+
@if (!isCollapsed()) {
|
|
2980
|
+
<span
|
|
2981
|
+
class="font-medium whitespace-nowrap flex items-center justify-between w-full"
|
|
2982
|
+
animate.enter="fade-in"
|
|
2983
|
+
animate.leave="fade-out"
|
|
2984
|
+
[class.text-base]="!isCompact()"
|
|
2985
|
+
[class.text-sm]="isCompact()"
|
|
2986
|
+
[ngClass]="
|
|
2987
|
+
isOptionActive(option)
|
|
2988
|
+
? 'text-green-base'
|
|
2989
|
+
: 'text-neutral-light-text'
|
|
2914
2990
|
"
|
|
2915
|
-
(click)="onChildClick(child.url)"
|
|
2916
|
-
[nzTooltipTitle]="isCollapsed() ? child.name : null"
|
|
2917
|
-
nzTooltipPlacement="right"
|
|
2918
|
-
[nzTooltipMouseEnterDelay]="0.3"
|
|
2919
2991
|
>
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
child.name
|
|
2923
|
-
}}</span>
|
|
2924
|
-
} @else {
|
|
2992
|
+
{{ option.name }}
|
|
2993
|
+
@if (hasBadge(option)) {
|
|
2925
2994
|
<span
|
|
2926
|
-
class="rounded-full
|
|
2927
|
-
|
|
2928
|
-
|
|
2995
|
+
class="ml-auto min-w-5 h-5 px-1.5 rounded-full text-xs font-medium flex items-center justify-center"
|
|
2996
|
+
[ngClass]="
|
|
2997
|
+
isOptionActive(option)
|
|
2998
|
+
? 'bg-green-base text-[#7FD1AE]'
|
|
2999
|
+
: 'bg-white/15 text-[#7FD1AE]'
|
|
3000
|
+
"
|
|
3001
|
+
[attr.data-testid]="'side-nav-option-badge-' + idx"
|
|
3002
|
+
>{{ option.badge }}</span
|
|
3003
|
+
>
|
|
3004
|
+
}
|
|
3005
|
+
@if (option.children?.length) {
|
|
3006
|
+
<ads-icon
|
|
3007
|
+
iconName="arrow_right"
|
|
3008
|
+
[size]="16"
|
|
3009
|
+
[color]="isOptionActive(option) ? '#014744' : '#ffffff'"
|
|
3010
|
+
class="ml-2 transition-transform duration-200"
|
|
2929
3011
|
[ngClass]="
|
|
2930
|
-
|
|
3012
|
+
expandedMenus()[option.name]
|
|
3013
|
+
? 'rotate-90'
|
|
3014
|
+
: '-rotate-90'
|
|
2931
3015
|
"
|
|
2932
|
-
></
|
|
3016
|
+
></ads-icon>
|
|
2933
3017
|
}
|
|
2934
|
-
</
|
|
3018
|
+
</span>
|
|
2935
3019
|
}
|
|
2936
|
-
</
|
|
2937
|
-
|
|
2938
|
-
|
|
3020
|
+
</button>
|
|
3021
|
+
|
|
3022
|
+
@if (option.children?.length && expandedMenus()[option.name]) {
|
|
3023
|
+
<div
|
|
3024
|
+
class="flex flex-col w-full"
|
|
3025
|
+
[ngClass]="childListClasses()"
|
|
3026
|
+
animate.enter="fade-in"
|
|
3027
|
+
>
|
|
3028
|
+
@for (
|
|
3029
|
+
child of option.children;
|
|
3030
|
+
track child.name;
|
|
3031
|
+
let subIdx = $index
|
|
3032
|
+
) {
|
|
3033
|
+
<button
|
|
3034
|
+
type="button"
|
|
3035
|
+
nz-tooltip
|
|
3036
|
+
class="cursor-pointer h-9 flex items-center transition-colors duration-300 border-none outline-none"
|
|
3037
|
+
[ngClass]="childButtonClasses(child.url, isCollapsed())"
|
|
3038
|
+
[attr.data-testid]="
|
|
3039
|
+
'side-nav-sub-option-' + idx + '-' + subIdx
|
|
3040
|
+
"
|
|
3041
|
+
(click)="onChildClick(child.url)"
|
|
3042
|
+
[nzTooltipTitle]="isCollapsed() ? child.name : null"
|
|
3043
|
+
nzTooltipPlacement="right"
|
|
3044
|
+
[nzTooltipMouseEnterDelay]="0.3"
|
|
3045
|
+
>
|
|
3046
|
+
@if (!isCollapsed()) {
|
|
3047
|
+
<span animate.enter="fade-in" animate.leave="fade-out">{{
|
|
3048
|
+
child.name
|
|
3049
|
+
}}</span>
|
|
3050
|
+
} @else {
|
|
3051
|
+
<span
|
|
3052
|
+
class="rounded-full bg-neutral-light-text"
|
|
3053
|
+
animate.enter="fade-in"
|
|
3054
|
+
animate.leave="fade-out"
|
|
3055
|
+
[ngClass]="
|
|
3056
|
+
isPathActive(child.url) ? 'w-2 h-2' : 'w-1.25 h-1.25'
|
|
3057
|
+
"
|
|
3058
|
+
></span>
|
|
3059
|
+
}
|
|
3060
|
+
</button>
|
|
3061
|
+
}
|
|
3062
|
+
</div>
|
|
3063
|
+
}
|
|
3064
|
+
</div>
|
|
3065
|
+
}
|
|
2939
3066
|
}
|
|
2940
3067
|
</nav>
|
|
2941
3068
|
@if (footerButton()) {
|
|
2942
3069
|
<div
|
|
2943
|
-
class="w-full
|
|
3070
|
+
class="w-full py-0 overflow-hidden mt-auto"
|
|
3071
|
+
[ngClass]="footerContainerClasses()"
|
|
2944
3072
|
animate.enter="fade-in"
|
|
2945
3073
|
animate.leave="fade-out"
|
|
2946
3074
|
>
|
|
2947
3075
|
<button
|
|
2948
3076
|
type="button"
|
|
2949
3077
|
nz-tooltip
|
|
2950
|
-
class="w-full
|
|
2951
|
-
[ngClass]="
|
|
2952
|
-
isCollapsed() ? 'px-2 justify-center' : 'px-5 justify-start'
|
|
2953
|
-
"
|
|
3078
|
+
class="w-full flex items-center gap-2 border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 cursor-pointer"
|
|
3079
|
+
[ngClass]="footerButtonClasses()"
|
|
2954
3080
|
[disabled]="footerButton()!.disabled ?? false"
|
|
2955
3081
|
(click)="footerButton()!.callback()"
|
|
2956
3082
|
[nzTooltipTitle]="isCollapsed() ? footerButton()!.text : null"
|
|
@@ -2969,11 +3095,18 @@ class SideNavComponent {
|
|
|
2969
3095
|
</button>
|
|
2970
3096
|
</div>
|
|
2971
3097
|
}
|
|
2972
|
-
|
|
2973
|
-
<div
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
3098
|
+
@for (btn of footerButtons(); track $index) {
|
|
3099
|
+
<div
|
|
3100
|
+
class="w-full py-0 overflow-hidden"
|
|
3101
|
+
[ngClass]="footerContainerClasses()"
|
|
3102
|
+
animate.enter="fade-in"
|
|
3103
|
+
animate.leave="fade-out"
|
|
3104
|
+
>
|
|
3105
|
+
<button
|
|
3106
|
+
type="button"
|
|
3107
|
+
nz-tooltip
|
|
3108
|
+
class="w-full flex items-center gap-2 border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 cursor-pointer"
|
|
3109
|
+
[ngClass]="footerButtonClasses()"
|
|
2977
3110
|
[disabled]="btn.disabled ?? false"
|
|
2978
3111
|
(click)="btn.callback()"
|
|
2979
3112
|
[nzTooltipTitle]="isCollapsed() ? btn.text : null"
|
|
@@ -3003,7 +3136,7 @@ class SideNavComponent {
|
|
|
3003
3136
|
/>
|
|
3004
3137
|
}
|
|
3005
3138
|
|
|
3006
|
-
<span class="text-white text-[0.75rem]">
|
|
3139
|
+
<span class="text-white text-[0.75rem]">{{ copyrightText() }}</span>
|
|
3007
3140
|
</div>
|
|
3008
3141
|
</div>
|
|
3009
3142
|
}
|
|
@@ -3032,118 +3165,179 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
3032
3165
|
}
|
|
3033
3166
|
</div>
|
|
3034
3167
|
<nav
|
|
3035
|
-
class="relative w-full flex-1 flex flex-col
|
|
3036
|
-
[ngClass]="
|
|
3168
|
+
class="relative w-full flex-1 flex flex-col"
|
|
3169
|
+
[ngClass]="navClasses()"
|
|
3037
3170
|
>
|
|
3038
|
-
@for (
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3171
|
+
@for (
|
|
3172
|
+
section of resolvedSections();
|
|
3173
|
+
track $index;
|
|
3174
|
+
let sectionIdx = $index
|
|
3175
|
+
) {
|
|
3176
|
+
@if (isCollapsed()) {
|
|
3177
|
+
@if (sectionIdx > 0) {
|
|
3178
|
+
<div
|
|
3179
|
+
class="mx-auto my-2 w-6 border-t border-white/20"
|
|
3180
|
+
[attr.data-testid]="'side-nav-section-divider-' + sectionIdx"
|
|
3181
|
+
></div>
|
|
3182
|
+
}
|
|
3183
|
+
} @else if (section.title) {
|
|
3184
|
+
<span
|
|
3185
|
+
class="px-3 pt-3 pb-1 text-xs font-medium text-[#7FD1AE] whitespace-nowrap"
|
|
3186
|
+
animate.enter="fade-in"
|
|
3187
|
+
[attr.data-testid]="'side-nav-section-title-' + sectionIdx"
|
|
3188
|
+
>{{ section.title }}</span
|
|
3050
3189
|
>
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
<span
|
|
3062
|
-
class="text-base font-medium whitespace-nowrap flex items-center justify-between w-full"
|
|
3063
|
-
animate.enter="fade-in"
|
|
3064
|
-
animate.leave="fade-out"
|
|
3065
|
-
[ngClass]="
|
|
3066
|
-
isOptionActive(option)
|
|
3067
|
-
? 'text-green-base'
|
|
3068
|
-
: 'text-neutral-light-text'
|
|
3069
|
-
"
|
|
3070
|
-
>
|
|
3190
|
+
}
|
|
3191
|
+
@for (
|
|
3192
|
+
option of section.options;
|
|
3193
|
+
track option.name;
|
|
3194
|
+
let optionIdx = $index
|
|
3195
|
+
) {
|
|
3196
|
+
@let idx = section.offset + optionIdx;
|
|
3197
|
+
<div>
|
|
3198
|
+
<ng-template #badgeTooltip>
|
|
3199
|
+
<span class="flex items-center gap-2">
|
|
3071
3200
|
{{ option.name }}
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
[color]="isOptionActive(option) ? '#014744' : '#ffffff'"
|
|
3077
|
-
class="ml-2 transition-transform duration-200"
|
|
3078
|
-
[ngClass]="
|
|
3079
|
-
expandedMenus()[option.name]
|
|
3080
|
-
? 'rotate-90'
|
|
3081
|
-
: '-rotate-90'
|
|
3082
|
-
"
|
|
3083
|
-
></ads-icon>
|
|
3084
|
-
}
|
|
3201
|
+
<span
|
|
3202
|
+
class="min-w-5 h-5 px-1.5 rounded-full text-xs flex items-center justify-center bg-white/15 text-[#7FD1AE]"
|
|
3203
|
+
>{{ option.badge }}</span
|
|
3204
|
+
>
|
|
3085
3205
|
</span>
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
[
|
|
3093
|
-
|
|
3206
|
+
</ng-template>
|
|
3207
|
+
<button
|
|
3208
|
+
type="button"
|
|
3209
|
+
nz-tooltip
|
|
3210
|
+
class="cursor-pointer flex items-center max-h-12 transition-colors duration-300 border-none outline-none"
|
|
3211
|
+
[ngClass]="optionButtonClasses(option)"
|
|
3212
|
+
[attr.data-testid]="'side-nav-option-' + idx"
|
|
3213
|
+
(click)="onOptionClick(option)"
|
|
3214
|
+
[nzTooltipTitle]="
|
|
3215
|
+
isCollapsed()
|
|
3216
|
+
? hasBadge(option)
|
|
3217
|
+
? badgeTooltip
|
|
3218
|
+
: option.name
|
|
3219
|
+
: null
|
|
3220
|
+
"
|
|
3221
|
+
nzTooltipPlacement="right"
|
|
3222
|
+
[nzTooltipMouseEnterDelay]="0.3"
|
|
3094
3223
|
>
|
|
3095
|
-
@
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3224
|
+
@if (option.icon) {
|
|
3225
|
+
<ads-icon
|
|
3226
|
+
[iconName]="option.icon"
|
|
3227
|
+
[size]="16"
|
|
3228
|
+
[color]="isOptionActive(option) ? '#014744' : '#ffffff'"
|
|
3229
|
+
[ngClass]="!isCollapsed() ? 'mr-2' : ''"
|
|
3230
|
+
></ads-icon>
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
@if (isCollapsed() && hasBadge(option)) {
|
|
3234
|
+
<span
|
|
3235
|
+
class="absolute top-1.5 right-1.5 w-1.5 h-1.5 rounded-full bg-[#7FD1AE]"
|
|
3236
|
+
[attr.data-testid]="'side-nav-option-badge-dot-' + idx"
|
|
3237
|
+
></span>
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
@if (!isCollapsed()) {
|
|
3241
|
+
<span
|
|
3242
|
+
class="font-medium whitespace-nowrap flex items-center justify-between w-full"
|
|
3243
|
+
animate.enter="fade-in"
|
|
3244
|
+
animate.leave="fade-out"
|
|
3245
|
+
[class.text-base]="!isCompact()"
|
|
3246
|
+
[class.text-sm]="isCompact()"
|
|
3247
|
+
[ngClass]="
|
|
3248
|
+
isOptionActive(option)
|
|
3249
|
+
? 'text-green-base'
|
|
3250
|
+
: 'text-neutral-light-text'
|
|
3107
3251
|
"
|
|
3108
|
-
(click)="onChildClick(child.url)"
|
|
3109
|
-
[nzTooltipTitle]="isCollapsed() ? child.name : null"
|
|
3110
|
-
nzTooltipPlacement="right"
|
|
3111
|
-
[nzTooltipMouseEnterDelay]="0.3"
|
|
3112
3252
|
>
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
child.name
|
|
3116
|
-
}}</span>
|
|
3117
|
-
} @else {
|
|
3253
|
+
{{ option.name }}
|
|
3254
|
+
@if (hasBadge(option)) {
|
|
3118
3255
|
<span
|
|
3119
|
-
class="rounded-full
|
|
3120
|
-
animate.enter="fade-in"
|
|
3121
|
-
animate.leave="fade-out"
|
|
3256
|
+
class="ml-auto min-w-5 h-5 px-1.5 rounded-full text-xs font-medium flex items-center justify-center"
|
|
3122
3257
|
[ngClass]="
|
|
3123
|
-
|
|
3258
|
+
isOptionActive(option)
|
|
3259
|
+
? 'bg-green-base text-[#7FD1AE]'
|
|
3260
|
+
: 'bg-white/15 text-[#7FD1AE]'
|
|
3124
3261
|
"
|
|
3125
|
-
|
|
3262
|
+
[attr.data-testid]="'side-nav-option-badge-' + idx"
|
|
3263
|
+
>{{ option.badge }}</span
|
|
3264
|
+
>
|
|
3126
3265
|
}
|
|
3127
|
-
|
|
3266
|
+
@if (option.children?.length) {
|
|
3267
|
+
<ads-icon
|
|
3268
|
+
iconName="arrow_right"
|
|
3269
|
+
[size]="16"
|
|
3270
|
+
[color]="isOptionActive(option) ? '#014744' : '#ffffff'"
|
|
3271
|
+
class="ml-2 transition-transform duration-200"
|
|
3272
|
+
[ngClass]="
|
|
3273
|
+
expandedMenus()[option.name]
|
|
3274
|
+
? 'rotate-90'
|
|
3275
|
+
: '-rotate-90'
|
|
3276
|
+
"
|
|
3277
|
+
></ads-icon>
|
|
3278
|
+
}
|
|
3279
|
+
</span>
|
|
3128
3280
|
}
|
|
3129
|
-
</
|
|
3130
|
-
|
|
3131
|
-
|
|
3281
|
+
</button>
|
|
3282
|
+
|
|
3283
|
+
@if (option.children?.length && expandedMenus()[option.name]) {
|
|
3284
|
+
<div
|
|
3285
|
+
class="flex flex-col w-full"
|
|
3286
|
+
[ngClass]="childListClasses()"
|
|
3287
|
+
animate.enter="fade-in"
|
|
3288
|
+
>
|
|
3289
|
+
@for (
|
|
3290
|
+
child of option.children;
|
|
3291
|
+
track child.name;
|
|
3292
|
+
let subIdx = $index
|
|
3293
|
+
) {
|
|
3294
|
+
<button
|
|
3295
|
+
type="button"
|
|
3296
|
+
nz-tooltip
|
|
3297
|
+
class="cursor-pointer h-9 flex items-center transition-colors duration-300 border-none outline-none"
|
|
3298
|
+
[ngClass]="childButtonClasses(child.url, isCollapsed())"
|
|
3299
|
+
[attr.data-testid]="
|
|
3300
|
+
'side-nav-sub-option-' + idx + '-' + subIdx
|
|
3301
|
+
"
|
|
3302
|
+
(click)="onChildClick(child.url)"
|
|
3303
|
+
[nzTooltipTitle]="isCollapsed() ? child.name : null"
|
|
3304
|
+
nzTooltipPlacement="right"
|
|
3305
|
+
[nzTooltipMouseEnterDelay]="0.3"
|
|
3306
|
+
>
|
|
3307
|
+
@if (!isCollapsed()) {
|
|
3308
|
+
<span animate.enter="fade-in" animate.leave="fade-out">{{
|
|
3309
|
+
child.name
|
|
3310
|
+
}}</span>
|
|
3311
|
+
} @else {
|
|
3312
|
+
<span
|
|
3313
|
+
class="rounded-full bg-neutral-light-text"
|
|
3314
|
+
animate.enter="fade-in"
|
|
3315
|
+
animate.leave="fade-out"
|
|
3316
|
+
[ngClass]="
|
|
3317
|
+
isPathActive(child.url) ? 'w-2 h-2' : 'w-1.25 h-1.25'
|
|
3318
|
+
"
|
|
3319
|
+
></span>
|
|
3320
|
+
}
|
|
3321
|
+
</button>
|
|
3322
|
+
}
|
|
3323
|
+
</div>
|
|
3324
|
+
}
|
|
3325
|
+
</div>
|
|
3326
|
+
}
|
|
3132
3327
|
}
|
|
3133
3328
|
</nav>
|
|
3134
3329
|
@if (footerButton()) {
|
|
3135
3330
|
<div
|
|
3136
|
-
class="w-full
|
|
3331
|
+
class="w-full py-0 overflow-hidden mt-auto"
|
|
3332
|
+
[ngClass]="footerContainerClasses()"
|
|
3137
3333
|
animate.enter="fade-in"
|
|
3138
3334
|
animate.leave="fade-out"
|
|
3139
3335
|
>
|
|
3140
3336
|
<button
|
|
3141
3337
|
type="button"
|
|
3142
3338
|
nz-tooltip
|
|
3143
|
-
class="w-full
|
|
3144
|
-
[ngClass]="
|
|
3145
|
-
isCollapsed() ? 'px-2 justify-center' : 'px-5 justify-start'
|
|
3146
|
-
"
|
|
3339
|
+
class="w-full flex items-center gap-2 border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 cursor-pointer"
|
|
3340
|
+
[ngClass]="footerButtonClasses()"
|
|
3147
3341
|
[disabled]="footerButton()!.disabled ?? false"
|
|
3148
3342
|
(click)="footerButton()!.callback()"
|
|
3149
3343
|
[nzTooltipTitle]="isCollapsed() ? footerButton()!.text : null"
|
|
@@ -3162,11 +3356,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
3162
3356
|
</button>
|
|
3163
3357
|
</div>
|
|
3164
3358
|
}
|
|
3165
|
-
|
|
3166
|
-
<div
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3359
|
+
@for (btn of footerButtons(); track $index) {
|
|
3360
|
+
<div
|
|
3361
|
+
class="w-full py-0 overflow-hidden"
|
|
3362
|
+
[ngClass]="footerContainerClasses()"
|
|
3363
|
+
animate.enter="fade-in"
|
|
3364
|
+
animate.leave="fade-out"
|
|
3365
|
+
>
|
|
3366
|
+
<button
|
|
3367
|
+
type="button"
|
|
3368
|
+
nz-tooltip
|
|
3369
|
+
class="w-full flex items-center gap-2 border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 cursor-pointer"
|
|
3370
|
+
[ngClass]="footerButtonClasses()"
|
|
3170
3371
|
[disabled]="btn.disabled ?? false"
|
|
3171
3372
|
(click)="btn.callback()"
|
|
3172
3373
|
[nzTooltipTitle]="isCollapsed() ? btn.text : null"
|
|
@@ -3196,14 +3397,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
3196
3397
|
/>
|
|
3197
3398
|
}
|
|
3198
3399
|
|
|
3199
|
-
<span class="text-white text-[0.75rem]">
|
|
3400
|
+
<span class="text-white text-[0.75rem]">{{ copyrightText() }}</span>
|
|
3200
3401
|
</div>
|
|
3201
3402
|
</div>
|
|
3202
3403
|
}
|
|
3203
3404
|
</aside>
|
|
3204
3405
|
`,
|
|
3205
3406
|
}]
|
|
3206
|
-
}], propDecorators: { isCollapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCollapsed", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], activePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activePath", required: false }] }], logoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoSrc", required: false }] }], footerLogoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerLogoSrc", required: false }] }], collapsedLogoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedLogoSrc", required: false }] }], footerButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButton", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }], logoAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoAlt", required: false }] }], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }], childSelected: [{ type: i0.Output, args: ["childSelected"] }], activePathChange: [{ type: i0.Output, args: ["activePathChange"] }] } });
|
|
3407
|
+
}], propDecorators: { isCollapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCollapsed", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], activePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activePath", required: false }] }], logoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoSrc", required: false }] }], footerLogoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerLogoSrc", required: false }] }], collapsedLogoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedLogoSrc", required: false }] }], footerButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButton", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }], logoAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoAlt", required: false }] }], sections: [{ type: i0.Input, args: [{ isSignal: true, alias: "sections", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], copyrightText: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyrightText", required: false }] }], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }], childSelected: [{ type: i0.Output, args: ["childSelected"] }], activePathChange: [{ type: i0.Output, args: ["activePathChange"] }] } });
|
|
3207
3408
|
|
|
3208
3409
|
class MultipleSelectorComponent {
|
|
3209
3410
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -3845,6 +4046,8 @@ class TableComponent {
|
|
|
3845
4046
|
statusStateStyles = this.defaultStatusStateStyles;
|
|
3846
4047
|
activeStateStyles = this.defaultActiveStateStyles;
|
|
3847
4048
|
selectable = false;
|
|
4049
|
+
/** Keeps the actions column pinned to the right edge, above the other columns, while scrolling horizontally. */
|
|
4050
|
+
stickyActions = false;
|
|
3848
4051
|
headerRenderVersion = 0;
|
|
3849
4052
|
constructor(hostTestId) {
|
|
3850
4053
|
this.hostTestId = hostTestId;
|
|
@@ -4139,7 +4342,7 @@ class TableComponent {
|
|
|
4139
4342
|
this.selectionChange.emit(this.table?.getSelectedRowModel?.()?.rows.map((row) => row.original) ?? []);
|
|
4140
4343
|
}
|
|
4141
4344
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: TableComponent, deps: [{ token: 'data-testid', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
4142
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: TableComponent, isStandalone: true, selector: "ads-table", inputs: { table: "table", isLoading: "isLoading", selectedSortingHeader: "selectedSortingHeader", sortDirection: "sortDirection", showButtons: "showButtons", allContentLeft: "allContentLeft", totalRegisters: "totalRegisters", minH: ["min-h", "minH"], areColumnsDraggable: "areColumnsDraggable", currentPage: "currentPage", totalPages: "totalPages", pageSize: "pageSize", enableMultiSort: "enableMultiSort", multiSortCriteria: "multiSortCriteria", actionButtons: "actionButtons", statusStateStyles: "statusStateStyles", activeStateStyles: "activeStateStyles", selectable: "selectable" }, outputs: { sortEvent: "sortEvent", columnOrderChange: "columnOrderChange", pageChange: "pageChange", columnSizingChange: "columnSizingChange", pageSizeChange: "pageSizeChange", multiSortEvent: "multiSortEvent", selectionChange: "selectionChange" }, ngImport: i0, template: "@if (getRows().length > 0 || isLoading) {\n <!-- Main table layout: data grid + footer pagination area -->\n <div\n class=\"flex w-full flex-col justify-between gap-4\"\n [ngClass]=\"{ 'min-h-[60vh]': minH }\"\n >\n <div class=\"relative min-h-40 w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <!-- Interactive header row: sorting, drag-and-drop, and column resizing -->\n <thead class=\"bg-green-1 text-white-base\">\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"h-10 min-h-10 max-h-11.25\"\n (cdkDropListDropped)=\"drop($event)\"\n [ngStyle]=\"allContentLeft ? { 'text-align': 'left' } : null\"\n >\n @if (selectable) {\n <!-- Checkbox selection column header: select all rows -->\n <th\n class=\"relative h-10 min-h-10 max-h-11.25 w-10 px-3 text-center align-middle border-r border-white/20 first:rounded-l-2xl\"\n [attr.data-testid]=\"contentTestId + '-header-select-all'\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n controlColor=\"white\"\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isSomeSelected() && !isAllSelected()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></ads-checkbox>\n </div>\n </th>\n }\n @for (\n column of getHeaderCells();\n track column.id + \"-\" + headerRenderVersion\n ) {\n @if (isColumnSortable(column)) {\n @if (areColumnsDraggable) {\n <!-- Sortable + draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0 overflow-hidden cursor-grab active:cursor-grabbing\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n cdkDragHandle\n class=\"group flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 border-none outline-0 bg-transparent hover:bg-white/10\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n <!-- When right-aligned, the sort indicator is shown before the header text -->\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n <!-- For left/center aligned headers, the sort indicator is shown after the text -->\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Sortable header cell without drag-and-drop -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n class=\"flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 hover:bg-white/10 bg-green-base\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n } @else {\n @if (areColumnsDraggable) {\n <!-- Non-sortable but draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n cdkDragHandle\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Plain header cell (no sort, no drag) -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n }\n }\n\n @if (showButtons) {\n <!-- Optional actions column header -->\n <th\n [attr.data-testid]=\"contentTestId + '-header-actions'\"\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium whitespace-nowrap rounded-r-2xl\"\n [ngStyle]=\"{ width: '1%' }\"\n >\n Actions\n </th>\n }\n </tr>\n </thead>\n\n <tbody class=\"relative\">\n @if (isLoading && getRows().length === 0) {\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"p-0\">\n <div\n class=\"flex min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of getRows(); track trackByFn($index, row)) {\n <tr\n [attr.data-testid]=\"getRowTestId(row, $index)\"\n class=\"h-10 min-h-10 max-h-11.25\"\n >\n @if (selectable) {\n <!-- Optional row selection checkbox -->\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 align-middle text-center\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n [checked]=\"isRowSelected(row)\"\n (checkedChange)=\"toggleRowSelection(row)\"\n ></ads-checkbox>\n </div>\n </td>\n }\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 text-sm whitespace-pre-line wrap-break-word text-black-base\"\n [ngClass]=\"cellAlignmentClass(cell)\"\n [ngStyle]=\"allContentLeft ? { padding: '0' } : null\"\n >\n @if (isStateCell(cell)) {\n <!-- State-like values (status/active) are rendered with ads-state for a consistent visual token -->\n <ads-state\n [shape]=\"getStateStyle(cell).shape ?? statusShape\"\n [containerShapes]=\"\n getStateStyle(cell).shape ?? statusShape\n \"\n [borderColor]=\"getStateStyle(cell).borderColor\"\n [bgColor]=\"getStateStyle(cell).bgColor\"\n [textColor]=\"getStateStyle(cell).textColor\"\n [text]=\"getStateText(cell)\"\n [fullWidth]=\"getStateStyle(cell).fullWidth ?? false\"\n [boldText]=\"getStateStyle(cell).boldText ?? true\"\n ></ads-state>\n } @else {\n <!-- Generic cell rendering for non-state columns via TanStack flexRender output -->\n <ng-container\n *flexRender=\"\n cell.column.columnDef.cell;\n props: cell.getContext();\n let renderedCell\n \"\n >\n <div\n [innerHTML]=\"renderedCell\"\n [ngStyle]=\"\n allContentLeft ? { 'text-align': 'left' } : null\n \"\n ></div>\n </ng-container>\n }\n </td>\n }\n\n @if (showButtons && actionButtons.length > 0) {\n <!-- Optional row action buttons -->\n <td\n class=\"border-b border-[#aedad8] px-1 py-1 align-middle text-center whitespace-nowrap\"\n >\n <div\n class=\"flex w-full items-center justify-center gap-1 p-0\"\n >\n @for (button of actionButtons; track $index) {\n @if (\n !button.condition || button.condition(row.original)\n ) {\n <button\n nz-tooltip\n [nzTooltipTitle]=\"\n getTooltipText(button, row.original)\n \"\n ads-button\n type=\"button\"\n [onlyIconButton]=\"true\"\n color=\"text\"\n [attr.data-testid]=\"\n getActionButtonTestId(row, button, $index)\n \"\n [title]=\"getTooltipText(button, row.original)\"\n [disabled]=\"\n isActionButtonDisabled(button, row.original)\n \"\n (click)=\"button.callback(row.original)\"\n >\n <ads-icon\n [ngClass]=\"\n isActionButtonDisabled(button, row.original)\n ? 'text-neutral-disabled-text'\n : 'text-green-1'\n \"\n [iconName]=\"iconNameFor(button.icon)\"\n [size]=\"16\"\n ></ads-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n }\n\n @if (isLoading && getRows().length > 0) {\n <tr class=\"absolute inset-0 z-10 block\">\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"block h-full p-0\">\n <div\n class=\"flex h-full min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Footer controls: page size selector, page navigation, and total record counter -->\n <div class=\"flex w-full flex-wrap items-center justify-end gap-4 py-2\">\n <div class=\"mr-auto flex items-center gap-2 text-sm text-green-1\">\n <span class=\"whitespace-nowrap font-medium\">Rows per page</span>\n <select\n class=\"h-8 cursor-pointer rounded border border-aqua-1 bg-white-base px-2 text-sm text-green-1 outline-none transition hover:border-green-1 focus:border-green-1 focus:ring-2 focus:ring-green-1/20\"\n [value]=\"pageSize\"\n (change)=\"onPageSizeChange($event)\"\n [attr.data-testid]=\"contentTestId + '-page-size-select'\"\n >\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n <option value=\"100\">100</option>\n </select>\n </div>\n\n <div class=\"flex w-fit items-center justify-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === 1\"\n (click)=\"previousPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-previous'\"\n >\n <span class=\"text-lg leading-none\">\u2039</span>\n Previous\n </button>\n\n <div class=\"flex items-center justify-center gap-1\">\n @for (page of getPageNumbers(); track $index) {\n @if (page === null) {\n <span\n class=\"inline-flex h-8 min-w-8 select-none items-center justify-center px-2 font-medium text-neutral-disabled-text\"\n >...</span\n >\n } @else {\n <button\n type=\"button\"\n class=\"inline-flex h-8 min-w-8 items-center justify-center rounded px-2 font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 outline-0 border-none\"\n [ngClass]=\"{\n 'bg-green-1 text-white-base hover:text-white-base':\n currentPage === page,\n 'bg-transparent': currentPage !== page,\n }\"\n [disabled]=\"false\"\n (click)=\"goToPage(page)\"\n [attr.data-testid]=\"contentTestId + '-pagination-page-' + page\"\n >\n {{ page }}\n </button>\n }\n }\n </div>\n\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"nextPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-next'\"\n >\n Next\n <span class=\"text-lg leading-none\">\u203A</span>\n </button>\n </div>\n\n @if (totalRegisters) {\n <div\n class=\"w-fit min-w-20 text-sm font-medium text-neutral-disabled-text\"\n [attr.data-testid]=\"contentTestId + '-pagination-info'\"\n >\n Total Records: {{ totalRegisters }}\n </div>\n }\n </div>\n </div>\n} @else {\n <!-- Empty state layout when there are no rows to display -->\n <div class=\"w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <thead class=\"bg-green-1 text-white-base\">\n <tr class=\"h-10 min-h-10 max-h-11.25\">\n @if (selectable) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 w-10 px-3 text-center first:rounded-l-2xl\"\n ></th>\n }\n @for (column of getHeaderCells(); track column.id) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-left font-medium first:rounded-l-2xl\"\n >\n {{ column.column.columnDef.header }}\n </th>\n }\n @if (showButtons) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium rounded-r-2xl\"\n >\n Options\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"py-2\">\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-aqua-2 bg-aqua-5/40 px-6 py-5 text-center\"\n >\n <span class=\"text-base font-semibold text-green-1\"\n >No available data</span\n >\n <span class=\"text-sm text-neutral-disabled-text\"\n >No data to display right now.</span\n >\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n}\n", styles: [":host ::ng-deep .cdk-drag-preview{background-color:#014744!important;color:#fff!important;border-radius:1rem!important;border-right:1px solid rgba(255,255,255,.2)!important;box-shadow:0 12px 28px #01474447!important;overflow:hidden!important}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging th.cdk-drag:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(.2,0,0,1)}:host ::ng-deep th.cdk-drag-animating{transition:transform .22s cubic-bezier(.2,0,0,1)}::ng-deep .cdk-drag-preview{background:#014743a9!important;color:#fff!important;box-shadow:none!important;border:none!important;border-radius:10rem!important}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$3.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: FlexRenderDirective, selector: "[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }, { kind: "component", type: CheckboxComponent, selector: "ads-checkbox", inputs: ["appearance", "label", "labelPosition", "labelColor", "controlColor", "checked", "indeterminate", "disabled"], outputs: ["checkedChange"] }, { kind: "component", type: IconComponent, selector: "ads-icon", inputs: ["iconName", "size", "title", "color"] }, { kind: "component", type: ButtonComponent, selector: "button[ads-button]", inputs: ["variant", "color", "buttonType", "disabled", "fullWidth", "iconButton", "onlyIconButton", "iconColor"], outputs: ["clicked"] }, { kind: "component", type: StateComponent, selector: "ads-state", inputs: ["boldText", "fullWidth", "shape", "text", "borderColor", "bgColor", "textColor", "containerShapes"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: NzTooltipModule }, { kind: "directive", type: i1$2.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }] });
|
|
4345
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: TableComponent, isStandalone: true, selector: "ads-table", inputs: { table: "table", isLoading: "isLoading", selectedSortingHeader: "selectedSortingHeader", sortDirection: "sortDirection", showButtons: "showButtons", allContentLeft: "allContentLeft", totalRegisters: "totalRegisters", minH: ["min-h", "minH"], areColumnsDraggable: "areColumnsDraggable", currentPage: "currentPage", totalPages: "totalPages", pageSize: "pageSize", enableMultiSort: "enableMultiSort", multiSortCriteria: "multiSortCriteria", actionButtons: "actionButtons", statusStateStyles: "statusStateStyles", activeStateStyles: "activeStateStyles", selectable: "selectable", stickyActions: "stickyActions" }, outputs: { sortEvent: "sortEvent", columnOrderChange: "columnOrderChange", pageChange: "pageChange", columnSizingChange: "columnSizingChange", pageSizeChange: "pageSizeChange", multiSortEvent: "multiSortEvent", selectionChange: "selectionChange" }, ngImport: i0, template: "@if (getRows().length > 0 || isLoading) {\n <!-- Main table layout: data grid + footer pagination area -->\n <div\n class=\"flex w-full flex-col justify-between gap-4\"\n [ngClass]=\"{ 'min-h-[60vh]': minH }\"\n >\n <div class=\"relative min-h-40 w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <!-- Interactive header row: sorting, drag-and-drop, and column resizing -->\n <thead class=\"bg-green-1 text-white-base\">\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"h-10 min-h-10 max-h-11.25\"\n (cdkDropListDropped)=\"drop($event)\"\n [ngStyle]=\"allContentLeft ? { 'text-align': 'left' } : null\"\n >\n @if (selectable) {\n <!-- Checkbox selection column header: select all rows -->\n <th\n class=\"relative h-10 min-h-10 max-h-11.25 w-10 px-3 text-center align-middle border-r border-white/20 first:rounded-l-2xl\"\n [attr.data-testid]=\"contentTestId + '-header-select-all'\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n controlColor=\"white\"\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isSomeSelected() && !isAllSelected()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></ads-checkbox>\n </div>\n </th>\n }\n @for (\n column of getHeaderCells();\n track column.id + \"-\" + headerRenderVersion\n ) {\n @if (isColumnSortable(column)) {\n @if (areColumnsDraggable) {\n <!-- Sortable + draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0 overflow-hidden cursor-grab active:cursor-grabbing\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n cdkDragHandle\n class=\"group flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 border-none outline-0 bg-transparent hover:bg-white/10\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n <!-- When right-aligned, the sort indicator is shown before the header text -->\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n <!-- For left/center aligned headers, the sort indicator is shown after the text -->\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Sortable header cell without drag-and-drop -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n class=\"flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 hover:bg-white/10 bg-green-base\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n } @else {\n @if (areColumnsDraggable) {\n <!-- Non-sortable but draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n cdkDragHandle\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Plain header cell (no sort, no drag) -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n }\n }\n\n @if (showButtons) {\n <!-- Optional actions column header -->\n <th\n [attr.data-testid]=\"contentTestId + '-header-actions'\"\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium whitespace-nowrap rounded-r-2xl\"\n [class.sticky-actions]=\"stickyActions\"\n [ngStyle]=\"{ width: '1%' }\"\n >\n Actions\n </th>\n }\n </tr>\n </thead>\n\n <tbody class=\"relative\">\n @if (isLoading && getRows().length === 0) {\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"p-0\">\n <div\n class=\"flex min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of getRows(); track trackByFn($index, row)) {\n <tr\n [attr.data-testid]=\"getRowTestId(row, $index)\"\n class=\"h-10 min-h-10 max-h-11.25\"\n >\n @if (selectable) {\n <!-- Optional row selection checkbox -->\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 align-middle text-center\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n [checked]=\"isRowSelected(row)\"\n (checkedChange)=\"toggleRowSelection(row)\"\n ></ads-checkbox>\n </div>\n </td>\n }\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 text-sm whitespace-pre-line wrap-break-word text-black-base\"\n [ngClass]=\"cellAlignmentClass(cell)\"\n [ngStyle]=\"allContentLeft ? { padding: '0' } : null\"\n >\n @if (isStateCell(cell)) {\n <!-- State-like values (status/active) are rendered with ads-state for a consistent visual token -->\n <ads-state\n [shape]=\"getStateStyle(cell).shape ?? statusShape\"\n [containerShapes]=\"\n getStateStyle(cell).shape ?? statusShape\n \"\n [borderColor]=\"getStateStyle(cell).borderColor\"\n [bgColor]=\"getStateStyle(cell).bgColor\"\n [textColor]=\"getStateStyle(cell).textColor\"\n [text]=\"getStateText(cell)\"\n [fullWidth]=\"getStateStyle(cell).fullWidth ?? false\"\n [boldText]=\"getStateStyle(cell).boldText ?? true\"\n ></ads-state>\n } @else {\n <!-- Generic cell rendering for non-state columns via TanStack flexRender output -->\n <ng-container\n *flexRender=\"\n cell.column.columnDef.cell;\n props: cell.getContext();\n let renderedCell\n \"\n >\n <div\n [innerHTML]=\"renderedCell\"\n [ngStyle]=\"\n allContentLeft ? { 'text-align': 'left' } : null\n \"\n ></div>\n </ng-container>\n }\n </td>\n }\n\n @if (showButtons && actionButtons.length > 0) {\n <!-- Optional row action buttons -->\n <td\n class=\"border-b border-[#aedad8] px-1 py-1 align-middle text-center whitespace-nowrap\"\n [class.sticky-actions]=\"stickyActions\"\n >\n <div\n class=\"flex w-full items-center justify-center gap-1 p-0\"\n >\n @for (button of actionButtons; track $index) {\n @if (\n !button.condition || button.condition(row.original)\n ) {\n <button\n nz-tooltip\n [nzTooltipTitle]=\"\n getTooltipText(button, row.original)\n \"\n ads-button\n type=\"button\"\n [onlyIconButton]=\"true\"\n color=\"text\"\n [attr.data-testid]=\"\n getActionButtonTestId(row, button, $index)\n \"\n [title]=\"getTooltipText(button, row.original)\"\n [disabled]=\"\n isActionButtonDisabled(button, row.original)\n \"\n (click)=\"button.callback(row.original)\"\n >\n <ads-icon\n [ngClass]=\"\n isActionButtonDisabled(button, row.original)\n ? 'text-neutral-disabled-text'\n : 'text-green-1'\n \"\n [iconName]=\"iconNameFor(button.icon)\"\n [size]=\"16\"\n ></ads-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n }\n\n @if (isLoading && getRows().length > 0) {\n <tr class=\"absolute inset-0 z-10 block\">\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"block h-full p-0\">\n <div\n class=\"flex h-full min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Footer controls: page size selector, page navigation, and total record counter -->\n <div class=\"flex w-full flex-wrap items-center justify-end gap-4 py-2\">\n <div class=\"mr-auto flex items-center gap-2 text-sm text-green-1\">\n <span class=\"whitespace-nowrap font-medium\">Rows per page</span>\n <select\n class=\"h-8 cursor-pointer rounded border border-aqua-1 bg-white-base px-2 text-sm text-green-1 outline-none transition hover:border-green-1 focus:border-green-1 focus:ring-2 focus:ring-green-1/20\"\n [value]=\"pageSize\"\n (change)=\"onPageSizeChange($event)\"\n [attr.data-testid]=\"contentTestId + '-page-size-select'\"\n >\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n <option value=\"100\">100</option>\n </select>\n </div>\n\n <div class=\"flex w-fit items-center justify-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === 1\"\n (click)=\"previousPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-previous'\"\n >\n <span class=\"text-lg leading-none\">\u2039</span>\n Previous\n </button>\n\n <div class=\"flex items-center justify-center gap-1\">\n @for (page of getPageNumbers(); track $index) {\n @if (page === null) {\n <span\n class=\"inline-flex h-8 min-w-8 select-none items-center justify-center px-2 font-medium text-neutral-disabled-text\"\n >...</span\n >\n } @else {\n <button\n type=\"button\"\n class=\"inline-flex h-8 min-w-8 items-center justify-center rounded px-2 font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 outline-0 border-none\"\n [ngClass]=\"{\n 'bg-green-1 text-white-base hover:text-white-base':\n currentPage === page,\n 'bg-transparent': currentPage !== page,\n }\"\n [disabled]=\"false\"\n (click)=\"goToPage(page)\"\n [attr.data-testid]=\"contentTestId + '-pagination-page-' + page\"\n >\n {{ page }}\n </button>\n }\n }\n </div>\n\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"nextPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-next'\"\n >\n Next\n <span class=\"text-lg leading-none\">\u203A</span>\n </button>\n </div>\n\n @if (totalRegisters) {\n <div\n class=\"w-fit min-w-20 text-sm font-medium text-neutral-disabled-text\"\n [attr.data-testid]=\"contentTestId + '-pagination-info'\"\n >\n Total Records: {{ totalRegisters }}\n </div>\n }\n </div>\n </div>\n} @else {\n <!-- Empty state layout when there are no rows to display -->\n <div class=\"w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <thead class=\"bg-green-1 text-white-base\">\n <tr class=\"h-10 min-h-10 max-h-11.25\">\n @if (selectable) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 w-10 px-3 text-center first:rounded-l-2xl\"\n ></th>\n }\n @for (column of getHeaderCells(); track column.id) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-left font-medium first:rounded-l-2xl\"\n >\n {{ column.column.columnDef.header }}\n </th>\n }\n @if (showButtons) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium rounded-r-2xl\"\n >\n Options\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"py-2\">\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-aqua-2 bg-aqua-5/40 px-6 py-5 text-center\"\n >\n <span class=\"text-base font-semibold text-green-1\"\n >No available data</span\n >\n <span class=\"text-sm text-neutral-disabled-text\"\n >No data to display right now.</span\n >\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n}\n", styles: [".sticky-actions{position:sticky;right:0;z-index:5}th.sticky-actions{background-color:var(--color-green-1, #014744)}td.sticky-actions{background-color:var(--ads-table-sticky-actions-bg, var(--color-white-base, #f6f6f6))}:host ::ng-deep .cdk-drag-preview{background-color:#014744!important;color:#fff!important;border-radius:1rem!important;border-right:1px solid rgba(255,255,255,.2)!important;box-shadow:0 12px 28px #01474447!important;overflow:hidden!important}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging th.cdk-drag:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(.2,0,0,1)}:host ::ng-deep th.cdk-drag-animating{transition:transform .22s cubic-bezier(.2,0,0,1)}::ng-deep .cdk-drag-preview{background:#014743a9!important;color:#fff!important;box-shadow:none!important;border:none!important;border-radius:10rem!important}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$3.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: FlexRenderDirective, selector: "[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }, { kind: "component", type: CheckboxComponent, selector: "ads-checkbox", inputs: ["appearance", "label", "labelPosition", "labelColor", "controlColor", "checked", "indeterminate", "disabled"], outputs: ["checkedChange"] }, { kind: "component", type: IconComponent, selector: "ads-icon", inputs: ["iconName", "size", "title", "color"] }, { kind: "component", type: ButtonComponent, selector: "button[ads-button]", inputs: ["variant", "color", "buttonType", "disabled", "fullWidth", "iconButton", "onlyIconButton", "iconColor"], outputs: ["clicked"] }, { kind: "component", type: StateComponent, selector: "ads-state", inputs: ["boldText", "fullWidth", "shape", "text", "borderColor", "bgColor", "textColor", "containerShapes"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: NzTooltipModule }, { kind: "directive", type: i1$2.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }] });
|
|
4143
4346
|
}
|
|
4144
4347
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
4145
4348
|
type: Component,
|
|
@@ -4155,7 +4358,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
4155
4358
|
CdkDrag,
|
|
4156
4359
|
CdkDropList,
|
|
4157
4360
|
NzTooltipModule
|
|
4158
|
-
], template: "@if (getRows().length > 0 || isLoading) {\n <!-- Main table layout: data grid + footer pagination area -->\n <div\n class=\"flex w-full flex-col justify-between gap-4\"\n [ngClass]=\"{ 'min-h-[60vh]': minH }\"\n >\n <div class=\"relative min-h-40 w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <!-- Interactive header row: sorting, drag-and-drop, and column resizing -->\n <thead class=\"bg-green-1 text-white-base\">\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"h-10 min-h-10 max-h-11.25\"\n (cdkDropListDropped)=\"drop($event)\"\n [ngStyle]=\"allContentLeft ? { 'text-align': 'left' } : null\"\n >\n @if (selectable) {\n <!-- Checkbox selection column header: select all rows -->\n <th\n class=\"relative h-10 min-h-10 max-h-11.25 w-10 px-3 text-center align-middle border-r border-white/20 first:rounded-l-2xl\"\n [attr.data-testid]=\"contentTestId + '-header-select-all'\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n controlColor=\"white\"\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isSomeSelected() && !isAllSelected()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></ads-checkbox>\n </div>\n </th>\n }\n @for (\n column of getHeaderCells();\n track column.id + \"-\" + headerRenderVersion\n ) {\n @if (isColumnSortable(column)) {\n @if (areColumnsDraggable) {\n <!-- Sortable + draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0 overflow-hidden cursor-grab active:cursor-grabbing\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n cdkDragHandle\n class=\"group flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 border-none outline-0 bg-transparent hover:bg-white/10\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n <!-- When right-aligned, the sort indicator is shown before the header text -->\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n <!-- For left/center aligned headers, the sort indicator is shown after the text -->\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Sortable header cell without drag-and-drop -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n class=\"flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 hover:bg-white/10 bg-green-base\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n } @else {\n @if (areColumnsDraggable) {\n <!-- Non-sortable but draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n cdkDragHandle\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Plain header cell (no sort, no drag) -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n }\n }\n\n @if (showButtons) {\n <!-- Optional actions column header -->\n <th\n [attr.data-testid]=\"contentTestId + '-header-actions'\"\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium whitespace-nowrap rounded-r-2xl\"\n [ngStyle]=\"{ width: '1%' }\"\n >\n Actions\n </th>\n }\n </tr>\n </thead>\n\n <tbody class=\"relative\">\n @if (isLoading && getRows().length === 0) {\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"p-0\">\n <div\n class=\"flex min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of getRows(); track trackByFn($index, row)) {\n <tr\n [attr.data-testid]=\"getRowTestId(row, $index)\"\n class=\"h-10 min-h-10 max-h-11.25\"\n >\n @if (selectable) {\n <!-- Optional row selection checkbox -->\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 align-middle text-center\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n [checked]=\"isRowSelected(row)\"\n (checkedChange)=\"toggleRowSelection(row)\"\n ></ads-checkbox>\n </div>\n </td>\n }\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 text-sm whitespace-pre-line wrap-break-word text-black-base\"\n [ngClass]=\"cellAlignmentClass(cell)\"\n [ngStyle]=\"allContentLeft ? { padding: '0' } : null\"\n >\n @if (isStateCell(cell)) {\n <!-- State-like values (status/active) are rendered with ads-state for a consistent visual token -->\n <ads-state\n [shape]=\"getStateStyle(cell).shape ?? statusShape\"\n [containerShapes]=\"\n getStateStyle(cell).shape ?? statusShape\n \"\n [borderColor]=\"getStateStyle(cell).borderColor\"\n [bgColor]=\"getStateStyle(cell).bgColor\"\n [textColor]=\"getStateStyle(cell).textColor\"\n [text]=\"getStateText(cell)\"\n [fullWidth]=\"getStateStyle(cell).fullWidth ?? false\"\n [boldText]=\"getStateStyle(cell).boldText ?? true\"\n ></ads-state>\n } @else {\n <!-- Generic cell rendering for non-state columns via TanStack flexRender output -->\n <ng-container\n *flexRender=\"\n cell.column.columnDef.cell;\n props: cell.getContext();\n let renderedCell\n \"\n >\n <div\n [innerHTML]=\"renderedCell\"\n [ngStyle]=\"\n allContentLeft ? { 'text-align': 'left' } : null\n \"\n ></div>\n </ng-container>\n }\n </td>\n }\n\n @if (showButtons && actionButtons.length > 0) {\n <!-- Optional row action buttons -->\n <td\n class=\"border-b border-[#aedad8] px-1 py-1 align-middle text-center whitespace-nowrap\"\n >\n <div\n class=\"flex w-full items-center justify-center gap-1 p-0\"\n >\n @for (button of actionButtons; track $index) {\n @if (\n !button.condition || button.condition(row.original)\n ) {\n <button\n nz-tooltip\n [nzTooltipTitle]=\"\n getTooltipText(button, row.original)\n \"\n ads-button\n type=\"button\"\n [onlyIconButton]=\"true\"\n color=\"text\"\n [attr.data-testid]=\"\n getActionButtonTestId(row, button, $index)\n \"\n [title]=\"getTooltipText(button, row.original)\"\n [disabled]=\"\n isActionButtonDisabled(button, row.original)\n \"\n (click)=\"button.callback(row.original)\"\n >\n <ads-icon\n [ngClass]=\"\n isActionButtonDisabled(button, row.original)\n ? 'text-neutral-disabled-text'\n : 'text-green-1'\n \"\n [iconName]=\"iconNameFor(button.icon)\"\n [size]=\"16\"\n ></ads-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n }\n\n @if (isLoading && getRows().length > 0) {\n <tr class=\"absolute inset-0 z-10 block\">\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"block h-full p-0\">\n <div\n class=\"flex h-full min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Footer controls: page size selector, page navigation, and total record counter -->\n <div class=\"flex w-full flex-wrap items-center justify-end gap-4 py-2\">\n <div class=\"mr-auto flex items-center gap-2 text-sm text-green-1\">\n <span class=\"whitespace-nowrap font-medium\">Rows per page</span>\n <select\n class=\"h-8 cursor-pointer rounded border border-aqua-1 bg-white-base px-2 text-sm text-green-1 outline-none transition hover:border-green-1 focus:border-green-1 focus:ring-2 focus:ring-green-1/20\"\n [value]=\"pageSize\"\n (change)=\"onPageSizeChange($event)\"\n [attr.data-testid]=\"contentTestId + '-page-size-select'\"\n >\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n <option value=\"100\">100</option>\n </select>\n </div>\n\n <div class=\"flex w-fit items-center justify-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === 1\"\n (click)=\"previousPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-previous'\"\n >\n <span class=\"text-lg leading-none\">\u2039</span>\n Previous\n </button>\n\n <div class=\"flex items-center justify-center gap-1\">\n @for (page of getPageNumbers(); track $index) {\n @if (page === null) {\n <span\n class=\"inline-flex h-8 min-w-8 select-none items-center justify-center px-2 font-medium text-neutral-disabled-text\"\n >...</span\n >\n } @else {\n <button\n type=\"button\"\n class=\"inline-flex h-8 min-w-8 items-center justify-center rounded px-2 font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 outline-0 border-none\"\n [ngClass]=\"{\n 'bg-green-1 text-white-base hover:text-white-base':\n currentPage === page,\n 'bg-transparent': currentPage !== page,\n }\"\n [disabled]=\"false\"\n (click)=\"goToPage(page)\"\n [attr.data-testid]=\"contentTestId + '-pagination-page-' + page\"\n >\n {{ page }}\n </button>\n }\n }\n </div>\n\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"nextPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-next'\"\n >\n Next\n <span class=\"text-lg leading-none\">\u203A</span>\n </button>\n </div>\n\n @if (totalRegisters) {\n <div\n class=\"w-fit min-w-20 text-sm font-medium text-neutral-disabled-text\"\n [attr.data-testid]=\"contentTestId + '-pagination-info'\"\n >\n Total Records: {{ totalRegisters }}\n </div>\n }\n </div>\n </div>\n} @else {\n <!-- Empty state layout when there are no rows to display -->\n <div class=\"w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <thead class=\"bg-green-1 text-white-base\">\n <tr class=\"h-10 min-h-10 max-h-11.25\">\n @if (selectable) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 w-10 px-3 text-center first:rounded-l-2xl\"\n ></th>\n }\n @for (column of getHeaderCells(); track column.id) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-left font-medium first:rounded-l-2xl\"\n >\n {{ column.column.columnDef.header }}\n </th>\n }\n @if (showButtons) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium rounded-r-2xl\"\n >\n Options\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"py-2\">\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-aqua-2 bg-aqua-5/40 px-6 py-5 text-center\"\n >\n <span class=\"text-base font-semibold text-green-1\"\n >No available data</span\n >\n <span class=\"text-sm text-neutral-disabled-text\"\n >No data to display right now.</span\n >\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n}\n", styles: [":host ::ng-deep .cdk-drag-preview{background-color:#014744!important;color:#fff!important;border-radius:1rem!important;border-right:1px solid rgba(255,255,255,.2)!important;box-shadow:0 12px 28px #01474447!important;overflow:hidden!important}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging th.cdk-drag:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(.2,0,0,1)}:host ::ng-deep th.cdk-drag-animating{transition:transform .22s cubic-bezier(.2,0,0,1)}::ng-deep .cdk-drag-preview{background:#014743a9!important;color:#fff!important;box-shadow:none!important;border:none!important;border-radius:10rem!important}\n"] }]
|
|
4361
|
+
], template: "@if (getRows().length > 0 || isLoading) {\n <!-- Main table layout: data grid + footer pagination area -->\n <div\n class=\"flex w-full flex-col justify-between gap-4\"\n [ngClass]=\"{ 'min-h-[60vh]': minH }\"\n >\n <div class=\"relative min-h-40 w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <!-- Interactive header row: sorting, drag-and-drop, and column resizing -->\n <thead class=\"bg-green-1 text-white-base\">\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"h-10 min-h-10 max-h-11.25\"\n (cdkDropListDropped)=\"drop($event)\"\n [ngStyle]=\"allContentLeft ? { 'text-align': 'left' } : null\"\n >\n @if (selectable) {\n <!-- Checkbox selection column header: select all rows -->\n <th\n class=\"relative h-10 min-h-10 max-h-11.25 w-10 px-3 text-center align-middle border-r border-white/20 first:rounded-l-2xl\"\n [attr.data-testid]=\"contentTestId + '-header-select-all'\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n controlColor=\"white\"\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isSomeSelected() && !isAllSelected()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></ads-checkbox>\n </div>\n </th>\n }\n @for (\n column of getHeaderCells();\n track column.id + \"-\" + headerRenderVersion\n ) {\n @if (isColumnSortable(column)) {\n @if (areColumnsDraggable) {\n <!-- Sortable + draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0 overflow-hidden cursor-grab active:cursor-grabbing\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n cdkDragHandle\n class=\"group flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 border-none outline-0 bg-transparent hover:bg-white/10\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n <!-- When right-aligned, the sort indicator is shown before the header text -->\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n <!-- For left/center aligned headers, the sort indicator is shown after the text -->\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Sortable header cell without drag-and-drop -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n class=\"flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 hover:bg-white/10 bg-green-base\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n } @else {\n @if (areColumnsDraggable) {\n <!-- Non-sortable but draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n cdkDragHandle\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Plain header cell (no sort, no drag) -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n }\n }\n\n @if (showButtons) {\n <!-- Optional actions column header -->\n <th\n [attr.data-testid]=\"contentTestId + '-header-actions'\"\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium whitespace-nowrap rounded-r-2xl\"\n [class.sticky-actions]=\"stickyActions\"\n [ngStyle]=\"{ width: '1%' }\"\n >\n Actions\n </th>\n }\n </tr>\n </thead>\n\n <tbody class=\"relative\">\n @if (isLoading && getRows().length === 0) {\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"p-0\">\n <div\n class=\"flex min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of getRows(); track trackByFn($index, row)) {\n <tr\n [attr.data-testid]=\"getRowTestId(row, $index)\"\n class=\"h-10 min-h-10 max-h-11.25\"\n >\n @if (selectable) {\n <!-- Optional row selection checkbox -->\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 align-middle text-center\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n [checked]=\"isRowSelected(row)\"\n (checkedChange)=\"toggleRowSelection(row)\"\n ></ads-checkbox>\n </div>\n </td>\n }\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 text-sm whitespace-pre-line wrap-break-word text-black-base\"\n [ngClass]=\"cellAlignmentClass(cell)\"\n [ngStyle]=\"allContentLeft ? { padding: '0' } : null\"\n >\n @if (isStateCell(cell)) {\n <!-- State-like values (status/active) are rendered with ads-state for a consistent visual token -->\n <ads-state\n [shape]=\"getStateStyle(cell).shape ?? statusShape\"\n [containerShapes]=\"\n getStateStyle(cell).shape ?? statusShape\n \"\n [borderColor]=\"getStateStyle(cell).borderColor\"\n [bgColor]=\"getStateStyle(cell).bgColor\"\n [textColor]=\"getStateStyle(cell).textColor\"\n [text]=\"getStateText(cell)\"\n [fullWidth]=\"getStateStyle(cell).fullWidth ?? false\"\n [boldText]=\"getStateStyle(cell).boldText ?? true\"\n ></ads-state>\n } @else {\n <!-- Generic cell rendering for non-state columns via TanStack flexRender output -->\n <ng-container\n *flexRender=\"\n cell.column.columnDef.cell;\n props: cell.getContext();\n let renderedCell\n \"\n >\n <div\n [innerHTML]=\"renderedCell\"\n [ngStyle]=\"\n allContentLeft ? { 'text-align': 'left' } : null\n \"\n ></div>\n </ng-container>\n }\n </td>\n }\n\n @if (showButtons && actionButtons.length > 0) {\n <!-- Optional row action buttons -->\n <td\n class=\"border-b border-[#aedad8] px-1 py-1 align-middle text-center whitespace-nowrap\"\n [class.sticky-actions]=\"stickyActions\"\n >\n <div\n class=\"flex w-full items-center justify-center gap-1 p-0\"\n >\n @for (button of actionButtons; track $index) {\n @if (\n !button.condition || button.condition(row.original)\n ) {\n <button\n nz-tooltip\n [nzTooltipTitle]=\"\n getTooltipText(button, row.original)\n \"\n ads-button\n type=\"button\"\n [onlyIconButton]=\"true\"\n color=\"text\"\n [attr.data-testid]=\"\n getActionButtonTestId(row, button, $index)\n \"\n [title]=\"getTooltipText(button, row.original)\"\n [disabled]=\"\n isActionButtonDisabled(button, row.original)\n \"\n (click)=\"button.callback(row.original)\"\n >\n <ads-icon\n [ngClass]=\"\n isActionButtonDisabled(button, row.original)\n ? 'text-neutral-disabled-text'\n : 'text-green-1'\n \"\n [iconName]=\"iconNameFor(button.icon)\"\n [size]=\"16\"\n ></ads-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n }\n\n @if (isLoading && getRows().length > 0) {\n <tr class=\"absolute inset-0 z-10 block\">\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"block h-full p-0\">\n <div\n class=\"flex h-full min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Footer controls: page size selector, page navigation, and total record counter -->\n <div class=\"flex w-full flex-wrap items-center justify-end gap-4 py-2\">\n <div class=\"mr-auto flex items-center gap-2 text-sm text-green-1\">\n <span class=\"whitespace-nowrap font-medium\">Rows per page</span>\n <select\n class=\"h-8 cursor-pointer rounded border border-aqua-1 bg-white-base px-2 text-sm text-green-1 outline-none transition hover:border-green-1 focus:border-green-1 focus:ring-2 focus:ring-green-1/20\"\n [value]=\"pageSize\"\n (change)=\"onPageSizeChange($event)\"\n [attr.data-testid]=\"contentTestId + '-page-size-select'\"\n >\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n <option value=\"100\">100</option>\n </select>\n </div>\n\n <div class=\"flex w-fit items-center justify-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === 1\"\n (click)=\"previousPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-previous'\"\n >\n <span class=\"text-lg leading-none\">\u2039</span>\n Previous\n </button>\n\n <div class=\"flex items-center justify-center gap-1\">\n @for (page of getPageNumbers(); track $index) {\n @if (page === null) {\n <span\n class=\"inline-flex h-8 min-w-8 select-none items-center justify-center px-2 font-medium text-neutral-disabled-text\"\n >...</span\n >\n } @else {\n <button\n type=\"button\"\n class=\"inline-flex h-8 min-w-8 items-center justify-center rounded px-2 font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 outline-0 border-none\"\n [ngClass]=\"{\n 'bg-green-1 text-white-base hover:text-white-base':\n currentPage === page,\n 'bg-transparent': currentPage !== page,\n }\"\n [disabled]=\"false\"\n (click)=\"goToPage(page)\"\n [attr.data-testid]=\"contentTestId + '-pagination-page-' + page\"\n >\n {{ page }}\n </button>\n }\n }\n </div>\n\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"nextPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-next'\"\n >\n Next\n <span class=\"text-lg leading-none\">\u203A</span>\n </button>\n </div>\n\n @if (totalRegisters) {\n <div\n class=\"w-fit min-w-20 text-sm font-medium text-neutral-disabled-text\"\n [attr.data-testid]=\"contentTestId + '-pagination-info'\"\n >\n Total Records: {{ totalRegisters }}\n </div>\n }\n </div>\n </div>\n} @else {\n <!-- Empty state layout when there are no rows to display -->\n <div class=\"w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <thead class=\"bg-green-1 text-white-base\">\n <tr class=\"h-10 min-h-10 max-h-11.25\">\n @if (selectable) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 w-10 px-3 text-center first:rounded-l-2xl\"\n ></th>\n }\n @for (column of getHeaderCells(); track column.id) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-left font-medium first:rounded-l-2xl\"\n >\n {{ column.column.columnDef.header }}\n </th>\n }\n @if (showButtons) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium rounded-r-2xl\"\n >\n Options\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"py-2\">\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-aqua-2 bg-aqua-5/40 px-6 py-5 text-center\"\n >\n <span class=\"text-base font-semibold text-green-1\"\n >No available data</span\n >\n <span class=\"text-sm text-neutral-disabled-text\"\n >No data to display right now.</span\n >\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n}\n", styles: [".sticky-actions{position:sticky;right:0;z-index:5}th.sticky-actions{background-color:var(--color-green-1, #014744)}td.sticky-actions{background-color:var(--ads-table-sticky-actions-bg, var(--color-white-base, #f6f6f6))}:host ::ng-deep .cdk-drag-preview{background-color:#014744!important;color:#fff!important;border-radius:1rem!important;border-right:1px solid rgba(255,255,255,.2)!important;box-shadow:0 12px 28px #01474447!important;overflow:hidden!important}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging th.cdk-drag:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(.2,0,0,1)}:host ::ng-deep th.cdk-drag-animating{transition:transform .22s cubic-bezier(.2,0,0,1)}::ng-deep .cdk-drag-preview{background:#014743a9!important;color:#fff!important;box-shadow:none!important;border:none!important;border-radius:10rem!important}\n"] }]
|
|
4159
4362
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4160
4363
|
type: Attribute,
|
|
4161
4364
|
args: ['data-testid']
|
|
@@ -4210,6 +4413,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
4210
4413
|
type: Input
|
|
4211
4414
|
}], selectable: [{
|
|
4212
4415
|
type: Input
|
|
4416
|
+
}], stickyActions: [{
|
|
4417
|
+
type: Input
|
|
4213
4418
|
}] } });
|
|
4214
4419
|
|
|
4215
4420
|
/**
|