@ngbase/adk 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngbase-adk-a11y.mjs +42 -42
- package/fesm2022/ngbase-adk-a11y.mjs.map +1 -1
- package/fesm2022/ngbase-adk-accordion.mjs +20 -26
- package/fesm2022/ngbase-adk-accordion.mjs.map +1 -1
- package/fesm2022/ngbase-adk-autocomplete.mjs +11 -11
- package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -1
- package/fesm2022/ngbase-adk-avatar.mjs +13 -13
- package/fesm2022/ngbase-adk-avatar.mjs.map +1 -1
- package/fesm2022/ngbase-adk-bidi.mjs +3 -3
- package/fesm2022/ngbase-adk-bidi.mjs.map +1 -1
- package/fesm2022/ngbase-adk-breadcrumb.mjs +14 -14
- package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngbase-adk-cache.mjs +3 -3
- package/fesm2022/ngbase-adk-cache.mjs.map +1 -1
- package/fesm2022/ngbase-adk-carousel.mjs +18 -18
- package/fesm2022/ngbase-adk-carousel.mjs.map +1 -1
- package/fesm2022/ngbase-adk-checkbox.mjs +15 -21
- package/fesm2022/ngbase-adk-checkbox.mjs.map +1 -1
- package/fesm2022/ngbase-adk-chip.mjs +12 -12
- package/fesm2022/ngbase-adk-chip.mjs.map +1 -1
- package/fesm2022/ngbase-adk-clipboard.mjs +7 -5
- package/fesm2022/ngbase-adk-clipboard.mjs.map +1 -1
- package/fesm2022/ngbase-adk-collections.mjs.map +1 -1
- package/fesm2022/ngbase-adk-color-picker.mjs +44 -53
- package/fesm2022/ngbase-adk-color-picker.mjs.map +1 -1
- package/fesm2022/ngbase-adk-cookies.mjs +3 -3
- package/fesm2022/ngbase-adk-cookies.mjs.map +1 -1
- package/fesm2022/ngbase-adk-datepicker.mjs +70 -89
- package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -1
- package/fesm2022/ngbase-adk-dialog.mjs +17 -39
- package/fesm2022/ngbase-adk-dialog.mjs.map +1 -1
- package/fesm2022/ngbase-adk-drag.mjs +20 -20
- package/fesm2022/ngbase-adk-drag.mjs.map +1 -1
- package/fesm2022/ngbase-adk-form-field.mjs +65 -118
- package/fesm2022/ngbase-adk-form-field.mjs.map +1 -1
- package/fesm2022/ngbase-adk-hover-card.mjs +5 -5
- package/fesm2022/ngbase-adk-hover-card.mjs.map +1 -1
- package/fesm2022/ngbase-adk-icon.mjs +9 -11
- package/fesm2022/ngbase-adk-icon.mjs.map +1 -1
- package/fesm2022/ngbase-adk-inline-edit.mjs +27 -35
- package/fesm2022/ngbase-adk-inline-edit.mjs.map +1 -1
- package/fesm2022/ngbase-adk-jwt.mjs +6 -6
- package/fesm2022/ngbase-adk-jwt.mjs.map +1 -1
- package/fesm2022/ngbase-adk-keys.mjs +6 -6
- package/fesm2022/ngbase-adk-keys.mjs.map +1 -1
- package/fesm2022/ngbase-adk-layout.mjs.map +1 -1
- package/fesm2022/ngbase-adk-list.mjs +10 -10
- package/fesm2022/ngbase-adk-list.mjs.map +1 -1
- package/fesm2022/ngbase-adk-mask.mjs +8 -8
- package/fesm2022/ngbase-adk-mask.mjs.map +1 -1
- package/fesm2022/ngbase-adk-menu.mjs +69 -79
- package/fesm2022/ngbase-adk-menu.mjs.map +1 -1
- package/fesm2022/ngbase-adk-network.mjs +3 -3
- package/fesm2022/ngbase-adk-network.mjs.map +1 -1
- package/fesm2022/ngbase-adk-otp.mjs +24 -45
- package/fesm2022/ngbase-adk-otp.mjs.map +1 -1
- package/fesm2022/ngbase-adk-pagination.mjs +9 -9
- package/fesm2022/ngbase-adk-pagination.mjs.map +1 -1
- package/fesm2022/ngbase-adk-popover.mjs +120 -89
- package/fesm2022/ngbase-adk-popover.mjs.map +1 -1
- package/fesm2022/ngbase-adk-portal.mjs +134 -47
- package/fesm2022/ngbase-adk-portal.mjs.map +1 -1
- package/fesm2022/ngbase-adk-progress.mjs +7 -7
- package/fesm2022/ngbase-adk-progress.mjs.map +1 -1
- package/fesm2022/ngbase-adk-radio.mjs +20 -27
- package/fesm2022/ngbase-adk-radio.mjs.map +1 -1
- package/fesm2022/ngbase-adk-resizable.mjs +138 -48
- package/fesm2022/ngbase-adk-resizable.mjs.map +1 -1
- package/fesm2022/ngbase-adk-scroll-area.mjs +28 -20
- package/fesm2022/ngbase-adk-scroll-area.mjs.map +1 -1
- package/fesm2022/ngbase-adk-select.mjs +58 -80
- package/fesm2022/ngbase-adk-select.mjs.map +1 -1
- package/fesm2022/ngbase-adk-selectable.mjs +19 -30
- package/fesm2022/ngbase-adk-selectable.mjs.map +1 -1
- package/fesm2022/ngbase-adk-sheet.mjs +6 -20
- package/fesm2022/ngbase-adk-sheet.mjs.map +1 -1
- package/fesm2022/ngbase-adk-sidenav.mjs +65 -48
- package/fesm2022/ngbase-adk-sidenav.mjs.map +1 -1
- package/fesm2022/ngbase-adk-slider.mjs +40 -53
- package/fesm2022/ngbase-adk-slider.mjs.map +1 -1
- package/fesm2022/ngbase-adk-sonner.mjs +12 -19
- package/fesm2022/ngbase-adk-sonner.mjs.map +1 -1
- package/fesm2022/ngbase-adk-stepper.mjs +17 -25
- package/fesm2022/ngbase-adk-stepper.mjs.map +1 -1
- package/fesm2022/ngbase-adk-switch.mjs +25 -32
- package/fesm2022/ngbase-adk-switch.mjs.map +1 -1
- package/fesm2022/ngbase-adk-table.mjs +581 -83
- package/fesm2022/ngbase-adk-table.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tabs.mjs +37 -35
- package/fesm2022/ngbase-adk-tabs.mjs.map +1 -1
- package/fesm2022/ngbase-adk-test.mjs.map +1 -1
- package/fesm2022/ngbase-adk-toggle-group.mjs +20 -34
- package/fesm2022/ngbase-adk-toggle-group.mjs.map +1 -1
- package/fesm2022/ngbase-adk-toggle.mjs +14 -19
- package/fesm2022/ngbase-adk-toggle.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tooltip.mjs +12 -19
- package/fesm2022/ngbase-adk-tooltip.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tour.mjs +52 -52
- package/fesm2022/ngbase-adk-tour.mjs.map +1 -1
- package/fesm2022/ngbase-adk-translate.mjs +8 -10
- package/fesm2022/ngbase-adk-translate.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tree.mjs +20 -20
- package/fesm2022/ngbase-adk-tree.mjs.map +1 -1
- package/fesm2022/ngbase-adk-utils.mjs +30 -43
- package/fesm2022/ngbase-adk-utils.mjs.map +1 -1
- package/fesm2022/ngbase-adk-virtualizer.mjs +9 -9
- package/fesm2022/ngbase-adk-virtualizer.mjs.map +1 -1
- package/package.json +101 -101
- package/schematics/components/files/accordion/accordion.ts.template +8 -5
- package/schematics/components/files/audio/AudioPlayer.ts.template +245 -0
- package/schematics/components/files/audio/AudioRecorder.ts.template +377 -0
- package/schematics/components/files/audio/AudioVisualizer.ts.template +175 -0
- package/schematics/components/files/audio/index.ts.template +3 -0
- package/schematics/components/files/charts/area-chart.component.ts.template +278 -0
- package/schematics/components/files/charts/bar-chart.component.ts.template +262 -0
- package/schematics/components/files/charts/chart-tooltip.component.ts.template +168 -0
- package/schematics/components/files/charts/index.ts.template +4 -0
- package/schematics/components/files/charts/line-chart.component.ts.template +238 -0
- package/schematics/components/files/charts/pie-chart.component.ts.template +283 -0
- package/schematics/components/files/checkbox/checkbox.ts.template +2 -2
- package/schematics/components/files/color-picker/color-picker.ts.template +2 -2
- package/schematics/components/files/dialog/dialog.ts.template +18 -14
- package/schematics/components/files/drawer/drawer.ts.template +30 -27
- package/schematics/components/files/form-field/form-field.ts.template +49 -21
- package/schematics/components/files/pagination/pagination.ts.template +4 -4
- package/schematics/components/files/picasa/picasa-base.component.ts.template +15 -30
- package/schematics/components/files/popover/popover.ts.template +15 -4
- package/schematics/components/files/select/list-selection.ts.template +0 -2
- package/schematics/components/files/select/option.ts.template +1 -1
- package/schematics/components/files/selectable/selectable.ts.template +2 -2
- package/schematics/components/files/sheet/sheet.ts.template +26 -14
- package/schematics/components/files/sidenav/sidenav.ts.template +7 -5
- package/schematics/components/files/sonner/sonner.ts.template +1 -2
- package/schematics/components/files/stepper/stepper.ts.template +2 -4
- package/schematics/components/files/switch/switch.ts.template +2 -2
- package/schematics/components/files/table/table.ts.template +43 -3
- package/schematics/components/files/theme/theme.service.ts.template +3 -3
- package/schematics/components/files/toggle/toggle.ts.template +1 -1
- package/schematics/components/files/toggle-group/toggle-group.ts.template +1 -1
- package/schematics/components/files/tooltip/tooltip.ts.template +2 -3
- package/{accordion/index.d.ts → types/ngbase-adk-accordion.d.ts} +1 -3
- package/{autocomplete/index.d.ts → types/ngbase-adk-autocomplete.d.ts} +2 -7
- package/{checkbox/index.d.ts → types/ngbase-adk-checkbox.d.ts} +8 -14
- package/types/ngbase-adk-clipboard.d.ts +12 -0
- package/{color-picker/index.d.ts → types/ngbase-adk-color-picker.d.ts} +14 -26
- package/{datepicker/index.d.ts → types/ngbase-adk-datepicker.d.ts} +9 -18
- package/{dialog/index.d.ts → types/ngbase-adk-dialog.d.ts} +3 -8
- package/types/ngbase-adk-form-field.d.ts +88 -0
- package/{inline-edit/index.d.ts → types/ngbase-adk-inline-edit.d.ts} +8 -16
- package/{menu/index.d.ts → types/ngbase-adk-menu.d.ts} +6 -5
- package/{otp/index.d.ts → types/ngbase-adk-otp.d.ts} +8 -16
- package/{popover/index.d.ts → types/ngbase-adk-popover.d.ts} +14 -2
- package/{portal/index.d.ts → types/ngbase-adk-portal.d.ts} +29 -8
- package/{radio/index.d.ts → types/ngbase-adk-radio.d.ts} +9 -12
- package/{resizable/index.d.ts → types/ngbase-adk-resizable.d.ts} +4 -4
- package/{scroll-area/index.d.ts → types/ngbase-adk-scroll-area.d.ts} +2 -1
- package/{select/index.d.ts → types/ngbase-adk-select.d.ts} +8 -22
- package/{selectable/index.d.ts → types/ngbase-adk-selectable.d.ts} +6 -10
- package/{sheet/index.d.ts → types/ngbase-adk-sheet.d.ts} +4 -3
- package/{sidenav/index.d.ts → types/ngbase-adk-sidenav.d.ts} +7 -8
- package/{slider/index.d.ts → types/ngbase-adk-slider.d.ts} +8 -17
- package/{sonner/index.d.ts → types/ngbase-adk-sonner.d.ts} +1 -3
- package/{stepper/index.d.ts → types/ngbase-adk-stepper.d.ts} +1 -4
- package/{switch/index.d.ts → types/ngbase-adk-switch.d.ts} +7 -14
- package/{table/index.d.ts → types/ngbase-adk-table.d.ts} +126 -3
- package/{test/index.d.ts → types/ngbase-adk-test.d.ts} +1 -1
- package/{toggle-group/index.d.ts → types/ngbase-adk-toggle-group.d.ts} +5 -10
- package/types/ngbase-adk-toggle.d.ts +14 -0
- package/{tooltip/index.d.ts → types/ngbase-adk-tooltip.d.ts} +9 -11
- package/{tour/index.d.ts → types/ngbase-adk-tour.d.ts} +4 -6
- package/{utils/index.d.ts → types/ngbase-adk-utils.d.ts} +15 -11
- package/clipboard/index.d.ts +0 -11
- package/form-field/index.d.ts +0 -97
- package/toggle/index.d.ts +0 -16
- /package/{a11y/index.d.ts → types/ngbase-adk-a11y.d.ts} +0 -0
- /package/{avatar/index.d.ts → types/ngbase-adk-avatar.d.ts} +0 -0
- /package/{bidi/index.d.ts → types/ngbase-adk-bidi.d.ts} +0 -0
- /package/{breadcrumb/index.d.ts → types/ngbase-adk-breadcrumb.d.ts} +0 -0
- /package/{cache/index.d.ts → types/ngbase-adk-cache.d.ts} +0 -0
- /package/{carousel/index.d.ts → types/ngbase-adk-carousel.d.ts} +0 -0
- /package/{chip/index.d.ts → types/ngbase-adk-chip.d.ts} +0 -0
- /package/{collections/index.d.ts → types/ngbase-adk-collections.d.ts} +0 -0
- /package/{cookies/index.d.ts → types/ngbase-adk-cookies.d.ts} +0 -0
- /package/{drag/index.d.ts → types/ngbase-adk-drag.d.ts} +0 -0
- /package/{hover-card/index.d.ts → types/ngbase-adk-hover-card.d.ts} +0 -0
- /package/{icon/index.d.ts → types/ngbase-adk-icon.d.ts} +0 -0
- /package/{jwt/index.d.ts → types/ngbase-adk-jwt.d.ts} +0 -0
- /package/{keys/index.d.ts → types/ngbase-adk-keys.d.ts} +0 -0
- /package/{layout/index.d.ts → types/ngbase-adk-layout.d.ts} +0 -0
- /package/{list/index.d.ts → types/ngbase-adk-list.d.ts} +0 -0
- /package/{mask/index.d.ts → types/ngbase-adk-mask.d.ts} +0 -0
- /package/{network/index.d.ts → types/ngbase-adk-network.d.ts} +0 -0
- /package/{pagination/index.d.ts → types/ngbase-adk-pagination.d.ts} +0 -0
- /package/{progress/index.d.ts → types/ngbase-adk-progress.d.ts} +0 -0
- /package/{tabs/index.d.ts → types/ngbase-adk-tabs.d.ts} +0 -0
- /package/{translate/index.d.ts → types/ngbase-adk-translate.d.ts} +0 -0
- /package/{tree/index.d.ts → types/ngbase-adk-tree.d.ts} +0 -0
- /package/{virtualizer/index.d.ts → types/ngbase-adk-virtualizer.d.ts} +0 -0
- /package/{index.d.ts → types/ngbase-adk.d.ts} +0 -0
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { animate, state, style, transition, trigger } from '@angular/animations';
|
|
2
1
|
import {
|
|
3
2
|
ChangeDetectionStrategy,
|
|
4
3
|
Component,
|
|
5
4
|
ViewContainerRef,
|
|
6
|
-
|
|
5
|
+
computed,
|
|
7
6
|
viewChild,
|
|
8
7
|
} from '@angular/core';
|
|
9
8
|
import { FocusTrap } from '@ngbase/adk/a11y';
|
|
10
9
|
import { BaseDialog, basePortal, DialogInput, DialogOptions } from '@ngbase/adk/portal';
|
|
11
|
-
import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
|
|
12
10
|
|
|
13
11
|
@Component({
|
|
14
12
|
selector: '<%= name %>-drawer',
|
|
15
13
|
template: `
|
|
16
14
|
<div class="pointer-events-none flex h-full flex-col justify-end">
|
|
17
15
|
<div
|
|
18
|
-
class="
|
|
19
|
-
|
|
16
|
+
class="{{
|
|
17
|
+
'bg-background pointer-events-auto flex max-h-[90vh] flex-col overflow-hidden rounded-tl-2xl rounded-tr-2xl border-t p-4 shadow-2xl' +
|
|
18
|
+
(closing() ? ' drawer-content-leave' : ' drawer-content')
|
|
19
|
+
}}"
|
|
20
|
+
(animationend)="onAnimationEnd($event)"
|
|
20
21
|
>
|
|
21
|
-
<button class="mx-auto h-2 w-20 rounded-full
|
|
22
|
+
<button class="bg-muted-foreground mx-auto h-2 w-20 rounded-full"></button>
|
|
22
23
|
@if (!isHideHeader) {
|
|
23
24
|
<div class="flex h-8 items-center">
|
|
24
25
|
<h2 class="flex-1 font-bold">{{ options.title }}</h2>
|
|
@@ -26,50 +27,52 @@ import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
|
|
|
26
27
|
</div>
|
|
27
28
|
}
|
|
28
29
|
<div class="h-full overflow-auto">
|
|
29
|
-
<ng-container #
|
|
30
|
+
<ng-container #contentContainer />
|
|
30
31
|
</div>
|
|
31
32
|
</div>
|
|
32
33
|
</div>
|
|
33
34
|
@if (backdropColor) {
|
|
34
35
|
<div
|
|
35
|
-
class="absolute top-0 -z-10 h-full w-full bg-black/30"
|
|
36
|
-
[@fadeAnimation]
|
|
37
36
|
(click)="close()"
|
|
37
|
+
(animationend)="onAnimationEnd($event)"
|
|
38
|
+
class="{{
|
|
39
|
+
'absolute top-0 -z-10 h-full w-full bg-black/30' +
|
|
40
|
+
(closing() ? ' dialog-backdrop-leave' : ' dialog-backdrop')
|
|
41
|
+
}}"
|
|
38
42
|
></div>
|
|
39
43
|
}
|
|
40
44
|
`,
|
|
41
45
|
host: {
|
|
42
46
|
class: 'fixed block top-0 bottom-0 left-0 right-0 overflow-hidden z-p',
|
|
43
|
-
'[@parentAnimation]': '',
|
|
44
|
-
'(@parentAnimation.done)': 'animationDone()',
|
|
45
47
|
},
|
|
46
48
|
hostDirectives: [FocusTrap],
|
|
47
49
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
48
|
-
animations: [
|
|
49
|
-
createHostAnimation(['@bottomAnimation', '@fadeAnimation']),
|
|
50
|
-
trigger('bottomAnimation', [
|
|
51
|
-
state('1', style({ transform: 'none' })),
|
|
52
|
-
state('void', style({ transform: 'translate3d(0, 100%, 0)' })),
|
|
53
|
-
state('0', style({ transform: 'translate3d(0, 100%, 0)' })),
|
|
54
|
-
transition('* => *', animate('200ms ease')),
|
|
55
|
-
]),
|
|
56
|
-
fadeAnimation('200ms'),
|
|
57
|
-
],
|
|
58
50
|
})
|
|
59
51
|
export class DrawerContainer extends BaseDialog {
|
|
60
|
-
|
|
52
|
+
protected override readonly hasAnimations = true;
|
|
53
|
+
readonly contentContainer = viewChild('contentContainer', { read: ViewContainerRef });
|
|
61
54
|
backdropColor = true;
|
|
62
55
|
options!: DialogOptions;
|
|
63
56
|
classNames = '';
|
|
64
57
|
isHideHeader = false;
|
|
65
58
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
});
|
|
59
|
+
onAnimationEnd(event: AnimationEvent) {
|
|
60
|
+
if (event.target === event.currentTarget) {
|
|
61
|
+
this.animationDone();
|
|
62
|
+
}
|
|
71
63
|
}
|
|
72
64
|
|
|
65
|
+
readonly style = computed(() => {
|
|
66
|
+
return {
|
|
67
|
+
width: this.options.fullWindow ? '100vw' : this.options.width,
|
|
68
|
+
height: this.options.fullWindow ? '100vh' : this.options.height,
|
|
69
|
+
maxWidth: this.options.fullWindow ? '100vw' : this.options.maxWidth,
|
|
70
|
+
maxHeight: this.options.fullWindow ? '100vh' : this.options.maxHeight || '96vh',
|
|
71
|
+
minHeight: this.options.minHeight,
|
|
72
|
+
minWidth: this.options.minWidth,
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
|
|
73
76
|
override setOptions(options: DialogOptions): void {
|
|
74
77
|
this.options = options;
|
|
75
78
|
this.classNames = this.options.classNames?.join(' ') || '';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChangeDetectionStrategy,
|
|
3
3
|
Component,
|
|
4
|
+
computed,
|
|
4
5
|
Directive,
|
|
5
6
|
effect,
|
|
6
7
|
ElementRef,
|
|
7
8
|
inject,
|
|
8
|
-
OnDestroy,
|
|
9
9
|
viewChild,
|
|
10
10
|
} from '@angular/core';
|
|
11
11
|
import {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
NgbFormField,
|
|
14
14
|
NgbInputError,
|
|
15
15
|
NgbLabel,
|
|
16
|
-
|
|
16
|
+
NumberFormat,
|
|
17
17
|
} from '@ngbase/adk/form-field';
|
|
18
18
|
import { InputStyle } from './input-style.directive';
|
|
19
19
|
import { NgbSelectTarget } from '@ngbase/adk/select';
|
|
@@ -26,20 +26,44 @@ import { NgbSelectTarget } from '@ngbase/adk/select';
|
|
|
26
26
|
template: `
|
|
27
27
|
<ng-content select="[<%= name %>Label]" />
|
|
28
28
|
<ng-content select="[<%= name %>Description]" />
|
|
29
|
-
<div
|
|
29
|
+
<div
|
|
30
|
+
class="has-[[disabled]]:bg-input/30 flex items-center"
|
|
31
|
+
#target
|
|
32
|
+
<%= name %>InputStyle
|
|
33
|
+
[class]="
|
|
34
|
+
ngbFormField.hasErrors()
|
|
35
|
+
? 'border-red-500 focus-within:border-red-500 focus-within:ring-red-500/30'
|
|
36
|
+
: ''
|
|
37
|
+
"
|
|
38
|
+
>
|
|
30
39
|
<ng-content select="[<%= name %>Prefix]" />
|
|
31
40
|
<ng-content />
|
|
32
41
|
<ng-content select="[<%= name %>Suffix]" />
|
|
33
42
|
</div>
|
|
34
|
-
|
|
43
|
+
@for (error of errors(); track error.kind) {
|
|
44
|
+
<div class="overflow-hidden" animate.enter="height-enter" animate.leave="height-leave">
|
|
45
|
+
<div class="mx-0.5 min-h-0 text-sm text-red-500">
|
|
46
|
+
{{ error.message }}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
}
|
|
35
50
|
`,
|
|
36
51
|
host: {
|
|
37
52
|
class: 'inline-flex flex-col font-medium gap-1',
|
|
38
53
|
},
|
|
39
54
|
})
|
|
40
|
-
export class
|
|
55
|
+
export class MeeFormField {
|
|
56
|
+
readonly ngbFormField = inject(NgbFormField);
|
|
41
57
|
readonly selectTarget = inject(NgbSelectTarget);
|
|
42
58
|
readonly target = viewChild.required<ElementRef<HTMLDivElement>>('target');
|
|
59
|
+
readonly errors = computed(() => {
|
|
60
|
+
const control = this.ngbFormField._control();
|
|
61
|
+
const state = control?.state();
|
|
62
|
+
if (state?.touched() && state?.errors()?.length) {
|
|
63
|
+
return state.errors();
|
|
64
|
+
}
|
|
65
|
+
return [];
|
|
66
|
+
});
|
|
43
67
|
private _ = effect(() => {
|
|
44
68
|
this.selectTarget.target.set(this.target().nativeElement);
|
|
45
69
|
});
|
|
@@ -57,6 +81,16 @@ export class MeeInput {
|
|
|
57
81
|
readonly formField = inject(NgbFormField, { optional: true });
|
|
58
82
|
}
|
|
59
83
|
|
|
84
|
+
@Directive({
|
|
85
|
+
selector: '[<%= name %>NumberInput]',
|
|
86
|
+
// hostDirectives: [{ directive: InputBase, inputs: ['value'], outputs: ['valueChange'] }],
|
|
87
|
+
host: {
|
|
88
|
+
class: 'outline-none w-full bg-transparent placeholder:text-gray-400',
|
|
89
|
+
'[class.border-red-500]': 'formField?.hasErrors()',
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
export class MeeNumberInput extends NumberFormat {}
|
|
93
|
+
|
|
60
94
|
@Component({
|
|
61
95
|
selector: '[<%= name %>Label]',
|
|
62
96
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -95,26 +129,20 @@ export class InputSuffix {}
|
|
|
95
129
|
@Component({
|
|
96
130
|
selector: '[<%= name %>Error]',
|
|
97
131
|
hostDirectives: [{ directive: NgbInputError, inputs: ['ngbError: <%= name %>Error'] }],
|
|
98
|
-
template:
|
|
132
|
+
template: `
|
|
133
|
+
@if (isInvalid()) {
|
|
134
|
+
<div class="overflow-hidden" animate.enter="height-enter" animate.leave="height-leave">
|
|
135
|
+
<div class="min-h-0">
|
|
136
|
+
<ng-content />
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
}
|
|
140
|
+
`,
|
|
99
141
|
host: {
|
|
100
142
|
class: 'text-red-500 mx-0.5',
|
|
101
|
-
'[@toggleDiv]': 'isInvalid() ? "visible" : "hidden"',
|
|
102
143
|
},
|
|
103
|
-
animations: [toggleDiv],
|
|
104
144
|
})
|
|
105
|
-
export class InputError
|
|
145
|
+
export class InputError {
|
|
106
146
|
readonly error = inject(NgbInputError);
|
|
107
|
-
readonly el = inject<ElementRef<HTMLDivElement>>(ElementRef);
|
|
108
|
-
|
|
109
147
|
readonly isInvalid = this.error.isInvalid;
|
|
110
|
-
|
|
111
|
-
constructor() {
|
|
112
|
-
this.error.animate.set(true);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
ngOnDestroy() {
|
|
116
|
-
if (!this.isInvalid()) {
|
|
117
|
-
this.el.nativeElement.classList.add('h-0', 'opacity-0');
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
148
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
lucideChevronsLeft,
|
|
11
11
|
lucideChevronsRight,
|
|
12
12
|
} from '@ng-icons/lucide';
|
|
13
|
-
import {
|
|
13
|
+
import { MeeFormField } from '<%= basepath %>/form-field';
|
|
14
14
|
|
|
15
15
|
@Component({
|
|
16
16
|
selector: '<%= name %>-pagination',
|
|
@@ -23,12 +23,12 @@ import { FormField } from '<%= basepath %>/form-field';
|
|
|
23
23
|
lucideChevronsRight,
|
|
24
24
|
}),
|
|
25
25
|
],
|
|
26
|
-
imports: [Button, Icon, Select, Option, NgbPaginationBtn,
|
|
26
|
+
imports: [Button, Icon, Select, Option, NgbPaginationBtn, MeeFormField],
|
|
27
27
|
template: `
|
|
28
28
|
<div class="flex items-center gap-2">
|
|
29
29
|
<div>Rows per page</div>
|
|
30
30
|
<<%= name %>-form-field class="!w-auto [&>.mis]:min-h-8 [&>.mis]:py-0">
|
|
31
|
-
<<%= name %>-select [value]="size()" (valueChange)="sizeChanged($event)">
|
|
31
|
+
<<%= name %>-select [value]="size()" (valueChange)="sizeChanged($any($event))">
|
|
32
32
|
@for (size of sizeOptions(); track size) {
|
|
33
33
|
<<%= name %>-option [value]="size">
|
|
34
34
|
{{ size }}
|
|
@@ -51,7 +51,7 @@ import { FormField } from '<%= basepath %>/form-field';
|
|
|
51
51
|
ngbPaginationBtn="page"
|
|
52
52
|
[jump]="snap"
|
|
53
53
|
<%= name %>Button="ghost"
|
|
54
|
-
class="
|
|
54
|
+
class="ring-offset-foreground aria-[current=page]:bg-muted aria-[current=page]:text-primary min-w-9 !p-2"
|
|
55
55
|
>
|
|
56
56
|
{{ snap }}
|
|
57
57
|
</button>
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
afterNextRender,
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
viewChild,
|
|
6
|
-
ViewContainerRef,
|
|
7
|
-
} from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, viewChild, ViewContainerRef } from '@angular/core';
|
|
8
2
|
import { BaseDialog, DialogOptions } from '@ngbase/adk/portal';
|
|
9
|
-
import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
|
|
10
3
|
import { Subject } from 'rxjs';
|
|
11
4
|
|
|
12
5
|
@Component({
|
|
@@ -15,18 +8,20 @@ import { Subject } from 'rxjs';
|
|
|
15
8
|
template: `
|
|
16
9
|
<div class="pointer-events-none flex h-full items-center justify-center">
|
|
17
10
|
<div class="pointer-events-auto">
|
|
18
|
-
<ng-container #
|
|
11
|
+
<ng-container #contentContainer />
|
|
19
12
|
</div>
|
|
20
13
|
<div
|
|
21
|
-
class="backdropColor pointer-events-auto absolute top-0 -z-10 h-full w-full"
|
|
22
14
|
(click)="!options.disableClose && close()"
|
|
23
|
-
|
|
15
|
+
(animationend)="onAnimationEnd($event)"
|
|
16
|
+
class="{{
|
|
17
|
+
'backdropColor pointer-events-auto absolute top-0 -z-10 h-full w-full' +
|
|
18
|
+
(closing() ? ' dialog-backdrop-leave' : ' dialog-backdrop')
|
|
19
|
+
}}"
|
|
24
20
|
></div>
|
|
25
21
|
</div>
|
|
26
22
|
`,
|
|
27
23
|
host: {
|
|
28
24
|
class: 'fixed block top-0 bottom-0 left-0 right-0 overflow-auto pointer-events-none z-p',
|
|
29
|
-
'[@parentAnimation]': '',
|
|
30
25
|
},
|
|
31
26
|
styles: `
|
|
32
27
|
.backdropColor {
|
|
@@ -41,10 +36,10 @@ import { Subject } from 'rxjs';
|
|
|
41
36
|
border-radius: 0;
|
|
42
37
|
}
|
|
43
38
|
`,
|
|
44
|
-
animations: [createHostAnimation(['@fadeAnimation']), fadeAnimation('300ms')],
|
|
45
39
|
})
|
|
46
40
|
export class PicasaBase extends BaseDialog {
|
|
47
|
-
|
|
41
|
+
protected override readonly hasAnimations = true;
|
|
42
|
+
readonly contentContainer = viewChild('contentContainer', { read: ViewContainerRef });
|
|
48
43
|
|
|
49
44
|
backdropColor = true;
|
|
50
45
|
isSidePopup = true;
|
|
@@ -54,26 +49,16 @@ export class PicasaBase extends BaseDialog {
|
|
|
54
49
|
isHideHeader = false;
|
|
55
50
|
onDone = new Subject<any>();
|
|
56
51
|
|
|
57
|
-
constructor() {
|
|
58
|
-
super();
|
|
59
|
-
afterNextRender(() => {
|
|
60
|
-
this._afterViewSource.next(this.myDialog()!);
|
|
61
|
-
|
|
62
|
-
// setTimeout(() => {
|
|
63
|
-
// this.show.set(false);
|
|
64
|
-
// }, 2000);
|
|
65
|
-
});
|
|
66
|
-
// this.dialogRef.afterClosed.subscribe(() => {
|
|
67
|
-
// setTimeout(() => {
|
|
68
|
-
// this.animationDone();
|
|
69
|
-
// }, 500);
|
|
70
|
-
// });
|
|
71
|
-
}
|
|
72
|
-
|
|
73
52
|
override setOptions(options: DialogOptions) {
|
|
74
53
|
this.options = options;
|
|
75
54
|
this.classNames = this.options.classNames?.join(' ') || '';
|
|
76
55
|
this.isHideHeader = this.options.header || false;
|
|
77
56
|
this.backdropColor = this.options.backdropColor || true;
|
|
78
57
|
}
|
|
58
|
+
|
|
59
|
+
onAnimationEnd(event: AnimationEvent) {
|
|
60
|
+
if (event.target === event.currentTarget) {
|
|
61
|
+
this.animationDone();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
79
64
|
}
|
|
@@ -18,11 +18,14 @@ import {
|
|
|
18
18
|
imports: [NgbPopoverBackdrop, NgbPopoverMain, NgbPopoverArrow],
|
|
19
19
|
template: ` <div
|
|
20
20
|
ngbPopoverMain
|
|
21
|
-
|
|
22
|
-
class="
|
|
21
|
+
(animationend)="onAnimationEnd($event)"
|
|
22
|
+
class="{{
|
|
23
|
+
'menu-container pointer-events-auto fixed z-10 flex flex-col rounded-lg border bg-popover text-popover-foreground shadow-md' +
|
|
24
|
+
(closing() ? ' popover-content-leave' : ' popover-content')
|
|
25
|
+
}}"
|
|
23
26
|
>
|
|
24
27
|
<div class="flex flex-1 flex-col overflow-auto" ngbPopoverArrow>
|
|
25
|
-
<ng-container #
|
|
28
|
+
<ng-container #contentContainer />
|
|
26
29
|
</div>
|
|
27
30
|
</div>
|
|
28
31
|
@if (options().backdrop) {
|
|
@@ -33,7 +36,15 @@ import {
|
|
|
33
36
|
'fixed top-0 left-0 w-full h-full pointer-events-none z-p flex items-center justify-center',
|
|
34
37
|
},
|
|
35
38
|
})
|
|
36
|
-
class Popover extends NgbPopover {
|
|
39
|
+
class Popover extends NgbPopover {
|
|
40
|
+
protected override readonly hasAnimations = true;
|
|
41
|
+
|
|
42
|
+
onAnimationEnd(event: AnimationEvent) {
|
|
43
|
+
if (event.target === event.currentTarget) {
|
|
44
|
+
this.animationDone();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
37
48
|
|
|
38
49
|
export function registerPopover() {
|
|
39
50
|
return registerNgbPopover(Popover);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
-
import { provideValueAccessor } from '@ngbase/adk/utils';
|
|
3
2
|
import { SelectBase } from '@ngbase/adk/select';
|
|
4
3
|
|
|
5
4
|
@Component({
|
|
6
5
|
selector: '<%= name %>-list-selection',
|
|
7
6
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8
7
|
template: `<ng-content />`,
|
|
9
|
-
providers: [provideValueAccessor(ListSelection)],
|
|
10
8
|
})
|
|
11
9
|
export class ListSelection<T> extends SelectBase<T> {
|
|
12
10
|
constructor() {
|
|
@@ -24,7 +24,7 @@ export class Option<T> {
|
|
|
24
24
|
@Component({
|
|
25
25
|
selector: '<%= name %>-option-group, [<%= name %>OptionGroup]',
|
|
26
26
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
-
template: `<div class="sticky -top-1 z-10
|
|
27
|
+
template: `<div class="bg-popover text-muted-foreground sticky -top-1 z-10 px-2 py-1.5 text-sm">
|
|
28
28
|
{{ label() }}
|
|
29
29
|
</div>
|
|
30
30
|
<ng-content />`,
|
|
@@ -23,8 +23,8 @@ export class SelectableItem<T> {
|
|
|
23
23
|
hostDirectives: [
|
|
24
24
|
{
|
|
25
25
|
directive: NgbSelectable,
|
|
26
|
-
inputs: ['
|
|
27
|
-
outputs: ['
|
|
26
|
+
inputs: ['value'],
|
|
27
|
+
outputs: ['valueChange', 'valueChanged'],
|
|
28
28
|
},
|
|
29
29
|
],
|
|
30
30
|
template: `<ng-content />`,
|
|
@@ -4,10 +4,8 @@ import { Button } from '<%= basepath %>/button';
|
|
|
4
4
|
import { Icon } from '<%= basepath %>/icon';
|
|
5
5
|
import { provideIcons } from '@ng-icons/core';
|
|
6
6
|
import { lucideX } from '@ng-icons/lucide';
|
|
7
|
-
import { sideAnimation } from '@ngbase/adk/dialog';
|
|
8
7
|
import { NgbSheet, NgbSheetContainer, ngbSheetPortal } from '@ngbase/adk/sheet';
|
|
9
8
|
import { aliasSheet } from '@ngbase/adk/sheet';
|
|
10
|
-
import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
|
|
11
9
|
|
|
12
10
|
@Component({
|
|
13
11
|
selector: '<%= name %>-sheet',
|
|
@@ -21,13 +19,22 @@ import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
|
|
|
21
19
|
[class]="options.position === 'left' ? 'justify-start' : 'justify-end'"
|
|
22
20
|
>
|
|
23
21
|
<div
|
|
24
|
-
class="
|
|
25
|
-
|
|
22
|
+
class="{{
|
|
23
|
+
'pointer-events-auto m-2 flex flex-col overflow-hidden rounded-lg border-l bg-background shadow-2xl will-change-transform' +
|
|
24
|
+
(closing()
|
|
25
|
+
? options.position === 'left'
|
|
26
|
+
? ' sheet-content-left-leave'
|
|
27
|
+
: ' sheet-content-right-leave'
|
|
28
|
+
: options.position === 'left'
|
|
29
|
+
? ' sheet-content-left'
|
|
30
|
+
: ' sheet-content-right')
|
|
31
|
+
}}"
|
|
26
32
|
[ngStyle]="{
|
|
27
33
|
width: options.width,
|
|
28
34
|
minWidth: options.minWidth,
|
|
29
35
|
maxWidth: options.maxWidth,
|
|
30
36
|
}"
|
|
37
|
+
(animationend)="onAnimationEnd($event)"
|
|
31
38
|
>
|
|
32
39
|
@if (!isHideHeader) {
|
|
33
40
|
<div class="flex items-center border-b px-4 py-2">
|
|
@@ -38,29 +45,34 @@ import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
|
|
|
38
45
|
</div>
|
|
39
46
|
}
|
|
40
47
|
<div class="h-full overflow-auto p-4">
|
|
41
|
-
<ng-container #
|
|
48
|
+
<ng-container #contentContainer />
|
|
42
49
|
</div>
|
|
43
50
|
</div>
|
|
44
51
|
</div>
|
|
45
52
|
@if (backdropColor) {
|
|
46
53
|
<div
|
|
47
|
-
class="absolute top-0 -z-10 h-full w-full bg-black/30"
|
|
48
|
-
[@fadeAnimation]
|
|
49
54
|
(click)="close()"
|
|
55
|
+
(animationend)="onAnimationEnd($event)"
|
|
56
|
+
class="{{
|
|
57
|
+
'absolute top-0 -z-10 h-full w-full bg-black/30' +
|
|
58
|
+
(closing() ? ' dialog-backdrop-leave' : ' dialog-backdrop')
|
|
59
|
+
}}"
|
|
50
60
|
></div>
|
|
51
|
-
<!-- [class]="status() ? 'pointer-events-auto' : 'pointer-events-none'" -->
|
|
52
61
|
}
|
|
53
62
|
`,
|
|
54
63
|
host: {
|
|
55
64
|
class: 'fixed block top-0 bottom-0 left-0 right-0 z-p',
|
|
56
65
|
},
|
|
57
|
-
animations: [
|
|
58
|
-
createHostAnimation(['@fadeAnimation', '@sideAnimation']),
|
|
59
|
-
fadeAnimation('300ms'),
|
|
60
|
-
sideAnimation,
|
|
61
|
-
],
|
|
62
66
|
})
|
|
63
|
-
export class SheetContainer extends NgbSheetContainer {
|
|
67
|
+
export class SheetContainer extends NgbSheetContainer {
|
|
68
|
+
protected override readonly hasAnimations = true;
|
|
69
|
+
|
|
70
|
+
onAnimationEnd(event: AnimationEvent) {
|
|
71
|
+
if (event.target === event.currentTarget) {
|
|
72
|
+
this.animationDone();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
64
76
|
|
|
65
77
|
export function sheetPortal() {
|
|
66
78
|
return ngbSheetPortal(SheetContainer);
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
NgbSidenavOverlay,
|
|
8
8
|
SidenavType,
|
|
9
9
|
aliasSidenav,
|
|
10
|
-
slideAnimation,
|
|
11
10
|
} from '@ngbase/adk/sidenav';
|
|
12
11
|
|
|
13
12
|
export type { SidenavType };
|
|
@@ -19,9 +18,13 @@ export type { SidenavType };
|
|
|
19
18
|
imports: [NgbSidenavOverlay, NgbSidenavHeaderTrack],
|
|
20
19
|
template: `
|
|
21
20
|
@if (showOverlay()) {
|
|
22
|
-
<div
|
|
21
|
+
<div
|
|
22
|
+
ngbSidenavOverlay
|
|
23
|
+
class="z-p bg-black/70"
|
|
24
|
+
animate.enter="dialog-backdrop"
|
|
25
|
+
></div>
|
|
23
26
|
}
|
|
24
|
-
<div ngbSidenavHeaderTrack class="
|
|
27
|
+
<div ngbSidenavHeaderTrack class="sidenav-track"></div>
|
|
25
28
|
<ng-content select="<%= name %>-sidenav-header" />
|
|
26
29
|
<ng-content />
|
|
27
30
|
`,
|
|
@@ -41,8 +44,7 @@ export class Sidenav extends NgbSidenav {}
|
|
|
41
44
|
</div>
|
|
42
45
|
`,
|
|
43
46
|
host: {
|
|
44
|
-
class: 'block h-full bg-background z-p
|
|
47
|
+
class: 'block h-full bg-background z-p sidenav-header',
|
|
45
48
|
},
|
|
46
|
-
animations: [slideAnimation('500ms cubic-bezier(0.4, 0, 0.2, 1)')],
|
|
47
49
|
})
|
|
48
50
|
export class SidenavHeader extends NgbSidenavHeader {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
-
import { NgbSonner, ngbSonnerPortal,
|
|
2
|
+
import { NgbSonner, ngbSonnerPortal, SonnerBase } from '@ngbase/adk/sonner';
|
|
3
3
|
import { Icon } from '<%= basepath %>/icon';
|
|
4
4
|
import { provideIcons } from '@ng-icons/core';
|
|
5
5
|
import {
|
|
@@ -41,7 +41,6 @@ import {
|
|
|
41
41
|
}
|
|
42
42
|
</ul>
|
|
43
43
|
`,
|
|
44
|
-
animations: [sonnerAnimation],
|
|
45
44
|
})
|
|
46
45
|
export class Sonner extends NgbSonner {
|
|
47
46
|
readonly icons = {
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
NgbStepper,
|
|
8
8
|
NgbStepperStep,
|
|
9
9
|
provideStep,
|
|
10
|
-
stepperAnimation,
|
|
11
10
|
} from '@ngbase/adk/stepper';
|
|
12
11
|
|
|
13
12
|
@Component({
|
|
@@ -46,8 +45,8 @@ import {
|
|
|
46
45
|
}
|
|
47
46
|
</div>
|
|
48
47
|
@if (step.verticalTemplate(); as template) {
|
|
49
|
-
<div class="ml-12"
|
|
50
|
-
<div class="pt-4">
|
|
48
|
+
<div class="stepper-content ml-12">
|
|
49
|
+
<div class="min-h-0 pt-4">
|
|
51
50
|
<ng-container *ngTemplateOutlet="template" />
|
|
52
51
|
</div>
|
|
53
52
|
</div>
|
|
@@ -57,7 +56,6 @@ import {
|
|
|
57
56
|
</div>
|
|
58
57
|
<ng-content />
|
|
59
58
|
`,
|
|
60
|
-
animations: [stepperAnimation],
|
|
61
59
|
})
|
|
62
60
|
export class Stepper extends NgbStepper {}
|
|
63
61
|
|
|
@@ -11,13 +11,13 @@ import { NgbSwitch, NgbSwitchLabel, NgbSwitchThumb, NgbSwitchTrack } from '@ngba
|
|
|
11
11
|
template: `
|
|
12
12
|
<button
|
|
13
13
|
ngbSwitchTrack
|
|
14
|
-
class="relative w-9 rounded-full border-2 border-transparent
|
|
14
|
+
class="bg-muted aria-[checked=true]:bg-primary relative w-9 rounded-full border-2 border-transparent transition-colors"
|
|
15
15
|
>
|
|
16
16
|
<span
|
|
17
17
|
#thumb="ngbSwitchThumb"
|
|
18
18
|
ngbSwitchThumb
|
|
19
19
|
[class]="thumb.checked() ? (thumb.rtl() ? '-translate-x-full' : 'translate-x-full') : ''"
|
|
20
|
-
class="block h-4 w-4 rounded-full
|
|
20
|
+
class="bg-background block h-4 w-4 rounded-full shadow-sm transition-transform"
|
|
21
21
|
></span>
|
|
22
22
|
</button>
|
|
23
23
|
<label ngbSwitchLabel><ng-content /></label>
|
|
@@ -24,9 +24,10 @@ import {
|
|
|
24
24
|
NgbSort,
|
|
25
25
|
NgbSortHeader,
|
|
26
26
|
NgbTable,
|
|
27
|
+
NgbTableVirtualScroll,
|
|
27
28
|
} from '@ngbase/adk/table';
|
|
28
29
|
import { Select, Option, SelectTrigger } from '<%= basepath %>/select';
|
|
29
|
-
import {
|
|
30
|
+
import { MeeFormField, InputSuffix } from '<%= basepath %>/form-field';
|
|
30
31
|
import { Icon } from '<%= basepath %>/icon';
|
|
31
32
|
import { provideIcons } from '@ng-icons/core';
|
|
32
33
|
import {
|
|
@@ -179,7 +180,16 @@ export class Sort extends NgbSort<any> {
|
|
|
179
180
|
provideIcons({ lucideChevronsUpDown, lucideArrowDown, lucideArrowUp, lucideArrowUpDown }),
|
|
180
181
|
],
|
|
181
182
|
providers: [aliasSortHeader(SortHeader)],
|
|
182
|
-
imports: [
|
|
183
|
+
imports: [
|
|
184
|
+
Select,
|
|
185
|
+
Option,
|
|
186
|
+
SelectTrigger,
|
|
187
|
+
MeeFormField,
|
|
188
|
+
InputSuffix,
|
|
189
|
+
Icon,
|
|
190
|
+
Button,
|
|
191
|
+
NgTemplateOutlet,
|
|
192
|
+
],
|
|
183
193
|
template: `
|
|
184
194
|
<ng-template #temp><ng-content /></ng-template>
|
|
185
195
|
@if (sort.mode() === 'selection') {
|
|
@@ -189,7 +199,7 @@ export class Sort extends NgbSort<any> {
|
|
|
189
199
|
<<%= name %>-option value="asc" (click)="setDirections('asc')">Asc</<%= name %>-option>
|
|
190
200
|
<<%= name %>-option value="desc" (click)="setDirections('desc')">Desc</<%= name %>-option>
|
|
191
201
|
</<%= name %>-select>
|
|
192
|
-
<<%= name %>-icon <%= name %>Suffix [name]="directionIcon()" class="!ml-0.5
|
|
202
|
+
<<%= name %>-icon <%= name %>Suffix [name]="directionIcon()" class="text-muted-foreground !ml-0.5" />
|
|
193
203
|
</<%= name %>-form-field>
|
|
194
204
|
} @else {
|
|
195
205
|
<button <%= name %>Button="ghost" class="h-8 gap-0.5 !px-2" (click)="toggle()">
|
|
@@ -213,3 +223,33 @@ export class SortHeader extends NgbSortHeader<Sort> {
|
|
|
213
223
|
: 'lucideArrowUpDown';
|
|
214
224
|
});
|
|
215
225
|
}
|
|
226
|
+
|
|
227
|
+
// Virtual Scroll
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Virtual scroll directive for tables that only renders visible rows.
|
|
231
|
+
* Dramatically improves performance for large datasets.
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```html
|
|
235
|
+
* <div class="h-[600px] overflow-auto">
|
|
236
|
+
* <table
|
|
237
|
+
* <%= name %>Table
|
|
238
|
+
* [data]="largeDataset"
|
|
239
|
+
* <%= name %>VirtualScroll="50">
|
|
240
|
+
* <!-- table definition -->
|
|
241
|
+
* </table>
|
|
242
|
+
* </div>
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
@Directive({
|
|
246
|
+
selector: 'table[<%= name %>Table][<%= name %>VirtualScroll]',
|
|
247
|
+
standalone: true,
|
|
248
|
+
hostDirectives: [
|
|
249
|
+
{
|
|
250
|
+
directive: NgbTableVirtualScroll,
|
|
251
|
+
inputs: ['ngbVirtualScroll: <%= name %>VirtualScroll', 'bufferSize', 'scrollContainer'],
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
})
|
|
255
|
+
export class VirtualScroll {}
|