@spartan-ng/cli 0.0.1-alpha.716 → 0.0.1-alpha.717
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/package.json +1 -1
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-cancel.ts.template +1 -4
- package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-search.ts.template +3 -15
- package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete.ts.template +3 -15
- package/src/generators/ui/libs/combobox/files/lib/hlm-combobox-multiple.ts.template +3 -15
- package/src/generators/ui/libs/combobox/files/lib/hlm-combobox.ts.template +3 -15
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-picker-anchor.ts.template +5 -12
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-picker-multi.ts.template +2 -2
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-picker.ts.template +2 -3
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-range-picker.ts.template +2 -2
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-close.ts.template +1 -1
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-content.ts.template +8 -1
- package/src/generators/ui/libs/drawer/files/lib/hlm-drawer-close.ts.template +1 -1
- package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-content.ts.template +10 -3
- package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-item.ts.template +4 -1
- package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-link.ts.template +4 -4
- package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-list.ts.template +4 -1
- package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-trigger.ts.template +15 -4
- package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu.ts.template +6 -1
- package/src/generators/ui/libs/popover/files/index.ts.template +15 -1
- package/src/generators/ui/libs/popover/files/lib/hlm-popover-description.ts.template +12 -0
- package/src/generators/ui/libs/popover/files/lib/hlm-popover-header.ts.template +12 -0
- package/src/generators/ui/libs/popover/files/lib/hlm-popover-title.ts.template +12 -0
- package/src/generators/ui/libs/popover/files/lib/hlm-popover-trigger.ts.template +1 -3
- package/src/generators/ui/libs/popover/files/lib/hlm-popover.ts.template +1 -11
- package/src/generators/ui/libs/select/files/lib/hlm-select-multiple.ts.template +3 -15
- package/src/generators/ui/libs/select/files/lib/hlm-select.ts.template +3 -15
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-close.ts.template +1 -1
- package/src/generators/ui/style-luma.css +2 -42
- package/src/generators/ui/style-lyra.css +2 -42
- package/src/generators/ui/style-maia.css +2 -42
- package/src/generators/ui/style-mira.css +2 -42
- package/src/generators/ui/style-nova.css +2 -42
- package/src/generators/ui/style-vega.css +2 -42
- package/src/generators/ui/supported-ui-libraries.json +45 -42
package/package.json
CHANGED
|
@@ -5,10 +5,7 @@ import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
|
|
|
5
5
|
@Directive({
|
|
6
6
|
selector: 'button[hlmAlertDialogCancel]',
|
|
7
7
|
providers: [provideBrnButtonConfig({ variant: 'outline' })],
|
|
8
|
-
hostDirectives: [
|
|
9
|
-
{ directive: BrnDialogClose, inputs: ['delay'] },
|
|
10
|
-
{ directive: HlmButton, inputs: ['variant', 'size'] },
|
|
11
|
-
],
|
|
8
|
+
hostDirectives: [BrnDialogClose, { directive: HlmButton, inputs: ['variant', 'size'] }],
|
|
12
9
|
host: { 'data-slot': 'alert-dialog-cancel', '[type]': 'type()' },
|
|
13
10
|
})
|
|
14
11
|
export class HlmAlertDialogCancel {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Directive } from '@angular/core';
|
|
2
2
|
import { BrnAutocompleteSearch } from '@spartan-ng/brain/autocomplete';
|
|
3
|
-
import {
|
|
4
|
-
import { BrnPopover, provideBrnPopoverConfig } from '@spartan-ng/brain/popover';
|
|
3
|
+
import { BrnPopover, provideBrnPopoverConfig, provideBrnPopoverDefaultOptions } from '@spartan-ng/brain/popover';
|
|
5
4
|
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Directive({
|
|
@@ -11,9 +10,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
11
10
|
align: 'start',
|
|
12
11
|
sideOffset: 6,
|
|
13
12
|
}),
|
|
14
|
-
|
|
15
|
-
autoFocus: 'first-heading',
|
|
16
|
-
}),
|
|
13
|
+
provideBrnPopoverDefaultOptions({ role: null }),
|
|
17
14
|
],
|
|
18
15
|
hostDirectives: [
|
|
19
16
|
{
|
|
@@ -23,16 +20,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
23
20
|
},
|
|
24
21
|
{
|
|
25
22
|
directive: BrnPopover,
|
|
26
|
-
inputs: [
|
|
27
|
-
'align',
|
|
28
|
-
'autoFocus',
|
|
29
|
-
'closeDelay',
|
|
30
|
-
'closeOnOutsidePointerEvents',
|
|
31
|
-
'sideOffset',
|
|
32
|
-
'state',
|
|
33
|
-
'offsetX',
|
|
34
|
-
'restoreFocus',
|
|
35
|
-
],
|
|
23
|
+
inputs: ['align', 'closeOnOutsidePointerEvents', 'sideOffset', 'state', 'offsetX'],
|
|
36
24
|
outputs: ['stateChanged', 'closed'],
|
|
37
25
|
},
|
|
38
26
|
],
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Directive } from '@angular/core';
|
|
2
2
|
import { BrnAutocomplete } from '@spartan-ng/brain/autocomplete';
|
|
3
|
-
import {
|
|
4
|
-
import { BrnPopover, provideBrnPopoverConfig } from '@spartan-ng/brain/popover';
|
|
3
|
+
import { BrnPopover, provideBrnPopoverConfig, provideBrnPopoverDefaultOptions } from '@spartan-ng/brain/popover';
|
|
5
4
|
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Directive({
|
|
@@ -11,9 +10,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
11
10
|
align: 'start',
|
|
12
11
|
sideOffset: 6,
|
|
13
12
|
}),
|
|
14
|
-
|
|
15
|
-
autoFocus: 'first-heading',
|
|
16
|
-
}),
|
|
13
|
+
provideBrnPopoverDefaultOptions({ role: null }),
|
|
17
14
|
],
|
|
18
15
|
hostDirectives: [
|
|
19
16
|
{
|
|
@@ -23,16 +20,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
23
20
|
},
|
|
24
21
|
{
|
|
25
22
|
directive: BrnPopover,
|
|
26
|
-
inputs: [
|
|
27
|
-
'align',
|
|
28
|
-
'autoFocus',
|
|
29
|
-
'closeDelay',
|
|
30
|
-
'closeOnOutsidePointerEvents',
|
|
31
|
-
'sideOffset',
|
|
32
|
-
'state',
|
|
33
|
-
'offsetX',
|
|
34
|
-
'restoreFocus',
|
|
35
|
-
],
|
|
23
|
+
inputs: ['align', 'closeOnOutsidePointerEvents', 'sideOffset', 'state', 'offsetX'],
|
|
36
24
|
outputs: ['stateChanged', 'closed'],
|
|
37
25
|
},
|
|
38
26
|
],
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Directive } from '@angular/core';
|
|
2
2
|
import { BrnComboboxMultiple } from '@spartan-ng/brain/combobox';
|
|
3
|
-
import {
|
|
4
|
-
import { BrnPopover, provideBrnPopoverConfig } from '@spartan-ng/brain/popover';
|
|
3
|
+
import { BrnPopover, provideBrnPopoverConfig, provideBrnPopoverDefaultOptions } from '@spartan-ng/brain/popover';
|
|
5
4
|
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Directive({
|
|
@@ -11,9 +10,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
11
10
|
align: 'start',
|
|
12
11
|
sideOffset: 6,
|
|
13
12
|
}),
|
|
14
|
-
|
|
15
|
-
autoFocus: 'first-heading',
|
|
16
|
-
}),
|
|
13
|
+
provideBrnPopoverDefaultOptions({ role: null }),
|
|
17
14
|
],
|
|
18
15
|
hostDirectives: [
|
|
19
16
|
{
|
|
@@ -32,16 +29,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
32
29
|
},
|
|
33
30
|
{
|
|
34
31
|
directive: BrnPopover,
|
|
35
|
-
inputs: [
|
|
36
|
-
'align',
|
|
37
|
-
'autoFocus',
|
|
38
|
-
'closeDelay',
|
|
39
|
-
'closeOnOutsidePointerEvents',
|
|
40
|
-
'sideOffset',
|
|
41
|
-
'state',
|
|
42
|
-
'offsetX',
|
|
43
|
-
'restoreFocus',
|
|
44
|
-
],
|
|
32
|
+
inputs: ['align', 'closeOnOutsidePointerEvents', 'sideOffset', 'state', 'offsetX'],
|
|
45
33
|
outputs: ['stateChanged', 'closed'],
|
|
46
34
|
},
|
|
47
35
|
],
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Directive } from '@angular/core';
|
|
2
2
|
import { BrnCombobox } from '@spartan-ng/brain/combobox';
|
|
3
|
-
import {
|
|
4
|
-
import { BrnPopover, provideBrnPopoverConfig } from '@spartan-ng/brain/popover';
|
|
3
|
+
import { BrnPopover, provideBrnPopoverConfig, provideBrnPopoverDefaultOptions } from '@spartan-ng/brain/popover';
|
|
5
4
|
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Directive({
|
|
@@ -11,9 +10,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
11
10
|
align: 'start',
|
|
12
11
|
sideOffset: 6,
|
|
13
12
|
}),
|
|
14
|
-
|
|
15
|
-
autoFocus: 'first-heading',
|
|
16
|
-
}),
|
|
13
|
+
provideBrnPopoverDefaultOptions({ role: null }),
|
|
17
14
|
],
|
|
18
15
|
hostDirectives: [
|
|
19
16
|
{
|
|
@@ -32,16 +29,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
32
29
|
},
|
|
33
30
|
{
|
|
34
31
|
directive: BrnPopover,
|
|
35
|
-
inputs: [
|
|
36
|
-
'align',
|
|
37
|
-
'autoFocus',
|
|
38
|
-
'closeDelay',
|
|
39
|
-
'closeOnOutsidePointerEvents',
|
|
40
|
-
'sideOffset',
|
|
41
|
-
'state',
|
|
42
|
-
'offsetX',
|
|
43
|
-
'restoreFocus',
|
|
44
|
-
],
|
|
32
|
+
inputs: ['align', 'closeOnOutsidePointerEvents', 'sideOffset', 'state', 'offsetX'],
|
|
45
33
|
outputs: ['stateChanged', 'closed'],
|
|
46
34
|
},
|
|
47
35
|
],
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Directive, effect, ElementRef, inject, input
|
|
2
|
-
import {
|
|
1
|
+
import { Directive, effect, ElementRef, inject, input } from '@angular/core';
|
|
2
|
+
import { BrnOverlay } from '@spartan-ng/brain/overlay';
|
|
3
3
|
import { BrnPopover } from '@spartan-ng/brain/popover';
|
|
4
4
|
|
|
5
5
|
@Directive({ selector: '[hlmDatePickerAnchor]' })
|
|
6
6
|
export class HlmDatePickerAnchor {
|
|
7
7
|
private readonly _host = inject(ElementRef, { host: true });
|
|
8
|
-
private readonly
|
|
8
|
+
private readonly _brnOverlay = inject(BrnOverlay, { optional: true });
|
|
9
9
|
|
|
10
10
|
public readonly hlmDatePickerAnchorFor = input<BrnPopover | undefined>(undefined, {
|
|
11
11
|
alias: 'hlmDatePickerAnchorFor',
|
|
@@ -13,16 +13,9 @@ export class HlmDatePickerAnchor {
|
|
|
13
13
|
|
|
14
14
|
constructor() {
|
|
15
15
|
effect(() => {
|
|
16
|
-
|
|
17
|
-
untracked(() => {
|
|
18
|
-
if (!brnDialog) return;
|
|
19
|
-
brnDialog.mutableAttachTo.set(this._host.nativeElement);
|
|
20
|
-
brnDialog.mutableCloseOnOutsidePointerEvents.set(true);
|
|
21
|
-
});
|
|
16
|
+
this.hlmDatePickerAnchorFor()?.setOrigin(this._host.nativeElement);
|
|
22
17
|
});
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
this._brnDialog.mutableAttachTo.set(this._host.nativeElement);
|
|
26
|
-
this._brnDialog.mutableCloseOnOutsidePointerEvents.set(true);
|
|
19
|
+
this._brnOverlay?.setOrigin(this._host.nativeElement);
|
|
27
20
|
}
|
|
28
21
|
}
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
viewChild,
|
|
15
15
|
} from '@angular/core';
|
|
16
16
|
import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
17
|
-
import type { BrnDialogState } from '@spartan-ng/brain/dialog';
|
|
18
17
|
import { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';
|
|
19
18
|
import type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
19
|
+
import type { BrnOverlayState } from '@spartan-ng/brain/overlay';
|
|
20
20
|
import { BrnPopover } from '@spartan-ng/brain/popover';
|
|
21
21
|
import { HlmCalendarMulti } from '<%- importAlias %>/calendar';
|
|
22
22
|
import { HlmPopoverImports } from '<%- importAlias %>/popover';
|
|
@@ -115,7 +115,7 @@ export class HlmDatePickerMulti<T> implements HlmDatePickerBase<T>, ControlValue
|
|
|
115
115
|
/** Defines how the date should be transformed before saving to model/form. */
|
|
116
116
|
public readonly transformDates = input<(date: T[]) => T[]>(this._config.transformDates);
|
|
117
117
|
|
|
118
|
-
protected readonly _popoverState = signal<
|
|
118
|
+
protected readonly _popoverState = signal<BrnOverlayState | null>(null);
|
|
119
119
|
|
|
120
120
|
protected readonly _disabled = linkedSignal(this.disabled);
|
|
121
121
|
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
viewChild,
|
|
14
14
|
} from '@angular/core';
|
|
15
15
|
import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
16
|
-
import type { BrnDialogState } from '@spartan-ng/brain/dialog';
|
|
17
16
|
import { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';
|
|
18
17
|
import type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
18
|
+
import type { BrnOverlayState } from '@spartan-ng/brain/overlay';
|
|
19
19
|
import { BrnPopover } from '@spartan-ng/brain/popover';
|
|
20
20
|
import { HlmCalendar } from '<%- importAlias %>/calendar';
|
|
21
21
|
import { HlmPopoverImports } from '<%- importAlias %>/popover';
|
|
@@ -38,7 +38,6 @@ export const HLM_DATE_PICKER_VALUE_ACCESSOR = {
|
|
|
38
38
|
template: `
|
|
39
39
|
<hlm-popover
|
|
40
40
|
sideOffset="5"
|
|
41
|
-
autoFocus="first-heading"
|
|
42
41
|
[state]="_popoverState()"
|
|
43
42
|
(stateChanged)="_popoverState.set($event)"
|
|
44
43
|
(closed)="_onTouched?.()"
|
|
@@ -102,7 +101,7 @@ export class HlmDatePicker<T> implements HlmDatePickerBase<T>, ControlValueAcces
|
|
|
102
101
|
/** Defines how the date should be transformed before saving to model/form. */
|
|
103
102
|
public readonly transformDate = input<(date: T) => T>(this._config.transformDate);
|
|
104
103
|
|
|
105
|
-
protected readonly _popoverState = signal<
|
|
104
|
+
protected readonly _popoverState = signal<BrnOverlayState | null>(null);
|
|
106
105
|
|
|
107
106
|
protected readonly _disabled = linkedSignal(this.disabled);
|
|
108
107
|
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
viewChild,
|
|
15
15
|
} from '@angular/core';
|
|
16
16
|
import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
17
|
-
import type { BrnDialogState } from '@spartan-ng/brain/dialog';
|
|
18
17
|
import { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';
|
|
19
18
|
import type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
19
|
+
import type { BrnOverlayState } from '@spartan-ng/brain/overlay';
|
|
20
20
|
import { BrnPopover } from '@spartan-ng/brain/popover';
|
|
21
21
|
import { HlmCalendarRange } from '<%- importAlias %>/calendar';
|
|
22
22
|
import { HlmPopoverImports } from '<%- importAlias %>/popover';
|
|
@@ -108,7 +108,7 @@ export class HlmDateRangePicker<T> implements HlmDatePickerBase<T>, ControlValue
|
|
|
108
108
|
/** Defines how the date should be transformed before saving to model/form. */
|
|
109
109
|
public readonly transformDates = input<(date: [T, T]) => [T, T]>(this._config.transformDates);
|
|
110
110
|
|
|
111
|
-
protected readonly _popoverState = signal<
|
|
111
|
+
protected readonly _popoverState = signal<BrnOverlayState | null>(null);
|
|
112
112
|
|
|
113
113
|
protected readonly _disabled = linkedSignal(this.disabled);
|
|
114
114
|
|
|
@@ -3,7 +3,7 @@ import { BrnDialogClose } from '@spartan-ng/brain/dialog';
|
|
|
3
3
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: 'button[hlmDialogClose]',
|
|
6
|
-
hostDirectives: [
|
|
6
|
+
hostDirectives: [BrnDialogClose],
|
|
7
7
|
host: { 'data-slot': 'dialog-close' },
|
|
8
8
|
})
|
|
9
9
|
export class HlmDialogClose {}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import type { ComponentType } from '@angular/cdk/portal';
|
|
2
3
|
import { NgComponentOutlet } from '@angular/common';
|
|
3
4
|
import { booleanAttribute, ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
|
|
4
5
|
import { provideIcons } from '@ng-icons/core';
|
|
@@ -9,6 +10,12 @@ import { HlmIconImports } from '<%- importAlias %>/icon';
|
|
|
9
10
|
import { classes } from '<%- importAlias %>/utils';
|
|
10
11
|
import { HlmDialogClose } from './hlm-dialog-close';
|
|
11
12
|
|
|
13
|
+
type HlmDialogContentContext = {
|
|
14
|
+
$component?: ComponentType<unknown>;
|
|
15
|
+
$dynamicComponentClass?: string;
|
|
16
|
+
$showCloseButton?: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
12
19
|
@Component({
|
|
13
20
|
selector: 'hlm-dialog-content',
|
|
14
21
|
imports: [NgComponentOutlet, HlmIconImports, HlmButton, HlmDialogClose],
|
|
@@ -35,7 +42,7 @@ import { HlmDialogClose } from './hlm-dialog-close';
|
|
|
35
42
|
})
|
|
36
43
|
export class HlmDialogContent {
|
|
37
44
|
private readonly _dialogRef = inject(BrnDialogRef);
|
|
38
|
-
private readonly _dialogContext = injectBrnDialogContext({ optional: true });
|
|
45
|
+
private readonly _dialogContext = injectBrnDialogContext<HlmDialogContentContext | null>({ optional: true });
|
|
39
46
|
|
|
40
47
|
public readonly showCloseButton = input<boolean, BooleanInput>(this._dialogContext?.$showCloseButton ?? true, {
|
|
41
48
|
transform: booleanAttribute,
|
|
@@ -3,7 +3,7 @@ import { BrnDrawerClose } from '@spartan-ng/brain/drawer';
|
|
|
3
3
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: 'button[hlmDrawerClose]',
|
|
6
|
-
hostDirectives: [
|
|
6
|
+
hostDirectives: [BrnDrawerClose],
|
|
7
7
|
host: { 'data-slot': 'drawer-close' },
|
|
8
8
|
})
|
|
9
9
|
export class HlmDrawerClose {}
|
package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-content.ts.template
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type NumberInput } from '@angular/cdk/coercion';
|
|
2
|
+
import { Directive, input, numberAttribute } from '@angular/core';
|
|
2
3
|
import { classes } from '<%- importAlias %>/utils';
|
|
3
4
|
|
|
4
5
|
@Directive({
|
|
5
6
|
selector: '[hlmNavigationMenuContent],hlm-navigation-menu-content',
|
|
6
|
-
host: {
|
|
7
|
+
host: {
|
|
8
|
+
'data-slot': 'navigation-menu-content',
|
|
9
|
+
'[style.--nav-offset]': 'navOffset()',
|
|
10
|
+
},
|
|
7
11
|
})
|
|
8
12
|
export class HlmNavigationMenuContent {
|
|
13
|
+
public readonly navOffset = input<number, NumberInput>(1.5, { transform: numberAttribute });
|
|
14
|
+
|
|
9
15
|
constructor() {
|
|
10
16
|
classes(() => [
|
|
11
17
|
'data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out top-0 left-0 w-full p-2 pr-2.5 md:w-auto',
|
|
12
18
|
'data-[orientation=horizontal]:data-[motion=from-end]:slide-in-from-right-52 data-[orientation=horizontal]:data-[motion=from-start]:slide-in-from-left-52 data-[orientation=horizontal]:data-[motion=to-end]:slide-out-to-right-52 data-[orientation=horizontal]:data-[motion=to-start]:slide-out-to-left-52',
|
|
13
19
|
'data-[orientation=vertical]:data-[motion=from-end]:slide-in-from-bottom-52 data-[orientation=vertical]:data-[motion=from-start]:slide-in-from-top-52 data-[orientation=vertical]:data-[motion=to-end]:slide-out-to-bottom-52 data-[orientation=vertical]:data-[motion=to-start]:slide-out-to-top-52',
|
|
14
|
-
'
|
|
20
|
+
'data-[orientation=horizontal]:mt-[--spacing(var(--nav-offset))] data-[orientation=vertical]:mx-[--spacing(var(--nav-offset))]',
|
|
21
|
+
'spartan-navigation-menu-popup block',
|
|
15
22
|
]);
|
|
16
23
|
}
|
|
17
24
|
}
|
package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-item.ts.template
CHANGED
|
@@ -5,9 +5,12 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
5
5
|
@Directive({
|
|
6
6
|
selector: 'li[hlmNavigationMenuItem]',
|
|
7
7
|
hostDirectives: [{ directive: BrnNavigationMenuItem, inputs: ['id'] }],
|
|
8
|
+
host: {
|
|
9
|
+
'data-slot': 'navigation-menu-item',
|
|
10
|
+
},
|
|
8
11
|
})
|
|
9
12
|
export class HlmNavigationMenuItem {
|
|
10
13
|
constructor() {
|
|
11
|
-
classes(() => 'relative');
|
|
14
|
+
classes(() => 'relative has-[:focus]:z-10 data-active:z-10');
|
|
12
15
|
}
|
|
13
16
|
}
|
package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-link.ts.template
CHANGED
|
@@ -5,12 +5,12 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
5
5
|
@Directive({
|
|
6
6
|
selector: 'a[hlmNavigationMenuLink]',
|
|
7
7
|
hostDirectives: [{ directive: BrnNavigationMenuLink, inputs: ['active'] }],
|
|
8
|
+
host: {
|
|
9
|
+
'data-slot': 'navigation-menu-link',
|
|
10
|
+
},
|
|
8
11
|
})
|
|
9
12
|
export class HlmNavigationMenuLink {
|
|
10
13
|
constructor() {
|
|
11
|
-
classes(() =>
|
|
12
|
-
'data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_ng-icon:not([class*="text-"])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_ng-icon:not([class*="text-"])]:text-base',
|
|
13
|
-
'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',
|
|
14
|
-
]);
|
|
14
|
+
classes(() => 'spartan-navigation-menu-link');
|
|
15
15
|
}
|
|
16
16
|
}
|
package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-list.ts.template
CHANGED
|
@@ -9,11 +9,14 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
9
9
|
directive: BrnNavigationMenuList,
|
|
10
10
|
},
|
|
11
11
|
],
|
|
12
|
+
host: {
|
|
13
|
+
'data-slot': 'navigation-menu-list',
|
|
14
|
+
},
|
|
12
15
|
})
|
|
13
16
|
export class HlmNavigationMenuList {
|
|
14
17
|
constructor() {
|
|
15
18
|
classes(() => [
|
|
16
|
-
'group flex flex-1 list-none items-center justify-center
|
|
19
|
+
'spartan-navigation-menu-list group flex flex-1 list-none items-center justify-center',
|
|
17
20
|
'data-[orientation=vertical]:flex-col',
|
|
18
21
|
]);
|
|
19
22
|
}
|
package/src/generators/ui/libs/navigation-menu/files/lib/hlm-navigation-menu-trigger.ts.template
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
|
+
import { lucideChevronDown } from '@ng-icons/lucide';
|
|
2
4
|
import { BrnNavigationMenuTrigger } from '@spartan-ng/brain/navigation-menu';
|
|
3
5
|
import { classes } from '<%- importAlias %>/utils';
|
|
4
6
|
|
|
5
|
-
@
|
|
7
|
+
@Component({
|
|
8
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
6
9
|
selector: 'button[hlmNavigationMenuTrigger]',
|
|
7
|
-
|
|
10
|
+
imports: [NgIcon],
|
|
11
|
+
providers: [provideIcons({ lucideChevronDown })],
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
hostDirectives: [{ directive: BrnNavigationMenuTrigger, inputs: ['align'] }],
|
|
14
|
+
host: { 'data-slot': 'navigation-menu-trigger' },
|
|
15
|
+
template: `
|
|
16
|
+
<ng-content />
|
|
17
|
+
<ng-icon name="lucideChevronDown" class="spartan-navigation-menu-trigger-icon" />
|
|
18
|
+
`,
|
|
8
19
|
})
|
|
9
20
|
export class HlmNavigationMenuTrigger {
|
|
10
21
|
constructor() {
|
|
11
22
|
classes(
|
|
12
23
|
() =>
|
|
13
|
-
'
|
|
24
|
+
'spartan-navigation-menu-trigger group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center outline-none disabled:pointer-events-none',
|
|
14
25
|
);
|
|
15
26
|
}
|
|
16
27
|
}
|
|
@@ -11,9 +11,14 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
11
11
|
outputs: ['valueChange'],
|
|
12
12
|
},
|
|
13
13
|
],
|
|
14
|
+
host: {
|
|
15
|
+
'data-slot': 'navigation-menu',
|
|
16
|
+
},
|
|
14
17
|
})
|
|
15
18
|
export class HlmNavigationMenu {
|
|
16
19
|
constructor() {
|
|
17
|
-
classes(
|
|
20
|
+
classes(
|
|
21
|
+
() => 'spartan-navigation-menu group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',
|
|
22
|
+
);
|
|
18
23
|
}
|
|
19
24
|
}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { HlmPopover } from './lib/hlm-popover';
|
|
2
2
|
import { HlmPopoverContent } from './lib/hlm-popover-content';
|
|
3
|
+
import { HlmPopoverDescription } from './lib/hlm-popover-description';
|
|
4
|
+
import { HlmPopoverHeader } from './lib/hlm-popover-header';
|
|
3
5
|
import { HlmPopoverPortal } from './lib/hlm-popover-portal';
|
|
6
|
+
import { HlmPopoverTitle } from './lib/hlm-popover-title';
|
|
4
7
|
import { HlmPopoverTrigger } from './lib/hlm-popover-trigger';
|
|
5
8
|
|
|
6
9
|
export * from './lib/hlm-popover';
|
|
7
10
|
export * from './lib/hlm-popover-content';
|
|
11
|
+
export * from './lib/hlm-popover-description';
|
|
12
|
+
export * from './lib/hlm-popover-header';
|
|
8
13
|
export * from './lib/hlm-popover-portal';
|
|
14
|
+
export * from './lib/hlm-popover-title';
|
|
9
15
|
export * from './lib/hlm-popover-trigger';
|
|
10
16
|
|
|
11
|
-
export const HlmPopoverImports = [
|
|
17
|
+
export const HlmPopoverImports = [
|
|
18
|
+
HlmPopover,
|
|
19
|
+
HlmPopoverContent,
|
|
20
|
+
HlmPopoverDescription,
|
|
21
|
+
HlmPopoverHeader,
|
|
22
|
+
HlmPopoverPortal,
|
|
23
|
+
HlmPopoverTitle,
|
|
24
|
+
HlmPopoverTrigger,
|
|
25
|
+
] as const;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmPopoverDescription]',
|
|
6
|
+
host: { 'data-slot': 'popover-description' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmPopoverDescription {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(() => 'spartan-popover-description');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmPopoverHeader],hlm-popover-header',
|
|
6
|
+
host: { 'data-slot': 'popover-header' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmPopoverHeader {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(() => 'spartan-popover-header');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmPopoverTitle]',
|
|
6
|
+
host: { 'data-slot': 'popover-title' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmPopoverTitle {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(() => 'spartan-popover-title');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -6,8 +6,6 @@ import { BrnPopoverTrigger } from '@spartan-ng/brain/popover';
|
|
|
6
6
|
hostDirectives: [
|
|
7
7
|
{ directive: BrnPopoverTrigger, inputs: ['id', 'brnPopoverTriggerFor: hlmPopoverTriggerFor', 'type'] },
|
|
8
8
|
],
|
|
9
|
-
host: {
|
|
10
|
-
'data-slot': 'popover-trigger',
|
|
11
|
-
},
|
|
9
|
+
host: { 'data-slot': 'popover-trigger' },
|
|
12
10
|
})
|
|
13
11
|
export class HlmPopoverTrigger {}
|
|
@@ -6,17 +6,7 @@ import { BrnPopover } from '@spartan-ng/brain/popover';
|
|
|
6
6
|
hostDirectives: [
|
|
7
7
|
{
|
|
8
8
|
directive: BrnPopover,
|
|
9
|
-
inputs: [
|
|
10
|
-
'align',
|
|
11
|
-
'autoFocus',
|
|
12
|
-
'attachTo',
|
|
13
|
-
'closeDelay',
|
|
14
|
-
'closeOnOutsidePointerEvents',
|
|
15
|
-
'offsetX',
|
|
16
|
-
'restoreFocus',
|
|
17
|
-
'sideOffset',
|
|
18
|
-
'state',
|
|
19
|
-
],
|
|
9
|
+
inputs: ['align', 'attachTo', 'autoFocus', 'closeOnOutsidePointerEvents', 'offsetX', 'sideOffset', 'state'],
|
|
20
10
|
outputs: ['stateChanged', 'closed'],
|
|
21
11
|
},
|
|
22
12
|
],
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Directive } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { BrnPopover, provideBrnPopoverConfig } from '@spartan-ng/brain/popover';
|
|
2
|
+
import { BrnPopover, provideBrnPopoverConfig, provideBrnPopoverDefaultOptions } from '@spartan-ng/brain/popover';
|
|
4
3
|
import { BrnSelectMultiple } from '@spartan-ng/brain/select';
|
|
5
4
|
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
@@ -11,9 +10,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
11
10
|
align: 'start',
|
|
12
11
|
sideOffset: 6,
|
|
13
12
|
}),
|
|
14
|
-
|
|
15
|
-
autoFocus: 'first-heading',
|
|
16
|
-
}),
|
|
13
|
+
provideBrnPopoverDefaultOptions({ role: null }),
|
|
17
14
|
],
|
|
18
15
|
hostDirectives: [
|
|
19
16
|
{
|
|
@@ -23,16 +20,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
23
20
|
},
|
|
24
21
|
{
|
|
25
22
|
directive: BrnPopover,
|
|
26
|
-
inputs: [
|
|
27
|
-
'align',
|
|
28
|
-
'autoFocus',
|
|
29
|
-
'closeDelay',
|
|
30
|
-
'closeOnOutsidePointerEvents',
|
|
31
|
-
'sideOffset',
|
|
32
|
-
'state',
|
|
33
|
-
'offsetX',
|
|
34
|
-
'restoreFocus',
|
|
35
|
-
],
|
|
23
|
+
inputs: ['align', 'closeOnOutsidePointerEvents', 'sideOffset', 'state', 'offsetX'],
|
|
36
24
|
outputs: ['stateChanged', 'closed'],
|
|
37
25
|
},
|
|
38
26
|
],
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Directive } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { BrnPopover, provideBrnPopoverConfig } from '@spartan-ng/brain/popover';
|
|
2
|
+
import { BrnPopover, provideBrnPopoverConfig, provideBrnPopoverDefaultOptions } from '@spartan-ng/brain/popover';
|
|
4
3
|
import { BrnSelect } from '@spartan-ng/brain/select';
|
|
5
4
|
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
@@ -11,9 +10,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
11
10
|
align: 'start',
|
|
12
11
|
sideOffset: 6,
|
|
13
12
|
}),
|
|
14
|
-
|
|
15
|
-
autoFocus: 'first-heading',
|
|
16
|
-
}),
|
|
13
|
+
provideBrnPopoverDefaultOptions({ role: null }),
|
|
17
14
|
],
|
|
18
15
|
hostDirectives: [
|
|
19
16
|
{
|
|
@@ -23,16 +20,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
23
20
|
},
|
|
24
21
|
{
|
|
25
22
|
directive: BrnPopover,
|
|
26
|
-
inputs: [
|
|
27
|
-
'align',
|
|
28
|
-
'autoFocus',
|
|
29
|
-
'closeDelay',
|
|
30
|
-
'closeOnOutsidePointerEvents',
|
|
31
|
-
'sideOffset',
|
|
32
|
-
'state',
|
|
33
|
-
'offsetX',
|
|
34
|
-
'restoreFocus',
|
|
35
|
-
],
|
|
23
|
+
inputs: ['align', 'closeOnOutsidePointerEvents', 'sideOffset', 'state', 'offsetX'],
|
|
36
24
|
outputs: ['stateChanged', 'closed'],
|
|
37
25
|
},
|
|
38
26
|
],
|
|
@@ -3,7 +3,7 @@ import { BrnSheetClose } from '@spartan-ng/brain/sheet';
|
|
|
3
3
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: 'button[hlmSheetClose]',
|
|
6
|
-
hostDirectives: [
|
|
6
|
+
hostDirectives: [BrnSheetClose],
|
|
7
7
|
host: { 'data-slot': 'sheet-close' },
|
|
8
8
|
})
|
|
9
9
|
export class HlmSheetClose {}
|