@spartan-ng/cli 0.0.1-alpha.336 → 0.0.1-alpha.337
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/base/versions.d.ts +1 -1
- package/src/generators/base/versions.js +1 -1
- package/src/generators/ui/generator.js +2 -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 +6 -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-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/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 +6 -16
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-header.directive.ts.template +6 -15
- 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 +14 -15
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +29 -17
- 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/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 +6 -11
- 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 +3 -7
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-title.directive.ts.template +5 -11
- package/src/generators/ui/libs/ui-hover-card-helm/files/lib/hlm-hover-card-content.component.ts.template +2 -7
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.spec.ts.template +3 -3
- 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-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 +114 -81
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, Directive, Input, signal } from '@angular/core';
|
|
1
|
+
import { computed, Directive, input, Input, signal } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { cva, VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -28,7 +28,7 @@ export const buttonVariants = cva(
|
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
);
|
|
31
|
-
type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
31
|
+
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
32
32
|
|
|
33
33
|
@Directive({
|
|
34
34
|
selector: '[hlmBtn]',
|
|
@@ -38,10 +38,15 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
|
38
38
|
},
|
|
39
39
|
})
|
|
40
40
|
export class HlmButtonDirective {
|
|
41
|
-
private readonly
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
private readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
42
|
+
private readonly _settableClass = signal<ClassValue>('');
|
|
43
|
+
|
|
44
|
+
protected _computedClass = computed(() =>
|
|
45
|
+
hlm(buttonVariants({ variant: this._variant(), size: this._size() }), this._settableClass(), this._userClass()),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
setClass(value: ClassValue) {
|
|
49
|
+
this._settableClass.set(value);
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
private readonly _variant = signal<ButtonVariants['variant']>('default');
|
|
@@ -55,9 +60,4 @@ export class HlmButtonDirective {
|
|
|
55
60
|
set size(size: ButtonVariants['size']) {
|
|
56
61
|
this._size.set(size);
|
|
57
62
|
}
|
|
58
|
-
|
|
59
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
60
|
-
private _generateClass() {
|
|
61
|
-
return hlm(buttonVariants({ variant: this._variant(), size: this._size() }), this._userCls());
|
|
62
|
-
}
|
|
63
63
|
}
|
package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-content.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 { cva, VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -17,14 +17,6 @@ export type CardContentVariants = VariantProps<typeof cardContentVariants>;
|
|
|
17
17
|
},
|
|
18
18
|
})
|
|
19
19
|
export class HlmCardContentDirective {
|
|
20
|
-
private readonly
|
|
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(cardContentVariants(), this._userCls());
|
|
29
|
-
}
|
|
20
|
+
private readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
+
protected _computedClass = computed(() => hlm(cardContentVariants(), this._userClass()));
|
|
30
22
|
}
|
package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-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 { cva, VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -17,14 +17,6 @@ export type CardDescriptionVariants = VariantProps<typeof cardDescriptionVariant
|
|
|
17
17
|
},
|
|
18
18
|
})
|
|
19
19
|
export class HlmCardDescriptionDirective {
|
|
20
|
-
private readonly
|
|
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(cardDescriptionVariants(), this._userCls());
|
|
29
|
-
}
|
|
20
|
+
private readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
+
protected _computedClass = computed(() => hlm(cardDescriptionVariants(), this._userClass()));
|
|
30
22
|
}
|
|
@@ -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 { cva, VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -24,20 +24,10 @@ export type CardFooterVariants = VariantProps<typeof cardFooterVariants>;
|
|
|
24
24
|
},
|
|
25
25
|
})
|
|
26
26
|
export class HlmCardFooterDirective {
|
|
27
|
-
private readonly
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
27
|
+
private readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
28
|
+
protected _computedClass = computed(() =>
|
|
29
|
+
hlm(cardFooterVariants({ direction: this.direction() }), this._userClass()),
|
|
30
|
+
);
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
@Input()
|
|
35
|
-
set direction(direction: CardFooterVariants['direction']) {
|
|
36
|
-
this._direction.set(direction);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
40
|
-
private _generateClass() {
|
|
41
|
-
return hlm(cardFooterVariants({ direction: this._direction() }), this._userCls());
|
|
42
|
-
}
|
|
32
|
+
public readonly direction = input<CardFooterVariants['direction']>('row');
|
|
43
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, Directive,
|
|
1
|
+
import { computed, Directive, input, signal } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { cva, VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -24,20 +24,11 @@ export type CardHeaderVariants = VariantProps<typeof cardHeaderVariants>;
|
|
|
24
24
|
},
|
|
25
25
|
})
|
|
26
26
|
export class HlmCardHeaderDirective {
|
|
27
|
-
private readonly
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
27
|
+
private readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
28
|
+
protected _computedClass = computed(() =>
|
|
29
|
+
hlm(cardHeaderVariants({ direction: this._direction() }), this._userClass()),
|
|
30
|
+
);
|
|
32
31
|
|
|
33
32
|
private readonly _direction = signal<CardHeaderVariants['direction']>('column');
|
|
34
|
-
|
|
35
|
-
set direction(direction: CardHeaderVariants['direction']) {
|
|
36
|
-
this._direction.set(direction);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
40
|
-
private _generateClass() {
|
|
41
|
-
return hlm(cardHeaderVariants({ direction: this._direction() }), this._userCls());
|
|
42
|
-
}
|
|
33
|
+
public readonly direction = input<CardHeaderVariants['direction']>('column');
|
|
43
34
|
}
|
|
@@ -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 { cva, VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -17,14 +17,6 @@ export type CardTitleVariants = VariantProps<typeof cardTitleVariants>;
|
|
|
17
17
|
},
|
|
18
18
|
})
|
|
19
19
|
export class HlmCardTitleDirective {
|
|
20
|
-
private readonly
|
|
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(cardTitleVariants(), this._userCls());
|
|
29
|
-
}
|
|
20
|
+
private readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
+
protected _computedClass = computed(() => hlm(cardTitleVariants(), this._userClass()));
|
|
30
22
|
}
|
|
@@ -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 { cva, VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -20,14 +20,6 @@ export type CardVariants = VariantProps<typeof cardVariants>;
|
|
|
20
20
|
},
|
|
21
21
|
})
|
|
22
22
|
export class HlmCardDirective {
|
|
23
|
-
private readonly
|
|
24
|
-
|
|
25
|
-
set class(userCls: ClassValue) {
|
|
26
|
-
this._userCls.set(userCls);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
30
|
-
private _generateClass() {
|
|
31
|
-
return hlm(cardVariants(), this._userCls());
|
|
32
|
-
}
|
|
23
|
+
private readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
24
|
+
protected _computedClass = computed(() => hlm(cardVariants(), this._userClass()));
|
|
33
25
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { HlmCarouselContentComponent } from './lib/hlm-carousel-content.component';
|
|
3
|
+
import { HlmCarouselItemComponent } from './lib/hlm-carousel-item.component';
|
|
4
|
+
import { HlmCarouselNextComponent } from './lib/hlm-carousel-next.component';
|
|
5
|
+
import { HlmCarouselPreviousComponent } from './lib/hlm-carousel-previous.component';
|
|
6
|
+
import { HlmCarouselComponent } from './lib/hlm-carousel.component';
|
|
7
|
+
|
|
8
|
+
export * from './lib/hlm-carousel-content.component';
|
|
9
|
+
export * from './lib/hlm-carousel-item.component';
|
|
10
|
+
export * from './lib/hlm-carousel-next.component';
|
|
11
|
+
export * from './lib/hlm-carousel-previous.component';
|
|
12
|
+
export * from './lib/hlm-carousel.component';
|
|
13
|
+
|
|
14
|
+
export const HlmCarouselImports = [
|
|
15
|
+
HlmCarouselComponent,
|
|
16
|
+
HlmCarouselContentComponent,
|
|
17
|
+
HlmCarouselItemComponent,
|
|
18
|
+
HlmCarouselPreviousComponent,
|
|
19
|
+
HlmCarouselNextComponent,
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
@NgModule({
|
|
23
|
+
imports: [...HlmCarouselImports],
|
|
24
|
+
exports: [...HlmCarouselImports],
|
|
25
|
+
})
|
|
26
|
+
export class HlmCarouselModule {}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-content.component.ts.template
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'hlm-carousel-content',
|
|
8
|
+
standalone: true,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
encapsulation: ViewEncapsulation.None,
|
|
11
|
+
host: {
|
|
12
|
+
'[class]': '_computedClass()',
|
|
13
|
+
},
|
|
14
|
+
template: `
|
|
15
|
+
<ng-content />
|
|
16
|
+
`,
|
|
17
|
+
})
|
|
18
|
+
export class HlmCarouselContentComponent {
|
|
19
|
+
private orientation = inject(HlmCarouselComponent).orientation;
|
|
20
|
+
|
|
21
|
+
_userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
|
+
protected _computedClass = computed(() =>
|
|
23
|
+
hlm('flex', this.orientation() === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', this._userClass()),
|
|
24
|
+
);
|
|
25
|
+
}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-item.component.ts.template
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'hlm-carousel-item',
|
|
8
|
+
standalone: true,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
encapsulation: ViewEncapsulation.None,
|
|
11
|
+
host: {
|
|
12
|
+
'[class]': '_computedClass()',
|
|
13
|
+
role: 'group',
|
|
14
|
+
'aria-roledescription': 'slide',
|
|
15
|
+
},
|
|
16
|
+
template: `
|
|
17
|
+
<ng-content />
|
|
18
|
+
`,
|
|
19
|
+
})
|
|
20
|
+
export class HlmCarouselItemComponent {
|
|
21
|
+
_userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
|
+
private orientation = inject(HlmCarouselComponent).orientation;
|
|
23
|
+
protected _computedClass = computed(() =>
|
|
24
|
+
hlm('min-w-0 shrink-0 grow-0 basis-full', this.orientation() === 'horizontal' ? 'pl-4' : 'pt-4', this._userClass()),
|
|
25
|
+
);
|
|
26
|
+
}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-next.component.ts.template
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ViewEncapsulation,
|
|
5
|
+
computed,
|
|
6
|
+
effect,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
|
+
untracked,
|
|
10
|
+
} from '@angular/core';
|
|
11
|
+
import { lucideArrowRight } from '@ng-icons/lucide';
|
|
12
|
+
import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
|
|
13
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
14
|
+
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
15
|
+
import { ClassValue } from 'clsx';
|
|
16
|
+
import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
20
|
+
selector: 'button[hlm-carousel-next], button[hlmCarouselNext]',
|
|
21
|
+
standalone: true,
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
encapsulation: ViewEncapsulation.None,
|
|
24
|
+
host: {
|
|
25
|
+
'[disabled]': 'isDisabled()',
|
|
26
|
+
'(click)': 'carousel.scrollNext()',
|
|
27
|
+
},
|
|
28
|
+
hostDirectives: [{ directive: HlmButtonDirective, inputs: ['variant', 'size'] }],
|
|
29
|
+
providers: [provideIcons({ lucideArrowRight })],
|
|
30
|
+
imports: [HlmIconComponent],
|
|
31
|
+
template: `
|
|
32
|
+
<hlm-icon size="sm" name="lucideArrowRight" />
|
|
33
|
+
<span class="sr-only">Next slide</span>
|
|
34
|
+
`,
|
|
35
|
+
})
|
|
36
|
+
export class HlmCarouselNextComponent {
|
|
37
|
+
protected carousel = inject(HlmCarouselComponent);
|
|
38
|
+
_userClass = input<ClassValue>('', { alias: 'class' });
|
|
39
|
+
protected _computedClass = computed(() =>
|
|
40
|
+
hlm(
|
|
41
|
+
'absolute h-8 w-8 rounded-full',
|
|
42
|
+
this.carousel.orientation() === 'horizontal'
|
|
43
|
+
? '-right-12 top-1/2 -translate-y-1/2'
|
|
44
|
+
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
45
|
+
this._userClass(),
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
protected isDisabled = () => !this.carousel.canScrollNext();
|
|
49
|
+
|
|
50
|
+
constructor() {
|
|
51
|
+
const button = inject(HlmButtonDirective);
|
|
52
|
+
|
|
53
|
+
button.variant = 'outline';
|
|
54
|
+
button.size = 'icon';
|
|
55
|
+
|
|
56
|
+
effect(() => {
|
|
57
|
+
const computedClass = this._computedClass();
|
|
58
|
+
|
|
59
|
+
untracked(() => button.setClass(computedClass));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ViewEncapsulation,
|
|
5
|
+
computed,
|
|
6
|
+
effect,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
|
+
untracked,
|
|
10
|
+
} from '@angular/core';
|
|
11
|
+
import { lucideArrowLeft } from '@ng-icons/lucide';
|
|
12
|
+
import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
|
|
13
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
14
|
+
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
15
|
+
import { ClassValue } from 'clsx';
|
|
16
|
+
import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
20
|
+
selector: 'button[hlm-carousel-previous], button[hlmCarouselPrevious]',
|
|
21
|
+
standalone: true,
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
encapsulation: ViewEncapsulation.None,
|
|
24
|
+
host: {
|
|
25
|
+
'[disabled]': 'isDisabled()',
|
|
26
|
+
'(click)': 'carousel.scrollPrev()',
|
|
27
|
+
},
|
|
28
|
+
hostDirectives: [{ directive: HlmButtonDirective, inputs: ['variant', 'size'] }],
|
|
29
|
+
providers: [provideIcons({ lucideArrowLeft })],
|
|
30
|
+
imports: [HlmIconComponent],
|
|
31
|
+
template: `
|
|
32
|
+
<hlm-icon size="sm" name="lucideArrowLeft" />
|
|
33
|
+
<span class="sr-only">Previous slide</span>
|
|
34
|
+
`,
|
|
35
|
+
})
|
|
36
|
+
export class HlmCarouselPreviousComponent {
|
|
37
|
+
protected carousel = inject(HlmCarouselComponent);
|
|
38
|
+
_userClass = input<ClassValue>('', { alias: 'class' });
|
|
39
|
+
protected _computedClass = computed(() =>
|
|
40
|
+
hlm(
|
|
41
|
+
'absolute h-8 w-8 rounded-full',
|
|
42
|
+
this.carousel.orientation() === 'horizontal'
|
|
43
|
+
? '-left-12 top-1/2 -translate-y-1/2'
|
|
44
|
+
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
45
|
+
this._userClass(),
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
protected isDisabled = () => !this.carousel.canScrollPrev();
|
|
49
|
+
|
|
50
|
+
constructor() {
|
|
51
|
+
const button = inject(HlmButtonDirective);
|
|
52
|
+
|
|
53
|
+
button.variant = 'outline';
|
|
54
|
+
button.size = 'icon';
|
|
55
|
+
|
|
56
|
+
effect(() => {
|
|
57
|
+
const computedClass = this._computedClass();
|
|
58
|
+
|
|
59
|
+
untracked(() => button.setClass(computedClass));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
HostListener,
|
|
5
|
+
InputSignal,
|
|
6
|
+
Signal,
|
|
7
|
+
ViewChild,
|
|
8
|
+
ViewEncapsulation,
|
|
9
|
+
computed,
|
|
10
|
+
input,
|
|
11
|
+
signal,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
14
|
+
import { ClassValue } from 'clsx';
|
|
15
|
+
import { EmblaCarouselDirective, EmblaEventType, EmblaPluginType, type EmblaOptionsType } from 'embla-carousel-angular';
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'hlm-carousel',
|
|
19
|
+
standalone: true,
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
encapsulation: ViewEncapsulation.None,
|
|
22
|
+
host: {
|
|
23
|
+
'[class]': '_computedClass()',
|
|
24
|
+
role: 'region',
|
|
25
|
+
'aria-roledescription': 'carousel',
|
|
26
|
+
},
|
|
27
|
+
imports: [EmblaCarouselDirective],
|
|
28
|
+
template: `
|
|
29
|
+
<div
|
|
30
|
+
emblaCarousel
|
|
31
|
+
class="overflow-hidden"
|
|
32
|
+
[plugins]="plugins()"
|
|
33
|
+
[options]="emblaOptions()"
|
|
34
|
+
[subscribeToEvents]="['init', 'select', 'reInit']"
|
|
35
|
+
(emblaChange)="onEmblaEvent($event)"
|
|
36
|
+
>
|
|
37
|
+
<ng-content select="hlm-carousel-content" />
|
|
38
|
+
</div>
|
|
39
|
+
<ng-content />
|
|
40
|
+
`,
|
|
41
|
+
})
|
|
42
|
+
export class HlmCarouselComponent {
|
|
43
|
+
@ViewChild(EmblaCarouselDirective) protected emblaCarousel?: EmblaCarouselDirective;
|
|
44
|
+
|
|
45
|
+
_userClass = input<ClassValue>('', { alias: 'class' });
|
|
46
|
+
protected _computedClass = computed(() => hlm('relative', this._userClass()));
|
|
47
|
+
|
|
48
|
+
orientation = input<'horizontal' | 'vertical'>('horizontal');
|
|
49
|
+
options: InputSignal<Omit<EmblaOptionsType, 'axis'> | undefined> = input();
|
|
50
|
+
plugins: InputSignal<EmblaPluginType[]> = input([] as EmblaPluginType[]);
|
|
51
|
+
|
|
52
|
+
protected emblaOptions: Signal<EmblaOptionsType> = computed(() => ({
|
|
53
|
+
...this.options(),
|
|
54
|
+
axis: this.orientation() === 'horizontal' ? 'x' : 'y',
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
private _canScrollPrev = signal(false);
|
|
58
|
+
canScrollPrev = this._canScrollPrev.asReadonly();
|
|
59
|
+
private _canScrollNext = signal(false);
|
|
60
|
+
canScrollNext = this._canScrollNext.asReadonly();
|
|
61
|
+
|
|
62
|
+
protected onEmblaEvent(event: EmblaEventType) {
|
|
63
|
+
const emblaApi = this.emblaCarousel?.emblaApi;
|
|
64
|
+
|
|
65
|
+
if (!emblaApi) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (event === 'select' || event === 'init' || event === 'reInit') {
|
|
70
|
+
this._canScrollPrev.set(emblaApi.canScrollPrev());
|
|
71
|
+
this._canScrollNext.set(emblaApi.canScrollNext());
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@HostListener('keydown', ['$event'])
|
|
76
|
+
protected onKeydown(event: KeyboardEvent) {
|
|
77
|
+
if (event.key === 'ArrowLeft') {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
this.emblaCarousel?.scrollPrev();
|
|
80
|
+
} else if (event.key === 'ArrowRight') {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
this.emblaCarousel?.scrollNext();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
scrollPrev() {
|
|
87
|
+
this.emblaCarousel?.scrollPrev();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
scrollNext() {
|
|
91
|
+
this.emblaCarousel?.scrollNext();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const generator_1 = require("../../../base/generator");
|
|
6
|
+
function generator(tree, options) {
|
|
7
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
return yield (0, generator_1.default)(tree, Object.assign(Object.assign({}, options), { primitiveName: 'carousel', internalName: 'ui-carousel-helm', publicName: 'ui-carousel-helm' }));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
exports.generator = generator;
|
|
12
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-carousel-helm/generator.ts"],"names":[],"mappings":";;;;AACA,uDAAuD;AAGvD,SAAsB,SAAS,CAAC,IAAU,EAAE,OAA+B;;QAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,kCAC9B,OAAO,KACV,aAAa,EAAE,UAAU,EACzB,YAAY,EAAE,kBAAkB,EAChC,UAAU,EAAE,kBAAkB,IAC7B,CAAC;IACJ,CAAC;CAAA;AAPD,8BAOC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, computed, inject, Input, signal } from '@angular/core';
|
|
2
|
-
import {
|
|
1
|
+
import { Component, computed, inject, input, Input, signal } 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,7 +9,7 @@ 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
|
},
|
|
@@ -20,24 +20,23 @@ import { ClassValue } from 'clsx';
|
|
|
20
20
|
export class HlmCheckboxCheckIconComponent {
|
|
21
21
|
private _brnCheckbox = inject(BrnCheckboxComponent);
|
|
22
22
|
protected _checked = this._brnCheckbox?.isChecked;
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
23
|
+
// TODO - this cannot be private for some reason
|
|
24
|
+
// build fails because hlm-checkbox.component.ts is giving the following error:
|
|
25
|
+
// Property '_userClass' is private and only accessible within class 'HlmCheckboxCheckIconComponent'.
|
|
26
|
+
// it should work as private but it doesn't
|
|
27
|
+
readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
28
28
|
|
|
29
|
-
protected readonly _iconName = signal<string>('
|
|
29
|
+
protected readonly _iconName = signal<string>('lucideCheck');
|
|
30
30
|
@Input()
|
|
31
31
|
set iconName(iconName: string) {
|
|
32
32
|
this._iconName.set(iconName);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
protected _computedClass = computed(() =>
|
|
36
|
-
|
|
37
|
-
return hlm(
|
|
35
|
+
protected _computedClass = computed(() =>
|
|
36
|
+
hlm(
|
|
38
37
|
'h-4 w-4 leading-none group-data-[state=unchecked]:opacity-0',
|
|
39
38
|
this._checked() === 'indeterminate' ? 'opacity-50' : '',
|
|
40
|
-
this.
|
|
41
|
-
)
|
|
42
|
-
|
|
39
|
+
this._userClass(),
|
|
40
|
+
),
|
|
41
|
+
);
|
|
43
42
|
}
|
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';
|
|
@@ -24,7 +34,7 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
24
34
|
[disabled]="_disabled()"
|
|
25
35
|
[id]="id"
|
|
26
36
|
>
|
|
27
|
-
<hlm-checkbox-checkicon [iconName]="_checkIconName()" />
|
|
37
|
+
<hlm-checkbox-checkicon [class]="_checkIconClass()" [iconName]="_checkIconName()" />
|
|
28
38
|
</brn-checkbox>
|
|
29
39
|
`,
|
|
30
40
|
host: {
|
|
@@ -37,17 +47,28 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
37
47
|
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
38
48
|
})
|
|
39
49
|
export class HlmCheckboxComponent {
|
|
40
|
-
private readonly
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
private readonly _userClass = input<ClassValue>('', { alias: 'class' });
|
|
51
|
+
protected _computedClass = computed(() =>
|
|
52
|
+
hlm(
|
|
53
|
+
'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' +
|
|
54
|
+
' 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',
|
|
55
|
+
this._disabled() ? 'cursor-not-allowed opacity-50' : '',
|
|
56
|
+
this._userClass(),
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
protected readonly _checkIconName = signal<string>('lucideCheck');
|
|
46
61
|
@Input()
|
|
47
62
|
set checkIconName(checkIconName: string) {
|
|
48
63
|
this._checkIconName.set(checkIconName);
|
|
49
64
|
}
|
|
50
65
|
|
|
66
|
+
protected readonly _checkIconClass = signal<string>('');
|
|
67
|
+
@Input()
|
|
68
|
+
set checkIconClass(checkIconName: string) {
|
|
69
|
+
this._checkIconClass.set(checkIconName);
|
|
70
|
+
}
|
|
71
|
+
|
|
51
72
|
@Output()
|
|
52
73
|
public changed = new EventEmitter<boolean>();
|
|
53
74
|
|
|
@@ -88,15 +109,6 @@ export class HlmCheckboxComponent {
|
|
|
88
109
|
@Input('aria-describedby')
|
|
89
110
|
ariaDescribedby: string | null = null;
|
|
90
111
|
|
|
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
112
|
/** CONROL VALUE ACCESSOR */
|
|
101
113
|
|
|
102
114
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|