@ngbase/adk 0.1.1 → 0.1.2
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/accordion/accordion-item.d.ts +4 -0
- package/accordion/public-api.d.ts +1 -1
- package/autocomplete/autocomplete.d.ts +2 -2
- package/avatar/avatar.d.ts +1 -1
- package/breadcrumb/breadcrumb.d.ts +2 -3
- package/breadcrumb/public-api.d.ts +1 -1
- package/carousel/carousel.d.ts +1 -1
- package/chip/chip.d.ts +2 -2
- package/datepicker/calendar.d.ts +3 -3
- package/datepicker/datepicker.d.ts +2 -2
- package/datepicker/time.d.ts +2 -2
- package/dialog/dialog.d.ts +1 -1
- package/fesm2022/ngbase-adk-accordion.mjs +4 -1
- package/fesm2022/ngbase-adk-accordion.mjs.map +1 -1
- package/fesm2022/ngbase-adk-autocomplete.mjs +7 -36
- package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -1
- package/fesm2022/ngbase-adk-avatar.mjs +2 -2
- package/fesm2022/ngbase-adk-avatar.mjs.map +1 -1
- package/fesm2022/ngbase-adk-breadcrumb.mjs +2 -2
- package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngbase-adk-carousel.mjs +2 -2
- package/fesm2022/ngbase-adk-carousel.mjs.map +1 -1
- package/fesm2022/ngbase-adk-chip.mjs +4 -2
- package/fesm2022/ngbase-adk-chip.mjs.map +1 -1
- package/fesm2022/ngbase-adk-datepicker.mjs +114 -328
- package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -1
- package/fesm2022/ngbase-adk-dialog.mjs +12 -13
- package/fesm2022/ngbase-adk-dialog.mjs.map +1 -1
- package/fesm2022/ngbase-adk-form-field.mjs +2 -156
- package/fesm2022/ngbase-adk-form-field.mjs.map +1 -1
- package/fesm2022/ngbase-adk-menu.mjs +15 -30
- package/fesm2022/ngbase-adk-menu.mjs.map +1 -1
- package/fesm2022/ngbase-adk-otp.mjs +164 -0
- package/fesm2022/ngbase-adk-otp.mjs.map +1 -0
- package/fesm2022/ngbase-adk-pagination.mjs +8 -65
- package/fesm2022/ngbase-adk-pagination.mjs.map +1 -1
- package/fesm2022/ngbase-adk-popover.mjs +423 -548
- package/fesm2022/ngbase-adk-popover.mjs.map +1 -1
- package/fesm2022/ngbase-adk-portal.mjs +0 -1
- package/fesm2022/ngbase-adk-portal.mjs.map +1 -1
- package/fesm2022/ngbase-adk-radio.mjs +2 -16
- package/fesm2022/ngbase-adk-radio.mjs.map +1 -1
- package/fesm2022/ngbase-adk-resizable.mjs +10 -43
- package/fesm2022/ngbase-adk-resizable.mjs.map +1 -1
- package/fesm2022/ngbase-adk-select.mjs +67 -173
- package/fesm2022/ngbase-adk-select.mjs.map +1 -1
- package/fesm2022/ngbase-adk-sheet.mjs +95 -0
- package/fesm2022/ngbase-adk-sheet.mjs.map +1 -0
- package/fesm2022/ngbase-adk-sidenav.mjs +2 -2
- package/fesm2022/ngbase-adk-sidenav.mjs.map +1 -1
- package/fesm2022/ngbase-adk-slider.mjs +9 -23
- package/fesm2022/ngbase-adk-slider.mjs.map +1 -1
- package/fesm2022/ngbase-adk-sonner.mjs +13 -63
- package/fesm2022/ngbase-adk-sonner.mjs.map +1 -1
- package/fesm2022/ngbase-adk-stepper.mjs +16 -114
- package/fesm2022/ngbase-adk-stepper.mjs.map +1 -1
- package/fesm2022/ngbase-adk-switch.mjs +2 -2
- package/fesm2022/ngbase-adk-switch.mjs.map +1 -1
- package/fesm2022/ngbase-adk-table.mjs +10 -30
- package/fesm2022/ngbase-adk-table.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tabs.mjs +14 -94
- package/fesm2022/ngbase-adk-tabs.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tooltip.mjs +49 -39
- package/fesm2022/ngbase-adk-tooltip.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tour.mjs +1 -1
- package/fesm2022/ngbase-adk-tour.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tree.mjs +11 -43
- package/fesm2022/ngbase-adk-tree.mjs.map +1 -1
- package/form-field/public-api.d.ts +0 -1
- package/menu/menu-trigger.d.ts +2 -2
- package/menu/menu.d.ts +6 -6
- package/otp/index.d.ts +5 -0
- package/{form-field → otp}/otp.d.ts +1 -1
- package/otp/public-api.d.ts +1 -0
- package/package.json +25 -17
- package/pagination/pagination.d.ts +5 -1
- package/popover/popover-arrow.ng.d.ts +34 -0
- package/popover/popover.d.ts +12 -3
- package/popover/popover.service.d.ts +5 -4
- package/popover/public-api.d.ts +1 -0
- package/popover/utils.d.ts +32 -48
- package/portal/dialog-ref.d.ts +0 -1
- package/resizable/resizable-group.d.ts +2 -2
- package/resizable/resizable.d.ts +2 -2
- package/schematics/components/files/accordion/accordion.ts.template +6 -8
- package/schematics/components/files/autocomplete/autocomplete.ts.template +2 -6
- package/schematics/components/files/avatar/avatar.ts.template +2 -2
- package/schematics/components/files/breadcrumb/breadcrumb.ts.template +5 -5
- package/schematics/components/files/carousel/carousel.ts.template +2 -2
- package/schematics/components/files/chip/chip.ts.template +2 -2
- package/schematics/components/files/datepicker/calendar.ts.template +6 -6
- package/schematics/components/files/datepicker/datepicker.ts.template +33 -3
- package/schematics/components/files/datepicker/index.ts.template +0 -1
- package/schematics/components/files/datepicker/time.ts.template +12 -4
- package/schematics/components/files/dialog/dialog.ts.template +8 -8
- package/schematics/components/files/form-field/{input.ts.template → form-field.ts.template} +13 -2
- package/schematics/components/files/form-field/index.ts.template +1 -2
- package/schematics/components/files/form-field/input-style.directive.ts.template +1 -1
- package/schematics/components/files/menu/menu.ts.template +3 -3
- package/schematics/components/files/otp/index.ts.template +5 -0
- package/schematics/components/files/{form-field → otp}/otp.ts.template +3 -3
- package/schematics/components/files/pagination/pagination.ts.template +2 -2
- package/schematics/components/files/popover/popover.ts.template +7 -30
- package/schematics/components/files/radio/radio.ts.template +3 -8
- package/schematics/components/files/resizable/resizable.ts.template +7 -7
- package/schematics/components/files/select/option.ts.template +1 -0
- package/schematics/components/files/select/select.ts.template +8 -8
- package/schematics/components/files/sheet/sheet.ts.template +11 -76
- package/schematics/components/files/sidenav/sidenav.ts.template +3 -3
- package/schematics/components/files/slider/slider.ts.template +3 -10
- package/schematics/components/files/sonner/sonner.ts.template +3 -2
- package/schematics/components/files/stepper/stepper.ts.template +4 -4
- package/schematics/components/files/switch/switch.ts.template +1 -1
- package/schematics/components/files/tabs/tab.ts.template +11 -8
- package/schematics/components/files/theme/theme.service.ts.template +0 -11
- package/schematics/components/files/tooltip/tooltip.ts.template +8 -3
- package/schematics/components/files/tour/index.ts.template +0 -2
- package/schematics/components/files/tour/tour.ts.template +13 -2
- package/schematics/components/files/tree/tree.ts.template +3 -3
- package/schematics/components/schema.json +8 -0
- package/select/option-group.d.ts +3 -3
- package/select/select.d.ts +2 -2
- package/sheet/index.d.ts +5 -0
- package/sheet/public-api.d.ts +2 -0
- package/sheet/sheet.d.ts +26 -0
- package/sheet/sheet.service.d.ts +13 -0
- package/sidenav/public-api.d.ts +1 -1
- package/sidenav/sidenav.d.ts +1 -1
- package/slider/public-api.d.ts +1 -1
- package/slider/slider.d.ts +5 -5
- package/sonner/sonner.d.ts +2 -1
- package/stepper/animation.d.ts +1 -1
- package/stepper/step.d.ts +1 -1
- package/stepper/stepper.d.ts +2 -2
- package/switch/switch.d.ts +1 -1
- package/table/body-row.d.ts +3 -3
- package/table/head-row.d.ts +3 -3
- package/table/table.d.ts +1 -1
- package/tabs/tab-group.d.ts +4 -4
- package/tabs/tab.d.ts +2 -2
- package/tooltip/public-api.d.ts +1 -1
- package/tooltip/tooltip.d.ts +5 -1
- package/tooltip/tooltip.directive.d.ts +1 -1
- package/tooltip/tooltip.service.d.ts +4 -2
- package/tour/tour.service.d.ts +3 -4
- package/tree/public-api.d.ts +2 -2
- package/tree/tree-node.d.ts +2 -2
- package/tree/tree.d.ts +2 -2
- package/schematics/components/files/datepicker/datepicker-trigger.ts.template +0 -27
- package/schematics/components/files/theme/theme.component.ts.template +0 -165
- package/schematics/components/files/tour/tour-step.ts.template +0 -8
- package/schematics/components/files/tour/tour.service.ts.template +0 -7
package/popover/utils.d.ts
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
export interface PopoverUtilConfig {
|
|
2
|
+
offset?: number;
|
|
3
|
+
sideOffset?: number;
|
|
4
|
+
smoothScroll?: boolean;
|
|
5
|
+
position?: Position | OverlayPosition;
|
|
6
|
+
client?: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
w: number;
|
|
10
|
+
h: number;
|
|
11
|
+
} | null;
|
|
12
|
+
target: HTMLElement;
|
|
13
|
+
el?: HTMLElement;
|
|
14
|
+
}
|
|
2
15
|
export interface Rect {
|
|
3
16
|
top: number;
|
|
4
17
|
left: number;
|
|
5
18
|
width: number;
|
|
6
19
|
height: number;
|
|
7
20
|
}
|
|
21
|
+
export type OverlayPosition = 'top' | 'bottom' | 'left' | 'right' | 'rs' | 're' | 'ls' | 'le' | 'tl' | 'tr' | 'bl' | 'br';
|
|
8
22
|
export declare enum Position {
|
|
9
23
|
Top = "top",
|
|
10
24
|
Bottom = "bottom",
|
|
@@ -13,44 +27,15 @@ export declare enum Position {
|
|
|
13
27
|
TopLeft = "tl",
|
|
14
28
|
TopRight = "tr",
|
|
15
29
|
BottomLeft = "bl",
|
|
16
|
-
BottomRight = "br"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
elWidth: number;
|
|
24
|
-
elHeight: number;
|
|
25
|
-
offset: number;
|
|
26
|
-
priority: PopoverPosition;
|
|
27
|
-
position: PopoverPosition;
|
|
28
|
-
windowWidth: number;
|
|
29
|
-
windowHeight: number;
|
|
30
|
-
scrollWidth: number;
|
|
31
|
-
}
|
|
32
|
-
export interface OverflowData {
|
|
33
|
-
top: boolean;
|
|
34
|
-
bottom: boolean;
|
|
35
|
-
left: boolean;
|
|
36
|
-
right: boolean;
|
|
37
|
-
leftSide: boolean;
|
|
38
|
-
rightSide: boolean;
|
|
39
|
-
any: boolean;
|
|
40
|
-
preferredHorizontal: 'left' | 'right' | undefined;
|
|
41
|
-
preferredVertical: 'top' | 'bottom' | undefined;
|
|
42
|
-
overflowAmount: {
|
|
43
|
-
top: number;
|
|
44
|
-
bottom: number;
|
|
45
|
-
left: number;
|
|
46
|
-
right: number;
|
|
47
|
-
leftSide: number;
|
|
48
|
-
rightSide: number;
|
|
49
|
-
};
|
|
30
|
+
BottomRight = "br",
|
|
31
|
+
RightStart = "rs",
|
|
32
|
+
RightEnd = "re",
|
|
33
|
+
LeftStart = "ls",
|
|
34
|
+
LeftEnd = "le"
|
|
50
35
|
}
|
|
51
36
|
export interface PositionResult {
|
|
52
|
-
top
|
|
53
|
-
left
|
|
37
|
+
top?: number;
|
|
38
|
+
left?: number;
|
|
54
39
|
bottom?: number;
|
|
55
40
|
right?: number;
|
|
56
41
|
position: Position;
|
|
@@ -61,25 +46,24 @@ export declare class PopoverPositioner {
|
|
|
61
46
|
private config;
|
|
62
47
|
private windowDimensions;
|
|
63
48
|
private scrollWidth;
|
|
64
|
-
private overflow;
|
|
65
|
-
private elRect;
|
|
66
49
|
private offset;
|
|
67
|
-
|
|
50
|
+
private sideOffset;
|
|
51
|
+
private elementRect;
|
|
52
|
+
constructor(config: PopoverUtilConfig, windowDimensions: {
|
|
68
53
|
width: number;
|
|
69
54
|
height: number;
|
|
70
|
-
}, scrollWidth
|
|
55
|
+
}, scrollWidth?: number);
|
|
71
56
|
calculatePosition(): PositionResult;
|
|
72
57
|
private getTargetRect;
|
|
73
58
|
private getElementRect;
|
|
74
|
-
private
|
|
75
|
-
private
|
|
76
|
-
private
|
|
77
|
-
private
|
|
78
|
-
|
|
59
|
+
private findBestPosition;
|
|
60
|
+
private getAvailableSpace;
|
|
61
|
+
private positionOverflows;
|
|
62
|
+
private getOverflowAmount;
|
|
63
|
+
private getPositionWithLeastOverflow;
|
|
79
64
|
private finalizePosition;
|
|
80
|
-
private getOverallOffset;
|
|
81
65
|
}
|
|
82
|
-
export declare function tooltipPosition(config:
|
|
66
|
+
export declare function tooltipPosition(config: PopoverUtilConfig, windowDimensions?: {
|
|
83
67
|
width: number;
|
|
84
68
|
height: number;
|
|
85
69
|
}, scrollWidth?: number): PositionResult;
|
package/portal/dialog-ref.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export declare class NgbResizableGroup {
|
|
|
14
14
|
start(): void;
|
|
15
15
|
end(): void;
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgbResizableGroup, never>;
|
|
17
|
-
static
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgbResizableGroup, "[ngbResizableGroup]", ["ngbResizableGroup"], { "direction": { "alias": "direction"; "required": false; "isSignal": true; }; }, {}, ["panels"], never, true, never>;
|
|
18
18
|
}
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function aliasResizableGroup(resizableGroup: typeof NgbResizableGroup): {
|
|
20
20
|
provide: typeof NgbResizableGroup;
|
|
21
21
|
useExisting: typeof NgbResizableGroup;
|
|
22
22
|
};
|
package/resizable/resizable.d.ts
CHANGED
|
@@ -42,9 +42,9 @@ export declare class NgbResizable {
|
|
|
42
42
|
private updateFlex;
|
|
43
43
|
updateElementSize(str: string): void;
|
|
44
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgbResizable, never>;
|
|
45
|
-
static
|
|
45
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgbResizable, "[ngbResizable]", ["ngbResizable"], { "size": { "alias": "size"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
46
46
|
}
|
|
47
|
-
export declare function
|
|
47
|
+
export declare function aliasResizable(resizable: typeof NgbResizable): {
|
|
48
48
|
provide: typeof NgbResizable;
|
|
49
49
|
useExisting: typeof NgbResizable;
|
|
50
50
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Directive
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
|
|
2
2
|
import {
|
|
3
|
+
aliasAccordion,
|
|
3
4
|
NgbAccordion,
|
|
4
5
|
NgbAccordionContent,
|
|
5
6
|
NgbAccordionGroup,
|
|
@@ -20,14 +21,13 @@ export class AccordionGroup {}
|
|
|
20
21
|
|
|
21
22
|
@Component({
|
|
22
23
|
selector: '<%= name %>-accordion',
|
|
24
|
+
exportAs: '<%= name %>Accordion',
|
|
23
25
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
-
|
|
25
|
-
{ directive: NgbAccordion, inputs: ['expanded', 'disabled'], outputs: ['expandedChange'] },
|
|
26
|
-
],
|
|
26
|
+
providers: [aliasAccordion(Accordion)],
|
|
27
27
|
imports: [NgbAccordionContent],
|
|
28
28
|
template: `
|
|
29
29
|
<ng-content select="[<%= name %>AccordionHeader]" />
|
|
30
|
-
@if (
|
|
30
|
+
@if (expanded()) {
|
|
31
31
|
<div ngbAccordionContent [@slide] class="overflow-hidden">
|
|
32
32
|
<div class="px-3 pb-4 text-muted">
|
|
33
33
|
<ng-content />
|
|
@@ -40,9 +40,7 @@ export class AccordionGroup {}
|
|
|
40
40
|
},
|
|
41
41
|
animations: [slideAnimation],
|
|
42
42
|
})
|
|
43
|
-
export class Accordion {
|
|
44
|
-
readonly accordion = inject(NgbAccordion);
|
|
45
|
-
}
|
|
43
|
+
export class Accordion extends NgbAccordion {}
|
|
46
44
|
|
|
47
45
|
@Directive({
|
|
48
46
|
selector: '[<%= name %>AccordionHeader]',
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
NgbAutocomplete,
|
|
4
|
-
NgbAutocompleteInput,
|
|
5
|
-
provideAutocomplete,
|
|
6
|
-
} from '@ngbase/adk/autocomplete';
|
|
2
|
+
import { NgbAutocomplete, NgbAutocompleteInput, aliasAutocomplete } from '@ngbase/adk/autocomplete';
|
|
7
3
|
import { NgbSelectOptionGroup } from '@ngbase/adk/select';
|
|
8
4
|
|
|
9
5
|
@Component({
|
|
10
6
|
selector: '<%= name %>-autocomplete',
|
|
11
7
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
-
providers: [
|
|
8
|
+
providers: [aliasAutocomplete(Autocomplete)],
|
|
13
9
|
imports: [NgbSelectOptionGroup],
|
|
14
10
|
template: `
|
|
15
11
|
<ul #container class="readonly !flex w-full flex-wrap gap-2" (click)="prevent($event)">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
-
import { NgbAvatar, NgbAvatarGroup,
|
|
2
|
+
import { NgbAvatar, NgbAvatarGroup, aliasAvatar } from '@ngbase/adk/avatar';
|
|
3
3
|
|
|
4
4
|
@Component({
|
|
5
5
|
selector: '<%= name %>-avatar-group',
|
|
@@ -15,7 +15,7 @@ export class AvatarGroup {}
|
|
|
15
15
|
@Component({
|
|
16
16
|
selector: '<%= name %>-avatar, [<%= name %>Avatar]',
|
|
17
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
-
providers: [
|
|
18
|
+
providers: [aliasAvatar(Avatar)],
|
|
19
19
|
template: `
|
|
20
20
|
@if (src(); as img) {
|
|
21
21
|
<img [src]="img" alt="avatar" class="h-full max-h-full max-w-full" />
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
|
|
2
|
+
import { Icon } from '<%= basepath %>/icon';
|
|
3
|
+
import { provideIcons } from '@ng-icons/core';
|
|
4
|
+
import { lucideChevronRight } from '@ng-icons/lucide';
|
|
2
5
|
import {
|
|
6
|
+
aliasBreadcrumb,
|
|
3
7
|
NgbBreadcrumb,
|
|
4
8
|
NgbBreadcrumbLink,
|
|
5
9
|
NgbBreadcrumbs,
|
|
6
10
|
NgbBreadcrumbSeparator,
|
|
7
11
|
NgbBreadcrumbSeparatorAria,
|
|
8
|
-
provideBreadcrumb,
|
|
9
12
|
} from '@ngbase/adk/breadcrumb';
|
|
10
|
-
import { Icon } from '<%= basepath %>/icon';
|
|
11
|
-
import { provideIcons } from '@ng-icons/core';
|
|
12
|
-
import { lucideChevronRight } from '@ng-icons/lucide';
|
|
13
13
|
|
|
14
14
|
@Component({
|
|
15
15
|
selector: '<%= name %>-breadcrumbs',
|
|
@@ -25,7 +25,7 @@ export class Breadcrumbs {}
|
|
|
25
25
|
@Component({
|
|
26
26
|
selector: '<%= name %>-breadcrumb',
|
|
27
27
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
|
-
providers: [
|
|
28
|
+
providers: [aliasBreadcrumb(Breadcrumb)],
|
|
29
29
|
viewProviders: [provideIcons({ lucideChevronRight })],
|
|
30
30
|
imports: [Icon, NgbBreadcrumbLink, NgbBreadcrumbSeparatorAria],
|
|
31
31
|
template: `
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
NgbCarouselContainer,
|
|
6
6
|
NgbCarouselItem,
|
|
7
7
|
NgbCarouselSubContainer,
|
|
8
|
-
|
|
8
|
+
aliasCarousel,
|
|
9
9
|
} from '@ngbase/adk/carousel';
|
|
10
10
|
|
|
11
11
|
@Component({
|
|
12
12
|
selector: '<%= name %>-carousel',
|
|
13
13
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
-
providers: [
|
|
14
|
+
providers: [aliasCarousel(Carousel)],
|
|
15
15
|
imports: [NgbCarouselContainer, NgbCarouselSubContainer],
|
|
16
16
|
template: `
|
|
17
17
|
<div class="touch-none overflow-hidden" ngbCarouselContainer>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
-
import { NgbChip, NgbChipGroup, NgbChipRemove,
|
|
2
|
+
import { NgbChip, NgbChipGroup, NgbChipRemove, aliasChip } from '@ngbase/adk/chip';
|
|
3
3
|
import { Button } from '<%= basepath %>/button';
|
|
4
4
|
import { Icon } from '<%= basepath %>/icon';
|
|
5
5
|
import { provideIcons } from '@ng-icons/core';
|
|
@@ -15,7 +15,7 @@ export class ChipGroup<T> {}
|
|
|
15
15
|
@Component({
|
|
16
16
|
selector: '<%= name %>-chip, [<%= name %>Chip]',
|
|
17
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
-
providers: [
|
|
18
|
+
providers: [aliasChip(Chip)],
|
|
19
19
|
viewProviders: [provideIcons({ lucideX })],
|
|
20
20
|
imports: [Button, Icon, NgbChipRemove],
|
|
21
21
|
template: `<ng-content />
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { NgClass } from '@angular/common';
|
|
2
2
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { Button } from '<%= basepath %>/button';
|
|
4
|
+
import { Icon } from '<%= basepath %>/icon';
|
|
5
|
+
import { provideIcons } from '@ng-icons/core';
|
|
6
|
+
import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
|
|
3
7
|
import {
|
|
4
8
|
CalendarBtn,
|
|
5
9
|
CalendarDayBtn,
|
|
@@ -7,18 +11,14 @@ import {
|
|
|
7
11
|
CalendarTitle,
|
|
8
12
|
CalendarYearBtn,
|
|
9
13
|
NgbCalendar,
|
|
10
|
-
|
|
14
|
+
aliasCalendar,
|
|
11
15
|
} from '@ngbase/adk/datepicker';
|
|
12
|
-
import { Button } from '<%= basepath %>/button';
|
|
13
|
-
import { Icon } from '<%= basepath %>/icon';
|
|
14
|
-
import { provideIcons } from '@ng-icons/core';
|
|
15
|
-
import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
|
|
16
16
|
import { TimePicker } from './time';
|
|
17
17
|
|
|
18
18
|
@Component({
|
|
19
19
|
selector: '<%= name %>-calendar',
|
|
20
20
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
-
providers: [
|
|
21
|
+
providers: [aliasCalendar(Calendar)],
|
|
22
22
|
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
23
23
|
imports: [
|
|
24
24
|
NgClass,
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
-
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
|
|
3
|
+
import {
|
|
4
|
+
DatepickerGroup,
|
|
5
|
+
NgbDatePicker,
|
|
6
|
+
NgbDatepickerTrigger,
|
|
7
|
+
aliasDatePicker,
|
|
8
|
+
registerDatePicker,
|
|
9
|
+
} from '@ngbase/adk/datepicker';
|
|
4
10
|
import { RangePipe } from '@ngbase/adk/utils';
|
|
5
11
|
import { Calendar } from './calendar';
|
|
6
12
|
|
|
7
13
|
@Component({
|
|
8
14
|
selector: '<%= name %>-date-picker',
|
|
9
15
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
providers: [
|
|
16
|
+
providers: [aliasDatePicker(DatePicker)],
|
|
11
17
|
imports: [Calendar, RangePipe, NgTemplateOutlet, DatepickerGroup],
|
|
12
18
|
template: `
|
|
13
19
|
<div class="flex" ngbDatepickerGroup>
|
|
@@ -26,3 +32,27 @@ import { Calendar } from './calendar';
|
|
|
26
32
|
},
|
|
27
33
|
})
|
|
28
34
|
export class DatePicker<D> extends NgbDatePicker<D> {}
|
|
35
|
+
|
|
36
|
+
@Directive({
|
|
37
|
+
selector: '[<%= name %>DatepickerTrigger]',
|
|
38
|
+
providers: [registerDatePicker(DatePicker)],
|
|
39
|
+
hostDirectives: [
|
|
40
|
+
{
|
|
41
|
+
directive: NgbDatepickerTrigger,
|
|
42
|
+
inputs: [
|
|
43
|
+
'noOfCalendars',
|
|
44
|
+
'range',
|
|
45
|
+
'time',
|
|
46
|
+
'format',
|
|
47
|
+
'fieldFormat',
|
|
48
|
+
'dateFilter',
|
|
49
|
+
'pickerType',
|
|
50
|
+
'pickerTemplate',
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
host: {
|
|
55
|
+
class: 'cursor-pointer hover:bg-muted-background outline-none',
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
export class DatepickerTrigger<D> {}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
-
import { NgbTimeInput, NgbTimePicker,
|
|
2
|
+
import { NgbTimeInput, NgbTimePicker, aliasTimePicker } from '@ngbase/adk/datepicker';
|
|
3
3
|
import { Button } from '<%= basepath %>/button';
|
|
4
4
|
|
|
5
5
|
@Component({
|
|
6
6
|
selector: '<%= name %>-time',
|
|
7
7
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8
|
-
providers: [
|
|
8
|
+
providers: [aliasTimePicker(TimePicker)],
|
|
9
9
|
imports: [Button, NgbTimeInput],
|
|
10
10
|
template: `
|
|
11
11
|
<input
|
|
@@ -30,10 +30,18 @@ import { Button } from '<%= basepath %>/button';
|
|
|
30
30
|
/>
|
|
31
31
|
@if (!is24()) {
|
|
32
32
|
<div class="ml-1 flex gap-2">
|
|
33
|
-
<button
|
|
33
|
+
<button
|
|
34
|
+
[<%= name %>Button]="am() ? 'primary' : 'ghost'"
|
|
35
|
+
class="small !px-1 !py-0"
|
|
36
|
+
(click)="changeAm(true)"
|
|
37
|
+
>
|
|
34
38
|
AM
|
|
35
39
|
</button>
|
|
36
|
-
<button
|
|
40
|
+
<button
|
|
41
|
+
[<%= name %>Button]="!am() ? 'primary' : 'ghost'"
|
|
42
|
+
class="small !px-1 !py-0"
|
|
43
|
+
(click)="changeAm(false)"
|
|
44
|
+
>
|
|
37
45
|
PM
|
|
38
46
|
</button>
|
|
39
47
|
</div>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
|
|
2
|
+
import { Button } from '<%= basepath %>/button';
|
|
3
|
+
import { Icon } from '<%= basepath %>/icon';
|
|
4
|
+
import { provideIcons } from '@ng-icons/core';
|
|
5
|
+
import { lucideX } from '@ng-icons/lucide';
|
|
2
6
|
import {
|
|
7
|
+
aliasDialog,
|
|
8
|
+
NgbDialog,
|
|
3
9
|
NgbDialogBackdrop,
|
|
10
|
+
NgbDialogClose,
|
|
4
11
|
NgbDialogContainer,
|
|
5
12
|
NgbDialogMain,
|
|
6
13
|
ngbDialogPortal,
|
|
7
|
-
provideDialog,
|
|
8
|
-
NgbDialog,
|
|
9
|
-
NgbDialogClose,
|
|
10
14
|
} from '@ngbase/adk/dialog';
|
|
11
15
|
import { DragMove } from '@ngbase/adk/drag';
|
|
12
|
-
import { Button } from '<%= basepath %>/button';
|
|
13
|
-
import { Icon } from '<%= basepath %>/icon';
|
|
14
|
-
import { provideIcons } from '@ng-icons/core';
|
|
15
|
-
import { lucideX } from '@ng-icons/lucide';
|
|
16
16
|
|
|
17
17
|
@Component({
|
|
18
18
|
selector: '<%= name %>-dialog',
|
|
19
19
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
-
providers: [
|
|
20
|
+
providers: [aliasDialog(DialogContainer)],
|
|
21
21
|
viewProviders: [provideIcons({ lucideX })],
|
|
22
22
|
imports: [Button, Icon, DragMove, NgbDialogMain, NgbDialogBackdrop],
|
|
23
23
|
template: `
|
|
@@ -25,7 +25,7 @@ import { NgbSelectTarget } from '@ngbase/adk/select';
|
|
|
25
25
|
template: `
|
|
26
26
|
<ng-content select="[<%= name %>Label]" />
|
|
27
27
|
<ng-content select="[<%= name %>Description]" />
|
|
28
|
-
<div class="flex items-center" #target <%= name %>InputStyle>
|
|
28
|
+
<div class="mt-1 flex items-center" #target <%= name %>InputStyle>
|
|
29
29
|
<ng-content select="[<%= name %>InputPrefix]" />
|
|
30
30
|
<ng-content />
|
|
31
31
|
<ng-content select="[<%= name %>InputSuffix]" />
|
|
@@ -33,7 +33,7 @@ import { NgbSelectTarget } from '@ngbase/adk/select';
|
|
|
33
33
|
<ng-content select="[<%= name %>Error]" />
|
|
34
34
|
`,
|
|
35
35
|
host: {
|
|
36
|
-
class: 'inline-flex flex-col font-medium
|
|
36
|
+
class: 'inline-flex flex-col font-medium gap-1',
|
|
37
37
|
},
|
|
38
38
|
})
|
|
39
39
|
export class FormField {
|
|
@@ -77,9 +77,20 @@ export class Description {}
|
|
|
77
77
|
|
|
78
78
|
@Directive({
|
|
79
79
|
selector: '[<%= name %>InputPrefix]',
|
|
80
|
+
host: {
|
|
81
|
+
class: 'mr-2.5',
|
|
82
|
+
},
|
|
80
83
|
})
|
|
81
84
|
export class InputPrefix {}
|
|
82
85
|
|
|
86
|
+
@Directive({
|
|
87
|
+
selector: '[<%= name %>InputSuffix]',
|
|
88
|
+
host: {
|
|
89
|
+
class: 'ml-2.5',
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
export class InputSuffix {}
|
|
93
|
+
|
|
83
94
|
@Component({
|
|
84
95
|
selector: '[<%= name %>Error]',
|
|
85
96
|
hostDirectives: [{ directive: NgbInputError, inputs: ['ngbError: <%= name %>Error'] }],
|
|
@@ -5,7 +5,7 @@ import { ɵFocusStyle as FocusStyle } from '<%= basepath %>/checkbox';
|
|
|
5
5
|
selector: '[<%= name %>InputStyle]',
|
|
6
6
|
hostDirectives: [{ directive: FocusStyle, inputs: ['unfocus'] }],
|
|
7
7
|
host: {
|
|
8
|
-
class: 'inline-block rounded-lg bg-foreground px-
|
|
8
|
+
class: 'inline-block rounded-lg bg-foreground px-2.5 py-2 border font-normal min-h-10',
|
|
9
9
|
},
|
|
10
10
|
})
|
|
11
11
|
export class InputStyle {}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
|
|
2
2
|
import { AccessibleGroup } from '@ngbase/adk/a11y';
|
|
3
|
-
import { NgbMenu, NgbMenuTrigger,
|
|
3
|
+
import { NgbMenu, NgbMenuTrigger, NgpMenuGroup, aliasMenu } from '@ngbase/adk/menu';
|
|
4
4
|
|
|
5
5
|
@Component({
|
|
6
6
|
selector: '<%= name %>-menu',
|
|
7
7
|
exportAs: '<%= name %>Menu',
|
|
8
8
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
-
providers: [
|
|
10
|
-
imports: [AccessibleGroup,
|
|
9
|
+
providers: [aliasMenu(Menu)],
|
|
10
|
+
imports: [AccessibleGroup, NgpMenuGroup],
|
|
11
11
|
template: `
|
|
12
12
|
<ng-template #container>
|
|
13
13
|
<div ngbMenuGroup class="flex flex-col p-1">
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
2
|
import { injectDirectionality } from '@ngbase/adk/bidi';
|
|
3
|
-
import { NgbInputOtp, NgbOtpInput, NgbOtpValue,
|
|
3
|
+
import { NgbInputOtp, NgbOtpInput, NgbOtpValue, aliasInputOtp } from '@ngbase/adk/otp';
|
|
4
4
|
import { NumberOnly, RangePipe } from '@ngbase/adk/utils';
|
|
5
|
-
import { InputStyle } from '
|
|
5
|
+
import { InputStyle } from '<%= basepath %>/form-field';
|
|
6
6
|
|
|
7
7
|
@Component({
|
|
8
8
|
selector: '<%= name %>-input-otp',
|
|
9
9
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
providers: [
|
|
10
|
+
providers: [aliasInputOtp(InputOtp)],
|
|
11
11
|
imports: [InputStyle, RangePipe, NgbOtpInput, NgbOtpValue, NumberOnly],
|
|
12
12
|
template: `
|
|
13
13
|
@for (num of size(); track $index; let l = $last) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, input } from '@angular/core';
|
|
2
|
-
import { NgbPagination, NgbPaginationBtn } from '@ngbase/adk/pagination';
|
|
2
|
+
import { aliasPagination, NgbPagination, NgbPaginationBtn } from '@ngbase/adk/pagination';
|
|
3
3
|
import { Button } from '<%= basepath %>/button';
|
|
4
4
|
import { Icon } from '<%= basepath %>/icon';
|
|
5
5
|
import { Option, Select } from '<%= basepath %>/select';
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
|
|
14
14
|
@Component({
|
|
15
15
|
selector: '<%= name %>-pagination',
|
|
16
|
-
providers: [
|
|
16
|
+
providers: [aliasPagination(Pagination)],
|
|
17
17
|
viewProviders: [
|
|
18
18
|
provideIcons({
|
|
19
19
|
lucideChevronLeft,
|
|
@@ -1,50 +1,27 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
|
|
2
2
|
import {
|
|
3
|
+
aliasPopover,
|
|
3
4
|
NgbPopover,
|
|
5
|
+
NgbPopoverArrow,
|
|
4
6
|
NgbPopoverBackdrop,
|
|
5
7
|
NgbPopoverClose,
|
|
6
8
|
NgbPopoverMain,
|
|
7
9
|
ngbPopoverPortal,
|
|
8
10
|
NgbPopoverTrigger,
|
|
9
|
-
providePopover,
|
|
10
11
|
registerNgbPopover,
|
|
11
12
|
} from '@ngbase/adk/popover';
|
|
12
13
|
|
|
13
14
|
@Component({
|
|
14
15
|
selector: '<%= name %>-popover',
|
|
15
16
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
-
providers: [
|
|
17
|
-
imports: [NgbPopoverBackdrop, NgbPopoverMain],
|
|
18
|
-
template: ` <
|
|
19
|
-
.popover-anchor {
|
|
20
|
-
--action-angle: 180deg;
|
|
21
|
-
--action-left: 50%;
|
|
22
|
-
--action-top: -1rem;
|
|
23
|
-
}
|
|
24
|
-
.popover-anchor::before {
|
|
25
|
-
content: '';
|
|
26
|
-
position: absolute;
|
|
27
|
-
width: 0;
|
|
28
|
-
height: 0;
|
|
29
|
-
border-style: solid;
|
|
30
|
-
border-top: 0.8rem solid;
|
|
31
|
-
@apply border-foreground;
|
|
32
|
-
border-left: 0.5rem solid transparent;
|
|
33
|
-
border-right: 0.5rem solid transparent;
|
|
34
|
-
top: var(--action-top);
|
|
35
|
-
left: var(--action-left);
|
|
36
|
-
transform: translateX(-50%) rotate(var(--action-angle, 180deg));
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
39
|
-
<div
|
|
17
|
+
providers: [aliasPopover(Popover)],
|
|
18
|
+
imports: [NgbPopoverBackdrop, NgbPopoverMain, NgbPopoverArrow],
|
|
19
|
+
template: ` <div
|
|
40
20
|
ngbPopoverMain
|
|
41
21
|
[@slideInOutAnimation]
|
|
42
|
-
class="
|
|
43
|
-
'menu-container pointer-events-auto fixed z-10 flex flex-col rounded-lg border bg-foreground shadow-md ' +
|
|
44
|
-
(options().anchor ? 'popover-anchor ' : 'overflow-auto ')
|
|
45
|
-
}}"
|
|
22
|
+
class="menu-container pointer-events-auto fixed z-10 flex flex-col rounded-lg border bg-foreground shadow-md"
|
|
46
23
|
>
|
|
47
|
-
<div class="flex flex-1 flex-col overflow-auto">
|
|
24
|
+
<div class="flex flex-1 flex-col overflow-auto" ngbPopoverArrow>
|
|
48
25
|
<ng-container #myDialog />
|
|
49
26
|
</div>
|
|
50
27
|
</div>
|
|
@@ -21,20 +21,15 @@ export class RadioGroup {}
|
|
|
21
21
|
<button
|
|
22
22
|
<%= name %>FocusStyle
|
|
23
23
|
ngbRadioIndicator
|
|
24
|
-
|
|
25
|
-
class="custom-radio relative flex h-4 w-4 flex-none items-center justify-center rounded-full border border-primary"
|
|
26
|
-
[class]="radioIndicator.disabled() ? 'border-muted' : 'border-primary'"
|
|
24
|
+
class="custom-radio relative flex h-4 w-4 flex-none items-center justify-center rounded-full border border-primary group-aria-[disabled='true']:border-muted"
|
|
27
25
|
>
|
|
28
|
-
|
|
29
|
-
class="h-2 w-2 rounded-full"
|
|
30
|
-
[class]="radioIndicator.disabled() ? 'bg-muted' : 'bg-primary'"
|
|
31
|
-
></div>
|
|
26
|
+
<div class="h-2 w-2 rounded-full bg-primary group-aria-[disabled='true']:bg-muted"></div>
|
|
32
27
|
</button>
|
|
33
28
|
<ng-content />
|
|
34
29
|
`,
|
|
35
30
|
host: {
|
|
36
31
|
class:
|
|
37
|
-
'flex items-center gap-2 py-1 cursor-pointer aria-[disabled="true"]:opacity-40 aria-[disabled="true"]:cursor-not-allowed',
|
|
32
|
+
'flex items-center gap-2 py-1 cursor-pointer aria-[disabled="true"]:opacity-40 aria-[disabled="true"]:cursor-not-allowed group',
|
|
38
33
|
},
|
|
39
34
|
})
|
|
40
35
|
export class Radio {}
|