@spartan-ng/cli 0.0.1-alpha.715 → 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/migrate-module-imports/import-map.js +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/avatar/files/lib/hlm-avatar-fallback.ts.template +1 -1
- package/src/generators/ui/libs/avatar/files/lib/hlm-avatar-image.ts.template +1 -1
- package/src/generators/ui/libs/breadcrumb/files/index.ts.template +0 -5
- package/src/generators/ui/libs/calendar/files/lib/hlm-calendar-multi.ts.template +1 -0
- package/src/generators/ui/libs/calendar/files/lib/hlm-calendar-range.ts.template +1 -0
- package/src/generators/ui/libs/calendar/files/lib/hlm-calendar.ts.template +1 -0
- 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/command/files/lib/hlm-command-dialog.ts.template +2 -2
- package/src/generators/ui/libs/command/files/lib/hlm-command-empty.ts.template +1 -1
- package/src/generators/ui/libs/command/files/lib/hlm-command-group-label.ts.template +1 -1
- package/src/generators/ui/libs/command/files/lib/hlm-command-group.ts.template +1 -1
- package/src/generators/ui/libs/command/files/lib/hlm-command-input.ts.template +7 -6
- package/src/generators/ui/libs/command/files/lib/hlm-command-item.ts.template +1 -1
- package/src/generators/ui/libs/command/files/lib/hlm-command-list.ts.template +1 -1
- package/src/generators/ui/libs/command/files/lib/hlm-command-separator.ts.template +1 -1
- package/src/generators/ui/libs/command/files/lib/hlm-command-shortcut.ts.template +1 -1
- package/src/generators/ui/libs/command/files/lib/hlm-command.ts.template +1 -1
- package/src/generators/ui/libs/context-menu/files/lib/hlm-context-menu-trigger.ts.template +3 -0
- 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/dropdown-menu/files/index.ts.template +3 -0
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-checkbox-indicator.ts.template +3 -2
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-checkbox.ts.template +30 -10
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-group.ts.template +1 -3
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-item-sub-indicator.ts.template +2 -2
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-item.ts.template +1 -1
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-label.ts.template +4 -4
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-radio-indicator.ts.template +5 -4
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-radio.ts.template +24 -9
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-separator.ts.template +2 -4
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-shortcut.ts.template +2 -4
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-sub-trigger.ts.template +44 -0
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-sub.ts.template +1 -4
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-trigger.ts.template +1 -3
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu.ts.template +1 -1
- package/src/generators/ui/libs/input/files/lib/hlm-input.ts.template +1 -0
- 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-content.ts.template +1 -0
- 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 +2 -11
- package/src/generators/ui/libs/progress/files/lib/hlm-progress-indicator.ts.template +5 -1
- package/src/generators/ui/libs/progress/files/lib/hlm-progress.ts.template +1 -0
- 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/libs/switch/files/lib/hlm-switch-thumb.ts.template +1 -0
- package/src/generators/ui/libs/switch/files/lib/hlm-switch.ts.template +1 -0
- package/src/generators/ui/primitive-deps.js +1 -0
- package/src/generators/ui/primitive-deps.js.map +1 -1
- package/src/generators/ui/primitives.d.ts +1 -1
- package/src/generators/ui/style-luma.css +15 -165
- package/src/generators/ui/style-lyra.css +13 -163
- package/src/generators/ui/style-maia.css +14 -164
- package/src/generators/ui/style-mira.css +13 -163
- package/src/generators/ui/style-nova.css +15 -165
- package/src/generators/ui/style-vega.css +16 -166
- package/src/generators/ui/supported-ui-libraries.json +46 -43
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ exports.default = {
|
|
|
40
40
|
HlmAutocompleteModule: 'HlmAutocompleteImports',
|
|
41
41
|
HlmAvatarModule: 'HlmAvatarImports',
|
|
42
42
|
HlmBadgeModule: 'HlmBadgeImports',
|
|
43
|
-
HlmBreadCrumbModule: '
|
|
43
|
+
HlmBreadCrumbModule: 'HlmBreadcrumbImports',
|
|
44
44
|
HlmButtonModule: 'HlmButtonImports',
|
|
45
45
|
HlmCalendarModule: 'HlmCalendarImports',
|
|
46
46
|
HlmCardModule: 'HlmCardImports',
|
|
@@ -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
|
],
|
|
@@ -25,6 +25,7 @@ import type { ClassValue } from 'clsx';
|
|
|
25
25
|
imports: [BrnCalendarImports, NgIcon, HlmIcon, NgTemplateOutlet, HlmSelectImports],
|
|
26
26
|
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
27
27
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
|
+
host: { 'data-slot': 'calendar' },
|
|
28
29
|
template: `
|
|
29
30
|
<div
|
|
30
31
|
brnCalendarMulti
|
|
@@ -25,6 +25,7 @@ import type { ClassValue } from 'clsx';
|
|
|
25
25
|
imports: [BrnCalendarImports, NgIcon, HlmIcon, HlmSelectImports, NgTemplateOutlet],
|
|
26
26
|
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
27
27
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
|
+
host: { 'data-slot': 'calendar' },
|
|
28
29
|
template: `
|
|
29
30
|
<div
|
|
30
31
|
brnCalendarRange
|
|
@@ -25,6 +25,7 @@ import type { ClassValue } from 'clsx';
|
|
|
25
25
|
imports: [BrnCalendarImports, NgIcon, HlmIcon, HlmSelectImports, NgTemplateOutlet],
|
|
26
26
|
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
27
27
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
|
+
host: { 'data-slot': 'calendar' },
|
|
28
29
|
template: `
|
|
29
30
|
<div
|
|
30
31
|
brnCalendar
|
|
@@ -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
|
],
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
linkedSignal,
|
|
9
9
|
output,
|
|
10
10
|
} from '@angular/core';
|
|
11
|
-
import {
|
|
11
|
+
import { BrnDialogState } from '@spartan-ng/brain/dialog';
|
|
12
12
|
import { HlmDialogImports } from '<%- importAlias %>/dialog';
|
|
13
13
|
import { hlm } from '<%- importAlias %>/utils';
|
|
14
14
|
import { ClassValue } from 'clsx';
|
|
15
15
|
|
|
16
16
|
@Component({
|
|
17
17
|
selector: 'hlm-command-dialog',
|
|
18
|
-
imports: [HlmDialogImports
|
|
18
|
+
imports: [HlmDialogImports],
|
|
19
19
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
20
|
template: `
|
|
21
21
|
<hlm-dialog [state]="_state()" (stateChanged)="stateChanged($event)">
|
|
@@ -16,6 +16,6 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
16
16
|
})
|
|
17
17
|
export class HlmCommandGroup {
|
|
18
18
|
constructor() {
|
|
19
|
-
classes(() => '
|
|
19
|
+
classes(() => 'spartan-command-group block data-hidden:hidden');
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -10,20 +10,21 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
10
10
|
imports: [HlmInputGroupImports, NgIcon, BrnCommandInput],
|
|
11
11
|
providers: [provideIcons({ lucideSearch })],
|
|
12
12
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
host: {
|
|
14
|
+
'data-slot': 'command-input-wrapper',
|
|
15
|
+
},
|
|
13
16
|
template: `
|
|
14
|
-
<hlm-input-group
|
|
15
|
-
class="bg-input/30 border-input/30 h-8 rounded-lg shadow-none *:data-[slot=input-group-addon]:pl-2"
|
|
16
|
-
>
|
|
17
|
+
<hlm-input-group class="spartan-command-input-group">
|
|
17
18
|
<input
|
|
18
19
|
brnCommandInput
|
|
19
20
|
data-slot="command-input"
|
|
20
|
-
class="
|
|
21
|
+
class="spartan-command-input outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
|
|
21
22
|
[id]="inputId()"
|
|
22
23
|
[placeholder]="placeholder()"
|
|
23
24
|
/>
|
|
24
25
|
|
|
25
26
|
<hlm-input-group-addon>
|
|
26
|
-
<ng-icon name="lucideSearch" />
|
|
27
|
+
<ng-icon name="lucideSearch" class="spartan-command-input-icon" />
|
|
27
28
|
</hlm-input-group-addon>
|
|
28
29
|
</hlm-input-group>
|
|
29
30
|
`,
|
|
@@ -33,6 +34,6 @@ export class HlmCommandInput {
|
|
|
33
34
|
public readonly placeholder = input<string>('');
|
|
34
35
|
|
|
35
36
|
constructor() {
|
|
36
|
-
classes(() => '
|
|
37
|
+
classes(() => 'spartan-command-input-wrapper');
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -19,7 +19,7 @@ export class HlmCommandItem {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
classes(
|
|
21
21
|
() =>
|
|
22
|
-
|
|
22
|
+
'spartan-command-item group/command-item w-full data-disabled:pointer-events-none data-disabled:opacity-50 data-hidden:hidden [&>ng-icon]:pointer-events-none [&>ng-icon]:shrink-0',
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -16,6 +16,6 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
16
16
|
})
|
|
17
17
|
export class HlmCommandList {
|
|
18
18
|
constructor() {
|
|
19
|
-
classes(() => '
|
|
19
|
+
classes(() => 'spartan-command-list overflow-x-hidden overflow-y-auto');
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -11,6 +11,6 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
11
11
|
})
|
|
12
12
|
export class HlmCommandSeparator {
|
|
13
13
|
constructor() {
|
|
14
|
-
classes(() => '
|
|
14
|
+
classes(() => 'spartan-command-separator block data-hidden:hidden');
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -17,6 +17,6 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
17
17
|
})
|
|
18
18
|
export class HlmCommand {
|
|
19
19
|
constructor() {
|
|
20
|
-
classes(() => '
|
|
20
|
+
classes(() => 'spartan-command flex size-full flex-col overflow-hidden');
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -3,6 +3,7 @@ import { CdkContextMenuTrigger } from '@angular/cdk/menu';
|
|
|
3
3
|
import { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { createMenuPosition, type MenuAlign, type MenuSide } from '@spartan-ng/brain/core';
|
|
6
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
6
7
|
import { injectHlmContextMenuConfig } from './hlm-context-menu-token';
|
|
7
8
|
|
|
8
9
|
@Directive({
|
|
@@ -50,5 +51,7 @@ export class HlmContextMenuTrigger {
|
|
|
50
51
|
effect(() => {
|
|
51
52
|
this._cdkTrigger.menuPosition = this._menuPosition();
|
|
52
53
|
});
|
|
54
|
+
|
|
55
|
+
classes(() => 'select-none');
|
|
53
56
|
}
|
|
54
57
|
}
|
|
@@ -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 {}
|
|
@@ -10,6 +10,7 @@ import { HlmDropdownMenuRadioIndicator } from './lib/hlm-dropdown-menu-radio-ind
|
|
|
10
10
|
import { HlmDropdownMenuSeparator } from './lib/hlm-dropdown-menu-separator';
|
|
11
11
|
import { HlmDropdownMenuShortcut } from './lib/hlm-dropdown-menu-shortcut';
|
|
12
12
|
import { HlmDropdownMenuSub } from './lib/hlm-dropdown-menu-sub';
|
|
13
|
+
import { HlmDropdownMenuSubTrigger } from './lib/hlm-dropdown-menu-sub-trigger';
|
|
13
14
|
|
|
14
15
|
import { HlmDropdownMenuTrigger } from './lib/hlm-dropdown-menu-trigger';
|
|
15
16
|
|
|
@@ -25,6 +26,7 @@ export * from './lib/hlm-dropdown-menu-radio-indicator';
|
|
|
25
26
|
export * from './lib/hlm-dropdown-menu-separator';
|
|
26
27
|
export * from './lib/hlm-dropdown-menu-shortcut';
|
|
27
28
|
export * from './lib/hlm-dropdown-menu-sub';
|
|
29
|
+
export * from './lib/hlm-dropdown-menu-sub-trigger';
|
|
28
30
|
export * from './lib/hlm-dropdown-menu-token';
|
|
29
31
|
export * from './lib/hlm-dropdown-menu-trigger';
|
|
30
32
|
|
|
@@ -41,5 +43,6 @@ export const HlmDropdownMenuImports = [
|
|
|
41
43
|
HlmDropdownMenuSeparator,
|
|
42
44
|
HlmDropdownMenuShortcut,
|
|
43
45
|
HlmDropdownMenuSub,
|
|
46
|
+
HlmDropdownMenuSubTrigger,
|
|
44
47
|
HlmDropdownMenuTrigger,
|
|
45
48
|
] as const;
|
|
@@ -8,15 +8,16 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
8
8
|
imports: [NgIcon],
|
|
9
9
|
providers: [provideIcons({ lucideCheck })],
|
|
10
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
host: { 'data-slot': 'dropdown-menu-checkbox-item-indicator' },
|
|
11
12
|
template: `
|
|
12
|
-
<ng-icon
|
|
13
|
+
<ng-icon name="lucideCheck" />
|
|
13
14
|
`,
|
|
14
15
|
})
|
|
15
16
|
export class HlmDropdownMenuCheckboxIndicator {
|
|
16
17
|
constructor() {
|
|
17
18
|
classes(
|
|
18
19
|
() =>
|
|
19
|
-
'
|
|
20
|
+
'spartan-dropdown-menu-item-indicator pointer-events-none opacity-0 group-data-checked/dropdown-menu-checkbox:opacity-100',
|
|
20
21
|
);
|
|
21
22
|
}
|
|
22
23
|
}
|