@spartan-ng/cli 0.0.1-alpha.336 → 0.0.1-alpha.338
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 +4 -4
- package/src/generators/base/generator.js +8 -3
- package/src/generators/base/generator.js.map +1 -1
- package/src/generators/base/lib/build-dependency-array.js +1 -0
- package/src/generators/base/lib/build-dependency-array.js.map +1 -1
- package/src/generators/base/versions.d.ts +2 -1
- package/src/generators/base/versions.js +3 -2
- package/src/generators/base/versions.js.map +1 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.js.map +1 -1
- package/src/generators/ui/generator.js +9 -2
- package/src/generators/ui/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-content.directive.ts.template +3 -8
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-icon.directive.ts.template +7 -11
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-item.directive.ts.template +9 -9
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-trigger.directive.ts.template +3 -8
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion.directive.ts.template +4 -9
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-cancel-button.directive.ts.template +3 -8
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-content.component.ts.template +3 -8
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-description.directive.ts.template +3 -8
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-footer.component.ts.template +3 -7
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-header.component.ts.template +3 -7
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-overlay.directive.ts.template +3 -7
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-title.directive.ts.template +3 -7
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog.component.ts.template +1 -2
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-description.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-title.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-aspect-ratio-helm/files/lib/helm-aspect-ratio.directive.ts.template +3 -8
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.spec.ts.template +10 -6
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-badge-helm/files/lib/hlm-badge.directive.ts.template +5 -14
- package/src/generators/ui/libs/ui-button-helm/files/.DS_Store.template +0 -0
- package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.directive.ts.template +11 -11
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-content.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-description.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-footer.directive.ts.template +4 -16
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-header.directive.ts.template +4 -16
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-title.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-carousel-helm/files/index.ts.template +26 -0
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-content.component.ts.template +25 -0
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-item.component.ts.template +26 -0
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-next.component.ts.template +62 -0
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-previous.component.ts.template +62 -0
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel.component.ts.template +93 -0
- package/src/generators/ui/libs/ui-carousel-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-carousel-helm/generator.js +12 -0
- package/src/generators/ui/libs/ui-carousel-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox-checkicon.component.ts.template +11 -20
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +50 -46
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog-close-button.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template +8 -14
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-empty.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-group.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-input-wrapper.component.ts.template +5 -14
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-input.directive.ts.template +7 -12
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item-icon.directive.ts.template +3 -10
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item.directive.ts.template +7 -12
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-list.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-shortcut.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-dialog-helm/files/.DS_Store.template +0 -0
- package/src/generators/ui/libs/ui-dialog-helm/files/index.ts.template +1 -0
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-close.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-content.component.ts.template +24 -17
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-description.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-footer.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-header.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-overlay.directive.ts.template +9 -13
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-title.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog.component.ts.template +1 -2
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog.service.ts.template +35 -0
- package/src/generators/ui/libs/ui-hover-card-helm/files/lib/hlm-hover-card-content.component.ts.template +3 -10
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.spec.ts.template +3 -3
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.ts.template +4 -4
- package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input-error.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.directive.ts.template +5 -10
- package/src/generators/ui/libs/ui-label-helm/files/lib/hlm-label.directive.ts.template +4 -10
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar-item.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-check.component.ts.template +12 -14
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-checkbox.directive.ts.template +8 -21
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-icon.directive.ts.template +3 -10
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.component.ts.template +12 -14
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.directive.ts.template +8 -21
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-sub-indicator.component.ts.template +6 -14
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item.directive.ts.template +5 -15
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-label.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-separator.component.ts.template +3 -11
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-shortcut.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu.component.ts.template +4 -12
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-sub-menu.component.ts.template +7 -13
- package/src/generators/ui/libs/ui-pagination-helm/files/index.ts.template +33 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-content.directive.ts.template +21 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-ellipsis.componet.ts.template +23 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-item.directive.ts.template +22 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-link.directive.ts.template +56 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-next.componet.ts.template +31 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-previous.componet.ts.template +31 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination.directive.ts.template +25 -0
- package/src/generators/ui/libs/ui-pagination-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-pagination-helm/generator.js +12 -0
- package/src/generators/ui/libs/ui-pagination-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-close.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-content.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress-indicator.directive.ts.template +5 -11
- package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress.directive.ts.template +5 -11
- package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-group.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-indicator.component.ts.template +3 -11
- package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio.directive.ts.template +5 -11
- package/src/generators/ui/libs/ui-select-helm/files/index.ts.template +38 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-content.directive.ts.template +34 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-group.directive.ts.template +22 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-label.directive.ts.template +38 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-option.component.ts.template +54 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-scroll-down.component.ts.template +17 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-scroll-up.component.ts.template +17 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-trigger.component.ts.template +44 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-value.directive.ts.template +26 -0
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select.directive.ts.template +21 -0
- package/src/generators/ui/libs/ui-select-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-select-helm/generator.js +12 -0
- package/src/generators/ui/libs/ui-select-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-separator-helm/files/lib/hlm-separator.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-close.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-content.component.ts.template +6 -14
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-description.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-footer.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-header.component.ts.template +3 -11
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-overlay.directive.ts.template +11 -17
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-title.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet.component.ts.template +1 -2
- package/src/generators/ui/libs/ui-skeleton-helm/files/lib/hlm-skeleton.component.ts.template +3 -11
- package/src/generators/ui/libs/ui-spinner-helm/files/lib/hlm-spinner.component.ts.template +5 -11
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-thumb.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.component.ts.template +19 -14
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-caption.component.ts.template +10 -28
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-table.component.ts.template +11 -27
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-td.component.ts.template +8 -12
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-th.component.ts.template +22 -23
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-trow.component.ts.template +7 -24
- package/src/generators/ui/libs/ui-tabs-helm/files/index.ts.template +8 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-content.directive.ts.template +9 -21
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-list.component.ts.template +5 -17
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-trigger.directive.ts.template +9 -21
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs.component.ts.template +17 -0
- package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle-group.directive.ts.template +7 -13
- package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle.directive.ts.template +5 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-blockquote.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-code.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h1.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h2.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h3.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h4.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-large.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-lead.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-muted.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-p.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-small.directive.ts.template +3 -11
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-ul.directive.ts.template +3 -11
- package/src/generators/ui/supported-ui-libraries.json +115 -81
- package/src/utils/get-project-names.js.map +1 -1
- package/src/utils/version-utils.js.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, computed, inject,
|
|
2
|
-
import {
|
|
1
|
+
import { Component, computed, inject, input } from '@angular/core';
|
|
2
|
+
import { lucideCheck } from '@ng-icons/lucide';
|
|
3
3
|
import { BrnCheckboxComponent } from '@spartan-ng/ui-checkbox-brain';
|
|
4
4
|
import { hlm } from '@spartan-ng/ui-core';
|
|
5
5
|
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
@@ -9,35 +9,26 @@ import { ClassValue } from 'clsx';
|
|
|
9
9
|
selector: 'hlm-checkbox-checkicon',
|
|
10
10
|
standalone: true,
|
|
11
11
|
imports: [HlmIconComponent],
|
|
12
|
-
providers: [provideIcons({
|
|
12
|
+
providers: [provideIcons({ lucideCheck })],
|
|
13
13
|
host: {
|
|
14
14
|
'[class]': '_computedClass()',
|
|
15
15
|
},
|
|
16
16
|
template: `
|
|
17
|
-
<hlm-icon size="sm" [name]="
|
|
17
|
+
<hlm-icon size="sm" [name]="iconName()" />
|
|
18
18
|
`,
|
|
19
19
|
})
|
|
20
20
|
export class HlmCheckboxCheckIconComponent {
|
|
21
21
|
private _brnCheckbox = inject(BrnCheckboxComponent);
|
|
22
22
|
protected _checked = this._brnCheckbox?.isChecked;
|
|
23
|
-
|
|
24
|
-
@Input()
|
|
25
|
-
set class(userCls: ClassValue) {
|
|
26
|
-
this._userCls.set(userCls);
|
|
27
|
-
}
|
|
23
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
@Input()
|
|
31
|
-
set iconName(iconName: string) {
|
|
32
|
-
this._iconName.set(iconName);
|
|
33
|
-
}
|
|
25
|
+
public readonly iconName = input<string>('lucideCheck');
|
|
34
26
|
|
|
35
|
-
protected _computedClass = computed(() =>
|
|
36
|
-
|
|
37
|
-
return hlm(
|
|
27
|
+
protected _computedClass = computed(() =>
|
|
28
|
+
hlm(
|
|
38
29
|
'h-4 w-4 leading-none group-data-[state=unchecked]:opacity-0',
|
|
39
30
|
this._checked() === 'indeterminate' ? 'opacity-50' : '',
|
|
40
|
-
this.
|
|
41
|
-
)
|
|
42
|
-
|
|
31
|
+
this.userClass(),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
43
34
|
}
|
package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
Input,
|
|
5
|
+
Output,
|
|
6
|
+
booleanAttribute,
|
|
7
|
+
computed,
|
|
8
|
+
forwardRef,
|
|
9
|
+
input,
|
|
10
|
+
signal,
|
|
11
|
+
} from '@angular/core';
|
|
2
12
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
13
|
import { BrnCheckboxComponent, indeterminateBooleanAttribute } from '@spartan-ng/ui-checkbox-brain';
|
|
4
14
|
import { hlm } from '@spartan-ng/ui-core';
|
|
@@ -17,14 +27,19 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
17
27
|
imports: [BrnCheckboxComponent, HlmCheckboxCheckIconComponent],
|
|
18
28
|
template: `
|
|
19
29
|
<brn-checkbox
|
|
30
|
+
[id]="id()"
|
|
31
|
+
[name]="name()"
|
|
20
32
|
[class]="_computedClass()"
|
|
21
33
|
[checked]="_checked()"
|
|
34
|
+
[disabled]="disabled()"
|
|
35
|
+
[required]="required()"
|
|
36
|
+
[aria-label]="ariaLabel()"
|
|
37
|
+
[aria-labelledby]="ariaLabelledby()"
|
|
38
|
+
[aria-describedby]="ariaDescribedby()"
|
|
22
39
|
(changed)="_handleChange()"
|
|
23
40
|
(touched)="_onTouched()"
|
|
24
|
-
[disabled]="_disabled()"
|
|
25
|
-
[id]="id"
|
|
26
41
|
>
|
|
27
|
-
<hlm-checkbox-checkicon [iconName]="
|
|
42
|
+
<hlm-checkbox-checkicon [class]="checkIconClass()" [iconName]="checkIconName()" />
|
|
28
43
|
</brn-checkbox>
|
|
29
44
|
`,
|
|
30
45
|
host: {
|
|
@@ -37,22 +52,41 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
37
52
|
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
38
53
|
})
|
|
39
54
|
export class HlmCheckboxComponent {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
56
|
+
protected _computedClass = computed(() =>
|
|
57
|
+
hlm(
|
|
58
|
+
'group inline-flex border border-foreground shrink-0 cursor-pointer items-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring' +
|
|
59
|
+
' focus-visible:ring-offset-2 focus-visible:ring-offset-background data-[state=checked]:text-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-background',
|
|
60
|
+
this.userClass(),
|
|
61
|
+
this.disabled() ? 'cursor-not-allowed opacity-50' : '',
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
/** Used to set the id on the underlying brn element. */
|
|
66
|
+
public readonly id = input<string | null>(null);
|
|
67
|
+
|
|
68
|
+
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
69
|
+
public readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });
|
|
70
|
+
|
|
71
|
+
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
72
|
+
public readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });
|
|
73
|
+
|
|
74
|
+
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
75
|
+
public readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });
|
|
76
|
+
|
|
77
|
+
public readonly name = input<string | null>(null);
|
|
78
|
+
public readonly disabled = input(false, { transform: booleanAttribute });
|
|
79
|
+
public readonly required = input(false, { transform: booleanAttribute });
|
|
80
|
+
|
|
81
|
+
// icon inputs
|
|
82
|
+
public readonly checkIconName = input<string>('lucideCheck');
|
|
83
|
+
public readonly checkIconClass = input<string>('');
|
|
50
84
|
|
|
51
85
|
@Output()
|
|
52
86
|
public changed = new EventEmitter<boolean>();
|
|
53
87
|
|
|
54
88
|
protected _handleChange(): void {
|
|
55
|
-
if (this.
|
|
89
|
+
if (this.disabled()) return;
|
|
56
90
|
|
|
57
91
|
const previousChecked = this._checked();
|
|
58
92
|
this._checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
|
|
@@ -60,43 +94,13 @@ export class HlmCheckboxComponent {
|
|
|
60
94
|
this.changed.emit(!previousChecked);
|
|
61
95
|
}
|
|
62
96
|
|
|
97
|
+
// TODO should be changed to new model input when updated to Angular 17.2
|
|
63
98
|
protected _checked = signal<boolean | 'indeterminate'>(false);
|
|
64
99
|
@Input({ transform: indeterminateBooleanAttribute })
|
|
65
100
|
set checked(value: boolean | 'indeterminate') {
|
|
66
101
|
this._checked.set(value);
|
|
67
102
|
}
|
|
68
103
|
|
|
69
|
-
protected readonly _disabled = signal(false);
|
|
70
|
-
@Input({ transform: booleanAttribute })
|
|
71
|
-
set disabled(value: boolean) {
|
|
72
|
-
this._disabled.set(value);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** Used to set the id on the underlying brn element. */
|
|
76
|
-
@Input()
|
|
77
|
-
id: string | null = null;
|
|
78
|
-
|
|
79
|
-
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
80
|
-
@Input('aria-label')
|
|
81
|
-
ariaLabel: string | null = null;
|
|
82
|
-
|
|
83
|
-
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
84
|
-
@Input('aria-labelledby')
|
|
85
|
-
ariaLabelledby: string | null = null;
|
|
86
|
-
|
|
87
|
-
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
88
|
-
@Input('aria-describedby')
|
|
89
|
-
ariaDescribedby: string | null = null;
|
|
90
|
-
|
|
91
|
-
protected _computedClass = computed(() =>
|
|
92
|
-
hlm(
|
|
93
|
-
'group inline-flex border border-foreground shrink-0 cursor-pointer items-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring' +
|
|
94
|
-
' focus-visible:ring-offset-2 focus-visible:ring-offset-background data-[state=checked]:text-background data-[state=unchecked]:bg-foreground data-[state=checked]:bg-primary data-[state=unchecked]:bg-background',
|
|
95
|
-
this._disabled() ? 'cursor-not-allowed opacity-50' : '',
|
|
96
|
-
this._userCls(),
|
|
97
|
-
),
|
|
98
|
-
);
|
|
99
|
-
|
|
100
104
|
/** CONROL VALUE ACCESSOR */
|
|
101
105
|
|
|
102
106
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Directive, computed, inject, input } from '@angular/core';
|
|
2
2
|
import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
|
|
3
3
|
import { hlm } from '@spartan-ng/ui-core';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -17,14 +17,6 @@ export class HlmCommandDialogCloseButtonDirective {
|
|
|
17
17
|
this._hlmBtn.variant = 'ghost';
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
set class(userCls: ClassValue) {
|
|
23
|
-
this._userCls.set(userCls);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
27
|
-
private _generateClass() {
|
|
28
|
-
return hlm('!p-1 !h-5 !w-5', this._userCls());
|
|
29
|
-
}
|
|
20
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
+
protected _computedClass = computed(() => hlm('!p-1 !h-5 !w-5', this.userClass()));
|
|
30
22
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Directive, ElementRef, Renderer2, computed, effect, inject, input, signal } from '@angular/core';
|
|
2
2
|
import { hlm, injectExposesStateProvider } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import { HlmCommandDirective } from './hlm-command.directive';
|
|
@@ -17,23 +17,17 @@ export class HlmCommandDialogDirective {
|
|
|
17
17
|
private _renderer = inject(Renderer2);
|
|
18
18
|
private _element = inject(ElementRef);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
+
protected _computedClass = computed(() =>
|
|
22
|
+
hlm(
|
|
23
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%]',
|
|
24
|
+
this.userClass(),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
25
27
|
|
|
26
28
|
constructor() {
|
|
27
29
|
effect(() => {
|
|
28
30
|
this._renderer.setAttribute(this._element.nativeElement, 'data-state', this.state());
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
33
|
-
private _generateClass() {
|
|
34
|
-
return hlm(
|
|
35
|
-
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%]',
|
|
36
|
-
this._userCls(),
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
33
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-empty.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -10,14 +10,6 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmCommandEmptyDirective {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
set class(userCls: ClassValue) {
|
|
16
|
-
this._userCls.set(userCls);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
20
|
-
private _generateClass() {
|
|
21
|
-
return hlm('py-6 text-center text-sm', this._userCls());
|
|
22
|
-
}
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected _computedClass = computed(() => hlm('py-6 text-center text-sm', this.userClass()));
|
|
23
15
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-group.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -10,19 +10,13 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmCommandGroupDirective {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this._userCls.set(userCls);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
20
|
-
private _generateClass() {
|
|
21
|
-
return hlm(
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected _computedClass = computed(() =>
|
|
15
|
+
hlm(
|
|
22
16
|
'block [&[cmdk-hidden="true"]]:hidden\n' +
|
|
23
17
|
'[&_.cmdk-group-label]:px-2 [&_.cmdk-group-label]:py-1.5 [&_.cmdk-group-label]:text-xs [&_.cmdk-group-label]:font-medium [&_.cmdk-group-label]:text-muted-foreground\n' +
|
|
24
18
|
'[&_.cmdk-group-content]:flex [&_.cmdk-group-content]:flex-col [&_.cmdk-group-content]:flex-col overflow-hidden p-1 text-foreground',
|
|
25
|
-
this.
|
|
26
|
-
)
|
|
27
|
-
|
|
19
|
+
this.userClass(),
|
|
20
|
+
),
|
|
21
|
+
);
|
|
28
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -11,17 +11,8 @@ import { ClassValue } from 'clsx';
|
|
|
11
11
|
},
|
|
12
12
|
})
|
|
13
13
|
export class HlmCommandInputWrapperComponent {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
21
|
-
private _generateClass() {
|
|
22
|
-
return hlm(
|
|
23
|
-
'flex space-x-2 items-center border-b border-border px-3 [&_hlm-icon]:h-5 [&_hlm-icon]:w-5',
|
|
24
|
-
this._userCls(),
|
|
25
|
-
);
|
|
26
|
-
}
|
|
14
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
+
protected _computedClass = computed(() =>
|
|
16
|
+
hlm('flex space-x-2 items-center border-b border-border px-3 [&_hlm-icon]:h-5 [&_hlm-icon]:w-5', this.userClass()),
|
|
17
|
+
);
|
|
27
18
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-input.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -10,17 +10,12 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmCommandInputDirective {
|
|
13
|
-
|
|
14
|
-
@Input()
|
|
15
|
-
set class(userCls: ClassValue) {
|
|
16
|
-
this._userCls.set(userCls);
|
|
17
|
-
}
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
18
14
|
|
|
19
|
-
protected _computedClass = computed(() =>
|
|
20
|
-
|
|
21
|
-
return hlm(
|
|
15
|
+
protected _computedClass = computed(() =>
|
|
16
|
+
hlm(
|
|
22
17
|
'h-11 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
|
|
23
|
-
this.
|
|
24
|
-
)
|
|
25
|
-
|
|
18
|
+
this.userClass(),
|
|
19
|
+
),
|
|
20
|
+
);
|
|
26
21
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item-icon.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, Directive, inject,
|
|
1
|
+
import { computed, Directive, inject, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { HlmIconComponent } from '@spartan-ng/ui-icon-helm';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -17,14 +17,7 @@ export class HlmCommandItemIconDirective {
|
|
|
17
17
|
if (!this._menuIcon) return;
|
|
18
18
|
this._menuIcon.size = 'none';
|
|
19
19
|
}
|
|
20
|
-
private readonly _userCls = signal<ClassValue>('');
|
|
21
|
-
@Input()
|
|
22
|
-
set class(userCls: ClassValue) {
|
|
23
|
-
this._userCls.set(userCls);
|
|
24
|
-
}
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return hlm('mr-2 h-4 w-4', this._userCls());
|
|
29
|
-
}
|
|
21
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
|
+
protected _computedClass = computed(() => hlm('mr-2 h-4 w-4', this.userClass()));
|
|
30
23
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, Directive,
|
|
1
|
+
import { computed, Directive, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -14,20 +14,15 @@ import { ClassValue } from 'clsx';
|
|
|
14
14
|
},
|
|
15
15
|
})
|
|
16
16
|
export class HlmCommandItemDirective {
|
|
17
|
-
|
|
18
|
-
@Input()
|
|
19
|
-
set class(userCls: ClassValue) {
|
|
20
|
-
this._userCls.set(userCls);
|
|
21
|
-
}
|
|
17
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
18
|
|
|
23
|
-
protected _computedClass = computed(() =>
|
|
24
|
-
|
|
25
|
-
return hlm(
|
|
19
|
+
protected _computedClass = computed(() =>
|
|
20
|
+
hlm(
|
|
26
21
|
'items-center relative cursor-default select-none rounded-sm px-2 py-1.5 text-sm outline-none\n' +
|
|
27
22
|
'aria-selected:bg-accent aria-selected:text-accent-foreground\n' +
|
|
28
23
|
'hover:bg-accent/50\n' +
|
|
29
24
|
'disabled:pointer-events-none disabled:opacity-50',
|
|
30
|
-
this.
|
|
31
|
-
)
|
|
32
|
-
|
|
25
|
+
this.userClass(),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
33
28
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-list.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -10,14 +10,6 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmCommandListDirective {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
set class(userCls: ClassValue) {
|
|
16
|
-
this._userCls.set(userCls);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
20
|
-
private _generateClass() {
|
|
21
|
-
return hlm('max-h-[300px] overflow-y-auto overflow-x-hidden', this._userCls());
|
|
22
|
-
}
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected _computedClass = computed(() => hlm('max-h-[300px] overflow-y-auto overflow-x-hidden', this.userClass()));
|
|
23
15
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-shortcut.component.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -13,14 +13,8 @@ import { ClassValue } from 'clsx';
|
|
|
13
13
|
},
|
|
14
14
|
})
|
|
15
15
|
export class HlmCommandShortcutComponent {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
23
|
-
private _generateClass() {
|
|
24
|
-
return hlm('ml-auto font-light text-xs tracking-widest opacity-60', this._userCls());
|
|
25
|
-
}
|
|
16
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
17
|
+
protected _computedClass = computed(() =>
|
|
18
|
+
hlm('ml-auto font-light text-xs tracking-widest opacity-60', this.userClass()),
|
|
19
|
+
);
|
|
26
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -10,17 +10,11 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmCommandDirective {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this._userCls.set(userCls);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
20
|
-
private _generateClass() {
|
|
21
|
-
return hlm(
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected _computedClass = computed(() =>
|
|
15
|
+
hlm(
|
|
22
16
|
'flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground',
|
|
23
|
-
this.
|
|
24
|
-
)
|
|
25
|
-
|
|
17
|
+
this.userClass(),
|
|
18
|
+
),
|
|
19
|
+
);
|
|
26
20
|
}
|
|
Binary file
|
|
@@ -17,6 +17,7 @@ export * from './lib/hlm-dialog-header.component';
|
|
|
17
17
|
export * from './lib/hlm-dialog-overlay.directive';
|
|
18
18
|
export * from './lib/hlm-dialog-title.directive';
|
|
19
19
|
export * from './lib/hlm-dialog.component';
|
|
20
|
+
export * from './lib/hlm-dialog.service';
|
|
20
21
|
|
|
21
22
|
export const HlmDialogImports = [
|
|
22
23
|
HlmDialogComponent,
|
package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-close.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -10,17 +10,11 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmDialogCloseDirective {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this._userCls.set(userCls);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
20
|
-
private _generateClass() {
|
|
21
|
-
return hlm(
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected _computedClass = computed(() =>
|
|
15
|
+
hlm(
|
|
22
16
|
'absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',
|
|
23
|
-
this.
|
|
24
|
-
)
|
|
25
|
-
|
|
17
|
+
this.userClass(),
|
|
18
|
+
),
|
|
19
|
+
);
|
|
26
20
|
}
|
package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-content.component.ts.template
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { NgComponentOutlet } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input, ViewEncapsulation } from '@angular/core';
|
|
3
|
+
import { lucideX } from '@ng-icons/lucide';
|
|
4
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
5
|
+
import { BrnDialogCloseDirective, BrnDialogRef, injectBrnDialogContext } from '@spartan-ng/ui-dialog-brain';
|
|
5
6
|
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
6
7
|
import { ClassValue } from 'clsx';
|
|
7
8
|
import { HlmDialogCloseDirective } from './hlm-dialog-close.directive';
|
|
@@ -9,36 +10,42 @@ import { HlmDialogCloseDirective } from './hlm-dialog-close.directive';
|
|
|
9
10
|
@Component({
|
|
10
11
|
selector: 'hlm-dialog-content',
|
|
11
12
|
standalone: true,
|
|
12
|
-
imports: [BrnDialogCloseDirective, HlmDialogCloseDirective, HlmIconComponent],
|
|
13
|
-
providers: [provideIcons({
|
|
13
|
+
imports: [NgComponentOutlet, BrnDialogCloseDirective, HlmDialogCloseDirective, HlmIconComponent],
|
|
14
|
+
providers: [provideIcons({ lucideX })],
|
|
14
15
|
host: {
|
|
15
16
|
'[class]': '_computedClass()',
|
|
16
17
|
'[attr.data-state]': 'state()',
|
|
17
18
|
},
|
|
18
19
|
template: `
|
|
19
|
-
|
|
20
|
+
@if (component) {
|
|
21
|
+
<ng-container [ngComponentOutlet]="component" />
|
|
22
|
+
} @else {
|
|
23
|
+
<ng-content />
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
<button brnDialogClose hlm>
|
|
21
27
|
<span class="sr-only">Close</span>
|
|
22
|
-
<hlm-icon class="flex h-4 w-4" size="
|
|
28
|
+
<hlm-icon class="flex h-4 w-4" size="none" name="lucideX" />
|
|
23
29
|
</button>
|
|
24
30
|
`,
|
|
25
31
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
32
|
encapsulation: ViewEncapsulation.None,
|
|
27
33
|
})
|
|
28
34
|
export class HlmDialogContentComponent {
|
|
29
|
-
private readonly
|
|
30
|
-
|
|
35
|
+
private readonly _dialogRef = inject(BrnDialogRef);
|
|
36
|
+
private readonly _dialogContext = injectBrnDialogContext({ optional: true });
|
|
37
|
+
|
|
38
|
+
public readonly state = computed(() => this._dialogRef?.state() ?? 'closed');
|
|
31
39
|
|
|
32
|
-
|
|
40
|
+
public readonly component = this._dialogContext?.['$component'];
|
|
41
|
+
private readonly _dynamicComponentClass = this._dialogContext?.['$dynamicComponentClass'];
|
|
42
|
+
|
|
43
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
33
44
|
protected readonly _computedClass = computed(() =>
|
|
34
45
|
hlm(
|
|
35
46
|
'border-border grid w-full max-w-lg relative gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%] sm:rounded-lg md:w-full',
|
|
36
|
-
this.
|
|
47
|
+
this.userClass(),
|
|
48
|
+
this._dynamicComponentClass,
|
|
37
49
|
),
|
|
38
50
|
);
|
|
39
|
-
|
|
40
|
-
@Input()
|
|
41
|
-
set class(userCls: ClassValue) {
|
|
42
|
-
this._userCls.set(userCls);
|
|
43
|
-
}
|
|
44
51
|
}
|
package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-description.directive.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, Directive,
|
|
1
|
+
import { computed, Directive, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { BrnDialogDescriptionDirective } from '@spartan-ng/ui-dialog-brain';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -12,14 +12,6 @@ import { ClassValue } from 'clsx';
|
|
|
12
12
|
hostDirectives: [BrnDialogDescriptionDirective],
|
|
13
13
|
})
|
|
14
14
|
export class HlmDialogDescriptionDirective {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
set class(userCls: ClassValue) {
|
|
18
|
-
this._userCls.set(userCls);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
22
|
-
private _generateClass() {
|
|
23
|
-
return hlm('text-sm text-muted-foreground', this._userCls());
|
|
24
|
-
}
|
|
15
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
16
|
+
protected _computedClass = computed(() => hlm('text-sm text-muted-foreground', this.userClass()));
|
|
25
17
|
}
|